@rozie-ui/data-table-solid 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +357 -0
- package/README.md +11 -11
- package/dist/index.cjs +13 -13
- package/dist/index.d.cts +165 -96
- package/dist/index.d.mts +165 -96
- package/dist/index.mjs +13 -13
- package/dist/source/index.jsx +12 -12
- package/package.json +5 -4
- package/src/DataTable.tsx +134 -62
- package/src/index.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -239,7 +239,7 @@ const indexOfRowIn = (rows, rowOriginal, rowId) => {
|
|
|
239
239
|
//#endregion
|
|
240
240
|
//#region src/DataTable.tsx
|
|
241
241
|
var _tmpl$$11 = /* @__PURE__ */ template(`<div class=rozie-data-table-wrap data-rozie-s-d5dcab4c=""><div class=rdt-column-defs aria-hidden=true data-rozie-s-d5dcab4c=""></div><div class=rdt-toolbar data-rozie-s-d5dcab4c=""><input type=text role=searchbox aria-label="Search table"class=rdt-global-filter data-rozie-s-d5dcab4c="">`), _tmpl$2$4 = /* @__PURE__ */ template(`<div class=rdt-sr-live role=status aria-live=polite aria-atomic=true data-rozie-s-d5dcab4c="">`), _tmpl$3$1 = /* @__PURE__ */ template(`<div class="rdt-sr-live rdt-sr-paste"data-testid=paste-announce role=status aria-live=polite aria-atomic=true data-rozie-s-d5dcab4c="">`), _tmpl$4$1 = /* @__PURE__ */ template(`<div class="rdt-sr-live rdt-sr-range"data-testid=range-announce role=status aria-live=polite aria-atomic=true data-rozie-s-d5dcab4c="">`), _tmpl$5$1 = /* @__PURE__ */ template(`<div class="rdt-sr-live rdt-sr-sortfilter"data-testid=sortfilter-announce role=status aria-live=polite aria-atomic=true data-rozie-s-d5dcab4c="">`), _tmpl$6 = /* @__PURE__ */ template(`<details class=rdt-colvis data-rozie-s-d5dcab4c=""><summary class=rdt-colvis-summary data-rozie-s-d5dcab4c="">Columns</summary><div class=rdt-colvis-menu role=group aria-label="Toggle columns"data-rozie-s-d5dcab4c="">`), _tmpl$7 = /* @__PURE__ */ template(`<label class=rdt-colvis-item data-rozie-s-d5dcab4c=""><input type=checkbox class=rdt-colvis-checkbox data-rozie-s-d5dcab4c=""><span class=rdt-colvis-label data-rozie-s-d5dcab4c="">`), _tmpl$8 = /* @__PURE__ */ template(`<div class=rdt-group-bar-host data-rozie-s-d5dcab4c="">`), _tmpl$9 = /* @__PURE__ */ template(`<span class=rdt-group-token data-group-token=""data-rozie-s-d5dcab4c="">`), _tmpl$0 = /* @__PURE__ */ template(`<div class=rdt-scroll data-rozie-s-d5dcab4c=""><table data-rozie-s-d5dcab4c=""><thead class=rdt-thead role=rowgroup data-rozie-s-d5dcab4c=""></thead><tbody class=rdt-tbody role=rowgroup data-rozie-s-d5dcab4c=""><tr class=rdt-spacer aria-hidden=true data-rozie-s-d5dcab4c=""><td data-rozie-s-d5dcab4c=""></td></tr><tr class=rdt-spacer aria-hidden=true data-rozie-s-d5dcab4c=""><td data-rozie-s-d5dcab4c="">`), _tmpl$1 = /* @__PURE__ */ template(`<table data-rozie-s-d5dcab4c=""><thead class=rdt-thead role=rowgroup data-rozie-s-d5dcab4c=""></thead><tbody class=rdt-tbody role=rowgroup data-rozie-s-d5dcab4c="">`), _tmpl$10 = /* @__PURE__ */ template(`<tr class=rdt-tr role=row data-rozie-s-d5dcab4c="">`), _tmpl$11 = /* @__PURE__ */ template(`<th role=columnheader data-grid-cell=""data-row=__header data-rozie-s-d5dcab4c="">`), _tmpl$12 = /* @__PURE__ */ template(`<span data-rozie-s-d5dcab4c="">`), _tmpl$13 = /* @__PURE__ */ template(`<div class=rdt-col-menu role=menu data-rozie-s-d5dcab4c=""><button type=button role=menuitem class=rdt-col-menu-item data-rozie-s-d5dcab4c="">Pin left</button><button type=button role=menuitem class=rdt-col-menu-item data-rozie-s-d5dcab4c="">Pin right</button><button type=button role=menuitem class=rdt-col-menu-item data-rozie-s-d5dcab4c="">Unpin</button><hr class=rdt-col-menu-sep data-rozie-s-d5dcab4c=""><button type=button role=menuitem class=rdt-col-menu-item data-rozie-s-d5dcab4c="">Hide column`), _tmpl$14 = /* @__PURE__ */ template(`<span data-rozie-s-d5dcab4c=""><button type=button class=rdt-resize-handle data-rozie-s-d5dcab4c=""><span class=rdt-resize-grip aria-hidden=true data-rozie-s-d5dcab4c="">`), _tmpl$15 = /* @__PURE__ */ template(`<button type=button class=rdt-sort-btn data-rozie-s-d5dcab4c=""><span class=rdt-header-label data-rozie-s-d5dcab4c=""></span><span class=rdt-sort-ind aria-hidden=true data-rozie-s-d5dcab4c="">`), _tmpl$16 = /* @__PURE__ */ template(`<span data-rozie-s-d5dcab4c=""><span class=rdt-header-label data-rozie-s-d5dcab4c="">`), _tmpl$17 = /* @__PURE__ */ template(`<button type=button class=rdt-col-menu-trigger data-rozie-s-d5dcab4c="">⋯`), _tmpl$18 = /* @__PURE__ */ template(`<input type=checkbox aria-label="Select all rows"class=rdt-select-all data-rozie-s-d5dcab4c="">`), _tmpl$19 = /* @__PURE__ */ template(`<tr class=rdt-filter-row data-rozie-s-d5dcab4c="">`), _tmpl$20 = /* @__PURE__ */ template(`<th role=presentation data-rozie-s-d5dcab4c="">`), _tmpl$21 = /* @__PURE__ */ template(`<input type=text class=rdt-col-filter data-rozie-s-d5dcab4c="">`), _tmpl$22 = /* @__PURE__ */ template(`<tr role=row data-rozie-s-d5dcab4c="">`), _tmpl$23 = /* @__PURE__ */ template(`<td data-grid-cell=""data-rozie-s-d5dcab4c="">`), _tmpl$24 = /* @__PURE__ */ template(`<span data-rozie-s-d5dcab4c=""><button type=button data-expander=""class="rdt-expander rdt-group-toggle"data-rozie-s-d5dcab4c=""></button><span class=rdt-group-value data-rozie-s-d5dcab4c=""></span><span class=rdt-group-count data-rozie-s-d5dcab4c="">`), _tmpl$25 = /* @__PURE__ */ template(`<span class=rdt-cell-value data-rozie-s-d5dcab4c="">`), _tmpl$26 = /* @__PURE__ */ template(`<input type=number data-editing-cell=""data-builtin-editor=""class=rdt-cell-editor data-rozie-s-d5dcab4c="">`), _tmpl$27 = /* @__PURE__ */ template(`<select data-editing-cell=""data-builtin-editor=""class=rdt-cell-editor data-rozie-s-d5dcab4c="">`), _tmpl$28 = /* @__PURE__ */ template(`<input type=checkbox data-editing-cell=""data-builtin-editor=""class=rdt-cell-editor data-rozie-s-d5dcab4c="">`), _tmpl$29 = /* @__PURE__ */ template(`<input type=text data-editing-cell=""data-builtin-editor=""class=rdt-cell-editor data-rozie-s-d5dcab4c="">`), _tmpl$30 = /* @__PURE__ */ template(`<option data-rozie-s-d5dcab4c="">`), _tmpl$31 = /* @__PURE__ */ template(`<input type=checkbox aria-label="Select row"class=rdt-select-row data-rozie-s-d5dcab4c="">`), _tmpl$32 = /* @__PURE__ */ template(`<button type=button data-expander=""class=rdt-expander data-rozie-s-d5dcab4c="">`), _tmpl$33 = /* @__PURE__ */ template(`<span data-fill-handle=""data-testid=fill-handle aria-hidden=true class=rdt-fill-handle data-rozie-s-d5dcab4c="">`), _tmpl$34 = /* @__PURE__ */ template(`<tr class=rdt-detail-row role=row data-rozie-s-d5dcab4c=""><td class=rdt-detail-cell data-rozie-s-d5dcab4c="">`), _tmpl$35 = /* @__PURE__ */ template(`<th class=rdt-col-spacer aria-hidden=true data-rozie-s-d5dcab4c="">`), _tmpl$36 = /* @__PURE__ */ template(`<td class=rdt-col-spacer aria-hidden=true data-rozie-s-d5dcab4c="">`), _tmpl$37 = /* @__PURE__ */ template(`<span data-rozie-s-d5dcab4c=""><input class=rdt-select-placeholder type=checkbox tabindex=-1 aria-hidden=true data-rozie-s-d5dcab4c="">`), _tmpl$38 = /* @__PURE__ */ template(`<span class=rdt-skeleton aria-hidden=true data-rozie-s-d5dcab4c="">​`), _tmpl$39 = /* @__PURE__ */ template(`<div class=rdt-pagination role=group aria-label=Pagination data-rozie-s-d5dcab4c=""><button type=button class="rdt-page-btn rdt-page-prev"data-rozie-s-d5dcab4c="">Prev</button><span class=rdt-page-status aria-live=polite data-rozie-s-d5dcab4c=""></span><button type=button class="rdt-page-btn rdt-page-next"data-rozie-s-d5dcab4c="">Next</button><select aria-label="Rows per page"class=rdt-page-size data-rozie-s-d5dcab4c=""><option value=10 data-rozie-s-d5dcab4c="">10</option><option value=25 data-rozie-s-d5dcab4c="">25</option><option value=50 data-rozie-s-d5dcab4c="">50</option><option value=100 data-rozie-s-d5dcab4c="">100`);
|
|
242
|
-
__rozieInjectStyle("DataTable-d5dcab4c", `[data-rozie-s-d5dcab4c]:host {
|
|
242
|
+
/** A cell position as integers over the visible (display-order) model. */ /** The active (roving-focus) cell. A header cell reports `rowIndex: null` and `isHeader: true`. */ /** The rectangular cell-range selection. Both corners are `null` when there is no range. */ /** One data column offered to the `#groupBar` slot. */ /** One changed cell inside a row edit commit. */ /** The `activecell-change` payload. `isHeader` is set when the move landed on or left a header cell. */ /** The `cell-edit-commit` payload: one committed cell. */ /** The `row-edit-commit` payload: the row and every cell the save changed. */ /** The `filter-change` payload: `globalFilter` for the search box, `columnFilters` for a per-column filter. Exactly one key is set. */ /** The `history-change` payload: undo/redo availability. */ /** The `range-change` payload: the new range corners (both `null` when the range cleared). */ /** The `row-activate` payload. `row` is the original data object and `index` its position in the rendered model. */ /** The `visible-range-change` payload: the rendered row window, `end` exclusive. */ __rozieInjectStyle("DataTable-d5dcab4c", `[data-rozie-s-d5dcab4c]:host {
|
|
243
243
|
--rdt-color: var(--rozie-data-table-fg, var(--rdt-ds-fg));
|
|
244
244
|
--rdt-select-accent: var(--rozie-data-table-select-accent, var(--rozie-data-table-accent, var(--rdt-ds-select-accent)));
|
|
245
245
|
--rdt-border: 1px solid var(--rozie-data-table-border-color, var(--rdt-ds-border-color));
|
|
@@ -692,23 +692,23 @@ function DataTable(_props) {
|
|
|
692
692
|
"maxHeight",
|
|
693
693
|
"children",
|
|
694
694
|
"ref",
|
|
695
|
-
"
|
|
695
|
+
"onActivecellChange",
|
|
696
|
+
"onCellEditCommit",
|
|
696
697
|
"onExpandChange",
|
|
697
|
-
"onGroupChange",
|
|
698
698
|
"onFilterChange",
|
|
699
|
+
"onGroupChange",
|
|
700
|
+
"onHistoryChange",
|
|
699
701
|
"onPageChange",
|
|
700
|
-
"onSelectionChange",
|
|
701
|
-
"onVisibilityChange",
|
|
702
|
-
"onResizeChange",
|
|
703
|
-
"onReorderChange",
|
|
704
702
|
"onPinChange",
|
|
705
|
-
"onHistoryChange",
|
|
706
|
-
"onVisibleRangeChange",
|
|
707
|
-
"onActivecellChange",
|
|
708
|
-
"onRowActivate",
|
|
709
703
|
"onRangeChange",
|
|
710
|
-
"
|
|
711
|
-
"
|
|
704
|
+
"onReorderChange",
|
|
705
|
+
"onResizeChange",
|
|
706
|
+
"onRowActivate",
|
|
707
|
+
"onRowEditCommit",
|
|
708
|
+
"onSelectionChange",
|
|
709
|
+
"onSortChange",
|
|
710
|
+
"onVisibilityChange",
|
|
711
|
+
"onVisibleRangeChange"
|
|
712
712
|
]);
|
|
713
713
|
const resolved = () => local.children;
|
|
714
714
|
onMount(() => {
|
package/dist/source/index.jsx
CHANGED
|
@@ -690,23 +690,23 @@ function DataTable(_props) {
|
|
|
690
690
|
"maxHeight",
|
|
691
691
|
"children",
|
|
692
692
|
"ref",
|
|
693
|
-
"
|
|
693
|
+
"onActivecellChange",
|
|
694
|
+
"onCellEditCommit",
|
|
694
695
|
"onExpandChange",
|
|
695
|
-
"onGroupChange",
|
|
696
696
|
"onFilterChange",
|
|
697
|
+
"onGroupChange",
|
|
698
|
+
"onHistoryChange",
|
|
697
699
|
"onPageChange",
|
|
698
|
-
"onSelectionChange",
|
|
699
|
-
"onVisibilityChange",
|
|
700
|
-
"onResizeChange",
|
|
701
|
-
"onReorderChange",
|
|
702
700
|
"onPinChange",
|
|
703
|
-
"onHistoryChange",
|
|
704
|
-
"onVisibleRangeChange",
|
|
705
|
-
"onActivecellChange",
|
|
706
|
-
"onRowActivate",
|
|
707
701
|
"onRangeChange",
|
|
708
|
-
"
|
|
709
|
-
"
|
|
702
|
+
"onReorderChange",
|
|
703
|
+
"onResizeChange",
|
|
704
|
+
"onRowActivate",
|
|
705
|
+
"onRowEditCommit",
|
|
706
|
+
"onSelectionChange",
|
|
707
|
+
"onSortChange",
|
|
708
|
+
"onVisibilityChange",
|
|
709
|
+
"onVisibleRangeChange"
|
|
710
710
|
]);
|
|
711
711
|
const resolved = () => local.children;
|
|
712
712
|
onMount(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rozie-ui/data-table-solid",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,17 +43,18 @@
|
|
|
43
43
|
},
|
|
44
44
|
"files": [
|
|
45
45
|
"dist",
|
|
46
|
-
"src"
|
|
46
|
+
"src",
|
|
47
|
+
"CHANGELOG.md"
|
|
47
48
|
],
|
|
48
49
|
"dependencies": {
|
|
49
50
|
"@solid-primitives/keyed": "^1.5.3",
|
|
50
|
-
"@rozie/runtime-solid": "^0.
|
|
51
|
+
"@rozie/runtime-solid": "^0.9.0"
|
|
51
52
|
},
|
|
52
53
|
"peerDependencies": {
|
|
53
54
|
"solid-js": "^1.8",
|
|
54
55
|
"@tanstack/table-core": "^8.21",
|
|
55
56
|
"@tanstack/virtual-core": "^3",
|
|
56
|
-
"@rozie-ui/popover-solid": "^0.1.0 || ^0.2.0"
|
|
57
|
+
"@rozie-ui/popover-solid": "^0.1.0 || ^0.2.0 || ^0.3.0"
|
|
57
58
|
},
|
|
58
59
|
"peerDependenciesMeta": {
|
|
59
60
|
"solid-js": {
|
package/src/DataTable.tsx
CHANGED
|
@@ -44,6 +44,78 @@ import { columnSpecsEquivalent } from './helpers/columnDefUtils';
|
|
|
44
44
|
|
|
45
45
|
// The registry API handed to <Column> children (whole-object-replace — T-48-PP guard).
|
|
46
46
|
|
|
47
|
+
import type { Column as TableColumn, ColumnDef, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, ExpandedState, GroupingState, PaginationState, RowSelectionState, SortingState, VisibilityState } from '@tanstack/table-core';
|
|
48
|
+
|
|
49
|
+
/** A cell position as integers over the visible (display-order) model. */
|
|
50
|
+
export interface DataTableCellPosition {
|
|
51
|
+
rowIndex: number;
|
|
52
|
+
colIndex: number;
|
|
53
|
+
}
|
|
54
|
+
/** The active (roving-focus) cell. A header cell reports `rowIndex: null` and `isHeader: true`. */
|
|
55
|
+
export interface DataTableActiveCell {
|
|
56
|
+
rowIndex: number | null;
|
|
57
|
+
colIndex: number;
|
|
58
|
+
isHeader: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** The rectangular cell-range selection. Both corners are `null` when there is no range. */
|
|
61
|
+
export interface DataTableRange {
|
|
62
|
+
anchor: DataTableCellPosition | null;
|
|
63
|
+
focus: DataTableCellPosition | null;
|
|
64
|
+
}
|
|
65
|
+
/** One data column offered to the `#groupBar` slot. */
|
|
66
|
+
export interface DataTableGroupableColumn {
|
|
67
|
+
id: string;
|
|
68
|
+
label: string;
|
|
69
|
+
}
|
|
70
|
+
/** One changed cell inside a row edit commit. */
|
|
71
|
+
export interface DataTableCellChange {
|
|
72
|
+
columnId: string;
|
|
73
|
+
oldValue: any;
|
|
74
|
+
newValue: any;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** The `activecell-change` payload. `isHeader` is set when the move landed on or left a header cell. */
|
|
78
|
+
export interface DataTableActiveCellChangePayload {
|
|
79
|
+
rowIndex: number | null;
|
|
80
|
+
colIndex: number;
|
|
81
|
+
isHeader?: boolean;
|
|
82
|
+
}
|
|
83
|
+
/** The `cell-edit-commit` payload: one committed cell. */
|
|
84
|
+
export interface DataTableCellEditCommitPayload {
|
|
85
|
+
rowId: string;
|
|
86
|
+
columnId: string;
|
|
87
|
+
oldValue: any;
|
|
88
|
+
newValue: any;
|
|
89
|
+
}
|
|
90
|
+
/** The `row-edit-commit` payload: the row and every cell the save changed. */
|
|
91
|
+
export interface DataTableRowEditCommitPayload {
|
|
92
|
+
rowId: string;
|
|
93
|
+
changes: DataTableCellChange[];
|
|
94
|
+
}
|
|
95
|
+
/** The `filter-change` payload: `globalFilter` for the search box, `columnFilters` for a per-column filter. Exactly one key is set. */
|
|
96
|
+
export interface DataTableFilterChangePayload {
|
|
97
|
+
globalFilter?: string;
|
|
98
|
+
columnFilters?: ColumnFiltersState;
|
|
99
|
+
}
|
|
100
|
+
/** The `history-change` payload: undo/redo availability. */
|
|
101
|
+
export interface DataTableHistoryChangePayload {
|
|
102
|
+
canUndo: boolean;
|
|
103
|
+
canRedo: boolean;
|
|
104
|
+
}
|
|
105
|
+
/** The `range-change` payload: the new range corners (both `null` when the range cleared). */
|
|
106
|
+
export type DataTableRangeChangePayload = DataTableRange;
|
|
107
|
+
/** The `row-activate` payload. `row` is the original data object and `index` its position in the rendered model. */
|
|
108
|
+
export interface DataTableRowActivatePayload {
|
|
109
|
+
row: any;
|
|
110
|
+
index: number;
|
|
111
|
+
trigger: 'keyboard' | 'click';
|
|
112
|
+
}
|
|
113
|
+
/** The `visible-range-change` payload: the rendered row window, `end` exclusive. */
|
|
114
|
+
export interface DataTableVisibleRangeChangePayload {
|
|
115
|
+
start: number;
|
|
116
|
+
end: number;
|
|
117
|
+
}
|
|
118
|
+
|
|
47
119
|
__rozieInjectStyle('DataTable-d5dcab4c', `[data-rozie-s-d5dcab4c]:host {
|
|
48
120
|
--rdt-color: var(--rozie-data-table-fg, var(--rdt-ds-fg));
|
|
49
121
|
--rdt-select-accent: var(--rozie-data-table-select-accent, var(--rozie-data-table-accent, var(--rdt-ds-select-accent)));
|
|
@@ -445,23 +517,23 @@ __rozieInjectStyle('DataTable-d5dcab4c', `[data-rozie-s-d5dcab4c]:host {
|
|
|
445
517
|
accent-color: var(--rdt-select-accent, currentColor);
|
|
446
518
|
}`);
|
|
447
519
|
|
|
448
|
-
interface GroupBarSlotCtx { grouping:
|
|
520
|
+
interface GroupBarSlotCtx { grouping: string[]; groupableColumns: DataTableGroupableColumn[]; applyGrouping: (cols: string[]) => void; clearGrouping: () => void; }
|
|
449
521
|
|
|
450
|
-
interface SelectAllSlotCtx { checked:
|
|
522
|
+
interface SelectAllSlotCtx { checked: boolean; indeterminate: boolean; toggle: (event: any) => void; }
|
|
451
523
|
|
|
452
|
-
interface PlaceholderSlotCtx { index:
|
|
524
|
+
interface PlaceholderSlotCtx { index: number; columnId: string; }
|
|
453
525
|
|
|
454
|
-
interface SelectCellSlotCtx { row: any; checked:
|
|
526
|
+
interface SelectCellSlotCtx { row: any; checked: boolean; toggle: (event: any) => void; }
|
|
455
527
|
|
|
456
528
|
interface DetailSlotCtx { row: any; }
|
|
457
529
|
|
|
458
|
-
interface ColHeaderSlotCtx { columnId:
|
|
530
|
+
interface ColHeaderSlotCtx { columnId: string; column: TableColumn<any, unknown>; label: string; }
|
|
459
531
|
|
|
460
|
-
interface FilterSlotCtx { columnId:
|
|
532
|
+
interface FilterSlotCtx { columnId: string; value: any; uniqueValues: any[]; minMax: [number, number] | null; columnLabel: string; setFilter: (columnId: string, value: any) => void; }
|
|
461
533
|
|
|
462
|
-
interface CellSlotCtx { columnId:
|
|
534
|
+
interface CellSlotCtx { columnId: string; column: TableColumn<any, unknown>; row: any; value: any; }
|
|
463
535
|
|
|
464
|
-
interface EditorSlotCtx { columnId:
|
|
536
|
+
interface EditorSlotCtx { columnId: string; column: TableColumn<any, unknown>; row: any; value: any; commit: (value: any) => void; cancel: () => void; columnLabel: string; autofocus: boolean; }
|
|
465
537
|
|
|
466
538
|
interface DataTableProps {
|
|
467
539
|
/**
|
|
@@ -610,23 +682,23 @@ interface DataTableProps {
|
|
|
610
682
|
* 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
683
|
*/
|
|
612
684
|
maxHeight?: string;
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
onFilterChange?: (
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
685
|
+
onActivecellChange?: (payload: DataTableActiveCellChangePayload) => void;
|
|
686
|
+
onCellEditCommit?: (payload: DataTableCellEditCommitPayload) => void;
|
|
687
|
+
onExpandChange?: (payload: ExpandedState) => void;
|
|
688
|
+
onFilterChange?: (payload: DataTableFilterChangePayload) => void;
|
|
689
|
+
onGroupChange?: (payload: GroupingState) => void;
|
|
690
|
+
onHistoryChange?: (payload: DataTableHistoryChangePayload) => void;
|
|
691
|
+
onPageChange?: (payload: PaginationState) => void;
|
|
692
|
+
onPinChange?: (payload: ColumnPinningState) => void;
|
|
693
|
+
onRangeChange?: (payload: DataTableRangeChangePayload) => void;
|
|
694
|
+
onReorderChange?: (payload: ColumnOrderState) => void;
|
|
695
|
+
onResizeChange?: (payload: ColumnSizingState) => void;
|
|
696
|
+
onRowActivate?: (payload: DataTableRowActivatePayload) => void;
|
|
697
|
+
onRowEditCommit?: (payload: DataTableRowEditCommitPayload) => void;
|
|
698
|
+
onSelectionChange?: (payload: RowSelectionState) => void;
|
|
699
|
+
onSortChange?: (payload: SortingState) => void;
|
|
700
|
+
onVisibilityChange?: (payload: VisibilityState) => void;
|
|
701
|
+
onVisibleRangeChange?: (payload: DataTableVisibleRangeChangePayload) => void;
|
|
630
702
|
// D-131: default slot resolved via children() at body top
|
|
631
703
|
children?: JSX.Element;
|
|
632
704
|
groupBarSlot?: (ctx: GroupBarSlotCtx) => JSX.Element;
|
|
@@ -638,52 +710,52 @@ interface DataTableProps {
|
|
|
638
710
|
filterSlot?: (ctx: FilterSlotCtx) => JSX.Element;
|
|
639
711
|
cellSlot?: (ctx: CellSlotCtx) => JSX.Element;
|
|
640
712
|
editorSlot?: (ctx: EditorSlotCtx) => JSX.Element;
|
|
641
|
-
slots?: { [key: `colHeader-${string}`]: ((ctx: { columnId:
|
|
713
|
+
slots?: { [key: `colHeader-${string}`]: ((ctx: { columnId: string; column: TableColumn<any, unknown>; label: string }) => JSX.Element) | undefined; [key: `filter-${string}`]: ((ctx: { columnId: string; value: any; uniqueValues: any[]; minMax: [number, number] | null; columnLabel: string; setFilter: (columnId: string, value: any) => void }) => JSX.Element) | undefined; [key: `cell-${string}`]: ((ctx: { columnId: string; column: TableColumn<any, unknown>; row: any; value: any }) => JSX.Element) | undefined; [key: `editor-${string}`]: ((ctx: { columnId: string; column: TableColumn<any, unknown>; row: any; value: any; commit: (value: any) => void; cancel: () => void; columnLabel: string; autofocus: boolean }) => JSX.Element) | undefined; [key: string]: ((...args: any[]) => JSX.Element) | undefined; };
|
|
642
714
|
ref?: (h: DataTableHandle) => void;
|
|
643
715
|
}
|
|
644
716
|
|
|
645
717
|
export interface DataTableHandle {
|
|
646
|
-
sortColumn: (
|
|
647
|
-
clearSorting: (
|
|
648
|
-
toggleRowExpanded: (
|
|
649
|
-
expandAll: (
|
|
650
|
-
collapseAll: (
|
|
651
|
-
getExpandedRows: (
|
|
652
|
-
applyGrouping: (
|
|
653
|
-
clearGrouping: (
|
|
654
|
-
getFacetedUniqueValues: (
|
|
655
|
-
getFacetedMinMaxValues: (
|
|
656
|
-
getColumnDefs: (
|
|
657
|
-
toggleAllRows: (
|
|
658
|
-
clearSelection: (
|
|
659
|
-
getSelectedRows: (
|
|
660
|
-
setPage: (
|
|
661
|
-
setRowsPerPage: (
|
|
662
|
-
toggleColumnVisibility: (
|
|
663
|
-
applyColumnOrder: (
|
|
664
|
-
resetColumnSizing: (
|
|
665
|
-
pinColumn: (
|
|
666
|
-
focusCell: (
|
|
667
|
-
getActiveCell: (
|
|
668
|
-
clearActiveCell: (
|
|
718
|
+
sortColumn: (colId: string, desc?: boolean) => void;
|
|
719
|
+
clearSorting: () => void;
|
|
720
|
+
toggleRowExpanded: (rowId: string | number) => void;
|
|
721
|
+
expandAll: () => void;
|
|
722
|
+
collapseAll: () => void;
|
|
723
|
+
getExpandedRows: () => any[];
|
|
724
|
+
applyGrouping: (cols: string[]) => void;
|
|
725
|
+
clearGrouping: () => void;
|
|
726
|
+
getFacetedUniqueValues: (colId: string) => any[];
|
|
727
|
+
getFacetedMinMaxValues: (colId: string) => [number, number] | null;
|
|
728
|
+
getColumnDefs: () => ColumnDef<any, any>[];
|
|
729
|
+
toggleAllRows: (value?: boolean) => void;
|
|
730
|
+
clearSelection: () => void;
|
|
731
|
+
getSelectedRows: () => any[];
|
|
732
|
+
setPage: (idx: number) => void;
|
|
733
|
+
setRowsPerPage: (size: number) => void;
|
|
734
|
+
toggleColumnVisibility: (colId: string) => void;
|
|
735
|
+
applyColumnOrder: (order: string[]) => void;
|
|
736
|
+
resetColumnSizing: () => void;
|
|
737
|
+
pinColumn: (colId: string, side: 'left' | 'right' | false) => void;
|
|
738
|
+
focusCell: (rowIndex: number, colIndex: number) => void;
|
|
739
|
+
getActiveCell: () => DataTableActiveCell;
|
|
740
|
+
clearActiveCell: () => void;
|
|
669
741
|
scrollToRow(index: any, options?: { align?: 'start' | 'center' | 'end' | 'auto'; behavior?: 'auto' | 'smooth' | 'instant'; }): void;
|
|
670
|
-
getScrollElement()
|
|
671
|
-
getRowIndexRelativeToPage: (
|
|
672
|
-
editCell: (
|
|
673
|
-
commitEditing: (
|
|
674
|
-
editRow: (
|
|
675
|
-
getSelectedRange: (
|
|
676
|
-
cut: (
|
|
677
|
-
undo: (
|
|
678
|
-
redo: (
|
|
679
|
-
canUndo: (
|
|
680
|
-
canRedo: (
|
|
681
|
-
clearHistory: (
|
|
742
|
+
getScrollElement: () => HTMLElement | null;
|
|
743
|
+
getRowIndexRelativeToPage: (absRow?: number) => number;
|
|
744
|
+
editCell: (rowIndex: number, colIndex: number) => void;
|
|
745
|
+
commitEditing: () => void;
|
|
746
|
+
editRow: (rowIndex: number) => void;
|
|
747
|
+
getSelectedRange: () => DataTableRange;
|
|
748
|
+
cut: () => void;
|
|
749
|
+
undo: () => void;
|
|
750
|
+
redo: () => void;
|
|
751
|
+
canUndo: () => boolean;
|
|
752
|
+
canRedo: () => boolean;
|
|
753
|
+
clearHistory: () => void;
|
|
682
754
|
}
|
|
683
755
|
|
|
684
756
|
export default function DataTable(_props: DataTableProps): JSX.Element {
|
|
685
757
|
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);
|
|
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', '
|
|
758
|
+
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', 'onActivecellChange', 'onCellEditCommit', 'onExpandChange', 'onFilterChange', 'onGroupChange', 'onHistoryChange', 'onPageChange', 'onPinChange', 'onRangeChange', 'onReorderChange', 'onResizeChange', 'onRowActivate', 'onRowEditCommit', 'onSelectionChange', 'onSortChange', 'onVisibilityChange', 'onVisibleRangeChange']);
|
|
687
759
|
const resolved = () => local.children;
|
|
688
760
|
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 }); });
|
|
689
761
|
|
package/src/index.ts
CHANGED
|
@@ -14,3 +14,4 @@ export { default as DetailPanel } from './DetailPanel';
|
|
|
14
14
|
|
|
15
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';
|
|
17
|
+
export type * from './DataTable';
|