forms-reactive
Version:
Reactive Form Web Component
2 lines • 3.54 kB
JavaScript
import{r as t,c as i,h as s,e}from"./p-3e1171f6.js";import{g as a}from"./p-f83a4566.js";import{a as n,d as o}from"./p-f9482dbc.js";import{s as h,c as r}from"./p-c1432a35.js";import{c}from"./p-25ec5224.js";import{t as l}from"./p-433100b9.js";import{g as d,c as f}from"./p-9c83f640.js";import"./p-8613551a.js";const u=":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;z-index:0}";const m=u;const p=class{constructor(s){t(this,s);this.ionNavWillLoad=i(this,"ionNavWillLoad",7);this.ionNavWillChange=i(this,"ionNavWillChange",3);this.ionNavDidChange=i(this,"ionNavDidChange",3);this.lockController=c();this.gestureOrAnimationInProgress=false;this.mode=d(this);this.delegate=undefined;this.animated=true;this.animation=undefined;this.swipeHandler=undefined}swipeHandlerChanged(){if(this.gesture){this.gesture.enable(this.swipeHandler!==undefined)}}async connectedCallback(){const t=()=>{this.gestureOrAnimationInProgress=true;if(this.swipeHandler){this.swipeHandler.onStart()}};this.gesture=(await import("./p-f3c69a01.js")).createSwipeBackGesture(this.el,(()=>!this.gestureOrAnimationInProgress&&!!this.swipeHandler&&this.swipeHandler.canStart()),(()=>t()),(t=>{var i;return(i=this.ani)===null||i===void 0?void 0:i.progressStep(t)}),((t,i,s)=>{if(this.ani){this.ani.onFinish((()=>{this.gestureOrAnimationInProgress=false;if(this.swipeHandler){this.swipeHandler.onEnd(t)}}),{oneTimeCallback:true});let e=t?-.001:.001;if(!t){this.ani.easing("cubic-bezier(1, 0, 0.68, 0.28)");e+=a([0,0],[1,0],[.68,.28],[1,1],i)[0]}else{e+=a([0,0],[.32,.72],[0,1],[1,1],i)[0]}this.ani.progressEnd(t?1:0,e,s)}else{this.gestureOrAnimationInProgress=false}}));this.swipeHandlerChanged()}componentWillLoad(){this.ionNavWillLoad.emit()}disconnectedCallback(){if(this.gesture){this.gesture.destroy();this.gesture=undefined}}async commit(t,i,s){const e=await this.lockController.lock();let a=false;try{a=await this.transition(t,i,s)}catch(t){console.error(t)}e();return a}async setRouteId(t,i,s,e){const a=await this.setRoot(t,i,{duration:s==="root"?0:undefined,direction:s==="back"?"back":"forward",animationBuilder:e});return{changed:a,element:this.activeEl}}async getRouteId(){const t=this.activeEl;return t?{id:t.tagName,element:t,params:this.activeParams}:undefined}async setRoot(t,i,s){if(this.activeComponent===t&&h(i,this.activeParams)){return false}const e=this.activeEl;const a=await n(this.delegate,this.el,t,["ion-page","ion-page-invisible"],i);this.activeComponent=t;this.activeEl=a;this.activeParams=i;await this.commit(a,e,s);await o(this.delegate,e);return true}async transition(t,i,s={}){if(i===t){return false}this.ionNavWillChange.emit();const{el:e,mode:a}=this;const n=this.animated&&f.getBoolean("animated",true);const o=s.animationBuilder||this.animation||f.get("navAnimation");await l(Object.assign(Object.assign({mode:a,animated:n,enteringEl:t,leavingEl:i,baseEl:e,deepWait:r(e),progressCallback:s.progressAnimation?t=>{if(t!==undefined&&!this.gestureOrAnimationInProgress){this.gestureOrAnimationInProgress=true;t.onFinish((()=>{this.gestureOrAnimationInProgress=false;if(this.swipeHandler){this.swipeHandler.onEnd(false)}}),{oneTimeCallback:true});t.progressEnd(0,0,0)}else{this.ani=t}}:undefined},s),{animationBuilder:o}));this.ionNavDidChange.emit();return true}render(){return s("slot",{key:"8d0c163c5f63158e16ef2db7cc3c756cf597461d"})}get el(){return e(this)}static get watchers(){return{swipeHandler:["swipeHandlerChanged"]}}};p.style=m;export{p as ion_router_outlet};
//# sourceMappingURL=p-9ae6d952.entry.js.map