@aurodesignsystem/auro-formkit 2.0.0-beta.10 → 2.0.0-beta.11
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/.turbo/cache/0c8124a987c1cc05-meta.json +1 -1
- package/.turbo/cache/0cd512cdf86242c7-meta.json +1 -0
- package/.turbo/cache/{ff4dbfffc29255ab.tar.zst → 0cd512cdf86242c7.tar.zst} +0 -0
- package/.turbo/cache/123c83cd8727dff3-meta.json +1 -0
- package/.turbo/cache/123c83cd8727dff3.tar.zst +0 -0
- package/.turbo/cache/18129dba20f51b6b-meta.json +1 -1
- package/.turbo/cache/253e861af7025ed4-meta.json +1 -0
- package/.turbo/cache/253e861af7025ed4.tar.zst +0 -0
- package/.turbo/cache/2787020e69f50af2-meta.json +1 -1
- package/.turbo/cache/2a5295c8f561ed84-meta.json +1 -0
- package/.turbo/cache/2c0d681132c153dd-meta.json +1 -1
- package/.turbo/cache/4006a206400d5c7b-meta.json +1 -1
- package/.turbo/cache/492dda333b8d15f1-meta.json +1 -1
- package/.turbo/cache/4e3619d9dfc86809-meta.json +1 -0
- package/.turbo/cache/4e3619d9dfc86809.tar.zst +0 -0
- package/.turbo/cache/50993de942ec15a9-meta.json +1 -1
- package/.turbo/cache/50cd7dcfc9f820c5-meta.json +1 -0
- package/.turbo/cache/50cd7dcfc9f820c5.tar.zst +0 -0
- package/.turbo/cache/51eaa58d5c167de8-meta.json +1 -1
- package/.turbo/cache/5a0d3e26da304c62-meta.json +1 -0
- package/.turbo/cache/5a0d3e26da304c62.tar.zst +0 -0
- package/.turbo/cache/5c960af698582835-meta.json +1 -0
- package/.turbo/cache/5c960af698582835.tar.zst +0 -0
- package/.turbo/cache/5dbbb71dffc3f542-meta.json +1 -0
- package/.turbo/cache/5dbbb71dffc3f542.tar.zst +0 -0
- package/.turbo/cache/6081837e8943b62e-meta.json +1 -1
- package/.turbo/cache/60ad74320c682a2b-meta.json +1 -1
- package/.turbo/cache/61e218aba69cff58-meta.json +1 -1
- package/.turbo/cache/77da375a012de9d0-meta.json +1 -1
- package/.turbo/cache/7964d1656e9e702a-meta.json +1 -0
- package/.turbo/cache/7964d1656e9e702a.tar.zst +0 -0
- package/.turbo/cache/7bf2b06a479d0b30-meta.json +1 -1
- package/.turbo/cache/7c9ca6163e61285c-meta.json +1 -1
- package/.turbo/cache/80aca269cd346fb4-meta.json +1 -0
- package/.turbo/cache/80aca269cd346fb4.tar.zst +0 -0
- package/.turbo/cache/8602fc2bb737a5cf-meta.json +1 -0
- package/.turbo/cache/89e0e7a6148e854f-meta.json +1 -0
- package/.turbo/cache/89e0e7a6148e854f.tar.zst +0 -0
- package/.turbo/cache/8bb856bd31b5b479-meta.json +1 -1
- package/.turbo/cache/93c887fb93a10daa-meta.json +1 -0
- package/.turbo/cache/93c887fb93a10daa.tar.zst +0 -0
- package/.turbo/cache/94dae2a64e9d8356-meta.json +1 -0
- package/.turbo/cache/97f6fe83b54acf09-meta.json +1 -0
- package/.turbo/cache/{080ca6155e637d5d.tar.zst → 97f6fe83b54acf09.tar.zst} +0 -0
- package/.turbo/cache/98317b0d14d94df7-meta.json +1 -0
- package/.turbo/cache/98317b0d14d94df7.tar.zst +0 -0
- package/.turbo/cache/9ae99e8e7bd83d06-meta.json +1 -1
- package/.turbo/cache/9cbcd13b1d031f63-meta.json +1 -0
- package/.turbo/cache/{8af27c076dc010c3.tar.zst → 9cbcd13b1d031f63.tar.zst} +0 -0
- package/.turbo/cache/afbbd49ed1a558b9-meta.json +1 -0
- package/.turbo/cache/b353ce8f6da43dea-meta.json +1 -0
- package/.turbo/cache/b5e6dc7fb9ae1a2f-meta.json +1 -1
- package/.turbo/cache/b6a202cc85cb61a0-meta.json +1 -1
- package/.turbo/cache/b8db059a9b9ccb5d-meta.json +1 -0
- package/.turbo/cache/bc24a38aa1b1a102-meta.json +1 -0
- package/.turbo/cache/be0b95293ea517cc-meta.json +1 -1
- package/.turbo/cache/c3a4f7a3565d6706-meta.json +1 -0
- package/.turbo/cache/c3a4f7a3565d6706.tar.zst +0 -0
- package/.turbo/cache/c44efc9e4ddd8a0e-meta.json +1 -1
- package/.turbo/cache/c6c6411199b68170-meta.json +1 -1
- package/.turbo/cache/c97b043e748e3580-meta.json +1 -0
- package/.turbo/cache/d5db503b2eaf239c-meta.json +1 -1
- package/.turbo/cache/d775555355d6b8fc-meta.json +1 -1
- package/.turbo/cache/d7c3007be148d2a1-meta.json +1 -1
- package/.turbo/cache/dad3d78b33edd9e4-meta.json +1 -1
- package/.turbo/cache/dc597b3ea4f61ec8-meta.json +1 -0
- package/.turbo/cache/dc597b3ea4f61ec8.tar.zst +0 -0
- package/.turbo/cache/df40b180126e5351-meta.json +1 -0
- package/.turbo/cache/df40b180126e5351.tar.zst +0 -0
- package/.turbo/cache/e5f217f77c32c93b-meta.json +1 -0
- package/.turbo/cache/{c2b51643f886a493.tar.zst → e5f217f77c32c93b.tar.zst} +0 -0
- package/.turbo/cache/e62cfee068e3ef36-meta.json +1 -1
- package/.turbo/cache/e9e36823f6c98f07-meta.json +1 -1
- package/.turbo/cache/ee1a3c1fe389da51-meta.json +1 -0
- package/.turbo/cache/f3c7b40f2c6a4094-meta.json +1 -0
- package/.turbo/cache/{b22ca87b2f7f9cc2.tar.zst → f3c7b40f2c6a4094.tar.zst} +0 -0
- package/.turbo/cache/f5958c3acb889631-meta.json +1 -0
- package/.turbo/cache/fb3809ac3f90e3b2-meta.json +1 -0
- package/.turbo/cache/{eb1dbe885532c1dc.tar.zst → fb3809ac3f90e3b2.tar.zst} +0 -0
- package/.turbo/cache/fd5ddfa43ebd8e5c-meta.json +1 -0
- package/.turbo/cache/fd5ddfa43ebd8e5c.tar.zst +0 -0
- package/CHANGELOG.md +13 -0
- package/components/checkbox/.turbo/turbo-build.log +3 -3
- package/components/checkbox/.turbo/turbo-bundler.log +3 -3
- package/components/checkbox/README.md +1 -1
- package/components/combobox/.turbo/turbo-build.log +3 -3
- package/components/combobox/README.md +4 -4
- package/components/combobox/demo/api.md +9 -9
- package/components/combobox/demo/api.min.js +2508 -642
- package/components/combobox/demo/index.min.js +2505 -639
- package/components/combobox/dist/auro-combobox.d.ts +9 -4
- package/components/combobox/dist/auro-combobox.d.ts.map +1 -1
- package/components/combobox/dist/index.js +1863 -312
- package/components/combobox/src/auro-combobox.js +70 -26
- package/components/counter/.turbo/turbo-build.log +3 -3
- package/components/counter/.turbo/turbo-bundler.log +3 -3
- package/components/counter/README.md +1 -1
- package/components/datepicker/.turbo/turbo-build.log +3 -3
- package/components/datepicker/README.md +4 -4
- package/components/dropdown/.turbo/turbo-build.log +3 -3
- package/components/dropdown/.turbo/turbo-bundler.log +2 -2
- package/components/dropdown/README.md +1 -1
- package/components/form/.turbo/turbo-build.log +3 -3
- package/components/form/.turbo/turbo-bundler.log +3 -3
- package/components/form/README.md +1 -1
- package/components/input/.turbo/turbo-build.log +3 -3
- package/components/input/.turbo/turbo-bundler.log +3 -3
- package/components/input/README.md +1 -1
- package/components/menu/.turbo/turbo-build.log +4 -2
- package/components/menu/.turbo/turbo-bundler.log +3 -3
- package/components/menu/README.md +1 -1
- package/components/menu/demo/api.md +57 -20
- package/components/menu/demo/api.min.js +620 -305
- package/components/menu/demo/index.min.js +618 -303
- package/components/menu/dist/auro-menu-utils.d.ts +43 -0
- package/components/menu/dist/auro-menu-utils.d.ts.map +1 -0
- package/components/menu/dist/auro-menu.d.ts +97 -81
- package/components/menu/dist/auro-menu.d.ts.map +1 -1
- package/components/menu/dist/index.d.ts +1 -0
- package/components/menu/dist/index.js +619 -304
- package/components/menu/src/auro-menu-utils.js +131 -0
- package/components/menu/src/auro-menu.js +493 -303
- package/components/menu/src/index.js +7 -0
- package/components/radio/.turbo/turbo-build.log +3 -3
- package/components/radio/.turbo/turbo-bundler.log +3 -3
- package/components/radio/README.md +1 -1
- package/components/select/.turbo/turbo-build.log +5 -3
- package/components/select/README.md +3 -3
- package/components/select/demo/api.md +46 -11
- package/components/select/demo/api.min.js +2336 -485
- package/components/select/demo/index.min.js +2337 -486
- package/components/select/dist/auro-select.d.ts +17 -6
- package/components/select/dist/auro-select.d.ts.map +1 -1
- package/components/select/dist/index.js +1706 -170
- package/components/select/src/auro-select.js +53 -24
- package/components/select/src/styles/style-css.js +1 -1
- package/components/select/src/styles/style.css +7 -0
- package/components/select/src/styles/style.scss +13 -0
- package/package.json +1 -1
- package/.turbo/cache/026e4d886ba97e63-meta.json +0 -1
- package/.turbo/cache/026e4d886ba97e63.tar.zst +0 -0
- package/.turbo/cache/080ca6155e637d5d-meta.json +0 -1
- package/.turbo/cache/0b115e30ff606299-meta.json +0 -1
- package/.turbo/cache/0b115e30ff606299.tar.zst +0 -0
- package/.turbo/cache/1c630fb3411e4a41-meta.json +0 -1
- package/.turbo/cache/24b19ac5895e5dd6-meta.json +0 -1
- package/.turbo/cache/24b19ac5895e5dd6.tar.zst +0 -0
- package/.turbo/cache/29b72c73cbccb53d-meta.json +0 -1
- package/.turbo/cache/29b72c73cbccb53d.tar.zst +0 -0
- package/.turbo/cache/3e647c5863d32e6f-meta.json +0 -1
- package/.turbo/cache/3e647c5863d32e6f.tar.zst +0 -0
- package/.turbo/cache/43f5206cc4e69b44-meta.json +0 -1
- package/.turbo/cache/4a85ec226b585fd5-meta.json +0 -1
- package/.turbo/cache/50a29c70b93c57dd-meta.json +0 -1
- package/.turbo/cache/50a29c70b93c57dd.tar.zst +0 -0
- package/.turbo/cache/56455145cd768755-meta.json +0 -1
- package/.turbo/cache/56455145cd768755.tar.zst +0 -0
- package/.turbo/cache/5c06332cf9f132da-meta.json +0 -1
- package/.turbo/cache/5e613afc6868d0e2-meta.json +0 -1
- package/.turbo/cache/5e613afc6868d0e2.tar.zst +0 -0
- package/.turbo/cache/639dac15b979bedc-meta.json +0 -1
- package/.turbo/cache/664c2e08614fd212-meta.json +0 -1
- package/.turbo/cache/6c51b0ebfc086faa-meta.json +0 -1
- package/.turbo/cache/6c51b0ebfc086faa.tar.zst +0 -0
- package/.turbo/cache/7216d994164825fb-meta.json +0 -1
- package/.turbo/cache/7216d994164825fb.tar.zst +0 -0
- package/.turbo/cache/83a167e135cb431a-meta.json +0 -1
- package/.turbo/cache/83a167e135cb431a.tar.zst +0 -0
- package/.turbo/cache/8af27c076dc010c3-meta.json +0 -1
- package/.turbo/cache/953c8216249d3509-meta.json +0 -1
- package/.turbo/cache/95a5e76ffd8c5110-meta.json +0 -1
- package/.turbo/cache/95a5e76ffd8c5110.tar.zst +0 -0
- package/.turbo/cache/a8b0fa0a9aa707c5-meta.json +0 -1
- package/.turbo/cache/a8b0fa0a9aa707c5.tar.zst +0 -0
- package/.turbo/cache/b22ca87b2f7f9cc2-meta.json +0 -1
- package/.turbo/cache/b7bbe2e7d44b77f0-meta.json +0 -1
- package/.turbo/cache/b7bbe2e7d44b77f0.tar.zst +0 -0
- package/.turbo/cache/c2b51643f886a493-meta.json +0 -1
- package/.turbo/cache/c74d369a0475b124-meta.json +0 -1
- package/.turbo/cache/c7f5a276ddb73cf7-meta.json +0 -1
- package/.turbo/cache/c96933d40404e4c8-meta.json +0 -1
- package/.turbo/cache/c96933d40404e4c8.tar.zst +0 -0
- package/.turbo/cache/eb1dbe885532c1dc-meta.json +0 -1
- package/.turbo/cache/f1f6744948f1b18f-meta.json +0 -1
- package/.turbo/cache/f1f6744948f1b18f.tar.zst +0 -0
- package/.turbo/cache/feefbc25d550c1cd-meta.json +0 -1
- package/.turbo/cache/ff4dbfffc29255ab-meta.json +0 -1
- /package/.turbo/cache/{639dac15b979bedc.tar.zst → 2a5295c8f561ed84.tar.zst} +0 -0
- /package/.turbo/cache/{1c630fb3411e4a41.tar.zst → 8602fc2bb737a5cf.tar.zst} +0 -0
- /package/.turbo/cache/{664c2e08614fd212.tar.zst → 94dae2a64e9d8356.tar.zst} +0 -0
- /package/.turbo/cache/{c7f5a276ddb73cf7.tar.zst → afbbd49ed1a558b9.tar.zst} +0 -0
- /package/.turbo/cache/{43f5206cc4e69b44.tar.zst → b353ce8f6da43dea.tar.zst} +0 -0
- /package/.turbo/cache/{c74d369a0475b124.tar.zst → b8db059a9b9ccb5d.tar.zst} +0 -0
- /package/.turbo/cache/{4a85ec226b585fd5.tar.zst → bc24a38aa1b1a102.tar.zst} +0 -0
- /package/.turbo/cache/{5c06332cf9f132da.tar.zst → c97b043e748e3580.tar.zst} +0 -0
- /package/.turbo/cache/{953c8216249d3509.tar.zst → ee1a3c1fe389da51.tar.zst} +0 -0
- /package/.turbo/cache/{feefbc25d550c1cd.tar.zst → f5958c3acb889631.tar.zst} +0 -0
|
@@ -19,6 +19,11 @@ import dropdownVersion from './formkit/auro-dropdownVersion.js';
|
|
|
19
19
|
import { AuroInput } from '@aurodesignsystem/auro-input';
|
|
20
20
|
import inputVersion from './formkit/auro-inputVersion.js';
|
|
21
21
|
|
|
22
|
+
import {
|
|
23
|
+
arrayConverter,
|
|
24
|
+
arrayOrUndefinedHasChanged
|
|
25
|
+
} from '@aurodesignsystem/auro-menu';
|
|
26
|
+
|
|
22
27
|
// Import touch detection lib
|
|
23
28
|
import styleCss from "./styles/style-css.js";
|
|
24
29
|
|
|
@@ -52,8 +57,8 @@ export class AuroCombobox extends LitElement {
|
|
|
52
57
|
|
|
53
58
|
this.noFilter = false;
|
|
54
59
|
this.validity = undefined;
|
|
55
|
-
this.value =
|
|
56
|
-
this.optionSelected =
|
|
60
|
+
this.value = undefined;
|
|
61
|
+
this.optionSelected = undefined;
|
|
57
62
|
|
|
58
63
|
this.privateDefaults();
|
|
59
64
|
|
|
@@ -121,7 +126,11 @@ export class AuroCombobox extends LitElement {
|
|
|
121
126
|
type: Boolean,
|
|
122
127
|
reflect: true
|
|
123
128
|
},
|
|
124
|
-
optionSelected: {
|
|
129
|
+
optionSelected: {
|
|
130
|
+
type: Object,
|
|
131
|
+
converter: arrayConverter,
|
|
132
|
+
hasChanged: arrayOrUndefinedHasChanged
|
|
133
|
+
},
|
|
125
134
|
noValidate: { type: Boolean },
|
|
126
135
|
required: {
|
|
127
136
|
type: Boolean,
|
|
@@ -136,7 +145,8 @@ export class AuroCombobox extends LitElement {
|
|
|
136
145
|
reflect: true
|
|
137
146
|
},
|
|
138
147
|
value: {
|
|
139
|
-
|
|
148
|
+
converter: arrayConverter,
|
|
149
|
+
hasChanged: arrayOrUndefinedHasChanged
|
|
140
150
|
},
|
|
141
151
|
checkmark: {
|
|
142
152
|
type: Boolean,
|
|
@@ -205,6 +215,33 @@ export class AuroCombobox extends LitElement {
|
|
|
205
215
|
this.generateOptionsArray();
|
|
206
216
|
this.availableOptions = [];
|
|
207
217
|
|
|
218
|
+
if (this.menu.optionSelected) {
|
|
219
|
+
// Get first option since combobox is single-select
|
|
220
|
+
const [selected] = this.menu.optionSelected;
|
|
221
|
+
|
|
222
|
+
if (!this.optionSelected || this.optionSelected[0] !== selected) {
|
|
223
|
+
// Store as array
|
|
224
|
+
this.optionSelected = [selected];
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (!this.value || this.value[0] !== selected.value) {
|
|
228
|
+
// Store as array
|
|
229
|
+
this.value = [selected.value];
|
|
230
|
+
// Menu already expects array
|
|
231
|
+
this.menu.value = this.value;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (this.input.value !== selected.textContent) {
|
|
235
|
+
this.input.value = selected.textContent;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (this.menu.matchWord !== this.input.value) {
|
|
239
|
+
this.menu.matchWord = this.input.value;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
this.classList.add('combobox-filled');
|
|
243
|
+
}
|
|
244
|
+
|
|
208
245
|
if (this.noFilter) {
|
|
209
246
|
this.availableOptions = [...this.options];
|
|
210
247
|
} else {
|
|
@@ -346,12 +383,15 @@ export class AuroCombobox extends LitElement {
|
|
|
346
383
|
// handle the menu event for an option selection
|
|
347
384
|
this.menu.addEventListener('auroMenu-selectedOption', () => {
|
|
348
385
|
if (this.menu.optionSelected) {
|
|
349
|
-
|
|
350
|
-
|
|
386
|
+
const [selected] = this.menu.optionSelected;
|
|
387
|
+
|
|
388
|
+
if (!this.optionSelected || this.optionSelected[0] !== selected) {
|
|
389
|
+
this.optionSelected = [selected];
|
|
351
390
|
}
|
|
352
391
|
|
|
353
|
-
if (this.value !== this.optionSelected.value) {
|
|
354
|
-
this.value = this.optionSelected.value;
|
|
392
|
+
if (!this.value || this.value[0] !== this.optionSelected[0].value) {
|
|
393
|
+
this.value = [this.optionSelected[0].value];
|
|
394
|
+
this.menu.value = this.value;
|
|
355
395
|
}
|
|
356
396
|
|
|
357
397
|
if (this.input.value !== this.optionSelected.textContent) {
|
|
@@ -387,7 +427,7 @@ export class AuroCombobox extends LitElement {
|
|
|
387
427
|
});
|
|
388
428
|
|
|
389
429
|
this.menu.addEventListener('auroMenu-selectValueFailure', () => {
|
|
390
|
-
this.
|
|
430
|
+
this.menu.clearSelection();
|
|
391
431
|
});
|
|
392
432
|
|
|
393
433
|
this.menu.addEventListener('auroMenu-selectValueReset', () => {
|
|
@@ -415,8 +455,9 @@ export class AuroCombobox extends LitElement {
|
|
|
415
455
|
this.validation.validate(this);
|
|
416
456
|
}
|
|
417
457
|
|
|
418
|
-
|
|
419
|
-
|
|
458
|
+
// Set to undefined if empty
|
|
459
|
+
if (this.value && this.value.length === 0) {
|
|
460
|
+
this.value = undefined;
|
|
420
461
|
}
|
|
421
462
|
});
|
|
422
463
|
|
|
@@ -459,10 +500,10 @@ export class AuroCombobox extends LitElement {
|
|
|
459
500
|
|
|
460
501
|
let hasChange = false;
|
|
461
502
|
|
|
462
|
-
|
|
463
|
-
|
|
503
|
+
// Store value as array or undefined
|
|
504
|
+
if (!this.value || this.value[0] !== this.input.value) {
|
|
505
|
+
this.value = this.input.value ? [this.input.value] : undefined;
|
|
464
506
|
hasChange = true;
|
|
465
|
-
|
|
466
507
|
this.dispatchEvent(new CustomEvent('auroCombobox-valueSet', {
|
|
467
508
|
bubbles: true,
|
|
468
509
|
cancelable: false,
|
|
@@ -484,23 +525,23 @@ export class AuroCombobox extends LitElement {
|
|
|
484
525
|
return;
|
|
485
526
|
}
|
|
486
527
|
|
|
487
|
-
this.menu.
|
|
528
|
+
this.menu.clearSelection();
|
|
488
529
|
this.handleMenuOptions();
|
|
489
530
|
|
|
490
|
-
//
|
|
531
|
+
// Validate only if the value was set programmatically
|
|
491
532
|
if (document.activeElement !== this) {
|
|
492
533
|
this.validation.validate(this);
|
|
493
534
|
}
|
|
494
535
|
|
|
495
|
-
//
|
|
536
|
+
// Hide menu if value is empty, otherwise show if there are available suggestions
|
|
496
537
|
if (this.input.value && this.input.value.length === 0) {
|
|
497
538
|
this.hideBib();
|
|
498
539
|
this.classList.remove('combobox-filled');
|
|
499
540
|
} else if (!this.dropdown.isPopoverVisible && this.availableOptions) {
|
|
500
541
|
const hasFocus = this.contains(document.activeElement);
|
|
501
542
|
|
|
502
|
-
//
|
|
503
|
-
//
|
|
543
|
+
// If focus is within the combobox, show bib
|
|
544
|
+
// Prevent bib from being shown while loading & presetting the value
|
|
504
545
|
if (hasFocus) {
|
|
505
546
|
this.showBib();
|
|
506
547
|
}
|
|
@@ -508,7 +549,7 @@ export class AuroCombobox extends LitElement {
|
|
|
508
549
|
this.classList.add('combobox-filled');
|
|
509
550
|
}
|
|
510
551
|
|
|
511
|
-
//
|
|
552
|
+
// Force dropdown bib to hide if input value has no matching suggestions
|
|
512
553
|
if (!this.availableOptions || this.availableOptions.length === 0) {
|
|
513
554
|
this.hideBib();
|
|
514
555
|
}
|
|
@@ -548,11 +589,11 @@ export class AuroCombobox extends LitElement {
|
|
|
548
589
|
|
|
549
590
|
if (this.dropdown.isPopoverVisible) {
|
|
550
591
|
if (evt.key === 'ArrowUp') {
|
|
551
|
-
this.menu.
|
|
592
|
+
this.menu.navigateOptions('up');
|
|
552
593
|
}
|
|
553
594
|
|
|
554
595
|
if (evt.key === 'ArrowDown') {
|
|
555
|
-
this.menu.
|
|
596
|
+
this.menu.navigateOptions('down');
|
|
556
597
|
}
|
|
557
598
|
}
|
|
558
599
|
});
|
|
@@ -611,20 +652,23 @@ export class AuroCombobox extends LitElement {
|
|
|
611
652
|
reset() {
|
|
612
653
|
this.input.reset();
|
|
613
654
|
this.validation.reset(this);
|
|
655
|
+
this.menu.value = undefined;
|
|
614
656
|
}
|
|
615
657
|
|
|
616
658
|
updated(changedProperties) {
|
|
617
659
|
// After the component is ready, send direct value changes to auro-menu.
|
|
618
660
|
if (changedProperties.has('value')) {
|
|
619
661
|
if (this.value) {
|
|
620
|
-
if (this.optionSelected && this.optionSelected.value === this.value) {
|
|
662
|
+
if (this.optionSelected && this.optionSelected[0] && this.optionSelected[0].value === this.value[0]) {
|
|
621
663
|
// If value updates and the previously selected option already matches the new value
|
|
622
664
|
// just update the input value to use the textContent of the optionSelected
|
|
623
|
-
this.input.value = this.optionSelected.textContent;
|
|
665
|
+
this.input.value = this.optionSelected[0].textContent;
|
|
624
666
|
} else {
|
|
625
667
|
// Otherwise just enter the value into the input
|
|
626
668
|
this.optionSelected = undefined;
|
|
627
|
-
|
|
669
|
+
// Use first value since combobox is single-select
|
|
670
|
+
const [inputValue] = this.value;
|
|
671
|
+
this.input.value = inputValue;
|
|
628
672
|
|
|
629
673
|
// If the value got set programmatically make sure we hide the bib
|
|
630
674
|
if (!this.contains(document.activeElement)) {
|
|
@@ -646,7 +690,7 @@ export class AuroCombobox extends LitElement {
|
|
|
646
690
|
/**
|
|
647
691
|
* Watch for slot changes and recalculate the menuoptions.
|
|
648
692
|
* @private
|
|
649
|
-
* @param {Event} event - slotchange event
|
|
693
|
+
* @param {Event} event - `slotchange` event.
|
|
650
694
|
* @returns {void}
|
|
651
695
|
*/
|
|
652
696
|
handleSlotChange(event) {
|
|
@@ -302,13 +302,13 @@ Complete!
|
|
|
302
302
|
|
|
303
303
|
[36m
|
|
304
304
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
305
|
-
[32mcreated [1mdist[22m in [1m1.
|
|
305
|
+
[32mcreated [1mdist[22m in [1m1.1s[22m[39m
|
|
306
306
|
[36m
|
|
307
307
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
308
|
-
[32mcreated [1m./demo/[22m in [
|
|
308
|
+
[32mcreated [1m./demo/[22m in [1m1.3s[22m[39m
|
|
309
309
|
[36m
|
|
310
310
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
311
|
-
[32mcreated [1m./demo/[22m in [
|
|
311
|
+
[32mcreated [1m./demo/[22m in [1m712ms[22m[39m
|
|
312
312
|
|
|
313
313
|
> @aurodesignsystem/auro-counter@1.0.0 build:docs
|
|
314
314
|
> wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component counter
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
[36m
|
|
6
6
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
7
|
-
[32mcreated [1mdist[22m in [
|
|
7
|
+
[32mcreated [1mdist[22m in [1m1.1s[22m[39m
|
|
8
8
|
[36m
|
|
9
9
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
10
|
-
[32mcreated [1m./demo/[22m in [
|
|
10
|
+
[32mcreated [1m./demo/[22m in [1m882ms[22m[39m
|
|
11
11
|
[36m
|
|
12
12
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
13
|
-
[32mcreated [1m./demo/[22m in [
|
|
13
|
+
[32mcreated [1m./demo/[22m in [1m651ms[22m[39m
|
|
@@ -100,7 +100,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
100
100
|
<!-- The below content is automatically added from ../../docs/templates/componentBundleUseModBrowsers.md -->
|
|
101
101
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.12.1/dist/tokens/CSSCustomProperties.css" />
|
|
102
102
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
|
|
103
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-counter@2.0.0-beta.
|
|
103
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-counter@2.0.0-beta.10/dist/auro-counter__bundled.js" type="module"></script>
|
|
104
104
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
105
105
|
|
|
106
106
|
## auro-counter use cases
|
|
@@ -373,13 +373,13 @@ More info and automated migrator: https://sass-lang.com/d/import
|
|
|
373
373
|
|
|
374
374
|
[36m
|
|
375
375
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
376
|
-
[32mcreated [1mdist[22m in [1m7.
|
|
376
|
+
[32mcreated [1mdist[22m in [1m7.2s[22m[39m
|
|
377
377
|
[36m
|
|
378
378
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
379
|
-
[32mcreated [1m./demo/[22m in [1m3.
|
|
379
|
+
[32mcreated [1m./demo/[22m in [1m3.6s[22m[39m
|
|
380
380
|
[36m
|
|
381
381
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
382
|
-
[32mcreated [1m./demo/[22m in [1m3.
|
|
382
|
+
[32mcreated [1m./demo/[22m in [1m3.3s[22m[39m
|
|
383
383
|
|
|
384
384
|
> @aurodesignsystem/auro-datepicker@3.2.0 build:docs
|
|
385
385
|
> wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component datepicker
|
|
@@ -93,10 +93,10 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
93
93
|
<!-- The below content is automatically added from ../../docs/templates/componentBundleUseModBrowsers.md -->
|
|
94
94
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.12.1/dist/tokens/CSSCustomProperties.css" />
|
|
95
95
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
|
|
96
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-dropdown@2.0.0-beta.
|
|
97
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-input@2.0.0-beta.
|
|
98
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-popover@2.0.0-beta.
|
|
99
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-datepicker@2.0.0-beta.
|
|
96
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-dropdown@2.0.0-beta.10/dist/auro-dropdown__bundled.js" type="module"></script>
|
|
97
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-input@2.0.0-beta.10/dist/auro-input__bundled.js" type="module"></script>
|
|
98
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-popover@2.0.0-beta.10/dist/auro-popover__bundled.js" type="module"></script>
|
|
99
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-datepicker@2.0.0-beta.10/dist/auro-datepicker__bundled.js" type="module"></script>
|
|
100
100
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
101
101
|
|
|
102
102
|
## auro-datepicker use cases
|
|
@@ -90,13 +90,13 @@ More info and automated migrator: https://sass-lang.com/d/import
|
|
|
90
90
|
|
|
91
91
|
[36m
|
|
92
92
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
93
|
-
[32mcreated [1mdist[22m in [1m1.
|
|
93
|
+
[32mcreated [1mdist[22m in [1m1.1s[22m[39m
|
|
94
94
|
[36m
|
|
95
95
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
96
|
-
[32mcreated [1m./demo/[22m in [
|
|
96
|
+
[32mcreated [1m./demo/[22m in [1m937ms[22m[39m
|
|
97
97
|
[36m
|
|
98
98
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
99
|
-
[32mcreated [1m./demo/[22m in [
|
|
99
|
+
[32mcreated [1m./demo/[22m in [1m741ms[22m[39m
|
|
100
100
|
|
|
101
101
|
> @aurodesignsystem/auro-dropdown@3.0.0 build:docs
|
|
102
102
|
> wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component dropdown
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[32mcreated [1mdist[22m in [1m1.4s[22m[39m
|
|
8
8
|
[36m
|
|
9
9
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
10
|
-
[32mcreated [1m./demo/[22m in [
|
|
10
|
+
[32mcreated [1m./demo/[22m in [1m843ms[22m[39m
|
|
11
11
|
[36m
|
|
12
12
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
13
|
-
[32mcreated [1m./demo/[22m in [
|
|
13
|
+
[32mcreated [1m./demo/[22m in [1m821ms[22m[39m
|
|
@@ -97,7 +97,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
97
97
|
<!-- The below content is automatically added from ../../docs/templates/componentBundleUseModBrowsers.md -->
|
|
98
98
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.9.2/dist/tokens/CSSCustomProperties.css" />
|
|
99
99
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
|
|
100
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-dropdown@2.0.0-beta.
|
|
100
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-dropdown@2.0.0-beta.10/dist/auro-dropdown__bundled.js" type="module"></script>
|
|
101
101
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
102
102
|
|
|
103
103
|
## auro-dropdown use cases
|
|
@@ -69,13 +69,13 @@ Run in verbose mode to see all warnings.
|
|
|
69
69
|
|
|
70
70
|
[36m
|
|
71
71
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
72
|
-
[32mcreated [1mdist[22m in [
|
|
72
|
+
[32mcreated [1mdist[22m in [1m592ms[22m[39m
|
|
73
73
|
[36m
|
|
74
74
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
75
|
-
[32mcreated [1m./demo/[22m in [
|
|
75
|
+
[32mcreated [1m./demo/[22m in [1m282ms[22m[39m
|
|
76
76
|
[36m
|
|
77
77
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
78
|
-
[32mcreated [1m./demo/[22m in [
|
|
78
|
+
[32mcreated [1m./demo/[22m in [1m218ms[22m[39m
|
|
79
79
|
|
|
80
80
|
> @aurodesignsystem/auro-form@1.0.0 build:docs
|
|
81
81
|
> wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component form
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
[36m
|
|
6
6
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
7
|
-
[32mcreated [1mdist[22m in [
|
|
7
|
+
[32mcreated [1mdist[22m in [1m435ms[22m[39m
|
|
8
8
|
[36m
|
|
9
9
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
10
|
-
[32mcreated [1m./demo/[22m in [
|
|
10
|
+
[32mcreated [1m./demo/[22m in [1m400ms[22m[39m
|
|
11
11
|
[36m
|
|
12
12
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
13
|
-
[32mcreated [1m./demo/[22m in [
|
|
13
|
+
[32mcreated [1m./demo/[22m in [1m377ms[22m[39m
|
|
@@ -97,7 +97,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
97
97
|
<!-- The below content is automatically added from ../../docs/templates/componentBundleUseModBrowsers.md -->
|
|
98
98
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.12.1/dist/tokens/CSSCustomProperties.css" />
|
|
99
99
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
|
|
100
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-form@2.0.0-beta.
|
|
100
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-form@2.0.0-beta.10/dist/auro-form__bundled.js" type="module"></script>
|
|
101
101
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
102
102
|
|
|
103
103
|
## auro-form use cases
|
|
@@ -216,13 +216,13 @@ More info and automated migrator: https://sass-lang.com/d/import
|
|
|
216
216
|
|
|
217
217
|
[36m
|
|
218
218
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
219
|
-
[32mcreated [1mdist[22m in [1m1.
|
|
219
|
+
[32mcreated [1mdist[22m in [1m1.4s[22m[39m
|
|
220
220
|
[36m
|
|
221
221
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
222
|
-
[32mcreated [1m./demo/[22m in [
|
|
222
|
+
[32mcreated [1m./demo/[22m in [1m1.2s[22m[39m
|
|
223
223
|
[36m
|
|
224
224
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
225
|
-
[32mcreated [1m./demo/[22m in [1m1.
|
|
225
|
+
[32mcreated [1m./demo/[22m in [1m1.5s[22m[39m
|
|
226
226
|
|
|
227
227
|
> @aurodesignsystem/auro-input@4.2.0 build:docs
|
|
228
228
|
> wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component input
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
[36m
|
|
6
6
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
7
|
-
[32mcreated [1mdist[22m in [1m1.
|
|
7
|
+
[32mcreated [1mdist[22m in [1m1.4s[22m[39m
|
|
8
8
|
[36m
|
|
9
9
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
10
|
-
[32mcreated [1m./demo/[22m in [
|
|
10
|
+
[32mcreated [1m./demo/[22m in [1m1s[22m[39m
|
|
11
11
|
[36m
|
|
12
12
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
13
|
-
[32mcreated [1m./demo/[22m in [
|
|
13
|
+
[32mcreated [1m./demo/[22m in [1m773ms[22m[39m
|
|
@@ -89,7 +89,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
89
89
|
<!-- The below content is automatically added from ../../docs/templates/componentBundleUseModBrowsers.md -->
|
|
90
90
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.12.1/dist/tokens/CSSCustomProperties.css" />
|
|
91
91
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
|
|
92
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-input@2.0.0-beta.
|
|
92
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-input@2.0.0-beta.10/dist/auro-input__bundled.js" type="module"></script>
|
|
93
93
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
94
94
|
|
|
95
95
|
## auro-input use cases
|
|
@@ -104,10 +104,10 @@ More info and automated migrator: https://sass-lang.com/d/import
|
|
|
104
104
|
[32mcreated [1mdist[22m in [1m1s[22m[39m
|
|
105
105
|
[36m
|
|
106
106
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
107
|
-
[32mcreated [1m./demo/[22m in [
|
|
107
|
+
[32mcreated [1m./demo/[22m in [1m565ms[22m[39m
|
|
108
108
|
[36m
|
|
109
109
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
110
|
-
[32mcreated [1m./demo/[22m in [
|
|
110
|
+
[32mcreated [1m./demo/[22m in [1m657ms[22m[39m
|
|
111
111
|
|
|
112
112
|
> @aurodesignsystem/auro-menu@4.1.4 build:docs
|
|
113
113
|
> wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component menu
|
|
@@ -149,6 +149,7 @@ Web Component Analyzer analyzing 2 files...
|
|
|
149
149
|
⁕ FILE:src=./../apiExamples/nocheckmark.html
|
|
150
150
|
⁕ FILE:src=./../apiExamples/disabledMenu.html
|
|
151
151
|
⁕ FILE:src=./../apiExamples/matchWord.html
|
|
152
|
+
⁕ FILE:src=./../apiExamples/multiSelect.html
|
|
152
153
|
⁕ FILE:src=./../apiExamples/loading.html
|
|
153
154
|
⁕ FILE:src=./../apiExamples/scroll.html
|
|
154
155
|
⁕ FILE:src=./../apiExamples/hr.html
|
|
@@ -163,6 +164,7 @@ Web Component Analyzer analyzing 2 files...
|
|
|
163
164
|
⁕ CODE:src=./../apiExamples/disabledMenu.html
|
|
164
165
|
⁕ CODE:src=./../apiExamples/matchWord.js
|
|
165
166
|
⁕ CODE:src=./../apiExamples/matchWord.html
|
|
167
|
+
⁕ CODE:src=./../apiExamples/multiSelect.html
|
|
166
168
|
⁕ CODE:src=./../apiExamples/loading.js
|
|
167
169
|
⁕ CODE:src=./../apiExamples/loading.html
|
|
168
170
|
⁕ CODE:src=./../apiExamples/scroll.html
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
[36m
|
|
6
6
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
7
|
-
[32mcreated [1mdist[22m in [
|
|
7
|
+
[32mcreated [1mdist[22m in [1m954ms[22m[39m
|
|
8
8
|
[36m
|
|
9
9
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
10
|
-
[32mcreated [1m./demo/[22m in [
|
|
10
|
+
[32mcreated [1m./demo/[22m in [1m742ms[22m[39m
|
|
11
11
|
[36m
|
|
12
12
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
13
|
-
[32mcreated [1m./demo/[22m in [
|
|
13
|
+
[32mcreated [1m./demo/[22m in [1m761ms[22m[39m
|
|
@@ -100,7 +100,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
100
100
|
<!-- The below content is automatically added from ../../docs/templates/componentBundleUseModBrowsers.md -->
|
|
101
101
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.12.1/dist/tokens/CSSCustomProperties.css" />
|
|
102
102
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
|
|
103
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-menu@2.0.0-beta.
|
|
103
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-menu@2.0.0-beta.10/dist/auro-menu__bundled.js" type="module"></script>
|
|
104
104
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
105
105
|
|
|
106
106
|
## auro-menu use cases
|
|
@@ -5,26 +5,31 @@
|
|
|
5
5
|
|
|
6
6
|
The auro-menu element provides users a way to select from a list of options.
|
|
7
7
|
|
|
8
|
+
## Attributes
|
|
9
|
+
|
|
10
|
+
| Attribute | Type | Description |
|
|
11
|
+
|------------------|---------------------------------|--------------------------------------------------|
|
|
12
|
+
| [optionselected](#optionselected) | `Array<HTMLElement>\|undefined` | An array of currently selected menu options. In single-select mode, the array will contain only one HTMLElement. `undefined` when no options are selected. |
|
|
13
|
+
|
|
8
14
|
## Properties
|
|
9
15
|
|
|
10
|
-
| Property | Attribute | Type
|
|
11
|
-
|
|
12
|
-
| [disabled](#disabled) | `disabled` | `
|
|
13
|
-
| [hasLoadingPlaceholder](#hasLoadingPlaceholder) | | `
|
|
14
|
-
| [loading](#loading) | `loading` | `
|
|
15
|
-
| [matchWord](#matchWord) | `
|
|
16
|
-
| [
|
|
17
|
-
| [
|
|
18
|
-
| [
|
|
19
|
-
| [
|
|
16
|
+
| Property | Attribute | Type | Default | Description |
|
|
17
|
+
|-------------------------|------------------|----------------------------|-------------|--------------------------------------------------|
|
|
18
|
+
| [disabled](#disabled) | `disabled` | `boolean` | | When true, the entire menu and all options are disabled; |
|
|
19
|
+
| [hasLoadingPlaceholder](#hasLoadingPlaceholder) | | `boolean` | | Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state. |
|
|
20
|
+
| [loading](#loading) | `loading` | `boolean` | false | When true, displays a loading state using the loadingIcon and loadingText slots if provided. |
|
|
21
|
+
| [matchWord](#matchWord) | `matchword` | `string` | "undefined" | Specifies a string used to highlight matched string parts in options. |
|
|
22
|
+
| [multiSelect](#multiSelect) | `multiselect` | `boolean` | false | When true, the selected option can be multiple options. |
|
|
23
|
+
| [noCheckmark](#noCheckmark) | `nocheckmark` | `boolean` | false | When true, selected option will not show the checkmark. |
|
|
24
|
+
| [optionActive](#optionActive) | `optionactive` | `object` | "undefined" | Specifies the current active menuOption. |
|
|
25
|
+
| [optionSelected](#optionSelected) | `optionSelected` | | "undefined" | |
|
|
26
|
+
| [value](#value) | `value` | `Array<string>\|undefined` | "undefined" | Value selected for the menu. `undefined` when no selection has been made, otherwise an array of strings. In single-select mode, the array will contain only one value. |
|
|
20
27
|
|
|
21
28
|
## Methods
|
|
22
29
|
|
|
23
|
-
| Method
|
|
24
|
-
|
|
25
|
-
| [
|
|
26
|
-
| [resetOptionsStates](#resetOptionsStates) | `(): void` | Reset the menu and all options. |
|
|
27
|
-
| [selectNextItem](#selectNextItem) | `(moveDirection: string): void` | Using value of current this.index evaluates index<br />of next :focus to set based on array of this.items ignoring items<br />with disabled attr.<br /><br />The event.target is not used as the function needs to know where to go,<br />versus knowing where it is.<br /><br />**moveDirection**: Up or Down based on keyboard event. |
|
|
30
|
+
| Method | Type | Description |
|
|
31
|
+
|---------|------------|--------------------------------------------------|
|
|
32
|
+
| [reset](#reset) | `(): void` | Resets the menu to its initial state.<br />This is the only way to return value to undefined. |
|
|
28
33
|
|
|
29
34
|
## Events
|
|
30
35
|
|
|
@@ -33,7 +38,7 @@ The auro-menu element provides users a way to select from a list of options.
|
|
|
33
38
|
| `auroMenu-activatedOption` | `CustomEvent<Element>` | Notifies that a menuoption has been made `active`. |
|
|
34
39
|
| `auroMenu-customEventFired` | `CustomEvent<any>` | Notifies that a custom event has been fired. |
|
|
35
40
|
| `auroMenu-loadingChange` | `CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>` | Notifies when the loading attribute is changed. |
|
|
36
|
-
| `auroMenu-selectValueFailure` | `CustomEvent<any>` | Notifies that
|
|
41
|
+
| `auroMenu-selectValueFailure` | `CustomEvent<any>` | Notifies that an attempt to select a menuoption by matching a value has failed. |
|
|
37
42
|
| `auroMenu-selectValueReset` | `CustomEvent<any>` | Notifies that the component value has been reset. |
|
|
38
43
|
| `auroMenu-selectedOption` | `CustomEvent<any>` | Notifies that a new menuoption selection has been made. |
|
|
39
44
|
|
|
@@ -308,6 +313,38 @@ export function auroMenuMatchWordExample() {
|
|
|
308
313
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
309
314
|
</auro-accordion>
|
|
310
315
|
|
|
316
|
+
### Multi Select<a name="multiSelect"></a>
|
|
317
|
+
The `auro-menu` supports a multi-select option. To use, place the `multiselect` attribute on the `<auro-menu>` element tag. When applied, the `value` attribute will become an Array versus String value.
|
|
318
|
+
|
|
319
|
+
<div class="exampleWrapper">
|
|
320
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/multiSelect.html) -->
|
|
321
|
+
<!-- The below content is automatically added from ./../apiExamples/multiSelect.html -->
|
|
322
|
+
<auro-menu multiselect>
|
|
323
|
+
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
324
|
+
<auro-menuoption value="price">Price</auro-menuoption>
|
|
325
|
+
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
326
|
+
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
327
|
+
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
328
|
+
</auro-menu>
|
|
329
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
330
|
+
</div>
|
|
331
|
+
<auro-accordion alignRight>
|
|
332
|
+
<span slot="trigger">See code</span>
|
|
333
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/multiSelect.html) -->
|
|
334
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/multiSelect.html -->
|
|
335
|
+
|
|
336
|
+
```html
|
|
337
|
+
<auro-menu multiselect>
|
|
338
|
+
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
339
|
+
<auro-menuoption value="price">Price</auro-menuoption>
|
|
340
|
+
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
341
|
+
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
342
|
+
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
343
|
+
</auro-menu>
|
|
344
|
+
```
|
|
345
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
346
|
+
</auro-accordion>
|
|
347
|
+
|
|
311
348
|
#### Loading<a name="loading"></a>
|
|
312
349
|
While content is loading, the menu can either remain empty or display a loading placeholder
|
|
313
350
|
|
|
@@ -874,12 +911,12 @@ The `auro-menu` may be reset to a state with no menuoption selected by setting t
|
|
|
874
911
|
```js
|
|
875
912
|
export function auroMenuResetExample() {
|
|
876
913
|
const resetExampleBtnElem = document.querySelector('#resetExampleBtn');
|
|
877
|
-
const resetExampleElem = document.querySelector('#resetExample');
|
|
878
|
-
|
|
914
|
+
const resetExampleElem = document.querySelector('#resetExample');
|
|
915
|
+
|
|
879
916
|
if (resetExampleElem && resetExampleBtnElem) {
|
|
880
917
|
resetExampleBtnElem.addEventListener('click', () => {
|
|
881
|
-
resetExampleElem.
|
|
882
|
-
})
|
|
918
|
+
resetExampleElem.reset();
|
|
919
|
+
});
|
|
883
920
|
}
|
|
884
921
|
}
|
|
885
922
|
```
|