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.

132 lines (131 loc) 6.34 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 { TextType } from './interfaces/text-type'; import { FIELD_SIZE_OPTIONS, FieldSize } from '../../styling/field-size'; import { NumericRange } from '../common/numeric-range'; import { ContentSectionTitles, KnownFieldTypes } from '@progress/sitefinity-widget-designers-sdk/common'; import { ContentSection } from '@progress/sitefinity-widget-designers-sdk/decorators/content-section'; import { DefaultValue } from '@progress/sitefinity-widget-designers-sdk/decorators/default-value'; import { Description } from '@progress/sitefinity-widget-designers-sdk/decorators/description'; import { DisplayName } from '@progress/sitefinity-widget-designers-sdk/decorators/display-name'; import { DataModel, DataType } from '@progress/sitefinity-widget-designers-sdk/decorators/data-type'; import { Group } from '@progress/sitefinity-widget-designers-sdk/decorators/group'; import { ConditionalVisibility } from '@progress/sitefinity-widget-designers-sdk/decorators/conditional-visibility'; import { Suffix } from '@progress/sitefinity-widget-designers-sdk/decorators/suffix'; import { Choice } from '@progress/sitefinity-widget-designers-sdk/decorators/choice'; import { Category } from '@progress/sitefinity-widget-designers-sdk/decorators/category'; import { WidgetEntity } from '@progress/sitefinity-widget-designers-sdk/decorators/widget-entity'; import { ViewSelector } from '@progress/sitefinity-widget-designers-sdk/decorators/view-selector'; import { Browsable } from '@progress/sitefinity-widget-designers-sdk/decorators/browsable'; let TextFieldEntity = class TextFieldEntity { Label = 'Untitled'; InstructionalText = null; InputType = TextType.Text; PlaceholderText = null; PredefinedValue = null; Required = false; Hidden = false; RequiredErrorMessage = null; Range = null; TextLengthViolationMessage = null; SfViewName = 'Default'; FieldSize = FieldSize.None; CssClass = null; RegularExpression = null; RegularExpressionViolationMessage = 'Please match the requested format'; SfFieldType; SfFieldName; }; __decorate([ ContentSection(ContentSectionTitles.LabelsAndContent, 1), DefaultValue('Untitled') ], TextFieldEntity.prototype, "Label", void 0); __decorate([ Description('Suitable for giving examples how the entered value will be used.'), ContentSection(ContentSectionTitles.LabelsAndContent, 2), DisplayName('Instructional text') ], TextFieldEntity.prototype, "InstructionalText", void 0); __decorate([ ContentSection(ContentSectionTitles.LabelsAndContent, 3), DisplayName('Field type'), Choice([{ Title: 'Text', Value: 'Text' }, { Title: 'Email', Value: 'Email' }, { Title: 'Phone', Value: 'Phone' }, { Title: 'URL', Value: 'URL' }]), DefaultValue(TextType.Text) ], TextFieldEntity.prototype, "InputType", void 0); __decorate([ ContentSection(ContentSectionTitles.LabelsAndContent, 4), DisplayName('Placeholder text') ], TextFieldEntity.prototype, "PlaceholderText", void 0); __decorate([ DisplayName('Predefined value'), ContentSection(ContentSectionTitles.LabelsAndContent, 5) ], TextFieldEntity.prototype, "PredefinedValue", void 0); __decorate([ ContentSection(ContentSectionTitles.LabelsAndContent, 6), DisplayName('Required field'), DataType(KnownFieldTypes.CheckBox), Group('Options') ], TextFieldEntity.prototype, "Required", void 0); __decorate([ ContentSection(ContentSectionTitles.LabelsAndContent, 7), DisplayName('Hide field initially (use form rules to display it)'), DataType(KnownFieldTypes.CheckBox), Group('Options') ], TextFieldEntity.prototype, "Hidden", void 0); __decorate([ DisplayName('Error message if the field is empty'), ContentSection(ContentSectionTitles.LabelsAndContent, 8), DefaultValue('{0} field is required'), ConditionalVisibility('{"conditions":[{"fieldName":"Required","operator":"Equals","value":true}]}') ], TextFieldEntity.prototype, "RequiredErrorMessage", void 0); __decorate([ ContentSection(ContentSectionTitles.Limitations), DataType(KnownFieldTypes.Range), DataModel(NumericRange), Suffix('characters') ], TextFieldEntity.prototype, "Range", void 0); __decorate([ ContentSection(ContentSectionTitles.Limitations), DisplayName('Error message displayed when the entry is out of range'), DefaultValue('{0} field input is too long') ], TextFieldEntity.prototype, "TextLengthViolationMessage", void 0); __decorate([ ContentSection(ContentSectionTitles.DisplaySettings), DisplayName('Template'), ViewSelector([{ Value: 'Default' }]) ], TextFieldEntity.prototype, "SfViewName", void 0); __decorate([ ContentSection(ContentSectionTitles.DisplaySettings), DisplayName('Field size'), DataType(KnownFieldTypes.ChipChoice), DefaultValue('None'), Choice(FIELD_SIZE_OPTIONS) ], TextFieldEntity.prototype, "FieldSize", void 0); __decorate([ Category('Advanced'), ContentSection('AdvancedMain', 2), DisplayName('CSS class') ], TextFieldEntity.prototype, "CssClass", void 0); __decorate([ Category('Advanced'), ContentSection('AdvancedMain', 3), DisplayName('Regular expression validation pattern') ], TextFieldEntity.prototype, "RegularExpression", void 0); __decorate([ Category('Advanced'), ContentSection('AdvancedMain', 4), DisplayName('Regular expression error message') ], TextFieldEntity.prototype, "RegularExpressionViolationMessage", void 0); __decorate([ Browsable(false) ], TextFieldEntity.prototype, "SfFieldType", void 0); __decorate([ Browsable(false) ], TextFieldEntity.prototype, "SfFieldName", void 0); TextFieldEntity = __decorate([ WidgetEntity('SitefinityTextField', 'Textbox') ], TextFieldEntity); export { TextFieldEntity };