@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.6 → 0.0.0-pr624.60
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/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +1214 -83
- package/components/bibtemplate/dist/registered.js +1214 -83
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/api.html +16 -10
- package/components/checkbox/demo/api.md +47 -14
- package/components/checkbox/demo/api.min.js +49 -37
- package/components/checkbox/demo/index.html +16 -10
- package/components/checkbox/demo/index.md +2 -2
- package/components/checkbox/demo/index.min.js +49 -37
- 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 +3 -3
- package/components/checkbox/dist/index.js +49 -37
- package/components/checkbox/dist/registered.js +49 -37
- package/components/combobox/demo/api.html +16 -10
- package/components/combobox/demo/api.md +112 -8
- package/components/combobox/demo/api.min.js +2941 -851
- package/components/combobox/demo/index.html +16 -10
- package/components/combobox/demo/index.md +6 -30
- package/components/combobox/demo/index.min.js +2941 -851
- package/components/combobox/demo/readme.html +16 -9
- package/components/combobox/dist/auro-combobox.d.ts +37 -8
- package/components/combobox/dist/index.js +2730 -736
- package/components/combobox/dist/registered.js +2730 -736
- package/components/counter/demo/api.html +17 -10
- package/components/counter/demo/api.md +156 -21
- package/components/counter/demo/api.min.js +6696 -4097
- package/components/counter/demo/index.html +17 -10
- package/components/counter/demo/index.md +185 -34
- package/components/counter/demo/index.min.js +6696 -4097
- 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 +151 -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 +6696 -4097
- package/components/counter/dist/registered.js +6696 -4097
- package/components/datepicker/demo/api.html +16 -10
- package/components/datepicker/demo/api.md +24 -16
- package/components/datepicker/demo/api.min.js +11749 -8230
- package/components/datepicker/demo/index.html +16 -10
- package/components/datepicker/demo/index.md +71 -4
- package/components/datepicker/demo/index.min.js +11749 -8230
- package/components/datepicker/demo/readme.html +16 -9
- package/components/datepicker/dist/auro-datepicker.d.ts +84 -11
- package/components/datepicker/dist/buttonVersion.d.ts +1 -1
- package/components/datepicker/dist/iconVersion.d.ts +2 -0
- package/components/datepicker/dist/index.js +6531 -3012
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +6531 -3012
- package/components/dropdown/demo/api.html +16 -10
- package/components/dropdown/demo/api.md +81 -274
- package/components/dropdown/demo/api.min.js +429 -195
- package/components/dropdown/demo/index.html +16 -10
- package/components/dropdown/demo/index.md +92 -362
- package/components/dropdown/demo/index.min.js +429 -195
- package/components/dropdown/demo/readme.html +16 -9
- package/components/dropdown/dist/auro-dropdown.d.ts +41 -76
- package/components/dropdown/dist/auro-dropdownBib.d.ts +14 -0
- package/components/dropdown/dist/index.js +429 -195
- package/components/dropdown/dist/registered.js +429 -195
- package/components/form/demo/api.html +16 -9
- package/components/form/demo/api.min.js +1 -1
- package/components/form/demo/autocomplete.html +19 -3
- package/components/form/demo/index.html +16 -9
- package/components/form/demo/index.min.js +1 -1
- package/components/form/demo/readme.html +16 -9
- package/components/form/demo/working.html +19 -13
- package/components/form/dist/index.js +1 -1
- package/components/form/dist/registered.js +1 -1
- package/components/helptext/dist/index.js +2 -2
- package/components/helptext/dist/registered.js +2 -2
- package/components/input/README.md +5 -2
- package/components/input/demo/api.html +16 -10
- package/components/input/demo/api.md +226 -129
- package/components/input/demo/api.min.js +828 -234
- package/components/input/demo/index.html +16 -10
- package/components/input/demo/index.md +48 -32
- package/components/input/demo/index.min.js +828 -234
- package/components/input/demo/readme.html +16 -9
- package/components/input/demo/readme.md +5 -2
- package/components/input/dist/auro-input.d.ts +3 -3
- package/components/input/dist/base-input.d.ts +33 -9
- package/components/input/dist/buttonVersion.d.ts +1 -1
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +828 -234
- package/components/input/dist/registered.js +828 -234
- package/components/layoutElement/dist/index.js +13 -10
- package/components/menu/demo/api.html +32 -10
- package/components/menu/demo/api.md +69 -8
- package/components/menu/demo/api.min.js +238 -47
- package/components/menu/demo/index.html +16 -10
- package/components/menu/demo/index.min.js +238 -47
- package/components/menu/demo/readme.html +16 -9
- package/components/menu/dist/auro-menu.d.ts +41 -7
- package/components/menu/dist/auro-menuoption.d.ts +15 -3
- package/components/menu/dist/iconVersion.d.ts +1 -1
- package/components/menu/dist/index.js +238 -47
- package/components/menu/dist/registered.js +238 -47
- package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
- 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 +7 -8
- package/components/radio/demo/api.min.js +72 -85
- package/components/radio/demo/index.html +16 -10
- package/components/radio/demo/index.min.js +72 -85
- 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 +9 -12
- package/components/radio/dist/index.js +72 -85
- package/components/radio/dist/registered.js +72 -85
- package/components/select/demo/api.html +16 -10
- package/components/select/demo/api.js +0 -2
- package/components/select/demo/api.md +104 -57
- package/components/select/demo/api.min.js +2107 -639
- package/components/select/demo/index.html +16 -11
- package/components/select/demo/index.md +45 -158
- package/components/select/demo/index.min.js +2104 -624
- package/components/select/demo/readme.html +16 -9
- package/components/select/dist/auro-select.d.ts +57 -16
- package/components/select/dist/index.js +2028 -644
- package/components/select/dist/registered.js +2028 -644
- package/package.json +29 -26
- /package/components/{datepicker/dist/styles/emphasized/style-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/{dropdown/dist/styles/default → datepicker/dist/styles/snowflake}/color-css.d.ts +0 -0
- /package/components/{dropdown/dist/styles/default → datepicker/dist/styles/snowflake}/style-css.d.ts +0 -0
- /package/components/dropdown/dist/styles/{default → classic}/bibColors-css.d.ts +0 -0
- /package/components/dropdown/dist/styles/{default → classic}/bibStyles-css.d.ts +0 -0
- /package/components/{menu/dist/styles/color-menu-css.d.ts → dropdown/dist/styles/classic/color-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/color-menuoption-css.d.ts → dropdown/dist/styles/classic/style-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{style-menu-css.d.ts → default/color-menu-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{style-menuoption-css.d.ts → default/color-menuoption-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{tokens-css.d.ts → default/style-menu-css.d.ts} +0 -0
|
@@ -90,17 +90,6 @@ function auroMenuLoadingExample() {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
function valueTextExample() {
|
|
94
|
-
const onValueTextSelectInput = (e) => {
|
|
95
|
-
const valueText = e.target.querySelector("[slot=valueText]");
|
|
96
|
-
|
|
97
|
-
valueText.textContent = e.detail.optionSelected.dataset.display;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const select = document.querySelector("#valueTextExample");
|
|
101
|
-
select.addEventListener('input', onValueTextSelectInput);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
93
|
/**
|
|
105
94
|
* @license
|
|
106
95
|
* Copyright 2019 Google LLC
|
|
@@ -147,7 +136,7 @@ const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});let i$1 = cl
|
|
|
147
136
|
*/
|
|
148
137
|
const a=Symbol.for(""),o$1=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litStatic$:t,r:a}),i=(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=n(x);
|
|
149
138
|
|
|
150
|
-
let AuroElement$
|
|
139
|
+
let AuroElement$4 = class AuroElement extends i$2 {
|
|
151
140
|
static get properties() {
|
|
152
141
|
return {
|
|
153
142
|
|
|
@@ -182,18 +171,21 @@ let AuroElement$3 = class AuroElement extends i$2 {
|
|
|
182
171
|
}
|
|
183
172
|
|
|
184
173
|
resetShapeClasses() {
|
|
185
|
-
|
|
186
|
-
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
174
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
187
175
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
176
|
+
if (wrapper) {
|
|
177
|
+
wrapper.classList.forEach((className) => {
|
|
178
|
+
if (className.startsWith('shape-')) {
|
|
179
|
+
wrapper.classList.remove(className);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
194
182
|
|
|
195
|
-
|
|
196
|
-
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (this.shape && this.size) {
|
|
186
|
+
wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
187
|
+
} else {
|
|
188
|
+
wrapper.classList.add('shape-none');
|
|
197
189
|
}
|
|
198
190
|
}
|
|
199
191
|
|
|
@@ -239,9 +231,9 @@ let AuroElement$3 = class AuroElement extends i$2 {
|
|
|
239
231
|
}
|
|
240
232
|
};
|
|
241
233
|
|
|
242
|
-
var shapeSizeCss$1 = i$5`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:58px;max-height:58px;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:60px;max-height:60px;background-color:unset}.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:58px;max-height:58px;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;min-height:56px;max-height:56px}.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}.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;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}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;min-height:68px;max-height:68px}.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}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;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}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:
|
|
234
|
+
var shapeSizeCss$1 = i$5`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:58px;max-height:58px;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:60px;max-height:60px;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:58px;max-height:58px;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:56px;max-height:56px}.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-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}`;
|
|
243
235
|
|
|
244
|
-
var tokensCss$5 = i$5`:host(:not([ondark])){--ds-auro-select-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-select-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-select-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-select-placeholder-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-select-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-select-error-icon-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-select-outline-color: transparent}:host([ondark]){--ds-auro-select-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-select-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-select-label-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-placeholder-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-error-icon-color: var(--ds-
|
|
236
|
+
var tokensCss$5 = i$5`:host(:not([ondark])){--ds-auro-select-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-select-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-select-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-select-placeholder-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-select-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-select-error-icon-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-select-outline-color: transparent}:host([ondark]){--ds-auro-select-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-select-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-select-label-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-placeholder-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-error-icon-color: var(--ds-basic-color-status-error-subtle, #fbc6c6);--ds-auro-select-outline-color: transparent}`;
|
|
245
237
|
|
|
246
238
|
class DateFormatter {
|
|
247
239
|
|
|
@@ -659,7 +651,7 @@ const {
|
|
|
659
651
|
|
|
660
652
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
661
653
|
|
|
662
|
-
let AuroLibraryRuntimeUtils$
|
|
654
|
+
let AuroLibraryRuntimeUtils$6 = class AuroLibraryRuntimeUtils {
|
|
663
655
|
|
|
664
656
|
/* eslint-disable jsdoc/require-param */
|
|
665
657
|
|
|
@@ -729,7 +721,7 @@ let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
|
729
721
|
class AuroFormValidation {
|
|
730
722
|
|
|
731
723
|
constructor() {
|
|
732
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
724
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
733
725
|
}
|
|
734
726
|
|
|
735
727
|
/**
|
|
@@ -789,19 +781,19 @@ class AuroFormValidation {
|
|
|
789
781
|
{
|
|
790
782
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
791
783
|
validity: 'tooShort',
|
|
792
|
-
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
784
|
+
message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
|
|
793
785
|
},
|
|
794
786
|
{
|
|
795
787
|
check: (e) => e.value?.length > e.maxLength,
|
|
796
788
|
validity: 'tooLong',
|
|
797
|
-
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
789
|
+
message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
|
|
798
790
|
}
|
|
799
791
|
],
|
|
800
792
|
pattern: [
|
|
801
793
|
{
|
|
802
794
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
803
795
|
validity: 'patternMismatch',
|
|
804
|
-
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
796
|
+
message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
|
|
805
797
|
}
|
|
806
798
|
]
|
|
807
799
|
},
|
|
@@ -996,10 +988,10 @@ class AuroFormValidation {
|
|
|
996
988
|
if (!hasValue && elem.required && elem.touched) {
|
|
997
989
|
elem.validity = 'valueMissing';
|
|
998
990
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
999
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
991
|
+
} else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
1000
992
|
this.validateType(elem);
|
|
1001
993
|
this.validateElementAttributes(elem);
|
|
1002
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
994
|
+
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
1003
995
|
this.validateElementAttributes(elem);
|
|
1004
996
|
}
|
|
1005
997
|
}
|
|
@@ -1008,7 +1000,9 @@ class AuroFormValidation {
|
|
|
1008
1000
|
elem.validity = this.auroInputElements[0].validity;
|
|
1009
1001
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
1010
1002
|
|
|
1011
|
-
|
|
1003
|
+
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1004
|
+
// combobox's 2nd input will have noValidate set true.
|
|
1005
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !this.auroInputElements[1].noValidate) {
|
|
1012
1006
|
elem.validity = this.auroInputElements[1].validity;
|
|
1013
1007
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
1014
1008
|
}
|
|
@@ -2820,7 +2814,7 @@ class AuroFloatingUI {
|
|
|
2820
2814
|
*/
|
|
2821
2815
|
mirrorSize() {
|
|
2822
2816
|
// mirror the boxsize from bibSizer
|
|
2823
|
-
if (this.element.bibSizer) {
|
|
2817
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
2824
2818
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2825
2819
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2826
2820
|
if (sizerStyle.width !== '0px') {
|
|
@@ -3032,13 +3026,13 @@ class AuroFloatingUI {
|
|
|
3032
3026
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
3033
3027
|
return;
|
|
3034
3028
|
}
|
|
3035
|
-
|
|
3029
|
+
|
|
3036
3030
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
3037
3031
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
3038
3032
|
return;
|
|
3039
3033
|
}
|
|
3040
3034
|
|
|
3041
|
-
this.hideBib();
|
|
3035
|
+
this.hideBib("keydown");
|
|
3042
3036
|
}
|
|
3043
3037
|
|
|
3044
3038
|
setupHideHandlers() {
|
|
@@ -3063,7 +3057,7 @@ class AuroFloatingUI {
|
|
|
3063
3057
|
document.expandedAuroFormkitDropdown = null;
|
|
3064
3058
|
document.expandedAuroFloater = this;
|
|
3065
3059
|
} else {
|
|
3066
|
-
this.hideBib();
|
|
3060
|
+
this.hideBib("click");
|
|
3067
3061
|
}
|
|
3068
3062
|
}
|
|
3069
3063
|
};
|
|
@@ -3076,7 +3070,7 @@ class AuroFloatingUI {
|
|
|
3076
3070
|
// if something else is open, let it handle itself
|
|
3077
3071
|
return;
|
|
3078
3072
|
}
|
|
3079
|
-
this.hideBib();
|
|
3073
|
+
this.hideBib("keydown");
|
|
3080
3074
|
}
|
|
3081
3075
|
};
|
|
3082
3076
|
|
|
@@ -3159,7 +3153,11 @@ class AuroFloatingUI {
|
|
|
3159
3153
|
}
|
|
3160
3154
|
}
|
|
3161
3155
|
|
|
3162
|
-
|
|
3156
|
+
/**
|
|
3157
|
+
* Hides the floating UI element.
|
|
3158
|
+
* @param {String} eventType - The event type that triggered the hiding action.
|
|
3159
|
+
*/
|
|
3160
|
+
hideBib(eventType = "unknown") {
|
|
3163
3161
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
3164
3162
|
this.lockScroll(false);
|
|
3165
3163
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -3170,7 +3168,7 @@ class AuroFloatingUI {
|
|
|
3170
3168
|
if (this.showing) {
|
|
3171
3169
|
this.cleanupHideHandlers();
|
|
3172
3170
|
this.showing = false;
|
|
3173
|
-
this.dispatchEventDropdownToggle();
|
|
3171
|
+
this.dispatchEventDropdownToggle(eventType);
|
|
3174
3172
|
}
|
|
3175
3173
|
}
|
|
3176
3174
|
document.expandedAuroFloater = null;
|
|
@@ -3179,11 +3177,13 @@ class AuroFloatingUI {
|
|
|
3179
3177
|
/**
|
|
3180
3178
|
* @private
|
|
3181
3179
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
3180
|
+
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3182
3181
|
*/
|
|
3183
|
-
dispatchEventDropdownToggle() {
|
|
3182
|
+
dispatchEventDropdownToggle(eventType) {
|
|
3184
3183
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
3185
3184
|
detail: {
|
|
3186
3185
|
expanded: this.showing,
|
|
3186
|
+
eventType: eventType || "unknown",
|
|
3187
3187
|
},
|
|
3188
3188
|
composed: true
|
|
3189
3189
|
});
|
|
@@ -3193,7 +3193,7 @@ class AuroFloatingUI {
|
|
|
3193
3193
|
|
|
3194
3194
|
handleClick() {
|
|
3195
3195
|
if (this.element.isPopoverVisible) {
|
|
3196
|
-
this.hideBib();
|
|
3196
|
+
this.hideBib("click");
|
|
3197
3197
|
} else {
|
|
3198
3198
|
this.showBib();
|
|
3199
3199
|
}
|
|
@@ -3216,8 +3216,9 @@ class AuroFloatingUI {
|
|
|
3216
3216
|
// Space is included as it's expected behavior for interactive elements
|
|
3217
3217
|
|
|
3218
3218
|
const origin = event.composedPath()[0];
|
|
3219
|
-
if (event.key === 'Enter' || (
|
|
3220
|
-
|
|
3219
|
+
if (event.key === 'Enter' || event.key === ' ' && (!origin || origin.tagName !== "INPUT")) {
|
|
3220
|
+
|
|
3221
|
+
event.preventDefault();
|
|
3221
3222
|
this.handleClick();
|
|
3222
3223
|
}
|
|
3223
3224
|
break;
|
|
@@ -3228,7 +3229,7 @@ class AuroFloatingUI {
|
|
|
3228
3229
|
break;
|
|
3229
3230
|
case 'mouseleave':
|
|
3230
3231
|
if (this.element.hoverToggle) {
|
|
3231
|
-
this.hideBib();
|
|
3232
|
+
this.hideBib("mouseleave");
|
|
3232
3233
|
}
|
|
3233
3234
|
break;
|
|
3234
3235
|
case 'focus':
|
|
@@ -3371,6 +3372,267 @@ class AuroFloatingUI {
|
|
|
3371
3372
|
}
|
|
3372
3373
|
}
|
|
3373
3374
|
|
|
3375
|
+
// Selectors for focusable elements
|
|
3376
|
+
const FOCUSABLE_SELECTORS = [
|
|
3377
|
+
'a[href]',
|
|
3378
|
+
'button:not([disabled])',
|
|
3379
|
+
'textarea:not([disabled])',
|
|
3380
|
+
'input:not([disabled])',
|
|
3381
|
+
'select:not([disabled])',
|
|
3382
|
+
'[role="tab"]:not([disabled])',
|
|
3383
|
+
'[role="link"]:not([disabled])',
|
|
3384
|
+
'[role="button"]:not([disabled])',
|
|
3385
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
3386
|
+
'[contenteditable]:not([contenteditable="false"])'
|
|
3387
|
+
];
|
|
3388
|
+
|
|
3389
|
+
// List of custom components that are known to be focusable
|
|
3390
|
+
const FOCUSABLE_COMPONENTS = [
|
|
3391
|
+
'auro-checkbox',
|
|
3392
|
+
'auro-radio',
|
|
3393
|
+
'auro-dropdown',
|
|
3394
|
+
'auro-button',
|
|
3395
|
+
'auro-combobox',
|
|
3396
|
+
'auro-input',
|
|
3397
|
+
'auro-counter',
|
|
3398
|
+
'auro-menu',
|
|
3399
|
+
'auro-select',
|
|
3400
|
+
'auro-datepicker',
|
|
3401
|
+
'auro-hyperlink',
|
|
3402
|
+
'auro-accordion',
|
|
3403
|
+
];
|
|
3404
|
+
|
|
3405
|
+
/**
|
|
3406
|
+
* Determines if a given element is a custom focusable component.
|
|
3407
|
+
* Returns true if the element matches a known focusable component and is not disabled.
|
|
3408
|
+
*
|
|
3409
|
+
* @param {HTMLElement} element The element to check for focusability.
|
|
3410
|
+
* @returns {boolean} True if the element is a focusable custom component, false otherwise.
|
|
3411
|
+
*/
|
|
3412
|
+
function isFocusableComponent(element) {
|
|
3413
|
+
const componentName = element.tagName.toLowerCase();
|
|
3414
|
+
|
|
3415
|
+
// Guard Clause: Element is a focusable component
|
|
3416
|
+
if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
|
|
3417
|
+
|
|
3418
|
+
// Guard Clause: Element is not disabled
|
|
3419
|
+
if (element.hasAttribute('disabled')) return false;
|
|
3420
|
+
|
|
3421
|
+
// Guard Clause: The element is a hyperlink and has no href attribute
|
|
3422
|
+
if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
|
|
3423
|
+
|
|
3424
|
+
// If all guard clauses pass, the element is a focusable component
|
|
3425
|
+
return true;
|
|
3426
|
+
}
|
|
3427
|
+
|
|
3428
|
+
/**
|
|
3429
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
3430
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
3431
|
+
*
|
|
3432
|
+
* @param {HTMLElement} container The container to search within
|
|
3433
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
3434
|
+
*/
|
|
3435
|
+
function getFocusableElements(container) {
|
|
3436
|
+
// Get elements in DOM order by walking the tree
|
|
3437
|
+
const orderedFocusableElements = [];
|
|
3438
|
+
|
|
3439
|
+
// Define a recursive function to collect focusable elements in DOM order
|
|
3440
|
+
const collectFocusableElements = (root) => {
|
|
3441
|
+
// Check if current element is focusable
|
|
3442
|
+
if (root.nodeType === Node.ELEMENT_NODE) {
|
|
3443
|
+
// Check if this is a custom component that is focusable
|
|
3444
|
+
const isComponentFocusable = isFocusableComponent(root);
|
|
3445
|
+
|
|
3446
|
+
if (isComponentFocusable) {
|
|
3447
|
+
// Add the component itself as a focusable element and don't traverse its shadow DOM
|
|
3448
|
+
orderedFocusableElements.push(root);
|
|
3449
|
+
return; // Skip traversing inside this component
|
|
3450
|
+
}
|
|
3451
|
+
|
|
3452
|
+
// Check if the element itself matches any selector
|
|
3453
|
+
for (const selector of FOCUSABLE_SELECTORS) {
|
|
3454
|
+
if (root.matches?.(selector)) {
|
|
3455
|
+
orderedFocusableElements.push(root);
|
|
3456
|
+
break; // Once we know it's focusable, no need to check other selectors
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
|
|
3460
|
+
// Process shadow DOM only for non-Auro components
|
|
3461
|
+
if (root.shadowRoot) {
|
|
3462
|
+
// Process shadow DOM children in order
|
|
3463
|
+
if (root.shadowRoot.children) {
|
|
3464
|
+
Array.from(root.shadowRoot.children).forEach(child => {
|
|
3465
|
+
collectFocusableElements(child);
|
|
3466
|
+
});
|
|
3467
|
+
}
|
|
3468
|
+
}
|
|
3469
|
+
|
|
3470
|
+
// Process slots and their assigned nodes in order
|
|
3471
|
+
if (root.tagName === 'SLOT') {
|
|
3472
|
+
const assignedNodes = root.assignedNodes({ flatten: true });
|
|
3473
|
+
for (const node of assignedNodes) {
|
|
3474
|
+
collectFocusableElements(node);
|
|
3475
|
+
}
|
|
3476
|
+
} else {
|
|
3477
|
+
// Process light DOM children in order
|
|
3478
|
+
if (root.children) {
|
|
3479
|
+
Array.from(root.children).forEach(child => {
|
|
3480
|
+
collectFocusableElements(child);
|
|
3481
|
+
});
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
};
|
|
3486
|
+
|
|
3487
|
+
// Start the traversal from the container
|
|
3488
|
+
collectFocusableElements(container);
|
|
3489
|
+
|
|
3490
|
+
// Remove duplicates that might have been collected through different paths
|
|
3491
|
+
// while preserving order
|
|
3492
|
+
const uniqueElements = [];
|
|
3493
|
+
const seen = new Set();
|
|
3494
|
+
|
|
3495
|
+
for (const element of orderedFocusableElements) {
|
|
3496
|
+
if (!seen.has(element)) {
|
|
3497
|
+
seen.add(element);
|
|
3498
|
+
uniqueElements.push(element);
|
|
3499
|
+
}
|
|
3500
|
+
}
|
|
3501
|
+
|
|
3502
|
+
return uniqueElements;
|
|
3503
|
+
}
|
|
3504
|
+
|
|
3505
|
+
/**
|
|
3506
|
+
* FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
|
|
3507
|
+
* It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
|
|
3508
|
+
*/
|
|
3509
|
+
class FocusTrap {
|
|
3510
|
+
/**
|
|
3511
|
+
* Creates a new FocusTrap instance for the given container element.
|
|
3512
|
+
* Initializes event listeners and prepares the container for focus management.
|
|
3513
|
+
*
|
|
3514
|
+
* @param {HTMLElement} container The DOM element to trap focus within.
|
|
3515
|
+
* @throws {Error} If the provided container is not a valid HTMLElement.
|
|
3516
|
+
*/
|
|
3517
|
+
constructor(container) {
|
|
3518
|
+
if (!container || !(container instanceof HTMLElement)) {
|
|
3519
|
+
throw new Error("FocusTrap requires a valid HTMLElement.");
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
this.container = container;
|
|
3523
|
+
this.tabDirection = 'forward'; // or 'backward'
|
|
3524
|
+
|
|
3525
|
+
this._init();
|
|
3526
|
+
}
|
|
3527
|
+
|
|
3528
|
+
/**
|
|
3529
|
+
* Initializes the focus trap by setting up event listeners and attributes on the container.
|
|
3530
|
+
* Prepares the container for focus management, including support for shadow DOM and inert attributes.
|
|
3531
|
+
*
|
|
3532
|
+
* @private
|
|
3533
|
+
*/
|
|
3534
|
+
_init() {
|
|
3535
|
+
|
|
3536
|
+
// Add inert attribute to prevent focusing programmatically as well (if supported)
|
|
3537
|
+
if ('inert' in HTMLElement.prototype) {
|
|
3538
|
+
this.container.inert = false; // Ensure the container isn't inert
|
|
3539
|
+
this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3542
|
+
// Track tab direction
|
|
3543
|
+
this.container.addEventListener('keydown', this._onKeydown);
|
|
3544
|
+
}
|
|
3545
|
+
|
|
3546
|
+
/**
|
|
3547
|
+
* Handles keydown events to manage tab navigation within the container.
|
|
3548
|
+
* Ensures that focus wraps around when reaching the first or last focusable element.
|
|
3549
|
+
*
|
|
3550
|
+
* @param {KeyboardEvent} e The keyboard event triggered by user interaction.
|
|
3551
|
+
* @private
|
|
3552
|
+
*/
|
|
3553
|
+
_onKeydown = (e) => {
|
|
3554
|
+
|
|
3555
|
+
if (e.key === 'Tab') {
|
|
3556
|
+
|
|
3557
|
+
// Set the tab direction based on the key pressed
|
|
3558
|
+
this.tabDirection = e.shiftKey ? 'backward' : 'forward';
|
|
3559
|
+
|
|
3560
|
+
// Get the active element(s) in the document and shadow root
|
|
3561
|
+
// This will include the active element in the shadow DOM if it exists
|
|
3562
|
+
// Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
|
|
3563
|
+
let activeElement = document.activeElement;
|
|
3564
|
+
const actives = [activeElement];
|
|
3565
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
3566
|
+
actives.push(activeElement.shadowRoot.activeElement);
|
|
3567
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
3568
|
+
}
|
|
3569
|
+
|
|
3570
|
+
// Update the focusable elements
|
|
3571
|
+
const focusables = this._getFocusableElements();
|
|
3572
|
+
|
|
3573
|
+
// If we're at either end of the focusable elements, wrap around to the other end
|
|
3574
|
+
const focusIndex =
|
|
3575
|
+
(actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
|
|
3576
|
+
? focusables.length - 1
|
|
3577
|
+
: actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
|
|
3578
|
+
? 0
|
|
3579
|
+
: null;
|
|
3580
|
+
|
|
3581
|
+
if (focusIndex !== null) {
|
|
3582
|
+
focusables[focusIndex].focus();
|
|
3583
|
+
e.preventDefault(); // Prevent default tab behavior
|
|
3584
|
+
e.stopPropagation(); // Stop the event from bubbling up
|
|
3585
|
+
}
|
|
3586
|
+
}
|
|
3587
|
+
};
|
|
3588
|
+
|
|
3589
|
+
/**
|
|
3590
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
3591
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
3592
|
+
*
|
|
3593
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
3594
|
+
* @private
|
|
3595
|
+
*/
|
|
3596
|
+
_getFocusableElements() {
|
|
3597
|
+
// Use the imported utility function to get focusable elements
|
|
3598
|
+
const elements = getFocusableElements(this.container);
|
|
3599
|
+
|
|
3600
|
+
// Filter out any elements with the 'focus-bookend' class
|
|
3601
|
+
return elements;
|
|
3602
|
+
}
|
|
3603
|
+
|
|
3604
|
+
/**
|
|
3605
|
+
* Moves focus to the first focusable element within the container.
|
|
3606
|
+
* Useful for setting initial focus when activating the focus trap.
|
|
3607
|
+
*/
|
|
3608
|
+
focusFirstElement() {
|
|
3609
|
+
const focusables = this._getFocusableElements();
|
|
3610
|
+
if (focusables.length) focusables[0].focus();
|
|
3611
|
+
}
|
|
3612
|
+
|
|
3613
|
+
/**
|
|
3614
|
+
* Moves focus to the last focusable element within the container.
|
|
3615
|
+
* Useful for setting focus when deactivating or cycling focus in reverse.
|
|
3616
|
+
*/
|
|
3617
|
+
focusLastElement() {
|
|
3618
|
+
const focusables = this._getFocusableElements();
|
|
3619
|
+
if (focusables.length) focusables[focusables.length - 1].focus();
|
|
3620
|
+
}
|
|
3621
|
+
|
|
3622
|
+
/**
|
|
3623
|
+
* Removes event listeners and attributes added by the focus trap.
|
|
3624
|
+
* Call this method to clean up when the focus trap is no longer needed.
|
|
3625
|
+
*/
|
|
3626
|
+
disconnect() {
|
|
3627
|
+
|
|
3628
|
+
if (this.container.hasAttribute('data-focus-trap-container')) {
|
|
3629
|
+
this.container.removeAttribute('data-focus-trap-container');
|
|
3630
|
+
}
|
|
3631
|
+
|
|
3632
|
+
this.container.removeEventListener('keydown', this._onKeydown);
|
|
3633
|
+
}
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3374
3636
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3375
3637
|
// See LICENSE in the project root for license information.
|
|
3376
3638
|
|
|
@@ -3561,9 +3823,9 @@ let BaseIcon$2 = class BaseIcon extends AuroElement$1$1 {
|
|
|
3561
3823
|
}
|
|
3562
3824
|
};
|
|
3563
3825
|
|
|
3564
|
-
var tokensCss$2$
|
|
3826
|
+
var tokensCss$2$2 = 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)}`;
|
|
3565
3827
|
|
|
3566
|
-
var colorCss$3$
|
|
3828
|
+
var colorCss$3$2 = i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
3567
3829
|
|
|
3568
3830
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3569
3831
|
// See LICENSE in the project root for license information.
|
|
@@ -3721,9 +3983,9 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3721
3983
|
static get styles() {
|
|
3722
3984
|
return [
|
|
3723
3985
|
super.styles,
|
|
3724
|
-
i$5`${tokensCss$2$
|
|
3986
|
+
i$5`${tokensCss$2$2}`,
|
|
3725
3987
|
i$5`${styleCss$2$2}`,
|
|
3726
|
-
i$5`${colorCss$3$
|
|
3988
|
+
i$5`${colorCss$3$2}`
|
|
3727
3989
|
];
|
|
3728
3990
|
}
|
|
3729
3991
|
|
|
@@ -3757,8 +4019,12 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3757
4019
|
async firstUpdated() {
|
|
3758
4020
|
await super.firstUpdated();
|
|
3759
4021
|
|
|
3760
|
-
|
|
3761
|
-
|
|
4022
|
+
/**
|
|
4023
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
4024
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
4025
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
4026
|
+
*/
|
|
4027
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
3762
4028
|
const svgDesc = this.svg.querySelector('desc');
|
|
3763
4029
|
|
|
3764
4030
|
if (svgDesc) {
|
|
@@ -3804,11 +4070,11 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3804
4070
|
|
|
3805
4071
|
var iconVersion$2 = '6.1.2';
|
|
3806
4072
|
|
|
3807
|
-
var styleCss$1$2 = i$5`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}.container{
|
|
4073
|
+
var styleCss$1$2 = i$5`: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}`;
|
|
3808
4074
|
|
|
3809
|
-
var colorCss$2$
|
|
4075
|
+
var colorCss$2$2 = i$5`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
3810
4076
|
|
|
3811
|
-
var tokensCss$1$
|
|
4077
|
+
var tokensCss$1$2 = i$5`: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)}`;
|
|
3812
4078
|
|
|
3813
4079
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
3814
4080
|
// See LICENSE in the project root for license information.
|
|
@@ -3829,7 +4095,7 @@ const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
|
3829
4095
|
*/
|
|
3830
4096
|
|
|
3831
4097
|
class AuroDropdownBib extends i$2 {
|
|
3832
|
-
|
|
4098
|
+
// not extending AuroElement because Bib needs only `shape` prop
|
|
3833
4099
|
constructor() {
|
|
3834
4100
|
super();
|
|
3835
4101
|
|
|
@@ -3839,13 +4105,16 @@ class AuroDropdownBib extends i$2 {
|
|
|
3839
4105
|
this._mobileBreakpointValue = undefined;
|
|
3840
4106
|
|
|
3841
4107
|
AuroLibraryRuntimeUtils$2$1.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
4108
|
+
|
|
4109
|
+
this.shape = "rounded";
|
|
4110
|
+
this.matchWidth = false;
|
|
3842
4111
|
}
|
|
3843
4112
|
|
|
3844
4113
|
static get styles() {
|
|
3845
4114
|
return [
|
|
3846
4115
|
styleCss$1$2,
|
|
3847
|
-
colorCss$2$
|
|
3848
|
-
tokensCss$1$
|
|
4116
|
+
colorCss$2$2,
|
|
4117
|
+
tokensCss$1$2
|
|
3849
4118
|
];
|
|
3850
4119
|
}
|
|
3851
4120
|
|
|
@@ -3876,6 +4145,15 @@ class AuroDropdownBib extends i$2 {
|
|
|
3876
4145
|
reflect: true
|
|
3877
4146
|
},
|
|
3878
4147
|
|
|
4148
|
+
/**
|
|
4149
|
+
* If declared, the bib width will match the trigger width.
|
|
4150
|
+
* @private
|
|
4151
|
+
*/
|
|
4152
|
+
matchWidth: {
|
|
4153
|
+
type: Boolean,
|
|
4154
|
+
reflect: true
|
|
4155
|
+
},
|
|
4156
|
+
|
|
3879
4157
|
/**
|
|
3880
4158
|
* If declared, will apply border-radius to the bib.
|
|
3881
4159
|
*/
|
|
@@ -3889,6 +4167,11 @@ class AuroDropdownBib extends i$2 {
|
|
|
3889
4167
|
*/
|
|
3890
4168
|
bibTemplate: {
|
|
3891
4169
|
type: Object
|
|
4170
|
+
},
|
|
4171
|
+
|
|
4172
|
+
shape: {
|
|
4173
|
+
type: String,
|
|
4174
|
+
reflect: true
|
|
3892
4175
|
}
|
|
3893
4176
|
};
|
|
3894
4177
|
}
|
|
@@ -3968,8 +4251,16 @@ class AuroDropdownBib extends i$2 {
|
|
|
3968
4251
|
|
|
3969
4252
|
// function that renders the HTML and CSS into the scope of the component
|
|
3970
4253
|
render() {
|
|
4254
|
+
const classes = {
|
|
4255
|
+
container: true
|
|
4256
|
+
};
|
|
4257
|
+
|
|
4258
|
+
// Since this class does not inherit from AuroElement, we apply the shape-related class within the `render` function,
|
|
4259
|
+
// mimicking the class naming convention used in AuroElement.resetShapeClasses.
|
|
4260
|
+
classes[`shape-${this.shape}`] = true;
|
|
4261
|
+
|
|
3971
4262
|
return u`
|
|
3972
|
-
<div class="
|
|
4263
|
+
<div class="${e(classes)}" part="bibContainer">
|
|
3973
4264
|
<slot></slot>
|
|
3974
4265
|
</div>
|
|
3975
4266
|
`;
|
|
@@ -3978,21 +4269,21 @@ class AuroDropdownBib extends i$2 {
|
|
|
3978
4269
|
|
|
3979
4270
|
var dropdownVersion$1 = '3.0.0';
|
|
3980
4271
|
|
|
3981
|
-
var shapeSizeCss = i$5`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:58px;max-height:58px;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:60px;max-height:60px;background-color:unset}.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:58px;max-height:58px;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;min-height:56px;max-height:56px}.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}.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;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}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;min-height:68px;max-height:68px}.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}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;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}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:
|
|
4272
|
+
var shapeSizeCss = i$5`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:58px;max-height:58px;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:60px;max-height:60px;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:58px;max-height:58px;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:56px;max-height:56px}.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-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}`;
|
|
3982
4273
|
|
|
3983
|
-
var colorCss$1$2 = i$5`:host .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,:host(:not([ondark])) .wrapper:
|
|
4274
|
+
var colorCss$1$2 = i$5`: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{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-basic-color-status-error-subtle, #fbc6c6)}`;
|
|
3984
4275
|
|
|
3985
|
-
var classicColorCss = i$5
|
|
4276
|
+
var classicColorCss = i$5``;
|
|
3986
4277
|
|
|
3987
|
-
var classicLayoutCss = i$5`: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{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .
|
|
4278
|
+
var classicLayoutCss = i$5`: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{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}: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);line-height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}`;
|
|
3988
4279
|
|
|
3989
|
-
var styleEmphasizedCss = i$5`:host{display:block}.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}.wrapper{display:flex;flex-direction:row
|
|
4280
|
+
var styleEmphasizedCss = i$5`:host{display:block}.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}.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([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)}`;
|
|
3990
4281
|
|
|
3991
|
-
var styleSnowflakeCss = i$5`:host{display:block}.wrapper{display:flex;flex
|
|
4282
|
+
var styleSnowflakeCss = i$5`:host{display:block}.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([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)}.layout-snowflake .chevron,.layout-snowflake-left .chevron,.layout-snowflake-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
3992
4283
|
|
|
3993
|
-
var colorCss$5 = i$5`: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-
|
|
4284
|
+
var colorCss$5 = i$5`: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-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
3994
4285
|
|
|
3995
|
-
var styleCss$6 = i$5
|
|
4286
|
+
var styleCss$6 = i$5`:host{position:relative;display:block}.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
3996
4287
|
|
|
3997
4288
|
var tokensCss$4 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
3998
4289
|
|
|
@@ -4003,7 +4294,7 @@ var tokensCss$4 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texti
|
|
|
4003
4294
|
|
|
4004
4295
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
4005
4296
|
|
|
4006
|
-
let AuroLibraryRuntimeUtils$
|
|
4297
|
+
let AuroLibraryRuntimeUtils$5 = class AuroLibraryRuntimeUtils {
|
|
4007
4298
|
|
|
4008
4299
|
/* eslint-disable jsdoc/require-param */
|
|
4009
4300
|
|
|
@@ -4084,7 +4375,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$2 {
|
|
|
4084
4375
|
this.onDark = false;
|
|
4085
4376
|
this.hasTextContent = false;
|
|
4086
4377
|
|
|
4087
|
-
AuroLibraryRuntimeUtils$
|
|
4378
|
+
AuroLibraryRuntimeUtils$5.prototype.handleComponentTagRename(this, 'auro-helptext');
|
|
4088
4379
|
}
|
|
4089
4380
|
|
|
4090
4381
|
static get styles() {
|
|
@@ -4140,7 +4431,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$2 {
|
|
|
4140
4431
|
*
|
|
4141
4432
|
*/
|
|
4142
4433
|
static register(name = "auro-helptext") {
|
|
4143
|
-
AuroLibraryRuntimeUtils$
|
|
4434
|
+
AuroLibraryRuntimeUtils$5.prototype.registerComponent(name, AuroHelpText);
|
|
4144
4435
|
}
|
|
4145
4436
|
|
|
4146
4437
|
updated() {
|
|
@@ -4198,7 +4489,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$2 {
|
|
|
4198
4489
|
|
|
4199
4490
|
var helpTextVersion$1 = '1.0.0';
|
|
4200
4491
|
|
|
4201
|
-
let AuroElement$
|
|
4492
|
+
let AuroElement$3 = class AuroElement extends i$2 {
|
|
4202
4493
|
static get properties() {
|
|
4203
4494
|
return {
|
|
4204
4495
|
|
|
@@ -4233,18 +4524,21 @@ let AuroElement$2 = class AuroElement extends i$2 {
|
|
|
4233
4524
|
}
|
|
4234
4525
|
|
|
4235
4526
|
resetShapeClasses() {
|
|
4236
|
-
|
|
4237
|
-
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
4527
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
4238
4528
|
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4529
|
+
if (wrapper) {
|
|
4530
|
+
wrapper.classList.forEach((className) => {
|
|
4531
|
+
if (className.startsWith('shape-')) {
|
|
4532
|
+
wrapper.classList.remove(className);
|
|
4533
|
+
}
|
|
4534
|
+
});
|
|
4245
4535
|
|
|
4246
|
-
|
|
4247
|
-
|
|
4536
|
+
}
|
|
4537
|
+
|
|
4538
|
+
if (this.shape && this.size) {
|
|
4539
|
+
wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
4540
|
+
} else {
|
|
4541
|
+
wrapper.classList.add('shape-none');
|
|
4248
4542
|
}
|
|
4249
4543
|
}
|
|
4250
4544
|
|
|
@@ -4294,10 +4588,8 @@ let AuroElement$2 = class AuroElement extends i$2 {
|
|
|
4294
4588
|
// See LICENSE in the project root for license information.
|
|
4295
4589
|
|
|
4296
4590
|
|
|
4297
|
-
|
|
4298
|
-
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
4591
|
+
/*
|
|
4299
4592
|
* @slot - Default slot for the popover content.
|
|
4300
|
-
* @slot label - Defines the content of the label.
|
|
4301
4593
|
* @slot helpText - Defines the content of the helpText.
|
|
4302
4594
|
* @slot trigger - Defines the content of the trigger.
|
|
4303
4595
|
* @csspart trigger - The trigger content container.
|
|
@@ -4307,7 +4599,7 @@ let AuroElement$2 = class AuroElement extends i$2 {
|
|
|
4307
4599
|
* @event auroDropdown-toggled - Notifies that the visibility of the dropdown bib has changed.
|
|
4308
4600
|
* @event auroDropdown-idAdded - Notifies consumers that the unique ID for the dropdown bib has been generated.
|
|
4309
4601
|
*/
|
|
4310
|
-
class AuroDropdown extends AuroElement$
|
|
4602
|
+
class AuroDropdown extends AuroElement$3 {
|
|
4311
4603
|
constructor() {
|
|
4312
4604
|
super();
|
|
4313
4605
|
|
|
@@ -4316,23 +4608,25 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4316
4608
|
this.matchWidth = false;
|
|
4317
4609
|
this.noHideOnThisFocusLoss = false;
|
|
4318
4610
|
|
|
4319
|
-
this.errorMessage =
|
|
4611
|
+
this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
|
|
4320
4612
|
|
|
4321
4613
|
// Layout Config
|
|
4322
|
-
this.layout =
|
|
4323
|
-
this.shape =
|
|
4324
|
-
this.size =
|
|
4614
|
+
this.layout = undefined;
|
|
4615
|
+
this.shape = undefined;
|
|
4616
|
+
this.size = undefined;
|
|
4617
|
+
|
|
4325
4618
|
this.parentBorder = false;
|
|
4326
4619
|
|
|
4327
|
-
|
|
4328
|
-
|
|
4620
|
+
/** @private */
|
|
4621
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4329
4622
|
|
|
4330
|
-
|
|
4331
|
-
return {
|
|
4332
|
-
// 'withValue': this.value && this.value.length > 0
|
|
4333
|
-
};
|
|
4623
|
+
this.privateDefaults();
|
|
4334
4624
|
}
|
|
4335
4625
|
|
|
4626
|
+
/**
|
|
4627
|
+
* @private
|
|
4628
|
+
* @returns {object} Class definition for the wrapper element.
|
|
4629
|
+
*/
|
|
4336
4630
|
get commonWrapperClasses() {
|
|
4337
4631
|
return {
|
|
4338
4632
|
'trigger': true,
|
|
@@ -4350,13 +4644,10 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4350
4644
|
privateDefaults() {
|
|
4351
4645
|
this.chevron = false;
|
|
4352
4646
|
this.disabled = false;
|
|
4647
|
+
this.disableFocusTrap = false;
|
|
4353
4648
|
this.error = false;
|
|
4354
|
-
this.inset = false;
|
|
4355
|
-
this.rounded = false;
|
|
4356
4649
|
this.tabIndex = 0;
|
|
4357
4650
|
this.noToggle = false;
|
|
4358
|
-
this.a11yAutocomplete = 'none';
|
|
4359
|
-
this.labeled = true;
|
|
4360
4651
|
this.a11yRole = 'button';
|
|
4361
4652
|
this.onDark = false;
|
|
4362
4653
|
this.showTriggerBorders = true;
|
|
@@ -4452,6 +4743,18 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4452
4743
|
this.floater.showBib();
|
|
4453
4744
|
}
|
|
4454
4745
|
|
|
4746
|
+
/**
|
|
4747
|
+
* When bib is open, focus on the first element inside of bib.
|
|
4748
|
+
* If not, trigger element will get focus.
|
|
4749
|
+
*/
|
|
4750
|
+
focus() {
|
|
4751
|
+
if (this.isPopoverVisible && this.focusTrap) {
|
|
4752
|
+
this.focusTrap.focusFirstElement();
|
|
4753
|
+
} else {
|
|
4754
|
+
this.trigger.focus();
|
|
4755
|
+
}
|
|
4756
|
+
}
|
|
4757
|
+
|
|
4455
4758
|
// function to define props used within the scope of this component
|
|
4456
4759
|
static get properties() {
|
|
4457
4760
|
return {
|
|
@@ -4465,6 +4768,15 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4465
4768
|
reflect: true
|
|
4466
4769
|
},
|
|
4467
4770
|
|
|
4771
|
+
/**
|
|
4772
|
+
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
4773
|
+
* @default false
|
|
4774
|
+
*/
|
|
4775
|
+
disableEventShow: {
|
|
4776
|
+
type: Boolean,
|
|
4777
|
+
reflect: true
|
|
4778
|
+
},
|
|
4779
|
+
|
|
4468
4780
|
/**
|
|
4469
4781
|
* If declared, applies a border around the trigger slot.
|
|
4470
4782
|
*/
|
|
@@ -4483,17 +4795,17 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4483
4795
|
},
|
|
4484
4796
|
|
|
4485
4797
|
/**
|
|
4486
|
-
* If declared, the dropdown
|
|
4798
|
+
* If declared, the dropdown is not interactive.
|
|
4487
4799
|
*/
|
|
4488
|
-
|
|
4800
|
+
disabled: {
|
|
4489
4801
|
type: Boolean,
|
|
4490
4802
|
reflect: true
|
|
4491
4803
|
},
|
|
4492
4804
|
|
|
4493
4805
|
/**
|
|
4494
|
-
* If declared, the
|
|
4806
|
+
* If declared, the focus trap inside of bib will be turned off.
|
|
4495
4807
|
*/
|
|
4496
|
-
|
|
4808
|
+
disableFocusTrap: {
|
|
4497
4809
|
type: Boolean,
|
|
4498
4810
|
reflect: true
|
|
4499
4811
|
},
|
|
@@ -4538,22 +4850,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4538
4850
|
reflect: true
|
|
4539
4851
|
},
|
|
4540
4852
|
|
|
4541
|
-
/**
|
|
4542
|
-
* Makes the trigger to be full width of its parent container.
|
|
4543
|
-
*/
|
|
4544
|
-
fluid: {
|
|
4545
|
-
type: Boolean,
|
|
4546
|
-
reflect: true
|
|
4547
|
-
},
|
|
4548
|
-
|
|
4549
|
-
/**
|
|
4550
|
-
* If declared, will apply padding around trigger slot content.
|
|
4551
|
-
*/
|
|
4552
|
-
inset: {
|
|
4553
|
-
type: Boolean,
|
|
4554
|
-
reflect: true
|
|
4555
|
-
},
|
|
4556
|
-
|
|
4557
4853
|
/**
|
|
4558
4854
|
* If true, the dropdown bib is displayed.
|
|
4559
4855
|
*/
|
|
@@ -4597,15 +4893,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4597
4893
|
reflect: true
|
|
4598
4894
|
},
|
|
4599
4895
|
|
|
4600
|
-
/**
|
|
4601
|
-
* Defines if there is a label preset.
|
|
4602
|
-
* @private
|
|
4603
|
-
*/
|
|
4604
|
-
labeled: {
|
|
4605
|
-
type: Boolean,
|
|
4606
|
-
reflect: true
|
|
4607
|
-
},
|
|
4608
|
-
|
|
4609
4896
|
/**
|
|
4610
4897
|
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
4611
4898
|
* @private
|
|
@@ -4666,6 +4953,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4666
4953
|
reflect: true
|
|
4667
4954
|
},
|
|
4668
4955
|
|
|
4956
|
+
/**
|
|
4957
|
+
* If declared, and a function is set, that function will execute when the slot content is updated.
|
|
4958
|
+
*/
|
|
4669
4959
|
onSlotChange: {
|
|
4670
4960
|
type: Function,
|
|
4671
4961
|
reflect: false
|
|
@@ -4680,14 +4970,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4680
4970
|
reflect: true
|
|
4681
4971
|
},
|
|
4682
4972
|
|
|
4683
|
-
/**
|
|
4684
|
-
* If declared, will apply border-radius to trigger and default slots.
|
|
4685
|
-
*/
|
|
4686
|
-
rounded: {
|
|
4687
|
-
type: Boolean,
|
|
4688
|
-
reflect: true
|
|
4689
|
-
},
|
|
4690
|
-
|
|
4691
4973
|
/**
|
|
4692
4974
|
* @private
|
|
4693
4975
|
*/
|
|
@@ -4702,22 +4984,14 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4702
4984
|
type: String || undefined,
|
|
4703
4985
|
attribute: false,
|
|
4704
4986
|
reflect: false
|
|
4705
|
-
},
|
|
4706
|
-
|
|
4707
|
-
/**
|
|
4708
|
-
* The value for the aria-autocomplete attribute of the trigger element.
|
|
4709
|
-
*/
|
|
4710
|
-
a11yAutocomplete: {
|
|
4711
|
-
type: String,
|
|
4712
|
-
attribute: false,
|
|
4713
4987
|
}
|
|
4714
4988
|
};
|
|
4715
4989
|
}
|
|
4716
4990
|
|
|
4717
4991
|
static get styles() {
|
|
4718
4992
|
return [
|
|
4993
|
+
tokensCss$1$2,
|
|
4719
4994
|
colorCss$1$2,
|
|
4720
|
-
tokensCss$1$1,
|
|
4721
4995
|
|
|
4722
4996
|
// default layout
|
|
4723
4997
|
classicColorCss,
|
|
@@ -4779,13 +5053,27 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4779
5053
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4780
5054
|
this.handleTriggerContentSlotChange();
|
|
4781
5055
|
}
|
|
5056
|
+
}
|
|
4782
5057
|
|
|
5058
|
+
/**
|
|
5059
|
+
* Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
|
|
5060
|
+
* @private
|
|
5061
|
+
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
5062
|
+
*/
|
|
5063
|
+
handleDropdownToggle(event) {
|
|
5064
|
+
this.updateFocusTrap();
|
|
5065
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
5066
|
+
const eventType = event.detail.eventType || "unknown";
|
|
5067
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
5068
|
+
this.trigger.focus();
|
|
5069
|
+
}
|
|
4783
5070
|
}
|
|
4784
5071
|
|
|
4785
5072
|
firstUpdated() {
|
|
4786
5073
|
|
|
4787
5074
|
// Configure the floater to, this will generate the ID for the bib
|
|
4788
5075
|
this.floater.configure(this, 'auroDropdown');
|
|
5076
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4789
5077
|
|
|
4790
5078
|
/**
|
|
4791
5079
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -4845,6 +5133,27 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4845
5133
|
this.hasFocus = true;
|
|
4846
5134
|
}
|
|
4847
5135
|
|
|
5136
|
+
/**
|
|
5137
|
+
* @private
|
|
5138
|
+
*/
|
|
5139
|
+
updateFocusTrap() {
|
|
5140
|
+
// If the dropdown is open, create a focus trap and focus the first element
|
|
5141
|
+
if (this.isPopoverVisible && !this.disableFocusTrap) {
|
|
5142
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
5143
|
+
this.focusTrap.focusFirstElement();
|
|
5144
|
+
return;
|
|
5145
|
+
}
|
|
5146
|
+
|
|
5147
|
+
// Guard Clause: Ensure there is a focus trap currently active before continuing
|
|
5148
|
+
if (!this.focusTrap) {
|
|
5149
|
+
return;
|
|
5150
|
+
}
|
|
5151
|
+
|
|
5152
|
+
// If the dropdown is not open, disconnect the focus trap if it exists
|
|
5153
|
+
this.focusTrap.disconnect();
|
|
5154
|
+
this.focusTrap = undefined;
|
|
5155
|
+
}
|
|
5156
|
+
|
|
4848
5157
|
/**
|
|
4849
5158
|
* Function to support @focusout event.
|
|
4850
5159
|
* @private
|
|
@@ -5005,14 +5314,13 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5005
5314
|
* @returns {void}
|
|
5006
5315
|
*/
|
|
5007
5316
|
handleTriggerContentSlotChange(event) {
|
|
5008
|
-
|
|
5009
5317
|
this.floater.handleTriggerTabIndex();
|
|
5010
5318
|
|
|
5011
5319
|
// Get the trigger
|
|
5012
5320
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
5013
5321
|
|
|
5014
5322
|
// Get the trigger slot
|
|
5015
|
-
const triggerSlot = this.shadowRoot.querySelector('.
|
|
5323
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContentWrapper slot');
|
|
5016
5324
|
|
|
5017
5325
|
// If there's a trigger slot
|
|
5018
5326
|
if (triggerSlot) {
|
|
@@ -5075,7 +5383,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5075
5383
|
*
|
|
5076
5384
|
* @private
|
|
5077
5385
|
* @method handleDefaultSlot
|
|
5078
|
-
* @param {Event} event - The event object representing the slot change.
|
|
5079
5386
|
* @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
|
|
5080
5387
|
*/
|
|
5081
5388
|
handleDefaultSlot() {
|
|
@@ -5086,33 +5393,10 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5086
5393
|
}
|
|
5087
5394
|
|
|
5088
5395
|
/**
|
|
5396
|
+
* Returns HTML for the common portion of the layouts.
|
|
5089
5397
|
* @private
|
|
5090
|
-
* @
|
|
5091
|
-
* @
|
|
5092
|
-
* @description Handles the slot change event for the label slot.
|
|
5093
|
-
*/
|
|
5094
|
-
handleLabelSlotChange (event) {
|
|
5095
|
-
|
|
5096
|
-
// Get the nodes from the event
|
|
5097
|
-
const nodes = event.target.assignedNodes();
|
|
5098
|
-
|
|
5099
|
-
// Guard clause for no nodes
|
|
5100
|
-
if (!nodes) {
|
|
5101
|
-
return;
|
|
5102
|
-
}
|
|
5103
|
-
|
|
5104
|
-
// Convert the nodes to a measurable array so we can get the length
|
|
5105
|
-
const nodesArr = Array.from(nodes);
|
|
5106
|
-
|
|
5107
|
-
// If the nodes array has a length, the dropdown is labeled
|
|
5108
|
-
this.labeled = nodesArr.length > 0;
|
|
5109
|
-
}
|
|
5110
|
-
|
|
5111
|
-
/**
|
|
5112
|
-
* Returns HTML for the common portion of the layouts.
|
|
5113
|
-
* @private
|
|
5114
|
-
* @param {Object} helpTextClasses - Classes to apply to the help text container.
|
|
5115
|
-
* @returns {html} - Returns HTML.
|
|
5398
|
+
* @param {Object} helpTextClasses - Classes to apply to the help text container.
|
|
5399
|
+
* @returns {html} - Returns HTML.
|
|
5116
5400
|
*/
|
|
5117
5401
|
renderBasicHtml(helpTextClasses) {
|
|
5118
5402
|
return u`
|
|
@@ -5122,22 +5406,17 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5122
5406
|
class="${e(this.commonWrapperClasses)}" part="wrapper"
|
|
5123
5407
|
tabindex="${this.tabIndex}"
|
|
5124
5408
|
role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
5125
|
-
aria-expanded="${o(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
5126
|
-
aria-controls="${o(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
5409
|
+
aria-expanded="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
5410
|
+
aria-controls="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
5127
5411
|
aria-labelledby="${o(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
5128
5412
|
@focusin="${this.handleFocusin}"
|
|
5129
5413
|
@blur="${this.handleFocusOut}">
|
|
5130
|
-
<div class="triggerContentWrapper">
|
|
5131
|
-
<
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
<div class="triggerContent">
|
|
5135
|
-
<slot
|
|
5136
|
-
name="trigger"
|
|
5137
|
-
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
5138
|
-
</div>
|
|
5414
|
+
<div class="triggerContentWrapper" id="triggerLabel">
|
|
5415
|
+
<slot
|
|
5416
|
+
name="trigger"
|
|
5417
|
+
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
5139
5418
|
</div>
|
|
5140
|
-
${this.chevron
|
|
5419
|
+
${this.chevron ? u`
|
|
5141
5420
|
<div
|
|
5142
5421
|
id="showStateIcon"
|
|
5143
5422
|
class="chevron"
|
|
@@ -5158,11 +5437,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5158
5437
|
<div id="bibSizer" part="size"></div>
|
|
5159
5438
|
<${this.dropdownBibTag}
|
|
5160
5439
|
id="bib"
|
|
5440
|
+
shape="${this.shape}"
|
|
5161
5441
|
?data-show="${this.isPopoverVisible}"
|
|
5162
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
5163
|
-
?common="${this.common}"
|
|
5164
|
-
?rounded="${this.common || this.rounded}"
|
|
5165
|
-
?inset="${this.common || this.inset}">
|
|
5442
|
+
?isfullscreen="${this.isBibFullscreen}">
|
|
5166
5443
|
<div class="slotContent">
|
|
5167
5444
|
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5168
5445
|
</div>
|
|
@@ -5177,62 +5454,13 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5177
5454
|
* @returns {html} - Returns HTML for the classic layout.
|
|
5178
5455
|
*/
|
|
5179
5456
|
renderLayoutClassic() {
|
|
5457
|
+
// TODO: check with Doug why this was never used?
|
|
5458
|
+
const helpTextClasses = {
|
|
5459
|
+
'helpText': true
|
|
5460
|
+
};
|
|
5180
5461
|
|
|
5181
5462
|
return u`
|
|
5182
|
-
|
|
5183
|
-
<div
|
|
5184
|
-
id="trigger"
|
|
5185
|
-
class="trigger"
|
|
5186
|
-
part="trigger"
|
|
5187
|
-
tabindex="${this.tabIndex}"
|
|
5188
|
-
?showBorder="${this.showTriggerBorders}"
|
|
5189
|
-
role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
5190
|
-
aria-expanded="${o(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
5191
|
-
aria-controls="${o(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
5192
|
-
aria-labelledby="${o(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
5193
|
-
>
|
|
5194
|
-
<div class="triggerContentWrapper">
|
|
5195
|
-
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
5196
|
-
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
5197
|
-
</label>
|
|
5198
|
-
<div class="triggerContent">
|
|
5199
|
-
<slot
|
|
5200
|
-
name="trigger"
|
|
5201
|
-
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
5202
|
-
</div>
|
|
5203
|
-
</div>
|
|
5204
|
-
${this.chevron || this.common ? u`
|
|
5205
|
-
<div
|
|
5206
|
-
id="showStateIcon"
|
|
5207
|
-
part="chevron">
|
|
5208
|
-
<${this.iconTag}
|
|
5209
|
-
category="interface"
|
|
5210
|
-
name="chevron-down"
|
|
5211
|
-
?onDark="${this.onDark}"
|
|
5212
|
-
variant="${this.disabled ? 'disabled' : 'muted'}">
|
|
5213
|
-
>
|
|
5214
|
-
</${this.iconTag}>
|
|
5215
|
-
</div>
|
|
5216
|
-
` : undefined }
|
|
5217
|
-
</div>
|
|
5218
|
-
<${this.helpTextTag} part="helpText" ?onDark=${this.onDark} ?error="${this.error}">
|
|
5219
|
-
<slot name="helpText"></slot>
|
|
5220
|
-
</${this.helpTextTag}>
|
|
5221
|
-
|
|
5222
|
-
<div id="bibSizer" part="size"></div>
|
|
5223
|
-
<${this.dropdownBibTag}
|
|
5224
|
-
id="bib"
|
|
5225
|
-
?data-show="${this.isPopoverVisible}"
|
|
5226
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
5227
|
-
?common="${this.common}"
|
|
5228
|
-
?rounded="${this.common || this.rounded}"
|
|
5229
|
-
?inset="${this.common || this.inset}"
|
|
5230
|
-
>
|
|
5231
|
-
<div class="slotContent">
|
|
5232
|
-
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5233
|
-
</div>
|
|
5234
|
-
</${this.dropdownBibTag}>
|
|
5235
|
-
</div>
|
|
5463
|
+
${this.renderBasicHtml(helpTextClasses)}
|
|
5236
5464
|
`;
|
|
5237
5465
|
}
|
|
5238
5466
|
|
|
@@ -5300,9 +5528,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5300
5528
|
|
|
5301
5529
|
var dropdownVersion = '3.0.0';
|
|
5302
5530
|
|
|
5303
|
-
var colorCss$
|
|
5531
|
+
var colorCss$3$1 = i$5`#headerContainer{box-shadow:var(--ds-auro-dropdownbib-header-boxshadow-color)}#footerContainer{background-color:var(--ds-auro-dropdownbib-footer-container-color)}`;
|
|
5304
5532
|
|
|
5305
|
-
var styleCss$
|
|
5533
|
+
var styleCss$4$1 = i$5`#bibTemplate{display:flex;overflow:hidden;height:100%;max-height:100%;flex-direction:column}#headerContainer{display:flex;flex-direction:column}#header{display:flex;width:100%;min-height:var(--ds-size-1000, 5rem);box-sizing:border-box;align-items:end;padding-top:var(--ds-size-400, 2rem);padding-right:var(--ds-size-700, 3.5rem);padding-left:var(--ds-size-200, 1rem);pointer-events:none}#subheader{width:100%}#subheader ::slotted([auro-input]){box-sizing:border-box;padding:0 var(--ds-size-200, 1rem)}#closeButton{position:absolute;top:var(--ds-size-400, 2rem);right:var(--ds-size-200, 1rem);border:none;background-color:transparent;cursor:pointer}#bodyContainer{position:relative;overflow:auto;flex:1 1 100%}:host([isfullscreen]) #bibTemplate{max-height:100dvh}:host([isfullscreen]) #bodyContainer{margin-top:var(--ds-size-100, 0.5rem)}#footerContainer{position:absolute;right:0;bottom:0;left:0;padding:var(--ds-size-200, 1rem)}`;
|
|
5306
5534
|
|
|
5307
5535
|
var tokenCss = i$5`:host{--ds-auro-dropdownbib-header-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-footer-container-color: var(--ds-basic-color-surface-default, #ffffff)}`;
|
|
5308
5536
|
|
|
@@ -5313,109 +5541,1153 @@ var tokenCss = i$5`:host{--ds-auro-dropdownbib-header-boxshadow-color: var(--ds-
|
|
|
5313
5541
|
|
|
5314
5542
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
5315
5543
|
|
|
5316
|
-
let AuroLibraryRuntimeUtils$
|
|
5544
|
+
let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
|
|
5545
|
+
|
|
5546
|
+
/* eslint-disable jsdoc/require-param */
|
|
5547
|
+
|
|
5548
|
+
/**
|
|
5549
|
+
* This will register a new custom element with the browser.
|
|
5550
|
+
* @param {String} name - The name of the custom element.
|
|
5551
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
5552
|
+
* @returns {void}
|
|
5553
|
+
*/
|
|
5554
|
+
registerComponent(name, componentClass) {
|
|
5555
|
+
if (!customElements.get(name)) {
|
|
5556
|
+
customElements.define(name, class extends componentClass {});
|
|
5557
|
+
}
|
|
5558
|
+
}
|
|
5559
|
+
|
|
5560
|
+
/**
|
|
5561
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
5562
|
+
* @returns {void}
|
|
5563
|
+
*/
|
|
5564
|
+
closestElement(
|
|
5565
|
+
selector, // selector like in .closest()
|
|
5566
|
+
base = this, // extra functionality to skip a parent
|
|
5567
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
5568
|
+
!el || el === document || el === window
|
|
5569
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
5570
|
+
: found
|
|
5571
|
+
? found // found a selector INside this element
|
|
5572
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
5573
|
+
) {
|
|
5574
|
+
return __Closest(base);
|
|
5575
|
+
}
|
|
5576
|
+
/* eslint-enable jsdoc/require-param */
|
|
5577
|
+
|
|
5578
|
+
/**
|
|
5579
|
+
* If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
|
|
5580
|
+
* @param {Object} elem - The element to check.
|
|
5581
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
5582
|
+
* @returns {void}
|
|
5583
|
+
*/
|
|
5584
|
+
handleComponentTagRename(elem, tagName) {
|
|
5585
|
+
const tag = tagName.toLowerCase();
|
|
5586
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
5587
|
+
|
|
5588
|
+
if (elemTag !== tag) {
|
|
5589
|
+
elem.setAttribute(tag, true);
|
|
5590
|
+
}
|
|
5591
|
+
}
|
|
5592
|
+
|
|
5593
|
+
/**
|
|
5594
|
+
* Validates if an element is a specific Auro component.
|
|
5595
|
+
* @param {Object} elem - The element to validate.
|
|
5596
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
5597
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
5598
|
+
*/
|
|
5599
|
+
elementMatch(elem, tagName) {
|
|
5600
|
+
const tag = tagName.toLowerCase();
|
|
5601
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
5602
|
+
|
|
5603
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
5604
|
+
}
|
|
5605
|
+
};
|
|
5606
|
+
|
|
5607
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5608
|
+
// See LICENSE in the project root for license information.
|
|
5609
|
+
|
|
5610
|
+
|
|
5611
|
+
class AuroDependencyVersioning {
|
|
5612
|
+
|
|
5613
|
+
/**
|
|
5614
|
+
* Generates a unique string to be used for child auro element naming.
|
|
5615
|
+
* @private
|
|
5616
|
+
* @param {string} baseName - Defines the first part of the unique element name.
|
|
5617
|
+
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
5618
|
+
* @returns {string} - Unique string to be used for naming.
|
|
5619
|
+
*/
|
|
5620
|
+
generateElementName(baseName, version) {
|
|
5621
|
+
let result = baseName;
|
|
5622
|
+
|
|
5623
|
+
result += '-';
|
|
5624
|
+
result += version.replace(/[.]/g, '_');
|
|
5625
|
+
|
|
5626
|
+
return result;
|
|
5627
|
+
}
|
|
5628
|
+
|
|
5629
|
+
/**
|
|
5630
|
+
* Generates a unique string to be used for child auro element naming.
|
|
5631
|
+
* @param {string} baseName - Defines the first part of the unique element name.
|
|
5632
|
+
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
5633
|
+
* @returns {string} - Unique string to be used for naming.
|
|
5634
|
+
*/
|
|
5635
|
+
generateTag(baseName, version, tagClass) {
|
|
5636
|
+
const elementName = this.generateElementName(baseName, version);
|
|
5637
|
+
const tag = i`${s(elementName)}`;
|
|
5638
|
+
|
|
5639
|
+
if (!customElements.get(elementName)) {
|
|
5640
|
+
customElements.define(elementName, class extends tagClass {});
|
|
5641
|
+
}
|
|
5642
|
+
|
|
5643
|
+
return tag;
|
|
5644
|
+
}
|
|
5645
|
+
}
|
|
5646
|
+
|
|
5647
|
+
/**
|
|
5648
|
+
* Private module-level WeakMap to hold MutationObservers for each host element.
|
|
5649
|
+
*/
|
|
5650
|
+
const _observers = new WeakMap();
|
|
5651
|
+
|
|
5652
|
+
/**
|
|
5653
|
+
* Private module-level WeakMap to hold attribute matchers and targets for each host element.
|
|
5654
|
+
* Structure: {
|
|
5655
|
+
* host: {
|
|
5656
|
+
* matchers: Set<Function>,
|
|
5657
|
+
* targets: Map<HTMLElement, Map<Function, {removeOriginal: boolean, currentAttributes: Map<string, string>}>>
|
|
5658
|
+
* }
|
|
5659
|
+
* }
|
|
5660
|
+
*/
|
|
5661
|
+
const _transportConfig = new WeakMap();
|
|
5662
|
+
|
|
5663
|
+
/**
|
|
5664
|
+
* Transfers all matching attributes from a host element to a target element and observes for future changes.
|
|
5665
|
+
*
|
|
5666
|
+
* @param {Object} params - The parameters for the function.
|
|
5667
|
+
* @param {HTMLElement} params.host - The host element from which attributes will be transported.
|
|
5668
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
5669
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove the attributes from the host element.
|
|
5670
|
+
* @param {boolean} [params.observe=true] - Whether to attach a MutationObserver to the host element.
|
|
5671
|
+
* @returns {Function} A function to detach the observer when no longer needed.
|
|
5672
|
+
* @throws {TypeError} If the host or target parameters are not instances of HTMLElement.
|
|
5673
|
+
*/
|
|
5674
|
+
const transportAttributes = ({ host, target, match, removeOriginal = true }) => {
|
|
5675
|
+
// Guard Clause: Ensure host is valid HTMLElement instance
|
|
5676
|
+
if (typeof host !== 'object' || !(host instanceof HTMLElement)) {
|
|
5677
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "host" parameter must be an instance of HTMLElement.');
|
|
5678
|
+
}
|
|
5679
|
+
|
|
5680
|
+
// Guard Clause: Ensure target is valid HTMLElement instance
|
|
5681
|
+
if (typeof target !== 'object' || !(target instanceof HTMLElement)) {
|
|
5682
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "target" parameter must be an instance of HTMLElement.');
|
|
5683
|
+
}
|
|
5684
|
+
|
|
5685
|
+
// Guard Clause: Ensure match is a function
|
|
5686
|
+
if (typeof match !== 'function') {
|
|
5687
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "match" parameter must be a function.');
|
|
5688
|
+
}
|
|
5689
|
+
|
|
5690
|
+
// Guard Clause: Ensure removeOriginal is a boolean
|
|
5691
|
+
if (typeof removeOriginal !== 'boolean') {
|
|
5692
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "removeOriginal" parameter must be a boolean.');
|
|
5693
|
+
}
|
|
5694
|
+
|
|
5695
|
+
// Register this transport and get cleanup function
|
|
5696
|
+
return _registerTransport({
|
|
5697
|
+
host,
|
|
5698
|
+
target,
|
|
5699
|
+
matcher: match,
|
|
5700
|
+
removeOriginal
|
|
5701
|
+
});
|
|
5702
|
+
};
|
|
5703
|
+
|
|
5704
|
+
/**
|
|
5705
|
+
* Registers a matcher and target for a host element and attaches an observer if needed.
|
|
5706
|
+
*
|
|
5707
|
+
* @param {Object} params - The parameters object.
|
|
5708
|
+
* @param {HTMLElement} params.host - The host element to observe.
|
|
5709
|
+
* @param {HTMLElement} params.target - The target element to receive attributes.
|
|
5710
|
+
* @param {Function} params.matcher - Function that determines which attributes to transport.
|
|
5711
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes.
|
|
5712
|
+
* @param {boolean} [params.observe=true] - Whether to observe for attribute changes.
|
|
5713
|
+
* @returns {Function} Function to detach the specific matcher and target pairing.
|
|
5714
|
+
* @private
|
|
5715
|
+
*/
|
|
5716
|
+
const _registerTransport = ({ host, target, matcher, removeOriginal = true }) => {
|
|
5717
|
+
// Initialize config for this host if it doesn't exist
|
|
5718
|
+
if (!_transportConfig.has(host)) {
|
|
5719
|
+
_transportConfig.set(host, {
|
|
5720
|
+
matchers: new Set(),
|
|
5721
|
+
targets: new Map()
|
|
5722
|
+
});
|
|
5723
|
+
}
|
|
5724
|
+
|
|
5725
|
+
const config = _transportConfig.get(host);
|
|
5726
|
+
|
|
5727
|
+
// Add the matcher to the set of matchers for this host
|
|
5728
|
+
config.matchers.add(matcher);
|
|
5729
|
+
|
|
5730
|
+
// Initialize target entry if it doesn't exist
|
|
5731
|
+
if (!config.targets.has(target)) {
|
|
5732
|
+
config.targets.set(target, new Map());
|
|
5733
|
+
}
|
|
5734
|
+
|
|
5735
|
+
// Store the matcher with its removeOriginal setting for this target
|
|
5736
|
+
config.targets.get(target).set(matcher, {
|
|
5737
|
+
removeOriginal,
|
|
5738
|
+
currentAttributes: new Map()
|
|
5739
|
+
});
|
|
5740
|
+
|
|
5741
|
+
// Perform initial attribute transport
|
|
5742
|
+
_transportAttributes({ host, target, matcher, removeOriginal });
|
|
5743
|
+
|
|
5744
|
+
// Attach observer
|
|
5745
|
+
_attachObserver(host);
|
|
5746
|
+
|
|
5747
|
+
// Return cleanup function and utility functions
|
|
5748
|
+
return {
|
|
5749
|
+
cleanup: () => _cleanupTransport(host, target, matcher),
|
|
5750
|
+
getObservedAttributes: () => _getObservedAttributes(host, target, matcher),
|
|
5751
|
+
getObservedAttribute: (attr) => _getObservedAttribute(host, target, matcher, attr),
|
|
5752
|
+
}
|
|
5753
|
+
};
|
|
5754
|
+
|
|
5755
|
+
/**
|
|
5756
|
+
* Cleans up resources associated with a specific matcher and target for a host element.
|
|
5757
|
+
*
|
|
5758
|
+
* @param {HTMLElement} host - The host element
|
|
5759
|
+
* @param {HTMLElement} target - The target element
|
|
5760
|
+
* @param {Function} matcher - The matcher function
|
|
5761
|
+
* @private
|
|
5762
|
+
*/
|
|
5763
|
+
const _cleanupTransport = (host, target, matcher) => {
|
|
5764
|
+
const config = _transportConfig.get(host);
|
|
5765
|
+
if (!config) return;
|
|
5766
|
+
|
|
5767
|
+
// Remove this matcher from this target
|
|
5768
|
+
const targetMatchers = config.targets.get(target);
|
|
5769
|
+
if (targetMatchers) {
|
|
5770
|
+
targetMatchers.delete(matcher);
|
|
5771
|
+
|
|
5772
|
+
// If this target has no more matchers, remove it
|
|
5773
|
+
if (targetMatchers.size === 0) {
|
|
5774
|
+
config.targets.delete(target);
|
|
5775
|
+
}
|
|
5776
|
+
}
|
|
5777
|
+
|
|
5778
|
+
// Check if this matcher is still used by any target
|
|
5779
|
+
let matcherStillUsed = false;
|
|
5780
|
+
for (const matcherMap of config.targets.values()) {
|
|
5781
|
+
if (matcherMap.has(matcher)) {
|
|
5782
|
+
matcherStillUsed = true;
|
|
5783
|
+
break;
|
|
5784
|
+
}
|
|
5785
|
+
}
|
|
5786
|
+
|
|
5787
|
+
// If not used anymore, remove from matchers set
|
|
5788
|
+
if (!matcherStillUsed) {
|
|
5789
|
+
config.matchers.delete(matcher);
|
|
5790
|
+
}
|
|
5791
|
+
|
|
5792
|
+
// If no more targets or matchers, detach observer
|
|
5793
|
+
if (config.targets.size === 0 || config.matchers.size === 0) {
|
|
5794
|
+
_detachObserver(host);
|
|
5795
|
+
}
|
|
5796
|
+
};
|
|
5797
|
+
|
|
5798
|
+
/**
|
|
5799
|
+
* Generic function to transport attributes from a host element to a target element.
|
|
5800
|
+
*
|
|
5801
|
+
* @param {Object} params - The parameters object.
|
|
5802
|
+
* @param {HTMLElement} params.host - The host element from which to transport attributes.
|
|
5803
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
5804
|
+
* @param {Function} params.matcher - Function that takes an attribute name and returns true if it should be transported.
|
|
5805
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes from host.
|
|
5806
|
+
* @returns {void}
|
|
5807
|
+
* @private
|
|
5808
|
+
*/
|
|
5809
|
+
const _transportAttributes = ({ host, target, matcher, removeOriginal = true }) => {
|
|
5810
|
+
// Get a list of all matching attributes on the host element and their values
|
|
5811
|
+
const matchingAttributes = host.getAttributeNames()
|
|
5812
|
+
.filter(attr => matcher(attr))
|
|
5813
|
+
.reduce((acc, attr) => {
|
|
5814
|
+
acc[attr] = host.getAttribute(attr);
|
|
5815
|
+
return acc;
|
|
5816
|
+
}, {});
|
|
5817
|
+
|
|
5818
|
+
// Move matching attributes to the target element, removing them from the host if removeOriginal is true
|
|
5819
|
+
Object.entries(matchingAttributes).forEach(([key, value]) => {
|
|
5820
|
+
_setObservedAttribute(host, target, matcher, key, value);
|
|
5821
|
+
target.setAttribute(key, value);
|
|
5822
|
+
if (removeOriginal) {
|
|
5823
|
+
host.removeAttribute(key);
|
|
5824
|
+
}
|
|
5825
|
+
});
|
|
5826
|
+
};
|
|
5827
|
+
|
|
5828
|
+
/**
|
|
5829
|
+
* Attaches a MutationObserver to the host element to monitor attribute changes.
|
|
5830
|
+
*
|
|
5831
|
+
* @param {HTMLElement} host - The element to observe for attribute changes.
|
|
5832
|
+
* @returns {MutationObserver} The observer instance.
|
|
5833
|
+
* @private
|
|
5834
|
+
*/
|
|
5835
|
+
const _attachObserver = (host) => {
|
|
5836
|
+
// If an observer for this host already exists, return it
|
|
5837
|
+
if (_observers.has(host)) {
|
|
5838
|
+
return _observers.get(host);
|
|
5839
|
+
}
|
|
5840
|
+
|
|
5841
|
+
// Create a new MutationObserver
|
|
5842
|
+
const observer = new MutationObserver((mutations) => {
|
|
5843
|
+
const config = _transportConfig.get(host);
|
|
5844
|
+
if (!config) return;
|
|
5845
|
+
|
|
5846
|
+
// For each mutation affecting attributes
|
|
5847
|
+
mutations
|
|
5848
|
+
.filter(mutation => mutation.type === 'attributes')
|
|
5849
|
+
.forEach(mutation => {
|
|
5850
|
+
const attributeName = mutation.attributeName;
|
|
5851
|
+
|
|
5852
|
+
// Find matchers that care about this attribute
|
|
5853
|
+
for (const matcher of config.matchers) {
|
|
5854
|
+
if (matcher(attributeName)) {
|
|
5855
|
+
// For each target that uses this matcher
|
|
5856
|
+
for (const [target, matcherConfigs] of config.targets.entries()) {
|
|
5857
|
+
if (matcherConfigs.has(matcher)) {
|
|
5858
|
+
const { removeOriginal } = matcherConfigs.get(matcher);
|
|
5859
|
+
_transportAttributes({
|
|
5860
|
+
host,
|
|
5861
|
+
target,
|
|
5862
|
+
matcher,
|
|
5863
|
+
removeOriginal
|
|
5864
|
+
});
|
|
5865
|
+
}
|
|
5866
|
+
}
|
|
5867
|
+
}
|
|
5868
|
+
}
|
|
5869
|
+
});
|
|
5870
|
+
});
|
|
5871
|
+
|
|
5872
|
+
// Start observing attribute changes
|
|
5873
|
+
observer.observe(host, { attributes: true });
|
|
5874
|
+
|
|
5875
|
+
// Store the observer
|
|
5876
|
+
_observers.set(host, observer);
|
|
5877
|
+
|
|
5878
|
+
return observer;
|
|
5879
|
+
};
|
|
5880
|
+
|
|
5881
|
+
/**
|
|
5882
|
+
* Detaches and cleans up the MutationObserver for a given host element.
|
|
5883
|
+
*
|
|
5884
|
+
* @param {HTMLElement} host - The element whose observer should be detached.
|
|
5885
|
+
* @private
|
|
5886
|
+
*/
|
|
5887
|
+
const _detachObserver = (host) => {
|
|
5888
|
+
if (_observers.has(host)) {
|
|
5889
|
+
const observer = _observers.get(host);
|
|
5890
|
+
observer.disconnect();
|
|
5891
|
+
_observers.delete(host);
|
|
5892
|
+
}
|
|
5893
|
+
|
|
5894
|
+
// Clean up the transport config as well
|
|
5895
|
+
if (_transportConfig.has(host)) {
|
|
5896
|
+
_transportConfig.delete(host);
|
|
5897
|
+
}
|
|
5898
|
+
};
|
|
5899
|
+
|
|
5900
|
+
/**
|
|
5901
|
+
* Gets the matcher configuration for a specific host, target, and matcher
|
|
5902
|
+
* @param {HTMLElement} host - The host element
|
|
5903
|
+
* @param {HTMLElement} target - The target element
|
|
5904
|
+
* @param {Function} matcher - The matcher function
|
|
5905
|
+
* @returns {Object|undefined} The matcher configuration if found
|
|
5906
|
+
* @private
|
|
5907
|
+
*/
|
|
5908
|
+
const _getMatcherConfig = (host, target, matcher) => {
|
|
5909
|
+
const config = _transportConfig.get(host);
|
|
5910
|
+
if (!config) return undefined;
|
|
5911
|
+
|
|
5912
|
+
const targetMatchers = config.targets.get(target);
|
|
5913
|
+
if (!targetMatchers) return undefined;
|
|
5914
|
+
|
|
5915
|
+
return targetMatchers.get(matcher);
|
|
5916
|
+
};
|
|
5917
|
+
|
|
5918
|
+
/**
|
|
5919
|
+
* Sets an observed attribute value
|
|
5920
|
+
* @param {HTMLElement} host - The host element
|
|
5921
|
+
* @param {HTMLElement} target - The target element
|
|
5922
|
+
* @param {Function} matcher - The matcher function
|
|
5923
|
+
* @param {string} key - The attribute name
|
|
5924
|
+
* @param {string} value - The attribute value
|
|
5925
|
+
* @private
|
|
5926
|
+
*/
|
|
5927
|
+
const _setObservedAttribute = (host, target, matcher, key, value) => {
|
|
5928
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5929
|
+
if (matcherConfig) {
|
|
5930
|
+
matcherConfig.currentAttributes.set(key, value);
|
|
5931
|
+
}
|
|
5932
|
+
};
|
|
5933
|
+
|
|
5934
|
+
const _getObservedAttribute = (host, target, matcher, attr) => {
|
|
5935
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5936
|
+
if (matcherConfig) return matcherConfig.currentAttributes.get(attr);
|
|
5937
|
+
return undefined;
|
|
5938
|
+
};
|
|
5939
|
+
|
|
5940
|
+
const _getObservedAttributes = (host, target, matcher) => {
|
|
5941
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5942
|
+
if (matcherConfig) return Array.from(matcherConfig.currentAttributes.entries());
|
|
5943
|
+
return [];
|
|
5944
|
+
};
|
|
5945
|
+
|
|
5946
|
+
const _matchers = {
|
|
5947
|
+
'aria-': attr => attr.startsWith('aria-'),
|
|
5948
|
+
'role': attr => attr.match(/^role$/)
|
|
5949
|
+
};
|
|
5950
|
+
|
|
5951
|
+
const transportAllA11yAttributes = ({ host, target, removeOriginal = true }) => {
|
|
5952
|
+
return transportAttributes({
|
|
5953
|
+
host,
|
|
5954
|
+
target,
|
|
5955
|
+
match: attr => {
|
|
5956
|
+
for (const key in _matchers) {
|
|
5957
|
+
if (_matchers[key](attr)) return true;
|
|
5958
|
+
}
|
|
5959
|
+
return false;
|
|
5960
|
+
},
|
|
5961
|
+
removeOriginal
|
|
5962
|
+
});
|
|
5963
|
+
};
|
|
5964
|
+
|
|
5965
|
+
let AuroElement$1 = class AuroElement extends i$2 {
|
|
5966
|
+
|
|
5967
|
+
/**
|
|
5968
|
+
* @type {Object} return object from transportAttributes via a11yUtilities
|
|
5969
|
+
* @property {Function} cleanup - Function to clean up the attribute watcher.
|
|
5970
|
+
* @property {Function} getCurrentAttributes - Function to get the current attributes being watched and their values.
|
|
5971
|
+
* @property {Function} getObservedAttribute - Function to get the value of a specific observed attribute by name.
|
|
5972
|
+
* @private
|
|
5973
|
+
*/
|
|
5974
|
+
attributeWatcher;
|
|
5975
|
+
|
|
5976
|
+
static get properties() {
|
|
5977
|
+
return {
|
|
5978
|
+
|
|
5979
|
+
/**
|
|
5980
|
+
* Defines the layout of an element.
|
|
5981
|
+
* @default {'default'}
|
|
5982
|
+
*/
|
|
5983
|
+
layout: {
|
|
5984
|
+
type: String,
|
|
5985
|
+
attribute: "layout",
|
|
5986
|
+
reflect: true
|
|
5987
|
+
},
|
|
5988
|
+
|
|
5989
|
+
/**
|
|
5990
|
+
* Defines the shape of an element.
|
|
5991
|
+
* @property {'default', 'rounded', 'pill', 'circle'}
|
|
5992
|
+
* @default {'default'}
|
|
5993
|
+
*/
|
|
5994
|
+
shape: {
|
|
5995
|
+
type: String,
|
|
5996
|
+
attribute: "shape",
|
|
5997
|
+
reflect: true
|
|
5998
|
+
},
|
|
5999
|
+
|
|
6000
|
+
/**
|
|
6001
|
+
* Defines the size of an element.
|
|
6002
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'}
|
|
6003
|
+
* @default {'md'}
|
|
6004
|
+
*/
|
|
6005
|
+
size: {
|
|
6006
|
+
type: String,
|
|
6007
|
+
attribute: "size",
|
|
6008
|
+
reflect: true
|
|
6009
|
+
},
|
|
6010
|
+
|
|
6011
|
+
/**
|
|
6012
|
+
* This Boolean attribute lets you specify that the element should be rendered in dark mode.
|
|
6013
|
+
* @default {false}
|
|
6014
|
+
*/
|
|
6015
|
+
onDark: {
|
|
6016
|
+
type: Boolean,
|
|
6017
|
+
attribute: "ondark",
|
|
6018
|
+
reflect: true
|
|
6019
|
+
},
|
|
6020
|
+
|
|
6021
|
+
/**
|
|
6022
|
+
* A reference to the wrapper element in the shadow DOM.
|
|
6023
|
+
* This is used to apply layout and shape classes dynamically.
|
|
6024
|
+
* @type {HTMLElement|null}
|
|
6025
|
+
* @default {null}
|
|
6026
|
+
* @private
|
|
6027
|
+
*/
|
|
6028
|
+
wrapper: {
|
|
6029
|
+
attribute: false,
|
|
6030
|
+
reflect: false
|
|
6031
|
+
}
|
|
6032
|
+
};
|
|
6033
|
+
}
|
|
6034
|
+
|
|
6035
|
+
|
|
6036
|
+
|
|
6037
|
+
resetShapeClasses() {
|
|
6038
|
+
if (this.shape && this.size) {
|
|
6039
|
+
|
|
6040
|
+
if (this.wrapper) {
|
|
6041
|
+
this.wrapper.classList.forEach((className) => {
|
|
6042
|
+
if (className.startsWith('shape-')) {
|
|
6043
|
+
this.wrapper.classList.remove(className);
|
|
6044
|
+
}
|
|
6045
|
+
});
|
|
6046
|
+
|
|
6047
|
+
this.wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
6048
|
+
}
|
|
6049
|
+
}
|
|
6050
|
+
}
|
|
6051
|
+
|
|
6052
|
+
resetLayoutClasses() {
|
|
6053
|
+
if (this.layout) {
|
|
6054
|
+
if (this.wrapper) {
|
|
6055
|
+
this.wrapper.classList.forEach((className) => {
|
|
6056
|
+
if (className.startsWith('layout-')) {
|
|
6057
|
+
this.wrapper.classList.remove(className);
|
|
6058
|
+
}
|
|
6059
|
+
});
|
|
6060
|
+
|
|
6061
|
+
this.wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
|
|
6062
|
+
}
|
|
6063
|
+
}
|
|
6064
|
+
}
|
|
6065
|
+
|
|
6066
|
+
updateComponentArchitecture() {
|
|
6067
|
+
this.resetLayoutClasses();
|
|
6068
|
+
this.resetShapeClasses();
|
|
6069
|
+
}
|
|
6070
|
+
|
|
6071
|
+
updated(changedProperties) {
|
|
6072
|
+
if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
|
|
6073
|
+
this.updateComponentArchitecture();
|
|
6074
|
+
}
|
|
6075
|
+
}
|
|
6076
|
+
|
|
6077
|
+
firstUpdated() {
|
|
6078
|
+
super.firstUpdated();
|
|
6079
|
+
|
|
6080
|
+
// Set a reference to the wrapper element in the shadow DOM
|
|
6081
|
+
this.wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
6082
|
+
|
|
6083
|
+
// Initialize the transportation of ARIA attributes to the target element and get the disconnect function for cleanup
|
|
6084
|
+
this.attributeWatcher = transportAllA11yAttributes({ host: this, target: this.shadowRoot.querySelector('.wrapper') });
|
|
6085
|
+
}
|
|
6086
|
+
|
|
6087
|
+
disconnectedCallback() {
|
|
6088
|
+
super.disconnectedCallback();
|
|
6089
|
+
|
|
6090
|
+
// Cleanup the ARIA observer if it exists
|
|
6091
|
+
if (this.attributeWatcher) {
|
|
6092
|
+
this.attributeWatcher.cleanup();
|
|
6093
|
+
this.attributeWatcher = null;
|
|
6094
|
+
}
|
|
6095
|
+
}
|
|
6096
|
+
|
|
6097
|
+
// Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
|
|
6098
|
+
// This will catch if an invalid layout value is passed in and render the default layout if so.
|
|
6099
|
+
render() {
|
|
6100
|
+
try {
|
|
6101
|
+
return this.renderLayout();
|
|
6102
|
+
} catch (error) {
|
|
6103
|
+
// failed to get the defined layout
|
|
6104
|
+
console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
|
|
6105
|
+
|
|
6106
|
+
// fallback to the default layout
|
|
6107
|
+
return this.getLayout('default');
|
|
6108
|
+
}
|
|
6109
|
+
}
|
|
6110
|
+
};
|
|
6111
|
+
|
|
6112
|
+
var styleCss$3$1 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_insetNone{padding:0}.util_insetXxxs{padding:.125rem}.util_insetXxxs--stretch{padding:.25rem .125rem}.util_insetXxxs--squish{padding:0 .125rem}.util_insetXxs{padding:.25rem}.util_insetXxs--stretch{padding:.375rem .25rem}.util_insetXxs--squish{padding:.125rem .25rem}.util_insetXs{padding:.5rem}.util_insetXs--stretch{padding:.75rem .5rem}.util_insetXs--squish{padding:.25rem .5rem}.util_insetSm{padding:.75rem}.util_insetSm--stretch{padding:1.125rem .75rem}.util_insetSm--squish{padding:.375rem .75rem}.util_insetMd{padding:1rem}.util_insetMd--stretch{padding:1.5rem 1rem}.util_insetMd--squish{padding:.5rem 1rem}.util_insetLg{padding:1.5rem}.util_insetLg--stretch{padding:2.25rem 1.5rem}.util_insetLg--squish{padding:.75rem 1.5rem}.util_insetXl{padding:2rem}.util_insetXl--stretch{padding:3rem 2rem}.util_insetXl--squish{padding:1rem 2rem}.util_insetXxl{padding:3rem}.util_insetXxl--stretch{padding:4.5rem 3rem}.util_insetXxl--squish{padding:1.5rem 3rem}.util_insetXxxl{padding:4rem}.util_insetXxxl--stretch{padding:6rem 4rem}.util_insetXxxl--squish{padding:2rem 4rem}:host([fluid]) .auro-button,:host([fluid=true]) .auro-button{min-width:auto;width:100%}:host([variant=flat]){display:inline-block}::slotted(svg){vertical-align:middle}slot{pointer-events:none}.auro-button{position:relative;padding:0 var(--ds-size-300, 1.5rem);cursor:pointer;border-width:1px;border-style:solid;border-radius:var(--ds-border-radius, 0.375rem);overflow:hidden;text-overflow:ellipsis;user-select:none;white-space:nowrap;min-height:var(--ds-size-600, 3rem);max-height:var(--ds-size-600, 3rem);display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:var(--ds-size-100, 0.5rem);margin:0;-webkit-touch-callout:none;-webkit-user-select:none;transition:padding 300ms ease-out}.auro-button:active{transform:scale(0.95)}.auro-button:focus-visible,.auro-button:focus{outline:none;outline-style:solid;outline-width:var(--ds-size-50, 0.25rem);outline-offset:calc(var(--ds-size-50, 0.25rem)*-1)}.auro-button:focus-visible:not([variant=secondary]):not([variant=tertiary]),.auro-button:focus:not([variant=secondary]):not([variant=tertiary]){outline-width:calc(var(--ds-size-50, 0.25rem) - 1px)}.auro-button.loading{cursor:not-allowed}.auro-button.loading *:not([auro-loader]){visibility:hidden}@media screen and (min-width: 576px){.auro-button{min-width:8.75rem;width:auto}}.auro-button:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=secondary]:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=tertiary]:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=ghost]:disabled{cursor:not-allowed;transform:unset}.auro-button[onDark]:disabled{cursor:not-allowed;transform:unset}.auro-button[onDark][variant=secondary]:disabled{cursor:not-allowed;transform:unset}@media(hover: hover){.auro-button[onDark][variant=tertiary]:active,.auro-button[onDark][variant=tertiary]:hover{box-shadow:none}}.auro-button[onDark][variant=tertiary]:active{box-shadow:none}.auro-button[onDark][variant=tertiary]:disabled{cursor:not-allowed;transform:unset}.auro-button.icon-only ::slotted(:not(auro-icon):not([auro-icon])){display:none}.auro-button--slim{min-width:unset;min-height:calc(var(--ds-size-500, 2.5rem) - var(--ds-size-50, 0.25rem));max-height:calc(var(--ds-size-500, 2.5rem) - var(--ds-size-50, 0.25rem))}.auro-button--iconOnly{padding:0 var(--ds-size-100, 0.5rem);border-radius:100px;min-width:unset;height:var(--ds-size-600, 3rem);width:var(--ds-size-500, 2.5rem)}.auro-button--iconOnly ::slotted(auro-icon),.auro-button--iconOnly ::slotted([auro-icon]){--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}.auro-button--iconOnly:not(.auro-button--rounded):focus-visible:not([variant=secondary]):not([variant=tertiary]):not([variant=flat]),.auro-button--iconOnly:not(.auro-button--rounded):focus:not([variant=secondary]):not([variant=tertiary]):not([variant=flat]){outline-width:1px;outline-offset:-2px}.auro-button--iconOnlySlim{padding:0 var(--ds-size-50, 0.25rem);height:calc(var(--ds-size-400, 2rem) + var(--ds-size-50, 0.25rem));width:calc(var(--ds-size-300, 1.5rem) + var(--ds-size-50, 0.25rem))}.auro-button--iconOnlySlim ::slotted(auro-icon),.auro-button--iconOnlySlim ::slotted([auro-icon]){--ds-auro-icon-size:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem))}.auro-button--rounded{border-radius:100px;box-shadow:var(--ds-elevation-300, 0px 0px 15px rgba(0, 0, 0, 0.2));height:var(--ds-size-500, 2.5rem);min-width:unset;transition:padding 300ms ease-out,outline 0ms,outline-offset 0ms}.auro-button--rounded ::slotted(auro-icon),.auro-button--rounded ::slotted([auro-icon]){--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}.auro-button--rounded:focus-visible:not([variant=flat]):after,.auro-button--rounded:focus:not([variant=flat]):after{border-radius:100px}:host([size=xs]) .wrapper:focus-visible,:host([size=xs]) .wrapper:focus{outline-width:1px;outline-offset:-2px}:host([rounded]) .textSlot{transition:opacity 300ms ease-in;opacity:1}:host([rounded][iconOnly]) .textSlot{opacity:0}:host([rounded][iconOnly]) .textWrapper{display:none}:host([rounded][iconOnly]) .auro-button{min-width:unset;padding:unset;width:var(--ds-size-600, 3rem)}[auro-loader]{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}`;
|
|
6113
|
+
|
|
6114
|
+
var colorCss$2$1 = i$5`[auro-loader]{color:var(--ds-auro-button-loader-color)}.auro-button{-webkit-tap-highlight-color:var(--ds-auro-button-tap-color);color:var(--ds-auro-button-text-color);background-color:var(--ds-auro-button-container-color);background-image:linear-gradient(var(--ds-auro-button-container-image), var(--ds-auro-button-container-image));border-color:var(--ds-auro-button-border-color)}.auro-button:not([variant=secondary]):not([variant=tertiary]):focus-visible{outline-color:var(--ds-auro-button-border-inset-color)}.auro-button:not([ondark]):active:not(:disabled),.auro-button:not([ondark]):hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-hover, #00274a);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-hover, #00274a);--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-hover, #00274a)}.auro-button:not([ondark]):disabled{--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-disabled, #acc9e2);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-disabled, #acc9e2);--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-disabled, #acc9e2)}.auro-button:not([ondark])[variant=secondary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background, #ffffff);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border, #01426a);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-secondary-text, #01426a)}.auro-button:not([ondark])[variant=secondary]:active:not(:disabled),.auro-button:not([ondark])[variant=secondary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-hover, #f2f2f2);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-hover, #f2f2f2);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-hover, #00274a);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text-hover, #00274a)}.auro-button:not([ondark])[variant=secondary]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=secondary]:disabled{--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-disabled, #f7f7f7);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-disabled, #f7f7f7);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-disabled, #cfe0ef);--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=tertiary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background, rgba(0, 0, 0, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background, rgba(0, 0, 0, 0.05));--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-tertiary-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-tertiary-text, #01426a)}.auro-button:not([ondark])[variant=tertiary]:active:not(:disabled),.auro-button:not([ondark])[variant=tertiary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-hover, rgba(0, 0, 0, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-hover, rgba(0, 0, 0, 0.1));--ds-auro-button-border-color:transparent}.auro-button:not([ondark])[variant=tertiary]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=tertiary]:disabled{--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=ghost]{--ds-auro-button-container-color:transparent;--ds-auro-button-container-image:transparent;--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-ghost-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-ghost-text, #01426a)}.auro-button:not([ondark])[variant=ghost]:active:not(:disabled),.auro-button:not([ondark])[variant=ghost]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-ghost-background-hover, rgba(0, 0, 0, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-ghost-background-hover, rgba(0, 0, 0, 0.05));--ds-auro-button-border-color:transparent}.auro-button:not([ondark])[variant=ghost]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=ghost]:disabled{--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=flat]{color:var(--ds-advanced-color-button-flat-text, #676767);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:active:not(:disabled),.auro-button:not([ondark])[variant=flat]:hover:not(:disabled){color:var(--ds-advanced-color-button-flat-text-hover, #525252);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:disabled{color:var(--ds-advanced-color-button-flat-text-disabled, #d0d0d0);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button[ondark]{--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a)}.auro-button[ondark]:active:not(:disabled),.auro-button[ondark]:hover:not(:disabled){--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse-hover, #ebf3f9);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse-hover, #ebf3f9);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse-hover, #ebf3f9)}.auro-button[ondark]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button[ondark]:disabled{--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=secondary]{--ds-auro-button-container-color:transparent;--ds-auro-button-container-image:transparent;--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-inverse, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-secondary-text-inverse, #ffffff)}.auro-button[ondark][variant=secondary]:active:not(:disabled),.auro-button[ondark][variant=secondary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-inverse-hover, rgba(255, 255, 255, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-inverse-hover, rgba(255, 255, 255, 0.1))}.auro-button[ondark][variant=secondary]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=secondary]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-inverse-disabled, #dddddd)}.auro-button[ondark][variant=tertiary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-inverse, rgba(255, 255, 255, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-inverse, rgba(255, 255, 255, 0.05));--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-tertiary-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-tertiary-text-inverse, #ffffff)}.auro-button[ondark][variant=tertiary]:active:not(:disabled),.auro-button[ondark][variant=tertiary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-inverse-hover, rgba(255, 255, 255, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-inverse-hover, rgba(255, 255, 255, 0.1))}.auro-button[ondark][variant=tertiary]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=tertiary]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=ghost]{--ds-auro-button-container-color:transparent;--ds-auro-button-container-image:transparent;--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-ghost-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-ghost-text-inverse, #ffffff)}.auro-button[ondark][variant=ghost]:active:not(:disabled),.auro-button[ondark][variant=ghost]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-ghost-background-inverse-hover, rgba(255, 255, 255, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-ghost-background-inverse-hover, rgba(255, 255, 255, 0.05))}.auro-button[ondark][variant=ghost]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=ghost]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=flat]{color:var(--ds-advanced-color-button-flat-text-inverse, #ffffff);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:active:not(:disabled),.auro-button[ondark][variant=flat]:hover:not(:disabled){color:var(--ds-advanced-color-button-flat-text-inverse-hover, #adadad);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:disabled{color:var(--ds-advanced-color-button-flat-text-inverse-disabled, #7e8894);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}`;
|
|
6115
|
+
|
|
6116
|
+
var tokensCss$2$1 = i$5`:host(:not([onDark])){--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background, #01426a);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text, #ffffff);--ds-auro-button-tap-color:transparent}:host([onDark]){--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a);--ds-auro-button-tap-color:transparent}`;
|
|
6117
|
+
|
|
6118
|
+
var shapeSize = i$5`.shape-rounded-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:6px;overflow:hidden;font-size:18px}.shape-rounded-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:6px;overflow:hidden;font-size:18px}.shape-rounded-md{min-height:44px;max-height:44px;border-style:solid;border-radius:6px;overflow:hidden;font-size:16px}.shape-rounded-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:6px;overflow:hidden;font-size:14px}.shape-rounded-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:4px;overflow:hidden;font-size:12px;outline-offset:-2px;outline-width:1px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:34px;overflow:hidden;font-size:18px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:34px 0 0 34px;overflow:hidden}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:0 34px 34px 0;overflow:hidden}.shape-pill-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:26px;overflow:hidden;font-size:18px}.shape-pill-left-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:26px 0 0 26px;overflow:hidden}.shape-pill-right-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:0 26px 26px 0;overflow:hidden}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-radius:22px;overflow:hidden}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-radius:22px 0 0 22px;overflow:hidden}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-radius:0 22px 22px 0;overflow:hidden;font-size:16px}.shape-pill-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:16px;overflow:hidden;font-size:14px}.shape-pill-left-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:16px 0 0 16px;overflow:hidden}.shape-pill-right-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:0 16px 16px 0;overflow:hidden}.shape-pill-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:10px;overflow:hidden;font-size:12px;outline-offset:-2px;outline-width:1px}.shape-pill-left-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:10px 0 0 10px;overflow:hidden;outline-offset:-2px;outline-width:1px}.shape-pill-right-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:0 10px 10px 0;overflow:hidden;outline-offset:-2px;outline-width:1px}.shape-circle-xl{min-height:68px;max-height:68px;min-width:68px;max-width:68px;border-style:solid;border-radius:34px;overflow:hidden;padding:0}.shape-circle-lg{min-height:52px;max-height:52px;min-width:52px;max-width:52px;border-style:solid;border-radius:26px;overflow:hidden;padding:0}.shape-circle-md{min-height:44px;max-height:44px;min-width:44px;max-width:44px;border-style:solid;border-radius:22px;overflow:hidden;padding:0}.shape-circle-sm{min-height:32px;max-height:32px;min-width:32px;max-width:32px;border-style:solid;border-radius:16px;overflow:hidden;padding:0}.shape-circle-xs{min-height:20px;max-height:20px;min-width:20px;max-width:20px;border-style:solid;border-radius:10px;overflow:hidden;padding:0;outline-offset:-2px;outline-width:1px}`;
|
|
6119
|
+
|
|
6120
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6121
|
+
// See LICENSE in the project root for license information.
|
|
6122
|
+
|
|
6123
|
+
// ---------------------------------------------------------------------
|
|
6124
|
+
|
|
6125
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
6126
|
+
|
|
6127
|
+
let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
6128
|
+
|
|
6129
|
+
/* eslint-disable jsdoc/require-param */
|
|
6130
|
+
|
|
6131
|
+
/**
|
|
6132
|
+
* This will register a new custom element with the browser.
|
|
6133
|
+
* @param {String} name - The name of the custom element.
|
|
6134
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
6135
|
+
* @returns {void}
|
|
6136
|
+
*/
|
|
6137
|
+
registerComponent(name, componentClass) {
|
|
6138
|
+
if (!customElements.get(name)) {
|
|
6139
|
+
customElements.define(name, class extends componentClass {});
|
|
6140
|
+
}
|
|
6141
|
+
}
|
|
6142
|
+
|
|
6143
|
+
/**
|
|
6144
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
6145
|
+
* @returns {void}
|
|
6146
|
+
*/
|
|
6147
|
+
closestElement(
|
|
6148
|
+
selector, // selector like in .closest()
|
|
6149
|
+
base = this, // extra functionality to skip a parent
|
|
6150
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
6151
|
+
!el || el === document || el === window
|
|
6152
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
6153
|
+
: found
|
|
6154
|
+
? found // found a selector INside this element
|
|
6155
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
6156
|
+
) {
|
|
6157
|
+
return __Closest(base);
|
|
6158
|
+
}
|
|
6159
|
+
/* eslint-enable jsdoc/require-param */
|
|
6160
|
+
|
|
6161
|
+
/**
|
|
6162
|
+
* If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
|
|
6163
|
+
* @param {Object} elem - The element to check.
|
|
6164
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
6165
|
+
* @returns {void}
|
|
6166
|
+
*/
|
|
6167
|
+
handleComponentTagRename(elem, tagName) {
|
|
6168
|
+
const tag = tagName.toLowerCase();
|
|
6169
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6170
|
+
|
|
6171
|
+
if (elemTag !== tag) {
|
|
6172
|
+
elem.setAttribute(tag, true);
|
|
6173
|
+
}
|
|
6174
|
+
}
|
|
6175
|
+
|
|
6176
|
+
/**
|
|
6177
|
+
* Validates if an element is a specific Auro component.
|
|
6178
|
+
* @param {Object} elem - The element to validate.
|
|
6179
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
6180
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
6181
|
+
*/
|
|
6182
|
+
elementMatch(elem, tagName) {
|
|
6183
|
+
const tag = tagName.toLowerCase();
|
|
6184
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6185
|
+
|
|
6186
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
6187
|
+
}
|
|
6188
|
+
};
|
|
6189
|
+
|
|
6190
|
+
var styleCss$2$1 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host,:host>span{position:relative}:host{width:2rem;height:2rem;display:inline-block;font-size:0}:host>span{position:absolute;display:inline-block;float:none;top:0;left:0;width:2rem;height:2rem;border-radius:100%;border-style:solid;border-width:0}:host([xs]),:host([xs])>span{width:1.2rem;height:1.2rem}:host([sm]),:host([sm])>span{width:3rem;height:3rem}:host([md]),:host([md])>span{width:5rem;height:5rem}:host([lg]),:host([lg])>span{width:8rem;height:8rem}:host{--margin:0.375rem;--margin-xs:0.2rem;--margin-sm:0.5rem;--margin-md:0.75rem;--margin-lg:1rem}:host([pulse]),:host([pulse])>span{position:relative}:host([pulse]){width:calc(3rem + var(--margin)*6);height:1.5rem}:host([pulse])>span{width:1rem;height:1rem;margin:var(--margin);animation:pulse 1.5s ease infinite}:host([pulse][xs]){width:calc(2.55rem + var(--margin-xs)*6);height:1.55rem}:host([pulse][xs])>span{margin:var(--margin-xs);width:.65rem;height:.65rem}:host([pulse][sm]){width:calc(6rem + var(--margin-sm)*6);height:2.5rem}:host([pulse][sm])>span{margin:var(--margin-sm);width:2rem;height:2rem}:host([pulse][md]){width:calc(9rem + var(--margin-md)*6);height:3.5rem}:host([pulse][md])>span{margin:var(--margin-md);width:3rem;height:3rem}:host([pulse][lg]){width:calc(15rem + var(--margin-lg)*6);height:5.5rem}:host([pulse][lg])>span{margin:var(--margin-lg);width:5rem;height:5rem}:host([pulse])>span:nth-child(1){animation-delay:-400ms}:host([pulse])>span:nth-child(2){animation-delay:-200ms}:host([pulse])>span:nth-child(3){animation-delay:0ms}@keyframes pulse{0%,100%{opacity:.1;transform:scale(0.9)}50%{opacity:1;transform:scale(1.1)}}:host([orbit]),:host([orbit])>span{opacity:1}:host([orbit])>span{border-width:5px}:host([orbit])>span:nth-child(2){animation:orbit 2s linear infinite}:host([orbit][sm])>span{border-width:8px}:host([orbit][md])>span{border-width:13px}:host([orbit][lg])>span{border-width:21px}@keyframes orbit{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}:host([ringworm])>svg{animation:rotate 2s linear infinite;height:100%;width:100%;stroke:currentcolor;stroke-width:8}:host([ringworm]) .path{stroke-dashoffset:0;animation:ringworm 1.5s ease-in-out infinite;stroke-linecap:round}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes ringworm{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}:host([laser]){position:static;width:100%;display:block;height:0;overflow:hidden;font-size:unset}:host([laser])>span{position:fixed;width:100%;height:.25rem;border-radius:0;z-index:100}:host([laser])>span:nth-child(1){border-color:currentcolor;opacity:.25}:host([laser])>span:nth-child(2){border-color:currentcolor;animation:laser 2s linear infinite;opacity:1;width:50%}:host([laser][sm])>span:nth-child(2){width:20%}:host([laser][md])>span:nth-child(2){width:30%}:host([laser][lg])>span:nth-child(2){width:50%;animation-duration:1.5s}:host([laser][xl])>span:nth-child(2){width:80%;animation-duration:1.5s}@keyframes laser{0%{left:-100%}100%{left:110%}}:host>.no-animation{display:none}@media(prefers-reduced-motion: reduce){:host{display:flex;align-items:center;justify-content:center;font-size:1rem}:host>span{opacity:1}:host>.loader{display:none}:host>.no-animation{display:block}}`;
|
|
6191
|
+
|
|
6192
|
+
var colorCss$1$1 = i$5`:host{color:var(--ds-auro-loader-color)}:host>span{background-color:var(--ds-auro-loader-background-color);border-color:var(--ds-auro-loader-border-color)}:host([onlight]){--ds-auro-loader-color:var(--ds-basic-color-brand-primary, #01426a)}:host([ondark]){--ds-auro-loader-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([orbit])>span{--ds-auro-loader-background-color:transparent}:host([orbit])>span:nth-child(1){--ds-auro-loader-border-color:currentcolor;opacity:.25}:host([orbit])>span:nth-child(2){--ds-auro-loader-border-color:currentcolor;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}`;
|
|
6193
|
+
|
|
6194
|
+
var tokensCss$1$1 = i$5`:host{--ds-auro-loader-background-color:currentcolor;--ds-auro-loader-border-color:currentcolor;--ds-auro-loader-color:currentcolor}`;
|
|
6195
|
+
|
|
6196
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6197
|
+
// See LICENSE in the project root for license information.
|
|
6198
|
+
|
|
6199
|
+
|
|
6200
|
+
class AuroLoader extends i$2 {
|
|
6201
|
+
constructor() {
|
|
6202
|
+
super();
|
|
6203
|
+
|
|
6204
|
+
/**
|
|
6205
|
+
* @private
|
|
6206
|
+
*/
|
|
6207
|
+
this.keys = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
6208
|
+
|
|
6209
|
+
/**
|
|
6210
|
+
* @private
|
|
6211
|
+
*/
|
|
6212
|
+
this.mdCount = 3;
|
|
6213
|
+
|
|
6214
|
+
/**
|
|
6215
|
+
* @private
|
|
6216
|
+
*/
|
|
6217
|
+
this.smCount = 2;
|
|
6218
|
+
|
|
6219
|
+
/**
|
|
6220
|
+
* @private
|
|
6221
|
+
*/
|
|
6222
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2();
|
|
6223
|
+
|
|
6224
|
+
this.orbit = false;
|
|
6225
|
+
this.ringworm = false;
|
|
6226
|
+
this.laser = false;
|
|
6227
|
+
this.pulse = false;
|
|
6228
|
+
}
|
|
6229
|
+
|
|
6230
|
+
// function to define props used within the scope of this component
|
|
6231
|
+
static get properties() {
|
|
6232
|
+
return {
|
|
6233
|
+
|
|
6234
|
+
/**
|
|
6235
|
+
* Sets loader to laser type.
|
|
6236
|
+
*/
|
|
6237
|
+
laser: {
|
|
6238
|
+
type: Boolean,
|
|
6239
|
+
reflect: true
|
|
6240
|
+
},
|
|
6241
|
+
|
|
6242
|
+
/**
|
|
6243
|
+
* Sets loader to orbit type.
|
|
6244
|
+
*/
|
|
6245
|
+
orbit: {
|
|
6246
|
+
type: Boolean,
|
|
6247
|
+
reflect: true
|
|
6248
|
+
},
|
|
6249
|
+
|
|
6250
|
+
/**
|
|
6251
|
+
* Sets loader to pulse type.
|
|
6252
|
+
*/
|
|
6253
|
+
pulse: {
|
|
6254
|
+
type: Boolean,
|
|
6255
|
+
reflect: true
|
|
6256
|
+
},
|
|
6257
|
+
|
|
6258
|
+
/**
|
|
6259
|
+
* Sets loader to ringworm type.
|
|
6260
|
+
*/
|
|
6261
|
+
ringworm: {
|
|
6262
|
+
type: Boolean,
|
|
6263
|
+
reflect: true
|
|
6264
|
+
}
|
|
6265
|
+
};
|
|
6266
|
+
}
|
|
6267
|
+
|
|
6268
|
+
static get styles() {
|
|
6269
|
+
return [
|
|
6270
|
+
i$5`${styleCss$2$1}`,
|
|
6271
|
+
i$5`${colorCss$1$1}`,
|
|
6272
|
+
i$5`${tokensCss$1$1}`
|
|
6273
|
+
];
|
|
6274
|
+
}
|
|
6275
|
+
|
|
6276
|
+
/**
|
|
6277
|
+
* This will register this element with the browser.
|
|
6278
|
+
* @param {string} [name="auro-loader"] - The name of element that you want to register to.
|
|
6279
|
+
*
|
|
6280
|
+
* @example
|
|
6281
|
+
* AuroLoader.register("custom-loader") // this will register this element to <custom-loader/>
|
|
6282
|
+
*
|
|
6283
|
+
*/
|
|
6284
|
+
static register(name = "auro-loader") {
|
|
6285
|
+
AuroLibraryRuntimeUtils$2.prototype.registerComponent(name, AuroLoader);
|
|
6286
|
+
}
|
|
6287
|
+
|
|
6288
|
+
firstUpdated() {
|
|
6289
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
6290
|
+
this.runtimeUtils.handleComponentTagRename(this, 'auro-loader');
|
|
6291
|
+
}
|
|
6292
|
+
|
|
6293
|
+
connectedCallback() {
|
|
6294
|
+
super.connectedCallback();
|
|
6295
|
+
}
|
|
6296
|
+
|
|
6297
|
+
/**
|
|
6298
|
+
* @private
|
|
6299
|
+
* @returns {Array} Numbered array for template map.
|
|
6300
|
+
*/
|
|
6301
|
+
defineTemplate() {
|
|
6302
|
+
let nodes = Array.from(Array(this.mdCount).keys());
|
|
6303
|
+
|
|
6304
|
+
if (this.orbit || this.laser) {
|
|
6305
|
+
nodes = Array.from(Array(this.smCount).keys());
|
|
6306
|
+
} else if (this.ringworm) {
|
|
6307
|
+
nodes = Array.from(Array(0).keys());
|
|
6308
|
+
}
|
|
6309
|
+
|
|
6310
|
+
return nodes;
|
|
6311
|
+
}
|
|
6312
|
+
|
|
6313
|
+
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
6314
|
+
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
6315
|
+
|
|
6316
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
6317
|
+
render() {
|
|
6318
|
+
return x`
|
|
6319
|
+
${this.defineTemplate().map((idx) => x`
|
|
6320
|
+
<span part="element" class="loader node-${idx}"></span>
|
|
6321
|
+
`)}
|
|
6322
|
+
|
|
6323
|
+
<div class="no-animation">Loading...</div>
|
|
6324
|
+
|
|
6325
|
+
${this.ringworm ? x`
|
|
6326
|
+
<svg part="element" class="circular" viewBox="25 25 50 50">
|
|
6327
|
+
<circle class="path" cx="50" cy="50" r="20" fill="none"/>
|
|
6328
|
+
</svg>`
|
|
6329
|
+
: ``
|
|
6330
|
+
}
|
|
6331
|
+
`;
|
|
6332
|
+
}
|
|
6333
|
+
}
|
|
6334
|
+
|
|
6335
|
+
var loaderVersion = '5.0.0';
|
|
6336
|
+
|
|
6337
|
+
/* eslint-disable max-lines, curly, jsdoc/no-undefined-types */
|
|
6338
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6339
|
+
// See LICENSE in the project root for license information.
|
|
6340
|
+
|
|
6341
|
+
|
|
6342
|
+
/**
|
|
6343
|
+
* @slot - Default slot for the text of the button.
|
|
6344
|
+
* @csspart button - Apply CSS to HTML5 button.
|
|
6345
|
+
* @csspart loader - Apply CSS to auro-loader.
|
|
6346
|
+
* @csspart text - Apply CSS to text slot.
|
|
6347
|
+
* @csspart icon - Apply CSS to icon slot.
|
|
6348
|
+
*/
|
|
6349
|
+
|
|
6350
|
+
/* eslint-disable lit/no-invalid-html, lit/binding-positions */
|
|
6351
|
+
|
|
6352
|
+
const ICON_ONLY_SHAPES = ['circle'];
|
|
6353
|
+
|
|
6354
|
+
/**
|
|
6355
|
+
* AuroButton is a custom element that provides a styled, accessible button with support for various states and form association.
|
|
6356
|
+
* It is designed to be flexible, supporting loading states, icon slots, and integration with HTML5 forms.
|
|
6357
|
+
* @property {'default', 'rounded', 'pill', 'circle'} shape - Defines the shape of the button.
|
|
6358
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'} size - Defines the size of the button.
|
|
6359
|
+
* @property {'primary', 'secondary', 'tertiary', 'ghost', 'flat'} variant - Sets the button variant.
|
|
6360
|
+
* @property {'submit', 'reset', 'button'} type - The type of button. Matches HTML5 Button Spec.
|
|
6361
|
+
* @property {boolean} onDark - Indicates if the button is rendered in dark mode.
|
|
6362
|
+
*/
|
|
6363
|
+
class AuroButton extends AuroElement$1 {
|
|
6364
|
+
|
|
6365
|
+
/**
|
|
6366
|
+
* Enables form association for this element.
|
|
6367
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals
|
|
6368
|
+
* @returns {boolean} - Returns true to enable form association.
|
|
6369
|
+
*/
|
|
6370
|
+
static get formAssociated() {
|
|
6371
|
+
return true;
|
|
6372
|
+
}
|
|
6373
|
+
|
|
6374
|
+
constructor() {
|
|
6375
|
+
super();
|
|
6376
|
+
this.autofocus = false;
|
|
6377
|
+
this.disabled = false;
|
|
6378
|
+
this.loading = false;
|
|
6379
|
+
this.size = "md";
|
|
6380
|
+
this.shape = "rounded";
|
|
6381
|
+
this.onDark = false;
|
|
6382
|
+
this.fluid = false;
|
|
6383
|
+
this.loadingText = this.loadingText || 'Loading...';
|
|
6384
|
+
|
|
6385
|
+
// Support for HTML5 forms
|
|
6386
|
+
if (typeof this.attachInternals === 'function') {
|
|
6387
|
+
this.internals = this.attachInternals();
|
|
6388
|
+
} else {
|
|
6389
|
+
this.internals = null;
|
|
6390
|
+
|
|
6391
|
+
// eslint-disable-next-line no-console
|
|
6392
|
+
console.warn('This browser does not support form association features. Some form-related functionality may not work as expected. Consider using a polyfill or handling click events manually.');
|
|
6393
|
+
}
|
|
6394
|
+
|
|
6395
|
+
/**
|
|
6396
|
+
* Generate unique names for dependency components.
|
|
6397
|
+
*/
|
|
6398
|
+
const versioning = new AuroDependencyVersioning();
|
|
6399
|
+
|
|
6400
|
+
/**
|
|
6401
|
+
* @private
|
|
6402
|
+
*/
|
|
6403
|
+
this.loaderTag = versioning.generateTag('auro-loader', loaderVersion, AuroLoader);
|
|
6404
|
+
|
|
6405
|
+
/**
|
|
6406
|
+
* @private
|
|
6407
|
+
*/
|
|
6408
|
+
this.buttonHref = undefined;
|
|
6409
|
+
|
|
6410
|
+
/**
|
|
6411
|
+
* @private
|
|
6412
|
+
*/
|
|
6413
|
+
this.buttonTarget = undefined;
|
|
6414
|
+
|
|
6415
|
+
/**
|
|
6416
|
+
* @private
|
|
6417
|
+
*/
|
|
6418
|
+
this.buttonRel = undefined;
|
|
6419
|
+
}
|
|
6420
|
+
|
|
6421
|
+
static get styles() {
|
|
6422
|
+
return [
|
|
6423
|
+
tokensCss$2$1,
|
|
6424
|
+
styleCss$3$1,
|
|
6425
|
+
colorCss$2$1,
|
|
6426
|
+
shapeSize
|
|
6427
|
+
];
|
|
6428
|
+
}
|
|
6429
|
+
|
|
6430
|
+
static get properties() {
|
|
6431
|
+
return {
|
|
6432
|
+
|
|
6433
|
+
...super.properties,
|
|
6434
|
+
|
|
6435
|
+
/**
|
|
6436
|
+
* Override layout since it isn't used in this component.
|
|
6437
|
+
* @private
|
|
6438
|
+
*/
|
|
6439
|
+
layout: {
|
|
6440
|
+
type: Boolean,
|
|
6441
|
+
attribute: false,
|
|
6442
|
+
reflect: false
|
|
6443
|
+
},
|
|
6444
|
+
|
|
6445
|
+
/**
|
|
6446
|
+
* This Boolean attribute lets you specify that the button should have input focus when the page loads, unless overridden by the user.
|
|
6447
|
+
*/
|
|
6448
|
+
autofocus: {
|
|
6449
|
+
type: Boolean,
|
|
6450
|
+
reflect: true
|
|
6451
|
+
},
|
|
6452
|
+
|
|
6453
|
+
/**
|
|
6454
|
+
* If set to true, button will become disabled and not allow for interactions.
|
|
6455
|
+
*/
|
|
6456
|
+
disabled: {
|
|
6457
|
+
type: Boolean,
|
|
6458
|
+
reflect: true
|
|
6459
|
+
},
|
|
6460
|
+
|
|
6461
|
+
/**
|
|
6462
|
+
* Alters the shape of the button to be full width of its parent container.
|
|
6463
|
+
*/
|
|
6464
|
+
fluid: {
|
|
6465
|
+
type: Boolean,
|
|
6466
|
+
reflect: true
|
|
6467
|
+
},
|
|
6468
|
+
|
|
6469
|
+
/**
|
|
6470
|
+
* If set to true button text will be replaced with `auro-loader` and become disabled.
|
|
6471
|
+
*/
|
|
6472
|
+
loading: {
|
|
6473
|
+
type: Boolean,
|
|
6474
|
+
reflect: true
|
|
6475
|
+
},
|
|
6476
|
+
|
|
6477
|
+
/**
|
|
6478
|
+
* Sets custom loading text for the `aria-label` on a button in loading state. If not set, the default value of "Loading..." will be used.
|
|
6479
|
+
*/
|
|
6480
|
+
loadingText: {
|
|
6481
|
+
type: String
|
|
6482
|
+
},
|
|
6483
|
+
|
|
6484
|
+
/**
|
|
6485
|
+
* Populates `tabindex` to define the focusable sequence in keyboard navigation.
|
|
6486
|
+
*/
|
|
6487
|
+
tIndex: {
|
|
6488
|
+
type: String,
|
|
6489
|
+
reflect: true
|
|
6490
|
+
},
|
|
6491
|
+
|
|
6492
|
+
/**
|
|
6493
|
+
* Populates `tabindex` to define the focusable sequence in keyboard navigation.
|
|
6494
|
+
* Must be used with "." to ensure the host element does not retain a reference to the `tabindex` attribute.
|
|
6495
|
+
* Example: `<auro-button .tabindex="${this.disabled ? '-1' : '0'}"></auro-button>`
|
|
6496
|
+
*/
|
|
6497
|
+
tabindex: {
|
|
6498
|
+
type: String,
|
|
6499
|
+
reflect: false
|
|
6500
|
+
},
|
|
6501
|
+
|
|
6502
|
+
/**
|
|
6503
|
+
* Sets title attribute. The information is most often shown as a tooltip text when the mouse moves over the element.
|
|
6504
|
+
*/
|
|
6505
|
+
title: {
|
|
6506
|
+
type: String,
|
|
6507
|
+
reflect: true
|
|
6508
|
+
},
|
|
6509
|
+
|
|
6510
|
+
/**
|
|
6511
|
+
* The type of the button. Possible values are: `submit`, `reset`, `button`.
|
|
6512
|
+
*/
|
|
6513
|
+
type: {
|
|
6514
|
+
type: String,
|
|
6515
|
+
reflect: true
|
|
6516
|
+
},
|
|
6517
|
+
|
|
6518
|
+
/**
|
|
6519
|
+
* Defines the value associated with the button which is submitted with the form data.
|
|
6520
|
+
*/
|
|
6521
|
+
value: {
|
|
6522
|
+
type: String,
|
|
6523
|
+
reflect: true
|
|
6524
|
+
},
|
|
6525
|
+
|
|
6526
|
+
/**
|
|
6527
|
+
* Sets button variant option.
|
|
6528
|
+
* @default primary
|
|
6529
|
+
*/
|
|
6530
|
+
variant: {
|
|
6531
|
+
type: String,
|
|
6532
|
+
reflect: true
|
|
6533
|
+
},
|
|
6534
|
+
|
|
6535
|
+
/**
|
|
6536
|
+
* @private
|
|
6537
|
+
*/
|
|
6538
|
+
buttonHref: {
|
|
6539
|
+
type: String,
|
|
6540
|
+
},
|
|
6541
|
+
|
|
6542
|
+
/**
|
|
6543
|
+
* @private
|
|
6544
|
+
*/
|
|
6545
|
+
buttonTarget: {
|
|
6546
|
+
type: String,
|
|
6547
|
+
},
|
|
5317
6548
|
|
|
5318
|
-
|
|
6549
|
+
/**
|
|
6550
|
+
* @private
|
|
6551
|
+
*/
|
|
6552
|
+
buttonRel: {
|
|
6553
|
+
type: String,
|
|
6554
|
+
},
|
|
6555
|
+
};
|
|
6556
|
+
}
|
|
5319
6557
|
|
|
5320
6558
|
/**
|
|
5321
|
-
* This will register
|
|
5322
|
-
* @param {
|
|
5323
|
-
*
|
|
5324
|
-
* @
|
|
6559
|
+
* This will register this element with the browser.
|
|
6560
|
+
* @param {string} [name="auro-button"] - The name of element that you want to register to.
|
|
6561
|
+
*
|
|
6562
|
+
* @example
|
|
6563
|
+
* AuroButton.register("custom-button") // this will register this element to <custom-button/>
|
|
6564
|
+
*
|
|
5325
6565
|
*/
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
customElements.define(name, class extends componentClass {});
|
|
5329
|
-
}
|
|
6566
|
+
static register(name = "auro-button") {
|
|
6567
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroButton);
|
|
5330
6568
|
}
|
|
5331
6569
|
|
|
5332
6570
|
/**
|
|
5333
|
-
*
|
|
6571
|
+
* Internal method to apply focus to the HTML5 button.
|
|
6572
|
+
* @private
|
|
5334
6573
|
* @returns {void}
|
|
5335
6574
|
*/
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
base = this, // extra functionality to skip a parent
|
|
5339
|
-
__Closest = (el, found = el && el.closest(selector)) =>
|
|
5340
|
-
!el || el === document || el === window
|
|
5341
|
-
? null // standard .closest() returns null for non-found selectors also
|
|
5342
|
-
: found
|
|
5343
|
-
? found // found a selector INside this element
|
|
5344
|
-
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
5345
|
-
) {
|
|
5346
|
-
return __Closest(base);
|
|
6575
|
+
focus() {
|
|
6576
|
+
this.renderRoot.querySelector('button').focus();
|
|
5347
6577
|
}
|
|
5348
|
-
/* eslint-enable jsdoc/require-param */
|
|
5349
6578
|
|
|
5350
6579
|
/**
|
|
5351
|
-
*
|
|
5352
|
-
* @
|
|
5353
|
-
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
6580
|
+
* Submits the form that this button is associated with.
|
|
6581
|
+
* @private
|
|
5354
6582
|
* @returns {void}
|
|
5355
6583
|
*/
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
if (elemTag !== tag) {
|
|
5361
|
-
elem.setAttribute(tag, true);
|
|
6584
|
+
surfaceSubmitEvent() {
|
|
6585
|
+
if (this.form) {
|
|
6586
|
+
this.form.requestSubmit();
|
|
5362
6587
|
}
|
|
5363
6588
|
}
|
|
5364
6589
|
|
|
5365
6590
|
/**
|
|
5366
|
-
*
|
|
5367
|
-
* @
|
|
5368
|
-
* @
|
|
5369
|
-
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
6591
|
+
* Returns the form element that this button is associated with.
|
|
6592
|
+
* @private
|
|
6593
|
+
* @returns {HTMLFormElement | null}
|
|
5370
6594
|
*/
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
const elemTag = elem.tagName.toLowerCase();
|
|
5374
|
-
|
|
5375
|
-
return elemTag === tag || elem.hasAttribute(tag);
|
|
6595
|
+
get form() {
|
|
6596
|
+
return this.internals ? this.internals.form : null;
|
|
5376
6597
|
}
|
|
5377
|
-
};
|
|
5378
6598
|
|
|
5379
|
-
|
|
5380
|
-
|
|
6599
|
+
/**
|
|
6600
|
+
* @private
|
|
6601
|
+
* @returns {Boolean}
|
|
6602
|
+
*/
|
|
6603
|
+
get hideText() {
|
|
6604
|
+
return ICON_ONLY_SHAPES.includes(this.shape);
|
|
6605
|
+
}
|
|
5381
6606
|
|
|
6607
|
+
/**
|
|
6608
|
+
* Returns the current value of the projected `aria-label` attribute or undefined if not set.
|
|
6609
|
+
* @returns {string | undefined}
|
|
6610
|
+
* @private
|
|
6611
|
+
*/
|
|
6612
|
+
get currentAriaLabel() {
|
|
6613
|
+
if (!this.attributeWatcher) return undefined;
|
|
5382
6614
|
|
|
5383
|
-
|
|
6615
|
+
const ariaLabel = this.attributeWatcher.getObservedAttribute("aria-label");
|
|
6616
|
+
return ariaLabel || undefined;
|
|
6617
|
+
}
|
|
5384
6618
|
|
|
5385
6619
|
/**
|
|
5386
|
-
*
|
|
6620
|
+
* Returns the current value of the projected `aria-labelledby` attribute or undefined if not set.
|
|
6621
|
+
* @returns {string | undefined}
|
|
5387
6622
|
* @private
|
|
5388
|
-
* @param {string} baseName - Defines the first part of the unique element name.
|
|
5389
|
-
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
5390
|
-
* @returns {string} - Unique string to be used for naming.
|
|
5391
6623
|
*/
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
result += '-';
|
|
5396
|
-
result += version.replace(/[.]/g, '_');
|
|
6624
|
+
get currentAriaLabelledBy() {
|
|
6625
|
+
if (!this.attributeWatcher) return undefined;
|
|
5397
6626
|
|
|
5398
|
-
|
|
6627
|
+
const ariaLabelledBy = this.attributeWatcher.getObservedAttribute("aria-labelledby");
|
|
6628
|
+
return ariaLabelledBy || undefined;
|
|
5399
6629
|
}
|
|
5400
6630
|
|
|
5401
6631
|
/**
|
|
5402
|
-
*
|
|
5403
|
-
* @
|
|
5404
|
-
* @
|
|
5405
|
-
* @returns {string} - Unique string to be used for naming.
|
|
6632
|
+
* Renders the default layout for the button.
|
|
6633
|
+
* @returns {TemplateResult}
|
|
6634
|
+
* @private
|
|
5406
6635
|
*/
|
|
5407
|
-
|
|
5408
|
-
const
|
|
5409
|
-
|
|
6636
|
+
renderLayoutDefault() {
|
|
6637
|
+
const classes = {
|
|
6638
|
+
"util_insetLg--squish": true,
|
|
6639
|
+
"auro-button": true,
|
|
6640
|
+
"icon-only": this.hideText,
|
|
6641
|
+
wrapper: true,
|
|
6642
|
+
loading: this.loading,
|
|
6643
|
+
};
|
|
5410
6644
|
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
}
|
|
6645
|
+
const tag = this.buttonHref ? i`a` : i`button`;
|
|
6646
|
+
const part = this.buttonHref ? 'link' : 'button';
|
|
5414
6647
|
|
|
5415
|
-
return
|
|
6648
|
+
return u`
|
|
6649
|
+
<${tag}
|
|
6650
|
+
part="${part}"
|
|
6651
|
+
aria-label="${o(this.loading ? this.loadingText : this.currentAriaLabel || undefined)}"
|
|
6652
|
+
aria-labelledby="${o(this.loading ? undefined : this.currentAriaLabelledBy || undefined)}"
|
|
6653
|
+
tabindex="${o(this.tIndex || this.tabindex)}"
|
|
6654
|
+
?autofocus="${this.autofocus}"
|
|
6655
|
+
class=${e(classes)}
|
|
6656
|
+
?disabled="${this.disabled || this.loading}"
|
|
6657
|
+
?onDark="${this.onDark}"
|
|
6658
|
+
title="${o(this.title ? this.title : undefined)}"
|
|
6659
|
+
name="${o(this.name ? this.name : undefined)}"
|
|
6660
|
+
type="${o(this.type ? this.type : undefined)}"
|
|
6661
|
+
variant="${o(this.variant ? this.variant : undefined)}"
|
|
6662
|
+
.value="${o(this.value ? this.value : undefined)}"
|
|
6663
|
+
@click="${this.type === 'submit' ? this.surfaceSubmitEvent : undefined}"
|
|
6664
|
+
href="${o(this.buttonHref || undefined)}"
|
|
6665
|
+
target="${o(this.buttonTarget || undefined)}"
|
|
6666
|
+
rel="${o(this.buttonRel || undefined)}"
|
|
6667
|
+
>
|
|
6668
|
+
${o(this.loading ? u`<${this.loaderTag} pulse part="loader"></${this.loaderTag}>` : undefined)}
|
|
6669
|
+
|
|
6670
|
+
<span class="contentWrapper">
|
|
6671
|
+
<span class="textSlot" part="text">
|
|
6672
|
+
<slot></slot>
|
|
6673
|
+
</span>
|
|
6674
|
+
</span>
|
|
6675
|
+
</${tag}>
|
|
6676
|
+
`;
|
|
6677
|
+
}
|
|
6678
|
+
|
|
6679
|
+
/**
|
|
6680
|
+
* Renders the layout of the button.
|
|
6681
|
+
* @returns {TemplateResult}
|
|
6682
|
+
* @private
|
|
6683
|
+
*/
|
|
6684
|
+
renderLayout() {
|
|
6685
|
+
return this.renderLayoutDefault();
|
|
5416
6686
|
}
|
|
5417
6687
|
}
|
|
5418
6688
|
|
|
6689
|
+
var buttonVersion = '11.2.1';
|
|
6690
|
+
|
|
5419
6691
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5420
6692
|
// See LICENSE in the project root for license information.
|
|
5421
6693
|
|
|
@@ -5426,7 +6698,7 @@ class AuroDependencyVersioning {
|
|
|
5426
6698
|
* @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
|
|
5427
6699
|
*/
|
|
5428
6700
|
|
|
5429
|
-
let AuroElement$
|
|
6701
|
+
let AuroElement$2 = class AuroElement extends i$2 {
|
|
5430
6702
|
|
|
5431
6703
|
// function to define props used within the scope of this component
|
|
5432
6704
|
static get properties() {
|
|
@@ -5494,7 +6766,7 @@ var styleCss$1$1 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}
|
|
|
5494
6766
|
*/
|
|
5495
6767
|
|
|
5496
6768
|
// build the component class
|
|
5497
|
-
let BaseIcon$1 = class BaseIcon extends AuroElement$
|
|
6769
|
+
let BaseIcon$1 = class BaseIcon extends AuroElement$2 {
|
|
5498
6770
|
constructor() {
|
|
5499
6771
|
super();
|
|
5500
6772
|
this.onDark = false;
|
|
@@ -5577,7 +6849,7 @@ var colorCss$4 = i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){
|
|
|
5577
6849
|
|
|
5578
6850
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
5579
6851
|
|
|
5580
|
-
let AuroLibraryRuntimeUtils$
|
|
6852
|
+
let AuroLibraryRuntimeUtils$1$1 = class AuroLibraryRuntimeUtils {
|
|
5581
6853
|
|
|
5582
6854
|
/* eslint-disable jsdoc/require-param */
|
|
5583
6855
|
|
|
@@ -5659,7 +6931,7 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5659
6931
|
*/
|
|
5660
6932
|
privateDefaults() {
|
|
5661
6933
|
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
5662
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
6934
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$1$1();
|
|
5663
6935
|
}
|
|
5664
6936
|
|
|
5665
6937
|
// function to define props used within the scope of this component
|
|
@@ -5741,7 +7013,7 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5741
7013
|
*
|
|
5742
7014
|
*/
|
|
5743
7015
|
static register(name = "auro-icon") {
|
|
5744
|
-
AuroLibraryRuntimeUtils$
|
|
7016
|
+
AuroLibraryRuntimeUtils$1$1.prototype.registerComponent(name, AuroIcon);
|
|
5745
7017
|
}
|
|
5746
7018
|
|
|
5747
7019
|
connectedCallback() {
|
|
@@ -5762,8 +7034,12 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5762
7034
|
async firstUpdated() {
|
|
5763
7035
|
await super.firstUpdated();
|
|
5764
7036
|
|
|
5765
|
-
|
|
5766
|
-
|
|
7037
|
+
/**
|
|
7038
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
7039
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
7040
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
7041
|
+
*/
|
|
7042
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
5767
7043
|
const svgDesc = this.svg.querySelector('desc');
|
|
5768
7044
|
|
|
5769
7045
|
if (svgDesc) {
|
|
@@ -5807,7 +7083,77 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5807
7083
|
}
|
|
5808
7084
|
};
|
|
5809
7085
|
|
|
5810
|
-
var iconVersion$1 = '8.0.
|
|
7086
|
+
var iconVersion$1 = '8.0.4';
|
|
7087
|
+
|
|
7088
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
7089
|
+
// See LICENSE in the project root for license information.
|
|
7090
|
+
|
|
7091
|
+
// ---------------------------------------------------------------------
|
|
7092
|
+
|
|
7093
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
7094
|
+
|
|
7095
|
+
let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
7096
|
+
|
|
7097
|
+
/* eslint-disable jsdoc/require-param */
|
|
7098
|
+
|
|
7099
|
+
/**
|
|
7100
|
+
* This will register a new custom element with the browser.
|
|
7101
|
+
* @param {String} name - The name of the custom element.
|
|
7102
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
7103
|
+
* @returns {void}
|
|
7104
|
+
*/
|
|
7105
|
+
registerComponent(name, componentClass) {
|
|
7106
|
+
if (!customElements.get(name)) {
|
|
7107
|
+
customElements.define(name, class extends componentClass {});
|
|
7108
|
+
}
|
|
7109
|
+
}
|
|
7110
|
+
|
|
7111
|
+
/**
|
|
7112
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
7113
|
+
* @returns {void}
|
|
7114
|
+
*/
|
|
7115
|
+
closestElement(
|
|
7116
|
+
selector, // selector like in .closest()
|
|
7117
|
+
base = this, // extra functionality to skip a parent
|
|
7118
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
7119
|
+
!el || el === document || el === window
|
|
7120
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
7121
|
+
: found
|
|
7122
|
+
? found // found a selector INside this element
|
|
7123
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
7124
|
+
) {
|
|
7125
|
+
return __Closest(base);
|
|
7126
|
+
}
|
|
7127
|
+
/* eslint-enable jsdoc/require-param */
|
|
7128
|
+
|
|
7129
|
+
/**
|
|
7130
|
+
* If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
|
|
7131
|
+
* @param {Object} elem - The element to check.
|
|
7132
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
7133
|
+
* @returns {void}
|
|
7134
|
+
*/
|
|
7135
|
+
handleComponentTagRename(elem, tagName) {
|
|
7136
|
+
const tag = tagName.toLowerCase();
|
|
7137
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
7138
|
+
|
|
7139
|
+
if (elemTag !== tag) {
|
|
7140
|
+
elem.setAttribute(tag, true);
|
|
7141
|
+
}
|
|
7142
|
+
}
|
|
7143
|
+
|
|
7144
|
+
/**
|
|
7145
|
+
* Validates if an element is a specific Auro component.
|
|
7146
|
+
* @param {Object} elem - The element to validate.
|
|
7147
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
7148
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
7149
|
+
*/
|
|
7150
|
+
elementMatch(elem, tagName) {
|
|
7151
|
+
const tag = tagName.toLowerCase();
|
|
7152
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
7153
|
+
|
|
7154
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
7155
|
+
}
|
|
7156
|
+
};
|
|
5811
7157
|
|
|
5812
7158
|
var styleCss$5 = i$5`.heading{margin:1.75rem 0;letter-spacing:var(--ds-text-heading-default-spacing, -0.2px);font-weight:var(--ds-text-heading-default-weight, 500)}.heading--display{margin-top:0;font-size:var(--ds-text-heading-display-size-breakpoint-sm, 2.75rem);font-weight:var(--ds-text-heading-display-weight, 100);line-height:var(--ds-text-heading-display-height-breakpoint-sm, 3.375rem)}@media screen and (min-width: 768px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-md, 3rem);line-height:var(--ds-text-heading-display-height-breakpoint-md, 3.75rem)}}@media screen and (min-width: 1024px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-lg, 3.5rem);line-height:var(--ds-text-heading-display-height-breakpoint-lg, 4.25rem)}}.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-sm, 2rem);font-weight:var(--ds-text-heading-800-weight, 500);line-height:var(--ds-text-heading-800-height-breakpoint-sm, 2.375rem)}@media screen and (min-width: 768px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-md, 2.25rem);line-height:var(--ds-text-heading-800-height-breakpoint-md, 2.625rem)}}@media screen and (min-width: 1024px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-lg, 2.5rem);line-height:var(--ds-text-heading-800-height-breakpoint-lg, 3rem)}}.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-sm, 1.75rem);font-weight:var(--ds-text-heading-700-weight, 500);line-height:var(--ds-text-heading-700-height-breakpoint-sm, 2.125rem)}@media screen and (min-width: 768px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-md, 2rem);line-height:var(--ds-text-heading-700-height-breakpoint-md, 2.375rem)}}@media screen and (min-width: 1024px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-lg, 2.25rem);line-height:var(--ds-text-heading-700-height-breakpoint-lg, 2.75rem)}}.heading--600{margin:1rem 0;font-size:var(--ds-text-heading-600-size-breakpoint-sm, 1.625rem);font-weight:var(--ds-text-heading-600-weight, 300);line-height:var(--ds-text-heading-600-height-breakpoint-sm, 1.875rem)}@media screen and (min-width: 768px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-md, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-md, 2.125rem)}}@media screen and (min-width: 1024px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-lg, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-lg, 2.25rem)}}.heading--500{margin:1rem 0;font-size:var(--ds-text-heading-500-size-breakpoint-sm, 1.375rem);font-weight:var(--ds-text-heading-500-weight, 300);line-height:var(--ds-text-heading-500-height-breakpoint-sm, 1.625rem)}@media screen and (min-width: 768px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-md, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-md, 1.875rem)}}@media screen and (min-width: 1024px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-lg, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-lg, 2rem)}}.heading--400{margin:.75rem 0;font-size:var(--ds-text-heading-400-size, 1.25rem);font-weight:var(--ds-text-heading-400-weight, 300);line-height:var(--ds-text-heading-400-height, 1.625rem)}.heading--300{margin:.75rem 0;font-size:var(--ds-text-heading-300-size, 1.125rem);font-weight:var(--ds-text-heading-300-weight, 300);line-height:var(--ds-text-heading-300-height, 1.625rem)}:host([no-margin-block]) .heading{margin-block:0}.util_stackMarginnone--bottom{margin-bottom:0}.util_stackMargin25--bottom{margin-bottom:var(--ds-size-25, 0.125rem)}.util_stackMargin50--bottom{margin-bottom:var(--ds-size-50, 0.25rem)}.util_stackMargin100--bottom{margin-bottom:var(--ds-size-100, 0.5rem)}.util_stackMargin150--bottom{margin-bottom:var(--ds-size-150, 0.75rem)}.util_stackMargin200--bottom{margin-bottom:var(--ds-size-200, 1rem)}.util_stackMargin300--bottom{margin-bottom:var(--ds-size-300, 1.5rem)}.util_stackMargin400--bottom{margin-bottom:var(--ds-size-400, 2rem)}.util_stackMargin600--bottom{margin-bottom:var(--ds-size-600, 3rem)}.util_stackMargin800--bottom{margin-bottom:var(--ds-size-800, 4rem)}.util_stackMarginnone--top{margin-top:0}.util_stackMargin25--top{margin-top:var(--ds-size-25, 0.125rem)}.util_stackMargin50--top{margin-top:var(--ds-size-50, 0.25rem)}.util_stackMargin100--top{margin-top:var(--ds-size-100, 0.5rem)}.util_stackMargin150--top{margin-top:var(--ds-size-150, 0.75rem)}.util_stackMargin200--top{margin-top:var(--ds-size-200, 1rem)}.util_stackMargin300--top{margin-top:var(--ds-size-300, 1.5rem)}.util_stackMargin400--top{margin-top:var(--ds-size-400, 2rem)}.util_stackMargin600--top{margin-top:var(--ds-size-600, 3rem)}.util_stackMargin800--top{margin-top:var(--ds-size-800, 4rem)}`;
|
|
5813
7159
|
|
|
@@ -5838,7 +7184,7 @@ class AuroHeader extends i$2 {
|
|
|
5838
7184
|
/**
|
|
5839
7185
|
* @private
|
|
5840
7186
|
*/
|
|
5841
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
7187
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$4();
|
|
5842
7188
|
}
|
|
5843
7189
|
|
|
5844
7190
|
// function to define props used within the scope of this component
|
|
@@ -5868,7 +7214,7 @@ class AuroHeader extends i$2 {
|
|
|
5868
7214
|
*
|
|
5869
7215
|
*/
|
|
5870
7216
|
static register(name = "auro-header") {
|
|
5871
|
-
AuroLibraryRuntimeUtils$
|
|
7217
|
+
AuroLibraryRuntimeUtils$4.prototype.registerComponent(name, AuroHeader);
|
|
5872
7218
|
}
|
|
5873
7219
|
|
|
5874
7220
|
firstUpdated() {
|
|
@@ -5964,17 +7310,30 @@ class AuroBibtemplate extends i$2 {
|
|
|
5964
7310
|
|
|
5965
7311
|
this.large = false;
|
|
5966
7312
|
|
|
5967
|
-
AuroLibraryRuntimeUtils$
|
|
7313
|
+
AuroLibraryRuntimeUtils$3.prototype.handleComponentTagRename(this, 'auro-bibtemplate');
|
|
5968
7314
|
|
|
5969
7315
|
const versioning = new AuroDependencyVersioning();
|
|
7316
|
+
|
|
7317
|
+
/**
|
|
7318
|
+
* @private
|
|
7319
|
+
*/
|
|
5970
7320
|
this.iconTag = versioning.generateTag('auro-formkit-bibtemplate-icon', iconVersion$1, AuroIcon$1);
|
|
7321
|
+
|
|
7322
|
+
/**
|
|
7323
|
+
* @private
|
|
7324
|
+
*/
|
|
5971
7325
|
this.headerTag = versioning.generateTag('auro-formkit-bibtemplate-header', headerVersion, AuroHeader);
|
|
7326
|
+
|
|
7327
|
+
/**
|
|
7328
|
+
* @private
|
|
7329
|
+
*/
|
|
7330
|
+
this.buttonTag = versioning.generateTag('auro-formkit-input-button', buttonVersion, AuroButton);
|
|
5972
7331
|
}
|
|
5973
7332
|
|
|
5974
7333
|
static get styles() {
|
|
5975
7334
|
return [
|
|
5976
|
-
colorCss$
|
|
5977
|
-
styleCss$
|
|
7335
|
+
colorCss$3$1,
|
|
7336
|
+
styleCss$4$1,
|
|
5978
7337
|
tokenCss
|
|
5979
7338
|
];
|
|
5980
7339
|
}
|
|
@@ -6003,7 +7362,7 @@ class AuroBibtemplate extends i$2 {
|
|
|
6003
7362
|
*
|
|
6004
7363
|
*/
|
|
6005
7364
|
static register(name = "auro-bibtemplate") {
|
|
6006
|
-
AuroLibraryRuntimeUtils$
|
|
7365
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroBibtemplate);
|
|
6007
7366
|
}
|
|
6008
7367
|
|
|
6009
7368
|
/**
|
|
@@ -6061,9 +7420,9 @@ class AuroBibtemplate extends i$2 {
|
|
|
6061
7420
|
<div id="bibTemplate" part="bibtemplate">
|
|
6062
7421
|
${this.isFullscreen ? u`
|
|
6063
7422
|
<div id="headerContainer">
|
|
6064
|
-
|
|
7423
|
+
<${this.buttonTag} id="closeButton" aria-label="Close" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
6065
7424
|
<${this.iconTag} category="interface" name="x-lg"></${this.iconTag}>
|
|
6066
|
-
|
|
7425
|
+
</${this.buttonTag}>
|
|
6067
7426
|
<${this.headerTag} display="${this.large ? 'display' : '600'}" level="3" size="none" id="header" no-margin-block>
|
|
6068
7427
|
<slot name="header"></slot>
|
|
6069
7428
|
</${this.headerTag}>
|
|
@@ -6087,9 +7446,9 @@ class AuroBibtemplate extends i$2 {
|
|
|
6087
7446
|
|
|
6088
7447
|
var bibTemplateVersion = '1.0.0';
|
|
6089
7448
|
|
|
6090
|
-
var colorCss$3 = i$5`: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-
|
|
7449
|
+
var colorCss$3 = i$5`: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-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
6091
7450
|
|
|
6092
|
-
var styleCss$4 = i$5
|
|
7451
|
+
var styleCss$4 = i$5`:host{position:relative;display:block}.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
6093
7452
|
|
|
6094
7453
|
var tokensCss$2 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
6095
7454
|
|
|
@@ -6295,68 +7654,7 @@ class AuroHelpText extends i$2 {
|
|
|
6295
7654
|
|
|
6296
7655
|
var helpTextVersion = '1.0.0';
|
|
6297
7656
|
|
|
6298
|
-
i$5
|
|
6299
|
-
|
|
6300
|
-
i$5`: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)}`;
|
|
6301
|
-
|
|
6302
|
-
i$5`: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-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
6303
|
-
|
|
6304
|
-
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6305
|
-
// See LICENSE in the project root for license information.
|
|
6306
|
-
|
|
6307
|
-
// ---------------------------------------------------------------------
|
|
6308
|
-
|
|
6309
|
-
/**
|
|
6310
|
-
* Converts value to an array.
|
|
6311
|
-
* If the value is a JSON string representing an array, it will be parsed.
|
|
6312
|
-
* If the value is already an array, it is returned.
|
|
6313
|
-
* If the value is undefined, it returns undefined.
|
|
6314
|
-
* @private
|
|
6315
|
-
* @param {any} value - The value to be converted. Can be a string, array, or undefined.
|
|
6316
|
-
* @returns {Array|undefined} - The converted array or undefined.
|
|
6317
|
-
* @throws {Error} - Throws an error if the value is not an array, undefined,
|
|
6318
|
-
* or if the value cannot be parsed into an array from a JSON string.
|
|
6319
|
-
*/
|
|
6320
|
-
function arrayConverter(value) {
|
|
6321
|
-
// Allow undefined
|
|
6322
|
-
if (value === undefined) {
|
|
6323
|
-
return undefined;
|
|
6324
|
-
}
|
|
6325
|
-
|
|
6326
|
-
// Return the value if it is already an array
|
|
6327
|
-
if (Array.isArray(value)) {
|
|
6328
|
-
return value;
|
|
6329
|
-
}
|
|
6330
|
-
|
|
6331
|
-
try {
|
|
6332
|
-
// If value is a JSON string, parse it
|
|
6333
|
-
const parsed = typeof value === 'string' ? JSON.parse(value) : value;
|
|
6334
|
-
|
|
6335
|
-
// Check if the parsed value is an array
|
|
6336
|
-
if (Array.isArray(parsed)) {
|
|
6337
|
-
return parsed;
|
|
6338
|
-
}
|
|
6339
|
-
} catch (error) {
|
|
6340
|
-
// If JSON parsing fails, continue to throw an error below
|
|
6341
|
-
/* eslint-disable no-console */
|
|
6342
|
-
console.error('JSON parsing failed:', error);
|
|
6343
|
-
}
|
|
6344
|
-
|
|
6345
|
-
// Throw error if the input is not an array or undefined
|
|
6346
|
-
throw new Error('Invalid value: Input must be an array or undefined');
|
|
6347
|
-
}
|
|
6348
|
-
|
|
6349
|
-
i$5`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-200, 1rem) var(--ds-size-50, 0.25rem) 0;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}: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)}:host ::slotted(strong){font-weight:700}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
6350
|
-
|
|
6351
|
-
i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
6352
|
-
|
|
6353
|
-
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, 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}`;
|
|
6354
|
-
|
|
6355
|
-
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)}`;
|
|
6356
|
-
|
|
6357
|
-
i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
6358
|
-
|
|
6359
|
-
var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}.mainContent{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;justify-content:center;align-items:center}::slotted([slot=typeIcon]){margin-right:8px}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;align-items:center;justify-content:center;width:100%;padding:0 8px 0 24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
|
|
7657
|
+
var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}:host([layout*=emphasized]) [auro-dropdown],:host([layout*=snowflake]) [auro-dropdown]{--ds-auro-select-border-color: transparent}.mainContent{position:relative;display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;align-items:center;justify-content:center}::slotted([slot=typeIcon]){margin-right:var(--ds-size-100, 0.5rem)}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;width:100%;align-items:center;justify-content:center}:host([layout*=emphasized]) .triggerContent,:host([layout*=snowflake]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem) 0 var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) [auro-dropdown] label.withValue{font-size:var(--ds-text-body-size-xs);line-height:20px}:host([layout*=emphasized]) [auro-dropdown] label.withValue{font-size:var(--ds-text-body-size-xs);line-height:20px}:host([layout*=classic]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem)}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{cursor:text;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host([layout*=classic]) label.withValue{font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([layout*=classic]) .value{height:auto;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]){pointer-events:none;user-select:none}:host([disabled]:not([ondark])) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([layout*=classic])[disabled][ondark]) [auro-dropdown]{--ds-auro-select-border-color: transparent}`;
|
|
6360
7658
|
|
|
6361
7659
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6362
7660
|
// See LICENSE in the project root for license information.
|
|
@@ -6369,9 +7667,10 @@ var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock
|
|
|
6369
7667
|
* @slot - Default slot for the menu content.
|
|
6370
7668
|
* @slot bib.fullscreen.headline - Defines the headline to display above menu-options
|
|
6371
7669
|
* @slot label - Defines the content of the label.
|
|
7670
|
+
* @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
6372
7671
|
* @slot helpText - Defines the content of the helpText.
|
|
6373
|
-
* @slot placeholder - Defines the content of the placeholder to be shown when there is no value
|
|
6374
7672
|
* @slot valueText - Dropdown value text display.
|
|
7673
|
+
* @slot displayValue - Allows custom HTML content to display the selected value when select is not focused.
|
|
6375
7674
|
* @event auroSelect-valueSet - Notifies that the component has a new value set.
|
|
6376
7675
|
* @event input - Notifies every time the value prop of the element is changed. The updated `value` and `optionSelected` will be delivered in `detail` object.
|
|
6377
7676
|
* @event auroFormElement-validated - Notifies that the `validity` and `errorMessage` values have changed.
|
|
@@ -6379,7 +7678,7 @@ var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock
|
|
|
6379
7678
|
*/
|
|
6380
7679
|
|
|
6381
7680
|
// build the component class
|
|
6382
|
-
class AuroSelect extends AuroElement$
|
|
7681
|
+
class AuroSelect extends AuroElement$4 {
|
|
6383
7682
|
constructor() {
|
|
6384
7683
|
super();
|
|
6385
7684
|
|
|
@@ -6389,11 +7688,11 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6389
7688
|
const idSubstrEnd = 8;
|
|
6390
7689
|
const idSubstrStart = 2;
|
|
6391
7690
|
|
|
6392
|
-
this.matchWidth =
|
|
7691
|
+
this.matchWidth = false;
|
|
6393
7692
|
|
|
6394
7693
|
// Layout Config
|
|
6395
|
-
this.layout = '
|
|
6396
|
-
this.shape = '
|
|
7694
|
+
this.layout = 'snowflake';
|
|
7695
|
+
this.shape = 'snowflake';
|
|
6397
7696
|
this.size = 'xl';
|
|
6398
7697
|
|
|
6399
7698
|
// floaterConfig
|
|
@@ -6404,6 +7703,10 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6404
7703
|
|
|
6405
7704
|
this.forceDisplayValue = false;
|
|
6406
7705
|
|
|
7706
|
+
this.layout = 'classic';
|
|
7707
|
+
this.shape = 'classic';
|
|
7708
|
+
this.size = 'xl';
|
|
7709
|
+
|
|
6407
7710
|
/**
|
|
6408
7711
|
* @private
|
|
6409
7712
|
*/
|
|
@@ -6419,7 +7722,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6419
7722
|
/**
|
|
6420
7723
|
* @private
|
|
6421
7724
|
*/
|
|
6422
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
7725
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
6423
7726
|
|
|
6424
7727
|
/**
|
|
6425
7728
|
* Generate unique names for dependency components.
|
|
@@ -6468,6 +7771,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6468
7771
|
this.value = undefined;
|
|
6469
7772
|
this.fullscreenBreakpoint = 'sm';
|
|
6470
7773
|
this.onDark = false;
|
|
7774
|
+
this.isPopoverVisible = false;
|
|
6471
7775
|
}
|
|
6472
7776
|
|
|
6473
7777
|
// This function is to define props used within the scope of this component
|
|
@@ -6509,6 +7813,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6509
7813
|
reflect: true
|
|
6510
7814
|
},
|
|
6511
7815
|
|
|
7816
|
+
/**
|
|
7817
|
+
* @private
|
|
7818
|
+
*/
|
|
7819
|
+
isPopoverVisible: {
|
|
7820
|
+
type: Boolean,
|
|
7821
|
+
reflect: false
|
|
7822
|
+
},
|
|
7823
|
+
|
|
6512
7824
|
/**
|
|
6513
7825
|
* If declared, the popover and trigger will be set to the same width.
|
|
6514
7826
|
*/
|
|
@@ -6525,14 +7837,6 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6525
7837
|
reflect: true
|
|
6526
7838
|
},
|
|
6527
7839
|
|
|
6528
|
-
/**
|
|
6529
|
-
* If set, makes dropdown width match the size of the content, rather than the width of the trigger.
|
|
6530
|
-
*/
|
|
6531
|
-
flexMenuWidth: {
|
|
6532
|
-
type: Boolean,
|
|
6533
|
-
reflect: true
|
|
6534
|
-
},
|
|
6535
|
-
|
|
6536
7840
|
/**
|
|
6537
7841
|
* Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
|
|
6538
7842
|
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
@@ -6626,7 +7930,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6626
7930
|
* "top" | "right" | "bottom" | "left" |
|
|
6627
7931
|
* "bottom-start" | "top-start" | "top-end" |
|
|
6628
7932
|
* "right-start" | "right-end" | "bottom-end" |
|
|
6629
|
-
* "left-start" | "left-end"
|
|
7933
|
+
* "left-start" | "left-end".
|
|
6630
7934
|
* @default bottom-start
|
|
6631
7935
|
*/
|
|
6632
7936
|
placement: {
|
|
@@ -6634,6 +7938,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6634
7938
|
reflect: true
|
|
6635
7939
|
},
|
|
6636
7940
|
|
|
7941
|
+
/**
|
|
7942
|
+
* Define custom placeholder text.
|
|
7943
|
+
*/
|
|
7944
|
+
placeholder: {
|
|
7945
|
+
type: String,
|
|
7946
|
+
reflect: true
|
|
7947
|
+
},
|
|
7948
|
+
|
|
6637
7949
|
/**
|
|
6638
7950
|
* Populates the `required` attribute on the element. Used for client-side validation.
|
|
6639
7951
|
*/
|
|
@@ -6680,11 +7992,12 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6680
7992
|
},
|
|
6681
7993
|
|
|
6682
7994
|
/**
|
|
6683
|
-
* Value selected for the component.
|
|
6684
|
-
* @type {String|Array<String>}
|
|
7995
|
+
* Value selected for the component.
|
|
6685
7996
|
*/
|
|
6686
7997
|
value: {
|
|
6687
|
-
type:
|
|
7998
|
+
type: String,
|
|
7999
|
+
reflect: true,
|
|
8000
|
+
attribute: 'value'
|
|
6688
8001
|
},
|
|
6689
8002
|
|
|
6690
8003
|
/**
|
|
@@ -6736,10 +8049,42 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6736
8049
|
];
|
|
6737
8050
|
}
|
|
6738
8051
|
|
|
8052
|
+
/**
|
|
8053
|
+
* Formatted value based on `multiSelect` state.
|
|
8054
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
8055
|
+
* @private
|
|
8056
|
+
* @returns {String|Array<String>}
|
|
8057
|
+
*/
|
|
8058
|
+
get formattedValue() {
|
|
8059
|
+
if (this.multiSelect) {
|
|
8060
|
+
if (!this.value) {
|
|
8061
|
+
return undefined;
|
|
8062
|
+
}
|
|
8063
|
+
if (this.value.startsWith("[")) {
|
|
8064
|
+
return JSON.parse(this.value);
|
|
8065
|
+
}
|
|
8066
|
+
return [this.value];
|
|
8067
|
+
}
|
|
8068
|
+
return this.value;
|
|
8069
|
+
}
|
|
8070
|
+
|
|
8071
|
+
/**
|
|
8072
|
+
* Returns classmap configuration for html5 input labels in all layouts.
|
|
8073
|
+
* @private
|
|
8074
|
+
* @returns {void}
|
|
8075
|
+
*/
|
|
8076
|
+
get commonLabelClasses() {
|
|
8077
|
+
return {
|
|
8078
|
+
'is-disabled': this.disabled,
|
|
8079
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8080
|
+
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
8081
|
+
};
|
|
8082
|
+
}
|
|
8083
|
+
|
|
6739
8084
|
/**
|
|
6740
8085
|
* Returns classmap configuration for wrapper elements in each layout.
|
|
6741
8086
|
* @private
|
|
6742
|
-
* @
|
|
8087
|
+
* @returns {object} - Returns classmap.
|
|
6743
8088
|
*/
|
|
6744
8089
|
get commonWrapperClasses() {
|
|
6745
8090
|
return {
|
|
@@ -6755,8 +8100,27 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6755
8100
|
configureDropdown() {
|
|
6756
8101
|
this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
|
|
6757
8102
|
|
|
8103
|
+
this.dropdown.addEventListener('auroDropdown-toggled', () => {
|
|
8104
|
+
this.isPopoverVisible = this.dropdown.isPopoverVisible;
|
|
8105
|
+
|
|
8106
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8107
|
+
// wait til the bib gets fully rendered
|
|
8108
|
+
setTimeout(() => {
|
|
8109
|
+
if (this.dropdown.isBibFullscreen) {
|
|
8110
|
+
// trigger holds the focus since menu is not a focusable element.
|
|
8111
|
+
this.dropdown.trigger.focus();
|
|
8112
|
+
|
|
8113
|
+
// default focus indicator on the first menu option
|
|
8114
|
+
if (this.menu.index < 0) {
|
|
8115
|
+
this.menu.navigateOptions('down');
|
|
8116
|
+
}
|
|
8117
|
+
}
|
|
8118
|
+
});
|
|
8119
|
+
}
|
|
8120
|
+
});
|
|
8121
|
+
|
|
6758
8122
|
// setting up bibtemplate
|
|
6759
|
-
this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
|
|
8123
|
+
this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
|
|
6760
8124
|
|
|
6761
8125
|
if (this.customBibWidth) {
|
|
6762
8126
|
this.dropdown.dropdownWidth = this.customBibWidth;
|
|
@@ -6775,7 +8139,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6775
8139
|
*
|
|
6776
8140
|
*/
|
|
6777
8141
|
static register(name = "auro-select") {
|
|
6778
|
-
AuroLibraryRuntimeUtils$
|
|
8142
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroSelect);
|
|
6779
8143
|
}
|
|
6780
8144
|
|
|
6781
8145
|
/**
|
|
@@ -6787,13 +8151,18 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6787
8151
|
const triggerContentEl = this.dropdown.querySelector('#triggerFocus');
|
|
6788
8152
|
|
|
6789
8153
|
// Clear out old value
|
|
6790
|
-
// const placeholder = triggerContentEl.querySelector('#placeholder');
|
|
6791
8154
|
const valueElem = triggerContentEl.querySelector('#value');
|
|
6792
8155
|
if (valueElem) {
|
|
6793
8156
|
valueElem.innerHTML = '';
|
|
6794
|
-
// valueElem.innerHTML = ''.appendChild(value);
|
|
6795
8157
|
}
|
|
6796
8158
|
|
|
8159
|
+
const slot = this.shadowRoot.querySelector('slot[name="displayValue"]');
|
|
8160
|
+
const slottedElements = slot.assignedElements();
|
|
8161
|
+
|
|
8162
|
+
slottedElements.forEach((element) => {
|
|
8163
|
+
element.remove();
|
|
8164
|
+
});
|
|
8165
|
+
|
|
6797
8166
|
// Handle selected options
|
|
6798
8167
|
if (this.optionSelected) {
|
|
6799
8168
|
if (this.multiSelect && this.optionSelected.length > 0) {
|
|
@@ -6803,10 +8172,8 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6803
8172
|
} else {
|
|
6804
8173
|
valueElem.innerHTML = this.optionSelected.innerHTML;
|
|
6805
8174
|
const displayValueEl = this.optionSelected.querySelector("[slot='displayValue']");
|
|
6806
|
-
if (displayValueEl) {
|
|
6807
|
-
const oldDisplayValueEl = this.querySelectorAll("[slot='displayValue']");
|
|
6808
|
-
oldDisplayValueEl.forEach((el) => el.remove());
|
|
6809
8175
|
|
|
8176
|
+
if (displayValueEl) {
|
|
6810
8177
|
this.appendChild(displayValueEl.cloneNode(true));
|
|
6811
8178
|
}
|
|
6812
8179
|
this.hasDisplayValueContent = displayValueEl !== null;
|
|
@@ -6832,6 +8199,15 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6832
8199
|
return;
|
|
6833
8200
|
}
|
|
6834
8201
|
|
|
8202
|
+
// set menu's default size if there it's not specified.
|
|
8203
|
+
if (!this.menu.getAttribute('size')) {
|
|
8204
|
+
this.menu.setAttribute('size', this.layout !== 'emphasized' ? 'md' : this.size);
|
|
8205
|
+
}
|
|
8206
|
+
|
|
8207
|
+
if (!this.getAttribute('shape')) {
|
|
8208
|
+
this.menu.setAttribute('shape', this.layout === 'classic' ? 'box' : this.shape);
|
|
8209
|
+
}
|
|
8210
|
+
|
|
6835
8211
|
if (this.multiSelect) {
|
|
6836
8212
|
this.menu.multiSelect = this.multiSelect;
|
|
6837
8213
|
}
|
|
@@ -6891,46 +8267,58 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6891
8267
|
configureSelect() {
|
|
6892
8268
|
|
|
6893
8269
|
this.addEventListener('keydown', (evt) => {
|
|
6894
|
-
|
|
6895
|
-
|
|
8270
|
+
// when the focus is on trigger not on close button
|
|
8271
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8272
|
+
if (evt.key === 'ArrowUp') {
|
|
8273
|
+
evt.preventDefault();
|
|
6896
8274
|
|
|
6897
|
-
|
|
8275
|
+
this.dropdown.show();
|
|
8276
|
+
|
|
8277
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8278
|
+
this.menu.navigateOptions('up');
|
|
8279
|
+
}
|
|
6898
8280
|
|
|
6899
|
-
|
|
6900
|
-
this.menu.navigateOptions('up');
|
|
8281
|
+
return;
|
|
6901
8282
|
}
|
|
6902
8283
|
|
|
6903
|
-
|
|
6904
|
-
|
|
8284
|
+
if (evt.key === 'ArrowDown') {
|
|
8285
|
+
evt.preventDefault();
|
|
6905
8286
|
|
|
6906
|
-
|
|
6907
|
-
evt.preventDefault();
|
|
8287
|
+
this.dropdown.show();
|
|
6908
8288
|
|
|
6909
|
-
|
|
8289
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8290
|
+
this.menu.navigateOptions('down');
|
|
8291
|
+
}
|
|
6910
8292
|
|
|
6911
|
-
|
|
6912
|
-
this.menu.navigateOptions('down');
|
|
8293
|
+
return;
|
|
6913
8294
|
}
|
|
6914
8295
|
|
|
6915
|
-
|
|
6916
|
-
|
|
8296
|
+
if (evt.key === 'Enter') {
|
|
8297
|
+
if (!this.dropdown.isPopoverVisible) {
|
|
8298
|
+
evt.preventDefault();
|
|
8299
|
+
this.menu.makeSelection();
|
|
8300
|
+
}
|
|
6917
8301
|
|
|
6918
|
-
|
|
6919
|
-
if (!this.dropdown.isPopoverVisible) {
|
|
6920
|
-
evt.preventDefault();
|
|
6921
|
-
this.menu.makeSelection();
|
|
8302
|
+
return;
|
|
6922
8303
|
}
|
|
6923
|
-
|
|
6924
|
-
return;
|
|
6925
8304
|
}
|
|
6926
8305
|
|
|
6927
|
-
if (evt.key === 'Tab') {
|
|
8306
|
+
if (evt.key === 'Tab' && this.dropdown.isPopoverVisible) {
|
|
6928
8307
|
if (this.dropdown.isBibFullscreen) {
|
|
6929
8308
|
evt.preventDefault();
|
|
8309
|
+
|
|
8310
|
+
// when the focus is on trigger not on close button
|
|
8311
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8312
|
+
// `dropdown.focus` will move focus to the first focusable element in bib when it's open,
|
|
8313
|
+
// when bib it not open, it will focus onto trigger.
|
|
8314
|
+
this.dropdown.focus();
|
|
8315
|
+
} else {
|
|
8316
|
+
// when close button has the focus, move focus back to the trigger
|
|
8317
|
+
this.dropdown.trigger.focus();
|
|
8318
|
+
}
|
|
6930
8319
|
} else {
|
|
6931
8320
|
this.dropdown.hide();
|
|
6932
8321
|
}
|
|
6933
|
-
|
|
6934
8322
|
return;
|
|
6935
8323
|
}
|
|
6936
8324
|
|
|
@@ -7095,34 +8483,39 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7095
8483
|
// Add the tag name as an attribute if it is different than the component name
|
|
7096
8484
|
this.runtimeUtils.handleComponentTagRename(this, 'auro-select');
|
|
7097
8485
|
|
|
7098
|
-
this.configureMenu();
|
|
7099
8486
|
this.configureDropdown();
|
|
8487
|
+
this.configureMenu();
|
|
7100
8488
|
this.configureSelect();
|
|
8489
|
+
}
|
|
7101
8490
|
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
8491
|
+
/**
|
|
8492
|
+
* Update the menu value. With checks for menu existence. Awaits value update.
|
|
8493
|
+
* @param {string} value - The value to set in the menu.
|
|
8494
|
+
* @returns {void}
|
|
8495
|
+
* @private
|
|
8496
|
+
*/
|
|
8497
|
+
async updateMenuValue(value) {
|
|
8498
|
+
if (!this.menu) return;
|
|
8499
|
+
|
|
8500
|
+
this.menu.setAttribute('value', value);
|
|
8501
|
+
this.menu.value = value;
|
|
8502
|
+
await this.menu.updateComplete;
|
|
7107
8503
|
}
|
|
7108
8504
|
|
|
7109
8505
|
async updated(changedProperties) {
|
|
7110
|
-
if (changedProperties.has('multiSelect')) {
|
|
8506
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has('value')) {
|
|
7111
8507
|
this.clearSelection();
|
|
7112
8508
|
}
|
|
7113
8509
|
|
|
7114
8510
|
if (changedProperties.has('value')) {
|
|
7115
8511
|
if (this.value) {
|
|
7116
|
-
|
|
8512
|
+
await this.updateMenuValue(this.value);
|
|
7117
8513
|
|
|
7118
|
-
this.menu
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
await this.menu.updateComplete;
|
|
7122
|
-
|
|
7123
|
-
this.optionSelected = this.menu.optionSelected;
|
|
8514
|
+
if (this.menu) {
|
|
8515
|
+
this.optionSelected = this.menu.optionSelected;
|
|
8516
|
+
}
|
|
7124
8517
|
} else {
|
|
7125
|
-
this.
|
|
8518
|
+
await this.updateMenuValue(undefined);
|
|
7126
8519
|
}
|
|
7127
8520
|
|
|
7128
8521
|
this._updateNativeSelect();
|
|
@@ -7141,7 +8534,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7141
8534
|
composed: true,
|
|
7142
8535
|
detail: {
|
|
7143
8536
|
optionSelected: this.optionSelected,
|
|
7144
|
-
value: this.
|
|
8537
|
+
value: this.formattedValue
|
|
7145
8538
|
}
|
|
7146
8539
|
}));
|
|
7147
8540
|
}
|
|
@@ -7153,6 +8546,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7153
8546
|
if (changedProperties.has('error')) {
|
|
7154
8547
|
this.validate(true);
|
|
7155
8548
|
}
|
|
8549
|
+
|
|
8550
|
+
if (changedProperties.has('shape') && this.menu) {
|
|
8551
|
+
this.menu.setAttribute('shape', this.layout === 'classic' ? 'box' : this.shape);
|
|
8552
|
+
}
|
|
8553
|
+
|
|
8554
|
+
if (changedProperties.has('size') && this.menu) {
|
|
8555
|
+
this.menu.setAttribute('size', this.layout !== 'emphasized' ? 'md' : this.size);
|
|
8556
|
+
}
|
|
7156
8557
|
}
|
|
7157
8558
|
|
|
7158
8559
|
/**
|
|
@@ -7192,13 +8593,13 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7192
8593
|
const selectedValue = selectedOption.value;
|
|
7193
8594
|
|
|
7194
8595
|
if (this.multiSelect) {
|
|
7195
|
-
const currentArray =
|
|
8596
|
+
const currentArray = this.formattedValue;
|
|
7196
8597
|
|
|
7197
8598
|
if (!currentArray.includes(selectedValue)) {
|
|
7198
|
-
this.value = [
|
|
8599
|
+
this.value = JSON.stringify([
|
|
7199
8600
|
...currentArray,
|
|
7200
8601
|
selectedValue
|
|
7201
|
-
];
|
|
8602
|
+
]);
|
|
7202
8603
|
}
|
|
7203
8604
|
} else {
|
|
7204
8605
|
const currentValue = this.value;
|
|
@@ -7221,12 +8622,17 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7221
8622
|
}
|
|
7222
8623
|
|
|
7223
8624
|
if (this.multiSelect) {
|
|
7224
|
-
nativeSelect.value = this.
|
|
8625
|
+
nativeSelect.value = this.multiSelect ? this.multiSelect[0] : '';
|
|
7225
8626
|
} else {
|
|
7226
8627
|
nativeSelect.value = this.value || '';
|
|
7227
8628
|
}
|
|
7228
8629
|
}
|
|
7229
8630
|
|
|
8631
|
+
/**
|
|
8632
|
+
* Returns HTML for the hidden a11y screen reader content.
|
|
8633
|
+
* @private
|
|
8634
|
+
* @returns {html} - Returns HTML for the hidden a11y screen reader content.
|
|
8635
|
+
*/
|
|
7230
8636
|
renderAriaHtml() {
|
|
7231
8637
|
return u`
|
|
7232
8638
|
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
@@ -7247,9 +8653,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7247
8653
|
`;
|
|
7248
8654
|
}
|
|
7249
8655
|
|
|
8656
|
+
/**
|
|
8657
|
+
* Returns HTML for the hidden HTML5 select.
|
|
8658
|
+
* @private
|
|
8659
|
+
* @returns {html} - Returns HTML for the hidden HTML5 select.
|
|
8660
|
+
*/
|
|
7250
8661
|
renderNativeSelect() {
|
|
7251
8662
|
return u`
|
|
7252
|
-
<div class="nativeSelectWrapper">
|
|
8663
|
+
<div class="nativeSelectWrapper util_displayHidden">
|
|
7253
8664
|
<select
|
|
7254
8665
|
tabindex="-1"
|
|
7255
8666
|
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
@@ -7286,14 +8697,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7286
8697
|
? u`
|
|
7287
8698
|
<${this.helpTextTag} ?onDark="${this.onDark}">
|
|
7288
8699
|
<p id="${this.uniqueId}" part="helpText">
|
|
7289
|
-
<slot name="
|
|
8700
|
+
<slot name="helpText"></slot>
|
|
7290
8701
|
</p>
|
|
7291
8702
|
</${this.helpTextTag}>
|
|
7292
8703
|
`
|
|
7293
8704
|
: u`
|
|
7294
8705
|
<${this.helpTextTag} error ?onDark="${this.onDark}">
|
|
7295
8706
|
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
7296
|
-
|
|
8707
|
+
${this.errorMessage}
|
|
7297
8708
|
</p>
|
|
7298
8709
|
</${this.helpTextTag}>
|
|
7299
8710
|
`
|
|
@@ -7306,23 +8717,22 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7306
8717
|
* @private
|
|
7307
8718
|
* @returns {import("lit").TemplateResult} - Returns HTML for the emphasized layout.
|
|
7308
8719
|
*/
|
|
7309
|
-
// TODO update to use util class
|
|
7310
8720
|
renderLayoutEmphasized() {
|
|
7311
8721
|
const placeholderClass = {
|
|
7312
|
-
|
|
8722
|
+
'util_displayHidden': this.value
|
|
7313
8723
|
};
|
|
7314
8724
|
|
|
7315
8725
|
const displayValueClasses = {
|
|
7316
8726
|
'displayValue': true,
|
|
7317
8727
|
'hasContent': this.hasDisplayValueContent,
|
|
7318
|
-
'hasFocus': this.
|
|
7319
|
-
'withValue': this.value && this.value.length > 0,
|
|
8728
|
+
'hasFocus': this.isPopoverVisible,
|
|
8729
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
7320
8730
|
'force': this.forceDisplayValue,
|
|
7321
8731
|
};
|
|
7322
8732
|
|
|
7323
8733
|
const valueContainerClasses = {
|
|
7324
8734
|
'valueContainer': true,
|
|
7325
|
-
'util_displayHiddenVisually':
|
|
8735
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
7326
8736
|
};
|
|
7327
8737
|
|
|
7328
8738
|
return u`
|
|
@@ -7333,16 +8743,16 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7333
8743
|
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
7334
8744
|
</div>
|
|
7335
8745
|
<${this.dropdownTag}
|
|
8746
|
+
a11yRole="select"
|
|
7336
8747
|
?autoPlacement="${this.autoPlacement}"
|
|
7337
8748
|
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
7338
|
-
?matchWidth="${
|
|
8749
|
+
?matchWidth="${this.matchWidth}"
|
|
7339
8750
|
?noFlip="${this.noFlip}"
|
|
7340
8751
|
?onDark="${this.onDark}"
|
|
7341
8752
|
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
7342
8753
|
.offset="${this.offset}"
|
|
7343
8754
|
.placement="${this.placement}"
|
|
7344
8755
|
chevron
|
|
7345
|
-
fluid
|
|
7346
8756
|
for="selectMenu"
|
|
7347
8757
|
layout="${this.layout}"
|
|
7348
8758
|
part="dropdown"
|
|
@@ -7354,15 +8764,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7354
8764
|
</div>
|
|
7355
8765
|
<div class="mainContent">
|
|
7356
8766
|
<div class="${e(valueContainerClasses)}">
|
|
7357
|
-
<label>
|
|
8767
|
+
<label class="${e(this.commonLabelClasses)}">
|
|
7358
8768
|
<slot name="label"></slot>
|
|
8769
|
+
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
7359
8770
|
</label>
|
|
7360
8771
|
<div class="value" id="value"></div>
|
|
7361
|
-
${
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
</div>
|
|
7365
|
-
`}
|
|
8772
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8773
|
+
${this.placeholder}
|
|
8774
|
+
</div>
|
|
7366
8775
|
</div>
|
|
7367
8776
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
7368
8777
|
<slot name="displayValue"></slot>
|
|
@@ -7389,20 +8798,20 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7389
8798
|
*/
|
|
7390
8799
|
renderLayoutSnowflake() {
|
|
7391
8800
|
const placeholderClass = {
|
|
7392
|
-
|
|
8801
|
+
'util_displayHidden': this.value
|
|
7393
8802
|
};
|
|
7394
8803
|
|
|
7395
8804
|
const displayValueClasses = {
|
|
7396
8805
|
'displayValue': true,
|
|
7397
8806
|
'hasContent': this.hasDisplayValueContent,
|
|
7398
|
-
'hasFocus': this.
|
|
7399
|
-
'withValue': this.value && this.value.length > 0,
|
|
8807
|
+
'hasFocus': this.isPopoverVisible,
|
|
8808
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
7400
8809
|
'force': this.forceDisplayValue,
|
|
7401
8810
|
};
|
|
7402
8811
|
|
|
7403
8812
|
const valueContainerClasses = {
|
|
7404
8813
|
'valueContainer': true,
|
|
7405
|
-
'util_displayHiddenVisually': (this.forceDisplayValue || !this.
|
|
8814
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
7406
8815
|
};
|
|
7407
8816
|
|
|
7408
8817
|
return u`
|
|
@@ -7415,14 +8824,13 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7415
8824
|
<${this.dropdownTag}
|
|
7416
8825
|
?autoPlacement="${this.autoPlacement}"
|
|
7417
8826
|
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
7418
|
-
?matchWidth="${
|
|
8827
|
+
?matchWidth="${this.matchWidth}"
|
|
7419
8828
|
?noFlip="${this.noFlip}"
|
|
7420
8829
|
?onDark="${this.onDark}"
|
|
7421
8830
|
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
7422
8831
|
.offset="${this.offset}"
|
|
7423
8832
|
.placement="${this.placement}"
|
|
7424
8833
|
chevron
|
|
7425
|
-
fluid
|
|
7426
8834
|
for="selectMenu"
|
|
7427
8835
|
layout="${this.layout}"
|
|
7428
8836
|
part="dropdown"
|
|
@@ -7434,15 +8842,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7434
8842
|
</div>
|
|
7435
8843
|
<div class="mainContent">
|
|
7436
8844
|
<div class="${e(valueContainerClasses)}">
|
|
7437
|
-
<label>
|
|
8845
|
+
<label class="${e(this.commonLabelClasses)}">
|
|
7438
8846
|
<slot name="label"></slot>
|
|
8847
|
+
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
7439
8848
|
</label>
|
|
7440
8849
|
<div class="value" id="value"></div>
|
|
7441
|
-
${
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
</div>
|
|
7445
|
-
`}
|
|
8850
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8851
|
+
${this.placeholder}
|
|
8852
|
+
</div>
|
|
7446
8853
|
</div>
|
|
7447
8854
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
7448
8855
|
<slot name="displayValue"></slot>
|
|
@@ -7458,6 +8865,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7458
8865
|
${this.renderHtmlHelpText()}
|
|
7459
8866
|
</div>
|
|
7460
8867
|
</${this.dropdownTag}>
|
|
8868
|
+
${this.renderNativeSelect()}
|
|
7461
8869
|
</div>
|
|
7462
8870
|
`;
|
|
7463
8871
|
}
|
|
@@ -7468,11 +8876,75 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7468
8876
|
* @returns {import("lit").TemplateResult} - Returns HTML for the classic layout.
|
|
7469
8877
|
*/
|
|
7470
8878
|
renderLayoutClassic() {
|
|
8879
|
+
const placeholderClass = {
|
|
8880
|
+
'util_displayHidden': this.value
|
|
8881
|
+
};
|
|
8882
|
+
|
|
8883
|
+
const displayValueClasses = {
|
|
8884
|
+
'displayValue': true,
|
|
8885
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8886
|
+
'hasFocus': this.isPopoverVisible,
|
|
8887
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8888
|
+
'force': this.forceDisplayValue,
|
|
8889
|
+
};
|
|
8890
|
+
|
|
8891
|
+
const valueContainerClasses = {
|
|
8892
|
+
'valueContainer': true,
|
|
8893
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
8894
|
+
};
|
|
8895
|
+
|
|
7471
8896
|
return u`
|
|
7472
8897
|
<div
|
|
7473
|
-
class="${e(this.commonWrapperClasses)}
|
|
8898
|
+
class="${e(this.commonWrapperClasses)}"
|
|
7474
8899
|
part="wrapper">
|
|
7475
|
-
|
|
8900
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8901
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8902
|
+
</div>
|
|
8903
|
+
<${this.dropdownTag}
|
|
8904
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8905
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8906
|
+
?matchWidth="${!this.flexMenuWidth}"
|
|
8907
|
+
?noFlip="${this.noFlip}"
|
|
8908
|
+
?onDark="${this.onDark}"
|
|
8909
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8910
|
+
.offset="${this.offset}"
|
|
8911
|
+
.placement="${this.placement}"
|
|
8912
|
+
chevron
|
|
8913
|
+
for="selectMenu"
|
|
8914
|
+
layout="${this.layout}"
|
|
8915
|
+
part="dropdown"
|
|
8916
|
+
shape="${this.shape}"
|
|
8917
|
+
size="${this.size}">
|
|
8918
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8919
|
+
<div class="accents left">
|
|
8920
|
+
<slot name="typeIcon"></slot>
|
|
8921
|
+
</div>
|
|
8922
|
+
<div class="mainContent">
|
|
8923
|
+
<div class="${e(valueContainerClasses)}">
|
|
8924
|
+
<label class="${e(this.commonLabelClasses)}">
|
|
8925
|
+
<slot name="label"></slot>
|
|
8926
|
+
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8927
|
+
</label>
|
|
8928
|
+
<div class="value" id="value"></div>
|
|
8929
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8930
|
+
${this.placeholder}
|
|
8931
|
+
</div>
|
|
8932
|
+
</div>
|
|
8933
|
+
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8934
|
+
<slot name="displayValue"></slot>
|
|
8935
|
+
</div>
|
|
8936
|
+
</div>
|
|
8937
|
+
<div class="accents right"></div>
|
|
8938
|
+
</div>
|
|
8939
|
+
<div class="menuWrapper"></div>
|
|
8940
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8941
|
+
<slot></slot>
|
|
8942
|
+
</${this.bibtemplateTag}>
|
|
8943
|
+
<div slot="helpText">
|
|
8944
|
+
${this.renderHtmlHelpText()}
|
|
8945
|
+
</div>
|
|
8946
|
+
</${this.dropdownTag}>
|
|
8947
|
+
${this.renderNativeSelect()}
|
|
7476
8948
|
</div>
|
|
7477
8949
|
`;
|
|
7478
8950
|
}
|
|
@@ -7506,112 +8978,13 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7506
8978
|
|
|
7507
8979
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
7508
8980
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
7509
|
-
|
|
7510
|
-
// function that renders the HTML and CSS into the scope of the component
|
|
7511
|
-
renderBACKUP() {
|
|
7512
|
-
const placeholderClass = {
|
|
7513
|
-
hidden: this.value,
|
|
7514
|
-
};
|
|
7515
|
-
|
|
7516
|
-
return u`
|
|
7517
|
-
<div class="outerWrapper">
|
|
7518
|
-
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
7519
|
-
${this.optionActive && this.options.length > 0
|
|
7520
|
-
? u`
|
|
7521
|
-
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
7522
|
-
`
|
|
7523
|
-
: undefined
|
|
7524
|
-
};
|
|
7525
|
-
|
|
7526
|
-
${this.optionSelected && this.options.length > 0
|
|
7527
|
-
? u`
|
|
7528
|
-
${`${this.optionSelected.innerText} selected`}
|
|
7529
|
-
`
|
|
7530
|
-
: undefined
|
|
7531
|
-
};
|
|
7532
|
-
</div>
|
|
7533
|
-
<div id="slotHolder" aria-hidden="true">
|
|
7534
|
-
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
7535
|
-
</div>
|
|
7536
|
-
<${this.dropdownTag}
|
|
7537
|
-
?autoPlacement="${this.autoPlacement}"
|
|
7538
|
-
?disabled="${this.disabled}"
|
|
7539
|
-
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
7540
|
-
?matchWidth="${!this.flexMenuWidth}"
|
|
7541
|
-
?noFlip="${this.noFlip}"
|
|
7542
|
-
?onDark="${this.onDark}"
|
|
7543
|
-
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
7544
|
-
.offset="${this.offset}"
|
|
7545
|
-
.placement="${this.placement}"
|
|
7546
|
-
chevron
|
|
7547
|
-
fluid
|
|
7548
|
-
for="selectMenu"
|
|
7549
|
-
layout="${this.layout}"
|
|
7550
|
-
part="dropdown"
|
|
7551
|
-
shape="${this.shape}"
|
|
7552
|
-
size="${this.size}">
|
|
7553
|
-
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
7554
|
-
<span id="placeholder"
|
|
7555
|
-
class="${e(placeholderClass)}"
|
|
7556
|
-
?aria-hidden="${this.optionSelected && this.optionSelected.length ? 'true' : false}"
|
|
7557
|
-
>
|
|
7558
|
-
<slot name="placeholder"></slot>
|
|
7559
|
-
</span>
|
|
7560
|
-
<slot name="valueText" id="valueText"></slot>
|
|
7561
|
-
</span>
|
|
7562
|
-
|
|
7563
|
-
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
7564
|
-
<slot></slot>
|
|
7565
|
-
</${this.bibtemplateTag}>
|
|
7566
|
-
<slot name="label" slot="label"></slot>
|
|
7567
|
-
<p slot="helpText">
|
|
7568
|
-
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
7569
|
-
? u`
|
|
7570
|
-
<span id="${this.uniqueId}" part="helpText">
|
|
7571
|
-
<slot name="helpText"></slot>
|
|
7572
|
-
</span>`
|
|
7573
|
-
: u`
|
|
7574
|
-
<span id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
7575
|
-
${this.errorMessage}
|
|
7576
|
-
</span>`
|
|
7577
|
-
}
|
|
7578
|
-
</p>
|
|
7579
|
-
</${this.dropdownTag}>
|
|
7580
|
-
<div class="nativeSelectWrapper">
|
|
7581
|
-
<select
|
|
7582
|
-
tabindex="-1"
|
|
7583
|
-
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
7584
|
-
name="${this.name || ''}"
|
|
7585
|
-
?disabled="${this.disabled}"
|
|
7586
|
-
?required="${this.required}"
|
|
7587
|
-
aria-hidden="true"
|
|
7588
|
-
autocomplete="${o(this.autocomplete)}"
|
|
7589
|
-
@change="${this._handleNativeSelectChange}">
|
|
7590
|
-
<option value="" ?selected="${!this.value}"></option>
|
|
7591
|
-
${this.options.map((option) => {
|
|
7592
|
-
const optionValue = option.value || option.textContent;
|
|
7593
|
-
return u`
|
|
7594
|
-
<option
|
|
7595
|
-
value="${optionValue}"
|
|
7596
|
-
?selected="${this.value === optionValue}">
|
|
7597
|
-
${option.textContent}
|
|
7598
|
-
</option>
|
|
7599
|
-
`;
|
|
7600
|
-
})}
|
|
7601
|
-
</select>
|
|
7602
|
-
</div>
|
|
7603
|
-
<!-- Help text and error message template -->
|
|
7604
|
-
${this.renderHtmlHelpText()}
|
|
7605
|
-
</div>
|
|
7606
|
-
`;
|
|
7607
|
-
}
|
|
7608
8981
|
}
|
|
7609
8982
|
|
|
7610
|
-
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:
|
|
8983
|
+
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:block;vertical-align:middle}:host .wrapper{box-sizing:border-box;display:inline-block;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;line-height:1;display:inline-block}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]){overflow-y:auto}:host([root]) .wrapper[class*=-lg]{padding:var(--ds-size-150, 0.75rem)}:host([root]) .wrapper[class*=-xl]{padding:var(--ds-size-200, 1rem)}`;
|
|
7611
8984
|
|
|
7612
8985
|
var colorCss$2 = i$5`: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)}`;
|
|
7613
8986
|
|
|
7614
|
-
var tokensCss$1 = i$5`: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-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
8987
|
+
var tokensCss$1 = i$5`: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)}`;
|
|
7615
8988
|
|
|
7616
8989
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7617
8990
|
// See LICENSE in the project root for license information.
|
|
@@ -7664,7 +9037,6 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
7664
9037
|
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
7665
9038
|
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
7666
9039
|
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
7667
|
-
* @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
|
|
7668
9040
|
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
7669
9041
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
7670
9042
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
@@ -7677,14 +9049,17 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
7677
9049
|
* @slot - Slot for insertion of menu options.
|
|
7678
9050
|
*/
|
|
7679
9051
|
|
|
7680
|
-
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens */
|
|
9052
|
+
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens, no-inline-comments, line-comment-position */
|
|
7681
9053
|
|
|
7682
|
-
class AuroMenu extends
|
|
9054
|
+
class AuroMenu extends AuroElement$4 {
|
|
7683
9055
|
constructor() {
|
|
7684
9056
|
super();
|
|
7685
9057
|
|
|
7686
9058
|
// State properties (reactive)
|
|
7687
9059
|
|
|
9060
|
+
this.shape = ""; // box, rounded, pill
|
|
9061
|
+
this.size = ""; // md, lg, xl
|
|
9062
|
+
|
|
7688
9063
|
// Value of the selected options
|
|
7689
9064
|
this.value = undefined;
|
|
7690
9065
|
// Currently selected option
|
|
@@ -7743,6 +9118,7 @@ class AuroMenu extends i$2 {
|
|
|
7743
9118
|
|
|
7744
9119
|
static get properties() {
|
|
7745
9120
|
return {
|
|
9121
|
+
...super.properties,
|
|
7746
9122
|
noCheckmark: {
|
|
7747
9123
|
type: Boolean,
|
|
7748
9124
|
reflect: true,
|
|
@@ -7773,9 +9149,24 @@ class AuroMenu extends i$2 {
|
|
|
7773
9149
|
reflect: true,
|
|
7774
9150
|
attribute: 'multiselect'
|
|
7775
9151
|
},
|
|
9152
|
+
|
|
9153
|
+
/**
|
|
9154
|
+
* Value selected for the component.
|
|
9155
|
+
*/
|
|
7776
9156
|
value: {
|
|
7777
|
-
|
|
7778
|
-
|
|
9157
|
+
type: String,
|
|
9158
|
+
reflect: true,
|
|
9159
|
+
attribute: 'value'
|
|
9160
|
+
},
|
|
9161
|
+
|
|
9162
|
+
/**
|
|
9163
|
+
* Indent level for submenus.
|
|
9164
|
+
* @private
|
|
9165
|
+
*/
|
|
9166
|
+
level: {
|
|
9167
|
+
type: Number,
|
|
9168
|
+
reflect: false,
|
|
9169
|
+
attribute: false
|
|
7779
9170
|
}
|
|
7780
9171
|
};
|
|
7781
9172
|
}
|
|
@@ -7797,7 +9188,26 @@ class AuroMenu extends i$2 {
|
|
|
7797
9188
|
*
|
|
7798
9189
|
*/
|
|
7799
9190
|
static register(name = "auro-menu") {
|
|
7800
|
-
AuroLibraryRuntimeUtils$
|
|
9191
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenu);
|
|
9192
|
+
}
|
|
9193
|
+
|
|
9194
|
+
/**
|
|
9195
|
+
* Formatted value based on `multiSelect` state.
|
|
9196
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
9197
|
+
* @private
|
|
9198
|
+
* @returns {String|Array<String>}
|
|
9199
|
+
*/
|
|
9200
|
+
get formattedValue() {
|
|
9201
|
+
if (this.multiSelect) {
|
|
9202
|
+
if (!this.value) {
|
|
9203
|
+
return undefined;
|
|
9204
|
+
}
|
|
9205
|
+
if (this.value.startsWith("[")) {
|
|
9206
|
+
return JSON.parse(this.value);
|
|
9207
|
+
}
|
|
9208
|
+
return [this.value];
|
|
9209
|
+
}
|
|
9210
|
+
return this.value;
|
|
7801
9211
|
}
|
|
7802
9212
|
|
|
7803
9213
|
// Lifecycle Methods
|
|
@@ -7809,6 +9219,7 @@ class AuroMenu extends i$2 {
|
|
|
7809
9219
|
this.addEventListener('mousedown', this.handleMouseSelect);
|
|
7810
9220
|
this.addEventListener('auroMenuOption-mouseover', this.handleOptionHover);
|
|
7811
9221
|
this.addEventListener('slotchange', this.handleSlotChange);
|
|
9222
|
+
this.setTagAttribute("auro-menu");
|
|
7812
9223
|
}
|
|
7813
9224
|
|
|
7814
9225
|
disconnectedCallback() {
|
|
@@ -7821,19 +9232,33 @@ class AuroMenu extends i$2 {
|
|
|
7821
9232
|
}
|
|
7822
9233
|
|
|
7823
9234
|
firstUpdated() {
|
|
7824
|
-
AuroLibraryRuntimeUtils$
|
|
9235
|
+
AuroLibraryRuntimeUtils$6.prototype.handleComponentTagRename(this, 'auro-menu');
|
|
7825
9236
|
|
|
7826
9237
|
this.loadingSlots = this.querySelectorAll("[slot='loadingText'], [slot='loadingIcon']");
|
|
7827
9238
|
this.initializeMenu();
|
|
7828
9239
|
}
|
|
7829
9240
|
|
|
9241
|
+
/**
|
|
9242
|
+
* Sets an attribute that matches the default tag name if the tag name is not the default.
|
|
9243
|
+
* @param {string} tagName - The tag name to set as an attribute.
|
|
9244
|
+
* @private
|
|
9245
|
+
*/
|
|
9246
|
+
setTagAttribute(tagName) {
|
|
9247
|
+
if (this.tagName.toLowerCase() !== tagName) {
|
|
9248
|
+
this.setAttribute(tagName, true);
|
|
9249
|
+
}
|
|
9250
|
+
}
|
|
9251
|
+
|
|
7830
9252
|
updated(changedProperties) {
|
|
7831
|
-
|
|
9253
|
+
super.updated(changedProperties);
|
|
9254
|
+
|
|
9255
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
|
|
7832
9256
|
// Reset selection if multiSelect mode changes
|
|
7833
9257
|
this.clearSelection();
|
|
7834
9258
|
}
|
|
7835
9259
|
|
|
7836
|
-
|
|
9260
|
+
|
|
9261
|
+
if (changedProperties.has("value")) {
|
|
7837
9262
|
// Handle null/undefined case
|
|
7838
9263
|
if (this.value === undefined || this.value === null) {
|
|
7839
9264
|
this.optionSelected = undefined;
|
|
@@ -7841,7 +9266,7 @@ class AuroMenu extends i$2 {
|
|
|
7841
9266
|
} else {
|
|
7842
9267
|
if (this.multiSelect) {
|
|
7843
9268
|
// In multiselect mode, this.value should be an array of strings
|
|
7844
|
-
const valueArray =
|
|
9269
|
+
const valueArray = this.formattedValue;
|
|
7845
9270
|
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
7846
9271
|
|
|
7847
9272
|
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
@@ -7901,6 +9326,19 @@ class AuroMenu extends i$2 {
|
|
|
7901
9326
|
this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]').forEach((element) => element.setAttribute('noCheckmark', ''));
|
|
7902
9327
|
}
|
|
7903
9328
|
|
|
9329
|
+
// Handle layout propagation to all menus and options
|
|
9330
|
+
const propagationTargets = this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]');
|
|
9331
|
+
[
|
|
9332
|
+
'size',
|
|
9333
|
+
'shape'
|
|
9334
|
+
].forEach((prop) => {
|
|
9335
|
+
if (changedProperties.has(prop)) {
|
|
9336
|
+
propagationTargets.forEach((el) => {
|
|
9337
|
+
el.setAttribute(prop, this[prop]);
|
|
9338
|
+
});
|
|
9339
|
+
}
|
|
9340
|
+
});
|
|
9341
|
+
|
|
7904
9342
|
// Regex for matchWord if needed
|
|
7905
9343
|
let regexWord = null;
|
|
7906
9344
|
|
|
@@ -7995,14 +9433,14 @@ class AuroMenu extends i$2 {
|
|
|
7995
9433
|
*/
|
|
7996
9434
|
handleSelectState(option) {
|
|
7997
9435
|
if (this.multiSelect) {
|
|
7998
|
-
const currentValue = this.
|
|
9436
|
+
const currentValue = this.formattedValue || [];
|
|
7999
9437
|
const currentSelected = this.optionSelected || [];
|
|
8000
9438
|
|
|
8001
9439
|
if (!currentValue.includes(option.value)) {
|
|
8002
|
-
this.value = [
|
|
9440
|
+
this.value = JSON.stringify([
|
|
8003
9441
|
...currentValue,
|
|
8004
9442
|
option.value
|
|
8005
|
-
];
|
|
9443
|
+
]);
|
|
8006
9444
|
}
|
|
8007
9445
|
if (!currentSelected.includes(option)) {
|
|
8008
9446
|
this.optionSelected = [
|
|
@@ -8025,13 +9463,15 @@ class AuroMenu extends i$2 {
|
|
|
8025
9463
|
* @param {HTMLElement} option - The menuoption to be deselected.
|
|
8026
9464
|
*/
|
|
8027
9465
|
handleDeselectState(option) {
|
|
8028
|
-
if (this.multiSelect
|
|
9466
|
+
if (this.multiSelect) {
|
|
8029
9467
|
// Remove this option from array
|
|
8030
|
-
|
|
9468
|
+
const newFormattedValue = (this.formattedValue || []).filter((val) => val !== option.value);
|
|
8031
9469
|
|
|
8032
9470
|
// If array is empty after removal, set back to undefined
|
|
8033
|
-
if (
|
|
9471
|
+
if (newFormattedValue && newFormattedValue.length === 0) {
|
|
8034
9472
|
this.value = undefined;
|
|
9473
|
+
} else {
|
|
9474
|
+
this.value = JSON.stringify(newFormattedValue);
|
|
8035
9475
|
}
|
|
8036
9476
|
|
|
8037
9477
|
this.optionSelected = this.optionSelected.filter((val) => val !== option);
|
|
@@ -8097,21 +9537,20 @@ class AuroMenu extends i$2 {
|
|
|
8097
9537
|
* @param {HTMLElement} menu - Root menu element.
|
|
8098
9538
|
*/
|
|
8099
9539
|
handleNestedMenus(menu) {
|
|
8100
|
-
|
|
9540
|
+
menu.level = menu.parentElement.level >= 0 ? menu.parentElement.level + 1 : 0;
|
|
8101
9541
|
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
if (!
|
|
8106
|
-
|
|
9542
|
+
if (menu.level > 0) {
|
|
9543
|
+
menu.setAttribute('role', 'group');
|
|
9544
|
+
menu.removeAttribute("root");
|
|
9545
|
+
if (!menu.hasAttribute('aria-label')) {
|
|
9546
|
+
menu.setAttribute('aria-label', 'submenu');
|
|
8107
9547
|
}
|
|
9548
|
+
}
|
|
8108
9549
|
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
this.handleNestedMenus(nestedMenu);
|
|
9550
|
+
const options = menu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption]');
|
|
9551
|
+
options.forEach((option) => {
|
|
9552
|
+
const regex = new RegExp(this.nestingSpacer, "gu");
|
|
9553
|
+
option.innerHTML = this.nestingSpacer.repeat(menu.level) + option.innerHTML.replace(regex, '');
|
|
8115
9554
|
});
|
|
8116
9555
|
}
|
|
8117
9556
|
|
|
@@ -8353,28 +9792,39 @@ class AuroMenu extends i$2 {
|
|
|
8353
9792
|
}
|
|
8354
9793
|
|
|
8355
9794
|
/**
|
|
8356
|
-
*
|
|
8357
|
-
* @
|
|
9795
|
+
* Logic to determine the layout of the component.
|
|
9796
|
+
* @protected
|
|
9797
|
+
* @returns {void}
|
|
8358
9798
|
*/
|
|
8359
|
-
|
|
9799
|
+
renderLayout() {
|
|
8360
9800
|
if (this.loading) {
|
|
8361
9801
|
return x`
|
|
8362
|
-
<
|
|
8363
|
-
<
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
|
|
9802
|
+
<div class="wrapper">
|
|
9803
|
+
<auro-menuoption
|
|
9804
|
+
disabled
|
|
9805
|
+
loadingplaceholder
|
|
9806
|
+
class="${this.hasLoadingPlaceholder ? "" : "empty"}"
|
|
9807
|
+
>
|
|
9808
|
+
<div>
|
|
9809
|
+
<slot name="loadingIcon"></slot>
|
|
9810
|
+
<slot name="loadingText"></slot>
|
|
9811
|
+
</div>
|
|
9812
|
+
</auro-menuoption>
|
|
9813
|
+
</div>
|
|
8368
9814
|
`;
|
|
8369
9815
|
}
|
|
8370
9816
|
|
|
8371
|
-
return x
|
|
9817
|
+
return x`
|
|
9818
|
+
<div class="wrapper">
|
|
9819
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
9820
|
+
</div>
|
|
9821
|
+
`;
|
|
8372
9822
|
}
|
|
8373
9823
|
}
|
|
8374
9824
|
|
|
8375
|
-
var styleCss$1 = i$5`:host{display:flex;align-items:center;padding:var(--ds-size-
|
|
9825
|
+
var styleCss$1 = i$5`:host{cursor:pointer;user-select:none}: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);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box],:host .wrapper[class*=shape-snowflake]{border-radius:unset}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem)}:host .wrapper[class*=-lg]:not(:last-child){margin-bottom:var(--ds-size-50, 0.25rem)}:host .wrapper[class*=-xl]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem)}:host .wrapper[class*=-xl]:not(:last-child){margin-bottom:var(--ds-size-100, 0.5rem)}: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)}:host ::slotted(strong){font-weight:700}: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}`;
|
|
8376
9826
|
|
|
8377
|
-
var colorCss$1 = i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
9827
|
+
var colorCss$1 = i$5`:host .wrapper{border:1px solid var(--ds-auro-menuoption-container-border-color);background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
8378
9828
|
|
|
8379
9829
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
8380
9830
|
// See LICENSE in the project root for license information.
|
|
@@ -8722,8 +10172,12 @@ class AuroIcon extends BaseIcon {
|
|
|
8722
10172
|
async firstUpdated() {
|
|
8723
10173
|
await super.firstUpdated();
|
|
8724
10174
|
|
|
8725
|
-
|
|
8726
|
-
|
|
10175
|
+
/**
|
|
10176
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
10177
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
10178
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
10179
|
+
*/
|
|
10180
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
8727
10181
|
const svgDesc = this.svg.querySelector('desc');
|
|
8728
10182
|
|
|
8729
10183
|
if (svgDesc) {
|
|
@@ -8767,7 +10221,7 @@ class AuroIcon extends BaseIcon {
|
|
|
8767
10221
|
}
|
|
8768
10222
|
}
|
|
8769
10223
|
|
|
8770
|
-
var iconVersion = '8.0.
|
|
10224
|
+
var iconVersion = '8.0.4';
|
|
8771
10225
|
|
|
8772
10226
|
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>"};
|
|
8773
10227
|
|
|
@@ -8785,10 +10239,13 @@ var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlin
|
|
|
8785
10239
|
* @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
|
|
8786
10240
|
* @slot - Specifies text for an option, but is not the value.
|
|
8787
10241
|
*/
|
|
8788
|
-
class AuroMenuOption extends
|
|
10242
|
+
class AuroMenuOption extends AuroElement$4 {
|
|
8789
10243
|
constructor() {
|
|
8790
10244
|
super();
|
|
8791
10245
|
|
|
10246
|
+
this.size = ""; // md, lg, xl
|
|
10247
|
+
this.shape = ""; // box, rounded, pill
|
|
10248
|
+
|
|
8792
10249
|
/**
|
|
8793
10250
|
* Generate unique names for dependency components.
|
|
8794
10251
|
*/
|
|
@@ -8807,11 +10264,12 @@ class AuroMenuOption extends i$2 {
|
|
|
8807
10264
|
/**
|
|
8808
10265
|
* @private
|
|
8809
10266
|
*/
|
|
8810
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
10267
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
8811
10268
|
}
|
|
8812
10269
|
|
|
8813
10270
|
static get properties() {
|
|
8814
10271
|
return {
|
|
10272
|
+
...super.properties,
|
|
8815
10273
|
nocheckmark: {
|
|
8816
10274
|
type: Boolean,
|
|
8817
10275
|
reflect: true
|
|
@@ -8851,7 +10309,7 @@ class AuroMenuOption extends i$2 {
|
|
|
8851
10309
|
*
|
|
8852
10310
|
*/
|
|
8853
10311
|
static register(name = "auro-menuoption") {
|
|
8854
|
-
AuroLibraryRuntimeUtils$
|
|
10312
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenuOption);
|
|
8855
10313
|
}
|
|
8856
10314
|
|
|
8857
10315
|
firstUpdated() {
|
|
@@ -8873,6 +10331,8 @@ class AuroMenuOption extends i$2 {
|
|
|
8873
10331
|
|
|
8874
10332
|
// observer for selected property changes
|
|
8875
10333
|
updated(changedProperties) {
|
|
10334
|
+
super.updated(changedProperties);
|
|
10335
|
+
|
|
8876
10336
|
if (changedProperties.has('selected')) {
|
|
8877
10337
|
this.setAttribute('aria-selected', this.selected.toString());
|
|
8878
10338
|
}
|
|
@@ -8894,10 +10354,19 @@ class AuroMenuOption extends i$2 {
|
|
|
8894
10354
|
return u`<${this.iconTag} customColor customSvg slot="icon">${svg}</${this.iconTag}>`;
|
|
8895
10355
|
}
|
|
8896
10356
|
|
|
8897
|
-
|
|
10357
|
+
/**
|
|
10358
|
+
* Logic to determine the layout of the component.
|
|
10359
|
+
* @protected
|
|
10360
|
+
* @returns {void}
|
|
10361
|
+
*/
|
|
10362
|
+
renderLayout() {
|
|
8898
10363
|
return u`
|
|
8899
|
-
|
|
8900
|
-
|
|
10364
|
+
<div class="wrapper">
|
|
10365
|
+
${this.selected && !this.nocheckmark
|
|
10366
|
+
? this.generateIconHtml(checkmarkIcon.svg)
|
|
10367
|
+
: undefined}
|
|
10368
|
+
<slot></slot>
|
|
10369
|
+
</div>
|
|
8901
10370
|
`;
|
|
8902
10371
|
}
|
|
8903
10372
|
}
|
|
@@ -8919,7 +10388,6 @@ function initExamples(initCount) {
|
|
|
8919
10388
|
inDialogExample();
|
|
8920
10389
|
resetStateExample();
|
|
8921
10390
|
auroMenuLoadingExample();
|
|
8922
|
-
valueTextExample();
|
|
8923
10391
|
} catch (err) {
|
|
8924
10392
|
if (initCount <= 20) {
|
|
8925
10393
|
// setTimeout handles issue where content is sometimes loaded after the functions get called
|