mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
|
|
(self.webpackChunkgabinete_digital=self.webpackChunkgabinete_digital||[]).push([[8708],{38708:function(e,t,i){"use strict";i.r(t),i.d(t,{ion_nav:function(){return d},ion_nav_link:function(){return v}});var n=i(31667),s=i(36177),r=i(13772),o=i(29605),a=i(57807),h=i(60504);class c{constructor(e,t){this.component=e,this.params=t,this.state=1}async init(e){if(this.state=2,!this.element){const t=this.component;this.element=await(0,h.a)(this.delegate,e,t,["ion-page","ion-page-invisible"],this.params)}}_destroy(){(0,r.k)(3!==this.state,"view state must be ATTACHED");const e=this.element;e&&(this.delegate?this.delegate.removeViewFromDom(e.parentElement,e):e.remove()),this.nav=void 0,this.state=3}}const l=(e,t,i)=>{if(!e)return!1;if(e.component!==t)return!1;const n=e.params;if(n===i)return!0;if(!n&&!i)return!0;if(!n||!i)return!1;const s=Object.keys(n),r=Object.keys(i);if(s.length!==r.length)return!1;for(const o of s)if(n[o]!==i[o])return!1;return!0},u=(e,t)=>e?e instanceof c?e:new c(e,t):null,d=class{constructor(e){(0,n.r)(this,e),this.ionNavWillLoad=(0,n.e)(this,"ionNavWillLoad",7),this.ionNavWillChange=(0,n.e)(this,"ionNavWillChange",3),this.ionNavDidChange=(0,n.e)(this,"ionNavDidChange",3),this.transInstr=[],this.animationEnabled=!0,this.useRouter=!1,this.isTransitioning=!1,this.destroyed=!1,this.views=[],this.animated=!0}swipeGestureChanged(){this.gesture&&this.gesture.enable(!0===this.swipeGesture)}rootChanged(){void 0!==this.root&&(this.useRouter||this.setRoot(this.root,this.rootParams))}componentWillLoad(){if(this.useRouter=!!document.querySelector("ion-router")&&!this.el.closest("[no-router]"),void 0===this.swipeGesture){const e=(0,s.b)(this);this.swipeGesture=s.c.getBoolean("swipeBackEnabled","ios"===e)}this.ionNavWillLoad.emit()}async componentDidLoad(){this.rootChanged(),this.gesture=(await i.e(4172).then(i.bind(i,94172))).createSwipeBackGesture(this.el,this.canStart.bind(this),this.onStart.bind(this),this.onMove.bind(this),this.onEnd.bind(this)),this.swipeGestureChanged()}disconnectedCallback(){for(const e of this.views)(0,o.l)(e.element,o.d),e._destroy();this.gesture&&(this.gesture.destroy(),this.gesture=void 0),this.transInstr.length=this.views.length=0,this.destroyed=!0}push(e,t,i,n){return this.queueTrns({insertStart:-1,insertViews:[{component:e,componentProps:t}],opts:i},n)}insert(e,t,i,n,s){return this.queueTrns({insertStart:e,insertViews:[{component:t,componentProps:i}],opts:n},s)}insertPages(e,t,i,n){return this.queueTrns({insertStart:e,insertViews:t,opts:i},n)}pop(e,t){return this.queueTrns({removeStart:-1,removeCount:1,opts:e},t)}popTo(e,t,i){const n={removeStart:-1,removeCount:-1,opts:t};return"object"==typeof e&&e.component?(n.removeView=e,n.removeStart=1):"number"==typeof e&&(n.removeStart=e+1),this.queueTrns(n,i)}popToRoot(e,t){return this.queueTrns({removeStart:1,removeCount:-1,opts:e},t)}removeIndex(e,t=1,i,n){return this.queueTrns({removeStart:e,removeCount:t,opts:i},n)}setRoot(e,t,i,n){return this.setPages([{component:e,componentProps:t}],i,n)}setPages(e,t,i){return null==t&&(t={}),!0!==t.animated&&(t.animated=!1),this.queueTrns({insertStart:0,insertViews:e,removeStart:0,removeCount:-1,opts:t},i)}setRouteId(e,t,i,n){const s=this.getActiveSync();if(l(s,e,t))return Promise.resolve({changed:!1,element:s.element});let r;const o=new Promise(e=>r=e);let a;const h={updateURL:!1,viewIsReady:e=>{let t;const i=new Promise(e=>t=e);return r({changed:!0,element:e,markVisible:async()=>{t(),await a}}),i}};if("root"===i)a=this.setRoot(e,t,h);else{const s=this.views.find(i=>l(i,e,t));s?a=this.popTo(s,Object.assign(Object.assign({},h),{direction:"back",animationBuilder:n})):"forward"===i?a=this.push(e,t,Object.assign(Object.assign({},h),{animationBuilder:n})):"back"===i&&(a=this.setRoot(e,t,Object.assign(Object.assign({},h),{direction:"back",animated:!0,animationBuilder:n})))}return o}async getRouteId(){const e=this.getActiveSync();return e?{id:e.element.tagName,params:e.params,element:e.element}:void 0}getActive(){return Promise.resolve(this.getActiveSync())}getByIndex(e){return Promise.resolve(this.views[e])}canGoB
|