@rozie-ui/data-table-solid 0.3.2 → 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 +175 -90
- package/dist/index.d.cts +40 -11
- package/dist/index.d.mts +40 -11
- package/dist/index.mjs +175 -90
- package/package.json +2 -2
- package/src/DataTable.tsx +177 -102
package/src/DataTable.tsx
CHANGED
|
@@ -353,18 +353,18 @@ interface GroupBarSlotCtx { grouping: any; groupableColumns: any; applyGrouping:
|
|
|
353
353
|
|
|
354
354
|
interface SelectAllSlotCtx { checked: any; indeterminate: any; toggle: any; }
|
|
355
355
|
|
|
356
|
+
interface SelectCellSlotCtx { row: any; checked: any; toggle: any; }
|
|
357
|
+
|
|
358
|
+
interface DetailSlotCtx { row: any; }
|
|
359
|
+
|
|
356
360
|
interface ColHeaderSlotCtx { columnId: any; column: any; label: any; }
|
|
357
361
|
|
|
358
362
|
interface FilterSlotCtx { columnId: any; value: any; uniqueValues: any; minMax: any; setFilter: any; }
|
|
359
363
|
|
|
360
|
-
interface SelectCellSlotCtx { row: any; checked: any; toggle: any; }
|
|
361
|
-
|
|
362
364
|
interface CellSlotCtx { columnId: any; column: any; row: any; value: any; }
|
|
363
365
|
|
|
364
366
|
interface EditorSlotCtx { columnId: any; column: any; row: any; value: any; commit: any; cancel: any; autofocus: any; }
|
|
365
367
|
|
|
366
|
-
interface DetailSlotCtx { row: any; }
|
|
367
|
-
|
|
368
368
|
interface DataTableProps {
|
|
369
369
|
/**
|
|
370
370
|
* The row data — `model: true`, so a committed cell/row edit writes a **fresh** array back through `r-model:data` (uncontrolled fallback `dataDefault`). A stable reference per Rozie's setup-once model — fed directly into table-core (never map/cloned in the watcher).
|
|
@@ -527,13 +527,13 @@ interface DataTableProps {
|
|
|
527
527
|
children?: JSX.Element;
|
|
528
528
|
groupBarSlot?: (ctx: GroupBarSlotCtx) => JSX.Element;
|
|
529
529
|
selectAllSlot?: (ctx: SelectAllSlotCtx) => JSX.Element;
|
|
530
|
+
selectCellSlot?: (ctx: SelectCellSlotCtx) => JSX.Element;
|
|
531
|
+
detailSlot?: (ctx: DetailSlotCtx) => JSX.Element;
|
|
530
532
|
colHeaderSlot?: (ctx: ColHeaderSlotCtx) => JSX.Element;
|
|
531
533
|
filterSlot?: (ctx: FilterSlotCtx) => JSX.Element;
|
|
532
|
-
selectCellSlot?: (ctx: SelectCellSlotCtx) => JSX.Element;
|
|
533
534
|
cellSlot?: (ctx: CellSlotCtx) => JSX.Element;
|
|
534
535
|
editorSlot?: (ctx: EditorSlotCtx) => JSX.Element;
|
|
535
|
-
|
|
536
|
-
slots?: Record<string, (ctx: any) => JSX.Element>;
|
|
536
|
+
slots?: { [key: `colHeader-${string}`]: ((ctx: { columnId: any; column: any; label: any }) => JSX.Element) | undefined; [key: `filter-${string}`]: ((ctx: { columnId: any; value: any; uniqueValues: any; minMax: any; setFilter: any }) => JSX.Element) | undefined; [key: `cell-${string}`]: ((ctx: { columnId: any; column: any; row: any; value: any }) => JSX.Element) | undefined; [key: `editor-${string}`]: ((ctx: { columnId: any; column: any; row: any; value: any; commit: any; cancel: any; autofocus: any }) => JSX.Element) | undefined; [key: string]: ((...args: any[]) => JSX.Element) | undefined; };
|
|
537
537
|
ref?: (h: DataTableHandle) => void;
|
|
538
538
|
}
|
|
539
539
|
|
|
@@ -3102,20 +3102,6 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
3102
3102
|
const m = editMetaOf(colId);
|
|
3103
3103
|
return m && m.editorOptions != null ? m.editorOptions : [];
|
|
3104
3104
|
}
|
|
3105
|
-
// hasEditorSlot: this column routes through the consumer's #editor scoped slot (req-2)
|
|
3106
|
-
// — true only when the column declared editor='custom' AND the consumer actually
|
|
3107
|
-
// provided an #editor slot. Falls through to the built-in editor otherwise (e.g. a
|
|
3108
|
-
// column marked 'custom' with no slot supplied degrades to the text editor, never blank).
|
|
3109
|
-
function hasEditorSlot(colId: any) {
|
|
3110
|
-
return editorTypeOf(colId) === 'custom' && !!(_props.editorSlot ?? _props.slots?.["editor"]);
|
|
3111
|
-
}
|
|
3112
|
-
|
|
3113
|
-
// hasFilterSlot: the consumer supplied a #filter scoped slot, so it OWNS the per-column
|
|
3114
|
-
// filter UI (re-added in 72-05 alongside the dedicated filter row's `<slot name="filter">`
|
|
3115
|
-
// host — see the 72-03 removal note in that plan's SUMMARY for why this was briefly gone).
|
|
3116
|
-
function hasFilterSlot() {
|
|
3117
|
-
return !!(_props.filterSlot ?? _props.slots?.["filter"]);
|
|
3118
|
-
}
|
|
3119
3105
|
function columnIsFilterable(colId: any) {
|
|
3120
3106
|
const d = defFor(colId);
|
|
3121
3107
|
return !!(d && d.filterable);
|
|
@@ -3126,13 +3112,27 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
3126
3112
|
}
|
|
3127
3113
|
|
|
3128
3114
|
// ── Column-management chrome (req-8/9/10/11) ────────────────────────────────────────
|
|
3129
|
-
// Live header width (px) for a
|
|
3130
|
-
//
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3115
|
+
// Live header width (px) for a <th> — drives the :style width binding. Takes the table-core
|
|
3116
|
+
// HEADER object (not a column id / Column lookup) and reads header.getSize() — deliberately,
|
|
3117
|
+
// NOT column.getSize(). table-core's own ColumnSizing feature (createHeader, always present —
|
|
3118
|
+
// it is in table-core's builtInFeatures, never opt-in) gives Header.getSize() a recursive
|
|
3119
|
+
// implementation: a LEAF header returns its own column's getSize() (identical to the old
|
|
3120
|
+
// column.getSize() path — byte-identical output there), but a GROUP header (one with
|
|
3121
|
+
// subHeaders, e.g. a multi-level `columns:` entry from buildConfigDef) SUMS every descendant
|
|
3122
|
+
// leaf column's getSize() instead of returning the group's own meaningless single-column
|
|
3123
|
+
// default (150px, table-core's defaultColumnSizing.size — group ColumnDefs never set `size`).
|
|
3124
|
+
// Before this fix, a colspan-N grouped <th> asked the browser for ONE column's worth of width
|
|
3125
|
+
// (150px) while spanning N columns; under `table-layout:fixed` the browser then divides that
|
|
3126
|
+
// single declared width ACROSS all N spanned <th>s (150/5 = 30px for this codebase's 5-column
|
|
3127
|
+
// "Group A" fixture) — a 5x collapse of the actual rendered column width, independent of (and
|
|
3128
|
+
// invisible to) columnSize()/the column virtualizer's windowing math, which reads
|
|
3129
|
+
// table.getVisibleLeafColumns()[i].getSize() directly and was never affected. Root cause +
|
|
3130
|
+
// fix confirmed via .planning/debug/datatable-d13-column-axis-all-targets.md and previously
|
|
3131
|
+
// documented as "Gap 1" in .planning/phases/87-.../deferred-items.md (the identical grouped-
|
|
3132
|
+
// header/colspan mismatch, found independently during 87-05/87-06 authoring and deferred).
|
|
3133
|
+
function headerWidth(header: any) {
|
|
3134
|
+
if (tick() < 0 || !header || typeof header.getSize !== 'function') return null;
|
|
3135
|
+
const w = header.getSize();
|
|
3136
3136
|
return w != null && w > 0 ? w + 'px' : null;
|
|
3137
3137
|
}
|
|
3138
3138
|
|
|
@@ -3249,15 +3249,18 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
3249
3249
|
}
|
|
3250
3250
|
return '';
|
|
3251
3251
|
}
|
|
3252
|
-
// Combined inline style for a <th> (width + pin)
|
|
3253
|
-
//
|
|
3254
|
-
//
|
|
3255
|
-
//
|
|
3256
|
-
|
|
3252
|
+
// Combined inline style for a <th> (width + pin). Plain string concat — uniform on all 6, no
|
|
3253
|
+
// bound-object trap. zIndex=2 (see pinStyle) so a pinned header cell — which hosts the ⋯ menu's
|
|
3254
|
+
// floating content — always stacks above the pinned filter-row cell for the same column
|
|
3255
|
+
// (zIndex=1, its own default). Takes the HEADER object (not a bare colId) so headerWidth() can
|
|
3256
|
+
// read header.getSize() — the group-aware size (see headerWidth's own comment). pinStyle still
|
|
3257
|
+
// keys off the plain column id (pinning is a leaf-column-only concern; a grouped header never
|
|
3258
|
+
// pins as a unit in this codebase's model).
|
|
3259
|
+
function thStyle(header: any) {
|
|
3257
3260
|
let s = '';
|
|
3258
|
-
const w = headerWidth(
|
|
3261
|
+
const w = headerWidth(header);
|
|
3259
3262
|
if (w) s += 'width:' + w + ';';
|
|
3260
|
-
s += pinStyle(
|
|
3263
|
+
s += pinStyle(header && header.column ? header.column.id : null, 2);
|
|
3261
3264
|
return s;
|
|
3262
3265
|
}
|
|
3263
3266
|
|
|
@@ -5719,8 +5722,25 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
5719
5722
|
fillEdgeScrollRaf = null;
|
|
5720
5723
|
}
|
|
5721
5724
|
}
|
|
5722
|
-
|
|
5723
|
-
|
|
5725
|
+
// FILL_HITTEST_PROBE_RADIUS_PX / FILL_HITTEST_PROBE_STEP_PX (hardening, authorized alongside the
|
|
5726
|
+
// D-13 grouped-header width fix — .planning/debug/datatable-d13-column-axis-all-targets.md):
|
|
5727
|
+
// resolveCellAt() below hit-tests document.elementFromPoint at ONE exact pixel — structurally
|
|
5728
|
+
// fragile against a scrolling DOM by construction: any narrow column transiting past that fixed
|
|
5729
|
+
// screen point (the edge-auto-scroll rAF loop in fillDrag re-probes the SAME fixed point every
|
|
5730
|
+
// frame while gridScrollEl's content slides underneath it) has only a single-frame-scale window
|
|
5731
|
+
// to be caught, and a probe pixel landing exactly on a border/rounding edge between two adjacent
|
|
5732
|
+
// `<td>`/`<th>`s can miss both. cellIndexFromPoint widens the miss case ONLY: it tries the exact
|
|
5733
|
+
// point first (byte-identical to the pre-hardening behavior on a hit — this is not a behavior
|
|
5734
|
+
// change to the common case) and, only if that misses, fans out a small nearest-first horizontal
|
|
5735
|
+
// search before giving up. Vertical-only misses are not probed (rows are >=24px tall by design —
|
|
5736
|
+
// FILL_EDGE_SCROLL_PX itself — so a row is never narrower than a single scroll step; only COLUMN
|
|
5737
|
+
// width has no such floor, hence a horizontal-only widening).
|
|
5738
|
+
const FILL_HITTEST_PROBE_RADIUS_PX = 8;
|
|
5739
|
+
const FILL_HITTEST_PROBE_STEP_PX = 2;
|
|
5740
|
+
|
|
5741
|
+
// resolveCellAt: the exact-point hit-test (identical logic to the pre-hardening
|
|
5742
|
+
// cellIndexFromPoint body) extracted so it can be re-tried at nearby x-offsets below.
|
|
5743
|
+
function resolveCellAt(clientX: any, clientY: any) {
|
|
5724
5744
|
let el = document.elementFromPoint(clientX, clientY);
|
|
5725
5745
|
// Pierce OPEN shadow roots (Lit): document.elementFromPoint retargets to the shadow HOST, so
|
|
5726
5746
|
// a drag over the Lit data-table's shadow content would otherwise resolve the host (no cell)
|
|
@@ -5745,6 +5765,22 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
5745
5765
|
c
|
|
5746
5766
|
};
|
|
5747
5767
|
}
|
|
5768
|
+
function cellIndexFromPoint(clientX: any, clientY: any) {
|
|
5769
|
+
if (typeof document === 'undefined' || !document.elementFromPoint) return null;
|
|
5770
|
+
const direct = resolveCellAt(clientX, clientY);
|
|
5771
|
+
if (direct) return direct;
|
|
5772
|
+
// Widened nearest-cell search: only reached when the exact point misses. Fans outward
|
|
5773
|
+
// (nearest-first, alternating +/-x) up to FILL_HITTEST_PROBE_RADIUS_PX before giving up —
|
|
5774
|
+
// catches a narrow column that transited past the fixed probe point on this exact frame
|
|
5775
|
+
// without changing which cell wins on an ordinary (non-edge-case) hit.
|
|
5776
|
+
for (let d = FILL_HITTEST_PROBE_STEP_PX; d <= FILL_HITTEST_PROBE_RADIUS_PX; d += FILL_HITTEST_PROBE_STEP_PX) {
|
|
5777
|
+
const right = resolveCellAt(clientX + d, clientY);
|
|
5778
|
+
if (right) return right;
|
|
5779
|
+
const left = resolveCellAt(clientX - d, clientY);
|
|
5780
|
+
if (left) return left;
|
|
5781
|
+
}
|
|
5782
|
+
return null;
|
|
5783
|
+
}
|
|
5748
5784
|
function onFillHandlePointerDown(e: any) {
|
|
5749
5785
|
if (!e) return;
|
|
5750
5786
|
if (e.preventDefault) e.preventDefault();
|
|
@@ -6069,39 +6105,73 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
6069
6105
|
return row ? row.id : null;
|
|
6070
6106
|
}
|
|
6071
6107
|
|
|
6108
|
+
// resolveEditFocusCellEl(rowIndex, colIndex): the DOM cell element for an edit-focus
|
|
6109
|
+
// target, given an EXPLICIT index pair — NEVER a $data re-read inside this function or its
|
|
6110
|
+
// caller's poll closure. Every call site already knows this pair SYNCHRONOUSLY at the
|
|
6111
|
+
// moment it calls (beginEdit's own rowIndex/colIndex params; commitEdit's stable, already-
|
|
6112
|
+
// settled $data.editingRow/editingCol; beginRowEdit's rowIndex + the target column's
|
|
6113
|
+
// editable[].colIndex from editableColumnsForRow) — threading them through as PARAMETERS,
|
|
6114
|
+
// mirroring focusRowEditorAt's already-proven resolveCellEl(String(rowIndex), colIndex)
|
|
6115
|
+
// shape, closes the React batched-setState staleness class 88-05-SUMMARY.md documented
|
|
6116
|
+
// (REACT_STALE_GATE_SINGLE_CELL_BUG): the OLD gate read $data.editFocusColId SYNCHRONOUSLY,
|
|
6117
|
+
// in the SAME tick beginEdit's own setState call set it, and React's batching meant that
|
|
6118
|
+
// read saw the PRE-edit (null) value. A plain function argument threaded through — never a
|
|
6119
|
+
// reactive re-read — is not subject to that race, uniformly on all 6 targets.
|
|
6120
|
+
function resolveEditFocusCellEl(rowIndex: any, colIndex: any) {
|
|
6121
|
+
if (rowIndex == null || colIndex == null || rowIndex < 0 || colIndex < 0) return null;
|
|
6122
|
+
return resolveCellEl(String(rowIndex), colIndex);
|
|
6123
|
+
}
|
|
6124
|
+
|
|
6072
6125
|
// Focus the freshly-mounted editor (Pitfall 1, ROZ123): after beginEdit flips the editing
|
|
6073
6126
|
// state, the editor <input> does not exist until the framework commits the r-if branch
|
|
6074
|
-
// (React setState async; Solid/Lit/Svelte next reactive tick). Poll for the
|
|
6075
|
-
//
|
|
6076
|
-
//
|
|
6127
|
+
// (React setState async; Solid/Lit/Svelte next reactive tick). Poll for the target CELL's
|
|
6128
|
+
// marked built-in editor for ~30 frames — the five fast targets resolve on attempt 1, React
|
|
6129
|
+
// retries across its async commit. NEVER read $refs eagerly.
|
|
6077
6130
|
// B2: selectAll gates the post-focus el.select(). Select-all is right when entering
|
|
6078
6131
|
// edit IN PLACE (F2/Enter/click/row-edit/validation-reject — no seeded char, the user
|
|
6079
6132
|
// retypes), but WRONG on a type-to-edit entry where a printable key already seeded the
|
|
6080
6133
|
// draft (selecting the seeded char makes the next keystroke replace it: Zeta → eta).
|
|
6081
6134
|
// beginEdit threads `seed == null` so a seeded entry skips the select and the caret sits
|
|
6082
6135
|
// AFTER the seeded char; every other caller keeps the default select-all.
|
|
6083
|
-
//
|
|
6084
|
-
//
|
|
6085
|
-
//
|
|
6086
|
-
//
|
|
6087
|
-
//
|
|
6088
|
-
//
|
|
6089
|
-
//
|
|
6090
|
-
|
|
6136
|
+
// D-01/D-02 (88-07): REPLACES the deleted presence-check early-return gate AND the
|
|
6137
|
+
// gridRoot-wide `[data-editing-cell]` first-match query with a column-scoped, marker-driven
|
|
6138
|
+
// poll. Resolves the TARGET cell first (resolveEditFocusCellEl, mirroring
|
|
6139
|
+
// focusRowEditorAt's already-shipped two-step resolve), then queries for an editor carrying
|
|
6140
|
+
// BOTH `data-editing-cell` and the host-owned `data-builtin-editor` marker WITHIN that one
|
|
6141
|
+
// cell — "no marker found" (a drop-in target, D-01) bails immediately rather than reaching
|
|
6142
|
+
// into DOM the host does not own; "no editor at all yet" keeps polling (the framework hasn't
|
|
6143
|
+
// committed the r-if branch). This closes the D-02 wrong-column hole the old grid-wide query
|
|
6144
|
+
// left open (every editable cell mounts an editor at once in row-edit mode) AND fixes the
|
|
6145
|
+
// React staleness race documented above, as a side effect of no longer reading
|
|
6146
|
+
// $data.editFocusColId anywhere in this function.
|
|
6147
|
+
function focusEditorWhenReady(rowIndex: any, colIndex: any, selectAll = true) {
|
|
6091
6148
|
if (!gridRoot) return;
|
|
6092
|
-
// Editor-owns-focus contract: when the CURRENT focus target is a #editor drop-in, the host
|
|
6093
|
-
// does NOT reach into its DOM — the drop-in self-focuses via its own autofocus prop.
|
|
6094
|
-
if (editFocusColId() != null && hasEditorSlot(editFocusColId())) return;
|
|
6095
6149
|
let attempts = 0;
|
|
6096
6150
|
const tryFocus = () => {
|
|
6097
|
-
const
|
|
6151
|
+
const cellEl = resolveEditFocusCellEl(rowIndex, colIndex);
|
|
6152
|
+
const el = cellEl && cellEl.querySelector ? cellEl.querySelector('[data-editing-cell][data-builtin-editor]') : null;
|
|
6153
|
+
if (!el) {
|
|
6154
|
+
// Editor-owns-focus contract (quick 260711-i5m, D-01): if the cell ALREADY holds an
|
|
6155
|
+
// editor that carries only the base marker, it's a consumer drop-in — it owns its own
|
|
6156
|
+
// focus (EditorText's own $onMount + reactive `autofocus`). Bail immediately, zero
|
|
6157
|
+
// wasted frames, rather than burning the retry ceiling on DOM the host does not own.
|
|
6158
|
+
const anyEditor = cellEl && cellEl.querySelector ? cellEl.querySelector('[data-editing-cell]') : null;
|
|
6159
|
+
if (anyEditor) return;
|
|
6160
|
+
attempts = attempts + 1;
|
|
6161
|
+
if (attempts >= 30) return;
|
|
6162
|
+
if (typeof requestAnimationFrame === 'function') requestAnimationFrame(tryFocus);else setTimeout(tryFocus, 16);
|
|
6163
|
+
return;
|
|
6164
|
+
}
|
|
6098
6165
|
// Do NOT stomp focus a later interaction already placed in a DIFFERENT column's editor of
|
|
6099
6166
|
// this row: focusEditorWhenReady only needs to get focus INTO the (first) freshly-mounted
|
|
6100
6167
|
// editor; if focus already sits in another editable cell, a late rAF re-focus would steal it
|
|
6101
6168
|
// back to the first editor and break row-mode Tab containment (the non-deterministic B21
|
|
6102
6169
|
// focus-theft). Compare the OWNING cell's data-col-index (NOT node identity) so a stale
|
|
6103
6170
|
// SAME-column editor node on Solid's node-replacing re-render still resolves as the target —
|
|
6104
|
-
// a genuinely dropped focus is still recovered.
|
|
6171
|
+
// a genuinely dropped focus is still recovered. Stays BROAD on `data-editing-cell` (NOT
|
|
6172
|
+
// narrowed to the builtin marker, D-02): focus validly placed inside a drop-in must still
|
|
6173
|
+
// count as "already placed" — narrowing this check would let a late rAF poll steal focus
|
|
6174
|
+
// back from a drop-in that legitimately holds it.
|
|
6105
6175
|
const ae = gridRoot && gridRoot.getRootNode ? gridRoot.getRootNode().activeElement : null;
|
|
6106
6176
|
if (ae && el && ae !== el && ae.closest && gridRoot.contains(ae) && ae.hasAttribute && ae.hasAttribute('data-editing-cell')) {
|
|
6107
6177
|
const aeCell = ae.closest('[data-grid-cell]');
|
|
@@ -6110,18 +6180,12 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
6110
6180
|
const elCol = elCell ? elCell.getAttribute('data-col-index') : null;
|
|
6111
6181
|
if (aeCol != null && aeCol !== elCol) return;
|
|
6112
6182
|
}
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
} catch (e: any) {}
|
|
6119
|
-
}
|
|
6120
|
-
return;
|
|
6183
|
+
el.focus();
|
|
6184
|
+
if (selectAll && el.select) {
|
|
6185
|
+
try {
|
|
6186
|
+
el.select();
|
|
6187
|
+
} catch (e: any) {}
|
|
6121
6188
|
}
|
|
6122
|
-
attempts = attempts + 1;
|
|
6123
|
-
if (attempts >= 30) return;
|
|
6124
|
-
if (typeof requestAnimationFrame === 'function') requestAnimationFrame(tryFocus);else setTimeout(tryFocus, 16);
|
|
6125
6189
|
};
|
|
6126
6190
|
if (typeof requestAnimationFrame === 'function') requestAnimationFrame(tryFocus);else setTimeout(tryFocus, 0);
|
|
6127
6191
|
}
|
|
@@ -6176,8 +6240,10 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
6176
6240
|
// from it. Cleared on endEdit.
|
|
6177
6241
|
setEditFocusColId(colId);
|
|
6178
6242
|
// B2: a seeded (type-to-edit) entry must NOT select-all — keep the caret after the
|
|
6179
|
-
// seeded char so subsequent typing appends instead of replacing it.
|
|
6180
|
-
|
|
6243
|
+
// seeded char so subsequent typing appends instead of replacing it. rowIndex/colIndex
|
|
6244
|
+
// are THIS call's own params — passed through directly (D-02), never re-read off
|
|
6245
|
+
// $data.editingRow/editingCol inside the poll.
|
|
6246
|
+
focusEditorWhenReady(rowIndex, colIndex, seed == null);
|
|
6181
6247
|
}
|
|
6182
6248
|
|
|
6183
6249
|
// Return focus to a body cell AFTER the editor unmounts (commit/cancel). The display↔
|
|
@@ -6291,8 +6357,10 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
6291
6357
|
const err = runValidator(colId, newValue, rowOriginal);
|
|
6292
6358
|
if (err !== true) {
|
|
6293
6359
|
// D-01: reject — keep the editor open, announce, re-trap focus, NEVER write the model.
|
|
6360
|
+
// $data.editingRow/editingCol are STABLE here (set by a prior beginEdit call, not this
|
|
6361
|
+
// same tick) — safe to read directly, unlike the deleted $data.editFocusColId gate.
|
|
6294
6362
|
setInvalid(err);
|
|
6295
|
-
focusEditorWhenReady();
|
|
6363
|
+
focusEditorWhenReady(editingRow(), editingCol());
|
|
6296
6364
|
return false;
|
|
6297
6365
|
}
|
|
6298
6366
|
setInvalid('');
|
|
@@ -6453,22 +6521,22 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
6453
6521
|
|
|
6454
6522
|
// B21/B22: focus the row-mode editor at a given VISIBLE col index. In full-row edit every
|
|
6455
6523
|
// editable cell is already mounted as an editor, so this resolves the cell off gridRoot and
|
|
6456
|
-
// focuses its [data-editing-cell] control. Bounded rAF-poll (mirrors
|
|
6457
|
-
// so a React re-render that recreates the input across the focus call
|
|
6458
|
-
// all on text/number editors (a no-op try/catch on select/checkbox).
|
|
6459
|
-
//
|
|
6460
|
-
//
|
|
6461
|
-
//
|
|
6462
|
-
//
|
|
6463
|
-
//
|
|
6524
|
+
// focuses its [data-editing-cell][data-builtin-editor] control. Bounded rAF-poll (mirrors
|
|
6525
|
+
// focusEditorWhenReady) so a React re-render that recreates the input across the focus call
|
|
6526
|
+
// still lands it. select-all on text/number editors (a no-op try/catch on select/checkbox).
|
|
6527
|
+
// D-01/D-02 (88-07): the old columnIdAt + presence-check early-return gate is DELETED — the
|
|
6528
|
+
// host-owned data-builtin-editor marker replaces it. If the resolved cell already holds an
|
|
6529
|
+
// editor carrying ONLY the base data-editing-cell marker (no builtin marker), that's a
|
|
6530
|
+
// consumer drop-in — bail immediately, it owns its own focus (EditorText's own $onMount +
|
|
6531
|
+
// reactive `autofocus`, which the caller already flips via $data.editFocusColId). This
|
|
6532
|
+
// two-step resolve (resolveCellEl THEN a scoped query within that one cell) was ALREADY
|
|
6533
|
+
// column-scoped and correct — it is the shape focusEditorWhenReady's D-02 rework adopts.
|
|
6464
6534
|
function focusRowEditorAt(rowIndex: any, colIndex: any) {
|
|
6465
6535
|
if (!gridRoot) return;
|
|
6466
|
-
const colId = columnIdAt(rowIndex, colIndex);
|
|
6467
|
-
if (colId != null && hasEditorSlot(colId)) return;
|
|
6468
6536
|
let attempts = 0;
|
|
6469
6537
|
const tryFocus = () => {
|
|
6470
6538
|
const cellEl = resolveCellEl(String(rowIndex), colIndex);
|
|
6471
|
-
const ed = cellEl && cellEl.querySelector ? cellEl.querySelector('[data-editing-cell]') : null;
|
|
6539
|
+
const ed = cellEl && cellEl.querySelector ? cellEl.querySelector('[data-editing-cell][data-builtin-editor]') : null;
|
|
6472
6540
|
if (ed) {
|
|
6473
6541
|
ed.focus();
|
|
6474
6542
|
if (ed.select) {
|
|
@@ -6478,6 +6546,11 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
6478
6546
|
}
|
|
6479
6547
|
return;
|
|
6480
6548
|
}
|
|
6549
|
+
// No marked built-in editor yet in this cell: a drop-in mounted there owns its own
|
|
6550
|
+
// focus — bail immediately (D-02) rather than burning the retry ceiling on DOM the
|
|
6551
|
+
// host does not own. No editor at all yet just means "keep polling."
|
|
6552
|
+
const any = cellEl && cellEl.querySelector ? cellEl.querySelector('[data-editing-cell]') : null;
|
|
6553
|
+
if (any) return;
|
|
6481
6554
|
attempts = attempts + 1;
|
|
6482
6555
|
if (attempts >= 30) return;
|
|
6483
6556
|
if (typeof requestAnimationFrame === 'function') requestAnimationFrame(tryFocus);else setTimeout(tryFocus, 16);
|
|
@@ -6524,9 +6597,11 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
6524
6597
|
// Editor-owns-focus contract (quick 260711-i5m): the row's FIRST editable column is the
|
|
6525
6598
|
// initial focus target — editorAutofocusFor derives the reactive `autofocus` #editor scope
|
|
6526
6599
|
// prop from it (a built-in column is also host-focused below via focusEditorWhenReady; a
|
|
6527
|
-
// drop-in column self-focuses via its own $onMount, gated off the host reach-in
|
|
6600
|
+
// drop-in column self-focuses via its own $onMount, gated off the host reach-in via D-01's
|
|
6601
|
+
// marker). editable[0].colIndex is THIS call's own already-resolved value (D-02) — passed
|
|
6602
|
+
// through directly, never re-read off $data.editFocusColId inside the poll.
|
|
6528
6603
|
setEditFocusColId(editable[0].colId);
|
|
6529
|
-
focusEditorWhenReady();
|
|
6604
|
+
focusEditorWhenReady(rowIndex, editable[0].colIndex);
|
|
6530
6605
|
}
|
|
6531
6606
|
|
|
6532
6607
|
// commitRow(): validate EVERY edited column (D-01 — keep the row open if ANY fails: set
|
|
@@ -7321,19 +7396,19 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
7321
7396
|
</div></Show>}{<Show when={isWindowed()} fallback={<table aria-rowcount={rozieAttr(gridAriaRowCount())} class={"rozie-data-table" + " " + rozieClass({ 'rdt-sticky': local.stickyHeader })} role={rozieAttr(tableRole())} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLTableElement; target: Element }) => { onGridKeyDown($event); }} onFocusIn={($event: FocusEvent & { currentTarget: HTMLTableElement; target: Element }) => { syncActiveFromEvent($event); }} onFocusOut={($event: FocusEvent & { currentTarget: HTMLTableElement; target: Element }) => { onGridFocusOut($event); }} onMouseDown={($event: MouseEvent & { currentTarget: HTMLTableElement; target: Element }) => { onGridMouseDown($event); }} onDblClick={($event: MouseEvent & { currentTarget: HTMLTableElement; target: Element }) => { onGridDblClick($event); }} onClick={($event: MouseEvent & { currentTarget: HTMLTableElement; target: Element }) => { onGridClick($event); }} data-rozie-s-d5dcab4c="">
|
|
7322
7397
|
<thead class={"rdt-thead"} role="rowgroup" data-rozie-s-d5dcab4c="">
|
|
7323
7398
|
<Key each={headerGroups() as readonly any[]} by={(hg) => hg.id}>{(hg, hgLevel) => <tr class={"rdt-tr"} role="row" aria-rowindex={rozieAttr(hgLevel() + 1)} data-rozie-s-d5dcab4c="">
|
|
7324
|
-
<Key each={hg().headers as readonly any[]} by={(header) => header.id}>{(header) => <th class={"rdt-th" + " " + rozieClass({ 'rdt-select-th': isSelectColumn(header().column.id), 'rdt-expander-th': isExpanderColumn(header().column.id), 'rdt-th-resizing': columnIsResizing(header().column.id), 'rdt-cell-active': isActiveCell('__header', headerColIndexOf(hg(), header()), hgLevel()) })} role="columnheader" data-col={rozieAttr(header().column.id)} data-grid-cell="" data-row="__header" data-header-level={rozieAttr(hgLevel())} colSpan={rozieAttr(header().colSpan > 1 ? header().colSpan : null)} data-col-index={rozieAttr(headerColIndexOf(hg(), header()))} tabIndex={rozieAttr(cellTabindex('__header', headerColIndexOf(hg(), header()), hgLevel()))} aria-sort={rozieAttr(ariaSortFor(header().column.id))} style={parseInlineStyle(thStyle(header()
|
|
7399
|
+
<Key each={hg().headers as readonly any[]} by={(header) => header.id}>{(header) => <th class={"rdt-th" + " " + rozieClass({ 'rdt-select-th': isSelectColumn(header().column.id), 'rdt-expander-th': isExpanderColumn(header().column.id), 'rdt-th-resizing': columnIsResizing(header().column.id), 'rdt-cell-active': isActiveCell('__header', headerColIndexOf(hg(), header()), hgLevel()) })} role="columnheader" data-col={rozieAttr(header().column.id)} data-grid-cell="" data-row="__header" data-header-level={rozieAttr(hgLevel())} colSpan={rozieAttr(header().colSpan > 1 ? header().colSpan : null)} data-col-index={rozieAttr(headerColIndexOf(hg(), header()))} tabIndex={rozieAttr(cellTabindex('__header', headerColIndexOf(hg(), header()), hgLevel()))} aria-sort={rozieAttr(ariaSortFor(header().column.id))} style={parseInlineStyle(thStyle(header()))} data-rozie-s-d5dcab4c="">
|
|
7325
7400
|
|
|
7326
7401
|
|
|
7327
7402
|
{<Show when={isSelectColumn(header().column.id)} fallback={<Show when={isExpanderColumn(header().column.id)} fallback={<span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7328
7403
|
|
|
7329
7404
|
{<Show when={header().column.getCanSort && header().column.getCanSort()} fallback={<span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7330
7405
|
<span class={"rdt-header-label"} data-rozie-s-d5dcab4c="">
|
|
7331
|
-
{(_props.colHeaderSlot ?? _props.slots?.['colHeader'])?.({ columnId: header().column.id, column: header().column, label: headerLabel(header().column.id) }) ?? rozieDisplay(headerLabel(header().column.id))}
|
|
7406
|
+
{_props.slots?.[`colHeader-${header().column.id}`]?.({ columnId: header().column.id, column: header().column, label: headerLabel(header().column.id) }) ?? (_props.colHeaderSlot ?? _props.slots?.['colHeader'])?.({ columnId: header().column.id, column: header().column, label: headerLabel(header().column.id) }) ?? rozieDisplay(headerLabel(header().column.id))}
|
|
7332
7407
|
</span>
|
|
7333
7408
|
</span>}><button type="button" class={"rdt-sort-btn"} onClick={($event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => { onHeaderSort(header().column.id, $event); }} data-rozie-s-d5dcab4c="">
|
|
7334
7409
|
|
|
7335
7410
|
<span class={"rdt-header-label"} data-rozie-s-d5dcab4c="">
|
|
7336
|
-
{(_props.colHeaderSlot ?? _props.slots?.['colHeader'])?.({ columnId: header().column.id, column: header().column, label: headerLabel(header().column.id) }) ?? rozieDisplay(headerLabel(header().column.id))}
|
|
7411
|
+
{_props.slots?.[`colHeader-${header().column.id}`]?.({ columnId: header().column.id, column: header().column, label: headerLabel(header().column.id) }) ?? (_props.colHeaderSlot ?? _props.slots?.['colHeader'])?.({ columnId: header().column.id, column: header().column, label: headerLabel(header().column.id) }) ?? rozieDisplay(headerLabel(header().column.id))}
|
|
7337
7412
|
</span>
|
|
7338
7413
|
<span class={"rdt-sort-ind"} aria-hidden="true" data-rozie-s-d5dcab4c="">{rozieDisplay(sortIndicator(header().column.id))}</span>
|
|
7339
7414
|
</button></Show>}<Popover trigger="click" placement="bottom-end" strategy="fixed" offset={4} data-rozie-s-d5dcab4c="" anchorSlot={() => (<>
|
|
@@ -7355,8 +7430,8 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
7355
7430
|
{<Show when={hasAnyFilterableColumn()}><tr class={"rdt-filter-row"} data-rozie-s-d5dcab4c="">
|
|
7356
7431
|
<Key each={headerGroups()[headerGroups().length - 1].headers as readonly any[]} by={(header) => header.id}>{(header) => <th class={"rdt-filter-cell"} role="presentation" style={parseInlineStyle(pinStyle(header().column.id))} data-rozie-s-d5dcab4c="">
|
|
7357
7432
|
{<Show when={isSelectColumn(header().column.id)} fallback={<Show when={isExpanderColumn(header().column.id)} fallback={<span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7358
|
-
{<Show when={columnIsFilterable(header().column.id)
|
|
7359
|
-
{(_props.filterSlot ?? _props.slots?.['filter'])?.({ columnId: header().column.id, value: columnFilterValue(header().column.id), uniqueValues: getFacetedUniqueValues(header().column.id), minMax: getFacetedMinMaxValues(header().column.id), setFilter: setColumnFilter })}
|
|
7433
|
+
{<Show when={columnIsFilterable(header().column.id)}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7434
|
+
{_props.slots?.[`filter-${header().column.id}`]?.({ columnId: header().column.id, value: columnFilterValue(header().column.id), uniqueValues: getFacetedUniqueValues(header().column.id), minMax: getFacetedMinMaxValues(header().column.id), setFilter: setColumnFilter }) ?? (_props.filterSlot ?? _props.slots?.['filter'])?.({ columnId: header().column.id, value: columnFilterValue(header().column.id), uniqueValues: getFacetedUniqueValues(header().column.id), minMax: getFacetedMinMaxValues(header().column.id), setFilter: setColumnFilter }) ?? <input type="text" aria-label={rozieAttr('Filter ' + headerLabel(header().column.id))} class={"rdt-col-filter"} value={columnFilterValue(header().column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onColumnFilterInput(header().column.id, $event); }} onClick={($event: MouseEvent & { currentTarget: HTMLInputElement; target: Element }) => { stopEvent($event); }} data-rozie-s-d5dcab4c="" />}
|
|
7360
7435
|
</span></Show>}</span>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Show>}</th>}</Key>
|
|
7361
7436
|
</tr></Show>}</thead>
|
|
7362
7437
|
|
|
@@ -7367,16 +7442,16 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
7367
7442
|
<Key each={visibleCellsFor(row()) as readonly any[]} by={(cell) => cell.id}>{(cell) => <td class={"rdt-td" + " " + rozieClass({ 'rdt-select-td': isSelectColumn(cell().column.id), 'rdt-expander-td': isExpanderColumn(cell().column.id), 'rdt-in-range': inRange(rowIndexOf(row()), colIndexOf(row(), cell())), 'rdt-cell-active': isActiveCell(String(rowIndexOf(row())), colIndexOf(row(), cell())) })} role={rozieAttr(cellRole())} data-col={rozieAttr(cell().column.id)} data-grid-cell="" data-row={rozieAttr(rowIndexOf(row()))} data-col-index={rozieAttr(colIndexOf(row(), cell()))} tabIndex={rozieAttr(cellTabindex(String(rowIndexOf(row())), colIndexOf(row(), cell())))} style={parseInlineStyle(bodyCellStyle(row(), cell().column.id))} aria-invalid={rozieAttr(cellAriaInvalid(rowIndexOf(row()), colIndexOf(row(), cell())))} data-in-range={rozieAttr(inRange(rowIndexOf(row()), colIndexOf(row(), cell())) ? 'true' : null)} data-agg-cell={rozieAttr(cellIsAggregated(cell()) ? cell().column.id : null)} data-rozie-s-d5dcab4c="">
|
|
7368
7443
|
|
|
7369
7444
|
{<Show when={isExpanderColumn(cell().column.id)} fallback={<Show when={isSelectColumn(cell().column.id)} fallback={<Show when={cellIsGrouped(cell())} fallback={<Show when={isEditing(rowIndexOf(row()), colIndexOf(row(), cell()))} fallback={<Show when={cellIsPlaceholder(cell())} fallback={<span class={"rdt-cell-value"} data-rozie-s-d5dcab4c="">
|
|
7370
|
-
{(_props.cellSlot ?? _props.slots?.['cell'])?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(row()), value: cell().getValue() }) ?? rozieDisplay(cell().getValue())}
|
|
7445
|
+
{_props.slots?.[`cell-${cell().column.id}`]?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(row()), value: cell().getValue() }) ?? (_props.cellSlot ?? _props.slots?.['cell'])?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(row()), value: cell().getValue() }) ?? rozieDisplay(cell().getValue())}
|
|
7371
7446
|
</span>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7372
|
-
{<Show when={
|
|
7447
|
+
{<Show when={editorTypeOf(cell().column.id) === 'number'} fallback={<Show when={editorTypeOf(cell().column.id) === 'select'} fallback={<Show when={editorTypeOf(cell().column.id) === 'checkbox'} fallback={<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: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" />}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7448
|
+
{_props.slots?.[`editor-${cell().column.id}`]?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(row()), value: editorValueFor(cell().column.id), commit: editorCommitFor(cell().column.id), cancel: editorCancelFor(), autofocus: editorAutofocusFor(cell().column.id, rowIndexOf(row())) }) ?? (_props.editorSlot ?? _props.slots?.['editor'])?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(row()), value: editorValueFor(cell().column.id), commit: editorCommitFor(cell().column.id), cancel: editorCancelFor(), autofocus: editorAutofocusFor(cell().column.id, rowIndexOf(row())) }) ?? <input type="text" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" />}
|
|
7449
|
+
</span></Show>}><input type="checkbox" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} checked={editorCheckedFor(cell().column.id)} onChange={($event: Event & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorCheckbox(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" /></Show>}><select data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onChange={($event: Event & { currentTarget: HTMLSelectElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="">
|
|
7373
7450
|
<Key each={editorOptionsOf(cell().column.id) as readonly any[]} by={(opt) => opt.value}>{(opt) => <option value={rozieAttr(opt().value)} data-rozie-s-d5dcab4c="">{rozieDisplay(opt().label)}</option>}</Key>
|
|
7374
|
-
</select></Show>}><input type="number" data-editing-cell="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" /></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7375
|
-
{(_props.editorSlot ?? _props.slots?.['editor'])?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(row()), value: editorValueFor(cell().column.id), commit: editorCommitFor(cell().column.id), cancel: editorCancelFor(), autofocus: editorAutofocusFor(cell().column.id, rowIndexOf(row())) })}
|
|
7376
|
-
</span></Show>}</span></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7451
|
+
</select></Show>}><input type="number" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" /></Show>}</span></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7377
7452
|
<button type="button" data-expander="" aria-expanded={!!rowIsExpanded(row())} aria-label={rozieAttr(rowIsExpanded(row()) ? 'Collapse group' : 'Expand group')} class={"rdt-expander rdt-group-toggle"} onClick={($event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => { onToggleExpand(row(), $event); }} data-rozie-s-d5dcab4c="">{rozieDisplay(rowIsExpanded(row()) ? '▾' : '▸')}</button>
|
|
7378
7453
|
<span class={"rdt-group-value"} data-rozie-s-d5dcab4c="">
|
|
7379
|
-
{(_props.cellSlot ?? _props.slots?.['cell'])?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(row()), value: cell().getValue() }) ?? rozieDisplay(cell().getValue())}
|
|
7454
|
+
{_props.slots?.[`cell-${cell().column.id}`]?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(row()), value: cell().getValue() }) ?? (_props.cellSlot ?? _props.slots?.['cell'])?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(row()), value: cell().getValue() }) ?? rozieDisplay(cell().getValue())}
|
|
7380
7455
|
</span>
|
|
7381
7456
|
<span class={"rdt-group-count"} data-rozie-s-d5dcab4c="">{rozieDisplay('(' + groupSubRowCount(row()) + ')')}</span>
|
|
7382
7457
|
</span></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
@@ -7396,15 +7471,15 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
7396
7471
|
<thead class={"rdt-thead"} role="rowgroup" data-rozie-s-d5dcab4c="">
|
|
7397
7472
|
<Key each={headerGroups() as readonly any[]} by={(hg) => hg.id}>{(hg, hgLevel) => <tr class={"rdt-tr"} role="row" aria-rowindex={rozieAttr(hgLevel() + 1)} data-rozie-s-d5dcab4c="">
|
|
7398
7473
|
|
|
7399
|
-
{<Show when={colsWindowed()}><th class={"rdt-col-spacer"} aria-hidden="true" style={parseInlineStyle('width:' + colPadLeft() + 'px;padding:0;border:0')} data-rozie-s-d5dcab4c="" /></Show>}<Key each={windowedHeadersFor(hg(), hgLevel()) as readonly any[]} by={(wh) => wh.header.id}>{(wh) => <th class={"rdt-th" + " " + rozieClass({ 'rdt-select-th': isSelectColumn(wh().header.column.id), 'rdt-expander-th': isExpanderColumn(wh().header.column.id), 'rdt-th-resizing': columnIsResizing(wh().header.column.id), 'rdt-cell-active': isActiveCell('__header', headerColIndexOf(hg(), wh().header), hgLevel()) })} role="columnheader" data-col={rozieAttr(wh().header.column.id)} data-grid-cell="" data-row="__header" data-header-level={rozieAttr(hgLevel())} colSpan={rozieAttr(wh().span > 1 ? wh().span : null)} data-col-index={rozieAttr(headerColIndexOf(hg(), wh().header))} tabIndex={rozieAttr(cellTabindex('__header', headerColIndexOf(hg(), wh().header), hgLevel()))} aria-sort={rozieAttr(ariaSortFor(wh().header.column.id))} style={parseInlineStyle(thStyle(wh().header
|
|
7474
|
+
{<Show when={colsWindowed()}><th class={"rdt-col-spacer"} aria-hidden="true" style={parseInlineStyle('width:' + colPadLeft() + 'px;padding:0;border:0')} data-rozie-s-d5dcab4c="" /></Show>}<Key each={windowedHeadersFor(hg(), hgLevel()) as readonly any[]} by={(wh) => wh.header.id}>{(wh) => <th class={"rdt-th" + " " + rozieClass({ 'rdt-select-th': isSelectColumn(wh().header.column.id), 'rdt-expander-th': isExpanderColumn(wh().header.column.id), 'rdt-th-resizing': columnIsResizing(wh().header.column.id), 'rdt-cell-active': isActiveCell('__header', headerColIndexOf(hg(), wh().header), hgLevel()) })} role="columnheader" data-col={rozieAttr(wh().header.column.id)} data-grid-cell="" data-row="__header" data-header-level={rozieAttr(hgLevel())} colSpan={rozieAttr(wh().span > 1 ? wh().span : null)} data-col-index={rozieAttr(headerColIndexOf(hg(), wh().header))} tabIndex={rozieAttr(cellTabindex('__header', headerColIndexOf(hg(), wh().header), hgLevel()))} aria-sort={rozieAttr(ariaSortFor(wh().header.column.id))} style={parseInlineStyle(thStyle(wh().header))} data-rozie-s-d5dcab4c="">
|
|
7400
7475
|
{<Show when={isSelectColumn(wh().header.column.id)} fallback={<Show when={isExpanderColumn(wh().header.column.id)} fallback={<span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7401
7476
|
{<Show when={wh().header.column.getCanSort && wh().header.column.getCanSort()} fallback={<span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7402
7477
|
<span class={"rdt-header-label"} data-rozie-s-d5dcab4c="">
|
|
7403
|
-
{(_props.colHeaderSlot ?? _props.slots?.['colHeader'])?.({ columnId: wh().header.column.id, column: wh().header.column, label: headerLabel(wh().header.column.id) }) ?? rozieDisplay(headerLabel(wh().header.column.id))}
|
|
7478
|
+
{_props.slots?.[`colHeader-${wh().header.column.id}`]?.({ columnId: wh().header.column.id, column: wh().header.column, label: headerLabel(wh().header.column.id) }) ?? (_props.colHeaderSlot ?? _props.slots?.['colHeader'])?.({ columnId: wh().header.column.id, column: wh().header.column, label: headerLabel(wh().header.column.id) }) ?? rozieDisplay(headerLabel(wh().header.column.id))}
|
|
7404
7479
|
</span>
|
|
7405
7480
|
</span>}><button type="button" class={"rdt-sort-btn"} onClick={($event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => { onHeaderSort(wh().header.column.id, $event); }} data-rozie-s-d5dcab4c="">
|
|
7406
7481
|
<span class={"rdt-header-label"} data-rozie-s-d5dcab4c="">
|
|
7407
|
-
{(_props.colHeaderSlot ?? _props.slots?.['colHeader'])?.({ columnId: wh().header.column.id, column: wh().header.column, label: headerLabel(wh().header.column.id) }) ?? rozieDisplay(headerLabel(wh().header.column.id))}
|
|
7482
|
+
{_props.slots?.[`colHeader-${wh().header.column.id}`]?.({ columnId: wh().header.column.id, column: wh().header.column, label: headerLabel(wh().header.column.id) }) ?? (_props.colHeaderSlot ?? _props.slots?.['colHeader'])?.({ columnId: wh().header.column.id, column: wh().header.column, label: headerLabel(wh().header.column.id) }) ?? rozieDisplay(headerLabel(wh().header.column.id))}
|
|
7408
7483
|
</span>
|
|
7409
7484
|
<span class={"rdt-sort-ind"} aria-hidden="true" data-rozie-s-d5dcab4c="">{rozieDisplay(sortIndicator(wh().header.column.id))}</span>
|
|
7410
7485
|
</button></Show>}<Popover trigger="click" placement="bottom-end" strategy="fixed" offset={4} data-rozie-s-d5dcab4c="" anchorSlot={() => (<>
|
|
@@ -7426,8 +7501,8 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
7426
7501
|
{<Show when={hasAnyFilterableColumn()}><tr class={"rdt-filter-row"} data-rozie-s-d5dcab4c="">
|
|
7427
7502
|
{<Show when={colsWindowed()}><th class={"rdt-col-spacer"} aria-hidden="true" style={parseInlineStyle('width:' + colPadLeft() + 'px;padding:0;border:0')} data-rozie-s-d5dcab4c="" /></Show>}<Key each={windowedHeadersFor(headerGroups()[headerGroups().length - 1], headerGroups().length - 1) as readonly any[]} by={(wh) => wh.header.id}>{(wh) => <th class={"rdt-filter-cell"} role="presentation" data-col={rozieAttr(wh().header.column.id)} style={parseInlineStyle(pinStyle(wh().header.column.id))} data-rozie-s-d5dcab4c="">
|
|
7428
7503
|
{<Show when={isSelectColumn(wh().header.column.id)} fallback={<Show when={isExpanderColumn(wh().header.column.id)} fallback={<span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7429
|
-
{<Show when={columnIsFilterable(wh().header.column.id)
|
|
7430
|
-
{(_props.filterSlot ?? _props.slots?.['filter'])?.({ columnId: wh().header.column.id, value: columnFilterValue(wh().header.column.id), uniqueValues: getFacetedUniqueValues(wh().header.column.id), minMax: getFacetedMinMaxValues(wh().header.column.id), setFilter: setColumnFilter })}
|
|
7504
|
+
{<Show when={columnIsFilterable(wh().header.column.id)}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7505
|
+
{_props.slots?.[`filter-${wh().header.column.id}`]?.({ columnId: wh().header.column.id, value: columnFilterValue(wh().header.column.id), uniqueValues: getFacetedUniqueValues(wh().header.column.id), minMax: getFacetedMinMaxValues(wh().header.column.id), setFilter: setColumnFilter }) ?? (_props.filterSlot ?? _props.slots?.['filter'])?.({ columnId: wh().header.column.id, value: columnFilterValue(wh().header.column.id), uniqueValues: getFacetedUniqueValues(wh().header.column.id), minMax: getFacetedMinMaxValues(wh().header.column.id), setFilter: setColumnFilter }) ?? <input type="text" aria-label={rozieAttr('Filter ' + headerLabel(wh().header.column.id))} class={"rdt-col-filter"} value={columnFilterValue(wh().header.column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onColumnFilterInput(wh().header.column.id, $event); }} onClick={($event: MouseEvent & { currentTarget: HTMLInputElement; target: Element }) => { stopEvent($event); }} data-rozie-s-d5dcab4c="" />}
|
|
7431
7506
|
</span></Show>}</span>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Show>}</th>}</Key>
|
|
7432
7507
|
{<Show when={colsWindowed()}><th class={"rdt-col-spacer"} aria-hidden="true" style={parseInlineStyle('width:' + colPadRight() + 'px;padding:0;border:0')} data-rozie-s-d5dcab4c="" /></Show>}</tr></Show>}</thead>
|
|
7433
7508
|
|
|
@@ -7443,16 +7518,16 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
7443
7518
|
{<Show when={colsWindowed()}><td class={"rdt-col-spacer"} aria-hidden="true" style={parseInlineStyle('width:' + colPadLeft() + 'px;padding:0;border:0')} data-rozie-s-d5dcab4c="" /></Show>}<Key each={windowedCells(wr().row) as readonly any[]} by={(cell) => cell.id}>{(cell) => <td class={"rdt-td" + " " + rozieClass({ 'rdt-select-td': isSelectColumn(cell().column.id), 'rdt-expander-td': isExpanderColumn(cell().column.id), 'rdt-in-range': inRange(wr().vi.index, colIndexOf(wr().row, cell())), 'rdt-cell-active': isActiveCell(String(wr().vi.index), colIndexOf(wr().row, cell())) })} role={rozieAttr(cellRole())} data-col={rozieAttr(cell().column.id)} data-grid-cell="" data-row={rozieAttr(wr().vi.index)} data-col-index={rozieAttr(colIndexOf(wr().row, cell()))} tabIndex={rozieAttr(cellTabindex(String(wr().vi.index), colIndexOf(wr().row, cell())))} style={parseInlineStyle(bodyCellStyle(wr().row, cell().column.id))} aria-invalid={rozieAttr(cellAriaInvalid(wr().vi.index, colIndexOf(wr().row, cell())))} data-in-range={rozieAttr(inRange(wr().vi.index, colIndexOf(wr().row, cell())) ? 'true' : null)} data-agg-cell={rozieAttr(cellIsAggregated(cell()) ? cell().column.id : null)} data-rozie-s-d5dcab4c="">
|
|
7444
7519
|
|
|
7445
7520
|
{<Show when={isExpanderColumn(cell().column.id)} fallback={<Show when={isSelectColumn(cell().column.id)} fallback={<Show when={cellIsGrouped(cell())} fallback={<Show when={isEditing(wr().vi.index, colIndexOf(wr().row, cell()))} fallback={<Show when={cellIsPlaceholder(cell())} fallback={<span class={"rdt-cell-value"} data-rozie-s-d5dcab4c="">
|
|
7446
|
-
{(_props.cellSlot ?? _props.slots?.['cell'])?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(wr().row), value: cell().getValue() }) ?? rozieDisplay(cell().getValue())}
|
|
7521
|
+
{_props.slots?.[`cell-${cell().column.id}`]?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(wr().row), value: cell().getValue() }) ?? (_props.cellSlot ?? _props.slots?.['cell'])?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(wr().row), value: cell().getValue() }) ?? rozieDisplay(cell().getValue())}
|
|
7447
7522
|
</span>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7448
|
-
{<Show when={
|
|
7523
|
+
{<Show when={editorTypeOf(cell().column.id) === 'number'} fallback={<Show when={editorTypeOf(cell().column.id) === 'select'} fallback={<Show when={editorTypeOf(cell().column.id) === 'checkbox'} fallback={<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: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" />}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7524
|
+
{_props.slots?.[`editor-${cell().column.id}`]?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(wr().row), value: editorValueFor(cell().column.id), commit: editorCommitFor(cell().column.id), cancel: editorCancelFor(), autofocus: editorAutofocusFor(cell().column.id, wr().vi.index) }) ?? (_props.editorSlot ?? _props.slots?.['editor'])?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(wr().row), value: editorValueFor(cell().column.id), commit: editorCommitFor(cell().column.id), cancel: editorCancelFor(), autofocus: editorAutofocusFor(cell().column.id, wr().vi.index) }) ?? <input type="text" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" />}
|
|
7525
|
+
</span></Show>}><input type="checkbox" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} checked={editorCheckedFor(cell().column.id)} onChange={($event: Event & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorCheckbox(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" /></Show>}><select data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onChange={($event: Event & { currentTarget: HTMLSelectElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="">
|
|
7449
7526
|
<Key each={editorOptionsOf(cell().column.id) as readonly any[]} by={(opt) => opt.value}>{(opt) => <option value={rozieAttr(opt().value)} data-rozie-s-d5dcab4c="">{rozieDisplay(opt().label)}</option>}</Key>
|
|
7450
|
-
</select></Show>}><input type="number" data-editing-cell="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" /></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7451
|
-
{(_props.editorSlot ?? _props.slots?.['editor'])?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(wr().row), value: editorValueFor(cell().column.id), commit: editorCommitFor(cell().column.id), cancel: editorCancelFor(), autofocus: editorAutofocusFor(cell().column.id, wr().vi.index) })}
|
|
7452
|
-
</span></Show>}</span></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7527
|
+
</select></Show>}><input type="number" data-editing-cell="" data-builtin-editor="" class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" /></Show>}</span></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|
|
7453
7528
|
<button type="button" data-expander="" aria-expanded={!!rowIsExpanded(wr().row)} aria-label={rozieAttr(rowIsExpanded(wr().row) ? 'Collapse group' : 'Expand group')} class={"rdt-expander rdt-group-toggle"} onClick={($event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => { onToggleExpand(wr().row, $event); }} data-rozie-s-d5dcab4c="">{rozieDisplay(rowIsExpanded(wr().row) ? '▾' : '▸')}</button>
|
|
7454
7529
|
<span class={"rdt-group-value"} data-rozie-s-d5dcab4c="">
|
|
7455
|
-
{(_props.cellSlot ?? _props.slots?.['cell'])?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(wr().row), value: cell().getValue() }) ?? rozieDisplay(cell().getValue())}
|
|
7530
|
+
{_props.slots?.[`cell-${cell().column.id}`]?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(wr().row), value: cell().getValue() }) ?? (_props.cellSlot ?? _props.slots?.['cell'])?.({ columnId: cell().column.id, column: cell().column, row: cellSlotRow(wr().row), value: cell().getValue() }) ?? rozieDisplay(cell().getValue())}
|
|
7456
7531
|
</span>
|
|
7457
7532
|
<span class={"rdt-group-count"} data-rozie-s-d5dcab4c="">{rozieDisplay('(' + groupSubRowCount(wr().row) + ')')}</span>
|
|
7458
7533
|
</span></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
|