@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.14 → 0.0.0-pr624.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/bibtemplate/dist/auro-bibtemplate.d.ts +12 -2
- package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +1022 -12
- package/components/bibtemplate/dist/registered.js +1022 -12
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/api.md +2 -2
- package/components/checkbox/demo/api.min.js +24 -19
- package/components/checkbox/demo/index.md +2 -2
- package/components/checkbox/demo/index.min.js +24 -19
- package/components/checkbox/demo/readme.md +1 -1
- package/components/checkbox/dist/auro-checkbox.d.ts +3 -3
- package/components/checkbox/dist/index.js +24 -19
- package/components/checkbox/dist/registered.js +24 -19
- package/components/combobox/demo/api.md +52 -0
- package/components/combobox/demo/api.min.js +2059 -651
- package/components/combobox/demo/index.md +6 -0
- package/components/combobox/demo/index.min.js +2059 -651
- package/components/combobox/dist/auro-combobox.d.ts +4 -4
- package/components/combobox/dist/index.js +1978 -629
- package/components/combobox/dist/registered.js +1978 -629
- package/components/counter/demo/api.md +21 -19
- package/components/counter/demo/api.min.js +2326 -539
- package/components/counter/demo/index.md +99 -34
- package/components/counter/demo/index.min.js +2326 -539
- package/components/counter/dist/auro-counter-button.d.ts +2 -0
- package/components/counter/dist/auro-counter-group.d.ts +92 -1
- package/components/counter/dist/helptextVersion.d.ts +2 -0
- package/components/counter/dist/iconVersion.d.ts +1 -1
- package/components/counter/dist/index.js +2326 -539
- package/components/counter/dist/registered.js +2326 -539
- package/components/datepicker/demo/api.md +3 -1
- package/components/datepicker/demo/api.min.js +5402 -3158
- package/components/datepicker/demo/index.md +6 -1
- package/components/datepicker/demo/index.min.js +5402 -3158
- package/components/datepicker/dist/auro-datepicker.d.ts +17 -7
- package/components/datepicker/dist/iconVersion.d.ts +2 -0
- package/components/datepicker/dist/index.js +5402 -3158
- package/components/datepicker/dist/registered.js +5402 -3158
- package/components/dropdown/demo/api.md +3 -4
- package/components/dropdown/demo/api.min.js +69 -119
- package/components/dropdown/demo/index.md +57 -9
- package/components/dropdown/demo/index.min.js +69 -119
- package/components/dropdown/dist/auro-dropdown.d.ts +0 -8
- package/components/dropdown/dist/auro-dropdownBib.d.ts +14 -0
- package/components/dropdown/dist/index.js +69 -119
- package/components/dropdown/dist/registered.js +69 -119
- package/components/input/demo/api.md +12 -5
- package/components/input/demo/api.min.js +665 -285
- package/components/input/demo/index.min.js +665 -285
- package/components/input/dist/auro-input.d.ts +6 -0
- package/components/input/dist/base-input.d.ts +29 -6
- package/components/input/dist/buttonVersion.d.ts +1 -1
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +665 -285
- package/components/input/dist/registered.js +665 -285
- package/components/layoutElement/dist/index.js +13 -10
- package/components/menu/demo/api.html +38 -0
- package/components/menu/demo/api.md +63 -2
- package/components/menu/demo/api.min.js +190 -36
- package/components/menu/demo/index.min.js +190 -36
- package/components/menu/dist/auro-menu.d.ts +22 -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 +190 -36
- package/components/menu/dist/registered.js +190 -36
- package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
- package/components/radio/demo/api.min.js +4 -2
- package/components/radio/demo/index.min.js +4 -2
- package/components/radio/dist/auro-radio.d.ts +1 -1
- package/components/radio/dist/index.js +4 -2
- package/components/radio/dist/registered.js +4 -2
- package/components/select/demo/api.md +5 -5
- package/components/select/demo/api.min.js +1412 -293
- package/components/select/demo/index.md +42 -1
- package/components/select/demo/index.min.js +1412 -293
- package/components/select/dist/auro-select.d.ts +8 -8
- package/components/select/dist/index.js +1321 -261
- package/components/select/dist/registered.js +1321 -261
- package/package.json +2 -2
- /package/components/{menu/dist/styles/color-menu-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{color-menuoption-css.d.ts → default/color-menu-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{style-menu-css.d.ts → default/color-menuoption-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{style-menuoption-css.d.ts → default/style-menu-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{tokens-css.d.ts → default/style-menuoption-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.
|
|
@@ -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
|
}
|
|
@@ -335,12 +444,15 @@ class AuroMenu extends LitElement {
|
|
|
335
444
|
}
|
|
336
445
|
|
|
337
446
|
updated(changedProperties) {
|
|
447
|
+
super.updated(changedProperties);
|
|
448
|
+
|
|
338
449
|
if (changedProperties.has('multiSelect')) {
|
|
339
450
|
// Reset selection if multiSelect mode changes
|
|
340
451
|
this.clearSelection();
|
|
341
452
|
}
|
|
342
453
|
|
|
343
|
-
|
|
454
|
+
|
|
455
|
+
if (changedProperties.has("value")) {
|
|
344
456
|
// Handle null/undefined case
|
|
345
457
|
if (this.value === undefined || this.value === null) {
|
|
346
458
|
this.optionSelected = undefined;
|
|
@@ -408,6 +520,19 @@ class AuroMenu extends LitElement {
|
|
|
408
520
|
this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]').forEach((element) => element.setAttribute('noCheckmark', ''));
|
|
409
521
|
}
|
|
410
522
|
|
|
523
|
+
// Handle layout propagation to all menus and options
|
|
524
|
+
const propagationTargets = this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]');
|
|
525
|
+
[
|
|
526
|
+
'size',
|
|
527
|
+
'shape'
|
|
528
|
+
].forEach((prop) => {
|
|
529
|
+
if (changedProperties.has(prop)) {
|
|
530
|
+
propagationTargets.forEach((el) => {
|
|
531
|
+
el.setAttribute(prop, this[prop]);
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
|
|
411
536
|
// Regex for matchWord if needed
|
|
412
537
|
let regexWord = null;
|
|
413
538
|
|
|
@@ -604,21 +729,20 @@ class AuroMenu extends LitElement {
|
|
|
604
729
|
* @param {HTMLElement} menu - Root menu element.
|
|
605
730
|
*/
|
|
606
731
|
handleNestedMenus(menu) {
|
|
607
|
-
|
|
732
|
+
menu.level = menu.parentElement.level >= 0 ? menu.parentElement.level + 1 : 0;
|
|
608
733
|
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
if (!
|
|
613
|
-
|
|
734
|
+
if (menu.level > 0) {
|
|
735
|
+
menu.setAttribute('role', 'group');
|
|
736
|
+
menu.removeAttribute("root");
|
|
737
|
+
if (!menu.hasAttribute('aria-label')) {
|
|
738
|
+
menu.setAttribute('aria-label', 'submenu');
|
|
614
739
|
}
|
|
740
|
+
}
|
|
615
741
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
this.handleNestedMenus(nestedMenu);
|
|
742
|
+
const options = menu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption]');
|
|
743
|
+
options.forEach((option) => {
|
|
744
|
+
const regex = new RegExp(this.nestingSpacer, "gu");
|
|
745
|
+
option.innerHTML = this.nestingSpacer.repeat(menu.level) + option.innerHTML.replace(regex, '');
|
|
622
746
|
});
|
|
623
747
|
}
|
|
624
748
|
|
|
@@ -860,28 +984,39 @@ class AuroMenu extends LitElement {
|
|
|
860
984
|
}
|
|
861
985
|
|
|
862
986
|
/**
|
|
863
|
-
*
|
|
864
|
-
* @
|
|
987
|
+
* Logic to determine the layout of the component.
|
|
988
|
+
* @protected
|
|
989
|
+
* @returns {void}
|
|
865
990
|
*/
|
|
866
|
-
|
|
991
|
+
renderLayout() {
|
|
867
992
|
if (this.loading) {
|
|
868
993
|
return html`
|
|
869
|
-
<
|
|
870
|
-
<
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
994
|
+
<div class="wrapper">
|
|
995
|
+
<auro-menuoption
|
|
996
|
+
disabled
|
|
997
|
+
loadingplaceholder
|
|
998
|
+
class="${this.hasLoadingPlaceholder ? "" : "empty"}"
|
|
999
|
+
>
|
|
1000
|
+
<div>
|
|
1001
|
+
<slot name="loadingIcon"></slot>
|
|
1002
|
+
<slot name="loadingText"></slot>
|
|
1003
|
+
</div>
|
|
1004
|
+
</auro-menuoption>
|
|
1005
|
+
</div>
|
|
875
1006
|
`;
|
|
876
1007
|
}
|
|
877
1008
|
|
|
878
|
-
return html
|
|
1009
|
+
return html`
|
|
1010
|
+
<div class="wrapper">
|
|
1011
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
1012
|
+
</div>
|
|
1013
|
+
`;
|
|
879
1014
|
}
|
|
880
1015
|
}
|
|
881
1016
|
|
|
882
|
-
var styleCss$1 = css`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-
|
|
1017
|
+
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
1018
|
|
|
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)}`;
|
|
1019
|
+
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
1020
|
|
|
886
1021
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
887
1022
|
// See LICENSE in the project root for license information.
|
|
@@ -1269,8 +1404,12 @@ class AuroIcon extends BaseIcon {
|
|
|
1269
1404
|
async firstUpdated() {
|
|
1270
1405
|
await super.firstUpdated();
|
|
1271
1406
|
|
|
1272
|
-
|
|
1273
|
-
|
|
1407
|
+
/**
|
|
1408
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
1409
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
1410
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
1411
|
+
*/
|
|
1412
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
1274
1413
|
const svgDesc = this.svg.querySelector('desc');
|
|
1275
1414
|
|
|
1276
1415
|
if (svgDesc) {
|
|
@@ -1314,7 +1453,7 @@ class AuroIcon extends BaseIcon {
|
|
|
1314
1453
|
}
|
|
1315
1454
|
}
|
|
1316
1455
|
|
|
1317
|
-
var iconVersion = '8.0.
|
|
1456
|
+
var iconVersion = '8.0.4';
|
|
1318
1457
|
|
|
1319
1458
|
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>"};
|
|
1320
1459
|
|
|
@@ -1332,10 +1471,13 @@ var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlin
|
|
|
1332
1471
|
* @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
|
|
1333
1472
|
* @slot - Specifies text for an option, but is not the value.
|
|
1334
1473
|
*/
|
|
1335
|
-
class AuroMenuOption extends
|
|
1474
|
+
class AuroMenuOption extends AuroElement$1 {
|
|
1336
1475
|
constructor() {
|
|
1337
1476
|
super();
|
|
1338
1477
|
|
|
1478
|
+
this.size = ""; // md, lg, xl
|
|
1479
|
+
this.shape = ""; // box, rounded, pill
|
|
1480
|
+
|
|
1339
1481
|
/**
|
|
1340
1482
|
* Generate unique names for dependency components.
|
|
1341
1483
|
*/
|
|
@@ -1359,6 +1501,7 @@ class AuroMenuOption extends LitElement {
|
|
|
1359
1501
|
|
|
1360
1502
|
static get properties() {
|
|
1361
1503
|
return {
|
|
1504
|
+
...super.properties,
|
|
1362
1505
|
nocheckmark: {
|
|
1363
1506
|
type: Boolean,
|
|
1364
1507
|
reflect: true
|
|
@@ -1420,6 +1563,8 @@ class AuroMenuOption extends LitElement {
|
|
|
1420
1563
|
|
|
1421
1564
|
// observer for selected property changes
|
|
1422
1565
|
updated(changedProperties) {
|
|
1566
|
+
super.updated(changedProperties);
|
|
1567
|
+
|
|
1423
1568
|
if (changedProperties.has('selected')) {
|
|
1424
1569
|
this.setAttribute('aria-selected', this.selected.toString());
|
|
1425
1570
|
}
|
|
@@ -1441,10 +1586,19 @@ class AuroMenuOption extends LitElement {
|
|
|
1441
1586
|
return html$1`<${this.iconTag} customColor customSvg slot="icon">${svg}</${this.iconTag}>`;
|
|
1442
1587
|
}
|
|
1443
1588
|
|
|
1444
|
-
|
|
1589
|
+
/**
|
|
1590
|
+
* Logic to determine the layout of the component.
|
|
1591
|
+
* @protected
|
|
1592
|
+
* @returns {void}
|
|
1593
|
+
*/
|
|
1594
|
+
renderLayout() {
|
|
1445
1595
|
return html$1`
|
|
1446
|
-
|
|
1447
|
-
|
|
1596
|
+
<div class="wrapper">
|
|
1597
|
+
${this.selected && !this.nocheckmark
|
|
1598
|
+
? this.generateIconHtml(checkmarkIcon.svg)
|
|
1599
|
+
: undefined}
|
|
1600
|
+
<slot></slot>
|
|
1601
|
+
</div>
|
|
1448
1602
|
`;
|
|
1449
1603
|
}
|
|
1450
1604
|
}
|