@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.
|
|
@@ -143,14 +238,17 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
143
238
|
* @slot - Slot for insertion of menu options.
|
|
144
239
|
*/
|
|
145
240
|
|
|
146
|
-
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens */
|
|
241
|
+
/* eslint-disable no-magic-numbers, max-lines, no-extra-parens, no-inline-comments, line-comment-position */
|
|
147
242
|
|
|
148
|
-
class AuroMenu extends
|
|
243
|
+
class AuroMenu extends AuroElement$1 {
|
|
149
244
|
constructor() {
|
|
150
245
|
super();
|
|
151
246
|
|
|
152
247
|
// State properties (reactive)
|
|
153
248
|
|
|
249
|
+
this.shape = ""; // box, rounded, pill
|
|
250
|
+
this.size = ""; // md, lg, xl
|
|
251
|
+
|
|
154
252
|
// Value of the selected options
|
|
155
253
|
this.value = undefined;
|
|
156
254
|
// Currently selected option
|
|
@@ -209,6 +307,7 @@ class AuroMenu extends LitElement {
|
|
|
209
307
|
|
|
210
308
|
static get properties() {
|
|
211
309
|
return {
|
|
310
|
+
...super.properties,
|
|
212
311
|
noCheckmark: {
|
|
213
312
|
type: Boolean,
|
|
214
313
|
reflect: true,
|
|
@@ -242,6 +341,16 @@ class AuroMenu extends LitElement {
|
|
|
242
341
|
value: {
|
|
243
342
|
// Allow string, string[] arrays and undefined
|
|
244
343
|
type: Object
|
|
344
|
+
},
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Indent level for submenus.
|
|
348
|
+
* @private
|
|
349
|
+
*/
|
|
350
|
+
level: {
|
|
351
|
+
type: Number,
|
|
352
|
+
reflect: false,
|
|
353
|
+
attribute: false
|
|
245
354
|
}
|
|
246
355
|
};
|
|
247
356
|
}
|
|
@@ -294,12 +403,15 @@ class AuroMenu extends LitElement {
|
|
|
294
403
|
}
|
|
295
404
|
|
|
296
405
|
updated(changedProperties) {
|
|
406
|
+
super.updated(changedProperties);
|
|
407
|
+
|
|
297
408
|
if (changedProperties.has('multiSelect')) {
|
|
298
409
|
// Reset selection if multiSelect mode changes
|
|
299
410
|
this.clearSelection();
|
|
300
411
|
}
|
|
301
412
|
|
|
302
|
-
|
|
413
|
+
|
|
414
|
+
if (changedProperties.has("value")) {
|
|
303
415
|
// Handle null/undefined case
|
|
304
416
|
if (this.value === undefined || this.value === null) {
|
|
305
417
|
this.optionSelected = undefined;
|
|
@@ -367,6 +479,19 @@ class AuroMenu extends LitElement {
|
|
|
367
479
|
this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]').forEach((element) => element.setAttribute('noCheckmark', ''));
|
|
368
480
|
}
|
|
369
481
|
|
|
482
|
+
// Handle layout propagation to all menus and options
|
|
483
|
+
const propagationTargets = this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]');
|
|
484
|
+
[
|
|
485
|
+
'size',
|
|
486
|
+
'shape'
|
|
487
|
+
].forEach((prop) => {
|
|
488
|
+
if (changedProperties.has(prop)) {
|
|
489
|
+
propagationTargets.forEach((el) => {
|
|
490
|
+
el.setAttribute(prop, this[prop]);
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
|
|
370
495
|
// Regex for matchWord if needed
|
|
371
496
|
let regexWord = null;
|
|
372
497
|
|
|
@@ -563,21 +688,20 @@ class AuroMenu extends LitElement {
|
|
|
563
688
|
* @param {HTMLElement} menu - Root menu element.
|
|
564
689
|
*/
|
|
565
690
|
handleNestedMenus(menu) {
|
|
566
|
-
|
|
691
|
+
menu.level = menu.parentElement.level >= 0 ? menu.parentElement.level + 1 : 0;
|
|
567
692
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
if (!
|
|
572
|
-
|
|
693
|
+
if (menu.level > 0) {
|
|
694
|
+
menu.setAttribute('role', 'group');
|
|
695
|
+
menu.removeAttribute("root");
|
|
696
|
+
if (!menu.hasAttribute('aria-label')) {
|
|
697
|
+
menu.setAttribute('aria-label', 'submenu');
|
|
573
698
|
}
|
|
699
|
+
}
|
|
574
700
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
this.handleNestedMenus(nestedMenu);
|
|
701
|
+
const options = menu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption]');
|
|
702
|
+
options.forEach((option) => {
|
|
703
|
+
const regex = new RegExp(this.nestingSpacer, "gu");
|
|
704
|
+
option.innerHTML = this.nestingSpacer.repeat(menu.level) + option.innerHTML.replace(regex, '');
|
|
581
705
|
});
|
|
582
706
|
}
|
|
583
707
|
|
|
@@ -819,28 +943,39 @@ class AuroMenu extends LitElement {
|
|
|
819
943
|
}
|
|
820
944
|
|
|
821
945
|
/**
|
|
822
|
-
*
|
|
823
|
-
* @
|
|
946
|
+
* Logic to determine the layout of the component.
|
|
947
|
+
* @protected
|
|
948
|
+
* @returns {void}
|
|
824
949
|
*/
|
|
825
|
-
|
|
950
|
+
renderLayout() {
|
|
826
951
|
if (this.loading) {
|
|
827
952
|
return html`
|
|
828
|
-
<
|
|
829
|
-
<
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
953
|
+
<div class="wrapper">
|
|
954
|
+
<auro-menuoption
|
|
955
|
+
disabled
|
|
956
|
+
loadingplaceholder
|
|
957
|
+
class="${this.hasLoadingPlaceholder ? "" : "empty"}"
|
|
958
|
+
>
|
|
959
|
+
<div>
|
|
960
|
+
<slot name="loadingIcon"></slot>
|
|
961
|
+
<slot name="loadingText"></slot>
|
|
962
|
+
</div>
|
|
963
|
+
</auro-menuoption>
|
|
964
|
+
</div>
|
|
834
965
|
`;
|
|
835
966
|
}
|
|
836
967
|
|
|
837
|
-
return html
|
|
968
|
+
return html`
|
|
969
|
+
<div class="wrapper">
|
|
970
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
971
|
+
</div>
|
|
972
|
+
`;
|
|
838
973
|
}
|
|
839
974
|
}
|
|
840
975
|
|
|
841
|
-
var styleCss$1 = css`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-
|
|
976
|
+
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}`;
|
|
842
977
|
|
|
843
|
-
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)}`;
|
|
978
|
+
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)}`;
|
|
844
979
|
|
|
845
980
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
846
981
|
// See LICENSE in the project root for license information.
|
|
@@ -1228,8 +1363,12 @@ class AuroIcon extends BaseIcon {
|
|
|
1228
1363
|
async firstUpdated() {
|
|
1229
1364
|
await super.firstUpdated();
|
|
1230
1365
|
|
|
1231
|
-
|
|
1232
|
-
|
|
1366
|
+
/**
|
|
1367
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
1368
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
1369
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
1370
|
+
*/
|
|
1371
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
1233
1372
|
const svgDesc = this.svg.querySelector('desc');
|
|
1234
1373
|
|
|
1235
1374
|
if (svgDesc) {
|
|
@@ -1273,7 +1412,7 @@ class AuroIcon extends BaseIcon {
|
|
|
1273
1412
|
}
|
|
1274
1413
|
}
|
|
1275
1414
|
|
|
1276
|
-
var iconVersion = '8.0.
|
|
1415
|
+
var iconVersion = '8.0.4';
|
|
1277
1416
|
|
|
1278
1417
|
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>"};
|
|
1279
1418
|
|
|
@@ -1291,10 +1430,13 @@ var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlin
|
|
|
1291
1430
|
* @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
|
|
1292
1431
|
* @slot - Specifies text for an option, but is not the value.
|
|
1293
1432
|
*/
|
|
1294
|
-
class AuroMenuOption extends
|
|
1433
|
+
class AuroMenuOption extends AuroElement$1 {
|
|
1295
1434
|
constructor() {
|
|
1296
1435
|
super();
|
|
1297
1436
|
|
|
1437
|
+
this.size = ""; // md, lg, xl
|
|
1438
|
+
this.shape = ""; // box, rounded, pill
|
|
1439
|
+
|
|
1298
1440
|
/**
|
|
1299
1441
|
* Generate unique names for dependency components.
|
|
1300
1442
|
*/
|
|
@@ -1318,6 +1460,7 @@ class AuroMenuOption extends LitElement {
|
|
|
1318
1460
|
|
|
1319
1461
|
static get properties() {
|
|
1320
1462
|
return {
|
|
1463
|
+
...super.properties,
|
|
1321
1464
|
nocheckmark: {
|
|
1322
1465
|
type: Boolean,
|
|
1323
1466
|
reflect: true
|
|
@@ -1379,6 +1522,8 @@ class AuroMenuOption extends LitElement {
|
|
|
1379
1522
|
|
|
1380
1523
|
// observer for selected property changes
|
|
1381
1524
|
updated(changedProperties) {
|
|
1525
|
+
super.updated(changedProperties);
|
|
1526
|
+
|
|
1382
1527
|
if (changedProperties.has('selected')) {
|
|
1383
1528
|
this.setAttribute('aria-selected', this.selected.toString());
|
|
1384
1529
|
}
|
|
@@ -1400,10 +1545,19 @@ class AuroMenuOption extends LitElement {
|
|
|
1400
1545
|
return html$1`<${this.iconTag} customColor customSvg slot="icon">${svg}</${this.iconTag}>`;
|
|
1401
1546
|
}
|
|
1402
1547
|
|
|
1403
|
-
|
|
1548
|
+
/**
|
|
1549
|
+
* Logic to determine the layout of the component.
|
|
1550
|
+
* @protected
|
|
1551
|
+
* @returns {void}
|
|
1552
|
+
*/
|
|
1553
|
+
renderLayout() {
|
|
1404
1554
|
return html$1`
|
|
1405
|
-
|
|
1406
|
-
|
|
1555
|
+
<div class="wrapper">
|
|
1556
|
+
${this.selected && !this.nocheckmark
|
|
1557
|
+
? this.generateIconHtml(checkmarkIcon.svg)
|
|
1558
|
+
: undefined}
|
|
1559
|
+
<slot></slot>
|
|
1560
|
+
</div>
|
|
1407
1561
|
`;
|
|
1408
1562
|
}
|
|
1409
1563
|
}
|
|
@@ -239,8 +239,8 @@ class AuroRadio extends i$2 {
|
|
|
239
239
|
},
|
|
240
240
|
|
|
241
241
|
/**
|
|
242
|
+
* ID for input node.
|
|
242
243
|
* @private
|
|
243
|
-
* id for input node
|
|
244
244
|
*/
|
|
245
245
|
inputId: {
|
|
246
246
|
type: String,
|
|
@@ -1136,7 +1136,9 @@ class AuroFormValidation {
|
|
|
1136
1136
|
elem.validity = this.auroInputElements[0].validity;
|
|
1137
1137
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
1138
1138
|
|
|
1139
|
-
|
|
1139
|
+
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1140
|
+
// combobox's 2nd input will have noValidate set true.
|
|
1141
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !this.auroInputElements[1].noValidate) {
|
|
1140
1142
|
elem.validity = this.auroInputElements[1].validity;
|
|
1141
1143
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
1142
1144
|
}
|
|
@@ -214,8 +214,8 @@ class AuroRadio extends i$2 {
|
|
|
214
214
|
},
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
|
+
* ID for input node.
|
|
217
218
|
* @private
|
|
218
|
-
* id for input node
|
|
219
219
|
*/
|
|
220
220
|
inputId: {
|
|
221
221
|
type: String,
|
|
@@ -1111,7 +1111,9 @@ class AuroFormValidation {
|
|
|
1111
1111
|
elem.validity = this.auroInputElements[0].validity;
|
|
1112
1112
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
1113
1113
|
|
|
1114
|
-
|
|
1114
|
+
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1115
|
+
// combobox's 2nd input will have noValidate set true.
|
|
1116
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !this.auroInputElements[1].noValidate) {
|
|
1115
1117
|
elem.validity = this.auroInputElements[1].validity;
|
|
1116
1118
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
1117
1119
|
}
|
|
@@ -174,8 +174,8 @@ class AuroRadio extends LitElement {
|
|
|
174
174
|
},
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
|
+
* ID for input node.
|
|
177
178
|
* @private
|
|
178
|
-
* id for input node
|
|
179
179
|
*/
|
|
180
180
|
inputId: {
|
|
181
181
|
type: String,
|
|
@@ -1064,7 +1064,9 @@ class AuroFormValidation {
|
|
|
1064
1064
|
elem.validity = this.auroInputElements[0].validity;
|
|
1065
1065
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
1066
1066
|
|
|
1067
|
-
|
|
1067
|
+
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1068
|
+
// combobox's 2nd input will have noValidate set true.
|
|
1069
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !this.auroInputElements[1].noValidate) {
|
|
1068
1070
|
elem.validity = this.auroInputElements[1].validity;
|
|
1069
1071
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
1070
1072
|
}
|
|
@@ -174,8 +174,8 @@ class AuroRadio extends LitElement {
|
|
|
174
174
|
},
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
|
+
* ID for input node.
|
|
177
178
|
* @private
|
|
178
|
-
* id for input node
|
|
179
179
|
*/
|
|
180
180
|
inputId: {
|
|
181
181
|
type: String,
|
|
@@ -1064,7 +1064,9 @@ class AuroFormValidation {
|
|
|
1064
1064
|
elem.validity = this.auroInputElements[0].validity;
|
|
1065
1065
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
1066
1066
|
|
|
1067
|
-
|
|
1067
|
+
// combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
|
|
1068
|
+
// combobox's 2nd input will have noValidate set true.
|
|
1069
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !this.auroInputElements[1].noValidate) {
|
|
1068
1070
|
elem.validity = this.auroInputElements[1].validity;
|
|
1069
1071
|
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
1070
1072
|
}
|
|
@@ -20,12 +20,11 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
|
|
|
20
20
|
| [autocomplete](#autocomplete) | `autocomplete` | `string` | | If declared, sets the autocomplete attribute for the select element. |
|
|
21
21
|
| [disabled](#disabled) | `disabled` | `boolean` | | When attribute is present, element shows disabled state. |
|
|
22
22
|
| [error](#error) | `error` | `string` | | When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value. |
|
|
23
|
-
| [flexMenuWidth](#flexMenuWidth) | `flexMenuWidth` | `boolean` | | If set, makes dropdown width match the size of the content, rather than the width of the trigger. |
|
|
24
23
|
| [forceDisplayValue](#forceDisplayValue) | `forceDisplayValue` | `boolean` | false | If declared, the label and value will be visually hidden and the displayValue will render 100% of the time. |
|
|
25
24
|
| [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | `string` | "sm" | Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)<br />at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.<br /><br />When expanded, the dropdown will automatically display in fullscreen mode<br />if the screen size is equal to or smaller than the selected breakpoint. |
|
|
26
25
|
| [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | `boolean` | | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600. |
|
|
27
|
-
| [layout](#layout) | | `string` | "
|
|
28
|
-
| [matchWidth](#matchWidth) | `matchWidth` | `boolean` |
|
|
26
|
+
| [layout](#layout) | | `string` | "snowflake" | |
|
|
27
|
+
| [matchWidth](#matchWidth) | `matchWidth` | `boolean` | false | If declared, the popover and trigger will be set to the same width. |
|
|
29
28
|
| [multiSelect](#multiSelect) | `multiselect` | `boolean` | | Sets multi-select mode, allowing multiple options to be selected at once. |
|
|
30
29
|
| [name](#name) | `name` | `string` | | The name for the select element. |
|
|
31
30
|
| [noCheckmark](#noCheckmark) | `noCheckmark` | `boolean` | | When true, checkmark on selected option will no longer be present. |
|
|
@@ -34,12 +33,12 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
|
|
|
34
33
|
| [offset](#offset) | `offset` | `number` | "0" | Gap between the trigger element and bib. |
|
|
35
34
|
| [onDark](#onDark) | `onDark` | `boolean` | | If declared, onDark styles will be applied to the trigger. |
|
|
36
35
|
| [optionSelected](#optionSelected) | `optionSelected` | `HTMLElement\|Array<HTMLElement>` | | Specifies the current selected menuOption. Default type is `HTMLElement`, changing to `Array<HTMLElement>` when `multiSelect` is true. |
|
|
37
|
-
| [placement](#placement) | `placement` | `string` | "bottom-start" | Position where the bib should appear relative to the trigger.<br />Accepted values:<br />"top" \| "right" \| "bottom" \| "left" \|<br />"bottom-start" \| "top-start" \| "top-end" \|<br />"right-start" \| "right-end" \| "bottom-end" \|<br />"left-start" \| "left-end" |
|
|
36
|
+
| [placement](#placement) | `placement` | `string` | "bottom-start" | Position where the bib should appear relative to the trigger.<br />Accepted values:<br />"top" \| "right" \| "bottom" \| "left" \|<br />"bottom-start" \| "top-start" \| "top-end" \|<br />"right-start" \| "right-end" \| "bottom-end" \|<br />"left-start" \| "left-end". |
|
|
38
37
|
| [required](#required) | `required` | `boolean` | | Populates the `required` attribute on the element. Used for client-side validation. |
|
|
39
38
|
| [setCustomValidity](#setCustomValidity) | `setCustomValidity` | `string` | | Sets a custom help text message to display for all validityStates. |
|
|
40
39
|
| [setCustomValidityCustomError](#setCustomValidityCustomError) | `setCustomValidityCustomError` | `string` | | Custom help text message to display when validity = `customError`. |
|
|
41
40
|
| [setCustomValidityValueMissing](#setCustomValidityValueMissing) | `setCustomValidityValueMissing` | `string` | | Custom help text message to display when validity = `valueMissing`. |
|
|
42
|
-
| [shape](#shape) | | `string` | "
|
|
41
|
+
| [shape](#shape) | | `string` | "snowflake" | |
|
|
43
42
|
| [size](#size) | | `string` | "xl" | |
|
|
44
43
|
| [validity](#validity) | `validity` | `string` | | Specifies the `validityState` this element is in. |
|
|
45
44
|
| [value](#value) | `value` | `String\|Array<String>` | | Value selected for the component. Default type is `String`, changing to `Array<String>` when `multiSelect` is true. |
|
|
@@ -68,6 +67,7 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
|
|
|
68
67
|
|---------------------------|--------------------------------------------------|
|
|
69
68
|
| | Default slot for the menu content. |
|
|
70
69
|
| `bib.fullscreen.headline` | Defines the headline to display above menu-options |
|
|
70
|
+
| [displayValue](#displayValue) | Allows custom HTML content to display the selected value when select is not focused. |
|
|
71
71
|
| [helpText](#helpText) | Defines the content of the helpText. |
|
|
72
72
|
| [label](#label) | Defines the content of the label. |
|
|
73
73
|
| [placeholder](#placeholder) | Defines the content of the placeholder to be shown when there is no value |
|