@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.
Files changed (43) hide show
  1. package/components/checkbox/demo/api.min.js +1 -1
  2. package/components/checkbox/demo/index.min.js +1 -1
  3. package/components/checkbox/dist/index.js +1 -1
  4. package/components/checkbox/dist/registered.js +1 -1
  5. package/components/combobox/demo/api.min.js +235 -47
  6. package/components/combobox/demo/index.min.js +235 -47
  7. package/components/combobox/dist/auro-combobox.d.ts +4 -0
  8. package/components/combobox/dist/index.js +144 -24
  9. package/components/combobox/dist/registered.js +144 -24
  10. package/components/counter/demo/api.min.js +30 -2
  11. package/components/counter/demo/index.min.js +30 -2
  12. package/components/counter/dist/index.js +30 -2
  13. package/components/counter/dist/registered.js +30 -2
  14. package/components/datepicker/demo/api.min.js +33 -3
  15. package/components/datepicker/demo/index.min.js +33 -3
  16. package/components/datepicker/dist/index.js +33 -3
  17. package/components/datepicker/dist/registered.js +33 -3
  18. package/components/dropdown/demo/api.min.js +29 -1
  19. package/components/dropdown/demo/index.min.js +29 -1
  20. package/components/dropdown/dist/index.js +29 -1
  21. package/components/dropdown/dist/registered.js +29 -1
  22. package/components/form/demo/api.min.js +331 -57
  23. package/components/form/demo/index.min.js +331 -57
  24. package/components/input/demo/api.min.js +1 -1
  25. package/components/input/demo/index.min.js +1 -1
  26. package/components/input/dist/index.js +1 -1
  27. package/components/input/dist/registered.js +1 -1
  28. package/components/menu/demo/api.md +1 -1
  29. package/components/menu/demo/api.min.js +91 -23
  30. package/components/menu/demo/index.min.js +91 -23
  31. package/components/menu/dist/auro-menuoption.d.ts +2 -0
  32. package/components/menu/dist/index.js +91 -23
  33. package/components/menu/dist/registered.js +91 -23
  34. package/components/radio/demo/api.min.js +1 -1
  35. package/components/radio/demo/index.min.js +1 -1
  36. package/components/radio/dist/index.js +1 -1
  37. package/components/radio/dist/registered.js +1 -1
  38. package/components/select/demo/api.min.js +121 -25
  39. package/components/select/demo/index.min.js +121 -25
  40. package/components/select/dist/index.js +30 -2
  41. package/components/select/dist/registered.js +30 -2
  42. package/custom-elements.json +422 -411
  43. package/package.json +2 -2
@@ -409,6 +409,7 @@ class AuroMenuOption extends AuroElement {
409
409
  this.selected = false;
410
410
  this.noCheckmark = false;
411
411
  this.disabled = false;
412
+ this.noMatch = false;
412
413
 
413
414
  /**
414
415
  * @private
@@ -489,7 +490,8 @@ class AuroMenuOption extends AuroElement {
489
490
  */
490
491
  noMatch: {
491
492
  type: Boolean,
492
- reflect: true
493
+ reflect: true,
494
+ attribute: 'nomatch'
493
495
  },
494
496
 
495
497
  /**
@@ -589,7 +591,7 @@ class AuroMenuOption extends AuroElement {
589
591
  this.setAttribute('aria-selected', this.selected.toString());
590
592
 
591
593
  // Update menu service selection state if this isn't an internal update
592
- if (this.internalUpdateInProgress !== true) {
594
+ if (this.internalUpdateInProgress !== true && this.menuService) {
593
595
  this.menuService[this.selected ? 'selectOption' : 'deselectOption'](this);
594
596
  }
595
597
  }
@@ -624,9 +626,10 @@ class AuroMenuOption extends AuroElement {
624
626
  }
625
627
 
626
628
  disconnectedCallback() {
627
- if (this.menuService) {
628
- this.menuService.unsubscribe(this.handleMenuChange);
629
- this.menuService.removeMenuOption(this);
629
+ const { menuService } = this;
630
+ if (menuService) {
631
+ menuService.unsubscribe(this.handleMenuChange);
632
+ menuService.removeMenuOption(this);
630
633
  }
631
634
  }
632
635
 
@@ -795,9 +798,11 @@ class AuroMenuOption extends AuroElement {
795
798
  * @private
796
799
  */
797
800
  handleMouseEnter() {
798
- if (!this.disabled) {
799
- this.menuService.setHighlightedOption(this);
801
+ const { menuService } = this;
802
+ if (!menuService || this.disabled) {
803
+ return;
800
804
  }
805
+ menuService.setHighlightedOption(this);
801
806
  }
802
807
 
803
808
  /**
@@ -1201,10 +1206,15 @@ class MenuService {
1201
1206
  return;
1202
1207
  }
1203
1208
 
1209
+ const before = this.selectedOptions || [];
1204
1210
  const optionsSet = new Set(optionsToDeselect);
1205
- this.selectedOptions = (this.selectedOptions || [])
1206
- .filter(opt => !optionsSet.has(opt));
1211
+ const after = before.filter(opt => !optionsSet.has(opt));
1207
1212
 
1213
+ if (this.optionsArraysMatch(after, before)) {
1214
+ return;
1215
+ }
1216
+
1217
+ this.selectedOptions = after;
1208
1218
  this.stageUpdate();
1209
1219
  }
1210
1220
 
@@ -1300,6 +1310,16 @@ class MenuService {
1300
1310
  return;
1301
1311
  }
1302
1312
 
1313
+ const hostValue = this.host && this.host.value;
1314
+ const hostHasValue = hostValue !== undefined &&
1315
+ hostValue !== null &&
1316
+ (!Array.isArray(hostValue) || hostValue.length > 0) &&
1317
+ (typeof hostValue !== 'string' || hostValue.trim() !== '');
1318
+
1319
+ if (hostHasValue && this._pendingValue != null) {
1320
+ return;
1321
+ }
1322
+
1303
1323
  this.clearPendingValue();
1304
1324
 
1305
1325
  if (this.selectedOptions.length > 0) {
@@ -1480,6 +1500,9 @@ class MenuService {
1480
1500
  this.notify({ type: 'optionsChange', options: this._menuOptions });
1481
1501
 
1482
1502
  if (this._pendingValue != null) {
1503
+ // Reset the retry count so a new option registration gives a fresh
1504
+ // budget — the initial retries fired before delayed options arrived.
1505
+ this._pendingRetryCount = 0;
1483
1506
  this.queuePendingValue(this._pendingValue);
1484
1507
  }
1485
1508
  }
@@ -1824,7 +1847,11 @@ class AuroMenu extends AuroElement {
1824
1847
  * @returns {string} - Returns the label of the currently selected option(s).
1825
1848
  */
1826
1849
  get currentLabel() {
1827
- return this.menuService.currentLabel;
1850
+ const { menuService } = this;
1851
+ if (!menuService) {
1852
+ return '';
1853
+ }
1854
+ return menuService.currentLabel;
1828
1855
  };
1829
1856
 
1830
1857
  /**
@@ -1847,7 +1874,12 @@ class AuroMenu extends AuroElement {
1847
1874
  * @param {number} value - Sets the index of the currently active option.
1848
1875
  */
1849
1876
  set index(value) {
1850
- this.menuService.setHighlightedIndex(value);
1877
+ const { menuService } = this;
1878
+ if (!menuService) {
1879
+ return;
1880
+ }
1881
+
1882
+ menuService.setHighlightedIndex(value);
1851
1883
  }
1852
1884
 
1853
1885
  /**
@@ -1869,7 +1901,11 @@ class AuroMenu extends AuroElement {
1869
1901
  * @returns {String|Array<String>}
1870
1902
  */
1871
1903
  get formattedValue() {
1872
- return this.menuService.currentValue;
1904
+ const { menuService } = this;
1905
+ if (!menuService) {
1906
+ return '';
1907
+ }
1908
+ return menuService.currentValue;
1873
1909
  }
1874
1910
 
1875
1911
  /**
@@ -1913,7 +1949,11 @@ class AuroMenu extends AuroElement {
1913
1949
  * @param {HTMLElement} option - The option to set as active.
1914
1950
  */
1915
1951
  updateActiveOption(option) {
1916
- this.menuService.setHighlightedOption(option);
1952
+ const { menuService } = this;
1953
+ if (!menuService) {
1954
+ return;
1955
+ }
1956
+ menuService.setHighlightedOption(option);
1917
1957
  }
1918
1958
 
1919
1959
  /**
@@ -1941,7 +1981,8 @@ class AuroMenu extends AuroElement {
1941
1981
  if (event.type === 'valueChange') {
1942
1982
 
1943
1983
  // New option is array value or first option with fallback to undefined for empty array in all cases
1944
- const newOption = this.multiSelect && event.options.length ? event.options : event.options[0] || undefined;
1984
+ const options = event.options || [];
1985
+ const newOption = this.multiSelect && options.length ? options : options[0] || undefined;
1945
1986
  const newValue = event.stringValue;
1946
1987
 
1947
1988
  // Check if the option or value has actually changed
@@ -1950,8 +1991,11 @@ class AuroMenu extends AuroElement {
1950
1991
  this.setInternalValue(newValue);
1951
1992
  }
1952
1993
 
1953
- // Notify components of selection change
1954
- this.notifySelectionChange(event);
1994
+ // Notify components of selection change (pass normalized options to avoid undefined iterability errors)
1995
+ this.notifySelectionChange({
1996
+ ...event,
1997
+ options
1998
+ });
1955
1999
  }
1956
2000
 
1957
2001
  if (event.type === 'highlightChange') {
@@ -1974,7 +2018,11 @@ class AuroMenu extends AuroElement {
1974
2018
  * @returns {Array<HTMLElement>}
1975
2019
  */
1976
2020
  get selectedOptions() {
1977
- return this.menuService ? this.menuService.selectedOptions : [];
2021
+ const { menuService } = this;
2022
+ if (!menuService) {
2023
+ return [];
2024
+ }
2025
+ return menuService.selectedOptions;
1978
2026
  }
1979
2027
 
1980
2028
  /**
@@ -1982,7 +2030,11 @@ class AuroMenu extends AuroElement {
1982
2030
  * @returns {HTMLElement|null}
1983
2031
  */
1984
2032
  get selectedOption() {
1985
- return this.menuService ? this.menuService.selectedOptions[0] : null;
2033
+ const { menuService } = this;
2034
+ if (!menuService) {
2035
+ return null;
2036
+ }
2037
+ return menuService.selectedOptions[0] || null;
1986
2038
  }
1987
2039
 
1988
2040
  // Lifecycle Methods
@@ -2026,7 +2078,11 @@ class AuroMenu extends AuroElement {
2026
2078
  // keys are not yet resolved (framework mount-order race), selectByValue
2027
2079
  // queues a bounded retry automatically via queuePendingValue.
2028
2080
  if (changedProperties.has('value') && !this.internalUpdateInProgress) {
2029
- this.menuService.selectByValue(this.value);
2081
+ const { menuService } = this;
2082
+ if (!menuService) {
2083
+ return;
2084
+ }
2085
+ menuService.selectByValue(this.value);
2030
2086
  }
2031
2087
 
2032
2088
  // Handle loading state changes
@@ -2091,7 +2147,11 @@ class AuroMenu extends AuroElement {
2091
2147
  * @protected
2092
2148
  */
2093
2149
  makeSelection() {
2094
- this.menuService.selectHighlightedOption();
2150
+ const { menuService } = this;
2151
+ if (!menuService) {
2152
+ return;
2153
+ }
2154
+ menuService.selectHighlightedOption();
2095
2155
  }
2096
2156
 
2097
2157
  /**
@@ -2110,7 +2170,11 @@ class AuroMenu extends AuroElement {
2110
2170
  * @public
2111
2171
  */
2112
2172
  reset() {
2113
- this.menuService.reset();
2173
+ const { menuService } = this;
2174
+ if (!menuService) {
2175
+ return;
2176
+ }
2177
+ menuService.reset();
2114
2178
 
2115
2179
  // Dispatch reset event
2116
2180
  dispatchMenuEvent(this, 'auroMenu-selectValueReset');
@@ -2145,10 +2209,14 @@ class AuroMenu extends AuroElement {
2145
2209
  * @protected
2146
2210
  */
2147
2211
  navigateOptions(direction) {
2212
+ const { menuService } = this;
2213
+ if (!menuService) {
2214
+ return;
2215
+ }
2148
2216
  if (direction === 'up') {
2149
- this.menuService.highlightPrevious();
2217
+ menuService.highlightPrevious();
2150
2218
  } else if (direction === 'down') {
2151
- this.menuService.highlightNext();
2219
+ menuService.highlightNext();
2152
2220
  }
2153
2221
  }
2154
2222
 
@@ -356,6 +356,7 @@ class AuroMenuOption extends AuroElement {
356
356
  this.selected = false;
357
357
  this.noCheckmark = false;
358
358
  this.disabled = false;
359
+ this.noMatch = false;
359
360
 
360
361
  /**
361
362
  * @private
@@ -436,7 +437,8 @@ class AuroMenuOption extends AuroElement {
436
437
  */
437
438
  noMatch: {
438
439
  type: Boolean,
439
- reflect: true
440
+ reflect: true,
441
+ attribute: 'nomatch'
440
442
  },
441
443
 
442
444
  /**
@@ -536,7 +538,7 @@ class AuroMenuOption extends AuroElement {
536
538
  this.setAttribute('aria-selected', this.selected.toString());
537
539
 
538
540
  // Update menu service selection state if this isn't an internal update
539
- if (this.internalUpdateInProgress !== true) {
541
+ if (this.internalUpdateInProgress !== true && this.menuService) {
540
542
  this.menuService[this.selected ? 'selectOption' : 'deselectOption'](this);
541
543
  }
542
544
  }
@@ -571,9 +573,10 @@ class AuroMenuOption extends AuroElement {
571
573
  }
572
574
 
573
575
  disconnectedCallback() {
574
- if (this.menuService) {
575
- this.menuService.unsubscribe(this.handleMenuChange);
576
- this.menuService.removeMenuOption(this);
576
+ const { menuService } = this;
577
+ if (menuService) {
578
+ menuService.unsubscribe(this.handleMenuChange);
579
+ menuService.removeMenuOption(this);
577
580
  }
578
581
  }
579
582
 
@@ -742,9 +745,11 @@ class AuroMenuOption extends AuroElement {
742
745
  * @private
743
746
  */
744
747
  handleMouseEnter() {
745
- if (!this.disabled) {
746
- this.menuService.setHighlightedOption(this);
748
+ const { menuService } = this;
749
+ if (!menuService || this.disabled) {
750
+ return;
747
751
  }
752
+ menuService.setHighlightedOption(this);
748
753
  }
749
754
 
750
755
  /**
@@ -1148,10 +1153,15 @@ class MenuService {
1148
1153
  return;
1149
1154
  }
1150
1155
 
1156
+ const before = this.selectedOptions || [];
1151
1157
  const optionsSet = new Set(optionsToDeselect);
1152
- this.selectedOptions = (this.selectedOptions || [])
1153
- .filter(opt => !optionsSet.has(opt));
1158
+ const after = before.filter(opt => !optionsSet.has(opt));
1154
1159
 
1160
+ if (this.optionsArraysMatch(after, before)) {
1161
+ return;
1162
+ }
1163
+
1164
+ this.selectedOptions = after;
1155
1165
  this.stageUpdate();
1156
1166
  }
1157
1167
 
@@ -1247,6 +1257,16 @@ class MenuService {
1247
1257
  return;
1248
1258
  }
1249
1259
 
1260
+ const hostValue = this.host && this.host.value;
1261
+ const hostHasValue = hostValue !== undefined &&
1262
+ hostValue !== null &&
1263
+ (!Array.isArray(hostValue) || hostValue.length > 0) &&
1264
+ (typeof hostValue !== 'string' || hostValue.trim() !== '');
1265
+
1266
+ if (hostHasValue && this._pendingValue != null) {
1267
+ return;
1268
+ }
1269
+
1250
1270
  this.clearPendingValue();
1251
1271
 
1252
1272
  if (this.selectedOptions.length > 0) {
@@ -1427,6 +1447,9 @@ class MenuService {
1427
1447
  this.notify({ type: 'optionsChange', options: this._menuOptions });
1428
1448
 
1429
1449
  if (this._pendingValue != null) {
1450
+ // Reset the retry count so a new option registration gives a fresh
1451
+ // budget — the initial retries fired before delayed options arrived.
1452
+ this._pendingRetryCount = 0;
1430
1453
  this.queuePendingValue(this._pendingValue);
1431
1454
  }
1432
1455
  }
@@ -1771,7 +1794,11 @@ class AuroMenu extends AuroElement {
1771
1794
  * @returns {string} - Returns the label of the currently selected option(s).
1772
1795
  */
1773
1796
  get currentLabel() {
1774
- return this.menuService.currentLabel;
1797
+ const { menuService } = this;
1798
+ if (!menuService) {
1799
+ return '';
1800
+ }
1801
+ return menuService.currentLabel;
1775
1802
  };
1776
1803
 
1777
1804
  /**
@@ -1794,7 +1821,12 @@ class AuroMenu extends AuroElement {
1794
1821
  * @param {number} value - Sets the index of the currently active option.
1795
1822
  */
1796
1823
  set index(value) {
1797
- this.menuService.setHighlightedIndex(value);
1824
+ const { menuService } = this;
1825
+ if (!menuService) {
1826
+ return;
1827
+ }
1828
+
1829
+ menuService.setHighlightedIndex(value);
1798
1830
  }
1799
1831
 
1800
1832
  /**
@@ -1816,7 +1848,11 @@ class AuroMenu extends AuroElement {
1816
1848
  * @returns {String|Array<String>}
1817
1849
  */
1818
1850
  get formattedValue() {
1819
- return this.menuService.currentValue;
1851
+ const { menuService } = this;
1852
+ if (!menuService) {
1853
+ return '';
1854
+ }
1855
+ return menuService.currentValue;
1820
1856
  }
1821
1857
 
1822
1858
  /**
@@ -1860,7 +1896,11 @@ class AuroMenu extends AuroElement {
1860
1896
  * @param {HTMLElement} option - The option to set as active.
1861
1897
  */
1862
1898
  updateActiveOption(option) {
1863
- this.menuService.setHighlightedOption(option);
1899
+ const { menuService } = this;
1900
+ if (!menuService) {
1901
+ return;
1902
+ }
1903
+ menuService.setHighlightedOption(option);
1864
1904
  }
1865
1905
 
1866
1906
  /**
@@ -1888,7 +1928,8 @@ class AuroMenu extends AuroElement {
1888
1928
  if (event.type === 'valueChange') {
1889
1929
 
1890
1930
  // New option is array value or first option with fallback to undefined for empty array in all cases
1891
- const newOption = this.multiSelect && event.options.length ? event.options : event.options[0] || undefined;
1931
+ const options = event.options || [];
1932
+ const newOption = this.multiSelect && options.length ? options : options[0] || undefined;
1892
1933
  const newValue = event.stringValue;
1893
1934
 
1894
1935
  // Check if the option or value has actually changed
@@ -1897,8 +1938,11 @@ class AuroMenu extends AuroElement {
1897
1938
  this.setInternalValue(newValue);
1898
1939
  }
1899
1940
 
1900
- // Notify components of selection change
1901
- this.notifySelectionChange(event);
1941
+ // Notify components of selection change (pass normalized options to avoid undefined iterability errors)
1942
+ this.notifySelectionChange({
1943
+ ...event,
1944
+ options
1945
+ });
1902
1946
  }
1903
1947
 
1904
1948
  if (event.type === 'highlightChange') {
@@ -1921,7 +1965,11 @@ class AuroMenu extends AuroElement {
1921
1965
  * @returns {Array<HTMLElement>}
1922
1966
  */
1923
1967
  get selectedOptions() {
1924
- return this.menuService ? this.menuService.selectedOptions : [];
1968
+ const { menuService } = this;
1969
+ if (!menuService) {
1970
+ return [];
1971
+ }
1972
+ return menuService.selectedOptions;
1925
1973
  }
1926
1974
 
1927
1975
  /**
@@ -1929,7 +1977,11 @@ class AuroMenu extends AuroElement {
1929
1977
  * @returns {HTMLElement|null}
1930
1978
  */
1931
1979
  get selectedOption() {
1932
- return this.menuService ? this.menuService.selectedOptions[0] : null;
1980
+ const { menuService } = this;
1981
+ if (!menuService) {
1982
+ return null;
1983
+ }
1984
+ return menuService.selectedOptions[0] || null;
1933
1985
  }
1934
1986
 
1935
1987
  // Lifecycle Methods
@@ -1973,7 +2025,11 @@ class AuroMenu extends AuroElement {
1973
2025
  // keys are not yet resolved (framework mount-order race), selectByValue
1974
2026
  // queues a bounded retry automatically via queuePendingValue.
1975
2027
  if (changedProperties.has('value') && !this.internalUpdateInProgress) {
1976
- this.menuService.selectByValue(this.value);
2028
+ const { menuService } = this;
2029
+ if (!menuService) {
2030
+ return;
2031
+ }
2032
+ menuService.selectByValue(this.value);
1977
2033
  }
1978
2034
 
1979
2035
  // Handle loading state changes
@@ -2038,7 +2094,11 @@ class AuroMenu extends AuroElement {
2038
2094
  * @protected
2039
2095
  */
2040
2096
  makeSelection() {
2041
- this.menuService.selectHighlightedOption();
2097
+ const { menuService } = this;
2098
+ if (!menuService) {
2099
+ return;
2100
+ }
2101
+ menuService.selectHighlightedOption();
2042
2102
  }
2043
2103
 
2044
2104
  /**
@@ -2057,7 +2117,11 @@ class AuroMenu extends AuroElement {
2057
2117
  * @public
2058
2118
  */
2059
2119
  reset() {
2060
- this.menuService.reset();
2120
+ const { menuService } = this;
2121
+ if (!menuService) {
2122
+ return;
2123
+ }
2124
+ menuService.reset();
2061
2125
 
2062
2126
  // Dispatch reset event
2063
2127
  dispatchMenuEvent(this, 'auroMenu-selectValueReset');
@@ -2092,10 +2156,14 @@ class AuroMenu extends AuroElement {
2092
2156
  * @protected
2093
2157
  */
2094
2158
  navigateOptions(direction) {
2159
+ const { menuService } = this;
2160
+ if (!menuService) {
2161
+ return;
2162
+ }
2095
2163
  if (direction === 'up') {
2096
- this.menuService.highlightPrevious();
2164
+ menuService.highlightPrevious();
2097
2165
  } else if (direction === 'down') {
2098
- this.menuService.highlightNext();
2166
+ menuService.highlightNext();
2099
2167
  }
2100
2168
  }
2101
2169
 
@@ -1645,7 +1645,7 @@ class AuroHelpText extends i$2 {
1645
1645
  }
1646
1646
  }
1647
1647
 
1648
- var formkitVersion = '202604091435';
1648
+ var formkitVersion = '202604100244';
1649
1649
 
1650
1650
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1651
1651
  // See LICENSE in the project root for license information.
@@ -1620,7 +1620,7 @@ class AuroHelpText extends i$2 {
1620
1620
  }
1621
1621
  }
1622
1622
 
1623
- var formkitVersion = '202604091435';
1623
+ var formkitVersion = '202604100244';
1624
1624
 
1625
1625
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1626
1626
  // See LICENSE in the project root for license information.
@@ -1573,7 +1573,7 @@ class AuroHelpText extends LitElement {
1573
1573
  }
1574
1574
  }
1575
1575
 
1576
- var formkitVersion = '202604091435';
1576
+ var formkitVersion = '202604100244';
1577
1577
 
1578
1578
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1579
1579
  // See LICENSE in the project root for license information.
@@ -1573,7 +1573,7 @@ class AuroHelpText extends LitElement {
1573
1573
  }
1574
1574
  }
1575
1575
 
1576
- var formkitVersion = '202604091435';
1576
+ var formkitVersion = '202604100244';
1577
1577
 
1578
1578
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1579
1579
  // See LICENSE in the project root for license information.