@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.2 → 0.0.0-pr624.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/bibtemplate/dist/auro-bibtemplate.d.ts +13 -2
- package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +1292 -79
- package/components/bibtemplate/dist/registered.js +1292 -79
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/api.md +8 -9
- package/components/checkbox/demo/api.min.js +30 -24
- package/components/checkbox/demo/index.md +2 -2
- package/components/checkbox/demo/index.min.js +30 -24
- package/components/checkbox/demo/readme.md +1 -1
- package/components/checkbox/dist/auro-checkbox.d.ts +3 -3
- package/components/checkbox/dist/index.js +30 -24
- package/components/checkbox/dist/registered.js +30 -24
- package/components/combobox/demo/api.md +53 -0
- package/components/combobox/demo/api.min.js +2898 -753
- package/components/combobox/demo/index.md +6 -0
- package/components/combobox/demo/index.min.js +2898 -753
- package/components/combobox/dist/auro-combobox.d.ts +12 -12
- package/components/combobox/dist/index.js +2646 -642
- package/components/combobox/dist/registered.js +2646 -642
- package/components/counter/demo/api.md +21 -19
- package/components/counter/demo/api.min.js +3648 -929
- package/components/counter/demo/index.md +99 -34
- package/components/counter/demo/index.min.js +3648 -929
- package/components/counter/dist/auro-counter-button.d.ts +2 -0
- package/components/counter/dist/auro-counter-group.d.ts +105 -6
- package/components/counter/dist/auro-counter.d.ts +6 -0
- package/components/counter/dist/helptextVersion.d.ts +2 -0
- package/components/counter/dist/iconVersion.d.ts +1 -1
- package/components/counter/dist/index.js +3648 -929
- package/components/counter/dist/registered.js +3648 -929
- package/components/datepicker/demo/api.md +36 -19
- package/components/datepicker/demo/api.min.js +11437 -7744
- package/components/datepicker/demo/index.md +80 -0
- package/components/datepicker/demo/index.min.js +11437 -7744
- package/components/datepicker/dist/auro-datepicker.d.ts +71 -3
- package/components/datepicker/dist/buttonVersion.d.ts +1 -1
- package/components/datepicker/dist/iconVersion.d.ts +2 -0
- package/components/datepicker/dist/index.js +13847 -10154
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +13847 -10154
- package/components/dropdown/demo/api.md +6 -7
- package/components/dropdown/demo/api.min.js +238 -144
- package/components/dropdown/demo/index.md +57 -9
- package/components/dropdown/demo/index.min.js +238 -144
- package/components/dropdown/dist/auro-dropdown.d.ts +10 -9
- package/components/dropdown/dist/auro-dropdownBib.d.ts +22 -0
- package/components/dropdown/dist/index.js +238 -144
- package/components/dropdown/dist/registered.js +238 -144
- package/components/form/demo/api.min.js +1 -1
- package/components/form/demo/index.min.js +1 -1
- package/components/form/dist/index.js +1 -1
- package/components/form/dist/registered.js +1 -1
- package/components/helptext/dist/index.js +2 -2
- package/components/helptext/dist/registered.js +2 -2
- package/components/input/demo/api.md +63 -56
- package/components/input/demo/api.min.js +983 -269
- package/components/input/demo/index.min.js +982 -268
- package/components/input/dist/auro-input.d.ts +202 -14
- package/components/input/dist/base-input.d.ts +30 -7
- package/components/input/dist/buttonVersion.d.ts +1 -1
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +982 -268
- package/components/input/dist/registered.js +982 -268
- package/components/layoutElement/dist/index.js +13 -10
- package/components/menu/demo/api.html +38 -0
- package/components/menu/demo/api.md +68 -7
- package/components/menu/demo/api.min.js +278 -42
- package/components/menu/demo/index.min.js +278 -42
- package/components/menu/dist/auro-menu.d.ts +28 -5
- package/components/menu/dist/auro-menuoption.d.ts +15 -3
- package/components/menu/dist/iconVersion.d.ts +1 -1
- package/components/menu/dist/index.js +278 -42
- package/components/menu/dist/registered.js +278 -42
- package/components/menu/dist/styles/default/color-menuoption-css.d.ts +2 -0
- package/components/menu/dist/styles/default/style-menu-css.d.ts +2 -0
- package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
- package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
- package/components/radio/demo/api.md +2 -2
- package/components/radio/demo/api.min.js +10 -7
- package/components/radio/demo/index.min.js +10 -7
- package/components/radio/dist/auro-radio.d.ts +1 -1
- package/components/radio/dist/index.js +10 -7
- package/components/radio/dist/registered.js +10 -7
- package/components/select/demo/api.js +2 -0
- package/components/select/demo/api.md +78 -12
- package/components/select/demo/api.min.js +2797 -538
- package/components/select/demo/index.html +1 -0
- package/components/select/demo/index.md +325 -763
- package/components/select/demo/index.min.js +2790 -543
- package/components/select/dist/auro-select.d.ts +111 -11
- package/components/select/dist/helptextVersion.d.ts +2 -0
- package/components/select/dist/index.js +2533 -427
- package/components/select/dist/registered.js +2533 -427
- package/components/select/dist/styles/shapeSize-css.d.ts +2 -0
- package/components/select/dist/styles/tokens-css.d.ts +2 -0
- package/package.json +6 -4
- /package/components/{dropdown/dist/styles/default/bibColors-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/{dropdown → datepicker}/dist/styles/default/color-css.d.ts +0 -0
- /package/components/{dropdown/dist/styles/default/bibStyles-css.d.ts → datepicker/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/{dropdown/dist/styles/default/style-css.d.ts → datepicker/dist/styles/snowflake/color-css.d.ts} +0 -0
- /package/components/{dropdown/dist/styles → datepicker/dist/styles/snowflake}/style-css.d.ts +0 -0
- /package/components/{menu/dist/styles/color-menu-css.d.ts → dropdown/dist/styles/classic/bibColors-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/color-menuoption-css.d.ts → dropdown/dist/styles/classic/bibStyles-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/style-menu-css.d.ts → dropdown/dist/styles/classic/color-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/style-menuoption-css.d.ts → dropdown/dist/styles/classic/style-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{tokens-css.d.ts → default/color-menu-css.d.ts} +0 -0
|
@@ -90,6 +90,17 @@ function auroMenuLoadingExample() {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
function valueTextExample() {
|
|
94
|
+
const onValueTextSelectInput = (e) => {
|
|
95
|
+
const valueText = e.target.querySelector("[slot=valueText]");
|
|
96
|
+
|
|
97
|
+
valueText.textContent = e.detail.optionSelected.dataset.display;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const select = document.querySelector("#valueTextExample");
|
|
101
|
+
select.addEventListener('input', onValueTextSelectInput);
|
|
102
|
+
}
|
|
103
|
+
|
|
93
104
|
/**
|
|
94
105
|
* @license
|
|
95
106
|
* Copyright 2019 Google LLC
|
|
@@ -136,6 +147,105 @@ const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});let i$1 = cl
|
|
|
136
147
|
*/
|
|
137
148
|
const a=Symbol.for(""),o$1=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litStatic$:t,r:a}),i=(t,...r)=>({_$litStatic$:r.reduce(((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[a+1]),t[0]),r:a}),l=new Map,n=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=false;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o$1(i));)c+=s+r[++$],f=true;$!==a&&u.push(i),n.push(c),$++;}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l.get(t))&&(n.raw=n,l.set(t,r=n)),e=u;}return t(r,...e)},u=n(x);
|
|
138
149
|
|
|
150
|
+
let AuroElement$4 = class AuroElement extends i$2 {
|
|
151
|
+
static get properties() {
|
|
152
|
+
return {
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Defines the language of an element.
|
|
156
|
+
* @default {'default'}
|
|
157
|
+
*/
|
|
158
|
+
layout: {
|
|
159
|
+
type: String,
|
|
160
|
+
attribute: "layout",
|
|
161
|
+
reflect: true
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
shape: {
|
|
165
|
+
type: String,
|
|
166
|
+
attribute: "shape",
|
|
167
|
+
reflect: true
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
size: {
|
|
171
|
+
type: String,
|
|
172
|
+
attribute: "size",
|
|
173
|
+
reflect: true
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
onDark: {
|
|
177
|
+
type: Boolean,
|
|
178
|
+
attribute: "ondark",
|
|
179
|
+
reflect: true
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
resetShapeClasses() {
|
|
185
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
186
|
+
|
|
187
|
+
if (wrapper) {
|
|
188
|
+
wrapper.classList.forEach((className) => {
|
|
189
|
+
if (className.startsWith('shape-')) {
|
|
190
|
+
wrapper.classList.remove(className);
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (this.shape && this.size) {
|
|
197
|
+
wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
198
|
+
} else {
|
|
199
|
+
wrapper.classList.add('shape-none');
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
resetLayoutClasses() {
|
|
204
|
+
if (this.layout) {
|
|
205
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
206
|
+
|
|
207
|
+
if (wrapper) {
|
|
208
|
+
wrapper.classList.forEach((className) => {
|
|
209
|
+
if (className.startsWith('layout-')) {
|
|
210
|
+
wrapper.classList.remove(className);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
updateComponentArchitecture() {
|
|
220
|
+
this.resetLayoutClasses();
|
|
221
|
+
this.resetShapeClasses();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
updated(changedProperties) {
|
|
225
|
+
if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
|
|
226
|
+
this.updateComponentArchitecture();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
|
|
231
|
+
// This will catch if an invalid layout value is passed in and render the default layout if so.
|
|
232
|
+
render() {
|
|
233
|
+
try {
|
|
234
|
+
return this.renderLayout();
|
|
235
|
+
} catch (error) {
|
|
236
|
+
// failed to get the defined layout
|
|
237
|
+
console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
|
|
238
|
+
|
|
239
|
+
// fallback to the default layout
|
|
240
|
+
return this.getLayout('default');
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
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}`;
|
|
246
|
+
|
|
247
|
+
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}`;
|
|
248
|
+
|
|
139
249
|
class DateFormatter {
|
|
140
250
|
|
|
141
251
|
constructor() {
|
|
@@ -192,9 +302,10 @@ class DateFormatter {
|
|
|
192
302
|
/**
|
|
193
303
|
* Convert a date object to string format.
|
|
194
304
|
* @param {Object} date - Date to convert to string.
|
|
195
|
-
* @
|
|
305
|
+
* @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
|
|
306
|
+
* @returns {String} Returns the date as a string.
|
|
196
307
|
*/
|
|
197
|
-
this.getDateAsString = (date) => date.toLocaleDateString(
|
|
308
|
+
this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
|
|
198
309
|
year: "numeric",
|
|
199
310
|
month: "2-digit",
|
|
200
311
|
day: "2-digit",
|
|
@@ -386,7 +497,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
|
|
|
386
497
|
const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
|
|
387
498
|
|
|
388
499
|
// Get the date string of the date object we created from the string date
|
|
389
|
-
const actualDateStr = dateFormatter.getDateAsString(dateObj);
|
|
500
|
+
const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
|
|
390
501
|
|
|
391
502
|
// Guard Clause: Generated date matches date string input
|
|
392
503
|
if (expectedDateStr !== actualDateStr) {
|
|
@@ -551,7 +662,7 @@ const {
|
|
|
551
662
|
|
|
552
663
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
553
664
|
|
|
554
|
-
let AuroLibraryRuntimeUtils$
|
|
665
|
+
let AuroLibraryRuntimeUtils$6 = class AuroLibraryRuntimeUtils {
|
|
555
666
|
|
|
556
667
|
/* eslint-disable jsdoc/require-param */
|
|
557
668
|
|
|
@@ -621,7 +732,7 @@ let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
|
|
|
621
732
|
class AuroFormValidation {
|
|
622
733
|
|
|
623
734
|
constructor() {
|
|
624
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
735
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
625
736
|
}
|
|
626
737
|
|
|
627
738
|
/**
|
|
@@ -900,7 +1011,9 @@ class AuroFormValidation {
|
|
|
900
1011
|
elem.validity = this.auroInputElements[0].validity;
|
|
901
1012
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
902
1013
|
|
|
903
|
-
|
|
1014
|
+
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1015
|
+
// combobox's 2nd input will have noValidate set true.
|
|
1016
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !this.auroInputElements[1].noValidate) {
|
|
904
1017
|
elem.validity = this.auroInputElements[1].validity;
|
|
905
1018
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
906
1019
|
}
|
|
@@ -1033,7 +1146,7 @@ let AuroDependencyVersioning$2 = class AuroDependencyVersioning {
|
|
|
1033
1146
|
|
|
1034
1147
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
1035
1148
|
|
|
1036
|
-
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
1149
|
+
let AuroLibraryRuntimeUtils$2$1 = class AuroLibraryRuntimeUtils {
|
|
1037
1150
|
|
|
1038
1151
|
/* eslint-disable jsdoc/require-param */
|
|
1039
1152
|
|
|
@@ -1616,10 +1729,11 @@ const flip$1 = function (options) {
|
|
|
1616
1729
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
1617
1730
|
const nextPlacement = placements[nextIndex];
|
|
1618
1731
|
if (nextPlacement) {
|
|
1619
|
-
var _overflowsData$;
|
|
1620
1732
|
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
1621
|
-
|
|
1622
|
-
if
|
|
1733
|
+
if (!ignoreCrossAxisOverflow ||
|
|
1734
|
+
// We leave the current main axis only if every placement on that axis
|
|
1735
|
+
// overflows the main axis.
|
|
1736
|
+
overflowsData.every(d => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {
|
|
1623
1737
|
// Try next placement and re-run the lifecycle.
|
|
1624
1738
|
return {
|
|
1625
1739
|
data: {
|
|
@@ -2640,8 +2754,28 @@ class AuroFloatingUI {
|
|
|
2640
2754
|
if (!AuroFloatingUI.isMousePressHandlerInitialized && window && window.addEventListener) {
|
|
2641
2755
|
AuroFloatingUI.isMousePressHandlerInitialized = true;
|
|
2642
2756
|
|
|
2757
|
+
// Track timeout for isMousePressed reset to avoid race conditions
|
|
2758
|
+
if (!AuroFloatingUI._mousePressedTimeout) {
|
|
2759
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
2760
|
+
}
|
|
2643
2761
|
const mouseEventGlobalHandler = (event) => {
|
|
2644
|
-
|
|
2762
|
+
const isPressed = event.type === 'mousedown';
|
|
2763
|
+
if (isPressed) {
|
|
2764
|
+
// Clear any pending timeout to prevent race condition
|
|
2765
|
+
if (AuroFloatingUI._mousePressedTimeout !== null) {
|
|
2766
|
+
clearTimeout(AuroFloatingUI._mousePressedTimeout);
|
|
2767
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
2768
|
+
}
|
|
2769
|
+
if (!AuroFloatingUI.isMousePressed) {
|
|
2770
|
+
AuroFloatingUI.isMousePressed = true;
|
|
2771
|
+
}
|
|
2772
|
+
} else if (AuroFloatingUI.isMousePressed && !isPressed) {
|
|
2773
|
+
// Schedule reset and track timeout ID
|
|
2774
|
+
AuroFloatingUI._mousePressedTimeout = setTimeout(() => {
|
|
2775
|
+
AuroFloatingUI.isMousePressed = false;
|
|
2776
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
2777
|
+
}, 0);
|
|
2778
|
+
}
|
|
2645
2779
|
};
|
|
2646
2780
|
|
|
2647
2781
|
window.addEventListener('mousedown', mouseEventGlobalHandler);
|
|
@@ -2768,6 +2902,7 @@ class AuroFloatingUI {
|
|
|
2768
2902
|
|
|
2769
2903
|
// Compute the position of the bib
|
|
2770
2904
|
computePosition(this.element.trigger, this.element.bib, {
|
|
2905
|
+
strategy: this.element.floaterConfig?.strategy || 'fixed',
|
|
2771
2906
|
placement: this.element.floaterConfig?.placement,
|
|
2772
2907
|
middleware: middleware || []
|
|
2773
2908
|
}).then(({ x, y }) => { // eslint-disable-line id-length
|
|
@@ -2902,8 +3037,9 @@ class AuroFloatingUI {
|
|
|
2902
3037
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2903
3038
|
return;
|
|
2904
3039
|
}
|
|
2905
|
-
|
|
2906
|
-
if
|
|
3040
|
+
|
|
3041
|
+
// if fullscreen bib is in fullscreen mode, do not close
|
|
3042
|
+
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2907
3043
|
return;
|
|
2908
3044
|
}
|
|
2909
3045
|
|
|
@@ -3204,8 +3340,6 @@ class AuroFloatingUI {
|
|
|
3204
3340
|
this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
|
|
3205
3341
|
}
|
|
3206
3342
|
|
|
3207
|
-
document.body.append(this.element.bib);
|
|
3208
|
-
|
|
3209
3343
|
this.regenerateBibId();
|
|
3210
3344
|
this.handleTriggerTabIndex();
|
|
3211
3345
|
|
|
@@ -3432,9 +3566,79 @@ let BaseIcon$2 = class BaseIcon extends AuroElement$1$1 {
|
|
|
3432
3566
|
}
|
|
3433
3567
|
};
|
|
3434
3568
|
|
|
3435
|
-
var tokensCss$2$
|
|
3569
|
+
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)}`;
|
|
3570
|
+
|
|
3571
|
+
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)}`;
|
|
3572
|
+
|
|
3573
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3574
|
+
// See LICENSE in the project root for license information.
|
|
3575
|
+
|
|
3576
|
+
// ---------------------------------------------------------------------
|
|
3577
|
+
|
|
3578
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
3579
|
+
|
|
3580
|
+
let AuroLibraryRuntimeUtils$1$2 = class AuroLibraryRuntimeUtils {
|
|
3581
|
+
|
|
3582
|
+
/* eslint-disable jsdoc/require-param */
|
|
3583
|
+
|
|
3584
|
+
/**
|
|
3585
|
+
* This will register a new custom element with the browser.
|
|
3586
|
+
* @param {String} name - The name of the custom element.
|
|
3587
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
3588
|
+
* @returns {void}
|
|
3589
|
+
*/
|
|
3590
|
+
registerComponent(name, componentClass) {
|
|
3591
|
+
if (!customElements.get(name)) {
|
|
3592
|
+
customElements.define(name, class extends componentClass {});
|
|
3593
|
+
}
|
|
3594
|
+
}
|
|
3595
|
+
|
|
3596
|
+
/**
|
|
3597
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
3598
|
+
* @returns {void}
|
|
3599
|
+
*/
|
|
3600
|
+
closestElement(
|
|
3601
|
+
selector, // selector like in .closest()
|
|
3602
|
+
base = this, // extra functionality to skip a parent
|
|
3603
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
3604
|
+
!el || el === document || el === window
|
|
3605
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
3606
|
+
: found
|
|
3607
|
+
? found // found a selector INside this element
|
|
3608
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
3609
|
+
) {
|
|
3610
|
+
return __Closest(base);
|
|
3611
|
+
}
|
|
3612
|
+
/* eslint-enable jsdoc/require-param */
|
|
3613
|
+
|
|
3614
|
+
/**
|
|
3615
|
+
* 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.
|
|
3616
|
+
* @param {Object} elem - The element to check.
|
|
3617
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
3618
|
+
* @returns {void}
|
|
3619
|
+
*/
|
|
3620
|
+
handleComponentTagRename(elem, tagName) {
|
|
3621
|
+
const tag = tagName.toLowerCase();
|
|
3622
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
3623
|
+
|
|
3624
|
+
if (elemTag !== tag) {
|
|
3625
|
+
elem.setAttribute(tag, true);
|
|
3626
|
+
}
|
|
3627
|
+
}
|
|
3628
|
+
|
|
3629
|
+
/**
|
|
3630
|
+
* Validates if an element is a specific Auro component.
|
|
3631
|
+
* @param {Object} elem - The element to validate.
|
|
3632
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
3633
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
3634
|
+
*/
|
|
3635
|
+
elementMatch(elem, tagName) {
|
|
3636
|
+
const tag = tagName.toLowerCase();
|
|
3637
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
3436
3638
|
|
|
3437
|
-
|
|
3639
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
3640
|
+
}
|
|
3641
|
+
};
|
|
3438
3642
|
|
|
3439
3643
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
3440
3644
|
// See LICENSE in the project root for license information.
|
|
@@ -3455,7 +3659,7 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3455
3659
|
*/
|
|
3456
3660
|
privateDefaults() {
|
|
3457
3661
|
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
3458
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
3662
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$1$2();
|
|
3459
3663
|
}
|
|
3460
3664
|
|
|
3461
3665
|
// function to define props used within the scope of this component
|
|
@@ -3522,9 +3726,9 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3522
3726
|
static get styles() {
|
|
3523
3727
|
return [
|
|
3524
3728
|
super.styles,
|
|
3525
|
-
i$5`${tokensCss$2$
|
|
3729
|
+
i$5`${tokensCss$2$2}`,
|
|
3526
3730
|
i$5`${styleCss$2$2}`,
|
|
3527
|
-
i$5`${colorCss$3$
|
|
3731
|
+
i$5`${colorCss$3$2}`
|
|
3528
3732
|
];
|
|
3529
3733
|
}
|
|
3530
3734
|
|
|
@@ -3537,7 +3741,7 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3537
3741
|
*
|
|
3538
3742
|
*/
|
|
3539
3743
|
static register(name = "auro-icon") {
|
|
3540
|
-
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroIcon);
|
|
3744
|
+
AuroLibraryRuntimeUtils$1$2.prototype.registerComponent(name, AuroIcon);
|
|
3541
3745
|
}
|
|
3542
3746
|
|
|
3543
3747
|
connectedCallback() {
|
|
@@ -3558,8 +3762,12 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3558
3762
|
async firstUpdated() {
|
|
3559
3763
|
await super.firstUpdated();
|
|
3560
3764
|
|
|
3561
|
-
|
|
3562
|
-
|
|
3765
|
+
/**
|
|
3766
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
3767
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
3768
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
3769
|
+
*/
|
|
3770
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
3563
3771
|
const svgDesc = this.svg.querySelector('desc');
|
|
3564
3772
|
|
|
3565
3773
|
if (svgDesc) {
|
|
@@ -3605,17 +3813,16 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3605
3813
|
|
|
3606
3814
|
var iconVersion$2 = '6.1.2';
|
|
3607
3815
|
|
|
3608
|
-
var styleCss$1$2 = i$5`:host{position:
|
|
3816
|
+
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}`;
|
|
3609
3817
|
|
|
3610
|
-
var colorCss$2$
|
|
3818
|
+
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)}`;
|
|
3611
3819
|
|
|
3612
|
-
var tokensCss$1$
|
|
3820
|
+
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-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db);--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}`;
|
|
3613
3821
|
|
|
3614
3822
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
3615
3823
|
// See LICENSE in the project root for license information.
|
|
3616
3824
|
|
|
3617
3825
|
|
|
3618
|
-
|
|
3619
3826
|
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
3620
3827
|
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
3621
3828
|
'xl',
|
|
@@ -3631,7 +3838,7 @@ const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
|
3631
3838
|
*/
|
|
3632
3839
|
|
|
3633
3840
|
class AuroDropdownBib extends i$2 {
|
|
3634
|
-
|
|
3841
|
+
// not extending AuroElement because Bib needs only `shape` prop
|
|
3635
3842
|
constructor() {
|
|
3636
3843
|
super();
|
|
3637
3844
|
|
|
@@ -3640,14 +3847,17 @@ class AuroDropdownBib extends i$2 {
|
|
|
3640
3847
|
*/
|
|
3641
3848
|
this._mobileBreakpointValue = undefined;
|
|
3642
3849
|
|
|
3643
|
-
AuroLibraryRuntimeUtils$1.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
3850
|
+
AuroLibraryRuntimeUtils$2$1.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
3851
|
+
|
|
3852
|
+
this.shape = "rounded";
|
|
3853
|
+
this.matchWidth = false;
|
|
3644
3854
|
}
|
|
3645
3855
|
|
|
3646
3856
|
static get styles() {
|
|
3647
3857
|
return [
|
|
3648
3858
|
styleCss$1$2,
|
|
3649
|
-
colorCss$2$
|
|
3650
|
-
tokensCss$1$
|
|
3859
|
+
colorCss$2$2,
|
|
3860
|
+
tokensCss$1$2
|
|
3651
3861
|
];
|
|
3652
3862
|
}
|
|
3653
3863
|
|
|
@@ -3678,6 +3888,15 @@ class AuroDropdownBib extends i$2 {
|
|
|
3678
3888
|
reflect: true
|
|
3679
3889
|
},
|
|
3680
3890
|
|
|
3891
|
+
/**
|
|
3892
|
+
* If declared, the bib width will match the trigger width.
|
|
3893
|
+
* @private
|
|
3894
|
+
*/
|
|
3895
|
+
matchWidth: {
|
|
3896
|
+
type: Boolean,
|
|
3897
|
+
reflect: true
|
|
3898
|
+
},
|
|
3899
|
+
|
|
3681
3900
|
/**
|
|
3682
3901
|
* If declared, will apply border-radius to the bib.
|
|
3683
3902
|
*/
|
|
@@ -3685,6 +3904,18 @@ class AuroDropdownBib extends i$2 {
|
|
|
3685
3904
|
type: Boolean,
|
|
3686
3905
|
reflect: true
|
|
3687
3906
|
},
|
|
3907
|
+
|
|
3908
|
+
/**
|
|
3909
|
+
* A reference to the associated bib template element.
|
|
3910
|
+
*/
|
|
3911
|
+
bibTemplate: {
|
|
3912
|
+
type: Object
|
|
3913
|
+
},
|
|
3914
|
+
|
|
3915
|
+
shape: {
|
|
3916
|
+
type: String,
|
|
3917
|
+
reflect: true
|
|
3918
|
+
}
|
|
3688
3919
|
};
|
|
3689
3920
|
}
|
|
3690
3921
|
|
|
@@ -3717,13 +3948,62 @@ class AuroDropdownBib extends i$2 {
|
|
|
3717
3948
|
}
|
|
3718
3949
|
}
|
|
3719
3950
|
});
|
|
3951
|
+
|
|
3952
|
+
if (this.bibTemplate) {
|
|
3953
|
+
// If the bib template is found, set the fullscreen attribute
|
|
3954
|
+
if (this.isFullscreen) {
|
|
3955
|
+
this.bibTemplate.setAttribute('isFullscreen', 'true');
|
|
3956
|
+
} else {
|
|
3957
|
+
this.bibTemplate.removeAttribute('isFullscreen');
|
|
3958
|
+
}
|
|
3959
|
+
}
|
|
3720
3960
|
}
|
|
3721
3961
|
}
|
|
3722
3962
|
|
|
3963
|
+
connectedCallback() {
|
|
3964
|
+
super.connectedCallback();
|
|
3965
|
+
|
|
3966
|
+
// Listen for the auro-bibtemplate-connected event to set the fullscreen attribute
|
|
3967
|
+
this.addEventListener('auro-bibtemplate-connected', (event) => {
|
|
3968
|
+
const bibTemplate = event.detail.element;
|
|
3969
|
+
this.bibTemplate = bibTemplate;
|
|
3970
|
+
|
|
3971
|
+
if (bibTemplate) {
|
|
3972
|
+
// If the bib template is found, set the fullscreen attribute
|
|
3973
|
+
if (this.isFullscreen) {
|
|
3974
|
+
bibTemplate.setAttribute('isFullscreen', 'true');
|
|
3975
|
+
} else {
|
|
3976
|
+
bibTemplate.removeAttribute('isFullscreen');
|
|
3977
|
+
}
|
|
3978
|
+
}
|
|
3979
|
+
});
|
|
3980
|
+
}
|
|
3981
|
+
|
|
3982
|
+
firstUpdated(changedProperties) {
|
|
3983
|
+
super.firstUpdated(changedProperties);
|
|
3984
|
+
|
|
3985
|
+
// Dispatch a custom event when the component is connected
|
|
3986
|
+
this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
|
|
3987
|
+
bubbles: true,
|
|
3988
|
+
composed: true,
|
|
3989
|
+
detail: {
|
|
3990
|
+
element: this
|
|
3991
|
+
}
|
|
3992
|
+
}));
|
|
3993
|
+
}
|
|
3994
|
+
|
|
3723
3995
|
// function that renders the HTML and CSS into the scope of the component
|
|
3724
3996
|
render() {
|
|
3997
|
+
const classes = {
|
|
3998
|
+
container: true
|
|
3999
|
+
};
|
|
4000
|
+
|
|
4001
|
+
// Since this class does not inherit from AuroElement, we apply the shape-related class within the `render` function,
|
|
4002
|
+
// mimicking the class naming convention used in AuroElement.resetShapeClasses.
|
|
4003
|
+
classes[`shape-${this.shape}`] = true;
|
|
4004
|
+
|
|
3725
4005
|
return u`
|
|
3726
|
-
<div class="
|
|
4006
|
+
<div class="${e(classes)}" part="bibContainer">
|
|
3727
4007
|
<slot></slot>
|
|
3728
4008
|
</div>
|
|
3729
4009
|
`;
|
|
@@ -3732,23 +4012,23 @@ class AuroDropdownBib extends i$2 {
|
|
|
3732
4012
|
|
|
3733
4013
|
var dropdownVersion$1 = '3.0.0';
|
|
3734
4014
|
|
|
3735
|
-
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:
|
|
4015
|
+
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}`;
|
|
3736
4016
|
|
|
3737
|
-
var colorCss$1$2 = i$5`:host .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus,:host(:not([ondark])) .wrapper:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-brand, #00274a)}:host([ondark]) .wrapper:focus,:host([ondark]) .wrapper:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff)}:host([error]:not([ondark])){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([error][ondark]){--ds-auro-dropdown-trigger-border-color: var(--ds-
|
|
4017
|
+
var colorCss$1$2 = i$5`:host .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus,:host(:not([ondark])) .wrapper:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-brand, #00274a)}:host([ondark]) .wrapper:focus,:host([ondark]) .wrapper:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff)}:host([error]:not([ondark])){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([error][ondark]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helpText{color:var(--ds-auro-dropdown-helptext-text-color)}`;
|
|
3738
4018
|
|
|
3739
|
-
var classicColorCss = i$5`:host([layout*=classic]) .label{color:var(--ds-auro-dropdown-label-text-color)}:host([layout*=classic]) .trigger{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-container-color);color:var(--ds-auro-dropdown-trigger-text-color)
|
|
4019
|
+
var classicColorCss = i$5`:host([layout*=classic]:not([onDark])) .label{color:var(--ds-auro-dropdown-label-text-color)}:host([layout*=classic]:not([onDark])) .trigger{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-container-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host([layout*=classic]:not([onDark])) .trigger:focus-within,:host([layout*=classic]:not([onDark])) .trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host([layout*=classic][disabled]:not([onDark])){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host([layout*=classic][error]:not([onDark])){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([layout*=classic][error]:not([onDark])) .trigger:focus-within,:host([layout*=classic][error]:not([onDark])) .trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host([layout*=classic][onDark]) .label{color:var(--ds-auro-dropdown-label-text-color)}:host([layout*=classic][onDark]) .trigger{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-container-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host([layout*=classic][onDark]) .trigger:focus-within,:host([layout*=classic][onDark]) .trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([layout*=classic][onDark][disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}:host([layout*=classic][onDark][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host([layout*=classic][onDark][error]) .trigger:focus-within,:host([layout*=classic][onDark][error]) .trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}`;
|
|
3740
4020
|
|
|
3741
|
-
var classicLayoutCss = i$5`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) .label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .trigger{display:flex;flex-direction:row}@media(hover: hover){:host([layout*=classic]) .trigger:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;
|
|
4021
|
+
var classicLayoutCss = i$5`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) .label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .trigger{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}@media(hover: hover){:host([layout*=classic]) .trigger:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([layout*=classic]:not([simple])) .triggerContentWrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([layout*=classic][matchwidth]) #bibSizer{width:100%}:host([layout*=classic][disabled]){pointer-events:none}`;
|
|
3742
4022
|
|
|
3743
|
-
var styleEmphasizedCss = i$5`:host{display:block}.wrapper{display:flex;flex-direction:
|
|
4023
|
+
var styleEmphasizedCss = i$5`:host{display:block}.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}.wrapper{display:flex;flex-direction:row}.trigger{display:flex;flex:1;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;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)}`;
|
|
3744
4024
|
|
|
3745
|
-
var styleSnowflakeCss = i$5`:host{display:block}.wrapper{display:flex;flex-direction:
|
|
4025
|
+
var styleSnowflakeCss = i$5`:host{display:block}.wrapper{display:flex;flex-direction:row}.trigger{display:flex;flex:1;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;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)}`;
|
|
3746
4026
|
|
|
3747
|
-
var colorCss$
|
|
4027
|
+
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)}`;
|
|
3748
4028
|
|
|
3749
|
-
var styleCss$
|
|
4029
|
+
var styleCss$6 = i$5`.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
3750
4030
|
|
|
3751
|
-
var tokensCss$
|
|
4031
|
+
var tokensCss$4 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
3752
4032
|
|
|
3753
4033
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3754
4034
|
// See LICENSE in the project root for license information.
|
|
@@ -3757,7 +4037,7 @@ var tokensCss$3 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texti
|
|
|
3757
4037
|
|
|
3758
4038
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
3759
4039
|
|
|
3760
|
-
let AuroLibraryRuntimeUtils$
|
|
4040
|
+
let AuroLibraryRuntimeUtils$5 = class AuroLibraryRuntimeUtils {
|
|
3761
4041
|
|
|
3762
4042
|
/* eslint-disable jsdoc/require-param */
|
|
3763
4043
|
|
|
@@ -3829,7 +4109,7 @@ let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
|
3829
4109
|
*
|
|
3830
4110
|
* @attr { Boolean } large - If declared, make font-size to 1rem(16px).
|
|
3831
4111
|
*/
|
|
3832
|
-
class AuroHelpText extends i$2 {
|
|
4112
|
+
let AuroHelpText$1 = class AuroHelpText extends i$2 {
|
|
3833
4113
|
|
|
3834
4114
|
constructor() {
|
|
3835
4115
|
super();
|
|
@@ -3838,14 +4118,14 @@ class AuroHelpText extends i$2 {
|
|
|
3838
4118
|
this.onDark = false;
|
|
3839
4119
|
this.hasTextContent = false;
|
|
3840
4120
|
|
|
3841
|
-
AuroLibraryRuntimeUtils$
|
|
4121
|
+
AuroLibraryRuntimeUtils$5.prototype.handleComponentTagRename(this, 'auro-helptext');
|
|
3842
4122
|
}
|
|
3843
4123
|
|
|
3844
4124
|
static get styles() {
|
|
3845
4125
|
return [
|
|
3846
|
-
colorCss$
|
|
3847
|
-
styleCss$
|
|
3848
|
-
tokensCss$
|
|
4126
|
+
colorCss$5,
|
|
4127
|
+
styleCss$6,
|
|
4128
|
+
tokensCss$4
|
|
3849
4129
|
];
|
|
3850
4130
|
}
|
|
3851
4131
|
|
|
@@ -3894,7 +4174,7 @@ class AuroHelpText extends i$2 {
|
|
|
3894
4174
|
*
|
|
3895
4175
|
*/
|
|
3896
4176
|
static register(name = "auro-helptext") {
|
|
3897
|
-
AuroLibraryRuntimeUtils$
|
|
4177
|
+
AuroLibraryRuntimeUtils$5.prototype.registerComponent(name, AuroHelpText);
|
|
3898
4178
|
}
|
|
3899
4179
|
|
|
3900
4180
|
updated() {
|
|
@@ -3948,11 +4228,11 @@ class AuroHelpText extends i$2 {
|
|
|
3948
4228
|
</div>
|
|
3949
4229
|
`;
|
|
3950
4230
|
}
|
|
3951
|
-
}
|
|
4231
|
+
};
|
|
3952
4232
|
|
|
3953
|
-
var helpTextVersion = '1.0.0';
|
|
4233
|
+
var helpTextVersion$1 = '1.0.0';
|
|
3954
4234
|
|
|
3955
|
-
let AuroElement$
|
|
4235
|
+
let AuroElement$3 = class AuroElement extends i$2 {
|
|
3956
4236
|
static get properties() {
|
|
3957
4237
|
return {
|
|
3958
4238
|
|
|
@@ -3987,18 +4267,21 @@ let AuroElement$2 = class AuroElement extends i$2 {
|
|
|
3987
4267
|
}
|
|
3988
4268
|
|
|
3989
4269
|
resetShapeClasses() {
|
|
3990
|
-
|
|
3991
|
-
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
4270
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
3992
4271
|
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
4272
|
+
if (wrapper) {
|
|
4273
|
+
wrapper.classList.forEach((className) => {
|
|
4274
|
+
if (className.startsWith('shape-')) {
|
|
4275
|
+
wrapper.classList.remove(className);
|
|
4276
|
+
}
|
|
4277
|
+
});
|
|
3999
4278
|
|
|
4000
|
-
|
|
4001
|
-
|
|
4279
|
+
}
|
|
4280
|
+
|
|
4281
|
+
if (this.shape && this.size) {
|
|
4282
|
+
wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
4283
|
+
} else {
|
|
4284
|
+
wrapper.classList.add('shape-none');
|
|
4002
4285
|
}
|
|
4003
4286
|
}
|
|
4004
4287
|
|
|
@@ -4061,7 +4344,7 @@ let AuroElement$2 = class AuroElement extends i$2 {
|
|
|
4061
4344
|
* @event auroDropdown-toggled - Notifies that the visibility of the dropdown bib has changed.
|
|
4062
4345
|
* @event auroDropdown-idAdded - Notifies consumers that the unique ID for the dropdown bib has been generated.
|
|
4063
4346
|
*/
|
|
4064
|
-
class AuroDropdown extends AuroElement$
|
|
4347
|
+
class AuroDropdown extends AuroElement$3 {
|
|
4065
4348
|
constructor() {
|
|
4066
4349
|
super();
|
|
4067
4350
|
|
|
@@ -4070,20 +4353,16 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4070
4353
|
this.matchWidth = false;
|
|
4071
4354
|
this.noHideOnThisFocusLoss = false;
|
|
4072
4355
|
|
|
4073
|
-
this.errorMessage = ''; // TODO
|
|
4356
|
+
this.errorMessage = ''; // TODO - check with Doug if there is still more to do here
|
|
4074
4357
|
|
|
4075
4358
|
// Layout Config
|
|
4076
4359
|
this.layout = 'classic';
|
|
4077
|
-
this.shape = '
|
|
4360
|
+
this.shape = 'classic';
|
|
4078
4361
|
this.size = 'xl';
|
|
4079
4362
|
|
|
4080
|
-
this.
|
|
4081
|
-
}
|
|
4363
|
+
this.parentBorder = false;
|
|
4082
4364
|
|
|
4083
|
-
|
|
4084
|
-
return {
|
|
4085
|
-
// 'withValue': this.value && this.value.length > 0
|
|
4086
|
-
};
|
|
4365
|
+
this.privateDefaults();
|
|
4087
4366
|
}
|
|
4088
4367
|
|
|
4089
4368
|
get commonWrapperClasses() {
|
|
@@ -4091,7 +4370,8 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4091
4370
|
'trigger': true,
|
|
4092
4371
|
'wrapper': true,
|
|
4093
4372
|
'hasFocus': this.hasFocus,
|
|
4094
|
-
'simple': this.simple
|
|
4373
|
+
'simple': this.simple,
|
|
4374
|
+
'parentBorder': this.parentBorder
|
|
4095
4375
|
};
|
|
4096
4376
|
}
|
|
4097
4377
|
|
|
@@ -4143,7 +4423,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4143
4423
|
/**
|
|
4144
4424
|
* @private
|
|
4145
4425
|
*/
|
|
4146
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
4426
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2$1();
|
|
4147
4427
|
|
|
4148
4428
|
/**
|
|
4149
4429
|
* @private
|
|
@@ -4168,7 +4448,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4168
4448
|
/**
|
|
4169
4449
|
* @private
|
|
4170
4450
|
*/
|
|
4171
|
-
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion, AuroHelpText);
|
|
4451
|
+
this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion$1, AuroHelpText$1);
|
|
4172
4452
|
|
|
4173
4453
|
/**
|
|
4174
4454
|
* @private
|
|
@@ -4358,6 +4638,15 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4358
4638
|
reflect: true
|
|
4359
4639
|
},
|
|
4360
4640
|
|
|
4641
|
+
/**
|
|
4642
|
+
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
4643
|
+
* @private
|
|
4644
|
+
*/
|
|
4645
|
+
parentBorder: {
|
|
4646
|
+
type: Boolean,
|
|
4647
|
+
reflect: true
|
|
4648
|
+
},
|
|
4649
|
+
|
|
4361
4650
|
/**
|
|
4362
4651
|
* If declared, the popover and trigger will be set to the same width.
|
|
4363
4652
|
*/
|
|
@@ -4460,7 +4749,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4460
4749
|
static get styles() {
|
|
4461
4750
|
return [
|
|
4462
4751
|
colorCss$1$2,
|
|
4463
|
-
tokensCss$1$
|
|
4752
|
+
tokensCss$1$2,
|
|
4464
4753
|
|
|
4465
4754
|
// default layout
|
|
4466
4755
|
classicColorCss,
|
|
@@ -4485,7 +4774,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4485
4774
|
*
|
|
4486
4775
|
*/
|
|
4487
4776
|
static register(name = "auro-dropdown") {
|
|
4488
|
-
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroDropdown);
|
|
4777
|
+
AuroLibraryRuntimeUtils$2$1.prototype.registerComponent(name, AuroDropdown);
|
|
4489
4778
|
}
|
|
4490
4779
|
|
|
4491
4780
|
/**
|
|
@@ -4748,14 +5037,13 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4748
5037
|
* @returns {void}
|
|
4749
5038
|
*/
|
|
4750
5039
|
handleTriggerContentSlotChange(event) {
|
|
4751
|
-
|
|
4752
5040
|
this.floater.handleTriggerTabIndex();
|
|
4753
5041
|
|
|
4754
5042
|
// Get the trigger
|
|
4755
5043
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
4756
5044
|
|
|
4757
5045
|
// Get the trigger slot
|
|
4758
|
-
const triggerSlot = this.shadowRoot.querySelector('.
|
|
5046
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContentWrapper slot');
|
|
4759
5047
|
|
|
4760
5048
|
// If there's a trigger slot
|
|
4761
5049
|
if (triggerSlot) {
|
|
@@ -4818,11 +5106,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4818
5106
|
*
|
|
4819
5107
|
* @private
|
|
4820
5108
|
* @method handleDefaultSlot
|
|
4821
|
-
* @param {Event} event - The event object representing the slot change.
|
|
4822
5109
|
* @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
|
|
4823
5110
|
*/
|
|
4824
|
-
handleDefaultSlot(
|
|
4825
|
-
[...event.target.assignedNodes()].forEach((node) => this.bibContent.append(node));
|
|
5111
|
+
handleDefaultSlot() {
|
|
4826
5112
|
|
|
4827
5113
|
if (this.onSlotChange) {
|
|
4828
5114
|
this.onSlotChange();
|
|
@@ -4830,33 +5116,10 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4830
5116
|
}
|
|
4831
5117
|
|
|
4832
5118
|
/**
|
|
5119
|
+
* Returns HTML for the common portion of the layouts.
|
|
4833
5120
|
* @private
|
|
4834
|
-
* @
|
|
4835
|
-
* @
|
|
4836
|
-
* @description Handles the slot change event for the label slot.
|
|
4837
|
-
*/
|
|
4838
|
-
handleLabelSlotChange (event) {
|
|
4839
|
-
|
|
4840
|
-
// Get the nodes from the event
|
|
4841
|
-
const nodes = event.target.assignedNodes();
|
|
4842
|
-
|
|
4843
|
-
// Guard clause for no nodes
|
|
4844
|
-
if (!nodes) {
|
|
4845
|
-
return;
|
|
4846
|
-
}
|
|
4847
|
-
|
|
4848
|
-
// Convert the nodes to a measurable array so we can get the length
|
|
4849
|
-
const nodesArr = Array.from(nodes);
|
|
4850
|
-
|
|
4851
|
-
// If the nodes array has a length, the dropdown is labeled
|
|
4852
|
-
this.labeled = nodesArr.length > 0;
|
|
4853
|
-
}
|
|
4854
|
-
|
|
4855
|
-
/**
|
|
4856
|
-
* Returns HTML for the common portion of the layouts.
|
|
4857
|
-
* @private
|
|
4858
|
-
* @param {Object} helpTextClasses - Classes to apply to the help text container.
|
|
4859
|
-
* @returns {html} - Returns HTML.
|
|
5121
|
+
* @param {Object} helpTextClasses - Classes to apply to the help text container.
|
|
5122
|
+
* @returns {html} - Returns HTML.
|
|
4860
5123
|
*/
|
|
4861
5124
|
renderBasicHtml(helpTextClasses) {
|
|
4862
5125
|
return u`
|
|
@@ -4866,24 +5129,20 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4866
5129
|
class="${e(this.commonWrapperClasses)}" part="wrapper"
|
|
4867
5130
|
tabindex="${this.tabIndex}"
|
|
4868
5131
|
role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
4869
|
-
aria-expanded="${o(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4870
|
-
aria-controls="${o(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
5132
|
+
aria-expanded="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
5133
|
+
aria-controls="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4871
5134
|
aria-labelledby="${o(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
4872
5135
|
@focusin="${this.handleFocusin}"
|
|
4873
5136
|
@blur="${this.handleFocusOut}">
|
|
4874
|
-
<div class="triggerContentWrapper">
|
|
4875
|
-
<
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
<div class="triggerContent">
|
|
4879
|
-
<slot
|
|
4880
|
-
name="trigger"
|
|
4881
|
-
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4882
|
-
</div>
|
|
5137
|
+
<div class="triggerContentWrapper" id="triggerLabel">
|
|
5138
|
+
<slot
|
|
5139
|
+
name="trigger"
|
|
5140
|
+
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4883
5141
|
</div>
|
|
4884
|
-
${this.chevron
|
|
5142
|
+
${this.chevron ? u`
|
|
4885
5143
|
<div
|
|
4886
5144
|
id="showStateIcon"
|
|
5145
|
+
class="chevron"
|
|
4887
5146
|
part="chevron">
|
|
4888
5147
|
<${this.iconTag}
|
|
4889
5148
|
category="interface"
|
|
@@ -4898,17 +5157,18 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4898
5157
|
<div class="${e(helpTextClasses)}">
|
|
4899
5158
|
<slot name="helpText"></slot>
|
|
4900
5159
|
</div>
|
|
4901
|
-
<div class="slotContent">
|
|
4902
|
-
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4903
|
-
</div>
|
|
4904
5160
|
<div id="bibSizer" part="size"></div>
|
|
4905
5161
|
<${this.dropdownBibTag}
|
|
4906
5162
|
id="bib"
|
|
5163
|
+
shape="${this.shape}"
|
|
4907
5164
|
?data-show="${this.isPopoverVisible}"
|
|
4908
5165
|
?isfullscreen="${this.isBibFullscreen}"
|
|
4909
5166
|
?common="${this.common}"
|
|
4910
5167
|
?rounded="${this.common || this.rounded}"
|
|
4911
5168
|
?inset="${this.common || this.inset}">
|
|
5169
|
+
<div class="slotContent">
|
|
5170
|
+
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5171
|
+
</div>
|
|
4912
5172
|
</${this.dropdownBibTag}>
|
|
4913
5173
|
</div>
|
|
4914
5174
|
`;
|
|
@@ -4920,67 +5180,14 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4920
5180
|
* @returns {html} - Returns HTML for the classic layout.
|
|
4921
5181
|
*/
|
|
4922
5182
|
renderLayoutClassic() {
|
|
5183
|
+
// TODO: check with Doug why this was never used?
|
|
4923
5184
|
const helpTextClasses = {
|
|
4924
|
-
'helpText': true
|
|
4925
|
-
'leftIndent': false,
|
|
4926
|
-
'rightIndent': false
|
|
5185
|
+
'helpText': true
|
|
4927
5186
|
};
|
|
4928
5187
|
|
|
4929
5188
|
return u`
|
|
4930
5189
|
${this.renderBasicHtml(helpTextClasses)}
|
|
4931
5190
|
`;
|
|
4932
|
-
// return html`
|
|
4933
|
-
// <div>
|
|
4934
|
-
// <div
|
|
4935
|
-
// id="trigger"
|
|
4936
|
-
// class="trigger"
|
|
4937
|
-
// part="trigger"
|
|
4938
|
-
// tabindex="${this.tabIndex}"
|
|
4939
|
-
// ?showBorder="${this.showTriggerBorders}"
|
|
4940
|
-
// role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
4941
|
-
// aria-expanded="${ifDefined(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4942
|
-
// aria-controls="${ifDefined(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4943
|
-
// aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
4944
|
-
// >
|
|
4945
|
-
// <div class="triggerContentWrapper">
|
|
4946
|
-
// <label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
4947
|
-
// <slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
4948
|
-
// </label>
|
|
4949
|
-
// <div class="triggerContent">
|
|
4950
|
-
// <slot
|
|
4951
|
-
// name="trigger"
|
|
4952
|
-
// @slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4953
|
-
// </div>
|
|
4954
|
-
// </div>
|
|
4955
|
-
// ${this.chevron || this.common ? html`
|
|
4956
|
-
// <div
|
|
4957
|
-
// id="showStateIcon"
|
|
4958
|
-
// part="chevron">
|
|
4959
|
-
// <${this.iconTag}
|
|
4960
|
-
// category="interface"
|
|
4961
|
-
// name="chevron-down"
|
|
4962
|
-
// ?onDark="${this.onDark}"
|
|
4963
|
-
// variant="${this.disabled ? 'disabled' : 'muted'}">
|
|
4964
|
-
// >
|
|
4965
|
-
// </${this.iconTag}>
|
|
4966
|
-
// </div>
|
|
4967
|
-
// ` : undefined }
|
|
4968
|
-
// </div>
|
|
4969
|
-
// <div class="slotContent">
|
|
4970
|
-
// <slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4971
|
-
// </div>
|
|
4972
|
-
// <div id="bibSizer" part="size"></div>
|
|
4973
|
-
// <${this.dropdownBibTag}
|
|
4974
|
-
// id="bib"
|
|
4975
|
-
// ?data-show="${this.isPopoverVisible}"
|
|
4976
|
-
// ?isfullscreen="${this.isBibFullscreen}"
|
|
4977
|
-
// ?common="${this.common}"
|
|
4978
|
-
// ?rounded="${this.common || this.rounded}"
|
|
4979
|
-
// ?inset="${this.common || this.inset}"
|
|
4980
|
-
// >
|
|
4981
|
-
// </${this.dropdownBibTag}>
|
|
4982
|
-
// </div>
|
|
4983
|
-
// `;
|
|
4984
5191
|
}
|
|
4985
5192
|
|
|
4986
5193
|
/**
|
|
@@ -5047,9 +5254,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5047
5254
|
|
|
5048
5255
|
var dropdownVersion = '3.0.0';
|
|
5049
5256
|
|
|
5050
|
-
var colorCss$
|
|
5257
|
+
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)}`;
|
|
5051
5258
|
|
|
5052
|
-
var styleCss$
|
|
5259
|
+
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)}`;
|
|
5053
5260
|
|
|
5054
5261
|
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)}`;
|
|
5055
5262
|
|
|
@@ -5060,7 +5267,7 @@ var tokenCss = i$5`:host{--ds-auro-dropdownbib-header-boxshadow-color: var(--ds-
|
|
|
5060
5267
|
|
|
5061
5268
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
5062
5269
|
|
|
5063
|
-
class AuroLibraryRuntimeUtils {
|
|
5270
|
+
let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
|
|
5064
5271
|
|
|
5065
5272
|
/* eslint-disable jsdoc/require-param */
|
|
5066
5273
|
|
|
@@ -5121,7 +5328,7 @@ class AuroLibraryRuntimeUtils {
|
|
|
5121
5328
|
|
|
5122
5329
|
return elemTag === tag || elem.hasAttribute(tag);
|
|
5123
5330
|
}
|
|
5124
|
-
}
|
|
5331
|
+
};
|
|
5125
5332
|
|
|
5126
5333
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5127
5334
|
// See LICENSE in the project root for license information.
|
|
@@ -5163,249 +5370,1363 @@ class AuroDependencyVersioning {
|
|
|
5163
5370
|
}
|
|
5164
5371
|
}
|
|
5165
5372
|
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5373
|
+
/**
|
|
5374
|
+
* Private module-level WeakMap to hold MutationObservers for each host element.
|
|
5375
|
+
*/
|
|
5376
|
+
const _observers = new WeakMap();
|
|
5169
5377
|
|
|
5170
5378
|
/**
|
|
5171
|
-
*
|
|
5172
|
-
*
|
|
5173
|
-
*
|
|
5379
|
+
* Private module-level WeakMap to hold attribute matchers and targets for each host element.
|
|
5380
|
+
* Structure: {
|
|
5381
|
+
* host: {
|
|
5382
|
+
* matchers: Set<Function>,
|
|
5383
|
+
* targets: Map<HTMLElement, Map<Function, {removeOriginal: boolean, currentAttributes: Map<string, string>}>>
|
|
5384
|
+
* }
|
|
5385
|
+
* }
|
|
5174
5386
|
*/
|
|
5387
|
+
const _transportConfig = new WeakMap();
|
|
5175
5388
|
|
|
5176
|
-
|
|
5389
|
+
/**
|
|
5390
|
+
* Transfers all matching attributes from a host element to a target element and observes for future changes.
|
|
5391
|
+
*
|
|
5392
|
+
* @param {Object} params - The parameters for the function.
|
|
5393
|
+
* @param {HTMLElement} params.host - The host element from which attributes will be transported.
|
|
5394
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
5395
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove the attributes from the host element.
|
|
5396
|
+
* @param {boolean} [params.observe=true] - Whether to attach a MutationObserver to the host element.
|
|
5397
|
+
* @returns {Function} A function to detach the observer when no longer needed.
|
|
5398
|
+
* @throws {TypeError} If the host or target parameters are not instances of HTMLElement.
|
|
5399
|
+
*/
|
|
5400
|
+
const transportAttributes = ({ host, target, match, removeOriginal = true }) => {
|
|
5401
|
+
// Guard Clause: Ensure host is valid HTMLElement instance
|
|
5402
|
+
if (typeof host !== 'object' || !(host instanceof HTMLElement)) {
|
|
5403
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "host" parameter must be an instance of HTMLElement.');
|
|
5404
|
+
}
|
|
5177
5405
|
|
|
5178
|
-
//
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
hidden: { type: Boolean,
|
|
5182
|
-
reflect: true },
|
|
5183
|
-
hiddenVisually: { type: Boolean,
|
|
5184
|
-
reflect: true },
|
|
5185
|
-
hiddenAudible: { type: Boolean,
|
|
5186
|
-
reflect: true },
|
|
5187
|
-
};
|
|
5406
|
+
// Guard Clause: Ensure target is valid HTMLElement instance
|
|
5407
|
+
if (typeof target !== 'object' || !(target instanceof HTMLElement)) {
|
|
5408
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "target" parameter must be an instance of HTMLElement.');
|
|
5188
5409
|
}
|
|
5189
5410
|
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
if (value) {
|
|
5195
|
-
return 'true'
|
|
5196
|
-
}
|
|
5411
|
+
// Guard Clause: Ensure match is a function
|
|
5412
|
+
if (typeof match !== 'function') {
|
|
5413
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "match" parameter must be a function.');
|
|
5414
|
+
}
|
|
5197
5415
|
|
|
5198
|
-
|
|
5416
|
+
// Guard Clause: Ensure removeOriginal is a boolean
|
|
5417
|
+
if (typeof removeOriginal !== 'boolean') {
|
|
5418
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "removeOriginal" parameter must be a boolean.');
|
|
5199
5419
|
}
|
|
5420
|
+
|
|
5421
|
+
// Register this transport and get cleanup function
|
|
5422
|
+
return _registerTransport({
|
|
5423
|
+
host,
|
|
5424
|
+
target,
|
|
5425
|
+
matcher: match,
|
|
5426
|
+
removeOriginal
|
|
5427
|
+
});
|
|
5200
5428
|
};
|
|
5201
5429
|
|
|
5202
|
-
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>"};
|
|
5203
|
-
|
|
5204
|
-
/* eslint-disable no-underscore-dangle, jsdoc/no-undefined-types, jsdoc/require-param-description */
|
|
5205
|
-
|
|
5206
|
-
const _fetchMap$1 = new Map();
|
|
5207
|
-
|
|
5208
5430
|
/**
|
|
5209
|
-
*
|
|
5210
|
-
*
|
|
5211
|
-
* @
|
|
5212
|
-
* @param {
|
|
5213
|
-
* @
|
|
5431
|
+
* Registers a matcher and target for a host element and attaches an observer if needed.
|
|
5432
|
+
*
|
|
5433
|
+
* @param {Object} params - The parameters object.
|
|
5434
|
+
* @param {HTMLElement} params.host - The host element to observe.
|
|
5435
|
+
* @param {HTMLElement} params.target - The target element to receive attributes.
|
|
5436
|
+
* @param {Function} params.matcher - Function that determines which attributes to transport.
|
|
5437
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes.
|
|
5438
|
+
* @param {boolean} [params.observe=true] - Whether to observe for attribute changes.
|
|
5439
|
+
* @returns {Function} Function to detach the specific matcher and target pairing.
|
|
5440
|
+
* @private
|
|
5214
5441
|
*/
|
|
5442
|
+
const _registerTransport = ({ host, target, matcher, removeOriginal = true }) => {
|
|
5443
|
+
// Initialize config for this host if it doesn't exist
|
|
5444
|
+
if (!_transportConfig.has(host)) {
|
|
5445
|
+
_transportConfig.set(host, {
|
|
5446
|
+
matchers: new Set(),
|
|
5447
|
+
targets: new Map()
|
|
5448
|
+
});
|
|
5449
|
+
}
|
|
5215
5450
|
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5451
|
+
const config = _transportConfig.get(host);
|
|
5452
|
+
|
|
5453
|
+
// Add the matcher to the set of matchers for this host
|
|
5454
|
+
config.matchers.add(matcher);
|
|
5455
|
+
|
|
5456
|
+
// Initialize target entry if it doesn't exist
|
|
5457
|
+
if (!config.targets.has(target)) {
|
|
5458
|
+
config.targets.set(target, new Map());
|
|
5459
|
+
}
|
|
5460
|
+
|
|
5461
|
+
// Store the matcher with its removeOriginal setting for this target
|
|
5462
|
+
config.targets.get(target).set(matcher, {
|
|
5463
|
+
removeOriginal,
|
|
5464
|
+
currentAttributes: new Map()
|
|
5465
|
+
});
|
|
5466
|
+
|
|
5467
|
+
// Perform initial attribute transport
|
|
5468
|
+
_transportAttributes({ host, target, matcher, removeOriginal });
|
|
5469
|
+
|
|
5470
|
+
// Attach observer
|
|
5471
|
+
_attachObserver(host);
|
|
5472
|
+
|
|
5473
|
+
// Return cleanup function and utility functions
|
|
5474
|
+
return {
|
|
5475
|
+
cleanup: () => _cleanupTransport(host, target, matcher),
|
|
5476
|
+
getObservedAttributes: () => _getObservedAttributes(host, target, matcher),
|
|
5477
|
+
getObservedAttribute: (attr) => _getObservedAttribute(host, target, matcher, attr),
|
|
5228
5478
|
}
|
|
5229
|
-
return _fetchMap$1.get(uri);
|
|
5230
5479
|
};
|
|
5231
5480
|
|
|
5232
|
-
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}`;
|
|
5233
|
-
|
|
5234
|
-
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5235
|
-
// See LICENSE in the project root for license information.
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
5239
5481
|
/**
|
|
5240
|
-
*
|
|
5482
|
+
* Cleans up resources associated with a specific matcher and target for a host element.
|
|
5483
|
+
*
|
|
5484
|
+
* @param {HTMLElement} host - The host element
|
|
5485
|
+
* @param {HTMLElement} target - The target element
|
|
5486
|
+
* @param {Function} matcher - The matcher function
|
|
5487
|
+
* @private
|
|
5241
5488
|
*/
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5489
|
+
const _cleanupTransport = (host, target, matcher) => {
|
|
5490
|
+
const config = _transportConfig.get(host);
|
|
5491
|
+
if (!config) return;
|
|
5492
|
+
|
|
5493
|
+
// Remove this matcher from this target
|
|
5494
|
+
const targetMatchers = config.targets.get(target);
|
|
5495
|
+
if (targetMatchers) {
|
|
5496
|
+
targetMatchers.delete(matcher);
|
|
5497
|
+
|
|
5498
|
+
// If this target has no more matchers, remove it
|
|
5499
|
+
if (targetMatchers.size === 0) {
|
|
5500
|
+
config.targets.delete(target);
|
|
5501
|
+
}
|
|
5502
|
+
}
|
|
5503
|
+
|
|
5504
|
+
// Check if this matcher is still used by any target
|
|
5505
|
+
let matcherStillUsed = false;
|
|
5506
|
+
for (const matcherMap of config.targets.values()) {
|
|
5507
|
+
if (matcherMap.has(matcher)) {
|
|
5508
|
+
matcherStillUsed = true;
|
|
5509
|
+
break;
|
|
5510
|
+
}
|
|
5248
5511
|
}
|
|
5249
|
-
|
|
5250
|
-
//
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
...super.properties,
|
|
5254
|
-
|
|
5255
|
-
/**
|
|
5256
|
-
* Set value for on-dark version of auro-icon.
|
|
5257
|
-
*/
|
|
5258
|
-
onDark: {
|
|
5259
|
-
type: Boolean,
|
|
5260
|
-
reflect: true
|
|
5261
|
-
},
|
|
5262
|
-
|
|
5263
|
-
/**
|
|
5264
|
-
* @private
|
|
5265
|
-
*/
|
|
5266
|
-
svg: {
|
|
5267
|
-
attribute: false,
|
|
5268
|
-
reflect: true
|
|
5269
|
-
}
|
|
5270
|
-
};
|
|
5512
|
+
|
|
5513
|
+
// If not used anymore, remove from matchers set
|
|
5514
|
+
if (!matcherStillUsed) {
|
|
5515
|
+
config.matchers.delete(matcher);
|
|
5271
5516
|
}
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
`;
|
|
5517
|
+
|
|
5518
|
+
// If no more targets or matchers, detach observer
|
|
5519
|
+
if (config.targets.size === 0 || config.matchers.size === 0) {
|
|
5520
|
+
_detachObserver(host);
|
|
5277
5521
|
}
|
|
5522
|
+
};
|
|
5278
5523
|
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5524
|
+
/**
|
|
5525
|
+
* Generic function to transport attributes from a host element to a target element.
|
|
5526
|
+
*
|
|
5527
|
+
* @param {Object} params - The parameters object.
|
|
5528
|
+
* @param {HTMLElement} params.host - The host element from which to transport attributes.
|
|
5529
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
5530
|
+
* @param {Function} params.matcher - Function that takes an attribute name and returns true if it should be transported.
|
|
5531
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes from host.
|
|
5532
|
+
* @returns {void}
|
|
5533
|
+
* @private
|
|
5534
|
+
*/
|
|
5535
|
+
const _transportAttributes = ({ host, target, matcher, removeOriginal = true }) => {
|
|
5536
|
+
// Get a list of all matching attributes on the host element and their values
|
|
5537
|
+
const matchingAttributes = host.getAttributeNames()
|
|
5538
|
+
.filter(attr => matcher(attr))
|
|
5539
|
+
.reduce((acc, attr) => {
|
|
5540
|
+
acc[attr] = host.getAttribute(attr);
|
|
5541
|
+
return acc;
|
|
5542
|
+
}, {});
|
|
5543
|
+
|
|
5544
|
+
// Move matching attributes to the target element, removing them from the host if removeOriginal is true
|
|
5545
|
+
Object.entries(matchingAttributes).forEach(([key, value]) => {
|
|
5546
|
+
_setObservedAttribute(host, target, matcher, key, value);
|
|
5547
|
+
target.setAttribute(key, value);
|
|
5548
|
+
if (removeOriginal) {
|
|
5549
|
+
host.removeAttribute(key);
|
|
5293
5550
|
}
|
|
5551
|
+
});
|
|
5552
|
+
};
|
|
5294
5553
|
|
|
5295
|
-
|
|
5554
|
+
/**
|
|
5555
|
+
* Attaches a MutationObserver to the host element to monitor attribute changes.
|
|
5556
|
+
*
|
|
5557
|
+
* @param {HTMLElement} host - The element to observe for attribute changes.
|
|
5558
|
+
* @returns {MutationObserver} The observer instance.
|
|
5559
|
+
* @private
|
|
5560
|
+
*/
|
|
5561
|
+
const _attachObserver = (host) => {
|
|
5562
|
+
// If an observer for this host already exists, return it
|
|
5563
|
+
if (_observers.has(host)) {
|
|
5564
|
+
return _observers.get(host);
|
|
5565
|
+
}
|
|
5566
|
+
|
|
5567
|
+
// Create a new MutationObserver
|
|
5568
|
+
const observer = new MutationObserver((mutations) => {
|
|
5569
|
+
const config = _transportConfig.get(host);
|
|
5570
|
+
if (!config) return;
|
|
5571
|
+
|
|
5572
|
+
// For each mutation affecting attributes
|
|
5573
|
+
mutations
|
|
5574
|
+
.filter(mutation => mutation.type === 'attributes')
|
|
5575
|
+
.forEach(mutation => {
|
|
5576
|
+
const attributeName = mutation.attributeName;
|
|
5577
|
+
|
|
5578
|
+
// Find matchers that care about this attribute
|
|
5579
|
+
for (const matcher of config.matchers) {
|
|
5580
|
+
if (matcher(attributeName)) {
|
|
5581
|
+
// For each target that uses this matcher
|
|
5582
|
+
for (const [target, matcherConfigs] of config.targets.entries()) {
|
|
5583
|
+
if (matcherConfigs.has(matcher)) {
|
|
5584
|
+
const { removeOriginal } = matcherConfigs.get(matcher);
|
|
5585
|
+
_transportAttributes({
|
|
5586
|
+
host,
|
|
5587
|
+
target,
|
|
5588
|
+
matcher,
|
|
5589
|
+
removeOriginal
|
|
5590
|
+
});
|
|
5591
|
+
}
|
|
5592
|
+
}
|
|
5593
|
+
}
|
|
5594
|
+
}
|
|
5595
|
+
});
|
|
5596
|
+
});
|
|
5296
5597
|
|
|
5297
|
-
|
|
5298
|
-
}
|
|
5598
|
+
// Start observing attribute changes
|
|
5599
|
+
observer.observe(host, { attributes: true });
|
|
5600
|
+
|
|
5601
|
+
// Store the observer
|
|
5602
|
+
_observers.set(host, observer);
|
|
5603
|
+
|
|
5604
|
+
return observer;
|
|
5605
|
+
};
|
|
5299
5606
|
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5607
|
+
/**
|
|
5608
|
+
* Detaches and cleans up the MutationObserver for a given host element.
|
|
5609
|
+
*
|
|
5610
|
+
* @param {HTMLElement} host - The element whose observer should be detached.
|
|
5611
|
+
* @private
|
|
5612
|
+
*/
|
|
5613
|
+
const _detachObserver = (host) => {
|
|
5614
|
+
if (_observers.has(host)) {
|
|
5615
|
+
const observer = _observers.get(host);
|
|
5616
|
+
observer.disconnect();
|
|
5617
|
+
_observers.delete(host);
|
|
5618
|
+
}
|
|
5619
|
+
|
|
5620
|
+
// Clean up the transport config as well
|
|
5621
|
+
if (_transportConfig.has(host)) {
|
|
5622
|
+
_transportConfig.delete(host);
|
|
5623
|
+
}
|
|
5624
|
+
};
|
|
5304
5625
|
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5626
|
+
/**
|
|
5627
|
+
* Gets the matcher configuration for a specific host, target, and matcher
|
|
5628
|
+
* @param {HTMLElement} host - The host element
|
|
5629
|
+
* @param {HTMLElement} target - The target element
|
|
5630
|
+
* @param {Function} matcher - The matcher function
|
|
5631
|
+
* @returns {Object|undefined} The matcher configuration if found
|
|
5632
|
+
* @private
|
|
5633
|
+
*/
|
|
5634
|
+
const _getMatcherConfig = (host, target, matcher) => {
|
|
5635
|
+
const config = _transportConfig.get(host);
|
|
5636
|
+
if (!config) return undefined;
|
|
5637
|
+
|
|
5638
|
+
const targetMatchers = config.targets.get(target);
|
|
5639
|
+
if (!targetMatchers) return undefined;
|
|
5640
|
+
|
|
5641
|
+
return targetMatchers.get(matcher);
|
|
5642
|
+
};
|
|
5309
5643
|
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5644
|
+
/**
|
|
5645
|
+
* Sets an observed attribute value
|
|
5646
|
+
* @param {HTMLElement} host - The host element
|
|
5647
|
+
* @param {HTMLElement} target - The target element
|
|
5648
|
+
* @param {Function} matcher - The matcher function
|
|
5649
|
+
* @param {string} key - The attribute name
|
|
5650
|
+
* @param {string} value - The attribute value
|
|
5651
|
+
* @private
|
|
5652
|
+
*/
|
|
5653
|
+
const _setObservedAttribute = (host, target, matcher, key, value) => {
|
|
5654
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5655
|
+
if (matcherConfig) {
|
|
5656
|
+
matcherConfig.currentAttributes.set(key, value);
|
|
5313
5657
|
}
|
|
5314
5658
|
};
|
|
5315
5659
|
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5660
|
+
const _getObservedAttribute = (host, target, matcher, attr) => {
|
|
5661
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5662
|
+
if (matcherConfig) return matcherConfig.currentAttributes.get(attr);
|
|
5663
|
+
return undefined;
|
|
5664
|
+
};
|
|
5319
5665
|
|
|
5320
|
-
|
|
5321
|
-
|
|
5666
|
+
const _getObservedAttributes = (host, target, matcher) => {
|
|
5667
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
5668
|
+
if (matcherConfig) return Array.from(matcherConfig.currentAttributes.entries());
|
|
5669
|
+
return [];
|
|
5670
|
+
};
|
|
5322
5671
|
|
|
5672
|
+
const _matchers = {
|
|
5673
|
+
'aria-': attr => attr.startsWith('aria-'),
|
|
5674
|
+
'role': attr => attr.match(/^role$/)
|
|
5675
|
+
};
|
|
5323
5676
|
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5677
|
+
const transportAllA11yAttributes = ({ host, target, removeOriginal = true }) => {
|
|
5678
|
+
return transportAttributes({
|
|
5679
|
+
host,
|
|
5680
|
+
target,
|
|
5681
|
+
match: attr => {
|
|
5682
|
+
for (const key in _matchers) {
|
|
5683
|
+
if (_matchers[key](attr)) return true;
|
|
5684
|
+
}
|
|
5685
|
+
return false;
|
|
5686
|
+
},
|
|
5687
|
+
removeOriginal
|
|
5688
|
+
});
|
|
5689
|
+
};
|
|
5327
5690
|
|
|
5328
|
-
|
|
5329
|
-
this.privateDefaults();
|
|
5330
|
-
}
|
|
5691
|
+
let AuroElement$1 = class AuroElement extends i$2 {
|
|
5331
5692
|
|
|
5332
5693
|
/**
|
|
5333
|
-
*
|
|
5694
|
+
* @type {Object} return object from transportAttributes via a11yUtilities
|
|
5695
|
+
* @property {Function} cleanup - Function to clean up the attribute watcher.
|
|
5696
|
+
* @property {Function} getCurrentAttributes - Function to get the current attributes being watched and their values.
|
|
5697
|
+
* @property {Function} getObservedAttribute - Function to get the value of a specific observed attribute by name.
|
|
5334
5698
|
* @private
|
|
5335
|
-
* @returns {void}
|
|
5336
5699
|
*/
|
|
5337
|
-
|
|
5338
|
-
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
5339
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
5340
|
-
}
|
|
5700
|
+
attributeWatcher;
|
|
5341
5701
|
|
|
5342
|
-
// function to define props used within the scope of this component
|
|
5343
5702
|
static get properties() {
|
|
5344
5703
|
return {
|
|
5345
|
-
...super.properties,
|
|
5346
5704
|
|
|
5347
5705
|
/**
|
|
5348
|
-
*
|
|
5706
|
+
* Defines the layout of an element.
|
|
5707
|
+
* @default {'default'}
|
|
5349
5708
|
*/
|
|
5350
|
-
|
|
5709
|
+
layout: {
|
|
5351
5710
|
type: String,
|
|
5711
|
+
attribute: "layout",
|
|
5352
5712
|
reflect: true
|
|
5353
5713
|
},
|
|
5354
|
-
|
|
5714
|
+
|
|
5355
5715
|
/**
|
|
5356
|
-
*
|
|
5716
|
+
* Defines the shape of an element.
|
|
5717
|
+
* @property {'default', 'rounded', 'pill', 'circle'}
|
|
5718
|
+
* @default {'default'}
|
|
5357
5719
|
*/
|
|
5358
|
-
|
|
5720
|
+
shape: {
|
|
5359
5721
|
type: String,
|
|
5722
|
+
attribute: "shape",
|
|
5360
5723
|
reflect: true
|
|
5361
5724
|
},
|
|
5362
5725
|
|
|
5363
5726
|
/**
|
|
5364
|
-
*
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
type: Boolean
|
|
5368
|
-
},
|
|
5369
|
-
|
|
5370
|
-
/**
|
|
5371
|
-
* When true, auro-icon will render a custom SVG inside the default slot.
|
|
5372
|
-
*/
|
|
5373
|
-
customSvg: {
|
|
5374
|
-
type: Boolean
|
|
5375
|
-
},
|
|
5376
|
-
|
|
5377
|
-
/**
|
|
5378
|
-
* Exposes content in slot as icon label.
|
|
5727
|
+
* Defines the size of an element.
|
|
5728
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'}
|
|
5729
|
+
* @default {'md'}
|
|
5379
5730
|
*/
|
|
5380
|
-
|
|
5381
|
-
type:
|
|
5731
|
+
size: {
|
|
5732
|
+
type: String,
|
|
5733
|
+
attribute: "size",
|
|
5382
5734
|
reflect: true
|
|
5383
5735
|
},
|
|
5384
5736
|
|
|
5385
|
-
/**
|
|
5386
|
-
*
|
|
5737
|
+
/**
|
|
5738
|
+
* This Boolean attribute lets you specify that the element should be rendered in dark mode.
|
|
5739
|
+
* @default {false}
|
|
5387
5740
|
*/
|
|
5388
|
-
|
|
5389
|
-
type:
|
|
5741
|
+
onDark: {
|
|
5742
|
+
type: Boolean,
|
|
5743
|
+
attribute: "ondark",
|
|
5390
5744
|
reflect: true
|
|
5391
5745
|
},
|
|
5392
5746
|
|
|
5393
5747
|
/**
|
|
5394
|
-
*
|
|
5748
|
+
* A reference to the wrapper element in the shadow DOM.
|
|
5749
|
+
* This is used to apply layout and shape classes dynamically.
|
|
5750
|
+
* @type {HTMLElement|null}
|
|
5751
|
+
* @default {null}
|
|
5752
|
+
* @private
|
|
5395
5753
|
*/
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
reflect:
|
|
5754
|
+
wrapper: {
|
|
5755
|
+
attribute: false,
|
|
5756
|
+
reflect: false
|
|
5399
5757
|
}
|
|
5400
5758
|
};
|
|
5401
5759
|
}
|
|
5402
5760
|
|
|
5403
|
-
|
|
5761
|
+
|
|
5762
|
+
|
|
5763
|
+
resetShapeClasses() {
|
|
5764
|
+
if (this.shape && this.size) {
|
|
5765
|
+
|
|
5766
|
+
if (this.wrapper) {
|
|
5767
|
+
this.wrapper.classList.forEach((className) => {
|
|
5768
|
+
if (className.startsWith('shape-')) {
|
|
5769
|
+
this.wrapper.classList.remove(className);
|
|
5770
|
+
}
|
|
5771
|
+
});
|
|
5772
|
+
|
|
5773
|
+
this.wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
5774
|
+
}
|
|
5775
|
+
}
|
|
5776
|
+
}
|
|
5777
|
+
|
|
5778
|
+
resetLayoutClasses() {
|
|
5779
|
+
if (this.layout) {
|
|
5780
|
+
if (this.wrapper) {
|
|
5781
|
+
this.wrapper.classList.forEach((className) => {
|
|
5782
|
+
if (className.startsWith('layout-')) {
|
|
5783
|
+
this.wrapper.classList.remove(className);
|
|
5784
|
+
}
|
|
5785
|
+
});
|
|
5786
|
+
|
|
5787
|
+
this.wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
|
|
5788
|
+
}
|
|
5789
|
+
}
|
|
5790
|
+
}
|
|
5791
|
+
|
|
5792
|
+
updateComponentArchitecture() {
|
|
5793
|
+
this.resetLayoutClasses();
|
|
5794
|
+
this.resetShapeClasses();
|
|
5795
|
+
}
|
|
5796
|
+
|
|
5797
|
+
updated(changedProperties) {
|
|
5798
|
+
if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
|
|
5799
|
+
this.updateComponentArchitecture();
|
|
5800
|
+
}
|
|
5801
|
+
}
|
|
5802
|
+
|
|
5803
|
+
firstUpdated() {
|
|
5804
|
+
super.firstUpdated();
|
|
5805
|
+
|
|
5806
|
+
// Set a reference to the wrapper element in the shadow DOM
|
|
5807
|
+
this.wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
5808
|
+
|
|
5809
|
+
// Initialize the transportation of ARIA attributes to the target element and get the disconnect function for cleanup
|
|
5810
|
+
this.attributeWatcher = transportAllA11yAttributes({ host: this, target: this.shadowRoot.querySelector('.wrapper') });
|
|
5811
|
+
}
|
|
5812
|
+
|
|
5813
|
+
disconnectedCallback() {
|
|
5814
|
+
super.disconnectedCallback();
|
|
5815
|
+
|
|
5816
|
+
// Cleanup the ARIA observer if it exists
|
|
5817
|
+
if (this.attributeWatcher) {
|
|
5818
|
+
this.attributeWatcher.cleanup();
|
|
5819
|
+
this.attributeWatcher = null;
|
|
5820
|
+
}
|
|
5821
|
+
}
|
|
5822
|
+
|
|
5823
|
+
// Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
|
|
5824
|
+
// This will catch if an invalid layout value is passed in and render the default layout if so.
|
|
5825
|
+
render() {
|
|
5826
|
+
try {
|
|
5827
|
+
return this.renderLayout();
|
|
5828
|
+
} catch (error) {
|
|
5829
|
+
// failed to get the defined layout
|
|
5830
|
+
console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
|
|
5831
|
+
|
|
5832
|
+
// fallback to the default layout
|
|
5833
|
+
return this.getLayout('default');
|
|
5834
|
+
}
|
|
5835
|
+
}
|
|
5836
|
+
};
|
|
5837
|
+
|
|
5838
|
+
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}`;
|
|
5839
|
+
|
|
5840
|
+
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)}`;
|
|
5841
|
+
|
|
5842
|
+
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}`;
|
|
5843
|
+
|
|
5844
|
+
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}`;
|
|
5845
|
+
|
|
5846
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
5847
|
+
// See LICENSE in the project root for license information.
|
|
5848
|
+
|
|
5849
|
+
// ---------------------------------------------------------------------
|
|
5850
|
+
|
|
5851
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
5852
|
+
|
|
5853
|
+
let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
5854
|
+
|
|
5855
|
+
/* eslint-disable jsdoc/require-param */
|
|
5856
|
+
|
|
5857
|
+
/**
|
|
5858
|
+
* This will register a new custom element with the browser.
|
|
5859
|
+
* @param {String} name - The name of the custom element.
|
|
5860
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
5861
|
+
* @returns {void}
|
|
5862
|
+
*/
|
|
5863
|
+
registerComponent(name, componentClass) {
|
|
5864
|
+
if (!customElements.get(name)) {
|
|
5865
|
+
customElements.define(name, class extends componentClass {});
|
|
5866
|
+
}
|
|
5867
|
+
}
|
|
5868
|
+
|
|
5869
|
+
/**
|
|
5870
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
5871
|
+
* @returns {void}
|
|
5872
|
+
*/
|
|
5873
|
+
closestElement(
|
|
5874
|
+
selector, // selector like in .closest()
|
|
5875
|
+
base = this, // extra functionality to skip a parent
|
|
5876
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
5877
|
+
!el || el === document || el === window
|
|
5878
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
5879
|
+
: found
|
|
5880
|
+
? found // found a selector INside this element
|
|
5881
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
5882
|
+
) {
|
|
5883
|
+
return __Closest(base);
|
|
5884
|
+
}
|
|
5885
|
+
/* eslint-enable jsdoc/require-param */
|
|
5886
|
+
|
|
5887
|
+
/**
|
|
5888
|
+
* 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.
|
|
5889
|
+
* @param {Object} elem - The element to check.
|
|
5890
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
5891
|
+
* @returns {void}
|
|
5892
|
+
*/
|
|
5893
|
+
handleComponentTagRename(elem, tagName) {
|
|
5894
|
+
const tag = tagName.toLowerCase();
|
|
5895
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
5896
|
+
|
|
5897
|
+
if (elemTag !== tag) {
|
|
5898
|
+
elem.setAttribute(tag, true);
|
|
5899
|
+
}
|
|
5900
|
+
}
|
|
5901
|
+
|
|
5902
|
+
/**
|
|
5903
|
+
* Validates if an element is a specific Auro component.
|
|
5904
|
+
* @param {Object} elem - The element to validate.
|
|
5905
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
5906
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
5907
|
+
*/
|
|
5908
|
+
elementMatch(elem, tagName) {
|
|
5909
|
+
const tag = tagName.toLowerCase();
|
|
5910
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
5911
|
+
|
|
5912
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
5913
|
+
}
|
|
5914
|
+
};
|
|
5915
|
+
|
|
5916
|
+
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}}`;
|
|
5917
|
+
|
|
5918
|
+
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}`;
|
|
5919
|
+
|
|
5920
|
+
var tokensCss$1$1 = i$5`:host{--ds-auro-loader-background-color:currentcolor;--ds-auro-loader-border-color:currentcolor;--ds-auro-loader-color:currentcolor}`;
|
|
5921
|
+
|
|
5922
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5923
|
+
// See LICENSE in the project root for license information.
|
|
5924
|
+
|
|
5925
|
+
|
|
5926
|
+
class AuroLoader extends i$2 {
|
|
5927
|
+
constructor() {
|
|
5928
|
+
super();
|
|
5929
|
+
|
|
5930
|
+
/**
|
|
5931
|
+
* @private
|
|
5932
|
+
*/
|
|
5933
|
+
this.keys = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
5934
|
+
|
|
5935
|
+
/**
|
|
5936
|
+
* @private
|
|
5937
|
+
*/
|
|
5938
|
+
this.mdCount = 3;
|
|
5939
|
+
|
|
5940
|
+
/**
|
|
5941
|
+
* @private
|
|
5942
|
+
*/
|
|
5943
|
+
this.smCount = 2;
|
|
5944
|
+
|
|
5945
|
+
/**
|
|
5946
|
+
* @private
|
|
5947
|
+
*/
|
|
5948
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2();
|
|
5949
|
+
|
|
5950
|
+
this.orbit = false;
|
|
5951
|
+
this.ringworm = false;
|
|
5952
|
+
this.laser = false;
|
|
5953
|
+
this.pulse = false;
|
|
5954
|
+
}
|
|
5955
|
+
|
|
5956
|
+
// function to define props used within the scope of this component
|
|
5957
|
+
static get properties() {
|
|
5958
|
+
return {
|
|
5959
|
+
|
|
5960
|
+
/**
|
|
5961
|
+
* Sets loader to laser type.
|
|
5962
|
+
*/
|
|
5963
|
+
laser: {
|
|
5964
|
+
type: Boolean,
|
|
5965
|
+
reflect: true
|
|
5966
|
+
},
|
|
5967
|
+
|
|
5968
|
+
/**
|
|
5969
|
+
* Sets loader to orbit type.
|
|
5970
|
+
*/
|
|
5971
|
+
orbit: {
|
|
5972
|
+
type: Boolean,
|
|
5973
|
+
reflect: true
|
|
5974
|
+
},
|
|
5975
|
+
|
|
5976
|
+
/**
|
|
5977
|
+
* Sets loader to pulse type.
|
|
5978
|
+
*/
|
|
5979
|
+
pulse: {
|
|
5980
|
+
type: Boolean,
|
|
5981
|
+
reflect: true
|
|
5982
|
+
},
|
|
5983
|
+
|
|
5984
|
+
/**
|
|
5985
|
+
* Sets loader to ringworm type.
|
|
5986
|
+
*/
|
|
5987
|
+
ringworm: {
|
|
5988
|
+
type: Boolean,
|
|
5989
|
+
reflect: true
|
|
5990
|
+
}
|
|
5991
|
+
};
|
|
5992
|
+
}
|
|
5993
|
+
|
|
5994
|
+
static get styles() {
|
|
5995
|
+
return [
|
|
5996
|
+
i$5`${styleCss$2$1}`,
|
|
5997
|
+
i$5`${colorCss$1$1}`,
|
|
5998
|
+
i$5`${tokensCss$1$1}`
|
|
5999
|
+
];
|
|
6000
|
+
}
|
|
6001
|
+
|
|
6002
|
+
/**
|
|
6003
|
+
* This will register this element with the browser.
|
|
6004
|
+
* @param {string} [name="auro-loader"] - The name of element that you want to register to.
|
|
6005
|
+
*
|
|
6006
|
+
* @example
|
|
6007
|
+
* AuroLoader.register("custom-loader") // this will register this element to <custom-loader/>
|
|
6008
|
+
*
|
|
6009
|
+
*/
|
|
6010
|
+
static register(name = "auro-loader") {
|
|
6011
|
+
AuroLibraryRuntimeUtils$2.prototype.registerComponent(name, AuroLoader);
|
|
6012
|
+
}
|
|
6013
|
+
|
|
6014
|
+
firstUpdated() {
|
|
6015
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
6016
|
+
this.runtimeUtils.handleComponentTagRename(this, 'auro-loader');
|
|
6017
|
+
}
|
|
6018
|
+
|
|
6019
|
+
connectedCallback() {
|
|
6020
|
+
super.connectedCallback();
|
|
6021
|
+
}
|
|
6022
|
+
|
|
6023
|
+
/**
|
|
6024
|
+
* @private
|
|
6025
|
+
* @returns {Array} Numbered array for template map.
|
|
6026
|
+
*/
|
|
6027
|
+
defineTemplate() {
|
|
6028
|
+
let nodes = Array.from(Array(this.mdCount).keys());
|
|
6029
|
+
|
|
6030
|
+
if (this.orbit || this.laser) {
|
|
6031
|
+
nodes = Array.from(Array(this.smCount).keys());
|
|
6032
|
+
} else if (this.ringworm) {
|
|
6033
|
+
nodes = Array.from(Array(0).keys());
|
|
6034
|
+
}
|
|
6035
|
+
|
|
6036
|
+
return nodes;
|
|
6037
|
+
}
|
|
6038
|
+
|
|
6039
|
+
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
6040
|
+
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
6041
|
+
|
|
6042
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
6043
|
+
render() {
|
|
6044
|
+
return x`
|
|
6045
|
+
${this.defineTemplate().map((idx) => x`
|
|
6046
|
+
<span part="element" class="loader node-${idx}"></span>
|
|
6047
|
+
`)}
|
|
6048
|
+
|
|
6049
|
+
<div class="no-animation">Loading...</div>
|
|
6050
|
+
|
|
6051
|
+
${this.ringworm ? x`
|
|
6052
|
+
<svg part="element" class="circular" viewBox="25 25 50 50">
|
|
6053
|
+
<circle class="path" cx="50" cy="50" r="20" fill="none"/>
|
|
6054
|
+
</svg>`
|
|
6055
|
+
: ``
|
|
6056
|
+
}
|
|
6057
|
+
`;
|
|
6058
|
+
}
|
|
6059
|
+
}
|
|
6060
|
+
|
|
6061
|
+
var loaderVersion = '5.0.0';
|
|
6062
|
+
|
|
6063
|
+
/* eslint-disable max-lines, curly, jsdoc/no-undefined-types */
|
|
6064
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6065
|
+
// See LICENSE in the project root for license information.
|
|
6066
|
+
|
|
6067
|
+
|
|
6068
|
+
/**
|
|
6069
|
+
* @slot - Default slot for the text of the button.
|
|
6070
|
+
* @csspart button - Apply CSS to HTML5 button.
|
|
6071
|
+
* @csspart loader - Apply CSS to auro-loader.
|
|
6072
|
+
* @csspart text - Apply CSS to text slot.
|
|
6073
|
+
* @csspart icon - Apply CSS to icon slot.
|
|
6074
|
+
*/
|
|
6075
|
+
|
|
6076
|
+
/* eslint-disable lit/no-invalid-html, lit/binding-positions */
|
|
6077
|
+
|
|
6078
|
+
const ICON_ONLY_SHAPES = ['circle'];
|
|
6079
|
+
|
|
6080
|
+
/**
|
|
6081
|
+
* AuroButton is a custom element that provides a styled, accessible button with support for various states and form association.
|
|
6082
|
+
* It is designed to be flexible, supporting loading states, icon slots, and integration with HTML5 forms.
|
|
6083
|
+
* @property {'default', 'rounded', 'pill', 'circle'} shape - Defines the shape of the button.
|
|
6084
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'} size - Defines the size of the button.
|
|
6085
|
+
* @property {'primary', 'secondary', 'tertiary', 'ghost', 'flat'} variant - Sets the button variant.
|
|
6086
|
+
* @property {'submit', 'reset', 'button'} type - The type of button. Matches HTML5 Button Spec.
|
|
6087
|
+
* @property {boolean} onDark - Indicates if the button is rendered in dark mode.
|
|
6088
|
+
*/
|
|
6089
|
+
class AuroButton extends AuroElement$1 {
|
|
6090
|
+
|
|
6091
|
+
/**
|
|
6092
|
+
* Enables form association for this element.
|
|
6093
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals
|
|
6094
|
+
* @returns {boolean} - Returns true to enable form association.
|
|
6095
|
+
*/
|
|
6096
|
+
static get formAssociated() {
|
|
6097
|
+
return true;
|
|
6098
|
+
}
|
|
6099
|
+
|
|
6100
|
+
constructor() {
|
|
6101
|
+
super();
|
|
6102
|
+
this.autofocus = false;
|
|
6103
|
+
this.disabled = false;
|
|
6104
|
+
this.loading = false;
|
|
6105
|
+
this.size = "md";
|
|
6106
|
+
this.shape = "rounded";
|
|
6107
|
+
this.onDark = false;
|
|
6108
|
+
this.fluid = false;
|
|
6109
|
+
this.loadingText = this.loadingText || 'Loading...';
|
|
6110
|
+
|
|
6111
|
+
// Support for HTML5 forms
|
|
6112
|
+
if (typeof this.attachInternals === 'function') {
|
|
6113
|
+
this.internals = this.attachInternals();
|
|
6114
|
+
} else {
|
|
6115
|
+
this.internals = null;
|
|
6116
|
+
|
|
6117
|
+
// eslint-disable-next-line no-console
|
|
6118
|
+
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.');
|
|
6119
|
+
}
|
|
6120
|
+
|
|
6121
|
+
/**
|
|
6122
|
+
* Generate unique names for dependency components.
|
|
6123
|
+
*/
|
|
6124
|
+
const versioning = new AuroDependencyVersioning();
|
|
6125
|
+
|
|
6126
|
+
/**
|
|
6127
|
+
* @private
|
|
6128
|
+
*/
|
|
6129
|
+
this.loaderTag = versioning.generateTag('auro-loader', loaderVersion, AuroLoader);
|
|
6130
|
+
|
|
6131
|
+
/**
|
|
6132
|
+
* @private
|
|
6133
|
+
*/
|
|
6134
|
+
this.buttonHref = undefined;
|
|
6135
|
+
|
|
6136
|
+
/**
|
|
6137
|
+
* @private
|
|
6138
|
+
*/
|
|
6139
|
+
this.buttonTarget = undefined;
|
|
6140
|
+
|
|
6141
|
+
/**
|
|
6142
|
+
* @private
|
|
6143
|
+
*/
|
|
6144
|
+
this.buttonRel = undefined;
|
|
6145
|
+
}
|
|
6146
|
+
|
|
6147
|
+
static get styles() {
|
|
6148
|
+
return [
|
|
6149
|
+
tokensCss$2$1,
|
|
6150
|
+
styleCss$3$1,
|
|
6151
|
+
colorCss$2$1,
|
|
6152
|
+
shapeSize
|
|
6153
|
+
];
|
|
6154
|
+
}
|
|
6155
|
+
|
|
6156
|
+
static get properties() {
|
|
6157
|
+
return {
|
|
6158
|
+
|
|
6159
|
+
...super.properties,
|
|
6160
|
+
|
|
6161
|
+
/**
|
|
6162
|
+
* Override layout since it isn't used in this component.
|
|
6163
|
+
* @private
|
|
6164
|
+
*/
|
|
6165
|
+
layout: {
|
|
6166
|
+
type: Boolean,
|
|
6167
|
+
attribute: false,
|
|
6168
|
+
reflect: false
|
|
6169
|
+
},
|
|
6170
|
+
|
|
6171
|
+
/**
|
|
6172
|
+
* This Boolean attribute lets you specify that the button should have input focus when the page loads, unless overridden by the user.
|
|
6173
|
+
*/
|
|
6174
|
+
autofocus: {
|
|
6175
|
+
type: Boolean,
|
|
6176
|
+
reflect: true
|
|
6177
|
+
},
|
|
6178
|
+
|
|
6179
|
+
/**
|
|
6180
|
+
* If set to true, button will become disabled and not allow for interactions.
|
|
6181
|
+
*/
|
|
6182
|
+
disabled: {
|
|
6183
|
+
type: Boolean,
|
|
6184
|
+
reflect: true
|
|
6185
|
+
},
|
|
6186
|
+
|
|
6187
|
+
/**
|
|
6188
|
+
* Alters the shape of the button to be full width of its parent container.
|
|
6189
|
+
*/
|
|
6190
|
+
fluid: {
|
|
6191
|
+
type: Boolean,
|
|
6192
|
+
reflect: true
|
|
6193
|
+
},
|
|
6194
|
+
|
|
6195
|
+
/**
|
|
6196
|
+
* If set to true button text will be replaced with `auro-loader` and become disabled.
|
|
6197
|
+
*/
|
|
6198
|
+
loading: {
|
|
6199
|
+
type: Boolean,
|
|
6200
|
+
reflect: true
|
|
6201
|
+
},
|
|
6202
|
+
|
|
6203
|
+
/**
|
|
6204
|
+
* 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.
|
|
6205
|
+
*/
|
|
6206
|
+
loadingText: {
|
|
6207
|
+
type: String
|
|
6208
|
+
},
|
|
6209
|
+
|
|
6210
|
+
/**
|
|
6211
|
+
* Populates `tabindex` to define the focusable sequence in keyboard navigation.
|
|
6212
|
+
*/
|
|
6213
|
+
tIndex: {
|
|
6214
|
+
type: String,
|
|
6215
|
+
reflect: true
|
|
6216
|
+
},
|
|
6217
|
+
|
|
6218
|
+
/**
|
|
6219
|
+
* Populates `tabindex` to define the focusable sequence in keyboard navigation.
|
|
6220
|
+
* Must be used with "." to ensure the host element does not retain a reference to the `tabindex` attribute.
|
|
6221
|
+
* Example: `<auro-button .tabindex="${this.disabled ? '-1' : '0'}"></auro-button>`
|
|
6222
|
+
*/
|
|
6223
|
+
tabindex: {
|
|
6224
|
+
type: String,
|
|
6225
|
+
reflect: false
|
|
6226
|
+
},
|
|
6227
|
+
|
|
6228
|
+
/**
|
|
6229
|
+
* Sets title attribute. The information is most often shown as a tooltip text when the mouse moves over the element.
|
|
6230
|
+
*/
|
|
6231
|
+
title: {
|
|
6232
|
+
type: String,
|
|
6233
|
+
reflect: true
|
|
6234
|
+
},
|
|
6235
|
+
|
|
6236
|
+
/**
|
|
6237
|
+
* The type of the button. Possible values are: `submit`, `reset`, `button`.
|
|
6238
|
+
*/
|
|
6239
|
+
type: {
|
|
6240
|
+
type: String,
|
|
6241
|
+
reflect: true
|
|
6242
|
+
},
|
|
6243
|
+
|
|
6244
|
+
/**
|
|
6245
|
+
* Defines the value associated with the button which is submitted with the form data.
|
|
6246
|
+
*/
|
|
6247
|
+
value: {
|
|
6248
|
+
type: String,
|
|
6249
|
+
reflect: true
|
|
6250
|
+
},
|
|
6251
|
+
|
|
6252
|
+
/**
|
|
6253
|
+
* Sets button variant option.
|
|
6254
|
+
* @default primary
|
|
6255
|
+
*/
|
|
6256
|
+
variant: {
|
|
6257
|
+
type: String,
|
|
6258
|
+
reflect: true
|
|
6259
|
+
},
|
|
6260
|
+
|
|
6261
|
+
/**
|
|
6262
|
+
* @private
|
|
6263
|
+
*/
|
|
6264
|
+
buttonHref: {
|
|
6265
|
+
type: String,
|
|
6266
|
+
},
|
|
6267
|
+
|
|
6268
|
+
/**
|
|
6269
|
+
* @private
|
|
6270
|
+
*/
|
|
6271
|
+
buttonTarget: {
|
|
6272
|
+
type: String,
|
|
6273
|
+
},
|
|
6274
|
+
|
|
6275
|
+
/**
|
|
6276
|
+
* @private
|
|
6277
|
+
*/
|
|
6278
|
+
buttonRel: {
|
|
6279
|
+
type: String,
|
|
6280
|
+
},
|
|
6281
|
+
};
|
|
6282
|
+
}
|
|
6283
|
+
|
|
6284
|
+
/**
|
|
6285
|
+
* This will register this element with the browser.
|
|
6286
|
+
* @param {string} [name="auro-button"] - The name of element that you want to register to.
|
|
6287
|
+
*
|
|
6288
|
+
* @example
|
|
6289
|
+
* AuroButton.register("custom-button") // this will register this element to <custom-button/>
|
|
6290
|
+
*
|
|
6291
|
+
*/
|
|
6292
|
+
static register(name = "auro-button") {
|
|
6293
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroButton);
|
|
6294
|
+
}
|
|
6295
|
+
|
|
6296
|
+
/**
|
|
6297
|
+
* Internal method to apply focus to the HTML5 button.
|
|
6298
|
+
* @private
|
|
6299
|
+
* @returns {void}
|
|
6300
|
+
*/
|
|
6301
|
+
focus() {
|
|
6302
|
+
this.renderRoot.querySelector('button').focus();
|
|
6303
|
+
}
|
|
6304
|
+
|
|
6305
|
+
/**
|
|
6306
|
+
* Submits the form that this button is associated with.
|
|
6307
|
+
* @private
|
|
6308
|
+
* @returns {void}
|
|
6309
|
+
*/
|
|
6310
|
+
surfaceSubmitEvent() {
|
|
6311
|
+
if (this.form) {
|
|
6312
|
+
this.form.requestSubmit();
|
|
6313
|
+
}
|
|
6314
|
+
}
|
|
6315
|
+
|
|
6316
|
+
/**
|
|
6317
|
+
* Returns the form element that this button is associated with.
|
|
6318
|
+
* @private
|
|
6319
|
+
* @returns {HTMLFormElement | null}
|
|
6320
|
+
*/
|
|
6321
|
+
get form() {
|
|
6322
|
+
return this.internals ? this.internals.form : null;
|
|
6323
|
+
}
|
|
6324
|
+
|
|
6325
|
+
/**
|
|
6326
|
+
* @private
|
|
6327
|
+
* @returns {Boolean}
|
|
6328
|
+
*/
|
|
6329
|
+
get hideText() {
|
|
6330
|
+
return ICON_ONLY_SHAPES.includes(this.shape);
|
|
6331
|
+
}
|
|
6332
|
+
|
|
6333
|
+
/**
|
|
6334
|
+
* Returns the current value of the projected `aria-label` attribute or undefined if not set.
|
|
6335
|
+
* @returns {string | undefined}
|
|
6336
|
+
* @private
|
|
6337
|
+
*/
|
|
6338
|
+
get currentAriaLabel() {
|
|
6339
|
+
if (!this.attributeWatcher) return undefined;
|
|
6340
|
+
|
|
6341
|
+
const ariaLabel = this.attributeWatcher.getObservedAttribute("aria-label");
|
|
6342
|
+
return ariaLabel || undefined;
|
|
6343
|
+
}
|
|
6344
|
+
|
|
6345
|
+
/**
|
|
6346
|
+
* Returns the current value of the projected `aria-labelledby` attribute or undefined if not set.
|
|
6347
|
+
* @returns {string | undefined}
|
|
6348
|
+
* @private
|
|
6349
|
+
*/
|
|
6350
|
+
get currentAriaLabelledBy() {
|
|
6351
|
+
if (!this.attributeWatcher) return undefined;
|
|
6352
|
+
|
|
6353
|
+
const ariaLabelledBy = this.attributeWatcher.getObservedAttribute("aria-labelledby");
|
|
6354
|
+
return ariaLabelledBy || undefined;
|
|
6355
|
+
}
|
|
6356
|
+
|
|
6357
|
+
/**
|
|
6358
|
+
* Renders the default layout for the button.
|
|
6359
|
+
* @returns {TemplateResult}
|
|
6360
|
+
* @private
|
|
6361
|
+
*/
|
|
6362
|
+
renderLayoutDefault() {
|
|
6363
|
+
const classes = {
|
|
6364
|
+
"util_insetLg--squish": true,
|
|
6365
|
+
"auro-button": true,
|
|
6366
|
+
"icon-only": this.hideText,
|
|
6367
|
+
wrapper: true,
|
|
6368
|
+
loading: this.loading,
|
|
6369
|
+
};
|
|
6370
|
+
|
|
6371
|
+
const tag = this.buttonHref ? i`a` : i`button`;
|
|
6372
|
+
const part = this.buttonHref ? 'link' : 'button';
|
|
6373
|
+
|
|
6374
|
+
return u`
|
|
6375
|
+
<${tag}
|
|
6376
|
+
part="${part}"
|
|
6377
|
+
aria-label="${o(this.loading ? this.loadingText : this.currentAriaLabel || undefined)}"
|
|
6378
|
+
aria-labelledby="${o(this.loading ? undefined : this.currentAriaLabelledBy || undefined)}"
|
|
6379
|
+
tabindex="${o(this.tIndex || this.tabindex)}"
|
|
6380
|
+
?autofocus="${this.autofocus}"
|
|
6381
|
+
class=${e(classes)}
|
|
6382
|
+
?disabled="${this.disabled || this.loading}"
|
|
6383
|
+
?onDark="${this.onDark}"
|
|
6384
|
+
title="${o(this.title ? this.title : undefined)}"
|
|
6385
|
+
name="${o(this.name ? this.name : undefined)}"
|
|
6386
|
+
type="${o(this.type ? this.type : undefined)}"
|
|
6387
|
+
variant="${o(this.variant ? this.variant : undefined)}"
|
|
6388
|
+
.value="${o(this.value ? this.value : undefined)}"
|
|
6389
|
+
@click="${this.type === 'submit' ? this.surfaceSubmitEvent : undefined}"
|
|
6390
|
+
href="${o(this.buttonHref || undefined)}"
|
|
6391
|
+
target="${o(this.buttonTarget || undefined)}"
|
|
6392
|
+
rel="${o(this.buttonRel || undefined)}"
|
|
6393
|
+
>
|
|
6394
|
+
${o(this.loading ? u`<${this.loaderTag} pulse part="loader"></${this.loaderTag}>` : undefined)}
|
|
6395
|
+
|
|
6396
|
+
<span class="contentWrapper">
|
|
6397
|
+
<span class="textSlot" part="text">
|
|
6398
|
+
<slot></slot>
|
|
6399
|
+
</span>
|
|
6400
|
+
</span>
|
|
6401
|
+
</${tag}>
|
|
6402
|
+
`;
|
|
6403
|
+
}
|
|
6404
|
+
|
|
6405
|
+
/**
|
|
6406
|
+
* Renders the layout of the button.
|
|
6407
|
+
* @returns {TemplateResult}
|
|
6408
|
+
* @private
|
|
6409
|
+
*/
|
|
6410
|
+
renderLayout() {
|
|
6411
|
+
return this.renderLayoutDefault();
|
|
6412
|
+
}
|
|
6413
|
+
}
|
|
6414
|
+
|
|
6415
|
+
var buttonVersion = '11.2.1';
|
|
6416
|
+
|
|
6417
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6418
|
+
// See LICENSE in the project root for license information.
|
|
6419
|
+
|
|
6420
|
+
|
|
6421
|
+
/**
|
|
6422
|
+
* @attr {Boolean} hidden - If present, the component will be hidden both visually and from screen readers
|
|
6423
|
+
* @attr {Boolean} hiddenVisually - If present, the component will be hidden visually, but still read by screen readers
|
|
6424
|
+
* @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
|
|
6425
|
+
*/
|
|
6426
|
+
|
|
6427
|
+
let AuroElement$2 = class AuroElement extends i$2 {
|
|
6428
|
+
|
|
6429
|
+
// function to define props used within the scope of this component
|
|
6430
|
+
static get properties() {
|
|
6431
|
+
return {
|
|
6432
|
+
hidden: { type: Boolean,
|
|
6433
|
+
reflect: true },
|
|
6434
|
+
hiddenVisually: { type: Boolean,
|
|
6435
|
+
reflect: true },
|
|
6436
|
+
hiddenAudible: { type: Boolean,
|
|
6437
|
+
reflect: true },
|
|
6438
|
+
};
|
|
6439
|
+
}
|
|
6440
|
+
|
|
6441
|
+
/**
|
|
6442
|
+
* @private Function that determines state of aria-hidden
|
|
6443
|
+
*/
|
|
6444
|
+
hideAudible(value) {
|
|
6445
|
+
if (value) {
|
|
6446
|
+
return 'true'
|
|
6447
|
+
}
|
|
6448
|
+
|
|
6449
|
+
return 'false'
|
|
6450
|
+
}
|
|
6451
|
+
};
|
|
6452
|
+
|
|
6453
|
+
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>"};
|
|
6454
|
+
|
|
6455
|
+
/* eslint-disable no-underscore-dangle, jsdoc/no-undefined-types, jsdoc/require-param-description */
|
|
6456
|
+
|
|
6457
|
+
const _fetchMap$1 = new Map();
|
|
6458
|
+
|
|
6459
|
+
/**
|
|
6460
|
+
* A callback to parse Response body.
|
|
6461
|
+
*
|
|
6462
|
+
* @callback ResponseParser
|
|
6463
|
+
* @param {Fetch.Response} response
|
|
6464
|
+
* @returns {Promise}
|
|
6465
|
+
*/
|
|
6466
|
+
|
|
6467
|
+
/**
|
|
6468
|
+
* A minimal in-memory map to de-duplicate Fetch API media requests.
|
|
6469
|
+
*
|
|
6470
|
+
* @param {String} uri
|
|
6471
|
+
* @param {Object} [options={}]
|
|
6472
|
+
* @param {ResponseParser} [options.responseParser=(response) => response.text()]
|
|
6473
|
+
* @returns {Promise}
|
|
6474
|
+
*/
|
|
6475
|
+
const cacheFetch$1 = (uri, options = {}) => {
|
|
6476
|
+
const responseParser = options.responseParser || ((response) => response.text());
|
|
6477
|
+
if (!_fetchMap$1.has(uri)) {
|
|
6478
|
+
_fetchMap$1.set(uri, fetch(uri).then(responseParser));
|
|
6479
|
+
}
|
|
6480
|
+
return _fetchMap$1.get(uri);
|
|
6481
|
+
};
|
|
6482
|
+
|
|
6483
|
+
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}`;
|
|
6484
|
+
|
|
6485
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6486
|
+
// See LICENSE in the project root for license information.
|
|
6487
|
+
|
|
6488
|
+
|
|
6489
|
+
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
6490
|
+
/**
|
|
6491
|
+
* @slot - Hidden from visibility, used for a11y if icon description is needed
|
|
6492
|
+
*/
|
|
6493
|
+
|
|
6494
|
+
// build the component class
|
|
6495
|
+
let BaseIcon$1 = class BaseIcon extends AuroElement$2 {
|
|
6496
|
+
constructor() {
|
|
6497
|
+
super();
|
|
6498
|
+
this.onDark = false;
|
|
6499
|
+
}
|
|
6500
|
+
|
|
6501
|
+
// function to define props used within the scope of this component
|
|
6502
|
+
static get properties() {
|
|
6503
|
+
return {
|
|
6504
|
+
...super.properties,
|
|
6505
|
+
|
|
6506
|
+
/**
|
|
6507
|
+
* Set value for on-dark version of auro-icon.
|
|
6508
|
+
*/
|
|
6509
|
+
onDark: {
|
|
6510
|
+
type: Boolean,
|
|
6511
|
+
reflect: true
|
|
6512
|
+
},
|
|
6513
|
+
|
|
6514
|
+
/**
|
|
6515
|
+
* @private
|
|
6516
|
+
*/
|
|
6517
|
+
svg: {
|
|
6518
|
+
attribute: false,
|
|
6519
|
+
reflect: true
|
|
6520
|
+
}
|
|
6521
|
+
};
|
|
6522
|
+
}
|
|
6523
|
+
|
|
6524
|
+
static get styles() {
|
|
6525
|
+
return i$5`
|
|
6526
|
+
${styleCss$1$1}
|
|
6527
|
+
`;
|
|
6528
|
+
}
|
|
6529
|
+
|
|
6530
|
+
/**
|
|
6531
|
+
* Async function to fetch requested icon from npm CDN.
|
|
6532
|
+
* @private
|
|
6533
|
+
* @param {string} category - Icon category.
|
|
6534
|
+
* @param {string} name - Icon name.
|
|
6535
|
+
* @returns {SVGElement} DOM - Ready HTML to be appended.
|
|
6536
|
+
*/
|
|
6537
|
+
async fetchIcon(category, name) {
|
|
6538
|
+
let iconHTML = '';
|
|
6539
|
+
|
|
6540
|
+
if (category === 'logos') {
|
|
6541
|
+
iconHTML = await cacheFetch$1(`${this.uri}/${category}/${name}.svg`);
|
|
6542
|
+
} else {
|
|
6543
|
+
iconHTML = await cacheFetch$1(`${this.uri}/icons/${category}/${name}.svg`);
|
|
6544
|
+
}
|
|
6545
|
+
|
|
6546
|
+
const dom = new DOMParser().parseFromString(iconHTML, 'text/html');
|
|
6547
|
+
|
|
6548
|
+
return dom.body.querySelector('svg');
|
|
6549
|
+
}
|
|
6550
|
+
|
|
6551
|
+
// lifecycle function
|
|
6552
|
+
async firstUpdated() {
|
|
6553
|
+
if (!this.customSvg) {
|
|
6554
|
+
const svg = await this.fetchIcon(this.category, this.name);
|
|
6555
|
+
|
|
6556
|
+
if (svg) {
|
|
6557
|
+
this.svg = svg;
|
|
6558
|
+
} else if (!svg) {
|
|
6559
|
+
const penDOM = new DOMParser().parseFromString(error$1.svg, 'text/html');
|
|
6560
|
+
|
|
6561
|
+
this.svg = penDOM.body.firstChild;
|
|
6562
|
+
}
|
|
6563
|
+
}
|
|
6564
|
+
}
|
|
6565
|
+
};
|
|
6566
|
+
|
|
6567
|
+
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)}`;
|
|
6568
|
+
|
|
6569
|
+
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)}`;
|
|
6570
|
+
|
|
6571
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6572
|
+
// See LICENSE in the project root for license information.
|
|
6573
|
+
|
|
6574
|
+
// ---------------------------------------------------------------------
|
|
6575
|
+
|
|
6576
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
6577
|
+
|
|
6578
|
+
let AuroLibraryRuntimeUtils$1$1 = class AuroLibraryRuntimeUtils {
|
|
6579
|
+
|
|
6580
|
+
/* eslint-disable jsdoc/require-param */
|
|
6581
|
+
|
|
6582
|
+
/**
|
|
6583
|
+
* This will register a new custom element with the browser.
|
|
6584
|
+
* @param {String} name - The name of the custom element.
|
|
6585
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
6586
|
+
* @returns {void}
|
|
6587
|
+
*/
|
|
6588
|
+
registerComponent(name, componentClass) {
|
|
6589
|
+
if (!customElements.get(name)) {
|
|
6590
|
+
customElements.define(name, class extends componentClass {});
|
|
6591
|
+
}
|
|
6592
|
+
}
|
|
6593
|
+
|
|
6594
|
+
/**
|
|
6595
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
6596
|
+
* @returns {void}
|
|
6597
|
+
*/
|
|
6598
|
+
closestElement(
|
|
6599
|
+
selector, // selector like in .closest()
|
|
6600
|
+
base = this, // extra functionality to skip a parent
|
|
6601
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
6602
|
+
!el || el === document || el === window
|
|
6603
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
6604
|
+
: found
|
|
6605
|
+
? found // found a selector INside this element
|
|
6606
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
6607
|
+
) {
|
|
6608
|
+
return __Closest(base);
|
|
6609
|
+
}
|
|
6610
|
+
/* eslint-enable jsdoc/require-param */
|
|
6611
|
+
|
|
6612
|
+
/**
|
|
6613
|
+
* 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.
|
|
6614
|
+
* @param {Object} elem - The element to check.
|
|
6615
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
6616
|
+
* @returns {void}
|
|
6617
|
+
*/
|
|
6618
|
+
handleComponentTagRename(elem, tagName) {
|
|
6619
|
+
const tag = tagName.toLowerCase();
|
|
6620
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6621
|
+
|
|
6622
|
+
if (elemTag !== tag) {
|
|
6623
|
+
elem.setAttribute(tag, true);
|
|
6624
|
+
}
|
|
6625
|
+
}
|
|
6626
|
+
|
|
6627
|
+
/**
|
|
6628
|
+
* Validates if an element is a specific Auro component.
|
|
6629
|
+
* @param {Object} elem - The element to validate.
|
|
6630
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
6631
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
6632
|
+
*/
|
|
6633
|
+
elementMatch(elem, tagName) {
|
|
6634
|
+
const tag = tagName.toLowerCase();
|
|
6635
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6636
|
+
|
|
6637
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
6638
|
+
}
|
|
6639
|
+
};
|
|
6640
|
+
|
|
6641
|
+
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6642
|
+
// See LICENSE in the project root for license information.
|
|
6643
|
+
|
|
6644
|
+
|
|
6645
|
+
let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
6646
|
+
constructor() {
|
|
6647
|
+
super();
|
|
6648
|
+
|
|
6649
|
+
this.variant = undefined;
|
|
6650
|
+
this.privateDefaults();
|
|
6651
|
+
}
|
|
6652
|
+
|
|
6653
|
+
/**
|
|
6654
|
+
* Internal Defaults.
|
|
6655
|
+
* @private
|
|
6656
|
+
* @returns {void}
|
|
6657
|
+
*/
|
|
6658
|
+
privateDefaults() {
|
|
6659
|
+
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
6660
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$1$1();
|
|
6661
|
+
}
|
|
6662
|
+
|
|
6663
|
+
// function to define props used within the scope of this component
|
|
6664
|
+
static get properties() {
|
|
6665
|
+
return {
|
|
6666
|
+
...super.properties,
|
|
6667
|
+
|
|
6668
|
+
/**
|
|
6669
|
+
* Set aria-hidden value. Default is `true`. Option is `false`.
|
|
6670
|
+
*/
|
|
6671
|
+
ariaHidden: {
|
|
6672
|
+
type: String,
|
|
6673
|
+
reflect: true
|
|
6674
|
+
},
|
|
6675
|
+
|
|
6676
|
+
/**
|
|
6677
|
+
* The category of the icon you are looking for. See https://auro.alaskaair.com/icons/usage.
|
|
6678
|
+
*/
|
|
6679
|
+
category: {
|
|
6680
|
+
type: String,
|
|
6681
|
+
reflect: true
|
|
6682
|
+
},
|
|
6683
|
+
|
|
6684
|
+
/**
|
|
6685
|
+
* Allows custom color to be set.
|
|
6686
|
+
*/
|
|
6687
|
+
customColor: {
|
|
6688
|
+
type: Boolean
|
|
6689
|
+
},
|
|
6690
|
+
|
|
6691
|
+
/**
|
|
6692
|
+
* When true, auro-icon will render a custom SVG inside the default slot.
|
|
6693
|
+
*/
|
|
6694
|
+
customSvg: {
|
|
6695
|
+
type: Boolean
|
|
6696
|
+
},
|
|
6697
|
+
|
|
6698
|
+
/**
|
|
6699
|
+
* Exposes content in slot as icon label.
|
|
6700
|
+
*/
|
|
6701
|
+
label: {
|
|
6702
|
+
type: Boolean,
|
|
6703
|
+
reflect: true
|
|
6704
|
+
},
|
|
6705
|
+
|
|
6706
|
+
/**
|
|
6707
|
+
* The name of the icon you are looking for without the file extension. See https://auro.alaskaair.com/icons/usage.
|
|
6708
|
+
*/
|
|
6709
|
+
name: {
|
|
6710
|
+
type: String,
|
|
6711
|
+
reflect: true
|
|
6712
|
+
},
|
|
6713
|
+
|
|
6714
|
+
/**
|
|
6715
|
+
* The style of the icon. The accepted variants are `accent1`, `disabled`, `muted`, `statusDefault`, `statusInfo`, `statusSuccess`, `statusWarning`, `statusError`, `statusInfoSubtle`, `statusSuccessSubtle`, `statusWarningSubtle`, `statusErrorSubtle`, `fareBasicEconomy`, `fareBusiness`, `fareEconomy`, `fareFirst`, `farePremiumEconomy`, `tierOneWorldEmerald`, `tierOneWorldSapphire`, `tierOneWorldRuby`.
|
|
6716
|
+
*/
|
|
6717
|
+
variant: {
|
|
6718
|
+
type: String,
|
|
6719
|
+
reflect: true
|
|
6720
|
+
}
|
|
6721
|
+
};
|
|
6722
|
+
}
|
|
6723
|
+
|
|
6724
|
+
static get styles() {
|
|
5404
6725
|
return [
|
|
5405
6726
|
super.styles,
|
|
5406
|
-
i$5`${tokensCss$
|
|
6727
|
+
i$5`${tokensCss$3}`,
|
|
5407
6728
|
i$5`${styleCss$1$1}`,
|
|
5408
|
-
i$5`${colorCss$
|
|
6729
|
+
i$5`${colorCss$4}`
|
|
5409
6730
|
];
|
|
5410
6731
|
}
|
|
5411
6732
|
|
|
@@ -5418,7 +6739,7 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5418
6739
|
*
|
|
5419
6740
|
*/
|
|
5420
6741
|
static register(name = "auro-icon") {
|
|
5421
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroIcon);
|
|
6742
|
+
AuroLibraryRuntimeUtils$1$1.prototype.registerComponent(name, AuroIcon);
|
|
5422
6743
|
}
|
|
5423
6744
|
|
|
5424
6745
|
connectedCallback() {
|
|
@@ -5439,8 +6760,12 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5439
6760
|
async firstUpdated() {
|
|
5440
6761
|
await super.firstUpdated();
|
|
5441
6762
|
|
|
5442
|
-
|
|
5443
|
-
|
|
6763
|
+
/**
|
|
6764
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
6765
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
6766
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
6767
|
+
*/
|
|
6768
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
5444
6769
|
const svgDesc = this.svg.querySelector('desc');
|
|
5445
6770
|
|
|
5446
6771
|
if (svgDesc) {
|
|
@@ -5450,43 +6775,113 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
5450
6775
|
}
|
|
5451
6776
|
}
|
|
5452
6777
|
|
|
5453
|
-
// function that renders the HTML and CSS into the scope of the component
|
|
5454
|
-
render() {
|
|
5455
|
-
const labelClasses = {
|
|
5456
|
-
'labelWrapper': true,
|
|
5457
|
-
'util_displayHiddenVisually': !this.label
|
|
5458
|
-
};
|
|
5459
|
-
|
|
5460
|
-
const svgClasses = {
|
|
5461
|
-
'svgWrapper': true,
|
|
5462
|
-
};
|
|
5463
|
-
|
|
5464
|
-
return x`
|
|
5465
|
-
<div class="componentWrapper">
|
|
5466
|
-
<div
|
|
5467
|
-
class="${e(svgClasses)}"
|
|
5468
|
-
title="${o(this.title || undefined)}">
|
|
5469
|
-
<span aria-hidden="${o(this.ariaHidden || true)}" part="svg">
|
|
5470
|
-
${this.customSvg ? x`
|
|
5471
|
-
<slot name="svg"></slot>
|
|
5472
|
-
` : x`
|
|
5473
|
-
${this.svg}
|
|
5474
|
-
`
|
|
5475
|
-
}
|
|
5476
|
-
</span>
|
|
5477
|
-
</div>
|
|
6778
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
6779
|
+
render() {
|
|
6780
|
+
const labelClasses = {
|
|
6781
|
+
'labelWrapper': true,
|
|
6782
|
+
'util_displayHiddenVisually': !this.label
|
|
6783
|
+
};
|
|
6784
|
+
|
|
6785
|
+
const svgClasses = {
|
|
6786
|
+
'svgWrapper': true,
|
|
6787
|
+
};
|
|
6788
|
+
|
|
6789
|
+
return x`
|
|
6790
|
+
<div class="componentWrapper">
|
|
6791
|
+
<div
|
|
6792
|
+
class="${e(svgClasses)}"
|
|
6793
|
+
title="${o(this.title || undefined)}">
|
|
6794
|
+
<span aria-hidden="${o(this.ariaHidden || true)}" part="svg">
|
|
6795
|
+
${this.customSvg ? x`
|
|
6796
|
+
<slot name="svg"></slot>
|
|
6797
|
+
` : x`
|
|
6798
|
+
${this.svg}
|
|
6799
|
+
`
|
|
6800
|
+
}
|
|
6801
|
+
</span>
|
|
6802
|
+
</div>
|
|
6803
|
+
|
|
6804
|
+
<div class="${e(labelClasses)}">
|
|
6805
|
+
<slot></slot>
|
|
6806
|
+
</div>
|
|
6807
|
+
</div>
|
|
6808
|
+
`;
|
|
6809
|
+
}
|
|
6810
|
+
};
|
|
6811
|
+
|
|
6812
|
+
var iconVersion$1 = '8.0.4';
|
|
6813
|
+
|
|
6814
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6815
|
+
// See LICENSE in the project root for license information.
|
|
6816
|
+
|
|
6817
|
+
// ---------------------------------------------------------------------
|
|
6818
|
+
|
|
6819
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
6820
|
+
|
|
6821
|
+
let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
6822
|
+
|
|
6823
|
+
/* eslint-disable jsdoc/require-param */
|
|
6824
|
+
|
|
6825
|
+
/**
|
|
6826
|
+
* This will register a new custom element with the browser.
|
|
6827
|
+
* @param {String} name - The name of the custom element.
|
|
6828
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
6829
|
+
* @returns {void}
|
|
6830
|
+
*/
|
|
6831
|
+
registerComponent(name, componentClass) {
|
|
6832
|
+
if (!customElements.get(name)) {
|
|
6833
|
+
customElements.define(name, class extends componentClass {});
|
|
6834
|
+
}
|
|
6835
|
+
}
|
|
6836
|
+
|
|
6837
|
+
/**
|
|
6838
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
6839
|
+
* @returns {void}
|
|
6840
|
+
*/
|
|
6841
|
+
closestElement(
|
|
6842
|
+
selector, // selector like in .closest()
|
|
6843
|
+
base = this, // extra functionality to skip a parent
|
|
6844
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
6845
|
+
!el || el === document || el === window
|
|
6846
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
6847
|
+
: found
|
|
6848
|
+
? found // found a selector INside this element
|
|
6849
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
6850
|
+
) {
|
|
6851
|
+
return __Closest(base);
|
|
6852
|
+
}
|
|
6853
|
+
/* eslint-enable jsdoc/require-param */
|
|
6854
|
+
|
|
6855
|
+
/**
|
|
6856
|
+
* 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.
|
|
6857
|
+
* @param {Object} elem - The element to check.
|
|
6858
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
6859
|
+
* @returns {void}
|
|
6860
|
+
*/
|
|
6861
|
+
handleComponentTagRename(elem, tagName) {
|
|
6862
|
+
const tag = tagName.toLowerCase();
|
|
6863
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
6864
|
+
|
|
6865
|
+
if (elemTag !== tag) {
|
|
6866
|
+
elem.setAttribute(tag, true);
|
|
6867
|
+
}
|
|
6868
|
+
}
|
|
6869
|
+
|
|
6870
|
+
/**
|
|
6871
|
+
* Validates if an element is a specific Auro component.
|
|
6872
|
+
* @param {Object} elem - The element to validate.
|
|
6873
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
6874
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
6875
|
+
*/
|
|
6876
|
+
elementMatch(elem, tagName) {
|
|
6877
|
+
const tag = tagName.toLowerCase();
|
|
6878
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
5478
6879
|
|
|
5479
|
-
|
|
5480
|
-
<slot></slot>
|
|
5481
|
-
</div>
|
|
5482
|
-
</div>
|
|
5483
|
-
`;
|
|
6880
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
5484
6881
|
}
|
|
5485
6882
|
};
|
|
5486
6883
|
|
|
5487
|
-
var
|
|
5488
|
-
|
|
5489
|
-
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)}`;
|
|
6884
|
+
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)}`;
|
|
5490
6885
|
|
|
5491
6886
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5492
6887
|
// See LICENSE in the project root for license information.
|
|
@@ -5515,7 +6910,7 @@ class AuroHeader extends i$2 {
|
|
|
5515
6910
|
/**
|
|
5516
6911
|
* @private
|
|
5517
6912
|
*/
|
|
5518
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
6913
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$4();
|
|
5519
6914
|
}
|
|
5520
6915
|
|
|
5521
6916
|
// function to define props used within the scope of this component
|
|
@@ -5533,7 +6928,7 @@ class AuroHeader extends i$2 {
|
|
|
5533
6928
|
}
|
|
5534
6929
|
|
|
5535
6930
|
static get styles() {
|
|
5536
|
-
return [styleCss$
|
|
6931
|
+
return [styleCss$5];
|
|
5537
6932
|
}
|
|
5538
6933
|
|
|
5539
6934
|
/**
|
|
@@ -5545,7 +6940,7 @@ class AuroHeader extends i$2 {
|
|
|
5545
6940
|
*
|
|
5546
6941
|
*/
|
|
5547
6942
|
static register(name = "auro-header") {
|
|
5548
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroHeader);
|
|
6943
|
+
AuroLibraryRuntimeUtils$4.prototype.registerComponent(name, AuroHeader);
|
|
5549
6944
|
}
|
|
5550
6945
|
|
|
5551
6946
|
firstUpdated() {
|
|
@@ -5641,17 +7036,30 @@ class AuroBibtemplate extends i$2 {
|
|
|
5641
7036
|
|
|
5642
7037
|
this.large = false;
|
|
5643
7038
|
|
|
5644
|
-
AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-bibtemplate');
|
|
7039
|
+
AuroLibraryRuntimeUtils$3.prototype.handleComponentTagRename(this, 'auro-bibtemplate');
|
|
5645
7040
|
|
|
5646
7041
|
const versioning = new AuroDependencyVersioning();
|
|
7042
|
+
|
|
7043
|
+
/**
|
|
7044
|
+
* @private
|
|
7045
|
+
*/
|
|
5647
7046
|
this.iconTag = versioning.generateTag('auro-formkit-bibtemplate-icon', iconVersion$1, AuroIcon$1);
|
|
7047
|
+
|
|
7048
|
+
/**
|
|
7049
|
+
* @private
|
|
7050
|
+
*/
|
|
5648
7051
|
this.headerTag = versioning.generateTag('auro-formkit-bibtemplate-header', headerVersion, AuroHeader);
|
|
7052
|
+
|
|
7053
|
+
/**
|
|
7054
|
+
* @private
|
|
7055
|
+
*/
|
|
7056
|
+
this.buttonTag = versioning.generateTag('auro-formkit-input-button', buttonVersion, AuroButton);
|
|
5649
7057
|
}
|
|
5650
7058
|
|
|
5651
7059
|
static get styles() {
|
|
5652
7060
|
return [
|
|
5653
|
-
colorCss$
|
|
5654
|
-
styleCss$
|
|
7061
|
+
colorCss$3$1,
|
|
7062
|
+
styleCss$4$1,
|
|
5655
7063
|
tokenCss
|
|
5656
7064
|
];
|
|
5657
7065
|
}
|
|
@@ -5680,7 +7088,7 @@ class AuroBibtemplate extends i$2 {
|
|
|
5680
7088
|
*
|
|
5681
7089
|
*/
|
|
5682
7090
|
static register(name = "auro-bibtemplate") {
|
|
5683
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroBibtemplate);
|
|
7091
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroBibtemplate);
|
|
5684
7092
|
}
|
|
5685
7093
|
|
|
5686
7094
|
/**
|
|
@@ -5720,15 +7128,27 @@ class AuroBibtemplate extends i$2 {
|
|
|
5720
7128
|
this.setAttribute('exportparts', 'bibtemplate:dropdownBibTemplate');
|
|
5721
7129
|
}
|
|
5722
7130
|
|
|
7131
|
+
firstUpdated(changedProperties) {
|
|
7132
|
+
super.firstUpdated(changedProperties);
|
|
7133
|
+
|
|
7134
|
+
this.dispatchEvent(new CustomEvent("auro-bibtemplate-connected", {
|
|
7135
|
+
bubbles: true,
|
|
7136
|
+
composed: true,
|
|
7137
|
+
detail: {
|
|
7138
|
+
element: this
|
|
7139
|
+
}
|
|
7140
|
+
}));
|
|
7141
|
+
}
|
|
7142
|
+
|
|
5723
7143
|
// function that renders the HTML and CSS into the scope of the component
|
|
5724
7144
|
render() {
|
|
5725
7145
|
return u`
|
|
5726
7146
|
<div id="bibTemplate" part="bibtemplate">
|
|
5727
7147
|
${this.isFullscreen ? u`
|
|
5728
7148
|
<div id="headerContainer">
|
|
5729
|
-
|
|
7149
|
+
<${this.buttonTag} id="closeButton" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
5730
7150
|
<${this.iconTag} category="interface" name="x-lg"></${this.iconTag}>
|
|
5731
|
-
|
|
7151
|
+
</${this.buttonTag}>
|
|
5732
7152
|
<${this.headerTag} display="${this.large ? 'display' : '600'}" level="3" size="none" id="header" no-margin-block>
|
|
5733
7153
|
<slot name="header"></slot>
|
|
5734
7154
|
</${this.headerTag}>
|
|
@@ -5737,26 +7157,234 @@ class AuroBibtemplate extends i$2 {
|
|
|
5737
7157
|
</span>
|
|
5738
7158
|
</div>` : null}
|
|
5739
7159
|
|
|
5740
|
-
<div id="bodyContainer">
|
|
5741
|
-
<slot></slot>
|
|
5742
|
-
</div>
|
|
7160
|
+
<div id="bodyContainer">
|
|
7161
|
+
<slot></slot>
|
|
7162
|
+
</div>
|
|
7163
|
+
|
|
7164
|
+
${this.isFullscreen ? u`
|
|
7165
|
+
<div id="footerContainer">
|
|
7166
|
+
<slot name="footer"></slot>
|
|
7167
|
+
</div>` : null}
|
|
7168
|
+
</div>
|
|
7169
|
+
`;
|
|
7170
|
+
}
|
|
7171
|
+
}
|
|
7172
|
+
|
|
7173
|
+
var bibTemplateVersion = '1.0.0';
|
|
7174
|
+
|
|
7175
|
+
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)}`;
|
|
7176
|
+
|
|
7177
|
+
var styleCss$4 = i$5`.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
7178
|
+
|
|
7179
|
+
var tokensCss$2 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
7180
|
+
|
|
7181
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
7182
|
+
// See LICENSE in the project root for license information.
|
|
7183
|
+
|
|
7184
|
+
// ---------------------------------------------------------------------
|
|
7185
|
+
|
|
7186
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
7187
|
+
|
|
7188
|
+
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
7189
|
+
|
|
7190
|
+
/* eslint-disable jsdoc/require-param */
|
|
7191
|
+
|
|
7192
|
+
/**
|
|
7193
|
+
* This will register a new custom element with the browser.
|
|
7194
|
+
* @param {String} name - The name of the custom element.
|
|
7195
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
7196
|
+
* @returns {void}
|
|
7197
|
+
*/
|
|
7198
|
+
registerComponent(name, componentClass) {
|
|
7199
|
+
if (!customElements.get(name)) {
|
|
7200
|
+
customElements.define(name, class extends componentClass {});
|
|
7201
|
+
}
|
|
7202
|
+
}
|
|
7203
|
+
|
|
7204
|
+
/**
|
|
7205
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
7206
|
+
* @returns {void}
|
|
7207
|
+
*/
|
|
7208
|
+
closestElement(
|
|
7209
|
+
selector, // selector like in .closest()
|
|
7210
|
+
base = this, // extra functionality to skip a parent
|
|
7211
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
7212
|
+
!el || el === document || el === window
|
|
7213
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
7214
|
+
: found
|
|
7215
|
+
? found // found a selector INside this element
|
|
7216
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
7217
|
+
) {
|
|
7218
|
+
return __Closest(base);
|
|
7219
|
+
}
|
|
7220
|
+
/* eslint-enable jsdoc/require-param */
|
|
7221
|
+
|
|
7222
|
+
/**
|
|
7223
|
+
* 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.
|
|
7224
|
+
* @param {Object} elem - The element to check.
|
|
7225
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
7226
|
+
* @returns {void}
|
|
7227
|
+
*/
|
|
7228
|
+
handleComponentTagRename(elem, tagName) {
|
|
7229
|
+
const tag = tagName.toLowerCase();
|
|
7230
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
7231
|
+
|
|
7232
|
+
if (elemTag !== tag) {
|
|
7233
|
+
elem.setAttribute(tag, true);
|
|
7234
|
+
}
|
|
7235
|
+
}
|
|
7236
|
+
|
|
7237
|
+
/**
|
|
7238
|
+
* Validates if an element is a specific Auro component.
|
|
7239
|
+
* @param {Object} elem - The element to validate.
|
|
7240
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
7241
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
7242
|
+
*/
|
|
7243
|
+
elementMatch(elem, tagName) {
|
|
7244
|
+
const tag = tagName.toLowerCase();
|
|
7245
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
7246
|
+
|
|
7247
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
7248
|
+
}
|
|
7249
|
+
};
|
|
7250
|
+
|
|
7251
|
+
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7252
|
+
// See LICENSE in the project root for license information.
|
|
7253
|
+
|
|
7254
|
+
|
|
7255
|
+
/**
|
|
7256
|
+
* Displays help text or error messages within form elements - Internal Use Only.
|
|
7257
|
+
*
|
|
7258
|
+
* @attr { Boolean } large - If declared, make font-size to 1rem(16px).
|
|
7259
|
+
*/
|
|
7260
|
+
class AuroHelpText extends i$2 {
|
|
7261
|
+
|
|
7262
|
+
constructor() {
|
|
7263
|
+
super();
|
|
7264
|
+
|
|
7265
|
+
this.error = false;
|
|
7266
|
+
this.onDark = false;
|
|
7267
|
+
this.hasTextContent = false;
|
|
7268
|
+
|
|
7269
|
+
AuroLibraryRuntimeUtils$1.prototype.handleComponentTagRename(this, 'auro-helptext');
|
|
7270
|
+
}
|
|
7271
|
+
|
|
7272
|
+
static get styles() {
|
|
7273
|
+
return [
|
|
7274
|
+
colorCss$3,
|
|
7275
|
+
styleCss$4,
|
|
7276
|
+
tokensCss$2
|
|
7277
|
+
];
|
|
7278
|
+
}
|
|
7279
|
+
|
|
7280
|
+
// function to define props used within the scope of this component
|
|
7281
|
+
static get properties() {
|
|
7282
|
+
return {
|
|
7283
|
+
|
|
7284
|
+
/**
|
|
7285
|
+
* @private
|
|
7286
|
+
*/
|
|
7287
|
+
slotNodes: {
|
|
7288
|
+
type: Boolean,
|
|
7289
|
+
},
|
|
7290
|
+
|
|
7291
|
+
/**
|
|
7292
|
+
* @private
|
|
7293
|
+
*/
|
|
7294
|
+
hasTextContent: {
|
|
7295
|
+
type: Boolean,
|
|
7296
|
+
},
|
|
7297
|
+
|
|
7298
|
+
/**
|
|
7299
|
+
* If declared, make font color red.
|
|
7300
|
+
*/
|
|
7301
|
+
error: {
|
|
7302
|
+
type: Boolean,
|
|
7303
|
+
reflect: true,
|
|
7304
|
+
},
|
|
7305
|
+
|
|
7306
|
+
/**
|
|
7307
|
+
* If declared, will apply onDark styles.
|
|
7308
|
+
*/
|
|
7309
|
+
onDark: {
|
|
7310
|
+
type: Boolean,
|
|
7311
|
+
reflect: true
|
|
7312
|
+
}
|
|
7313
|
+
};
|
|
7314
|
+
}
|
|
7315
|
+
|
|
7316
|
+
/**
|
|
7317
|
+
* This will register this element with the browser.
|
|
7318
|
+
* @param {string} [name="auro-helptext"] - The name of element that you want to register to.
|
|
7319
|
+
*
|
|
7320
|
+
* @example
|
|
7321
|
+
* AuroCheckbox.register("custom-helptext") // this will register this element to <custom-helptext/>
|
|
7322
|
+
*
|
|
7323
|
+
*/
|
|
7324
|
+
static register(name = "auro-helptext") {
|
|
7325
|
+
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroHelpText);
|
|
7326
|
+
}
|
|
7327
|
+
|
|
7328
|
+
updated() {
|
|
7329
|
+
this.handleSlotChange();
|
|
7330
|
+
}
|
|
7331
|
+
|
|
7332
|
+
handleSlotChange(event) {
|
|
7333
|
+
if (event) {
|
|
7334
|
+
this.slotNodes = event.target.assignedNodes();
|
|
7335
|
+
}
|
|
7336
|
+
|
|
7337
|
+
this.hasTextContent = this.checkSlotsForContent(this.slotNodes);
|
|
7338
|
+
}
|
|
7339
|
+
|
|
7340
|
+
/**
|
|
7341
|
+
* Checks if any of the provided nodes or their nested slot nodes contain non-empty text content.
|
|
7342
|
+
*
|
|
7343
|
+
* @param {NodeList|Array} nodes - The list of nodes to check for content.
|
|
7344
|
+
* @returns {boolean} - Returns true if any node or nested slot node contains non-empty text content, otherwise false.
|
|
7345
|
+
* @private
|
|
7346
|
+
*/
|
|
7347
|
+
checkSlotsForContent(nodes) {
|
|
7348
|
+
if (!nodes) {
|
|
7349
|
+
return false;
|
|
7350
|
+
}
|
|
7351
|
+
|
|
7352
|
+
return nodes.some((node) => {
|
|
7353
|
+
if (node.textContent.trim()) {
|
|
7354
|
+
return true;
|
|
7355
|
+
}
|
|
7356
|
+
|
|
7357
|
+
if (!node.querySelector) {
|
|
7358
|
+
return false;
|
|
7359
|
+
}
|
|
7360
|
+
|
|
7361
|
+
const nestedSlot = node.tagName === 'SLOT' ? node : node.querySelector('slot');
|
|
7362
|
+
if (!nestedSlot) {
|
|
7363
|
+
return false;
|
|
7364
|
+
}
|
|
5743
7365
|
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
7366
|
+
const nestedSlotNodes = nestedSlot.assignedNodes();
|
|
7367
|
+
return this.checkSlotsForContent(nestedSlotNodes);
|
|
7368
|
+
});
|
|
7369
|
+
}
|
|
7370
|
+
|
|
7371
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
7372
|
+
render() {
|
|
7373
|
+
return x`
|
|
7374
|
+
<div class="helptext-wrapper" ?visible="${this.hasTextContent}">
|
|
7375
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
5748
7376
|
</div>
|
|
5749
|
-
|
|
7377
|
+
`;
|
|
5750
7378
|
}
|
|
5751
7379
|
}
|
|
5752
7380
|
|
|
5753
|
-
var
|
|
7381
|
+
var helpTextVersion = '1.0.0';
|
|
5754
7382
|
|
|
5755
|
-
i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:
|
|
7383
|
+
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)}`;
|
|
5756
7384
|
|
|
5757
7385
|
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)}`;
|
|
5758
7386
|
|
|
5759
|
-
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)}`;
|
|
7387
|
+
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)}`;
|
|
5760
7388
|
|
|
5761
7389
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5762
7390
|
// See LICENSE in the project root for license information.
|
|
@@ -5803,9 +7431,9 @@ function arrayConverter(value) {
|
|
|
5803
7431
|
throw new Error('Invalid value: Input must be an array or undefined');
|
|
5804
7432
|
}
|
|
5805
7433
|
|
|
5806
|
-
i$5`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-
|
|
7434
|
+
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);margin-bottom:var(--ds-size-50, 0.25rem)}:host .wrapper[class*=-xl]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem);margin-bottom:var(--ds-size-100, 0.5rem)}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
5807
7435
|
|
|
5808
|
-
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)}`;
|
|
7436
|
+
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)}`;
|
|
5809
7437
|
|
|
5810
7438
|
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}`;
|
|
5811
7439
|
|
|
@@ -5813,7 +7441,7 @@ i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);-
|
|
|
5813
7441
|
|
|
5814
7442
|
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)}`;
|
|
5815
7443
|
|
|
5816
|
-
var styleCss$3 = i$5
|
|
7444
|
+
var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}.mainContent{position:relative;display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;align-items:center;justify-content:center}::slotted([slot=typeIcon]){margin-right:8px}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;width:100%;align-items:center;justify-content:center}:host([layout*=emphasized]) .triggerContent,:host([layout*=snowflake]) .triggerContent{padding:0 8px 0 24px}:host([layout*=classic]) .triggerContent{padding:0 8px}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{cursor:text;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host([layout*=classic]) label.withValue{font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([layout*=classic]) .value{height:auto;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
|
|
5817
7445
|
|
|
5818
7446
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5819
7447
|
// See LICENSE in the project root for license information.
|
|
@@ -5828,14 +7456,16 @@ var styleCss$3 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.u
|
|
|
5828
7456
|
* @slot label - Defines the content of the label.
|
|
5829
7457
|
* @slot helpText - Defines the content of the helpText.
|
|
5830
7458
|
* @slot placeholder - Defines the content of the placeholder to be shown when there is no value
|
|
7459
|
+
* @slot valueText - Dropdown value text display.
|
|
7460
|
+
* @slot displayValue - Allows custom HTML content to display the selected value when select is not focused.
|
|
5831
7461
|
* @event auroSelect-valueSet - Notifies that the component has a new value set.
|
|
5832
|
-
* @event input - Notifies every time the value prop of the element is changed.
|
|
7462
|
+
* @event input - Notifies every time the value prop of the element is changed. The updated `value` and `optionSelected` will be delivered in `detail` object.
|
|
5833
7463
|
* @event auroFormElement-validated - Notifies that the `validity` and `errorMessage` values have changed.
|
|
5834
7464
|
* @csspart helpText - Apply CSS to the help text.
|
|
5835
7465
|
*/
|
|
5836
7466
|
|
|
5837
7467
|
// build the component class
|
|
5838
|
-
class AuroSelect extends
|
|
7468
|
+
class AuroSelect extends AuroElement$4 {
|
|
5839
7469
|
constructor() {
|
|
5840
7470
|
super();
|
|
5841
7471
|
|
|
@@ -5845,12 +7475,25 @@ class AuroSelect extends i$2 {
|
|
|
5845
7475
|
const idSubstrEnd = 8;
|
|
5846
7476
|
const idSubstrStart = 2;
|
|
5847
7477
|
|
|
7478
|
+
this.matchWidth = false;
|
|
7479
|
+
|
|
7480
|
+
// Layout Config
|
|
7481
|
+
this.layout = 'snowflake';
|
|
7482
|
+
this.shape = 'snowflake';
|
|
7483
|
+
this.size = 'xl';
|
|
7484
|
+
|
|
5848
7485
|
// floaterConfig
|
|
5849
7486
|
this.placement = 'bottom-start';
|
|
5850
7487
|
this.offset = 0;
|
|
5851
7488
|
this.noFlip = false;
|
|
5852
7489
|
this.autoPlacement = false;
|
|
5853
7490
|
|
|
7491
|
+
this.forceDisplayValue = false;
|
|
7492
|
+
|
|
7493
|
+
this.layout = 'classic';
|
|
7494
|
+
this.shape = 'classic';
|
|
7495
|
+
this.size = 'xl';
|
|
7496
|
+
|
|
5854
7497
|
/**
|
|
5855
7498
|
* @private
|
|
5856
7499
|
*/
|
|
@@ -5866,7 +7509,7 @@ class AuroSelect extends i$2 {
|
|
|
5866
7509
|
/**
|
|
5867
7510
|
* @private
|
|
5868
7511
|
*/
|
|
5869
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
7512
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
5870
7513
|
|
|
5871
7514
|
/**
|
|
5872
7515
|
* Generate unique names for dependency components.
|
|
@@ -5883,10 +7526,25 @@ class AuroSelect extends i$2 {
|
|
|
5883
7526
|
*/
|
|
5884
7527
|
this.bibtemplateTag = versioning.generateTag('auro-formkit-select-bibtemplate', bibTemplateVersion, AuroBibtemplate);
|
|
5885
7528
|
|
|
7529
|
+
/**
|
|
7530
|
+
* @private
|
|
7531
|
+
*/
|
|
7532
|
+
this.helpTextTag = versioning.generateTag('auro-formkit-input-helptext', helpTextVersion, AuroHelpText);
|
|
7533
|
+
|
|
5886
7534
|
/**
|
|
5887
7535
|
* @private
|
|
5888
7536
|
*/
|
|
5889
7537
|
this.isHiddenWhileLoading = false;
|
|
7538
|
+
|
|
7539
|
+
/**
|
|
7540
|
+
* @private
|
|
7541
|
+
*/
|
|
7542
|
+
this.hasFocus = false;
|
|
7543
|
+
|
|
7544
|
+
/**
|
|
7545
|
+
* @private
|
|
7546
|
+
*/
|
|
7547
|
+
this.hasDisplayValueContent = false;
|
|
5890
7548
|
}
|
|
5891
7549
|
|
|
5892
7550
|
/**
|
|
@@ -5900,6 +7558,7 @@ class AuroSelect extends i$2 {
|
|
|
5900
7558
|
this.value = undefined;
|
|
5901
7559
|
this.fullscreenBreakpoint = 'sm';
|
|
5902
7560
|
this.onDark = false;
|
|
7561
|
+
this.isPopoverVisible = false;
|
|
5903
7562
|
}
|
|
5904
7563
|
|
|
5905
7564
|
// This function is to define props used within the scope of this component
|
|
@@ -5916,6 +7575,14 @@ class AuroSelect extends i$2 {
|
|
|
5916
7575
|
reflect: true
|
|
5917
7576
|
},
|
|
5918
7577
|
|
|
7578
|
+
/**
|
|
7579
|
+
* If declared, the label and value will be visually hidden and the displayValue will render 100% of the time.
|
|
7580
|
+
*/
|
|
7581
|
+
forceDisplayValue: {
|
|
7582
|
+
type: Boolean,
|
|
7583
|
+
reflect: true
|
|
7584
|
+
},
|
|
7585
|
+
|
|
5919
7586
|
/**
|
|
5920
7587
|
* If declared, bib's position will be automatically calculated where to appear.
|
|
5921
7588
|
* @default false
|
|
@@ -5934,21 +7601,29 @@ class AuroSelect extends i$2 {
|
|
|
5934
7601
|
},
|
|
5935
7602
|
|
|
5936
7603
|
/**
|
|
5937
|
-
*
|
|
7604
|
+
* @private
|
|
5938
7605
|
*/
|
|
5939
|
-
|
|
5940
|
-
type:
|
|
5941
|
-
reflect:
|
|
7606
|
+
isPopoverVisible: {
|
|
7607
|
+
type: Boolean,
|
|
7608
|
+
reflect: false
|
|
5942
7609
|
},
|
|
5943
7610
|
|
|
5944
7611
|
/**
|
|
5945
|
-
* If
|
|
7612
|
+
* If declared, the popover and trigger will be set to the same width.
|
|
5946
7613
|
*/
|
|
5947
|
-
|
|
7614
|
+
matchWidth: {
|
|
5948
7615
|
type: Boolean,
|
|
5949
7616
|
reflect: true
|
|
5950
7617
|
},
|
|
5951
7618
|
|
|
7619
|
+
/**
|
|
7620
|
+
* The name for the select element.
|
|
7621
|
+
*/
|
|
7622
|
+
name: {
|
|
7623
|
+
type: String,
|
|
7624
|
+
reflect: true
|
|
7625
|
+
},
|
|
7626
|
+
|
|
5952
7627
|
/**
|
|
5953
7628
|
* Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
|
|
5954
7629
|
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
@@ -6042,7 +7717,7 @@ class AuroSelect extends i$2 {
|
|
|
6042
7717
|
* "top" | "right" | "bottom" | "left" |
|
|
6043
7718
|
* "bottom-start" | "top-start" | "top-end" |
|
|
6044
7719
|
* "right-start" | "right-end" | "bottom-end" |
|
|
6045
|
-
* "left-start" | "left-end"
|
|
7720
|
+
* "left-start" | "left-end".
|
|
6046
7721
|
* @default bottom-start
|
|
6047
7722
|
*/
|
|
6048
7723
|
placement: {
|
|
@@ -6122,12 +7797,58 @@ class AuroSelect extends i$2 {
|
|
|
6122
7797
|
type: Boolean,
|
|
6123
7798
|
reflect: true,
|
|
6124
7799
|
attribute: false
|
|
6125
|
-
}
|
|
7800
|
+
},
|
|
7801
|
+
|
|
7802
|
+
/**
|
|
7803
|
+
* @private
|
|
7804
|
+
*/
|
|
7805
|
+
hasFocus: {
|
|
7806
|
+
type: Boolean,
|
|
7807
|
+
reflect: false,
|
|
7808
|
+
attribute: false
|
|
7809
|
+
},
|
|
7810
|
+
|
|
7811
|
+
/**
|
|
7812
|
+
* @private
|
|
7813
|
+
*/
|
|
7814
|
+
hasDisplayValueContent: {
|
|
7815
|
+
type: Boolean,
|
|
7816
|
+
reflect: false,
|
|
7817
|
+
attribute: false
|
|
7818
|
+
},
|
|
6126
7819
|
};
|
|
6127
7820
|
}
|
|
6128
7821
|
|
|
6129
7822
|
static get styles() {
|
|
6130
|
-
return [
|
|
7823
|
+
return [
|
|
7824
|
+
i$5`${shapeSizeCss$1}`,
|
|
7825
|
+
i$5`${tokensCss$5}`,
|
|
7826
|
+
i$5`${styleCss$3}`,
|
|
7827
|
+
];
|
|
7828
|
+
}
|
|
7829
|
+
|
|
7830
|
+
/**
|
|
7831
|
+
* Returns classmap configuration for html5 input labels in all layouts.
|
|
7832
|
+
* @private
|
|
7833
|
+
* @returns {void}
|
|
7834
|
+
*/
|
|
7835
|
+
get commonLabelClasses() {
|
|
7836
|
+
return {
|
|
7837
|
+
'is-disabled': this.disabled,
|
|
7838
|
+
'withValue': this.value && this.value.length > 0,
|
|
7839
|
+
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
7840
|
+
};
|
|
7841
|
+
}
|
|
7842
|
+
|
|
7843
|
+
/**
|
|
7844
|
+
* Returns classmap configuration for wrapper elements in each layout.
|
|
7845
|
+
* @private
|
|
7846
|
+
* @returns {object} - Returns classmap.
|
|
7847
|
+
*/
|
|
7848
|
+
get commonWrapperClasses() {
|
|
7849
|
+
return {
|
|
7850
|
+
'wrapper': true
|
|
7851
|
+
};
|
|
6131
7852
|
}
|
|
6132
7853
|
|
|
6133
7854
|
/**
|
|
@@ -6137,11 +7858,13 @@ class AuroSelect extends i$2 {
|
|
|
6137
7858
|
*/
|
|
6138
7859
|
configureDropdown() {
|
|
6139
7860
|
this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
|
|
6140
|
-
|
|
7861
|
+
|
|
7862
|
+
this.dropdown.addEventListener('auroDropdown-toggled', () => {
|
|
7863
|
+
this.isPopoverVisible = this.dropdown.isPopoverVisible;
|
|
7864
|
+
});
|
|
6141
7865
|
|
|
6142
7866
|
// setting up bibtemplate
|
|
6143
|
-
this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
|
|
6144
|
-
this.bibtemplate.append(this.menuWrapper);
|
|
7867
|
+
this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
|
|
6145
7868
|
|
|
6146
7869
|
if (this.customBibWidth) {
|
|
6147
7870
|
this.dropdown.dropdownWidth = this.customBibWidth;
|
|
@@ -6160,7 +7883,7 @@ class AuroSelect extends i$2 {
|
|
|
6160
7883
|
*
|
|
6161
7884
|
*/
|
|
6162
7885
|
static register(name = "auro-select") {
|
|
6163
|
-
AuroLibraryRuntimeUtils$
|
|
7886
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroSelect);
|
|
6164
7887
|
}
|
|
6165
7888
|
|
|
6166
7889
|
/**
|
|
@@ -6171,27 +7894,34 @@ class AuroSelect extends i$2 {
|
|
|
6171
7894
|
updateDisplayedValue() {
|
|
6172
7895
|
const triggerContentEl = this.dropdown.querySelector('#triggerFocus');
|
|
6173
7896
|
|
|
6174
|
-
// Clear
|
|
6175
|
-
const
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
triggerContentEl.appendChild(placeholder);
|
|
7897
|
+
// Clear out old value
|
|
7898
|
+
const valueElem = triggerContentEl.querySelector('#value');
|
|
7899
|
+
if (valueElem) {
|
|
7900
|
+
valueElem.innerHTML = '';
|
|
6179
7901
|
}
|
|
6180
7902
|
|
|
7903
|
+
const slot = this.shadowRoot.querySelector('slot[name="displayValue"]');
|
|
7904
|
+
const slottedElements = slot.assignedElements();
|
|
7905
|
+
|
|
7906
|
+
slottedElements.forEach((element) => {
|
|
7907
|
+
element.remove();
|
|
7908
|
+
});
|
|
7909
|
+
|
|
6181
7910
|
// Handle selected options
|
|
6182
7911
|
if (this.optionSelected) {
|
|
6183
|
-
let displayText = '';
|
|
6184
|
-
|
|
6185
7912
|
if (this.multiSelect && this.optionSelected.length > 0) {
|
|
6186
|
-
|
|
6187
|
-
|
|
7913
|
+
const displayText = this.optionSelected.map((option) => option.textContent).join(', ');
|
|
7914
|
+
|
|
7915
|
+
valueElem.textContent = displayText;
|
|
6188
7916
|
} else {
|
|
6189
|
-
|
|
6190
|
-
|
|
7917
|
+
valueElem.innerHTML = this.optionSelected.innerHTML;
|
|
7918
|
+
const displayValueEl = this.optionSelected.querySelector("[slot='displayValue']");
|
|
6191
7919
|
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
7920
|
+
if (displayValueEl) {
|
|
7921
|
+
this.appendChild(displayValueEl.cloneNode(true));
|
|
7922
|
+
}
|
|
7923
|
+
this.hasDisplayValueContent = displayValueEl !== null;
|
|
7924
|
+
}
|
|
6195
7925
|
}
|
|
6196
7926
|
|
|
6197
7927
|
this.dropdown.requestUpdate();
|
|
@@ -6213,6 +7943,15 @@ class AuroSelect extends i$2 {
|
|
|
6213
7943
|
return;
|
|
6214
7944
|
}
|
|
6215
7945
|
|
|
7946
|
+
// set menu's default size if there it's not specified.
|
|
7947
|
+
if (!this.menu.getAttribute('size')) {
|
|
7948
|
+
this.menu.setAttribute('size', this.layout !== 'emphasized' ? 'md' : this.size);
|
|
7949
|
+
}
|
|
7950
|
+
|
|
7951
|
+
if (!this.getAttribute('shape')) {
|
|
7952
|
+
this.menu.setAttribute('shape', this.layout === 'classic' ? 'box' : this.shape);
|
|
7953
|
+
}
|
|
7954
|
+
|
|
6216
7955
|
if (this.multiSelect) {
|
|
6217
7956
|
this.menu.multiSelect = this.multiSelect;
|
|
6218
7957
|
}
|
|
@@ -6270,8 +8009,6 @@ class AuroSelect extends i$2 {
|
|
|
6270
8009
|
* @returns {void}
|
|
6271
8010
|
*/
|
|
6272
8011
|
configureSelect() {
|
|
6273
|
-
// inject menu into menuWrapper
|
|
6274
|
-
this.menuWrapper.append(this.menu);
|
|
6275
8012
|
|
|
6276
8013
|
this.addEventListener('keydown', (evt) => {
|
|
6277
8014
|
if (evt.key === 'ArrowUp') {
|
|
@@ -6325,6 +8062,7 @@ class AuroSelect extends i$2 {
|
|
|
6325
8062
|
|
|
6326
8063
|
this.addEventListener('blur', () => {
|
|
6327
8064
|
this.validation.validate(this);
|
|
8065
|
+
this.hasFocus = false;
|
|
6328
8066
|
});
|
|
6329
8067
|
}
|
|
6330
8068
|
|
|
@@ -6400,6 +8138,7 @@ class AuroSelect extends i$2 {
|
|
|
6400
8138
|
*/
|
|
6401
8139
|
handleFocusin() {
|
|
6402
8140
|
|
|
8141
|
+
this.hasFocus = true;
|
|
6403
8142
|
this.touched = true;
|
|
6404
8143
|
}
|
|
6405
8144
|
|
|
@@ -6476,17 +8215,32 @@ class AuroSelect extends i$2 {
|
|
|
6476
8215
|
// Add the tag name as an attribute if it is different than the component name
|
|
6477
8216
|
this.runtimeUtils.handleComponentTagRename(this, 'auro-select');
|
|
6478
8217
|
|
|
6479
|
-
this.configureMenu();
|
|
6480
8218
|
this.configureDropdown();
|
|
8219
|
+
this.configureMenu();
|
|
6481
8220
|
this.configureSelect();
|
|
6482
8221
|
|
|
6483
8222
|
// Set the initial value in auro-menu if defined
|
|
6484
8223
|
if (this.hasAttribute('value') && this.getAttribute('value').length > 0) {
|
|
6485
8224
|
this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
|
|
6486
|
-
this.menu
|
|
8225
|
+
if (this.menu) {
|
|
8226
|
+
this.menu.value = this.value;
|
|
8227
|
+
}
|
|
6487
8228
|
}
|
|
6488
8229
|
}
|
|
6489
8230
|
|
|
8231
|
+
/**
|
|
8232
|
+
* Update the menu value. With checks for menu existence. Awaits value update.
|
|
8233
|
+
* @param {string} value - The value to set in the menu.
|
|
8234
|
+
* @returns void
|
|
8235
|
+
* @private
|
|
8236
|
+
*/
|
|
8237
|
+
async updateMenuValue(value) {
|
|
8238
|
+
if (!this.menu) return;
|
|
8239
|
+
|
|
8240
|
+
this.menu.value = value;
|
|
8241
|
+
await this.menu.updateComplete;
|
|
8242
|
+
}
|
|
8243
|
+
|
|
6490
8244
|
async updated(changedProperties) {
|
|
6491
8245
|
if (changedProperties.has('multiSelect')) {
|
|
6492
8246
|
this.clearSelection();
|
|
@@ -6496,14 +8250,13 @@ class AuroSelect extends i$2 {
|
|
|
6496
8250
|
if (this.value) {
|
|
6497
8251
|
this.value = this.multiSelect ? arrayConverter(this.value) : this.value;
|
|
6498
8252
|
|
|
6499
|
-
this.
|
|
6500
|
-
|
|
6501
|
-
// Wait for menu to finish updating its value
|
|
6502
|
-
await this.menu.updateComplete;
|
|
8253
|
+
await this.updateMenuValue(this.value);
|
|
6503
8254
|
|
|
6504
|
-
|
|
8255
|
+
if (this.menu) {
|
|
8256
|
+
this.optionSelected = this.menu.optionSelected;
|
|
8257
|
+
}
|
|
6505
8258
|
} else {
|
|
6506
|
-
this.
|
|
8259
|
+
await this.updateMenuValue(undefined);
|
|
6507
8260
|
}
|
|
6508
8261
|
|
|
6509
8262
|
this._updateNativeSelect();
|
|
@@ -6520,6 +8273,10 @@ class AuroSelect extends i$2 {
|
|
|
6520
8273
|
bubbles: true,
|
|
6521
8274
|
cancelable: true,
|
|
6522
8275
|
composed: true,
|
|
8276
|
+
detail: {
|
|
8277
|
+
optionSelected: this.optionSelected,
|
|
8278
|
+
value: this.value
|
|
8279
|
+
}
|
|
6523
8280
|
}));
|
|
6524
8281
|
}
|
|
6525
8282
|
|
|
@@ -6530,6 +8287,14 @@ class AuroSelect extends i$2 {
|
|
|
6530
8287
|
if (changedProperties.has('error')) {
|
|
6531
8288
|
this.validate(true);
|
|
6532
8289
|
}
|
|
8290
|
+
|
|
8291
|
+
if (changedProperties.has('shape') && this.menu) {
|
|
8292
|
+
this.menu.setAttribute('shape', this.layout === 'classic' ? 'box' : this.shape);
|
|
8293
|
+
}
|
|
8294
|
+
|
|
8295
|
+
if (changedProperties.has('size') && this.menu) {
|
|
8296
|
+
this.menu.setAttribute('size', this.layout !== 'emphasized' ? 'md' : this.size);
|
|
8297
|
+
}
|
|
6533
8298
|
}
|
|
6534
8299
|
|
|
6535
8300
|
/**
|
|
@@ -6554,53 +8319,397 @@ class AuroSelect extends i$2 {
|
|
|
6554
8319
|
* Validates value.
|
|
6555
8320
|
* @param {boolean} [force=false] - Whether to force validation.
|
|
6556
8321
|
*/
|
|
6557
|
-
validate(force = false) {
|
|
6558
|
-
this.validation.validate(this, force);
|
|
8322
|
+
validate(force = false) {
|
|
8323
|
+
this.validation.validate(this, force);
|
|
8324
|
+
}
|
|
8325
|
+
|
|
8326
|
+
/**
|
|
8327
|
+
* Syncs the value from the native select element to the component's value.
|
|
8328
|
+
* @param {Event} event // The change event from the native select element.
|
|
8329
|
+
* @returns {void}
|
|
8330
|
+
* @private
|
|
8331
|
+
*/
|
|
8332
|
+
_handleNativeSelectChange(event) {
|
|
8333
|
+
const selectedOption = event.target.options[event.target.selectedIndex];
|
|
8334
|
+
const selectedValue = selectedOption.value;
|
|
8335
|
+
|
|
8336
|
+
if (this.multiSelect) {
|
|
8337
|
+
const currentArray = Array.isArray(this.value) ? this.value : [];
|
|
8338
|
+
|
|
8339
|
+
if (!currentArray.includes(selectedValue)) {
|
|
8340
|
+
this.value = [
|
|
8341
|
+
...currentArray,
|
|
8342
|
+
selectedValue
|
|
8343
|
+
];
|
|
8344
|
+
}
|
|
8345
|
+
} else {
|
|
8346
|
+
const currentValue = this.value;
|
|
8347
|
+
|
|
8348
|
+
if (currentValue !== selectedValue) {
|
|
8349
|
+
this.value = selectedValue;
|
|
8350
|
+
}
|
|
8351
|
+
}
|
|
8352
|
+
}
|
|
8353
|
+
|
|
8354
|
+
/**
|
|
8355
|
+
* Updates the native select element's value based on the component's value.
|
|
8356
|
+
* @returns {void}
|
|
8357
|
+
* @private
|
|
8358
|
+
*/
|
|
8359
|
+
_updateNativeSelect() {
|
|
8360
|
+
const nativeSelect = this.shadowRoot.querySelector('select');
|
|
8361
|
+
if (!nativeSelect) {
|
|
8362
|
+
return;
|
|
8363
|
+
}
|
|
8364
|
+
|
|
8365
|
+
if (this.multiSelect) {
|
|
8366
|
+
nativeSelect.value = this.value ? this.value[0] : '';
|
|
8367
|
+
} else {
|
|
8368
|
+
nativeSelect.value = this.value || '';
|
|
8369
|
+
}
|
|
8370
|
+
}
|
|
8371
|
+
|
|
8372
|
+
renderAriaHtml() {
|
|
8373
|
+
return u`
|
|
8374
|
+
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
8375
|
+
${this.optionActive && this.options.length > 0
|
|
8376
|
+
? u`
|
|
8377
|
+
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
8378
|
+
`
|
|
8379
|
+
: undefined
|
|
8380
|
+
};
|
|
8381
|
+
|
|
8382
|
+
${this.optionSelected && this.options.length > 0
|
|
8383
|
+
? u`
|
|
8384
|
+
${`${this.optionSelected.innerText} selected`}
|
|
8385
|
+
`
|
|
8386
|
+
: undefined
|
|
8387
|
+
};
|
|
8388
|
+
</div>
|
|
8389
|
+
`;
|
|
8390
|
+
}
|
|
8391
|
+
|
|
8392
|
+
renderNativeSelect() {
|
|
8393
|
+
return u`
|
|
8394
|
+
<div class="nativeSelectWrapper util_displayHidden">
|
|
8395
|
+
<select
|
|
8396
|
+
tabindex="-1"
|
|
8397
|
+
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
8398
|
+
name="${this.name || ''}"
|
|
8399
|
+
?disabled="${this.disabled}"
|
|
8400
|
+
?required="${this.required}"
|
|
8401
|
+
aria-hidden="true"
|
|
8402
|
+
autocomplete="${o(this.autocomplete)}"
|
|
8403
|
+
@change="${this._handleNativeSelectChange}">
|
|
8404
|
+
<option value="" ?selected="${!this.value}"></option>
|
|
8405
|
+
${this.options.map((option) => {
|
|
8406
|
+
const optionValue = option.value || option.textContent;
|
|
8407
|
+
return u`
|
|
8408
|
+
<option
|
|
8409
|
+
value="${optionValue}"
|
|
8410
|
+
?selected="${this.value === optionValue}">
|
|
8411
|
+
${option.textContent}
|
|
8412
|
+
</option>
|
|
8413
|
+
`;
|
|
8414
|
+
})}
|
|
8415
|
+
</select>
|
|
8416
|
+
</div>
|
|
8417
|
+
`;
|
|
8418
|
+
}
|
|
8419
|
+
|
|
8420
|
+
/**
|
|
8421
|
+
* Returns HTML for the help text and error message.
|
|
8422
|
+
* @private
|
|
8423
|
+
* @returns {html} - Returns HTML for the help text and error message.
|
|
8424
|
+
*/
|
|
8425
|
+
renderHtmlHelpText() {
|
|
8426
|
+
return u`
|
|
8427
|
+
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
8428
|
+
? u`
|
|
8429
|
+
<${this.helpTextTag} ?onDark="${this.onDark}">
|
|
8430
|
+
<p id="${this.uniqueId}" part="helpText">
|
|
8431
|
+
<slot name="helptext"></slot>
|
|
8432
|
+
</p>
|
|
8433
|
+
</${this.helpTextTag}>
|
|
8434
|
+
`
|
|
8435
|
+
: u`
|
|
8436
|
+
<${this.helpTextTag} error ?onDark="${this.onDark}">
|
|
8437
|
+
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
8438
|
+
ERROR MESSAGE ${this.errorMessage}
|
|
8439
|
+
</p>
|
|
8440
|
+
</${this.helpTextTag}>
|
|
8441
|
+
`
|
|
8442
|
+
}
|
|
8443
|
+
`;
|
|
8444
|
+
}
|
|
8445
|
+
|
|
8446
|
+
/**
|
|
8447
|
+
* Returns HTML for the emphasized layout.
|
|
8448
|
+
* @private
|
|
8449
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the emphasized layout.
|
|
8450
|
+
*/
|
|
8451
|
+
renderLayoutEmphasized() {
|
|
8452
|
+
const placeholderClass = {
|
|
8453
|
+
hidden: this.value,
|
|
8454
|
+
};
|
|
8455
|
+
|
|
8456
|
+
const displayValueClasses = {
|
|
8457
|
+
'displayValue': true,
|
|
8458
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8459
|
+
'hasFocus': this.isPopoverVisible,
|
|
8460
|
+
'withValue': this.value && this.value.length > 0,
|
|
8461
|
+
'force': this.forceDisplayValue,
|
|
8462
|
+
};
|
|
8463
|
+
|
|
8464
|
+
const valueContainerClasses = {
|
|
8465
|
+
'valueContainer': true,
|
|
8466
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
8467
|
+
};
|
|
8468
|
+
|
|
8469
|
+
return u`
|
|
8470
|
+
<div
|
|
8471
|
+
class="${e(this.commonWrapperClasses)}"
|
|
8472
|
+
part="wrapper">
|
|
8473
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8474
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8475
|
+
</div>
|
|
8476
|
+
<${this.dropdownTag}
|
|
8477
|
+
a11yRole="select"
|
|
8478
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8479
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8480
|
+
?matchWidth="${this.matchWidth}"
|
|
8481
|
+
?noFlip="${this.noFlip}"
|
|
8482
|
+
?onDark="${this.onDark}"
|
|
8483
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8484
|
+
.offset="${this.offset}"
|
|
8485
|
+
.placement="${this.placement}"
|
|
8486
|
+
chevron
|
|
8487
|
+
fluid
|
|
8488
|
+
for="selectMenu"
|
|
8489
|
+
layout="${this.layout}"
|
|
8490
|
+
part="dropdown"
|
|
8491
|
+
shape="${this.shape}"
|
|
8492
|
+
size="${this.size}">
|
|
8493
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8494
|
+
<div class="accents left">
|
|
8495
|
+
<slot name="typeIcon"></slot>
|
|
8496
|
+
</div>
|
|
8497
|
+
<div class="mainContent">
|
|
8498
|
+
<div class="${e(valueContainerClasses)}">
|
|
8499
|
+
<label class="${e(this.commonLabelClasses)}">
|
|
8500
|
+
<slot name="label"></slot>
|
|
8501
|
+
</label>
|
|
8502
|
+
<div class="value" id="value"></div>
|
|
8503
|
+
${this.value ? undefined : u`
|
|
8504
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8505
|
+
<slot name="placeholder"></slot>
|
|
8506
|
+
</div>
|
|
8507
|
+
`}
|
|
8508
|
+
</div>
|
|
8509
|
+
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8510
|
+
<slot name="displayValue"></slot>
|
|
8511
|
+
</div>
|
|
8512
|
+
</div>
|
|
8513
|
+
<div class="accents right"></div>
|
|
8514
|
+
</div>
|
|
8515
|
+
<div class="menuWrapper"></div>
|
|
8516
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8517
|
+
<slot></slot>
|
|
8518
|
+
</${this.bibtemplateTag}>
|
|
8519
|
+
<div slot="helpText">
|
|
8520
|
+
${this.renderHtmlHelpText()}
|
|
8521
|
+
</div>
|
|
8522
|
+
</${this.dropdownTag}>
|
|
8523
|
+
</div>
|
|
8524
|
+
`;
|
|
8525
|
+
}
|
|
8526
|
+
|
|
8527
|
+
/**
|
|
8528
|
+
* Returns HTML for the snowflake layout.
|
|
8529
|
+
* @private
|
|
8530
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the snowflake layout.
|
|
8531
|
+
*/
|
|
8532
|
+
renderLayoutSnowflake() {
|
|
8533
|
+
const placeholderClass = {
|
|
8534
|
+
hidden: this.value,
|
|
8535
|
+
};
|
|
8536
|
+
|
|
8537
|
+
const displayValueClasses = {
|
|
8538
|
+
'displayValue': true,
|
|
8539
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8540
|
+
'hasFocus': this.isPopoverVisible,
|
|
8541
|
+
'withValue': this.value && this.value.length > 0,
|
|
8542
|
+
'force': this.forceDisplayValue,
|
|
8543
|
+
};
|
|
8544
|
+
|
|
8545
|
+
const valueContainerClasses = {
|
|
8546
|
+
'valueContainer': true,
|
|
8547
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
8548
|
+
};
|
|
8549
|
+
|
|
8550
|
+
return u`
|
|
8551
|
+
<div
|
|
8552
|
+
class="${e(this.commonWrapperClasses)}"
|
|
8553
|
+
part="wrapper">
|
|
8554
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8555
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8556
|
+
</div>
|
|
8557
|
+
<${this.dropdownTag}
|
|
8558
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8559
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8560
|
+
?matchWidth="${this.matchWidth}"
|
|
8561
|
+
?noFlip="${this.noFlip}"
|
|
8562
|
+
?onDark="${this.onDark}"
|
|
8563
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8564
|
+
.offset="${this.offset}"
|
|
8565
|
+
.placement="${this.placement}"
|
|
8566
|
+
chevron
|
|
8567
|
+
fluid
|
|
8568
|
+
for="selectMenu"
|
|
8569
|
+
layout="${this.layout}"
|
|
8570
|
+
part="dropdown"
|
|
8571
|
+
shape="${this.shape}"
|
|
8572
|
+
size="${this.size}">
|
|
8573
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8574
|
+
<div class="accents left">
|
|
8575
|
+
<slot name="typeIcon"></slot>
|
|
8576
|
+
</div>
|
|
8577
|
+
<div class="mainContent">
|
|
8578
|
+
<div class="${e(valueContainerClasses)}">
|
|
8579
|
+
<label class="${e(this.commonLabelClasses)}">
|
|
8580
|
+
<slot name="label"></slot>
|
|
8581
|
+
</label>
|
|
8582
|
+
<div class="value" id="value"></div>
|
|
8583
|
+
${this.value ? undefined : u`
|
|
8584
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8585
|
+
<slot name="placeholder"></slot>
|
|
8586
|
+
</div>
|
|
8587
|
+
`}
|
|
8588
|
+
</div>
|
|
8589
|
+
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8590
|
+
<slot name="displayValue"></slot>
|
|
8591
|
+
</div>
|
|
8592
|
+
</div>
|
|
8593
|
+
<div class="accents right"></div>
|
|
8594
|
+
</div>
|
|
8595
|
+
<div class="menuWrapper"></div>
|
|
8596
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8597
|
+
<slot></slot>
|
|
8598
|
+
</${this.bibtemplateTag}>
|
|
8599
|
+
<div slot="helpText">
|
|
8600
|
+
${this.renderHtmlHelpText()}
|
|
8601
|
+
</div>
|
|
8602
|
+
</${this.dropdownTag}>
|
|
8603
|
+
${this.renderNativeSelect()}
|
|
8604
|
+
</div>
|
|
8605
|
+
`;
|
|
6559
8606
|
}
|
|
6560
8607
|
|
|
6561
8608
|
/**
|
|
6562
|
-
*
|
|
6563
|
-
* @param {Event} event // The change event from the native select element.
|
|
6564
|
-
* @returns {void}
|
|
8609
|
+
* Returns HTML for the classic layout.
|
|
6565
8610
|
* @private
|
|
8611
|
+
* @returns {import("lit").TemplateResult} - Returns HTML for the classic layout.
|
|
6566
8612
|
*/
|
|
6567
|
-
|
|
6568
|
-
const
|
|
6569
|
-
|
|
8613
|
+
renderLayoutClassic() {
|
|
8614
|
+
const placeholderClass = {
|
|
8615
|
+
hidden: this.value,
|
|
8616
|
+
};
|
|
6570
8617
|
|
|
6571
|
-
|
|
6572
|
-
|
|
8618
|
+
const displayValueClasses = {
|
|
8619
|
+
'displayValue': true,
|
|
8620
|
+
'hasContent': this.hasDisplayValueContent,
|
|
8621
|
+
'hasFocus': this.isPopoverVisible,
|
|
8622
|
+
'withValue': this.value && this.value.length > 0,
|
|
8623
|
+
'force': this.forceDisplayValue,
|
|
8624
|
+
};
|
|
6573
8625
|
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
];
|
|
6579
|
-
}
|
|
6580
|
-
} else {
|
|
6581
|
-
const currentValue = this.value;
|
|
8626
|
+
const valueContainerClasses = {
|
|
8627
|
+
'valueContainer': true,
|
|
8628
|
+
'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
|
|
8629
|
+
};
|
|
6582
8630
|
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
8631
|
+
return u`
|
|
8632
|
+
<div
|
|
8633
|
+
class="${e(this.commonWrapperClasses)}"
|
|
8634
|
+
part="wrapper">
|
|
8635
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8636
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8637
|
+
</div>
|
|
8638
|
+
<${this.dropdownTag}
|
|
8639
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8640
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8641
|
+
?matchWidth="${!this.flexMenuWidth}"
|
|
8642
|
+
?noFlip="${this.noFlip}"
|
|
8643
|
+
?onDark="${this.onDark}"
|
|
8644
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8645
|
+
.offset="${this.offset}"
|
|
8646
|
+
.placement="${this.placement}"
|
|
8647
|
+
chevron
|
|
8648
|
+
fluid
|
|
8649
|
+
for="selectMenu"
|
|
8650
|
+
layout="${this.layout}"
|
|
8651
|
+
part="dropdown"
|
|
8652
|
+
shape="${this.shape}"
|
|
8653
|
+
size="${this.size}">
|
|
8654
|
+
<div slot="trigger" aria-haspopup="true" id="triggerFocus" class="triggerContent">
|
|
8655
|
+
<div class="accents left">
|
|
8656
|
+
<slot name="typeIcon"></slot>
|
|
8657
|
+
</div>
|
|
8658
|
+
<div class="mainContent">
|
|
8659
|
+
<div class="${e(valueContainerClasses)}">
|
|
8660
|
+
<label class="${e(this.commonLabelClasses)}">
|
|
8661
|
+
<slot name="label"></slot>
|
|
8662
|
+
</label>
|
|
8663
|
+
<div class="value" id="value"></div>
|
|
8664
|
+
${this.value ? undefined : u`
|
|
8665
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8666
|
+
<slot name="placeholder"></slot>
|
|
8667
|
+
</div>
|
|
8668
|
+
`}
|
|
8669
|
+
</div>
|
|
8670
|
+
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8671
|
+
<slot name="displayValue"></slot>
|
|
8672
|
+
</div>
|
|
8673
|
+
</div>
|
|
8674
|
+
<div class="accents right"></div>
|
|
8675
|
+
</div>
|
|
8676
|
+
<div class="menuWrapper"></div>
|
|
8677
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8678
|
+
<slot></slot>
|
|
8679
|
+
</${this.bibtemplateTag}>
|
|
8680
|
+
<div slot="helpText">
|
|
8681
|
+
${this.renderHtmlHelpText()}
|
|
8682
|
+
</div>
|
|
8683
|
+
</${this.dropdownTag}>
|
|
8684
|
+
${this.renderNativeSelect()}
|
|
8685
|
+
</div>
|
|
8686
|
+
`;
|
|
6587
8687
|
}
|
|
6588
8688
|
|
|
6589
8689
|
/**
|
|
6590
|
-
*
|
|
6591
|
-
* @returns {void}
|
|
8690
|
+
* Logic to determine the layout of the component.
|
|
6592
8691
|
* @private
|
|
8692
|
+
* @param {string} [ForcedLayout] - Used to force a specific layout, pass in the layout name to use.
|
|
8693
|
+
* @returns {void}
|
|
6593
8694
|
*/
|
|
6594
|
-
|
|
6595
|
-
const
|
|
6596
|
-
if (!nativeSelect) {
|
|
6597
|
-
return;
|
|
6598
|
-
}
|
|
8695
|
+
renderLayout(ForcedLayout) {
|
|
8696
|
+
const layout = ForcedLayout || this.layout;
|
|
6599
8697
|
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
8698
|
+
switch (layout) {
|
|
8699
|
+
case 'emphasized':
|
|
8700
|
+
return this.renderLayoutEmphasized();
|
|
8701
|
+
case 'emphasized-left':
|
|
8702
|
+
return this.renderLayoutEmphasized();
|
|
8703
|
+
case 'emphasized-right':
|
|
8704
|
+
return this.renderLayoutEmphasized();
|
|
8705
|
+
case 'snowflake':
|
|
8706
|
+
return this.renderLayoutSnowflake();
|
|
8707
|
+
case 'snowflake-left':
|
|
8708
|
+
return this.renderLayoutSnowflake();
|
|
8709
|
+
case 'snowflake-right':
|
|
8710
|
+
return this.renderLayoutSnowflake();
|
|
8711
|
+
default:
|
|
8712
|
+
return this.renderLayoutClassic();
|
|
6604
8713
|
}
|
|
6605
8714
|
}
|
|
6606
8715
|
|
|
@@ -6608,7 +8717,7 @@ class AuroSelect extends i$2 {
|
|
|
6608
8717
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
6609
8718
|
|
|
6610
8719
|
// function that renders the HTML and CSS into the scope of the component
|
|
6611
|
-
|
|
8720
|
+
renderBACKUP() {
|
|
6612
8721
|
const placeholderClass = {
|
|
6613
8722
|
hidden: this.value,
|
|
6614
8723
|
};
|
|
@@ -6634,27 +8743,34 @@ class AuroSelect extends i$2 {
|
|
|
6634
8743
|
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
6635
8744
|
</div>
|
|
6636
8745
|
<${this.dropdownTag}
|
|
6637
|
-
|
|
8746
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8747
|
+
?disabled="${this.disabled}"
|
|
6638
8748
|
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8749
|
+
?matchWidth="${this.matchWidth}"
|
|
8750
|
+
?noFlip="${this.noFlip}"
|
|
6639
8751
|
?onDark="${this.onDark}"
|
|
6640
|
-
common
|
|
6641
|
-
fluid
|
|
6642
8752
|
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
6643
|
-
?matchWidth="${!this.flexMenuWidth}"
|
|
6644
|
-
chevron
|
|
6645
|
-
.placement="${this.placement}"
|
|
6646
8753
|
.offset="${this.offset}"
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
8754
|
+
.placement="${this.placement}"
|
|
8755
|
+
chevron
|
|
8756
|
+
fluid
|
|
8757
|
+
for="selectMenu"
|
|
8758
|
+
layout="${this.layout}"
|
|
8759
|
+
part="dropdown"
|
|
8760
|
+
shape="${this.shape}"
|
|
8761
|
+
size="${this.size}">
|
|
6650
8762
|
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
6651
|
-
<span id="placeholder"
|
|
8763
|
+
<span id="placeholder"
|
|
8764
|
+
class="${e(placeholderClass)}"
|
|
8765
|
+
?aria-hidden="${this.optionSelected && this.optionSelected.length ? 'true' : false}"
|
|
8766
|
+
>
|
|
8767
|
+
<slot name="placeholder"></slot>
|
|
8768
|
+
</span>
|
|
8769
|
+
<slot name="valueText" id="valueText"></slot>
|
|
6652
8770
|
</span>
|
|
6653
8771
|
|
|
6654
|
-
<div class="menuWrapper">
|
|
6655
|
-
</div>
|
|
6656
|
-
|
|
6657
8772
|
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8773
|
+
<slot></slot>
|
|
6658
8774
|
</${this.bibtemplateTag}>
|
|
6659
8775
|
<slot name="label" slot="label"></slot>
|
|
6660
8776
|
<p slot="helpText">
|
|
@@ -6694,16 +8810,17 @@ class AuroSelect extends i$2 {
|
|
|
6694
8810
|
</select>
|
|
6695
8811
|
</div>
|
|
6696
8812
|
<!-- Help text and error message template -->
|
|
8813
|
+
${this.renderHtmlHelpText()}
|
|
6697
8814
|
</div>
|
|
6698
8815
|
`;
|
|
6699
8816
|
}
|
|
6700
8817
|
}
|
|
6701
8818
|
|
|
6702
|
-
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:
|
|
8819
|
+
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)}`;
|
|
6703
8820
|
|
|
6704
8821
|
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)}`;
|
|
6705
8822
|
|
|
6706
|
-
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)}`;
|
|
8823
|
+
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)}`;
|
|
6707
8824
|
|
|
6708
8825
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6709
8826
|
// See LICENSE in the project root for license information.
|
|
@@ -6769,14 +8886,17 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
6769
8886
|
* @slot - Slot for insertion of menu options.
|
|
6770
8887
|
*/
|
|
6771
8888
|
|
|
6772
|
-
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens */
|
|
8889
|
+
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens, no-inline-comments, line-comment-position */
|
|
6773
8890
|
|
|
6774
|
-
class AuroMenu extends
|
|
8891
|
+
class AuroMenu extends AuroElement$4 {
|
|
6775
8892
|
constructor() {
|
|
6776
8893
|
super();
|
|
6777
8894
|
|
|
6778
8895
|
// State properties (reactive)
|
|
6779
8896
|
|
|
8897
|
+
this.shape = ""; // box, rounded, pill
|
|
8898
|
+
this.size = ""; // md, lg, xl
|
|
8899
|
+
|
|
6780
8900
|
// Value of the selected options
|
|
6781
8901
|
this.value = undefined;
|
|
6782
8902
|
// Currently selected option
|
|
@@ -6835,6 +8955,7 @@ class AuroMenu extends i$2 {
|
|
|
6835
8955
|
|
|
6836
8956
|
static get properties() {
|
|
6837
8957
|
return {
|
|
8958
|
+
...super.properties,
|
|
6838
8959
|
noCheckmark: {
|
|
6839
8960
|
type: Boolean,
|
|
6840
8961
|
reflect: true,
|
|
@@ -6868,6 +8989,16 @@ class AuroMenu extends i$2 {
|
|
|
6868
8989
|
value: {
|
|
6869
8990
|
// Allow string, string[] arrays and undefined
|
|
6870
8991
|
type: Object
|
|
8992
|
+
},
|
|
8993
|
+
|
|
8994
|
+
/**
|
|
8995
|
+
* Indent level for submenus.
|
|
8996
|
+
* @private
|
|
8997
|
+
*/
|
|
8998
|
+
level: {
|
|
8999
|
+
type: Number,
|
|
9000
|
+
reflect: false,
|
|
9001
|
+
attribute: false
|
|
6871
9002
|
}
|
|
6872
9003
|
};
|
|
6873
9004
|
}
|
|
@@ -6889,7 +9020,7 @@ class AuroMenu extends i$2 {
|
|
|
6889
9020
|
*
|
|
6890
9021
|
*/
|
|
6891
9022
|
static register(name = "auro-menu") {
|
|
6892
|
-
AuroLibraryRuntimeUtils$
|
|
9023
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenu);
|
|
6893
9024
|
}
|
|
6894
9025
|
|
|
6895
9026
|
// Lifecycle Methods
|
|
@@ -6901,6 +9032,7 @@ class AuroMenu extends i$2 {
|
|
|
6901
9032
|
this.addEventListener('mousedown', this.handleMouseSelect);
|
|
6902
9033
|
this.addEventListener('auroMenuOption-mouseover', this.handleOptionHover);
|
|
6903
9034
|
this.addEventListener('slotchange', this.handleSlotChange);
|
|
9035
|
+
this.setTagAttribute("auro-menu");
|
|
6904
9036
|
}
|
|
6905
9037
|
|
|
6906
9038
|
disconnectedCallback() {
|
|
@@ -6913,19 +9045,33 @@ class AuroMenu extends i$2 {
|
|
|
6913
9045
|
}
|
|
6914
9046
|
|
|
6915
9047
|
firstUpdated() {
|
|
6916
|
-
AuroLibraryRuntimeUtils$
|
|
9048
|
+
AuroLibraryRuntimeUtils$6.prototype.handleComponentTagRename(this, 'auro-menu');
|
|
6917
9049
|
|
|
6918
9050
|
this.loadingSlots = this.querySelectorAll("[slot='loadingText'], [slot='loadingIcon']");
|
|
6919
9051
|
this.initializeMenu();
|
|
6920
9052
|
}
|
|
6921
9053
|
|
|
9054
|
+
/**
|
|
9055
|
+
* Sets an attribute that matches the default tag name if the tag name is not the default.
|
|
9056
|
+
* @param {string} tagName - The tag name to set as an attribute.
|
|
9057
|
+
* @private
|
|
9058
|
+
*/
|
|
9059
|
+
setTagAttribute(tagName) {
|
|
9060
|
+
if (this.tagName.toLowerCase() !== tagName) {
|
|
9061
|
+
this.setAttribute(tagName, true);
|
|
9062
|
+
}
|
|
9063
|
+
}
|
|
9064
|
+
|
|
6922
9065
|
updated(changedProperties) {
|
|
9066
|
+
super.updated(changedProperties);
|
|
9067
|
+
|
|
6923
9068
|
if (changedProperties.has('multiSelect')) {
|
|
6924
9069
|
// Reset selection if multiSelect mode changes
|
|
6925
9070
|
this.clearSelection();
|
|
6926
9071
|
}
|
|
6927
9072
|
|
|
6928
|
-
|
|
9073
|
+
|
|
9074
|
+
if (changedProperties.has("value")) {
|
|
6929
9075
|
// Handle null/undefined case
|
|
6930
9076
|
if (this.value === undefined || this.value === null) {
|
|
6931
9077
|
this.optionSelected = undefined;
|
|
@@ -6993,6 +9139,19 @@ class AuroMenu extends i$2 {
|
|
|
6993
9139
|
this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]').forEach((element) => element.setAttribute('noCheckmark', ''));
|
|
6994
9140
|
}
|
|
6995
9141
|
|
|
9142
|
+
// Handle layout propagation to all menus and options
|
|
9143
|
+
const propagationTargets = this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]');
|
|
9144
|
+
[
|
|
9145
|
+
'size',
|
|
9146
|
+
'shape'
|
|
9147
|
+
].forEach((prop) => {
|
|
9148
|
+
if (changedProperties.has(prop)) {
|
|
9149
|
+
propagationTargets.forEach((el) => {
|
|
9150
|
+
el.setAttribute(prop, this[prop]);
|
|
9151
|
+
});
|
|
9152
|
+
}
|
|
9153
|
+
});
|
|
9154
|
+
|
|
6996
9155
|
// Regex for matchWord if needed
|
|
6997
9156
|
let regexWord = null;
|
|
6998
9157
|
|
|
@@ -7189,21 +9348,20 @@ class AuroMenu extends i$2 {
|
|
|
7189
9348
|
* @param {HTMLElement} menu - Root menu element.
|
|
7190
9349
|
*/
|
|
7191
9350
|
handleNestedMenus(menu) {
|
|
7192
|
-
|
|
9351
|
+
menu.level = menu.parentElement.level >= 0 ? menu.parentElement.level + 1 : 0;
|
|
7193
9352
|
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
if (!
|
|
7198
|
-
|
|
9353
|
+
if (menu.level > 0) {
|
|
9354
|
+
menu.setAttribute('role', 'group');
|
|
9355
|
+
menu.removeAttribute("root");
|
|
9356
|
+
if (!menu.hasAttribute('aria-label')) {
|
|
9357
|
+
menu.setAttribute('aria-label', 'submenu');
|
|
7199
9358
|
}
|
|
9359
|
+
}
|
|
7200
9360
|
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
this.handleNestedMenus(nestedMenu);
|
|
9361
|
+
const options = menu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption]');
|
|
9362
|
+
options.forEach((option) => {
|
|
9363
|
+
const regex = new RegExp(this.nestingSpacer, "gu");
|
|
9364
|
+
option.innerHTML = this.nestingSpacer.repeat(menu.level) + option.innerHTML.replace(regex, '');
|
|
7207
9365
|
});
|
|
7208
9366
|
}
|
|
7209
9367
|
|
|
@@ -7445,28 +9603,39 @@ class AuroMenu extends i$2 {
|
|
|
7445
9603
|
}
|
|
7446
9604
|
|
|
7447
9605
|
/**
|
|
7448
|
-
*
|
|
7449
|
-
* @
|
|
9606
|
+
* Logic to determine the layout of the component.
|
|
9607
|
+
* @protected
|
|
9608
|
+
* @returns {void}
|
|
7450
9609
|
*/
|
|
7451
|
-
|
|
9610
|
+
renderLayout() {
|
|
7452
9611
|
if (this.loading) {
|
|
7453
9612
|
return x`
|
|
7454
|
-
<
|
|
7455
|
-
<
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
9613
|
+
<div class="wrapper">
|
|
9614
|
+
<auro-menuoption
|
|
9615
|
+
disabled
|
|
9616
|
+
loadingplaceholder
|
|
9617
|
+
class="${this.hasLoadingPlaceholder ? "" : "empty"}"
|
|
9618
|
+
>
|
|
9619
|
+
<div>
|
|
9620
|
+
<slot name="loadingIcon"></slot>
|
|
9621
|
+
<slot name="loadingText"></slot>
|
|
9622
|
+
</div>
|
|
9623
|
+
</auro-menuoption>
|
|
9624
|
+
</div>
|
|
7460
9625
|
`;
|
|
7461
9626
|
}
|
|
7462
9627
|
|
|
7463
|
-
return x
|
|
9628
|
+
return x`
|
|
9629
|
+
<div class="wrapper">
|
|
9630
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
9631
|
+
</div>
|
|
9632
|
+
`;
|
|
7464
9633
|
}
|
|
7465
9634
|
}
|
|
7466
9635
|
|
|
7467
|
-
var styleCss$1 = i$5`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-
|
|
9636
|
+
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);margin-bottom:var(--ds-size-50, 0.25rem)}:host .wrapper[class*=-xl]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem);margin-bottom:var(--ds-size-100, 0.5rem)}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
7468
9637
|
|
|
7469
|
-
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)}`;
|
|
9638
|
+
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)}`;
|
|
7470
9639
|
|
|
7471
9640
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7472
9641
|
// See LICENSE in the project root for license information.
|
|
@@ -7622,6 +9791,76 @@ var tokensCss = i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-def
|
|
|
7622
9791
|
|
|
7623
9792
|
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)}`;
|
|
7624
9793
|
|
|
9794
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
9795
|
+
// See LICENSE in the project root for license information.
|
|
9796
|
+
|
|
9797
|
+
// ---------------------------------------------------------------------
|
|
9798
|
+
|
|
9799
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
9800
|
+
|
|
9801
|
+
class AuroLibraryRuntimeUtils {
|
|
9802
|
+
|
|
9803
|
+
/* eslint-disable jsdoc/require-param */
|
|
9804
|
+
|
|
9805
|
+
/**
|
|
9806
|
+
* This will register a new custom element with the browser.
|
|
9807
|
+
* @param {String} name - The name of the custom element.
|
|
9808
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
9809
|
+
* @returns {void}
|
|
9810
|
+
*/
|
|
9811
|
+
registerComponent(name, componentClass) {
|
|
9812
|
+
if (!customElements.get(name)) {
|
|
9813
|
+
customElements.define(name, class extends componentClass {});
|
|
9814
|
+
}
|
|
9815
|
+
}
|
|
9816
|
+
|
|
9817
|
+
/**
|
|
9818
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
9819
|
+
* @returns {void}
|
|
9820
|
+
*/
|
|
9821
|
+
closestElement(
|
|
9822
|
+
selector, // selector like in .closest()
|
|
9823
|
+
base = this, // extra functionality to skip a parent
|
|
9824
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
9825
|
+
!el || el === document || el === window
|
|
9826
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
9827
|
+
: found
|
|
9828
|
+
? found // found a selector INside this element
|
|
9829
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
9830
|
+
) {
|
|
9831
|
+
return __Closest(base);
|
|
9832
|
+
}
|
|
9833
|
+
/* eslint-enable jsdoc/require-param */
|
|
9834
|
+
|
|
9835
|
+
/**
|
|
9836
|
+
* 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.
|
|
9837
|
+
* @param {Object} elem - The element to check.
|
|
9838
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
9839
|
+
* @returns {void}
|
|
9840
|
+
*/
|
|
9841
|
+
handleComponentTagRename(elem, tagName) {
|
|
9842
|
+
const tag = tagName.toLowerCase();
|
|
9843
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
9844
|
+
|
|
9845
|
+
if (elemTag !== tag) {
|
|
9846
|
+
elem.setAttribute(tag, true);
|
|
9847
|
+
}
|
|
9848
|
+
}
|
|
9849
|
+
|
|
9850
|
+
/**
|
|
9851
|
+
* Validates if an element is a specific Auro component.
|
|
9852
|
+
* @param {Object} elem - The element to validate.
|
|
9853
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
9854
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
9855
|
+
*/
|
|
9856
|
+
elementMatch(elem, tagName) {
|
|
9857
|
+
const tag = tagName.toLowerCase();
|
|
9858
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
9859
|
+
|
|
9860
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
9861
|
+
}
|
|
9862
|
+
}
|
|
9863
|
+
|
|
7625
9864
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7626
9865
|
// See LICENSE in the project root for license information.
|
|
7627
9866
|
|
|
@@ -7641,7 +9880,7 @@ class AuroIcon extends BaseIcon {
|
|
|
7641
9880
|
*/
|
|
7642
9881
|
privateDefaults() {
|
|
7643
9882
|
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
7644
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils
|
|
9883
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
7645
9884
|
}
|
|
7646
9885
|
|
|
7647
9886
|
// function to define props used within the scope of this component
|
|
@@ -7723,7 +9962,7 @@ class AuroIcon extends BaseIcon {
|
|
|
7723
9962
|
*
|
|
7724
9963
|
*/
|
|
7725
9964
|
static register(name = "auro-icon") {
|
|
7726
|
-
AuroLibraryRuntimeUtils
|
|
9965
|
+
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroIcon);
|
|
7727
9966
|
}
|
|
7728
9967
|
|
|
7729
9968
|
connectedCallback() {
|
|
@@ -7744,8 +9983,12 @@ class AuroIcon extends BaseIcon {
|
|
|
7744
9983
|
async firstUpdated() {
|
|
7745
9984
|
await super.firstUpdated();
|
|
7746
9985
|
|
|
7747
|
-
|
|
7748
|
-
|
|
9986
|
+
/**
|
|
9987
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
9988
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
9989
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
9990
|
+
*/
|
|
9991
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
7749
9992
|
const svgDesc = this.svg.querySelector('desc');
|
|
7750
9993
|
|
|
7751
9994
|
if (svgDesc) {
|
|
@@ -7789,7 +10032,7 @@ class AuroIcon extends BaseIcon {
|
|
|
7789
10032
|
}
|
|
7790
10033
|
}
|
|
7791
10034
|
|
|
7792
|
-
var iconVersion = '8.0.
|
|
10035
|
+
var iconVersion = '8.0.4';
|
|
7793
10036
|
|
|
7794
10037
|
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>"};
|
|
7795
10038
|
|
|
@@ -7807,10 +10050,13 @@ var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlin
|
|
|
7807
10050
|
* @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
|
|
7808
10051
|
* @slot - Specifies text for an option, but is not the value.
|
|
7809
10052
|
*/
|
|
7810
|
-
class AuroMenuOption extends
|
|
10053
|
+
class AuroMenuOption extends AuroElement$4 {
|
|
7811
10054
|
constructor() {
|
|
7812
10055
|
super();
|
|
7813
10056
|
|
|
10057
|
+
this.size = ""; // md, lg, xl
|
|
10058
|
+
this.shape = ""; // box, rounded, pill
|
|
10059
|
+
|
|
7814
10060
|
/**
|
|
7815
10061
|
* Generate unique names for dependency components.
|
|
7816
10062
|
*/
|
|
@@ -7829,11 +10075,12 @@ class AuroMenuOption extends i$2 {
|
|
|
7829
10075
|
/**
|
|
7830
10076
|
* @private
|
|
7831
10077
|
*/
|
|
7832
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
10078
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
7833
10079
|
}
|
|
7834
10080
|
|
|
7835
10081
|
static get properties() {
|
|
7836
10082
|
return {
|
|
10083
|
+
...super.properties,
|
|
7837
10084
|
nocheckmark: {
|
|
7838
10085
|
type: Boolean,
|
|
7839
10086
|
reflect: true
|
|
@@ -7873,7 +10120,7 @@ class AuroMenuOption extends i$2 {
|
|
|
7873
10120
|
*
|
|
7874
10121
|
*/
|
|
7875
10122
|
static register(name = "auro-menuoption") {
|
|
7876
|
-
AuroLibraryRuntimeUtils$
|
|
10123
|
+
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenuOption);
|
|
7877
10124
|
}
|
|
7878
10125
|
|
|
7879
10126
|
firstUpdated() {
|
|
@@ -7895,6 +10142,8 @@ class AuroMenuOption extends i$2 {
|
|
|
7895
10142
|
|
|
7896
10143
|
// observer for selected property changes
|
|
7897
10144
|
updated(changedProperties) {
|
|
10145
|
+
super.updated(changedProperties);
|
|
10146
|
+
|
|
7898
10147
|
if (changedProperties.has('selected')) {
|
|
7899
10148
|
this.setAttribute('aria-selected', this.selected.toString());
|
|
7900
10149
|
}
|
|
@@ -7916,10 +10165,19 @@ class AuroMenuOption extends i$2 {
|
|
|
7916
10165
|
return u`<${this.iconTag} customColor customSvg slot="icon">${svg}</${this.iconTag}>`;
|
|
7917
10166
|
}
|
|
7918
10167
|
|
|
7919
|
-
|
|
10168
|
+
/**
|
|
10169
|
+
* Logic to determine the layout of the component.
|
|
10170
|
+
* @protected
|
|
10171
|
+
* @returns {void}
|
|
10172
|
+
*/
|
|
10173
|
+
renderLayout() {
|
|
7920
10174
|
return u`
|
|
7921
|
-
|
|
7922
|
-
|
|
10175
|
+
<div class="wrapper">
|
|
10176
|
+
${this.selected && !this.nocheckmark
|
|
10177
|
+
? this.generateIconHtml(checkmarkIcon.svg)
|
|
10178
|
+
: undefined}
|
|
10179
|
+
<slot></slot>
|
|
10180
|
+
</div>
|
|
7923
10181
|
`;
|
|
7924
10182
|
}
|
|
7925
10183
|
}
|
|
@@ -7941,6 +10199,7 @@ function initExamples(initCount) {
|
|
|
7941
10199
|
inDialogExample();
|
|
7942
10200
|
resetStateExample();
|
|
7943
10201
|
auroMenuLoadingExample();
|
|
10202
|
+
valueTextExample();
|
|
7944
10203
|
} catch (err) {
|
|
7945
10204
|
if (initCount <= 20) {
|
|
7946
10205
|
// setTimeout handles issue where content is sometimes loaded after the functions get called
|