forms-reactive
Version:
Reactive Form Web Component
11 lines • 4.23 kB
JavaScript
import{c as n}from"./p-9c83f640.js";import{w as e,B as s}from"./p-3e1171f6.js";import{p as o}from"./p-8613551a.js";import{r as t}from"./p-c1432a35.js";
/*!
* (C) Ionic http://ionicframework.com - MIT License
*/const i="ionViewWillEnter";const a="ionViewDidEnter";const c="ionViewWillLeave";const r="ionViewDidLeave";const f="ionViewWillUnload";
/*!
* (C) Ionic http://ionicframework.com - MIT License
*/const l=n=>{n.tabIndex=-1;n.focus()};const u=n=>n.offsetParent!==null;const d=()=>{const e=e=>{const s=n.get("focusManagerPriority",false);if(s){const n=document.activeElement;if(n!==null&&(e===null||e===void 0?void 0:e.contains(n))){n.setAttribute(p,"true")}}};const s=e=>{const s=n.get("focusManagerPriority",false);if(Array.isArray(s)&&!e.contains(document.activeElement)){const n=e.querySelector(`[${p}]`);if(n&&u(n)){l(n);return}for(const n of s){switch(n){case"content":const s=e.querySelector('main, [role="main"]');if(s&&u(s)){l(s);return}break;case"heading":const t=e.querySelector('h1, [role="heading"][aria-level="1"]');if(t&&u(t)){l(t);return}break;case"banner":const i=e.querySelector('header, [role="banner"]');if(i&&u(i)){l(i);return}break;default:o(`Unrecognized focus manager priority value ${n}`);break}}l(e)}};return{saveViewFocus:e,setViewFocus:s}};const p="ion-last-focus";
/*!
* (C) Ionic http://ionicframework.com - MIT License
*/const w=()=>import("./p-2ddddbd3.js");const m=()=>import("./p-a815b9a0.js");const b=d();const g=n=>new Promise(((s,o)=>{e((()=>{v(n);y(n).then((e=>{if(e.animation){e.animation.destroy()}h(n);s(e)}),(e=>{h(n);o(e)}))}))}));const v=n=>{const e=n.enteringEl;const s=n.leavingEl;b.saveViewFocus(s);U(e,s,n.direction);if(n.showGoBack){e.classList.add("can-go-back")}else{e.classList.remove("can-go-back")}F(e,false);e.style.setProperty("pointer-events","none");if(s){F(s,false);s.style.setProperty("pointer-events","none")}};const y=async n=>{const e=await P(n);const o=e&&s.isBrowser?k(e,n):V(n);return o};const h=n=>{const e=n.enteringEl;const s=n.leavingEl;e.classList.remove("ion-page-invisible");e.style.removeProperty("pointer-events");if(s!==undefined){s.classList.remove("ion-page-invisible");s.style.removeProperty("pointer-events")}b.setViewFocus(e)};const P=async n=>{if(!n.leavingEl||!n.animated||n.duration===0){return undefined}if(n.animationBuilder){return n.animationBuilder}const e=n.mode==="ios"?(await w()).iosTransitionAnimation:(await m()).mdTransitionAnimation;return e};const k=async(n,e)=>{await j(e,true);const s=n(e.baseEl,e);L(e.enteringEl,e.leavingEl);const o=await E(s,e);if(e.progressCallback){e.progressCallback(undefined)}if(o){M(e.enteringEl,e.leavingEl)}return{hasCompleted:o,animation:s}};const V=async e=>{const s=e.enteringEl;const o=e.leavingEl;const t=n.get("focusManagerPriority",false);await j(e,t);L(s,o);M(s,o);return{hasCompleted:true}};const j=async(n,e)=>{const s=n.deepWait!==undefined?n.deepWait:e;if(s){await Promise.all([D(n.enteringEl),D(n.leavingEl)])}await C(n.viewIsReady,n.enteringEl)};const C=async(n,e)=>{if(n){await n(e)}};const E=(n,e)=>{const s=e.progressCallback;const o=new Promise((e=>{n.onFinish((n=>e(n===1)))}));if(s){n.progressStart(true);s(n)}else{n.play()}return o};const L=(n,e)=>{W(e,c);W(n,i)};const M=(n,e)=>{W(n,a);W(e,r)};const W=(n,e)=>{if(n){const s=new CustomEvent(e,{bubbles:false,cancelable:false});n.dispatchEvent(s)}};const A=()=>new Promise((n=>t((()=>t((()=>n()))))));const D=async n=>{const e=n;if(e){if(e.componentOnReady!=null){const n=await e.componentOnReady();if(n!=null){return}}else if(e.__registerHost!=null){const n=new Promise((n=>t(n)));await n;return}await Promise.all(Array.from(e.children).map(D))}};const F=(n,e)=>{if(e){n.setAttribute("aria-hidden","true");n.classList.add("ion-page-hidden")}else{n.hidden=false;n.removeAttribute("aria-hidden");n.classList.remove("ion-page-hidden")}};const U=(n,e,s)=>{if(n!==undefined){n.style.zIndex=s==="back"?"99":"101"}if(e!==undefined){e.style.zIndex="100"}};const $=n=>{if(n.classList.contains("ion-page")){return n}const e=n.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs");if(e){return e}return n};export{f as L,c as a,r as b,D as d,$ as g,W as l,F as s,g as t,A as w};
//# sourceMappingURL=p-433100b9.js.map