@ni/nimble-components 22.0.1 → 22.1.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 (39) hide show
  1. package/dist/all-components-bundle.js +83 -60
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +2294 -2292
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/combobox/index.d.ts +2 -7
  6. package/dist/esm/combobox/index.js +0 -15
  7. package/dist/esm/combobox/index.js.map +1 -1
  8. package/dist/esm/label-provider/table/index.d.ts +6 -0
  9. package/dist/esm/label-provider/table/index.js +10 -2
  10. package/dist/esm/label-provider/table/index.js.map +1 -1
  11. package/dist/esm/label-provider/table/label-token-defaults.js +3 -1
  12. package/dist/esm/label-provider/table/label-token-defaults.js.map +1 -1
  13. package/dist/esm/label-provider/table/label-tokens.d.ts +2 -0
  14. package/dist/esm/label-provider/table/label-tokens.js +8 -0
  15. package/dist/esm/label-provider/table/label-tokens.js.map +1 -1
  16. package/dist/esm/table-column/date-text/group-header-view/index.d.ts +1 -3
  17. package/dist/esm/table-column/date-text/group-header-view/index.js +0 -6
  18. package/dist/esm/table-column/date-text/group-header-view/index.js.map +1 -1
  19. package/dist/esm/table-column/duration-text/group-header-view/index.d.ts +1 -3
  20. package/dist/esm/table-column/duration-text/group-header-view/index.js +0 -6
  21. package/dist/esm/table-column/duration-text/group-header-view/index.js.map +1 -1
  22. package/dist/esm/table-column/enum-text/group-header-view/index.d.ts +1 -3
  23. package/dist/esm/table-column/enum-text/group-header-view/index.js +1 -12
  24. package/dist/esm/table-column/enum-text/group-header-view/index.js.map +1 -1
  25. package/dist/esm/table-column/icon/group-header-view/index.d.ts +1 -3
  26. package/dist/esm/table-column/icon/group-header-view/index.js +2 -10
  27. package/dist/esm/table-column/icon/group-header-view/index.js.map +1 -1
  28. package/dist/esm/table-column/icon/group-header-view/template.js +6 -0
  29. package/dist/esm/table-column/icon/group-header-view/template.js.map +1 -1
  30. package/dist/esm/table-column/number-text/group-header-view/index.d.ts +1 -3
  31. package/dist/esm/table-column/number-text/group-header-view/index.js +0 -6
  32. package/dist/esm/table-column/number-text/group-header-view/index.js.map +1 -1
  33. package/dist/esm/table-column/text/group-header-view/index.d.ts +1 -1
  34. package/dist/esm/table-column/text/group-header-view/index.js +1 -1
  35. package/dist/esm/table-column/text/group-header-view/index.js.map +1 -1
  36. package/dist/esm/table-column/text-base/group-header-view/index.d.ts +16 -0
  37. package/dist/esm/table-column/text-base/group-header-view/index.js +53 -1
  38. package/dist/esm/table-column/text-base/group-header-view/index.js.map +1 -1
  39. package/package.json +1 -1
@@ -16301,7 +16301,7 @@
16301
16301
 
16302
16302
  /**
16303
16303
  * Do not edit directly
16304
- * Generated on Thu, 14 Mar 2024 14:32:10 GMT
16304
+ * Generated on Wed, 20 Mar 2024 16:28:54 GMT
16305
16305
  */
16306
16306
 
16307
16307
  const Information100DarkUi = "#a46eff";
@@ -21222,21 +21222,6 @@
21222
21222
  this.emitChangeIfValueUpdated();
21223
21223
  return returnValue;
21224
21224
  }
21225
- /**
21226
- * @internal
21227
- */
21228
- registerOption(option) {
21229
- if (this.options.includes(option)) {
21230
- return;
21231
- }
21232
- // Adding an option to the end, ultimately, isn't the correct
21233
- // thing to do, as this will mean the option's index in the options,
21234
- // at least temporarily, does not match the DOM order. However, it
21235
- // is expected that a successive run of `slottedOptionsChanged` will
21236
- // correct this order issue. See 'https://github.com/ni/nimble/issues/1915'
21237
- // for more info.
21238
- this.options.push(option);
21239
- }
21240
21225
  focusAndScrollOptionIntoView() {
21241
21226
  if (this.open) {
21242
21227
  super.focusAndScrollOptionIntoView();
@@ -24212,7 +24197,9 @@
24212
24197
  tableGroupSelectAllLabel: 'Select all rows in group',
24213
24198
  tableRowSelectLabel: 'Select row',
24214
24199
  tableRowOperationColumnLabel: 'Row operations',
24215
- tableRowLoadingLabel: 'Loading'
24200
+ tableRowLoadingLabel: 'Loading',
24201
+ tableGroupRowPlaceholderNoValueLabel: 'No value',
24202
+ tableGroupRowPlaceholderEmptyLabel: 'Empty'
24216
24203
  };
24217
24204
 
24218
24205
  const tableGroupCollapseLabel = DesignToken.create({
@@ -24271,6 +24258,14 @@
24271
24258
  name: 'table-row-loading-label',
24272
24259
  cssCustomPropertyName: null
24273
24260
  }).withDefault(tableLabelDefaults.tableRowLoadingLabel);
24261
+ const tableGroupRowPlaceholderNoValueLabel = DesignToken.create({
24262
+ name: 'table-group-row-placeholder-no-value-label',
24263
+ cssCustomPropertyName: null
24264
+ }).withDefault(tableLabelDefaults.tableGroupRowPlaceholderNoValueLabel);
24265
+ const tableGroupRowPlaceholderEmptyLabel = DesignToken.create({
24266
+ name: 'table-group-row-placeholder-empty-label',
24267
+ cssCustomPropertyName: null
24268
+ }).withDefault(tableLabelDefaults.tableGroupRowPlaceholderEmptyLabel);
24274
24269
 
24275
24270
  const supportedLabels = {
24276
24271
  groupCollapse: tableGroupCollapseLabel,
@@ -24286,7 +24281,9 @@
24286
24281
  groupSelectAll: tableGroupSelectAllLabel,
24287
24282
  rowSelect: tableRowSelectLabel,
24288
24283
  rowOperationColumn: tableRowOperationColumnLabel,
24289
- rowLoading: tableRowLoadingLabel
24284
+ rowLoading: tableRowLoadingLabel,
24285
+ groupRowPlaceholderNoValue: tableGroupRowPlaceholderNoValueLabel,
24286
+ groupRowPlaceholderEmpty: tableGroupRowPlaceholderEmptyLabel
24290
24287
  };
24291
24288
  /**
24292
24289
  * Label provider for the Nimble table (and its sub-components and columns)
@@ -24339,6 +24336,12 @@
24339
24336
  __decorate$1([
24340
24337
  attr({ attribute: 'row-loading' })
24341
24338
  ], LabelProviderTable.prototype, "rowLoading", void 0);
24339
+ __decorate$1([
24340
+ attr({ attribute: 'group-row-placeholder-no-value' })
24341
+ ], LabelProviderTable.prototype, "groupRowPlaceholderNoValue", void 0);
24342
+ __decorate$1([
24343
+ attr({ attribute: 'group-row-placeholder-empty' })
24344
+ ], LabelProviderTable.prototype, "groupRowPlaceholderEmpty", void 0);
24342
24345
  const nimbleLabelProviderTable = LabelProviderTable.compose({
24343
24346
  baseName: 'label-provider-table'
24344
24347
  });
@@ -67144,8 +67147,59 @@ img.ProseMirror-separator {
67144
67147
  this.hasOverflow = false;
67145
67148
  /**
67146
67149
  * Text to render in the cell.
67150
+ *
67151
+ * The value is initialized to `tableGroupRowPlaceholderNoValue` because if the group
67152
+ * row never has a value defined on it, the change handlers may never get called but
67153
+ * the text needs to be correct.
67147
67154
  */
67148
- this.text = '';
67155
+ this.text = tableGroupRowPlaceholderNoValueLabel.getValueFor(this);
67156
+ this.noValuePlaceholderLabelSubscriber = {
67157
+ handleChange: () => {
67158
+ this.applyPlaceholderTextIfNeeded();
67159
+ }
67160
+ };
67161
+ this.emptyPlaceholderLabelSubscriber = {
67162
+ handleChange: () => {
67163
+ this.applyPlaceholderTextIfNeeded();
67164
+ }
67165
+ };
67166
+ }
67167
+ connectedCallback() {
67168
+ super.connectedCallback();
67169
+ tableGroupRowPlaceholderNoValueLabel.subscribe(this.noValuePlaceholderLabelSubscriber, this);
67170
+ tableGroupRowPlaceholderEmptyLabel.subscribe(this.emptyPlaceholderLabelSubscriber, this);
67171
+ this.applyPlaceholderTextIfNeeded();
67172
+ }
67173
+ disconnectedCallback() {
67174
+ super.disconnectedCallback();
67175
+ tableGroupRowPlaceholderNoValueLabel.unsubscribe(this.noValuePlaceholderLabelSubscriber);
67176
+ tableGroupRowPlaceholderEmptyLabel.unsubscribe(this.emptyPlaceholderLabelSubscriber);
67177
+ }
67178
+ columnConfigChanged() {
67179
+ if (!this.applyPlaceholderTextIfNeeded()) {
67180
+ this.updateText();
67181
+ }
67182
+ }
67183
+ groupHeaderValueChanged() {
67184
+ if (!this.applyPlaceholderTextIfNeeded()) {
67185
+ this.updateText();
67186
+ }
67187
+ }
67188
+ /**
67189
+ * Sets `this.text` to the appropriate placeholder if `groupHeaderValue` warrants it.
67190
+ * @returns `true` if `this.text` was set to a placeholder, `false` otherwise.
67191
+ */
67192
+ applyPlaceholderTextIfNeeded() {
67193
+ if (this.groupHeaderValue === null
67194
+ || this.groupHeaderValue === undefined) {
67195
+ this.text = tableGroupRowPlaceholderNoValueLabel.getValueFor(this);
67196
+ return true;
67197
+ }
67198
+ if (this.groupHeaderValue === '') {
67199
+ this.text = tableGroupRowPlaceholderEmptyLabel.getValueFor(this);
67200
+ return true;
67201
+ }
67202
+ return false;
67149
67203
  }
67150
67204
  }
67151
67205
  __decorate$1([
@@ -67178,7 +67232,7 @@ img.ProseMirror-separator {
67178
67232
  * The group header view for displaying string fields as text.
67179
67233
  */
67180
67234
  class TableColumnTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
67181
- groupHeaderValueChanged() {
67235
+ updateText() {
67182
67236
  this.text = typeof this.groupHeaderValue === 'string'
67183
67237
  ? this.groupHeaderValue
67184
67238
  : '';
@@ -67338,12 +67392,6 @@ img.ProseMirror-separator {
67338
67392
  * The group header view for displaying date/time fields as text.
67339
67393
  */
67340
67394
  class TableColumnDateTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
67341
- columnConfigChanged() {
67342
- this.updateText();
67343
- }
67344
- groupHeaderValueChanged() {
67345
- this.updateText();
67346
- }
67347
67395
  updateText() {
67348
67396
  if (this.columnConfig) {
67349
67397
  this.text = formatNumericDate(this.columnConfig.formatter, this.groupHeaderValue);
@@ -67867,12 +67915,6 @@ img.ProseMirror-separator {
67867
67915
  * The group header view for displaying duration fields as text.
67868
67916
  */
67869
67917
  class TableColumnDurationTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
67870
- columnConfigChanged() {
67871
- this.updateText();
67872
- }
67873
- groupHeaderValueChanged() {
67874
- this.updateText();
67875
- }
67876
67918
  updateText() {
67877
67919
  if (this.columnConfig) {
67878
67920
  this.text = this.columnConfig.formatter.format(this.groupHeaderValue);
@@ -68179,19 +68221,8 @@ img.ProseMirror-separator {
68179
68221
  * A group header view for enum columns
68180
68222
  */
68181
68223
  class TableColumnEnumTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
68182
- columnConfigChanged() {
68183
- this.updateText();
68184
- }
68185
- groupHeaderValueChanged() {
68186
- this.updateText();
68187
- }
68188
68224
  updateText() {
68189
- const value = this.groupHeaderValue;
68190
- if (value === undefined || value === null) {
68191
- this.text = '';
68192
- return;
68193
- }
68194
- const config = this.columnConfig?.mappingConfigs.get(value);
68225
+ const config = this.columnConfig?.mappingConfigs.get(this.groupHeaderValue);
68195
68226
  this.text = config instanceof MappingTextConfig && config.text
68196
68227
  ? config.text
68197
68228
  : '';
@@ -68265,12 +68296,6 @@ img.ProseMirror-separator {
68265
68296
  * The group header view for displaying number fields as text.
68266
68297
  */
68267
68298
  class TableColumnNumberTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
68268
- columnConfigChanged() {
68269
- this.updateText();
68270
- }
68271
- groupHeaderValueChanged() {
68272
- this.updateText();
68273
- }
68274
68299
  updateText() {
68275
68300
  this.text = this.columnConfig?.formatter?.format(this.groupHeaderValue) ?? '';
68276
68301
  }
@@ -68937,6 +68962,12 @@ img.ProseMirror-separator {
68937
68962
  title="${x => (x.hasOverflow && x.text ? x.text : null)}"
68938
68963
  >${x => x.text}</span>
68939
68964
  `)}
68965
+ ${when(x => x.visual === undefined, html `
68966
+ <span
68967
+ ${overflow('hasOverflow')}
68968
+ title="${x => (x.hasOverflow && x.text ? x.text : null)}"
68969
+ >${x => x.text}</span>
68970
+ `)}
68940
68971
  `;
68941
68972
 
68942
68973
  // Create an empty template containing only a space because creating a ViewTemplate
@@ -68982,21 +69013,13 @@ img.ProseMirror-separator {
68982
69013
  * The group header view for the icon column
68983
69014
  */
68984
69015
  class TableColumnIconGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
68985
- columnConfigChanged() {
68986
- this.updateState();
68987
- }
68988
- groupHeaderValueChanged() {
68989
- this.updateState();
68990
- }
68991
- updateState() {
69016
+ updateText() {
68992
69017
  this.visual = undefined;
68993
69018
  if (!this.columnConfig) {
69019
+ this.text = '';
68994
69020
  return;
68995
69021
  }
68996
69022
  const value = this.groupHeaderValue;
68997
- if (value === undefined || value === null) {
68998
- return;
68999
- }
69000
69023
  const mappingConfig = this.columnConfig.mappingConfigs.get(value);
69001
69024
  if (mappingConfig instanceof MappingIconConfig) {
69002
69025
  this.visual = 'icon';