@aurodesignsystem/auro-formkit 5.8.1 → 5.9.1
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/CHANGELOG.md +4 -15
- package/README.md +4 -4
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +2 -2
- package/components/bibtemplate/dist/registered.js +2 -2
- package/components/checkbox/demo/api.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/api.md +7 -6
- package/components/combobox/demo/api.min.js +1698 -1038
- package/components/combobox/demo/index.min.js +1698 -1038
- package/components/combobox/dist/auro-combobox.d.ts +10 -8
- package/components/combobox/dist/index.js +128 -149
- package/components/combobox/dist/registered.js +128 -149
- package/components/counter/demo/api.min.js +37 -61
- package/components/counter/demo/index.min.js +37 -61
- package/components/counter/dist/index.js +37 -61
- package/components/counter/dist/registered.js +37 -61
- package/components/datepicker/demo/api.min.js +55 -148
- package/components/datepicker/demo/index.min.js +55 -148
- package/components/datepicker/dist/auro-datepicker.d.ts +1 -1
- package/components/datepicker/dist/iconVersion.d.ts +1 -1
- package/components/datepicker/dist/index.js +55 -148
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +55 -148
- package/components/dropdown/demo/api.min.js +33 -57
- package/components/dropdown/demo/index.min.js +33 -57
- package/components/dropdown/dist/iconVersion.d.ts +1 -1
- package/components/dropdown/dist/index.js +33 -57
- package/components/dropdown/dist/registered.js +33 -57
- package/components/form/demo/working.html +1 -1
- package/components/input/demo/api.min.js +5 -4
- package/components/input/demo/index.min.js +5 -4
- package/components/input/dist/base-input.d.ts +1 -1
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +5 -4
- package/components/input/dist/registered.js +5 -4
- package/components/menu/demo/api.js +4 -0
- package/components/menu/demo/api.md +271 -31
- package/components/menu/demo/api.min.js +1609 -863
- package/components/menu/demo/index.html +1 -0
- package/components/menu/demo/index.js +2 -0
- package/components/menu/demo/index.md +95 -1
- package/components/menu/demo/index.min.js +1544 -812
- package/components/menu/dist/auro-menu.context.d.ts +227 -0
- package/components/menu/dist/auro-menu.d.ts +98 -53
- package/components/menu/dist/auro-menuoption.d.ts +116 -14
- package/components/menu/dist/index.js +1457 -796
- package/components/menu/dist/registered.js +1456 -807
- package/components/radio/demo/api.min.js +1 -1
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/api.md +8 -7
- package/components/select/demo/api.min.js +1617 -1056
- package/components/select/demo/index.min.js +1617 -1056
- package/components/select/dist/auro-select.d.ts +11 -35
- package/components/select/dist/index.js +98 -218
- package/components/select/dist/registered.js +98 -218
- package/package.json +8 -2
|
@@ -3,34 +3,34 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const t$2=globalThis,e$
|
|
6
|
+
const t$2=globalThis,e$5=t$2.ShadowRoot&&(void 0===t$2.ShadyCSS||t$2.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$6=Symbol(),o$5=new WeakMap;let n$4 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$6)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$5&&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$4("string"==typeof t?t:t+"",void 0,s$6),i$6=(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$4(o,t,s$6)},S$1=(s,o)=>{if(e$5)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$2.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$5?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2017 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
-
*/const{is:i$
|
|
12
|
+
*/const{is:i$5,defineProperty:e$4,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$4,getPrototypeOf:n$3}=Object,a$2=globalThis,c$1=a$2.trustedTypes,l$2=c$1?c$1.emptyScript:"",p$2=a$2.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$3={toAttribute(t,s){switch(s){case Boolean:t=t?l$2: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$2=(t,s)=>!i$5(t,s),b={attribute:true,type:String,converter:u$3,reflect:false,useDefault:false,hasChanged:f$2};Symbol.metadata??=Symbol("metadata"),a$2.litPropertyMetadata??=new WeakMap;let y$2 = 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$4(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(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$1("elementProperties")))return;const t=n$3(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("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$1(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$3).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$3;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$2)(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$2.elementStyles=[],y$2.shadowRootOptions={mode:"open"},y$2[d$1("elementProperties")]=new Map,y$2[d$1("finalized")]=new Map,p$2?.({ReactiveElement:y$2}),(a$2.reactiveElementVersions??=[]).push("2.1.1");
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @license
|
|
16
16
|
* Copyright 2017 Google LLC
|
|
17
17
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
18
18
|
*/
|
|
19
|
-
const t$1=globalThis,i$
|
|
19
|
+
const t$1=globalThis,i$4=t$1.trustedTypes,s$5=i$4?i$4.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$3="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$3="?"+h,n$2=`<${o$3}>`,r=document,l$1=()=>r.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a$1=Array.isArray,u$2=t=>a$1(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f$1=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m$1=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p$1=/'/g,g$1=/"/g,$=/^(?:script|style|textarea|title)$/i,y$1=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x$1=y$1(1),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a$1(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$5?s$5.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f$1;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$1?"!--"===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$1,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$1):c===g$1||c===p$1?c=m$1:c===v||c===_?c=f$1:(c=m$1,r=void 0);const x=c===m$1&&t[i+1].startsWith("/>")?" ":"";l+=c===f$1?s+n$2:d>=0?(o.push(a),s.slice(0,d)+e$3+s.slice(d)+h+x):s+h+(-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$3)){const i=v[a++],s=r.getAttribute(t).split(h),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)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i$4?i$4.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l$1()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l$1());}}}else if(8===r.nodeType)if(r.data===o$3)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r.createElement("template");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(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(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).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,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(this,t,i),c(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$2(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(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.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$1(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$1()),this.O(l$1()),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(this,t,i,0),o=!c(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(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(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(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(this,t);}};const j=t$1.litHtmlPolyfillSupport;j?.(N,R),(t$1.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$1(),t),t,void 0,s??{});}return h._$AI(t),h};
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright 2017 Google LLC
|
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/const s$
|
|
25
|
+
*/const s$4=globalThis;let i$3 = class i extends y$2{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$3._$litElement$=true,i$3["finalized"]=true,s$4.litElementHydrateSupport?.({LitElement:i$3});const o$2=s$4.litElementPolyfillSupport;o$2?.({LitElement:i$3});(s$4.litElementVersions??=[]).push("4.2.1");
|
|
26
26
|
|
|
27
|
-
var styleCss$1 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.body-default{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);font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.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);font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{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);font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.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);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-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-2xs-font-size, 0.625rem);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);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);font-weight:var(--wcss-display-2xl-weight, 300);line-height:var(--wcss-display-2xl-line-height, 1.3);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem))}.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);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);font-weight:var(--wcss-display-xl-weight, 300);line-height:var(--wcss-display-xl-line-height, 1.3);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem))}.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);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);font-weight:var(--wcss-display-lg-weight, 300);line-height:var(--wcss-display-lg-line-height, 1.3);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem))}.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);letter-spacing:var(--wcss-display-md-letter-spacing, 0);font-weight:var(--wcss-display-md-weight, 300);line-height:var(--wcss-display-md-line-height, 1.3);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem))}.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);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);font-weight:var(--wcss-display-sm-weight, 300);line-height:var(--wcss-display-sm-line-height, 1.3);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem))}.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);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);font-weight:var(--wcss-display-xs-weight, 300);line-height:var(--wcss-display-xs-line-height, 1.3);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem))}.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);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);font-weight:var(--wcss-heading-xl-weight, 300);line-height:var(--wcss-heading-xl-line-height, 1.3);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem))}.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);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);font-weight:var(--wcss-heading-lg-weight, 300);line-height:var(--wcss-heading-lg-line-height, 1.3);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem))}.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);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);font-weight:var(--wcss-heading-md-weight, 300);line-height:var(--wcss-heading-md-line-height, 1.3);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem))}.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);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);font-weight:var(--wcss-heading-sm-weight, 300);line-height:var(--wcss-heading-sm-line-height, 1.3);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem))}.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);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);font-weight:var(--wcss-heading-xs-weight, 450);line-height:var(--wcss-heading-xs-line-height, 1.3);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem))}.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);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);font-weight:var(--wcss-heading-2xs-weight, 450);line-height:var(--wcss-heading-2xs-line-height, 1.3);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem))}.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);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-2xl-weight, 450);line-height:var(--wcss-accent-2xl-line-height, 1);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));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);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-xl-weight, 450);line-height:var(--wcss-accent-xl-line-height, 1.3);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));text-transform:uppercase}.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);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);font-weight:var(--wcss-accent-lg-weight, 450);line-height:var(--wcss-accent-lg-line-height, 1.3);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));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);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);font-weight:var(--wcss-accent-md-weight, 500);line-height:var(--wcss-accent-md-line-height, 1.3);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));text-transform:uppercase}.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);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);font-weight:var(--wcss-accent-sm-weight, 500);line-height:var(--wcss-accent-sm-line-height, 1.3);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));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);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-xs-weight, 500);line-height:var(--wcss-accent-xs-line-height, 1.3);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));text-transform:uppercase}.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);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-2xs-weight, 450);line-height:var(--wcss-accent-2xs-line-height, 1.3);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));text-transform:uppercase}:host{display:block;vertical-align:middle;line-height:0}:host .menuWrapper{box-sizing:border-box;display:flex;flex-direction:column;width:100%;margin:0;padding:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host [loadingplaceholder].empty{opacity:0;position:absolute}:host [loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;display:inline-block;margin-bottom:var(--ds-size-25, 0.125rem)}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]){overflow-y:auto}:host([root]) .menuWrapper.lg{padding:var(--ds-size-150, 0.75rem);gap:var(--ds-size-50, 0.25rem)}:host([root]) .menuWrapper.xl{padding:var(--ds-size-200, 1rem);gap:var(--ds-size-100, 0.5rem)}`;
|
|
27
|
+
var styleCss$1 = i$6`:focus:not(:focus-visible){outline:3px solid transparent}.body-default{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);font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.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);font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{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);font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.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);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-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-2xs-font-size, 0.625rem);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);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);font-weight:var(--wcss-display-2xl-weight, 300);line-height:var(--wcss-display-2xl-line-height, 1.3);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem))}.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);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);font-weight:var(--wcss-display-xl-weight, 300);line-height:var(--wcss-display-xl-line-height, 1.3);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem))}.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);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);font-weight:var(--wcss-display-lg-weight, 300);line-height:var(--wcss-display-lg-line-height, 1.3);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem))}.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);letter-spacing:var(--wcss-display-md-letter-spacing, 0);font-weight:var(--wcss-display-md-weight, 300);line-height:var(--wcss-display-md-line-height, 1.3);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem))}.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);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);font-weight:var(--wcss-display-sm-weight, 300);line-height:var(--wcss-display-sm-line-height, 1.3);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem))}.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);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);font-weight:var(--wcss-display-xs-weight, 300);line-height:var(--wcss-display-xs-line-height, 1.3);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem))}.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);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);font-weight:var(--wcss-heading-xl-weight, 300);line-height:var(--wcss-heading-xl-line-height, 1.3);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem))}.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);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);font-weight:var(--wcss-heading-lg-weight, 300);line-height:var(--wcss-heading-lg-line-height, 1.3);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem))}.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);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);font-weight:var(--wcss-heading-md-weight, 300);line-height:var(--wcss-heading-md-line-height, 1.3);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem))}.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);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);font-weight:var(--wcss-heading-sm-weight, 300);line-height:var(--wcss-heading-sm-line-height, 1.3);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem))}.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);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);font-weight:var(--wcss-heading-xs-weight, 450);line-height:var(--wcss-heading-xs-line-height, 1.3);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem))}.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);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);font-weight:var(--wcss-heading-2xs-weight, 450);line-height:var(--wcss-heading-2xs-line-height, 1.3);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem))}.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);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-2xl-weight, 450);line-height:var(--wcss-accent-2xl-line-height, 1);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));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);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-xl-weight, 450);line-height:var(--wcss-accent-xl-line-height, 1.3);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));text-transform:uppercase}.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);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);font-weight:var(--wcss-accent-lg-weight, 450);line-height:var(--wcss-accent-lg-line-height, 1.3);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));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);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);font-weight:var(--wcss-accent-md-weight, 500);line-height:var(--wcss-accent-md-line-height, 1.3);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));text-transform:uppercase}.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);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);font-weight:var(--wcss-accent-sm-weight, 500);line-height:var(--wcss-accent-sm-line-height, 1.3);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));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);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-xs-weight, 500);line-height:var(--wcss-accent-xs-line-height, 1.3);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));text-transform:uppercase}.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);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-2xs-weight, 450);line-height:var(--wcss-accent-2xs-line-height, 1.3);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));text-transform:uppercase}:host{display:block;vertical-align:middle;line-height:0}:host .menuWrapper{box-sizing:border-box;display:flex;flex-direction:column;width:100%;margin:0;padding:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host [loadingplaceholder].empty{opacity:0;position:absolute}:host [loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;display:inline-block;margin-bottom:var(--ds-size-25, 0.125rem)}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]){overflow-y:auto}:host([root]) .menuWrapper.lg{padding:var(--ds-size-150, 0.75rem);gap:var(--ds-size-50, 0.25rem)}:host([root]) .menuWrapper.xl{padding:var(--ds-size-200, 1rem);gap:var(--ds-size-100, 0.5rem)}`;
|
|
28
28
|
|
|
29
|
-
var colorCss$1 = i$
|
|
29
|
+
var colorCss$1 = i$6`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-divider-color)}[loadingplaceholder] slot[name=loadingIcon]{color:var(--ds-auro-menu-loader-color)}[loadingplaceholder] slot[name=loadingText]{color:var(--ds-auro-menu-loader-text-color)}`;
|
|
30
30
|
|
|
31
|
-
var tokensCss = i$
|
|
31
|
+
var tokensCss = i$6`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
32
32
|
|
|
33
|
-
class AuroElement extends i$
|
|
33
|
+
class AuroElement extends i$3 {
|
|
34
34
|
static get properties() {
|
|
35
35
|
return {
|
|
36
36
|
|
|
@@ -134,6 +134,50 @@ class AuroElement extends i$2 {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
/**
|
|
138
|
+
* @license
|
|
139
|
+
* Copyright 2021 Google LLC
|
|
140
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
141
|
+
*/
|
|
142
|
+
let s$3 = class s extends Event{constructor(s,t,e,o){super("context-request",{bubbles:true,composed:true}),this.context=s,this.contextTarget=t,this.callback=e,this.subscribe=o??false;}};
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @license
|
|
146
|
+
* Copyright 2021 Google LLC
|
|
147
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
148
|
+
*/
|
|
149
|
+
function n$1(n){return n}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* @license
|
|
153
|
+
* Copyright 2021 Google LLC
|
|
154
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
155
|
+
*/let s$2 = class s{constructor(t,s,i,h){if(this.subscribe=false,this.provided=false,this.value=void 0,this.t=(t,s)=>{this.unsubscribe&&(this.unsubscribe!==s&&(this.provided=false,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=true,this.callback&&this.callback(t,s)),this.unsubscribe=s;},this.host=t,void 0!==s.context){const t=s;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??false;}else this.context=s,this.callback=i,this.subscribe=h??false;this.host.addController(this);}hostConnected(){this.dispatchRequest();}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0);}dispatchRequest(){this.host.dispatchEvent(new s$3(this.context,this.host,this.t,this.subscribe));}};
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @license
|
|
159
|
+
* Copyright 2021 Google LLC
|
|
160
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
161
|
+
*/
|
|
162
|
+
let s$1 = class s{get value(){return this.o}set value(s){this.setValue(s);}setValue(s,t=false){const i=t||!Object.is(s,this.o);this.o=s,i&&this.updateObservers();}constructor(s){this.subscriptions=new Map,this.updateObservers=()=>{for(const[s,{disposer:t}]of this.subscriptions)s(this.o,t);},void 0!==s&&(this.value=s);}addCallback(s,t,i){if(!i)return void s(this.value);this.subscriptions.has(s)||this.subscriptions.set(s,{disposer:()=>{this.subscriptions.delete(s);},consumerHost:t});const{disposer:h}=this.subscriptions.get(s);s(this.value,h);}clearCallbacks(){this.subscriptions.clear();}};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @license
|
|
166
|
+
* Copyright 2021 Google LLC
|
|
167
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
168
|
+
*/let e$2 = class e extends Event{constructor(t,s){super("context-provider",{bubbles:true,composed:true}),this.context=t,this.contextTarget=s;}};let i$2 = class i extends s$1{constructor(s,e,i){super(void 0!==e.context?e.initialValue:i),this.onContextRequest=t=>{if(t.context!==this.context)return;const s=t.contextTarget??t.composedPath()[0];s!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,s,t.subscribe));},this.onProviderRequest=s=>{if(s.context!==this.context)return;if((s.contextTarget??s.composedPath()[0])===this.host)return;const e=new Set;for(const[s,{consumerHost:i}]of this.subscriptions)e.has(s)||(e.add(s),i.dispatchEvent(new s$3(this.context,i,s,true)));s.stopPropagation();},this.host=s,void 0!==e.context?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this);}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest);}hostConnected(){this.host.dispatchEvent(new e$2(this.context,this.host));}};
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @license
|
|
172
|
+
* Copyright 2020 Google LLC
|
|
173
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
174
|
+
*/
|
|
175
|
+
const a=Symbol.for(""),o$1=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litStatic$:t,r:a}),i$1=(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}),l=new Map,n=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$1(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.get(t))&&(n.raw=n,l.set(t,r=n)),e=u;}return t(r,...e)},u$1=n(x$1);
|
|
176
|
+
|
|
177
|
+
var styleCss = i$6`.body-default{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);font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.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);font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{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);font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.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);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-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-2xs-font-size, 0.625rem);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);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);font-weight:var(--wcss-display-2xl-weight, 300);line-height:var(--wcss-display-2xl-line-height, 1.3);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem))}.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);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);font-weight:var(--wcss-display-xl-weight, 300);line-height:var(--wcss-display-xl-line-height, 1.3);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem))}.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);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);font-weight:var(--wcss-display-lg-weight, 300);line-height:var(--wcss-display-lg-line-height, 1.3);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem))}.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);letter-spacing:var(--wcss-display-md-letter-spacing, 0);font-weight:var(--wcss-display-md-weight, 300);line-height:var(--wcss-display-md-line-height, 1.3);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem))}.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);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);font-weight:var(--wcss-display-sm-weight, 300);line-height:var(--wcss-display-sm-line-height, 1.3);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem))}.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);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);font-weight:var(--wcss-display-xs-weight, 300);line-height:var(--wcss-display-xs-line-height, 1.3);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem))}.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);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);font-weight:var(--wcss-heading-xl-weight, 300);line-height:var(--wcss-heading-xl-line-height, 1.3);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem))}.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);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);font-weight:var(--wcss-heading-lg-weight, 300);line-height:var(--wcss-heading-lg-line-height, 1.3);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem))}.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);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);font-weight:var(--wcss-heading-md-weight, 300);line-height:var(--wcss-heading-md-line-height, 1.3);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem))}.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);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);font-weight:var(--wcss-heading-sm-weight, 300);line-height:var(--wcss-heading-sm-line-height, 1.3);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem))}.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);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);font-weight:var(--wcss-heading-xs-weight, 450);line-height:var(--wcss-heading-xs-line-height, 1.3);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem))}.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);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);font-weight:var(--wcss-heading-2xs-weight, 450);line-height:var(--wcss-heading-2xs-line-height, 1.3);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem))}.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);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-2xl-weight, 450);line-height:var(--wcss-accent-2xl-line-height, 1);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));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);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-xl-weight, 450);line-height:var(--wcss-accent-xl-line-height, 1.3);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));text-transform:uppercase}.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);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);font-weight:var(--wcss-accent-lg-weight, 450);line-height:var(--wcss-accent-lg-line-height, 1.3);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));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);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);font-weight:var(--wcss-accent-md-weight, 500);line-height:var(--wcss-accent-md-line-height, 1.3);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));text-transform:uppercase}.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);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);font-weight:var(--wcss-accent-sm-weight, 500);line-height:var(--wcss-accent-sm-line-height, 1.3);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));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);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-xs-weight, 500);line-height:var(--wcss-accent-xs-line-height, 1.3);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));text-transform:uppercase}.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);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-2xs-weight, 450);line-height:var(--wcss-accent-2xs-line-height, 1.3);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));text-transform:uppercase}:host{cursor:pointer;user-select:none;text-overflow:ellipsis;max-width:100dvw}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-300, 1.5rem) + var(--ds-size-100, 0.5rem));padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-50, 0.25rem);border-radius:var(--ds-size-100, 0.5rem);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box]{border-radius:unset}:host .wrapper[class*=shape-snowflake]{border-radius:unset;line-height:24px}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem);line-height:26px}:host .wrapper[class*=-xl]{padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem);line-height:26px}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}[slot=displayValue]{display:none}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-300, 1.5rem) + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
178
|
+
|
|
179
|
+
var colorCss = i$6`:host .wrapper{background-color:var(--ds-auro-menuoption-container-color, transparent);box-shadow:inset 0 0 0 1px var(--ds-auro-menuoption-container-border-color, transparent);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted, #ebfafd)}:host(:focus){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand, #00274a)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-subtle, #b4eff9);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([selected]:hover),:host([selected].active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted, #ebfafd)}:host([selected]:focus){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-subtle, #b4eff9);--ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand, #00274a)}:host(:focus:hover),:host(:focus.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted, #ebfafd);--ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand, #00274a)}:host([selected]:focus:hover),:host([selected]:focus.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted, #ebfafd);--ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand, #00274a)}`;
|
|
180
|
+
|
|
137
181
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
138
182
|
// See LICENSE in the project root for license information.
|
|
139
183
|
|
|
@@ -217,21 +261,96 @@ class AuroLibraryRuntimeUtils {
|
|
|
217
261
|
}
|
|
218
262
|
}
|
|
219
263
|
|
|
220
|
-
// Copyright (c)
|
|
264
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
221
265
|
// See LICENSE in the project root for license information.
|
|
222
266
|
|
|
223
267
|
|
|
268
|
+
class AuroDependencyVersioning {
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Generates a unique string to be used for child auro element naming.
|
|
272
|
+
* @private
|
|
273
|
+
* @param {string} baseName - Defines the first part of the unique element name.
|
|
274
|
+
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
275
|
+
* @returns {string} - Unique string to be used for naming.
|
|
276
|
+
*/
|
|
277
|
+
generateElementName(baseName, version) {
|
|
278
|
+
let result = baseName;
|
|
279
|
+
|
|
280
|
+
result += '-';
|
|
281
|
+
result += version.replace(/[.]/g, '_');
|
|
282
|
+
|
|
283
|
+
return result;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Generates a unique string to be used for child auro element naming.
|
|
288
|
+
* @param {string} baseName - Defines the first part of the unique element name.
|
|
289
|
+
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
290
|
+
* @returns {string} - Unique string to be used for naming.
|
|
291
|
+
*/
|
|
292
|
+
generateTag(baseName, version, tagClass) {
|
|
293
|
+
const elementName = this.generateElementName(baseName, version);
|
|
294
|
+
const tag = i$1`${s(elementName)}`;
|
|
295
|
+
|
|
296
|
+
if (!customElements.get(elementName)) {
|
|
297
|
+
customElements.define(elementName, class extends tagClass {});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return tag;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
224
304
|
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* @returns {boolean} True if option is interactive.
|
|
305
|
+
* @license
|
|
306
|
+
* Copyright 2017 Google LLC
|
|
307
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
229
308
|
*/
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
309
|
+
const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* @license
|
|
313
|
+
* Copyright 2018 Google LLC
|
|
314
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
315
|
+
*/const e=e$1(class extends i{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.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}});
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* @license
|
|
319
|
+
* Copyright 2018 Google LLC
|
|
320
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
321
|
+
*/const o=o=>o??E;
|
|
322
|
+
|
|
323
|
+
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$3{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$6`: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}
|
|
324
|
+
`;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$6`.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}
|
|
325
|
+
`;var y=i$6`: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)}
|
|
326
|
+
`;var k=i$6`: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)}
|
|
327
|
+
`;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`
|
|
328
|
+
<div class="componentWrapper">
|
|
329
|
+
<div
|
|
330
|
+
class="${e({svgWrapper:true})}"
|
|
331
|
+
title="${o(this.title||void 0)}">
|
|
332
|
+
<span aria-hidden="${o(this.ariaHidden||true)}" part="svg">
|
|
333
|
+
${this.customSvg?x$1`
|
|
334
|
+
<slot name="svg"></slot>
|
|
335
|
+
`:x$1`
|
|
336
|
+
${this.svg}
|
|
337
|
+
`}
|
|
338
|
+
</span>
|
|
339
|
+
</div>
|
|
340
|
+
|
|
341
|
+
<div class="${e(t)}" part="label">
|
|
342
|
+
<slot></slot>
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
`}}
|
|
346
|
+
|
|
347
|
+
var iconVersion = '9.1.0';
|
|
348
|
+
|
|
349
|
+
var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"checkmark-sm__desc\" class=\"ico_squareLarge\" 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=\"checkmark-sm__desc\">a small check mark.</desc><path d=\"M8.461 11.84a.625.625 0 1 0-.922.844l2.504 2.738c.247.27.674.27.922 0l5.496-6a.625.625 0 1 0-.922-.844l-5.035 5.496z\"/></svg>"};
|
|
350
|
+
|
|
351
|
+
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
352
|
+
// See LICENSE in the project root for license information.
|
|
353
|
+
|
|
235
354
|
|
|
236
355
|
/**
|
|
237
356
|
* Helper method to dispatch custom events.
|
|
@@ -253,164 +372,1218 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
253
372
|
element.dispatchEvent(new CustomEvent(eventName, eventConfig));
|
|
254
373
|
}
|
|
255
374
|
|
|
256
|
-
|
|
257
|
-
* @license
|
|
258
|
-
* Copyright 2017 Google LLC
|
|
259
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
260
|
-
*/
|
|
261
|
-
const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});let i$1 = class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* @license
|
|
265
|
-
* Copyright 2018 Google LLC
|
|
266
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
267
|
-
*/const e=e$1(class extends i$1{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.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}});
|
|
268
|
-
|
|
269
|
-
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
375
|
+
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
270
376
|
// See LICENSE in the project root for license information.
|
|
271
377
|
|
|
272
378
|
|
|
273
|
-
|
|
274
|
-
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
275
379
|
/**
|
|
276
|
-
* The auro-menu element provides users a way to
|
|
277
|
-
*
|
|
278
|
-
* @attr {
|
|
279
|
-
* @attr {
|
|
280
|
-
* @attr {
|
|
281
|
-
* @attr {
|
|
282
|
-
* @
|
|
283
|
-
* @
|
|
284
|
-
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
285
|
-
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
286
|
-
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
287
|
-
* @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
|
|
288
|
-
* @event {CustomEvent<any>} auroMenu-selectValueFailure - Notifies that an attempt to select a menuoption by matching a value has failed.
|
|
289
|
-
* @event {CustomEvent<any>} auroMenu-selectValueReset - Notifies that the component value has been reset.
|
|
290
|
-
* @event {CustomEvent<any>} auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
|
|
291
|
-
* @slot loadingText - Text to show while loading attribute is set
|
|
292
|
-
* @slot loadingIcon - Icon to show while loading attribute is set
|
|
293
|
-
* @slot - Slot for insertion of menu options.
|
|
380
|
+
* The auro-menu element provides users a way to define a menu option.
|
|
381
|
+
*
|
|
382
|
+
* @attr {String} value - Specifies the value to be sent to a server.
|
|
383
|
+
* @attr {String} noCheckmark - When true, selected option will not show the checkmark.
|
|
384
|
+
* @attr {Boolean} disabled - When true specifies that the menuoption is disabled.
|
|
385
|
+
* @attr {Boolean} selected - Specifies that an option is selected.
|
|
386
|
+
* @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
|
|
387
|
+
* @slot - Specifies text for an option, but is not the value.
|
|
294
388
|
*/
|
|
389
|
+
class AuroMenuOption extends AuroElement {
|
|
295
390
|
|
|
296
|
-
|
|
391
|
+
/**
|
|
392
|
+
* This will register this element with the browser.
|
|
393
|
+
* @param {string} [name="auro-menuoption"] - The name of element that you want to register to.
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* AuroMenuOption.register("custom-menuoption") // this will register this element to <custom-menuoption/>
|
|
397
|
+
*
|
|
398
|
+
*/
|
|
399
|
+
static register(name = "auro-menuoption") {
|
|
400
|
+
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenuOption);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Returns whether the menu option is currently active and selectable.
|
|
405
|
+
* An option is considered active if it is not hidden, not disabled, and not static.
|
|
406
|
+
* @returns {boolean} True if the option is active, false otherwise.
|
|
407
|
+
*/
|
|
408
|
+
get isActive() {
|
|
409
|
+
return !this.hasAttribute('hidden') &&
|
|
410
|
+
!this.disabled &&
|
|
411
|
+
!this.hasAttribute('static');
|
|
412
|
+
}
|
|
297
413
|
|
|
298
|
-
class AuroMenu extends AuroElement {
|
|
299
414
|
constructor() {
|
|
300
415
|
super();
|
|
301
416
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* @private
|
|
306
|
-
*/
|
|
307
|
-
this.shape = "box";
|
|
417
|
+
this.bindEvents();
|
|
308
418
|
|
|
309
419
|
/**
|
|
310
420
|
* @private
|
|
311
421
|
*/
|
|
312
|
-
this.
|
|
313
|
-
|
|
314
|
-
// Value of the selected options
|
|
315
|
-
this.value = undefined;
|
|
316
|
-
// Currently selected option
|
|
317
|
-
this.optionSelected = undefined;
|
|
318
|
-
// String used for highlighting/filtering
|
|
319
|
-
this.matchWord = undefined;
|
|
320
|
-
// Hide the checkmark icon on selected options
|
|
321
|
-
this.noCheckmark = false;
|
|
322
|
-
// Currently active option
|
|
323
|
-
this.optionActive = undefined;
|
|
324
|
-
// Loading state
|
|
325
|
-
this.loading = false;
|
|
326
|
-
// Multi-select mode
|
|
327
|
-
this.multiSelect = false;
|
|
328
|
-
|
|
329
|
-
// Event Bindings
|
|
422
|
+
this.shape = undefined;
|
|
330
423
|
|
|
331
424
|
/**
|
|
332
425
|
* @private
|
|
333
426
|
*/
|
|
334
|
-
this.
|
|
427
|
+
this.size = undefined;
|
|
335
428
|
|
|
336
429
|
/**
|
|
337
|
-
*
|
|
430
|
+
* Generate unique names for dependency components.
|
|
338
431
|
*/
|
|
339
|
-
|
|
432
|
+
const versioning = new AuroDependencyVersioning();
|
|
433
|
+
this.iconTag = versioning.generateTag('auro-formkit-menuoption-icon', iconVersion, x);
|
|
340
434
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
this.handleOptionHover = this.handleOptionHover.bind(this);
|
|
435
|
+
this.selected = false;
|
|
436
|
+
this.noCheckmark = false;
|
|
437
|
+
this.disabled = false;
|
|
345
438
|
|
|
346
439
|
/**
|
|
347
440
|
* @private
|
|
348
441
|
*/
|
|
349
|
-
this.
|
|
442
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
350
443
|
|
|
351
|
-
//
|
|
444
|
+
// Initialize context-related properties
|
|
445
|
+
this.menuService = null;
|
|
446
|
+
this.unsubscribe = null;
|
|
352
447
|
|
|
353
448
|
/**
|
|
354
449
|
* @private
|
|
355
450
|
*/
|
|
356
|
-
|
|
357
|
-
// Root-level menu (true) or a nested submenu (false)
|
|
358
|
-
rootMenu: true,
|
|
359
|
-
// Currently focused/active menu item index
|
|
360
|
-
index: -1,
|
|
361
|
-
// Nested menu spacer
|
|
362
|
-
nestingSpacer: '<span class="nestingSpacer"></span>',
|
|
363
|
-
// Loading indicator for slot elements
|
|
364
|
-
loadingSlots: null,
|
|
365
|
-
// Store for menu items
|
|
366
|
-
items: [],
|
|
367
|
-
});
|
|
451
|
+
this.handleMenuChange = this.handleMenuChange.bind(this);
|
|
368
452
|
}
|
|
369
453
|
|
|
370
454
|
static get properties() {
|
|
371
455
|
return {
|
|
372
456
|
...super.properties,
|
|
373
|
-
noCheckmark: {
|
|
374
|
-
type: Boolean,
|
|
375
|
-
reflect: true,
|
|
376
|
-
attribute: 'nocheckmark'
|
|
377
|
-
},
|
|
378
457
|
disabled: {
|
|
379
458
|
type: Boolean,
|
|
380
459
|
reflect: true
|
|
381
460
|
},
|
|
382
|
-
|
|
383
|
-
type:
|
|
461
|
+
event: {
|
|
462
|
+
type: String,
|
|
384
463
|
reflect: true
|
|
385
464
|
},
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
465
|
+
key: {
|
|
466
|
+
type: String,
|
|
467
|
+
reflect: true
|
|
389
468
|
},
|
|
390
|
-
|
|
469
|
+
menuService: {
|
|
391
470
|
type: Object,
|
|
392
|
-
|
|
471
|
+
state: true
|
|
393
472
|
},
|
|
394
473
|
matchWord: {
|
|
395
474
|
type: String,
|
|
396
|
-
|
|
475
|
+
state: true
|
|
397
476
|
},
|
|
398
|
-
|
|
477
|
+
noCheckmark: {
|
|
399
478
|
type: Boolean,
|
|
400
|
-
reflect: true
|
|
401
|
-
|
|
479
|
+
reflect: true
|
|
480
|
+
},
|
|
481
|
+
selected: {
|
|
482
|
+
type: Boolean,
|
|
483
|
+
reflect: true
|
|
484
|
+
},
|
|
485
|
+
tabIndex: {
|
|
486
|
+
type: Number,
|
|
487
|
+
reflect: true
|
|
402
488
|
},
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* Value selected for the component.
|
|
406
|
-
*/
|
|
407
489
|
value: {
|
|
408
490
|
type: String,
|
|
409
|
-
reflect: true
|
|
410
|
-
attribute: 'value'
|
|
491
|
+
reflect: true
|
|
411
492
|
},
|
|
493
|
+
};
|
|
494
|
+
}
|
|
412
495
|
|
|
413
|
-
|
|
496
|
+
static get styles() {
|
|
497
|
+
return [
|
|
498
|
+
styleCss,
|
|
499
|
+
colorCss,
|
|
500
|
+
tokensCss
|
|
501
|
+
];
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
connectedCallback() {
|
|
505
|
+
super.connectedCallback();
|
|
506
|
+
|
|
507
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
508
|
+
// Add this step soon as this node gets attached to the DOM to avoid racing condition with menu's value setting logic.
|
|
509
|
+
this.runtimeUtils.handleComponentTagRename(this, 'auro-menuoption');
|
|
510
|
+
|
|
511
|
+
// Set up context consumption in connectedCallback
|
|
512
|
+
this._contextConsumer = new s$2(this, {
|
|
513
|
+
context: MenuContext,
|
|
514
|
+
callback: this.attachTo.bind(this),
|
|
515
|
+
subscribe: true
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
// Establish the key property as early as possible
|
|
519
|
+
const valueAttr = this.getAttribute('value');
|
|
520
|
+
const keyAttr = this.getAttribute('key');
|
|
521
|
+
this.key = keyAttr !== null ? keyAttr : valueAttr;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
firstUpdated() {
|
|
525
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
526
|
+
this.runtimeUtils.handleComponentTagRename(this, 'auro-menuoption');
|
|
527
|
+
|
|
528
|
+
this.setAttribute('role', 'option');
|
|
529
|
+
this.setAttribute('aria-selected', 'false');
|
|
530
|
+
|
|
531
|
+
this.addEventListener('mouseover', () => {
|
|
532
|
+
this.dispatchEvent(new CustomEvent('auroMenuOption-mouseover', {
|
|
533
|
+
bubbles: true,
|
|
534
|
+
cancelable: false,
|
|
535
|
+
composed: true,
|
|
536
|
+
detail: this
|
|
537
|
+
}));
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
updated(changedProperties) {
|
|
542
|
+
super.updated(changedProperties);
|
|
543
|
+
|
|
544
|
+
// Update aria-selected attribute if selected changed
|
|
545
|
+
if (changedProperties.has('selected')) {
|
|
546
|
+
|
|
547
|
+
// Update aria-selected attribute
|
|
548
|
+
this.setAttribute('aria-selected', this.selected.toString());
|
|
549
|
+
|
|
550
|
+
// Update menu service selection state if this isn't an internal update
|
|
551
|
+
if (this.internalUpdateInProgress !== true) {
|
|
552
|
+
this.menuService[this.selected ? 'selectOption' : 'deselectOption'](this);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
if (changedProperties.has('active')) {
|
|
557
|
+
this.updateActiveClasses();
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// Update text highlight if matchWord changed
|
|
561
|
+
if (changedProperties.has('matchWord')) {
|
|
562
|
+
this.updateTextHighlight();
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
// Set the key to be the passed value if no key is provided
|
|
566
|
+
if (changedProperties.has('value') && this.key === undefined) {
|
|
567
|
+
this.key = this.value;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
disconnectedCallback() {
|
|
572
|
+
if (this.menuService) {
|
|
573
|
+
this.menuService.unsubscribe(this.handleMenuChange);
|
|
574
|
+
this.menuService.removeMenuOption(this);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Sets up event listeners for user interaction with the menu option.
|
|
580
|
+
* This function enables click and mouse enter events to trigger selection and highlighting logic.
|
|
581
|
+
*/
|
|
582
|
+
bindEvents() {
|
|
583
|
+
this.addEventListener('click', this.handleClick.bind(this));
|
|
584
|
+
this.addEventListener('mouseenter', this.handleMouseEnter.bind(this));
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Attaches this menu option to a menu service and subscribes to its events.
|
|
589
|
+
* This method enables the option to participate in menu selection and highlighting logic.
|
|
590
|
+
* @param {Object} service - The menu service instance to attach to.
|
|
591
|
+
*/
|
|
592
|
+
attachTo(service) {
|
|
593
|
+
if (!service) {
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
this.menuService = service;
|
|
597
|
+
this.menuService.addMenuOption(this);
|
|
598
|
+
this.menuService.subscribe(this.handleMenuChange);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Handles changes from the menu service and updates the option's state.
|
|
603
|
+
* This function synchronizes the option's properties and selection/highlight state with menu events.
|
|
604
|
+
* @param {Object} event - The event object from the menu service.
|
|
605
|
+
*/
|
|
606
|
+
handleMenuChange(event) {
|
|
607
|
+
|
|
608
|
+
// Ignore events without a type or property
|
|
609
|
+
if (!event || (!event.type && !event.property)) {
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// Update reactive properties based on event type
|
|
614
|
+
if (event.property && Object.keys(AuroMenuOption.properties).includes(event.property)) {
|
|
615
|
+
this[event.property] = event.value;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
// Handle highlight changes
|
|
619
|
+
if (event.type === 'highlightChange') {
|
|
620
|
+
const isActive = event.option === this;
|
|
621
|
+
this.active = isActive;
|
|
622
|
+
this.updateActiveClasses();
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
if (event.type === 'stateChange') {
|
|
626
|
+
const isSelected = event.selectedOptions.includes(this);
|
|
627
|
+
this.setInternalSelected(isSelected);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Updates the internal selected state of the menu option bypassing 'updated' and triggers custom events if selected.
|
|
633
|
+
* This function ensures the option's selection state is synchronized with menu logic and notifies listeners.
|
|
634
|
+
* @param {boolean} isSelected - Whether the option should be marked as selected.
|
|
635
|
+
*/
|
|
636
|
+
setInternalSelected(isSelected) {
|
|
637
|
+
this.internalUpdateInProgress = true;
|
|
638
|
+
this.selected = isSelected;
|
|
639
|
+
|
|
640
|
+
// Fire custom event if selected
|
|
641
|
+
if (isSelected) {
|
|
642
|
+
this.handleCustomEvent();
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
setTimeout(() => {
|
|
646
|
+
this.internalUpdateInProgress = false;
|
|
647
|
+
}, 0);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Sets the selected state of the menu option.
|
|
652
|
+
* This function updates whether the option is currently selected.
|
|
653
|
+
* @param {boolean} isSelected - Whether the option should be marked as selected.
|
|
654
|
+
* @deprecated Simply modify the `selected` property directly instead.
|
|
655
|
+
*/
|
|
656
|
+
setSelected(isSelected) {
|
|
657
|
+
this.selected = isSelected;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Updates the active state and visual highlighting of the menu option.
|
|
662
|
+
* This function toggles the option's active status and applies or removes the active CSS class.
|
|
663
|
+
* @param {boolean} isActive - Whether the option should be marked as active.
|
|
664
|
+
* @deprecated Simply modify the `active` property directly instead.
|
|
665
|
+
*/
|
|
666
|
+
updateActive(isActive) {
|
|
667
|
+
|
|
668
|
+
// Set active state
|
|
669
|
+
this.active = isActive;
|
|
670
|
+
this.updateActiveClasses();
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Updates the CSS class for the menu option based on its active state.
|
|
675
|
+
* This function adds or removes the 'active' class to visually indicate the option's active status.
|
|
676
|
+
* @private
|
|
677
|
+
*/
|
|
678
|
+
updateActiveClasses() {
|
|
679
|
+
// Update class based on active state
|
|
680
|
+
if (this.active) this.classList.add('active');
|
|
681
|
+
else this.classList.remove('active');
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Updates the visual highlighting of text within the menu option based on the current match word.
|
|
687
|
+
* This function highlights matching text segments and manages nested spacers for display formatting.
|
|
688
|
+
* @private
|
|
689
|
+
*/
|
|
690
|
+
updateTextHighlight() {
|
|
691
|
+
|
|
692
|
+
// Regex for matchWord if needed
|
|
693
|
+
let regexWord = null;
|
|
694
|
+
|
|
695
|
+
if (this.matchWord && this.matchWord.length) {
|
|
696
|
+
const escapedWord = this.matchWord.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
|
|
697
|
+
regexWord = new RegExp(escapedWord, 'giu');
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
// Update text highlighting if matchWord changed
|
|
701
|
+
if (regexWord &&
|
|
702
|
+
this.isActive && !this.hasAttribute('persistent')) {
|
|
703
|
+
const nested = this.querySelectorAll('.nestingSpacer');
|
|
704
|
+
|
|
705
|
+
const displayValueEl = this.querySelector('[slot="displayValue"]');
|
|
706
|
+
if (displayValueEl) {
|
|
707
|
+
this.removeChild(displayValueEl);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
// Create nested spacers
|
|
711
|
+
const nestingSpacerBundle = [...nested].map(() => this.nestingSpacer).join('');
|
|
712
|
+
|
|
713
|
+
// Update with spacers and matchWord
|
|
714
|
+
this.innerHTML = nestingSpacerBundle +
|
|
715
|
+
this.textContent.replace(
|
|
716
|
+
regexWord,
|
|
717
|
+
(match) => `<strong>${match}</strong>`
|
|
718
|
+
);
|
|
719
|
+
if (displayValueEl) {
|
|
720
|
+
this.append(displayValueEl);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* Handles click events on the menu option, toggling its selected state.
|
|
727
|
+
* This function dispatches a click event and updates selection if the option is not disabled.
|
|
728
|
+
* @private
|
|
729
|
+
*/
|
|
730
|
+
handleClick() {
|
|
731
|
+
if (!this.disabled) {
|
|
732
|
+
this.dispatchClickEvent();
|
|
733
|
+
this.selected = !this.selected;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Handles mouse enter events to highlight the menu option.
|
|
739
|
+
* This function updates the menu service to set this option as the currently highlighted item if not disabled.
|
|
740
|
+
* @private
|
|
741
|
+
*/
|
|
742
|
+
handleMouseEnter() {
|
|
743
|
+
if (!this.disabled) {
|
|
744
|
+
this.menuService.setHighlightedOption(this);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Dispatches custom events defined for this menu option.
|
|
750
|
+
* This function notifies listeners when a custom event is triggered by the option.
|
|
751
|
+
* @private
|
|
752
|
+
*/
|
|
753
|
+
handleCustomEvent() {
|
|
754
|
+
if (this.event) {
|
|
755
|
+
dispatchMenuEvent(this, this.event, { option: this });
|
|
756
|
+
dispatchMenuEvent(this, 'auroMenu-customEventFired', { option: this });
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Dispatches a click event for this menu option.
|
|
762
|
+
* This function notifies listeners that the option has been clicked.
|
|
763
|
+
* @private
|
|
764
|
+
*/
|
|
765
|
+
dispatchClickEvent() {
|
|
766
|
+
this.dispatchEvent(new CustomEvent('auroMenuOption-click', {
|
|
767
|
+
bubbles: true,
|
|
768
|
+
cancelable: false,
|
|
769
|
+
composed: true,
|
|
770
|
+
detail: this
|
|
771
|
+
}));
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Generates an HTML element containing an SVG icon based on the provided `svgContent`.
|
|
776
|
+
*
|
|
777
|
+
* @private
|
|
778
|
+
* @param {string} svgContent - The SVG content to be embedded.
|
|
779
|
+
* @returns {Element} The HTML element containing the SVG icon.
|
|
780
|
+
*/
|
|
781
|
+
generateIconHtml(svgContent) {
|
|
782
|
+
const dom = new DOMParser().parseFromString(svgContent, 'text/html');
|
|
783
|
+
const svg = dom.body.firstChild;
|
|
784
|
+
|
|
785
|
+
svg.setAttribute('slot', 'svg');
|
|
786
|
+
|
|
787
|
+
return u$1`<${this.iconTag} customColor customSvg>${svg}</${this.iconTag}>`;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Logic to determine the layout of the component.
|
|
792
|
+
* @protected
|
|
793
|
+
* @returns {void}
|
|
794
|
+
*/
|
|
795
|
+
renderLayout() {
|
|
796
|
+
|
|
797
|
+
const fontClassMap = {
|
|
798
|
+
xs: 'body-sm',
|
|
799
|
+
sm: 'body-default',
|
|
800
|
+
md: 'body-default',
|
|
801
|
+
lg: 'body-lg',
|
|
802
|
+
xl: 'body-lg'
|
|
803
|
+
};
|
|
804
|
+
|
|
805
|
+
const classes = e({
|
|
806
|
+
'wrapper': true,
|
|
807
|
+
[this.size ? fontClassMap[this.size] : 'body-sm']: true,
|
|
808
|
+
});
|
|
809
|
+
|
|
810
|
+
return u$1`
|
|
811
|
+
<div class="${classes}">
|
|
812
|
+
${this.selected && !this.noCheckmark
|
|
813
|
+
? this.generateIconHtml(checkmarkIcon.svg)
|
|
814
|
+
: undefined}
|
|
815
|
+
<slot></slot>
|
|
816
|
+
</div>
|
|
817
|
+
`;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/* eslint-disable */
|
|
822
|
+
|
|
823
|
+
class MenuService {
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* PROPERTIES AND GETTERS
|
|
827
|
+
*/
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* Gets the list of registered menu options.
|
|
831
|
+
* @returns {AuroMenuOption[]}
|
|
832
|
+
*/
|
|
833
|
+
get menuOptions() {
|
|
834
|
+
return this._menuOptions;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Gets the currently highlighted option.
|
|
839
|
+
* @returns {AuroMenuOption|null}
|
|
840
|
+
*/
|
|
841
|
+
get highlightedOption() {
|
|
842
|
+
return this._menuOptions[this.highlightedIndex] || null;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* Gets the current value(s) of the selected option(s).
|
|
847
|
+
* @returns {string|string[]|undefined}
|
|
848
|
+
*/
|
|
849
|
+
get currentValue() {
|
|
850
|
+
const values = (this.selectedOptions || []).map(option => option.value);
|
|
851
|
+
return this.multiSelect ? values : values[0];
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Gets the label(s) of the currently selected option(s).
|
|
856
|
+
* @returns {string}
|
|
857
|
+
*/
|
|
858
|
+
get currentLabel() {
|
|
859
|
+
const labels = (this.selectedOptions || []).map(option => option.textContent);
|
|
860
|
+
return this.multiSelect ? labels.join(", ") : labels[0] || '';
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* Gets the string representation of the current value(s).
|
|
865
|
+
* For multi-select, this is a JSON stringified array.
|
|
866
|
+
* @returns {string|undefined}
|
|
867
|
+
*/
|
|
868
|
+
get stringValue() {
|
|
869
|
+
const { currentValue } = this;
|
|
870
|
+
|
|
871
|
+
if (Array.isArray(currentValue)) {
|
|
872
|
+
if (currentValue.length > 0) {
|
|
873
|
+
return JSON.stringify(currentValue);
|
|
874
|
+
}
|
|
875
|
+
return undefined;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
if (typeof currentValue === 'string') {
|
|
879
|
+
if (currentValue.length > 0) {
|
|
880
|
+
return currentValue;
|
|
881
|
+
}
|
|
882
|
+
return undefined;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
// Future: handle other types here (e.g., number, object, etc.)
|
|
886
|
+
return undefined;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Gets the key(s) of the currently selected option(s).
|
|
891
|
+
* @returns {string|string[]|undefined}
|
|
892
|
+
*/
|
|
893
|
+
get currentKeys() {
|
|
894
|
+
const keys = (this.selectedOptions || []).map(option => option.key);
|
|
895
|
+
return this.multiSelect ? keys : keys[0];
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* CONSTRUCTOR
|
|
900
|
+
*/
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* Creates a new MenuService instance.
|
|
904
|
+
* @param {Object} options - The options object.
|
|
905
|
+
* @param {AuroMenu} options.host - The host element that this service will control. Required.
|
|
906
|
+
* @throws {Error} If the host is not provided.
|
|
907
|
+
*/
|
|
908
|
+
constructor({ host } = {}) {
|
|
909
|
+
|
|
910
|
+
// Ensure a host was passed
|
|
911
|
+
if (!host) {
|
|
912
|
+
throw new Error("MenuService requires a host element.");
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
// Attach the service to the host
|
|
916
|
+
this.host = host;
|
|
917
|
+
this.host.addController(this);
|
|
918
|
+
|
|
919
|
+
// Set default properties
|
|
920
|
+
this.size = undefined;
|
|
921
|
+
this.shape = undefined;
|
|
922
|
+
this.noCheckmark = undefined;
|
|
923
|
+
this.disabled = undefined;
|
|
924
|
+
this.matchWord = undefined;
|
|
925
|
+
this.multiSelect = undefined;
|
|
926
|
+
this.allowDeselect = undefined;
|
|
927
|
+
this.selectAllMatchingOptions = undefined;
|
|
928
|
+
|
|
929
|
+
this.highlightedIndex = -1;
|
|
930
|
+
|
|
931
|
+
this._menuOptions = [];
|
|
932
|
+
this._subscribers = [];
|
|
933
|
+
this.internalUpdateInProgress = false;
|
|
934
|
+
this.selectedOptions = [];
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* PROPERTY SYNCING
|
|
939
|
+
*/
|
|
940
|
+
|
|
941
|
+
/**
|
|
942
|
+
* Handles host updates.
|
|
943
|
+
* This is a lit reactive lifecycle method.
|
|
944
|
+
* This comes from the Lit controller interface provided by adding this service as a controller to the host.
|
|
945
|
+
* See constructor for `this.host.addController(this)`
|
|
946
|
+
* You can read more about Lit reactive controllers here: https://lit.dev/docs/composition/controllers/
|
|
947
|
+
*/
|
|
948
|
+
hostUpdated() {
|
|
949
|
+
|
|
950
|
+
// Reset selection if multiSelect mode changes
|
|
951
|
+
if (this.host.multiSelect !== this.multiSelect) {
|
|
952
|
+
this.selectedOptions = [];
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
// Update properties on host update
|
|
956
|
+
this.setProperties({
|
|
957
|
+
size: this.host.size,
|
|
958
|
+
shape: this.host.shape,
|
|
959
|
+
noCheckmark: this.host.noCheckmark,
|
|
960
|
+
disabled: this.host.disabled,
|
|
961
|
+
matchWord: this.host.matchWord,
|
|
962
|
+
multiSelect: this.host.multiSelect,
|
|
963
|
+
allowDeselect: this.host.allowDeselect,
|
|
964
|
+
selectAllMatchingOptions: this.host.selectAllMatchingOptions
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
/**
|
|
969
|
+
* Handles host disconnection and memory cleanup.
|
|
970
|
+
*/
|
|
971
|
+
hostDisconnected() {
|
|
972
|
+
this._subscribers = [];
|
|
973
|
+
this._menuOptions = [];
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* Sets a property value if it exists on the instance and the value has changed.
|
|
978
|
+
* @param {string} property
|
|
979
|
+
* @param {any} value
|
|
980
|
+
*/
|
|
981
|
+
setProperty(property, value) {
|
|
982
|
+
|
|
983
|
+
// Only update if we are tracking the property in this service
|
|
984
|
+
if (this.hasOwnProperty(property)) {
|
|
985
|
+
|
|
986
|
+
// Check if the value has changed
|
|
987
|
+
const valueChanged = this[property] !== value;
|
|
988
|
+
|
|
989
|
+
// Update and notify if changed
|
|
990
|
+
if (valueChanged) {
|
|
991
|
+
this[property] = value;
|
|
992
|
+
this.notify({ property, value });
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Sets multiple properties on the instance.
|
|
999
|
+
* @param {Object} properties - Key-value pairs of properties to set.
|
|
1000
|
+
*/
|
|
1001
|
+
setProperties(properties) {
|
|
1002
|
+
for (const [key, value] of Object.entries(properties)) {
|
|
1003
|
+
this.setProperty(key, value);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* MENU OPTION HIGHLIGHTING
|
|
1009
|
+
*/
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* Highlights the next active option in the menu.
|
|
1013
|
+
*/
|
|
1014
|
+
highlightNext() {
|
|
1015
|
+
this.moveHighlightedOption("next");
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* Highlights the previous active option in the menu.
|
|
1020
|
+
*/
|
|
1021
|
+
highlightPrevious() {
|
|
1022
|
+
this.moveHighlightedOption("previous");
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* Moves the highlighted option in the specified direction.
|
|
1027
|
+
* @param {string} direction - The direction to move the highlight ("next" or "previous").
|
|
1028
|
+
*/
|
|
1029
|
+
moveHighlightedOption(direction) {
|
|
1030
|
+
|
|
1031
|
+
// Get the active options
|
|
1032
|
+
const activeOptions = this._menuOptions.filter(option => option.isActive);
|
|
1033
|
+
|
|
1034
|
+
// Get the currently active option
|
|
1035
|
+
const currentActiveOption = activeOptions[activeOptions.indexOf(this.highlightedOption)];
|
|
1036
|
+
|
|
1037
|
+
// Determine the new index based on the currently active option and direction
|
|
1038
|
+
let newIndex = currentActiveOption
|
|
1039
|
+
? direction === "previous"
|
|
1040
|
+
? activeOptions.indexOf(currentActiveOption) - 1
|
|
1041
|
+
: activeOptions.indexOf(currentActiveOption) + 1
|
|
1042
|
+
: direction === "previous"
|
|
1043
|
+
? activeOptions.length - 1
|
|
1044
|
+
: 0;
|
|
1045
|
+
|
|
1046
|
+
// Wrap around the index if needed
|
|
1047
|
+
newIndex = newIndex < 0 ? activeOptions.length - 1 : newIndex >= activeOptions.length ? 0 : newIndex;
|
|
1048
|
+
|
|
1049
|
+
// Get the new active option and set it as highlighted
|
|
1050
|
+
const newActiveOption = activeOptions[newIndex];
|
|
1051
|
+
this.setHighlightedOption(newActiveOption);
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
/**
|
|
1055
|
+
* Sets the highlighted index to the specified option.
|
|
1056
|
+
* @param {AuroMenuOption} option - The option to highlight.
|
|
1057
|
+
*/
|
|
1058
|
+
setHighlightedOption(option) {
|
|
1059
|
+
|
|
1060
|
+
if (!option) return;
|
|
1061
|
+
|
|
1062
|
+
// Get the index of the option to highlight
|
|
1063
|
+
const index = this._menuOptions.indexOf(option);
|
|
1064
|
+
|
|
1065
|
+
// Update highlighted index
|
|
1066
|
+
this.highlightedIndex = index;
|
|
1067
|
+
|
|
1068
|
+
// Notify subscribers of highlight change
|
|
1069
|
+
this.notify({ type: 'highlightChange', option, index: this.highlightedIndex });
|
|
1070
|
+
|
|
1071
|
+
// Dispatch the change event
|
|
1072
|
+
this.dispatchChangeEvent('auroMenu-activatedOption', option);
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
/**
|
|
1076
|
+
* Sets the highlighted option to the option at the specified index if it exists.
|
|
1077
|
+
* @param {number} index
|
|
1078
|
+
*/
|
|
1079
|
+
setHighlightedIndex(index) {
|
|
1080
|
+
const option = this._menuOptions[index] || null;
|
|
1081
|
+
this.setHighlightedOption(option);
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
/**
|
|
1085
|
+
* Selects the currently highlighted option.
|
|
1086
|
+
*/
|
|
1087
|
+
selectHighlightedOption() {
|
|
1088
|
+
if (this.highlightedOption) {
|
|
1089
|
+
this.toggleOption(this.highlightedOption);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* SELECTION AND DESELECTION METHODS
|
|
1095
|
+
*/
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* Selects one or more options in a batch operation
|
|
1099
|
+
* @param {AuroMenuOption|AuroMenuOption[]} options - Single option or array of options to select
|
|
1100
|
+
*/
|
|
1101
|
+
selectOptions(options) {
|
|
1102
|
+
let optionsToSelect = Array.isArray(options) ? options : [options];
|
|
1103
|
+
|
|
1104
|
+
// Filter out options that are inactive
|
|
1105
|
+
optionsToSelect = optionsToSelect.filter(option => option.isActive);
|
|
1106
|
+
|
|
1107
|
+
if (!optionsToSelect.length) return;
|
|
1108
|
+
|
|
1109
|
+
if (this.multiSelect) {
|
|
1110
|
+
this.selectedOptions = [...(this.selectedOptions || []), ...optionsToSelect];
|
|
1111
|
+
} else {
|
|
1112
|
+
// In single select mode, only take the last option
|
|
1113
|
+
this.selectedOptions = [optionsToSelect[optionsToSelect.length - 1]];
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
this.stageUpdate();
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
/**
|
|
1120
|
+
* Deselects one or more options in a batch operation
|
|
1121
|
+
* @param {AuroMenuOption|AuroMenuOption[]} options - Single option or array of options to deselect
|
|
1122
|
+
*/
|
|
1123
|
+
deselectOptions(options) {
|
|
1124
|
+
const optionsToDeselect = Array.isArray(options) ? options : [options];
|
|
1125
|
+
|
|
1126
|
+
if (!optionsToDeselect.length) return;
|
|
1127
|
+
|
|
1128
|
+
// Check if deselection should be prevented
|
|
1129
|
+
const shouldPreventDeselect = !this.allowDeselect && !this.multiSelect;
|
|
1130
|
+
const isOnlySelectedOption = this.selectedOptions.length === 1 && optionsToDeselect.includes(this.selectedOptions[0]);
|
|
1131
|
+
|
|
1132
|
+
// Prevent deselecting the only selected option if not allowed
|
|
1133
|
+
if (shouldPreventDeselect && isOnlySelectedOption) return;
|
|
1134
|
+
|
|
1135
|
+
const optionsSet = new Set(optionsToDeselect);
|
|
1136
|
+
this.selectedOptions = (this.selectedOptions || [])
|
|
1137
|
+
.filter(opt => !optionsSet.has(opt));
|
|
1138
|
+
|
|
1139
|
+
this.stageUpdate();
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* Selects a single option.
|
|
1144
|
+
* @param {AuroMenuOption} option
|
|
1145
|
+
*/
|
|
1146
|
+
selectOption(option) {
|
|
1147
|
+
this.selectOptions(option);
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* Deselects a single option.
|
|
1152
|
+
* @param {AuroMenuOption} option
|
|
1153
|
+
*/
|
|
1154
|
+
deselectOption(option) {
|
|
1155
|
+
this.deselectOptions(option);
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* Toggles the selection state of a single option.
|
|
1160
|
+
* @param {AuroMenuOption} option
|
|
1161
|
+
*/
|
|
1162
|
+
toggleOption(option) {
|
|
1163
|
+
if (option.selected) {
|
|
1164
|
+
this.deselectOption(option);
|
|
1165
|
+
} else {
|
|
1166
|
+
this.selectOption(option);
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
/**
|
|
1171
|
+
* Selects options based on their value(s) when compared to a passed value or values.
|
|
1172
|
+
* Value or values are normalized to an array of strings that can be matched to option keys.
|
|
1173
|
+
* @param {string|number|Array<string|number>} value - The value(s) to select.
|
|
1174
|
+
*/
|
|
1175
|
+
selectByValue(value) {
|
|
1176
|
+
// Early exit for invalid/empty values or internal updates
|
|
1177
|
+
if (this.internalUpdateInProgress ||
|
|
1178
|
+
this.host.internalUpdateInProgress ||
|
|
1179
|
+
value === undefined ||
|
|
1180
|
+
value === null ||
|
|
1181
|
+
(Array.isArray(value) && value.length === 0) ||
|
|
1182
|
+
(typeof value === 'string' && value.trim() === '')) {
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
this.reset();
|
|
1187
|
+
|
|
1188
|
+
// Normalize values to array of strings
|
|
1189
|
+
const normalizedValues = this._getNormalizedValues(value);
|
|
1190
|
+
|
|
1191
|
+
// Validate for single-select mode
|
|
1192
|
+
let validatedValues = normalizedValues;
|
|
1193
|
+
if (normalizedValues.length > 1 && !this.multiSelect) {
|
|
1194
|
+
console.warn("MenuService - Multiple values provided for single-select menu. Only the first value will be selected.");
|
|
1195
|
+
validatedValues = [normalizedValues[0]];
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
// Find matching options by comparing available options to validated values
|
|
1199
|
+
const trackedKeys = new Set();
|
|
1200
|
+
const optionsToSelect = this._menuOptions.filter(option => {
|
|
1201
|
+
const passesFilter = validatedValues.includes(option.key);
|
|
1202
|
+
const alreadyTracked = trackedKeys.has(option.key);
|
|
1203
|
+
|
|
1204
|
+
trackedKeys.add(option.key);
|
|
1205
|
+
|
|
1206
|
+
// Include the option in the options to be selected if it passes the filter check and
|
|
1207
|
+
// either hasn't been tracked yet or selectAllMatchingOptions is true
|
|
1208
|
+
return passesFilter && (!alreadyTracked || (alreadyTracked && this.selectAllMatchingOptions));
|
|
1209
|
+
});
|
|
1210
|
+
|
|
1211
|
+
// Handle selection result
|
|
1212
|
+
if (optionsToSelect.length && !this.optionsArraysMatch(optionsToSelect, this.selectedOptions)) {
|
|
1213
|
+
this.selectOptions(optionsToSelect);
|
|
1214
|
+
} else {
|
|
1215
|
+
this.stageUpdate();
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
// Dispatch failure event if no matches found
|
|
1219
|
+
if (!optionsToSelect.length && validatedValues.length) {
|
|
1220
|
+
this.dispatchChangeEvent('auroMenu-selectValueFailure', {
|
|
1221
|
+
message: 'No matching options found for the provided value(s).',
|
|
1222
|
+
values: validatedValues
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* Resets the selected options to an empty array.
|
|
1229
|
+
*/
|
|
1230
|
+
reset() {
|
|
1231
|
+
const previousOptions = [...this.selectedOptions];
|
|
1232
|
+
this.selectedOptions = [];
|
|
1233
|
+
|
|
1234
|
+
// Single update after clearing all
|
|
1235
|
+
if (previousOptions.length) {
|
|
1236
|
+
this.stageUpdate();
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* SUBSCRIPTION, NOTIFICATION AND EVENT DISPATCH METHODS
|
|
1242
|
+
*/
|
|
1243
|
+
|
|
1244
|
+
/**
|
|
1245
|
+
* Subscribes a callback to menu service events.
|
|
1246
|
+
* @param {Function} callback - The callback to invoke on events.
|
|
1247
|
+
*/
|
|
1248
|
+
subscribe(callback) {
|
|
1249
|
+
this._subscribers.push(callback);
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* Remove a previously subscribed callback from menu service events.
|
|
1254
|
+
* @param {Function} callback
|
|
1255
|
+
*/
|
|
1256
|
+
unsubscribe(callback) {
|
|
1257
|
+
this._subscribers = this._subscribers.filter(cb => cb !== callback);
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
/**
|
|
1261
|
+
* Stages an update to notify subscribers of state and value changes.
|
|
1262
|
+
*/
|
|
1263
|
+
stageUpdate() {
|
|
1264
|
+
this.notifyStateChange();
|
|
1265
|
+
this.notifyValueChange();
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* Notifies subscribers of a menu service event.
|
|
1270
|
+
* All notifications are sent to all subscribers.
|
|
1271
|
+
* @param {string} event - The event to send to subscribers.
|
|
1272
|
+
*/
|
|
1273
|
+
notify(event) {
|
|
1274
|
+
this._subscribers.forEach(callback => callback(event));
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
/**
|
|
1278
|
+
* Notifies subscribers of a state change (selected options has changed).
|
|
1279
|
+
*/
|
|
1280
|
+
notifyStateChange() {
|
|
1281
|
+
this.notify({ type: 'stateChange', selectedOptions: this.selectedOptions });
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* Notifies subscribers of a value change (current value has changed).
|
|
1286
|
+
*/
|
|
1287
|
+
notifyValueChange() {
|
|
1288
|
+
|
|
1289
|
+
// Prepare details for the event
|
|
1290
|
+
const details = {
|
|
1291
|
+
value: this.currentValue,
|
|
1292
|
+
stringValue: this.stringValue,
|
|
1293
|
+
keys: this.currentKeys,
|
|
1294
|
+
options: this.selectedOptions,
|
|
1295
|
+
label: this.currentLabel
|
|
1296
|
+
};
|
|
1297
|
+
|
|
1298
|
+
// If only one option is selected, include its index
|
|
1299
|
+
if (this.selectedOptions.length === 1) details.index = this._menuOptions.indexOf(this.selectedOptions[0]);
|
|
1300
|
+
|
|
1301
|
+
this.notify({
|
|
1302
|
+
type: 'valueChange',
|
|
1303
|
+
...details
|
|
1304
|
+
});
|
|
1305
|
+
|
|
1306
|
+
this.dispatchChangeEvent('auroMenu-selectedOption', details);
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
/**
|
|
1310
|
+
* Dispatches a custom event from the host element.
|
|
1311
|
+
* @param {string} eventName
|
|
1312
|
+
* @param {any} detail
|
|
1313
|
+
*/
|
|
1314
|
+
dispatchChangeEvent(eventName, detail) {
|
|
1315
|
+
this.host.dispatchEvent(new CustomEvent(eventName, {
|
|
1316
|
+
bubbles: true,
|
|
1317
|
+
cancelable: false,
|
|
1318
|
+
composed: true,
|
|
1319
|
+
detail
|
|
1320
|
+
}));
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
/**
|
|
1324
|
+
* MENU OPTION MANAGEMENT METHODS
|
|
1325
|
+
*/
|
|
1326
|
+
|
|
1327
|
+
/**
|
|
1328
|
+
* Adds a menu option to the service's list.
|
|
1329
|
+
* @param {AuroMenuOption} option - the option to track
|
|
1330
|
+
*/
|
|
1331
|
+
addMenuOption(option) {
|
|
1332
|
+
this._menuOptions.push(option);
|
|
1333
|
+
this.notify({ type: 'optionsChange', options: this._menuOptions });
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
/**
|
|
1337
|
+
* Removes a menu option from the service's list.
|
|
1338
|
+
* @param {AuroMenuOption} option - the option to remove
|
|
1339
|
+
*/
|
|
1340
|
+
removeMenuOption(option) {
|
|
1341
|
+
this._menuOptions = this._menuOptions.filter(opt => opt !== option);
|
|
1342
|
+
this.notify({ type: 'optionsChange', options: this._menuOptions });
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* UTILITIES
|
|
1347
|
+
*/
|
|
1348
|
+
|
|
1349
|
+
/**
|
|
1350
|
+
* Normalizes a value or array of values into an array of strings for option selection.
|
|
1351
|
+
* This function ensures that input values are consistently formatted for matching menu options.
|
|
1352
|
+
*
|
|
1353
|
+
* @param {string|number|Array<string|number>} value - The value(s) to normalize.
|
|
1354
|
+
* @returns {Array<string>} An array of string values suitable for option matching.
|
|
1355
|
+
* @throws {Error} If any value is not a string or number.
|
|
1356
|
+
*/
|
|
1357
|
+
_getNormalizedValues(value) {
|
|
1358
|
+
let values = value;
|
|
1359
|
+
|
|
1360
|
+
// Handle JSON string and single value string input
|
|
1361
|
+
if (!Array.isArray(values) && typeof values === 'string') {
|
|
1362
|
+
|
|
1363
|
+
// Attempt to parse as JSON array
|
|
1364
|
+
try {
|
|
1365
|
+
|
|
1366
|
+
// Normalize single quotes to double quotes for JSON parsing
|
|
1367
|
+
// This will not handle complex cases but will cover basic usage
|
|
1368
|
+
const parseValue = values.replace(/'([^']*?)'/g, '"$1"');
|
|
1369
|
+
|
|
1370
|
+
// Attempt parse
|
|
1371
|
+
const parsed = JSON.parse(parseValue);
|
|
1372
|
+
|
|
1373
|
+
// Ensure parsed value is an array
|
|
1374
|
+
if (!Array.isArray(parsed)) throw new Error('Not an array');
|
|
1375
|
+
|
|
1376
|
+
// Set values to parsed array
|
|
1377
|
+
values = parsed;
|
|
1378
|
+
} catch (err) {
|
|
1379
|
+
|
|
1380
|
+
// If parsing fails, treat as single value
|
|
1381
|
+
values = [value];
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
// Handle a single number being passed
|
|
1386
|
+
if (typeof values === 'number') {
|
|
1387
|
+
values = [String(values)];
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
// Coerce each value to string and validate types
|
|
1391
|
+
values.forEach((val, index) => {
|
|
1392
|
+
|
|
1393
|
+
// Throw an error for invalid value types
|
|
1394
|
+
if (typeof val !== 'string' && typeof val !== 'number') {
|
|
1395
|
+
throw new Error('Value contains invalid value type. Supported types are string and number.');
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
// Convert numbers to strings for consistency
|
|
1399
|
+
if (typeof val === 'number') {
|
|
1400
|
+
values[index] = String(val);
|
|
1401
|
+
}
|
|
1402
|
+
});
|
|
1403
|
+
|
|
1404
|
+
// Return the resulting array of string values
|
|
1405
|
+
return values;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* Returns whether two arrays of options contain the same elements.
|
|
1410
|
+
* @param {AuroMenuOption[]} arr1 - First array of options.
|
|
1411
|
+
* @param {AuroMenuOption[]} arr2 - Second array of options.
|
|
1412
|
+
* @returns {boolean} True if arrays match, false otherwise.
|
|
1413
|
+
*/
|
|
1414
|
+
optionsArraysMatch(arr1, arr2) {
|
|
1415
|
+
if (arr1.length !== arr2.length) return false;
|
|
1416
|
+
|
|
1417
|
+
const set1 = new Set(arr1);
|
|
1418
|
+
const set2 = new Set(arr2);
|
|
1419
|
+
|
|
1420
|
+
for (let item of set1) {
|
|
1421
|
+
if (!set2.has(item)) {
|
|
1422
|
+
return false;
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
return true;
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
const MenuContext = n$1('menu-context');
|
|
1431
|
+
|
|
1432
|
+
/* eslint-disable no-underscore-dangle, curly */
|
|
1433
|
+
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
1434
|
+
// See LICENSE in the project root for license information.
|
|
1435
|
+
|
|
1436
|
+
|
|
1437
|
+
|
|
1438
|
+
/**
|
|
1439
|
+
* The auro-menu element provides users a way to select from a list of options.
|
|
1440
|
+
* @attr {HTMLElement|Array<HTMLElement>} optionSelected - An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements.
|
|
1441
|
+
* @attr {object} optionactive - Specifies the current active menuOption.
|
|
1442
|
+
* @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
|
|
1443
|
+
* @attr {boolean} disabled - When true, the entire menu and all options are disabled;
|
|
1444
|
+
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
1445
|
+
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
1446
|
+
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
1447
|
+
* @attr {boolean} selectAllMatchingOptions - When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
|
|
1448
|
+
* @attr {string} value - The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
|
|
1449
|
+
* @prop {string} size - Sets the size of the menu. Accepted values are 'sm' and 'md'. Default is 'sm'.
|
|
1450
|
+
* @prop {string} shape - Sets the shape of the menu options. Accepted values are 'box' and 'round'. Default is 'box'.
|
|
1451
|
+
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
1452
|
+
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
1453
|
+
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
1454
|
+
* @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
|
|
1455
|
+
* @event {CustomEvent<any>} auroMenu-selectValueFailure - Notifies that an attempt to select a menuoption by matching a value has failed.
|
|
1456
|
+
* @event {CustomEvent<any>} auroMenu-selectValueReset - Notifies that the component value has been reset.
|
|
1457
|
+
* @event {CustomEvent<any>} auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
|
|
1458
|
+
* @slot loadingText - Text to show while loading attribute is set
|
|
1459
|
+
* @slot loadingIcon - Icon to show while loading attribute is set
|
|
1460
|
+
* @slot - Slot for insertion of menu options.
|
|
1461
|
+
*/
|
|
1462
|
+
|
|
1463
|
+
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens */
|
|
1464
|
+
|
|
1465
|
+
class AuroMenu extends AuroElement {
|
|
1466
|
+
|
|
1467
|
+
constructor() {
|
|
1468
|
+
super();
|
|
1469
|
+
|
|
1470
|
+
// State properties (reactive)
|
|
1471
|
+
|
|
1472
|
+
/**
|
|
1473
|
+
* @private
|
|
1474
|
+
*/
|
|
1475
|
+
this.shape = "box";
|
|
1476
|
+
|
|
1477
|
+
/**
|
|
1478
|
+
* @private
|
|
1479
|
+
*/
|
|
1480
|
+
this.size = "sm";
|
|
1481
|
+
|
|
1482
|
+
// Value of the selected options
|
|
1483
|
+
this.value = undefined;
|
|
1484
|
+
// Currently selected option
|
|
1485
|
+
this.optionSelected = undefined;
|
|
1486
|
+
// String used for highlighting/filtering
|
|
1487
|
+
this.matchWord = undefined;
|
|
1488
|
+
// Hide the checkmark icon on selected options
|
|
1489
|
+
this.noCheckmark = false;
|
|
1490
|
+
// Currently active option
|
|
1491
|
+
this.optionActive = undefined;
|
|
1492
|
+
// Loading state
|
|
1493
|
+
this.loading = false;
|
|
1494
|
+
// Multi-select mode
|
|
1495
|
+
this.multiSelect = false;
|
|
1496
|
+
// Allow deselecting of menu options
|
|
1497
|
+
this.allowDeselect = false;
|
|
1498
|
+
// Select all matching options when setting value in multi-select mode
|
|
1499
|
+
this.selectAllMatchingOptions = false;
|
|
1500
|
+
|
|
1501
|
+
// Event Bindings
|
|
1502
|
+
|
|
1503
|
+
/**
|
|
1504
|
+
* @private
|
|
1505
|
+
*/
|
|
1506
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
1507
|
+
|
|
1508
|
+
|
|
1509
|
+
/**
|
|
1510
|
+
* @private
|
|
1511
|
+
*/
|
|
1512
|
+
this.handleSlotChange = this.handleSlotChange.bind(this);
|
|
1513
|
+
|
|
1514
|
+
// Instance properties (non-reactive)
|
|
1515
|
+
|
|
1516
|
+
/**
|
|
1517
|
+
* @private
|
|
1518
|
+
*/
|
|
1519
|
+
Object.assign(this, {
|
|
1520
|
+
// Root-level menu (true) or a nested submenu (false)
|
|
1521
|
+
rootMenu: true,
|
|
1522
|
+
// Currently focused/active menu item index
|
|
1523
|
+
_index: -1,
|
|
1524
|
+
// Nested menu spacer
|
|
1525
|
+
nestingSpacer: '<span class="nestingSpacer"></span>',
|
|
1526
|
+
// Loading indicator for slot elements
|
|
1527
|
+
loadingSlots: null,
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
static get properties() {
|
|
1532
|
+
return {
|
|
1533
|
+
...super.properties,
|
|
1534
|
+
|
|
1535
|
+
/**
|
|
1536
|
+
* Allows deselecting an already selected option when clicked again in single-select mode.
|
|
1537
|
+
*/
|
|
1538
|
+
allowDeselect: {
|
|
1539
|
+
type: Boolean,
|
|
1540
|
+
reflect: true,
|
|
1541
|
+
},
|
|
1542
|
+
noCheckmark: {
|
|
1543
|
+
type: Boolean,
|
|
1544
|
+
reflect: true,
|
|
1545
|
+
attribute: 'nocheckmark'
|
|
1546
|
+
},
|
|
1547
|
+
disabled: {
|
|
1548
|
+
type: Boolean,
|
|
1549
|
+
reflect: true
|
|
1550
|
+
},
|
|
1551
|
+
loading: {
|
|
1552
|
+
type: Boolean,
|
|
1553
|
+
reflect: true
|
|
1554
|
+
},
|
|
1555
|
+
optionSelected: {
|
|
1556
|
+
// Allow HTMLElement, HTMLElement[] arrays and undefined
|
|
1557
|
+
type: Object
|
|
1558
|
+
},
|
|
1559
|
+
optionActive: {
|
|
1560
|
+
type: Object,
|
|
1561
|
+
attribute: 'optionactive'
|
|
1562
|
+
},
|
|
1563
|
+
matchWord: {
|
|
1564
|
+
type: String,
|
|
1565
|
+
attribute: 'matchword'
|
|
1566
|
+
},
|
|
1567
|
+
multiSelect: {
|
|
1568
|
+
type: Boolean,
|
|
1569
|
+
reflect: true,
|
|
1570
|
+
attribute: 'multiselect'
|
|
1571
|
+
},
|
|
1572
|
+
selectAllMatchingOptions: {
|
|
1573
|
+
type: Boolean,
|
|
1574
|
+
reflect: true,
|
|
1575
|
+
},
|
|
1576
|
+
|
|
1577
|
+
/**
|
|
1578
|
+
* Value selected for the component.
|
|
1579
|
+
*/
|
|
1580
|
+
value: {
|
|
1581
|
+
type: String,
|
|
1582
|
+
reflect: true,
|
|
1583
|
+
attribute: 'value'
|
|
1584
|
+
},
|
|
1585
|
+
|
|
1586
|
+
/**
|
|
414
1587
|
* Indent level for submenus.
|
|
415
1588
|
* @private
|
|
416
1589
|
*/
|
|
@@ -418,6 +1591,16 @@ class AuroMenu extends AuroElement {
|
|
|
418
1591
|
type: Number,
|
|
419
1592
|
reflect: false,
|
|
420
1593
|
attribute: false
|
|
1594
|
+
},
|
|
1595
|
+
|
|
1596
|
+
/**
|
|
1597
|
+
* Available menu options
|
|
1598
|
+
* @readonly
|
|
1599
|
+
*/
|
|
1600
|
+
options: {
|
|
1601
|
+
type: Array,
|
|
1602
|
+
reflect: false,
|
|
1603
|
+
attribute: false
|
|
421
1604
|
}
|
|
422
1605
|
};
|
|
423
1606
|
}
|
|
@@ -430,6 +1613,37 @@ class AuroMenu extends AuroElement {
|
|
|
430
1613
|
];
|
|
431
1614
|
}
|
|
432
1615
|
|
|
1616
|
+
/**
|
|
1617
|
+
* @readonly
|
|
1618
|
+
* @returns {string} - Returns the label of the currently selected option(s).
|
|
1619
|
+
*/
|
|
1620
|
+
get currentLabel() {
|
|
1621
|
+
return this.menuService.currentLabel;
|
|
1622
|
+
};
|
|
1623
|
+
|
|
1624
|
+
/**
|
|
1625
|
+
* @readonly
|
|
1626
|
+
* @returns {Array<HTMLElement>} - Returns the array of available menu options.
|
|
1627
|
+
* @deprecated use `options` property instead.
|
|
1628
|
+
*/
|
|
1629
|
+
get items() {
|
|
1630
|
+
return this.options;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
/**
|
|
1634
|
+
* @returns {number} - Returns the index of the currently active option.
|
|
1635
|
+
*/
|
|
1636
|
+
get index() {
|
|
1637
|
+
return this._index;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
/**
|
|
1641
|
+
* @param {number} value - Sets the index of the currently active option.
|
|
1642
|
+
*/
|
|
1643
|
+
set index(value) {
|
|
1644
|
+
this.menuService.setHighlightedIndex(value);
|
|
1645
|
+
}
|
|
1646
|
+
|
|
433
1647
|
/**
|
|
434
1648
|
* This will register this element with the browser.
|
|
435
1649
|
* @param {string} [name="auro-menu"] - The name of element that you want to register to.
|
|
@@ -449,16 +1663,113 @@ class AuroMenu extends AuroElement {
|
|
|
449
1663
|
* @returns {String|Array<String>}
|
|
450
1664
|
*/
|
|
451
1665
|
get formattedValue() {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
1666
|
+
return this.menuService.currentValue;
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
/**
|
|
1670
|
+
* Gets the current property values for the menu service.
|
|
1671
|
+
* @private
|
|
1672
|
+
* @returns {Object}
|
|
1673
|
+
*/
|
|
1674
|
+
get propertyValues() {
|
|
1675
|
+
return {
|
|
1676
|
+
size: this.size,
|
|
1677
|
+
shape: this.shape,
|
|
1678
|
+
noCheckmark: this.nocheckmark,
|
|
1679
|
+
disabled: this.disabled
|
|
1680
|
+
};
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
/**
|
|
1684
|
+
* Provides the menu context to child components.
|
|
1685
|
+
* Initializes the MenuService and subscribes to menu changes.
|
|
1686
|
+
* @protected
|
|
1687
|
+
*/
|
|
1688
|
+
provideContext() {
|
|
1689
|
+
this.menuService = new MenuService({host: this});
|
|
1690
|
+
this.menuService.setProperties(this.propertyValues);
|
|
1691
|
+
this.menuService.subscribe(this.handleMenuChange.bind(this));
|
|
1692
|
+
this._contextProvider = new i$2(this, {
|
|
1693
|
+
context: MenuContext,
|
|
1694
|
+
initialValue: this.menuService
|
|
1695
|
+
});
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
/**
|
|
1699
|
+
* Updates the currently active option in the menu.
|
|
1700
|
+
* @param {HTMLElement} option - The option to set as active.
|
|
1701
|
+
*/
|
|
1702
|
+
updateActiveOption(option) {
|
|
1703
|
+
this.menuService.setHighlightedOption(option);
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
/**
|
|
1707
|
+
* Sets the internal value and manages update state.
|
|
1708
|
+
* @param {String|Array<String>} value - The value to set.
|
|
1709
|
+
* @protected
|
|
1710
|
+
*/
|
|
1711
|
+
setInternalValue(value) {
|
|
1712
|
+
if (this.value !== value) {
|
|
1713
|
+
this.internalUpdateInProgress = true;
|
|
1714
|
+
this.value = value;
|
|
1715
|
+
|
|
1716
|
+
setTimeout(() => {
|
|
1717
|
+
this.internalUpdateInProgress = false;
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
/**
|
|
1723
|
+
* Handles changes from the menu service and updates component state.
|
|
1724
|
+
* @param {Object} event - The event object from the menu service.
|
|
1725
|
+
* @protected
|
|
1726
|
+
*/
|
|
1727
|
+
handleMenuChange(event) {
|
|
1728
|
+
if (event.type === 'valueChange') {
|
|
1729
|
+
|
|
1730
|
+
// New option is array value or first option with fallback to undefined for empty array in all cases
|
|
1731
|
+
const newOption = this.multiSelect && event.options.length ? event.options : event.options[0] || undefined;
|
|
1732
|
+
const newValue = event.stringValue;
|
|
1733
|
+
|
|
1734
|
+
// Check if the option or value has actually changed
|
|
1735
|
+
if (newValue === undefined || (this.optionSelected !== newOption || this.stringValue !== newValue)) {
|
|
1736
|
+
this.optionSelected = newOption;
|
|
1737
|
+
this.setInternalValue(newValue);
|
|
458
1738
|
}
|
|
459
|
-
|
|
1739
|
+
|
|
1740
|
+
// Notify components of selection change
|
|
1741
|
+
this.notifySelectionChange(event);
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
if (event.type === 'highlightChange') {
|
|
1745
|
+
this.optionActive = event.option;
|
|
1746
|
+
this._index = event.index;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
if (event.type === 'optionsChange') {
|
|
1750
|
+
this.options = event.options;
|
|
1751
|
+
this.dispatchEvent(new CustomEvent('auroMenu-optionsChange', {
|
|
1752
|
+
detail: {
|
|
1753
|
+
options: event.options
|
|
1754
|
+
}
|
|
1755
|
+
}));
|
|
460
1756
|
}
|
|
461
|
-
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
/**
|
|
1760
|
+
* Gets the currently selected options.
|
|
1761
|
+
* @returns {Array<HTMLElement>}
|
|
1762
|
+
*/
|
|
1763
|
+
get selectedOptions() {
|
|
1764
|
+
return this.menuService ? this.menuService.selectedOptions : [];
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
/**
|
|
1768
|
+
* Gets the first selected option, or null if none.
|
|
1769
|
+
* @returns {HTMLElement|null}
|
|
1770
|
+
*/
|
|
1771
|
+
get selectedOption() {
|
|
1772
|
+
return this.menuService ? this.menuService.selectedOptions[0] : null;
|
|
462
1773
|
}
|
|
463
1774
|
|
|
464
1775
|
// Lifecycle Methods
|
|
@@ -466,8 +1777,10 @@ class AuroMenu extends AuroElement {
|
|
|
466
1777
|
connectedCallback() {
|
|
467
1778
|
super.connectedCallback();
|
|
468
1779
|
|
|
1780
|
+
this.provideContext();
|
|
1781
|
+
|
|
469
1782
|
this.addEventListener('keydown', this.handleKeyDown);
|
|
470
|
-
this.addEventListener('
|
|
1783
|
+
this.addEventListener('auroMenuOption-click', this.handleMouseSelect);
|
|
471
1784
|
this.addEventListener('auroMenuOption-mouseover', this.handleOptionHover);
|
|
472
1785
|
this.addEventListener('slotchange', this.handleSlotChange);
|
|
473
1786
|
this.setTagAttribute("auro-menu");
|
|
@@ -475,7 +1788,7 @@ class AuroMenu extends AuroElement {
|
|
|
475
1788
|
|
|
476
1789
|
disconnectedCallback() {
|
|
477
1790
|
this.removeEventListener('keydown', this.handleKeyDown);
|
|
478
|
-
this.removeEventListener('
|
|
1791
|
+
this.removeEventListener('auroMenuOption-click', this.handleMouseSelect);
|
|
479
1792
|
this.removeEventListener('auroMenuOption-mouseover', this.handleOptionHover);
|
|
480
1793
|
this.removeEventListener('slotchange', this.handleSlotChange);
|
|
481
1794
|
|
|
@@ -489,177 +1802,43 @@ class AuroMenu extends AuroElement {
|
|
|
489
1802
|
this.initializeMenu();
|
|
490
1803
|
}
|
|
491
1804
|
|
|
492
|
-
/**
|
|
493
|
-
* Sets an attribute that matches the default tag name if the tag name is not the default.
|
|
494
|
-
* @param {string} tagName - The tag name to set as an attribute.
|
|
495
|
-
* @private
|
|
496
|
-
*/
|
|
497
|
-
setTagAttribute(tagName) {
|
|
498
|
-
if (this.tagName.toLowerCase() !== tagName) {
|
|
499
|
-
this.setAttribute(tagName, true);
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
1805
|
|
|
503
|
-
// eslint-disable-next-line complexity
|
|
504
1806
|
updated(changedProperties) {
|
|
505
1807
|
super.updated(changedProperties);
|
|
506
1808
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
(!old && this.optionSelected) ||
|
|
511
|
-
(old && !this.optionSelected)) {
|
|
512
|
-
this.notifySelectionChange();
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
|
|
517
|
-
// Reset selection if multiSelect mode changes
|
|
518
|
-
this.clearSelection();
|
|
1809
|
+
// Update menu service properties on host update
|
|
1810
|
+
if (changedProperties.has('value')) {
|
|
1811
|
+
this.menuService.selectByValue(this.value);
|
|
519
1812
|
}
|
|
520
1813
|
|
|
521
|
-
|
|
522
|
-
if (changedProperties.has(
|
|
523
|
-
|
|
524
|
-
if (this.value === undefined || this.value === null) {
|
|
525
|
-
this.clearSelection();
|
|
526
|
-
} else {
|
|
527
|
-
if (this.multiSelect) {
|
|
528
|
-
// In multiselect mode, this.value should be an array of strings
|
|
529
|
-
const valueArray = this.formattedValue;
|
|
530
|
-
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
531
|
-
|
|
532
|
-
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
533
|
-
} else {
|
|
534
|
-
// In single-select mode, this.value should be a string
|
|
535
|
-
const matchingOptions = this.items.find((item) => item.value === this.value);
|
|
536
|
-
|
|
537
|
-
if (matchingOptions) {
|
|
538
|
-
this.optionSelected = matchingOptions;
|
|
539
|
-
this.index = this.items.indexOf(matchingOptions);
|
|
540
|
-
} else {
|
|
541
|
-
// If no matching option found, reset selection
|
|
542
|
-
this.optionSelected = undefined;
|
|
543
|
-
this.index = -1;
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
// If no matching options were found in either mode
|
|
548
|
-
if (!this.optionSelected || (Array.isArray(this.optionSelected) && this.optionSelected.length === 0)) {
|
|
549
|
-
dispatchMenuEvent(this, 'auroMenu-selectValueFailure');
|
|
550
|
-
this.optionSelected = undefined;
|
|
551
|
-
this.index = -1;
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
// Update UI state
|
|
556
|
-
this.updateItemsState(new Map([
|
|
557
|
-
[
|
|
558
|
-
'optionSelected',
|
|
559
|
-
true
|
|
560
|
-
]
|
|
561
|
-
]));
|
|
562
|
-
|
|
563
|
-
// Notify of changes
|
|
564
|
-
if (this.optionSelected !== undefined) {
|
|
565
|
-
this.notifySelectionChange();
|
|
566
|
-
}
|
|
1814
|
+
// Handle loading state changes
|
|
1815
|
+
if (changedProperties.has('loading')) {
|
|
1816
|
+
this.setLoadingState(this.loading);
|
|
567
1817
|
}
|
|
568
|
-
|
|
569
|
-
// Process all other UI updates
|
|
570
|
-
this.updateItemsState(changedProperties);
|
|
571
1818
|
}
|
|
572
1819
|
|
|
573
1820
|
/**
|
|
574
|
-
*
|
|
1821
|
+
* Sets an attribute that matches the default tag name if the tag name is not the default.
|
|
1822
|
+
* @param {string} tagName - The tag name to set as an attribute.
|
|
575
1823
|
* @private
|
|
576
|
-
* @param {Map<string, boolean>} changedProperties - LitElement's changed properties map.
|
|
577
1824
|
*/
|
|
578
|
-
|
|
579
|
-
if (
|
|
580
|
-
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
// Handle noCheckmark propagation to all menus and options
|
|
584
|
-
if (changedProperties.has('noCheckmark') && this.noCheckmark) {
|
|
585
|
-
// Update both menus and options
|
|
586
|
-
this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]').forEach((element) => element.setAttribute('noCheckmark', ''));
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
// Handle layout propagation to all menus and options
|
|
590
|
-
const propagationTargets = this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]');
|
|
591
|
-
[
|
|
592
|
-
'size',
|
|
593
|
-
'shape'
|
|
594
|
-
].forEach((prop) => {
|
|
595
|
-
if (changedProperties.has(prop)) {
|
|
596
|
-
propagationTargets.forEach((el) => {
|
|
597
|
-
el.setAttribute(prop, this[prop]);
|
|
598
|
-
});
|
|
599
|
-
}
|
|
600
|
-
});
|
|
601
|
-
|
|
602
|
-
// Regex for matchWord if needed
|
|
603
|
-
let regexWord = null;
|
|
604
|
-
|
|
605
|
-
if (changedProperties.has('matchWord') && this.matchWord && this.matchWord.length) {
|
|
606
|
-
const escapedWord = this.matchWord.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
|
|
607
|
-
regexWord = new RegExp(escapedWord, 'giu');
|
|
1825
|
+
setTagAttribute(tagName) {
|
|
1826
|
+
if (this.tagName.toLowerCase() !== tagName) {
|
|
1827
|
+
this.setAttribute(tagName, true);
|
|
608
1828
|
}
|
|
1829
|
+
}
|
|
609
1830
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
} else {
|
|
621
|
-
option.removeAttribute('selected');
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
// Update text highlighting if matchWord changed
|
|
626
|
-
if (changedProperties.has('matchWord') && regexWord &&
|
|
627
|
-
isOptionInteractive(option) && !option.hasAttribute('persistent')) {
|
|
628
|
-
const nested = option.querySelectorAll('.nestingSpacer');
|
|
629
|
-
|
|
630
|
-
const displayValueEl = option.querySelector('[slot="displayValue"]');
|
|
631
|
-
if (displayValueEl) {
|
|
632
|
-
option.removeChild(displayValueEl);
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
// Create nested spacers
|
|
636
|
-
const nestingSpacerBundle = [...nested].map(() => this.nestingSpacer).join('');
|
|
637
|
-
|
|
638
|
-
// Update with spacers and matchWord
|
|
639
|
-
option.innerHTML = nestingSpacerBundle +
|
|
640
|
-
option.textContent.replace(
|
|
641
|
-
regexWord,
|
|
642
|
-
(match) => `<strong>${match}</strong>`
|
|
643
|
-
);
|
|
644
|
-
if (displayValueEl) {
|
|
645
|
-
option.append(displayValueEl);
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
// Update disabled state
|
|
650
|
-
if (changedProperties.has('disabled')) {
|
|
651
|
-
option.disabled = this.disabled;
|
|
652
|
-
}
|
|
1831
|
+
/**
|
|
1832
|
+
* Sets the loading state and dispatches a loading change event.
|
|
1833
|
+
* @param {boolean} isLoading - Whether the menu is loading.
|
|
1834
|
+
* @protected
|
|
1835
|
+
*/
|
|
1836
|
+
setLoadingState(isLoading) {
|
|
1837
|
+
this.setAttribute("aria-busy", isLoading);
|
|
1838
|
+
dispatchMenuEvent(this, "auroMenu-loadingChange", {
|
|
1839
|
+
loading: isLoading,
|
|
1840
|
+
hasLoadingPlaceholder: this.hasLoadingPlaceholder
|
|
653
1841
|
});
|
|
654
|
-
|
|
655
|
-
// Handle loading state changes
|
|
656
|
-
if (changedProperties.has('loading')) {
|
|
657
|
-
this.setAttribute("aria-busy", this.loading);
|
|
658
|
-
dispatchMenuEvent(this, "auroMenu-loadingChange", {
|
|
659
|
-
loading: this.loading,
|
|
660
|
-
hasLoadingPlaceholder: this.hasLoadingPlaceholder
|
|
661
|
-
});
|
|
662
|
-
}
|
|
663
1842
|
}
|
|
664
1843
|
|
|
665
1844
|
// Init Methods
|
|
@@ -669,7 +1848,6 @@ class AuroMenu extends AuroElement {
|
|
|
669
1848
|
* @private
|
|
670
1849
|
*/
|
|
671
1850
|
initializeMenu() {
|
|
672
|
-
this.initItems();
|
|
673
1851
|
if (this.rootMenu) {
|
|
674
1852
|
this.setAttribute('role', 'listbox');
|
|
675
1853
|
this.setAttribute('root', '');
|
|
@@ -678,94 +1856,11 @@ class AuroMenu extends AuroElement {
|
|
|
678
1856
|
}
|
|
679
1857
|
|
|
680
1858
|
/**
|
|
681
|
-
*
|
|
682
|
-
* @
|
|
683
|
-
*/
|
|
684
|
-
initItems() {
|
|
685
|
-
this.items = Array.from(this.querySelectorAll('auro-menuoption, [auro-menuoption]'));
|
|
686
|
-
if (this.noCheckmark) {
|
|
687
|
-
this.updateItemsState(new Map([
|
|
688
|
-
[
|
|
689
|
-
'noCheckmark',
|
|
690
|
-
true
|
|
691
|
-
]
|
|
692
|
-
]));
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
// Logic Methods
|
|
697
|
-
|
|
698
|
-
/**
|
|
699
|
-
* Updates menu state when an option is selected.
|
|
700
|
-
* @private
|
|
701
|
-
* @param {HTMLElement} option - The option element to select.
|
|
702
|
-
*/
|
|
703
|
-
handleSelectState(option) {
|
|
704
|
-
if (this.multiSelect) {
|
|
705
|
-
const currentValue = this.formattedValue || [];
|
|
706
|
-
const currentSelected = this.optionSelected || [];
|
|
707
|
-
|
|
708
|
-
if (!currentValue.includes(option.value)) {
|
|
709
|
-
this.value = JSON.stringify([
|
|
710
|
-
...currentValue,
|
|
711
|
-
option.value
|
|
712
|
-
]);
|
|
713
|
-
}
|
|
714
|
-
if (!currentSelected.includes(option)) {
|
|
715
|
-
this.optionSelected = [
|
|
716
|
-
...currentSelected,
|
|
717
|
-
option
|
|
718
|
-
];
|
|
719
|
-
}
|
|
720
|
-
} else {
|
|
721
|
-
// Single select - use arrays with single values
|
|
722
|
-
this.value = option.value;
|
|
723
|
-
this.optionSelected = option;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
this.index = this.items.indexOf(option);
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
/**
|
|
730
|
-
* Deselects a menu option and updates related state.
|
|
731
|
-
* @private
|
|
732
|
-
* @param {HTMLElement} option - The menuoption to be deselected.
|
|
1859
|
+
* Selects the currently highlighted option.
|
|
1860
|
+
* @protected
|
|
733
1861
|
*/
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
// Remove this option from array
|
|
737
|
-
const newFormattedValue = (this.formattedValue || []).filter((val) => val !== option.value);
|
|
738
|
-
|
|
739
|
-
// If array is empty after removal, set back to undefined
|
|
740
|
-
if (newFormattedValue && newFormattedValue.length === 0) {
|
|
741
|
-
this.value = undefined;
|
|
742
|
-
} else {
|
|
743
|
-
this.value = JSON.stringify(newFormattedValue);
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
this.optionSelected = this.optionSelected.filter((val) => val !== option);
|
|
747
|
-
if (this.optionSelected.length === 0) {
|
|
748
|
-
this.optionSelected = undefined;
|
|
749
|
-
}
|
|
750
|
-
} else {
|
|
751
|
-
// For single-select: Back to undefined when deselected
|
|
752
|
-
this.value = undefined;
|
|
753
|
-
this.optionSelected = undefined;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
// Update the index tracking
|
|
757
|
-
this.index = this.items.indexOf(option);
|
|
758
|
-
|
|
759
|
-
// Update UI to reflect changes
|
|
760
|
-
this.updateItemsState(new Map([
|
|
761
|
-
[
|
|
762
|
-
'optionSelected',
|
|
763
|
-
true
|
|
764
|
-
]
|
|
765
|
-
]));
|
|
766
|
-
|
|
767
|
-
// Notify of selection change
|
|
768
|
-
this.notifySelectionChange();
|
|
1862
|
+
makeSelection() {
|
|
1863
|
+
this.menuService.selectHighlightedOption();
|
|
769
1864
|
}
|
|
770
1865
|
|
|
771
1866
|
/**
|
|
@@ -775,7 +1870,7 @@ class AuroMenu extends AuroElement {
|
|
|
775
1870
|
clearSelection() {
|
|
776
1871
|
this.optionSelected = undefined;
|
|
777
1872
|
this.value = undefined;
|
|
778
|
-
this.
|
|
1873
|
+
this._index = -1;
|
|
779
1874
|
}
|
|
780
1875
|
|
|
781
1876
|
/**
|
|
@@ -784,18 +1879,7 @@ class AuroMenu extends AuroElement {
|
|
|
784
1879
|
* @public
|
|
785
1880
|
*/
|
|
786
1881
|
reset() {
|
|
787
|
-
|
|
788
|
-
this.value = undefined;
|
|
789
|
-
this.optionSelected = undefined;
|
|
790
|
-
this.index = -1;
|
|
791
|
-
|
|
792
|
-
// Reset UI state
|
|
793
|
-
this.updateItemsState(new Map([
|
|
794
|
-
[
|
|
795
|
-
'optionSelected',
|
|
796
|
-
true
|
|
797
|
-
]
|
|
798
|
-
]));
|
|
1882
|
+
this.menuService.reset();
|
|
799
1883
|
|
|
800
1884
|
// Dispatch reset event
|
|
801
1885
|
dispatchMenuEvent(this, 'auroMenu-selectValueReset');
|
|
@@ -835,186 +1919,43 @@ class AuroMenu extends AuroElement {
|
|
|
835
1919
|
event.preventDefault();
|
|
836
1920
|
switch (event.key) {
|
|
837
1921
|
case "ArrowDown":
|
|
838
|
-
this.
|
|
1922
|
+
this.menuService.highlightNext();
|
|
839
1923
|
break;
|
|
840
1924
|
case "ArrowUp":
|
|
841
|
-
this.
|
|
1925
|
+
this.menuService.highlightPrevious();
|
|
842
1926
|
break;
|
|
843
1927
|
case "Tab":
|
|
844
|
-
this.makeSelection();
|
|
845
|
-
break;
|
|
846
1928
|
case "Enter":
|
|
847
|
-
this.
|
|
1929
|
+
this.menuService.selectHighlightedOption();
|
|
848
1930
|
break;
|
|
849
1931
|
}
|
|
850
1932
|
}
|
|
851
1933
|
|
|
852
1934
|
/**
|
|
853
|
-
*
|
|
854
|
-
* @
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
const option = this.items[this.index];
|
|
863
|
-
|
|
864
|
-
// Return early if option is not interactive
|
|
865
|
-
if (!option || !isOptionInteractive(option)) {
|
|
866
|
-
return;
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
// Handle custom events first
|
|
870
|
-
if (option.hasAttribute('event')) {
|
|
871
|
-
this.handleCustomEvent(option);
|
|
872
|
-
return;
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
if (this.multiSelect) {
|
|
876
|
-
// In multiselect, toggle individual selections
|
|
877
|
-
this.toggleOption(option);
|
|
878
|
-
// In single select, only handle selection of new options
|
|
879
|
-
} else if (this.option !== this.optionSelected || !this.isOptionSelected(option)) {
|
|
880
|
-
this.clearSelection();
|
|
881
|
-
this.handleSelectState(option);
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
this.notifySelectionChange();
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
/**
|
|
888
|
-
* Toggle the selection state of the menuoption.
|
|
889
|
-
* @private
|
|
890
|
-
* @param {HTMLElement} option - The menuoption to toggle.
|
|
891
|
-
*/
|
|
892
|
-
toggleOption(option) {
|
|
893
|
-
const isCurrentlySelected = this.isOptionSelected(option);
|
|
894
|
-
|
|
895
|
-
if (isCurrentlySelected) {
|
|
896
|
-
this.handleDeselectState(option);
|
|
897
|
-
} else if (option.value === undefined || option.value === '') {
|
|
898
|
-
dispatchMenuEvent(this, 'auroMenu-selectValueFailure');
|
|
899
|
-
} else {
|
|
900
|
-
this.handleSelectState(option);
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
/**
|
|
905
|
-
* Handles option selection via mouse.
|
|
906
|
-
* @private
|
|
907
|
-
* @param {MouseEvent} event - Event object from the browser.
|
|
908
|
-
*/
|
|
909
|
-
handleMouseSelect(event) {
|
|
910
|
-
if (!this.rootMenu || event.target === this) {
|
|
911
|
-
return;
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
const option = event.target.closest('auro-menuoption, [auro-menuoption]');
|
|
915
|
-
if (option) {
|
|
916
|
-
this.index = this.items.indexOf(option);
|
|
917
|
-
this.makeSelection();
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
/**
|
|
922
|
-
* Handles option hover events.
|
|
923
|
-
* @private
|
|
924
|
-
* @param {CustomEvent} event - Event object from the browser.
|
|
925
|
-
*/
|
|
926
|
-
handleOptionHover(event) {
|
|
927
|
-
const option = event.target;
|
|
928
|
-
this.index = this.items.indexOf(option);
|
|
929
|
-
this.updateActiveOption(this.index);
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
/**
|
|
933
|
-
* Handles slot change events.
|
|
934
|
-
* @private
|
|
935
|
-
*/
|
|
936
|
-
handleSlotChange() {
|
|
937
|
-
if (this.parentElement && this.parentElement.closest('auro-menu, [auro-menu]')) {
|
|
938
|
-
this.rootMenu = false;
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
if (this.rootMenu) {
|
|
942
|
-
this.initializeMenu();
|
|
943
|
-
} else if (this.noCheckmark) {
|
|
944
|
-
this.updateItemsState(new Map([
|
|
945
|
-
[
|
|
946
|
-
'noCheckmark',
|
|
947
|
-
true
|
|
948
|
-
]
|
|
949
|
-
]));
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
/**
|
|
954
|
-
* Navigates through options using keyboard.
|
|
955
|
-
* @private
|
|
956
|
-
* @param {string} direction - 'up' or 'down'.
|
|
957
|
-
*/
|
|
958
|
-
navigateOptions(direction) {
|
|
959
|
-
// Return early if no items exist
|
|
960
|
-
if (!this.items || !this.items.length) {
|
|
961
|
-
return;
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
let newIndex = this.index;
|
|
965
|
-
const increment = direction === 'down' ? 1 : -1;
|
|
966
|
-
const maxIterations = this.items.length;
|
|
967
|
-
let iterations = 0;
|
|
968
|
-
let foundInteractiveOption = false;
|
|
969
|
-
|
|
970
|
-
do {
|
|
971
|
-
newIndex = (newIndex + increment + this.items.length) % this.items.length;
|
|
972
|
-
iterations += 1;
|
|
973
|
-
|
|
974
|
-
// Check if current option is interactive
|
|
975
|
-
const currentOption = this.items[newIndex];
|
|
976
|
-
if (isOptionInteractive(currentOption)) {
|
|
977
|
-
foundInteractiveOption = true;
|
|
978
|
-
break;
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
// Break if all options were checked
|
|
982
|
-
if (iterations >= maxIterations) {
|
|
983
|
-
break;
|
|
984
|
-
}
|
|
985
|
-
} while (iterations < maxIterations);
|
|
986
|
-
|
|
987
|
-
// Handle the results of the search
|
|
988
|
-
if (foundInteractiveOption) {
|
|
989
|
-
// Update only if an interactive option was found
|
|
990
|
-
this.index = newIndex;
|
|
991
|
-
this.updateActiveOption(this.index);
|
|
992
|
-
} else {
|
|
993
|
-
// All options are disabled or non-interactive
|
|
994
|
-
// Keep the current index unchanged
|
|
995
|
-
dispatchMenuEvent(this, 'auroMenu-navigateFailure', {
|
|
996
|
-
reason: 'No interactive options available',
|
|
997
|
-
direction,
|
|
998
|
-
currentIndex: this.index
|
|
999
|
-
});
|
|
1935
|
+
* Navigates the menu options in the specified direction.
|
|
1936
|
+
* @param {'up'|'down'} direction - The direction to navigate.
|
|
1937
|
+
* @protected
|
|
1938
|
+
*/
|
|
1939
|
+
navigateOptions(direction) {
|
|
1940
|
+
if (direction === 'up') {
|
|
1941
|
+
this.menuService.highlightPrevious();
|
|
1942
|
+
} else if (direction === 'down') {
|
|
1943
|
+
this.menuService.highlightNext();
|
|
1000
1944
|
}
|
|
1001
1945
|
}
|
|
1002
1946
|
|
|
1003
1947
|
/**
|
|
1004
|
-
*
|
|
1005
|
-
* @
|
|
1948
|
+
* Handles slot change events.
|
|
1949
|
+
* @private
|
|
1006
1950
|
*/
|
|
1007
|
-
|
|
1008
|
-
if (
|
|
1009
|
-
|
|
1951
|
+
handleSlotChange() {
|
|
1952
|
+
if (this.parentElement && this.parentElement.closest('auro-menu, [auro-menu]')) {
|
|
1953
|
+
this.rootMenu = false;
|
|
1010
1954
|
}
|
|
1011
1955
|
|
|
1012
|
-
this.
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
this.index = index;
|
|
1016
|
-
|
|
1017
|
-
dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
|
|
1956
|
+
if (this.rootMenu) {
|
|
1957
|
+
this.initializeMenu();
|
|
1958
|
+
}
|
|
1018
1959
|
}
|
|
1019
1960
|
|
|
1020
1961
|
/**
|
|
@@ -1033,8 +1974,13 @@ class AuroMenu extends AuroElement {
|
|
|
1033
1974
|
* @param {any} source - The source that triggers this event.
|
|
1034
1975
|
* @private
|
|
1035
1976
|
*/
|
|
1036
|
-
notifySelectionChange(
|
|
1037
|
-
dispatchMenuEvent(this, 'auroMenu-selectedOption', {
|
|
1977
|
+
notifySelectionChange({value, stringValue, keys, options} = {}) {
|
|
1978
|
+
dispatchMenuEvent(this, 'auroMenu-selectedOption', {
|
|
1979
|
+
value,
|
|
1980
|
+
stringValue,
|
|
1981
|
+
keys,
|
|
1982
|
+
options
|
|
1983
|
+
});
|
|
1038
1984
|
}
|
|
1039
1985
|
|
|
1040
1986
|
/**
|
|
@@ -1107,269 +2053,41 @@ class AuroMenu extends AuroElement {
|
|
|
1107
2053
|
}
|
|
1108
2054
|
}
|
|
1109
2055
|
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
var styleCss = i$5`.body-default{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);font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.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);font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{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);font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.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);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-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-2xs-font-size, 0.625rem);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);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);font-weight:var(--wcss-display-2xl-weight, 300);line-height:var(--wcss-display-2xl-line-height, 1.3);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem))}.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);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);font-weight:var(--wcss-display-xl-weight, 300);line-height:var(--wcss-display-xl-line-height, 1.3);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem))}.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);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);font-weight:var(--wcss-display-lg-weight, 300);line-height:var(--wcss-display-lg-line-height, 1.3);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem))}.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);letter-spacing:var(--wcss-display-md-letter-spacing, 0);font-weight:var(--wcss-display-md-weight, 300);line-height:var(--wcss-display-md-line-height, 1.3);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem))}.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);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);font-weight:var(--wcss-display-sm-weight, 300);line-height:var(--wcss-display-sm-line-height, 1.3);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem))}.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);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);font-weight:var(--wcss-display-xs-weight, 300);line-height:var(--wcss-display-xs-line-height, 1.3);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem))}.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);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);font-weight:var(--wcss-heading-xl-weight, 300);line-height:var(--wcss-heading-xl-line-height, 1.3);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem))}.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);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);font-weight:var(--wcss-heading-lg-weight, 300);line-height:var(--wcss-heading-lg-line-height, 1.3);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem))}.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);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);font-weight:var(--wcss-heading-md-weight, 300);line-height:var(--wcss-heading-md-line-height, 1.3);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem))}.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);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);font-weight:var(--wcss-heading-sm-weight, 300);line-height:var(--wcss-heading-sm-line-height, 1.3);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem))}.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);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);font-weight:var(--wcss-heading-xs-weight, 450);line-height:var(--wcss-heading-xs-line-height, 1.3);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem))}.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);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);font-weight:var(--wcss-heading-2xs-weight, 450);line-height:var(--wcss-heading-2xs-line-height, 1.3);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem))}.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);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-2xl-weight, 450);line-height:var(--wcss-accent-2xl-line-height, 1);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));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);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-xl-weight, 450);line-height:var(--wcss-accent-xl-line-height, 1.3);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));text-transform:uppercase}.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);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);font-weight:var(--wcss-accent-lg-weight, 450);line-height:var(--wcss-accent-lg-line-height, 1.3);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));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);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);font-weight:var(--wcss-accent-md-weight, 500);line-height:var(--wcss-accent-md-line-height, 1.3);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));text-transform:uppercase}.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);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);font-weight:var(--wcss-accent-sm-weight, 500);line-height:var(--wcss-accent-sm-line-height, 1.3);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));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);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-xs-weight, 500);line-height:var(--wcss-accent-xs-line-height, 1.3);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));text-transform:uppercase}.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);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-2xs-weight, 450);line-height:var(--wcss-accent-2xs-line-height, 1.3);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));text-transform:uppercase}:host{cursor:pointer;user-select:none;text-overflow:ellipsis;max-width:100dvw}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-300, 1.5rem) + var(--ds-size-100, 0.5rem));padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-50, 0.25rem);border-radius:var(--ds-size-100, 0.5rem);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box]{border-radius:unset}:host .wrapper[class*=shape-snowflake]{border-radius:unset;line-height:24px}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem);line-height:26px}:host .wrapper[class*=-xl]{padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem);line-height:26px}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}[slot=displayValue]{display:none}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-300, 1.5rem) + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
// See LICENSE in the project root for license information.
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
class AuroDependencyVersioning {
|
|
1126
|
-
|
|
1127
|
-
/**
|
|
1128
|
-
* Generates a unique string to be used for child auro element naming.
|
|
1129
|
-
* @private
|
|
1130
|
-
* @param {string} baseName - Defines the first part of the unique element name.
|
|
1131
|
-
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
1132
|
-
* @returns {string} - Unique string to be used for naming.
|
|
1133
|
-
*/
|
|
1134
|
-
generateElementName(baseName, version) {
|
|
1135
|
-
let result = baseName;
|
|
1136
|
-
|
|
1137
|
-
result += '-';
|
|
1138
|
-
result += version.replace(/[.]/g, '_');
|
|
1139
|
-
|
|
1140
|
-
return result;
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
/**
|
|
1144
|
-
* Generates a unique string to be used for child auro element naming.
|
|
1145
|
-
* @param {string} baseName - Defines the first part of the unique element name.
|
|
1146
|
-
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
1147
|
-
* @returns {string} - Unique string to be used for naming.
|
|
1148
|
-
*/
|
|
1149
|
-
generateTag(baseName, version, tagClass) {
|
|
1150
|
-
const elementName = this.generateElementName(baseName, version);
|
|
1151
|
-
const tag = i`${s(elementName)}`;
|
|
1152
|
-
|
|
1153
|
-
if (!customElements.get(elementName)) {
|
|
1154
|
-
customElements.define(elementName, class extends tagClass {});
|
|
1155
|
-
}
|
|
1156
|
-
|
|
1157
|
-
return tag;
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
/**
|
|
1162
|
-
* @license
|
|
1163
|
-
* Copyright 2018 Google LLC
|
|
1164
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
1165
|
-
*/const o=o=>o??E;
|
|
1166
|
-
|
|
1167
|
-
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$2{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$5`: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;line-height:1;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}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.labelWrapper{margin-left:var(--ds-size-50, .25rem);line-height:1.8}
|
|
1168
|
-
`;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$5`.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}
|
|
1169
|
-
`;var y=i$5`: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)}
|
|
1170
|
-
`;var k=i$5`: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)}
|
|
1171
|
-
`;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`
|
|
1172
|
-
<div class="componentWrapper">
|
|
1173
|
-
<div
|
|
1174
|
-
class="${e({svgWrapper:true})}"
|
|
1175
|
-
title="${o(this.title||void 0)}">
|
|
1176
|
-
<span aria-hidden="${o(this.ariaHidden||true)}" part="svg">
|
|
1177
|
-
${this.customSvg?x$1`
|
|
1178
|
-
<slot name="svg"></slot>
|
|
1179
|
-
`:x$1`
|
|
1180
|
-
${this.svg}
|
|
1181
|
-
`}
|
|
1182
|
-
</span>
|
|
1183
|
-
</div>
|
|
1184
|
-
|
|
1185
|
-
<div class="${e(t)}" part="label">
|
|
1186
|
-
<slot></slot>
|
|
1187
|
-
</div>
|
|
1188
|
-
</div>
|
|
1189
|
-
`}}
|
|
1190
|
-
|
|
1191
|
-
var iconVersion = '9.1.0';
|
|
1192
|
-
|
|
1193
|
-
var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"checkmark-sm__desc\" class=\"ico_squareLarge\" 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=\"checkmark-sm__desc\">a small check mark.</desc><path d=\"M8.461 11.84a.625.625 0 1 0-.922.844l2.504 2.738c.247.27.674.27.922 0l5.496-6a.625.625 0 1 0-.922-.844l-5.035 5.496z\"/></svg>"};
|
|
1194
|
-
|
|
1195
|
-
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
1196
|
-
// See LICENSE in the project root for license information.
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
/**
|
|
1200
|
-
* The auro-menu element provides users a way to define a menu option.
|
|
1201
|
-
*
|
|
1202
|
-
* @attr {String} value - Specifies the value to be sent to a server.
|
|
1203
|
-
* @attr {String} noCheckmark - When true, selected option will not show the checkmark.
|
|
1204
|
-
* @attr {Boolean} disabled - When true specifies that the menuoption is disabled.
|
|
1205
|
-
* @attr {Boolean} selected - Specifies that an option is selected.
|
|
1206
|
-
* @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
|
|
1207
|
-
* @slot - Specifies text for an option, but is not the value.
|
|
1208
|
-
*/
|
|
1209
|
-
class AuroMenuOption extends AuroElement {
|
|
1210
|
-
constructor() {
|
|
1211
|
-
super();
|
|
1212
|
-
|
|
1213
|
-
/**
|
|
1214
|
-
* @private
|
|
1215
|
-
*/
|
|
1216
|
-
this.shape = undefined;
|
|
1217
|
-
|
|
1218
|
-
/**
|
|
1219
|
-
* @private
|
|
1220
|
-
*/
|
|
1221
|
-
this.size = undefined;
|
|
1222
|
-
|
|
1223
|
-
/**
|
|
1224
|
-
* Generate unique names for dependency components.
|
|
1225
|
-
*/
|
|
1226
|
-
const versioning = new AuroDependencyVersioning();
|
|
1227
|
-
this.iconTag = versioning.generateTag('auro-formkit-menuoption-icon', iconVersion, x);
|
|
1228
|
-
|
|
1229
|
-
this.selected = false;
|
|
1230
|
-
this.nocheckmark = false;
|
|
1231
|
-
this.disabled = false;
|
|
1232
|
-
|
|
1233
|
-
/**
|
|
1234
|
-
* @private
|
|
1235
|
-
*/
|
|
1236
|
-
this.tabIndex = -1;
|
|
1237
|
-
|
|
1238
|
-
/**
|
|
1239
|
-
* @private
|
|
1240
|
-
*/
|
|
1241
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
static get properties() {
|
|
1245
|
-
return {
|
|
1246
|
-
...super.properties,
|
|
1247
|
-
nocheckmark: {
|
|
1248
|
-
type: Boolean,
|
|
1249
|
-
reflect: true
|
|
1250
|
-
},
|
|
1251
|
-
selected: {
|
|
1252
|
-
type: Boolean,
|
|
1253
|
-
reflect: true
|
|
1254
|
-
},
|
|
1255
|
-
disabled: {
|
|
1256
|
-
type: Boolean,
|
|
1257
|
-
reflect: true
|
|
1258
|
-
},
|
|
1259
|
-
value: {
|
|
1260
|
-
type: String,
|
|
1261
|
-
reflect: true
|
|
1262
|
-
},
|
|
1263
|
-
tabIndex: {
|
|
1264
|
-
type: Number,
|
|
1265
|
-
reflect: true
|
|
1266
|
-
}
|
|
1267
|
-
};
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
static get styles() {
|
|
1271
|
-
return [
|
|
1272
|
-
styleCss,
|
|
1273
|
-
colorCss,
|
|
1274
|
-
tokensCss
|
|
1275
|
-
];
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
/**
|
|
1279
|
-
* This will register this element with the browser.
|
|
1280
|
-
* @param {string} [name="auro-menuoption"] - The name of element that you want to register to.
|
|
1281
|
-
*
|
|
1282
|
-
* @example
|
|
1283
|
-
* AuroMenuOption.register("custom-menuoption") // this will register this element to <custom-menuoption/>
|
|
1284
|
-
*
|
|
1285
|
-
*/
|
|
1286
|
-
static register(name = "auro-menuoption") {
|
|
1287
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenuOption);
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
connectedCallback() {
|
|
1291
|
-
super.connectedCallback();
|
|
1292
|
-
|
|
1293
|
-
// Add the tag name as an attribute if it is different than the component name
|
|
1294
|
-
// Add this step soon as this node gets attached to the DOM to avoid racing condition with menu's value setting logic.
|
|
1295
|
-
this.runtimeUtils.handleComponentTagRename(this, 'auro-menuoption');
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
firstUpdated() {
|
|
1299
|
-
if (!this.hasAttribute('size')) {
|
|
1300
|
-
this.size = this.parentElement.getAttribute('size') || 'sm';
|
|
1301
|
-
}
|
|
1302
|
-
if (!this.hasAttribute('shape')) {
|
|
1303
|
-
this.shape = this.parentElement.getAttribute('shape') || 'box';
|
|
1304
|
-
}
|
|
2056
|
+
function initKeysExample() {
|
|
2057
|
+
const menu = document.getElementById('keys-menu');
|
|
2058
|
+
const stopsButton = document.getElementById('stopsButton');
|
|
2059
|
+
const stopsTopButton = document.getElementById('stopsTopButton');
|
|
2060
|
+
const output = document.getElementById('output');
|
|
2061
|
+
|
|
2062
|
+
const createConsoleEntry = (message) => {
|
|
2063
|
+
const node = document.createElement('span');
|
|
2064
|
+
node.innerHTML = message;
|
|
2065
|
+
output.appendChild(node);
|
|
2066
|
+
output.appendChild(document.createElement('br'));
|
|
2067
|
+
};
|
|
1305
2068
|
|
|
1306
|
-
|
|
1307
|
-
|
|
2069
|
+
const resetConsole = () => {
|
|
2070
|
+
output.innerHTML = '';
|
|
2071
|
+
};
|
|
1308
2072
|
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
2073
|
+
const updateMenuValue = (value) => {
|
|
2074
|
+
resetConsole();
|
|
2075
|
+
createConsoleEntry(`Setting menu.value: <em>"${value}"</em>`);
|
|
2076
|
+
menu.value = '';
|
|
2077
|
+
menu.value = value;
|
|
2078
|
+
createConsoleEntry(`menu.value before next lifecycle: <em>"${menu.value}"</em>`);
|
|
2079
|
+
setTimeout(() => {
|
|
2080
|
+
createConsoleEntry(`menu.value after lifecycle: <em>"${menu.value}"</em>`);
|
|
1316
2081
|
});
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
// observer for selected property changes
|
|
1320
|
-
updated(changedProperties) {
|
|
1321
|
-
super.updated(changedProperties);
|
|
1322
|
-
|
|
1323
|
-
if (changedProperties.has('selected')) {
|
|
1324
|
-
this.setAttribute('aria-selected', this.selected.toString());
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
/**
|
|
1329
|
-
* Generates an HTML element containing an SVG icon based on the provided `svgContent`.
|
|
1330
|
-
*
|
|
1331
|
-
* @private
|
|
1332
|
-
* @param {string} svgContent - The SVG content to be embedded.
|
|
1333
|
-
* @returns {Element} The HTML element containing the SVG icon.
|
|
1334
|
-
*/
|
|
1335
|
-
generateIconHtml(svgContent) {
|
|
1336
|
-
const dom = new DOMParser().parseFromString(svgContent, 'text/html');
|
|
1337
|
-
const svg = dom.body.firstChild;
|
|
1338
|
-
|
|
1339
|
-
svg.setAttribute('slot', 'svg');
|
|
1340
|
-
|
|
1341
|
-
return u$1`<${this.iconTag} customColor customSvg>${svg}</${this.iconTag}>`;
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
/**
|
|
1345
|
-
* Logic to determine the layout of the component.
|
|
1346
|
-
* @protected
|
|
1347
|
-
* @returns {void}
|
|
1348
|
-
*/
|
|
1349
|
-
renderLayout() {
|
|
1350
|
-
|
|
1351
|
-
const fontClassMap = {
|
|
1352
|
-
xs: 'body-sm',
|
|
1353
|
-
sm: 'body-default',
|
|
1354
|
-
md: 'body-default',
|
|
1355
|
-
lg: 'body-lg',
|
|
1356
|
-
xl: 'body-lg'
|
|
1357
|
-
};
|
|
2082
|
+
};
|
|
1358
2083
|
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
});
|
|
2084
|
+
stopsButton.addEventListener('click', () => {
|
|
2085
|
+
updateMenuValue('stops');
|
|
2086
|
+
});
|
|
1363
2087
|
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
? this.generateIconHtml(checkmarkIcon.svg)
|
|
1368
|
-
: undefined}
|
|
1369
|
-
<slot></slot>
|
|
1370
|
-
</div>
|
|
1371
|
-
`;
|
|
1372
|
-
}
|
|
2088
|
+
stopsTopButton.addEventListener('click', () => {
|
|
2089
|
+
updateMenuValue('stops-top');
|
|
2090
|
+
});
|
|
1373
2091
|
}
|
|
1374
2092
|
|
|
1375
2093
|
/* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */
|
|
@@ -1381,6 +2099,20 @@ AuroMenu.register('custom-menu');
|
|
|
1381
2099
|
AuroMenuOption.register('custom-menuoption');
|
|
1382
2100
|
|
|
1383
2101
|
function initExamples(initCount) {
|
|
2102
|
+
initCount = initCount || 0;
|
|
2103
|
+
|
|
2104
|
+
try {
|
|
2105
|
+
// javascript example function calls to be added here upon creation to test examples
|
|
2106
|
+
// auroMenuResetExample();
|
|
2107
|
+
initKeysExample();
|
|
2108
|
+
} catch (err) {
|
|
2109
|
+
if (initCount <= 20) {
|
|
2110
|
+
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
|
2111
|
+
setTimeout(() => {
|
|
2112
|
+
initExamples(initCount + 1);
|
|
2113
|
+
}, 100);
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
1384
2116
|
}
|
|
1385
2117
|
|
|
1386
2118
|
export { initExamples };
|