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.

181 lines (180 loc) 7.67 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 { Attributes, Category, Choice, ConditionalVisibility, Content, ContentSection, DataType, DefaultValue, Description, DisplayName, Group, KnownFieldTypes, Margins, PropertyCategory, ViewSelector, WidgetEntity, WidgetLabel } from '@progress/sitefinity-widget-designers-sdk'; import { PostLoginAction } from './interfaces/post-login-action'; import { RestSdkTypes } from '../../rest-sdk/rest-client'; let LoginFormEntity = class LoginFormEntity { PostLoginAction = PostLoginAction.StayOnSamePage; PostLoginRedirectPage; RegistrationPage; ResetPasswordPage; RememberMe = false; //Login with external providers ExternalProviders; SfViewName = 'Default'; Margins; // Advanced SfWidgetLabel = 'Login form'; CssClass; MembershipProviderName; // Labels and messages Header = 'Login'; EmailLabel = 'Email / Username'; PasswordLabel = 'Password'; SubmitButtonLabel = 'Log in'; ErrorMessage = 'Incorrect credentials.'; RememberMeLabel = 'Remember me'; ForgottenPasswordLinkLabel = 'Forgotten password'; NotRegisteredLabel = 'Not registered yet?'; RegisterLinkText = 'Register now'; ExternalProvidersHeader = 'or use account in...'; ValidationRequiredMessage = 'All fields are required.'; ValidationInvalidEmailMessage = 'Invalid email format.'; Attributes; }; __decorate([ DisplayName('After login users will...'), DataType(KnownFieldTypes.RadioChoice), ContentSection('Select pages', 1), Choice([ { Value: 'StayOnSamePage', Title: 'Stay on the same page' }, { Value: 'RedirectToPage', Title: 'Redirect to page...' } ]) ], LoginFormEntity.prototype, "PostLoginAction", void 0); __decorate([ Content({ Type: RestSdkTypes.Pages, AllowMultipleItemsSelection: false }), DisplayName(''), ContentSection('Select pages', 1), ConditionalVisibility('{\u0022conditions\u0022:[{\u0022fieldName\u0022:\u0022PostLoginAction\u0022,\u0022operator\u0022:\u0022Equals\u0022,\u0022value\u0022:\u0022RedirectToPage\u0022}],\u0022inline\u0022:\u0022true\u0022}'), DefaultValue(null) ], LoginFormEntity.prototype, "PostLoginRedirectPage", void 0); __decorate([ Content({ Type: RestSdkTypes.Pages, AllowMultipleItemsSelection: false }), DisplayName('Registration page'), ContentSection('Select pages', 1), Description('This is the page where you have dropped the Registration form widget. If you leave this field empty, a link to the Registration page will not be displayed in the Login form widget.'), DefaultValue(null) ], LoginFormEntity.prototype, "RegistrationPage", void 0); __decorate([ Content({ Type: RestSdkTypes.Pages, AllowMultipleItemsSelection: false }), DisplayName('Reset password page'), ContentSection('Select pages', 1), Description('This is the page where you have dropped the Reset password widget. If you leave this field empty, a link to the Reset password page will not be displayed in the Login form widget.'), DefaultValue(null) ], LoginFormEntity.prototype, "ResetPasswordPage", void 0); __decorate([ DisplayName('Show \u0022Remember me\u0022 checkbox'), DataType(KnownFieldTypes.CheckBox), Group('Login form options'), ContentSection('Select pages', 1) ], LoginFormEntity.prototype, "RememberMe", void 0); __decorate([ DisplayName('Allow users to log in with...'), ContentSection('Login with external providers', 1), DataType(KnownFieldTypes.MultipleChoiceChip), Choice({ ActionTitle: 'Select external providers', ButtonTitle: 'Add', ServiceUrl: '/Default.GetExternalProviders()' }) ], LoginFormEntity.prototype, "ExternalProviders", void 0); __decorate([ ContentSection('Display settings', 1), DisplayName('Login form template'), ViewSelector([{ Value: 'Default' }]) ], LoginFormEntity.prototype, "SfViewName", void 0); __decorate([ ContentSection('Display settings', 1), Margins('Login form') ], LoginFormEntity.prototype, "Margins", void 0); __decorate([ WidgetLabel() ], LoginFormEntity.prototype, "SfWidgetLabel", void 0); __decorate([ DisplayName('CSS class'), Category(PropertyCategory.Advanced) ], LoginFormEntity.prototype, "CssClass", void 0); __decorate([ DisplayName('Membership Provider'), Category(PropertyCategory.Advanced) ], LoginFormEntity.prototype, "MembershipProviderName", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages'), DisplayName('Login form header') ], LoginFormEntity.prototype, "Header", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages'), DisplayName('Email field label') ], LoginFormEntity.prototype, "EmailLabel", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages'), DisplayName('Password field label') ], LoginFormEntity.prototype, "PasswordLabel", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages'), DisplayName('Login form button') ], LoginFormEntity.prototype, "SubmitButtonLabel", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages'), DisplayName('Incorrect credentials message') ], LoginFormEntity.prototype, "ErrorMessage", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages'), DisplayName('Remember me checkbox') ], LoginFormEntity.prototype, "RememberMeLabel", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages'), DisplayName('Forgotten password link') ], LoginFormEntity.prototype, "ForgottenPasswordLinkLabel", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages'), DisplayName('Not registered label') ], LoginFormEntity.prototype, "NotRegisteredLabel", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages'), DisplayName('Register link') ], LoginFormEntity.prototype, "RegisterLinkText", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages'), DisplayName('External providers header') ], LoginFormEntity.prototype, "ExternalProvidersHeader", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages'), DisplayName('Required fields error message') ], LoginFormEntity.prototype, "ValidationRequiredMessage", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages'), DisplayName('Invalid email error message') ], LoginFormEntity.prototype, "ValidationInvalidEmailMessage", void 0); __decorate([ Attributes('LoginForm', 'Login form') ], LoginFormEntity.prototype, "Attributes", void 0); LoginFormEntity = __decorate([ WidgetEntity('SitefinityLoginForm', 'Login form') ], LoginFormEntity); export { LoginFormEntity };