@ni/nimble-components 24.1.11 → 24.1.12

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.
@@ -16333,7 +16333,7 @@
16333
16333
 
16334
16334
  /**
16335
16335
  * Do not edit directly
16336
- * Generated on Wed, 10 Apr 2024 17:29:50 GMT
16336
+ * Generated on Wed, 10 Apr 2024 19:20:19 GMT
16337
16337
  */
16338
16338
 
16339
16339
  const Information100DarkUi = "#a46eff";
@@ -58659,6 +58659,9 @@ img.ProseMirror-separator {
58659
58659
  const isNimbleListOption = (el) => {
58660
58660
  return el instanceof ListOption;
58661
58661
  };
58662
+ const isOptionSelectable = (el) => {
58663
+ return !el.visuallyHidden && !el.disabled && !el.hidden;
58664
+ };
58662
58665
  /**
58663
58666
  * A nimble-styled HTML select.
58664
58667
  */
@@ -59088,7 +59091,9 @@ img.ProseMirror-separator {
59088
59091
  // don't call super.selectNextOption as that relies on side-effecty
59089
59092
  // behavior to not select disabled option (which no longer works)
59090
59093
  for (let i = this.selectedIndex + 1; i < this.options.length; i++) {
59091
- if (!this.options[i]?.disabled) {
59094
+ const listOption = this.options[i];
59095
+ if (isNimbleListOption(listOption)
59096
+ && isOptionSelectable(listOption)) {
59092
59097
  this.selectedIndex = i;
59093
59098
  break;
59094
59099
  }
@@ -59098,7 +59103,9 @@ img.ProseMirror-separator {
59098
59103
  // don't call super.selectPreviousOption as that relies on side-effecty
59099
59104
  // behavior to not select disabled option (which no longer works)
59100
59105
  for (let i = this.selectedIndex - 1; i >= 0; i--) {
59101
- if (!this.options[i]?.disabled) {
59106
+ const listOption = this.options[i];
59107
+ if (isNimbleListOption(listOption)
59108
+ && isOptionSelectable(listOption)) {
59102
59109
  this.selectedIndex = i;
59103
59110
  break;
59104
59111
  }
@@ -59207,9 +59214,6 @@ img.ProseMirror-separator {
59207
59214
  const optionIsSelected = (option) => {
59208
59215
  return option.hasAttribute('selected') || option.selected;
59209
59216
  };
59210
- const optionIsDisabled = (option) => {
59211
- return option.hasAttribute('disabled') || option.disabled;
59212
- };
59213
59217
  let selectedIndex = -1;
59214
59218
  let firstValidOptionIndex = -1;
59215
59219
  for (let i = 0; i < options?.length; i++) {
@@ -59217,7 +59221,8 @@ img.ProseMirror-separator {
59217
59221
  if (optionIsSelected(option) || option?.value === this.value) {
59218
59222
  selectedIndex = i;
59219
59223
  }
59220
- if (firstValidOptionIndex === -1 && !optionIsDisabled(option)) {
59224
+ if (firstValidOptionIndex === -1
59225
+ && isOptionSelectable(option)) {
59221
59226
  firstValidOptionIndex = i;
59222
59227
  }
59223
59228
  }