@ikas/popup-renderer 1.0.70 → 1.0.71
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.
|
@@ -35,7 +35,7 @@ export declare class FormElement extends BaseElement {
|
|
|
35
35
|
formSettings: FormSettings;
|
|
36
36
|
buttonSettings: ButtonElement;
|
|
37
37
|
bgColor: string;
|
|
38
|
-
constructor(data
|
|
38
|
+
constructor(data: Partial<FormElement> | undefined, stepNumber: number);
|
|
39
39
|
addNewElement(type: FormItemTypeEnum): void;
|
|
40
40
|
}
|
|
41
41
|
export declare class FormRow {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__extends as t,__assign as r}from'./../../../../../../ext/tslib/tslib.es6.mjs.js';import{makeObservable as o,observable as e,action as n}from"mobx";import{PopupElementTypeEnum as i,BaseElement as s}from"../base/index.js";import{ButtonElement as d}from"../button/index.js";import{FormSettings as m}from"./form-settings/index.js";import{CustomerNameFormItem as u}from"./customer-name/index.js";import{CustomerSurnameFormItem as E}from"./customer-surname/index.js";import{CustomerEmailFormItem as a}from"./customer-email/index.js";import{CustomerPhoneFormItem as c}from"./customer-phone/index.js";import{CustomerBirthdayFormItem as l}from"./customer-birthday/index.js";import{CustomerGenderFormItem as h}from"./customer-gender/index.js";import{CheckboxFormItem as M}from"./checkbox/index.js";import{CustomerAttributeFormItem as f}from"./customer-attribute/index.js";var R;!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"}(R||(R={}));var T=function(r){function s(t){void 0===t&&(t={});var
|
|
1
|
+
import{__extends as t,__assign as r}from'./../../../../../../ext/tslib/tslib.es6.mjs.js';import{makeObservable as o,observable as e,action as n}from"mobx";import{PopupElementTypeEnum as i,BaseElement as s}from"../base/index.js";import{ButtonElement as d}from"../button/index.js";import{FormSettings as m}from"./form-settings/index.js";import{CustomerNameFormItem as u}from"./customer-name/index.js";import{CustomerSurnameFormItem as E}from"./customer-surname/index.js";import{CustomerEmailFormItem as a}from"./customer-email/index.js";import{CustomerPhoneFormItem as c}from"./customer-phone/index.js";import{CustomerBirthdayFormItem as l}from"./customer-birthday/index.js";import{CustomerGenderFormItem as h}from"./customer-gender/index.js";import{CheckboxFormItem as M}from"./checkbox/index.js";import{CustomerAttributeFormItem as f}from"./customer-attribute/index.js";var R;!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"}(R||(R={}));var T=function(r){function s(t,s){void 0===t&&(t={});var u,E,a=this;return(a=r.call(this,t)||this).type=i.FORM,a.rows=t.rows?t.rows.map((function(t){return new C(t)})):[],a.formSettings=t.formSettings||new m,a.buttonSettings=t.buttonSettings||new d({outerHorizontalPadding:0,outerVerticalPadding:0,buttonBgColor:"#000000",borderColor:"#000000"}),a.bgColor=t.bgColor||"",a.verticalPadding=null!==(u=t.verticalPadding)&&void 0!==u?u:12,a.horizontalPadding=null!==(E=t.horizontalPadding)&&void 0!==E?E:12,o(a,{rows:e,formSettings:e,buttonSettings:e,bgColor:e,addNewElement:n.bound}),0===a.rows.length&&s>0&&a.addNewElement(R.CUSTOMER_EMAIL),a}return t(s,r),s.prototype.addNewElement=function(t){var r=new C({order:this.rows.length,columns:[new S({type:t,order:0})]});this.rows.push(r)},s}(s),C=function(){function t(t){var r;void 0===t&&(t={}),this.id=t.id||Date.now().toString(),this.order=null!==(r=t.order)&&void 0!==r?r:0,this.columns=t.columns?t.columns.map((function(t){return new S(t)})):[],o(this,{id:e,order:e,columns:e,addNewElement:n.bound,changeColumnSort:n.bound})}return t.prototype.addNewElement=function(t){this.columns.push(new S({type:t,order:this.columns.length}))},t.prototype.changeColumnSort=function(){this.columns.forEach((function(t,r){0===r?t.order=t.order+1:1===r&&(t.order=t.order-1)})),this.columns=this.columns.sort((function(t,r){return t.order-r.order}))},t}(),S=function(){function t(t){var r;void 0===t&&(t={}),this.id=t.id||Date.now().toString(),this.order=null!==(r=t.order)&&void 0!==r?r:0,this.type=t.type||R.CUSTOMER_NAME,this.formItem=this.setFormItems(t.formItem),o(this,{id:e,order:e,type:e,formItem:e,setFormItems:n.bound})}return t.prototype.setFormItems=function(t){switch(this.type){case R.CUSTOMER_NAME:return new u(r({},t));case R.CUSTOMER_SURNAME:return new E(r({},t));case R.CUSTOMER_EMAIL:return new a(r({},t));case R.CUSTOMER_PHONE:return new c(r({},t));case R.CUSTOMER_BIRTHDAY:return new l(r({},t));case R.CUSTOMER_GENDER:return new h(r({},t));case R.CHECKBOX_FORM_ITEM:return new M(r({},t));case R.CUSTOMER_ATTRIBUTE:return new f(r({},t))}},t}(),p=function(t){void 0===t&&(t={}),this.text=t.text||"Input Label",o(this,{text:e})},O=function(t){void 0===t&&(t={}),this.validationErrorMessage=t.validationErrorMessage||"It's required to fill this field",this.hasError=t.hasError||!1,o(this,{validationErrorMessage:e,hasError:e})};export{S as FormColumn,T as FormElement,R as FormItemTypeEnum,C as FormRow,p as InputLabel,O as RequiredInput};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as e,observable as t,action as s}from"mobx";import{TextElement as n}from"./elements/text/index.js";import{FormElement as r}from"./elements/form/index.js";import{ImageElement as i}from"./elements/image/index.js";import{ProductListElement as o}from"./elements/product/index.js";import{ButtonElement as m}from"./elements/button/index.js";import{SocialMediaElement as a}from"./elements/social/index.js";import{DividerElement as h}from"./elements/divider/index.js";import{SpaceElement as u}from"./elements/space/index.js";import{PopupElementTypeEnum as
|
|
1
|
+
import{makeObservable as e,observable as t,action as s}from"mobx";import{TextElement as n}from"./elements/text/index.js";import{FormElement as r}from"./elements/form/index.js";import{ImageElement as i}from"./elements/image/index.js";import{ProductListElement as o}from"./elements/product/index.js";import{ButtonElement as m}from"./elements/button/index.js";import{SocialMediaElement as a}from"./elements/social/index.js";import{DividerElement as h}from"./elements/divider/index.js";import{SpaceElement as u}from"./elements/space/index.js";import{PopupElementTypeEnum as p}from"./elements/base/index.js";import{ImageColumnElement as l}from"./elements/image-column/index.js";var d=function(){function d(r){var i=this;this.id=r.id||Date.now().toString(),this.stepNumber=r.stepNumber||0,this.name=r.name||"",this.isThankYouStep=r.isThankYouStep||!1,this.isTeaser=r.isTeaser||!1,this.elements=r.elements&&r.elements.length?r.elements.map((function(e){return i.setContent(e)})):[],this.isTeaser&&(this.id=this.id+"-teaser"),this.isTeaser&&!this.elements.length&&this.elements.push(new n({order:0})),e(this,{stepNumber:t,name:t,isThankYouStep:t,isTeaser:t,elements:t,setContent:s.bound,addNewElement:s.bound})}return d.prototype.setContent=function(e){switch(e.type){case p.TEXT:return new n(e||{});case p.FORM:return new r(e||{},this.stepNumber);case p.IMAGE:return new i(e||{});case p.IMAGE_COLUMN:return new l(e||{});case p.PRODUCT_LIST:return new o(e||{});case p.BUTTON:return new m(e||{});case p.SOCIAL_MEDIA:return new a(e||{});case p.DIVIDER:return new h(e||{});case p.SPACE:return new u(e||{})}},d.prototype.addNewElement=function(e){var t=this.elements.length;switch(e){case p.TEXT:this.elements.push(new n({order:t}));break;case p.FORM:this.elements.push(new r({order:t},this.stepNumber));break;case p.IMAGE:this.elements.push(new i({order:t}));break;case p.IMAGE_COLUMN:this.elements.push(new l({order:t}));break;case p.PRODUCT_LIST:this.elements.push(new o({order:t}));break;case p.BUTTON:this.elements.push(new m({order:t,buttonBgColor:"#000000",borderColor:"#000000"}));break;case p.SOCIAL_MEDIA:this.elements.push(new a({order:t}));break;case p.DIVIDER:this.elements.push(new h({order:t,borderColor:"#E3E8EF"}));break;case p.SPACE:this.elements.push(new u({order:t}))}},d}();export{d as PopupStep};
|