@ionic/core 8.7.3-dev.11755600455.1e79c35a → 8.7.3-dev.11755696506.17b8097b
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/ion-refresher.js +18 -1
- package/components/overlays.js +102 -2
- package/dist/cjs/index.cjs.js +1 -1
- 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-datetime_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-loading.cjs.entry.js +1 -1
- package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-modal.cjs.entry.js +1 -1
- package/dist/cjs/ion-popover.cjs.entry.js +1 -1
- package/dist/cjs/ion-refresher_2.cjs.entry.js +18 -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-DUsEBICv.js → overlays-DFkeeMZX.js} +101 -1
- package/dist/collection/components/refresher/refresher.js +18 -1
- package/dist/collection/utils/overlays.js +102 -1
- package/dist/docs.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +1 -1
- package/dist/esm/ion-alert.entry.js +1 -1
- package/dist/esm/ion-datetime_3.entry.js +1 -1
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu_3.entry.js +1 -1
- package/dist/esm/ion-modal.entry.js +1 -1
- package/dist/esm/ion-popover.entry.js +1 -1
- package/dist/esm/ion-refresher_2.entry.js +18 -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-B_dsLNe8.js → overlays-BfCgLYdD.js} +102 -2
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-698fb72c.entry.js → p-1e6a6fde.entry.js} +1 -1
- package/dist/ionic/{p-98d0823e.entry.js → p-31f7216f.entry.js} +1 -1
- package/dist/ionic/{p-57bb1214.entry.js → p-4d57f91a.entry.js} +1 -1
- package/dist/ionic/{p-8bfe00f3.entry.js → p-5c138549.entry.js} +1 -1
- package/dist/ionic/p-8cdb4ff5.entry.js +4 -0
- package/dist/ionic/{p-09ed68cf.entry.js → p-9f8f01e6.entry.js} +1 -1
- package/dist/ionic/{p-84236acb.entry.js → p-b92a19c8.entry.js} +1 -1
- package/dist/ionic/{p-9c6fddc6.entry.js → p-e206b074.entry.js} +1 -1
- package/dist/ionic/{p-8b54aa01.entry.js → p-e61fd4b2.entry.js} +1 -1
- package/dist/ionic/{p-07d8f62a.entry.js → p-eb9b64a6.entry.js} +1 -1
- package/dist/ionic/{p-7ed24ba0.entry.js → p-ef5372b6.entry.js} +1 -1
- package/dist/ionic/p-ly6Zj1CK.js +4 -0
- package/hydrate/index.js +119 -2
- package/hydrate/index.mjs +119 -2
- package/package.json +1 -1
- package/dist/ionic/p-C3MD7jSK.js +0 -4
- package/dist/ionic/p-ac2be9d6.entry.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{f as t,r as o,c as i,e as a,j as e,h as n,d as s,g as r}from"./p-4DxY6_gG.js";import{E as d,a as l}from"./p-EnaLTYYj.js";import{g as p,r as c}from"./p-C-Cct-6D.js";import{c as h}from"./p-B-hirT0v.js";import{O as m,d as b,e as u,i as g,j as f,k as x,f as w,g as v,h as y,s as k,G as j}from"./p-C3MD7jSK.js";import{c as T,g as $}from"./p-DiVJyqlX.js";import{b as D}from"./p-Br3vSlYh.js";import{c as Y}from"./p-C87oPMMF.js";import{w as C}from"./p-ZjP4CjeZ.js";import{createGesture as z}from"./p-Cl0B-RWe.js";import"./p-CvaZMP6T.js";import"./p-DAfH9Iif.js";import"./p-BTEOs1at.js";const M=(t,o)=>Math.floor(t/2-o/2),O=(t,o)=>{const i=Y(),a=Y(),{position:e,top:n,bottom:s}=o,r=p(t).querySelector(".toast-wrapper");switch(a.addElement(r),e){case"top":a.fromTo("transform","translateY(-100%)",`translateY(${n})`);break;case"middle":const o=M(t.clientHeight,r.clientHeight);r.style.top=`${o}px`,a.fromTo("opacity",.01,1);break;default:a.fromTo("transform","translateY(100%)",`translateY(${s})`)}return i.easing("cubic-bezier(.155,1.105,.295,1.12)").duration(400).addAnimation(a)},P=(t,o)=>{const i=Y(),a=Y(),{position:e,top:n,bottom:s}=o,r=p(t).querySelector(".toast-wrapper");switch(a.addElement(r),e){case"top":a.fromTo("transform",`translateY(${n})`,"translateY(-100%)");break;case"middle":a.fromTo("opacity",.99,0);break;default:a.fromTo("transform",`translateY(${s})`,"translateY(100%)")}return i.easing("cubic-bezier(.36,.66,.04,1)").duration(300).addAnimation(a)},E=(t,o)=>{const i=Y(),a=Y(),{position:e,top:n,bottom:s}=o,r=p(t).querySelector(".toast-wrapper");switch(a.addElement(r),e){case"top":r.style.setProperty("transform",`translateY(${n})`),a.fromTo("opacity",.01,1);break;case"middle":const o=M(t.clientHeight,r.clientHeight);r.style.top=`${o}px`,a.fromTo("opacity",.01,1);break;default:r.style.setProperty("transform",`translateY(${s})`),a.fromTo("opacity",.01,1)}return i.easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation(a)},H=t=>{const o=Y(),i=Y(),a=p(t).querySelector(".toast-wrapper");return i.addElement(a).fromTo("opacity",.99,0),o.easing("cubic-bezier(.36,.66,.04,1)").duration(300).addAnimation(i)},B=class{constructor(t){o(this,t),this.didPresent=i(this,"ionToastDidPresent",7),this.willPresent=i(this,"ionToastWillPresent",7),this.willDismiss=i(this,"ionToastWillDismiss",7),this.didDismiss=i(this,"ionToastDidDismiss",7),this.didPresentShorthand=i(this,"didPresent",7),this.willPresentShorthand=i(this,"willPresent",7),this.willDismissShorthand=i(this,"willDismiss",7),this.didDismissShorthand=i(this,"didDismiss",7),this.delegateController=b(this),this.lockController=h(),this.triggerController=u(),this.customHTMLEnabled=a.get("innerHTMLTemplatesEnabled",d),this.presented=!1,this.revealContentToScreenReader=!1,this.hasController=!1,this.duration=a.getNumber("toastDuration",0),this.layout="baseline",this.keyboardClose=!1,this.position="bottom",this.translucent=!1,this.animated=!0,this.isOpen=!1,this.dispatchCancelHandler=t=>{if(g(t.detail.role)){const t=this.getButtons().find((t=>"cancel"===t.role));this.callButtonHandler(t)}},this.createSwipeGesture=t=>{const o=this.gesture=((t,o,i)=>{const a=p(t).querySelector(".toast-wrapper"),e=t.clientHeight,n=a.getBoundingClientRect();let s=0;const r="middle"===t.position?.5:0,d="top"===t.position?-1:1,l=M(e,n.height),c=[{offset:0,transform:`translateY(-${l+n.height}px)`},{offset:.5,transform:"translateY(0px)"},{offset:1,transform:`translateY(${l+n.height}px)`}],h=Y("toast-swipe-to-dismiss-animation").addElement(a).duration(100);switch(t.position){case"middle":s=e+n.height,h.keyframes(c),h.progressStart(!0,.5);break;case"top":s=n.bottom,h.keyframes([{offset:0,transform:`translateY(${o.top})`},{offset:1,transform:"translateY(-100%)"}]),h.progressStart(!0,0);break;default:s=e-n.top,h.keyframes([{offset:0,transform:`translateY(${o.bottom})`},{offset:1,transform:"translateY(100%)"}]),h.progressStart(!0,0)}const b=t=>t*d/s,u=z({el:a,gestureName:"toast-swipe-to-dismiss",gesturePriority:m,direction:"y",onMove:t=>{const o=r+b(t.deltaY);h.progressStep(o)},onEnd:o=>{const e=o.velocityY,n=(o.deltaY+1e3*e)/s*d;u.enable(!1);let r=!0,p=1,m=0,g=0;if("middle"===t.position){r=n>=.25||n<=-.25,p=1,m=0;const t=a.getBoundingClientRect(),i=t.top-l,e=(l+t.height)*(o.deltaY<=0?-1:1);h.keyframes([{offset:0,transform:`translateY(${i}px)`},{offset:1,transform:`translateY(${r?`${e}px`:"0px"})`}]),g=e-i}else r=n>=.5,p=r?1:0,m=b(o.deltaY),g=(r?1-m:m)*s;const f=Math.min(Math.abs(g)/Math.abs(e),200);h.onFinish((()=>{r?(i(),h.destroy()):("middle"===t.position?h.keyframes(c).progressStart(!0,.5):h.progressStart(!0,0),u.enable(!0))}),{oneTimeCallback:!0}).progressEnd(p,m,f)}});return u})(this.el,t,(()=>{this.dismiss(void 0,j)}));o.enable(!0)},this.destroySwipeGesture=()=>{const{gesture:t}=this;void 0!==t&&(t.destroy(),this.gesture=void 0)},this.prefersSwipeGesture=()=>{const{swipeGesture:t}=this;return"vertical"===t}}swipeGestureChanged(){this.destroySwipeGesture(),this.presented&&this.prefersSwipeGesture()&&this.createSwipeGesture(this.lastPresentedPosition)}onIsOpenChange(t,o){!0===t&&!1===o?this.present():!1===t&&!0===o&&this.dismiss()}triggerChanged(){const{trigger:t,el:o,triggerController:i}=this;t&&i.addClickListener(o,t)}connectedCallback(){f(this.el),this.triggerChanged()}disconnectedCallback(){this.triggerController.removeClickListener()}componentWillLoad(){var t;(null===(t=this.htmlAttributes)||void 0===t?void 0:t.id)||x(this.el)}componentDidLoad(){!0===this.isOpen&&c((()=>this.present())),this.triggerChanged()}async present(){const o=await this.lockController.lock();await this.delegateController.attachViewToDom();const{el:i,position:a}=this,e=function(o,i,a,e){let n;if(n="md"===a?"top"===o?8:-8:"top"===o?10:-10,i&&C){!function(o,i){null===o.offsetParent&&t("[ion-toast] - The positionAnchor element for ion-toast was found in the DOM, but appears to be hidden. This may lead to unexpected positioning of the toast.",i)}(i,e);const a=i.getBoundingClientRect();return"top"===o?n+=a.bottom:"bottom"===o&&(n-=C.innerHeight-a.top),{top:`${n}px`,bottom:`${n}px`}}return{top:`calc(${n}px + var(--ion-safe-area-top, 0px))`,bottom:`calc(${n}px - var(--ion-safe-area-bottom, 0px))`}}(a,this.getAnchorElement(),D(this),i);this.lastPresentedPosition=e,await w(this,"toastEnter",O,E,{position:a,top:e.top,bottom:e.bottom}),this.revealContentToScreenReader=!0,this.duration>0&&(this.durationTimeout=setTimeout((()=>this.dismiss(void 0,"timeout")),this.duration)),this.prefersSwipeGesture()&&this.createSwipeGesture(e),o()}async dismiss(t,o){var i,a;const e=await this.lockController.lock(),{durationTimeout:n,position:s,lastPresentedPosition:r}=this;n&&clearTimeout(n);const d=await v(this,t,o,"toastLeave",P,H,{position:s,top:null!==(i=null==r?void 0:r.top)&&void 0!==i?i:"",bottom:null!==(a=null==r?void 0:r.bottom)&&void 0!==a?a:""});return d&&(this.delegateController.removeViewFromDom(),this.revealContentToScreenReader=!1),this.lastPresentedPosition=void 0,this.destroySwipeGesture(),e(),d}onDidDismiss(){return y(this.el,"ionToastDidDismiss")}onWillDismiss(){return y(this.el,"ionToastWillDismiss")}getButtons(){return this.buttons?this.buttons.map((t=>"string"==typeof t?{text:t}:t)):[]}getAnchorElement(){const{position:o,positionAnchor:i,el:a}=this;if(void 0!==i)if("middle"!==o||void 0===i){if("string"==typeof i){const o=document.getElementById(i);return null===o?void t(`[ion-toast] - An anchor element with an ID of "${i}" was not found in the DOM.`,a):o}if(i instanceof HTMLElement)return i;t("[ion-toast] - Invalid positionAnchor value:",i,a)}else t('[ion-toast] - The positionAnchor property is ignored when using position="middle".',this.el)}async buttonClick(t){const o=t.role;return g(o)||await this.callButtonHandler(t)?this.dismiss(void 0,o):Promise.resolve()}async callButtonHandler(t){if(null==t?void 0:t.handler)try{if(!1===await k(t.handler))return!1}catch(t){e("[ion-toast] - Exception in callButtonHandler:",t)}return!0}renderButtons(t,o){if(0===t.length)return;const i=D(this);return n("div",{class:{"toast-button-group":!0,[`toast-button-group-${o}`]:!0}},t.map((t=>n("button",Object.assign({},t.htmlAttributes,{type:"button",class:I(t),tabIndex:0,onClick:()=>this.buttonClick(t),part:L(t)}),n("div",{class:"toast-button-inner"},t.icon&&n("ion-icon",{"aria-hidden":"true",icon:t.icon,slot:void 0===t.text?"icon-only":void 0,class:"toast-button-icon"}),t.text),"md"===i&&n("ion-ripple-effect",{type:void 0!==t.icon&&void 0===t.text?"unbounded":"bounded"})))))}renderToastMessage(t,o=null){const{customHTMLEnabled:i,message:a}=this;return i?n("div",{key:t,"aria-hidden":o,class:"toast-message",part:"message",innerHTML:l(a)}):n("div",{key:t,"aria-hidden":o,class:"toast-message",part:"message"},a)}renderHeader(t,o=null){return n("div",{key:t,class:"toast-header","aria-hidden":o,part:"header"},this.header)}render(){const{layout:o,el:i,revealContentToScreenReader:a,header:e,message:r}=this,d=this.getButtons(),l=d.filter((t=>"start"===t.side)),p=d.filter((t=>"start"!==t.side)),c=D(this),h={"toast-wrapper":!0,[`toast-${this.position}`]:!0,[`toast-layout-${o}`]:!0};return"stacked"===o&&l.length>0&&p.length>0&&t("[ion-toast] - This toast is using start and end buttons with the stacked toast layout. We recommend following the best practice of using either start or end buttons with the stacked toast layout.",i),n(s,Object.assign({key:"d1ecd90c87700aad4685e230cdd430aa286b8791",tabindex:"-1"},this.htmlAttributes,{style:{zIndex:`${6e4+this.overlayIndex}`},class:T(this.color,Object.assign(Object.assign({[c]:!0},$(this.cssClass)),{"overlay-hidden":!0,"toast-translucent":this.translucent})),onIonToastWillDismiss:this.dispatchCancelHandler}),n("div",{key:"4bfc863417324de69e222054d5cf9c452038b41e",class:h},n("div",{key:"3417940afec0392e81b7d54c7cb00f3ab6c30d47",class:"toast-container",part:"container"},this.renderButtons(l,"start"),void 0!==this.icon&&n("ion-icon",{key:"6bf878fbc85c01e1e5faa9d97d46255a6511a952",class:"toast-icon",part:"icon",icon:this.icon,lazy:!1,"aria-hidden":"true"}),n("div",{key:"54b500348a9c37660c3aff37436d9188e4374947",class:"toast-content",role:"status","aria-atomic":"true","aria-live":"polite"},!a&&void 0!==e&&this.renderHeader("oldHeader","true"),!a&&void 0!==r&&this.renderToastMessage("oldMessage","true"),a&&void 0!==e&&this.renderHeader("header"),a&&void 0!==r&&this.renderToastMessage("header")),this.renderButtons(p,"end"))))}get el(){return r(this)}static get watchers(){return{swipeGesture:["swipeGestureChanged"],isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}}},I=t=>({"toast-button":!0,"toast-button-icon-only":void 0!==t.icon&&void 0===t.text,[`toast-button-${t.role}`]:void 0!==t.role,"ion-focusable":!0,"ion-activatable":!0}),L=t=>g(t.role)?"button cancel":"button";B.style={ios:":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}:host{inset-inline-start:0}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{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);pointer-events:auto}.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}.toast-wrapper.toast-top{-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{-ms-flex-wrap:wrap;flex-wrap:wrap}.toast-layout-baseline .toast-content{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{min-width:0}.toast-message{-ms-flex:1;flex:1;white-space:var(--white-space)}.toast-button-group{display:-ms-flexbox;display:flex}.toast-layout-stacked .toast-button-group{-ms-flex-pack:end;justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--border-radius:14px;--button-color:var(--ion-color-primary, #0054e9);--color:var(--ion-color-step-850, var(--ion-text-color-step-150, #262626));--max-width:700px;--max-height:478px;--start:10px;--end:10px;font-size:clamp(14px, 0.875rem, 43.4px)}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;z-index:10}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.toast-translucent) .toast-wrapper{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}:host(.ion-color.toast-translucent) .toast-wrapper{background:rgba(var(--ion-color-base-rgb), 0.8)}}.toast-wrapper.toast-middle{opacity:0.01}.toast-content{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:15px;padding-bottom:15px}.toast-header{margin-bottom:2px;font-weight:500}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;min-height:44px;-webkit-transition:background-color, opacity 100ms linear;transition:background-color, opacity 100ms linear;border:0;background-color:transparent;font-family:var(--ion-font-family);font-size:clamp(17px, 1.0625rem, 21.998px);font-weight:500;overflow:hidden}.toast-button.ion-activated{opacity:0.4}@media (any-hover: hover){.toast-button:hover{opacity:0.6}}",md:":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}:host{inset-inline-start:0}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{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);pointer-events:auto}.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}.toast-wrapper.toast-top{-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{-ms-flex-wrap:wrap;flex-wrap:wrap}.toast-layout-baseline .toast-content{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{min-width:0}.toast-message{-ms-flex:1;flex:1;white-space:var(--white-space)}.toast-button-group{display:-ms-flexbox;display:flex}.toast-layout-stacked .toast-button-group{-ms-flex-pack:end;justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-800, var(--ion-background-color-step-800, #333333));--border-radius:4px;--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--button-color:var(--ion-color-primary, #0054e9);--color:var(--ion-color-step-50, var(--ion-text-color-step-950, #f2f2f2));--max-width:700px;--start:8px;--end:8px;font-size:0.875rem}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;opacity:0.01;z-index:10}.toast-content{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:14px;padding-bottom:14px}.toast-header{margin-bottom:2px;font-weight:500;line-height:1.25rem}.toast-message{line-height:1.25rem}.toast-layout-baseline .toast-button-group-start{-webkit-margin-start:8px;margin-inline-start:8px}.toast-layout-stacked .toast-button-group-start{-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px}.toast-layout-baseline .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px}.toast-layout-stacked .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px;margin-bottom:8px}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;font-family:var(--ion-font-family);font-size:0.875rem;font-weight:500;letter-spacing:0.84px;text-transform:uppercase;overflow:hidden}.toast-button-cancel{color:var(--ion-color-step-100, var(--ion-text-color-step-900, #e6e6e6))}.toast-button-icon-only{border-radius:50%;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:9px;padding-bottom:9px;width:36px;height:36px}@media (any-hover: hover){.toast-button:hover{background-color:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.08)}.toast-button-cancel:hover{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.08)}}"};export{B as ion_toast}
|
|
4
|
+
import{f as t,r as o,c as i,e as a,j as e,h as n,d as s,g as r}from"./p-4DxY6_gG.js";import{E as d,a as l}from"./p-EnaLTYYj.js";import{g as p,r as c}from"./p-C-Cct-6D.js";import{c as h}from"./p-B-hirT0v.js";import{O as m,d as b,e as u,i as g,j as f,k as x,f as w,g as v,h as y,s as k,G as j}from"./p-ly6Zj1CK.js";import{c as T,g as $}from"./p-DiVJyqlX.js";import{b as Y}from"./p-Br3vSlYh.js";import{c as D}from"./p-C87oPMMF.js";import{w as C}from"./p-ZjP4CjeZ.js";import{createGesture as z}from"./p-Cl0B-RWe.js";import"./p-CvaZMP6T.js";import"./p-DAfH9Iif.js";import"./p-BTEOs1at.js";const M=(t,o)=>Math.floor(t/2-o/2),O=(t,o)=>{const i=D(),a=D(),{position:e,top:n,bottom:s}=o,r=p(t).querySelector(".toast-wrapper");switch(a.addElement(r),e){case"top":a.fromTo("transform","translateY(-100%)",`translateY(${n})`);break;case"middle":const o=M(t.clientHeight,r.clientHeight);r.style.top=`${o}px`,a.fromTo("opacity",.01,1);break;default:a.fromTo("transform","translateY(100%)",`translateY(${s})`)}return i.easing("cubic-bezier(.155,1.105,.295,1.12)").duration(400).addAnimation(a)},P=(t,o)=>{const i=D(),a=D(),{position:e,top:n,bottom:s}=o,r=p(t).querySelector(".toast-wrapper");switch(a.addElement(r),e){case"top":a.fromTo("transform",`translateY(${n})`,"translateY(-100%)");break;case"middle":a.fromTo("opacity",.99,0);break;default:a.fromTo("transform",`translateY(${s})`,"translateY(100%)")}return i.easing("cubic-bezier(.36,.66,.04,1)").duration(300).addAnimation(a)},E=(t,o)=>{const i=D(),a=D(),{position:e,top:n,bottom:s}=o,r=p(t).querySelector(".toast-wrapper");switch(a.addElement(r),e){case"top":r.style.setProperty("transform",`translateY(${n})`),a.fromTo("opacity",.01,1);break;case"middle":const o=M(t.clientHeight,r.clientHeight);r.style.top=`${o}px`,a.fromTo("opacity",.01,1);break;default:r.style.setProperty("transform",`translateY(${s})`),a.fromTo("opacity",.01,1)}return i.easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation(a)},H=t=>{const o=D(),i=D(),a=p(t).querySelector(".toast-wrapper");return i.addElement(a).fromTo("opacity",.99,0),o.easing("cubic-bezier(.36,.66,.04,1)").duration(300).addAnimation(i)},B=class{constructor(t){o(this,t),this.didPresent=i(this,"ionToastDidPresent",7),this.willPresent=i(this,"ionToastWillPresent",7),this.willDismiss=i(this,"ionToastWillDismiss",7),this.didDismiss=i(this,"ionToastDidDismiss",7),this.didPresentShorthand=i(this,"didPresent",7),this.willPresentShorthand=i(this,"willPresent",7),this.willDismissShorthand=i(this,"willDismiss",7),this.didDismissShorthand=i(this,"didDismiss",7),this.delegateController=b(this),this.lockController=h(),this.triggerController=u(),this.customHTMLEnabled=a.get("innerHTMLTemplatesEnabled",d),this.presented=!1,this.revealContentToScreenReader=!1,this.hasController=!1,this.duration=a.getNumber("toastDuration",0),this.layout="baseline",this.keyboardClose=!1,this.position="bottom",this.translucent=!1,this.animated=!0,this.isOpen=!1,this.dispatchCancelHandler=t=>{if(g(t.detail.role)){const t=this.getButtons().find((t=>"cancel"===t.role));this.callButtonHandler(t)}},this.createSwipeGesture=t=>{const o=this.gesture=((t,o,i)=>{const a=p(t).querySelector(".toast-wrapper"),e=t.clientHeight,n=a.getBoundingClientRect();let s=0;const r="middle"===t.position?.5:0,d="top"===t.position?-1:1,l=M(e,n.height),c=[{offset:0,transform:`translateY(-${l+n.height}px)`},{offset:.5,transform:"translateY(0px)"},{offset:1,transform:`translateY(${l+n.height}px)`}],h=D("toast-swipe-to-dismiss-animation").addElement(a).duration(100);switch(t.position){case"middle":s=e+n.height,h.keyframes(c),h.progressStart(!0,.5);break;case"top":s=n.bottom,h.keyframes([{offset:0,transform:`translateY(${o.top})`},{offset:1,transform:"translateY(-100%)"}]),h.progressStart(!0,0);break;default:s=e-n.top,h.keyframes([{offset:0,transform:`translateY(${o.bottom})`},{offset:1,transform:"translateY(100%)"}]),h.progressStart(!0,0)}const b=t=>t*d/s,u=z({el:a,gestureName:"toast-swipe-to-dismiss",gesturePriority:m,direction:"y",onMove:t=>{const o=r+b(t.deltaY);h.progressStep(o)},onEnd:o=>{const e=o.velocityY,n=(o.deltaY+1e3*e)/s*d;u.enable(!1);let r=!0,p=1,m=0,g=0;if("middle"===t.position){r=n>=.25||n<=-.25,p=1,m=0;const t=a.getBoundingClientRect(),i=t.top-l,e=(l+t.height)*(o.deltaY<=0?-1:1);h.keyframes([{offset:0,transform:`translateY(${i}px)`},{offset:1,transform:`translateY(${r?`${e}px`:"0px"})`}]),g=e-i}else r=n>=.5,p=r?1:0,m=b(o.deltaY),g=(r?1-m:m)*s;const f=Math.min(Math.abs(g)/Math.abs(e),200);h.onFinish((()=>{r?(i(),h.destroy()):("middle"===t.position?h.keyframes(c).progressStart(!0,.5):h.progressStart(!0,0),u.enable(!0))}),{oneTimeCallback:!0}).progressEnd(p,m,f)}});return u})(this.el,t,(()=>{this.dismiss(void 0,j)}));o.enable(!0)},this.destroySwipeGesture=()=>{const{gesture:t}=this;void 0!==t&&(t.destroy(),this.gesture=void 0)},this.prefersSwipeGesture=()=>{const{swipeGesture:t}=this;return"vertical"===t}}swipeGestureChanged(){this.destroySwipeGesture(),this.presented&&this.prefersSwipeGesture()&&this.createSwipeGesture(this.lastPresentedPosition)}onIsOpenChange(t,o){!0===t&&!1===o?this.present():!1===t&&!0===o&&this.dismiss()}triggerChanged(){const{trigger:t,el:o,triggerController:i}=this;t&&i.addClickListener(o,t)}connectedCallback(){f(this.el),this.triggerChanged()}disconnectedCallback(){this.triggerController.removeClickListener()}componentWillLoad(){var t;(null===(t=this.htmlAttributes)||void 0===t?void 0:t.id)||x(this.el)}componentDidLoad(){!0===this.isOpen&&c((()=>this.present())),this.triggerChanged()}async present(){const o=await this.lockController.lock();await this.delegateController.attachViewToDom();const{el:i,position:a}=this,e=function(o,i,a,e){let n;if(n="md"===a?"top"===o?8:-8:"top"===o?10:-10,i&&C){!function(o,i){null===o.offsetParent&&t("[ion-toast] - The positionAnchor element for ion-toast was found in the DOM, but appears to be hidden. This may lead to unexpected positioning of the toast.",i)}(i,e);const a=i.getBoundingClientRect();return"top"===o?n+=a.bottom:"bottom"===o&&(n-=C.innerHeight-a.top),{top:`${n}px`,bottom:`${n}px`}}return{top:`calc(${n}px + var(--ion-safe-area-top, 0px))`,bottom:`calc(${n}px - var(--ion-safe-area-bottom, 0px))`}}(a,this.getAnchorElement(),Y(this),i);this.lastPresentedPosition=e,await w(this,"toastEnter",O,E,{position:a,top:e.top,bottom:e.bottom}),this.revealContentToScreenReader=!0,this.duration>0&&(this.durationTimeout=setTimeout((()=>this.dismiss(void 0,"timeout")),this.duration)),this.prefersSwipeGesture()&&this.createSwipeGesture(e),o()}async dismiss(t,o){var i,a;const e=await this.lockController.lock(),{durationTimeout:n,position:s,lastPresentedPosition:r}=this;n&&clearTimeout(n);const d=await v(this,t,o,"toastLeave",P,H,{position:s,top:null!==(i=null==r?void 0:r.top)&&void 0!==i?i:"",bottom:null!==(a=null==r?void 0:r.bottom)&&void 0!==a?a:""});return d&&(this.delegateController.removeViewFromDom(),this.revealContentToScreenReader=!1),this.lastPresentedPosition=void 0,this.destroySwipeGesture(),e(),d}onDidDismiss(){return y(this.el,"ionToastDidDismiss")}onWillDismiss(){return y(this.el,"ionToastWillDismiss")}getButtons(){return this.buttons?this.buttons.map((t=>"string"==typeof t?{text:t}:t)):[]}getAnchorElement(){const{position:o,positionAnchor:i,el:a}=this;if(void 0!==i)if("middle"!==o||void 0===i){if("string"==typeof i){const o=document.getElementById(i);return null===o?void t(`[ion-toast] - An anchor element with an ID of "${i}" was not found in the DOM.`,a):o}if(i instanceof HTMLElement)return i;t("[ion-toast] - Invalid positionAnchor value:",i,a)}else t('[ion-toast] - The positionAnchor property is ignored when using position="middle".',this.el)}async buttonClick(t){const o=t.role;return g(o)||await this.callButtonHandler(t)?this.dismiss(void 0,o):Promise.resolve()}async callButtonHandler(t){if(null==t?void 0:t.handler)try{if(!1===await k(t.handler))return!1}catch(t){e("[ion-toast] - Exception in callButtonHandler:",t)}return!0}renderButtons(t,o){if(0===t.length)return;const i=Y(this);return n("div",{class:{"toast-button-group":!0,[`toast-button-group-${o}`]:!0}},t.map((t=>n("button",Object.assign({},t.htmlAttributes,{type:"button",class:I(t),tabIndex:0,onClick:()=>this.buttonClick(t),part:L(t)}),n("div",{class:"toast-button-inner"},t.icon&&n("ion-icon",{"aria-hidden":"true",icon:t.icon,slot:void 0===t.text?"icon-only":void 0,class:"toast-button-icon"}),t.text),"md"===i&&n("ion-ripple-effect",{type:void 0!==t.icon&&void 0===t.text?"unbounded":"bounded"})))))}renderToastMessage(t,o=null){const{customHTMLEnabled:i,message:a}=this;return i?n("div",{key:t,"aria-hidden":o,class:"toast-message",part:"message",innerHTML:l(a)}):n("div",{key:t,"aria-hidden":o,class:"toast-message",part:"message"},a)}renderHeader(t,o=null){return n("div",{key:t,class:"toast-header","aria-hidden":o,part:"header"},this.header)}render(){const{layout:o,el:i,revealContentToScreenReader:a,header:e,message:r}=this,d=this.getButtons(),l=d.filter((t=>"start"===t.side)),p=d.filter((t=>"start"!==t.side)),c=Y(this),h={"toast-wrapper":!0,[`toast-${this.position}`]:!0,[`toast-layout-${o}`]:!0};return"stacked"===o&&l.length>0&&p.length>0&&t("[ion-toast] - This toast is using start and end buttons with the stacked toast layout. We recommend following the best practice of using either start or end buttons with the stacked toast layout.",i),n(s,Object.assign({key:"d1ecd90c87700aad4685e230cdd430aa286b8791",tabindex:"-1"},this.htmlAttributes,{style:{zIndex:`${6e4+this.overlayIndex}`},class:T(this.color,Object.assign(Object.assign({[c]:!0},$(this.cssClass)),{"overlay-hidden":!0,"toast-translucent":this.translucent})),onIonToastWillDismiss:this.dispatchCancelHandler}),n("div",{key:"4bfc863417324de69e222054d5cf9c452038b41e",class:h},n("div",{key:"3417940afec0392e81b7d54c7cb00f3ab6c30d47",class:"toast-container",part:"container"},this.renderButtons(l,"start"),void 0!==this.icon&&n("ion-icon",{key:"6bf878fbc85c01e1e5faa9d97d46255a6511a952",class:"toast-icon",part:"icon",icon:this.icon,lazy:!1,"aria-hidden":"true"}),n("div",{key:"54b500348a9c37660c3aff37436d9188e4374947",class:"toast-content",role:"status","aria-atomic":"true","aria-live":"polite"},!a&&void 0!==e&&this.renderHeader("oldHeader","true"),!a&&void 0!==r&&this.renderToastMessage("oldMessage","true"),a&&void 0!==e&&this.renderHeader("header"),a&&void 0!==r&&this.renderToastMessage("header")),this.renderButtons(p,"end"))))}get el(){return r(this)}static get watchers(){return{swipeGesture:["swipeGestureChanged"],isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}}},I=t=>({"toast-button":!0,"toast-button-icon-only":void 0!==t.icon&&void 0===t.text,[`toast-button-${t.role}`]:void 0!==t.role,"ion-focusable":!0,"ion-activatable":!0}),L=t=>g(t.role)?"button cancel":"button";B.style={ios:":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}:host{inset-inline-start:0}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{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);pointer-events:auto}.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}.toast-wrapper.toast-top{-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{-ms-flex-wrap:wrap;flex-wrap:wrap}.toast-layout-baseline .toast-content{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{min-width:0}.toast-message{-ms-flex:1;flex:1;white-space:var(--white-space)}.toast-button-group{display:-ms-flexbox;display:flex}.toast-layout-stacked .toast-button-group{-ms-flex-pack:end;justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--border-radius:14px;--button-color:var(--ion-color-primary, #0054e9);--color:var(--ion-color-step-850, var(--ion-text-color-step-150, #262626));--max-width:700px;--max-height:478px;--start:10px;--end:10px;font-size:clamp(14px, 0.875rem, 43.4px)}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;z-index:10}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.toast-translucent) .toast-wrapper{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}:host(.ion-color.toast-translucent) .toast-wrapper{background:rgba(var(--ion-color-base-rgb), 0.8)}}.toast-wrapper.toast-middle{opacity:0.01}.toast-content{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:15px;padding-bottom:15px}.toast-header{margin-bottom:2px;font-weight:500}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;min-height:44px;-webkit-transition:background-color, opacity 100ms linear;transition:background-color, opacity 100ms linear;border:0;background-color:transparent;font-family:var(--ion-font-family);font-size:clamp(17px, 1.0625rem, 21.998px);font-weight:500;overflow:hidden}.toast-button.ion-activated{opacity:0.4}@media (any-hover: hover){.toast-button:hover{opacity:0.6}}",md:":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}:host{inset-inline-start:0}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{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);pointer-events:auto}.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}.toast-wrapper.toast-top{-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{-ms-flex-wrap:wrap;flex-wrap:wrap}.toast-layout-baseline .toast-content{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{min-width:0}.toast-message{-ms-flex:1;flex:1;white-space:var(--white-space)}.toast-button-group{display:-ms-flexbox;display:flex}.toast-layout-stacked .toast-button-group{-ms-flex-pack:end;justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-800, var(--ion-background-color-step-800, #333333));--border-radius:4px;--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--button-color:var(--ion-color-primary, #0054e9);--color:var(--ion-color-step-50, var(--ion-text-color-step-950, #f2f2f2));--max-width:700px;--start:8px;--end:8px;font-size:0.875rem}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;opacity:0.01;z-index:10}.toast-content{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:14px;padding-bottom:14px}.toast-header{margin-bottom:2px;font-weight:500;line-height:1.25rem}.toast-message{line-height:1.25rem}.toast-layout-baseline .toast-button-group-start{-webkit-margin-start:8px;margin-inline-start:8px}.toast-layout-stacked .toast-button-group-start{-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px}.toast-layout-baseline .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px}.toast-layout-stacked .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px;margin-bottom:8px}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;font-family:var(--ion-font-family);font-size:0.875rem;font-weight:500;letter-spacing:0.84px;text-transform:uppercase;overflow:hidden}.toast-button-cancel{color:var(--ion-color-step-100, var(--ion-text-color-step-900, #e6e6e6))}.toast-button-icon-only{border-radius:50%;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:9px;padding-bottom:9px;width:36px;height:36px}@media (any-hover: hover){.toast-button:hover{background-color:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.08)}.toast-button-cancel:hover{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.08)}}"};export{B as ion_toast}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{r as i,c as t,e as o,h as n,d as a,g as e}from"./p-4DxY6_gG.js";import{E as s,a as r}from"./p-EnaLTYYj.js";import{r as d}from"./p-C-Cct-6D.js";import{c}from"./p-B-hirT0v.js";import{d as l,e as p,B as h,j as g,k as m,f as b,g as f,h as x}from"./p-
|
|
4
|
+
import{r as i,c as t,e as o,h as n,d as a,g as e}from"./p-4DxY6_gG.js";import{E as s,a as r}from"./p-EnaLTYYj.js";import{r as d}from"./p-C-Cct-6D.js";import{c}from"./p-B-hirT0v.js";import{d as l,e as p,B as h,j as g,k as m,f as b,g as f,h as x}from"./p-ly6Zj1CK.js";import{g as u}from"./p-DiVJyqlX.js";import{b as v}from"./p-Br3vSlYh.js";import{c as y}from"./p-C87oPMMF.js";import"./p-ZjP4CjeZ.js";import"./p-CvaZMP6T.js";import"./p-DAfH9Iif.js";import"./p-BTEOs1at.js";const k=i=>{const t=y(),o=y(),n=y();return o.addElement(i.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),n.addElement(i.querySelector(".loading-wrapper")).keyframes([{offset:0,opacity:.01,transform:"scale(1.1)"},{offset:1,opacity:1,transform:"scale(1)"}]),t.addElement(i).easing("ease-in-out").duration(200).addAnimation([o,n])},w=i=>{const t=y(),o=y(),n=y();return o.addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),n.addElement(i.querySelector(".loading-wrapper")).keyframes([{offset:0,opacity:.99,transform:"scale(1)"},{offset:1,opacity:0,transform:"scale(0.9)"}]),t.addElement(i).easing("ease-in-out").duration(200).addAnimation([o,n])},j=i=>{const t=y(),o=y(),n=y();return o.addElement(i.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),n.addElement(i.querySelector(".loading-wrapper")).keyframes([{offset:0,opacity:.01,transform:"scale(1.1)"},{offset:1,opacity:1,transform:"scale(1)"}]),t.addElement(i).easing("ease-in-out").duration(200).addAnimation([o,n])},D=i=>{const t=y(),o=y(),n=y();return o.addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),n.addElement(i.querySelector(".loading-wrapper")).keyframes([{offset:0,opacity:.99,transform:"scale(1)"},{offset:1,opacity:0,transform:"scale(0.9)"}]),t.addElement(i).easing("ease-in-out").duration(200).addAnimation([o,n])},L=class{constructor(n){i(this,n),this.didPresent=t(this,"ionLoadingDidPresent",7),this.willPresent=t(this,"ionLoadingWillPresent",7),this.willDismiss=t(this,"ionLoadingWillDismiss",7),this.didDismiss=t(this,"ionLoadingDidDismiss",7),this.didPresentShorthand=t(this,"didPresent",7),this.willPresentShorthand=t(this,"willPresent",7),this.willDismissShorthand=t(this,"willDismiss",7),this.didDismissShorthand=t(this,"didDismiss",7),this.delegateController=l(this),this.lockController=c(),this.triggerController=p(),this.customHTMLEnabled=o.get("innerHTMLTemplatesEnabled",s),this.presented=!1,this.hasController=!1,this.keyboardClose=!0,this.duration=0,this.backdropDismiss=!1,this.showBackdrop=!0,this.translucent=!1,this.animated=!0,this.isOpen=!1,this.onBackdropTap=()=>{this.dismiss(void 0,h)}}onIsOpenChange(i,t){!0===i&&!1===t?this.present():!1===i&&!0===t&&this.dismiss()}triggerChanged(){const{trigger:i,el:t,triggerController:o}=this;i&&o.addClickListener(t,i)}connectedCallback(){g(this.el),this.triggerChanged()}componentWillLoad(){var i;if(void 0===this.spinner){const i=v(this);this.spinner=o.get("loadingSpinner",o.get("spinner","ios"===i?"lines":"crescent"))}(null===(i=this.htmlAttributes)||void 0===i?void 0:i.id)||m(this.el)}componentDidLoad(){!0===this.isOpen&&d((()=>this.present())),this.triggerChanged()}disconnectedCallback(){this.triggerController.removeClickListener()}async present(){const i=await this.lockController.lock();await this.delegateController.attachViewToDom(),await b(this,"loadingEnter",k,j),this.duration>0&&(this.durationTimeout=setTimeout((()=>this.dismiss()),this.duration+10)),i()}async dismiss(i,t){const o=await this.lockController.lock();this.durationTimeout&&clearTimeout(this.durationTimeout);const n=await f(this,i,t,"loadingLeave",w,D);return n&&this.delegateController.removeViewFromDom(),o(),n}onDidDismiss(){return x(this.el,"ionLoadingDidDismiss")}onWillDismiss(){return x(this.el,"ionLoadingWillDismiss")}renderLoadingMessage(i){const{customHTMLEnabled:t,message:o}=this;return t?n("div",{class:"loading-content",id:i,innerHTML:r(o)}):n("div",{class:"loading-content",id:i},o)}render(){const{message:i,spinner:t,htmlAttributes:o,overlayIndex:e}=this,s=v(this),r=`loading-${e}-msg`;return n(a,Object.assign({key:"4497183ce220242abe19ae15f328f9a92ccafbbc",role:"dialog","aria-modal":"true","aria-labelledby":void 0!==i?r:null,tabindex:"-1"},o,{style:{zIndex:`${4e4+this.overlayIndex}`},onIonBackdropTap:this.onBackdropTap,class:Object.assign(Object.assign({},u(this.cssClass)),{[s]:!0,"overlay-hidden":!0,"loading-translucent":this.translucent})}),n("ion-backdrop",{key:"231dec84e424a2dc358ce95b84d6035cf43e4dea",visible:this.showBackdrop,tappable:this.backdropDismiss}),n("div",{key:"c9af29b6e6bb49a217396a5c874bbfb8835a926c",tabindex:"0","aria-hidden":"true"}),n("div",{key:"a8659863743cdeccbe1ba810eaabfd3ebfcb86f3",class:"loading-wrapper ion-overlay-wrapper"},t&&n("div",{key:"3b346f39bc71691bd8686556a1e142198a7b12fa",class:"loading-spinner"},n("ion-spinner",{key:"8dc2bf1556e5138e262827f1516c59ecd09f3520",name:t,"aria-hidden":"true"})),void 0!==i&&this.renderLoadingMessage(r)),n("div",{key:"054164c0dbae9a0e0973dd3c8e28f5b771820310",tabindex:"0","aria-hidden":"true"}))}get el(){return e(this)}static get watchers(){return{isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}}};L.style={ios:".sc-ion-loading-ios-h{--min-width:auto;--width:auto;--min-height:auto;--height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-loading-ios-h{display:none}.loading-wrapper.sc-ion-loading-ios{display:-ms-flexbox;display:flex;-ms-flex-align:inherit;align-items:inherit;-ms-flex-pack:inherit;justify-content:inherit;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);background:var(--background);opacity:0;z-index:10}ion-spinner.sc-ion-loading-ios{color:var(--spinner-color)}.sc-ion-loading-ios-h{--background:var(--ion-overlay-background-color, var(--ion-color-step-100, var(--ion-background-color-step-100, #f9f9f9)));--max-width:270px;--max-height:90%;--spinner-color:var(--ion-color-step-600, var(--ion-text-color-step-400, #666666));--backdrop-opacity:var(--ion-backdrop-opacity, 0.3);color:var(--ion-text-color, #000);font-size:0.875rem}.loading-wrapper.sc-ion-loading-ios{border-radius:8px;-webkit-padding-start:34px;padding-inline-start:34px;-webkit-padding-end:34px;padding-inline-end:34px;padding-top:24px;padding-bottom:24px}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.loading-translucent.sc-ion-loading-ios-h .loading-wrapper.sc-ion-loading-ios{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}.loading-content.sc-ion-loading-ios{font-weight:bold}.loading-spinner.sc-ion-loading-ios+.loading-content.sc-ion-loading-ios{-webkit-margin-start:16px;margin-inline-start:16px}",md:".sc-ion-loading-md-h{--min-width:auto;--width:auto;--min-height:auto;--height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-loading-md-h{display:none}.loading-wrapper.sc-ion-loading-md{display:-ms-flexbox;display:flex;-ms-flex-align:inherit;align-items:inherit;-ms-flex-pack:inherit;justify-content:inherit;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);background:var(--background);opacity:0;z-index:10}ion-spinner.sc-ion-loading-md{color:var(--spinner-color)}.sc-ion-loading-md-h{--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--max-width:280px;--max-height:90%;--spinner-color:var(--ion-color-primary, #0054e9);--backdrop-opacity:var(--ion-backdrop-opacity, 0.32);color:var(--ion-color-step-850, var(--ion-text-color-step-150, #262626));font-size:0.875rem}.loading-wrapper.sc-ion-loading-md{border-radius:2px;-webkit-padding-start:24px;padding-inline-start:24px;-webkit-padding-end:24px;padding-inline-end:24px;padding-top:24px;padding-bottom:24px;-webkit-box-shadow:0 16px 20px rgba(0, 0, 0, 0.4);box-shadow:0 16px 20px rgba(0, 0, 0, 0.4)}.loading-spinner.sc-ion-loading-md+.loading-content.sc-ion-loading-md{-webkit-margin-start:16px;margin-inline-start:16px}"};export{L as ion_loading}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import{d as n}from"./p-ZjP4CjeZ.js";import{n as e,c as o,f as t,m as i,g as a}from"./p-C-Cct-6D.js";import{OVERLAY_BACK_BUTTON_PRIORITY as r,shouldUseCloseWatcher as d}from"./p-CvaZMP6T.js";import{e as s,j as l,f as c}from"./p-4DxY6_gG.js";import{b as u,a as m}from"./p-Br3vSlYh.js";import{C as v}from"./p-DAfH9Iif.js";import{B as p}from"./p-BTEOs1at.js";const f='[tabindex]:not([tabindex^="-"]):not([hidden]):not([disabled]), input:not([type=hidden]):not([tabindex^="-"]):not([hidden]):not([disabled]), textarea:not([tabindex^="-"]):not([hidden]):not([disabled]), button:not([tabindex^="-"]):not([hidden]):not([disabled]), select:not([tabindex^="-"]):not([hidden]):not([disabled]), ion-checkbox:not([tabindex^="-"]):not([hidden]):not([disabled]), ion-radio:not([tabindex^="-"]):not([hidden]):not([disabled]), .ion-focusable:not([tabindex^="-"]):not([hidden]):not([disabled]), .ion-focusable[disabled="false"]:not([tabindex^="-"]):not([hidden])',h=(n,e)=>{const o=n.querySelector(f);y(o,null!=e?e:n)},b=(n,e)=>{const o=Array.from(n.querySelectorAll(f));y(o.length>0?o[o.length-1]:null,null!=e?e:n)},y=(n,o)=>{let t=n;const i=null==n?void 0:n.shadowRoot;if(i&&(t=i.querySelector(f)||n),t){const n=t.closest("ion-radio-group");n?n.setFocus():e(t)}else o.focus()};let g=0,w=0;const O=new WeakMap,T=n=>({create:e=>B(n,e),dismiss:(e,o,t)=>E(document,e,o,n,t),getTop:async()=>Z(document,n)}),k=T("ion-alert"),x=T("ion-action-sheet"),j=T("ion-loading"),A=T("ion-modal"),C=T("ion-picker-legacy"),I=T("ion-popover"),D=T("ion-toast"),S=n=>{"undefined"!=typeof document&&M(document);const e=g++;n.overlayIndex=e},N=n=>(n.hasAttribute("id")||(n.id="ion-overlay-"+ ++w),n.id),B=(n,e)=>"undefined"!=typeof window&&void 0!==window.customElements?window.customElements.whenDefined(n).then((()=>{const t=document.createElement(n);return t.classList.add("overlay-hidden"),Object.assign(t,Object.assign(Object.assign({},e),{hasController:!0})),Y(document).appendChild(t),new Promise((n=>o(t,n)))})):Promise.resolve(),P=(n,o)=>{let t=n;const i=null==n?void 0:n.shadowRoot;i&&(t=i.querySelector(f)||n),t?e(t):o.focus()},M=n=>{0===g&&(g=1,n.addEventListener("focus",(e=>{((n,e)=>{const o=Z(e,"ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker-legacy,ion-popover"),t=n.target;o&&t&&(o.classList.contains(tn)||(o.shadowRoot?(()=>{if(o.contains(t))o.lastFocus=t;else if("ION-TOAST"===t.tagName)P(o.lastFocus,o);else{const n=o.lastFocus;h(o),n===e.activeElement&&b(o),o.lastFocus=e.activeElement}})():(()=>{if(o===t)o.lastFocus=void 0;else if("ION-TOAST"===t.tagName)P(o.lastFocus,o);else{const n=a(o);if(!n.contains(t))return;const i=n.querySelector(".ion-overlay-wrapper");if(!i)return;if(i.contains(t)||t===n.querySelector("ion-backdrop"))o.lastFocus=t;else{const n=o.lastFocus;h(i,o),n===e.activeElement&&b(i,o),o.lastFocus=e.activeElement}}})()))})(e,n)}),!0),n.addEventListener("ionBackButton",(e=>{const o=Z(n);(null==o?void 0:o.backdropDismiss)&&e.detail.register(r,(()=>{o.dismiss(void 0,K)}))})),d()||n.addEventListener("keydown",(e=>{if("Escape"===e.key){const e=Z(n);(null==e?void 0:e.backdropDismiss)&&e.dismiss(void 0,K)}})))},E=(n,e,o,t,i)=>{const a=Z(n,t,i);return a?a.dismiss(e,o):Promise.reject("overlay does not exist")},G=(n,e)=>((n,e)=>(void 0===e&&(e="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker-legacy,ion-popover,ion-toast"),Array.from(n.querySelectorAll(e)).filter((n=>n.overlayIndex>0))))(n,e).filter((n=>!n.classList.contains("overlay-hidden"))),Z=(n,e,o)=>{const t=G(n,e);return void 0===o?t[t.length-1]:t.find((n=>n.id===o))},$=(n=!1)=>{const e=Y(document).querySelector("ion-router-outlet, ion-nav, #ion-view-container-root");e&&(n?(e.setAttribute("aria-hidden","true"),e.setAttribute("inert","")):(e.removeAttribute("aria-hidden"),e.removeAttribute("inert")))},F=async(n,e,o,t,i)=>{var a,r;if(n.presented)return;console.log("presenting overlay..."),"ION-TOAST"!==n.el.tagName&&$(!0),en(n.el),nn(n.el),n.presented=!0,n.willPresent.emit(),null===(a=n.willPresentShorthand)||void 0===a||a.emit();const d=u(n),l=n.enterAnimation?n.enterAnimation:s.get(e,"ios"===d?o:t);await _(n,l,n.el,i)&&(n.didPresent.emit(),null===(r=n.didPresentShorthand)||void 0===r||r.emit()),"ION-TOAST"!==n.el.tagName&&L(n.el),!n.keyboardClose||null!==document.activeElement&&n.el.contains(document.activeElement)||n.el.focus(),n.el.removeAttribute("aria-hidden"),n.el.removeAttribute("inert")},L=async n=>{let e=document.activeElement;if(!e)return;const o=null==e?void 0:e.shadowRoot;o&&(e=o.querySelector(f)||e),await n.onDidDismiss(),null!==document.activeElement&&document.activeElement!==document.body||e.focus()},V=async(e,o,t,i,a,r,d)=>{var c,m;if(!e.presented)return!1;const v=(void 0!==n?G(n):[]).filter((n=>"ION-TOAST"!==n.tagName));1===v.length&&v[0].id===e.el.id&&($(!1),document.body.classList.remove(p)),e.presented=!1;try{nn(e.el),e.el.style.setProperty("pointer-events","none"),e.willDismiss.emit({data:o,role:t}),null===(c=e.willDismissShorthand)||void 0===c||c.emit({data:o,role:t});const n=u(e),l=e.leaveAnimation?e.leaveAnimation:s.get(i,"ios"===n?a:r);t!==Q&&await _(e,l,e.el,d),e.didDismiss.emit({data:o,role:t}),null===(m=e.didDismissShorthand)||void 0===m||m.emit({data:o,role:t}),(O.get(e)||[]).forEach((n=>n.destroy())),O.delete(e),e.el.classList.add("overlay-hidden"),e.el.style.removeProperty("pointer-events"),void 0!==e.el.lastFocus&&(e.el.lastFocus=void 0)}catch(n){l(`[${e.el.tagName.toLowerCase()}] - `,n)}return e.el.remove(),on(),!0},Y=n=>n.querySelector("ion-app")||n.body,_=async(n,e,o,t)=>{o.classList.remove("overlay-hidden");const i=e(n.el,t);n.animated&&s.getBoolean("animated",!0)||i.duration(0),n.keyboardClose&&i.beforeAddWrite((()=>{const n=o.ownerDocument.activeElement;(null==n?void 0:n.matches("input,ion-input, ion-textarea"))&&n.blur()}));const a=O.get(n)||[];return O.set(n,[...a,i]),await i.play(),!0},q=(n,e)=>{let o;const t=new Promise((n=>o=n));return z(n,e,(n=>{o(n.detail)})),t},z=(n,e,o)=>{const a=t=>{i(n,e,a),o(t)};t(n,e,a)},H=n=>"cancel"===n||n===K,W=n=>n(),J=(n,e)=>{if("function"==typeof n)return s.get("_zoneGate",W)((()=>{try{return n(e)}catch(n){throw n}}))},K="backdrop",Q="gesture",R=39,U=n=>{let e,o=!1;const t=v(),i=(i=!1)=>{if(e&&!i)return{delegate:e,inline:o};const{el:a,hasController:r,delegate:d}=n;return o=null!==a.parentNode&&!r,e=o?d||t:d,{inline:o,delegate:e}};return{attachViewToDom:async e=>{const{delegate:o}=i(!0);if(o)return await o.attachViewToDom(n.el,e);const{hasController:t}=n;if(t&&void 0!==e)throw new Error("framework delegate is missing");return null},removeViewFromDom:()=>{const{delegate:e}=i();e&&void 0!==n.el&&e.removeViewFromDom(n.el.parentElement,n.el)}}},X=()=>{let n;const e=()=>{n&&(n(),n=void 0)};return{addClickListener:(o,t)=>{e();const i=void 0!==t?document.getElementById(t):null;i?n=((n,e)=>{const o=()=>{e.present()};return n.addEventListener("click",o),()=>{n.removeEventListener("click",o)}})(i,o):c(`[${o.tagName.toLowerCase()}] - A trigger element with the ID "${t}" was not found in the DOM. The trigger element must be in the DOM when the "trigger" property is set on an overlay component.`,o)},removeClickListener:e}},nn=e=>{void 0!==n&&m("android")&&(e.setAttribute("aria-hidden","true"),e.setAttribute("inert",""))},en=e=>{var o;if(void 0===n)return;const t=G(n);for(let n=t.length-1;n>=0;n--){const i=t[n],a=null!==(o=t[n+1])&&void 0!==o?o:e;(a.hasAttribute("aria-hidden")||"ION-TOAST"!==a.tagName)&&(i.setAttribute("aria-hidden","true"),i.setAttribute("inert",""))}},on=()=>{if(void 0===n)return;const e=G(n);for(let n=e.length-1;n>=0;n--){const o=e[n];if(o.removeAttribute("aria-hidden"),o.removeAttribute("inert"),"ION-TOAST"!==o.tagName)break}},tn="ion-disable-focus-trap";export{K as B,tn as F,Q as G,R as O,k as a,x as b,I as c,U as d,X as e,F as f,V as g,q as h,H as i,S as j,N as k,j as l,A as m,h as n,Z as o,C as p,b as q,J as s,D as t}
|
package/hydrate/index.js
CHANGED
|
@@ -6179,6 +6179,7 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
6179
6179
|
if (overlay.presented) {
|
|
6180
6180
|
return;
|
|
6181
6181
|
}
|
|
6182
|
+
console.log("presenting overlay...");
|
|
6182
6183
|
/**
|
|
6183
6184
|
* Due to accessibility guidelines, toasts do not have
|
|
6184
6185
|
* focus traps.
|
|
@@ -6188,8 +6189,9 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
6188
6189
|
*/
|
|
6189
6190
|
if (overlay.el.tagName !== 'ION-TOAST') {
|
|
6190
6191
|
setRootAriaHidden(true);
|
|
6191
|
-
document.body.classList.add(BACKDROP_NO_SCROLL);
|
|
6192
6192
|
}
|
|
6193
|
+
hideUnderlyingOverlaysFromScreenReaders(overlay.el);
|
|
6194
|
+
hideAnimatingOverlayFromScreenReaders(overlay.el);
|
|
6193
6195
|
overlay.presented = true;
|
|
6194
6196
|
overlay.willPresent.emit();
|
|
6195
6197
|
(_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
|
|
@@ -6236,6 +6238,7 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
6236
6238
|
* screen readers.
|
|
6237
6239
|
*/
|
|
6238
6240
|
overlay.el.removeAttribute('aria-hidden');
|
|
6241
|
+
overlay.el.removeAttribute('inert');
|
|
6239
6242
|
};
|
|
6240
6243
|
/**
|
|
6241
6244
|
* When an overlay component is dismissed,
|
|
@@ -6315,6 +6318,12 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
6315
6318
|
}
|
|
6316
6319
|
overlay.presented = false;
|
|
6317
6320
|
try {
|
|
6321
|
+
/**
|
|
6322
|
+
* There is no need to show the overlay to screen readers during
|
|
6323
|
+
* the dismiss animation. This is because the overlay will be removed
|
|
6324
|
+
* from the DOM after the animation is complete.
|
|
6325
|
+
*/
|
|
6326
|
+
hideAnimatingOverlayFromScreenReaders(overlay.el);
|
|
6318
6327
|
// Overlay contents should not be clickable during dismiss
|
|
6319
6328
|
overlay.el.style.setProperty('pointer-events', 'none');
|
|
6320
6329
|
overlay.willDismiss.emit({ data, role });
|
|
@@ -6353,6 +6362,7 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
6353
6362
|
printIonError(`[${overlay.el.tagName.toLowerCase()}] - `, err);
|
|
6354
6363
|
}
|
|
6355
6364
|
overlay.el.remove();
|
|
6365
|
+
revealOverlaysToScreenReaders();
|
|
6356
6366
|
return true;
|
|
6357
6367
|
};
|
|
6358
6368
|
const getAppRoot = (doc) => {
|
|
@@ -6548,6 +6558,96 @@ const createTriggerController = () => {
|
|
|
6548
6558
|
removeClickListener,
|
|
6549
6559
|
};
|
|
6550
6560
|
};
|
|
6561
|
+
/**
|
|
6562
|
+
* The overlay that is being animated also needs to hide from screen
|
|
6563
|
+
* readers during its animation. This ensures that assistive technologies
|
|
6564
|
+
* like TalkBack do not announce or interact with the content until the
|
|
6565
|
+
* animation is complete, avoiding confusion for users.
|
|
6566
|
+
*
|
|
6567
|
+
* When the overlay is presented on an Android device, TalkBack's focus rings
|
|
6568
|
+
* may appear in the wrong position due to the transition (specifically
|
|
6569
|
+
* `transform` styles). This occurs because the focus rings are initially
|
|
6570
|
+
* displayed at the starting position of the elements before the transition
|
|
6571
|
+
* begins. This workaround ensures the focus rings do not appear in the
|
|
6572
|
+
* incorrect location.
|
|
6573
|
+
*
|
|
6574
|
+
* If this solution is applied to iOS devices, then it leads to a bug where
|
|
6575
|
+
* the overlays cannot be accessed by screen readers. This is due to
|
|
6576
|
+
* VoiceOver not being able to update the accessibility tree when the
|
|
6577
|
+
* `aria-hidden` is removed.
|
|
6578
|
+
*
|
|
6579
|
+
* @param overlay - The overlay that is being animated.
|
|
6580
|
+
*/
|
|
6581
|
+
const hideAnimatingOverlayFromScreenReaders = (overlay) => {
|
|
6582
|
+
if (doc === undefined)
|
|
6583
|
+
return;
|
|
6584
|
+
if (isPlatform('android')) {
|
|
6585
|
+
/**
|
|
6586
|
+
* Once the animation is complete, this attribute will be removed.
|
|
6587
|
+
* This is done at the end of the `present` method.
|
|
6588
|
+
*/
|
|
6589
|
+
overlay.setAttribute('aria-hidden', 'true');
|
|
6590
|
+
overlay.setAttribute('inert', '');
|
|
6591
|
+
}
|
|
6592
|
+
};
|
|
6593
|
+
/**
|
|
6594
|
+
* Ensure that underlying overlays have aria-hidden if necessary so that screen readers
|
|
6595
|
+
* cannot move focus to these elements. Note that we cannot rely on focus/focusin/focusout
|
|
6596
|
+
* events here because those events do not fire when the screen readers moves to a non-focusable
|
|
6597
|
+
* element such as text.
|
|
6598
|
+
* Without this logic screen readers would be able to move focus outside of the top focus-trapped overlay.
|
|
6599
|
+
*
|
|
6600
|
+
* @param newTopMostOverlay - The overlay that is being presented. Since the overlay has not been
|
|
6601
|
+
* fully presented yet at the time this function is called it will not be included in the getPresentedOverlays result.
|
|
6602
|
+
*/
|
|
6603
|
+
const hideUnderlyingOverlaysFromScreenReaders = (newTopMostOverlay) => {
|
|
6604
|
+
var _a;
|
|
6605
|
+
if (doc === undefined)
|
|
6606
|
+
return;
|
|
6607
|
+
const overlays = getPresentedOverlays(doc);
|
|
6608
|
+
for (let i = overlays.length - 1; i >= 0; i--) {
|
|
6609
|
+
const presentedOverlay = overlays[i];
|
|
6610
|
+
const nextPresentedOverlay = (_a = overlays[i + 1]) !== null && _a !== void 0 ? _a : newTopMostOverlay;
|
|
6611
|
+
/**
|
|
6612
|
+
* If next overlay has aria-hidden then all remaining overlays will have it too.
|
|
6613
|
+
* Or, if the next overlay is a Toast that does not have aria-hidden then current overlay
|
|
6614
|
+
* should not have aria-hidden either so focus can remain in the current overlay.
|
|
6615
|
+
*/
|
|
6616
|
+
if (nextPresentedOverlay.hasAttribute('aria-hidden') || nextPresentedOverlay.tagName !== 'ION-TOAST') {
|
|
6617
|
+
presentedOverlay.setAttribute('aria-hidden', 'true');
|
|
6618
|
+
presentedOverlay.setAttribute('inert', '');
|
|
6619
|
+
}
|
|
6620
|
+
}
|
|
6621
|
+
};
|
|
6622
|
+
/**
|
|
6623
|
+
* When dismissing an overlay we need to reveal the new top-most overlay to screen readers.
|
|
6624
|
+
* If the top-most overlay is a Toast we potentially need to reveal more overlays since
|
|
6625
|
+
* focus is never automatically moved to the Toast.
|
|
6626
|
+
*/
|
|
6627
|
+
const revealOverlaysToScreenReaders = () => {
|
|
6628
|
+
if (doc === undefined)
|
|
6629
|
+
return;
|
|
6630
|
+
const overlays = getPresentedOverlays(doc);
|
|
6631
|
+
for (let i = overlays.length - 1; i >= 0; i--) {
|
|
6632
|
+
const currentOverlay = overlays[i];
|
|
6633
|
+
/**
|
|
6634
|
+
* If the current we are looking at is a Toast then we can remove aria-hidden.
|
|
6635
|
+
* However, we potentially need to keep looking at the overlay stack because there
|
|
6636
|
+
* could be more Toasts underneath. Additionally, we need to unhide the closest non-Toast
|
|
6637
|
+
* overlay too so focus can move there since focus is never automatically moved to the Toast.
|
|
6638
|
+
*/
|
|
6639
|
+
currentOverlay.removeAttribute('aria-hidden');
|
|
6640
|
+
currentOverlay.removeAttribute('inert');
|
|
6641
|
+
/**
|
|
6642
|
+
* If we found a non-Toast element then we can just remove aria-hidden and stop searching entirely
|
|
6643
|
+
* since this overlay should always receive focus. As a result, all underlying overlays should still
|
|
6644
|
+
* be hidden from screen readers.
|
|
6645
|
+
*/
|
|
6646
|
+
if (currentOverlay.tagName !== 'ION-TOAST') {
|
|
6647
|
+
break;
|
|
6648
|
+
}
|
|
6649
|
+
}
|
|
6650
|
+
};
|
|
6551
6651
|
const FOCUS_TRAP_DISABLE_CLASS = 'ion-disable-focus-trap';
|
|
6552
6652
|
|
|
6553
6653
|
const hostContext = (selector, el) => {
|
|
@@ -29202,6 +29302,14 @@ class Refresher {
|
|
|
29202
29302
|
this.beginRefresh();
|
|
29203
29303
|
this.didRefresh = true;
|
|
29204
29304
|
hapticImpact({ style: ImpactStyle.Light });
|
|
29305
|
+
/**
|
|
29306
|
+
* Clear focus from any active element to prevent scroll jumps
|
|
29307
|
+
* when the refresh completes
|
|
29308
|
+
*/
|
|
29309
|
+
const activeElement = document.activeElement;
|
|
29310
|
+
if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.blur) !== undefined) {
|
|
29311
|
+
activeElement.blur();
|
|
29312
|
+
}
|
|
29205
29313
|
/**
|
|
29206
29314
|
* Translate the content element otherwise when pointer is removed
|
|
29207
29315
|
* from screen the scroll content will bounce back over the refresher
|
|
@@ -29617,6 +29725,15 @@ class Refresher {
|
|
|
29617
29725
|
this.state = 8 /* RefresherState.Refreshing */;
|
|
29618
29726
|
// place the content in a hangout position while it thinks
|
|
29619
29727
|
this.setCss(this.pullMin, this.snapbackDuration, true, '');
|
|
29728
|
+
/**
|
|
29729
|
+
* Clear focus from any active element to prevent the browser
|
|
29730
|
+
* from restoring focus and causing scroll jumps after refresh.
|
|
29731
|
+
* This ensures the view stays at the top after refresh completes.
|
|
29732
|
+
*/
|
|
29733
|
+
const activeElement = document.activeElement;
|
|
29734
|
+
if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.blur) !== undefined) {
|
|
29735
|
+
activeElement.blur();
|
|
29736
|
+
}
|
|
29620
29737
|
// emit "refresh" because it was pulled down far enough
|
|
29621
29738
|
// and they let go to begin refreshing
|
|
29622
29739
|
this.ionRefresh.emit({
|
|
@@ -29699,7 +29816,7 @@ class Refresher {
|
|
|
29699
29816
|
}
|
|
29700
29817
|
render() {
|
|
29701
29818
|
const mode = getIonMode$1(this);
|
|
29702
|
-
return (hAsync(Host, { key: '
|
|
29819
|
+
return (hAsync(Host, { key: '2d1bd880877b698604542ab2d602d38b9504d975', slot: "fixed", class: {
|
|
29703
29820
|
[mode]: true,
|
|
29704
29821
|
// Used internally for styling
|
|
29705
29822
|
[`refresher-${mode}`]: true,
|
package/hydrate/index.mjs
CHANGED
|
@@ -6177,6 +6177,7 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
6177
6177
|
if (overlay.presented) {
|
|
6178
6178
|
return;
|
|
6179
6179
|
}
|
|
6180
|
+
console.log("presenting overlay...");
|
|
6180
6181
|
/**
|
|
6181
6182
|
* Due to accessibility guidelines, toasts do not have
|
|
6182
6183
|
* focus traps.
|
|
@@ -6186,8 +6187,9 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
6186
6187
|
*/
|
|
6187
6188
|
if (overlay.el.tagName !== 'ION-TOAST') {
|
|
6188
6189
|
setRootAriaHidden(true);
|
|
6189
|
-
document.body.classList.add(BACKDROP_NO_SCROLL);
|
|
6190
6190
|
}
|
|
6191
|
+
hideUnderlyingOverlaysFromScreenReaders(overlay.el);
|
|
6192
|
+
hideAnimatingOverlayFromScreenReaders(overlay.el);
|
|
6191
6193
|
overlay.presented = true;
|
|
6192
6194
|
overlay.willPresent.emit();
|
|
6193
6195
|
(_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
|
|
@@ -6234,6 +6236,7 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
6234
6236
|
* screen readers.
|
|
6235
6237
|
*/
|
|
6236
6238
|
overlay.el.removeAttribute('aria-hidden');
|
|
6239
|
+
overlay.el.removeAttribute('inert');
|
|
6237
6240
|
};
|
|
6238
6241
|
/**
|
|
6239
6242
|
* When an overlay component is dismissed,
|
|
@@ -6313,6 +6316,12 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
6313
6316
|
}
|
|
6314
6317
|
overlay.presented = false;
|
|
6315
6318
|
try {
|
|
6319
|
+
/**
|
|
6320
|
+
* There is no need to show the overlay to screen readers during
|
|
6321
|
+
* the dismiss animation. This is because the overlay will be removed
|
|
6322
|
+
* from the DOM after the animation is complete.
|
|
6323
|
+
*/
|
|
6324
|
+
hideAnimatingOverlayFromScreenReaders(overlay.el);
|
|
6316
6325
|
// Overlay contents should not be clickable during dismiss
|
|
6317
6326
|
overlay.el.style.setProperty('pointer-events', 'none');
|
|
6318
6327
|
overlay.willDismiss.emit({ data, role });
|
|
@@ -6351,6 +6360,7 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
6351
6360
|
printIonError(`[${overlay.el.tagName.toLowerCase()}] - `, err);
|
|
6352
6361
|
}
|
|
6353
6362
|
overlay.el.remove();
|
|
6363
|
+
revealOverlaysToScreenReaders();
|
|
6354
6364
|
return true;
|
|
6355
6365
|
};
|
|
6356
6366
|
const getAppRoot = (doc) => {
|
|
@@ -6546,6 +6556,96 @@ const createTriggerController = () => {
|
|
|
6546
6556
|
removeClickListener,
|
|
6547
6557
|
};
|
|
6548
6558
|
};
|
|
6559
|
+
/**
|
|
6560
|
+
* The overlay that is being animated also needs to hide from screen
|
|
6561
|
+
* readers during its animation. This ensures that assistive technologies
|
|
6562
|
+
* like TalkBack do not announce or interact with the content until the
|
|
6563
|
+
* animation is complete, avoiding confusion for users.
|
|
6564
|
+
*
|
|
6565
|
+
* When the overlay is presented on an Android device, TalkBack's focus rings
|
|
6566
|
+
* may appear in the wrong position due to the transition (specifically
|
|
6567
|
+
* `transform` styles). This occurs because the focus rings are initially
|
|
6568
|
+
* displayed at the starting position of the elements before the transition
|
|
6569
|
+
* begins. This workaround ensures the focus rings do not appear in the
|
|
6570
|
+
* incorrect location.
|
|
6571
|
+
*
|
|
6572
|
+
* If this solution is applied to iOS devices, then it leads to a bug where
|
|
6573
|
+
* the overlays cannot be accessed by screen readers. This is due to
|
|
6574
|
+
* VoiceOver not being able to update the accessibility tree when the
|
|
6575
|
+
* `aria-hidden` is removed.
|
|
6576
|
+
*
|
|
6577
|
+
* @param overlay - The overlay that is being animated.
|
|
6578
|
+
*/
|
|
6579
|
+
const hideAnimatingOverlayFromScreenReaders = (overlay) => {
|
|
6580
|
+
if (doc === undefined)
|
|
6581
|
+
return;
|
|
6582
|
+
if (isPlatform('android')) {
|
|
6583
|
+
/**
|
|
6584
|
+
* Once the animation is complete, this attribute will be removed.
|
|
6585
|
+
* This is done at the end of the `present` method.
|
|
6586
|
+
*/
|
|
6587
|
+
overlay.setAttribute('aria-hidden', 'true');
|
|
6588
|
+
overlay.setAttribute('inert', '');
|
|
6589
|
+
}
|
|
6590
|
+
};
|
|
6591
|
+
/**
|
|
6592
|
+
* Ensure that underlying overlays have aria-hidden if necessary so that screen readers
|
|
6593
|
+
* cannot move focus to these elements. Note that we cannot rely on focus/focusin/focusout
|
|
6594
|
+
* events here because those events do not fire when the screen readers moves to a non-focusable
|
|
6595
|
+
* element such as text.
|
|
6596
|
+
* Without this logic screen readers would be able to move focus outside of the top focus-trapped overlay.
|
|
6597
|
+
*
|
|
6598
|
+
* @param newTopMostOverlay - The overlay that is being presented. Since the overlay has not been
|
|
6599
|
+
* fully presented yet at the time this function is called it will not be included in the getPresentedOverlays result.
|
|
6600
|
+
*/
|
|
6601
|
+
const hideUnderlyingOverlaysFromScreenReaders = (newTopMostOverlay) => {
|
|
6602
|
+
var _a;
|
|
6603
|
+
if (doc === undefined)
|
|
6604
|
+
return;
|
|
6605
|
+
const overlays = getPresentedOverlays(doc);
|
|
6606
|
+
for (let i = overlays.length - 1; i >= 0; i--) {
|
|
6607
|
+
const presentedOverlay = overlays[i];
|
|
6608
|
+
const nextPresentedOverlay = (_a = overlays[i + 1]) !== null && _a !== void 0 ? _a : newTopMostOverlay;
|
|
6609
|
+
/**
|
|
6610
|
+
* If next overlay has aria-hidden then all remaining overlays will have it too.
|
|
6611
|
+
* Or, if the next overlay is a Toast that does not have aria-hidden then current overlay
|
|
6612
|
+
* should not have aria-hidden either so focus can remain in the current overlay.
|
|
6613
|
+
*/
|
|
6614
|
+
if (nextPresentedOverlay.hasAttribute('aria-hidden') || nextPresentedOverlay.tagName !== 'ION-TOAST') {
|
|
6615
|
+
presentedOverlay.setAttribute('aria-hidden', 'true');
|
|
6616
|
+
presentedOverlay.setAttribute('inert', '');
|
|
6617
|
+
}
|
|
6618
|
+
}
|
|
6619
|
+
};
|
|
6620
|
+
/**
|
|
6621
|
+
* When dismissing an overlay we need to reveal the new top-most overlay to screen readers.
|
|
6622
|
+
* If the top-most overlay is a Toast we potentially need to reveal more overlays since
|
|
6623
|
+
* focus is never automatically moved to the Toast.
|
|
6624
|
+
*/
|
|
6625
|
+
const revealOverlaysToScreenReaders = () => {
|
|
6626
|
+
if (doc === undefined)
|
|
6627
|
+
return;
|
|
6628
|
+
const overlays = getPresentedOverlays(doc);
|
|
6629
|
+
for (let i = overlays.length - 1; i >= 0; i--) {
|
|
6630
|
+
const currentOverlay = overlays[i];
|
|
6631
|
+
/**
|
|
6632
|
+
* If the current we are looking at is a Toast then we can remove aria-hidden.
|
|
6633
|
+
* However, we potentially need to keep looking at the overlay stack because there
|
|
6634
|
+
* could be more Toasts underneath. Additionally, we need to unhide the closest non-Toast
|
|
6635
|
+
* overlay too so focus can move there since focus is never automatically moved to the Toast.
|
|
6636
|
+
*/
|
|
6637
|
+
currentOverlay.removeAttribute('aria-hidden');
|
|
6638
|
+
currentOverlay.removeAttribute('inert');
|
|
6639
|
+
/**
|
|
6640
|
+
* If we found a non-Toast element then we can just remove aria-hidden and stop searching entirely
|
|
6641
|
+
* since this overlay should always receive focus. As a result, all underlying overlays should still
|
|
6642
|
+
* be hidden from screen readers.
|
|
6643
|
+
*/
|
|
6644
|
+
if (currentOverlay.tagName !== 'ION-TOAST') {
|
|
6645
|
+
break;
|
|
6646
|
+
}
|
|
6647
|
+
}
|
|
6648
|
+
};
|
|
6549
6649
|
const FOCUS_TRAP_DISABLE_CLASS = 'ion-disable-focus-trap';
|
|
6550
6650
|
|
|
6551
6651
|
const hostContext = (selector, el) => {
|
|
@@ -29200,6 +29300,14 @@ class Refresher {
|
|
|
29200
29300
|
this.beginRefresh();
|
|
29201
29301
|
this.didRefresh = true;
|
|
29202
29302
|
hapticImpact({ style: ImpactStyle.Light });
|
|
29303
|
+
/**
|
|
29304
|
+
* Clear focus from any active element to prevent scroll jumps
|
|
29305
|
+
* when the refresh completes
|
|
29306
|
+
*/
|
|
29307
|
+
const activeElement = document.activeElement;
|
|
29308
|
+
if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.blur) !== undefined) {
|
|
29309
|
+
activeElement.blur();
|
|
29310
|
+
}
|
|
29203
29311
|
/**
|
|
29204
29312
|
* Translate the content element otherwise when pointer is removed
|
|
29205
29313
|
* from screen the scroll content will bounce back over the refresher
|
|
@@ -29615,6 +29723,15 @@ class Refresher {
|
|
|
29615
29723
|
this.state = 8 /* RefresherState.Refreshing */;
|
|
29616
29724
|
// place the content in a hangout position while it thinks
|
|
29617
29725
|
this.setCss(this.pullMin, this.snapbackDuration, true, '');
|
|
29726
|
+
/**
|
|
29727
|
+
* Clear focus from any active element to prevent the browser
|
|
29728
|
+
* from restoring focus and causing scroll jumps after refresh.
|
|
29729
|
+
* This ensures the view stays at the top after refresh completes.
|
|
29730
|
+
*/
|
|
29731
|
+
const activeElement = document.activeElement;
|
|
29732
|
+
if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.blur) !== undefined) {
|
|
29733
|
+
activeElement.blur();
|
|
29734
|
+
}
|
|
29618
29735
|
// emit "refresh" because it was pulled down far enough
|
|
29619
29736
|
// and they let go to begin refreshing
|
|
29620
29737
|
this.ionRefresh.emit({
|
|
@@ -29697,7 +29814,7 @@ class Refresher {
|
|
|
29697
29814
|
}
|
|
29698
29815
|
render() {
|
|
29699
29816
|
const mode = getIonMode$1(this);
|
|
29700
|
-
return (hAsync(Host, { key: '
|
|
29817
|
+
return (hAsync(Host, { key: '2d1bd880877b698604542ab2d602d38b9504d975', slot: "fixed", class: {
|
|
29701
29818
|
[mode]: true,
|
|
29702
29819
|
// Used internally for styling
|
|
29703
29820
|
[`refresher-${mode}`]: true,
|
package/package.json
CHANGED
package/dist/ionic/p-C3MD7jSK.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{d as n}from"./p-ZjP4CjeZ.js";import{n as o,c as e,f as t,m as i,g as a}from"./p-C-Cct-6D.js";import{OVERLAY_BACK_BUTTON_PRIORITY as s,shouldUseCloseWatcher as d}from"./p-CvaZMP6T.js";import{e as r,j as l,f as c}from"./p-4DxY6_gG.js";import{b as u}from"./p-Br3vSlYh.js";import{C as m}from"./p-DAfH9Iif.js";import{B as p}from"./p-BTEOs1at.js";const v='[tabindex]:not([tabindex^="-"]):not([hidden]):not([disabled]), input:not([type=hidden]):not([tabindex^="-"]):not([hidden]):not([disabled]), textarea:not([tabindex^="-"]):not([hidden]):not([disabled]), button:not([tabindex^="-"]):not([hidden]):not([disabled]), select:not([tabindex^="-"]):not([hidden]):not([disabled]), ion-checkbox:not([tabindex^="-"]):not([hidden]):not([disabled]), ion-radio:not([tabindex^="-"]):not([hidden]):not([disabled]), .ion-focusable:not([tabindex^="-"]):not([hidden]):not([disabled]), .ion-focusable[disabled="false"]:not([tabindex^="-"]):not([hidden])',f=(n,o)=>{const e=n.querySelector(v);b(e,null!=o?o:n)},h=(n,o)=>{const e=Array.from(n.querySelectorAll(v));b(e.length>0?e[e.length-1]:null,null!=o?o:n)},b=(n,e)=>{let t=n;const i=null==n?void 0:n.shadowRoot;if(i&&(t=i.querySelector(v)||n),t){const n=t.closest("ion-radio-group");n?n.setFocus():o(t)}else e.focus()};let y=0,w=0;const g=new WeakMap,O=n=>({create:o=>P(n,o),dismiss:(o,e,t)=>M(document,o,e,n,t),getTop:async()=>G(document,n)}),x=O("ion-alert"),k=O("ion-action-sheet"),T=O("ion-loading"),j=O("ion-modal"),C=O("ion-picker-legacy"),A=O("ion-popover"),D=O("ion-toast"),I=n=>{"undefined"!=typeof document&&N(document);const o=y++;n.overlayIndex=o},B=n=>(n.hasAttribute("id")||(n.id="ion-overlay-"+ ++w),n.id),P=(n,o)=>"undefined"!=typeof window&&void 0!==window.customElements?window.customElements.whenDefined(n).then((()=>{const t=document.createElement(n);return t.classList.add("overlay-hidden"),Object.assign(t,Object.assign(Object.assign({},o),{hasController:!0})),V(document).appendChild(t),new Promise((n=>e(t,n)))})):Promise.resolve(),S=(n,e)=>{let t=n;const i=null==n?void 0:n.shadowRoot;i&&(t=i.querySelector(v)||n),t?o(t):e.focus()},N=n=>{0===y&&(y=1,n.addEventListener("focus",(o=>{((n,o)=>{const e=G(o,"ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker-legacy,ion-popover"),t=n.target;e&&t&&(e.classList.contains(X)||(e.shadowRoot?(()=>{if(e.contains(t))e.lastFocus=t;else if("ION-TOAST"===t.tagName)S(e.lastFocus,e);else{const n=e.lastFocus;f(e),n===o.activeElement&&h(e),e.lastFocus=o.activeElement}})():(()=>{if(e===t)e.lastFocus=void 0;else if("ION-TOAST"===t.tagName)S(e.lastFocus,e);else{const n=a(e);if(!n.contains(t))return;const i=n.querySelector(".ion-overlay-wrapper");if(!i)return;if(i.contains(t)||t===n.querySelector("ion-backdrop"))e.lastFocus=t;else{const n=e.lastFocus;f(i,e),n===o.activeElement&&h(i,e),e.lastFocus=o.activeElement}}})()))})(o,n)}),!0),n.addEventListener("ionBackButton",(o=>{const e=G(n);(null==e?void 0:e.backdropDismiss)&&o.detail.register(s,(()=>{e.dismiss(void 0,J)}))})),d()||n.addEventListener("keydown",(o=>{if("Escape"===o.key){const o=G(n);(null==o?void 0:o.backdropDismiss)&&o.dismiss(void 0,J)}})))},M=(n,o,e,t,i)=>{const a=G(n,t,i);return a?a.dismiss(o,e):Promise.reject("overlay does not exist")},E=(n,o)=>((n,o)=>(void 0===o&&(o="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker-legacy,ion-popover,ion-toast"),Array.from(n.querySelectorAll(o)).filter((n=>n.overlayIndex>0))))(n,o).filter((n=>!n.classList.contains("overlay-hidden"))),G=(n,o,e)=>{const t=E(n,o);return void 0===e?t[t.length-1]:t.find((n=>n.id===e))},Z=(n=!1)=>{const o=V(document).querySelector("ion-router-outlet, ion-nav, #ion-view-container-root");o&&(n?(o.setAttribute("aria-hidden","true"),o.setAttribute("inert","")):(o.removeAttribute("aria-hidden"),o.removeAttribute("inert")))},$=async(n,o,e,t,i)=>{var a,s;if(n.presented)return;"ION-TOAST"!==n.el.tagName&&(Z(!0),document.body.classList.add(p)),n.presented=!0,n.willPresent.emit(),null===(a=n.willPresentShorthand)||void 0===a||a.emit();const d=u(n),l=n.enterAnimation?n.enterAnimation:r.get(o,"ios"===d?e:t);await Y(n,l,n.el,i)&&(n.didPresent.emit(),null===(s=n.didPresentShorthand)||void 0===s||s.emit()),"ION-TOAST"!==n.el.tagName&&F(n.el),!n.keyboardClose||null!==document.activeElement&&n.el.contains(document.activeElement)||n.el.focus(),n.el.removeAttribute("aria-hidden")},F=async n=>{let o=document.activeElement;if(!o)return;const e=null==o?void 0:o.shadowRoot;e&&(o=e.querySelector(v)||o),await n.onDidDismiss(),null!==document.activeElement&&document.activeElement!==document.body||o.focus()},L=async(o,e,t,i,a,s,d)=>{var c,m;if(!o.presented)return!1;const v=(void 0!==n?E(n):[]).filter((n=>"ION-TOAST"!==n.tagName));1===v.length&&v[0].id===o.el.id&&(Z(!1),document.body.classList.remove(p)),o.presented=!1;try{o.el.style.setProperty("pointer-events","none"),o.willDismiss.emit({data:e,role:t}),null===(c=o.willDismissShorthand)||void 0===c||c.emit({data:e,role:t});const n=u(o),l=o.leaveAnimation?o.leaveAnimation:r.get(i,"ios"===n?a:s);t!==K&&await Y(o,l,o.el,d),o.didDismiss.emit({data:e,role:t}),null===(m=o.didDismissShorthand)||void 0===m||m.emit({data:e,role:t}),(g.get(o)||[]).forEach((n=>n.destroy())),g.delete(o),o.el.classList.add("overlay-hidden"),o.el.style.removeProperty("pointer-events"),void 0!==o.el.lastFocus&&(o.el.lastFocus=void 0)}catch(n){l(`[${o.el.tagName.toLowerCase()}] - `,n)}return o.el.remove(),!0},V=n=>n.querySelector("ion-app")||n.body,Y=async(n,o,e,t)=>{e.classList.remove("overlay-hidden");const i=o(n.el,t);n.animated&&r.getBoolean("animated",!0)||i.duration(0),n.keyboardClose&&i.beforeAddWrite((()=>{const n=e.ownerDocument.activeElement;(null==n?void 0:n.matches("input,ion-input, ion-textarea"))&&n.blur()}));const a=g.get(n)||[];return g.set(n,[...a,i]),await i.play(),!0},_=(n,o)=>{let e;const t=new Promise((n=>e=n));return q(n,o,(n=>{e(n.detail)})),t},q=(n,o,e)=>{const a=t=>{i(n,o,a),e(t)};t(n,o,a)},z=n=>"cancel"===n||n===J,H=n=>n(),W=(n,o)=>{if("function"==typeof n)return r.get("_zoneGate",H)((()=>{try{return n(o)}catch(n){throw n}}))},J="backdrop",K="gesture",Q=39,R=n=>{let o,e=!1;const t=m(),i=(i=!1)=>{if(o&&!i)return{delegate:o,inline:e};const{el:a,hasController:s,delegate:d}=n;return e=null!==a.parentNode&&!s,o=e?d||t:d,{inline:e,delegate:o}};return{attachViewToDom:async o=>{const{delegate:e}=i(!0);if(e)return await e.attachViewToDom(n.el,o);const{hasController:t}=n;if(t&&void 0!==o)throw new Error("framework delegate is missing");return null},removeViewFromDom:()=>{const{delegate:o}=i();o&&void 0!==n.el&&o.removeViewFromDom(n.el.parentElement,n.el)}}},U=()=>{let n;const o=()=>{n&&(n(),n=void 0)};return{addClickListener:(e,t)=>{o();const i=void 0!==t?document.getElementById(t):null;i?n=((n,o)=>{const e=()=>{o.present()};return n.addEventListener("click",e),()=>{n.removeEventListener("click",e)}})(i,e):c(`[${e.tagName.toLowerCase()}] - A trigger element with the ID "${t}" was not found in the DOM. The trigger element must be in the DOM when the "trigger" property is set on an overlay component.`,e)},removeClickListener:o}},X="ion-disable-focus-trap";export{J as B,X as F,K as G,Q as O,x as a,k as b,A as c,R as d,U as e,$ as f,L as g,_ as h,z as i,I as j,B as k,T as l,j as m,f as n,G as o,C as p,h as q,W as s,D as t}
|