@aurodesignsystem-dev/auro-formkit 0.0.0-pr1394.1 → 0.0.0-pr1394.2

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 (44) 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 +153 -41
  6. package/components/combobox/demo/index.min.js +153 -41
  7. package/components/combobox/dist/index.js +5 -4
  8. package/components/combobox/dist/registered.js +5 -4
  9. package/components/counter/demo/api.min.js +4 -3
  10. package/components/counter/demo/index.min.js +4 -3
  11. package/components/counter/dist/index.js +4 -3
  12. package/components/counter/dist/registered.js +4 -3
  13. package/components/datepicker/demo/api.min.js +5 -4
  14. package/components/datepicker/demo/index.min.js +5 -4
  15. package/components/datepicker/dist/index.js +5 -4
  16. package/components/datepicker/dist/registered.js +5 -4
  17. package/components/dropdown/demo/api.min.js +3 -2
  18. package/components/dropdown/demo/index.min.js +3 -2
  19. package/components/dropdown/dist/auro-dropdownBib.d.ts +2 -1
  20. package/components/dropdown/dist/index.js +3 -2
  21. package/components/dropdown/dist/registered.js +3 -2
  22. package/components/form/demo/api.min.js +177 -57
  23. package/components/form/demo/index.min.js +177 -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 +148 -37
  30. package/components/menu/demo/index.min.js +148 -37
  31. package/components/menu/dist/auro-menu.context.d.ts +15 -3
  32. package/components/menu/dist/auro-menu.d.ts +1 -1
  33. package/components/menu/dist/index.js +148 -37
  34. package/components/menu/dist/registered.js +148 -37
  35. package/components/radio/demo/api.min.js +1 -1
  36. package/components/radio/demo/index.min.js +1 -1
  37. package/components/radio/dist/index.js +1 -1
  38. package/components/radio/dist/registered.js +1 -1
  39. package/components/select/demo/api.min.js +160 -43
  40. package/components/select/demo/index.min.js +160 -43
  41. package/components/select/dist/index.js +12 -6
  42. package/components/select/dist/registered.js +12 -6
  43. package/custom-elements.json +66 -5
  44. package/package.json +12 -4
@@ -1687,7 +1687,7 @@ class AuroHelpText extends i$2 {
1687
1687
  }
1688
1688
  }
1689
1689
 
1690
- var formkitVersion = '202603232347';
1690
+ var formkitVersion = '202603242021';
1691
1691
 
1692
1692
  // Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1693
1693
  // See LICENSE in the project root for license information.
@@ -1679,7 +1679,7 @@ class AuroHelpText extends i$2 {
1679
1679
  }
1680
1680
  }
1681
1681
 
1682
- var formkitVersion = '202603232347';
1682
+ var formkitVersion = '202603242021';
1683
1683
 
1684
1684
  // Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1685
1685
  // See LICENSE in the project root for license information.
@@ -1632,7 +1632,7 @@ class AuroHelpText extends LitElement {
1632
1632
  }
1633
1633
  }
1634
1634
 
1635
- var formkitVersion = '202603232347';
1635
+ var formkitVersion = '202603242021';
1636
1636
 
1637
1637
  // Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1638
1638
  // See LICENSE in the project root for license information.
@@ -1632,7 +1632,7 @@ class AuroHelpText extends LitElement {
1632
1632
  }
1633
1633
  }
1634
1634
 
1635
- var formkitVersion = '202603232347';
1635
+ var formkitVersion = '202603242021';
1636
1636
 
1637
1637
  // Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1638
1638
  // See LICENSE in the project root for license information.
@@ -4497,7 +4497,8 @@ class AuroDropdownBib extends i$4 {
4497
4497
  * Set by auro-dropdown when a menu option is highlighted via
4498
4498
  * aria-activedescendant. The dialog keyboard bridge checks this
4499
4499
  * flag so that Enter selects the highlighted option instead of
4500
- * clicking the trigger button.
4500
+ * activating the focused interactive element (e.g. the trigger
4501
+ * button, or the bibtemplate close button in fullscreen).
4501
4502
  * @private
4502
4503
  */
4503
4504
  hasActiveDescendant: {
@@ -5058,7 +5059,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$4 {
5058
5059
  }
5059
5060
  };
5060
5061
 
5061
- var formkitVersion$2 = '202603232347';
5062
+ var formkitVersion$2 = '202603242021';
5062
5063
 
5063
5064
  let AuroElement$2 = class AuroElement extends i$4 {
5064
5065
  static get properties() {
@@ -12822,7 +12823,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$4 {
12822
12823
  }
12823
12824
  };
12824
12825
 
12825
- var formkitVersion$1 = '202603232347';
12826
+ var formkitVersion$1 = '202603242021';
12826
12827
 
12827
12828
  // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
12828
12829
  // See LICENSE in the project root for license information.
@@ -13861,7 +13862,7 @@ class AuroBibtemplate extends i$4 {
13861
13862
  }
13862
13863
  }
13863
13864
 
13864
- var formkitVersion = '202603232347';
13865
+ var formkitVersion = '202603242021';
13865
13866
 
13866
13867
  var styleCss$3 = i$7`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;text-align:left}:host [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: transparent}:host #inputInBib::part(wrapper){box-shadow:none}:host #inputInBib::part(accent-left){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
13867
13868
 
@@ -16049,10 +16050,20 @@ class AuroMenuOption extends AuroElement {
16049
16050
  subscribe: true
16050
16051
  });
16051
16052
 
16052
- // Establish the key property as early as possible
16053
+ // Establish the key property as early as possible.
16054
+ // When a framework (e.g. Svelte) inserts the element into the DOM before
16055
+ // setting its `value` property, both `getAttribute('value')` and
16056
+ // `getAttribute('key')` return null here. Setting `this.key = null`
16057
+ // would block the fallback in `updated()` that assigns key from the
16058
+ // value property (the guard checked `=== undefined`). Only assign key
16059
+ // if at least one source attribute is actually present so that the
16060
+ // `updated()` fallback can run when the value property arrives later.
16053
16061
  const valueAttr = this.getAttribute('value');
16054
16062
  const keyAttr = this.getAttribute('key');
16055
- this.key = keyAttr !== null ? keyAttr : valueAttr;
16063
+ const resolvedKey = keyAttr !== null ? keyAttr : valueAttr;
16064
+ if (resolvedKey !== null) {
16065
+ this.key = resolvedKey;
16066
+ }
16056
16067
  }
16057
16068
 
16058
16069
  firstUpdated() {
@@ -16102,8 +16113,14 @@ class AuroMenuOption extends AuroElement {
16102
16113
  this.updateTextHighlight();
16103
16114
  }
16104
16115
 
16105
- // Set the key to be the passed value if no key is provided
16106
- if (changedProperties.has('value') && this.key === undefined) {
16116
+ // Set the key to be the passed value if no key is provided.
16117
+ // Loose equality (== null) is intentional: it catches both null AND
16118
+ // undefined. When a framework (e.g. Svelte, React) inserts the element
16119
+ // before setting its value property, connectedCallback skips key
16120
+ // assignment because both attributes are null at that point. The Lit
16121
+ // property default for `key` is undefined (not null), so strict
16122
+ // === null would miss the case and the fallback would never run.
16123
+ if (changedProperties.has('value') && this.key == null) { // eslint-disable-line eqeqeq, no-eq-null
16107
16124
  this.key = this.value;
16108
16125
  }
16109
16126
  }
@@ -16472,6 +16489,9 @@ class MenuService {
16472
16489
  this._subscribers = [];
16473
16490
  this.internalUpdateInProgress = false;
16474
16491
  this.selectedOptions = [];
16492
+ this._pendingValue = null;
16493
+ this._pendingRetryScheduled = false;
16494
+ this._pendingRetryCount = 0;
16475
16495
  }
16476
16496
 
16477
16497
  /**
@@ -16511,6 +16531,9 @@ class MenuService {
16511
16531
  hostDisconnected() {
16512
16532
  this._subscribers = [];
16513
16533
  this._menuOptions = [];
16534
+ this._pendingValue = null;
16535
+ this._pendingRetryScheduled = false;
16536
+ this._pendingRetryCount = 0;
16514
16537
  }
16515
16538
 
16516
16539
  /**
@@ -16713,17 +16736,22 @@ class MenuService {
16713
16736
  * @param {string|number|Array<string|number>} value - The value(s) to select.
16714
16737
  */
16715
16738
  selectByValue(value) {
16716
- // Early exit for invalid/empty values or internal updates
16717
- if (this.internalUpdateInProgress ||
16718
- this.host.internalUpdateInProgress ||
16719
- value === undefined ||
16739
+ const isEmptyValue = value === undefined ||
16720
16740
  value === null ||
16721
16741
  (Array.isArray(value) && value.length === 0) ||
16722
- (typeof value === 'string' && value.trim() === '')) {
16742
+ (typeof value === 'string' && value.trim() === '');
16743
+
16744
+ // Early exit for invalid/empty values
16745
+ if (isEmptyValue) {
16723
16746
  return;
16724
16747
  }
16725
16748
 
16726
- this.reset();
16749
+ // If an internal update cycle is still in progress, defer value application
16750
+ // rather than dropping it.
16751
+ if (this.internalUpdateInProgress || this.host.internalUpdateInProgress) {
16752
+ this.queuePendingValue(value);
16753
+ return;
16754
+ }
16727
16755
 
16728
16756
  // Normalize values to array of strings
16729
16757
  const normalizedValues = this._getNormalizedValues(value);
@@ -16735,33 +16763,100 @@ class MenuService {
16735
16763
  validatedValues = [normalizedValues[0]];
16736
16764
  }
16737
16765
 
16766
+ if (this._menuOptions.length === 0) {
16767
+ this.queuePendingValue(value);
16768
+ return;
16769
+ }
16770
+
16738
16771
  // Find matching options by comparing available options to validated values
16739
16772
  const trackedKeys = new Set();
16740
16773
  const optionsToSelect = this._menuOptions.filter(option => {
16741
16774
  const passesFilter = validatedValues.includes(option.key);
16742
16775
  const alreadyTracked = trackedKeys.has(option.key);
16776
+ const isActive = option.isActive;
16743
16777
 
16744
16778
  trackedKeys.add(option.key);
16745
16779
 
16746
16780
  // Include the option in the options to be selected if it passes the filter check and
16747
16781
  // either hasn't been tracked yet or selectAllMatchingOptions is true
16748
- return passesFilter && (!alreadyTracked || (alreadyTracked && this.selectAllMatchingOptions));
16782
+ return isActive && passesFilter && (!alreadyTracked || (alreadyTracked && this.selectAllMatchingOptions));
16749
16783
  });
16750
16784
 
16751
- // Handle selection result
16752
- if (optionsToSelect.length && !this.optionsArraysMatch(optionsToSelect, this.selectedOptions)) {
16753
- this.selectOptions(optionsToSelect);
16754
- } else {
16755
- this.stageUpdate();
16785
+ // Handle no matches: clear existing selection, but do not dispatch an intermediate
16786
+ // undefined value that can overwrite the host value in parent components.
16787
+ if (!optionsToSelect.length) {
16788
+ const hasUnresolvedKeys = this._menuOptions.some((option) => option.isActive && option.key == null);
16789
+
16790
+ if (hasUnresolvedKeys) {
16791
+ this.queuePendingValue(value);
16792
+ return;
16793
+ }
16794
+
16795
+ this.clearPendingValue();
16796
+
16797
+ if (this.selectedOptions.length > 0) {
16798
+ this.selectedOptions = [];
16799
+ }
16800
+
16801
+ // Always notify so the host resets any stale invalid value, even when
16802
+ // selectedOptions was already empty (e.g. double-clicking set-invalid).
16803
+ this.stageUpdate({ reason: 'no-match' });
16804
+
16805
+ // Dispatch failure event if no matches found
16806
+ if (validatedValues.length) {
16807
+ this.dispatchChangeEvent('auroMenu-selectValueFailure', {
16808
+ message: 'No matching options found for the provided value(s).',
16809
+ values: validatedValues
16810
+ });
16811
+ }
16812
+
16813
+ return;
16756
16814
  }
16757
16815
 
16758
- // Dispatch failure event if no matches found
16759
- if (!optionsToSelect.length && validatedValues.length) {
16760
- this.dispatchChangeEvent('auroMenu-selectValueFailure', {
16761
- message: 'No matching options found for the provided value(s).',
16762
- values: validatedValues
16763
- });
16816
+ this.clearPendingValue();
16817
+
16818
+ if (this.optionsArraysMatch(optionsToSelect, this.selectedOptions)) {
16819
+ return;
16820
+ }
16821
+
16822
+ // Apply programmatic selection as a single transaction and emit one final state.
16823
+ this.selectedOptions = optionsToSelect;
16824
+ this.stageUpdate();
16825
+ }
16826
+
16827
+ /**
16828
+ * Queues a pending value and schedules a bounded retry.
16829
+ * @param {string|number|Array<string|number>} value - The value to retry.
16830
+ */
16831
+ queuePendingValue(value) {
16832
+ this._pendingValue = value;
16833
+
16834
+ if (this._pendingRetryScheduled || this._pendingRetryCount >= 5) {
16835
+ return;
16764
16836
  }
16837
+
16838
+ this._pendingRetryScheduled = true;
16839
+ this._pendingRetryCount += 1;
16840
+
16841
+ setTimeout(() => {
16842
+ this._pendingRetryScheduled = false;
16843
+
16844
+ if (this._pendingValue == null) {
16845
+ return;
16846
+ }
16847
+
16848
+ const pendingValue = this._pendingValue;
16849
+ this.selectByValue(pendingValue);
16850
+ }, 0);
16851
+ }
16852
+
16853
+ /**
16854
+ * Clears pending retry state.
16855
+ */
16856
+ clearPendingValue() {
16857
+ this._pendingValue = null;
16858
+ this._pendingRetryScheduled = false;
16859
+ this._pendingRetryCount = 0;
16765
16860
  }
16766
16861
 
16767
16862
  /**
@@ -16800,9 +16895,9 @@ class MenuService {
16800
16895
  /**
16801
16896
  * Stages an update to notify subscribers of state and value changes.
16802
16897
  */
16803
- stageUpdate() {
16804
- this.notifyStateChange();
16805
- this.notifyValueChange();
16898
+ stageUpdate(meta = {}) {
16899
+ this.notifyStateChange(meta);
16900
+ this.notifyValueChange(meta);
16806
16901
  }
16807
16902
 
16808
16903
  /**
@@ -16817,14 +16912,18 @@ class MenuService {
16817
16912
  /**
16818
16913
  * Notifies subscribers of a state change (selected options has changed).
16819
16914
  */
16820
- notifyStateChange() {
16821
- this.notify({ type: 'stateChange', selectedOptions: this.selectedOptions });
16915
+ notifyStateChange(meta = {}) {
16916
+ this.notify({
16917
+ type: 'stateChange',
16918
+ selectedOptions: this.selectedOptions,
16919
+ ...meta
16920
+ });
16822
16921
  }
16823
16922
 
16824
16923
  /**
16825
16924
  * Notifies subscribers of a value change (current value has changed).
16826
16925
  */
16827
- notifyValueChange() {
16926
+ notifyValueChange(meta = {}) {
16828
16927
 
16829
16928
  // Prepare details for the event
16830
16929
  const details = {
@@ -16840,10 +16939,9 @@ class MenuService {
16840
16939
 
16841
16940
  this.notify({
16842
16941
  type: 'valueChange',
16942
+ ...meta,
16843
16943
  ...details
16844
16944
  });
16845
-
16846
- this.dispatchChangeEvent('auroMenu-selectedOption', details);
16847
16945
  }
16848
16946
 
16849
16947
  /**
@@ -16871,6 +16969,10 @@ class MenuService {
16871
16969
  addMenuOption(option) {
16872
16970
  this._menuOptions.push(option);
16873
16971
  this.notify({ type: 'optionsChange', options: this._menuOptions });
16972
+
16973
+ if (this._pendingValue != null) {
16974
+ this.queuePendingValue(this._pendingValue);
16975
+ }
16874
16976
  }
16875
16977
 
16876
16978
  /**
@@ -16880,6 +16982,10 @@ class MenuService {
16880
16982
  removeMenuOption(option) {
16881
16983
  this._menuOptions = this._menuOptions.filter(opt => opt !== option);
16882
16984
  this.notify({ type: 'optionsChange', options: this._menuOptions });
16985
+
16986
+ if (this._menuOptions.length === 0) {
16987
+ this.clearPendingValue();
16988
+ }
16883
16989
  }
16884
16990
 
16885
16991
  /**
@@ -17153,7 +17259,7 @@ class AuroMenu extends AuroElement {
17153
17259
  },
17154
17260
 
17155
17261
  /**
17156
- * Available menu options
17262
+ * Available menu options.
17157
17263
  * @readonly
17158
17264
  */
17159
17265
  options: {
@@ -17220,7 +17326,7 @@ class AuroMenu extends AuroElement {
17220
17326
  /**
17221
17327
  * @readonly
17222
17328
  * @returns {Array<HTMLElement>} - Returns the array of available menu options.
17223
- * @deprecated use `options` property instead.
17329
+ * @deprecated Use `options` property instead.
17224
17330
  */
17225
17331
  get items() {
17226
17332
  return this.options;
@@ -17328,7 +17434,7 @@ class AuroMenu extends AuroElement {
17328
17434
  const newValue = event.stringValue;
17329
17435
 
17330
17436
  // Check if the option or value has actually changed
17331
- if (newValue === undefined || (this.optionSelected !== newOption || this.stringValue !== newValue)) {
17437
+ if (this.optionSelected !== newOption || this.stringValue !== newValue) {
17332
17438
  this.optionSelected = newOption;
17333
17439
  this.setInternalValue(newValue);
17334
17440
  }
@@ -17402,8 +17508,13 @@ class AuroMenu extends AuroElement {
17402
17508
  updated(changedProperties) {
17403
17509
  super.updated(changedProperties);
17404
17510
 
17405
- // Update menu service properties on host update
17406
- if (changedProperties.has('value')) {
17511
+ // Apply value selection synchronously so that static-HTML fixtures
17512
+ // resolve within a single update cycle. The refactored selectByValue
17513
+ // no longer calls reset() first, so the destructive intermediate-event
17514
+ // cascade that originally required deferral is eliminated. If option
17515
+ // keys are not yet resolved (framework mount-order race), selectByValue
17516
+ // queues a bounded retry automatically via queuePendingValue.
17517
+ if (changedProperties.has('value') && !this.internalUpdateInProgress) {
17407
17518
  this.menuService.selectByValue(this.value);
17408
17519
  }
17409
17520
 
@@ -17583,12 +17694,13 @@ class AuroMenu extends AuroElement {
17583
17694
  * @param {any} source - The source that triggers this event.
17584
17695
  * @private
17585
17696
  */
17586
- notifySelectionChange({value, stringValue, keys, options} = {}) {
17697
+ notifySelectionChange({value, stringValue, keys, options, reason} = {}) {
17587
17698
  dispatchMenuEvent(this, 'auroMenu-selectedOption', {
17588
17699
  value,
17589
17700
  stringValue,
17590
17701
  keys,
17591
- options
17702
+ options,
17703
+ reason
17592
17704
  });
17593
17705
  }
17594
17706