@ikas/popup-renderer 1.0.87 → 1.0.88
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.
|
@@ -18,5 +18,5 @@ export declare class PopupStep {
|
|
|
18
18
|
elements: ElementType[];
|
|
19
19
|
constructor(data: Partial<PopupStep>);
|
|
20
20
|
setContent(content: ElementType): TextElement | FormElement | ImageElement | ImageColumnElement | ProductListElement | ButtonElement | SocialMediaElement | DividerElement | SpaceElement;
|
|
21
|
-
addNewElement(type: PopupElementTypeEnum): void;
|
|
21
|
+
addNewElement(type: PopupElementTypeEnum, element?: ElementType): void;
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as
|
|
1
|
+
import{__assign as e}from'./../../../../ext/tslib/tslib.es6.mjs.js';import{makeObservable as t,observable as s,action as n}from"mobx";import{TextElement as r}from"./elements/text/index.js";import{FormElement as i}from"./elements/form/index.js";import{ImageElement as o}from"./elements/image/index.js";import{ProductListElement as m}from"./elements/product/index.js";import{ButtonElement as a}from"./elements/button/index.js";import{SocialMediaElement as d}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 l}from"./elements/base/index.js";import{ImageColumnElement as p}from"./elements/image-column/index.js";var w=function(){function w(e){var i=this;this.id=e.id||Date.now().toString(),this.stepNumber=e.stepNumber||0,this.name=e.name||"",this.isThankYouStep=e.isThankYouStep||!1,this.isTeaser=e.isTeaser||!1,this.elements=e.elements&&e.elements.length?e.elements.map((function(e){return i.setContent(e)})):[],this.isTeaser&&(this.id=this.id+"-teaser"),this.isTeaser&&!this.elements.length&&this.elements.push(new r({order:0})),t(this,{stepNumber:s,name:s,isThankYouStep:s,isTeaser:s,elements:s,setContent:n.bound,addNewElement:n.bound})}return w.prototype.setContent=function(e){switch(e.type){case l.TEXT:return new r(e||{});case l.FORM:return new i(e||{},this.stepNumber);case l.IMAGE:return new o(e||{});case l.IMAGE_COLUMN:return new p(e||{});case l.PRODUCT_LIST:return new m(e||{});case l.BUTTON:return new a(e||{});case l.SOCIAL_MEDIA:return new d(e||{});case l.DIVIDER:return new h(e||{});case l.SPACE:return new u(e||{})}},w.prototype.addNewElement=function(t,s){var n=this.elements.length;switch(t){case l.TEXT:this.elements.push(new r(e(e({},s),{order:n,id:Date.now().toString()})));break;case l.FORM:this.elements.push(new i(e(e({},s),{order:n,id:Date.now().toString()}),this.stepNumber));break;case l.IMAGE:this.elements.push(new o(e(e({},s),{order:n,id:Date.now().toString()})));break;case l.IMAGE_COLUMN:this.elements.push(new p(e(e({},s),{order:n,id:Date.now().toString()})));break;case l.PRODUCT_LIST:this.elements.push(new m(e(e({},s),{order:n,id:Date.now().toString()})));break;case l.BUTTON:this.elements.push(new a(e(e({},s),{order:n,buttonBgColor:"#000000",borderColor:"#000000",id:Date.now().toString()})));break;case l.SOCIAL_MEDIA:this.elements.push(new d(e(e({},s),{order:n,id:Date.now().toString()})));break;case l.DIVIDER:this.elements.push(new h(e(e({},s),{order:n,id:Date.now().toString(),borderColor:"#E3E8EF"})));break;case l.SPACE:this.elements.push(new u(e(e({},s),{order:n,id:Date.now().toString()})))}},w}();export{w as PopupStep};
|