@limetech/lime-elements 38.29.3 → 38.29.4

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [38.29.4](https://github.com/Lundalogik/lime-elements/compare/v38.29.3...v38.29.4) (2025-11-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+
7
+ * **table:** prevent scrolling to top after selecting a row at the bottom ([1b4ddc3](https://github.com/Lundalogik/lime-elements/commit/1b4ddc3d9e7ef5de7ab6cea332875640bef580a2))
8
+
1
9
  ## [38.29.3](https://github.com/Lundalogik/lime-elements/compare/v38.29.2...v38.29.3) (2025-11-04)
2
10
 
3
11
 
@@ -24434,7 +24434,10 @@ const Table = class {
24434
24434
  this.formatRows();
24435
24435
  }
24436
24436
  updateData(newData = [], oldData = []) {
24437
- const shouldReplace = this.shouldReplaceData(newData, oldData);
24437
+ const newIds = this.getRowIds(newData);
24438
+ const oldIds = this.getRowIds(oldData);
24439
+ const shouldReplace = this.shouldReplaceData(newIds, oldIds);
24440
+ const hasRowUpdates = !areRowsEqual(newData, oldData);
24438
24441
  setTimeout(() => {
24439
24442
  if (!this.tabulator) {
24440
24443
  return;
@@ -24445,6 +24448,11 @@ const Table = class {
24445
24448
  this.setSelection();
24446
24449
  return;
24447
24450
  }
24451
+ if (hasRowUpdates) {
24452
+ this.tabulator.updateData(newData);
24453
+ this.setSelection();
24454
+ return;
24455
+ }
24448
24456
  this.tabulator.updateOrAddData(newData);
24449
24457
  });
24450
24458
  }
@@ -24507,12 +24515,12 @@ const Table = class {
24507
24515
  }
24508
24516
  this.tabulator.setSort(newSorting);
24509
24517
  }
24510
- shouldReplaceData(newData, oldData) {
24511
- const newIds = newData.map((item) => { var _a; return (_a = item.id) !== null && _a !== void 0 ? _a : item; });
24512
- const oldIds = oldData.map((item) => { var _a; return (_a = item.id) !== null && _a !== void 0 ? _a : item; });
24518
+ shouldReplaceData(newIds, oldIds) {
24513
24519
  return (!this.areEqualIds(newIds, oldIds) ||
24514
- !this.isSameOrder(newIds, oldIds) ||
24515
- !areRowsEqual(newData, oldData));
24520
+ !this.isSameOrder(newIds, oldIds));
24521
+ }
24522
+ getRowIds(data) {
24523
+ return data.map((item) => { var _a; return (_a = item.id) !== null && _a !== void 0 ? _a : item; });
24516
24524
  }
24517
24525
  areEqualIds(newIds, oldIds) {
24518
24526
  const newIdSet = new Set(newIds);