UNPKG

@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.

143 lines (142 loc) 6.65 kB
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 { Category, Choice, ConditionalVisibility, Content, ContentSection, ContentSectionTitles, DataModel, DataType, DefaultValue, Description, DisplayName, Group, KnownFieldTypes, Placeholder, Required, ViewSelector, WidgetEntity } from '@progress/sitefinity-widget-designers-sdk'; import { SelectionMode } from './selection-modes'; import { FIELD_SIZE_OPTIONS, FieldSize } from '../../styling/field-size'; import { ClassificationSettings } from '../../common/classification-settings'; let DynamicListEntity = class DynamicListEntity { Label = 'Untitled'; InstructionalText = null; CssClass = null; ListType = SelectionMode.Content; SelectedContent = null; Required = false; Hidden = false; RequiredErrorMessage = null; OrderByContent = null; ClassificationSettings = null; OrderBy = null; SortExpression = null; SfViewName = 'Dropdown'; FieldSize = FieldSize.None; ColumnsNumber = 1; ValueFieldName = null; SfFieldType; SfFieldName; }; __decorate([ ContentSection(ContentSectionTitles.LabelsAndContent, 1), DefaultValue('Select a choice') ], DynamicListEntity.prototype, "Label", void 0); __decorate([ ContentSection(ContentSectionTitles.LabelsAndContent, 2), DisplayName('Instructional text'), Description('Suitable for giving examples how the entered value will be used.') ], DynamicListEntity.prototype, "InstructionalText", void 0); __decorate([ Category('Advanced'), ContentSection('AdvancedMain'), DisplayName('CSS class') ], DynamicListEntity.prototype, "CssClass", void 0); __decorate([ ContentSection(ContentSectionTitles.LabelsAndContent, 3), DisplayName('List type'), DataType(KnownFieldTypes.ChipChoice), Choice([{ Value: 'Content' }, { Value: 'Classification' }]) ], DynamicListEntity.prototype, "ListType", void 0); __decorate([ Content(), DisplayName(''), ContentSection(ContentSectionTitles.LabelsAndContent, 4), ConditionalVisibility('{"conditions":[{"fieldName":"ListType","operator":"Equals","value":"Content"}]}') ], DynamicListEntity.prototype, "SelectedContent", void 0); __decorate([ ContentSection(ContentSectionTitles.LabelsAndContent, 8), DisplayName('Required field'), DataType(KnownFieldTypes.CheckBox), Group('Options') ], DynamicListEntity.prototype, "Required", void 0); __decorate([ ContentSection(ContentSectionTitles.LabelsAndContent, 8), DisplayName('Hide field initially (use form rules to display it)'), DataType(KnownFieldTypes.CheckBox), Group('Options') ], DynamicListEntity.prototype, "Hidden", void 0); __decorate([ DisplayName('Error message if choice is not selected'), ContentSection(ContentSectionTitles.LabelsAndContent, 9), DefaultValue('{0} field is required'), ConditionalVisibility('{"conditions":[{"fieldName":"Required","operator":"Equals","value":true}]}') ], DynamicListEntity.prototype, "RequiredErrorMessage", void 0); __decorate([ ContentSection(ContentSectionTitles.LabelsAndContent, 5), DisplayName('Sort items'), DefaultValue('PublicationDate DESC'), DataType('dynamicChoicePerItemType'), Choice({ ServiceUrl: '/Default.Sorters()?frontend=True' }), ConditionalVisibility('{"conditions":[{"fieldName":"ListType","operator":"Equals","value":"Content"}]}') ], DynamicListEntity.prototype, "OrderByContent", void 0); __decorate([ ContentSection(ContentSectionTitles.LabelsAndContent, 4), Placeholder('Select classification'), DisplayName('Classification'), DataType('taxonSelector'), DataModel(ClassificationSettings), Required('Please select a classification'), ConditionalVisibility('{"conditions":[{"fieldName":"ListType","operator":"Equals","value":"Classification"}]}') ], DynamicListEntity.prototype, "ClassificationSettings", void 0); __decorate([ ContentSection(ContentSectionTitles.LabelsAndContent, 5), DisplayName('Sort items'), DefaultValue('Title ASC'), DataType(KnownFieldTypes.Choices), Choice({ ServiceUrl: '{0}/Default.Sorters()?frontend=True', ServiceCallParameters: '[{ "taxaUrl" : "{0}"}]' }), ConditionalVisibility('{"conditions":[{"fieldName":"ListType","operator":"Equals","value":"Classification"}]}') ], DynamicListEntity.prototype, "OrderBy", void 0); __decorate([ Category('Advanced'), DisplayName('Sort expression'), Description('Custom sort expression, used if default sorting is not suitable.') ], DynamicListEntity.prototype, "SortExpression", void 0); __decorate([ ViewSelector([{ Value: 'Checkboxes' }, { Value: 'Dropdown' }]), ContentSection(ContentSectionTitles.DisplaySettings, 1), DefaultValue('Dropdown'), DisplayName('Template') ], DynamicListEntity.prototype, "SfViewName", void 0); __decorate([ ContentSection(ContentSectionTitles.DisplaySettings, 2), DisplayName('Field size'), DataType(KnownFieldTypes.ChipChoice), DefaultValue('None'), Choice(FIELD_SIZE_OPTIONS) ], DynamicListEntity.prototype, "FieldSize", void 0); __decorate([ ContentSection(ContentSectionTitles.DisplaySettings, 3), DataType(KnownFieldTypes.Choices), ConditionalVisibility('{"conditions":[{"fieldName":"SfViewName","operator":"Equals","value":"Checkboxes"}]}'), DisplayName('Layout'), DefaultValue(1), Choice({ Choices: [ { 'Title': 'One column', 'Name': '1', 'Value': 1 }, { 'Title': 'Two columns', 'Name': '2', 'Value': 2 }, { 'Title': 'Three columns', 'Name': '3', 'Value': 3 }, { 'Title': 'Side by side', 'Name': '0', 'Value': 0 } ] }) ], DynamicListEntity.prototype, "ColumnsNumber", void 0); __decorate([ Category('Advanced'), ContentSection('AdvancedMain'), DisplayName('Value field name'), Description('Name of the field that will be used to hold the value of the selection.') ], DynamicListEntity.prototype, "ValueFieldName", void 0); DynamicListEntity = __decorate([ WidgetEntity('SitefinityDynamicList', 'Dynamic list') ], DynamicListEntity); export { DynamicListEntity };