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.

74 lines (73 loc) 3.43 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 { Category, Choice, ConditionalVisibility, Content, ContentSection, ContentSectionTitles, DataModel, DataType, DefaultValue, DisplayName, KeysValues, KnownFieldTypes, LengthDependsOn, Required, TableView, WidgetEntity, WidgetLabel } from '@progress/sitefinity-widget-designers-sdk'; import { FormSubmitAction } from './interfaces/form-submit-action'; import { OffsetStyle } from '../styling/offset-style'; import { RestSdkTypes } from '../../rest-sdk/rest-client'; 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 };