@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.
88 lines (87 loc) • 4.61 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 { FormSubmitAction } from './interfaces/form-submit-action';
import { OffsetStyle } from '../styling/offset-style';
import { RestSdkTypes } from '../../rest-sdk/rest-client';
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 { DataModel, DataType } from '@progress/sitefinity-widget-designers-sdk/decorators/data-type';
import { ConditionalVisibility } from '@progress/sitefinity-widget-designers-sdk/decorators/conditional-visibility';
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 { Content } from '@progress/sitefinity-widget-designers-sdk/decorators/content';
import { Required } from '@progress/sitefinity-widget-designers-sdk/decorators/validations';
import { TableView } from '@progress/sitefinity-widget-designers-sdk/decorators/table-view';
import { WidgetLabel } from '@progress/sitefinity-widget-designers-sdk/decorators/widget-label';
import { LengthDependsOn } from '@progress/sitefinity-widget-designers-sdk/decorators/length-depends-on';
import { KeysValues } from '@progress/sitefinity-widget-designers-sdk/decorators/attributes';
let FormEntity = class FormEntity {
SelectedItems = null;
FormSubmitAction = FormSubmitAction.AsSetInForm;
SuccessMessage = null;
RedirectPage = null;
Margins = null;
SfWidgetLabel = 'Form';
CssClass;
Attributes;
};
__decorate([
Content({ Type: RestSdkTypes.Form, AllowMultipleItemsSelection: false }),
DisplayName('Select a form'),
ContentSection('Form setup', 0)
], FormEntity.prototype, "SelectedItems", void 0);
__decorate([
ContentSection('Form setup', 1),
DisplayName('Confirmation on submit'),
DataType(KnownFieldTypes.RadioChoice),
Choice([
{ Title: 'As set in the form', Value: 'AsSetInForm' },
{ Title: 'Custom message', Value: 'Message' },
{ Title: 'Custom redirect to a page', Value: 'Redirect' }
])
], FormEntity.prototype, "FormSubmitAction", void 0);
__decorate([
ContentSection('Form setup', 1),
DisplayName(''),
DataType(KnownFieldTypes.TextArea),
DefaultValue('Thank you for filling out our form.'),
ConditionalVisibility('{\"conditions\":[{\"fieldName\":\"FormSubmitAction\",\"operator\":\"Equals\",\"value\":\"Message\"}],\"inline\":\"true\"}')
], FormEntity.prototype, "SuccessMessage", void 0);
__decorate([
ContentSection('Form setup', 1),
DisplayName(''),
Content({ Type: RestSdkTypes.Pages, AllowMultipleItemsSelection: false }),
ConditionalVisibility('{\"conditions\":[{\"fieldName\":\"FormSubmitAction\",\"operator\":\"Equals\",\"value\":\"Redirect\"}],\"inline\":\"true\"}'),
Required()
], FormEntity.prototype, "RedirectPage", void 0);
__decorate([
ContentSection(ContentSectionTitles.DisplaySettings, 0),
TableView('Form'),
DataModel(OffsetStyle)
], FormEntity.prototype, "Margins", void 0);
__decorate([
WidgetLabel()
], FormEntity.prototype, "SfWidgetLabel", void 0);
__decorate([
DisplayName('CSS class'),
Category('Advanced')
], FormEntity.prototype, "CssClass", void 0);
__decorate([
Category('Advanced'),
ContentSection(ContentSectionTitles.Attributes),
DisplayName('Attributes for...'),
LengthDependsOn(null, '', '', '[{"Name": "Form", "Title": "Form"}]'),
DataType(KnownFieldTypes.Attributes),
DataModel(KeysValues)
], FormEntity.prototype, "Attributes", void 0);
FormEntity = __decorate([
WidgetEntity('SitefinityForm', 'Form')
], FormEntity);
export { FormEntity };