@ni/nimble-components 22.0.1 → 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.
- package/dist/all-components-bundle.js +83 -45
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +2293 -2291
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/label-provider/table/index.d.ts +6 -0
- package/dist/esm/label-provider/table/index.js +10 -2
- package/dist/esm/label-provider/table/index.js.map +1 -1
- package/dist/esm/label-provider/table/label-token-defaults.js +3 -1
- package/dist/esm/label-provider/table/label-token-defaults.js.map +1 -1
- package/dist/esm/label-provider/table/label-tokens.d.ts +2 -0
- package/dist/esm/label-provider/table/label-tokens.js +8 -0
- package/dist/esm/label-provider/table/label-tokens.js.map +1 -1
- package/dist/esm/table-column/date-text/group-header-view/index.d.ts +1 -3
- package/dist/esm/table-column/date-text/group-header-view/index.js +0 -6
- package/dist/esm/table-column/date-text/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/duration-text/group-header-view/index.d.ts +1 -3
- package/dist/esm/table-column/duration-text/group-header-view/index.js +0 -6
- package/dist/esm/table-column/duration-text/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/enum-text/group-header-view/index.d.ts +1 -3
- package/dist/esm/table-column/enum-text/group-header-view/index.js +1 -12
- package/dist/esm/table-column/enum-text/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/icon/group-header-view/index.d.ts +1 -3
- package/dist/esm/table-column/icon/group-header-view/index.js +2 -10
- package/dist/esm/table-column/icon/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/icon/group-header-view/template.js +6 -0
- package/dist/esm/table-column/icon/group-header-view/template.js.map +1 -1
- package/dist/esm/table-column/number-text/group-header-view/index.d.ts +1 -3
- package/dist/esm/table-column/number-text/group-header-view/index.js +0 -6
- package/dist/esm/table-column/number-text/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/text/group-header-view/index.d.ts +1 -1
- package/dist/esm/table-column/text/group-header-view/index.js +1 -1
- package/dist/esm/table-column/text/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/text-base/group-header-view/index.d.ts +16 -0
- package/dist/esm/table-column/text-base/group-header-view/index.js +53 -1
- package/dist/esm/table-column/text-base/group-header-view/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -16301,7 +16301,7 @@
|
|
|
16301
16301
|
|
|
16302
16302
|
/**
|
|
16303
16303
|
* Do not edit directly
|
|
16304
|
-
* Generated on
|
|
16304
|
+
* Generated on Mon, 18 Mar 2024 16:55:50 GMT
|
|
16305
16305
|
*/
|
|
16306
16306
|
|
|
16307
16307
|
const Information100DarkUi = "#a46eff";
|
|
@@ -24212,7 +24212,9 @@
|
|
|
24212
24212
|
tableGroupSelectAllLabel: 'Select all rows in group',
|
|
24213
24213
|
tableRowSelectLabel: 'Select row',
|
|
24214
24214
|
tableRowOperationColumnLabel: 'Row operations',
|
|
24215
|
-
tableRowLoadingLabel: 'Loading'
|
|
24215
|
+
tableRowLoadingLabel: 'Loading',
|
|
24216
|
+
tableGroupRowPlaceholderNoValueLabel: 'No value',
|
|
24217
|
+
tableGroupRowPlaceholderEmptyLabel: 'Empty'
|
|
24216
24218
|
};
|
|
24217
24219
|
|
|
24218
24220
|
const tableGroupCollapseLabel = DesignToken.create({
|
|
@@ -24271,6 +24273,14 @@
|
|
|
24271
24273
|
name: 'table-row-loading-label',
|
|
24272
24274
|
cssCustomPropertyName: null
|
|
24273
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);
|
|
24274
24284
|
|
|
24275
24285
|
const supportedLabels = {
|
|
24276
24286
|
groupCollapse: tableGroupCollapseLabel,
|
|
@@ -24286,7 +24296,9 @@
|
|
|
24286
24296
|
groupSelectAll: tableGroupSelectAllLabel,
|
|
24287
24297
|
rowSelect: tableRowSelectLabel,
|
|
24288
24298
|
rowOperationColumn: tableRowOperationColumnLabel,
|
|
24289
|
-
rowLoading: tableRowLoadingLabel
|
|
24299
|
+
rowLoading: tableRowLoadingLabel,
|
|
24300
|
+
groupRowPlaceholderNoValue: tableGroupRowPlaceholderNoValueLabel,
|
|
24301
|
+
groupRowPlaceholderEmpty: tableGroupRowPlaceholderEmptyLabel
|
|
24290
24302
|
};
|
|
24291
24303
|
/**
|
|
24292
24304
|
* Label provider for the Nimble table (and its sub-components and columns)
|
|
@@ -24339,6 +24351,12 @@
|
|
|
24339
24351
|
__decorate$1([
|
|
24340
24352
|
attr({ attribute: 'row-loading' })
|
|
24341
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);
|
|
24342
24360
|
const nimbleLabelProviderTable = LabelProviderTable.compose({
|
|
24343
24361
|
baseName: 'label-provider-table'
|
|
24344
24362
|
});
|
|
@@ -67144,8 +67162,59 @@ img.ProseMirror-separator {
|
|
|
67144
67162
|
this.hasOverflow = false;
|
|
67145
67163
|
/**
|
|
67146
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.
|
|
67147
67169
|
*/
|
|
67148
|
-
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;
|
|
67149
67218
|
}
|
|
67150
67219
|
}
|
|
67151
67220
|
__decorate$1([
|
|
@@ -67178,7 +67247,7 @@ img.ProseMirror-separator {
|
|
|
67178
67247
|
* The group header view for displaying string fields as text.
|
|
67179
67248
|
*/
|
|
67180
67249
|
class TableColumnTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
|
|
67181
|
-
|
|
67250
|
+
updateText() {
|
|
67182
67251
|
this.text = typeof this.groupHeaderValue === 'string'
|
|
67183
67252
|
? this.groupHeaderValue
|
|
67184
67253
|
: '';
|
|
@@ -67338,12 +67407,6 @@ img.ProseMirror-separator {
|
|
|
67338
67407
|
* The group header view for displaying date/time fields as text.
|
|
67339
67408
|
*/
|
|
67340
67409
|
class TableColumnDateTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
|
|
67341
|
-
columnConfigChanged() {
|
|
67342
|
-
this.updateText();
|
|
67343
|
-
}
|
|
67344
|
-
groupHeaderValueChanged() {
|
|
67345
|
-
this.updateText();
|
|
67346
|
-
}
|
|
67347
67410
|
updateText() {
|
|
67348
67411
|
if (this.columnConfig) {
|
|
67349
67412
|
this.text = formatNumericDate(this.columnConfig.formatter, this.groupHeaderValue);
|
|
@@ -67867,12 +67930,6 @@ img.ProseMirror-separator {
|
|
|
67867
67930
|
* The group header view for displaying duration fields as text.
|
|
67868
67931
|
*/
|
|
67869
67932
|
class TableColumnDurationTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
|
|
67870
|
-
columnConfigChanged() {
|
|
67871
|
-
this.updateText();
|
|
67872
|
-
}
|
|
67873
|
-
groupHeaderValueChanged() {
|
|
67874
|
-
this.updateText();
|
|
67875
|
-
}
|
|
67876
67933
|
updateText() {
|
|
67877
67934
|
if (this.columnConfig) {
|
|
67878
67935
|
this.text = this.columnConfig.formatter.format(this.groupHeaderValue);
|
|
@@ -68179,19 +68236,8 @@ img.ProseMirror-separator {
|
|
|
68179
68236
|
* A group header view for enum columns
|
|
68180
68237
|
*/
|
|
68181
68238
|
class TableColumnEnumTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
|
|
68182
|
-
columnConfigChanged() {
|
|
68183
|
-
this.updateText();
|
|
68184
|
-
}
|
|
68185
|
-
groupHeaderValueChanged() {
|
|
68186
|
-
this.updateText();
|
|
68187
|
-
}
|
|
68188
68239
|
updateText() {
|
|
68189
|
-
const
|
|
68190
|
-
if (value === undefined || value === null) {
|
|
68191
|
-
this.text = '';
|
|
68192
|
-
return;
|
|
68193
|
-
}
|
|
68194
|
-
const config = this.columnConfig?.mappingConfigs.get(value);
|
|
68240
|
+
const config = this.columnConfig?.mappingConfigs.get(this.groupHeaderValue);
|
|
68195
68241
|
this.text = config instanceof MappingTextConfig && config.text
|
|
68196
68242
|
? config.text
|
|
68197
68243
|
: '';
|
|
@@ -68265,12 +68311,6 @@ img.ProseMirror-separator {
|
|
|
68265
68311
|
* The group header view for displaying number fields as text.
|
|
68266
68312
|
*/
|
|
68267
68313
|
class TableColumnNumberTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
|
|
68268
|
-
columnConfigChanged() {
|
|
68269
|
-
this.updateText();
|
|
68270
|
-
}
|
|
68271
|
-
groupHeaderValueChanged() {
|
|
68272
|
-
this.updateText();
|
|
68273
|
-
}
|
|
68274
68314
|
updateText() {
|
|
68275
68315
|
this.text = this.columnConfig?.formatter?.format(this.groupHeaderValue) ?? '';
|
|
68276
68316
|
}
|
|
@@ -68937,6 +68977,12 @@ img.ProseMirror-separator {
|
|
|
68937
68977
|
title="${x => (x.hasOverflow && x.text ? x.text : null)}"
|
|
68938
68978
|
>${x => x.text}</span>
|
|
68939
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
|
+
`)}
|
|
68940
68986
|
`;
|
|
68941
68987
|
|
|
68942
68988
|
// Create an empty template containing only a space because creating a ViewTemplate
|
|
@@ -68982,21 +69028,13 @@ img.ProseMirror-separator {
|
|
|
68982
69028
|
* The group header view for the icon column
|
|
68983
69029
|
*/
|
|
68984
69030
|
class TableColumnIconGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
|
|
68985
|
-
|
|
68986
|
-
this.updateState();
|
|
68987
|
-
}
|
|
68988
|
-
groupHeaderValueChanged() {
|
|
68989
|
-
this.updateState();
|
|
68990
|
-
}
|
|
68991
|
-
updateState() {
|
|
69031
|
+
updateText() {
|
|
68992
69032
|
this.visual = undefined;
|
|
68993
69033
|
if (!this.columnConfig) {
|
|
69034
|
+
this.text = '';
|
|
68994
69035
|
return;
|
|
68995
69036
|
}
|
|
68996
69037
|
const value = this.groupHeaderValue;
|
|
68997
|
-
if (value === undefined || value === null) {
|
|
68998
|
-
return;
|
|
68999
|
-
}
|
|
69000
69038
|
const mappingConfig = this.columnConfig.mappingConfigs.get(value);
|
|
69001
69039
|
if (mappingConfig instanceof MappingIconConfig) {
|
|
69002
69040
|
this.visual = 'icon';
|