@rozie-ui/data-table-solid 0.6.0 → 0.7.1
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 +2 -0
- package/dist/index.cjs +9 -0
- package/dist/index.d.cts +22 -17
- package/dist/index.d.mts +22 -17
- package/dist/index.mjs +9 -0
- package/dist/source/index.jsx +9 -0
- package/package.json +3 -3
- package/src/DataTable.tsx +51 -18
- package/src/index.ts +1 -1
package/README.md
CHANGED
|
@@ -545,6 +545,8 @@ Beyond props, the component exposes imperative methods (declared once in the Roz
|
|
|
545
545
|
| `focusCell` | Move + focus the active cell (grid interaction mode) — `focusCell(rowIndex, colIndex)`. `rowIndex` is the ABSOLUTE display-order position in `getPrePaginationRowModel().rows` (filter+sort+expand applied, BEFORE pagination/windowing), in BOTH paginated and virtual modes: a paginated `focusCell(abs)` switches to `Math.floor(abs/pageSize)` then focuses; a virtual `focusCell(abs)` scrolls-then-focuses. Args coerced to integers + clamped to bounds. Fires `activecell-change` with the absolute `rowIndex`. (Named `focusCell`, not `focus`: a bare `focus` verb shadows the inherited `HTMLElement.focus` on Lit — ROZ137.) |
|
|
546
546
|
| `getActiveCell` | Return the current active-cell position — `getActiveCell()` → `{ rowIndex, colIndex, isHeader }`. For a body cell `rowIndex` is the ABSOLUTE display-order index (matching `focusCell` / `activecell-change`) and `isHeader` is `false`; for a header-active cell `rowIndex` is `null` and `isHeader` is `true` (integers only — no row data, no DOM node). |
|
|
547
547
|
| `clearActiveCell` | Reset the roving active-cell position to the entry cell and exit interaction mode — `clearActiveCell()`. The next Tab-in re-enters at the entry cell. (Named `clearActiveCell`, not `clear`: distinct from the listbox `clear` selection verb.) |
|
|
548
|
+
| `scrollToRow` | Scroll a row into view on a `virtual` table — `scrollToRow(index, options?)` where `options` mirrors TanStack virtual-core's own `ScrollToOptions` (`{ align?: 'start'|'center'|'end'|'auto', behavior?: 'auto'|'smooth'|'instant' }`) and is forwarded UNCHANGED to `virtualizer.scrollToIndex`. INDEPENDENT of grid-mode focus: never moves the roving active cell and never fires `activecell-change`, callable in either `interactionMode`. `index` is coerced to an integer (never range-clamped here — virtual-core's own `scrollToIndex` already clamps to `[0, options.count-1]`). A no-op when rows are not windowed (`virtual` off, or `'columns'`-only). |
|
|
549
|
+
| `getScrollElement` | Return the scroll-container DOM node the row and column virtualizer(s) observe — `getScrollElement()` → `HTMLElement | null`. The supported replacement for reaching into the internal `.rdt-scroll` class selector. Returns `null` when nothing is windowed. |
|
|
548
550
|
| `getRowIndexRelativeToPage` | Convert an ABSOLUTE display-order row index (the `focusCell` / `getActiveCell` / `activecell-change` space) to the PAGE-RELATIVE index — `getRowIndexRelativeToPage(absRow?)` → `number`. With no argument it converts the current active cell (`abs - pageIndex*pageSize`). In virtual mode (no pagination) it returns the absolute index unchanged. Mirrors MUI `getRowIndexRelativeToVisibleRows`. (Named `getRowIndexRelativeToPage`: collision-clean against the verb/event/prop and Lit ROZ137 reserved sets.) |
|
|
549
551
|
| `editCell` | Programmatically open the editor on a cell — `editCell(rowIndex, colIndex)`, addressed by index over the visible model (args coerced to integers + clamped). No-op on a non-editable cell. (Named `editCell`, not `edit`: collision-clean against the verb/event/prop and Lit ROZ137 reserved sets.) |
|
|
550
552
|
| `commitEditing` | Programmatically commit the open editor — `commitEditing()`. Runs the column validator; on success writes the two-way `data` model and fires one `cell-edit-commit`; on a validation failure keeps the editor open. No-op when no cell is editing. (Named `commitEditing`, not `commit`.) |
|
package/dist/index.cjs
CHANGED
|
@@ -763,6 +763,8 @@ function DataTable(_props) {
|
|
|
763
763
|
focusCell,
|
|
764
764
|
getActiveCell,
|
|
765
765
|
clearActiveCell,
|
|
766
|
+
scrollToRow,
|
|
767
|
+
getScrollElement,
|
|
766
768
|
getRowIndexRelativeToPage,
|
|
767
769
|
editCell,
|
|
768
770
|
commitEditing,
|
|
@@ -1699,6 +1701,13 @@ function DataTable(_props) {
|
|
|
1699
1701
|
end
|
|
1700
1702
|
});
|
|
1701
1703
|
}
|
|
1704
|
+
function scrollToRow(index, options) {
|
|
1705
|
+
if (!rowsWindowed() || !virtualizer) return;
|
|
1706
|
+
virtualizer.scrollToIndex(Math.trunc(Number(index)) || 0, options || void 0);
|
|
1707
|
+
}
|
|
1708
|
+
function getScrollElement() {
|
|
1709
|
+
return gridScrollEl;
|
|
1710
|
+
}
|
|
1702
1711
|
function virtualItemKey(i) {
|
|
1703
1712
|
const src = windowSource();
|
|
1704
1713
|
return src && src[i] ? src[i].id : void 0;
|
package/dist/index.d.cts
CHANGED
|
@@ -200,23 +200,23 @@ interface DataTableProps {
|
|
|
200
200
|
* A CSS length string bounding the `rdt-scroll` container when `virtual` is on (e.g. `'400px'`). Mirrored to the `--rozie-data-table-max-height` custom property; the prop wins, the token is the fallback.
|
|
201
201
|
*/
|
|
202
202
|
maxHeight?: string;
|
|
203
|
-
onSortChange?: (...args:
|
|
204
|
-
onExpandChange?: (...args:
|
|
205
|
-
onGroupChange?: (...args:
|
|
206
|
-
onFilterChange?: (...args:
|
|
207
|
-
onPageChange?: (...args:
|
|
208
|
-
onSelectionChange?: (...args:
|
|
209
|
-
onVisibilityChange?: (...args:
|
|
210
|
-
onResizeChange?: (...args:
|
|
211
|
-
onReorderChange?: (...args:
|
|
212
|
-
onPinChange?: (...args:
|
|
213
|
-
onHistoryChange?: (...args:
|
|
214
|
-
onVisibleRangeChange?: (...args:
|
|
215
|
-
onActivecellChange?: (...args:
|
|
216
|
-
onRowActivate?: (...args:
|
|
217
|
-
onRangeChange?: (...args:
|
|
218
|
-
onCellEditCommit?: (...args:
|
|
219
|
-
onRowEditCommit?: (...args:
|
|
203
|
+
onSortChange?: (...args: any[]) => void;
|
|
204
|
+
onExpandChange?: (...args: any[]) => void;
|
|
205
|
+
onGroupChange?: (...args: any[]) => void;
|
|
206
|
+
onFilterChange?: (...args: any[]) => void;
|
|
207
|
+
onPageChange?: (...args: any[]) => void;
|
|
208
|
+
onSelectionChange?: (...args: any[]) => void;
|
|
209
|
+
onVisibilityChange?: (...args: any[]) => void;
|
|
210
|
+
onResizeChange?: (...args: any[]) => void;
|
|
211
|
+
onReorderChange?: (...args: any[]) => void;
|
|
212
|
+
onPinChange?: (...args: any[]) => void;
|
|
213
|
+
onHistoryChange?: (...args: any[]) => void;
|
|
214
|
+
onVisibleRangeChange?: (...args: any[]) => void;
|
|
215
|
+
onActivecellChange?: (...args: any[]) => void;
|
|
216
|
+
onRowActivate?: (...args: any[]) => void;
|
|
217
|
+
onRangeChange?: (...args: any[]) => void;
|
|
218
|
+
onCellEditCommit?: (...args: any[]) => void;
|
|
219
|
+
onRowEditCommit?: (...args: any[]) => void;
|
|
220
220
|
children?: JSX.Element;
|
|
221
221
|
groupBarSlot?: (ctx: GroupBarSlotCtx) => JSX.Element;
|
|
222
222
|
selectAllSlot?: (ctx: SelectAllSlotCtx) => JSX.Element;
|
|
@@ -285,6 +285,11 @@ interface DataTableHandle {
|
|
|
285
285
|
focusCell: (...args: any[]) => any;
|
|
286
286
|
getActiveCell: (...args: any[]) => any;
|
|
287
287
|
clearActiveCell: (...args: any[]) => any;
|
|
288
|
+
scrollToRow(index: any, options?: {
|
|
289
|
+
align?: 'start' | 'center' | 'end' | 'auto';
|
|
290
|
+
behavior?: 'auto' | 'smooth' | 'instant';
|
|
291
|
+
}): void;
|
|
292
|
+
getScrollElement(): any;
|
|
288
293
|
getRowIndexRelativeToPage: (...args: any[]) => any;
|
|
289
294
|
editCell: (...args: any[]) => any;
|
|
290
295
|
commitEditing: (...args: any[]) => any;
|
package/dist/index.d.mts
CHANGED
|
@@ -200,23 +200,23 @@ interface DataTableProps {
|
|
|
200
200
|
* A CSS length string bounding the `rdt-scroll` container when `virtual` is on (e.g. `'400px'`). Mirrored to the `--rozie-data-table-max-height` custom property; the prop wins, the token is the fallback.
|
|
201
201
|
*/
|
|
202
202
|
maxHeight?: string;
|
|
203
|
-
onSortChange?: (...args:
|
|
204
|
-
onExpandChange?: (...args:
|
|
205
|
-
onGroupChange?: (...args:
|
|
206
|
-
onFilterChange?: (...args:
|
|
207
|
-
onPageChange?: (...args:
|
|
208
|
-
onSelectionChange?: (...args:
|
|
209
|
-
onVisibilityChange?: (...args:
|
|
210
|
-
onResizeChange?: (...args:
|
|
211
|
-
onReorderChange?: (...args:
|
|
212
|
-
onPinChange?: (...args:
|
|
213
|
-
onHistoryChange?: (...args:
|
|
214
|
-
onVisibleRangeChange?: (...args:
|
|
215
|
-
onActivecellChange?: (...args:
|
|
216
|
-
onRowActivate?: (...args:
|
|
217
|
-
onRangeChange?: (...args:
|
|
218
|
-
onCellEditCommit?: (...args:
|
|
219
|
-
onRowEditCommit?: (...args:
|
|
203
|
+
onSortChange?: (...args: any[]) => void;
|
|
204
|
+
onExpandChange?: (...args: any[]) => void;
|
|
205
|
+
onGroupChange?: (...args: any[]) => void;
|
|
206
|
+
onFilterChange?: (...args: any[]) => void;
|
|
207
|
+
onPageChange?: (...args: any[]) => void;
|
|
208
|
+
onSelectionChange?: (...args: any[]) => void;
|
|
209
|
+
onVisibilityChange?: (...args: any[]) => void;
|
|
210
|
+
onResizeChange?: (...args: any[]) => void;
|
|
211
|
+
onReorderChange?: (...args: any[]) => void;
|
|
212
|
+
onPinChange?: (...args: any[]) => void;
|
|
213
|
+
onHistoryChange?: (...args: any[]) => void;
|
|
214
|
+
onVisibleRangeChange?: (...args: any[]) => void;
|
|
215
|
+
onActivecellChange?: (...args: any[]) => void;
|
|
216
|
+
onRowActivate?: (...args: any[]) => void;
|
|
217
|
+
onRangeChange?: (...args: any[]) => void;
|
|
218
|
+
onCellEditCommit?: (...args: any[]) => void;
|
|
219
|
+
onRowEditCommit?: (...args: any[]) => void;
|
|
220
220
|
children?: JSX.Element;
|
|
221
221
|
groupBarSlot?: (ctx: GroupBarSlotCtx) => JSX.Element;
|
|
222
222
|
selectAllSlot?: (ctx: SelectAllSlotCtx) => JSX.Element;
|
|
@@ -285,6 +285,11 @@ interface DataTableHandle {
|
|
|
285
285
|
focusCell: (...args: any[]) => any;
|
|
286
286
|
getActiveCell: (...args: any[]) => any;
|
|
287
287
|
clearActiveCell: (...args: any[]) => any;
|
|
288
|
+
scrollToRow(index: any, options?: {
|
|
289
|
+
align?: 'start' | 'center' | 'end' | 'auto';
|
|
290
|
+
behavior?: 'auto' | 'smooth' | 'instant';
|
|
291
|
+
}): void;
|
|
292
|
+
getScrollElement(): any;
|
|
288
293
|
getRowIndexRelativeToPage: (...args: any[]) => any;
|
|
289
294
|
editCell: (...args: any[]) => any;
|
|
290
295
|
commitEditing: (...args: any[]) => any;
|
package/dist/index.mjs
CHANGED
|
@@ -736,6 +736,8 @@ function DataTable(_props) {
|
|
|
736
736
|
focusCell,
|
|
737
737
|
getActiveCell,
|
|
738
738
|
clearActiveCell,
|
|
739
|
+
scrollToRow,
|
|
740
|
+
getScrollElement,
|
|
739
741
|
getRowIndexRelativeToPage,
|
|
740
742
|
editCell,
|
|
741
743
|
commitEditing,
|
|
@@ -1672,6 +1674,13 @@ function DataTable(_props) {
|
|
|
1672
1674
|
end
|
|
1673
1675
|
});
|
|
1674
1676
|
}
|
|
1677
|
+
function scrollToRow(index, options) {
|
|
1678
|
+
if (!rowsWindowed() || !virtualizer) return;
|
|
1679
|
+
virtualizer.scrollToIndex(Math.trunc(Number(index)) || 0, options || void 0);
|
|
1680
|
+
}
|
|
1681
|
+
function getScrollElement() {
|
|
1682
|
+
return gridScrollEl;
|
|
1683
|
+
}
|
|
1675
1684
|
function virtualItemKey(i) {
|
|
1676
1685
|
const src = windowSource();
|
|
1677
1686
|
return src && src[i] ? src[i].id : void 0;
|
package/dist/source/index.jsx
CHANGED
|
@@ -734,6 +734,8 @@ function DataTable(_props) {
|
|
|
734
734
|
focusCell,
|
|
735
735
|
getActiveCell,
|
|
736
736
|
clearActiveCell,
|
|
737
|
+
scrollToRow,
|
|
738
|
+
getScrollElement,
|
|
737
739
|
getRowIndexRelativeToPage,
|
|
738
740
|
editCell,
|
|
739
741
|
commitEditing,
|
|
@@ -1671,6 +1673,13 @@ function DataTable(_props) {
|
|
|
1671
1673
|
end
|
|
1672
1674
|
});
|
|
1673
1675
|
}
|
|
1676
|
+
function scrollToRow(index, options) {
|
|
1677
|
+
if (!rowsWindowed() || !virtualizer) return;
|
|
1678
|
+
virtualizer.scrollToIndex(Math.trunc(Number(index)) || 0, options || void 0);
|
|
1679
|
+
}
|
|
1680
|
+
function getScrollElement() {
|
|
1681
|
+
return gridScrollEl;
|
|
1682
|
+
}
|
|
1674
1683
|
function virtualItemKey(i) {
|
|
1675
1684
|
const src = windowSource();
|
|
1676
1685
|
return src && src[i] ? src[i].id : void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rozie-ui/data-table-solid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@solid-primitives/keyed": "^1.5.3",
|
|
50
|
-
"@rozie/runtime-solid": "^0.
|
|
50
|
+
"@rozie/runtime-solid": "^0.8.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"solid-js": "^1.8",
|
|
54
54
|
"@tanstack/table-core": "^8.21",
|
|
55
55
|
"@tanstack/virtual-core": "^3",
|
|
56
|
-
"@rozie-ui/popover-solid": "^0.1.0 || ^0.2.0"
|
|
56
|
+
"@rozie-ui/popover-solid": "^0.1.0 || ^0.2.0 || ^0.3.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"solid-js": {
|
package/src/DataTable.tsx
CHANGED
|
@@ -610,23 +610,23 @@ interface DataTableProps {
|
|
|
610
610
|
* A CSS length string bounding the `rdt-scroll` container when `virtual` is on (e.g. `'400px'`). Mirrored to the `--rozie-data-table-max-height` custom property; the prop wins, the token is the fallback.
|
|
611
611
|
*/
|
|
612
612
|
maxHeight?: string;
|
|
613
|
-
onSortChange?: (...args:
|
|
614
|
-
onExpandChange?: (...args:
|
|
615
|
-
onGroupChange?: (...args:
|
|
616
|
-
onFilterChange?: (...args:
|
|
617
|
-
onPageChange?: (...args:
|
|
618
|
-
onSelectionChange?: (...args:
|
|
619
|
-
onVisibilityChange?: (...args:
|
|
620
|
-
onResizeChange?: (...args:
|
|
621
|
-
onReorderChange?: (...args:
|
|
622
|
-
onPinChange?: (...args:
|
|
623
|
-
onHistoryChange?: (...args:
|
|
624
|
-
onVisibleRangeChange?: (...args:
|
|
625
|
-
onActivecellChange?: (...args:
|
|
626
|
-
onRowActivate?: (...args:
|
|
627
|
-
onRangeChange?: (...args:
|
|
628
|
-
onCellEditCommit?: (...args:
|
|
629
|
-
onRowEditCommit?: (...args:
|
|
613
|
+
onSortChange?: (...args: any[]) => void;
|
|
614
|
+
onExpandChange?: (...args: any[]) => void;
|
|
615
|
+
onGroupChange?: (...args: any[]) => void;
|
|
616
|
+
onFilterChange?: (...args: any[]) => void;
|
|
617
|
+
onPageChange?: (...args: any[]) => void;
|
|
618
|
+
onSelectionChange?: (...args: any[]) => void;
|
|
619
|
+
onVisibilityChange?: (...args: any[]) => void;
|
|
620
|
+
onResizeChange?: (...args: any[]) => void;
|
|
621
|
+
onReorderChange?: (...args: any[]) => void;
|
|
622
|
+
onPinChange?: (...args: any[]) => void;
|
|
623
|
+
onHistoryChange?: (...args: any[]) => void;
|
|
624
|
+
onVisibleRangeChange?: (...args: any[]) => void;
|
|
625
|
+
onActivecellChange?: (...args: any[]) => void;
|
|
626
|
+
onRowActivate?: (...args: any[]) => void;
|
|
627
|
+
onRangeChange?: (...args: any[]) => void;
|
|
628
|
+
onCellEditCommit?: (...args: any[]) => void;
|
|
629
|
+
onRowEditCommit?: (...args: any[]) => void;
|
|
630
630
|
// D-131: default slot resolved via children() at body top
|
|
631
631
|
children?: JSX.Element;
|
|
632
632
|
groupBarSlot?: (ctx: GroupBarSlotCtx) => JSX.Element;
|
|
@@ -666,6 +666,8 @@ export interface DataTableHandle {
|
|
|
666
666
|
focusCell: (...args: any[]) => any;
|
|
667
667
|
getActiveCell: (...args: any[]) => any;
|
|
668
668
|
clearActiveCell: (...args: any[]) => any;
|
|
669
|
+
scrollToRow(index: any, options?: { align?: 'start' | 'center' | 'end' | 'auto'; behavior?: 'auto' | 'smooth' | 'instant'; }): void;
|
|
670
|
+
getScrollElement(): any;
|
|
669
671
|
getRowIndexRelativeToPage: (...args: any[]) => any;
|
|
670
672
|
editCell: (...args: any[]) => any;
|
|
671
673
|
commitEditing: (...args: any[]) => any;
|
|
@@ -683,7 +685,7 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
683
685
|
const _merged = mergeProps({ columns: (() => [])() as any[], selectionMode: 'none', manual: false, rowCount: null, pageCount: null, expandable: false, getRowId: null, getSubRows: null, groupable: false, stickyHeader: false, interactionMode: 'table', singleClickEdit: false, undoable: false, undoLimit: 100, virtual: false, estimateRowHeight: 40, autoMeasure: false, maxHeight: '' }, _props);
|
|
684
686
|
const [local, attrs] = splitProps(_merged, ['data', 'columns', 'selectionMode', 'sorting', 'globalFilter', 'columnFilters', 'pagination', 'manual', 'rowCount', 'pageCount', 'expandable', 'expanded', 'getRowId', 'getSubRows', 'groupable', 'grouping', 'rowSelection', 'columnVisibility', 'columnSizing', 'columnOrder', 'columnPinning', 'stickyHeader', 'interactionMode', 'singleClickEdit', 'undoable', 'undoLimit', 'virtual', 'estimateRowHeight', 'autoMeasure', 'maxHeight', 'children', 'ref', 'onSortChange', 'onExpandChange', 'onGroupChange', 'onFilterChange', 'onPageChange', 'onSelectionChange', 'onVisibilityChange', 'onResizeChange', 'onReorderChange', 'onPinChange', 'onHistoryChange', 'onVisibleRangeChange', 'onActivecellChange', 'onRowActivate', 'onRangeChange', 'onCellEditCommit', 'onRowEditCommit']);
|
|
685
687
|
const resolved = () => local.children;
|
|
686
|
-
onMount(() => { local.ref?.({ sortColumn, clearSorting, toggleRowExpanded, expandAll, collapseAll, getExpandedRows, applyGrouping, clearGrouping, getFacetedUniqueValues, getFacetedMinMaxValues, getColumnDefs, toggleAllRows, clearSelection, getSelectedRows, setPage, setRowsPerPage, toggleColumnVisibility, applyColumnOrder, resetColumnSizing, pinColumn, focusCell, getActiveCell, clearActiveCell, getRowIndexRelativeToPage, editCell, commitEditing, editRow, getSelectedRange, cut, undo, redo, canUndo, canRedo, clearHistory }); });
|
|
688
|
+
onMount(() => { local.ref?.({ sortColumn, clearSorting, toggleRowExpanded, expandAll, collapseAll, getExpandedRows, applyGrouping, clearGrouping, getFacetedUniqueValues, getFacetedMinMaxValues, getColumnDefs, toggleAllRows, clearSelection, getSelectedRows, setPage, setRowsPerPage, toggleColumnVisibility, applyColumnOrder, resetColumnSizing, pinColumn, focusCell, getActiveCell, clearActiveCell, scrollToRow, getScrollElement, getRowIndexRelativeToPage, editCell, commitEditing, editRow, getSelectedRange, cut, undo, redo, canUndo, canRedo, clearHistory }); });
|
|
687
689
|
|
|
688
690
|
const __ctx_data_table_columns = rozieContext("data-table:columns");
|
|
689
691
|
const [data, setData] = createControllableSignal<any[]>(_props as unknown as Record<string, unknown>, 'data', []);
|
|
@@ -2699,6 +2701,37 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
|
2699
2701
|
});
|
|
2700
2702
|
}
|
|
2701
2703
|
|
|
2704
|
+
// scrollToRow(index, options?) — quick 260927-a2r (oinbox dogfooding): plain scroll-into-view
|
|
2705
|
+
// for a windowed row, forwarding TanStack virtual-core's own ScrollToOptions ({ align?,
|
|
2706
|
+
// behavior? }) UNCHANGED to virtualizer.scrollToIndex — the SAME call focusActiveCell's D-12
|
|
2707
|
+
// off-window scroll-then-focus path (gridFocusNav.rzts) already drives, exposed here as a
|
|
2708
|
+
// standalone public verb rather than invented plumbing. INDEPENDENT of grid-mode focus
|
|
2709
|
+
// (feedback_no_false_equivalent_options / the todo's own open question): never reads or
|
|
2710
|
+
// writes $data.activeRow/activeColIndex, never emits activecell-change, and is callable in
|
|
2711
|
+
// EITHER interactionMode ('table' or 'grid') — a scroll, not a focus move. No-op when rows
|
|
2712
|
+
// are not windowed or the row virtualizer has not been constructed yet — mirrors the
|
|
2713
|
+
// isGrid()-gated no-op precedent on focusCell/clearActiveCell (gridActiveCellVerbs.rzts) for
|
|
2714
|
+
// the identical reason: the capability this verb drives isn't active. `index` is coerced
|
|
2715
|
+
// (T-260927A2R-01) — never range-clamped here: virtual-core's own scrollToIndex already
|
|
2716
|
+
// clamps to [0, options.count-1] internally (verified in @tanstack/virtual-core source).
|
|
2717
|
+
function scrollToRow(index: any, options?: {
|
|
2718
|
+
align?: 'start' | 'center' | 'end' | 'auto';
|
|
2719
|
+
behavior?: 'auto' | 'smooth' | 'instant';
|
|
2720
|
+
}): void {
|
|
2721
|
+
if (!rowsWindowed() || !virtualizer) return;
|
|
2722
|
+
virtualizer.scrollToIndex(Math.trunc(Number(index)) || 0, options || undefined);
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2725
|
+
// getScrollElement() — quick 260927-a2r: returns the DOM node the row AND column
|
|
2726
|
+
// virtualizer(s) observe/scroll (the `.rdt-scroll` div captured post-mount in
|
|
2727
|
+
// DataTable.rozie's own $onMount, D-03) — the supported replacement for a consumer reaching
|
|
2728
|
+
// into the internal `.rdt-scroll` class selector. Returns null when nothing is windowed:
|
|
2729
|
+
// gridScrollEl is only ever assigned inside the isWindowed() guard, so no extra gate is
|
|
2730
|
+
// needed here beyond that natural null.
|
|
2731
|
+
function getScrollElement(): any {
|
|
2732
|
+
return gridScrollEl;
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2702
2735
|
// ══ Generic vertical windowing math (Phase 64, D-04) — the target-agnostic virtual-core bridge ══
|
|
2703
2736
|
// Lifted verbatim from the DataTable virtualization.rzts (the Phase 53/63 B13 baseline). This partial
|
|
2704
2737
|
// holds ONLY the PURE windowing math; every DOM/refs/virtualizer-instance impurity stays per-consumer
|
package/src/index.ts
CHANGED
|
@@ -12,5 +12,5 @@ export { default as FilterSelect } from './FilterSelect';
|
|
|
12
12
|
export { default as GroupBar } from './GroupBar';
|
|
13
13
|
export { default as DetailPanel } from './DetailPanel';
|
|
14
14
|
|
|
15
|
-
/** The `$expose` imperative handle received via `ref` — { sortColumn, clearSorting, toggleRowExpanded, expandAll, collapseAll, getExpandedRows, applyGrouping, clearGrouping, getFacetedUniqueValues, getFacetedMinMaxValues, getColumnDefs, toggleAllRows, clearSelection, getSelectedRows, setPage, setRowsPerPage, toggleColumnVisibility, applyColumnOrder, resetColumnSizing, pinColumn, focusCell, getActiveCell, clearActiveCell, getRowIndexRelativeToPage, editCell, commitEditing, editRow, getSelectedRange, cut, undo, redo, canUndo, canRedo, clearHistory }. */
|
|
15
|
+
/** The `$expose` imperative handle received via `ref` — { sortColumn, clearSorting, toggleRowExpanded, expandAll, collapseAll, getExpandedRows, applyGrouping, clearGrouping, getFacetedUniqueValues, getFacetedMinMaxValues, getColumnDefs, toggleAllRows, clearSelection, getSelectedRows, setPage, setRowsPerPage, toggleColumnVisibility, applyColumnOrder, resetColumnSizing, pinColumn, focusCell, getActiveCell, clearActiveCell, scrollToRow, getScrollElement, getRowIndexRelativeToPage, editCell, commitEditing, editRow, getSelectedRange, cut, undo, redo, canUndo, canRedo, clearHistory }. */
|
|
16
16
|
export type { DataTableHandle } from './DataTable';
|