@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.4 → 0.0.0-pr624.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/bibtemplate/dist/auro-bibtemplate.d.ts +13 -2
- package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +1292 -79
- package/components/bibtemplate/dist/registered.js +1292 -79
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/api.md +47 -14
- package/components/checkbox/demo/api.min.js +44 -31
- package/components/checkbox/demo/index.md +2 -2
- package/components/checkbox/demo/index.min.js +44 -31
- 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 +44 -31
- package/components/checkbox/dist/registered.js +44 -31
- package/components/combobox/demo/api.md +100 -2
- package/components/combobox/demo/api.min.js +3202 -759
- package/components/combobox/demo/index.md +6 -30
- package/components/combobox/demo/index.min.js +3202 -759
- package/components/combobox/dist/auro-combobox.d.ts +37 -16
- package/components/combobox/dist/index.js +3091 -789
- package/components/combobox/dist/registered.js +3091 -789
- package/components/counter/demo/api.html +1 -0
- package/components/counter/demo/api.md +21 -19
- package/components/counter/demo/api.min.js +3324 -614
- package/components/counter/demo/index.html +1 -0
- package/components/counter/demo/index.md +103 -34
- package/components/counter/demo/index.min.js +3324 -614
- package/components/counter/dist/auro-counter-button.d.ts +2 -0
- package/components/counter/dist/auro-counter-group.d.ts +89 -6
- package/components/counter/dist/auro-counter.d.ts +6 -0
- package/components/counter/dist/helptextVersion.d.ts +2 -0
- package/components/counter/dist/iconVersion.d.ts +1 -1
- package/components/counter/dist/index.js +3324 -614
- package/components/counter/dist/registered.js +3324 -614
- package/components/datepicker/demo/api.md +36 -19
- package/components/datepicker/demo/api.min.js +11976 -8000
- package/components/datepicker/demo/index.md +80 -0
- package/components/datepicker/demo/index.min.js +11976 -8000
- package/components/datepicker/dist/auro-datepicker.d.ts +71 -3
- package/components/datepicker/dist/buttonVersion.d.ts +1 -1
- package/components/datepicker/dist/iconVersion.d.ts +2 -0
- package/components/datepicker/dist/index.js +12238 -8262
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +12238 -8262
- package/components/dropdown/demo/api.md +8 -9
- package/components/dropdown/demo/api.min.js +551 -147
- package/components/dropdown/demo/index.md +57 -9
- package/components/dropdown/demo/index.min.js +551 -147
- package/components/dropdown/dist/auro-dropdown.d.ts +28 -9
- package/components/dropdown/dist/auro-dropdownBib.d.ts +22 -0
- package/components/dropdown/dist/index.js +551 -147
- package/components/dropdown/dist/registered.js +551 -147
- package/components/form/demo/api.min.js +1 -1
- package/components/form/demo/index.min.js +1 -1
- package/components/form/dist/index.js +1 -1
- package/components/form/dist/registered.js +1 -1
- package/components/helptext/dist/index.js +2 -2
- package/components/helptext/dist/registered.js +2 -2
- package/components/input/README.md +5 -2
- package/components/input/demo/api.md +271 -176
- package/components/input/demo/api.min.js +956 -270
- package/components/input/demo/index.md +48 -32
- package/components/input/demo/index.min.js +955 -269
- package/components/input/demo/readme.md +5 -2
- package/components/input/dist/auro-input.d.ts +23 -15
- package/components/input/dist/base-input.d.ts +32 -8
- package/components/input/dist/buttonVersion.d.ts +1 -1
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +955 -269
- package/components/input/dist/registered.js +955 -269
- package/components/layoutElement/dist/index.js +13 -10
- package/components/menu/demo/api.html +38 -0
- package/components/menu/demo/api.md +68 -7
- package/components/menu/demo/api.min.js +278 -42
- package/components/menu/demo/index.min.js +278 -42
- package/components/menu/dist/auro-menu.d.ts +28 -5
- package/components/menu/dist/auro-menuoption.d.ts +15 -3
- package/components/menu/dist/iconVersion.d.ts +1 -1
- package/components/menu/dist/index.js +278 -42
- package/components/menu/dist/registered.js +278 -42
- package/components/menu/dist/styles/default/color-menuoption-css.d.ts +2 -0
- package/components/menu/dist/styles/default/style-menu-css.d.ts +2 -0
- package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
- package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
- package/components/radio/demo/api.md +7 -8
- package/components/radio/demo/api.min.js +68 -80
- package/components/radio/demo/index.min.js +68 -80
- 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 +68 -80
- package/components/radio/dist/registered.js +68 -80
- package/components/select/demo/api.md +123 -13
- package/components/select/demo/api.min.js +3045 -456
- package/components/select/demo/index.html +1 -0
- package/components/select/demo/index.md +323 -763
- package/components/select/demo/index.min.js +3045 -456
- package/components/select/dist/auro-select.d.ts +112 -11
- package/components/select/dist/helptextVersion.d.ts +2 -0
- package/components/select/dist/index.js +2925 -477
- package/components/select/dist/registered.js +2925 -477
- package/components/select/dist/styles/shapeSize-css.d.ts +2 -0
- package/components/select/dist/styles/tokens-css.d.ts +2 -0
- package/package.json +6 -4
- /package/components/{dropdown/dist/styles/default/bibColors-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/{dropdown → datepicker}/dist/styles/default/color-css.d.ts +0 -0
- /package/components/{dropdown/dist/styles/default/bibStyles-css.d.ts → datepicker/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/{dropdown/dist/styles/default/style-css.d.ts → datepicker/dist/styles/snowflake/color-css.d.ts} +0 -0
- /package/components/{dropdown/dist/styles → datepicker/dist/styles/snowflake}/style-css.d.ts +0 -0
- /package/components/{menu/dist/styles/color-menu-css.d.ts → dropdown/dist/styles/classic/bibColors-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/color-menuoption-css.d.ts → dropdown/dist/styles/classic/bibStyles-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/style-menu-css.d.ts → dropdown/dist/styles/classic/color-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/style-menuoption-css.d.ts → dropdown/dist/styles/classic/style-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{tokens-css.d.ts → default/color-menu-css.d.ts} +0 -0
|
@@ -44,6 +44,105 @@ const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});let i$1 = cl
|
|
|
44
44
|
*/
|
|
45
45
|
const a=Symbol.for(""),o$1=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litStatic$:t,r:a}),i=(t,...r)=>({_$litStatic$:r.reduce(((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[a+1]),t[0]),r:a}),l=new Map,n=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=false;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o$1(i));)c+=s+r[++$],f=true;$!==a&&u.push(i),n.push(c),$++;}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l.get(t))&&(n.raw=n,l.set(t,r=n)),e=u;}return t(r,...e)},u=n(x);
|
|
46
46
|
|
|
47
|
+
let AuroElement$4 = class AuroElement extends i$2 {
|
|
48
|
+
static get properties() {
|
|
49
|
+
return {
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Defines the language of an element.
|
|
53
|
+
* @default {'default'}
|
|
54
|
+
*/
|
|
55
|
+
layout: {
|
|
56
|
+
type: String,
|
|
57
|
+
attribute: "layout",
|
|
58
|
+
reflect: true
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
shape: {
|
|
62
|
+
type: String,
|
|
63
|
+
attribute: "shape",
|
|
64
|
+
reflect: true
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
size: {
|
|
68
|
+
type: String,
|
|
69
|
+
attribute: "size",
|
|
70
|
+
reflect: true
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
onDark: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
attribute: "ondark",
|
|
76
|
+
reflect: true
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
resetShapeClasses() {
|
|
82
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
83
|
+
|
|
84
|
+
if (wrapper) {
|
|
85
|
+
wrapper.classList.forEach((className) => {
|
|
86
|
+
if (className.startsWith('shape-')) {
|
|
87
|
+
wrapper.classList.remove(className);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (this.shape && this.size) {
|
|
94
|
+
wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
95
|
+
} else {
|
|
96
|
+
wrapper.classList.add('shape-none');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
resetLayoutClasses() {
|
|
101
|
+
if (this.layout) {
|
|
102
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
103
|
+
|
|
104
|
+
if (wrapper) {
|
|
105
|
+
wrapper.classList.forEach((className) => {
|
|
106
|
+
if (className.startsWith('layout-')) {
|
|
107
|
+
wrapper.classList.remove(className);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
updateComponentArchitecture() {
|
|
117
|
+
this.resetLayoutClasses();
|
|
118
|
+
this.resetShapeClasses();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
updated(changedProperties) {
|
|
122
|
+
if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
|
|
123
|
+
this.updateComponentArchitecture();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
|
|
128
|
+
// This will catch if an invalid layout value is passed in and render the default layout if so.
|
|
129
|
+
render() {
|
|
130
|
+
try {
|
|
131
|
+
return this.renderLayout();
|
|
132
|
+
} catch (error) {
|
|
133
|
+
// failed to get the defined layout
|
|
134
|
+
console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
|
|
135
|
+
|
|
136
|
+
// fallback to the default layout
|
|
137
|
+
return this.getLayout('default');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
var shapeSizeCss$1 = i$5`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:58px;max-height:58px;border-style:solid;border-width:1px;border-radius:var(--ds-border-radius, 0.375rem)}.shape-classic-xl.simple,.shape-classic-lg.simple,.shape-classic-md.simple,.shape-classic-sm.simple,.shape-classic-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}`;
|
|
143
|
+
|
|
144
|
+
var tokensCss$5 = i$5`:host(:not([ondark])){--ds-auro-select-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-select-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-select-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-select-placeholder-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-select-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-select-error-icon-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-select-outline-color: transparent}:host([ondark]){--ds-auro-select-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-select-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-select-label-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-placeholder-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-error-icon-color: var(--ds-basic-color-status-error-subtle, #fbc6c6);--ds-auro-select-outline-color: transparent}`;
|
|
145
|
+
|
|
47
146
|
class DateFormatter {
|
|
48
147
|
|
|
49
148
|
constructor() {
|
|
@@ -100,9 +199,10 @@ class DateFormatter {
|
|
|
100
199
|
/**
|
|
101
200
|
* Convert a date object to string format.
|
|
102
201
|
* @param {Object} date - Date to convert to string.
|
|
103
|
-
* @
|
|
202
|
+
* @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
|
|
203
|
+
* @returns {String} Returns the date as a string.
|
|
104
204
|
*/
|
|
105
|
-
this.getDateAsString = (date) => date.toLocaleDateString(
|
|
205
|
+
this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
|
|
106
206
|
year: "numeric",
|
|
107
207
|
month: "2-digit",
|
|
108
208
|
day: "2-digit",
|
|
@@ -294,7 +394,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
|
|
|
294
394
|
const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
|
|
295
395
|
|
|
296
396
|
// Get the date string of the date object we created from the string date
|
|
297
|
-
const actualDateStr = dateFormatter.getDateAsString(dateObj);
|
|
397
|
+
const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
|
|
298
398
|
|
|
299
399
|
// Guard Clause: Generated date matches date string input
|
|
300
400
|
if (expectedDateStr !== actualDateStr) {
|
|
@@ -459,7 +559,7 @@ const {
|
|
|
459
559
|
|
|
460
560
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
461
561
|
|
|
462
|
-
let AuroLibraryRuntimeUtils$
|
|
562
|
+
let AuroLibraryRuntimeUtils$6 = class AuroLibraryRuntimeUtils {
|
|
463
563
|
|
|
464
564
|
/* eslint-disable jsdoc/require-param */
|
|
465
565
|
|
|
@@ -529,7 +629,7 @@ let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
|
|
|
529
629
|
class AuroFormValidation {
|
|
530
630
|
|
|
531
631
|
constructor() {
|
|
532
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
632
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
533
633
|
}
|
|
534
634
|
|
|
535
635
|
/**
|
|
@@ -808,7 +908,9 @@ class AuroFormValidation {
|
|
|
808
908
|
elem.validity = this.auroInputElements[0].validity;
|
|
809
909
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
810
910
|
|
|
811
|
-
|
|
911
|
+
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
912
|
+
// combobox's 2nd input will have noValidate set true.
|
|
913
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !this.auroInputElements[1].noValidate) {
|
|
812
914
|
elem.validity = this.auroInputElements[1].validity;
|
|
813
915
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
814
916
|
}
|
|
@@ -941,7 +1043,7 @@ let AuroDependencyVersioning$2 = class AuroDependencyVersioning {
|
|
|
941
1043
|
|
|
942
1044
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
943
1045
|
|
|
944
|
-
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
1046
|
+
let AuroLibraryRuntimeUtils$2$1 = class AuroLibraryRuntimeUtils {
|
|
945
1047
|
|
|
946
1048
|
/* eslint-disable jsdoc/require-param */
|
|
947
1049
|
|
|
@@ -1524,10 +1626,11 @@ const flip$1 = function (options) {
|
|
|
1524
1626
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
1525
1627
|
const nextPlacement = placements[nextIndex];
|
|
1526
1628
|
if (nextPlacement) {
|
|
1527
|
-
var _overflowsData$;
|
|
1528
1629
|
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
1529
|
-
|
|
1530
|
-
if
|
|
1630
|
+
if (!ignoreCrossAxisOverflow ||
|
|
1631
|
+
// We leave the current main axis only if every placement on that axis
|
|
1632
|
+
// overflows the main axis.
|
|
1633
|
+
overflowsData.every(d => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {
|
|
1531
1634
|
// Try next placement and re-run the lifecycle.
|
|
1532
1635
|
return {
|
|
1533
1636
|
data: {
|
|
@@ -2548,8 +2651,28 @@ class AuroFloatingUI {
|
|
|
2548
2651
|
if (!AuroFloatingUI.isMousePressHandlerInitialized && window && window.addEventListener) {
|
|
2549
2652
|
AuroFloatingUI.isMousePressHandlerInitialized = true;
|
|
2550
2653
|
|
|
2654
|
+
// Track timeout for isMousePressed reset to avoid race conditions
|
|
2655
|
+
if (!AuroFloatingUI._mousePressedTimeout) {
|
|
2656
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
2657
|
+
}
|
|
2551
2658
|
const mouseEventGlobalHandler = (event) => {
|
|
2552
|
-
|
|
2659
|
+
const isPressed = event.type === 'mousedown';
|
|
2660
|
+
if (isPressed) {
|
|
2661
|
+
// Clear any pending timeout to prevent race condition
|
|
2662
|
+
if (AuroFloatingUI._mousePressedTimeout !== null) {
|
|
2663
|
+
clearTimeout(AuroFloatingUI._mousePressedTimeout);
|
|
2664
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
2665
|
+
}
|
|
2666
|
+
if (!AuroFloatingUI.isMousePressed) {
|
|
2667
|
+
AuroFloatingUI.isMousePressed = true;
|
|
2668
|
+
}
|
|
2669
|
+
} else if (AuroFloatingUI.isMousePressed && !isPressed) {
|
|
2670
|
+
// Schedule reset and track timeout ID
|
|
2671
|
+
AuroFloatingUI._mousePressedTimeout = setTimeout(() => {
|
|
2672
|
+
AuroFloatingUI.isMousePressed = false;
|
|
2673
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
2674
|
+
}, 0);
|
|
2675
|
+
}
|
|
2553
2676
|
};
|
|
2554
2677
|
|
|
2555
2678
|
window.addEventListener('mousedown', mouseEventGlobalHandler);
|
|
@@ -2676,6 +2799,7 @@ class AuroFloatingUI {
|
|
|
2676
2799
|
|
|
2677
2800
|
// Compute the position of the bib
|
|
2678
2801
|
computePosition(this.element.trigger, this.element.bib, {
|
|
2802
|
+
strategy: this.element.floaterConfig?.strategy || 'fixed',
|
|
2679
2803
|
placement: this.element.floaterConfig?.placement,
|
|
2680
2804
|
middleware: middleware || []
|
|
2681
2805
|
}).then(({ x, y }) => { // eslint-disable-line id-length
|
|
@@ -2810,8 +2934,9 @@ class AuroFloatingUI {
|
|
|
2810
2934
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2811
2935
|
return;
|
|
2812
2936
|
}
|
|
2813
|
-
|
|
2814
|
-
if
|
|
2937
|
+
|
|
2938
|
+
// if fullscreen bib is in fullscreen mode, do not close
|
|
2939
|
+
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2815
2940
|
return;
|
|
2816
2941
|
}
|
|
2817
2942
|
|
|
@@ -2993,10 +3118,11 @@ class AuroFloatingUI {
|
|
|
2993
3118
|
// Space is included as it's expected behavior for interactive elements
|
|
2994
3119
|
|
|
2995
3120
|
const origin = event.composedPath()[0];
|
|
2996
|
-
if (event.key === 'Enter' || (
|
|
2997
|
-
|
|
3121
|
+
if (event.key === 'Enter' || event.key === ' ' && (!origin || origin.tagName !== "INPUT")) {
|
|
3122
|
+
|
|
3123
|
+
event.preventDefault();
|
|
2998
3124
|
this.handleClick();
|
|
2999
|
-
}
|
|
3125
|
+
}
|
|
3000
3126
|
break;
|
|
3001
3127
|
case 'mouseenter':
|
|
3002
3128
|
if (this.element.hoverToggle) {
|
|
@@ -3112,8 +3238,6 @@ class AuroFloatingUI {
|
|
|
3112
3238
|
this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
|
|
3113
3239
|
}
|
|
3114
3240
|
|
|
3115
|
-
document.body.append(this.element.bib);
|
|
3116
|
-
|
|
3117
3241
|
this.regenerateBibId();
|
|
3118
3242
|
this.handleTriggerTabIndex();
|
|
3119
3243
|
|
|
@@ -3150,6 +3274,267 @@ class AuroFloatingUI {
|
|
|
3150
3274
|
}
|
|
3151
3275
|
}
|
|
3152
3276
|
|
|
3277
|
+
// Selectors for focusable elements
|
|
3278
|
+
const FOCUSABLE_SELECTORS = [
|
|
3279
|
+
'a[href]',
|
|
3280
|
+
'button:not([disabled])',
|
|
3281
|
+
'textarea:not([disabled])',
|
|
3282
|
+
'input:not([disabled])',
|
|
3283
|
+
'select:not([disabled])',
|
|
3284
|
+
'[role="tab"]:not([disabled])',
|
|
3285
|
+
'[role="link"]:not([disabled])',
|
|
3286
|
+
'[role="button"]:not([disabled])',
|
|
3287
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
3288
|
+
'[contenteditable]:not([contenteditable="false"])'
|
|
3289
|
+
];
|
|
3290
|
+
|
|
3291
|
+
// List of custom components that are known to be focusable
|
|
3292
|
+
const FOCUSABLE_COMPONENTS = [
|
|
3293
|
+
'auro-checkbox',
|
|
3294
|
+
'auro-radio',
|
|
3295
|
+
'auro-dropdown',
|
|
3296
|
+
'auro-button',
|
|
3297
|
+
'auro-combobox',
|
|
3298
|
+
'auro-input',
|
|
3299
|
+
'auro-counter',
|
|
3300
|
+
'auro-menu',
|
|
3301
|
+
'auro-select',
|
|
3302
|
+
'auro-datepicker',
|
|
3303
|
+
'auro-hyperlink',
|
|
3304
|
+
'auro-accordion',
|
|
3305
|
+
];
|
|
3306
|
+
|
|
3307
|
+
/**
|
|
3308
|
+
* Determines if a given element is a custom focusable component.
|
|
3309
|
+
* Returns true if the element matches a known focusable component and is not disabled.
|
|
3310
|
+
*
|
|
3311
|
+
* @param {HTMLElement} element The element to check for focusability.
|
|
3312
|
+
* @returns {boolean} True if the element is a focusable custom component, false otherwise.
|
|
3313
|
+
*/
|
|
3314
|
+
function isFocusableComponent(element) {
|
|
3315
|
+
const componentName = element.tagName.toLowerCase();
|
|
3316
|
+
|
|
3317
|
+
// Guard Clause: Element is a focusable component
|
|
3318
|
+
if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
|
|
3319
|
+
|
|
3320
|
+
// Guard Clause: Element is not disabled
|
|
3321
|
+
if (element.hasAttribute('disabled')) return false;
|
|
3322
|
+
|
|
3323
|
+
// Guard Clause: The element is a hyperlink and has no href attribute
|
|
3324
|
+
if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
|
|
3325
|
+
|
|
3326
|
+
// If all guard clauses pass, the element is a focusable component
|
|
3327
|
+
return true;
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3330
|
+
/**
|
|
3331
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
3332
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
3333
|
+
*
|
|
3334
|
+
* @param {HTMLElement} container The container to search within
|
|
3335
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
3336
|
+
*/
|
|
3337
|
+
function getFocusableElements(container) {
|
|
3338
|
+
// Get elements in DOM order by walking the tree
|
|
3339
|
+
const orderedFocusableElements = [];
|
|
3340
|
+
|
|
3341
|
+
// Define a recursive function to collect focusable elements in DOM order
|
|
3342
|
+
const collectFocusableElements = (root) => {
|
|
3343
|
+
// Check if current element is focusable
|
|
3344
|
+
if (root.nodeType === Node.ELEMENT_NODE) {
|
|
3345
|
+
// Check if this is a custom component that is focusable
|
|
3346
|
+
const isComponentFocusable = isFocusableComponent(root);
|
|
3347
|
+
|
|
3348
|
+
if (isComponentFocusable) {
|
|
3349
|
+
// Add the component itself as a focusable element and don't traverse its shadow DOM
|
|
3350
|
+
orderedFocusableElements.push(root);
|
|
3351
|
+
return; // Skip traversing inside this component
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3354
|
+
// Check if the element itself matches any selector
|
|
3355
|
+
for (const selector of FOCUSABLE_SELECTORS) {
|
|
3356
|
+
if (root.matches?.(selector)) {
|
|
3357
|
+
orderedFocusableElements.push(root);
|
|
3358
|
+
break; // Once we know it's focusable, no need to check other selectors
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
// Process shadow DOM only for non-Auro components
|
|
3363
|
+
if (root.shadowRoot) {
|
|
3364
|
+
// Process shadow DOM children in order
|
|
3365
|
+
if (root.shadowRoot.children) {
|
|
3366
|
+
Array.from(root.shadowRoot.children).forEach(child => {
|
|
3367
|
+
collectFocusableElements(child);
|
|
3368
|
+
});
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
|
|
3372
|
+
// Process slots and their assigned nodes in order
|
|
3373
|
+
if (root.tagName === 'SLOT') {
|
|
3374
|
+
const assignedNodes = root.assignedNodes({ flatten: true });
|
|
3375
|
+
for (const node of assignedNodes) {
|
|
3376
|
+
collectFocusableElements(node);
|
|
3377
|
+
}
|
|
3378
|
+
} else {
|
|
3379
|
+
// Process light DOM children in order
|
|
3380
|
+
if (root.children) {
|
|
3381
|
+
Array.from(root.children).forEach(child => {
|
|
3382
|
+
collectFocusableElements(child);
|
|
3383
|
+
});
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
}
|
|
3387
|
+
};
|
|
3388
|
+
|
|
3389
|
+
// Start the traversal from the container
|
|
3390
|
+
collectFocusableElements(container);
|
|
3391
|
+
|
|
3392
|
+
// Remove duplicates that might have been collected through different paths
|
|
3393
|
+
// while preserving order
|
|
3394
|
+
const uniqueElements = [];
|
|
3395
|
+
const seen = new Set();
|
|
3396
|
+
|
|
3397
|
+
for (const element of orderedFocusableElements) {
|
|
3398
|
+
if (!seen.has(element)) {
|
|
3399
|
+
seen.add(element);
|
|
3400
|
+
uniqueElements.push(element);
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
|
|
3404
|
+
return uniqueElements;
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3407
|
+
/**
|
|
3408
|
+
* FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
|
|
3409
|
+
* It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
|
|
3410
|
+
*/
|
|
3411
|
+
class FocusTrap {
|
|
3412
|
+
/**
|
|
3413
|
+
* Creates a new FocusTrap instance for the given container element.
|
|
3414
|
+
* Initializes event listeners and prepares the container for focus management.
|
|
3415
|
+
*
|
|
3416
|
+
* @param {HTMLElement} container The DOM element to trap focus within.
|
|
3417
|
+
* @throws {Error} If the provided container is not a valid HTMLElement.
|
|
3418
|
+
*/
|
|
3419
|
+
constructor(container) {
|
|
3420
|
+
if (!container || !(container instanceof HTMLElement)) {
|
|
3421
|
+
throw new Error("FocusTrap requires a valid HTMLElement.");
|
|
3422
|
+
}
|
|
3423
|
+
|
|
3424
|
+
this.container = container;
|
|
3425
|
+
this.tabDirection = 'forward'; // or 'backward'
|
|
3426
|
+
|
|
3427
|
+
this._init();
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
/**
|
|
3431
|
+
* Initializes the focus trap by setting up event listeners and attributes on the container.
|
|
3432
|
+
* Prepares the container for focus management, including support for shadow DOM and inert attributes.
|
|
3433
|
+
*
|
|
3434
|
+
* @private
|
|
3435
|
+
*/
|
|
3436
|
+
_init() {
|
|
3437
|
+
|
|
3438
|
+
// Add inert attribute to prevent focusing programmatically as well (if supported)
|
|
3439
|
+
if ('inert' in HTMLElement.prototype) {
|
|
3440
|
+
this.container.inert = false; // Ensure the container isn't inert
|
|
3441
|
+
this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
|
|
3442
|
+
}
|
|
3443
|
+
|
|
3444
|
+
// Track tab direction
|
|
3445
|
+
this.container.addEventListener('keydown', this._onKeydown);
|
|
3446
|
+
}
|
|
3447
|
+
|
|
3448
|
+
/**
|
|
3449
|
+
* Handles keydown events to manage tab navigation within the container.
|
|
3450
|
+
* Ensures that focus wraps around when reaching the first or last focusable element.
|
|
3451
|
+
*
|
|
3452
|
+
* @param {KeyboardEvent} e The keyboard event triggered by user interaction.
|
|
3453
|
+
* @private
|
|
3454
|
+
*/
|
|
3455
|
+
_onKeydown = (e) => {
|
|
3456
|
+
|
|
3457
|
+
if (e.key === 'Tab') {
|
|
3458
|
+
|
|
3459
|
+
// Set the tab direction based on the key pressed
|
|
3460
|
+
this.tabDirection = e.shiftKey ? 'backward' : 'forward';
|
|
3461
|
+
|
|
3462
|
+
// Get the active element(s) in the document and shadow root
|
|
3463
|
+
// This will include the active element in the shadow DOM if it exists
|
|
3464
|
+
// Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
|
|
3465
|
+
let activeElement = document.activeElement;
|
|
3466
|
+
const actives = [activeElement];
|
|
3467
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
3468
|
+
actives.push(activeElement.shadowRoot.activeElement);
|
|
3469
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
3470
|
+
}
|
|
3471
|
+
|
|
3472
|
+
// Update the focusable elements
|
|
3473
|
+
const focusables = this._getFocusableElements();
|
|
3474
|
+
|
|
3475
|
+
// If we're at either end of the focusable elements, wrap around to the other end
|
|
3476
|
+
const focusIndex =
|
|
3477
|
+
(actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
|
|
3478
|
+
? focusables.length - 1
|
|
3479
|
+
: actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
|
|
3480
|
+
? 0
|
|
3481
|
+
: null;
|
|
3482
|
+
|
|
3483
|
+
if (focusIndex !== null) {
|
|
3484
|
+
focusables[focusIndex].focus();
|
|
3485
|
+
e.preventDefault(); // Prevent default tab behavior
|
|
3486
|
+
e.stopPropagation(); // Stop the event from bubbling up
|
|
3487
|
+
}
|
|
3488
|
+
}
|
|
3489
|
+
};
|
|
3490
|
+
|
|
3491
|
+
/**
|
|
3492
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
3493
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
3494
|
+
*
|
|
3495
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
3496
|
+
* @private
|
|
3497
|
+
*/
|
|
3498
|
+
_getFocusableElements() {
|
|
3499
|
+
// Use the imported utility function to get focusable elements
|
|
3500
|
+
const elements = getFocusableElements(this.container);
|
|
3501
|
+
|
|
3502
|
+
// Filter out any elements with the 'focus-bookend' class
|
|
3503
|
+
return elements;
|
|
3504
|
+
}
|
|
3505
|
+
|
|
3506
|
+
/**
|
|
3507
|
+
* Moves focus to the first focusable element within the container.
|
|
3508
|
+
* Useful for setting initial focus when activating the focus trap.
|
|
3509
|
+
*/
|
|
3510
|
+
focusFirstElement() {
|
|
3511
|
+
const focusables = this._getFocusableElements();
|
|
3512
|
+
if (focusables.length) focusables[0].focus();
|
|
3513
|
+
}
|
|
3514
|
+
|
|
3515
|
+
/**
|
|
3516
|
+
* Moves focus to the last focusable element within the container.
|
|
3517
|
+
* Useful for setting focus when deactivating or cycling focus in reverse.
|
|
3518
|
+
*/
|
|
3519
|
+
focusLastElement() {
|
|
3520
|
+
const focusables = this._getFocusableElements();
|
|
3521
|
+
if (focusables.length) focusables[focusables.length - 1].focus();
|
|
3522
|
+
}
|
|
3523
|
+
|
|
3524
|
+
/**
|
|
3525
|
+
* Removes event listeners and attributes added by the focus trap.
|
|
3526
|
+
* Call this method to clean up when the focus trap is no longer needed.
|
|
3527
|
+
*/
|
|
3528
|
+
disconnect() {
|
|
3529
|
+
|
|
3530
|
+
if (this.container.hasAttribute('data-focus-trap-container')) {
|
|
3531
|
+
this.container.removeAttribute('data-focus-trap-container');
|
|
3532
|
+
}
|
|
3533
|
+
|
|
3534
|
+
this.container.removeEventListener('keydown', this._onKeydown);
|
|
3535
|
+
}
|
|
3536
|
+
}
|
|
3537
|
+
|
|
3153
3538
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3154
3539
|
// See LICENSE in the project root for license information.
|
|
3155
3540
|
|
|
@@ -3340,50 +3725,120 @@ let BaseIcon$2 = class BaseIcon extends AuroElement$1$1 {
|
|
|
3340
3725
|
}
|
|
3341
3726
|
};
|
|
3342
3727
|
|
|
3343
|
-
var tokensCss$2$
|
|
3728
|
+
var tokensCss$2$2 = i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color:#02426D;--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}`;
|
|
3344
3729
|
|
|
3345
|
-
var colorCss$3$
|
|
3730
|
+
var colorCss$3$2 = i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
3346
3731
|
|
|
3347
|
-
// Copyright (c)
|
|
3732
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3348
3733
|
// See LICENSE in the project root for license information.
|
|
3349
3734
|
|
|
3735
|
+
// ---------------------------------------------------------------------
|
|
3350
3736
|
|
|
3351
|
-
|
|
3352
|
-
constructor() {
|
|
3353
|
-
super();
|
|
3737
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
3354
3738
|
|
|
3355
|
-
|
|
3356
|
-
|
|
3739
|
+
let AuroLibraryRuntimeUtils$1$2 = class AuroLibraryRuntimeUtils {
|
|
3740
|
+
|
|
3741
|
+
/* eslint-disable jsdoc/require-param */
|
|
3742
|
+
|
|
3743
|
+
/**
|
|
3744
|
+
* This will register a new custom element with the browser.
|
|
3745
|
+
* @param {String} name - The name of the custom element.
|
|
3746
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
3747
|
+
* @returns {void}
|
|
3748
|
+
*/
|
|
3749
|
+
registerComponent(name, componentClass) {
|
|
3750
|
+
if (!customElements.get(name)) {
|
|
3751
|
+
customElements.define(name, class extends componentClass {});
|
|
3752
|
+
}
|
|
3357
3753
|
}
|
|
3358
3754
|
|
|
3359
3755
|
/**
|
|
3360
|
-
*
|
|
3361
|
-
* @private
|
|
3756
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
3362
3757
|
* @returns {void}
|
|
3363
3758
|
*/
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3759
|
+
closestElement(
|
|
3760
|
+
selector, // selector like in .closest()
|
|
3761
|
+
base = this, // extra functionality to skip a parent
|
|
3762
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
3763
|
+
!el || el === document || el === window
|
|
3764
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
3765
|
+
: found
|
|
3766
|
+
? found // found a selector INside this element
|
|
3767
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
3768
|
+
) {
|
|
3769
|
+
return __Closest(base);
|
|
3367
3770
|
}
|
|
3771
|
+
/* eslint-enable jsdoc/require-param */
|
|
3368
3772
|
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3773
|
+
/**
|
|
3774
|
+
* 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.
|
|
3775
|
+
* @param {Object} elem - The element to check.
|
|
3776
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
3777
|
+
* @returns {void}
|
|
3778
|
+
*/
|
|
3779
|
+
handleComponentTagRename(elem, tagName) {
|
|
3780
|
+
const tag = tagName.toLowerCase();
|
|
3781
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
3373
3782
|
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
type: String,
|
|
3379
|
-
reflect: true
|
|
3380
|
-
},
|
|
3783
|
+
if (elemTag !== tag) {
|
|
3784
|
+
elem.setAttribute(tag, true);
|
|
3785
|
+
}
|
|
3786
|
+
}
|
|
3381
3787
|
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3788
|
+
/**
|
|
3789
|
+
* Validates if an element is a specific Auro component.
|
|
3790
|
+
* @param {Object} elem - The element to validate.
|
|
3791
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
3792
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
3793
|
+
*/
|
|
3794
|
+
elementMatch(elem, tagName) {
|
|
3795
|
+
const tag = tagName.toLowerCase();
|
|
3796
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
3797
|
+
|
|
3798
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
3799
|
+
}
|
|
3800
|
+
};
|
|
3801
|
+
|
|
3802
|
+
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
3803
|
+
// See LICENSE in the project root for license information.
|
|
3804
|
+
|
|
3805
|
+
|
|
3806
|
+
let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
3807
|
+
constructor() {
|
|
3808
|
+
super();
|
|
3809
|
+
|
|
3810
|
+
this.variant = undefined;
|
|
3811
|
+
this.privateDefaults();
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3814
|
+
/**
|
|
3815
|
+
* Internal Defaults.
|
|
3816
|
+
* @private
|
|
3817
|
+
* @returns {void}
|
|
3818
|
+
*/
|
|
3819
|
+
privateDefaults() {
|
|
3820
|
+
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
3821
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$1$2();
|
|
3822
|
+
}
|
|
3823
|
+
|
|
3824
|
+
// function to define props used within the scope of this component
|
|
3825
|
+
static get properties() {
|
|
3826
|
+
return {
|
|
3827
|
+
...super.properties,
|
|
3828
|
+
|
|
3829
|
+
/**
|
|
3830
|
+
* Set aria-hidden value. Default is `true`. Option is `false`.
|
|
3831
|
+
*/
|
|
3832
|
+
ariaHidden: {
|
|
3833
|
+
type: String,
|
|
3834
|
+
reflect: true
|
|
3835
|
+
},
|
|
3836
|
+
|
|
3837
|
+
/**
|
|
3838
|
+
* The category of the icon you are looking for. See https://auro.alaskaair.com/icons/usage.
|
|
3839
|
+
*/
|
|
3840
|
+
category: {
|
|
3841
|
+
type: String,
|
|
3387
3842
|
reflect: true
|
|
3388
3843
|
},
|
|
3389
3844
|
|
|
@@ -3430,9 +3885,9 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3430
3885
|
static get styles() {
|
|
3431
3886
|
return [
|
|
3432
3887
|
super.styles,
|
|
3433
|
-
i$5`${tokensCss$2$
|
|
3888
|
+
i$5`${tokensCss$2$2}`,
|
|
3434
3889
|
i$5`${styleCss$2$2}`,
|
|
3435
|
-
i$5`${colorCss$3$
|
|
3890
|
+
i$5`${colorCss$3$2}`
|
|
3436
3891
|
];
|
|
3437
3892
|
}
|
|
3438
3893
|
|
|
@@ -3445,7 +3900,7 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3445
3900
|
*
|
|
3446
3901
|
*/
|
|
3447
3902
|
static register(name = "auro-icon") {
|
|
3448
|
-
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroIcon);
|
|
3903
|
+
AuroLibraryRuntimeUtils$1$2.prototype.registerComponent(name, AuroIcon);
|
|
3449
3904
|
}
|
|
3450
3905
|
|
|
3451
3906
|
connectedCallback() {
|
|
@@ -3466,8 +3921,12 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3466
3921
|
async firstUpdated() {
|
|
3467
3922
|
await super.firstUpdated();
|
|
3468
3923
|
|
|
3469
|
-
|
|
3470
|
-
|
|
3924
|
+
/**
|
|
3925
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
3926
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
3927
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
3928
|
+
*/
|
|
3929
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
3471
3930
|
const svgDesc = this.svg.querySelector('desc');
|
|
3472
3931
|
|
|
3473
3932
|
if (svgDesc) {
|
|
@@ -3513,17 +3972,16 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3513
3972
|
|
|
3514
3973
|
var iconVersion$2 = '6.1.2';
|
|
3515
3974
|
|
|
3516
|
-
var styleCss$1$2 = i$5`:host{position:
|
|
3975
|
+
var styleCss$1$2 = i$5`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}`;
|
|
3517
3976
|
|
|
3518
|
-
var colorCss$2$
|
|
3977
|
+
var colorCss$2$2 = i$5`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
3519
3978
|
|
|
3520
|
-
var tokensCss$1$
|
|
3979
|
+
var tokensCss$1$2 = i$5`:host(:not([ondark])){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-dropdown-trigger-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db);--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}`;
|
|
3521
3980
|
|
|
3522
3981
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
3523
3982
|
// See LICENSE in the project root for license information.
|
|
3524
3983
|
|
|
3525
3984
|
|
|
3526
|
-
|
|
3527
3985
|
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
3528
3986
|
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
3529
3987
|
'xl',
|
|
@@ -3539,7 +3997,7 @@ const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
|
3539
3997
|
*/
|
|
3540
3998
|
|
|
3541
3999
|
class AuroDropdownBib extends i$2 {
|
|
3542
|
-
|
|
4000
|
+
// not extending AuroElement because Bib needs only `shape` prop
|
|
3543
4001
|
constructor() {
|
|
3544
4002
|
super();
|
|
3545
4003
|
|
|
@@ -3548,14 +4006,17 @@ class AuroDropdownBib extends i$2 {
|
|
|
3548
4006
|
*/
|
|
3549
4007
|
this._mobileBreakpointValue = undefined;
|
|
3550
4008
|
|
|
3551
|
-
AuroLibraryRuntimeUtils$1.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
4009
|
+
AuroLibraryRuntimeUtils$2$1.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
4010
|
+
|
|
4011
|
+
this.shape = "rounded";
|
|
4012
|
+
this.matchWidth = false;
|
|
3552
4013
|
}
|
|
3553
4014
|
|
|
3554
4015
|
static get styles() {
|
|
3555
4016
|
return [
|
|
3556
4017
|
styleCss$1$2,
|
|
3557
|
-
colorCss$2$
|
|
3558
|
-
tokensCss$1$
|
|
4018
|
+
colorCss$2$2,
|
|
4019
|
+
tokensCss$1$2
|
|
3559
4020
|
];
|
|
3560
4021
|
}
|
|
3561
4022
|
|
|
@@ -3586,6 +4047,15 @@ class AuroDropdownBib extends i$2 {
|
|
|
3586
4047
|
reflect: true
|
|
3587
4048
|
},
|
|
3588
4049
|
|
|
4050
|
+
/**
|
|
4051
|
+
* If declared, the bib width will match the trigger width.
|
|
4052
|
+
* @private
|
|
4053
|
+
*/
|
|
4054
|
+
matchWidth: {
|
|
4055
|
+
type: Boolean,
|
|
4056
|
+
reflect: true
|
|
4057
|
+
},
|
|
4058
|
+
|
|
3589
4059
|
/**
|
|
3590
4060
|
* If declared, will apply border-radius to the bib.
|
|
3591
4061
|
*/
|
|
@@ -3593,6 +4063,18 @@ class AuroDropdownBib extends i$2 {
|
|
|
3593
4063
|
type: Boolean,
|
|
3594
4064
|
reflect: true
|
|
3595
4065
|
},
|
|
4066
|
+
|
|
4067
|
+
/**
|
|
4068
|
+
* A reference to the associated bib template element.
|
|
4069
|
+
*/
|
|
4070
|
+
bibTemplate: {
|
|
4071
|
+
type: Object
|
|
4072
|
+
},
|
|
4073
|
+
|
|
4074
|
+
shape: {
|
|
4075
|
+
type: String,
|
|
4076
|
+
reflect: true
|
|
4077
|
+
}
|
|
3596
4078
|
};
|
|
3597
4079
|
}
|
|
3598
4080
|
|
|
@@ -3625,13 +4107,62 @@ class AuroDropdownBib extends i$2 {
|
|
|
3625
4107
|
}
|
|
3626
4108
|
}
|
|
3627
4109
|
});
|
|
4110
|
+
|
|
4111
|
+
if (this.bibTemplate) {
|
|
4112
|
+
// If the bib template is found, set the fullscreen attribute
|
|
4113
|
+
if (this.isFullscreen) {
|
|
4114
|
+
this.bibTemplate.setAttribute('isFullscreen', 'true');
|
|
4115
|
+
} else {
|
|
4116
|
+
this.bibTemplate.removeAttribute('isFullscreen');
|
|
4117
|
+
}
|
|
4118
|
+
}
|
|
3628
4119
|
}
|
|
3629
4120
|
}
|
|
3630
4121
|
|
|
4122
|
+
connectedCallback() {
|
|
4123
|
+
super.connectedCallback();
|
|
4124
|
+
|
|
4125
|
+
// Listen for the auro-bibtemplate-connected event to set the fullscreen attribute
|
|
4126
|
+
this.addEventListener('auro-bibtemplate-connected', (event) => {
|
|
4127
|
+
const bibTemplate = event.detail.element;
|
|
4128
|
+
this.bibTemplate = bibTemplate;
|
|
4129
|
+
|
|
4130
|
+
if (bibTemplate) {
|
|
4131
|
+
// If the bib template is found, set the fullscreen attribute
|
|
4132
|
+
if (this.isFullscreen) {
|
|
4133
|
+
bibTemplate.setAttribute('isFullscreen', 'true');
|
|
4134
|
+
} else {
|
|
4135
|
+
bibTemplate.removeAttribute('isFullscreen');
|
|
4136
|
+
}
|
|
4137
|
+
}
|
|
4138
|
+
});
|
|
4139
|
+
}
|
|
4140
|
+
|
|
4141
|
+
firstUpdated(changedProperties) {
|
|
4142
|
+
super.firstUpdated(changedProperties);
|
|
4143
|
+
|
|
4144
|
+
// Dispatch a custom event when the component is connected
|
|
4145
|
+
this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
|
|
4146
|
+
bubbles: true,
|
|
4147
|
+
composed: true,
|
|
4148
|
+
detail: {
|
|
4149
|
+
element: this
|
|
4150
|
+
}
|
|
4151
|
+
}));
|
|
4152
|
+
}
|
|
4153
|
+
|
|
3631
4154
|
// function that renders the HTML and CSS into the scope of the component
|
|
3632
4155
|
render() {
|
|
4156
|
+
const classes = {
|
|
4157
|
+
container: true
|
|
4158
|
+
};
|
|
4159
|
+
|
|
4160
|
+
// Since this class does not inherit from AuroElement, we apply the shape-related class within the `render` function,
|
|
4161
|
+
// mimicking the class naming convention used in AuroElement.resetShapeClasses.
|
|
4162
|
+
classes[`shape-${this.shape}`] = true;
|
|
4163
|
+
|
|
3633
4164
|
return u`
|
|
3634
|
-
<div class="
|
|
4165
|
+
<div class="${e(classes)}" part="bibContainer">
|
|
3635
4166
|
<slot></slot>
|
|
3636
4167
|
</div>
|
|
3637
4168
|
`;
|
|
@@ -3640,23 +4171,23 @@ class AuroDropdownBib extends i$2 {
|
|
|
3640
4171
|
|
|
3641
4172
|
var dropdownVersion$1 = '3.0.0';
|
|
3642
4173
|
|
|
3643
|
-
var shapeSizeCss = i$5`.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:
|
|
4174
|
+
var shapeSizeCss = i$5`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:58px;max-height:58px;border-style:solid;border-width:1px;border-radius:var(--ds-border-radius, 0.375rem)}.shape-classic-xl.simple,.shape-classic-lg.simple,.shape-classic-md.simple,.shape-classic-sm.simple,.shape-classic-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}`;
|
|
3644
4175
|
|
|
3645
|
-
var colorCss$1$2 = i$5`:host .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus,:host(:not([ondark])) .wrapper:
|
|
4176
|
+
var colorCss$1$2 = i$5`: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)}`;
|
|
3646
4177
|
|
|
3647
|
-
var classicColorCss = i$5
|
|
4178
|
+
var classicColorCss = i$5``;
|
|
3648
4179
|
|
|
3649
|
-
var classicLayoutCss = i$5`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) .label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .
|
|
4180
|
+
var classicLayoutCss = i$5`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) .label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .wrapper{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}@media(hover: hover){:host([layout*=classic]) .wrapper:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([layout*=classic]:not([simple])) .triggerContentWrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([layout*=classic][matchwidth]) #bibSizer{width:100%}:host([layout*=classic][disabled]){pointer-events:none}`;
|
|
3650
4181
|
|
|
3651
|
-
var styleEmphasizedCss = i$5`:host{display:block}.wrapper{display:flex;flex
|
|
4182
|
+
var styleEmphasizedCss = i$5`:host{display:block}.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([layout*=emphasized][shape*=pill]:not([layout*=right])) .leftIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left])) .rightIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left]):not([layout*=right])) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
3652
4183
|
|
|
3653
|
-
var styleSnowflakeCss = i$5`:host{display:block}.wrapper{display:flex;flex
|
|
4184
|
+
var styleSnowflakeCss = i$5`:host{display:block}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([layout*=snowflake]) .leftIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}.layout-snowflake .chevron,.layout-snowflake-left .chevron,.layout-snowflake-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
3654
4185
|
|
|
3655
|
-
var colorCss$
|
|
4186
|
+
var colorCss$5 = i$5`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
3656
4187
|
|
|
3657
|
-
var styleCss$
|
|
4188
|
+
var styleCss$6 = i$5`.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}`;
|
|
3658
4189
|
|
|
3659
|
-
var tokensCss$
|
|
4190
|
+
var tokensCss$4 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
3660
4191
|
|
|
3661
4192
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3662
4193
|
// See LICENSE in the project root for license information.
|
|
@@ -3665,7 +4196,7 @@ var tokensCss$3 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texti
|
|
|
3665
4196
|
|
|
3666
4197
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
3667
4198
|
|
|
3668
|
-
let AuroLibraryRuntimeUtils$
|
|
4199
|
+
let AuroLibraryRuntimeUtils$5 = class AuroLibraryRuntimeUtils {
|
|
3669
4200
|
|
|
3670
4201
|
/* eslint-disable jsdoc/require-param */
|
|
3671
4202
|
|
|
@@ -3737,7 +4268,7 @@ let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
|
3737
4268
|
*
|
|
3738
4269
|
* @attr { Boolean } large - If declared, make font-size to 1rem(16px).
|
|
3739
4270
|
*/
|
|
3740
|
-
class AuroHelpText extends i$2 {
|
|
4271
|
+
let AuroHelpText$1 = class AuroHelpText extends i$2 {
|
|
3741
4272
|
|
|
3742
4273
|
constructor() {
|
|
3743
4274
|
super();
|
|
@@ -3746,14 +4277,14 @@ class AuroHelpText extends i$2 {
|
|
|
3746
4277
|
this.onDark = false;
|
|
3747
4278
|
this.hasTextContent = false;
|
|
3748
4279
|
|
|
3749
|
-
AuroLibraryRuntimeUtils$
|
|
4280
|
+
AuroLibraryRuntimeUtils$5.prototype.handleComponentTagRename(this, 'auro-helptext');
|
|
3750
4281
|
}
|
|
3751
4282
|
|
|
3752
4283
|
static get styles() {
|
|
3753
4284
|
return [
|
|
3754
|
-
colorCss$
|
|
3755
|
-
styleCss$
|
|
3756
|
-
tokensCss$
|
|
4285
|
+
colorCss$5,
|
|
4286
|
+
styleCss$6,
|
|
4287
|
+
tokensCss$4
|
|
3757
4288
|
];
|
|
3758
4289
|
}
|
|
3759
4290
|
|
|
@@ -3802,7 +4333,7 @@ class AuroHelpText extends i$2 {
|
|
|
3802
4333
|
*
|
|
3803
4334
|
*/
|
|
3804
4335
|
static register(name = "auro-helptext") {
|
|
3805
|
-
AuroLibraryRuntimeUtils$
|
|
4336
|
+
AuroLibraryRuntimeUtils$5.prototype.registerComponent(name, AuroHelpText);
|
|
3806
4337
|
}
|
|
3807
4338
|
|
|
3808
4339
|
updated() {
|
|
@@ -3856,11 +4387,11 @@ class AuroHelpText extends i$2 {
|
|
|
3856
4387
|
</div>
|
|
3857
4388
|
`;
|
|
3858
4389
|
}
|
|
3859
|
-
}
|
|
4390
|
+
};
|
|
3860
4391
|
|
|
3861
|
-
var helpTextVersion = '1.0.0';
|
|
4392
|
+
var helpTextVersion$1 = '1.0.0';
|
|
3862
4393
|
|
|
3863
|
-
let AuroElement$
|
|
4394
|
+
let AuroElement$3 = class AuroElement extends i$2 {
|
|
3864
4395
|
static get properties() {
|
|
3865
4396
|
return {
|
|
3866
4397
|
|
|
@@ -3895,18 +4426,21 @@ let AuroElement$2 = class AuroElement extends i$2 {
|
|
|
3895
4426
|
}
|
|
3896
4427
|
|
|
3897
4428
|
resetShapeClasses() {
|
|
3898
|
-
|
|
3899
|
-
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
4429
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
3900
4430
|
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
4431
|
+
if (wrapper) {
|
|
4432
|
+
wrapper.classList.forEach((className) => {
|
|
4433
|
+
if (className.startsWith('shape-')) {
|
|
4434
|
+
wrapper.classList.remove(className);
|
|
4435
|
+
}
|
|
4436
|
+
});
|
|
3907
4437
|
|
|
3908
|
-
|
|
3909
|
-
|
|
4438
|
+
}
|
|
4439
|
+
|
|
4440
|
+
if (this.shape && this.size) {
|
|
4441
|
+
wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
4442
|
+
} else {
|
|
4443
|
+
wrapper.classList.add('shape-none');
|
|
3910
4444
|
}
|
|
3911
4445
|
}
|
|
3912
4446
|
|
|
@@ -3969,7 +4503,7 @@ let AuroElement$2 = class AuroElement extends i$2 {
|
|
|
3969
4503
|
* @event auroDropdown-toggled - Notifies that the visibility of the dropdown bib has changed.
|
|
3970
4504
|
* @event auroDropdown-idAdded - Notifies consumers that the unique ID for the dropdown bib has been generated.
|
|
3971
4505
|
*/
|
|
3972
|
-
class AuroDropdown extends AuroElement$
|
|
4506
|
+
class AuroDropdown extends AuroElement$3 {
|
|
3973
4507
|
constructor() {
|
|
3974
4508
|
super();
|
|
3975
4509
|
|
|
@@ -3978,20 +4512,16 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
3978
4512
|
this.matchWidth = false;
|
|
3979
4513
|
this.noHideOnThisFocusLoss = false;
|
|
3980
4514
|
|
|
3981
|
-
this.errorMessage = ''; // TODO
|
|
4515
|
+
this.errorMessage = ''; // TODO - check with Doug if there is still more to do here
|
|
3982
4516
|
|
|
3983
4517
|
// Layout Config
|
|
3984
4518
|
this.layout = 'classic';
|
|
3985
|
-
this.shape = '
|
|
4519
|
+
this.shape = 'classic';
|
|
3986
4520
|
this.size = 'xl';
|
|
3987
4521
|
|
|
3988
|
-
this.
|
|
3989
|
-
}
|
|
4522
|
+
this.parentBorder = false;
|
|
3990
4523
|
|
|
3991
|
-
|
|
3992
|
-
return {
|
|
3993
|
-
// 'withValue': this.value && this.value.length > 0
|
|
3994
|
-
};
|
|
4524
|
+
this.privateDefaults();
|
|
3995
4525
|
}
|
|
3996
4526
|
|
|
3997
4527
|
get commonWrapperClasses() {
|
|
@@ -3999,7 +4529,8 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
3999
4529
|
'trigger': true,
|
|
4000
4530
|
'wrapper': true,
|
|
4001
4531
|
'hasFocus': this.hasFocus,
|
|
4002
|
-
'simple': this.simple
|
|
4532
|
+
'simple': this.simple,
|
|
4533
|
+
'parentBorder': this.parentBorder
|
|
4003
4534
|
};
|
|
4004
4535
|
}
|
|
4005
4536
|
|
|
@@ -4010,6 +4541,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4010
4541
|
privateDefaults() {
|
|
4011
4542
|
this.chevron = false;
|
|
4012
4543
|
this.disabled = false;
|
|
4544
|
+
this.disableFocusTrap = false;
|
|
4013
4545
|
this.error = false;
|
|
4014
4546
|
this.inset = false;
|
|
4015
4547
|
this.rounded = false;
|
|
@@ -4051,7 +4583,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4051
4583
|
/**
|
|
4052
4584
|
* @private
|
|
4053
4585
|
*/
|
|
4054
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
4586
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2$1();
|
|
4055
4587
|
|
|
4056
4588
|
/**
|
|
4057
4589
|
* @private
|
|
@@ -4076,7 +4608,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4076
4608
|
/**
|
|
4077
4609
|
* @private
|
|
4078
4610
|
*/
|
|
4079
|
-
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion, AuroHelpText);
|
|
4611
|
+
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion$1, AuroHelpText$1);
|
|
4080
4612
|
|
|
4081
4613
|
/**
|
|
4082
4614
|
* @private
|
|
@@ -4112,6 +4644,18 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4112
4644
|
this.floater.showBib();
|
|
4113
4645
|
}
|
|
4114
4646
|
|
|
4647
|
+
/**
|
|
4648
|
+
* When bib is open, focus on the first element inside of bib.
|
|
4649
|
+
* If not, trigger element will get focus.
|
|
4650
|
+
*/
|
|
4651
|
+
focus() {
|
|
4652
|
+
if (this.isPopoverVisible && this.focusTrap) {
|
|
4653
|
+
this.focusTrap.focusFirstElement();
|
|
4654
|
+
} else {
|
|
4655
|
+
this.trigger.focus();
|
|
4656
|
+
}
|
|
4657
|
+
}
|
|
4658
|
+
|
|
4115
4659
|
// function to define props used within the scope of this component
|
|
4116
4660
|
static get properties() {
|
|
4117
4661
|
return {
|
|
@@ -4158,6 +4702,14 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4158
4702
|
reflect: true
|
|
4159
4703
|
},
|
|
4160
4704
|
|
|
4705
|
+
/**
|
|
4706
|
+
* If declare, the focus trap inside of bib will be turned off.
|
|
4707
|
+
*/
|
|
4708
|
+
disableFocusTrap: {
|
|
4709
|
+
type: Boolean,
|
|
4710
|
+
reflect: true
|
|
4711
|
+
},
|
|
4712
|
+
|
|
4161
4713
|
/**
|
|
4162
4714
|
* @private
|
|
4163
4715
|
*/
|
|
@@ -4266,6 +4818,15 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4266
4818
|
reflect: true
|
|
4267
4819
|
},
|
|
4268
4820
|
|
|
4821
|
+
/**
|
|
4822
|
+
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
4823
|
+
* @private
|
|
4824
|
+
*/
|
|
4825
|
+
parentBorder: {
|
|
4826
|
+
type: Boolean,
|
|
4827
|
+
reflect: true
|
|
4828
|
+
},
|
|
4829
|
+
|
|
4269
4830
|
/**
|
|
4270
4831
|
* If declared, the popover and trigger will be set to the same width.
|
|
4271
4832
|
*/
|
|
@@ -4368,7 +4929,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4368
4929
|
static get styles() {
|
|
4369
4930
|
return [
|
|
4370
4931
|
colorCss$1$2,
|
|
4371
|
-
tokensCss$1$
|
|
4932
|
+
tokensCss$1$2,
|
|
4372
4933
|
|
|
4373
4934
|
// default layout
|
|
4374
4935
|
classicColorCss,
|
|
@@ -4393,7 +4954,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4393
4954
|
*
|
|
4394
4955
|
*/
|
|
4395
4956
|
static register(name = "auro-dropdown") {
|
|
4396
|
-
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroDropdown);
|
|
4957
|
+
AuroLibraryRuntimeUtils$2$1.prototype.registerComponent(name, AuroDropdown);
|
|
4397
4958
|
}
|
|
4398
4959
|
|
|
4399
4960
|
/**
|
|
@@ -4431,6 +4992,12 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4431
4992
|
this.handleTriggerContentSlotChange();
|
|
4432
4993
|
}
|
|
4433
4994
|
|
|
4995
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
4996
|
+
this.updateFocusTrap();
|
|
4997
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
4998
|
+
this.trigger.focus();
|
|
4999
|
+
}
|
|
5000
|
+
}
|
|
4434
5001
|
}
|
|
4435
5002
|
|
|
4436
5003
|
firstUpdated() {
|
|
@@ -4496,6 +5063,27 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4496
5063
|
this.hasFocus = true;
|
|
4497
5064
|
}
|
|
4498
5065
|
|
|
5066
|
+
/**
|
|
5067
|
+
* @private
|
|
5068
|
+
*/
|
|
5069
|
+
updateFocusTrap() {
|
|
5070
|
+
// If the dropdown is open, create a focus trap and focus the first element
|
|
5071
|
+
if (this.isPopoverVisible && !this.disableFocusTrap) {
|
|
5072
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
5073
|
+
this.focusTrap.focusFirstElement();
|
|
5074
|
+
return;
|
|
5075
|
+
}
|
|
5076
|
+
|
|
5077
|
+
// Guard Clause: Ensure there is a focus trap currently active before continuing
|
|
5078
|
+
if (!this.focusTrap) {
|
|
5079
|
+
return;
|
|
5080
|
+
}
|
|
5081
|
+
|
|
5082
|
+
// If the dropdown is not open, disconnect the focus trap if it exists
|
|
5083
|
+
this.focusTrap.disconnect();
|
|
5084
|
+
this.focusTrap = undefined;
|
|
5085
|
+
}
|
|
5086
|
+
|
|
4499
5087
|
/**
|
|
4500
5088
|
* Function to support @focusout event.
|
|
4501
5089
|
* @private
|
|
@@ -4656,14 +5244,13 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4656
5244
|
* @returns {void}
|
|
4657
5245
|
*/
|
|
4658
5246
|
handleTriggerContentSlotChange(event) {
|
|
4659
|
-
|
|
4660
5247
|
this.floater.handleTriggerTabIndex();
|
|
4661
5248
|
|
|
4662
5249
|
// Get the trigger
|
|
4663
5250
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
4664
5251
|
|
|
4665
5252
|
// Get the trigger slot
|
|
4666
|
-
const triggerSlot = this.shadowRoot.querySelector('.
|
|
5253
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContentWrapper slot');
|
|
4667
5254
|
|
|
4668
5255
|
// If there's a trigger slot
|
|
4669
5256
|
if (triggerSlot) {
|
|
@@ -4726,40 +5313,15 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4726
5313
|
*
|
|
4727
5314
|
* @private
|
|
4728
5315
|
* @method handleDefaultSlot
|
|
4729
|
-
* @param {Event} event - The event object representing the slot change.
|
|
4730
5316
|
* @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
|
|
4731
5317
|
*/
|
|
4732
|
-
handleDefaultSlot(
|
|
4733
|
-
[...event.target.assignedNodes()].forEach((node) => this.bibContent.append(node));
|
|
5318
|
+
handleDefaultSlot() {
|
|
4734
5319
|
|
|
4735
5320
|
if (this.onSlotChange) {
|
|
4736
5321
|
this.onSlotChange();
|
|
4737
5322
|
}
|
|
4738
5323
|
}
|
|
4739
5324
|
|
|
4740
|
-
/**
|
|
4741
|
-
* @private
|
|
4742
|
-
* @method handleLabelSlotChange
|
|
4743
|
-
* @param {event} event - The event object representing the slot change.
|
|
4744
|
-
* @description Handles the slot change event for the label slot.
|
|
4745
|
-
*/
|
|
4746
|
-
handleLabelSlotChange (event) {
|
|
4747
|
-
|
|
4748
|
-
// Get the nodes from the event
|
|
4749
|
-
const nodes = event.target.assignedNodes();
|
|
4750
|
-
|
|
4751
|
-
// Guard clause for no nodes
|
|
4752
|
-
if (!nodes) {
|
|
4753
|
-
return;
|
|
4754
|
-
}
|
|
4755
|
-
|
|
4756
|
-
// Convert the nodes to a measurable array so we can get the length
|
|
4757
|
-
const nodesArr = Array.from(nodes);
|
|
4758
|
-
|
|
4759
|
-
// If the nodes array has a length, the dropdown is labeled
|
|
4760
|
-
this.labeled = nodesArr.length > 0;
|
|
4761
|
-
}
|
|
4762
|
-
|
|
4763
5325
|
/**
|
|
4764
5326
|
* Returns HTML for the common portion of the layouts.
|
|
4765
5327
|
* @private
|
|
@@ -4774,24 +5336,20 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4774
5336
|
class="${e(this.commonWrapperClasses)}" part="wrapper"
|
|
4775
5337
|
tabindex="${this.tabIndex}"
|
|
4776
5338
|
role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
4777
|
-
aria-expanded="${o(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4778
|
-
aria-controls="${o(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
5339
|
+
aria-expanded="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
5340
|
+
aria-controls="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4779
5341
|
aria-labelledby="${o(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
4780
5342
|
@focusin="${this.handleFocusin}"
|
|
4781
5343
|
@blur="${this.handleFocusOut}">
|
|
4782
|
-
<div class="triggerContentWrapper">
|
|
4783
|
-
<
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
<div class="triggerContent">
|
|
4787
|
-
<slot
|
|
4788
|
-
name="trigger"
|
|
4789
|
-
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4790
|
-
</div>
|
|
5344
|
+
<div class="triggerContentWrapper" id="triggerLabel">
|
|
5345
|
+
<slot
|
|
5346
|
+
name="trigger"
|
|
5347
|
+
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4791
5348
|
</div>
|
|
4792
|
-
${this.chevron
|
|
5349
|
+
${this.chevron ? u`
|
|
4793
5350
|
<div
|
|
4794
5351
|
id="showStateIcon"
|
|
5352
|
+
class="chevron"
|
|
4795
5353
|
part="chevron">
|
|
4796
5354
|
<${this.iconTag}
|
|
4797
5355
|
category="interface"
|
|
@@ -4806,17 +5364,18 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4806
5364
|
<div class="${e(helpTextClasses)}">
|
|
4807
5365
|
<slot name="helpText"></slot>
|
|
4808
5366
|
</div>
|
|
4809
|
-
<div class="slotContent">
|
|
4810
|
-
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4811
|
-
</div>
|
|
4812
5367
|
<div id="bibSizer" part="size"></div>
|
|
4813
5368
|
<${this.dropdownBibTag}
|
|
4814
5369
|
id="bib"
|
|
5370
|
+
shape="${this.shape}"
|
|
4815
5371
|
?data-show="${this.isPopoverVisible}"
|
|
4816
5372
|
?isfullscreen="${this.isBibFullscreen}"
|
|
4817
5373
|
?common="${this.common}"
|
|
4818
5374
|
?rounded="${this.common || this.rounded}"
|
|
4819
5375
|
?inset="${this.common || this.inset}">
|
|
5376
|
+
<div class="slotContent">
|
|
5377
|
+
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5378
|
+
</div>
|
|
4820
5379
|
</${this.dropdownBibTag}>
|
|
4821
5380
|
</div>
|
|
4822
5381
|
`;
|
|
@@ -4828,67 +5387,14 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4828
5387
|
* @returns {html} - Returns HTML for the classic layout.
|
|
4829
5388
|
*/
|
|
4830
5389
|
renderLayoutClassic() {
|
|
5390
|
+
// TODO: check with Doug why this was never used?
|
|
4831
5391
|
const helpTextClasses = {
|
|
4832
|
-
'helpText': true
|
|
4833
|
-
'leftIndent': false,
|
|
4834
|
-
'rightIndent': false
|
|
5392
|
+
'helpText': true
|
|
4835
5393
|
};
|
|
4836
5394
|
|
|
4837
5395
|
return u`
|
|
4838
5396
|
${this.renderBasicHtml(helpTextClasses)}
|
|
4839
5397
|
`;
|
|
4840
|
-
// return html`
|
|
4841
|
-
// <div>
|
|
4842
|
-
// <div
|
|
4843
|
-
// id="trigger"
|
|
4844
|
-
// class="trigger"
|
|
4845
|
-
// part="trigger"
|
|
4846
|
-
// tabindex="${this.tabIndex}"
|
|
4847
|
-
// ?showBorder="${this.showTriggerBorders}"
|
|
4848
|
-
// role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
4849
|
-
// aria-expanded="${ifDefined(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4850
|
-
// aria-controls="${ifDefined(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4851
|
-
// aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
4852
|
-
// >
|
|
4853
|
-
// <div class="triggerContentWrapper">
|
|
4854
|
-
// <label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
4855
|
-
// <slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
4856
|
-
// </label>
|
|
4857
|
-
// <div class="triggerContent">
|
|
4858
|
-
// <slot
|
|
4859
|
-
// name="trigger"
|
|
4860
|
-
// @slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4861
|
-
// </div>
|
|
4862
|
-
// </div>
|
|
4863
|
-
// ${this.chevron || this.common ? html`
|
|
4864
|
-
// <div
|
|
4865
|
-
// id="showStateIcon"
|
|
4866
|
-
// part="chevron">
|
|
4867
|
-
// <${this.iconTag}
|
|
4868
|
-
// category="interface"
|
|
4869
|
-
// name="chevron-down"
|
|
4870
|
-
// ?onDark="${this.onDark}"
|
|
4871
|
-
// variant="${this.disabled ? 'disabled' : 'muted'}">
|
|
4872
|
-
// >
|
|
4873
|
-
// </${this.iconTag}>
|
|
4874
|
-
// </div>
|
|
4875
|
-
// ` : undefined }
|
|
4876
|
-
// </div>
|
|
4877
|
-
// <div class="slotContent">
|
|
4878
|
-
// <slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4879
|
-
// </div>
|
|
4880
|
-
// <div id="bibSizer" part="size"></div>
|
|
4881
|
-
// <${this.dropdownBibTag}
|
|
4882
|
-
// id="bib"
|
|
4883
|
-
// ?data-show="${this.isPopoverVisible}"
|
|
4884
|
-
// ?isfullscreen="${this.isBibFullscreen}"
|
|
4885
|
-
// ?common="${this.common}"
|
|
4886
|
-
// ?rounded="${this.common || this.rounded}"
|
|
4887
|
-
// ?inset="${this.common || this.inset}"
|
|
4888
|
-
// >
|
|
4889
|
-
// </${this.dropdownBibTag}>
|
|
4890
|
-
// </div>
|
|
4891
|
-
// `;
|
|
4892
5398
|
}
|
|
4893
5399
|
|
|
4894
5400
|
/**
|
|
@@ -4955,9 +5461,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4955
5461
|
|
|
4956
5462
|
var dropdownVersion = '3.0.0';
|
|
4957
5463
|
|
|
4958
|
-
var colorCss$
|
|
5464
|
+
var colorCss$3$1 = i$5`#headerContainer{box-shadow:var(--ds-auro-dropdownbib-header-boxshadow-color)}#footerContainer{background-color:var(--ds-auro-dropdownbib-footer-container-color)}`;
|
|
4959
5465
|
|
|
4960
|
-
var styleCss$
|
|
5466
|
+
var styleCss$4$1 = i$5`#bibTemplate{display:flex;overflow:hidden;height:100%;max-height:100%;flex-direction:column}#headerContainer{display:flex;flex-direction:column}#header{display:flex;width:100%;min-height:var(--ds-size-1000, 5rem);box-sizing:border-box;align-items:end;padding-top:var(--ds-size-400, 2rem);padding-right:var(--ds-size-700, 3.5rem);padding-left:var(--ds-size-200, 1rem);pointer-events:none}#subheader{width:100%}#subheader ::slotted([auro-input]){box-sizing:border-box;padding:0 var(--ds-size-200, 1rem)}#closeButton{position:absolute;top:var(--ds-size-400, 2rem);right:var(--ds-size-200, 1rem);border:none;background-color:transparent;cursor:pointer}#bodyContainer{position:relative;overflow:auto;flex:1 1 100%}:host([isfullscreen]) #bibTemplate{max-height:100dvh}:host([isfullscreen]) #bodyContainer{margin-top:var(--ds-size-100, 0.5rem)}#footerContainer{position:absolute;right:0;bottom:0;left:0;padding:var(--ds-size-200, 1rem)}`;
|
|
4961
5467
|
|
|
4962
5468
|
var tokenCss = i$5`:host{--ds-auro-dropdownbib-header-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-footer-container-color: var(--ds-basic-color-surface-default, #ffffff)}`;
|
|
4963
5469
|
|
|
@@ -4968,7 +5474,7 @@ var tokenCss = i$5`:host{--ds-auro-dropdownbib-header-boxshadow-color: var(--ds-
|
|
|
4968
5474
|
|
|
4969
5475
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
4970
5476
|
|
|
4971
|
-
class AuroLibraryRuntimeUtils {
|
|
5477
|
+
let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
|
|
4972
5478
|
|
|
4973
5479
|
/* eslint-disable jsdoc/require-param */
|
|
4974
5480
|
|
|
@@ -5029,7 +5535,7 @@ class AuroLibraryRuntimeUtils {
|
|
|
5029
5535
|
|
|
5030
5536
|
return elemTag === tag || elem.hasAttribute(tag);
|
|
5031
5537
|
}
|
|
5032
|
-
}
|
|
5538
|
+
};
|
|
5033
5539
|
|
|
5034
5540
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5035
5541
|
// See LICENSE in the project root for license information.
|
|
@@ -5071,85 +5577,1129 @@ class AuroDependencyVersioning {
|
|
|
5071
5577
|
}
|
|
5072
5578
|
}
|
|
5073
5579
|
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5580
|
+
/**
|
|
5581
|
+
* Private module-level WeakMap to hold MutationObservers for each host element.
|
|
5582
|
+
*/
|
|
5583
|
+
const _observers = new WeakMap();
|
|
5077
5584
|
|
|
5078
5585
|
/**
|
|
5079
|
-
*
|
|
5080
|
-
*
|
|
5081
|
-
*
|
|
5586
|
+
* Private module-level WeakMap to hold attribute matchers and targets for each host element.
|
|
5587
|
+
* Structure: {
|
|
5588
|
+
* host: {
|
|
5589
|
+
* matchers: Set<Function>,
|
|
5590
|
+
* targets: Map<HTMLElement, Map<Function, {removeOriginal: boolean, currentAttributes: Map<string, string>}>>
|
|
5591
|
+
* }
|
|
5592
|
+
* }
|
|
5082
5593
|
*/
|
|
5594
|
+
const _transportConfig = new WeakMap();
|
|
5083
5595
|
|
|
5084
|
-
|
|
5596
|
+
/**
|
|
5597
|
+
* Transfers all matching attributes from a host element to a target element and observes for future changes.
|
|
5598
|
+
*
|
|
5599
|
+
* @param {Object} params - The parameters for the function.
|
|
5600
|
+
* @param {HTMLElement} params.host - The host element from which attributes will be transported.
|
|
5601
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
5602
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove the attributes from the host element.
|
|
5603
|
+
* @param {boolean} [params.observe=true] - Whether to attach a MutationObserver to the host element.
|
|
5604
|
+
* @returns {Function} A function to detach the observer when no longer needed.
|
|
5605
|
+
* @throws {TypeError} If the host or target parameters are not instances of HTMLElement.
|
|
5606
|
+
*/
|
|
5607
|
+
const transportAttributes = ({ host, target, match, removeOriginal = true }) => {
|
|
5608
|
+
// Guard Clause: Ensure host is valid HTMLElement instance
|
|
5609
|
+
if (typeof host !== 'object' || !(host instanceof HTMLElement)) {
|
|
5610
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "host" parameter must be an instance of HTMLElement.');
|
|
5611
|
+
}
|
|
5085
5612
|
|
|
5086
|
-
//
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
hidden: { type: Boolean,
|
|
5090
|
-
reflect: true },
|
|
5091
|
-
hiddenVisually: { type: Boolean,
|
|
5092
|
-
reflect: true },
|
|
5093
|
-
hiddenAudible: { type: Boolean,
|
|
5094
|
-
reflect: true },
|
|
5095
|
-
};
|
|
5613
|
+
// Guard Clause: Ensure target is valid HTMLElement instance
|
|
5614
|
+
if (typeof target !== 'object' || !(target instanceof HTMLElement)) {
|
|
5615
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "target" parameter must be an instance of HTMLElement.');
|
|
5096
5616
|
}
|
|
5097
5617
|
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
if (value) {
|
|
5103
|
-
return 'true'
|
|
5104
|
-
}
|
|
5618
|
+
// Guard Clause: Ensure match is a function
|
|
5619
|
+
if (typeof match !== 'function') {
|
|
5620
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "match" parameter must be a function.');
|
|
5621
|
+
}
|
|
5105
5622
|
|
|
5106
|
-
|
|
5623
|
+
// Guard Clause: Ensure removeOriginal is a boolean
|
|
5624
|
+
if (typeof removeOriginal !== 'boolean') {
|
|
5625
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "removeOriginal" parameter must be a boolean.');
|
|
5107
5626
|
}
|
|
5627
|
+
|
|
5628
|
+
// Register this transport and get cleanup function
|
|
5629
|
+
return _registerTransport({
|
|
5630
|
+
host,
|
|
5631
|
+
target,
|
|
5632
|
+
matcher: match,
|
|
5633
|
+
removeOriginal
|
|
5634
|
+
});
|
|
5108
5635
|
};
|
|
5109
5636
|
|
|
5110
|
-
var error$1 = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"error__desc\" class=\"ico_squareLarge\" data-deprecated=\"true\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><desc id=\"error__desc\">Error alert indicator.</desc><path d=\"m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583\"/></svg>"};
|
|
5111
|
-
|
|
5112
|
-
/* eslint-disable no-underscore-dangle, jsdoc/no-undefined-types, jsdoc/require-param-description */
|
|
5113
|
-
|
|
5114
|
-
const _fetchMap$1 = new Map();
|
|
5115
|
-
|
|
5116
5637
|
/**
|
|
5117
|
-
*
|
|
5118
|
-
*
|
|
5119
|
-
* @
|
|
5120
|
-
* @param {
|
|
5121
|
-
* @
|
|
5638
|
+
* Registers a matcher and target for a host element and attaches an observer if needed.
|
|
5639
|
+
*
|
|
5640
|
+
* @param {Object} params - The parameters object.
|
|
5641
|
+
* @param {HTMLElement} params.host - The host element to observe.
|
|
5642
|
+
* @param {HTMLElement} params.target - The target element to receive attributes.
|
|
5643
|
+
* @param {Function} params.matcher - Function that determines which attributes to transport.
|
|
5644
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes.
|
|
5645
|
+
* @param {boolean} [params.observe=true] - Whether to observe for attribute changes.
|
|
5646
|
+
* @returns {Function} Function to detach the specific matcher and target pairing.
|
|
5647
|
+
* @private
|
|
5122
5648
|
*/
|
|
5649
|
+
const _registerTransport = ({ host, target, matcher, removeOriginal = true }) => {
|
|
5650
|
+
// Initialize config for this host if it doesn't exist
|
|
5651
|
+
if (!_transportConfig.has(host)) {
|
|
5652
|
+
_transportConfig.set(host, {
|
|
5653
|
+
matchers: new Set(),
|
|
5654
|
+
targets: new Map()
|
|
5655
|
+
});
|
|
5656
|
+
}
|
|
5657
|
+
|
|
5658
|
+
const config = _transportConfig.get(host);
|
|
5659
|
+
|
|
5660
|
+
// Add the matcher to the set of matchers for this host
|
|
5661
|
+
config.matchers.add(matcher);
|
|
5662
|
+
|
|
5663
|
+
// Initialize target entry if it doesn't exist
|
|
5664
|
+
if (!config.targets.has(target)) {
|
|
5665
|
+
config.targets.set(target, new Map());
|
|
5666
|
+
}
|
|
5667
|
+
|
|
5668
|
+
// Store the matcher with its removeOriginal setting for this target
|
|
5669
|
+
config.targets.get(target).set(matcher, {
|
|
5670
|
+
removeOriginal,
|
|
5671
|
+
currentAttributes: new Map()
|
|
5672
|
+
});
|
|
5673
|
+
|
|
5674
|
+
// Perform initial attribute transport
|
|
5675
|
+
_transportAttributes({ host, target, matcher, removeOriginal });
|
|
5676
|
+
|
|
5677
|
+
// Attach observer
|
|
5678
|
+
_attachObserver(host);
|
|
5679
|
+
|
|
5680
|
+
// Return cleanup function and utility functions
|
|
5681
|
+
return {
|
|
5682
|
+
cleanup: () => _cleanupTransport(host, target, matcher),
|
|
5683
|
+
getObservedAttributes: () => _getObservedAttributes(host, target, matcher),
|
|
5684
|
+
getObservedAttribute: (attr) => _getObservedAttribute(host, target, matcher, attr),
|
|
5685
|
+
}
|
|
5686
|
+
};
|
|
5123
5687
|
|
|
5124
5688
|
/**
|
|
5125
|
-
*
|
|
5126
|
-
*
|
|
5127
|
-
* @param {
|
|
5128
|
-
* @param {
|
|
5129
|
-
* @param {
|
|
5130
|
-
* @
|
|
5689
|
+
* Cleans up resources associated with a specific matcher and target for a host element.
|
|
5690
|
+
*
|
|
5691
|
+
* @param {HTMLElement} host - The host element
|
|
5692
|
+
* @param {HTMLElement} target - The target element
|
|
5693
|
+
* @param {Function} matcher - The matcher function
|
|
5694
|
+
* @private
|
|
5131
5695
|
*/
|
|
5132
|
-
const
|
|
5133
|
-
const
|
|
5134
|
-
if (!
|
|
5135
|
-
|
|
5696
|
+
const _cleanupTransport = (host, target, matcher) => {
|
|
5697
|
+
const config = _transportConfig.get(host);
|
|
5698
|
+
if (!config) return;
|
|
5699
|
+
|
|
5700
|
+
// Remove this matcher from this target
|
|
5701
|
+
const targetMatchers = config.targets.get(target);
|
|
5702
|
+
if (targetMatchers) {
|
|
5703
|
+
targetMatchers.delete(matcher);
|
|
5704
|
+
|
|
5705
|
+
// If this target has no more matchers, remove it
|
|
5706
|
+
if (targetMatchers.size === 0) {
|
|
5707
|
+
config.targets.delete(target);
|
|
5708
|
+
}
|
|
5709
|
+
}
|
|
5710
|
+
|
|
5711
|
+
// Check if this matcher is still used by any target
|
|
5712
|
+
let matcherStillUsed = false;
|
|
5713
|
+
for (const matcherMap of config.targets.values()) {
|
|
5714
|
+
if (matcherMap.has(matcher)) {
|
|
5715
|
+
matcherStillUsed = true;
|
|
5716
|
+
break;
|
|
5717
|
+
}
|
|
5718
|
+
}
|
|
5719
|
+
|
|
5720
|
+
// If not used anymore, remove from matchers set
|
|
5721
|
+
if (!matcherStillUsed) {
|
|
5722
|
+
config.matchers.delete(matcher);
|
|
5723
|
+
}
|
|
5724
|
+
|
|
5725
|
+
// If no more targets or matchers, detach observer
|
|
5726
|
+
if (config.targets.size === 0 || config.matchers.size === 0) {
|
|
5727
|
+
_detachObserver(host);
|
|
5136
5728
|
}
|
|
5137
|
-
return _fetchMap$1.get(uri);
|
|
5138
5729
|
};
|
|
5139
5730
|
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5731
|
+
/**
|
|
5732
|
+
* Generic function to transport attributes from a host element to a target element.
|
|
5733
|
+
*
|
|
5734
|
+
* @param {Object} params - The parameters object.
|
|
5735
|
+
* @param {HTMLElement} params.host - The host element from which to transport attributes.
|
|
5736
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
5737
|
+
* @param {Function} params.matcher - Function that takes an attribute name and returns true if it should be transported.
|
|
5738
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes from host.
|
|
5739
|
+
* @returns {void}
|
|
5740
|
+
* @private
|
|
5741
|
+
*/
|
|
5742
|
+
const _transportAttributes = ({ host, target, matcher, removeOriginal = true }) => {
|
|
5743
|
+
// Get a list of all matching attributes on the host element and their values
|
|
5744
|
+
const matchingAttributes = host.getAttributeNames()
|
|
5745
|
+
.filter(attr => matcher(attr))
|
|
5746
|
+
.reduce((acc, attr) => {
|
|
5747
|
+
acc[attr] = host.getAttribute(attr);
|
|
5748
|
+
return acc;
|
|
5749
|
+
}, {});
|
|
5750
|
+
|
|
5751
|
+
// Move matching attributes to the target element, removing them from the host if removeOriginal is true
|
|
5752
|
+
Object.entries(matchingAttributes).forEach(([key, value]) => {
|
|
5753
|
+
_setObservedAttribute(host, target, matcher, key, value);
|
|
5754
|
+
target.setAttribute(key, value);
|
|
5755
|
+
if (removeOriginal) {
|
|
5756
|
+
host.removeAttribute(key);
|
|
5757
|
+
}
|
|
5758
|
+
});
|
|
5759
|
+
};
|
|
5760
|
+
|
|
5761
|
+
/**
|
|
5762
|
+
* Attaches a MutationObserver to the host element to monitor attribute changes.
|
|
5763
|
+
*
|
|
5764
|
+
* @param {HTMLElement} host - The element to observe for attribute changes.
|
|
5765
|
+
* @returns {MutationObserver} The observer instance.
|
|
5766
|
+
* @private
|
|
5767
|
+
*/
|
|
5768
|
+
const _attachObserver = (host) => {
|
|
5769
|
+
// If an observer for this host already exists, return it
|
|
5770
|
+
if (_observers.has(host)) {
|
|
5771
|
+
return _observers.get(host);
|
|
5772
|
+
}
|
|
5773
|
+
|
|
5774
|
+
// Create a new MutationObserver
|
|
5775
|
+
const observer = new MutationObserver((mutations) => {
|
|
5776
|
+
const config = _transportConfig.get(host);
|
|
5777
|
+
if (!config) return;
|
|
5778
|
+
|
|
5779
|
+
// For each mutation affecting attributes
|
|
5780
|
+
mutations
|
|
5781
|
+
.filter(mutation => mutation.type === 'attributes')
|
|
5782
|
+
.forEach(mutation => {
|
|
5783
|
+
const attributeName = mutation.attributeName;
|
|
5784
|
+
|
|
5785
|
+
// Find matchers that care about this attribute
|
|
5786
|
+
for (const matcher of config.matchers) {
|
|
5787
|
+
if (matcher(attributeName)) {
|
|
5788
|
+
// For each target that uses this matcher
|
|
5789
|
+
for (const [target, matcherConfigs] of config.targets.entries()) {
|
|
5790
|
+
if (matcherConfigs.has(matcher)) {
|
|
5791
|
+
const { removeOriginal } = matcherConfigs.get(matcher);
|
|
5792
|
+
_transportAttributes({
|
|
5793
|
+
host,
|
|
5794
|
+
target,
|
|
5795
|
+
matcher,
|
|
5796
|
+
removeOriginal
|
|
5797
|
+
});
|
|
5798
|
+
}
|
|
5799
|
+
}
|
|
5800
|
+
}
|
|
5801
|
+
}
|
|
5802
|
+
});
|
|
5803
|
+
});
|
|
5804
|
+
|
|
5805
|
+
// Start observing attribute changes
|
|
5806
|
+
observer.observe(host, { attributes: true });
|
|
5807
|
+
|
|
5808
|
+
// Store the observer
|
|
5809
|
+
_observers.set(host, observer);
|
|
5810
|
+
|
|
5811
|
+
return observer;
|
|
5812
|
+
};
|
|
5813
|
+
|
|
5814
|
+
/**
|
|
5815
|
+
* Detaches and cleans up the MutationObserver for a given host element.
|
|
5816
|
+
*
|
|
5817
|
+
* @param {HTMLElement} host - The element whose observer should be detached.
|
|
5818
|
+
* @private
|
|
5819
|
+
*/
|
|
5820
|
+
const _detachObserver = (host) => {
|
|
5821
|
+
if (_observers.has(host)) {
|
|
5822
|
+
const observer = _observers.get(host);
|
|
5823
|
+
observer.disconnect();
|
|
5824
|
+
_observers.delete(host);
|
|
5825
|
+
}
|
|
5826
|
+
|
|
5827
|
+
// Clean up the transport config as well
|
|
5828
|
+
if (_transportConfig.has(host)) {
|
|
5829
|
+
_transportConfig.delete(host);
|
|
5830
|
+
}
|
|
5831
|
+
};
|
|
5832
|
+
|
|
5833
|
+
/**
|
|
5834
|
+
* Gets the matcher configuration for a specific host, target, and matcher
|
|
5835
|
+
* @param {HTMLElement} host - The host element
|
|
5836
|
+
* @param {HTMLElement} target - The target element
|
|
5837
|
+
* @param {Function} matcher - The matcher function
|
|
5838
|
+
* @returns {Object|undefined} The matcher configuration if found
|
|
5839
|
+
* @private
|
|
5840
|
+
*/
|
|
5841
|
+
const _getMatcherConfig = (host, target, matcher) => {
|
|
5842
|
+
const config = _transportConfig.get(host);
|
|
5843
|
+
if (!config) return undefined;
|
|
5844
|
+
|
|
5845
|
+
const targetMatchers = config.targets.get(target);
|
|
5846
|
+
if (!targetMatchers) return undefined;
|
|
5847
|
+
|
|
5848
|
+
return targetMatchers.get(matcher);
|
|
5849
|
+
};
|
|
5850
|
+
|
|
5851
|
+
/**
|
|
5852
|
+
* Sets an observed attribute value
|
|
5853
|
+
* @param {HTMLElement} host - The host element
|
|
5854
|
+
* @param {HTMLElement} target - The target element
|
|
5855
|
+
* @param {Function} matcher - The matcher function
|
|
5856
|
+
* @param {string} key - The attribute name
|
|
5857
|
+
* @param {string} value - The attribute value
|
|
5858
|
+
* @private
|
|
5859
|
+
*/
|
|
5860
|
+
const _setObservedAttribute = (host, target, matcher, key, value) => {
|
|
5861
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5862
|
+
if (matcherConfig) {
|
|
5863
|
+
matcherConfig.currentAttributes.set(key, value);
|
|
5864
|
+
}
|
|
5865
|
+
};
|
|
5866
|
+
|
|
5867
|
+
const _getObservedAttribute = (host, target, matcher, attr) => {
|
|
5868
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5869
|
+
if (matcherConfig) return matcherConfig.currentAttributes.get(attr);
|
|
5870
|
+
return undefined;
|
|
5871
|
+
};
|
|
5872
|
+
|
|
5873
|
+
const _getObservedAttributes = (host, target, matcher) => {
|
|
5874
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5875
|
+
if (matcherConfig) return Array.from(matcherConfig.currentAttributes.entries());
|
|
5876
|
+
return [];
|
|
5877
|
+
};
|
|
5878
|
+
|
|
5879
|
+
const _matchers = {
|
|
5880
|
+
'aria-': attr => attr.startsWith('aria-'),
|
|
5881
|
+
'role': attr => attr.match(/^role$/)
|
|
5882
|
+
};
|
|
5883
|
+
|
|
5884
|
+
const transportAllA11yAttributes = ({ host, target, removeOriginal = true }) => {
|
|
5885
|
+
return transportAttributes({
|
|
5886
|
+
host,
|
|
5887
|
+
target,
|
|
5888
|
+
match: attr => {
|
|
5889
|
+
for (const key in _matchers) {
|
|
5890
|
+
if (_matchers[key](attr)) return true;
|
|
5891
|
+
}
|
|
5892
|
+
return false;
|
|
5893
|
+
},
|
|
5894
|
+
removeOriginal
|
|
5895
|
+
});
|
|
5896
|
+
};
|
|
5897
|
+
|
|
5898
|
+
let AuroElement$1 = class AuroElement extends i$2 {
|
|
5899
|
+
|
|
5900
|
+
/**
|
|
5901
|
+
* @type {Object} return object from transportAttributes via a11yUtilities
|
|
5902
|
+
* @property {Function} cleanup - Function to clean up the attribute watcher.
|
|
5903
|
+
* @property {Function} getCurrentAttributes - Function to get the current attributes being watched and their values.
|
|
5904
|
+
* @property {Function} getObservedAttribute - Function to get the value of a specific observed attribute by name.
|
|
5905
|
+
* @private
|
|
5906
|
+
*/
|
|
5907
|
+
attributeWatcher;
|
|
5908
|
+
|
|
5909
|
+
static get properties() {
|
|
5910
|
+
return {
|
|
5911
|
+
|
|
5912
|
+
/**
|
|
5913
|
+
* Defines the layout of an element.
|
|
5914
|
+
* @default {'default'}
|
|
5915
|
+
*/
|
|
5916
|
+
layout: {
|
|
5917
|
+
type: String,
|
|
5918
|
+
attribute: "layout",
|
|
5919
|
+
reflect: true
|
|
5920
|
+
},
|
|
5921
|
+
|
|
5922
|
+
/**
|
|
5923
|
+
* Defines the shape of an element.
|
|
5924
|
+
* @property {'default', 'rounded', 'pill', 'circle'}
|
|
5925
|
+
* @default {'default'}
|
|
5926
|
+
*/
|
|
5927
|
+
shape: {
|
|
5928
|
+
type: String,
|
|
5929
|
+
attribute: "shape",
|
|
5930
|
+
reflect: true
|
|
5931
|
+
},
|
|
5932
|
+
|
|
5933
|
+
/**
|
|
5934
|
+
* Defines the size of an element.
|
|
5935
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'}
|
|
5936
|
+
* @default {'md'}
|
|
5937
|
+
*/
|
|
5938
|
+
size: {
|
|
5939
|
+
type: String,
|
|
5940
|
+
attribute: "size",
|
|
5941
|
+
reflect: true
|
|
5942
|
+
},
|
|
5943
|
+
|
|
5944
|
+
/**
|
|
5945
|
+
* This Boolean attribute lets you specify that the element should be rendered in dark mode.
|
|
5946
|
+
* @default {false}
|
|
5947
|
+
*/
|
|
5948
|
+
onDark: {
|
|
5949
|
+
type: Boolean,
|
|
5950
|
+
attribute: "ondark",
|
|
5951
|
+
reflect: true
|
|
5952
|
+
},
|
|
5953
|
+
|
|
5954
|
+
/**
|
|
5955
|
+
* A reference to the wrapper element in the shadow DOM.
|
|
5956
|
+
* This is used to apply layout and shape classes dynamically.
|
|
5957
|
+
* @type {HTMLElement|null}
|
|
5958
|
+
* @default {null}
|
|
5959
|
+
* @private
|
|
5960
|
+
*/
|
|
5961
|
+
wrapper: {
|
|
5962
|
+
attribute: false,
|
|
5963
|
+
reflect: false
|
|
5964
|
+
}
|
|
5965
|
+
};
|
|
5966
|
+
}
|
|
5967
|
+
|
|
5968
|
+
|
|
5969
|
+
|
|
5970
|
+
resetShapeClasses() {
|
|
5971
|
+
if (this.shape && this.size) {
|
|
5972
|
+
|
|
5973
|
+
if (this.wrapper) {
|
|
5974
|
+
this.wrapper.classList.forEach((className) => {
|
|
5975
|
+
if (className.startsWith('shape-')) {
|
|
5976
|
+
this.wrapper.classList.remove(className);
|
|
5977
|
+
}
|
|
5978
|
+
});
|
|
5979
|
+
|
|
5980
|
+
this.wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
5981
|
+
}
|
|
5982
|
+
}
|
|
5983
|
+
}
|
|
5984
|
+
|
|
5985
|
+
resetLayoutClasses() {
|
|
5986
|
+
if (this.layout) {
|
|
5987
|
+
if (this.wrapper) {
|
|
5988
|
+
this.wrapper.classList.forEach((className) => {
|
|
5989
|
+
if (className.startsWith('layout-')) {
|
|
5990
|
+
this.wrapper.classList.remove(className);
|
|
5991
|
+
}
|
|
5992
|
+
});
|
|
5993
|
+
|
|
5994
|
+
this.wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
|
|
5995
|
+
}
|
|
5996
|
+
}
|
|
5997
|
+
}
|
|
5998
|
+
|
|
5999
|
+
updateComponentArchitecture() {
|
|
6000
|
+
this.resetLayoutClasses();
|
|
6001
|
+
this.resetShapeClasses();
|
|
6002
|
+
}
|
|
6003
|
+
|
|
6004
|
+
updated(changedProperties) {
|
|
6005
|
+
if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
|
|
6006
|
+
this.updateComponentArchitecture();
|
|
6007
|
+
}
|
|
6008
|
+
}
|
|
6009
|
+
|
|
6010
|
+
firstUpdated() {
|
|
6011
|
+
super.firstUpdated();
|
|
6012
|
+
|
|
6013
|
+
// Set a reference to the wrapper element in the shadow DOM
|
|
6014
|
+
this.wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
6015
|
+
|
|
6016
|
+
// Initialize the transportation of ARIA attributes to the target element and get the disconnect function for cleanup
|
|
6017
|
+
this.attributeWatcher = transportAllA11yAttributes({ host: this, target: this.shadowRoot.querySelector('.wrapper') });
|
|
6018
|
+
}
|
|
6019
|
+
|
|
6020
|
+
disconnectedCallback() {
|
|
6021
|
+
super.disconnectedCallback();
|
|
6022
|
+
|
|
6023
|
+
// Cleanup the ARIA observer if it exists
|
|
6024
|
+
if (this.attributeWatcher) {
|
|
6025
|
+
this.attributeWatcher.cleanup();
|
|
6026
|
+
this.attributeWatcher = null;
|
|
6027
|
+
}
|
|
6028
|
+
}
|
|
6029
|
+
|
|
6030
|
+
// Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
|
|
6031
|
+
// This will catch if an invalid layout value is passed in and render the default layout if so.
|
|
6032
|
+
render() {
|
|
6033
|
+
try {
|
|
6034
|
+
return this.renderLayout();
|
|
6035
|
+
} catch (error) {
|
|
6036
|
+
// failed to get the defined layout
|
|
6037
|
+
console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
|
|
6038
|
+
|
|
6039
|
+
// fallback to the default layout
|
|
6040
|
+
return this.getLayout('default');
|
|
6041
|
+
}
|
|
6042
|
+
}
|
|
6043
|
+
};
|
|
6044
|
+
|
|
6045
|
+
var styleCss$3$1 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_insetNone{padding:0}.util_insetXxxs{padding:.125rem}.util_insetXxxs--stretch{padding:.25rem .125rem}.util_insetXxxs--squish{padding:0 .125rem}.util_insetXxs{padding:.25rem}.util_insetXxs--stretch{padding:.375rem .25rem}.util_insetXxs--squish{padding:.125rem .25rem}.util_insetXs{padding:.5rem}.util_insetXs--stretch{padding:.75rem .5rem}.util_insetXs--squish{padding:.25rem .5rem}.util_insetSm{padding:.75rem}.util_insetSm--stretch{padding:1.125rem .75rem}.util_insetSm--squish{padding:.375rem .75rem}.util_insetMd{padding:1rem}.util_insetMd--stretch{padding:1.5rem 1rem}.util_insetMd--squish{padding:.5rem 1rem}.util_insetLg{padding:1.5rem}.util_insetLg--stretch{padding:2.25rem 1.5rem}.util_insetLg--squish{padding:.75rem 1.5rem}.util_insetXl{padding:2rem}.util_insetXl--stretch{padding:3rem 2rem}.util_insetXl--squish{padding:1rem 2rem}.util_insetXxl{padding:3rem}.util_insetXxl--stretch{padding:4.5rem 3rem}.util_insetXxl--squish{padding:1.5rem 3rem}.util_insetXxxl{padding:4rem}.util_insetXxxl--stretch{padding:6rem 4rem}.util_insetXxxl--squish{padding:2rem 4rem}:host([fluid]) .auro-button,:host([fluid=true]) .auro-button{min-width:auto;width:100%}:host([variant=flat]){display:inline-block}::slotted(svg){vertical-align:middle}slot{pointer-events:none}.auro-button{position:relative;padding:0 var(--ds-size-300, 1.5rem);cursor:pointer;border-width:1px;border-style:solid;border-radius:var(--ds-border-radius, 0.375rem);overflow:hidden;text-overflow:ellipsis;user-select:none;white-space:nowrap;min-height:var(--ds-size-600, 3rem);max-height:var(--ds-size-600, 3rem);display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:var(--ds-size-100, 0.5rem);margin:0;-webkit-touch-callout:none;-webkit-user-select:none;transition:padding 300ms ease-out}.auro-button:active{transform:scale(0.95)}.auro-button:focus-visible,.auro-button:focus{outline:none;outline-style:solid;outline-width:var(--ds-size-50, 0.25rem);outline-offset:calc(var(--ds-size-50, 0.25rem)*-1)}.auro-button:focus-visible:not([variant=secondary]):not([variant=tertiary]),.auro-button:focus:not([variant=secondary]):not([variant=tertiary]){outline-width:calc(var(--ds-size-50, 0.25rem) - 1px)}.auro-button.loading{cursor:not-allowed}.auro-button.loading *:not([auro-loader]){visibility:hidden}@media screen and (min-width: 576px){.auro-button{min-width:8.75rem;width:auto}}.auro-button:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=secondary]:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=tertiary]:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=ghost]:disabled{cursor:not-allowed;transform:unset}.auro-button[onDark]:disabled{cursor:not-allowed;transform:unset}.auro-button[onDark][variant=secondary]:disabled{cursor:not-allowed;transform:unset}@media(hover: hover){.auro-button[onDark][variant=tertiary]:active,.auro-button[onDark][variant=tertiary]:hover{box-shadow:none}}.auro-button[onDark][variant=tertiary]:active{box-shadow:none}.auro-button[onDark][variant=tertiary]:disabled{cursor:not-allowed;transform:unset}.auro-button.icon-only ::slotted(:not(auro-icon):not([auro-icon])){display:none}.auro-button--slim{min-width:unset;min-height:calc(var(--ds-size-500, 2.5rem) - var(--ds-size-50, 0.25rem));max-height:calc(var(--ds-size-500, 2.5rem) - var(--ds-size-50, 0.25rem))}.auro-button--iconOnly{padding:0 var(--ds-size-100, 0.5rem);border-radius:100px;min-width:unset;height:var(--ds-size-600, 3rem);width:var(--ds-size-500, 2.5rem)}.auro-button--iconOnly ::slotted(auro-icon),.auro-button--iconOnly ::slotted([auro-icon]){--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}.auro-button--iconOnly:not(.auro-button--rounded):focus-visible:not([variant=secondary]):not([variant=tertiary]):not([variant=flat]),.auro-button--iconOnly:not(.auro-button--rounded):focus:not([variant=secondary]):not([variant=tertiary]):not([variant=flat]){outline-width:1px;outline-offset:-2px}.auro-button--iconOnlySlim{padding:0 var(--ds-size-50, 0.25rem);height:calc(var(--ds-size-400, 2rem) + var(--ds-size-50, 0.25rem));width:calc(var(--ds-size-300, 1.5rem) + var(--ds-size-50, 0.25rem))}.auro-button--iconOnlySlim ::slotted(auro-icon),.auro-button--iconOnlySlim ::slotted([auro-icon]){--ds-auro-icon-size:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem))}.auro-button--rounded{border-radius:100px;box-shadow:var(--ds-elevation-300, 0px 0px 15px rgba(0, 0, 0, 0.2));height:var(--ds-size-500, 2.5rem);min-width:unset;transition:padding 300ms ease-out,outline 0ms,outline-offset 0ms}.auro-button--rounded ::slotted(auro-icon),.auro-button--rounded ::slotted([auro-icon]){--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}.auro-button--rounded:focus-visible:not([variant=flat]):after,.auro-button--rounded:focus:not([variant=flat]):after{border-radius:100px}:host([size=xs]) .wrapper:focus-visible,:host([size=xs]) .wrapper:focus{outline-width:1px;outline-offset:-2px}:host([rounded]) .textSlot{transition:opacity 300ms ease-in;opacity:1}:host([rounded][iconOnly]) .textSlot{opacity:0}:host([rounded][iconOnly]) .textWrapper{display:none}:host([rounded][iconOnly]) .auro-button{min-width:unset;padding:unset;width:var(--ds-size-600, 3rem)}[auro-loader]{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}`;
|
|
6046
|
+
|
|
6047
|
+
var colorCss$2$1 = i$5`[auro-loader]{color:var(--ds-auro-button-loader-color)}.auro-button{-webkit-tap-highlight-color:var(--ds-auro-button-tap-color);color:var(--ds-auro-button-text-color);background-color:var(--ds-auro-button-container-color);background-image:linear-gradient(var(--ds-auro-button-container-image), var(--ds-auro-button-container-image));border-color:var(--ds-auro-button-border-color)}.auro-button:not([variant=secondary]):not([variant=tertiary]):focus-visible{outline-color:var(--ds-auro-button-border-inset-color)}.auro-button:not([ondark]):active:not(:disabled),.auro-button:not([ondark]):hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-hover, #00274a);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-hover, #00274a);--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-hover, #00274a)}.auro-button:not([ondark]):disabled{--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-disabled, #acc9e2);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-disabled, #acc9e2);--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-disabled, #acc9e2)}.auro-button:not([ondark])[variant=secondary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background, #ffffff);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border, #01426a);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-secondary-text, #01426a)}.auro-button:not([ondark])[variant=secondary]:active:not(:disabled),.auro-button:not([ondark])[variant=secondary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-hover, #f2f2f2);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-hover, #f2f2f2);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-hover, #00274a);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text-hover, #00274a)}.auro-button:not([ondark])[variant=secondary]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=secondary]:disabled{--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-disabled, #f7f7f7);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-disabled, #f7f7f7);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-disabled, #cfe0ef);--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=tertiary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background, rgba(0, 0, 0, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background, rgba(0, 0, 0, 0.05));--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-tertiary-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-tertiary-text, #01426a)}.auro-button:not([ondark])[variant=tertiary]:active:not(:disabled),.auro-button:not([ondark])[variant=tertiary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-hover, rgba(0, 0, 0, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-hover, rgba(0, 0, 0, 0.1));--ds-auro-button-border-color:transparent}.auro-button:not([ondark])[variant=tertiary]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=tertiary]:disabled{--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=ghost]{--ds-auro-button-container-color:transparent;--ds-auro-button-container-image:transparent;--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-ghost-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-ghost-text, #01426a)}.auro-button:not([ondark])[variant=ghost]:active:not(:disabled),.auro-button:not([ondark])[variant=ghost]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-ghost-background-hover, rgba(0, 0, 0, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-ghost-background-hover, rgba(0, 0, 0, 0.05));--ds-auro-button-border-color:transparent}.auro-button:not([ondark])[variant=ghost]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=ghost]:disabled{--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=flat]{color:var(--ds-advanced-color-button-flat-text, #676767);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:active:not(:disabled),.auro-button:not([ondark])[variant=flat]:hover:not(:disabled){color:var(--ds-advanced-color-button-flat-text-hover, #525252);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:disabled{color:var(--ds-advanced-color-button-flat-text-disabled, #d0d0d0);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button[ondark]{--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a)}.auro-button[ondark]:active:not(:disabled),.auro-button[ondark]:hover:not(:disabled){--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse-hover, #ebf3f9);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse-hover, #ebf3f9);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse-hover, #ebf3f9)}.auro-button[ondark]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button[ondark]:disabled{--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=secondary]{--ds-auro-button-container-color:transparent;--ds-auro-button-container-image:transparent;--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-inverse, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-secondary-text-inverse, #ffffff)}.auro-button[ondark][variant=secondary]:active:not(:disabled),.auro-button[ondark][variant=secondary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-inverse-hover, rgba(255, 255, 255, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-inverse-hover, rgba(255, 255, 255, 0.1))}.auro-button[ondark][variant=secondary]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=secondary]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-inverse-disabled, #dddddd)}.auro-button[ondark][variant=tertiary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-inverse, rgba(255, 255, 255, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-inverse, rgba(255, 255, 255, 0.05));--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-tertiary-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-tertiary-text-inverse, #ffffff)}.auro-button[ondark][variant=tertiary]:active:not(:disabled),.auro-button[ondark][variant=tertiary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-inverse-hover, rgba(255, 255, 255, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-inverse-hover, rgba(255, 255, 255, 0.1))}.auro-button[ondark][variant=tertiary]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=tertiary]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=ghost]{--ds-auro-button-container-color:transparent;--ds-auro-button-container-image:transparent;--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-ghost-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-ghost-text-inverse, #ffffff)}.auro-button[ondark][variant=ghost]:active:not(:disabled),.auro-button[ondark][variant=ghost]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-ghost-background-inverse-hover, rgba(255, 255, 255, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-ghost-background-inverse-hover, rgba(255, 255, 255, 0.05))}.auro-button[ondark][variant=ghost]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=ghost]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=flat]{color:var(--ds-advanced-color-button-flat-text-inverse, #ffffff);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:active:not(:disabled),.auro-button[ondark][variant=flat]:hover:not(:disabled){color:var(--ds-advanced-color-button-flat-text-inverse-hover, #adadad);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:disabled{color:var(--ds-advanced-color-button-flat-text-inverse-disabled, #7e8894);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}`;
|
|
6048
|
+
|
|
6049
|
+
var tokensCss$2$1 = i$5`:host(:not([onDark])){--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background, #01426a);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text, #ffffff);--ds-auro-button-tap-color:transparent}:host([onDark]){--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a);--ds-auro-button-tap-color:transparent}`;
|
|
6050
|
+
|
|
6051
|
+
var shapeSize = i$5`.shape-rounded-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:6px;overflow:hidden;font-size:18px}.shape-rounded-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:6px;overflow:hidden;font-size:18px}.shape-rounded-md{min-height:44px;max-height:44px;border-style:solid;border-radius:6px;overflow:hidden;font-size:16px}.shape-rounded-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:6px;overflow:hidden;font-size:14px}.shape-rounded-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:4px;overflow:hidden;font-size:12px;outline-offset:-2px;outline-width:1px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:34px;overflow:hidden;font-size:18px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:34px 0 0 34px;overflow:hidden}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:0 34px 34px 0;overflow:hidden}.shape-pill-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:26px;overflow:hidden;font-size:18px}.shape-pill-left-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:26px 0 0 26px;overflow:hidden}.shape-pill-right-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:0 26px 26px 0;overflow:hidden}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-radius:22px;overflow:hidden}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-radius:22px 0 0 22px;overflow:hidden}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-radius:0 22px 22px 0;overflow:hidden;font-size:16px}.shape-pill-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:16px;overflow:hidden;font-size:14px}.shape-pill-left-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:16px 0 0 16px;overflow:hidden}.shape-pill-right-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:0 16px 16px 0;overflow:hidden}.shape-pill-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:10px;overflow:hidden;font-size:12px;outline-offset:-2px;outline-width:1px}.shape-pill-left-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:10px 0 0 10px;overflow:hidden;outline-offset:-2px;outline-width:1px}.shape-pill-right-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:0 10px 10px 0;overflow:hidden;outline-offset:-2px;outline-width:1px}.shape-circle-xl{min-height:68px;max-height:68px;min-width:68px;max-width:68px;border-style:solid;border-radius:34px;overflow:hidden;padding:0}.shape-circle-lg{min-height:52px;max-height:52px;min-width:52px;max-width:52px;border-style:solid;border-radius:26px;overflow:hidden;padding:0}.shape-circle-md{min-height:44px;max-height:44px;min-width:44px;max-width:44px;border-style:solid;border-radius:22px;overflow:hidden;padding:0}.shape-circle-sm{min-height:32px;max-height:32px;min-width:32px;max-width:32px;border-style:solid;border-radius:16px;overflow:hidden;padding:0}.shape-circle-xs{min-height:20px;max-height:20px;min-width:20px;max-width:20px;border-style:solid;border-radius:10px;overflow:hidden;padding:0;outline-offset:-2px;outline-width:1px}`;
|
|
6052
|
+
|
|
6053
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6054
|
+
// See LICENSE in the project root for license information.
|
|
6055
|
+
|
|
6056
|
+
// ---------------------------------------------------------------------
|
|
6057
|
+
|
|
6058
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
6059
|
+
|
|
6060
|
+
let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
6061
|
+
|
|
6062
|
+
/* eslint-disable jsdoc/require-param */
|
|
6063
|
+
|
|
6064
|
+
/**
|
|
6065
|
+
* This will register a new custom element with the browser.
|
|
6066
|
+
* @param {String} name - The name of the custom element.
|
|
6067
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
6068
|
+
* @returns {void}
|
|
6069
|
+
*/
|
|
6070
|
+
registerComponent(name, componentClass) {
|
|
6071
|
+
if (!customElements.get(name)) {
|
|
6072
|
+
customElements.define(name, class extends componentClass {});
|
|
6073
|
+
}
|
|
6074
|
+
}
|
|
6075
|
+
|
|
6076
|
+
/**
|
|
6077
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
6078
|
+
* @returns {void}
|
|
6079
|
+
*/
|
|
6080
|
+
closestElement(
|
|
6081
|
+
selector, // selector like in .closest()
|
|
6082
|
+
base = this, // extra functionality to skip a parent
|
|
6083
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
6084
|
+
!el || el === document || el === window
|
|
6085
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
6086
|
+
: found
|
|
6087
|
+
? found // found a selector INside this element
|
|
6088
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
6089
|
+
) {
|
|
6090
|
+
return __Closest(base);
|
|
6091
|
+
}
|
|
6092
|
+
/* eslint-enable jsdoc/require-param */
|
|
6093
|
+
|
|
6094
|
+
/**
|
|
6095
|
+
* 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.
|
|
6096
|
+
* @param {Object} elem - The element to check.
|
|
6097
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
6098
|
+
* @returns {void}
|
|
6099
|
+
*/
|
|
6100
|
+
handleComponentTagRename(elem, tagName) {
|
|
6101
|
+
const tag = tagName.toLowerCase();
|
|
6102
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6103
|
+
|
|
6104
|
+
if (elemTag !== tag) {
|
|
6105
|
+
elem.setAttribute(tag, true);
|
|
6106
|
+
}
|
|
6107
|
+
}
|
|
6108
|
+
|
|
6109
|
+
/**
|
|
6110
|
+
* Validates if an element is a specific Auro component.
|
|
6111
|
+
* @param {Object} elem - The element to validate.
|
|
6112
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
6113
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
6114
|
+
*/
|
|
6115
|
+
elementMatch(elem, tagName) {
|
|
6116
|
+
const tag = tagName.toLowerCase();
|
|
6117
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6118
|
+
|
|
6119
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
6120
|
+
}
|
|
6121
|
+
};
|
|
6122
|
+
|
|
6123
|
+
var styleCss$2$1 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host,:host>span{position:relative}:host{width:2rem;height:2rem;display:inline-block;font-size:0}:host>span{position:absolute;display:inline-block;float:none;top:0;left:0;width:2rem;height:2rem;border-radius:100%;border-style:solid;border-width:0}:host([xs]),:host([xs])>span{width:1.2rem;height:1.2rem}:host([sm]),:host([sm])>span{width:3rem;height:3rem}:host([md]),:host([md])>span{width:5rem;height:5rem}:host([lg]),:host([lg])>span{width:8rem;height:8rem}:host{--margin:0.375rem;--margin-xs:0.2rem;--margin-sm:0.5rem;--margin-md:0.75rem;--margin-lg:1rem}:host([pulse]),:host([pulse])>span{position:relative}:host([pulse]){width:calc(3rem + var(--margin)*6);height:1.5rem}:host([pulse])>span{width:1rem;height:1rem;margin:var(--margin);animation:pulse 1.5s ease infinite}:host([pulse][xs]){width:calc(2.55rem + var(--margin-xs)*6);height:1.55rem}:host([pulse][xs])>span{margin:var(--margin-xs);width:.65rem;height:.65rem}:host([pulse][sm]){width:calc(6rem + var(--margin-sm)*6);height:2.5rem}:host([pulse][sm])>span{margin:var(--margin-sm);width:2rem;height:2rem}:host([pulse][md]){width:calc(9rem + var(--margin-md)*6);height:3.5rem}:host([pulse][md])>span{margin:var(--margin-md);width:3rem;height:3rem}:host([pulse][lg]){width:calc(15rem + var(--margin-lg)*6);height:5.5rem}:host([pulse][lg])>span{margin:var(--margin-lg);width:5rem;height:5rem}:host([pulse])>span:nth-child(1){animation-delay:-400ms}:host([pulse])>span:nth-child(2){animation-delay:-200ms}:host([pulse])>span:nth-child(3){animation-delay:0ms}@keyframes pulse{0%,100%{opacity:.1;transform:scale(0.9)}50%{opacity:1;transform:scale(1.1)}}:host([orbit]),:host([orbit])>span{opacity:1}:host([orbit])>span{border-width:5px}:host([orbit])>span:nth-child(2){animation:orbit 2s linear infinite}:host([orbit][sm])>span{border-width:8px}:host([orbit][md])>span{border-width:13px}:host([orbit][lg])>span{border-width:21px}@keyframes orbit{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}:host([ringworm])>svg{animation:rotate 2s linear infinite;height:100%;width:100%;stroke:currentcolor;stroke-width:8}:host([ringworm]) .path{stroke-dashoffset:0;animation:ringworm 1.5s ease-in-out infinite;stroke-linecap:round}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes ringworm{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}:host([laser]){position:static;width:100%;display:block;height:0;overflow:hidden;font-size:unset}:host([laser])>span{position:fixed;width:100%;height:.25rem;border-radius:0;z-index:100}:host([laser])>span:nth-child(1){border-color:currentcolor;opacity:.25}:host([laser])>span:nth-child(2){border-color:currentcolor;animation:laser 2s linear infinite;opacity:1;width:50%}:host([laser][sm])>span:nth-child(2){width:20%}:host([laser][md])>span:nth-child(2){width:30%}:host([laser][lg])>span:nth-child(2){width:50%;animation-duration:1.5s}:host([laser][xl])>span:nth-child(2){width:80%;animation-duration:1.5s}@keyframes laser{0%{left:-100%}100%{left:110%}}:host>.no-animation{display:none}@media(prefers-reduced-motion: reduce){:host{display:flex;align-items:center;justify-content:center;font-size:1rem}:host>span{opacity:1}:host>.loader{display:none}:host>.no-animation{display:block}}`;
|
|
6124
|
+
|
|
6125
|
+
var colorCss$1$1 = i$5`:host{color:var(--ds-auro-loader-color)}:host>span{background-color:var(--ds-auro-loader-background-color);border-color:var(--ds-auro-loader-border-color)}:host([onlight]){--ds-auro-loader-color:var(--ds-basic-color-brand-primary, #01426a)}:host([ondark]){--ds-auro-loader-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([orbit])>span{--ds-auro-loader-background-color:transparent}:host([orbit])>span:nth-child(1){--ds-auro-loader-border-color:currentcolor;opacity:.25}:host([orbit])>span:nth-child(2){--ds-auro-loader-border-color:currentcolor;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}`;
|
|
6126
|
+
|
|
6127
|
+
var tokensCss$1$1 = i$5`:host{--ds-auro-loader-background-color:currentcolor;--ds-auro-loader-border-color:currentcolor;--ds-auro-loader-color:currentcolor}`;
|
|
6128
|
+
|
|
6129
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6130
|
+
// See LICENSE in the project root for license information.
|
|
6131
|
+
|
|
6132
|
+
|
|
6133
|
+
class AuroLoader extends i$2 {
|
|
6134
|
+
constructor() {
|
|
6135
|
+
super();
|
|
6136
|
+
|
|
6137
|
+
/**
|
|
6138
|
+
* @private
|
|
6139
|
+
*/
|
|
6140
|
+
this.keys = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
6141
|
+
|
|
6142
|
+
/**
|
|
6143
|
+
* @private
|
|
6144
|
+
*/
|
|
6145
|
+
this.mdCount = 3;
|
|
6146
|
+
|
|
6147
|
+
/**
|
|
6148
|
+
* @private
|
|
6149
|
+
*/
|
|
6150
|
+
this.smCount = 2;
|
|
6151
|
+
|
|
6152
|
+
/**
|
|
6153
|
+
* @private
|
|
6154
|
+
*/
|
|
6155
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2();
|
|
6156
|
+
|
|
6157
|
+
this.orbit = false;
|
|
6158
|
+
this.ringworm = false;
|
|
6159
|
+
this.laser = false;
|
|
6160
|
+
this.pulse = false;
|
|
6161
|
+
}
|
|
6162
|
+
|
|
6163
|
+
// function to define props used within the scope of this component
|
|
6164
|
+
static get properties() {
|
|
6165
|
+
return {
|
|
6166
|
+
|
|
6167
|
+
/**
|
|
6168
|
+
* Sets loader to laser type.
|
|
6169
|
+
*/
|
|
6170
|
+
laser: {
|
|
6171
|
+
type: Boolean,
|
|
6172
|
+
reflect: true
|
|
6173
|
+
},
|
|
6174
|
+
|
|
6175
|
+
/**
|
|
6176
|
+
* Sets loader to orbit type.
|
|
6177
|
+
*/
|
|
6178
|
+
orbit: {
|
|
6179
|
+
type: Boolean,
|
|
6180
|
+
reflect: true
|
|
6181
|
+
},
|
|
6182
|
+
|
|
6183
|
+
/**
|
|
6184
|
+
* Sets loader to pulse type.
|
|
6185
|
+
*/
|
|
6186
|
+
pulse: {
|
|
6187
|
+
type: Boolean,
|
|
6188
|
+
reflect: true
|
|
6189
|
+
},
|
|
6190
|
+
|
|
6191
|
+
/**
|
|
6192
|
+
* Sets loader to ringworm type.
|
|
6193
|
+
*/
|
|
6194
|
+
ringworm: {
|
|
6195
|
+
type: Boolean,
|
|
6196
|
+
reflect: true
|
|
6197
|
+
}
|
|
6198
|
+
};
|
|
6199
|
+
}
|
|
6200
|
+
|
|
6201
|
+
static get styles() {
|
|
6202
|
+
return [
|
|
6203
|
+
i$5`${styleCss$2$1}`,
|
|
6204
|
+
i$5`${colorCss$1$1}`,
|
|
6205
|
+
i$5`${tokensCss$1$1}`
|
|
6206
|
+
];
|
|
6207
|
+
}
|
|
6208
|
+
|
|
6209
|
+
/**
|
|
6210
|
+
* This will register this element with the browser.
|
|
6211
|
+
* @param {string} [name="auro-loader"] - The name of element that you want to register to.
|
|
6212
|
+
*
|
|
6213
|
+
* @example
|
|
6214
|
+
* AuroLoader.register("custom-loader") // this will register this element to <custom-loader/>
|
|
6215
|
+
*
|
|
6216
|
+
*/
|
|
6217
|
+
static register(name = "auro-loader") {
|
|
6218
|
+
AuroLibraryRuntimeUtils$2.prototype.registerComponent(name, AuroLoader);
|
|
6219
|
+
}
|
|
6220
|
+
|
|
6221
|
+
firstUpdated() {
|
|
6222
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
6223
|
+
this.runtimeUtils.handleComponentTagRename(this, 'auro-loader');
|
|
6224
|
+
}
|
|
6225
|
+
|
|
6226
|
+
connectedCallback() {
|
|
6227
|
+
super.connectedCallback();
|
|
6228
|
+
}
|
|
6229
|
+
|
|
6230
|
+
/**
|
|
6231
|
+
* @private
|
|
6232
|
+
* @returns {Array} Numbered array for template map.
|
|
6233
|
+
*/
|
|
6234
|
+
defineTemplate() {
|
|
6235
|
+
let nodes = Array.from(Array(this.mdCount).keys());
|
|
6236
|
+
|
|
6237
|
+
if (this.orbit || this.laser) {
|
|
6238
|
+
nodes = Array.from(Array(this.smCount).keys());
|
|
6239
|
+
} else if (this.ringworm) {
|
|
6240
|
+
nodes = Array.from(Array(0).keys());
|
|
6241
|
+
}
|
|
6242
|
+
|
|
6243
|
+
return nodes;
|
|
6244
|
+
}
|
|
6245
|
+
|
|
6246
|
+
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
6247
|
+
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
6248
|
+
|
|
6249
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
6250
|
+
render() {
|
|
6251
|
+
return x`
|
|
6252
|
+
${this.defineTemplate().map((idx) => x`
|
|
6253
|
+
<span part="element" class="loader node-${idx}"></span>
|
|
6254
|
+
`)}
|
|
6255
|
+
|
|
6256
|
+
<div class="no-animation">Loading...</div>
|
|
6257
|
+
|
|
6258
|
+
${this.ringworm ? x`
|
|
6259
|
+
<svg part="element" class="circular" viewBox="25 25 50 50">
|
|
6260
|
+
<circle class="path" cx="50" cy="50" r="20" fill="none"/>
|
|
6261
|
+
</svg>`
|
|
6262
|
+
: ``
|
|
6263
|
+
}
|
|
6264
|
+
`;
|
|
6265
|
+
}
|
|
6266
|
+
}
|
|
6267
|
+
|
|
6268
|
+
var loaderVersion = '5.0.0';
|
|
6269
|
+
|
|
6270
|
+
/* eslint-disable max-lines, curly, jsdoc/no-undefined-types */
|
|
6271
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6272
|
+
// See LICENSE in the project root for license information.
|
|
6273
|
+
|
|
6274
|
+
|
|
6275
|
+
/**
|
|
6276
|
+
* @slot - Default slot for the text of the button.
|
|
6277
|
+
* @csspart button - Apply CSS to HTML5 button.
|
|
6278
|
+
* @csspart loader - Apply CSS to auro-loader.
|
|
6279
|
+
* @csspart text - Apply CSS to text slot.
|
|
6280
|
+
* @csspart icon - Apply CSS to icon slot.
|
|
6281
|
+
*/
|
|
6282
|
+
|
|
6283
|
+
/* eslint-disable lit/no-invalid-html, lit/binding-positions */
|
|
6284
|
+
|
|
6285
|
+
const ICON_ONLY_SHAPES = ['circle'];
|
|
6286
|
+
|
|
6287
|
+
/**
|
|
6288
|
+
* AuroButton is a custom element that provides a styled, accessible button with support for various states and form association.
|
|
6289
|
+
* It is designed to be flexible, supporting loading states, icon slots, and integration with HTML5 forms.
|
|
6290
|
+
* @property {'default', 'rounded', 'pill', 'circle'} shape - Defines the shape of the button.
|
|
6291
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'} size - Defines the size of the button.
|
|
6292
|
+
* @property {'primary', 'secondary', 'tertiary', 'ghost', 'flat'} variant - Sets the button variant.
|
|
6293
|
+
* @property {'submit', 'reset', 'button'} type - The type of button. Matches HTML5 Button Spec.
|
|
6294
|
+
* @property {boolean} onDark - Indicates if the button is rendered in dark mode.
|
|
6295
|
+
*/
|
|
6296
|
+
class AuroButton extends AuroElement$1 {
|
|
6297
|
+
|
|
6298
|
+
/**
|
|
6299
|
+
* Enables form association for this element.
|
|
6300
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals
|
|
6301
|
+
* @returns {boolean} - Returns true to enable form association.
|
|
6302
|
+
*/
|
|
6303
|
+
static get formAssociated() {
|
|
6304
|
+
return true;
|
|
6305
|
+
}
|
|
6306
|
+
|
|
6307
|
+
constructor() {
|
|
6308
|
+
super();
|
|
6309
|
+
this.autofocus = false;
|
|
6310
|
+
this.disabled = false;
|
|
6311
|
+
this.loading = false;
|
|
6312
|
+
this.size = "md";
|
|
6313
|
+
this.shape = "rounded";
|
|
6314
|
+
this.onDark = false;
|
|
6315
|
+
this.fluid = false;
|
|
6316
|
+
this.loadingText = this.loadingText || 'Loading...';
|
|
6317
|
+
|
|
6318
|
+
// Support for HTML5 forms
|
|
6319
|
+
if (typeof this.attachInternals === 'function') {
|
|
6320
|
+
this.internals = this.attachInternals();
|
|
6321
|
+
} else {
|
|
6322
|
+
this.internals = null;
|
|
6323
|
+
|
|
6324
|
+
// eslint-disable-next-line no-console
|
|
6325
|
+
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.');
|
|
6326
|
+
}
|
|
6327
|
+
|
|
6328
|
+
/**
|
|
6329
|
+
* Generate unique names for dependency components.
|
|
6330
|
+
*/
|
|
6331
|
+
const versioning = new AuroDependencyVersioning();
|
|
6332
|
+
|
|
6333
|
+
/**
|
|
6334
|
+
* @private
|
|
6335
|
+
*/
|
|
6336
|
+
this.loaderTag = versioning.generateTag('auro-loader', loaderVersion, AuroLoader);
|
|
6337
|
+
|
|
6338
|
+
/**
|
|
6339
|
+
* @private
|
|
6340
|
+
*/
|
|
6341
|
+
this.buttonHref = undefined;
|
|
6342
|
+
|
|
6343
|
+
/**
|
|
6344
|
+
* @private
|
|
6345
|
+
*/
|
|
6346
|
+
this.buttonTarget = undefined;
|
|
6347
|
+
|
|
6348
|
+
/**
|
|
6349
|
+
* @private
|
|
6350
|
+
*/
|
|
6351
|
+
this.buttonRel = undefined;
|
|
6352
|
+
}
|
|
6353
|
+
|
|
6354
|
+
static get styles() {
|
|
6355
|
+
return [
|
|
6356
|
+
tokensCss$2$1,
|
|
6357
|
+
styleCss$3$1,
|
|
6358
|
+
colorCss$2$1,
|
|
6359
|
+
shapeSize
|
|
6360
|
+
];
|
|
6361
|
+
}
|
|
6362
|
+
|
|
6363
|
+
static get properties() {
|
|
6364
|
+
return {
|
|
6365
|
+
|
|
6366
|
+
...super.properties,
|
|
6367
|
+
|
|
6368
|
+
/**
|
|
6369
|
+
* Override layout since it isn't used in this component.
|
|
6370
|
+
* @private
|
|
6371
|
+
*/
|
|
6372
|
+
layout: {
|
|
6373
|
+
type: Boolean,
|
|
6374
|
+
attribute: false,
|
|
6375
|
+
reflect: false
|
|
6376
|
+
},
|
|
6377
|
+
|
|
6378
|
+
/**
|
|
6379
|
+
* This Boolean attribute lets you specify that the button should have input focus when the page loads, unless overridden by the user.
|
|
6380
|
+
*/
|
|
6381
|
+
autofocus: {
|
|
6382
|
+
type: Boolean,
|
|
6383
|
+
reflect: true
|
|
6384
|
+
},
|
|
6385
|
+
|
|
6386
|
+
/**
|
|
6387
|
+
* If set to true, button will become disabled and not allow for interactions.
|
|
6388
|
+
*/
|
|
6389
|
+
disabled: {
|
|
6390
|
+
type: Boolean,
|
|
6391
|
+
reflect: true
|
|
6392
|
+
},
|
|
6393
|
+
|
|
6394
|
+
/**
|
|
6395
|
+
* Alters the shape of the button to be full width of its parent container.
|
|
6396
|
+
*/
|
|
6397
|
+
fluid: {
|
|
6398
|
+
type: Boolean,
|
|
6399
|
+
reflect: true
|
|
6400
|
+
},
|
|
6401
|
+
|
|
6402
|
+
/**
|
|
6403
|
+
* If set to true button text will be replaced with `auro-loader` and become disabled.
|
|
6404
|
+
*/
|
|
6405
|
+
loading: {
|
|
6406
|
+
type: Boolean,
|
|
6407
|
+
reflect: true
|
|
6408
|
+
},
|
|
6409
|
+
|
|
6410
|
+
/**
|
|
6411
|
+
* 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.
|
|
6412
|
+
*/
|
|
6413
|
+
loadingText: {
|
|
6414
|
+
type: String
|
|
6415
|
+
},
|
|
6416
|
+
|
|
6417
|
+
/**
|
|
6418
|
+
* Populates `tabindex` to define the focusable sequence in keyboard navigation.
|
|
6419
|
+
*/
|
|
6420
|
+
tIndex: {
|
|
6421
|
+
type: String,
|
|
6422
|
+
reflect: true
|
|
6423
|
+
},
|
|
6424
|
+
|
|
6425
|
+
/**
|
|
6426
|
+
* Populates `tabindex` to define the focusable sequence in keyboard navigation.
|
|
6427
|
+
* Must be used with "." to ensure the host element does not retain a reference to the `tabindex` attribute.
|
|
6428
|
+
* Example: `<auro-button .tabindex="${this.disabled ? '-1' : '0'}"></auro-button>`
|
|
6429
|
+
*/
|
|
6430
|
+
tabindex: {
|
|
6431
|
+
type: String,
|
|
6432
|
+
reflect: false
|
|
6433
|
+
},
|
|
6434
|
+
|
|
6435
|
+
/**
|
|
6436
|
+
* Sets title attribute. The information is most often shown as a tooltip text when the mouse moves over the element.
|
|
6437
|
+
*/
|
|
6438
|
+
title: {
|
|
6439
|
+
type: String,
|
|
6440
|
+
reflect: true
|
|
6441
|
+
},
|
|
6442
|
+
|
|
6443
|
+
/**
|
|
6444
|
+
* The type of the button. Possible values are: `submit`, `reset`, `button`.
|
|
6445
|
+
*/
|
|
6446
|
+
type: {
|
|
6447
|
+
type: String,
|
|
6448
|
+
reflect: true
|
|
6449
|
+
},
|
|
6450
|
+
|
|
6451
|
+
/**
|
|
6452
|
+
* Defines the value associated with the button which is submitted with the form data.
|
|
6453
|
+
*/
|
|
6454
|
+
value: {
|
|
6455
|
+
type: String,
|
|
6456
|
+
reflect: true
|
|
6457
|
+
},
|
|
6458
|
+
|
|
6459
|
+
/**
|
|
6460
|
+
* Sets button variant option.
|
|
6461
|
+
* @default primary
|
|
6462
|
+
*/
|
|
6463
|
+
variant: {
|
|
6464
|
+
type: String,
|
|
6465
|
+
reflect: true
|
|
6466
|
+
},
|
|
6467
|
+
|
|
6468
|
+
/**
|
|
6469
|
+
* @private
|
|
6470
|
+
*/
|
|
6471
|
+
buttonHref: {
|
|
6472
|
+
type: String,
|
|
6473
|
+
},
|
|
6474
|
+
|
|
6475
|
+
/**
|
|
6476
|
+
* @private
|
|
6477
|
+
*/
|
|
6478
|
+
buttonTarget: {
|
|
6479
|
+
type: String,
|
|
6480
|
+
},
|
|
6481
|
+
|
|
6482
|
+
/**
|
|
6483
|
+
* @private
|
|
6484
|
+
*/
|
|
6485
|
+
buttonRel: {
|
|
6486
|
+
type: String,
|
|
6487
|
+
},
|
|
6488
|
+
};
|
|
6489
|
+
}
|
|
6490
|
+
|
|
6491
|
+
/**
|
|
6492
|
+
* This will register this element with the browser.
|
|
6493
|
+
* @param {string} [name="auro-button"] - The name of element that you want to register to.
|
|
6494
|
+
*
|
|
6495
|
+
* @example
|
|
6496
|
+
* AuroButton.register("custom-button") // this will register this element to <custom-button/>
|
|
6497
|
+
*
|
|
6498
|
+
*/
|
|
6499
|
+
static register(name = "auro-button") {
|
|
6500
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroButton);
|
|
6501
|
+
}
|
|
6502
|
+
|
|
6503
|
+
/**
|
|
6504
|
+
* Internal method to apply focus to the HTML5 button.
|
|
6505
|
+
* @private
|
|
6506
|
+
* @returns {void}
|
|
6507
|
+
*/
|
|
6508
|
+
focus() {
|
|
6509
|
+
this.renderRoot.querySelector('button').focus();
|
|
6510
|
+
}
|
|
6511
|
+
|
|
6512
|
+
/**
|
|
6513
|
+
* Submits the form that this button is associated with.
|
|
6514
|
+
* @private
|
|
6515
|
+
* @returns {void}
|
|
6516
|
+
*/
|
|
6517
|
+
surfaceSubmitEvent() {
|
|
6518
|
+
if (this.form) {
|
|
6519
|
+
this.form.requestSubmit();
|
|
6520
|
+
}
|
|
6521
|
+
}
|
|
6522
|
+
|
|
6523
|
+
/**
|
|
6524
|
+
* Returns the form element that this button is associated with.
|
|
6525
|
+
* @private
|
|
6526
|
+
* @returns {HTMLFormElement | null}
|
|
6527
|
+
*/
|
|
6528
|
+
get form() {
|
|
6529
|
+
return this.internals ? this.internals.form : null;
|
|
6530
|
+
}
|
|
6531
|
+
|
|
6532
|
+
/**
|
|
6533
|
+
* @private
|
|
6534
|
+
* @returns {Boolean}
|
|
6535
|
+
*/
|
|
6536
|
+
get hideText() {
|
|
6537
|
+
return ICON_ONLY_SHAPES.includes(this.shape);
|
|
6538
|
+
}
|
|
6539
|
+
|
|
6540
|
+
/**
|
|
6541
|
+
* Returns the current value of the projected `aria-label` attribute or undefined if not set.
|
|
6542
|
+
* @returns {string | undefined}
|
|
6543
|
+
* @private
|
|
6544
|
+
*/
|
|
6545
|
+
get currentAriaLabel() {
|
|
6546
|
+
if (!this.attributeWatcher) return undefined;
|
|
6547
|
+
|
|
6548
|
+
const ariaLabel = this.attributeWatcher.getObservedAttribute("aria-label");
|
|
6549
|
+
return ariaLabel || undefined;
|
|
6550
|
+
}
|
|
6551
|
+
|
|
6552
|
+
/**
|
|
6553
|
+
* Returns the current value of the projected `aria-labelledby` attribute or undefined if not set.
|
|
6554
|
+
* @returns {string | undefined}
|
|
6555
|
+
* @private
|
|
6556
|
+
*/
|
|
6557
|
+
get currentAriaLabelledBy() {
|
|
6558
|
+
if (!this.attributeWatcher) return undefined;
|
|
6559
|
+
|
|
6560
|
+
const ariaLabelledBy = this.attributeWatcher.getObservedAttribute("aria-labelledby");
|
|
6561
|
+
return ariaLabelledBy || undefined;
|
|
6562
|
+
}
|
|
6563
|
+
|
|
6564
|
+
/**
|
|
6565
|
+
* Renders the default layout for the button.
|
|
6566
|
+
* @returns {TemplateResult}
|
|
6567
|
+
* @private
|
|
6568
|
+
*/
|
|
6569
|
+
renderLayoutDefault() {
|
|
6570
|
+
const classes = {
|
|
6571
|
+
"util_insetLg--squish": true,
|
|
6572
|
+
"auro-button": true,
|
|
6573
|
+
"icon-only": this.hideText,
|
|
6574
|
+
wrapper: true,
|
|
6575
|
+
loading: this.loading,
|
|
6576
|
+
};
|
|
6577
|
+
|
|
6578
|
+
const tag = this.buttonHref ? i`a` : i`button`;
|
|
6579
|
+
const part = this.buttonHref ? 'link' : 'button';
|
|
6580
|
+
|
|
6581
|
+
return u`
|
|
6582
|
+
<${tag}
|
|
6583
|
+
part="${part}"
|
|
6584
|
+
aria-label="${o(this.loading ? this.loadingText : this.currentAriaLabel || undefined)}"
|
|
6585
|
+
aria-labelledby="${o(this.loading ? undefined : this.currentAriaLabelledBy || undefined)}"
|
|
6586
|
+
tabindex="${o(this.tIndex || this.tabindex)}"
|
|
6587
|
+
?autofocus="${this.autofocus}"
|
|
6588
|
+
class=${e(classes)}
|
|
6589
|
+
?disabled="${this.disabled || this.loading}"
|
|
6590
|
+
?onDark="${this.onDark}"
|
|
6591
|
+
title="${o(this.title ? this.title : undefined)}"
|
|
6592
|
+
name="${o(this.name ? this.name : undefined)}"
|
|
6593
|
+
type="${o(this.type ? this.type : undefined)}"
|
|
6594
|
+
variant="${o(this.variant ? this.variant : undefined)}"
|
|
6595
|
+
.value="${o(this.value ? this.value : undefined)}"
|
|
6596
|
+
@click="${this.type === 'submit' ? this.surfaceSubmitEvent : undefined}"
|
|
6597
|
+
href="${o(this.buttonHref || undefined)}"
|
|
6598
|
+
target="${o(this.buttonTarget || undefined)}"
|
|
6599
|
+
rel="${o(this.buttonRel || undefined)}"
|
|
6600
|
+
>
|
|
6601
|
+
${o(this.loading ? u`<${this.loaderTag} pulse part="loader"></${this.loaderTag}>` : undefined)}
|
|
6602
|
+
|
|
6603
|
+
<span class="contentWrapper">
|
|
6604
|
+
<span class="textSlot" part="text">
|
|
6605
|
+
<slot></slot>
|
|
6606
|
+
</span>
|
|
6607
|
+
</span>
|
|
6608
|
+
</${tag}>
|
|
6609
|
+
`;
|
|
6610
|
+
}
|
|
6611
|
+
|
|
6612
|
+
/**
|
|
6613
|
+
* Renders the layout of the button.
|
|
6614
|
+
* @returns {TemplateResult}
|
|
6615
|
+
* @private
|
|
6616
|
+
*/
|
|
6617
|
+
renderLayout() {
|
|
6618
|
+
return this.renderLayoutDefault();
|
|
6619
|
+
}
|
|
6620
|
+
}
|
|
6621
|
+
|
|
6622
|
+
var buttonVersion = '11.2.1';
|
|
6623
|
+
|
|
6624
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6625
|
+
// See LICENSE in the project root for license information.
|
|
6626
|
+
|
|
6627
|
+
|
|
6628
|
+
/**
|
|
6629
|
+
* @attr {Boolean} hidden - If present, the component will be hidden both visually and from screen readers
|
|
6630
|
+
* @attr {Boolean} hiddenVisually - If present, the component will be hidden visually, but still read by screen readers
|
|
6631
|
+
* @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
|
|
6632
|
+
*/
|
|
6633
|
+
|
|
6634
|
+
let AuroElement$2 = class AuroElement extends i$2 {
|
|
6635
|
+
|
|
6636
|
+
// function to define props used within the scope of this component
|
|
6637
|
+
static get properties() {
|
|
6638
|
+
return {
|
|
6639
|
+
hidden: { type: Boolean,
|
|
6640
|
+
reflect: true },
|
|
6641
|
+
hiddenVisually: { type: Boolean,
|
|
6642
|
+
reflect: true },
|
|
6643
|
+
hiddenAudible: { type: Boolean,
|
|
6644
|
+
reflect: true },
|
|
6645
|
+
};
|
|
6646
|
+
}
|
|
6647
|
+
|
|
6648
|
+
/**
|
|
6649
|
+
* @private Function that determines state of aria-hidden
|
|
6650
|
+
*/
|
|
6651
|
+
hideAudible(value) {
|
|
6652
|
+
if (value) {
|
|
6653
|
+
return 'true'
|
|
6654
|
+
}
|
|
6655
|
+
|
|
6656
|
+
return 'false'
|
|
6657
|
+
}
|
|
6658
|
+
};
|
|
6659
|
+
|
|
6660
|
+
var error$1 = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"error__desc\" class=\"ico_squareLarge\" data-deprecated=\"true\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><desc id=\"error__desc\">Error alert indicator.</desc><path d=\"m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583\"/></svg>"};
|
|
6661
|
+
|
|
6662
|
+
/* eslint-disable no-underscore-dangle, jsdoc/no-undefined-types, jsdoc/require-param-description */
|
|
6663
|
+
|
|
6664
|
+
const _fetchMap$1 = new Map();
|
|
6665
|
+
|
|
6666
|
+
/**
|
|
6667
|
+
* A callback to parse Response body.
|
|
6668
|
+
*
|
|
6669
|
+
* @callback ResponseParser
|
|
6670
|
+
* @param {Fetch.Response} response
|
|
6671
|
+
* @returns {Promise}
|
|
6672
|
+
*/
|
|
6673
|
+
|
|
6674
|
+
/**
|
|
6675
|
+
* A minimal in-memory map to de-duplicate Fetch API media requests.
|
|
6676
|
+
*
|
|
6677
|
+
* @param {String} uri
|
|
6678
|
+
* @param {Object} [options={}]
|
|
6679
|
+
* @param {ResponseParser} [options.responseParser=(response) => response.text()]
|
|
6680
|
+
* @returns {Promise}
|
|
6681
|
+
*/
|
|
6682
|
+
const cacheFetch$1 = (uri, options = {}) => {
|
|
6683
|
+
const responseParser = options.responseParser || ((response) => response.text());
|
|
6684
|
+
if (!_fetchMap$1.has(uri)) {
|
|
6685
|
+
_fetchMap$1.set(uri, fetch(uri).then(responseParser));
|
|
6686
|
+
}
|
|
6687
|
+
return _fetchMap$1.get(uri);
|
|
6688
|
+
};
|
|
6689
|
+
|
|
6690
|
+
var styleCss$1$1 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, 0.75rem))}:host{color:currentColor;vertical-align:middle;line-height:1;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem) !important;width:var(--ds-auro-icon-size, 1.5rem) !important;height:var(--ds-auro-icon-size, 1.5rem) !important}.componentWrapper{display:flex}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.labelWrapper{margin-left:var(--ds-size-50, 0.25rem);line-height:1.8}`;
|
|
6691
|
+
|
|
6692
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6693
|
+
// See LICENSE in the project root for license information.
|
|
6694
|
+
|
|
6695
|
+
|
|
6696
|
+
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
5147
6697
|
/**
|
|
5148
6698
|
* @slot - Hidden from visibility, used for a11y if icon description is needed
|
|
5149
6699
|
*/
|
|
5150
6700
|
|
|
5151
6701
|
// build the component class
|
|
5152
|
-
let BaseIcon$1 = class BaseIcon extends AuroElement$
|
|
6702
|
+
let BaseIcon$1 = class BaseIcon extends AuroElement$2 {
|
|
5153
6703
|
constructor() {
|
|
5154
6704
|
super();
|
|
5155
6705
|
this.onDark = false;
|
|
@@ -5221,9 +6771,79 @@ let BaseIcon$1 = class BaseIcon extends AuroElement$1 {
|
|
|
5221
6771
|
}
|
|
5222
6772
|
};
|
|
5223
6773
|
|
|
5224
|
-
var tokensCss$
|
|
6774
|
+
var tokensCss$3 = i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color:#02426D;--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}`;
|
|
6775
|
+
|
|
6776
|
+
var colorCss$4 = i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
6777
|
+
|
|
6778
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6779
|
+
// See LICENSE in the project root for license information.
|
|
6780
|
+
|
|
6781
|
+
// ---------------------------------------------------------------------
|
|
6782
|
+
|
|
6783
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
6784
|
+
|
|
6785
|
+
let AuroLibraryRuntimeUtils$1$1 = class AuroLibraryRuntimeUtils {
|
|
6786
|
+
|
|
6787
|
+
/* eslint-disable jsdoc/require-param */
|
|
6788
|
+
|
|
6789
|
+
/**
|
|
6790
|
+
* This will register a new custom element with the browser.
|
|
6791
|
+
* @param {String} name - The name of the custom element.
|
|
6792
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
6793
|
+
* @returns {void}
|
|
6794
|
+
*/
|
|
6795
|
+
registerComponent(name, componentClass) {
|
|
6796
|
+
if (!customElements.get(name)) {
|
|
6797
|
+
customElements.define(name, class extends componentClass {});
|
|
6798
|
+
}
|
|
6799
|
+
}
|
|
6800
|
+
|
|
6801
|
+
/**
|
|
6802
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
6803
|
+
* @returns {void}
|
|
6804
|
+
*/
|
|
6805
|
+
closestElement(
|
|
6806
|
+
selector, // selector like in .closest()
|
|
6807
|
+
base = this, // extra functionality to skip a parent
|
|
6808
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
6809
|
+
!el || el === document || el === window
|
|
6810
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
6811
|
+
: found
|
|
6812
|
+
? found // found a selector INside this element
|
|
6813
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
6814
|
+
) {
|
|
6815
|
+
return __Closest(base);
|
|
6816
|
+
}
|
|
6817
|
+
/* eslint-enable jsdoc/require-param */
|
|
6818
|
+
|
|
6819
|
+
/**
|
|
6820
|
+
* 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.
|
|
6821
|
+
* @param {Object} elem - The element to check.
|
|
6822
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
6823
|
+
* @returns {void}
|
|
6824
|
+
*/
|
|
6825
|
+
handleComponentTagRename(elem, tagName) {
|
|
6826
|
+
const tag = tagName.toLowerCase();
|
|
6827
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6828
|
+
|
|
6829
|
+
if (elemTag !== tag) {
|
|
6830
|
+
elem.setAttribute(tag, true);
|
|
6831
|
+
}
|
|
6832
|
+
}
|
|
6833
|
+
|
|
6834
|
+
/**
|
|
6835
|
+
* Validates if an element is a specific Auro component.
|
|
6836
|
+
* @param {Object} elem - The element to validate.
|
|
6837
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
6838
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
6839
|
+
*/
|
|
6840
|
+
elementMatch(elem, tagName) {
|
|
6841
|
+
const tag = tagName.toLowerCase();
|
|
6842
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
5225
6843
|
|
|
5226
|
-
|
|
6844
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
6845
|
+
}
|
|
6846
|
+
};
|
|
5227
6847
|
|
|
5228
6848
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5229
6849
|
// See LICENSE in the project root for license information.
|
|
@@ -5244,7 +6864,7 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5244
6864
|
*/
|
|
5245
6865
|
privateDefaults() {
|
|
5246
6866
|
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
5247
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
6867
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$1$1();
|
|
5248
6868
|
}
|
|
5249
6869
|
|
|
5250
6870
|
// function to define props used within the scope of this component
|
|
@@ -5311,9 +6931,9 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5311
6931
|
static get styles() {
|
|
5312
6932
|
return [
|
|
5313
6933
|
super.styles,
|
|
5314
|
-
i$5`${tokensCss$
|
|
6934
|
+
i$5`${tokensCss$3}`,
|
|
5315
6935
|
i$5`${styleCss$1$1}`,
|
|
5316
|
-
i$5`${colorCss$
|
|
6936
|
+
i$5`${colorCss$4}`
|
|
5317
6937
|
];
|
|
5318
6938
|
}
|
|
5319
6939
|
|
|
@@ -5326,7 +6946,7 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5326
6946
|
*
|
|
5327
6947
|
*/
|
|
5328
6948
|
static register(name = "auro-icon") {
|
|
5329
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroIcon);
|
|
6949
|
+
AuroLibraryRuntimeUtils$1$1.prototype.registerComponent(name, AuroIcon);
|
|
5330
6950
|
}
|
|
5331
6951
|
|
|
5332
6952
|
connectedCallback() {
|
|
@@ -5347,8 +6967,12 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5347
6967
|
async firstUpdated() {
|
|
5348
6968
|
await super.firstUpdated();
|
|
5349
6969
|
|
|
5350
|
-
|
|
5351
|
-
|
|
6970
|
+
/**
|
|
6971
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
6972
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
6973
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
6974
|
+
*/
|
|
6975
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
5352
6976
|
const svgDesc = this.svg.querySelector('desc');
|
|
5353
6977
|
|
|
5354
6978
|
if (svgDesc) {
|
|
@@ -5369,32 +6993,102 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5369
6993
|
'svgWrapper': true,
|
|
5370
6994
|
};
|
|
5371
6995
|
|
|
5372
|
-
return x`
|
|
5373
|
-
<div class="componentWrapper">
|
|
5374
|
-
<div
|
|
5375
|
-
class="${e(svgClasses)}"
|
|
5376
|
-
title="${o(this.title || undefined)}">
|
|
5377
|
-
<span aria-hidden="${o(this.ariaHidden || true)}" part="svg">
|
|
5378
|
-
${this.customSvg ? x`
|
|
5379
|
-
<slot name="svg"></slot>
|
|
5380
|
-
` : x`
|
|
5381
|
-
${this.svg}
|
|
5382
|
-
`
|
|
5383
|
-
}
|
|
5384
|
-
</span>
|
|
5385
|
-
</div>
|
|
6996
|
+
return x`
|
|
6997
|
+
<div class="componentWrapper">
|
|
6998
|
+
<div
|
|
6999
|
+
class="${e(svgClasses)}"
|
|
7000
|
+
title="${o(this.title || undefined)}">
|
|
7001
|
+
<span aria-hidden="${o(this.ariaHidden || true)}" part="svg">
|
|
7002
|
+
${this.customSvg ? x`
|
|
7003
|
+
<slot name="svg"></slot>
|
|
7004
|
+
` : x`
|
|
7005
|
+
${this.svg}
|
|
7006
|
+
`
|
|
7007
|
+
}
|
|
7008
|
+
</span>
|
|
7009
|
+
</div>
|
|
7010
|
+
|
|
7011
|
+
<div class="${e(labelClasses)}">
|
|
7012
|
+
<slot></slot>
|
|
7013
|
+
</div>
|
|
7014
|
+
</div>
|
|
7015
|
+
`;
|
|
7016
|
+
}
|
|
7017
|
+
};
|
|
7018
|
+
|
|
7019
|
+
var iconVersion$1 = '8.0.4';
|
|
7020
|
+
|
|
7021
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
7022
|
+
// See LICENSE in the project root for license information.
|
|
7023
|
+
|
|
7024
|
+
// ---------------------------------------------------------------------
|
|
7025
|
+
|
|
7026
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
7027
|
+
|
|
7028
|
+
let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
7029
|
+
|
|
7030
|
+
/* eslint-disable jsdoc/require-param */
|
|
7031
|
+
|
|
7032
|
+
/**
|
|
7033
|
+
* This will register a new custom element with the browser.
|
|
7034
|
+
* @param {String} name - The name of the custom element.
|
|
7035
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
7036
|
+
* @returns {void}
|
|
7037
|
+
*/
|
|
7038
|
+
registerComponent(name, componentClass) {
|
|
7039
|
+
if (!customElements.get(name)) {
|
|
7040
|
+
customElements.define(name, class extends componentClass {});
|
|
7041
|
+
}
|
|
7042
|
+
}
|
|
7043
|
+
|
|
7044
|
+
/**
|
|
7045
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
7046
|
+
* @returns {void}
|
|
7047
|
+
*/
|
|
7048
|
+
closestElement(
|
|
7049
|
+
selector, // selector like in .closest()
|
|
7050
|
+
base = this, // extra functionality to skip a parent
|
|
7051
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
7052
|
+
!el || el === document || el === window
|
|
7053
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
7054
|
+
: found
|
|
7055
|
+
? found // found a selector INside this element
|
|
7056
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
7057
|
+
) {
|
|
7058
|
+
return __Closest(base);
|
|
7059
|
+
}
|
|
7060
|
+
/* eslint-enable jsdoc/require-param */
|
|
7061
|
+
|
|
7062
|
+
/**
|
|
7063
|
+
* 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.
|
|
7064
|
+
* @param {Object} elem - The element to check.
|
|
7065
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
7066
|
+
* @returns {void}
|
|
7067
|
+
*/
|
|
7068
|
+
handleComponentTagRename(elem, tagName) {
|
|
7069
|
+
const tag = tagName.toLowerCase();
|
|
7070
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
7071
|
+
|
|
7072
|
+
if (elemTag !== tag) {
|
|
7073
|
+
elem.setAttribute(tag, true);
|
|
7074
|
+
}
|
|
7075
|
+
}
|
|
7076
|
+
|
|
7077
|
+
/**
|
|
7078
|
+
* Validates if an element is a specific Auro component.
|
|
7079
|
+
* @param {Object} elem - The element to validate.
|
|
7080
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
7081
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
7082
|
+
*/
|
|
7083
|
+
elementMatch(elem, tagName) {
|
|
7084
|
+
const tag = tagName.toLowerCase();
|
|
7085
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
5386
7086
|
|
|
5387
|
-
|
|
5388
|
-
<slot></slot>
|
|
5389
|
-
</div>
|
|
5390
|
-
</div>
|
|
5391
|
-
`;
|
|
7087
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
5392
7088
|
}
|
|
5393
7089
|
};
|
|
5394
7090
|
|
|
5395
|
-
var
|
|
5396
|
-
|
|
5397
|
-
var styleCss$4 = i$5`.heading{margin:1.75rem 0;letter-spacing:var(--ds-text-heading-default-spacing, -0.2px);font-weight:var(--ds-text-heading-default-weight, 500)}.heading--display{margin-top:0;font-size:var(--ds-text-heading-display-size-breakpoint-sm, 2.75rem);font-weight:var(--ds-text-heading-display-weight, 100);line-height:var(--ds-text-heading-display-height-breakpoint-sm, 3.375rem)}@media screen and (min-width: 768px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-md, 3rem);line-height:var(--ds-text-heading-display-height-breakpoint-md, 3.75rem)}}@media screen and (min-width: 1024px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-lg, 3.5rem);line-height:var(--ds-text-heading-display-height-breakpoint-lg, 4.25rem)}}.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-sm, 2rem);font-weight:var(--ds-text-heading-800-weight, 500);line-height:var(--ds-text-heading-800-height-breakpoint-sm, 2.375rem)}@media screen and (min-width: 768px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-md, 2.25rem);line-height:var(--ds-text-heading-800-height-breakpoint-md, 2.625rem)}}@media screen and (min-width: 1024px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-lg, 2.5rem);line-height:var(--ds-text-heading-800-height-breakpoint-lg, 3rem)}}.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-sm, 1.75rem);font-weight:var(--ds-text-heading-700-weight, 500);line-height:var(--ds-text-heading-700-height-breakpoint-sm, 2.125rem)}@media screen and (min-width: 768px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-md, 2rem);line-height:var(--ds-text-heading-700-height-breakpoint-md, 2.375rem)}}@media screen and (min-width: 1024px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-lg, 2.25rem);line-height:var(--ds-text-heading-700-height-breakpoint-lg, 2.75rem)}}.heading--600{margin:1rem 0;font-size:var(--ds-text-heading-600-size-breakpoint-sm, 1.625rem);font-weight:var(--ds-text-heading-600-weight, 300);line-height:var(--ds-text-heading-600-height-breakpoint-sm, 1.875rem)}@media screen and (min-width: 768px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-md, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-md, 2.125rem)}}@media screen and (min-width: 1024px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-lg, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-lg, 2.25rem)}}.heading--500{margin:1rem 0;font-size:var(--ds-text-heading-500-size-breakpoint-sm, 1.375rem);font-weight:var(--ds-text-heading-500-weight, 300);line-height:var(--ds-text-heading-500-height-breakpoint-sm, 1.625rem)}@media screen and (min-width: 768px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-md, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-md, 1.875rem)}}@media screen and (min-width: 1024px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-lg, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-lg, 2rem)}}.heading--400{margin:.75rem 0;font-size:var(--ds-text-heading-400-size, 1.25rem);font-weight:var(--ds-text-heading-400-weight, 300);line-height:var(--ds-text-heading-400-height, 1.625rem)}.heading--300{margin:.75rem 0;font-size:var(--ds-text-heading-300-size, 1.125rem);font-weight:var(--ds-text-heading-300-weight, 300);line-height:var(--ds-text-heading-300-height, 1.625rem)}:host([no-margin-block]) .heading{margin-block:0}.util_stackMarginnone--bottom{margin-bottom:0}.util_stackMargin25--bottom{margin-bottom:var(--ds-size-25, 0.125rem)}.util_stackMargin50--bottom{margin-bottom:var(--ds-size-50, 0.25rem)}.util_stackMargin100--bottom{margin-bottom:var(--ds-size-100, 0.5rem)}.util_stackMargin150--bottom{margin-bottom:var(--ds-size-150, 0.75rem)}.util_stackMargin200--bottom{margin-bottom:var(--ds-size-200, 1rem)}.util_stackMargin300--bottom{margin-bottom:var(--ds-size-300, 1.5rem)}.util_stackMargin400--bottom{margin-bottom:var(--ds-size-400, 2rem)}.util_stackMargin600--bottom{margin-bottom:var(--ds-size-600, 3rem)}.util_stackMargin800--bottom{margin-bottom:var(--ds-size-800, 4rem)}.util_stackMarginnone--top{margin-top:0}.util_stackMargin25--top{margin-top:var(--ds-size-25, 0.125rem)}.util_stackMargin50--top{margin-top:var(--ds-size-50, 0.25rem)}.util_stackMargin100--top{margin-top:var(--ds-size-100, 0.5rem)}.util_stackMargin150--top{margin-top:var(--ds-size-150, 0.75rem)}.util_stackMargin200--top{margin-top:var(--ds-size-200, 1rem)}.util_stackMargin300--top{margin-top:var(--ds-size-300, 1.5rem)}.util_stackMargin400--top{margin-top:var(--ds-size-400, 2rem)}.util_stackMargin600--top{margin-top:var(--ds-size-600, 3rem)}.util_stackMargin800--top{margin-top:var(--ds-size-800, 4rem)}`;
|
|
7091
|
+
var styleCss$5 = i$5`.heading{margin:1.75rem 0;letter-spacing:var(--ds-text-heading-default-spacing, -0.2px);font-weight:var(--ds-text-heading-default-weight, 500)}.heading--display{margin-top:0;font-size:var(--ds-text-heading-display-size-breakpoint-sm, 2.75rem);font-weight:var(--ds-text-heading-display-weight, 100);line-height:var(--ds-text-heading-display-height-breakpoint-sm, 3.375rem)}@media screen and (min-width: 768px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-md, 3rem);line-height:var(--ds-text-heading-display-height-breakpoint-md, 3.75rem)}}@media screen and (min-width: 1024px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-lg, 3.5rem);line-height:var(--ds-text-heading-display-height-breakpoint-lg, 4.25rem)}}.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-sm, 2rem);font-weight:var(--ds-text-heading-800-weight, 500);line-height:var(--ds-text-heading-800-height-breakpoint-sm, 2.375rem)}@media screen and (min-width: 768px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-md, 2.25rem);line-height:var(--ds-text-heading-800-height-breakpoint-md, 2.625rem)}}@media screen and (min-width: 1024px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-lg, 2.5rem);line-height:var(--ds-text-heading-800-height-breakpoint-lg, 3rem)}}.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-sm, 1.75rem);font-weight:var(--ds-text-heading-700-weight, 500);line-height:var(--ds-text-heading-700-height-breakpoint-sm, 2.125rem)}@media screen and (min-width: 768px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-md, 2rem);line-height:var(--ds-text-heading-700-height-breakpoint-md, 2.375rem)}}@media screen and (min-width: 1024px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-lg, 2.25rem);line-height:var(--ds-text-heading-700-height-breakpoint-lg, 2.75rem)}}.heading--600{margin:1rem 0;font-size:var(--ds-text-heading-600-size-breakpoint-sm, 1.625rem);font-weight:var(--ds-text-heading-600-weight, 300);line-height:var(--ds-text-heading-600-height-breakpoint-sm, 1.875rem)}@media screen and (min-width: 768px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-md, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-md, 2.125rem)}}@media screen and (min-width: 1024px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-lg, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-lg, 2.25rem)}}.heading--500{margin:1rem 0;font-size:var(--ds-text-heading-500-size-breakpoint-sm, 1.375rem);font-weight:var(--ds-text-heading-500-weight, 300);line-height:var(--ds-text-heading-500-height-breakpoint-sm, 1.625rem)}@media screen and (min-width: 768px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-md, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-md, 1.875rem)}}@media screen and (min-width: 1024px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-lg, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-lg, 2rem)}}.heading--400{margin:.75rem 0;font-size:var(--ds-text-heading-400-size, 1.25rem);font-weight:var(--ds-text-heading-400-weight, 300);line-height:var(--ds-text-heading-400-height, 1.625rem)}.heading--300{margin:.75rem 0;font-size:var(--ds-text-heading-300-size, 1.125rem);font-weight:var(--ds-text-heading-300-weight, 300);line-height:var(--ds-text-heading-300-height, 1.625rem)}:host([no-margin-block]) .heading{margin-block:0}.util_stackMarginnone--bottom{margin-bottom:0}.util_stackMargin25--bottom{margin-bottom:var(--ds-size-25, 0.125rem)}.util_stackMargin50--bottom{margin-bottom:var(--ds-size-50, 0.25rem)}.util_stackMargin100--bottom{margin-bottom:var(--ds-size-100, 0.5rem)}.util_stackMargin150--bottom{margin-bottom:var(--ds-size-150, 0.75rem)}.util_stackMargin200--bottom{margin-bottom:var(--ds-size-200, 1rem)}.util_stackMargin300--bottom{margin-bottom:var(--ds-size-300, 1.5rem)}.util_stackMargin400--bottom{margin-bottom:var(--ds-size-400, 2rem)}.util_stackMargin600--bottom{margin-bottom:var(--ds-size-600, 3rem)}.util_stackMargin800--bottom{margin-bottom:var(--ds-size-800, 4rem)}.util_stackMarginnone--top{margin-top:0}.util_stackMargin25--top{margin-top:var(--ds-size-25, 0.125rem)}.util_stackMargin50--top{margin-top:var(--ds-size-50, 0.25rem)}.util_stackMargin100--top{margin-top:var(--ds-size-100, 0.5rem)}.util_stackMargin150--top{margin-top:var(--ds-size-150, 0.75rem)}.util_stackMargin200--top{margin-top:var(--ds-size-200, 1rem)}.util_stackMargin300--top{margin-top:var(--ds-size-300, 1.5rem)}.util_stackMargin400--top{margin-top:var(--ds-size-400, 2rem)}.util_stackMargin600--top{margin-top:var(--ds-size-600, 3rem)}.util_stackMargin800--top{margin-top:var(--ds-size-800, 4rem)}`;
|
|
5398
7092
|
|
|
5399
7093
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5400
7094
|
// See LICENSE in the project root for license information.
|
|
@@ -5423,7 +7117,7 @@ class AuroHeader extends i$2 {
|
|
|
5423
7117
|
/**
|
|
5424
7118
|
* @private
|
|
5425
7119
|
*/
|
|
5426
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
7120
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$4();
|
|
5427
7121
|
}
|
|
5428
7122
|
|
|
5429
7123
|
// function to define props used within the scope of this component
|
|
@@ -5441,7 +7135,7 @@ class AuroHeader extends i$2 {
|
|
|
5441
7135
|
}
|
|
5442
7136
|
|
|
5443
7137
|
static get styles() {
|
|
5444
|
-
return [styleCss$
|
|
7138
|
+
return [styleCss$5];
|
|
5445
7139
|
}
|
|
5446
7140
|
|
|
5447
7141
|
/**
|
|
@@ -5453,7 +7147,7 @@ class AuroHeader extends i$2 {
|
|
|
5453
7147
|
*
|
|
5454
7148
|
*/
|
|
5455
7149
|
static register(name = "auro-header") {
|
|
5456
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroHeader);
|
|
7150
|
+
AuroLibraryRuntimeUtils$4.prototype.registerComponent(name, AuroHeader);
|
|
5457
7151
|
}
|
|
5458
7152
|
|
|
5459
7153
|
firstUpdated() {
|
|
@@ -5549,17 +7243,30 @@ class AuroBibtemplate extends i$2 {
|
|
|
5549
7243
|
|
|
5550
7244
|
this.large = false;
|
|
5551
7245
|
|
|
5552
|
-
AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-bibtemplate');
|
|
7246
|
+
AuroLibraryRuntimeUtils$3.prototype.handleComponentTagRename(this, 'auro-bibtemplate');
|
|
5553
7247
|
|
|
5554
7248
|
const versioning = new AuroDependencyVersioning();
|
|
7249
|
+
|
|
7250
|
+
/**
|
|
7251
|
+
* @private
|
|
7252
|
+
*/
|
|
5555
7253
|
this.iconTag = versioning.generateTag('auro-formkit-bibtemplate-icon', iconVersion$1, AuroIcon$1);
|
|
7254
|
+
|
|
7255
|
+
/**
|
|
7256
|
+
* @private
|
|
7257
|
+
*/
|
|
5556
7258
|
this.headerTag = versioning.generateTag('auro-formkit-bibtemplate-header', headerVersion, AuroHeader);
|
|
7259
|
+
|
|
7260
|
+
/**
|
|
7261
|
+
* @private
|
|
7262
|
+
*/
|
|
7263
|
+
this.buttonTag = versioning.generateTag('auro-formkit-input-button', buttonVersion, AuroButton);
|
|
5557
7264
|
}
|
|
5558
7265
|
|
|
5559
7266
|
static get styles() {
|
|
5560
7267
|
return [
|
|
5561
|
-
colorCss$
|
|
5562
|
-
styleCss$
|
|
7268
|
+
colorCss$3$1,
|
|
7269
|
+
styleCss$4$1,
|
|
5563
7270
|
tokenCss
|
|
5564
7271
|
];
|
|
5565
7272
|
}
|
|
@@ -5588,7 +7295,7 @@ class AuroBibtemplate extends i$2 {
|
|
|
5588
7295
|
*
|
|
5589
7296
|
*/
|
|
5590
7297
|
static register(name = "auro-bibtemplate") {
|
|
5591
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroBibtemplate);
|
|
7298
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroBibtemplate);
|
|
5592
7299
|
}
|
|
5593
7300
|
|
|
5594
7301
|
/**
|
|
@@ -5628,15 +7335,27 @@ class AuroBibtemplate extends i$2 {
|
|
|
5628
7335
|
this.setAttribute('exportparts', 'bibtemplate:dropdownBibTemplate');
|
|
5629
7336
|
}
|
|
5630
7337
|
|
|
7338
|
+
firstUpdated(changedProperties) {
|
|
7339
|
+
super.firstUpdated(changedProperties);
|
|
7340
|
+
|
|
7341
|
+
this.dispatchEvent(new CustomEvent("auro-bibtemplate-connected", {
|
|
7342
|
+
bubbles: true,
|
|
7343
|
+
composed: true,
|
|
7344
|
+
detail: {
|
|
7345
|
+
element: this
|
|
7346
|
+
}
|
|
7347
|
+
}));
|
|
7348
|
+
}
|
|
7349
|
+
|
|
5631
7350
|
// function that renders the HTML and CSS into the scope of the component
|
|
5632
7351
|
render() {
|
|
5633
7352
|
return u`
|
|
5634
7353
|
<div id="bibTemplate" part="bibtemplate">
|
|
5635
7354
|
${this.isFullscreen ? u`
|
|
5636
7355
|
<div id="headerContainer">
|
|
5637
|
-
|
|
7356
|
+
<${this.buttonTag} id="closeButton" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
5638
7357
|
<${this.iconTag} category="interface" name="x-lg"></${this.iconTag}>
|
|
5639
|
-
|
|
7358
|
+
</${this.buttonTag}>
|
|
5640
7359
|
<${this.headerTag} display="${this.large ? 'display' : '600'}" level="3" size="none" id="header" no-margin-block>
|
|
5641
7360
|
<slot name="header"></slot>
|
|
5642
7361
|
</${this.headerTag}>
|
|
@@ -5660,11 +7379,219 @@ class AuroBibtemplate extends i$2 {
|
|
|
5660
7379
|
|
|
5661
7380
|
var bibTemplateVersion = '1.0.0';
|
|
5662
7381
|
|
|
5663
|
-
i$5`:
|
|
7382
|
+
var colorCss$3 = i$5`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
7383
|
+
|
|
7384
|
+
var styleCss$4 = i$5`.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}`;
|
|
7385
|
+
|
|
7386
|
+
var tokensCss$2 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
7387
|
+
|
|
7388
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
7389
|
+
// See LICENSE in the project root for license information.
|
|
7390
|
+
|
|
7391
|
+
// ---------------------------------------------------------------------
|
|
7392
|
+
|
|
7393
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
7394
|
+
|
|
7395
|
+
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
7396
|
+
|
|
7397
|
+
/* eslint-disable jsdoc/require-param */
|
|
7398
|
+
|
|
7399
|
+
/**
|
|
7400
|
+
* This will register a new custom element with the browser.
|
|
7401
|
+
* @param {String} name - The name of the custom element.
|
|
7402
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
7403
|
+
* @returns {void}
|
|
7404
|
+
*/
|
|
7405
|
+
registerComponent(name, componentClass) {
|
|
7406
|
+
if (!customElements.get(name)) {
|
|
7407
|
+
customElements.define(name, class extends componentClass {});
|
|
7408
|
+
}
|
|
7409
|
+
}
|
|
7410
|
+
|
|
7411
|
+
/**
|
|
7412
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
7413
|
+
* @returns {void}
|
|
7414
|
+
*/
|
|
7415
|
+
closestElement(
|
|
7416
|
+
selector, // selector like in .closest()
|
|
7417
|
+
base = this, // extra functionality to skip a parent
|
|
7418
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
7419
|
+
!el || el === document || el === window
|
|
7420
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
7421
|
+
: found
|
|
7422
|
+
? found // found a selector INside this element
|
|
7423
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
7424
|
+
) {
|
|
7425
|
+
return __Closest(base);
|
|
7426
|
+
}
|
|
7427
|
+
/* eslint-enable jsdoc/require-param */
|
|
7428
|
+
|
|
7429
|
+
/**
|
|
7430
|
+
* 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.
|
|
7431
|
+
* @param {Object} elem - The element to check.
|
|
7432
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
7433
|
+
* @returns {void}
|
|
7434
|
+
*/
|
|
7435
|
+
handleComponentTagRename(elem, tagName) {
|
|
7436
|
+
const tag = tagName.toLowerCase();
|
|
7437
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
7438
|
+
|
|
7439
|
+
if (elemTag !== tag) {
|
|
7440
|
+
elem.setAttribute(tag, true);
|
|
7441
|
+
}
|
|
7442
|
+
}
|
|
7443
|
+
|
|
7444
|
+
/**
|
|
7445
|
+
* Validates if an element is a specific Auro component.
|
|
7446
|
+
* @param {Object} elem - The element to validate.
|
|
7447
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
7448
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
7449
|
+
*/
|
|
7450
|
+
elementMatch(elem, tagName) {
|
|
7451
|
+
const tag = tagName.toLowerCase();
|
|
7452
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
7453
|
+
|
|
7454
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
7455
|
+
}
|
|
7456
|
+
};
|
|
7457
|
+
|
|
7458
|
+
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7459
|
+
// See LICENSE in the project root for license information.
|
|
7460
|
+
|
|
7461
|
+
|
|
7462
|
+
/**
|
|
7463
|
+
* Displays help text or error messages within form elements - Internal Use Only.
|
|
7464
|
+
*
|
|
7465
|
+
* @attr { Boolean } large - If declared, make font-size to 1rem(16px).
|
|
7466
|
+
*/
|
|
7467
|
+
class AuroHelpText extends i$2 {
|
|
7468
|
+
|
|
7469
|
+
constructor() {
|
|
7470
|
+
super();
|
|
7471
|
+
|
|
7472
|
+
this.error = false;
|
|
7473
|
+
this.onDark = false;
|
|
7474
|
+
this.hasTextContent = false;
|
|
7475
|
+
|
|
7476
|
+
AuroLibraryRuntimeUtils$1.prototype.handleComponentTagRename(this, 'auro-helptext');
|
|
7477
|
+
}
|
|
7478
|
+
|
|
7479
|
+
static get styles() {
|
|
7480
|
+
return [
|
|
7481
|
+
colorCss$3,
|
|
7482
|
+
styleCss$4,
|
|
7483
|
+
tokensCss$2
|
|
7484
|
+
];
|
|
7485
|
+
}
|
|
7486
|
+
|
|
7487
|
+
// function to define props used within the scope of this component
|
|
7488
|
+
static get properties() {
|
|
7489
|
+
return {
|
|
7490
|
+
|
|
7491
|
+
/**
|
|
7492
|
+
* @private
|
|
7493
|
+
*/
|
|
7494
|
+
slotNodes: {
|
|
7495
|
+
type: Boolean,
|
|
7496
|
+
},
|
|
7497
|
+
|
|
7498
|
+
/**
|
|
7499
|
+
* @private
|
|
7500
|
+
*/
|
|
7501
|
+
hasTextContent: {
|
|
7502
|
+
type: Boolean,
|
|
7503
|
+
},
|
|
7504
|
+
|
|
7505
|
+
/**
|
|
7506
|
+
* If declared, make font color red.
|
|
7507
|
+
*/
|
|
7508
|
+
error: {
|
|
7509
|
+
type: Boolean,
|
|
7510
|
+
reflect: true,
|
|
7511
|
+
},
|
|
7512
|
+
|
|
7513
|
+
/**
|
|
7514
|
+
* If declared, will apply onDark styles.
|
|
7515
|
+
*/
|
|
7516
|
+
onDark: {
|
|
7517
|
+
type: Boolean,
|
|
7518
|
+
reflect: true
|
|
7519
|
+
}
|
|
7520
|
+
};
|
|
7521
|
+
}
|
|
7522
|
+
|
|
7523
|
+
/**
|
|
7524
|
+
* This will register this element with the browser.
|
|
7525
|
+
* @param {string} [name="auro-helptext"] - The name of element that you want to register to.
|
|
7526
|
+
*
|
|
7527
|
+
* @example
|
|
7528
|
+
* AuroCheckbox.register("custom-helptext") // this will register this element to <custom-helptext/>
|
|
7529
|
+
*
|
|
7530
|
+
*/
|
|
7531
|
+
static register(name = "auro-helptext") {
|
|
7532
|
+
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroHelpText);
|
|
7533
|
+
}
|
|
7534
|
+
|
|
7535
|
+
updated() {
|
|
7536
|
+
this.handleSlotChange();
|
|
7537
|
+
}
|
|
7538
|
+
|
|
7539
|
+
handleSlotChange(event) {
|
|
7540
|
+
if (event) {
|
|
7541
|
+
this.slotNodes = event.target.assignedNodes();
|
|
7542
|
+
}
|
|
7543
|
+
|
|
7544
|
+
this.hasTextContent = this.checkSlotsForContent(this.slotNodes);
|
|
7545
|
+
}
|
|
7546
|
+
|
|
7547
|
+
/**
|
|
7548
|
+
* Checks if any of the provided nodes or their nested slot nodes contain non-empty text content.
|
|
7549
|
+
*
|
|
7550
|
+
* @param {NodeList|Array} nodes - The list of nodes to check for content.
|
|
7551
|
+
* @returns {boolean} - Returns true if any node or nested slot node contains non-empty text content, otherwise false.
|
|
7552
|
+
* @private
|
|
7553
|
+
*/
|
|
7554
|
+
checkSlotsForContent(nodes) {
|
|
7555
|
+
if (!nodes) {
|
|
7556
|
+
return false;
|
|
7557
|
+
}
|
|
7558
|
+
|
|
7559
|
+
return nodes.some((node) => {
|
|
7560
|
+
if (node.textContent.trim()) {
|
|
7561
|
+
return true;
|
|
7562
|
+
}
|
|
7563
|
+
|
|
7564
|
+
if (!node.querySelector) {
|
|
7565
|
+
return false;
|
|
7566
|
+
}
|
|
7567
|
+
|
|
7568
|
+
const nestedSlot = node.tagName === 'SLOT' ? node : node.querySelector('slot');
|
|
7569
|
+
if (!nestedSlot) {
|
|
7570
|
+
return false;
|
|
7571
|
+
}
|
|
7572
|
+
|
|
7573
|
+
const nestedSlotNodes = nestedSlot.assignedNodes();
|
|
7574
|
+
return this.checkSlotsForContent(nestedSlotNodes);
|
|
7575
|
+
});
|
|
7576
|
+
}
|
|
7577
|
+
|
|
7578
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
7579
|
+
render() {
|
|
7580
|
+
return x`
|
|
7581
|
+
<div class="helptext-wrapper" ?visible="${this.hasTextContent}">
|
|
7582
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
7583
|
+
</div>
|
|
7584
|
+
`;
|
|
7585
|
+
}
|
|
7586
|
+
}
|
|
7587
|
+
|
|
7588
|
+
var helpTextVersion = '1.0.0';
|
|
7589
|
+
|
|
7590
|
+
i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:block;vertical-align:middle}:host .wrapper{box-sizing:border-box;display:inline-block;width:100%;margin:0;padding:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host [loadingplaceholder].empty{opacity:0;position:absolute}:host [loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;line-height:1;display:inline-block}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]){overflow-y:auto}:host([root]) .wrapper[class*=-lg]{padding:var(--ds-size-150, 0.75rem)}:host([root]) .wrapper[class*=-xl]{padding:var(--ds-size-200, 1rem)}`;
|
|
5664
7591
|
|
|
5665
7592
|
i$5`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-divider-color)}[loadingplaceholder] slot[name=loadingIcon]{color:var(--ds-auro-menu-loader-color)}[loadingplaceholder] slot[name=loadingText]{color:var(--ds-auro-menu-loader-text-color)}`;
|
|
5666
7593
|
|
|
5667
|
-
i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
7594
|
+
i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
5668
7595
|
|
|
5669
7596
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5670
7597
|
// See LICENSE in the project root for license information.
|
|
@@ -5711,9 +7638,9 @@ function arrayConverter(value) {
|
|
|
5711
7638
|
throw new Error('Invalid value: Input must be an array or undefined');
|
|
5712
7639
|
}
|
|
5713
7640
|
|
|
5714
|
-
i$5`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-
|
|
7641
|
+
i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem));padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-50, 0.25rem);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box],:host .wrapper[class*=shape-snowflake]{border-radius:unset}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem)}:host .wrapper[class*=-lg]:not(:last-child){margin-bottom:var(--ds-size-50, 0.25rem)}:host .wrapper[class*=-xl]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem)}:host .wrapper[class*=-xl]:not(:last-child){margin-bottom:var(--ds-size-100, 0.5rem)}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
5715
7642
|
|
|
5716
|
-
i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
7643
|
+
i$5`:host .wrapper{border:1px solid var(--ds-auro-menuoption-container-border-color);background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
5717
7644
|
|
|
5718
7645
|
i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, 0.75rem))}:host{color:currentColor;vertical-align:middle;line-height:1;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem) !important;width:var(--ds-auro-icon-size, 1.5rem) !important;height:var(--ds-auro-icon-size, 1.5rem) !important}.componentWrapper{display:flex}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.labelWrapper{margin-left:var(--ds-size-50, 0.25rem);line-height:1.8}`;
|
|
5719
7646
|
|
|
@@ -5721,7 +7648,7 @@ i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);-
|
|
|
5721
7648
|
|
|
5722
7649
|
i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
5723
7650
|
|
|
5724
|
-
var styleCss$3 = i$5
|
|
7651
|
+
var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}.mainContent{position:relative;display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;align-items:center;justify-content:center}::slotted([slot=typeIcon]){margin-right:8px}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;width:100%;align-items:center;justify-content:center}:host([layout*=emphasized]) .triggerContent,:host([layout*=snowflake]) .triggerContent{padding:0 8px 0 24px}:host([layout*=classic]) .triggerContent{padding:0 8px}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{cursor:text;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host([layout*=classic]) label.withValue{font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([layout*=classic]) .value{height:auto;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
|
|
5725
7652
|
|
|
5726
7653
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5727
7654
|
// See LICENSE in the project root for license information.
|
|
@@ -5734,16 +7661,19 @@ var styleCss$3 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.u
|
|
|
5734
7661
|
* @slot - Default slot for the menu content.
|
|
5735
7662
|
* @slot bib.fullscreen.headline - Defines the headline to display above menu-options
|
|
5736
7663
|
* @slot label - Defines the content of the label.
|
|
7664
|
+
* @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
5737
7665
|
* @slot helpText - Defines the content of the helpText.
|
|
5738
7666
|
* @slot placeholder - Defines the content of the placeholder to be shown when there is no value
|
|
7667
|
+
* @slot valueText - Dropdown value text display.
|
|
7668
|
+
* @slot displayValue - Allows custom HTML content to display the selected value when select is not focused.
|
|
5739
7669
|
* @event auroSelect-valueSet - Notifies that the component has a new value set.
|
|
5740
|
-
* @event input - Notifies every time the value prop of the element is changed.
|
|
7670
|
+
* @event input - Notifies every time the value prop of the element is changed. The updated `value` and `optionSelected` will be delivered in `detail` object.
|
|
5741
7671
|
* @event auroFormElement-validated - Notifies that the `validity` and `errorMessage` values have changed.
|
|
5742
7672
|
* @csspart helpText - Apply CSS to the help text.
|
|
5743
7673
|
*/
|
|
5744
7674
|
|
|
5745
7675
|
// build the component class
|
|
5746
|
-
class AuroSelect extends
|
|
7676
|
+
class AuroSelect extends AuroElement$4 {
|
|
5747
7677
|
constructor() {
|
|
5748
7678
|
super();
|
|
5749
7679
|
|
|
@@ -5753,12 +7683,25 @@ class AuroSelect extends i$2 {
|
|
|
5753
7683
|
const idSubstrEnd = 8;
|
|
5754
7684
|
const idSubstrStart = 2;
|
|
5755
7685
|
|
|
7686
|
+
this.matchWidth = false;
|
|
7687
|
+
|
|
7688
|
+
// Layout Config
|
|
7689
|
+
this.layout = 'snowflake';
|
|
7690
|
+
this.shape = 'snowflake';
|
|
7691
|
+
this.size = 'xl';
|
|
7692
|
+
|
|
5756
7693
|
// floaterConfig
|
|
5757
7694
|
this.placement = 'bottom-start';
|
|
5758
7695
|
this.offset = 0;
|
|
5759
7696
|
this.noFlip = false;
|
|
5760
7697
|
this.autoPlacement = false;
|
|
5761
7698
|
|
|
7699
|
+
this.forceDisplayValue = false;
|
|
7700
|
+
|
|
7701
|
+
this.layout = 'classic';
|
|
7702
|
+
this.shape = 'classic';
|
|
7703
|
+
this.size = 'xl';
|
|
7704
|
+
|
|
5762
7705
|
/**
|
|
5763
7706
|
* @private
|
|
5764
7707
|
*/
|
|
@@ -5774,7 +7717,7 @@ class AuroSelect extends i$2 {
|
|
|
5774
7717
|
/**
|
|
5775
7718
|
* @private
|
|
5776
7719
|
*/
|
|
5777
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
7720
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
5778
7721
|
|
|
5779
7722
|
/**
|
|
5780
7723
|
* Generate unique names for dependency components.
|
|
@@ -5791,10 +7734,25 @@ class AuroSelect extends i$2 {
|
|
|
5791
7734
|
*/
|
|
5792
7735
|
this.bibtemplateTag = versioning.generateTag('auro-formkit-select-bibtemplate', bibTemplateVersion, AuroBibtemplate);
|
|
5793
7736
|
|
|
7737
|
+
/**
|
|
7738
|
+
* @private
|
|
7739
|
+
*/
|
|
7740
|
+
this.helpTextTag = versioning.generateTag('auro-formkit-input-helptext', helpTextVersion, AuroHelpText);
|
|
7741
|
+
|
|
5794
7742
|
/**
|
|
5795
7743
|
* @private
|
|
5796
7744
|
*/
|
|
5797
7745
|
this.isHiddenWhileLoading = false;
|
|
7746
|
+
|
|
7747
|
+
/**
|
|
7748
|
+
* @private
|
|
7749
|
+
*/
|
|
7750
|
+
this.hasFocus = false;
|
|
7751
|
+
|
|
7752
|
+
/**
|
|
7753
|
+
* @private
|
|
7754
|
+
*/
|
|
7755
|
+
this.hasDisplayValueContent = false;
|
|
5798
7756
|
}
|
|
5799
7757
|
|
|
5800
7758
|
/**
|
|
@@ -5808,6 +7766,7 @@ class AuroSelect extends i$2 {
|
|
|
5808
7766
|
this.value = undefined;
|
|
5809
7767
|
this.fullscreenBreakpoint = 'sm';
|
|
5810
7768
|
this.onDark = false;
|
|
7769
|
+
this.isPopoverVisible = false;
|
|
5811
7770
|
}
|
|
5812
7771
|
|
|
5813
7772
|
// This function is to define props used within the scope of this component
|
|
@@ -5824,6 +7783,14 @@ class AuroSelect extends i$2 {
|
|
|
5824
7783
|
reflect: true
|
|
5825
7784
|
},
|
|
5826
7785
|
|
|
7786
|
+
/**
|
|
7787
|
+
* If declared, the label and value will be visually hidden and the displayValue will render 100% of the time.
|
|
7788
|
+
*/
|
|
7789
|
+
forceDisplayValue: {
|
|
7790
|
+
type: Boolean,
|
|
7791
|
+
reflect: true
|
|
7792
|
+
},
|
|
7793
|
+
|
|
5827
7794
|
/**
|
|
5828
7795
|
* If declared, bib's position will be automatically calculated where to appear.
|
|
5829
7796
|
* @default false
|
|
@@ -5842,21 +7809,29 @@ class AuroSelect extends i$2 {
|
|
|
5842
7809
|
},
|
|
5843
7810
|
|
|
5844
7811
|
/**
|
|
5845
|
-
*
|
|
7812
|
+
* @private
|
|
5846
7813
|
*/
|
|
5847
|
-
|
|
5848
|
-
type:
|
|
5849
|
-
reflect:
|
|
7814
|
+
isPopoverVisible: {
|
|
7815
|
+
type: Boolean,
|
|
7816
|
+
reflect: false
|
|
5850
7817
|
},
|
|
5851
7818
|
|
|
5852
7819
|
/**
|
|
5853
|
-
* If
|
|
7820
|
+
* If declared, the popover and trigger will be set to the same width.
|
|
5854
7821
|
*/
|
|
5855
|
-
|
|
7822
|
+
matchWidth: {
|
|
5856
7823
|
type: Boolean,
|
|
5857
7824
|
reflect: true
|
|
5858
7825
|
},
|
|
5859
7826
|
|
|
7827
|
+
/**
|
|
7828
|
+
* The name for the select element.
|
|
7829
|
+
*/
|
|
7830
|
+
name: {
|
|
7831
|
+
type: String,
|
|
7832
|
+
reflect: true
|
|
7833
|
+
},
|
|
7834
|
+
|
|
5860
7835
|
/**
|
|
5861
7836
|
* Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
|
|
5862
7837
|
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
@@ -5950,7 +7925,7 @@ class AuroSelect extends i$2 {
|
|
|
5950
7925
|
* "top" | "right" | "bottom" | "left" |
|
|
5951
7926
|
* "bottom-start" | "top-start" | "top-end" |
|
|
5952
7927
|
* "right-start" | "right-end" | "bottom-end" |
|
|
5953
|
-
* "left-start" | "left-end"
|
|
7928
|
+
* "left-start" | "left-end".
|
|
5954
7929
|
* @default bottom-start
|
|
5955
7930
|
*/
|
|
5956
7931
|
placement: {
|
|
@@ -6030,12 +8005,58 @@ class AuroSelect extends i$2 {
|
|
|
6030
8005
|
type: Boolean,
|
|
6031
8006
|
reflect: true,
|
|
6032
8007
|
attribute: false
|
|
6033
|
-
}
|
|
8008
|
+
},
|
|
8009
|
+
|
|
8010
|
+
/**
|
|
8011
|
+
* @private
|
|
8012
|
+
*/
|
|
8013
|
+
hasFocus: {
|
|
8014
|
+
type: Boolean,
|
|
8015
|
+
reflect: false,
|
|
8016
|
+
attribute: false
|
|
8017
|
+
},
|
|
8018
|
+
|
|
8019
|
+
/**
|
|
8020
|
+
* @private
|
|
8021
|
+
*/
|
|
8022
|
+
hasDisplayValueContent: {
|
|
8023
|
+
type: Boolean,
|
|
8024
|
+
reflect: false,
|
|
8025
|
+
attribute: false
|
|
8026
|
+
},
|
|
6034
8027
|
};
|
|
6035
8028
|
}
|
|
6036
8029
|
|
|
6037
8030
|
static get styles() {
|
|
6038
|
-
return [
|
|
8031
|
+
return [
|
|
8032
|
+
i$5`${shapeSizeCss$1}`,
|
|
8033
|
+
i$5`${tokensCss$5}`,
|
|
8034
|
+
i$5`${styleCss$3}`,
|
|
8035
|
+
];
|
|
8036
|
+
}
|
|
8037
|
+
|
|
8038
|
+
/**
|
|
8039
|
+
* Returns classmap configuration for html5 input labels in all layouts.
|
|
8040
|
+
* @private
|
|
8041
|
+
* @returns {void}
|
|
8042
|
+
*/
|
|
8043
|
+
get commonLabelClasses() {
|
|
8044
|
+
return {
|
|
8045
|
+
'is-disabled': this.disabled,
|
|
8046
|
+
'withValue': this.value && this.value.length > 0,
|
|
8047
|
+
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
8048
|
+
};
|
|
8049
|
+
}
|
|
8050
|
+
|
|
8051
|
+
/**
|
|
8052
|
+
* Returns classmap configuration for wrapper elements in each layout.
|
|
8053
|
+
* @private
|
|
8054
|
+
* @returns {object} - Returns classmap.
|
|
8055
|
+
*/
|
|
8056
|
+
get commonWrapperClasses() {
|
|
8057
|
+
return {
|
|
8058
|
+
'wrapper': true
|
|
8059
|
+
};
|
|
6039
8060
|
}
|
|
6040
8061
|
|
|
6041
8062
|
/**
|
|
@@ -6045,11 +8066,28 @@ class AuroSelect extends i$2 {
|
|
|
6045
8066
|
*/
|
|
6046
8067
|
configureDropdown() {
|
|
6047
8068
|
this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
|
|
6048
|
-
|
|
8069
|
+
|
|
8070
|
+
this.dropdown.addEventListener('auroDropdown-toggled', () => {
|
|
8071
|
+
this.isPopoverVisible = this.dropdown.isPopoverVisible;
|
|
8072
|
+
|
|
8073
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8074
|
+
// wait til the bib gets fully rendered
|
|
8075
|
+
setTimeout(() => {
|
|
8076
|
+
if (this.dropdown.isBibFullscreen) {
|
|
8077
|
+
// trigger holds the focus since menu is not a focusable element.
|
|
8078
|
+
this.dropdown.trigger.focus();
|
|
8079
|
+
|
|
8080
|
+
// default focus indicator on the first menu option
|
|
8081
|
+
if (this.menu.index < 0) {
|
|
8082
|
+
this.menu.navigateOptions('down');
|
|
8083
|
+
}
|
|
8084
|
+
}
|
|
8085
|
+
});
|
|
8086
|
+
}
|
|
8087
|
+
});
|
|
6049
8088
|
|
|
6050
8089
|
// setting up bibtemplate
|
|
6051
|
-
this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
|
|
6052
|
-
this.bibtemplate.append(this.menuWrapper);
|
|
8090
|
+
this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
|
|
6053
8091
|
|
|
6054
8092
|
if (this.customBibWidth) {
|
|
6055
8093
|
this.dropdown.dropdownWidth = this.customBibWidth;
|
|
@@ -6068,7 +8106,7 @@ class AuroSelect extends i$2 {
|
|
|
6068
8106
|
*
|
|
6069
8107
|
*/
|
|
6070
8108
|
static register(name = "auro-select") {
|
|
6071
|
-
AuroLibraryRuntimeUtils$
|
|
8109
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroSelect);
|
|
6072
8110
|
}
|
|
6073
8111
|
|
|
6074
8112
|
/**
|
|
@@ -6079,27 +8117,34 @@ class AuroSelect extends i$2 {
|
|
|
6079
8117
|
updateDisplayedValue() {
|
|
6080
8118
|
const triggerContentEl = this.dropdown.querySelector('#triggerFocus');
|
|
6081
8119
|
|
|
6082
|
-
// Clear
|
|
6083
|
-
const
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
triggerContentEl.appendChild(placeholder);
|
|
8120
|
+
// Clear out old value
|
|
8121
|
+
const valueElem = triggerContentEl.querySelector('#value');
|
|
8122
|
+
if (valueElem) {
|
|
8123
|
+
valueElem.innerHTML = '';
|
|
6087
8124
|
}
|
|
6088
8125
|
|
|
8126
|
+
const slot = this.shadowRoot.querySelector('slot[name="displayValue"]');
|
|
8127
|
+
const slottedElements = slot.assignedElements();
|
|
8128
|
+
|
|
8129
|
+
slottedElements.forEach((element) => {
|
|
8130
|
+
element.remove();
|
|
8131
|
+
});
|
|
8132
|
+
|
|
6089
8133
|
// Handle selected options
|
|
6090
8134
|
if (this.optionSelected) {
|
|
6091
|
-
let displayText = '';
|
|
6092
|
-
|
|
6093
8135
|
if (this.multiSelect && this.optionSelected.length > 0) {
|
|
6094
|
-
|
|
6095
|
-
|
|
8136
|
+
const displayText = this.optionSelected.map((option) => option.textContent).join(', ');
|
|
8137
|
+
|
|
8138
|
+
valueElem.textContent = displayText;
|
|
6096
8139
|
} else {
|
|
6097
|
-
|
|
6098
|
-
|
|
8140
|
+
valueElem.innerHTML = this.optionSelected.innerHTML;
|
|
8141
|
+
const displayValueEl = this.optionSelected.querySelector("[slot='displayValue']");
|
|
6099
8142
|
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
8143
|
+
if (displayValueEl) {
|
|
8144
|
+
this.appendChild(displayValueEl.cloneNode(true));
|
|
8145
|
+
}
|
|
8146
|
+
this.hasDisplayValueContent = displayValueEl !== null;
|
|
8147
|
+
}
|
|
6103
8148
|
}
|
|
6104
8149
|
|
|
6105
8150
|
this.dropdown.requestUpdate();
|
|
@@ -6121,6 +8166,15 @@ class AuroSelect extends i$2 {
|
|
|
6121
8166
|
return;
|
|
6122
8167
|
}
|
|
6123
8168
|
|
|
8169
|
+
// set menu's default size if there it's not specified.
|
|
8170
|
+
if (!this.menu.getAttribute('size')) {
|
|
8171
|
+
this.menu.setAttribute('size', this.layout !== 'emphasized' ? 'md' : this.size);
|
|
8172
|
+
}
|
|
8173
|
+
|
|
8174
|
+
if (!this.getAttribute('shape')) {
|
|
8175
|
+
this.menu.setAttribute('shape', this.layout === 'classic' ? 'box' : this.shape);
|
|
8176
|
+
}
|
|
8177
|
+
|
|
6124
8178
|
if (this.multiSelect) {
|
|
6125
8179
|
this.menu.multiSelect = this.multiSelect;
|
|
6126
8180
|
}
|
|
@@ -6178,50 +8232,60 @@ class AuroSelect extends i$2 {
|
|
|
6178
8232
|
* @returns {void}
|
|
6179
8233
|
*/
|
|
6180
8234
|
configureSelect() {
|
|
6181
|
-
// inject menu into menuWrapper
|
|
6182
|
-
this.menuWrapper.append(this.menu);
|
|
6183
8235
|
|
|
6184
8236
|
this.addEventListener('keydown', (evt) => {
|
|
6185
|
-
|
|
6186
|
-
|
|
8237
|
+
// when the focus is on trigger not on close button
|
|
8238
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8239
|
+
if (evt.key === 'ArrowUp') {
|
|
8240
|
+
evt.preventDefault();
|
|
6187
8241
|
|
|
6188
|
-
|
|
8242
|
+
this.dropdown.show();
|
|
6189
8243
|
|
|
6190
|
-
|
|
6191
|
-
|
|
8244
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8245
|
+
this.menu.navigateOptions('up');
|
|
8246
|
+
}
|
|
8247
|
+
|
|
8248
|
+
return;
|
|
6192
8249
|
}
|
|
6193
8250
|
|
|
6194
|
-
|
|
6195
|
-
|
|
8251
|
+
if (evt.key === 'ArrowDown') {
|
|
8252
|
+
evt.preventDefault();
|
|
6196
8253
|
|
|
6197
|
-
|
|
6198
|
-
evt.preventDefault();
|
|
8254
|
+
this.dropdown.show();
|
|
6199
8255
|
|
|
6200
|
-
|
|
8256
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8257
|
+
this.menu.navigateOptions('down');
|
|
8258
|
+
}
|
|
6201
8259
|
|
|
6202
|
-
|
|
6203
|
-
this.menu.navigateOptions('down');
|
|
8260
|
+
return;
|
|
6204
8261
|
}
|
|
6205
8262
|
|
|
6206
|
-
|
|
6207
|
-
|
|
8263
|
+
if (evt.key === 'Enter') {
|
|
8264
|
+
if (!this.dropdown.isPopoverVisible) {
|
|
8265
|
+
evt.preventDefault();
|
|
8266
|
+
this.menu.makeSelection();
|
|
8267
|
+
}
|
|
6208
8268
|
|
|
6209
|
-
|
|
6210
|
-
if (!this.dropdown.isPopoverVisible) {
|
|
6211
|
-
evt.preventDefault();
|
|
6212
|
-
this.menu.makeSelection();
|
|
8269
|
+
return;
|
|
6213
8270
|
}
|
|
6214
|
-
|
|
6215
|
-
return;
|
|
6216
8271
|
}
|
|
6217
8272
|
|
|
6218
|
-
if (evt.key === 'Tab') {
|
|
8273
|
+
if (evt.key === 'Tab' && this.dropdown.isPopoverVisible) {
|
|
6219
8274
|
if (this.dropdown.isBibFullscreen) {
|
|
6220
8275
|
evt.preventDefault();
|
|
8276
|
+
|
|
8277
|
+
// when the focus is on trigger not on close button
|
|
8278
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8279
|
+
// `dropdown.focus` will move focus to the first focusable element in bib when it's open,
|
|
8280
|
+
// when bib it not open, it will focus onto trigger.
|
|
8281
|
+
this.dropdown.focus();
|
|
8282
|
+
} else {
|
|
8283
|
+
// when close button has the focus, move focus back to the trigger
|
|
8284
|
+
this.dropdown.trigger.focus();
|
|
8285
|
+
}
|
|
6221
8286
|
} else {
|
|
6222
8287
|
this.dropdown.hide();
|
|
6223
8288
|
}
|
|
6224
|
-
|
|
6225
8289
|
return;
|
|
6226
8290
|
}
|
|
6227
8291
|
|
|
@@ -6233,6 +8297,7 @@ class AuroSelect extends i$2 {
|
|
|
6233
8297
|
|
|
6234
8298
|
this.addEventListener('blur', () => {
|
|
6235
8299
|
this.validation.validate(this);
|
|
8300
|
+
this.hasFocus = false;
|
|
6236
8301
|
});
|
|
6237
8302
|
}
|
|
6238
8303
|
|
|
@@ -6308,6 +8373,7 @@ class AuroSelect extends i$2 {
|
|
|
6308
8373
|
*/
|
|
6309
8374
|
handleFocusin() {
|
|
6310
8375
|
|
|
8376
|
+
this.hasFocus = true;
|
|
6311
8377
|
this.touched = true;
|
|
6312
8378
|
}
|
|
6313
8379
|
|
|
@@ -6384,17 +8450,32 @@ class AuroSelect extends i$2 {
|
|
|
6384
8450
|
// Add the tag name as an attribute if it is different than the component name
|
|
6385
8451
|
this.runtimeUtils.handleComponentTagRename(this, 'auro-select');
|
|
6386
8452
|
|
|
6387
|
-
this.configureMenu();
|
|
6388
8453
|
this.configureDropdown();
|
|
8454
|
+
this.configureMenu();
|
|
6389
8455
|
this.configureSelect();
|
|
6390
8456
|
|
|
6391
8457
|
// Set the initial value in auro-menu if defined
|
|
6392
8458
|
if (this.hasAttribute('value') && this.getAttribute('value').length > 0) {
|
|
6393
8459
|
this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
|
|
6394
|
-
this.menu
|
|
8460
|
+
if (this.menu) {
|
|
8461
|
+
this.menu.value = this.value;
|
|
8462
|
+
}
|
|
6395
8463
|
}
|
|
6396
8464
|
}
|
|
6397
8465
|
|
|
8466
|
+
/**
|
|
8467
|
+
* Update the menu value. With checks for menu existence. Awaits value update.
|
|
8468
|
+
* @param {string} value - The value to set in the menu.
|
|
8469
|
+
* @returns void
|
|
8470
|
+
* @private
|
|
8471
|
+
*/
|
|
8472
|
+
async updateMenuValue(value) {
|
|
8473
|
+
if (!this.menu) return;
|
|
8474
|
+
|
|
8475
|
+
this.menu.value = value;
|
|
8476
|
+
await this.menu.updateComplete;
|
|
8477
|
+
}
|
|
8478
|
+
|
|
6398
8479
|
async updated(changedProperties) {
|
|
6399
8480
|
if (changedProperties.has('multiSelect')) {
|
|
6400
8481
|
this.clearSelection();
|
|
@@ -6404,14 +8485,13 @@ class AuroSelect extends i$2 {
|
|
|
6404
8485
|
if (this.value) {
|
|
6405
8486
|
this.value = this.multiSelect ? arrayConverter(this.value) : this.value;
|
|
6406
8487
|
|
|
6407
|
-
this.
|
|
6408
|
-
|
|
6409
|
-
// Wait for menu to finish updating its value
|
|
6410
|
-
await this.menu.updateComplete;
|
|
8488
|
+
await this.updateMenuValue(this.value);
|
|
6411
8489
|
|
|
6412
|
-
|
|
8490
|
+
if (this.menu) {
|
|
8491
|
+
this.optionSelected = this.menu.optionSelected;
|
|
8492
|
+
}
|
|
6413
8493
|
} else {
|
|
6414
|
-
this.
|
|
8494
|
+
await this.updateMenuValue(undefined);
|
|
6415
8495
|
}
|
|
6416
8496
|
|
|
6417
8497
|
this._updateNativeSelect();
|
|
@@ -6428,6 +8508,10 @@ class AuroSelect extends i$2 {
|
|
|
6428
8508
|
bubbles: true,
|
|
6429
8509
|
cancelable: true,
|
|
6430
8510
|
composed: true,
|
|
8511
|
+
detail: {
|
|
8512
|
+
optionSelected: this.optionSelected,
|
|
8513
|
+
value: this.value
|
|
8514
|
+
}
|
|
6431
8515
|
}));
|
|
6432
8516
|
}
|
|
6433
8517
|
|
|
@@ -6438,6 +8522,14 @@ class AuroSelect extends i$2 {
|
|
|
6438
8522
|
if (changedProperties.has('error')) {
|
|
6439
8523
|
this.validate(true);
|
|
6440
8524
|
}
|
|
8525
|
+
|
|
8526
|
+
if (changedProperties.has('shape') && this.menu) {
|
|
8527
|
+
this.menu.setAttribute('shape', this.layout === 'classic' ? 'box' : this.shape);
|
|
8528
|
+
}
|
|
8529
|
+
|
|
8530
|
+
if (changedProperties.has('size') && this.menu) {
|
|
8531
|
+
this.menu.setAttribute('size', this.layout !== 'emphasized' ? 'md' : this.size);
|
|
8532
|
+
}
|
|
6441
8533
|
}
|
|
6442
8534
|
|
|
6443
8535
|
/**
|
|
@@ -6462,53 +8554,400 @@ class AuroSelect extends i$2 {
|
|
|
6462
8554
|
* Validates value.
|
|
6463
8555
|
* @param {boolean} [force=false] - Whether to force validation.
|
|
6464
8556
|
*/
|
|
6465
|
-
validate(force = false) {
|
|
6466
|
-
this.validation.validate(this, force);
|
|
8557
|
+
validate(force = false) {
|
|
8558
|
+
this.validation.validate(this, force);
|
|
8559
|
+
}
|
|
8560
|
+
|
|
8561
|
+
/**
|
|
8562
|
+
* Syncs the value from the native select element to the component's value.
|
|
8563
|
+
* @param {Event} event // The change event from the native select element.
|
|
8564
|
+
* @returns {void}
|
|
8565
|
+
* @private
|
|
8566
|
+
*/
|
|
8567
|
+
_handleNativeSelectChange(event) {
|
|
8568
|
+
const selectedOption = event.target.options[event.target.selectedIndex];
|
|
8569
|
+
const selectedValue = selectedOption.value;
|
|
8570
|
+
|
|
8571
|
+
if (this.multiSelect) {
|
|
8572
|
+
const currentArray = Array.isArray(this.value) ? this.value : [];
|
|
8573
|
+
|
|
8574
|
+
if (!currentArray.includes(selectedValue)) {
|
|
8575
|
+
this.value = [
|
|
8576
|
+
...currentArray,
|
|
8577
|
+
selectedValue
|
|
8578
|
+
];
|
|
8579
|
+
}
|
|
8580
|
+
} else {
|
|
8581
|
+
const currentValue = this.value;
|
|
8582
|
+
|
|
8583
|
+
if (currentValue !== selectedValue) {
|
|
8584
|
+
this.value = selectedValue;
|
|
8585
|
+
}
|
|
8586
|
+
}
|
|
8587
|
+
}
|
|
8588
|
+
|
|
8589
|
+
/**
|
|
8590
|
+
* Updates the native select element's value based on the component's value.
|
|
8591
|
+
* @returns {void}
|
|
8592
|
+
* @private
|
|
8593
|
+
*/
|
|
8594
|
+
_updateNativeSelect() {
|
|
8595
|
+
const nativeSelect = this.shadowRoot.querySelector('select');
|
|
8596
|
+
if (!nativeSelect) {
|
|
8597
|
+
return;
|
|
8598
|
+
}
|
|
8599
|
+
|
|
8600
|
+
if (this.multiSelect) {
|
|
8601
|
+
nativeSelect.value = this.value ? this.value[0] : '';
|
|
8602
|
+
} else {
|
|
8603
|
+
nativeSelect.value = this.value || '';
|
|
8604
|
+
}
|
|
8605
|
+
}
|
|
8606
|
+
|
|
8607
|
+
renderAriaHtml() {
|
|
8608
|
+
return u`
|
|
8609
|
+
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
8610
|
+
${this.optionActive && this.options.length > 0
|
|
8611
|
+
? u`
|
|
8612
|
+
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
8613
|
+
`
|
|
8614
|
+
: undefined
|
|
8615
|
+
};
|
|
8616
|
+
|
|
8617
|
+
${this.optionSelected && this.options.length > 0
|
|
8618
|
+
? u`
|
|
8619
|
+
${`${this.optionSelected.innerText} selected`}
|
|
8620
|
+
`
|
|
8621
|
+
: undefined
|
|
8622
|
+
};
|
|
8623
|
+
</div>
|
|
8624
|
+
`;
|
|
8625
|
+
}
|
|
8626
|
+
|
|
8627
|
+
renderNativeSelect() {
|
|
8628
|
+
return u`
|
|
8629
|
+
<div class="nativeSelectWrapper util_displayHidden">
|
|
8630
|
+
<select
|
|
8631
|
+
tabindex="-1"
|
|
8632
|
+
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
8633
|
+
name="${this.name || ''}"
|
|
8634
|
+
?disabled="${this.disabled}"
|
|
8635
|
+
?required="${this.required}"
|
|
8636
|
+
aria-hidden="true"
|
|
8637
|
+
autocomplete="${o(this.autocomplete)}"
|
|
8638
|
+
@change="${this._handleNativeSelectChange}">
|
|
8639
|
+
<option value="" ?selected="${!this.value}"></option>
|
|
8640
|
+
${this.options.map((option) => {
|
|
8641
|
+
const optionValue = option.value || option.textContent;
|
|
8642
|
+
return u`
|
|
8643
|
+
<option
|
|
8644
|
+
value="${optionValue}"
|
|
8645
|
+
?selected="${this.value === optionValue}">
|
|
8646
|
+
${option.textContent}
|
|
8647
|
+
</option>
|
|
8648
|
+
`;
|
|
8649
|
+
})}
|
|
8650
|
+
</select>
|
|
8651
|
+
</div>
|
|
8652
|
+
`;
|
|
8653
|
+
}
|
|
8654
|
+
|
|
8655
|
+
/**
|
|
8656
|
+
* Returns HTML for the help text and error message.
|
|
8657
|
+
* @private
|
|
8658
|
+
* @returns {html} - Returns HTML for the help text and error message.
|
|
8659
|
+
*/
|
|
8660
|
+
renderHtmlHelpText() {
|
|
8661
|
+
return u`
|
|
8662
|
+
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
8663
|
+
? u`
|
|
8664
|
+
<${this.helpTextTag} ?onDark="${this.onDark}">
|
|
8665
|
+
<p id="${this.uniqueId}" part="helpText">
|
|
8666
|
+
<slot name="helpText"></slot>
|
|
8667
|
+
</p>
|
|
8668
|
+
</${this.helpTextTag}>
|
|
8669
|
+
`
|
|
8670
|
+
: u`
|
|
8671
|
+
<${this.helpTextTag} error ?onDark="${this.onDark}">
|
|
8672
|
+
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
8673
|
+
ERROR MESSAGE ${this.errorMessage}
|
|
8674
|
+
</p>
|
|
8675
|
+
</${this.helpTextTag}>
|
|
8676
|
+
`
|
|
8677
|
+
}
|
|
8678
|
+
`;
|
|
8679
|
+
}
|
|
8680
|
+
|
|
8681
|
+
/**
|
|
8682
|
+
* Returns HTML for the emphasized layout.
|
|
8683
|
+
* @private
|
|
8684
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the emphasized layout.
|
|
8685
|
+
*/
|
|
8686
|
+
renderLayoutEmphasized() {
|
|
8687
|
+
const placeholderClass = {
|
|
8688
|
+
hidden: this.value,
|
|
8689
|
+
};
|
|
8690
|
+
|
|
8691
|
+
const displayValueClasses = {
|
|
8692
|
+
'displayValue': true,
|
|
8693
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8694
|
+
'hasFocus': this.isPopoverVisible,
|
|
8695
|
+
'withValue': this.value && this.value.length > 0,
|
|
8696
|
+
'force': this.forceDisplayValue,
|
|
8697
|
+
};
|
|
8698
|
+
|
|
8699
|
+
const valueContainerClasses = {
|
|
8700
|
+
'valueContainer': true,
|
|
8701
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
8702
|
+
};
|
|
8703
|
+
|
|
8704
|
+
return u`
|
|
8705
|
+
<div
|
|
8706
|
+
class="${e(this.commonWrapperClasses)}"
|
|
8707
|
+
part="wrapper">
|
|
8708
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8709
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8710
|
+
</div>
|
|
8711
|
+
<${this.dropdownTag}
|
|
8712
|
+
a11yRole="select"
|
|
8713
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8714
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8715
|
+
?matchWidth="${this.matchWidth}"
|
|
8716
|
+
?noFlip="${this.noFlip}"
|
|
8717
|
+
?onDark="${this.onDark}"
|
|
8718
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8719
|
+
.offset="${this.offset}"
|
|
8720
|
+
.placement="${this.placement}"
|
|
8721
|
+
chevron
|
|
8722
|
+
fluid
|
|
8723
|
+
for="selectMenu"
|
|
8724
|
+
layout="${this.layout}"
|
|
8725
|
+
part="dropdown"
|
|
8726
|
+
shape="${this.shape}"
|
|
8727
|
+
size="${this.size}">
|
|
8728
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8729
|
+
<div class="accents left">
|
|
8730
|
+
<slot name="typeIcon"></slot>
|
|
8731
|
+
</div>
|
|
8732
|
+
<div class="mainContent">
|
|
8733
|
+
<div class="${e(valueContainerClasses)}">
|
|
8734
|
+
<label class="${e(this.commonLabelClasses)}">
|
|
8735
|
+
<slot name="label"></slot>
|
|
8736
|
+
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8737
|
+
</label>
|
|
8738
|
+
<div class="value" id="value"></div>
|
|
8739
|
+
${this.value ? undefined : u`
|
|
8740
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8741
|
+
<slot name="placeholder"></slot>
|
|
8742
|
+
</div>
|
|
8743
|
+
`}
|
|
8744
|
+
</div>
|
|
8745
|
+
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8746
|
+
<slot name="displayValue"></slot>
|
|
8747
|
+
</div>
|
|
8748
|
+
</div>
|
|
8749
|
+
<div class="accents right"></div>
|
|
8750
|
+
</div>
|
|
8751
|
+
<div class="menuWrapper"></div>
|
|
8752
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8753
|
+
<slot></slot>
|
|
8754
|
+
</${this.bibtemplateTag}>
|
|
8755
|
+
<div slot="helpText">
|
|
8756
|
+
${this.renderHtmlHelpText()}
|
|
8757
|
+
</div>
|
|
8758
|
+
</${this.dropdownTag}>
|
|
8759
|
+
</div>
|
|
8760
|
+
`;
|
|
8761
|
+
}
|
|
8762
|
+
|
|
8763
|
+
/**
|
|
8764
|
+
* Returns HTML for the snowflake layout.
|
|
8765
|
+
* @private
|
|
8766
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the snowflake layout.
|
|
8767
|
+
*/
|
|
8768
|
+
renderLayoutSnowflake() {
|
|
8769
|
+
const placeholderClass = {
|
|
8770
|
+
hidden: this.value,
|
|
8771
|
+
};
|
|
8772
|
+
|
|
8773
|
+
const displayValueClasses = {
|
|
8774
|
+
'displayValue': true,
|
|
8775
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8776
|
+
'hasFocus': this.isPopoverVisible,
|
|
8777
|
+
'withValue': this.value && this.value.length > 0,
|
|
8778
|
+
'force': this.forceDisplayValue,
|
|
8779
|
+
};
|
|
8780
|
+
|
|
8781
|
+
const valueContainerClasses = {
|
|
8782
|
+
'valueContainer': true,
|
|
8783
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
8784
|
+
};
|
|
8785
|
+
|
|
8786
|
+
return u`
|
|
8787
|
+
<div
|
|
8788
|
+
class="${e(this.commonWrapperClasses)}"
|
|
8789
|
+
part="wrapper">
|
|
8790
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8791
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8792
|
+
</div>
|
|
8793
|
+
<${this.dropdownTag}
|
|
8794
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8795
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8796
|
+
?matchWidth="${this.matchWidth}"
|
|
8797
|
+
?noFlip="${this.noFlip}"
|
|
8798
|
+
?onDark="${this.onDark}"
|
|
8799
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8800
|
+
.offset="${this.offset}"
|
|
8801
|
+
.placement="${this.placement}"
|
|
8802
|
+
chevron
|
|
8803
|
+
fluid
|
|
8804
|
+
for="selectMenu"
|
|
8805
|
+
layout="${this.layout}"
|
|
8806
|
+
part="dropdown"
|
|
8807
|
+
shape="${this.shape}"
|
|
8808
|
+
size="${this.size}">
|
|
8809
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8810
|
+
<div class="accents left">
|
|
8811
|
+
<slot name="typeIcon"></slot>
|
|
8812
|
+
</div>
|
|
8813
|
+
<div class="mainContent">
|
|
8814
|
+
<div class="${e(valueContainerClasses)}">
|
|
8815
|
+
<label class="${e(this.commonLabelClasses)}">
|
|
8816
|
+
<slot name="label"></slot>
|
|
8817
|
+
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8818
|
+
</label>
|
|
8819
|
+
<div class="value" id="value"></div>
|
|
8820
|
+
${this.value ? undefined : u`
|
|
8821
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8822
|
+
<slot name="placeholder"></slot>
|
|
8823
|
+
</div>
|
|
8824
|
+
`}
|
|
8825
|
+
</div>
|
|
8826
|
+
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8827
|
+
<slot name="displayValue"></slot>
|
|
8828
|
+
</div>
|
|
8829
|
+
</div>
|
|
8830
|
+
<div class="accents right"></div>
|
|
8831
|
+
</div>
|
|
8832
|
+
<div class="menuWrapper"></div>
|
|
8833
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8834
|
+
<slot></slot>
|
|
8835
|
+
</${this.bibtemplateTag}>
|
|
8836
|
+
<div slot="helpText">
|
|
8837
|
+
${this.renderHtmlHelpText()}
|
|
8838
|
+
</div>
|
|
8839
|
+
</${this.dropdownTag}>
|
|
8840
|
+
${this.renderNativeSelect()}
|
|
8841
|
+
</div>
|
|
8842
|
+
`;
|
|
6467
8843
|
}
|
|
6468
8844
|
|
|
6469
8845
|
/**
|
|
6470
|
-
*
|
|
6471
|
-
* @param {Event} event // The change event from the native select element.
|
|
6472
|
-
* @returns {void}
|
|
8846
|
+
* Returns HTML for the classic layout.
|
|
6473
8847
|
* @private
|
|
8848
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the classic layout.
|
|
6474
8849
|
*/
|
|
6475
|
-
|
|
6476
|
-
const
|
|
6477
|
-
|
|
8850
|
+
renderLayoutClassic() {
|
|
8851
|
+
const placeholderClass = {
|
|
8852
|
+
hidden: this.value,
|
|
8853
|
+
};
|
|
6478
8854
|
|
|
6479
|
-
|
|
6480
|
-
|
|
8855
|
+
const displayValueClasses = {
|
|
8856
|
+
'displayValue': true,
|
|
8857
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8858
|
+
'hasFocus': this.isPopoverVisible,
|
|
8859
|
+
'withValue': this.value && this.value.length > 0,
|
|
8860
|
+
'force': this.forceDisplayValue,
|
|
8861
|
+
};
|
|
6481
8862
|
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
];
|
|
6487
|
-
}
|
|
6488
|
-
} else {
|
|
6489
|
-
const currentValue = this.value;
|
|
8863
|
+
const valueContainerClasses = {
|
|
8864
|
+
'valueContainer': true,
|
|
8865
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
8866
|
+
};
|
|
6490
8867
|
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
8868
|
+
return u`
|
|
8869
|
+
<div
|
|
8870
|
+
class="${e(this.commonWrapperClasses)}"
|
|
8871
|
+
part="wrapper">
|
|
8872
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8873
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8874
|
+
</div>
|
|
8875
|
+
<${this.dropdownTag}
|
|
8876
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8877
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8878
|
+
?matchWidth="${!this.flexMenuWidth}"
|
|
8879
|
+
?noFlip="${this.noFlip}"
|
|
8880
|
+
?onDark="${this.onDark}"
|
|
8881
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8882
|
+
.offset="${this.offset}"
|
|
8883
|
+
.placement="${this.placement}"
|
|
8884
|
+
chevron
|
|
8885
|
+
fluid
|
|
8886
|
+
for="selectMenu"
|
|
8887
|
+
layout="${this.layout}"
|
|
8888
|
+
part="dropdown"
|
|
8889
|
+
shape="${this.shape}"
|
|
8890
|
+
size="${this.size}">
|
|
8891
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8892
|
+
<div class="accents left">
|
|
8893
|
+
<slot name="typeIcon"></slot>
|
|
8894
|
+
</div>
|
|
8895
|
+
<div class="mainContent">
|
|
8896
|
+
<div class="${e(valueContainerClasses)}">
|
|
8897
|
+
<label class="${e(this.commonLabelClasses)}">
|
|
8898
|
+
<slot name="label"></slot>
|
|
8899
|
+
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8900
|
+
</label>
|
|
8901
|
+
<div class="value" id="value"></div>
|
|
8902
|
+
${this.value ? undefined : u`
|
|
8903
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8904
|
+
<slot name="placeholder"></slot>
|
|
8905
|
+
</div>
|
|
8906
|
+
`}
|
|
8907
|
+
</div>
|
|
8908
|
+
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8909
|
+
<slot name="displayValue"></slot>
|
|
8910
|
+
</div>
|
|
8911
|
+
</div>
|
|
8912
|
+
<div class="accents right"></div>
|
|
8913
|
+
</div>
|
|
8914
|
+
<div class="menuWrapper"></div>
|
|
8915
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8916
|
+
<slot></slot>
|
|
8917
|
+
</${this.bibtemplateTag}>
|
|
8918
|
+
<div slot="helpText">
|
|
8919
|
+
${this.renderHtmlHelpText()}
|
|
8920
|
+
</div>
|
|
8921
|
+
</${this.dropdownTag}>
|
|
8922
|
+
${this.renderNativeSelect()}
|
|
8923
|
+
</div>
|
|
8924
|
+
`;
|
|
6495
8925
|
}
|
|
6496
8926
|
|
|
6497
8927
|
/**
|
|
6498
|
-
*
|
|
6499
|
-
* @returns {void}
|
|
8928
|
+
* Logic to determine the layout of the component.
|
|
6500
8929
|
* @private
|
|
8930
|
+
* @param {string} [ForcedLayout] - Used to force a specific layout, pass in the layout name to use.
|
|
8931
|
+
* @returns {void}
|
|
6501
8932
|
*/
|
|
6502
|
-
|
|
6503
|
-
const
|
|
6504
|
-
if (!nativeSelect) {
|
|
6505
|
-
return;
|
|
6506
|
-
}
|
|
8933
|
+
renderLayout(ForcedLayout) {
|
|
8934
|
+
const layout = ForcedLayout || this.layout;
|
|
6507
8935
|
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
8936
|
+
switch (layout) {
|
|
8937
|
+
case 'emphasized':
|
|
8938
|
+
return this.renderLayoutEmphasized();
|
|
8939
|
+
case 'emphasized-left':
|
|
8940
|
+
return this.renderLayoutEmphasized();
|
|
8941
|
+
case 'emphasized-right':
|
|
8942
|
+
return this.renderLayoutEmphasized();
|
|
8943
|
+
case 'snowflake':
|
|
8944
|
+
return this.renderLayoutSnowflake();
|
|
8945
|
+
case 'snowflake-left':
|
|
8946
|
+
return this.renderLayoutSnowflake();
|
|
8947
|
+
case 'snowflake-right':
|
|
8948
|
+
return this.renderLayoutSnowflake();
|
|
8949
|
+
default:
|
|
8950
|
+
return this.renderLayoutClassic();
|
|
6512
8951
|
}
|
|
6513
8952
|
}
|
|
6514
8953
|
|
|
@@ -6516,7 +8955,7 @@ class AuroSelect extends i$2 {
|
|
|
6516
8955
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
6517
8956
|
|
|
6518
8957
|
// function that renders the HTML and CSS into the scope of the component
|
|
6519
|
-
|
|
8958
|
+
renderBACKUP() {
|
|
6520
8959
|
const placeholderClass = {
|
|
6521
8960
|
hidden: this.value,
|
|
6522
8961
|
};
|
|
@@ -6542,29 +8981,37 @@ class AuroSelect extends i$2 {
|
|
|
6542
8981
|
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
6543
8982
|
</div>
|
|
6544
8983
|
<${this.dropdownTag}
|
|
6545
|
-
|
|
8984
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8985
|
+
?disabled="${this.disabled}"
|
|
6546
8986
|
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8987
|
+
?matchWidth="${this.matchWidth}"
|
|
8988
|
+
?noFlip="${this.noFlip}"
|
|
6547
8989
|
?onDark="${this.onDark}"
|
|
6548
|
-
common
|
|
6549
|
-
fluid
|
|
6550
8990
|
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
6551
|
-
?matchWidth="${!this.flexMenuWidth}"
|
|
6552
|
-
chevron
|
|
6553
|
-
.placement="${this.placement}"
|
|
6554
8991
|
.offset="${this.offset}"
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
8992
|
+
.placement="${this.placement}"
|
|
8993
|
+
chevron
|
|
8994
|
+
fluid
|
|
8995
|
+
for="selectMenu"
|
|
8996
|
+
layout="${this.layout}"
|
|
8997
|
+
part="dropdown"
|
|
8998
|
+
shape="${this.shape}"
|
|
8999
|
+
size="${this.size}">
|
|
6558
9000
|
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
6559
|
-
<span id="placeholder"
|
|
9001
|
+
<span id="placeholder"
|
|
9002
|
+
class="${e(placeholderClass)}"
|
|
9003
|
+
?aria-hidden="${this.optionSelected && this.optionSelected.length ? 'true' : false}"
|
|
9004
|
+
>
|
|
9005
|
+
<slot name="placeholder"></slot>
|
|
9006
|
+
</span>
|
|
9007
|
+
<slot name="valueText" id="valueText"></slot>
|
|
6560
9008
|
</span>
|
|
6561
9009
|
|
|
6562
|
-
<div class="menuWrapper">
|
|
6563
|
-
</div>
|
|
6564
|
-
|
|
6565
9010
|
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
9011
|
+
<slot></slot>
|
|
6566
9012
|
</${this.bibtemplateTag}>
|
|
6567
9013
|
<slot name="label" slot="label"></slot>
|
|
9014
|
+
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
6568
9015
|
<p slot="helpText">
|
|
6569
9016
|
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
6570
9017
|
? u`
|
|
@@ -6602,16 +9049,17 @@ class AuroSelect extends i$2 {
|
|
|
6602
9049
|
</select>
|
|
6603
9050
|
</div>
|
|
6604
9051
|
<!-- Help text and error message template -->
|
|
9052
|
+
${this.renderHtmlHelpText()}
|
|
6605
9053
|
</div>
|
|
6606
9054
|
`;
|
|
6607
9055
|
}
|
|
6608
9056
|
}
|
|
6609
9057
|
|
|
6610
|
-
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:
|
|
9058
|
+
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:block;vertical-align:middle}:host .wrapper{box-sizing:border-box;display:inline-block;width:100%;margin:0;padding:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host [loadingplaceholder].empty{opacity:0;position:absolute}:host [loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;line-height:1;display:inline-block}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]){overflow-y:auto}:host([root]) .wrapper[class*=-lg]{padding:var(--ds-size-150, 0.75rem)}:host([root]) .wrapper[class*=-xl]{padding:var(--ds-size-200, 1rem)}`;
|
|
6611
9059
|
|
|
6612
9060
|
var colorCss$2 = i$5`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-divider-color)}[loadingplaceholder] slot[name=loadingIcon]{color:var(--ds-auro-menu-loader-color)}[loadingplaceholder] slot[name=loadingText]{color:var(--ds-auro-menu-loader-text-color)}`;
|
|
6613
9061
|
|
|
6614
|
-
var tokensCss$1 = i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
9062
|
+
var tokensCss$1 = i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
6615
9063
|
|
|
6616
9064
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6617
9065
|
// See LICENSE in the project root for license information.
|
|
@@ -6677,14 +9125,17 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
6677
9125
|
* @slot - Slot for insertion of menu options.
|
|
6678
9126
|
*/
|
|
6679
9127
|
|
|
6680
|
-
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens */
|
|
9128
|
+
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens, no-inline-comments, line-comment-position */
|
|
6681
9129
|
|
|
6682
|
-
class AuroMenu extends
|
|
9130
|
+
class AuroMenu extends AuroElement$4 {
|
|
6683
9131
|
constructor() {
|
|
6684
9132
|
super();
|
|
6685
9133
|
|
|
6686
9134
|
// State properties (reactive)
|
|
6687
9135
|
|
|
9136
|
+
this.shape = ""; // box, rounded, pill
|
|
9137
|
+
this.size = ""; // md, lg, xl
|
|
9138
|
+
|
|
6688
9139
|
// Value of the selected options
|
|
6689
9140
|
this.value = undefined;
|
|
6690
9141
|
// Currently selected option
|
|
@@ -6743,6 +9194,7 @@ class AuroMenu extends i$2 {
|
|
|
6743
9194
|
|
|
6744
9195
|
static get properties() {
|
|
6745
9196
|
return {
|
|
9197
|
+
...super.properties,
|
|
6746
9198
|
noCheckmark: {
|
|
6747
9199
|
type: Boolean,
|
|
6748
9200
|
reflect: true,
|
|
@@ -6776,6 +9228,16 @@ class AuroMenu extends i$2 {
|
|
|
6776
9228
|
value: {
|
|
6777
9229
|
// Allow string, string[] arrays and undefined
|
|
6778
9230
|
type: Object
|
|
9231
|
+
},
|
|
9232
|
+
|
|
9233
|
+
/**
|
|
9234
|
+
* Indent level for submenus.
|
|
9235
|
+
* @private
|
|
9236
|
+
*/
|
|
9237
|
+
level: {
|
|
9238
|
+
type: Number,
|
|
9239
|
+
reflect: false,
|
|
9240
|
+
attribute: false
|
|
6779
9241
|
}
|
|
6780
9242
|
};
|
|
6781
9243
|
}
|
|
@@ -6797,7 +9259,7 @@ class AuroMenu extends i$2 {
|
|
|
6797
9259
|
*
|
|
6798
9260
|
*/
|
|
6799
9261
|
static register(name = "auro-menu") {
|
|
6800
|
-
AuroLibraryRuntimeUtils$
|
|
9262
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenu);
|
|
6801
9263
|
}
|
|
6802
9264
|
|
|
6803
9265
|
// Lifecycle Methods
|
|
@@ -6809,6 +9271,7 @@ class AuroMenu extends i$2 {
|
|
|
6809
9271
|
this.addEventListener('mousedown', this.handleMouseSelect);
|
|
6810
9272
|
this.addEventListener('auroMenuOption-mouseover', this.handleOptionHover);
|
|
6811
9273
|
this.addEventListener('slotchange', this.handleSlotChange);
|
|
9274
|
+
this.setTagAttribute("auro-menu");
|
|
6812
9275
|
}
|
|
6813
9276
|
|
|
6814
9277
|
disconnectedCallback() {
|
|
@@ -6821,19 +9284,33 @@ class AuroMenu extends i$2 {
|
|
|
6821
9284
|
}
|
|
6822
9285
|
|
|
6823
9286
|
firstUpdated() {
|
|
6824
|
-
AuroLibraryRuntimeUtils$
|
|
9287
|
+
AuroLibraryRuntimeUtils$6.prototype.handleComponentTagRename(this, 'auro-menu');
|
|
6825
9288
|
|
|
6826
9289
|
this.loadingSlots = this.querySelectorAll("[slot='loadingText'], [slot='loadingIcon']");
|
|
6827
9290
|
this.initializeMenu();
|
|
6828
9291
|
}
|
|
6829
9292
|
|
|
9293
|
+
/**
|
|
9294
|
+
* Sets an attribute that matches the default tag name if the tag name is not the default.
|
|
9295
|
+
* @param {string} tagName - The tag name to set as an attribute.
|
|
9296
|
+
* @private
|
|
9297
|
+
*/
|
|
9298
|
+
setTagAttribute(tagName) {
|
|
9299
|
+
if (this.tagName.toLowerCase() !== tagName) {
|
|
9300
|
+
this.setAttribute(tagName, true);
|
|
9301
|
+
}
|
|
9302
|
+
}
|
|
9303
|
+
|
|
6830
9304
|
updated(changedProperties) {
|
|
9305
|
+
super.updated(changedProperties);
|
|
9306
|
+
|
|
6831
9307
|
if (changedProperties.has('multiSelect')) {
|
|
6832
9308
|
// Reset selection if multiSelect mode changes
|
|
6833
9309
|
this.clearSelection();
|
|
6834
9310
|
}
|
|
6835
9311
|
|
|
6836
|
-
|
|
9312
|
+
|
|
9313
|
+
if (changedProperties.has("value")) {
|
|
6837
9314
|
// Handle null/undefined case
|
|
6838
9315
|
if (this.value === undefined || this.value === null) {
|
|
6839
9316
|
this.optionSelected = undefined;
|
|
@@ -6901,6 +9378,19 @@ class AuroMenu extends i$2 {
|
|
|
6901
9378
|
this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]').forEach((element) => element.setAttribute('noCheckmark', ''));
|
|
6902
9379
|
}
|
|
6903
9380
|
|
|
9381
|
+
// Handle layout propagation to all menus and options
|
|
9382
|
+
const propagationTargets = this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]');
|
|
9383
|
+
[
|
|
9384
|
+
'size',
|
|
9385
|
+
'shape'
|
|
9386
|
+
].forEach((prop) => {
|
|
9387
|
+
if (changedProperties.has(prop)) {
|
|
9388
|
+
propagationTargets.forEach((el) => {
|
|
9389
|
+
el.setAttribute(prop, this[prop]);
|
|
9390
|
+
});
|
|
9391
|
+
}
|
|
9392
|
+
});
|
|
9393
|
+
|
|
6904
9394
|
// Regex for matchWord if needed
|
|
6905
9395
|
let regexWord = null;
|
|
6906
9396
|
|
|
@@ -7097,21 +9587,20 @@ class AuroMenu extends i$2 {
|
|
|
7097
9587
|
* @param {HTMLElement} menu - Root menu element.
|
|
7098
9588
|
*/
|
|
7099
9589
|
handleNestedMenus(menu) {
|
|
7100
|
-
|
|
9590
|
+
menu.level = menu.parentElement.level >= 0 ? menu.parentElement.level + 1 : 0;
|
|
7101
9591
|
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
if (!
|
|
7106
|
-
|
|
9592
|
+
if (menu.level > 0) {
|
|
9593
|
+
menu.setAttribute('role', 'group');
|
|
9594
|
+
menu.removeAttribute("root");
|
|
9595
|
+
if (!menu.hasAttribute('aria-label')) {
|
|
9596
|
+
menu.setAttribute('aria-label', 'submenu');
|
|
7107
9597
|
}
|
|
9598
|
+
}
|
|
7108
9599
|
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
this.handleNestedMenus(nestedMenu);
|
|
9600
|
+
const options = menu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption]');
|
|
9601
|
+
options.forEach((option) => {
|
|
9602
|
+
const regex = new RegExp(this.nestingSpacer, "gu");
|
|
9603
|
+
option.innerHTML = this.nestingSpacer.repeat(menu.level) + option.innerHTML.replace(regex, '');
|
|
7115
9604
|
});
|
|
7116
9605
|
}
|
|
7117
9606
|
|
|
@@ -7353,28 +9842,39 @@ class AuroMenu extends i$2 {
|
|
|
7353
9842
|
}
|
|
7354
9843
|
|
|
7355
9844
|
/**
|
|
7356
|
-
*
|
|
7357
|
-
* @
|
|
9845
|
+
* Logic to determine the layout of the component.
|
|
9846
|
+
* @protected
|
|
9847
|
+
* @returns {void}
|
|
7358
9848
|
*/
|
|
7359
|
-
|
|
9849
|
+
renderLayout() {
|
|
7360
9850
|
if (this.loading) {
|
|
7361
9851
|
return x`
|
|
7362
|
-
<
|
|
7363
|
-
<
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
9852
|
+
<div class="wrapper">
|
|
9853
|
+
<auro-menuoption
|
|
9854
|
+
disabled
|
|
9855
|
+
loadingplaceholder
|
|
9856
|
+
class="${this.hasLoadingPlaceholder ? "" : "empty"}"
|
|
9857
|
+
>
|
|
9858
|
+
<div>
|
|
9859
|
+
<slot name="loadingIcon"></slot>
|
|
9860
|
+
<slot name="loadingText"></slot>
|
|
9861
|
+
</div>
|
|
9862
|
+
</auro-menuoption>
|
|
9863
|
+
</div>
|
|
7368
9864
|
`;
|
|
7369
9865
|
}
|
|
7370
9866
|
|
|
7371
|
-
return x
|
|
9867
|
+
return x`
|
|
9868
|
+
<div class="wrapper">
|
|
9869
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
9870
|
+
</div>
|
|
9871
|
+
`;
|
|
7372
9872
|
}
|
|
7373
9873
|
}
|
|
7374
9874
|
|
|
7375
|
-
var styleCss$1 = i$5`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-
|
|
9875
|
+
var styleCss$1 = i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem));padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-50, 0.25rem);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box],:host .wrapper[class*=shape-snowflake]{border-radius:unset}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem)}:host .wrapper[class*=-lg]:not(:last-child){margin-bottom:var(--ds-size-50, 0.25rem)}:host .wrapper[class*=-xl]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem)}:host .wrapper[class*=-xl]:not(:last-child){margin-bottom:var(--ds-size-100, 0.5rem)}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
7376
9876
|
|
|
7377
|
-
var colorCss$1 = i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
9877
|
+
var colorCss$1 = i$5`:host .wrapper{border:1px solid var(--ds-auro-menuoption-container-border-color);background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
7378
9878
|
|
|
7379
9879
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7380
9880
|
// See LICENSE in the project root for license information.
|
|
@@ -7530,6 +10030,76 @@ var tokensCss = i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-def
|
|
|
7530
10030
|
|
|
7531
10031
|
var colorCss = i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
7532
10032
|
|
|
10033
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
10034
|
+
// See LICENSE in the project root for license information.
|
|
10035
|
+
|
|
10036
|
+
// ---------------------------------------------------------------------
|
|
10037
|
+
|
|
10038
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
10039
|
+
|
|
10040
|
+
class AuroLibraryRuntimeUtils {
|
|
10041
|
+
|
|
10042
|
+
/* eslint-disable jsdoc/require-param */
|
|
10043
|
+
|
|
10044
|
+
/**
|
|
10045
|
+
* This will register a new custom element with the browser.
|
|
10046
|
+
* @param {String} name - The name of the custom element.
|
|
10047
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
10048
|
+
* @returns {void}
|
|
10049
|
+
*/
|
|
10050
|
+
registerComponent(name, componentClass) {
|
|
10051
|
+
if (!customElements.get(name)) {
|
|
10052
|
+
customElements.define(name, class extends componentClass {});
|
|
10053
|
+
}
|
|
10054
|
+
}
|
|
10055
|
+
|
|
10056
|
+
/**
|
|
10057
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
10058
|
+
* @returns {void}
|
|
10059
|
+
*/
|
|
10060
|
+
closestElement(
|
|
10061
|
+
selector, // selector like in .closest()
|
|
10062
|
+
base = this, // extra functionality to skip a parent
|
|
10063
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
10064
|
+
!el || el === document || el === window
|
|
10065
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
10066
|
+
: found
|
|
10067
|
+
? found // found a selector INside this element
|
|
10068
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
10069
|
+
) {
|
|
10070
|
+
return __Closest(base);
|
|
10071
|
+
}
|
|
10072
|
+
/* eslint-enable jsdoc/require-param */
|
|
10073
|
+
|
|
10074
|
+
/**
|
|
10075
|
+
* 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.
|
|
10076
|
+
* @param {Object} elem - The element to check.
|
|
10077
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
10078
|
+
* @returns {void}
|
|
10079
|
+
*/
|
|
10080
|
+
handleComponentTagRename(elem, tagName) {
|
|
10081
|
+
const tag = tagName.toLowerCase();
|
|
10082
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
10083
|
+
|
|
10084
|
+
if (elemTag !== tag) {
|
|
10085
|
+
elem.setAttribute(tag, true);
|
|
10086
|
+
}
|
|
10087
|
+
}
|
|
10088
|
+
|
|
10089
|
+
/**
|
|
10090
|
+
* Validates if an element is a specific Auro component.
|
|
10091
|
+
* @param {Object} elem - The element to validate.
|
|
10092
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
10093
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
10094
|
+
*/
|
|
10095
|
+
elementMatch(elem, tagName) {
|
|
10096
|
+
const tag = tagName.toLowerCase();
|
|
10097
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
10098
|
+
|
|
10099
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
10100
|
+
}
|
|
10101
|
+
}
|
|
10102
|
+
|
|
7533
10103
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7534
10104
|
// See LICENSE in the project root for license information.
|
|
7535
10105
|
|
|
@@ -7549,7 +10119,7 @@ class AuroIcon extends BaseIcon {
|
|
|
7549
10119
|
*/
|
|
7550
10120
|
privateDefaults() {
|
|
7551
10121
|
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
7552
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils
|
|
10122
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
7553
10123
|
}
|
|
7554
10124
|
|
|
7555
10125
|
// function to define props used within the scope of this component
|
|
@@ -7631,7 +10201,7 @@ class AuroIcon extends BaseIcon {
|
|
|
7631
10201
|
*
|
|
7632
10202
|
*/
|
|
7633
10203
|
static register(name = "auro-icon") {
|
|
7634
|
-
AuroLibraryRuntimeUtils
|
|
10204
|
+
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroIcon);
|
|
7635
10205
|
}
|
|
7636
10206
|
|
|
7637
10207
|
connectedCallback() {
|
|
@@ -7652,8 +10222,12 @@ class AuroIcon extends BaseIcon {
|
|
|
7652
10222
|
async firstUpdated() {
|
|
7653
10223
|
await super.firstUpdated();
|
|
7654
10224
|
|
|
7655
|
-
|
|
7656
|
-
|
|
10225
|
+
/**
|
|
10226
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
10227
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
10228
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
10229
|
+
*/
|
|
10230
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
7657
10231
|
const svgDesc = this.svg.querySelector('desc');
|
|
7658
10232
|
|
|
7659
10233
|
if (svgDesc) {
|
|
@@ -7697,7 +10271,7 @@ class AuroIcon extends BaseIcon {
|
|
|
7697
10271
|
}
|
|
7698
10272
|
}
|
|
7699
10273
|
|
|
7700
|
-
var iconVersion = '8.0.
|
|
10274
|
+
var iconVersion = '8.0.4';
|
|
7701
10275
|
|
|
7702
10276
|
var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"checkmark-sm__desc\" class=\"ico_squareLarge\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><desc id=\"checkmark-sm__desc\">a small check mark.</desc><path d=\"M8.461 11.84a.625.625 0 1 0-.922.844l2.504 2.738c.247.27.674.27.922 0l5.496-6a.625.625 0 1 0-.922-.844l-5.035 5.496z\"/></svg>"};
|
|
7703
10277
|
|
|
@@ -7715,10 +10289,13 @@ var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlin
|
|
|
7715
10289
|
* @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
|
|
7716
10290
|
* @slot - Specifies text for an option, but is not the value.
|
|
7717
10291
|
*/
|
|
7718
|
-
class AuroMenuOption extends
|
|
10292
|
+
class AuroMenuOption extends AuroElement$4 {
|
|
7719
10293
|
constructor() {
|
|
7720
10294
|
super();
|
|
7721
10295
|
|
|
10296
|
+
this.size = ""; // md, lg, xl
|
|
10297
|
+
this.shape = ""; // box, rounded, pill
|
|
10298
|
+
|
|
7722
10299
|
/**
|
|
7723
10300
|
* Generate unique names for dependency components.
|
|
7724
10301
|
*/
|
|
@@ -7737,11 +10314,12 @@ class AuroMenuOption extends i$2 {
|
|
|
7737
10314
|
/**
|
|
7738
10315
|
* @private
|
|
7739
10316
|
*/
|
|
7740
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
10317
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
7741
10318
|
}
|
|
7742
10319
|
|
|
7743
10320
|
static get properties() {
|
|
7744
10321
|
return {
|
|
10322
|
+
...super.properties,
|
|
7745
10323
|
nocheckmark: {
|
|
7746
10324
|
type: Boolean,
|
|
7747
10325
|
reflect: true
|
|
@@ -7781,7 +10359,7 @@ class AuroMenuOption extends i$2 {
|
|
|
7781
10359
|
*
|
|
7782
10360
|
*/
|
|
7783
10361
|
static register(name = "auro-menuoption") {
|
|
7784
|
-
AuroLibraryRuntimeUtils$
|
|
10362
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenuOption);
|
|
7785
10363
|
}
|
|
7786
10364
|
|
|
7787
10365
|
firstUpdated() {
|
|
@@ -7803,6 +10381,8 @@ class AuroMenuOption extends i$2 {
|
|
|
7803
10381
|
|
|
7804
10382
|
// observer for selected property changes
|
|
7805
10383
|
updated(changedProperties) {
|
|
10384
|
+
super.updated(changedProperties);
|
|
10385
|
+
|
|
7806
10386
|
if (changedProperties.has('selected')) {
|
|
7807
10387
|
this.setAttribute('aria-selected', this.selected.toString());
|
|
7808
10388
|
}
|
|
@@ -7824,10 +10404,19 @@ class AuroMenuOption extends i$2 {
|
|
|
7824
10404
|
return u`<${this.iconTag} customColor customSvg slot="icon">${svg}</${this.iconTag}>`;
|
|
7825
10405
|
}
|
|
7826
10406
|
|
|
7827
|
-
|
|
10407
|
+
/**
|
|
10408
|
+
* Logic to determine the layout of the component.
|
|
10409
|
+
* @protected
|
|
10410
|
+
* @returns {void}
|
|
10411
|
+
*/
|
|
10412
|
+
renderLayout() {
|
|
7828
10413
|
return u`
|
|
7829
|
-
|
|
7830
|
-
|
|
10414
|
+
<div class="wrapper">
|
|
10415
|
+
${this.selected && !this.nocheckmark
|
|
10416
|
+
? this.generateIconHtml(checkmarkIcon.svg)
|
|
10417
|
+
: undefined}
|
|
10418
|
+
<slot></slot>
|
|
10419
|
+
</div>
|
|
7831
10420
|
`;
|
|
7832
10421
|
}
|
|
7833
10422
|
}
|