UNPKG

@aurigma/ui-framework

Version:

A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.

1 lines 8.34 kB
(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){t.r(e),t.d(e,"AuWidgetFinishGroup",function(){return r}),t.d(e,"widget",function(){return r});var o,c=t(0),e=t(868),i=t(160),a=t(2),d=t(1),r=(o=i.b,Object(c.d)(l,o),l.prototype.updateParams=function(n){var e=this,t=(this.value=(d.a.isNotNullOrUndefined(n.value)?n:this).value,this._checkboxPrompt=n.checkboxPrompt,this._checkboxEnable=!d.a.isNotNullOrUndefined(n.checkboxEnabled)||n.checkboxEnabled,this._checkboxVisible=!d.a.isNotNullOrUndefined(n.checkboxVisible)||n.checkboxVisible,this._buttonText=n.buttonText,this._buttonClassStyle=n.buttonClassStyle,this._buttonVisible=null==(t=n.buttonVisible)||t,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&&768<window.innerWidth?"18px":"0px",this.__containerJustifyContent="left"===n.downloadPosition?this._buttonVisible?"space-between":"flex-start":"flex-end",[].concat(function(){return e._buttonEnable=!1},n.onClick,function(){return Object(c.b)(e,void 0,void 0,function(){var t,e,o,i,a,r=this;return Object(c.e)(this,function(n){switch(n.label){case 0:t=[],Object.keys(this.auWizard.scope.$).forEach(function(n){var n=r.auWizard.scope.$[n],e=n.tagName.toLowerCase();-1===e.indexOf("order")&&-1===e.indexOf("cart")||t.push(n)}),n.label=1;case 1:n.trys.push([1,6,7,8]),e=Object(c.k)(t),o=e.next(),n.label=2;case 2:return o.done?[3,5]:[4,o.value.compile()];case 3:n.sent(),n.label=4;case 4:return o=e.next(),[3,2];case 5:return[3,8];case 6:return i=n.sent(),i={error:i},[3,8];case 7:try{o&&!o.done&&(a=e.return)&&a.call(e)}finally{if(i)throw i.error}return[7];case 8:return[2]}})})},this._submit,function(){return e._buttonEnable=!0}).filter(function(n){return n}));this._onClick=d.a.functionWrapperConstructor(t)},l.prototype._onDownloadClick=function(){return Object(c.b)(this,void 0,void 0,function(){var e,t,o,i,a,r,l;return Object(c.e)(this,function(n){switch(n.label){case 0:return this.params.downloads&&0<this.params.downloads.length?-1===(typeof this.params.downloads[0]).indexOf("function")?[3,10]:[4,d.a.functionWrapperConstructor(this.params.downloads)()]:[3,13];case 1:e=n.sent(),n.label=2;case 2:n.trys.push([2,7,8,9]),t=Object(c.k)(e),o=t.next(),n.label=3;case 3:return o.done?[3,6]:(i=o.value,[4,this.auWizard.downloadFile(i.url,i.name,i.newTab)]);case 4:n.sent(),n.label=5;case 5:return o=t.next(),[3,3];case 6:return[3,9];case 7:return i=n.sent(),r={error:i},[3,9];case 8:try{o&&!o.done&&(l=t.return)&&l.call(t)}finally{if(r)throw r.error}return[7];case 9:return[3,13];case 10:return[4,this.auWizard.downloadFilesAsZip(this.params.downloads)];case 11:return a=n.sent(),[4,this.auWizard.downloadFile(a,"files.zip",!0)];case 12:n.sent(),n.label=13;case 13:return[2]}})})},l.prototype._submit=function(){return(this.driver.cart||this.driver.orders.current).submit()},l.prototype.valueChanged=function(){this._buttonEnable=this.value,this.emitChange({value:this.value})},Object.defineProperty(l.prototype,"_",{get:function(){return this.value},enumerable:!1,configurable:!0}),l.prototype.clearSelection=function(){this.value=!1},Object(c.c)([Object(a.c)(),Object(c.g)("design:type",Boolean)],l.prototype,"value",void 0),Object(c.c)([Object(a.c)(),Object(c.g)("design:type",Boolean)],l.prototype,"_buttonEnable",void 0),Object(c.c)([Object(a.b)("value"),Object(c.g)("design:type",Function),Object(c.g)("design:paramtypes",[]),Object(c.g)("design:returntype",void 0)],l.prototype,"valueChanged",null),Object(c.c)([Object(a.a)("au-widget-finish-group",e)],l));function l(){var n=null!==o&&o.apply(this,arguments)||this;return n.value=!1,n._checkboxPrompt="",n._checkboxEnable=!0,n._checkboxVisible=!0,n._buttonEnable=!1,n._buttonText="",n._buttonClassStyle="",n._buttonVisible=!0,n._downloadText="",n._downloadEnable=!0,n._downloadVisible=!1,n._downloadPosition="left",n._downloadOrder=30,n._downloadMarginLeft="",n.__containerJustifyContent="",n}}}]);