@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.2 → 0.0.0-pr624.21
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 +13 -2
- package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +1292 -79
- package/components/bibtemplate/dist/registered.js +1292 -79
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/api.md +8 -9
- package/components/checkbox/demo/api.min.js +30 -24
- package/components/checkbox/demo/index.md +2 -2
- package/components/checkbox/demo/index.min.js +30 -24
- package/components/checkbox/demo/readme.md +1 -1
- package/components/checkbox/dist/auro-checkbox.d.ts +3 -3
- package/components/checkbox/dist/index.js +30 -24
- package/components/checkbox/dist/registered.js +30 -24
- package/components/combobox/demo/api.md +53 -0
- package/components/combobox/demo/api.min.js +2898 -753
- package/components/combobox/demo/index.md +6 -0
- package/components/combobox/demo/index.min.js +2898 -753
- package/components/combobox/dist/auro-combobox.d.ts +12 -12
- package/components/combobox/dist/index.js +2646 -642
- package/components/combobox/dist/registered.js +2646 -642
- package/components/counter/demo/api.md +21 -19
- package/components/counter/demo/api.min.js +3648 -929
- package/components/counter/demo/index.md +99 -34
- package/components/counter/demo/index.min.js +3648 -929
- package/components/counter/dist/auro-counter-button.d.ts +2 -0
- package/components/counter/dist/auro-counter-group.d.ts +105 -6
- package/components/counter/dist/auro-counter.d.ts +6 -0
- package/components/counter/dist/helptextVersion.d.ts +2 -0
- package/components/counter/dist/iconVersion.d.ts +1 -1
- package/components/counter/dist/index.js +3648 -929
- package/components/counter/dist/registered.js +3648 -929
- package/components/datepicker/demo/api.md +36 -19
- package/components/datepicker/demo/api.min.js +11437 -7744
- package/components/datepicker/demo/index.md +80 -0
- package/components/datepicker/demo/index.min.js +11437 -7744
- package/components/datepicker/dist/auro-datepicker.d.ts +71 -3
- package/components/datepicker/dist/buttonVersion.d.ts +1 -1
- package/components/datepicker/dist/iconVersion.d.ts +2 -0
- package/components/datepicker/dist/index.js +13847 -10154
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +13847 -10154
- package/components/dropdown/demo/api.md +6 -7
- package/components/dropdown/demo/api.min.js +238 -144
- package/components/dropdown/demo/index.md +57 -9
- package/components/dropdown/demo/index.min.js +238 -144
- package/components/dropdown/dist/auro-dropdown.d.ts +10 -9
- package/components/dropdown/dist/auro-dropdownBib.d.ts +22 -0
- package/components/dropdown/dist/index.js +238 -144
- package/components/dropdown/dist/registered.js +238 -144
- package/components/form/demo/api.min.js +1 -1
- package/components/form/demo/index.min.js +1 -1
- package/components/form/dist/index.js +1 -1
- package/components/form/dist/registered.js +1 -1
- package/components/helptext/dist/index.js +2 -2
- package/components/helptext/dist/registered.js +2 -2
- package/components/input/demo/api.md +63 -56
- package/components/input/demo/api.min.js +983 -269
- package/components/input/demo/index.min.js +982 -268
- package/components/input/dist/auro-input.d.ts +202 -14
- package/components/input/dist/base-input.d.ts +30 -7
- package/components/input/dist/buttonVersion.d.ts +1 -1
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +982 -268
- package/components/input/dist/registered.js +982 -268
- package/components/layoutElement/dist/index.js +13 -10
- package/components/menu/demo/api.html +38 -0
- package/components/menu/demo/api.md +68 -7
- package/components/menu/demo/api.min.js +278 -42
- package/components/menu/demo/index.min.js +278 -42
- package/components/menu/dist/auro-menu.d.ts +28 -5
- package/components/menu/dist/auro-menuoption.d.ts +15 -3
- package/components/menu/dist/iconVersion.d.ts +1 -1
- package/components/menu/dist/index.js +278 -42
- package/components/menu/dist/registered.js +278 -42
- package/components/menu/dist/styles/default/color-menuoption-css.d.ts +2 -0
- package/components/menu/dist/styles/default/style-menu-css.d.ts +2 -0
- package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
- package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
- package/components/radio/demo/api.md +2 -2
- package/components/radio/demo/api.min.js +10 -7
- package/components/radio/demo/index.min.js +10 -7
- package/components/radio/dist/auro-radio.d.ts +1 -1
- package/components/radio/dist/index.js +10 -7
- package/components/radio/dist/registered.js +10 -7
- package/components/select/demo/api.js +2 -0
- package/components/select/demo/api.md +78 -12
- package/components/select/demo/api.min.js +2797 -538
- package/components/select/demo/index.html +1 -0
- package/components/select/demo/index.md +325 -763
- package/components/select/demo/index.min.js +2790 -543
- package/components/select/dist/auro-select.d.ts +111 -11
- package/components/select/dist/helptextVersion.d.ts +2 -0
- package/components/select/dist/index.js +2533 -427
- package/components/select/dist/registered.js +2533 -427
- 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 +6 -4
- /package/components/{dropdown/dist/styles/default/bibColors-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/{dropdown → datepicker}/dist/styles/default/color-css.d.ts +0 -0
- /package/components/{dropdown/dist/styles/default/bibStyles-css.d.ts → datepicker/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/{dropdown/dist/styles/default/style-css.d.ts → datepicker/dist/styles/snowflake/color-css.d.ts} +0 -0
- /package/components/{dropdown/dist/styles → datepicker/dist/styles/snowflake}/style-css.d.ts +0 -0
- /package/components/{menu/dist/styles/color-menu-css.d.ts → dropdown/dist/styles/classic/bibColors-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/color-menuoption-css.d.ts → dropdown/dist/styles/classic/bibStyles-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/style-menu-css.d.ts → dropdown/dist/styles/classic/color-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/style-menuoption-css.d.ts → dropdown/dist/styles/classic/style-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{tokens-css.d.ts → default/color-menu-css.d.ts} +0 -0
|
@@ -1,9 +1,108 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LitElement, css, html as html$1 } from 'lit';
|
|
2
2
|
import { classMap } from 'lit/directives/class-map.js';
|
|
3
3
|
import { unsafeStatic, literal, html } from 'lit/static-html.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
5
|
import { ifDefined as ifDefined$1 } from 'lit-html/directives/if-defined.js';
|
|
6
6
|
|
|
7
|
+
let AuroElement$3 = class AuroElement extends LitElement {
|
|
8
|
+
static get properties() {
|
|
9
|
+
return {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Defines the language of an element.
|
|
13
|
+
* @default {'default'}
|
|
14
|
+
*/
|
|
15
|
+
layout: {
|
|
16
|
+
type: String,
|
|
17
|
+
attribute: "layout",
|
|
18
|
+
reflect: true
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
shape: {
|
|
22
|
+
type: String,
|
|
23
|
+
attribute: "shape",
|
|
24
|
+
reflect: true
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
size: {
|
|
28
|
+
type: String,
|
|
29
|
+
attribute: "size",
|
|
30
|
+
reflect: true
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
onDark: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
attribute: "ondark",
|
|
36
|
+
reflect: true
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
resetShapeClasses() {
|
|
42
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
43
|
+
|
|
44
|
+
if (wrapper) {
|
|
45
|
+
wrapper.classList.forEach((className) => {
|
|
46
|
+
if (className.startsWith('shape-')) {
|
|
47
|
+
wrapper.classList.remove(className);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (this.shape && this.size) {
|
|
54
|
+
wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
55
|
+
} else {
|
|
56
|
+
wrapper.classList.add('shape-none');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
resetLayoutClasses() {
|
|
61
|
+
if (this.layout) {
|
|
62
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
63
|
+
|
|
64
|
+
if (wrapper) {
|
|
65
|
+
wrapper.classList.forEach((className) => {
|
|
66
|
+
if (className.startsWith('layout-')) {
|
|
67
|
+
wrapper.classList.remove(className);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
updateComponentArchitecture() {
|
|
77
|
+
this.resetLayoutClasses();
|
|
78
|
+
this.resetShapeClasses();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
updated(changedProperties) {
|
|
82
|
+
if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
|
|
83
|
+
this.updateComponentArchitecture();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
|
|
88
|
+
// This will catch if an invalid layout value is passed in and render the default layout if so.
|
|
89
|
+
render() {
|
|
90
|
+
try {
|
|
91
|
+
return this.renderLayout();
|
|
92
|
+
} catch (error) {
|
|
93
|
+
// failed to get the defined layout
|
|
94
|
+
console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
|
|
95
|
+
|
|
96
|
+
// fallback to the default layout
|
|
97
|
+
return this.getLayout('default');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
var shapeSizeCss$1 = css`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:58px;max-height:58px;border-style:solid;border-width:1px;border-radius:var(--ds-border-radius, 0.375rem)}.shape-classic-xl.simple,.shape-classic-lg.simple,.shape-classic-md.simple,.shape-classic-sm.simple,.shape-classic-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}`;
|
|
103
|
+
|
|
104
|
+
var tokensCss$5 = css`:host(:not([ondark])){--ds-auro-select-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-select-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-select-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-select-placeholder-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-select-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-select-error-icon-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-select-outline-color: transparent}:host([ondark]){--ds-auro-select-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-select-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-select-label-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-placeholder-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-error-icon-color: var(--ds-basic-color-status-error-subtle, #fbc6c6);--ds-auro-select-outline-color: transparent}`;
|
|
105
|
+
|
|
7
106
|
class DateFormatter {
|
|
8
107
|
|
|
9
108
|
constructor() {
|
|
@@ -60,9 +159,10 @@ class DateFormatter {
|
|
|
60
159
|
/**
|
|
61
160
|
* Convert a date object to string format.
|
|
62
161
|
* @param {Object} date - Date to convert to string.
|
|
63
|
-
* @
|
|
162
|
+
* @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
|
|
163
|
+
* @returns {String} Returns the date as a string.
|
|
64
164
|
*/
|
|
65
|
-
this.getDateAsString = (date) => date.toLocaleDateString(
|
|
165
|
+
this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
|
|
66
166
|
year: "numeric",
|
|
67
167
|
month: "2-digit",
|
|
68
168
|
day: "2-digit",
|
|
@@ -254,7 +354,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
|
|
|
254
354
|
const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
|
|
255
355
|
|
|
256
356
|
// Get the date string of the date object we created from the string date
|
|
257
|
-
const actualDateStr = dateFormatter.getDateAsString(dateObj);
|
|
357
|
+
const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
|
|
258
358
|
|
|
259
359
|
// Guard Clause: Generated date matches date string input
|
|
260
360
|
if (expectedDateStr !== actualDateStr) {
|
|
@@ -419,7 +519,7 @@ const {
|
|
|
419
519
|
|
|
420
520
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
421
521
|
|
|
422
|
-
let AuroLibraryRuntimeUtils$
|
|
522
|
+
let AuroLibraryRuntimeUtils$6 = class AuroLibraryRuntimeUtils {
|
|
423
523
|
|
|
424
524
|
/* eslint-disable jsdoc/require-param */
|
|
425
525
|
|
|
@@ -489,7 +589,7 @@ let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
|
|
|
489
589
|
class AuroFormValidation {
|
|
490
590
|
|
|
491
591
|
constructor() {
|
|
492
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
592
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
493
593
|
}
|
|
494
594
|
|
|
495
595
|
/**
|
|
@@ -768,7 +868,9 @@ class AuroFormValidation {
|
|
|
768
868
|
elem.validity = this.auroInputElements[0].validity;
|
|
769
869
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
770
870
|
|
|
771
|
-
|
|
871
|
+
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
872
|
+
// combobox's 2nd input will have noValidate set true.
|
|
873
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !this.auroInputElements[1].noValidate) {
|
|
772
874
|
elem.validity = this.auroInputElements[1].validity;
|
|
773
875
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
774
876
|
}
|
|
@@ -895,7 +997,7 @@ let AuroDependencyVersioning$2 = class AuroDependencyVersioning {
|
|
|
895
997
|
|
|
896
998
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
897
999
|
|
|
898
|
-
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
1000
|
+
let AuroLibraryRuntimeUtils$2$1 = class AuroLibraryRuntimeUtils {
|
|
899
1001
|
|
|
900
1002
|
/* eslint-disable jsdoc/require-param */
|
|
901
1003
|
|
|
@@ -1478,10 +1580,11 @@ const flip$1 = function (options) {
|
|
|
1478
1580
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
1479
1581
|
const nextPlacement = placements[nextIndex];
|
|
1480
1582
|
if (nextPlacement) {
|
|
1481
|
-
var _overflowsData$;
|
|
1482
1583
|
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
1483
|
-
|
|
1484
|
-
if
|
|
1584
|
+
if (!ignoreCrossAxisOverflow ||
|
|
1585
|
+
// We leave the current main axis only if every placement on that axis
|
|
1586
|
+
// overflows the main axis.
|
|
1587
|
+
overflowsData.every(d => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {
|
|
1485
1588
|
// Try next placement and re-run the lifecycle.
|
|
1486
1589
|
return {
|
|
1487
1590
|
data: {
|
|
@@ -2502,8 +2605,28 @@ class AuroFloatingUI {
|
|
|
2502
2605
|
if (!AuroFloatingUI.isMousePressHandlerInitialized && window && window.addEventListener) {
|
|
2503
2606
|
AuroFloatingUI.isMousePressHandlerInitialized = true;
|
|
2504
2607
|
|
|
2608
|
+
// Track timeout for isMousePressed reset to avoid race conditions
|
|
2609
|
+
if (!AuroFloatingUI._mousePressedTimeout) {
|
|
2610
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
2611
|
+
}
|
|
2505
2612
|
const mouseEventGlobalHandler = (event) => {
|
|
2506
|
-
|
|
2613
|
+
const isPressed = event.type === 'mousedown';
|
|
2614
|
+
if (isPressed) {
|
|
2615
|
+
// Clear any pending timeout to prevent race condition
|
|
2616
|
+
if (AuroFloatingUI._mousePressedTimeout !== null) {
|
|
2617
|
+
clearTimeout(AuroFloatingUI._mousePressedTimeout);
|
|
2618
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
2619
|
+
}
|
|
2620
|
+
if (!AuroFloatingUI.isMousePressed) {
|
|
2621
|
+
AuroFloatingUI.isMousePressed = true;
|
|
2622
|
+
}
|
|
2623
|
+
} else if (AuroFloatingUI.isMousePressed && !isPressed) {
|
|
2624
|
+
// Schedule reset and track timeout ID
|
|
2625
|
+
AuroFloatingUI._mousePressedTimeout = setTimeout(() => {
|
|
2626
|
+
AuroFloatingUI.isMousePressed = false;
|
|
2627
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
2628
|
+
}, 0);
|
|
2629
|
+
}
|
|
2507
2630
|
};
|
|
2508
2631
|
|
|
2509
2632
|
window.addEventListener('mousedown', mouseEventGlobalHandler);
|
|
@@ -2630,6 +2753,7 @@ class AuroFloatingUI {
|
|
|
2630
2753
|
|
|
2631
2754
|
// Compute the position of the bib
|
|
2632
2755
|
computePosition(this.element.trigger, this.element.bib, {
|
|
2756
|
+
strategy: this.element.floaterConfig?.strategy || 'fixed',
|
|
2633
2757
|
placement: this.element.floaterConfig?.placement,
|
|
2634
2758
|
middleware: middleware || []
|
|
2635
2759
|
}).then(({ x, y }) => { // eslint-disable-line id-length
|
|
@@ -2764,8 +2888,9 @@ class AuroFloatingUI {
|
|
|
2764
2888
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2765
2889
|
return;
|
|
2766
2890
|
}
|
|
2767
|
-
|
|
2768
|
-
if
|
|
2891
|
+
|
|
2892
|
+
// if fullscreen bib is in fullscreen mode, do not close
|
|
2893
|
+
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2769
2894
|
return;
|
|
2770
2895
|
}
|
|
2771
2896
|
|
|
@@ -3066,8 +3191,6 @@ class AuroFloatingUI {
|
|
|
3066
3191
|
this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
|
|
3067
3192
|
}
|
|
3068
3193
|
|
|
3069
|
-
document.body.append(this.element.bib);
|
|
3070
|
-
|
|
3071
3194
|
this.regenerateBibId();
|
|
3072
3195
|
this.handleTriggerTabIndex();
|
|
3073
3196
|
|
|
@@ -3154,7 +3277,7 @@ let AuroDependencyVersioning$1 = class AuroDependencyVersioning {
|
|
|
3154
3277
|
* @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
|
|
3155
3278
|
*/
|
|
3156
3279
|
|
|
3157
|
-
let AuroElement$1 = class AuroElement extends LitElement {
|
|
3280
|
+
let AuroElement$1$1 = class AuroElement extends LitElement {
|
|
3158
3281
|
|
|
3159
3282
|
// function to define props used within the scope of this component
|
|
3160
3283
|
static get properties() {
|
|
@@ -3222,7 +3345,7 @@ var styleCss$2$1 = css`:focus:not(:focus-visible){outline:3px solid transparent}
|
|
|
3222
3345
|
*/
|
|
3223
3346
|
|
|
3224
3347
|
// build the component class
|
|
3225
|
-
let BaseIcon$1 = class BaseIcon extends AuroElement$1 {
|
|
3348
|
+
let BaseIcon$1 = class BaseIcon extends AuroElement$1$1 {
|
|
3226
3349
|
constructor() {
|
|
3227
3350
|
super();
|
|
3228
3351
|
this.onDark = false;
|
|
@@ -3294,9 +3417,79 @@ let BaseIcon$1 = class BaseIcon extends AuroElement$1 {
|
|
|
3294
3417
|
}
|
|
3295
3418
|
};
|
|
3296
3419
|
|
|
3297
|
-
var tokensCss$2 = css`: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)}`;
|
|
3420
|
+
var tokensCss$2$1 = css`: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)}`;
|
|
3421
|
+
|
|
3422
|
+
var colorCss$3$1 = css`: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)}`;
|
|
3423
|
+
|
|
3424
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3425
|
+
// See LICENSE in the project root for license information.
|
|
3426
|
+
|
|
3427
|
+
// ---------------------------------------------------------------------
|
|
3428
|
+
|
|
3429
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
3430
|
+
|
|
3431
|
+
let AuroLibraryRuntimeUtils$1$1 = class AuroLibraryRuntimeUtils {
|
|
3432
|
+
|
|
3433
|
+
/* eslint-disable jsdoc/require-param */
|
|
3434
|
+
|
|
3435
|
+
/**
|
|
3436
|
+
* This will register a new custom element with the browser.
|
|
3437
|
+
* @param {String} name - The name of the custom element.
|
|
3438
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
3439
|
+
* @returns {void}
|
|
3440
|
+
*/
|
|
3441
|
+
registerComponent(name, componentClass) {
|
|
3442
|
+
if (!customElements.get(name)) {
|
|
3443
|
+
customElements.define(name, class extends componentClass {});
|
|
3444
|
+
}
|
|
3445
|
+
}
|
|
3446
|
+
|
|
3447
|
+
/**
|
|
3448
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
3449
|
+
* @returns {void}
|
|
3450
|
+
*/
|
|
3451
|
+
closestElement(
|
|
3452
|
+
selector, // selector like in .closest()
|
|
3453
|
+
base = this, // extra functionality to skip a parent
|
|
3454
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
3455
|
+
!el || el === document || el === window
|
|
3456
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
3457
|
+
: found
|
|
3458
|
+
? found // found a selector INside this element
|
|
3459
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
3460
|
+
) {
|
|
3461
|
+
return __Closest(base);
|
|
3462
|
+
}
|
|
3463
|
+
/* eslint-enable jsdoc/require-param */
|
|
3464
|
+
|
|
3465
|
+
/**
|
|
3466
|
+
* 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.
|
|
3467
|
+
* @param {Object} elem - The element to check.
|
|
3468
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
3469
|
+
* @returns {void}
|
|
3470
|
+
*/
|
|
3471
|
+
handleComponentTagRename(elem, tagName) {
|
|
3472
|
+
const tag = tagName.toLowerCase();
|
|
3473
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
3474
|
+
|
|
3475
|
+
if (elemTag !== tag) {
|
|
3476
|
+
elem.setAttribute(tag, true);
|
|
3477
|
+
}
|
|
3478
|
+
}
|
|
3479
|
+
|
|
3480
|
+
/**
|
|
3481
|
+
* Validates if an element is a specific Auro component.
|
|
3482
|
+
* @param {Object} elem - The element to validate.
|
|
3483
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
3484
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
3485
|
+
*/
|
|
3486
|
+
elementMatch(elem, tagName) {
|
|
3487
|
+
const tag = tagName.toLowerCase();
|
|
3488
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
3298
3489
|
|
|
3299
|
-
|
|
3490
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
3491
|
+
}
|
|
3492
|
+
};
|
|
3300
3493
|
|
|
3301
3494
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
3302
3495
|
// See LICENSE in the project root for license information.
|
|
@@ -3317,7 +3510,7 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
3317
3510
|
*/
|
|
3318
3511
|
privateDefaults() {
|
|
3319
3512
|
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
3320
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
3513
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$1$1();
|
|
3321
3514
|
}
|
|
3322
3515
|
|
|
3323
3516
|
// function to define props used within the scope of this component
|
|
@@ -3384,9 +3577,9 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
3384
3577
|
static get styles() {
|
|
3385
3578
|
return [
|
|
3386
3579
|
super.styles,
|
|
3387
|
-
css`${tokensCss$2}`,
|
|
3580
|
+
css`${tokensCss$2$1}`,
|
|
3388
3581
|
css`${styleCss$2$1}`,
|
|
3389
|
-
css`${colorCss$3}`
|
|
3582
|
+
css`${colorCss$3$1}`
|
|
3390
3583
|
];
|
|
3391
3584
|
}
|
|
3392
3585
|
|
|
@@ -3399,7 +3592,7 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
3399
3592
|
*
|
|
3400
3593
|
*/
|
|
3401
3594
|
static register(name = "auro-icon") {
|
|
3402
|
-
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroIcon);
|
|
3595
|
+
AuroLibraryRuntimeUtils$1$1.prototype.registerComponent(name, AuroIcon);
|
|
3403
3596
|
}
|
|
3404
3597
|
|
|
3405
3598
|
connectedCallback() {
|
|
@@ -3420,8 +3613,12 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
3420
3613
|
async firstUpdated() {
|
|
3421
3614
|
await super.firstUpdated();
|
|
3422
3615
|
|
|
3423
|
-
|
|
3424
|
-
|
|
3616
|
+
/**
|
|
3617
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
3618
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
3619
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
3620
|
+
*/
|
|
3621
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
3425
3622
|
const svgDesc = this.svg.querySelector('desc');
|
|
3426
3623
|
|
|
3427
3624
|
if (svgDesc) {
|
|
@@ -3467,17 +3664,16 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
3467
3664
|
|
|
3468
3665
|
var iconVersion$1 = '6.1.2';
|
|
3469
3666
|
|
|
3470
|
-
var styleCss$1$
|
|
3667
|
+
var styleCss$1$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}`;
|
|
3471
3668
|
|
|
3472
|
-
var colorCss$2 = css`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
3669
|
+
var colorCss$2$1 = css`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
3473
3670
|
|
|
3474
|
-
var tokensCss$1 = css`:host(:not([ondark])){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-dropdown-trigger-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-border-color:
|
|
3671
|
+
var tokensCss$1$1 = css`:host(:not([ondark])){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-dropdown-trigger-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db);--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}`;
|
|
3475
3672
|
|
|
3476
3673
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
3477
3674
|
// See LICENSE in the project root for license information.
|
|
3478
3675
|
|
|
3479
3676
|
|
|
3480
|
-
|
|
3481
3677
|
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
3482
3678
|
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
3483
3679
|
'xl',
|
|
@@ -3493,7 +3689,7 @@ const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
|
3493
3689
|
*/
|
|
3494
3690
|
|
|
3495
3691
|
class AuroDropdownBib extends LitElement {
|
|
3496
|
-
|
|
3692
|
+
// not extending AuroElement because Bib needs only `shape` prop
|
|
3497
3693
|
constructor() {
|
|
3498
3694
|
super();
|
|
3499
3695
|
|
|
@@ -3502,14 +3698,17 @@ class AuroDropdownBib extends LitElement {
|
|
|
3502
3698
|
*/
|
|
3503
3699
|
this._mobileBreakpointValue = undefined;
|
|
3504
3700
|
|
|
3505
|
-
AuroLibraryRuntimeUtils$1.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
3701
|
+
AuroLibraryRuntimeUtils$2$1.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
3702
|
+
|
|
3703
|
+
this.shape = "rounded";
|
|
3704
|
+
this.matchWidth = false;
|
|
3506
3705
|
}
|
|
3507
3706
|
|
|
3508
3707
|
static get styles() {
|
|
3509
3708
|
return [
|
|
3510
|
-
styleCss$1$
|
|
3511
|
-
colorCss$2,
|
|
3512
|
-
tokensCss$1
|
|
3709
|
+
styleCss$1$2,
|
|
3710
|
+
colorCss$2$1,
|
|
3711
|
+
tokensCss$1$1
|
|
3513
3712
|
];
|
|
3514
3713
|
}
|
|
3515
3714
|
|
|
@@ -3540,6 +3739,15 @@ class AuroDropdownBib extends LitElement {
|
|
|
3540
3739
|
reflect: true
|
|
3541
3740
|
},
|
|
3542
3741
|
|
|
3742
|
+
/**
|
|
3743
|
+
* If declared, the bib width will match the trigger width.
|
|
3744
|
+
* @private
|
|
3745
|
+
*/
|
|
3746
|
+
matchWidth: {
|
|
3747
|
+
type: Boolean,
|
|
3748
|
+
reflect: true
|
|
3749
|
+
},
|
|
3750
|
+
|
|
3543
3751
|
/**
|
|
3544
3752
|
* If declared, will apply border-radius to the bib.
|
|
3545
3753
|
*/
|
|
@@ -3547,6 +3755,18 @@ class AuroDropdownBib extends LitElement {
|
|
|
3547
3755
|
type: Boolean,
|
|
3548
3756
|
reflect: true
|
|
3549
3757
|
},
|
|
3758
|
+
|
|
3759
|
+
/**
|
|
3760
|
+
* A reference to the associated bib template element.
|
|
3761
|
+
*/
|
|
3762
|
+
bibTemplate: {
|
|
3763
|
+
type: Object
|
|
3764
|
+
},
|
|
3765
|
+
|
|
3766
|
+
shape: {
|
|
3767
|
+
type: String,
|
|
3768
|
+
reflect: true
|
|
3769
|
+
}
|
|
3550
3770
|
};
|
|
3551
3771
|
}
|
|
3552
3772
|
|
|
@@ -3579,13 +3799,62 @@ class AuroDropdownBib extends LitElement {
|
|
|
3579
3799
|
}
|
|
3580
3800
|
}
|
|
3581
3801
|
});
|
|
3802
|
+
|
|
3803
|
+
if (this.bibTemplate) {
|
|
3804
|
+
// If the bib template is found, set the fullscreen attribute
|
|
3805
|
+
if (this.isFullscreen) {
|
|
3806
|
+
this.bibTemplate.setAttribute('isFullscreen', 'true');
|
|
3807
|
+
} else {
|
|
3808
|
+
this.bibTemplate.removeAttribute('isFullscreen');
|
|
3809
|
+
}
|
|
3810
|
+
}
|
|
3582
3811
|
}
|
|
3583
3812
|
}
|
|
3584
3813
|
|
|
3814
|
+
connectedCallback() {
|
|
3815
|
+
super.connectedCallback();
|
|
3816
|
+
|
|
3817
|
+
// Listen for the auro-bibtemplate-connected event to set the fullscreen attribute
|
|
3818
|
+
this.addEventListener('auro-bibtemplate-connected', (event) => {
|
|
3819
|
+
const bibTemplate = event.detail.element;
|
|
3820
|
+
this.bibTemplate = bibTemplate;
|
|
3821
|
+
|
|
3822
|
+
if (bibTemplate) {
|
|
3823
|
+
// If the bib template is found, set the fullscreen attribute
|
|
3824
|
+
if (this.isFullscreen) {
|
|
3825
|
+
bibTemplate.setAttribute('isFullscreen', 'true');
|
|
3826
|
+
} else {
|
|
3827
|
+
bibTemplate.removeAttribute('isFullscreen');
|
|
3828
|
+
}
|
|
3829
|
+
}
|
|
3830
|
+
});
|
|
3831
|
+
}
|
|
3832
|
+
|
|
3833
|
+
firstUpdated(changedProperties) {
|
|
3834
|
+
super.firstUpdated(changedProperties);
|
|
3835
|
+
|
|
3836
|
+
// Dispatch a custom event when the component is connected
|
|
3837
|
+
this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
|
|
3838
|
+
bubbles: true,
|
|
3839
|
+
composed: true,
|
|
3840
|
+
detail: {
|
|
3841
|
+
element: this
|
|
3842
|
+
}
|
|
3843
|
+
}));
|
|
3844
|
+
}
|
|
3845
|
+
|
|
3585
3846
|
// function that renders the HTML and CSS into the scope of the component
|
|
3586
3847
|
render() {
|
|
3848
|
+
const classes = {
|
|
3849
|
+
container: true
|
|
3850
|
+
};
|
|
3851
|
+
|
|
3852
|
+
// Since this class does not inherit from AuroElement, we apply the shape-related class within the `render` function,
|
|
3853
|
+
// mimicking the class naming convention used in AuroElement.resetShapeClasses.
|
|
3854
|
+
classes[`shape-${this.shape}`] = true;
|
|
3855
|
+
|
|
3587
3856
|
return html`
|
|
3588
|
-
<div class="
|
|
3857
|
+
<div class="${classMap(classes)}" part="bibContainer">
|
|
3589
3858
|
<slot></slot>
|
|
3590
3859
|
</div>
|
|
3591
3860
|
`;
|
|
@@ -3594,23 +3863,23 @@ class AuroDropdownBib extends LitElement {
|
|
|
3594
3863
|
|
|
3595
3864
|
var dropdownVersion$1 = '3.0.0';
|
|
3596
3865
|
|
|
3597
|
-
var shapeSizeCss = css`.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:
|
|
3866
|
+
var shapeSizeCss = css`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:58px;max-height:58px;border-style:solid;border-width:1px;border-radius:var(--ds-border-radius, 0.375rem)}.shape-classic-xl.simple,.shape-classic-lg.simple,.shape-classic-md.simple,.shape-classic-sm.simple,.shape-classic-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}`;
|
|
3598
3867
|
|
|
3599
|
-
var colorCss$1$1 = css`: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-
|
|
3868
|
+
var colorCss$1$1 = css`: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-basic-color-status-error-subtle, #fbc6c6)}.helpText{color:var(--ds-auro-dropdown-helptext-text-color)}`;
|
|
3600
3869
|
|
|
3601
|
-
var classicColorCss = css`: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)
|
|
3870
|
+
var classicColorCss = css`:host([layout*=classic]:not([onDark])) .label{color:var(--ds-auro-dropdown-label-text-color)}:host([layout*=classic]:not([onDark])) .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)}:host([layout*=classic]:not([onDark])) .trigger:focus-within,:host([layout*=classic]:not([onDark])) .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]:not([onDark])){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host([layout*=classic][error]:not([onDark])){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([layout*=classic][error]:not([onDark])) .trigger:focus-within,:host([layout*=classic][error]:not([onDark])) .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][onDark]) .label{color:var(--ds-auro-dropdown-label-text-color)}:host([layout*=classic][onDark]) .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)}:host([layout*=classic][onDark]) .trigger:focus-within,:host([layout*=classic][onDark]) .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]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}:host([layout*=classic][onDark][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}: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)}`;
|
|
3602
3871
|
|
|
3603
|
-
var classicLayoutCss = css`: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;
|
|
3872
|
+
var classicLayoutCss = css`: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;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}@media(hover: hover){:host([layout*=classic]) .trigger:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([layout*=classic]:not([simple])) .triggerContentWrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([layout*=classic][matchwidth]) #bibSizer{width:100%}:host([layout*=classic][disabled]){pointer-events:none}`;
|
|
3604
3873
|
|
|
3605
|
-
var styleEmphasizedCss = css`:host{display:block}.wrapper{display:flex;flex-direction:
|
|
3874
|
+
var styleEmphasizedCss = css`: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;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)}`;
|
|
3606
3875
|
|
|
3607
|
-
var styleSnowflakeCss = css`:host{display:block}.wrapper{display:flex;flex-direction:
|
|
3876
|
+
var styleSnowflakeCss = css`: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;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)}`;
|
|
3608
3877
|
|
|
3609
|
-
var colorCss$
|
|
3878
|
+
var colorCss$5 = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
3610
3879
|
|
|
3611
|
-
var styleCss$
|
|
3880
|
+
var styleCss$6 = css`.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
3612
3881
|
|
|
3613
|
-
var tokensCss$
|
|
3882
|
+
var tokensCss$4 = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
3614
3883
|
|
|
3615
3884
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3616
3885
|
// See LICENSE in the project root for license information.
|
|
@@ -3619,7 +3888,7 @@ var tokensCss$3 = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texti
|
|
|
3619
3888
|
|
|
3620
3889
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
3621
3890
|
|
|
3622
|
-
let AuroLibraryRuntimeUtils$
|
|
3891
|
+
let AuroLibraryRuntimeUtils$5 = class AuroLibraryRuntimeUtils {
|
|
3623
3892
|
|
|
3624
3893
|
/* eslint-disable jsdoc/require-param */
|
|
3625
3894
|
|
|
@@ -3691,7 +3960,7 @@ let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
|
3691
3960
|
*
|
|
3692
3961
|
* @attr { Boolean } large - If declared, make font-size to 1rem(16px).
|
|
3693
3962
|
*/
|
|
3694
|
-
class AuroHelpText extends LitElement {
|
|
3963
|
+
let AuroHelpText$1 = class AuroHelpText extends LitElement {
|
|
3695
3964
|
|
|
3696
3965
|
constructor() {
|
|
3697
3966
|
super();
|
|
@@ -3700,14 +3969,14 @@ class AuroHelpText extends LitElement {
|
|
|
3700
3969
|
this.onDark = false;
|
|
3701
3970
|
this.hasTextContent = false;
|
|
3702
3971
|
|
|
3703
|
-
AuroLibraryRuntimeUtils$
|
|
3972
|
+
AuroLibraryRuntimeUtils$5.prototype.handleComponentTagRename(this, 'auro-helptext');
|
|
3704
3973
|
}
|
|
3705
3974
|
|
|
3706
3975
|
static get styles() {
|
|
3707
3976
|
return [
|
|
3708
|
-
colorCss$
|
|
3709
|
-
styleCss$
|
|
3710
|
-
tokensCss$
|
|
3977
|
+
colorCss$5,
|
|
3978
|
+
styleCss$6,
|
|
3979
|
+
tokensCss$4
|
|
3711
3980
|
];
|
|
3712
3981
|
}
|
|
3713
3982
|
|
|
@@ -3756,7 +4025,7 @@ class AuroHelpText extends LitElement {
|
|
|
3756
4025
|
*
|
|
3757
4026
|
*/
|
|
3758
4027
|
static register(name = "auro-helptext") {
|
|
3759
|
-
AuroLibraryRuntimeUtils$
|
|
4028
|
+
AuroLibraryRuntimeUtils$5.prototype.registerComponent(name, AuroHelpText);
|
|
3760
4029
|
}
|
|
3761
4030
|
|
|
3762
4031
|
updated() {
|
|
@@ -3810,9 +4079,9 @@ class AuroHelpText extends LitElement {
|
|
|
3810
4079
|
</div>
|
|
3811
4080
|
`;
|
|
3812
4081
|
}
|
|
3813
|
-
}
|
|
4082
|
+
};
|
|
3814
4083
|
|
|
3815
|
-
var helpTextVersion = '1.0.0';
|
|
4084
|
+
var helpTextVersion$1 = '1.0.0';
|
|
3816
4085
|
|
|
3817
4086
|
let AuroElement$2 = class AuroElement extends LitElement {
|
|
3818
4087
|
static get properties() {
|
|
@@ -3849,18 +4118,21 @@ let AuroElement$2 = class AuroElement extends LitElement {
|
|
|
3849
4118
|
}
|
|
3850
4119
|
|
|
3851
4120
|
resetShapeClasses() {
|
|
3852
|
-
|
|
3853
|
-
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
4121
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
3854
4122
|
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
4123
|
+
if (wrapper) {
|
|
4124
|
+
wrapper.classList.forEach((className) => {
|
|
4125
|
+
if (className.startsWith('shape-')) {
|
|
4126
|
+
wrapper.classList.remove(className);
|
|
4127
|
+
}
|
|
4128
|
+
});
|
|
3861
4129
|
|
|
3862
|
-
|
|
3863
|
-
|
|
4130
|
+
}
|
|
4131
|
+
|
|
4132
|
+
if (this.shape && this.size) {
|
|
4133
|
+
wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
4134
|
+
} else {
|
|
4135
|
+
wrapper.classList.add('shape-none');
|
|
3864
4136
|
}
|
|
3865
4137
|
}
|
|
3866
4138
|
|
|
@@ -3932,20 +4204,16 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
3932
4204
|
this.matchWidth = false;
|
|
3933
4205
|
this.noHideOnThisFocusLoss = false;
|
|
3934
4206
|
|
|
3935
|
-
this.errorMessage = ''; // TODO
|
|
4207
|
+
this.errorMessage = ''; // TODO - check with Doug if there is still more to do here
|
|
3936
4208
|
|
|
3937
4209
|
// Layout Config
|
|
3938
4210
|
this.layout = 'classic';
|
|
3939
|
-
this.shape = '
|
|
4211
|
+
this.shape = 'classic';
|
|
3940
4212
|
this.size = 'xl';
|
|
3941
4213
|
|
|
3942
|
-
this.
|
|
3943
|
-
}
|
|
4214
|
+
this.parentBorder = false;
|
|
3944
4215
|
|
|
3945
|
-
|
|
3946
|
-
return {
|
|
3947
|
-
// 'withValue': this.value && this.value.length > 0
|
|
3948
|
-
};
|
|
4216
|
+
this.privateDefaults();
|
|
3949
4217
|
}
|
|
3950
4218
|
|
|
3951
4219
|
get commonWrapperClasses() {
|
|
@@ -3953,7 +4221,8 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
3953
4221
|
'trigger': true,
|
|
3954
4222
|
'wrapper': true,
|
|
3955
4223
|
'hasFocus': this.hasFocus,
|
|
3956
|
-
'simple': this.simple
|
|
4224
|
+
'simple': this.simple,
|
|
4225
|
+
'parentBorder': this.parentBorder
|
|
3957
4226
|
};
|
|
3958
4227
|
}
|
|
3959
4228
|
|
|
@@ -4005,7 +4274,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4005
4274
|
/**
|
|
4006
4275
|
* @private
|
|
4007
4276
|
*/
|
|
4008
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
4277
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2$1();
|
|
4009
4278
|
|
|
4010
4279
|
/**
|
|
4011
4280
|
* @private
|
|
@@ -4030,7 +4299,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4030
4299
|
/**
|
|
4031
4300
|
* @private
|
|
4032
4301
|
*/
|
|
4033
|
-
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion, AuroHelpText);
|
|
4302
|
+
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion$1, AuroHelpText$1);
|
|
4034
4303
|
|
|
4035
4304
|
/**
|
|
4036
4305
|
* @private
|
|
@@ -4220,6 +4489,15 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4220
4489
|
reflect: true
|
|
4221
4490
|
},
|
|
4222
4491
|
|
|
4492
|
+
/**
|
|
4493
|
+
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
4494
|
+
* @private
|
|
4495
|
+
*/
|
|
4496
|
+
parentBorder: {
|
|
4497
|
+
type: Boolean,
|
|
4498
|
+
reflect: true
|
|
4499
|
+
},
|
|
4500
|
+
|
|
4223
4501
|
/**
|
|
4224
4502
|
* If declared, the popover and trigger will be set to the same width.
|
|
4225
4503
|
*/
|
|
@@ -4322,7 +4600,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4322
4600
|
static get styles() {
|
|
4323
4601
|
return [
|
|
4324
4602
|
colorCss$1$1,
|
|
4325
|
-
tokensCss$1,
|
|
4603
|
+
tokensCss$1$1,
|
|
4326
4604
|
|
|
4327
4605
|
// default layout
|
|
4328
4606
|
classicColorCss,
|
|
@@ -4347,7 +4625,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4347
4625
|
*
|
|
4348
4626
|
*/
|
|
4349
4627
|
static register(name = "auro-dropdown") {
|
|
4350
|
-
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroDropdown);
|
|
4628
|
+
AuroLibraryRuntimeUtils$2$1.prototype.registerComponent(name, AuroDropdown);
|
|
4351
4629
|
}
|
|
4352
4630
|
|
|
4353
4631
|
/**
|
|
@@ -4610,14 +4888,13 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4610
4888
|
* @returns {void}
|
|
4611
4889
|
*/
|
|
4612
4890
|
handleTriggerContentSlotChange(event) {
|
|
4613
|
-
|
|
4614
4891
|
this.floater.handleTriggerTabIndex();
|
|
4615
4892
|
|
|
4616
4893
|
// Get the trigger
|
|
4617
4894
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
4618
4895
|
|
|
4619
4896
|
// Get the trigger slot
|
|
4620
|
-
const triggerSlot = this.shadowRoot.querySelector('.
|
|
4897
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContentWrapper slot');
|
|
4621
4898
|
|
|
4622
4899
|
// If there's a trigger slot
|
|
4623
4900
|
if (triggerSlot) {
|
|
@@ -4680,11 +4957,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4680
4957
|
*
|
|
4681
4958
|
* @private
|
|
4682
4959
|
* @method handleDefaultSlot
|
|
4683
|
-
* @param {Event} event - The event object representing the slot change.
|
|
4684
4960
|
* @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
|
|
4685
4961
|
*/
|
|
4686
|
-
handleDefaultSlot(
|
|
4687
|
-
[...event.target.assignedNodes()].forEach((node) => this.bibContent.append(node));
|
|
4962
|
+
handleDefaultSlot() {
|
|
4688
4963
|
|
|
4689
4964
|
if (this.onSlotChange) {
|
|
4690
4965
|
this.onSlotChange();
|
|
@@ -4692,33 +4967,10 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4692
4967
|
}
|
|
4693
4968
|
|
|
4694
4969
|
/**
|
|
4970
|
+
* Returns HTML for the common portion of the layouts.
|
|
4695
4971
|
* @private
|
|
4696
|
-
* @
|
|
4697
|
-
* @
|
|
4698
|
-
* @description Handles the slot change event for the label slot.
|
|
4699
|
-
*/
|
|
4700
|
-
handleLabelSlotChange (event) {
|
|
4701
|
-
|
|
4702
|
-
// Get the nodes from the event
|
|
4703
|
-
const nodes = event.target.assignedNodes();
|
|
4704
|
-
|
|
4705
|
-
// Guard clause for no nodes
|
|
4706
|
-
if (!nodes) {
|
|
4707
|
-
return;
|
|
4708
|
-
}
|
|
4709
|
-
|
|
4710
|
-
// Convert the nodes to a measurable array so we can get the length
|
|
4711
|
-
const nodesArr = Array.from(nodes);
|
|
4712
|
-
|
|
4713
|
-
// If the nodes array has a length, the dropdown is labeled
|
|
4714
|
-
this.labeled = nodesArr.length > 0;
|
|
4715
|
-
}
|
|
4716
|
-
|
|
4717
|
-
/**
|
|
4718
|
-
* Returns HTML for the common portion of the layouts.
|
|
4719
|
-
* @private
|
|
4720
|
-
* @param {Object} helpTextClasses - Classes to apply to the help text container.
|
|
4721
|
-
* @returns {html} - Returns HTML.
|
|
4972
|
+
* @param {Object} helpTextClasses - Classes to apply to the help text container.
|
|
4973
|
+
* @returns {html} - Returns HTML.
|
|
4722
4974
|
*/
|
|
4723
4975
|
renderBasicHtml(helpTextClasses) {
|
|
4724
4976
|
return html`
|
|
@@ -4728,24 +4980,20 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4728
4980
|
class="${classMap(this.commonWrapperClasses)}" part="wrapper"
|
|
4729
4981
|
tabindex="${this.tabIndex}"
|
|
4730
4982
|
role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
4731
|
-
aria-expanded="${ifDefined(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4732
|
-
aria-controls="${ifDefined(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4983
|
+
aria-expanded="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4984
|
+
aria-controls="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4733
4985
|
aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
4734
4986
|
@focusin="${this.handleFocusin}"
|
|
4735
4987
|
@blur="${this.handleFocusOut}">
|
|
4736
|
-
<div class="triggerContentWrapper">
|
|
4737
|
-
<
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
<div class="triggerContent">
|
|
4741
|
-
<slot
|
|
4742
|
-
name="trigger"
|
|
4743
|
-
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4744
|
-
</div>
|
|
4988
|
+
<div class="triggerContentWrapper" id="triggerLabel">
|
|
4989
|
+
<slot
|
|
4990
|
+
name="trigger"
|
|
4991
|
+
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4745
4992
|
</div>
|
|
4746
|
-
${this.chevron
|
|
4993
|
+
${this.chevron ? html`
|
|
4747
4994
|
<div
|
|
4748
4995
|
id="showStateIcon"
|
|
4996
|
+
class="chevron"
|
|
4749
4997
|
part="chevron">
|
|
4750
4998
|
<${this.iconTag}
|
|
4751
4999
|
category="interface"
|
|
@@ -4760,17 +5008,18 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4760
5008
|
<div class="${classMap(helpTextClasses)}">
|
|
4761
5009
|
<slot name="helpText"></slot>
|
|
4762
5010
|
</div>
|
|
4763
|
-
<div class="slotContent">
|
|
4764
|
-
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4765
|
-
</div>
|
|
4766
5011
|
<div id="bibSizer" part="size"></div>
|
|
4767
5012
|
<${this.dropdownBibTag}
|
|
4768
5013
|
id="bib"
|
|
5014
|
+
shape="${this.shape}"
|
|
4769
5015
|
?data-show="${this.isPopoverVisible}"
|
|
4770
5016
|
?isfullscreen="${this.isBibFullscreen}"
|
|
4771
5017
|
?common="${this.common}"
|
|
4772
5018
|
?rounded="${this.common || this.rounded}"
|
|
4773
5019
|
?inset="${this.common || this.inset}">
|
|
5020
|
+
<div class="slotContent">
|
|
5021
|
+
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5022
|
+
</div>
|
|
4774
5023
|
</${this.dropdownBibTag}>
|
|
4775
5024
|
</div>
|
|
4776
5025
|
`;
|
|
@@ -4782,67 +5031,14 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4782
5031
|
* @returns {html} - Returns HTML for the classic layout.
|
|
4783
5032
|
*/
|
|
4784
5033
|
renderLayoutClassic() {
|
|
5034
|
+
// TODO: check with Doug why this was never used?
|
|
4785
5035
|
const helpTextClasses = {
|
|
4786
|
-
'helpText': true
|
|
4787
|
-
'leftIndent': false,
|
|
4788
|
-
'rightIndent': false
|
|
5036
|
+
'helpText': true
|
|
4789
5037
|
};
|
|
4790
5038
|
|
|
4791
5039
|
return html`
|
|
4792
5040
|
${this.renderBasicHtml(helpTextClasses)}
|
|
4793
5041
|
`;
|
|
4794
|
-
// return html`
|
|
4795
|
-
// <div>
|
|
4796
|
-
// <div
|
|
4797
|
-
// id="trigger"
|
|
4798
|
-
// class="trigger"
|
|
4799
|
-
// part="trigger"
|
|
4800
|
-
// tabindex="${this.tabIndex}"
|
|
4801
|
-
// ?showBorder="${this.showTriggerBorders}"
|
|
4802
|
-
// role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
4803
|
-
// aria-expanded="${ifDefined(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4804
|
-
// aria-controls="${ifDefined(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4805
|
-
// aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
4806
|
-
// >
|
|
4807
|
-
// <div class="triggerContentWrapper">
|
|
4808
|
-
// <label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
4809
|
-
// <slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
4810
|
-
// </label>
|
|
4811
|
-
// <div class="triggerContent">
|
|
4812
|
-
// <slot
|
|
4813
|
-
// name="trigger"
|
|
4814
|
-
// @slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4815
|
-
// </div>
|
|
4816
|
-
// </div>
|
|
4817
|
-
// ${this.chevron || this.common ? html`
|
|
4818
|
-
// <div
|
|
4819
|
-
// id="showStateIcon"
|
|
4820
|
-
// part="chevron">
|
|
4821
|
-
// <${this.iconTag}
|
|
4822
|
-
// category="interface"
|
|
4823
|
-
// name="chevron-down"
|
|
4824
|
-
// ?onDark="${this.onDark}"
|
|
4825
|
-
// variant="${this.disabled ? 'disabled' : 'muted'}">
|
|
4826
|
-
// >
|
|
4827
|
-
// </${this.iconTag}>
|
|
4828
|
-
// </div>
|
|
4829
|
-
// ` : undefined }
|
|
4830
|
-
// </div>
|
|
4831
|
-
// <div class="slotContent">
|
|
4832
|
-
// <slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4833
|
-
// </div>
|
|
4834
|
-
// <div id="bibSizer" part="size"></div>
|
|
4835
|
-
// <${this.dropdownBibTag}
|
|
4836
|
-
// id="bib"
|
|
4837
|
-
// ?data-show="${this.isPopoverVisible}"
|
|
4838
|
-
// ?isfullscreen="${this.isBibFullscreen}"
|
|
4839
|
-
// ?common="${this.common}"
|
|
4840
|
-
// ?rounded="${this.common || this.rounded}"
|
|
4841
|
-
// ?inset="${this.common || this.inset}"
|
|
4842
|
-
// >
|
|
4843
|
-
// </${this.dropdownBibTag}>
|
|
4844
|
-
// </div>
|
|
4845
|
-
// `;
|
|
4846
5042
|
}
|
|
4847
5043
|
|
|
4848
5044
|
/**
|
|
@@ -4909,9 +5105,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4909
5105
|
|
|
4910
5106
|
var dropdownVersion = '3.0.0';
|
|
4911
5107
|
|
|
4912
|
-
var colorCss$
|
|
5108
|
+
var colorCss$3 = css`#headerContainer{box-shadow:var(--ds-auro-dropdownbib-header-boxshadow-color)}#footerContainer{background-color:var(--ds-auro-dropdownbib-footer-container-color)}`;
|
|
4913
5109
|
|
|
4914
|
-
var styleCss$
|
|
5110
|
+
var styleCss$4 = css`#bibTemplate{display:flex;overflow:hidden;height:100%;max-height:100%;flex-direction:column}#headerContainer{display:flex;flex-direction:column}#header{display:flex;width:100%;min-height:var(--ds-size-1000, 5rem);box-sizing:border-box;align-items:end;padding-top:var(--ds-size-400, 2rem);padding-right:var(--ds-size-700, 3.5rem);padding-left:var(--ds-size-200, 1rem);pointer-events:none}#subheader{width:100%}#subheader ::slotted([auro-input]){box-sizing:border-box;padding:0 var(--ds-size-200, 1rem)}#closeButton{position:absolute;top:var(--ds-size-400, 2rem);right:var(--ds-size-200, 1rem);border:none;background-color:transparent;cursor:pointer}#bodyContainer{position:relative;overflow:auto;flex:1 1 100%}:host([isfullscreen]) #bibTemplate{max-height:100dvh}:host([isfullscreen]) #bodyContainer{margin-top:var(--ds-size-100, 0.5rem)}#footerContainer{position:absolute;right:0;bottom:0;left:0;padding:var(--ds-size-200, 1rem)}`;
|
|
4915
5111
|
|
|
4916
5112
|
var tokenCss = css`:host{--ds-auro-dropdownbib-header-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-footer-container-color: var(--ds-basic-color-surface-default, #ffffff)}`;
|
|
4917
5113
|
|
|
@@ -4922,7 +5118,7 @@ var tokenCss = css`:host{--ds-auro-dropdownbib-header-boxshadow-color: var(--ds-
|
|
|
4922
5118
|
|
|
4923
5119
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
4924
5120
|
|
|
4925
|
-
class AuroLibraryRuntimeUtils {
|
|
5121
|
+
let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
|
|
4926
5122
|
|
|
4927
5123
|
/* eslint-disable jsdoc/require-param */
|
|
4928
5124
|
|
|
@@ -4983,7 +5179,7 @@ class AuroLibraryRuntimeUtils {
|
|
|
4983
5179
|
|
|
4984
5180
|
return elemTag === tag || elem.hasAttribute(tag);
|
|
4985
5181
|
}
|
|
4986
|
-
}
|
|
5182
|
+
};
|
|
4987
5183
|
|
|
4988
5184
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
4989
5185
|
// See LICENSE in the project root for license information.
|
|
@@ -5025,239 +5221,1353 @@ class AuroDependencyVersioning {
|
|
|
5025
5221
|
}
|
|
5026
5222
|
}
|
|
5027
5223
|
|
|
5028
|
-
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5029
|
-
// See LICENSE in the project root for license information.
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
5224
|
/**
|
|
5033
|
-
*
|
|
5034
|
-
* @attr {Boolean} hiddenVisually - If present, the component will be hidden visually, but still read by screen readers
|
|
5035
|
-
* @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
|
|
5225
|
+
* Private module-level WeakMap to hold MutationObservers for each host element.
|
|
5036
5226
|
*/
|
|
5227
|
+
const _observers = new WeakMap();
|
|
5037
5228
|
|
|
5038
|
-
|
|
5229
|
+
/**
|
|
5230
|
+
* Private module-level WeakMap to hold attribute matchers and targets for each host element.
|
|
5231
|
+
* Structure: {
|
|
5232
|
+
* host: {
|
|
5233
|
+
* matchers: Set<Function>,
|
|
5234
|
+
* targets: Map<HTMLElement, Map<Function, {removeOriginal: boolean, currentAttributes: Map<string, string>}>>
|
|
5235
|
+
* }
|
|
5236
|
+
* }
|
|
5237
|
+
*/
|
|
5238
|
+
const _transportConfig = new WeakMap();
|
|
5039
5239
|
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5240
|
+
/**
|
|
5241
|
+
* Transfers all matching attributes from a host element to a target element and observes for future changes.
|
|
5242
|
+
*
|
|
5243
|
+
* @param {Object} params - The parameters for the function.
|
|
5244
|
+
* @param {HTMLElement} params.host - The host element from which attributes will be transported.
|
|
5245
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
5246
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove the attributes from the host element.
|
|
5247
|
+
* @param {boolean} [params.observe=true] - Whether to attach a MutationObserver to the host element.
|
|
5248
|
+
* @returns {Function} A function to detach the observer when no longer needed.
|
|
5249
|
+
* @throws {TypeError} If the host or target parameters are not instances of HTMLElement.
|
|
5250
|
+
*/
|
|
5251
|
+
const transportAttributes = ({ host, target, match, removeOriginal = true }) => {
|
|
5252
|
+
// Guard Clause: Ensure host is valid HTMLElement instance
|
|
5253
|
+
if (typeof host !== 'object' || !(host instanceof HTMLElement)) {
|
|
5254
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "host" parameter must be an instance of HTMLElement.');
|
|
5050
5255
|
}
|
|
5051
5256
|
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
hideAudible(value) {
|
|
5056
|
-
if (value) {
|
|
5057
|
-
return 'true'
|
|
5058
|
-
}
|
|
5059
|
-
|
|
5060
|
-
return 'false'
|
|
5257
|
+
// Guard Clause: Ensure target is valid HTMLElement instance
|
|
5258
|
+
if (typeof target !== 'object' || !(target instanceof HTMLElement)) {
|
|
5259
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "target" parameter must be an instance of HTMLElement.');
|
|
5061
5260
|
}
|
|
5062
|
-
}
|
|
5063
|
-
|
|
5064
|
-
var error = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"error__desc\" class=\"ico_squareLarge\" data-deprecated=\"true\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><desc id=\"error__desc\">Error alert indicator.</desc><path d=\"m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583\"/></svg>"};
|
|
5065
5261
|
|
|
5066
|
-
|
|
5262
|
+
// Guard Clause: Ensure match is a function
|
|
5263
|
+
if (typeof match !== 'function') {
|
|
5264
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "match" parameter must be a function.');
|
|
5265
|
+
}
|
|
5067
5266
|
|
|
5068
|
-
|
|
5267
|
+
// Guard Clause: Ensure removeOriginal is a boolean
|
|
5268
|
+
if (typeof removeOriginal !== 'boolean') {
|
|
5269
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "removeOriginal" parameter must be a boolean.');
|
|
5270
|
+
}
|
|
5271
|
+
|
|
5272
|
+
// Register this transport and get cleanup function
|
|
5273
|
+
return _registerTransport({
|
|
5274
|
+
host,
|
|
5275
|
+
target,
|
|
5276
|
+
matcher: match,
|
|
5277
|
+
removeOriginal
|
|
5278
|
+
});
|
|
5279
|
+
};
|
|
5069
5280
|
|
|
5070
5281
|
/**
|
|
5071
|
-
*
|
|
5072
|
-
*
|
|
5073
|
-
* @
|
|
5074
|
-
* @param {
|
|
5075
|
-
* @
|
|
5282
|
+
* Registers a matcher and target for a host element and attaches an observer if needed.
|
|
5283
|
+
*
|
|
5284
|
+
* @param {Object} params - The parameters object.
|
|
5285
|
+
* @param {HTMLElement} params.host - The host element to observe.
|
|
5286
|
+
* @param {HTMLElement} params.target - The target element to receive attributes.
|
|
5287
|
+
* @param {Function} params.matcher - Function that determines which attributes to transport.
|
|
5288
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes.
|
|
5289
|
+
* @param {boolean} [params.observe=true] - Whether to observe for attribute changes.
|
|
5290
|
+
* @returns {Function} Function to detach the specific matcher and target pairing.
|
|
5291
|
+
* @private
|
|
5076
5292
|
*/
|
|
5293
|
+
const _registerTransport = ({ host, target, matcher, removeOriginal = true }) => {
|
|
5294
|
+
// Initialize config for this host if it doesn't exist
|
|
5295
|
+
if (!_transportConfig.has(host)) {
|
|
5296
|
+
_transportConfig.set(host, {
|
|
5297
|
+
matchers: new Set(),
|
|
5298
|
+
targets: new Map()
|
|
5299
|
+
});
|
|
5300
|
+
}
|
|
5077
5301
|
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5302
|
+
const config = _transportConfig.get(host);
|
|
5303
|
+
|
|
5304
|
+
// Add the matcher to the set of matchers for this host
|
|
5305
|
+
config.matchers.add(matcher);
|
|
5306
|
+
|
|
5307
|
+
// Initialize target entry if it doesn't exist
|
|
5308
|
+
if (!config.targets.has(target)) {
|
|
5309
|
+
config.targets.set(target, new Map());
|
|
5310
|
+
}
|
|
5311
|
+
|
|
5312
|
+
// Store the matcher with its removeOriginal setting for this target
|
|
5313
|
+
config.targets.get(target).set(matcher, {
|
|
5314
|
+
removeOriginal,
|
|
5315
|
+
currentAttributes: new Map()
|
|
5316
|
+
});
|
|
5317
|
+
|
|
5318
|
+
// Perform initial attribute transport
|
|
5319
|
+
_transportAttributes({ host, target, matcher, removeOriginal });
|
|
5320
|
+
|
|
5321
|
+
// Attach observer
|
|
5322
|
+
_attachObserver(host);
|
|
5323
|
+
|
|
5324
|
+
// Return cleanup function and utility functions
|
|
5325
|
+
return {
|
|
5326
|
+
cleanup: () => _cleanupTransport(host, target, matcher),
|
|
5327
|
+
getObservedAttributes: () => _getObservedAttributes(host, target, matcher),
|
|
5328
|
+
getObservedAttribute: (attr) => _getObservedAttribute(host, target, matcher, attr),
|
|
5090
5329
|
}
|
|
5091
|
-
return _fetchMap.get(uri);
|
|
5092
5330
|
};
|
|
5093
5331
|
|
|
5094
|
-
var styleCss$1 = css`: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}`;
|
|
5095
|
-
|
|
5096
|
-
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5097
|
-
// See LICENSE in the project root for license information.
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
5101
5332
|
/**
|
|
5102
|
-
*
|
|
5333
|
+
* Cleans up resources associated with a specific matcher and target for a host element.
|
|
5334
|
+
*
|
|
5335
|
+
* @param {HTMLElement} host - The host element
|
|
5336
|
+
* @param {HTMLElement} target - The target element
|
|
5337
|
+
* @param {Function} matcher - The matcher function
|
|
5338
|
+
* @private
|
|
5103
5339
|
*/
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5340
|
+
const _cleanupTransport = (host, target, matcher) => {
|
|
5341
|
+
const config = _transportConfig.get(host);
|
|
5342
|
+
if (!config) return;
|
|
5343
|
+
|
|
5344
|
+
// Remove this matcher from this target
|
|
5345
|
+
const targetMatchers = config.targets.get(target);
|
|
5346
|
+
if (targetMatchers) {
|
|
5347
|
+
targetMatchers.delete(matcher);
|
|
5348
|
+
|
|
5349
|
+
// If this target has no more matchers, remove it
|
|
5350
|
+
if (targetMatchers.size === 0) {
|
|
5351
|
+
config.targets.delete(target);
|
|
5352
|
+
}
|
|
5353
|
+
}
|
|
5354
|
+
|
|
5355
|
+
// Check if this matcher is still used by any target
|
|
5356
|
+
let matcherStillUsed = false;
|
|
5357
|
+
for (const matcherMap of config.targets.values()) {
|
|
5358
|
+
if (matcherMap.has(matcher)) {
|
|
5359
|
+
matcherStillUsed = true;
|
|
5360
|
+
break;
|
|
5361
|
+
}
|
|
5110
5362
|
}
|
|
5111
|
-
|
|
5112
|
-
//
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
...super.properties,
|
|
5116
|
-
|
|
5117
|
-
/**
|
|
5118
|
-
* Set value for on-dark version of auro-icon.
|
|
5119
|
-
*/
|
|
5120
|
-
onDark: {
|
|
5121
|
-
type: Boolean,
|
|
5122
|
-
reflect: true
|
|
5123
|
-
},
|
|
5124
|
-
|
|
5125
|
-
/**
|
|
5126
|
-
* @private
|
|
5127
|
-
*/
|
|
5128
|
-
svg: {
|
|
5129
|
-
attribute: false,
|
|
5130
|
-
reflect: true
|
|
5131
|
-
}
|
|
5132
|
-
};
|
|
5363
|
+
|
|
5364
|
+
// If not used anymore, remove from matchers set
|
|
5365
|
+
if (!matcherStillUsed) {
|
|
5366
|
+
config.matchers.delete(matcher);
|
|
5133
5367
|
}
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
`;
|
|
5368
|
+
|
|
5369
|
+
// If no more targets or matchers, detach observer
|
|
5370
|
+
if (config.targets.size === 0 || config.matchers.size === 0) {
|
|
5371
|
+
_detachObserver(host);
|
|
5139
5372
|
}
|
|
5373
|
+
};
|
|
5140
5374
|
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5375
|
+
/**
|
|
5376
|
+
* Generic function to transport attributes from a host element to a target element.
|
|
5377
|
+
*
|
|
5378
|
+
* @param {Object} params - The parameters object.
|
|
5379
|
+
* @param {HTMLElement} params.host - The host element from which to transport attributes.
|
|
5380
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
5381
|
+
* @param {Function} params.matcher - Function that takes an attribute name and returns true if it should be transported.
|
|
5382
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes from host.
|
|
5383
|
+
* @returns {void}
|
|
5384
|
+
* @private
|
|
5385
|
+
*/
|
|
5386
|
+
const _transportAttributes = ({ host, target, matcher, removeOriginal = true }) => {
|
|
5387
|
+
// Get a list of all matching attributes on the host element and their values
|
|
5388
|
+
const matchingAttributes = host.getAttributeNames()
|
|
5389
|
+
.filter(attr => matcher(attr))
|
|
5390
|
+
.reduce((acc, attr) => {
|
|
5391
|
+
acc[attr] = host.getAttribute(attr);
|
|
5392
|
+
return acc;
|
|
5393
|
+
}, {});
|
|
5394
|
+
|
|
5395
|
+
// Move matching attributes to the target element, removing them from the host if removeOriginal is true
|
|
5396
|
+
Object.entries(matchingAttributes).forEach(([key, value]) => {
|
|
5397
|
+
_setObservedAttribute(host, target, matcher, key, value);
|
|
5398
|
+
target.setAttribute(key, value);
|
|
5399
|
+
if (removeOriginal) {
|
|
5400
|
+
host.removeAttribute(key);
|
|
5155
5401
|
}
|
|
5402
|
+
});
|
|
5403
|
+
};
|
|
5156
5404
|
|
|
5157
|
-
|
|
5405
|
+
/**
|
|
5406
|
+
* Attaches a MutationObserver to the host element to monitor attribute changes.
|
|
5407
|
+
*
|
|
5408
|
+
* @param {HTMLElement} host - The element to observe for attribute changes.
|
|
5409
|
+
* @returns {MutationObserver} The observer instance.
|
|
5410
|
+
* @private
|
|
5411
|
+
*/
|
|
5412
|
+
const _attachObserver = (host) => {
|
|
5413
|
+
// If an observer for this host already exists, return it
|
|
5414
|
+
if (_observers.has(host)) {
|
|
5415
|
+
return _observers.get(host);
|
|
5416
|
+
}
|
|
5417
|
+
|
|
5418
|
+
// Create a new MutationObserver
|
|
5419
|
+
const observer = new MutationObserver((mutations) => {
|
|
5420
|
+
const config = _transportConfig.get(host);
|
|
5421
|
+
if (!config) return;
|
|
5422
|
+
|
|
5423
|
+
// For each mutation affecting attributes
|
|
5424
|
+
mutations
|
|
5425
|
+
.filter(mutation => mutation.type === 'attributes')
|
|
5426
|
+
.forEach(mutation => {
|
|
5427
|
+
const attributeName = mutation.attributeName;
|
|
5428
|
+
|
|
5429
|
+
// Find matchers that care about this attribute
|
|
5430
|
+
for (const matcher of config.matchers) {
|
|
5431
|
+
if (matcher(attributeName)) {
|
|
5432
|
+
// For each target that uses this matcher
|
|
5433
|
+
for (const [target, matcherConfigs] of config.targets.entries()) {
|
|
5434
|
+
if (matcherConfigs.has(matcher)) {
|
|
5435
|
+
const { removeOriginal } = matcherConfigs.get(matcher);
|
|
5436
|
+
_transportAttributes({
|
|
5437
|
+
host,
|
|
5438
|
+
target,
|
|
5439
|
+
matcher,
|
|
5440
|
+
removeOriginal
|
|
5441
|
+
});
|
|
5442
|
+
}
|
|
5443
|
+
}
|
|
5444
|
+
}
|
|
5445
|
+
}
|
|
5446
|
+
});
|
|
5447
|
+
});
|
|
5158
5448
|
|
|
5159
|
-
|
|
5160
|
-
}
|
|
5449
|
+
// Start observing attribute changes
|
|
5450
|
+
observer.observe(host, { attributes: true });
|
|
5451
|
+
|
|
5452
|
+
// Store the observer
|
|
5453
|
+
_observers.set(host, observer);
|
|
5454
|
+
|
|
5455
|
+
return observer;
|
|
5456
|
+
};
|
|
5161
5457
|
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5458
|
+
/**
|
|
5459
|
+
* Detaches and cleans up the MutationObserver for a given host element.
|
|
5460
|
+
*
|
|
5461
|
+
* @param {HTMLElement} host - The element whose observer should be detached.
|
|
5462
|
+
* @private
|
|
5463
|
+
*/
|
|
5464
|
+
const _detachObserver = (host) => {
|
|
5465
|
+
if (_observers.has(host)) {
|
|
5466
|
+
const observer = _observers.get(host);
|
|
5467
|
+
observer.disconnect();
|
|
5468
|
+
_observers.delete(host);
|
|
5469
|
+
}
|
|
5470
|
+
|
|
5471
|
+
// Clean up the transport config as well
|
|
5472
|
+
if (_transportConfig.has(host)) {
|
|
5473
|
+
_transportConfig.delete(host);
|
|
5474
|
+
}
|
|
5475
|
+
};
|
|
5166
5476
|
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5477
|
+
/**
|
|
5478
|
+
* Gets the matcher configuration for a specific host, target, and matcher
|
|
5479
|
+
* @param {HTMLElement} host - The host element
|
|
5480
|
+
* @param {HTMLElement} target - The target element
|
|
5481
|
+
* @param {Function} matcher - The matcher function
|
|
5482
|
+
* @returns {Object|undefined} The matcher configuration if found
|
|
5483
|
+
* @private
|
|
5484
|
+
*/
|
|
5485
|
+
const _getMatcherConfig = (host, target, matcher) => {
|
|
5486
|
+
const config = _transportConfig.get(host);
|
|
5487
|
+
if (!config) return undefined;
|
|
5488
|
+
|
|
5489
|
+
const targetMatchers = config.targets.get(target);
|
|
5490
|
+
if (!targetMatchers) return undefined;
|
|
5491
|
+
|
|
5492
|
+
return targetMatchers.get(matcher);
|
|
5493
|
+
};
|
|
5171
5494
|
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5495
|
+
/**
|
|
5496
|
+
* Sets an observed attribute value
|
|
5497
|
+
* @param {HTMLElement} host - The host element
|
|
5498
|
+
* @param {HTMLElement} target - The target element
|
|
5499
|
+
* @param {Function} matcher - The matcher function
|
|
5500
|
+
* @param {string} key - The attribute name
|
|
5501
|
+
* @param {string} value - The attribute value
|
|
5502
|
+
* @private
|
|
5503
|
+
*/
|
|
5504
|
+
const _setObservedAttribute = (host, target, matcher, key, value) => {
|
|
5505
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5506
|
+
if (matcherConfig) {
|
|
5507
|
+
matcherConfig.currentAttributes.set(key, value);
|
|
5175
5508
|
}
|
|
5176
|
-
}
|
|
5177
|
-
|
|
5178
|
-
var tokensCss = css`: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)}`;
|
|
5509
|
+
};
|
|
5179
5510
|
|
|
5180
|
-
|
|
5511
|
+
const _getObservedAttribute = (host, target, matcher, attr) => {
|
|
5512
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5513
|
+
if (matcherConfig) return matcherConfig.currentAttributes.get(attr);
|
|
5514
|
+
return undefined;
|
|
5515
|
+
};
|
|
5181
5516
|
|
|
5182
|
-
|
|
5183
|
-
|
|
5517
|
+
const _getObservedAttributes = (host, target, matcher) => {
|
|
5518
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5519
|
+
if (matcherConfig) return Array.from(matcherConfig.currentAttributes.entries());
|
|
5520
|
+
return [];
|
|
5521
|
+
};
|
|
5184
5522
|
|
|
5523
|
+
const _matchers = {
|
|
5524
|
+
'aria-': attr => attr.startsWith('aria-'),
|
|
5525
|
+
'role': attr => attr.match(/^role$/)
|
|
5526
|
+
};
|
|
5185
5527
|
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5528
|
+
const transportAllA11yAttributes = ({ host, target, removeOriginal = true }) => {
|
|
5529
|
+
return transportAttributes({
|
|
5530
|
+
host,
|
|
5531
|
+
target,
|
|
5532
|
+
match: attr => {
|
|
5533
|
+
for (const key in _matchers) {
|
|
5534
|
+
if (_matchers[key](attr)) return true;
|
|
5535
|
+
}
|
|
5536
|
+
return false;
|
|
5537
|
+
},
|
|
5538
|
+
removeOriginal
|
|
5539
|
+
});
|
|
5540
|
+
};
|
|
5189
5541
|
|
|
5190
|
-
|
|
5191
|
-
this.privateDefaults();
|
|
5192
|
-
}
|
|
5542
|
+
let AuroElement$1 = class AuroElement extends LitElement {
|
|
5193
5543
|
|
|
5194
5544
|
/**
|
|
5195
|
-
*
|
|
5545
|
+
* @type {Object} return object from transportAttributes via a11yUtilities
|
|
5546
|
+
* @property {Function} cleanup - Function to clean up the attribute watcher.
|
|
5547
|
+
* @property {Function} getCurrentAttributes - Function to get the current attributes being watched and their values.
|
|
5548
|
+
* @property {Function} getObservedAttribute - Function to get the value of a specific observed attribute by name.
|
|
5196
5549
|
* @private
|
|
5197
|
-
* @returns {void}
|
|
5198
5550
|
*/
|
|
5199
|
-
|
|
5200
|
-
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
5201
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
5202
|
-
}
|
|
5551
|
+
attributeWatcher;
|
|
5203
5552
|
|
|
5204
|
-
// function to define props used within the scope of this component
|
|
5205
5553
|
static get properties() {
|
|
5206
5554
|
return {
|
|
5207
|
-
...super.properties,
|
|
5208
5555
|
|
|
5209
5556
|
/**
|
|
5210
|
-
*
|
|
5557
|
+
* Defines the layout of an element.
|
|
5558
|
+
* @default {'default'}
|
|
5211
5559
|
*/
|
|
5212
|
-
|
|
5560
|
+
layout: {
|
|
5213
5561
|
type: String,
|
|
5562
|
+
attribute: "layout",
|
|
5214
5563
|
reflect: true
|
|
5215
5564
|
},
|
|
5216
|
-
|
|
5565
|
+
|
|
5217
5566
|
/**
|
|
5218
|
-
*
|
|
5567
|
+
* Defines the shape of an element.
|
|
5568
|
+
* @property {'default', 'rounded', 'pill', 'circle'}
|
|
5569
|
+
* @default {'default'}
|
|
5219
5570
|
*/
|
|
5220
|
-
|
|
5571
|
+
shape: {
|
|
5221
5572
|
type: String,
|
|
5573
|
+
attribute: "shape",
|
|
5222
5574
|
reflect: true
|
|
5223
5575
|
},
|
|
5224
5576
|
|
|
5225
5577
|
/**
|
|
5226
|
-
*
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
type: Boolean
|
|
5230
|
-
},
|
|
5231
|
-
|
|
5232
|
-
/**
|
|
5233
|
-
* When true, auro-icon will render a custom SVG inside the default slot.
|
|
5234
|
-
*/
|
|
5235
|
-
customSvg: {
|
|
5236
|
-
type: Boolean
|
|
5237
|
-
},
|
|
5238
|
-
|
|
5239
|
-
/**
|
|
5240
|
-
* Exposes content in slot as icon label.
|
|
5578
|
+
* Defines the size of an element.
|
|
5579
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'}
|
|
5580
|
+
* @default {'md'}
|
|
5241
5581
|
*/
|
|
5242
|
-
|
|
5243
|
-
type:
|
|
5582
|
+
size: {
|
|
5583
|
+
type: String,
|
|
5584
|
+
attribute: "size",
|
|
5244
5585
|
reflect: true
|
|
5245
5586
|
},
|
|
5246
5587
|
|
|
5247
|
-
/**
|
|
5248
|
-
*
|
|
5588
|
+
/**
|
|
5589
|
+
* This Boolean attribute lets you specify that the element should be rendered in dark mode.
|
|
5590
|
+
* @default {false}
|
|
5249
5591
|
*/
|
|
5250
|
-
|
|
5251
|
-
type:
|
|
5592
|
+
onDark: {
|
|
5593
|
+
type: Boolean,
|
|
5594
|
+
attribute: "ondark",
|
|
5252
5595
|
reflect: true
|
|
5253
5596
|
},
|
|
5254
5597
|
|
|
5255
5598
|
/**
|
|
5256
|
-
*
|
|
5599
|
+
* A reference to the wrapper element in the shadow DOM.
|
|
5600
|
+
* This is used to apply layout and shape classes dynamically.
|
|
5601
|
+
* @type {HTMLElement|null}
|
|
5602
|
+
* @default {null}
|
|
5603
|
+
* @private
|
|
5257
5604
|
*/
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
reflect:
|
|
5605
|
+
wrapper: {
|
|
5606
|
+
attribute: false,
|
|
5607
|
+
reflect: false
|
|
5608
|
+
}
|
|
5609
|
+
};
|
|
5610
|
+
}
|
|
5611
|
+
|
|
5612
|
+
|
|
5613
|
+
|
|
5614
|
+
resetShapeClasses() {
|
|
5615
|
+
if (this.shape && this.size) {
|
|
5616
|
+
|
|
5617
|
+
if (this.wrapper) {
|
|
5618
|
+
this.wrapper.classList.forEach((className) => {
|
|
5619
|
+
if (className.startsWith('shape-')) {
|
|
5620
|
+
this.wrapper.classList.remove(className);
|
|
5621
|
+
}
|
|
5622
|
+
});
|
|
5623
|
+
|
|
5624
|
+
this.wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
5625
|
+
}
|
|
5626
|
+
}
|
|
5627
|
+
}
|
|
5628
|
+
|
|
5629
|
+
resetLayoutClasses() {
|
|
5630
|
+
if (this.layout) {
|
|
5631
|
+
if (this.wrapper) {
|
|
5632
|
+
this.wrapper.classList.forEach((className) => {
|
|
5633
|
+
if (className.startsWith('layout-')) {
|
|
5634
|
+
this.wrapper.classList.remove(className);
|
|
5635
|
+
}
|
|
5636
|
+
});
|
|
5637
|
+
|
|
5638
|
+
this.wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
|
|
5639
|
+
}
|
|
5640
|
+
}
|
|
5641
|
+
}
|
|
5642
|
+
|
|
5643
|
+
updateComponentArchitecture() {
|
|
5644
|
+
this.resetLayoutClasses();
|
|
5645
|
+
this.resetShapeClasses();
|
|
5646
|
+
}
|
|
5647
|
+
|
|
5648
|
+
updated(changedProperties) {
|
|
5649
|
+
if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
|
|
5650
|
+
this.updateComponentArchitecture();
|
|
5651
|
+
}
|
|
5652
|
+
}
|
|
5653
|
+
|
|
5654
|
+
firstUpdated() {
|
|
5655
|
+
super.firstUpdated();
|
|
5656
|
+
|
|
5657
|
+
// Set a reference to the wrapper element in the shadow DOM
|
|
5658
|
+
this.wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
5659
|
+
|
|
5660
|
+
// Initialize the transportation of ARIA attributes to the target element and get the disconnect function for cleanup
|
|
5661
|
+
this.attributeWatcher = transportAllA11yAttributes({ host: this, target: this.shadowRoot.querySelector('.wrapper') });
|
|
5662
|
+
}
|
|
5663
|
+
|
|
5664
|
+
disconnectedCallback() {
|
|
5665
|
+
super.disconnectedCallback();
|
|
5666
|
+
|
|
5667
|
+
// Cleanup the ARIA observer if it exists
|
|
5668
|
+
if (this.attributeWatcher) {
|
|
5669
|
+
this.attributeWatcher.cleanup();
|
|
5670
|
+
this.attributeWatcher = null;
|
|
5671
|
+
}
|
|
5672
|
+
}
|
|
5673
|
+
|
|
5674
|
+
// Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
|
|
5675
|
+
// This will catch if an invalid layout value is passed in and render the default layout if so.
|
|
5676
|
+
render() {
|
|
5677
|
+
try {
|
|
5678
|
+
return this.renderLayout();
|
|
5679
|
+
} catch (error) {
|
|
5680
|
+
// failed to get the defined layout
|
|
5681
|
+
console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
|
|
5682
|
+
|
|
5683
|
+
// fallback to the default layout
|
|
5684
|
+
return this.getLayout('default');
|
|
5685
|
+
}
|
|
5686
|
+
}
|
|
5687
|
+
};
|
|
5688
|
+
|
|
5689
|
+
var styleCss$3 = css`:focus:not(:focus-visible){outline:3px solid transparent}.util_insetNone{padding:0}.util_insetXxxs{padding:.125rem}.util_insetXxxs--stretch{padding:.25rem .125rem}.util_insetXxxs--squish{padding:0 .125rem}.util_insetXxs{padding:.25rem}.util_insetXxs--stretch{padding:.375rem .25rem}.util_insetXxs--squish{padding:.125rem .25rem}.util_insetXs{padding:.5rem}.util_insetXs--stretch{padding:.75rem .5rem}.util_insetXs--squish{padding:.25rem .5rem}.util_insetSm{padding:.75rem}.util_insetSm--stretch{padding:1.125rem .75rem}.util_insetSm--squish{padding:.375rem .75rem}.util_insetMd{padding:1rem}.util_insetMd--stretch{padding:1.5rem 1rem}.util_insetMd--squish{padding:.5rem 1rem}.util_insetLg{padding:1.5rem}.util_insetLg--stretch{padding:2.25rem 1.5rem}.util_insetLg--squish{padding:.75rem 1.5rem}.util_insetXl{padding:2rem}.util_insetXl--stretch{padding:3rem 2rem}.util_insetXl--squish{padding:1rem 2rem}.util_insetXxl{padding:3rem}.util_insetXxl--stretch{padding:4.5rem 3rem}.util_insetXxl--squish{padding:1.5rem 3rem}.util_insetXxxl{padding:4rem}.util_insetXxxl--stretch{padding:6rem 4rem}.util_insetXxxl--squish{padding:2rem 4rem}:host([fluid]) .auro-button,:host([fluid=true]) .auro-button{min-width:auto;width:100%}:host([variant=flat]){display:inline-block}::slotted(svg){vertical-align:middle}slot{pointer-events:none}.auro-button{position:relative;padding:0 var(--ds-size-300, 1.5rem);cursor:pointer;border-width:1px;border-style:solid;border-radius:var(--ds-border-radius, 0.375rem);overflow:hidden;text-overflow:ellipsis;user-select:none;white-space:nowrap;min-height:var(--ds-size-600, 3rem);max-height:var(--ds-size-600, 3rem);display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:var(--ds-size-100, 0.5rem);margin:0;-webkit-touch-callout:none;-webkit-user-select:none;transition:padding 300ms ease-out}.auro-button:active{transform:scale(0.95)}.auro-button:focus-visible,.auro-button:focus{outline:none;outline-style:solid;outline-width:var(--ds-size-50, 0.25rem);outline-offset:calc(var(--ds-size-50, 0.25rem)*-1)}.auro-button:focus-visible:not([variant=secondary]):not([variant=tertiary]),.auro-button:focus:not([variant=secondary]):not([variant=tertiary]){outline-width:calc(var(--ds-size-50, 0.25rem) - 1px)}.auro-button.loading{cursor:not-allowed}.auro-button.loading *:not([auro-loader]){visibility:hidden}@media screen and (min-width: 576px){.auro-button{min-width:8.75rem;width:auto}}.auro-button:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=secondary]:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=tertiary]:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=ghost]:disabled{cursor:not-allowed;transform:unset}.auro-button[onDark]:disabled{cursor:not-allowed;transform:unset}.auro-button[onDark][variant=secondary]:disabled{cursor:not-allowed;transform:unset}@media(hover: hover){.auro-button[onDark][variant=tertiary]:active,.auro-button[onDark][variant=tertiary]:hover{box-shadow:none}}.auro-button[onDark][variant=tertiary]:active{box-shadow:none}.auro-button[onDark][variant=tertiary]:disabled{cursor:not-allowed;transform:unset}.auro-button.icon-only ::slotted(:not(auro-icon):not([auro-icon])){display:none}.auro-button--slim{min-width:unset;min-height:calc(var(--ds-size-500, 2.5rem) - var(--ds-size-50, 0.25rem));max-height:calc(var(--ds-size-500, 2.5rem) - var(--ds-size-50, 0.25rem))}.auro-button--iconOnly{padding:0 var(--ds-size-100, 0.5rem);border-radius:100px;min-width:unset;height:var(--ds-size-600, 3rem);width:var(--ds-size-500, 2.5rem)}.auro-button--iconOnly ::slotted(auro-icon),.auro-button--iconOnly ::slotted([auro-icon]){--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}.auro-button--iconOnly:not(.auro-button--rounded):focus-visible:not([variant=secondary]):not([variant=tertiary]):not([variant=flat]),.auro-button--iconOnly:not(.auro-button--rounded):focus:not([variant=secondary]):not([variant=tertiary]):not([variant=flat]){outline-width:1px;outline-offset:-2px}.auro-button--iconOnlySlim{padding:0 var(--ds-size-50, 0.25rem);height:calc(var(--ds-size-400, 2rem) + var(--ds-size-50, 0.25rem));width:calc(var(--ds-size-300, 1.5rem) + var(--ds-size-50, 0.25rem))}.auro-button--iconOnlySlim ::slotted(auro-icon),.auro-button--iconOnlySlim ::slotted([auro-icon]){--ds-auro-icon-size:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem))}.auro-button--rounded{border-radius:100px;box-shadow:var(--ds-elevation-300, 0px 0px 15px rgba(0, 0, 0, 0.2));height:var(--ds-size-500, 2.5rem);min-width:unset;transition:padding 300ms ease-out,outline 0ms,outline-offset 0ms}.auro-button--rounded ::slotted(auro-icon),.auro-button--rounded ::slotted([auro-icon]){--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}.auro-button--rounded:focus-visible:not([variant=flat]):after,.auro-button--rounded:focus:not([variant=flat]):after{border-radius:100px}:host([size=xs]) .wrapper:focus-visible,:host([size=xs]) .wrapper:focus{outline-width:1px;outline-offset:-2px}:host([rounded]) .textSlot{transition:opacity 300ms ease-in;opacity:1}:host([rounded][iconOnly]) .textSlot{opacity:0}:host([rounded][iconOnly]) .textWrapper{display:none}:host([rounded][iconOnly]) .auro-button{min-width:unset;padding:unset;width:var(--ds-size-600, 3rem)}[auro-loader]{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}`;
|
|
5690
|
+
|
|
5691
|
+
var colorCss$2 = css`[auro-loader]{color:var(--ds-auro-button-loader-color)}.auro-button{-webkit-tap-highlight-color:var(--ds-auro-button-tap-color);color:var(--ds-auro-button-text-color);background-color:var(--ds-auro-button-container-color);background-image:linear-gradient(var(--ds-auro-button-container-image), var(--ds-auro-button-container-image));border-color:var(--ds-auro-button-border-color)}.auro-button:not([variant=secondary]):not([variant=tertiary]):focus-visible{outline-color:var(--ds-auro-button-border-inset-color)}.auro-button:not([ondark]):active:not(:disabled),.auro-button:not([ondark]):hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-hover, #00274a);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-hover, #00274a);--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-hover, #00274a)}.auro-button:not([ondark]):disabled{--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-disabled, #acc9e2);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-disabled, #acc9e2);--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-disabled, #acc9e2)}.auro-button:not([ondark])[variant=secondary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background, #ffffff);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border, #01426a);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-secondary-text, #01426a)}.auro-button:not([ondark])[variant=secondary]:active:not(:disabled),.auro-button:not([ondark])[variant=secondary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-hover, #f2f2f2);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-hover, #f2f2f2);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-hover, #00274a);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text-hover, #00274a)}.auro-button:not([ondark])[variant=secondary]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=secondary]:disabled{--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-disabled, #f7f7f7);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-disabled, #f7f7f7);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-disabled, #cfe0ef);--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=tertiary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background, rgba(0, 0, 0, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background, rgba(0, 0, 0, 0.05));--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-tertiary-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-tertiary-text, #01426a)}.auro-button:not([ondark])[variant=tertiary]:active:not(:disabled),.auro-button:not([ondark])[variant=tertiary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-hover, rgba(0, 0, 0, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-hover, rgba(0, 0, 0, 0.1));--ds-auro-button-border-color:transparent}.auro-button:not([ondark])[variant=tertiary]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=tertiary]:disabled{--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=ghost]{--ds-auro-button-container-color:transparent;--ds-auro-button-container-image:transparent;--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-ghost-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-ghost-text, #01426a)}.auro-button:not([ondark])[variant=ghost]:active:not(:disabled),.auro-button:not([ondark])[variant=ghost]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-ghost-background-hover, rgba(0, 0, 0, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-ghost-background-hover, rgba(0, 0, 0, 0.05));--ds-auro-button-border-color:transparent}.auro-button:not([ondark])[variant=ghost]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=ghost]:disabled{--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=flat]{color:var(--ds-advanced-color-button-flat-text, #676767);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:active:not(:disabled),.auro-button:not([ondark])[variant=flat]:hover:not(:disabled){color:var(--ds-advanced-color-button-flat-text-hover, #525252);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:disabled{color:var(--ds-advanced-color-button-flat-text-disabled, #d0d0d0);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button[ondark]{--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a)}.auro-button[ondark]:active:not(:disabled),.auro-button[ondark]:hover:not(:disabled){--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse-hover, #ebf3f9);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse-hover, #ebf3f9);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse-hover, #ebf3f9)}.auro-button[ondark]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button[ondark]:disabled{--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=secondary]{--ds-auro-button-container-color:transparent;--ds-auro-button-container-image:transparent;--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-inverse, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-secondary-text-inverse, #ffffff)}.auro-button[ondark][variant=secondary]:active:not(:disabled),.auro-button[ondark][variant=secondary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-inverse-hover, rgba(255, 255, 255, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-inverse-hover, rgba(255, 255, 255, 0.1))}.auro-button[ondark][variant=secondary]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=secondary]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-inverse-disabled, #dddddd)}.auro-button[ondark][variant=tertiary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-inverse, rgba(255, 255, 255, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-inverse, rgba(255, 255, 255, 0.05));--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-tertiary-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-tertiary-text-inverse, #ffffff)}.auro-button[ondark][variant=tertiary]:active:not(:disabled),.auro-button[ondark][variant=tertiary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-inverse-hover, rgba(255, 255, 255, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-inverse-hover, rgba(255, 255, 255, 0.1))}.auro-button[ondark][variant=tertiary]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=tertiary]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=ghost]{--ds-auro-button-container-color:transparent;--ds-auro-button-container-image:transparent;--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-ghost-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-ghost-text-inverse, #ffffff)}.auro-button[ondark][variant=ghost]:active:not(:disabled),.auro-button[ondark][variant=ghost]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-ghost-background-inverse-hover, rgba(255, 255, 255, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-ghost-background-inverse-hover, rgba(255, 255, 255, 0.05))}.auro-button[ondark][variant=ghost]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=ghost]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=flat]{color:var(--ds-advanced-color-button-flat-text-inverse, #ffffff);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:active:not(:disabled),.auro-button[ondark][variant=flat]:hover:not(:disabled){color:var(--ds-advanced-color-button-flat-text-inverse-hover, #adadad);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:disabled{color:var(--ds-advanced-color-button-flat-text-inverse-disabled, #7e8894);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}`;
|
|
5692
|
+
|
|
5693
|
+
var tokensCss$2 = css`:host(:not([onDark])){--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background, #01426a);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text, #ffffff);--ds-auro-button-tap-color:transparent}:host([onDark]){--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a);--ds-auro-button-tap-color:transparent}`;
|
|
5694
|
+
|
|
5695
|
+
var shapeSize = css`.shape-rounded-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:6px;overflow:hidden;font-size:18px}.shape-rounded-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:6px;overflow:hidden;font-size:18px}.shape-rounded-md{min-height:44px;max-height:44px;border-style:solid;border-radius:6px;overflow:hidden;font-size:16px}.shape-rounded-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:6px;overflow:hidden;font-size:14px}.shape-rounded-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:4px;overflow:hidden;font-size:12px;outline-offset:-2px;outline-width:1px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:34px;overflow:hidden;font-size:18px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:34px 0 0 34px;overflow:hidden}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:0 34px 34px 0;overflow:hidden}.shape-pill-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:26px;overflow:hidden;font-size:18px}.shape-pill-left-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:26px 0 0 26px;overflow:hidden}.shape-pill-right-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:0 26px 26px 0;overflow:hidden}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-radius:22px;overflow:hidden}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-radius:22px 0 0 22px;overflow:hidden}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-radius:0 22px 22px 0;overflow:hidden;font-size:16px}.shape-pill-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:16px;overflow:hidden;font-size:14px}.shape-pill-left-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:16px 0 0 16px;overflow:hidden}.shape-pill-right-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:0 16px 16px 0;overflow:hidden}.shape-pill-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:10px;overflow:hidden;font-size:12px;outline-offset:-2px;outline-width:1px}.shape-pill-left-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:10px 0 0 10px;overflow:hidden;outline-offset:-2px;outline-width:1px}.shape-pill-right-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:0 10px 10px 0;overflow:hidden;outline-offset:-2px;outline-width:1px}.shape-circle-xl{min-height:68px;max-height:68px;min-width:68px;max-width:68px;border-style:solid;border-radius:34px;overflow:hidden;padding:0}.shape-circle-lg{min-height:52px;max-height:52px;min-width:52px;max-width:52px;border-style:solid;border-radius:26px;overflow:hidden;padding:0}.shape-circle-md{min-height:44px;max-height:44px;min-width:44px;max-width:44px;border-style:solid;border-radius:22px;overflow:hidden;padding:0}.shape-circle-sm{min-height:32px;max-height:32px;min-width:32px;max-width:32px;border-style:solid;border-radius:16px;overflow:hidden;padding:0}.shape-circle-xs{min-height:20px;max-height:20px;min-width:20px;max-width:20px;border-style:solid;border-radius:10px;overflow:hidden;padding:0;outline-offset:-2px;outline-width:1px}`;
|
|
5696
|
+
|
|
5697
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5698
|
+
// See LICENSE in the project root for license information.
|
|
5699
|
+
|
|
5700
|
+
// ---------------------------------------------------------------------
|
|
5701
|
+
|
|
5702
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
5703
|
+
|
|
5704
|
+
let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
5705
|
+
|
|
5706
|
+
/* eslint-disable jsdoc/require-param */
|
|
5707
|
+
|
|
5708
|
+
/**
|
|
5709
|
+
* This will register a new custom element with the browser.
|
|
5710
|
+
* @param {String} name - The name of the custom element.
|
|
5711
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
5712
|
+
* @returns {void}
|
|
5713
|
+
*/
|
|
5714
|
+
registerComponent(name, componentClass) {
|
|
5715
|
+
if (!customElements.get(name)) {
|
|
5716
|
+
customElements.define(name, class extends componentClass {});
|
|
5717
|
+
}
|
|
5718
|
+
}
|
|
5719
|
+
|
|
5720
|
+
/**
|
|
5721
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
5722
|
+
* @returns {void}
|
|
5723
|
+
*/
|
|
5724
|
+
closestElement(
|
|
5725
|
+
selector, // selector like in .closest()
|
|
5726
|
+
base = this, // extra functionality to skip a parent
|
|
5727
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
5728
|
+
!el || el === document || el === window
|
|
5729
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
5730
|
+
: found
|
|
5731
|
+
? found // found a selector INside this element
|
|
5732
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
5733
|
+
) {
|
|
5734
|
+
return __Closest(base);
|
|
5735
|
+
}
|
|
5736
|
+
/* eslint-enable jsdoc/require-param */
|
|
5737
|
+
|
|
5738
|
+
/**
|
|
5739
|
+
* 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.
|
|
5740
|
+
* @param {Object} elem - The element to check.
|
|
5741
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
5742
|
+
* @returns {void}
|
|
5743
|
+
*/
|
|
5744
|
+
handleComponentTagRename(elem, tagName) {
|
|
5745
|
+
const tag = tagName.toLowerCase();
|
|
5746
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
5747
|
+
|
|
5748
|
+
if (elemTag !== tag) {
|
|
5749
|
+
elem.setAttribute(tag, true);
|
|
5750
|
+
}
|
|
5751
|
+
}
|
|
5752
|
+
|
|
5753
|
+
/**
|
|
5754
|
+
* Validates if an element is a specific Auro component.
|
|
5755
|
+
* @param {Object} elem - The element to validate.
|
|
5756
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
5757
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
5758
|
+
*/
|
|
5759
|
+
elementMatch(elem, tagName) {
|
|
5760
|
+
const tag = tagName.toLowerCase();
|
|
5761
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
5762
|
+
|
|
5763
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
5764
|
+
}
|
|
5765
|
+
};
|
|
5766
|
+
|
|
5767
|
+
var styleCss$2 = css`:focus:not(:focus-visible){outline:3px solid transparent}:host,:host>span{position:relative}:host{width:2rem;height:2rem;display:inline-block;font-size:0}:host>span{position:absolute;display:inline-block;float:none;top:0;left:0;width:2rem;height:2rem;border-radius:100%;border-style:solid;border-width:0}:host([xs]),:host([xs])>span{width:1.2rem;height:1.2rem}:host([sm]),:host([sm])>span{width:3rem;height:3rem}:host([md]),:host([md])>span{width:5rem;height:5rem}:host([lg]),:host([lg])>span{width:8rem;height:8rem}:host{--margin:0.375rem;--margin-xs:0.2rem;--margin-sm:0.5rem;--margin-md:0.75rem;--margin-lg:1rem}:host([pulse]),:host([pulse])>span{position:relative}:host([pulse]){width:calc(3rem + var(--margin)*6);height:1.5rem}:host([pulse])>span{width:1rem;height:1rem;margin:var(--margin);animation:pulse 1.5s ease infinite}:host([pulse][xs]){width:calc(2.55rem + var(--margin-xs)*6);height:1.55rem}:host([pulse][xs])>span{margin:var(--margin-xs);width:.65rem;height:.65rem}:host([pulse][sm]){width:calc(6rem + var(--margin-sm)*6);height:2.5rem}:host([pulse][sm])>span{margin:var(--margin-sm);width:2rem;height:2rem}:host([pulse][md]){width:calc(9rem + var(--margin-md)*6);height:3.5rem}:host([pulse][md])>span{margin:var(--margin-md);width:3rem;height:3rem}:host([pulse][lg]){width:calc(15rem + var(--margin-lg)*6);height:5.5rem}:host([pulse][lg])>span{margin:var(--margin-lg);width:5rem;height:5rem}:host([pulse])>span:nth-child(1){animation-delay:-400ms}:host([pulse])>span:nth-child(2){animation-delay:-200ms}:host([pulse])>span:nth-child(3){animation-delay:0ms}@keyframes pulse{0%,100%{opacity:.1;transform:scale(0.9)}50%{opacity:1;transform:scale(1.1)}}:host([orbit]),:host([orbit])>span{opacity:1}:host([orbit])>span{border-width:5px}:host([orbit])>span:nth-child(2){animation:orbit 2s linear infinite}:host([orbit][sm])>span{border-width:8px}:host([orbit][md])>span{border-width:13px}:host([orbit][lg])>span{border-width:21px}@keyframes orbit{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}:host([ringworm])>svg{animation:rotate 2s linear infinite;height:100%;width:100%;stroke:currentcolor;stroke-width:8}:host([ringworm]) .path{stroke-dashoffset:0;animation:ringworm 1.5s ease-in-out infinite;stroke-linecap:round}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes ringworm{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}:host([laser]){position:static;width:100%;display:block;height:0;overflow:hidden;font-size:unset}:host([laser])>span{position:fixed;width:100%;height:.25rem;border-radius:0;z-index:100}:host([laser])>span:nth-child(1){border-color:currentcolor;opacity:.25}:host([laser])>span:nth-child(2){border-color:currentcolor;animation:laser 2s linear infinite;opacity:1;width:50%}:host([laser][sm])>span:nth-child(2){width:20%}:host([laser][md])>span:nth-child(2){width:30%}:host([laser][lg])>span:nth-child(2){width:50%;animation-duration:1.5s}:host([laser][xl])>span:nth-child(2){width:80%;animation-duration:1.5s}@keyframes laser{0%{left:-100%}100%{left:110%}}:host>.no-animation{display:none}@media(prefers-reduced-motion: reduce){:host{display:flex;align-items:center;justify-content:center;font-size:1rem}:host>span{opacity:1}:host>.loader{display:none}:host>.no-animation{display:block}}`;
|
|
5768
|
+
|
|
5769
|
+
var colorCss$1 = css`:host{color:var(--ds-auro-loader-color)}:host>span{background-color:var(--ds-auro-loader-background-color);border-color:var(--ds-auro-loader-border-color)}:host([onlight]){--ds-auro-loader-color:var(--ds-basic-color-brand-primary, #01426a)}:host([ondark]){--ds-auro-loader-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([orbit])>span{--ds-auro-loader-background-color:transparent}:host([orbit])>span:nth-child(1){--ds-auro-loader-border-color:currentcolor;opacity:.25}:host([orbit])>span:nth-child(2){--ds-auro-loader-border-color:currentcolor;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}`;
|
|
5770
|
+
|
|
5771
|
+
var tokensCss$1 = css`:host{--ds-auro-loader-background-color:currentcolor;--ds-auro-loader-border-color:currentcolor;--ds-auro-loader-color:currentcolor}`;
|
|
5772
|
+
|
|
5773
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5774
|
+
// See LICENSE in the project root for license information.
|
|
5775
|
+
|
|
5776
|
+
|
|
5777
|
+
class AuroLoader extends LitElement {
|
|
5778
|
+
constructor() {
|
|
5779
|
+
super();
|
|
5780
|
+
|
|
5781
|
+
/**
|
|
5782
|
+
* @private
|
|
5783
|
+
*/
|
|
5784
|
+
this.keys = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
5785
|
+
|
|
5786
|
+
/**
|
|
5787
|
+
* @private
|
|
5788
|
+
*/
|
|
5789
|
+
this.mdCount = 3;
|
|
5790
|
+
|
|
5791
|
+
/**
|
|
5792
|
+
* @private
|
|
5793
|
+
*/
|
|
5794
|
+
this.smCount = 2;
|
|
5795
|
+
|
|
5796
|
+
/**
|
|
5797
|
+
* @private
|
|
5798
|
+
*/
|
|
5799
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2();
|
|
5800
|
+
|
|
5801
|
+
this.orbit = false;
|
|
5802
|
+
this.ringworm = false;
|
|
5803
|
+
this.laser = false;
|
|
5804
|
+
this.pulse = false;
|
|
5805
|
+
}
|
|
5806
|
+
|
|
5807
|
+
// function to define props used within the scope of this component
|
|
5808
|
+
static get properties() {
|
|
5809
|
+
return {
|
|
5810
|
+
|
|
5811
|
+
/**
|
|
5812
|
+
* Sets loader to laser type.
|
|
5813
|
+
*/
|
|
5814
|
+
laser: {
|
|
5815
|
+
type: Boolean,
|
|
5816
|
+
reflect: true
|
|
5817
|
+
},
|
|
5818
|
+
|
|
5819
|
+
/**
|
|
5820
|
+
* Sets loader to orbit type.
|
|
5821
|
+
*/
|
|
5822
|
+
orbit: {
|
|
5823
|
+
type: Boolean,
|
|
5824
|
+
reflect: true
|
|
5825
|
+
},
|
|
5826
|
+
|
|
5827
|
+
/**
|
|
5828
|
+
* Sets loader to pulse type.
|
|
5829
|
+
*/
|
|
5830
|
+
pulse: {
|
|
5831
|
+
type: Boolean,
|
|
5832
|
+
reflect: true
|
|
5833
|
+
},
|
|
5834
|
+
|
|
5835
|
+
/**
|
|
5836
|
+
* Sets loader to ringworm type.
|
|
5837
|
+
*/
|
|
5838
|
+
ringworm: {
|
|
5839
|
+
type: Boolean,
|
|
5840
|
+
reflect: true
|
|
5841
|
+
}
|
|
5842
|
+
};
|
|
5843
|
+
}
|
|
5844
|
+
|
|
5845
|
+
static get styles() {
|
|
5846
|
+
return [
|
|
5847
|
+
css`${styleCss$2}`,
|
|
5848
|
+
css`${colorCss$1}`,
|
|
5849
|
+
css`${tokensCss$1}`
|
|
5850
|
+
];
|
|
5851
|
+
}
|
|
5852
|
+
|
|
5853
|
+
/**
|
|
5854
|
+
* This will register this element with the browser.
|
|
5855
|
+
* @param {string} [name="auro-loader"] - The name of element that you want to register to.
|
|
5856
|
+
*
|
|
5857
|
+
* @example
|
|
5858
|
+
* AuroLoader.register("custom-loader") // this will register this element to <custom-loader/>
|
|
5859
|
+
*
|
|
5860
|
+
*/
|
|
5861
|
+
static register(name = "auro-loader") {
|
|
5862
|
+
AuroLibraryRuntimeUtils$2.prototype.registerComponent(name, AuroLoader);
|
|
5863
|
+
}
|
|
5864
|
+
|
|
5865
|
+
firstUpdated() {
|
|
5866
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
5867
|
+
this.runtimeUtils.handleComponentTagRename(this, 'auro-loader');
|
|
5868
|
+
}
|
|
5869
|
+
|
|
5870
|
+
connectedCallback() {
|
|
5871
|
+
super.connectedCallback();
|
|
5872
|
+
}
|
|
5873
|
+
|
|
5874
|
+
/**
|
|
5875
|
+
* @private
|
|
5876
|
+
* @returns {Array} Numbered array for template map.
|
|
5877
|
+
*/
|
|
5878
|
+
defineTemplate() {
|
|
5879
|
+
let nodes = Array.from(Array(this.mdCount).keys());
|
|
5880
|
+
|
|
5881
|
+
if (this.orbit || this.laser) {
|
|
5882
|
+
nodes = Array.from(Array(this.smCount).keys());
|
|
5883
|
+
} else if (this.ringworm) {
|
|
5884
|
+
nodes = Array.from(Array(0).keys());
|
|
5885
|
+
}
|
|
5886
|
+
|
|
5887
|
+
return nodes;
|
|
5888
|
+
}
|
|
5889
|
+
|
|
5890
|
+
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
5891
|
+
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
5892
|
+
|
|
5893
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
5894
|
+
render() {
|
|
5895
|
+
return html$1`
|
|
5896
|
+
${this.defineTemplate().map((idx) => html$1`
|
|
5897
|
+
<span part="element" class="loader node-${idx}"></span>
|
|
5898
|
+
`)}
|
|
5899
|
+
|
|
5900
|
+
<div class="no-animation">Loading...</div>
|
|
5901
|
+
|
|
5902
|
+
${this.ringworm ? html$1`
|
|
5903
|
+
<svg part="element" class="circular" viewBox="25 25 50 50">
|
|
5904
|
+
<circle class="path" cx="50" cy="50" r="20" fill="none"/>
|
|
5905
|
+
</svg>`
|
|
5906
|
+
: ``
|
|
5907
|
+
}
|
|
5908
|
+
`;
|
|
5909
|
+
}
|
|
5910
|
+
}
|
|
5911
|
+
|
|
5912
|
+
var loaderVersion = '5.0.0';
|
|
5913
|
+
|
|
5914
|
+
/* eslint-disable max-lines, curly, jsdoc/no-undefined-types */
|
|
5915
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5916
|
+
// See LICENSE in the project root for license information.
|
|
5917
|
+
|
|
5918
|
+
|
|
5919
|
+
/**
|
|
5920
|
+
* @slot - Default slot for the text of the button.
|
|
5921
|
+
* @csspart button - Apply CSS to HTML5 button.
|
|
5922
|
+
* @csspart loader - Apply CSS to auro-loader.
|
|
5923
|
+
* @csspart text - Apply CSS to text slot.
|
|
5924
|
+
* @csspart icon - Apply CSS to icon slot.
|
|
5925
|
+
*/
|
|
5926
|
+
|
|
5927
|
+
/* eslint-disable lit/no-invalid-html, lit/binding-positions */
|
|
5928
|
+
|
|
5929
|
+
const ICON_ONLY_SHAPES = ['circle'];
|
|
5930
|
+
|
|
5931
|
+
/**
|
|
5932
|
+
* AuroButton is a custom element that provides a styled, accessible button with support for various states and form association.
|
|
5933
|
+
* It is designed to be flexible, supporting loading states, icon slots, and integration with HTML5 forms.
|
|
5934
|
+
* @property {'default', 'rounded', 'pill', 'circle'} shape - Defines the shape of the button.
|
|
5935
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'} size - Defines the size of the button.
|
|
5936
|
+
* @property {'primary', 'secondary', 'tertiary', 'ghost', 'flat'} variant - Sets the button variant.
|
|
5937
|
+
* @property {'submit', 'reset', 'button'} type - The type of button. Matches HTML5 Button Spec.
|
|
5938
|
+
* @property {boolean} onDark - Indicates if the button is rendered in dark mode.
|
|
5939
|
+
*/
|
|
5940
|
+
class AuroButton extends AuroElement$1 {
|
|
5941
|
+
|
|
5942
|
+
/**
|
|
5943
|
+
* Enables form association for this element.
|
|
5944
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals
|
|
5945
|
+
* @returns {boolean} - Returns true to enable form association.
|
|
5946
|
+
*/
|
|
5947
|
+
static get formAssociated() {
|
|
5948
|
+
return true;
|
|
5949
|
+
}
|
|
5950
|
+
|
|
5951
|
+
constructor() {
|
|
5952
|
+
super();
|
|
5953
|
+
this.autofocus = false;
|
|
5954
|
+
this.disabled = false;
|
|
5955
|
+
this.loading = false;
|
|
5956
|
+
this.size = "md";
|
|
5957
|
+
this.shape = "rounded";
|
|
5958
|
+
this.onDark = false;
|
|
5959
|
+
this.fluid = false;
|
|
5960
|
+
this.loadingText = this.loadingText || 'Loading...';
|
|
5961
|
+
|
|
5962
|
+
// Support for HTML5 forms
|
|
5963
|
+
if (typeof this.attachInternals === 'function') {
|
|
5964
|
+
this.internals = this.attachInternals();
|
|
5965
|
+
} else {
|
|
5966
|
+
this.internals = null;
|
|
5967
|
+
|
|
5968
|
+
// eslint-disable-next-line no-console
|
|
5969
|
+
console.warn('This browser does not support form association features. Some form-related functionality may not work as expected. Consider using a polyfill or handling click events manually.');
|
|
5970
|
+
}
|
|
5971
|
+
|
|
5972
|
+
/**
|
|
5973
|
+
* Generate unique names for dependency components.
|
|
5974
|
+
*/
|
|
5975
|
+
const versioning = new AuroDependencyVersioning();
|
|
5976
|
+
|
|
5977
|
+
/**
|
|
5978
|
+
* @private
|
|
5979
|
+
*/
|
|
5980
|
+
this.loaderTag = versioning.generateTag('auro-loader', loaderVersion, AuroLoader);
|
|
5981
|
+
|
|
5982
|
+
/**
|
|
5983
|
+
* @private
|
|
5984
|
+
*/
|
|
5985
|
+
this.buttonHref = undefined;
|
|
5986
|
+
|
|
5987
|
+
/**
|
|
5988
|
+
* @private
|
|
5989
|
+
*/
|
|
5990
|
+
this.buttonTarget = undefined;
|
|
5991
|
+
|
|
5992
|
+
/**
|
|
5993
|
+
* @private
|
|
5994
|
+
*/
|
|
5995
|
+
this.buttonRel = undefined;
|
|
5996
|
+
}
|
|
5997
|
+
|
|
5998
|
+
static get styles() {
|
|
5999
|
+
return [
|
|
6000
|
+
tokensCss$2,
|
|
6001
|
+
styleCss$3,
|
|
6002
|
+
colorCss$2,
|
|
6003
|
+
shapeSize
|
|
6004
|
+
];
|
|
6005
|
+
}
|
|
6006
|
+
|
|
6007
|
+
static get properties() {
|
|
6008
|
+
return {
|
|
6009
|
+
|
|
6010
|
+
...super.properties,
|
|
6011
|
+
|
|
6012
|
+
/**
|
|
6013
|
+
* Override layout since it isn't used in this component.
|
|
6014
|
+
* @private
|
|
6015
|
+
*/
|
|
6016
|
+
layout: {
|
|
6017
|
+
type: Boolean,
|
|
6018
|
+
attribute: false,
|
|
6019
|
+
reflect: false
|
|
6020
|
+
},
|
|
6021
|
+
|
|
6022
|
+
/**
|
|
6023
|
+
* This Boolean attribute lets you specify that the button should have input focus when the page loads, unless overridden by the user.
|
|
6024
|
+
*/
|
|
6025
|
+
autofocus: {
|
|
6026
|
+
type: Boolean,
|
|
6027
|
+
reflect: true
|
|
6028
|
+
},
|
|
6029
|
+
|
|
6030
|
+
/**
|
|
6031
|
+
* If set to true, button will become disabled and not allow for interactions.
|
|
6032
|
+
*/
|
|
6033
|
+
disabled: {
|
|
6034
|
+
type: Boolean,
|
|
6035
|
+
reflect: true
|
|
6036
|
+
},
|
|
6037
|
+
|
|
6038
|
+
/**
|
|
6039
|
+
* Alters the shape of the button to be full width of its parent container.
|
|
6040
|
+
*/
|
|
6041
|
+
fluid: {
|
|
6042
|
+
type: Boolean,
|
|
6043
|
+
reflect: true
|
|
6044
|
+
},
|
|
6045
|
+
|
|
6046
|
+
/**
|
|
6047
|
+
* If set to true button text will be replaced with `auro-loader` and become disabled.
|
|
6048
|
+
*/
|
|
6049
|
+
loading: {
|
|
6050
|
+
type: Boolean,
|
|
6051
|
+
reflect: true
|
|
6052
|
+
},
|
|
6053
|
+
|
|
6054
|
+
/**
|
|
6055
|
+
* Sets custom loading text for the `aria-label` on a button in loading state. If not set, the default value of "Loading..." will be used.
|
|
6056
|
+
*/
|
|
6057
|
+
loadingText: {
|
|
6058
|
+
type: String
|
|
6059
|
+
},
|
|
6060
|
+
|
|
6061
|
+
/**
|
|
6062
|
+
* Populates `tabindex` to define the focusable sequence in keyboard navigation.
|
|
6063
|
+
*/
|
|
6064
|
+
tIndex: {
|
|
6065
|
+
type: String,
|
|
6066
|
+
reflect: true
|
|
6067
|
+
},
|
|
6068
|
+
|
|
6069
|
+
/**
|
|
6070
|
+
* Populates `tabindex` to define the focusable sequence in keyboard navigation.
|
|
6071
|
+
* Must be used with "." to ensure the host element does not retain a reference to the `tabindex` attribute.
|
|
6072
|
+
* Example: `<auro-button .tabindex="${this.disabled ? '-1' : '0'}"></auro-button>`
|
|
6073
|
+
*/
|
|
6074
|
+
tabindex: {
|
|
6075
|
+
type: String,
|
|
6076
|
+
reflect: false
|
|
6077
|
+
},
|
|
6078
|
+
|
|
6079
|
+
/**
|
|
6080
|
+
* Sets title attribute. The information is most often shown as a tooltip text when the mouse moves over the element.
|
|
6081
|
+
*/
|
|
6082
|
+
title: {
|
|
6083
|
+
type: String,
|
|
6084
|
+
reflect: true
|
|
6085
|
+
},
|
|
6086
|
+
|
|
6087
|
+
/**
|
|
6088
|
+
* The type of the button. Possible values are: `submit`, `reset`, `button`.
|
|
6089
|
+
*/
|
|
6090
|
+
type: {
|
|
6091
|
+
type: String,
|
|
6092
|
+
reflect: true
|
|
6093
|
+
},
|
|
6094
|
+
|
|
6095
|
+
/**
|
|
6096
|
+
* Defines the value associated with the button which is submitted with the form data.
|
|
6097
|
+
*/
|
|
6098
|
+
value: {
|
|
6099
|
+
type: String,
|
|
6100
|
+
reflect: true
|
|
6101
|
+
},
|
|
6102
|
+
|
|
6103
|
+
/**
|
|
6104
|
+
* Sets button variant option.
|
|
6105
|
+
* @default primary
|
|
6106
|
+
*/
|
|
6107
|
+
variant: {
|
|
6108
|
+
type: String,
|
|
6109
|
+
reflect: true
|
|
6110
|
+
},
|
|
6111
|
+
|
|
6112
|
+
/**
|
|
6113
|
+
* @private
|
|
6114
|
+
*/
|
|
6115
|
+
buttonHref: {
|
|
6116
|
+
type: String,
|
|
6117
|
+
},
|
|
6118
|
+
|
|
6119
|
+
/**
|
|
6120
|
+
* @private
|
|
6121
|
+
*/
|
|
6122
|
+
buttonTarget: {
|
|
6123
|
+
type: String,
|
|
6124
|
+
},
|
|
6125
|
+
|
|
6126
|
+
/**
|
|
6127
|
+
* @private
|
|
6128
|
+
*/
|
|
6129
|
+
buttonRel: {
|
|
6130
|
+
type: String,
|
|
6131
|
+
},
|
|
6132
|
+
};
|
|
6133
|
+
}
|
|
6134
|
+
|
|
6135
|
+
/**
|
|
6136
|
+
* This will register this element with the browser.
|
|
6137
|
+
* @param {string} [name="auro-button"] - The name of element that you want to register to.
|
|
6138
|
+
*
|
|
6139
|
+
* @example
|
|
6140
|
+
* AuroButton.register("custom-button") // this will register this element to <custom-button/>
|
|
6141
|
+
*
|
|
6142
|
+
*/
|
|
6143
|
+
static register(name = "auro-button") {
|
|
6144
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroButton);
|
|
6145
|
+
}
|
|
6146
|
+
|
|
6147
|
+
/**
|
|
6148
|
+
* Internal method to apply focus to the HTML5 button.
|
|
6149
|
+
* @private
|
|
6150
|
+
* @returns {void}
|
|
6151
|
+
*/
|
|
6152
|
+
focus() {
|
|
6153
|
+
this.renderRoot.querySelector('button').focus();
|
|
6154
|
+
}
|
|
6155
|
+
|
|
6156
|
+
/**
|
|
6157
|
+
* Submits the form that this button is associated with.
|
|
6158
|
+
* @private
|
|
6159
|
+
* @returns {void}
|
|
6160
|
+
*/
|
|
6161
|
+
surfaceSubmitEvent() {
|
|
6162
|
+
if (this.form) {
|
|
6163
|
+
this.form.requestSubmit();
|
|
6164
|
+
}
|
|
6165
|
+
}
|
|
6166
|
+
|
|
6167
|
+
/**
|
|
6168
|
+
* Returns the form element that this button is associated with.
|
|
6169
|
+
* @private
|
|
6170
|
+
* @returns {HTMLFormElement | null}
|
|
6171
|
+
*/
|
|
6172
|
+
get form() {
|
|
6173
|
+
return this.internals ? this.internals.form : null;
|
|
6174
|
+
}
|
|
6175
|
+
|
|
6176
|
+
/**
|
|
6177
|
+
* @private
|
|
6178
|
+
* @returns {Boolean}
|
|
6179
|
+
*/
|
|
6180
|
+
get hideText() {
|
|
6181
|
+
return ICON_ONLY_SHAPES.includes(this.shape);
|
|
6182
|
+
}
|
|
6183
|
+
|
|
6184
|
+
/**
|
|
6185
|
+
* Returns the current value of the projected `aria-label` attribute or undefined if not set.
|
|
6186
|
+
* @returns {string | undefined}
|
|
6187
|
+
* @private
|
|
6188
|
+
*/
|
|
6189
|
+
get currentAriaLabel() {
|
|
6190
|
+
if (!this.attributeWatcher) return undefined;
|
|
6191
|
+
|
|
6192
|
+
const ariaLabel = this.attributeWatcher.getObservedAttribute("aria-label");
|
|
6193
|
+
return ariaLabel || undefined;
|
|
6194
|
+
}
|
|
6195
|
+
|
|
6196
|
+
/**
|
|
6197
|
+
* Returns the current value of the projected `aria-labelledby` attribute or undefined if not set.
|
|
6198
|
+
* @returns {string | undefined}
|
|
6199
|
+
* @private
|
|
6200
|
+
*/
|
|
6201
|
+
get currentAriaLabelledBy() {
|
|
6202
|
+
if (!this.attributeWatcher) return undefined;
|
|
6203
|
+
|
|
6204
|
+
const ariaLabelledBy = this.attributeWatcher.getObservedAttribute("aria-labelledby");
|
|
6205
|
+
return ariaLabelledBy || undefined;
|
|
6206
|
+
}
|
|
6207
|
+
|
|
6208
|
+
/**
|
|
6209
|
+
* Renders the default layout for the button.
|
|
6210
|
+
* @returns {TemplateResult}
|
|
6211
|
+
* @private
|
|
6212
|
+
*/
|
|
6213
|
+
renderLayoutDefault() {
|
|
6214
|
+
const classes = {
|
|
6215
|
+
"util_insetLg--squish": true,
|
|
6216
|
+
"auro-button": true,
|
|
6217
|
+
"icon-only": this.hideText,
|
|
6218
|
+
wrapper: true,
|
|
6219
|
+
loading: this.loading,
|
|
6220
|
+
};
|
|
6221
|
+
|
|
6222
|
+
const tag = this.buttonHref ? literal`a` : literal`button`;
|
|
6223
|
+
const part = this.buttonHref ? 'link' : 'button';
|
|
6224
|
+
|
|
6225
|
+
return html`
|
|
6226
|
+
<${tag}
|
|
6227
|
+
part="${part}"
|
|
6228
|
+
aria-label="${ifDefined(this.loading ? this.loadingText : this.currentAriaLabel || undefined)}"
|
|
6229
|
+
aria-labelledby="${ifDefined(this.loading ? undefined : this.currentAriaLabelledBy || undefined)}"
|
|
6230
|
+
tabindex="${ifDefined(this.tIndex || this.tabindex)}"
|
|
6231
|
+
?autofocus="${this.autofocus}"
|
|
6232
|
+
class=${classMap(classes)}
|
|
6233
|
+
?disabled="${this.disabled || this.loading}"
|
|
6234
|
+
?onDark="${this.onDark}"
|
|
6235
|
+
title="${ifDefined(this.title ? this.title : undefined)}"
|
|
6236
|
+
name="${ifDefined(this.name ? this.name : undefined)}"
|
|
6237
|
+
type="${ifDefined(this.type ? this.type : undefined)}"
|
|
6238
|
+
variant="${ifDefined(this.variant ? this.variant : undefined)}"
|
|
6239
|
+
.value="${ifDefined(this.value ? this.value : undefined)}"
|
|
6240
|
+
@click="${this.type === 'submit' ? this.surfaceSubmitEvent : undefined}"
|
|
6241
|
+
href="${ifDefined(this.buttonHref || undefined)}"
|
|
6242
|
+
target="${ifDefined(this.buttonTarget || undefined)}"
|
|
6243
|
+
rel="${ifDefined(this.buttonRel || undefined)}"
|
|
6244
|
+
>
|
|
6245
|
+
${ifDefined(this.loading ? html`<${this.loaderTag} pulse part="loader"></${this.loaderTag}>` : undefined)}
|
|
6246
|
+
|
|
6247
|
+
<span class="contentWrapper">
|
|
6248
|
+
<span class="textSlot" part="text">
|
|
6249
|
+
<slot></slot>
|
|
6250
|
+
</span>
|
|
6251
|
+
</span>
|
|
6252
|
+
</${tag}>
|
|
6253
|
+
`;
|
|
6254
|
+
}
|
|
6255
|
+
|
|
6256
|
+
/**
|
|
6257
|
+
* Renders the layout of the button.
|
|
6258
|
+
* @returns {TemplateResult}
|
|
6259
|
+
* @private
|
|
6260
|
+
*/
|
|
6261
|
+
renderLayout() {
|
|
6262
|
+
return this.renderLayoutDefault();
|
|
6263
|
+
}
|
|
6264
|
+
}
|
|
6265
|
+
|
|
6266
|
+
var buttonVersion = '11.2.1';
|
|
6267
|
+
|
|
6268
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6269
|
+
// See LICENSE in the project root for license information.
|
|
6270
|
+
|
|
6271
|
+
|
|
6272
|
+
/**
|
|
6273
|
+
* @attr {Boolean} hidden - If present, the component will be hidden both visually and from screen readers
|
|
6274
|
+
* @attr {Boolean} hiddenVisually - If present, the component will be hidden visually, but still read by screen readers
|
|
6275
|
+
* @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
|
|
6276
|
+
*/
|
|
6277
|
+
|
|
6278
|
+
class AuroElement extends LitElement {
|
|
6279
|
+
|
|
6280
|
+
// function to define props used within the scope of this component
|
|
6281
|
+
static get properties() {
|
|
6282
|
+
return {
|
|
6283
|
+
hidden: { type: Boolean,
|
|
6284
|
+
reflect: true },
|
|
6285
|
+
hiddenVisually: { type: Boolean,
|
|
6286
|
+
reflect: true },
|
|
6287
|
+
hiddenAudible: { type: Boolean,
|
|
6288
|
+
reflect: true },
|
|
6289
|
+
};
|
|
6290
|
+
}
|
|
6291
|
+
|
|
6292
|
+
/**
|
|
6293
|
+
* @private Function that determines state of aria-hidden
|
|
6294
|
+
*/
|
|
6295
|
+
hideAudible(value) {
|
|
6296
|
+
if (value) {
|
|
6297
|
+
return 'true'
|
|
6298
|
+
}
|
|
6299
|
+
|
|
6300
|
+
return 'false'
|
|
6301
|
+
}
|
|
6302
|
+
}
|
|
6303
|
+
|
|
6304
|
+
var error = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"error__desc\" class=\"ico_squareLarge\" data-deprecated=\"true\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><desc id=\"error__desc\">Error alert indicator.</desc><path d=\"m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583\"/></svg>"};
|
|
6305
|
+
|
|
6306
|
+
/* eslint-disable no-underscore-dangle, jsdoc/no-undefined-types, jsdoc/require-param-description */
|
|
6307
|
+
|
|
6308
|
+
const _fetchMap = new Map();
|
|
6309
|
+
|
|
6310
|
+
/**
|
|
6311
|
+
* A callback to parse Response body.
|
|
6312
|
+
*
|
|
6313
|
+
* @callback ResponseParser
|
|
6314
|
+
* @param {Fetch.Response} response
|
|
6315
|
+
* @returns {Promise}
|
|
6316
|
+
*/
|
|
6317
|
+
|
|
6318
|
+
/**
|
|
6319
|
+
* A minimal in-memory map to de-duplicate Fetch API media requests.
|
|
6320
|
+
*
|
|
6321
|
+
* @param {String} uri
|
|
6322
|
+
* @param {Object} [options={}]
|
|
6323
|
+
* @param {ResponseParser} [options.responseParser=(response) => response.text()]
|
|
6324
|
+
* @returns {Promise}
|
|
6325
|
+
*/
|
|
6326
|
+
const cacheFetch = (uri, options = {}) => {
|
|
6327
|
+
const responseParser = options.responseParser || ((response) => response.text());
|
|
6328
|
+
if (!_fetchMap.has(uri)) {
|
|
6329
|
+
_fetchMap.set(uri, fetch(uri).then(responseParser));
|
|
6330
|
+
}
|
|
6331
|
+
return _fetchMap.get(uri);
|
|
6332
|
+
};
|
|
6333
|
+
|
|
6334
|
+
var styleCss$1$1 = css`: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}`;
|
|
6335
|
+
|
|
6336
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6337
|
+
// See LICENSE in the project root for license information.
|
|
6338
|
+
|
|
6339
|
+
|
|
6340
|
+
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
6341
|
+
/**
|
|
6342
|
+
* @slot - Hidden from visibility, used for a11y if icon description is needed
|
|
6343
|
+
*/
|
|
6344
|
+
|
|
6345
|
+
// build the component class
|
|
6346
|
+
class BaseIcon extends AuroElement {
|
|
6347
|
+
constructor() {
|
|
6348
|
+
super();
|
|
6349
|
+
this.onDark = false;
|
|
6350
|
+
}
|
|
6351
|
+
|
|
6352
|
+
// function to define props used within the scope of this component
|
|
6353
|
+
static get properties() {
|
|
6354
|
+
return {
|
|
6355
|
+
...super.properties,
|
|
6356
|
+
|
|
6357
|
+
/**
|
|
6358
|
+
* Set value for on-dark version of auro-icon.
|
|
6359
|
+
*/
|
|
6360
|
+
onDark: {
|
|
6361
|
+
type: Boolean,
|
|
6362
|
+
reflect: true
|
|
6363
|
+
},
|
|
6364
|
+
|
|
6365
|
+
/**
|
|
6366
|
+
* @private
|
|
6367
|
+
*/
|
|
6368
|
+
svg: {
|
|
6369
|
+
attribute: false,
|
|
6370
|
+
reflect: true
|
|
6371
|
+
}
|
|
6372
|
+
};
|
|
6373
|
+
}
|
|
6374
|
+
|
|
6375
|
+
static get styles() {
|
|
6376
|
+
return css`
|
|
6377
|
+
${styleCss$1$1}
|
|
6378
|
+
`;
|
|
6379
|
+
}
|
|
6380
|
+
|
|
6381
|
+
/**
|
|
6382
|
+
* Async function to fetch requested icon from npm CDN.
|
|
6383
|
+
* @private
|
|
6384
|
+
* @param {string} category - Icon category.
|
|
6385
|
+
* @param {string} name - Icon name.
|
|
6386
|
+
* @returns {SVGElement} DOM - Ready HTML to be appended.
|
|
6387
|
+
*/
|
|
6388
|
+
async fetchIcon(category, name) {
|
|
6389
|
+
let iconHTML = '';
|
|
6390
|
+
|
|
6391
|
+
if (category === 'logos') {
|
|
6392
|
+
iconHTML = await cacheFetch(`${this.uri}/${category}/${name}.svg`);
|
|
6393
|
+
} else {
|
|
6394
|
+
iconHTML = await cacheFetch(`${this.uri}/icons/${category}/${name}.svg`);
|
|
6395
|
+
}
|
|
6396
|
+
|
|
6397
|
+
const dom = new DOMParser().parseFromString(iconHTML, 'text/html');
|
|
6398
|
+
|
|
6399
|
+
return dom.body.querySelector('svg');
|
|
6400
|
+
}
|
|
6401
|
+
|
|
6402
|
+
// lifecycle function
|
|
6403
|
+
async firstUpdated() {
|
|
6404
|
+
if (!this.customSvg) {
|
|
6405
|
+
const svg = await this.fetchIcon(this.category, this.name);
|
|
6406
|
+
|
|
6407
|
+
if (svg) {
|
|
6408
|
+
this.svg = svg;
|
|
6409
|
+
} else if (!svg) {
|
|
6410
|
+
const penDOM = new DOMParser().parseFromString(error.svg, 'text/html');
|
|
6411
|
+
|
|
6412
|
+
this.svg = penDOM.body.firstChild;
|
|
6413
|
+
}
|
|
6414
|
+
}
|
|
6415
|
+
}
|
|
6416
|
+
}
|
|
6417
|
+
|
|
6418
|
+
var tokensCss$3 = css`: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)}`;
|
|
6419
|
+
|
|
6420
|
+
var colorCss$4 = css`: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)}`;
|
|
6421
|
+
|
|
6422
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6423
|
+
// See LICENSE in the project root for license information.
|
|
6424
|
+
|
|
6425
|
+
// ---------------------------------------------------------------------
|
|
6426
|
+
|
|
6427
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
6428
|
+
|
|
6429
|
+
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
6430
|
+
|
|
6431
|
+
/* eslint-disable jsdoc/require-param */
|
|
6432
|
+
|
|
6433
|
+
/**
|
|
6434
|
+
* This will register a new custom element with the browser.
|
|
6435
|
+
* @param {String} name - The name of the custom element.
|
|
6436
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
6437
|
+
* @returns {void}
|
|
6438
|
+
*/
|
|
6439
|
+
registerComponent(name, componentClass) {
|
|
6440
|
+
if (!customElements.get(name)) {
|
|
6441
|
+
customElements.define(name, class extends componentClass {});
|
|
6442
|
+
}
|
|
6443
|
+
}
|
|
6444
|
+
|
|
6445
|
+
/**
|
|
6446
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
6447
|
+
* @returns {void}
|
|
6448
|
+
*/
|
|
6449
|
+
closestElement(
|
|
6450
|
+
selector, // selector like in .closest()
|
|
6451
|
+
base = this, // extra functionality to skip a parent
|
|
6452
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
6453
|
+
!el || el === document || el === window
|
|
6454
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
6455
|
+
: found
|
|
6456
|
+
? found // found a selector INside this element
|
|
6457
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
6458
|
+
) {
|
|
6459
|
+
return __Closest(base);
|
|
6460
|
+
}
|
|
6461
|
+
/* eslint-enable jsdoc/require-param */
|
|
6462
|
+
|
|
6463
|
+
/**
|
|
6464
|
+
* 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.
|
|
6465
|
+
* @param {Object} elem - The element to check.
|
|
6466
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
6467
|
+
* @returns {void}
|
|
6468
|
+
*/
|
|
6469
|
+
handleComponentTagRename(elem, tagName) {
|
|
6470
|
+
const tag = tagName.toLowerCase();
|
|
6471
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6472
|
+
|
|
6473
|
+
if (elemTag !== tag) {
|
|
6474
|
+
elem.setAttribute(tag, true);
|
|
6475
|
+
}
|
|
6476
|
+
}
|
|
6477
|
+
|
|
6478
|
+
/**
|
|
6479
|
+
* Validates if an element is a specific Auro component.
|
|
6480
|
+
* @param {Object} elem - The element to validate.
|
|
6481
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
6482
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
6483
|
+
*/
|
|
6484
|
+
elementMatch(elem, tagName) {
|
|
6485
|
+
const tag = tagName.toLowerCase();
|
|
6486
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6487
|
+
|
|
6488
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
6489
|
+
}
|
|
6490
|
+
};
|
|
6491
|
+
|
|
6492
|
+
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6493
|
+
// See LICENSE in the project root for license information.
|
|
6494
|
+
|
|
6495
|
+
|
|
6496
|
+
class AuroIcon extends BaseIcon {
|
|
6497
|
+
constructor() {
|
|
6498
|
+
super();
|
|
6499
|
+
|
|
6500
|
+
this.variant = undefined;
|
|
6501
|
+
this.privateDefaults();
|
|
6502
|
+
}
|
|
6503
|
+
|
|
6504
|
+
/**
|
|
6505
|
+
* Internal Defaults.
|
|
6506
|
+
* @private
|
|
6507
|
+
* @returns {void}
|
|
6508
|
+
*/
|
|
6509
|
+
privateDefaults() {
|
|
6510
|
+
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
6511
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
6512
|
+
}
|
|
6513
|
+
|
|
6514
|
+
// function to define props used within the scope of this component
|
|
6515
|
+
static get properties() {
|
|
6516
|
+
return {
|
|
6517
|
+
...super.properties,
|
|
6518
|
+
|
|
6519
|
+
/**
|
|
6520
|
+
* Set aria-hidden value. Default is `true`. Option is `false`.
|
|
6521
|
+
*/
|
|
6522
|
+
ariaHidden: {
|
|
6523
|
+
type: String,
|
|
6524
|
+
reflect: true
|
|
6525
|
+
},
|
|
6526
|
+
|
|
6527
|
+
/**
|
|
6528
|
+
* The category of the icon you are looking for. See https://auro.alaskaair.com/icons/usage.
|
|
6529
|
+
*/
|
|
6530
|
+
category: {
|
|
6531
|
+
type: String,
|
|
6532
|
+
reflect: true
|
|
6533
|
+
},
|
|
6534
|
+
|
|
6535
|
+
/**
|
|
6536
|
+
* Allows custom color to be set.
|
|
6537
|
+
*/
|
|
6538
|
+
customColor: {
|
|
6539
|
+
type: Boolean
|
|
6540
|
+
},
|
|
6541
|
+
|
|
6542
|
+
/**
|
|
6543
|
+
* When true, auro-icon will render a custom SVG inside the default slot.
|
|
6544
|
+
*/
|
|
6545
|
+
customSvg: {
|
|
6546
|
+
type: Boolean
|
|
6547
|
+
},
|
|
6548
|
+
|
|
6549
|
+
/**
|
|
6550
|
+
* Exposes content in slot as icon label.
|
|
6551
|
+
*/
|
|
6552
|
+
label: {
|
|
6553
|
+
type: Boolean,
|
|
6554
|
+
reflect: true
|
|
6555
|
+
},
|
|
6556
|
+
|
|
6557
|
+
/**
|
|
6558
|
+
* The name of the icon you are looking for without the file extension. See https://auro.alaskaair.com/icons/usage.
|
|
6559
|
+
*/
|
|
6560
|
+
name: {
|
|
6561
|
+
type: String,
|
|
6562
|
+
reflect: true
|
|
6563
|
+
},
|
|
6564
|
+
|
|
6565
|
+
/**
|
|
6566
|
+
* The style of the icon. The accepted variants are `accent1`, `disabled`, `muted`, `statusDefault`, `statusInfo`, `statusSuccess`, `statusWarning`, `statusError`, `statusInfoSubtle`, `statusSuccessSubtle`, `statusWarningSubtle`, `statusErrorSubtle`, `fareBasicEconomy`, `fareBusiness`, `fareEconomy`, `fareFirst`, `farePremiumEconomy`, `tierOneWorldEmerald`, `tierOneWorldSapphire`, `tierOneWorldRuby`.
|
|
6567
|
+
*/
|
|
6568
|
+
variant: {
|
|
6569
|
+
type: String,
|
|
6570
|
+
reflect: true
|
|
5261
6571
|
}
|
|
5262
6572
|
};
|
|
5263
6573
|
}
|
|
@@ -5265,9 +6575,9 @@ class AuroIcon extends BaseIcon {
|
|
|
5265
6575
|
static get styles() {
|
|
5266
6576
|
return [
|
|
5267
6577
|
super.styles,
|
|
5268
|
-
css`${tokensCss}`,
|
|
5269
|
-
css`${styleCss$1}`,
|
|
5270
|
-
css`${colorCss}`
|
|
6578
|
+
css`${tokensCss$3}`,
|
|
6579
|
+
css`${styleCss$1$1}`,
|
|
6580
|
+
css`${colorCss$4}`
|
|
5271
6581
|
];
|
|
5272
6582
|
}
|
|
5273
6583
|
|
|
@@ -5280,7 +6590,7 @@ class AuroIcon extends BaseIcon {
|
|
|
5280
6590
|
*
|
|
5281
6591
|
*/
|
|
5282
6592
|
static register(name = "auro-icon") {
|
|
5283
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroIcon);
|
|
6593
|
+
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroIcon);
|
|
5284
6594
|
}
|
|
5285
6595
|
|
|
5286
6596
|
connectedCallback() {
|
|
@@ -5301,8 +6611,12 @@ class AuroIcon extends BaseIcon {
|
|
|
5301
6611
|
async firstUpdated() {
|
|
5302
6612
|
await super.firstUpdated();
|
|
5303
6613
|
|
|
5304
|
-
|
|
5305
|
-
|
|
6614
|
+
/**
|
|
6615
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
6616
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
6617
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
6618
|
+
*/
|
|
6619
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
5306
6620
|
const svgDesc = this.svg.querySelector('desc');
|
|
5307
6621
|
|
|
5308
6622
|
if (svgDesc) {
|
|
@@ -5346,9 +6660,79 @@ class AuroIcon extends BaseIcon {
|
|
|
5346
6660
|
}
|
|
5347
6661
|
}
|
|
5348
6662
|
|
|
5349
|
-
var iconVersion = '8.0.
|
|
6663
|
+
var iconVersion = '8.0.4';
|
|
6664
|
+
|
|
6665
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6666
|
+
// See LICENSE in the project root for license information.
|
|
6667
|
+
|
|
6668
|
+
// ---------------------------------------------------------------------
|
|
6669
|
+
|
|
6670
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
6671
|
+
|
|
6672
|
+
let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
6673
|
+
|
|
6674
|
+
/* eslint-disable jsdoc/require-param */
|
|
6675
|
+
|
|
6676
|
+
/**
|
|
6677
|
+
* This will register a new custom element with the browser.
|
|
6678
|
+
* @param {String} name - The name of the custom element.
|
|
6679
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
6680
|
+
* @returns {void}
|
|
6681
|
+
*/
|
|
6682
|
+
registerComponent(name, componentClass) {
|
|
6683
|
+
if (!customElements.get(name)) {
|
|
6684
|
+
customElements.define(name, class extends componentClass {});
|
|
6685
|
+
}
|
|
6686
|
+
}
|
|
6687
|
+
|
|
6688
|
+
/**
|
|
6689
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
6690
|
+
* @returns {void}
|
|
6691
|
+
*/
|
|
6692
|
+
closestElement(
|
|
6693
|
+
selector, // selector like in .closest()
|
|
6694
|
+
base = this, // extra functionality to skip a parent
|
|
6695
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
6696
|
+
!el || el === document || el === window
|
|
6697
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
6698
|
+
: found
|
|
6699
|
+
? found // found a selector INside this element
|
|
6700
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
6701
|
+
) {
|
|
6702
|
+
return __Closest(base);
|
|
6703
|
+
}
|
|
6704
|
+
/* eslint-enable jsdoc/require-param */
|
|
6705
|
+
|
|
6706
|
+
/**
|
|
6707
|
+
* 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.
|
|
6708
|
+
* @param {Object} elem - The element to check.
|
|
6709
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
6710
|
+
* @returns {void}
|
|
6711
|
+
*/
|
|
6712
|
+
handleComponentTagRename(elem, tagName) {
|
|
6713
|
+
const tag = tagName.toLowerCase();
|
|
6714
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6715
|
+
|
|
6716
|
+
if (elemTag !== tag) {
|
|
6717
|
+
elem.setAttribute(tag, true);
|
|
6718
|
+
}
|
|
6719
|
+
}
|
|
6720
|
+
|
|
6721
|
+
/**
|
|
6722
|
+
* Validates if an element is a specific Auro component.
|
|
6723
|
+
* @param {Object} elem - The element to validate.
|
|
6724
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
6725
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
6726
|
+
*/
|
|
6727
|
+
elementMatch(elem, tagName) {
|
|
6728
|
+
const tag = tagName.toLowerCase();
|
|
6729
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6730
|
+
|
|
6731
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
6732
|
+
}
|
|
6733
|
+
};
|
|
5350
6734
|
|
|
5351
|
-
var styleCss$
|
|
6735
|
+
var styleCss$5 = css`.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)}`;
|
|
5352
6736
|
|
|
5353
6737
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5354
6738
|
// See LICENSE in the project root for license information.
|
|
@@ -5377,7 +6761,7 @@ class AuroHeader extends LitElement {
|
|
|
5377
6761
|
/**
|
|
5378
6762
|
* @private
|
|
5379
6763
|
*/
|
|
5380
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
6764
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$4();
|
|
5381
6765
|
}
|
|
5382
6766
|
|
|
5383
6767
|
// function to define props used within the scope of this component
|
|
@@ -5395,7 +6779,7 @@ class AuroHeader extends LitElement {
|
|
|
5395
6779
|
}
|
|
5396
6780
|
|
|
5397
6781
|
static get styles() {
|
|
5398
|
-
return [styleCss$
|
|
6782
|
+
return [styleCss$5];
|
|
5399
6783
|
}
|
|
5400
6784
|
|
|
5401
6785
|
/**
|
|
@@ -5407,7 +6791,7 @@ class AuroHeader extends LitElement {
|
|
|
5407
6791
|
*
|
|
5408
6792
|
*/
|
|
5409
6793
|
static register(name = "auro-header") {
|
|
5410
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroHeader);
|
|
6794
|
+
AuroLibraryRuntimeUtils$4.prototype.registerComponent(name, AuroHeader);
|
|
5411
6795
|
}
|
|
5412
6796
|
|
|
5413
6797
|
firstUpdated() {
|
|
@@ -5503,17 +6887,30 @@ class AuroBibtemplate extends LitElement {
|
|
|
5503
6887
|
|
|
5504
6888
|
this.large = false;
|
|
5505
6889
|
|
|
5506
|
-
AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-bibtemplate');
|
|
6890
|
+
AuroLibraryRuntimeUtils$3.prototype.handleComponentTagRename(this, 'auro-bibtemplate');
|
|
5507
6891
|
|
|
5508
6892
|
const versioning = new AuroDependencyVersioning();
|
|
6893
|
+
|
|
6894
|
+
/**
|
|
6895
|
+
* @private
|
|
6896
|
+
*/
|
|
5509
6897
|
this.iconTag = versioning.generateTag('auro-formkit-bibtemplate-icon', iconVersion, AuroIcon);
|
|
6898
|
+
|
|
6899
|
+
/**
|
|
6900
|
+
* @private
|
|
6901
|
+
*/
|
|
5510
6902
|
this.headerTag = versioning.generateTag('auro-formkit-bibtemplate-header', headerVersion, AuroHeader);
|
|
6903
|
+
|
|
6904
|
+
/**
|
|
6905
|
+
* @private
|
|
6906
|
+
*/
|
|
6907
|
+
this.buttonTag = versioning.generateTag('auro-formkit-input-button', buttonVersion, AuroButton);
|
|
5511
6908
|
}
|
|
5512
6909
|
|
|
5513
6910
|
static get styles() {
|
|
5514
6911
|
return [
|
|
5515
|
-
colorCss$
|
|
5516
|
-
styleCss$
|
|
6912
|
+
colorCss$3,
|
|
6913
|
+
styleCss$4,
|
|
5517
6914
|
tokenCss
|
|
5518
6915
|
];
|
|
5519
6916
|
}
|
|
@@ -5542,7 +6939,7 @@ class AuroBibtemplate extends LitElement {
|
|
|
5542
6939
|
*
|
|
5543
6940
|
*/
|
|
5544
6941
|
static register(name = "auro-bibtemplate") {
|
|
5545
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroBibtemplate);
|
|
6942
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroBibtemplate);
|
|
5546
6943
|
}
|
|
5547
6944
|
|
|
5548
6945
|
/**
|
|
@@ -5582,15 +6979,27 @@ class AuroBibtemplate extends LitElement {
|
|
|
5582
6979
|
this.setAttribute('exportparts', 'bibtemplate:dropdownBibTemplate');
|
|
5583
6980
|
}
|
|
5584
6981
|
|
|
6982
|
+
firstUpdated(changedProperties) {
|
|
6983
|
+
super.firstUpdated(changedProperties);
|
|
6984
|
+
|
|
6985
|
+
this.dispatchEvent(new CustomEvent("auro-bibtemplate-connected", {
|
|
6986
|
+
bubbles: true,
|
|
6987
|
+
composed: true,
|
|
6988
|
+
detail: {
|
|
6989
|
+
element: this
|
|
6990
|
+
}
|
|
6991
|
+
}));
|
|
6992
|
+
}
|
|
6993
|
+
|
|
5585
6994
|
// function that renders the HTML and CSS into the scope of the component
|
|
5586
6995
|
render() {
|
|
5587
6996
|
return html`
|
|
5588
6997
|
<div id="bibTemplate" part="bibtemplate">
|
|
5589
6998
|
${this.isFullscreen ? html`
|
|
5590
6999
|
<div id="headerContainer">
|
|
5591
|
-
|
|
7000
|
+
<${this.buttonTag} id="closeButton" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
5592
7001
|
<${this.iconTag} category="interface" name="x-lg"></${this.iconTag}>
|
|
5593
|
-
|
|
7002
|
+
</${this.buttonTag}>
|
|
5594
7003
|
<${this.headerTag} display="${this.large ? 'display' : '600'}" level="3" size="none" id="header" no-margin-block>
|
|
5595
7004
|
<slot name="header"></slot>
|
|
5596
7005
|
</${this.headerTag}>
|
|
@@ -5614,11 +7023,219 @@ class AuroBibtemplate extends LitElement {
|
|
|
5614
7023
|
|
|
5615
7024
|
var bibTemplateVersion = '1.0.0';
|
|
5616
7025
|
|
|
5617
|
-
|
|
7026
|
+
var colorCss = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
7027
|
+
|
|
7028
|
+
var styleCss$1 = css`.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
7029
|
+
|
|
7030
|
+
var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
7031
|
+
|
|
7032
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
7033
|
+
// See LICENSE in the project root for license information.
|
|
7034
|
+
|
|
7035
|
+
// ---------------------------------------------------------------------
|
|
7036
|
+
|
|
7037
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
7038
|
+
|
|
7039
|
+
class AuroLibraryRuntimeUtils {
|
|
7040
|
+
|
|
7041
|
+
/* eslint-disable jsdoc/require-param */
|
|
7042
|
+
|
|
7043
|
+
/**
|
|
7044
|
+
* This will register a new custom element with the browser.
|
|
7045
|
+
* @param {String} name - The name of the custom element.
|
|
7046
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
7047
|
+
* @returns {void}
|
|
7048
|
+
*/
|
|
7049
|
+
registerComponent(name, componentClass) {
|
|
7050
|
+
if (!customElements.get(name)) {
|
|
7051
|
+
customElements.define(name, class extends componentClass {});
|
|
7052
|
+
}
|
|
7053
|
+
}
|
|
7054
|
+
|
|
7055
|
+
/**
|
|
7056
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
7057
|
+
* @returns {void}
|
|
7058
|
+
*/
|
|
7059
|
+
closestElement(
|
|
7060
|
+
selector, // selector like in .closest()
|
|
7061
|
+
base = this, // extra functionality to skip a parent
|
|
7062
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
7063
|
+
!el || el === document || el === window
|
|
7064
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
7065
|
+
: found
|
|
7066
|
+
? found // found a selector INside this element
|
|
7067
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
7068
|
+
) {
|
|
7069
|
+
return __Closest(base);
|
|
7070
|
+
}
|
|
7071
|
+
/* eslint-enable jsdoc/require-param */
|
|
7072
|
+
|
|
7073
|
+
/**
|
|
7074
|
+
* 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.
|
|
7075
|
+
* @param {Object} elem - The element to check.
|
|
7076
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
7077
|
+
* @returns {void}
|
|
7078
|
+
*/
|
|
7079
|
+
handleComponentTagRename(elem, tagName) {
|
|
7080
|
+
const tag = tagName.toLowerCase();
|
|
7081
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
7082
|
+
|
|
7083
|
+
if (elemTag !== tag) {
|
|
7084
|
+
elem.setAttribute(tag, true);
|
|
7085
|
+
}
|
|
7086
|
+
}
|
|
7087
|
+
|
|
7088
|
+
/**
|
|
7089
|
+
* Validates if an element is a specific Auro component.
|
|
7090
|
+
* @param {Object} elem - The element to validate.
|
|
7091
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
7092
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
7093
|
+
*/
|
|
7094
|
+
elementMatch(elem, tagName) {
|
|
7095
|
+
const tag = tagName.toLowerCase();
|
|
7096
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
7097
|
+
|
|
7098
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
7099
|
+
}
|
|
7100
|
+
}
|
|
7101
|
+
|
|
7102
|
+
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7103
|
+
// See LICENSE in the project root for license information.
|
|
7104
|
+
|
|
7105
|
+
|
|
7106
|
+
/**
|
|
7107
|
+
* Displays help text or error messages within form elements - Internal Use Only.
|
|
7108
|
+
*
|
|
7109
|
+
* @attr { Boolean } large - If declared, make font-size to 1rem(16px).
|
|
7110
|
+
*/
|
|
7111
|
+
class AuroHelpText extends LitElement {
|
|
7112
|
+
|
|
7113
|
+
constructor() {
|
|
7114
|
+
super();
|
|
7115
|
+
|
|
7116
|
+
this.error = false;
|
|
7117
|
+
this.onDark = false;
|
|
7118
|
+
this.hasTextContent = false;
|
|
7119
|
+
|
|
7120
|
+
AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-helptext');
|
|
7121
|
+
}
|
|
7122
|
+
|
|
7123
|
+
static get styles() {
|
|
7124
|
+
return [
|
|
7125
|
+
colorCss,
|
|
7126
|
+
styleCss$1,
|
|
7127
|
+
tokensCss
|
|
7128
|
+
];
|
|
7129
|
+
}
|
|
7130
|
+
|
|
7131
|
+
// function to define props used within the scope of this component
|
|
7132
|
+
static get properties() {
|
|
7133
|
+
return {
|
|
7134
|
+
|
|
7135
|
+
/**
|
|
7136
|
+
* @private
|
|
7137
|
+
*/
|
|
7138
|
+
slotNodes: {
|
|
7139
|
+
type: Boolean,
|
|
7140
|
+
},
|
|
7141
|
+
|
|
7142
|
+
/**
|
|
7143
|
+
* @private
|
|
7144
|
+
*/
|
|
7145
|
+
hasTextContent: {
|
|
7146
|
+
type: Boolean,
|
|
7147
|
+
},
|
|
7148
|
+
|
|
7149
|
+
/**
|
|
7150
|
+
* If declared, make font color red.
|
|
7151
|
+
*/
|
|
7152
|
+
error: {
|
|
7153
|
+
type: Boolean,
|
|
7154
|
+
reflect: true,
|
|
7155
|
+
},
|
|
7156
|
+
|
|
7157
|
+
/**
|
|
7158
|
+
* If declared, will apply onDark styles.
|
|
7159
|
+
*/
|
|
7160
|
+
onDark: {
|
|
7161
|
+
type: Boolean,
|
|
7162
|
+
reflect: true
|
|
7163
|
+
}
|
|
7164
|
+
};
|
|
7165
|
+
}
|
|
7166
|
+
|
|
7167
|
+
/**
|
|
7168
|
+
* This will register this element with the browser.
|
|
7169
|
+
* @param {string} [name="auro-helptext"] - The name of element that you want to register to.
|
|
7170
|
+
*
|
|
7171
|
+
* @example
|
|
7172
|
+
* AuroCheckbox.register("custom-helptext") // this will register this element to <custom-helptext/>
|
|
7173
|
+
*
|
|
7174
|
+
*/
|
|
7175
|
+
static register(name = "auro-helptext") {
|
|
7176
|
+
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroHelpText);
|
|
7177
|
+
}
|
|
7178
|
+
|
|
7179
|
+
updated() {
|
|
7180
|
+
this.handleSlotChange();
|
|
7181
|
+
}
|
|
7182
|
+
|
|
7183
|
+
handleSlotChange(event) {
|
|
7184
|
+
if (event) {
|
|
7185
|
+
this.slotNodes = event.target.assignedNodes();
|
|
7186
|
+
}
|
|
7187
|
+
|
|
7188
|
+
this.hasTextContent = this.checkSlotsForContent(this.slotNodes);
|
|
7189
|
+
}
|
|
7190
|
+
|
|
7191
|
+
/**
|
|
7192
|
+
* Checks if any of the provided nodes or their nested slot nodes contain non-empty text content.
|
|
7193
|
+
*
|
|
7194
|
+
* @param {NodeList|Array} nodes - The list of nodes to check for content.
|
|
7195
|
+
* @returns {boolean} - Returns true if any node or nested slot node contains non-empty text content, otherwise false.
|
|
7196
|
+
* @private
|
|
7197
|
+
*/
|
|
7198
|
+
checkSlotsForContent(nodes) {
|
|
7199
|
+
if (!nodes) {
|
|
7200
|
+
return false;
|
|
7201
|
+
}
|
|
7202
|
+
|
|
7203
|
+
return nodes.some((node) => {
|
|
7204
|
+
if (node.textContent.trim()) {
|
|
7205
|
+
return true;
|
|
7206
|
+
}
|
|
7207
|
+
|
|
7208
|
+
if (!node.querySelector) {
|
|
7209
|
+
return false;
|
|
7210
|
+
}
|
|
7211
|
+
|
|
7212
|
+
const nestedSlot = node.tagName === 'SLOT' ? node : node.querySelector('slot');
|
|
7213
|
+
if (!nestedSlot) {
|
|
7214
|
+
return false;
|
|
7215
|
+
}
|
|
7216
|
+
|
|
7217
|
+
const nestedSlotNodes = nestedSlot.assignedNodes();
|
|
7218
|
+
return this.checkSlotsForContent(nestedSlotNodes);
|
|
7219
|
+
});
|
|
7220
|
+
}
|
|
7221
|
+
|
|
7222
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
7223
|
+
render() {
|
|
7224
|
+
return html$1`
|
|
7225
|
+
<div class="helptext-wrapper" ?visible="${this.hasTextContent}">
|
|
7226
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
7227
|
+
</div>
|
|
7228
|
+
`;
|
|
7229
|
+
}
|
|
7230
|
+
}
|
|
7231
|
+
|
|
7232
|
+
var helpTextVersion = '1.0.0';
|
|
7233
|
+
|
|
7234
|
+
css`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:block;vertical-align:middle}:host .wrapper{box-sizing:border-box;display:inline-block;width:100%;margin:0;padding:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host [loadingplaceholder].empty{opacity:0;position:absolute}:host [loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;line-height:1;display:inline-block}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]){overflow-y:auto}:host([root]) .wrapper[class*=-lg]{padding:var(--ds-size-150, 0.75rem)}:host([root]) .wrapper[class*=-xl]{padding:var(--ds-size-200, 1rem)}`;
|
|
5618
7235
|
|
|
5619
7236
|
css`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-divider-color)}[loadingplaceholder] slot[name=loadingIcon]{color:var(--ds-auro-menu-loader-color)}[loadingplaceholder] slot[name=loadingText]{color:var(--ds-auro-menu-loader-text-color)}`;
|
|
5620
7237
|
|
|
5621
|
-
css`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
7238
|
+
css`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
5622
7239
|
|
|
5623
7240
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5624
7241
|
// See LICENSE in the project root for license information.
|
|
@@ -5665,9 +7282,9 @@ function arrayConverter(value) {
|
|
|
5665
7282
|
throw new Error('Invalid value: Input must be an array or undefined');
|
|
5666
7283
|
}
|
|
5667
7284
|
|
|
5668
|
-
css`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-
|
|
7285
|
+
css`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem));padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-50, 0.25rem);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box],:host .wrapper[class*=shape-snowflake]{border-radius:unset}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem);margin-bottom:var(--ds-size-50, 0.25rem)}:host .wrapper[class*=-xl]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem);margin-bottom:var(--ds-size-100, 0.5rem)}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
5669
7286
|
|
|
5670
|
-
css`: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)}`;
|
|
7287
|
+
css`:host .wrapper{border:1px solid var(--ds-auro-menuoption-container-border-color);background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
5671
7288
|
|
|
5672
7289
|
css`: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}`;
|
|
5673
7290
|
|
|
@@ -5675,7 +7292,7 @@ css`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);-
|
|
|
5675
7292
|
|
|
5676
7293
|
css`: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)}`;
|
|
5677
7294
|
|
|
5678
|
-
var styleCss = css
|
|
7295
|
+
var styleCss = css`.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:1;flex-direction:column;align-items:center;justify-content:center}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;align-items:center;justify-content:center}::slotted([slot=typeIcon]){margin-right:8px}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;width:100%;align-items:center;justify-content:center}:host([layout*=emphasized]) .triggerContent,:host([layout*=snowflake]) .triggerContent{padding:0 8px 0 24px}:host([layout*=classic]) .triggerContent{padding:0 8px}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{cursor:text;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host([layout*=classic]) label.withValue{font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([layout*=classic]) .value{height:auto;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
|
|
5679
7296
|
|
|
5680
7297
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5681
7298
|
// See LICENSE in the project root for license information.
|
|
@@ -5690,14 +7307,16 @@ var styleCss = css`:focus:not(:focus-visible){outline:3px solid transparent}.uti
|
|
|
5690
7307
|
* @slot label - Defines the content of the label.
|
|
5691
7308
|
* @slot helpText - Defines the content of the helpText.
|
|
5692
7309
|
* @slot placeholder - Defines the content of the placeholder to be shown when there is no value
|
|
7310
|
+
* @slot valueText - Dropdown value text display.
|
|
7311
|
+
* @slot displayValue - Allows custom HTML content to display the selected value when select is not focused.
|
|
5693
7312
|
* @event auroSelect-valueSet - Notifies that the component has a new value set.
|
|
5694
|
-
* @event input - Notifies every time the value prop of the element is changed.
|
|
7313
|
+
* @event input - Notifies every time the value prop of the element is changed. The updated `value` and `optionSelected` will be delivered in `detail` object.
|
|
5695
7314
|
* @event auroFormElement-validated - Notifies that the `validity` and `errorMessage` values have changed.
|
|
5696
7315
|
* @csspart helpText - Apply CSS to the help text.
|
|
5697
7316
|
*/
|
|
5698
7317
|
|
|
5699
7318
|
// build the component class
|
|
5700
|
-
class AuroSelect extends
|
|
7319
|
+
class AuroSelect extends AuroElement$3 {
|
|
5701
7320
|
constructor() {
|
|
5702
7321
|
super();
|
|
5703
7322
|
|
|
@@ -5707,12 +7326,25 @@ class AuroSelect extends LitElement {
|
|
|
5707
7326
|
const idSubstrEnd = 8;
|
|
5708
7327
|
const idSubstrStart = 2;
|
|
5709
7328
|
|
|
7329
|
+
this.matchWidth = false;
|
|
7330
|
+
|
|
7331
|
+
// Layout Config
|
|
7332
|
+
this.layout = 'snowflake';
|
|
7333
|
+
this.shape = 'snowflake';
|
|
7334
|
+
this.size = 'xl';
|
|
7335
|
+
|
|
5710
7336
|
// floaterConfig
|
|
5711
7337
|
this.placement = 'bottom-start';
|
|
5712
7338
|
this.offset = 0;
|
|
5713
7339
|
this.noFlip = false;
|
|
5714
7340
|
this.autoPlacement = false;
|
|
5715
7341
|
|
|
7342
|
+
this.forceDisplayValue = false;
|
|
7343
|
+
|
|
7344
|
+
this.layout = 'classic';
|
|
7345
|
+
this.shape = 'classic';
|
|
7346
|
+
this.size = 'xl';
|
|
7347
|
+
|
|
5716
7348
|
/**
|
|
5717
7349
|
* @private
|
|
5718
7350
|
*/
|
|
@@ -5728,7 +7360,7 @@ class AuroSelect extends LitElement {
|
|
|
5728
7360
|
/**
|
|
5729
7361
|
* @private
|
|
5730
7362
|
*/
|
|
5731
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
7363
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
5732
7364
|
|
|
5733
7365
|
/**
|
|
5734
7366
|
* Generate unique names for dependency components.
|
|
@@ -5745,10 +7377,25 @@ class AuroSelect extends LitElement {
|
|
|
5745
7377
|
*/
|
|
5746
7378
|
this.bibtemplateTag = versioning.generateTag('auro-formkit-select-bibtemplate', bibTemplateVersion, AuroBibtemplate);
|
|
5747
7379
|
|
|
7380
|
+
/**
|
|
7381
|
+
* @private
|
|
7382
|
+
*/
|
|
7383
|
+
this.helpTextTag = versioning.generateTag('auro-formkit-input-helptext', helpTextVersion, AuroHelpText);
|
|
7384
|
+
|
|
5748
7385
|
/**
|
|
5749
7386
|
* @private
|
|
5750
7387
|
*/
|
|
5751
7388
|
this.isHiddenWhileLoading = false;
|
|
7389
|
+
|
|
7390
|
+
/**
|
|
7391
|
+
* @private
|
|
7392
|
+
*/
|
|
7393
|
+
this.hasFocus = false;
|
|
7394
|
+
|
|
7395
|
+
/**
|
|
7396
|
+
* @private
|
|
7397
|
+
*/
|
|
7398
|
+
this.hasDisplayValueContent = false;
|
|
5752
7399
|
}
|
|
5753
7400
|
|
|
5754
7401
|
/**
|
|
@@ -5762,6 +7409,7 @@ class AuroSelect extends LitElement {
|
|
|
5762
7409
|
this.value = undefined;
|
|
5763
7410
|
this.fullscreenBreakpoint = 'sm';
|
|
5764
7411
|
this.onDark = false;
|
|
7412
|
+
this.isPopoverVisible = false;
|
|
5765
7413
|
}
|
|
5766
7414
|
|
|
5767
7415
|
// This function is to define props used within the scope of this component
|
|
@@ -5778,6 +7426,14 @@ class AuroSelect extends LitElement {
|
|
|
5778
7426
|
reflect: true
|
|
5779
7427
|
},
|
|
5780
7428
|
|
|
7429
|
+
/**
|
|
7430
|
+
* If declared, the label and value will be visually hidden and the displayValue will render 100% of the time.
|
|
7431
|
+
*/
|
|
7432
|
+
forceDisplayValue: {
|
|
7433
|
+
type: Boolean,
|
|
7434
|
+
reflect: true
|
|
7435
|
+
},
|
|
7436
|
+
|
|
5781
7437
|
/**
|
|
5782
7438
|
* If declared, bib's position will be automatically calculated where to appear.
|
|
5783
7439
|
* @default false
|
|
@@ -5796,18 +7452,26 @@ class AuroSelect extends LitElement {
|
|
|
5796
7452
|
},
|
|
5797
7453
|
|
|
5798
7454
|
/**
|
|
5799
|
-
*
|
|
7455
|
+
* @private
|
|
5800
7456
|
*/
|
|
5801
|
-
|
|
5802
|
-
type:
|
|
7457
|
+
isPopoverVisible: {
|
|
7458
|
+
type: Boolean,
|
|
7459
|
+
reflect: false
|
|
7460
|
+
},
|
|
7461
|
+
|
|
7462
|
+
/**
|
|
7463
|
+
* If declared, the popover and trigger will be set to the same width.
|
|
7464
|
+
*/
|
|
7465
|
+
matchWidth: {
|
|
7466
|
+
type: Boolean,
|
|
5803
7467
|
reflect: true
|
|
5804
7468
|
},
|
|
5805
7469
|
|
|
5806
7470
|
/**
|
|
5807
|
-
*
|
|
7471
|
+
* The name for the select element.
|
|
5808
7472
|
*/
|
|
5809
|
-
|
|
5810
|
-
type:
|
|
7473
|
+
name: {
|
|
7474
|
+
type: String,
|
|
5811
7475
|
reflect: true
|
|
5812
7476
|
},
|
|
5813
7477
|
|
|
@@ -5904,7 +7568,7 @@ class AuroSelect extends LitElement {
|
|
|
5904
7568
|
* "top" | "right" | "bottom" | "left" |
|
|
5905
7569
|
* "bottom-start" | "top-start" | "top-end" |
|
|
5906
7570
|
* "right-start" | "right-end" | "bottom-end" |
|
|
5907
|
-
* "left-start" | "left-end"
|
|
7571
|
+
* "left-start" | "left-end".
|
|
5908
7572
|
* @default bottom-start
|
|
5909
7573
|
*/
|
|
5910
7574
|
placement: {
|
|
@@ -5984,12 +7648,58 @@ class AuroSelect extends LitElement {
|
|
|
5984
7648
|
type: Boolean,
|
|
5985
7649
|
reflect: true,
|
|
5986
7650
|
attribute: false
|
|
5987
|
-
}
|
|
7651
|
+
},
|
|
7652
|
+
|
|
7653
|
+
/**
|
|
7654
|
+
* @private
|
|
7655
|
+
*/
|
|
7656
|
+
hasFocus: {
|
|
7657
|
+
type: Boolean,
|
|
7658
|
+
reflect: false,
|
|
7659
|
+
attribute: false
|
|
7660
|
+
},
|
|
7661
|
+
|
|
7662
|
+
/**
|
|
7663
|
+
* @private
|
|
7664
|
+
*/
|
|
7665
|
+
hasDisplayValueContent: {
|
|
7666
|
+
type: Boolean,
|
|
7667
|
+
reflect: false,
|
|
7668
|
+
attribute: false
|
|
7669
|
+
},
|
|
5988
7670
|
};
|
|
5989
7671
|
}
|
|
5990
7672
|
|
|
5991
7673
|
static get styles() {
|
|
5992
|
-
return [
|
|
7674
|
+
return [
|
|
7675
|
+
css`${shapeSizeCss$1}`,
|
|
7676
|
+
css`${tokensCss$5}`,
|
|
7677
|
+
css`${styleCss}`,
|
|
7678
|
+
];
|
|
7679
|
+
}
|
|
7680
|
+
|
|
7681
|
+
/**
|
|
7682
|
+
* Returns classmap configuration for html5 input labels in all layouts.
|
|
7683
|
+
* @private
|
|
7684
|
+
* @returns {void}
|
|
7685
|
+
*/
|
|
7686
|
+
get commonLabelClasses() {
|
|
7687
|
+
return {
|
|
7688
|
+
'is-disabled': this.disabled,
|
|
7689
|
+
'withValue': this.value && this.value.length > 0,
|
|
7690
|
+
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
7691
|
+
};
|
|
7692
|
+
}
|
|
7693
|
+
|
|
7694
|
+
/**
|
|
7695
|
+
* Returns classmap configuration for wrapper elements in each layout.
|
|
7696
|
+
* @private
|
|
7697
|
+
* @returns {object} - Returns classmap.
|
|
7698
|
+
*/
|
|
7699
|
+
get commonWrapperClasses() {
|
|
7700
|
+
return {
|
|
7701
|
+
'wrapper': true
|
|
7702
|
+
};
|
|
5993
7703
|
}
|
|
5994
7704
|
|
|
5995
7705
|
/**
|
|
@@ -5999,11 +7709,13 @@ class AuroSelect extends LitElement {
|
|
|
5999
7709
|
*/
|
|
6000
7710
|
configureDropdown() {
|
|
6001
7711
|
this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
|
|
6002
|
-
|
|
7712
|
+
|
|
7713
|
+
this.dropdown.addEventListener('auroDropdown-toggled', () => {
|
|
7714
|
+
this.isPopoverVisible = this.dropdown.isPopoverVisible;
|
|
7715
|
+
});
|
|
6003
7716
|
|
|
6004
7717
|
// setting up bibtemplate
|
|
6005
|
-
this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
|
|
6006
|
-
this.bibtemplate.append(this.menuWrapper);
|
|
7718
|
+
this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
|
|
6007
7719
|
|
|
6008
7720
|
if (this.customBibWidth) {
|
|
6009
7721
|
this.dropdown.dropdownWidth = this.customBibWidth;
|
|
@@ -6022,7 +7734,7 @@ class AuroSelect extends LitElement {
|
|
|
6022
7734
|
*
|
|
6023
7735
|
*/
|
|
6024
7736
|
static register(name = "auro-select") {
|
|
6025
|
-
AuroLibraryRuntimeUtils$
|
|
7737
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroSelect);
|
|
6026
7738
|
}
|
|
6027
7739
|
|
|
6028
7740
|
/**
|
|
@@ -6033,27 +7745,34 @@ class AuroSelect extends LitElement {
|
|
|
6033
7745
|
updateDisplayedValue() {
|
|
6034
7746
|
const triggerContentEl = this.dropdown.querySelector('#triggerFocus');
|
|
6035
7747
|
|
|
6036
|
-
// Clear
|
|
6037
|
-
const
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
triggerContentEl.appendChild(placeholder);
|
|
7748
|
+
// Clear out old value
|
|
7749
|
+
const valueElem = triggerContentEl.querySelector('#value');
|
|
7750
|
+
if (valueElem) {
|
|
7751
|
+
valueElem.innerHTML = '';
|
|
6041
7752
|
}
|
|
6042
7753
|
|
|
7754
|
+
const slot = this.shadowRoot.querySelector('slot[name="displayValue"]');
|
|
7755
|
+
const slottedElements = slot.assignedElements();
|
|
7756
|
+
|
|
7757
|
+
slottedElements.forEach((element) => {
|
|
7758
|
+
element.remove();
|
|
7759
|
+
});
|
|
7760
|
+
|
|
6043
7761
|
// Handle selected options
|
|
6044
7762
|
if (this.optionSelected) {
|
|
6045
|
-
let displayText = '';
|
|
6046
|
-
|
|
6047
7763
|
if (this.multiSelect && this.optionSelected.length > 0) {
|
|
6048
|
-
|
|
6049
|
-
|
|
7764
|
+
const displayText = this.optionSelected.map((option) => option.textContent).join(', ');
|
|
7765
|
+
|
|
7766
|
+
valueElem.textContent = displayText;
|
|
6050
7767
|
} else {
|
|
6051
|
-
|
|
6052
|
-
|
|
7768
|
+
valueElem.innerHTML = this.optionSelected.innerHTML;
|
|
7769
|
+
const displayValueEl = this.optionSelected.querySelector("[slot='displayValue']");
|
|
6053
7770
|
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
7771
|
+
if (displayValueEl) {
|
|
7772
|
+
this.appendChild(displayValueEl.cloneNode(true));
|
|
7773
|
+
}
|
|
7774
|
+
this.hasDisplayValueContent = displayValueEl !== null;
|
|
7775
|
+
}
|
|
6057
7776
|
}
|
|
6058
7777
|
|
|
6059
7778
|
this.dropdown.requestUpdate();
|
|
@@ -6075,6 +7794,15 @@ class AuroSelect extends LitElement {
|
|
|
6075
7794
|
return;
|
|
6076
7795
|
}
|
|
6077
7796
|
|
|
7797
|
+
// set menu's default size if there it's not specified.
|
|
7798
|
+
if (!this.menu.getAttribute('size')) {
|
|
7799
|
+
this.menu.setAttribute('size', this.layout !== 'emphasized' ? 'md' : this.size);
|
|
7800
|
+
}
|
|
7801
|
+
|
|
7802
|
+
if (!this.getAttribute('shape')) {
|
|
7803
|
+
this.menu.setAttribute('shape', this.layout === 'classic' ? 'box' : this.shape);
|
|
7804
|
+
}
|
|
7805
|
+
|
|
6078
7806
|
if (this.multiSelect) {
|
|
6079
7807
|
this.menu.multiSelect = this.multiSelect;
|
|
6080
7808
|
}
|
|
@@ -6132,8 +7860,6 @@ class AuroSelect extends LitElement {
|
|
|
6132
7860
|
* @returns {void}
|
|
6133
7861
|
*/
|
|
6134
7862
|
configureSelect() {
|
|
6135
|
-
// inject menu into menuWrapper
|
|
6136
|
-
this.menuWrapper.append(this.menu);
|
|
6137
7863
|
|
|
6138
7864
|
this.addEventListener('keydown', (evt) => {
|
|
6139
7865
|
if (evt.key === 'ArrowUp') {
|
|
@@ -6187,6 +7913,7 @@ class AuroSelect extends LitElement {
|
|
|
6187
7913
|
|
|
6188
7914
|
this.addEventListener('blur', () => {
|
|
6189
7915
|
this.validation.validate(this);
|
|
7916
|
+
this.hasFocus = false;
|
|
6190
7917
|
});
|
|
6191
7918
|
}
|
|
6192
7919
|
|
|
@@ -6262,6 +7989,7 @@ class AuroSelect extends LitElement {
|
|
|
6262
7989
|
*/
|
|
6263
7990
|
handleFocusin() {
|
|
6264
7991
|
|
|
7992
|
+
this.hasFocus = true;
|
|
6265
7993
|
this.touched = true;
|
|
6266
7994
|
}
|
|
6267
7995
|
|
|
@@ -6338,17 +8066,32 @@ class AuroSelect extends LitElement {
|
|
|
6338
8066
|
// Add the tag name as an attribute if it is different than the component name
|
|
6339
8067
|
this.runtimeUtils.handleComponentTagRename(this, 'auro-select');
|
|
6340
8068
|
|
|
6341
|
-
this.configureMenu();
|
|
6342
8069
|
this.configureDropdown();
|
|
8070
|
+
this.configureMenu();
|
|
6343
8071
|
this.configureSelect();
|
|
6344
8072
|
|
|
6345
8073
|
// Set the initial value in auro-menu if defined
|
|
6346
8074
|
if (this.hasAttribute('value') && this.getAttribute('value').length > 0) {
|
|
6347
8075
|
this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
|
|
6348
|
-
this.menu
|
|
8076
|
+
if (this.menu) {
|
|
8077
|
+
this.menu.value = this.value;
|
|
8078
|
+
}
|
|
6349
8079
|
}
|
|
6350
8080
|
}
|
|
6351
8081
|
|
|
8082
|
+
/**
|
|
8083
|
+
* Update the menu value. With checks for menu existence. Awaits value update.
|
|
8084
|
+
* @param {string} value - The value to set in the menu.
|
|
8085
|
+
* @returns void
|
|
8086
|
+
* @private
|
|
8087
|
+
*/
|
|
8088
|
+
async updateMenuValue(value) {
|
|
8089
|
+
if (!this.menu) return;
|
|
8090
|
+
|
|
8091
|
+
this.menu.value = value;
|
|
8092
|
+
await this.menu.updateComplete;
|
|
8093
|
+
}
|
|
8094
|
+
|
|
6352
8095
|
async updated(changedProperties) {
|
|
6353
8096
|
if (changedProperties.has('multiSelect')) {
|
|
6354
8097
|
this.clearSelection();
|
|
@@ -6358,14 +8101,13 @@ class AuroSelect extends LitElement {
|
|
|
6358
8101
|
if (this.value) {
|
|
6359
8102
|
this.value = this.multiSelect ? arrayConverter(this.value) : this.value;
|
|
6360
8103
|
|
|
6361
|
-
this.
|
|
6362
|
-
|
|
6363
|
-
// Wait for menu to finish updating its value
|
|
6364
|
-
await this.menu.updateComplete;
|
|
8104
|
+
await this.updateMenuValue(this.value);
|
|
6365
8105
|
|
|
6366
|
-
|
|
8106
|
+
if (this.menu) {
|
|
8107
|
+
this.optionSelected = this.menu.optionSelected;
|
|
8108
|
+
}
|
|
6367
8109
|
} else {
|
|
6368
|
-
this.
|
|
8110
|
+
await this.updateMenuValue(undefined);
|
|
6369
8111
|
}
|
|
6370
8112
|
|
|
6371
8113
|
this._updateNativeSelect();
|
|
@@ -6382,6 +8124,10 @@ class AuroSelect extends LitElement {
|
|
|
6382
8124
|
bubbles: true,
|
|
6383
8125
|
cancelable: true,
|
|
6384
8126
|
composed: true,
|
|
8127
|
+
detail: {
|
|
8128
|
+
optionSelected: this.optionSelected,
|
|
8129
|
+
value: this.value
|
|
8130
|
+
}
|
|
6385
8131
|
}));
|
|
6386
8132
|
}
|
|
6387
8133
|
|
|
@@ -6392,6 +8138,14 @@ class AuroSelect extends LitElement {
|
|
|
6392
8138
|
if (changedProperties.has('error')) {
|
|
6393
8139
|
this.validate(true);
|
|
6394
8140
|
}
|
|
8141
|
+
|
|
8142
|
+
if (changedProperties.has('shape') && this.menu) {
|
|
8143
|
+
this.menu.setAttribute('shape', this.layout === 'classic' ? 'box' : this.shape);
|
|
8144
|
+
}
|
|
8145
|
+
|
|
8146
|
+
if (changedProperties.has('size') && this.menu) {
|
|
8147
|
+
this.menu.setAttribute('size', this.layout !== 'emphasized' ? 'md' : this.size);
|
|
8148
|
+
}
|
|
6395
8149
|
}
|
|
6396
8150
|
|
|
6397
8151
|
/**
|
|
@@ -6466,11 +8220,355 @@ class AuroSelect extends LitElement {
|
|
|
6466
8220
|
}
|
|
6467
8221
|
}
|
|
6468
8222
|
|
|
8223
|
+
renderAriaHtml() {
|
|
8224
|
+
return html`
|
|
8225
|
+
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
8226
|
+
${this.optionActive && this.options.length > 0
|
|
8227
|
+
? html`
|
|
8228
|
+
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
8229
|
+
`
|
|
8230
|
+
: undefined
|
|
8231
|
+
};
|
|
8232
|
+
|
|
8233
|
+
${this.optionSelected && this.options.length > 0
|
|
8234
|
+
? html`
|
|
8235
|
+
${`${this.optionSelected.innerText} selected`}
|
|
8236
|
+
`
|
|
8237
|
+
: undefined
|
|
8238
|
+
};
|
|
8239
|
+
</div>
|
|
8240
|
+
`;
|
|
8241
|
+
}
|
|
8242
|
+
|
|
8243
|
+
renderNativeSelect() {
|
|
8244
|
+
return html`
|
|
8245
|
+
<div class="nativeSelectWrapper util_displayHidden">
|
|
8246
|
+
<select
|
|
8247
|
+
tabindex="-1"
|
|
8248
|
+
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
8249
|
+
name="${this.name || ''}"
|
|
8250
|
+
?disabled="${this.disabled}"
|
|
8251
|
+
?required="${this.required}"
|
|
8252
|
+
aria-hidden="true"
|
|
8253
|
+
autocomplete="${ifDefined$1(this.autocomplete)}"
|
|
8254
|
+
@change="${this._handleNativeSelectChange}">
|
|
8255
|
+
<option value="" ?selected="${!this.value}"></option>
|
|
8256
|
+
${this.options.map((option) => {
|
|
8257
|
+
const optionValue = option.value || option.textContent;
|
|
8258
|
+
return html`
|
|
8259
|
+
<option
|
|
8260
|
+
value="${optionValue}"
|
|
8261
|
+
?selected="${this.value === optionValue}">
|
|
8262
|
+
${option.textContent}
|
|
8263
|
+
</option>
|
|
8264
|
+
`;
|
|
8265
|
+
})}
|
|
8266
|
+
</select>
|
|
8267
|
+
</div>
|
|
8268
|
+
`;
|
|
8269
|
+
}
|
|
8270
|
+
|
|
8271
|
+
/**
|
|
8272
|
+
* Returns HTML for the help text and error message.
|
|
8273
|
+
* @private
|
|
8274
|
+
* @returns {html} - Returns HTML for the help text and error message.
|
|
8275
|
+
*/
|
|
8276
|
+
renderHtmlHelpText() {
|
|
8277
|
+
return html`
|
|
8278
|
+
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
8279
|
+
? html`
|
|
8280
|
+
<${this.helpTextTag} ?onDark="${this.onDark}">
|
|
8281
|
+
<p id="${this.uniqueId}" part="helpText">
|
|
8282
|
+
<slot name="helptext"></slot>
|
|
8283
|
+
</p>
|
|
8284
|
+
</${this.helpTextTag}>
|
|
8285
|
+
`
|
|
8286
|
+
: html`
|
|
8287
|
+
<${this.helpTextTag} error ?onDark="${this.onDark}">
|
|
8288
|
+
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
8289
|
+
ERROR MESSAGE ${this.errorMessage}
|
|
8290
|
+
</p>
|
|
8291
|
+
</${this.helpTextTag}>
|
|
8292
|
+
`
|
|
8293
|
+
}
|
|
8294
|
+
`;
|
|
8295
|
+
}
|
|
8296
|
+
|
|
8297
|
+
/**
|
|
8298
|
+
* Returns HTML for the emphasized layout.
|
|
8299
|
+
* @private
|
|
8300
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the emphasized layout.
|
|
8301
|
+
*/
|
|
8302
|
+
renderLayoutEmphasized() {
|
|
8303
|
+
const placeholderClass = {
|
|
8304
|
+
hidden: this.value,
|
|
8305
|
+
};
|
|
8306
|
+
|
|
8307
|
+
const displayValueClasses = {
|
|
8308
|
+
'displayValue': true,
|
|
8309
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8310
|
+
'hasFocus': this.isPopoverVisible,
|
|
8311
|
+
'withValue': this.value && this.value.length > 0,
|
|
8312
|
+
'force': this.forceDisplayValue,
|
|
8313
|
+
};
|
|
8314
|
+
|
|
8315
|
+
const valueContainerClasses = {
|
|
8316
|
+
'valueContainer': true,
|
|
8317
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
8318
|
+
};
|
|
8319
|
+
|
|
8320
|
+
return html`
|
|
8321
|
+
<div
|
|
8322
|
+
class="${classMap(this.commonWrapperClasses)}"
|
|
8323
|
+
part="wrapper">
|
|
8324
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8325
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8326
|
+
</div>
|
|
8327
|
+
<${this.dropdownTag}
|
|
8328
|
+
a11yRole="select"
|
|
8329
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8330
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8331
|
+
?matchWidth="${this.matchWidth}"
|
|
8332
|
+
?noFlip="${this.noFlip}"
|
|
8333
|
+
?onDark="${this.onDark}"
|
|
8334
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8335
|
+
.offset="${this.offset}"
|
|
8336
|
+
.placement="${this.placement}"
|
|
8337
|
+
chevron
|
|
8338
|
+
fluid
|
|
8339
|
+
for="selectMenu"
|
|
8340
|
+
layout="${this.layout}"
|
|
8341
|
+
part="dropdown"
|
|
8342
|
+
shape="${this.shape}"
|
|
8343
|
+
size="${this.size}">
|
|
8344
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8345
|
+
<div class="accents left">
|
|
8346
|
+
<slot name="typeIcon"></slot>
|
|
8347
|
+
</div>
|
|
8348
|
+
<div class="mainContent">
|
|
8349
|
+
<div class="${classMap(valueContainerClasses)}">
|
|
8350
|
+
<label class="${classMap(this.commonLabelClasses)}">
|
|
8351
|
+
<slot name="label"></slot>
|
|
8352
|
+
</label>
|
|
8353
|
+
<div class="value" id="value"></div>
|
|
8354
|
+
${this.value ? undefined : html`
|
|
8355
|
+
<div id="placeholder" class="${classMap(placeholderClass)}">
|
|
8356
|
+
<slot name="placeholder"></slot>
|
|
8357
|
+
</div>
|
|
8358
|
+
`}
|
|
8359
|
+
</div>
|
|
8360
|
+
<div class="${classMap(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8361
|
+
<slot name="displayValue"></slot>
|
|
8362
|
+
</div>
|
|
8363
|
+
</div>
|
|
8364
|
+
<div class="accents right"></div>
|
|
8365
|
+
</div>
|
|
8366
|
+
<div class="menuWrapper"></div>
|
|
8367
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8368
|
+
<slot></slot>
|
|
8369
|
+
</${this.bibtemplateTag}>
|
|
8370
|
+
<div slot="helpText">
|
|
8371
|
+
${this.renderHtmlHelpText()}
|
|
8372
|
+
</div>
|
|
8373
|
+
</${this.dropdownTag}>
|
|
8374
|
+
</div>
|
|
8375
|
+
`;
|
|
8376
|
+
}
|
|
8377
|
+
|
|
8378
|
+
/**
|
|
8379
|
+
* Returns HTML for the snowflake layout.
|
|
8380
|
+
* @private
|
|
8381
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the snowflake layout.
|
|
8382
|
+
*/
|
|
8383
|
+
renderLayoutSnowflake() {
|
|
8384
|
+
const placeholderClass = {
|
|
8385
|
+
hidden: this.value,
|
|
8386
|
+
};
|
|
8387
|
+
|
|
8388
|
+
const displayValueClasses = {
|
|
8389
|
+
'displayValue': true,
|
|
8390
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8391
|
+
'hasFocus': this.isPopoverVisible,
|
|
8392
|
+
'withValue': this.value && this.value.length > 0,
|
|
8393
|
+
'force': this.forceDisplayValue,
|
|
8394
|
+
};
|
|
8395
|
+
|
|
8396
|
+
const valueContainerClasses = {
|
|
8397
|
+
'valueContainer': true,
|
|
8398
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
8399
|
+
};
|
|
8400
|
+
|
|
8401
|
+
return html`
|
|
8402
|
+
<div
|
|
8403
|
+
class="${classMap(this.commonWrapperClasses)}"
|
|
8404
|
+
part="wrapper">
|
|
8405
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8406
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8407
|
+
</div>
|
|
8408
|
+
<${this.dropdownTag}
|
|
8409
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8410
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8411
|
+
?matchWidth="${this.matchWidth}"
|
|
8412
|
+
?noFlip="${this.noFlip}"
|
|
8413
|
+
?onDark="${this.onDark}"
|
|
8414
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8415
|
+
.offset="${this.offset}"
|
|
8416
|
+
.placement="${this.placement}"
|
|
8417
|
+
chevron
|
|
8418
|
+
fluid
|
|
8419
|
+
for="selectMenu"
|
|
8420
|
+
layout="${this.layout}"
|
|
8421
|
+
part="dropdown"
|
|
8422
|
+
shape="${this.shape}"
|
|
8423
|
+
size="${this.size}">
|
|
8424
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8425
|
+
<div class="accents left">
|
|
8426
|
+
<slot name="typeIcon"></slot>
|
|
8427
|
+
</div>
|
|
8428
|
+
<div class="mainContent">
|
|
8429
|
+
<div class="${classMap(valueContainerClasses)}">
|
|
8430
|
+
<label class="${classMap(this.commonLabelClasses)}">
|
|
8431
|
+
<slot name="label"></slot>
|
|
8432
|
+
</label>
|
|
8433
|
+
<div class="value" id="value"></div>
|
|
8434
|
+
${this.value ? undefined : html`
|
|
8435
|
+
<div id="placeholder" class="${classMap(placeholderClass)}">
|
|
8436
|
+
<slot name="placeholder"></slot>
|
|
8437
|
+
</div>
|
|
8438
|
+
`}
|
|
8439
|
+
</div>
|
|
8440
|
+
<div class="${classMap(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8441
|
+
<slot name="displayValue"></slot>
|
|
8442
|
+
</div>
|
|
8443
|
+
</div>
|
|
8444
|
+
<div class="accents right"></div>
|
|
8445
|
+
</div>
|
|
8446
|
+
<div class="menuWrapper"></div>
|
|
8447
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8448
|
+
<slot></slot>
|
|
8449
|
+
</${this.bibtemplateTag}>
|
|
8450
|
+
<div slot="helpText">
|
|
8451
|
+
${this.renderHtmlHelpText()}
|
|
8452
|
+
</div>
|
|
8453
|
+
</${this.dropdownTag}>
|
|
8454
|
+
${this.renderNativeSelect()}
|
|
8455
|
+
</div>
|
|
8456
|
+
`;
|
|
8457
|
+
}
|
|
8458
|
+
|
|
8459
|
+
/**
|
|
8460
|
+
* Returns HTML for the classic layout.
|
|
8461
|
+
* @private
|
|
8462
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the classic layout.
|
|
8463
|
+
*/
|
|
8464
|
+
renderLayoutClassic() {
|
|
8465
|
+
const placeholderClass = {
|
|
8466
|
+
hidden: this.value,
|
|
8467
|
+
};
|
|
8468
|
+
|
|
8469
|
+
const displayValueClasses = {
|
|
8470
|
+
'displayValue': true,
|
|
8471
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8472
|
+
'hasFocus': this.isPopoverVisible,
|
|
8473
|
+
'withValue': this.value && this.value.length > 0,
|
|
8474
|
+
'force': this.forceDisplayValue,
|
|
8475
|
+
};
|
|
8476
|
+
|
|
8477
|
+
const valueContainerClasses = {
|
|
8478
|
+
'valueContainer': true,
|
|
8479
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
8480
|
+
};
|
|
8481
|
+
|
|
8482
|
+
return html`
|
|
8483
|
+
<div
|
|
8484
|
+
class="${classMap(this.commonWrapperClasses)}"
|
|
8485
|
+
part="wrapper">
|
|
8486
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8487
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8488
|
+
</div>
|
|
8489
|
+
<${this.dropdownTag}
|
|
8490
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8491
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8492
|
+
?matchWidth="${!this.flexMenuWidth}"
|
|
8493
|
+
?noFlip="${this.noFlip}"
|
|
8494
|
+
?onDark="${this.onDark}"
|
|
8495
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8496
|
+
.offset="${this.offset}"
|
|
8497
|
+
.placement="${this.placement}"
|
|
8498
|
+
chevron
|
|
8499
|
+
fluid
|
|
8500
|
+
for="selectMenu"
|
|
8501
|
+
layout="${this.layout}"
|
|
8502
|
+
part="dropdown"
|
|
8503
|
+
shape="${this.shape}"
|
|
8504
|
+
size="${this.size}">
|
|
8505
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8506
|
+
<div class="accents left">
|
|
8507
|
+
<slot name="typeIcon"></slot>
|
|
8508
|
+
</div>
|
|
8509
|
+
<div class="mainContent">
|
|
8510
|
+
<div class="${classMap(valueContainerClasses)}">
|
|
8511
|
+
<label class="${classMap(this.commonLabelClasses)}">
|
|
8512
|
+
<slot name="label"></slot>
|
|
8513
|
+
</label>
|
|
8514
|
+
<div class="value" id="value"></div>
|
|
8515
|
+
${this.value ? undefined : html`
|
|
8516
|
+
<div id="placeholder" class="${classMap(placeholderClass)}">
|
|
8517
|
+
<slot name="placeholder"></slot>
|
|
8518
|
+
</div>
|
|
8519
|
+
`}
|
|
8520
|
+
</div>
|
|
8521
|
+
<div class="${classMap(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8522
|
+
<slot name="displayValue"></slot>
|
|
8523
|
+
</div>
|
|
8524
|
+
</div>
|
|
8525
|
+
<div class="accents right"></div>
|
|
8526
|
+
</div>
|
|
8527
|
+
<div class="menuWrapper"></div>
|
|
8528
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8529
|
+
<slot></slot>
|
|
8530
|
+
</${this.bibtemplateTag}>
|
|
8531
|
+
<div slot="helpText">
|
|
8532
|
+
${this.renderHtmlHelpText()}
|
|
8533
|
+
</div>
|
|
8534
|
+
</${this.dropdownTag}>
|
|
8535
|
+
${this.renderNativeSelect()}
|
|
8536
|
+
</div>
|
|
8537
|
+
`;
|
|
8538
|
+
}
|
|
8539
|
+
|
|
8540
|
+
/**
|
|
8541
|
+
* Logic to determine the layout of the component.
|
|
8542
|
+
* @private
|
|
8543
|
+
* @param {string} [ForcedLayout] - Used to force a specific layout, pass in the layout name to use.
|
|
8544
|
+
* @returns {void}
|
|
8545
|
+
*/
|
|
8546
|
+
renderLayout(ForcedLayout) {
|
|
8547
|
+
const layout = ForcedLayout || this.layout;
|
|
8548
|
+
|
|
8549
|
+
switch (layout) {
|
|
8550
|
+
case 'emphasized':
|
|
8551
|
+
return this.renderLayoutEmphasized();
|
|
8552
|
+
case 'emphasized-left':
|
|
8553
|
+
return this.renderLayoutEmphasized();
|
|
8554
|
+
case 'emphasized-right':
|
|
8555
|
+
return this.renderLayoutEmphasized();
|
|
8556
|
+
case 'snowflake':
|
|
8557
|
+
return this.renderLayoutSnowflake();
|
|
8558
|
+
case 'snowflake-left':
|
|
8559
|
+
return this.renderLayoutSnowflake();
|
|
8560
|
+
case 'snowflake-right':
|
|
8561
|
+
return this.renderLayoutSnowflake();
|
|
8562
|
+
default:
|
|
8563
|
+
return this.renderLayoutClassic();
|
|
8564
|
+
}
|
|
8565
|
+
}
|
|
8566
|
+
|
|
6469
8567
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
6470
8568
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
6471
8569
|
|
|
6472
8570
|
// function that renders the HTML and CSS into the scope of the component
|
|
6473
|
-
|
|
8571
|
+
renderBACKUP() {
|
|
6474
8572
|
const placeholderClass = {
|
|
6475
8573
|
hidden: this.value,
|
|
6476
8574
|
};
|
|
@@ -6496,27 +8594,34 @@ class AuroSelect extends LitElement {
|
|
|
6496
8594
|
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
6497
8595
|
</div>
|
|
6498
8596
|
<${this.dropdownTag}
|
|
6499
|
-
|
|
8597
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8598
|
+
?disabled="${this.disabled}"
|
|
6500
8599
|
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8600
|
+
?matchWidth="${this.matchWidth}"
|
|
8601
|
+
?noFlip="${this.noFlip}"
|
|
6501
8602
|
?onDark="${this.onDark}"
|
|
6502
|
-
common
|
|
6503
|
-
fluid
|
|
6504
8603
|
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
6505
|
-
?matchWidth="${!this.flexMenuWidth}"
|
|
6506
|
-
chevron
|
|
6507
|
-
.placement="${this.placement}"
|
|
6508
8604
|
.offset="${this.offset}"
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
8605
|
+
.placement="${this.placement}"
|
|
8606
|
+
chevron
|
|
8607
|
+
fluid
|
|
8608
|
+
for="selectMenu"
|
|
8609
|
+
layout="${this.layout}"
|
|
8610
|
+
part="dropdown"
|
|
8611
|
+
shape="${this.shape}"
|
|
8612
|
+
size="${this.size}">
|
|
6512
8613
|
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
6513
|
-
<span id="placeholder"
|
|
8614
|
+
<span id="placeholder"
|
|
8615
|
+
class="${classMap(placeholderClass)}"
|
|
8616
|
+
?aria-hidden="${this.optionSelected && this.optionSelected.length ? 'true' : false}"
|
|
8617
|
+
>
|
|
8618
|
+
<slot name="placeholder"></slot>
|
|
8619
|
+
</span>
|
|
8620
|
+
<slot name="valueText" id="valueText"></slot>
|
|
6514
8621
|
</span>
|
|
6515
8622
|
|
|
6516
|
-
<div class="menuWrapper">
|
|
6517
|
-
</div>
|
|
6518
|
-
|
|
6519
8623
|
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8624
|
+
<slot></slot>
|
|
6520
8625
|
</${this.bibtemplateTag}>
|
|
6521
8626
|
<slot name="label" slot="label"></slot>
|
|
6522
8627
|
<p slot="helpText">
|
|
@@ -6556,6 +8661,7 @@ class AuroSelect extends LitElement {
|
|
|
6556
8661
|
</select>
|
|
6557
8662
|
</div>
|
|
6558
8663
|
<!-- Help text and error message template -->
|
|
8664
|
+
${this.renderHtmlHelpText()}
|
|
6559
8665
|
</div>
|
|
6560
8666
|
`;
|
|
6561
8667
|
}
|