@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
|
@@ -3,11 +3,106 @@ import { unsafeStatic, literal, html as html$1 } from 'lit/static-html.js';
|
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
5
|
|
|
6
|
-
var styleCss$2 = css`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:
|
|
6
|
+
var styleCss$2 = css`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:block;vertical-align:middle}:host .wrapper{box-sizing:border-box;display:inline-block;width:100%;margin:0;padding:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host [loadingplaceholder].empty{opacity:0;position:absolute}:host [loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;line-height:1;display:inline-block}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]){overflow-y:auto}:host([root]) .wrapper[class*=-lg]{padding:var(--ds-size-150, 0.75rem)}:host([root]) .wrapper[class*=-xl]{padding:var(--ds-size-200, 1rem)}`;
|
|
7
7
|
|
|
8
8
|
var colorCss$2 = css`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-divider-color)}[loadingplaceholder] slot[name=loadingIcon]{color:var(--ds-auro-menu-loader-color)}[loadingplaceholder] slot[name=loadingText]{color:var(--ds-auro-menu-loader-text-color)}`;
|
|
9
9
|
|
|
10
|
-
var tokensCss$1 = css`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
10
|
+
var tokensCss$1 = css`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
11
|
+
|
|
12
|
+
let AuroElement$1 = class AuroElement extends LitElement {
|
|
13
|
+
static get properties() {
|
|
14
|
+
return {
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Defines the language of an element.
|
|
18
|
+
* @default {'default'}
|
|
19
|
+
*/
|
|
20
|
+
layout: {
|
|
21
|
+
type: String,
|
|
22
|
+
attribute: "layout",
|
|
23
|
+
reflect: true
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
shape: {
|
|
27
|
+
type: String,
|
|
28
|
+
attribute: "shape",
|
|
29
|
+
reflect: true
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
size: {
|
|
33
|
+
type: String,
|
|
34
|
+
attribute: "size",
|
|
35
|
+
reflect: true
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
onDark: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
attribute: "ondark",
|
|
41
|
+
reflect: true
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
resetShapeClasses() {
|
|
47
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
48
|
+
|
|
49
|
+
if (wrapper) {
|
|
50
|
+
wrapper.classList.forEach((className) => {
|
|
51
|
+
if (className.startsWith('shape-')) {
|
|
52
|
+
wrapper.classList.remove(className);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (this.shape && this.size) {
|
|
59
|
+
wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
60
|
+
} else {
|
|
61
|
+
wrapper.classList.add('shape-none');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
resetLayoutClasses() {
|
|
66
|
+
if (this.layout) {
|
|
67
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
68
|
+
|
|
69
|
+
if (wrapper) {
|
|
70
|
+
wrapper.classList.forEach((className) => {
|
|
71
|
+
if (className.startsWith('layout-')) {
|
|
72
|
+
wrapper.classList.remove(className);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
updateComponentArchitecture() {
|
|
82
|
+
this.resetLayoutClasses();
|
|
83
|
+
this.resetShapeClasses();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
updated(changedProperties) {
|
|
87
|
+
if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
|
|
88
|
+
this.updateComponentArchitecture();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
|
|
93
|
+
// This will catch if an invalid layout value is passed in and render the default layout if so.
|
|
94
|
+
render() {
|
|
95
|
+
try {
|
|
96
|
+
return this.renderLayout();
|
|
97
|
+
} catch (error) {
|
|
98
|
+
// failed to get the defined layout
|
|
99
|
+
console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
|
|
100
|
+
|
|
101
|
+
// fallback to the default layout
|
|
102
|
+
return this.getLayout('default');
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
11
106
|
|
|
12
107
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
13
108
|
// See LICENSE in the project root for license information.
|
|
@@ -16,7 +111,7 @@ var tokensCss$1 = css`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-b
|
|
|
16
111
|
|
|
17
112
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
18
113
|
|
|
19
|
-
class AuroLibraryRuntimeUtils {
|
|
114
|
+
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
20
115
|
|
|
21
116
|
/* eslint-disable jsdoc/require-param */
|
|
22
117
|
|
|
@@ -77,7 +172,7 @@ class AuroLibraryRuntimeUtils {
|
|
|
77
172
|
|
|
78
173
|
return elemTag === tag || elem.hasAttribute(tag);
|
|
79
174
|
}
|
|
80
|
-
}
|
|
175
|
+
};
|
|
81
176
|
|
|
82
177
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
83
178
|
// See LICENSE in the project root for license information.
|
|
@@ -184,14 +279,17 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
184
279
|
* @slot - Slot for insertion of menu options.
|
|
185
280
|
*/
|
|
186
281
|
|
|
187
|
-
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens */
|
|
282
|
+
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens, no-inline-comments, line-comment-position */
|
|
188
283
|
|
|
189
|
-
class AuroMenu extends
|
|
284
|
+
class AuroMenu extends AuroElement$1 {
|
|
190
285
|
constructor() {
|
|
191
286
|
super();
|
|
192
287
|
|
|
193
288
|
// State properties (reactive)
|
|
194
289
|
|
|
290
|
+
this.shape = ""; // box, rounded, pill
|
|
291
|
+
this.size = ""; // md, lg, xl
|
|
292
|
+
|
|
195
293
|
// Value of the selected options
|
|
196
294
|
this.value = undefined;
|
|
197
295
|
// Currently selected option
|
|
@@ -250,6 +348,7 @@ class AuroMenu extends LitElement {
|
|
|
250
348
|
|
|
251
349
|
static get properties() {
|
|
252
350
|
return {
|
|
351
|
+
...super.properties,
|
|
253
352
|
noCheckmark: {
|
|
254
353
|
type: Boolean,
|
|
255
354
|
reflect: true,
|
|
@@ -283,6 +382,16 @@ class AuroMenu extends LitElement {
|
|
|
283
382
|
value: {
|
|
284
383
|
// Allow string, string[] arrays and undefined
|
|
285
384
|
type: Object
|
|
385
|
+
},
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Indent level for submenus.
|
|
389
|
+
* @private
|
|
390
|
+
*/
|
|
391
|
+
level: {
|
|
392
|
+
type: Number,
|
|
393
|
+
reflect: false,
|
|
394
|
+
attribute: false
|
|
286
395
|
}
|
|
287
396
|
};
|
|
288
397
|
}
|
|
@@ -304,7 +413,7 @@ class AuroMenu extends LitElement {
|
|
|
304
413
|
*
|
|
305
414
|
*/
|
|
306
415
|
static register(name = "auro-menu") {
|
|
307
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenu);
|
|
416
|
+
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroMenu);
|
|
308
417
|
}
|
|
309
418
|
|
|
310
419
|
// Lifecycle Methods
|
|
@@ -316,6 +425,7 @@ class AuroMenu extends LitElement {
|
|
|
316
425
|
this.addEventListener('mousedown', this.handleMouseSelect);
|
|
317
426
|
this.addEventListener('auroMenuOption-mouseover', this.handleOptionHover);
|
|
318
427
|
this.addEventListener('slotchange', this.handleSlotChange);
|
|
428
|
+
this.setTagAttribute("auro-menu");
|
|
319
429
|
}
|
|
320
430
|
|
|
321
431
|
disconnectedCallback() {
|
|
@@ -328,19 +438,33 @@ class AuroMenu extends LitElement {
|
|
|
328
438
|
}
|
|
329
439
|
|
|
330
440
|
firstUpdated() {
|
|
331
|
-
AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-menu');
|
|
441
|
+
AuroLibraryRuntimeUtils$1.prototype.handleComponentTagRename(this, 'auro-menu');
|
|
332
442
|
|
|
333
443
|
this.loadingSlots = this.querySelectorAll("[slot='loadingText'], [slot='loadingIcon']");
|
|
334
444
|
this.initializeMenu();
|
|
335
445
|
}
|
|
336
446
|
|
|
447
|
+
/**
|
|
448
|
+
* Sets an attribute that matches the default tag name if the tag name is not the default.
|
|
449
|
+
* @param {string} tagName - The tag name to set as an attribute.
|
|
450
|
+
* @private
|
|
451
|
+
*/
|
|
452
|
+
setTagAttribute(tagName) {
|
|
453
|
+
if (this.tagName.toLowerCase() !== tagName) {
|
|
454
|
+
this.setAttribute(tagName, true);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
337
458
|
updated(changedProperties) {
|
|
459
|
+
super.updated(changedProperties);
|
|
460
|
+
|
|
338
461
|
if (changedProperties.has('multiSelect')) {
|
|
339
462
|
// Reset selection if multiSelect mode changes
|
|
340
463
|
this.clearSelection();
|
|
341
464
|
}
|
|
342
465
|
|
|
343
|
-
|
|
466
|
+
|
|
467
|
+
if (changedProperties.has("value")) {
|
|
344
468
|
// Handle null/undefined case
|
|
345
469
|
if (this.value === undefined || this.value === null) {
|
|
346
470
|
this.optionSelected = undefined;
|
|
@@ -408,6 +532,19 @@ class AuroMenu extends LitElement {
|
|
|
408
532
|
this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]').forEach((element) => element.setAttribute('noCheckmark', ''));
|
|
409
533
|
}
|
|
410
534
|
|
|
535
|
+
// Handle layout propagation to all menus and options
|
|
536
|
+
const propagationTargets = this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]');
|
|
537
|
+
[
|
|
538
|
+
'size',
|
|
539
|
+
'shape'
|
|
540
|
+
].forEach((prop) => {
|
|
541
|
+
if (changedProperties.has(prop)) {
|
|
542
|
+
propagationTargets.forEach((el) => {
|
|
543
|
+
el.setAttribute(prop, this[prop]);
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
|
|
411
548
|
// Regex for matchWord if needed
|
|
412
549
|
let regexWord = null;
|
|
413
550
|
|
|
@@ -604,21 +741,20 @@ class AuroMenu extends LitElement {
|
|
|
604
741
|
* @param {HTMLElement} menu - Root menu element.
|
|
605
742
|
*/
|
|
606
743
|
handleNestedMenus(menu) {
|
|
607
|
-
|
|
744
|
+
menu.level = menu.parentElement.level >= 0 ? menu.parentElement.level + 1 : 0;
|
|
608
745
|
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
if (!
|
|
613
|
-
|
|
746
|
+
if (menu.level > 0) {
|
|
747
|
+
menu.setAttribute('role', 'group');
|
|
748
|
+
menu.removeAttribute("root");
|
|
749
|
+
if (!menu.hasAttribute('aria-label')) {
|
|
750
|
+
menu.setAttribute('aria-label', 'submenu');
|
|
614
751
|
}
|
|
752
|
+
}
|
|
615
753
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
this.handleNestedMenus(nestedMenu);
|
|
754
|
+
const options = menu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption]');
|
|
755
|
+
options.forEach((option) => {
|
|
756
|
+
const regex = new RegExp(this.nestingSpacer, "gu");
|
|
757
|
+
option.innerHTML = this.nestingSpacer.repeat(menu.level) + option.innerHTML.replace(regex, '');
|
|
622
758
|
});
|
|
623
759
|
}
|
|
624
760
|
|
|
@@ -860,28 +996,39 @@ class AuroMenu extends LitElement {
|
|
|
860
996
|
}
|
|
861
997
|
|
|
862
998
|
/**
|
|
863
|
-
*
|
|
864
|
-
* @
|
|
999
|
+
* Logic to determine the layout of the component.
|
|
1000
|
+
* @protected
|
|
1001
|
+
* @returns {void}
|
|
865
1002
|
*/
|
|
866
|
-
|
|
1003
|
+
renderLayout() {
|
|
867
1004
|
if (this.loading) {
|
|
868
1005
|
return html`
|
|
869
|
-
<
|
|
870
|
-
<
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
1006
|
+
<div class="wrapper">
|
|
1007
|
+
<auro-menuoption
|
|
1008
|
+
disabled
|
|
1009
|
+
loadingplaceholder
|
|
1010
|
+
class="${this.hasLoadingPlaceholder ? "" : "empty"}"
|
|
1011
|
+
>
|
|
1012
|
+
<div>
|
|
1013
|
+
<slot name="loadingIcon"></slot>
|
|
1014
|
+
<slot name="loadingText"></slot>
|
|
1015
|
+
</div>
|
|
1016
|
+
</auro-menuoption>
|
|
1017
|
+
</div>
|
|
875
1018
|
`;
|
|
876
1019
|
}
|
|
877
1020
|
|
|
878
|
-
return html
|
|
1021
|
+
return html`
|
|
1022
|
+
<div class="wrapper">
|
|
1023
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
1024
|
+
</div>
|
|
1025
|
+
`;
|
|
879
1026
|
}
|
|
880
1027
|
}
|
|
881
1028
|
|
|
882
|
-
var styleCss$1 = css`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-
|
|
1029
|
+
var styleCss$1 = css`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem));padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-50, 0.25rem);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box],:host .wrapper[class*=shape-snowflake]{border-radius:unset}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem);margin-bottom:var(--ds-size-50, 0.25rem)}:host .wrapper[class*=-xl]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem);margin-bottom:var(--ds-size-100, 0.5rem)}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
883
1030
|
|
|
884
|
-
var colorCss$1 = css`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
1031
|
+
var colorCss$1 = css`:host .wrapper{border:1px solid var(--ds-auro-menuoption-container-border-color);background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
885
1032
|
|
|
886
1033
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
887
1034
|
// See LICENSE in the project root for license information.
|
|
@@ -1077,6 +1224,76 @@ var tokensCss = css`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-def
|
|
|
1077
1224
|
|
|
1078
1225
|
var colorCss = css`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
1079
1226
|
|
|
1227
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
1228
|
+
// See LICENSE in the project root for license information.
|
|
1229
|
+
|
|
1230
|
+
// ---------------------------------------------------------------------
|
|
1231
|
+
|
|
1232
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
1233
|
+
|
|
1234
|
+
class AuroLibraryRuntimeUtils {
|
|
1235
|
+
|
|
1236
|
+
/* eslint-disable jsdoc/require-param */
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* This will register a new custom element with the browser.
|
|
1240
|
+
* @param {String} name - The name of the custom element.
|
|
1241
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
1242
|
+
* @returns {void}
|
|
1243
|
+
*/
|
|
1244
|
+
registerComponent(name, componentClass) {
|
|
1245
|
+
if (!customElements.get(name)) {
|
|
1246
|
+
customElements.define(name, class extends componentClass {});
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
1252
|
+
* @returns {void}
|
|
1253
|
+
*/
|
|
1254
|
+
closestElement(
|
|
1255
|
+
selector, // selector like in .closest()
|
|
1256
|
+
base = this, // extra functionality to skip a parent
|
|
1257
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
1258
|
+
!el || el === document || el === window
|
|
1259
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
1260
|
+
: found
|
|
1261
|
+
? found // found a selector INside this element
|
|
1262
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
1263
|
+
) {
|
|
1264
|
+
return __Closest(base);
|
|
1265
|
+
}
|
|
1266
|
+
/* eslint-enable jsdoc/require-param */
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* 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.
|
|
1270
|
+
* @param {Object} elem - The element to check.
|
|
1271
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
1272
|
+
* @returns {void}
|
|
1273
|
+
*/
|
|
1274
|
+
handleComponentTagRename(elem, tagName) {
|
|
1275
|
+
const tag = tagName.toLowerCase();
|
|
1276
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
1277
|
+
|
|
1278
|
+
if (elemTag !== tag) {
|
|
1279
|
+
elem.setAttribute(tag, true);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* Validates if an element is a specific Auro component.
|
|
1285
|
+
* @param {Object} elem - The element to validate.
|
|
1286
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
1287
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
1288
|
+
*/
|
|
1289
|
+
elementMatch(elem, tagName) {
|
|
1290
|
+
const tag = tagName.toLowerCase();
|
|
1291
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
1292
|
+
|
|
1293
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1080
1297
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
1081
1298
|
// See LICENSE in the project root for license information.
|
|
1082
1299
|
|
|
@@ -1199,8 +1416,12 @@ class AuroIcon extends BaseIcon {
|
|
|
1199
1416
|
async firstUpdated() {
|
|
1200
1417
|
await super.firstUpdated();
|
|
1201
1418
|
|
|
1202
|
-
|
|
1203
|
-
|
|
1419
|
+
/**
|
|
1420
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
1421
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
1422
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
1423
|
+
*/
|
|
1424
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
1204
1425
|
const svgDesc = this.svg.querySelector('desc');
|
|
1205
1426
|
|
|
1206
1427
|
if (svgDesc) {
|
|
@@ -1244,7 +1465,7 @@ class AuroIcon extends BaseIcon {
|
|
|
1244
1465
|
}
|
|
1245
1466
|
}
|
|
1246
1467
|
|
|
1247
|
-
var iconVersion = '8.0.
|
|
1468
|
+
var iconVersion = '8.0.4';
|
|
1248
1469
|
|
|
1249
1470
|
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>"};
|
|
1250
1471
|
|
|
@@ -1262,10 +1483,13 @@ var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlin
|
|
|
1262
1483
|
* @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
|
|
1263
1484
|
* @slot - Specifies text for an option, but is not the value.
|
|
1264
1485
|
*/
|
|
1265
|
-
class AuroMenuOption extends
|
|
1486
|
+
class AuroMenuOption extends AuroElement$1 {
|
|
1266
1487
|
constructor() {
|
|
1267
1488
|
super();
|
|
1268
1489
|
|
|
1490
|
+
this.size = ""; // md, lg, xl
|
|
1491
|
+
this.shape = ""; // box, rounded, pill
|
|
1492
|
+
|
|
1269
1493
|
/**
|
|
1270
1494
|
* Generate unique names for dependency components.
|
|
1271
1495
|
*/
|
|
@@ -1284,11 +1508,12 @@ class AuroMenuOption extends LitElement {
|
|
|
1284
1508
|
/**
|
|
1285
1509
|
* @private
|
|
1286
1510
|
*/
|
|
1287
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
1511
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
1288
1512
|
}
|
|
1289
1513
|
|
|
1290
1514
|
static get properties() {
|
|
1291
1515
|
return {
|
|
1516
|
+
...super.properties,
|
|
1292
1517
|
nocheckmark: {
|
|
1293
1518
|
type: Boolean,
|
|
1294
1519
|
reflect: true
|
|
@@ -1328,7 +1553,7 @@ class AuroMenuOption extends LitElement {
|
|
|
1328
1553
|
*
|
|
1329
1554
|
*/
|
|
1330
1555
|
static register(name = "auro-menuoption") {
|
|
1331
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenuOption);
|
|
1556
|
+
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroMenuOption);
|
|
1332
1557
|
}
|
|
1333
1558
|
|
|
1334
1559
|
firstUpdated() {
|
|
@@ -1350,6 +1575,8 @@ class AuroMenuOption extends LitElement {
|
|
|
1350
1575
|
|
|
1351
1576
|
// observer for selected property changes
|
|
1352
1577
|
updated(changedProperties) {
|
|
1578
|
+
super.updated(changedProperties);
|
|
1579
|
+
|
|
1353
1580
|
if (changedProperties.has('selected')) {
|
|
1354
1581
|
this.setAttribute('aria-selected', this.selected.toString());
|
|
1355
1582
|
}
|
|
@@ -1371,10 +1598,19 @@ class AuroMenuOption extends LitElement {
|
|
|
1371
1598
|
return html$1`<${this.iconTag} customColor customSvg slot="icon">${svg}</${this.iconTag}>`;
|
|
1372
1599
|
}
|
|
1373
1600
|
|
|
1374
|
-
|
|
1601
|
+
/**
|
|
1602
|
+
* Logic to determine the layout of the component.
|
|
1603
|
+
* @protected
|
|
1604
|
+
* @returns {void}
|
|
1605
|
+
*/
|
|
1606
|
+
renderLayout() {
|
|
1375
1607
|
return html$1`
|
|
1376
|
-
|
|
1377
|
-
|
|
1608
|
+
<div class="wrapper">
|
|
1609
|
+
${this.selected && !this.nocheckmark
|
|
1610
|
+
? this.generateIconHtml(checkmarkIcon.svg)
|
|
1611
|
+
: undefined}
|
|
1612
|
+
<slot></slot>
|
|
1613
|
+
</div>
|
|
1378
1614
|
`;
|
|
1379
1615
|
}
|
|
1380
1616
|
}
|