@aurodesignsystem-dev/auro-popover 0.0.0-pr102.2 → 0.0.0-pr102.3
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/README.md +12 -12
- package/demo/api.min.js +5 -4
- package/demo/index.min.js +5 -4
- package/dist/auro-popover__bundled.js +5 -4
- package/dist/layoverVersion.d.ts +1 -1
- package/package.json +3 -3
- package/src/layoverVersion.js +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ The following sections are editable by making changes to the following files:
|
|
|
17
17
|
| Component Example Code | HTML sample code of the components use | `./apiExamples/basic.html` |
|
|
18
18
|
-->
|
|
19
19
|
|
|
20
|
-
#
|
|
20
|
+
# Dev/auro-popover
|
|
21
21
|
|
|
22
22
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/description.md) -->
|
|
23
23
|
<!-- The below content is automatically added from ./docs/partials/description.md -->
|
|
@@ -40,13 +40,13 @@ For the most up to date information on [UI development browser support](https://
|
|
|
40
40
|
## Install
|
|
41
41
|
|
|
42
42
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/componentInstall_esm.md) -->
|
|
43
|
-
[](https://github.com/AlaskaAirlines/auro-popover/actions/workflows/testPublish.yml)
|
|
44
|
-
[](https://www.npmjs.com/package/@aurodesignsystem/auro-popover)
|
|
45
|
-
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
43
|
+
[](https://github.com/AlaskaAirlines/-dev/-dev/auro-popover/actions/workflows/testPublish.yml)
|
|
44
|
+
[](https://www.npmjs.com/package/@aurodesignsystem-dev/-dev/-dev/auro-popover)
|
|
45
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
46
46
|

|
|
47
47
|
|
|
48
48
|
```shell
|
|
49
|
-
$ npm i @aurodesignsystem/auro-popover
|
|
49
|
+
$ npm i @aurodesignsystem-dev/-dev/-dev/auro-popover
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
Installing as a direct, dev or peer dependency is up to the user installing the package. If you are unsure as to what type of dependency you should use, consider reading this [stack overflow](https://stackoverflow.com/questions/18875674/whats-the-difference-between-dependencies-devdependencies-and-peerdependencies) answer.
|
|
@@ -63,13 +63,13 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
63
63
|
### Define dependency in project component
|
|
64
64
|
|
|
65
65
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/componentImportDescription.md) -->
|
|
66
|
-
Defining the component dependency within each component that is using the
|
|
66
|
+
Defining the component dependency within each component that is using the `<-dev/-dev/auro-popover>` component.
|
|
67
67
|
|
|
68
68
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
69
69
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/componentImport.md) -->
|
|
70
70
|
|
|
71
71
|
```js
|
|
72
|
-
import "@aurodesignsystem/auro-popover";
|
|
72
|
+
import "@aurodesignsystem-dev/-dev/-dev/auro-popover";
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
@@ -94,7 +94,7 @@ import "@aurodesignsystem/auro-popover";
|
|
|
94
94
|
## Install bundled assets from CDN
|
|
95
95
|
|
|
96
96
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/bundleInstallDescription.md) -->
|
|
97
|
-
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. See --
|
|
97
|
+
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. See -- `-dev/-dev/auro-popover__bundled.js` for modern browsers. Legacy browsers such as IE11 are no longer supported.
|
|
98
98
|
|
|
99
99
|
**WARNING!** When installing into your application environment, DO NOT use `@latest` for the requested version. Risks include unknown MAJOR version releases and instant adoption of any new features and possible bugs without developer knowledge. The `@latest` wildcard should NEVER be used for production customer-facing applications. You have been warned.
|
|
100
100
|
|
|
@@ -107,12 +107,12 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
107
107
|
```html
|
|
108
108
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@/dist/auro-classic/CSSCustomProperties.css" />
|
|
109
109
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@/dist/bundled/essentials.css" />
|
|
110
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-popover@
|
|
110
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem-dev/-dev/-dev/auro-popover@0.0.0-pr102.3/dist/-dev/-dev/auro-popover__bundled.js" type="module"></script>
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
114
114
|
|
|
115
|
-
## auro-popover use cases
|
|
115
|
+
## auro-dev/auro-popover use cases
|
|
116
116
|
|
|
117
117
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
118
118
|
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
@@ -125,7 +125,7 @@ The `auro-popover` element should be used in situations where users may:
|
|
|
125
125
|
|
|
126
126
|
## API Code Examples
|
|
127
127
|
|
|
128
|
-
### Default auro-popover
|
|
128
|
+
### Default auro-dev/auro-popover
|
|
129
129
|
|
|
130
130
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
131
131
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
@@ -184,7 +184,7 @@ The custom element API file is generated in the build and committed back to the
|
|
|
184
184
|
### Testing
|
|
185
185
|
|
|
186
186
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/development/testing.md) -->
|
|
187
|
-
Automated tests are required for every Auro component. See `.\test
|
|
187
|
+
Automated tests are required for every Auro component. See `.\test\-dev/-dev/auro-popover.test.js` for the tests for this component. Run `npm test` to run the tests and check code coverage. Tests must pass and meet a certain coverage threshold to commit. See [the testing documentation](https://auro.alaskaair.com/support/tests) for more details.
|
|
188
188
|
|
|
189
189
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
190
190
|
|
package/demo/api.min.js
CHANGED
|
@@ -178,8 +178,8 @@ class AuroLibraryRuntimeUtils {
|
|
|
178
178
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
179
179
|
*/const o=o=>o??E$1;
|
|
180
180
|
|
|
181
|
-
const a=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[role="tab"]:not([disabled])','[role="link"]:not([disabled])','[role="button"]:not([disabled])','[tabindex]:not([tabindex="-1"])','[contenteditable]:not([contenteditable="false"])'],l=["auro-checkbox","auro-radio","auro-dropdown","auro-button","auro-combobox","auro-input","auro-counter","auro-select","auro-datepicker","auro-hyperlink","auro-accordion"];function c(t){const e=[],n=t=>{if(t.nodeType===Node.ELEMENT_NODE){if(function(t){const e=t.tagName.toLowerCase();return !(!l.some(n=>t.hasAttribute(n)||e===n)||t.hasAttribute("disabled")||e.match("hyperlink")&&!t.hasAttribute("href"))}(t))return void e.push(t);for(const n of a)if(t.matches?.(n)){e.push(t);break}if(t.shadowRoot&&t.shadowRoot.children&&Array.from(t.shadowRoot.children).forEach(t=>{n(t);}),"SLOT"===t.tagName){const e=t.assignedNodes({flatten:true});for(const t of e)n(t);}else t.children&&Array.from(t.children).forEach(t=>{n(t);});}};n(t);const o=[],i=new Set;for(const t of e)i.has(t)||(i.add(t),o.push(t));const r=o.filter(t=>t.hasAttribute("tabindex")&&(parseInt(t.getAttribute("tabindex"))??-1)>0);r.sort((t,e)=>parseInt(t.getAttribute("tabindex"),10)-parseInt(e.getAttribute("tabindex"),10));const s=o.filter(t=>!t.hasAttribute("tabindex")||0===(parseInt(t.getAttribute("tabindex"))??-1));return [...r,...s]}class h{constructor(t,e=false){if(!(t&&t instanceof HTMLElement))throw new Error("FocusTrap requires a valid HTMLElement.");this.container=t,this.tabDirection="forward",this.controlTabOrder=e,this._init();}_init(){"inert"in HTMLElement.prototype&&(this.container.inert=false,this.container.setAttribute("data-focus-trap-container",true)),this.container.addEventListener("keydown",this._onKeydown);}_getActiveElements(){let{activeElement:t}=document;const e=[t];for(;t?.shadowRoot?.activeElement;)e.push(t.shadowRoot.activeElement),t=t.shadowRoot.activeElement;return e}_getNextFocusIndex(t,e,n){const o=n.includes(e[0])||n.includes(this.container),i=n.includes(e[e.length-1]);if(this.controlTabOrder){let n=t+("forward"===this.tabDirection?1:-1);return n<0&&(n=e.length-1),n>=e.length&&(n=0),n}return "backward"===this.tabDirection&&o?e.length-1:"forward"===this.tabDirection&&i?0:null}_handleTabKey(t){const e=this._getFocusableElements();if(!e.length)return void console.warn("FocusTrap: No focusable elements found in the container.");this.tabDirection=t.shiftKey?"backward":"forward";const n=this._getActiveElements();let o=e.findIndex(t=>n.includes(t));-1===o&&(o=0);let i=this._getNextFocusIndex(o,e,n);null!==i&&(t.preventDefault(),e[i].focus());}_onKeydown=t=>{"Tab"===t.key&&this._handleTabKey(t);};_getFocusableElements(){return c(this.container)}focusFirstElement(){const t=this._getFocusableElements();t.length&&t[0].focus();}focusLastElement(){const t=this._getFocusableElements();t.length&&t[t.length-1].focus();}disconnect(){this.container.hasAttribute("data-focus-trap-container")&&this.container.removeAttribute("data-focus-trap-container"),this.container.removeEventListener("keydown",this._onKeydown);}}const u={fromAttribute:t=>null!=t&&(""===t||"false"!==t.toLowerCase()),toAttribute:t=>t?"":null},d=["top","right","bottom","left"],f=["start","end"],p=d.reduce((t,e)=>t.concat(e,e+"-"+f[0],e+"-"+f[1]),[]),g=Math.min,m=Math.max,v=Math.round,w=Math.floor,y=t=>({x:t,y:t}),b={left:"right",right:"left",bottom:"top",top:"bottom"},_={start:"end",end:"start"};function x(t,e,n){return m(t,g(e,n))}function E(t,e){return "function"==typeof t?t(e):t}function T(t){return t.split("-")[0]}function S(t){return t.split("-")[1]}function R(t){return "y"===t?"height":"width"}const L=new Set(["top","bottom"]);function C(t){return L.has(T(t))?"y":"x"}function A(t){return "x"===C(t)?"y":"x"}function P(t,e,n){ void 0===n&&(n=false);const o=S(t),i=A(t),r=R(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=D(s)),[s,D(s)]}function O(t){return t.replace(/start|end/g,t=>_[t])}const k=["left","right"],F=["right","left"],B=["top","bottom"],H=["bottom","top"];function I(t,e,n,o){const i=S(t);let r=function(t,e,n){switch(t){case "top":case "bottom":return n?e?F:k:e?k:F;case "left":case "right":return e?B:H;default:return []}}(T(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(O)))),r}function D(t){return t.replace(/left|right|bottom|top/g,t=>b[t])}function N(t){return "number"!=typeof t?function(t){return {top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function $(t){const{x:e,y:n,width:o,height:i}=t;return {width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function V(t,e,n){let{reference:o,floating:i}=t;const r=C(e),s=A(e),a=R(s),l=T(e),c="y"===r,h=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,d=o[a]/2-i[a]/2;let f;switch(l){case "top":f={x:h,y:o.y-i.height};break;case "bottom":f={x:h,y:o.y+o.height};break;case "right":f={x:o.x+o.width,y:u};break;case "left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y};}switch(S(e)){case "start":f[s]-=d*(n&&c?-1:1);break;case "end":f[s]+=d*(n&&c?-1:1);}return f}async function W(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=false,padding:f=0}=E(e,t),p=N(f),g=a[d?"floating"===u?"reference":"floating":u],m=$(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),v="floating"===u?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),y=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},b=$(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return {top:(m.top-b.top+p.top)/y.y,bottom:(b.bottom-m.bottom+p.bottom)/y.y,left:(m.left-b.left+p.left)/y.x,right:(b.right-m.right+p.right)/y.x}}function M(t,e){return {top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function j(t){return d.some(e=>t[e]>=0)}function z(t){const e=g(...t.map(t=>t.left)),n=g(...t.map(t=>t.top));return {x:e,y:n,width:m(...t.map(t=>t.right))-e,height:m(...t.map(t=>t.bottom))-n}}const K=new Set(["left","top"]);function Y(){return "undefined"!=typeof window}function q(t){return G(t)?(t.nodeName||"").toLowerCase():"#document"}function U(t){var e;return (null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function X(t){var e;return null==(e=(G(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function G(t){return !!Y()&&(t instanceof Node||t instanceof U(t).Node)}function J(t){return !!Y()&&(t instanceof Element||t instanceof U(t).Element)}function Q(t){return !!Y()&&(t instanceof HTMLElement||t instanceof U(t).HTMLElement)}function Z(t){return !(!Y()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof U(t).ShadowRoot)}const tt=new Set(["inline","contents"]);function et(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=ft(t);return /auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!tt.has(i)}const nt=new Set(["table","td","th"]);function ot(t){return nt.has(q(t))}const it=[":popover-open",":modal"];function rt(t){return it.some(e=>{try{return t.matches(e)}catch(t){return false}})}const st=["transform","translate","scale","rotate","perspective"],at=["transform","translate","scale","rotate","perspective","filter"],lt=["paint","layout","strict","content"];function ct(t){const e=ht(),n=J(t)?ft(t):t;return st.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||at.some(t=>(n.willChange||"").includes(t))||lt.some(t=>(n.contain||"").includes(t))}function ht(){return !("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ut=new Set(["html","body","#document"]);function dt(t){return ut.has(q(t))}function ft(t){return U(t).getComputedStyle(t)}function pt(t){return J(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function gt(t){if("html"===q(t))return t;const e=t.assignedSlot||t.parentNode||Z(t)&&t.host||X(t);return Z(e)?e.host:e}function mt(t){const e=gt(t);return dt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Q(e)&&et(e)?e:mt(e)}function vt(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=true);const i=mt(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=U(i);if(r){const t=wt(s);return e.concat(s,s.visualViewport||[],et(i)?i:[],t&&n?vt(t):[])}return e.concat(i,vt(i,[],n))}function wt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yt(t){const e=ft(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=Q(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,a=v(n)!==r||v(o)!==s;return a&&(n=r,o=s),{width:n,height:o,$:a}}function bt(t){return J(t)?t:t.contextElement}function _t(t){const e=bt(t);if(!Q(e))return y(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=yt(e);let s=(r?v(n.width):n.width)/o,a=(r?v(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const xt=y(0);function Et(t){const e=U(t);return ht()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:xt}function Tt(t,e,n,o){ void 0===e&&(e=false),void 0===n&&(n=false);const i=t.getBoundingClientRect(),r=bt(t);let s=y(1);e&&(o?J(o)&&(s=_t(o)):s=_t(t));const a=function(t,e,n){return void 0===e&&(e=false),!(!n||e&&n!==U(t))&&e}(r,n,o)?Et(r):y(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,h=i.width/s.x,u=i.height/s.y;if(r){const t=U(r),e=o&&J(o)?U(o):o;let n=t,i=wt(n);for(;i&&o&&e!==n;){const t=_t(i),e=i.getBoundingClientRect(),o=ft(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,u*=t.y,l+=r,c+=s,n=U(i),i=wt(n);}}return $({width:h,height:u,x:l,y:c})}function St(t,e){const n=pt(t).scrollLeft;return e?e.left+n:Tt(X(t)).left+n}function Rt(t,e,n){ void 0===n&&(n=false);const o=t.getBoundingClientRect();return {x:o.left+e.scrollLeft-(n?0:St(t,o)),y:o.top+e.scrollTop}}const Lt=new Set(["absolute","fixed"]);function Ct(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=U(t),o=X(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,a=0,l=0;if(i){r=i.width,s=i.height;const t=ht();(!t||t&&"fixed"===e)&&(a=i.offsetLeft,l=i.offsetTop);}return {width:r,height:s,x:a,y:l}}(t,n);else if("document"===e)o=function(t){const e=X(t),n=pt(t),o=t.ownerDocument.body,i=m(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=m(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+St(t);const a=-n.scrollTop;return "rtl"===ft(o).direction&&(s+=m(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}(X(t));else if(J(e))o=function(t,e){const n=Tt(t,true,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=Q(t)?_t(t):y(1);return {width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else {const n=Et(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height};}return $(o)}function At(t,e){const n=gt(t);return !(n===e||!J(n)||dt(n))&&("fixed"===ft(n).position||At(n,e))}function Pt(t,e,n){const o=Q(e),i=X(e),r="fixed"===n,s=Tt(t,true,r,e);let a={scrollLeft:0,scrollTop:0};const l=y(0);function c(){l.x=St(i);}if(o||!o&&!r)if(("body"!==q(e)||et(i))&&(a=pt(e)),o){const t=Tt(e,true,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop;}else i&&c();r&&!o&&i&&c();const h=!i||o||r?y(0):Rt(i,a);return {x:s.left+a.scrollLeft-l.x-h.x,y:s.top+a.scrollTop-l.y-h.y,width:s.width,height:s.height}}function Ot(t){return "static"===ft(t).position}function kt(t,e){if(!Q(t)||"fixed"===ft(t).position)return null;if(e)return e(t);let n=t.offsetParent;return X(t)===n&&(n=n.ownerDocument.body),n}function Ft(t,e){const n=U(t);if(rt(t))return n;if(!Q(t)){let e=gt(t);for(;e&&!dt(e);){if(J(e)&&!Ot(e))return e;e=gt(e);}return n}let o=kt(t,e);for(;o&&ot(o)&&Ot(o);)o=kt(o,e);return o&&dt(o)&&Ot(o)&&!ct(o)?n:o||function(t){let e=gt(t);for(;Q(e)&&!dt(e);){if(ct(e))return e;if(rt(e))return null;e=gt(e);}return null}(t)||n}const Bt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=X(o),a=!!e&&rt(e.floating);if(o===s||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=y(1);const h=y(0),u=Q(o);if((u||!u&&!r)&&(("body"!==q(o)||et(s))&&(l=pt(o)),Q(o))){const t=Tt(o);c=_t(o),h.x=t.x+o.clientLeft,h.y=t.y+o.clientTop;}const d=!s||u||r?y(0):Rt(s,l,true);return {width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+h.x+d.x,y:n.y*c.y-l.scrollTop*c.y+h.y+d.y}},getDocumentElement:X,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?rt(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=vt(t,[],false).filter(t=>J(t)&&"body"!==q(t)),i=null;const r="fixed"===ft(t).position;let s=r?gt(t):t;for(;J(s)&&!dt(s);){const e=ft(s),n=ct(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&Lt.has(i.position)||et(s)&&!n&&At(t,s))?o=o.filter(t=>t!==s):i=e,s=gt(s);}return e.set(t,o),o}(e,this._c):[].concat(n),o],s=r[0],a=r.reduce((t,n)=>{const o=Ct(e,n,i);return t.top=m(o.top,t.top),t.right=g(o.right,t.right),t.bottom=g(o.bottom,t.bottom),t.left=m(o.left,t.left),t},Ct(e,s,i));return {width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ft,getElementRects:async function(t){const e=this.getOffsetParent||Ft,n=this.getDimensions,o=await n(t.floating);return {reference:Pt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=yt(t);return {width:e,height:n}},getScale:_t,isElement:J,isRTL:function(t){return "rtl"===ft(t).direction}};function Ht(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function It(t,e,n,o){ void 0===o&&(o={});const{ancestorScroll:i=true,ancestorResize:r=true,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=false}=o,c=bt(t),h=i||r?[...c?vt(c):[],...vt(e)]:[];h.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:true}),r&&t.addEventListener("resize",n);});const u=c&&a?function(t,e){let n,o=null;const i=X(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null;}return function s(a,l){ void 0===a&&(a=false),void 0===l&&(l=1),r();const c=t.getBoundingClientRect(),{left:h,top:u,width:d,height:f}=c;if(a||e(),!d||!f)return;const p={rootMargin:-w(u)+"px "+-w(i.clientWidth-(h+d))+"px "+-w(i.clientHeight-(u+f))+"px "+-w(h)+"px",threshold:m(0,g(1,l))||1};let v=true;function y(e){const o=e[0].intersectionRatio;if(o!==l){if(!v)return s();o?s(false,o):n=setTimeout(()=>{s(false,1e-7);},1e3);}1!==o||Ht(c,t.getBoundingClientRect())||s(),v=false;}try{o=new IntersectionObserver(y,{...p,root:i.ownerDocument});}catch(t){o=new IntersectionObserver(y,p);}o.observe(t);}(true),r}(c,n):null;let d,f=-1,p=null;s&&(p=new ResizeObserver(t=>{let[o]=t;o&&o.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e);})),n();}),c&&!l&&p.observe(c),p.observe(e));let v=l?Tt(t):null;return l&&function e(){const o=Tt(t);v&&!Ht(v,o)&&n();v=o,d=requestAnimationFrame(e);}(),n(),()=>{var t;h.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n);}),null==u||u(),null==(t=p)||t.disconnect(),p=null,l&&cancelAnimationFrame(d);}}const Dt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:a}=e,l=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=T(n),a=S(n),l="y"===C(n),c=K.has(s)?-1:1,h=r&&l?-1:1,u=E(e,t);let{mainAxis:d,crossAxis:f,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*h,y:d*c}:{x:d*c,y:f*h}}(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},Nt=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:r,middlewareData:s,placement:a,platform:l,elements:c}=e,{crossAxis:h=false,alignment:u,allowedPlacements:d=p,autoAlignment:f=true,...g}=E(t,e),m=void 0!==u||d===p?function(t,e,n){return (t?[...n.filter(e=>S(e)===t),...n.filter(e=>S(e)!==t)]:n.filter(t=>T(t)===t)).filter(n=>!t||S(n)===t||!!e&&O(n)!==n)}(u||null,f,d):d,v=await W(e,g),w=(null==(n=s.autoPlacement)?void 0:n.index)||0,y=m[w];if(null==y)return {};const b=P(y,r,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(a!==y)return {reset:{placement:m[0]}};const _=[v[T(y)],v[b[0]],v[b[1]]],x=[...(null==(o=s.autoPlacement)?void 0:o.overflows)||[],{placement:y,overflows:_}],R=m[w+1];if(R)return {data:{index:w+1,overflows:x},reset:{placement:R}};const L=x.map(t=>{const e=S(t.placement);return [t.placement,e&&h?t.overflows.slice(0,2).reduce((t,e)=>t+e,0):t.overflows[0],t.overflows]}).sort((t,e)=>t[1]-e[1]),C=(null==(i=L.filter(t=>t[2].slice(0,S(t[0])?2:3).every(t=>t<=0))[0])?void 0:i[0])||L[0][0];return C!==a?{data:{index:w+1,overflows:x},reset:{placement:C}}:{}}}},$t=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=true,crossAxis:u=true,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=true,...m}=E(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return {};const v=T(i),w=C(a),y=T(a)===a,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=d||(y||!g?[D(a)]:function(t){const e=D(t);return [O(t),e,O(e)]}(a)),x="none"!==p;!d&&x&&_.push(...I(a,g,p,b));const S=[a,..._],R=await W(e,m),L=[];let A=(null==(o=r.flip)?void 0:o.overflows)||[];if(h&&L.push(R[v]),u){const t=P(i,s,b);L.push(R[t[0]],R[t[1]]);}if(A=[...A,{placement:i,overflows:L}],!L.every(t=>t<=0)){var k,F;const t=((null==(k=r.flip)?void 0:k.index)||0)+1,e=S[t];if(e){if(!("alignment"===u&&w!==C(e))||A.every(t=>t.overflows[0]>0&&C(t.placement)===w))return {data:{index:t,overflows:A},reset:{placement:e}}}let n=null==(F=A.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:F.placement;if(!n)switch(f){case "bestFit":{var B;const t=null==(B=A.filter(t=>{if(x){const e=C(t.placement);return e===w||"y"===e}return true}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:B[0];t&&(n=t);break}case "initialPlacement":n=a;}if(i!==n)return {reset:{placement:n}}}return {}}}},Vt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=E(t,e);switch(o){case "referenceHidden":{const t=M(await W(e,{...i,elementContext:"reference"}),n.reference);return {data:{referenceHiddenOffsets:t,referenceHidden:j(t)}}}case "escaped":{const t=M(await W(e,{...i,altBoundary:true}),n.floating);return {data:{escapedOffsets:t,escaped:j(t)}}}default:return {}}}}},Wt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:h=0}=E(t,e)||{};if(null==c)return {};const u=N(h),d={x:n,y:o},f=A(i),p=R(f),m=await s.getDimensions(c),v="y"===f,w=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",_=r.reference[p]+r.reference[f]-d[f]-r.floating[p],T=d[f]-r.reference[f],L=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=L?L[b]:0;C&&await(null==s.isElement?void 0:s.isElement(L))||(C=a.floating[b]||r.floating[p]);const P=_/2-T/2,O=C/2-m[p]/2-1,k=g(u[w],O),F=g(u[y],O),B=k,H=C-m[p]-F,I=C/2-m[p]/2+P,D=x(B,I,H),$=!l.arrow&&null!=S(i)&&I!==D&&r.reference[p]/2-(I<B?k:F)-m[p]/2<0,V=$?I<B?I-B:I-H:0;return {[f]:d[f]+V,data:{[f]:D,centerOffset:I-D-V,...$&&{alignmentOffset:V}},reset:$}}}),Mt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:a=2,x:l,y:c}=E(t,e),h=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),u=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i;}return n.map(t=>$(z(t)))}(h),d=$(z(h)),f=N(a);const p=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=l&&null!=c)return u.find(t=>l>t.left-f.left&&l<t.right+f.right&&c>t.top-f.top&&c<t.bottom+f.bottom)||d;if(u.length>=2){if("y"===C(n)){const t=u[0],e=u[u.length-1],o="top"===T(n),i=t.top,r=e.bottom,s=o?t.left:e.left,a=o?t.right:e.right;return {top:i,bottom:r,left:s,right:a,width:a-s,height:r-i,x:s,y:i}}const t="left"===T(n),e=m(...u.map(t=>t.right)),o=g(...u.map(t=>t.left)),i=u.filter(n=>t?n.left===o:n.right===e),r=i[0].top,s=i[i.length-1].bottom;return {top:r,bottom:s,left:o,right:e,width:e-o,height:s-r,x:o,y:r}}return d}},floating:o.floating,strategy:s});return i.reference.x!==p.reference.x||i.reference.y!==p.reference.y||i.reference.width!==p.reference.width||i.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}},jt=(t,e,n)=>{const o=new Map,i={platform:Bt,...n},r={...i.platform,_c:o};return (async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:u}=V(c,o,l),d=o,f={},p=0;for(let n=0;n<a.length;n++){const{name:r,fn:g}=a[n],{x:m,y:v,data:w,reset:y}=await g({x:h,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:f,rects:c,platform:s,elements:{reference:t,floating:e}});h=null!=m?m:h,u=null!=v?v:u,f={...f,[r]:{...f[r],...w}},y&&p<=50&&(p++,"object"==typeof y&&(y.placement&&(d=y.placement),y.rects&&(c=true===y.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):y.rects),({x:h,y:u}=V(c,d,l))),n=-1);}return {x:h,y:u,placement:d,strategy:i,middlewareData:f}})(t,e,{...i,platform:r})};class zt{constructor(t,e,n={}){this.referenceEl=t,this.floatingEl=e,this.options=n,this.setFloaterStyles(),false!==this.options.autoStart&&this.start(),this.cleanup=null;}setFloaterStyles(){if(!this.floatingEl)return;Object.assign(this.floatingEl.style,{position:"absolute",margin:"0"});}updatePosition(){if(!this.referenceEl||!this.floatingEl)return;const t=[].concat(this.options.offset&&0!==this.options.offset?Dt(this.options.offset):[],this.options.arrowEl?Wt({element:this.options.arrowEl}):[],this.options.useFlip?$t():[],this.options.useAutoPlacement?Nt():[],this.options.useHide?Vt():[],this.options.inline?Mt():[]);jt(this.referenceEl,this.floatingEl,{strategy:this.options.strategy||"absolute",placement:this.options.placement||"bottom-start",middleware:t}).then(({x:t,y:e,middlewareData:n})=>{Object.assign(this.floatingEl?.style??{},{visibility:n.hide?.referenceHidden?"hidden":"visible",left:`${t}px`,top:`${e}px`});});}start(){return this.cleanup&&this.cleanup(),this.cleanup=It(this.referenceEl,this.floatingEl,this.updatePosition.bind(this)),this.cleanup}stop(){this.cleanup&&(this.cleanup(),this.cleanup=null);}disconnect(){this.stop(),this.referenceEl=null,this.floatingEl=null;}}class Kt{registerComponent(t,e){customElements.get(t)||customElements.define(t,class extends e{});}closestElement(t,e=this,n=(e,o=e&&e.closest(t))=>e&&e!==document&&e!==window?o||n(e.getRootNode().host):null){return n(e)}handleComponentTagRename(t,e){const n=e.toLowerCase();t.tagName.toLowerCase()!==n&&t.setAttribute(n,true);}elementMatch(t,e){const n=e.toLowerCase();return t.tagName.toLowerCase()===n||t.hasAttribute(n)}}var Yt=i$3`.popover,.popover-trigger{outline:inherit;background:inherit;border:inherit;padding:0;overflow:visible}:host(:not([shown])) .popover{opacity:0;pointer-events:none;position:absolute}.popover .popover-arrow{position:absolute}.popover .popover-arrow.direction-down{bottom:0;transform:translateY(100%)}.popover .popover-arrow.direction-up{top:0;transform:translateY(-100%)}.popover .popover-arrow.direction-left{left:0;transform:translate(-100%)}.popover .popover-arrow.direction-right{right:0;transform:translate(100%)}.popover-trigger{margin:0;width:inherit;font-size:inherit;text-align:inherit;font:inherit;display:inline-flex}:host([behavior\$=-fullscreen]) [popover]{width:100%;height:100%;top:0;left:0}.popover::backdrop{background:var(--auro-layover-backdrop-background, transparent);backdrop-filter:var(--auro-layover-backdrop-filter, none);opacity:var(--auro-layover-backdrop-opacity, 1);transition:var(--auro-layover-backdrop-transition, none)}
|
|
182
|
-
`;const qt={disabled:false,type:"manual",behavior:"dropdown",showOnHover:false,showOnFocus:true,showOnChange:true,useHide:true,useFlip:true,offset:0,useAutoPlacement:false,placement:"bottom-start",inline:false,shown:false,hideOnNoValue:true},Ut={offset:0,placement:"bottom-start",strategy:"absolute"},Xt=["input","input-fullscreen","input-dropdown"],Gt=["dialog","dialog-fullscreen"],Jt=["dropdown"],Qt=["tooltip"];class Zt extends i$1{static register(t="auro-layover"){Kt.prototype.registerComponent(t,Zt);}constructor(){super(),this._setDefaults(qt),this._createElementRefs(),this._runtimeUtils=new Kt;}_createElementRefs(){this._popoverRef=e$1(),this._arrowElRef=e$1(),this._arrowSlotRef=e$1(),this._buttonRef=e$1(),this._positioningTargetRef=e$1(),this._triggerSlotRef=e$1();}_setDefaults(t){Object.keys(t).forEach(e=>{ void 0===this[e]&&(this[e]=t[e]);});}static get properties(){return {allowBodyScroll:{type:Boolean,reflect:true,converter:u},disabled:{type:Boolean,reflect:true},title:{type:String,reflect:false},type:{type:String,reflect:false},behavior:{type:String,reflect:true},offset:{type:Number,reflect:false},placement:{type:String,reflect:false},showOnHover:{type:Boolean,reflect:false},showOnFocus:{type:String,reflect:false,converter:u},showOnChange:{type:String,reflect:false,converter:u},hideOnNoValue:{type:String,reflect:false,converter:u},shown:{type:Boolean,reflect:true},matchWidth:{type:Boolean,reflect:false,converter:u},minInputLength:{type:Number,reflect:false},input:{type:Object,state:true},useHide:{type:String,reflect:false,converter:u},useAutoPlacement:{type:String,reflect:false,converter:u},useFlip:{type:String,reflect:false,converter:u},inline:{type:String,reflect:false,converter:u},_open:{type:Boolean,reflect:false,state:true},_hasTriggerContent:{type:Boolean,reflect:false,state:true},_currentBehaviorState:{type:String,state:true}}}static get styles(){return [Yt]}get button(){return this._buttonRef.value}get popover(){return this._popoverRef.value}get arrow(){return this._arrowElRef.value}toggle(){this._open?this.hide():this.show();}get _shouldPosition(){return ["dropdown","tooltip","input","input-dropdown"].includes(this.behavior)}show({internal:t=false}={}){this.popover&&!this.disabled&&(this._manageBehavior(this.behavior),this._matchPopoverToTriggerWidth(),this._disableBodyScroll(),this._shouldPosition?this._attachPopoverPositioner():this._detachPopoverPositioner(),this._shouldAdjustFocus&&this.popover.focus(),this._attachFocusTrap(),t||this.popover.showPopover(),this.shown=true,this._dispatchShowEvent());}hide({internal:t=false}={}){if(this.popover&&!this.disabled){if(this._resetBodyScroll(),this._detachPopoverPositioner(),this._detachFocusTrap(),t||this.popover.hidePopover(),this.shown=false,this._shouldAdjustFocus){const t=window.scrollY,e=this._triggerElInSlot||this.button;e?.focus({preventScroll:true}),window.scrollY!==t&&window.scrollTo({top:t,behavior:"instant"});}this._dispatchHideEvent();}}connectedCallback(){super.connectedCallback(),this._runtimeUtils=new Kt,this._runtimeUtils.handleComponentTagRename(this,"auro-layover");}updated(t){["input"].some(e=>t.has(e))&&this.input&&!this.behavior.match("input")&&(this.behavior="input"),["behavior","_hasTriggerContent","input"].some(e=>t.has(e))&&this._manageBehavior(this.behavior);}disconnectedCallback(){super.disconnectedCallback(),this._cleanupCurrentBehavior();}get _shouldAdjustFocus(){return ![...Xt,...Qt].includes(this.behavior)}get _dropdownOptions(){const{placement:t,offset:e,inline:n,useHide:o,useAutoPlacement:i,useFlip:r}=this;return {...Ut,arrowEl:this.arrow,placement:t,offset:e,inline:n,useHide:o,useAutoPlacement:i,useFlip:r}}get _shouldDisableBodyScroll(){return ["dialog"].includes(this.behavior)&&!this.allowBodyScroll}get _triggerSlot(){return this._triggerSlotRef.value}get _positioningTarget(){return this._positioningTargetRef.value}get _triggerElInSlot(){if(!this._triggerSlot)return;const t=this._triggerSlot.assignedNodes({flatten:true});t.length>1&&console.warn("\nAuroLayover: The input behavior requires a single trigger element to be passed to the trigger slot.\n\nExample:\n<auro-layover>\n\t<auro-button slot='trigger'>Click me</auro-button>\n</auro-layover>\n\nPassing more than one element may lead to undesireable behavior.\n");const e=t.find(t=>t.tagName);return t.length&&!e&&console.warn("\nAuroLayover: The trigger slot should not contain text nodes.\n\nExample:\n<auro-layover>\n\t<auro-button slot='trigger'>Click me</auro-button>\n</auro-layover>\n"),e??void 0}get _shouldAttachFocusTrap(){return !this._focusTrap&&!["input","input-dropdown",...Qt].includes(this.behavior)}_matchPopoverToTriggerWidth(){if(!this.matchWidth)return void(this.popover.style.width=null);const t=this._triggerElInSlot||this.button,{width:e}=t?.getBoundingClientRect()||{};this.popover.style.width=e?`${e}px`:"auto";}_calcType(t){return Xt.includes(t)?"manual":Gt.includes(t)||Jt.includes(t)?this._hasTriggerContent?"auto":"manual":Qt.includes(t)?"hint":"manual"}_manageBehavior(t=this.behavior){switch(this._currentBehaviorState=t,this._cleanupCurrentBehavior(),this.type=this._calcType(t),t){case "input":case "input-dropdown":case "input-fullscreen":this._bindToInput();break;case "dropdown":this.shown&&this._attachPopoverPositioner();break;case "tooltip":this.showOnHover=true,this._bindHover(),this.shown&&this._attachPopoverPositioner();break;case "dialog":case "dialog-fullscreen":break;default:console.warn(`AuroLayover: Unknown behavior type "${t}"`);}}_cleanupCurrentBehavior(){this._detachInput(),this._detachHover(),this._detachPopoverPositioner(),this._resetBodyScroll(),this._resetPositionStyles(),this._detachFocusTrap();}_resetPositionStyles(){this.popover&&(this.popover.style.margin=null,this.popover.style.position=null,this.popover.style.top=null,this.popover.style.left=null);}_attachFocusTrap(){this._shouldAttachFocusTrap&&(this._focusTrap=new h(this.popover,true),setTimeout(()=>{this._focusTrap&&this._focusTrap.focusFirstElement();}));}_detachFocusTrap(){this._focusTrap&&(this._focusTrap.disconnect(),this._focusTrap=null);}_attachPopoverPositioner(){this._positioningTarget&&this.popover&&(this._positioner=new zt(this._positioningTarget,this.popover,this._dropdownOptions));}_detachPopoverPositioner(){this._resetPositionStyles(),this._positioner&&(this._positioner.disconnect(),this._positioner=null);}_checkForInput(){!this.input&&this._triggerElInSlot&&this._triggerElInSlot.tagName.toLowerCase().match("input")&&(this.input=this._triggerElInSlot),this.input||setTimeout(()=>{if(!this.input)throw new Error("\nAuroLayover: The input behavior requires an input element to be passed to the trigger slot.\n\nExample:\n<auro-layover>\n\t<auro-input slot='trigger'></auro-input>\n</auro-layover>\n");this._bindToInput();},50);}_bindToInput(){this._checkForInput(),this.input&&(this.input.addEventListener("input",this._handleInputChange),this.input.addEventListener("focus",this._handleInputFocus),["input-fullscreen"].includes(this.behavior)||this.input.addEventListener("blur",this._handleInputBlur));}_detachInput(){const{input:t}=this;t&&(t.removeEventListener("focus",this._handleInputFocus),t.removeEventListener("input",this._handleInputChange),t.removeEventListener("blur",this._handleInputBlur));}_bindHover(){const t=this._triggerElInSlot;t&&(t.addEventListener("mouseover",this._handleOnHover),t.addEventListener("mouseout",this._handleOnHoverLeave));}_detachHover(){const t=this._triggerElInSlot;t&&(t.removeEventListener("mouseover",this._handleOnHover),t.removeEventListener("mouseout",this._handleOnHoverLeave));}_disableBodyScroll(){this._shouldDisableBodyScroll&&(document.documentElement.style.overflow="hidden");}_resetBodyScroll(){document.documentElement.style.overflow=null;}_dispatchShowEvent(){this.dispatchEvent(new CustomEvent("auro-layover-shown",{detail:{target:this,newState:"shown"},bubbles:true,composed:true})),this._dispatchChangeEvent({state:"shown"});}_dispatchHideEvent(){this.dispatchEvent(new CustomEvent("auro-layover-hidden",{detail:{target:this,newState:"hidden"},bubbles:true,composed:true})),this._dispatchChangeEvent({state:"hidden"});}_dispatchChangeEvent({state:t}){this.dispatchEvent(new CustomEvent("auro-layover-change",{detail:{target:this,newState:t},bubbles:true,composed:true}));}_dispatchBeforeChangeEvent({state:t}){this.dispatchEvent(new CustomEvent("auro-layover-beforechange",{detail:{target:this,newState:t},bubbles:true,composed:true}));}_inputPassesValueCheck=t=>{const{value:e}=t;return !(e&&e.length||this.hideOnNoValue)||(e&&e.length>=this.minInputLength||!this.minInputLength||this.minInputLength<=0)};_handleInputChange=t=>{if(!this.showOnChange)return false;const e=t.target;this._inputPassesValueCheck(e)?this.show():this.hide();};_handleInputFocus=t=>{if(!this.showOnFocus)return false;const e=t.target;this._inputPassesValueCheck(e)&&this.show();};_handleInputBlur=()=>{this.hide();};_handleTriggerSlotChange(){const t=this._triggerSlot.assignedNodes({flatten:true});this._hasTriggerContent=!!(t.length>0);}
|
|
181
|
+
const a=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[role="tab"]:not([disabled])','[role="link"]:not([disabled])','[role="button"]:not([disabled])','[tabindex]:not([tabindex="-1"])','[contenteditable]:not([contenteditable="false"])'],l=["auro-checkbox","auro-radio","auro-dropdown","auro-button","auro-combobox","auro-input","auro-counter","auro-select","auro-datepicker","auro-hyperlink","auro-accordion"];function c(t){const e=[],n=t=>{if(t.nodeType===Node.ELEMENT_NODE){if(function(t){const e=t.tagName.toLowerCase();return !(!l.some(n=>t.hasAttribute(n)||e===n)||t.hasAttribute("disabled")||e.match("hyperlink")&&!t.hasAttribute("href"))}(t))return void e.push(t);for(const n of a)if(t.matches?.(n)){e.push(t);break}if(t.shadowRoot&&t.shadowRoot.children&&Array.from(t.shadowRoot.children).forEach(t=>{n(t);}),"SLOT"===t.tagName){const e=t.assignedNodes({flatten:true});for(const t of e)n(t);}else t.children&&Array.from(t.children).forEach(t=>{n(t);});}};n(t);const o=[],i=new Set;for(const t of e)i.has(t)||(i.add(t),o.push(t));const r=o.filter(t=>t.hasAttribute("tabindex")&&(parseInt(t.getAttribute("tabindex"))??-1)>0);r.sort((t,e)=>parseInt(t.getAttribute("tabindex"),10)-parseInt(e.getAttribute("tabindex"),10));const s=o.filter(t=>!t.hasAttribute("tabindex")||0===(parseInt(t.getAttribute("tabindex"))??-1));return [...r,...s]}class h{constructor(t,e=false){if(!(t&&t instanceof HTMLElement))throw new Error("FocusTrap requires a valid HTMLElement.");this.container=t,this.tabDirection="forward",this.controlTabOrder=e,this._init();}_init(){"inert"in HTMLElement.prototype&&(this.container.inert=false,this.container.setAttribute("data-focus-trap-container",true)),this.container.addEventListener("keydown",this._onKeydown);}_getActiveElements(){let{activeElement:t}=document;const e=[t];for(;t?.shadowRoot?.activeElement;)e.push(t.shadowRoot.activeElement),t=t.shadowRoot.activeElement;return e}_getNextFocusIndex(t,e,n){const o=n.includes(e[0])||n.includes(this.container),i=n.includes(e[e.length-1]);if(this.controlTabOrder){let n=t+("forward"===this.tabDirection?1:-1);return n<0&&(n=e.length-1),n>=e.length&&(n=0),n}return "backward"===this.tabDirection&&o?e.length-1:"forward"===this.tabDirection&&i?0:null}_handleTabKey(t){const e=this._getFocusableElements();if(!e.length)return void console.warn("FocusTrap: No focusable elements found in the container.");this.tabDirection=t.shiftKey?"backward":"forward";const n=this._getActiveElements();let o=e.findIndex(t=>n.includes(t));-1===o&&(o=0);let i=this._getNextFocusIndex(o,e,n);null!==i&&(t.preventDefault(),e[i].focus());}_onKeydown=t=>{"Tab"===t.key&&this._handleTabKey(t);};_getFocusableElements(){return c(this.container)}focusFirstElement(){const t=this._getFocusableElements();t.length&&t[0].focus();}focusLastElement(){const t=this._getFocusableElements();t.length&&t[t.length-1].focus();}disconnect(){this.container.hasAttribute("data-focus-trap-container")&&this.container.removeAttribute("data-focus-trap-container"),this.container.removeEventListener("keydown",this._onKeydown);}}const u={fromAttribute:t=>null!=t&&(""===t||"false"!==t.toLowerCase()),toAttribute:t=>t?"":null},d=["top","right","bottom","left"],f=["start","end"],p=d.reduce((t,e)=>t.concat(e,e+"-"+f[0],e+"-"+f[1]),[]),g=Math.min,m=Math.max,v=Math.round,w=Math.floor,y=t=>({x:t,y:t}),b={left:"right",right:"left",bottom:"top",top:"bottom"},_={start:"end",end:"start"};function x(t,e,n){return m(t,g(e,n))}function E(t,e){return "function"==typeof t?t(e):t}function T(t){return t.split("-")[0]}function S(t){return t.split("-")[1]}function R(t){return "y"===t?"height":"width"}const L=new Set(["top","bottom"]);function C(t){return L.has(T(t))?"y":"x"}function P(t){return "x"===C(t)?"y":"x"}function A(t,e,n){ void 0===n&&(n=false);const o=S(t),i=P(t),r=R(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=D(s)),[s,D(s)]}function O(t){return t.replace(/start|end/g,t=>_[t])}const k=["left","right"],F=["right","left"],B=["top","bottom"],H=["bottom","top"];function I(t,e,n,o){const i=S(t);let r=function(t,e,n){switch(t){case "top":case "bottom":return n?e?F:k:e?k:F;case "left":case "right":return e?B:H;default:return []}}(T(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(O)))),r}function D(t){return t.replace(/left|right|bottom|top/g,t=>b[t])}function N(t){return "number"!=typeof t?function(t){return {top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function $(t){const{x:e,y:n,width:o,height:i}=t;return {width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function V(t,e,n){let{reference:o,floating:i}=t;const r=C(e),s=P(e),a=R(s),l=T(e),c="y"===r,h=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,d=o[a]/2-i[a]/2;let f;switch(l){case "top":f={x:h,y:o.y-i.height};break;case "bottom":f={x:h,y:o.y+o.height};break;case "right":f={x:o.x+o.width,y:u};break;case "left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y};}switch(S(e)){case "start":f[s]-=d*(n&&c?-1:1);break;case "end":f[s]+=d*(n&&c?-1:1);}return f}async function W(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=false,padding:f=0}=E(e,t),p=N(f),g=a[d?"floating"===u?"reference":"floating":u],m=$(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),v="floating"===u?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),y=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},b=$(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return {top:(m.top-b.top+p.top)/y.y,bottom:(b.bottom-m.bottom+p.bottom)/y.y,left:(m.left-b.left+p.left)/y.x,right:(b.right-m.right+p.right)/y.x}}function M(t,e){return {top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function j(t){return d.some(e=>t[e]>=0)}function z(t){const e=g(...t.map(t=>t.left)),n=g(...t.map(t=>t.top));return {x:e,y:n,width:m(...t.map(t=>t.right))-e,height:m(...t.map(t=>t.bottom))-n}}const K=new Set(["left","top"]);function Y(){return "undefined"!=typeof window}function q(t){return G(t)?(t.nodeName||"").toLowerCase():"#document"}function U(t){var e;return (null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function X(t){var e;return null==(e=(G(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function G(t){return !!Y()&&(t instanceof Node||t instanceof U(t).Node)}function J(t){return !!Y()&&(t instanceof Element||t instanceof U(t).Element)}function Q(t){return !!Y()&&(t instanceof HTMLElement||t instanceof U(t).HTMLElement)}function Z(t){return !(!Y()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof U(t).ShadowRoot)}const tt=new Set(["inline","contents"]);function et(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=ft(t);return /auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!tt.has(i)}const nt=new Set(["table","td","th"]);function ot(t){return nt.has(q(t))}const it=[":popover-open",":modal"];function rt(t){return it.some(e=>{try{return t.matches(e)}catch(t){return false}})}const st=["transform","translate","scale","rotate","perspective"],at=["transform","translate","scale","rotate","perspective","filter"],lt=["paint","layout","strict","content"];function ct(t){const e=ht(),n=J(t)?ft(t):t;return st.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||at.some(t=>(n.willChange||"").includes(t))||lt.some(t=>(n.contain||"").includes(t))}function ht(){return !("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ut=new Set(["html","body","#document"]);function dt(t){return ut.has(q(t))}function ft(t){return U(t).getComputedStyle(t)}function pt(t){return J(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function gt(t){if("html"===q(t))return t;const e=t.assignedSlot||t.parentNode||Z(t)&&t.host||X(t);return Z(e)?e.host:e}function mt(t){const e=gt(t);return dt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Q(e)&&et(e)?e:mt(e)}function vt(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=true);const i=mt(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=U(i);if(r){const t=wt(s);return e.concat(s,s.visualViewport||[],et(i)?i:[],t&&n?vt(t):[])}return e.concat(i,vt(i,[],n))}function wt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yt(t){const e=ft(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=Q(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,a=v(n)!==r||v(o)!==s;return a&&(n=r,o=s),{width:n,height:o,$:a}}function bt(t){return J(t)?t:t.contextElement}function _t(t){const e=bt(t);if(!Q(e))return y(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=yt(e);let s=(r?v(n.width):n.width)/o,a=(r?v(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const xt=y(0);function Et(t){const e=U(t);return ht()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:xt}function Tt(t,e,n,o){ void 0===e&&(e=false),void 0===n&&(n=false);const i=t.getBoundingClientRect(),r=bt(t);let s=y(1);e&&(o?J(o)&&(s=_t(o)):s=_t(t));const a=function(t,e,n){return void 0===e&&(e=false),!(!n||e&&n!==U(t))&&e}(r,n,o)?Et(r):y(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,h=i.width/s.x,u=i.height/s.y;if(r){const t=U(r),e=o&&J(o)?U(o):o;let n=t,i=wt(n);for(;i&&o&&e!==n;){const t=_t(i),e=i.getBoundingClientRect(),o=ft(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,u*=t.y,l+=r,c+=s,n=U(i),i=wt(n);}}return $({width:h,height:u,x:l,y:c})}function St(t,e){const n=pt(t).scrollLeft;return e?e.left+n:Tt(X(t)).left+n}function Rt(t,e,n){ void 0===n&&(n=false);const o=t.getBoundingClientRect();return {x:o.left+e.scrollLeft-(n?0:St(t,o)),y:o.top+e.scrollTop}}const Lt=new Set(["absolute","fixed"]);function Ct(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=U(t),o=X(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,a=0,l=0;if(i){r=i.width,s=i.height;const t=ht();(!t||t&&"fixed"===e)&&(a=i.offsetLeft,l=i.offsetTop);}return {width:r,height:s,x:a,y:l}}(t,n);else if("document"===e)o=function(t){const e=X(t),n=pt(t),o=t.ownerDocument.body,i=m(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=m(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+St(t);const a=-n.scrollTop;return "rtl"===ft(o).direction&&(s+=m(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}(X(t));else if(J(e))o=function(t,e){const n=Tt(t,true,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=Q(t)?_t(t):y(1);return {width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else {const n=Et(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height};}return $(o)}function Pt(t,e){const n=gt(t);return !(n===e||!J(n)||dt(n))&&("fixed"===ft(n).position||Pt(n,e))}function At(t,e,n){const o=Q(e),i=X(e),r="fixed"===n,s=Tt(t,true,r,e);let a={scrollLeft:0,scrollTop:0};const l=y(0);function c(){l.x=St(i);}if(o||!o&&!r)if(("body"!==q(e)||et(i))&&(a=pt(e)),o){const t=Tt(e,true,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop;}else i&&c();r&&!o&&i&&c();const h=!i||o||r?y(0):Rt(i,a);return {x:s.left+a.scrollLeft-l.x-h.x,y:s.top+a.scrollTop-l.y-h.y,width:s.width,height:s.height}}function Ot(t){return "static"===ft(t).position}function kt(t,e){if(!Q(t)||"fixed"===ft(t).position)return null;if(e)return e(t);let n=t.offsetParent;return X(t)===n&&(n=n.ownerDocument.body),n}function Ft(t,e){const n=U(t);if(rt(t))return n;if(!Q(t)){let e=gt(t);for(;e&&!dt(e);){if(J(e)&&!Ot(e))return e;e=gt(e);}return n}let o=kt(t,e);for(;o&&ot(o)&&Ot(o);)o=kt(o,e);return o&&dt(o)&&Ot(o)&&!ct(o)?n:o||function(t){let e=gt(t);for(;Q(e)&&!dt(e);){if(ct(e))return e;if(rt(e))return null;e=gt(e);}return null}(t)||n}const Bt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=X(o),a=!!e&&rt(e.floating);if(o===s||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=y(1);const h=y(0),u=Q(o);if((u||!u&&!r)&&(("body"!==q(o)||et(s))&&(l=pt(o)),Q(o))){const t=Tt(o);c=_t(o),h.x=t.x+o.clientLeft,h.y=t.y+o.clientTop;}const d=!s||u||r?y(0):Rt(s,l,true);return {width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+h.x+d.x,y:n.y*c.y-l.scrollTop*c.y+h.y+d.y}},getDocumentElement:X,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?rt(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=vt(t,[],false).filter(t=>J(t)&&"body"!==q(t)),i=null;const r="fixed"===ft(t).position;let s=r?gt(t):t;for(;J(s)&&!dt(s);){const e=ft(s),n=ct(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&Lt.has(i.position)||et(s)&&!n&&Pt(t,s))?o=o.filter(t=>t!==s):i=e,s=gt(s);}return e.set(t,o),o}(e,this._c):[].concat(n),o],s=r[0],a=r.reduce((t,n)=>{const o=Ct(e,n,i);return t.top=m(o.top,t.top),t.right=g(o.right,t.right),t.bottom=g(o.bottom,t.bottom),t.left=m(o.left,t.left),t},Ct(e,s,i));return {width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ft,getElementRects:async function(t){const e=this.getOffsetParent||Ft,n=this.getDimensions,o=await n(t.floating);return {reference:At(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=yt(t);return {width:e,height:n}},getScale:_t,isElement:J,isRTL:function(t){return "rtl"===ft(t).direction}};function Ht(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function It(t,e,n,o){ void 0===o&&(o={});const{ancestorScroll:i=true,ancestorResize:r=true,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=false}=o,c=bt(t),h=i||r?[...c?vt(c):[],...vt(e)]:[];h.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:true}),r&&t.addEventListener("resize",n);});const u=c&&a?function(t,e){let n,o=null;const i=X(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null;}return function s(a,l){ void 0===a&&(a=false),void 0===l&&(l=1),r();const c=t.getBoundingClientRect(),{left:h,top:u,width:d,height:f}=c;if(a||e(),!d||!f)return;const p={rootMargin:-w(u)+"px "+-w(i.clientWidth-(h+d))+"px "+-w(i.clientHeight-(u+f))+"px "+-w(h)+"px",threshold:m(0,g(1,l))||1};let v=true;function y(e){const o=e[0].intersectionRatio;if(o!==l){if(!v)return s();o?s(false,o):n=setTimeout(()=>{s(false,1e-7);},1e3);}1!==o||Ht(c,t.getBoundingClientRect())||s(),v=false;}try{o=new IntersectionObserver(y,{...p,root:i.ownerDocument});}catch(t){o=new IntersectionObserver(y,p);}o.observe(t);}(true),r}(c,n):null;let d,f=-1,p=null;s&&(p=new ResizeObserver(t=>{let[o]=t;o&&o.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e);})),n();}),c&&!l&&p.observe(c),p.observe(e));let v=l?Tt(t):null;return l&&function e(){const o=Tt(t);v&&!Ht(v,o)&&n();v=o,d=requestAnimationFrame(e);}(),n(),()=>{var t;h.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n);}),null==u||u(),null==(t=p)||t.disconnect(),p=null,l&&cancelAnimationFrame(d);}}const Dt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:a}=e,l=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=T(n),a=S(n),l="y"===C(n),c=K.has(s)?-1:1,h=r&&l?-1:1,u=E(e,t);let{mainAxis:d,crossAxis:f,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*h,y:d*c}:{x:d*c,y:f*h}}(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},Nt=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:r,middlewareData:s,placement:a,platform:l,elements:c}=e,{crossAxis:h=false,alignment:u,allowedPlacements:d=p,autoAlignment:f=true,...g}=E(t,e),m=void 0!==u||d===p?function(t,e,n){return (t?[...n.filter(e=>S(e)===t),...n.filter(e=>S(e)!==t)]:n.filter(t=>T(t)===t)).filter(n=>!t||S(n)===t||!!e&&O(n)!==n)}(u||null,f,d):d,v=await W(e,g),w=(null==(n=s.autoPlacement)?void 0:n.index)||0,y=m[w];if(null==y)return {};const b=A(y,r,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(a!==y)return {reset:{placement:m[0]}};const _=[v[T(y)],v[b[0]],v[b[1]]],x=[...(null==(o=s.autoPlacement)?void 0:o.overflows)||[],{placement:y,overflows:_}],R=m[w+1];if(R)return {data:{index:w+1,overflows:x},reset:{placement:R}};const L=x.map(t=>{const e=S(t.placement);return [t.placement,e&&h?t.overflows.slice(0,2).reduce((t,e)=>t+e,0):t.overflows[0],t.overflows]}).sort((t,e)=>t[1]-e[1]),C=(null==(i=L.filter(t=>t[2].slice(0,S(t[0])?2:3).every(t=>t<=0))[0])?void 0:i[0])||L[0][0];return C!==a?{data:{index:w+1,overflows:x},reset:{placement:C}}:{}}}},$t=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=true,crossAxis:u=true,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=true,...m}=E(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return {};const v=T(i),w=C(a),y=T(a)===a,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=d||(y||!g?[D(a)]:function(t){const e=D(t);return [O(t),e,O(e)]}(a)),x="none"!==p;!d&&x&&_.push(...I(a,g,p,b));const S=[a,..._],R=await W(e,m),L=[];let P=(null==(o=r.flip)?void 0:o.overflows)||[];if(h&&L.push(R[v]),u){const t=A(i,s,b);L.push(R[t[0]],R[t[1]]);}if(P=[...P,{placement:i,overflows:L}],!L.every(t=>t<=0)){var k,F;const t=((null==(k=r.flip)?void 0:k.index)||0)+1,e=S[t];if(e){if(!("alignment"===u&&w!==C(e))||P.every(t=>t.overflows[0]>0&&C(t.placement)===w))return {data:{index:t,overflows:P},reset:{placement:e}}}let n=null==(F=P.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:F.placement;if(!n)switch(f){case "bestFit":{var B;const t=null==(B=P.filter(t=>{if(x){const e=C(t.placement);return e===w||"y"===e}return true}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:B[0];t&&(n=t);break}case "initialPlacement":n=a;}if(i!==n)return {reset:{placement:n}}}return {}}}},Vt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=E(t,e);switch(o){case "referenceHidden":{const t=M(await W(e,{...i,elementContext:"reference"}),n.reference);return {data:{referenceHiddenOffsets:t,referenceHidden:j(t)}}}case "escaped":{const t=M(await W(e,{...i,altBoundary:true}),n.floating);return {data:{escapedOffsets:t,escaped:j(t)}}}default:return {}}}}},Wt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:h=0}=E(t,e)||{};if(null==c)return {};const u=N(h),d={x:n,y:o},f=P(i),p=R(f),m=await s.getDimensions(c),v="y"===f,w=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",_=r.reference[p]+r.reference[f]-d[f]-r.floating[p],T=d[f]-r.reference[f],L=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=L?L[b]:0;C&&await(null==s.isElement?void 0:s.isElement(L))||(C=a.floating[b]||r.floating[p]);const A=_/2-T/2,O=C/2-m[p]/2-1,k=g(u[w],O),F=g(u[y],O),B=k,H=C-m[p]-F,I=C/2-m[p]/2+A,D=x(B,I,H),$=!l.arrow&&null!=S(i)&&I!==D&&r.reference[p]/2-(I<B?k:F)-m[p]/2<0,V=$?I<B?I-B:I-H:0;return {[f]:d[f]+V,data:{[f]:D,centerOffset:I-D-V,...$&&{alignmentOffset:V}},reset:$}}}),Mt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:a=2,x:l,y:c}=E(t,e),h=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),u=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i;}return n.map(t=>$(z(t)))}(h),d=$(z(h)),f=N(a);const p=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=l&&null!=c)return u.find(t=>l>t.left-f.left&&l<t.right+f.right&&c>t.top-f.top&&c<t.bottom+f.bottom)||d;if(u.length>=2){if("y"===C(n)){const t=u[0],e=u[u.length-1],o="top"===T(n),i=t.top,r=e.bottom,s=o?t.left:e.left,a=o?t.right:e.right;return {top:i,bottom:r,left:s,right:a,width:a-s,height:r-i,x:s,y:i}}const t="left"===T(n),e=m(...u.map(t=>t.right)),o=g(...u.map(t=>t.left)),i=u.filter(n=>t?n.left===o:n.right===e),r=i[0].top,s=i[i.length-1].bottom;return {top:r,bottom:s,left:o,right:e,width:e-o,height:s-r,x:o,y:r}}return d}},floating:o.floating,strategy:s});return i.reference.x!==p.reference.x||i.reference.y!==p.reference.y||i.reference.width!==p.reference.width||i.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}},jt=(t,e,n)=>{const o=new Map,i={platform:Bt,...n},r={...i.platform,_c:o};return (async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:u}=V(c,o,l),d=o,f={},p=0;for(let n=0;n<a.length;n++){const{name:r,fn:g}=a[n],{x:m,y:v,data:w,reset:y}=await g({x:h,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:f,rects:c,platform:s,elements:{reference:t,floating:e}});h=null!=m?m:h,u=null!=v?v:u,f={...f,[r]:{...f[r],...w}},y&&p<=50&&(p++,"object"==typeof y&&(y.placement&&(d=y.placement),y.rects&&(c=true===y.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):y.rects),({x:h,y:u}=V(c,d,l))),n=-1);}return {x:h,y:u,placement:d,strategy:i,middlewareData:f}})(t,e,{...i,platform:r})};class zt{constructor(t,e,n={}){this.referenceEl=t,this.floatingEl=e,this.options=n,this.setFloaterStyles(),false!==this.options.autoStart&&this.start(),this.cleanup=null;}setFloaterStyles(){if(!this.floatingEl)return;Object.assign(this.floatingEl.style,{position:"absolute",margin:"0"});}updatePosition(){if(!this.referenceEl||!this.floatingEl)return;const t=[].concat(this.options.offset&&0!==this.options.offset?Dt(this.options.offset):[],this.options.arrowEl?Wt({element:this.options.arrowEl}):[],this.options.useFlip?$t():[],this.options.useAutoPlacement?Nt():[],this.options.useHide?Vt():[],this.options.inline?Mt():[]);jt(this.referenceEl,this.floatingEl,{strategy:this.options.strategy||"absolute",placement:this.options.placement||"bottom-start",middleware:t}).then(({x:t,y:e,middlewareData:n})=>{Object.assign(this.floatingEl?.style??{},{visibility:n.hide?.referenceHidden?"hidden":"visible",left:`${t}px`,top:`${e}px`});});}start(){return this.cleanup&&this.cleanup(),this.cleanup=It(this.referenceEl,this.floatingEl,this.updatePosition.bind(this)),this.cleanup}stop(){this.cleanup&&(this.cleanup(),this.cleanup=null);}disconnect(){this.stop(),this.referenceEl=null,this.floatingEl=null;}}class Kt{registerComponent(t,e){customElements.get(t)||customElements.define(t,class extends e{});}closestElement(t,e=this,n=(e,o=e&&e.closest(t))=>e&&e!==document&&e!==window?o||n(e.getRootNode().host):null){return n(e)}handleComponentTagRename(t,e){const n=e.toLowerCase();t.tagName.toLowerCase()!==n&&t.setAttribute(n,true);}elementMatch(t,e){const n=e.toLowerCase();return t.tagName.toLowerCase()===n||t.hasAttribute(n)}}var Yt=i$3`.popover,.popover-trigger{outline:inherit;background:inherit;border:inherit;padding:0;overflow:visible}:host(:not([shown])) .popover{opacity:0;pointer-events:none;position:absolute}.popover .popover-arrow{position:absolute}.popover .popover-arrow.direction-down{bottom:0;transform:translateY(100%)}.popover .popover-arrow.direction-up{top:0;transform:translateY(-100%)}.popover .popover-arrow.direction-left{left:0;transform:translate(-100%)}.popover .popover-arrow.direction-right{right:0;transform:translate(100%)}.popover-trigger{margin:0;width:inherit;font-size:inherit;text-align:inherit;font:inherit;display:inline-flex}:host([behavior\$=-fullscreen]) [popover]{width:100%;height:100%;top:0;left:0}.popover::backdrop{background:var(--auro-layover-backdrop-background, transparent);backdrop-filter:var(--auro-layover-backdrop-filter, none);opacity:var(--auro-layover-backdrop-opacity, 1);transition:var(--auro-layover-backdrop-transition, none)}
|
|
182
|
+
`;const qt={disabled:false,type:"manual",behavior:"dropdown",showOnHover:false,showOnFocus:true,showOnChange:true,useHide:true,useFlip:true,offset:0,useAutoPlacement:false,placement:"bottom-start",inline:false,shown:false,hideOnNoValue:true},Ut={offset:0,placement:"bottom-start",strategy:"absolute"},Xt=["input","input-fullscreen","input-dropdown"],Gt=["dialog","dialog-fullscreen"],Jt=["dropdown"],Qt=["tooltip"];class Zt extends i$1{static register(t="auro-layover"){Kt.prototype.registerComponent(t,Zt);}constructor(){super(),this._setDefaults(qt),this._createElementRefs(),this._runtimeUtils=new Kt;}_createElementRefs(){this._popoverRef=e$1(),this._arrowElRef=e$1(),this._arrowSlotRef=e$1(),this._buttonRef=e$1(),this._positioningTargetRef=e$1(),this._triggerSlotRef=e$1();}_setDefaults(t){Object.keys(t).forEach(e=>{ void 0===this[e]&&(this[e]=t[e]);});}static get properties(){return {allowBodyScroll:{type:Boolean,reflect:true,converter:u},disabled:{type:Boolean,reflect:true},title:{type:String,reflect:false},type:{type:String,reflect:false},behavior:{type:String,reflect:true},offset:{type:Number,reflect:false},placement:{type:String,reflect:false},showOnHover:{type:Boolean,reflect:false},showOnFocus:{type:String,reflect:false,converter:u},showOnChange:{type:String,reflect:false,converter:u},hideOnNoValue:{type:String,reflect:false,converter:u},shown:{type:Boolean,reflect:true},matchWidth:{type:Boolean,reflect:false,converter:u},minInputLength:{type:Number,reflect:false},input:{type:Object,state:true},useHide:{type:String,reflect:false,converter:u},useAutoPlacement:{type:String,reflect:false,converter:u},useFlip:{type:String,reflect:false,converter:u},inline:{type:String,reflect:false,converter:u},_open:{type:Boolean,reflect:false,state:true},_hasTriggerContent:{type:Boolean,reflect:false,state:true},_currentBehaviorState:{type:String,state:true}}}static get styles(){return [Yt]}get button(){return this._buttonRef.value}get popover(){return this._popoverRef.value}get arrow(){return this._arrowElRef.value}toggle(){this._open?this.hide():this.show();}get _shouldPosition(){return ["dropdown","tooltip","input","input-dropdown"].includes(this.behavior)}show({internal:t=false}={}){this.popover&&!this.disabled&&(this._manageBehavior(this.behavior),this._matchPopoverToTriggerWidth(),this._disableBodyScroll(),this._shouldPosition?this._attachPopoverPositioner():this._detachPopoverPositioner(),this._shouldAdjustFocus&&this.popover.focus(),this._attachFocusTrap(),t||this.popover.showPopover(),this.shown=true,this._dispatchShowEvent());}hide({internal:t=false}={}){if(this.popover&&!this.disabled){if(this._resetBodyScroll(),this._detachPopoverPositioner(),this._detachFocusTrap(),t||this.popover.hidePopover(),this.shown=false,this._shouldAdjustFocus){const t=window.scrollY,e=this._triggerElInSlot||this.button;e?.focus({preventScroll:true}),window.scrollY!==t&&window.scrollTo({top:t,behavior:"instant"});}this._dispatchHideEvent();}}connectedCallback(){super.connectedCallback(),this._runtimeUtils=new Kt,this._runtimeUtils.handleComponentTagRename(this,"auro-layover");}updated(t){["input"].some(e=>t.has(e))&&this.input&&!this.behavior.match("input")&&(this.behavior="input"),["behavior","_hasTriggerContent","input"].some(e=>t.has(e))&&this._manageBehavior(this.behavior);}disconnectedCallback(){super.disconnectedCallback(),this._cleanupCurrentBehavior();}get _shouldAdjustFocus(){return ![...Xt,...Qt].includes(this.behavior)}get _dropdownOptions(){const{placement:t,offset:e,inline:n,useHide:o,useAutoPlacement:i,useFlip:r}=this;return {...Ut,arrowEl:this.arrow,placement:t,offset:e,inline:n,useHide:o,useAutoPlacement:i,useFlip:r}}get _shouldDisableBodyScroll(){return ["dialog"].includes(this.behavior)&&!this.allowBodyScroll}get _triggerSlot(){return this._triggerSlotRef.value}get _positioningTarget(){return this._positioningTargetRef.value}get _triggerElInSlot(){if(!this._triggerSlot)return;const t=this._triggerSlot.assignedNodes({flatten:true});t.length>1&&console.warn("\nAuroLayover: The input behavior requires a single trigger element to be passed to the trigger slot.\n\nExample:\n<auro-layover>\n\t<auro-button slot='trigger'>Click me</auro-button>\n</auro-layover>\n\nPassing more than one element may lead to undesireable behavior.\n");const e=t.find(t=>t.tagName);return t.length&&!e&&console.warn("\nAuroLayover: The trigger slot should not contain text nodes.\n\nExample:\n<auro-layover>\n\t<auro-button slot='trigger'>Click me</auro-button>\n</auro-layover>\n"),e??void 0}get _shouldAttachFocusTrap(){return !this._focusTrap&&!["input","input-dropdown",...Qt].includes(this.behavior)}_matchPopoverToTriggerWidth(){if(!this.matchWidth)return void(this.popover.style.width=null);const t=this._triggerElInSlot||this.button,{width:e}=t?.getBoundingClientRect()||{};this.popover.style.width=e?`${e}px`:"auto";}_calcType(t){return Xt.includes(t)?"manual":Gt.includes(t)||Jt.includes(t)?this._hasTriggerContent?"auto":"manual":Qt.includes(t)?"hint":"manual"}_manageBehavior(t=this.behavior){switch(this._currentBehaviorState=t,this._cleanupCurrentBehavior(),this.type=this._calcType(t),t){case "input":case "input-dropdown":case "input-fullscreen":this._bindToInput();break;case "dropdown":this.shown&&this._attachPopoverPositioner();break;case "tooltip":this.showOnHover=true,this._bindHover(),this.shown&&this._attachPopoverPositioner();break;case "dialog":case "dialog-fullscreen":break;default:console.warn(`AuroLayover: Unknown behavior type "${t}"`);}}_cleanupCurrentBehavior(){this._detachInput(),this._detachHover(),this._detachPopoverPositioner(),this._resetBodyScroll(),this._resetPositionStyles(),this._detachFocusTrap();}_resetPositionStyles(){this.popover&&(this.popover.style.margin=null,this.popover.style.position=null,this.popover.style.top=null,this.popover.style.left=null);}_attachFocusTrap(){this._shouldAttachFocusTrap&&(this._focusTrap=new h(this.popover,true),setTimeout(()=>{this._focusTrap&&this._focusTrap.focusFirstElement();}));}_detachFocusTrap(){this._focusTrap&&(this._focusTrap.disconnect(),this._focusTrap=null);}_attachPopoverPositioner(){this._positioningTarget&&this.popover&&(this._positioner=new zt(this._positioningTarget,this.popover,this._dropdownOptions));}_detachPopoverPositioner(){this._resetPositionStyles(),this._positioner&&(this._positioner.disconnect(),this._positioner=null);}_checkForInput(){!this.input&&this._triggerElInSlot&&this._triggerElInSlot.tagName.toLowerCase().match("input")&&(this.input=this._triggerElInSlot),this.input||setTimeout(()=>{if(!this.input)throw new Error("\nAuroLayover: The input behavior requires an input element to be passed to the trigger slot.\n\nExample:\n<auro-layover>\n\t<auro-input slot='trigger'></auro-input>\n</auro-layover>\n");this._bindToInput();},50);}_bindToInput(){this._checkForInput(),this.input&&(this.input.addEventListener("input",this._handleInputChange),this.input.addEventListener("focus",this._handleInputFocus),["input-fullscreen"].includes(this.behavior)||this.input.addEventListener("blur",this._handleInputBlur));}_detachInput(){const{input:t}=this;t&&(t.removeEventListener("focus",this._handleInputFocus),t.removeEventListener("input",this._handleInputChange),t.removeEventListener("blur",this._handleInputBlur));}_bindHover(){const t=this._triggerElInSlot;t&&(t.addEventListener("mouseover",this._handleOnHover),t.addEventListener("mouseout",this._handleOnHoverLeave));}_detachHover(){const t=this._triggerElInSlot;t&&(t.removeEventListener("mouseover",this._handleOnHover),t.removeEventListener("mouseout",this._handleOnHoverLeave));}_disableBodyScroll(){this._shouldDisableBodyScroll&&(document.documentElement.style.overflow="hidden");}_resetBodyScroll(){document.documentElement.style.overflow=null;}_dispatchShowEvent(){this.dispatchEvent(new CustomEvent("auro-layover-shown",{detail:{target:this,newState:"shown"},bubbles:true,composed:true})),this._dispatchChangeEvent({state:"shown"});}_dispatchHideEvent(){this.dispatchEvent(new CustomEvent("auro-layover-hidden",{detail:{target:this,newState:"hidden"},bubbles:true,composed:true})),this._dispatchChangeEvent({state:"hidden"});}_dispatchChangeEvent({state:t}){this.dispatchEvent(new CustomEvent("auro-layover-change",{detail:{target:this,newState:t},bubbles:true,composed:true}));}_dispatchBeforeChangeEvent({state:t}){this.dispatchEvent(new CustomEvent("auro-layover-beforechange",{detail:{target:this,newState:t},bubbles:true,composed:true}));}_inputPassesValueCheck=t=>{const{value:e}=t;return !(e&&e.length||this.hideOnNoValue)||(e&&e.length>=this.minInputLength||!this.minInputLength||this.minInputLength<=0)};_handleInputChange=t=>{if(!this.showOnChange)return false;const e=t.target;this._inputPassesValueCheck(e)?this.show():this.hide();};_handleInputFocus=t=>{if(!this.showOnFocus)return false;const e=t.target;this._inputPassesValueCheck(e)&&this.show();};_handleInputBlur=()=>{this.hide();};_handleTriggerSlotChange(){const t=this._triggerSlot.assignedNodes({flatten:true});this._hasTriggerContent=!!(t.length>0);}_handlePopoverBeforeToggle(t){const e="open"===t.newState;if(e)return this._dispatchBeforeChangeEvent({state:"shown"}),void this.show({internal:true});if(!e){if(window.closingLayover&&window.closingLayover!==this)return t.preventDefault(),t.stopPropagation(),void this.popover.showPopover();window.closingLayover=this,this._dispatchBeforeChangeEvent({state:"hidden"}),this.hide({internal:true});}}_handlePopoverToggle(t){const e="open"===t.newState,n=window.closingLayover===this;e||(n||this.popover.showPopover(),n&&setTimeout(()=>{window.closingLayover=null;}));}_handleOnHover=()=>{this.showOnHover&&this.show();};_handleOnHoverLeave=()=>{this.showOnHover&&this.hide();};_renderTriggerSlot(){return x$1`
|
|
183
183
|
<span class="popover-trigger" ${n(this._positioningTargetRef)}>
|
|
184
184
|
<slot
|
|
185
185
|
name="trigger"
|
|
@@ -208,7 +208,8 @@ const a=["a[href]","button:not([disabled])","textarea:not([disabled])","input:no
|
|
|
208
208
|
class="popover"
|
|
209
209
|
role="dialog"
|
|
210
210
|
aria-label="${this.title}"
|
|
211
|
-
@
|
|
211
|
+
@toggle=${this._handlePopoverToggle.bind(this)}
|
|
212
|
+
@beforetoggle=${this._handlePopoverBeforeToggle.bind(this)}
|
|
212
213
|
tabindex="-1"
|
|
213
214
|
>
|
|
214
215
|
<div
|
|
@@ -225,7 +226,7 @@ const a=["a[href]","button:not([disabled])","textarea:not([disabled])","input:no
|
|
|
225
226
|
${this._renderPopover()}
|
|
226
227
|
`}}
|
|
227
228
|
|
|
228
|
-
var layoverVersion = '0.0.0-pr1.
|
|
229
|
+
var layoverVersion = '0.0.0-pr1.17';
|
|
229
230
|
|
|
230
231
|
var styleCss = i$3`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.util_insetNone{padding:0}.util_insetXxxs{padding:.125rem}.util_insetXxxs--stretch{padding:.25rem .125rem}.util_insetXxxs--squish{padding:0 .125rem}.util_insetXxs{padding:.25rem}.util_insetXxs--stretch{padding:.375rem .25rem}.util_insetXxs--squish{padding:.125rem .25rem}.util_insetXs{padding:.5rem}.util_insetXs--stretch{padding:.75rem .5rem}.util_insetXs--squish{padding:.25rem .5rem}.util_insetSm{padding:.75rem}.util_insetSm--stretch{padding:1.125rem .75rem}.util_insetSm--squish{padding:.375rem .75rem}.util_insetMd{padding:1rem}.util_insetMd--stretch{padding:1.5rem 1rem}.util_insetMd--squish{padding:.5rem 1rem}.util_insetLg{padding:1.5rem}.util_insetLg--stretch{padding:2.25rem 1.5rem}.util_insetLg--squish{padding:.75rem 1.5rem}.util_insetXl{padding:2rem}.util_insetXl--stretch{padding:3rem 2rem}.util_insetXl--squish{padding:1rem 2rem}.util_insetXxl{padding:3rem}.util_insetXxl--stretch{padding:4.5rem 3rem}.util_insetXxl--squish{padding:1.5rem 3rem}.util_insetXxxl{padding:4rem}.util_insetXxxl--stretch{padding:6rem 4rem}.util_insetXxxl--squish{padding:2rem 4rem}::slotted(*){white-space:normal}::slotted(*:hover){cursor:pointer}:host([removeSpace]) .popover{margin:calc(-1*(var(--ds-size-50, 0.25rem) + 1px)) 0 !important}.arrow{width:0;height:0;position:relative;border-style:solid}.arrow[data-placement=top]{border-width:var(--ds-size-150, 0.75rem) calc(var(--ds-size-150, 0.75rem)/2 + .5px) 0 calc(var(--ds-size-150, 0.75rem)/2 + .5px);border-color:var(--ds-auro-popover-container-color) transparent transparent transparent}.arrow[data-placement=bottom]{border-width:0 calc(var(--ds-size-150, 0.75rem)/2 + .5px) var(--ds-size-150, 0.75rem) calc(var(--ds-size-150, 0.75rem)/2 + .5px);border-color:transparent transparent var(--ds-auro-popover-container-color) transparent}.arrow[data-placement=left]{border-width:calc(var(--ds-size-150, 0.75rem)/2 + .5px) 0 calc(var(--ds-size-150, 0.75rem)/2 + .5px) var(--ds-size-150, 0.75rem);border-color:transparent transparent transparent var(--ds-auro-popover-container-color)}.arrow[data-placement=right]{border-width:calc(var(--ds-size-150, 0.75rem)/2 + .5px) var(--ds-size-150, 0.75rem) calc(var(--ds-size-150, 0.75rem)/2 + .5px) 0;border-color:transparent var(--ds-auro-popover-container-color) transparent transparent}.popover{display:inline-block;max-width:calc(100% - var(--ds-size-400, 2rem));border-radius:var(--ds-border-radius, 0.375rem)}@media screen and (min-width: 576px){.popover{max-width:50%}}@media screen and (min-width: 768px){.popover{max-width:40%}}@media screen and (min-width: 1024px){.popover{max-width:27rem}}`;
|
|
231
232
|
|
package/demo/index.min.js
CHANGED
|
@@ -178,8 +178,8 @@ class AuroLibraryRuntimeUtils {
|
|
|
178
178
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
179
179
|
*/const o=o=>o??E$1;
|
|
180
180
|
|
|
181
|
-
const a=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[role="tab"]:not([disabled])','[role="link"]:not([disabled])','[role="button"]:not([disabled])','[tabindex]:not([tabindex="-1"])','[contenteditable]:not([contenteditable="false"])'],l=["auro-checkbox","auro-radio","auro-dropdown","auro-button","auro-combobox","auro-input","auro-counter","auro-select","auro-datepicker","auro-hyperlink","auro-accordion"];function c(t){const e=[],n=t=>{if(t.nodeType===Node.ELEMENT_NODE){if(function(t){const e=t.tagName.toLowerCase();return !(!l.some(n=>t.hasAttribute(n)||e===n)||t.hasAttribute("disabled")||e.match("hyperlink")&&!t.hasAttribute("href"))}(t))return void e.push(t);for(const n of a)if(t.matches?.(n)){e.push(t);break}if(t.shadowRoot&&t.shadowRoot.children&&Array.from(t.shadowRoot.children).forEach(t=>{n(t);}),"SLOT"===t.tagName){const e=t.assignedNodes({flatten:true});for(const t of e)n(t);}else t.children&&Array.from(t.children).forEach(t=>{n(t);});}};n(t);const o=[],i=new Set;for(const t of e)i.has(t)||(i.add(t),o.push(t));const r=o.filter(t=>t.hasAttribute("tabindex")&&(parseInt(t.getAttribute("tabindex"))??-1)>0);r.sort((t,e)=>parseInt(t.getAttribute("tabindex"),10)-parseInt(e.getAttribute("tabindex"),10));const s=o.filter(t=>!t.hasAttribute("tabindex")||0===(parseInt(t.getAttribute("tabindex"))??-1));return [...r,...s]}class h{constructor(t,e=false){if(!(t&&t instanceof HTMLElement))throw new Error("FocusTrap requires a valid HTMLElement.");this.container=t,this.tabDirection="forward",this.controlTabOrder=e,this._init();}_init(){"inert"in HTMLElement.prototype&&(this.container.inert=false,this.container.setAttribute("data-focus-trap-container",true)),this.container.addEventListener("keydown",this._onKeydown);}_getActiveElements(){let{activeElement:t}=document;const e=[t];for(;t?.shadowRoot?.activeElement;)e.push(t.shadowRoot.activeElement),t=t.shadowRoot.activeElement;return e}_getNextFocusIndex(t,e,n){const o=n.includes(e[0])||n.includes(this.container),i=n.includes(e[e.length-1]);if(this.controlTabOrder){let n=t+("forward"===this.tabDirection?1:-1);return n<0&&(n=e.length-1),n>=e.length&&(n=0),n}return "backward"===this.tabDirection&&o?e.length-1:"forward"===this.tabDirection&&i?0:null}_handleTabKey(t){const e=this._getFocusableElements();if(!e.length)return void console.warn("FocusTrap: No focusable elements found in the container.");this.tabDirection=t.shiftKey?"backward":"forward";const n=this._getActiveElements();let o=e.findIndex(t=>n.includes(t));-1===o&&(o=0);let i=this._getNextFocusIndex(o,e,n);null!==i&&(t.preventDefault(),e[i].focus());}_onKeydown=t=>{"Tab"===t.key&&this._handleTabKey(t);};_getFocusableElements(){return c(this.container)}focusFirstElement(){const t=this._getFocusableElements();t.length&&t[0].focus();}focusLastElement(){const t=this._getFocusableElements();t.length&&t[t.length-1].focus();}disconnect(){this.container.hasAttribute("data-focus-trap-container")&&this.container.removeAttribute("data-focus-trap-container"),this.container.removeEventListener("keydown",this._onKeydown);}}const u={fromAttribute:t=>null!=t&&(""===t||"false"!==t.toLowerCase()),toAttribute:t=>t?"":null},d=["top","right","bottom","left"],f=["start","end"],p=d.reduce((t,e)=>t.concat(e,e+"-"+f[0],e+"-"+f[1]),[]),g=Math.min,m=Math.max,v=Math.round,w=Math.floor,y=t=>({x:t,y:t}),b={left:"right",right:"left",bottom:"top",top:"bottom"},_={start:"end",end:"start"};function x(t,e,n){return m(t,g(e,n))}function E(t,e){return "function"==typeof t?t(e):t}function T(t){return t.split("-")[0]}function S(t){return t.split("-")[1]}function R(t){return "y"===t?"height":"width"}const L=new Set(["top","bottom"]);function C(t){return L.has(T(t))?"y":"x"}function A(t){return "x"===C(t)?"y":"x"}function P(t,e,n){ void 0===n&&(n=false);const o=S(t),i=A(t),r=R(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=D(s)),[s,D(s)]}function O(t){return t.replace(/start|end/g,t=>_[t])}const k=["left","right"],F=["right","left"],B=["top","bottom"],H=["bottom","top"];function I(t,e,n,o){const i=S(t);let r=function(t,e,n){switch(t){case "top":case "bottom":return n?e?F:k:e?k:F;case "left":case "right":return e?B:H;default:return []}}(T(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(O)))),r}function D(t){return t.replace(/left|right|bottom|top/g,t=>b[t])}function N(t){return "number"!=typeof t?function(t){return {top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function $(t){const{x:e,y:n,width:o,height:i}=t;return {width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function V(t,e,n){let{reference:o,floating:i}=t;const r=C(e),s=A(e),a=R(s),l=T(e),c="y"===r,h=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,d=o[a]/2-i[a]/2;let f;switch(l){case "top":f={x:h,y:o.y-i.height};break;case "bottom":f={x:h,y:o.y+o.height};break;case "right":f={x:o.x+o.width,y:u};break;case "left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y};}switch(S(e)){case "start":f[s]-=d*(n&&c?-1:1);break;case "end":f[s]+=d*(n&&c?-1:1);}return f}async function W(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=false,padding:f=0}=E(e,t),p=N(f),g=a[d?"floating"===u?"reference":"floating":u],m=$(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),v="floating"===u?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),y=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},b=$(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return {top:(m.top-b.top+p.top)/y.y,bottom:(b.bottom-m.bottom+p.bottom)/y.y,left:(m.left-b.left+p.left)/y.x,right:(b.right-m.right+p.right)/y.x}}function M(t,e){return {top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function j(t){return d.some(e=>t[e]>=0)}function z(t){const e=g(...t.map(t=>t.left)),n=g(...t.map(t=>t.top));return {x:e,y:n,width:m(...t.map(t=>t.right))-e,height:m(...t.map(t=>t.bottom))-n}}const K=new Set(["left","top"]);function Y(){return "undefined"!=typeof window}function q(t){return G(t)?(t.nodeName||"").toLowerCase():"#document"}function U(t){var e;return (null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function X(t){var e;return null==(e=(G(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function G(t){return !!Y()&&(t instanceof Node||t instanceof U(t).Node)}function J(t){return !!Y()&&(t instanceof Element||t instanceof U(t).Element)}function Q(t){return !!Y()&&(t instanceof HTMLElement||t instanceof U(t).HTMLElement)}function Z(t){return !(!Y()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof U(t).ShadowRoot)}const tt=new Set(["inline","contents"]);function et(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=ft(t);return /auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!tt.has(i)}const nt=new Set(["table","td","th"]);function ot(t){return nt.has(q(t))}const it=[":popover-open",":modal"];function rt(t){return it.some(e=>{try{return t.matches(e)}catch(t){return false}})}const st=["transform","translate","scale","rotate","perspective"],at=["transform","translate","scale","rotate","perspective","filter"],lt=["paint","layout","strict","content"];function ct(t){const e=ht(),n=J(t)?ft(t):t;return st.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||at.some(t=>(n.willChange||"").includes(t))||lt.some(t=>(n.contain||"").includes(t))}function ht(){return !("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ut=new Set(["html","body","#document"]);function dt(t){return ut.has(q(t))}function ft(t){return U(t).getComputedStyle(t)}function pt(t){return J(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function gt(t){if("html"===q(t))return t;const e=t.assignedSlot||t.parentNode||Z(t)&&t.host||X(t);return Z(e)?e.host:e}function mt(t){const e=gt(t);return dt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Q(e)&&et(e)?e:mt(e)}function vt(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=true);const i=mt(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=U(i);if(r){const t=wt(s);return e.concat(s,s.visualViewport||[],et(i)?i:[],t&&n?vt(t):[])}return e.concat(i,vt(i,[],n))}function wt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yt(t){const e=ft(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=Q(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,a=v(n)!==r||v(o)!==s;return a&&(n=r,o=s),{width:n,height:o,$:a}}function bt(t){return J(t)?t:t.contextElement}function _t(t){const e=bt(t);if(!Q(e))return y(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=yt(e);let s=(r?v(n.width):n.width)/o,a=(r?v(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const xt=y(0);function Et(t){const e=U(t);return ht()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:xt}function Tt(t,e,n,o){ void 0===e&&(e=false),void 0===n&&(n=false);const i=t.getBoundingClientRect(),r=bt(t);let s=y(1);e&&(o?J(o)&&(s=_t(o)):s=_t(t));const a=function(t,e,n){return void 0===e&&(e=false),!(!n||e&&n!==U(t))&&e}(r,n,o)?Et(r):y(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,h=i.width/s.x,u=i.height/s.y;if(r){const t=U(r),e=o&&J(o)?U(o):o;let n=t,i=wt(n);for(;i&&o&&e!==n;){const t=_t(i),e=i.getBoundingClientRect(),o=ft(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,u*=t.y,l+=r,c+=s,n=U(i),i=wt(n);}}return $({width:h,height:u,x:l,y:c})}function St(t,e){const n=pt(t).scrollLeft;return e?e.left+n:Tt(X(t)).left+n}function Rt(t,e,n){ void 0===n&&(n=false);const o=t.getBoundingClientRect();return {x:o.left+e.scrollLeft-(n?0:St(t,o)),y:o.top+e.scrollTop}}const Lt=new Set(["absolute","fixed"]);function Ct(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=U(t),o=X(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,a=0,l=0;if(i){r=i.width,s=i.height;const t=ht();(!t||t&&"fixed"===e)&&(a=i.offsetLeft,l=i.offsetTop);}return {width:r,height:s,x:a,y:l}}(t,n);else if("document"===e)o=function(t){const e=X(t),n=pt(t),o=t.ownerDocument.body,i=m(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=m(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+St(t);const a=-n.scrollTop;return "rtl"===ft(o).direction&&(s+=m(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}(X(t));else if(J(e))o=function(t,e){const n=Tt(t,true,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=Q(t)?_t(t):y(1);return {width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else {const n=Et(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height};}return $(o)}function At(t,e){const n=gt(t);return !(n===e||!J(n)||dt(n))&&("fixed"===ft(n).position||At(n,e))}function Pt(t,e,n){const o=Q(e),i=X(e),r="fixed"===n,s=Tt(t,true,r,e);let a={scrollLeft:0,scrollTop:0};const l=y(0);function c(){l.x=St(i);}if(o||!o&&!r)if(("body"!==q(e)||et(i))&&(a=pt(e)),o){const t=Tt(e,true,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop;}else i&&c();r&&!o&&i&&c();const h=!i||o||r?y(0):Rt(i,a);return {x:s.left+a.scrollLeft-l.x-h.x,y:s.top+a.scrollTop-l.y-h.y,width:s.width,height:s.height}}function Ot(t){return "static"===ft(t).position}function kt(t,e){if(!Q(t)||"fixed"===ft(t).position)return null;if(e)return e(t);let n=t.offsetParent;return X(t)===n&&(n=n.ownerDocument.body),n}function Ft(t,e){const n=U(t);if(rt(t))return n;if(!Q(t)){let e=gt(t);for(;e&&!dt(e);){if(J(e)&&!Ot(e))return e;e=gt(e);}return n}let o=kt(t,e);for(;o&&ot(o)&&Ot(o);)o=kt(o,e);return o&&dt(o)&&Ot(o)&&!ct(o)?n:o||function(t){let e=gt(t);for(;Q(e)&&!dt(e);){if(ct(e))return e;if(rt(e))return null;e=gt(e);}return null}(t)||n}const Bt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=X(o),a=!!e&&rt(e.floating);if(o===s||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=y(1);const h=y(0),u=Q(o);if((u||!u&&!r)&&(("body"!==q(o)||et(s))&&(l=pt(o)),Q(o))){const t=Tt(o);c=_t(o),h.x=t.x+o.clientLeft,h.y=t.y+o.clientTop;}const d=!s||u||r?y(0):Rt(s,l,true);return {width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+h.x+d.x,y:n.y*c.y-l.scrollTop*c.y+h.y+d.y}},getDocumentElement:X,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?rt(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=vt(t,[],false).filter(t=>J(t)&&"body"!==q(t)),i=null;const r="fixed"===ft(t).position;let s=r?gt(t):t;for(;J(s)&&!dt(s);){const e=ft(s),n=ct(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&Lt.has(i.position)||et(s)&&!n&&At(t,s))?o=o.filter(t=>t!==s):i=e,s=gt(s);}return e.set(t,o),o}(e,this._c):[].concat(n),o],s=r[0],a=r.reduce((t,n)=>{const o=Ct(e,n,i);return t.top=m(o.top,t.top),t.right=g(o.right,t.right),t.bottom=g(o.bottom,t.bottom),t.left=m(o.left,t.left),t},Ct(e,s,i));return {width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ft,getElementRects:async function(t){const e=this.getOffsetParent||Ft,n=this.getDimensions,o=await n(t.floating);return {reference:Pt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=yt(t);return {width:e,height:n}},getScale:_t,isElement:J,isRTL:function(t){return "rtl"===ft(t).direction}};function Ht(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function It(t,e,n,o){ void 0===o&&(o={});const{ancestorScroll:i=true,ancestorResize:r=true,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=false}=o,c=bt(t),h=i||r?[...c?vt(c):[],...vt(e)]:[];h.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:true}),r&&t.addEventListener("resize",n);});const u=c&&a?function(t,e){let n,o=null;const i=X(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null;}return function s(a,l){ void 0===a&&(a=false),void 0===l&&(l=1),r();const c=t.getBoundingClientRect(),{left:h,top:u,width:d,height:f}=c;if(a||e(),!d||!f)return;const p={rootMargin:-w(u)+"px "+-w(i.clientWidth-(h+d))+"px "+-w(i.clientHeight-(u+f))+"px "+-w(h)+"px",threshold:m(0,g(1,l))||1};let v=true;function y(e){const o=e[0].intersectionRatio;if(o!==l){if(!v)return s();o?s(false,o):n=setTimeout(()=>{s(false,1e-7);},1e3);}1!==o||Ht(c,t.getBoundingClientRect())||s(),v=false;}try{o=new IntersectionObserver(y,{...p,root:i.ownerDocument});}catch(t){o=new IntersectionObserver(y,p);}o.observe(t);}(true),r}(c,n):null;let d,f=-1,p=null;s&&(p=new ResizeObserver(t=>{let[o]=t;o&&o.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e);})),n();}),c&&!l&&p.observe(c),p.observe(e));let v=l?Tt(t):null;return l&&function e(){const o=Tt(t);v&&!Ht(v,o)&&n();v=o,d=requestAnimationFrame(e);}(),n(),()=>{var t;h.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n);}),null==u||u(),null==(t=p)||t.disconnect(),p=null,l&&cancelAnimationFrame(d);}}const Dt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:a}=e,l=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=T(n),a=S(n),l="y"===C(n),c=K.has(s)?-1:1,h=r&&l?-1:1,u=E(e,t);let{mainAxis:d,crossAxis:f,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*h,y:d*c}:{x:d*c,y:f*h}}(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},Nt=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:r,middlewareData:s,placement:a,platform:l,elements:c}=e,{crossAxis:h=false,alignment:u,allowedPlacements:d=p,autoAlignment:f=true,...g}=E(t,e),m=void 0!==u||d===p?function(t,e,n){return (t?[...n.filter(e=>S(e)===t),...n.filter(e=>S(e)!==t)]:n.filter(t=>T(t)===t)).filter(n=>!t||S(n)===t||!!e&&O(n)!==n)}(u||null,f,d):d,v=await W(e,g),w=(null==(n=s.autoPlacement)?void 0:n.index)||0,y=m[w];if(null==y)return {};const b=P(y,r,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(a!==y)return {reset:{placement:m[0]}};const _=[v[T(y)],v[b[0]],v[b[1]]],x=[...(null==(o=s.autoPlacement)?void 0:o.overflows)||[],{placement:y,overflows:_}],R=m[w+1];if(R)return {data:{index:w+1,overflows:x},reset:{placement:R}};const L=x.map(t=>{const e=S(t.placement);return [t.placement,e&&h?t.overflows.slice(0,2).reduce((t,e)=>t+e,0):t.overflows[0],t.overflows]}).sort((t,e)=>t[1]-e[1]),C=(null==(i=L.filter(t=>t[2].slice(0,S(t[0])?2:3).every(t=>t<=0))[0])?void 0:i[0])||L[0][0];return C!==a?{data:{index:w+1,overflows:x},reset:{placement:C}}:{}}}},$t=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=true,crossAxis:u=true,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=true,...m}=E(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return {};const v=T(i),w=C(a),y=T(a)===a,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=d||(y||!g?[D(a)]:function(t){const e=D(t);return [O(t),e,O(e)]}(a)),x="none"!==p;!d&&x&&_.push(...I(a,g,p,b));const S=[a,..._],R=await W(e,m),L=[];let A=(null==(o=r.flip)?void 0:o.overflows)||[];if(h&&L.push(R[v]),u){const t=P(i,s,b);L.push(R[t[0]],R[t[1]]);}if(A=[...A,{placement:i,overflows:L}],!L.every(t=>t<=0)){var k,F;const t=((null==(k=r.flip)?void 0:k.index)||0)+1,e=S[t];if(e){if(!("alignment"===u&&w!==C(e))||A.every(t=>t.overflows[0]>0&&C(t.placement)===w))return {data:{index:t,overflows:A},reset:{placement:e}}}let n=null==(F=A.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:F.placement;if(!n)switch(f){case "bestFit":{var B;const t=null==(B=A.filter(t=>{if(x){const e=C(t.placement);return e===w||"y"===e}return true}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:B[0];t&&(n=t);break}case "initialPlacement":n=a;}if(i!==n)return {reset:{placement:n}}}return {}}}},Vt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=E(t,e);switch(o){case "referenceHidden":{const t=M(await W(e,{...i,elementContext:"reference"}),n.reference);return {data:{referenceHiddenOffsets:t,referenceHidden:j(t)}}}case "escaped":{const t=M(await W(e,{...i,altBoundary:true}),n.floating);return {data:{escapedOffsets:t,escaped:j(t)}}}default:return {}}}}},Wt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:h=0}=E(t,e)||{};if(null==c)return {};const u=N(h),d={x:n,y:o},f=A(i),p=R(f),m=await s.getDimensions(c),v="y"===f,w=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",_=r.reference[p]+r.reference[f]-d[f]-r.floating[p],T=d[f]-r.reference[f],L=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=L?L[b]:0;C&&await(null==s.isElement?void 0:s.isElement(L))||(C=a.floating[b]||r.floating[p]);const P=_/2-T/2,O=C/2-m[p]/2-1,k=g(u[w],O),F=g(u[y],O),B=k,H=C-m[p]-F,I=C/2-m[p]/2+P,D=x(B,I,H),$=!l.arrow&&null!=S(i)&&I!==D&&r.reference[p]/2-(I<B?k:F)-m[p]/2<0,V=$?I<B?I-B:I-H:0;return {[f]:d[f]+V,data:{[f]:D,centerOffset:I-D-V,...$&&{alignmentOffset:V}},reset:$}}}),Mt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:a=2,x:l,y:c}=E(t,e),h=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),u=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i;}return n.map(t=>$(z(t)))}(h),d=$(z(h)),f=N(a);const p=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=l&&null!=c)return u.find(t=>l>t.left-f.left&&l<t.right+f.right&&c>t.top-f.top&&c<t.bottom+f.bottom)||d;if(u.length>=2){if("y"===C(n)){const t=u[0],e=u[u.length-1],o="top"===T(n),i=t.top,r=e.bottom,s=o?t.left:e.left,a=o?t.right:e.right;return {top:i,bottom:r,left:s,right:a,width:a-s,height:r-i,x:s,y:i}}const t="left"===T(n),e=m(...u.map(t=>t.right)),o=g(...u.map(t=>t.left)),i=u.filter(n=>t?n.left===o:n.right===e),r=i[0].top,s=i[i.length-1].bottom;return {top:r,bottom:s,left:o,right:e,width:e-o,height:s-r,x:o,y:r}}return d}},floating:o.floating,strategy:s});return i.reference.x!==p.reference.x||i.reference.y!==p.reference.y||i.reference.width!==p.reference.width||i.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}},jt=(t,e,n)=>{const o=new Map,i={platform:Bt,...n},r={...i.platform,_c:o};return (async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:u}=V(c,o,l),d=o,f={},p=0;for(let n=0;n<a.length;n++){const{name:r,fn:g}=a[n],{x:m,y:v,data:w,reset:y}=await g({x:h,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:f,rects:c,platform:s,elements:{reference:t,floating:e}});h=null!=m?m:h,u=null!=v?v:u,f={...f,[r]:{...f[r],...w}},y&&p<=50&&(p++,"object"==typeof y&&(y.placement&&(d=y.placement),y.rects&&(c=true===y.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):y.rects),({x:h,y:u}=V(c,d,l))),n=-1);}return {x:h,y:u,placement:d,strategy:i,middlewareData:f}})(t,e,{...i,platform:r})};class zt{constructor(t,e,n={}){this.referenceEl=t,this.floatingEl=e,this.options=n,this.setFloaterStyles(),false!==this.options.autoStart&&this.start(),this.cleanup=null;}setFloaterStyles(){if(!this.floatingEl)return;Object.assign(this.floatingEl.style,{position:"absolute",margin:"0"});}updatePosition(){if(!this.referenceEl||!this.floatingEl)return;const t=[].concat(this.options.offset&&0!==this.options.offset?Dt(this.options.offset):[],this.options.arrowEl?Wt({element:this.options.arrowEl}):[],this.options.useFlip?$t():[],this.options.useAutoPlacement?Nt():[],this.options.useHide?Vt():[],this.options.inline?Mt():[]);jt(this.referenceEl,this.floatingEl,{strategy:this.options.strategy||"absolute",placement:this.options.placement||"bottom-start",middleware:t}).then(({x:t,y:e,middlewareData:n})=>{Object.assign(this.floatingEl?.style??{},{visibility:n.hide?.referenceHidden?"hidden":"visible",left:`${t}px`,top:`${e}px`});});}start(){return this.cleanup&&this.cleanup(),this.cleanup=It(this.referenceEl,this.floatingEl,this.updatePosition.bind(this)),this.cleanup}stop(){this.cleanup&&(this.cleanup(),this.cleanup=null);}disconnect(){this.stop(),this.referenceEl=null,this.floatingEl=null;}}class Kt{registerComponent(t,e){customElements.get(t)||customElements.define(t,class extends e{});}closestElement(t,e=this,n=(e,o=e&&e.closest(t))=>e&&e!==document&&e!==window?o||n(e.getRootNode().host):null){return n(e)}handleComponentTagRename(t,e){const n=e.toLowerCase();t.tagName.toLowerCase()!==n&&t.setAttribute(n,true);}elementMatch(t,e){const n=e.toLowerCase();return t.tagName.toLowerCase()===n||t.hasAttribute(n)}}var Yt=i$3`.popover,.popover-trigger{outline:inherit;background:inherit;border:inherit;padding:0;overflow:visible}:host(:not([shown])) .popover{opacity:0;pointer-events:none;position:absolute}.popover .popover-arrow{position:absolute}.popover .popover-arrow.direction-down{bottom:0;transform:translateY(100%)}.popover .popover-arrow.direction-up{top:0;transform:translateY(-100%)}.popover .popover-arrow.direction-left{left:0;transform:translate(-100%)}.popover .popover-arrow.direction-right{right:0;transform:translate(100%)}.popover-trigger{margin:0;width:inherit;font-size:inherit;text-align:inherit;font:inherit;display:inline-flex}:host([behavior\$=-fullscreen]) [popover]{width:100%;height:100%;top:0;left:0}.popover::backdrop{background:var(--auro-layover-backdrop-background, transparent);backdrop-filter:var(--auro-layover-backdrop-filter, none);opacity:var(--auro-layover-backdrop-opacity, 1);transition:var(--auro-layover-backdrop-transition, none)}
|
|
182
|
-
`;const qt={disabled:false,type:"manual",behavior:"dropdown",showOnHover:false,showOnFocus:true,showOnChange:true,useHide:true,useFlip:true,offset:0,useAutoPlacement:false,placement:"bottom-start",inline:false,shown:false,hideOnNoValue:true},Ut={offset:0,placement:"bottom-start",strategy:"absolute"},Xt=["input","input-fullscreen","input-dropdown"],Gt=["dialog","dialog-fullscreen"],Jt=["dropdown"],Qt=["tooltip"];class Zt extends i$1{static register(t="auro-layover"){Kt.prototype.registerComponent(t,Zt);}constructor(){super(),this._setDefaults(qt),this._createElementRefs(),this._runtimeUtils=new Kt;}_createElementRefs(){this._popoverRef=e$1(),this._arrowElRef=e$1(),this._arrowSlotRef=e$1(),this._buttonRef=e$1(),this._positioningTargetRef=e$1(),this._triggerSlotRef=e$1();}_setDefaults(t){Object.keys(t).forEach(e=>{ void 0===this[e]&&(this[e]=t[e]);});}static get properties(){return {allowBodyScroll:{type:Boolean,reflect:true,converter:u},disabled:{type:Boolean,reflect:true},title:{type:String,reflect:false},type:{type:String,reflect:false},behavior:{type:String,reflect:true},offset:{type:Number,reflect:false},placement:{type:String,reflect:false},showOnHover:{type:Boolean,reflect:false},showOnFocus:{type:String,reflect:false,converter:u},showOnChange:{type:String,reflect:false,converter:u},hideOnNoValue:{type:String,reflect:false,converter:u},shown:{type:Boolean,reflect:true},matchWidth:{type:Boolean,reflect:false,converter:u},minInputLength:{type:Number,reflect:false},input:{type:Object,state:true},useHide:{type:String,reflect:false,converter:u},useAutoPlacement:{type:String,reflect:false,converter:u},useFlip:{type:String,reflect:false,converter:u},inline:{type:String,reflect:false,converter:u},_open:{type:Boolean,reflect:false,state:true},_hasTriggerContent:{type:Boolean,reflect:false,state:true},_currentBehaviorState:{type:String,state:true}}}static get styles(){return [Yt]}get button(){return this._buttonRef.value}get popover(){return this._popoverRef.value}get arrow(){return this._arrowElRef.value}toggle(){this._open?this.hide():this.show();}get _shouldPosition(){return ["dropdown","tooltip","input","input-dropdown"].includes(this.behavior)}show({internal:t=false}={}){this.popover&&!this.disabled&&(this._manageBehavior(this.behavior),this._matchPopoverToTriggerWidth(),this._disableBodyScroll(),this._shouldPosition?this._attachPopoverPositioner():this._detachPopoverPositioner(),this._shouldAdjustFocus&&this.popover.focus(),this._attachFocusTrap(),t||this.popover.showPopover(),this.shown=true,this._dispatchShowEvent());}hide({internal:t=false}={}){if(this.popover&&!this.disabled){if(this._resetBodyScroll(),this._detachPopoverPositioner(),this._detachFocusTrap(),t||this.popover.hidePopover(),this.shown=false,this._shouldAdjustFocus){const t=window.scrollY,e=this._triggerElInSlot||this.button;e?.focus({preventScroll:true}),window.scrollY!==t&&window.scrollTo({top:t,behavior:"instant"});}this._dispatchHideEvent();}}connectedCallback(){super.connectedCallback(),this._runtimeUtils=new Kt,this._runtimeUtils.handleComponentTagRename(this,"auro-layover");}updated(t){["input"].some(e=>t.has(e))&&this.input&&!this.behavior.match("input")&&(this.behavior="input"),["behavior","_hasTriggerContent","input"].some(e=>t.has(e))&&this._manageBehavior(this.behavior);}disconnectedCallback(){super.disconnectedCallback(),this._cleanupCurrentBehavior();}get _shouldAdjustFocus(){return ![...Xt,...Qt].includes(this.behavior)}get _dropdownOptions(){const{placement:t,offset:e,inline:n,useHide:o,useAutoPlacement:i,useFlip:r}=this;return {...Ut,arrowEl:this.arrow,placement:t,offset:e,inline:n,useHide:o,useAutoPlacement:i,useFlip:r}}get _shouldDisableBodyScroll(){return ["dialog"].includes(this.behavior)&&!this.allowBodyScroll}get _triggerSlot(){return this._triggerSlotRef.value}get _positioningTarget(){return this._positioningTargetRef.value}get _triggerElInSlot(){if(!this._triggerSlot)return;const t=this._triggerSlot.assignedNodes({flatten:true});t.length>1&&console.warn("\nAuroLayover: The input behavior requires a single trigger element to be passed to the trigger slot.\n\nExample:\n<auro-layover>\n\t<auro-button slot='trigger'>Click me</auro-button>\n</auro-layover>\n\nPassing more than one element may lead to undesireable behavior.\n");const e=t.find(t=>t.tagName);return t.length&&!e&&console.warn("\nAuroLayover: The trigger slot should not contain text nodes.\n\nExample:\n<auro-layover>\n\t<auro-button slot='trigger'>Click me</auro-button>\n</auro-layover>\n"),e??void 0}get _shouldAttachFocusTrap(){return !this._focusTrap&&!["input","input-dropdown",...Qt].includes(this.behavior)}_matchPopoverToTriggerWidth(){if(!this.matchWidth)return void(this.popover.style.width=null);const t=this._triggerElInSlot||this.button,{width:e}=t?.getBoundingClientRect()||{};this.popover.style.width=e?`${e}px`:"auto";}_calcType(t){return Xt.includes(t)?"manual":Gt.includes(t)||Jt.includes(t)?this._hasTriggerContent?"auto":"manual":Qt.includes(t)?"hint":"manual"}_manageBehavior(t=this.behavior){switch(this._currentBehaviorState=t,this._cleanupCurrentBehavior(),this.type=this._calcType(t),t){case "input":case "input-dropdown":case "input-fullscreen":this._bindToInput();break;case "dropdown":this.shown&&this._attachPopoverPositioner();break;case "tooltip":this.showOnHover=true,this._bindHover(),this.shown&&this._attachPopoverPositioner();break;case "dialog":case "dialog-fullscreen":break;default:console.warn(`AuroLayover: Unknown behavior type "${t}"`);}}_cleanupCurrentBehavior(){this._detachInput(),this._detachHover(),this._detachPopoverPositioner(),this._resetBodyScroll(),this._resetPositionStyles(),this._detachFocusTrap();}_resetPositionStyles(){this.popover&&(this.popover.style.margin=null,this.popover.style.position=null,this.popover.style.top=null,this.popover.style.left=null);}_attachFocusTrap(){this._shouldAttachFocusTrap&&(this._focusTrap=new h(this.popover,true),setTimeout(()=>{this._focusTrap&&this._focusTrap.focusFirstElement();}));}_detachFocusTrap(){this._focusTrap&&(this._focusTrap.disconnect(),this._focusTrap=null);}_attachPopoverPositioner(){this._positioningTarget&&this.popover&&(this._positioner=new zt(this._positioningTarget,this.popover,this._dropdownOptions));}_detachPopoverPositioner(){this._resetPositionStyles(),this._positioner&&(this._positioner.disconnect(),this._positioner=null);}_checkForInput(){!this.input&&this._triggerElInSlot&&this._triggerElInSlot.tagName.toLowerCase().match("input")&&(this.input=this._triggerElInSlot),this.input||setTimeout(()=>{if(!this.input)throw new Error("\nAuroLayover: The input behavior requires an input element to be passed to the trigger slot.\n\nExample:\n<auro-layover>\n\t<auro-input slot='trigger'></auro-input>\n</auro-layover>\n");this._bindToInput();},50);}_bindToInput(){this._checkForInput(),this.input&&(this.input.addEventListener("input",this._handleInputChange),this.input.addEventListener("focus",this._handleInputFocus),["input-fullscreen"].includes(this.behavior)||this.input.addEventListener("blur",this._handleInputBlur));}_detachInput(){const{input:t}=this;t&&(t.removeEventListener("focus",this._handleInputFocus),t.removeEventListener("input",this._handleInputChange),t.removeEventListener("blur",this._handleInputBlur));}_bindHover(){const t=this._triggerElInSlot;t&&(t.addEventListener("mouseover",this._handleOnHover),t.addEventListener("mouseout",this._handleOnHoverLeave));}_detachHover(){const t=this._triggerElInSlot;t&&(t.removeEventListener("mouseover",this._handleOnHover),t.removeEventListener("mouseout",this._handleOnHoverLeave));}_disableBodyScroll(){this._shouldDisableBodyScroll&&(document.documentElement.style.overflow="hidden");}_resetBodyScroll(){document.documentElement.style.overflow=null;}_dispatchShowEvent(){this.dispatchEvent(new CustomEvent("auro-layover-shown",{detail:{target:this,newState:"shown"},bubbles:true,composed:true})),this._dispatchChangeEvent({state:"shown"});}_dispatchHideEvent(){this.dispatchEvent(new CustomEvent("auro-layover-hidden",{detail:{target:this,newState:"hidden"},bubbles:true,composed:true})),this._dispatchChangeEvent({state:"hidden"});}_dispatchChangeEvent({state:t}){this.dispatchEvent(new CustomEvent("auro-layover-change",{detail:{target:this,newState:t},bubbles:true,composed:true}));}_dispatchBeforeChangeEvent({state:t}){this.dispatchEvent(new CustomEvent("auro-layover-beforechange",{detail:{target:this,newState:t},bubbles:true,composed:true}));}_inputPassesValueCheck=t=>{const{value:e}=t;return !(e&&e.length||this.hideOnNoValue)||(e&&e.length>=this.minInputLength||!this.minInputLength||this.minInputLength<=0)};_handleInputChange=t=>{if(!this.showOnChange)return false;const e=t.target;this._inputPassesValueCheck(e)?this.show():this.hide();};_handleInputFocus=t=>{if(!this.showOnFocus)return false;const e=t.target;this._inputPassesValueCheck(e)&&this.show();};_handleInputBlur=()=>{this.hide();};_handleTriggerSlotChange(){const t=this._triggerSlot.assignedNodes({flatten:true});this._hasTriggerContent=!!(t.length>0);}
|
|
181
|
+
const a=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[role="tab"]:not([disabled])','[role="link"]:not([disabled])','[role="button"]:not([disabled])','[tabindex]:not([tabindex="-1"])','[contenteditable]:not([contenteditable="false"])'],l=["auro-checkbox","auro-radio","auro-dropdown","auro-button","auro-combobox","auro-input","auro-counter","auro-select","auro-datepicker","auro-hyperlink","auro-accordion"];function c(t){const e=[],n=t=>{if(t.nodeType===Node.ELEMENT_NODE){if(function(t){const e=t.tagName.toLowerCase();return !(!l.some(n=>t.hasAttribute(n)||e===n)||t.hasAttribute("disabled")||e.match("hyperlink")&&!t.hasAttribute("href"))}(t))return void e.push(t);for(const n of a)if(t.matches?.(n)){e.push(t);break}if(t.shadowRoot&&t.shadowRoot.children&&Array.from(t.shadowRoot.children).forEach(t=>{n(t);}),"SLOT"===t.tagName){const e=t.assignedNodes({flatten:true});for(const t of e)n(t);}else t.children&&Array.from(t.children).forEach(t=>{n(t);});}};n(t);const o=[],i=new Set;for(const t of e)i.has(t)||(i.add(t),o.push(t));const r=o.filter(t=>t.hasAttribute("tabindex")&&(parseInt(t.getAttribute("tabindex"))??-1)>0);r.sort((t,e)=>parseInt(t.getAttribute("tabindex"),10)-parseInt(e.getAttribute("tabindex"),10));const s=o.filter(t=>!t.hasAttribute("tabindex")||0===(parseInt(t.getAttribute("tabindex"))??-1));return [...r,...s]}class h{constructor(t,e=false){if(!(t&&t instanceof HTMLElement))throw new Error("FocusTrap requires a valid HTMLElement.");this.container=t,this.tabDirection="forward",this.controlTabOrder=e,this._init();}_init(){"inert"in HTMLElement.prototype&&(this.container.inert=false,this.container.setAttribute("data-focus-trap-container",true)),this.container.addEventListener("keydown",this._onKeydown);}_getActiveElements(){let{activeElement:t}=document;const e=[t];for(;t?.shadowRoot?.activeElement;)e.push(t.shadowRoot.activeElement),t=t.shadowRoot.activeElement;return e}_getNextFocusIndex(t,e,n){const o=n.includes(e[0])||n.includes(this.container),i=n.includes(e[e.length-1]);if(this.controlTabOrder){let n=t+("forward"===this.tabDirection?1:-1);return n<0&&(n=e.length-1),n>=e.length&&(n=0),n}return "backward"===this.tabDirection&&o?e.length-1:"forward"===this.tabDirection&&i?0:null}_handleTabKey(t){const e=this._getFocusableElements();if(!e.length)return void console.warn("FocusTrap: No focusable elements found in the container.");this.tabDirection=t.shiftKey?"backward":"forward";const n=this._getActiveElements();let o=e.findIndex(t=>n.includes(t));-1===o&&(o=0);let i=this._getNextFocusIndex(o,e,n);null!==i&&(t.preventDefault(),e[i].focus());}_onKeydown=t=>{"Tab"===t.key&&this._handleTabKey(t);};_getFocusableElements(){return c(this.container)}focusFirstElement(){const t=this._getFocusableElements();t.length&&t[0].focus();}focusLastElement(){const t=this._getFocusableElements();t.length&&t[t.length-1].focus();}disconnect(){this.container.hasAttribute("data-focus-trap-container")&&this.container.removeAttribute("data-focus-trap-container"),this.container.removeEventListener("keydown",this._onKeydown);}}const u={fromAttribute:t=>null!=t&&(""===t||"false"!==t.toLowerCase()),toAttribute:t=>t?"":null},d=["top","right","bottom","left"],f=["start","end"],p=d.reduce((t,e)=>t.concat(e,e+"-"+f[0],e+"-"+f[1]),[]),g=Math.min,m=Math.max,v=Math.round,w=Math.floor,y=t=>({x:t,y:t}),b={left:"right",right:"left",bottom:"top",top:"bottom"},_={start:"end",end:"start"};function x(t,e,n){return m(t,g(e,n))}function E(t,e){return "function"==typeof t?t(e):t}function T(t){return t.split("-")[0]}function S(t){return t.split("-")[1]}function R(t){return "y"===t?"height":"width"}const L=new Set(["top","bottom"]);function C(t){return L.has(T(t))?"y":"x"}function P(t){return "x"===C(t)?"y":"x"}function A(t,e,n){ void 0===n&&(n=false);const o=S(t),i=P(t),r=R(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=D(s)),[s,D(s)]}function O(t){return t.replace(/start|end/g,t=>_[t])}const k=["left","right"],F=["right","left"],B=["top","bottom"],H=["bottom","top"];function I(t,e,n,o){const i=S(t);let r=function(t,e,n){switch(t){case "top":case "bottom":return n?e?F:k:e?k:F;case "left":case "right":return e?B:H;default:return []}}(T(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(O)))),r}function D(t){return t.replace(/left|right|bottom|top/g,t=>b[t])}function N(t){return "number"!=typeof t?function(t){return {top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function $(t){const{x:e,y:n,width:o,height:i}=t;return {width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function V(t,e,n){let{reference:o,floating:i}=t;const r=C(e),s=P(e),a=R(s),l=T(e),c="y"===r,h=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,d=o[a]/2-i[a]/2;let f;switch(l){case "top":f={x:h,y:o.y-i.height};break;case "bottom":f={x:h,y:o.y+o.height};break;case "right":f={x:o.x+o.width,y:u};break;case "left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y};}switch(S(e)){case "start":f[s]-=d*(n&&c?-1:1);break;case "end":f[s]+=d*(n&&c?-1:1);}return f}async function W(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=false,padding:f=0}=E(e,t),p=N(f),g=a[d?"floating"===u?"reference":"floating":u],m=$(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),v="floating"===u?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),y=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},b=$(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return {top:(m.top-b.top+p.top)/y.y,bottom:(b.bottom-m.bottom+p.bottom)/y.y,left:(m.left-b.left+p.left)/y.x,right:(b.right-m.right+p.right)/y.x}}function M(t,e){return {top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function j(t){return d.some(e=>t[e]>=0)}function z(t){const e=g(...t.map(t=>t.left)),n=g(...t.map(t=>t.top));return {x:e,y:n,width:m(...t.map(t=>t.right))-e,height:m(...t.map(t=>t.bottom))-n}}const K=new Set(["left","top"]);function Y(){return "undefined"!=typeof window}function q(t){return G(t)?(t.nodeName||"").toLowerCase():"#document"}function U(t){var e;return (null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function X(t){var e;return null==(e=(G(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function G(t){return !!Y()&&(t instanceof Node||t instanceof U(t).Node)}function J(t){return !!Y()&&(t instanceof Element||t instanceof U(t).Element)}function Q(t){return !!Y()&&(t instanceof HTMLElement||t instanceof U(t).HTMLElement)}function Z(t){return !(!Y()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof U(t).ShadowRoot)}const tt=new Set(["inline","contents"]);function et(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=ft(t);return /auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!tt.has(i)}const nt=new Set(["table","td","th"]);function ot(t){return nt.has(q(t))}const it=[":popover-open",":modal"];function rt(t){return it.some(e=>{try{return t.matches(e)}catch(t){return false}})}const st=["transform","translate","scale","rotate","perspective"],at=["transform","translate","scale","rotate","perspective","filter"],lt=["paint","layout","strict","content"];function ct(t){const e=ht(),n=J(t)?ft(t):t;return st.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||at.some(t=>(n.willChange||"").includes(t))||lt.some(t=>(n.contain||"").includes(t))}function ht(){return !("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ut=new Set(["html","body","#document"]);function dt(t){return ut.has(q(t))}function ft(t){return U(t).getComputedStyle(t)}function pt(t){return J(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function gt(t){if("html"===q(t))return t;const e=t.assignedSlot||t.parentNode||Z(t)&&t.host||X(t);return Z(e)?e.host:e}function mt(t){const e=gt(t);return dt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Q(e)&&et(e)?e:mt(e)}function vt(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=true);const i=mt(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=U(i);if(r){const t=wt(s);return e.concat(s,s.visualViewport||[],et(i)?i:[],t&&n?vt(t):[])}return e.concat(i,vt(i,[],n))}function wt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yt(t){const e=ft(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=Q(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,a=v(n)!==r||v(o)!==s;return a&&(n=r,o=s),{width:n,height:o,$:a}}function bt(t){return J(t)?t:t.contextElement}function _t(t){const e=bt(t);if(!Q(e))return y(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=yt(e);let s=(r?v(n.width):n.width)/o,a=(r?v(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const xt=y(0);function Et(t){const e=U(t);return ht()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:xt}function Tt(t,e,n,o){ void 0===e&&(e=false),void 0===n&&(n=false);const i=t.getBoundingClientRect(),r=bt(t);let s=y(1);e&&(o?J(o)&&(s=_t(o)):s=_t(t));const a=function(t,e,n){return void 0===e&&(e=false),!(!n||e&&n!==U(t))&&e}(r,n,o)?Et(r):y(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,h=i.width/s.x,u=i.height/s.y;if(r){const t=U(r),e=o&&J(o)?U(o):o;let n=t,i=wt(n);for(;i&&o&&e!==n;){const t=_t(i),e=i.getBoundingClientRect(),o=ft(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,u*=t.y,l+=r,c+=s,n=U(i),i=wt(n);}}return $({width:h,height:u,x:l,y:c})}function St(t,e){const n=pt(t).scrollLeft;return e?e.left+n:Tt(X(t)).left+n}function Rt(t,e,n){ void 0===n&&(n=false);const o=t.getBoundingClientRect();return {x:o.left+e.scrollLeft-(n?0:St(t,o)),y:o.top+e.scrollTop}}const Lt=new Set(["absolute","fixed"]);function Ct(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=U(t),o=X(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,a=0,l=0;if(i){r=i.width,s=i.height;const t=ht();(!t||t&&"fixed"===e)&&(a=i.offsetLeft,l=i.offsetTop);}return {width:r,height:s,x:a,y:l}}(t,n);else if("document"===e)o=function(t){const e=X(t),n=pt(t),o=t.ownerDocument.body,i=m(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=m(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+St(t);const a=-n.scrollTop;return "rtl"===ft(o).direction&&(s+=m(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}(X(t));else if(J(e))o=function(t,e){const n=Tt(t,true,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=Q(t)?_t(t):y(1);return {width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else {const n=Et(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height};}return $(o)}function Pt(t,e){const n=gt(t);return !(n===e||!J(n)||dt(n))&&("fixed"===ft(n).position||Pt(n,e))}function At(t,e,n){const o=Q(e),i=X(e),r="fixed"===n,s=Tt(t,true,r,e);let a={scrollLeft:0,scrollTop:0};const l=y(0);function c(){l.x=St(i);}if(o||!o&&!r)if(("body"!==q(e)||et(i))&&(a=pt(e)),o){const t=Tt(e,true,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop;}else i&&c();r&&!o&&i&&c();const h=!i||o||r?y(0):Rt(i,a);return {x:s.left+a.scrollLeft-l.x-h.x,y:s.top+a.scrollTop-l.y-h.y,width:s.width,height:s.height}}function Ot(t){return "static"===ft(t).position}function kt(t,e){if(!Q(t)||"fixed"===ft(t).position)return null;if(e)return e(t);let n=t.offsetParent;return X(t)===n&&(n=n.ownerDocument.body),n}function Ft(t,e){const n=U(t);if(rt(t))return n;if(!Q(t)){let e=gt(t);for(;e&&!dt(e);){if(J(e)&&!Ot(e))return e;e=gt(e);}return n}let o=kt(t,e);for(;o&&ot(o)&&Ot(o);)o=kt(o,e);return o&&dt(o)&&Ot(o)&&!ct(o)?n:o||function(t){let e=gt(t);for(;Q(e)&&!dt(e);){if(ct(e))return e;if(rt(e))return null;e=gt(e);}return null}(t)||n}const Bt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=X(o),a=!!e&&rt(e.floating);if(o===s||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=y(1);const h=y(0),u=Q(o);if((u||!u&&!r)&&(("body"!==q(o)||et(s))&&(l=pt(o)),Q(o))){const t=Tt(o);c=_t(o),h.x=t.x+o.clientLeft,h.y=t.y+o.clientTop;}const d=!s||u||r?y(0):Rt(s,l,true);return {width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+h.x+d.x,y:n.y*c.y-l.scrollTop*c.y+h.y+d.y}},getDocumentElement:X,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?rt(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=vt(t,[],false).filter(t=>J(t)&&"body"!==q(t)),i=null;const r="fixed"===ft(t).position;let s=r?gt(t):t;for(;J(s)&&!dt(s);){const e=ft(s),n=ct(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&Lt.has(i.position)||et(s)&&!n&&Pt(t,s))?o=o.filter(t=>t!==s):i=e,s=gt(s);}return e.set(t,o),o}(e,this._c):[].concat(n),o],s=r[0],a=r.reduce((t,n)=>{const o=Ct(e,n,i);return t.top=m(o.top,t.top),t.right=g(o.right,t.right),t.bottom=g(o.bottom,t.bottom),t.left=m(o.left,t.left),t},Ct(e,s,i));return {width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ft,getElementRects:async function(t){const e=this.getOffsetParent||Ft,n=this.getDimensions,o=await n(t.floating);return {reference:At(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=yt(t);return {width:e,height:n}},getScale:_t,isElement:J,isRTL:function(t){return "rtl"===ft(t).direction}};function Ht(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function It(t,e,n,o){ void 0===o&&(o={});const{ancestorScroll:i=true,ancestorResize:r=true,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=false}=o,c=bt(t),h=i||r?[...c?vt(c):[],...vt(e)]:[];h.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:true}),r&&t.addEventListener("resize",n);});const u=c&&a?function(t,e){let n,o=null;const i=X(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null;}return function s(a,l){ void 0===a&&(a=false),void 0===l&&(l=1),r();const c=t.getBoundingClientRect(),{left:h,top:u,width:d,height:f}=c;if(a||e(),!d||!f)return;const p={rootMargin:-w(u)+"px "+-w(i.clientWidth-(h+d))+"px "+-w(i.clientHeight-(u+f))+"px "+-w(h)+"px",threshold:m(0,g(1,l))||1};let v=true;function y(e){const o=e[0].intersectionRatio;if(o!==l){if(!v)return s();o?s(false,o):n=setTimeout(()=>{s(false,1e-7);},1e3);}1!==o||Ht(c,t.getBoundingClientRect())||s(),v=false;}try{o=new IntersectionObserver(y,{...p,root:i.ownerDocument});}catch(t){o=new IntersectionObserver(y,p);}o.observe(t);}(true),r}(c,n):null;let d,f=-1,p=null;s&&(p=new ResizeObserver(t=>{let[o]=t;o&&o.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e);})),n();}),c&&!l&&p.observe(c),p.observe(e));let v=l?Tt(t):null;return l&&function e(){const o=Tt(t);v&&!Ht(v,o)&&n();v=o,d=requestAnimationFrame(e);}(),n(),()=>{var t;h.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n);}),null==u||u(),null==(t=p)||t.disconnect(),p=null,l&&cancelAnimationFrame(d);}}const Dt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:a}=e,l=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=T(n),a=S(n),l="y"===C(n),c=K.has(s)?-1:1,h=r&&l?-1:1,u=E(e,t);let{mainAxis:d,crossAxis:f,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*h,y:d*c}:{x:d*c,y:f*h}}(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},Nt=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:r,middlewareData:s,placement:a,platform:l,elements:c}=e,{crossAxis:h=false,alignment:u,allowedPlacements:d=p,autoAlignment:f=true,...g}=E(t,e),m=void 0!==u||d===p?function(t,e,n){return (t?[...n.filter(e=>S(e)===t),...n.filter(e=>S(e)!==t)]:n.filter(t=>T(t)===t)).filter(n=>!t||S(n)===t||!!e&&O(n)!==n)}(u||null,f,d):d,v=await W(e,g),w=(null==(n=s.autoPlacement)?void 0:n.index)||0,y=m[w];if(null==y)return {};const b=A(y,r,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(a!==y)return {reset:{placement:m[0]}};const _=[v[T(y)],v[b[0]],v[b[1]]],x=[...(null==(o=s.autoPlacement)?void 0:o.overflows)||[],{placement:y,overflows:_}],R=m[w+1];if(R)return {data:{index:w+1,overflows:x},reset:{placement:R}};const L=x.map(t=>{const e=S(t.placement);return [t.placement,e&&h?t.overflows.slice(0,2).reduce((t,e)=>t+e,0):t.overflows[0],t.overflows]}).sort((t,e)=>t[1]-e[1]),C=(null==(i=L.filter(t=>t[2].slice(0,S(t[0])?2:3).every(t=>t<=0))[0])?void 0:i[0])||L[0][0];return C!==a?{data:{index:w+1,overflows:x},reset:{placement:C}}:{}}}},$t=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=true,crossAxis:u=true,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=true,...m}=E(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return {};const v=T(i),w=C(a),y=T(a)===a,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=d||(y||!g?[D(a)]:function(t){const e=D(t);return [O(t),e,O(e)]}(a)),x="none"!==p;!d&&x&&_.push(...I(a,g,p,b));const S=[a,..._],R=await W(e,m),L=[];let P=(null==(o=r.flip)?void 0:o.overflows)||[];if(h&&L.push(R[v]),u){const t=A(i,s,b);L.push(R[t[0]],R[t[1]]);}if(P=[...P,{placement:i,overflows:L}],!L.every(t=>t<=0)){var k,F;const t=((null==(k=r.flip)?void 0:k.index)||0)+1,e=S[t];if(e){if(!("alignment"===u&&w!==C(e))||P.every(t=>t.overflows[0]>0&&C(t.placement)===w))return {data:{index:t,overflows:P},reset:{placement:e}}}let n=null==(F=P.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:F.placement;if(!n)switch(f){case "bestFit":{var B;const t=null==(B=P.filter(t=>{if(x){const e=C(t.placement);return e===w||"y"===e}return true}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:B[0];t&&(n=t);break}case "initialPlacement":n=a;}if(i!==n)return {reset:{placement:n}}}return {}}}},Vt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=E(t,e);switch(o){case "referenceHidden":{const t=M(await W(e,{...i,elementContext:"reference"}),n.reference);return {data:{referenceHiddenOffsets:t,referenceHidden:j(t)}}}case "escaped":{const t=M(await W(e,{...i,altBoundary:true}),n.floating);return {data:{escapedOffsets:t,escaped:j(t)}}}default:return {}}}}},Wt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:h=0}=E(t,e)||{};if(null==c)return {};const u=N(h),d={x:n,y:o},f=P(i),p=R(f),m=await s.getDimensions(c),v="y"===f,w=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",_=r.reference[p]+r.reference[f]-d[f]-r.floating[p],T=d[f]-r.reference[f],L=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=L?L[b]:0;C&&await(null==s.isElement?void 0:s.isElement(L))||(C=a.floating[b]||r.floating[p]);const A=_/2-T/2,O=C/2-m[p]/2-1,k=g(u[w],O),F=g(u[y],O),B=k,H=C-m[p]-F,I=C/2-m[p]/2+A,D=x(B,I,H),$=!l.arrow&&null!=S(i)&&I!==D&&r.reference[p]/2-(I<B?k:F)-m[p]/2<0,V=$?I<B?I-B:I-H:0;return {[f]:d[f]+V,data:{[f]:D,centerOffset:I-D-V,...$&&{alignmentOffset:V}},reset:$}}}),Mt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:a=2,x:l,y:c}=E(t,e),h=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),u=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i;}return n.map(t=>$(z(t)))}(h),d=$(z(h)),f=N(a);const p=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=l&&null!=c)return u.find(t=>l>t.left-f.left&&l<t.right+f.right&&c>t.top-f.top&&c<t.bottom+f.bottom)||d;if(u.length>=2){if("y"===C(n)){const t=u[0],e=u[u.length-1],o="top"===T(n),i=t.top,r=e.bottom,s=o?t.left:e.left,a=o?t.right:e.right;return {top:i,bottom:r,left:s,right:a,width:a-s,height:r-i,x:s,y:i}}const t="left"===T(n),e=m(...u.map(t=>t.right)),o=g(...u.map(t=>t.left)),i=u.filter(n=>t?n.left===o:n.right===e),r=i[0].top,s=i[i.length-1].bottom;return {top:r,bottom:s,left:o,right:e,width:e-o,height:s-r,x:o,y:r}}return d}},floating:o.floating,strategy:s});return i.reference.x!==p.reference.x||i.reference.y!==p.reference.y||i.reference.width!==p.reference.width||i.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}},jt=(t,e,n)=>{const o=new Map,i={platform:Bt,...n},r={...i.platform,_c:o};return (async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:u}=V(c,o,l),d=o,f={},p=0;for(let n=0;n<a.length;n++){const{name:r,fn:g}=a[n],{x:m,y:v,data:w,reset:y}=await g({x:h,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:f,rects:c,platform:s,elements:{reference:t,floating:e}});h=null!=m?m:h,u=null!=v?v:u,f={...f,[r]:{...f[r],...w}},y&&p<=50&&(p++,"object"==typeof y&&(y.placement&&(d=y.placement),y.rects&&(c=true===y.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):y.rects),({x:h,y:u}=V(c,d,l))),n=-1);}return {x:h,y:u,placement:d,strategy:i,middlewareData:f}})(t,e,{...i,platform:r})};class zt{constructor(t,e,n={}){this.referenceEl=t,this.floatingEl=e,this.options=n,this.setFloaterStyles(),false!==this.options.autoStart&&this.start(),this.cleanup=null;}setFloaterStyles(){if(!this.floatingEl)return;Object.assign(this.floatingEl.style,{position:"absolute",margin:"0"});}updatePosition(){if(!this.referenceEl||!this.floatingEl)return;const t=[].concat(this.options.offset&&0!==this.options.offset?Dt(this.options.offset):[],this.options.arrowEl?Wt({element:this.options.arrowEl}):[],this.options.useFlip?$t():[],this.options.useAutoPlacement?Nt():[],this.options.useHide?Vt():[],this.options.inline?Mt():[]);jt(this.referenceEl,this.floatingEl,{strategy:this.options.strategy||"absolute",placement:this.options.placement||"bottom-start",middleware:t}).then(({x:t,y:e,middlewareData:n})=>{Object.assign(this.floatingEl?.style??{},{visibility:n.hide?.referenceHidden?"hidden":"visible",left:`${t}px`,top:`${e}px`});});}start(){return this.cleanup&&this.cleanup(),this.cleanup=It(this.referenceEl,this.floatingEl,this.updatePosition.bind(this)),this.cleanup}stop(){this.cleanup&&(this.cleanup(),this.cleanup=null);}disconnect(){this.stop(),this.referenceEl=null,this.floatingEl=null;}}class Kt{registerComponent(t,e){customElements.get(t)||customElements.define(t,class extends e{});}closestElement(t,e=this,n=(e,o=e&&e.closest(t))=>e&&e!==document&&e!==window?o||n(e.getRootNode().host):null){return n(e)}handleComponentTagRename(t,e){const n=e.toLowerCase();t.tagName.toLowerCase()!==n&&t.setAttribute(n,true);}elementMatch(t,e){const n=e.toLowerCase();return t.tagName.toLowerCase()===n||t.hasAttribute(n)}}var Yt=i$3`.popover,.popover-trigger{outline:inherit;background:inherit;border:inherit;padding:0;overflow:visible}:host(:not([shown])) .popover{opacity:0;pointer-events:none;position:absolute}.popover .popover-arrow{position:absolute}.popover .popover-arrow.direction-down{bottom:0;transform:translateY(100%)}.popover .popover-arrow.direction-up{top:0;transform:translateY(-100%)}.popover .popover-arrow.direction-left{left:0;transform:translate(-100%)}.popover .popover-arrow.direction-right{right:0;transform:translate(100%)}.popover-trigger{margin:0;width:inherit;font-size:inherit;text-align:inherit;font:inherit;display:inline-flex}:host([behavior\$=-fullscreen]) [popover]{width:100%;height:100%;top:0;left:0}.popover::backdrop{background:var(--auro-layover-backdrop-background, transparent);backdrop-filter:var(--auro-layover-backdrop-filter, none);opacity:var(--auro-layover-backdrop-opacity, 1);transition:var(--auro-layover-backdrop-transition, none)}
|
|
182
|
+
`;const qt={disabled:false,type:"manual",behavior:"dropdown",showOnHover:false,showOnFocus:true,showOnChange:true,useHide:true,useFlip:true,offset:0,useAutoPlacement:false,placement:"bottom-start",inline:false,shown:false,hideOnNoValue:true},Ut={offset:0,placement:"bottom-start",strategy:"absolute"},Xt=["input","input-fullscreen","input-dropdown"],Gt=["dialog","dialog-fullscreen"],Jt=["dropdown"],Qt=["tooltip"];class Zt extends i$1{static register(t="auro-layover"){Kt.prototype.registerComponent(t,Zt);}constructor(){super(),this._setDefaults(qt),this._createElementRefs(),this._runtimeUtils=new Kt;}_createElementRefs(){this._popoverRef=e$1(),this._arrowElRef=e$1(),this._arrowSlotRef=e$1(),this._buttonRef=e$1(),this._positioningTargetRef=e$1(),this._triggerSlotRef=e$1();}_setDefaults(t){Object.keys(t).forEach(e=>{ void 0===this[e]&&(this[e]=t[e]);});}static get properties(){return {allowBodyScroll:{type:Boolean,reflect:true,converter:u},disabled:{type:Boolean,reflect:true},title:{type:String,reflect:false},type:{type:String,reflect:false},behavior:{type:String,reflect:true},offset:{type:Number,reflect:false},placement:{type:String,reflect:false},showOnHover:{type:Boolean,reflect:false},showOnFocus:{type:String,reflect:false,converter:u},showOnChange:{type:String,reflect:false,converter:u},hideOnNoValue:{type:String,reflect:false,converter:u},shown:{type:Boolean,reflect:true},matchWidth:{type:Boolean,reflect:false,converter:u},minInputLength:{type:Number,reflect:false},input:{type:Object,state:true},useHide:{type:String,reflect:false,converter:u},useAutoPlacement:{type:String,reflect:false,converter:u},useFlip:{type:String,reflect:false,converter:u},inline:{type:String,reflect:false,converter:u},_open:{type:Boolean,reflect:false,state:true},_hasTriggerContent:{type:Boolean,reflect:false,state:true},_currentBehaviorState:{type:String,state:true}}}static get styles(){return [Yt]}get button(){return this._buttonRef.value}get popover(){return this._popoverRef.value}get arrow(){return this._arrowElRef.value}toggle(){this._open?this.hide():this.show();}get _shouldPosition(){return ["dropdown","tooltip","input","input-dropdown"].includes(this.behavior)}show({internal:t=false}={}){this.popover&&!this.disabled&&(this._manageBehavior(this.behavior),this._matchPopoverToTriggerWidth(),this._disableBodyScroll(),this._shouldPosition?this._attachPopoverPositioner():this._detachPopoverPositioner(),this._shouldAdjustFocus&&this.popover.focus(),this._attachFocusTrap(),t||this.popover.showPopover(),this.shown=true,this._dispatchShowEvent());}hide({internal:t=false}={}){if(this.popover&&!this.disabled){if(this._resetBodyScroll(),this._detachPopoverPositioner(),this._detachFocusTrap(),t||this.popover.hidePopover(),this.shown=false,this._shouldAdjustFocus){const t=window.scrollY,e=this._triggerElInSlot||this.button;e?.focus({preventScroll:true}),window.scrollY!==t&&window.scrollTo({top:t,behavior:"instant"});}this._dispatchHideEvent();}}connectedCallback(){super.connectedCallback(),this._runtimeUtils=new Kt,this._runtimeUtils.handleComponentTagRename(this,"auro-layover");}updated(t){["input"].some(e=>t.has(e))&&this.input&&!this.behavior.match("input")&&(this.behavior="input"),["behavior","_hasTriggerContent","input"].some(e=>t.has(e))&&this._manageBehavior(this.behavior);}disconnectedCallback(){super.disconnectedCallback(),this._cleanupCurrentBehavior();}get _shouldAdjustFocus(){return ![...Xt,...Qt].includes(this.behavior)}get _dropdownOptions(){const{placement:t,offset:e,inline:n,useHide:o,useAutoPlacement:i,useFlip:r}=this;return {...Ut,arrowEl:this.arrow,placement:t,offset:e,inline:n,useHide:o,useAutoPlacement:i,useFlip:r}}get _shouldDisableBodyScroll(){return ["dialog"].includes(this.behavior)&&!this.allowBodyScroll}get _triggerSlot(){return this._triggerSlotRef.value}get _positioningTarget(){return this._positioningTargetRef.value}get _triggerElInSlot(){if(!this._triggerSlot)return;const t=this._triggerSlot.assignedNodes({flatten:true});t.length>1&&console.warn("\nAuroLayover: The input behavior requires a single trigger element to be passed to the trigger slot.\n\nExample:\n<auro-layover>\n\t<auro-button slot='trigger'>Click me</auro-button>\n</auro-layover>\n\nPassing more than one element may lead to undesireable behavior.\n");const e=t.find(t=>t.tagName);return t.length&&!e&&console.warn("\nAuroLayover: The trigger slot should not contain text nodes.\n\nExample:\n<auro-layover>\n\t<auro-button slot='trigger'>Click me</auro-button>\n</auro-layover>\n"),e??void 0}get _shouldAttachFocusTrap(){return !this._focusTrap&&!["input","input-dropdown",...Qt].includes(this.behavior)}_matchPopoverToTriggerWidth(){if(!this.matchWidth)return void(this.popover.style.width=null);const t=this._triggerElInSlot||this.button,{width:e}=t?.getBoundingClientRect()||{};this.popover.style.width=e?`${e}px`:"auto";}_calcType(t){return Xt.includes(t)?"manual":Gt.includes(t)||Jt.includes(t)?this._hasTriggerContent?"auto":"manual":Qt.includes(t)?"hint":"manual"}_manageBehavior(t=this.behavior){switch(this._currentBehaviorState=t,this._cleanupCurrentBehavior(),this.type=this._calcType(t),t){case "input":case "input-dropdown":case "input-fullscreen":this._bindToInput();break;case "dropdown":this.shown&&this._attachPopoverPositioner();break;case "tooltip":this.showOnHover=true,this._bindHover(),this.shown&&this._attachPopoverPositioner();break;case "dialog":case "dialog-fullscreen":break;default:console.warn(`AuroLayover: Unknown behavior type "${t}"`);}}_cleanupCurrentBehavior(){this._detachInput(),this._detachHover(),this._detachPopoverPositioner(),this._resetBodyScroll(),this._resetPositionStyles(),this._detachFocusTrap();}_resetPositionStyles(){this.popover&&(this.popover.style.margin=null,this.popover.style.position=null,this.popover.style.top=null,this.popover.style.left=null);}_attachFocusTrap(){this._shouldAttachFocusTrap&&(this._focusTrap=new h(this.popover,true),setTimeout(()=>{this._focusTrap&&this._focusTrap.focusFirstElement();}));}_detachFocusTrap(){this._focusTrap&&(this._focusTrap.disconnect(),this._focusTrap=null);}_attachPopoverPositioner(){this._positioningTarget&&this.popover&&(this._positioner=new zt(this._positioningTarget,this.popover,this._dropdownOptions));}_detachPopoverPositioner(){this._resetPositionStyles(),this._positioner&&(this._positioner.disconnect(),this._positioner=null);}_checkForInput(){!this.input&&this._triggerElInSlot&&this._triggerElInSlot.tagName.toLowerCase().match("input")&&(this.input=this._triggerElInSlot),this.input||setTimeout(()=>{if(!this.input)throw new Error("\nAuroLayover: The input behavior requires an input element to be passed to the trigger slot.\n\nExample:\n<auro-layover>\n\t<auro-input slot='trigger'></auro-input>\n</auro-layover>\n");this._bindToInput();},50);}_bindToInput(){this._checkForInput(),this.input&&(this.input.addEventListener("input",this._handleInputChange),this.input.addEventListener("focus",this._handleInputFocus),["input-fullscreen"].includes(this.behavior)||this.input.addEventListener("blur",this._handleInputBlur));}_detachInput(){const{input:t}=this;t&&(t.removeEventListener("focus",this._handleInputFocus),t.removeEventListener("input",this._handleInputChange),t.removeEventListener("blur",this._handleInputBlur));}_bindHover(){const t=this._triggerElInSlot;t&&(t.addEventListener("mouseover",this._handleOnHover),t.addEventListener("mouseout",this._handleOnHoverLeave));}_detachHover(){const t=this._triggerElInSlot;t&&(t.removeEventListener("mouseover",this._handleOnHover),t.removeEventListener("mouseout",this._handleOnHoverLeave));}_disableBodyScroll(){this._shouldDisableBodyScroll&&(document.documentElement.style.overflow="hidden");}_resetBodyScroll(){document.documentElement.style.overflow=null;}_dispatchShowEvent(){this.dispatchEvent(new CustomEvent("auro-layover-shown",{detail:{target:this,newState:"shown"},bubbles:true,composed:true})),this._dispatchChangeEvent({state:"shown"});}_dispatchHideEvent(){this.dispatchEvent(new CustomEvent("auro-layover-hidden",{detail:{target:this,newState:"hidden"},bubbles:true,composed:true})),this._dispatchChangeEvent({state:"hidden"});}_dispatchChangeEvent({state:t}){this.dispatchEvent(new CustomEvent("auro-layover-change",{detail:{target:this,newState:t},bubbles:true,composed:true}));}_dispatchBeforeChangeEvent({state:t}){this.dispatchEvent(new CustomEvent("auro-layover-beforechange",{detail:{target:this,newState:t},bubbles:true,composed:true}));}_inputPassesValueCheck=t=>{const{value:e}=t;return !(e&&e.length||this.hideOnNoValue)||(e&&e.length>=this.minInputLength||!this.minInputLength||this.minInputLength<=0)};_handleInputChange=t=>{if(!this.showOnChange)return false;const e=t.target;this._inputPassesValueCheck(e)?this.show():this.hide();};_handleInputFocus=t=>{if(!this.showOnFocus)return false;const e=t.target;this._inputPassesValueCheck(e)&&this.show();};_handleInputBlur=()=>{this.hide();};_handleTriggerSlotChange(){const t=this._triggerSlot.assignedNodes({flatten:true});this._hasTriggerContent=!!(t.length>0);}_handlePopoverBeforeToggle(t){const e="open"===t.newState;if(e)return this._dispatchBeforeChangeEvent({state:"shown"}),void this.show({internal:true});if(!e){if(window.closingLayover&&window.closingLayover!==this)return t.preventDefault(),t.stopPropagation(),void this.popover.showPopover();window.closingLayover=this,this._dispatchBeforeChangeEvent({state:"hidden"}),this.hide({internal:true});}}_handlePopoverToggle(t){const e="open"===t.newState,n=window.closingLayover===this;e||(n||this.popover.showPopover(),n&&setTimeout(()=>{window.closingLayover=null;}));}_handleOnHover=()=>{this.showOnHover&&this.show();};_handleOnHoverLeave=()=>{this.showOnHover&&this.hide();};_renderTriggerSlot(){return x$1`
|
|
183
183
|
<span class="popover-trigger" ${n(this._positioningTargetRef)}>
|
|
184
184
|
<slot
|
|
185
185
|
name="trigger"
|
|
@@ -208,7 +208,8 @@ const a=["a[href]","button:not([disabled])","textarea:not([disabled])","input:no
|
|
|
208
208
|
class="popover"
|
|
209
209
|
role="dialog"
|
|
210
210
|
aria-label="${this.title}"
|
|
211
|
-
@
|
|
211
|
+
@toggle=${this._handlePopoverToggle.bind(this)}
|
|
212
|
+
@beforetoggle=${this._handlePopoverBeforeToggle.bind(this)}
|
|
212
213
|
tabindex="-1"
|
|
213
214
|
>
|
|
214
215
|
<div
|
|
@@ -225,7 +226,7 @@ const a=["a[href]","button:not([disabled])","textarea:not([disabled])","input:no
|
|
|
225
226
|
${this._renderPopover()}
|
|
226
227
|
`}}
|
|
227
228
|
|
|
228
|
-
var layoverVersion = '0.0.0-pr1.
|
|
229
|
+
var layoverVersion = '0.0.0-pr1.17';
|
|
229
230
|
|
|
230
231
|
var styleCss = i$3`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.util_insetNone{padding:0}.util_insetXxxs{padding:.125rem}.util_insetXxxs--stretch{padding:.25rem .125rem}.util_insetXxxs--squish{padding:0 .125rem}.util_insetXxs{padding:.25rem}.util_insetXxs--stretch{padding:.375rem .25rem}.util_insetXxs--squish{padding:.125rem .25rem}.util_insetXs{padding:.5rem}.util_insetXs--stretch{padding:.75rem .5rem}.util_insetXs--squish{padding:.25rem .5rem}.util_insetSm{padding:.75rem}.util_insetSm--stretch{padding:1.125rem .75rem}.util_insetSm--squish{padding:.375rem .75rem}.util_insetMd{padding:1rem}.util_insetMd--stretch{padding:1.5rem 1rem}.util_insetMd--squish{padding:.5rem 1rem}.util_insetLg{padding:1.5rem}.util_insetLg--stretch{padding:2.25rem 1.5rem}.util_insetLg--squish{padding:.75rem 1.5rem}.util_insetXl{padding:2rem}.util_insetXl--stretch{padding:3rem 2rem}.util_insetXl--squish{padding:1rem 2rem}.util_insetXxl{padding:3rem}.util_insetXxl--stretch{padding:4.5rem 3rem}.util_insetXxl--squish{padding:1.5rem 3rem}.util_insetXxxl{padding:4rem}.util_insetXxxl--stretch{padding:6rem 4rem}.util_insetXxxl--squish{padding:2rem 4rem}::slotted(*){white-space:normal}::slotted(*:hover){cursor:pointer}:host([removeSpace]) .popover{margin:calc(-1*(var(--ds-size-50, 0.25rem) + 1px)) 0 !important}.arrow{width:0;height:0;position:relative;border-style:solid}.arrow[data-placement=top]{border-width:var(--ds-size-150, 0.75rem) calc(var(--ds-size-150, 0.75rem)/2 + .5px) 0 calc(var(--ds-size-150, 0.75rem)/2 + .5px);border-color:var(--ds-auro-popover-container-color) transparent transparent transparent}.arrow[data-placement=bottom]{border-width:0 calc(var(--ds-size-150, 0.75rem)/2 + .5px) var(--ds-size-150, 0.75rem) calc(var(--ds-size-150, 0.75rem)/2 + .5px);border-color:transparent transparent var(--ds-auro-popover-container-color) transparent}.arrow[data-placement=left]{border-width:calc(var(--ds-size-150, 0.75rem)/2 + .5px) 0 calc(var(--ds-size-150, 0.75rem)/2 + .5px) var(--ds-size-150, 0.75rem);border-color:transparent transparent transparent var(--ds-auro-popover-container-color)}.arrow[data-placement=right]{border-width:calc(var(--ds-size-150, 0.75rem)/2 + .5px) var(--ds-size-150, 0.75rem) calc(var(--ds-size-150, 0.75rem)/2 + .5px) 0;border-color:transparent var(--ds-auro-popover-container-color) transparent transparent}.popover{display:inline-block;max-width:calc(100% - var(--ds-size-400, 2rem));border-radius:var(--ds-border-radius, 0.375rem)}@media screen and (min-width: 576px){.popover{max-width:50%}}@media screen and (min-width: 768px){.popover{max-width:40%}}@media screen and (min-width: 1024px){.popover{max-width:27rem}}`;
|
|
231
232
|
|
|
@@ -178,8 +178,8 @@ class AuroLibraryRuntimeUtils {
|
|
|
178
178
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
179
179
|
*/const o=o=>o??E$1;
|
|
180
180
|
|
|
181
|
-
const a=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[role="tab"]:not([disabled])','[role="link"]:not([disabled])','[role="button"]:not([disabled])','[tabindex]:not([tabindex="-1"])','[contenteditable]:not([contenteditable="false"])'],l=["auro-checkbox","auro-radio","auro-dropdown","auro-button","auro-combobox","auro-input","auro-counter","auro-select","auro-datepicker","auro-hyperlink","auro-accordion"];function c(t){const e=[],n=t=>{if(t.nodeType===Node.ELEMENT_NODE){if(function(t){const e=t.tagName.toLowerCase();return !(!l.some(n=>t.hasAttribute(n)||e===n)||t.hasAttribute("disabled")||e.match("hyperlink")&&!t.hasAttribute("href"))}(t))return void e.push(t);for(const n of a)if(t.matches?.(n)){e.push(t);break}if(t.shadowRoot&&t.shadowRoot.children&&Array.from(t.shadowRoot.children).forEach(t=>{n(t);}),"SLOT"===t.tagName){const e=t.assignedNodes({flatten:true});for(const t of e)n(t);}else t.children&&Array.from(t.children).forEach(t=>{n(t);});}};n(t);const o=[],i=new Set;for(const t of e)i.has(t)||(i.add(t),o.push(t));const r=o.filter(t=>t.hasAttribute("tabindex")&&(parseInt(t.getAttribute("tabindex"))??-1)>0);r.sort((t,e)=>parseInt(t.getAttribute("tabindex"),10)-parseInt(e.getAttribute("tabindex"),10));const s=o.filter(t=>!t.hasAttribute("tabindex")||0===(parseInt(t.getAttribute("tabindex"))??-1));return [...r,...s]}class h{constructor(t,e=false){if(!(t&&t instanceof HTMLElement))throw new Error("FocusTrap requires a valid HTMLElement.");this.container=t,this.tabDirection="forward",this.controlTabOrder=e,this._init();}_init(){"inert"in HTMLElement.prototype&&(this.container.inert=false,this.container.setAttribute("data-focus-trap-container",true)),this.container.addEventListener("keydown",this._onKeydown);}_getActiveElements(){let{activeElement:t}=document;const e=[t];for(;t?.shadowRoot?.activeElement;)e.push(t.shadowRoot.activeElement),t=t.shadowRoot.activeElement;return e}_getNextFocusIndex(t,e,n){const o=n.includes(e[0])||n.includes(this.container),i=n.includes(e[e.length-1]);if(this.controlTabOrder){let n=t+("forward"===this.tabDirection?1:-1);return n<0&&(n=e.length-1),n>=e.length&&(n=0),n}return "backward"===this.tabDirection&&o?e.length-1:"forward"===this.tabDirection&&i?0:null}_handleTabKey(t){const e=this._getFocusableElements();if(!e.length)return void console.warn("FocusTrap: No focusable elements found in the container.");this.tabDirection=t.shiftKey?"backward":"forward";const n=this._getActiveElements();let o=e.findIndex(t=>n.includes(t));-1===o&&(o=0);let i=this._getNextFocusIndex(o,e,n);null!==i&&(t.preventDefault(),e[i].focus());}_onKeydown=t=>{"Tab"===t.key&&this._handleTabKey(t);};_getFocusableElements(){return c(this.container)}focusFirstElement(){const t=this._getFocusableElements();t.length&&t[0].focus();}focusLastElement(){const t=this._getFocusableElements();t.length&&t[t.length-1].focus();}disconnect(){this.container.hasAttribute("data-focus-trap-container")&&this.container.removeAttribute("data-focus-trap-container"),this.container.removeEventListener("keydown",this._onKeydown);}}const u={fromAttribute:t=>null!=t&&(""===t||"false"!==t.toLowerCase()),toAttribute:t=>t?"":null},d=["top","right","bottom","left"],f=["start","end"],p=d.reduce((t,e)=>t.concat(e,e+"-"+f[0],e+"-"+f[1]),[]),g=Math.min,m=Math.max,v=Math.round,w=Math.floor,y=t=>({x:t,y:t}),b={left:"right",right:"left",bottom:"top",top:"bottom"},_={start:"end",end:"start"};function x(t,e,n){return m(t,g(e,n))}function E(t,e){return "function"==typeof t?t(e):t}function T(t){return t.split("-")[0]}function S(t){return t.split("-")[1]}function R(t){return "y"===t?"height":"width"}const L=new Set(["top","bottom"]);function C(t){return L.has(T(t))?"y":"x"}function A(t){return "x"===C(t)?"y":"x"}function P(t,e,n){ void 0===n&&(n=false);const o=S(t),i=A(t),r=R(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=D(s)),[s,D(s)]}function O(t){return t.replace(/start|end/g,t=>_[t])}const k=["left","right"],F=["right","left"],B=["top","bottom"],H=["bottom","top"];function I(t,e,n,o){const i=S(t);let r=function(t,e,n){switch(t){case "top":case "bottom":return n?e?F:k:e?k:F;case "left":case "right":return e?B:H;default:return []}}(T(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(O)))),r}function D(t){return t.replace(/left|right|bottom|top/g,t=>b[t])}function N(t){return "number"!=typeof t?function(t){return {top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function $(t){const{x:e,y:n,width:o,height:i}=t;return {width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function V(t,e,n){let{reference:o,floating:i}=t;const r=C(e),s=A(e),a=R(s),l=T(e),c="y"===r,h=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,d=o[a]/2-i[a]/2;let f;switch(l){case "top":f={x:h,y:o.y-i.height};break;case "bottom":f={x:h,y:o.y+o.height};break;case "right":f={x:o.x+o.width,y:u};break;case "left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y};}switch(S(e)){case "start":f[s]-=d*(n&&c?-1:1);break;case "end":f[s]+=d*(n&&c?-1:1);}return f}async function W(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=false,padding:f=0}=E(e,t),p=N(f),g=a[d?"floating"===u?"reference":"floating":u],m=$(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),v="floating"===u?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),y=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},b=$(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return {top:(m.top-b.top+p.top)/y.y,bottom:(b.bottom-m.bottom+p.bottom)/y.y,left:(m.left-b.left+p.left)/y.x,right:(b.right-m.right+p.right)/y.x}}function M(t,e){return {top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function j(t){return d.some(e=>t[e]>=0)}function z(t){const e=g(...t.map(t=>t.left)),n=g(...t.map(t=>t.top));return {x:e,y:n,width:m(...t.map(t=>t.right))-e,height:m(...t.map(t=>t.bottom))-n}}const K=new Set(["left","top"]);function Y(){return "undefined"!=typeof window}function q(t){return G(t)?(t.nodeName||"").toLowerCase():"#document"}function U(t){var e;return (null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function X(t){var e;return null==(e=(G(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function G(t){return !!Y()&&(t instanceof Node||t instanceof U(t).Node)}function J(t){return !!Y()&&(t instanceof Element||t instanceof U(t).Element)}function Q(t){return !!Y()&&(t instanceof HTMLElement||t instanceof U(t).HTMLElement)}function Z(t){return !(!Y()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof U(t).ShadowRoot)}const tt=new Set(["inline","contents"]);function et(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=ft(t);return /auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!tt.has(i)}const nt=new Set(["table","td","th"]);function ot(t){return nt.has(q(t))}const it=[":popover-open",":modal"];function rt(t){return it.some(e=>{try{return t.matches(e)}catch(t){return false}})}const st=["transform","translate","scale","rotate","perspective"],at=["transform","translate","scale","rotate","perspective","filter"],lt=["paint","layout","strict","content"];function ct(t){const e=ht(),n=J(t)?ft(t):t;return st.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||at.some(t=>(n.willChange||"").includes(t))||lt.some(t=>(n.contain||"").includes(t))}function ht(){return !("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ut=new Set(["html","body","#document"]);function dt(t){return ut.has(q(t))}function ft(t){return U(t).getComputedStyle(t)}function pt(t){return J(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function gt(t){if("html"===q(t))return t;const e=t.assignedSlot||t.parentNode||Z(t)&&t.host||X(t);return Z(e)?e.host:e}function mt(t){const e=gt(t);return dt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Q(e)&&et(e)?e:mt(e)}function vt(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=true);const i=mt(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=U(i);if(r){const t=wt(s);return e.concat(s,s.visualViewport||[],et(i)?i:[],t&&n?vt(t):[])}return e.concat(i,vt(i,[],n))}function wt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yt(t){const e=ft(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=Q(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,a=v(n)!==r||v(o)!==s;return a&&(n=r,o=s),{width:n,height:o,$:a}}function bt(t){return J(t)?t:t.contextElement}function _t(t){const e=bt(t);if(!Q(e))return y(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=yt(e);let s=(r?v(n.width):n.width)/o,a=(r?v(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const xt=y(0);function Et(t){const e=U(t);return ht()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:xt}function Tt(t,e,n,o){ void 0===e&&(e=false),void 0===n&&(n=false);const i=t.getBoundingClientRect(),r=bt(t);let s=y(1);e&&(o?J(o)&&(s=_t(o)):s=_t(t));const a=function(t,e,n){return void 0===e&&(e=false),!(!n||e&&n!==U(t))&&e}(r,n,o)?Et(r):y(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,h=i.width/s.x,u=i.height/s.y;if(r){const t=U(r),e=o&&J(o)?U(o):o;let n=t,i=wt(n);for(;i&&o&&e!==n;){const t=_t(i),e=i.getBoundingClientRect(),o=ft(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,u*=t.y,l+=r,c+=s,n=U(i),i=wt(n);}}return $({width:h,height:u,x:l,y:c})}function St(t,e){const n=pt(t).scrollLeft;return e?e.left+n:Tt(X(t)).left+n}function Rt(t,e,n){ void 0===n&&(n=false);const o=t.getBoundingClientRect();return {x:o.left+e.scrollLeft-(n?0:St(t,o)),y:o.top+e.scrollTop}}const Lt=new Set(["absolute","fixed"]);function Ct(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=U(t),o=X(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,a=0,l=0;if(i){r=i.width,s=i.height;const t=ht();(!t||t&&"fixed"===e)&&(a=i.offsetLeft,l=i.offsetTop);}return {width:r,height:s,x:a,y:l}}(t,n);else if("document"===e)o=function(t){const e=X(t),n=pt(t),o=t.ownerDocument.body,i=m(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=m(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+St(t);const a=-n.scrollTop;return "rtl"===ft(o).direction&&(s+=m(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}(X(t));else if(J(e))o=function(t,e){const n=Tt(t,true,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=Q(t)?_t(t):y(1);return {width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else {const n=Et(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height};}return $(o)}function At(t,e){const n=gt(t);return !(n===e||!J(n)||dt(n))&&("fixed"===ft(n).position||At(n,e))}function Pt(t,e,n){const o=Q(e),i=X(e),r="fixed"===n,s=Tt(t,true,r,e);let a={scrollLeft:0,scrollTop:0};const l=y(0);function c(){l.x=St(i);}if(o||!o&&!r)if(("body"!==q(e)||et(i))&&(a=pt(e)),o){const t=Tt(e,true,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop;}else i&&c();r&&!o&&i&&c();const h=!i||o||r?y(0):Rt(i,a);return {x:s.left+a.scrollLeft-l.x-h.x,y:s.top+a.scrollTop-l.y-h.y,width:s.width,height:s.height}}function Ot(t){return "static"===ft(t).position}function kt(t,e){if(!Q(t)||"fixed"===ft(t).position)return null;if(e)return e(t);let n=t.offsetParent;return X(t)===n&&(n=n.ownerDocument.body),n}function Ft(t,e){const n=U(t);if(rt(t))return n;if(!Q(t)){let e=gt(t);for(;e&&!dt(e);){if(J(e)&&!Ot(e))return e;e=gt(e);}return n}let o=kt(t,e);for(;o&&ot(o)&&Ot(o);)o=kt(o,e);return o&&dt(o)&&Ot(o)&&!ct(o)?n:o||function(t){let e=gt(t);for(;Q(e)&&!dt(e);){if(ct(e))return e;if(rt(e))return null;e=gt(e);}return null}(t)||n}const Bt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=X(o),a=!!e&&rt(e.floating);if(o===s||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=y(1);const h=y(0),u=Q(o);if((u||!u&&!r)&&(("body"!==q(o)||et(s))&&(l=pt(o)),Q(o))){const t=Tt(o);c=_t(o),h.x=t.x+o.clientLeft,h.y=t.y+o.clientTop;}const d=!s||u||r?y(0):Rt(s,l,true);return {width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+h.x+d.x,y:n.y*c.y-l.scrollTop*c.y+h.y+d.y}},getDocumentElement:X,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?rt(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=vt(t,[],false).filter(t=>J(t)&&"body"!==q(t)),i=null;const r="fixed"===ft(t).position;let s=r?gt(t):t;for(;J(s)&&!dt(s);){const e=ft(s),n=ct(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&Lt.has(i.position)||et(s)&&!n&&At(t,s))?o=o.filter(t=>t!==s):i=e,s=gt(s);}return e.set(t,o),o}(e,this._c):[].concat(n),o],s=r[0],a=r.reduce((t,n)=>{const o=Ct(e,n,i);return t.top=m(o.top,t.top),t.right=g(o.right,t.right),t.bottom=g(o.bottom,t.bottom),t.left=m(o.left,t.left),t},Ct(e,s,i));return {width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ft,getElementRects:async function(t){const e=this.getOffsetParent||Ft,n=this.getDimensions,o=await n(t.floating);return {reference:Pt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=yt(t);return {width:e,height:n}},getScale:_t,isElement:J,isRTL:function(t){return "rtl"===ft(t).direction}};function Ht(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function It(t,e,n,o){ void 0===o&&(o={});const{ancestorScroll:i=true,ancestorResize:r=true,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=false}=o,c=bt(t),h=i||r?[...c?vt(c):[],...vt(e)]:[];h.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:true}),r&&t.addEventListener("resize",n);});const u=c&&a?function(t,e){let n,o=null;const i=X(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null;}return function s(a,l){ void 0===a&&(a=false),void 0===l&&(l=1),r();const c=t.getBoundingClientRect(),{left:h,top:u,width:d,height:f}=c;if(a||e(),!d||!f)return;const p={rootMargin:-w(u)+"px "+-w(i.clientWidth-(h+d))+"px "+-w(i.clientHeight-(u+f))+"px "+-w(h)+"px",threshold:m(0,g(1,l))||1};let v=true;function y(e){const o=e[0].intersectionRatio;if(o!==l){if(!v)return s();o?s(false,o):n=setTimeout(()=>{s(false,1e-7);},1e3);}1!==o||Ht(c,t.getBoundingClientRect())||s(),v=false;}try{o=new IntersectionObserver(y,{...p,root:i.ownerDocument});}catch(t){o=new IntersectionObserver(y,p);}o.observe(t);}(true),r}(c,n):null;let d,f=-1,p=null;s&&(p=new ResizeObserver(t=>{let[o]=t;o&&o.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e);})),n();}),c&&!l&&p.observe(c),p.observe(e));let v=l?Tt(t):null;return l&&function e(){const o=Tt(t);v&&!Ht(v,o)&&n();v=o,d=requestAnimationFrame(e);}(),n(),()=>{var t;h.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n);}),null==u||u(),null==(t=p)||t.disconnect(),p=null,l&&cancelAnimationFrame(d);}}const Dt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:a}=e,l=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=T(n),a=S(n),l="y"===C(n),c=K.has(s)?-1:1,h=r&&l?-1:1,u=E(e,t);let{mainAxis:d,crossAxis:f,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*h,y:d*c}:{x:d*c,y:f*h}}(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},Nt=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:r,middlewareData:s,placement:a,platform:l,elements:c}=e,{crossAxis:h=false,alignment:u,allowedPlacements:d=p,autoAlignment:f=true,...g}=E(t,e),m=void 0!==u||d===p?function(t,e,n){return (t?[...n.filter(e=>S(e)===t),...n.filter(e=>S(e)!==t)]:n.filter(t=>T(t)===t)).filter(n=>!t||S(n)===t||!!e&&O(n)!==n)}(u||null,f,d):d,v=await W(e,g),w=(null==(n=s.autoPlacement)?void 0:n.index)||0,y=m[w];if(null==y)return {};const b=P(y,r,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(a!==y)return {reset:{placement:m[0]}};const _=[v[T(y)],v[b[0]],v[b[1]]],x=[...(null==(o=s.autoPlacement)?void 0:o.overflows)||[],{placement:y,overflows:_}],R=m[w+1];if(R)return {data:{index:w+1,overflows:x},reset:{placement:R}};const L=x.map(t=>{const e=S(t.placement);return [t.placement,e&&h?t.overflows.slice(0,2).reduce((t,e)=>t+e,0):t.overflows[0],t.overflows]}).sort((t,e)=>t[1]-e[1]),C=(null==(i=L.filter(t=>t[2].slice(0,S(t[0])?2:3).every(t=>t<=0))[0])?void 0:i[0])||L[0][0];return C!==a?{data:{index:w+1,overflows:x},reset:{placement:C}}:{}}}},$t=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=true,crossAxis:u=true,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=true,...m}=E(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return {};const v=T(i),w=C(a),y=T(a)===a,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=d||(y||!g?[D(a)]:function(t){const e=D(t);return [O(t),e,O(e)]}(a)),x="none"!==p;!d&&x&&_.push(...I(a,g,p,b));const S=[a,..._],R=await W(e,m),L=[];let A=(null==(o=r.flip)?void 0:o.overflows)||[];if(h&&L.push(R[v]),u){const t=P(i,s,b);L.push(R[t[0]],R[t[1]]);}if(A=[...A,{placement:i,overflows:L}],!L.every(t=>t<=0)){var k,F;const t=((null==(k=r.flip)?void 0:k.index)||0)+1,e=S[t];if(e){if(!("alignment"===u&&w!==C(e))||A.every(t=>t.overflows[0]>0&&C(t.placement)===w))return {data:{index:t,overflows:A},reset:{placement:e}}}let n=null==(F=A.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:F.placement;if(!n)switch(f){case "bestFit":{var B;const t=null==(B=A.filter(t=>{if(x){const e=C(t.placement);return e===w||"y"===e}return true}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:B[0];t&&(n=t);break}case "initialPlacement":n=a;}if(i!==n)return {reset:{placement:n}}}return {}}}},Vt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=E(t,e);switch(o){case "referenceHidden":{const t=M(await W(e,{...i,elementContext:"reference"}),n.reference);return {data:{referenceHiddenOffsets:t,referenceHidden:j(t)}}}case "escaped":{const t=M(await W(e,{...i,altBoundary:true}),n.floating);return {data:{escapedOffsets:t,escaped:j(t)}}}default:return {}}}}},Wt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:h=0}=E(t,e)||{};if(null==c)return {};const u=N(h),d={x:n,y:o},f=A(i),p=R(f),m=await s.getDimensions(c),v="y"===f,w=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",_=r.reference[p]+r.reference[f]-d[f]-r.floating[p],T=d[f]-r.reference[f],L=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=L?L[b]:0;C&&await(null==s.isElement?void 0:s.isElement(L))||(C=a.floating[b]||r.floating[p]);const P=_/2-T/2,O=C/2-m[p]/2-1,k=g(u[w],O),F=g(u[y],O),B=k,H=C-m[p]-F,I=C/2-m[p]/2+P,D=x(B,I,H),$=!l.arrow&&null!=S(i)&&I!==D&&r.reference[p]/2-(I<B?k:F)-m[p]/2<0,V=$?I<B?I-B:I-H:0;return {[f]:d[f]+V,data:{[f]:D,centerOffset:I-D-V,...$&&{alignmentOffset:V}},reset:$}}}),Mt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:a=2,x:l,y:c}=E(t,e),h=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),u=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i;}return n.map(t=>$(z(t)))}(h),d=$(z(h)),f=N(a);const p=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=l&&null!=c)return u.find(t=>l>t.left-f.left&&l<t.right+f.right&&c>t.top-f.top&&c<t.bottom+f.bottom)||d;if(u.length>=2){if("y"===C(n)){const t=u[0],e=u[u.length-1],o="top"===T(n),i=t.top,r=e.bottom,s=o?t.left:e.left,a=o?t.right:e.right;return {top:i,bottom:r,left:s,right:a,width:a-s,height:r-i,x:s,y:i}}const t="left"===T(n),e=m(...u.map(t=>t.right)),o=g(...u.map(t=>t.left)),i=u.filter(n=>t?n.left===o:n.right===e),r=i[0].top,s=i[i.length-1].bottom;return {top:r,bottom:s,left:o,right:e,width:e-o,height:s-r,x:o,y:r}}return d}},floating:o.floating,strategy:s});return i.reference.x!==p.reference.x||i.reference.y!==p.reference.y||i.reference.width!==p.reference.width||i.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}},jt=(t,e,n)=>{const o=new Map,i={platform:Bt,...n},r={...i.platform,_c:o};return (async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:u}=V(c,o,l),d=o,f={},p=0;for(let n=0;n<a.length;n++){const{name:r,fn:g}=a[n],{x:m,y:v,data:w,reset:y}=await g({x:h,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:f,rects:c,platform:s,elements:{reference:t,floating:e}});h=null!=m?m:h,u=null!=v?v:u,f={...f,[r]:{...f[r],...w}},y&&p<=50&&(p++,"object"==typeof y&&(y.placement&&(d=y.placement),y.rects&&(c=true===y.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):y.rects),({x:h,y:u}=V(c,d,l))),n=-1);}return {x:h,y:u,placement:d,strategy:i,middlewareData:f}})(t,e,{...i,platform:r})};class zt{constructor(t,e,n={}){this.referenceEl=t,this.floatingEl=e,this.options=n,this.setFloaterStyles(),false!==this.options.autoStart&&this.start(),this.cleanup=null;}setFloaterStyles(){if(!this.floatingEl)return;Object.assign(this.floatingEl.style,{position:"absolute",margin:"0"});}updatePosition(){if(!this.referenceEl||!this.floatingEl)return;const t=[].concat(this.options.offset&&0!==this.options.offset?Dt(this.options.offset):[],this.options.arrowEl?Wt({element:this.options.arrowEl}):[],this.options.useFlip?$t():[],this.options.useAutoPlacement?Nt():[],this.options.useHide?Vt():[],this.options.inline?Mt():[]);jt(this.referenceEl,this.floatingEl,{strategy:this.options.strategy||"absolute",placement:this.options.placement||"bottom-start",middleware:t}).then(({x:t,y:e,middlewareData:n})=>{Object.assign(this.floatingEl?.style??{},{visibility:n.hide?.referenceHidden?"hidden":"visible",left:`${t}px`,top:`${e}px`});});}start(){return this.cleanup&&this.cleanup(),this.cleanup=It(this.referenceEl,this.floatingEl,this.updatePosition.bind(this)),this.cleanup}stop(){this.cleanup&&(this.cleanup(),this.cleanup=null);}disconnect(){this.stop(),this.referenceEl=null,this.floatingEl=null;}}class Kt{registerComponent(t,e){customElements.get(t)||customElements.define(t,class extends e{});}closestElement(t,e=this,n=(e,o=e&&e.closest(t))=>e&&e!==document&&e!==window?o||n(e.getRootNode().host):null){return n(e)}handleComponentTagRename(t,e){const n=e.toLowerCase();t.tagName.toLowerCase()!==n&&t.setAttribute(n,true);}elementMatch(t,e){const n=e.toLowerCase();return t.tagName.toLowerCase()===n||t.hasAttribute(n)}}var Yt=i$3`.popover,.popover-trigger{outline:inherit;background:inherit;border:inherit;padding:0;overflow:visible}:host(:not([shown])) .popover{opacity:0;pointer-events:none;position:absolute}.popover .popover-arrow{position:absolute}.popover .popover-arrow.direction-down{bottom:0;transform:translateY(100%)}.popover .popover-arrow.direction-up{top:0;transform:translateY(-100%)}.popover .popover-arrow.direction-left{left:0;transform:translate(-100%)}.popover .popover-arrow.direction-right{right:0;transform:translate(100%)}.popover-trigger{margin:0;width:inherit;font-size:inherit;text-align:inherit;font:inherit;display:inline-flex}:host([behavior\$=-fullscreen]) [popover]{width:100%;height:100%;top:0;left:0}.popover::backdrop{background:var(--auro-layover-backdrop-background, transparent);backdrop-filter:var(--auro-layover-backdrop-filter, none);opacity:var(--auro-layover-backdrop-opacity, 1);transition:var(--auro-layover-backdrop-transition, none)}
|
|
182
|
-
`;const qt={disabled:false,type:"manual",behavior:"dropdown",showOnHover:false,showOnFocus:true,showOnChange:true,useHide:true,useFlip:true,offset:0,useAutoPlacement:false,placement:"bottom-start",inline:false,shown:false,hideOnNoValue:true},Ut={offset:0,placement:"bottom-start",strategy:"absolute"},Xt=["input","input-fullscreen","input-dropdown"],Gt=["dialog","dialog-fullscreen"],Jt=["dropdown"],Qt=["tooltip"];class Zt extends i$1{static register(t="auro-layover"){Kt.prototype.registerComponent(t,Zt);}constructor(){super(),this._setDefaults(qt),this._createElementRefs(),this._runtimeUtils=new Kt;}_createElementRefs(){this._popoverRef=e$1(),this._arrowElRef=e$1(),this._arrowSlotRef=e$1(),this._buttonRef=e$1(),this._positioningTargetRef=e$1(),this._triggerSlotRef=e$1();}_setDefaults(t){Object.keys(t).forEach(e=>{ void 0===this[e]&&(this[e]=t[e]);});}static get properties(){return {allowBodyScroll:{type:Boolean,reflect:true,converter:u},disabled:{type:Boolean,reflect:true},title:{type:String,reflect:false},type:{type:String,reflect:false},behavior:{type:String,reflect:true},offset:{type:Number,reflect:false},placement:{type:String,reflect:false},showOnHover:{type:Boolean,reflect:false},showOnFocus:{type:String,reflect:false,converter:u},showOnChange:{type:String,reflect:false,converter:u},hideOnNoValue:{type:String,reflect:false,converter:u},shown:{type:Boolean,reflect:true},matchWidth:{type:Boolean,reflect:false,converter:u},minInputLength:{type:Number,reflect:false},input:{type:Object,state:true},useHide:{type:String,reflect:false,converter:u},useAutoPlacement:{type:String,reflect:false,converter:u},useFlip:{type:String,reflect:false,converter:u},inline:{type:String,reflect:false,converter:u},_open:{type:Boolean,reflect:false,state:true},_hasTriggerContent:{type:Boolean,reflect:false,state:true},_currentBehaviorState:{type:String,state:true}}}static get styles(){return [Yt]}get button(){return this._buttonRef.value}get popover(){return this._popoverRef.value}get arrow(){return this._arrowElRef.value}toggle(){this._open?this.hide():this.show();}get _shouldPosition(){return ["dropdown","tooltip","input","input-dropdown"].includes(this.behavior)}show({internal:t=false}={}){this.popover&&!this.disabled&&(this._manageBehavior(this.behavior),this._matchPopoverToTriggerWidth(),this._disableBodyScroll(),this._shouldPosition?this._attachPopoverPositioner():this._detachPopoverPositioner(),this._shouldAdjustFocus&&this.popover.focus(),this._attachFocusTrap(),t||this.popover.showPopover(),this.shown=true,this._dispatchShowEvent());}hide({internal:t=false}={}){if(this.popover&&!this.disabled){if(this._resetBodyScroll(),this._detachPopoverPositioner(),this._detachFocusTrap(),t||this.popover.hidePopover(),this.shown=false,this._shouldAdjustFocus){const t=window.scrollY,e=this._triggerElInSlot||this.button;e?.focus({preventScroll:true}),window.scrollY!==t&&window.scrollTo({top:t,behavior:"instant"});}this._dispatchHideEvent();}}connectedCallback(){super.connectedCallback(),this._runtimeUtils=new Kt,this._runtimeUtils.handleComponentTagRename(this,"auro-layover");}updated(t){["input"].some(e=>t.has(e))&&this.input&&!this.behavior.match("input")&&(this.behavior="input"),["behavior","_hasTriggerContent","input"].some(e=>t.has(e))&&this._manageBehavior(this.behavior);}disconnectedCallback(){super.disconnectedCallback(),this._cleanupCurrentBehavior();}get _shouldAdjustFocus(){return ![...Xt,...Qt].includes(this.behavior)}get _dropdownOptions(){const{placement:t,offset:e,inline:n,useHide:o,useAutoPlacement:i,useFlip:r}=this;return {...Ut,arrowEl:this.arrow,placement:t,offset:e,inline:n,useHide:o,useAutoPlacement:i,useFlip:r}}get _shouldDisableBodyScroll(){return ["dialog"].includes(this.behavior)&&!this.allowBodyScroll}get _triggerSlot(){return this._triggerSlotRef.value}get _positioningTarget(){return this._positioningTargetRef.value}get _triggerElInSlot(){if(!this._triggerSlot)return;const t=this._triggerSlot.assignedNodes({flatten:true});t.length>1&&console.warn("\nAuroLayover: The input behavior requires a single trigger element to be passed to the trigger slot.\n\nExample:\n<auro-layover>\n\t<auro-button slot='trigger'>Click me</auro-button>\n</auro-layover>\n\nPassing more than one element may lead to undesireable behavior.\n");const e=t.find(t=>t.tagName);return t.length&&!e&&console.warn("\nAuroLayover: The trigger slot should not contain text nodes.\n\nExample:\n<auro-layover>\n\t<auro-button slot='trigger'>Click me</auro-button>\n</auro-layover>\n"),e??void 0}get _shouldAttachFocusTrap(){return !this._focusTrap&&!["input","input-dropdown",...Qt].includes(this.behavior)}_matchPopoverToTriggerWidth(){if(!this.matchWidth)return void(this.popover.style.width=null);const t=this._triggerElInSlot||this.button,{width:e}=t?.getBoundingClientRect()||{};this.popover.style.width=e?`${e}px`:"auto";}_calcType(t){return Xt.includes(t)?"manual":Gt.includes(t)||Jt.includes(t)?this._hasTriggerContent?"auto":"manual":Qt.includes(t)?"hint":"manual"}_manageBehavior(t=this.behavior){switch(this._currentBehaviorState=t,this._cleanupCurrentBehavior(),this.type=this._calcType(t),t){case "input":case "input-dropdown":case "input-fullscreen":this._bindToInput();break;case "dropdown":this.shown&&this._attachPopoverPositioner();break;case "tooltip":this.showOnHover=true,this._bindHover(),this.shown&&this._attachPopoverPositioner();break;case "dialog":case "dialog-fullscreen":break;default:console.warn(`AuroLayover: Unknown behavior type "${t}"`);}}_cleanupCurrentBehavior(){this._detachInput(),this._detachHover(),this._detachPopoverPositioner(),this._resetBodyScroll(),this._resetPositionStyles(),this._detachFocusTrap();}_resetPositionStyles(){this.popover&&(this.popover.style.margin=null,this.popover.style.position=null,this.popover.style.top=null,this.popover.style.left=null);}_attachFocusTrap(){this._shouldAttachFocusTrap&&(this._focusTrap=new h(this.popover,true),setTimeout(()=>{this._focusTrap&&this._focusTrap.focusFirstElement();}));}_detachFocusTrap(){this._focusTrap&&(this._focusTrap.disconnect(),this._focusTrap=null);}_attachPopoverPositioner(){this._positioningTarget&&this.popover&&(this._positioner=new zt(this._positioningTarget,this.popover,this._dropdownOptions));}_detachPopoverPositioner(){this._resetPositionStyles(),this._positioner&&(this._positioner.disconnect(),this._positioner=null);}_checkForInput(){!this.input&&this._triggerElInSlot&&this._triggerElInSlot.tagName.toLowerCase().match("input")&&(this.input=this._triggerElInSlot),this.input||setTimeout(()=>{if(!this.input)throw new Error("\nAuroLayover: The input behavior requires an input element to be passed to the trigger slot.\n\nExample:\n<auro-layover>\n\t<auro-input slot='trigger'></auro-input>\n</auro-layover>\n");this._bindToInput();},50);}_bindToInput(){this._checkForInput(),this.input&&(this.input.addEventListener("input",this._handleInputChange),this.input.addEventListener("focus",this._handleInputFocus),["input-fullscreen"].includes(this.behavior)||this.input.addEventListener("blur",this._handleInputBlur));}_detachInput(){const{input:t}=this;t&&(t.removeEventListener("focus",this._handleInputFocus),t.removeEventListener("input",this._handleInputChange),t.removeEventListener("blur",this._handleInputBlur));}_bindHover(){const t=this._triggerElInSlot;t&&(t.addEventListener("mouseover",this._handleOnHover),t.addEventListener("mouseout",this._handleOnHoverLeave));}_detachHover(){const t=this._triggerElInSlot;t&&(t.removeEventListener("mouseover",this._handleOnHover),t.removeEventListener("mouseout",this._handleOnHoverLeave));}_disableBodyScroll(){this._shouldDisableBodyScroll&&(document.documentElement.style.overflow="hidden");}_resetBodyScroll(){document.documentElement.style.overflow=null;}_dispatchShowEvent(){this.dispatchEvent(new CustomEvent("auro-layover-shown",{detail:{target:this,newState:"shown"},bubbles:true,composed:true})),this._dispatchChangeEvent({state:"shown"});}_dispatchHideEvent(){this.dispatchEvent(new CustomEvent("auro-layover-hidden",{detail:{target:this,newState:"hidden"},bubbles:true,composed:true})),this._dispatchChangeEvent({state:"hidden"});}_dispatchChangeEvent({state:t}){this.dispatchEvent(new CustomEvent("auro-layover-change",{detail:{target:this,newState:t},bubbles:true,composed:true}));}_dispatchBeforeChangeEvent({state:t}){this.dispatchEvent(new CustomEvent("auro-layover-beforechange",{detail:{target:this,newState:t},bubbles:true,composed:true}));}_inputPassesValueCheck=t=>{const{value:e}=t;return !(e&&e.length||this.hideOnNoValue)||(e&&e.length>=this.minInputLength||!this.minInputLength||this.minInputLength<=0)};_handleInputChange=t=>{if(!this.showOnChange)return false;const e=t.target;this._inputPassesValueCheck(e)?this.show():this.hide();};_handleInputFocus=t=>{if(!this.showOnFocus)return false;const e=t.target;this._inputPassesValueCheck(e)&&this.show();};_handleInputBlur=()=>{this.hide();};_handleTriggerSlotChange(){const t=this._triggerSlot.assignedNodes({flatten:true});this._hasTriggerContent=!!(t.length>0);}
|
|
181
|
+
const a=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[role="tab"]:not([disabled])','[role="link"]:not([disabled])','[role="button"]:not([disabled])','[tabindex]:not([tabindex="-1"])','[contenteditable]:not([contenteditable="false"])'],l=["auro-checkbox","auro-radio","auro-dropdown","auro-button","auro-combobox","auro-input","auro-counter","auro-select","auro-datepicker","auro-hyperlink","auro-accordion"];function c(t){const e=[],n=t=>{if(t.nodeType===Node.ELEMENT_NODE){if(function(t){const e=t.tagName.toLowerCase();return !(!l.some(n=>t.hasAttribute(n)||e===n)||t.hasAttribute("disabled")||e.match("hyperlink")&&!t.hasAttribute("href"))}(t))return void e.push(t);for(const n of a)if(t.matches?.(n)){e.push(t);break}if(t.shadowRoot&&t.shadowRoot.children&&Array.from(t.shadowRoot.children).forEach(t=>{n(t);}),"SLOT"===t.tagName){const e=t.assignedNodes({flatten:true});for(const t of e)n(t);}else t.children&&Array.from(t.children).forEach(t=>{n(t);});}};n(t);const o=[],i=new Set;for(const t of e)i.has(t)||(i.add(t),o.push(t));const r=o.filter(t=>t.hasAttribute("tabindex")&&(parseInt(t.getAttribute("tabindex"))??-1)>0);r.sort((t,e)=>parseInt(t.getAttribute("tabindex"),10)-parseInt(e.getAttribute("tabindex"),10));const s=o.filter(t=>!t.hasAttribute("tabindex")||0===(parseInt(t.getAttribute("tabindex"))??-1));return [...r,...s]}class h{constructor(t,e=false){if(!(t&&t instanceof HTMLElement))throw new Error("FocusTrap requires a valid HTMLElement.");this.container=t,this.tabDirection="forward",this.controlTabOrder=e,this._init();}_init(){"inert"in HTMLElement.prototype&&(this.container.inert=false,this.container.setAttribute("data-focus-trap-container",true)),this.container.addEventListener("keydown",this._onKeydown);}_getActiveElements(){let{activeElement:t}=document;const e=[t];for(;t?.shadowRoot?.activeElement;)e.push(t.shadowRoot.activeElement),t=t.shadowRoot.activeElement;return e}_getNextFocusIndex(t,e,n){const o=n.includes(e[0])||n.includes(this.container),i=n.includes(e[e.length-1]);if(this.controlTabOrder){let n=t+("forward"===this.tabDirection?1:-1);return n<0&&(n=e.length-1),n>=e.length&&(n=0),n}return "backward"===this.tabDirection&&o?e.length-1:"forward"===this.tabDirection&&i?0:null}_handleTabKey(t){const e=this._getFocusableElements();if(!e.length)return void console.warn("FocusTrap: No focusable elements found in the container.");this.tabDirection=t.shiftKey?"backward":"forward";const n=this._getActiveElements();let o=e.findIndex(t=>n.includes(t));-1===o&&(o=0);let i=this._getNextFocusIndex(o,e,n);null!==i&&(t.preventDefault(),e[i].focus());}_onKeydown=t=>{"Tab"===t.key&&this._handleTabKey(t);};_getFocusableElements(){return c(this.container)}focusFirstElement(){const t=this._getFocusableElements();t.length&&t[0].focus();}focusLastElement(){const t=this._getFocusableElements();t.length&&t[t.length-1].focus();}disconnect(){this.container.hasAttribute("data-focus-trap-container")&&this.container.removeAttribute("data-focus-trap-container"),this.container.removeEventListener("keydown",this._onKeydown);}}const u={fromAttribute:t=>null!=t&&(""===t||"false"!==t.toLowerCase()),toAttribute:t=>t?"":null},d=["top","right","bottom","left"],f=["start","end"],p=d.reduce((t,e)=>t.concat(e,e+"-"+f[0],e+"-"+f[1]),[]),g=Math.min,m=Math.max,v=Math.round,w=Math.floor,y=t=>({x:t,y:t}),b={left:"right",right:"left",bottom:"top",top:"bottom"},_={start:"end",end:"start"};function x(t,e,n){return m(t,g(e,n))}function E(t,e){return "function"==typeof t?t(e):t}function T(t){return t.split("-")[0]}function S(t){return t.split("-")[1]}function R(t){return "y"===t?"height":"width"}const L=new Set(["top","bottom"]);function C(t){return L.has(T(t))?"y":"x"}function P(t){return "x"===C(t)?"y":"x"}function A(t,e,n){ void 0===n&&(n=false);const o=S(t),i=P(t),r=R(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=D(s)),[s,D(s)]}function O(t){return t.replace(/start|end/g,t=>_[t])}const k=["left","right"],F=["right","left"],B=["top","bottom"],H=["bottom","top"];function I(t,e,n,o){const i=S(t);let r=function(t,e,n){switch(t){case "top":case "bottom":return n?e?F:k:e?k:F;case "left":case "right":return e?B:H;default:return []}}(T(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(O)))),r}function D(t){return t.replace(/left|right|bottom|top/g,t=>b[t])}function N(t){return "number"!=typeof t?function(t){return {top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function $(t){const{x:e,y:n,width:o,height:i}=t;return {width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function V(t,e,n){let{reference:o,floating:i}=t;const r=C(e),s=P(e),a=R(s),l=T(e),c="y"===r,h=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,d=o[a]/2-i[a]/2;let f;switch(l){case "top":f={x:h,y:o.y-i.height};break;case "bottom":f={x:h,y:o.y+o.height};break;case "right":f={x:o.x+o.width,y:u};break;case "left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y};}switch(S(e)){case "start":f[s]-=d*(n&&c?-1:1);break;case "end":f[s]+=d*(n&&c?-1:1);}return f}async function W(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=false,padding:f=0}=E(e,t),p=N(f),g=a[d?"floating"===u?"reference":"floating":u],m=$(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),v="floating"===u?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),y=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},b=$(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return {top:(m.top-b.top+p.top)/y.y,bottom:(b.bottom-m.bottom+p.bottom)/y.y,left:(m.left-b.left+p.left)/y.x,right:(b.right-m.right+p.right)/y.x}}function M(t,e){return {top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function j(t){return d.some(e=>t[e]>=0)}function z(t){const e=g(...t.map(t=>t.left)),n=g(...t.map(t=>t.top));return {x:e,y:n,width:m(...t.map(t=>t.right))-e,height:m(...t.map(t=>t.bottom))-n}}const K=new Set(["left","top"]);function Y(){return "undefined"!=typeof window}function q(t){return G(t)?(t.nodeName||"").toLowerCase():"#document"}function U(t){var e;return (null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function X(t){var e;return null==(e=(G(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function G(t){return !!Y()&&(t instanceof Node||t instanceof U(t).Node)}function J(t){return !!Y()&&(t instanceof Element||t instanceof U(t).Element)}function Q(t){return !!Y()&&(t instanceof HTMLElement||t instanceof U(t).HTMLElement)}function Z(t){return !(!Y()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof U(t).ShadowRoot)}const tt=new Set(["inline","contents"]);function et(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=ft(t);return /auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!tt.has(i)}const nt=new Set(["table","td","th"]);function ot(t){return nt.has(q(t))}const it=[":popover-open",":modal"];function rt(t){return it.some(e=>{try{return t.matches(e)}catch(t){return false}})}const st=["transform","translate","scale","rotate","perspective"],at=["transform","translate","scale","rotate","perspective","filter"],lt=["paint","layout","strict","content"];function ct(t){const e=ht(),n=J(t)?ft(t):t;return st.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||at.some(t=>(n.willChange||"").includes(t))||lt.some(t=>(n.contain||"").includes(t))}function ht(){return !("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ut=new Set(["html","body","#document"]);function dt(t){return ut.has(q(t))}function ft(t){return U(t).getComputedStyle(t)}function pt(t){return J(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function gt(t){if("html"===q(t))return t;const e=t.assignedSlot||t.parentNode||Z(t)&&t.host||X(t);return Z(e)?e.host:e}function mt(t){const e=gt(t);return dt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Q(e)&&et(e)?e:mt(e)}function vt(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=true);const i=mt(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=U(i);if(r){const t=wt(s);return e.concat(s,s.visualViewport||[],et(i)?i:[],t&&n?vt(t):[])}return e.concat(i,vt(i,[],n))}function wt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yt(t){const e=ft(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=Q(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,a=v(n)!==r||v(o)!==s;return a&&(n=r,o=s),{width:n,height:o,$:a}}function bt(t){return J(t)?t:t.contextElement}function _t(t){const e=bt(t);if(!Q(e))return y(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=yt(e);let s=(r?v(n.width):n.width)/o,a=(r?v(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const xt=y(0);function Et(t){const e=U(t);return ht()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:xt}function Tt(t,e,n,o){ void 0===e&&(e=false),void 0===n&&(n=false);const i=t.getBoundingClientRect(),r=bt(t);let s=y(1);e&&(o?J(o)&&(s=_t(o)):s=_t(t));const a=function(t,e,n){return void 0===e&&(e=false),!(!n||e&&n!==U(t))&&e}(r,n,o)?Et(r):y(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,h=i.width/s.x,u=i.height/s.y;if(r){const t=U(r),e=o&&J(o)?U(o):o;let n=t,i=wt(n);for(;i&&o&&e!==n;){const t=_t(i),e=i.getBoundingClientRect(),o=ft(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,u*=t.y,l+=r,c+=s,n=U(i),i=wt(n);}}return $({width:h,height:u,x:l,y:c})}function St(t,e){const n=pt(t).scrollLeft;return e?e.left+n:Tt(X(t)).left+n}function Rt(t,e,n){ void 0===n&&(n=false);const o=t.getBoundingClientRect();return {x:o.left+e.scrollLeft-(n?0:St(t,o)),y:o.top+e.scrollTop}}const Lt=new Set(["absolute","fixed"]);function Ct(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=U(t),o=X(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,a=0,l=0;if(i){r=i.width,s=i.height;const t=ht();(!t||t&&"fixed"===e)&&(a=i.offsetLeft,l=i.offsetTop);}return {width:r,height:s,x:a,y:l}}(t,n);else if("document"===e)o=function(t){const e=X(t),n=pt(t),o=t.ownerDocument.body,i=m(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=m(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+St(t);const a=-n.scrollTop;return "rtl"===ft(o).direction&&(s+=m(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}(X(t));else if(J(e))o=function(t,e){const n=Tt(t,true,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=Q(t)?_t(t):y(1);return {width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else {const n=Et(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height};}return $(o)}function Pt(t,e){const n=gt(t);return !(n===e||!J(n)||dt(n))&&("fixed"===ft(n).position||Pt(n,e))}function At(t,e,n){const o=Q(e),i=X(e),r="fixed"===n,s=Tt(t,true,r,e);let a={scrollLeft:0,scrollTop:0};const l=y(0);function c(){l.x=St(i);}if(o||!o&&!r)if(("body"!==q(e)||et(i))&&(a=pt(e)),o){const t=Tt(e,true,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop;}else i&&c();r&&!o&&i&&c();const h=!i||o||r?y(0):Rt(i,a);return {x:s.left+a.scrollLeft-l.x-h.x,y:s.top+a.scrollTop-l.y-h.y,width:s.width,height:s.height}}function Ot(t){return "static"===ft(t).position}function kt(t,e){if(!Q(t)||"fixed"===ft(t).position)return null;if(e)return e(t);let n=t.offsetParent;return X(t)===n&&(n=n.ownerDocument.body),n}function Ft(t,e){const n=U(t);if(rt(t))return n;if(!Q(t)){let e=gt(t);for(;e&&!dt(e);){if(J(e)&&!Ot(e))return e;e=gt(e);}return n}let o=kt(t,e);for(;o&&ot(o)&&Ot(o);)o=kt(o,e);return o&&dt(o)&&Ot(o)&&!ct(o)?n:o||function(t){let e=gt(t);for(;Q(e)&&!dt(e);){if(ct(e))return e;if(rt(e))return null;e=gt(e);}return null}(t)||n}const Bt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=X(o),a=!!e&&rt(e.floating);if(o===s||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=y(1);const h=y(0),u=Q(o);if((u||!u&&!r)&&(("body"!==q(o)||et(s))&&(l=pt(o)),Q(o))){const t=Tt(o);c=_t(o),h.x=t.x+o.clientLeft,h.y=t.y+o.clientTop;}const d=!s||u||r?y(0):Rt(s,l,true);return {width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+h.x+d.x,y:n.y*c.y-l.scrollTop*c.y+h.y+d.y}},getDocumentElement:X,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?rt(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=vt(t,[],false).filter(t=>J(t)&&"body"!==q(t)),i=null;const r="fixed"===ft(t).position;let s=r?gt(t):t;for(;J(s)&&!dt(s);){const e=ft(s),n=ct(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&Lt.has(i.position)||et(s)&&!n&&Pt(t,s))?o=o.filter(t=>t!==s):i=e,s=gt(s);}return e.set(t,o),o}(e,this._c):[].concat(n),o],s=r[0],a=r.reduce((t,n)=>{const o=Ct(e,n,i);return t.top=m(o.top,t.top),t.right=g(o.right,t.right),t.bottom=g(o.bottom,t.bottom),t.left=m(o.left,t.left),t},Ct(e,s,i));return {width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ft,getElementRects:async function(t){const e=this.getOffsetParent||Ft,n=this.getDimensions,o=await n(t.floating);return {reference:At(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=yt(t);return {width:e,height:n}},getScale:_t,isElement:J,isRTL:function(t){return "rtl"===ft(t).direction}};function Ht(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function It(t,e,n,o){ void 0===o&&(o={});const{ancestorScroll:i=true,ancestorResize:r=true,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=false}=o,c=bt(t),h=i||r?[...c?vt(c):[],...vt(e)]:[];h.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:true}),r&&t.addEventListener("resize",n);});const u=c&&a?function(t,e){let n,o=null;const i=X(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null;}return function s(a,l){ void 0===a&&(a=false),void 0===l&&(l=1),r();const c=t.getBoundingClientRect(),{left:h,top:u,width:d,height:f}=c;if(a||e(),!d||!f)return;const p={rootMargin:-w(u)+"px "+-w(i.clientWidth-(h+d))+"px "+-w(i.clientHeight-(u+f))+"px "+-w(h)+"px",threshold:m(0,g(1,l))||1};let v=true;function y(e){const o=e[0].intersectionRatio;if(o!==l){if(!v)return s();o?s(false,o):n=setTimeout(()=>{s(false,1e-7);},1e3);}1!==o||Ht(c,t.getBoundingClientRect())||s(),v=false;}try{o=new IntersectionObserver(y,{...p,root:i.ownerDocument});}catch(t){o=new IntersectionObserver(y,p);}o.observe(t);}(true),r}(c,n):null;let d,f=-1,p=null;s&&(p=new ResizeObserver(t=>{let[o]=t;o&&o.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e);})),n();}),c&&!l&&p.observe(c),p.observe(e));let v=l?Tt(t):null;return l&&function e(){const o=Tt(t);v&&!Ht(v,o)&&n();v=o,d=requestAnimationFrame(e);}(),n(),()=>{var t;h.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n);}),null==u||u(),null==(t=p)||t.disconnect(),p=null,l&&cancelAnimationFrame(d);}}const Dt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:a}=e,l=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=T(n),a=S(n),l="y"===C(n),c=K.has(s)?-1:1,h=r&&l?-1:1,u=E(e,t);let{mainAxis:d,crossAxis:f,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*h,y:d*c}:{x:d*c,y:f*h}}(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},Nt=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:r,middlewareData:s,placement:a,platform:l,elements:c}=e,{crossAxis:h=false,alignment:u,allowedPlacements:d=p,autoAlignment:f=true,...g}=E(t,e),m=void 0!==u||d===p?function(t,e,n){return (t?[...n.filter(e=>S(e)===t),...n.filter(e=>S(e)!==t)]:n.filter(t=>T(t)===t)).filter(n=>!t||S(n)===t||!!e&&O(n)!==n)}(u||null,f,d):d,v=await W(e,g),w=(null==(n=s.autoPlacement)?void 0:n.index)||0,y=m[w];if(null==y)return {};const b=A(y,r,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(a!==y)return {reset:{placement:m[0]}};const _=[v[T(y)],v[b[0]],v[b[1]]],x=[...(null==(o=s.autoPlacement)?void 0:o.overflows)||[],{placement:y,overflows:_}],R=m[w+1];if(R)return {data:{index:w+1,overflows:x},reset:{placement:R}};const L=x.map(t=>{const e=S(t.placement);return [t.placement,e&&h?t.overflows.slice(0,2).reduce((t,e)=>t+e,0):t.overflows[0],t.overflows]}).sort((t,e)=>t[1]-e[1]),C=(null==(i=L.filter(t=>t[2].slice(0,S(t[0])?2:3).every(t=>t<=0))[0])?void 0:i[0])||L[0][0];return C!==a?{data:{index:w+1,overflows:x},reset:{placement:C}}:{}}}},$t=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=true,crossAxis:u=true,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=true,...m}=E(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return {};const v=T(i),w=C(a),y=T(a)===a,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=d||(y||!g?[D(a)]:function(t){const e=D(t);return [O(t),e,O(e)]}(a)),x="none"!==p;!d&&x&&_.push(...I(a,g,p,b));const S=[a,..._],R=await W(e,m),L=[];let P=(null==(o=r.flip)?void 0:o.overflows)||[];if(h&&L.push(R[v]),u){const t=A(i,s,b);L.push(R[t[0]],R[t[1]]);}if(P=[...P,{placement:i,overflows:L}],!L.every(t=>t<=0)){var k,F;const t=((null==(k=r.flip)?void 0:k.index)||0)+1,e=S[t];if(e){if(!("alignment"===u&&w!==C(e))||P.every(t=>t.overflows[0]>0&&C(t.placement)===w))return {data:{index:t,overflows:P},reset:{placement:e}}}let n=null==(F=P.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:F.placement;if(!n)switch(f){case "bestFit":{var B;const t=null==(B=P.filter(t=>{if(x){const e=C(t.placement);return e===w||"y"===e}return true}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:B[0];t&&(n=t);break}case "initialPlacement":n=a;}if(i!==n)return {reset:{placement:n}}}return {}}}},Vt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=E(t,e);switch(o){case "referenceHidden":{const t=M(await W(e,{...i,elementContext:"reference"}),n.reference);return {data:{referenceHiddenOffsets:t,referenceHidden:j(t)}}}case "escaped":{const t=M(await W(e,{...i,altBoundary:true}),n.floating);return {data:{escapedOffsets:t,escaped:j(t)}}}default:return {}}}}},Wt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:h=0}=E(t,e)||{};if(null==c)return {};const u=N(h),d={x:n,y:o},f=P(i),p=R(f),m=await s.getDimensions(c),v="y"===f,w=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",_=r.reference[p]+r.reference[f]-d[f]-r.floating[p],T=d[f]-r.reference[f],L=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=L?L[b]:0;C&&await(null==s.isElement?void 0:s.isElement(L))||(C=a.floating[b]||r.floating[p]);const A=_/2-T/2,O=C/2-m[p]/2-1,k=g(u[w],O),F=g(u[y],O),B=k,H=C-m[p]-F,I=C/2-m[p]/2+A,D=x(B,I,H),$=!l.arrow&&null!=S(i)&&I!==D&&r.reference[p]/2-(I<B?k:F)-m[p]/2<0,V=$?I<B?I-B:I-H:0;return {[f]:d[f]+V,data:{[f]:D,centerOffset:I-D-V,...$&&{alignmentOffset:V}},reset:$}}}),Mt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:a=2,x:l,y:c}=E(t,e),h=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),u=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i;}return n.map(t=>$(z(t)))}(h),d=$(z(h)),f=N(a);const p=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=l&&null!=c)return u.find(t=>l>t.left-f.left&&l<t.right+f.right&&c>t.top-f.top&&c<t.bottom+f.bottom)||d;if(u.length>=2){if("y"===C(n)){const t=u[0],e=u[u.length-1],o="top"===T(n),i=t.top,r=e.bottom,s=o?t.left:e.left,a=o?t.right:e.right;return {top:i,bottom:r,left:s,right:a,width:a-s,height:r-i,x:s,y:i}}const t="left"===T(n),e=m(...u.map(t=>t.right)),o=g(...u.map(t=>t.left)),i=u.filter(n=>t?n.left===o:n.right===e),r=i[0].top,s=i[i.length-1].bottom;return {top:r,bottom:s,left:o,right:e,width:e-o,height:s-r,x:o,y:r}}return d}},floating:o.floating,strategy:s});return i.reference.x!==p.reference.x||i.reference.y!==p.reference.y||i.reference.width!==p.reference.width||i.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}},jt=(t,e,n)=>{const o=new Map,i={platform:Bt,...n},r={...i.platform,_c:o};return (async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:u}=V(c,o,l),d=o,f={},p=0;for(let n=0;n<a.length;n++){const{name:r,fn:g}=a[n],{x:m,y:v,data:w,reset:y}=await g({x:h,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:f,rects:c,platform:s,elements:{reference:t,floating:e}});h=null!=m?m:h,u=null!=v?v:u,f={...f,[r]:{...f[r],...w}},y&&p<=50&&(p++,"object"==typeof y&&(y.placement&&(d=y.placement),y.rects&&(c=true===y.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):y.rects),({x:h,y:u}=V(c,d,l))),n=-1);}return {x:h,y:u,placement:d,strategy:i,middlewareData:f}})(t,e,{...i,platform:r})};class zt{constructor(t,e,n={}){this.referenceEl=t,this.floatingEl=e,this.options=n,this.setFloaterStyles(),false!==this.options.autoStart&&this.start(),this.cleanup=null;}setFloaterStyles(){if(!this.floatingEl)return;Object.assign(this.floatingEl.style,{position:"absolute",margin:"0"});}updatePosition(){if(!this.referenceEl||!this.floatingEl)return;const t=[].concat(this.options.offset&&0!==this.options.offset?Dt(this.options.offset):[],this.options.arrowEl?Wt({element:this.options.arrowEl}):[],this.options.useFlip?$t():[],this.options.useAutoPlacement?Nt():[],this.options.useHide?Vt():[],this.options.inline?Mt():[]);jt(this.referenceEl,this.floatingEl,{strategy:this.options.strategy||"absolute",placement:this.options.placement||"bottom-start",middleware:t}).then(({x:t,y:e,middlewareData:n})=>{Object.assign(this.floatingEl?.style??{},{visibility:n.hide?.referenceHidden?"hidden":"visible",left:`${t}px`,top:`${e}px`});});}start(){return this.cleanup&&this.cleanup(),this.cleanup=It(this.referenceEl,this.floatingEl,this.updatePosition.bind(this)),this.cleanup}stop(){this.cleanup&&(this.cleanup(),this.cleanup=null);}disconnect(){this.stop(),this.referenceEl=null,this.floatingEl=null;}}class Kt{registerComponent(t,e){customElements.get(t)||customElements.define(t,class extends e{});}closestElement(t,e=this,n=(e,o=e&&e.closest(t))=>e&&e!==document&&e!==window?o||n(e.getRootNode().host):null){return n(e)}handleComponentTagRename(t,e){const n=e.toLowerCase();t.tagName.toLowerCase()!==n&&t.setAttribute(n,true);}elementMatch(t,e){const n=e.toLowerCase();return t.tagName.toLowerCase()===n||t.hasAttribute(n)}}var Yt=i$3`.popover,.popover-trigger{outline:inherit;background:inherit;border:inherit;padding:0;overflow:visible}:host(:not([shown])) .popover{opacity:0;pointer-events:none;position:absolute}.popover .popover-arrow{position:absolute}.popover .popover-arrow.direction-down{bottom:0;transform:translateY(100%)}.popover .popover-arrow.direction-up{top:0;transform:translateY(-100%)}.popover .popover-arrow.direction-left{left:0;transform:translate(-100%)}.popover .popover-arrow.direction-right{right:0;transform:translate(100%)}.popover-trigger{margin:0;width:inherit;font-size:inherit;text-align:inherit;font:inherit;display:inline-flex}:host([behavior\$=-fullscreen]) [popover]{width:100%;height:100%;top:0;left:0}.popover::backdrop{background:var(--auro-layover-backdrop-background, transparent);backdrop-filter:var(--auro-layover-backdrop-filter, none);opacity:var(--auro-layover-backdrop-opacity, 1);transition:var(--auro-layover-backdrop-transition, none)}
|
|
182
|
+
`;const qt={disabled:false,type:"manual",behavior:"dropdown",showOnHover:false,showOnFocus:true,showOnChange:true,useHide:true,useFlip:true,offset:0,useAutoPlacement:false,placement:"bottom-start",inline:false,shown:false,hideOnNoValue:true},Ut={offset:0,placement:"bottom-start",strategy:"absolute"},Xt=["input","input-fullscreen","input-dropdown"],Gt=["dialog","dialog-fullscreen"],Jt=["dropdown"],Qt=["tooltip"];class Zt extends i$1{static register(t="auro-layover"){Kt.prototype.registerComponent(t,Zt);}constructor(){super(),this._setDefaults(qt),this._createElementRefs(),this._runtimeUtils=new Kt;}_createElementRefs(){this._popoverRef=e$1(),this._arrowElRef=e$1(),this._arrowSlotRef=e$1(),this._buttonRef=e$1(),this._positioningTargetRef=e$1(),this._triggerSlotRef=e$1();}_setDefaults(t){Object.keys(t).forEach(e=>{ void 0===this[e]&&(this[e]=t[e]);});}static get properties(){return {allowBodyScroll:{type:Boolean,reflect:true,converter:u},disabled:{type:Boolean,reflect:true},title:{type:String,reflect:false},type:{type:String,reflect:false},behavior:{type:String,reflect:true},offset:{type:Number,reflect:false},placement:{type:String,reflect:false},showOnHover:{type:Boolean,reflect:false},showOnFocus:{type:String,reflect:false,converter:u},showOnChange:{type:String,reflect:false,converter:u},hideOnNoValue:{type:String,reflect:false,converter:u},shown:{type:Boolean,reflect:true},matchWidth:{type:Boolean,reflect:false,converter:u},minInputLength:{type:Number,reflect:false},input:{type:Object,state:true},useHide:{type:String,reflect:false,converter:u},useAutoPlacement:{type:String,reflect:false,converter:u},useFlip:{type:String,reflect:false,converter:u},inline:{type:String,reflect:false,converter:u},_open:{type:Boolean,reflect:false,state:true},_hasTriggerContent:{type:Boolean,reflect:false,state:true},_currentBehaviorState:{type:String,state:true}}}static get styles(){return [Yt]}get button(){return this._buttonRef.value}get popover(){return this._popoverRef.value}get arrow(){return this._arrowElRef.value}toggle(){this._open?this.hide():this.show();}get _shouldPosition(){return ["dropdown","tooltip","input","input-dropdown"].includes(this.behavior)}show({internal:t=false}={}){this.popover&&!this.disabled&&(this._manageBehavior(this.behavior),this._matchPopoverToTriggerWidth(),this._disableBodyScroll(),this._shouldPosition?this._attachPopoverPositioner():this._detachPopoverPositioner(),this._shouldAdjustFocus&&this.popover.focus(),this._attachFocusTrap(),t||this.popover.showPopover(),this.shown=true,this._dispatchShowEvent());}hide({internal:t=false}={}){if(this.popover&&!this.disabled){if(this._resetBodyScroll(),this._detachPopoverPositioner(),this._detachFocusTrap(),t||this.popover.hidePopover(),this.shown=false,this._shouldAdjustFocus){const t=window.scrollY,e=this._triggerElInSlot||this.button;e?.focus({preventScroll:true}),window.scrollY!==t&&window.scrollTo({top:t,behavior:"instant"});}this._dispatchHideEvent();}}connectedCallback(){super.connectedCallback(),this._runtimeUtils=new Kt,this._runtimeUtils.handleComponentTagRename(this,"auro-layover");}updated(t){["input"].some(e=>t.has(e))&&this.input&&!this.behavior.match("input")&&(this.behavior="input"),["behavior","_hasTriggerContent","input"].some(e=>t.has(e))&&this._manageBehavior(this.behavior);}disconnectedCallback(){super.disconnectedCallback(),this._cleanupCurrentBehavior();}get _shouldAdjustFocus(){return ![...Xt,...Qt].includes(this.behavior)}get _dropdownOptions(){const{placement:t,offset:e,inline:n,useHide:o,useAutoPlacement:i,useFlip:r}=this;return {...Ut,arrowEl:this.arrow,placement:t,offset:e,inline:n,useHide:o,useAutoPlacement:i,useFlip:r}}get _shouldDisableBodyScroll(){return ["dialog"].includes(this.behavior)&&!this.allowBodyScroll}get _triggerSlot(){return this._triggerSlotRef.value}get _positioningTarget(){return this._positioningTargetRef.value}get _triggerElInSlot(){if(!this._triggerSlot)return;const t=this._triggerSlot.assignedNodes({flatten:true});t.length>1&&console.warn("\nAuroLayover: The input behavior requires a single trigger element to be passed to the trigger slot.\n\nExample:\n<auro-layover>\n\t<auro-button slot='trigger'>Click me</auro-button>\n</auro-layover>\n\nPassing more than one element may lead to undesireable behavior.\n");const e=t.find(t=>t.tagName);return t.length&&!e&&console.warn("\nAuroLayover: The trigger slot should not contain text nodes.\n\nExample:\n<auro-layover>\n\t<auro-button slot='trigger'>Click me</auro-button>\n</auro-layover>\n"),e??void 0}get _shouldAttachFocusTrap(){return !this._focusTrap&&!["input","input-dropdown",...Qt].includes(this.behavior)}_matchPopoverToTriggerWidth(){if(!this.matchWidth)return void(this.popover.style.width=null);const t=this._triggerElInSlot||this.button,{width:e}=t?.getBoundingClientRect()||{};this.popover.style.width=e?`${e}px`:"auto";}_calcType(t){return Xt.includes(t)?"manual":Gt.includes(t)||Jt.includes(t)?this._hasTriggerContent?"auto":"manual":Qt.includes(t)?"hint":"manual"}_manageBehavior(t=this.behavior){switch(this._currentBehaviorState=t,this._cleanupCurrentBehavior(),this.type=this._calcType(t),t){case "input":case "input-dropdown":case "input-fullscreen":this._bindToInput();break;case "dropdown":this.shown&&this._attachPopoverPositioner();break;case "tooltip":this.showOnHover=true,this._bindHover(),this.shown&&this._attachPopoverPositioner();break;case "dialog":case "dialog-fullscreen":break;default:console.warn(`AuroLayover: Unknown behavior type "${t}"`);}}_cleanupCurrentBehavior(){this._detachInput(),this._detachHover(),this._detachPopoverPositioner(),this._resetBodyScroll(),this._resetPositionStyles(),this._detachFocusTrap();}_resetPositionStyles(){this.popover&&(this.popover.style.margin=null,this.popover.style.position=null,this.popover.style.top=null,this.popover.style.left=null);}_attachFocusTrap(){this._shouldAttachFocusTrap&&(this._focusTrap=new h(this.popover,true),setTimeout(()=>{this._focusTrap&&this._focusTrap.focusFirstElement();}));}_detachFocusTrap(){this._focusTrap&&(this._focusTrap.disconnect(),this._focusTrap=null);}_attachPopoverPositioner(){this._positioningTarget&&this.popover&&(this._positioner=new zt(this._positioningTarget,this.popover,this._dropdownOptions));}_detachPopoverPositioner(){this._resetPositionStyles(),this._positioner&&(this._positioner.disconnect(),this._positioner=null);}_checkForInput(){!this.input&&this._triggerElInSlot&&this._triggerElInSlot.tagName.toLowerCase().match("input")&&(this.input=this._triggerElInSlot),this.input||setTimeout(()=>{if(!this.input)throw new Error("\nAuroLayover: The input behavior requires an input element to be passed to the trigger slot.\n\nExample:\n<auro-layover>\n\t<auro-input slot='trigger'></auro-input>\n</auro-layover>\n");this._bindToInput();},50);}_bindToInput(){this._checkForInput(),this.input&&(this.input.addEventListener("input",this._handleInputChange),this.input.addEventListener("focus",this._handleInputFocus),["input-fullscreen"].includes(this.behavior)||this.input.addEventListener("blur",this._handleInputBlur));}_detachInput(){const{input:t}=this;t&&(t.removeEventListener("focus",this._handleInputFocus),t.removeEventListener("input",this._handleInputChange),t.removeEventListener("blur",this._handleInputBlur));}_bindHover(){const t=this._triggerElInSlot;t&&(t.addEventListener("mouseover",this._handleOnHover),t.addEventListener("mouseout",this._handleOnHoverLeave));}_detachHover(){const t=this._triggerElInSlot;t&&(t.removeEventListener("mouseover",this._handleOnHover),t.removeEventListener("mouseout",this._handleOnHoverLeave));}_disableBodyScroll(){this._shouldDisableBodyScroll&&(document.documentElement.style.overflow="hidden");}_resetBodyScroll(){document.documentElement.style.overflow=null;}_dispatchShowEvent(){this.dispatchEvent(new CustomEvent("auro-layover-shown",{detail:{target:this,newState:"shown"},bubbles:true,composed:true})),this._dispatchChangeEvent({state:"shown"});}_dispatchHideEvent(){this.dispatchEvent(new CustomEvent("auro-layover-hidden",{detail:{target:this,newState:"hidden"},bubbles:true,composed:true})),this._dispatchChangeEvent({state:"hidden"});}_dispatchChangeEvent({state:t}){this.dispatchEvent(new CustomEvent("auro-layover-change",{detail:{target:this,newState:t},bubbles:true,composed:true}));}_dispatchBeforeChangeEvent({state:t}){this.dispatchEvent(new CustomEvent("auro-layover-beforechange",{detail:{target:this,newState:t},bubbles:true,composed:true}));}_inputPassesValueCheck=t=>{const{value:e}=t;return !(e&&e.length||this.hideOnNoValue)||(e&&e.length>=this.minInputLength||!this.minInputLength||this.minInputLength<=0)};_handleInputChange=t=>{if(!this.showOnChange)return false;const e=t.target;this._inputPassesValueCheck(e)?this.show():this.hide();};_handleInputFocus=t=>{if(!this.showOnFocus)return false;const e=t.target;this._inputPassesValueCheck(e)&&this.show();};_handleInputBlur=()=>{this.hide();};_handleTriggerSlotChange(){const t=this._triggerSlot.assignedNodes({flatten:true});this._hasTriggerContent=!!(t.length>0);}_handlePopoverBeforeToggle(t){const e="open"===t.newState;if(e)return this._dispatchBeforeChangeEvent({state:"shown"}),void this.show({internal:true});if(!e){if(window.closingLayover&&window.closingLayover!==this)return t.preventDefault(),t.stopPropagation(),void this.popover.showPopover();window.closingLayover=this,this._dispatchBeforeChangeEvent({state:"hidden"}),this.hide({internal:true});}}_handlePopoverToggle(t){const e="open"===t.newState,n=window.closingLayover===this;e||(n||this.popover.showPopover(),n&&setTimeout(()=>{window.closingLayover=null;}));}_handleOnHover=()=>{this.showOnHover&&this.show();};_handleOnHoverLeave=()=>{this.showOnHover&&this.hide();};_renderTriggerSlot(){return x$1`
|
|
183
183
|
<span class="popover-trigger" ${n(this._positioningTargetRef)}>
|
|
184
184
|
<slot
|
|
185
185
|
name="trigger"
|
|
@@ -208,7 +208,8 @@ const a=["a[href]","button:not([disabled])","textarea:not([disabled])","input:no
|
|
|
208
208
|
class="popover"
|
|
209
209
|
role="dialog"
|
|
210
210
|
aria-label="${this.title}"
|
|
211
|
-
@
|
|
211
|
+
@toggle=${this._handlePopoverToggle.bind(this)}
|
|
212
|
+
@beforetoggle=${this._handlePopoverBeforeToggle.bind(this)}
|
|
212
213
|
tabindex="-1"
|
|
213
214
|
>
|
|
214
215
|
<div
|
|
@@ -225,7 +226,7 @@ const a=["a[href]","button:not([disabled])","textarea:not([disabled])","input:no
|
|
|
225
226
|
${this._renderPopover()}
|
|
226
227
|
`}}
|
|
227
228
|
|
|
228
|
-
var layoverVersion = '0.0.0-pr1.
|
|
229
|
+
var layoverVersion = '0.0.0-pr1.17';
|
|
229
230
|
|
|
230
231
|
var styleCss = i$3`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.util_insetNone{padding:0}.util_insetXxxs{padding:.125rem}.util_insetXxxs--stretch{padding:.25rem .125rem}.util_insetXxxs--squish{padding:0 .125rem}.util_insetXxs{padding:.25rem}.util_insetXxs--stretch{padding:.375rem .25rem}.util_insetXxs--squish{padding:.125rem .25rem}.util_insetXs{padding:.5rem}.util_insetXs--stretch{padding:.75rem .5rem}.util_insetXs--squish{padding:.25rem .5rem}.util_insetSm{padding:.75rem}.util_insetSm--stretch{padding:1.125rem .75rem}.util_insetSm--squish{padding:.375rem .75rem}.util_insetMd{padding:1rem}.util_insetMd--stretch{padding:1.5rem 1rem}.util_insetMd--squish{padding:.5rem 1rem}.util_insetLg{padding:1.5rem}.util_insetLg--stretch{padding:2.25rem 1.5rem}.util_insetLg--squish{padding:.75rem 1.5rem}.util_insetXl{padding:2rem}.util_insetXl--stretch{padding:3rem 2rem}.util_insetXl--squish{padding:1rem 2rem}.util_insetXxl{padding:3rem}.util_insetXxl--stretch{padding:4.5rem 3rem}.util_insetXxl--squish{padding:1.5rem 3rem}.util_insetXxxl{padding:4rem}.util_insetXxxl--stretch{padding:6rem 4rem}.util_insetXxxl--squish{padding:2rem 4rem}::slotted(*){white-space:normal}::slotted(*:hover){cursor:pointer}:host([removeSpace]) .popover{margin:calc(-1*(var(--ds-size-50, 0.25rem) + 1px)) 0 !important}.arrow{width:0;height:0;position:relative;border-style:solid}.arrow[data-placement=top]{border-width:var(--ds-size-150, 0.75rem) calc(var(--ds-size-150, 0.75rem)/2 + .5px) 0 calc(var(--ds-size-150, 0.75rem)/2 + .5px);border-color:var(--ds-auro-popover-container-color) transparent transparent transparent}.arrow[data-placement=bottom]{border-width:0 calc(var(--ds-size-150, 0.75rem)/2 + .5px) var(--ds-size-150, 0.75rem) calc(var(--ds-size-150, 0.75rem)/2 + .5px);border-color:transparent transparent var(--ds-auro-popover-container-color) transparent}.arrow[data-placement=left]{border-width:calc(var(--ds-size-150, 0.75rem)/2 + .5px) 0 calc(var(--ds-size-150, 0.75rem)/2 + .5px) var(--ds-size-150, 0.75rem);border-color:transparent transparent transparent var(--ds-auro-popover-container-color)}.arrow[data-placement=right]{border-width:calc(var(--ds-size-150, 0.75rem)/2 + .5px) var(--ds-size-150, 0.75rem) calc(var(--ds-size-150, 0.75rem)/2 + .5px) 0;border-color:transparent var(--ds-auro-popover-container-color) transparent transparent}.popover{display:inline-block;max-width:calc(100% - var(--ds-size-400, 2rem));border-radius:var(--ds-border-radius, 0.375rem)}@media screen and (min-width: 576px){.popover{max-width:50%}}@media screen and (min-width: 768px){.popover{max-width:40%}}@media screen and (min-width: 1024px){.popover{max-width:27rem}}`;
|
|
231
232
|
|
package/dist/layoverVersion.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"================================================================================"
|
|
8
8
|
],
|
|
9
9
|
"name": "@aurodesignsystem-dev/auro-popover",
|
|
10
|
-
"version": "0.0.0-pr102.
|
|
10
|
+
"version": "0.0.0-pr102.3",
|
|
11
11
|
"description": "auro-popover HTML custom element",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"node": "^20.x || ^22.x "
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@aurodesignsystem/auro-library": "^5.3.
|
|
24
|
-
"@aurodesignsystem/auro-layover": "npm:@aurodesignsystem-dev/auro-layover@0.0.0-pr1.
|
|
23
|
+
"@aurodesignsystem/auro-library": "^5.3.3",
|
|
24
|
+
"@aurodesignsystem/auro-layover": "npm:@aurodesignsystem-dev/auro-layover@0.0.0-pr1.17",
|
|
25
25
|
"@aurodesignsystem/design-tokens": "^8.4.0",
|
|
26
26
|
"@aurodesignsystem/webcorestylesheets": "10.0.3",
|
|
27
27
|
"@popperjs/core": "^2.11.8",
|
package/src/layoverVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '0.0.0-pr1.
|
|
1
|
+
export default '0.0.0-pr1.17'
|