@rozie-ui/data-table-solid 0.3.1 → 0.4.0
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 +51 -2
- package/dist/index.cjs +275 -108
- package/dist/index.d.cts +40 -11
- package/dist/index.d.mts +40 -11
- package/dist/index.mjs +275 -108
- package/package.json +2 -2
- package/src/DataTable.tsx +373 -130
- package/src/helpers/columnDefUtils.ts +77 -1
package/dist/index.cjs
CHANGED
|
@@ -44,6 +44,39 @@ const wrapAggregationFn = (fn) => {
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
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
|
+
};
|
|
47
80
|
//#endregion
|
|
48
81
|
//#region src/helpers/indexMath.ts
|
|
49
82
|
const clamp = (v, lo, hi) => v < lo ? lo : v > hi ? hi : v;
|
|
@@ -933,6 +966,7 @@ function DataTable(_props) {
|
|
|
933
966
|
let columnDefsCache = null;
|
|
934
967
|
let columnDefsCacheColumnsRef = void 0;
|
|
935
968
|
let columnDefsCacheColRegRef = void 0;
|
|
969
|
+
let columnDefsIndexCache = null;
|
|
936
970
|
function columnDefs() {
|
|
937
971
|
const cfg = local.columns || [];
|
|
938
972
|
const reg = colReg() || {};
|
|
@@ -976,8 +1010,13 @@ function DataTable(_props) {
|
|
|
976
1010
|
columnDefsCache = out;
|
|
977
1011
|
columnDefsCacheColumnsRef = local.columns;
|
|
978
1012
|
columnDefsCacheColRegRef = colReg();
|
|
1013
|
+
columnDefsIndexCache = indexDefsById(out);
|
|
979
1014
|
return out;
|
|
980
1015
|
}
|
|
1016
|
+
function defIndex() {
|
|
1017
|
+
columnDefs();
|
|
1018
|
+
return columnDefsIndexCache || Object.create(null);
|
|
1019
|
+
}
|
|
981
1020
|
const SELECT_COL_ID = "__rdt_select";
|
|
982
1021
|
const EXPANDER_COL_ID = "__rdt_expander";
|
|
983
1022
|
function selectionEnabled() {
|
|
@@ -1695,9 +1734,9 @@ function DataTable(_props) {
|
|
|
1695
1734
|
return "";
|
|
1696
1735
|
}
|
|
1697
1736
|
function defFor(colId) {
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
return null;
|
|
1737
|
+
if (colId == null) return null;
|
|
1738
|
+
const d = defIndex()[String(colId)];
|
|
1739
|
+
return d != null ? d : null;
|
|
1701
1740
|
}
|
|
1702
1741
|
function visibleCellsFor(row) {
|
|
1703
1742
|
return rowModelVer() >= 0 ? row.getVisibleCells() : [];
|
|
@@ -1718,12 +1757,6 @@ function DataTable(_props) {
|
|
|
1718
1757
|
const m = editMetaOf(colId);
|
|
1719
1758
|
return m && m.editorOptions != null ? m.editorOptions : [];
|
|
1720
1759
|
}
|
|
1721
|
-
function hasEditorSlot(colId) {
|
|
1722
|
-
return editorTypeOf(colId) === "custom" && !!(_props.editorSlot ?? _props.slots?.["editor"]);
|
|
1723
|
-
}
|
|
1724
|
-
function hasFilterSlot() {
|
|
1725
|
-
return !!(_props.filterSlot ?? _props.slots?.["filter"]);
|
|
1726
|
-
}
|
|
1727
1760
|
function columnIsFilterable(colId) {
|
|
1728
1761
|
const d = defFor(colId);
|
|
1729
1762
|
return !!(d && d.filterable);
|
|
@@ -1732,11 +1765,9 @@ function DataTable(_props) {
|
|
|
1732
1765
|
const d = defFor(colId);
|
|
1733
1766
|
return d ? d.header : colId;
|
|
1734
1767
|
}
|
|
1735
|
-
function headerWidth(
|
|
1736
|
-
if (tick() < 0 || !
|
|
1737
|
-
const
|
|
1738
|
-
if (!col) return null;
|
|
1739
|
-
const w = col.getSize();
|
|
1768
|
+
function headerWidth(header) {
|
|
1769
|
+
if (tick() < 0 || !header || typeof header.getSize !== "function") return null;
|
|
1770
|
+
const w = header.getSize();
|
|
1740
1771
|
return w != null && w > 0 ? w + "px" : null;
|
|
1741
1772
|
}
|
|
1742
1773
|
function onResizeStart(colId, evt) {
|
|
@@ -1800,11 +1831,11 @@ function DataTable(_props) {
|
|
|
1800
1831
|
if (side === "right") return "position:sticky;right:" + (col.getAfter ? col.getAfter("right") : 0) + "px;z-index:" + zIndex + ";";
|
|
1801
1832
|
return "";
|
|
1802
1833
|
}
|
|
1803
|
-
function thStyle(
|
|
1834
|
+
function thStyle(header) {
|
|
1804
1835
|
let s = "";
|
|
1805
|
-
const w = headerWidth(
|
|
1836
|
+
const w = headerWidth(header);
|
|
1806
1837
|
if (w) s += "width:" + w + ";";
|
|
1807
|
-
s += pinStyle(
|
|
1838
|
+
s += pinStyle(header && header.column ? header.column.id : null, 2);
|
|
1808
1839
|
return s;
|
|
1809
1840
|
}
|
|
1810
1841
|
function onGlobalFilterInput(evt) {
|
|
@@ -1890,6 +1921,9 @@ function DataTable(_props) {
|
|
|
1890
1921
|
function rowIsGrouped(row) {
|
|
1891
1922
|
return !!(tick() >= 0 && row && row.getIsGrouped && row.getIsGrouped());
|
|
1892
1923
|
}
|
|
1924
|
+
function rowIndexIsGrouped(rowIndex) {
|
|
1925
|
+
return rowIsGrouped((rows() || [])[rowIndex]);
|
|
1926
|
+
}
|
|
1893
1927
|
function groupingActive() {
|
|
1894
1928
|
return tick() >= 0 && (currentState().grouping || []).length > 0;
|
|
1895
1929
|
}
|
|
@@ -1903,21 +1937,54 @@ function DataTable(_props) {
|
|
|
1903
1937
|
return !!(tick() >= 0 && cellCtx && cellCtx.getIsPlaceholder && cellCtx.getIsPlaceholder());
|
|
1904
1938
|
}
|
|
1905
1939
|
function groupSubRowCount(row) {
|
|
1906
|
-
|
|
1940
|
+
if (row && row.getLeafRows) {
|
|
1941
|
+
const leaves = row.getLeafRows();
|
|
1942
|
+
let n = 0;
|
|
1943
|
+
for (let i = 0; i < leaves.length; i++) {
|
|
1944
|
+
const r = leaves[i];
|
|
1945
|
+
if (!(r && r.getIsGrouped && r.getIsGrouped())) n = n + 1;
|
|
1946
|
+
}
|
|
1947
|
+
return n;
|
|
1948
|
+
}
|
|
1949
|
+
return row && row.subRows ? row.subRows.length : 0;
|
|
1950
|
+
}
|
|
1951
|
+
let groupRowDescriptorCache = null;
|
|
1952
|
+
let groupRowDescriptorCacheVer = void 0;
|
|
1953
|
+
function groupRowDescriptor(row) {
|
|
1954
|
+
const ver = rowModelVer();
|
|
1955
|
+
if (!groupRowDescriptorCache || groupRowDescriptorCacheVer !== ver) {
|
|
1956
|
+
groupRowDescriptorCache = Object.create(null);
|
|
1957
|
+
groupRowDescriptorCacheVer = ver;
|
|
1958
|
+
}
|
|
1959
|
+
const key = String(row.id);
|
|
1960
|
+
let d = groupRowDescriptorCache[key];
|
|
1961
|
+
if (!d) {
|
|
1962
|
+
const groupingColumnId = row.groupingColumnId != null ? row.groupingColumnId : "";
|
|
1963
|
+
const groupingValue = row.getGroupingValue ? row.getGroupingValue(groupingColumnId) : row.groupingValue;
|
|
1964
|
+
d = {
|
|
1965
|
+
isGroupRow: true,
|
|
1966
|
+
groupId: row.id,
|
|
1967
|
+
groupingColumnId,
|
|
1968
|
+
groupingValue,
|
|
1969
|
+
leafCount: groupSubRowCount(row)
|
|
1970
|
+
};
|
|
1971
|
+
groupRowDescriptorCache[key] = d;
|
|
1972
|
+
}
|
|
1973
|
+
return d;
|
|
1974
|
+
}
|
|
1975
|
+
function cellSlotRow(row) {
|
|
1976
|
+
return rowIsGrouped(row) ? groupRowDescriptor(row) : row ? row.original : null;
|
|
1907
1977
|
}
|
|
1908
1978
|
function groupingKeys() {
|
|
1909
1979
|
return currentState().grouping || [];
|
|
1910
1980
|
}
|
|
1911
1981
|
function groupableColumns() {
|
|
1912
1982
|
const out = [];
|
|
1913
|
-
const defs = columnDefs();
|
|
1914
|
-
for (const d of defs) {
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
label: d.header != null ? d.header : d.id
|
|
1919
|
-
});
|
|
1920
|
-
}
|
|
1983
|
+
const defs = collectGroupableLeafDefs(columnDefs());
|
|
1984
|
+
for (const d of defs) out.push({
|
|
1985
|
+
id: d.id,
|
|
1986
|
+
label: d.header != null ? d.header : d.id
|
|
1987
|
+
});
|
|
1921
1988
|
return out;
|
|
1922
1989
|
}
|
|
1923
1990
|
function stopEvent(evt) {
|
|
@@ -2943,11 +3010,13 @@ function DataTable(_props) {
|
|
|
2943
3010
|
for (let gr = 0; gr < grid.length; gr++) {
|
|
2944
3011
|
const r = originRow + gr;
|
|
2945
3012
|
if (r > maxRow) break;
|
|
3013
|
+
const rowGrouped = rowIndexIsGrouped(r);
|
|
2946
3014
|
const cols = grid[gr] || [];
|
|
2947
3015
|
for (let gc = 0; gc < cols.length; gc++) {
|
|
2948
3016
|
const c = originCol + gc;
|
|
2949
3017
|
if (c > maxCol) break;
|
|
2950
3018
|
total = total + 1;
|
|
3019
|
+
if (rowGrouped) continue;
|
|
2951
3020
|
const colId = columnIdAt(r, c);
|
|
2952
3021
|
if (colId == null || !columnEditable(colId)) continue;
|
|
2953
3022
|
const rowObj = rowOriginalAt(r);
|
|
@@ -3122,8 +3191,9 @@ function DataTable(_props) {
|
|
|
3122
3191
|
fillEdgeScrollRaf = null;
|
|
3123
3192
|
}
|
|
3124
3193
|
}
|
|
3125
|
-
|
|
3126
|
-
|
|
3194
|
+
const FILL_HITTEST_PROBE_RADIUS_PX = 8;
|
|
3195
|
+
const FILL_HITTEST_PROBE_STEP_PX = 2;
|
|
3196
|
+
function resolveCellAt(clientX, clientY) {
|
|
3127
3197
|
let el = document.elementFromPoint(clientX, clientY);
|
|
3128
3198
|
while (el && el.shadowRoot && el.shadowRoot.elementFromPoint) {
|
|
3129
3199
|
const inner = el.shadowRoot.elementFromPoint(clientX, clientY);
|
|
@@ -3144,6 +3214,18 @@ function DataTable(_props) {
|
|
|
3144
3214
|
c
|
|
3145
3215
|
};
|
|
3146
3216
|
}
|
|
3217
|
+
function cellIndexFromPoint(clientX, clientY) {
|
|
3218
|
+
if (typeof document === "undefined" || !document.elementFromPoint) return null;
|
|
3219
|
+
const direct = resolveCellAt(clientX, clientY);
|
|
3220
|
+
if (direct) return direct;
|
|
3221
|
+
for (let d = FILL_HITTEST_PROBE_STEP_PX; d <= FILL_HITTEST_PROBE_RADIUS_PX; d += FILL_HITTEST_PROBE_STEP_PX) {
|
|
3222
|
+
const right = resolveCellAt(clientX + d, clientY);
|
|
3223
|
+
if (right) return right;
|
|
3224
|
+
const left = resolveCellAt(clientX - d, clientY);
|
|
3225
|
+
if (left) return left;
|
|
3226
|
+
}
|
|
3227
|
+
return null;
|
|
3228
|
+
}
|
|
3147
3229
|
function onFillHandlePointerDown(e) {
|
|
3148
3230
|
if (!e) return;
|
|
3149
3231
|
if (e.preventDefault) e.preventDefault();
|
|
@@ -3250,11 +3332,13 @@ function DataTable(_props) {
|
|
|
3250
3332
|
return cell && cell.column ? cell.column.id : null;
|
|
3251
3333
|
}
|
|
3252
3334
|
function isActiveCellEditable() {
|
|
3335
|
+
if (rowIndexIsGrouped(activeRow())) return false;
|
|
3253
3336
|
const colId = activeCellColumnId();
|
|
3254
3337
|
return colId != null && columnEditable(colId);
|
|
3255
3338
|
}
|
|
3256
3339
|
function isEditing(rowIndex, colIndex) {
|
|
3257
3340
|
if (editVer() < 0) return false;
|
|
3341
|
+
if (rowIndexIsGrouped(rowIndex)) return false;
|
|
3258
3342
|
if (editingRowIndex() != null && editingRowIndex() === rowIndex) {
|
|
3259
3343
|
const colId = columnIdAt(rowIndex, colIndex);
|
|
3260
3344
|
return colId != null && columnEditable(colId);
|
|
@@ -3314,12 +3398,24 @@ function DataTable(_props) {
|
|
|
3314
3398
|
const row = (rows() || [])[editingRow()];
|
|
3315
3399
|
return row ? row.id : null;
|
|
3316
3400
|
}
|
|
3317
|
-
function
|
|
3401
|
+
function resolveEditFocusCellEl(rowIndex, colIndex) {
|
|
3402
|
+
if (rowIndex == null || colIndex == null || rowIndex < 0 || colIndex < 0) return null;
|
|
3403
|
+
return resolveCellEl(String(rowIndex), colIndex);
|
|
3404
|
+
}
|
|
3405
|
+
function focusEditorWhenReady(rowIndex, colIndex, selectAll = true) {
|
|
3318
3406
|
if (!gridRoot) return;
|
|
3319
|
-
if (editFocusColId() != null && hasEditorSlot(editFocusColId())) return;
|
|
3320
3407
|
let attempts = 0;
|
|
3321
3408
|
const tryFocus = () => {
|
|
3322
|
-
const
|
|
3409
|
+
const cellEl = resolveEditFocusCellEl(rowIndex, colIndex);
|
|
3410
|
+
const el = cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell][data-builtin-editor]") : null;
|
|
3411
|
+
if (!el) {
|
|
3412
|
+
if (cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell]") : null) return;
|
|
3413
|
+
attempts = attempts + 1;
|
|
3414
|
+
if (attempts >= 30) return;
|
|
3415
|
+
if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
|
|
3416
|
+
else setTimeout(tryFocus, 16);
|
|
3417
|
+
return;
|
|
3418
|
+
}
|
|
3323
3419
|
const ae = gridRoot && gridRoot.getRootNode ? gridRoot.getRootNode().activeElement : null;
|
|
3324
3420
|
if (ae && el && ae !== el && ae.closest && gridRoot.contains(ae) && ae.hasAttribute && ae.hasAttribute("data-editing-cell")) {
|
|
3325
3421
|
const aeCell = ae.closest("[data-grid-cell]");
|
|
@@ -3328,17 +3424,10 @@ function DataTable(_props) {
|
|
|
3328
3424
|
const elCol = elCell ? elCell.getAttribute("data-col-index") : null;
|
|
3329
3425
|
if (aeCol != null && aeCol !== elCol) return;
|
|
3330
3426
|
}
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
} catch (e) {}
|
|
3336
|
-
return;
|
|
3337
|
-
}
|
|
3338
|
-
attempts = attempts + 1;
|
|
3339
|
-
if (attempts >= 30) return;
|
|
3340
|
-
if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
|
|
3341
|
-
else setTimeout(tryFocus, 16);
|
|
3427
|
+
el.focus();
|
|
3428
|
+
if (selectAll && el.select) try {
|
|
3429
|
+
el.select();
|
|
3430
|
+
} catch (e) {}
|
|
3342
3431
|
};
|
|
3343
3432
|
if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
|
|
3344
3433
|
else setTimeout(tryFocus, 0);
|
|
@@ -3356,6 +3445,7 @@ function DataTable(_props) {
|
|
|
3356
3445
|
return cell ? cell.getValue() : null;
|
|
3357
3446
|
}
|
|
3358
3447
|
function beginEdit(rowIndex, colIndex, seed) {
|
|
3448
|
+
if (rowIndexIsGrouped(rowIndex)) return;
|
|
3359
3449
|
const colId = columnIdAt(rowIndex, colIndex);
|
|
3360
3450
|
if (colId == null || !columnEditable(colId)) return;
|
|
3361
3451
|
committedThisSession = false;
|
|
@@ -3368,7 +3458,7 @@ function DataTable(_props) {
|
|
|
3368
3458
|
setActiveInControl(true);
|
|
3369
3459
|
setEditVer(editVer() + 1);
|
|
3370
3460
|
setEditFocusColId(colId);
|
|
3371
|
-
focusEditorWhenReady(seed == null);
|
|
3461
|
+
focusEditorWhenReady(rowIndex, colIndex, seed == null);
|
|
3372
3462
|
}
|
|
3373
3463
|
function focusCellWhenReady(row, col) {
|
|
3374
3464
|
if (!gridRoot) return;
|
|
@@ -3436,7 +3526,7 @@ function DataTable(_props) {
|
|
|
3436
3526
|
const err = runValidator(colId, newValue, rowOriginal);
|
|
3437
3527
|
if (err !== true) {
|
|
3438
3528
|
setInvalid(err);
|
|
3439
|
-
focusEditorWhenReady();
|
|
3529
|
+
focusEditorWhenReady(editingRow(), editingCol());
|
|
3440
3530
|
return false;
|
|
3441
3531
|
}
|
|
3442
3532
|
setInvalid("");
|
|
@@ -3467,6 +3557,7 @@ function DataTable(_props) {
|
|
|
3467
3557
|
return true;
|
|
3468
3558
|
}
|
|
3469
3559
|
function toggleActiveBooleanCell() {
|
|
3560
|
+
if (rowIndexIsGrouped(activeRow())) return;
|
|
3470
3561
|
const colId = columnIdAt(activeRow(), activeColIndex());
|
|
3471
3562
|
if (colId == null || !columnEditable(colId)) return;
|
|
3472
3563
|
const row = (rows() || [])[activeRow()];
|
|
@@ -3528,12 +3619,10 @@ function DataTable(_props) {
|
|
|
3528
3619
|
}
|
|
3529
3620
|
function focusRowEditorAt(rowIndex, colIndex) {
|
|
3530
3621
|
if (!gridRoot) return;
|
|
3531
|
-
const colId = columnIdAt(rowIndex, colIndex);
|
|
3532
|
-
if (colId != null && hasEditorSlot(colId)) return;
|
|
3533
3622
|
let attempts = 0;
|
|
3534
3623
|
const tryFocus = () => {
|
|
3535
3624
|
const cellEl = resolveCellEl(String(rowIndex), colIndex);
|
|
3536
|
-
const ed = cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell]") : null;
|
|
3625
|
+
const ed = cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell][data-builtin-editor]") : null;
|
|
3537
3626
|
if (ed) {
|
|
3538
3627
|
ed.focus();
|
|
3539
3628
|
if (ed.select) try {
|
|
@@ -3541,6 +3630,7 @@ function DataTable(_props) {
|
|
|
3541
3630
|
} catch (e) {}
|
|
3542
3631
|
return;
|
|
3543
3632
|
}
|
|
3633
|
+
if (cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell]") : null) return;
|
|
3544
3634
|
attempts = attempts + 1;
|
|
3545
3635
|
if (attempts >= 30) return;
|
|
3546
3636
|
if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
|
|
@@ -3552,6 +3642,7 @@ function DataTable(_props) {
|
|
|
3552
3642
|
function beginRowEdit(row) {
|
|
3553
3643
|
const rowIndex = rowIndexOf(row);
|
|
3554
3644
|
if (rowIndex < 0) return;
|
|
3645
|
+
if (rowIndexIsGrouped(rowIndex)) return;
|
|
3555
3646
|
const editable = editableColumnsForRow(rowIndex);
|
|
3556
3647
|
if (editable.length === 0) return;
|
|
3557
3648
|
committedThisSession = false;
|
|
@@ -3571,7 +3662,7 @@ function DataTable(_props) {
|
|
|
3571
3662
|
setActiveInControl(true);
|
|
3572
3663
|
setEditVer(editVer() + 1);
|
|
3573
3664
|
setEditFocusColId(editable[0].colId);
|
|
3574
|
-
focusEditorWhenReady();
|
|
3665
|
+
focusEditorWhenReady(rowIndex, editable[0].colIndex);
|
|
3575
3666
|
}
|
|
3576
3667
|
function commitRow() {
|
|
3577
3668
|
if (editingRowIndex() == null) return false;
|
|
@@ -4048,14 +4139,18 @@ function DataTable(_props) {
|
|
|
4048
4139
|
"rdt-expander-th": isExpanderColumn(header().column.id),
|
|
4049
4140
|
"rdt-th-resizing": columnIsResizing(header().column.id),
|
|
4050
4141
|
"rdt-cell-active": isActiveCell("__header", headerColIndexOf(hg(), header()), hgLevel())
|
|
4051
|
-
})} role="columnheader" data-col={(0, _rozie_runtime_solid.rozieAttr)(header().column.id)} data-grid-cell="" data-row="__header" data-header-level={(0, _rozie_runtime_solid.rozieAttr)(hgLevel())} colSpan={(0, _rozie_runtime_solid.rozieAttr)(header().colSpan > 1 ? header().colSpan : null)} data-col-index={(0, _rozie_runtime_solid.rozieAttr)(headerColIndexOf(hg(), header()))} tabIndex={(0, _rozie_runtime_solid.rozieAttr)(cellTabindex("__header", headerColIndexOf(hg(), header()), hgLevel()))} aria-sort={(0, _rozie_runtime_solid.rozieAttr)(ariaSortFor(header().column.id))} style={(0, _rozie_runtime_solid.parseInlineStyle)(thStyle(header()
|
|
4142
|
+
})} role="columnheader" data-col={(0, _rozie_runtime_solid.rozieAttr)(header().column.id)} data-grid-cell="" data-row="__header" data-header-level={(0, _rozie_runtime_solid.rozieAttr)(hgLevel())} colSpan={(0, _rozie_runtime_solid.rozieAttr)(header().colSpan > 1 ? header().colSpan : null)} data-col-index={(0, _rozie_runtime_solid.rozieAttr)(headerColIndexOf(hg(), header()))} tabIndex={(0, _rozie_runtime_solid.rozieAttr)(cellTabindex("__header", headerColIndexOf(hg(), header()), hgLevel()))} aria-sort={(0, _rozie_runtime_solid.rozieAttr)(ariaSortFor(header().column.id))} style={(0, _rozie_runtime_solid.parseInlineStyle)(thStyle(header()))} data-rozie-s-d5dcab4c="">
|
|
4052
4143
|
|
|
4053
4144
|
|
|
4054
4145
|
{<Solid_js.Show when={isSelectColumn(header().column.id)} fallback={<Solid_js.Show when={isExpanderColumn(header().column.id)} fallback={<span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4055
4146
|
|
|
4056
4147
|
{<Solid_js.Show when={header().column.getCanSort && header().column.getCanSort()} fallback={<span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4057
4148
|
<span class={"rdt-header-label"} data-rozie-s-d5dcab4c="">
|
|
4058
|
-
{
|
|
4149
|
+
{_props.slots?.[`colHeader-${header().column.id}`]?.({
|
|
4150
|
+
columnId: header().column.id,
|
|
4151
|
+
column: header().column,
|
|
4152
|
+
label: headerLabel(header().column.id)
|
|
4153
|
+
}) ?? (_props.colHeaderSlot ?? _props.slots?.["colHeader"])?.({
|
|
4059
4154
|
columnId: header().column.id,
|
|
4060
4155
|
column: header().column,
|
|
4061
4156
|
label: headerLabel(header().column.id)
|
|
@@ -4066,7 +4161,11 @@ function DataTable(_props) {
|
|
|
4066
4161
|
}} data-rozie-s-d5dcab4c="">
|
|
4067
4162
|
|
|
4068
4163
|
<span class={"rdt-header-label"} data-rozie-s-d5dcab4c="">
|
|
4069
|
-
{
|
|
4164
|
+
{_props.slots?.[`colHeader-${header().column.id}`]?.({
|
|
4165
|
+
columnId: header().column.id,
|
|
4166
|
+
column: header().column,
|
|
4167
|
+
label: headerLabel(header().column.id)
|
|
4168
|
+
}) ?? (_props.colHeaderSlot ?? _props.slots?.["colHeader"])?.({
|
|
4070
4169
|
columnId: header().column.id,
|
|
4071
4170
|
column: header().column,
|
|
4072
4171
|
label: headerLabel(header().column.id)
|
|
@@ -4110,18 +4209,24 @@ function DataTable(_props) {
|
|
|
4110
4209
|
{<Solid_js.Show when={hasAnyFilterableColumn()}><tr class={"rdt-filter-row"} data-rozie-s-d5dcab4c="">
|
|
4111
4210
|
<_solid_primitives_keyed.Key each={headerGroups()[headerGroups().length - 1].headers} by={(header) => header.id}>{(header) => <th class={"rdt-filter-cell"} role="presentation" style={(0, _rozie_runtime_solid.parseInlineStyle)(pinStyle(header().column.id))} data-rozie-s-d5dcab4c="">
|
|
4112
4211
|
{<Solid_js.Show when={isSelectColumn(header().column.id)} fallback={<Solid_js.Show when={isExpanderColumn(header().column.id)} fallback={<span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4113
|
-
{<Solid_js.Show when={columnIsFilterable(header().column.id)
|
|
4114
|
-
|
|
4115
|
-
}} onClick={($event) => {
|
|
4116
|
-
stopEvent($event);
|
|
4117
|
-
}} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}{<Solid_js.Show when={columnIsFilterable(header().column.id)}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4118
|
-
{(_props.filterSlot ?? _props.slots?.["filter"])?.({
|
|
4212
|
+
{<Solid_js.Show when={columnIsFilterable(header().column.id)}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4213
|
+
{_props.slots?.[`filter-${header().column.id}`]?.({
|
|
4119
4214
|
columnId: header().column.id,
|
|
4120
4215
|
value: columnFilterValue(header().column.id),
|
|
4121
4216
|
uniqueValues: getFacetedUniqueValues(header().column.id),
|
|
4122
4217
|
minMax: getFacetedMinMaxValues(header().column.id),
|
|
4123
4218
|
setFilter: setColumnFilter
|
|
4124
|
-
})
|
|
4219
|
+
}) ?? (_props.filterSlot ?? _props.slots?.["filter"])?.({
|
|
4220
|
+
columnId: header().column.id,
|
|
4221
|
+
value: columnFilterValue(header().column.id),
|
|
4222
|
+
uniqueValues: getFacetedUniqueValues(header().column.id),
|
|
4223
|
+
minMax: getFacetedMinMaxValues(header().column.id),
|
|
4224
|
+
setFilter: setColumnFilter
|
|
4225
|
+
}) ?? <input type="text" aria-label={(0, _rozie_runtime_solid.rozieAttr)("Filter " + headerLabel(header().column.id))} class={"rdt-col-filter"} value={columnFilterValue(header().column.id)} onInput={($event) => {
|
|
4226
|
+
onColumnFilterInput(header().column.id, $event);
|
|
4227
|
+
}} onClick={($event) => {
|
|
4228
|
+
stopEvent($event);
|
|
4229
|
+
}} data-rozie-s-d5dcab4c="" />}
|
|
4125
4230
|
</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>
|
|
4126
4231
|
</tr></Solid_js.Show>}</thead>
|
|
4127
4232
|
|
|
@@ -4137,26 +4242,55 @@ function DataTable(_props) {
|
|
|
4137
4242
|
})} role={(0, _rozie_runtime_solid.rozieAttr)(cellRole())} data-col={(0, _rozie_runtime_solid.rozieAttr)(cell().column.id)} data-grid-cell="" data-row={(0, _rozie_runtime_solid.rozieAttr)(rowIndexOf(row()))} data-col-index={(0, _rozie_runtime_solid.rozieAttr)(colIndexOf(row(), cell()))} tabIndex={(0, _rozie_runtime_solid.rozieAttr)(cellTabindex(String(rowIndexOf(row())), colIndexOf(row(), cell())))} style={(0, _rozie_runtime_solid.parseInlineStyle)(bodyCellStyle(row(), cell().column.id))} aria-invalid={(0, _rozie_runtime_solid.rozieAttr)(cellAriaInvalid(rowIndexOf(row()), colIndexOf(row(), cell())))} data-in-range={(0, _rozie_runtime_solid.rozieAttr)(inRange(rowIndexOf(row()), colIndexOf(row(), cell())) ? "true" : null)} data-agg-cell={(0, _rozie_runtime_solid.rozieAttr)(cellIsAggregated(cell()) ? cell().column.id : null)} data-rozie-s-d5dcab4c="">
|
|
4138
4243
|
|
|
4139
4244
|
{<Solid_js.Show when={isExpanderColumn(cell().column.id)} fallback={<Solid_js.Show when={isSelectColumn(cell().column.id)} fallback={<Solid_js.Show when={cellIsGrouped(cell())} fallback={<Solid_js.Show when={isEditing(rowIndexOf(row()), colIndexOf(row(), cell()))} fallback={<Solid_js.Show when={cellIsPlaceholder(cell())} fallback={<span class={"rdt-cell-value"} data-rozie-s-d5dcab4c="">
|
|
4140
|
-
{
|
|
4245
|
+
{_props.slots?.[`cell-${cell().column.id}`]?.({
|
|
4141
4246
|
columnId: cell().column.id,
|
|
4142
4247
|
column: cell().column,
|
|
4143
|
-
row: row()
|
|
4248
|
+
row: cellSlotRow(row()),
|
|
4249
|
+
value: cell().getValue()
|
|
4250
|
+
}) ?? (_props.cellSlot ?? _props.slots?.["cell"])?.({
|
|
4251
|
+
columnId: cell().column.id,
|
|
4252
|
+
column: cell().column,
|
|
4253
|
+
row: cellSlotRow(row()),
|
|
4144
4254
|
value: cell().getValue()
|
|
4145
4255
|
}) ?? (0, _rozie_runtime_solid.rozieDisplay)(cell().getValue())}
|
|
4146
4256
|
</span>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4147
|
-
{<Solid_js.Show when={
|
|
4257
|
+
{<Solid_js.Show when={editorTypeOf(cell().column.id) === "number"} fallback={<Solid_js.Show when={editorTypeOf(cell().column.id) === "select"} fallback={<Solid_js.Show when={editorTypeOf(cell().column.id) === "checkbox"} fallback={<Solid_js.Show when={editorTypeOf(cell().column.id) === "custom"} fallback={<input type="text" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event) => {
|
|
4258
|
+
onCellEditorInput(cell().column.id, $event);
|
|
4259
|
+
}} onKeyDown={($event) => {
|
|
4260
|
+
onEditorKeyDown($event);
|
|
4261
|
+
}} onBlur={($event) => {
|
|
4262
|
+
onEditorBlur($event);
|
|
4263
|
+
}} data-rozie-s-d5dcab4c="" />}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4264
|
+
{_props.slots?.[`editor-${cell().column.id}`]?.({
|
|
4265
|
+
columnId: cell().column.id,
|
|
4266
|
+
column: cell().column,
|
|
4267
|
+
row: cellSlotRow(row()),
|
|
4268
|
+
value: editorValueFor(cell().column.id),
|
|
4269
|
+
commit: editorCommitFor(cell().column.id),
|
|
4270
|
+
cancel: editorCancelFor(),
|
|
4271
|
+
autofocus: editorAutofocusFor(cell().column.id, rowIndexOf(row()))
|
|
4272
|
+
}) ?? (_props.editorSlot ?? _props.slots?.["editor"])?.({
|
|
4273
|
+
columnId: cell().column.id,
|
|
4274
|
+
column: cell().column,
|
|
4275
|
+
row: cellSlotRow(row()),
|
|
4276
|
+
value: editorValueFor(cell().column.id),
|
|
4277
|
+
commit: editorCommitFor(cell().column.id),
|
|
4278
|
+
cancel: editorCancelFor(),
|
|
4279
|
+
autofocus: editorAutofocusFor(cell().column.id, rowIndexOf(row()))
|
|
4280
|
+
}) ?? <input type="text" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event) => {
|
|
4148
4281
|
onCellEditorInput(cell().column.id, $event);
|
|
4149
4282
|
}} onKeyDown={($event) => {
|
|
4150
4283
|
onEditorKeyDown($event);
|
|
4151
4284
|
}} onBlur={($event) => {
|
|
4152
4285
|
onEditorBlur($event);
|
|
4153
|
-
}} data-rozie-s-d5dcab4c="" />}
|
|
4286
|
+
}} data-rozie-s-d5dcab4c="" />}
|
|
4287
|
+
</span></Solid_js.Show>}><input type="checkbox" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} checked={editorCheckedFor(cell().column.id)} onChange={($event) => {
|
|
4154
4288
|
onCellEditorCheckbox(cell().column.id, $event);
|
|
4155
4289
|
}} onKeyDown={($event) => {
|
|
4156
4290
|
onEditorKeyDown($event);
|
|
4157
4291
|
}} onBlur={($event) => {
|
|
4158
4292
|
onEditorBlur($event);
|
|
4159
|
-
}} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}><select data-editing-cell="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onChange={($event) => {
|
|
4293
|
+
}} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}><select data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onChange={($event) => {
|
|
4160
4294
|
onCellEditorInput(cell().column.id, $event);
|
|
4161
4295
|
}} onKeyDown={($event) => {
|
|
4162
4296
|
onEditorKeyDown($event);
|
|
@@ -4164,38 +4298,33 @@ function DataTable(_props) {
|
|
|
4164
4298
|
onEditorBlur($event);
|
|
4165
4299
|
}} data-rozie-s-d5dcab4c="">
|
|
4166
4300
|
<_solid_primitives_keyed.Key each={editorOptionsOf(cell().column.id)} by={(opt) => opt.value}>{(opt) => <option value={(0, _rozie_runtime_solid.rozieAttr)(opt().value)} data-rozie-s-d5dcab4c="">{(0, _rozie_runtime_solid.rozieDisplay)(opt().label)}</option>}</_solid_primitives_keyed.Key>
|
|
4167
|
-
</select></Solid_js.Show>}><input type="number" data-editing-cell="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event) => {
|
|
4301
|
+
</select></Solid_js.Show>}><input type="number" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event) => {
|
|
4168
4302
|
onCellEditorInput(cell().column.id, $event);
|
|
4169
4303
|
}} onKeyDown={($event) => {
|
|
4170
4304
|
onEditorKeyDown($event);
|
|
4171
4305
|
}} onBlur={($event) => {
|
|
4172
4306
|
onEditorBlur($event);
|
|
4173
|
-
}} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4174
|
-
{(_props.editorSlot ?? _props.slots?.["editor"])?.({
|
|
4175
|
-
columnId: cell().column.id,
|
|
4176
|
-
column: cell().column,
|
|
4177
|
-
row: row().original,
|
|
4178
|
-
value: editorValueFor(cell().column.id),
|
|
4179
|
-
commit: editorCommitFor(cell().column.id),
|
|
4180
|
-
cancel: editorCancelFor(),
|
|
4181
|
-
autofocus: editorAutofocusFor(cell().column.id, rowIndexOf(row()))
|
|
4182
|
-
})}
|
|
4183
|
-
</span></Solid_js.Show>}</span></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4307
|
+
}} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}</span></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4184
4308
|
<button type="button" data-expander="" aria-expanded={!!rowIsExpanded(row())} aria-label={(0, _rozie_runtime_solid.rozieAttr)(rowIsExpanded(row()) ? "Collapse group" : "Expand group")} class={"rdt-expander rdt-group-toggle"} onClick={($event) => {
|
|
4185
4309
|
onToggleExpand(row(), $event);
|
|
4186
4310
|
}} data-rozie-s-d5dcab4c="">{(0, _rozie_runtime_solid.rozieDisplay)(rowIsExpanded(row()) ? "▾" : "▸")}</button>
|
|
4187
4311
|
<span class={"rdt-group-value"} data-rozie-s-d5dcab4c="">
|
|
4188
|
-
{
|
|
4312
|
+
{_props.slots?.[`cell-${cell().column.id}`]?.({
|
|
4189
4313
|
columnId: cell().column.id,
|
|
4190
4314
|
column: cell().column,
|
|
4191
|
-
row: row()
|
|
4315
|
+
row: cellSlotRow(row()),
|
|
4316
|
+
value: cell().getValue()
|
|
4317
|
+
}) ?? (_props.cellSlot ?? _props.slots?.["cell"])?.({
|
|
4318
|
+
columnId: cell().column.id,
|
|
4319
|
+
column: cell().column,
|
|
4320
|
+
row: cellSlotRow(row()),
|
|
4192
4321
|
value: cell().getValue()
|
|
4193
4322
|
}) ?? (0, _rozie_runtime_solid.rozieDisplay)(cell().getValue())}
|
|
4194
4323
|
</span>
|
|
4195
4324
|
<span class={"rdt-group-count"} data-rozie-s-d5dcab4c="">{(0, _rozie_runtime_solid.rozieDisplay)("(" + groupSubRowCount(row()) + ")")}</span>
|
|
4196
4325
|
</span></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4197
4326
|
{(_props.selectCellSlot ?? _props.slots?.["selectCell"])?.({
|
|
4198
|
-
row: row()
|
|
4327
|
+
row: cellSlotRow(row()),
|
|
4199
4328
|
checked: rowIsSelected(row()),
|
|
4200
4329
|
toggle: (e) => onToggleRow(row(), e)
|
|
4201
4330
|
}) ?? <input type="checkbox" aria-label="Select row" class={"rdt-select-row"} checked={rowIsSelected(row())} onChange={($event) => {
|
|
@@ -4240,11 +4369,15 @@ function DataTable(_props) {
|
|
|
4240
4369
|
"rdt-expander-th": isExpanderColumn(wh().header.column.id),
|
|
4241
4370
|
"rdt-th-resizing": columnIsResizing(wh().header.column.id),
|
|
4242
4371
|
"rdt-cell-active": isActiveCell("__header", headerColIndexOf(hg(), wh().header), hgLevel())
|
|
4243
|
-
})} 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
|
|
4372
|
+
})} 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))} data-rozie-s-d5dcab4c="">
|
|
4244
4373
|
{<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="">
|
|
4245
4374
|
{<Solid_js.Show when={wh().header.column.getCanSort && wh().header.column.getCanSort()} fallback={<span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4246
4375
|
<span class={"rdt-header-label"} data-rozie-s-d5dcab4c="">
|
|
4247
|
-
{
|
|
4376
|
+
{_props.slots?.[`colHeader-${wh().header.column.id}`]?.({
|
|
4377
|
+
columnId: wh().header.column.id,
|
|
4378
|
+
column: wh().header.column,
|
|
4379
|
+
label: headerLabel(wh().header.column.id)
|
|
4380
|
+
}) ?? (_props.colHeaderSlot ?? _props.slots?.["colHeader"])?.({
|
|
4248
4381
|
columnId: wh().header.column.id,
|
|
4249
4382
|
column: wh().header.column,
|
|
4250
4383
|
label: headerLabel(wh().header.column.id)
|
|
@@ -4254,7 +4387,11 @@ function DataTable(_props) {
|
|
|
4254
4387
|
onHeaderSort(wh().header.column.id, $event);
|
|
4255
4388
|
}} data-rozie-s-d5dcab4c="">
|
|
4256
4389
|
<span class={"rdt-header-label"} data-rozie-s-d5dcab4c="">
|
|
4257
|
-
{
|
|
4390
|
+
{_props.slots?.[`colHeader-${wh().header.column.id}`]?.({
|
|
4391
|
+
columnId: wh().header.column.id,
|
|
4392
|
+
column: wh().header.column,
|
|
4393
|
+
label: headerLabel(wh().header.column.id)
|
|
4394
|
+
}) ?? (_props.colHeaderSlot ?? _props.slots?.["colHeader"])?.({
|
|
4258
4395
|
columnId: wh().header.column.id,
|
|
4259
4396
|
column: wh().header.column,
|
|
4260
4397
|
label: headerLabel(wh().header.column.id)
|
|
@@ -4298,18 +4435,24 @@ function DataTable(_props) {
|
|
|
4298
4435
|
{<Solid_js.Show when={hasAnyFilterableColumn()}><tr class={"rdt-filter-row"} data-rozie-s-d5dcab4c="">
|
|
4299
4436
|
{<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="">
|
|
4300
4437
|
{<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="">
|
|
4301
|
-
{<Solid_js.Show when={columnIsFilterable(wh().header.column.id)
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4438
|
+
{<Solid_js.Show when={columnIsFilterable(wh().header.column.id)}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4439
|
+
{_props.slots?.[`filter-${wh().header.column.id}`]?.({
|
|
4440
|
+
columnId: wh().header.column.id,
|
|
4441
|
+
value: columnFilterValue(wh().header.column.id),
|
|
4442
|
+
uniqueValues: getFacetedUniqueValues(wh().header.column.id),
|
|
4443
|
+
minMax: getFacetedMinMaxValues(wh().header.column.id),
|
|
4444
|
+
setFilter: setColumnFilter
|
|
4445
|
+
}) ?? (_props.filterSlot ?? _props.slots?.["filter"])?.({
|
|
4307
4446
|
columnId: wh().header.column.id,
|
|
4308
4447
|
value: columnFilterValue(wh().header.column.id),
|
|
4309
4448
|
uniqueValues: getFacetedUniqueValues(wh().header.column.id),
|
|
4310
4449
|
minMax: getFacetedMinMaxValues(wh().header.column.id),
|
|
4311
4450
|
setFilter: setColumnFilter
|
|
4312
|
-
})}
|
|
4451
|
+
}) ?? <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) => {
|
|
4452
|
+
onColumnFilterInput(wh().header.column.id, $event);
|
|
4453
|
+
}} onClick={($event) => {
|
|
4454
|
+
stopEvent($event);
|
|
4455
|
+
}} data-rozie-s-d5dcab4c="" />}
|
|
4313
4456
|
</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>
|
|
4314
4457
|
{<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>
|
|
4315
4458
|
|
|
@@ -4333,26 +4476,55 @@ function DataTable(_props) {
|
|
|
4333
4476
|
})} role={(0, _rozie_runtime_solid.rozieAttr)(cellRole())} data-col={(0, _rozie_runtime_solid.rozieAttr)(cell().column.id)} data-grid-cell="" data-row={(0, _rozie_runtime_solid.rozieAttr)(wr().vi.index)} data-col-index={(0, _rozie_runtime_solid.rozieAttr)(colIndexOf(wr().row, cell()))} tabIndex={(0, _rozie_runtime_solid.rozieAttr)(cellTabindex(String(wr().vi.index), colIndexOf(wr().row, cell())))} style={(0, _rozie_runtime_solid.parseInlineStyle)(bodyCellStyle(wr().row, cell().column.id))} aria-invalid={(0, _rozie_runtime_solid.rozieAttr)(cellAriaInvalid(wr().vi.index, colIndexOf(wr().row, cell())))} data-in-range={(0, _rozie_runtime_solid.rozieAttr)(inRange(wr().vi.index, colIndexOf(wr().row, cell())) ? "true" : null)} data-agg-cell={(0, _rozie_runtime_solid.rozieAttr)(cellIsAggregated(cell()) ? cell().column.id : null)} data-rozie-s-d5dcab4c="">
|
|
4334
4477
|
|
|
4335
4478
|
{<Solid_js.Show when={isExpanderColumn(cell().column.id)} fallback={<Solid_js.Show when={isSelectColumn(cell().column.id)} fallback={<Solid_js.Show when={cellIsGrouped(cell())} fallback={<Solid_js.Show when={isEditing(wr().vi.index, colIndexOf(wr().row, cell()))} fallback={<Solid_js.Show when={cellIsPlaceholder(cell())} fallback={<span class={"rdt-cell-value"} data-rozie-s-d5dcab4c="">
|
|
4336
|
-
{
|
|
4479
|
+
{_props.slots?.[`cell-${cell().column.id}`]?.({
|
|
4480
|
+
columnId: cell().column.id,
|
|
4481
|
+
column: cell().column,
|
|
4482
|
+
row: cellSlotRow(wr().row),
|
|
4483
|
+
value: cell().getValue()
|
|
4484
|
+
}) ?? (_props.cellSlot ?? _props.slots?.["cell"])?.({
|
|
4337
4485
|
columnId: cell().column.id,
|
|
4338
4486
|
column: cell().column,
|
|
4339
|
-
row: wr().row
|
|
4487
|
+
row: cellSlotRow(wr().row),
|
|
4340
4488
|
value: cell().getValue()
|
|
4341
4489
|
}) ?? (0, _rozie_runtime_solid.rozieDisplay)(cell().getValue())}
|
|
4342
4490
|
</span>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4343
|
-
{<Solid_js.Show when={
|
|
4491
|
+
{<Solid_js.Show when={editorTypeOf(cell().column.id) === "number"} fallback={<Solid_js.Show when={editorTypeOf(cell().column.id) === "select"} fallback={<Solid_js.Show when={editorTypeOf(cell().column.id) === "checkbox"} fallback={<Solid_js.Show when={editorTypeOf(cell().column.id) === "custom"} fallback={<input type="text" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event) => {
|
|
4492
|
+
onCellEditorInput(cell().column.id, $event);
|
|
4493
|
+
}} onKeyDown={($event) => {
|
|
4494
|
+
onEditorKeyDown($event);
|
|
4495
|
+
}} onBlur={($event) => {
|
|
4496
|
+
onEditorBlur($event);
|
|
4497
|
+
}} data-rozie-s-d5dcab4c="" />}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4498
|
+
{_props.slots?.[`editor-${cell().column.id}`]?.({
|
|
4499
|
+
columnId: cell().column.id,
|
|
4500
|
+
column: cell().column,
|
|
4501
|
+
row: cellSlotRow(wr().row),
|
|
4502
|
+
value: editorValueFor(cell().column.id),
|
|
4503
|
+
commit: editorCommitFor(cell().column.id),
|
|
4504
|
+
cancel: editorCancelFor(),
|
|
4505
|
+
autofocus: editorAutofocusFor(cell().column.id, wr().vi.index)
|
|
4506
|
+
}) ?? (_props.editorSlot ?? _props.slots?.["editor"])?.({
|
|
4507
|
+
columnId: cell().column.id,
|
|
4508
|
+
column: cell().column,
|
|
4509
|
+
row: cellSlotRow(wr().row),
|
|
4510
|
+
value: editorValueFor(cell().column.id),
|
|
4511
|
+
commit: editorCommitFor(cell().column.id),
|
|
4512
|
+
cancel: editorCancelFor(),
|
|
4513
|
+
autofocus: editorAutofocusFor(cell().column.id, wr().vi.index)
|
|
4514
|
+
}) ?? <input type="text" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event) => {
|
|
4344
4515
|
onCellEditorInput(cell().column.id, $event);
|
|
4345
4516
|
}} onKeyDown={($event) => {
|
|
4346
4517
|
onEditorKeyDown($event);
|
|
4347
4518
|
}} onBlur={($event) => {
|
|
4348
4519
|
onEditorBlur($event);
|
|
4349
|
-
}} data-rozie-s-d5dcab4c="" />}
|
|
4520
|
+
}} data-rozie-s-d5dcab4c="" />}
|
|
4521
|
+
</span></Solid_js.Show>}><input type="checkbox" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} checked={editorCheckedFor(cell().column.id)} onChange={($event) => {
|
|
4350
4522
|
onCellEditorCheckbox(cell().column.id, $event);
|
|
4351
4523
|
}} onKeyDown={($event) => {
|
|
4352
4524
|
onEditorKeyDown($event);
|
|
4353
4525
|
}} onBlur={($event) => {
|
|
4354
4526
|
onEditorBlur($event);
|
|
4355
|
-
}} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}><select data-editing-cell="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onChange={($event) => {
|
|
4527
|
+
}} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}><select data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onChange={($event) => {
|
|
4356
4528
|
onCellEditorInput(cell().column.id, $event);
|
|
4357
4529
|
}} onKeyDown={($event) => {
|
|
4358
4530
|
onEditorKeyDown($event);
|
|
@@ -4360,38 +4532,33 @@ function DataTable(_props) {
|
|
|
4360
4532
|
onEditorBlur($event);
|
|
4361
4533
|
}} data-rozie-s-d5dcab4c="">
|
|
4362
4534
|
<_solid_primitives_keyed.Key each={editorOptionsOf(cell().column.id)} by={(opt) => opt.value}>{(opt) => <option value={(0, _rozie_runtime_solid.rozieAttr)(opt().value)} data-rozie-s-d5dcab4c="">{(0, _rozie_runtime_solid.rozieDisplay)(opt().label)}</option>}</_solid_primitives_keyed.Key>
|
|
4363
|
-
</select></Solid_js.Show>}><input type="number" data-editing-cell="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event) => {
|
|
4535
|
+
</select></Solid_js.Show>}><input type="number" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event) => {
|
|
4364
4536
|
onCellEditorInput(cell().column.id, $event);
|
|
4365
4537
|
}} onKeyDown={($event) => {
|
|
4366
4538
|
onEditorKeyDown($event);
|
|
4367
4539
|
}} onBlur={($event) => {
|
|
4368
4540
|
onEditorBlur($event);
|
|
4369
|
-
}} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4370
|
-
{(_props.editorSlot ?? _props.slots?.["editor"])?.({
|
|
4371
|
-
columnId: cell().column.id,
|
|
4372
|
-
column: cell().column,
|
|
4373
|
-
row: wr().row.original,
|
|
4374
|
-
value: editorValueFor(cell().column.id),
|
|
4375
|
-
commit: editorCommitFor(cell().column.id),
|
|
4376
|
-
cancel: editorCancelFor(),
|
|
4377
|
-
autofocus: editorAutofocusFor(cell().column.id, wr().vi.index)
|
|
4378
|
-
})}
|
|
4379
|
-
</span></Solid_js.Show>}</span></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4541
|
+
}} data-rozie-s-d5dcab4c="" /></Solid_js.Show>}</span></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4380
4542
|
<button type="button" data-expander="" aria-expanded={!!rowIsExpanded(wr().row)} aria-label={(0, _rozie_runtime_solid.rozieAttr)(rowIsExpanded(wr().row) ? "Collapse group" : "Expand group")} class={"rdt-expander rdt-group-toggle"} onClick={($event) => {
|
|
4381
4543
|
onToggleExpand(wr().row, $event);
|
|
4382
4544
|
}} data-rozie-s-d5dcab4c="">{(0, _rozie_runtime_solid.rozieDisplay)(rowIsExpanded(wr().row) ? "▾" : "▸")}</button>
|
|
4383
4545
|
<span class={"rdt-group-value"} data-rozie-s-d5dcab4c="">
|
|
4384
|
-
{
|
|
4546
|
+
{_props.slots?.[`cell-${cell().column.id}`]?.({
|
|
4547
|
+
columnId: cell().column.id,
|
|
4548
|
+
column: cell().column,
|
|
4549
|
+
row: cellSlotRow(wr().row),
|
|
4550
|
+
value: cell().getValue()
|
|
4551
|
+
}) ?? (_props.cellSlot ?? _props.slots?.["cell"])?.({
|
|
4385
4552
|
columnId: cell().column.id,
|
|
4386
4553
|
column: cell().column,
|
|
4387
|
-
row: wr().row
|
|
4554
|
+
row: cellSlotRow(wr().row),
|
|
4388
4555
|
value: cell().getValue()
|
|
4389
4556
|
}) ?? (0, _rozie_runtime_solid.rozieDisplay)(cell().getValue())}
|
|
4390
4557
|
</span>
|
|
4391
4558
|
<span class={"rdt-group-count"} data-rozie-s-d5dcab4c="">{(0, _rozie_runtime_solid.rozieDisplay)("(" + groupSubRowCount(wr().row) + ")")}</span>
|
|
4392
4559
|
</span></Solid_js.Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
4393
4560
|
{(_props.selectCellSlot ?? _props.slots?.["selectCell"])?.({
|
|
4394
|
-
row: wr().row
|
|
4561
|
+
row: cellSlotRow(wr().row),
|
|
4395
4562
|
checked: rowIsSelected(wr().row),
|
|
4396
4563
|
toggle: (e) => onToggleRow(wr().row, e)
|
|
4397
4564
|
}) ?? <input type="checkbox" aria-label="Select row" class={"rdt-select-row"} checked={rowIsSelected(wr().row)} onChange={($event) => {
|