@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
1 lines • 2.22 kB
JavaScript
(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[28],{914:function(e,t,a){a.r(t),a.d(t,"AuWidgetFunctionTrigger",function(){return o}),a.d(t,"widget",function(){return o});var t=a(0),c=a(2),i=(a(201),a(1)),n=a(37),a=a(160);let o=class extends a.a{constructor(){super(...arguments),this.enabled=!0,this._callbackPending=!1,this._lockList=[],this._finally=()=>Promise.resolve(),this._catch=()=>Promise.reject(),this._callback=()=>Promise.resolve()}_callbackPendingObserver(e){this._showPreloader(e)}updateParams(e){var t=n.Maybe.maybe(e);this.enabled=t.bind(e=>i.a.maybeGet(()=>e.enabled)).valueOr(this.enabled),this._lockList=t.bind(e=>i.a.maybeGet(()=>e.lock)).map(e=>i.a.ensureArray(e)).valueOr(this._lockList),this._finally=i.a.functionWrapperConstructor(e.finally),this._catch=i.a.functionWrapperConstructor(e.catch),this._callback=i.a.functionWrapperConstructor(e.callback)}async updateParamsAsync(e){if(await super.updateParamsAsync(e),!this.enabled)return Promise.resolve(null);this._callbackPending=!0;try{await this._callback(...e.arguments)}catch(e){console.error(e),this._catch()}finally{this._finally(),this._callbackPending=!1}}_showPreloader(t){this._lockList.forEach(e=>{e="main"===e?this.auWizard:this.auWizard.scope.$[e]||this.jsonParamsFetcher.scope[e]||this.jsonParamsFetcher.scope.$[e];e&&e.showPreloader(t)})}};Object(t.a)([Object(c.c)(),Object(t.b)("design:type",Boolean)],o.prototype,"enabled",void 0),Object(t.a)([Object(c.c)(),Object(t.b)("design:type",Boolean)],o.prototype,"_callbackPending",void 0),Object(t.a)([Object(c.c)(),Object(t.b)("design:type",Array)],o.prototype,"_lockList",void 0),Object(t.a)([Object(c.c)(),Object(t.b)("design:type",Function)],o.prototype,"_finally",void 0),Object(t.a)([Object(c.c)(),Object(t.b)("design:type",Function)],o.prototype,"_catch",void 0),Object(t.a)([Object(c.c)(),Object(t.b)("design:type",Function)],o.prototype,"_callback",void 0),Object(t.a)([Object(c.b)("_callbackPending"),Object(t.b)("design:type",Function),Object(t.b)("design:paramtypes",[Boolean]),Object(t.b)("design:returntype",void 0)],o.prototype,"_callbackPendingObserver",null),o=Object(t.a)([Object(c.a)("au-widget-function-trigger")],o)}}]);