@progress/sitefinity-nextjs-sdk
Version:
Provides OOB widgets developed using the Next.js framework, which includes an abstraction layer for Sitefinity communication. Additionally, it offers an expanded API, typings, and tools for further development and integration.
121 lines (120 loc) • 6.55 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { DecimalNumberRange, NumberRange } from './number-range';
import { DateRange } from './date-range';
import { Choice, ComplexType, ConditionalVisibility, DataModel, DataType, DefaultValue, Description, DisplayName, DisplaySettings, KnownFieldTypes, Model, Placeholder, Range, StringLength, TableView } from '@progress/sitefinity-widget-designers-sdk';
let FacetSettings = class FacetSettings {
RangeType;
DateRanges = null;
DateStep = null;
NumberStep;
NumberRanges = null;
NumberRangesDecimal = null;
Prefix;
Suffix;
DisplayCustomRange = false;
FacetType = null;
};
__decorate([
DisplayName('Range type'),
DefaultValue(0),
DataType(KnownFieldTypes.ChipChoice),
Choice({ Choices: [{ 'Title': 'Auto', 'Name': 'Auto', 'Value': 0, 'Icon': null }, { 'Title': 'Custom', 'Name': 'Custom', 'Value': 1, 'Icon': null }] })
], FacetSettings.prototype, "RangeType", void 0);
__decorate([
TableView({ Reorderable: false, Selectable: false, MultipleSelect: false }),
DisplayName('Set ranges'),
Description('Specify the ranges for generating facets.'),
ConditionalVisibility({
'operator': 'And',
'conditions': [
{ 'fieldName': 'RangeType', 'operator': 'Equals', 'value': 1 },
{ 'fieldName': 'FacetType', 'operator': 'Equals', 'value': 'DateAndTime' }
]
}),
DataModel(DateRange),
DataType(ComplexType.Enumerable)
], FacetSettings.prototype, "DateRanges", void 0);
__decorate([
DisplayName('Set a range step'),
DataType(KnownFieldTypes.Choices),
Description('Select a step to automatically group values by time period.'),
ConditionalVisibility({ 'operator': 'And', 'conditions': [
{ 'fieldName': 'RangeType', 'operator': 'Equals', 'value': 0 },
{ 'fieldName': 'FacetType', 'operator': 'Equals', 'value': 'DateAndTime' }
] }),
Choice({ Choices: [{ 'Title': 'day', 'Name': '0', 'Value': 0, 'Icon': 'ban' }, { 'Title': 'week', 'Name': '1', 'Value': 1, 'Icon': null }, { 'Title': 'month', 'Name': '2', 'Value': 2, 'Icon': null }, { 'Title': 'quarter', 'Name': '3', 'Value': 3, 'Icon': null }, { 'Title': 'year', 'Name': '4', 'Value': 4, 'Icon': null }] })
], FacetSettings.prototype, "DateStep", void 0);
__decorate([
DisplayName('Set a range step'),
Description('Specify a step to automatically generate ranges. For example, if the step is set to 10, generated ranges will be 0 - 10, 10 - 20, 20 - 30, etc. If a step is not set, all values are displayed.'),
Placeholder('type number...'),
ConditionalVisibility({ 'operator': 'And', 'conditions': [
{ 'fieldName': 'RangeType', 'operator': 'Equals', 'value': 0 },
{ 'fieldName': 'FacetType', 'operator': 'Contains', 'value': 'Number' }
] }),
Range(1, 2147483647, 'Enter a positive number'),
DefaultValue(null),
DataType('number')
], FacetSettings.prototype, "NumberStep", void 0);
__decorate([
TableView({ Reorderable: false, Selectable: false, MultipleSelect: false }),
DisplayName('Set ranges'),
Description('Specify the ranges for generating facets.'),
ConditionalVisibility({ 'operator': 'And', 'conditions': [
{ 'fieldName': 'RangeType', 'operator': 'Equals', 'value': 1 },
{ 'fieldName': 'FacetType', 'operator': 'Equals', 'value': 'NumberWhole' }
] }),
DataModel(NumberRange),
DataType(ComplexType.Enumerable)
], FacetSettings.prototype, "NumberRanges", void 0);
__decorate([
TableView({ Reorderable: false, Selectable: false, MultipleSelect: false }),
DisplayName('Set ranges'),
Description('Specify the ranges for generating facets.'),
ConditionalVisibility({ 'operator': 'And', 'conditions': [
{ 'fieldName': 'RangeType', 'operator': 'Equals', 'value': 1 },
{ 'fieldName': 'FacetType', 'operator': 'Equals', 'value': 'NumberDecimal' }
] }),
DataModel(DecimalNumberRange),
DataType(ComplexType.Enumerable)
], FacetSettings.prototype, "NumberRangesDecimal", void 0);
__decorate([
DisplayName('Prefix'),
Description('Add text before the values, such as units, currency, etc. For example, $0 - $10, $10 - $20, $20 - $30, etc.'),
ConditionalVisibility({ 'operator': 'And', 'conditions': [
{ 'fieldName': 'RangeType', 'operator': 'Equals', 'value': 0 },
{ 'fieldName': 'FacetType', 'operator': 'Contains', 'value': 'Number' }
] }),
StringLength(20, 'Your text must be less than 20 characters'),
DefaultValue(null),
DataType('string')
], FacetSettings.prototype, "Prefix", void 0);
__decorate([
DisplayName('Suffix'),
Description('Add text after the values, such as units, currency, etc. For example, 0 in - 10 in, 10 in - 20 in, 20 in - 30 in, etc.'),
ConditionalVisibility({ 'operator': 'And', 'conditions': [{ 'fieldName': 'RangeType', 'operator': 'Equals', 'value': 0 },
{ 'fieldName': 'FacetType', 'operator': 'Contains', 'value': 'Number' }] }),
StringLength(20, 'Your text must be less than 20 characters'),
DefaultValue(null),
DataType('string')
], FacetSettings.prototype, "Suffix", void 0);
__decorate([
DisplayName('Users can enter custom values'),
Description('If enabled, empty fields for entering custom values are displayed on your site.'),
DataType(KnownFieldTypes.ChipChoice),
ConditionalVisibility({ 'operator': 'Or', 'conditions': [{ 'fieldName': 'RangeType', 'operator': 'Equals', 'value': 1 }, { 'fieldName': 'FacetType', 'operator': 'Contains', 'value': 'Number' }] }),
Choice('[{"Title":"Yes","Name":"Yes","Value":true,"Icon":null},{"Title":"No","Name":"No","Value":false,"Icon":null}]')
], FacetSettings.prototype, "DisplayCustomRange", void 0);
__decorate([
DisplaySettings(true),
DataType('string')
], FacetSettings.prototype, "FacetType", void 0);
FacetSettings = __decorate([
Model()
], FacetSettings);
export { FacetSettings };