@aurodesignsystem-dev/auro-formkit 0.0.0-pr1506.0 → 0.0.0-pr1507.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 (48) hide show
  1. package/components/checkbox/demo/customize.min.js +1 -1
  2. package/components/checkbox/demo/getting-started.min.js +1 -1
  3. package/components/checkbox/demo/index.min.js +1 -1
  4. package/components/checkbox/dist/index.js +1 -1
  5. package/components/checkbox/dist/registered.js +1 -1
  6. package/components/combobox/demo/customize.min.js +141 -122
  7. package/components/combobox/demo/getting-started.min.js +141 -122
  8. package/components/combobox/demo/index.min.js +141 -122
  9. package/components/combobox/dist/auro-combobox.d.ts +0 -9
  10. package/components/combobox/dist/index.js +139 -120
  11. package/components/combobox/dist/registered.js +139 -120
  12. package/components/counter/demo/customize.min.js +2 -2
  13. package/components/counter/demo/index.min.js +2 -2
  14. package/components/counter/dist/index.js +2 -2
  15. package/components/counter/dist/registered.js +2 -2
  16. package/components/datepicker/demo/customize.min.js +28 -35
  17. package/components/datepicker/demo/index.min.js +28 -35
  18. package/components/datepicker/dist/index.js +28 -35
  19. package/components/datepicker/dist/registered.js +28 -35
  20. package/components/dropdown/demo/customize.min.js +1 -1
  21. package/components/dropdown/demo/getting-started.min.js +1 -1
  22. package/components/dropdown/demo/index.min.js +1 -1
  23. package/components/dropdown/dist/index.js +1 -1
  24. package/components/dropdown/dist/registered.js +1 -1
  25. package/components/form/demo/customize.min.js +201 -195
  26. package/components/form/demo/getting-started.min.js +201 -195
  27. package/components/form/demo/index.min.js +201 -195
  28. package/components/form/demo/registerDemoDeps.min.js +201 -195
  29. package/components/input/demo/customize.min.js +26 -32
  30. package/components/input/demo/getting-started.min.js +26 -32
  31. package/components/input/demo/index.min.js +26 -32
  32. package/components/input/dist/index.js +26 -32
  33. package/components/input/dist/registered.js +26 -32
  34. package/components/menu/demo/index.min.js +2 -2
  35. package/components/menu/dist/index.js +2 -2
  36. package/components/menu/dist/registered.js +2 -2
  37. package/components/radio/demo/customize.min.js +1 -1
  38. package/components/radio/demo/getting-started.min.js +1 -1
  39. package/components/radio/demo/index.min.js +1 -1
  40. package/components/radio/dist/index.js +1 -1
  41. package/components/radio/dist/registered.js +1 -1
  42. package/components/select/demo/customize.min.js +4 -4
  43. package/components/select/demo/getting-started.min.js +4 -4
  44. package/components/select/demo/index.min.js +4 -4
  45. package/components/select/dist/index.js +2 -2
  46. package/components/select/dist/registered.js +2 -2
  47. package/custom-elements.json +0 -20
  48. package/package.json +1 -1
@@ -825,8 +825,6 @@ function navigateArrow(component, direction, options = {}) {
825
825
  }
826
826
  }
827
827
 
828
- /* eslint-disable no-underscore-dangle */
829
-
830
828
  /**
831
829
  * Returns the clear button element from the active input's shadow
832
830
  * DOM, if available.
@@ -862,9 +860,11 @@ function isClearBtnFocused(ctx, clearBtn = getClearBtn(ctx)) {
862
860
  * @param {Object} menu - The menu component.
863
861
  */
864
862
  function reconcileMenuIndex(menu) {
863
+ // eslint-disable-next-line no-underscore-dangle
865
864
  if (menu._index < 0 && menu.optionActive && menu.items) {
866
865
  const idx = menu.items.indexOf(menu.optionActive);
867
866
  if (idx >= 0) {
867
+ // eslint-disable-next-line no-underscore-dangle
868
868
  menu._index = idx;
869
869
  }
870
870
  }
@@ -4888,7 +4888,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$3 {
4888
4888
  }
4889
4889
  };
4890
4890
 
4891
- var formkitVersion$2 = '202606190840';
4891
+ var formkitVersion$2 = '202606192121';
4892
4892
 
4893
4893
  let AuroElement$2 = class AuroElement extends i$3 {
4894
4894
  static get properties() {
@@ -16609,7 +16609,6 @@ class AuroInputUtilities {
16609
16609
  const maskOptions = this.getMaskOptions('date', normalizedFormat);
16610
16610
 
16611
16611
  if (!(valueObject instanceof Date) || Number.isNaN(valueObject.getTime()) || !maskOptions || typeof maskOptions.format !== 'function') {
16612
- console.debug('Invalid date object or mask options for formatting', { valueObject, maskOptions }); // eslint-disable-line no-console
16613
16612
  return undefined;
16614
16613
  }
16615
16614
 
@@ -17420,6 +17419,10 @@ class BaseInput extends AuroElement$1 {
17420
17419
  this.wrapperElement.addEventListener('click', this.handleClick);
17421
17420
  }
17422
17421
 
17422
+ // add attribute for query selectors when auro-input is registered under a custom name
17423
+ if (this.tagName.toLowerCase() !== 'auro-input' && !this.hasAttribute('auro-input')) {
17424
+ this.setAttribute('auro-input', '');
17425
+ }
17423
17426
  this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
17424
17427
 
17425
17428
  // use validity message override if declared when initializing the component
@@ -17590,14 +17593,14 @@ class BaseInput extends AuroElement$1 {
17590
17593
 
17591
17594
  if (formattedValue !== this.inputElement.value) {
17592
17595
  this.skipNextProgrammaticInputEvent = true;
17593
- if (this.maskInstance && this.type !== 'date') {
17596
+ if (this.maskInstance && this.type === 'credit-card') {
17594
17597
  // Route through the mask so its _value and el.value stay in lock-step
17595
17598
  // (set value calls updateControl which writes el.value = displayValue).
17596
17599
  // Writing el.value directly leaves the mask thinking displayValue is
17597
- // stale; _saveSelection on the next focus/click then warns. Date is
17598
- // excluded because its formattedValue can be raw ISO when the calendar
17599
- // is invalid, and re-masking through mm/dd/yyyy would truncate it and
17600
- // flip validity from patternMismatch to tooShort.
17600
+ // stale; _saveSelection on the next focus/click then warns. Scoped to
17601
+ // credit-card so date's own formattedValue (raw ISO when calendar-invalid)
17602
+ // isn't re-masked through the mm/dd/yyyy mask, which would truncate it
17603
+ // and flip validity from patternMismatch to tooShort.
17601
17604
  this.maskInstance.value = formattedValue || '';
17602
17605
  } else if (formattedValue) {
17603
17606
  this.inputElement.value = formattedValue;
@@ -17708,33 +17711,31 @@ class BaseInput extends AuroElement$1 {
17708
17711
  * @returns {void}
17709
17712
  */
17710
17713
  configureAutoFormatting() {
17711
- // _configuringMask gates two things: external re-entry into this method
17712
- // while setup is mid-flight (from property changes that call back here),
17713
- // and the accept/complete listeners below both need to ignore the mask
17714
- // events fired by our own value-restore step.
17714
+ // Re-entrancy guard. The patched-setter's synthetic input event (suppressed
17715
+ // by _configuringMask above) could otherwise trigger handleInput
17716
+ // processCreditCard configureAutoFormatting before the outer call's
17717
+ // set value has finished its alignCursor pass.
17715
17718
  if (this._configuringMask) return;
17716
17719
  this._configuringMask = true;
17717
17720
  try {
17718
- // Destroy any prior mask so IMask can attach fresh under the new format.
17719
17721
  if (this.maskInstance) {
17720
17722
  this.maskInstance.destroy();
17721
17723
  }
17722
17724
 
17725
+ // Pass new format to util
17723
17726
  this.util.updateFormat(this.format);
17724
17727
 
17725
17728
  const maskOptions = this.util.getMaskOptions(this.type, this.format);
17726
17729
 
17727
17730
  if (this.inputElement && maskOptions.mask) {
17728
- // Capture the current display so it can be re-applied after IMask
17729
- // attaches. The restore at the bottom goes through maskInstance.value
17730
- // (not inputElement.value directly) so the mask's internal state and
17731
- // the input's displayed text stay in lock-step.
17732
- let existingValue = this.inputElement.value;
17733
17731
 
17734
- // Format-change case (e.g. locale switch): existingValue is the OLD
17735
- // mask's display string and may not parse under the new mask. When
17736
- // we have a valid date model, rebuild the display from valueObject
17737
- // (the canonical source) using the new mask's format function.
17732
+ // Stash and clear any existing value before IMask init.
17733
+ // IMask's constructor processes the current input value which requires
17734
+ // selection state clearing first avoids that scenario entirely.
17735
+ // When the format changes (e.g. locale switch) and we have a valid ISO
17736
+ // model value, compute the display string for the NEW format instead of
17737
+ // re-using the old display string, which may be invalid in the new mask.
17738
+ let existingValue = this.inputElement.value;
17738
17739
  if (
17739
17740
  this.util.isFullDateFormat(this.type, this.format) &&
17740
17741
  this.value &&
@@ -17746,18 +17747,15 @@ class BaseInput extends AuroElement$1 {
17746
17747
  existingValue = maskOptions.format(this.valueObject);
17747
17748
  }
17748
17749
 
17749
- // Clear before IMask attaches so the constructor seeds an empty
17750
- // internal value. Otherwise IMask reads the stale unmasked string
17751
- // and emits a spurious 'accept' before the restore below runs.
17752
17750
  this.skipNextProgrammaticInputEvent = true;
17753
17751
  this.inputElement.value = '';
17754
17752
 
17755
17753
  this.maskInstance = IMask(this.inputElement, maskOptions);
17756
17754
 
17757
- // Mask fires 'accept' on every value change, including the restore
17758
- // step below. Skip events fired during configureAutoFormatting so
17759
- // we don't overwrite a value the parent just pushed.
17760
17755
  this.maskInstance.on('accept', () => {
17756
+ // Suppress propagation during configureAutoFormatting's own value-restoration
17757
+ // (line below) — the mask emits 'accept' on every value-set, including ours,
17758
+ // and we don't want to overwrite a value the parent just pushed.
17761
17759
  if (this._configuringMask) return;
17762
17760
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
17763
17761
  if (this.type === "date") {
@@ -17765,8 +17763,6 @@ class BaseInput extends AuroElement$1 {
17765
17763
  }
17766
17764
  });
17767
17765
 
17768
- // Mask fires 'complete' on the restore step below for any value that
17769
- // happens to be a complete match. Same setup-suppression as 'accept'.
17770
17766
  this.maskInstance.on('complete', () => {
17771
17767
  if (this._configuringMask) return;
17772
17768
  this.value = this.util.toModelValue(this.maskInstance.value, this.format);
@@ -17775,9 +17771,7 @@ class BaseInput extends AuroElement$1 {
17775
17771
  }
17776
17772
  });
17777
17773
 
17778
- // Write existingValue through the mask (not the input directly) so
17779
- // the mask reformats it under the new rules and keeps its internal
17780
- // _value aligned with the input's displayed text.
17774
+ // Restore the stashed value through IMask so it's properly masked
17781
17775
  if (existingValue) {
17782
17776
  this.maskInstance.value = existingValue;
17783
17777
  }
@@ -18483,7 +18477,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$3 {
18483
18477
  }
18484
18478
  };
18485
18479
 
18486
- var formkitVersion$1 = '202606190840';
18480
+ var formkitVersion$1 = '202606192121';
18487
18481
 
18488
18482
  // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
18489
18483
  // See LICENSE in the project root for license information.
@@ -19604,7 +19598,7 @@ class AuroBibtemplate extends i$3 {
19604
19598
  }
19605
19599
  }
19606
19600
 
19607
- var formkitVersion = '202606190840';
19601
+ var formkitVersion = '202606192121';
19608
19602
 
19609
19603
  var styleCss$3 = i$6`.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}`;
19610
19604
 
@@ -20591,7 +20585,7 @@ class AuroCombobox extends AuroElement {
20591
20585
  if (this.menu) {
20592
20586
  this.menu.matchWord = normalizeFilterValue(this.input.value);
20593
20587
  }
20594
- const label = getOptionLabel(this.menu.optionSelected);
20588
+ const label = getOptionLabel(this.menu.optionSelected) || this.menu.currentLabel;
20595
20589
  this.updateTriggerTextDisplay(label || this.value);
20596
20590
  }
20597
20591
 
@@ -20605,9 +20599,40 @@ class AuroCombobox extends AuroElement {
20605
20599
  // in suggestion mode, do not override input value if no selection has been made and the input currently has focus
20606
20600
  const isInputFocusedWithNoSelection = !this.menu.value && (this.input.matches(':focus-within') || (this.inputInBib && this.inputInBib.matches(':focus-within')));
20607
20601
 
20608
- const suppressed = this.persistInput || (this.behavior === 'suggestion' && isInputFocusedWithNoSelection);
20609
- if (!suppressed) {
20610
- this.syncInputValuesAcrossTriggerAndBib(label || this.value);
20602
+ if (!this.persistInput && !(this.behavior === 'suggestion' && isInputFocusedWithNoSelection)) {
20603
+ const nextValue = label || this.value;
20604
+ // Only set the flag when there's an actual write to suppress —
20605
+ // syncValuesAndStates re-enters here during typing when both inputs
20606
+ // already match, and a no-op flag flip would make the bib branch's
20607
+ // bail eat legitimate user-input events.
20608
+ const triggerNeedsSync = this.input.value !== nextValue;
20609
+ const bibNeedsSync = Boolean(this.inputInBib && this.inputInBib !== this.input && this.inputInBib.value !== nextValue);
20610
+ if (triggerNeedsSync || bibNeedsSync) {
20611
+ this._syncingDisplayValue = true;
20612
+ if (triggerNeedsSync) {
20613
+ this.input.value = nextValue;
20614
+ }
20615
+ if (bibNeedsSync) {
20616
+ this.inputInBib.value = nextValue;
20617
+ }
20618
+ const pending = [];
20619
+ if (triggerNeedsSync) {
20620
+ pending.push(this.input.updateComplete);
20621
+ }
20622
+ if (bibNeedsSync) {
20623
+ pending.push(this.inputInBib.updateComplete);
20624
+ }
20625
+ Promise.all(pending).then(() => {
20626
+ // imask reasserts otherwise, and handleBlur reverts to its stale value.
20627
+ if (triggerNeedsSync && this.input.maskInstance && typeof this.input.maskInstance.updateValue === 'function') {
20628
+ this.input.maskInstance.updateValue();
20629
+ }
20630
+ if (bibNeedsSync && this.inputInBib && this.inputInBib.maskInstance && typeof this.inputInBib.maskInstance.updateValue === 'function') {
20631
+ this.inputInBib.maskInstance.updateValue();
20632
+ }
20633
+ this._syncingDisplayValue = false;
20634
+ });
20635
+ }
20611
20636
  }
20612
20637
 
20613
20638
  // update the displayValue in the trigger if displayValue slot content is present
@@ -20635,52 +20660,6 @@ class AuroCombobox extends AuroElement {
20635
20660
  this.requestUpdate();
20636
20661
  }
20637
20662
 
20638
- /**
20639
- * Writes nextValue to the trigger input and the bib input when their current
20640
- * value differs, then re-asserts imask after Lit's update flushes.
20641
- * @param {string} nextValue - The value to write to both inputs.
20642
- * @returns {Promise<void> | null} Promise that resolves after the inputs flush,
20643
- * or null when no sync was needed (so callers can skip post-flush work).
20644
- * @private
20645
- */
20646
- syncInputValuesAcrossTriggerAndBib(nextValue) {
20647
- // Only set the flag when there's an actual write to suppress —
20648
- // syncValuesAndStates re-enters here during typing when both inputs
20649
- // already match, and a no-op flag flip would make the bib branch's
20650
- // bail eat legitimate user-input events.
20651
- const triggerNeedsSync = this.input.value !== nextValue;
20652
- const bibNeedsSync = Boolean(this.inputInBib && this.inputInBib !== this.input && this.inputInBib.value !== nextValue);
20653
- if (!triggerNeedsSync && !bibNeedsSync) {
20654
- return null;
20655
- }
20656
-
20657
- this._syncingDisplayValue = true;
20658
- if (triggerNeedsSync) {
20659
- this.input.value = nextValue;
20660
- }
20661
- if (bibNeedsSync) {
20662
- this.inputInBib.value = nextValue;
20663
- }
20664
-
20665
- const pending = [];
20666
- if (triggerNeedsSync) {
20667
- pending.push(this.input.updateComplete);
20668
- }
20669
- if (bibNeedsSync) {
20670
- pending.push(this.inputInBib.updateComplete);
20671
- }
20672
- return Promise.all(pending).then(() => {
20673
- // imask reasserts otherwise, and handleBlur reverts to its stale value.
20674
- if (triggerNeedsSync && this.input.maskInstance && typeof this.input.maskInstance.updateValue === 'function') {
20675
- this.input.maskInstance.updateValue();
20676
- }
20677
- if (bibNeedsSync && this.inputInBib && this.inputInBib.maskInstance && typeof this.inputInBib.maskInstance.updateValue === 'function') {
20678
- this.inputInBib.maskInstance.updateValue();
20679
- }
20680
- this._syncingDisplayValue = false;
20681
- });
20682
- }
20683
-
20684
20663
  /**
20685
20664
  * Processes hidden state of all menu options and determines if there are any available options not hidden.
20686
20665
  * @private
@@ -20708,9 +20687,9 @@ class AuroCombobox extends AuroElement {
20708
20687
  this.syncValuesAndStates();
20709
20688
  }
20710
20689
 
20711
- // Re-activate when optionActive is not in the current scrollable viewport,
20712
- // or when _index has been reset (e.g. by clearSelection in an async update)
20713
- // so that makeSelection() can find the correct option.
20690
+ // Re-activate when optionActive is no longer visible, or when _index has
20691
+ // been reset (e.g. by clearSelection in an async update) so that
20692
+ // makeSelection() can find the correct option.
20714
20693
  if (!this.availableOptions.includes(this.menu.optionActive) || this.menu._index < 0) {
20715
20694
  this.activateFirstEnabledAvailableOption();
20716
20695
  }
@@ -20844,25 +20823,28 @@ class AuroCombobox extends AuroElement {
20844
20823
 
20845
20824
  guardTouchPassthrough(this.menu);
20846
20825
 
20847
- // showModal() takes focus away from the trigger. Early focus once
20848
- // the dialog has painted; the shared doubleRaf below is the fallback
20849
- // for when the dialog needs an extra frame and also clears the
20850
- // validation guard.
20826
+ // The dialog's showModal() steals focus from the trigger.
20827
+ // A single rAF is enough for the dialog DOM to be painted and
20828
+ // focusable, then doubleRaf finalizes the transition.
20851
20829
  requestAnimationFrame(() => {
20852
20830
  this.setInputFocus();
20853
20831
  });
20854
- }
20855
- // else (desktop popover-open): Chrome resets the trigger caret to
20856
- // [0, 0] when its floating <label for="…"> overlay receives focus.
20857
- // The shared doubleRaf below parks the caret back at end-of-text
20858
- // after the dropdown layout settles.
20859
-
20860
- doubleRaf(() => {
20861
- this.setInputFocus();
20862
- if (this._inFullscreenTransition) {
20832
+
20833
+ doubleRaf(() => {
20834
+ this.setInputFocus();
20863
20835
  this._inFullscreenTransition = false;
20864
- }
20865
- });
20836
+ });
20837
+ } else {
20838
+ // Desktop popover-open: restore the trigger caret to end-of-text.
20839
+ // Clicking the trigger lands on auro-input's floating <label for="…">
20840
+ // overlay; Chrome resets the native input's selection to [0, 0] on
20841
+ // label-focus before any JS runs. setInputFocus()'s non-fullscreen
20842
+ // branch parks the caret at end. doubleRaf lets the dropdown layout
20843
+ // settle first, matching the fullscreen branch timing.
20844
+ doubleRaf(() => {
20845
+ this.setInputFocus();
20846
+ });
20847
+ }
20866
20848
  }
20867
20849
  });
20868
20850
 
@@ -20969,9 +20951,9 @@ class AuroCombobox extends AuroElement {
20969
20951
  } else {
20970
20952
  // Safety net for the strategy-change setTimeout: a viewport-crossing
20971
20953
  // fullscreen→floating switch can close the dialog and leave focus on
20972
- // body. Every other call into this branch already has focus on the
20973
- // input via the combobox-level focusin → this.focus() redirect, so
20974
- // this is a no-op in the common case.
20954
+ // body. Every other Branch 2 callsite already has focus on the input
20955
+ // via the focusin → this.focus() redirect (L1448-1452), so this is a
20956
+ // no-op in the common case.
20975
20957
  if (!this.input.componentHasFocus) {
20976
20958
  this.input.focus();
20977
20959
  }
@@ -21090,7 +21072,7 @@ class AuroCombobox extends AuroElement {
21090
21072
  if (this.menu.optionSelected) {
21091
21073
  const selected = this.menu.optionSelected;
21092
21074
 
21093
- if (this.optionSelected !== selected) {
21075
+ if (!this.optionSelected || this.optionSelected !== selected) {
21094
21076
  this.optionSelected = selected;
21095
21077
  }
21096
21078
 
@@ -21103,7 +21085,7 @@ class AuroCombobox extends AuroElement {
21103
21085
  }
21104
21086
 
21105
21087
  // Update display
21106
- this.updateTriggerTextDisplay(getOptionLabel(this.optionSelected));
21088
+ this.updateTriggerTextDisplay(getOptionLabel(this.optionSelected) || this.menu.value);
21107
21089
 
21108
21090
  // Update match word for filtering
21109
21091
  const trimmedInput = normalizeFilterValue(this.input.value);
@@ -21485,7 +21467,15 @@ class AuroCombobox extends AuroElement {
21485
21467
  this.menu.value = undefined;
21486
21468
  this.validation.reset(this);
21487
21469
  this.touched = false;
21470
+ // Force validity back to the cleared state. validation.reset() calls
21471
+ // validate() at the end, and (post-credit-card-fix) the trigger input's
21472
+ // residual validity may still be copied into the combobox by the
21473
+ // auroInputElements loop. Explicitly clear here so reset() actually
21474
+ // leaves the component in a "no validity" state.
21488
21475
  this.validity = undefined;
21476
+ this.errorMessage = '';
21477
+ this.input.validity = undefined;
21478
+ this.input.errorMessage = '';
21489
21479
  }
21490
21480
 
21491
21481
  /**
@@ -21538,23 +21528,52 @@ class AuroCombobox extends AuroElement {
21538
21528
  this.input.value = this.value;
21539
21529
  }
21540
21530
 
21541
- // Sync menu.value only when an option actually matches, or when filter
21542
- // mode needs setMenuValue to dispatch auroMenu-selectValueFailure (the
21543
- // listener at line 1206 clears combobox.value, mirroring select's
21544
- // pattern). Otherwise sync the input display for freeform values.
21531
+ // Sync menu.value only when an option actually matches; otherwise clear it.
21545
21532
  if (this.menu.options && this.menu.options.length > 0) {
21546
- if (this.menu.options.some((opt) => opt.value === this.value) || this.behavior === 'filter') {
21533
+ if (this.menu.options.some((opt) => opt.value === this.value)) {
21534
+ this.setMenuValue(this.value);
21535
+ } else if (this.behavior === 'filter') {
21536
+ // In filter mode, freeform values aren't allowed. Push the unmatched
21537
+ // value through setMenuValue so menu dispatches auroMenu-selectValueFailure
21538
+ // and the listener at line 1206 clears combobox.value (mirrors select's
21539
+ // pattern). Bypassing setMenuValue here would skip the failure cascade.
21547
21540
  this.setMenuValue(this.value);
21548
21541
  } else {
21549
21542
  if (this.menu.value) {
21550
21543
  this.menu.value = undefined;
21551
21544
  }
21552
- // Suggestion-mode freeform value: sync the trigger + bib to show it,
21553
- // then refresh the filter once the inputs flush (handleInputValueChange
21554
- // bailed on _syncingDisplayValue).
21555
- const syncPromise = this.syncInputValuesAcrossTriggerAndBib(this.value || '');
21556
- if (syncPromise) {
21557
- syncPromise.then(() => {
21545
+ // Sync the display for programmatic freeform value changes (e.g. the
21546
+ // swap-values pattern). Guard with _syncingDisplayValue so that the
21547
+ // re-entrant input event from base-input.notifyValueChanged() is
21548
+ // ignored by handleInputValueChange. Skip the sync when input already
21549
+ // matches to avoid spurious events during the normal typing path.
21550
+ const nextValue = this.value || '';
21551
+ const triggerNeedsSync = this.input.value !== nextValue;
21552
+ const bibNeedsSync = Boolean(this.inputInBib && this.inputInBib !== this.input && this.inputInBib.value !== nextValue);
21553
+ if (triggerNeedsSync || bibNeedsSync) {
21554
+ this._syncingDisplayValue = true;
21555
+ if (triggerNeedsSync) {
21556
+ this.input.value = nextValue;
21557
+ }
21558
+ if (bibNeedsSync) {
21559
+ this.inputInBib.value = nextValue;
21560
+ }
21561
+ const pending = [];
21562
+ if (triggerNeedsSync) {
21563
+ pending.push(this.input.updateComplete);
21564
+ }
21565
+ if (bibNeedsSync) {
21566
+ pending.push(this.inputInBib.updateComplete);
21567
+ }
21568
+ Promise.all(pending).then(() => {
21569
+ if (triggerNeedsSync && this.input.maskInstance && typeof this.input.maskInstance.updateValue === 'function') {
21570
+ this.input.maskInstance.updateValue();
21571
+ }
21572
+ if (bibNeedsSync && this.inputInBib && this.inputInBib.maskInstance && typeof this.inputInBib.maskInstance.updateValue === 'function') {
21573
+ this.inputInBib.maskInstance.updateValue();
21574
+ }
21575
+ this._syncingDisplayValue = false;
21576
+ // handleInputValueChange bailed on the flag — refresh the filter.
21558
21577
  this._programmaticFilterRefresh = true;
21559
21578
  this.handleMenuOptions();
21560
21579
  setTimeout(() => {
@@ -22160,8 +22179,8 @@ class AuroMenu extends AuroElement {
22160
22179
  // Malformed JSON (e.g. a literal string that happens to start with "[") falls back
22161
22180
  // to a single-item array rather than throwing during render.
22162
22181
  try {
22163
- const parsed = JSON.parse(this.value);
22164
- return Array.isArray(parsed) ? parsed : [this.value];
22182
+ // any valid JSON starting with `[` ALWAYS parses to an array
22183
+ return JSON.parse(this.value);
22165
22184
  } catch {
22166
22185
  return [this.value];
22167
22186
  }
@@ -412,15 +412,6 @@ export class AuroCombobox extends AuroElement {
412
412
  * @private
413
413
  */
414
414
  private updateTriggerTextDisplay;
415
- /**
416
- * Writes nextValue to the trigger input and the bib input when their current
417
- * value differs, then re-asserts imask after Lit's update flushes.
418
- * @param {string} nextValue - The value to write to both inputs.
419
- * @returns {Promise<void> | null} Promise that resolves after the inputs flush,
420
- * or null when no sync was needed (so callers can skip post-flush work).
421
- * @private
422
- */
423
- private syncInputValuesAcrossTriggerAndBib;
424
415
  _syncingDisplayValue: boolean | undefined;
425
416
  /**
426
417
  * Processes hidden state of all menu options and determines if there are any available options not hidden.