@ni/nimble-components 21.10.1 → 21.10.2

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.
@@ -16301,7 +16301,7 @@
16301
16301
 
16302
16302
  /**
16303
16303
  * Do not edit directly
16304
- * Generated on Tue, 12 Mar 2024 20:45:49 GMT
16304
+ * Generated on Tue, 12 Mar 2024 22:01:57 GMT
16305
16305
  */
16306
16306
 
16307
16307
  const Information100DarkUi = "#a46eff";
@@ -21191,6 +21191,21 @@
21191
21191
  this.emitChangeIfValueUpdated();
21192
21192
  return returnValue;
21193
21193
  }
21194
+ /**
21195
+ * @internal
21196
+ */
21197
+ registerOption(option) {
21198
+ if (this.options.includes(option)) {
21199
+ return;
21200
+ }
21201
+ // Adding an option to the end, ultimately, isn't the correct
21202
+ // thing to do, as this will mean the option's index in the options,
21203
+ // at least temporarily, does not match the DOM order. However, it
21204
+ // is expected that a successive run of `slottedOptionsChanged` will
21205
+ // correct this order issue. See 'https://github.com/ni/nimble/issues/1915'
21206
+ // for more info.
21207
+ this.options.push(option);
21208
+ }
21194
21209
  focusAndScrollOptionIntoView() {
21195
21210
  if (this.open) {
21196
21211
  super.focusAndScrollOptionIntoView();
@@ -24435,6 +24450,18 @@
24435
24450
  .map(node => node.textContent?.trim())
24436
24451
  .join(' ');
24437
24452
  }
24453
+ connectedCallback() {
24454
+ super.connectedCallback();
24455
+ if (this.isListOptionOwner(this.parentElement)) {
24456
+ this.parentElement.registerOption(this);
24457
+ }
24458
+ }
24459
+ isListOptionOwner(parent) {
24460
+ if (!parent) {
24461
+ return false;
24462
+ }
24463
+ return typeof parent.registerOption === 'function';
24464
+ }
24438
24465
  }
24439
24466
  __decorate$1([
24440
24467
  attr({ mode: 'boolean' })
@@ -58600,6 +58627,21 @@ img.ProseMirror-separator {
58600
58627
  }
58601
58628
  }
58602
58629
  }
58630
+ /**
58631
+ * @internal
58632
+ */
58633
+ registerOption(option) {
58634
+ if (this.options.includes(option)) {
58635
+ return;
58636
+ }
58637
+ // Adding an option to the end, ultimately, isn't the correct
58638
+ // thing to do, as this will mean the option's index in the options,
58639
+ // at least temporarily, does not match the DOM order. However, it
58640
+ // is expected that a successive run of `slottedOptionsChanged` will
58641
+ // correct this order issue. See 'https://github.com/ni/nimble/issues/1915'
58642
+ // for more info.
58643
+ this.options.push(option);
58644
+ }
58603
58645
  // Prevents parent classes from resetting selectedIndex to a positive
58604
58646
  // value while filtering, which can result in a disabled option being
58605
58647
  // selected.