@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
1 lines • 2.55 kB
JavaScript
(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[51],{870:function(t,e){t.exports='<style>\n :host {\n width: 100%;\n height: 100%;\n }\n</style>\n\n<iframe id="frameID" width="100%" height="100%" style="border: none;"></iframe>\n'},912:function(t,e,n){"use strict";n.r(e),n.d(e,"AuWidgetVariantSelector",(function(){return a})),n.d(e,"widget",(function(){return a}));var i=n(0),r=n(1),o=n(2),c=n(160),u=n(870),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onDoubleClick=null,e}return Object(i.d)(e,t),e.prototype.exportWidgetData=function(t){return Object(i.b)(this,void 0,void 0,(function(){return Object(i.e)(this,(function(t){return[2,{selectedVariant:this.selectedVariant}]}))}))},e.prototype.restoreWidgetFromData=function(t,e){return Object(i.b)(this,void 0,void 0,(function(){return Object(i.e)(this,(function(e){return this.selectedVariant=t.selectedVariant,this.emitChange(),[2]}))}))},e.prototype.updateParams=function(t){t.onDoubleClick&&(this.onDoubleClick=r.a.functionWrapperConstructor(t.onDoubleClick)),this._initIFrame(t.productId,t.productVersionId,t.productFilterId)},e.prototype._initIFrame=function(t,e,n){return Object(i.b)(this,void 0,void 0,(function(){var r,o,c,u,a=this;return Object(i.e)(this,(function(i){switch(i.label){case 0:return r=this.querySelectorShadow("#frameID"),o=r.contentWindow||r,c=r.contentDocument||o.document,[4,this.getScriptContent()];case 1:return u=i.sent(),c.write(u),this._element=c.createElement("au-product-variant-selector"),this._element.apiUrl=this.auWizard.driver.backOffice.backOfficeUrl,this._element.token=this.auWizard.driver.backOffice.token,Number(t)&&(this._element.productId=Number(t)),Number(e)&&(this._element.productVersionId=Number(e)),Number(n)&&(this._element.productFilterId=Number(n)),this._element.addEventListener("variantSelected",(function(t){a.selectedVariant=t.detail,a.emitChange()})),this._element.addEventListener("variantDoubleClicked",(function(t){a.onDoubleClick&&a.onDoubleClick()})),c.write("<body></body"),c.body.appendChild(this._element),[2]}}))}))},e.prototype.getScriptContent=function(){return Object(i.b)(this,void 0,void 0,(function(){return Object(i.e)(this,(function(t){return[2,r.a.loadHtml(r.a.getPatchedUrl("static/variant-selector/variantSelector.html?t="+Date.now()))]}))}))},Object(i.c)([Object(o.c)(),Object(i.g)("design:type",Object)],e.prototype,"selectedVariant",void 0),Object(i.c)([Object(o.a)("au-widget-variant-selector",u)],e)}(c.c)}}]);