@aurodesignsystem-dev/auro-formkit 0.0.0-pr1309.1 → 0.0.0-pr1313.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/bibtemplate/dist/auro-bibtemplate.d.ts +0 -10
- package/components/bibtemplate/dist/buttonVersion.d.ts +1 -1
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +13 -23
- package/components/bibtemplate/dist/registered.js +13 -23
- package/components/checkbox/demo/api.md +0 -7
- package/components/checkbox/demo/api.min.js +13 -16
- package/components/checkbox/demo/index.min.js +13 -16
- package/components/checkbox/dist/auro-checkbox-group.d.ts +3 -4
- package/components/checkbox/dist/auro-checkbox.d.ts +0 -2
- package/components/checkbox/dist/index.js +4 -7
- package/components/checkbox/dist/registered.js +4 -7
- package/components/combobox/demo/api.min.js +279 -449
- package/components/combobox/demo/index.html +5 -1
- package/components/combobox/demo/index.js +15 -0
- package/components/combobox/demo/index.min.js +280 -445
- package/components/combobox/dist/index.js +162 -331
- package/components/combobox/dist/registered.js +162 -331
- package/components/counter/demo/api.min.js +185 -356
- package/components/counter/demo/index.min.js +185 -356
- package/components/counter/dist/auro-counter-button.d.ts +2 -11
- package/components/counter/dist/index.js +145 -312
- package/components/counter/dist/registered.js +145 -312
- package/components/datepicker/demo/api.min.js +322 -491
- package/components/datepicker/demo/index.min.js +322 -491
- package/components/datepicker/dist/buttonVersion.d.ts +1 -1
- package/components/datepicker/dist/iconVersion.d.ts +1 -1
- package/components/datepicker/dist/index.js +180 -349
- package/components/datepicker/dist/registered.js +180 -349
- package/components/dropdown/README.md +2 -2
- package/components/dropdown/demo/api.js +15 -3
- package/components/dropdown/demo/api.md +48 -51
- package/components/dropdown/demo/api.min.js +203 -290
- package/components/dropdown/demo/index.js +7 -2
- package/components/dropdown/demo/index.md +6 -6
- package/components/dropdown/demo/index.min.js +164 -288
- package/components/dropdown/demo/readme.html +7 -1
- package/components/dropdown/demo/readme.md +2 -2
- package/components/dropdown/dist/iconVersion.d.ts +1 -1
- package/components/dropdown/dist/index.js +119 -274
- package/components/dropdown/dist/registered.js +119 -274
- package/components/form/demo/api.min.js +11 -13
- package/components/form/demo/index.min.js +11 -13
- package/components/form/dist/auro-form.d.ts +0 -8
- package/components/form/dist/index.js +6 -8
- package/components/form/dist/registered.js +6 -8
- package/components/input/demo/api.md +0 -2
- package/components/input/demo/api.min.js +79 -83
- package/components/input/demo/index.min.js +79 -83
- package/components/input/dist/auro-input.d.ts +0 -22
- package/components/input/dist/base-input.d.ts +18 -1
- package/components/input/dist/buttonVersion.d.ts +1 -1
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +34 -38
- package/components/input/dist/registered.js +34 -38
- package/components/menu/demo/api.md +3 -3
- package/components/menu/demo/api.min.js +17 -18
- package/components/menu/demo/index.min.js +17 -18
- package/components/menu/dist/auro-menuoption.d.ts +1 -2
- package/components/menu/dist/index.js +6 -7
- package/components/menu/dist/registered.js +6 -7
- package/components/radio/demo/api.min.js +10 -10
- package/components/radio/demo/index.min.js +10 -10
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/api.min.js +161 -327
- package/components/select/demo/index.min.js +161 -327
- package/components/select/dist/index.js +133 -298
- package/components/select/dist/registered.js +133 -298
- package/package.json +14 -38
- package/custom-elements.json +0 -18143
|
@@ -1,16 +1,34 @@
|
|
|
1
|
+
function classicExample() {
|
|
2
|
+
const btn = document.querySelector('#classicButton');
|
|
3
|
+
const dropdown = document.querySelector('#classic');
|
|
4
|
+
|
|
5
|
+
btn?.addEventListener('click', () => {
|
|
6
|
+
dropdown.hide();
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function classicInverseExample() {
|
|
11
|
+
const btn = document.querySelector('#classicInverseButton');
|
|
12
|
+
const dropdown = document.querySelector('#classicInverse');
|
|
13
|
+
|
|
14
|
+
btn?.addEventListener('click', () => {
|
|
15
|
+
dropdown.hide();
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
1
19
|
/**
|
|
2
20
|
* @license
|
|
3
21
|
* Copyright 2017 Google LLC
|
|
4
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
23
|
*/
|
|
6
|
-
const t$2=globalThis,i$5=t
|
|
24
|
+
const t$2=globalThis,i$5=t$2.trustedTypes,s$4=i$5?i$5.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$5="$lit$",h$3=`lit$${Math.random().toFixed(9).slice(2)}$`,o$7="?"+h$3,n$5=`<${o$7}>`,r$3=document,l$2=()=>r$3.createComment(""),c$3=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a$2=Array.isArray,u$3=t=>a$2(t)||"function"==typeof t?.[Symbol.iterator],d$1="[ \t\n\f\r]",f$4=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m$1=RegExp(`>|${d$1}(?:([^\\s"'>=/]+)(${d$1}*=${d$1}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p$2=/'/g,g$1=/"/g,$=/^(?:script|style|textarea|title)$/i,y$2=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x$1=y$2(1),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r$3.createTreeWalker(r$3,129);function P(t,i){if(!a$2(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$4?s$4.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f$4;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f$4?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m$1):void 0!==u[3]&&(c=m$1):c===m$1?">"===u[0]?(c=r??f$4,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m$1:'"'===u[3]?g$1:p$2):c===g$1||c===p$2?c=m$1:c===v||c===_?c=f$4:(c=m$1,r=void 0);const x=c===m$1&&t[i+1].startsWith("/>")?" ":"";l+=c===f$4?s+n$5:d>=0?(o.push(a),s.slice(0,d)+e$5+s.slice(d)+h$3+x):s+h$3+(-2===d?i:x);}return [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e$5)){const i=v[a++],s=r.getAttribute(t).split(h$3),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H:"?"===e[1]?I:"@"===e[1]?L:k$1}),r.removeAttribute(t);}else t.startsWith(h$3)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h$3),s=t.length-1;if(s>0){r.textContent=i$5?i$5.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l$2()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l$2());}}}else if(8===r.nodeType)if(r.data===o$7)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h$3,t+1));)d.push({type:7,index:c}),t+=h$3.length-1;}c++;}}static createElement(t,i){const s=r$3.createElement("template");return s.innerHTML=t,s}}function S$1(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c$3(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S$1(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r$3).importNode(i,true);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z$1(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.currentNode=r$3,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S$1(this,t,i),c$3(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u$3(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E&&c$3(this._$AH)?this._$AA.nextSibling.data=t:this.T(r$3.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a$2(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l$2()),this.O(l$2()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(false,true,i);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}let k$1 = class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=S$1(this,t,i,0),o=!c$3(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S$1(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c$3(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}};class H extends k$1{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}}class I extends k$1{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}}class L extends k$1{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S$1(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}let z$1 = class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S$1(this,t);}};const j=t$2.litHtmlPolyfillSupport;j?.(N,R),(t$2.litHtmlVersions??=[]).push("3.3.1");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l$2(),t),t,void 0,s??{});}return h._$AI(t),h};
|
|
7
25
|
|
|
8
26
|
/**
|
|
9
27
|
* @license
|
|
10
28
|
* Copyright 2020 Google LLC
|
|
11
29
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
30
|
*/
|
|
13
|
-
const a$1=Symbol.for(""),o$6=t=>{if(t?.r===a$1)return t?._$litStatic$},s$3=t=>({_$litStatic$:t,r:a$1}),i$4=(t,...r)=>({_$litStatic$:r.reduce((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[a+1],t[0]),r:a$1}),l$1=new Map,n$4=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=false;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o$6(i));)c+=s+r[++$],f=true;$!==a&&u.push(i),n.push(c),$++;}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l$1.get(t))&&(n.raw=n,l$1.set(t,r=n)),e=u;}return t(r,...e)},u$2=n$4(
|
|
31
|
+
const a$1=Symbol.for(""),o$6=t=>{if(t?.r===a$1)return t?._$litStatic$},s$3=t=>({_$litStatic$:t,r:a$1}),i$4=(t,...r)=>({_$litStatic$:r.reduce(((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[a+1]),t[0]),r:a$1}),l$1=new Map,n$4=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=false;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o$6(i));)c+=s+r[++$],f=true;$!==a&&u.push(i),n.push(c),$++;}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l$1.get(t))&&(n.raw=n,l$1.set(t,r=n)),e=u;}return t(r,...e)},u$2=n$4(x$1);
|
|
14
32
|
|
|
15
33
|
/**
|
|
16
34
|
* @license
|
|
@@ -23,44 +41,44 @@ const t$1={ATTRIBUTE:1,CHILD:2},e$4=t=>(...e)=>({_$litDirective$:t,values:e});le
|
|
|
23
41
|
* @license
|
|
24
42
|
* Copyright 2018 Google LLC
|
|
25
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
26
|
-
*/const e$3=e$4(class extends i$3{constructor(t){if(super(t),t.type!==t$1.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter(s=>t[s]).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return
|
|
44
|
+
*/const e$3=e$4(class extends i$3{constructor(t){if(super(t),t.type!==t$1.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return T}});
|
|
27
45
|
|
|
28
46
|
/**
|
|
29
47
|
* @license
|
|
30
48
|
* Copyright 2019 Google LLC
|
|
31
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
50
|
*/
|
|
33
|
-
const t=globalThis,e$2=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$5=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$2&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$5.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$5.set(s,t));}return t}toString(){return this.cssText}};const r$
|
|
51
|
+
const t=globalThis,e$2=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$5=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$2&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$5.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$5.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$3("string"==typeof t?t:t+"",void 0,s$2),i$2=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n$3(o,t,s$2)},S=(s,o)=>{if(e$2)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$2?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
|
|
34
52
|
|
|
35
53
|
/**
|
|
36
54
|
* @license
|
|
37
55
|
* Copyright 2017 Google LLC
|
|
38
56
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
-
*/const{is:i$1,defineProperty:e$1,getOwnPropertyDescriptor:h$2,getOwnPropertyNames:r$
|
|
57
|
+
*/const{is:i$1,defineProperty:e$1,getOwnPropertyDescriptor:h$2,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$4,getPrototypeOf:n$2}=Object,a=globalThis,c$1=a.trustedTypes,l=c$1?c$1.emptyScript:"",p$1=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$3=(t,s)=>!i$1(t,s),b={attribute:true,type:String,converter:u$1,reflect:false,useDefault:false,hasChanged:f$3};Symbol.metadata??=Symbol("metadata"),a.litPropertyMetadata??=new WeakMap;let y$1 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$1(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$2(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,s=[...r$1(t),...o$4(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f$3)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d("elementProperties")]=new Map,y$1[d("finalized")]=new Map,p$1?.({ReactiveElement:y$1}),(a.reactiveElementVersions??=[]).push("2.1.1");
|
|
40
58
|
|
|
41
59
|
/**
|
|
42
60
|
* @license
|
|
43
61
|
* Copyright 2017 Google LLC
|
|
44
62
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
|
-
*/const s$1=globalThis;class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=
|
|
63
|
+
*/const s$1=globalThis;class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return T}}i._$litElement$=true,i["finalized"]=true,s$1.litElementHydrateSupport?.({LitElement:i});const o$3=s$1.litElementPolyfillSupport;o$3?.({LitElement:i});(s$1.litElementVersions??=[]).push("4.2.1");
|
|
46
64
|
|
|
47
65
|
/**
|
|
48
66
|
* @license
|
|
49
67
|
* Copyright 2020 Google LLC
|
|
50
68
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
|
-
*/const
|
|
69
|
+
*/const f$2=o=>void 0===o.strings;
|
|
52
70
|
|
|
53
71
|
/**
|
|
54
72
|
* @license
|
|
55
73
|
* Copyright 2017 Google LLC
|
|
56
74
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
57
|
-
*/const s=(i,t)=>{const e=i._$AN;if(void 0===e)return false;for(const i of e)i._$AO?.(t,false),s(i,t);return true},o$2=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t;}while(0===e?.size)},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c(t);}};function h$1(i){ void 0!==this._$AN?(o$2(this),this._$AM=i,r(this)):this._$AM=i;}function n$1(i,t=false,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(r))for(let i=e;i<r.length;i++)s(r[i],false),o$2(r[i]);else null!=r&&(s(r,false),o$2(r));else s(this,i);}const c=i=>{i.type==t$1.CHILD&&(i._$AP??=n$1,i._$AQ??=h$1);};let f$1 = class f extends i$3{constructor(){super(...arguments),this._$AN=void 0;}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU;}_$AO(i,t=true){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o$2(this));}setValue(t){if(
|
|
75
|
+
*/const s=(i,t)=>{const e=i._$AN;if(void 0===e)return false;for(const i of e)i._$AO?.(t,false),s(i,t);return true},o$2=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t;}while(0===e?.size)},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c(t);}};function h$1(i){ void 0!==this._$AN?(o$2(this),this._$AM=i,r(this)):this._$AM=i;}function n$1(i,t=false,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(r))for(let i=e;i<r.length;i++)s(r[i],false),o$2(r[i]);else null!=r&&(s(r,false),o$2(r));else s(this,i);}const c=i=>{i.type==t$1.CHILD&&(i._$AP??=n$1,i._$AQ??=h$1);};let f$1 = class f extends i$3{constructor(){super(...arguments),this._$AN=void 0;}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU;}_$AO(i,t=true){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o$2(this));}setValue(t){if(f$2(this._$Ct))this._$Ct._$AI(t,this);else {const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0);}}disconnected(){}reconnected(){}};
|
|
58
76
|
|
|
59
77
|
/**
|
|
60
78
|
* @license
|
|
61
79
|
* Copyright 2020 Google LLC
|
|
62
80
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/const e=()=>new h;class h{}const o$1=new WeakMap,n=e$4(class extends f$1{render(i){return
|
|
81
|
+
*/const e=()=>new h;class h{}const o$1=new WeakMap,n=e$4(class extends f$1{render(i){return E}update(i,[s]){const e=s!==this.G;return e&&void 0!==this.G&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=s,this.ht=i.options?.host,this.rt(this.ct=i.element)),E}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.G){const i=this.ht??globalThis;let s=o$1.get(i);void 0===s&&(s=new WeakMap,o$1.set(i,s)),void 0!==s.get(this.G)&&this.G.call(this.ht,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ht,t);}else this.G.value=t;}get lt(){return "function"==typeof this.G?o$1.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0);}reconnected(){this.rt(this.ct);}});
|
|
64
82
|
|
|
65
83
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
66
84
|
// See LICENSE in the project root for license information.
|
|
@@ -189,9 +207,8 @@ function getOppositeAxis(axis) {
|
|
|
189
207
|
function getAxisLength(axis) {
|
|
190
208
|
return axis === 'y' ? 'height' : 'width';
|
|
191
209
|
}
|
|
192
|
-
const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
|
|
193
210
|
function getSideAxis(placement) {
|
|
194
|
-
return
|
|
211
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
195
212
|
}
|
|
196
213
|
function getAlignmentAxis(placement) {
|
|
197
214
|
return getOppositeAxis(getSideAxis(placement));
|
|
@@ -216,19 +233,19 @@ function getExpandedPlacements(placement) {
|
|
|
216
233
|
function getOppositeAlignmentPlacement(placement) {
|
|
217
234
|
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
218
235
|
}
|
|
219
|
-
const lrPlacement = ['left', 'right'];
|
|
220
|
-
const rlPlacement = ['right', 'left'];
|
|
221
|
-
const tbPlacement = ['top', 'bottom'];
|
|
222
|
-
const btPlacement = ['bottom', 'top'];
|
|
223
236
|
function getSideList(side, isStart, rtl) {
|
|
237
|
+
const lr = ['left', 'right'];
|
|
238
|
+
const rl = ['right', 'left'];
|
|
239
|
+
const tb = ['top', 'bottom'];
|
|
240
|
+
const bt = ['bottom', 'top'];
|
|
224
241
|
switch (side) {
|
|
225
242
|
case 'top':
|
|
226
243
|
case 'bottom':
|
|
227
|
-
if (rtl) return isStart ?
|
|
228
|
-
return isStart ?
|
|
244
|
+
if (rtl) return isStart ? rl : lr;
|
|
245
|
+
return isStart ? lr : rl;
|
|
229
246
|
case 'left':
|
|
230
247
|
case 'right':
|
|
231
|
-
return isStart ?
|
|
248
|
+
return isStart ? tb : bt;
|
|
232
249
|
default:
|
|
233
250
|
return [];
|
|
234
251
|
}
|
|
@@ -669,22 +686,16 @@ const flip$1 = function (options) {
|
|
|
669
686
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
670
687
|
const nextPlacement = placements[nextIndex];
|
|
671
688
|
if (nextPlacement) {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
},
|
|
683
|
-
reset: {
|
|
684
|
-
placement: nextPlacement
|
|
685
|
-
}
|
|
686
|
-
};
|
|
687
|
-
}
|
|
689
|
+
// Try next placement and re-run the lifecycle.
|
|
690
|
+
return {
|
|
691
|
+
data: {
|
|
692
|
+
index: nextIndex,
|
|
693
|
+
overflows: overflowsData
|
|
694
|
+
},
|
|
695
|
+
reset: {
|
|
696
|
+
placement: nextPlacement
|
|
697
|
+
}
|
|
698
|
+
};
|
|
688
699
|
}
|
|
689
700
|
|
|
690
701
|
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
@@ -730,8 +741,6 @@ const flip$1 = function (options) {
|
|
|
730
741
|
};
|
|
731
742
|
};
|
|
732
743
|
|
|
733
|
-
const originSides = /*#__PURE__*/new Set(['left', 'top']);
|
|
734
|
-
|
|
735
744
|
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
736
745
|
// Derivable.
|
|
737
746
|
|
|
@@ -745,7 +754,7 @@ async function convertValueToCoords(state, options) {
|
|
|
745
754
|
const side = getSide(placement);
|
|
746
755
|
const alignment = getAlignment(placement);
|
|
747
756
|
const isVertical = getSideAxis(placement) === 'y';
|
|
748
|
-
const mainAxisMulti =
|
|
757
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
749
758
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
750
759
|
const rawValue = evaluate(options, state);
|
|
751
760
|
|
|
@@ -938,7 +947,6 @@ function isShadowRoot(value) {
|
|
|
938
947
|
}
|
|
939
948
|
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
940
949
|
}
|
|
941
|
-
const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
|
|
942
950
|
function isOverflowElement(element) {
|
|
943
951
|
const {
|
|
944
952
|
overflow,
|
|
@@ -946,32 +954,27 @@ function isOverflowElement(element) {
|
|
|
946
954
|
overflowY,
|
|
947
955
|
display
|
|
948
956
|
} = getComputedStyle$1(element);
|
|
949
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !
|
|
957
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
950
958
|
}
|
|
951
|
-
const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
|
|
952
959
|
function isTableElement(element) {
|
|
953
|
-
return
|
|
960
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
954
961
|
}
|
|
955
|
-
const topLayerSelectors = [':popover-open', ':modal'];
|
|
956
962
|
function isTopLayer(element) {
|
|
957
|
-
return
|
|
963
|
+
return [':popover-open', ':modal'].some(selector => {
|
|
958
964
|
try {
|
|
959
965
|
return element.matches(selector);
|
|
960
|
-
} catch (
|
|
966
|
+
} catch (e) {
|
|
961
967
|
return false;
|
|
962
968
|
}
|
|
963
969
|
});
|
|
964
970
|
}
|
|
965
|
-
const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
|
|
966
|
-
const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
|
|
967
|
-
const containValues = ['paint', 'layout', 'strict', 'content'];
|
|
968
971
|
function isContainingBlock(elementOrCss) {
|
|
969
972
|
const webkit = isWebKit();
|
|
970
973
|
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
971
974
|
|
|
972
975
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
973
976
|
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
974
|
-
return
|
|
977
|
+
return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
|
975
978
|
}
|
|
976
979
|
function getContainingBlock(element) {
|
|
977
980
|
let currentNode = getParentNode(element);
|
|
@@ -989,9 +992,8 @@ function isWebKit() {
|
|
|
989
992
|
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
990
993
|
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
991
994
|
}
|
|
992
|
-
const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
|
|
993
995
|
function isLastTraversableNode(node) {
|
|
994
|
-
return
|
|
996
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
995
997
|
}
|
|
996
998
|
function getComputedStyle$1(element) {
|
|
997
999
|
return getWindow(element).getComputedStyle(element);
|
|
@@ -1191,9 +1193,14 @@ function getWindowScrollBarX(element, rect) {
|
|
|
1191
1193
|
return rect.left + leftScroll;
|
|
1192
1194
|
}
|
|
1193
1195
|
|
|
1194
|
-
function getHTMLOffset(documentElement, scroll) {
|
|
1196
|
+
function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
|
|
1197
|
+
if (ignoreScrollbarX === void 0) {
|
|
1198
|
+
ignoreScrollbarX = false;
|
|
1199
|
+
}
|
|
1195
1200
|
const htmlRect = documentElement.getBoundingClientRect();
|
|
1196
|
-
const x = htmlRect.left + scroll.scrollLeft -
|
|
1201
|
+
const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
|
|
1202
|
+
// RTL <body> scrollbar.
|
|
1203
|
+
getWindowScrollBarX(documentElement, htmlRect));
|
|
1197
1204
|
const y = htmlRect.top + scroll.scrollTop;
|
|
1198
1205
|
return {
|
|
1199
1206
|
x,
|
|
@@ -1232,7 +1239,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1232
1239
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1233
1240
|
}
|
|
1234
1241
|
}
|
|
1235
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1242
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
|
|
1236
1243
|
return {
|
|
1237
1244
|
width: rect.width * scale.x,
|
|
1238
1245
|
height: rect.height * scale.y,
|
|
@@ -1266,10 +1273,6 @@ function getDocumentRect(element) {
|
|
|
1266
1273
|
};
|
|
1267
1274
|
}
|
|
1268
1275
|
|
|
1269
|
-
// Safety check: ensure the scrollbar space is reasonable in case this
|
|
1270
|
-
// calculation is affected by unusual styles.
|
|
1271
|
-
// Most scrollbars leave 15-18px of space.
|
|
1272
|
-
const SCROLLBAR_MAX = 25;
|
|
1273
1276
|
function getViewportRect(element, strategy) {
|
|
1274
1277
|
const win = getWindow(element);
|
|
1275
1278
|
const html = getDocumentElement(element);
|
|
@@ -1287,24 +1290,6 @@ function getViewportRect(element, strategy) {
|
|
|
1287
1290
|
y = visualViewport.offsetTop;
|
|
1288
1291
|
}
|
|
1289
1292
|
}
|
|
1290
|
-
const windowScrollbarX = getWindowScrollBarX(html);
|
|
1291
|
-
// <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
|
|
1292
|
-
// visual width of the <html> but this is not considered in the size
|
|
1293
|
-
// of `html.clientWidth`.
|
|
1294
|
-
if (windowScrollbarX <= 0) {
|
|
1295
|
-
const doc = html.ownerDocument;
|
|
1296
|
-
const body = doc.body;
|
|
1297
|
-
const bodyStyles = getComputedStyle(body);
|
|
1298
|
-
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
1299
|
-
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
1300
|
-
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
1301
|
-
width -= clippingStableScrollbarWidth;
|
|
1302
|
-
}
|
|
1303
|
-
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
1304
|
-
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
1305
|
-
// by the scrollbar amount so there isn't extra space on the right.
|
|
1306
|
-
width += windowScrollbarX;
|
|
1307
|
-
}
|
|
1308
1293
|
return {
|
|
1309
1294
|
width,
|
|
1310
1295
|
height,
|
|
@@ -1313,7 +1298,6 @@ function getViewportRect(element, strategy) {
|
|
|
1313
1298
|
};
|
|
1314
1299
|
}
|
|
1315
1300
|
|
|
1316
|
-
const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
|
|
1317
1301
|
// Returns the inner client rect, subtracting scrollbars if present.
|
|
1318
1302
|
function getInnerBoundingClientRect(element, strategy) {
|
|
1319
1303
|
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
@@ -1378,7 +1362,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
1378
1362
|
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
1379
1363
|
currentContainingBlockComputedStyle = null;
|
|
1380
1364
|
}
|
|
1381
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle &&
|
|
1365
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
1382
1366
|
if (shouldDropCurrentNode) {
|
|
1383
1367
|
// Drop non-containing blocks.
|
|
1384
1368
|
result = result.filter(ancestor => ancestor !== currentNode);
|
|
@@ -1441,12 +1425,6 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1441
1425
|
scrollTop: 0
|
|
1442
1426
|
};
|
|
1443
1427
|
const offsets = createCoords(0);
|
|
1444
|
-
|
|
1445
|
-
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
1446
|
-
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
1447
|
-
function setLeftRTLScrollbarOffset() {
|
|
1448
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
1449
|
-
}
|
|
1450
1428
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1451
1429
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1452
1430
|
scroll = getNodeScroll(offsetParent);
|
|
@@ -1456,12 +1434,11 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1456
1434
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1457
1435
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1458
1436
|
} else if (documentElement) {
|
|
1459
|
-
|
|
1437
|
+
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
1438
|
+
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
1439
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1460
1440
|
}
|
|
1461
1441
|
}
|
|
1462
|
-
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
1463
|
-
setLeftRTLScrollbarOffset();
|
|
1464
|
-
}
|
|
1465
1442
|
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1466
1443
|
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
1467
1444
|
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
@@ -1638,7 +1615,7 @@ function observeMove(element, onMove) {
|
|
|
1638
1615
|
// Handle <iframe>s
|
|
1639
1616
|
root: root.ownerDocument
|
|
1640
1617
|
});
|
|
1641
|
-
} catch (
|
|
1618
|
+
} catch (e) {
|
|
1642
1619
|
io = new IntersectionObserver(handleObserve, options);
|
|
1643
1620
|
}
|
|
1644
1621
|
io.observe(element);
|
|
@@ -2429,32 +2406,32 @@ class AuroFloatingUI {
|
|
|
2429
2406
|
|
|
2430
2407
|
// Selectors for focusable elements
|
|
2431
2408
|
const FOCUSABLE_SELECTORS = [
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2409
|
+
'a[href]',
|
|
2410
|
+
'button:not([disabled])',
|
|
2411
|
+
'textarea:not([disabled])',
|
|
2412
|
+
'input:not([disabled])',
|
|
2413
|
+
'select:not([disabled])',
|
|
2437
2414
|
'[role="tab"]:not([disabled])',
|
|
2438
2415
|
'[role="link"]:not([disabled])',
|
|
2439
2416
|
'[role="button"]:not([disabled])',
|
|
2440
2417
|
'[tabindex]:not([tabindex="-1"])',
|
|
2441
|
-
'[contenteditable]:not([contenteditable="false"])'
|
|
2418
|
+
'[contenteditable]:not([contenteditable="false"])'
|
|
2442
2419
|
];
|
|
2443
2420
|
|
|
2444
2421
|
// List of custom components that are known to be focusable
|
|
2445
2422
|
const FOCUSABLE_COMPONENTS = [
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2423
|
+
'auro-checkbox',
|
|
2424
|
+
'auro-radio',
|
|
2425
|
+
'auro-dropdown',
|
|
2426
|
+
'auro-button',
|
|
2427
|
+
'auro-combobox',
|
|
2428
|
+
'auro-input',
|
|
2429
|
+
'auro-counter',
|
|
2430
|
+
'auro-menu',
|
|
2431
|
+
'auro-select',
|
|
2432
|
+
'auro-datepicker',
|
|
2433
|
+
'auro-hyperlink',
|
|
2434
|
+
'auro-accordion',
|
|
2458
2435
|
];
|
|
2459
2436
|
|
|
2460
2437
|
/**
|
|
@@ -2468,43 +2445,21 @@ function isFocusableComponent(element) {
|
|
|
2468
2445
|
const componentName = element.tagName.toLowerCase();
|
|
2469
2446
|
|
|
2470
2447
|
// Guard Clause: Element is a focusable component
|
|
2471
|
-
if (
|
|
2472
|
-
!FOCUSABLE_COMPONENTS.some(
|
|
2473
|
-
(name) => element.hasAttribute(name) || componentName === name,
|
|
2474
|
-
)
|
|
2475
|
-
)
|
|
2476
|
-
return false;
|
|
2448
|
+
if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
|
|
2477
2449
|
|
|
2478
2450
|
// Guard Clause: Element is not disabled
|
|
2479
|
-
if (element.hasAttribute(
|
|
2451
|
+
if (element.hasAttribute('disabled')) return false;
|
|
2480
2452
|
|
|
2481
2453
|
// Guard Clause: The element is a hyperlink and has no href attribute
|
|
2482
|
-
if (componentName.match("hyperlink") && !element.hasAttribute(
|
|
2483
|
-
return false;
|
|
2454
|
+
if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
|
|
2484
2455
|
|
|
2485
2456
|
// If all guard clauses pass, the element is a focusable component
|
|
2486
2457
|
return true;
|
|
2487
2458
|
}
|
|
2488
2459
|
|
|
2489
|
-
/**
|
|
2490
|
-
* Safely get a numeric tabindex for an element.
|
|
2491
|
-
* Returns a number if the tabindex is a valid integer, otherwise null.
|
|
2492
|
-
*
|
|
2493
|
-
* @param {HTMLElement} element The element whose tabindex to read.
|
|
2494
|
-
* @returns {?number} The numeric tabindex or null if missing/invalid.
|
|
2495
|
-
*/
|
|
2496
|
-
function getNumericTabIndex(element) {
|
|
2497
|
-
const raw = element.getAttribute("tabindex");
|
|
2498
|
-
if (raw == null) return null;
|
|
2499
|
-
|
|
2500
|
-
const value = Number.parseInt(raw, 10);
|
|
2501
|
-
return Number.isNaN(value) ? null : value;
|
|
2502
|
-
}
|
|
2503
|
-
|
|
2504
2460
|
/**
|
|
2505
2461
|
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
2506
2462
|
* Returns a unique, ordered array of elements that can receive focus.
|
|
2507
|
-
* Also sorts elements with tabindex first, preserving their order.
|
|
2508
2463
|
*
|
|
2509
2464
|
* @param {HTMLElement} container The container to search within
|
|
2510
2465
|
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
@@ -2538,14 +2493,14 @@ function getFocusableElements(container) {
|
|
|
2538
2493
|
if (root.shadowRoot) {
|
|
2539
2494
|
// Process shadow DOM children in order
|
|
2540
2495
|
if (root.shadowRoot.children) {
|
|
2541
|
-
Array.from(root.shadowRoot.children).forEach(
|
|
2496
|
+
Array.from(root.shadowRoot.children).forEach(child => {
|
|
2542
2497
|
collectFocusableElements(child);
|
|
2543
2498
|
});
|
|
2544
2499
|
}
|
|
2545
2500
|
}
|
|
2546
2501
|
|
|
2547
2502
|
// Process slots and their assigned nodes in order
|
|
2548
|
-
if (root.tagName ===
|
|
2503
|
+
if (root.tagName === 'SLOT') {
|
|
2549
2504
|
const assignedNodes = root.assignedNodes({ flatten: true });
|
|
2550
2505
|
for (const node of assignedNodes) {
|
|
2551
2506
|
collectFocusableElements(node);
|
|
@@ -2553,7 +2508,7 @@ function getFocusableElements(container) {
|
|
|
2553
2508
|
} else {
|
|
2554
2509
|
// Process light DOM children in order
|
|
2555
2510
|
if (root.children) {
|
|
2556
|
-
Array.from(root.children).forEach(
|
|
2511
|
+
Array.from(root.children).forEach(child => {
|
|
2557
2512
|
collectFocusableElements(child);
|
|
2558
2513
|
});
|
|
2559
2514
|
}
|
|
@@ -2576,37 +2531,7 @@ function getFocusableElements(container) {
|
|
|
2576
2531
|
}
|
|
2577
2532
|
}
|
|
2578
2533
|
|
|
2579
|
-
|
|
2580
|
-
// This ensures that elements with tabindex are prioritized in the focus order
|
|
2581
|
-
|
|
2582
|
-
// First extract elements with valid positive tabindex
|
|
2583
|
-
const elementsWithTabindex = uniqueElements.filter((el) => {
|
|
2584
|
-
const tabindex = getNumericTabIndex(el);
|
|
2585
|
-
return tabindex !== null && tabindex > 0;
|
|
2586
|
-
});
|
|
2587
|
-
|
|
2588
|
-
// Sort these elements by their tabindex value
|
|
2589
|
-
elementsWithTabindex.sort((a, b) => {
|
|
2590
|
-
const aIndex = getNumericTabIndex(a) ?? 0;
|
|
2591
|
-
const bIndex = getNumericTabIndex(b) ?? 0;
|
|
2592
|
-
return aIndex - bIndex;
|
|
2593
|
-
});
|
|
2594
|
-
|
|
2595
|
-
// Elements without tabindex (preserving their original order)
|
|
2596
|
-
const elementsWithoutTabindex = uniqueElements.filter((el) => {
|
|
2597
|
-
const tabindex = getNumericTabIndex(el);
|
|
2598
|
-
|
|
2599
|
-
// Elements without tabindex or with tabindex of 0 stay in DOM order
|
|
2600
|
-
return tabindex === null || tabindex === 0;
|
|
2601
|
-
});
|
|
2602
|
-
|
|
2603
|
-
// Combine both arrays with tabindex elements first
|
|
2604
|
-
const tabIndexedUniqueElements = [
|
|
2605
|
-
...elementsWithTabindex,
|
|
2606
|
-
...elementsWithoutTabindex,
|
|
2607
|
-
];
|
|
2608
|
-
|
|
2609
|
-
return tabIndexedUniqueElements;
|
|
2534
|
+
return uniqueElements;
|
|
2610
2535
|
}
|
|
2611
2536
|
|
|
2612
2537
|
/**
|
|
@@ -2619,17 +2544,15 @@ class FocusTrap {
|
|
|
2619
2544
|
* Initializes event listeners and prepares the container for focus management.
|
|
2620
2545
|
*
|
|
2621
2546
|
* @param {HTMLElement} container The DOM element to trap focus within.
|
|
2622
|
-
* @param {boolean} [controlTabOrder=false] If true enables manual control of the tab order by the FocusTrap.
|
|
2623
2547
|
* @throws {Error} If the provided container is not a valid HTMLElement.
|
|
2624
2548
|
*/
|
|
2625
|
-
constructor(container
|
|
2549
|
+
constructor(container) {
|
|
2626
2550
|
if (!container || !(container instanceof HTMLElement)) {
|
|
2627
2551
|
throw new Error("FocusTrap requires a valid HTMLElement.");
|
|
2628
2552
|
}
|
|
2629
2553
|
|
|
2630
2554
|
this.container = container;
|
|
2631
|
-
this.tabDirection =
|
|
2632
|
-
this.controlTabOrder = controlTabOrder;
|
|
2555
|
+
this.tabDirection = 'forward'; // or 'backward'
|
|
2633
2556
|
|
|
2634
2557
|
this._init();
|
|
2635
2558
|
}
|
|
@@ -2641,119 +2564,58 @@ class FocusTrap {
|
|
|
2641
2564
|
* @private
|
|
2642
2565
|
*/
|
|
2643
2566
|
_init() {
|
|
2567
|
+
|
|
2644
2568
|
// Add inert attribute to prevent focusing programmatically as well (if supported)
|
|
2645
|
-
if (
|
|
2569
|
+
if ('inert' in HTMLElement.prototype) {
|
|
2646
2570
|
this.container.inert = false; // Ensure the container isn't inert
|
|
2647
|
-
this.container.setAttribute(
|
|
2571
|
+
this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
|
|
2648
2572
|
}
|
|
2649
2573
|
|
|
2650
2574
|
// Track tab direction
|
|
2651
|
-
this.container.addEventListener(
|
|
2652
|
-
}
|
|
2653
|
-
|
|
2654
|
-
/**
|
|
2655
|
-
* Gets an array of currently active (focused) elements in the document and shadow DOM.
|
|
2656
|
-
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
2657
|
-
* @private
|
|
2658
|
-
*/
|
|
2659
|
-
_getActiveElements() {
|
|
2660
|
-
// Get the active element(s) in the document and shadow root
|
|
2661
|
-
// This will include the active element in the shadow DOM if it exists
|
|
2662
|
-
// Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
|
|
2663
|
-
let { activeElement } = document;
|
|
2664
|
-
const actives = [activeElement];
|
|
2665
|
-
while (activeElement?.shadowRoot?.activeElement) {
|
|
2666
|
-
actives.push(activeElement.shadowRoot.activeElement);
|
|
2667
|
-
activeElement = activeElement.shadowRoot.activeElement;
|
|
2668
|
-
}
|
|
2669
|
-
return actives;
|
|
2670
|
-
}
|
|
2671
|
-
|
|
2672
|
-
/**
|
|
2673
|
-
* Gets the next focus index based on the current index and focusable elements.
|
|
2674
|
-
* @param {number} currentIndex The current index of the focused element.
|
|
2675
|
-
* @param {Array<HTMLElement>} focusables The array of focusable elements.
|
|
2676
|
-
* @returns {number|null} The next focus index or null if not determined.
|
|
2677
|
-
*/
|
|
2678
|
-
_getNextFocusIndex(currentIndex, focusables, actives) {
|
|
2679
|
-
if (this.controlTabOrder) {
|
|
2680
|
-
// Calculate the new index based on the current index and tab direction
|
|
2681
|
-
let newFocusIndex =
|
|
2682
|
-
currentIndex + (this.tabDirection === "forward" ? 1 : -1);
|
|
2683
|
-
|
|
2684
|
-
// Wrap-around logic
|
|
2685
|
-
if (newFocusIndex < 0) newFocusIndex = focusables.length - 1;
|
|
2686
|
-
if (newFocusIndex >= focusables.length) newFocusIndex = 0;
|
|
2687
|
-
|
|
2688
|
-
// Early return with the new index
|
|
2689
|
-
return newFocusIndex;
|
|
2690
|
-
}
|
|
2691
|
-
|
|
2692
|
-
// Determine if we need to wrap
|
|
2693
|
-
const atFirst =
|
|
2694
|
-
actives.includes(focusables[0]) || actives.includes(this.container);
|
|
2695
|
-
const atLast = actives.includes(focusables[focusables.length - 1]);
|
|
2696
|
-
|
|
2697
|
-
// Only wrap if at the ends
|
|
2698
|
-
if (this.tabDirection === "backward" && atFirst) {
|
|
2699
|
-
return focusables.length - 1;
|
|
2700
|
-
}
|
|
2701
|
-
|
|
2702
|
-
if (this.tabDirection === "forward" && atLast) {
|
|
2703
|
-
return 0;
|
|
2704
|
-
}
|
|
2705
|
-
|
|
2706
|
-
// No wrap, so don't change focus, return early
|
|
2707
|
-
return null;
|
|
2575
|
+
this.container.addEventListener('keydown', this._onKeydown);
|
|
2708
2576
|
}
|
|
2709
2577
|
|
|
2710
2578
|
/**
|
|
2711
|
-
* Handles
|
|
2712
|
-
*
|
|
2713
|
-
*
|
|
2714
|
-
*/
|
|
2715
|
-
_handleTabKey(e) {
|
|
2716
|
-
// Update the focusable elements
|
|
2717
|
-
const focusables = this._getFocusableElements();
|
|
2718
|
-
|
|
2719
|
-
// If there are no focusable elements, exit
|
|
2720
|
-
if (!focusables.length) return;
|
|
2721
|
-
|
|
2722
|
-
// Set the tab direction based on the key pressed
|
|
2723
|
-
this.tabDirection = e.shiftKey ? "backward" : "forward";
|
|
2724
|
-
|
|
2725
|
-
// Get the active elements that are currently focused
|
|
2726
|
-
const actives = this._getActiveElements();
|
|
2727
|
-
|
|
2728
|
-
// If we're at either end of the focusable elements, wrap around to the other end
|
|
2729
|
-
let focusIndex = focusables.findIndex((el) => actives.includes(el));
|
|
2730
|
-
|
|
2731
|
-
// Fallback if we have no focused element
|
|
2732
|
-
if (focusIndex === -1) focusIndex = 0;
|
|
2733
|
-
|
|
2734
|
-
// Get the next focus index based on the current focus index, tab direction, and controlTabOrder setting
|
|
2735
|
-
// Is null if no new focus index is determined
|
|
2736
|
-
const newFocusIndex = this._getNextFocusIndex(
|
|
2737
|
-
focusIndex,
|
|
2738
|
-
focusables,
|
|
2739
|
-
actives,
|
|
2740
|
-
);
|
|
2741
|
-
|
|
2742
|
-
// If we have a new focus index, set focus to that element
|
|
2743
|
-
if (newFocusIndex !== null) {
|
|
2744
|
-
e.preventDefault();
|
|
2745
|
-
focusables[newFocusIndex].focus();
|
|
2746
|
-
}
|
|
2747
|
-
}
|
|
2748
|
-
|
|
2749
|
-
/**
|
|
2750
|
-
* Catches the keydown event
|
|
2579
|
+
* Handles keydown events to manage tab navigation within the container.
|
|
2580
|
+
* Ensures that focus wraps around when reaching the first or last focusable element.
|
|
2581
|
+
*
|
|
2751
2582
|
* @param {KeyboardEvent} e The keyboard event triggered by user interaction.
|
|
2752
2583
|
* @private
|
|
2753
2584
|
*/
|
|
2754
2585
|
_onKeydown = (e) => {
|
|
2755
|
-
|
|
2756
|
-
if (e.key ===
|
|
2586
|
+
|
|
2587
|
+
if (e.key === 'Tab') {
|
|
2588
|
+
|
|
2589
|
+
// Set the tab direction based on the key pressed
|
|
2590
|
+
this.tabDirection = e.shiftKey ? 'backward' : 'forward';
|
|
2591
|
+
|
|
2592
|
+
// Get the active element(s) in the document and shadow root
|
|
2593
|
+
// This will include the active element in the shadow DOM if it exists
|
|
2594
|
+
// Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
|
|
2595
|
+
let activeElement = document.activeElement;
|
|
2596
|
+
const actives = [activeElement];
|
|
2597
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
2598
|
+
actives.push(activeElement.shadowRoot.activeElement);
|
|
2599
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2602
|
+
// Update the focusable elements
|
|
2603
|
+
const focusables = this._getFocusableElements();
|
|
2604
|
+
|
|
2605
|
+
// If we're at either end of the focusable elements, wrap around to the other end
|
|
2606
|
+
const focusIndex =
|
|
2607
|
+
(actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
|
|
2608
|
+
? focusables.length - 1
|
|
2609
|
+
: actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
|
|
2610
|
+
? 0
|
|
2611
|
+
: null;
|
|
2612
|
+
|
|
2613
|
+
if (focusIndex !== null) {
|
|
2614
|
+
focusables[focusIndex].focus();
|
|
2615
|
+
e.preventDefault(); // Prevent default tab behavior
|
|
2616
|
+
e.stopPropagation(); // Stop the event from bubbling up
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2757
2619
|
};
|
|
2758
2620
|
|
|
2759
2621
|
/**
|
|
@@ -2766,8 +2628,8 @@ class FocusTrap {
|
|
|
2766
2628
|
_getFocusableElements() {
|
|
2767
2629
|
// Use the imported utility function to get focusable elements
|
|
2768
2630
|
const elements = getFocusableElements(this.container);
|
|
2769
|
-
|
|
2770
|
-
//
|
|
2631
|
+
|
|
2632
|
+
// Filter out any elements with the 'focus-bookend' class
|
|
2771
2633
|
return elements;
|
|
2772
2634
|
}
|
|
2773
2635
|
|
|
@@ -2794,11 +2656,12 @@ class FocusTrap {
|
|
|
2794
2656
|
* Call this method to clean up when the focus trap is no longer needed.
|
|
2795
2657
|
*/
|
|
2796
2658
|
disconnect() {
|
|
2797
|
-
|
|
2798
|
-
|
|
2659
|
+
|
|
2660
|
+
if (this.container.hasAttribute('data-focus-trap-container')) {
|
|
2661
|
+
this.container.removeAttribute('data-focus-trap-container');
|
|
2799
2662
|
}
|
|
2800
2663
|
|
|
2801
|
-
this.container.removeEventListener(
|
|
2664
|
+
this.container.removeEventListener('keydown', this._onKeydown);
|
|
2802
2665
|
}
|
|
2803
2666
|
}
|
|
2804
2667
|
|
|
@@ -2846,21 +2709,21 @@ class AuroDependencyVersioning {
|
|
|
2846
2709
|
* @license
|
|
2847
2710
|
* Copyright 2018 Google LLC
|
|
2848
2711
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2849
|
-
*/const o=o=>o??
|
|
2712
|
+
*/const o=o=>o??E;
|
|
2850
2713
|
|
|
2851
|
-
class p{registerComponent(t,a){customElements.get(t)||customElements.define(t,class extends a{});}closestElement(t,a=this,e=(a,s=a&&a.closest(t))=>a&&a!==document&&a!==window?s||e(a.getRootNode().host):null){return e(a)}handleComponentTagRename(t,a){const e=a.toLowerCase();t.tagName.toLowerCase()!==e&&t.setAttribute(e,true);}elementMatch(t,a){const e=a.toLowerCase();return t.tagName.toLowerCase()===e||t.hasAttribute(e)}
|
|
2852
|
-
`;class z extends m{constructor(){super(),this.
|
|
2714
|
+
class p{registerComponent(t,a){customElements.get(t)||customElements.define(t,class extends a{});}closestElement(t,a=this,e=(a,s=a&&a.closest(t))=>a&&a!==document&&a!==window?s||e(a.getRootNode().host):null){return e(a)}handleComponentTagRename(t,a){const e=a.toLowerCase();t.tagName.toLowerCase()!==e&&t.setAttribute(e,true);}elementMatch(t,a){const e=a.toLowerCase();return t.tagName.toLowerCase()===e||t.hasAttribute(e)}}var u='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-labelledby="error__desc" class="ico_squareLarge" data-deprecated="true" role="img" style="min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor" viewBox="0 0 24 24" part="svg"><title/><desc id="error__desc">Error alert indicator.</desc><path d="m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583"/></svg>';class m extends i{static get properties(){return {hidden:{type:Boolean,reflect:true},hiddenVisually:{type:Boolean,reflect:true},hiddenAudible:{type:Boolean,reflect:true}}}hideAudible(t){return t?"true":"false"}}const g=new Map,f=(t,a={})=>{const e=a.responseParser||(t=>t.text());return g.has(t)||g.set(t,fetch(t).then(e)),g.get(t)};var w=i$2`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, .75rem))}:host{color:currentColor;vertical-align:middle;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem)!important;width:var(--ds-auro-icon-size, 1.5rem)!important;height:var(--ds-auro-icon-size, 1.5rem)!important}.componentWrapper{display:flex;line-height:var(--ds-auro-icon-size)}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.svgWrapper [part=svg]{display:flex}.labelWrapper{margin-left:var(--ds-size-50, .25rem)}.labelWrapper ::slotted(*){line-height:inherit!important}
|
|
2715
|
+
`;class z extends m{constructor(){super(),this.onDark=false,this.appearance="default";}static get properties(){return {...m.properties,onDark:{type:Boolean,reflect:true},appearance:{type:String,reflect:true},svg:{attribute:false,reflect:true}}}static get styles(){return w}async fetchIcon(t,a){let e="";e="logos"===t?await f(`${this.uri}/${t}/${a}.svg`):await f(`${this.uri}/icons/${t}/${a}.svg`);return (new DOMParser).parseFromString(e,"text/html").body.querySelector("svg")}async firstUpdated(){try{if(!this.customSvg){const t=await this.fetchIcon(this.category,this.name);if(t)this.svg=t;else if(!t){const t=(new DOMParser).parseFromString(u,"text/html");this.svg=t.body.firstChild;}}}catch(t){this.svg=void 0;}}}i$2`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}:host{display:inline-block;--ds-auro-icon-size: 100%;width:100%;height:100%}:host .logo{color:var(--ds-auro-alaska-color)}:host([onDark]),:host([appearance=inverse]){--ds-auro-alaska-color: #FFF}
|
|
2853
2716
|
`;var y=i$2`:host{--ds-auro-icon-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color: #02426D;--ds-auro-icon-size: var(--ds-size-300, 1.5rem)}
|
|
2854
|
-
`;var
|
|
2855
|
-
`;class
|
|
2717
|
+
`;var k=i$2`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]),:host(:not([appearance=inverse])[variant=accent1]){--ds-auro-icon-color: var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]),:host(:not([appearance=inverse])[variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]),:host(:not([appearance=inverse])[variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]),:host(:not([appearance=inverse])[variant=statusDefault]){--ds-auro-icon-color: var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]),:host(:not([appearance=inverse])[variant=statusInfo]){--ds-auro-icon-color: var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]),:host(:not([appearance=inverse])[variant=statusSuccess]){--ds-auro-icon-color: var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]),:host(:not([appearance=inverse])[variant=statusWarning]){--ds-auro-icon-color: var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]),:host(:not([appearance=inverse])[variant=statusError]){--ds-auro-icon-color: var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]),:host(:not([appearance=inverse])[variant=statusInfoSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]),:host(:not([appearance=inverse])[variant=statusSuccessSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]),:host(:not([appearance=inverse])[variant=statusWarningSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]),:host(:not([appearance=inverse])[variant=statusErrorSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]),:host(:not([appearance=inverse])[variant=fareBasicEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]),:host(:not([appearance=inverse])[variant=fareBusiness]){--ds-auro-icon-color: var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]),:host(:not([appearance=inverse])[variant=fareEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]),:host(:not([appearance=inverse])[variant=fareFirst]){--ds-auro-icon-color: var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]),:host(:not([appearance=inverse])[variant=farePremiumEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]),:host(:not([appearance=inverse])[variant=tierOneWorldEmerald]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]),:host(:not([appearance=inverse])[variant=tierOneWorldSapphire]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]),:host(:not([appearance=inverse])[variant=tierOneWorldRuby]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]),:host([appearance=inverse]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]),:host([appearance=inverse][variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]),:host([appearance=inverse][variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]),:host([appearance=inverse][variant=statusError]){--ds-auro-icon-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}
|
|
2718
|
+
`;class x extends z{constructor(){super(),this.variant=void 0,this.privateDefaults();}privateDefaults(){this.uri="https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist",this.runtimeUtils=new p;}static get properties(){return {...z.properties,ariaHidden:{type:String,reflect:true},category:{type:String,reflect:true},customColor:{type:Boolean,reflect:true},customSvg:{type:Boolean},label:{type:Boolean,reflect:true},name:{type:String,reflect:true},variant:{type:String,reflect:true}}}static get styles(){return [z.styles,y,w,k]}static register(t="auro-icon"){p.prototype.registerComponent(t,x);}connectedCallback(){super.connectedCallback(),this.runtimeUtils.handleComponentTagRename(this,"auro-icon");}exposeCssParts(){this.setAttribute("exportparts","svg:iconSvg");}async firstUpdated(){if(await super.firstUpdated(),this.hasAttribute("ariaHidden")&&this.svg){const t=this.svg.querySelector("desc");t&&(t.remove(),this.svg.removeAttribute("aria-labelledby"));}}render(){const t={labelWrapper:true,util_displayHiddenVisually:!this.label};return x$1`
|
|
2856
2719
|
<div class="componentWrapper">
|
|
2857
2720
|
<div
|
|
2858
2721
|
class="${e$3({svgWrapper:true})}"
|
|
2859
2722
|
title="${o(this.title||void 0)}">
|
|
2860
2723
|
<span aria-hidden="${o(this.ariaHidden||true)}" part="svg">
|
|
2861
|
-
${this.customSvg?
|
|
2724
|
+
${this.customSvg?x$1`
|
|
2862
2725
|
<slot name="svg"></slot>
|
|
2863
|
-
`:
|
|
2726
|
+
`:x$1`
|
|
2864
2727
|
${this.svg}
|
|
2865
2728
|
`}
|
|
2866
2729
|
</span>
|
|
@@ -2872,7 +2735,7 @@ class p{registerComponent(t,a){customElements.get(t)||customElements.define(t,cl
|
|
|
2872
2735
|
</div>
|
|
2873
2736
|
`}}
|
|
2874
2737
|
|
|
2875
|
-
var iconVersion = '9.1.
|
|
2738
|
+
var iconVersion = '9.1.1';
|
|
2876
2739
|
|
|
2877
2740
|
var styleCss$2 = i$2`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}:host(:not([isfullscreen])) .container[class*=shape-rounded]{border-radius:16px}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}`;
|
|
2878
2741
|
|
|
@@ -3305,7 +3168,7 @@ class AuroHelpText extends i {
|
|
|
3305
3168
|
|
|
3306
3169
|
// function that renders the HTML and CSS into the scope of the component
|
|
3307
3170
|
render() {
|
|
3308
|
-
return
|
|
3171
|
+
return x$1`
|
|
3309
3172
|
<div class="helptext-wrapper body-xs" ?visible="${this.hasTextContent}">
|
|
3310
3173
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
3311
3174
|
</div>
|
|
@@ -3313,7 +3176,7 @@ class AuroHelpText extends i {
|
|
|
3313
3176
|
}
|
|
3314
3177
|
}
|
|
3315
3178
|
|
|
3316
|
-
var formkitVersion = '
|
|
3179
|
+
var formkitVersion = '202601290115';
|
|
3317
3180
|
|
|
3318
3181
|
class AuroElement extends i {
|
|
3319
3182
|
static get properties() {
|
|
@@ -3541,7 +3404,7 @@ class AuroDropdown extends AuroElement {
|
|
|
3541
3404
|
/**
|
|
3542
3405
|
* @private
|
|
3543
3406
|
*/
|
|
3544
|
-
this.iconTag = versioning.generateTag('auro-formkit-dropdown-icon', iconVersion,
|
|
3407
|
+
this.iconTag = versioning.generateTag('auro-formkit-dropdown-icon', iconVersion, x);
|
|
3545
3408
|
|
|
3546
3409
|
/**
|
|
3547
3410
|
* @private
|
|
@@ -3608,7 +3471,7 @@ class AuroDropdown extends AuroElement {
|
|
|
3608
3471
|
* The value for the role attribute of the trigger element.
|
|
3609
3472
|
*/
|
|
3610
3473
|
a11yRole: {
|
|
3611
|
-
type: String,
|
|
3474
|
+
type: String || undefined,
|
|
3612
3475
|
attribute: false,
|
|
3613
3476
|
reflect: false
|
|
3614
3477
|
},
|
|
@@ -4366,11 +4229,24 @@ class AuroDropdown extends AuroElement {
|
|
|
4366
4229
|
}
|
|
4367
4230
|
|
|
4368
4231
|
/* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */
|
|
4369
|
-
|
|
4232
|
+
|
|
4370
4233
|
AuroDropdown.register();
|
|
4371
4234
|
AuroDropdown.register('custom-dropdown');
|
|
4372
4235
|
|
|
4373
4236
|
function initExamples(initialCount = 0) {
|
|
4237
|
+
try {
|
|
4238
|
+
// javascript example function calls to be added here upon creation to test examples
|
|
4239
|
+
classicExample();
|
|
4240
|
+
classicInverseExample();
|
|
4241
|
+
customExample();
|
|
4242
|
+
} catch (err) {
|
|
4243
|
+
if (initialCount <= 20) {
|
|
4244
|
+
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
|
4245
|
+
setTimeout(() => {
|
|
4246
|
+
initExamples(initialCount + 1);
|
|
4247
|
+
}, 100);
|
|
4248
|
+
}
|
|
4249
|
+
}
|
|
4374
4250
|
}
|
|
4375
4251
|
|
|
4376
4252
|
export { initExamples };
|