@lavalogic/scoria 0.11.7 → 0.11.9
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.
|
@@ -66,7 +66,7 @@ export class TableContext {
|
|
|
66
66
|
}
|
|
67
67
|
this._dataRepo = $state(dataRepo);
|
|
68
68
|
// this.dataRepo.forceRefresh = this.forceVisibilityUpdate;
|
|
69
|
-
|
|
69
|
+
$effect(() => {
|
|
70
70
|
const sd = (() => {
|
|
71
71
|
if (this.paginationRepo?.paginationType == PaginationType.Local) {
|
|
72
72
|
const state = this.dataRepo?.sorting ?? [];
|
|
@@ -95,19 +95,23 @@ export class TableContext {
|
|
|
95
95
|
}
|
|
96
96
|
return this.filteredData ?? [];
|
|
97
97
|
})();
|
|
98
|
-
const cpd =
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
const cpd = (() => {
|
|
99
|
+
if (dataRepo.paginationType != PaginationType.Local) {
|
|
100
|
+
return sd ?? [];
|
|
101
|
+
}
|
|
102
|
+
return sd.slice(dataRepo.pageStartIndex, dataRepo.pageEndIndexExclusive);
|
|
103
|
+
})();
|
|
101
104
|
const ori = new Map((dataRepo.data ?? []).map((item, index) => [item, index]));
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
if (cpd != null) {
|
|
106
|
+
this._sortedData = sd;
|
|
107
|
+
this._currentPageData = cpd;
|
|
108
|
+
this._originalRowIndices = ori;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
}
|
|
108
112
|
});
|
|
109
113
|
$effect(() => {
|
|
110
|
-
if (_currentPageData) {
|
|
114
|
+
if (this._currentPageData) {
|
|
111
115
|
untrack(() => {
|
|
112
116
|
if (this.paginationRepo?.paginationState.pageIndex != undefined &&
|
|
113
117
|
this.paginationRepo?.paginationState.pageSize != undefined) {
|
|
@@ -355,12 +359,7 @@ export class TableContext {
|
|
|
355
359
|
return this._columnDefs;
|
|
356
360
|
}
|
|
357
361
|
set columnDefs(v) {
|
|
358
|
-
// if (this._columnDefs.length > 0 && v != this._columnDefs) {
|
|
359
|
-
// debugger;
|
|
360
|
-
// }
|
|
361
362
|
this._columnDefs = v;
|
|
362
|
-
// this causes an error...?
|
|
363
|
-
// this.table = createTable(this.tableOptions);
|
|
364
363
|
}
|
|
365
364
|
_columnPresets = $state([]);
|
|
366
365
|
get columnPresets() {
|
|
@@ -967,7 +966,6 @@ export class TableContext {
|
|
|
967
966
|
onEditCell = async (item, coords, value) => {
|
|
968
967
|
const oldKey = this.selectionExtractor?.(item);
|
|
969
968
|
const wasSelected = oldKey != null && this.selectedItems.has(oldKey);
|
|
970
|
-
// debugger;
|
|
971
969
|
if (wasSelected) {
|
|
972
970
|
this.selectedItems.delete(oldKey);
|
|
973
971
|
}
|
|
@@ -1886,8 +1884,8 @@ export class TableContext {
|
|
|
1886
1884
|
for (const item of selectedRows) {
|
|
1887
1885
|
const rowIndex = this.sortedData.indexOf(item);
|
|
1888
1886
|
if (rowIndex == -1) {
|
|
1889
|
-
|
|
1890
|
-
|
|
1887
|
+
console.warn(`row index for highlighted row data not found`);
|
|
1888
|
+
continue;
|
|
1891
1889
|
}
|
|
1892
1890
|
indices.set(item, rowIndex);
|
|
1893
1891
|
}
|