@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 +8 -0
- package/dist/cjs/limel-table.cjs.entry.js +14 -6
- package/dist/cjs/limel-table.cjs.entry.js.map +1 -1
- package/dist/collection/components/table/table.js +15 -7
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/esm/limel-table.entry.js +14 -6
- package/dist/esm/limel-table.entry.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-c3394c18.entry.js → p-d1aa44e1.entry.js} +2 -2
- package/dist/lime-elements/p-d1aa44e1.entry.js.map +1 -0
- package/dist/types/components/table/table.d.ts +3 -1
- package/dist/types/components.d.ts +2 -2
- package/package.json +1 -1
- package/dist/lime-elements/p-c3394c18.entry.js.map +0 -1
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
|
|
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(
|
|
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
|
-
|
|
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);
|