@ionic/core 9.0.7-dev.11790871695.14a4111c → 9.0.7-dev.11790887756.13f9320e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/index.js +1 -1
- package/components/ion-action-sheet.js +1 -1
- package/components/ion-alert.js +1 -1
- package/components/ion-app.js +1 -1
- package/components/ion-content.js +1 -1
- package/components/ion-datetime.js +1 -1
- package/components/ion-loading.js +1 -1
- package/components/ion-menu-button.js +1 -1
- package/components/ion-menu-toggle.js +1 -1
- package/components/ion-menu.js +1 -1
- package/components/ion-modal.js +1 -1
- package/components/ion-popover.js +1 -1
- package/components/ion-select-modal.js +1 -1
- package/components/ion-select-popover.js +1 -1
- package/components/ion-select.js +1 -1
- package/components/ion-toast.js +1 -1
- package/components/{p-BinR4_P7.js → p-4QPSgC9s.js} +1 -1
- package/components/{p-CiXOsJF2.js → p-BHFF2Rku.js} +1 -1
- package/components/{p-DPyjiKOq.js → p-BRCkmCrc.js} +1 -1
- package/components/p-BsOZAFNI.js +4 -0
- package/components/p-CArDvZQz.js +4 -0
- package/components/{p-PPagT42x.js → p-CB2RQcuo.js} +1 -1
- package/components/p-CKtw0kcb.js +4 -0
- package/components/{p-CvzE7FFp.js → p-CZlKzXag.js} +1 -1
- package/components/p-CgwJ4NuD.js +4 -0
- package/components/{p-CQjNc-Pz.js → p-DjbwrsJd.js} +1 -1
- package/components/p-vg8joG77.js +4 -0
- package/dist/cjs/{index-CElfU-dK.js → index-fm08amr6.js} +2 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/ion-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/ion-alert.cjs.entry.js +1 -1
- package/dist/cjs/ion-app_8.cjs.entry.js +2 -2
- package/dist/cjs/ion-datetime.cjs.entry.js +1 -1
- package/dist/cjs/ion-loading.cjs.entry.js +1 -1
- package/dist/cjs/ion-menu_3.cjs.entry.js +5 -4
- package/dist/cjs/ion-modal.cjs.entry.js +1 -1
- package/dist/cjs/ion-popover.cjs.entry.js +1 -1
- package/dist/cjs/ion-select-modal.cjs.entry.js +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-toast.cjs.entry.js +1 -1
- package/dist/cjs/{overlays-C68wNDWY.js → overlays-CEt1Pxnd.js} +75 -16
- package/dist/collection/components/menu/menu.js +4 -3
- package/dist/collection/utils/hardware-back-button.js +41 -12
- package/dist/collection/utils/menu-controller/index.js +2 -1
- package/dist/collection/utils/overlays.js +30 -4
- package/dist/docs.json +1 -1
- package/dist/esm/{index-B9jhwvmO.js → index-CzPyKjAQ.js} +2 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/ion-action-sheet.entry.js +1 -1
- package/dist/esm/ion-alert.entry.js +1 -1
- package/dist/esm/ion-app_8.entry.js +2 -2
- package/dist/esm/ion-datetime.entry.js +1 -1
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu_3.entry.js +5 -4
- package/dist/esm/ion-modal.entry.js +1 -1
- package/dist/esm/ion-popover.entry.js +1 -1
- package/dist/esm/ion-select-modal.entry.js +1 -1
- package/dist/esm/ion-select_3.entry.js +1 -1
- package/dist/esm/ion-toast.entry.js +1 -1
- package/dist/esm/{overlays-BQnV0HAU.js → overlays-D5W_ly69.js} +74 -17
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-3a5faaa8.entry.js → p-0111c108.entry.js} +1 -1
- package/dist/ionic/{p-636349e2.entry.js → p-22160ced.entry.js} +1 -1
- package/dist/ionic/{p-24b0a961.entry.js → p-5112a8ba.entry.js} +1 -1
- package/dist/ionic/{p-f9057f70.entry.js → p-5edc856b.entry.js} +1 -1
- package/dist/ionic/{p-3bd7e5df.entry.js → p-8a00d904.entry.js} +1 -1
- package/dist/ionic/p-C036rEeA.js +4 -0
- package/dist/ionic/p-OJpZr8fg.js +4 -0
- package/dist/ionic/p-b3346b86.entry.js +4 -0
- package/dist/ionic/{p-efa00ce5.entry.js → p-b798b4ec.entry.js} +1 -1
- package/dist/ionic/{p-30dcf43b.entry.js → p-d0451c11.entry.js} +1 -1
- package/dist/ionic/{p-76309bab.entry.js → p-e063a7bf.entry.js} +1 -1
- package/dist/ionic/{p-b1164028.entry.js → p-ff664022.entry.js} +1 -1
- package/dist/ionic/{p-7441ed2b.entry.js → p-ffd45970.entry.js} +1 -1
- package/dist/types/utils/config.d.ts +4 -1
- package/dist/types/utils/hardware-back-button.d.ts +11 -0
- package/dist/types/utils/overlays.d.ts +5 -2
- package/hydrate/index.js +13 -5
- package/hydrate/index.mjs +13 -5
- package/package.json +1 -1
- package/components/p-BNnmwjuy.js +0 -4
- package/components/p-BsLM9eQu.js +0 -4
- package/components/p-DGLuPe1e.js +0 -4
- package/components/p-WMQuK_Tj.js +0 -4
- package/components/p-q2WJ5Igc.js +0 -4
- package/dist/ionic/p-83448626.entry.js +0 -4
- package/dist/ionic/p-Ba6ZV-qU.js +0 -4
- package/dist/ionic/p-DZUqAr_6.js +0 -4
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import{d as t,H as i,i as o,p as e,w as a,e as s,h as r,f as n,t as d}from"./p-BriaEJK8.js";import{i as h,b as p,a as l,d as c,r as m,f,p as u}from"./p-B8HBLiYi.js";import{C as b,a as x,d as v}from"./p-Canp1qah.js";import{p as w,g,e as k,r as y,j as A,l as Y}from"./p-DlUdjUlf.js";import{c as S}from"./p-B-hirT0v.js";import{g as C}from"./p-CIGNaXM1.js";import{G as D,O as E,F as O,n as M,d as B,B as T,h as P,r as I,j as N,k as j,e as R,f as $,g as z}from"./p-BsOZAFNI.js";import{g as L}from"./p-byZM6qHV.js";import{e as F,w as W}from"./p-CVVUo4J1.js";import{b as H}from"./p-BEiYs-sz.js";import{KEYBOARD_DID_OPEN as V}from"./p-D7-vHX0A.js";import{c as Z}from"./p-LH1I_Zhd.js";import{g as K}from"./p-hHmYLOfE.js";import{createGesture as U}from"./p-D0YpjgON.js";import{w as G}from"./p-ZjP4CjeZ.js";import{d as _}from"./p-BSJriPuC.js";var J;!function(t){t.Dark="DARK",t.Light="LIGHT",t.Default="DEFAULT"}(J||(J={}));const q={getEngine(){const t=C();if(t?.isPluginAvailable("StatusBar"))return t.Plugins.StatusBar},setStyle(t){const i=this.getEngine();i&&i.setStyle(t)},getStyle:async function(){const t=this.getEngine();if(!t)return J.Default;const{style:i}=await t.getInfo();return i}},X=(t,i)=>{if(1===i)return 0;const o=1/(1-i);return t*o+-i*o},Q=()=>{!G||G.innerWidth>=768||q.setStyle({style:J.Dark})},tt=(t=J.Default)=>{!G||G.innerWidth>=768||q.setStyle({style:t})},it=t=>{const i=h(t)?g(t).querySelector(".inner-scroll"):t;return!p(t)&&0===i.scrollTop},ot=async(t,i)=>{"function"==typeof t.canDismiss&&await t.canDismiss(void 0,D)&&(i.isRunning()?i.onFinish((()=>{t.dismiss(void 0,"handler")}),{oneTimeCallback:!0}):t.dismiss(void 0,"handler"))},et=t=>.00255275*2.71828**(-14.9619*t)-1.00255*2.71828**(-.0380968*t)+1,at=.915,st=(t,i)=>k(400,t/Math.abs(1.1*i),500),rt=(t,i)=>{const o=window.innerHeight,e=t.getBoundingClientRect().top,a=Math.round(1e3*(1-i/(o-e)))/1e3;return Math.max(0,Math.min(1,a))},nt=t=>{const{currentBreakpoint:i,backdropBreakpoint:o,expandToScroll:e}=t,a=void 0===o||o<i,s=a?`calc(var(--backdrop-opacity) * ${i})`:"0",r=Z("backdropAnimation").fromTo("opacity",0,s);return a&&r.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),{wrapperAnimation:Z("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:`translateY(${100-100*i}%)`}]),backdropAnimation:r,contentAnimation:e?void 0:Z("contentAnimation").keyframes([{offset:0,opacity:1,maxHeight:100*(1-i)+"%"},{offset:1,opacity:1,maxHeight:100*i+"%"}])}},dt=t=>{const{currentBreakpoint:i,backdropBreakpoint:o}=t,e=`calc(var(--backdrop-opacity) * ${X(i,o)})`,a=[{offset:0,opacity:e},{offset:1,opacity:0}],s=[{offset:0,opacity:e},{offset:o,opacity:0},{offset:1,opacity:0}],r=Z("backdropAnimation").keyframes(0!==o?s:a);return{wrapperAnimation:Z("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:`translateY(${100-100*i}%)`},{offset:1,opacity:1,transform:"translateY(100%)"}]),backdropAnimation:r}},ht=(t,i)=>{const{presentingEl:o,currentBreakpoint:e,expandToScroll:a}=i,s=g(t),{wrapperAnimation:r,backdropAnimation:n,contentAnimation:d}=void 0!==e?nt(i):{backdropAnimation:Z().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:Z().fromTo("transform","translateY(100vh)","translateY(0vh)"),contentAnimation:void 0};n.addElement(s.querySelector("ion-backdrop")),r.addElement(s.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1}),!a&&d?.addElement(t.querySelector(".ion-page"));const h=Z("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation([r]);if(d&&h.addAnimation(d),o){const t=window.innerWidth<768,i="ION-MODAL"===o.tagName&&void 0!==o.presentingElement,e=g(o),a=Z().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"}),s=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",e=`translateY(${i?"-10px":t}) scale(0.915)`;a.afterStyles({transform:e}).beforeAddWrite((()=>s.style.setProperty("background-color","black"))).addElement(o).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:e,borderRadius:"10px 10px 0 0"}]),h.addAnimation(a)}else if(h.addAnimation(n),i){const t=`translateY(-10px) scale(${i?at:1})`;a.afterStyles({transform:t}).addElement(e.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:t}]);const o=Z().afterStyles({transform:t}).addElement(e.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:t}]);h.addAnimation([a,o])}else r.fromTo("opacity","0","1")}else h.addAnimation(n);return h},pt=(t,i,o=500)=>{const{presentingEl:e,currentBreakpoint:a}=i,s=g(t),{wrapperAnimation:r,backdropAnimation:n}=void 0!==a?dt(i):{backdropAnimation:Z().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:Z().fromTo("transform","translateY(0vh)","translateY(100vh)")};n.addElement(s.querySelector("ion-backdrop")),r.addElement(s.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const d=Z("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o).addAnimation(r);if(e){const t=window.innerWidth<768,i="ION-MODAL"===e.tagName&&void 0!==e.presentingElement,o=g(e),a=Z().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((t=>{1===t&&(e.style.setProperty("overflow",""),Array.from(s.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((t=>void 0!==t.presentingElement)).length<=1&&s.style.setProperty("background-color",""))})),s=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",o=`translateY(${i?"-10px":t}) scale(0.915)`;a.addElement(e).keyframes([{offset:0,filter:"contrast(0.85)",transform:o,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]),d.addAnimation(a)}else if(d.addAnimation(n),i){const t=`translateY(-10px) scale(${i?at:1})`;a.addElement(o.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:t},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);const e=Z().addElement(o.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:t},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);d.addAnimation([a,e])}else r.fromTo("opacity","1","0")}else d.addAnimation(n);return d},lt=(t,i)=>{const{currentBreakpoint:o,expandToScroll:e}=i,a=g(t),{wrapperAnimation:s,backdropAnimation:r,contentAnimation:n}=void 0!==o?nt(i):{backdropAnimation:Z().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:Z().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]),contentAnimation:void 0};r.addElement(a.querySelector("ion-backdrop")),s.addElement(a.querySelector(".modal-wrapper")),!e&&n?.addElement(t.querySelector(".ion-page"));const d=Z().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([r,s]);return n&&d.addAnimation(n),d},ct=(t,i)=>{const{currentBreakpoint:o}=i,e=g(t),{wrapperAnimation:a,backdropAnimation:s}=void 0!==o?dt(i):{backdropAnimation:Z().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:Z().keyframes([{offset:0,opacity:.99,transform:"translateY(0px)"},{offset:1,opacity:0,transform:"translateY(40px)"}])};return s.addElement(e.querySelector("ion-backdrop")),a.addElement(e.querySelector(".modal-wrapper")),Z().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([s,a])};let mt=null,ft=!1;const ut=()=>{if(null!==mt)return mt;const t=G?.document;if(!t?.body)return 0;const i=t.createElement("div");i.style.cssText="position:fixed;visibility:hidden;pointer-events:none;top:0;left:0;padding-top:var(--ion-safe-area-top,0px);",t.body.appendChild(i);const o=parseFloat(getComputedStyle(i).paddingTop)||0;return i.remove(),mt=o,ft||(ft=!0,y((()=>{mt=null,ft=!1}))),o},bt=t=>{const i=getComputedStyle(t),o=M(i.getPropertyValue("--width")),e=M(i.getPropertyValue("--height"));return"fullscreen"===o&&"fullscreen"===e?{vertical:!0,horizontal:!0}:xt(t)},xt=t=>{const i=t.shadowRoot?.querySelector(".modal-wrapper");if(null==i||void 0===G)return{vertical:!1,horizontal:!1};const o=t.classList.contains("overlay-hidden");o&&t.classList.remove("overlay-hidden");const{width:e,height:a}=i.getBoundingClientRect();return o&&t.classList.add("overlay-hidden"),{vertical:a>=G.innerHeight-5,horizontal:e>=G.innerWidth-5}},vt=(t,i)=>{t.style.setProperty("--ion-safe-area-top",i.top),t.style.setProperty("--ion-safe-area-bottom",i.bottom),t.style.setProperty("--ion-safe-area-left",i.left),t.style.setProperty("--ion-safe-area-right",i.right)},wt=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.didPresent=o(this,"ionModalDidPresent",7),this.willPresent=o(this,"ionModalWillPresent",7),this.willDismiss=o(this,"ionModalWillDismiss",7),this.didDismiss=o(this,"ionModalDidDismiss",7),this.ionBreakpointDidChange=o(this,"ionBreakpointDidChange",7),this.didPresentShorthand=o(this,"didPresent",7),this.willPresentShorthand=o(this,"willPresent",7),this.willDismissShorthand=o(this,"willDismiss",7),this.didDismissShorthand=o(this,"didDismiss",7),this.ionMount=o(this,"ionMount",7),this.ionDragStart=o(this,"ionDragStart",7),this.ionDragMove=o(this,"ionDragMove",7),this.ionDragEnd=o(this,"ionDragEnd",7),this.lockController=S(),this.triggerController=B(),this.coreDelegate=b(),this.isSheetModal=!1,this.inheritedAttributes={},this.inline=!1,this.gestureAnimationDismissing=!1,this.isPresenting=!1,this.presented=!1,this.hasController=!1,this.keyboardClose=!0,this.expandToScroll=!0,this.backdropBreakpoint=0,this.handleBehavior="cycle",this.backdropDismiss=!0,this.showBackdrop=!0,this.animated=!0,this.isOpen=!1,this.keepContentsMounted=!1,this.focusTrap=!0,this.canDismiss=!0,this.onHandleClick=()=>{const{sheetTransition:t,handleBehavior:i}=this;"cycle"===i&&void 0===t&&this.moveToNextBreakpoint()},this.onBackdropTap=()=>{const{sheetTransition:t}=this;void 0===t&&this.dismiss(void 0,T)},this.onLifecycle=t=>{const i=this.usersElement,o=gt[t.type];if(i&&o){const e=new CustomEvent(o,{bubbles:!1,cancelable:!1,detail:t.detail});i.dispatchEvent(e)}},this.onModalFocus=t=>{const{dragHandleEl:i,el:o}=this;t.target===o&&null==o.shadowRoot?.activeElement&&i&&-1!==i.tabIndex&&i.focus()},this.onSlotChange=({target:t})=>{t.assignedElements().forEach((t=>{t.querySelectorAll("ion-modal").forEach((t=>{null===t.getAttribute("data-parent-ion-modal")&&t.setAttribute("data-parent-ion-modal",this.el.id)}))}))}}onIsOpenChange(t,i){!0===t&&!1===i?this.present():!1===t&&!0===i&&this.dismiss()}triggerChanged(){const{trigger:t,el:i,triggerController:o}=this;t&&o.addClickListener(i,t)}onWindowResize(){this.presented&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((()=>{const t=this.getSafeAreaContext();if(!t.isCardModal||this.enterAnimation||this.leaveAnimation||this.handleViewTransition(),t.isSheetModal&&this.updateSheetOffsetTop(),!t.isSheetModal&&!t.isCardModal){this.updateSafeAreaOverrides();const{contentEl:t,hasFooter:i}=this.findContentAndFooter();this.clearContentSafeAreaPadding(t),this.applyFullscreenSafeAreaTo(t,i)}}),50))}breakpointsChanged(t){void 0!==t&&(this.sortedBreakpoints=t.sort(((t,i)=>t-i)))}connectedCallback(){const{el:t}=this;P(t),this.triggerChanged(),(this.presented||this.isPresenting)&&this.restoreSafeAreaOverrides(),this.presented&&(I(t),this.initParentRemovalObserver())}disconnectedCallback(){this.triggerController.removeClickListener(),this.cleanupViewTransitionListener(),this.cleanupParentRemovalObserver(),this.cleanupSafeAreaOverrides(),this.presented&&N()}componentWillLoad(){const{breakpoints:t,initialBreakpoint:i,el:o,htmlAttributes:a}=this,s=this.isSheetModal=void 0!==t&&void 0!==i,r=["aria-label","role"];this.inheritedAttributes=A(o,r),o.parentNode&&(this.cachedOriginalParent=o.parentNode),void 0!==a&&r.forEach((t=>{a[t]&&(this.inheritedAttributes={...this.inheritedAttributes,[t]:a[t]},delete a[t])})),s&&(this.currentBreakpoint=this.initialBreakpoint),void 0===t||void 0===i||t.includes(i)||e("[ion-modal] - Your breakpoints array must include the initialBreakpoint value."),this.htmlAttributes?.id||j(this.el)}componentDidLoad(){!0===this.isOpen&&y((()=>this.present())),this.breakpointsChanged(this.breakpoints),this.triggerChanged()}getDelegate(t=!1){if(this.workingDelegate&&!t)return{delegate:this.workingDelegate,inline:this.inline};const i=this.inline=null!==this.el.parentNode&&!this.hasController;return{inline:i,delegate:this.workingDelegate=i?this.delegate||this.coreDelegate:this.delegate}}async checkCanDismiss(t,i){const{canDismiss:o}=this;return"function"==typeof o?o(t,i):o}async present(){const t=await this.lockController.lock();if(this.presented)return void t();const{presentingElement:i,el:o}=this;this.currentBreakpoint=this.initialBreakpoint;const{inline:e,delegate:s}=this.getDelegate(!0);this.ionMount.emit(),this.usersElement=await x(s,o,this.component,["ion-page"],this.componentProps,e),Y(o)?await F(this.usersElement):this.keepContentsMounted||await W(),a((()=>this.el.classList.add("show-modal"))),this.isSheetModal=void 0!==this.breakpoints&&void 0!==this.initialBreakpoint,this.isPresenting=!0;const r=void 0!==i;try{this.setInitialSafeAreaOverrides(),r&&"ios"===H(this)&&(this.statusBarStyle=await q.getStyle(),Q()),await R(this,"modalEnter",ht,lt,{presentingEl:i,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll})}finally{this.isPresenting=!1}this.updateSafeAreaOverrides(),this.applyFullscreenSafeArea(),"undefined"!=typeof window&&(this.keyboardOpenCallback=()=>{this.gesture&&(this.gesture.enable(!1),y((()=>{this.gesture&&this.gesture.enable(!0)})))},window.addEventListener(V,this.keyboardOpenCallback)),this.isSheetModal?this.initSheetGesture():r&&this.initSwipeToClose(),this.initViewTransitionListener(),this.initParentRemovalObserver(),t()}initSwipeToClose(){if("ios"!==H(this))return;const{el:t}=this,i=this.leaveAnimation||s.get("modalLeave",pt),o=this.animation=i(t,{presentingEl:this.presentingElement,expandToScroll:this.expandToScroll});f(t)?(this.gesture=((t,i,o,e,a,s,r)=>{const n=.5,d=t.offsetHeight;let p=!1,f=!1,u=null,b=!0,x=0;const v=U({el:t,gestureName:"modalSwipeToClose",gesturePriority:E,direction:"y",threshold:10,canStart:t=>{const i=t.event.target;return null===i||!i.closest||(u=l(i),u?it(u):null===i.closest("ion-footer"))},onStart:o=>{const{deltaY:e}=o;window.getSelection()?.removeAllRanges(),b=!u||!h(u)||u.scrollY,f=void 0!==t.canDismiss&&!0!==t.canDismiss,e>0&&u&&c(u),i.progressStart(!0,p?1:0),a()},onMove:e=>{const{deltaY:a}=e;a>0&&u&&c(u);const r=e.deltaY/d,h=r>=0&&f,p=h?.2:.9999,l=h?et(r/p):r,m=k(1e-4,l,p);i.progressStep(m),m>=n&&x<n?tt(o):m<n&&x>=n&&Q(),x=m;const b={currentY:e.currentY,deltaY:e.deltaY,velocityY:e.velocityY,progress:rt(t,e.deltaY)};s(b)},onEnd:o=>{const a=o.velocityY,s=o.deltaY/d,h=s>=0&&f,l=h?.2:.9999,c=h?et(s/l):s,x=k(1e-4,c,l),w=!h&&(o.deltaY+1e3*a)/d>=n;let g=w?-.001:.001;w?(i.easing("cubic-bezier(0.32, 0.72, 0, 1)"),g+=K([0,0],[.32,.72],[0,1],[1,1],x)[0]):(i.easing("cubic-bezier(1, 0, 0.68, 0.28)"),g+=K([0,0],[1,0],[.68,.28],[1,1],x)[0]);const y=st(w?s*d:(1-x)*d,a);p=w,v.enable(!1),u&&m(u,b),i.onFinish((()=>{w||v.enable(!0)})).progressEnd(w?1:0,g,y);const A=h&&x>l/4;A?ot(t,i):w&&e();const Y=h?A&&"function"==typeof t.canDismiss:w,S={currentY:o.currentY,deltaY:o.deltaY,velocityY:o.velocityY,progress:rt(t,o.deltaY),isDismissing:Y};r(S)}});return v})(t,o,this.statusBarStyle??J.Default,(()=>this.cardOnDismiss()),(()=>this.onDragStart()),(t=>this.onDragMove(t)),(t=>this.onDragEnd(t))),this.gesture.enable(!0)):u(t)}initSheetGesture(){const{wrapperEl:t,initialBreakpoint:i,backdropBreakpoint:o}=this;if(!t||void 0===i)return;const e=this.enterAnimation||s.get("modalEnter",ht),a=this.animation=e(this.el,{presentingEl:this.presentingElement,currentBreakpoint:i,backdropBreakpoint:o,expandToScroll:this.expandToScroll});a.progressStart(!0,1);const{gesture:r,moveSheetToBreakpoint:n,resetContentScroll:d}=((t,i,o,e,a,s,r=[],n,d,p,c,m,f,u)=>{const b={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:0!==a?[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-a,opacity:0},{offset:1,opacity:0}]:[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}],CONTENT_KEYFRAMES:[{offset:0,maxHeight:"100%"},{offset:1,maxHeight:"0%"}]},x=t.querySelector("ion-content"),v=x?.scrollY??!0,w=o.clientHeight;let A=e,Y=0,S=!1,C=null,D=null,E=null,M=null;const B=r[r.length-1],T=r[0],P=s.childAnimations.find((t=>"wrapperAnimation"===t.id)),I=s.childAnimations.find((t=>"backdropAnimation"===t.id)),N=s.childAnimations.find((t=>"contentAnimation"===t.id)),j=()=>{!1!==t.focusTrap&&!1!==t.showBackdrop&&(t.style.setProperty("pointer-events","auto"),i.style.setProperty("pointer-events","auto"),t.classList.remove(O))},R=()=>{t.style.setProperty("pointer-events","none"),i.style.setProperty("pointer-events","none"),t.classList.add(O)},$=i=>{if(!D&&(D=Array.from(t.querySelectorAll("ion-footer")),!D.length))return;const o=t.querySelector(".ion-page");if(M=i,"stationary"===i)D.forEach((t=>{t.classList.remove("modal-footer-moving"),t.style.removeProperty("position"),t.style.removeProperty("width"),t.style.removeProperty("height"),t.style.removeProperty("top"),t.style.removeProperty("left"),o?.style.removeProperty("padding-bottom"),o?.appendChild(t)}));else{let i=0;D.forEach(((o,e)=>{const a=o.getBoundingClientRect(),s=document.body.getBoundingClientRect();i+=o.clientHeight;const r=a.top-s.top,n=a.left-s.left;if(o.style.setProperty("--pinned-width",`${o.clientWidth}px`),o.style.setProperty("--pinned-height",`${o.clientHeight}px`),o.style.setProperty("--pinned-top",`${r}px`),o.style.setProperty("--pinned-left",`${n}px`),0===e){E=r;const i=t.querySelector("ion-header");i&&(E-=i.clientHeight)}})),D.forEach((t=>{o?.style.setProperty("padding-bottom",`${i}px`),t.classList.add("modal-footer-moving"),t.style.setProperty("position","absolute"),t.style.setProperty("width","var(--pinned-width)"),t.style.setProperty("height","var(--pinned-height)"),t.style.setProperty("top","var(--pinned-top)"),t.style.setProperty("left","var(--pinned-left)"),document.body.appendChild(t)}))}};P&&I&&(P.keyframes([...b.WRAPPER_KEYFRAMES]),I.keyframes([...b.BACKDROP_KEYFRAMES]),N?.keyframes([...b.CONTENT_KEYFRAMES]),s.progressStart(!0,1-A),A>a&&!1!==t.focusTrap&&!1!==t.showBackdrop?j():R()),x&&A!==B&&n&&(x.scrollY=!1);const z=i=>{const{breakpoint:o,canDismiss:e,breakpointOffset:d,animated:h}=i,l=e&&0===o,m=l?A:o,f=0!==m;return A=0,P&&I&&(P.keyframes([{offset:0,transform:`translateY(${100*d}%)`},{offset:1,transform:`translateY(${100*(1-m)}%)`}]),I.keyframes([{offset:0,opacity:`calc(var(--backdrop-opacity) * ${X(1-d,a)})`},{offset:1,opacity:`calc(var(--backdrop-opacity) * ${X(m,a)})`}]),N&&N.keyframes([{offset:0,maxHeight:100*(1-d)+"%"},{offset:1,maxHeight:100*m+"%"}]),s.progressStep(0)),H.enable(!1),l?ot(t,s):f||p(),!x||m!==r[r.length-1]&&n||(x.scrollY=v),n||0!==m||$("stationary"),new Promise((i=>{s.onFinish((()=>{f?(n||$("stationary"),P&&I?y((()=>{P.keyframes([...b.WRAPPER_KEYFRAMES]),I.keyframes([...b.BACKDROP_KEYFRAMES]),N?.keyframes([...b.CONTENT_KEYFRAMES]),s.progressStart(!0,1-m),A=m,c(A),A>a&&!1!==t.focusTrap&&!1!==t.showBackdrop?j():R(),H.enable(!0),i()})):(H.enable(!0),i())):i()}),{oneTimeCallback:!0}).progressEnd(1,0,h?500:0)}))},L=t=>{const i=o.getBoundingClientRect().top+t,e=F(i);return r.reduce(((t,i)=>Math.abs(i-e)<Math.abs(t-e)?i:t))},F=t=>{const i=r[r.length-1],o=W(r[0]),e=W(i),a=Math.round((o-t)/(o-e)*1e3)/1e3;return Math.max(0,Math.min(1,a))},W=i=>{const o=t.getBoundingClientRect();return window.innerHeight-o.height*i},H=U({el:o,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:t=>{const i=l(t.event.target);return A=d(),!(i&&(!n||1===A))||it(i)},onStart:i=>{if(window.getSelection()?.removeAllRanges(),S=void 0!==t.canDismiss&&!0!==t.canDismiss&&0===T,!n){const t=l(i.event.target);C=t&&h(t)?g(t).querySelector(".inner-scroll"):t}n||$("moving"),i.deltaY>0&&x&&(x.scrollY=!1),y((()=>{t.focus()})),s.progressStart(!0,1-A),m()},onMove:t=>{if(n||null===E||null===M||(t.currentY>=E&&"moving"===M?$("stationary"):t.currentY<E&&"stationary"===M&&$("moving")),!n&&t.deltaY<=0&&C)return;t.deltaY>0&&x&&(x.scrollY=!1);const i=r.length>1?1-r[1]:void 0,o=1-A+t.deltaY/w,e=void 0!==i&&o>=i&&S,a=e?.95:.9999,d=e&&void 0!==i?i+et((o-i)/(a-i)):o;Y=k(1e-4,d,a),s.progressStep(Y);const h=L(t.deltaY),p={currentY:t.currentY,deltaY:t.deltaY,velocityY:t.velocityY,progress:F(t.currentY),snapBreakpoint:h};f(p)},onEnd:i=>{const o=L(i.deltaY),e=S&&0===o?"function"==typeof t.canDismiss:0===o,a={currentY:i.currentY,deltaY:i.deltaY,velocityY:i.velocityY,progress:F(i.currentY),snapBreakpoint:o,isDismissing:e};if(!n&&i.deltaY<=0&&C&&C.scrollTop>0)return $("stationary"),void u({...a,isDismissing:!1});z({breakpoint:o,breakpointOffset:Y,canDismiss:S,animated:!0}),u(a)}});return{gesture:H,moveSheetToBreakpoint:z,resetContentScroll:()=>{x&&(x.scrollY=v)}}})(this.el,this.backdropEl,t,i,o,a,this.sortedBreakpoints,this.expandToScroll,(()=>this.currentBreakpoint??0),(()=>this.sheetOnDismiss()),(t=>{this.currentBreakpoint!==t&&(this.currentBreakpoint=t,this.ionBreakpointDidChange.emit({breakpoint:t}))}),(()=>this.onDragStart()),(t=>this.onDragMove(t)),(t=>this.onDragEnd(t)));this.gesture=r,this.moveSheetToBreakpoint=n,this.resetSheetContentScroll=d,this.gesture.enable(!0),(!1===this.showBackdrop||!1===this.focusTrap||o>0)&&this.setupChildRoutePassthrough()}setupChildRoutePassthrough(){this.cachedPageParent=this.getOriginalPageParent();const t=this.cachedPageParent;if(!t||"ION-APP"===t.tagName)return;if(Array.from(t.children).some((t=>!(t===this.el||t instanceof i&&"none"===window.getComputedStyle(t).display||"TEMPLATE"===t.tagName||"SLOT"===t.tagName||t.nodeType===Node.TEXT_NODE&&!t.textContent?.trim()))))return;t.classList.add("ion-page-overlay-passthrough");const o=t.parentElement;"ION-ROUTER-OUTLET"===o?.tagName&&"ION-APP"!==o.parentElement?.tagName&&(o.style.setProperty("pointer-events","none"),o.setAttribute("data-overlay-passthrough","true"))}getOriginalPageParent(){if(!this.cachedOriginalParent)return null;let t=this.cachedOriginalParent;for(;t&&!t.classList.contains("ion-page");)t=t.parentElement;return t}cleanupChildRoutePassthrough(){const t=this.cachedPageParent;if(!t)return;t.classList.remove("ion-page-overlay-passthrough");const i=t.parentElement;i?.hasAttribute("data-overlay-passthrough")&&(i.style.removeProperty("pointer-events"),i.removeAttribute("data-overlay-passthrough")),this.cachedPageParent=void 0}sheetOnDismiss(){this.gestureAnimationDismissing=!0,this.animation.onFinish((async()=>{this.currentBreakpoint=0,this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint}),await this.dismiss(void 0,D),this.gestureAnimationDismissing=!1}))}cardOnDismiss(){this.gestureAnimationDismissing=!0,tt(this.statusBarStyle),this.animation.onFinish((async()=>{await this.dismiss(void 0,D),this.gestureAnimationDismissing=!1}))}async dismiss(t,i){if(this.gestureAnimationDismissing&&i!==D)return!1;clearTimeout(this.resizeTimeout),this.resizeTimeout=void 0;const o=await this.lockController.lock();if(await this.dismissNestedModals(),"handler"!==i&&!await this.checkCanDismiss(t,i))return o(),!1;const{presentingElement:e}=this;void 0!==e&&"ios"===H(this)&&tt(this.statusBarStyle),"undefined"!=typeof window&&this.keyboardOpenCallback&&(window.removeEventListener(V,this.keyboardOpenCallback),this.keyboardOpenCallback=void 0);const s=await $(this,t,i,"modalLeave",pt,ct,{presentingEl:e,currentBreakpoint:this.currentBreakpoint??this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll});if(s){const{delegate:t}=this.getDelegate();await v(t,this.usersElement),a((()=>this.el.classList.remove("show-modal"))),this.animation&&this.animation.destroy(),this.gesture&&this.gesture.destroy(),this.resetSheetContentScroll?.(),this.resetSheetContentScroll=void 0,this.cleanupViewTransitionListener(),this.cleanupParentRemovalObserver(),this.cleanupSafeAreaOverrides(),this.cleanupChildRoutePassthrough()}return this.currentBreakpoint=void 0,this.animation=void 0,o(),s}onDidDismiss(){return z(this.el,"ionModalDidDismiss")}onWillDismiss(){return z(this.el,"ionModalWillDismiss")}async setCurrentBreakpoint(t){if(!this.isSheetModal)return void e("[ion-modal] - setCurrentBreakpoint is only supported on sheet modals.");if(!this.breakpoints.includes(t))return void e(`[ion-modal] - Attempted to set invalid breakpoint value ${t}. Please double check that the breakpoint value is part of your defined breakpoints.`);const{currentBreakpoint:i,moveSheetToBreakpoint:o,canDismiss:a,breakpoints:s,animated:r}=this;i!==t&&o&&(this.sheetTransition=o({breakpoint:t,breakpointOffset:1-i,canDismiss:void 0!==a&&!0!==a&&0===s[0],animated:r}),await this.sheetTransition,this.sheetTransition=void 0)}async getCurrentBreakpoint(){return this.currentBreakpoint}async moveToNextBreakpoint(){const{breakpoints:t,currentBreakpoint:i}=this;if(!t||null==i)return!1;const o=t.filter((t=>0!==t)),e=o.indexOf(i),a=o[(e+1)%o.length];return await this.setCurrentBreakpoint(a),!0}initViewTransitionListener(){"ios"!==H(this)||!this.presentingElement||this.enterAnimation||this.leaveAnimation||(this.currentViewIsPortrait=window.innerWidth<768)}handleViewTransition(){if(!this.presented)return;const t=window.innerWidth<768;if(this.currentViewIsPortrait===t)return;this.viewTransitionAnimation&&(this.viewTransitionAnimation.destroy(),this.viewTransitionAnimation=void 0);const{presentingElement:i}=this;if(!i)return;let o;o=this.currentViewIsPortrait&&!t?((t,i,o=300)=>{const{presentingEl:e}=i;if(!e)return Z("portrait-to-landscape-transition");const a="ION-MODAL"===e.tagName&&void 0!==e.presentingElement,s=g(e),r=document.body,n=Z("portrait-to-landscape-transition").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o),d=Z().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});if(a){const t="translateY(-10px) scale(0.915)",i="translateY(0px) scale(1)";d.addElement(e).afterStyles({transform:i}).fromTo("transform",t,i).fromTo("filter","contrast(0.85)","contrast(1)");const o=Z().addElement(s.querySelector(".modal-shadow")).afterStyles({transform:i,opacity:"0"}).fromTo("transform",t,i);n.addAnimation([d,o])}else{const i=g(t),o=Z().addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).fromTo("opacity","1","1"),a=Z().addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)","var(--backdrop-opacity)"),s=`translateY(${CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px"}) scale(0.915)`;d.addElement(e).afterStyles({transform:"translateY(0px) scale(1)","border-radius":"0px"}).beforeAddWrite((()=>r.style.setProperty("background-color",""))).fromTo("transform",s,"translateY(0px) scale(1)").fromTo("filter","contrast(0.85)","contrast(1)").fromTo("border-radius","10px 10px 0 0","0px"),n.addAnimation([d,o,a])}return n})(this.el,{presentingEl:i}):((t,i,o=300)=>{const{presentingEl:e}=i;if(!e)return Z("landscape-to-portrait-transition");const a="ION-MODAL"===e.tagName&&void 0!==e.presentingElement,s=g(e),r=document.body,n=Z("landscape-to-portrait-transition").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o),d=Z().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});if(a){const t="translateY(-10px) scale(0.915)",i="translateY(0) scale(1)";d.addElement(e).afterStyles({transform:i}).fromTo("transform",t,i);const o=Z().addElement(s.querySelector(".modal-shadow")).afterStyles({transform:i,opacity:"0"}).fromTo("transform",t,i);n.addAnimation([d,o])}else{const i=g(t),o=Z().addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).fromTo("opacity","1","1"),a=Z().addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)","var(--backdrop-opacity)"),s=`translateY(${CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px"}) scale(0.915)`;d.addElement(e).afterStyles({transform:s}).beforeAddWrite((()=>r.style.setProperty("background-color","black"))).keyframes([{offset:0,transform:"translateY(0px) scale(1)",filter:"contrast(1)",borderRadius:"0px"},{offset:.2,transform:"translateY(0px) scale(1)",filter:"contrast(1)",borderRadius:"10px 10px 0 0"},{offset:1,transform:s,filter:"contrast(0.85)",borderRadius:"10px 10px 0 0"}]),n.addAnimation([d,o,a])}return n})(this.el,{presentingEl:i}),this.currentViewIsPortrait=t,this.viewTransitionAnimation=o,o.play().then((()=>{this.viewTransitionAnimation=void 0,y((()=>this.updateSafeAreaOverrides())),this.reinitSwipeToClose()}))}cleanupViewTransitionListener(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=void 0),this.viewTransitionAnimation&&(this.viewTransitionAnimation.destroy(),this.viewTransitionAnimation=void 0)}reinitSwipeToClose(){"ios"===H(this)&&this.presentingElement&&(this.gesture&&(this.gesture.destroy(),this.gesture=void 0),this.animation&&(this.animation.progressEnd(0,0,0),this.animation.destroy(),this.animation=void 0),y((()=>{this.ensureCorrectModalPosition(),this.initSwipeToClose()})))}ensureCorrectModalPosition(){const{el:t,presentingElement:i}=this,o=g(t).querySelector(".modal-wrapper");if(o&&(o.style.transform="translateY(0vh)",o.style.opacity="1"),"ION-MODAL"===i?.tagName)if(window.innerWidth<768){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px";i.style.transform=`translateY(${t}) scale(0.915)`}else i.style.transform="translateY(0px) scale(1)"}async dismissNestedModals(){const t=document.querySelectorAll(`ion-modal[data-parent-ion-modal="${this.el.id}"]`);t?.forEach((async t=>{await t.dismiss(void 0,"parent-dismissed")}))}initParentRemovalObserver(){"undefined"!=typeof MutationObserver&&"undefined"!=typeof window&&this.cachedOriginalParent&&this.cachedOriginalParent.nodeType!==Node.DOCUMENT_NODE&&this.cachedOriginalParent.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&(this.hasController||this.cachedOriginalParent===document.body||"ION-APP"===this.cachedOriginalParent.tagName||(this.cleanupParentRemovalObserver(),this.parentRemovalObserver=new MutationObserver((t=>{t.forEach((t=>{"childList"===t.type&&t.removedNodes.length>0&&(Array.from(t.removedNodes).some((t=>{const i=t===this.cachedOriginalParent,o=!!this.cachedOriginalParent&&t.contains?.(this.cachedOriginalParent);return i||o}))||this.cachedOriginalParent&&!this.cachedOriginalParent.isConnected)&&(this.dismiss(void 0,"parent-removed"),this.cachedOriginalParent=void 0)}))})),this.parentRemovalObserver.observe(document.body,{childList:!0,subtree:!0})))}cleanupParentRemovalObserver(){this.parentRemovalObserver?.disconnect(),this.parentRemovalObserver=void 0}onDragStart(){this.ionDragStart.emit()}onDragMove(t){this.ionDragMove.emit(t)}onDragEnd(t){this.ionDragEnd.emit(t)}getSafeAreaContext(){return{isSheetModal:this.isSheetModal,isCardModal:void 0!==this.presentingElement&&"ios"===H(this),presentingElement:this.presentingElement,breakpoints:this.breakpoints,currentBreakpoint:this.currentBreakpoint}}watchHeightForContent(){var t;this.isSheetModal||(this.unsubscribeHeightChange?.(),this.unsubscribeHeightChange=(t=()=>{this.el.querySelectorAll("ion-content").forEach((t=>t.recalculateDimensions()))},w(this.el,"--height",(()=>t()))))}setInitialSafeAreaOverrides(){const t={...this.getSafeAreaContext(),coveredAxes:bt(this.el)},i=(t=>{const{isSheetModal:i,isCardModal:o}=t;if(i)return{top:"0px",bottom:"inherit",left:"0px",right:"0px"};if(o)return{top:"inherit",bottom:"inherit",left:"0px",right:"0px"};const{vertical:e,horizontal:a}=t.coveredAxes??{vertical:!0,horizontal:!0};return{top:e?"inherit":"0px",bottom:e?"inherit":"0px",left:a?"inherit":"0px",right:a?"inherit":"0px"}})(t);var o;vt(this.el,i),this.watchHeightForContent(),t.isSheetModal&&(this.updateSheetOffsetTop(),this.unsubscribeRootSafeAreaTop?.(),this.unsubscribeRootSafeAreaTop=(o=t=>this.updateSheetOffsetTop(t),w(G?.document?.body,"--ion-safe-area-top",o,ut())))}updateSheetOffsetTop(t){const i=t??ut();this.el.style.setProperty("--ion-modal-offset-top",`${i}px`)}updateSafeAreaOverrides(){const{wrapperEl:t,el:i}=this,o=this.getSafeAreaContext();if(o.isSheetModal)return;if(o.isCardModal)return;if(!t)return;const e=(t=>{const i=t.getBoundingClientRect();return{top:i.top<=5?"inherit":"0px",bottom:i.bottom>=(G?.innerHeight??0)-5?"inherit":"0px",left:i.left<=5?"inherit":"0px",right:i.right>=(G?.innerWidth??0)-5?"inherit":"0px"}})(t);vt(i,e)}applyFullscreenSafeArea(){const t=this.getSafeAreaContext();if(t.isSheetModal||t.isCardModal)return;const{contentEl:i,hasFooter:o}=this.findContentAndFooter();this.applyFullscreenSafeAreaTo(i,o)}applyFullscreenSafeAreaTo(t,i){t&&!i&&t.style.setProperty("--internal-content-safe-area-padding-bottom","var(--ion-safe-area-bottom, 0px)")}clearContentSafeAreaPadding(t){t&&t.style.removeProperty("--internal-content-safe-area-padding-bottom")}findContentAndFooter(){let t=null,i=!1;for(const o of Array.from(this.el.children)){"ION-CONTENT"===o.tagName&&(t=o),"ION-FOOTER"===o.tagName&&(i=!0);for(const e of Array.from(o.children))"ION-CONTENT"!==e.tagName||t||(t=e),"ION-FOOTER"===e.tagName&&(i=!0)}return{contentEl:t,hasFooter:i}}cleanupSafeAreaOverrides(){var t;(t=this.el).style.removeProperty("--ion-safe-area-top"),t.style.removeProperty("--ion-safe-area-bottom"),t.style.removeProperty("--ion-safe-area-left"),t.style.removeProperty("--ion-safe-area-right"),this.unsubscribeRootSafeAreaTop?.(),this.unsubscribeRootSafeAreaTop=void 0,this.unsubscribeHeightChange?.(),this.unsubscribeHeightChange=void 0,this.el.style.removeProperty("--ion-modal-offset-top");const{contentEl:i}=this.findContentAndFooter();this.clearContentSafeAreaPadding(i)}restoreSafeAreaOverrides(){this.setInitialSafeAreaOverrides(),this.applyFullscreenSafeArea(),y((()=>{if(!this.presented||!this.el.isConnected||this.isPresenting)return;const{width:t,height:i}=this.el.getBoundingClientRect();0===t&&0===i||this.updateSafeAreaOverrides()}))}render(){const{handle:t,isSheetModal:i,presentingElement:o,htmlAttributes:e,handleBehavior:a,inheritedAttributes:s,focusTrap:d,expandToScroll:h}=this,p=!1!==t&&i,l=H(this),c=void 0!==o&&"ios"===l,m="cycle"===a;return r(n,{key:"17a95bd7722bac2344bea041aff97db17f55c0cf","no-router":!0,tabIndex:m&&i&&p?0:-1,...e,style:{zIndex:`${2e4+this.overlayIndex}`},class:{[l]:!0,"modal-default":!c&&!i,"modal-card":c,"modal-sheet":i,"modal-no-expand-scroll":i&&!h,"overlay-hidden":!0,[O]:!1===d,...L(this.cssClass)},onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle,onFocus:this.onModalFocus},r("ion-backdrop",{key:"9dab1ef4771c0d847ba2be8672afbaa2748517f3",ref:t=>this.backdropEl=t,visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),"ios"===l&&r("div",{key:"64af7ed1c5f552b61fc4b9387b926acc76c8a99a",class:"modal-shadow"}),r("div",{key:"7e76d77d5b2e8f0467bb793facf5aa86f8d01bbe",role:"dialog",...s,"aria-modal":"true",tabIndex:-1,class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:t=>this.wrapperEl=t},p&&r("button",{key:"5efc0bb0a59adcc594ac48da9fd90e57908a7ffb",class:"modal-handle",tabIndex:m?0:-1,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:m?this.onHandleClick:void 0,part:"handle",ref:t=>this.dragHandleEl=t}),r("slot",{key:"6175fcd0b39c086b4e9eb9e96c4d631c2a86774b",onSlotchange:this.onSlotChange})))}get el(){return this}static get watchers(){return{isOpen:[{onIsOpenChange:0}],trigger:[{triggerChanged:0}],breakpoints:[{breakpointsChanged:0}]}}static get style(){return{ios:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:100%;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;outline:none}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-modal-offset-top, 0px) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}',md:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:100%;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;outline:none}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-modal-offset-top, 0px) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}'}}},[289,"ion-modal",{hasController:[4,"has-controller"],overlayIndex:[2,"overlay-index"],delegate:[16],keyboardClose:[4,"keyboard-close"],enterAnimation:[16],leaveAnimation:[16],breakpoints:[16],expandToScroll:[4,"expand-to-scroll"],initialBreakpoint:[2,"initial-breakpoint"],backdropBreakpoint:[2,"backdrop-breakpoint"],handle:[4],handleBehavior:[1,"handle-behavior"],component:[1],componentProps:[16],cssClass:[1,"css-class"],backdropDismiss:[4,"backdrop-dismiss"],showBackdrop:[4,"show-backdrop"],animated:[4],presentingElement:[16],htmlAttributes:[16],isOpen:[4,"is-open"],trigger:[1],keepContentsMounted:[4,"keep-contents-mounted"],focusTrap:[4,"focus-trap"],canDismiss:[4,"can-dismiss"],isSheetModal:[32],presented:[32],present:[64],dismiss:[64],onDidDismiss:[64],onWillDismiss:[64],setCurrentBreakpoint:[64],getCurrentBreakpoint:[64]},[[9,"resize","onWindowResize"]],{isOpen:[{onIsOpenChange:0}],trigger:[{triggerChanged:0}],breakpoints:[{breakpointsChanged:0}]}]),gt={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};function kt(){"undefined"!=typeof customElements&&["ion-modal","ion-backdrop"].forEach((t=>{switch(t){case"ion-modal":customElements.get(d(t))||customElements.define(d(t),wt);break;case"ion-backdrop":customElements.get(d(t))||_()}}))}export{wt as M,kt as d}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{d as t,H as o,i,k as s,j as e,h as n,f as r,t as l}from"./p-BriaEJK8.js";import{i as a,l as c,c as h}from"./p-DlUdjUlf.js";import{n as d}from"./p-WMQuK_Tj.js";import{b as f,a as p}from"./p-BEiYs-sz.js";import{i as u}from"./p-Dojwmvde.js";import{h as m,c as v}from"./p-byZM6qHV.js";const b=t(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.ionScrollStart=i(this,"ionScrollStart",7),this.ionScroll=i(this,"ionScroll",7),this.ionScrollEnd=i(this,"ionScrollEnd",7),this.watchDog=null,this.isScrolling=!1,this.lastScroll=0,this.queued=!1,this.cTop=-1,this.cBottom=-1,this.isMainContent=!0,this.resizeTimeout=null,this.inheritedAttributes={},this.tabsElement=null,this.detail={scrollTop:0,scrollLeft:0,type:"scroll",event:void 0,startX:0,startY:0,startTime:0,currentX:0,currentY:0,velocityX:0,velocityY:0,deltaX:0,deltaY:0,currentTime:0,data:void 0,isScrolling:!0},this.sizeToContent=!1,this.fullscreen=!1,this.fixedSlotPlacement="after",this.scrollX=!1,this.scrollY=!0,this.scrollEvents=!1}fullscreenChanged(){this.setupFullscreenResizeObserver()}componentWillLoad(){this.inheritedAttributes=a(this.el),this.sizeToContent=this.readSizeToContent()}connectedCallback(){if(this.isMainContent=null===this.el.closest("ion-menu, ion-popover, ion-modal"),c(this.el)){const t=this.tabsElement=this.el.closest("ion-tabs");null!==t&&(this.tabsLoadCallback=()=>this.resize(),t.addEventListener("ionTabBarLoaded",this.tabsLoadCallback))}this.setupFullscreenResizeObserver(),this.updateSizeToContent()}componentDidLoad(){this.setupFullscreenResizeObserver()}disconnectedCallback(){if(this.onScrollEnd(),c(this.el)){const{tabsElement:t,tabsLoadCallback:o}=this;null!==t&&void 0!==o&&t.removeEventListener("ionTabBarLoaded",o),this.tabsElement=null,this.tabsLoadCallback=void 0}this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.destroyFullscreenResizeObserver()}setupFullscreenResizeObserver(){"undefined"!=typeof ResizeObserver&&(this.fullscreen&&!m("ion-popover",this.el)?void 0===this.fullscreenResizeObserver&&(this.fullscreenResizeObserver=new ResizeObserver((()=>{null!==this.el.offsetParent&&this.resize()})),this.fullscreenResizeObserver.observe(this.el)):this.destroyFullscreenResizeObserver())}updateSizeToContent(){s((()=>{this.sizeToContent=this.readSizeToContent()}))}destroyFullscreenResizeObserver(){void 0!==this.fullscreenResizeObserver&&(this.fullscreenResizeObserver.disconnect(),this.fullscreenResizeObserver=void 0)}onResize(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.resizeTimeout=setTimeout((()=>{null!==this.el.offsetParent&&this.resize()}),100)}shouldForceOverscroll(){const{forceOverscroll:t}=this,o=f(this);return void 0===t?"ios"===o&&p("ios"):t}readSizeToContent(){if(m("ion-popover",this.el))return!0;const t=this.el.closest("ion-modal");if(null===t)return!1;const o=getComputedStyle(t).getPropertyValue("--height");return"content"===d(o)}resize(){this.updateSizeToContent(),this.fullscreen?s((()=>this.readDimensions())):0===this.cTop&&0===this.cBottom||(this.cTop=this.cBottom=0,e(this))}async recalculateDimensions(){s((()=>this.readDimensions())),this.updateSizeToContent()}readDimensions(){const t=g(this.el),o=Math.max(this.el.offsetTop,0),i=Math.max(t.offsetHeight-o-this.el.offsetHeight,0);(o!==this.cTop||i!==this.cBottom)&&(this.cTop=o,this.cBottom=i,e(this))}onScroll(t){const o=Date.now(),i=!this.isScrolling;this.lastScroll=o,i&&this.onScrollStart(),!this.queued&&this.scrollEvents&&(this.queued=!0,s((o=>{this.queued=!1,this.detail.event=t,x(this.detail,this.scrollEl,o,i),this.ionScroll.emit(this.detail)})))}async getScrollElement(){return this.scrollEl||await new Promise((t=>h(this.el,t))),Promise.resolve(this.scrollEl)}async getBackgroundElement(){return this.backgroundContentEl||await new Promise((t=>h(this.el,t))),Promise.resolve(this.backgroundContentEl)}scrollToTop(t=0){return this.scrollToPoint(void 0,0,t)}async scrollToBottom(t=0){const o=await this.getScrollElement();return this.scrollToPoint(void 0,o.scrollHeight-o.clientHeight,t)}async scrollByPoint(t,o,i){const s=await this.getScrollElement();return this.scrollToPoint(t+s.scrollLeft,o+s.scrollTop,i)}async scrollToPoint(t,o,i=0){const s=await this.getScrollElement();if(i<32)return null!=o&&(s.scrollTop=o),void(null!=t&&(s.scrollLeft=t));let e,n=0;const r=new Promise((t=>e=t)),l=s.scrollTop,a=s.scrollLeft,c=null!=o?o-l:0,h=null!=t?t-a:0,d=t=>{const o=Math.min(1,(t-n)/i)-1,r=Math.pow(o,3)+1;0!==c&&(s.scrollTop=Math.floor(r*c+l)),0!==h&&(s.scrollLeft=Math.floor(r*h+a)),r<1?requestAnimationFrame(d):e()};return requestAnimationFrame((t=>{n=t,d(t)})),r}onScrollStart(){this.isScrolling=!0,this.ionScrollStart.emit({isScrolling:!0}),this.watchDog&&clearInterval(this.watchDog),this.watchDog=setInterval((()=>{this.lastScroll<Date.now()-120&&this.onScrollEnd()}),100)}onScrollEnd(){this.watchDog&&clearInterval(this.watchDog),this.watchDog=null,this.isScrolling&&(this.isScrolling=!1,this.ionScrollEnd.emit({isScrolling:!1}))}render(){const{fixedSlotPlacement:t,inheritedAttributes:o,isMainContent:i,scrollX:s,scrollY:e,el:l}=this,a=u(l)?"rtl":"ltr",c=f(this),h=this.shouldForceOverscroll(),d="ios"===c;return this.resize(),n(r,{key:"e1013621096729354ef92915af52dd823e69fdff",role:i?"main":void 0,class:v(this.color,{[c]:!0,"content-fullscreen":this.fullscreen,"content-sizing":this.sizeToContent,overscroll:h,[`content-${a}`]:!0}),style:{"--offset-top":`${this.cTop}px`,"--offset-bottom":`${this.cBottom}px`},...o},n("div",{key:"3d8649b164d6324beaa1bc50e1d204ad06c2ec1a",ref:t=>this.backgroundContentEl=t,id:"background-content",part:"background"}),"before"===t?n("slot",{name:"fixed"}):null,n("div",{key:"dd2d3bed8690b4f5027a43f5ec60e7e7df18106d",class:{"inner-scroll":!0,"scroll-x":s,"scroll-y":e,overscroll:(s||e)&&h},ref:t=>this.scrollEl=t,onScroll:this.scrollEvents?t=>this.onScroll(t):void 0,part:"scroll"},n("slot",{key:"dc3d4584d9e9afd43699525a619b8e873078fbbf"})),d?n("div",{class:"transition-effect"},n("div",{class:"transition-cover"}),n("div",{class:"transition-shadow"})):null,"after"===t?n("slot",{name:"fixed"}):null)}get el(){return this}static get watchers(){return{fullscreen:[{fullscreenChanged:0}]}}static get style(){return':host{--background:var(--ion-background-color, #fff);--color:var(--ion-text-color, #000);--padding-top:0px;--padding-bottom:0px;--padding-start:0px;--padding-end:0px;--keyboard-offset:0px;--offset-top:0px;--offset-bottom:0px;--overflow:auto;display:block;position:relative;-ms-flex:1;flex:1;width:100%;height:100%;margin:0 !important;padding:0 !important;font-family:var(--ion-font-family, inherit);contain:size style}:host(.ion-color) .inner-scroll{background:var(--ion-color-base);color:var(--ion-color-contrast)}#background-content{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);position:absolute;background:var(--background)}.inner-scroll{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:calc(var(--padding-top) + var(--offset-top));padding-bottom:calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom) + var(--internal-content-safe-area-padding-bottom, 0px));position:absolute;color:var(--color);-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;-ms-touch-action:pan-x pan-y pinch-zoom;touch-action:pan-x pan-y pinch-zoom}.scroll-y,.scroll-x{-webkit-overflow-scrolling:touch;z-index:0;will-change:scroll-position}.scroll-y{overflow-y:var(--overflow);overscroll-behavior-y:contain}.scroll-x{overflow-x:var(--overflow);overscroll-behavior-x:contain}.overscroll::before,.overscroll::after{position:absolute;width:1px;height:1px;content:""}.overscroll::before{bottom:-1px}.overscroll::after{top:-1px}:host(.content-sizing){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:0;contain:none}:host(.content-sizing) .inner-scroll{position:relative;top:0;bottom:0;margin-top:calc(var(--offset-top) * -1);margin-bottom:calc(var(--offset-bottom) * -1)}.transition-effect{display:none;position:absolute;width:100%;height:100vh;opacity:0;pointer-events:none}:host(.content-ltr) .transition-effect{left:-100%;}:host(.content-rtl) .transition-effect{right:-100%;}.transition-cover{position:absolute;right:0;width:100%;height:100%;background:black;opacity:0.1}.transition-shadow{display:block;position:absolute;width:100%;height:100%;-webkit-box-shadow:inset -9px 0 9px 0 rgba(0, 0, 100, 0.03);box-shadow:inset -9px 0 9px 0 rgba(0, 0, 100, 0.03)}:host(.content-ltr) .transition-shadow{right:0;}:host(.content-rtl) .transition-shadow{left:0;-webkit-transform:scaleX(-1);transform:scaleX(-1)}::slotted([slot=fixed]){position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0)}'}},[257,"ion-content",{color:[513],fullscreen:[4],fixedSlotPlacement:[1,"fixed-slot-placement"],forceOverscroll:[1028,"force-overscroll"],scrollX:[4,"scroll-x"],scrollY:[4,"scroll-y"],scrollEvents:[4,"scroll-events"],sizeToContent:[32],recalculateDimensions:[64],getScrollElement:[64],getBackgroundElement:[64],scrollToTop:[64],scrollToBottom:[64],scrollByPoint:[64],scrollToPoint:[64]},[[9,"resize","onResize"]],{fullscreen:[{fullscreenChanged:0}]}]),g=t=>{const o=t.closest("ion-tabs");if(o)return o;return t.closest("ion-app, ion-page, .ion-page, page-inner, .popover-content")||(t=>t.parentElement?t.parentElement:t.parentNode?.host?t.parentNode.host:null)(t)},x=(t,o,i,s)=>{const e=t.currentX,n=t.currentY,r=o.scrollLeft,l=o.scrollTop,a=i-t.currentTime;if(s&&(t.startTime=i,t.startX=r,t.startY=l,t.velocityX=t.velocityY=0),t.currentTime=i,t.currentX=t.scrollLeft=r,t.currentY=t.scrollTop=l,t.deltaX=r-t.startX,t.deltaY=l-t.startY,a>0&&a<100){const o=(l-n)/a;t.velocityX=(r-e)/a*.7+.3*t.velocityX,t.velocityY=.7*o+.3*t.velocityY}};function y(){"undefined"!=typeof customElements&&["ion-content"].forEach((t=>{"ion-content"===t&&(customElements.get(l(t))||customElements.define(l(t),b))}))}export{b as C,y as d}
|
|
4
|
+
import{d as t,H as o,i,k as s,j as e,h as n,f as r,t as l}from"./p-BriaEJK8.js";import{i as a,l as c,c as h}from"./p-DlUdjUlf.js";import{n as d}from"./p-BsOZAFNI.js";import{b as f,a as p}from"./p-BEiYs-sz.js";import{i as u}from"./p-Dojwmvde.js";import{h as m,c as v}from"./p-byZM6qHV.js";const b=t(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.ionScrollStart=i(this,"ionScrollStart",7),this.ionScroll=i(this,"ionScroll",7),this.ionScrollEnd=i(this,"ionScrollEnd",7),this.watchDog=null,this.isScrolling=!1,this.lastScroll=0,this.queued=!1,this.cTop=-1,this.cBottom=-1,this.isMainContent=!0,this.resizeTimeout=null,this.inheritedAttributes={},this.tabsElement=null,this.detail={scrollTop:0,scrollLeft:0,type:"scroll",event:void 0,startX:0,startY:0,startTime:0,currentX:0,currentY:0,velocityX:0,velocityY:0,deltaX:0,deltaY:0,currentTime:0,data:void 0,isScrolling:!0},this.sizeToContent=!1,this.fullscreen=!1,this.fixedSlotPlacement="after",this.scrollX=!1,this.scrollY=!0,this.scrollEvents=!1}fullscreenChanged(){this.setupFullscreenResizeObserver()}componentWillLoad(){this.inheritedAttributes=a(this.el),this.sizeToContent=this.readSizeToContent()}connectedCallback(){if(this.isMainContent=null===this.el.closest("ion-menu, ion-popover, ion-modal"),c(this.el)){const t=this.tabsElement=this.el.closest("ion-tabs");null!==t&&(this.tabsLoadCallback=()=>this.resize(),t.addEventListener("ionTabBarLoaded",this.tabsLoadCallback))}this.setupFullscreenResizeObserver(),this.updateSizeToContent()}componentDidLoad(){this.setupFullscreenResizeObserver()}disconnectedCallback(){if(this.onScrollEnd(),c(this.el)){const{tabsElement:t,tabsLoadCallback:o}=this;null!==t&&void 0!==o&&t.removeEventListener("ionTabBarLoaded",o),this.tabsElement=null,this.tabsLoadCallback=void 0}this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.destroyFullscreenResizeObserver()}setupFullscreenResizeObserver(){"undefined"!=typeof ResizeObserver&&(this.fullscreen&&!m("ion-popover",this.el)?void 0===this.fullscreenResizeObserver&&(this.fullscreenResizeObserver=new ResizeObserver((()=>{null!==this.el.offsetParent&&this.resize()})),this.fullscreenResizeObserver.observe(this.el)):this.destroyFullscreenResizeObserver())}updateSizeToContent(){s((()=>{this.sizeToContent=this.readSizeToContent()}))}destroyFullscreenResizeObserver(){void 0!==this.fullscreenResizeObserver&&(this.fullscreenResizeObserver.disconnect(),this.fullscreenResizeObserver=void 0)}onResize(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.resizeTimeout=setTimeout((()=>{null!==this.el.offsetParent&&this.resize()}),100)}shouldForceOverscroll(){const{forceOverscroll:t}=this,o=f(this);return void 0===t?"ios"===o&&p("ios"):t}readSizeToContent(){if(m("ion-popover",this.el))return!0;const t=this.el.closest("ion-modal");if(null===t)return!1;const o=getComputedStyle(t).getPropertyValue("--height");return"content"===d(o)}resize(){this.updateSizeToContent(),this.fullscreen?s((()=>this.readDimensions())):0===this.cTop&&0===this.cBottom||(this.cTop=this.cBottom=0,e(this))}async recalculateDimensions(){s((()=>this.readDimensions())),this.updateSizeToContent()}readDimensions(){const t=g(this.el),o=Math.max(this.el.offsetTop,0),i=Math.max(t.offsetHeight-o-this.el.offsetHeight,0);(o!==this.cTop||i!==this.cBottom)&&(this.cTop=o,this.cBottom=i,e(this))}onScroll(t){const o=Date.now(),i=!this.isScrolling;this.lastScroll=o,i&&this.onScrollStart(),!this.queued&&this.scrollEvents&&(this.queued=!0,s((o=>{this.queued=!1,this.detail.event=t,x(this.detail,this.scrollEl,o,i),this.ionScroll.emit(this.detail)})))}async getScrollElement(){return this.scrollEl||await new Promise((t=>h(this.el,t))),Promise.resolve(this.scrollEl)}async getBackgroundElement(){return this.backgroundContentEl||await new Promise((t=>h(this.el,t))),Promise.resolve(this.backgroundContentEl)}scrollToTop(t=0){return this.scrollToPoint(void 0,0,t)}async scrollToBottom(t=0){const o=await this.getScrollElement();return this.scrollToPoint(void 0,o.scrollHeight-o.clientHeight,t)}async scrollByPoint(t,o,i){const s=await this.getScrollElement();return this.scrollToPoint(t+s.scrollLeft,o+s.scrollTop,i)}async scrollToPoint(t,o,i=0){const s=await this.getScrollElement();if(i<32)return null!=o&&(s.scrollTop=o),void(null!=t&&(s.scrollLeft=t));let e,n=0;const r=new Promise((t=>e=t)),l=s.scrollTop,a=s.scrollLeft,c=null!=o?o-l:0,h=null!=t?t-a:0,d=t=>{const o=Math.min(1,(t-n)/i)-1,r=Math.pow(o,3)+1;0!==c&&(s.scrollTop=Math.floor(r*c+l)),0!==h&&(s.scrollLeft=Math.floor(r*h+a)),r<1?requestAnimationFrame(d):e()};return requestAnimationFrame((t=>{n=t,d(t)})),r}onScrollStart(){this.isScrolling=!0,this.ionScrollStart.emit({isScrolling:!0}),this.watchDog&&clearInterval(this.watchDog),this.watchDog=setInterval((()=>{this.lastScroll<Date.now()-120&&this.onScrollEnd()}),100)}onScrollEnd(){this.watchDog&&clearInterval(this.watchDog),this.watchDog=null,this.isScrolling&&(this.isScrolling=!1,this.ionScrollEnd.emit({isScrolling:!1}))}render(){const{fixedSlotPlacement:t,inheritedAttributes:o,isMainContent:i,scrollX:s,scrollY:e,el:l}=this,a=u(l)?"rtl":"ltr",c=f(this),h=this.shouldForceOverscroll(),d="ios"===c;return this.resize(),n(r,{key:"e1013621096729354ef92915af52dd823e69fdff",role:i?"main":void 0,class:v(this.color,{[c]:!0,"content-fullscreen":this.fullscreen,"content-sizing":this.sizeToContent,overscroll:h,[`content-${a}`]:!0}),style:{"--offset-top":`${this.cTop}px`,"--offset-bottom":`${this.cBottom}px`},...o},n("div",{key:"3d8649b164d6324beaa1bc50e1d204ad06c2ec1a",ref:t=>this.backgroundContentEl=t,id:"background-content",part:"background"}),"before"===t?n("slot",{name:"fixed"}):null,n("div",{key:"dd2d3bed8690b4f5027a43f5ec60e7e7df18106d",class:{"inner-scroll":!0,"scroll-x":s,"scroll-y":e,overscroll:(s||e)&&h},ref:t=>this.scrollEl=t,onScroll:this.scrollEvents?t=>this.onScroll(t):void 0,part:"scroll"},n("slot",{key:"dc3d4584d9e9afd43699525a619b8e873078fbbf"})),d?n("div",{class:"transition-effect"},n("div",{class:"transition-cover"}),n("div",{class:"transition-shadow"})):null,"after"===t?n("slot",{name:"fixed"}):null)}get el(){return this}static get watchers(){return{fullscreen:[{fullscreenChanged:0}]}}static get style(){return':host{--background:var(--ion-background-color, #fff);--color:var(--ion-text-color, #000);--padding-top:0px;--padding-bottom:0px;--padding-start:0px;--padding-end:0px;--keyboard-offset:0px;--offset-top:0px;--offset-bottom:0px;--overflow:auto;display:block;position:relative;-ms-flex:1;flex:1;width:100%;height:100%;margin:0 !important;padding:0 !important;font-family:var(--ion-font-family, inherit);contain:size style}:host(.ion-color) .inner-scroll{background:var(--ion-color-base);color:var(--ion-color-contrast)}#background-content{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);position:absolute;background:var(--background)}.inner-scroll{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:calc(var(--padding-top) + var(--offset-top));padding-bottom:calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom) + var(--internal-content-safe-area-padding-bottom, 0px));position:absolute;color:var(--color);-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;-ms-touch-action:pan-x pan-y pinch-zoom;touch-action:pan-x pan-y pinch-zoom}.scroll-y,.scroll-x{-webkit-overflow-scrolling:touch;z-index:0;will-change:scroll-position}.scroll-y{overflow-y:var(--overflow);overscroll-behavior-y:contain}.scroll-x{overflow-x:var(--overflow);overscroll-behavior-x:contain}.overscroll::before,.overscroll::after{position:absolute;width:1px;height:1px;content:""}.overscroll::before{bottom:-1px}.overscroll::after{top:-1px}:host(.content-sizing){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:0;contain:none}:host(.content-sizing) .inner-scroll{position:relative;top:0;bottom:0;margin-top:calc(var(--offset-top) * -1);margin-bottom:calc(var(--offset-bottom) * -1)}.transition-effect{display:none;position:absolute;width:100%;height:100vh;opacity:0;pointer-events:none}:host(.content-ltr) .transition-effect{left:-100%;}:host(.content-rtl) .transition-effect{right:-100%;}.transition-cover{position:absolute;right:0;width:100%;height:100%;background:black;opacity:0.1}.transition-shadow{display:block;position:absolute;width:100%;height:100%;-webkit-box-shadow:inset -9px 0 9px 0 rgba(0, 0, 100, 0.03);box-shadow:inset -9px 0 9px 0 rgba(0, 0, 100, 0.03)}:host(.content-ltr) .transition-shadow{right:0;}:host(.content-rtl) .transition-shadow{left:0;-webkit-transform:scaleX(-1);transform:scaleX(-1)}::slotted([slot=fixed]){position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0)}'}},[257,"ion-content",{color:[513],fullscreen:[4],fixedSlotPlacement:[1,"fixed-slot-placement"],forceOverscroll:[1028,"force-overscroll"],scrollX:[4,"scroll-x"],scrollY:[4,"scroll-y"],scrollEvents:[4,"scroll-events"],sizeToContent:[32],recalculateDimensions:[64],getScrollElement:[64],getBackgroundElement:[64],scrollToTop:[64],scrollToBottom:[64],scrollByPoint:[64],scrollToPoint:[64]},[[9,"resize","onResize"]],{fullscreen:[{fullscreenChanged:0}]}]),g=t=>{const o=t.closest("ion-tabs");if(o)return o;return t.closest("ion-app, ion-page, .ion-page, page-inner, .popover-content")||(t=>t.parentElement?t.parentElement:t.parentNode?.host?t.parentNode.host:null)(t)},x=(t,o,i,s)=>{const e=t.currentX,n=t.currentY,r=o.scrollLeft,l=o.scrollTop,a=i-t.currentTime;if(s&&(t.startTime=i,t.startX=r,t.startY=l,t.velocityX=t.velocityY=0),t.currentTime=i,t.currentX=t.scrollLeft=r,t.currentY=t.scrollTop=l,t.deltaX=r-t.startX,t.deltaY=l-t.startY,a>0&&a<100){const o=(l-n)/a;t.velocityX=(r-e)/a*.7+.3*t.velocityX,t.velocityY=.7*o+.3*t.velocityY}};function y(){"undefined"!=typeof customElements&&["ion-content"].forEach((t=>{"ion-content"===t&&(customElements.get(l(t))||customElements.define(l(t),b))}))}export{b as C,y as d}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import{d as t}from"./p-ZjP4CjeZ.js";import{MENU_BACK_BUTTON_PRIORITY as e,addCloseWatcherCondition as n}from"./p-CArDvZQz.js";import{p as r}from"./p-BriaEJK8.js";import{c as s}from"./p-DlUdjUlf.js";import{b as a}from"./p-BEiYs-sz.js";import{c as o}from"./p-LH1I_Zhd.js";const i=t=>o().duration(t?400:300),u=t=>{let e,n;const r=t.width+8,s=o(),u=o();t.isEndSide?(e=r+"px",n="0px"):(e=-r+"px",n="0px"),s.addElement(t.menuInnerEl).fromTo("transform",`translateX(${e})`,`translateX(${n})`);const c="ios"===a(t),p=c?.2:.25;return u.addElement(t.backdropEl).fromTo("opacity",.01,p),i(c).addAnimation([s,u])},c=t=>{let e,n;const r=a(t),s=t.width;t.isEndSide?(e=-s+"px",n=s+"px"):(e=s+"px",n=-s+"px");const u=o().addElement(t.menuInnerEl).fromTo("transform",`translateX(${n})`,"translateX(0px)"),c=o().addElement(t.contentEl).fromTo("transform","translateX(0px)",`translateX(${e})`),p=o().addElement(t.backdropEl).fromTo("opacity",.01,.32);return i("ios"===r).addAnimation([u,c,p])},p=t=>{const e=a(t),n=t.width*(t.isEndSide?-1:1)+"px",r=o().addElement(t.contentEl).fromTo("transform","translateX(0px)",`translateX(${n})`);return i("ios"===e).addAnimation(r)},m=(()=>{const a=new Map,o=[],i=async(t,e=!1)=>{if(await h(),"start"===t||"end"===t){const n=o.filter((e=>e.side===t&&!e.disabled));if(n.length>=1)return n.length>1&&e&&r(`menuController queried for a menu on the "${t}" side, but ${n.length} menus were found. The first menu reference will be used. If this is not the behavior you want then pass the ID of the menu instead of its side.`,n.map((t=>t.el))),n[0].el;const s=o.filter((e=>e.side===t));if(s.length>=1)return s.length>1&&e&&r(`menuController queried for a menu on the "${t}" side, but ${s.length} menus were found. The first menu reference will be used. If this is not the behavior you want then pass the ID of the menu instead of its side.`,s.map((t=>t.el))),s[0].el}else if(null!=t)return w((e=>e.menuId===t));return w((t=>!t.disabled))||(o.length>0?o[0].el:void 0)},m=async()=>(await h(),l()),f=(t,e)=>{a.set(t,e)},l=()=>w((t=>t._isOpen)),d=()=>o.some((t=>t.isAnimating)),w=t=>{const e=o.find(t);if(void 0!==e)return e.el},h=()=>Promise.all(Array.from(document.querySelectorAll("ion-menu")).map((t=>new Promise((e=>s(t,e))))));return f("reveal",p),f("push",c),f("overlay",u),n((()=>void 0!==l())),t?.addEventListener("ionBackButton",(t=>{const n=l();n&&t.detail.register(e,(()=>n.close()))})),{registerAnimation:f,get:i,getMenus:async()=>(await h(),o.map((t=>t.el))),getOpen:m,isEnabled:async t=>{const e=await i(t);return!!e&&!e.disabled},swipeGesture:async(t,e)=>{const n=await i(e);return n&&(n.swipeGesture=t),n},isAnimating:async()=>(await h(),d()),isOpen:async t=>{if(null!=t){const e=await i(t);return void 0!==e&&e.isOpen()}return void 0!==await m()},enable:async(t,e)=>{const n=await i(e);return n&&(n.disabled=!t),n},toggle:async t=>{const e=await i(t,!0);return!!e&&e.toggle()},close:async t=>{const e=await(void 0!==t?i(t,!0):m());return void 0!==e&&e.close()},open:async t=>{const e=await i(t,!0);return!!e&&e.open()},_getOpenSync:l,_createAnimation:(t,e)=>{const n=a.get(t);if(!n)throw new Error("animation not registered");return n(e)},_register:t=>{o.indexOf(t)<0&&o.push(t)},_unregister:t=>{const e=o.indexOf(t);e>-1&&o.splice(e,1)},_setOpen:async(t,e,n,r)=>{if(d())return!1;if(e){const e=await m();e&&t.el!==e&&await e.setOpen(!1,!1)}return t._setOpen(e,n,r)}}})();export{m}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
6
|
var helpers = require('./helpers-Crluoxqu.js');
|
|
7
|
-
var hardwareBackButton = require('./overlays-
|
|
7
|
+
var hardwareBackButton = require('./overlays-CEt1Pxnd.js');
|
|
8
8
|
var index = require('./index-SAR1xwtW.js');
|
|
9
9
|
var ionicGlobal = require('./ionic-global-C1h8Yi_K.js');
|
|
10
10
|
var animation = require('./animation-BFKyYY11.js');
|
|
@@ -273,6 +273,7 @@ const createMenuController = () => {
|
|
|
273
273
|
registerAnimation('reveal', menuRevealAnimation);
|
|
274
274
|
registerAnimation('push', menuPushAnimation);
|
|
275
275
|
registerAnimation('overlay', menuOverlayAnimation);
|
|
276
|
+
hardwareBackButton.addCloseWatcherCondition(() => _getOpenSync() !== undefined);
|
|
276
277
|
helpers.doc?.addEventListener('ionBackButton', (ev) => {
|
|
277
278
|
const openMenu = _getOpenSync();
|
|
278
279
|
if (openMenu) {
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -15,8 +15,8 @@ var index$2 = require('./index-SAR1xwtW.js');
|
|
|
15
15
|
var index$3 = require('./index-BSD7toMO.js');
|
|
16
16
|
var config = require('./config-CjUbvdPW.js');
|
|
17
17
|
var theme = require('./theme-Bw0rpaNN.js');
|
|
18
|
-
var index$4 = require('./index-
|
|
19
|
-
var hardwareBackButton = require('./overlays-
|
|
18
|
+
var index$4 = require('./index-fm08amr6.js');
|
|
19
|
+
var hardwareBackButton = require('./overlays-CEt1Pxnd.js');
|
|
20
20
|
require('./gesture-controller-CeJslptU.js');
|
|
21
21
|
require('./dir-zwDPRE5K.js');
|
|
22
22
|
require('./framework-delegate-DTLbqaaO.js');
|
|
@@ -7,7 +7,7 @@ var index = require('./index-SAR1xwtW.js');
|
|
|
7
7
|
var buttonActive = require('./button-active-CEQaiV9N.js');
|
|
8
8
|
var helpers = require('./helpers-Crluoxqu.js');
|
|
9
9
|
var lockController = require('./lock-controller-aDB9wrEf.js');
|
|
10
|
-
var hardwareBackButton = require('./overlays-
|
|
10
|
+
var hardwareBackButton = require('./overlays-CEt1Pxnd.js');
|
|
11
11
|
var selectOptionRender = require('./select-option-render-C-Yh9yZG.js');
|
|
12
12
|
var theme = require('./theme-Bw0rpaNN.js');
|
|
13
13
|
var ionicGlobal = require('./ionic-global-C1h8Yi_K.js');
|
|
@@ -9,7 +9,7 @@ var buttonActive = require('./button-active-CEQaiV9N.js');
|
|
|
9
9
|
var helpers = require('./helpers-Crluoxqu.js');
|
|
10
10
|
var lockController = require('./lock-controller-aDB9wrEf.js');
|
|
11
11
|
var overlayControlLabel = require('./overlay-control-label-D2sdL2O8.js');
|
|
12
|
-
var hardwareBackButton = require('./overlays-
|
|
12
|
+
var hardwareBackButton = require('./overlays-CEt1Pxnd.js');
|
|
13
13
|
var index$1 = require('./index-BSD7toMO.js');
|
|
14
14
|
var selectOptionRender = require('./select-option-render-C-Yh9yZG.js');
|
|
15
15
|
var theme = require('./theme-Bw0rpaNN.js');
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
6
|
var index = require('./index-SAR1xwtW.js');
|
|
7
|
-
var hardwareBackButton = require('./overlays-
|
|
7
|
+
var hardwareBackButton = require('./overlays-CEt1Pxnd.js');
|
|
8
8
|
var ionicGlobal = require('./ionic-global-C1h8Yi_K.js');
|
|
9
9
|
var helpers = require('./helpers-Crluoxqu.js');
|
|
10
10
|
var dir = require('./dir-zwDPRE5K.js');
|
|
@@ -43,7 +43,7 @@ const App = class {
|
|
|
43
43
|
const platform = ionicGlobal.isPlatform(window, 'ios') ? 'ios' : 'android';
|
|
44
44
|
Promise.resolve().then(function () { return require('./input-shims-CHghGZe-.js'); }).then((module) => module.startInputShims(index.config, platform));
|
|
45
45
|
}
|
|
46
|
-
const hardwareBackButtonModule = await Promise.resolve().then(function () { return require('./overlays-
|
|
46
|
+
const hardwareBackButtonModule = await Promise.resolve().then(function () { return require('./overlays-CEt1Pxnd.js'); }).then(function (n) { return n.hardwareBackButton; });
|
|
47
47
|
const supportsHardwareBackButtonEvents = isHybrid || hardwareBackButton.shouldUseCloseWatcher();
|
|
48
48
|
if (index.config.getBoolean('hardwareBackButton', supportsHardwareBackButtonEvents)) {
|
|
49
49
|
hardwareBackButtonModule.startHardwareBackButton();
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
var index = require('./index-SAR1xwtW.js');
|
|
7
7
|
var focusVisible = require('./focus-visible-CCvKiLh3.js');
|
|
8
8
|
var helpers = require('./helpers-Crluoxqu.js');
|
|
9
|
-
var hardwareBackButton = require('./overlays-
|
|
9
|
+
var hardwareBackButton = require('./overlays-CEt1Pxnd.js');
|
|
10
10
|
var dir = require('./dir-zwDPRE5K.js');
|
|
11
11
|
var theme = require('./theme-Bw0rpaNN.js');
|
|
12
12
|
var index$1 = require('./index-wOmugbdg.js');
|
|
@@ -7,7 +7,7 @@ var index = require('./index-SAR1xwtW.js');
|
|
|
7
7
|
var config = require('./config-CjUbvdPW.js');
|
|
8
8
|
var helpers = require('./helpers-Crluoxqu.js');
|
|
9
9
|
var lockController = require('./lock-controller-aDB9wrEf.js');
|
|
10
|
-
var hardwareBackButton = require('./overlays-
|
|
10
|
+
var hardwareBackButton = require('./overlays-CEt1Pxnd.js');
|
|
11
11
|
var index$1 = require('./index-BSD7toMO.js');
|
|
12
12
|
var theme = require('./theme-Bw0rpaNN.js');
|
|
13
13
|
var ionicGlobal = require('./ionic-global-C1h8Yi_K.js');
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
var index = require('./index-SAR1xwtW.js');
|
|
7
7
|
var cubicBezier = require('./cubic-bezier-DAjy1V-e.js');
|
|
8
|
-
var hardwareBackButton = require('./overlays-
|
|
8
|
+
var hardwareBackButton = require('./overlays-CEt1Pxnd.js');
|
|
9
9
|
var gestureController = require('./gesture-controller-CeJslptU.js');
|
|
10
10
|
var helpers = require('./helpers-Crluoxqu.js');
|
|
11
|
-
var index$1 = require('./index-
|
|
11
|
+
var index$1 = require('./index-fm08amr6.js');
|
|
12
12
|
var ionicGlobal = require('./ionic-global-C1h8Yi_K.js');
|
|
13
13
|
var theme = require('./theme-Bw0rpaNN.js');
|
|
14
14
|
var index$2 = require('./index-wOmugbdg.js');
|
|
@@ -565,6 +565,7 @@ const Menu = class {
|
|
|
565
565
|
// emit opened/closed events
|
|
566
566
|
this._isOpen = isOpen;
|
|
567
567
|
this.isAnimating = false;
|
|
568
|
+
hardwareBackButton.updateCloseWatcher();
|
|
568
569
|
if (!this._isOpen) {
|
|
569
570
|
this.blocker.unblock();
|
|
570
571
|
}
|
|
@@ -661,14 +662,14 @@ const Menu = class {
|
|
|
661
662
|
* the ionBackButton listener in the menu controller
|
|
662
663
|
* will handle closing the menu when Escape is pressed.
|
|
663
664
|
*/
|
|
664
|
-
return (index.h(index.Host, { key: '
|
|
665
|
+
return (index.h(index.Host, { key: '5cf26df26d4e539860cbeaea98ec621b98c3fcfc', onKeyDown: hardwareBackButton.shouldUseCloseWatcher() ? null : this.onKeydown, role: "navigation", "aria-label": inheritedAttributes['aria-label'] || 'menu', class: {
|
|
665
666
|
[mode]: true,
|
|
666
667
|
[`menu-type-${type}`]: true,
|
|
667
668
|
'menu-enabled': !disabled,
|
|
668
669
|
[`menu-side-${side}`]: true,
|
|
669
670
|
'menu-pane-visible': isPaneVisible,
|
|
670
671
|
'split-pane-side': theme.hostContext('ion-split-pane', el),
|
|
671
|
-
} }, index.h("div", { key: '
|
|
672
|
+
} }, index.h("div", { key: 'f337016e293bb8665c99762e0c389dd6c372bb33', class: "menu-inner", part: "container", ref: (el) => (this.menuInnerEl = el) }, index.h("slot", { key: '4c3fe331aa42cd57d7ad9bd1f5910f8eeb62d7da' })), index.h("ion-backdrop", { key: '61af7ea876d81574841e1dd3e81e2352e555d096', ref: (el) => (this.backdropEl = el), class: "menu-backdrop", tappable: false, stopPropagation: false, part: "backdrop" })));
|
|
672
673
|
}
|
|
673
674
|
get el() { return index.getElement(this); }
|
|
674
675
|
static get watchers() { return {
|
|
@@ -9,7 +9,7 @@ var frameworkDelegate = require('./framework-delegate-DTLbqaaO.js');
|
|
|
9
9
|
var helpers = require('./helpers-Crluoxqu.js');
|
|
10
10
|
var lockController = require('./lock-controller-aDB9wrEf.js');
|
|
11
11
|
var capacitor = require('./capacitor-BMzmHhwe.js');
|
|
12
|
-
var hardwareBackButton = require('./overlays-
|
|
12
|
+
var hardwareBackButton = require('./overlays-CEt1Pxnd.js');
|
|
13
13
|
var theme = require('./theme-Bw0rpaNN.js');
|
|
14
14
|
var index$3 = require('./index-CgXTRA_-.js');
|
|
15
15
|
var ionicGlobal = require('./ionic-global-C1h8Yi_K.js');
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
6
|
var index = require('./index-SAR1xwtW.js');
|
|
7
|
-
var hardwareBackButton = require('./overlays-
|
|
7
|
+
var hardwareBackButton = require('./overlays-CEt1Pxnd.js');
|
|
8
8
|
var frameworkDelegate = require('./framework-delegate-DTLbqaaO.js');
|
|
9
9
|
var helpers = require('./helpers-Crluoxqu.js');
|
|
10
10
|
var lockController = require('./lock-controller-aDB9wrEf.js');
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
var index = require('./index-SAR1xwtW.js');
|
|
7
7
|
var ionicGlobal = require('./ionic-global-C1h8Yi_K.js');
|
|
8
8
|
var overlayControlLabel = require('./overlay-control-label-D2sdL2O8.js');
|
|
9
|
-
var hardwareBackButton = require('./overlays-
|
|
9
|
+
var hardwareBackButton = require('./overlays-CEt1Pxnd.js');
|
|
10
10
|
var selectOptionRender = require('./select-option-render-C-Yh9yZG.js');
|
|
11
11
|
var theme = require('./theme-Bw0rpaNN.js');
|
|
12
12
|
require('./helpers-Crluoxqu.js');
|
|
@@ -9,7 +9,7 @@ var slotMutationController = require('./slot-mutation-controller-zixZ5LyH.js');
|
|
|
9
9
|
var compareWithUtils = require('./compare-with-utils-DSicavqM.js');
|
|
10
10
|
var validity = require('./validity-BpS37YFM.js');
|
|
11
11
|
var helpers = require('./helpers-Crluoxqu.js');
|
|
12
|
-
var hardwareBackButton = require('./overlays-
|
|
12
|
+
var hardwareBackButton = require('./overlays-CEt1Pxnd.js');
|
|
13
13
|
var dir = require('./dir-zwDPRE5K.js');
|
|
14
14
|
var index$2 = require('./index-BSD7toMO.js');
|
|
15
15
|
var theme = require('./theme-Bw0rpaNN.js');
|
|
@@ -7,7 +7,7 @@ var index = require('./index-SAR1xwtW.js');
|
|
|
7
7
|
var config = require('./config-CjUbvdPW.js');
|
|
8
8
|
var helpers = require('./helpers-Crluoxqu.js');
|
|
9
9
|
var lockController = require('./lock-controller-aDB9wrEf.js');
|
|
10
|
-
var hardwareBackButton = require('./overlays-
|
|
10
|
+
var hardwareBackButton = require('./overlays-CEt1Pxnd.js');
|
|
11
11
|
var index$2 = require('./index-BSD7toMO.js');
|
|
12
12
|
var theme = require('./theme-Bw0rpaNN.js');
|
|
13
13
|
var ionicGlobal = require('./ionic-global-C1h8Yi_K.js');
|
|
@@ -35,6 +35,23 @@ const shouldUseCloseWatcher = () => index.config.get('experimentalCloseWatcher',
|
|
|
35
35
|
const blockHardwareBackButton = () => {
|
|
36
36
|
document.addEventListener('backbutton', () => { });
|
|
37
37
|
};
|
|
38
|
+
const closeWatcherConditions = [];
|
|
39
|
+
let syncCloseWatcher;
|
|
40
|
+
/**
|
|
41
|
+
* Registers a check for whether the back button
|
|
42
|
+
* has something to close. The CloseWatcher is only
|
|
43
|
+
* active while one of these checks passes.
|
|
44
|
+
*/
|
|
45
|
+
const addCloseWatcherCondition = (condition) => {
|
|
46
|
+
closeWatcherConditions.push(condition);
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Call this whenever something the back button
|
|
50
|
+
* can close opens or closes.
|
|
51
|
+
*/
|
|
52
|
+
const updateCloseWatcher = () => {
|
|
53
|
+
syncCloseWatcher?.();
|
|
54
|
+
};
|
|
38
55
|
const startHardwareBackButton = () => {
|
|
39
56
|
const doc = document;
|
|
40
57
|
let busy = false;
|
|
@@ -86,32 +103,44 @@ const startHardwareBackButton = () => {
|
|
|
86
103
|
processHandlers();
|
|
87
104
|
};
|
|
88
105
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* events firing.
|
|
106
|
+
* Android WebView never sends the hardware back
|
|
107
|
+
* button to a CloseWatcher, so hybrid apps still
|
|
108
|
+
* need this. Browsers never fire backbutton.
|
|
93
109
|
*/
|
|
110
|
+
doc.addEventListener('backbutton', backButtonCallback);
|
|
94
111
|
if (shouldUseCloseWatcher()) {
|
|
95
112
|
let watcher;
|
|
96
|
-
|
|
97
|
-
|
|
113
|
+
/**
|
|
114
|
+
* An active CloseWatcher stops the back button from
|
|
115
|
+
* navigating, so only keep one while there's something to close.
|
|
116
|
+
*/
|
|
117
|
+
syncCloseWatcher = () => {
|
|
118
|
+
const canClose = closeWatcherConditions.some((condition) => condition());
|
|
119
|
+
if (!canClose) {
|
|
120
|
+
watcher?.destroy();
|
|
121
|
+
watcher = undefined;
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (watcher !== undefined) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
98
127
|
watcher = new helpers.win.CloseWatcher();
|
|
99
128
|
/**
|
|
100
129
|
* Once a close request happens
|
|
101
130
|
* the watcher gets destroyed.
|
|
102
131
|
* As a result, we need to re-configure
|
|
103
132
|
* the watcher so we can respond to other
|
|
104
|
-
* close requests
|
|
133
|
+
* close requests, including after one that
|
|
134
|
+
* closed nothing, like a modal whose canDismiss
|
|
135
|
+
* returned false.
|
|
105
136
|
*/
|
|
106
137
|
watcher.onclose = () => {
|
|
138
|
+
watcher = undefined;
|
|
107
139
|
backButtonCallback();
|
|
108
|
-
|
|
140
|
+
syncCloseWatcher?.();
|
|
109
141
|
};
|
|
110
142
|
};
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
doc.addEventListener('backbutton', backButtonCallback);
|
|
143
|
+
syncCloseWatcher();
|
|
115
144
|
}
|
|
116
145
|
};
|
|
117
146
|
const OVERLAY_BACK_BUTTON_PRIORITY = 100;
|
|
@@ -121,9 +150,11 @@ var hardwareBackButton = /*#__PURE__*/Object.freeze({
|
|
|
121
150
|
__proto__: null,
|
|
122
151
|
MENU_BACK_BUTTON_PRIORITY: MENU_BACK_BUTTON_PRIORITY,
|
|
123
152
|
OVERLAY_BACK_BUTTON_PRIORITY: OVERLAY_BACK_BUTTON_PRIORITY,
|
|
153
|
+
addCloseWatcherCondition: addCloseWatcherCondition,
|
|
124
154
|
blockHardwareBackButton: blockHardwareBackButton,
|
|
125
155
|
shouldUseCloseWatcher: shouldUseCloseWatcher,
|
|
126
|
-
startHardwareBackButton: startHardwareBackButton
|
|
156
|
+
startHardwareBackButton: startHardwareBackButton,
|
|
157
|
+
updateCloseWatcher: updateCloseWatcher
|
|
127
158
|
});
|
|
128
159
|
|
|
129
160
|
/**
|
|
@@ -209,6 +240,11 @@ const focusElementInContext = (hostToFocus, fallbackElement) => {
|
|
|
209
240
|
|
|
210
241
|
let lastOverlayIndex = 0;
|
|
211
242
|
let lastId = 0;
|
|
243
|
+
/**
|
|
244
|
+
* Every overlay except toast, which doesn't trap
|
|
245
|
+
* focus or close on back.
|
|
246
|
+
*/
|
|
247
|
+
const NON_TOAST_OVERLAYS = 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-popover';
|
|
212
248
|
const activeAnimations = new WeakMap();
|
|
213
249
|
/**
|
|
214
250
|
* Determines if the overlay's backdrop is always blocking (no background interaction).
|
|
@@ -335,7 +371,7 @@ const focusElementInOverlay = (hostToFocus, overlay) => {
|
|
|
335
371
|
* Should NOT include: Toast
|
|
336
372
|
*/
|
|
337
373
|
const trapKeyboardFocus = (ev, doc) => {
|
|
338
|
-
const lastOverlay = getPresentedOverlay(doc,
|
|
374
|
+
const lastOverlay = getPresentedOverlay(doc, NON_TOAST_OVERLAYS);
|
|
339
375
|
const target = ev.target;
|
|
340
376
|
/**
|
|
341
377
|
* If no active overlay, ignore this event.
|
|
@@ -518,6 +554,11 @@ const connectListeners = (doc) => {
|
|
|
518
554
|
doc.addEventListener('focus', (ev) => {
|
|
519
555
|
trapKeyboardFocus(ev, doc);
|
|
520
556
|
}, true);
|
|
557
|
+
/**
|
|
558
|
+
* Whether the overlay actually dismisses is checked at press time,
|
|
559
|
+
* since `backdropDismiss` can change while it's open.
|
|
560
|
+
*/
|
|
561
|
+
addCloseWatcherCondition(() => getPresentedOverlay(doc, NON_TOAST_OVERLAYS) !== undefined);
|
|
521
562
|
// handle back-button click
|
|
522
563
|
doc.addEventListener('ionBackButton', (ev) => {
|
|
523
564
|
const lastOverlay = getPresentedOverlay(doc);
|
|
@@ -641,7 +682,8 @@ const setRootAriaHidden = (hidden = false) => {
|
|
|
641
682
|
* Cleans up root `aria-hidden` and `backdrop-no-scroll` when
|
|
642
683
|
* an overlay is removed from the DOM without going through
|
|
643
684
|
* the `dismiss()` flow (e.g., when a framework unmounts the
|
|
644
|
-
* overlay during a route change).
|
|
685
|
+
* overlay during a route change). Also releases the
|
|
686
|
+
* CloseWatcher if nothing is left to close.
|
|
645
687
|
*
|
|
646
688
|
* Should be called from an overlay's `disconnectedCallback`
|
|
647
689
|
* when the overlay was still presented at the time of removal.
|
|
@@ -650,6 +692,7 @@ const cleanupRootFocusTrapAccessibility = () => {
|
|
|
650
692
|
if (typeof document === 'undefined') {
|
|
651
693
|
return;
|
|
652
694
|
}
|
|
695
|
+
updateCloseWatcher();
|
|
653
696
|
const remainingOverlays = getPresentedOverlays(document);
|
|
654
697
|
const hasRemainingLocking = remainingOverlays.some((o) => locksAppRoot(o));
|
|
655
698
|
if (!hasRemainingLocking) {
|
|
@@ -671,7 +714,9 @@ const applyRootLock = (el) => {
|
|
|
671
714
|
};
|
|
672
715
|
/**
|
|
673
716
|
* Re-applies the root lock that `cleanupRootFocusTrapAccessibility()` released.
|
|
674
|
-
* Call from `connectedCallback` when the overlay is still presented.
|
|
717
|
+
* Call from `connectedCallback` when the overlay is still presented. Also
|
|
718
|
+
* re-arms the CloseWatcher, which every overlay needs, so that happens
|
|
719
|
+
* before the `locksAppRoot` check.
|
|
675
720
|
*
|
|
676
721
|
* A synchronous move keeps the overlay connected, so the lock survives. A
|
|
677
722
|
* detach with a re-insert in a later task releases it, which is the shape a
|
|
@@ -681,6 +726,7 @@ const restoreRootFocusTrapAccessibility = (overlayEl) => {
|
|
|
681
726
|
if (typeof document === 'undefined') {
|
|
682
727
|
return;
|
|
683
728
|
}
|
|
729
|
+
updateCloseWatcher();
|
|
684
730
|
const el = overlayEl;
|
|
685
731
|
if (!locksAppRoot(el)) {
|
|
686
732
|
return;
|
|
@@ -894,6 +940,11 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
894
940
|
index.printIonError(`[${overlay.el.tagName.toLowerCase()}] - `, err);
|
|
895
941
|
}
|
|
896
942
|
overlay.el.remove();
|
|
943
|
+
/**
|
|
944
|
+
* Release the back button if nothing
|
|
945
|
+
* else is left to close.
|
|
946
|
+
*/
|
|
947
|
+
updateCloseWatcher();
|
|
897
948
|
return true;
|
|
898
949
|
};
|
|
899
950
|
const getAppRoot = (doc) => {
|
|
@@ -902,6 +953,12 @@ const getAppRoot = (doc) => {
|
|
|
902
953
|
const overlayAnimation = async (overlay, animationBuilder, baseEl, opts) => {
|
|
903
954
|
// Make overlay visible in case it's hidden
|
|
904
955
|
baseEl.classList.remove('overlay-hidden');
|
|
956
|
+
/**
|
|
957
|
+
* Removing `overlay-hidden` makes the overlay count
|
|
958
|
+
* as presented, so back can dismiss it while it
|
|
959
|
+
* animates in.
|
|
960
|
+
*/
|
|
961
|
+
updateCloseWatcher();
|
|
905
962
|
const aniRoot = overlay.el;
|
|
906
963
|
const animation = animationBuilder(aniRoot, opts);
|
|
907
964
|
if (!overlay.animated || !index.config.getBoolean('animated', true)) {
|
|
@@ -1131,6 +1188,7 @@ exports.GESTURE = GESTURE;
|
|
|
1131
1188
|
exports.MENU_BACK_BUTTON_PRIORITY = MENU_BACK_BUTTON_PRIORITY;
|
|
1132
1189
|
exports.OVERLAY_GESTURE_PRIORITY = OVERLAY_GESTURE_PRIORITY;
|
|
1133
1190
|
exports.actionSheetController = actionSheetController;
|
|
1191
|
+
exports.addCloseWatcherCondition = addCloseWatcherCondition;
|
|
1134
1192
|
exports.alertController = alertController;
|
|
1135
1193
|
exports.cleanupRootFocusTrapAccessibility = cleanupRootFocusTrapAccessibility;
|
|
1136
1194
|
exports.createDelegateController = createDelegateController;
|
|
@@ -1153,3 +1211,4 @@ exports.safeCall = safeCall;
|
|
|
1153
1211
|
exports.setOverlayId = setOverlayId;
|
|
1154
1212
|
exports.shouldUseCloseWatcher = shouldUseCloseWatcher;
|
|
1155
1213
|
exports.toastController = toastController;
|
|
1214
|
+
exports.updateCloseWatcher = updateCloseWatcher;
|
|
@@ -5,7 +5,7 @@ import { Build, Host, h } from "@stencil/core";
|
|
|
5
5
|
import { getTimeGivenProgression } from "../../utils/animation/cubic-bezier";
|
|
6
6
|
import { focusFirstDescendant, focusLastDescendant } from "../../utils/focus-trap";
|
|
7
7
|
import { GESTURE_CONTROLLER } from "../../utils/gesture/index";
|
|
8
|
-
import { shouldUseCloseWatcher } from "../../utils/hardware-back-button";
|
|
8
|
+
import { shouldUseCloseWatcher, updateCloseWatcher } from "../../utils/hardware-back-button";
|
|
9
9
|
import { inheritAriaAttributes, assert, clamp, isEndSide as isEnd } from "../../utils/helpers";
|
|
10
10
|
import { printIonError } from "../../utils/logging/index";
|
|
11
11
|
import { menuController } from "../../utils/menu-controller/index";
|
|
@@ -560,6 +560,7 @@ export class Menu {
|
|
|
560
560
|
// emit opened/closed events
|
|
561
561
|
this._isOpen = isOpen;
|
|
562
562
|
this.isAnimating = false;
|
|
563
|
+
updateCloseWatcher();
|
|
563
564
|
if (!this._isOpen) {
|
|
564
565
|
this.blocker.unblock();
|
|
565
566
|
}
|
|
@@ -656,14 +657,14 @@ export class Menu {
|
|
|
656
657
|
* the ionBackButton listener in the menu controller
|
|
657
658
|
* will handle closing the menu when Escape is pressed.
|
|
658
659
|
*/
|
|
659
|
-
return (h(Host, { key: '
|
|
660
|
+
return (h(Host, { key: '5cf26df26d4e539860cbeaea98ec621b98c3fcfc', onKeyDown: shouldUseCloseWatcher() ? null : this.onKeydown, role: "navigation", "aria-label": inheritedAttributes['aria-label'] || 'menu', class: {
|
|
660
661
|
[mode]: true,
|
|
661
662
|
[`menu-type-${type}`]: true,
|
|
662
663
|
'menu-enabled': !disabled,
|
|
663
664
|
[`menu-side-${side}`]: true,
|
|
664
665
|
'menu-pane-visible': isPaneVisible,
|
|
665
666
|
'split-pane-side': hostContext('ion-split-pane', el),
|
|
666
|
-
} }, h("div", { key: '
|
|
667
|
+
} }, h("div", { key: 'f337016e293bb8665c99762e0c389dd6c372bb33', class: "menu-inner", part: "container", ref: (el) => (this.menuInnerEl = el) }, h("slot", { key: '4c3fe331aa42cd57d7ad9bd1f5910f8eeb62d7da' })), h("ion-backdrop", { key: '61af7ea876d81574841e1dd3e81e2352e555d096', ref: (el) => (this.backdropEl = el), class: "menu-backdrop", tappable: false, stopPropagation: false, part: "backdrop" })));
|
|
667
668
|
}
|
|
668
669
|
static get is() { return "ion-menu"; }
|
|
669
670
|
static get encapsulation() { return "shadow"; }
|