@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.
- package/components/checkbox/demo/customize.min.js +1 -1
- package/components/checkbox/demo/getting-started.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/customize.min.js +141 -122
- package/components/combobox/demo/getting-started.min.js +141 -122
- package/components/combobox/demo/index.min.js +141 -122
- package/components/combobox/dist/auro-combobox.d.ts +0 -9
- package/components/combobox/dist/index.js +139 -120
- package/components/combobox/dist/registered.js +139 -120
- package/components/counter/demo/customize.min.js +2 -2
- package/components/counter/demo/index.min.js +2 -2
- package/components/counter/dist/index.js +2 -2
- package/components/counter/dist/registered.js +2 -2
- package/components/datepicker/demo/customize.min.js +28 -35
- package/components/datepicker/demo/index.min.js +28 -35
- package/components/datepicker/dist/index.js +28 -35
- package/components/datepicker/dist/registered.js +28 -35
- package/components/dropdown/demo/customize.min.js +1 -1
- package/components/dropdown/demo/getting-started.min.js +1 -1
- package/components/dropdown/demo/index.min.js +1 -1
- package/components/dropdown/dist/index.js +1 -1
- package/components/dropdown/dist/registered.js +1 -1
- package/components/form/demo/customize.min.js +201 -195
- package/components/form/demo/getting-started.min.js +201 -195
- package/components/form/demo/index.min.js +201 -195
- package/components/form/demo/registerDemoDeps.min.js +201 -195
- package/components/input/demo/customize.min.js +26 -32
- package/components/input/demo/getting-started.min.js +26 -32
- package/components/input/demo/index.min.js +26 -32
- package/components/input/dist/index.js +26 -32
- package/components/input/dist/registered.js +26 -32
- package/components/menu/demo/index.min.js +2 -2
- package/components/menu/dist/index.js +2 -2
- package/components/menu/dist/registered.js +2 -2
- package/components/radio/demo/customize.min.js +1 -1
- package/components/radio/demo/getting-started.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/customize.min.js +4 -4
- package/components/select/demo/getting-started.min.js +4 -4
- package/components/select/demo/index.min.js +4 -4
- package/components/select/dist/index.js +2 -2
- package/components/select/dist/registered.js +2 -2
- package/custom-elements.json +0 -20
- package/package.json +1 -1
|
@@ -810,8 +810,6 @@ function navigateArrow(component, direction, options = {}) {
|
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
812
|
|
|
813
|
-
/* eslint-disable no-underscore-dangle */
|
|
814
|
-
|
|
815
813
|
/**
|
|
816
814
|
* Returns the clear button element from the active input's shadow
|
|
817
815
|
* DOM, if available.
|
|
@@ -847,9 +845,11 @@ function isClearBtnFocused(ctx, clearBtn = getClearBtn(ctx)) {
|
|
|
847
845
|
* @param {Object} menu - The menu component.
|
|
848
846
|
*/
|
|
849
847
|
function reconcileMenuIndex(menu) {
|
|
848
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
850
849
|
if (menu._index < 0 && menu.optionActive && menu.items) {
|
|
851
850
|
const idx = menu.items.indexOf(menu.optionActive);
|
|
852
851
|
if (idx >= 0) {
|
|
852
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
853
853
|
menu._index = idx;
|
|
854
854
|
}
|
|
855
855
|
}
|
|
@@ -4873,7 +4873,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$3 {
|
|
|
4873
4873
|
}
|
|
4874
4874
|
};
|
|
4875
4875
|
|
|
4876
|
-
var formkitVersion$2 = '
|
|
4876
|
+
var formkitVersion$2 = '202606192121';
|
|
4877
4877
|
|
|
4878
4878
|
let AuroElement$2 = class AuroElement extends i$3 {
|
|
4879
4879
|
static get properties() {
|
|
@@ -16594,7 +16594,6 @@ class AuroInputUtilities {
|
|
|
16594
16594
|
const maskOptions = this.getMaskOptions('date', normalizedFormat);
|
|
16595
16595
|
|
|
16596
16596
|
if (!(valueObject instanceof Date) || Number.isNaN(valueObject.getTime()) || !maskOptions || typeof maskOptions.format !== 'function') {
|
|
16597
|
-
console.debug('Invalid date object or mask options for formatting', { valueObject, maskOptions }); // eslint-disable-line no-console
|
|
16598
16597
|
return undefined;
|
|
16599
16598
|
}
|
|
16600
16599
|
|
|
@@ -17405,6 +17404,10 @@ class BaseInput extends AuroElement$1 {
|
|
|
17405
17404
|
this.wrapperElement.addEventListener('click', this.handleClick);
|
|
17406
17405
|
}
|
|
17407
17406
|
|
|
17407
|
+
// add attribute for query selectors when auro-input is registered under a custom name
|
|
17408
|
+
if (this.tagName.toLowerCase() !== 'auro-input' && !this.hasAttribute('auro-input')) {
|
|
17409
|
+
this.setAttribute('auro-input', '');
|
|
17410
|
+
}
|
|
17408
17411
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
17409
17412
|
|
|
17410
17413
|
// use validity message override if declared when initializing the component
|
|
@@ -17575,14 +17578,14 @@ class BaseInput extends AuroElement$1 {
|
|
|
17575
17578
|
|
|
17576
17579
|
if (formattedValue !== this.inputElement.value) {
|
|
17577
17580
|
this.skipNextProgrammaticInputEvent = true;
|
|
17578
|
-
if (this.maskInstance && this.type
|
|
17581
|
+
if (this.maskInstance && this.type === 'credit-card') {
|
|
17579
17582
|
// Route through the mask so its _value and el.value stay in lock-step
|
|
17580
17583
|
// (set value calls updateControl which writes el.value = displayValue).
|
|
17581
17584
|
// Writing el.value directly leaves the mask thinking displayValue is
|
|
17582
|
-
// stale; _saveSelection on the next focus/click then warns.
|
|
17583
|
-
//
|
|
17584
|
-
//
|
|
17585
|
-
// flip validity from patternMismatch to tooShort.
|
|
17585
|
+
// stale; _saveSelection on the next focus/click then warns. Scoped to
|
|
17586
|
+
// credit-card so date's own formattedValue (raw ISO when calendar-invalid)
|
|
17587
|
+
// isn't re-masked through the mm/dd/yyyy mask, which would truncate it
|
|
17588
|
+
// and flip validity from patternMismatch to tooShort.
|
|
17586
17589
|
this.maskInstance.value = formattedValue || '';
|
|
17587
17590
|
} else if (formattedValue) {
|
|
17588
17591
|
this.inputElement.value = formattedValue;
|
|
@@ -17693,33 +17696,31 @@ class BaseInput extends AuroElement$1 {
|
|
|
17693
17696
|
* @returns {void}
|
|
17694
17697
|
*/
|
|
17695
17698
|
configureAutoFormatting() {
|
|
17696
|
-
//
|
|
17697
|
-
//
|
|
17698
|
-
//
|
|
17699
|
-
//
|
|
17699
|
+
// Re-entrancy guard. The patched-setter's synthetic input event (suppressed
|
|
17700
|
+
// by _configuringMask above) could otherwise trigger handleInput →
|
|
17701
|
+
// processCreditCard → configureAutoFormatting before the outer call's
|
|
17702
|
+
// set value has finished its alignCursor pass.
|
|
17700
17703
|
if (this._configuringMask) return;
|
|
17701
17704
|
this._configuringMask = true;
|
|
17702
17705
|
try {
|
|
17703
|
-
// Destroy any prior mask so IMask can attach fresh under the new format.
|
|
17704
17706
|
if (this.maskInstance) {
|
|
17705
17707
|
this.maskInstance.destroy();
|
|
17706
17708
|
}
|
|
17707
17709
|
|
|
17710
|
+
// Pass new format to util
|
|
17708
17711
|
this.util.updateFormat(this.format);
|
|
17709
17712
|
|
|
17710
17713
|
const maskOptions = this.util.getMaskOptions(this.type, this.format);
|
|
17711
17714
|
|
|
17712
17715
|
if (this.inputElement && maskOptions.mask) {
|
|
17713
|
-
// Capture the current display so it can be re-applied after IMask
|
|
17714
|
-
// attaches. The restore at the bottom goes through maskInstance.value
|
|
17715
|
-
// (not inputElement.value directly) so the mask's internal state and
|
|
17716
|
-
// the input's displayed text stay in lock-step.
|
|
17717
|
-
let existingValue = this.inputElement.value;
|
|
17718
17716
|
|
|
17719
|
-
//
|
|
17720
|
-
//
|
|
17721
|
-
//
|
|
17722
|
-
//
|
|
17717
|
+
// Stash and clear any existing value before IMask init.
|
|
17718
|
+
// IMask's constructor processes the current input value which requires
|
|
17719
|
+
// selection state — clearing first avoids that scenario entirely.
|
|
17720
|
+
// When the format changes (e.g. locale switch) and we have a valid ISO
|
|
17721
|
+
// model value, compute the display string for the NEW format instead of
|
|
17722
|
+
// re-using the old display string, which may be invalid in the new mask.
|
|
17723
|
+
let existingValue = this.inputElement.value;
|
|
17723
17724
|
if (
|
|
17724
17725
|
this.util.isFullDateFormat(this.type, this.format) &&
|
|
17725
17726
|
this.value &&
|
|
@@ -17731,18 +17732,15 @@ class BaseInput extends AuroElement$1 {
|
|
|
17731
17732
|
existingValue = maskOptions.format(this.valueObject);
|
|
17732
17733
|
}
|
|
17733
17734
|
|
|
17734
|
-
// Clear before IMask attaches so the constructor seeds an empty
|
|
17735
|
-
// internal value. Otherwise IMask reads the stale unmasked string
|
|
17736
|
-
// and emits a spurious 'accept' before the restore below runs.
|
|
17737
17735
|
this.skipNextProgrammaticInputEvent = true;
|
|
17738
17736
|
this.inputElement.value = '';
|
|
17739
17737
|
|
|
17740
17738
|
this.maskInstance = IMask(this.inputElement, maskOptions);
|
|
17741
17739
|
|
|
17742
|
-
// Mask fires 'accept' on every value change, including the restore
|
|
17743
|
-
// step below. Skip events fired during configureAutoFormatting so
|
|
17744
|
-
// we don't overwrite a value the parent just pushed.
|
|
17745
17740
|
this.maskInstance.on('accept', () => {
|
|
17741
|
+
// Suppress propagation during configureAutoFormatting's own value-restoration
|
|
17742
|
+
// (line below) — the mask emits 'accept' on every value-set, including ours,
|
|
17743
|
+
// and we don't want to overwrite a value the parent just pushed.
|
|
17746
17744
|
if (this._configuringMask) return;
|
|
17747
17745
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
17748
17746
|
if (this.type === "date") {
|
|
@@ -17750,8 +17748,6 @@ class BaseInput extends AuroElement$1 {
|
|
|
17750
17748
|
}
|
|
17751
17749
|
});
|
|
17752
17750
|
|
|
17753
|
-
// Mask fires 'complete' on the restore step below for any value that
|
|
17754
|
-
// happens to be a complete match. Same setup-suppression as 'accept'.
|
|
17755
17751
|
this.maskInstance.on('complete', () => {
|
|
17756
17752
|
if (this._configuringMask) return;
|
|
17757
17753
|
this.value = this.util.toModelValue(this.maskInstance.value, this.format);
|
|
@@ -17760,9 +17756,7 @@ class BaseInput extends AuroElement$1 {
|
|
|
17760
17756
|
}
|
|
17761
17757
|
});
|
|
17762
17758
|
|
|
17763
|
-
//
|
|
17764
|
-
// the mask reformats it under the new rules and keeps its internal
|
|
17765
|
-
// _value aligned with the input's displayed text.
|
|
17759
|
+
// Restore the stashed value through IMask so it's properly masked
|
|
17766
17760
|
if (existingValue) {
|
|
17767
17761
|
this.maskInstance.value = existingValue;
|
|
17768
17762
|
}
|
|
@@ -18468,7 +18462,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$3 {
|
|
|
18468
18462
|
}
|
|
18469
18463
|
};
|
|
18470
18464
|
|
|
18471
|
-
var formkitVersion$1 = '
|
|
18465
|
+
var formkitVersion$1 = '202606192121';
|
|
18472
18466
|
|
|
18473
18467
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
18474
18468
|
// See LICENSE in the project root for license information.
|
|
@@ -19589,7 +19583,7 @@ class AuroBibtemplate extends i$3 {
|
|
|
19589
19583
|
}
|
|
19590
19584
|
}
|
|
19591
19585
|
|
|
19592
|
-
var formkitVersion = '
|
|
19586
|
+
var formkitVersion = '202606192121';
|
|
19593
19587
|
|
|
19594
19588
|
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}`;
|
|
19595
19589
|
|
|
@@ -20576,7 +20570,7 @@ class AuroCombobox extends AuroElement {
|
|
|
20576
20570
|
if (this.menu) {
|
|
20577
20571
|
this.menu.matchWord = normalizeFilterValue(this.input.value);
|
|
20578
20572
|
}
|
|
20579
|
-
const label = getOptionLabel(this.menu.optionSelected);
|
|
20573
|
+
const label = getOptionLabel(this.menu.optionSelected) || this.menu.currentLabel;
|
|
20580
20574
|
this.updateTriggerTextDisplay(label || this.value);
|
|
20581
20575
|
}
|
|
20582
20576
|
|
|
@@ -20590,9 +20584,40 @@ class AuroCombobox extends AuroElement {
|
|
|
20590
20584
|
// in suggestion mode, do not override input value if no selection has been made and the input currently has focus
|
|
20591
20585
|
const isInputFocusedWithNoSelection = !this.menu.value && (this.input.matches(':focus-within') || (this.inputInBib && this.inputInBib.matches(':focus-within')));
|
|
20592
20586
|
|
|
20593
|
-
|
|
20594
|
-
|
|
20595
|
-
|
|
20587
|
+
if (!this.persistInput && !(this.behavior === 'suggestion' && isInputFocusedWithNoSelection)) {
|
|
20588
|
+
const nextValue = label || this.value;
|
|
20589
|
+
// Only set the flag when there's an actual write to suppress —
|
|
20590
|
+
// syncValuesAndStates re-enters here during typing when both inputs
|
|
20591
|
+
// already match, and a no-op flag flip would make the bib branch's
|
|
20592
|
+
// bail eat legitimate user-input events.
|
|
20593
|
+
const triggerNeedsSync = this.input.value !== nextValue;
|
|
20594
|
+
const bibNeedsSync = Boolean(this.inputInBib && this.inputInBib !== this.input && this.inputInBib.value !== nextValue);
|
|
20595
|
+
if (triggerNeedsSync || bibNeedsSync) {
|
|
20596
|
+
this._syncingDisplayValue = true;
|
|
20597
|
+
if (triggerNeedsSync) {
|
|
20598
|
+
this.input.value = nextValue;
|
|
20599
|
+
}
|
|
20600
|
+
if (bibNeedsSync) {
|
|
20601
|
+
this.inputInBib.value = nextValue;
|
|
20602
|
+
}
|
|
20603
|
+
const pending = [];
|
|
20604
|
+
if (triggerNeedsSync) {
|
|
20605
|
+
pending.push(this.input.updateComplete);
|
|
20606
|
+
}
|
|
20607
|
+
if (bibNeedsSync) {
|
|
20608
|
+
pending.push(this.inputInBib.updateComplete);
|
|
20609
|
+
}
|
|
20610
|
+
Promise.all(pending).then(() => {
|
|
20611
|
+
// imask reasserts otherwise, and handleBlur reverts to its stale value.
|
|
20612
|
+
if (triggerNeedsSync && this.input.maskInstance && typeof this.input.maskInstance.updateValue === 'function') {
|
|
20613
|
+
this.input.maskInstance.updateValue();
|
|
20614
|
+
}
|
|
20615
|
+
if (bibNeedsSync && this.inputInBib && this.inputInBib.maskInstance && typeof this.inputInBib.maskInstance.updateValue === 'function') {
|
|
20616
|
+
this.inputInBib.maskInstance.updateValue();
|
|
20617
|
+
}
|
|
20618
|
+
this._syncingDisplayValue = false;
|
|
20619
|
+
});
|
|
20620
|
+
}
|
|
20596
20621
|
}
|
|
20597
20622
|
|
|
20598
20623
|
// update the displayValue in the trigger if displayValue slot content is present
|
|
@@ -20620,52 +20645,6 @@ class AuroCombobox extends AuroElement {
|
|
|
20620
20645
|
this.requestUpdate();
|
|
20621
20646
|
}
|
|
20622
20647
|
|
|
20623
|
-
/**
|
|
20624
|
-
* Writes nextValue to the trigger input and the bib input when their current
|
|
20625
|
-
* value differs, then re-asserts imask after Lit's update flushes.
|
|
20626
|
-
* @param {string} nextValue - The value to write to both inputs.
|
|
20627
|
-
* @returns {Promise<void> | null} Promise that resolves after the inputs flush,
|
|
20628
|
-
* or null when no sync was needed (so callers can skip post-flush work).
|
|
20629
|
-
* @private
|
|
20630
|
-
*/
|
|
20631
|
-
syncInputValuesAcrossTriggerAndBib(nextValue) {
|
|
20632
|
-
// Only set the flag when there's an actual write to suppress —
|
|
20633
|
-
// syncValuesAndStates re-enters here during typing when both inputs
|
|
20634
|
-
// already match, and a no-op flag flip would make the bib branch's
|
|
20635
|
-
// bail eat legitimate user-input events.
|
|
20636
|
-
const triggerNeedsSync = this.input.value !== nextValue;
|
|
20637
|
-
const bibNeedsSync = Boolean(this.inputInBib && this.inputInBib !== this.input && this.inputInBib.value !== nextValue);
|
|
20638
|
-
if (!triggerNeedsSync && !bibNeedsSync) {
|
|
20639
|
-
return null;
|
|
20640
|
-
}
|
|
20641
|
-
|
|
20642
|
-
this._syncingDisplayValue = true;
|
|
20643
|
-
if (triggerNeedsSync) {
|
|
20644
|
-
this.input.value = nextValue;
|
|
20645
|
-
}
|
|
20646
|
-
if (bibNeedsSync) {
|
|
20647
|
-
this.inputInBib.value = nextValue;
|
|
20648
|
-
}
|
|
20649
|
-
|
|
20650
|
-
const pending = [];
|
|
20651
|
-
if (triggerNeedsSync) {
|
|
20652
|
-
pending.push(this.input.updateComplete);
|
|
20653
|
-
}
|
|
20654
|
-
if (bibNeedsSync) {
|
|
20655
|
-
pending.push(this.inputInBib.updateComplete);
|
|
20656
|
-
}
|
|
20657
|
-
return Promise.all(pending).then(() => {
|
|
20658
|
-
// imask reasserts otherwise, and handleBlur reverts to its stale value.
|
|
20659
|
-
if (triggerNeedsSync && this.input.maskInstance && typeof this.input.maskInstance.updateValue === 'function') {
|
|
20660
|
-
this.input.maskInstance.updateValue();
|
|
20661
|
-
}
|
|
20662
|
-
if (bibNeedsSync && this.inputInBib && this.inputInBib.maskInstance && typeof this.inputInBib.maskInstance.updateValue === 'function') {
|
|
20663
|
-
this.inputInBib.maskInstance.updateValue();
|
|
20664
|
-
}
|
|
20665
|
-
this._syncingDisplayValue = false;
|
|
20666
|
-
});
|
|
20667
|
-
}
|
|
20668
|
-
|
|
20669
20648
|
/**
|
|
20670
20649
|
* Processes hidden state of all menu options and determines if there are any available options not hidden.
|
|
20671
20650
|
* @private
|
|
@@ -20693,9 +20672,9 @@ class AuroCombobox extends AuroElement {
|
|
|
20693
20672
|
this.syncValuesAndStates();
|
|
20694
20673
|
}
|
|
20695
20674
|
|
|
20696
|
-
// Re-activate when optionActive is
|
|
20697
|
-
//
|
|
20698
|
-
//
|
|
20675
|
+
// Re-activate when optionActive is no longer visible, or when _index has
|
|
20676
|
+
// been reset (e.g. by clearSelection in an async update) so that
|
|
20677
|
+
// makeSelection() can find the correct option.
|
|
20699
20678
|
if (!this.availableOptions.includes(this.menu.optionActive) || this.menu._index < 0) {
|
|
20700
20679
|
this.activateFirstEnabledAvailableOption();
|
|
20701
20680
|
}
|
|
@@ -20829,25 +20808,28 @@ class AuroCombobox extends AuroElement {
|
|
|
20829
20808
|
|
|
20830
20809
|
guardTouchPassthrough(this.menu);
|
|
20831
20810
|
|
|
20832
|
-
// showModal()
|
|
20833
|
-
//
|
|
20834
|
-
//
|
|
20835
|
-
// validation guard.
|
|
20811
|
+
// The dialog's showModal() steals focus from the trigger.
|
|
20812
|
+
// A single rAF is enough for the dialog DOM to be painted and
|
|
20813
|
+
// focusable, then doubleRaf finalizes the transition.
|
|
20836
20814
|
requestAnimationFrame(() => {
|
|
20837
20815
|
this.setInputFocus();
|
|
20838
20816
|
});
|
|
20839
|
-
|
|
20840
|
-
|
|
20841
|
-
|
|
20842
|
-
// The shared doubleRaf below parks the caret back at end-of-text
|
|
20843
|
-
// after the dropdown layout settles.
|
|
20844
|
-
|
|
20845
|
-
doubleRaf(() => {
|
|
20846
|
-
this.setInputFocus();
|
|
20847
|
-
if (this._inFullscreenTransition) {
|
|
20817
|
+
|
|
20818
|
+
doubleRaf(() => {
|
|
20819
|
+
this.setInputFocus();
|
|
20848
20820
|
this._inFullscreenTransition = false;
|
|
20849
|
-
}
|
|
20850
|
-
}
|
|
20821
|
+
});
|
|
20822
|
+
} else {
|
|
20823
|
+
// Desktop popover-open: restore the trigger caret to end-of-text.
|
|
20824
|
+
// Clicking the trigger lands on auro-input's floating <label for="…">
|
|
20825
|
+
// overlay; Chrome resets the native input's selection to [0, 0] on
|
|
20826
|
+
// label-focus before any JS runs. setInputFocus()'s non-fullscreen
|
|
20827
|
+
// branch parks the caret at end. doubleRaf lets the dropdown layout
|
|
20828
|
+
// settle first, matching the fullscreen branch timing.
|
|
20829
|
+
doubleRaf(() => {
|
|
20830
|
+
this.setInputFocus();
|
|
20831
|
+
});
|
|
20832
|
+
}
|
|
20851
20833
|
}
|
|
20852
20834
|
});
|
|
20853
20835
|
|
|
@@ -20954,9 +20936,9 @@ class AuroCombobox extends AuroElement {
|
|
|
20954
20936
|
} else {
|
|
20955
20937
|
// Safety net for the strategy-change setTimeout: a viewport-crossing
|
|
20956
20938
|
// fullscreen→floating switch can close the dialog and leave focus on
|
|
20957
|
-
// body. Every other
|
|
20958
|
-
//
|
|
20959
|
-
//
|
|
20939
|
+
// body. Every other Branch 2 callsite already has focus on the input
|
|
20940
|
+
// via the focusin → this.focus() redirect (L1448-1452), so this is a
|
|
20941
|
+
// no-op in the common case.
|
|
20960
20942
|
if (!this.input.componentHasFocus) {
|
|
20961
20943
|
this.input.focus();
|
|
20962
20944
|
}
|
|
@@ -21075,7 +21057,7 @@ class AuroCombobox extends AuroElement {
|
|
|
21075
21057
|
if (this.menu.optionSelected) {
|
|
21076
21058
|
const selected = this.menu.optionSelected;
|
|
21077
21059
|
|
|
21078
|
-
if (this.optionSelected !== selected) {
|
|
21060
|
+
if (!this.optionSelected || this.optionSelected !== selected) {
|
|
21079
21061
|
this.optionSelected = selected;
|
|
21080
21062
|
}
|
|
21081
21063
|
|
|
@@ -21088,7 +21070,7 @@ class AuroCombobox extends AuroElement {
|
|
|
21088
21070
|
}
|
|
21089
21071
|
|
|
21090
21072
|
// Update display
|
|
21091
|
-
this.updateTriggerTextDisplay(getOptionLabel(this.optionSelected));
|
|
21073
|
+
this.updateTriggerTextDisplay(getOptionLabel(this.optionSelected) || this.menu.value);
|
|
21092
21074
|
|
|
21093
21075
|
// Update match word for filtering
|
|
21094
21076
|
const trimmedInput = normalizeFilterValue(this.input.value);
|
|
@@ -21470,7 +21452,15 @@ class AuroCombobox extends AuroElement {
|
|
|
21470
21452
|
this.menu.value = undefined;
|
|
21471
21453
|
this.validation.reset(this);
|
|
21472
21454
|
this.touched = false;
|
|
21455
|
+
// Force validity back to the cleared state. validation.reset() calls
|
|
21456
|
+
// validate() at the end, and (post-credit-card-fix) the trigger input's
|
|
21457
|
+
// residual validity may still be copied into the combobox by the
|
|
21458
|
+
// auroInputElements loop. Explicitly clear here so reset() actually
|
|
21459
|
+
// leaves the component in a "no validity" state.
|
|
21473
21460
|
this.validity = undefined;
|
|
21461
|
+
this.errorMessage = '';
|
|
21462
|
+
this.input.validity = undefined;
|
|
21463
|
+
this.input.errorMessage = '';
|
|
21474
21464
|
}
|
|
21475
21465
|
|
|
21476
21466
|
/**
|
|
@@ -21523,23 +21513,52 @@ class AuroCombobox extends AuroElement {
|
|
|
21523
21513
|
this.input.value = this.value;
|
|
21524
21514
|
}
|
|
21525
21515
|
|
|
21526
|
-
// Sync menu.value only when an option actually matches
|
|
21527
|
-
// mode needs setMenuValue to dispatch auroMenu-selectValueFailure (the
|
|
21528
|
-
// listener at line 1206 clears combobox.value, mirroring select's
|
|
21529
|
-
// pattern). Otherwise sync the input display for freeform values.
|
|
21516
|
+
// Sync menu.value only when an option actually matches; otherwise clear it.
|
|
21530
21517
|
if (this.menu.options && this.menu.options.length > 0) {
|
|
21531
|
-
if (this.menu.options.some((opt) => opt.value === this.value)
|
|
21518
|
+
if (this.menu.options.some((opt) => opt.value === this.value)) {
|
|
21519
|
+
this.setMenuValue(this.value);
|
|
21520
|
+
} else if (this.behavior === 'filter') {
|
|
21521
|
+
// In filter mode, freeform values aren't allowed. Push the unmatched
|
|
21522
|
+
// value through setMenuValue so menu dispatches auroMenu-selectValueFailure
|
|
21523
|
+
// and the listener at line 1206 clears combobox.value (mirrors select's
|
|
21524
|
+
// pattern). Bypassing setMenuValue here would skip the failure cascade.
|
|
21532
21525
|
this.setMenuValue(this.value);
|
|
21533
21526
|
} else {
|
|
21534
21527
|
if (this.menu.value) {
|
|
21535
21528
|
this.menu.value = undefined;
|
|
21536
21529
|
}
|
|
21537
|
-
//
|
|
21538
|
-
//
|
|
21539
|
-
//
|
|
21540
|
-
|
|
21541
|
-
|
|
21542
|
-
|
|
21530
|
+
// Sync the display for programmatic freeform value changes (e.g. the
|
|
21531
|
+
// swap-values pattern). Guard with _syncingDisplayValue so that the
|
|
21532
|
+
// re-entrant input event from base-input.notifyValueChanged() is
|
|
21533
|
+
// ignored by handleInputValueChange. Skip the sync when input already
|
|
21534
|
+
// matches to avoid spurious events during the normal typing path.
|
|
21535
|
+
const nextValue = this.value || '';
|
|
21536
|
+
const triggerNeedsSync = this.input.value !== nextValue;
|
|
21537
|
+
const bibNeedsSync = Boolean(this.inputInBib && this.inputInBib !== this.input && this.inputInBib.value !== nextValue);
|
|
21538
|
+
if (triggerNeedsSync || bibNeedsSync) {
|
|
21539
|
+
this._syncingDisplayValue = true;
|
|
21540
|
+
if (triggerNeedsSync) {
|
|
21541
|
+
this.input.value = nextValue;
|
|
21542
|
+
}
|
|
21543
|
+
if (bibNeedsSync) {
|
|
21544
|
+
this.inputInBib.value = nextValue;
|
|
21545
|
+
}
|
|
21546
|
+
const pending = [];
|
|
21547
|
+
if (triggerNeedsSync) {
|
|
21548
|
+
pending.push(this.input.updateComplete);
|
|
21549
|
+
}
|
|
21550
|
+
if (bibNeedsSync) {
|
|
21551
|
+
pending.push(this.inputInBib.updateComplete);
|
|
21552
|
+
}
|
|
21553
|
+
Promise.all(pending).then(() => {
|
|
21554
|
+
if (triggerNeedsSync && this.input.maskInstance && typeof this.input.maskInstance.updateValue === 'function') {
|
|
21555
|
+
this.input.maskInstance.updateValue();
|
|
21556
|
+
}
|
|
21557
|
+
if (bibNeedsSync && this.inputInBib && this.inputInBib.maskInstance && typeof this.inputInBib.maskInstance.updateValue === 'function') {
|
|
21558
|
+
this.inputInBib.maskInstance.updateValue();
|
|
21559
|
+
}
|
|
21560
|
+
this._syncingDisplayValue = false;
|
|
21561
|
+
// handleInputValueChange bailed on the flag — refresh the filter.
|
|
21543
21562
|
this._programmaticFilterRefresh = true;
|
|
21544
21563
|
this.handleMenuOptions();
|
|
21545
21564
|
setTimeout(() => {
|
|
@@ -22145,8 +22164,8 @@ class AuroMenu extends AuroElement {
|
|
|
22145
22164
|
// Malformed JSON (e.g. a literal string that happens to start with "[") falls back
|
|
22146
22165
|
// to a single-item array rather than throwing during render.
|
|
22147
22166
|
try {
|
|
22148
|
-
|
|
22149
|
-
return
|
|
22167
|
+
// any valid JSON starting with `[` ALWAYS parses to an array
|
|
22168
|
+
return JSON.parse(this.value);
|
|
22150
22169
|
} catch {
|
|
22151
22170
|
return [this.value];
|
|
22152
22171
|
}
|