@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.
75 lines (74 loc) • 3.65 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 { WidgetEntity, DisplayName, Description, ContentSection, DataType, Choice, KnownFieldTypes, Group, DefaultValue, ContentSectionTitles, Browsable, ConditionalVisibility, Category, PropertyCategory, ViewSelector } from '@progress/sitefinity-widget-designers-sdk';
import { DateFieldType } from './interfaces/date-field-type';
let DateTimeFieldEntity = class DateTimeFieldEntity {
Label = 'Untitled';
InstructionalText = null;
FieldType = DateFieldType.DateOnly;
Required = false;
Hidden = false;
RequiredErrorMessage = null;
SfViewName = 'Default';
CssClass = null;
SfFieldType;
SfFieldName;
};
__decorate([
ContentSection(ContentSectionTitles.LabelsAndContent, 1),
DefaultValue('Untitled')
], DateTimeFieldEntity.prototype, "Label", void 0);
__decorate([
DisplayName('Instructional text'),
Description('Suitable for giving examples how the entered value will be used.'),
ContentSection(ContentSectionTitles.LabelsAndContent, 2)
], DateTimeFieldEntity.prototype, "InstructionalText", void 0);
__decorate([
DisplayName('Display'),
Description('This property can only be set initially. Saving the form makes the property read-only.'),
ContentSection(ContentSectionTitles.LabelsAndContent, 3),
DataType(KnownFieldTypes.Choices),
Choice([{ Title: 'Date', Value: DateFieldType.DateOnly }, { Title: 'Date and time', Value: DateFieldType.DateTime }, { Title: 'Time', Value: DateFieldType.TimeOnly }])
], DateTimeFieldEntity.prototype, "FieldType", void 0);
__decorate([
Group('Options'),
DisplayName('Required field'),
DataType(KnownFieldTypes.CheckBox),
ContentSection(ContentSectionTitles.LabelsAndContent, 4)
], DateTimeFieldEntity.prototype, "Required", void 0);
__decorate([
ContentSection(ContentSectionTitles.LabelsAndContent, 5),
DisplayName('Hide field initially (use form rules to display it)'),
DataType(KnownFieldTypes.CheckBox),
Group('Options')
], DateTimeFieldEntity.prototype, "Hidden", void 0);
__decorate([
DisplayName('Error message if the field is empty'),
ContentSection(ContentSectionTitles.LabelsAndContent, 6),
DefaultValue('{0} field is required'),
ConditionalVisibility('{"conditions":[{"fieldName":"Required","operator":"Equals","value":true}]}')
], DateTimeFieldEntity.prototype, "RequiredErrorMessage", void 0);
__decorate([
ContentSection(ContentSectionTitles.DisplaySettings),
DisplayName('Template'),
ViewSelector([{ Value: 'Default' }])
], DateTimeFieldEntity.prototype, "SfViewName", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('AdvancedMain', 2),
DisplayName('CSS class')
], DateTimeFieldEntity.prototype, "CssClass", void 0);
__decorate([
Browsable(false)
], DateTimeFieldEntity.prototype, "SfFieldType", void 0);
__decorate([
Browsable(false)
], DateTimeFieldEntity.prototype, "SfFieldName", void 0);
DateTimeFieldEntity = __decorate([
WidgetEntity('SitefinityDateTimeField', 'Date and time')
], DateTimeFieldEntity);
export { DateTimeFieldEntity };