@aurodesignsystem-dev/auro-formkit 0.0.0-pr1431.2 → 0.0.0-pr1433.0
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/checkbox/demo/api.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/api.min.js +235 -47
- package/components/combobox/demo/index.min.js +235 -47
- package/components/combobox/dist/auro-combobox.d.ts +4 -0
- package/components/combobox/dist/index.js +144 -24
- package/components/combobox/dist/registered.js +144 -24
- package/components/counter/demo/api.min.js +30 -2
- package/components/counter/demo/index.min.js +30 -2
- package/components/counter/dist/index.js +30 -2
- package/components/counter/dist/registered.js +30 -2
- package/components/datepicker/demo/api.min.js +33 -3
- package/components/datepicker/demo/index.min.js +33 -3
- package/components/datepicker/dist/index.js +33 -3
- package/components/datepicker/dist/registered.js +33 -3
- package/components/dropdown/demo/api.min.js +29 -1
- package/components/dropdown/demo/index.min.js +29 -1
- package/components/dropdown/dist/index.js +29 -1
- package/components/dropdown/dist/registered.js +29 -1
- package/components/form/demo/api.min.js +331 -57
- package/components/form/demo/index.min.js +331 -57
- package/components/input/demo/api.min.js +1 -1
- package/components/input/demo/index.min.js +1 -1
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/menu/demo/api.md +1 -1
- package/components/menu/demo/api.min.js +91 -23
- package/components/menu/demo/index.min.js +91 -23
- package/components/menu/dist/auro-menuoption.d.ts +2 -0
- package/components/menu/dist/index.js +91 -23
- package/components/menu/dist/registered.js +91 -23
- package/components/radio/demo/api.min.js +1 -1
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/api.min.js +121 -25
- package/components/select/demo/index.min.js +121 -25
- package/components/select/dist/index.js +30 -2
- package/components/select/dist/registered.js +30 -2
- package/custom-elements.json +422 -411
- package/package.json +2 -2
|
@@ -6626,7 +6626,7 @@ class AuroHelpText extends LitElement {
|
|
|
6626
6626
|
}
|
|
6627
6627
|
}
|
|
6628
6628
|
|
|
6629
|
-
var formkitVersion = '
|
|
6629
|
+
var formkitVersion = '202604100244';
|
|
6630
6630
|
|
|
6631
6631
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6632
6632
|
// See LICENSE in the project root for license information.
|
|
@@ -6626,7 +6626,7 @@ class AuroHelpText extends LitElement {
|
|
|
6626
6626
|
}
|
|
6627
6627
|
}
|
|
6628
6628
|
|
|
6629
|
-
var formkitVersion = '
|
|
6629
|
+
var formkitVersion = '202604100244';
|
|
6630
6630
|
|
|
6631
6631
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6632
6632
|
// See LICENSE in the project root for license information.
|
|
@@ -67,7 +67,7 @@ The `auro-menuoption` element provides users a way to define a menu option.
|
|
|
67
67
|
| [iconTag](#iconTag) | | | `string` | | |
|
|
68
68
|
| [isActive](#isActive) | | readonly | `boolean` | | Returns whether the menu option is currently active and selectable.<br />An option is considered active if it is not hidden, not disabled, and not static. |
|
|
69
69
|
| [key](#key) | `key` | | `string` | | Allows users to set a unique key for the menu option for specified option selection. If no key is provided, the value property will be used. |
|
|
70
|
-
| [noMatch](#noMatch) | `
|
|
70
|
+
| [noMatch](#noMatch) | `nomatch` | | `boolean` | false | When true, marks this option as the "no matching results" placeholder shown by combobox when the user's input does not match any available options. Enables distinct styling and prevents the option from being treated as a selectable match. |
|
|
71
71
|
| [selected](#selected) | `selected` | | `boolean` | false | Specifies that an option is selected. |
|
|
72
72
|
| [tabIndex](#tabIndex) | `tabIndex` | | `number` | | Specifies the tab index of the menu option. |
|
|
73
73
|
| [unsubscribe](#unsubscribe) | | | | null | |
|
|
@@ -527,6 +527,7 @@ class AuroMenuOption extends AuroElement {
|
|
|
527
527
|
this.selected = false;
|
|
528
528
|
this.noCheckmark = false;
|
|
529
529
|
this.disabled = false;
|
|
530
|
+
this.noMatch = false;
|
|
530
531
|
|
|
531
532
|
/**
|
|
532
533
|
* @private
|
|
@@ -607,7 +608,8 @@ class AuroMenuOption extends AuroElement {
|
|
|
607
608
|
*/
|
|
608
609
|
noMatch: {
|
|
609
610
|
type: Boolean,
|
|
610
|
-
reflect: true
|
|
611
|
+
reflect: true,
|
|
612
|
+
attribute: 'nomatch'
|
|
611
613
|
},
|
|
612
614
|
|
|
613
615
|
/**
|
|
@@ -707,7 +709,7 @@ class AuroMenuOption extends AuroElement {
|
|
|
707
709
|
this.setAttribute('aria-selected', this.selected.toString());
|
|
708
710
|
|
|
709
711
|
// Update menu service selection state if this isn't an internal update
|
|
710
|
-
if (this.internalUpdateInProgress !== true) {
|
|
712
|
+
if (this.internalUpdateInProgress !== true && this.menuService) {
|
|
711
713
|
this.menuService[this.selected ? 'selectOption' : 'deselectOption'](this);
|
|
712
714
|
}
|
|
713
715
|
}
|
|
@@ -742,9 +744,10 @@ class AuroMenuOption extends AuroElement {
|
|
|
742
744
|
}
|
|
743
745
|
|
|
744
746
|
disconnectedCallback() {
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
747
|
+
const { menuService } = this;
|
|
748
|
+
if (menuService) {
|
|
749
|
+
menuService.unsubscribe(this.handleMenuChange);
|
|
750
|
+
menuService.removeMenuOption(this);
|
|
748
751
|
}
|
|
749
752
|
}
|
|
750
753
|
|
|
@@ -913,9 +916,11 @@ class AuroMenuOption extends AuroElement {
|
|
|
913
916
|
* @private
|
|
914
917
|
*/
|
|
915
918
|
handleMouseEnter() {
|
|
916
|
-
|
|
917
|
-
|
|
919
|
+
const { menuService } = this;
|
|
920
|
+
if (!menuService || this.disabled) {
|
|
921
|
+
return;
|
|
918
922
|
}
|
|
923
|
+
menuService.setHighlightedOption(this);
|
|
919
924
|
}
|
|
920
925
|
|
|
921
926
|
/**
|
|
@@ -1319,10 +1324,15 @@ class MenuService {
|
|
|
1319
1324
|
return;
|
|
1320
1325
|
}
|
|
1321
1326
|
|
|
1327
|
+
const before = this.selectedOptions || [];
|
|
1322
1328
|
const optionsSet = new Set(optionsToDeselect);
|
|
1323
|
-
|
|
1324
|
-
.filter(opt => !optionsSet.has(opt));
|
|
1329
|
+
const after = before.filter(opt => !optionsSet.has(opt));
|
|
1325
1330
|
|
|
1331
|
+
if (this.optionsArraysMatch(after, before)) {
|
|
1332
|
+
return;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
this.selectedOptions = after;
|
|
1326
1336
|
this.stageUpdate();
|
|
1327
1337
|
}
|
|
1328
1338
|
|
|
@@ -1418,6 +1428,16 @@ class MenuService {
|
|
|
1418
1428
|
return;
|
|
1419
1429
|
}
|
|
1420
1430
|
|
|
1431
|
+
const hostValue = this.host && this.host.value;
|
|
1432
|
+
const hostHasValue = hostValue !== undefined &&
|
|
1433
|
+
hostValue !== null &&
|
|
1434
|
+
(!Array.isArray(hostValue) || hostValue.length > 0) &&
|
|
1435
|
+
(typeof hostValue !== 'string' || hostValue.trim() !== '');
|
|
1436
|
+
|
|
1437
|
+
if (hostHasValue && this._pendingValue != null) {
|
|
1438
|
+
return;
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1421
1441
|
this.clearPendingValue();
|
|
1422
1442
|
|
|
1423
1443
|
if (this.selectedOptions.length > 0) {
|
|
@@ -1598,6 +1618,9 @@ class MenuService {
|
|
|
1598
1618
|
this.notify({ type: 'optionsChange', options: this._menuOptions });
|
|
1599
1619
|
|
|
1600
1620
|
if (this._pendingValue != null) {
|
|
1621
|
+
// Reset the retry count so a new option registration gives a fresh
|
|
1622
|
+
// budget — the initial retries fired before delayed options arrived.
|
|
1623
|
+
this._pendingRetryCount = 0;
|
|
1601
1624
|
this.queuePendingValue(this._pendingValue);
|
|
1602
1625
|
}
|
|
1603
1626
|
}
|
|
@@ -1942,7 +1965,11 @@ class AuroMenu extends AuroElement {
|
|
|
1942
1965
|
* @returns {string} - Returns the label of the currently selected option(s).
|
|
1943
1966
|
*/
|
|
1944
1967
|
get currentLabel() {
|
|
1945
|
-
|
|
1968
|
+
const { menuService } = this;
|
|
1969
|
+
if (!menuService) {
|
|
1970
|
+
return '';
|
|
1971
|
+
}
|
|
1972
|
+
return menuService.currentLabel;
|
|
1946
1973
|
};
|
|
1947
1974
|
|
|
1948
1975
|
/**
|
|
@@ -1965,7 +1992,12 @@ class AuroMenu extends AuroElement {
|
|
|
1965
1992
|
* @param {number} value - Sets the index of the currently active option.
|
|
1966
1993
|
*/
|
|
1967
1994
|
set index(value) {
|
|
1968
|
-
this
|
|
1995
|
+
const { menuService } = this;
|
|
1996
|
+
if (!menuService) {
|
|
1997
|
+
return;
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
menuService.setHighlightedIndex(value);
|
|
1969
2001
|
}
|
|
1970
2002
|
|
|
1971
2003
|
/**
|
|
@@ -1987,7 +2019,11 @@ class AuroMenu extends AuroElement {
|
|
|
1987
2019
|
* @returns {String|Array<String>}
|
|
1988
2020
|
*/
|
|
1989
2021
|
get formattedValue() {
|
|
1990
|
-
|
|
2022
|
+
const { menuService } = this;
|
|
2023
|
+
if (!menuService) {
|
|
2024
|
+
return '';
|
|
2025
|
+
}
|
|
2026
|
+
return menuService.currentValue;
|
|
1991
2027
|
}
|
|
1992
2028
|
|
|
1993
2029
|
/**
|
|
@@ -2031,7 +2067,11 @@ class AuroMenu extends AuroElement {
|
|
|
2031
2067
|
* @param {HTMLElement} option - The option to set as active.
|
|
2032
2068
|
*/
|
|
2033
2069
|
updateActiveOption(option) {
|
|
2034
|
-
this
|
|
2070
|
+
const { menuService } = this;
|
|
2071
|
+
if (!menuService) {
|
|
2072
|
+
return;
|
|
2073
|
+
}
|
|
2074
|
+
menuService.setHighlightedOption(option);
|
|
2035
2075
|
}
|
|
2036
2076
|
|
|
2037
2077
|
/**
|
|
@@ -2059,7 +2099,8 @@ class AuroMenu extends AuroElement {
|
|
|
2059
2099
|
if (event.type === 'valueChange') {
|
|
2060
2100
|
|
|
2061
2101
|
// New option is array value or first option with fallback to undefined for empty array in all cases
|
|
2062
|
-
const
|
|
2102
|
+
const options = event.options || [];
|
|
2103
|
+
const newOption = this.multiSelect && options.length ? options : options[0] || undefined;
|
|
2063
2104
|
const newValue = event.stringValue;
|
|
2064
2105
|
|
|
2065
2106
|
// Check if the option or value has actually changed
|
|
@@ -2068,8 +2109,11 @@ class AuroMenu extends AuroElement {
|
|
|
2068
2109
|
this.setInternalValue(newValue);
|
|
2069
2110
|
}
|
|
2070
2111
|
|
|
2071
|
-
// Notify components of selection change
|
|
2072
|
-
this.notifySelectionChange(
|
|
2112
|
+
// Notify components of selection change (pass normalized options to avoid undefined iterability errors)
|
|
2113
|
+
this.notifySelectionChange({
|
|
2114
|
+
...event,
|
|
2115
|
+
options
|
|
2116
|
+
});
|
|
2073
2117
|
}
|
|
2074
2118
|
|
|
2075
2119
|
if (event.type === 'highlightChange') {
|
|
@@ -2092,7 +2136,11 @@ class AuroMenu extends AuroElement {
|
|
|
2092
2136
|
* @returns {Array<HTMLElement>}
|
|
2093
2137
|
*/
|
|
2094
2138
|
get selectedOptions() {
|
|
2095
|
-
|
|
2139
|
+
const { menuService } = this;
|
|
2140
|
+
if (!menuService) {
|
|
2141
|
+
return [];
|
|
2142
|
+
}
|
|
2143
|
+
return menuService.selectedOptions;
|
|
2096
2144
|
}
|
|
2097
2145
|
|
|
2098
2146
|
/**
|
|
@@ -2100,7 +2148,11 @@ class AuroMenu extends AuroElement {
|
|
|
2100
2148
|
* @returns {HTMLElement|null}
|
|
2101
2149
|
*/
|
|
2102
2150
|
get selectedOption() {
|
|
2103
|
-
|
|
2151
|
+
const { menuService } = this;
|
|
2152
|
+
if (!menuService) {
|
|
2153
|
+
return null;
|
|
2154
|
+
}
|
|
2155
|
+
return menuService.selectedOptions[0] || null;
|
|
2104
2156
|
}
|
|
2105
2157
|
|
|
2106
2158
|
// Lifecycle Methods
|
|
@@ -2144,7 +2196,11 @@ class AuroMenu extends AuroElement {
|
|
|
2144
2196
|
// keys are not yet resolved (framework mount-order race), selectByValue
|
|
2145
2197
|
// queues a bounded retry automatically via queuePendingValue.
|
|
2146
2198
|
if (changedProperties.has('value') && !this.internalUpdateInProgress) {
|
|
2147
|
-
|
|
2199
|
+
const { menuService } = this;
|
|
2200
|
+
if (!menuService) {
|
|
2201
|
+
return;
|
|
2202
|
+
}
|
|
2203
|
+
menuService.selectByValue(this.value);
|
|
2148
2204
|
}
|
|
2149
2205
|
|
|
2150
2206
|
// Handle loading state changes
|
|
@@ -2209,7 +2265,11 @@ class AuroMenu extends AuroElement {
|
|
|
2209
2265
|
* @protected
|
|
2210
2266
|
*/
|
|
2211
2267
|
makeSelection() {
|
|
2212
|
-
this
|
|
2268
|
+
const { menuService } = this;
|
|
2269
|
+
if (!menuService) {
|
|
2270
|
+
return;
|
|
2271
|
+
}
|
|
2272
|
+
menuService.selectHighlightedOption();
|
|
2213
2273
|
}
|
|
2214
2274
|
|
|
2215
2275
|
/**
|
|
@@ -2228,7 +2288,11 @@ class AuroMenu extends AuroElement {
|
|
|
2228
2288
|
* @public
|
|
2229
2289
|
*/
|
|
2230
2290
|
reset() {
|
|
2231
|
-
this
|
|
2291
|
+
const { menuService } = this;
|
|
2292
|
+
if (!menuService) {
|
|
2293
|
+
return;
|
|
2294
|
+
}
|
|
2295
|
+
menuService.reset();
|
|
2232
2296
|
|
|
2233
2297
|
// Dispatch reset event
|
|
2234
2298
|
dispatchMenuEvent(this, 'auroMenu-selectValueReset');
|
|
@@ -2263,10 +2327,14 @@ class AuroMenu extends AuroElement {
|
|
|
2263
2327
|
* @protected
|
|
2264
2328
|
*/
|
|
2265
2329
|
navigateOptions(direction) {
|
|
2330
|
+
const { menuService } = this;
|
|
2331
|
+
if (!menuService) {
|
|
2332
|
+
return;
|
|
2333
|
+
}
|
|
2266
2334
|
if (direction === 'up') {
|
|
2267
|
-
|
|
2335
|
+
menuService.highlightPrevious();
|
|
2268
2336
|
} else if (direction === 'down') {
|
|
2269
|
-
|
|
2337
|
+
menuService.highlightNext();
|
|
2270
2338
|
}
|
|
2271
2339
|
}
|
|
2272
2340
|
|
|
@@ -435,6 +435,7 @@ class AuroMenuOption extends AuroElement {
|
|
|
435
435
|
this.selected = false;
|
|
436
436
|
this.noCheckmark = false;
|
|
437
437
|
this.disabled = false;
|
|
438
|
+
this.noMatch = false;
|
|
438
439
|
|
|
439
440
|
/**
|
|
440
441
|
* @private
|
|
@@ -515,7 +516,8 @@ class AuroMenuOption extends AuroElement {
|
|
|
515
516
|
*/
|
|
516
517
|
noMatch: {
|
|
517
518
|
type: Boolean,
|
|
518
|
-
reflect: true
|
|
519
|
+
reflect: true,
|
|
520
|
+
attribute: 'nomatch'
|
|
519
521
|
},
|
|
520
522
|
|
|
521
523
|
/**
|
|
@@ -615,7 +617,7 @@ class AuroMenuOption extends AuroElement {
|
|
|
615
617
|
this.setAttribute('aria-selected', this.selected.toString());
|
|
616
618
|
|
|
617
619
|
// Update menu service selection state if this isn't an internal update
|
|
618
|
-
if (this.internalUpdateInProgress !== true) {
|
|
620
|
+
if (this.internalUpdateInProgress !== true && this.menuService) {
|
|
619
621
|
this.menuService[this.selected ? 'selectOption' : 'deselectOption'](this);
|
|
620
622
|
}
|
|
621
623
|
}
|
|
@@ -650,9 +652,10 @@ class AuroMenuOption extends AuroElement {
|
|
|
650
652
|
}
|
|
651
653
|
|
|
652
654
|
disconnectedCallback() {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
655
|
+
const { menuService } = this;
|
|
656
|
+
if (menuService) {
|
|
657
|
+
menuService.unsubscribe(this.handleMenuChange);
|
|
658
|
+
menuService.removeMenuOption(this);
|
|
656
659
|
}
|
|
657
660
|
}
|
|
658
661
|
|
|
@@ -821,9 +824,11 @@ class AuroMenuOption extends AuroElement {
|
|
|
821
824
|
* @private
|
|
822
825
|
*/
|
|
823
826
|
handleMouseEnter() {
|
|
824
|
-
|
|
825
|
-
|
|
827
|
+
const { menuService } = this;
|
|
828
|
+
if (!menuService || this.disabled) {
|
|
829
|
+
return;
|
|
826
830
|
}
|
|
831
|
+
menuService.setHighlightedOption(this);
|
|
827
832
|
}
|
|
828
833
|
|
|
829
834
|
/**
|
|
@@ -1227,10 +1232,15 @@ class MenuService {
|
|
|
1227
1232
|
return;
|
|
1228
1233
|
}
|
|
1229
1234
|
|
|
1235
|
+
const before = this.selectedOptions || [];
|
|
1230
1236
|
const optionsSet = new Set(optionsToDeselect);
|
|
1231
|
-
|
|
1232
|
-
.filter(opt => !optionsSet.has(opt));
|
|
1237
|
+
const after = before.filter(opt => !optionsSet.has(opt));
|
|
1233
1238
|
|
|
1239
|
+
if (this.optionsArraysMatch(after, before)) {
|
|
1240
|
+
return;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
this.selectedOptions = after;
|
|
1234
1244
|
this.stageUpdate();
|
|
1235
1245
|
}
|
|
1236
1246
|
|
|
@@ -1326,6 +1336,16 @@ class MenuService {
|
|
|
1326
1336
|
return;
|
|
1327
1337
|
}
|
|
1328
1338
|
|
|
1339
|
+
const hostValue = this.host && this.host.value;
|
|
1340
|
+
const hostHasValue = hostValue !== undefined &&
|
|
1341
|
+
hostValue !== null &&
|
|
1342
|
+
(!Array.isArray(hostValue) || hostValue.length > 0) &&
|
|
1343
|
+
(typeof hostValue !== 'string' || hostValue.trim() !== '');
|
|
1344
|
+
|
|
1345
|
+
if (hostHasValue && this._pendingValue != null) {
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1329
1349
|
this.clearPendingValue();
|
|
1330
1350
|
|
|
1331
1351
|
if (this.selectedOptions.length > 0) {
|
|
@@ -1506,6 +1526,9 @@ class MenuService {
|
|
|
1506
1526
|
this.notify({ type: 'optionsChange', options: this._menuOptions });
|
|
1507
1527
|
|
|
1508
1528
|
if (this._pendingValue != null) {
|
|
1529
|
+
// Reset the retry count so a new option registration gives a fresh
|
|
1530
|
+
// budget — the initial retries fired before delayed options arrived.
|
|
1531
|
+
this._pendingRetryCount = 0;
|
|
1509
1532
|
this.queuePendingValue(this._pendingValue);
|
|
1510
1533
|
}
|
|
1511
1534
|
}
|
|
@@ -1850,7 +1873,11 @@ class AuroMenu extends AuroElement {
|
|
|
1850
1873
|
* @returns {string} - Returns the label of the currently selected option(s).
|
|
1851
1874
|
*/
|
|
1852
1875
|
get currentLabel() {
|
|
1853
|
-
|
|
1876
|
+
const { menuService } = this;
|
|
1877
|
+
if (!menuService) {
|
|
1878
|
+
return '';
|
|
1879
|
+
}
|
|
1880
|
+
return menuService.currentLabel;
|
|
1854
1881
|
};
|
|
1855
1882
|
|
|
1856
1883
|
/**
|
|
@@ -1873,7 +1900,12 @@ class AuroMenu extends AuroElement {
|
|
|
1873
1900
|
* @param {number} value - Sets the index of the currently active option.
|
|
1874
1901
|
*/
|
|
1875
1902
|
set index(value) {
|
|
1876
|
-
this
|
|
1903
|
+
const { menuService } = this;
|
|
1904
|
+
if (!menuService) {
|
|
1905
|
+
return;
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
menuService.setHighlightedIndex(value);
|
|
1877
1909
|
}
|
|
1878
1910
|
|
|
1879
1911
|
/**
|
|
@@ -1895,7 +1927,11 @@ class AuroMenu extends AuroElement {
|
|
|
1895
1927
|
* @returns {String|Array<String>}
|
|
1896
1928
|
*/
|
|
1897
1929
|
get formattedValue() {
|
|
1898
|
-
|
|
1930
|
+
const { menuService } = this;
|
|
1931
|
+
if (!menuService) {
|
|
1932
|
+
return '';
|
|
1933
|
+
}
|
|
1934
|
+
return menuService.currentValue;
|
|
1899
1935
|
}
|
|
1900
1936
|
|
|
1901
1937
|
/**
|
|
@@ -1939,7 +1975,11 @@ class AuroMenu extends AuroElement {
|
|
|
1939
1975
|
* @param {HTMLElement} option - The option to set as active.
|
|
1940
1976
|
*/
|
|
1941
1977
|
updateActiveOption(option) {
|
|
1942
|
-
this
|
|
1978
|
+
const { menuService } = this;
|
|
1979
|
+
if (!menuService) {
|
|
1980
|
+
return;
|
|
1981
|
+
}
|
|
1982
|
+
menuService.setHighlightedOption(option);
|
|
1943
1983
|
}
|
|
1944
1984
|
|
|
1945
1985
|
/**
|
|
@@ -1967,7 +2007,8 @@ class AuroMenu extends AuroElement {
|
|
|
1967
2007
|
if (event.type === 'valueChange') {
|
|
1968
2008
|
|
|
1969
2009
|
// New option is array value or first option with fallback to undefined for empty array in all cases
|
|
1970
|
-
const
|
|
2010
|
+
const options = event.options || [];
|
|
2011
|
+
const newOption = this.multiSelect && options.length ? options : options[0] || undefined;
|
|
1971
2012
|
const newValue = event.stringValue;
|
|
1972
2013
|
|
|
1973
2014
|
// Check if the option or value has actually changed
|
|
@@ -1976,8 +2017,11 @@ class AuroMenu extends AuroElement {
|
|
|
1976
2017
|
this.setInternalValue(newValue);
|
|
1977
2018
|
}
|
|
1978
2019
|
|
|
1979
|
-
// Notify components of selection change
|
|
1980
|
-
this.notifySelectionChange(
|
|
2020
|
+
// Notify components of selection change (pass normalized options to avoid undefined iterability errors)
|
|
2021
|
+
this.notifySelectionChange({
|
|
2022
|
+
...event,
|
|
2023
|
+
options
|
|
2024
|
+
});
|
|
1981
2025
|
}
|
|
1982
2026
|
|
|
1983
2027
|
if (event.type === 'highlightChange') {
|
|
@@ -2000,7 +2044,11 @@ class AuroMenu extends AuroElement {
|
|
|
2000
2044
|
* @returns {Array<HTMLElement>}
|
|
2001
2045
|
*/
|
|
2002
2046
|
get selectedOptions() {
|
|
2003
|
-
|
|
2047
|
+
const { menuService } = this;
|
|
2048
|
+
if (!menuService) {
|
|
2049
|
+
return [];
|
|
2050
|
+
}
|
|
2051
|
+
return menuService.selectedOptions;
|
|
2004
2052
|
}
|
|
2005
2053
|
|
|
2006
2054
|
/**
|
|
@@ -2008,7 +2056,11 @@ class AuroMenu extends AuroElement {
|
|
|
2008
2056
|
* @returns {HTMLElement|null}
|
|
2009
2057
|
*/
|
|
2010
2058
|
get selectedOption() {
|
|
2011
|
-
|
|
2059
|
+
const { menuService } = this;
|
|
2060
|
+
if (!menuService) {
|
|
2061
|
+
return null;
|
|
2062
|
+
}
|
|
2063
|
+
return menuService.selectedOptions[0] || null;
|
|
2012
2064
|
}
|
|
2013
2065
|
|
|
2014
2066
|
// Lifecycle Methods
|
|
@@ -2052,7 +2104,11 @@ class AuroMenu extends AuroElement {
|
|
|
2052
2104
|
// keys are not yet resolved (framework mount-order race), selectByValue
|
|
2053
2105
|
// queues a bounded retry automatically via queuePendingValue.
|
|
2054
2106
|
if (changedProperties.has('value') && !this.internalUpdateInProgress) {
|
|
2055
|
-
|
|
2107
|
+
const { menuService } = this;
|
|
2108
|
+
if (!menuService) {
|
|
2109
|
+
return;
|
|
2110
|
+
}
|
|
2111
|
+
menuService.selectByValue(this.value);
|
|
2056
2112
|
}
|
|
2057
2113
|
|
|
2058
2114
|
// Handle loading state changes
|
|
@@ -2117,7 +2173,11 @@ class AuroMenu extends AuroElement {
|
|
|
2117
2173
|
* @protected
|
|
2118
2174
|
*/
|
|
2119
2175
|
makeSelection() {
|
|
2120
|
-
this
|
|
2176
|
+
const { menuService } = this;
|
|
2177
|
+
if (!menuService) {
|
|
2178
|
+
return;
|
|
2179
|
+
}
|
|
2180
|
+
menuService.selectHighlightedOption();
|
|
2121
2181
|
}
|
|
2122
2182
|
|
|
2123
2183
|
/**
|
|
@@ -2136,7 +2196,11 @@ class AuroMenu extends AuroElement {
|
|
|
2136
2196
|
* @public
|
|
2137
2197
|
*/
|
|
2138
2198
|
reset() {
|
|
2139
|
-
this
|
|
2199
|
+
const { menuService } = this;
|
|
2200
|
+
if (!menuService) {
|
|
2201
|
+
return;
|
|
2202
|
+
}
|
|
2203
|
+
menuService.reset();
|
|
2140
2204
|
|
|
2141
2205
|
// Dispatch reset event
|
|
2142
2206
|
dispatchMenuEvent(this, 'auroMenu-selectValueReset');
|
|
@@ -2171,10 +2235,14 @@ class AuroMenu extends AuroElement {
|
|
|
2171
2235
|
* @protected
|
|
2172
2236
|
*/
|
|
2173
2237
|
navigateOptions(direction) {
|
|
2238
|
+
const { menuService } = this;
|
|
2239
|
+
if (!menuService) {
|
|
2240
|
+
return;
|
|
2241
|
+
}
|
|
2174
2242
|
if (direction === 'up') {
|
|
2175
|
-
|
|
2243
|
+
menuService.highlightPrevious();
|
|
2176
2244
|
} else if (direction === 'down') {
|
|
2177
|
-
|
|
2245
|
+
menuService.highlightNext();
|
|
2178
2246
|
}
|
|
2179
2247
|
}
|
|
2180
2248
|
|
|
@@ -71,6 +71,7 @@ export class AuroMenuOption extends AuroElement {
|
|
|
71
71
|
noMatch: {
|
|
72
72
|
type: BooleanConstructor;
|
|
73
73
|
reflect: boolean;
|
|
74
|
+
attribute: string;
|
|
74
75
|
};
|
|
75
76
|
/**
|
|
76
77
|
* Specifies that an option is selected.
|
|
@@ -113,6 +114,7 @@ export class AuroMenuOption extends AuroElement {
|
|
|
113
114
|
selected: boolean;
|
|
114
115
|
noCheckmark: boolean;
|
|
115
116
|
disabled: boolean;
|
|
117
|
+
noMatch: boolean;
|
|
116
118
|
/**
|
|
117
119
|
* @private
|
|
118
120
|
*/
|