@ikas/popup-renderer 1.0.120 → 1.0.121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__extends as t,__assign as o}from'./../../../../../../ext/tslib/tslib.es6.mjs.js';import{makeObservable as r,observable as n,action as e}from"mobx";import{PopupElementTypeEnum as i,BaseElement as s}from"../base/index.js";import{ButtonElement as a}from"../button/index.js";import{FormSettings as l}from"./form-settings/index.js";import{CustomerNameFormItem as u}from"./customer-name/index.js";import{CustomerSurnameFormItem as d}from"./customer-surname/index.js";import{CustomerEmailFormItem as m}from"./customer-email/index.js";import{CustomerPhoneFormItem as p}from"./customer-phone/index.js";import{CustomerBirthdayFormItem as E}from"./customer-birthday/index.js";import{CustomerGenderFormItem as c}from"./customer-gender/index.js";import{CheckboxFormItem as h}from"./checkbox/index.js";import{CustomerAttributeFormItem as T}from"./customer-attribute/index.js";import{Popup as C}from"../../../../index.js";var M;!function(t){t.CUSTOMER_NAME="CUSTOMER_NAME",t.CUSTOMER_SURNAME="CUSTOMER_SURNAME",t.CUSTOMER_EMAIL="CUSTOMER_EMAIL",t.CUSTOMER_PHONE="CUSTOMER_PHONE",t.CUSTOMER_BIRTHDAY="CUSTOMER_BIRTHDAY",t.CUSTOMER_GENDER="CUSTOMER_GENDER",t.CHECKBOX_FORM_ITEM="CHECKBOX_FORM_ITEM",t.CUSTOMER_ATTRIBUTE="CUSTOMER_ATTRIBUTE"}(M||(M={}));var f=function(o){function s(t,s){void 0===t&&(t={});var u,d,m,p,E=this;return(E=o.call(this,t)||this).type=i.FORM,E.rows=t.rows?t.rows.map((function(t){return new R(t)})):[],E.formSettings=t.formSettings||new l,E.buttonSettings=t.buttonSettings||new a({outerHorizontalPadding:0,outerVerticalPadding:0,buttonBgColor:"#000000",borderColor:"#000000"}),E.bgColor=t.bgColor||"",E.outerVerticalPadding=null!==(u=t.outerVerticalPadding)&&void 0!==u?u:
|
|
1
|
+
import{__extends as t,__assign as o}from'./../../../../../../ext/tslib/tslib.es6.mjs.js';import{makeObservable as r,observable as n,action as e}from"mobx";import{PopupElementTypeEnum as i,BaseElement as s}from"../base/index.js";import{ButtonElement as a}from"../button/index.js";import{FormSettings as l}from"./form-settings/index.js";import{CustomerNameFormItem as u}from"./customer-name/index.js";import{CustomerSurnameFormItem as d}from"./customer-surname/index.js";import{CustomerEmailFormItem as m}from"./customer-email/index.js";import{CustomerPhoneFormItem as p}from"./customer-phone/index.js";import{CustomerBirthdayFormItem as E}from"./customer-birthday/index.js";import{CustomerGenderFormItem as c}from"./customer-gender/index.js";import{CheckboxFormItem as h}from"./checkbox/index.js";import{CustomerAttributeFormItem as T}from"./customer-attribute/index.js";import{Popup as C}from"../../../../index.js";var M;!function(t){t.CUSTOMER_NAME="CUSTOMER_NAME",t.CUSTOMER_SURNAME="CUSTOMER_SURNAME",t.CUSTOMER_EMAIL="CUSTOMER_EMAIL",t.CUSTOMER_PHONE="CUSTOMER_PHONE",t.CUSTOMER_BIRTHDAY="CUSTOMER_BIRTHDAY",t.CUSTOMER_GENDER="CUSTOMER_GENDER",t.CHECKBOX_FORM_ITEM="CHECKBOX_FORM_ITEM",t.CUSTOMER_ATTRIBUTE="CUSTOMER_ATTRIBUTE"}(M||(M={}));var f=function(o){function s(t,s){void 0===t&&(t={});var u,d,m,p,E=this;return(E=o.call(this,t)||this).type=i.FORM,E.rows=t.rows?t.rows.map((function(t){return new R(t)})):[],E.formSettings=t.formSettings||new l,E.buttonSettings=t.buttonSettings||new a({outerHorizontalPadding:0,outerVerticalPadding:0,buttonBgColor:"#000000",borderColor:"#000000"}),E.bgColor=t.bgColor||"",E.outerVerticalPadding=null!==(u=t.outerVerticalPadding)&&void 0!==u?u:10,E.outerHorizontalPadding=null!==(d=t.outerHorizontalPadding)&&void 0!==d?d:0,E.verticalPadding=null!==(m=t.verticalPadding)&&void 0!==m?m:0,E.horizontalPadding=null!==(p=t.horizontalPadding)&&void 0!==p?p:0,r(E,{rows:n,formSettings:n,buttonSettings:n,bgColor:n,addNewElement:e.bound}),0===E.rows.length&&1===s&&E.addNewElement(M.CUSTOMER_EMAIL),E}return t(s,o),s.prototype.addNewElement=function(t){var o=new R({order:this.rows.length,columns:[new w({type:t,order:0})]});this.rows.push(o)},s}(s),R=function(){function t(t){var o;void 0===t&&(t={}),this.id=t.id||Date.now().toString(),this.order=null!==(o=t.order)&&void 0!==o?o:0,this.columns=t.columns?t.columns.map((function(t){return new w(t)})):[],r(this,{id:n,order:n,columns:n,addNewElement:e.bound,changeColumnSort:e.bound})}return t.prototype.addNewElement=function(t){this.columns.push(new w({type:t,order:this.columns.length}))},t.prototype.changeColumnSort=function(){this.columns.forEach((function(t,o){0===o?t.order=t.order+1:1===o&&(t.order=t.order-1)})),this.columns=this.columns.sort((function(t,o){return t.order-o.order}))},t}(),w=function(){function t(t){var o;void 0===t&&(t={}),this.id=t.id||Date.now().toString(),this.order=null!==(o=t.order)&&void 0!==o?o:0,this.type=t.type||M.CUSTOMER_NAME,this.formItem=this.setFormItems(t.formItem),r(this,{id:n,order:n,type:n,formItem:n,setFormItems:e.bound})}return t.prototype.setFormItems=function(t){switch(this.type){case M.CUSTOMER_NAME:return new u(t?o({},t):{inputLabel:new S({text:C.t("popup:initialClassTranslations.firstName")})});case M.CUSTOMER_SURNAME:return new d(t?o({},t):{inputLabel:new S({text:C.t("popup:initialClassTranslations.lastName")})});case M.CUSTOMER_EMAIL:return new m(t?o({},t):{inputLabel:new S({text:C.t("popup:initialClassTranslations.email")})});case M.CUSTOMER_PHONE:return new p(t?o({},t):{inputLabel:new S({text:C.t("popup:initialClassTranslations.phone")})});case M.CUSTOMER_BIRTHDAY:return new E(t?o({},t):{inputLabel:new S({text:C.t("popup:initialClassTranslations.birthday")})});case M.CUSTOMER_GENDER:return new c(t?o({},t):{inputLabel:new S({text:C.t("popup:initialClassTranslations.gender")})});case M.CHECKBOX_FORM_ITEM:return new h(o({},t));case M.CUSTOMER_ATTRIBUTE:return new T(o({},t))}},t}(),S=function(t){void 0===t&&(t={}),this.text=t.text||C.t("popup:initialClassTranslations.inputLabel"),r(this,{text:n})},g=function(t){void 0===t&&(t={}),this.validationErrorMessage=t.validationErrorMessage||C.t("popup:initialClassTranslations.requiredFieldErrorMessage"),this.hasError=t.hasError||!1,r(this,{validationErrorMessage:n,hasError:n})},O=function(t){void 0===t&&(t={}),this.text=t.text||C.t("popup:initialClassTranslations.placeholder"),r(this,{text:n})};export{w as FormColumn,f as FormElement,M as FormItemTypeEnum,R as FormRow,S as InputLabel,O as InputPlaceholder,g as RequiredInput};
|