@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.1 → 0.0.0-pr624.10
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 +1 -0
- package/components/bibtemplate/dist/index.js +88 -6
- package/components/bibtemplate/dist/registered.js +88 -6
- package/components/checkbox/demo/api.min.js +4 -3
- package/components/checkbox/demo/index.min.js +4 -3
- package/components/checkbox/dist/index.js +4 -3
- package/components/checkbox/dist/registered.js +4 -3
- package/components/combobox/demo/api.md +30 -29
- package/components/combobox/demo/api.min.js +598 -428
- package/components/combobox/demo/index.html +0 -1
- package/components/combobox/demo/index.md +43 -0
- package/components/combobox/demo/index.min.js +596 -426
- package/components/combobox/dist/auro-combobox.d.ts +13 -18
- package/components/combobox/dist/index.js +458 -273
- package/components/combobox/dist/registered.js +458 -273
- package/components/counter/demo/api.min.js +377 -62
- package/components/counter/demo/index.min.js +377 -62
- package/components/counter/dist/index.js +377 -62
- package/components/counter/dist/registered.js +377 -62
- package/components/datepicker/demo/api.md +13 -5
- package/components/datepicker/demo/api.min.js +847 -324
- package/components/datepicker/demo/index.md +13 -0
- package/components/datepicker/demo/index.min.js +847 -324
- package/components/datepicker/dist/auro-datepicker.d.ts +21 -2
- package/components/datepicker/dist/index.js +677 -154
- package/components/datepicker/dist/registered.js +677 -154
- package/components/dropdown/demo/api.md +2 -2
- package/components/dropdown/demo/api.min.js +199 -37
- package/components/dropdown/demo/index.md +45 -0
- package/components/dropdown/demo/index.min.js +199 -37
- package/components/dropdown/dist/auro-dropdown.d.ts +10 -1
- package/components/dropdown/dist/auro-dropdownBib.d.ts +8 -0
- package/components/dropdown/dist/index.js +199 -37
- package/components/dropdown/dist/registered.js +199 -37
- package/components/dropdown/dist/styles/classic/color-css.d.ts +2 -0
- package/components/dropdown/dist/styles/classic/style-css.d.ts +2 -0
- package/components/input/demo/api.md +53 -49
- package/components/input/demo/api.min.js +121 -27
- package/components/input/demo/index.min.js +121 -27
- package/components/input/dist/auro-input.d.ts +22 -14
- package/components/input/dist/base-input.d.ts +1 -1
- package/components/input/dist/index.js +121 -27
- package/components/input/dist/registered.js +121 -27
- package/components/layoutElement/dist/index.d.ts +1 -0
- package/components/layoutElement/dist/index.js +95 -1
- package/components/menu/demo/api.md +11 -11
- package/components/menu/demo/api.min.js +115 -130
- package/components/menu/demo/index.min.js +115 -130
- package/components/menu/dist/auro-menu-utils.d.ts +0 -8
- package/components/menu/dist/auro-menu.d.ts +3 -8
- package/components/menu/dist/index.d.ts +1 -1
- package/components/menu/dist/index.js +116 -90
- package/components/menu/dist/registered.js +115 -130
- package/components/radio/demo/api.min.js +4 -3
- package/components/radio/demo/index.min.js +4 -3
- package/components/radio/dist/index.js +4 -3
- package/components/radio/dist/registered.js +4 -3
- package/components/select/demo/api.js +2 -0
- package/components/select/demo/api.md +108 -42
- package/components/select/demo/api.min.js +1264 -352
- package/components/select/demo/index.html +1 -0
- package/components/select/demo/index.md +298 -777
- package/components/select/demo/index.min.js +1251 -351
- package/components/select/dist/auro-select.d.ts +110 -18
- package/components/select/dist/helptextVersion.d.ts +2 -0
- package/components/select/dist/index.js +1105 -190
- package/components/select/dist/registered.js +1105 -190
- package/components/select/dist/styles/shapeSize-css.d.ts +2 -0
- package/components/select/dist/styles/tokens-css.d.ts +2 -0
- package/package.json +3 -3
- /package/components/{dropdown → datepicker}/dist/styles/default/color-css.d.ts +0 -0
- /package/components/{dropdown/dist/styles/default → datepicker/dist/styles/emphasized}/style-css.d.ts +0 -0
- /package/components/{dropdown/dist/styles/default/bibColors-css.d.ts → datepicker/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/dropdown/dist/styles/{default/bibStyles-css.d.ts → classic/bibColors-css.d.ts} +0 -0
- /package/components/dropdown/dist/styles/{style-css.d.ts → classic/bibStyles-css.d.ts} +0 -0
|
@@ -14,11 +14,11 @@ function valueExample() {
|
|
|
14
14
|
const valueExample = document.querySelector('#valueExample');
|
|
15
15
|
|
|
16
16
|
document.querySelector('#validValueExampleBtn').addEventListener('click', () => {
|
|
17
|
-
valueExample.value = [
|
|
17
|
+
valueExample.value = '["arrival", "prefer alaska"]';
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
document.querySelector('#invalidValueExampleBtn').addEventListener('click', () => {
|
|
21
|
-
valueExample.value = [
|
|
21
|
+
valueExample.value = '["flight course"]';
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -90,6 +90,17 @@ 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
|
+
|
|
93
104
|
/**
|
|
94
105
|
* @license
|
|
95
106
|
* Copyright 2019 Google LLC
|
|
@@ -136,6 +147,102 @@ const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});let i$1 = cl
|
|
|
136
147
|
*/
|
|
137
148
|
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);
|
|
138
149
|
|
|
150
|
+
let AuroElement$3 = class AuroElement extends i$2 {
|
|
151
|
+
static get properties() {
|
|
152
|
+
return {
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Defines the language of an element.
|
|
156
|
+
* @default {'default'}
|
|
157
|
+
*/
|
|
158
|
+
layout: {
|
|
159
|
+
type: String,
|
|
160
|
+
attribute: "layout",
|
|
161
|
+
reflect: true
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
shape: {
|
|
165
|
+
type: String,
|
|
166
|
+
attribute: "shape",
|
|
167
|
+
reflect: true
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
size: {
|
|
171
|
+
type: String,
|
|
172
|
+
attribute: "size",
|
|
173
|
+
reflect: true
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
onDark: {
|
|
177
|
+
type: Boolean,
|
|
178
|
+
attribute: "ondark",
|
|
179
|
+
reflect: true
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
resetShapeClasses() {
|
|
185
|
+
if (this.shape && this.size) {
|
|
186
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
187
|
+
|
|
188
|
+
if (wrapper) {
|
|
189
|
+
wrapper.classList.forEach((className) => {
|
|
190
|
+
if (className.startsWith('shape-')) {
|
|
191
|
+
wrapper.classList.remove(className);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
resetLayoutClasses() {
|
|
201
|
+
if (this.layout) {
|
|
202
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
203
|
+
|
|
204
|
+
if (wrapper) {
|
|
205
|
+
wrapper.classList.forEach((className) => {
|
|
206
|
+
if (className.startsWith('layout-')) {
|
|
207
|
+
wrapper.classList.remove(className);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
updateComponentArchitecture() {
|
|
217
|
+
this.resetLayoutClasses();
|
|
218
|
+
this.resetShapeClasses();
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
updated(changedProperties) {
|
|
222
|
+
if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
|
|
223
|
+
this.updateComponentArchitecture();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
|
|
228
|
+
// This will catch if an invalid layout value is passed in and render the default layout if so.
|
|
229
|
+
render() {
|
|
230
|
+
try {
|
|
231
|
+
return this.renderLayout();
|
|
232
|
+
} catch (error) {
|
|
233
|
+
// failed to get the defined layout
|
|
234
|
+
console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
|
|
235
|
+
|
|
236
|
+
// fallback to the default layout
|
|
237
|
+
return this.getLayout('default');
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
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:72px;max-height:72px;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}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:72px;max-height:72px;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}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-pill-md{min-height:72px;max-height:72px;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}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:72px;max-height:72px;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}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:72px;max-height:72px;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}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;min-height:44px;max-height:44px}`;
|
|
243
|
+
|
|
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-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-select-outline-color: transparent}`;
|
|
245
|
+
|
|
139
246
|
class DateFormatter {
|
|
140
247
|
|
|
141
248
|
constructor() {
|
|
@@ -192,9 +299,10 @@ class DateFormatter {
|
|
|
192
299
|
/**
|
|
193
300
|
* Convert a date object to string format.
|
|
194
301
|
* @param {Object} date - Date to convert to string.
|
|
195
|
-
* @
|
|
302
|
+
* @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
|
|
303
|
+
* @returns {String} Returns the date as a string.
|
|
196
304
|
*/
|
|
197
|
-
this.getDateAsString = (date) => date.toLocaleDateString(
|
|
305
|
+
this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
|
|
198
306
|
year: "numeric",
|
|
199
307
|
month: "2-digit",
|
|
200
308
|
day: "2-digit",
|
|
@@ -386,7 +494,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
|
|
|
386
494
|
const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
|
|
387
495
|
|
|
388
496
|
// Get the date string of the date object we created from the string date
|
|
389
|
-
const actualDateStr = dateFormatter.getDateAsString(dateObj);
|
|
497
|
+
const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
|
|
390
498
|
|
|
391
499
|
// Guard Clause: Generated date matches date string input
|
|
392
500
|
if (expectedDateStr !== actualDateStr) {
|
|
@@ -551,7 +659,7 @@ const {
|
|
|
551
659
|
|
|
552
660
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
553
661
|
|
|
554
|
-
let AuroLibraryRuntimeUtils$
|
|
662
|
+
let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
555
663
|
|
|
556
664
|
/* eslint-disable jsdoc/require-param */
|
|
557
665
|
|
|
@@ -621,7 +729,7 @@ let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
|
|
|
621
729
|
class AuroFormValidation {
|
|
622
730
|
|
|
623
731
|
constructor() {
|
|
624
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
732
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$4();
|
|
625
733
|
}
|
|
626
734
|
|
|
627
735
|
/**
|
|
@@ -1033,7 +1141,7 @@ let AuroDependencyVersioning$2 = class AuroDependencyVersioning {
|
|
|
1033
1141
|
|
|
1034
1142
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
1035
1143
|
|
|
1036
|
-
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
1144
|
+
let AuroLibraryRuntimeUtils$2$1 = class AuroLibraryRuntimeUtils {
|
|
1037
1145
|
|
|
1038
1146
|
/* eslint-disable jsdoc/require-param */
|
|
1039
1147
|
|
|
@@ -1616,10 +1724,11 @@ const flip$1 = function (options) {
|
|
|
1616
1724
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
1617
1725
|
const nextPlacement = placements[nextIndex];
|
|
1618
1726
|
if (nextPlacement) {
|
|
1619
|
-
var _overflowsData$;
|
|
1620
1727
|
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
1621
|
-
|
|
1622
|
-
if
|
|
1728
|
+
if (!ignoreCrossAxisOverflow ||
|
|
1729
|
+
// We leave the current main axis only if every placement on that axis
|
|
1730
|
+
// overflows the main axis.
|
|
1731
|
+
overflowsData.every(d => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {
|
|
1623
1732
|
// Try next placement and re-run the lifecycle.
|
|
1624
1733
|
return {
|
|
1625
1734
|
data: {
|
|
@@ -2640,8 +2749,28 @@ class AuroFloatingUI {
|
|
|
2640
2749
|
if (!AuroFloatingUI.isMousePressHandlerInitialized && window && window.addEventListener) {
|
|
2641
2750
|
AuroFloatingUI.isMousePressHandlerInitialized = true;
|
|
2642
2751
|
|
|
2752
|
+
// Track timeout for isMousePressed reset to avoid race conditions
|
|
2753
|
+
if (!AuroFloatingUI._mousePressedTimeout) {
|
|
2754
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
2755
|
+
}
|
|
2643
2756
|
const mouseEventGlobalHandler = (event) => {
|
|
2644
|
-
|
|
2757
|
+
const isPressed = event.type === 'mousedown';
|
|
2758
|
+
if (isPressed) {
|
|
2759
|
+
// Clear any pending timeout to prevent race condition
|
|
2760
|
+
if (AuroFloatingUI._mousePressedTimeout !== null) {
|
|
2761
|
+
clearTimeout(AuroFloatingUI._mousePressedTimeout);
|
|
2762
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
2763
|
+
}
|
|
2764
|
+
if (!AuroFloatingUI.isMousePressed) {
|
|
2765
|
+
AuroFloatingUI.isMousePressed = true;
|
|
2766
|
+
}
|
|
2767
|
+
} else if (AuroFloatingUI.isMousePressed && !isPressed) {
|
|
2768
|
+
// Schedule reset and track timeout ID
|
|
2769
|
+
AuroFloatingUI._mousePressedTimeout = setTimeout(() => {
|
|
2770
|
+
AuroFloatingUI.isMousePressed = false;
|
|
2771
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
2772
|
+
}, 0);
|
|
2773
|
+
}
|
|
2645
2774
|
};
|
|
2646
2775
|
|
|
2647
2776
|
window.addEventListener('mousedown', mouseEventGlobalHandler);
|
|
@@ -2768,6 +2897,7 @@ class AuroFloatingUI {
|
|
|
2768
2897
|
|
|
2769
2898
|
// Compute the position of the bib
|
|
2770
2899
|
computePosition(this.element.trigger, this.element.bib, {
|
|
2900
|
+
strategy: this.element.floaterConfig?.strategy || 'fixed',
|
|
2771
2901
|
placement: this.element.floaterConfig?.placement,
|
|
2772
2902
|
middleware: middleware || []
|
|
2773
2903
|
}).then(({ x, y }) => { // eslint-disable-line id-length
|
|
@@ -2902,8 +3032,9 @@ class AuroFloatingUI {
|
|
|
2902
3032
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2903
3033
|
return;
|
|
2904
3034
|
}
|
|
2905
|
-
|
|
2906
|
-
if
|
|
3035
|
+
|
|
3036
|
+
// if fullscreen bib is in fullscreen mode, do not close
|
|
3037
|
+
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2907
3038
|
return;
|
|
2908
3039
|
}
|
|
2909
3040
|
|
|
@@ -3204,8 +3335,6 @@ class AuroFloatingUI {
|
|
|
3204
3335
|
this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
|
|
3205
3336
|
}
|
|
3206
3337
|
|
|
3207
|
-
document.body.append(this.element.bib);
|
|
3208
|
-
|
|
3209
3338
|
this.regenerateBibId();
|
|
3210
3339
|
this.handleTriggerTabIndex();
|
|
3211
3340
|
|
|
@@ -3348,7 +3477,7 @@ const cacheFetch$2 = (uri, options = {}) => {
|
|
|
3348
3477
|
return _fetchMap$2.get(uri);
|
|
3349
3478
|
};
|
|
3350
3479
|
|
|
3351
|
-
var styleCss$
|
|
3480
|
+
var styleCss$2$2 = 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}`;
|
|
3352
3481
|
|
|
3353
3482
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
3354
3483
|
// See LICENSE in the project root for license information.
|
|
@@ -3391,7 +3520,7 @@ let BaseIcon$2 = class BaseIcon extends AuroElement$1$1 {
|
|
|
3391
3520
|
|
|
3392
3521
|
static get styles() {
|
|
3393
3522
|
return i$5`
|
|
3394
|
-
${styleCss$
|
|
3523
|
+
${styleCss$2$2}
|
|
3395
3524
|
`;
|
|
3396
3525
|
}
|
|
3397
3526
|
|
|
@@ -3436,6 +3565,76 @@ var tokensCss$2$1 = i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon
|
|
|
3436
3565
|
|
|
3437
3566
|
var colorCss$3$1 = 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)}`;
|
|
3438
3567
|
|
|
3568
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3569
|
+
// See LICENSE in the project root for license information.
|
|
3570
|
+
|
|
3571
|
+
// ---------------------------------------------------------------------
|
|
3572
|
+
|
|
3573
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
3574
|
+
|
|
3575
|
+
let AuroLibraryRuntimeUtils$1$2 = class AuroLibraryRuntimeUtils {
|
|
3576
|
+
|
|
3577
|
+
/* eslint-disable jsdoc/require-param */
|
|
3578
|
+
|
|
3579
|
+
/**
|
|
3580
|
+
* This will register a new custom element with the browser.
|
|
3581
|
+
* @param {String} name - The name of the custom element.
|
|
3582
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
3583
|
+
* @returns {void}
|
|
3584
|
+
*/
|
|
3585
|
+
registerComponent(name, componentClass) {
|
|
3586
|
+
if (!customElements.get(name)) {
|
|
3587
|
+
customElements.define(name, class extends componentClass {});
|
|
3588
|
+
}
|
|
3589
|
+
}
|
|
3590
|
+
|
|
3591
|
+
/**
|
|
3592
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
3593
|
+
* @returns {void}
|
|
3594
|
+
*/
|
|
3595
|
+
closestElement(
|
|
3596
|
+
selector, // selector like in .closest()
|
|
3597
|
+
base = this, // extra functionality to skip a parent
|
|
3598
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
3599
|
+
!el || el === document || el === window
|
|
3600
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
3601
|
+
: found
|
|
3602
|
+
? found // found a selector INside this element
|
|
3603
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
3604
|
+
) {
|
|
3605
|
+
return __Closest(base);
|
|
3606
|
+
}
|
|
3607
|
+
/* eslint-enable jsdoc/require-param */
|
|
3608
|
+
|
|
3609
|
+
/**
|
|
3610
|
+
* 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.
|
|
3611
|
+
* @param {Object} elem - The element to check.
|
|
3612
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
3613
|
+
* @returns {void}
|
|
3614
|
+
*/
|
|
3615
|
+
handleComponentTagRename(elem, tagName) {
|
|
3616
|
+
const tag = tagName.toLowerCase();
|
|
3617
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
3618
|
+
|
|
3619
|
+
if (elemTag !== tag) {
|
|
3620
|
+
elem.setAttribute(tag, true);
|
|
3621
|
+
}
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3624
|
+
/**
|
|
3625
|
+
* Validates if an element is a specific Auro component.
|
|
3626
|
+
* @param {Object} elem - The element to validate.
|
|
3627
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
3628
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
3629
|
+
*/
|
|
3630
|
+
elementMatch(elem, tagName) {
|
|
3631
|
+
const tag = tagName.toLowerCase();
|
|
3632
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
3633
|
+
|
|
3634
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
3635
|
+
}
|
|
3636
|
+
};
|
|
3637
|
+
|
|
3439
3638
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
3440
3639
|
// See LICENSE in the project root for license information.
|
|
3441
3640
|
|
|
@@ -3455,7 +3654,7 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3455
3654
|
*/
|
|
3456
3655
|
privateDefaults() {
|
|
3457
3656
|
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
3458
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
3657
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$1$2();
|
|
3459
3658
|
}
|
|
3460
3659
|
|
|
3461
3660
|
// function to define props used within the scope of this component
|
|
@@ -3523,7 +3722,7 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3523
3722
|
return [
|
|
3524
3723
|
super.styles,
|
|
3525
3724
|
i$5`${tokensCss$2$1}`,
|
|
3526
|
-
i$5`${styleCss$
|
|
3725
|
+
i$5`${styleCss$2$2}`,
|
|
3527
3726
|
i$5`${colorCss$3$1}`
|
|
3528
3727
|
];
|
|
3529
3728
|
}
|
|
@@ -3537,7 +3736,7 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3537
3736
|
*
|
|
3538
3737
|
*/
|
|
3539
3738
|
static register(name = "auro-icon") {
|
|
3540
|
-
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroIcon);
|
|
3739
|
+
AuroLibraryRuntimeUtils$1$2.prototype.registerComponent(name, AuroIcon);
|
|
3541
3740
|
}
|
|
3542
3741
|
|
|
3543
3742
|
connectedCallback() {
|
|
@@ -3605,7 +3804,7 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3605
3804
|
|
|
3606
3805
|
var iconVersion$2 = '6.1.2';
|
|
3607
3806
|
|
|
3608
|
-
var styleCss$
|
|
3807
|
+
var styleCss$1$2 = i$5`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}.container{display:inline-block;overflow:auto;box-sizing:border-box;margin:var(--ds-size-50, 0.25rem) 0}: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}`;
|
|
3609
3808
|
|
|
3610
3809
|
var colorCss$2$1 = 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)}`;
|
|
3611
3810
|
|
|
@@ -3615,7 +3814,6 @@ var tokensCss$1$1 = i$5`:host(:not([ondark])){--ds-auro-dropdown-label-text-colo
|
|
|
3615
3814
|
// See LICENSE in the project root for license information.
|
|
3616
3815
|
|
|
3617
3816
|
|
|
3618
|
-
|
|
3619
3817
|
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
3620
3818
|
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
3621
3819
|
'xl',
|
|
@@ -3640,12 +3838,12 @@ class AuroDropdownBib extends i$2 {
|
|
|
3640
3838
|
*/
|
|
3641
3839
|
this._mobileBreakpointValue = undefined;
|
|
3642
3840
|
|
|
3643
|
-
AuroLibraryRuntimeUtils$1.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
3841
|
+
AuroLibraryRuntimeUtils$2$1.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
3644
3842
|
}
|
|
3645
3843
|
|
|
3646
3844
|
static get styles() {
|
|
3647
3845
|
return [
|
|
3648
|
-
styleCss$
|
|
3846
|
+
styleCss$1$2,
|
|
3649
3847
|
colorCss$2$1,
|
|
3650
3848
|
tokensCss$1$1
|
|
3651
3849
|
];
|
|
@@ -3685,6 +3883,13 @@ class AuroDropdownBib extends i$2 {
|
|
|
3685
3883
|
type: Boolean,
|
|
3686
3884
|
reflect: true
|
|
3687
3885
|
},
|
|
3886
|
+
|
|
3887
|
+
/**
|
|
3888
|
+
* A reference to the associated bib template element.
|
|
3889
|
+
*/
|
|
3890
|
+
bibTemplate: {
|
|
3891
|
+
type: Object
|
|
3892
|
+
}
|
|
3688
3893
|
};
|
|
3689
3894
|
}
|
|
3690
3895
|
|
|
@@ -3717,9 +3922,50 @@ class AuroDropdownBib extends i$2 {
|
|
|
3717
3922
|
}
|
|
3718
3923
|
}
|
|
3719
3924
|
});
|
|
3925
|
+
|
|
3926
|
+
if (this.bibTemplate) {
|
|
3927
|
+
// If the bib template is found, set the fullscreen attribute
|
|
3928
|
+
if (this.isFullscreen) {
|
|
3929
|
+
this.bibTemplate.setAttribute('isFullscreen', 'true');
|
|
3930
|
+
} else {
|
|
3931
|
+
this.bibTemplate.removeAttribute('isFullscreen');
|
|
3932
|
+
}
|
|
3933
|
+
}
|
|
3720
3934
|
}
|
|
3721
3935
|
}
|
|
3722
3936
|
|
|
3937
|
+
connectedCallback() {
|
|
3938
|
+
super.connectedCallback();
|
|
3939
|
+
|
|
3940
|
+
// Listen for the auro-bibtemplate-connected event to set the fullscreen attribute
|
|
3941
|
+
this.addEventListener('auro-bibtemplate-connected', (event) => {
|
|
3942
|
+
const bibTemplate = event.detail.element;
|
|
3943
|
+
this.bibTemplate = bibTemplate;
|
|
3944
|
+
|
|
3945
|
+
if (bibTemplate) {
|
|
3946
|
+
// If the bib template is found, set the fullscreen attribute
|
|
3947
|
+
if (this.isFullscreen) {
|
|
3948
|
+
bibTemplate.setAttribute('isFullscreen', 'true');
|
|
3949
|
+
} else {
|
|
3950
|
+
bibTemplate.removeAttribute('isFullscreen');
|
|
3951
|
+
}
|
|
3952
|
+
}
|
|
3953
|
+
});
|
|
3954
|
+
}
|
|
3955
|
+
|
|
3956
|
+
firstUpdated(changedProperties) {
|
|
3957
|
+
super.firstUpdated(changedProperties);
|
|
3958
|
+
|
|
3959
|
+
// Dispatch a custom event when the component is connected
|
|
3960
|
+
this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
|
|
3961
|
+
bubbles: true,
|
|
3962
|
+
composed: true,
|
|
3963
|
+
detail: {
|
|
3964
|
+
element: this
|
|
3965
|
+
}
|
|
3966
|
+
}));
|
|
3967
|
+
}
|
|
3968
|
+
|
|
3723
3969
|
// function that renders the HTML and CSS into the scope of the component
|
|
3724
3970
|
render() {
|
|
3725
3971
|
return u`
|
|
@@ -3732,21 +3978,23 @@ class AuroDropdownBib extends i$2 {
|
|
|
3732
3978
|
|
|
3733
3979
|
var dropdownVersion$1 = '3.0.0';
|
|
3734
3980
|
|
|
3735
|
-
var shapeSizeCss = i$5`.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:
|
|
3736
|
-
|
|
3737
|
-
var styleCss$1$2 = i$5`:host([layout*=classic]){position:relative;display:inline-block;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]) .trigger{position:relative;display:flex;align-items:center}:host([layout*=classic]) .trigger[showBorder]{border-width:1px;border-style:solid;cursor:pointer;outline-style:solid;outline-width:1px}@media(hover: hover){:host([layout*=classic]) .trigger:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}: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([layout*=classic][fluid]){display:block}:host([layout*=classic][matchwidth]) #bibSizer{width:100%}:host([layout*=classic][disabled]){pointer-events:none}:host([layout*=classic][inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([layout*=classic][common]) .trigger,:host([layout*=classic][inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([layout*=classic][inset][bordered][labeled]) .trigger{padding:var(--ds-size-100, 0.5rem) var(--ds-size-150, 0.75rem)}:host([layout*=classic][common]) .trigger,:host([layout*=classic][rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
|
|
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:72px;max-height:72px;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}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:72px;max-height:72px;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}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-pill-md{min-height:72px;max-height:72px;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}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:72px;max-height:72px;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}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:72px;max-height:72px;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}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;min-height:44px;max-height:44px}`;
|
|
3738
3982
|
|
|
3739
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:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-brand, #00274a)}:host([ondark]) .wrapper:focus,:host([ondark]) .wrapper:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff)}:host([error]:not([ondark])){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([error][ondark]){--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}.helpText{color:var(--ds-auro-dropdown-helptext-text-color)}`;
|
|
3740
3984
|
|
|
3741
|
-
var
|
|
3985
|
+
var classicColorCss = i$5`:host([layout*=classic]) .label{color:var(--ds-auro-dropdown-label-text-color)}:host([layout*=classic]) .trigger{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-container-color);color:var(--ds-auro-dropdown-trigger-text-color);outline-color:var(--ds-auro-dropdown-trigger-outline-color)}:host([layout*=classic]) .trigger:focus-within,:host([layout*=classic]) .trigger: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([layout*=classic])[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)}:host([layout*=classic])[common],:host([layout*=classic])[bordered]{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-bold, #585e67)}:host([layout*=classic])[common] .trigger:active,:host([layout*=classic])[common] .trigger:focus-within,:host([layout*=classic])[bordered] .trigger:active,:host([layout*=classic])[bordered] .trigger:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a)}:host([layout*=classic])[error]{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([layout*=classic])[error] .trigger{outline:solid 1px var(--ds-auro-dropdown-trigger-border-color)}:host([layout*=classic])[error] .trigger:focus-within,:host([layout*=classic])[error] .trigger: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([layout*=classic])[disabled][common],:host([layout*=classic])[disabled][bordered]{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host([layout*=classic])[onDark]{--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([layout*=classic])[onDark]:focus-within,:host([layout*=classic])[onDark]: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([layout*=classic])[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)}:host([layout*=classic])[onDark][common],:host([layout*=classic])[onDark][bordered]{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff)}:host([layout*=classic])[onDark][common] .trigger:focus-within,:host([layout*=classic])[onDark][common] .trigger:active,:host([layout*=classic])[onDark][bordered] .trigger:focus-within,:host([layout*=classic])[onDark][bordered] .trigger: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([layout*=classic])[onDark][error]{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}:host([layout*=classic])[onDark][error] .trigger{outline:solid 1px var(--ds-auro-dropdown-trigger-border-color)}:host([layout*=classic])[onDark][error] .trigger:focus-within,:host([layout*=classic])[onDark][error] .trigger: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([layout*=classic])[onDark][disabled][common],:host([layout*=classic])[onDark][disabled][bordered]{--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}`;
|
|
3986
|
+
|
|
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]) .trigger{display:flex;flex-direction:row}@media(hover: hover){:host([layout*=classic]) .trigger:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}: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([layout*=classic][fluid]){display:block}:host([layout*=classic][matchwidth]) #bibSizer{width:100%}:host([layout*=classic][disabled]){pointer-events:none}:host([layout*=classic][inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([layout*=classic][common]) .trigger,:host([layout*=classic][inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([layout*=classic][inset][bordered][labeled]) .trigger{padding:var(--ds-size-100, 0.5rem) var(--ds-size-150, 0.75rem)}:host([layout*=classic][common]) .trigger,:host([layout*=classic][rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
|
|
3988
|
+
|
|
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}.trigger{display:flex;flex:1;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;width:100%;flex:1;align-items:center;justify-content:center}.triggerContent{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)}`;
|
|
3742
3990
|
|
|
3743
|
-
var styleSnowflakeCss = i$5`:host{display:block}.wrapper{display:flex;flex-direction:
|
|
3991
|
+
var styleSnowflakeCss = i$5`:host{display:block}.wrapper{display:flex;flex-direction:row}.trigger{display:flex;flex:1;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;width:100%;flex:1;align-items:center;justify-content:center}.triggerContent{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)}`;
|
|
3744
3992
|
|
|
3745
|
-
var colorCss$
|
|
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-advanced-color-state-error-inverse, #f9a4a8)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
3746
3994
|
|
|
3747
|
-
var styleCss$
|
|
3995
|
+
var styleCss$6 = i$5`.helptext-wrapper{display:none;font-size:var(--ds-basic-text-body-xs-font-size, 12px);font-weight:var(--ds-basic-text-body-xs-font-weight, 450);letter-spacing:var(--ds-basic-text-body-xs-letter-spacing, 0);line-height:var(--ds-basic-text-body-xs-line-height, 16px)}:host([large]) .helptext-wrapper{font-size:var(--ds-basic-text-body-default-font-size, 16px);font-weight:var(--ds-basic-text-body-default-font-weight, 450);letter-spacing:var(--ds-basic-text-body-default-letter-spacing, 0);line-height:var(--ds-basic-text-body-default-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}`;
|
|
3748
3996
|
|
|
3749
|
-
var tokensCss$
|
|
3997
|
+
var tokensCss$4 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
3750
3998
|
|
|
3751
3999
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3752
4000
|
// See LICENSE in the project root for license information.
|
|
@@ -3755,7 +4003,7 @@ var tokensCss$3 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texti
|
|
|
3755
4003
|
|
|
3756
4004
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
3757
4005
|
|
|
3758
|
-
let AuroLibraryRuntimeUtils$
|
|
4006
|
+
let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
|
|
3759
4007
|
|
|
3760
4008
|
/* eslint-disable jsdoc/require-param */
|
|
3761
4009
|
|
|
@@ -3827,7 +4075,7 @@ let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
|
3827
4075
|
*
|
|
3828
4076
|
* @attr { Boolean } large - If declared, make font-size to 1rem(16px).
|
|
3829
4077
|
*/
|
|
3830
|
-
class AuroHelpText extends i$2 {
|
|
4078
|
+
let AuroHelpText$1 = class AuroHelpText extends i$2 {
|
|
3831
4079
|
|
|
3832
4080
|
constructor() {
|
|
3833
4081
|
super();
|
|
@@ -3836,14 +4084,14 @@ class AuroHelpText extends i$2 {
|
|
|
3836
4084
|
this.onDark = false;
|
|
3837
4085
|
this.hasTextContent = false;
|
|
3838
4086
|
|
|
3839
|
-
AuroLibraryRuntimeUtils$
|
|
4087
|
+
AuroLibraryRuntimeUtils$3.prototype.handleComponentTagRename(this, 'auro-helptext');
|
|
3840
4088
|
}
|
|
3841
4089
|
|
|
3842
4090
|
static get styles() {
|
|
3843
4091
|
return [
|
|
3844
|
-
colorCss$
|
|
3845
|
-
styleCss$
|
|
3846
|
-
tokensCss$
|
|
4092
|
+
colorCss$5,
|
|
4093
|
+
styleCss$6,
|
|
4094
|
+
tokensCss$4
|
|
3847
4095
|
];
|
|
3848
4096
|
}
|
|
3849
4097
|
|
|
@@ -3892,7 +4140,7 @@ class AuroHelpText extends i$2 {
|
|
|
3892
4140
|
*
|
|
3893
4141
|
*/
|
|
3894
4142
|
static register(name = "auro-helptext") {
|
|
3895
|
-
AuroLibraryRuntimeUtils$
|
|
4143
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroHelpText);
|
|
3896
4144
|
}
|
|
3897
4145
|
|
|
3898
4146
|
updated() {
|
|
@@ -3946,9 +4194,9 @@ class AuroHelpText extends i$2 {
|
|
|
3946
4194
|
</div>
|
|
3947
4195
|
`;
|
|
3948
4196
|
}
|
|
3949
|
-
}
|
|
4197
|
+
};
|
|
3950
4198
|
|
|
3951
|
-
var helpTextVersion = '1.0.0';
|
|
4199
|
+
var helpTextVersion$1 = '1.0.0';
|
|
3952
4200
|
|
|
3953
4201
|
let AuroElement$2 = class AuroElement extends i$2 {
|
|
3954
4202
|
static get properties() {
|
|
@@ -4068,12 +4316,13 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4068
4316
|
this.matchWidth = false;
|
|
4069
4317
|
this.noHideOnThisFocusLoss = false;
|
|
4070
4318
|
|
|
4071
|
-
this.errorMessage = ''; // TODO
|
|
4319
|
+
this.errorMessage = ''; // TODO - check with Doug if there is still more to do here
|
|
4072
4320
|
|
|
4073
4321
|
// Layout Config
|
|
4074
|
-
this.layout = '
|
|
4322
|
+
this.layout = 'classic';
|
|
4075
4323
|
this.shape = 'rounded';
|
|
4076
4324
|
this.size = 'xl';
|
|
4325
|
+
this.parentBorder = false;
|
|
4077
4326
|
|
|
4078
4327
|
this.privateDefaults();
|
|
4079
4328
|
}
|
|
@@ -4089,7 +4338,8 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4089
4338
|
'trigger': true,
|
|
4090
4339
|
'wrapper': true,
|
|
4091
4340
|
'hasFocus': this.hasFocus,
|
|
4092
|
-
'simple': this.simple
|
|
4341
|
+
'simple': this.simple,
|
|
4342
|
+
'parentBorder': this.parentBorder
|
|
4093
4343
|
};
|
|
4094
4344
|
}
|
|
4095
4345
|
|
|
@@ -4141,7 +4391,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4141
4391
|
/**
|
|
4142
4392
|
* @private
|
|
4143
4393
|
*/
|
|
4144
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
4394
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2$1();
|
|
4145
4395
|
|
|
4146
4396
|
/**
|
|
4147
4397
|
* @private
|
|
@@ -4166,7 +4416,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4166
4416
|
/**
|
|
4167
4417
|
* @private
|
|
4168
4418
|
*/
|
|
4169
|
-
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion, AuroHelpText);
|
|
4419
|
+
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion$1, AuroHelpText$1);
|
|
4170
4420
|
|
|
4171
4421
|
/**
|
|
4172
4422
|
* @private
|
|
@@ -4356,6 +4606,15 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4356
4606
|
reflect: true
|
|
4357
4607
|
},
|
|
4358
4608
|
|
|
4609
|
+
/**
|
|
4610
|
+
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
4611
|
+
* @private
|
|
4612
|
+
*/
|
|
4613
|
+
parentBorder: {
|
|
4614
|
+
type: Boolean,
|
|
4615
|
+
reflect: true
|
|
4616
|
+
},
|
|
4617
|
+
|
|
4359
4618
|
/**
|
|
4360
4619
|
* If declared, the popover and trigger will be set to the same width.
|
|
4361
4620
|
*/
|
|
@@ -4458,10 +4717,18 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4458
4717
|
static get styles() {
|
|
4459
4718
|
return [
|
|
4460
4719
|
colorCss$1$2,
|
|
4461
|
-
styleCss$1$2,
|
|
4462
4720
|
tokensCss$1$1,
|
|
4721
|
+
|
|
4722
|
+
// default layout
|
|
4723
|
+
classicColorCss,
|
|
4724
|
+
classicLayoutCss,
|
|
4725
|
+
|
|
4726
|
+
// emphasized layout
|
|
4463
4727
|
styleEmphasizedCss,
|
|
4728
|
+
|
|
4729
|
+
// snowflake layout
|
|
4464
4730
|
styleSnowflakeCss,
|
|
4731
|
+
|
|
4465
4732
|
shapeSizeCss
|
|
4466
4733
|
];
|
|
4467
4734
|
}
|
|
@@ -4475,7 +4742,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4475
4742
|
*
|
|
4476
4743
|
*/
|
|
4477
4744
|
static register(name = "auro-dropdown") {
|
|
4478
|
-
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroDropdown);
|
|
4745
|
+
AuroLibraryRuntimeUtils$2$1.prototype.registerComponent(name, AuroDropdown);
|
|
4479
4746
|
}
|
|
4480
4747
|
|
|
4481
4748
|
/**
|
|
@@ -4808,11 +5075,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4808
5075
|
*
|
|
4809
5076
|
* @private
|
|
4810
5077
|
* @method handleDefaultSlot
|
|
4811
|
-
* @param {Event} event - The event object representing the slot change.
|
|
4812
5078
|
* @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
|
|
4813
5079
|
*/
|
|
4814
|
-
handleDefaultSlot(
|
|
4815
|
-
[...event.target.assignedNodes()].forEach((node) => this.bibContent.append(node));
|
|
5080
|
+
handleDefaultSlot() {
|
|
4816
5081
|
|
|
4817
5082
|
if (this.onSlotChange) {
|
|
4818
5083
|
this.onSlotChange();
|
|
@@ -4855,7 +5120,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4855
5120
|
id="trigger"
|
|
4856
5121
|
class="${e(this.commonWrapperClasses)}" part="wrapper"
|
|
4857
5122
|
tabindex="${this.tabIndex}"
|
|
4858
|
-
?showBorder="${this.showTriggerBorders}"
|
|
4859
5123
|
role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
4860
5124
|
aria-expanded="${o(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4861
5125
|
aria-controls="${o(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
@@ -4875,6 +5139,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4875
5139
|
${this.chevron || this.common ? u`
|
|
4876
5140
|
<div
|
|
4877
5141
|
id="showStateIcon"
|
|
5142
|
+
class="chevron"
|
|
4878
5143
|
part="chevron">
|
|
4879
5144
|
<${this.iconTag}
|
|
4880
5145
|
category="interface"
|
|
@@ -4889,9 +5154,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4889
5154
|
<div class="${e(helpTextClasses)}">
|
|
4890
5155
|
<slot name="helpText"></slot>
|
|
4891
5156
|
</div>
|
|
4892
|
-
<div class="slotContent">
|
|
4893
|
-
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4894
|
-
</div>
|
|
4895
5157
|
<div id="bibSizer" part="size"></div>
|
|
4896
5158
|
<${this.dropdownBibTag}
|
|
4897
5159
|
id="bib"
|
|
@@ -4900,6 +5162,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4900
5162
|
?common="${this.common}"
|
|
4901
5163
|
?rounded="${this.common || this.rounded}"
|
|
4902
5164
|
?inset="${this.common || this.inset}">
|
|
5165
|
+
<div class="slotContent">
|
|
5166
|
+
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5167
|
+
</div>
|
|
4903
5168
|
</${this.dropdownBibTag}>
|
|
4904
5169
|
</div>
|
|
4905
5170
|
`;
|
|
@@ -4911,6 +5176,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4911
5176
|
* @returns {html} - Returns HTML for the classic layout.
|
|
4912
5177
|
*/
|
|
4913
5178
|
renderLayoutClassic() {
|
|
5179
|
+
|
|
4914
5180
|
return u`
|
|
4915
5181
|
<div>
|
|
4916
5182
|
<div
|
|
@@ -4948,9 +5214,10 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4948
5214
|
</div>
|
|
4949
5215
|
` : undefined }
|
|
4950
5216
|
</div>
|
|
4951
|
-
|
|
4952
|
-
<slot
|
|
4953
|
-
|
|
5217
|
+
<${this.helpTextTag} part="helpText" ?onDark=${this.onDark} ?error="${this.error}">
|
|
5218
|
+
<slot name="helpText"></slot>
|
|
5219
|
+
</${this.helpTextTag}>
|
|
5220
|
+
|
|
4954
5221
|
<div id="bibSizer" part="size"></div>
|
|
4955
5222
|
<${this.dropdownBibTag}
|
|
4956
5223
|
id="bib"
|
|
@@ -4960,6 +5227,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4960
5227
|
?rounded="${this.common || this.rounded}"
|
|
4961
5228
|
?inset="${this.common || this.inset}"
|
|
4962
5229
|
>
|
|
5230
|
+
<div class="slotContent">
|
|
5231
|
+
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5232
|
+
</div>
|
|
4963
5233
|
</${this.dropdownBibTag}>
|
|
4964
5234
|
</div>
|
|
4965
5235
|
`;
|
|
@@ -5042,7 +5312,7 @@ var tokenCss = i$5`:host{--ds-auro-dropdownbib-header-boxshadow-color: var(--ds-
|
|
|
5042
5312
|
|
|
5043
5313
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
5044
5314
|
|
|
5045
|
-
class AuroLibraryRuntimeUtils {
|
|
5315
|
+
let AuroLibraryRuntimeUtils$1$1 = class AuroLibraryRuntimeUtils {
|
|
5046
5316
|
|
|
5047
5317
|
/* eslint-disable jsdoc/require-param */
|
|
5048
5318
|
|
|
@@ -5103,7 +5373,7 @@ class AuroLibraryRuntimeUtils {
|
|
|
5103
5373
|
|
|
5104
5374
|
return elemTag === tag || elem.hasAttribute(tag);
|
|
5105
5375
|
}
|
|
5106
|
-
}
|
|
5376
|
+
};
|
|
5107
5377
|
|
|
5108
5378
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5109
5379
|
// See LICENSE in the project root for license information.
|
|
@@ -5295,32 +5565,102 @@ let BaseIcon$1 = class BaseIcon extends AuroElement$1 {
|
|
|
5295
5565
|
}
|
|
5296
5566
|
};
|
|
5297
5567
|
|
|
5298
|
-
var tokensCss$
|
|
5568
|
+
var tokensCss$3 = 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)}`;
|
|
5299
5569
|
|
|
5300
|
-
var colorCss$
|
|
5570
|
+
var colorCss$4 = 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)}`;
|
|
5301
5571
|
|
|
5302
|
-
// Copyright (c)
|
|
5572
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5303
5573
|
// See LICENSE in the project root for license information.
|
|
5304
5574
|
|
|
5575
|
+
// ---------------------------------------------------------------------
|
|
5305
5576
|
|
|
5306
|
-
|
|
5307
|
-
constructor() {
|
|
5308
|
-
super();
|
|
5577
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
5309
5578
|
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5579
|
+
let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
5580
|
+
|
|
5581
|
+
/* eslint-disable jsdoc/require-param */
|
|
5313
5582
|
|
|
5314
5583
|
/**
|
|
5315
|
-
*
|
|
5316
|
-
* @
|
|
5584
|
+
* This will register a new custom element with the browser.
|
|
5585
|
+
* @param {String} name - The name of the custom element.
|
|
5586
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
5317
5587
|
* @returns {void}
|
|
5318
5588
|
*/
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5589
|
+
registerComponent(name, componentClass) {
|
|
5590
|
+
if (!customElements.get(name)) {
|
|
5591
|
+
customElements.define(name, class extends componentClass {});
|
|
5592
|
+
}
|
|
5593
|
+
}
|
|
5594
|
+
|
|
5595
|
+
/**
|
|
5596
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
5597
|
+
* @returns {void}
|
|
5598
|
+
*/
|
|
5599
|
+
closestElement(
|
|
5600
|
+
selector, // selector like in .closest()
|
|
5601
|
+
base = this, // extra functionality to skip a parent
|
|
5602
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
5603
|
+
!el || el === document || el === window
|
|
5604
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
5605
|
+
: found
|
|
5606
|
+
? found // found a selector INside this element
|
|
5607
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
5608
|
+
) {
|
|
5609
|
+
return __Closest(base);
|
|
5610
|
+
}
|
|
5611
|
+
/* eslint-enable jsdoc/require-param */
|
|
5612
|
+
|
|
5613
|
+
/**
|
|
5614
|
+
* 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.
|
|
5615
|
+
* @param {Object} elem - The element to check.
|
|
5616
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
5617
|
+
* @returns {void}
|
|
5618
|
+
*/
|
|
5619
|
+
handleComponentTagRename(elem, tagName) {
|
|
5620
|
+
const tag = tagName.toLowerCase();
|
|
5621
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
5622
|
+
|
|
5623
|
+
if (elemTag !== tag) {
|
|
5624
|
+
elem.setAttribute(tag, true);
|
|
5625
|
+
}
|
|
5626
|
+
}
|
|
5627
|
+
|
|
5628
|
+
/**
|
|
5629
|
+
* Validates if an element is a specific Auro component.
|
|
5630
|
+
* @param {Object} elem - The element to validate.
|
|
5631
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
5632
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
5633
|
+
*/
|
|
5634
|
+
elementMatch(elem, tagName) {
|
|
5635
|
+
const tag = tagName.toLowerCase();
|
|
5636
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
5637
|
+
|
|
5638
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
5639
|
+
}
|
|
5640
|
+
};
|
|
5641
|
+
|
|
5642
|
+
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5643
|
+
// See LICENSE in the project root for license information.
|
|
5644
|
+
|
|
5645
|
+
|
|
5646
|
+
let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
5647
|
+
constructor() {
|
|
5648
|
+
super();
|
|
5649
|
+
|
|
5650
|
+
this.variant = undefined;
|
|
5651
|
+
this.privateDefaults();
|
|
5652
|
+
}
|
|
5653
|
+
|
|
5654
|
+
/**
|
|
5655
|
+
* Internal Defaults.
|
|
5656
|
+
* @private
|
|
5657
|
+
* @returns {void}
|
|
5658
|
+
*/
|
|
5659
|
+
privateDefaults() {
|
|
5660
|
+
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
5661
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2();
|
|
5662
|
+
}
|
|
5663
|
+
|
|
5324
5664
|
// function to define props used within the scope of this component
|
|
5325
5665
|
static get properties() {
|
|
5326
5666
|
return {
|
|
@@ -5385,9 +5725,9 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5385
5725
|
static get styles() {
|
|
5386
5726
|
return [
|
|
5387
5727
|
super.styles,
|
|
5388
|
-
i$5`${tokensCss$
|
|
5728
|
+
i$5`${tokensCss$3}`,
|
|
5389
5729
|
i$5`${styleCss$1$1}`,
|
|
5390
|
-
i$5`${colorCss$
|
|
5730
|
+
i$5`${colorCss$4}`
|
|
5391
5731
|
];
|
|
5392
5732
|
}
|
|
5393
5733
|
|
|
@@ -5400,7 +5740,7 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5400
5740
|
*
|
|
5401
5741
|
*/
|
|
5402
5742
|
static register(name = "auro-icon") {
|
|
5403
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroIcon);
|
|
5743
|
+
AuroLibraryRuntimeUtils$2.prototype.registerComponent(name, AuroIcon);
|
|
5404
5744
|
}
|
|
5405
5745
|
|
|
5406
5746
|
connectedCallback() {
|
|
@@ -5468,7 +5808,7 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5468
5808
|
|
|
5469
5809
|
var iconVersion$1 = '8.0.3';
|
|
5470
5810
|
|
|
5471
|
-
var styleCss$
|
|
5811
|
+
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)}`;
|
|
5472
5812
|
|
|
5473
5813
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5474
5814
|
// See LICENSE in the project root for license information.
|
|
@@ -5497,7 +5837,7 @@ class AuroHeader extends i$2 {
|
|
|
5497
5837
|
/**
|
|
5498
5838
|
* @private
|
|
5499
5839
|
*/
|
|
5500
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
5840
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$1$1();
|
|
5501
5841
|
}
|
|
5502
5842
|
|
|
5503
5843
|
// function to define props used within the scope of this component
|
|
@@ -5515,7 +5855,7 @@ class AuroHeader extends i$2 {
|
|
|
5515
5855
|
}
|
|
5516
5856
|
|
|
5517
5857
|
static get styles() {
|
|
5518
|
-
return [styleCss$
|
|
5858
|
+
return [styleCss$5];
|
|
5519
5859
|
}
|
|
5520
5860
|
|
|
5521
5861
|
/**
|
|
@@ -5527,7 +5867,7 @@ class AuroHeader extends i$2 {
|
|
|
5527
5867
|
*
|
|
5528
5868
|
*/
|
|
5529
5869
|
static register(name = "auro-header") {
|
|
5530
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroHeader);
|
|
5870
|
+
AuroLibraryRuntimeUtils$1$1.prototype.registerComponent(name, AuroHeader);
|
|
5531
5871
|
}
|
|
5532
5872
|
|
|
5533
5873
|
firstUpdated() {
|
|
@@ -5623,7 +5963,7 @@ class AuroBibtemplate extends i$2 {
|
|
|
5623
5963
|
|
|
5624
5964
|
this.large = false;
|
|
5625
5965
|
|
|
5626
|
-
AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-bibtemplate');
|
|
5966
|
+
AuroLibraryRuntimeUtils$1$1.prototype.handleComponentTagRename(this, 'auro-bibtemplate');
|
|
5627
5967
|
|
|
5628
5968
|
const versioning = new AuroDependencyVersioning();
|
|
5629
5969
|
this.iconTag = versioning.generateTag('auro-formkit-bibtemplate-icon', iconVersion$1, AuroIcon$1);
|
|
@@ -5662,7 +6002,7 @@ class AuroBibtemplate extends i$2 {
|
|
|
5662
6002
|
*
|
|
5663
6003
|
*/
|
|
5664
6004
|
static register(name = "auro-bibtemplate") {
|
|
5665
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroBibtemplate);
|
|
6005
|
+
AuroLibraryRuntimeUtils$1$1.prototype.registerComponent(name, AuroBibtemplate);
|
|
5666
6006
|
}
|
|
5667
6007
|
|
|
5668
6008
|
/**
|
|
@@ -5702,6 +6042,18 @@ class AuroBibtemplate extends i$2 {
|
|
|
5702
6042
|
this.setAttribute('exportparts', 'bibtemplate:dropdownBibTemplate');
|
|
5703
6043
|
}
|
|
5704
6044
|
|
|
6045
|
+
firstUpdated(changedProperties) {
|
|
6046
|
+
super.firstUpdated(changedProperties);
|
|
6047
|
+
|
|
6048
|
+
this.dispatchEvent(new CustomEvent("auro-bibtemplate-connected", {
|
|
6049
|
+
bubbles: true,
|
|
6050
|
+
composed: true,
|
|
6051
|
+
detail: {
|
|
6052
|
+
element: this
|
|
6053
|
+
}
|
|
6054
|
+
}));
|
|
6055
|
+
}
|
|
6056
|
+
|
|
5705
6057
|
// function that renders the HTML and CSS into the scope of the component
|
|
5706
6058
|
render() {
|
|
5707
6059
|
return u`
|
|
@@ -5723,16 +6075,224 @@ class AuroBibtemplate extends i$2 {
|
|
|
5723
6075
|
<slot></slot>
|
|
5724
6076
|
</div>
|
|
5725
6077
|
|
|
5726
|
-
${this.isFullscreen ? u`
|
|
5727
|
-
<div id="footerContainer">
|
|
5728
|
-
<slot name="footer"></slot>
|
|
5729
|
-
</div>` : null}
|
|
6078
|
+
${this.isFullscreen ? u`
|
|
6079
|
+
<div id="footerContainer">
|
|
6080
|
+
<slot name="footer"></slot>
|
|
6081
|
+
</div>` : null}
|
|
6082
|
+
</div>
|
|
6083
|
+
`;
|
|
6084
|
+
}
|
|
6085
|
+
}
|
|
6086
|
+
|
|
6087
|
+
var bibTemplateVersion = '1.0.0';
|
|
6088
|
+
|
|
6089
|
+
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-advanced-color-state-error-inverse, #f9a4a8)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
6090
|
+
|
|
6091
|
+
var styleCss$4 = i$5`.helptext-wrapper{display:none;font-size:var(--ds-basic-text-body-xs-font-size, 12px);font-weight:var(--ds-basic-text-body-xs-font-weight, 450);letter-spacing:var(--ds-basic-text-body-xs-letter-spacing, 0);line-height:var(--ds-basic-text-body-xs-line-height, 16px)}:host([large]) .helptext-wrapper{font-size:var(--ds-basic-text-body-default-font-size, 16px);font-weight:var(--ds-basic-text-body-default-font-weight, 450);letter-spacing:var(--ds-basic-text-body-default-letter-spacing, 0);line-height:var(--ds-basic-text-body-default-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}`;
|
|
6092
|
+
|
|
6093
|
+
var tokensCss$2 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
6094
|
+
|
|
6095
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6096
|
+
// See LICENSE in the project root for license information.
|
|
6097
|
+
|
|
6098
|
+
// ---------------------------------------------------------------------
|
|
6099
|
+
|
|
6100
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
6101
|
+
|
|
6102
|
+
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
6103
|
+
|
|
6104
|
+
/* eslint-disable jsdoc/require-param */
|
|
6105
|
+
|
|
6106
|
+
/**
|
|
6107
|
+
* This will register a new custom element with the browser.
|
|
6108
|
+
* @param {String} name - The name of the custom element.
|
|
6109
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
6110
|
+
* @returns {void}
|
|
6111
|
+
*/
|
|
6112
|
+
registerComponent(name, componentClass) {
|
|
6113
|
+
if (!customElements.get(name)) {
|
|
6114
|
+
customElements.define(name, class extends componentClass {});
|
|
6115
|
+
}
|
|
6116
|
+
}
|
|
6117
|
+
|
|
6118
|
+
/**
|
|
6119
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
6120
|
+
* @returns {void}
|
|
6121
|
+
*/
|
|
6122
|
+
closestElement(
|
|
6123
|
+
selector, // selector like in .closest()
|
|
6124
|
+
base = this, // extra functionality to skip a parent
|
|
6125
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
6126
|
+
!el || el === document || el === window
|
|
6127
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
6128
|
+
: found
|
|
6129
|
+
? found // found a selector INside this element
|
|
6130
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
6131
|
+
) {
|
|
6132
|
+
return __Closest(base);
|
|
6133
|
+
}
|
|
6134
|
+
/* eslint-enable jsdoc/require-param */
|
|
6135
|
+
|
|
6136
|
+
/**
|
|
6137
|
+
* 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.
|
|
6138
|
+
* @param {Object} elem - The element to check.
|
|
6139
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
6140
|
+
* @returns {void}
|
|
6141
|
+
*/
|
|
6142
|
+
handleComponentTagRename(elem, tagName) {
|
|
6143
|
+
const tag = tagName.toLowerCase();
|
|
6144
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6145
|
+
|
|
6146
|
+
if (elemTag !== tag) {
|
|
6147
|
+
elem.setAttribute(tag, true);
|
|
6148
|
+
}
|
|
6149
|
+
}
|
|
6150
|
+
|
|
6151
|
+
/**
|
|
6152
|
+
* Validates if an element is a specific Auro component.
|
|
6153
|
+
* @param {Object} elem - The element to validate.
|
|
6154
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
6155
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
6156
|
+
*/
|
|
6157
|
+
elementMatch(elem, tagName) {
|
|
6158
|
+
const tag = tagName.toLowerCase();
|
|
6159
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6160
|
+
|
|
6161
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
6162
|
+
}
|
|
6163
|
+
};
|
|
6164
|
+
|
|
6165
|
+
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6166
|
+
// See LICENSE in the project root for license information.
|
|
6167
|
+
|
|
6168
|
+
|
|
6169
|
+
/**
|
|
6170
|
+
* Displays help text or error messages within form elements - Internal Use Only.
|
|
6171
|
+
*
|
|
6172
|
+
* @attr { Boolean } large - If declared, make font-size to 1rem(16px).
|
|
6173
|
+
*/
|
|
6174
|
+
class AuroHelpText extends i$2 {
|
|
6175
|
+
|
|
6176
|
+
constructor() {
|
|
6177
|
+
super();
|
|
6178
|
+
|
|
6179
|
+
this.error = false;
|
|
6180
|
+
this.onDark = false;
|
|
6181
|
+
this.hasTextContent = false;
|
|
6182
|
+
|
|
6183
|
+
AuroLibraryRuntimeUtils$1.prototype.handleComponentTagRename(this, 'auro-helptext');
|
|
6184
|
+
}
|
|
6185
|
+
|
|
6186
|
+
static get styles() {
|
|
6187
|
+
return [
|
|
6188
|
+
colorCss$3,
|
|
6189
|
+
styleCss$4,
|
|
6190
|
+
tokensCss$2
|
|
6191
|
+
];
|
|
6192
|
+
}
|
|
6193
|
+
|
|
6194
|
+
// function to define props used within the scope of this component
|
|
6195
|
+
static get properties() {
|
|
6196
|
+
return {
|
|
6197
|
+
|
|
6198
|
+
/**
|
|
6199
|
+
* @private
|
|
6200
|
+
*/
|
|
6201
|
+
slotNodes: {
|
|
6202
|
+
type: Boolean,
|
|
6203
|
+
},
|
|
6204
|
+
|
|
6205
|
+
/**
|
|
6206
|
+
* @private
|
|
6207
|
+
*/
|
|
6208
|
+
hasTextContent: {
|
|
6209
|
+
type: Boolean,
|
|
6210
|
+
},
|
|
6211
|
+
|
|
6212
|
+
/**
|
|
6213
|
+
* If declared, make font color red.
|
|
6214
|
+
*/
|
|
6215
|
+
error: {
|
|
6216
|
+
type: Boolean,
|
|
6217
|
+
reflect: true,
|
|
6218
|
+
},
|
|
6219
|
+
|
|
6220
|
+
/**
|
|
6221
|
+
* If declared, will apply onDark styles.
|
|
6222
|
+
*/
|
|
6223
|
+
onDark: {
|
|
6224
|
+
type: Boolean,
|
|
6225
|
+
reflect: true
|
|
6226
|
+
}
|
|
6227
|
+
};
|
|
6228
|
+
}
|
|
6229
|
+
|
|
6230
|
+
/**
|
|
6231
|
+
* This will register this element with the browser.
|
|
6232
|
+
* @param {string} [name="auro-helptext"] - The name of element that you want to register to.
|
|
6233
|
+
*
|
|
6234
|
+
* @example
|
|
6235
|
+
* AuroCheckbox.register("custom-helptext") // this will register this element to <custom-helptext/>
|
|
6236
|
+
*
|
|
6237
|
+
*/
|
|
6238
|
+
static register(name = "auro-helptext") {
|
|
6239
|
+
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroHelpText);
|
|
6240
|
+
}
|
|
6241
|
+
|
|
6242
|
+
updated() {
|
|
6243
|
+
this.handleSlotChange();
|
|
6244
|
+
}
|
|
6245
|
+
|
|
6246
|
+
handleSlotChange(event) {
|
|
6247
|
+
if (event) {
|
|
6248
|
+
this.slotNodes = event.target.assignedNodes();
|
|
6249
|
+
}
|
|
6250
|
+
|
|
6251
|
+
this.hasTextContent = this.checkSlotsForContent(this.slotNodes);
|
|
6252
|
+
}
|
|
6253
|
+
|
|
6254
|
+
/**
|
|
6255
|
+
* Checks if any of the provided nodes or their nested slot nodes contain non-empty text content.
|
|
6256
|
+
*
|
|
6257
|
+
* @param {NodeList|Array} nodes - The list of nodes to check for content.
|
|
6258
|
+
* @returns {boolean} - Returns true if any node or nested slot node contains non-empty text content, otherwise false.
|
|
6259
|
+
* @private
|
|
6260
|
+
*/
|
|
6261
|
+
checkSlotsForContent(nodes) {
|
|
6262
|
+
if (!nodes) {
|
|
6263
|
+
return false;
|
|
6264
|
+
}
|
|
6265
|
+
|
|
6266
|
+
return nodes.some((node) => {
|
|
6267
|
+
if (node.textContent.trim()) {
|
|
6268
|
+
return true;
|
|
6269
|
+
}
|
|
6270
|
+
|
|
6271
|
+
if (!node.querySelector) {
|
|
6272
|
+
return false;
|
|
6273
|
+
}
|
|
6274
|
+
|
|
6275
|
+
const nestedSlot = node.tagName === 'SLOT' ? node : node.querySelector('slot');
|
|
6276
|
+
if (!nestedSlot) {
|
|
6277
|
+
return false;
|
|
6278
|
+
}
|
|
6279
|
+
|
|
6280
|
+
const nestedSlotNodes = nestedSlot.assignedNodes();
|
|
6281
|
+
return this.checkSlotsForContent(nestedSlotNodes);
|
|
6282
|
+
});
|
|
6283
|
+
}
|
|
6284
|
+
|
|
6285
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
6286
|
+
render() {
|
|
6287
|
+
return x`
|
|
6288
|
+
<div class="helptext-wrapper" ?visible="${this.hasTextContent}">
|
|
6289
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
5730
6290
|
</div>
|
|
5731
|
-
|
|
6291
|
+
`;
|
|
5732
6292
|
}
|
|
5733
6293
|
}
|
|
5734
6294
|
|
|
5735
|
-
var
|
|
6295
|
+
var helpTextVersion = '1.0.0';
|
|
5736
6296
|
|
|
5737
6297
|
i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:inline-block;width:100%;margin:0;padding:0;vertical-align:middle}:host ::slotted(auro-menuoption),:host ::slotted([auro-menuoption]),:host auro-menuoption[loadingplaceholder]{padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem))}:host ::slotted([selected]){padding-left: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([nocheckmark]) ::slotted(auro-menuoption),:host([nocheckmark]) auro-menuoption[loadingplaceholder]{padding-left:var(--ds-size-200, 1rem)}:host([root]){overflow-y:auto}[loadingplaceholder].empty{opacity:0;position:absolute}[loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;line-height:1;display:inline-block}[loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}`;
|
|
5738
6298
|
|
|
@@ -5756,7 +6316,7 @@ i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgb
|
|
|
5756
6316
|
* @throws {Error} - Throws an error if the value is not an array, undefined,
|
|
5757
6317
|
* or if the value cannot be parsed into an array from a JSON string.
|
|
5758
6318
|
*/
|
|
5759
|
-
function arrayConverter
|
|
6319
|
+
function arrayConverter(value) {
|
|
5760
6320
|
// Allow undefined
|
|
5761
6321
|
if (value === undefined) {
|
|
5762
6322
|
return undefined;
|
|
@@ -5785,61 +6345,6 @@ function arrayConverter$1(value) {
|
|
|
5785
6345
|
throw new Error('Invalid value: Input must be an array or undefined');
|
|
5786
6346
|
}
|
|
5787
6347
|
|
|
5788
|
-
/**
|
|
5789
|
-
* Compare two arrays for equality.
|
|
5790
|
-
* @private
|
|
5791
|
-
* @param {Array} arr1 - First array to compare.
|
|
5792
|
-
* @param {Array} arr2 - Second array to compare.
|
|
5793
|
-
* @returns {boolean} True if arrays are equal.
|
|
5794
|
-
*/
|
|
5795
|
-
function arraysAreEqual$1(arr1, arr2) {
|
|
5796
|
-
// If both arrays undefined, they are equal (true)
|
|
5797
|
-
if (arr1 === undefined || arr2 === undefined) {
|
|
5798
|
-
return arr1 === arr2;
|
|
5799
|
-
}
|
|
5800
|
-
|
|
5801
|
-
// If arrays have different lengths, they are not equal
|
|
5802
|
-
if (arr1.length !== arr2.length) {
|
|
5803
|
-
return false;
|
|
5804
|
-
}
|
|
5805
|
-
|
|
5806
|
-
// If every item at each index is the same, return true
|
|
5807
|
-
for (let index = 0; index < arr1.length; index += 1) {
|
|
5808
|
-
if (arr1[index] !== arr2[index]) {
|
|
5809
|
-
return false;
|
|
5810
|
-
}
|
|
5811
|
-
}
|
|
5812
|
-
return true;
|
|
5813
|
-
}
|
|
5814
|
-
|
|
5815
|
-
/**
|
|
5816
|
-
* Compares array for changes.
|
|
5817
|
-
* @private
|
|
5818
|
-
* @param {Array|any} newVal - New value to compare.
|
|
5819
|
-
* @param {Array|any} oldVal - Old value to compare.
|
|
5820
|
-
* @returns {boolean} True if arrays have changed.
|
|
5821
|
-
*/
|
|
5822
|
-
function arrayOrUndefinedHasChanged$1(newVal, oldVal) {
|
|
5823
|
-
try {
|
|
5824
|
-
// Check if values are undefined or arrays
|
|
5825
|
-
const isArrayOrUndefined = (val) => val === undefined || Array.isArray(val);
|
|
5826
|
-
|
|
5827
|
-
// If non-array or non-undefined, throw error
|
|
5828
|
-
if (!isArrayOrUndefined(newVal) || !isArrayOrUndefined(oldVal)) {
|
|
5829
|
-
const invalidValue = isArrayOrUndefined(newVal) ? oldVal : newVal;
|
|
5830
|
-
throw new Error(`Value must be an array or undefined, received ${typeof invalidValue}`);
|
|
5831
|
-
}
|
|
5832
|
-
|
|
5833
|
-
// Return true if arrays have changed, false if they are the same
|
|
5834
|
-
return !arraysAreEqual$1(newVal, oldVal);
|
|
5835
|
-
} catch (error) {
|
|
5836
|
-
/* eslint-disable no-console */
|
|
5837
|
-
console.error(error);
|
|
5838
|
-
// If validation fails, it has changed
|
|
5839
|
-
return true;
|
|
5840
|
-
}
|
|
5841
|
-
}
|
|
5842
|
-
|
|
5843
6348
|
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}`;
|
|
5844
6349
|
|
|
5845
6350
|
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)}`;
|
|
@@ -5850,7 +6355,7 @@ i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);-
|
|
|
5850
6355
|
|
|
5851
6356
|
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)}`;
|
|
5852
6357
|
|
|
5853
|
-
var styleCss$3 = i$5
|
|
6358
|
+
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}.layout-emphasized .triggerContent,.layout-snowflake .triggerContent{display:flex;align-items:center;justify-content:center;width:100%;padding:0 8px 0 24px}.layout-classic .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}`;
|
|
5854
6359
|
|
|
5855
6360
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5856
6361
|
// See LICENSE in the project root for license information.
|
|
@@ -5865,14 +6370,15 @@ var styleCss$3 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.u
|
|
|
5865
6370
|
* @slot label - Defines the content of the label.
|
|
5866
6371
|
* @slot helpText - Defines the content of the helpText.
|
|
5867
6372
|
* @slot placeholder - Defines the content of the placeholder to be shown when there is no value
|
|
6373
|
+
* @slot valueText - Dropdown value text display.
|
|
5868
6374
|
* @event auroSelect-valueSet - Notifies that the component has a new value set.
|
|
5869
|
-
* @event input - Notifies every time the value prop of the element is changed.
|
|
6375
|
+
* @event input - Notifies every time the value prop of the element is changed. The updated `value` and `optionSelected` will be delivered in `detail` object.
|
|
5870
6376
|
* @event auroFormElement-validated - Notifies that the `validity` and `errorMessage` values have changed.
|
|
5871
6377
|
* @csspart helpText - Apply CSS to the help text.
|
|
5872
6378
|
*/
|
|
5873
6379
|
|
|
5874
6380
|
// build the component class
|
|
5875
|
-
class AuroSelect extends
|
|
6381
|
+
class AuroSelect extends AuroElement$3 {
|
|
5876
6382
|
constructor() {
|
|
5877
6383
|
super();
|
|
5878
6384
|
|
|
@@ -5882,12 +6388,21 @@ class AuroSelect extends i$2 {
|
|
|
5882
6388
|
const idSubstrEnd = 8;
|
|
5883
6389
|
const idSubstrStart = 2;
|
|
5884
6390
|
|
|
6391
|
+
this.matchWidth = true;
|
|
6392
|
+
|
|
6393
|
+
// Layout Config
|
|
6394
|
+
this.layout = 'classic';
|
|
6395
|
+
this.shape = 'classic';
|
|
6396
|
+
this.size = 'xl';
|
|
6397
|
+
|
|
5885
6398
|
// floaterConfig
|
|
5886
6399
|
this.placement = 'bottom-start';
|
|
5887
6400
|
this.offset = 0;
|
|
5888
6401
|
this.noFlip = false;
|
|
5889
6402
|
this.autoPlacement = false;
|
|
5890
6403
|
|
|
6404
|
+
this.forceDisplayValue = false;
|
|
6405
|
+
|
|
5891
6406
|
/**
|
|
5892
6407
|
* @private
|
|
5893
6408
|
*/
|
|
@@ -5903,7 +6418,7 @@ class AuroSelect extends i$2 {
|
|
|
5903
6418
|
/**
|
|
5904
6419
|
* @private
|
|
5905
6420
|
*/
|
|
5906
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
6421
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$4();
|
|
5907
6422
|
|
|
5908
6423
|
/**
|
|
5909
6424
|
* Generate unique names for dependency components.
|
|
@@ -5920,10 +6435,25 @@ class AuroSelect extends i$2 {
|
|
|
5920
6435
|
*/
|
|
5921
6436
|
this.bibtemplateTag = versioning.generateTag('auro-formkit-select-bibtemplate', bibTemplateVersion, AuroBibtemplate);
|
|
5922
6437
|
|
|
6438
|
+
/**
|
|
6439
|
+
* @private
|
|
6440
|
+
*/
|
|
6441
|
+
this.helpTextTag = versioning.generateTag('auro-formkit-input-helptext', helpTextVersion, AuroHelpText);
|
|
6442
|
+
|
|
5923
6443
|
/**
|
|
5924
6444
|
* @private
|
|
5925
6445
|
*/
|
|
5926
6446
|
this.isHiddenWhileLoading = false;
|
|
6447
|
+
|
|
6448
|
+
/**
|
|
6449
|
+
* @private
|
|
6450
|
+
*/
|
|
6451
|
+
this.hasFocus = false;
|
|
6452
|
+
|
|
6453
|
+
/**
|
|
6454
|
+
* @private
|
|
6455
|
+
*/
|
|
6456
|
+
this.hasDisplayValueContent = false;
|
|
5927
6457
|
}
|
|
5928
6458
|
|
|
5929
6459
|
/**
|
|
@@ -5937,6 +6467,7 @@ class AuroSelect extends i$2 {
|
|
|
5937
6467
|
this.value = undefined;
|
|
5938
6468
|
this.fullscreenBreakpoint = 'sm';
|
|
5939
6469
|
this.onDark = false;
|
|
6470
|
+
this.isPopoverVisible = false;
|
|
5940
6471
|
}
|
|
5941
6472
|
|
|
5942
6473
|
// This function is to define props used within the scope of this component
|
|
@@ -5953,6 +6484,14 @@ class AuroSelect extends i$2 {
|
|
|
5953
6484
|
reflect: true
|
|
5954
6485
|
},
|
|
5955
6486
|
|
|
6487
|
+
/**
|
|
6488
|
+
* If declared, the label and value will be visually hidden and the displayValue will render 100% of the time.
|
|
6489
|
+
*/
|
|
6490
|
+
forceDisplayValue: {
|
|
6491
|
+
type: Boolean,
|
|
6492
|
+
reflect: true
|
|
6493
|
+
},
|
|
6494
|
+
|
|
5956
6495
|
/**
|
|
5957
6496
|
* If declared, bib's position will be automatically calculated where to appear.
|
|
5958
6497
|
* @default false
|
|
@@ -5970,6 +6509,22 @@ class AuroSelect extends i$2 {
|
|
|
5970
6509
|
reflect: true
|
|
5971
6510
|
},
|
|
5972
6511
|
|
|
6512
|
+
/**
|
|
6513
|
+
* @private
|
|
6514
|
+
*/
|
|
6515
|
+
isPopoverVisible: {
|
|
6516
|
+
type: Boolean,
|
|
6517
|
+
reflect: false
|
|
6518
|
+
},
|
|
6519
|
+
|
|
6520
|
+
/**
|
|
6521
|
+
* If declared, the popover and trigger will be set to the same width.
|
|
6522
|
+
*/
|
|
6523
|
+
matchWidth: {
|
|
6524
|
+
type: Boolean,
|
|
6525
|
+
reflect: true
|
|
6526
|
+
},
|
|
6527
|
+
|
|
5973
6528
|
/**
|
|
5974
6529
|
* The name for the select element.
|
|
5975
6530
|
*/
|
|
@@ -6001,7 +6556,7 @@ class AuroSelect extends i$2 {
|
|
|
6001
6556
|
|
|
6002
6557
|
/**
|
|
6003
6558
|
* If declared, make bib.fullscreen.headline in HeadingDisplay.
|
|
6004
|
-
* Otherwise, Heading 600
|
|
6559
|
+
* Otherwise, Heading 600.
|
|
6005
6560
|
*/
|
|
6006
6561
|
largeFullscreenHeadline: {
|
|
6007
6562
|
type: Boolean,
|
|
@@ -6059,12 +6614,11 @@ class AuroSelect extends i$2 {
|
|
|
6059
6614
|
},
|
|
6060
6615
|
|
|
6061
6616
|
/**
|
|
6062
|
-
* Specifies the current selected menuOption.
|
|
6617
|
+
* Specifies the current selected menuOption. Default type is `HTMLElement`, changing to `Array<HTMLElement>` when `multiSelect` is true.
|
|
6618
|
+
* @type {HTMLElement|Array<HTMLElement>}
|
|
6063
6619
|
*/
|
|
6064
6620
|
optionSelected: {
|
|
6065
|
-
|
|
6066
|
-
converter: arrayConverter$1,
|
|
6067
|
-
hasChanged: arrayOrUndefinedHasChanged$1
|
|
6621
|
+
type: Object
|
|
6068
6622
|
},
|
|
6069
6623
|
|
|
6070
6624
|
/**
|
|
@@ -6134,12 +6688,11 @@ class AuroSelect extends i$2 {
|
|
|
6134
6688
|
},
|
|
6135
6689
|
|
|
6136
6690
|
/**
|
|
6137
|
-
* Value selected for the component.
|
|
6691
|
+
* Value selected for the component. Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
6692
|
+
* @type {String|Array<String>}
|
|
6138
6693
|
*/
|
|
6139
6694
|
value: {
|
|
6140
|
-
|
|
6141
|
-
converter: arrayConverter$1,
|
|
6142
|
-
hasChanged: arrayOrUndefinedHasChanged$1
|
|
6695
|
+
type: Object
|
|
6143
6696
|
},
|
|
6144
6697
|
|
|
6145
6698
|
/**
|
|
@@ -6161,12 +6714,45 @@ class AuroSelect extends i$2 {
|
|
|
6161
6714
|
type: Boolean,
|
|
6162
6715
|
reflect: true,
|
|
6163
6716
|
attribute: false
|
|
6164
|
-
}
|
|
6717
|
+
},
|
|
6718
|
+
|
|
6719
|
+
/**
|
|
6720
|
+
* @private
|
|
6721
|
+
*/
|
|
6722
|
+
hasFocus: {
|
|
6723
|
+
type: Boolean,
|
|
6724
|
+
reflect: false,
|
|
6725
|
+
attribute: false
|
|
6726
|
+
},
|
|
6727
|
+
|
|
6728
|
+
/**
|
|
6729
|
+
* @private
|
|
6730
|
+
*/
|
|
6731
|
+
hasDisplayValueContent: {
|
|
6732
|
+
type: Boolean,
|
|
6733
|
+
reflect: false,
|
|
6734
|
+
attribute: false
|
|
6735
|
+
},
|
|
6165
6736
|
};
|
|
6166
6737
|
}
|
|
6167
6738
|
|
|
6168
6739
|
static get styles() {
|
|
6169
|
-
return [
|
|
6740
|
+
return [
|
|
6741
|
+
i$5`${shapeSizeCss$1}`,
|
|
6742
|
+
i$5`${tokensCss$5}`,
|
|
6743
|
+
i$5`${styleCss$3}`,
|
|
6744
|
+
];
|
|
6745
|
+
}
|
|
6746
|
+
|
|
6747
|
+
/**
|
|
6748
|
+
* Returns classmap configuration for wrapper elements in each layout.
|
|
6749
|
+
* @private
|
|
6750
|
+
* @return {object} - Returns classmap.
|
|
6751
|
+
*/
|
|
6752
|
+
get commonWrapperClasses() {
|
|
6753
|
+
return {
|
|
6754
|
+
'wrapper': true
|
|
6755
|
+
};
|
|
6170
6756
|
}
|
|
6171
6757
|
|
|
6172
6758
|
/**
|
|
@@ -6176,11 +6762,13 @@ class AuroSelect extends i$2 {
|
|
|
6176
6762
|
*/
|
|
6177
6763
|
configureDropdown() {
|
|
6178
6764
|
this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
|
|
6179
|
-
|
|
6765
|
+
|
|
6766
|
+
this.dropdown.addEventListener('auroDropdown-toggled', () => {
|
|
6767
|
+
this.isPopoverVisible = this.dropdown.isPopoverVisible;
|
|
6768
|
+
});
|
|
6180
6769
|
|
|
6181
6770
|
// setting up bibtemplate
|
|
6182
6771
|
this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$); // eslint-disable-line no-underscore-dangle
|
|
6183
|
-
this.bibtemplate.append(this.menuWrapper);
|
|
6184
6772
|
|
|
6185
6773
|
if (this.customBibWidth) {
|
|
6186
6774
|
this.dropdown.dropdownWidth = this.customBibWidth;
|
|
@@ -6199,7 +6787,7 @@ class AuroSelect extends i$2 {
|
|
|
6199
6787
|
*
|
|
6200
6788
|
*/
|
|
6201
6789
|
static register(name = "auro-select") {
|
|
6202
|
-
AuroLibraryRuntimeUtils$
|
|
6790
|
+
AuroLibraryRuntimeUtils$4.prototype.registerComponent(name, AuroSelect);
|
|
6203
6791
|
}
|
|
6204
6792
|
|
|
6205
6793
|
/**
|
|
@@ -6210,21 +6798,34 @@ class AuroSelect extends i$2 {
|
|
|
6210
6798
|
updateDisplayedValue() {
|
|
6211
6799
|
const triggerContentEl = this.dropdown.querySelector('#triggerFocus');
|
|
6212
6800
|
|
|
6213
|
-
// Clear
|
|
6214
|
-
const
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
triggerContentEl.appendChild(placeholder);
|
|
6801
|
+
// Clear out old value
|
|
6802
|
+
const valueElem = triggerContentEl.querySelector('#value');
|
|
6803
|
+
if (valueElem) {
|
|
6804
|
+
valueElem.innerHTML = '';
|
|
6218
6805
|
}
|
|
6219
6806
|
|
|
6807
|
+
const slot = this.shadowRoot.querySelector('slot[name="displayValue"]');
|
|
6808
|
+
const slottedElements = slot.assignedElements();
|
|
6809
|
+
|
|
6810
|
+
slottedElements.forEach((element) => {
|
|
6811
|
+
element.remove();
|
|
6812
|
+
});
|
|
6813
|
+
|
|
6220
6814
|
// Handle selected options
|
|
6221
|
-
if (this.optionSelected
|
|
6222
|
-
|
|
6223
|
-
|
|
6815
|
+
if (this.optionSelected) {
|
|
6816
|
+
if (this.multiSelect && this.optionSelected.length > 0) {
|
|
6817
|
+
const displayText = this.optionSelected.map((option) => option.textContent).join(', ');
|
|
6818
|
+
|
|
6819
|
+
valueElem.textContent = displayText;
|
|
6820
|
+
} else {
|
|
6821
|
+
valueElem.innerHTML = this.optionSelected.innerHTML;
|
|
6822
|
+
const displayValueEl = this.optionSelected.querySelector("[slot='displayValue']");
|
|
6224
6823
|
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6824
|
+
if (displayValueEl) {
|
|
6825
|
+
this.appendChild(displayValueEl.cloneNode(true));
|
|
6826
|
+
}
|
|
6827
|
+
this.hasDisplayValueContent = displayValueEl !== null;
|
|
6828
|
+
}
|
|
6228
6829
|
}
|
|
6229
6830
|
|
|
6230
6831
|
this.dropdown.requestUpdate();
|
|
@@ -6303,8 +6904,6 @@ class AuroSelect extends i$2 {
|
|
|
6303
6904
|
* @returns {void}
|
|
6304
6905
|
*/
|
|
6305
6906
|
configureSelect() {
|
|
6306
|
-
// inject menu into menuWrapper
|
|
6307
|
-
this.menuWrapper.append(this.menu);
|
|
6308
6907
|
|
|
6309
6908
|
this.addEventListener('keydown', (evt) => {
|
|
6310
6909
|
if (evt.key === 'ArrowUp') {
|
|
@@ -6358,6 +6957,7 @@ class AuroSelect extends i$2 {
|
|
|
6358
6957
|
|
|
6359
6958
|
this.addEventListener('blur', () => {
|
|
6360
6959
|
this.validation.validate(this);
|
|
6960
|
+
this.hasFocus = false;
|
|
6361
6961
|
});
|
|
6362
6962
|
}
|
|
6363
6963
|
|
|
@@ -6433,6 +7033,7 @@ class AuroSelect extends i$2 {
|
|
|
6433
7033
|
*/
|
|
6434
7034
|
handleFocusin() {
|
|
6435
7035
|
|
|
7036
|
+
this.hasFocus = true;
|
|
6436
7037
|
this.touched = true;
|
|
6437
7038
|
}
|
|
6438
7039
|
|
|
@@ -6468,6 +7069,17 @@ class AuroSelect extends i$2 {
|
|
|
6468
7069
|
}
|
|
6469
7070
|
}
|
|
6470
7071
|
|
|
7072
|
+
/**
|
|
7073
|
+
* Resets all options to their default state.
|
|
7074
|
+
* @private
|
|
7075
|
+
*/
|
|
7076
|
+
clearSelection() {
|
|
7077
|
+
this.value = undefined;
|
|
7078
|
+
this.optionSelected = undefined;
|
|
7079
|
+
|
|
7080
|
+
this.menu.multiSelect = this.multiSelect;
|
|
7081
|
+
}
|
|
7082
|
+
|
|
6471
7083
|
/**
|
|
6472
7084
|
* Handle element attributes on update.
|
|
6473
7085
|
* @private
|
|
@@ -6504,13 +7116,20 @@ class AuroSelect extends i$2 {
|
|
|
6504
7116
|
|
|
6505
7117
|
// Set the initial value in auro-menu if defined
|
|
6506
7118
|
if (this.hasAttribute('value') && this.getAttribute('value').length > 0) {
|
|
7119
|
+
this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
|
|
6507
7120
|
this.menu.value = this.value;
|
|
6508
7121
|
}
|
|
6509
7122
|
}
|
|
6510
7123
|
|
|
6511
7124
|
async updated(changedProperties) {
|
|
7125
|
+
if (changedProperties.has('multiSelect')) {
|
|
7126
|
+
this.clearSelection();
|
|
7127
|
+
}
|
|
7128
|
+
|
|
6512
7129
|
if (changedProperties.has('value')) {
|
|
6513
7130
|
if (this.value) {
|
|
7131
|
+
this.value = this.multiSelect ? arrayConverter(this.value) : this.value;
|
|
7132
|
+
|
|
6514
7133
|
this.menu.value = this.value;
|
|
6515
7134
|
|
|
6516
7135
|
// Wait for menu to finish updating its value
|
|
@@ -6535,6 +7154,10 @@ class AuroSelect extends i$2 {
|
|
|
6535
7154
|
bubbles: true,
|
|
6536
7155
|
cancelable: true,
|
|
6537
7156
|
composed: true,
|
|
7157
|
+
detail: {
|
|
7158
|
+
optionSelected: this.optionSelected,
|
|
7159
|
+
value: this.value
|
|
7160
|
+
}
|
|
6538
7161
|
}));
|
|
6539
7162
|
}
|
|
6540
7163
|
|
|
@@ -6556,56 +7179,351 @@ class AuroSelect extends i$2 {
|
|
|
6556
7179
|
}
|
|
6557
7180
|
|
|
6558
7181
|
/**
|
|
6559
|
-
* Hide dropdownbib.
|
|
7182
|
+
* Hide dropdownbib.
|
|
7183
|
+
* @private
|
|
7184
|
+
*/
|
|
7185
|
+
hideBib() {
|
|
7186
|
+
if (this.dropdown) {
|
|
7187
|
+
this.dropdown.hide();
|
|
7188
|
+
}
|
|
7189
|
+
}
|
|
7190
|
+
|
|
7191
|
+
/**
|
|
7192
|
+
* Validates value.
|
|
7193
|
+
* @param {boolean} [force=false] - Whether to force validation.
|
|
7194
|
+
*/
|
|
7195
|
+
validate(force = false) {
|
|
7196
|
+
this.validation.validate(this, force);
|
|
7197
|
+
}
|
|
7198
|
+
|
|
7199
|
+
/**
|
|
7200
|
+
* Syncs the value from the native select element to the component's value.
|
|
7201
|
+
* @param {Event} event // The change event from the native select element.
|
|
7202
|
+
* @returns {void}
|
|
7203
|
+
* @private
|
|
7204
|
+
*/
|
|
7205
|
+
_handleNativeSelectChange(event) {
|
|
7206
|
+
const selectedOption = event.target.options[event.target.selectedIndex];
|
|
7207
|
+
const selectedValue = selectedOption.value;
|
|
7208
|
+
|
|
7209
|
+
if (this.multiSelect) {
|
|
7210
|
+
const currentArray = Array.isArray(this.value) ? this.value : [];
|
|
7211
|
+
|
|
7212
|
+
if (!currentArray.includes(selectedValue)) {
|
|
7213
|
+
this.value = [
|
|
7214
|
+
...currentArray,
|
|
7215
|
+
selectedValue
|
|
7216
|
+
];
|
|
7217
|
+
}
|
|
7218
|
+
} else {
|
|
7219
|
+
const currentValue = this.value;
|
|
7220
|
+
|
|
7221
|
+
if (currentValue !== selectedValue) {
|
|
7222
|
+
this.value = selectedValue;
|
|
7223
|
+
}
|
|
7224
|
+
}
|
|
7225
|
+
}
|
|
7226
|
+
|
|
7227
|
+
/**
|
|
7228
|
+
* Updates the native select element's value based on the component's value.
|
|
7229
|
+
* @returns {void}
|
|
7230
|
+
* @private
|
|
7231
|
+
*/
|
|
7232
|
+
_updateNativeSelect() {
|
|
7233
|
+
const nativeSelect = this.shadowRoot.querySelector('select');
|
|
7234
|
+
if (!nativeSelect) {
|
|
7235
|
+
return;
|
|
7236
|
+
}
|
|
7237
|
+
|
|
7238
|
+
if (this.multiSelect) {
|
|
7239
|
+
nativeSelect.value = this.value ? this.value[0] : '';
|
|
7240
|
+
} else {
|
|
7241
|
+
nativeSelect.value = this.value || '';
|
|
7242
|
+
}
|
|
7243
|
+
}
|
|
7244
|
+
|
|
7245
|
+
renderAriaHtml() {
|
|
7246
|
+
return u`
|
|
7247
|
+
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
7248
|
+
${this.optionActive && this.options.length > 0
|
|
7249
|
+
? u`
|
|
7250
|
+
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
7251
|
+
`
|
|
7252
|
+
: undefined
|
|
7253
|
+
};
|
|
7254
|
+
|
|
7255
|
+
${this.optionSelected && this.options.length > 0
|
|
7256
|
+
? u`
|
|
7257
|
+
${`${this.optionSelected.innerText} selected`}
|
|
7258
|
+
`
|
|
7259
|
+
: undefined
|
|
7260
|
+
};
|
|
7261
|
+
</div>
|
|
7262
|
+
`;
|
|
7263
|
+
}
|
|
7264
|
+
|
|
7265
|
+
renderNativeSelect() {
|
|
7266
|
+
return u`
|
|
7267
|
+
<div class="nativeSelectWrapper">
|
|
7268
|
+
<select
|
|
7269
|
+
tabindex="-1"
|
|
7270
|
+
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
7271
|
+
name="${this.name || ''}"
|
|
7272
|
+
?disabled="${this.disabled}"
|
|
7273
|
+
?required="${this.required}"
|
|
7274
|
+
aria-hidden="true"
|
|
7275
|
+
autocomplete="${o(this.autocomplete)}"
|
|
7276
|
+
@change="${this._handleNativeSelectChange}">
|
|
7277
|
+
<option value="" ?selected="${!this.value}"></option>
|
|
7278
|
+
${this.options.map((option) => {
|
|
7279
|
+
const optionValue = option.value || option.textContent;
|
|
7280
|
+
return u`
|
|
7281
|
+
<option
|
|
7282
|
+
value="${optionValue}"
|
|
7283
|
+
?selected="${this.value === optionValue}">
|
|
7284
|
+
${option.textContent}
|
|
7285
|
+
</option>
|
|
7286
|
+
`;
|
|
7287
|
+
})}
|
|
7288
|
+
</select>
|
|
7289
|
+
</div>
|
|
7290
|
+
`;
|
|
7291
|
+
}
|
|
7292
|
+
|
|
7293
|
+
/**
|
|
7294
|
+
* Returns HTML for the help text and error message.
|
|
7295
|
+
* @private
|
|
7296
|
+
* @returns {html} - Returns HTML for the help text and error message.
|
|
7297
|
+
*/
|
|
7298
|
+
renderHtmlHelpText() {
|
|
7299
|
+
return u`
|
|
7300
|
+
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
7301
|
+
? u`
|
|
7302
|
+
<${this.helpTextTag} ?onDark="${this.onDark}">
|
|
7303
|
+
<p id="${this.uniqueId}" part="helpText">
|
|
7304
|
+
<slot name="helptext"></slot>
|
|
7305
|
+
</p>
|
|
7306
|
+
</${this.helpTextTag}>
|
|
7307
|
+
`
|
|
7308
|
+
: u`
|
|
7309
|
+
<${this.helpTextTag} error ?onDark="${this.onDark}">
|
|
7310
|
+
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
7311
|
+
ERROR MESSAGE ${this.errorMessage}
|
|
7312
|
+
</p>
|
|
7313
|
+
</${this.helpTextTag}>
|
|
7314
|
+
`
|
|
7315
|
+
}
|
|
7316
|
+
`;
|
|
7317
|
+
}
|
|
7318
|
+
|
|
7319
|
+
/**
|
|
7320
|
+
* Returns HTML for the emphasized layout.
|
|
7321
|
+
* @private
|
|
7322
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the emphasized layout.
|
|
7323
|
+
*/
|
|
7324
|
+
// TODO update to use util class
|
|
7325
|
+
renderLayoutEmphasized() {
|
|
7326
|
+
const placeholderClass = {
|
|
7327
|
+
hidden: this.value,
|
|
7328
|
+
};
|
|
7329
|
+
|
|
7330
|
+
const displayValueClasses = {
|
|
7331
|
+
'displayValue': true,
|
|
7332
|
+
'hasContent': this.hasDisplayValueContent,
|
|
7333
|
+
'hasFocus': this.isPopoverVisible,
|
|
7334
|
+
'withValue': this.value && this.value.length > 0,
|
|
7335
|
+
'force': this.forceDisplayValue,
|
|
7336
|
+
};
|
|
7337
|
+
|
|
7338
|
+
const valueContainerClasses = {
|
|
7339
|
+
'valueContainer': true,
|
|
7340
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
7341
|
+
};
|
|
7342
|
+
|
|
7343
|
+
return u`
|
|
7344
|
+
<div
|
|
7345
|
+
class="${e(this.commonWrapperClasses)}"
|
|
7346
|
+
part="wrapper">
|
|
7347
|
+
<div id="slotHolder" aria-hidden="true">
|
|
7348
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
7349
|
+
</div>
|
|
7350
|
+
<${this.dropdownTag}
|
|
7351
|
+
?autoPlacement="${this.autoPlacement}"
|
|
7352
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
7353
|
+
?matchWidth="${!this.flexMenuWidth}"
|
|
7354
|
+
?noFlip="${this.noFlip}"
|
|
7355
|
+
?onDark="${this.onDark}"
|
|
7356
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
7357
|
+
.offset="${this.offset}"
|
|
7358
|
+
.placement="${this.placement}"
|
|
7359
|
+
chevron
|
|
7360
|
+
fluid
|
|
7361
|
+
for="selectMenu"
|
|
7362
|
+
layout="${this.layout}"
|
|
7363
|
+
part="dropdown"
|
|
7364
|
+
shape="${this.shape}"
|
|
7365
|
+
size="${this.size}">
|
|
7366
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
7367
|
+
<div class="accents left">
|
|
7368
|
+
<slot name="typeIcon"></slot>
|
|
7369
|
+
</div>
|
|
7370
|
+
<div class="mainContent">
|
|
7371
|
+
<div class="${e(valueContainerClasses)}">
|
|
7372
|
+
<label>
|
|
7373
|
+
<slot name="label"></slot>
|
|
7374
|
+
</label>
|
|
7375
|
+
<div class="value" id="value"></div>
|
|
7376
|
+
${this.value ? undefined : u`
|
|
7377
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
7378
|
+
<slot name="placeholder"></slot>
|
|
7379
|
+
</div>
|
|
7380
|
+
`}
|
|
7381
|
+
</div>
|
|
7382
|
+
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
7383
|
+
<slot name="displayValue"></slot>
|
|
7384
|
+
</div>
|
|
7385
|
+
</div>
|
|
7386
|
+
<div class="accents right"></div>
|
|
7387
|
+
</div>
|
|
7388
|
+
<div class="menuWrapper"></div>
|
|
7389
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
7390
|
+
<slot></slot>
|
|
7391
|
+
</${this.bibtemplateTag}>
|
|
7392
|
+
<div slot="helpText">
|
|
7393
|
+
${this.renderHtmlHelpText()}
|
|
7394
|
+
</div>
|
|
7395
|
+
</${this.dropdownTag}>
|
|
7396
|
+
</div>
|
|
7397
|
+
`;
|
|
7398
|
+
}
|
|
7399
|
+
|
|
7400
|
+
/**
|
|
7401
|
+
* Returns HTML for the snowflake layout.
|
|
6560
7402
|
* @private
|
|
7403
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the snowflake layout.
|
|
6561
7404
|
*/
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
this.
|
|
6565
|
-
}
|
|
6566
|
-
}
|
|
7405
|
+
renderLayoutSnowflake() {
|
|
7406
|
+
const placeholderClass = {
|
|
7407
|
+
hidden: this.value,
|
|
7408
|
+
};
|
|
6567
7409
|
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
7410
|
+
const displayValueClasses = {
|
|
7411
|
+
'displayValue': true,
|
|
7412
|
+
'hasContent': this.hasDisplayValueContent,
|
|
7413
|
+
'hasFocus': this.isPopoverVisible,
|
|
7414
|
+
'withValue': this.value && this.value.length > 0,
|
|
7415
|
+
'force': this.forceDisplayValue,
|
|
7416
|
+
};
|
|
7417
|
+
|
|
7418
|
+
const valueContainerClasses = {
|
|
7419
|
+
'valueContainer': true,
|
|
7420
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
7421
|
+
};
|
|
7422
|
+
|
|
7423
|
+
return u`
|
|
7424
|
+
<div
|
|
7425
|
+
class="${e(this.commonWrapperClasses)}"
|
|
7426
|
+
part="wrapper">
|
|
7427
|
+
<div id="slotHolder" aria-hidden="true">
|
|
7428
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
7429
|
+
</div>
|
|
7430
|
+
<${this.dropdownTag}
|
|
7431
|
+
?autoPlacement="${this.autoPlacement}"
|
|
7432
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
7433
|
+
?matchWidth="${!this.flexMenuWidth}"
|
|
7434
|
+
?noFlip="${this.noFlip}"
|
|
7435
|
+
?onDark="${this.onDark}"
|
|
7436
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
7437
|
+
.offset="${this.offset}"
|
|
7438
|
+
.placement="${this.placement}"
|
|
7439
|
+
chevron
|
|
7440
|
+
fluid
|
|
7441
|
+
for="selectMenu"
|
|
7442
|
+
layout="${this.layout}"
|
|
7443
|
+
part="dropdown"
|
|
7444
|
+
shape="${this.shape}"
|
|
7445
|
+
size="${this.size}">
|
|
7446
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
7447
|
+
<div class="accents left">
|
|
7448
|
+
<slot name="typeIcon"></slot>
|
|
7449
|
+
</div>
|
|
7450
|
+
<div class="mainContent">
|
|
7451
|
+
<div class="${e(valueContainerClasses)}">
|
|
7452
|
+
<label>
|
|
7453
|
+
<slot name="label"></slot>
|
|
7454
|
+
</label>
|
|
7455
|
+
<div class="value" id="value"></div>
|
|
7456
|
+
${this.value ? undefined : u`
|
|
7457
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
7458
|
+
<slot name="placeholder"></slot>
|
|
7459
|
+
</div>
|
|
7460
|
+
`}
|
|
7461
|
+
</div>
|
|
7462
|
+
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
7463
|
+
<slot name="displayValue"></slot>
|
|
7464
|
+
</div>
|
|
7465
|
+
</div>
|
|
7466
|
+
<div class="accents right"></div>
|
|
7467
|
+
</div>
|
|
7468
|
+
<div class="menuWrapper"></div>
|
|
7469
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
7470
|
+
<slot></slot>
|
|
7471
|
+
</${this.bibtemplateTag}>
|
|
7472
|
+
<div slot="helpText">
|
|
7473
|
+
${this.renderHtmlHelpText()}
|
|
7474
|
+
</div>
|
|
7475
|
+
</${this.dropdownTag}>
|
|
7476
|
+
</div>
|
|
7477
|
+
`;
|
|
6574
7478
|
}
|
|
6575
7479
|
|
|
6576
7480
|
/**
|
|
6577
|
-
*
|
|
6578
|
-
* @param {Event} event // The change event from the native select element.
|
|
6579
|
-
* @returns {void}
|
|
7481
|
+
* Returns HTML for the classic layout.
|
|
6580
7482
|
* @private
|
|
7483
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the classic layout.
|
|
6581
7484
|
*/
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
7485
|
+
renderLayoutClassic() {
|
|
7486
|
+
return u`
|
|
7487
|
+
<div
|
|
7488
|
+
class="${e(this.commonWrapperClasses)} thin"
|
|
7489
|
+
part="wrapper">
|
|
7490
|
+
classic
|
|
7491
|
+
</div>
|
|
7492
|
+
`;
|
|
6587
7493
|
}
|
|
6588
7494
|
|
|
6589
7495
|
/**
|
|
6590
|
-
*
|
|
6591
|
-
* @returns {void}
|
|
7496
|
+
* Logic to determine the layout of the component.
|
|
6592
7497
|
* @private
|
|
7498
|
+
* @param {string} [ForcedLayout] - Used to force a specific layout, pass in the layout name to use.
|
|
7499
|
+
* @returns {void}
|
|
6593
7500
|
*/
|
|
6594
|
-
|
|
6595
|
-
const
|
|
6596
|
-
|
|
6597
|
-
|
|
7501
|
+
renderLayout(ForcedLayout) {
|
|
7502
|
+
const layout = ForcedLayout || this.layout;
|
|
7503
|
+
|
|
7504
|
+
switch (layout) {
|
|
7505
|
+
case 'emphasized':
|
|
7506
|
+
return this.renderLayoutEmphasized();
|
|
7507
|
+
case 'emphasized-left':
|
|
7508
|
+
return this.renderLayoutEmphasized();
|
|
7509
|
+
case 'emphasized-right':
|
|
7510
|
+
return this.renderLayoutEmphasized();
|
|
7511
|
+
case 'snowflake':
|
|
7512
|
+
return this.renderLayoutSnowflake();
|
|
7513
|
+
case 'snowflake-left':
|
|
7514
|
+
return this.renderLayoutSnowflake();
|
|
7515
|
+
case 'snowflake-right':
|
|
7516
|
+
return this.renderLayoutSnowflake();
|
|
7517
|
+
default:
|
|
7518
|
+
return this.renderLayoutClassic();
|
|
6598
7519
|
}
|
|
6599
|
-
const [value] = this.value || [];
|
|
6600
|
-
nativeSelect.value = value || '';
|
|
6601
7520
|
}
|
|
6602
7521
|
|
|
6603
|
-
|
|
6604
7522
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
6605
7523
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
6606
7524
|
|
|
6607
7525
|
// function that renders the HTML and CSS into the scope of the component
|
|
6608
|
-
|
|
7526
|
+
renderBACKUP() {
|
|
6609
7527
|
const placeholderClass = {
|
|
6610
7528
|
hidden: this.value,
|
|
6611
7529
|
};
|
|
@@ -6631,27 +7549,34 @@ class AuroSelect extends i$2 {
|
|
|
6631
7549
|
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
6632
7550
|
</div>
|
|
6633
7551
|
<${this.dropdownTag}
|
|
6634
|
-
|
|
7552
|
+
?autoPlacement="${this.autoPlacement}"
|
|
7553
|
+
?disabled="${this.disabled}"
|
|
6635
7554
|
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
7555
|
+
?matchWidth="${!this.flexMenuWidth}"
|
|
7556
|
+
?noFlip="${this.noFlip}"
|
|
6636
7557
|
?onDark="${this.onDark}"
|
|
6637
|
-
common
|
|
6638
|
-
fluid
|
|
6639
7558
|
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
6640
|
-
?matchWidth="${!this.flexMenuWidth}"
|
|
6641
|
-
chevron
|
|
6642
|
-
.placement="${this.placement}"
|
|
6643
7559
|
.offset="${this.offset}"
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
7560
|
+
.placement="${this.placement}"
|
|
7561
|
+
chevron
|
|
7562
|
+
fluid
|
|
7563
|
+
for="selectMenu"
|
|
7564
|
+
layout="${this.layout}"
|
|
7565
|
+
part="dropdown"
|
|
7566
|
+
shape="${this.shape}"
|
|
7567
|
+
size="${this.size}">
|
|
6647
7568
|
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
6648
|
-
<span id="placeholder"
|
|
7569
|
+
<span id="placeholder"
|
|
7570
|
+
class="${e(placeholderClass)}"
|
|
7571
|
+
?aria-hidden="${this.optionSelected && this.optionSelected.length ? 'true' : false}"
|
|
7572
|
+
>
|
|
7573
|
+
<slot name="placeholder"></slot>
|
|
7574
|
+
</span>
|
|
7575
|
+
<slot name="valueText" id="valueText"></slot>
|
|
6649
7576
|
</span>
|
|
6650
7577
|
|
|
6651
|
-
<div class="menuWrapper">
|
|
6652
|
-
</div>
|
|
6653
|
-
|
|
6654
7578
|
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
7579
|
+
<slot></slot>
|
|
6655
7580
|
</${this.bibtemplateTag}>
|
|
6656
7581
|
<slot name="label" slot="label"></slot>
|
|
6657
7582
|
<p slot="helpText">
|
|
@@ -6691,6 +7616,7 @@ class AuroSelect extends i$2 {
|
|
|
6691
7616
|
</select>
|
|
6692
7617
|
</div>
|
|
6693
7618
|
<!-- Help text and error message template -->
|
|
7619
|
+
${this.renderHtmlHelpText()}
|
|
6694
7620
|
</div>
|
|
6695
7621
|
`;
|
|
6696
7622
|
}
|
|
@@ -6705,102 +7631,6 @@ var tokensCss$1 = i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-b
|
|
|
6705
7631
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6706
7632
|
// See LICENSE in the project root for license information.
|
|
6707
7633
|
|
|
6708
|
-
// ---------------------------------------------------------------------
|
|
6709
|
-
|
|
6710
|
-
/**
|
|
6711
|
-
* Converts value to an array.
|
|
6712
|
-
* If the value is a JSON string representing an array, it will be parsed.
|
|
6713
|
-
* If the value is already an array, it is returned.
|
|
6714
|
-
* If the value is undefined, it returns undefined.
|
|
6715
|
-
* @private
|
|
6716
|
-
* @param {any} value - The value to be converted. Can be a string, array, or undefined.
|
|
6717
|
-
* @returns {Array|undefined} - The converted array or undefined.
|
|
6718
|
-
* @throws {Error} - Throws an error if the value is not an array, undefined,
|
|
6719
|
-
* or if the value cannot be parsed into an array from a JSON string.
|
|
6720
|
-
*/
|
|
6721
|
-
function arrayConverter(value) {
|
|
6722
|
-
// Allow undefined
|
|
6723
|
-
if (value === undefined) {
|
|
6724
|
-
return undefined;
|
|
6725
|
-
}
|
|
6726
|
-
|
|
6727
|
-
// Return the value if it is already an array
|
|
6728
|
-
if (Array.isArray(value)) {
|
|
6729
|
-
return value;
|
|
6730
|
-
}
|
|
6731
|
-
|
|
6732
|
-
try {
|
|
6733
|
-
// If value is a JSON string, parse it
|
|
6734
|
-
const parsed = typeof value === 'string' ? JSON.parse(value) : value;
|
|
6735
|
-
|
|
6736
|
-
// Check if the parsed value is an array
|
|
6737
|
-
if (Array.isArray(parsed)) {
|
|
6738
|
-
return parsed;
|
|
6739
|
-
}
|
|
6740
|
-
} catch (error) {
|
|
6741
|
-
// If JSON parsing fails, continue to throw an error below
|
|
6742
|
-
/* eslint-disable no-console */
|
|
6743
|
-
console.error('JSON parsing failed:', error);
|
|
6744
|
-
}
|
|
6745
|
-
|
|
6746
|
-
// Throw error if the input is not an array or undefined
|
|
6747
|
-
throw new Error('Invalid value: Input must be an array or undefined');
|
|
6748
|
-
}
|
|
6749
|
-
|
|
6750
|
-
/**
|
|
6751
|
-
* Compare two arrays for equality.
|
|
6752
|
-
* @private
|
|
6753
|
-
* @param {Array} arr1 - First array to compare.
|
|
6754
|
-
* @param {Array} arr2 - Second array to compare.
|
|
6755
|
-
* @returns {boolean} True if arrays are equal.
|
|
6756
|
-
*/
|
|
6757
|
-
function arraysAreEqual(arr1, arr2) {
|
|
6758
|
-
// If both arrays undefined, they are equal (true)
|
|
6759
|
-
if (arr1 === undefined || arr2 === undefined) {
|
|
6760
|
-
return arr1 === arr2;
|
|
6761
|
-
}
|
|
6762
|
-
|
|
6763
|
-
// If arrays have different lengths, they are not equal
|
|
6764
|
-
if (arr1.length !== arr2.length) {
|
|
6765
|
-
return false;
|
|
6766
|
-
}
|
|
6767
|
-
|
|
6768
|
-
// If every item at each index is the same, return true
|
|
6769
|
-
for (let index = 0; index < arr1.length; index += 1) {
|
|
6770
|
-
if (arr1[index] !== arr2[index]) {
|
|
6771
|
-
return false;
|
|
6772
|
-
}
|
|
6773
|
-
}
|
|
6774
|
-
return true;
|
|
6775
|
-
}
|
|
6776
|
-
|
|
6777
|
-
/**
|
|
6778
|
-
* Compares array for changes.
|
|
6779
|
-
* @private
|
|
6780
|
-
* @param {Array|any} newVal - New value to compare.
|
|
6781
|
-
* @param {Array|any} oldVal - Old value to compare.
|
|
6782
|
-
* @returns {boolean} True if arrays have changed.
|
|
6783
|
-
*/
|
|
6784
|
-
function arrayOrUndefinedHasChanged(newVal, oldVal) {
|
|
6785
|
-
try {
|
|
6786
|
-
// Check if values are undefined or arrays
|
|
6787
|
-
const isArrayOrUndefined = (val) => val === undefined || Array.isArray(val);
|
|
6788
|
-
|
|
6789
|
-
// If non-array or non-undefined, throw error
|
|
6790
|
-
if (!isArrayOrUndefined(newVal) || !isArrayOrUndefined(oldVal)) {
|
|
6791
|
-
const invalidValue = isArrayOrUndefined(newVal) ? oldVal : newVal;
|
|
6792
|
-
throw new Error(`Value must be an array or undefined, received ${typeof invalidValue}`);
|
|
6793
|
-
}
|
|
6794
|
-
|
|
6795
|
-
// Return true if arrays have changed, false if they are the same
|
|
6796
|
-
return !arraysAreEqual(newVal, oldVal);
|
|
6797
|
-
} catch (error) {
|
|
6798
|
-
/* eslint-disable no-console */
|
|
6799
|
-
console.error(error);
|
|
6800
|
-
// If validation fails, it has changed
|
|
6801
|
-
return true;
|
|
6802
|
-
}
|
|
6803
|
-
}
|
|
6804
7634
|
|
|
6805
7635
|
/**
|
|
6806
7636
|
* Validates if an option can be interacted with.
|
|
@@ -6834,7 +7664,7 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
6834
7664
|
element.dispatchEvent(new CustomEvent(eventName, eventConfig));
|
|
6835
7665
|
}
|
|
6836
7666
|
|
|
6837
|
-
// Copyright (c)
|
|
7667
|
+
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6838
7668
|
// See LICENSE in the project root for license information.
|
|
6839
7669
|
|
|
6840
7670
|
|
|
@@ -6842,14 +7672,14 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
6842
7672
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
6843
7673
|
/**
|
|
6844
7674
|
* The auro-menu element provides users a way to select from a list of options.
|
|
6845
|
-
* @attr {Array<HTMLElement
|
|
7675
|
+
* @attr {HTMLElement|Array<HTMLElement>} optionSelected - An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements.
|
|
6846
7676
|
* @attr {object} optionactive - Specifies the current active menuOption.
|
|
6847
7677
|
* @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
|
|
6848
7678
|
* @attr {boolean} disabled - When true, the entire menu and all options are disabled;
|
|
6849
7679
|
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
6850
7680
|
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
6851
7681
|
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
6852
|
-
* @attr {Array<string
|
|
7682
|
+
* @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
|
|
6853
7683
|
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
6854
7684
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
6855
7685
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
@@ -6862,7 +7692,7 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
6862
7692
|
* @slot - Slot for insertion of menu options.
|
|
6863
7693
|
*/
|
|
6864
7694
|
|
|
6865
|
-
/* eslint-disable no-magic-numbers, max-lines */
|
|
7695
|
+
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens */
|
|
6866
7696
|
|
|
6867
7697
|
class AuroMenu extends i$2 {
|
|
6868
7698
|
constructor() {
|
|
@@ -6942,9 +7772,8 @@ class AuroMenu extends i$2 {
|
|
|
6942
7772
|
reflect: true
|
|
6943
7773
|
},
|
|
6944
7774
|
optionSelected: {
|
|
6945
|
-
// Allow HTMLElement[] arrays and undefined
|
|
6946
|
-
|
|
6947
|
-
hasChanged: arrayOrUndefinedHasChanged
|
|
7775
|
+
// Allow HTMLElement, HTMLElement[] arrays and undefined
|
|
7776
|
+
type: Object
|
|
6948
7777
|
},
|
|
6949
7778
|
optionActive: {
|
|
6950
7779
|
type: Object,
|
|
@@ -6960,10 +7789,8 @@ class AuroMenu extends i$2 {
|
|
|
6960
7789
|
attribute: 'multiselect'
|
|
6961
7790
|
},
|
|
6962
7791
|
value: {
|
|
6963
|
-
// Allow string[] arrays and undefined
|
|
6964
|
-
type: Object
|
|
6965
|
-
converter: arrayConverter,
|
|
6966
|
-
hasChanged: arrayOrUndefinedHasChanged
|
|
7792
|
+
// Allow string, string[] arrays and undefined
|
|
7793
|
+
type: Object
|
|
6967
7794
|
}
|
|
6968
7795
|
};
|
|
6969
7796
|
}
|
|
@@ -6985,7 +7812,7 @@ class AuroMenu extends i$2 {
|
|
|
6985
7812
|
*
|
|
6986
7813
|
*/
|
|
6987
7814
|
static register(name = "auro-menu") {
|
|
6988
|
-
AuroLibraryRuntimeUtils$
|
|
7815
|
+
AuroLibraryRuntimeUtils$4.prototype.registerComponent(name, AuroMenu);
|
|
6989
7816
|
}
|
|
6990
7817
|
|
|
6991
7818
|
// Lifecycle Methods
|
|
@@ -7009,37 +7836,46 @@ class AuroMenu extends i$2 {
|
|
|
7009
7836
|
}
|
|
7010
7837
|
|
|
7011
7838
|
firstUpdated() {
|
|
7012
|
-
AuroLibraryRuntimeUtils$
|
|
7839
|
+
AuroLibraryRuntimeUtils$4.prototype.handleComponentTagRename(this, 'auro-menu');
|
|
7013
7840
|
|
|
7014
7841
|
this.loadingSlots = this.querySelectorAll("[slot='loadingText'], [slot='loadingIcon']");
|
|
7015
7842
|
this.initializeMenu();
|
|
7016
7843
|
}
|
|
7017
7844
|
|
|
7018
7845
|
updated(changedProperties) {
|
|
7846
|
+
if (changedProperties.has('multiSelect')) {
|
|
7847
|
+
// Reset selection if multiSelect mode changes
|
|
7848
|
+
this.clearSelection();
|
|
7849
|
+
}
|
|
7850
|
+
|
|
7019
7851
|
if (changedProperties.has('value')) {
|
|
7020
7852
|
// Handle null/undefined case
|
|
7021
7853
|
if (this.value === undefined || this.value === null) {
|
|
7022
7854
|
this.optionSelected = undefined;
|
|
7023
|
-
// Reset index tracking
|
|
7024
7855
|
this.index = -1;
|
|
7025
7856
|
} else {
|
|
7026
|
-
|
|
7027
|
-
|
|
7857
|
+
if (this.multiSelect) {
|
|
7858
|
+
// In multiselect mode, this.value should be an array of strings
|
|
7859
|
+
const valueArray = Array.isArray(this.value) ? this.value : [this.value];
|
|
7860
|
+
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
7028
7861
|
|
|
7029
|
-
|
|
7030
|
-
|
|
7862
|
+
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
7863
|
+
} else {
|
|
7864
|
+
// In single-select mode, this.value should be a string
|
|
7865
|
+
const matchingOptions = this.items.find((item) => item.value === this.value);
|
|
7031
7866
|
|
|
7032
|
-
|
|
7033
|
-
if (this.multiSelect) {
|
|
7034
|
-
// For multiselect, keep all matching options
|
|
7867
|
+
if (matchingOptions) {
|
|
7035
7868
|
this.optionSelected = matchingOptions;
|
|
7869
|
+
this.index = this.items.indexOf(matchingOptions);
|
|
7036
7870
|
} else {
|
|
7037
|
-
//
|
|
7038
|
-
this.optionSelected =
|
|
7039
|
-
this.index =
|
|
7871
|
+
// If no matching option found, reset selection
|
|
7872
|
+
this.optionSelected = undefined;
|
|
7873
|
+
this.index = -1;
|
|
7040
7874
|
}
|
|
7041
|
-
}
|
|
7042
|
-
|
|
7875
|
+
}
|
|
7876
|
+
|
|
7877
|
+
// If no matching options were found in either mode
|
|
7878
|
+
if (!this.optionSelected || (Array.isArray(this.optionSelected) && this.optionSelected.length === 0)) {
|
|
7043
7879
|
dispatchMenuEvent(this, 'auroMenu-selectValueFailure');
|
|
7044
7880
|
this.optionSelected = undefined;
|
|
7045
7881
|
this.index = -1;
|
|
@@ -7191,8 +8027,8 @@ class AuroMenu extends i$2 {
|
|
|
7191
8027
|
}
|
|
7192
8028
|
} else {
|
|
7193
8029
|
// Single select - use arrays with single values
|
|
7194
|
-
this.value =
|
|
7195
|
-
this.optionSelected =
|
|
8030
|
+
this.value = option.value;
|
|
8031
|
+
this.optionSelected = option;
|
|
7196
8032
|
}
|
|
7197
8033
|
|
|
7198
8034
|
this.index = this.items.indexOf(option);
|
|
@@ -7514,8 +8350,13 @@ class AuroMenu extends i$2 {
|
|
|
7514
8350
|
if (!this.optionSelected) {
|
|
7515
8351
|
return false;
|
|
7516
8352
|
}
|
|
7517
|
-
|
|
7518
|
-
|
|
8353
|
+
|
|
8354
|
+
if (this.multiSelect) {
|
|
8355
|
+
// In multi-select mode, check if the option is in the selected array
|
|
8356
|
+
return Array.isArray(this.optionSelected) && this.optionSelected.some((selectedOption) => selectedOption === option);
|
|
8357
|
+
}
|
|
8358
|
+
|
|
8359
|
+
return this.optionSelected === option;
|
|
7519
8360
|
}
|
|
7520
8361
|
|
|
7521
8362
|
/**
|
|
@@ -7704,6 +8545,76 @@ var tokensCss = i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-def
|
|
|
7704
8545
|
|
|
7705
8546
|
var colorCss = 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)}`;
|
|
7706
8547
|
|
|
8548
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
8549
|
+
// See LICENSE in the project root for license information.
|
|
8550
|
+
|
|
8551
|
+
// ---------------------------------------------------------------------
|
|
8552
|
+
|
|
8553
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
8554
|
+
|
|
8555
|
+
class AuroLibraryRuntimeUtils {
|
|
8556
|
+
|
|
8557
|
+
/* eslint-disable jsdoc/require-param */
|
|
8558
|
+
|
|
8559
|
+
/**
|
|
8560
|
+
* This will register a new custom element with the browser.
|
|
8561
|
+
* @param {String} name - The name of the custom element.
|
|
8562
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
8563
|
+
* @returns {void}
|
|
8564
|
+
*/
|
|
8565
|
+
registerComponent(name, componentClass) {
|
|
8566
|
+
if (!customElements.get(name)) {
|
|
8567
|
+
customElements.define(name, class extends componentClass {});
|
|
8568
|
+
}
|
|
8569
|
+
}
|
|
8570
|
+
|
|
8571
|
+
/**
|
|
8572
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
8573
|
+
* @returns {void}
|
|
8574
|
+
*/
|
|
8575
|
+
closestElement(
|
|
8576
|
+
selector, // selector like in .closest()
|
|
8577
|
+
base = this, // extra functionality to skip a parent
|
|
8578
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
8579
|
+
!el || el === document || el === window
|
|
8580
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
8581
|
+
: found
|
|
8582
|
+
? found // found a selector INside this element
|
|
8583
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
8584
|
+
) {
|
|
8585
|
+
return __Closest(base);
|
|
8586
|
+
}
|
|
8587
|
+
/* eslint-enable jsdoc/require-param */
|
|
8588
|
+
|
|
8589
|
+
/**
|
|
8590
|
+
* 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.
|
|
8591
|
+
* @param {Object} elem - The element to check.
|
|
8592
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
8593
|
+
* @returns {void}
|
|
8594
|
+
*/
|
|
8595
|
+
handleComponentTagRename(elem, tagName) {
|
|
8596
|
+
const tag = tagName.toLowerCase();
|
|
8597
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
8598
|
+
|
|
8599
|
+
if (elemTag !== tag) {
|
|
8600
|
+
elem.setAttribute(tag, true);
|
|
8601
|
+
}
|
|
8602
|
+
}
|
|
8603
|
+
|
|
8604
|
+
/**
|
|
8605
|
+
* Validates if an element is a specific Auro component.
|
|
8606
|
+
* @param {Object} elem - The element to validate.
|
|
8607
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
8608
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
8609
|
+
*/
|
|
8610
|
+
elementMatch(elem, tagName) {
|
|
8611
|
+
const tag = tagName.toLowerCase();
|
|
8612
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
8613
|
+
|
|
8614
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
8615
|
+
}
|
|
8616
|
+
}
|
|
8617
|
+
|
|
7707
8618
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7708
8619
|
// See LICENSE in the project root for license information.
|
|
7709
8620
|
|
|
@@ -7723,7 +8634,7 @@ class AuroIcon extends BaseIcon {
|
|
|
7723
8634
|
*/
|
|
7724
8635
|
privateDefaults() {
|
|
7725
8636
|
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
7726
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils
|
|
8637
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
7727
8638
|
}
|
|
7728
8639
|
|
|
7729
8640
|
// function to define props used within the scope of this component
|
|
@@ -7805,7 +8716,7 @@ class AuroIcon extends BaseIcon {
|
|
|
7805
8716
|
*
|
|
7806
8717
|
*/
|
|
7807
8718
|
static register(name = "auro-icon") {
|
|
7808
|
-
AuroLibraryRuntimeUtils
|
|
8719
|
+
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroIcon);
|
|
7809
8720
|
}
|
|
7810
8721
|
|
|
7811
8722
|
connectedCallback() {
|
|
@@ -7911,7 +8822,7 @@ class AuroMenuOption extends i$2 {
|
|
|
7911
8822
|
/**
|
|
7912
8823
|
* @private
|
|
7913
8824
|
*/
|
|
7914
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
8825
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$4();
|
|
7915
8826
|
}
|
|
7916
8827
|
|
|
7917
8828
|
static get properties() {
|
|
@@ -7955,7 +8866,7 @@ class AuroMenuOption extends i$2 {
|
|
|
7955
8866
|
*
|
|
7956
8867
|
*/
|
|
7957
8868
|
static register(name = "auro-menuoption") {
|
|
7958
|
-
AuroLibraryRuntimeUtils$
|
|
8869
|
+
AuroLibraryRuntimeUtils$4.prototype.registerComponent(name, AuroMenuOption);
|
|
7959
8870
|
}
|
|
7960
8871
|
|
|
7961
8872
|
firstUpdated() {
|
|
@@ -8023,6 +8934,7 @@ function initExamples(initCount) {
|
|
|
8023
8934
|
inDialogExample();
|
|
8024
8935
|
resetStateExample();
|
|
8025
8936
|
auroMenuLoadingExample();
|
|
8937
|
+
valueTextExample();
|
|
8026
8938
|
} catch (err) {
|
|
8027
8939
|
if (initCount <= 20) {
|
|
8028
8940
|
// setTimeout handles issue where content is sometimes loaded after the functions get called
|