@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.
70 lines (69 loc) • 3.34 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 { Category, ComplexType, ConditionalVisibility, ContentSection, ContentSectionTitles, DataModel, DataType, DefaultValue, Description, DisplayName, Group, KnownFieldTypes, Model, PropertyCategory, SectionsOrder, TableView, ViewSelector } from '@progress/sitefinity-widget-designers-sdk';
import { ChoiceOptionModel } from '../common/choice-option';
let ChoiceEntityBase = class ChoiceEntityBase {
Label = 'Select a choice';
InstructionalText = null;
Choices = null;
Required = false;
Hidden = false;
RequiredErrorMessage = '{0} field is required';
SfViewName = 'Default';
CssClass = null;
SfFieldType;
SfFieldName;
};
__decorate([
ContentSection(ContentSectionTitles.LabelsAndContent, 1),
DisplayName('Label or question'),
DataType(KnownFieldTypes.TextArea)
], ChoiceEntityBase.prototype, "Label", void 0);
__decorate([
ContentSection(ContentSectionTitles.LabelsAndContent, 2),
DisplayName('Instructional text'),
Description('Suitable for giving examples how the entered value will be used.')
], ChoiceEntityBase.prototype, "InstructionalText", void 0);
__decorate([
ContentSection(ContentSectionTitles.LabelsAndContent, 3),
TableView({ Selectable: true, Reorderable: true }),
DataType(ComplexType.Enumerable),
DataModel(ChoiceOptionModel)
], ChoiceEntityBase.prototype, "Choices", void 0);
__decorate([
ContentSection(ContentSectionTitles.LabelsAndContent, 5),
DisplayName('Required field'),
DataType(KnownFieldTypes.CheckBox),
Group('Options')
], ChoiceEntityBase.prototype, "Required", void 0);
__decorate([
ContentSection(ContentSectionTitles.LabelsAndContent, 6),
DisplayName('Hide field initially (use form rules to display it)'),
DataType(KnownFieldTypes.CheckBox),
Group('Options')
], ChoiceEntityBase.prototype, "Hidden", void 0);
__decorate([
ContentSection(ContentSectionTitles.LabelsAndContent, 7),
DisplayName('Error message if choice is not selected'),
DefaultValue('{0} field is required'),
ConditionalVisibility('{"conditions":[{"fieldName":"Required","operator":"Equals","value":true}]}')
], ChoiceEntityBase.prototype, "RequiredErrorMessage", void 0);
__decorate([
ViewSelector([{ Value: 'Default' }]),
ContentSection(ContentSectionTitles.DisplaySettings, 1),
DisplayName('Template')
], ChoiceEntityBase.prototype, "SfViewName", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('AdvancedMain'),
DisplayName('CSS class')
], ChoiceEntityBase.prototype, "CssClass", void 0);
ChoiceEntityBase = __decorate([
Model(),
SectionsOrder([ContentSectionTitles.LabelsAndContent, ContentSectionTitles.DisplaySettings])
], ChoiceEntityBase);
export { ChoiceEntityBase };