@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
1 lines • 8.44 kB
JavaScript
(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[27],{868:function(n,e){n.exports='<style>\n :host {\n display: block;\n }\n\n [hidden] {\n display: none !important;\n }\n\n .text {\n user-select: none;\n @apply --au-body1-font;\n }\n\n paper-checkbox {\n --paper-checkbox-checked-color: var(--theme-primary-color);\n --paper-checkbox-unchecked-color: var(--checkbox-unchecked-color);\n --paper-checkbox-vertical-align: top;\n --paper-checkbox-margin: 1px 0 0 0;\n }\n\n /* =============== button =============== */\n paper-button {\n @apply --au-header-button-geometry;\n @apply --au-button-font;\n margin: 0;\n }\n\n #button.primary {\n background-color: var(--theme-primary-color);\n color: var(--theme-interface-color);\n }\n\n #button.success {\n background-color: var(--theme-success-color);\n color: var(--theme-interface-color);\n }\n\n #button.warning {\n background-color: var(--theme-warning-color);\n color: var(--theme-interface-color);\n }\n\n #button.danger {\n background-color: var(--theme-error-color);\n color: var(--theme-interface-color);\n }\n\n #button[disabled] {\n background: var(--button-disable-background);\n color: var(--button-disable-color);\n }\n\n .div__container {\n display: flex;\n align-items: center;\n width: 100%;\n }\n\n .div__buttoncheckbox {\n order: 20;\n display: inline-block;\n margin-left: auto;\n }\n\n .div__checkbox {\n display: inline-block;\n }\n\n .div__button {\n display: inline-block;\n margin-left: 15px;\n }\n\n .div__download {\n display: inline-block;\n order: 30;\n }\n\n .div__download_icon {\n margin-right: 10px;\n fill: none;\n }\n\n #downloadButton {\n padding-left: 0px !important;\n color: var(--theme-primary-color);\n }\n\n paper-checkbox {\n --paper-checkbox-vertical-align: text-bottom;\n }\n\n @media (max-width: 769px) {\n .div__container {\n justify-content: space-between;\n flex-direction: column;\n padding: 0 15px;\n align-items: baseline;\n }\n\n .div__download {\n margin-bottom: 15px;\n width: 100%;\n }\n\n .div__buttoncheckbox {\n display: flex;\n align-items: center;\n width: 100%;\n }\n\n .div__checkbox {\n width: 60%;\n margin-right: 15px;\n }\n\n .div__button {\n width: 80px;\n height: 40px;\n }\n }\n</style>\n\n<div class="div__container" style$="justify-content: {{__containerJustifyContent}}">\n <template is="dom-if" if="[[_buttonVisible]]">\n <div class="div__buttoncheckbox">\n <div class="div__checkbox" hidden="[[!_checkboxVisible]]">\n <paper-checkbox noink type="value" checked="{{value}}" disabled$="{{!_checkboxEnable}}">\n <span noink class="text">\n [[_checkboxPrompt]]\n </span>\n </paper-checkbox>\n </div>\n\n <div class="div__button">\n <paper-button id="button" class$="[[_buttonClassStyle]]" style="height: 40px;" on-tap="_onClick"\n disabled="[[!_buttonEnable]]">\n <span>[[_buttonText]]</span>\n </paper-button>\n </div>\n </div>\n </template>\n\n <div class="div__download" style$="order: {{_downloadOrder}}; margin-left: {{_downloadMarginLeft}};">\n <paper-button id="downloadButton" on-tap="_onDownloadClick" disabled="[[!_downloadEnable]]"\n hidden="[[!_downloadVisible]]">\n <iron-icon icon="au-icons:download" class="div__download_icon"></iron-icon>\n <span>[[_downloadText]]</span>\n </paper-button>\n </div>\n</div>'},910:function(n,e,t){"use strict";t.r(e),t.d(e,"AuWidgetFinishGroup",(function(){return c})),t.d(e,"widget",(function(){return c}));var o=t(0),i=t(868),a=t(160),r=t(2),l=t(1),c=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.value=!1,e._checkboxPrompt="",e._checkboxEnable=!0,e._checkboxVisible=!0,e._buttonEnable=!1,e._buttonText="",e._buttonClassStyle="",e._buttonVisible=!0,e._downloadText="",e._downloadEnable=!0,e._downloadVisible=!1,e._downloadPosition="left",e._downloadOrder=30,e._downloadMarginLeft="",e.__containerJustifyContent="",e}return Object(o.d)(e,n),e.prototype.updateParams=function(n){var e,t=this;this.value=l.a.isNotNullOrUndefined(n.value)?n.value:this.value,this._checkboxPrompt=n.checkboxPrompt,this._checkboxEnable=!l.a.isNotNullOrUndefined(n.checkboxEnabled)||n.checkboxEnabled,this._checkboxVisible=!l.a.isNotNullOrUndefined(n.checkboxVisible)||n.checkboxVisible,this._buttonText=n.buttonText,this._buttonClassStyle=n.buttonClassStyle,this._buttonVisible=null===(e=n.buttonVisible)||void 0===e||e,this._downloadEnable=void 0===n.downloadEnable||n.downloadEnable,this._downloadText=n.downloadText,this._downloadVisible=!0===n.downloadVisible||void 0===n.downloadVisible&&void 0!==n.downloads,this._downloadPosition=void 0!==n.downloadPosition?n.downloadPosition:"left",this._downloadOrder="left"===this._downloadPosition||window.innerWidth<768?10:30,this._downloadMarginLeft="right"===this._downloadPosition&&window.innerWidth>768?"18px":"0px",this.__containerJustifyContent="left"===n.downloadPosition?this._buttonVisible?"space-between":"flex-start":"flex-end";var i=[].concat((function(){return t._buttonEnable=!1}),n.onClick,(function(){return Object(o.b)(t,void 0,void 0,(function(){var n,e,t,i,a,r,l=this;return Object(o.e)(this,(function(c){switch(c.label){case 0:n=[],Object.keys(this.auWizard.scope.$).forEach((function(e){var t=l.auWizard.scope.$[e],o=t.tagName.toLowerCase();-1===o.indexOf("order")&&-1===o.indexOf("cart")||n.push(t)})),c.label=1;case 1:c.trys.push([1,6,7,8]),e=Object(o.k)(n),t=e.next(),c.label=2;case 2:return t.done?[3,5]:[4,t.value.compile()];case 3:c.sent(),c.label=4;case 4:return t=e.next(),[3,2];case 5:return[3,8];case 6:return i=c.sent(),a={error:i},[3,8];case 7:try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(a)throw a.error}return[7];case 8:return[2]}}))}))}),this._submit,(function(){return t._buttonEnable=!0})).filter((function(n){return n}));this._onClick=l.a.functionWrapperConstructor(i)},e.prototype._onDownloadClick=function(){return Object(o.b)(this,void 0,void 0,(function(){var n,e,t,i,a,r,c,d;return Object(o.e)(this,(function(s){switch(s.label){case 0:return this.params.downloads&&this.params.downloads.length>0?-1===(typeof this.params.downloads[0]).indexOf("function")?[3,10]:[4,l.a.functionWrapperConstructor(this.params.downloads)()]:[3,13];case 1:n=s.sent(),s.label=2;case 2:s.trys.push([2,7,8,9]),e=Object(o.k)(n),t=e.next(),s.label=3;case 3:return t.done?[3,6]:(i=t.value,[4,this.auWizard.downloadFile(i.url,i.name,i.newTab)]);case 4:s.sent(),s.label=5;case 5:return t=e.next(),[3,3];case 6:return[3,9];case 7:return a=s.sent(),c={error:a},[3,9];case 8:try{t&&!t.done&&(d=e.return)&&d.call(e)}finally{if(c)throw c.error}return[7];case 9:return[3,13];case 10:return[4,this.auWizard.downloadFilesAsZip(this.params.downloads)];case 11:return r=s.sent(),[4,this.auWizard.downloadFile(r,"files.zip",!0)];case 12:s.sent(),s.label=13;case 13:return[2]}}))}))},e.prototype._submit=function(){return this.driver.cart?this.driver.cart.submit():this.driver.orders.current.submit()},e.prototype.valueChanged=function(){this._buttonEnable=this.value,this.emitChange({value:this.value})},Object.defineProperty(e.prototype,"_",{get:function(){return this.value},enumerable:!1,configurable:!0}),e.prototype.clearSelection=function(){this.value=!1},Object(o.c)([Object(r.c)(),Object(o.g)("design:type",Boolean)],e.prototype,"value",void 0),Object(o.c)([Object(r.c)(),Object(o.g)("design:type",Boolean)],e.prototype,"_buttonEnable",void 0),Object(o.c)([Object(r.b)("value"),Object(o.g)("design:type",Function),Object(o.g)("design:paramtypes",[]),Object(o.g)("design:returntype",void 0)],e.prototype,"valueChanged",null),Object(o.c)([Object(r.a)("au-widget-finish-group",i)],e)}(a.b)}}]);