@ni/nimble-components 22.0.0 → 22.1.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 (48) hide show
  1. package/dist/all-components-bundle.js +114 -45
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +2324 -2291
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/anchor/styles.js +4 -0
  6. package/dist/esm/anchor/styles.js.map +1 -1
  7. package/dist/esm/anchor-button/styles.js +12 -0
  8. package/dist/esm/anchor-button/styles.js.map +1 -1
  9. package/dist/esm/anchor-menu-item/styles.js +5 -0
  10. package/dist/esm/anchor-menu-item/styles.js.map +1 -1
  11. package/dist/esm/anchor-tab/styles.js +1 -0
  12. package/dist/esm/anchor-tab/styles.js.map +1 -1
  13. package/dist/esm/anchor-tree-item/styles.js +5 -0
  14. package/dist/esm/anchor-tree-item/styles.js.map +1 -1
  15. package/dist/esm/breadcrumb-item/styles.js +4 -0
  16. package/dist/esm/breadcrumb-item/styles.js.map +1 -1
  17. package/dist/esm/label-provider/table/index.d.ts +6 -0
  18. package/dist/esm/label-provider/table/index.js +10 -2
  19. package/dist/esm/label-provider/table/index.js.map +1 -1
  20. package/dist/esm/label-provider/table/label-token-defaults.js +3 -1
  21. package/dist/esm/label-provider/table/label-token-defaults.js.map +1 -1
  22. package/dist/esm/label-provider/table/label-tokens.d.ts +2 -0
  23. package/dist/esm/label-provider/table/label-tokens.js +8 -0
  24. package/dist/esm/label-provider/table/label-tokens.js.map +1 -1
  25. package/dist/esm/table-column/date-text/group-header-view/index.d.ts +1 -3
  26. package/dist/esm/table-column/date-text/group-header-view/index.js +0 -6
  27. package/dist/esm/table-column/date-text/group-header-view/index.js.map +1 -1
  28. package/dist/esm/table-column/duration-text/group-header-view/index.d.ts +1 -3
  29. package/dist/esm/table-column/duration-text/group-header-view/index.js +0 -6
  30. package/dist/esm/table-column/duration-text/group-header-view/index.js.map +1 -1
  31. package/dist/esm/table-column/enum-text/group-header-view/index.d.ts +1 -3
  32. package/dist/esm/table-column/enum-text/group-header-view/index.js +1 -12
  33. package/dist/esm/table-column/enum-text/group-header-view/index.js.map +1 -1
  34. package/dist/esm/table-column/icon/group-header-view/index.d.ts +1 -3
  35. package/dist/esm/table-column/icon/group-header-view/index.js +2 -10
  36. package/dist/esm/table-column/icon/group-header-view/index.js.map +1 -1
  37. package/dist/esm/table-column/icon/group-header-view/template.js +6 -0
  38. package/dist/esm/table-column/icon/group-header-view/template.js.map +1 -1
  39. package/dist/esm/table-column/number-text/group-header-view/index.d.ts +1 -3
  40. package/dist/esm/table-column/number-text/group-header-view/index.js +0 -6
  41. package/dist/esm/table-column/number-text/group-header-view/index.js.map +1 -1
  42. package/dist/esm/table-column/text/group-header-view/index.d.ts +1 -1
  43. package/dist/esm/table-column/text/group-header-view/index.js +1 -1
  44. package/dist/esm/table-column/text/group-header-view/index.js.map +1 -1
  45. package/dist/esm/table-column/text-base/group-header-view/index.d.ts +16 -0
  46. package/dist/esm/table-column/text-base/group-header-view/index.js +53 -1
  47. package/dist/esm/table-column/text-base/group-header-view/index.js.map +1 -1
  48. package/package.json +1 -1
@@ -16301,7 +16301,7 @@
16301
16301
 
16302
16302
  /**
16303
16303
  * Do not edit directly
16304
- * Generated on Wed, 13 Mar 2024 22:51:24 GMT
16304
+ * Generated on Mon, 18 Mar 2024 16:55:50 GMT
16305
16305
  */
16306
16306
 
16307
16307
  const Information100DarkUi = "#a46eff";
@@ -17124,6 +17124,10 @@
17124
17124
  color: ${linkProminentDisabledFontColor};
17125
17125
  }
17126
17126
 
17127
+ .content {
17128
+ pointer-events: none;
17129
+ }
17130
+
17127
17131
  [part='end'] {
17128
17132
  display: none;
17129
17133
  }
@@ -17618,6 +17622,18 @@
17618
17622
  .control {
17619
17623
  text-decoration: none;
17620
17624
  }
17625
+
17626
+ [part='start'] {
17627
+ pointer-events: none;
17628
+ }
17629
+
17630
+ .content {
17631
+ pointer-events: none;
17632
+ }
17633
+
17634
+ [part='end'] {
17635
+ pointer-events: none;
17636
+ }
17621
17637
  `;
17622
17638
 
17623
17639
  const template$D = (context, definition) => html `
@@ -17767,6 +17783,7 @@
17767
17783
 
17768
17784
  [part='start'] {
17769
17785
  display: contents;
17786
+ pointer-events: none;
17770
17787
  }
17771
17788
 
17772
17789
  slot[name='start']::slotted(*) {
@@ -17779,6 +17796,10 @@
17779
17796
  grid-column: 1;
17780
17797
  }
17781
17798
 
17799
+ .content {
17800
+ pointer-events: none;
17801
+ }
17802
+
17782
17803
  :host(.indent-1) .content {
17783
17804
  grid-column: 2;
17784
17805
  }
@@ -17950,6 +17971,7 @@
17950
17971
  }
17951
17972
 
17952
17973
  slot:not([name]) {
17974
+ pointer-events: none;
17953
17975
  display: block;
17954
17976
  padding: ${mediumPadding} ${standardPadding}
17955
17977
  calc(${mediumPadding} - ${borderWidth});
@@ -18415,6 +18437,7 @@
18415
18437
  /* this rule keeps children without an icon text aligned with parents */ ''}
18416
18438
  [part="start"] {
18417
18439
  width: ${iconSize};
18440
+ pointer-events: none;
18418
18441
  }
18419
18442
 
18420
18443
  ${ /* the start class is applied when the corresponding slot is filled */''}
@@ -18430,6 +18453,10 @@
18430
18453
  height: ${iconSize};
18431
18454
  }
18432
18455
 
18456
+ .content {
18457
+ pointer-events: none;
18458
+ }
18459
+
18433
18460
  [part='end'] {
18434
18461
  display: none;
18435
18462
  }
@@ -20028,6 +20055,10 @@
20028
20055
  display: none;
20029
20056
  }
20030
20057
 
20058
+ .content {
20059
+ pointer-events: none;
20060
+ }
20061
+
20031
20062
  [part='end'] {
20032
20063
  display: none;
20033
20064
  }
@@ -24181,7 +24212,9 @@
24181
24212
  tableGroupSelectAllLabel: 'Select all rows in group',
24182
24213
  tableRowSelectLabel: 'Select row',
24183
24214
  tableRowOperationColumnLabel: 'Row operations',
24184
- tableRowLoadingLabel: 'Loading'
24215
+ tableRowLoadingLabel: 'Loading',
24216
+ tableGroupRowPlaceholderNoValueLabel: 'No value',
24217
+ tableGroupRowPlaceholderEmptyLabel: 'Empty'
24185
24218
  };
24186
24219
 
24187
24220
  const tableGroupCollapseLabel = DesignToken.create({
@@ -24240,6 +24273,14 @@
24240
24273
  name: 'table-row-loading-label',
24241
24274
  cssCustomPropertyName: null
24242
24275
  }).withDefault(tableLabelDefaults.tableRowLoadingLabel);
24276
+ const tableGroupRowPlaceholderNoValueLabel = DesignToken.create({
24277
+ name: 'table-group-row-placeholder-no-value-label',
24278
+ cssCustomPropertyName: null
24279
+ }).withDefault(tableLabelDefaults.tableGroupRowPlaceholderNoValueLabel);
24280
+ const tableGroupRowPlaceholderEmptyLabel = DesignToken.create({
24281
+ name: 'table-group-row-placeholder-empty-label',
24282
+ cssCustomPropertyName: null
24283
+ }).withDefault(tableLabelDefaults.tableGroupRowPlaceholderEmptyLabel);
24243
24284
 
24244
24285
  const supportedLabels = {
24245
24286
  groupCollapse: tableGroupCollapseLabel,
@@ -24255,7 +24296,9 @@
24255
24296
  groupSelectAll: tableGroupSelectAllLabel,
24256
24297
  rowSelect: tableRowSelectLabel,
24257
24298
  rowOperationColumn: tableRowOperationColumnLabel,
24258
- rowLoading: tableRowLoadingLabel
24299
+ rowLoading: tableRowLoadingLabel,
24300
+ groupRowPlaceholderNoValue: tableGroupRowPlaceholderNoValueLabel,
24301
+ groupRowPlaceholderEmpty: tableGroupRowPlaceholderEmptyLabel
24259
24302
  };
24260
24303
  /**
24261
24304
  * Label provider for the Nimble table (and its sub-components and columns)
@@ -24308,6 +24351,12 @@
24308
24351
  __decorate$1([
24309
24352
  attr({ attribute: 'row-loading' })
24310
24353
  ], LabelProviderTable.prototype, "rowLoading", void 0);
24354
+ __decorate$1([
24355
+ attr({ attribute: 'group-row-placeholder-no-value' })
24356
+ ], LabelProviderTable.prototype, "groupRowPlaceholderNoValue", void 0);
24357
+ __decorate$1([
24358
+ attr({ attribute: 'group-row-placeholder-empty' })
24359
+ ], LabelProviderTable.prototype, "groupRowPlaceholderEmpty", void 0);
24311
24360
  const nimbleLabelProviderTable = LabelProviderTable.compose({
24312
24361
  baseName: 'label-provider-table'
24313
24362
  });
@@ -67113,8 +67162,59 @@ img.ProseMirror-separator {
67113
67162
  this.hasOverflow = false;
67114
67163
  /**
67115
67164
  * Text to render in the cell.
67165
+ *
67166
+ * The value is initialized to `tableGroupRowPlaceholderNoValue` because if the group
67167
+ * row never has a value defined on it, the change handlers may never get called but
67168
+ * the text needs to be correct.
67116
67169
  */
67117
- this.text = '';
67170
+ this.text = tableGroupRowPlaceholderNoValueLabel.getValueFor(this);
67171
+ this.noValuePlaceholderLabelSubscriber = {
67172
+ handleChange: () => {
67173
+ this.applyPlaceholderTextIfNeeded();
67174
+ }
67175
+ };
67176
+ this.emptyPlaceholderLabelSubscriber = {
67177
+ handleChange: () => {
67178
+ this.applyPlaceholderTextIfNeeded();
67179
+ }
67180
+ };
67181
+ }
67182
+ connectedCallback() {
67183
+ super.connectedCallback();
67184
+ tableGroupRowPlaceholderNoValueLabel.subscribe(this.noValuePlaceholderLabelSubscriber, this);
67185
+ tableGroupRowPlaceholderEmptyLabel.subscribe(this.emptyPlaceholderLabelSubscriber, this);
67186
+ this.applyPlaceholderTextIfNeeded();
67187
+ }
67188
+ disconnectedCallback() {
67189
+ super.disconnectedCallback();
67190
+ tableGroupRowPlaceholderNoValueLabel.unsubscribe(this.noValuePlaceholderLabelSubscriber);
67191
+ tableGroupRowPlaceholderEmptyLabel.unsubscribe(this.emptyPlaceholderLabelSubscriber);
67192
+ }
67193
+ columnConfigChanged() {
67194
+ if (!this.applyPlaceholderTextIfNeeded()) {
67195
+ this.updateText();
67196
+ }
67197
+ }
67198
+ groupHeaderValueChanged() {
67199
+ if (!this.applyPlaceholderTextIfNeeded()) {
67200
+ this.updateText();
67201
+ }
67202
+ }
67203
+ /**
67204
+ * Sets `this.text` to the appropriate placeholder if `groupHeaderValue` warrants it.
67205
+ * @returns `true` if `this.text` was set to a placeholder, `false` otherwise.
67206
+ */
67207
+ applyPlaceholderTextIfNeeded() {
67208
+ if (this.groupHeaderValue === null
67209
+ || this.groupHeaderValue === undefined) {
67210
+ this.text = tableGroupRowPlaceholderNoValueLabel.getValueFor(this);
67211
+ return true;
67212
+ }
67213
+ if (this.groupHeaderValue === '') {
67214
+ this.text = tableGroupRowPlaceholderEmptyLabel.getValueFor(this);
67215
+ return true;
67216
+ }
67217
+ return false;
67118
67218
  }
67119
67219
  }
67120
67220
  __decorate$1([
@@ -67147,7 +67247,7 @@ img.ProseMirror-separator {
67147
67247
  * The group header view for displaying string fields as text.
67148
67248
  */
67149
67249
  class TableColumnTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
67150
- groupHeaderValueChanged() {
67250
+ updateText() {
67151
67251
  this.text = typeof this.groupHeaderValue === 'string'
67152
67252
  ? this.groupHeaderValue
67153
67253
  : '';
@@ -67307,12 +67407,6 @@ img.ProseMirror-separator {
67307
67407
  * The group header view for displaying date/time fields as text.
67308
67408
  */
67309
67409
  class TableColumnDateTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
67310
- columnConfigChanged() {
67311
- this.updateText();
67312
- }
67313
- groupHeaderValueChanged() {
67314
- this.updateText();
67315
- }
67316
67410
  updateText() {
67317
67411
  if (this.columnConfig) {
67318
67412
  this.text = formatNumericDate(this.columnConfig.formatter, this.groupHeaderValue);
@@ -67836,12 +67930,6 @@ img.ProseMirror-separator {
67836
67930
  * The group header view for displaying duration fields as text.
67837
67931
  */
67838
67932
  class TableColumnDurationTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
67839
- columnConfigChanged() {
67840
- this.updateText();
67841
- }
67842
- groupHeaderValueChanged() {
67843
- this.updateText();
67844
- }
67845
67933
  updateText() {
67846
67934
  if (this.columnConfig) {
67847
67935
  this.text = this.columnConfig.formatter.format(this.groupHeaderValue);
@@ -68148,19 +68236,8 @@ img.ProseMirror-separator {
68148
68236
  * A group header view for enum columns
68149
68237
  */
68150
68238
  class TableColumnEnumTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
68151
- columnConfigChanged() {
68152
- this.updateText();
68153
- }
68154
- groupHeaderValueChanged() {
68155
- this.updateText();
68156
- }
68157
68239
  updateText() {
68158
- const value = this.groupHeaderValue;
68159
- if (value === undefined || value === null) {
68160
- this.text = '';
68161
- return;
68162
- }
68163
- const config = this.columnConfig?.mappingConfigs.get(value);
68240
+ const config = this.columnConfig?.mappingConfigs.get(this.groupHeaderValue);
68164
68241
  this.text = config instanceof MappingTextConfig && config.text
68165
68242
  ? config.text
68166
68243
  : '';
@@ -68234,12 +68311,6 @@ img.ProseMirror-separator {
68234
68311
  * The group header view for displaying number fields as text.
68235
68312
  */
68236
68313
  class TableColumnNumberTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
68237
- columnConfigChanged() {
68238
- this.updateText();
68239
- }
68240
- groupHeaderValueChanged() {
68241
- this.updateText();
68242
- }
68243
68314
  updateText() {
68244
68315
  this.text = this.columnConfig?.formatter?.format(this.groupHeaderValue) ?? '';
68245
68316
  }
@@ -68906,6 +68977,12 @@ img.ProseMirror-separator {
68906
68977
  title="${x => (x.hasOverflow && x.text ? x.text : null)}"
68907
68978
  >${x => x.text}</span>
68908
68979
  `)}
68980
+ ${when(x => x.visual === undefined, html `
68981
+ <span
68982
+ ${overflow('hasOverflow')}
68983
+ title="${x => (x.hasOverflow && x.text ? x.text : null)}"
68984
+ >${x => x.text}</span>
68985
+ `)}
68909
68986
  `;
68910
68987
 
68911
68988
  // Create an empty template containing only a space because creating a ViewTemplate
@@ -68951,21 +69028,13 @@ img.ProseMirror-separator {
68951
69028
  * The group header view for the icon column
68952
69029
  */
68953
69030
  class TableColumnIconGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
68954
- columnConfigChanged() {
68955
- this.updateState();
68956
- }
68957
- groupHeaderValueChanged() {
68958
- this.updateState();
68959
- }
68960
- updateState() {
69031
+ updateText() {
68961
69032
  this.visual = undefined;
68962
69033
  if (!this.columnConfig) {
69034
+ this.text = '';
68963
69035
  return;
68964
69036
  }
68965
69037
  const value = this.groupHeaderValue;
68966
- if (value === undefined || value === null) {
68967
- return;
68968
- }
68969
69038
  const mappingConfig = this.columnConfig.mappingConfigs.get(value);
68970
69039
  if (mappingConfig instanceof MappingIconConfig) {
68971
69040
  this.visual = 'icon';