@lavalogic/scoria 0.11.13 → 0.11.14
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.
|
@@ -82,11 +82,8 @@ export class TableContext {
|
|
|
82
82
|
const sd = (() => {
|
|
83
83
|
if (this.paginationRepo?.paginationType == PaginationType.Local) {
|
|
84
84
|
const state = dataRepo.sorting ?? [];
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
[...this.selectedItems.values()]
|
|
88
|
-
: fd.concat();
|
|
89
|
-
sortedData.sort((a, b) => {
|
|
85
|
+
const dataToSort = fd.concat();
|
|
86
|
+
dataToSort.sort((a, b) => {
|
|
90
87
|
const end = state.length;
|
|
91
88
|
for (let i = 0; i < end; i++) {
|
|
92
89
|
const { id, desc } = state[i];
|
|
@@ -97,13 +94,13 @@ export class TableContext {
|
|
|
97
94
|
return result;
|
|
98
95
|
}
|
|
99
96
|
}
|
|
100
|
-
else {
|
|
97
|
+
else if (dev) {
|
|
101
98
|
console.warn('no sorting fn found for ' + id);
|
|
102
99
|
}
|
|
103
100
|
}
|
|
104
101
|
return 0;
|
|
105
102
|
});
|
|
106
|
-
return
|
|
103
|
+
return dataToSort;
|
|
107
104
|
}
|
|
108
105
|
return fd ?? [];
|
|
109
106
|
})();
|
|
@@ -111,7 +108,11 @@ export class TableContext {
|
|
|
111
108
|
if (dataRepo.paginationType != PaginationType.Local) {
|
|
112
109
|
return sd ?? [];
|
|
113
110
|
}
|
|
114
|
-
|
|
111
|
+
const x = sd.slice(dataRepo.pageStartIndex, dataRepo.pageEndIndexExclusive);
|
|
112
|
+
if (dev) {
|
|
113
|
+
console.log(x);
|
|
114
|
+
}
|
|
115
|
+
return x;
|
|
115
116
|
})();
|
|
116
117
|
const ori = new Map((dataRepo.data ?? []).map((item, index) => [item, index]));
|
|
117
118
|
this._filteredData = fd;
|
|
@@ -713,8 +714,8 @@ export class TableContext {
|
|
|
713
714
|
return this._originalRowIndices;
|
|
714
715
|
}
|
|
715
716
|
paginationRowModel = $derived.by(() => {
|
|
716
|
-
const
|
|
717
|
-
const rows =
|
|
717
|
+
const currentPageData = this._currentPageData;
|
|
718
|
+
const rows = currentPageData.map((item, index) => {
|
|
718
719
|
const unsortedIndex = this._originalRowIndices.get(item) ?? index;
|
|
719
720
|
if (!item) {
|
|
720
721
|
throw new Error(`No Item was found at index ${index}`);
|