@ni/spright-components 4.1.1 → 4.1.2

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