@ni/spright-components 4.1.1 → 4.1.3
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.
|
@@ -17143,6 +17143,7 @@
|
|
|
17143
17143
|
color: ${buttonLabelFontColor};
|
|
17144
17144
|
font: ${buttonLabelFont};
|
|
17145
17145
|
cursor: pointer;
|
|
17146
|
+
white-space: nowrap;
|
|
17146
17147
|
outline: none;
|
|
17147
17148
|
border: none;
|
|
17148
17149
|
${
|
|
@@ -67918,10 +67919,6 @@ focus outline in that case.
|
|
|
67918
67919
|
get pageSize() {
|
|
67919
67920
|
return this._pageSize;
|
|
67920
67921
|
}
|
|
67921
|
-
get rowHeight() {
|
|
67922
|
-
return (parseFloat(controlHeight.getValueFor(this.table))
|
|
67923
|
-
+ 2 * parseFloat(borderWidth.getValueFor(this.table)));
|
|
67924
|
-
}
|
|
67925
67922
|
constructor(table, tanStackTable) {
|
|
67926
67923
|
this.visibleItems = [];
|
|
67927
67924
|
this.scrollHeight = 0;
|
|
@@ -67962,6 +67959,13 @@ focus outline in that case.
|
|
|
67962
67959
|
scrollToIndex(index, options) {
|
|
67963
67960
|
this.virtualizer?.scrollToIndex(index, options);
|
|
67964
67961
|
}
|
|
67962
|
+
updateRowHeight() {
|
|
67963
|
+
this.updatePageSize();
|
|
67964
|
+
if (this.virtualizer) {
|
|
67965
|
+
this.updateVirtualizer();
|
|
67966
|
+
this.virtualizer.measure();
|
|
67967
|
+
}
|
|
67968
|
+
}
|
|
67965
67969
|
updateVirtualizer() {
|
|
67966
67970
|
const options = this.createVirtualizerOptions();
|
|
67967
67971
|
if (this.virtualizer) {
|
|
@@ -67974,7 +67978,7 @@ focus outline in that case.
|
|
|
67974
67978
|
this.handleVirtualizerChange();
|
|
67975
67979
|
}
|
|
67976
67980
|
createVirtualizerOptions() {
|
|
67977
|
-
const rowHeight = this.rowHeight;
|
|
67981
|
+
const rowHeight = this.table.rowHeight;
|
|
67978
67982
|
return {
|
|
67979
67983
|
count: this.tanStackTable.getRowModel().rows.length,
|
|
67980
67984
|
getScrollElement: () => {
|
|
@@ -68016,7 +68020,7 @@ focus outline in that case.
|
|
|
68016
68020
|
this.rowContainerYOffset = rowContainerYOffset;
|
|
68017
68021
|
}
|
|
68018
68022
|
updatePageSize() {
|
|
68019
|
-
this._pageSize = Math.round(this.table.viewport.clientHeight / this.rowHeight);
|
|
68023
|
+
this._pageSize = Math.round(this.table.viewport.clientHeight / this.table.rowHeight);
|
|
68020
68024
|
}
|
|
68021
68025
|
}
|
|
68022
68026
|
__decorate$1([
|
|
@@ -70130,6 +70134,12 @@ focus outline in that case.
|
|
|
70130
70134
|
}
|
|
70131
70135
|
return '';
|
|
70132
70136
|
}
|
|
70137
|
+
/**
|
|
70138
|
+
* @internal
|
|
70139
|
+
*/
|
|
70140
|
+
get rowHeight() {
|
|
70141
|
+
return this._rowHeight;
|
|
70142
|
+
}
|
|
70133
70143
|
constructor() {
|
|
70134
70144
|
super();
|
|
70135
70145
|
this.selectionMode = TableRowSelectionMode.none;
|
|
@@ -70183,6 +70193,7 @@ focus outline in that case.
|
|
|
70183
70193
|
this.tableValidator = new TableValidator();
|
|
70184
70194
|
this.tableUpdateTracker = new TableUpdateTracker(this);
|
|
70185
70195
|
this.columnNotifiers = [];
|
|
70196
|
+
this._rowHeight = 0;
|
|
70186
70197
|
this.isInitialized = false;
|
|
70187
70198
|
// Programmatically updating the selection state of a checkbox fires the 'change' event.
|
|
70188
70199
|
// Therefore, selection change events that occur due to programmatically updating
|
|
@@ -70192,6 +70203,16 @@ focus outline in that case.
|
|
|
70192
70203
|
// Map from the external slot name to the record ID of the row that should have the slot
|
|
70193
70204
|
// and the unique slot name that the slot should be slotted into.
|
|
70194
70205
|
this.requestedSlots = new Map();
|
|
70206
|
+
this.borderWidthSubscriber = {
|
|
70207
|
+
handleChange: () => {
|
|
70208
|
+
this.updateRowHeight();
|
|
70209
|
+
}
|
|
70210
|
+
};
|
|
70211
|
+
this.controlHeightSubscriber = {
|
|
70212
|
+
handleChange: () => {
|
|
70213
|
+
this.updateRowHeight();
|
|
70214
|
+
}
|
|
70215
|
+
};
|
|
70195
70216
|
this.actionMenuSlots = [];
|
|
70196
70217
|
this.onViewPortScroll = (event) => {
|
|
70197
70218
|
this.scrollX = event.target.scrollLeft;
|
|
@@ -70299,6 +70320,7 @@ focus outline in that case.
|
|
|
70299
70320
|
connectedCallback() {
|
|
70300
70321
|
super.connectedCallback();
|
|
70301
70322
|
this.initialize();
|
|
70323
|
+
this.updateRowHeight();
|
|
70302
70324
|
this.virtualizer.connect();
|
|
70303
70325
|
this.viewport.addEventListener('scroll', this.onViewPortScroll, {
|
|
70304
70326
|
passive: true
|
|
@@ -70307,6 +70329,8 @@ focus outline in that case.
|
|
|
70307
70329
|
window.addEventListener('keydown', this.onKeyDown);
|
|
70308
70330
|
window.addEventListener('keyup', this.onKeyUp);
|
|
70309
70331
|
window.addEventListener('blur', this.onBlur);
|
|
70332
|
+
borderWidth.subscribe(this.borderWidthSubscriber, this);
|
|
70333
|
+
controlHeight.subscribe(this.controlHeightSubscriber, this);
|
|
70310
70334
|
}
|
|
70311
70335
|
disconnectedCallback() {
|
|
70312
70336
|
super.disconnectedCallback();
|
|
@@ -70316,6 +70340,8 @@ focus outline in that case.
|
|
|
70316
70340
|
window.removeEventListener('keydown', this.onKeyDown);
|
|
70317
70341
|
window.removeEventListener('keyup', this.onKeyUp);
|
|
70318
70342
|
window.removeEventListener('blur', this.onBlur);
|
|
70343
|
+
borderWidth.unsubscribe(this.borderWidthSubscriber);
|
|
70344
|
+
controlHeight.unsubscribe(this.controlHeightSubscriber);
|
|
70319
70345
|
}
|
|
70320
70346
|
checkValidity() {
|
|
70321
70347
|
return this.tableValidator.isValid();
|
|
@@ -70959,6 +70985,11 @@ focus outline in that case.
|
|
|
70959
70985
|
}
|
|
70960
70986
|
return tanstackSelectionState;
|
|
70961
70987
|
}
|
|
70988
|
+
updateRowHeight() {
|
|
70989
|
+
this._rowHeight = parseFloat(controlHeight.getValueFor(this))
|
|
70990
|
+
+ 2 * parseFloat(borderWidth.getValueFor(this));
|
|
70991
|
+
this.virtualizer?.updateRowHeight();
|
|
70992
|
+
}
|
|
70962
70993
|
};
|
|
70963
70994
|
__decorate$1([
|
|
70964
70995
|
attr({ attribute: 'id-field-name' })
|