@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.5 → 0.0.0-pr624.50
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 +47 -34
- package/components/checkbox/demo/index.md +2 -2
- package/components/checkbox/demo/index.min.js +47 -34
- 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 +47 -34
- package/components/checkbox/dist/registered.js +47 -34
- package/components/combobox/demo/api.md +112 -8
- package/components/combobox/demo/api.min.js +3203 -760
- package/components/combobox/demo/index.md +6 -30
- package/components/combobox/demo/index.min.js +3203 -760
- package/components/combobox/dist/auro-combobox.d.ts +37 -16
- package/components/combobox/dist/index.js +3093 -791
- package/components/combobox/dist/registered.js +3093 -791
- package/components/counter/demo/api.html +1 -0
- package/components/counter/demo/api.md +29 -21
- package/components/counter/demo/api.min.js +3332 -615
- package/components/counter/demo/index.html +1 -0
- package/components/counter/demo/index.md +103 -34
- package/components/counter/demo/index.min.js +3332 -615
- package/components/counter/dist/auro-counter-button.d.ts +2 -0
- package/components/counter/dist/auro-counter-group.d.ts +90 -7
- 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 +3332 -615
- package/components/counter/dist/registered.js +3332 -615
- package/components/datepicker/demo/api.md +36 -19
- package/components/datepicker/demo/api.min.js +14940 -10964
- package/components/datepicker/demo/index.md +80 -0
- package/components/datepicker/demo/index.min.js +14940 -10964
- 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 +11817 -7841
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +11817 -7841
- package/components/dropdown/demo/api.md +25 -12
- package/components/dropdown/demo/api.min.js +552 -148
- package/components/dropdown/demo/index.md +57 -9
- package/components/dropdown/demo/index.min.js +552 -148
- 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 +552 -148
- package/components/dropdown/dist/registered.js +552 -148
- 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 +958 -272
- package/components/input/demo/index.md +48 -32
- package/components/input/demo/index.min.js +957 -271
- 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 +33 -9
- package/components/input/dist/buttonVersion.d.ts +1 -1
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +957 -271
- package/components/input/dist/registered.js +957 -271
- 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 +71 -83
- package/components/radio/demo/index.min.js +71 -83
- 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 +71 -83
- package/components/radio/dist/registered.js +71 -83
- package/components/select/demo/api.js +0 -2
- package/components/select/demo/api.md +100 -45
- package/components/select/demo/api.min.js +3009 -526
- package/components/select/demo/index.html +1 -0
- package/components/select/demo/index.md +176 -768
- package/components/select/demo/index.min.js +3013 -518
- package/components/select/dist/auro-select.d.ts +126 -11
- package/components/select/dist/helptextVersion.d.ts +2 -0
- package/components/select/dist/index.js +2892 -538
- package/components/select/dist/registered.js +2892 -538
- 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 +28 -26
- /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:0px;min-height:60px;max-height:60px;background-color:unset}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-pill-xl{min-height:
|
|
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([layout*=classic])){--ds-auro-dropdown-trigger-border-color: transparent}:host(:not([ondark])) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus-within,:host(:not([ondark])) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host(:not([onDark])[disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([ondark])[error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]) .label{color:var(--ds-auro-dropdown-label-text-color)}:host([onDark]) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host([onDark]) .wrapper:focus-within,:host([onDark]) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark][disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}:host([ondark][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}`;
|
|
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([matchwidth]) #bibSizer{width:100%}`;
|
|
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`:host{position:relative;display:block}.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
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
|
*/
|
|
@@ -4367,8 +4928,8 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4367
4928
|
|
|
4368
4929
|
static get styles() {
|
|
4369
4930
|
return [
|
|
4931
|
+
tokensCss$1$2,
|
|
4370
4932
|
colorCss$1$2,
|
|
4371
|
-
tokensCss$1$1,
|
|
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`:host{position:relative;display:block}.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
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)}:host([layout*=emphasized]) [auro-dropdown],:host([layout*=snowflake]) [auro-dropdown]{--ds-auro-select-border-color: transparent}.mainContent{position:relative;display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;align-items:center;justify-content:center}::slotted([slot=typeIcon]){margin-right: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*=snowflake]) [auro-dropdown] label.withValue{font-size:var(--ds-text-body-size-xs);line-height:20px}:host([layout*=emphasized]) [auro-dropdown] label.withValue{font-size:var(--ds-text-body-size-xs);line-height:20px}:host([layout*=classic]) .triggerContent{padding:0 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]){pointer-events:none;user-select:none}:host([disabled]:not([ondark])) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([layout*=classic])[disabled][ondark]) [auro-dropdown]{--ds-auro-select-border-color: transparent}`;
|
|
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,9 +7661,10 @@ 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
|
-
* @slot placeholder - Defines the content of the placeholder to be shown when there is no value
|
|
5739
7666
|
* @slot valueText - Dropdown value text display.
|
|
7667
|
+
* @slot displayValue - Allows custom HTML content to display the selected value when select is not focused.
|
|
5740
7668
|
* @event auroSelect-valueSet - Notifies that the component has a new value set.
|
|
5741
7669
|
* @event input - Notifies every time the value prop of the element is changed. The updated `value` and `optionSelected` will be delivered in `detail` object.
|
|
5742
7670
|
* @event auroFormElement-validated - Notifies that the `validity` and `errorMessage` values have changed.
|
|
@@ -5744,7 +7672,7 @@ var styleCss$3 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.u
|
|
|
5744
7672
|
*/
|
|
5745
7673
|
|
|
5746
7674
|
// build the component class
|
|
5747
|
-
class AuroSelect extends
|
|
7675
|
+
class AuroSelect extends AuroElement$4 {
|
|
5748
7676
|
constructor() {
|
|
5749
7677
|
super();
|
|
5750
7678
|
|
|
@@ -5754,12 +7682,25 @@ class AuroSelect extends i$2 {
|
|
|
5754
7682
|
const idSubstrEnd = 8;
|
|
5755
7683
|
const idSubstrStart = 2;
|
|
5756
7684
|
|
|
7685
|
+
this.matchWidth = false;
|
|
7686
|
+
|
|
7687
|
+
// Layout Config
|
|
7688
|
+
this.layout = 'snowflake';
|
|
7689
|
+
this.shape = 'snowflake';
|
|
7690
|
+
this.size = 'xl';
|
|
7691
|
+
|
|
5757
7692
|
// floaterConfig
|
|
5758
7693
|
this.placement = 'bottom-start';
|
|
5759
7694
|
this.offset = 0;
|
|
5760
7695
|
this.noFlip = false;
|
|
5761
7696
|
this.autoPlacement = false;
|
|
5762
7697
|
|
|
7698
|
+
this.forceDisplayValue = false;
|
|
7699
|
+
|
|
7700
|
+
this.layout = 'classic';
|
|
7701
|
+
this.shape = 'classic';
|
|
7702
|
+
this.size = 'xl';
|
|
7703
|
+
|
|
5763
7704
|
/**
|
|
5764
7705
|
* @private
|
|
5765
7706
|
*/
|
|
@@ -5775,7 +7716,7 @@ class AuroSelect extends i$2 {
|
|
|
5775
7716
|
/**
|
|
5776
7717
|
* @private
|
|
5777
7718
|
*/
|
|
5778
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
7719
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
5779
7720
|
|
|
5780
7721
|
/**
|
|
5781
7722
|
* Generate unique names for dependency components.
|
|
@@ -5792,10 +7733,25 @@ class AuroSelect extends i$2 {
|
|
|
5792
7733
|
*/
|
|
5793
7734
|
this.bibtemplateTag = versioning.generateTag('auro-formkit-select-bibtemplate', bibTemplateVersion, AuroBibtemplate);
|
|
5794
7735
|
|
|
7736
|
+
/**
|
|
7737
|
+
* @private
|
|
7738
|
+
*/
|
|
7739
|
+
this.helpTextTag = versioning.generateTag('auro-formkit-input-helptext', helpTextVersion, AuroHelpText);
|
|
7740
|
+
|
|
5795
7741
|
/**
|
|
5796
7742
|
* @private
|
|
5797
7743
|
*/
|
|
5798
7744
|
this.isHiddenWhileLoading = false;
|
|
7745
|
+
|
|
7746
|
+
/**
|
|
7747
|
+
* @private
|
|
7748
|
+
*/
|
|
7749
|
+
this.hasFocus = false;
|
|
7750
|
+
|
|
7751
|
+
/**
|
|
7752
|
+
* @private
|
|
7753
|
+
*/
|
|
7754
|
+
this.hasDisplayValueContent = false;
|
|
5799
7755
|
}
|
|
5800
7756
|
|
|
5801
7757
|
/**
|
|
@@ -5809,6 +7765,7 @@ class AuroSelect extends i$2 {
|
|
|
5809
7765
|
this.value = undefined;
|
|
5810
7766
|
this.fullscreenBreakpoint = 'sm';
|
|
5811
7767
|
this.onDark = false;
|
|
7768
|
+
this.isPopoverVisible = false;
|
|
5812
7769
|
}
|
|
5813
7770
|
|
|
5814
7771
|
// This function is to define props used within the scope of this component
|
|
@@ -5825,6 +7782,14 @@ class AuroSelect extends i$2 {
|
|
|
5825
7782
|
reflect: true
|
|
5826
7783
|
},
|
|
5827
7784
|
|
|
7785
|
+
/**
|
|
7786
|
+
* If declared, the label and value will be visually hidden and the displayValue will render 100% of the time.
|
|
7787
|
+
*/
|
|
7788
|
+
forceDisplayValue: {
|
|
7789
|
+
type: Boolean,
|
|
7790
|
+
reflect: true
|
|
7791
|
+
},
|
|
7792
|
+
|
|
5828
7793
|
/**
|
|
5829
7794
|
* If declared, bib's position will be automatically calculated where to appear.
|
|
5830
7795
|
* @default false
|
|
@@ -5843,21 +7808,29 @@ class AuroSelect extends i$2 {
|
|
|
5843
7808
|
},
|
|
5844
7809
|
|
|
5845
7810
|
/**
|
|
5846
|
-
*
|
|
7811
|
+
* @private
|
|
5847
7812
|
*/
|
|
5848
|
-
|
|
5849
|
-
type:
|
|
5850
|
-
reflect:
|
|
7813
|
+
isPopoverVisible: {
|
|
7814
|
+
type: Boolean,
|
|
7815
|
+
reflect: false
|
|
5851
7816
|
},
|
|
5852
7817
|
|
|
5853
7818
|
/**
|
|
5854
|
-
* If
|
|
7819
|
+
* If declared, the popover and trigger will be set to the same width.
|
|
5855
7820
|
*/
|
|
5856
|
-
|
|
7821
|
+
matchWidth: {
|
|
5857
7822
|
type: Boolean,
|
|
5858
7823
|
reflect: true
|
|
5859
7824
|
},
|
|
5860
7825
|
|
|
7826
|
+
/**
|
|
7827
|
+
* The name for the select element.
|
|
7828
|
+
*/
|
|
7829
|
+
name: {
|
|
7830
|
+
type: String,
|
|
7831
|
+
reflect: true
|
|
7832
|
+
},
|
|
7833
|
+
|
|
5861
7834
|
/**
|
|
5862
7835
|
* Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
|
|
5863
7836
|
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
@@ -5951,7 +7924,7 @@ class AuroSelect extends i$2 {
|
|
|
5951
7924
|
* "top" | "right" | "bottom" | "left" |
|
|
5952
7925
|
* "bottom-start" | "top-start" | "top-end" |
|
|
5953
7926
|
* "right-start" | "right-end" | "bottom-end" |
|
|
5954
|
-
* "left-start" | "left-end"
|
|
7927
|
+
* "left-start" | "left-end".
|
|
5955
7928
|
* @default bottom-start
|
|
5956
7929
|
*/
|
|
5957
7930
|
placement: {
|
|
@@ -5959,6 +7932,14 @@ class AuroSelect extends i$2 {
|
|
|
5959
7932
|
reflect: true
|
|
5960
7933
|
},
|
|
5961
7934
|
|
|
7935
|
+
/**
|
|
7936
|
+
* Define custom placeholder text.
|
|
7937
|
+
*/
|
|
7938
|
+
placeholder: {
|
|
7939
|
+
type: String,
|
|
7940
|
+
reflect: true
|
|
7941
|
+
},
|
|
7942
|
+
|
|
5962
7943
|
/**
|
|
5963
7944
|
* Populates the `required` attribute on the element. Used for client-side validation.
|
|
5964
7945
|
*/
|
|
@@ -6031,12 +8012,58 @@ class AuroSelect extends i$2 {
|
|
|
6031
8012
|
type: Boolean,
|
|
6032
8013
|
reflect: true,
|
|
6033
8014
|
attribute: false
|
|
6034
|
-
}
|
|
8015
|
+
},
|
|
8016
|
+
|
|
8017
|
+
/**
|
|
8018
|
+
* @private
|
|
8019
|
+
*/
|
|
8020
|
+
hasFocus: {
|
|
8021
|
+
type: Boolean,
|
|
8022
|
+
reflect: false,
|
|
8023
|
+
attribute: false
|
|
8024
|
+
},
|
|
8025
|
+
|
|
8026
|
+
/**
|
|
8027
|
+
* @private
|
|
8028
|
+
*/
|
|
8029
|
+
hasDisplayValueContent: {
|
|
8030
|
+
type: Boolean,
|
|
8031
|
+
reflect: false,
|
|
8032
|
+
attribute: false
|
|
8033
|
+
},
|
|
6035
8034
|
};
|
|
6036
8035
|
}
|
|
6037
8036
|
|
|
6038
8037
|
static get styles() {
|
|
6039
|
-
return [
|
|
8038
|
+
return [
|
|
8039
|
+
i$5`${shapeSizeCss$1}`,
|
|
8040
|
+
i$5`${tokensCss$5}`,
|
|
8041
|
+
i$5`${styleCss$3}`,
|
|
8042
|
+
];
|
|
8043
|
+
}
|
|
8044
|
+
|
|
8045
|
+
/**
|
|
8046
|
+
* Returns classmap configuration for html5 input labels in all layouts.
|
|
8047
|
+
* @private
|
|
8048
|
+
* @returns {void}
|
|
8049
|
+
*/
|
|
8050
|
+
get commonLabelClasses() {
|
|
8051
|
+
return {
|
|
8052
|
+
'is-disabled': this.disabled,
|
|
8053
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8054
|
+
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
8055
|
+
};
|
|
8056
|
+
}
|
|
8057
|
+
|
|
8058
|
+
/**
|
|
8059
|
+
* Returns classmap configuration for wrapper elements in each layout.
|
|
8060
|
+
* @private
|
|
8061
|
+
* @returns {object} - Returns classmap.
|
|
8062
|
+
*/
|
|
8063
|
+
get commonWrapperClasses() {
|
|
8064
|
+
return {
|
|
8065
|
+
'wrapper': true
|
|
8066
|
+
};
|
|
6040
8067
|
}
|
|
6041
8068
|
|
|
6042
8069
|
/**
|
|
@@ -6046,11 +8073,28 @@ class AuroSelect extends i$2 {
|
|
|
6046
8073
|
*/
|
|
6047
8074
|
configureDropdown() {
|
|
6048
8075
|
this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
|
|
6049
|
-
|
|
8076
|
+
|
|
8077
|
+
this.dropdown.addEventListener('auroDropdown-toggled', () => {
|
|
8078
|
+
this.isPopoverVisible = this.dropdown.isPopoverVisible;
|
|
8079
|
+
|
|
8080
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8081
|
+
// wait til the bib gets fully rendered
|
|
8082
|
+
setTimeout(() => {
|
|
8083
|
+
if (this.dropdown.isBibFullscreen) {
|
|
8084
|
+
// trigger holds the focus since menu is not a focusable element.
|
|
8085
|
+
this.dropdown.trigger.focus();
|
|
8086
|
+
|
|
8087
|
+
// default focus indicator on the first menu option
|
|
8088
|
+
if (this.menu.index < 0) {
|
|
8089
|
+
this.menu.navigateOptions('down');
|
|
8090
|
+
}
|
|
8091
|
+
}
|
|
8092
|
+
});
|
|
8093
|
+
}
|
|
8094
|
+
});
|
|
6050
8095
|
|
|
6051
8096
|
// setting up bibtemplate
|
|
6052
|
-
this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
|
|
6053
|
-
this.bibtemplate.append(this.menuWrapper);
|
|
8097
|
+
this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
|
|
6054
8098
|
|
|
6055
8099
|
if (this.customBibWidth) {
|
|
6056
8100
|
this.dropdown.dropdownWidth = this.customBibWidth;
|
|
@@ -6069,7 +8113,7 @@ class AuroSelect extends i$2 {
|
|
|
6069
8113
|
*
|
|
6070
8114
|
*/
|
|
6071
8115
|
static register(name = "auro-select") {
|
|
6072
|
-
AuroLibraryRuntimeUtils$
|
|
8116
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroSelect);
|
|
6073
8117
|
}
|
|
6074
8118
|
|
|
6075
8119
|
/**
|
|
@@ -6080,21 +8124,34 @@ class AuroSelect extends i$2 {
|
|
|
6080
8124
|
updateDisplayedValue() {
|
|
6081
8125
|
const triggerContentEl = this.dropdown.querySelector('#triggerFocus');
|
|
6082
8126
|
|
|
6083
|
-
|
|
6084
|
-
|
|
8127
|
+
// Clear out old value
|
|
8128
|
+
const valueElem = triggerContentEl.querySelector('#value');
|
|
8129
|
+
if (valueElem) {
|
|
8130
|
+
valueElem.innerHTML = '';
|
|
8131
|
+
}
|
|
8132
|
+
|
|
8133
|
+
const slot = this.shadowRoot.querySelector('slot[name="displayValue"]');
|
|
8134
|
+
const slottedElements = slot.assignedElements();
|
|
8135
|
+
|
|
8136
|
+
slottedElements.forEach((element) => {
|
|
8137
|
+
element.remove();
|
|
8138
|
+
});
|
|
6085
8139
|
|
|
6086
8140
|
// Handle selected options
|
|
6087
8141
|
if (this.optionSelected) {
|
|
6088
|
-
let displayText = '';
|
|
6089
|
-
|
|
6090
8142
|
if (this.multiSelect && this.optionSelected.length > 0) {
|
|
6091
|
-
|
|
6092
|
-
|
|
8143
|
+
const displayText = this.optionSelected.map((option) => option.textContent).join(', ');
|
|
8144
|
+
|
|
8145
|
+
valueElem.textContent = displayText;
|
|
6093
8146
|
} else {
|
|
6094
|
-
|
|
6095
|
-
|
|
8147
|
+
valueElem.innerHTML = this.optionSelected.innerHTML;
|
|
8148
|
+
const displayValueEl = this.optionSelected.querySelector("[slot='displayValue']");
|
|
6096
8149
|
|
|
6097
|
-
|
|
8150
|
+
if (displayValueEl) {
|
|
8151
|
+
this.appendChild(displayValueEl.cloneNode(true));
|
|
8152
|
+
}
|
|
8153
|
+
this.hasDisplayValueContent = displayValueEl !== null;
|
|
8154
|
+
}
|
|
6098
8155
|
}
|
|
6099
8156
|
|
|
6100
8157
|
this.dropdown.requestUpdate();
|
|
@@ -6116,6 +8173,15 @@ class AuroSelect extends i$2 {
|
|
|
6116
8173
|
return;
|
|
6117
8174
|
}
|
|
6118
8175
|
|
|
8176
|
+
// set menu's default size if there it's not specified.
|
|
8177
|
+
if (!this.menu.getAttribute('size')) {
|
|
8178
|
+
this.menu.setAttribute('size', this.layout !== 'emphasized' ? 'md' : this.size);
|
|
8179
|
+
}
|
|
8180
|
+
|
|
8181
|
+
if (!this.getAttribute('shape')) {
|
|
8182
|
+
this.menu.setAttribute('shape', this.layout === 'classic' ? 'box' : this.shape);
|
|
8183
|
+
}
|
|
8184
|
+
|
|
6119
8185
|
if (this.multiSelect) {
|
|
6120
8186
|
this.menu.multiSelect = this.multiSelect;
|
|
6121
8187
|
}
|
|
@@ -6173,50 +8239,60 @@ class AuroSelect extends i$2 {
|
|
|
6173
8239
|
* @returns {void}
|
|
6174
8240
|
*/
|
|
6175
8241
|
configureSelect() {
|
|
6176
|
-
// inject menu into menuWrapper
|
|
6177
|
-
this.menuWrapper.append(this.menu);
|
|
6178
8242
|
|
|
6179
8243
|
this.addEventListener('keydown', (evt) => {
|
|
6180
|
-
|
|
6181
|
-
|
|
8244
|
+
// when the focus is on trigger not on close button
|
|
8245
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8246
|
+
if (evt.key === 'ArrowUp') {
|
|
8247
|
+
evt.preventDefault();
|
|
6182
8248
|
|
|
6183
|
-
|
|
8249
|
+
this.dropdown.show();
|
|
8250
|
+
|
|
8251
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8252
|
+
this.menu.navigateOptions('up');
|
|
8253
|
+
}
|
|
6184
8254
|
|
|
6185
|
-
|
|
6186
|
-
this.menu.navigateOptions('up');
|
|
8255
|
+
return;
|
|
6187
8256
|
}
|
|
6188
8257
|
|
|
6189
|
-
|
|
6190
|
-
|
|
8258
|
+
if (evt.key === 'ArrowDown') {
|
|
8259
|
+
evt.preventDefault();
|
|
6191
8260
|
|
|
6192
|
-
|
|
6193
|
-
evt.preventDefault();
|
|
8261
|
+
this.dropdown.show();
|
|
6194
8262
|
|
|
6195
|
-
|
|
8263
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8264
|
+
this.menu.navigateOptions('down');
|
|
8265
|
+
}
|
|
6196
8266
|
|
|
6197
|
-
|
|
6198
|
-
this.menu.navigateOptions('down');
|
|
8267
|
+
return;
|
|
6199
8268
|
}
|
|
6200
8269
|
|
|
6201
|
-
|
|
6202
|
-
|
|
8270
|
+
if (evt.key === 'Enter') {
|
|
8271
|
+
if (!this.dropdown.isPopoverVisible) {
|
|
8272
|
+
evt.preventDefault();
|
|
8273
|
+
this.menu.makeSelection();
|
|
8274
|
+
}
|
|
6203
8275
|
|
|
6204
|
-
|
|
6205
|
-
if (!this.dropdown.isPopoverVisible) {
|
|
6206
|
-
evt.preventDefault();
|
|
6207
|
-
this.menu.makeSelection();
|
|
8276
|
+
return;
|
|
6208
8277
|
}
|
|
6209
|
-
|
|
6210
|
-
return;
|
|
6211
8278
|
}
|
|
6212
8279
|
|
|
6213
|
-
if (evt.key === 'Tab') {
|
|
8280
|
+
if (evt.key === 'Tab' && this.dropdown.isPopoverVisible) {
|
|
6214
8281
|
if (this.dropdown.isBibFullscreen) {
|
|
6215
8282
|
evt.preventDefault();
|
|
8283
|
+
|
|
8284
|
+
// when the focus is on trigger not on close button
|
|
8285
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8286
|
+
// `dropdown.focus` will move focus to the first focusable element in bib when it's open,
|
|
8287
|
+
// when bib it not open, it will focus onto trigger.
|
|
8288
|
+
this.dropdown.focus();
|
|
8289
|
+
} else {
|
|
8290
|
+
// when close button has the focus, move focus back to the trigger
|
|
8291
|
+
this.dropdown.trigger.focus();
|
|
8292
|
+
}
|
|
6216
8293
|
} else {
|
|
6217
8294
|
this.dropdown.hide();
|
|
6218
8295
|
}
|
|
6219
|
-
|
|
6220
8296
|
return;
|
|
6221
8297
|
}
|
|
6222
8298
|
|
|
@@ -6228,6 +8304,7 @@ class AuroSelect extends i$2 {
|
|
|
6228
8304
|
|
|
6229
8305
|
this.addEventListener('blur', () => {
|
|
6230
8306
|
this.validation.validate(this);
|
|
8307
|
+
this.hasFocus = false;
|
|
6231
8308
|
});
|
|
6232
8309
|
}
|
|
6233
8310
|
|
|
@@ -6303,6 +8380,7 @@ class AuroSelect extends i$2 {
|
|
|
6303
8380
|
*/
|
|
6304
8381
|
handleFocusin() {
|
|
6305
8382
|
|
|
8383
|
+
this.hasFocus = true;
|
|
6306
8384
|
this.touched = true;
|
|
6307
8385
|
}
|
|
6308
8386
|
|
|
@@ -6379,17 +8457,32 @@ class AuroSelect extends i$2 {
|
|
|
6379
8457
|
// Add the tag name as an attribute if it is different than the component name
|
|
6380
8458
|
this.runtimeUtils.handleComponentTagRename(this, 'auro-select');
|
|
6381
8459
|
|
|
6382
|
-
this.configureMenu();
|
|
6383
8460
|
this.configureDropdown();
|
|
8461
|
+
this.configureMenu();
|
|
6384
8462
|
this.configureSelect();
|
|
6385
8463
|
|
|
6386
8464
|
// Set the initial value in auro-menu if defined
|
|
6387
8465
|
if (this.hasAttribute('value') && this.getAttribute('value').length > 0) {
|
|
6388
8466
|
this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
|
|
6389
|
-
this.menu
|
|
8467
|
+
if (this.menu) {
|
|
8468
|
+
this.menu.value = this.value;
|
|
8469
|
+
}
|
|
6390
8470
|
}
|
|
6391
8471
|
}
|
|
6392
8472
|
|
|
8473
|
+
/**
|
|
8474
|
+
* Update the menu value. With checks for menu existence. Awaits value update.
|
|
8475
|
+
* @param {string} value - The value to set in the menu.
|
|
8476
|
+
* @returns {void}
|
|
8477
|
+
* @private
|
|
8478
|
+
*/
|
|
8479
|
+
async updateMenuValue(value) {
|
|
8480
|
+
if (!this.menu) return;
|
|
8481
|
+
|
|
8482
|
+
this.menu.value = value;
|
|
8483
|
+
await this.menu.updateComplete;
|
|
8484
|
+
}
|
|
8485
|
+
|
|
6393
8486
|
async updated(changedProperties) {
|
|
6394
8487
|
if (changedProperties.has('multiSelect')) {
|
|
6395
8488
|
this.clearSelection();
|
|
@@ -6399,14 +8492,13 @@ class AuroSelect extends i$2 {
|
|
|
6399
8492
|
if (this.value) {
|
|
6400
8493
|
this.value = this.multiSelect ? arrayConverter(this.value) : this.value;
|
|
6401
8494
|
|
|
6402
|
-
this.
|
|
6403
|
-
|
|
6404
|
-
// Wait for menu to finish updating its value
|
|
6405
|
-
await this.menu.updateComplete;
|
|
8495
|
+
await this.updateMenuValue(this.value);
|
|
6406
8496
|
|
|
6407
|
-
|
|
8497
|
+
if (this.menu) {
|
|
8498
|
+
this.optionSelected = this.menu.optionSelected;
|
|
8499
|
+
}
|
|
6408
8500
|
} else {
|
|
6409
|
-
this.
|
|
8501
|
+
await this.updateMenuValue(undefined);
|
|
6410
8502
|
}
|
|
6411
8503
|
|
|
6412
8504
|
this._updateNativeSelect();
|
|
@@ -6437,6 +8529,14 @@ class AuroSelect extends i$2 {
|
|
|
6437
8529
|
if (changedProperties.has('error')) {
|
|
6438
8530
|
this.validate(true);
|
|
6439
8531
|
}
|
|
8532
|
+
|
|
8533
|
+
if (changedProperties.has('shape') && this.menu) {
|
|
8534
|
+
this.menu.setAttribute('shape', this.layout === 'classic' ? 'box' : this.shape);
|
|
8535
|
+
}
|
|
8536
|
+
|
|
8537
|
+
if (changedProperties.has('size') && this.menu) {
|
|
8538
|
+
this.menu.setAttribute('size', this.layout !== 'emphasized' ? 'md' : this.size);
|
|
8539
|
+
}
|
|
6440
8540
|
}
|
|
6441
8541
|
|
|
6442
8542
|
/**
|
|
@@ -6466,157 +8566,411 @@ class AuroSelect extends i$2 {
|
|
|
6466
8566
|
}
|
|
6467
8567
|
|
|
6468
8568
|
/**
|
|
6469
|
-
* Syncs the value from the native select element to the component's value.
|
|
6470
|
-
* @param {Event} event // The change event from the native select element.
|
|
6471
|
-
* @returns {void}
|
|
8569
|
+
* Syncs the value from the native select element to the component's value.
|
|
8570
|
+
* @param {Event} event // The change event from the native select element.
|
|
8571
|
+
* @returns {void}
|
|
8572
|
+
* @private
|
|
8573
|
+
*/
|
|
8574
|
+
_handleNativeSelectChange(event) {
|
|
8575
|
+
const selectedOption = event.target.options[event.target.selectedIndex];
|
|
8576
|
+
const selectedValue = selectedOption.value;
|
|
8577
|
+
|
|
8578
|
+
if (this.multiSelect) {
|
|
8579
|
+
const currentArray = Array.isArray(this.value) ? this.value : [];
|
|
8580
|
+
|
|
8581
|
+
if (!currentArray.includes(selectedValue)) {
|
|
8582
|
+
this.value = [
|
|
8583
|
+
...currentArray,
|
|
8584
|
+
selectedValue
|
|
8585
|
+
];
|
|
8586
|
+
}
|
|
8587
|
+
} else {
|
|
8588
|
+
const currentValue = this.value;
|
|
8589
|
+
|
|
8590
|
+
if (currentValue !== selectedValue) {
|
|
8591
|
+
this.value = selectedValue;
|
|
8592
|
+
}
|
|
8593
|
+
}
|
|
8594
|
+
}
|
|
8595
|
+
|
|
8596
|
+
/**
|
|
8597
|
+
* Updates the native select element's value based on the component's value.
|
|
8598
|
+
* @returns {void}
|
|
8599
|
+
* @private
|
|
8600
|
+
*/
|
|
8601
|
+
_updateNativeSelect() {
|
|
8602
|
+
const nativeSelect = this.shadowRoot.querySelector('select');
|
|
8603
|
+
if (!nativeSelect) {
|
|
8604
|
+
return;
|
|
8605
|
+
}
|
|
8606
|
+
|
|
8607
|
+
if (this.multiSelect) {
|
|
8608
|
+
nativeSelect.value = this.value ? this.value[0] : '';
|
|
8609
|
+
} else {
|
|
8610
|
+
nativeSelect.value = this.value || '';
|
|
8611
|
+
}
|
|
8612
|
+
}
|
|
8613
|
+
|
|
8614
|
+
/**
|
|
8615
|
+
* Returns HTML for the hidden a11y screen reader content.
|
|
8616
|
+
* @private
|
|
8617
|
+
* @returns {html} - Returns HTML for the hidden a11y screen reader content.
|
|
8618
|
+
*/
|
|
8619
|
+
renderAriaHtml() {
|
|
8620
|
+
return u`
|
|
8621
|
+
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
8622
|
+
${this.optionActive && this.options.length > 0
|
|
8623
|
+
? u`
|
|
8624
|
+
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
8625
|
+
`
|
|
8626
|
+
: undefined
|
|
8627
|
+
};
|
|
8628
|
+
|
|
8629
|
+
${this.optionSelected && this.options.length > 0
|
|
8630
|
+
? u`
|
|
8631
|
+
${`${this.optionSelected.innerText} selected`}
|
|
8632
|
+
`
|
|
8633
|
+
: undefined
|
|
8634
|
+
};
|
|
8635
|
+
</div>
|
|
8636
|
+
`;
|
|
8637
|
+
}
|
|
8638
|
+
|
|
8639
|
+
/**
|
|
8640
|
+
* Returns HTML for the hidden HTML5 select.
|
|
8641
|
+
* @private
|
|
8642
|
+
* @returns {html} - Returns HTML for the hidden HTML5 select.
|
|
8643
|
+
*/
|
|
8644
|
+
renderNativeSelect() {
|
|
8645
|
+
return u`
|
|
8646
|
+
<div class="nativeSelectWrapper util_displayHidden">
|
|
8647
|
+
<select
|
|
8648
|
+
tabindex="-1"
|
|
8649
|
+
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
8650
|
+
name="${this.name || ''}"
|
|
8651
|
+
?disabled="${this.disabled}"
|
|
8652
|
+
?required="${this.required}"
|
|
8653
|
+
aria-hidden="true"
|
|
8654
|
+
autocomplete="${o(this.autocomplete)}"
|
|
8655
|
+
@change="${this._handleNativeSelectChange}">
|
|
8656
|
+
<option value="" ?selected="${!this.value}"></option>
|
|
8657
|
+
${this.options.map((option) => {
|
|
8658
|
+
const optionValue = option.value || option.textContent;
|
|
8659
|
+
return u`
|
|
8660
|
+
<option
|
|
8661
|
+
value="${optionValue}"
|
|
8662
|
+
?selected="${this.value === optionValue}">
|
|
8663
|
+
${option.textContent}
|
|
8664
|
+
</option>
|
|
8665
|
+
`;
|
|
8666
|
+
})}
|
|
8667
|
+
</select>
|
|
8668
|
+
</div>
|
|
8669
|
+
`;
|
|
8670
|
+
}
|
|
8671
|
+
|
|
8672
|
+
/**
|
|
8673
|
+
* Returns HTML for the help text and error message.
|
|
8674
|
+
* @private
|
|
8675
|
+
* @returns {html} - Returns HTML for the help text and error message.
|
|
8676
|
+
*/
|
|
8677
|
+
renderHtmlHelpText() {
|
|
8678
|
+
return u`
|
|
8679
|
+
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
8680
|
+
? u`
|
|
8681
|
+
<${this.helpTextTag} ?onDark="${this.onDark}">
|
|
8682
|
+
<p id="${this.uniqueId}" part="helpText">
|
|
8683
|
+
<slot name="helpText"></slot>
|
|
8684
|
+
</p>
|
|
8685
|
+
</${this.helpTextTag}>
|
|
8686
|
+
`
|
|
8687
|
+
: u`
|
|
8688
|
+
<${this.helpTextTag} error ?onDark="${this.onDark}">
|
|
8689
|
+
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
8690
|
+
${this.errorMessage}
|
|
8691
|
+
</p>
|
|
8692
|
+
</${this.helpTextTag}>
|
|
8693
|
+
`
|
|
8694
|
+
}
|
|
8695
|
+
`;
|
|
8696
|
+
}
|
|
8697
|
+
|
|
8698
|
+
/**
|
|
8699
|
+
* Returns HTML for the emphasized layout.
|
|
8700
|
+
* @private
|
|
8701
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the emphasized layout.
|
|
8702
|
+
*/
|
|
8703
|
+
renderLayoutEmphasized() {
|
|
8704
|
+
const placeholderClass = {
|
|
8705
|
+
'util_displayHidden': this.value
|
|
8706
|
+
};
|
|
8707
|
+
|
|
8708
|
+
const displayValueClasses = {
|
|
8709
|
+
'displayValue': true,
|
|
8710
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8711
|
+
'hasFocus': this.isPopoverVisible,
|
|
8712
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8713
|
+
'force': this.forceDisplayValue,
|
|
8714
|
+
};
|
|
8715
|
+
|
|
8716
|
+
const valueContainerClasses = {
|
|
8717
|
+
'valueContainer': true,
|
|
8718
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
8719
|
+
};
|
|
8720
|
+
|
|
8721
|
+
return u`
|
|
8722
|
+
<div
|
|
8723
|
+
class="${e(this.commonWrapperClasses)}"
|
|
8724
|
+
part="wrapper">
|
|
8725
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8726
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8727
|
+
</div>
|
|
8728
|
+
<${this.dropdownTag}
|
|
8729
|
+
a11yRole="select"
|
|
8730
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8731
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8732
|
+
?matchWidth="${this.matchWidth}"
|
|
8733
|
+
?noFlip="${this.noFlip}"
|
|
8734
|
+
?onDark="${this.onDark}"
|
|
8735
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8736
|
+
.offset="${this.offset}"
|
|
8737
|
+
.placement="${this.placement}"
|
|
8738
|
+
chevron
|
|
8739
|
+
fluid
|
|
8740
|
+
for="selectMenu"
|
|
8741
|
+
layout="${this.layout}"
|
|
8742
|
+
part="dropdown"
|
|
8743
|
+
shape="${this.shape}"
|
|
8744
|
+
size="${this.size}">
|
|
8745
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8746
|
+
<div class="accents left">
|
|
8747
|
+
<slot name="typeIcon"></slot>
|
|
8748
|
+
</div>
|
|
8749
|
+
<div class="mainContent">
|
|
8750
|
+
<div class="${e(valueContainerClasses)}">
|
|
8751
|
+
<label class="${e(this.commonLabelClasses)}">
|
|
8752
|
+
<slot name="label"></slot>
|
|
8753
|
+
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8754
|
+
</label>
|
|
8755
|
+
<div class="value" id="value"></div>
|
|
8756
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8757
|
+
${this.placeholder}
|
|
8758
|
+
</div>
|
|
8759
|
+
</div>
|
|
8760
|
+
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8761
|
+
<slot name="displayValue"></slot>
|
|
8762
|
+
</div>
|
|
8763
|
+
</div>
|
|
8764
|
+
<div class="accents right"></div>
|
|
8765
|
+
</div>
|
|
8766
|
+
<div class="menuWrapper"></div>
|
|
8767
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8768
|
+
<slot></slot>
|
|
8769
|
+
</${this.bibtemplateTag}>
|
|
8770
|
+
<div slot="helpText">
|
|
8771
|
+
${this.renderHtmlHelpText()}
|
|
8772
|
+
</div>
|
|
8773
|
+
</${this.dropdownTag}>
|
|
8774
|
+
</div>
|
|
8775
|
+
`;
|
|
8776
|
+
}
|
|
8777
|
+
|
|
8778
|
+
/**
|
|
8779
|
+
* Returns HTML for the snowflake layout.
|
|
6472
8780
|
* @private
|
|
8781
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the snowflake layout.
|
|
6473
8782
|
*/
|
|
6474
|
-
|
|
6475
|
-
const
|
|
6476
|
-
|
|
8783
|
+
renderLayoutSnowflake() {
|
|
8784
|
+
const placeholderClass = {
|
|
8785
|
+
'util_displayHidden': this.value
|
|
8786
|
+
};
|
|
6477
8787
|
|
|
6478
|
-
|
|
6479
|
-
|
|
8788
|
+
const displayValueClasses = {
|
|
8789
|
+
'displayValue': true,
|
|
8790
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8791
|
+
'hasFocus': this.isPopoverVisible,
|
|
8792
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8793
|
+
'force': this.forceDisplayValue,
|
|
8794
|
+
};
|
|
6480
8795
|
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
];
|
|
6486
|
-
}
|
|
6487
|
-
} else {
|
|
6488
|
-
const currentValue = this.value;
|
|
8796
|
+
const valueContainerClasses = {
|
|
8797
|
+
'valueContainer': true,
|
|
8798
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
8799
|
+
};
|
|
6489
8800
|
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
8801
|
+
return u`
|
|
8802
|
+
<div
|
|
8803
|
+
class="${e(this.commonWrapperClasses)}"
|
|
8804
|
+
part="wrapper">
|
|
8805
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8806
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8807
|
+
</div>
|
|
8808
|
+
<${this.dropdownTag}
|
|
8809
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8810
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8811
|
+
?matchWidth="${this.matchWidth}"
|
|
8812
|
+
?noFlip="${this.noFlip}"
|
|
8813
|
+
?onDark="${this.onDark}"
|
|
8814
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8815
|
+
.offset="${this.offset}"
|
|
8816
|
+
.placement="${this.placement}"
|
|
8817
|
+
chevron
|
|
8818
|
+
fluid
|
|
8819
|
+
for="selectMenu"
|
|
8820
|
+
layout="${this.layout}"
|
|
8821
|
+
part="dropdown"
|
|
8822
|
+
shape="${this.shape}"
|
|
8823
|
+
size="${this.size}">
|
|
8824
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8825
|
+
<div class="accents left">
|
|
8826
|
+
<slot name="typeIcon"></slot>
|
|
8827
|
+
</div>
|
|
8828
|
+
<div class="mainContent">
|
|
8829
|
+
<div class="${e(valueContainerClasses)}">
|
|
8830
|
+
<label class="${e(this.commonLabelClasses)}">
|
|
8831
|
+
<slot name="label"></slot>
|
|
8832
|
+
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8833
|
+
</label>
|
|
8834
|
+
<div class="value" id="value"></div>
|
|
8835
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8836
|
+
${this.placeholder}
|
|
8837
|
+
</div>
|
|
8838
|
+
</div>
|
|
8839
|
+
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8840
|
+
<slot name="displayValue"></slot>
|
|
8841
|
+
</div>
|
|
8842
|
+
</div>
|
|
8843
|
+
<div class="accents right"></div>
|
|
8844
|
+
</div>
|
|
8845
|
+
<div class="menuWrapper"></div>
|
|
8846
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8847
|
+
<slot></slot>
|
|
8848
|
+
</${this.bibtemplateTag}>
|
|
8849
|
+
<div slot="helpText">
|
|
8850
|
+
${this.renderHtmlHelpText()}
|
|
8851
|
+
</div>
|
|
8852
|
+
</${this.dropdownTag}>
|
|
8853
|
+
${this.renderNativeSelect()}
|
|
8854
|
+
</div>
|
|
8855
|
+
`;
|
|
6494
8856
|
}
|
|
6495
8857
|
|
|
6496
8858
|
/**
|
|
6497
|
-
*
|
|
6498
|
-
* @returns {void}
|
|
8859
|
+
* Returns HTML for the classic layout.
|
|
6499
8860
|
* @private
|
|
8861
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the classic layout.
|
|
6500
8862
|
*/
|
|
6501
|
-
|
|
6502
|
-
const
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
}
|
|
6506
|
-
|
|
6507
|
-
if (this.multiSelect) {
|
|
6508
|
-
nativeSelect.value = this.value ? this.value[0] : '';
|
|
6509
|
-
} else {
|
|
6510
|
-
nativeSelect.value = this.value || '';
|
|
6511
|
-
}
|
|
6512
|
-
}
|
|
8863
|
+
renderLayoutClassic() {
|
|
8864
|
+
const placeholderClass = {
|
|
8865
|
+
'util_displayHidden': this.value
|
|
8866
|
+
};
|
|
6513
8867
|
|
|
6514
|
-
|
|
6515
|
-
|
|
8868
|
+
const displayValueClasses = {
|
|
8869
|
+
'displayValue': true,
|
|
8870
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8871
|
+
'hasFocus': this.isPopoverVisible,
|
|
8872
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8873
|
+
'force': this.forceDisplayValue,
|
|
8874
|
+
};
|
|
6516
8875
|
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
hidden: this.value,
|
|
8876
|
+
const valueContainerClasses = {
|
|
8877
|
+
'valueContainer': true,
|
|
8878
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
6521
8879
|
};
|
|
6522
8880
|
|
|
6523
8881
|
return u`
|
|
6524
|
-
<div
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
? u`
|
|
6528
|
-
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
6529
|
-
`
|
|
6530
|
-
: undefined
|
|
6531
|
-
};
|
|
6532
|
-
|
|
6533
|
-
${this.optionSelected && this.options.length > 0
|
|
6534
|
-
? u`
|
|
6535
|
-
${`${this.optionSelected.innerText} selected`}
|
|
6536
|
-
`
|
|
6537
|
-
: undefined
|
|
6538
|
-
};
|
|
6539
|
-
</div>
|
|
8882
|
+
<div
|
|
8883
|
+
class="${e(this.commonWrapperClasses)}"
|
|
8884
|
+
part="wrapper">
|
|
6540
8885
|
<div id="slotHolder" aria-hidden="true">
|
|
6541
8886
|
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
6542
8887
|
</div>
|
|
6543
8888
|
<${this.dropdownTag}
|
|
6544
|
-
|
|
8889
|
+
?autoPlacement="${this.autoPlacement}"
|
|
6545
8890
|
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8891
|
+
?matchWidth="${!this.flexMenuWidth}"
|
|
8892
|
+
?noFlip="${this.noFlip}"
|
|
6546
8893
|
?onDark="${this.onDark}"
|
|
6547
|
-
common
|
|
6548
|
-
fluid
|
|
6549
8894
|
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
6550
|
-
?matchWidth="${!this.flexMenuWidth}"
|
|
6551
|
-
chevron
|
|
6552
|
-
.placement="${this.placement}"
|
|
6553
8895
|
.offset="${this.offset}"
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
8896
|
+
.placement="${this.placement}"
|
|
8897
|
+
chevron
|
|
8898
|
+
fluid
|
|
8899
|
+
for="selectMenu"
|
|
8900
|
+
layout="${this.layout}"
|
|
8901
|
+
part="dropdown"
|
|
8902
|
+
shape="${this.shape}"
|
|
8903
|
+
size="${this.size}">
|
|
8904
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8905
|
+
<div class="accents left">
|
|
8906
|
+
<slot name="typeIcon"></slot>
|
|
8907
|
+
</div>
|
|
8908
|
+
<div class="mainContent">
|
|
8909
|
+
<div class="${e(valueContainerClasses)}">
|
|
8910
|
+
<label class="${e(this.commonLabelClasses)}">
|
|
8911
|
+
<slot name="label"></slot>
|
|
8912
|
+
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8913
|
+
</label>
|
|
8914
|
+
<div class="value" id="value"></div>
|
|
8915
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8916
|
+
${this.placeholder}
|
|
8917
|
+
</div>
|
|
8918
|
+
</div>
|
|
8919
|
+
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8920
|
+
<slot name="displayValue"></slot>
|
|
8921
|
+
</div>
|
|
8922
|
+
</div>
|
|
8923
|
+
<div class="accents right"></div>
|
|
6568
8924
|
</div>
|
|
6569
|
-
|
|
8925
|
+
<div class="menuWrapper"></div>
|
|
6570
8926
|
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8927
|
+
<slot></slot>
|
|
6571
8928
|
</${this.bibtemplateTag}>
|
|
6572
|
-
<
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
? u`
|
|
6576
|
-
<span id="${this.uniqueId}" part="helpText">
|
|
6577
|
-
<slot name="helpText"></slot>
|
|
6578
|
-
</span>`
|
|
6579
|
-
: u`
|
|
6580
|
-
<span id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
6581
|
-
${this.errorMessage}
|
|
6582
|
-
</span>`
|
|
6583
|
-
}
|
|
6584
|
-
</p>
|
|
8929
|
+
<div slot="helpText">
|
|
8930
|
+
${this.renderHtmlHelpText()}
|
|
8931
|
+
</div>
|
|
6585
8932
|
</${this.dropdownTag}>
|
|
6586
|
-
|
|
6587
|
-
<select
|
|
6588
|
-
tabindex="-1"
|
|
6589
|
-
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
6590
|
-
name="${this.name || ''}"
|
|
6591
|
-
?disabled="${this.disabled}"
|
|
6592
|
-
?required="${this.required}"
|
|
6593
|
-
aria-hidden="true"
|
|
6594
|
-
autocomplete="${o(this.autocomplete)}"
|
|
6595
|
-
@change="${this._handleNativeSelectChange}">
|
|
6596
|
-
<option value="" ?selected="${!this.value}"></option>
|
|
6597
|
-
${this.options.map((option) => {
|
|
6598
|
-
const optionValue = option.value || option.textContent;
|
|
6599
|
-
return u`
|
|
6600
|
-
<option
|
|
6601
|
-
value="${optionValue}"
|
|
6602
|
-
?selected="${this.value === optionValue}">
|
|
6603
|
-
${option.textContent}
|
|
6604
|
-
</option>
|
|
6605
|
-
`;
|
|
6606
|
-
})}
|
|
6607
|
-
</select>
|
|
6608
|
-
</div>
|
|
6609
|
-
<!-- Help text and error message template -->
|
|
8933
|
+
${this.renderNativeSelect()}
|
|
6610
8934
|
</div>
|
|
6611
8935
|
`;
|
|
6612
8936
|
}
|
|
8937
|
+
|
|
8938
|
+
/**
|
|
8939
|
+
* Logic to determine the layout of the component.
|
|
8940
|
+
* @private
|
|
8941
|
+
* @param {string} [ForcedLayout] - Used to force a specific layout, pass in the layout name to use.
|
|
8942
|
+
* @returns {void}
|
|
8943
|
+
*/
|
|
8944
|
+
renderLayout(ForcedLayout) {
|
|
8945
|
+
const layout = ForcedLayout || this.layout;
|
|
8946
|
+
|
|
8947
|
+
switch (layout) {
|
|
8948
|
+
case 'emphasized':
|
|
8949
|
+
return this.renderLayoutEmphasized();
|
|
8950
|
+
case 'emphasized-left':
|
|
8951
|
+
return this.renderLayoutEmphasized();
|
|
8952
|
+
case 'emphasized-right':
|
|
8953
|
+
return this.renderLayoutEmphasized();
|
|
8954
|
+
case 'snowflake':
|
|
8955
|
+
return this.renderLayoutSnowflake();
|
|
8956
|
+
case 'snowflake-left':
|
|
8957
|
+
return this.renderLayoutSnowflake();
|
|
8958
|
+
case 'snowflake-right':
|
|
8959
|
+
return this.renderLayoutSnowflake();
|
|
8960
|
+
default:
|
|
8961
|
+
return this.renderLayoutClassic();
|
|
8962
|
+
}
|
|
8963
|
+
}
|
|
8964
|
+
|
|
8965
|
+
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
8966
|
+
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
6613
8967
|
}
|
|
6614
8968
|
|
|
6615
|
-
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:
|
|
8969
|
+
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)}`;
|
|
6616
8970
|
|
|
6617
8971
|
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)}`;
|
|
6618
8972
|
|
|
6619
|
-
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)}`;
|
|
8973
|
+
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)}`;
|
|
6620
8974
|
|
|
6621
8975
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6622
8976
|
// See LICENSE in the project root for license information.
|
|
@@ -6682,14 +9036,17 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
6682
9036
|
* @slot - Slot for insertion of menu options.
|
|
6683
9037
|
*/
|
|
6684
9038
|
|
|
6685
|
-
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens */
|
|
9039
|
+
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens, no-inline-comments, line-comment-position */
|
|
6686
9040
|
|
|
6687
|
-
class AuroMenu extends
|
|
9041
|
+
class AuroMenu extends AuroElement$4 {
|
|
6688
9042
|
constructor() {
|
|
6689
9043
|
super();
|
|
6690
9044
|
|
|
6691
9045
|
// State properties (reactive)
|
|
6692
9046
|
|
|
9047
|
+
this.shape = ""; // box, rounded, pill
|
|
9048
|
+
this.size = ""; // md, lg, xl
|
|
9049
|
+
|
|
6693
9050
|
// Value of the selected options
|
|
6694
9051
|
this.value = undefined;
|
|
6695
9052
|
// Currently selected option
|
|
@@ -6748,6 +9105,7 @@ class AuroMenu extends i$2 {
|
|
|
6748
9105
|
|
|
6749
9106
|
static get properties() {
|
|
6750
9107
|
return {
|
|
9108
|
+
...super.properties,
|
|
6751
9109
|
noCheckmark: {
|
|
6752
9110
|
type: Boolean,
|
|
6753
9111
|
reflect: true,
|
|
@@ -6781,6 +9139,16 @@ class AuroMenu extends i$2 {
|
|
|
6781
9139
|
value: {
|
|
6782
9140
|
// Allow string, string[] arrays and undefined
|
|
6783
9141
|
type: Object
|
|
9142
|
+
},
|
|
9143
|
+
|
|
9144
|
+
/**
|
|
9145
|
+
* Indent level for submenus.
|
|
9146
|
+
* @private
|
|
9147
|
+
*/
|
|
9148
|
+
level: {
|
|
9149
|
+
type: Number,
|
|
9150
|
+
reflect: false,
|
|
9151
|
+
attribute: false
|
|
6784
9152
|
}
|
|
6785
9153
|
};
|
|
6786
9154
|
}
|
|
@@ -6802,7 +9170,7 @@ class AuroMenu extends i$2 {
|
|
|
6802
9170
|
*
|
|
6803
9171
|
*/
|
|
6804
9172
|
static register(name = "auro-menu") {
|
|
6805
|
-
AuroLibraryRuntimeUtils$
|
|
9173
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenu);
|
|
6806
9174
|
}
|
|
6807
9175
|
|
|
6808
9176
|
// Lifecycle Methods
|
|
@@ -6814,6 +9182,7 @@ class AuroMenu extends i$2 {
|
|
|
6814
9182
|
this.addEventListener('mousedown', this.handleMouseSelect);
|
|
6815
9183
|
this.addEventListener('auroMenuOption-mouseover', this.handleOptionHover);
|
|
6816
9184
|
this.addEventListener('slotchange', this.handleSlotChange);
|
|
9185
|
+
this.setTagAttribute("auro-menu");
|
|
6817
9186
|
}
|
|
6818
9187
|
|
|
6819
9188
|
disconnectedCallback() {
|
|
@@ -6826,19 +9195,33 @@ class AuroMenu extends i$2 {
|
|
|
6826
9195
|
}
|
|
6827
9196
|
|
|
6828
9197
|
firstUpdated() {
|
|
6829
|
-
AuroLibraryRuntimeUtils$
|
|
9198
|
+
AuroLibraryRuntimeUtils$6.prototype.handleComponentTagRename(this, 'auro-menu');
|
|
6830
9199
|
|
|
6831
9200
|
this.loadingSlots = this.querySelectorAll("[slot='loadingText'], [slot='loadingIcon']");
|
|
6832
9201
|
this.initializeMenu();
|
|
6833
9202
|
}
|
|
6834
9203
|
|
|
9204
|
+
/**
|
|
9205
|
+
* Sets an attribute that matches the default tag name if the tag name is not the default.
|
|
9206
|
+
* @param {string} tagName - The tag name to set as an attribute.
|
|
9207
|
+
* @private
|
|
9208
|
+
*/
|
|
9209
|
+
setTagAttribute(tagName) {
|
|
9210
|
+
if (this.tagName.toLowerCase() !== tagName) {
|
|
9211
|
+
this.setAttribute(tagName, true);
|
|
9212
|
+
}
|
|
9213
|
+
}
|
|
9214
|
+
|
|
6835
9215
|
updated(changedProperties) {
|
|
9216
|
+
super.updated(changedProperties);
|
|
9217
|
+
|
|
6836
9218
|
if (changedProperties.has('multiSelect')) {
|
|
6837
9219
|
// Reset selection if multiSelect mode changes
|
|
6838
9220
|
this.clearSelection();
|
|
6839
9221
|
}
|
|
6840
9222
|
|
|
6841
|
-
|
|
9223
|
+
|
|
9224
|
+
if (changedProperties.has("value")) {
|
|
6842
9225
|
// Handle null/undefined case
|
|
6843
9226
|
if (this.value === undefined || this.value === null) {
|
|
6844
9227
|
this.optionSelected = undefined;
|
|
@@ -6906,6 +9289,19 @@ class AuroMenu extends i$2 {
|
|
|
6906
9289
|
this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]').forEach((element) => element.setAttribute('noCheckmark', ''));
|
|
6907
9290
|
}
|
|
6908
9291
|
|
|
9292
|
+
// Handle layout propagation to all menus and options
|
|
9293
|
+
const propagationTargets = this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]');
|
|
9294
|
+
[
|
|
9295
|
+
'size',
|
|
9296
|
+
'shape'
|
|
9297
|
+
].forEach((prop) => {
|
|
9298
|
+
if (changedProperties.has(prop)) {
|
|
9299
|
+
propagationTargets.forEach((el) => {
|
|
9300
|
+
el.setAttribute(prop, this[prop]);
|
|
9301
|
+
});
|
|
9302
|
+
}
|
|
9303
|
+
});
|
|
9304
|
+
|
|
6909
9305
|
// Regex for matchWord if needed
|
|
6910
9306
|
let regexWord = null;
|
|
6911
9307
|
|
|
@@ -7102,21 +9498,20 @@ class AuroMenu extends i$2 {
|
|
|
7102
9498
|
* @param {HTMLElement} menu - Root menu element.
|
|
7103
9499
|
*/
|
|
7104
9500
|
handleNestedMenus(menu) {
|
|
7105
|
-
|
|
9501
|
+
menu.level = menu.parentElement.level >= 0 ? menu.parentElement.level + 1 : 0;
|
|
7106
9502
|
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
if (!
|
|
7111
|
-
|
|
9503
|
+
if (menu.level > 0) {
|
|
9504
|
+
menu.setAttribute('role', 'group');
|
|
9505
|
+
menu.removeAttribute("root");
|
|
9506
|
+
if (!menu.hasAttribute('aria-label')) {
|
|
9507
|
+
menu.setAttribute('aria-label', 'submenu');
|
|
7112
9508
|
}
|
|
9509
|
+
}
|
|
7113
9510
|
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
this.handleNestedMenus(nestedMenu);
|
|
9511
|
+
const options = menu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption]');
|
|
9512
|
+
options.forEach((option) => {
|
|
9513
|
+
const regex = new RegExp(this.nestingSpacer, "gu");
|
|
9514
|
+
option.innerHTML = this.nestingSpacer.repeat(menu.level) + option.innerHTML.replace(regex, '');
|
|
7120
9515
|
});
|
|
7121
9516
|
}
|
|
7122
9517
|
|
|
@@ -7358,28 +9753,39 @@ class AuroMenu extends i$2 {
|
|
|
7358
9753
|
}
|
|
7359
9754
|
|
|
7360
9755
|
/**
|
|
7361
|
-
*
|
|
7362
|
-
* @
|
|
9756
|
+
* Logic to determine the layout of the component.
|
|
9757
|
+
* @protected
|
|
9758
|
+
* @returns {void}
|
|
7363
9759
|
*/
|
|
7364
|
-
|
|
9760
|
+
renderLayout() {
|
|
7365
9761
|
if (this.loading) {
|
|
7366
9762
|
return x`
|
|
7367
|
-
<
|
|
7368
|
-
<
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
9763
|
+
<div class="wrapper">
|
|
9764
|
+
<auro-menuoption
|
|
9765
|
+
disabled
|
|
9766
|
+
loadingplaceholder
|
|
9767
|
+
class="${this.hasLoadingPlaceholder ? "" : "empty"}"
|
|
9768
|
+
>
|
|
9769
|
+
<div>
|
|
9770
|
+
<slot name="loadingIcon"></slot>
|
|
9771
|
+
<slot name="loadingText"></slot>
|
|
9772
|
+
</div>
|
|
9773
|
+
</auro-menuoption>
|
|
9774
|
+
</div>
|
|
7373
9775
|
`;
|
|
7374
9776
|
}
|
|
7375
9777
|
|
|
7376
|
-
return x
|
|
9778
|
+
return x`
|
|
9779
|
+
<div class="wrapper">
|
|
9780
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
9781
|
+
</div>
|
|
9782
|
+
`;
|
|
7377
9783
|
}
|
|
7378
9784
|
}
|
|
7379
9785
|
|
|
7380
|
-
var styleCss$1 = i$5`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-
|
|
9786
|
+
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}`;
|
|
7381
9787
|
|
|
7382
|
-
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)}`;
|
|
9788
|
+
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)}`;
|
|
7383
9789
|
|
|
7384
9790
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7385
9791
|
// See LICENSE in the project root for license information.
|
|
@@ -7535,6 +9941,76 @@ var tokensCss = i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-def
|
|
|
7535
9941
|
|
|
7536
9942
|
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)}`;
|
|
7537
9943
|
|
|
9944
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
9945
|
+
// See LICENSE in the project root for license information.
|
|
9946
|
+
|
|
9947
|
+
// ---------------------------------------------------------------------
|
|
9948
|
+
|
|
9949
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
9950
|
+
|
|
9951
|
+
class AuroLibraryRuntimeUtils {
|
|
9952
|
+
|
|
9953
|
+
/* eslint-disable jsdoc/require-param */
|
|
9954
|
+
|
|
9955
|
+
/**
|
|
9956
|
+
* This will register a new custom element with the browser.
|
|
9957
|
+
* @param {String} name - The name of the custom element.
|
|
9958
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
9959
|
+
* @returns {void}
|
|
9960
|
+
*/
|
|
9961
|
+
registerComponent(name, componentClass) {
|
|
9962
|
+
if (!customElements.get(name)) {
|
|
9963
|
+
customElements.define(name, class extends componentClass {});
|
|
9964
|
+
}
|
|
9965
|
+
}
|
|
9966
|
+
|
|
9967
|
+
/**
|
|
9968
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
9969
|
+
* @returns {void}
|
|
9970
|
+
*/
|
|
9971
|
+
closestElement(
|
|
9972
|
+
selector, // selector like in .closest()
|
|
9973
|
+
base = this, // extra functionality to skip a parent
|
|
9974
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
9975
|
+
!el || el === document || el === window
|
|
9976
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
9977
|
+
: found
|
|
9978
|
+
? found // found a selector INside this element
|
|
9979
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
9980
|
+
) {
|
|
9981
|
+
return __Closest(base);
|
|
9982
|
+
}
|
|
9983
|
+
/* eslint-enable jsdoc/require-param */
|
|
9984
|
+
|
|
9985
|
+
/**
|
|
9986
|
+
* 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.
|
|
9987
|
+
* @param {Object} elem - The element to check.
|
|
9988
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
9989
|
+
* @returns {void}
|
|
9990
|
+
*/
|
|
9991
|
+
handleComponentTagRename(elem, tagName) {
|
|
9992
|
+
const tag = tagName.toLowerCase();
|
|
9993
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
9994
|
+
|
|
9995
|
+
if (elemTag !== tag) {
|
|
9996
|
+
elem.setAttribute(tag, true);
|
|
9997
|
+
}
|
|
9998
|
+
}
|
|
9999
|
+
|
|
10000
|
+
/**
|
|
10001
|
+
* Validates if an element is a specific Auro component.
|
|
10002
|
+
* @param {Object} elem - The element to validate.
|
|
10003
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
10004
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
10005
|
+
*/
|
|
10006
|
+
elementMatch(elem, tagName) {
|
|
10007
|
+
const tag = tagName.toLowerCase();
|
|
10008
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
10009
|
+
|
|
10010
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
10011
|
+
}
|
|
10012
|
+
}
|
|
10013
|
+
|
|
7538
10014
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7539
10015
|
// See LICENSE in the project root for license information.
|
|
7540
10016
|
|
|
@@ -7554,7 +10030,7 @@ class AuroIcon extends BaseIcon {
|
|
|
7554
10030
|
*/
|
|
7555
10031
|
privateDefaults() {
|
|
7556
10032
|
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
7557
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils
|
|
10033
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
7558
10034
|
}
|
|
7559
10035
|
|
|
7560
10036
|
// function to define props used within the scope of this component
|
|
@@ -7636,7 +10112,7 @@ class AuroIcon extends BaseIcon {
|
|
|
7636
10112
|
*
|
|
7637
10113
|
*/
|
|
7638
10114
|
static register(name = "auro-icon") {
|
|
7639
|
-
AuroLibraryRuntimeUtils
|
|
10115
|
+
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroIcon);
|
|
7640
10116
|
}
|
|
7641
10117
|
|
|
7642
10118
|
connectedCallback() {
|
|
@@ -7657,8 +10133,12 @@ class AuroIcon extends BaseIcon {
|
|
|
7657
10133
|
async firstUpdated() {
|
|
7658
10134
|
await super.firstUpdated();
|
|
7659
10135
|
|
|
7660
|
-
|
|
7661
|
-
|
|
10136
|
+
/**
|
|
10137
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
10138
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
10139
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
10140
|
+
*/
|
|
10141
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
7662
10142
|
const svgDesc = this.svg.querySelector('desc');
|
|
7663
10143
|
|
|
7664
10144
|
if (svgDesc) {
|
|
@@ -7702,7 +10182,7 @@ class AuroIcon extends BaseIcon {
|
|
|
7702
10182
|
}
|
|
7703
10183
|
}
|
|
7704
10184
|
|
|
7705
|
-
var iconVersion = '8.0.
|
|
10185
|
+
var iconVersion = '8.0.4';
|
|
7706
10186
|
|
|
7707
10187
|
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>"};
|
|
7708
10188
|
|
|
@@ -7720,10 +10200,13 @@ var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlin
|
|
|
7720
10200
|
* @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
|
|
7721
10201
|
* @slot - Specifies text for an option, but is not the value.
|
|
7722
10202
|
*/
|
|
7723
|
-
class AuroMenuOption extends
|
|
10203
|
+
class AuroMenuOption extends AuroElement$4 {
|
|
7724
10204
|
constructor() {
|
|
7725
10205
|
super();
|
|
7726
10206
|
|
|
10207
|
+
this.size = ""; // md, lg, xl
|
|
10208
|
+
this.shape = ""; // box, rounded, pill
|
|
10209
|
+
|
|
7727
10210
|
/**
|
|
7728
10211
|
* Generate unique names for dependency components.
|
|
7729
10212
|
*/
|
|
@@ -7742,11 +10225,12 @@ class AuroMenuOption extends i$2 {
|
|
|
7742
10225
|
/**
|
|
7743
10226
|
* @private
|
|
7744
10227
|
*/
|
|
7745
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
10228
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
7746
10229
|
}
|
|
7747
10230
|
|
|
7748
10231
|
static get properties() {
|
|
7749
10232
|
return {
|
|
10233
|
+
...super.properties,
|
|
7750
10234
|
nocheckmark: {
|
|
7751
10235
|
type: Boolean,
|
|
7752
10236
|
reflect: true
|
|
@@ -7786,7 +10270,7 @@ class AuroMenuOption extends i$2 {
|
|
|
7786
10270
|
*
|
|
7787
10271
|
*/
|
|
7788
10272
|
static register(name = "auro-menuoption") {
|
|
7789
|
-
AuroLibraryRuntimeUtils$
|
|
10273
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenuOption);
|
|
7790
10274
|
}
|
|
7791
10275
|
|
|
7792
10276
|
firstUpdated() {
|
|
@@ -7808,6 +10292,8 @@ class AuroMenuOption extends i$2 {
|
|
|
7808
10292
|
|
|
7809
10293
|
// observer for selected property changes
|
|
7810
10294
|
updated(changedProperties) {
|
|
10295
|
+
super.updated(changedProperties);
|
|
10296
|
+
|
|
7811
10297
|
if (changedProperties.has('selected')) {
|
|
7812
10298
|
this.setAttribute('aria-selected', this.selected.toString());
|
|
7813
10299
|
}
|
|
@@ -7829,10 +10315,19 @@ class AuroMenuOption extends i$2 {
|
|
|
7829
10315
|
return u`<${this.iconTag} customColor customSvg slot="icon">${svg}</${this.iconTag}>`;
|
|
7830
10316
|
}
|
|
7831
10317
|
|
|
7832
|
-
|
|
10318
|
+
/**
|
|
10319
|
+
* Logic to determine the layout of the component.
|
|
10320
|
+
* @protected
|
|
10321
|
+
* @returns {void}
|
|
10322
|
+
*/
|
|
10323
|
+
renderLayout() {
|
|
7833
10324
|
return u`
|
|
7834
|
-
|
|
7835
|
-
|
|
10325
|
+
<div class="wrapper">
|
|
10326
|
+
${this.selected && !this.nocheckmark
|
|
10327
|
+
? this.generateIconHtml(checkmarkIcon.svg)
|
|
10328
|
+
: undefined}
|
|
10329
|
+
<slot></slot>
|
|
10330
|
+
</div>
|
|
7836
10331
|
`;
|
|
7837
10332
|
}
|
|
7838
10333
|
}
|