@ni/nimble-components 21.10.1 → 22.0.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.
Files changed (29) hide show
  1. package/dist/all-components-bundle.js +67 -25
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +6 -6
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/banner/template.js +4 -4
  6. package/dist/esm/banner/template.js.map +1 -1
  7. package/dist/esm/combobox/index.d.ts +7 -2
  8. package/dist/esm/combobox/index.js +15 -0
  9. package/dist/esm/combobox/index.js.map +1 -1
  10. package/dist/esm/label-provider/core/index.d.ts +9 -9
  11. package/dist/esm/label-provider/core/index.js +10 -10
  12. package/dist/esm/label-provider/core/index.js.map +1 -1
  13. package/dist/esm/label-provider/core/label-token-defaults.js +3 -3
  14. package/dist/esm/label-provider/core/label-token-defaults.js.map +1 -1
  15. package/dist/esm/label-provider/core/label-tokens.d.ts +3 -3
  16. package/dist/esm/label-provider/core/label-tokens.js +9 -9
  17. package/dist/esm/label-provider/core/label-tokens.js.map +1 -1
  18. package/dist/esm/list-option/index.d.ts +2 -0
  19. package/dist/esm/list-option/index.js +12 -0
  20. package/dist/esm/list-option/index.js.map +1 -1
  21. package/dist/esm/patterns/dropdown/types.d.ts +14 -0
  22. package/dist/esm/patterns/dropdown/types.js.map +1 -1
  23. package/dist/esm/select/index.d.ts +7 -2
  24. package/dist/esm/select/index.js +15 -0
  25. package/dist/esm/select/index.js.map +1 -1
  26. package/dist/esm/select/testing/select.pageobject.d.ts +2 -2
  27. package/dist/esm/select/testing/select.pageobject.js +4 -5
  28. package/dist/esm/select/testing/select.pageobject.js.map +1 -1
  29. package/package.json +1 -1
@@ -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 Wed, 13 Mar 2024 22:51:24 GMT
16305
16305
  */
16306
16306
 
16307
16307
  const Information100DarkUi = "#a46eff";
@@ -19772,9 +19772,9 @@
19772
19772
  popupDismissLabel: 'Close',
19773
19773
  numericIncrementLabel: 'Increment',
19774
19774
  numericDecrementLabel: 'Decrement',
19775
- errorIconLabel: 'Error',
19776
- warningIconLabel: 'Warning',
19777
- informationIconLabel: 'Information',
19775
+ popupIconErrorLabel: 'Error',
19776
+ popupIconWarningLabel: 'Warning',
19777
+ popupIconInformationLabel: 'Information',
19778
19778
  filterSearchLabel: 'Search',
19779
19779
  filterNoResultsLabel: 'No items found'
19780
19780
  };
@@ -19791,18 +19791,18 @@
19791
19791
  name: 'numeric-increment-label',
19792
19792
  cssCustomPropertyName: null
19793
19793
  }).withDefault(coreLabelDefaults.numericIncrementLabel);
19794
- const errorIconLabel = DesignToken.create({
19795
- name: 'error-icon-label',
19794
+ const popupIconErrorLabel = DesignToken.create({
19795
+ name: 'popup-icon-error-label',
19796
19796
  cssCustomPropertyName: null
19797
- }).withDefault(coreLabelDefaults.errorIconLabel);
19798
- const warningIconLabel = DesignToken.create({
19799
- name: 'warning-icon-label',
19797
+ }).withDefault(coreLabelDefaults.popupIconErrorLabel);
19798
+ const popupIconWarningLabel = DesignToken.create({
19799
+ name: 'popup-icon-warning-label',
19800
19800
  cssCustomPropertyName: null
19801
- }).withDefault(coreLabelDefaults.warningIconLabel);
19802
- const informationIconLabel = DesignToken.create({
19803
- name: 'information-icon-label',
19801
+ }).withDefault(coreLabelDefaults.popupIconWarningLabel);
19802
+ const popupIconInformationLabel = DesignToken.create({
19803
+ name: 'popup-icon-information-label',
19804
19804
  cssCustomPropertyName: null
19805
- }).withDefault(coreLabelDefaults.informationIconLabel);
19805
+ }).withDefault(coreLabelDefaults.popupIconInformationLabel);
19806
19806
  const filterSearchLabel = DesignToken.create({
19807
19807
  name: 'filter-search-label',
19808
19808
  cssCustomPropertyName: null
@@ -19839,13 +19839,13 @@
19839
19839
  >
19840
19840
  <div class="icon">
19841
19841
  ${when(x => x.severity === BannerSeverity.error, html `
19842
- <${iconExclamationMarkTag} role="img" aria-label="${x => errorIconLabel.getValueFor(x)}"></${iconExclamationMarkTag}>
19842
+ <${iconExclamationMarkTag} role="img" aria-label="${x => popupIconErrorLabel.getValueFor(x)}"></${iconExclamationMarkTag}>
19843
19843
  `)}
19844
19844
  ${when(x => x.severity === BannerSeverity.warning, html `
19845
- <${iconTriangleFilledTag} role="img" aria-label="${x => warningIconLabel.getValueFor(x)}"></${iconTriangleFilledTag}>
19845
+ <${iconTriangleFilledTag} role="img" aria-label="${x => popupIconWarningLabel.getValueFor(x)}"></${iconTriangleFilledTag}>
19846
19846
  `)}
19847
19847
  ${when(x => x.severity === BannerSeverity.information, html `
19848
- <${iconInfoTag} role="img" aria-label="${x => informationIconLabel.getValueFor(x)}"></${iconInfoTag}>
19848
+ <${iconInfoTag} role="img" aria-label="${x => popupIconInformationLabel.getValueFor(x)}"></${iconInfoTag}>
19849
19849
  `)}
19850
19850
  </div>
19851
19851
  <div class="text">
@@ -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();
@@ -24106,9 +24121,9 @@
24106
24121
  popupDismiss: popupDismissLabel,
24107
24122
  numericDecrement: numericDecrementLabel,
24108
24123
  numericIncrement: numericIncrementLabel,
24109
- errorIcon: errorIconLabel,
24110
- warningIcon: warningIconLabel,
24111
- informationIcon: informationIconLabel,
24124
+ popupIconError: popupIconErrorLabel,
24125
+ popupIconWarning: popupIconWarningLabel,
24126
+ popupIconInformation: popupIconInformationLabel,
24112
24127
  filterSearch: filterSearchLabel,
24113
24128
  filterNoResults: filterNoResultsLabel
24114
24129
  };
@@ -24131,14 +24146,14 @@
24131
24146
  attr({ attribute: 'numeric-increment' })
24132
24147
  ], LabelProviderCore.prototype, "numericIncrement", void 0);
24133
24148
  __decorate$1([
24134
- attr({ attribute: 'error-icon' })
24135
- ], LabelProviderCore.prototype, "errorIcon", void 0);
24149
+ attr({ attribute: 'popup-icon-error' })
24150
+ ], LabelProviderCore.prototype, "popupIconError", void 0);
24136
24151
  __decorate$1([
24137
- attr({ attribute: 'warning-icon' })
24138
- ], LabelProviderCore.prototype, "warningIcon", void 0);
24152
+ attr({ attribute: 'popup-icon-warning' })
24153
+ ], LabelProviderCore.prototype, "popupIconWarning", void 0);
24139
24154
  __decorate$1([
24140
- attr({ attribute: 'information-icon' })
24141
- ], LabelProviderCore.prototype, "informationIcon", void 0);
24155
+ attr({ attribute: 'popup-icon-information' })
24156
+ ], LabelProviderCore.prototype, "popupIconInformation", void 0);
24142
24157
  __decorate$1([
24143
24158
  attr({ attribute: 'filter-search' })
24144
24159
  ], LabelProviderCore.prototype, "filterSearch", void 0);
@@ -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.