@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.
49 lines (48 loc) • 2.83 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 { ChoiceEntityBase } from '../interfaces/choice-entity-base';
import { FIELD_SIZE_OPTIONS, FieldSize } from '../../styling/field-size';
import { DROPWDOWN_PREDEFINED_LIST } from './dropdown-predefined-list';
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 { DisplayName } from '@progress/sitefinity-widget-designers-sdk/decorators/display-name';
import { DataType } from '@progress/sitefinity-widget-designers-sdk/decorators/data-type';
import { Choice } from '@progress/sitefinity-widget-designers-sdk/decorators/choice';
import { WidgetEntity } from '@progress/sitefinity-widget-designers-sdk/decorators/widget-entity';
import { TableView } from '@progress/sitefinity-widget-designers-sdk/decorators/table-view';
let DropdownEntity = class DropdownEntity extends ChoiceEntityBase {
Label = 'Untitled';
Choices = [{ Name: 'Select' }, { Name: 'First choice', Value: '1' }, { Name: 'Second choice', Value: '2' }];
Sorting = 'Manual';
FieldSize = FieldSize.None;
};
__decorate([
DataType('string'),
DisplayName('Label '),
ContentSection(ContentSectionTitles.LabelsAndContent, 1)
], DropdownEntity.prototype, "Label", void 0);
__decorate([
TableView({ Selectable: true, Reorderable: true }, DROPWDOWN_PREDEFINED_LIST)
], DropdownEntity.prototype, "Choices", void 0);
__decorate([
ContentSection(ContentSectionTitles.LabelsAndContent, 4),
DefaultValue('Manual'),
DisplayName('Sort choices'),
DataType(KnownFieldTypes.Choices),
Choice([{ Title: 'As set manually', Value: 'Manual' }, { Title: 'Alphabetically', Value: 'Alphabetical' }])
], DropdownEntity.prototype, "Sorting", void 0);
__decorate([
ContentSection(ContentSectionTitles.DisplaySettings, 2),
DisplayName('Field size'),
DataType(KnownFieldTypes.ChipChoice),
Choice(FIELD_SIZE_OPTIONS)
], DropdownEntity.prototype, "FieldSize", void 0);
DropdownEntity = __decorate([
WidgetEntity('SitefinityDropdown', 'Dropdown')
], DropdownEntity);
export { DropdownEntity };