@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.11 → 0.0.0-pr624.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/bibtemplate/dist/auro-bibtemplate.d.ts +12 -2
- package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
- package/components/bibtemplate/dist/headerVersion.d.ts +1 -1
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +1244 -95
- package/components/bibtemplate/dist/registered.js +1244 -95
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/api.html +16 -10
- package/components/checkbox/demo/api.md +54 -19
- package/components/checkbox/demo/api.min.js +70 -45
- package/components/checkbox/demo/index.html +16 -10
- package/components/checkbox/demo/index.md +2 -2
- package/components/checkbox/demo/index.min.js +70 -45
- package/components/checkbox/demo/readme.html +16 -9
- package/components/checkbox/demo/readme.md +1 -1
- package/components/checkbox/dist/auro-checkbox-group.d.ts +1 -1
- package/components/checkbox/dist/auro-checkbox.d.ts +6 -3
- package/components/checkbox/dist/index.js +69 -44
- package/components/checkbox/dist/registered.js +69 -44
- package/components/combobox/README.md +2 -0
- package/components/combobox/demo/api.html +16 -10
- package/components/combobox/demo/api.md +121 -8
- package/components/combobox/demo/api.min.js +3283 -963
- package/components/combobox/demo/index.html +16 -10
- package/components/combobox/demo/index.md +20 -34
- package/components/combobox/demo/index.min.js +3283 -963
- package/components/combobox/demo/readme.html +16 -9
- package/components/combobox/demo/readme.md +2 -0
- package/components/combobox/dist/auro-combobox.d.ts +59 -14
- package/components/combobox/dist/index.js +3024 -848
- package/components/combobox/dist/registered.js +3024 -848
- package/components/counter/demo/api.html +17 -10
- package/components/counter/demo/api.md +167 -21
- package/components/counter/demo/api.min.js +3428 -777
- package/components/counter/demo/index.html +17 -10
- package/components/counter/demo/index.md +191 -34
- package/components/counter/demo/index.min.js +3428 -777
- package/components/counter/demo/readme.html +16 -9
- package/components/counter/dist/auro-counter-button.d.ts +2 -0
- package/components/counter/dist/auro-counter-group.d.ts +162 -11
- package/components/counter/dist/auro-counter.d.ts +16 -0
- package/components/counter/dist/helptextVersion.d.ts +2 -0
- package/components/counter/dist/iconVersion.d.ts +1 -1
- package/components/counter/dist/index.js +3427 -776
- package/components/counter/dist/registered.js +3427 -776
- package/components/datepicker/README.md +2 -1
- package/components/datepicker/demo/api.html +16 -10
- package/components/datepicker/demo/api.md +70 -28
- package/components/datepicker/demo/api.min.js +7082 -3165
- package/components/datepicker/demo/index.html +16 -10
- package/components/datepicker/demo/index.md +87 -8
- package/components/datepicker/demo/index.min.js +7082 -3165
- package/components/datepicker/demo/readme.html +16 -9
- package/components/datepicker/demo/readme.md +2 -1
- package/components/datepicker/dist/auro-datepicker.d.ts +152 -12
- package/components/datepicker/dist/buttonVersion.d.ts +1 -1
- package/components/datepicker/dist/iconVersion.d.ts +2 -0
- package/components/datepicker/dist/index.js +14635 -10718
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +14635 -10718
- package/components/dropdown/demo/api.html +16 -10
- package/components/dropdown/demo/api.md +89 -281
- package/components/dropdown/demo/api.min.js +452 -271
- package/components/dropdown/demo/index.html +16 -10
- package/components/dropdown/demo/index.md +92 -362
- package/components/dropdown/demo/index.min.js +452 -271
- package/components/dropdown/demo/readme.html +16 -9
- package/components/dropdown/dist/auro-dropdown.d.ts +43 -82
- package/components/dropdown/dist/auro-dropdownBib.d.ts +14 -0
- package/components/dropdown/dist/index.js +451 -270
- package/components/dropdown/dist/registered.js +451 -270
- package/components/form/demo/api.html +16 -9
- package/components/form/demo/api.md +1 -1
- package/components/form/demo/api.min.js +3 -3
- package/components/form/demo/autocomplete.html +19 -3
- package/components/form/demo/index.html +16 -9
- package/components/form/demo/index.min.js +3 -3
- package/components/form/demo/readme.html +16 -9
- package/components/form/demo/working.html +19 -13
- package/components/form/dist/auro-form.d.ts +1 -1
- package/components/form/dist/index.js +2 -2
- package/components/form/dist/registered.js +2 -2
- package/components/helptext/dist/auro-helptext.d.ts +0 -2
- package/components/helptext/dist/index.js +2 -4
- package/components/helptext/dist/registered.js +2 -4
- package/components/input/README.md +6 -2
- package/components/input/demo/api.html +16 -10
- package/components/input/demo/api.md +234 -136
- package/components/input/demo/api.min.js +1057 -299
- package/components/input/demo/index.html +16 -10
- package/components/input/demo/index.md +55 -32
- package/components/input/demo/index.min.js +1071 -313
- package/components/input/demo/readme.html +16 -9
- package/components/input/demo/readme.md +6 -2
- package/components/input/dist/auro-input.d.ts +36 -2
- package/components/input/dist/base-input.d.ts +47 -11
- package/components/input/dist/buttonVersion.d.ts +1 -1
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +1070 -312
- package/components/input/dist/registered.js +1070 -312
- package/components/layoutElement/dist/index.js +11 -8
- package/components/layoutElement/dist/registered.js +97 -0
- package/components/menu/demo/api.html +17 -10
- package/components/menu/demo/api.md +65 -8
- package/components/menu/demo/api.min.js +303 -64
- package/components/menu/demo/index.html +16 -10
- package/components/menu/demo/index.min.js +303 -64
- package/components/menu/demo/readme.html +16 -9
- package/components/menu/dist/auro-menu.d.ts +53 -7
- package/components/menu/dist/auro-menuoption.d.ts +21 -3
- package/components/menu/dist/iconVersion.d.ts +1 -1
- package/components/menu/dist/index.js +288 -49
- package/components/menu/dist/registered.js +288 -49
- package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
- package/components/radio/demo/api.html +16 -10
- package/components/radio/demo/api.md +41 -9
- package/components/radio/demo/api.min.js +93 -95
- package/components/radio/demo/index.html +16 -10
- package/components/radio/demo/index.min.js +93 -95
- package/components/radio/demo/readme.html +16 -9
- package/components/radio/dist/auro-radio-group.d.ts +1 -1
- package/components/radio/dist/auro-radio.d.ts +11 -12
- package/components/radio/dist/index.js +92 -94
- package/components/radio/dist/registered.js +92 -94
- package/components/select/README.md +1 -0
- package/components/select/demo/api.html +16 -10
- package/components/select/demo/api.js +0 -2
- package/components/select/demo/api.md +159 -125
- package/components/select/demo/api.min.js +2284 -729
- package/components/select/demo/index.html +17 -11
- package/components/select/demo/index.md +1074 -259
- package/components/select/demo/index.min.js +2286 -719
- package/components/select/demo/readme.html +16 -9
- package/components/select/demo/readme.md +1 -0
- package/components/select/dist/auro-select.d.ts +86 -25
- package/components/select/dist/index.js +2178 -755
- package/components/select/dist/registered.js +2178 -755
- package/package.json +31 -28
- /package/components/{datepicker/dist/styles/default/color-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/datepicker/dist/styles/{emphasized/style-css.d.ts → classic/color-css.d.ts} +0 -0
- /package/components/{input/dist/styles/default/input-css.d.ts → datepicker/dist/styles/classic/style-css.d.ts} +0 -0
- /package/components/{input/dist/styles/default/label-css.d.ts → datepicker/dist/styles/snowflake/color-css.d.ts} +0 -0
- /package/components/{input/dist/styles/input-css.d.ts → datepicker/dist/styles/snowflake/style-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/color-menu-css.d.ts → dropdown/dist/styles/style-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{color-menuoption-css.d.ts → default/color-menu-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{style-menu-css.d.ts → default/color-menuoption-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{style-menuoption-css.d.ts → default/style-menu-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{tokens-css.d.ts → default/style-menuoption-css.d.ts} +0 -0
|
@@ -36,7 +36,7 @@ const t=globalThis,e$1=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShad
|
|
|
36
36
|
* @license
|
|
37
37
|
* Copyright 2017 Google LLC
|
|
38
38
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
-
*/const{is:i$1,defineProperty:e,getOwnPropertyDescriptor:h,getOwnPropertyNames:r,getOwnPropertySymbols:o$2,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:"",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f=(t,s)=>!i$1(t,s),b={attribute:true,type:String,converter:u,reflect:false,useDefault:false,hasChanged:f};Symbol.metadata??=Symbol("metadata"),a.litPropertyMetadata??=new WeakMap;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(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d("elementProperties")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,s=[...r(t),...o$2(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$1(s));}else void 0!==s&&i.push(c$1(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).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;this._$Em=e
|
|
39
|
+
*/const{is:i$1,defineProperty:e,getOwnPropertyDescriptor:h,getOwnPropertyNames:r,getOwnPropertySymbols:o$2,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:"",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f=(t,s)=>!i$1(t,s),b={attribute:true,type:String,converter:u,reflect:false,useDefault:false,hasChanged:f};Symbol.metadata??=Symbol("metadata"),a.litPropertyMetadata??=new WeakMap;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(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d("elementProperties")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,s=[...r(t),...o$2(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$1(s));}else void 0!==s&&i.push(c$1(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).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;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)(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.elementStyles=[],y.shadowRootOptions={mode:"open"},y[d("elementProperties")]=new Map,y[d("finalized")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push("2.1.1");
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* @license
|
|
@@ -1730,7 +1730,7 @@ class AuroFloatingUI {
|
|
|
1730
1730
|
*/
|
|
1731
1731
|
mirrorSize() {
|
|
1732
1732
|
// mirror the boxsize from bibSizer
|
|
1733
|
-
if (this.element.bibSizer) {
|
|
1733
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
1734
1734
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
1735
1735
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
1736
1736
|
if (sizerStyle.width !== '0px') {
|
|
@@ -1866,6 +1866,7 @@ class AuroFloatingUI {
|
|
|
1866
1866
|
this.element.bib.style.left = "0px";
|
|
1867
1867
|
this.element.bib.style.width = '';
|
|
1868
1868
|
this.element.bib.style.height = '';
|
|
1869
|
+
this.element.style.contain = '';
|
|
1869
1870
|
|
|
1870
1871
|
// reset the size that was mirroring `size` css-part
|
|
1871
1872
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
@@ -1890,6 +1891,7 @@ class AuroFloatingUI {
|
|
|
1890
1891
|
this.element.bib.style.position = '';
|
|
1891
1892
|
this.element.bib.removeAttribute('isfullscreen');
|
|
1892
1893
|
this.element.isBibFullscreen = false;
|
|
1894
|
+
this.element.style.contain = 'layout';
|
|
1893
1895
|
}
|
|
1894
1896
|
|
|
1895
1897
|
const isChanged = this.strategy && this.strategy !== value;
|
|
@@ -1942,22 +1944,16 @@ class AuroFloatingUI {
|
|
|
1942
1944
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
1943
1945
|
return;
|
|
1944
1946
|
}
|
|
1945
|
-
|
|
1947
|
+
|
|
1946
1948
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
1947
1949
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
1948
1950
|
return;
|
|
1949
1951
|
}
|
|
1950
1952
|
|
|
1951
|
-
this.hideBib();
|
|
1953
|
+
this.hideBib("keydown");
|
|
1952
1954
|
}
|
|
1953
1955
|
|
|
1954
1956
|
setupHideHandlers() {
|
|
1955
|
-
this.preventFocusLoseOnBibClick = (event) => {
|
|
1956
|
-
event.preventDefault();
|
|
1957
|
-
event.stopPropagation();
|
|
1958
|
-
};
|
|
1959
|
-
this.element.bib.addEventListener('mousedown', this.preventFocusLoseOnBibClick);
|
|
1960
|
-
|
|
1961
1957
|
// Define handlers & store references
|
|
1962
1958
|
this.focusHandler = () => this.handleFocusLoss();
|
|
1963
1959
|
|
|
@@ -1973,7 +1969,7 @@ class AuroFloatingUI {
|
|
|
1973
1969
|
document.expandedAuroFormkitDropdown = null;
|
|
1974
1970
|
document.expandedAuroFloater = this;
|
|
1975
1971
|
} else {
|
|
1976
|
-
this.hideBib();
|
|
1972
|
+
this.hideBib("click");
|
|
1977
1973
|
}
|
|
1978
1974
|
}
|
|
1979
1975
|
};
|
|
@@ -1986,7 +1982,7 @@ class AuroFloatingUI {
|
|
|
1986
1982
|
// if something else is open, let it handle itself
|
|
1987
1983
|
return;
|
|
1988
1984
|
}
|
|
1989
|
-
this.hideBib();
|
|
1985
|
+
this.hideBib("keydown");
|
|
1990
1986
|
}
|
|
1991
1987
|
};
|
|
1992
1988
|
|
|
@@ -2007,11 +2003,6 @@ class AuroFloatingUI {
|
|
|
2007
2003
|
cleanupHideHandlers() {
|
|
2008
2004
|
// Remove event listeners if they exist
|
|
2009
2005
|
|
|
2010
|
-
if (this.preventFocusLoseOnBibClick) {
|
|
2011
|
-
this.element.bib.removeEventListener('mousedown', this.preventFocusLoseOnBibClick);
|
|
2012
|
-
delete this.preventFocusLoseOnBibClick;
|
|
2013
|
-
}
|
|
2014
|
-
|
|
2015
2006
|
if (this.focusHandler) {
|
|
2016
2007
|
document.removeEventListener('focusin', this.focusHandler);
|
|
2017
2008
|
this.focusHandler = null;
|
|
@@ -2069,7 +2060,11 @@ class AuroFloatingUI {
|
|
|
2069
2060
|
}
|
|
2070
2061
|
}
|
|
2071
2062
|
|
|
2072
|
-
|
|
2063
|
+
/**
|
|
2064
|
+
* Hides the floating UI element.
|
|
2065
|
+
* @param {String} eventType - The event type that triggered the hiding action.
|
|
2066
|
+
*/
|
|
2067
|
+
hideBib(eventType = "unknown") {
|
|
2073
2068
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
2074
2069
|
this.lockScroll(false);
|
|
2075
2070
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -2080,7 +2075,7 @@ class AuroFloatingUI {
|
|
|
2080
2075
|
if (this.showing) {
|
|
2081
2076
|
this.cleanupHideHandlers();
|
|
2082
2077
|
this.showing = false;
|
|
2083
|
-
this.dispatchEventDropdownToggle();
|
|
2078
|
+
this.dispatchEventDropdownToggle(eventType);
|
|
2084
2079
|
}
|
|
2085
2080
|
}
|
|
2086
2081
|
document.expandedAuroFloater = null;
|
|
@@ -2089,11 +2084,13 @@ class AuroFloatingUI {
|
|
|
2089
2084
|
/**
|
|
2090
2085
|
* @private
|
|
2091
2086
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
2087
|
+
* @param {String} eventType - The event type that triggered the toggle action.
|
|
2092
2088
|
*/
|
|
2093
|
-
dispatchEventDropdownToggle() {
|
|
2089
|
+
dispatchEventDropdownToggle(eventType) {
|
|
2094
2090
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
2095
2091
|
detail: {
|
|
2096
2092
|
expanded: this.showing,
|
|
2093
|
+
eventType: eventType || "unknown",
|
|
2097
2094
|
},
|
|
2098
2095
|
composed: true
|
|
2099
2096
|
});
|
|
@@ -2103,7 +2100,7 @@ class AuroFloatingUI {
|
|
|
2103
2100
|
|
|
2104
2101
|
handleClick() {
|
|
2105
2102
|
if (this.element.isPopoverVisible) {
|
|
2106
|
-
this.hideBib();
|
|
2103
|
+
this.hideBib("click");
|
|
2107
2104
|
} else {
|
|
2108
2105
|
this.showBib();
|
|
2109
2106
|
}
|
|
@@ -2126,8 +2123,9 @@ class AuroFloatingUI {
|
|
|
2126
2123
|
// Space is included as it's expected behavior for interactive elements
|
|
2127
2124
|
|
|
2128
2125
|
const origin = event.composedPath()[0];
|
|
2129
|
-
if (event.key === 'Enter' || (
|
|
2130
|
-
|
|
2126
|
+
if (event.key === 'Enter' || event.key === ' ' && (!origin || origin.tagName !== "INPUT")) {
|
|
2127
|
+
|
|
2128
|
+
event.preventDefault();
|
|
2131
2129
|
this.handleClick();
|
|
2132
2130
|
}
|
|
2133
2131
|
break;
|
|
@@ -2138,7 +2136,7 @@ class AuroFloatingUI {
|
|
|
2138
2136
|
break;
|
|
2139
2137
|
case 'mouseleave':
|
|
2140
2138
|
if (this.element.hoverToggle) {
|
|
2141
|
-
this.hideBib();
|
|
2139
|
+
this.hideBib("mouseleave");
|
|
2142
2140
|
}
|
|
2143
2141
|
break;
|
|
2144
2142
|
case 'focus':
|
|
@@ -2281,6 +2279,267 @@ class AuroFloatingUI {
|
|
|
2281
2279
|
}
|
|
2282
2280
|
}
|
|
2283
2281
|
|
|
2282
|
+
// Selectors for focusable elements
|
|
2283
|
+
const FOCUSABLE_SELECTORS = [
|
|
2284
|
+
'a[href]',
|
|
2285
|
+
'button:not([disabled])',
|
|
2286
|
+
'textarea:not([disabled])',
|
|
2287
|
+
'input:not([disabled])',
|
|
2288
|
+
'select:not([disabled])',
|
|
2289
|
+
'[role="tab"]:not([disabled])',
|
|
2290
|
+
'[role="link"]:not([disabled])',
|
|
2291
|
+
'[role="button"]:not([disabled])',
|
|
2292
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
2293
|
+
'[contenteditable]:not([contenteditable="false"])'
|
|
2294
|
+
];
|
|
2295
|
+
|
|
2296
|
+
// List of custom components that are known to be focusable
|
|
2297
|
+
const FOCUSABLE_COMPONENTS = [
|
|
2298
|
+
'auro-checkbox',
|
|
2299
|
+
'auro-radio',
|
|
2300
|
+
'auro-dropdown',
|
|
2301
|
+
'auro-button',
|
|
2302
|
+
'auro-combobox',
|
|
2303
|
+
'auro-input',
|
|
2304
|
+
'auro-counter',
|
|
2305
|
+
'auro-menu',
|
|
2306
|
+
'auro-select',
|
|
2307
|
+
'auro-datepicker',
|
|
2308
|
+
'auro-hyperlink',
|
|
2309
|
+
'auro-accordion',
|
|
2310
|
+
];
|
|
2311
|
+
|
|
2312
|
+
/**
|
|
2313
|
+
* Determines if a given element is a custom focusable component.
|
|
2314
|
+
* Returns true if the element matches a known focusable component and is not disabled.
|
|
2315
|
+
*
|
|
2316
|
+
* @param {HTMLElement} element The element to check for focusability.
|
|
2317
|
+
* @returns {boolean} True if the element is a focusable custom component, false otherwise.
|
|
2318
|
+
*/
|
|
2319
|
+
function isFocusableComponent(element) {
|
|
2320
|
+
const componentName = element.tagName.toLowerCase();
|
|
2321
|
+
|
|
2322
|
+
// Guard Clause: Element is a focusable component
|
|
2323
|
+
if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
|
|
2324
|
+
|
|
2325
|
+
// Guard Clause: Element is not disabled
|
|
2326
|
+
if (element.hasAttribute('disabled')) return false;
|
|
2327
|
+
|
|
2328
|
+
// Guard Clause: The element is a hyperlink and has no href attribute
|
|
2329
|
+
if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
|
|
2330
|
+
|
|
2331
|
+
// If all guard clauses pass, the element is a focusable component
|
|
2332
|
+
return true;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
/**
|
|
2336
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
2337
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
2338
|
+
*
|
|
2339
|
+
* @param {HTMLElement} container The container to search within
|
|
2340
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
2341
|
+
*/
|
|
2342
|
+
function getFocusableElements(container) {
|
|
2343
|
+
// Get elements in DOM order by walking the tree
|
|
2344
|
+
const orderedFocusableElements = [];
|
|
2345
|
+
|
|
2346
|
+
// Define a recursive function to collect focusable elements in DOM order
|
|
2347
|
+
const collectFocusableElements = (root) => {
|
|
2348
|
+
// Check if current element is focusable
|
|
2349
|
+
if (root.nodeType === Node.ELEMENT_NODE) {
|
|
2350
|
+
// Check if this is a custom component that is focusable
|
|
2351
|
+
const isComponentFocusable = isFocusableComponent(root);
|
|
2352
|
+
|
|
2353
|
+
if (isComponentFocusable) {
|
|
2354
|
+
// Add the component itself as a focusable element and don't traverse its shadow DOM
|
|
2355
|
+
orderedFocusableElements.push(root);
|
|
2356
|
+
return; // Skip traversing inside this component
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
// Check if the element itself matches any selector
|
|
2360
|
+
for (const selector of FOCUSABLE_SELECTORS) {
|
|
2361
|
+
if (root.matches?.(selector)) {
|
|
2362
|
+
orderedFocusableElements.push(root);
|
|
2363
|
+
break; // Once we know it's focusable, no need to check other selectors
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
// Process shadow DOM only for non-Auro components
|
|
2368
|
+
if (root.shadowRoot) {
|
|
2369
|
+
// Process shadow DOM children in order
|
|
2370
|
+
if (root.shadowRoot.children) {
|
|
2371
|
+
Array.from(root.shadowRoot.children).forEach(child => {
|
|
2372
|
+
collectFocusableElements(child);
|
|
2373
|
+
});
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
// Process slots and their assigned nodes in order
|
|
2378
|
+
if (root.tagName === 'SLOT') {
|
|
2379
|
+
const assignedNodes = root.assignedNodes({ flatten: true });
|
|
2380
|
+
for (const node of assignedNodes) {
|
|
2381
|
+
collectFocusableElements(node);
|
|
2382
|
+
}
|
|
2383
|
+
} else {
|
|
2384
|
+
// Process light DOM children in order
|
|
2385
|
+
if (root.children) {
|
|
2386
|
+
Array.from(root.children).forEach(child => {
|
|
2387
|
+
collectFocusableElements(child);
|
|
2388
|
+
});
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
};
|
|
2393
|
+
|
|
2394
|
+
// Start the traversal from the container
|
|
2395
|
+
collectFocusableElements(container);
|
|
2396
|
+
|
|
2397
|
+
// Remove duplicates that might have been collected through different paths
|
|
2398
|
+
// while preserving order
|
|
2399
|
+
const uniqueElements = [];
|
|
2400
|
+
const seen = new Set();
|
|
2401
|
+
|
|
2402
|
+
for (const element of orderedFocusableElements) {
|
|
2403
|
+
if (!seen.has(element)) {
|
|
2404
|
+
seen.add(element);
|
|
2405
|
+
uniqueElements.push(element);
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
return uniqueElements;
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
/**
|
|
2413
|
+
* FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
|
|
2414
|
+
* It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
|
|
2415
|
+
*/
|
|
2416
|
+
class FocusTrap {
|
|
2417
|
+
/**
|
|
2418
|
+
* Creates a new FocusTrap instance for the given container element.
|
|
2419
|
+
* Initializes event listeners and prepares the container for focus management.
|
|
2420
|
+
*
|
|
2421
|
+
* @param {HTMLElement} container The DOM element to trap focus within.
|
|
2422
|
+
* @throws {Error} If the provided container is not a valid HTMLElement.
|
|
2423
|
+
*/
|
|
2424
|
+
constructor(container) {
|
|
2425
|
+
if (!container || !(container instanceof HTMLElement)) {
|
|
2426
|
+
throw new Error("FocusTrap requires a valid HTMLElement.");
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
this.container = container;
|
|
2430
|
+
this.tabDirection = 'forward'; // or 'backward'
|
|
2431
|
+
|
|
2432
|
+
this._init();
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
/**
|
|
2436
|
+
* Initializes the focus trap by setting up event listeners and attributes on the container.
|
|
2437
|
+
* Prepares the container for focus management, including support for shadow DOM and inert attributes.
|
|
2438
|
+
*
|
|
2439
|
+
* @private
|
|
2440
|
+
*/
|
|
2441
|
+
_init() {
|
|
2442
|
+
|
|
2443
|
+
// Add inert attribute to prevent focusing programmatically as well (if supported)
|
|
2444
|
+
if ('inert' in HTMLElement.prototype) {
|
|
2445
|
+
this.container.inert = false; // Ensure the container isn't inert
|
|
2446
|
+
this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
|
|
2447
|
+
}
|
|
2448
|
+
|
|
2449
|
+
// Track tab direction
|
|
2450
|
+
this.container.addEventListener('keydown', this._onKeydown);
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
/**
|
|
2454
|
+
* Handles keydown events to manage tab navigation within the container.
|
|
2455
|
+
* Ensures that focus wraps around when reaching the first or last focusable element.
|
|
2456
|
+
*
|
|
2457
|
+
* @param {KeyboardEvent} e The keyboard event triggered by user interaction.
|
|
2458
|
+
* @private
|
|
2459
|
+
*/
|
|
2460
|
+
_onKeydown = (e) => {
|
|
2461
|
+
|
|
2462
|
+
if (e.key === 'Tab') {
|
|
2463
|
+
|
|
2464
|
+
// Set the tab direction based on the key pressed
|
|
2465
|
+
this.tabDirection = e.shiftKey ? 'backward' : 'forward';
|
|
2466
|
+
|
|
2467
|
+
// Get the active element(s) in the document and shadow root
|
|
2468
|
+
// This will include the active element in the shadow DOM if it exists
|
|
2469
|
+
// Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
|
|
2470
|
+
let activeElement = document.activeElement;
|
|
2471
|
+
const actives = [activeElement];
|
|
2472
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
2473
|
+
actives.push(activeElement.shadowRoot.activeElement);
|
|
2474
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2477
|
+
// Update the focusable elements
|
|
2478
|
+
const focusables = this._getFocusableElements();
|
|
2479
|
+
|
|
2480
|
+
// If we're at either end of the focusable elements, wrap around to the other end
|
|
2481
|
+
const focusIndex =
|
|
2482
|
+
(actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
|
|
2483
|
+
? focusables.length - 1
|
|
2484
|
+
: actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
|
|
2485
|
+
? 0
|
|
2486
|
+
: null;
|
|
2487
|
+
|
|
2488
|
+
if (focusIndex !== null) {
|
|
2489
|
+
focusables[focusIndex].focus();
|
|
2490
|
+
e.preventDefault(); // Prevent default tab behavior
|
|
2491
|
+
e.stopPropagation(); // Stop the event from bubbling up
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
};
|
|
2495
|
+
|
|
2496
|
+
/**
|
|
2497
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
2498
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
2499
|
+
*
|
|
2500
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
2501
|
+
* @private
|
|
2502
|
+
*/
|
|
2503
|
+
_getFocusableElements() {
|
|
2504
|
+
// Use the imported utility function to get focusable elements
|
|
2505
|
+
const elements = getFocusableElements(this.container);
|
|
2506
|
+
|
|
2507
|
+
// Filter out any elements with the 'focus-bookend' class
|
|
2508
|
+
return elements;
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
/**
|
|
2512
|
+
* Moves focus to the first focusable element within the container.
|
|
2513
|
+
* Useful for setting initial focus when activating the focus trap.
|
|
2514
|
+
*/
|
|
2515
|
+
focusFirstElement() {
|
|
2516
|
+
const focusables = this._getFocusableElements();
|
|
2517
|
+
if (focusables.length) focusables[0].focus();
|
|
2518
|
+
}
|
|
2519
|
+
|
|
2520
|
+
/**
|
|
2521
|
+
* Moves focus to the last focusable element within the container.
|
|
2522
|
+
* Useful for setting focus when deactivating or cycling focus in reverse.
|
|
2523
|
+
*/
|
|
2524
|
+
focusLastElement() {
|
|
2525
|
+
const focusables = this._getFocusableElements();
|
|
2526
|
+
if (focusables.length) focusables[focusables.length - 1].focus();
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2529
|
+
/**
|
|
2530
|
+
* Removes event listeners and attributes added by the focus trap.
|
|
2531
|
+
* Call this method to clean up when the focus trap is no longer needed.
|
|
2532
|
+
*/
|
|
2533
|
+
disconnect() {
|
|
2534
|
+
|
|
2535
|
+
if (this.container.hasAttribute('data-focus-trap-container')) {
|
|
2536
|
+
this.container.removeAttribute('data-focus-trap-container');
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
this.container.removeEventListener('keydown', this._onKeydown);
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
|
|
2284
2543
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
2285
2544
|
// See LICENSE in the project root for license information.
|
|
2286
2545
|
|
|
@@ -2393,7 +2652,7 @@ const cacheFetch = (uri, options = {}) => {
|
|
|
2393
2652
|
return _fetchMap.get(uri);
|
|
2394
2653
|
};
|
|
2395
2654
|
|
|
2396
|
-
var styleCss$
|
|
2655
|
+
var styleCss$3 = i$2`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, 0.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, 0.25rem);line-height:1.8}`;
|
|
2397
2656
|
|
|
2398
2657
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2399
2658
|
// See LICENSE in the project root for license information.
|
|
@@ -2436,7 +2695,7 @@ class BaseIcon extends AuroElement$1 {
|
|
|
2436
2695
|
|
|
2437
2696
|
static get styles() {
|
|
2438
2697
|
return i$2`
|
|
2439
|
-
${styleCss$
|
|
2698
|
+
${styleCss$3}
|
|
2440
2699
|
`;
|
|
2441
2700
|
}
|
|
2442
2701
|
|
|
@@ -2598,7 +2857,8 @@ class AuroIcon extends BaseIcon {
|
|
|
2598
2857
|
* Allows custom color to be set.
|
|
2599
2858
|
*/
|
|
2600
2859
|
customColor: {
|
|
2601
|
-
type: Boolean
|
|
2860
|
+
type: Boolean,
|
|
2861
|
+
reflect: true
|
|
2602
2862
|
},
|
|
2603
2863
|
|
|
2604
2864
|
/**
|
|
@@ -2638,7 +2898,7 @@ class AuroIcon extends BaseIcon {
|
|
|
2638
2898
|
return [
|
|
2639
2899
|
super.styles,
|
|
2640
2900
|
i$2`${tokensCss$2}`,
|
|
2641
|
-
i$2`${styleCss$
|
|
2901
|
+
i$2`${styleCss$3}`,
|
|
2642
2902
|
i$2`${colorCss$3}`
|
|
2643
2903
|
];
|
|
2644
2904
|
}
|
|
@@ -2673,8 +2933,12 @@ class AuroIcon extends BaseIcon {
|
|
|
2673
2933
|
async firstUpdated() {
|
|
2674
2934
|
await super.firstUpdated();
|
|
2675
2935
|
|
|
2676
|
-
|
|
2677
|
-
|
|
2936
|
+
/**
|
|
2937
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
2938
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
2939
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
2940
|
+
*/
|
|
2941
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
2678
2942
|
const svgDesc = this.svg.querySelector('desc');
|
|
2679
2943
|
|
|
2680
2944
|
if (svgDesc) {
|
|
@@ -2720,11 +2984,11 @@ class AuroIcon extends BaseIcon {
|
|
|
2720
2984
|
|
|
2721
2985
|
var iconVersion = '6.1.2';
|
|
2722
2986
|
|
|
2723
|
-
var styleCss$
|
|
2987
|
+
var styleCss$2 = i$2`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}`;
|
|
2724
2988
|
|
|
2725
2989
|
var colorCss$2 = i$2`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
2726
2990
|
|
|
2727
|
-
var tokensCss$1 = i$2`:host(:not([ondark])){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-dropdown-trigger-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-border-color:
|
|
2991
|
+
var tokensCss$1 = i$2`:host(:not([ondark])){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-dropdown-trigger-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db);--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}`;
|
|
2728
2992
|
|
|
2729
2993
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2730
2994
|
// See LICENSE in the project root for license information.
|
|
@@ -2745,7 +3009,7 @@ const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
|
2745
3009
|
*/
|
|
2746
3010
|
|
|
2747
3011
|
class AuroDropdownBib extends i {
|
|
2748
|
-
|
|
3012
|
+
// not extending AuroElement because Bib needs only `shape` prop
|
|
2749
3013
|
constructor() {
|
|
2750
3014
|
super();
|
|
2751
3015
|
|
|
@@ -2755,11 +3019,14 @@ class AuroDropdownBib extends i {
|
|
|
2755
3019
|
this._mobileBreakpointValue = undefined;
|
|
2756
3020
|
|
|
2757
3021
|
AuroLibraryRuntimeUtils$2.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
3022
|
+
|
|
3023
|
+
this.shape = "rounded";
|
|
3024
|
+
this.matchWidth = false;
|
|
2758
3025
|
}
|
|
2759
3026
|
|
|
2760
3027
|
static get styles() {
|
|
2761
3028
|
return [
|
|
2762
|
-
styleCss$
|
|
3029
|
+
styleCss$2,
|
|
2763
3030
|
colorCss$2,
|
|
2764
3031
|
tokensCss$1
|
|
2765
3032
|
];
|
|
@@ -2792,6 +3059,15 @@ class AuroDropdownBib extends i {
|
|
|
2792
3059
|
reflect: true
|
|
2793
3060
|
},
|
|
2794
3061
|
|
|
3062
|
+
/**
|
|
3063
|
+
* If declared, the bib width will match the trigger width.
|
|
3064
|
+
* @private
|
|
3065
|
+
*/
|
|
3066
|
+
matchWidth: {
|
|
3067
|
+
type: Boolean,
|
|
3068
|
+
reflect: true
|
|
3069
|
+
},
|
|
3070
|
+
|
|
2795
3071
|
/**
|
|
2796
3072
|
* If declared, will apply border-radius to the bib.
|
|
2797
3073
|
*/
|
|
@@ -2805,6 +3081,11 @@ class AuroDropdownBib extends i {
|
|
|
2805
3081
|
*/
|
|
2806
3082
|
bibTemplate: {
|
|
2807
3083
|
type: Object
|
|
3084
|
+
},
|
|
3085
|
+
|
|
3086
|
+
shape: {
|
|
3087
|
+
type: String,
|
|
3088
|
+
reflect: true
|
|
2808
3089
|
}
|
|
2809
3090
|
};
|
|
2810
3091
|
}
|
|
@@ -2884,8 +3165,16 @@ class AuroDropdownBib extends i {
|
|
|
2884
3165
|
|
|
2885
3166
|
// function that renders the HTML and CSS into the scope of the component
|
|
2886
3167
|
render() {
|
|
3168
|
+
const classes = {
|
|
3169
|
+
container: true
|
|
3170
|
+
};
|
|
3171
|
+
|
|
3172
|
+
// Since this class does not inherit from AuroElement, we apply the shape-related class within the `render` function,
|
|
3173
|
+
// mimicking the class naming convention used in AuroElement.resetShapeClasses.
|
|
3174
|
+
classes[`shape-${this.shape}`] = true;
|
|
3175
|
+
|
|
2887
3176
|
return u$1`
|
|
2888
|
-
<div class="
|
|
3177
|
+
<div class="${e$2(classes)}" part="bibContainer">
|
|
2889
3178
|
<slot></slot>
|
|
2890
3179
|
</div>
|
|
2891
3180
|
`;
|
|
@@ -2894,21 +3183,23 @@ class AuroDropdownBib extends i {
|
|
|
2894
3183
|
|
|
2895
3184
|
var dropdownVersion = '3.0.0';
|
|
2896
3185
|
|
|
2897
|
-
var shapeSizeCss = i$2`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:
|
|
3186
|
+
var shapeSizeCss = i$2`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:56px;max-height:56px;border-style:solid;border-width:1px;border-radius:var(--ds-border-radius, 0.375rem)}.shape-classic-xl.simple,.shape-classic-lg.simple,.shape-classic-md.simple,.shape-classic-sm.simple,.shape-classic-xs.simple{border-width:0px;min-height:58px;max-height:58px;background-color:unset;box-shadow:none}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:56px;max-height:56px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;box-shadow:unset;min-height:54px;max-height:54px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-box-lg{min-height:52px;max-height:52px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-box-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-box-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-box-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-box-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-box-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-box-sm{min-height:32px;max-height:32px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-sm.simple{border-width:0px;min-height:36px;max-height:36px;background-color:unset;box-shadow:none}.shape-box-sm.thin{border-width:1px;min-height:34px;max-height:34px;background-color:unset}.shape-box-sm.parentBorder{border:0;box-shadow:unset;min-height:32px;max-height:32px}.shape-box-xs{min-height:20px;max-height:20px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xs.simple{border-width:0px;min-height:24px;max-height:24px;background-color:unset;box-shadow:none}.shape-box-xs.thin{border-width:1px;min-height:22px;max-height:22px;background-color:unset}.shape-box-xs.parentBorder{border:0;box-shadow:unset;min-height:20px;max-height:20px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}`;
|
|
3187
|
+
|
|
3188
|
+
var colorCss$1 = i$2`:host(:not([layout*=classic])){--ds-auro-dropdown-trigger-border-color: transparent}:host(:not([ondark])) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus-within,:host(:not([ondark])) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host(:not([onDark])[disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([ondark])[error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]) .label,:host([onDark]) .helpText{color:var(--ds-auro-dropdown-label-text-color)}:host([onDark]) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host([onDark]) .wrapper:focus-within,:host([onDark]) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark][disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}:host([ondark][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
2898
3189
|
|
|
2899
|
-
var
|
|
3190
|
+
var styleCss$1 = i$2`:host{position:relative;display:block}:host([open]){z-index:var(--depth-tooltip, 400)}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([matchwidth]) #bibSizer{width:100%}`;
|
|
2900
3191
|
|
|
2901
|
-
var classicColorCss = i$2
|
|
3192
|
+
var classicColorCss = i$2``;
|
|
2902
3193
|
|
|
2903
|
-
var classicLayoutCss = i$2`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic])
|
|
3194
|
+
var classicLayoutCss = i$2`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) label{transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .wrapper{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}@media(hover: hover){:host([layout*=classic]) .wrapper:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}`;
|
|
2904
3195
|
|
|
2905
|
-
var styleEmphasizedCss = i$2
|
|
3196
|
+
var styleEmphasizedCss = i$2`.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=right])) .leftIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left])) .rightIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left]):not([layout*=right])) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
2906
3197
|
|
|
2907
|
-
var styleSnowflakeCss = i$2`:host
|
|
3198
|
+
var styleSnowflakeCss = i$2`:host([layout*=snowflake]) .leftIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .trigger,:host([layout*=snowflake]) .helpText{text-align:center}.layout-snowflake .chevron,.layout-snowflake-left .chevron,.layout-snowflake-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
2908
3199
|
|
|
2909
3200
|
var colorCss = i$2`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
2910
3201
|
|
|
2911
|
-
var styleCss = i$2`.
|
|
3202
|
+
var styleCss = i$2`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.63)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, 0.88)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:host{position:relative;display:block}.helptext-wrapper{display:none}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
2912
3203
|
|
|
2913
3204
|
var tokensCss = i$2`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
2914
3205
|
|
|
@@ -2988,8 +3279,6 @@ class AuroLibraryRuntimeUtils {
|
|
|
2988
3279
|
|
|
2989
3280
|
/**
|
|
2990
3281
|
* Displays help text or error messages within form elements - Internal Use Only.
|
|
2991
|
-
*
|
|
2992
|
-
* @attr { Boolean } large - If declared, make font-size to 1rem(16px).
|
|
2993
3282
|
*/
|
|
2994
3283
|
class AuroHelpText extends i {
|
|
2995
3284
|
|
|
@@ -3105,7 +3394,7 @@ class AuroHelpText extends i {
|
|
|
3105
3394
|
// function that renders the HTML and CSS into the scope of the component
|
|
3106
3395
|
render() {
|
|
3107
3396
|
return x`
|
|
3108
|
-
<div class="helptext-wrapper" ?visible="${this.hasTextContent}">
|
|
3397
|
+
<div class="helptext-wrapper body-xs" ?visible="${this.hasTextContent}">
|
|
3109
3398
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
3110
3399
|
</div>
|
|
3111
3400
|
`;
|
|
@@ -3149,19 +3438,22 @@ class AuroElement extends i {
|
|
|
3149
3438
|
}
|
|
3150
3439
|
|
|
3151
3440
|
resetShapeClasses() {
|
|
3152
|
-
|
|
3153
|
-
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
3441
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
3154
3442
|
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3443
|
+
if (wrapper) {
|
|
3444
|
+
wrapper.classList.forEach((className) => {
|
|
3445
|
+
if (className.startsWith('shape-')) {
|
|
3446
|
+
wrapper.classList.remove(className);
|
|
3447
|
+
}
|
|
3448
|
+
});
|
|
3161
3449
|
|
|
3450
|
+
if (this.shape && this.size) {
|
|
3162
3451
|
wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
3452
|
+
} else {
|
|
3453
|
+
wrapper.classList.add('shape-none');
|
|
3163
3454
|
}
|
|
3164
3455
|
}
|
|
3456
|
+
|
|
3165
3457
|
}
|
|
3166
3458
|
|
|
3167
3459
|
resetLayoutClasses() {
|
|
@@ -3210,14 +3502,14 @@ class AuroElement extends i {
|
|
|
3210
3502
|
// See LICENSE in the project root for license information.
|
|
3211
3503
|
|
|
3212
3504
|
|
|
3213
|
-
|
|
3214
|
-
|
|
3505
|
+
|
|
3506
|
+
/*
|
|
3215
3507
|
* @slot - Default slot for the popover content.
|
|
3216
|
-
* @slot label - Defines the content of the label.
|
|
3217
3508
|
* @slot helpText - Defines the content of the helpText.
|
|
3218
3509
|
* @slot trigger - Defines the content of the trigger.
|
|
3219
3510
|
* @csspart trigger - The trigger content container.
|
|
3220
3511
|
* @csspart chevron - The collapsed/expanded state icon container.
|
|
3512
|
+
* @csspart size - The size of the dropdown bib. (height, width, maxHeight, maxWidth only)
|
|
3221
3513
|
* @csspart helpText - The helpText content container.
|
|
3222
3514
|
* @event auroDropdown-triggerClick - Notifies that the trigger has been clicked.
|
|
3223
3515
|
* @event auroDropdown-toggled - Notifies that the visibility of the dropdown bib has changed.
|
|
@@ -3232,23 +3524,25 @@ class AuroDropdown extends AuroElement {
|
|
|
3232
3524
|
this.matchWidth = false;
|
|
3233
3525
|
this.noHideOnThisFocusLoss = false;
|
|
3234
3526
|
|
|
3235
|
-
this.errorMessage =
|
|
3527
|
+
this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
|
|
3236
3528
|
|
|
3237
3529
|
// Layout Config
|
|
3238
|
-
this.layout =
|
|
3239
|
-
this.shape =
|
|
3240
|
-
this.size =
|
|
3530
|
+
this.layout = undefined;
|
|
3531
|
+
this.shape = undefined;
|
|
3532
|
+
this.size = undefined;
|
|
3533
|
+
|
|
3241
3534
|
this.parentBorder = false;
|
|
3242
3535
|
|
|
3243
|
-
|
|
3244
|
-
|
|
3536
|
+
/** @private */
|
|
3537
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
3245
3538
|
|
|
3246
|
-
|
|
3247
|
-
return {
|
|
3248
|
-
// 'withValue': this.value && this.value.length > 0
|
|
3249
|
-
};
|
|
3539
|
+
this.privateDefaults();
|
|
3250
3540
|
}
|
|
3251
3541
|
|
|
3542
|
+
/**
|
|
3543
|
+
* @private
|
|
3544
|
+
* @returns {object} Class definition for the wrapper element.
|
|
3545
|
+
*/
|
|
3252
3546
|
get commonWrapperClasses() {
|
|
3253
3547
|
return {
|
|
3254
3548
|
'trigger': true,
|
|
@@ -3266,13 +3560,10 @@ class AuroDropdown extends AuroElement {
|
|
|
3266
3560
|
privateDefaults() {
|
|
3267
3561
|
this.chevron = false;
|
|
3268
3562
|
this.disabled = false;
|
|
3563
|
+
this.disableFocusTrap = false;
|
|
3269
3564
|
this.error = false;
|
|
3270
|
-
this.inset = false;
|
|
3271
|
-
this.rounded = false;
|
|
3272
3565
|
this.tabIndex = 0;
|
|
3273
3566
|
this.noToggle = false;
|
|
3274
|
-
this.a11yAutocomplete = 'none';
|
|
3275
|
-
this.labeled = true;
|
|
3276
3567
|
this.a11yRole = 'button';
|
|
3277
3568
|
this.onDark = false;
|
|
3278
3569
|
this.showTriggerBorders = true;
|
|
@@ -3368,6 +3659,18 @@ class AuroDropdown extends AuroElement {
|
|
|
3368
3659
|
this.floater.showBib();
|
|
3369
3660
|
}
|
|
3370
3661
|
|
|
3662
|
+
/**
|
|
3663
|
+
* When bib is open, focus on the first element inside of bib.
|
|
3664
|
+
* If not, trigger element will get focus.
|
|
3665
|
+
*/
|
|
3666
|
+
focus() {
|
|
3667
|
+
if (this.isPopoverVisible && this.focusTrap) {
|
|
3668
|
+
this.focusTrap.focusFirstElement();
|
|
3669
|
+
} else {
|
|
3670
|
+
this.trigger.focus();
|
|
3671
|
+
}
|
|
3672
|
+
}
|
|
3673
|
+
|
|
3371
3674
|
// function to define props used within the scope of this component
|
|
3372
3675
|
static get properties() {
|
|
3373
3676
|
return {
|
|
@@ -3381,6 +3684,15 @@ class AuroDropdown extends AuroElement {
|
|
|
3381
3684
|
reflect: true
|
|
3382
3685
|
},
|
|
3383
3686
|
|
|
3687
|
+
/**
|
|
3688
|
+
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
3689
|
+
* @default false
|
|
3690
|
+
*/
|
|
3691
|
+
disableEventShow: {
|
|
3692
|
+
type: Boolean,
|
|
3693
|
+
reflect: true
|
|
3694
|
+
},
|
|
3695
|
+
|
|
3384
3696
|
/**
|
|
3385
3697
|
* If declared, applies a border around the trigger slot.
|
|
3386
3698
|
*/
|
|
@@ -3399,17 +3711,17 @@ class AuroDropdown extends AuroElement {
|
|
|
3399
3711
|
},
|
|
3400
3712
|
|
|
3401
3713
|
/**
|
|
3402
|
-
* If declared, the dropdown
|
|
3714
|
+
* If declared, the dropdown is not interactive.
|
|
3403
3715
|
*/
|
|
3404
|
-
|
|
3716
|
+
disabled: {
|
|
3405
3717
|
type: Boolean,
|
|
3406
3718
|
reflect: true
|
|
3407
3719
|
},
|
|
3408
3720
|
|
|
3409
3721
|
/**
|
|
3410
|
-
* If declared, the
|
|
3722
|
+
* If declared, the focus trap inside of bib will be turned off.
|
|
3411
3723
|
*/
|
|
3412
|
-
|
|
3724
|
+
disableFocusTrap: {
|
|
3413
3725
|
type: Boolean,
|
|
3414
3726
|
reflect: true
|
|
3415
3727
|
},
|
|
@@ -3454,27 +3766,13 @@ class AuroDropdown extends AuroElement {
|
|
|
3454
3766
|
reflect: true
|
|
3455
3767
|
},
|
|
3456
3768
|
|
|
3457
|
-
/**
|
|
3458
|
-
* Makes the trigger to be full width of its parent container.
|
|
3459
|
-
*/
|
|
3460
|
-
fluid: {
|
|
3461
|
-
type: Boolean,
|
|
3462
|
-
reflect: true
|
|
3463
|
-
},
|
|
3464
|
-
|
|
3465
|
-
/**
|
|
3466
|
-
* If declared, will apply padding around trigger slot content.
|
|
3467
|
-
*/
|
|
3468
|
-
inset: {
|
|
3469
|
-
type: Boolean,
|
|
3470
|
-
reflect: true
|
|
3471
|
-
},
|
|
3472
|
-
|
|
3473
3769
|
/**
|
|
3474
3770
|
* If true, the dropdown bib is displayed.
|
|
3475
3771
|
*/
|
|
3476
3772
|
isPopoverVisible: {
|
|
3477
|
-
type: Boolean
|
|
3773
|
+
type: Boolean,
|
|
3774
|
+
reflect: true,
|
|
3775
|
+
attribute: 'open'
|
|
3478
3776
|
},
|
|
3479
3777
|
|
|
3480
3778
|
/**
|
|
@@ -3513,15 +3811,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3513
3811
|
reflect: true
|
|
3514
3812
|
},
|
|
3515
3813
|
|
|
3516
|
-
/**
|
|
3517
|
-
* Defines if there is a label preset.
|
|
3518
|
-
* @private
|
|
3519
|
-
*/
|
|
3520
|
-
labeled: {
|
|
3521
|
-
type: Boolean,
|
|
3522
|
-
reflect: true
|
|
3523
|
-
},
|
|
3524
|
-
|
|
3525
3814
|
/**
|
|
3526
3815
|
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
3527
3816
|
* @private
|
|
@@ -3582,6 +3871,9 @@ class AuroDropdown extends AuroElement {
|
|
|
3582
3871
|
reflect: true
|
|
3583
3872
|
},
|
|
3584
3873
|
|
|
3874
|
+
/**
|
|
3875
|
+
* If declared, and a function is set, that function will execute when the slot content is updated.
|
|
3876
|
+
*/
|
|
3585
3877
|
onSlotChange: {
|
|
3586
3878
|
type: Function,
|
|
3587
3879
|
reflect: false
|
|
@@ -3596,14 +3888,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3596
3888
|
reflect: true
|
|
3597
3889
|
},
|
|
3598
3890
|
|
|
3599
|
-
/**
|
|
3600
|
-
* If declared, will apply border-radius to trigger and default slots.
|
|
3601
|
-
*/
|
|
3602
|
-
rounded: {
|
|
3603
|
-
type: Boolean,
|
|
3604
|
-
reflect: true
|
|
3605
|
-
},
|
|
3606
|
-
|
|
3607
3891
|
/**
|
|
3608
3892
|
* @private
|
|
3609
3893
|
*/
|
|
@@ -3618,22 +3902,15 @@ class AuroDropdown extends AuroElement {
|
|
|
3618
3902
|
type: String || undefined,
|
|
3619
3903
|
attribute: false,
|
|
3620
3904
|
reflect: false
|
|
3621
|
-
},
|
|
3622
|
-
|
|
3623
|
-
/**
|
|
3624
|
-
* The value for the aria-autocomplete attribute of the trigger element.
|
|
3625
|
-
*/
|
|
3626
|
-
a11yAutocomplete: {
|
|
3627
|
-
type: String,
|
|
3628
|
-
attribute: false,
|
|
3629
3905
|
}
|
|
3630
3906
|
};
|
|
3631
3907
|
}
|
|
3632
3908
|
|
|
3633
3909
|
static get styles() {
|
|
3634
3910
|
return [
|
|
3635
|
-
|
|
3911
|
+
styleCss$1,
|
|
3636
3912
|
tokensCss$1,
|
|
3913
|
+
colorCss$1,
|
|
3637
3914
|
|
|
3638
3915
|
// default layout
|
|
3639
3916
|
classicColorCss,
|
|
@@ -3695,13 +3972,27 @@ class AuroDropdown extends AuroElement {
|
|
|
3695
3972
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
3696
3973
|
this.handleTriggerContentSlotChange();
|
|
3697
3974
|
}
|
|
3975
|
+
}
|
|
3698
3976
|
|
|
3977
|
+
/**
|
|
3978
|
+
* Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
|
|
3979
|
+
* @private
|
|
3980
|
+
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
3981
|
+
*/
|
|
3982
|
+
handleDropdownToggle(event) {
|
|
3983
|
+
this.updateFocusTrap();
|
|
3984
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
3985
|
+
const eventType = event.detail.eventType || "unknown";
|
|
3986
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
3987
|
+
this.trigger.focus();
|
|
3988
|
+
}
|
|
3699
3989
|
}
|
|
3700
3990
|
|
|
3701
3991
|
firstUpdated() {
|
|
3702
3992
|
|
|
3703
3993
|
// Configure the floater to, this will generate the ID for the bib
|
|
3704
3994
|
this.floater.configure(this, 'auroDropdown');
|
|
3995
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
3705
3996
|
|
|
3706
3997
|
/**
|
|
3707
3998
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -3719,6 +4010,13 @@ class AuroDropdown extends AuroElement {
|
|
|
3719
4010
|
|
|
3720
4011
|
// Add the tag name as an attribute if it is different than the component name
|
|
3721
4012
|
this.runtimeUtils.handleComponentTagRename(this, 'auro-dropdown');
|
|
4013
|
+
|
|
4014
|
+
this.trigger.addEventListener('click', () => {
|
|
4015
|
+
this.dispatchEvent(new CustomEvent('auroDropdown-triggerClick', {
|
|
4016
|
+
bubbles: true,
|
|
4017
|
+
composed: true
|
|
4018
|
+
}));
|
|
4019
|
+
});
|
|
3722
4020
|
}
|
|
3723
4021
|
|
|
3724
4022
|
/**
|
|
@@ -3762,70 +4060,33 @@ class AuroDropdown extends AuroElement {
|
|
|
3762
4060
|
}
|
|
3763
4061
|
|
|
3764
4062
|
/**
|
|
3765
|
-
* Function to support @focusout event.
|
|
3766
4063
|
* @private
|
|
3767
|
-
* @return {void}
|
|
3768
4064
|
*/
|
|
3769
|
-
|
|
3770
|
-
|
|
4065
|
+
updateFocusTrap() {
|
|
4066
|
+
// If the dropdown is open, create a focus trap and focus the first element
|
|
4067
|
+
if (this.isPopoverVisible && !this.disableFocusTrap) {
|
|
4068
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
4069
|
+
this.focusTrap.focusFirstElement();
|
|
4070
|
+
return;
|
|
4071
|
+
}
|
|
4072
|
+
|
|
4073
|
+
// Guard Clause: Ensure there is a focus trap currently active before continuing
|
|
4074
|
+
if (!this.focusTrap) {
|
|
4075
|
+
return;
|
|
4076
|
+
}
|
|
4077
|
+
|
|
4078
|
+
// If the dropdown is not open, disconnect the focus trap if it exists
|
|
4079
|
+
this.focusTrap.disconnect();
|
|
4080
|
+
this.focusTrap = undefined;
|
|
3771
4081
|
}
|
|
3772
4082
|
|
|
3773
4083
|
/**
|
|
3774
|
-
*
|
|
4084
|
+
* Function to support @focusout event.
|
|
3775
4085
|
* @private
|
|
3776
|
-
* @
|
|
3777
|
-
* @returns {Boolean} - True if the element or any children are focusable.
|
|
4086
|
+
* @return {void}
|
|
3778
4087
|
*/
|
|
3779
|
-
|
|
3780
|
-
this.
|
|
3781
|
-
|
|
3782
|
-
const nodes = [
|
|
3783
|
-
element,
|
|
3784
|
-
...element.children
|
|
3785
|
-
];
|
|
3786
|
-
|
|
3787
|
-
const focusableElements = [
|
|
3788
|
-
'a',
|
|
3789
|
-
'auro-hyperlink',
|
|
3790
|
-
'button',
|
|
3791
|
-
'auro-button',
|
|
3792
|
-
'input',
|
|
3793
|
-
'auro-input',
|
|
3794
|
-
];
|
|
3795
|
-
|
|
3796
|
-
const focusableElementsThatNeedBorders = ['auro-input'];
|
|
3797
|
-
|
|
3798
|
-
const result = nodes.some((node) => {
|
|
3799
|
-
const tagName = node.tagName.toLowerCase();
|
|
3800
|
-
|
|
3801
|
-
if (node.tabIndex > -1) {
|
|
3802
|
-
return true;
|
|
3803
|
-
}
|
|
3804
|
-
|
|
3805
|
-
if (focusableElements.includes(tagName)) {
|
|
3806
|
-
if ((tagName === 'a' || tagName === 'auro-hyperlink' || node.hasAttribute('auro-hyperlink')) && node.hasAttribute('href')) {
|
|
3807
|
-
return true;
|
|
3808
|
-
}
|
|
3809
|
-
if (!node.hasAttribute('disabled')) {
|
|
3810
|
-
return true;
|
|
3811
|
-
}
|
|
3812
|
-
}
|
|
3813
|
-
|
|
3814
|
-
if (focusableElements.some((focusableElement) => focusableElement.startsWith('auro-') && (focusableElement === tagName || node.hasAttribute(focusableElement)))) {
|
|
3815
|
-
return true;
|
|
3816
|
-
}
|
|
3817
|
-
|
|
3818
|
-
return false;
|
|
3819
|
-
});
|
|
3820
|
-
|
|
3821
|
-
if (result) {
|
|
3822
|
-
this.showTriggerBorders = !nodes.some((node) => {
|
|
3823
|
-
const tagName = node.tagName.toLowerCase();
|
|
3824
|
-
return focusableElements.includes(tagName) && !focusableElementsThatNeedBorders.includes(tagName);
|
|
3825
|
-
});
|
|
3826
|
-
}
|
|
3827
|
-
|
|
3828
|
-
return result;
|
|
4088
|
+
handleFocusout() {
|
|
4089
|
+
this.hasFocus = false;
|
|
3829
4090
|
}
|
|
3830
4091
|
|
|
3831
4092
|
/**
|
|
@@ -3921,14 +4182,13 @@ class AuroDropdown extends AuroElement {
|
|
|
3921
4182
|
* @returns {void}
|
|
3922
4183
|
*/
|
|
3923
4184
|
handleTriggerContentSlotChange(event) {
|
|
3924
|
-
|
|
3925
4185
|
this.floater.handleTriggerTabIndex();
|
|
3926
4186
|
|
|
3927
4187
|
// Get the trigger
|
|
3928
4188
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3929
4189
|
|
|
3930
4190
|
// Get the trigger slot
|
|
3931
|
-
const triggerSlot = this.shadowRoot.querySelector('.
|
|
4191
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContentWrapper slot');
|
|
3932
4192
|
|
|
3933
4193
|
// If there's a trigger slot
|
|
3934
4194
|
if (triggerSlot) {
|
|
@@ -3940,7 +4200,7 @@ class AuroDropdown extends AuroElement {
|
|
|
3940
4200
|
if (triggerContentNodes) {
|
|
3941
4201
|
|
|
3942
4202
|
// See if any of them are focusable elements
|
|
3943
|
-
this.triggerContentFocusable = triggerContentNodes.some((node) =>
|
|
4203
|
+
this.triggerContentFocusable = triggerContentNodes.some((node) => getFocusableElements(node).length > 0);
|
|
3944
4204
|
|
|
3945
4205
|
// If any of them are focusable elements
|
|
3946
4206
|
if (this.triggerContentFocusable) {
|
|
@@ -4000,29 +4260,6 @@ class AuroDropdown extends AuroElement {
|
|
|
4000
4260
|
}
|
|
4001
4261
|
}
|
|
4002
4262
|
|
|
4003
|
-
/**
|
|
4004
|
-
* @private
|
|
4005
|
-
* @method handleLabelSlotChange
|
|
4006
|
-
* @param {event} event - The event object representing the slot change.
|
|
4007
|
-
* @description Handles the slot change event for the label slot.
|
|
4008
|
-
*/
|
|
4009
|
-
handleLabelSlotChange (event) {
|
|
4010
|
-
|
|
4011
|
-
// Get the nodes from the event
|
|
4012
|
-
const nodes = event.target.assignedNodes();
|
|
4013
|
-
|
|
4014
|
-
// Guard clause for no nodes
|
|
4015
|
-
if (!nodes) {
|
|
4016
|
-
return;
|
|
4017
|
-
}
|
|
4018
|
-
|
|
4019
|
-
// Convert the nodes to a measurable array so we can get the length
|
|
4020
|
-
const nodesArr = Array.from(nodes);
|
|
4021
|
-
|
|
4022
|
-
// If the nodes array has a length, the dropdown is labeled
|
|
4023
|
-
this.labeled = nodesArr.length > 0;
|
|
4024
|
-
}
|
|
4025
|
-
|
|
4026
4263
|
/**
|
|
4027
4264
|
* Returns HTML for the common portion of the layouts.
|
|
4028
4265
|
* @private
|
|
@@ -4035,24 +4272,19 @@ class AuroDropdown extends AuroElement {
|
|
|
4035
4272
|
<div
|
|
4036
4273
|
id="trigger"
|
|
4037
4274
|
class="${e$2(this.commonWrapperClasses)}" part="wrapper"
|
|
4038
|
-
tabindex="${this.tabIndex}"
|
|
4275
|
+
tabindex="${o(this.triggerContentFocusable ? undefined : this.tabIndex)}"
|
|
4039
4276
|
role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
4040
|
-
aria-expanded="${o(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4041
|
-
aria-controls="${o(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4277
|
+
aria-expanded="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4278
|
+
aria-controls="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4042
4279
|
aria-labelledby="${o(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
4043
4280
|
@focusin="${this.handleFocusin}"
|
|
4044
4281
|
@blur="${this.handleFocusOut}">
|
|
4045
|
-
<div class="triggerContentWrapper">
|
|
4046
|
-
<
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
<div class="triggerContent">
|
|
4050
|
-
<slot
|
|
4051
|
-
name="trigger"
|
|
4052
|
-
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4053
|
-
</div>
|
|
4282
|
+
<div class="triggerContentWrapper" id="triggerLabel">
|
|
4283
|
+
<slot
|
|
4284
|
+
name="trigger"
|
|
4285
|
+
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4054
4286
|
</div>
|
|
4055
|
-
${this.chevron
|
|
4287
|
+
${this.chevron ? u$1`
|
|
4056
4288
|
<div
|
|
4057
4289
|
id="showStateIcon"
|
|
4058
4290
|
class="chevron"
|
|
@@ -4073,11 +4305,9 @@ class AuroDropdown extends AuroElement {
|
|
|
4073
4305
|
<div id="bibSizer" part="size"></div>
|
|
4074
4306
|
<${this.dropdownBibTag}
|
|
4075
4307
|
id="bib"
|
|
4308
|
+
shape="${this.shape}"
|
|
4076
4309
|
?data-show="${this.isPopoverVisible}"
|
|
4077
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
4078
|
-
?common="${this.common}"
|
|
4079
|
-
?rounded="${this.common || this.rounded}"
|
|
4080
|
-
?inset="${this.common || this.inset}">
|
|
4310
|
+
?isfullscreen="${this.isBibFullscreen}">
|
|
4081
4311
|
<div class="slotContent">
|
|
4082
4312
|
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4083
4313
|
</div>
|
|
@@ -4092,62 +4322,13 @@ class AuroDropdown extends AuroElement {
|
|
|
4092
4322
|
* @returns {html} - Returns HTML for the classic layout.
|
|
4093
4323
|
*/
|
|
4094
4324
|
renderLayoutClassic() {
|
|
4325
|
+
// TODO: check with Doug why this was never used?
|
|
4326
|
+
const helpTextClasses = {
|
|
4327
|
+
'helpText': true
|
|
4328
|
+
};
|
|
4095
4329
|
|
|
4096
4330
|
return u$1`
|
|
4097
|
-
|
|
4098
|
-
<div
|
|
4099
|
-
id="trigger"
|
|
4100
|
-
class="trigger"
|
|
4101
|
-
part="trigger"
|
|
4102
|
-
tabindex="${this.tabIndex}"
|
|
4103
|
-
?showBorder="${this.showTriggerBorders}"
|
|
4104
|
-
role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
4105
|
-
aria-expanded="${o(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4106
|
-
aria-controls="${o(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4107
|
-
aria-labelledby="${o(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
4108
|
-
>
|
|
4109
|
-
<div class="triggerContentWrapper">
|
|
4110
|
-
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
4111
|
-
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
4112
|
-
</label>
|
|
4113
|
-
<div class="triggerContent">
|
|
4114
|
-
<slot
|
|
4115
|
-
name="trigger"
|
|
4116
|
-
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4117
|
-
</div>
|
|
4118
|
-
</div>
|
|
4119
|
-
${this.chevron || this.common ? u$1`
|
|
4120
|
-
<div
|
|
4121
|
-
id="showStateIcon"
|
|
4122
|
-
part="chevron">
|
|
4123
|
-
<${this.iconTag}
|
|
4124
|
-
category="interface"
|
|
4125
|
-
name="chevron-down"
|
|
4126
|
-
?onDark="${this.onDark}"
|
|
4127
|
-
variant="${this.disabled ? 'disabled' : 'muted'}">
|
|
4128
|
-
>
|
|
4129
|
-
</${this.iconTag}>
|
|
4130
|
-
</div>
|
|
4131
|
-
` : undefined }
|
|
4132
|
-
</div>
|
|
4133
|
-
<${this.helpTextTag} part="helpText" ?onDark=${this.onDark} ?error="${this.error}">
|
|
4134
|
-
<slot name="helpText"></slot>
|
|
4135
|
-
</${this.helpTextTag}>
|
|
4136
|
-
|
|
4137
|
-
<div id="bibSizer" part="size"></div>
|
|
4138
|
-
<${this.dropdownBibTag}
|
|
4139
|
-
id="bib"
|
|
4140
|
-
?data-show="${this.isPopoverVisible}"
|
|
4141
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
4142
|
-
?common="${this.common}"
|
|
4143
|
-
?rounded="${this.common || this.rounded}"
|
|
4144
|
-
?inset="${this.common || this.inset}"
|
|
4145
|
-
>
|
|
4146
|
-
<div class="slotContent">
|
|
4147
|
-
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4148
|
-
</div>
|
|
4149
|
-
</${this.dropdownBibTag}>
|
|
4150
|
-
</div>
|
|
4331
|
+
${this.renderBasicHtml(helpTextClasses)}
|
|
4151
4332
|
`;
|
|
4152
4333
|
}
|
|
4153
4334
|
|