@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.30 → 0.0.0-pr624.32

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.
@@ -15760,7 +15760,6 @@ class AuroCombobox extends AuroElement {
15760
15760
 
15761
15761
  /**
15762
15762
  * Value selected for the dropdown menu.
15763
- * @type {string}
15764
15763
  */
15765
15764
  value: {
15766
15765
  type: String
@@ -15810,6 +15809,10 @@ class AuroCombobox extends AuroElement {
15810
15809
  ];
15811
15810
  }
15812
15811
 
15812
+ /**
15813
+ * Checks if the element is valid.
15814
+ * @returns {boolean} - Returns true if the element is valid, false otherwise.
15815
+ */
15813
15816
  isValid() {
15814
15817
  let valid = true;
15815
15818
 
@@ -15833,87 +15836,95 @@ class AuroCombobox extends AuroElement {
15833
15836
  }
15834
15837
 
15835
15838
  /**
15836
- * Processes hidden state of all menu options and determines if there are any available options not hidden.
15839
+ * Updates the filter for the available options based on the input value.
15837
15840
  * @private
15838
- * @returns {void}
15839
15841
  */
15840
- handleMenuOptions() {
15841
- // Reset menu matchword UI
15842
- this.menu.updateItemsState(new Map([
15843
- [
15844
- 'matchWord',
15845
- true
15846
- ]
15847
- ]));
15842
+ updateFilter() {
15848
15843
 
15849
- this.generateOptionsArray();
15850
- this.availableOptions = [];
15844
+ // Reset available options if noFilter is set to false after being true.
15845
+ if (this.noFilter) {
15846
+ this.availableOptions = [...this.options];
15847
+ return;
15848
+ }
15851
15849
 
15852
- if (this.menu.optionSelected) {
15853
- // Get first option since combobox is single-select
15854
- const selected = this.menu.optionSelected;
15850
+ this.noMatchOption = undefined;
15855
15851
 
15856
- if (!this.optionSelected || this.optionSelected !== selected) {
15857
- this.optionSelected = selected;
15858
- }
15852
+ this.options.forEach((option) => {
15853
+ let matchString = option.textContent.toLowerCase();
15859
15854
 
15860
- if (!this.value || this.value !== selected.value) {
15861
- this.value = selected.value;
15855
+ if (option.hasAttribute('nomatch')) {
15856
+ this.noMatchOption = option;
15857
+ }
15862
15858
 
15863
- this.menu.value = this.value;
15859
+ if (option.hasAttribute('persistent')) {
15860
+ this.availableOptions.push(option);
15864
15861
  }
15865
15862
 
15866
- if (this.input.value !== selected.textContent) {
15867
- this.input.value = selected.textContent;
15863
+ if (option.hasAttribute('suggest')) {
15864
+ matchString = `${matchString} ${option.getAttribute('suggest')}`.toLowerCase();
15868
15865
  }
15869
15866
 
15870
- if (this.menu.matchWord !== this.input.value) {
15871
- this.menu.matchWord = this.input.value;
15867
+ // only count options that match the typed input value AND are not currently selected AND are not static
15868
+ if (this.input.value && matchString.includes(this.input.value.toLowerCase()) && !option.hasAttribute('static')) {
15869
+ option.removeAttribute('hidden');
15870
+ this.availableOptions.push(option);
15871
+ } else if (!option.hasAttribute('persistent')) {
15872
+ // Hide all other non-persistent options
15873
+ option.setAttribute('hidden', '');
15872
15874
  }
15875
+ });
15873
15876
 
15874
- this.classList.add('combobox-filled');
15877
+ if (this.availableOptions.length === 0) {
15878
+ if (this.noMatchOption) {
15879
+ this.noMatchOption.removeAttribute('hidden');
15880
+ } else {
15881
+ this.hideBib();
15882
+ }
15883
+ } else if (this.noMatchOption) {
15884
+ this.noMatchOption.setAttribute('hidden', '');
15875
15885
  }
15886
+ }
15876
15887
 
15877
- if (this.noFilter) {
15878
- this.availableOptions = [...this.options];
15879
- } else {
15880
- this.noMatchOption = undefined;
15881
-
15882
- this.options.forEach((option) => {
15883
- let matchString = option.textContent.toLowerCase();
15888
+ /**
15889
+ * Syncs the values and states of this component, the input, and the menu, including this.optionSelected and this.menu.optionSelected.
15890
+ * @private
15891
+ * @returns {void}
15892
+ */
15893
+ async syncValuesAndStates() {
15884
15894
 
15885
- if (option.hasAttribute('nomatch')) {
15886
- this.noMatchOption = option;
15887
- }
15895
+ // Sync values
15896
+ this.menu.value = this.value;
15897
+ this.menu.matchWord = this.value;
15898
+ this.input.value = this.value;
15888
15899
 
15889
- if (option.hasAttribute('persistent')) {
15890
- this.availableOptions.push(option);
15891
- }
15900
+ // Wait a lifecycle for child components to update
15901
+ await Promise.all([this.menu.updateComplete]);
15902
+ }
15892
15903
 
15893
- if (option.hasAttribute('suggest')) {
15894
- matchString = `${matchString} ${option.getAttribute('suggest')}`.toLowerCase();
15895
- }
15904
+ /**
15905
+ * Resets the menu matchWord to true.
15906
+ * @private
15907
+ */
15908
+ resetMenuMatchword() {
15909
+ this.menu.updateItemsState(new Map([
15910
+ [
15911
+ 'matchWord',
15912
+ true
15913
+ ]
15914
+ ]));
15915
+ };
15896
15916
 
15897
- // only count options that match the typed input value AND are not currently selected AND are not static
15898
- if (this.input.value && matchString.includes(this.input.value.toLowerCase()) && !option.hasAttribute('static')) {
15899
- option.removeAttribute('hidden');
15900
- this.availableOptions.push(option);
15901
- } else if (!option.hasAttribute('persistent')) {
15902
- // Hide all other non-persistent options
15903
- option.setAttribute('hidden', '');
15904
- }
15905
- });
15917
+ /**
15918
+ * Processes hidden state of all menu options and determines if there are any available options not hidden.
15919
+ * @private
15920
+ * @returns {void}
15921
+ */
15922
+ handleMenuOptions() {
15906
15923
 
15907
- if (this.availableOptions.length === 0) {
15908
- if (this.noMatchOption) {
15909
- this.noMatchOption.removeAttribute('hidden');
15910
- } else {
15911
- this.hideBib();
15912
- }
15913
- } else if (this.noMatchOption) {
15914
- this.noMatchOption.setAttribute('hidden', '');
15915
- }
15916
- }
15924
+ this.resetMenuMatchword();
15925
+ this.generateOptionsArray();
15926
+ this.availableOptions = [];
15927
+ this.updateFilter();
15917
15928
  }
15918
15929
 
15919
15930
  /**
@@ -16071,8 +16082,6 @@ class AuroCombobox extends AuroElement {
16071
16082
  this.menu.matchWord = this.input.value;
16072
16083
  }
16073
16084
 
16074
- this.classList.add('combobox-filled');
16075
-
16076
16085
  // update the hidden state of options based on newly selected value
16077
16086
  this.handleMenuOptions();
16078
16087
 
@@ -16213,9 +16222,6 @@ class AuroCombobox extends AuroElement {
16213
16222
  // Hide menu if value is empty, otherwise show if there are available suggestions
16214
16223
  if (this.input.value && this.input.value.length === 0) {
16215
16224
  this.hideBib();
16216
- this.classList.remove('combobox-filled');
16217
- } else if (!this.dropdown.isPopoverVisible && this.availableOptions) {
16218
- this.classList.add('combobox-filled');
16219
16225
  }
16220
16226
 
16221
16227
  // Force dropdown bib to hide if input value has no matching suggestions
@@ -16273,7 +16279,6 @@ class AuroCombobox extends AuroElement {
16273
16279
  * @private
16274
16280
  * @returns {void}
16275
16281
  */
16276
-
16277
16282
  performUpdate() {
16278
16283
  super.performUpdate();
16279
16284
 
@@ -16332,30 +16337,18 @@ class AuroCombobox extends AuroElement {
16332
16337
  this.validation.validate(this, force);
16333
16338
  }
16334
16339
 
16335
- updated(changedProperties) {
16340
+ async updated(changedProperties) {
16336
16341
  // After the component is ready, send direct value changes to auro-menu.
16337
- if (changedProperties.has('value')) {
16338
- if (this.value) {
16339
- if (this.optionSelected && this.optionSelected.value === this.value) {
16340
- // If value updates and the previously selected option already matches the new value
16341
- // just update the input value to use the textContent of the optionSelected
16342
- this.input.value = this.optionSelected.textContent;
16343
- } else {
16344
- // Otherwise just enter the value into the input
16345
- this.optionSelected = undefined;
16346
-
16347
- const inputValue = this.value;
16348
- this.input.value = inputValue;
16342
+ if (changedProperties.has('value') && this.value !== changedProperties.get('value')) {
16349
16343
 
16350
- // Update the menu value and matchWord
16351
- this.menu.matchWord = inputValue;
16352
- this.handleMenuOptions();
16344
+ // Sync the input, menu, and optionSelected states
16345
+ await this.syncValuesAndStates();
16353
16346
 
16354
- // If the value got set programmatically make sure we hide the bib
16355
- // when input is not taking the focus (input can be in dropdown.trigger or in bibtemplate)
16356
- if (!this.contains(document.activeElement) && !this.bibtemplate.contains(document.activeElement)) {
16357
- this.hideBib();
16358
- }
16347
+ if (this.value) {
16348
+ // If the value got set programmatically make sure we hide the bib
16349
+ // when input is not taking the focus (input can be in dropdown.trigger or in bibtemplate)
16350
+ if (!this.contains(document.activeElement) && !this.bibtemplate.contains(document.activeElement)) {
16351
+ this.hideBib();
16359
16352
  }
16360
16353
  } else {
16361
16354
  this.reset();
@@ -15760,7 +15760,6 @@ class AuroCombobox extends AuroElement {
15760
15760
 
15761
15761
  /**
15762
15762
  * Value selected for the dropdown menu.
15763
- * @type {string}
15764
15763
  */
15765
15764
  value: {
15766
15765
  type: String
@@ -15810,6 +15809,10 @@ class AuroCombobox extends AuroElement {
15810
15809
  ];
15811
15810
  }
15812
15811
 
15812
+ /**
15813
+ * Checks if the element is valid.
15814
+ * @returns {boolean} - Returns true if the element is valid, false otherwise.
15815
+ */
15813
15816
  isValid() {
15814
15817
  let valid = true;
15815
15818
 
@@ -15833,87 +15836,95 @@ class AuroCombobox extends AuroElement {
15833
15836
  }
15834
15837
 
15835
15838
  /**
15836
- * Processes hidden state of all menu options and determines if there are any available options not hidden.
15839
+ * Updates the filter for the available options based on the input value.
15837
15840
  * @private
15838
- * @returns {void}
15839
15841
  */
15840
- handleMenuOptions() {
15841
- // Reset menu matchword UI
15842
- this.menu.updateItemsState(new Map([
15843
- [
15844
- 'matchWord',
15845
- true
15846
- ]
15847
- ]));
15842
+ updateFilter() {
15848
15843
 
15849
- this.generateOptionsArray();
15850
- this.availableOptions = [];
15844
+ // Reset available options if noFilter is set to false after being true.
15845
+ if (this.noFilter) {
15846
+ this.availableOptions = [...this.options];
15847
+ return;
15848
+ }
15851
15849
 
15852
- if (this.menu.optionSelected) {
15853
- // Get first option since combobox is single-select
15854
- const selected = this.menu.optionSelected;
15850
+ this.noMatchOption = undefined;
15855
15851
 
15856
- if (!this.optionSelected || this.optionSelected !== selected) {
15857
- this.optionSelected = selected;
15858
- }
15852
+ this.options.forEach((option) => {
15853
+ let matchString = option.textContent.toLowerCase();
15859
15854
 
15860
- if (!this.value || this.value !== selected.value) {
15861
- this.value = selected.value;
15855
+ if (option.hasAttribute('nomatch')) {
15856
+ this.noMatchOption = option;
15857
+ }
15862
15858
 
15863
- this.menu.value = this.value;
15859
+ if (option.hasAttribute('persistent')) {
15860
+ this.availableOptions.push(option);
15864
15861
  }
15865
15862
 
15866
- if (this.input.value !== selected.textContent) {
15867
- this.input.value = selected.textContent;
15863
+ if (option.hasAttribute('suggest')) {
15864
+ matchString = `${matchString} ${option.getAttribute('suggest')}`.toLowerCase();
15868
15865
  }
15869
15866
 
15870
- if (this.menu.matchWord !== this.input.value) {
15871
- this.menu.matchWord = this.input.value;
15867
+ // only count options that match the typed input value AND are not currently selected AND are not static
15868
+ if (this.input.value && matchString.includes(this.input.value.toLowerCase()) && !option.hasAttribute('static')) {
15869
+ option.removeAttribute('hidden');
15870
+ this.availableOptions.push(option);
15871
+ } else if (!option.hasAttribute('persistent')) {
15872
+ // Hide all other non-persistent options
15873
+ option.setAttribute('hidden', '');
15872
15874
  }
15875
+ });
15873
15876
 
15874
- this.classList.add('combobox-filled');
15877
+ if (this.availableOptions.length === 0) {
15878
+ if (this.noMatchOption) {
15879
+ this.noMatchOption.removeAttribute('hidden');
15880
+ } else {
15881
+ this.hideBib();
15882
+ }
15883
+ } else if (this.noMatchOption) {
15884
+ this.noMatchOption.setAttribute('hidden', '');
15875
15885
  }
15886
+ }
15876
15887
 
15877
- if (this.noFilter) {
15878
- this.availableOptions = [...this.options];
15879
- } else {
15880
- this.noMatchOption = undefined;
15881
-
15882
- this.options.forEach((option) => {
15883
- let matchString = option.textContent.toLowerCase();
15888
+ /**
15889
+ * Syncs the values and states of this component, the input, and the menu, including this.optionSelected and this.menu.optionSelected.
15890
+ * @private
15891
+ * @returns {void}
15892
+ */
15893
+ async syncValuesAndStates() {
15884
15894
 
15885
- if (option.hasAttribute('nomatch')) {
15886
- this.noMatchOption = option;
15887
- }
15895
+ // Sync values
15896
+ this.menu.value = this.value;
15897
+ this.menu.matchWord = this.value;
15898
+ this.input.value = this.value;
15888
15899
 
15889
- if (option.hasAttribute('persistent')) {
15890
- this.availableOptions.push(option);
15891
- }
15900
+ // Wait a lifecycle for child components to update
15901
+ await Promise.all([this.menu.updateComplete]);
15902
+ }
15892
15903
 
15893
- if (option.hasAttribute('suggest')) {
15894
- matchString = `${matchString} ${option.getAttribute('suggest')}`.toLowerCase();
15895
- }
15904
+ /**
15905
+ * Resets the menu matchWord to true.
15906
+ * @private
15907
+ */
15908
+ resetMenuMatchword() {
15909
+ this.menu.updateItemsState(new Map([
15910
+ [
15911
+ 'matchWord',
15912
+ true
15913
+ ]
15914
+ ]));
15915
+ };
15896
15916
 
15897
- // only count options that match the typed input value AND are not currently selected AND are not static
15898
- if (this.input.value && matchString.includes(this.input.value.toLowerCase()) && !option.hasAttribute('static')) {
15899
- option.removeAttribute('hidden');
15900
- this.availableOptions.push(option);
15901
- } else if (!option.hasAttribute('persistent')) {
15902
- // Hide all other non-persistent options
15903
- option.setAttribute('hidden', '');
15904
- }
15905
- });
15917
+ /**
15918
+ * Processes hidden state of all menu options and determines if there are any available options not hidden.
15919
+ * @private
15920
+ * @returns {void}
15921
+ */
15922
+ handleMenuOptions() {
15906
15923
 
15907
- if (this.availableOptions.length === 0) {
15908
- if (this.noMatchOption) {
15909
- this.noMatchOption.removeAttribute('hidden');
15910
- } else {
15911
- this.hideBib();
15912
- }
15913
- } else if (this.noMatchOption) {
15914
- this.noMatchOption.setAttribute('hidden', '');
15915
- }
15916
- }
15924
+ this.resetMenuMatchword();
15925
+ this.generateOptionsArray();
15926
+ this.availableOptions = [];
15927
+ this.updateFilter();
15917
15928
  }
15918
15929
 
15919
15930
  /**
@@ -16071,8 +16082,6 @@ class AuroCombobox extends AuroElement {
16071
16082
  this.menu.matchWord = this.input.value;
16072
16083
  }
16073
16084
 
16074
- this.classList.add('combobox-filled');
16075
-
16076
16085
  // update the hidden state of options based on newly selected value
16077
16086
  this.handleMenuOptions();
16078
16087
 
@@ -16213,9 +16222,6 @@ class AuroCombobox extends AuroElement {
16213
16222
  // Hide menu if value is empty, otherwise show if there are available suggestions
16214
16223
  if (this.input.value && this.input.value.length === 0) {
16215
16224
  this.hideBib();
16216
- this.classList.remove('combobox-filled');
16217
- } else if (!this.dropdown.isPopoverVisible && this.availableOptions) {
16218
- this.classList.add('combobox-filled');
16219
16225
  }
16220
16226
 
16221
16227
  // Force dropdown bib to hide if input value has no matching suggestions
@@ -16273,7 +16279,6 @@ class AuroCombobox extends AuroElement {
16273
16279
  * @private
16274
16280
  * @returns {void}
16275
16281
  */
16276
-
16277
16282
  performUpdate() {
16278
16283
  super.performUpdate();
16279
16284
 
@@ -16332,30 +16337,18 @@ class AuroCombobox extends AuroElement {
16332
16337
  this.validation.validate(this, force);
16333
16338
  }
16334
16339
 
16335
- updated(changedProperties) {
16340
+ async updated(changedProperties) {
16336
16341
  // After the component is ready, send direct value changes to auro-menu.
16337
- if (changedProperties.has('value')) {
16338
- if (this.value) {
16339
- if (this.optionSelected && this.optionSelected.value === this.value) {
16340
- // If value updates and the previously selected option already matches the new value
16341
- // just update the input value to use the textContent of the optionSelected
16342
- this.input.value = this.optionSelected.textContent;
16343
- } else {
16344
- // Otherwise just enter the value into the input
16345
- this.optionSelected = undefined;
16346
-
16347
- const inputValue = this.value;
16348
- this.input.value = inputValue;
16342
+ if (changedProperties.has('value') && this.value !== changedProperties.get('value')) {
16349
16343
 
16350
- // Update the menu value and matchWord
16351
- this.menu.matchWord = inputValue;
16352
- this.handleMenuOptions();
16344
+ // Sync the input, menu, and optionSelected states
16345
+ await this.syncValuesAndStates();
16353
16346
 
16354
- // If the value got set programmatically make sure we hide the bib
16355
- // when input is not taking the focus (input can be in dropdown.trigger or in bibtemplate)
16356
- if (!this.contains(document.activeElement) && !this.bibtemplate.contains(document.activeElement)) {
16357
- this.hideBib();
16358
- }
16347
+ if (this.value) {
16348
+ // If the value got set programmatically make sure we hide the bib
16349
+ // when input is not taking the focus (input can be in dropdown.trigger or in bibtemplate)
16350
+ if (!this.contains(document.activeElement) && !this.bibtemplate.contains(document.activeElement)) {
16351
+ this.hideBib();
16359
16352
  }
16360
16353
  } else {
16361
16354
  this.reset();
@@ -82,7 +82,10 @@ This configuration enables proper module resolution for the component's TypeScri
82
82
  <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
83
83
 
84
84
  ```html
85
- <auro-input bordered shape="rounded" size="lg"></auro-input>
85
+ <auro-input>
86
+ <span slot="label">Label</span>
87
+ <span slot="helpText">Help Text</span>
88
+ </auro-input>
86
89
  ```
87
90
  <!-- AURO-GENERATED-CONTENT:END -->
88
91