@aurodesignsystem/auro-formkit 5.1.0-rc-1223.1 → 5.1.0-rc-1237.1

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 (51) hide show
  1. package/CHANGELOG.md +4 -1
  2. package/components/checkbox/demo/api.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/api.md +7 -6
  7. package/components/combobox/demo/api.min.js +1651 -987
  8. package/components/combobox/demo/index.min.js +1651 -987
  9. package/components/combobox/dist/auro-combobox.d.ts +8 -7
  10. package/components/combobox/dist/index.js +87 -86
  11. package/components/combobox/dist/registered.js +87 -86
  12. package/components/counter/demo/api.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/api.min.js +7 -6
  17. package/components/datepicker/demo/index.min.js +7 -6
  18. package/components/datepicker/dist/auro-datepicker.d.ts +1 -1
  19. package/components/datepicker/dist/index.js +7 -6
  20. package/components/datepicker/dist/registered.js +7 -6
  21. package/components/dropdown/demo/api.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/input/demo/api.min.js +2 -1
  26. package/components/input/demo/index.min.js +2 -1
  27. package/components/input/dist/index.js +2 -1
  28. package/components/input/dist/registered.js +2 -1
  29. package/components/menu/demo/api.js +4 -0
  30. package/components/menu/demo/api.md +271 -26
  31. package/components/menu/demo/api.min.js +1591 -863
  32. package/components/menu/demo/index.html +1 -0
  33. package/components/menu/demo/index.js +2 -0
  34. package/components/menu/demo/index.md +95 -1
  35. package/components/menu/demo/index.min.js +1524 -810
  36. package/components/menu/dist/auro-menu.context.d.ts +222 -0
  37. package/components/menu/dist/auro-menu.d.ts +93 -53
  38. package/components/menu/dist/auro-menuoption.d.ts +115 -13
  39. package/components/menu/dist/index.js +1441 -798
  40. package/components/menu/dist/registered.js +1440 -809
  41. package/components/radio/demo/api.min.js +1 -1
  42. package/components/radio/demo/index.min.js +1 -1
  43. package/components/radio/dist/index.js +1 -1
  44. package/components/radio/dist/registered.js +1 -1
  45. package/components/select/demo/api.md +8 -7
  46. package/components/select/demo/api.min.js +1573 -1006
  47. package/components/select/demo/index.min.js +1573 -1006
  48. package/components/select/dist/auro-select.d.ts +11 -35
  49. package/components/select/dist/index.js +64 -160
  50. package/components/select/dist/registered.js +64 -160
  51. package/package.json +2 -1
@@ -345,7 +345,7 @@ export class AuroCombobox extends AuroElement {
345
345
  bibtemplateTag: any;
346
346
  inputTag: any;
347
347
  helpTextTag: any;
348
- availableOptions: any[];
348
+ availableOptions: any[] | any[];
349
349
  dropdownId: any;
350
350
  dropdownOpen: any;
351
351
  errorMessage: any;
@@ -384,11 +384,6 @@ export class AuroCombobox extends AuroElement {
384
384
  * @private
385
385
  */
386
386
  private updateTriggerTextDisplay;
387
- /**
388
- * Resets the menu matchWord to true.
389
- * @private
390
- */
391
- private resetMenuMatchword;
392
387
  /**
393
388
  * Processes hidden state of all menu options and determines if there are any available options not hidden.
394
389
  * @private
@@ -401,7 +396,7 @@ export class AuroCombobox extends AuroElement {
401
396
  * @returns {void}
402
397
  */
403
398
  private generateOptionsArray;
404
- options: any[] | NodeListOf<Element>;
399
+ options: any;
405
400
  /**
406
401
  * Hides the dropdown bib if its open.
407
402
  * @returns {void}
@@ -484,6 +479,12 @@ export class AuroCombobox extends AuroElement {
484
479
  * @returns {void}
485
480
  */
486
481
  focus(): void;
482
+ /**
483
+ * Sets the menu value if menu is available.
484
+ * @param {string} value - The value to set on the menu.
485
+ * @returns {void}
486
+ */
487
+ setMenuValue(value: string): void;
487
488
  /**
488
489
  * Resets component to initial state.
489
490
  * @returns {void}
@@ -4113,7 +4113,7 @@ let AuroHelpText$2 = class AuroHelpText extends LitElement {
4113
4113
  }
4114
4114
  };
4115
4115
 
4116
- var formkitVersion$2 = '202511110102';
4116
+ var formkitVersion$2 = '202511252346';
4117
4117
 
4118
4118
  let AuroElement$2 = class AuroElement extends LitElement {
4119
4119
  static get properties() {
@@ -10801,6 +10801,7 @@ class BaseInput extends AuroElement$1 {
10801
10801
  const inputEvent = new InputEvent('input', {
10802
10802
  bubbles: true,
10803
10803
  composed: true,
10804
+ cancelable: false
10804
10805
  });
10805
10806
  inputEvent.isProgrammatic = true;
10806
10807
  this.dispatchEvent(inputEvent);
@@ -11730,7 +11731,7 @@ let AuroHelpText$1 = class AuroHelpText extends LitElement {
11730
11731
  }
11731
11732
  };
11732
11733
 
11733
- var formkitVersion$1 = '202511110102';
11734
+ var formkitVersion$1 = '202511252346';
11734
11735
 
11735
11736
  // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
11736
11737
  // See LICENSE in the project root for license information.
@@ -12720,7 +12721,7 @@ class AuroBibtemplate extends LitElement {
12720
12721
  }
12721
12722
  }
12722
12723
 
12723
- var formkitVersion = '202511110102';
12724
+ var formkitVersion = '202511252346';
12724
12725
 
12725
12726
  var styleCss$1 = css`.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}`;
12726
12727
 
@@ -13574,8 +13575,14 @@ class AuroCombobox extends AuroElement {
13574
13575
  matchString = `${matchString} ${option.getAttribute('suggest')}`.toLowerCase();
13575
13576
  }
13576
13577
 
13577
- // only count options that match the typed input value AND are not currently selected AND are not static
13578
- if (this.input.value && matchString.includes(this.input.value.toLowerCase()) && !option.hasAttribute('static')) {
13578
+ // If input is empty, show all options (except static ones)
13579
+ if (!this.input.value || this.input.value.length === 0) {
13580
+ if (!option.hasAttribute('static')) {
13581
+ option.removeAttribute('hidden');
13582
+ this.availableOptions.push(option);
13583
+ }
13584
+ } else if (matchString.includes(this.input.value.toLowerCase()) && !option.hasAttribute('static')) {
13585
+ // only count options that match the typed input value AND are not static
13579
13586
  option.removeAttribute('hidden');
13580
13587
  this.availableOptions.push(option);
13581
13588
  } else if (!option.hasAttribute('persistent')) {
@@ -13600,13 +13607,11 @@ class AuroCombobox extends AuroElement {
13600
13607
  * @private
13601
13608
  * @returns {void}
13602
13609
  */
13603
- async syncValuesAndStates() {
13604
- this.menu.value = this.value;
13605
- this.menu.matchWord = this.input.value;
13606
-
13607
- // Wait a lifecycle for child components to update
13608
- await Promise.all([this.menu.updateComplete]);
13609
-
13610
+ syncValuesAndStates() {
13611
+ // Only sync matchWord, don't set menu.value here since setMenuValue should handle that
13612
+ if (this.menu) {
13613
+ this.menu.matchWord = this.input.value;
13614
+ }
13610
13615
  this.updateTriggerTextDisplay();
13611
13616
  }
13612
13617
 
@@ -13617,11 +13622,7 @@ class AuroCombobox extends AuroElement {
13617
13622
  updateTriggerTextDisplay() {
13618
13623
  // update the input content if persistInput is false
13619
13624
  if (!this.persistInput) {
13620
- if (this.menu.optionSelected && this.menu.optionSelected.textContent.length > 0) {
13621
- this.input.value = this.menu.optionSelected.textContent;
13622
- } else {
13623
- this.input.value = this.value;
13624
- }
13625
+ this.input.value = this.value;
13625
13626
  }
13626
13627
 
13627
13628
  // update the displayValue in the trigger if displayValue slot content is present
@@ -13641,27 +13642,12 @@ class AuroCombobox extends AuroElement {
13641
13642
  this.requestUpdate();
13642
13643
  }
13643
13644
 
13644
- /**
13645
- * Resets the menu matchWord to true.
13646
- * @private
13647
- */
13648
- resetMenuMatchword() {
13649
- this.menu.updateItemsState(new Map([
13650
- [
13651
- 'matchWord',
13652
- true
13653
- ]
13654
- ]));
13655
- };
13656
-
13657
13645
  /**
13658
13646
  * Processes hidden state of all menu options and determines if there are any available options not hidden.
13659
13647
  * @private
13660
13648
  * @returns {void}
13661
13649
  */
13662
13650
  handleMenuOptions() {
13663
- this.resetMenuMatchword();
13664
-
13665
13651
  this.generateOptionsArray();
13666
13652
  this.availableOptions = [];
13667
13653
  this.updateFilter();
@@ -13677,8 +13663,8 @@ class AuroCombobox extends AuroElement {
13677
13663
  * @returns {void}
13678
13664
  */
13679
13665
  generateOptionsArray() {
13680
- if (this.menu) {
13681
- this.options = this.menu.querySelectorAll('auro-menuoption, [auro-menuoption]');
13666
+ if (this.menu && this.menu.options) {
13667
+ this.options = this.menu.options;
13682
13668
  } else {
13683
13669
  this.options = [];
13684
13670
  }
@@ -13833,20 +13819,19 @@ class AuroCombobox extends AuroElement {
13833
13819
  this.menu = this.querySelector('auro-menu, [auro-menu]');
13834
13820
  this.defaultMenuShape = this.menu.getAttribute('shape');
13835
13821
 
13836
- this.menu.value = this.value;
13837
-
13838
- this.updateMenuShapeSize();
13839
-
13840
- // a racing condition on custom-combobox with custom-menu
13841
- if (!this.menu || this.menuShadowRoot === null) {
13822
+ // racing condition on custom-combobox with custom-menu
13823
+ if (!this.menu) {
13842
13824
  setTimeout(() => {
13843
13825
  this.configureMenu();
13844
13826
  }, 0);
13845
13827
  return;
13846
13828
  }
13847
13829
 
13848
- this.menu.addEventListener('auroMenu-loadingChange', (event) => this.handleMenuLoadingChange(event));
13849
- this.menu.shadowRoot.addEventListener('slotchange', (event) => this.handleSlotChange(event));
13830
+ this.updateMenuShapeSize();
13831
+
13832
+ // Sync options array like select does
13833
+ this.options = this.menu.options;
13834
+ this.menu.addEventListener("auroMenu-loadingChange", (event) => this.handleMenuLoadingChange(event));
13850
13835
 
13851
13836
  if (this.checkmark) {
13852
13837
  this.menu.removeAttribute('nocheckmark');
@@ -13854,32 +13839,27 @@ class AuroCombobox extends AuroElement {
13854
13839
  this.menu.setAttribute('nocheckmark', '');
13855
13840
  }
13856
13841
 
13857
- // handle the menu event for an option selection
13858
- this.menu.addEventListener('auroMenu-selectedOption', (evt) => {
13859
- if (this.menu.optionSelected) {
13860
- const selected = this.menu.optionSelected;
13861
-
13862
- if (!this.optionSelected || this.optionSelected !== selected) {
13863
- this.optionSelected = selected;
13864
- }
13865
-
13866
- if (!this.value || this.value !== this.optionSelected.value) {
13867
- this.value = this.optionSelected.value;
13868
- // this.menu.value = this.value;
13869
- }
13842
+ // Handle menu option selection like select does
13843
+ this.menu.addEventListener('auroMenu-selectedOption', (event) => {
13844
+ // Update the optionSelected from the event details, not manually
13845
+ [this.optionSelected] = event.detail.options;
13870
13846
 
13871
- this.updateTriggerTextDisplay();
13847
+ // Update the internal value to match the menu's value
13848
+ this.value = event.detail.stringValue;
13872
13849
 
13873
- if (this.menu.matchWord !== this.input.value) {
13874
- this.menu.matchWord = this.input.value;
13875
- }
13850
+ // Update display
13851
+ this.updateTriggerTextDisplay();
13876
13852
 
13877
- // update the hidden state of options based on newly selected value
13878
- this.handleMenuOptions();
13853
+ // Update match word for filtering
13854
+ if (this.menu.matchWord !== this.input.value) {
13855
+ this.menu.matchWord = this.input.value;
13879
13856
  }
13880
13857
 
13881
- // dropdown bib should hide when making a selection
13882
- if (evt.detail && evt.detail.source !== 'slotchange') {
13858
+ // Update available options based on selection
13859
+ this.handleMenuOptions();
13860
+
13861
+ // Hide dropdown on selection (except during slot changes)
13862
+ if (event.detail && event.detail.source !== 'slotchange') {
13883
13863
  setTimeout(() => {
13884
13864
  this.hideBib();
13885
13865
  }, 0);
@@ -13900,13 +13880,8 @@ class AuroCombobox extends AuroElement {
13900
13880
  });
13901
13881
  });
13902
13882
 
13903
- this.menu.addEventListener('auroMenu-selectValueFailure', () => {
13904
- this.menu.clearSelection();
13905
- });
13906
-
13907
- this.menu.addEventListener('auroMenu-selectValueReset', () => {
13908
- this.clear();
13909
- });
13883
+ // Handle slot changes
13884
+ this.menu.shadowRoot.addEventListener('slotchange', (event) => this.handleSlotChange(event));
13910
13885
  }
13911
13886
 
13912
13887
  /**
@@ -13987,7 +13962,7 @@ class AuroCombobox extends AuroElement {
13987
13962
  this.hideBib();
13988
13963
  }
13989
13964
 
13990
- this.dispatchEvent(new CustomEvent('inputValue', { detail: { value: this.inputValue} }));
13965
+ this.dispatchEvent(new CustomEvent('inputValue', { detail: { value: this.inputValue } }));
13991
13966
  }
13992
13967
 
13993
13968
  /**
@@ -14044,7 +14019,7 @@ class AuroCombobox extends AuroElement {
14044
14019
  evt.preventDefault();
14045
14020
 
14046
14021
  // navigate on menu only when the focus is on input
14047
- if (!this.dropdown.isBibFullscreen || this.shadowRoot.activeElement === this.inputInBib) {
14022
+ if (!this.dropdown.isBibFullscreen || this.dropdown.isPopoverVisible) {
14048
14023
  const direction = evt.key.replace('Arrow', '').toLowerCase();
14049
14024
  this.menu.navigateOptions(direction);
14050
14025
  }
@@ -14113,6 +14088,18 @@ class AuroCombobox extends AuroElement {
14113
14088
  }
14114
14089
  }
14115
14090
 
14091
+ /**
14092
+ * Sets the menu value if menu is available.
14093
+ * @param {string} value - The value to set on the menu.
14094
+ * @returns {void}
14095
+ */
14096
+ setMenuValue(value) {
14097
+ if (!this.menu) {
14098
+ return;
14099
+ }
14100
+ this.menu.value = value;
14101
+ }
14102
+
14116
14103
  /**
14117
14104
  * Resets component to initial state.
14118
14105
  * @returns {void}
@@ -14132,12 +14119,17 @@ class AuroCombobox extends AuroElement {
14132
14119
  * @returns {void}
14133
14120
  */
14134
14121
  clear() {
14135
- this.input.clear();
14122
+ // Clear combobox state first
14123
+ this.optionSelected = undefined;
14124
+ this.value = undefined;
14125
+
14126
+ // Then clear input and menu
14127
+ if (this.input.value) {
14128
+ this.input.clear();
14129
+ }
14136
14130
  if (this.menu.value || this.menu.optionSelected) {
14137
14131
  this.menu.reset();
14138
14132
  }
14139
- this.optionSelected = undefined;
14140
- this.value = undefined;
14141
14133
  }
14142
14134
 
14143
14135
  /**
@@ -14157,10 +14149,13 @@ class AuroCombobox extends AuroElement {
14157
14149
  this.hasValue = false;
14158
14150
  }
14159
14151
 
14160
- if (this.hasValue && !this.input.value && (!this.menu.availableOptions || this.menu.availableOptions.length === 0)) {
14152
+ if (this.hasValue && !this.input.value && (!this.menu.options || this.menu.options.length === 0)) {
14161
14153
  this.input.value = this.value;
14162
14154
  }
14163
14155
 
14156
+ // Use setMenuValue like select does instead of direct assignment
14157
+ this.setMenuValue(this.value);
14158
+
14164
14159
  if (this.value) {
14165
14160
  // If the value got set programmatically make sure we hide the bib
14166
14161
  // when input is not taking the focus (input can be in dropdown.trigger or in bibtemplate)
@@ -14171,13 +14166,19 @@ class AuroCombobox extends AuroElement {
14171
14166
  this.clear();
14172
14167
  }
14173
14168
 
14174
- // Sync the input, menu, and optionSelected states
14175
- await this.syncValuesAndStates();
14169
+ // Sync the input and match word, but don't directly set menu.value again
14170
+ if (this.menu) {
14171
+ this.menu.matchWord = this.input.value;
14172
+ }
14176
14173
 
14177
14174
  this.dispatchEvent(new CustomEvent('input', {
14178
14175
  bubbles: true,
14179
14176
  cancelable: false,
14180
14177
  composed: true,
14178
+ detail: {
14179
+ optionSelected: this.menu.optionSelected,
14180
+ value: this.menu.value
14181
+ }
14181
14182
  }));
14182
14183
 
14183
14184
  // Deprecated, need to be removed.
@@ -14197,8 +14198,8 @@ class AuroCombobox extends AuroElement {
14197
14198
  }
14198
14199
 
14199
14200
  if (changedProperties.has('error')) {
14200
- this.input.setAttribute('error', this.getAttribute('error'));
14201
- this.validate();
14201
+ await this.input.setAttribute('error', this.getAttribute('error'));
14202
+ this.validate(true);
14202
14203
  }
14203
14204
 
14204
14205
  if (changedProperties.has('shape') && this.menu) {
@@ -14304,11 +14305,11 @@ class AuroCombobox extends AuroElement {
14304
14305
  <div>
14305
14306
  <div aria-live="polite" class="util_displayHiddenVisually">
14306
14307
  ${this.optionActive && this.availableOptions.length > 0
14307
- ? html`
14308
+ ? html`
14308
14309
  ${`${this.optionActive.textContent}, selected, ${this.availableOptions.indexOf(this.optionActive) + 1} of ${this.availableOptions.length}`}
14309
14310
  `
14310
- : undefined
14311
- }
14311
+ : undefined
14312
+ }
14312
14313
  </div>
14313
14314
  <${this.dropdownTag}
14314
14315
  appearance="${this.onDark ? 'inverse' : this.appearance}"
@@ -14390,21 +14391,21 @@ class AuroCombobox extends AuroElement {
14390
14391
 
14391
14392
  <span slot="helpText">
14392
14393
  ${!this.validity || this.validity === 'valid'
14393
- ? html`
14394
+ ? html`
14394
14395
  <${this.helpTextTag} class="${classMap(helpTextContentClasses)}" appearance="${this.onDark ? 'inverse' : this.appearance}"">
14395
14396
  <p id="${this.uniqueId}" part="helpText">
14396
14397
  <slot name="helpText"></slot>
14397
14398
  </p>
14398
14399
  </${this.helpTextTag}>
14399
14400
  `
14400
- : html`
14401
+ : html`
14401
14402
  <${this.helpTextTag} class="${classMap(errorTextContentClasses)}" error appearance="${this.onDark ? 'inverse' : this.appearance}"">
14402
14403
  <p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
14403
14404
  ${this.errorMessage}
14404
14405
  </p>
14405
14406
  </${this.helpTextTag}>
14406
14407
  `
14407
- }
14408
+ }
14408
14409
  </span>
14409
14410
  </${this.dropdownTag}>
14410
14411
  </div>