@ionic/core 9.0.13 → 9.0.14-dev.11795647570.11455540
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-datetime.js +1 -1
- package/components/ion-popover.js +1 -1
- package/components/ion-select.js +1 -1
- package/components/p-vU3qJ6VA.js +4 -0
- package/dist/cjs/ion-popover.cjs.entry.js +41 -67
- package/dist/collection/components/popover/popover.js +3 -3
- package/dist/collection/components/popover/utils.js +39 -65
- package/dist/docs.json +2 -2
- package/dist/esm/ion-popover.entry.js +41 -67
- package/dist/html.html-data.json +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-2af6e96d.entry.js +4 -0
- package/dist/types/components/popover/popover.d.ts +1 -0
- package/dist/types/components.d.ts +2 -2
- package/hydrate/index.js +41 -67
- package/hydrate/index.mjs +41 -67
- package/package.json +1 -1
- package/components/p-CFdW9ebZ.js +0 -4
- package/dist/ionic/p-a03667a4.entry.js +0 -4
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import{d as t,H as e,i as o,p as r,h as i,f as s,t as n}from"./p-CyKwPay6.js";import{B as a,h as p,r as c,j as d,k as h,e as l,n as v,f,g,F as m}from"./p-C46T-8zV.js";import{C as b,a as x,d as u}from"./p-BbMAsoPz.js";import{g as w,r as k,a as y,l as P}from"./p-vBBGetx6.js";import{c as D}from"./p-B-hirT0v.js";import{O as T}from"./p-CB9IiUSo.js";import{b as A,a as $}from"./p-DFlkSd5_.js";import{i as C}from"./p-Dj4J3LkD.js";import{g as I}from"./p-byZM6qHV.js";import{e as L,w as W}from"./p-BgjAK-TD.js";import{c as O}from"./p-B2T8YxDT.js";import{d as N}from"./p-B2mPmeop.js";let j=null,z=!1;const B=t=>{if(null!==j)return j;if(null===t.body)return{top:0,bottom:0,left:0,right:0};const e=t.createElement("div");e.style.cssText="position:fixed;visibility:hidden;pointer-events:none;top:0;left:0;padding-top:var(--ion-safe-area-top,0px);padding-bottom:var(--ion-safe-area-bottom,0px);padding-left:var(--ion-safe-area-left,0px);padding-right:var(--ion-safe-area-right,0px);",t.body.appendChild(e);const o=getComputedStyle(e),r={top:parseFloat(o.paddingTop)||0,bottom:parseFloat(o.paddingBottom)||0,left:parseFloat(o.paddingLeft)||0,right:parseFloat(o.paddingRight)||0};return e.remove(),j=r,z||(z=!0,k((()=>{j=null,z=!1}))),r},S=t=>{if(!t)return 1;const e=t.currentCSSZoom;if("number"==typeof e&&e>0)return e;const{width:o}=t.getBoundingClientRect(),{offsetWidth:r}=t;if(r>0&&o>0){const t=o/r;return Math.abs(t-1)<.01?1:t}return 1},E=(t,e,o,r=1)=>{const i=e.getBoundingClientRect(),s=i.height/r;let n=i.width/r;return"cover"===t&&o&&(n=o.getBoundingClientRect().width/r),{contentWidth:n,contentHeight:s}},Y=(t,e)=>e&&"ION-ITEM"===e.tagName?t.findIndex((t=>t===e)):-1,M=t=>{const e=w(t).querySelector("button");e&&k((()=>e.focus()))},X=(t,e,o,r,i,s,n,a,p,c,d,h=1)=>{let l={top:0,left:0,width:0,height:0};if("event"===s){if(!d)return p;l={top:d.clientY/h,left:d.clientX/h,width:1,height:1}}else{const t=d,e=c||t?.detail?.ionShadowTarget||t?.target;if(!e)return p;const o=e.getBoundingClientRect();l={top:o.top/h,left:o.left/h,width:o.width/h,height:o.height/h}}const v=K(n,l,e,o,r,i,t),f=U(a,n,l,e,o,t),g=v.top+f.top,m=v.left+f.left,{arrowTop:b,arrowLeft:x}=V(n,r,i,g,m,e,o,t),{originX:u,originY:w}=H(n,a,t);return{top:g,left:m,referenceCoordinates:l,arrowTop:b,arrowLeft:x,originX:u,originY:w}},H=(t,e,o)=>{switch(t){case"top":return{originX:F(e,o),originY:"bottom"};case"bottom":return{originX:F(e,o),originY:"top"};case"left":return{originX:"right",originY:R(e)};case"right":return{originX:"left",originY:R(e)};case"start":return{originX:o?"left":"right",originY:R(e)};case"end":return{originX:o?"right":"left",originY:R(e)}}},F=(t,e)=>{switch(t){case"start":return e?"right":"left";case"center":return"center";case"end":return e?"left":"right"}},R=t=>{switch(t){case"start":return"top";case"center":return"center";case"end":return"bottom"}},V=(t,e,o,r,i,s,n,a)=>{const p={arrowTop:r+n/2-e/2,arrowLeft:i+s-e/2},c={arrowTop:r+n/2-e/2,arrowLeft:i-1.5*e};switch(t){case"top":return{arrowTop:r+n,arrowLeft:i+s/2-e/2};case"bottom":return{arrowTop:r-o,arrowLeft:i+s/2-e/2};case"left":return p;case"right":return c;case"start":return a?c:p;case"end":return a?p:c;default:return{arrowTop:0,arrowLeft:0}}},K=(t,e,o,r,i,s,n)=>{const a={top:e.top,left:e.left-o-i},p={top:e.top,left:e.left+e.width+i};switch(t){case"top":return{top:e.top-r-s,left:e.left};case"right":return p;case"bottom":return{top:e.top+e.height+s,left:e.left};case"left":return a;case"start":return n?p:a;case"end":return n?a:p}},U=(t,e,o,r,i,s)=>{switch(e){case"start":case"end":case"left":case"right":switch(t){case"end":return{top:-(i-o.height),left:0};case"center":return{top:-(i/2-o.height/2),left:0};default:return{top:0,left:0}}default:switch(t){case"end":return{top:0,left:s?0:-(r-o.width)};case"center":return{top:0,left:-(r/2-o.width/2)};default:return{top:0,left:s?-(r-o.width):0}}}},q=(t,e,o,r,i,s,n,a,p,c,d,h,l=0,v=0,f=0)=>{let g,m=l,b=o,x=e,u=c,w=d,k=!1,y=!1,P=!1,D=!1;const T=h?h.top+h.height:s/2-a/2,A=h?h.height:0;let $=!1;if(b<r+p.left?(b=r,k=!0,u="left"):n+r+b+p.right>i&&(y=!0,b=i-n-r,u="right"),T+A+a>s-p.bottom&&("top"===t||"bottom"===t)){const t=T-a-A-(f-1);t>=p.top+r?(x=t,m=x+a,w="bottom",$=!0):(g=r,D=!0,x>=s-p.bottom-r&&(x=p.top+r,P=!0))}return{top:x,left:b,bottom:g,originX:u,originY:w,checkSafeAreaLeft:k,checkSafeAreaRight:y,checkSafeAreaTop:P,checkSafeAreaBottom:D,arrowTop:m,arrowLeft:v,addPopoverBottomClass:$,hideArrow:!1}},G=(t,e)=>{const{event:o,size:r,trigger:i,reference:s,side:n,align:a}=e,p=t.ownerDocument,c=C(t),d=w(t),h=d.querySelector(".popover-content"),l=d.querySelector(".popover-arrow"),v=S(h),f=p.defaultView.innerWidth/v,g=p.defaultView.innerHeight/v,m=i||o?.detail?.ionShadowTarget||o?.target,{contentWidth:b,contentHeight:x}=E(r,h,m,v),{arrowWidth:u,arrowHeight:k}=((t,e=1)=>{if(!t)return{arrowWidth:0,arrowHeight:0};const{width:o,height:r}=t.getBoundingClientRect();return{arrowWidth:o/e,arrowHeight:r/e}})(l,v),y=X(c,b,x,u,k,s,n,a,{top:g/2-x/2,left:f/2-b/2,originX:c?"right":"left",originY:"top"},i,o,v),P="cover"===r?0:5,D=B(p),T="cover"===r?{top:0,bottom:0,left:0,right:0}:{top:Math.max(D.top,25),bottom:Math.max(D.bottom,25),left:Math.max(D.left,25),right:Math.max(D.right,25)},{originX:A,originY:$,top:I,left:L,bottom:W,checkSafeAreaLeft:N,checkSafeAreaRight:j,checkSafeAreaTop:z,checkSafeAreaBottom:Y,arrowTop:M,arrowLeft:H,addPopoverBottomClass:F}=q(n,y.top,y.left,P,f,g,b,x,T,y.originX,y.originY,y.referenceCoordinates,y.arrowTop,y.arrowLeft,k),R=O(),V=O(),K=O();return V.addElement(d.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),K.addElement(d.querySelector(".popover-arrow")).addElement(d.querySelector(".popover-content")).fromTo("opacity",.01,1),R.easing("ease").duration(100).beforeAddWrite((()=>{if("cover"===r&&t.style.setProperty("--width",`${b}px`),F&&t.classList.add("popover-bottom"),void 0!==W){let t=`${W}px`;Y&&(t=`${W}px + var(--ion-safe-area-bottom, 0px)`),h.style.setProperty("bottom",`calc(${t})`)}let e=`${L}px`;N&&(e=`${L}px + var(--ion-safe-area-left, 0px)`),j&&(e=`${L}px - var(--ion-safe-area-right, 0px)`);let s=`${I}px`;if(z&&(s=`${I}px + var(--ion-safe-area-top, 0px)`),h.style.setProperty("top",`calc(${s} + var(--offset-y, 0))`),h.style.setProperty("left",`calc(${e} + var(--offset-x, 0))`),h.style.setProperty("transform-origin",`${$} ${A}`),null!==l){const t=((t,e=!1,o,r)=>!(!o&&!r||"top"!==t&&"bottom"!==t&&e))(n,y.top!==I||y.left!==L,o,i);t?(l.style.setProperty("top",`calc(${M}px + var(--offset-y, 0))`),l.style.setProperty("left",`calc(${H}px + var(--offset-x, 0))`)):l.style.setProperty("display","none")}})).addAnimation([V,K])},J=t=>{const e=w(t),o=e.querySelector(".popover-content"),r=e.querySelector(".popover-arrow"),i=O(),s=O(),n=O();return s.addElement(e.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),n.addElement(e.querySelector(".popover-arrow")).addElement(e.querySelector(".popover-content")).fromTo("opacity",.99,0),i.easing("ease").afterAddWrite((()=>{t.style.removeProperty("--width"),t.classList.remove("popover-bottom"),o.style.removeProperty("top"),o.style.removeProperty("left"),o.style.removeProperty("bottom"),o.style.removeProperty("transform-origin"),r&&(r.style.removeProperty("top"),r.style.removeProperty("left"),r.style.removeProperty("display"))})).duration(300).addAnimation([s,n])},Z=(t,e)=>{const{event:o,size:r,trigger:i,reference:s,side:n,align:a}=e,p=t.ownerDocument,c=C(t),d=w(t),h=d.querySelector(".popover-content"),l=S(h),v=p.defaultView.innerWidth/l,f=p.defaultView.innerHeight/l,g=i||o?.detail?.ionShadowTarget||o?.target,{contentWidth:m,contentHeight:b}=E(r,h,g,l),x=X(c,m,b,0,0,s,n,a,{top:f/2-b/2,left:v/2-m/2,originX:c?"right":"left",originY:"top"},i,o,l),u="cover"===r?0:12,k="cover"===r?{top:0,bottom:0,left:0,right:0}:B(p),{originX:y,originY:P,top:D,left:T,bottom:A,checkSafeAreaLeft:$,checkSafeAreaRight:I,checkSafeAreaTop:L,checkSafeAreaBottom:W,addPopoverBottomClass:N}=q(n,x.top,x.left,u,v,f,m,b,k,x.originX,x.originY,x.referenceCoordinates);let j=`${T}px`;$&&(j=`${T}px + var(--ion-safe-area-left, 0px)`),I&&(j=`${T}px - var(--ion-safe-area-right, 0px)`);let z=`${D}px`;L&&(z=`${D}px + var(--ion-safe-area-top, 0px)`);const Y=O(),M=O(),H=O(),F=O(),R=O();return M.addElement(d.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),H.addElement(d.querySelector(".popover-wrapper")).duration(150).fromTo("opacity",.01,1),F.addElement(h).beforeStyles({top:`calc(${z} + var(--offset-y, 0px))`,left:`calc(${j} + var(--offset-x, 0px))`,"transform-origin":`${P} ${y}`}).beforeAddWrite((()=>{if(void 0!==A){let t=`${A}px`;W&&(t=`${A}px + var(--ion-safe-area-bottom, 0px)`),h.style.setProperty("bottom",`calc(${t})`)}})).fromTo("transform","scale(0.8)","scale(1)"),R.addElement(d.querySelector(".popover-viewport")).fromTo("opacity",.01,1),Y.easing("cubic-bezier(0.36,0.66,0.04,1)").duration(300).beforeAddWrite((()=>{"cover"===r&&t.style.setProperty("--width",`${m}px`),N&&t.classList.add("popover-bottom")})).addAnimation([M,H,F,R])},_=t=>{const e=w(t),o=e.querySelector(".popover-content"),r=O(),i=O(),s=O();return i.addElement(e.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),s.addElement(e.querySelector(".popover-wrapper")).fromTo("opacity",.99,0),r.easing("ease").afterAddWrite((()=>{t.style.removeProperty("--width"),t.classList.remove("popover-bottom"),o.style.removeProperty("top"),o.style.removeProperty("left"),o.style.removeProperty("bottom"),o.style.removeProperty("transform-origin")})).duration(150).addAnimation([i,s])},Q=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.didPresent=o(this,"ionPopoverDidPresent",7),this.willPresent=o(this,"ionPopoverWillPresent",7),this.willDismiss=o(this,"ionPopoverWillDismiss",7),this.didDismiss=o(this,"ionPopoverDidDismiss",7),this.didPresentShorthand=o(this,"didPresent",7),this.willPresentShorthand=o(this,"willPresent",7),this.willDismissShorthand=o(this,"willDismiss",7),this.didDismissShorthand=o(this,"didDismiss",7),this.ionMount=o(this,"ionMount",7),this.parentPopover=null,this.coreDelegate=b(),this.lockController=D(),this.inline=!1,this.focusDescendantOnPresent=!1,this.dirSetOnPresent=!1,this.presented=!1,this.hasController=!1,this.keyboardClose=!0,this.backdropDismiss=!0,this.showBackdrop=!0,this.translucent=!1,this.animated=!0,this.triggerAction="click",this.size="auto",this.dismissOnSelect=!1,this.reference="trigger",this.side="bottom",this.arrow=!0,this.isOpen=!1,this.keyboardEvents=!1,this.focusTrap=!0,this.keepContentsMounted=!1,this.onBackdropTap=()=>{this.dismiss(void 0,a)},this.onLifecycle=t=>{const e=this.usersElement,o=tt[t.type];if(e&&o){const r=new CustomEvent(o,{bubbles:!1,cancelable:!1,detail:t.detail});e.dispatchEvent(r)}},this.configureTriggerInteraction=()=>{const{trigger:t,triggerAction:e,el:o,destroyTriggerInteraction:i}=this;if(i&&i(),void 0===t)return;const s=this.triggerEl=void 0!==t?document.getElementById(t):null;s?this.destroyTriggerInteraction=((t,e,o)=>{let r=[];switch(e){case"hover":let t;r=[{eventName:"mouseenter",callback:async e=>{e.stopPropagation(),t&&clearTimeout(t),t=setTimeout((()=>{k((()=>{o.presentFromTrigger(e),t=void 0}))}),100)}},{eventName:"mouseleave",callback:e=>{t&&clearTimeout(t);const r=e.relatedTarget;r&&r.closest("ion-popover")!==o&&o.dismiss(void 0,void 0,!1)}},{eventName:"click",callback:t=>t.stopPropagation()},{eventName:"ionPopoverActivateTrigger",callback:t=>o.presentFromTrigger(t,!0)}];break;case"context-menu":r=[{eventName:"contextmenu",callback:t=>{t.preventDefault(),o.presentFromTrigger(t)}},{eventName:"click",callback:t=>t.stopPropagation()},{eventName:"ionPopoverActivateTrigger",callback:t=>o.presentFromTrigger(t,!0)}];break;default:r=[{eventName:"click",callback:t=>o.presentFromTrigger(t)},{eventName:"ionPopoverActivateTrigger",callback:t=>o.presentFromTrigger(t,!0)}]}return r.forEach((({eventName:e,callback:o})=>t.addEventListener(e,o))),t.setAttribute("data-ion-popover-trigger","true"),()=>{r.forEach((({eventName:e,callback:o})=>t.removeEventListener(e,o))),t.removeAttribute("data-ion-popover-trigger")}})(s,e,o):r(`[ion-popover] - 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 ion-popover.`,this.el)},this.configureKeyboardInteraction=()=>{const{destroyKeyboardInteraction:t,el:e}=this;t&&t(),this.destroyKeyboardInteraction=(t=>{const e=async e=>{const o=document.activeElement;let r=[];const i=e.target?.tagName;if("ION-POPOVER"===i||"ION-ITEM"===i){try{r=Array.from(t.querySelectorAll("ion-item:not(ion-popover ion-popover *):not([disabled])"))}catch{}switch(e.key){case"ArrowLeft":await t.getParentPopover()&&t.dismiss(void 0,void 0,!1);break;case"ArrowDown":e.preventDefault();const i=((t,e)=>t[Y(t,e)+1])(r,o);void 0!==i&&M(i);break;case"ArrowUp":e.preventDefault();const s=((t,e)=>t[Y(t,e)-1])(r,o);void 0!==s&&M(s);break;case"Home":e.preventDefault();const n=r[0];void 0!==n&&M(n);break;case"End":e.preventDefault();const a=r[r.length-1];void 0!==a&&M(a);break;case"ArrowRight":case" ":case"Enter":if(o&&o.hasAttribute("data-ion-popover-trigger")){const t=new CustomEvent("ionPopoverActivateTrigger");o.dispatchEvent(t)}}}};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)})(e)},this.configureDismissInteraction=()=>{const{destroyDismissInteraction:t,parentPopover:e,triggerAction:o,triggerEl:r,el:i}=this;e&&r&&(t&&t(),this.destroyDismissInteraction=((t,e,o,r)=>{let i=[];const s=w(r).querySelector(".popover-content");return i="hover"===e?[{eventName:"mouseenter",callback:e=>{document.elementFromPoint(e.clientX,e.clientY)!==t&&o.dismiss(void 0,void 0,!1)}}]:[{eventName:"click",callback:e=>{e.target.closest("[data-ion-popover-trigger]")!==t?o.dismiss(void 0,void 0,!1):e.stopPropagation()}}],i.forEach((({eventName:t,callback:e})=>s.addEventListener(t,e))),()=>{i.forEach((({eventName:t,callback:e})=>s.removeEventListener(t,e)))}})(r,o,i,e))}}onTriggerChange(){this.configureTriggerInteraction()}onIsOpenChange(t,e){!0===t&&!1===e?this.present():!1===t&&!0===e&&this.dismiss()}connectedCallback(){const{configureTriggerInteraction:t,el:e}=this;p(e),t(),this.presented&&(c(e),this.recalculateContentOnHeaderReady())}disconnectedCallback(){const{destroyTriggerInteraction:t}=this;t&&t(),this.headerResizeObserver&&(this.headerResizeObserver.disconnect(),this.headerResizeObserver=void 0),this.presented&&d()}componentWillLoad(){const{el:t}=this,e=this.htmlAttributes?.id??h(t);this.parentPopover=t.closest(`ion-popover:not(#${e})`),void 0===this.alignment&&(this.alignment="ios"===A(this)?"center":"start")}componentDidLoad(){const{parentPopover:t,isOpen:e}=this;!0===e&&k((()=>this.present())),t&&y(t,"ionPopoverWillDismiss",(()=>{this.dismiss(void 0,void 0,!1)})),this.configureTriggerInteraction()}async presentFromTrigger(t,e=!1){this.focusDescendantOnPresent=e,await this.present(t),this.focusDescendantOnPresent=!1}getDelegate(t=!1){if(this.workingDelegate&&!t)return{delegate:this.workingDelegate,inline:this.inline};const e=this.inline=null!==this.el.parentNode&&!this.hasController;return{inline:e,delegate:this.workingDelegate=e?this.delegate||this.coreDelegate:this.delegate}}async present(t){const e=await this.lockController.lock();if(this.presented)return void e();const{el:o}=this,{inline:r,delegate:i}=this.getDelegate(!0);o.hasAttribute("dir")||(o.setAttribute("dir",C(o)?"rtl":"ltr"),this.dirSetOnPresent=!0),this.ionMount.emit(),this.usersElement=await x(i,o,this.component,["popover-viewport"],this.componentProps,r),this.recalculateContentOnHeaderReady(),this.keyboardEvents||this.configureKeyboardInteraction(),this.configureDismissInteraction(),P(o)?await L(this.usersElement):this.keepContentsMounted||await W(),await l(this,"popoverEnter",G,Z,{event:t||this.event,size:this.size,trigger:this.triggerEl,reference:this.reference,side:this.side,align:this.alignment}),this.focusDescendantOnPresent&&v(o),e()}recalculateContentOnHeaderReady(){const t=this.el.shadowRoot?.querySelector(".popover-content");if(!t)return;const e=this.usersElement||t,o=e.querySelector("ion-header"),r=e.querySelectorAll("ion-content");o&&0!==r.length&&(this.headerResizeObserver&&(this.headerResizeObserver.disconnect(),this.headerResizeObserver=void 0),this.headerResizeObserver=new ResizeObserver((async()=>{if(o.offsetHeight>0){this.headerResizeObserver?.disconnect(),this.headerResizeObserver=void 0;for(const t of r)await t.recalculateDimensions()}})),this.headerResizeObserver.observe(o))}async dismiss(t,e,o=!0){const r=await this.lockController.lock(),{destroyKeyboardInteraction:i,destroyDismissInteraction:s}=this;o&&this.parentPopover&&this.parentPopover.dismiss(t,e,o);const n=await f(this,t,e,"popoverLeave",J,_,this.event);if(n){i&&(i(),this.destroyKeyboardInteraction=void 0),s&&(s(),this.destroyDismissInteraction=void 0);const{delegate:t}=this.getDelegate();await u(t,this.usersElement),this.dirSetOnPresent&&(this.el.removeAttribute("dir"),this.dirSetOnPresent=!1)}return r(),n}async getParentPopover(){return this.parentPopover}onDidDismiss(){return g(this.el,"ionPopoverDidDismiss")}onWillDismiss(){return g(this.el,"ionPopoverWillDismiss")}render(){const t=A(this),{onLifecycle:e,parentPopover:o,dismissOnSelect:r,side:n,arrow:a,htmlAttributes:p,focusTrap:c}=this,d=$("desktop"),h=a&&!o;return i(s,{key:"799f0b8c23298152f4d1acce57af3b0b841088cc","aria-modal":"true","no-router":!0,tabindex:"-1",...p,style:{zIndex:`${2e4+this.overlayIndex}`},class:{...I(this.cssClass),[t]:!0,"popover-translucent":this.translucent,"overlay-hidden":!0,"popover-desktop":d,[`popover-side-${n}`]:!0,[m]:!1===c,"popover-nested":!!o},onIonPopoverDidPresent:e,onIonPopoverWillPresent:e,onIonPopoverWillDismiss:e,onIonPopoverDidDismiss:e,onIonBackdropTap:this.onBackdropTap},!o&&i("ion-backdrop",{key:"bb018f8e093cab6b565455619f6c17f384184f7f",tappable:this.backdropDismiss,visible:this.showBackdrop,part:"backdrop"}),i(T,{key:"1f71ca9bc25e76863ab5f504ce37464eaf6c48d8",overlay:this.el,edge:"start"}),i("div",{key:"650eddc581be1dadab01a9690d7d4c0bf36bcf91",class:"popover-wrapper ion-overlay-wrapper",onClick:r?()=>this.dismiss():void 0},h&&i("div",{key:"95f2639dae6ac16a3ba01e1ce8eb18869024694c",class:"popover-arrow",part:"arrow"}),i("div",{key:"1f4ce7f6b56b4b8d51c8f1c9e502c78c3430b0a2",class:"popover-content",part:"content"},i("slot",{key:"a936b487579eed45153dab5db3dd92d4a48f6101"}))),i(T,{key:"b583cf2f37c370ab9753df7639c5cc0fc2b16f44",overlay:this.el,edge:"end"}))}get el(){return this}static get watchers(){return{trigger:[{onTriggerChange:0}],triggerAction:[{onTriggerChange:0}],isOpen:[{onIsOpenChange:0}]}}static get style(){return{ios:':host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;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;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}:host(.ion-disable-focus-trap) .ion-overlay-focus-boundary{display:none}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;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);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}::slotted(.popover-viewport){--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}@supports not selector(:dir(rtl)){:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start:dir(rtl)){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}@supports not selector(:dir(rtl)){:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end:dir(rtl)){--offset-x:5px}}:host(.select-popover-rich-content){--width:clamp(250px, calc(100vw - 40px), 400px)}:host{--width:200px;--max-height:90%;--box-shadow:none;--backdrop-opacity:var(--ion-backdrop-opacity, 0.08)}:host(.popover-desktop){--box-shadow:0px 4px 16px 0px rgba(0, 0, 0, 0.12)}.popover-content{border-radius:10px}:host(.popover-desktop) .popover-content{border:0.5px solid var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6))}.popover-arrow{display:block;position:absolute;width:20px;height:10px;overflow:hidden;z-index:11}.popover-arrow::after{top:3px;border-radius:3px;position:absolute;width:14px;height:14px;-webkit-transform:rotate(45deg);transform:rotate(45deg);background:var(--background);content:"";z-index:10}.popover-arrow::after{inset-inline-start:3px}:host(.popover-bottom) .popover-arrow{top:auto;bottom:-10px}:host(.popover-bottom) .popover-arrow::after{top:-6px}:host(.popover-side-left) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}:host(.popover-side-right) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host(.popover-side-top) .popover-arrow{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host(.popover-side-start) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}@supports not selector(:dir(rtl)){:host-context([dir=rtl]):host(.popover-side-start) .popover-arrow,:host-context([dir=rtl]).popover-side-start .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}}@supports selector(:dir(rtl)){:host(.popover-side-start:dir(rtl)) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}}:host(.popover-side-end) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@supports not selector(:dir(rtl)){:host-context([dir=rtl]):host(.popover-side-end) .popover-arrow,:host-context([dir=rtl]).popover-side-end .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}}@supports selector(:dir(rtl)){:host(.popover-side-end:dir(rtl)) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}}.popover-arrow,.popover-content{opacity:0}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.popover-translucent) .popover-content,:host(.popover-translucent) .popover-arrow::after{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)}}',md:":host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;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;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}:host(.ion-disable-focus-trap) .ion-overlay-focus-boundary{display:none}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;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);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}::slotted(.popover-viewport){--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}@supports not selector(:dir(rtl)){:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start:dir(rtl)){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}@supports not selector(:dir(rtl)){:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end:dir(rtl)){--offset-x:5px}}:host(.select-popover-rich-content){--width:clamp(250px, calc(100vw - 40px), 400px)}:host{--width:250px;--max-height:90%;--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}.popover-content{border-radius:4px;-webkit-transform-origin:left top;transform-origin:left top}@supports not selector(:dir(rtl)){:host-context([dir=rtl]) .popover-content{-webkit-transform-origin:right top;transform-origin:right top}}[dir=rtl] .popover-content{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){.popover-content:dir(rtl){-webkit-transform-origin:right top;transform-origin:right top}}.popover-viewport{-webkit-transition-delay:100ms;transition-delay:100ms}.popover-wrapper{opacity:0}"}}},[289,"ion-popover",{hasController:[4,"has-controller"],delegate:[16],overlayIndex:[2,"overlay-index"],enterAnimation:[16],leaveAnimation:[16],component:[1],componentProps:[16],keyboardClose:[4,"keyboard-close"],cssClass:[1,"css-class"],backdropDismiss:[4,"backdrop-dismiss"],event:[8],showBackdrop:[4,"show-backdrop"],translucent:[4],animated:[4],htmlAttributes:[16],triggerAction:[1,"trigger-action"],trigger:[1],size:[1],dismissOnSelect:[4,"dismiss-on-select"],reference:[1],side:[1],alignment:[1025],arrow:[4],isOpen:[4,"is-open"],keyboardEvents:[4,"keyboard-events"],focusTrap:[4,"focus-trap"],keepContentsMounted:[4,"keep-contents-mounted"],presented:[32],presentFromTrigger:[64],present:[64],dismiss:[64],getParentPopover:[64],onDidDismiss:[64],onWillDismiss:[64]},void 0,{trigger:[{onTriggerChange:0}],triggerAction:[{onTriggerChange:0}],isOpen:[{onIsOpenChange:0}]}]),tt={ionPopoverDidPresent:"ionViewDidEnter",ionPopoverWillPresent:"ionViewWillEnter",ionPopoverWillDismiss:"ionViewWillLeave",ionPopoverDidDismiss:"ionViewDidLeave"};function et(){"undefined"!=typeof customElements&&["ion-popover","ion-backdrop"].forEach((t=>{switch(t){case"ion-popover":customElements.get(n(t))||customElements.define(n(t),Q);break;case"ion-backdrop":customElements.get(n(t))||N()}}))}export{Q as P,et as d}
|
|
@@ -552,7 +552,7 @@ const getPopoverPosition = (isRTL, contentWidth, contentHeight, arrowWidth, arro
|
|
|
552
552
|
* would allow the popover content
|
|
553
553
|
* to have the correct alignment.
|
|
554
554
|
*/
|
|
555
|
-
const alignedCoordinates =
|
|
555
|
+
const alignedCoordinates = calculatePopoverAlignedCoordinates(align, side, referenceCoordinates, contentWidth, contentHeight, isRTL);
|
|
556
556
|
const top = coordinates.top + alignedCoordinates.top;
|
|
557
557
|
const left = coordinates.left + alignedCoordinates.left;
|
|
558
558
|
const { arrowTop, arrowLeft } = calculateArrowPosition(side, arrowWidth, arrowHeight, top, left, contentWidth, contentHeight, isRTL);
|
|
@@ -569,9 +569,9 @@ const getPopoverPosition = (isRTL, contentWidth, contentHeight, arrowWidth, arro
|
|
|
569
569
|
const calculatePopoverOrigin = (side, align, isRTL) => {
|
|
570
570
|
switch (side) {
|
|
571
571
|
case 'top':
|
|
572
|
-
return { originX: getOriginXAlignment(align), originY: 'bottom' };
|
|
572
|
+
return { originX: getOriginXAlignment(align, isRTL), originY: 'bottom' };
|
|
573
573
|
case 'bottom':
|
|
574
|
-
return { originX: getOriginXAlignment(align), originY: 'top' };
|
|
574
|
+
return { originX: getOriginXAlignment(align, isRTL), originY: 'top' };
|
|
575
575
|
case 'left':
|
|
576
576
|
return { originX: 'right', originY: getOriginYAlignment(align) };
|
|
577
577
|
case 'right':
|
|
@@ -582,14 +582,14 @@ const calculatePopoverOrigin = (side, align, isRTL) => {
|
|
|
582
582
|
return { originX: isRTL ? 'right' : 'left', originY: getOriginYAlignment(align) };
|
|
583
583
|
}
|
|
584
584
|
};
|
|
585
|
-
const getOriginXAlignment = (align) => {
|
|
585
|
+
const getOriginXAlignment = (align, isRTL) => {
|
|
586
586
|
switch (align) {
|
|
587
587
|
case 'start':
|
|
588
|
-
return 'left';
|
|
588
|
+
return isRTL ? 'right' : 'left';
|
|
589
589
|
case 'center':
|
|
590
590
|
return 'center';
|
|
591
591
|
case 'end':
|
|
592
|
-
return 'right';
|
|
592
|
+
return isRTL ? 'left' : 'right';
|
|
593
593
|
}
|
|
594
594
|
};
|
|
595
595
|
const getOriginYAlignment = (align) => {
|
|
@@ -681,71 +681,45 @@ const calculatePopoverSide = (side, triggerBoundingBox, contentWidth, contentHei
|
|
|
681
681
|
* correct alignment regardless while taking
|
|
682
682
|
* into account the side the popover is on.
|
|
683
683
|
*/
|
|
684
|
-
const
|
|
685
|
-
switch (align) {
|
|
686
|
-
case 'center':
|
|
687
|
-
return calculatePopoverCenterAlign(side, triggerBoundingBox, contentWidth, contentHeight);
|
|
688
|
-
case 'end':
|
|
689
|
-
return calculatePopoverEndAlign(side, triggerBoundingBox, contentWidth, contentHeight);
|
|
690
|
-
case 'start':
|
|
691
|
-
default:
|
|
692
|
-
return { top: 0, left: 0 };
|
|
693
|
-
}
|
|
694
|
-
};
|
|
695
|
-
/**
|
|
696
|
-
* Calculate the end alignment for
|
|
697
|
-
* the popover. If side is on the x-axis
|
|
698
|
-
* then the align values refer to the top
|
|
699
|
-
* and bottom margins of the content.
|
|
700
|
-
* If side is on the y-axis then the
|
|
701
|
-
* align values refer to the left and right
|
|
702
|
-
* margins of the content.
|
|
703
|
-
*/
|
|
704
|
-
const calculatePopoverEndAlign = (side, triggerBoundingBox, contentWidth, contentHeight) => {
|
|
684
|
+
const calculatePopoverAlignedCoordinates = (align, side, triggerBoundingBox, contentWidth, contentHeight, isRTL) => {
|
|
705
685
|
switch (side) {
|
|
706
686
|
case 'start':
|
|
707
687
|
case 'end':
|
|
708
688
|
case 'left':
|
|
709
|
-
case 'right':
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
};
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
* the popover. If side is on the x-axis
|
|
726
|
-
* then the align values refer to the top
|
|
727
|
-
* and bottom margins of the content.
|
|
728
|
-
* If side is on the y-axis then the
|
|
729
|
-
* align values refer to the left and right
|
|
730
|
-
* margins of the content.
|
|
731
|
-
*/
|
|
732
|
-
const calculatePopoverCenterAlign = (side, triggerBoundingBox, contentWidth, contentHeight) => {
|
|
733
|
-
switch (side) {
|
|
734
|
-
case 'start':
|
|
735
|
-
case 'end':
|
|
736
|
-
case 'left':
|
|
737
|
-
case 'right':
|
|
738
|
-
return {
|
|
739
|
-
top: -(contentHeight / 2 - triggerBoundingBox.height / 2),
|
|
740
|
-
left: 0,
|
|
741
|
-
};
|
|
689
|
+
case 'right': {
|
|
690
|
+
/**
|
|
691
|
+
* If side is on the x-axis
|
|
692
|
+
* then the align values refer to the top
|
|
693
|
+
* and bottom margins of the content.
|
|
694
|
+
*/
|
|
695
|
+
switch (align) {
|
|
696
|
+
case 'end':
|
|
697
|
+
return { top: -(contentHeight - triggerBoundingBox.height), left: 0 };
|
|
698
|
+
case 'center':
|
|
699
|
+
return { top: -(contentHeight / 2 - triggerBoundingBox.height / 2), left: 0 };
|
|
700
|
+
case 'start':
|
|
701
|
+
default:
|
|
702
|
+
return { top: 0, left: 0 };
|
|
703
|
+
}
|
|
704
|
+
}
|
|
742
705
|
case 'top':
|
|
743
706
|
case 'bottom':
|
|
744
|
-
default:
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
707
|
+
default: {
|
|
708
|
+
/**
|
|
709
|
+
* If side is on the y-axis then the
|
|
710
|
+
* align values refer to the left and right
|
|
711
|
+
* margins of the content.
|
|
712
|
+
*/
|
|
713
|
+
switch (align) {
|
|
714
|
+
case 'end':
|
|
715
|
+
return { top: 0, left: isRTL ? 0 : -(contentWidth - triggerBoundingBox.width) };
|
|
716
|
+
case 'center':
|
|
717
|
+
return { top: 0, left: -(contentWidth / 2 - triggerBoundingBox.width / 2) };
|
|
718
|
+
case 'start':
|
|
719
|
+
default:
|
|
720
|
+
return { top: 0, left: isRTL ? -(contentWidth - triggerBoundingBox.width) : 0 };
|
|
721
|
+
}
|
|
722
|
+
}
|
|
749
723
|
}
|
|
750
724
|
};
|
|
751
725
|
/**
|
|
@@ -1648,7 +1622,7 @@ const Popover = class {
|
|
|
1648
1622
|
const { onLifecycle, parentPopover, dismissOnSelect, side, arrow, htmlAttributes, focusTrap } = this;
|
|
1649
1623
|
const desktop = ionicGlobal.isPlatform('desktop');
|
|
1650
1624
|
const enableArrow = arrow && !parentPopover;
|
|
1651
|
-
return (index.h(index.Host, { key: '
|
|
1625
|
+
return (index.h(index.Host, { key: '799f0b8c23298152f4d1acce57af3b0b841088cc', "aria-modal": "true", "no-router": true, tabindex: "-1", ...htmlAttributes, style: {
|
|
1652
1626
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
1653
1627
|
}, class: {
|
|
1654
1628
|
...theme.getClassMap(this.cssClass),
|
|
@@ -1659,7 +1633,7 @@ const Popover = class {
|
|
|
1659
1633
|
[`popover-side-${side}`]: true,
|
|
1660
1634
|
[hardwareBackButton.FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false,
|
|
1661
1635
|
'popover-nested': !!parentPopover,
|
|
1662
|
-
}, onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonBackdropTap: this.onBackdropTap }, !parentPopover && index.h("ion-backdrop", { key: '
|
|
1636
|
+
}, onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonBackdropTap: this.onBackdropTap }, !parentPopover && index.h("ion-backdrop", { key: 'bb018f8e093cab6b565455619f6c17f384184f7f', tappable: this.backdropDismiss, visible: this.showBackdrop, part: "backdrop" }), index.h(overlayFocusBoundary.OverlayFocusBoundary, { key: '1f71ca9bc25e76863ab5f504ce37464eaf6c48d8', overlay: this.el, edge: "start" }), index.h("div", { key: '650eddc581be1dadab01a9690d7d4c0bf36bcf91', class: "popover-wrapper ion-overlay-wrapper", onClick: dismissOnSelect ? () => this.dismiss() : undefined }, enableArrow && index.h("div", { key: '95f2639dae6ac16a3ba01e1ce8eb18869024694c', class: "popover-arrow", part: "arrow" }), index.h("div", { key: '1f4ce7f6b56b4b8d51c8f1c9e502c78c3430b0a2', class: "popover-content", part: "content" }, index.h("slot", { key: 'a936b487579eed45153dab5db3dd92d4a48f6101' }))), index.h(overlayFocusBoundary.OverlayFocusBoundary, { key: 'b583cf2f37c370ab9753df7639c5cc0fc2b16f44', overlay: this.el, edge: "end" })));
|
|
1663
1637
|
}
|
|
1664
1638
|
get el() { return index.getElement(this); }
|
|
1665
1639
|
static get watchers() { return {
|
|
@@ -497,7 +497,7 @@ export class Popover {
|
|
|
497
497
|
const { onLifecycle, parentPopover, dismissOnSelect, side, arrow, htmlAttributes, focusTrap } = this;
|
|
498
498
|
const desktop = isPlatform('desktop');
|
|
499
499
|
const enableArrow = arrow && !parentPopover;
|
|
500
|
-
return (h(Host, { key: '
|
|
500
|
+
return (h(Host, { key: '799f0b8c23298152f4d1acce57af3b0b841088cc', "aria-modal": "true", "no-router": true, tabindex: "-1", ...htmlAttributes, style: {
|
|
501
501
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
502
502
|
}, class: {
|
|
503
503
|
...getClassMap(this.cssClass),
|
|
@@ -508,7 +508,7 @@ export class Popover {
|
|
|
508
508
|
[`popover-side-${side}`]: true,
|
|
509
509
|
[FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false,
|
|
510
510
|
'popover-nested': !!parentPopover,
|
|
511
|
-
}, onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonBackdropTap: this.onBackdropTap }, !parentPopover && h("ion-backdrop", { key: '
|
|
511
|
+
}, onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonBackdropTap: this.onBackdropTap }, !parentPopover && h("ion-backdrop", { key: 'bb018f8e093cab6b565455619f6c17f384184f7f', tappable: this.backdropDismiss, visible: this.showBackdrop, part: "backdrop" }), h(OverlayFocusBoundary, { key: '1f71ca9bc25e76863ab5f504ce37464eaf6c48d8', overlay: this.el, edge: "start" }), h("div", { key: '650eddc581be1dadab01a9690d7d4c0bf36bcf91', class: "popover-wrapper ion-overlay-wrapper", onClick: dismissOnSelect ? () => this.dismiss() : undefined }, enableArrow && h("div", { key: '95f2639dae6ac16a3ba01e1ce8eb18869024694c', class: "popover-arrow", part: "arrow" }), h("div", { key: '1f4ce7f6b56b4b8d51c8f1c9e502c78c3430b0a2', class: "popover-content", part: "content" }, h("slot", { key: 'a936b487579eed45153dab5db3dd92d4a48f6101' }))), h(OverlayFocusBoundary, { key: 'b583cf2f37c370ab9753df7639c5cc0fc2b16f44', overlay: this.el, edge: "end" })));
|
|
512
512
|
}
|
|
513
513
|
static get is() { return "ion-popover"; }
|
|
514
514
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1020,7 +1020,7 @@ export class Popover {
|
|
|
1020
1020
|
"optional": true,
|
|
1021
1021
|
"docs": {
|
|
1022
1022
|
"tags": [],
|
|
1023
|
-
"text": "Describes how to align the popover content with the `reference` point.\nDefaults to `\"center\"` for `ios` mode, and `\"start\"` for `md` mode."
|
|
1023
|
+
"text": "Describes how to align the popover content with the `reference` point.\nDefaults to `\"center\"` for `ios` mode, and `\"start\"` for `md` mode.\nThe `\"start\"` and `\"end\"` values are RTL-aware."
|
|
1024
1024
|
},
|
|
1025
1025
|
"getter": false,
|
|
1026
1026
|
"setter": false,
|
|
@@ -540,7 +540,7 @@ export const getPopoverPosition = (isRTL, contentWidth, contentHeight, arrowWidt
|
|
|
540
540
|
* would allow the popover content
|
|
541
541
|
* to have the correct alignment.
|
|
542
542
|
*/
|
|
543
|
-
const alignedCoordinates =
|
|
543
|
+
const alignedCoordinates = calculatePopoverAlignedCoordinates(align, side, referenceCoordinates, contentWidth, contentHeight, isRTL);
|
|
544
544
|
const top = coordinates.top + alignedCoordinates.top;
|
|
545
545
|
const left = coordinates.left + alignedCoordinates.left;
|
|
546
546
|
const { arrowTop, arrowLeft } = calculateArrowPosition(side, arrowWidth, arrowHeight, top, left, contentWidth, contentHeight, isRTL);
|
|
@@ -557,9 +557,9 @@ export const getPopoverPosition = (isRTL, contentWidth, contentHeight, arrowWidt
|
|
|
557
557
|
const calculatePopoverOrigin = (side, align, isRTL) => {
|
|
558
558
|
switch (side) {
|
|
559
559
|
case 'top':
|
|
560
|
-
return { originX: getOriginXAlignment(align), originY: 'bottom' };
|
|
560
|
+
return { originX: getOriginXAlignment(align, isRTL), originY: 'bottom' };
|
|
561
561
|
case 'bottom':
|
|
562
|
-
return { originX: getOriginXAlignment(align), originY: 'top' };
|
|
562
|
+
return { originX: getOriginXAlignment(align, isRTL), originY: 'top' };
|
|
563
563
|
case 'left':
|
|
564
564
|
return { originX: 'right', originY: getOriginYAlignment(align) };
|
|
565
565
|
case 'right':
|
|
@@ -570,14 +570,14 @@ const calculatePopoverOrigin = (side, align, isRTL) => {
|
|
|
570
570
|
return { originX: isRTL ? 'right' : 'left', originY: getOriginYAlignment(align) };
|
|
571
571
|
}
|
|
572
572
|
};
|
|
573
|
-
const getOriginXAlignment = (align) => {
|
|
573
|
+
const getOriginXAlignment = (align, isRTL) => {
|
|
574
574
|
switch (align) {
|
|
575
575
|
case 'start':
|
|
576
|
-
return 'left';
|
|
576
|
+
return isRTL ? 'right' : 'left';
|
|
577
577
|
case 'center':
|
|
578
578
|
return 'center';
|
|
579
579
|
case 'end':
|
|
580
|
-
return 'right';
|
|
580
|
+
return isRTL ? 'left' : 'right';
|
|
581
581
|
}
|
|
582
582
|
};
|
|
583
583
|
const getOriginYAlignment = (align) => {
|
|
@@ -669,71 +669,45 @@ const calculatePopoverSide = (side, triggerBoundingBox, contentWidth, contentHei
|
|
|
669
669
|
* correct alignment regardless while taking
|
|
670
670
|
* into account the side the popover is on.
|
|
671
671
|
*/
|
|
672
|
-
const
|
|
673
|
-
switch (align) {
|
|
674
|
-
case 'center':
|
|
675
|
-
return calculatePopoverCenterAlign(side, triggerBoundingBox, contentWidth, contentHeight);
|
|
676
|
-
case 'end':
|
|
677
|
-
return calculatePopoverEndAlign(side, triggerBoundingBox, contentWidth, contentHeight);
|
|
678
|
-
case 'start':
|
|
679
|
-
default:
|
|
680
|
-
return { top: 0, left: 0 };
|
|
681
|
-
}
|
|
682
|
-
};
|
|
683
|
-
/**
|
|
684
|
-
* Calculate the end alignment for
|
|
685
|
-
* the popover. If side is on the x-axis
|
|
686
|
-
* then the align values refer to the top
|
|
687
|
-
* and bottom margins of the content.
|
|
688
|
-
* If side is on the y-axis then the
|
|
689
|
-
* align values refer to the left and right
|
|
690
|
-
* margins of the content.
|
|
691
|
-
*/
|
|
692
|
-
const calculatePopoverEndAlign = (side, triggerBoundingBox, contentWidth, contentHeight) => {
|
|
672
|
+
const calculatePopoverAlignedCoordinates = (align, side, triggerBoundingBox, contentWidth, contentHeight, isRTL) => {
|
|
693
673
|
switch (side) {
|
|
694
674
|
case 'start':
|
|
695
675
|
case 'end':
|
|
696
676
|
case 'left':
|
|
697
|
-
case 'right':
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
};
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
* the popover. If side is on the x-axis
|
|
714
|
-
* then the align values refer to the top
|
|
715
|
-
* and bottom margins of the content.
|
|
716
|
-
* If side is on the y-axis then the
|
|
717
|
-
* align values refer to the left and right
|
|
718
|
-
* margins of the content.
|
|
719
|
-
*/
|
|
720
|
-
const calculatePopoverCenterAlign = (side, triggerBoundingBox, contentWidth, contentHeight) => {
|
|
721
|
-
switch (side) {
|
|
722
|
-
case 'start':
|
|
723
|
-
case 'end':
|
|
724
|
-
case 'left':
|
|
725
|
-
case 'right':
|
|
726
|
-
return {
|
|
727
|
-
top: -(contentHeight / 2 - triggerBoundingBox.height / 2),
|
|
728
|
-
left: 0,
|
|
729
|
-
};
|
|
677
|
+
case 'right': {
|
|
678
|
+
/**
|
|
679
|
+
* If side is on the x-axis
|
|
680
|
+
* then the align values refer to the top
|
|
681
|
+
* and bottom margins of the content.
|
|
682
|
+
*/
|
|
683
|
+
switch (align) {
|
|
684
|
+
case 'end':
|
|
685
|
+
return { top: -(contentHeight - triggerBoundingBox.height), left: 0 };
|
|
686
|
+
case 'center':
|
|
687
|
+
return { top: -(contentHeight / 2 - triggerBoundingBox.height / 2), left: 0 };
|
|
688
|
+
case 'start':
|
|
689
|
+
default:
|
|
690
|
+
return { top: 0, left: 0 };
|
|
691
|
+
}
|
|
692
|
+
}
|
|
730
693
|
case 'top':
|
|
731
694
|
case 'bottom':
|
|
732
|
-
default:
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
695
|
+
default: {
|
|
696
|
+
/**
|
|
697
|
+
* If side is on the y-axis then the
|
|
698
|
+
* align values refer to the left and right
|
|
699
|
+
* margins of the content.
|
|
700
|
+
*/
|
|
701
|
+
switch (align) {
|
|
702
|
+
case 'end':
|
|
703
|
+
return { top: 0, left: isRTL ? 0 : -(contentWidth - triggerBoundingBox.width) };
|
|
704
|
+
case 'center':
|
|
705
|
+
return { top: 0, left: -(contentWidth / 2 - triggerBoundingBox.width / 2) };
|
|
706
|
+
case 'start':
|
|
707
|
+
default:
|
|
708
|
+
return { top: 0, left: isRTL ? -(contentWidth - triggerBoundingBox.width) : 0 };
|
|
709
|
+
}
|
|
710
|
+
}
|
|
737
711
|
}
|
|
738
712
|
};
|
|
739
713
|
/**
|
package/dist/docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-11-
|
|
2
|
+
"timestamp": "2026-11-25T23:01:30",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.45.5",
|
|
@@ -22992,7 +22992,7 @@
|
|
|
22992
22992
|
"mutable": true,
|
|
22993
22993
|
"attr": "alignment",
|
|
22994
22994
|
"reflectToAttr": false,
|
|
22995
|
-
"docs": "Describes how to align the popover content with the `reference` point.\nDefaults to `\"center\"` for `ios` mode, and `\"start\"` for `md` mode.",
|
|
22995
|
+
"docs": "Describes how to align the popover content with the `reference` point.\nDefaults to `\"center\"` for `ios` mode, and `\"start\"` for `md` mode.\nThe `\"start\"` and `\"end\"` values are RTL-aware.",
|
|
22996
22996
|
"docsTags": [],
|
|
22997
22997
|
"values": [
|
|
22998
22998
|
{
|
|
@@ -550,7 +550,7 @@ const getPopoverPosition = (isRTL, contentWidth, contentHeight, arrowWidth, arro
|
|
|
550
550
|
* would allow the popover content
|
|
551
551
|
* to have the correct alignment.
|
|
552
552
|
*/
|
|
553
|
-
const alignedCoordinates =
|
|
553
|
+
const alignedCoordinates = calculatePopoverAlignedCoordinates(align, side, referenceCoordinates, contentWidth, contentHeight, isRTL);
|
|
554
554
|
const top = coordinates.top + alignedCoordinates.top;
|
|
555
555
|
const left = coordinates.left + alignedCoordinates.left;
|
|
556
556
|
const { arrowTop, arrowLeft } = calculateArrowPosition(side, arrowWidth, arrowHeight, top, left, contentWidth, contentHeight, isRTL);
|
|
@@ -567,9 +567,9 @@ const getPopoverPosition = (isRTL, contentWidth, contentHeight, arrowWidth, arro
|
|
|
567
567
|
const calculatePopoverOrigin = (side, align, isRTL) => {
|
|
568
568
|
switch (side) {
|
|
569
569
|
case 'top':
|
|
570
|
-
return { originX: getOriginXAlignment(align), originY: 'bottom' };
|
|
570
|
+
return { originX: getOriginXAlignment(align, isRTL), originY: 'bottom' };
|
|
571
571
|
case 'bottom':
|
|
572
|
-
return { originX: getOriginXAlignment(align), originY: 'top' };
|
|
572
|
+
return { originX: getOriginXAlignment(align, isRTL), originY: 'top' };
|
|
573
573
|
case 'left':
|
|
574
574
|
return { originX: 'right', originY: getOriginYAlignment(align) };
|
|
575
575
|
case 'right':
|
|
@@ -580,14 +580,14 @@ const calculatePopoverOrigin = (side, align, isRTL) => {
|
|
|
580
580
|
return { originX: isRTL ? 'right' : 'left', originY: getOriginYAlignment(align) };
|
|
581
581
|
}
|
|
582
582
|
};
|
|
583
|
-
const getOriginXAlignment = (align) => {
|
|
583
|
+
const getOriginXAlignment = (align, isRTL) => {
|
|
584
584
|
switch (align) {
|
|
585
585
|
case 'start':
|
|
586
|
-
return 'left';
|
|
586
|
+
return isRTL ? 'right' : 'left';
|
|
587
587
|
case 'center':
|
|
588
588
|
return 'center';
|
|
589
589
|
case 'end':
|
|
590
|
-
return 'right';
|
|
590
|
+
return isRTL ? 'left' : 'right';
|
|
591
591
|
}
|
|
592
592
|
};
|
|
593
593
|
const getOriginYAlignment = (align) => {
|
|
@@ -679,71 +679,45 @@ const calculatePopoverSide = (side, triggerBoundingBox, contentWidth, contentHei
|
|
|
679
679
|
* correct alignment regardless while taking
|
|
680
680
|
* into account the side the popover is on.
|
|
681
681
|
*/
|
|
682
|
-
const
|
|
683
|
-
switch (align) {
|
|
684
|
-
case 'center':
|
|
685
|
-
return calculatePopoverCenterAlign(side, triggerBoundingBox, contentWidth, contentHeight);
|
|
686
|
-
case 'end':
|
|
687
|
-
return calculatePopoverEndAlign(side, triggerBoundingBox, contentWidth, contentHeight);
|
|
688
|
-
case 'start':
|
|
689
|
-
default:
|
|
690
|
-
return { top: 0, left: 0 };
|
|
691
|
-
}
|
|
692
|
-
};
|
|
693
|
-
/**
|
|
694
|
-
* Calculate the end alignment for
|
|
695
|
-
* the popover. If side is on the x-axis
|
|
696
|
-
* then the align values refer to the top
|
|
697
|
-
* and bottom margins of the content.
|
|
698
|
-
* If side is on the y-axis then the
|
|
699
|
-
* align values refer to the left and right
|
|
700
|
-
* margins of the content.
|
|
701
|
-
*/
|
|
702
|
-
const calculatePopoverEndAlign = (side, triggerBoundingBox, contentWidth, contentHeight) => {
|
|
682
|
+
const calculatePopoverAlignedCoordinates = (align, side, triggerBoundingBox, contentWidth, contentHeight, isRTL) => {
|
|
703
683
|
switch (side) {
|
|
704
684
|
case 'start':
|
|
705
685
|
case 'end':
|
|
706
686
|
case 'left':
|
|
707
|
-
case 'right':
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
};
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
* the popover. If side is on the x-axis
|
|
724
|
-
* then the align values refer to the top
|
|
725
|
-
* and bottom margins of the content.
|
|
726
|
-
* If side is on the y-axis then the
|
|
727
|
-
* align values refer to the left and right
|
|
728
|
-
* margins of the content.
|
|
729
|
-
*/
|
|
730
|
-
const calculatePopoverCenterAlign = (side, triggerBoundingBox, contentWidth, contentHeight) => {
|
|
731
|
-
switch (side) {
|
|
732
|
-
case 'start':
|
|
733
|
-
case 'end':
|
|
734
|
-
case 'left':
|
|
735
|
-
case 'right':
|
|
736
|
-
return {
|
|
737
|
-
top: -(contentHeight / 2 - triggerBoundingBox.height / 2),
|
|
738
|
-
left: 0,
|
|
739
|
-
};
|
|
687
|
+
case 'right': {
|
|
688
|
+
/**
|
|
689
|
+
* If side is on the x-axis
|
|
690
|
+
* then the align values refer to the top
|
|
691
|
+
* and bottom margins of the content.
|
|
692
|
+
*/
|
|
693
|
+
switch (align) {
|
|
694
|
+
case 'end':
|
|
695
|
+
return { top: -(contentHeight - triggerBoundingBox.height), left: 0 };
|
|
696
|
+
case 'center':
|
|
697
|
+
return { top: -(contentHeight / 2 - triggerBoundingBox.height / 2), left: 0 };
|
|
698
|
+
case 'start':
|
|
699
|
+
default:
|
|
700
|
+
return { top: 0, left: 0 };
|
|
701
|
+
}
|
|
702
|
+
}
|
|
740
703
|
case 'top':
|
|
741
704
|
case 'bottom':
|
|
742
|
-
default:
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
705
|
+
default: {
|
|
706
|
+
/**
|
|
707
|
+
* If side is on the y-axis then the
|
|
708
|
+
* align values refer to the left and right
|
|
709
|
+
* margins of the content.
|
|
710
|
+
*/
|
|
711
|
+
switch (align) {
|
|
712
|
+
case 'end':
|
|
713
|
+
return { top: 0, left: isRTL ? 0 : -(contentWidth - triggerBoundingBox.width) };
|
|
714
|
+
case 'center':
|
|
715
|
+
return { top: 0, left: -(contentWidth / 2 - triggerBoundingBox.width / 2) };
|
|
716
|
+
case 'start':
|
|
717
|
+
default:
|
|
718
|
+
return { top: 0, left: isRTL ? -(contentWidth - triggerBoundingBox.width) : 0 };
|
|
719
|
+
}
|
|
720
|
+
}
|
|
747
721
|
}
|
|
748
722
|
};
|
|
749
723
|
/**
|
|
@@ -1646,7 +1620,7 @@ const Popover = class {
|
|
|
1646
1620
|
const { onLifecycle, parentPopover, dismissOnSelect, side, arrow, htmlAttributes, focusTrap } = this;
|
|
1647
1621
|
const desktop = isPlatform('desktop');
|
|
1648
1622
|
const enableArrow = arrow && !parentPopover;
|
|
1649
|
-
return (h(Host, { key: '
|
|
1623
|
+
return (h(Host, { key: '799f0b8c23298152f4d1acce57af3b0b841088cc', "aria-modal": "true", "no-router": true, tabindex: "-1", ...htmlAttributes, style: {
|
|
1650
1624
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
1651
1625
|
}, class: {
|
|
1652
1626
|
...getClassMap(this.cssClass),
|
|
@@ -1657,7 +1631,7 @@ const Popover = class {
|
|
|
1657
1631
|
[`popover-side-${side}`]: true,
|
|
1658
1632
|
[FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false,
|
|
1659
1633
|
'popover-nested': !!parentPopover,
|
|
1660
|
-
}, onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonBackdropTap: this.onBackdropTap }, !parentPopover && h("ion-backdrop", { key: '
|
|
1634
|
+
}, onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonBackdropTap: this.onBackdropTap }, !parentPopover && h("ion-backdrop", { key: 'bb018f8e093cab6b565455619f6c17f384184f7f', tappable: this.backdropDismiss, visible: this.showBackdrop, part: "backdrop" }), h(OverlayFocusBoundary, { key: '1f71ca9bc25e76863ab5f504ce37464eaf6c48d8', overlay: this.el, edge: "start" }), h("div", { key: '650eddc581be1dadab01a9690d7d4c0bf36bcf91', class: "popover-wrapper ion-overlay-wrapper", onClick: dismissOnSelect ? () => this.dismiss() : undefined }, enableArrow && h("div", { key: '95f2639dae6ac16a3ba01e1ce8eb18869024694c', class: "popover-arrow", part: "arrow" }), h("div", { key: '1f4ce7f6b56b4b8d51c8f1c9e502c78c3430b0a2', class: "popover-content", part: "content" }, h("slot", { key: 'a936b487579eed45153dab5db3dd92d4a48f6101' }))), h(OverlayFocusBoundary, { key: 'b583cf2f37c370ab9753df7639c5cc0fc2b16f44', overlay: this.el, edge: "end" })));
|
|
1661
1635
|
}
|
|
1662
1636
|
get el() { return getElement(this); }
|
|
1663
1637
|
static get watchers() { return {
|
package/dist/html.html-data.json
CHANGED
|
@@ -4157,7 +4157,7 @@
|
|
|
4157
4157
|
"attributes": [
|
|
4158
4158
|
{
|
|
4159
4159
|
"name": "alignment",
|
|
4160
|
-
"description": "Describes how to align the popover content with the `reference` point.\nDefaults to `\"center\"` for `ios` mode, and `\"start\"` for `md` mode.",
|
|
4160
|
+
"description": "Describes how to align the popover content with the `reference` point.\nDefaults to `\"center\"` for `ios` mode, and `\"start\"` for `md` mode.\nThe `\"start\"` and `\"end\"` values are RTL-aware.",
|
|
4161
4161
|
"values": [
|
|
4162
4162
|
{
|
|
4163
4163
|
"name": "center"
|