@ionic/core 8.7.3-dev.11755696506.17b8097b → 8.7.3-dev.11755697669.1be2024b

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.
Files changed (44) hide show
  1. package/components/overlays.js +9 -6
  2. package/dist/cjs/index.cjs.js +1 -1
  3. package/dist/cjs/ion-action-sheet.cjs.entry.js +1 -1
  4. package/dist/cjs/ion-alert.cjs.entry.js +1 -1
  5. package/dist/cjs/ion-datetime_3.cjs.entry.js +1 -1
  6. package/dist/cjs/ion-loading.cjs.entry.js +1 -1
  7. package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
  8. package/dist/cjs/ion-modal.cjs.entry.js +1 -1
  9. package/dist/cjs/ion-popover.cjs.entry.js +1 -1
  10. package/dist/cjs/ion-select-modal.cjs.entry.js +1 -1
  11. package/dist/cjs/ion-select_3.cjs.entry.js +1 -1
  12. package/dist/cjs/ion-toast.cjs.entry.js +1 -1
  13. package/dist/cjs/{overlays-DFkeeMZX.js → overlays-Ca4z9krz.js} +9 -6
  14. package/dist/collection/utils/overlays.js +9 -6
  15. package/dist/docs.json +1 -1
  16. package/dist/esm/index.js +1 -1
  17. package/dist/esm/ion-action-sheet.entry.js +1 -1
  18. package/dist/esm/ion-alert.entry.js +1 -1
  19. package/dist/esm/ion-datetime_3.entry.js +1 -1
  20. package/dist/esm/ion-loading.entry.js +1 -1
  21. package/dist/esm/ion-menu_3.entry.js +1 -1
  22. package/dist/esm/ion-modal.entry.js +1 -1
  23. package/dist/esm/ion-popover.entry.js +1 -1
  24. package/dist/esm/ion-select-modal.entry.js +1 -1
  25. package/dist/esm/ion-select_3.entry.js +1 -1
  26. package/dist/esm/ion-toast.entry.js +1 -1
  27. package/dist/esm/{overlays-BfCgLYdD.js → overlays-C14Rvrme.js} +9 -6
  28. package/dist/ionic/index.esm.js +1 -1
  29. package/dist/ionic/ionic.esm.js +1 -1
  30. package/dist/ionic/{p-b92a19c8.entry.js → p-05baca9e.entry.js} +1 -1
  31. package/dist/ionic/{p-e61fd4b2.entry.js → p-1be8ffce.entry.js} +1 -1
  32. package/dist/ionic/{p-5c138549.entry.js → p-2e296f4a.entry.js} +1 -1
  33. package/dist/ionic/{p-eb9b64a6.entry.js → p-31393988.entry.js} +1 -1
  34. package/dist/ionic/{p-31f7216f.entry.js → p-3c51f2cd.entry.js} +1 -1
  35. package/dist/ionic/{p-9f8f01e6.entry.js → p-5b64a786.entry.js} +1 -1
  36. package/dist/ionic/{p-ef5372b6.entry.js → p-6d655180.entry.js} +1 -1
  37. package/dist/ionic/p-DMk_cMN9.js +4 -0
  38. package/dist/ionic/{p-4d57f91a.entry.js → p-a67512ba.entry.js} +1 -1
  39. package/dist/ionic/{p-1e6a6fde.entry.js → p-b1c70f1c.entry.js} +1 -1
  40. package/dist/ionic/{p-e206b074.entry.js → p-b6432111.entry.js} +1 -1
  41. package/hydrate/index.js +9 -6
  42. package/hydrate/index.mjs +9 -6
  43. package/package.json +1 -1
  44. package/dist/ionic/p-ly6Zj1CK.js +0 -4
package/hydrate/index.mjs CHANGED
@@ -6173,11 +6173,12 @@ const setRootAriaHidden = (hidden = false) => {
6173
6173
  }
6174
6174
  };
6175
6175
  const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts) => {
6176
- var _a, _b;
6176
+ var _a, _b, _c;
6177
6177
  if (overlay.presented) {
6178
6178
  return;
6179
6179
  }
6180
6180
  console.log("presenting overlay...");
6181
+ (_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.blur();
6181
6182
  /**
6182
6183
  * Due to accessibility guidelines, toasts do not have
6183
6184
  * focus traps.
@@ -6187,12 +6188,13 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
6187
6188
  */
6188
6189
  if (overlay.el.tagName !== 'ION-TOAST') {
6189
6190
  setRootAriaHidden(true);
6191
+ document.body.classList.add(BACKDROP_NO_SCROLL);
6190
6192
  }
6191
6193
  hideUnderlyingOverlaysFromScreenReaders(overlay.el);
6192
6194
  hideAnimatingOverlayFromScreenReaders(overlay.el);
6193
6195
  overlay.presented = true;
6194
6196
  overlay.willPresent.emit();
6195
- (_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
6197
+ (_b = overlay.willPresentShorthand) === null || _b === void 0 ? void 0 : _b.emit();
6196
6198
  const mode = getIonMode$1(overlay);
6197
6199
  // get the user's animation fn if one was provided
6198
6200
  const animationBuilder = overlay.enterAnimation
@@ -6201,7 +6203,7 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
6201
6203
  const completed = await overlayAnimation(overlay, animationBuilder, overlay.el, opts);
6202
6204
  if (completed) {
6203
6205
  overlay.didPresent.emit();
6204
- (_b = overlay.didPresentShorthand) === null || _b === void 0 ? void 0 : _b.emit();
6206
+ (_c = overlay.didPresentShorthand) === null || _c === void 0 ? void 0 : _c.emit();
6205
6207
  }
6206
6208
  /**
6207
6209
  * When an overlay that steals focus
@@ -6288,10 +6290,11 @@ const restoreElementFocus = async (overlayEl) => {
6288
6290
  }
6289
6291
  };
6290
6292
  const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnimation, opts) => {
6291
- var _a, _b;
6293
+ var _a, _b, _c;
6292
6294
  if (!overlay.presented) {
6293
6295
  return false;
6294
6296
  }
6297
+ (_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.blur();
6295
6298
  const presentedOverlays = doc !== undefined ? getPresentedOverlays(doc) : [];
6296
6299
  /**
6297
6300
  * For accessibility, toasts lack focus traps and don't receive
@@ -6325,7 +6328,7 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
6325
6328
  // Overlay contents should not be clickable during dismiss
6326
6329
  overlay.el.style.setProperty('pointer-events', 'none');
6327
6330
  overlay.willDismiss.emit({ data, role });
6328
- (_a = overlay.willDismissShorthand) === null || _a === void 0 ? void 0 : _a.emit({ data, role });
6331
+ (_b = overlay.willDismissShorthand) === null || _b === void 0 ? void 0 : _b.emit({ data, role });
6329
6332
  const mode = getIonMode$1(overlay);
6330
6333
  const animationBuilder = overlay.leaveAnimation
6331
6334
  ? overlay.leaveAnimation
@@ -6335,7 +6338,7 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
6335
6338
  await overlayAnimation(overlay, animationBuilder, overlay.el, opts);
6336
6339
  }
6337
6340
  overlay.didDismiss.emit({ data, role });
6338
- (_b = overlay.didDismissShorthand) === null || _b === void 0 ? void 0 : _b.emit({ data, role });
6341
+ (_c = overlay.didDismissShorthand) === null || _c === void 0 ? void 0 : _c.emit({ data, role });
6339
6342
  // Get a reference to all animations currently assigned to this overlay
6340
6343
  // Then tear them down to return the overlay to its initial visual state
6341
6344
  const animations = activeAnimations.get(overlay) || [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionic/core",
3
- "version": "8.7.3-dev.11755696506.17b8097b",
3
+ "version": "8.7.3-dev.11755697669.1be2024b",
4
4
  "description": "Base components for Ionic",
5
5
  "keywords": [
6
6
  "ionic",
@@ -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 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}