@ikas/popup-renderer
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -1,1 +0,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 m}from"./elements/product/index.js";import{ButtonElement as o}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.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||{});case p.IMAGE:return new i(e||{});case p.IMAGE_COLUMN:return new l(e||{});case p.PRODUCT_LIST:return new m(e||{});case p.BUTTON:return new o(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}));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 m({order:t}));break;case p.BUTTON:this.elements.push(new o({order:t}));break;case p.SOCIAL_MEDIA:this.elements.push(new a({order:t}));break;case p.DIVIDER:this.elements.push(new h({order:t}));break;case p.SPACE:this.elements.push(new u({order:t}))}},d}();export{d as PopupStep}; | ||
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 m}from"./elements/product/index.js";import{ButtonElement as o}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||{});case p.IMAGE:return new i(e||{});case p.IMAGE_COLUMN:return new l(e||{});case p.PRODUCT_LIST:return new m(e||{});case p.BUTTON:return new o(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}));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 m({order:t}));break;case p.BUTTON:this.elements.push(new o({order:t}));break;case p.SOCIAL_MEDIA:this.elements.push(new a({order:t}));break;case p.DIVIDER:this.elements.push(new h({order:t}));break;case p.SPACE:this.elements.push(new u({order:t}))}},d}();export{d as PopupStep}; |
{ | ||
"name": "@ikas/popup-renderer", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": "ucy", |
105110