@ionic/core
Version:
Base components for Ionic
1 lines • 2.27 kB
JavaScript
import{a as n,b as i,c as e,d as a}from"./chunk-90d954cd.js";const t=()=>import("./chunk-e34b3d2d.js"),o=()=>import("./chunk-f2d9e763.js");function s(n){return new Promise((i,e)=>{n.queue.write(()=>{!function(n){const i=n.enteringEl,e=n.leavingEl;(function(i,e,a){void 0!==i&&(i.style.zIndex="back"===n.direction?"99":"101"),void 0!==e&&(e.style.zIndex="100")})(i,e),n.showGoBack?i.classList.add("can-go-back"):i.classList.remove("can-go-back"),p(i,!1),e&&p(e,!1)}(n),async function(n){const i=await async function(n){if(n.leavingEl&&n.animated&&0!==n.duration)return n.animationBuilder?n.animationBuilder:"ios"===n.mode?(await t()).iosTransitionAnimation:(await o()).mdTransitionAnimation}(n);return i?async function(n,i){await c(i,!0);const e=await import("./chunk-b43431d3.js").then(e=>e.create(n,i.baseEl,i));return l(i.enteringEl,i.leavingEl),await function(n,i){const e=i.progressCallback,a=new Promise(i=>n.onFinish(i));return e?(n.progressStart(),e(n)):n.play(),a}(e,i),i.progressCallback&&i.progressCallback(void 0),e.hasCompleted&&d(i.enteringEl,i.leavingEl),{hasCompleted:e.hasCompleted,animation:e}}(i,n):async function(n){const i=n.enteringEl,e=n.leavingEl;return await c(n,!1),l(i,e),d(i,e),{hasCompleted:!0}}(n)}(n).then(e=>{e.animation&&e.animation.destroy(),r(n),i(e)},i=>{r(n),e(i)})})})}function r(n){const i=n.leavingEl;n.enteringEl.classList.remove("ion-page-invisible"),void 0!==i&&i.classList.remove("ion-page-invisible")}async function c(n,i){const e=(void 0!==n.deepWait?n.deepWait:i)?[g(n.enteringEl),g(n.leavingEl)]:[m(n.enteringEl),m(n.leavingEl)];await Promise.all(e),await async function(n,i){n&&await n(i)}(n.viewIsReady,n.enteringEl)}function l(e,a){u(a,n),u(e,i)}function d(n,i){u(n,e),u(i,a)}function u(n,i){if(n){const e=new CustomEvent(i,{bubbles:!1,cancelable:!1});n.dispatchEvent(e)}}function m(n){return n&&n.componentOnReady?n.componentOnReady():Promise.resolve()}async function g(n){const i=n;if(i){if(null!=i.componentOnReady&&null!=await i.componentOnReady())return;await Promise.all(Array.from(i.children).map(g))}}function p(n,i){i?(n.setAttribute("aria-hidden","true"),n.classList.add("ion-page-hidden")):(n.hidden=!1,n.removeAttribute("aria-hidden"),n.classList.remove("ion-page-hidden"))}export{g as a,u as b,s as c,p as d};