@rozie-ui/data-table-solid 0.2.6 → 0.3.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.
- package/README.md +3 -2
- package/dist/index.cjs +696 -255
- package/dist/index.d.cts +7 -3
- package/dist/index.d.mts +7 -3
- package/dist/index.mjs +696 -255
- package/package.json +2 -2
- package/src/DataTable.tsx +1320 -418
- package/src/helpers/columnDefUtils.ts +111 -0
- package/src/helpers/indexMath.ts +25 -0
- package/src/helpers/rowValueUtils.ts +62 -0
- package/src/helpers/tsvGrid.ts +115 -0
package/dist/index.cjs
CHANGED
|
@@ -31,6 +31,196 @@ let _rozie_ui_popover_solid = require("@rozie-ui/popover-solid");
|
|
|
31
31
|
_rozie_ui_popover_solid = __toESM(_rozie_ui_popover_solid);
|
|
32
32
|
let _tanstack_table_core = require("@tanstack/table-core");
|
|
33
33
|
let _tanstack_virtual_core = require("@tanstack/virtual-core");
|
|
34
|
+
//#region src/helpers/columnDefUtils.ts
|
|
35
|
+
const isSafeKey = (k) => k !== "__proto__" && k !== "constructor" && k !== "prototype";
|
|
36
|
+
const wrapAggregationFn = (fn) => {
|
|
37
|
+
if (typeof fn === "string") return fn;
|
|
38
|
+
if (typeof fn !== "function") return void 0;
|
|
39
|
+
return (columnId, leafRows, childRows) => {
|
|
40
|
+
try {
|
|
41
|
+
return fn(columnId, leafRows, childRows);
|
|
42
|
+
} catch (err) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
const collectNestedDefs = (list, out) => {
|
|
48
|
+
if (!Array.isArray(list)) return;
|
|
49
|
+
for (const d of list) {
|
|
50
|
+
if (!d || d.id == null) continue;
|
|
51
|
+
const id = String(d.id);
|
|
52
|
+
if (!(id in out)) out[id] = d;
|
|
53
|
+
if (Array.isArray(d.columns)) collectNestedDefs(d.columns, out);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const indexDefsById = (defs) => {
|
|
57
|
+
const out = Object.create(null);
|
|
58
|
+
if (!Array.isArray(defs)) return out;
|
|
59
|
+
for (const d of defs) {
|
|
60
|
+
if (!d || d.id == null) continue;
|
|
61
|
+
out[String(d.id)] = d;
|
|
62
|
+
}
|
|
63
|
+
for (const d of defs) if (d && Array.isArray(d.columns)) collectNestedDefs(d.columns, out);
|
|
64
|
+
return out;
|
|
65
|
+
};
|
|
66
|
+
const collectGroupableLeafDefs = (defs) => {
|
|
67
|
+
const out = [];
|
|
68
|
+
if (!Array.isArray(defs)) return out;
|
|
69
|
+
for (const d of defs) {
|
|
70
|
+
if (!d) continue;
|
|
71
|
+
if (Array.isArray(d.columns)) {
|
|
72
|
+
out.push(...collectGroupableLeafDefs(d.columns));
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (d.groupable === false) continue;
|
|
76
|
+
out.push(d);
|
|
77
|
+
}
|
|
78
|
+
return out;
|
|
79
|
+
};
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/helpers/indexMath.ts
|
|
82
|
+
const clamp = (v, lo, hi) => v < lo ? lo : v > hi ? hi : v;
|
|
83
|
+
const focusables = (cellEl) => {
|
|
84
|
+
if (!cellEl || !cellEl.querySelectorAll) return [];
|
|
85
|
+
return Array.prototype.slice.call(cellEl.querySelectorAll("button,[href],input,select,textarea,[tabindex]:not([tabindex=\"-1\"])")).filter((n) => !n.disabled);
|
|
86
|
+
};
|
|
87
|
+
const applyUpdater = (updater, current) => typeof updater === "function" ? updater(current) : updater;
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/helpers/tsvGrid.ts
|
|
90
|
+
const escapeTsvField = (s) => {
|
|
91
|
+
if (s.indexOf(" ") >= 0 || s.indexOf("\n") >= 0 || s.indexOf("\r") >= 0 || s.indexOf("\"") >= 0) return "\"" + s.replace(/"/g, "\"\"") + "\"";
|
|
92
|
+
return s;
|
|
93
|
+
};
|
|
94
|
+
const parseTsv = (text) => {
|
|
95
|
+
const str = text != null ? String(text) : "";
|
|
96
|
+
if (str === "" || str.length > 2e6) return [];
|
|
97
|
+
const rows = [];
|
|
98
|
+
let row = [];
|
|
99
|
+
let field = "";
|
|
100
|
+
let inQuotes = false;
|
|
101
|
+
let i = 0;
|
|
102
|
+
const n = str.length;
|
|
103
|
+
while (i < n) {
|
|
104
|
+
const ch = str[i];
|
|
105
|
+
if (inQuotes) {
|
|
106
|
+
if (ch === "\"") {
|
|
107
|
+
if (i + 1 < n && str[i + 1] === "\"") {
|
|
108
|
+
field = field + "\"";
|
|
109
|
+
i = i + 2;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
inQuotes = false;
|
|
113
|
+
i = i + 1;
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
field = field + ch;
|
|
117
|
+
i = i + 1;
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (ch === "\"" && field === "") {
|
|
121
|
+
inQuotes = true;
|
|
122
|
+
i = i + 1;
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
if (ch === " ") {
|
|
126
|
+
row.push(field);
|
|
127
|
+
field = "";
|
|
128
|
+
i = i + 1;
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (ch === "\r") {
|
|
132
|
+
if (i + 1 < n && str[i + 1] === "\n") i = i + 1;
|
|
133
|
+
row.push(field);
|
|
134
|
+
field = "";
|
|
135
|
+
rows.push(row);
|
|
136
|
+
row = [];
|
|
137
|
+
i = i + 1;
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (ch === "\n") {
|
|
141
|
+
row.push(field);
|
|
142
|
+
field = "";
|
|
143
|
+
rows.push(row);
|
|
144
|
+
row = [];
|
|
145
|
+
i = i + 1;
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
field = field + ch;
|
|
149
|
+
i = i + 1;
|
|
150
|
+
}
|
|
151
|
+
row.push(field);
|
|
152
|
+
rows.push(row);
|
|
153
|
+
if (rows.length > 1) {
|
|
154
|
+
const last = rows[rows.length - 1];
|
|
155
|
+
if (last.length === 1 && last[0] === "") rows.pop();
|
|
156
|
+
}
|
|
157
|
+
return rows;
|
|
158
|
+
};
|
|
159
|
+
const tileGridToBox = (grid, box) => {
|
|
160
|
+
const srcRows = grid.length;
|
|
161
|
+
let srcCols = 0;
|
|
162
|
+
for (let i = 0; i < srcRows; i++) {
|
|
163
|
+
const w = grid[i] && grid[i].length ? grid[i].length : 0;
|
|
164
|
+
if (w > srcCols) srcCols = w;
|
|
165
|
+
}
|
|
166
|
+
if (srcRows <= 0 || srcCols <= 0) return grid;
|
|
167
|
+
const boxRows = box.r1 - box.r0 + 1;
|
|
168
|
+
const boxCols = box.c1 - box.c0 + 1;
|
|
169
|
+
const rows = boxRows > srcRows ? boxRows : srcRows;
|
|
170
|
+
const cols = boxCols > srcCols ? boxCols : srcCols;
|
|
171
|
+
const out = [];
|
|
172
|
+
for (let r = 0; r < rows; r++) {
|
|
173
|
+
const srcLine = grid[r % srcRows] || [];
|
|
174
|
+
const line = [];
|
|
175
|
+
for (let c = 0; c < cols; c++) {
|
|
176
|
+
const v = srcLine[c % srcCols];
|
|
177
|
+
line.push(v != null ? v : "");
|
|
178
|
+
}
|
|
179
|
+
out.push(line);
|
|
180
|
+
}
|
|
181
|
+
return out;
|
|
182
|
+
};
|
|
183
|
+
const tileIndex = (i, lo, hi) => {
|
|
184
|
+
const span = hi - lo + 1;
|
|
185
|
+
if (span <= 1) return lo;
|
|
186
|
+
let k = (i - lo) % span;
|
|
187
|
+
if (k < 0) k = k + span;
|
|
188
|
+
return lo + k;
|
|
189
|
+
};
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/helpers/rowValueUtils.ts
|
|
192
|
+
const replaceRowValue = (rows, rowIndex, field, value) => {
|
|
193
|
+
const src = rows || [];
|
|
194
|
+
const out = [];
|
|
195
|
+
for (let i = 0; i < src.length; i++) if (i === rowIndex) out.push({
|
|
196
|
+
...src[i] || {},
|
|
197
|
+
[field]: value
|
|
198
|
+
});
|
|
199
|
+
else out.push(src[i]);
|
|
200
|
+
return out;
|
|
201
|
+
};
|
|
202
|
+
const replaceRowValues = (rows, rowIndex, fieldValues) => {
|
|
203
|
+
const src = rows || [];
|
|
204
|
+
const fv = fieldValues || {};
|
|
205
|
+
const out = [];
|
|
206
|
+
for (let i = 0; i < src.length; i++) if (i === rowIndex) out.push({
|
|
207
|
+
...src[i] || {},
|
|
208
|
+
...fv
|
|
209
|
+
});
|
|
210
|
+
else out.push(src[i]);
|
|
211
|
+
return out;
|
|
212
|
+
};
|
|
213
|
+
const indexOfRowIn = (rows, rowOriginal, rowId) => {
|
|
214
|
+
const list = rows || [];
|
|
215
|
+
for (let i = 0; i < list.length; i++) {
|
|
216
|
+
const r = list[i];
|
|
217
|
+
if (!r) continue;
|
|
218
|
+
if (rowId != null && r.id === rowId) return i;
|
|
219
|
+
if (rowOriginal != null && r.original === rowOriginal) return i;
|
|
220
|
+
}
|
|
221
|
+
return -1;
|
|
222
|
+
};
|
|
223
|
+
//#endregion
|
|
34
224
|
//#region src/DataTable.tsx
|
|
35
225
|
(0, _rozie_runtime_solid.__rozieInjectStyle)("DataTable-d5dcab4c", `.rozie-data-table[data-rozie-s-d5dcab4c] {
|
|
36
226
|
border-collapse: collapse;
|
|
@@ -38,6 +228,13 @@ let _tanstack_virtual_core = require("@tanstack/virtual-core");
|
|
|
38
228
|
font: var(--rdt-font, 14px system-ui, sans-serif);
|
|
39
229
|
color: var(--rdt-color, inherit);
|
|
40
230
|
}
|
|
231
|
+
.rozie-data-table.rdt-col-windowed[data-rozie-s-d5dcab4c] {
|
|
232
|
+
table-layout: fixed;
|
|
233
|
+
}
|
|
234
|
+
.rozie-data-table.rdt-col-windowed[data-rozie-s-d5dcab4c] .rdt-th[data-rozie-s-d5dcab4c],
|
|
235
|
+
.rozie-data-table.rdt-col-windowed[data-rozie-s-d5dcab4c] .rdt-td[data-rozie-s-d5dcab4c] {
|
|
236
|
+
box-sizing: border-box;
|
|
237
|
+
}
|
|
41
238
|
.rdt-sr-live[data-rozie-s-d5dcab4c] {
|
|
42
239
|
position: absolute;
|
|
43
240
|
width: 1px;
|
|
@@ -355,6 +552,7 @@ function DataTable(_props) {
|
|
|
355
552
|
undoLimit: 100,
|
|
356
553
|
virtual: false,
|
|
357
554
|
estimateRowHeight: 40,
|
|
555
|
+
autoMeasure: false,
|
|
358
556
|
maxHeight: ""
|
|
359
557
|
}, _props), [
|
|
360
558
|
"data",
|
|
@@ -384,6 +582,7 @@ function DataTable(_props) {
|
|
|
384
582
|
"undoLimit",
|
|
385
583
|
"virtual",
|
|
386
584
|
"estimateRowHeight",
|
|
585
|
+
"autoMeasure",
|
|
387
586
|
"maxHeight",
|
|
388
587
|
"children",
|
|
389
588
|
"ref",
|
|
@@ -558,10 +757,11 @@ function DataTable(_props) {
|
|
|
558
757
|
setRows(nextRows);
|
|
559
758
|
setHeaderGroups(nextGroups);
|
|
560
759
|
setRowModelVer(rowModelVer() + 1);
|
|
561
|
-
if (
|
|
760
|
+
if (rowsWindowed() && virtualizer) {
|
|
562
761
|
virtualizer.setOptions(virtualizerOptions());
|
|
563
762
|
virtualizer._willUpdate();
|
|
564
763
|
}
|
|
764
|
+
remeasureColumnWindow();
|
|
565
765
|
const nextRowCount = nextRows.length;
|
|
566
766
|
clampActiveCell(nextRowCount, nextRows.length ? nextRows[0].getVisibleCells().length : nextGroups.length ? (nextGroups[nextGroups.length - 1].headers || []).length : 0);
|
|
567
767
|
const pgState = table.getState().pagination;
|
|
@@ -582,17 +782,28 @@ function DataTable(_props) {
|
|
|
582
782
|
};
|
|
583
783
|
refreshRowModel();
|
|
584
784
|
gridRoot = __rozieRootRef ? __rozieRootRef.querySelector(".rozie-data-table") : null;
|
|
585
|
-
if (
|
|
586
|
-
|
|
785
|
+
if (isWindowed()) gridScrollEl = __rozieRootRef ? __rozieRootRef.querySelector(".rdt-scroll") : null;
|
|
786
|
+
if (rowsWindowed()) {
|
|
587
787
|
virtualizer = new _tanstack_virtual_core.Virtualizer(virtualizerOptions());
|
|
588
788
|
virtualizerCleanup = virtualizer._didMount();
|
|
589
|
-
|
|
789
|
+
}
|
|
790
|
+
if (colsWindowed()) {
|
|
791
|
+
colVirtualizer = new _tanstack_virtual_core.Virtualizer(columnVirtualizerOptions());
|
|
792
|
+
colVirtualizerCleanup = colVirtualizer._didMount();
|
|
793
|
+
}
|
|
794
|
+
if (isWindowed()) setWindowVer(windowVer() + 1);
|
|
795
|
+
if (isWindowed()) {
|
|
590
796
|
const afterFirstFrame = () => {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
797
|
+
if (rowsWindowed()) {
|
|
798
|
+
remeasureWindow();
|
|
799
|
+
if (!(gridScrollEl ? gridScrollEl.clientHeight : 0)) console.warn("[rozie-data-table] virtual is on but the scroll container has no bounded height; set maxHeight or --rozie-data-table-max-height");
|
|
800
|
+
const pg = pagination();
|
|
801
|
+
const pgConfigured = pg != null && !(pg.pageIndex === 0 && pg.pageSize === 10);
|
|
802
|
+
if (local.manual !== true && pgConfigured) console.warn("[rozie-data-table] virtual+pagination: client pagination is configured but virtual windowing replaces it — the pagination chrome is auto-suppressed. Remove the pagination prop or set manual to silence this.");
|
|
803
|
+
}
|
|
804
|
+
if (colsWindowed()) {
|
|
805
|
+
if (!(gridScrollEl ? gridScrollEl.clientWidth : 0)) console.warn("[rozie-data-table] virtual is on for columns but the scroll container has no bounded width; set a CSS width on an ancestor so the column window can be measured");
|
|
806
|
+
}
|
|
596
807
|
};
|
|
597
808
|
if (typeof requestAnimationFrame === "function") requestAnimationFrame(() => requestAnimationFrame(afterFirstFrame));
|
|
598
809
|
else setTimeout(afterFirstFrame, 0);
|
|
@@ -603,6 +814,9 @@ function DataTable(_props) {
|
|
|
603
814
|
});
|
|
604
815
|
(0, Solid_js.onCleanup)(() => {
|
|
605
816
|
if (virtualizerCleanup) virtualizerCleanup();
|
|
817
|
+
if (colVirtualizerCleanup) colVirtualizerCleanup();
|
|
818
|
+
teardownColRtlWatch();
|
|
819
|
+
teardownRemeasure();
|
|
606
820
|
teardownFillDrag();
|
|
607
821
|
teardownRangeDrag();
|
|
608
822
|
});
|
|
@@ -657,7 +871,11 @@ function DataTable(_props) {
|
|
|
657
871
|
let virtualizer = null;
|
|
658
872
|
let virtualizerCleanup = null;
|
|
659
873
|
let gridScrollEl = null;
|
|
874
|
+
let colVirtualizer = null;
|
|
875
|
+
let colVirtualizerCleanup = null;
|
|
660
876
|
let remeasurePending = false;
|
|
877
|
+
let remeasureRaf = null;
|
|
878
|
+
let remeasureDisposed = false;
|
|
661
879
|
const GRID_PAGE_STEP = 10;
|
|
662
880
|
let gridRoot = null;
|
|
663
881
|
let programmatic = 0;
|
|
@@ -701,20 +919,6 @@ function DataTable(_props) {
|
|
|
701
919
|
function currentData() {
|
|
702
920
|
return data() != null ? data() : dataDefault();
|
|
703
921
|
}
|
|
704
|
-
function isSafeKey(k) {
|
|
705
|
-
return k !== "__proto__" && k !== "constructor" && k !== "prototype";
|
|
706
|
-
}
|
|
707
|
-
function wrapAggregationFn(fn) {
|
|
708
|
-
if (typeof fn === "string") return fn;
|
|
709
|
-
if (typeof fn !== "function") return void 0;
|
|
710
|
-
return (columnId, leafRows, childRows) => {
|
|
711
|
-
try {
|
|
712
|
-
return fn(columnId, leafRows, childRows);
|
|
713
|
-
} catch (err) {
|
|
714
|
-
return;
|
|
715
|
-
}
|
|
716
|
-
};
|
|
717
|
-
}
|
|
718
922
|
function buildConfigDef(c) {
|
|
719
923
|
if (!c) return null;
|
|
720
924
|
if (Array.isArray(c.columns)) {
|
|
@@ -759,10 +963,16 @@ function DataTable(_props) {
|
|
|
759
963
|
}
|
|
760
964
|
};
|
|
761
965
|
}
|
|
966
|
+
let columnDefsCache = null;
|
|
967
|
+
let columnDefsCacheColumnsRef = void 0;
|
|
968
|
+
let columnDefsCacheColRegRef = void 0;
|
|
969
|
+
let columnDefsIndexCache = null;
|
|
762
970
|
function columnDefs() {
|
|
971
|
+
const cfg = local.columns || [];
|
|
972
|
+
const reg = colReg() || {};
|
|
973
|
+
if (columnDefsCache && local.columns === columnDefsCacheColumnsRef && colReg() === columnDefsCacheColRegRef) return columnDefsCache;
|
|
763
974
|
const byId = Object.create(null);
|
|
764
975
|
const order = [];
|
|
765
|
-
const cfg = local.columns || [];
|
|
766
976
|
for (const c of cfg) {
|
|
767
977
|
const def = buildConfigDef(c);
|
|
768
978
|
if (!def) continue;
|
|
@@ -770,7 +980,6 @@ function DataTable(_props) {
|
|
|
770
980
|
if (!(id in byId)) order.push(id);
|
|
771
981
|
byId[id] = def;
|
|
772
982
|
}
|
|
773
|
-
const reg = colReg() || {};
|
|
774
983
|
for (const id in reg) {
|
|
775
984
|
if (!isSafeKey(id)) continue;
|
|
776
985
|
const spec = reg[id];
|
|
@@ -798,8 +1007,16 @@ function DataTable(_props) {
|
|
|
798
1007
|
}
|
|
799
1008
|
const out = [];
|
|
800
1009
|
for (const id of order) if (byId[id]) out.push(byId[id]);
|
|
1010
|
+
columnDefsCache = out;
|
|
1011
|
+
columnDefsCacheColumnsRef = local.columns;
|
|
1012
|
+
columnDefsCacheColRegRef = colReg();
|
|
1013
|
+
columnDefsIndexCache = indexDefsById(out);
|
|
801
1014
|
return out;
|
|
802
1015
|
}
|
|
1016
|
+
function defIndex() {
|
|
1017
|
+
columnDefs();
|
|
1018
|
+
return columnDefsIndexCache || Object.create(null);
|
|
1019
|
+
}
|
|
803
1020
|
const SELECT_COL_ID = "__rdt_select";
|
|
804
1021
|
const EXPANDER_COL_ID = "__rdt_expander";
|
|
805
1022
|
function selectionEnabled() {
|
|
@@ -838,9 +1055,6 @@ function DataTable(_props) {
|
|
|
838
1055
|
_props.onSortChange?.(next);
|
|
839
1056
|
programmatic--;
|
|
840
1057
|
}
|
|
841
|
-
function applyUpdater(updater, current) {
|
|
842
|
-
return typeof updater === "function" ? updater(current) : updater;
|
|
843
|
-
}
|
|
844
1058
|
function writeExpanded(next) {
|
|
845
1059
|
if (programmatic) return;
|
|
846
1060
|
programmatic++;
|
|
@@ -1048,12 +1262,71 @@ function DataTable(_props) {
|
|
|
1048
1262
|
const next = applyUpdater(updater, columnSizingInfo());
|
|
1049
1263
|
setColumnSizingInfo(next != null ? next : columnSizingInfo());
|
|
1050
1264
|
}
|
|
1265
|
+
function resolveVirtual() {
|
|
1266
|
+
const v = local.virtual;
|
|
1267
|
+
if (typeof v === "string") {
|
|
1268
|
+
if (v === "rows") return "rows";
|
|
1269
|
+
if (v === "columns") return "columns";
|
|
1270
|
+
if (v === "both") return "both";
|
|
1271
|
+
return "off";
|
|
1272
|
+
}
|
|
1273
|
+
return v === true ? "rows" : "off";
|
|
1274
|
+
}
|
|
1275
|
+
function rowsWindowed() {
|
|
1276
|
+
const s = resolveVirtual();
|
|
1277
|
+
return s === "rows" || s === "both";
|
|
1278
|
+
}
|
|
1279
|
+
function colsWindowed() {
|
|
1280
|
+
const s = resolveVirtual();
|
|
1281
|
+
return s === "columns" || s === "both";
|
|
1282
|
+
}
|
|
1283
|
+
function isWindowed() {
|
|
1284
|
+
return rowsWindowed() || colsWindowed();
|
|
1285
|
+
}
|
|
1286
|
+
function autoMeasureOn() {
|
|
1287
|
+
return local.autoMeasure === true;
|
|
1288
|
+
}
|
|
1289
|
+
function columnCount() {
|
|
1290
|
+
return visibleColCount();
|
|
1291
|
+
}
|
|
1292
|
+
function columnSize(i) {
|
|
1293
|
+
if (!table || !table.getVisibleLeafColumns) return 150;
|
|
1294
|
+
const c = table.getVisibleLeafColumns()[i];
|
|
1295
|
+
return c && typeof c.getSize === "function" ? c.getSize() : 150;
|
|
1296
|
+
}
|
|
1297
|
+
function forcedColumns() {
|
|
1298
|
+
if (!colsWindowed()) return [];
|
|
1299
|
+
const out = [];
|
|
1300
|
+
if (table && table.getVisibleLeafColumns) {
|
|
1301
|
+
const cols = table.getVisibleLeafColumns();
|
|
1302
|
+
for (let i = 0; i < cols.length; i++) {
|
|
1303
|
+
const c = cols[i];
|
|
1304
|
+
if (c && c.getIsPinned && c.getIsPinned()) out.push(i);
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
if (!activeIsHeader() && activeColIndex() >= 0 && out.indexOf(activeColIndex()) === -1) out.push(activeColIndex());
|
|
1308
|
+
if (editingRow() >= 0 && editingCol() >= 0 && out.indexOf(editingCol()) === -1) out.push(editingCol());
|
|
1309
|
+
return out;
|
|
1310
|
+
}
|
|
1311
|
+
function windowedCells(row) {
|
|
1312
|
+
windowVer();
|
|
1313
|
+
const cells = visibleCellsFor(row);
|
|
1314
|
+
if (!colsWindowed()) return cells;
|
|
1315
|
+
const idx = windowedColIndices();
|
|
1316
|
+
const out = [];
|
|
1317
|
+
for (let i = 0; i < idx.length; i++) {
|
|
1318
|
+
const cell = cells[idx[i]];
|
|
1319
|
+
if (cell) out.push(cell);
|
|
1320
|
+
}
|
|
1321
|
+
return out;
|
|
1322
|
+
}
|
|
1051
1323
|
function windowSource() {
|
|
1052
1324
|
if (!table) return [];
|
|
1053
|
-
if (
|
|
1325
|
+
if (rowsWindowed()) return table.getPrePaginationRowModel().rows;
|
|
1054
1326
|
return table.getRowModel().rows;
|
|
1055
1327
|
}
|
|
1056
1328
|
function scheduleRemeasure() {
|
|
1329
|
+
if (remeasureDisposed) return;
|
|
1057
1330
|
if (remeasurePending) return;
|
|
1058
1331
|
remeasurePending = true;
|
|
1059
1332
|
let ranMicro = false;
|
|
@@ -1061,6 +1334,7 @@ function DataTable(_props) {
|
|
|
1061
1334
|
remeasureWindow();
|
|
1062
1335
|
};
|
|
1063
1336
|
const rafPass = () => {
|
|
1337
|
+
remeasureRaf = null;
|
|
1064
1338
|
remeasurePending = false;
|
|
1065
1339
|
remeasureWindow();
|
|
1066
1340
|
};
|
|
@@ -1068,9 +1342,18 @@ function DataTable(_props) {
|
|
|
1068
1342
|
ranMicro = true;
|
|
1069
1343
|
queueMicrotask(microPass);
|
|
1070
1344
|
}
|
|
1071
|
-
if (typeof requestAnimationFrame === "function") requestAnimationFrame(rafPass);
|
|
1345
|
+
if (typeof requestAnimationFrame === "function") remeasureRaf = requestAnimationFrame(rafPass);
|
|
1072
1346
|
else if (ranMicro) remeasurePending = false;
|
|
1073
|
-
else setTimeout(rafPass, 0);
|
|
1347
|
+
else remeasureRaf = setTimeout(rafPass, 0);
|
|
1348
|
+
}
|
|
1349
|
+
function teardownRemeasure() {
|
|
1350
|
+
remeasureDisposed = true;
|
|
1351
|
+
if (remeasureRaf != null) {
|
|
1352
|
+
if (typeof requestAnimationFrame === "function") cancelAnimationFrame(remeasureRaf);
|
|
1353
|
+
else clearTimeout(remeasureRaf);
|
|
1354
|
+
remeasureRaf = null;
|
|
1355
|
+
}
|
|
1356
|
+
remeasurePending = false;
|
|
1074
1357
|
}
|
|
1075
1358
|
function pinnedEditIndex() {
|
|
1076
1359
|
if (editingRow() >= 0) return editingRow();
|
|
@@ -1083,20 +1366,124 @@ function DataTable(_props) {
|
|
|
1083
1366
|
return ms && ms[pin] ? ms[pin] : null;
|
|
1084
1367
|
}
|
|
1085
1368
|
function remeasureWindow() {
|
|
1369
|
+
if (remeasureDisposed) return;
|
|
1086
1370
|
if (!virtualizer || !gridRoot) return;
|
|
1087
1371
|
if (virtualizer.scrollState) return;
|
|
1088
1372
|
const trs = gridRoot.querySelectorAll("tbody.rdt-tbody > tr[data-index]");
|
|
1089
1373
|
for (const tr of trs) virtualizer.measureElement(tr);
|
|
1374
|
+
if (afterRowRemeasure) afterRowRemeasure();
|
|
1090
1375
|
}
|
|
1091
1376
|
function virtualItemKey(i) {
|
|
1092
1377
|
const src = windowSource();
|
|
1093
1378
|
return src && src[i] ? src[i].id : void 0;
|
|
1094
1379
|
}
|
|
1380
|
+
const COL_OVERSCAN = 3;
|
|
1381
|
+
let colRtlObserver = null;
|
|
1382
|
+
let colRtlObserverEl = null;
|
|
1383
|
+
function isColRtl() {
|
|
1384
|
+
if (!gridScrollEl || typeof getComputedStyle !== "function") return false;
|
|
1385
|
+
return getComputedStyle(gridScrollEl).direction === "rtl";
|
|
1386
|
+
}
|
|
1387
|
+
function ensureColRtlWatch() {
|
|
1388
|
+
if (!gridScrollEl || colRtlObserverEl === gridScrollEl || typeof MutationObserver !== "function") return;
|
|
1389
|
+
if (colRtlObserver) colRtlObserver.disconnect();
|
|
1390
|
+
colRtlObserver = new MutationObserver(() => {
|
|
1391
|
+
if (colVirtualizer) colVirtualizer.setOptions({
|
|
1392
|
+
...colVirtualizer.options,
|
|
1393
|
+
isRtl: isColRtl()
|
|
1394
|
+
});
|
|
1395
|
+
});
|
|
1396
|
+
colRtlObserver.observe(gridScrollEl, {
|
|
1397
|
+
attributes: true,
|
|
1398
|
+
attributeFilter: ["dir"]
|
|
1399
|
+
});
|
|
1400
|
+
colRtlObserverEl = gridScrollEl;
|
|
1401
|
+
}
|
|
1402
|
+
function teardownColRtlWatch() {
|
|
1403
|
+
if (colRtlObserver) colRtlObserver.disconnect();
|
|
1404
|
+
colRtlObserver = null;
|
|
1405
|
+
colRtlObserverEl = null;
|
|
1406
|
+
}
|
|
1407
|
+
function columnVirtualizerOptions() {
|
|
1408
|
+
ensureColRtlWatch();
|
|
1409
|
+
return {
|
|
1410
|
+
count: columnCount(),
|
|
1411
|
+
getScrollElement: () => gridScrollEl,
|
|
1412
|
+
estimateSize: (i) => columnSize(i),
|
|
1413
|
+
horizontal: true,
|
|
1414
|
+
isRtl: isColRtl(),
|
|
1415
|
+
observeElementRect: _tanstack_virtual_core.observeElementRect,
|
|
1416
|
+
observeElementOffset: _tanstack_virtual_core.observeElementOffset,
|
|
1417
|
+
scrollToFn: _tanstack_virtual_core.elementScroll,
|
|
1418
|
+
measureElement: _tanstack_virtual_core.measureElement,
|
|
1419
|
+
overscan: COL_OVERSCAN,
|
|
1420
|
+
onChange: () => {
|
|
1421
|
+
setWindowVer(windowVer() + 1);
|
|
1422
|
+
}
|
|
1423
|
+
};
|
|
1424
|
+
}
|
|
1425
|
+
let measuredRowTotal = 0;
|
|
1426
|
+
let measuredRowCount = 0;
|
|
1427
|
+
let lastFedRowEstimate = 0;
|
|
1428
|
+
let foldedRowHeights = {};
|
|
1429
|
+
let windowVerBumpPending = false;
|
|
1430
|
+
function bumpWindowVer() {
|
|
1431
|
+
if (windowVerBumpPending) return;
|
|
1432
|
+
windowVerBumpPending = true;
|
|
1433
|
+
const flush = () => {
|
|
1434
|
+
windowVerBumpPending = false;
|
|
1435
|
+
setWindowVer(windowVer() + 1);
|
|
1436
|
+
};
|
|
1437
|
+
if (typeof queueMicrotask !== "undefined") queueMicrotask(flush);
|
|
1438
|
+
else setTimeout(flush, 0);
|
|
1439
|
+
}
|
|
1440
|
+
const ESTIMATE_REFEED_DELTA_PX = 4;
|
|
1441
|
+
function estimateRowSize(i) {
|
|
1442
|
+
if (!autoMeasureOn()) return local.estimateRowHeight;
|
|
1443
|
+
if (measuredRowCount === 0) return local.estimateRowHeight;
|
|
1444
|
+
return Math.round(measuredRowTotal / measuredRowCount);
|
|
1445
|
+
}
|
|
1446
|
+
function foldMeasuredRow(index, height) {
|
|
1447
|
+
const prev = foldedRowHeights[index];
|
|
1448
|
+
if (prev === height) return;
|
|
1449
|
+
if (prev == null) {
|
|
1450
|
+
measuredRowTotal = measuredRowTotal + height;
|
|
1451
|
+
measuredRowCount = measuredRowCount + 1;
|
|
1452
|
+
} else measuredRowTotal = measuredRowTotal - prev + height;
|
|
1453
|
+
foldedRowHeights[index] = height;
|
|
1454
|
+
}
|
|
1455
|
+
function refineRowEstimate() {
|
|
1456
|
+
if (!autoMeasureOn() || !virtualizer) return;
|
|
1457
|
+
const items = virtualizer.getVirtualItems();
|
|
1458
|
+
const measurements = virtualizer.getMeasurements();
|
|
1459
|
+
for (let i = 0; i < items.length; i++) {
|
|
1460
|
+
const idx = items[i].index;
|
|
1461
|
+
const m = measurements && measurements[idx];
|
|
1462
|
+
if (m) foldMeasuredRow(idx, m.size);
|
|
1463
|
+
}
|
|
1464
|
+
if (virtualizer.scrollState) return;
|
|
1465
|
+
const est = estimateRowSize(0);
|
|
1466
|
+
if (Math.abs(est - lastFedRowEstimate) < ESTIMATE_REFEED_DELTA_PX) return;
|
|
1467
|
+
const anchorIndex = items.length ? items[0].index : -1;
|
|
1468
|
+
const anchorStart = items.length ? items[0].start : 0;
|
|
1469
|
+
virtualizer.setOptions(virtualizerOptions());
|
|
1470
|
+
virtualizer._willUpdate();
|
|
1471
|
+
lastFedRowEstimate = est;
|
|
1472
|
+
if (anchorIndex >= 0 && gridScrollEl) {
|
|
1473
|
+
const freshMeasurements = virtualizer.getMeasurements();
|
|
1474
|
+
const fresh = freshMeasurements && freshMeasurements[anchorIndex];
|
|
1475
|
+
if (fresh) {
|
|
1476
|
+
const delta = fresh.start - anchorStart;
|
|
1477
|
+
if (delta !== 0) gridScrollEl.scrollTop = gridScrollEl.scrollTop + delta;
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
bumpWindowVer();
|
|
1481
|
+
}
|
|
1095
1482
|
function virtualizerOptions() {
|
|
1096
1483
|
return {
|
|
1097
1484
|
count: windowSource().length,
|
|
1098
1485
|
getScrollElement: () => gridScrollEl,
|
|
1099
|
-
estimateSize: () =>
|
|
1486
|
+
estimateSize: (i) => estimateRowSize(i),
|
|
1100
1487
|
observeElementRect: _tanstack_virtual_core.observeElementRect,
|
|
1101
1488
|
observeElementOffset: _tanstack_virtual_core.observeElementOffset,
|
|
1102
1489
|
scrollToFn: _tanstack_virtual_core.elementScroll,
|
|
@@ -1104,7 +1491,7 @@ function DataTable(_props) {
|
|
|
1104
1491
|
overscan: 8,
|
|
1105
1492
|
getItemKey: virtualItemKey,
|
|
1106
1493
|
onChange: () => {
|
|
1107
|
-
|
|
1494
|
+
bumpWindowVer();
|
|
1108
1495
|
scheduleRemeasure();
|
|
1109
1496
|
}
|
|
1110
1497
|
};
|
|
@@ -1116,8 +1503,8 @@ function DataTable(_props) {
|
|
|
1116
1503
|
windowVer();
|
|
1117
1504
|
editVer();
|
|
1118
1505
|
if (!virtualizer) {
|
|
1119
|
-
if (!
|
|
1120
|
-
vi:
|
|
1506
|
+
if (!rowsWindowed()) return (rows() || []).map((r, i) => ({
|
|
1507
|
+
vi: { index: i },
|
|
1121
1508
|
row: r
|
|
1122
1509
|
}));
|
|
1123
1510
|
return [];
|
|
@@ -1153,7 +1540,7 @@ function DataTable(_props) {
|
|
|
1153
1540
|
function padTop() {
|
|
1154
1541
|
windowVer();
|
|
1155
1542
|
editVer();
|
|
1156
|
-
if (!
|
|
1543
|
+
if (!rowsWindowed() || !virtualizer) return 0;
|
|
1157
1544
|
const items = virtualizer.getVirtualItems();
|
|
1158
1545
|
let pad = items.length ? items[0].start : 0;
|
|
1159
1546
|
const pin = pinnedEditIndex();
|
|
@@ -1167,7 +1554,7 @@ function DataTable(_props) {
|
|
|
1167
1554
|
function padBottom() {
|
|
1168
1555
|
windowVer();
|
|
1169
1556
|
editVer();
|
|
1170
|
-
if (!
|
|
1557
|
+
if (!rowsWindowed() || !virtualizer) return 0;
|
|
1171
1558
|
const items = virtualizer.getVirtualItems();
|
|
1172
1559
|
if (!items.length) return 0;
|
|
1173
1560
|
let pad = virtualizer.getTotalSize() - items[items.length - 1].end;
|
|
@@ -1188,11 +1575,59 @@ function DataTable(_props) {
|
|
|
1188
1575
|
return false;
|
|
1189
1576
|
}
|
|
1190
1577
|
function rowIsOutsideWindow(r) {
|
|
1191
|
-
if (!
|
|
1578
|
+
if (!rowsWindowed() || !virtualizer) return false;
|
|
1192
1579
|
const items = virtualizer.getVirtualItems();
|
|
1193
1580
|
for (const it of items) if (it.index === r) return false;
|
|
1194
1581
|
return true;
|
|
1195
1582
|
}
|
|
1583
|
+
function windowedColIndices() {
|
|
1584
|
+
windowVer();
|
|
1585
|
+
editVer();
|
|
1586
|
+
if (!colsWindowed()) {
|
|
1587
|
+
const n = columnCount();
|
|
1588
|
+
const out = [];
|
|
1589
|
+
for (let i = 0; i < n; i++) out.push(i);
|
|
1590
|
+
return out;
|
|
1591
|
+
}
|
|
1592
|
+
if (!colVirtualizer) return [];
|
|
1593
|
+
const idx = colVirtualizer.getVirtualItems().map((it) => it.index);
|
|
1594
|
+
const forced = forcedColumns();
|
|
1595
|
+
for (let i = 0; i < forced.length; i++) if (idx.indexOf(forced[i]) === -1) idx.push(forced[i]);
|
|
1596
|
+
idx.sort((a, b) => a - b);
|
|
1597
|
+
return idx;
|
|
1598
|
+
}
|
|
1599
|
+
function colPadLeft() {
|
|
1600
|
+
windowVer();
|
|
1601
|
+
editVer();
|
|
1602
|
+
if (!colsWindowed() || !colVirtualizer) return 0;
|
|
1603
|
+
const items = colVirtualizer.getVirtualItems();
|
|
1604
|
+
let pad = items.length ? items[0].start : 0;
|
|
1605
|
+
if (items.length) {
|
|
1606
|
+
const firstIdx = items[0].index;
|
|
1607
|
+
const forced = forcedColumns();
|
|
1608
|
+
for (let i = 0; i < forced.length; i++) if (forced[i] < firstIdx) pad = pad - columnSize(forced[i]);
|
|
1609
|
+
}
|
|
1610
|
+
return pad < 0 ? 0 : pad;
|
|
1611
|
+
}
|
|
1612
|
+
function colPadRight() {
|
|
1613
|
+
windowVer();
|
|
1614
|
+
editVer();
|
|
1615
|
+
if (!colsWindowed() || !colVirtualizer) return 0;
|
|
1616
|
+
const items = colVirtualizer.getVirtualItems();
|
|
1617
|
+
if (!items.length) return 0;
|
|
1618
|
+
let pad = colVirtualizer.getTotalSize() - items[items.length - 1].end;
|
|
1619
|
+
const lastIdx = items[items.length - 1].index;
|
|
1620
|
+
const forced = forcedColumns();
|
|
1621
|
+
for (let i = 0; i < forced.length; i++) if (forced[i] > lastIdx) pad = pad - columnSize(forced[i]);
|
|
1622
|
+
return pad < 0 ? 0 : pad;
|
|
1623
|
+
}
|
|
1624
|
+
function colIsOutsideWindow(c) {
|
|
1625
|
+
if (!colsWindowed() || !colVirtualizer) return false;
|
|
1626
|
+
const items = colVirtualizer.getVirtualItems();
|
|
1627
|
+
for (const it of items) if (it.index === c) return false;
|
|
1628
|
+
return true;
|
|
1629
|
+
}
|
|
1630
|
+
let afterRowRemeasure = refineRowEstimate;
|
|
1196
1631
|
const announceState = {
|
|
1197
1632
|
sorting: null,
|
|
1198
1633
|
columnFilters: null,
|
|
@@ -1299,9 +1734,9 @@ function DataTable(_props) {
|
|
|
1299
1734
|
return "";
|
|
1300
1735
|
}
|
|
1301
1736
|
function defFor(colId) {
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
return null;
|
|
1737
|
+
if (colId == null) return null;
|
|
1738
|
+
const d = defIndex()[String(colId)];
|
|
1739
|
+
return d != null ? d : null;
|
|
1305
1740
|
}
|
|
1306
1741
|
function visibleCellsFor(row) {
|
|
1307
1742
|
return rowModelVer() >= 0 ? row.getVisibleCells() : [];
|
|
@@ -1494,6 +1929,9 @@ function DataTable(_props) {
|
|
|
1494
1929
|
function rowIsGrouped(row) {
|
|
1495
1930
|
return !!(tick() >= 0 && row && row.getIsGrouped && row.getIsGrouped());
|
|
1496
1931
|
}
|
|
1932
|
+
function rowIndexIsGrouped(rowIndex) {
|
|
1933
|
+
return rowIsGrouped((rows() || [])[rowIndex]);
|
|
1934
|
+
}
|
|
1497
1935
|
function groupingActive() {
|
|
1498
1936
|
return tick() >= 0 && (currentState().grouping || []).length > 0;
|
|
1499
1937
|
}
|
|
@@ -1507,21 +1945,54 @@ function DataTable(_props) {
|
|
|
1507
1945
|
return !!(tick() >= 0 && cellCtx && cellCtx.getIsPlaceholder && cellCtx.getIsPlaceholder());
|
|
1508
1946
|
}
|
|
1509
1947
|
function groupSubRowCount(row) {
|
|
1510
|
-
|
|
1948
|
+
if (row && row.getLeafRows) {
|
|
1949
|
+
const leaves = row.getLeafRows();
|
|
1950
|
+
let n = 0;
|
|
1951
|
+
for (let i = 0; i < leaves.length; i++) {
|
|
1952
|
+
const r = leaves[i];
|
|
1953
|
+
if (!(r && r.getIsGrouped && r.getIsGrouped())) n = n + 1;
|
|
1954
|
+
}
|
|
1955
|
+
return n;
|
|
1956
|
+
}
|
|
1957
|
+
return row && row.subRows ? row.subRows.length : 0;
|
|
1958
|
+
}
|
|
1959
|
+
let groupRowDescriptorCache = null;
|
|
1960
|
+
let groupRowDescriptorCacheVer = void 0;
|
|
1961
|
+
function groupRowDescriptor(row) {
|
|
1962
|
+
const ver = rowModelVer();
|
|
1963
|
+
if (!groupRowDescriptorCache || groupRowDescriptorCacheVer !== ver) {
|
|
1964
|
+
groupRowDescriptorCache = Object.create(null);
|
|
1965
|
+
groupRowDescriptorCacheVer = ver;
|
|
1966
|
+
}
|
|
1967
|
+
const key = String(row.id);
|
|
1968
|
+
let d = groupRowDescriptorCache[key];
|
|
1969
|
+
if (!d) {
|
|
1970
|
+
const groupingColumnId = row.groupingColumnId != null ? row.groupingColumnId : "";
|
|
1971
|
+
const groupingValue = row.getGroupingValue ? row.getGroupingValue(groupingColumnId) : row.groupingValue;
|
|
1972
|
+
d = {
|
|
1973
|
+
isGroupRow: true,
|
|
1974
|
+
groupId: row.id,
|
|
1975
|
+
groupingColumnId,
|
|
1976
|
+
groupingValue,
|
|
1977
|
+
leafCount: groupSubRowCount(row)
|
|
1978
|
+
};
|
|
1979
|
+
groupRowDescriptorCache[key] = d;
|
|
1980
|
+
}
|
|
1981
|
+
return d;
|
|
1982
|
+
}
|
|
1983
|
+
function cellSlotRow(row) {
|
|
1984
|
+
return rowIsGrouped(row) ? groupRowDescriptor(row) : row ? row.original : null;
|
|
1511
1985
|
}
|
|
1512
1986
|
function groupingKeys() {
|
|
1513
1987
|
return currentState().grouping || [];
|
|
1514
1988
|
}
|
|
1515
1989
|
function groupableColumns() {
|
|
1516
1990
|
const out = [];
|
|
1517
|
-
const defs = columnDefs();
|
|
1518
|
-
for (const d of defs) {
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
label: d.header != null ? d.header : d.id
|
|
1523
|
-
});
|
|
1524
|
-
}
|
|
1991
|
+
const defs = collectGroupableLeafDefs(columnDefs());
|
|
1992
|
+
for (const d of defs) out.push({
|
|
1993
|
+
id: d.id,
|
|
1994
|
+
label: d.header != null ? d.header : d.id
|
|
1995
|
+
});
|
|
1525
1996
|
return out;
|
|
1526
1997
|
}
|
|
1527
1998
|
function stopEvent(evt) {
|
|
@@ -1609,7 +2080,7 @@ function DataTable(_props) {
|
|
|
1609
2080
|
}
|
|
1610
2081
|
function getRowIndexRelativeToPage(absRow) {
|
|
1611
2082
|
const abs = absRow == null ? toAbsRow(activeRow()) : Math.trunc(Number(absRow)) || 0;
|
|
1612
|
-
if (
|
|
2083
|
+
if (rowsWindowed()) return abs;
|
|
1613
2084
|
return abs - pageRowOffset();
|
|
1614
2085
|
}
|
|
1615
2086
|
function cut() {
|
|
@@ -1634,14 +2105,14 @@ function DataTable(_props) {
|
|
|
1634
2105
|
return (hg && hg.headers ? hg.headers : []).indexOf(header);
|
|
1635
2106
|
}
|
|
1636
2107
|
function pageRowOffset() {
|
|
1637
|
-
if (!isGrid() ||
|
|
2108
|
+
if (!isGrid() || rowsWindowed()) return 0;
|
|
1638
2109
|
return pageIndex() * pageSize();
|
|
1639
2110
|
}
|
|
1640
2111
|
function toAbsRow(localRow) {
|
|
1641
2112
|
return localRow + pageRowOffset();
|
|
1642
2113
|
}
|
|
1643
2114
|
function prePaginationRowCount() {
|
|
1644
|
-
if (!table ||
|
|
2115
|
+
if (!table || rowsWindowed()) return bodyRowCount();
|
|
1645
2116
|
const pm = table.getPrePaginationRowModel();
|
|
1646
2117
|
return pm && pm.rows ? pm.rows.length : bodyRowCount();
|
|
1647
2118
|
}
|
|
@@ -1676,8 +2147,11 @@ function DataTable(_props) {
|
|
|
1676
2147
|
const c = nextCol == null ? activeColIndex() : nextCol;
|
|
1677
2148
|
const lvl = nextLevel == null ? activeHeaderLevel() : nextLevel;
|
|
1678
2149
|
const header = nextIsHeader == null ? activeIsHeader() : nextIsHeader;
|
|
1679
|
-
|
|
1680
|
-
|
|
2150
|
+
const rowOut = rowsWindowed() && virtualizer && rowIsOutsideWindow(r);
|
|
2151
|
+
const colOut = colsWindowed() && colVirtualizer && colIsOutsideWindow(c);
|
|
2152
|
+
if (!header && (rowOut || colOut)) {
|
|
2153
|
+
if (rowOut) virtualizer.scrollToIndex(r, { align: "center" });
|
|
2154
|
+
if (colOut) colVirtualizer.scrollToIndex(c, { align: "center" });
|
|
1681
2155
|
let focusAttempts = 0;
|
|
1682
2156
|
const myEpoch = focusIntentEpoch;
|
|
1683
2157
|
const focusWhenReady = () => {
|
|
@@ -1725,9 +2199,6 @@ function DataTable(_props) {
|
|
|
1725
2199
|
function bodyRowCount() {
|
|
1726
2200
|
return (rows() || []).length;
|
|
1727
2201
|
}
|
|
1728
|
-
function clamp(v, lo, hi) {
|
|
1729
|
-
return v < lo ? lo : v > hi ? hi : v;
|
|
1730
|
-
}
|
|
1731
2202
|
function headerLeafLevel() {
|
|
1732
2203
|
const hg = headerGroups() || [];
|
|
1733
2204
|
return hg.length ? hg.length - 1 : 0;
|
|
@@ -1890,10 +2361,6 @@ function DataTable(_props) {
|
|
|
1890
2361
|
function currentCellEl() {
|
|
1891
2362
|
return resolveCellEl(activeIsHeader() ? "__header" : String(activeRow()), activeColIndex(), activeIsHeader() ? activeHeaderLevel() : null);
|
|
1892
2363
|
}
|
|
1893
|
-
function focusables(cellEl) {
|
|
1894
|
-
if (!cellEl || !cellEl.querySelectorAll) return [];
|
|
1895
|
-
return Array.prototype.slice.call(cellEl.querySelectorAll("button,[href],input,select,textarea,[tabindex]:not([tabindex=\"-1\"])")).filter((n) => !n.disabled);
|
|
1896
|
-
}
|
|
1897
2364
|
function enterControl() {
|
|
1898
2365
|
const list = focusables(currentCellEl());
|
|
1899
2366
|
if (!list.length) return;
|
|
@@ -2296,6 +2763,40 @@ function DataTable(_props) {
|
|
|
2296
2763
|
recoverGridFocus(String(recRow), recCol, null);
|
|
2297
2764
|
}
|
|
2298
2765
|
}
|
|
2766
|
+
function windowedHeadersFor(hg, hgLevel) {
|
|
2767
|
+
const headers = hg && hg.headers || [];
|
|
2768
|
+
if (!colsWindowed()) return headers.map((h) => ({
|
|
2769
|
+
header: h,
|
|
2770
|
+
span: h && h.colSpan > 1 ? h.colSpan : 1
|
|
2771
|
+
}));
|
|
2772
|
+
const idx = windowedColIndices();
|
|
2773
|
+
const idxSet = {};
|
|
2774
|
+
for (let i = 0; i < idx.length; i++) idxSet[idx[i]] = true;
|
|
2775
|
+
let cursor = 0;
|
|
2776
|
+
const out = [];
|
|
2777
|
+
for (let i = 0; i < headers.length; i++) {
|
|
2778
|
+
const h = headers[i];
|
|
2779
|
+
const leafCount = h && h.colSpan ? h.colSpan : 1;
|
|
2780
|
+
const start = cursor;
|
|
2781
|
+
const end = cursor + leafCount;
|
|
2782
|
+
cursor = end;
|
|
2783
|
+
let span = 0;
|
|
2784
|
+
for (let c = start; c < end; c++) if (idxSet[c]) span = span + 1;
|
|
2785
|
+
if (span > 0) out.push({
|
|
2786
|
+
header: h,
|
|
2787
|
+
span
|
|
2788
|
+
});
|
|
2789
|
+
}
|
|
2790
|
+
return out;
|
|
2791
|
+
}
|
|
2792
|
+
function windowedColSpan() {
|
|
2793
|
+
return colsWindowed() ? windowedColIndices().length + 2 : visibleColCount();
|
|
2794
|
+
}
|
|
2795
|
+
function remeasureColumnWindow() {
|
|
2796
|
+
if (!colsWindowed() || !colVirtualizer) return;
|
|
2797
|
+
colVirtualizer.setOptions(columnVirtualizerOptions());
|
|
2798
|
+
colVirtualizer._willUpdate();
|
|
2799
|
+
}
|
|
2299
2800
|
let gridEmptyFallback = false;
|
|
2300
2801
|
let rangeTransition = false;
|
|
2301
2802
|
let rangeClickPending = false;
|
|
@@ -2478,10 +2979,6 @@ function DataTable(_props) {
|
|
|
2478
2979
|
c1: ac > fc ? ac : fc
|
|
2479
2980
|
};
|
|
2480
2981
|
}
|
|
2481
|
-
function escapeTsvField(s) {
|
|
2482
|
-
if (s.indexOf(" ") >= 0 || s.indexOf("\n") >= 0 || s.indexOf("\r") >= 0 || s.indexOf("\"") >= 0) return "\"" + s.replace(/"/g, "\"\"") + "\"";
|
|
2483
|
-
return s;
|
|
2484
|
-
}
|
|
2485
2982
|
function rangeToTsv() {
|
|
2486
2983
|
const box = normalizedRange();
|
|
2487
2984
|
const r0 = box ? box.r0 : activeRow();
|
|
@@ -2499,71 +2996,6 @@ function DataTable(_props) {
|
|
|
2499
2996
|
}
|
|
2500
2997
|
return lines.join("\n");
|
|
2501
2998
|
}
|
|
2502
|
-
function parseTsv(text) {
|
|
2503
|
-
const str = text != null ? String(text) : "";
|
|
2504
|
-
if (str === "" || str.length > 2e6) return [];
|
|
2505
|
-
const rows = [];
|
|
2506
|
-
let row = [];
|
|
2507
|
-
let field = "";
|
|
2508
|
-
let inQuotes = false;
|
|
2509
|
-
let i = 0;
|
|
2510
|
-
const n = str.length;
|
|
2511
|
-
while (i < n) {
|
|
2512
|
-
const ch = str[i];
|
|
2513
|
-
if (inQuotes) {
|
|
2514
|
-
if (ch === "\"") {
|
|
2515
|
-
if (i + 1 < n && str[i + 1] === "\"") {
|
|
2516
|
-
field = field + "\"";
|
|
2517
|
-
i = i + 2;
|
|
2518
|
-
continue;
|
|
2519
|
-
}
|
|
2520
|
-
inQuotes = false;
|
|
2521
|
-
i = i + 1;
|
|
2522
|
-
continue;
|
|
2523
|
-
}
|
|
2524
|
-
field = field + ch;
|
|
2525
|
-
i = i + 1;
|
|
2526
|
-
continue;
|
|
2527
|
-
}
|
|
2528
|
-
if (ch === "\"" && field === "") {
|
|
2529
|
-
inQuotes = true;
|
|
2530
|
-
i = i + 1;
|
|
2531
|
-
continue;
|
|
2532
|
-
}
|
|
2533
|
-
if (ch === " ") {
|
|
2534
|
-
row.push(field);
|
|
2535
|
-
field = "";
|
|
2536
|
-
i = i + 1;
|
|
2537
|
-
continue;
|
|
2538
|
-
}
|
|
2539
|
-
if (ch === "\r") {
|
|
2540
|
-
if (i + 1 < n && str[i + 1] === "\n") i = i + 1;
|
|
2541
|
-
row.push(field);
|
|
2542
|
-
field = "";
|
|
2543
|
-
rows.push(row);
|
|
2544
|
-
row = [];
|
|
2545
|
-
i = i + 1;
|
|
2546
|
-
continue;
|
|
2547
|
-
}
|
|
2548
|
-
if (ch === "\n") {
|
|
2549
|
-
row.push(field);
|
|
2550
|
-
field = "";
|
|
2551
|
-
rows.push(row);
|
|
2552
|
-
row = [];
|
|
2553
|
-
i = i + 1;
|
|
2554
|
-
continue;
|
|
2555
|
-
}
|
|
2556
|
-
field = field + ch;
|
|
2557
|
-
i = i + 1;
|
|
2558
|
-
}
|
|
2559
|
-
row.push(field);
|
|
2560
|
-
rows.push(row);
|
|
2561
|
-
if (rows.length > 1) {
|
|
2562
|
-
const last = rows[rows.length - 1];
|
|
2563
|
-
if (last.length === 1 && last[0] === "") rows.pop();
|
|
2564
|
-
}
|
|
2565
|
-
return rows;
|
|
2566
|
-
}
|
|
2567
2999
|
function copyRange() {
|
|
2568
3000
|
if (!clipboardActiveAllowed()) return;
|
|
2569
3001
|
if (typeof navigator === "undefined" || !navigator.clipboard || !navigator.clipboard.writeText) return;
|
|
@@ -2586,11 +3018,13 @@ function DataTable(_props) {
|
|
|
2586
3018
|
for (let gr = 0; gr < grid.length; gr++) {
|
|
2587
3019
|
const r = originRow + gr;
|
|
2588
3020
|
if (r > maxRow) break;
|
|
3021
|
+
const rowGrouped = rowIndexIsGrouped(r);
|
|
2589
3022
|
const cols = grid[gr] || [];
|
|
2590
3023
|
for (let gc = 0; gc < cols.length; gc++) {
|
|
2591
3024
|
const c = originCol + gc;
|
|
2592
3025
|
if (c > maxCol) break;
|
|
2593
3026
|
total = total + 1;
|
|
3027
|
+
if (rowGrouped) continue;
|
|
2594
3028
|
const colId = columnIdAt(r, c);
|
|
2595
3029
|
if (colId == null || !columnEditable(colId)) continue;
|
|
2596
3030
|
const rowObj = rowOriginalAt(r);
|
|
@@ -2630,30 +3064,6 @@ function DataTable(_props) {
|
|
|
2630
3064
|
const row = (rows() || [])[rowIndex];
|
|
2631
3065
|
return row ? row.id : null;
|
|
2632
3066
|
}
|
|
2633
|
-
function tileGridToBox(grid, box) {
|
|
2634
|
-
const srcRows = grid.length;
|
|
2635
|
-
let srcCols = 0;
|
|
2636
|
-
for (let i = 0; i < srcRows; i++) {
|
|
2637
|
-
const w = grid[i] && grid[i].length ? grid[i].length : 0;
|
|
2638
|
-
if (w > srcCols) srcCols = w;
|
|
2639
|
-
}
|
|
2640
|
-
if (srcRows <= 0 || srcCols <= 0) return grid;
|
|
2641
|
-
const boxRows = box.r1 - box.r0 + 1;
|
|
2642
|
-
const boxCols = box.c1 - box.c0 + 1;
|
|
2643
|
-
const rows = boxRows > srcRows ? boxRows : srcRows;
|
|
2644
|
-
const cols = boxCols > srcCols ? boxCols : srcCols;
|
|
2645
|
-
const out = [];
|
|
2646
|
-
for (let r = 0; r < rows; r++) {
|
|
2647
|
-
const srcLine = grid[r % srcRows] || [];
|
|
2648
|
-
const line = [];
|
|
2649
|
-
for (let c = 0; c < cols; c++) {
|
|
2650
|
-
const v = srcLine[c % srcCols];
|
|
2651
|
-
line.push(v != null ? v : "");
|
|
2652
|
-
}
|
|
2653
|
-
out.push(line);
|
|
2654
|
-
}
|
|
2655
|
-
return out;
|
|
2656
|
-
}
|
|
2657
3067
|
function pasteRange() {
|
|
2658
3068
|
if (!clipboardActiveAllowed()) return;
|
|
2659
3069
|
if (typeof navigator === "undefined" || !navigator.clipboard || !navigator.clipboard.readText) return;
|
|
@@ -2713,13 +3123,6 @@ function DataTable(_props) {
|
|
|
2713
3123
|
}
|
|
2714
3124
|
applyGridToRange(grid, r0, c0);
|
|
2715
3125
|
}
|
|
2716
|
-
function tileIndex(i, lo, hi) {
|
|
2717
|
-
const span = hi - lo + 1;
|
|
2718
|
-
if (span <= 1) return lo;
|
|
2719
|
-
let k = (i - lo) % span;
|
|
2720
|
-
if (k < 0) k = k + span;
|
|
2721
|
-
return lo + k;
|
|
2722
|
-
}
|
|
2723
3126
|
function fillRange(sourceBox, endCell) {
|
|
2724
3127
|
let box;
|
|
2725
3128
|
if (sourceBox && sourceBox.r0 != null && endCell) {
|
|
@@ -2759,6 +3162,30 @@ function DataTable(_props) {
|
|
|
2759
3162
|
let fillDragging = false;
|
|
2760
3163
|
let fillDragMove = null;
|
|
2761
3164
|
let fillDragUp = null;
|
|
3165
|
+
let fillEdgeScrollRaf = null;
|
|
3166
|
+
const FILL_EDGE_SCROLL_PX = 24;
|
|
3167
|
+
const FILL_EDGE_SCROLL_STEP = 16;
|
|
3168
|
+
function edgeDelta(clientX, clientY) {
|
|
3169
|
+
if (!gridScrollEl) return {
|
|
3170
|
+
dx: 0,
|
|
3171
|
+
dy: 0
|
|
3172
|
+
};
|
|
3173
|
+
const rect = gridScrollEl.getBoundingClientRect();
|
|
3174
|
+
let dx = 0;
|
|
3175
|
+
let dy = 0;
|
|
3176
|
+
if (colsWindowed()) {
|
|
3177
|
+
if (clientX - rect.left < FILL_EDGE_SCROLL_PX) dx = -FILL_EDGE_SCROLL_STEP;
|
|
3178
|
+
else if (rect.right - clientX < FILL_EDGE_SCROLL_PX) dx = FILL_EDGE_SCROLL_STEP;
|
|
3179
|
+
}
|
|
3180
|
+
if (rowsWindowed()) {
|
|
3181
|
+
if (clientY - rect.top < FILL_EDGE_SCROLL_PX) dy = -FILL_EDGE_SCROLL_STEP;
|
|
3182
|
+
else if (rect.bottom - clientY < FILL_EDGE_SCROLL_PX) dy = FILL_EDGE_SCROLL_STEP;
|
|
3183
|
+
}
|
|
3184
|
+
return {
|
|
3185
|
+
dx,
|
|
3186
|
+
dy
|
|
3187
|
+
};
|
|
3188
|
+
}
|
|
2762
3189
|
function teardownFillDrag() {
|
|
2763
3190
|
if (typeof document !== "undefined") {
|
|
2764
3191
|
if (fillDragMove) document.removeEventListener("pointermove", fillDragMove);
|
|
@@ -2767,6 +3194,10 @@ function DataTable(_props) {
|
|
|
2767
3194
|
fillDragMove = null;
|
|
2768
3195
|
fillDragUp = null;
|
|
2769
3196
|
fillDragging = false;
|
|
3197
|
+
if (fillEdgeScrollRaf != null) {
|
|
3198
|
+
if (typeof cancelAnimationFrame === "function") cancelAnimationFrame(fillEdgeScrollRaf);
|
|
3199
|
+
fillEdgeScrollRaf = null;
|
|
3200
|
+
}
|
|
2770
3201
|
}
|
|
2771
3202
|
function cellIndexFromPoint(clientX, clientY) {
|
|
2772
3203
|
if (typeof document === "undefined" || !document.elementFromPoint) return null;
|
|
@@ -2801,14 +3232,42 @@ function DataTable(_props) {
|
|
|
2801
3232
|
r: sourceBox.r1,
|
|
2802
3233
|
c: sourceBox.c1
|
|
2803
3234
|
} : null;
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
3235
|
+
let lastClientX = 0;
|
|
3236
|
+
let lastClientY = 0;
|
|
3237
|
+
const applyPointAt = (clientX, clientY) => {
|
|
3238
|
+
const cell = cellIndexFromPoint(clientX, clientY);
|
|
2807
3239
|
if (cell && (!lastCell || cell.r !== lastCell.r || cell.c !== lastCell.c)) {
|
|
2808
3240
|
lastCell = cell;
|
|
2809
3241
|
setRangeFocus$local(cell.r, cell.c);
|
|
2810
3242
|
}
|
|
2811
3243
|
};
|
|
3244
|
+
const scrollStep = () => {
|
|
3245
|
+
if (!fillDragging) {
|
|
3246
|
+
fillEdgeScrollRaf = null;
|
|
3247
|
+
return;
|
|
3248
|
+
}
|
|
3249
|
+
const d = edgeDelta(lastClientX, lastClientY);
|
|
3250
|
+
if (d.dx === 0 && d.dy === 0) {
|
|
3251
|
+
fillEdgeScrollRaf = null;
|
|
3252
|
+
return;
|
|
3253
|
+
}
|
|
3254
|
+
if (gridScrollEl) {
|
|
3255
|
+
if (d.dx !== 0) gridScrollEl.scrollLeft = gridScrollEl.scrollLeft + d.dx;
|
|
3256
|
+
if (d.dy !== 0) gridScrollEl.scrollTop = gridScrollEl.scrollTop + d.dy;
|
|
3257
|
+
}
|
|
3258
|
+
applyPointAt(lastClientX, lastClientY);
|
|
3259
|
+
fillEdgeScrollRaf = requestAnimationFrame(scrollStep);
|
|
3260
|
+
};
|
|
3261
|
+
const move = (ev) => {
|
|
3262
|
+
if (!fillDragging) return;
|
|
3263
|
+
lastClientX = ev.clientX;
|
|
3264
|
+
lastClientY = ev.clientY;
|
|
3265
|
+
applyPointAt(ev.clientX, ev.clientY);
|
|
3266
|
+
if (fillEdgeScrollRaf == null && typeof requestAnimationFrame === "function") {
|
|
3267
|
+
const d = edgeDelta(ev.clientX, ev.clientY);
|
|
3268
|
+
if (d.dx !== 0 || d.dy !== 0) fillEdgeScrollRaf = requestAnimationFrame(scrollStep);
|
|
3269
|
+
}
|
|
3270
|
+
};
|
|
2812
3271
|
const up = () => {
|
|
2813
3272
|
teardownFillDrag();
|
|
2814
3273
|
if (lastCell && sourceBox && (lastCell.r !== sourceBox.r1 || lastCell.c !== sourceBox.c1)) fillRange(sourceBox, lastCell);
|
|
@@ -2868,11 +3327,13 @@ function DataTable(_props) {
|
|
|
2868
3327
|
return cell && cell.column ? cell.column.id : null;
|
|
2869
3328
|
}
|
|
2870
3329
|
function isActiveCellEditable() {
|
|
3330
|
+
if (rowIndexIsGrouped(activeRow())) return false;
|
|
2871
3331
|
const colId = activeCellColumnId();
|
|
2872
3332
|
return colId != null && columnEditable(colId);
|
|
2873
3333
|
}
|
|
2874
3334
|
function isEditing(rowIndex, colIndex) {
|
|
2875
3335
|
if (editVer() < 0) return false;
|
|
3336
|
+
if (rowIndexIsGrouped(rowIndex)) return false;
|
|
2876
3337
|
if (editingRowIndex() != null && editingRowIndex() === rowIndex) {
|
|
2877
3338
|
const colId = columnIdAt(rowIndex, colIndex);
|
|
2878
3339
|
return colId != null && columnEditable(colId);
|
|
@@ -2899,16 +3360,6 @@ function DataTable(_props) {
|
|
|
2899
3360
|
function setInvalid(msg) {
|
|
2900
3361
|
setInvalidMsg(msg != null ? msg : "");
|
|
2901
3362
|
}
|
|
2902
|
-
function replaceRowValue(rows, rowIndex, field, value) {
|
|
2903
|
-
const src = rows || [];
|
|
2904
|
-
const out = [];
|
|
2905
|
-
for (let i = 0; i < src.length; i++) if (i === rowIndex) out.push({
|
|
2906
|
-
...src[i] || {},
|
|
2907
|
-
[field]: value
|
|
2908
|
-
});
|
|
2909
|
-
else out.push(src[i]);
|
|
2910
|
-
return out;
|
|
2911
|
-
}
|
|
2912
3363
|
function sourceIndexOfRow(visibleRowIndex) {
|
|
2913
3364
|
const row = (rows() || [])[visibleRowIndex];
|
|
2914
3365
|
if (!row) return visibleRowIndex;
|
|
@@ -2984,6 +3435,7 @@ function DataTable(_props) {
|
|
|
2984
3435
|
return cell ? cell.getValue() : null;
|
|
2985
3436
|
}
|
|
2986
3437
|
function beginEdit(rowIndex, colIndex, seed) {
|
|
3438
|
+
if (rowIndexIsGrouped(rowIndex)) return;
|
|
2987
3439
|
const colId = columnIdAt(rowIndex, colIndex);
|
|
2988
3440
|
if (colId == null || !columnEditable(colId)) return;
|
|
2989
3441
|
committedThisSession = false;
|
|
@@ -3015,16 +3467,6 @@ function DataTable(_props) {
|
|
|
3015
3467
|
if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
|
|
3016
3468
|
else setTimeout(tryFocus, 0);
|
|
3017
3469
|
}
|
|
3018
|
-
function indexOfRowIn(rows, rowOriginal, rowId) {
|
|
3019
|
-
const list = rows || [];
|
|
3020
|
-
for (let i = 0; i < list.length; i++) {
|
|
3021
|
-
const r = list[i];
|
|
3022
|
-
if (!r) continue;
|
|
3023
|
-
if (rowId != null && r.id === rowId) return i;
|
|
3024
|
-
if (rowOriginal != null && r.original === rowOriginal) return i;
|
|
3025
|
-
}
|
|
3026
|
-
return -1;
|
|
3027
|
-
}
|
|
3028
3470
|
function endEdit() {
|
|
3029
3471
|
setEditingRow(-1);
|
|
3030
3472
|
setEditingCol(-1);
|
|
@@ -3105,6 +3547,7 @@ function DataTable(_props) {
|
|
|
3105
3547
|
return true;
|
|
3106
3548
|
}
|
|
3107
3549
|
function toggleActiveBooleanCell() {
|
|
3550
|
+
if (rowIndexIsGrouped(activeRow())) return;
|
|
3108
3551
|
const colId = columnIdAt(activeRow(), activeColIndex());
|
|
3109
3552
|
if (colId == null || !columnEditable(colId)) return;
|
|
3110
3553
|
const row = (rows() || [])[activeRow()];
|
|
@@ -3190,6 +3633,7 @@ function DataTable(_props) {
|
|
|
3190
3633
|
function beginRowEdit(row) {
|
|
3191
3634
|
const rowIndex = rowIndexOf(row);
|
|
3192
3635
|
if (rowIndex < 0) return;
|
|
3636
|
+
if (rowIndexIsGrouped(rowIndex)) return;
|
|
3193
3637
|
const editable = editableColumnsForRow(rowIndex);
|
|
3194
3638
|
if (editable.length === 0) return;
|
|
3195
3639
|
committedThisSession = false;
|
|
@@ -3279,17 +3723,6 @@ function DataTable(_props) {
|
|
|
3279
3723
|
editTransition = false;
|
|
3280
3724
|
focusCellWhenReady(focusRow, focusCol);
|
|
3281
3725
|
}
|
|
3282
|
-
function replaceRowValues(rows, rowIndex, fieldValues) {
|
|
3283
|
-
const src = rows || [];
|
|
3284
|
-
const fv = fieldValues || {};
|
|
3285
|
-
const out = [];
|
|
3286
|
-
for (let i = 0; i < src.length; i++) if (i === rowIndex) out.push({
|
|
3287
|
-
...src[i] || {},
|
|
3288
|
-
...fv
|
|
3289
|
-
});
|
|
3290
|
-
else out.push(src[i]);
|
|
3291
|
-
return out;
|
|
3292
|
-
}
|
|
3293
3726
|
function nextEditableCell(fromRow, fromCol) {
|
|
3294
3727
|
const rowList = rows() || [];
|
|
3295
3728
|
const rowCount = rowList.length;
|
|
@@ -3540,8 +3973,9 @@ function DataTable(_props) {
|
|
|
3540
3973
|
const absLast = prePaginationRowCount() - 1;
|
|
3541
3974
|
const absRow = clamp(Math.trunc(Number(rowIndex)) || 0, 0, absLast < 0 ? 0 : absLast);
|
|
3542
3975
|
const prevAbs = toAbsRow(activeRow());
|
|
3976
|
+
const prevCol = activeColIndex();
|
|
3543
3977
|
const prevIsHeader = activeIsHeader();
|
|
3544
|
-
if (
|
|
3978
|
+
if (rowsWindowed()) {
|
|
3545
3979
|
setActiveIsHeader(false);
|
|
3546
3980
|
setActiveInControl(false);
|
|
3547
3981
|
setActiveRow(absRow);
|
|
@@ -3560,7 +3994,7 @@ function DataTable(_props) {
|
|
|
3560
3994
|
if (switched) focusAbsCellWhenReady(absRow, localRow, c);
|
|
3561
3995
|
else focusActiveCell(localRow, c, false);
|
|
3562
3996
|
}
|
|
3563
|
-
if (absRow !== prevAbs || prevIsHeader) _props.onActivecellChange?.({
|
|
3997
|
+
if (absRow !== prevAbs || c !== prevCol || prevIsHeader) _props.onActivecellChange?.({
|
|
3564
3998
|
rowIndex: absRow,
|
|
3565
3999
|
colIndex: c
|
|
3566
4000
|
});
|
|
@@ -3676,7 +4110,7 @@ function DataTable(_props) {
|
|
|
3676
4110
|
applyGrouping,
|
|
3677
4111
|
clearGrouping
|
|
3678
4112
|
}) ?? <_solid_primitives_keyed.Key each={groupingKeys()} by={(gk) => gk}>{(gk) => <span class={"rdt-group-token"} data-group-token="" data-rozie-s-d5dcab4c="">{(0, _rozie_runtime_solid.rozieDisplay)(gk())}</span>}</_solid_primitives_keyed.Key>}
|
|
3679
|
-
</div></Solid_js.Show>}{<Solid_js.Show when={
|
|
4113
|
+
</div></Solid_js.Show>}{<Solid_js.Show when={isWindowed()} fallback={<table aria-rowcount={(0, _rozie_runtime_solid.rozieAttr)(gridAriaRowCount())} class={"rozie-data-table " + (0, _rozie_runtime_solid.rozieClass)({ "rdt-sticky": local.stickyHeader })} role={(0, _rozie_runtime_solid.rozieAttr)(tableRole())} onKeyDown={($event) => {
|
|
3680
4114
|
onGridKeyDown($event);
|
|
3681
4115
|
}} onFocusIn={($event) => {
|
|
3682
4116
|
syncActiveFromEvent($event);
|
|
@@ -3788,7 +4222,7 @@ function DataTable(_props) {
|
|
|
3788
4222
|
{(_props.cellSlot ?? _props.slots?.["cell"])?.({
|
|
3789
4223
|
columnId: cell().column.id,
|
|
3790
4224
|
column: cell().column,
|
|
3791
|
-
row: row()
|
|
4225
|
+
row: cellSlotRow(row()),
|
|
3792
4226
|
value: cell().getValue()
|
|
3793
4227
|
}) ?? (0, _rozie_runtime_solid.rozieDisplay)(cell().getValue())}
|
|
3794
4228
|
</span>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
@@ -3822,7 +4256,7 @@ function DataTable(_props) {
|
|
|
3822
4256
|
{(_props.editorSlot ?? _props.slots?.["editor"])?.({
|
|
3823
4257
|
columnId: cell().column.id,
|
|
3824
4258
|
column: cell().column,
|
|
3825
|
-
row: row()
|
|
4259
|
+
row: cellSlotRow(row()),
|
|
3826
4260
|
value: editorValueFor(cell().column.id),
|
|
3827
4261
|
commit: editorCommitFor(cell().column.id),
|
|
3828
4262
|
cancel: editorCancelFor(),
|
|
@@ -3836,14 +4270,14 @@ function DataTable(_props) {
|
|
|
3836
4270
|
{(_props.cellSlot ?? _props.slots?.["cell"])?.({
|
|
3837
4271
|
columnId: cell().column.id,
|
|
3838
4272
|
column: cell().column,
|
|
3839
|
-
row: row()
|
|
4273
|
+
row: cellSlotRow(row()),
|
|
3840
4274
|
value: cell().getValue()
|
|
3841
4275
|
}) ?? (0, _rozie_runtime_solid.rozieDisplay)(cell().getValue())}
|
|
3842
4276
|
</span>
|
|
3843
4277
|
<span class={"rdt-group-count"} data-rozie-s-d5dcab4c="">{(0, _rozie_runtime_solid.rozieDisplay)("(" + groupSubRowCount(row()) + ")")}</span>
|
|
3844
4278
|
</span></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
3845
4279
|
{(_props.selectCellSlot ?? _props.slots?.["selectCell"])?.({
|
|
3846
|
-
row: row()
|
|
4280
|
+
row: cellSlotRow(row()),
|
|
3847
4281
|
checked: rowIsSelected(row()),
|
|
3848
4282
|
toggle: (e) => onToggleRow(row(), e)
|
|
3849
4283
|
}) ?? <input type="checkbox" aria-label="Select row" class={"rdt-select-row"} checked={rowIsSelected(row())} onChange={($event) => {
|
|
@@ -3863,8 +4297,11 @@ function DataTable(_props) {
|
|
|
3863
4297
|
</td>
|
|
3864
4298
|
</tr></Solid_js.Show>}</>}</_solid_primitives_keyed.Key>
|
|
3865
4299
|
</tbody>
|
|
3866
|
-
</table>}><div class={"rdt-scroll"} style={(0, _rozie_runtime_solid.parseInlineStyle)(local.maxHeight ? "max-height:" + local.maxHeight + ";overflow:auto;--rozie-data-table-max-height:" + local.maxHeight : "overflow:auto")} data-rozie-s-d5dcab4c="">
|
|
3867
|
-
<table aria-rowcount={(0, _rozie_runtime_solid.rozieAttr)(gridAriaRowCount())} class={"rozie-data-table " + (0, _rozie_runtime_solid.rozieClass)({
|
|
4300
|
+
</table>}><div class={"rdt-scroll"} style={(0, _rozie_runtime_solid.parseInlineStyle)(rowsWindowed() && local.maxHeight ? "max-height:" + local.maxHeight + ";overflow:auto;--rozie-data-table-max-height:" + local.maxHeight : "overflow:auto")} data-rozie-s-d5dcab4c="">
|
|
4301
|
+
<table aria-rowcount={(0, _rozie_runtime_solid.rozieAttr)(gridAriaRowCount())} class={"rozie-data-table " + (0, _rozie_runtime_solid.rozieClass)({
|
|
4302
|
+
"rdt-sticky": local.stickyHeader,
|
|
4303
|
+
"rdt-col-windowed": colsWindowed()
|
|
4304
|
+
})} role={(0, _rozie_runtime_solid.rozieAttr)(tableRole())} onKeyDown={($event) => {
|
|
3868
4305
|
onGridKeyDown($event);
|
|
3869
4306
|
}} onFocusIn={($event) => {
|
|
3870
4307
|
syncActiveFromEvent($event);
|
|
@@ -3879,53 +4316,54 @@ function DataTable(_props) {
|
|
|
3879
4316
|
}} data-rozie-s-d5dcab4c="">
|
|
3880
4317
|
<thead class={"rdt-thead"} role="rowgroup" data-rozie-s-d5dcab4c="">
|
|
3881
4318
|
<_solid_primitives_keyed.Key each={headerGroups()} by={(hg) => hg.id}>{(hg, hgLevel) => <tr class={"rdt-tr"} role="row" aria-rowindex={(0, _rozie_runtime_solid.rozieAttr)(hgLevel() + 1)} data-rozie-s-d5dcab4c="">
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
"rdt-
|
|
3885
|
-
"rdt-th
|
|
3886
|
-
"rdt-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
4319
|
+
|
|
4320
|
+
{<Solid_js.Show when={colsWindowed()}><th class={"rdt-col-spacer"} aria-hidden="true" style={(0, _rozie_runtime_solid.parseInlineStyle)("width:" + colPadLeft() + "px;padding:0;border:0")} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}<_solid_primitives_keyed.Key each={windowedHeadersFor(hg(), hgLevel())} by={(wh) => wh.header.id}>{(wh) => <th class={"rdt-th " + (0, _rozie_runtime_solid.rozieClass)({
|
|
4321
|
+
"rdt-select-th": isSelectColumn(wh().header.column.id),
|
|
4322
|
+
"rdt-expander-th": isExpanderColumn(wh().header.column.id),
|
|
4323
|
+
"rdt-th-resizing": columnIsResizing(wh().header.column.id),
|
|
4324
|
+
"rdt-cell-active": isActiveCell("__header", headerColIndexOf(hg(), wh().header), hgLevel())
|
|
4325
|
+
})} role="columnheader" data-col={(0, _rozie_runtime_solid.rozieAttr)(wh().header.column.id)} data-grid-cell="" data-row="__header" data-header-level={(0, _rozie_runtime_solid.rozieAttr)(hgLevel())} colSpan={(0, _rozie_runtime_solid.rozieAttr)(wh().span > 1 ? wh().span : null)} data-col-index={(0, _rozie_runtime_solid.rozieAttr)(headerColIndexOf(hg(), wh().header))} tabIndex={(0, _rozie_runtime_solid.rozieAttr)(cellTabindex("__header", headerColIndexOf(hg(), wh().header), hgLevel()))} aria-sort={(0, _rozie_runtime_solid.rozieAttr)(ariaSortFor(wh().header.column.id))} style={(0, _rozie_runtime_solid.parseInlineStyle)(thStyle(wh().header.column.id))} data-rozie-s-d5dcab4c="">
|
|
4326
|
+
{<Solid_js.Show when={isSelectColumn(wh().header.column.id)} fallback={<Solid_js.Show when={isExpanderColumn(wh().header.column.id)} fallback={<span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4327
|
+
{<Solid_js.Show when={wh().header.column.getCanSort && wh().header.column.getCanSort()} fallback={<span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
3890
4328
|
<span class={"rdt-header-label"} data-rozie-s-d5dcab4c="">
|
|
3891
4329
|
{(_props.colHeaderSlot ?? _props.slots?.["colHeader"])?.({
|
|
3892
|
-
columnId:
|
|
3893
|
-
column:
|
|
3894
|
-
label: headerLabel(
|
|
3895
|
-
}) ?? (0, _rozie_runtime_solid.rozieDisplay)(headerLabel(
|
|
4330
|
+
columnId: wh().header.column.id,
|
|
4331
|
+
column: wh().header.column,
|
|
4332
|
+
label: headerLabel(wh().header.column.id)
|
|
4333
|
+
}) ?? (0, _rozie_runtime_solid.rozieDisplay)(headerLabel(wh().header.column.id))}
|
|
3896
4334
|
</span>
|
|
3897
4335
|
</span>}><button type="button" class={"rdt-sort-btn"} onClick={($event) => {
|
|
3898
|
-
onHeaderSort(
|
|
4336
|
+
onHeaderSort(wh().header.column.id, $event);
|
|
3899
4337
|
}} data-rozie-s-d5dcab4c="">
|
|
3900
4338
|
<span class={"rdt-header-label"} data-rozie-s-d5dcab4c="">
|
|
3901
4339
|
{(_props.colHeaderSlot ?? _props.slots?.["colHeader"])?.({
|
|
3902
|
-
columnId:
|
|
3903
|
-
column:
|
|
3904
|
-
label: headerLabel(
|
|
3905
|
-
}) ?? (0, _rozie_runtime_solid.rozieDisplay)(headerLabel(
|
|
4340
|
+
columnId: wh().header.column.id,
|
|
4341
|
+
column: wh().header.column,
|
|
4342
|
+
label: headerLabel(wh().header.column.id)
|
|
4343
|
+
}) ?? (0, _rozie_runtime_solid.rozieDisplay)(headerLabel(wh().header.column.id))}
|
|
3906
4344
|
</span>
|
|
3907
|
-
<span class={"rdt-sort-ind"} aria-hidden="true" data-rozie-s-d5dcab4c="">{(0, _rozie_runtime_solid.rozieDisplay)(sortIndicator(
|
|
4345
|
+
<span class={"rdt-sort-ind"} aria-hidden="true" data-rozie-s-d5dcab4c="">{(0, _rozie_runtime_solid.rozieDisplay)(sortIndicator(wh().header.column.id))}</span>
|
|
3908
4346
|
</button></Solid_js.Show>}<_rozie_ui_popover_solid.default trigger="click" placement="bottom-end" strategy="fixed" offset={4} data-rozie-s-d5dcab4c="" anchorSlot={() => <>
|
|
3909
|
-
<button type="button" class={"rdt-col-menu-trigger"} aria-label={(0, _rozie_runtime_solid.rozieAttr)("Column options for " + headerLabel(
|
|
4347
|
+
<button type="button" class={"rdt-col-menu-trigger"} aria-label={(0, _rozie_runtime_solid.rozieAttr)("Column options for " + headerLabel(wh().header.column.id))} data-rozie-s-d5dcab4c="">⋯</button>
|
|
3910
4348
|
</>}><div class={"rdt-col-menu"} role="menu" data-rozie-s-d5dcab4c="">
|
|
3911
|
-
<button type="button" role="menuitem" aria-pressed={columnPinSide(
|
|
3912
|
-
onPinColumn(
|
|
4349
|
+
<button type="button" role="menuitem" aria-pressed={columnPinSide(wh().header.column.id) === "left"} class={"rdt-col-menu-item"} onClick={($event) => {
|
|
4350
|
+
onPinColumn(wh().header.column.id, "left", $event);
|
|
3913
4351
|
}} data-rozie-s-d5dcab4c="">Pin left</button>
|
|
3914
|
-
<button type="button" role="menuitem" aria-pressed={columnPinSide(
|
|
3915
|
-
onPinColumn(
|
|
4352
|
+
<button type="button" role="menuitem" aria-pressed={columnPinSide(wh().header.column.id) === "right"} class={"rdt-col-menu-item"} onClick={($event) => {
|
|
4353
|
+
onPinColumn(wh().header.column.id, "right", $event);
|
|
3916
4354
|
}} data-rozie-s-d5dcab4c="">Pin right</button>
|
|
3917
|
-
<button type="button" role="menuitem" aria-pressed={!columnPinSide(
|
|
3918
|
-
onPinColumn(
|
|
4355
|
+
<button type="button" role="menuitem" aria-pressed={!columnPinSide(wh().header.column.id)} class={"rdt-col-menu-item"} onClick={($event) => {
|
|
4356
|
+
onPinColumn(wh().header.column.id, false, $event);
|
|
3919
4357
|
}} data-rozie-s-d5dcab4c="">Unpin</button>
|
|
3920
4358
|
<hr class={"rdt-col-menu-sep"} data-rozie-s-d5dcab4c="" />
|
|
3921
4359
|
<button type="button" role="menuitem" class={"rdt-col-menu-item"} onClick={($event) => {
|
|
3922
|
-
onHideColumn(
|
|
4360
|
+
onHideColumn(wh().header.column.id, $event);
|
|
3923
4361
|
}} data-rozie-s-d5dcab4c="">Hide column</button>
|
|
3924
4362
|
</div></_rozie_ui_popover_solid.default>
|
|
3925
|
-
<button type="button" aria-label={(0, _rozie_runtime_solid.rozieAttr)("Resize " + headerLabel(
|
|
3926
|
-
onResizeStart(
|
|
4363
|
+
<button type="button" aria-label={(0, _rozie_runtime_solid.rozieAttr)("Resize " + headerLabel(wh().header.column.id))} class={"rdt-resize-handle"} onPointerDown={($event) => {
|
|
4364
|
+
onResizeStart(wh().header.column.id, $event);
|
|
3927
4365
|
}} onTouchStart={($event) => {
|
|
3928
|
-
onResizeStart(
|
|
4366
|
+
onResizeStart(wh().header.column.id, $event);
|
|
3929
4367
|
}} data-rozie-s-d5dcab4c=""><span class={"rdt-resize-grip"} aria-hidden="true" data-rozie-s-d5dcab4c="" /></button>
|
|
3930
4368
|
</span>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
3931
4369
|
{(_props.selectAllSlot ?? _props.slots?.["selectAll"])?.({
|
|
@@ -3936,30 +4374,31 @@ function DataTable(_props) {
|
|
|
3936
4374
|
onToggleAllRows($event);
|
|
3937
4375
|
}} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}
|
|
3938
4376
|
</span></Solid_js.Show>}</th>}</_solid_primitives_keyed.Key>
|
|
3939
|
-
|
|
4377
|
+
|
|
4378
|
+
{<Solid_js.Show when={colsWindowed()}><th class={"rdt-col-spacer"} aria-hidden="true" style={(0, _rozie_runtime_solid.parseInlineStyle)("width:" + colPadRight() + "px;padding:0;border:0")} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}</tr>}</_solid_primitives_keyed.Key>
|
|
3940
4379
|
|
|
3941
4380
|
{<Solid_js.Show when={hasAnyFilterableColumn()}><tr class={"rdt-filter-row"} data-rozie-s-d5dcab4c="">
|
|
3942
|
-
<_solid_primitives_keyed.Key each={headerGroups()[headerGroups().length - 1].
|
|
3943
|
-
{<Solid_js.Show when={isSelectColumn(
|
|
3944
|
-
{<Solid_js.Show when={columnIsFilterable(
|
|
3945
|
-
onColumnFilterInput(
|
|
4381
|
+
{<Solid_js.Show when={colsWindowed()}><th class={"rdt-col-spacer"} aria-hidden="true" style={(0, _rozie_runtime_solid.parseInlineStyle)("width:" + colPadLeft() + "px;padding:0;border:0")} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}<_solid_primitives_keyed.Key each={windowedHeadersFor(headerGroups()[headerGroups().length - 1], headerGroups().length - 1)} by={(wh) => wh.header.id}>{(wh) => <th class={"rdt-filter-cell"} role="presentation" data-col={(0, _rozie_runtime_solid.rozieAttr)(wh().header.column.id)} style={(0, _rozie_runtime_solid.parseInlineStyle)(pinStyle(wh().header.column.id))} data-rozie-s-d5dcab4c="">
|
|
4382
|
+
{<Solid_js.Show when={isSelectColumn(wh().header.column.id)} fallback={<Solid_js.Show when={isExpanderColumn(wh().header.column.id)} fallback={<span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4383
|
+
{<Solid_js.Show when={columnIsFilterable(wh().header.column.id) && !hasFilterSlot()}><input type="text" aria-label={(0, _rozie_runtime_solid.rozieAttr)("Filter " + headerLabel(wh().header.column.id))} class={"rdt-col-filter"} value={columnFilterValue(wh().header.column.id)} onInput={($event) => {
|
|
4384
|
+
onColumnFilterInput(wh().header.column.id, $event);
|
|
3946
4385
|
}} onClick={($event) => {
|
|
3947
4386
|
stopEvent($event);
|
|
3948
|
-
}} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}{<Solid_js.Show when={columnIsFilterable(
|
|
4387
|
+
}} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}{<Solid_js.Show when={columnIsFilterable(wh().header.column.id)}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
3949
4388
|
{(_props.filterSlot ?? _props.slots?.["filter"])?.({
|
|
3950
|
-
columnId:
|
|
3951
|
-
value: columnFilterValue(
|
|
3952
|
-
uniqueValues: getFacetedUniqueValues(
|
|
3953
|
-
minMax: getFacetedMinMaxValues(
|
|
4389
|
+
columnId: wh().header.column.id,
|
|
4390
|
+
value: columnFilterValue(wh().header.column.id),
|
|
4391
|
+
uniqueValues: getFacetedUniqueValues(wh().header.column.id),
|
|
4392
|
+
minMax: getFacetedMinMaxValues(wh().header.column.id),
|
|
3954
4393
|
setFilter: setColumnFilter
|
|
3955
4394
|
})}
|
|
3956
4395
|
</span></Solid_js.Show>}</span>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}</th>}</_solid_primitives_keyed.Key>
|
|
3957
|
-
|
|
4396
|
+
{<Solid_js.Show when={colsWindowed()}><th class={"rdt-col-spacer"} aria-hidden="true" style={(0, _rozie_runtime_solid.parseInlineStyle)("width:" + colPadRight() + "px;padding:0;border:0")} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}</tr></Solid_js.Show>}</thead>
|
|
3958
4397
|
|
|
3959
4398
|
<tbody class={"rdt-tbody"} role="rowgroup" data-rozie-s-d5dcab4c="">
|
|
3960
4399
|
|
|
3961
4400
|
<tr class={"rdt-spacer"} aria-hidden="true" data-rozie-s-d5dcab4c="">
|
|
3962
|
-
<td colSpan={(0, _rozie_runtime_solid.rozieAttr)(
|
|
4401
|
+
<td colSpan={(0, _rozie_runtime_solid.rozieAttr)(windowedColSpan())} style={(0, _rozie_runtime_solid.parseInlineStyle)("height:" + padTop() + "px;padding:0;border:0")} data-rozie-s-d5dcab4c="" />
|
|
3963
4402
|
</tr>
|
|
3964
4403
|
|
|
3965
4404
|
<_solid_primitives_keyed.Key each={windowedRows()} by={(wr) => wr.row.id}>{(wr) => <>
|
|
@@ -3967,7 +4406,8 @@ function DataTable(_props) {
|
|
|
3967
4406
|
"rdt-group-header": rowIsGrouped(wr().row),
|
|
3968
4407
|
"rdt-row-pinned": wr().pinned
|
|
3969
4408
|
})} role="row" data-row={(0, _rozie_runtime_solid.rozieAttr)(wr().vi.index)} aria-rowindex={(0, _rozie_runtime_solid.rozieAttr)(headerRowCount() + wr().vi.index + 1)} data-index={(0, _rozie_runtime_solid.rozieAttr)(wr().vi.index)} data-pinned={(0, _rozie_runtime_solid.rozieAttr)(wr().pinned ? "true" : null)} data-depth={(0, _rozie_runtime_solid.rozieAttr)(wr().row.depth)} data-group-header={(0, _rozie_runtime_solid.rozieAttr)(rowIsGrouped(wr().row) ? wr().row.id : null)} data-group-leaf={(0, _rozie_runtime_solid.rozieAttr)(groupingActive() && !rowIsGrouped(wr().row) ? wr().row.id : null)} aria-expanded={(rowIsGrouped(wr().row) ? !!rowIsExpanded(wr().row) : null) ?? void 0} aria-selected={(local.selectionMode !== "none" ? !!rowIsSelected(wr().row) : null) ?? void 0} aria-level={(0, _rozie_runtime_solid.rozieAttr)(groupingActive() ? wr().row.depth + 1 : null)} data-rozie-s-d5dcab4c="">
|
|
3970
|
-
|
|
4409
|
+
|
|
4410
|
+
{<Solid_js.Show when={colsWindowed()}><td class={"rdt-col-spacer"} aria-hidden="true" style={(0, _rozie_runtime_solid.parseInlineStyle)("width:" + colPadLeft() + "px;padding:0;border:0")} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}<_solid_primitives_keyed.Key each={windowedCells(wr().row)} by={(cell) => cell.id}>{(cell) => <td class={"rdt-td " + (0, _rozie_runtime_solid.rozieClass)({
|
|
3971
4411
|
"rdt-select-td": isSelectColumn(cell().column.id),
|
|
3972
4412
|
"rdt-expander-td": isExpanderColumn(cell().column.id),
|
|
3973
4413
|
"rdt-in-range": inRange(wr().vi.index, colIndexOf(wr().row, cell())),
|
|
@@ -3978,7 +4418,7 @@ function DataTable(_props) {
|
|
|
3978
4418
|
{(_props.cellSlot ?? _props.slots?.["cell"])?.({
|
|
3979
4419
|
columnId: cell().column.id,
|
|
3980
4420
|
column: cell().column,
|
|
3981
|
-
row: wr().row
|
|
4421
|
+
row: cellSlotRow(wr().row),
|
|
3982
4422
|
value: cell().getValue()
|
|
3983
4423
|
}) ?? (0, _rozie_runtime_solid.rozieDisplay)(cell().getValue())}
|
|
3984
4424
|
</span>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
@@ -4012,7 +4452,7 @@ function DataTable(_props) {
|
|
|
4012
4452
|
{(_props.editorSlot ?? _props.slots?.["editor"])?.({
|
|
4013
4453
|
columnId: cell().column.id,
|
|
4014
4454
|
column: cell().column,
|
|
4015
|
-
row: wr().row
|
|
4455
|
+
row: cellSlotRow(wr().row),
|
|
4016
4456
|
value: editorValueFor(cell().column.id),
|
|
4017
4457
|
commit: editorCommitFor(cell().column.id),
|
|
4018
4458
|
cancel: editorCancelFor(),
|
|
@@ -4026,14 +4466,14 @@ function DataTable(_props) {
|
|
|
4026
4466
|
{(_props.cellSlot ?? _props.slots?.["cell"])?.({
|
|
4027
4467
|
columnId: cell().column.id,
|
|
4028
4468
|
column: cell().column,
|
|
4029
|
-
row: wr().row
|
|
4469
|
+
row: cellSlotRow(wr().row),
|
|
4030
4470
|
value: cell().getValue()
|
|
4031
4471
|
}) ?? (0, _rozie_runtime_solid.rozieDisplay)(cell().getValue())}
|
|
4032
4472
|
</span>
|
|
4033
4473
|
<span class={"rdt-group-count"} data-rozie-s-d5dcab4c="">{(0, _rozie_runtime_solid.rozieDisplay)("(" + groupSubRowCount(wr().row) + ")")}</span>
|
|
4034
4474
|
</span></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4035
4475
|
{(_props.selectCellSlot ?? _props.slots?.["selectCell"])?.({
|
|
4036
|
-
row: wr().row
|
|
4476
|
+
row: cellSlotRow(wr().row),
|
|
4037
4477
|
checked: rowIsSelected(wr().row),
|
|
4038
4478
|
toggle: (e) => onToggleRow(wr().row, e)
|
|
4039
4479
|
}) ?? <input type="checkbox" aria-label="Select row" class={"rdt-select-row"} checked={rowIsSelected(wr().row)} onChange={($event) => {
|
|
@@ -4045,20 +4485,21 @@ function DataTable(_props) {
|
|
|
4045
4485
|
}} data-rozie-s-d5dcab4c="">{(0, _rozie_runtime_solid.rozieDisplay)(rowIsExpanded(wr().row) ? "▾" : "▸")}</button></Solid_js.Show>}</span></Solid_js.Show>}{<Solid_js.Show when={isFillHandleCell(wr().vi.index, colIndexOf(wr().row, cell()))}><span data-fill-handle="" data-testid="fill-handle" aria-hidden="true" class={"rdt-fill-handle"} onPointerDown={($event) => {
|
|
4046
4486
|
onFillHandlePointerDown($event);
|
|
4047
4487
|
}} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}</td>}</_solid_primitives_keyed.Key>
|
|
4048
|
-
|
|
4488
|
+
|
|
4489
|
+
{<Solid_js.Show when={colsWindowed()}><td class={"rdt-col-spacer"} aria-hidden="true" style={(0, _rozie_runtime_solid.parseInlineStyle)("width:" + colPadRight() + "px;padding:0;border:0")} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}</tr>
|
|
4049
4490
|
|
|
4050
4491
|
{<Solid_js.Show when={rowShowsDetail(wr().row)}><tr class={"rdt-detail-row"} role="row" data-detail-row={(0, _rozie_runtime_solid.rozieAttr)(wr().row.id)} data-rozie-s-d5dcab4c="">
|
|
4051
|
-
<td class={"rdt-detail-cell"} colSpan={(0, _rozie_runtime_solid.rozieAttr)(
|
|
4492
|
+
<td class={"rdt-detail-cell"} colSpan={(0, _rozie_runtime_solid.rozieAttr)(windowedColSpan())} data-rozie-s-d5dcab4c="">
|
|
4052
4493
|
{(_props.detailSlot ?? _props.slots?.["detail"])?.({ row: wr().row.original })}
|
|
4053
4494
|
</td>
|
|
4054
4495
|
</tr></Solid_js.Show>}</>}</_solid_primitives_keyed.Key>
|
|
4055
4496
|
|
|
4056
4497
|
<tr class={"rdt-spacer"} aria-hidden="true" data-rozie-s-d5dcab4c="">
|
|
4057
|
-
<td colSpan={(0, _rozie_runtime_solid.rozieAttr)(
|
|
4498
|
+
<td colSpan={(0, _rozie_runtime_solid.rozieAttr)(windowedColSpan())} style={(0, _rozie_runtime_solid.parseInlineStyle)("height:" + padBottom() + "px;padding:0;border:0")} data-rozie-s-d5dcab4c="" />
|
|
4058
4499
|
</tr>
|
|
4059
4500
|
</tbody>
|
|
4060
4501
|
</table>
|
|
4061
|
-
</div></Solid_js.Show>}{<Solid_js.Show when={!
|
|
4502
|
+
</div></Solid_js.Show>}{<Solid_js.Show when={!rowsWindowed()}><div class={"rdt-pagination"} role="group" aria-label="Pagination" data-rozie-s-d5dcab4c="">
|
|
4062
4503
|
<button type="button" class={"rdt-page-btn rdt-page-prev"} disabled={!canPrevPage()} onClick={($event) => {
|
|
4063
4504
|
onPrevPage();
|
|
4064
4505
|
}} data-rozie-s-d5dcab4c="">Prev</button>
|