@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.6 → 0.0.0-pr624.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/bibtemplate/dist/auro-bibtemplate.d.ts +12 -2
- package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +1214 -83
- package/components/bibtemplate/dist/registered.js +1214 -83
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/api.html +16 -10
- package/components/checkbox/demo/api.md +47 -14
- package/components/checkbox/demo/api.min.js +49 -37
- package/components/checkbox/demo/index.html +16 -10
- package/components/checkbox/demo/index.md +2 -2
- package/components/checkbox/demo/index.min.js +49 -37
- package/components/checkbox/demo/readme.html +16 -9
- package/components/checkbox/demo/readme.md +1 -1
- package/components/checkbox/dist/auro-checkbox-group.d.ts +1 -1
- package/components/checkbox/dist/auro-checkbox.d.ts +3 -3
- package/components/checkbox/dist/index.js +49 -37
- package/components/checkbox/dist/registered.js +49 -37
- package/components/combobox/demo/api.html +16 -10
- package/components/combobox/demo/api.md +112 -8
- package/components/combobox/demo/api.min.js +2941 -851
- package/components/combobox/demo/index.html +16 -10
- package/components/combobox/demo/index.md +6 -30
- package/components/combobox/demo/index.min.js +2941 -851
- package/components/combobox/demo/readme.html +16 -9
- package/components/combobox/dist/auro-combobox.d.ts +37 -8
- package/components/combobox/dist/index.js +2730 -736
- package/components/combobox/dist/registered.js +2730 -736
- package/components/counter/demo/api.html +17 -10
- package/components/counter/demo/api.md +156 -21
- package/components/counter/demo/api.min.js +6696 -4097
- package/components/counter/demo/index.html +17 -10
- package/components/counter/demo/index.md +185 -34
- package/components/counter/demo/index.min.js +6696 -4097
- package/components/counter/demo/readme.html +16 -9
- package/components/counter/dist/auro-counter-button.d.ts +2 -0
- package/components/counter/dist/auro-counter-group.d.ts +151 -11
- package/components/counter/dist/auro-counter.d.ts +16 -0
- package/components/counter/dist/helptextVersion.d.ts +2 -0
- package/components/counter/dist/iconVersion.d.ts +1 -1
- package/components/counter/dist/index.js +6696 -4097
- package/components/counter/dist/registered.js +6696 -4097
- package/components/datepicker/demo/api.html +16 -10
- package/components/datepicker/demo/api.md +24 -16
- package/components/datepicker/demo/api.min.js +11749 -8230
- package/components/datepicker/demo/index.html +16 -10
- package/components/datepicker/demo/index.md +71 -4
- package/components/datepicker/demo/index.min.js +11749 -8230
- package/components/datepicker/demo/readme.html +16 -9
- package/components/datepicker/dist/auro-datepicker.d.ts +84 -11
- package/components/datepicker/dist/buttonVersion.d.ts +1 -1
- package/components/datepicker/dist/iconVersion.d.ts +2 -0
- package/components/datepicker/dist/index.js +6531 -3012
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +6531 -3012
- package/components/dropdown/demo/api.html +16 -10
- package/components/dropdown/demo/api.md +81 -274
- package/components/dropdown/demo/api.min.js +429 -195
- package/components/dropdown/demo/index.html +16 -10
- package/components/dropdown/demo/index.md +92 -362
- package/components/dropdown/demo/index.min.js +429 -195
- package/components/dropdown/demo/readme.html +16 -9
- package/components/dropdown/dist/auro-dropdown.d.ts +41 -76
- package/components/dropdown/dist/auro-dropdownBib.d.ts +14 -0
- package/components/dropdown/dist/index.js +429 -195
- package/components/dropdown/dist/registered.js +429 -195
- package/components/form/demo/api.html +16 -9
- package/components/form/demo/api.min.js +1 -1
- package/components/form/demo/autocomplete.html +19 -3
- package/components/form/demo/index.html +16 -9
- package/components/form/demo/index.min.js +1 -1
- package/components/form/demo/readme.html +16 -9
- package/components/form/demo/working.html +19 -13
- package/components/form/dist/index.js +1 -1
- package/components/form/dist/registered.js +1 -1
- package/components/helptext/dist/index.js +2 -2
- package/components/helptext/dist/registered.js +2 -2
- package/components/input/README.md +5 -2
- package/components/input/demo/api.html +16 -10
- package/components/input/demo/api.md +226 -129
- package/components/input/demo/api.min.js +828 -234
- package/components/input/demo/index.html +16 -10
- package/components/input/demo/index.md +48 -32
- package/components/input/demo/index.min.js +828 -234
- package/components/input/demo/readme.html +16 -9
- package/components/input/demo/readme.md +5 -2
- package/components/input/dist/auro-input.d.ts +3 -3
- package/components/input/dist/base-input.d.ts +33 -9
- package/components/input/dist/buttonVersion.d.ts +1 -1
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +828 -234
- package/components/input/dist/registered.js +828 -234
- package/components/layoutElement/dist/index.js +13 -10
- package/components/menu/demo/api.html +32 -10
- package/components/menu/demo/api.md +69 -8
- package/components/menu/demo/api.min.js +238 -47
- package/components/menu/demo/index.html +16 -10
- package/components/menu/demo/index.min.js +238 -47
- package/components/menu/demo/readme.html +16 -9
- package/components/menu/dist/auro-menu.d.ts +41 -7
- package/components/menu/dist/auro-menuoption.d.ts +15 -3
- package/components/menu/dist/iconVersion.d.ts +1 -1
- package/components/menu/dist/index.js +238 -47
- package/components/menu/dist/registered.js +238 -47
- package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
- package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
- package/components/radio/demo/api.html +16 -10
- package/components/radio/demo/api.md +7 -8
- package/components/radio/demo/api.min.js +72 -85
- package/components/radio/demo/index.html +16 -10
- package/components/radio/demo/index.min.js +72 -85
- package/components/radio/demo/readme.html +16 -9
- package/components/radio/dist/auro-radio-group.d.ts +1 -1
- package/components/radio/dist/auro-radio.d.ts +9 -12
- package/components/radio/dist/index.js +72 -85
- package/components/radio/dist/registered.js +72 -85
- package/components/select/demo/api.html +16 -10
- package/components/select/demo/api.js +0 -2
- package/components/select/demo/api.md +104 -57
- package/components/select/demo/api.min.js +2107 -639
- package/components/select/demo/index.html +16 -11
- package/components/select/demo/index.md +45 -158
- package/components/select/demo/index.min.js +2104 -624
- package/components/select/demo/readme.html +16 -9
- package/components/select/dist/auro-select.d.ts +57 -16
- package/components/select/dist/index.js +2028 -644
- package/components/select/dist/registered.js +2028 -644
- package/package.json +29 -26
- /package/components/{datepicker/dist/styles/emphasized/style-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/{dropdown/dist/styles/default → datepicker/dist/styles/snowflake}/color-css.d.ts +0 -0
- /package/components/{dropdown/dist/styles/default → datepicker/dist/styles/snowflake}/style-css.d.ts +0 -0
- /package/components/dropdown/dist/styles/{default → classic}/bibColors-css.d.ts +0 -0
- /package/components/dropdown/dist/styles/{default → classic}/bibStyles-css.d.ts +0 -0
- /package/components/{menu/dist/styles/color-menu-css.d.ts → dropdown/dist/styles/classic/color-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/color-menuoption-css.d.ts → dropdown/dist/styles/classic/style-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{style-menu-css.d.ts → default/color-menu-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{style-menuoption-css.d.ts → default/color-menuoption-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{tokens-css.d.ts → default/style-menu-css.d.ts} +0 -0
|
@@ -39,18 +39,21 @@ let AuroElement$3 = class AuroElement extends LitElement {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
resetShapeClasses() {
|
|
42
|
-
|
|
43
|
-
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
42
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
if (wrapper) {
|
|
45
|
+
wrapper.classList.forEach((className) => {
|
|
46
|
+
if (className.startsWith('shape-')) {
|
|
47
|
+
wrapper.classList.remove(className);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
|
|
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');
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
|
|
@@ -96,9 +99,9 @@ let AuroElement$3 = class AuroElement extends LitElement {
|
|
|
96
99
|
}
|
|
97
100
|
};
|
|
98
101
|
|
|
99
|
-
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}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;min-height:56px;max-height:56px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:
|
|
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}`;
|
|
100
103
|
|
|
101
|
-
var tokensCss$
|
|
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}`;
|
|
102
105
|
|
|
103
106
|
class DateFormatter {
|
|
104
107
|
|
|
@@ -516,7 +519,7 @@ const {
|
|
|
516
519
|
|
|
517
520
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
518
521
|
|
|
519
|
-
let AuroLibraryRuntimeUtils$
|
|
522
|
+
let AuroLibraryRuntimeUtils$6 = class AuroLibraryRuntimeUtils {
|
|
520
523
|
|
|
521
524
|
/* eslint-disable jsdoc/require-param */
|
|
522
525
|
|
|
@@ -586,7 +589,7 @@ let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
|
586
589
|
class AuroFormValidation {
|
|
587
590
|
|
|
588
591
|
constructor() {
|
|
589
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
592
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
590
593
|
}
|
|
591
594
|
|
|
592
595
|
/**
|
|
@@ -646,19 +649,19 @@ class AuroFormValidation {
|
|
|
646
649
|
{
|
|
647
650
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
648
651
|
validity: 'tooShort',
|
|
649
|
-
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
652
|
+
message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
|
|
650
653
|
},
|
|
651
654
|
{
|
|
652
655
|
check: (e) => e.value?.length > e.maxLength,
|
|
653
656
|
validity: 'tooLong',
|
|
654
|
-
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
657
|
+
message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
|
|
655
658
|
}
|
|
656
659
|
],
|
|
657
660
|
pattern: [
|
|
658
661
|
{
|
|
659
662
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
660
663
|
validity: 'patternMismatch',
|
|
661
|
-
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
664
|
+
message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
|
|
662
665
|
}
|
|
663
666
|
]
|
|
664
667
|
},
|
|
@@ -853,10 +856,10 @@ class AuroFormValidation {
|
|
|
853
856
|
if (!hasValue && elem.required && elem.touched) {
|
|
854
857
|
elem.validity = 'valueMissing';
|
|
855
858
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
856
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
859
|
+
} else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
857
860
|
this.validateType(elem);
|
|
858
861
|
this.validateElementAttributes(elem);
|
|
859
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
862
|
+
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
860
863
|
this.validateElementAttributes(elem);
|
|
861
864
|
}
|
|
862
865
|
}
|
|
@@ -865,7 +868,9 @@ class AuroFormValidation {
|
|
|
865
868
|
elem.validity = this.auroInputElements[0].validity;
|
|
866
869
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
867
870
|
|
|
868
|
-
|
|
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) {
|
|
869
874
|
elem.validity = this.auroInputElements[1].validity;
|
|
870
875
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
871
876
|
}
|
|
@@ -2671,7 +2676,7 @@ class AuroFloatingUI {
|
|
|
2671
2676
|
*/
|
|
2672
2677
|
mirrorSize() {
|
|
2673
2678
|
// mirror the boxsize from bibSizer
|
|
2674
|
-
if (this.element.bibSizer) {
|
|
2679
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
2675
2680
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2676
2681
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2677
2682
|
if (sizerStyle.width !== '0px') {
|
|
@@ -2883,13 +2888,13 @@ class AuroFloatingUI {
|
|
|
2883
2888
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2884
2889
|
return;
|
|
2885
2890
|
}
|
|
2886
|
-
|
|
2891
|
+
|
|
2887
2892
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
2888
2893
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2889
2894
|
return;
|
|
2890
2895
|
}
|
|
2891
2896
|
|
|
2892
|
-
this.hideBib();
|
|
2897
|
+
this.hideBib("keydown");
|
|
2893
2898
|
}
|
|
2894
2899
|
|
|
2895
2900
|
setupHideHandlers() {
|
|
@@ -2914,7 +2919,7 @@ class AuroFloatingUI {
|
|
|
2914
2919
|
document.expandedAuroFormkitDropdown = null;
|
|
2915
2920
|
document.expandedAuroFloater = this;
|
|
2916
2921
|
} else {
|
|
2917
|
-
this.hideBib();
|
|
2922
|
+
this.hideBib("click");
|
|
2918
2923
|
}
|
|
2919
2924
|
}
|
|
2920
2925
|
};
|
|
@@ -2927,7 +2932,7 @@ class AuroFloatingUI {
|
|
|
2927
2932
|
// if something else is open, let it handle itself
|
|
2928
2933
|
return;
|
|
2929
2934
|
}
|
|
2930
|
-
this.hideBib();
|
|
2935
|
+
this.hideBib("keydown");
|
|
2931
2936
|
}
|
|
2932
2937
|
};
|
|
2933
2938
|
|
|
@@ -3010,7 +3015,11 @@ class AuroFloatingUI {
|
|
|
3010
3015
|
}
|
|
3011
3016
|
}
|
|
3012
3017
|
|
|
3013
|
-
|
|
3018
|
+
/**
|
|
3019
|
+
* Hides the floating UI element.
|
|
3020
|
+
* @param {String} eventType - The event type that triggered the hiding action.
|
|
3021
|
+
*/
|
|
3022
|
+
hideBib(eventType = "unknown") {
|
|
3014
3023
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
3015
3024
|
this.lockScroll(false);
|
|
3016
3025
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -3021,7 +3030,7 @@ class AuroFloatingUI {
|
|
|
3021
3030
|
if (this.showing) {
|
|
3022
3031
|
this.cleanupHideHandlers();
|
|
3023
3032
|
this.showing = false;
|
|
3024
|
-
this.dispatchEventDropdownToggle();
|
|
3033
|
+
this.dispatchEventDropdownToggle(eventType);
|
|
3025
3034
|
}
|
|
3026
3035
|
}
|
|
3027
3036
|
document.expandedAuroFloater = null;
|
|
@@ -3030,11 +3039,13 @@ class AuroFloatingUI {
|
|
|
3030
3039
|
/**
|
|
3031
3040
|
* @private
|
|
3032
3041
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
3042
|
+
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3033
3043
|
*/
|
|
3034
|
-
dispatchEventDropdownToggle() {
|
|
3044
|
+
dispatchEventDropdownToggle(eventType) {
|
|
3035
3045
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
3036
3046
|
detail: {
|
|
3037
3047
|
expanded: this.showing,
|
|
3048
|
+
eventType: eventType || "unknown",
|
|
3038
3049
|
},
|
|
3039
3050
|
composed: true
|
|
3040
3051
|
});
|
|
@@ -3044,7 +3055,7 @@ class AuroFloatingUI {
|
|
|
3044
3055
|
|
|
3045
3056
|
handleClick() {
|
|
3046
3057
|
if (this.element.isPopoverVisible) {
|
|
3047
|
-
this.hideBib();
|
|
3058
|
+
this.hideBib("click");
|
|
3048
3059
|
} else {
|
|
3049
3060
|
this.showBib();
|
|
3050
3061
|
}
|
|
@@ -3067,8 +3078,9 @@ class AuroFloatingUI {
|
|
|
3067
3078
|
// Space is included as it's expected behavior for interactive elements
|
|
3068
3079
|
|
|
3069
3080
|
const origin = event.composedPath()[0];
|
|
3070
|
-
if (event.key === 'Enter' || (
|
|
3071
|
-
|
|
3081
|
+
if (event.key === 'Enter' || event.key === ' ' && (!origin || origin.tagName !== "INPUT")) {
|
|
3082
|
+
|
|
3083
|
+
event.preventDefault();
|
|
3072
3084
|
this.handleClick();
|
|
3073
3085
|
}
|
|
3074
3086
|
break;
|
|
@@ -3079,7 +3091,7 @@ class AuroFloatingUI {
|
|
|
3079
3091
|
break;
|
|
3080
3092
|
case 'mouseleave':
|
|
3081
3093
|
if (this.element.hoverToggle) {
|
|
3082
|
-
this.hideBib();
|
|
3094
|
+
this.hideBib("mouseleave");
|
|
3083
3095
|
}
|
|
3084
3096
|
break;
|
|
3085
3097
|
case 'focus':
|
|
@@ -3222,6 +3234,267 @@ class AuroFloatingUI {
|
|
|
3222
3234
|
}
|
|
3223
3235
|
}
|
|
3224
3236
|
|
|
3237
|
+
// Selectors for focusable elements
|
|
3238
|
+
const FOCUSABLE_SELECTORS = [
|
|
3239
|
+
'a[href]',
|
|
3240
|
+
'button:not([disabled])',
|
|
3241
|
+
'textarea:not([disabled])',
|
|
3242
|
+
'input:not([disabled])',
|
|
3243
|
+
'select:not([disabled])',
|
|
3244
|
+
'[role="tab"]:not([disabled])',
|
|
3245
|
+
'[role="link"]:not([disabled])',
|
|
3246
|
+
'[role="button"]:not([disabled])',
|
|
3247
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
3248
|
+
'[contenteditable]:not([contenteditable="false"])'
|
|
3249
|
+
];
|
|
3250
|
+
|
|
3251
|
+
// List of custom components that are known to be focusable
|
|
3252
|
+
const FOCUSABLE_COMPONENTS = [
|
|
3253
|
+
'auro-checkbox',
|
|
3254
|
+
'auro-radio',
|
|
3255
|
+
'auro-dropdown',
|
|
3256
|
+
'auro-button',
|
|
3257
|
+
'auro-combobox',
|
|
3258
|
+
'auro-input',
|
|
3259
|
+
'auro-counter',
|
|
3260
|
+
'auro-menu',
|
|
3261
|
+
'auro-select',
|
|
3262
|
+
'auro-datepicker',
|
|
3263
|
+
'auro-hyperlink',
|
|
3264
|
+
'auro-accordion',
|
|
3265
|
+
];
|
|
3266
|
+
|
|
3267
|
+
/**
|
|
3268
|
+
* Determines if a given element is a custom focusable component.
|
|
3269
|
+
* Returns true if the element matches a known focusable component and is not disabled.
|
|
3270
|
+
*
|
|
3271
|
+
* @param {HTMLElement} element The element to check for focusability.
|
|
3272
|
+
* @returns {boolean} True if the element is a focusable custom component, false otherwise.
|
|
3273
|
+
*/
|
|
3274
|
+
function isFocusableComponent(element) {
|
|
3275
|
+
const componentName = element.tagName.toLowerCase();
|
|
3276
|
+
|
|
3277
|
+
// Guard Clause: Element is a focusable component
|
|
3278
|
+
if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
|
|
3279
|
+
|
|
3280
|
+
// Guard Clause: Element is not disabled
|
|
3281
|
+
if (element.hasAttribute('disabled')) return false;
|
|
3282
|
+
|
|
3283
|
+
// Guard Clause: The element is a hyperlink and has no href attribute
|
|
3284
|
+
if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
|
|
3285
|
+
|
|
3286
|
+
// If all guard clauses pass, the element is a focusable component
|
|
3287
|
+
return true;
|
|
3288
|
+
}
|
|
3289
|
+
|
|
3290
|
+
/**
|
|
3291
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
3292
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
3293
|
+
*
|
|
3294
|
+
* @param {HTMLElement} container The container to search within
|
|
3295
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
3296
|
+
*/
|
|
3297
|
+
function getFocusableElements(container) {
|
|
3298
|
+
// Get elements in DOM order by walking the tree
|
|
3299
|
+
const orderedFocusableElements = [];
|
|
3300
|
+
|
|
3301
|
+
// Define a recursive function to collect focusable elements in DOM order
|
|
3302
|
+
const collectFocusableElements = (root) => {
|
|
3303
|
+
// Check if current element is focusable
|
|
3304
|
+
if (root.nodeType === Node.ELEMENT_NODE) {
|
|
3305
|
+
// Check if this is a custom component that is focusable
|
|
3306
|
+
const isComponentFocusable = isFocusableComponent(root);
|
|
3307
|
+
|
|
3308
|
+
if (isComponentFocusable) {
|
|
3309
|
+
// Add the component itself as a focusable element and don't traverse its shadow DOM
|
|
3310
|
+
orderedFocusableElements.push(root);
|
|
3311
|
+
return; // Skip traversing inside this component
|
|
3312
|
+
}
|
|
3313
|
+
|
|
3314
|
+
// Check if the element itself matches any selector
|
|
3315
|
+
for (const selector of FOCUSABLE_SELECTORS) {
|
|
3316
|
+
if (root.matches?.(selector)) {
|
|
3317
|
+
orderedFocusableElements.push(root);
|
|
3318
|
+
break; // Once we know it's focusable, no need to check other selectors
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
|
|
3322
|
+
// Process shadow DOM only for non-Auro components
|
|
3323
|
+
if (root.shadowRoot) {
|
|
3324
|
+
// Process shadow DOM children in order
|
|
3325
|
+
if (root.shadowRoot.children) {
|
|
3326
|
+
Array.from(root.shadowRoot.children).forEach(child => {
|
|
3327
|
+
collectFocusableElements(child);
|
|
3328
|
+
});
|
|
3329
|
+
}
|
|
3330
|
+
}
|
|
3331
|
+
|
|
3332
|
+
// Process slots and their assigned nodes in order
|
|
3333
|
+
if (root.tagName === 'SLOT') {
|
|
3334
|
+
const assignedNodes = root.assignedNodes({ flatten: true });
|
|
3335
|
+
for (const node of assignedNodes) {
|
|
3336
|
+
collectFocusableElements(node);
|
|
3337
|
+
}
|
|
3338
|
+
} else {
|
|
3339
|
+
// Process light DOM children in order
|
|
3340
|
+
if (root.children) {
|
|
3341
|
+
Array.from(root.children).forEach(child => {
|
|
3342
|
+
collectFocusableElements(child);
|
|
3343
|
+
});
|
|
3344
|
+
}
|
|
3345
|
+
}
|
|
3346
|
+
}
|
|
3347
|
+
};
|
|
3348
|
+
|
|
3349
|
+
// Start the traversal from the container
|
|
3350
|
+
collectFocusableElements(container);
|
|
3351
|
+
|
|
3352
|
+
// Remove duplicates that might have been collected through different paths
|
|
3353
|
+
// while preserving order
|
|
3354
|
+
const uniqueElements = [];
|
|
3355
|
+
const seen = new Set();
|
|
3356
|
+
|
|
3357
|
+
for (const element of orderedFocusableElements) {
|
|
3358
|
+
if (!seen.has(element)) {
|
|
3359
|
+
seen.add(element);
|
|
3360
|
+
uniqueElements.push(element);
|
|
3361
|
+
}
|
|
3362
|
+
}
|
|
3363
|
+
|
|
3364
|
+
return uniqueElements;
|
|
3365
|
+
}
|
|
3366
|
+
|
|
3367
|
+
/**
|
|
3368
|
+
* FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
|
|
3369
|
+
* It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
|
|
3370
|
+
*/
|
|
3371
|
+
class FocusTrap {
|
|
3372
|
+
/**
|
|
3373
|
+
* Creates a new FocusTrap instance for the given container element.
|
|
3374
|
+
* Initializes event listeners and prepares the container for focus management.
|
|
3375
|
+
*
|
|
3376
|
+
* @param {HTMLElement} container The DOM element to trap focus within.
|
|
3377
|
+
* @throws {Error} If the provided container is not a valid HTMLElement.
|
|
3378
|
+
*/
|
|
3379
|
+
constructor(container) {
|
|
3380
|
+
if (!container || !(container instanceof HTMLElement)) {
|
|
3381
|
+
throw new Error("FocusTrap requires a valid HTMLElement.");
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
this.container = container;
|
|
3385
|
+
this.tabDirection = 'forward'; // or 'backward'
|
|
3386
|
+
|
|
3387
|
+
this._init();
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3390
|
+
/**
|
|
3391
|
+
* Initializes the focus trap by setting up event listeners and attributes on the container.
|
|
3392
|
+
* Prepares the container for focus management, including support for shadow DOM and inert attributes.
|
|
3393
|
+
*
|
|
3394
|
+
* @private
|
|
3395
|
+
*/
|
|
3396
|
+
_init() {
|
|
3397
|
+
|
|
3398
|
+
// Add inert attribute to prevent focusing programmatically as well (if supported)
|
|
3399
|
+
if ('inert' in HTMLElement.prototype) {
|
|
3400
|
+
this.container.inert = false; // Ensure the container isn't inert
|
|
3401
|
+
this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
|
|
3402
|
+
}
|
|
3403
|
+
|
|
3404
|
+
// Track tab direction
|
|
3405
|
+
this.container.addEventListener('keydown', this._onKeydown);
|
|
3406
|
+
}
|
|
3407
|
+
|
|
3408
|
+
/**
|
|
3409
|
+
* Handles keydown events to manage tab navigation within the container.
|
|
3410
|
+
* Ensures that focus wraps around when reaching the first or last focusable element.
|
|
3411
|
+
*
|
|
3412
|
+
* @param {KeyboardEvent} e The keyboard event triggered by user interaction.
|
|
3413
|
+
* @private
|
|
3414
|
+
*/
|
|
3415
|
+
_onKeydown = (e) => {
|
|
3416
|
+
|
|
3417
|
+
if (e.key === 'Tab') {
|
|
3418
|
+
|
|
3419
|
+
// Set the tab direction based on the key pressed
|
|
3420
|
+
this.tabDirection = e.shiftKey ? 'backward' : 'forward';
|
|
3421
|
+
|
|
3422
|
+
// Get the active element(s) in the document and shadow root
|
|
3423
|
+
// This will include the active element in the shadow DOM if it exists
|
|
3424
|
+
// Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
|
|
3425
|
+
let activeElement = document.activeElement;
|
|
3426
|
+
const actives = [activeElement];
|
|
3427
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
3428
|
+
actives.push(activeElement.shadowRoot.activeElement);
|
|
3429
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
3430
|
+
}
|
|
3431
|
+
|
|
3432
|
+
// Update the focusable elements
|
|
3433
|
+
const focusables = this._getFocusableElements();
|
|
3434
|
+
|
|
3435
|
+
// If we're at either end of the focusable elements, wrap around to the other end
|
|
3436
|
+
const focusIndex =
|
|
3437
|
+
(actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
|
|
3438
|
+
? focusables.length - 1
|
|
3439
|
+
: actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
|
|
3440
|
+
? 0
|
|
3441
|
+
: null;
|
|
3442
|
+
|
|
3443
|
+
if (focusIndex !== null) {
|
|
3444
|
+
focusables[focusIndex].focus();
|
|
3445
|
+
e.preventDefault(); // Prevent default tab behavior
|
|
3446
|
+
e.stopPropagation(); // Stop the event from bubbling up
|
|
3447
|
+
}
|
|
3448
|
+
}
|
|
3449
|
+
};
|
|
3450
|
+
|
|
3451
|
+
/**
|
|
3452
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
3453
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
3454
|
+
*
|
|
3455
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
3456
|
+
* @private
|
|
3457
|
+
*/
|
|
3458
|
+
_getFocusableElements() {
|
|
3459
|
+
// Use the imported utility function to get focusable elements
|
|
3460
|
+
const elements = getFocusableElements(this.container);
|
|
3461
|
+
|
|
3462
|
+
// Filter out any elements with the 'focus-bookend' class
|
|
3463
|
+
return elements;
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3466
|
+
/**
|
|
3467
|
+
* Moves focus to the first focusable element within the container.
|
|
3468
|
+
* Useful for setting initial focus when activating the focus trap.
|
|
3469
|
+
*/
|
|
3470
|
+
focusFirstElement() {
|
|
3471
|
+
const focusables = this._getFocusableElements();
|
|
3472
|
+
if (focusables.length) focusables[0].focus();
|
|
3473
|
+
}
|
|
3474
|
+
|
|
3475
|
+
/**
|
|
3476
|
+
* Moves focus to the last focusable element within the container.
|
|
3477
|
+
* Useful for setting focus when deactivating or cycling focus in reverse.
|
|
3478
|
+
*/
|
|
3479
|
+
focusLastElement() {
|
|
3480
|
+
const focusables = this._getFocusableElements();
|
|
3481
|
+
if (focusables.length) focusables[focusables.length - 1].focus();
|
|
3482
|
+
}
|
|
3483
|
+
|
|
3484
|
+
/**
|
|
3485
|
+
* Removes event listeners and attributes added by the focus trap.
|
|
3486
|
+
* Call this method to clean up when the focus trap is no longer needed.
|
|
3487
|
+
*/
|
|
3488
|
+
disconnect() {
|
|
3489
|
+
|
|
3490
|
+
if (this.container.hasAttribute('data-focus-trap-container')) {
|
|
3491
|
+
this.container.removeAttribute('data-focus-trap-container');
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
this.container.removeEventListener('keydown', this._onKeydown);
|
|
3495
|
+
}
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3225
3498
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3226
3499
|
// See LICENSE in the project root for license information.
|
|
3227
3500
|
|
|
@@ -3272,7 +3545,7 @@ let AuroDependencyVersioning$1 = class AuroDependencyVersioning {
|
|
|
3272
3545
|
* @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
|
|
3273
3546
|
*/
|
|
3274
3547
|
|
|
3275
|
-
let AuroElement$1 = class AuroElement extends LitElement {
|
|
3548
|
+
let AuroElement$1$1 = class AuroElement extends LitElement {
|
|
3276
3549
|
|
|
3277
3550
|
// function to define props used within the scope of this component
|
|
3278
3551
|
static get properties() {
|
|
@@ -3340,7 +3613,7 @@ var styleCss$2$1 = css`:focus:not(:focus-visible){outline:3px solid transparent}
|
|
|
3340
3613
|
*/
|
|
3341
3614
|
|
|
3342
3615
|
// build the component class
|
|
3343
|
-
let BaseIcon$1 = class BaseIcon extends AuroElement$1 {
|
|
3616
|
+
let BaseIcon$1 = class BaseIcon extends AuroElement$1$1 {
|
|
3344
3617
|
constructor() {
|
|
3345
3618
|
super();
|
|
3346
3619
|
this.onDark = false;
|
|
@@ -3412,9 +3685,9 @@ let BaseIcon$1 = class BaseIcon extends AuroElement$1 {
|
|
|
3412
3685
|
}
|
|
3413
3686
|
};
|
|
3414
3687
|
|
|
3415
|
-
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)}`;
|
|
3688
|
+
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)}`;
|
|
3416
3689
|
|
|
3417
|
-
var colorCss$3 = 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)}`;
|
|
3690
|
+
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)}`;
|
|
3418
3691
|
|
|
3419
3692
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3420
3693
|
// See LICENSE in the project root for license information.
|
|
@@ -3572,9 +3845,9 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
3572
3845
|
static get styles() {
|
|
3573
3846
|
return [
|
|
3574
3847
|
super.styles,
|
|
3575
|
-
css`${tokensCss$2}`,
|
|
3848
|
+
css`${tokensCss$2$1}`,
|
|
3576
3849
|
css`${styleCss$2$1}`,
|
|
3577
|
-
css`${colorCss$3}`
|
|
3850
|
+
css`${colorCss$3$1}`
|
|
3578
3851
|
];
|
|
3579
3852
|
}
|
|
3580
3853
|
|
|
@@ -3608,8 +3881,12 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
3608
3881
|
async firstUpdated() {
|
|
3609
3882
|
await super.firstUpdated();
|
|
3610
3883
|
|
|
3611
|
-
|
|
3612
|
-
|
|
3884
|
+
/**
|
|
3885
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
3886
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
3887
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
3888
|
+
*/
|
|
3889
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
3613
3890
|
const svgDesc = this.svg.querySelector('desc');
|
|
3614
3891
|
|
|
3615
3892
|
if (svgDesc) {
|
|
@@ -3655,11 +3932,11 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
3655
3932
|
|
|
3656
3933
|
var iconVersion$1 = '6.1.2';
|
|
3657
3934
|
|
|
3658
|
-
var styleCss$1$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}.container{
|
|
3935
|
+
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}`;
|
|
3659
3936
|
|
|
3660
3937
|
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)}`;
|
|
3661
3938
|
|
|
3662
|
-
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:
|
|
3939
|
+
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-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db);--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}`;
|
|
3663
3940
|
|
|
3664
3941
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
3665
3942
|
// See LICENSE in the project root for license information.
|
|
@@ -3680,7 +3957,7 @@ const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
|
3680
3957
|
*/
|
|
3681
3958
|
|
|
3682
3959
|
class AuroDropdownBib extends LitElement {
|
|
3683
|
-
|
|
3960
|
+
// not extending AuroElement because Bib needs only `shape` prop
|
|
3684
3961
|
constructor() {
|
|
3685
3962
|
super();
|
|
3686
3963
|
|
|
@@ -3690,6 +3967,9 @@ class AuroDropdownBib extends LitElement {
|
|
|
3690
3967
|
this._mobileBreakpointValue = undefined;
|
|
3691
3968
|
|
|
3692
3969
|
AuroLibraryRuntimeUtils$2$1.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
3970
|
+
|
|
3971
|
+
this.shape = "rounded";
|
|
3972
|
+
this.matchWidth = false;
|
|
3693
3973
|
}
|
|
3694
3974
|
|
|
3695
3975
|
static get styles() {
|
|
@@ -3727,6 +4007,15 @@ class AuroDropdownBib extends LitElement {
|
|
|
3727
4007
|
reflect: true
|
|
3728
4008
|
},
|
|
3729
4009
|
|
|
4010
|
+
/**
|
|
4011
|
+
* If declared, the bib width will match the trigger width.
|
|
4012
|
+
* @private
|
|
4013
|
+
*/
|
|
4014
|
+
matchWidth: {
|
|
4015
|
+
type: Boolean,
|
|
4016
|
+
reflect: true
|
|
4017
|
+
},
|
|
4018
|
+
|
|
3730
4019
|
/**
|
|
3731
4020
|
* If declared, will apply border-radius to the bib.
|
|
3732
4021
|
*/
|
|
@@ -3740,6 +4029,11 @@ class AuroDropdownBib extends LitElement {
|
|
|
3740
4029
|
*/
|
|
3741
4030
|
bibTemplate: {
|
|
3742
4031
|
type: Object
|
|
4032
|
+
},
|
|
4033
|
+
|
|
4034
|
+
shape: {
|
|
4035
|
+
type: String,
|
|
4036
|
+
reflect: true
|
|
3743
4037
|
}
|
|
3744
4038
|
};
|
|
3745
4039
|
}
|
|
@@ -3819,8 +4113,16 @@ class AuroDropdownBib extends LitElement {
|
|
|
3819
4113
|
|
|
3820
4114
|
// function that renders the HTML and CSS into the scope of the component
|
|
3821
4115
|
render() {
|
|
4116
|
+
const classes = {
|
|
4117
|
+
container: true
|
|
4118
|
+
};
|
|
4119
|
+
|
|
4120
|
+
// Since this class does not inherit from AuroElement, we apply the shape-related class within the `render` function,
|
|
4121
|
+
// mimicking the class naming convention used in AuroElement.resetShapeClasses.
|
|
4122
|
+
classes[`shape-${this.shape}`] = true;
|
|
4123
|
+
|
|
3822
4124
|
return html`
|
|
3823
|
-
<div class="
|
|
4125
|
+
<div class="${classMap(classes)}" part="bibContainer">
|
|
3824
4126
|
<slot></slot>
|
|
3825
4127
|
</div>
|
|
3826
4128
|
`;
|
|
@@ -3829,23 +4131,23 @@ class AuroDropdownBib extends LitElement {
|
|
|
3829
4131
|
|
|
3830
4132
|
var dropdownVersion$1 = '3.0.0';
|
|
3831
4133
|
|
|
3832
|
-
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}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;min-height:56px;max-height:56px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:
|
|
4134
|
+
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}`;
|
|
3833
4135
|
|
|
3834
|
-
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:
|
|
4136
|
+
var colorCss$1$1 = css`:host(:not([layout*=classic])){--ds-auro-dropdown-trigger-border-color: transparent}:host(:not([ondark])) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus-within,:host(:not([ondark])) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host(:not([onDark])[disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([ondark])[error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]) .label{color:var(--ds-auro-dropdown-label-text-color)}:host([onDark]) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host([onDark]) .wrapper:focus-within,:host([onDark]) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark][disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}:host([ondark][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}`;
|
|
3835
4137
|
|
|
3836
|
-
var classicColorCss = css
|
|
4138
|
+
var classicColorCss = css``;
|
|
3837
4139
|
|
|
3838
|
-
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]) .
|
|
4140
|
+
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]) .wrapper{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}@media(hover: hover){:host([layout*=classic]) .wrapper:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}`;
|
|
3839
4141
|
|
|
3840
|
-
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
|
|
4142
|
+
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:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([layout*=emphasized][shape*=pill]:not([layout*=right])) .leftIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left])) .rightIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left]):not([layout*=right])) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
3841
4143
|
|
|
3842
|
-
var styleSnowflakeCss = css`:host{display:block}.wrapper{display:flex;flex
|
|
4144
|
+
var styleSnowflakeCss = css`:host{display:block}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([layout*=snowflake]) .leftIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}.layout-snowflake .chevron,.layout-snowflake-left .chevron,.layout-snowflake-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
3843
4145
|
|
|
3844
|
-
var colorCss$
|
|
4146
|
+
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)}`;
|
|
3845
4147
|
|
|
3846
|
-
var styleCss$
|
|
4148
|
+
var styleCss$6 = css`:host{position:relative;display:block}.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
3847
4149
|
|
|
3848
|
-
var tokensCss$
|
|
4150
|
+
var tokensCss$4 = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
3849
4151
|
|
|
3850
4152
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3851
4153
|
// See LICENSE in the project root for license information.
|
|
@@ -3854,7 +4156,7 @@ var tokensCss$3 = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texti
|
|
|
3854
4156
|
|
|
3855
4157
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
3856
4158
|
|
|
3857
|
-
let AuroLibraryRuntimeUtils$
|
|
4159
|
+
let AuroLibraryRuntimeUtils$5 = class AuroLibraryRuntimeUtils {
|
|
3858
4160
|
|
|
3859
4161
|
/* eslint-disable jsdoc/require-param */
|
|
3860
4162
|
|
|
@@ -3935,14 +4237,14 @@ let AuroHelpText$1 = class AuroHelpText extends LitElement {
|
|
|
3935
4237
|
this.onDark = false;
|
|
3936
4238
|
this.hasTextContent = false;
|
|
3937
4239
|
|
|
3938
|
-
AuroLibraryRuntimeUtils$
|
|
4240
|
+
AuroLibraryRuntimeUtils$5.prototype.handleComponentTagRename(this, 'auro-helptext');
|
|
3939
4241
|
}
|
|
3940
4242
|
|
|
3941
4243
|
static get styles() {
|
|
3942
4244
|
return [
|
|
3943
|
-
colorCss$
|
|
3944
|
-
styleCss$
|
|
3945
|
-
tokensCss$
|
|
4245
|
+
colorCss$5,
|
|
4246
|
+
styleCss$6,
|
|
4247
|
+
tokensCss$4
|
|
3946
4248
|
];
|
|
3947
4249
|
}
|
|
3948
4250
|
|
|
@@ -3991,7 +4293,7 @@ let AuroHelpText$1 = class AuroHelpText extends LitElement {
|
|
|
3991
4293
|
*
|
|
3992
4294
|
*/
|
|
3993
4295
|
static register(name = "auro-helptext") {
|
|
3994
|
-
AuroLibraryRuntimeUtils$
|
|
4296
|
+
AuroLibraryRuntimeUtils$5.prototype.registerComponent(name, AuroHelpText);
|
|
3995
4297
|
}
|
|
3996
4298
|
|
|
3997
4299
|
updated() {
|
|
@@ -4084,18 +4386,21 @@ let AuroElement$2 = class AuroElement extends LitElement {
|
|
|
4084
4386
|
}
|
|
4085
4387
|
|
|
4086
4388
|
resetShapeClasses() {
|
|
4087
|
-
|
|
4088
|
-
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
4389
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
4089
4390
|
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4391
|
+
if (wrapper) {
|
|
4392
|
+
wrapper.classList.forEach((className) => {
|
|
4393
|
+
if (className.startsWith('shape-')) {
|
|
4394
|
+
wrapper.classList.remove(className);
|
|
4395
|
+
}
|
|
4396
|
+
});
|
|
4096
4397
|
|
|
4097
|
-
|
|
4098
|
-
|
|
4398
|
+
}
|
|
4399
|
+
|
|
4400
|
+
if (this.shape && this.size) {
|
|
4401
|
+
wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
4402
|
+
} else {
|
|
4403
|
+
wrapper.classList.add('shape-none');
|
|
4099
4404
|
}
|
|
4100
4405
|
}
|
|
4101
4406
|
|
|
@@ -4145,10 +4450,8 @@ let AuroElement$2 = class AuroElement extends LitElement {
|
|
|
4145
4450
|
// See LICENSE in the project root for license information.
|
|
4146
4451
|
|
|
4147
4452
|
|
|
4148
|
-
|
|
4149
|
-
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
4453
|
+
/*
|
|
4150
4454
|
* @slot - Default slot for the popover content.
|
|
4151
|
-
* @slot label - Defines the content of the label.
|
|
4152
4455
|
* @slot helpText - Defines the content of the helpText.
|
|
4153
4456
|
* @slot trigger - Defines the content of the trigger.
|
|
4154
4457
|
* @csspart trigger - The trigger content container.
|
|
@@ -4167,23 +4470,25 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4167
4470
|
this.matchWidth = false;
|
|
4168
4471
|
this.noHideOnThisFocusLoss = false;
|
|
4169
4472
|
|
|
4170
|
-
this.errorMessage =
|
|
4473
|
+
this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
|
|
4171
4474
|
|
|
4172
4475
|
// Layout Config
|
|
4173
|
-
this.layout =
|
|
4174
|
-
this.shape =
|
|
4175
|
-
this.size =
|
|
4476
|
+
this.layout = undefined;
|
|
4477
|
+
this.shape = undefined;
|
|
4478
|
+
this.size = undefined;
|
|
4479
|
+
|
|
4176
4480
|
this.parentBorder = false;
|
|
4177
4481
|
|
|
4178
|
-
|
|
4179
|
-
|
|
4482
|
+
/** @private */
|
|
4483
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4180
4484
|
|
|
4181
|
-
|
|
4182
|
-
return {
|
|
4183
|
-
// 'withValue': this.value && this.value.length > 0
|
|
4184
|
-
};
|
|
4485
|
+
this.privateDefaults();
|
|
4185
4486
|
}
|
|
4186
4487
|
|
|
4488
|
+
/**
|
|
4489
|
+
* @private
|
|
4490
|
+
* @returns {object} Class definition for the wrapper element.
|
|
4491
|
+
*/
|
|
4187
4492
|
get commonWrapperClasses() {
|
|
4188
4493
|
return {
|
|
4189
4494
|
'trigger': true,
|
|
@@ -4201,13 +4506,10 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4201
4506
|
privateDefaults() {
|
|
4202
4507
|
this.chevron = false;
|
|
4203
4508
|
this.disabled = false;
|
|
4509
|
+
this.disableFocusTrap = false;
|
|
4204
4510
|
this.error = false;
|
|
4205
|
-
this.inset = false;
|
|
4206
|
-
this.rounded = false;
|
|
4207
4511
|
this.tabIndex = 0;
|
|
4208
4512
|
this.noToggle = false;
|
|
4209
|
-
this.a11yAutocomplete = 'none';
|
|
4210
|
-
this.labeled = true;
|
|
4211
4513
|
this.a11yRole = 'button';
|
|
4212
4514
|
this.onDark = false;
|
|
4213
4515
|
this.showTriggerBorders = true;
|
|
@@ -4303,6 +4605,18 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4303
4605
|
this.floater.showBib();
|
|
4304
4606
|
}
|
|
4305
4607
|
|
|
4608
|
+
/**
|
|
4609
|
+
* When bib is open, focus on the first element inside of bib.
|
|
4610
|
+
* If not, trigger element will get focus.
|
|
4611
|
+
*/
|
|
4612
|
+
focus() {
|
|
4613
|
+
if (this.isPopoverVisible && this.focusTrap) {
|
|
4614
|
+
this.focusTrap.focusFirstElement();
|
|
4615
|
+
} else {
|
|
4616
|
+
this.trigger.focus();
|
|
4617
|
+
}
|
|
4618
|
+
}
|
|
4619
|
+
|
|
4306
4620
|
// function to define props used within the scope of this component
|
|
4307
4621
|
static get properties() {
|
|
4308
4622
|
return {
|
|
@@ -4316,6 +4630,15 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4316
4630
|
reflect: true
|
|
4317
4631
|
},
|
|
4318
4632
|
|
|
4633
|
+
/**
|
|
4634
|
+
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
4635
|
+
* @default false
|
|
4636
|
+
*/
|
|
4637
|
+
disableEventShow: {
|
|
4638
|
+
type: Boolean,
|
|
4639
|
+
reflect: true
|
|
4640
|
+
},
|
|
4641
|
+
|
|
4319
4642
|
/**
|
|
4320
4643
|
* If declared, applies a border around the trigger slot.
|
|
4321
4644
|
*/
|
|
@@ -4334,17 +4657,17 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4334
4657
|
},
|
|
4335
4658
|
|
|
4336
4659
|
/**
|
|
4337
|
-
* If declared, the dropdown
|
|
4660
|
+
* If declared, the dropdown is not interactive.
|
|
4338
4661
|
*/
|
|
4339
|
-
|
|
4662
|
+
disabled: {
|
|
4340
4663
|
type: Boolean,
|
|
4341
4664
|
reflect: true
|
|
4342
4665
|
},
|
|
4343
4666
|
|
|
4344
4667
|
/**
|
|
4345
|
-
* If declared, the
|
|
4668
|
+
* If declared, the focus trap inside of bib will be turned off.
|
|
4346
4669
|
*/
|
|
4347
|
-
|
|
4670
|
+
disableFocusTrap: {
|
|
4348
4671
|
type: Boolean,
|
|
4349
4672
|
reflect: true
|
|
4350
4673
|
},
|
|
@@ -4389,22 +4712,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4389
4712
|
reflect: true
|
|
4390
4713
|
},
|
|
4391
4714
|
|
|
4392
|
-
/**
|
|
4393
|
-
* Makes the trigger to be full width of its parent container.
|
|
4394
|
-
*/
|
|
4395
|
-
fluid: {
|
|
4396
|
-
type: Boolean,
|
|
4397
|
-
reflect: true
|
|
4398
|
-
},
|
|
4399
|
-
|
|
4400
|
-
/**
|
|
4401
|
-
* If declared, will apply padding around trigger slot content.
|
|
4402
|
-
*/
|
|
4403
|
-
inset: {
|
|
4404
|
-
type: Boolean,
|
|
4405
|
-
reflect: true
|
|
4406
|
-
},
|
|
4407
|
-
|
|
4408
4715
|
/**
|
|
4409
4716
|
* If true, the dropdown bib is displayed.
|
|
4410
4717
|
*/
|
|
@@ -4448,15 +4755,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4448
4755
|
reflect: true
|
|
4449
4756
|
},
|
|
4450
4757
|
|
|
4451
|
-
/**
|
|
4452
|
-
* Defines if there is a label preset.
|
|
4453
|
-
* @private
|
|
4454
|
-
*/
|
|
4455
|
-
labeled: {
|
|
4456
|
-
type: Boolean,
|
|
4457
|
-
reflect: true
|
|
4458
|
-
},
|
|
4459
|
-
|
|
4460
4758
|
/**
|
|
4461
4759
|
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
4462
4760
|
* @private
|
|
@@ -4517,6 +4815,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4517
4815
|
reflect: true
|
|
4518
4816
|
},
|
|
4519
4817
|
|
|
4818
|
+
/**
|
|
4819
|
+
* If declared, and a function is set, that function will execute when the slot content is updated.
|
|
4820
|
+
*/
|
|
4520
4821
|
onSlotChange: {
|
|
4521
4822
|
type: Function,
|
|
4522
4823
|
reflect: false
|
|
@@ -4531,14 +4832,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4531
4832
|
reflect: true
|
|
4532
4833
|
},
|
|
4533
4834
|
|
|
4534
|
-
/**
|
|
4535
|
-
* If declared, will apply border-radius to trigger and default slots.
|
|
4536
|
-
*/
|
|
4537
|
-
rounded: {
|
|
4538
|
-
type: Boolean,
|
|
4539
|
-
reflect: true
|
|
4540
|
-
},
|
|
4541
|
-
|
|
4542
4835
|
/**
|
|
4543
4836
|
* @private
|
|
4544
4837
|
*/
|
|
@@ -4553,22 +4846,14 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4553
4846
|
type: String || undefined,
|
|
4554
4847
|
attribute: false,
|
|
4555
4848
|
reflect: false
|
|
4556
|
-
},
|
|
4557
|
-
|
|
4558
|
-
/**
|
|
4559
|
-
* The value for the aria-autocomplete attribute of the trigger element.
|
|
4560
|
-
*/
|
|
4561
|
-
a11yAutocomplete: {
|
|
4562
|
-
type: String,
|
|
4563
|
-
attribute: false,
|
|
4564
4849
|
}
|
|
4565
4850
|
};
|
|
4566
4851
|
}
|
|
4567
4852
|
|
|
4568
4853
|
static get styles() {
|
|
4569
4854
|
return [
|
|
4570
|
-
colorCss$1$1,
|
|
4571
4855
|
tokensCss$1$1,
|
|
4856
|
+
colorCss$1$1,
|
|
4572
4857
|
|
|
4573
4858
|
// default layout
|
|
4574
4859
|
classicColorCss,
|
|
@@ -4630,13 +4915,27 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4630
4915
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4631
4916
|
this.handleTriggerContentSlotChange();
|
|
4632
4917
|
}
|
|
4918
|
+
}
|
|
4633
4919
|
|
|
4920
|
+
/**
|
|
4921
|
+
* Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
|
|
4922
|
+
* @private
|
|
4923
|
+
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
4924
|
+
*/
|
|
4925
|
+
handleDropdownToggle(event) {
|
|
4926
|
+
this.updateFocusTrap();
|
|
4927
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
4928
|
+
const eventType = event.detail.eventType || "unknown";
|
|
4929
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4930
|
+
this.trigger.focus();
|
|
4931
|
+
}
|
|
4634
4932
|
}
|
|
4635
4933
|
|
|
4636
4934
|
firstUpdated() {
|
|
4637
4935
|
|
|
4638
4936
|
// Configure the floater to, this will generate the ID for the bib
|
|
4639
4937
|
this.floater.configure(this, 'auroDropdown');
|
|
4938
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4640
4939
|
|
|
4641
4940
|
/**
|
|
4642
4941
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -4696,6 +4995,27 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4696
4995
|
this.hasFocus = true;
|
|
4697
4996
|
}
|
|
4698
4997
|
|
|
4998
|
+
/**
|
|
4999
|
+
* @private
|
|
5000
|
+
*/
|
|
5001
|
+
updateFocusTrap() {
|
|
5002
|
+
// If the dropdown is open, create a focus trap and focus the first element
|
|
5003
|
+
if (this.isPopoverVisible && !this.disableFocusTrap) {
|
|
5004
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
5005
|
+
this.focusTrap.focusFirstElement();
|
|
5006
|
+
return;
|
|
5007
|
+
}
|
|
5008
|
+
|
|
5009
|
+
// Guard Clause: Ensure there is a focus trap currently active before continuing
|
|
5010
|
+
if (!this.focusTrap) {
|
|
5011
|
+
return;
|
|
5012
|
+
}
|
|
5013
|
+
|
|
5014
|
+
// If the dropdown is not open, disconnect the focus trap if it exists
|
|
5015
|
+
this.focusTrap.disconnect();
|
|
5016
|
+
this.focusTrap = undefined;
|
|
5017
|
+
}
|
|
5018
|
+
|
|
4699
5019
|
/**
|
|
4700
5020
|
* Function to support @focusout event.
|
|
4701
5021
|
* @private
|
|
@@ -4856,14 +5176,13 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4856
5176
|
* @returns {void}
|
|
4857
5177
|
*/
|
|
4858
5178
|
handleTriggerContentSlotChange(event) {
|
|
4859
|
-
|
|
4860
5179
|
this.floater.handleTriggerTabIndex();
|
|
4861
5180
|
|
|
4862
5181
|
// Get the trigger
|
|
4863
5182
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
4864
5183
|
|
|
4865
5184
|
// Get the trigger slot
|
|
4866
|
-
const triggerSlot = this.shadowRoot.querySelector('.
|
|
5185
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContentWrapper slot');
|
|
4867
5186
|
|
|
4868
5187
|
// If there's a trigger slot
|
|
4869
5188
|
if (triggerSlot) {
|
|
@@ -4926,7 +5245,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4926
5245
|
*
|
|
4927
5246
|
* @private
|
|
4928
5247
|
* @method handleDefaultSlot
|
|
4929
|
-
* @param {Event} event - The event object representing the slot change.
|
|
4930
5248
|
* @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
|
|
4931
5249
|
*/
|
|
4932
5250
|
handleDefaultSlot() {
|
|
@@ -4936,29 +5254,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4936
5254
|
}
|
|
4937
5255
|
}
|
|
4938
5256
|
|
|
4939
|
-
/**
|
|
4940
|
-
* @private
|
|
4941
|
-
* @method handleLabelSlotChange
|
|
4942
|
-
* @param {event} event - The event object representing the slot change.
|
|
4943
|
-
* @description Handles the slot change event for the label slot.
|
|
4944
|
-
*/
|
|
4945
|
-
handleLabelSlotChange (event) {
|
|
4946
|
-
|
|
4947
|
-
// Get the nodes from the event
|
|
4948
|
-
const nodes = event.target.assignedNodes();
|
|
4949
|
-
|
|
4950
|
-
// Guard clause for no nodes
|
|
4951
|
-
if (!nodes) {
|
|
4952
|
-
return;
|
|
4953
|
-
}
|
|
4954
|
-
|
|
4955
|
-
// Convert the nodes to a measurable array so we can get the length
|
|
4956
|
-
const nodesArr = Array.from(nodes);
|
|
4957
|
-
|
|
4958
|
-
// If the nodes array has a length, the dropdown is labeled
|
|
4959
|
-
this.labeled = nodesArr.length > 0;
|
|
4960
|
-
}
|
|
4961
|
-
|
|
4962
5257
|
/**
|
|
4963
5258
|
* Returns HTML for the common portion of the layouts.
|
|
4964
5259
|
* @private
|
|
@@ -4973,22 +5268,17 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4973
5268
|
class="${classMap(this.commonWrapperClasses)}" part="wrapper"
|
|
4974
5269
|
tabindex="${this.tabIndex}"
|
|
4975
5270
|
role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
4976
|
-
aria-expanded="${ifDefined(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4977
|
-
aria-controls="${ifDefined(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
5271
|
+
aria-expanded="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
5272
|
+
aria-controls="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4978
5273
|
aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
4979
5274
|
@focusin="${this.handleFocusin}"
|
|
4980
5275
|
@blur="${this.handleFocusOut}">
|
|
4981
|
-
<div class="triggerContentWrapper">
|
|
4982
|
-
<
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
<div class="triggerContent">
|
|
4986
|
-
<slot
|
|
4987
|
-
name="trigger"
|
|
4988
|
-
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4989
|
-
</div>
|
|
5276
|
+
<div class="triggerContentWrapper" id="triggerLabel">
|
|
5277
|
+
<slot
|
|
5278
|
+
name="trigger"
|
|
5279
|
+
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4990
5280
|
</div>
|
|
4991
|
-
${this.chevron
|
|
5281
|
+
${this.chevron ? html`
|
|
4992
5282
|
<div
|
|
4993
5283
|
id="showStateIcon"
|
|
4994
5284
|
class="chevron"
|
|
@@ -5009,11 +5299,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5009
5299
|
<div id="bibSizer" part="size"></div>
|
|
5010
5300
|
<${this.dropdownBibTag}
|
|
5011
5301
|
id="bib"
|
|
5302
|
+
shape="${this.shape}"
|
|
5012
5303
|
?data-show="${this.isPopoverVisible}"
|
|
5013
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
5014
|
-
?common="${this.common}"
|
|
5015
|
-
?rounded="${this.common || this.rounded}"
|
|
5016
|
-
?inset="${this.common || this.inset}">
|
|
5304
|
+
?isfullscreen="${this.isBibFullscreen}">
|
|
5017
5305
|
<div class="slotContent">
|
|
5018
5306
|
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5019
5307
|
</div>
|
|
@@ -5028,245 +5316,1240 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5028
5316
|
* @returns {html} - Returns HTML for the classic layout.
|
|
5029
5317
|
*/
|
|
5030
5318
|
renderLayoutClassic() {
|
|
5319
|
+
// TODO: check with Doug why this was never used?
|
|
5320
|
+
const helpTextClasses = {
|
|
5321
|
+
'helpText': true
|
|
5322
|
+
};
|
|
5031
5323
|
|
|
5032
5324
|
return html`
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
</div>
|
|
5069
|
-
<${this.helpTextTag} part="helpText" ?onDark=${this.onDark} ?error="${this.error}">
|
|
5070
|
-
<slot name="helpText"></slot>
|
|
5071
|
-
</${this.helpTextTag}>
|
|
5072
|
-
|
|
5073
|
-
<div id="bibSizer" part="size"></div>
|
|
5074
|
-
<${this.dropdownBibTag}
|
|
5075
|
-
id="bib"
|
|
5076
|
-
?data-show="${this.isPopoverVisible}"
|
|
5077
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
5078
|
-
?common="${this.common}"
|
|
5079
|
-
?rounded="${this.common || this.rounded}"
|
|
5080
|
-
?inset="${this.common || this.inset}"
|
|
5081
|
-
>
|
|
5082
|
-
<div class="slotContent">
|
|
5083
|
-
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5084
|
-
</div>
|
|
5085
|
-
</${this.dropdownBibTag}>
|
|
5086
|
-
</div>
|
|
5325
|
+
${this.renderBasicHtml(helpTextClasses)}
|
|
5326
|
+
`;
|
|
5327
|
+
}
|
|
5328
|
+
|
|
5329
|
+
/**
|
|
5330
|
+
* Returns HTML for the snowflake layout. Does not support type="*".
|
|
5331
|
+
* @private
|
|
5332
|
+
* @returns {html} - Returns HTML for the snowflake layout.
|
|
5333
|
+
*/
|
|
5334
|
+
renderLayoutSnowflake() {
|
|
5335
|
+
const helpTextClasses = {
|
|
5336
|
+
'helpText': true,
|
|
5337
|
+
'leftIndent': true,
|
|
5338
|
+
'rightIndent': true
|
|
5339
|
+
};
|
|
5340
|
+
|
|
5341
|
+
return html`
|
|
5342
|
+
${this.renderBasicHtml(helpTextClasses)}
|
|
5343
|
+
`;
|
|
5344
|
+
}
|
|
5345
|
+
|
|
5346
|
+
/**
|
|
5347
|
+
* Returns HTML for the emphasized layout. Does not support type="*".
|
|
5348
|
+
* @private
|
|
5349
|
+
* @returns {html} - Returns HTML for the emphasized layout.
|
|
5350
|
+
*/
|
|
5351
|
+
renderLayoutEmphasized() {
|
|
5352
|
+
const helpTextClasses = {
|
|
5353
|
+
'helpText': true,
|
|
5354
|
+
'leftIndent': this.shape.toLowerCase().includes('pill') && !this.shape.toLowerCase().includes('right'),
|
|
5355
|
+
'rightIndent': this.shape.toLowerCase().includes('pill') && !this.shape.toLowerCase().includes('left')
|
|
5356
|
+
};
|
|
5357
|
+
|
|
5358
|
+
return html`
|
|
5359
|
+
${this.renderBasicHtml(helpTextClasses)}
|
|
5087
5360
|
`;
|
|
5088
5361
|
}
|
|
5089
5362
|
|
|
5090
5363
|
/**
|
|
5091
|
-
*
|
|
5092
|
-
* @private
|
|
5093
|
-
* @
|
|
5364
|
+
* Logic to determine the layout of the component.
|
|
5365
|
+
* @private
|
|
5366
|
+
* @param {string} [ForcedLayout] - Used to force a specific layout, pass in the layout name to use.
|
|
5367
|
+
* @returns {HTMLCollection} - Returns the HTML for the layout.
|
|
5368
|
+
*/
|
|
5369
|
+
renderLayout(ForcedLayout) {
|
|
5370
|
+
const layout = ForcedLayout || this.layout;
|
|
5371
|
+
|
|
5372
|
+
switch (layout) {
|
|
5373
|
+
case 'emphasized':
|
|
5374
|
+
return this.renderLayoutEmphasized();
|
|
5375
|
+
case 'emphasized-left':
|
|
5376
|
+
return this.renderLayoutEmphasized();
|
|
5377
|
+
case 'emphasized-right':
|
|
5378
|
+
return this.renderLayoutEmphasized();
|
|
5379
|
+
case 'snowflake':
|
|
5380
|
+
return this.renderLayoutSnowflake();
|
|
5381
|
+
case 'snowflake-left':
|
|
5382
|
+
return this.renderLayoutSnowflake();
|
|
5383
|
+
case 'snowflake-right':
|
|
5384
|
+
return this.renderLayoutSnowflake();
|
|
5385
|
+
default:
|
|
5386
|
+
return this.renderLayoutClassic();
|
|
5387
|
+
}
|
|
5388
|
+
}
|
|
5389
|
+
}
|
|
5390
|
+
|
|
5391
|
+
var dropdownVersion = '3.0.0';
|
|
5392
|
+
|
|
5393
|
+
var colorCss$3 = css`#headerContainer{box-shadow:var(--ds-auro-dropdownbib-header-boxshadow-color)}#footerContainer{background-color:var(--ds-auro-dropdownbib-footer-container-color)}`;
|
|
5394
|
+
|
|
5395
|
+
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)}`;
|
|
5396
|
+
|
|
5397
|
+
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)}`;
|
|
5398
|
+
|
|
5399
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5400
|
+
// See LICENSE in the project root for license information.
|
|
5401
|
+
|
|
5402
|
+
// ---------------------------------------------------------------------
|
|
5403
|
+
|
|
5404
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
5405
|
+
|
|
5406
|
+
let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
|
|
5407
|
+
|
|
5408
|
+
/* eslint-disable jsdoc/require-param */
|
|
5409
|
+
|
|
5410
|
+
/**
|
|
5411
|
+
* This will register a new custom element with the browser.
|
|
5412
|
+
* @param {String} name - The name of the custom element.
|
|
5413
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
5414
|
+
* @returns {void}
|
|
5415
|
+
*/
|
|
5416
|
+
registerComponent(name, componentClass) {
|
|
5417
|
+
if (!customElements.get(name)) {
|
|
5418
|
+
customElements.define(name, class extends componentClass {});
|
|
5419
|
+
}
|
|
5420
|
+
}
|
|
5421
|
+
|
|
5422
|
+
/**
|
|
5423
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
5424
|
+
* @returns {void}
|
|
5425
|
+
*/
|
|
5426
|
+
closestElement(
|
|
5427
|
+
selector, // selector like in .closest()
|
|
5428
|
+
base = this, // extra functionality to skip a parent
|
|
5429
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
5430
|
+
!el || el === document || el === window
|
|
5431
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
5432
|
+
: found
|
|
5433
|
+
? found // found a selector INside this element
|
|
5434
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
5435
|
+
) {
|
|
5436
|
+
return __Closest(base);
|
|
5437
|
+
}
|
|
5438
|
+
/* eslint-enable jsdoc/require-param */
|
|
5439
|
+
|
|
5440
|
+
/**
|
|
5441
|
+
* 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.
|
|
5442
|
+
* @param {Object} elem - The element to check.
|
|
5443
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
5444
|
+
* @returns {void}
|
|
5445
|
+
*/
|
|
5446
|
+
handleComponentTagRename(elem, tagName) {
|
|
5447
|
+
const tag = tagName.toLowerCase();
|
|
5448
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
5449
|
+
|
|
5450
|
+
if (elemTag !== tag) {
|
|
5451
|
+
elem.setAttribute(tag, true);
|
|
5452
|
+
}
|
|
5453
|
+
}
|
|
5454
|
+
|
|
5455
|
+
/**
|
|
5456
|
+
* Validates if an element is a specific Auro component.
|
|
5457
|
+
* @param {Object} elem - The element to validate.
|
|
5458
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
5459
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
5460
|
+
*/
|
|
5461
|
+
elementMatch(elem, tagName) {
|
|
5462
|
+
const tag = tagName.toLowerCase();
|
|
5463
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
5464
|
+
|
|
5465
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
5466
|
+
}
|
|
5467
|
+
};
|
|
5468
|
+
|
|
5469
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5470
|
+
// See LICENSE in the project root for license information.
|
|
5471
|
+
|
|
5472
|
+
|
|
5473
|
+
class AuroDependencyVersioning {
|
|
5474
|
+
|
|
5475
|
+
/**
|
|
5476
|
+
* Generates a unique string to be used for child auro element naming.
|
|
5477
|
+
* @private
|
|
5478
|
+
* @param {string} baseName - Defines the first part of the unique element name.
|
|
5479
|
+
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
5480
|
+
* @returns {string} - Unique string to be used for naming.
|
|
5481
|
+
*/
|
|
5482
|
+
generateElementName(baseName, version) {
|
|
5483
|
+
let result = baseName;
|
|
5484
|
+
|
|
5485
|
+
result += '-';
|
|
5486
|
+
result += version.replace(/[.]/g, '_');
|
|
5487
|
+
|
|
5488
|
+
return result;
|
|
5489
|
+
}
|
|
5490
|
+
|
|
5491
|
+
/**
|
|
5492
|
+
* Generates a unique string to be used for child auro element naming.
|
|
5493
|
+
* @param {string} baseName - Defines the first part of the unique element name.
|
|
5494
|
+
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
5495
|
+
* @returns {string} - Unique string to be used for naming.
|
|
5496
|
+
*/
|
|
5497
|
+
generateTag(baseName, version, tagClass) {
|
|
5498
|
+
const elementName = this.generateElementName(baseName, version);
|
|
5499
|
+
const tag = literal`${unsafeStatic(elementName)}`;
|
|
5500
|
+
|
|
5501
|
+
if (!customElements.get(elementName)) {
|
|
5502
|
+
customElements.define(elementName, class extends tagClass {});
|
|
5503
|
+
}
|
|
5504
|
+
|
|
5505
|
+
return tag;
|
|
5506
|
+
}
|
|
5507
|
+
}
|
|
5508
|
+
|
|
5509
|
+
/**
|
|
5510
|
+
* Private module-level WeakMap to hold MutationObservers for each host element.
|
|
5511
|
+
*/
|
|
5512
|
+
const _observers = new WeakMap();
|
|
5513
|
+
|
|
5514
|
+
/**
|
|
5515
|
+
* Private module-level WeakMap to hold attribute matchers and targets for each host element.
|
|
5516
|
+
* Structure: {
|
|
5517
|
+
* host: {
|
|
5518
|
+
* matchers: Set<Function>,
|
|
5519
|
+
* targets: Map<HTMLElement, Map<Function, {removeOriginal: boolean, currentAttributes: Map<string, string>}>>
|
|
5520
|
+
* }
|
|
5521
|
+
* }
|
|
5522
|
+
*/
|
|
5523
|
+
const _transportConfig = new WeakMap();
|
|
5524
|
+
|
|
5525
|
+
/**
|
|
5526
|
+
* Transfers all matching attributes from a host element to a target element and observes for future changes.
|
|
5527
|
+
*
|
|
5528
|
+
* @param {Object} params - The parameters for the function.
|
|
5529
|
+
* @param {HTMLElement} params.host - The host element from which attributes will be transported.
|
|
5530
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
5531
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove the attributes from the host element.
|
|
5532
|
+
* @param {boolean} [params.observe=true] - Whether to attach a MutationObserver to the host element.
|
|
5533
|
+
* @returns {Function} A function to detach the observer when no longer needed.
|
|
5534
|
+
* @throws {TypeError} If the host or target parameters are not instances of HTMLElement.
|
|
5535
|
+
*/
|
|
5536
|
+
const transportAttributes = ({ host, target, match, removeOriginal = true }) => {
|
|
5537
|
+
// Guard Clause: Ensure host is valid HTMLElement instance
|
|
5538
|
+
if (typeof host !== 'object' || !(host instanceof HTMLElement)) {
|
|
5539
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "host" parameter must be an instance of HTMLElement.');
|
|
5540
|
+
}
|
|
5541
|
+
|
|
5542
|
+
// Guard Clause: Ensure target is valid HTMLElement instance
|
|
5543
|
+
if (typeof target !== 'object' || !(target instanceof HTMLElement)) {
|
|
5544
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "target" parameter must be an instance of HTMLElement.');
|
|
5545
|
+
}
|
|
5546
|
+
|
|
5547
|
+
// Guard Clause: Ensure match is a function
|
|
5548
|
+
if (typeof match !== 'function') {
|
|
5549
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "match" parameter must be a function.');
|
|
5550
|
+
}
|
|
5551
|
+
|
|
5552
|
+
// Guard Clause: Ensure removeOriginal is a boolean
|
|
5553
|
+
if (typeof removeOriginal !== 'boolean') {
|
|
5554
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "removeOriginal" parameter must be a boolean.');
|
|
5555
|
+
}
|
|
5556
|
+
|
|
5557
|
+
// Register this transport and get cleanup function
|
|
5558
|
+
return _registerTransport({
|
|
5559
|
+
host,
|
|
5560
|
+
target,
|
|
5561
|
+
matcher: match,
|
|
5562
|
+
removeOriginal
|
|
5563
|
+
});
|
|
5564
|
+
};
|
|
5565
|
+
|
|
5566
|
+
/**
|
|
5567
|
+
* Registers a matcher and target for a host element and attaches an observer if needed.
|
|
5568
|
+
*
|
|
5569
|
+
* @param {Object} params - The parameters object.
|
|
5570
|
+
* @param {HTMLElement} params.host - The host element to observe.
|
|
5571
|
+
* @param {HTMLElement} params.target - The target element to receive attributes.
|
|
5572
|
+
* @param {Function} params.matcher - Function that determines which attributes to transport.
|
|
5573
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes.
|
|
5574
|
+
* @param {boolean} [params.observe=true] - Whether to observe for attribute changes.
|
|
5575
|
+
* @returns {Function} Function to detach the specific matcher and target pairing.
|
|
5576
|
+
* @private
|
|
5577
|
+
*/
|
|
5578
|
+
const _registerTransport = ({ host, target, matcher, removeOriginal = true }) => {
|
|
5579
|
+
// Initialize config for this host if it doesn't exist
|
|
5580
|
+
if (!_transportConfig.has(host)) {
|
|
5581
|
+
_transportConfig.set(host, {
|
|
5582
|
+
matchers: new Set(),
|
|
5583
|
+
targets: new Map()
|
|
5584
|
+
});
|
|
5585
|
+
}
|
|
5586
|
+
|
|
5587
|
+
const config = _transportConfig.get(host);
|
|
5588
|
+
|
|
5589
|
+
// Add the matcher to the set of matchers for this host
|
|
5590
|
+
config.matchers.add(matcher);
|
|
5591
|
+
|
|
5592
|
+
// Initialize target entry if it doesn't exist
|
|
5593
|
+
if (!config.targets.has(target)) {
|
|
5594
|
+
config.targets.set(target, new Map());
|
|
5595
|
+
}
|
|
5596
|
+
|
|
5597
|
+
// Store the matcher with its removeOriginal setting for this target
|
|
5598
|
+
config.targets.get(target).set(matcher, {
|
|
5599
|
+
removeOriginal,
|
|
5600
|
+
currentAttributes: new Map()
|
|
5601
|
+
});
|
|
5602
|
+
|
|
5603
|
+
// Perform initial attribute transport
|
|
5604
|
+
_transportAttributes({ host, target, matcher, removeOriginal });
|
|
5605
|
+
|
|
5606
|
+
// Attach observer
|
|
5607
|
+
_attachObserver(host);
|
|
5608
|
+
|
|
5609
|
+
// Return cleanup function and utility functions
|
|
5610
|
+
return {
|
|
5611
|
+
cleanup: () => _cleanupTransport(host, target, matcher),
|
|
5612
|
+
getObservedAttributes: () => _getObservedAttributes(host, target, matcher),
|
|
5613
|
+
getObservedAttribute: (attr) => _getObservedAttribute(host, target, matcher, attr),
|
|
5614
|
+
}
|
|
5615
|
+
};
|
|
5616
|
+
|
|
5617
|
+
/**
|
|
5618
|
+
* Cleans up resources associated with a specific matcher and target for a host element.
|
|
5619
|
+
*
|
|
5620
|
+
* @param {HTMLElement} host - The host element
|
|
5621
|
+
* @param {HTMLElement} target - The target element
|
|
5622
|
+
* @param {Function} matcher - The matcher function
|
|
5623
|
+
* @private
|
|
5624
|
+
*/
|
|
5625
|
+
const _cleanupTransport = (host, target, matcher) => {
|
|
5626
|
+
const config = _transportConfig.get(host);
|
|
5627
|
+
if (!config) return;
|
|
5628
|
+
|
|
5629
|
+
// Remove this matcher from this target
|
|
5630
|
+
const targetMatchers = config.targets.get(target);
|
|
5631
|
+
if (targetMatchers) {
|
|
5632
|
+
targetMatchers.delete(matcher);
|
|
5633
|
+
|
|
5634
|
+
// If this target has no more matchers, remove it
|
|
5635
|
+
if (targetMatchers.size === 0) {
|
|
5636
|
+
config.targets.delete(target);
|
|
5637
|
+
}
|
|
5638
|
+
}
|
|
5639
|
+
|
|
5640
|
+
// Check if this matcher is still used by any target
|
|
5641
|
+
let matcherStillUsed = false;
|
|
5642
|
+
for (const matcherMap of config.targets.values()) {
|
|
5643
|
+
if (matcherMap.has(matcher)) {
|
|
5644
|
+
matcherStillUsed = true;
|
|
5645
|
+
break;
|
|
5646
|
+
}
|
|
5647
|
+
}
|
|
5648
|
+
|
|
5649
|
+
// If not used anymore, remove from matchers set
|
|
5650
|
+
if (!matcherStillUsed) {
|
|
5651
|
+
config.matchers.delete(matcher);
|
|
5652
|
+
}
|
|
5653
|
+
|
|
5654
|
+
// If no more targets or matchers, detach observer
|
|
5655
|
+
if (config.targets.size === 0 || config.matchers.size === 0) {
|
|
5656
|
+
_detachObserver(host);
|
|
5657
|
+
}
|
|
5658
|
+
};
|
|
5659
|
+
|
|
5660
|
+
/**
|
|
5661
|
+
* Generic function to transport attributes from a host element to a target element.
|
|
5662
|
+
*
|
|
5663
|
+
* @param {Object} params - The parameters object.
|
|
5664
|
+
* @param {HTMLElement} params.host - The host element from which to transport attributes.
|
|
5665
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
5666
|
+
* @param {Function} params.matcher - Function that takes an attribute name and returns true if it should be transported.
|
|
5667
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes from host.
|
|
5668
|
+
* @returns {void}
|
|
5669
|
+
* @private
|
|
5670
|
+
*/
|
|
5671
|
+
const _transportAttributes = ({ host, target, matcher, removeOriginal = true }) => {
|
|
5672
|
+
// Get a list of all matching attributes on the host element and their values
|
|
5673
|
+
const matchingAttributes = host.getAttributeNames()
|
|
5674
|
+
.filter(attr => matcher(attr))
|
|
5675
|
+
.reduce((acc, attr) => {
|
|
5676
|
+
acc[attr] = host.getAttribute(attr);
|
|
5677
|
+
return acc;
|
|
5678
|
+
}, {});
|
|
5679
|
+
|
|
5680
|
+
// Move matching attributes to the target element, removing them from the host if removeOriginal is true
|
|
5681
|
+
Object.entries(matchingAttributes).forEach(([key, value]) => {
|
|
5682
|
+
_setObservedAttribute(host, target, matcher, key, value);
|
|
5683
|
+
target.setAttribute(key, value);
|
|
5684
|
+
if (removeOriginal) {
|
|
5685
|
+
host.removeAttribute(key);
|
|
5686
|
+
}
|
|
5687
|
+
});
|
|
5688
|
+
};
|
|
5689
|
+
|
|
5690
|
+
/**
|
|
5691
|
+
* Attaches a MutationObserver to the host element to monitor attribute changes.
|
|
5692
|
+
*
|
|
5693
|
+
* @param {HTMLElement} host - The element to observe for attribute changes.
|
|
5694
|
+
* @returns {MutationObserver} The observer instance.
|
|
5695
|
+
* @private
|
|
5696
|
+
*/
|
|
5697
|
+
const _attachObserver = (host) => {
|
|
5698
|
+
// If an observer for this host already exists, return it
|
|
5699
|
+
if (_observers.has(host)) {
|
|
5700
|
+
return _observers.get(host);
|
|
5701
|
+
}
|
|
5702
|
+
|
|
5703
|
+
// Create a new MutationObserver
|
|
5704
|
+
const observer = new MutationObserver((mutations) => {
|
|
5705
|
+
const config = _transportConfig.get(host);
|
|
5706
|
+
if (!config) return;
|
|
5707
|
+
|
|
5708
|
+
// For each mutation affecting attributes
|
|
5709
|
+
mutations
|
|
5710
|
+
.filter(mutation => mutation.type === 'attributes')
|
|
5711
|
+
.forEach(mutation => {
|
|
5712
|
+
const attributeName = mutation.attributeName;
|
|
5713
|
+
|
|
5714
|
+
// Find matchers that care about this attribute
|
|
5715
|
+
for (const matcher of config.matchers) {
|
|
5716
|
+
if (matcher(attributeName)) {
|
|
5717
|
+
// For each target that uses this matcher
|
|
5718
|
+
for (const [target, matcherConfigs] of config.targets.entries()) {
|
|
5719
|
+
if (matcherConfigs.has(matcher)) {
|
|
5720
|
+
const { removeOriginal } = matcherConfigs.get(matcher);
|
|
5721
|
+
_transportAttributes({
|
|
5722
|
+
host,
|
|
5723
|
+
target,
|
|
5724
|
+
matcher,
|
|
5725
|
+
removeOriginal
|
|
5726
|
+
});
|
|
5727
|
+
}
|
|
5728
|
+
}
|
|
5729
|
+
}
|
|
5730
|
+
}
|
|
5731
|
+
});
|
|
5732
|
+
});
|
|
5733
|
+
|
|
5734
|
+
// Start observing attribute changes
|
|
5735
|
+
observer.observe(host, { attributes: true });
|
|
5736
|
+
|
|
5737
|
+
// Store the observer
|
|
5738
|
+
_observers.set(host, observer);
|
|
5739
|
+
|
|
5740
|
+
return observer;
|
|
5741
|
+
};
|
|
5742
|
+
|
|
5743
|
+
/**
|
|
5744
|
+
* Detaches and cleans up the MutationObserver for a given host element.
|
|
5745
|
+
*
|
|
5746
|
+
* @param {HTMLElement} host - The element whose observer should be detached.
|
|
5747
|
+
* @private
|
|
5748
|
+
*/
|
|
5749
|
+
const _detachObserver = (host) => {
|
|
5750
|
+
if (_observers.has(host)) {
|
|
5751
|
+
const observer = _observers.get(host);
|
|
5752
|
+
observer.disconnect();
|
|
5753
|
+
_observers.delete(host);
|
|
5754
|
+
}
|
|
5755
|
+
|
|
5756
|
+
// Clean up the transport config as well
|
|
5757
|
+
if (_transportConfig.has(host)) {
|
|
5758
|
+
_transportConfig.delete(host);
|
|
5759
|
+
}
|
|
5760
|
+
};
|
|
5761
|
+
|
|
5762
|
+
/**
|
|
5763
|
+
* Gets the matcher configuration for a specific host, target, and matcher
|
|
5764
|
+
* @param {HTMLElement} host - The host element
|
|
5765
|
+
* @param {HTMLElement} target - The target element
|
|
5766
|
+
* @param {Function} matcher - The matcher function
|
|
5767
|
+
* @returns {Object|undefined} The matcher configuration if found
|
|
5768
|
+
* @private
|
|
5769
|
+
*/
|
|
5770
|
+
const _getMatcherConfig = (host, target, matcher) => {
|
|
5771
|
+
const config = _transportConfig.get(host);
|
|
5772
|
+
if (!config) return undefined;
|
|
5773
|
+
|
|
5774
|
+
const targetMatchers = config.targets.get(target);
|
|
5775
|
+
if (!targetMatchers) return undefined;
|
|
5776
|
+
|
|
5777
|
+
return targetMatchers.get(matcher);
|
|
5778
|
+
};
|
|
5779
|
+
|
|
5780
|
+
/**
|
|
5781
|
+
* Sets an observed attribute value
|
|
5782
|
+
* @param {HTMLElement} host - The host element
|
|
5783
|
+
* @param {HTMLElement} target - The target element
|
|
5784
|
+
* @param {Function} matcher - The matcher function
|
|
5785
|
+
* @param {string} key - The attribute name
|
|
5786
|
+
* @param {string} value - The attribute value
|
|
5787
|
+
* @private
|
|
5788
|
+
*/
|
|
5789
|
+
const _setObservedAttribute = (host, target, matcher, key, value) => {
|
|
5790
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5791
|
+
if (matcherConfig) {
|
|
5792
|
+
matcherConfig.currentAttributes.set(key, value);
|
|
5793
|
+
}
|
|
5794
|
+
};
|
|
5795
|
+
|
|
5796
|
+
const _getObservedAttribute = (host, target, matcher, attr) => {
|
|
5797
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5798
|
+
if (matcherConfig) return matcherConfig.currentAttributes.get(attr);
|
|
5799
|
+
return undefined;
|
|
5800
|
+
};
|
|
5801
|
+
|
|
5802
|
+
const _getObservedAttributes = (host, target, matcher) => {
|
|
5803
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5804
|
+
if (matcherConfig) return Array.from(matcherConfig.currentAttributes.entries());
|
|
5805
|
+
return [];
|
|
5806
|
+
};
|
|
5807
|
+
|
|
5808
|
+
const _matchers = {
|
|
5809
|
+
'aria-': attr => attr.startsWith('aria-'),
|
|
5810
|
+
'role': attr => attr.match(/^role$/)
|
|
5811
|
+
};
|
|
5812
|
+
|
|
5813
|
+
const transportAllA11yAttributes = ({ host, target, removeOriginal = true }) => {
|
|
5814
|
+
return transportAttributes({
|
|
5815
|
+
host,
|
|
5816
|
+
target,
|
|
5817
|
+
match: attr => {
|
|
5818
|
+
for (const key in _matchers) {
|
|
5819
|
+
if (_matchers[key](attr)) return true;
|
|
5820
|
+
}
|
|
5821
|
+
return false;
|
|
5822
|
+
},
|
|
5823
|
+
removeOriginal
|
|
5824
|
+
});
|
|
5825
|
+
};
|
|
5826
|
+
|
|
5827
|
+
let AuroElement$1 = class AuroElement extends LitElement {
|
|
5828
|
+
|
|
5829
|
+
/**
|
|
5830
|
+
* @type {Object} return object from transportAttributes via a11yUtilities
|
|
5831
|
+
* @property {Function} cleanup - Function to clean up the attribute watcher.
|
|
5832
|
+
* @property {Function} getCurrentAttributes - Function to get the current attributes being watched and their values.
|
|
5833
|
+
* @property {Function} getObservedAttribute - Function to get the value of a specific observed attribute by name.
|
|
5834
|
+
* @private
|
|
5835
|
+
*/
|
|
5836
|
+
attributeWatcher;
|
|
5837
|
+
|
|
5838
|
+
static get properties() {
|
|
5839
|
+
return {
|
|
5840
|
+
|
|
5841
|
+
/**
|
|
5842
|
+
* Defines the layout of an element.
|
|
5843
|
+
* @default {'default'}
|
|
5844
|
+
*/
|
|
5845
|
+
layout: {
|
|
5846
|
+
type: String,
|
|
5847
|
+
attribute: "layout",
|
|
5848
|
+
reflect: true
|
|
5849
|
+
},
|
|
5850
|
+
|
|
5851
|
+
/**
|
|
5852
|
+
* Defines the shape of an element.
|
|
5853
|
+
* @property {'default', 'rounded', 'pill', 'circle'}
|
|
5854
|
+
* @default {'default'}
|
|
5855
|
+
*/
|
|
5856
|
+
shape: {
|
|
5857
|
+
type: String,
|
|
5858
|
+
attribute: "shape",
|
|
5859
|
+
reflect: true
|
|
5860
|
+
},
|
|
5861
|
+
|
|
5862
|
+
/**
|
|
5863
|
+
* Defines the size of an element.
|
|
5864
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'}
|
|
5865
|
+
* @default {'md'}
|
|
5866
|
+
*/
|
|
5867
|
+
size: {
|
|
5868
|
+
type: String,
|
|
5869
|
+
attribute: "size",
|
|
5870
|
+
reflect: true
|
|
5871
|
+
},
|
|
5872
|
+
|
|
5873
|
+
/**
|
|
5874
|
+
* This Boolean attribute lets you specify that the element should be rendered in dark mode.
|
|
5875
|
+
* @default {false}
|
|
5876
|
+
*/
|
|
5877
|
+
onDark: {
|
|
5878
|
+
type: Boolean,
|
|
5879
|
+
attribute: "ondark",
|
|
5880
|
+
reflect: true
|
|
5881
|
+
},
|
|
5882
|
+
|
|
5883
|
+
/**
|
|
5884
|
+
* A reference to the wrapper element in the shadow DOM.
|
|
5885
|
+
* This is used to apply layout and shape classes dynamically.
|
|
5886
|
+
* @type {HTMLElement|null}
|
|
5887
|
+
* @default {null}
|
|
5888
|
+
* @private
|
|
5889
|
+
*/
|
|
5890
|
+
wrapper: {
|
|
5891
|
+
attribute: false,
|
|
5892
|
+
reflect: false
|
|
5893
|
+
}
|
|
5894
|
+
};
|
|
5895
|
+
}
|
|
5896
|
+
|
|
5897
|
+
|
|
5898
|
+
|
|
5899
|
+
resetShapeClasses() {
|
|
5900
|
+
if (this.shape && this.size) {
|
|
5901
|
+
|
|
5902
|
+
if (this.wrapper) {
|
|
5903
|
+
this.wrapper.classList.forEach((className) => {
|
|
5904
|
+
if (className.startsWith('shape-')) {
|
|
5905
|
+
this.wrapper.classList.remove(className);
|
|
5906
|
+
}
|
|
5907
|
+
});
|
|
5908
|
+
|
|
5909
|
+
this.wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
5910
|
+
}
|
|
5911
|
+
}
|
|
5912
|
+
}
|
|
5913
|
+
|
|
5914
|
+
resetLayoutClasses() {
|
|
5915
|
+
if (this.layout) {
|
|
5916
|
+
if (this.wrapper) {
|
|
5917
|
+
this.wrapper.classList.forEach((className) => {
|
|
5918
|
+
if (className.startsWith('layout-')) {
|
|
5919
|
+
this.wrapper.classList.remove(className);
|
|
5920
|
+
}
|
|
5921
|
+
});
|
|
5922
|
+
|
|
5923
|
+
this.wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
|
|
5924
|
+
}
|
|
5925
|
+
}
|
|
5926
|
+
}
|
|
5927
|
+
|
|
5928
|
+
updateComponentArchitecture() {
|
|
5929
|
+
this.resetLayoutClasses();
|
|
5930
|
+
this.resetShapeClasses();
|
|
5931
|
+
}
|
|
5932
|
+
|
|
5933
|
+
updated(changedProperties) {
|
|
5934
|
+
if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
|
|
5935
|
+
this.updateComponentArchitecture();
|
|
5936
|
+
}
|
|
5937
|
+
}
|
|
5938
|
+
|
|
5939
|
+
firstUpdated() {
|
|
5940
|
+
super.firstUpdated();
|
|
5941
|
+
|
|
5942
|
+
// Set a reference to the wrapper element in the shadow DOM
|
|
5943
|
+
this.wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
5944
|
+
|
|
5945
|
+
// Initialize the transportation of ARIA attributes to the target element and get the disconnect function for cleanup
|
|
5946
|
+
this.attributeWatcher = transportAllA11yAttributes({ host: this, target: this.shadowRoot.querySelector('.wrapper') });
|
|
5947
|
+
}
|
|
5948
|
+
|
|
5949
|
+
disconnectedCallback() {
|
|
5950
|
+
super.disconnectedCallback();
|
|
5951
|
+
|
|
5952
|
+
// Cleanup the ARIA observer if it exists
|
|
5953
|
+
if (this.attributeWatcher) {
|
|
5954
|
+
this.attributeWatcher.cleanup();
|
|
5955
|
+
this.attributeWatcher = null;
|
|
5956
|
+
}
|
|
5957
|
+
}
|
|
5958
|
+
|
|
5959
|
+
// Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
|
|
5960
|
+
// This will catch if an invalid layout value is passed in and render the default layout if so.
|
|
5961
|
+
render() {
|
|
5962
|
+
try {
|
|
5963
|
+
return this.renderLayout();
|
|
5964
|
+
} catch (error) {
|
|
5965
|
+
// failed to get the defined layout
|
|
5966
|
+
console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
|
|
5967
|
+
|
|
5968
|
+
// fallback to the default layout
|
|
5969
|
+
return this.getLayout('default');
|
|
5970
|
+
}
|
|
5971
|
+
}
|
|
5972
|
+
};
|
|
5973
|
+
|
|
5974
|
+
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}`;
|
|
5975
|
+
|
|
5976
|
+
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)}`;
|
|
5977
|
+
|
|
5978
|
+
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}`;
|
|
5979
|
+
|
|
5980
|
+
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}`;
|
|
5981
|
+
|
|
5982
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5983
|
+
// See LICENSE in the project root for license information.
|
|
5984
|
+
|
|
5985
|
+
// ---------------------------------------------------------------------
|
|
5986
|
+
|
|
5987
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
5988
|
+
|
|
5989
|
+
let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
5990
|
+
|
|
5991
|
+
/* eslint-disable jsdoc/require-param */
|
|
5992
|
+
|
|
5993
|
+
/**
|
|
5994
|
+
* This will register a new custom element with the browser.
|
|
5995
|
+
* @param {String} name - The name of the custom element.
|
|
5996
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
5997
|
+
* @returns {void}
|
|
5998
|
+
*/
|
|
5999
|
+
registerComponent(name, componentClass) {
|
|
6000
|
+
if (!customElements.get(name)) {
|
|
6001
|
+
customElements.define(name, class extends componentClass {});
|
|
6002
|
+
}
|
|
6003
|
+
}
|
|
6004
|
+
|
|
6005
|
+
/**
|
|
6006
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
6007
|
+
* @returns {void}
|
|
6008
|
+
*/
|
|
6009
|
+
closestElement(
|
|
6010
|
+
selector, // selector like in .closest()
|
|
6011
|
+
base = this, // extra functionality to skip a parent
|
|
6012
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
6013
|
+
!el || el === document || el === window
|
|
6014
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
6015
|
+
: found
|
|
6016
|
+
? found // found a selector INside this element
|
|
6017
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
6018
|
+
) {
|
|
6019
|
+
return __Closest(base);
|
|
6020
|
+
}
|
|
6021
|
+
/* eslint-enable jsdoc/require-param */
|
|
6022
|
+
|
|
6023
|
+
/**
|
|
6024
|
+
* 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.
|
|
6025
|
+
* @param {Object} elem - The element to check.
|
|
6026
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
6027
|
+
* @returns {void}
|
|
6028
|
+
*/
|
|
6029
|
+
handleComponentTagRename(elem, tagName) {
|
|
6030
|
+
const tag = tagName.toLowerCase();
|
|
6031
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6032
|
+
|
|
6033
|
+
if (elemTag !== tag) {
|
|
6034
|
+
elem.setAttribute(tag, true);
|
|
6035
|
+
}
|
|
6036
|
+
}
|
|
6037
|
+
|
|
6038
|
+
/**
|
|
6039
|
+
* Validates if an element is a specific Auro component.
|
|
6040
|
+
* @param {Object} elem - The element to validate.
|
|
6041
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
6042
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
6043
|
+
*/
|
|
6044
|
+
elementMatch(elem, tagName) {
|
|
6045
|
+
const tag = tagName.toLowerCase();
|
|
6046
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6047
|
+
|
|
6048
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
6049
|
+
}
|
|
6050
|
+
};
|
|
6051
|
+
|
|
6052
|
+
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}}`;
|
|
6053
|
+
|
|
6054
|
+
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}`;
|
|
6055
|
+
|
|
6056
|
+
var tokensCss$1 = css`:host{--ds-auro-loader-background-color:currentcolor;--ds-auro-loader-border-color:currentcolor;--ds-auro-loader-color:currentcolor}`;
|
|
6057
|
+
|
|
6058
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6059
|
+
// See LICENSE in the project root for license information.
|
|
6060
|
+
|
|
6061
|
+
|
|
6062
|
+
class AuroLoader extends LitElement {
|
|
6063
|
+
constructor() {
|
|
6064
|
+
super();
|
|
6065
|
+
|
|
6066
|
+
/**
|
|
6067
|
+
* @private
|
|
6068
|
+
*/
|
|
6069
|
+
this.keys = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
6070
|
+
|
|
6071
|
+
/**
|
|
6072
|
+
* @private
|
|
6073
|
+
*/
|
|
6074
|
+
this.mdCount = 3;
|
|
6075
|
+
|
|
6076
|
+
/**
|
|
6077
|
+
* @private
|
|
6078
|
+
*/
|
|
6079
|
+
this.smCount = 2;
|
|
6080
|
+
|
|
6081
|
+
/**
|
|
6082
|
+
* @private
|
|
6083
|
+
*/
|
|
6084
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2();
|
|
6085
|
+
|
|
6086
|
+
this.orbit = false;
|
|
6087
|
+
this.ringworm = false;
|
|
6088
|
+
this.laser = false;
|
|
6089
|
+
this.pulse = false;
|
|
6090
|
+
}
|
|
6091
|
+
|
|
6092
|
+
// function to define props used within the scope of this component
|
|
6093
|
+
static get properties() {
|
|
6094
|
+
return {
|
|
6095
|
+
|
|
6096
|
+
/**
|
|
6097
|
+
* Sets loader to laser type.
|
|
6098
|
+
*/
|
|
6099
|
+
laser: {
|
|
6100
|
+
type: Boolean,
|
|
6101
|
+
reflect: true
|
|
6102
|
+
},
|
|
6103
|
+
|
|
6104
|
+
/**
|
|
6105
|
+
* Sets loader to orbit type.
|
|
6106
|
+
*/
|
|
6107
|
+
orbit: {
|
|
6108
|
+
type: Boolean,
|
|
6109
|
+
reflect: true
|
|
6110
|
+
},
|
|
6111
|
+
|
|
6112
|
+
/**
|
|
6113
|
+
* Sets loader to pulse type.
|
|
6114
|
+
*/
|
|
6115
|
+
pulse: {
|
|
6116
|
+
type: Boolean,
|
|
6117
|
+
reflect: true
|
|
6118
|
+
},
|
|
6119
|
+
|
|
6120
|
+
/**
|
|
6121
|
+
* Sets loader to ringworm type.
|
|
6122
|
+
*/
|
|
6123
|
+
ringworm: {
|
|
6124
|
+
type: Boolean,
|
|
6125
|
+
reflect: true
|
|
6126
|
+
}
|
|
6127
|
+
};
|
|
6128
|
+
}
|
|
6129
|
+
|
|
6130
|
+
static get styles() {
|
|
6131
|
+
return [
|
|
6132
|
+
css`${styleCss$2}`,
|
|
6133
|
+
css`${colorCss$1}`,
|
|
6134
|
+
css`${tokensCss$1}`
|
|
6135
|
+
];
|
|
6136
|
+
}
|
|
6137
|
+
|
|
6138
|
+
/**
|
|
6139
|
+
* This will register this element with the browser.
|
|
6140
|
+
* @param {string} [name="auro-loader"] - The name of element that you want to register to.
|
|
6141
|
+
*
|
|
6142
|
+
* @example
|
|
6143
|
+
* AuroLoader.register("custom-loader") // this will register this element to <custom-loader/>
|
|
6144
|
+
*
|
|
6145
|
+
*/
|
|
6146
|
+
static register(name = "auro-loader") {
|
|
6147
|
+
AuroLibraryRuntimeUtils$2.prototype.registerComponent(name, AuroLoader);
|
|
6148
|
+
}
|
|
6149
|
+
|
|
6150
|
+
firstUpdated() {
|
|
6151
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
6152
|
+
this.runtimeUtils.handleComponentTagRename(this, 'auro-loader');
|
|
6153
|
+
}
|
|
6154
|
+
|
|
6155
|
+
connectedCallback() {
|
|
6156
|
+
super.connectedCallback();
|
|
6157
|
+
}
|
|
6158
|
+
|
|
6159
|
+
/**
|
|
6160
|
+
* @private
|
|
6161
|
+
* @returns {Array} Numbered array for template map.
|
|
6162
|
+
*/
|
|
6163
|
+
defineTemplate() {
|
|
6164
|
+
let nodes = Array.from(Array(this.mdCount).keys());
|
|
6165
|
+
|
|
6166
|
+
if (this.orbit || this.laser) {
|
|
6167
|
+
nodes = Array.from(Array(this.smCount).keys());
|
|
6168
|
+
} else if (this.ringworm) {
|
|
6169
|
+
nodes = Array.from(Array(0).keys());
|
|
6170
|
+
}
|
|
6171
|
+
|
|
6172
|
+
return nodes;
|
|
6173
|
+
}
|
|
6174
|
+
|
|
6175
|
+
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
6176
|
+
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
6177
|
+
|
|
6178
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
6179
|
+
render() {
|
|
6180
|
+
return html$1`
|
|
6181
|
+
${this.defineTemplate().map((idx) => html$1`
|
|
6182
|
+
<span part="element" class="loader node-${idx}"></span>
|
|
6183
|
+
`)}
|
|
6184
|
+
|
|
6185
|
+
<div class="no-animation">Loading...</div>
|
|
6186
|
+
|
|
6187
|
+
${this.ringworm ? html$1`
|
|
6188
|
+
<svg part="element" class="circular" viewBox="25 25 50 50">
|
|
6189
|
+
<circle class="path" cx="50" cy="50" r="20" fill="none"/>
|
|
6190
|
+
</svg>`
|
|
6191
|
+
: ``
|
|
6192
|
+
}
|
|
6193
|
+
`;
|
|
6194
|
+
}
|
|
6195
|
+
}
|
|
6196
|
+
|
|
6197
|
+
var loaderVersion = '5.0.0';
|
|
6198
|
+
|
|
6199
|
+
/* eslint-disable max-lines, curly, jsdoc/no-undefined-types */
|
|
6200
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6201
|
+
// See LICENSE in the project root for license information.
|
|
6202
|
+
|
|
6203
|
+
|
|
6204
|
+
/**
|
|
6205
|
+
* @slot - Default slot for the text of the button.
|
|
6206
|
+
* @csspart button - Apply CSS to HTML5 button.
|
|
6207
|
+
* @csspart loader - Apply CSS to auro-loader.
|
|
6208
|
+
* @csspart text - Apply CSS to text slot.
|
|
6209
|
+
* @csspart icon - Apply CSS to icon slot.
|
|
6210
|
+
*/
|
|
6211
|
+
|
|
6212
|
+
/* eslint-disable lit/no-invalid-html, lit/binding-positions */
|
|
6213
|
+
|
|
6214
|
+
const ICON_ONLY_SHAPES = ['circle'];
|
|
6215
|
+
|
|
6216
|
+
/**
|
|
6217
|
+
* AuroButton is a custom element that provides a styled, accessible button with support for various states and form association.
|
|
6218
|
+
* It is designed to be flexible, supporting loading states, icon slots, and integration with HTML5 forms.
|
|
6219
|
+
* @property {'default', 'rounded', 'pill', 'circle'} shape - Defines the shape of the button.
|
|
6220
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'} size - Defines the size of the button.
|
|
6221
|
+
* @property {'primary', 'secondary', 'tertiary', 'ghost', 'flat'} variant - Sets the button variant.
|
|
6222
|
+
* @property {'submit', 'reset', 'button'} type - The type of button. Matches HTML5 Button Spec.
|
|
6223
|
+
* @property {boolean} onDark - Indicates if the button is rendered in dark mode.
|
|
6224
|
+
*/
|
|
6225
|
+
class AuroButton extends AuroElement$1 {
|
|
6226
|
+
|
|
6227
|
+
/**
|
|
6228
|
+
* Enables form association for this element.
|
|
6229
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals
|
|
6230
|
+
* @returns {boolean} - Returns true to enable form association.
|
|
6231
|
+
*/
|
|
6232
|
+
static get formAssociated() {
|
|
6233
|
+
return true;
|
|
6234
|
+
}
|
|
6235
|
+
|
|
6236
|
+
constructor() {
|
|
6237
|
+
super();
|
|
6238
|
+
this.autofocus = false;
|
|
6239
|
+
this.disabled = false;
|
|
6240
|
+
this.loading = false;
|
|
6241
|
+
this.size = "md";
|
|
6242
|
+
this.shape = "rounded";
|
|
6243
|
+
this.onDark = false;
|
|
6244
|
+
this.fluid = false;
|
|
6245
|
+
this.loadingText = this.loadingText || 'Loading...';
|
|
6246
|
+
|
|
6247
|
+
// Support for HTML5 forms
|
|
6248
|
+
if (typeof this.attachInternals === 'function') {
|
|
6249
|
+
this.internals = this.attachInternals();
|
|
6250
|
+
} else {
|
|
6251
|
+
this.internals = null;
|
|
6252
|
+
|
|
6253
|
+
// eslint-disable-next-line no-console
|
|
6254
|
+
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.');
|
|
6255
|
+
}
|
|
6256
|
+
|
|
6257
|
+
/**
|
|
6258
|
+
* Generate unique names for dependency components.
|
|
6259
|
+
*/
|
|
6260
|
+
const versioning = new AuroDependencyVersioning();
|
|
6261
|
+
|
|
6262
|
+
/**
|
|
6263
|
+
* @private
|
|
6264
|
+
*/
|
|
6265
|
+
this.loaderTag = versioning.generateTag('auro-loader', loaderVersion, AuroLoader);
|
|
6266
|
+
|
|
6267
|
+
/**
|
|
6268
|
+
* @private
|
|
6269
|
+
*/
|
|
6270
|
+
this.buttonHref = undefined;
|
|
6271
|
+
|
|
6272
|
+
/**
|
|
6273
|
+
* @private
|
|
6274
|
+
*/
|
|
6275
|
+
this.buttonTarget = undefined;
|
|
6276
|
+
|
|
6277
|
+
/**
|
|
6278
|
+
* @private
|
|
6279
|
+
*/
|
|
6280
|
+
this.buttonRel = undefined;
|
|
6281
|
+
}
|
|
6282
|
+
|
|
6283
|
+
static get styles() {
|
|
6284
|
+
return [
|
|
6285
|
+
tokensCss$2,
|
|
6286
|
+
styleCss$3,
|
|
6287
|
+
colorCss$2,
|
|
6288
|
+
shapeSize
|
|
6289
|
+
];
|
|
6290
|
+
}
|
|
6291
|
+
|
|
6292
|
+
static get properties() {
|
|
6293
|
+
return {
|
|
6294
|
+
|
|
6295
|
+
...super.properties,
|
|
6296
|
+
|
|
6297
|
+
/**
|
|
6298
|
+
* Override layout since it isn't used in this component.
|
|
6299
|
+
* @private
|
|
6300
|
+
*/
|
|
6301
|
+
layout: {
|
|
6302
|
+
type: Boolean,
|
|
6303
|
+
attribute: false,
|
|
6304
|
+
reflect: false
|
|
6305
|
+
},
|
|
6306
|
+
|
|
6307
|
+
/**
|
|
6308
|
+
* This Boolean attribute lets you specify that the button should have input focus when the page loads, unless overridden by the user.
|
|
6309
|
+
*/
|
|
6310
|
+
autofocus: {
|
|
6311
|
+
type: Boolean,
|
|
6312
|
+
reflect: true
|
|
6313
|
+
},
|
|
6314
|
+
|
|
6315
|
+
/**
|
|
6316
|
+
* If set to true, button will become disabled and not allow for interactions.
|
|
6317
|
+
*/
|
|
6318
|
+
disabled: {
|
|
6319
|
+
type: Boolean,
|
|
6320
|
+
reflect: true
|
|
6321
|
+
},
|
|
6322
|
+
|
|
6323
|
+
/**
|
|
6324
|
+
* Alters the shape of the button to be full width of its parent container.
|
|
6325
|
+
*/
|
|
6326
|
+
fluid: {
|
|
6327
|
+
type: Boolean,
|
|
6328
|
+
reflect: true
|
|
6329
|
+
},
|
|
6330
|
+
|
|
6331
|
+
/**
|
|
6332
|
+
* If set to true button text will be replaced with `auro-loader` and become disabled.
|
|
6333
|
+
*/
|
|
6334
|
+
loading: {
|
|
6335
|
+
type: Boolean,
|
|
6336
|
+
reflect: true
|
|
6337
|
+
},
|
|
6338
|
+
|
|
6339
|
+
/**
|
|
6340
|
+
* 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.
|
|
6341
|
+
*/
|
|
6342
|
+
loadingText: {
|
|
6343
|
+
type: String
|
|
6344
|
+
},
|
|
6345
|
+
|
|
6346
|
+
/**
|
|
6347
|
+
* Populates `tabindex` to define the focusable sequence in keyboard navigation.
|
|
6348
|
+
*/
|
|
6349
|
+
tIndex: {
|
|
6350
|
+
type: String,
|
|
6351
|
+
reflect: true
|
|
6352
|
+
},
|
|
6353
|
+
|
|
6354
|
+
/**
|
|
6355
|
+
* Populates `tabindex` to define the focusable sequence in keyboard navigation.
|
|
6356
|
+
* Must be used with "." to ensure the host element does not retain a reference to the `tabindex` attribute.
|
|
6357
|
+
* Example: `<auro-button .tabindex="${this.disabled ? '-1' : '0'}"></auro-button>`
|
|
6358
|
+
*/
|
|
6359
|
+
tabindex: {
|
|
6360
|
+
type: String,
|
|
6361
|
+
reflect: false
|
|
6362
|
+
},
|
|
6363
|
+
|
|
6364
|
+
/**
|
|
6365
|
+
* Sets title attribute. The information is most often shown as a tooltip text when the mouse moves over the element.
|
|
6366
|
+
*/
|
|
6367
|
+
title: {
|
|
6368
|
+
type: String,
|
|
6369
|
+
reflect: true
|
|
6370
|
+
},
|
|
6371
|
+
|
|
6372
|
+
/**
|
|
6373
|
+
* The type of the button. Possible values are: `submit`, `reset`, `button`.
|
|
6374
|
+
*/
|
|
6375
|
+
type: {
|
|
6376
|
+
type: String,
|
|
6377
|
+
reflect: true
|
|
6378
|
+
},
|
|
6379
|
+
|
|
6380
|
+
/**
|
|
6381
|
+
* Defines the value associated with the button which is submitted with the form data.
|
|
6382
|
+
*/
|
|
6383
|
+
value: {
|
|
6384
|
+
type: String,
|
|
6385
|
+
reflect: true
|
|
6386
|
+
},
|
|
6387
|
+
|
|
6388
|
+
/**
|
|
6389
|
+
* Sets button variant option.
|
|
6390
|
+
* @default primary
|
|
6391
|
+
*/
|
|
6392
|
+
variant: {
|
|
6393
|
+
type: String,
|
|
6394
|
+
reflect: true
|
|
6395
|
+
},
|
|
6396
|
+
|
|
6397
|
+
/**
|
|
6398
|
+
* @private
|
|
6399
|
+
*/
|
|
6400
|
+
buttonHref: {
|
|
6401
|
+
type: String,
|
|
6402
|
+
},
|
|
6403
|
+
|
|
6404
|
+
/**
|
|
6405
|
+
* @private
|
|
6406
|
+
*/
|
|
6407
|
+
buttonTarget: {
|
|
6408
|
+
type: String,
|
|
6409
|
+
},
|
|
6410
|
+
|
|
6411
|
+
/**
|
|
6412
|
+
* @private
|
|
6413
|
+
*/
|
|
6414
|
+
buttonRel: {
|
|
6415
|
+
type: String,
|
|
6416
|
+
},
|
|
6417
|
+
};
|
|
6418
|
+
}
|
|
6419
|
+
|
|
6420
|
+
/**
|
|
6421
|
+
* This will register this element with the browser.
|
|
6422
|
+
* @param {string} [name="auro-button"] - The name of element that you want to register to.
|
|
6423
|
+
*
|
|
6424
|
+
* @example
|
|
6425
|
+
* AuroButton.register("custom-button") // this will register this element to <custom-button/>
|
|
6426
|
+
*
|
|
5094
6427
|
*/
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
'helpText': true,
|
|
5098
|
-
'leftIndent': true,
|
|
5099
|
-
'rightIndent': true
|
|
5100
|
-
};
|
|
5101
|
-
|
|
5102
|
-
return html`
|
|
5103
|
-
${this.renderBasicHtml(helpTextClasses)}
|
|
5104
|
-
`;
|
|
6428
|
+
static register(name = "auro-button") {
|
|
6429
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroButton);
|
|
5105
6430
|
}
|
|
5106
6431
|
|
|
5107
6432
|
/**
|
|
5108
|
-
*
|
|
6433
|
+
* Internal method to apply focus to the HTML5 button.
|
|
5109
6434
|
* @private
|
|
5110
|
-
* @returns {
|
|
6435
|
+
* @returns {void}
|
|
5111
6436
|
*/
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
'helpText': true,
|
|
5115
|
-
'leftIndent': this.shape.toLowerCase().includes('pill') && !this.shape.toLowerCase().includes('right'),
|
|
5116
|
-
'rightIndent': this.shape.toLowerCase().includes('pill') && !this.shape.toLowerCase().includes('left')
|
|
5117
|
-
};
|
|
5118
|
-
|
|
5119
|
-
return html`
|
|
5120
|
-
${this.renderBasicHtml(helpTextClasses)}
|
|
5121
|
-
`;
|
|
6437
|
+
focus() {
|
|
6438
|
+
this.renderRoot.querySelector('button').focus();
|
|
5122
6439
|
}
|
|
5123
6440
|
|
|
5124
6441
|
/**
|
|
5125
|
-
*
|
|
6442
|
+
* Submits the form that this button is associated with.
|
|
5126
6443
|
* @private
|
|
5127
|
-
* @
|
|
5128
|
-
* @returns {HTMLCollection} - Returns the HTML for the layout.
|
|
6444
|
+
* @returns {void}
|
|
5129
6445
|
*/
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
switch (layout) {
|
|
5134
|
-
case 'emphasized':
|
|
5135
|
-
return this.renderLayoutEmphasized();
|
|
5136
|
-
case 'emphasized-left':
|
|
5137
|
-
return this.renderLayoutEmphasized();
|
|
5138
|
-
case 'emphasized-right':
|
|
5139
|
-
return this.renderLayoutEmphasized();
|
|
5140
|
-
case 'snowflake':
|
|
5141
|
-
return this.renderLayoutSnowflake();
|
|
5142
|
-
case 'snowflake-left':
|
|
5143
|
-
return this.renderLayoutSnowflake();
|
|
5144
|
-
case 'snowflake-right':
|
|
5145
|
-
return this.renderLayoutSnowflake();
|
|
5146
|
-
default:
|
|
5147
|
-
return this.renderLayoutClassic();
|
|
6446
|
+
surfaceSubmitEvent() {
|
|
6447
|
+
if (this.form) {
|
|
6448
|
+
this.form.requestSubmit();
|
|
5148
6449
|
}
|
|
5149
6450
|
}
|
|
5150
|
-
}
|
|
5151
|
-
|
|
5152
|
-
var dropdownVersion = '3.0.0';
|
|
5153
|
-
|
|
5154
|
-
var colorCss$1 = css`#headerContainer{box-shadow:var(--ds-auro-dropdownbib-header-boxshadow-color)}#footerContainer{background-color:var(--ds-auro-dropdownbib-footer-container-color)}`;
|
|
5155
|
-
|
|
5156
|
-
var styleCss$2 = 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]){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}#closeButton [auro-icon]{--ds-auro-icon-size: var(--ds-size-500, 2.5rem)}#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)}`;
|
|
5157
|
-
|
|
5158
|
-
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)}`;
|
|
5159
|
-
|
|
5160
|
-
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5161
|
-
// See LICENSE in the project root for license information.
|
|
5162
|
-
|
|
5163
|
-
// ---------------------------------------------------------------------
|
|
5164
|
-
|
|
5165
|
-
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
5166
|
-
|
|
5167
|
-
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
5168
|
-
|
|
5169
|
-
/* eslint-disable jsdoc/require-param */
|
|
5170
6451
|
|
|
5171
6452
|
/**
|
|
5172
|
-
*
|
|
5173
|
-
* @
|
|
5174
|
-
* @
|
|
5175
|
-
* @returns {void}
|
|
6453
|
+
* Returns the form element that this button is associated with.
|
|
6454
|
+
* @private
|
|
6455
|
+
* @returns {HTMLFormElement | null}
|
|
5176
6456
|
*/
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
customElements.define(name, class extends componentClass {});
|
|
5180
|
-
}
|
|
6457
|
+
get form() {
|
|
6458
|
+
return this.internals ? this.internals.form : null;
|
|
5181
6459
|
}
|
|
5182
6460
|
|
|
5183
6461
|
/**
|
|
5184
|
-
*
|
|
5185
|
-
* @returns {
|
|
6462
|
+
* @private
|
|
6463
|
+
* @returns {Boolean}
|
|
5186
6464
|
*/
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
base = this, // extra functionality to skip a parent
|
|
5190
|
-
__Closest = (el, found = el && el.closest(selector)) =>
|
|
5191
|
-
!el || el === document || el === window
|
|
5192
|
-
? null // standard .closest() returns null for non-found selectors also
|
|
5193
|
-
: found
|
|
5194
|
-
? found // found a selector INside this element
|
|
5195
|
-
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
5196
|
-
) {
|
|
5197
|
-
return __Closest(base);
|
|
6465
|
+
get hideText() {
|
|
6466
|
+
return ICON_ONLY_SHAPES.includes(this.shape);
|
|
5198
6467
|
}
|
|
5199
|
-
/* eslint-enable jsdoc/require-param */
|
|
5200
6468
|
|
|
5201
6469
|
/**
|
|
5202
|
-
*
|
|
5203
|
-
* @
|
|
5204
|
-
* @
|
|
5205
|
-
* @returns {void}
|
|
6470
|
+
* Returns the current value of the projected `aria-label` attribute or undefined if not set.
|
|
6471
|
+
* @returns {string | undefined}
|
|
6472
|
+
* @private
|
|
5206
6473
|
*/
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
const elemTag = elem.tagName.toLowerCase();
|
|
6474
|
+
get currentAriaLabel() {
|
|
6475
|
+
if (!this.attributeWatcher) return undefined;
|
|
5210
6476
|
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
}
|
|
6477
|
+
const ariaLabel = this.attributeWatcher.getObservedAttribute("aria-label");
|
|
6478
|
+
return ariaLabel || undefined;
|
|
5214
6479
|
}
|
|
5215
6480
|
|
|
5216
6481
|
/**
|
|
5217
|
-
*
|
|
5218
|
-
* @
|
|
5219
|
-
* @
|
|
5220
|
-
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
6482
|
+
* Returns the current value of the projected `aria-labelledby` attribute or undefined if not set.
|
|
6483
|
+
* @returns {string | undefined}
|
|
6484
|
+
* @private
|
|
5221
6485
|
*/
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
const elemTag = elem.tagName.toLowerCase();
|
|
6486
|
+
get currentAriaLabelledBy() {
|
|
6487
|
+
if (!this.attributeWatcher) return undefined;
|
|
5225
6488
|
|
|
5226
|
-
|
|
6489
|
+
const ariaLabelledBy = this.attributeWatcher.getObservedAttribute("aria-labelledby");
|
|
6490
|
+
return ariaLabelledBy || undefined;
|
|
5227
6491
|
}
|
|
5228
|
-
};
|
|
5229
|
-
|
|
5230
|
-
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5231
|
-
// See LICENSE in the project root for license information.
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
class AuroDependencyVersioning {
|
|
5235
6492
|
|
|
5236
6493
|
/**
|
|
5237
|
-
*
|
|
6494
|
+
* Renders the default layout for the button.
|
|
6495
|
+
* @returns {TemplateResult}
|
|
5238
6496
|
* @private
|
|
5239
|
-
* @param {string} baseName - Defines the first part of the unique element name.
|
|
5240
|
-
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
5241
|
-
* @returns {string} - Unique string to be used for naming.
|
|
5242
6497
|
*/
|
|
5243
|
-
|
|
5244
|
-
|
|
6498
|
+
renderLayoutDefault() {
|
|
6499
|
+
const classes = {
|
|
6500
|
+
"util_insetLg--squish": true,
|
|
6501
|
+
"auro-button": true,
|
|
6502
|
+
"icon-only": this.hideText,
|
|
6503
|
+
wrapper: true,
|
|
6504
|
+
loading: this.loading,
|
|
6505
|
+
};
|
|
5245
6506
|
|
|
5246
|
-
|
|
5247
|
-
|
|
6507
|
+
const tag = this.buttonHref ? literal`a` : literal`button`;
|
|
6508
|
+
const part = this.buttonHref ? 'link' : 'button';
|
|
5248
6509
|
|
|
5249
|
-
return
|
|
6510
|
+
return html`
|
|
6511
|
+
<${tag}
|
|
6512
|
+
part="${part}"
|
|
6513
|
+
aria-label="${ifDefined(this.loading ? this.loadingText : this.currentAriaLabel || undefined)}"
|
|
6514
|
+
aria-labelledby="${ifDefined(this.loading ? undefined : this.currentAriaLabelledBy || undefined)}"
|
|
6515
|
+
tabindex="${ifDefined(this.tIndex || this.tabindex)}"
|
|
6516
|
+
?autofocus="${this.autofocus}"
|
|
6517
|
+
class=${classMap(classes)}
|
|
6518
|
+
?disabled="${this.disabled || this.loading}"
|
|
6519
|
+
?onDark="${this.onDark}"
|
|
6520
|
+
title="${ifDefined(this.title ? this.title : undefined)}"
|
|
6521
|
+
name="${ifDefined(this.name ? this.name : undefined)}"
|
|
6522
|
+
type="${ifDefined(this.type ? this.type : undefined)}"
|
|
6523
|
+
variant="${ifDefined(this.variant ? this.variant : undefined)}"
|
|
6524
|
+
.value="${ifDefined(this.value ? this.value : undefined)}"
|
|
6525
|
+
@click="${this.type === 'submit' ? this.surfaceSubmitEvent : undefined}"
|
|
6526
|
+
href="${ifDefined(this.buttonHref || undefined)}"
|
|
6527
|
+
target="${ifDefined(this.buttonTarget || undefined)}"
|
|
6528
|
+
rel="${ifDefined(this.buttonRel || undefined)}"
|
|
6529
|
+
>
|
|
6530
|
+
${ifDefined(this.loading ? html`<${this.loaderTag} pulse part="loader"></${this.loaderTag}>` : undefined)}
|
|
6531
|
+
|
|
6532
|
+
<span class="contentWrapper">
|
|
6533
|
+
<span class="textSlot" part="text">
|
|
6534
|
+
<slot></slot>
|
|
6535
|
+
</span>
|
|
6536
|
+
</span>
|
|
6537
|
+
</${tag}>
|
|
6538
|
+
`;
|
|
5250
6539
|
}
|
|
5251
6540
|
|
|
5252
6541
|
/**
|
|
5253
|
-
*
|
|
5254
|
-
* @
|
|
5255
|
-
* @
|
|
5256
|
-
* @returns {string} - Unique string to be used for naming.
|
|
6542
|
+
* Renders the layout of the button.
|
|
6543
|
+
* @returns {TemplateResult}
|
|
6544
|
+
* @private
|
|
5257
6545
|
*/
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
const tag = literal`${unsafeStatic(elementName)}`;
|
|
5261
|
-
|
|
5262
|
-
if (!customElements.get(elementName)) {
|
|
5263
|
-
customElements.define(elementName, class extends tagClass {});
|
|
5264
|
-
}
|
|
5265
|
-
|
|
5266
|
-
return tag;
|
|
6546
|
+
renderLayout() {
|
|
6547
|
+
return this.renderLayoutDefault();
|
|
5267
6548
|
}
|
|
5268
6549
|
}
|
|
5269
6550
|
|
|
6551
|
+
var buttonVersion = '11.2.1';
|
|
6552
|
+
|
|
5270
6553
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5271
6554
|
// See LICENSE in the project root for license information.
|
|
5272
6555
|
|
|
@@ -5417,9 +6700,9 @@ class BaseIcon extends AuroElement {
|
|
|
5417
6700
|
}
|
|
5418
6701
|
}
|
|
5419
6702
|
|
|
5420
|
-
var tokensCss$
|
|
6703
|
+
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)}`;
|
|
5421
6704
|
|
|
5422
|
-
var colorCss$
|
|
6705
|
+
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)}`;
|
|
5423
6706
|
|
|
5424
6707
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5425
6708
|
// See LICENSE in the project root for license information.
|
|
@@ -5428,7 +6711,7 @@ var colorCss$2 = css`:host{color:var(--ds-auro-icon-color)}:host([customColor]){
|
|
|
5428
6711
|
|
|
5429
6712
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
5430
6713
|
|
|
5431
|
-
let AuroLibraryRuntimeUtils$
|
|
6714
|
+
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
5432
6715
|
|
|
5433
6716
|
/* eslint-disable jsdoc/require-param */
|
|
5434
6717
|
|
|
@@ -5510,7 +6793,7 @@ class AuroIcon extends BaseIcon {
|
|
|
5510
6793
|
*/
|
|
5511
6794
|
privateDefaults() {
|
|
5512
6795
|
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
5513
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
6796
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
5514
6797
|
}
|
|
5515
6798
|
|
|
5516
6799
|
// function to define props used within the scope of this component
|
|
@@ -5577,9 +6860,9 @@ class AuroIcon extends BaseIcon {
|
|
|
5577
6860
|
static get styles() {
|
|
5578
6861
|
return [
|
|
5579
6862
|
super.styles,
|
|
5580
|
-
css`${tokensCss$
|
|
6863
|
+
css`${tokensCss$3}`,
|
|
5581
6864
|
css`${styleCss$1$1}`,
|
|
5582
|
-
css`${colorCss$
|
|
6865
|
+
css`${colorCss$4}`
|
|
5583
6866
|
];
|
|
5584
6867
|
}
|
|
5585
6868
|
|
|
@@ -5592,7 +6875,7 @@ class AuroIcon extends BaseIcon {
|
|
|
5592
6875
|
*
|
|
5593
6876
|
*/
|
|
5594
6877
|
static register(name = "auro-icon") {
|
|
5595
|
-
AuroLibraryRuntimeUtils$
|
|
6878
|
+
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroIcon);
|
|
5596
6879
|
}
|
|
5597
6880
|
|
|
5598
6881
|
connectedCallback() {
|
|
@@ -5613,8 +6896,12 @@ class AuroIcon extends BaseIcon {
|
|
|
5613
6896
|
async firstUpdated() {
|
|
5614
6897
|
await super.firstUpdated();
|
|
5615
6898
|
|
|
5616
|
-
|
|
5617
|
-
|
|
6899
|
+
/**
|
|
6900
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
6901
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
6902
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
6903
|
+
*/
|
|
6904
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
5618
6905
|
const svgDesc = this.svg.querySelector('desc');
|
|
5619
6906
|
|
|
5620
6907
|
if (svgDesc) {
|
|
@@ -5658,9 +6945,79 @@ class AuroIcon extends BaseIcon {
|
|
|
5658
6945
|
}
|
|
5659
6946
|
}
|
|
5660
6947
|
|
|
5661
|
-
var iconVersion = '8.0.
|
|
6948
|
+
var iconVersion = '8.0.4';
|
|
6949
|
+
|
|
6950
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6951
|
+
// See LICENSE in the project root for license information.
|
|
6952
|
+
|
|
6953
|
+
// ---------------------------------------------------------------------
|
|
6954
|
+
|
|
6955
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
6956
|
+
|
|
6957
|
+
let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
6958
|
+
|
|
6959
|
+
/* eslint-disable jsdoc/require-param */
|
|
6960
|
+
|
|
6961
|
+
/**
|
|
6962
|
+
* This will register a new custom element with the browser.
|
|
6963
|
+
* @param {String} name - The name of the custom element.
|
|
6964
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
6965
|
+
* @returns {void}
|
|
6966
|
+
*/
|
|
6967
|
+
registerComponent(name, componentClass) {
|
|
6968
|
+
if (!customElements.get(name)) {
|
|
6969
|
+
customElements.define(name, class extends componentClass {});
|
|
6970
|
+
}
|
|
6971
|
+
}
|
|
6972
|
+
|
|
6973
|
+
/**
|
|
6974
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
6975
|
+
* @returns {void}
|
|
6976
|
+
*/
|
|
6977
|
+
closestElement(
|
|
6978
|
+
selector, // selector like in .closest()
|
|
6979
|
+
base = this, // extra functionality to skip a parent
|
|
6980
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
6981
|
+
!el || el === document || el === window
|
|
6982
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
6983
|
+
: found
|
|
6984
|
+
? found // found a selector INside this element
|
|
6985
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
6986
|
+
) {
|
|
6987
|
+
return __Closest(base);
|
|
6988
|
+
}
|
|
6989
|
+
/* eslint-enable jsdoc/require-param */
|
|
6990
|
+
|
|
6991
|
+
/**
|
|
6992
|
+
* 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.
|
|
6993
|
+
* @param {Object} elem - The element to check.
|
|
6994
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
6995
|
+
* @returns {void}
|
|
6996
|
+
*/
|
|
6997
|
+
handleComponentTagRename(elem, tagName) {
|
|
6998
|
+
const tag = tagName.toLowerCase();
|
|
6999
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
7000
|
+
|
|
7001
|
+
if (elemTag !== tag) {
|
|
7002
|
+
elem.setAttribute(tag, true);
|
|
7003
|
+
}
|
|
7004
|
+
}
|
|
7005
|
+
|
|
7006
|
+
/**
|
|
7007
|
+
* Validates if an element is a specific Auro component.
|
|
7008
|
+
* @param {Object} elem - The element to validate.
|
|
7009
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
7010
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
7011
|
+
*/
|
|
7012
|
+
elementMatch(elem, tagName) {
|
|
7013
|
+
const tag = tagName.toLowerCase();
|
|
7014
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
7015
|
+
|
|
7016
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
7017
|
+
}
|
|
7018
|
+
};
|
|
5662
7019
|
|
|
5663
|
-
var styleCss$
|
|
7020
|
+
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)}`;
|
|
5664
7021
|
|
|
5665
7022
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5666
7023
|
// See LICENSE in the project root for license information.
|
|
@@ -5689,7 +7046,7 @@ class AuroHeader extends LitElement {
|
|
|
5689
7046
|
/**
|
|
5690
7047
|
* @private
|
|
5691
7048
|
*/
|
|
5692
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
7049
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$4();
|
|
5693
7050
|
}
|
|
5694
7051
|
|
|
5695
7052
|
// function to define props used within the scope of this component
|
|
@@ -5707,7 +7064,7 @@ class AuroHeader extends LitElement {
|
|
|
5707
7064
|
}
|
|
5708
7065
|
|
|
5709
7066
|
static get styles() {
|
|
5710
|
-
return [styleCss$
|
|
7067
|
+
return [styleCss$5];
|
|
5711
7068
|
}
|
|
5712
7069
|
|
|
5713
7070
|
/**
|
|
@@ -5719,7 +7076,7 @@ class AuroHeader extends LitElement {
|
|
|
5719
7076
|
*
|
|
5720
7077
|
*/
|
|
5721
7078
|
static register(name = "auro-header") {
|
|
5722
|
-
AuroLibraryRuntimeUtils$
|
|
7079
|
+
AuroLibraryRuntimeUtils$4.prototype.registerComponent(name, AuroHeader);
|
|
5723
7080
|
}
|
|
5724
7081
|
|
|
5725
7082
|
firstUpdated() {
|
|
@@ -5815,17 +7172,30 @@ class AuroBibtemplate extends LitElement {
|
|
|
5815
7172
|
|
|
5816
7173
|
this.large = false;
|
|
5817
7174
|
|
|
5818
|
-
AuroLibraryRuntimeUtils$
|
|
7175
|
+
AuroLibraryRuntimeUtils$3.prototype.handleComponentTagRename(this, 'auro-bibtemplate');
|
|
5819
7176
|
|
|
5820
7177
|
const versioning = new AuroDependencyVersioning();
|
|
7178
|
+
|
|
7179
|
+
/**
|
|
7180
|
+
* @private
|
|
7181
|
+
*/
|
|
5821
7182
|
this.iconTag = versioning.generateTag('auro-formkit-bibtemplate-icon', iconVersion, AuroIcon);
|
|
7183
|
+
|
|
7184
|
+
/**
|
|
7185
|
+
* @private
|
|
7186
|
+
*/
|
|
5822
7187
|
this.headerTag = versioning.generateTag('auro-formkit-bibtemplate-header', headerVersion, AuroHeader);
|
|
7188
|
+
|
|
7189
|
+
/**
|
|
7190
|
+
* @private
|
|
7191
|
+
*/
|
|
7192
|
+
this.buttonTag = versioning.generateTag('auro-formkit-input-button', buttonVersion, AuroButton);
|
|
5823
7193
|
}
|
|
5824
7194
|
|
|
5825
7195
|
static get styles() {
|
|
5826
7196
|
return [
|
|
5827
|
-
colorCss$
|
|
5828
|
-
styleCss$
|
|
7197
|
+
colorCss$3,
|
|
7198
|
+
styleCss$4,
|
|
5829
7199
|
tokenCss
|
|
5830
7200
|
];
|
|
5831
7201
|
}
|
|
@@ -5854,7 +7224,7 @@ class AuroBibtemplate extends LitElement {
|
|
|
5854
7224
|
*
|
|
5855
7225
|
*/
|
|
5856
7226
|
static register(name = "auro-bibtemplate") {
|
|
5857
|
-
AuroLibraryRuntimeUtils$
|
|
7227
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroBibtemplate);
|
|
5858
7228
|
}
|
|
5859
7229
|
|
|
5860
7230
|
/**
|
|
@@ -5912,9 +7282,9 @@ class AuroBibtemplate extends LitElement {
|
|
|
5912
7282
|
<div id="bibTemplate" part="bibtemplate">
|
|
5913
7283
|
${this.isFullscreen ? html`
|
|
5914
7284
|
<div id="headerContainer">
|
|
5915
|
-
|
|
7285
|
+
<${this.buttonTag} id="closeButton" aria-label="Close" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
5916
7286
|
<${this.iconTag} category="interface" name="x-lg"></${this.iconTag}>
|
|
5917
|
-
|
|
7287
|
+
</${this.buttonTag}>
|
|
5918
7288
|
<${this.headerTag} display="${this.large ? 'display' : '600'}" level="3" size="none" id="header" no-margin-block>
|
|
5919
7289
|
<slot name="header"></slot>
|
|
5920
7290
|
</${this.headerTag}>
|
|
@@ -5938,9 +7308,9 @@ class AuroBibtemplate extends LitElement {
|
|
|
5938
7308
|
|
|
5939
7309
|
var bibTemplateVersion = '1.0.0';
|
|
5940
7310
|
|
|
5941
|
-
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-
|
|
7311
|
+
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)}`;
|
|
5942
7312
|
|
|
5943
|
-
var styleCss$1 = css
|
|
7313
|
+
var styleCss$1 = css`:host{position:relative;display:block}.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
5944
7314
|
|
|
5945
7315
|
var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
5946
7316
|
|
|
@@ -6146,68 +7516,7 @@ class AuroHelpText extends LitElement {
|
|
|
6146
7516
|
|
|
6147
7517
|
var helpTextVersion = '1.0.0';
|
|
6148
7518
|
|
|
6149
|
-
css
|
|
6150
|
-
|
|
6151
|
-
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)}`;
|
|
6152
|
-
|
|
6153
|
-
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)}`;
|
|
6154
|
-
|
|
6155
|
-
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6156
|
-
// See LICENSE in the project root for license information.
|
|
6157
|
-
|
|
6158
|
-
// ---------------------------------------------------------------------
|
|
6159
|
-
|
|
6160
|
-
/**
|
|
6161
|
-
* Converts value to an array.
|
|
6162
|
-
* If the value is a JSON string representing an array, it will be parsed.
|
|
6163
|
-
* If the value is already an array, it is returned.
|
|
6164
|
-
* If the value is undefined, it returns undefined.
|
|
6165
|
-
* @private
|
|
6166
|
-
* @param {any} value - The value to be converted. Can be a string, array, or undefined.
|
|
6167
|
-
* @returns {Array|undefined} - The converted array or undefined.
|
|
6168
|
-
* @throws {Error} - Throws an error if the value is not an array, undefined,
|
|
6169
|
-
* or if the value cannot be parsed into an array from a JSON string.
|
|
6170
|
-
*/
|
|
6171
|
-
function arrayConverter(value) {
|
|
6172
|
-
// Allow undefined
|
|
6173
|
-
if (value === undefined) {
|
|
6174
|
-
return undefined;
|
|
6175
|
-
}
|
|
6176
|
-
|
|
6177
|
-
// Return the value if it is already an array
|
|
6178
|
-
if (Array.isArray(value)) {
|
|
6179
|
-
return value;
|
|
6180
|
-
}
|
|
6181
|
-
|
|
6182
|
-
try {
|
|
6183
|
-
// If value is a JSON string, parse it
|
|
6184
|
-
const parsed = typeof value === 'string' ? JSON.parse(value) : value;
|
|
6185
|
-
|
|
6186
|
-
// Check if the parsed value is an array
|
|
6187
|
-
if (Array.isArray(parsed)) {
|
|
6188
|
-
return parsed;
|
|
6189
|
-
}
|
|
6190
|
-
} catch (error) {
|
|
6191
|
-
// If JSON parsing fails, continue to throw an error below
|
|
6192
|
-
/* eslint-disable no-console */
|
|
6193
|
-
console.error('JSON parsing failed:', error);
|
|
6194
|
-
}
|
|
6195
|
-
|
|
6196
|
-
// Throw error if the input is not an array or undefined
|
|
6197
|
-
throw new Error('Invalid value: Input must be an array or undefined');
|
|
6198
|
-
}
|
|
6199
|
-
|
|
6200
|
-
css`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-200, 1rem) var(--ds-size-50, 0.25rem) 0;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
6201
|
-
|
|
6202
|
-
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)}`;
|
|
6203
|
-
|
|
6204
|
-
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}`;
|
|
6205
|
-
|
|
6206
|
-
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)}`;
|
|
6207
|
-
|
|
6208
|
-
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)}`;
|
|
6209
|
-
|
|
6210
|
-
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-direction:column;justify-content:center;align-items:center;flex:1}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;justify-content:center;align-items:center}::slotted([slot=typeIcon]){margin-right:8px}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;align-items:center;justify-content:center;width:100%;padding:0 8px 0 24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
|
|
7519
|
+
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)}:host([layout*=emphasized]) [auro-dropdown],:host([layout*=snowflake]) [auro-dropdown]{--ds-auro-select-border-color: transparent}.mainContent{position:relative;display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;align-items:center;justify-content:center}::slotted([slot=typeIcon]){margin-right:var(--ds-size-100, 0.5rem)}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;width:100%;align-items:center;justify-content:center}:host([layout*=emphasized]) .triggerContent,:host([layout*=snowflake]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem) 0 var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) [auro-dropdown] label.withValue{font-size:var(--ds-text-body-size-xs);line-height:20px}:host([layout*=emphasized]) [auro-dropdown] label.withValue{font-size:var(--ds-text-body-size-xs);line-height:20px}:host([layout*=classic]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem)}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{cursor:text;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host([layout*=classic]) label.withValue{font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([layout*=classic]) .value{height:auto;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]){pointer-events:none;user-select:none}:host([disabled]:not([ondark])) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([layout*=classic])[disabled][ondark]) [auro-dropdown]{--ds-auro-select-border-color: transparent}`;
|
|
6211
7520
|
|
|
6212
7521
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6213
7522
|
// See LICENSE in the project root for license information.
|
|
@@ -6220,9 +7529,10 @@ var styleCss = css`.util_displayInline{display:inline}.util_displayInlineBlock{d
|
|
|
6220
7529
|
* @slot - Default slot for the menu content.
|
|
6221
7530
|
* @slot bib.fullscreen.headline - Defines the headline to display above menu-options
|
|
6222
7531
|
* @slot label - Defines the content of the label.
|
|
7532
|
+
* @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
6223
7533
|
* @slot helpText - Defines the content of the helpText.
|
|
6224
|
-
* @slot placeholder - Defines the content of the placeholder to be shown when there is no value
|
|
6225
7534
|
* @slot valueText - Dropdown value text display.
|
|
7535
|
+
* @slot displayValue - Allows custom HTML content to display the selected value when select is not focused.
|
|
6226
7536
|
* @event auroSelect-valueSet - Notifies that the component has a new value set.
|
|
6227
7537
|
* @event input - Notifies every time the value prop of the element is changed. The updated `value` and `optionSelected` will be delivered in `detail` object.
|
|
6228
7538
|
* @event auroFormElement-validated - Notifies that the `validity` and `errorMessage` values have changed.
|
|
@@ -6240,11 +7550,11 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6240
7550
|
const idSubstrEnd = 8;
|
|
6241
7551
|
const idSubstrStart = 2;
|
|
6242
7552
|
|
|
6243
|
-
this.matchWidth =
|
|
7553
|
+
this.matchWidth = false;
|
|
6244
7554
|
|
|
6245
7555
|
// Layout Config
|
|
6246
|
-
this.layout = '
|
|
6247
|
-
this.shape = '
|
|
7556
|
+
this.layout = 'snowflake';
|
|
7557
|
+
this.shape = 'snowflake';
|
|
6248
7558
|
this.size = 'xl';
|
|
6249
7559
|
|
|
6250
7560
|
// floaterConfig
|
|
@@ -6255,6 +7565,10 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6255
7565
|
|
|
6256
7566
|
this.forceDisplayValue = false;
|
|
6257
7567
|
|
|
7568
|
+
this.layout = 'classic';
|
|
7569
|
+
this.shape = 'classic';
|
|
7570
|
+
this.size = 'xl';
|
|
7571
|
+
|
|
6258
7572
|
/**
|
|
6259
7573
|
* @private
|
|
6260
7574
|
*/
|
|
@@ -6270,7 +7584,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6270
7584
|
/**
|
|
6271
7585
|
* @private
|
|
6272
7586
|
*/
|
|
6273
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
7587
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
6274
7588
|
|
|
6275
7589
|
/**
|
|
6276
7590
|
* Generate unique names for dependency components.
|
|
@@ -6319,6 +7633,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6319
7633
|
this.value = undefined;
|
|
6320
7634
|
this.fullscreenBreakpoint = 'sm';
|
|
6321
7635
|
this.onDark = false;
|
|
7636
|
+
this.isPopoverVisible = false;
|
|
6322
7637
|
}
|
|
6323
7638
|
|
|
6324
7639
|
// This function is to define props used within the scope of this component
|
|
@@ -6360,6 +7675,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6360
7675
|
reflect: true
|
|
6361
7676
|
},
|
|
6362
7677
|
|
|
7678
|
+
/**
|
|
7679
|
+
* @private
|
|
7680
|
+
*/
|
|
7681
|
+
isPopoverVisible: {
|
|
7682
|
+
type: Boolean,
|
|
7683
|
+
reflect: false
|
|
7684
|
+
},
|
|
7685
|
+
|
|
6363
7686
|
/**
|
|
6364
7687
|
* If declared, the popover and trigger will be set to the same width.
|
|
6365
7688
|
*/
|
|
@@ -6376,14 +7699,6 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6376
7699
|
reflect: true
|
|
6377
7700
|
},
|
|
6378
7701
|
|
|
6379
|
-
/**
|
|
6380
|
-
* If set, makes dropdown width match the size of the content, rather than the width of the trigger.
|
|
6381
|
-
*/
|
|
6382
|
-
flexMenuWidth: {
|
|
6383
|
-
type: Boolean,
|
|
6384
|
-
reflect: true
|
|
6385
|
-
},
|
|
6386
|
-
|
|
6387
7702
|
/**
|
|
6388
7703
|
* Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
|
|
6389
7704
|
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
@@ -6477,7 +7792,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6477
7792
|
* "top" | "right" | "bottom" | "left" |
|
|
6478
7793
|
* "bottom-start" | "top-start" | "top-end" |
|
|
6479
7794
|
* "right-start" | "right-end" | "bottom-end" |
|
|
6480
|
-
* "left-start" | "left-end"
|
|
7795
|
+
* "left-start" | "left-end".
|
|
6481
7796
|
* @default bottom-start
|
|
6482
7797
|
*/
|
|
6483
7798
|
placement: {
|
|
@@ -6485,6 +7800,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6485
7800
|
reflect: true
|
|
6486
7801
|
},
|
|
6487
7802
|
|
|
7803
|
+
/**
|
|
7804
|
+
* Define custom placeholder text.
|
|
7805
|
+
*/
|
|
7806
|
+
placeholder: {
|
|
7807
|
+
type: String,
|
|
7808
|
+
reflect: true
|
|
7809
|
+
},
|
|
7810
|
+
|
|
6488
7811
|
/**
|
|
6489
7812
|
* Populates the `required` attribute on the element. Used for client-side validation.
|
|
6490
7813
|
*/
|
|
@@ -6531,11 +7854,12 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6531
7854
|
},
|
|
6532
7855
|
|
|
6533
7856
|
/**
|
|
6534
|
-
* Value selected for the component.
|
|
6535
|
-
* @type {String|Array<String>}
|
|
7857
|
+
* Value selected for the component.
|
|
6536
7858
|
*/
|
|
6537
7859
|
value: {
|
|
6538
|
-
type:
|
|
7860
|
+
type: String,
|
|
7861
|
+
reflect: true,
|
|
7862
|
+
attribute: 'value'
|
|
6539
7863
|
},
|
|
6540
7864
|
|
|
6541
7865
|
/**
|
|
@@ -6582,15 +7906,47 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6582
7906
|
static get styles() {
|
|
6583
7907
|
return [
|
|
6584
7908
|
css`${shapeSizeCss$1}`,
|
|
6585
|
-
css`${tokensCss$
|
|
7909
|
+
css`${tokensCss$5}`,
|
|
6586
7910
|
css`${styleCss}`,
|
|
6587
7911
|
];
|
|
6588
7912
|
}
|
|
6589
7913
|
|
|
7914
|
+
/**
|
|
7915
|
+
* Formatted value based on `multiSelect` state.
|
|
7916
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
7917
|
+
* @private
|
|
7918
|
+
* @returns {String|Array<String>}
|
|
7919
|
+
*/
|
|
7920
|
+
get formattedValue() {
|
|
7921
|
+
if (this.multiSelect) {
|
|
7922
|
+
if (!this.value) {
|
|
7923
|
+
return undefined;
|
|
7924
|
+
}
|
|
7925
|
+
if (this.value.startsWith("[")) {
|
|
7926
|
+
return JSON.parse(this.value);
|
|
7927
|
+
}
|
|
7928
|
+
return [this.value];
|
|
7929
|
+
}
|
|
7930
|
+
return this.value;
|
|
7931
|
+
}
|
|
7932
|
+
|
|
7933
|
+
/**
|
|
7934
|
+
* Returns classmap configuration for html5 input labels in all layouts.
|
|
7935
|
+
* @private
|
|
7936
|
+
* @returns {void}
|
|
7937
|
+
*/
|
|
7938
|
+
get commonLabelClasses() {
|
|
7939
|
+
return {
|
|
7940
|
+
'is-disabled': this.disabled,
|
|
7941
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
7942
|
+
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
7943
|
+
};
|
|
7944
|
+
}
|
|
7945
|
+
|
|
6590
7946
|
/**
|
|
6591
7947
|
* Returns classmap configuration for wrapper elements in each layout.
|
|
6592
7948
|
* @private
|
|
6593
|
-
* @
|
|
7949
|
+
* @returns {object} - Returns classmap.
|
|
6594
7950
|
*/
|
|
6595
7951
|
get commonWrapperClasses() {
|
|
6596
7952
|
return {
|
|
@@ -6606,8 +7962,27 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6606
7962
|
configureDropdown() {
|
|
6607
7963
|
this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
|
|
6608
7964
|
|
|
7965
|
+
this.dropdown.addEventListener('auroDropdown-toggled', () => {
|
|
7966
|
+
this.isPopoverVisible = this.dropdown.isPopoverVisible;
|
|
7967
|
+
|
|
7968
|
+
if (this.dropdown.isPopoverVisible) {
|
|
7969
|
+
// wait til the bib gets fully rendered
|
|
7970
|
+
setTimeout(() => {
|
|
7971
|
+
if (this.dropdown.isBibFullscreen) {
|
|
7972
|
+
// trigger holds the focus since menu is not a focusable element.
|
|
7973
|
+
this.dropdown.trigger.focus();
|
|
7974
|
+
|
|
7975
|
+
// default focus indicator on the first menu option
|
|
7976
|
+
if (this.menu.index < 0) {
|
|
7977
|
+
this.menu.navigateOptions('down');
|
|
7978
|
+
}
|
|
7979
|
+
}
|
|
7980
|
+
});
|
|
7981
|
+
}
|
|
7982
|
+
});
|
|
7983
|
+
|
|
6609
7984
|
// setting up bibtemplate
|
|
6610
|
-
this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
|
|
7985
|
+
this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
|
|
6611
7986
|
|
|
6612
7987
|
if (this.customBibWidth) {
|
|
6613
7988
|
this.dropdown.dropdownWidth = this.customBibWidth;
|
|
@@ -6626,7 +8001,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6626
8001
|
*
|
|
6627
8002
|
*/
|
|
6628
8003
|
static register(name = "auro-select") {
|
|
6629
|
-
AuroLibraryRuntimeUtils$
|
|
8004
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroSelect);
|
|
6630
8005
|
}
|
|
6631
8006
|
|
|
6632
8007
|
/**
|
|
@@ -6638,13 +8013,18 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6638
8013
|
const triggerContentEl = this.dropdown.querySelector('#triggerFocus');
|
|
6639
8014
|
|
|
6640
8015
|
// Clear out old value
|
|
6641
|
-
// const placeholder = triggerContentEl.querySelector('#placeholder');
|
|
6642
8016
|
const valueElem = triggerContentEl.querySelector('#value');
|
|
6643
8017
|
if (valueElem) {
|
|
6644
8018
|
valueElem.innerHTML = '';
|
|
6645
|
-
// valueElem.innerHTML = ''.appendChild(value);
|
|
6646
8019
|
}
|
|
6647
8020
|
|
|
8021
|
+
const slot = this.shadowRoot.querySelector('slot[name="displayValue"]');
|
|
8022
|
+
const slottedElements = slot.assignedElements();
|
|
8023
|
+
|
|
8024
|
+
slottedElements.forEach((element) => {
|
|
8025
|
+
element.remove();
|
|
8026
|
+
});
|
|
8027
|
+
|
|
6648
8028
|
// Handle selected options
|
|
6649
8029
|
if (this.optionSelected) {
|
|
6650
8030
|
if (this.multiSelect && this.optionSelected.length > 0) {
|
|
@@ -6654,10 +8034,8 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6654
8034
|
} else {
|
|
6655
8035
|
valueElem.innerHTML = this.optionSelected.innerHTML;
|
|
6656
8036
|
const displayValueEl = this.optionSelected.querySelector("[slot='displayValue']");
|
|
6657
|
-
if (displayValueEl) {
|
|
6658
|
-
const oldDisplayValueEl = this.querySelectorAll("[slot='displayValue']");
|
|
6659
|
-
oldDisplayValueEl.forEach((el) => el.remove());
|
|
6660
8037
|
|
|
8038
|
+
if (displayValueEl) {
|
|
6661
8039
|
this.appendChild(displayValueEl.cloneNode(true));
|
|
6662
8040
|
}
|
|
6663
8041
|
this.hasDisplayValueContent = displayValueEl !== null;
|
|
@@ -6683,6 +8061,15 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6683
8061
|
return;
|
|
6684
8062
|
}
|
|
6685
8063
|
|
|
8064
|
+
// set menu's default size if there it's not specified.
|
|
8065
|
+
if (!this.menu.getAttribute('size')) {
|
|
8066
|
+
this.menu.setAttribute('size', this.layout !== 'emphasized' ? 'md' : this.size);
|
|
8067
|
+
}
|
|
8068
|
+
|
|
8069
|
+
if (!this.getAttribute('shape')) {
|
|
8070
|
+
this.menu.setAttribute('shape', this.layout === 'classic' ? 'box' : this.shape);
|
|
8071
|
+
}
|
|
8072
|
+
|
|
6686
8073
|
if (this.multiSelect) {
|
|
6687
8074
|
this.menu.multiSelect = this.multiSelect;
|
|
6688
8075
|
}
|
|
@@ -6742,46 +8129,58 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6742
8129
|
configureSelect() {
|
|
6743
8130
|
|
|
6744
8131
|
this.addEventListener('keydown', (evt) => {
|
|
6745
|
-
|
|
6746
|
-
|
|
8132
|
+
// when the focus is on trigger not on close button
|
|
8133
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8134
|
+
if (evt.key === 'ArrowUp') {
|
|
8135
|
+
evt.preventDefault();
|
|
6747
8136
|
|
|
6748
|
-
|
|
8137
|
+
this.dropdown.show();
|
|
8138
|
+
|
|
8139
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8140
|
+
this.menu.navigateOptions('up');
|
|
8141
|
+
}
|
|
6749
8142
|
|
|
6750
|
-
|
|
6751
|
-
this.menu.navigateOptions('up');
|
|
8143
|
+
return;
|
|
6752
8144
|
}
|
|
6753
8145
|
|
|
6754
|
-
|
|
6755
|
-
|
|
8146
|
+
if (evt.key === 'ArrowDown') {
|
|
8147
|
+
evt.preventDefault();
|
|
6756
8148
|
|
|
6757
|
-
|
|
6758
|
-
evt.preventDefault();
|
|
8149
|
+
this.dropdown.show();
|
|
6759
8150
|
|
|
6760
|
-
|
|
8151
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8152
|
+
this.menu.navigateOptions('down');
|
|
8153
|
+
}
|
|
6761
8154
|
|
|
6762
|
-
|
|
6763
|
-
this.menu.navigateOptions('down');
|
|
8155
|
+
return;
|
|
6764
8156
|
}
|
|
6765
8157
|
|
|
6766
|
-
|
|
6767
|
-
|
|
8158
|
+
if (evt.key === 'Enter') {
|
|
8159
|
+
if (!this.dropdown.isPopoverVisible) {
|
|
8160
|
+
evt.preventDefault();
|
|
8161
|
+
this.menu.makeSelection();
|
|
8162
|
+
}
|
|
6768
8163
|
|
|
6769
|
-
|
|
6770
|
-
if (!this.dropdown.isPopoverVisible) {
|
|
6771
|
-
evt.preventDefault();
|
|
6772
|
-
this.menu.makeSelection();
|
|
8164
|
+
return;
|
|
6773
8165
|
}
|
|
6774
|
-
|
|
6775
|
-
return;
|
|
6776
8166
|
}
|
|
6777
8167
|
|
|
6778
|
-
if (evt.key === 'Tab') {
|
|
8168
|
+
if (evt.key === 'Tab' && this.dropdown.isPopoverVisible) {
|
|
6779
8169
|
if (this.dropdown.isBibFullscreen) {
|
|
6780
8170
|
evt.preventDefault();
|
|
8171
|
+
|
|
8172
|
+
// when the focus is on trigger not on close button
|
|
8173
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8174
|
+
// `dropdown.focus` will move focus to the first focusable element in bib when it's open,
|
|
8175
|
+
// when bib it not open, it will focus onto trigger.
|
|
8176
|
+
this.dropdown.focus();
|
|
8177
|
+
} else {
|
|
8178
|
+
// when close button has the focus, move focus back to the trigger
|
|
8179
|
+
this.dropdown.trigger.focus();
|
|
8180
|
+
}
|
|
6781
8181
|
} else {
|
|
6782
8182
|
this.dropdown.hide();
|
|
6783
8183
|
}
|
|
6784
|
-
|
|
6785
8184
|
return;
|
|
6786
8185
|
}
|
|
6787
8186
|
|
|
@@ -6946,34 +8345,39 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6946
8345
|
// Add the tag name as an attribute if it is different than the component name
|
|
6947
8346
|
this.runtimeUtils.handleComponentTagRename(this, 'auro-select');
|
|
6948
8347
|
|
|
6949
|
-
this.configureMenu();
|
|
6950
8348
|
this.configureDropdown();
|
|
8349
|
+
this.configureMenu();
|
|
6951
8350
|
this.configureSelect();
|
|
8351
|
+
}
|
|
6952
8352
|
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
8353
|
+
/**
|
|
8354
|
+
* Update the menu value. With checks for menu existence. Awaits value update.
|
|
8355
|
+
* @param {string} value - The value to set in the menu.
|
|
8356
|
+
* @returns {void}
|
|
8357
|
+
* @private
|
|
8358
|
+
*/
|
|
8359
|
+
async updateMenuValue(value) {
|
|
8360
|
+
if (!this.menu) return;
|
|
8361
|
+
|
|
8362
|
+
this.menu.setAttribute('value', value);
|
|
8363
|
+
this.menu.value = value;
|
|
8364
|
+
await this.menu.updateComplete;
|
|
6958
8365
|
}
|
|
6959
8366
|
|
|
6960
8367
|
async updated(changedProperties) {
|
|
6961
|
-
if (changedProperties.has('multiSelect')) {
|
|
8368
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has('value')) {
|
|
6962
8369
|
this.clearSelection();
|
|
6963
8370
|
}
|
|
6964
8371
|
|
|
6965
8372
|
if (changedProperties.has('value')) {
|
|
6966
8373
|
if (this.value) {
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
this.menu.value = this.value;
|
|
8374
|
+
await this.updateMenuValue(this.value);
|
|
6970
8375
|
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
this.optionSelected = this.menu.optionSelected;
|
|
8376
|
+
if (this.menu) {
|
|
8377
|
+
this.optionSelected = this.menu.optionSelected;
|
|
8378
|
+
}
|
|
6975
8379
|
} else {
|
|
6976
|
-
this.
|
|
8380
|
+
await this.updateMenuValue(undefined);
|
|
6977
8381
|
}
|
|
6978
8382
|
|
|
6979
8383
|
this._updateNativeSelect();
|
|
@@ -6992,7 +8396,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
6992
8396
|
composed: true,
|
|
6993
8397
|
detail: {
|
|
6994
8398
|
optionSelected: this.optionSelected,
|
|
6995
|
-
value: this.
|
|
8399
|
+
value: this.formattedValue
|
|
6996
8400
|
}
|
|
6997
8401
|
}));
|
|
6998
8402
|
}
|
|
@@ -7004,6 +8408,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7004
8408
|
if (changedProperties.has('error')) {
|
|
7005
8409
|
this.validate(true);
|
|
7006
8410
|
}
|
|
8411
|
+
|
|
8412
|
+
if (changedProperties.has('shape') && this.menu) {
|
|
8413
|
+
this.menu.setAttribute('shape', this.layout === 'classic' ? 'box' : this.shape);
|
|
8414
|
+
}
|
|
8415
|
+
|
|
8416
|
+
if (changedProperties.has('size') && this.menu) {
|
|
8417
|
+
this.menu.setAttribute('size', this.layout !== 'emphasized' ? 'md' : this.size);
|
|
8418
|
+
}
|
|
7007
8419
|
}
|
|
7008
8420
|
|
|
7009
8421
|
/**
|
|
@@ -7043,13 +8455,13 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7043
8455
|
const selectedValue = selectedOption.value;
|
|
7044
8456
|
|
|
7045
8457
|
if (this.multiSelect) {
|
|
7046
|
-
const currentArray =
|
|
8458
|
+
const currentArray = this.formattedValue;
|
|
7047
8459
|
|
|
7048
8460
|
if (!currentArray.includes(selectedValue)) {
|
|
7049
|
-
this.value = [
|
|
8461
|
+
this.value = JSON.stringify([
|
|
7050
8462
|
...currentArray,
|
|
7051
8463
|
selectedValue
|
|
7052
|
-
];
|
|
8464
|
+
]);
|
|
7053
8465
|
}
|
|
7054
8466
|
} else {
|
|
7055
8467
|
const currentValue = this.value;
|
|
@@ -7072,12 +8484,17 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7072
8484
|
}
|
|
7073
8485
|
|
|
7074
8486
|
if (this.multiSelect) {
|
|
7075
|
-
nativeSelect.value = this.
|
|
8487
|
+
nativeSelect.value = this.multiSelect ? this.multiSelect[0] : '';
|
|
7076
8488
|
} else {
|
|
7077
8489
|
nativeSelect.value = this.value || '';
|
|
7078
8490
|
}
|
|
7079
8491
|
}
|
|
7080
8492
|
|
|
8493
|
+
/**
|
|
8494
|
+
* Returns HTML for the hidden a11y screen reader content.
|
|
8495
|
+
* @private
|
|
8496
|
+
* @returns {html} - Returns HTML for the hidden a11y screen reader content.
|
|
8497
|
+
*/
|
|
7081
8498
|
renderAriaHtml() {
|
|
7082
8499
|
return html`
|
|
7083
8500
|
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
@@ -7098,9 +8515,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7098
8515
|
`;
|
|
7099
8516
|
}
|
|
7100
8517
|
|
|
8518
|
+
/**
|
|
8519
|
+
* Returns HTML for the hidden HTML5 select.
|
|
8520
|
+
* @private
|
|
8521
|
+
* @returns {html} - Returns HTML for the hidden HTML5 select.
|
|
8522
|
+
*/
|
|
7101
8523
|
renderNativeSelect() {
|
|
7102
8524
|
return html`
|
|
7103
|
-
<div class="nativeSelectWrapper">
|
|
8525
|
+
<div class="nativeSelectWrapper util_displayHidden">
|
|
7104
8526
|
<select
|
|
7105
8527
|
tabindex="-1"
|
|
7106
8528
|
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
@@ -7137,14 +8559,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7137
8559
|
? html`
|
|
7138
8560
|
<${this.helpTextTag} ?onDark="${this.onDark}">
|
|
7139
8561
|
<p id="${this.uniqueId}" part="helpText">
|
|
7140
|
-
<slot name="
|
|
8562
|
+
<slot name="helpText"></slot>
|
|
7141
8563
|
</p>
|
|
7142
8564
|
</${this.helpTextTag}>
|
|
7143
8565
|
`
|
|
7144
8566
|
: html`
|
|
7145
8567
|
<${this.helpTextTag} error ?onDark="${this.onDark}">
|
|
7146
8568
|
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
7147
|
-
|
|
8569
|
+
${this.errorMessage}
|
|
7148
8570
|
</p>
|
|
7149
8571
|
</${this.helpTextTag}>
|
|
7150
8572
|
`
|
|
@@ -7157,23 +8579,22 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7157
8579
|
* @private
|
|
7158
8580
|
* @returns {import("lit").TemplateResult} - Returns HTML for the emphasized layout.
|
|
7159
8581
|
*/
|
|
7160
|
-
// TODO update to use util class
|
|
7161
8582
|
renderLayoutEmphasized() {
|
|
7162
8583
|
const placeholderClass = {
|
|
7163
|
-
|
|
8584
|
+
'util_displayHidden': this.value
|
|
7164
8585
|
};
|
|
7165
8586
|
|
|
7166
8587
|
const displayValueClasses = {
|
|
7167
8588
|
'displayValue': true,
|
|
7168
8589
|
'hasContent': this.hasDisplayValueContent,
|
|
7169
|
-
'hasFocus': this.
|
|
7170
|
-
'withValue': this.value && this.value.length > 0,
|
|
8590
|
+
'hasFocus': this.isPopoverVisible,
|
|
8591
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
7171
8592
|
'force': this.forceDisplayValue,
|
|
7172
8593
|
};
|
|
7173
8594
|
|
|
7174
8595
|
const valueContainerClasses = {
|
|
7175
8596
|
'valueContainer': true,
|
|
7176
|
-
'util_displayHiddenVisually':
|
|
8597
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
7177
8598
|
};
|
|
7178
8599
|
|
|
7179
8600
|
return html`
|
|
@@ -7184,16 +8605,16 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7184
8605
|
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
7185
8606
|
</div>
|
|
7186
8607
|
<${this.dropdownTag}
|
|
8608
|
+
a11yRole="select"
|
|
7187
8609
|
?autoPlacement="${this.autoPlacement}"
|
|
7188
8610
|
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
7189
|
-
?matchWidth="${
|
|
8611
|
+
?matchWidth="${this.matchWidth}"
|
|
7190
8612
|
?noFlip="${this.noFlip}"
|
|
7191
8613
|
?onDark="${this.onDark}"
|
|
7192
8614
|
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
7193
8615
|
.offset="${this.offset}"
|
|
7194
8616
|
.placement="${this.placement}"
|
|
7195
8617
|
chevron
|
|
7196
|
-
fluid
|
|
7197
8618
|
for="selectMenu"
|
|
7198
8619
|
layout="${this.layout}"
|
|
7199
8620
|
part="dropdown"
|
|
@@ -7205,15 +8626,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7205
8626
|
</div>
|
|
7206
8627
|
<div class="mainContent">
|
|
7207
8628
|
<div class="${classMap(valueContainerClasses)}">
|
|
7208
|
-
<label>
|
|
8629
|
+
<label class="${classMap(this.commonLabelClasses)}">
|
|
7209
8630
|
<slot name="label"></slot>
|
|
8631
|
+
${this.required ? undefined : html`<slot name="optionalLabel"> (optional)</slot>`}
|
|
7210
8632
|
</label>
|
|
7211
8633
|
<div class="value" id="value"></div>
|
|
7212
|
-
${
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
</div>
|
|
7216
|
-
`}
|
|
8634
|
+
<div id="placeholder" class="${classMap(placeholderClass)}">
|
|
8635
|
+
${this.placeholder}
|
|
8636
|
+
</div>
|
|
7217
8637
|
</div>
|
|
7218
8638
|
<div class="${classMap(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
7219
8639
|
<slot name="displayValue"></slot>
|
|
@@ -7240,20 +8660,20 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7240
8660
|
*/
|
|
7241
8661
|
renderLayoutSnowflake() {
|
|
7242
8662
|
const placeholderClass = {
|
|
7243
|
-
|
|
8663
|
+
'util_displayHidden': this.value
|
|
7244
8664
|
};
|
|
7245
8665
|
|
|
7246
8666
|
const displayValueClasses = {
|
|
7247
8667
|
'displayValue': true,
|
|
7248
8668
|
'hasContent': this.hasDisplayValueContent,
|
|
7249
|
-
'hasFocus': this.
|
|
7250
|
-
'withValue': this.value && this.value.length > 0,
|
|
8669
|
+
'hasFocus': this.isPopoverVisible,
|
|
8670
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
7251
8671
|
'force': this.forceDisplayValue,
|
|
7252
8672
|
};
|
|
7253
8673
|
|
|
7254
8674
|
const valueContainerClasses = {
|
|
7255
8675
|
'valueContainer': true,
|
|
7256
|
-
'util_displayHiddenVisually': (this.forceDisplayValue || !this.
|
|
8676
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
7257
8677
|
};
|
|
7258
8678
|
|
|
7259
8679
|
return html`
|
|
@@ -7266,14 +8686,13 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7266
8686
|
<${this.dropdownTag}
|
|
7267
8687
|
?autoPlacement="${this.autoPlacement}"
|
|
7268
8688
|
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
7269
|
-
?matchWidth="${
|
|
8689
|
+
?matchWidth="${this.matchWidth}"
|
|
7270
8690
|
?noFlip="${this.noFlip}"
|
|
7271
8691
|
?onDark="${this.onDark}"
|
|
7272
8692
|
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
7273
8693
|
.offset="${this.offset}"
|
|
7274
8694
|
.placement="${this.placement}"
|
|
7275
8695
|
chevron
|
|
7276
|
-
fluid
|
|
7277
8696
|
for="selectMenu"
|
|
7278
8697
|
layout="${this.layout}"
|
|
7279
8698
|
part="dropdown"
|
|
@@ -7285,15 +8704,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7285
8704
|
</div>
|
|
7286
8705
|
<div class="mainContent">
|
|
7287
8706
|
<div class="${classMap(valueContainerClasses)}">
|
|
7288
|
-
<label>
|
|
8707
|
+
<label class="${classMap(this.commonLabelClasses)}">
|
|
7289
8708
|
<slot name="label"></slot>
|
|
8709
|
+
${this.required ? undefined : html`<slot name="optionalLabel"> (optional)</slot>`}
|
|
7290
8710
|
</label>
|
|
7291
8711
|
<div class="value" id="value"></div>
|
|
7292
|
-
${
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
</div>
|
|
7296
|
-
`}
|
|
8712
|
+
<div id="placeholder" class="${classMap(placeholderClass)}">
|
|
8713
|
+
${this.placeholder}
|
|
8714
|
+
</div>
|
|
7297
8715
|
</div>
|
|
7298
8716
|
<div class="${classMap(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
7299
8717
|
<slot name="displayValue"></slot>
|
|
@@ -7309,6 +8727,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7309
8727
|
${this.renderHtmlHelpText()}
|
|
7310
8728
|
</div>
|
|
7311
8729
|
</${this.dropdownTag}>
|
|
8730
|
+
${this.renderNativeSelect()}
|
|
7312
8731
|
</div>
|
|
7313
8732
|
`;
|
|
7314
8733
|
}
|
|
@@ -7319,11 +8738,75 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7319
8738
|
* @returns {import("lit").TemplateResult} - Returns HTML for the classic layout.
|
|
7320
8739
|
*/
|
|
7321
8740
|
renderLayoutClassic() {
|
|
8741
|
+
const placeholderClass = {
|
|
8742
|
+
'util_displayHidden': this.value
|
|
8743
|
+
};
|
|
8744
|
+
|
|
8745
|
+
const displayValueClasses = {
|
|
8746
|
+
'displayValue': true,
|
|
8747
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8748
|
+
'hasFocus': this.isPopoverVisible,
|
|
8749
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8750
|
+
'force': this.forceDisplayValue,
|
|
8751
|
+
};
|
|
8752
|
+
|
|
8753
|
+
const valueContainerClasses = {
|
|
8754
|
+
'valueContainer': true,
|
|
8755
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
8756
|
+
};
|
|
8757
|
+
|
|
7322
8758
|
return html`
|
|
7323
8759
|
<div
|
|
7324
|
-
class="${classMap(this.commonWrapperClasses)}
|
|
8760
|
+
class="${classMap(this.commonWrapperClasses)}"
|
|
7325
8761
|
part="wrapper">
|
|
7326
|
-
|
|
8762
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8763
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8764
|
+
</div>
|
|
8765
|
+
<${this.dropdownTag}
|
|
8766
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8767
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8768
|
+
?matchWidth="${!this.flexMenuWidth}"
|
|
8769
|
+
?noFlip="${this.noFlip}"
|
|
8770
|
+
?onDark="${this.onDark}"
|
|
8771
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8772
|
+
.offset="${this.offset}"
|
|
8773
|
+
.placement="${this.placement}"
|
|
8774
|
+
chevron
|
|
8775
|
+
for="selectMenu"
|
|
8776
|
+
layout="${this.layout}"
|
|
8777
|
+
part="dropdown"
|
|
8778
|
+
shape="${this.shape}"
|
|
8779
|
+
size="${this.size}">
|
|
8780
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8781
|
+
<div class="accents left">
|
|
8782
|
+
<slot name="typeIcon"></slot>
|
|
8783
|
+
</div>
|
|
8784
|
+
<div class="mainContent">
|
|
8785
|
+
<div class="${classMap(valueContainerClasses)}">
|
|
8786
|
+
<label class="${classMap(this.commonLabelClasses)}">
|
|
8787
|
+
<slot name="label"></slot>
|
|
8788
|
+
${this.required ? undefined : html`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8789
|
+
</label>
|
|
8790
|
+
<div class="value" id="value"></div>
|
|
8791
|
+
<div id="placeholder" class="${classMap(placeholderClass)}">
|
|
8792
|
+
${this.placeholder}
|
|
8793
|
+
</div>
|
|
8794
|
+
</div>
|
|
8795
|
+
<div class="${classMap(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8796
|
+
<slot name="displayValue"></slot>
|
|
8797
|
+
</div>
|
|
8798
|
+
</div>
|
|
8799
|
+
<div class="accents right"></div>
|
|
8800
|
+
</div>
|
|
8801
|
+
<div class="menuWrapper"></div>
|
|
8802
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8803
|
+
<slot></slot>
|
|
8804
|
+
</${this.bibtemplateTag}>
|
|
8805
|
+
<div slot="helpText">
|
|
8806
|
+
${this.renderHtmlHelpText()}
|
|
8807
|
+
</div>
|
|
8808
|
+
</${this.dropdownTag}>
|
|
8809
|
+
${this.renderNativeSelect()}
|
|
7327
8810
|
</div>
|
|
7328
8811
|
`;
|
|
7329
8812
|
}
|
|
@@ -7357,105 +8840,6 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7357
8840
|
|
|
7358
8841
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
7359
8842
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
7360
|
-
|
|
7361
|
-
// function that renders the HTML and CSS into the scope of the component
|
|
7362
|
-
renderBACKUP() {
|
|
7363
|
-
const placeholderClass = {
|
|
7364
|
-
hidden: this.value,
|
|
7365
|
-
};
|
|
7366
|
-
|
|
7367
|
-
return html`
|
|
7368
|
-
<div class="outerWrapper">
|
|
7369
|
-
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
7370
|
-
${this.optionActive && this.options.length > 0
|
|
7371
|
-
? html`
|
|
7372
|
-
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
7373
|
-
`
|
|
7374
|
-
: undefined
|
|
7375
|
-
};
|
|
7376
|
-
|
|
7377
|
-
${this.optionSelected && this.options.length > 0
|
|
7378
|
-
? html`
|
|
7379
|
-
${`${this.optionSelected.innerText} selected`}
|
|
7380
|
-
`
|
|
7381
|
-
: undefined
|
|
7382
|
-
};
|
|
7383
|
-
</div>
|
|
7384
|
-
<div id="slotHolder" aria-hidden="true">
|
|
7385
|
-
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
7386
|
-
</div>
|
|
7387
|
-
<${this.dropdownTag}
|
|
7388
|
-
?autoPlacement="${this.autoPlacement}"
|
|
7389
|
-
?disabled="${this.disabled}"
|
|
7390
|
-
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
7391
|
-
?matchWidth="${!this.flexMenuWidth}"
|
|
7392
|
-
?noFlip="${this.noFlip}"
|
|
7393
|
-
?onDark="${this.onDark}"
|
|
7394
|
-
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
7395
|
-
.offset="${this.offset}"
|
|
7396
|
-
.placement="${this.placement}"
|
|
7397
|
-
chevron
|
|
7398
|
-
fluid
|
|
7399
|
-
for="selectMenu"
|
|
7400
|
-
layout="${this.layout}"
|
|
7401
|
-
part="dropdown"
|
|
7402
|
-
shape="${this.shape}"
|
|
7403
|
-
size="${this.size}">
|
|
7404
|
-
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
7405
|
-
<span id="placeholder"
|
|
7406
|
-
class="${classMap(placeholderClass)}"
|
|
7407
|
-
?aria-hidden="${this.optionSelected && this.optionSelected.length ? 'true' : false}"
|
|
7408
|
-
>
|
|
7409
|
-
<slot name="placeholder"></slot>
|
|
7410
|
-
</span>
|
|
7411
|
-
<slot name="valueText" id="valueText"></slot>
|
|
7412
|
-
</span>
|
|
7413
|
-
|
|
7414
|
-
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
7415
|
-
<slot></slot>
|
|
7416
|
-
</${this.bibtemplateTag}>
|
|
7417
|
-
<slot name="label" slot="label"></slot>
|
|
7418
|
-
<p slot="helpText">
|
|
7419
|
-
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
7420
|
-
? html`
|
|
7421
|
-
<span id="${this.uniqueId}" part="helpText">
|
|
7422
|
-
<slot name="helpText"></slot>
|
|
7423
|
-
</span>`
|
|
7424
|
-
: html`
|
|
7425
|
-
<span id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
7426
|
-
${this.errorMessage}
|
|
7427
|
-
</span>`
|
|
7428
|
-
}
|
|
7429
|
-
</p>
|
|
7430
|
-
</${this.dropdownTag}>
|
|
7431
|
-
<div class="nativeSelectWrapper">
|
|
7432
|
-
<select
|
|
7433
|
-
tabindex="-1"
|
|
7434
|
-
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
7435
|
-
name="${this.name || ''}"
|
|
7436
|
-
?disabled="${this.disabled}"
|
|
7437
|
-
?required="${this.required}"
|
|
7438
|
-
aria-hidden="true"
|
|
7439
|
-
autocomplete="${ifDefined$1(this.autocomplete)}"
|
|
7440
|
-
@change="${this._handleNativeSelectChange}">
|
|
7441
|
-
<option value="" ?selected="${!this.value}"></option>
|
|
7442
|
-
${this.options.map((option) => {
|
|
7443
|
-
const optionValue = option.value || option.textContent;
|
|
7444
|
-
return html`
|
|
7445
|
-
<option
|
|
7446
|
-
value="${optionValue}"
|
|
7447
|
-
?selected="${this.value === optionValue}">
|
|
7448
|
-
${option.textContent}
|
|
7449
|
-
</option>
|
|
7450
|
-
`;
|
|
7451
|
-
})}
|
|
7452
|
-
</select>
|
|
7453
|
-
</div>
|
|
7454
|
-
<!-- Help text and error message template -->
|
|
7455
|
-
${this.renderHtmlHelpText()}
|
|
7456
|
-
</div>
|
|
7457
|
-
`;
|
|
7458
|
-
}
|
|
7459
8843
|
}
|
|
7460
8844
|
|
|
7461
8845
|
AuroSelect.register();
|