@rozie-ui/data-table-solid 0.1.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/LICENSE +21 -0
- package/README.md +533 -0
- package/dist/index.cjs +5006 -0
- package/dist/index.d.cts +566 -0
- package/dist/index.d.mts +566 -0
- package/dist/index.mjs +4990 -0
- package/package.json +85 -0
- package/src/Column.tsx +149 -0
- package/src/DataTable.tsx +6542 -0
- package/src/DetailPanel.tsx +40 -0
- package/src/EditorCheckbox.tsx +52 -0
- package/src/EditorDate.tsx +71 -0
- package/src/EditorNumber.tsx +77 -0
- package/src/EditorSelect.tsx +79 -0
- package/src/EditorText.tsx +72 -0
- package/src/FilterNumberRange.tsx +77 -0
- package/src/FilterSelect.tsx +60 -0
- package/src/FilterText.tsx +65 -0
- package/src/GroupBar.tsx +207 -0
- package/src/Popover.tsx +416 -0
- package/src/index.ts +16 -0
- package/src/internal/middleware.ts +54 -0
- package/src/themes/base.css +102 -0
- package/src/themes/bootstrap.css +37 -0
- package/src/themes/material.css +35 -0
- package/src/themes/shadcn.css +41 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,566 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
|
|
3
|
+
//#region src/DataTable.d.ts
|
|
4
|
+
interface GroupBarSlotCtx {
|
|
5
|
+
grouping: any;
|
|
6
|
+
groupableColumns: any;
|
|
7
|
+
applyGrouping: any;
|
|
8
|
+
clearGrouping: any;
|
|
9
|
+
}
|
|
10
|
+
interface SelectAllSlotCtx {
|
|
11
|
+
checked: any;
|
|
12
|
+
indeterminate: any;
|
|
13
|
+
toggle: any;
|
|
14
|
+
}
|
|
15
|
+
interface ColHeaderSlotCtx {
|
|
16
|
+
columnId: any;
|
|
17
|
+
column: any;
|
|
18
|
+
label: any;
|
|
19
|
+
}
|
|
20
|
+
interface FilterSlotCtx {
|
|
21
|
+
columnId: any;
|
|
22
|
+
value: any;
|
|
23
|
+
uniqueValues: any;
|
|
24
|
+
minMax: any;
|
|
25
|
+
setFilter: any;
|
|
26
|
+
}
|
|
27
|
+
interface SelectCellSlotCtx {
|
|
28
|
+
row: any;
|
|
29
|
+
checked: any;
|
|
30
|
+
toggle: any;
|
|
31
|
+
}
|
|
32
|
+
interface CellSlotCtx {
|
|
33
|
+
columnId: any;
|
|
34
|
+
column: any;
|
|
35
|
+
row: any;
|
|
36
|
+
value: any;
|
|
37
|
+
}
|
|
38
|
+
interface EditorSlotCtx {
|
|
39
|
+
columnId: any;
|
|
40
|
+
column: any;
|
|
41
|
+
row: any;
|
|
42
|
+
value: any;
|
|
43
|
+
commit: any;
|
|
44
|
+
cancel: any;
|
|
45
|
+
}
|
|
46
|
+
interface DetailSlotCtx {
|
|
47
|
+
row: any;
|
|
48
|
+
}
|
|
49
|
+
interface DataTableProps {
|
|
50
|
+
/**
|
|
51
|
+
* 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).
|
|
52
|
+
* @example
|
|
53
|
+
* <DataTable r-model:data="rows" :columns="cols" />
|
|
54
|
+
*/
|
|
55
|
+
data: any[];
|
|
56
|
+
defaultData?: any[];
|
|
57
|
+
onDataChange?: (data: any[]) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Config-array column fallback (lower precedence than `<Column>` children). Each entry: `{ id?, field, header?, sortable?, filterable?, pinned?, width? }`. Columns may come from this array, from `<Column>` children, or both (id-keyed last-write-wins union).
|
|
60
|
+
*/
|
|
61
|
+
columns?: any[];
|
|
62
|
+
/**
|
|
63
|
+
* Row-selection mode: `'none'` | `'single'` | `'multiple'`. `'multiple'` auto-injects a leading checkbox column with a select-all header.
|
|
64
|
+
*/
|
|
65
|
+
selectionMode?: string;
|
|
66
|
+
/**
|
|
67
|
+
* `SortingState` — `[{ id, desc }]`. Uncontrolled fallback when unbound. Two-way: writes funnel a fresh value through the `sort-change` event regardless of binding.
|
|
68
|
+
*/
|
|
69
|
+
sorting?: any[];
|
|
70
|
+
defaultSorting?: any[];
|
|
71
|
+
onSortingChange?: (sorting: any[]) => void;
|
|
72
|
+
/**
|
|
73
|
+
* The global search string — narrows all columns. Feeds `getFilteredRowModel()`. Surfaces through `filter-change`. Two-way: fires `filter-change` regardless of binding.
|
|
74
|
+
*/
|
|
75
|
+
globalFilter?: string;
|
|
76
|
+
defaultGlobalFilter?: string;
|
|
77
|
+
onGlobalFilterChange?: (globalFilter: string) => void;
|
|
78
|
+
/**
|
|
79
|
+
* `ColumnFiltersState` — `[{ id, value }]` per-column narrowing (gated by each column's `filterable`). Two-way: whole-array replace on write, fires `filter-change`.
|
|
80
|
+
*/
|
|
81
|
+
columnFilters?: any[];
|
|
82
|
+
defaultColumnFilters?: any[];
|
|
83
|
+
onColumnFiltersChange?: (columnFilters: any[]) => void;
|
|
84
|
+
/**
|
|
85
|
+
* `{ pageIndex, pageSize }`. Defaults to `{ pageIndex: 0, pageSize: 10 }`; feeds the prev/next + page-size chrome (and `getPaginationRowModel()`). Two-way: funnels a fresh object through `page-change`.
|
|
86
|
+
*/
|
|
87
|
+
pagination?: Record<string, any>;
|
|
88
|
+
defaultPagination?: Record<string, any>;
|
|
89
|
+
onPaginationChange?: (pagination: Record<string, any>) => void;
|
|
90
|
+
/**
|
|
91
|
+
* Server-side hook: sets `manualPagination` / `manualFiltering` / `manualSorting` so table-core trusts the consumer-supplied rows and only emits the change events (the consumer fetches each page).
|
|
92
|
+
*/
|
|
93
|
+
manual?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Total server-side row count for `manual` pagination; lets the table compute page count when it doesn't hold the full dataset.
|
|
96
|
+
*/
|
|
97
|
+
rowCount?: (number) | null;
|
|
98
|
+
/**
|
|
99
|
+
* Explicit total page count for `manual` pagination; overrides rowCount-derived count.
|
|
100
|
+
*/
|
|
101
|
+
pageCount?: (number) | null;
|
|
102
|
+
/**
|
|
103
|
+
* Opt-in **expandable rows**. When `true`, a leading chevron expander column auto-injects (after the select column) and `getExpandedRowModel` activates; default `false` is byte-identical-off. Every row can expand to reveal a `#detail` panel unless `getSubRows` is supplied (then only rows with children expand). Bind `:expandable="true"` (a bare attr only coerces on Vue+Lit).
|
|
104
|
+
*/
|
|
105
|
+
expandable?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* `ExpandedState` — `{ [rowId]: true }`, or the `true` literal after `expandAll` (declared `type: [Object, Boolean]`). Multi-expand (multiple rows open at once). Surfaces through `expand-change`; uncontrolled fallback (`$data.expandedDefault`) when unbound — the default is `null` so the uncontrolled fallback AND the grouping auto-expand default are reachable (a non-null default would short-circuit them). When grouping is active and `expanded` is untouched, group subtrees auto-expand.
|
|
108
|
+
*/
|
|
109
|
+
expanded?: (Record<string, any> | boolean) | null;
|
|
110
|
+
defaultExpanded?: (Record<string, any> | boolean) | null;
|
|
111
|
+
onExpandedChange?: (expanded: (Record<string, any> | boolean) | null) => void;
|
|
112
|
+
/**
|
|
113
|
+
* Table-level child-row accessor `(originalRow, index) => TData[] | undefined` that drives nested sub-rows. When supplied (with `expandable`), table-core flattens the hierarchy and the expand seam reveals depth-indented child rows. Null → the `#detail` scoped slot is the expand mode.
|
|
114
|
+
*/
|
|
115
|
+
getSubRows?: ((...args: unknown[]) => unknown) | null;
|
|
116
|
+
/**
|
|
117
|
+
* Opt-in gate for the **headless `#groupBar`** host region. Default `false` is byte-identical-off. `getGroupedRowModel` is wired unconditionally (inert when `grouping` is empty), so grouping is driven by the `grouping` model; this flag only gates the consumer-facing group-bar surface (the component ships **no** built-in drag UI).
|
|
118
|
+
*/
|
|
119
|
+
groupable?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* `GroupingState` — an ordered `string[]` of column ids (multi-column → nested groups, e.g. `['region','category']`). An empty/unbound list is ungrouped (byte-identical-off). Group-header rows are collapsible (they ride the expand model). Surfaces through `group-change`; uncontrolled fallback (`$data.groupingDefault`, default `[]`) when unbound — the default is `null` (mirroring `expanded`) so the uncontrolled fallback is reachable and the grouping auto-expand default can activate when a consumer applies grouping without binding `r-model:grouping` (a non-null `[]` default would short-circuit it). All reads are null-guarded, so table-core still receives an array.
|
|
122
|
+
*/
|
|
123
|
+
grouping?: (any[]) | null;
|
|
124
|
+
defaultGrouping?: (any[]) | null;
|
|
125
|
+
onGroupingChange?: (grouping: (any[]) | null) => void;
|
|
126
|
+
/**
|
|
127
|
+
* `RowSelectionState` — `{ [rowId]: true }`. Checkbox-only toggle (the row body does not select). Driven by the `selectionMode` chrome. Two-way: fires `selection-change` regardless of binding.
|
|
128
|
+
*/
|
|
129
|
+
rowSelection?: Record<string, any>;
|
|
130
|
+
defaultRowSelection?: Record<string, any>;
|
|
131
|
+
onRowSelectionChange?: (rowSelection: Record<string, any>) => void;
|
|
132
|
+
/**
|
|
133
|
+
* `VisibilityState` — `{ [colId]: boolean }`. Hidden columns drop automatically from header + body. Two-way: funnels a fresh object through `visibility-change`.
|
|
134
|
+
*/
|
|
135
|
+
columnVisibility?: Record<string, any>;
|
|
136
|
+
defaultColumnVisibility?: Record<string, any>;
|
|
137
|
+
onColumnVisibilityChange?: (columnVisibility: Record<string, any>) => void;
|
|
138
|
+
/**
|
|
139
|
+
* `ColumnSizingState` — `{ [colId]: number }`. Driven live by the pointer-drag resize handle (`columnResizeMode: 'onChange'`). Two-way: fires `resize-change`.
|
|
140
|
+
*/
|
|
141
|
+
columnSizing?: Record<string, any>;
|
|
142
|
+
defaultColumnSizing?: Record<string, any>;
|
|
143
|
+
onColumnSizingChange?: (columnSizing: Record<string, any>) => void;
|
|
144
|
+
/**
|
|
145
|
+
* `ColumnOrderState` — `string[]`. A fresh order array on reorder (never an in-place splice). Two-way: fires `reorder-change`.
|
|
146
|
+
*/
|
|
147
|
+
columnOrder?: any[];
|
|
148
|
+
defaultColumnOrder?: any[];
|
|
149
|
+
onColumnOrderChange?: (columnOrder: any[]) => void;
|
|
150
|
+
/**
|
|
151
|
+
* `ColumnPinningState` — `{ left: string[], right: string[] }`. Pinned columns get `position: sticky` + computed offsets. Defaults to `{ left: [], right: [] }`. Two-way: fires `pin-change`.
|
|
152
|
+
*/
|
|
153
|
+
columnPinning?: Record<string, any>;
|
|
154
|
+
defaultColumnPinning?: Record<string, any>;
|
|
155
|
+
onColumnPinningChange?: (columnPinning: Record<string, any>) => void;
|
|
156
|
+
/**
|
|
157
|
+
* Pure-CSS sticky header: the `<thead>` sticks to the top of the scroll container.
|
|
158
|
+
*/
|
|
159
|
+
stickyHeader?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* `'table'` (default, row-oriented, byte-behaviorally identical to a plain accessible table) | `'grid'` (GA since Phase 63) — lights up the full WAI-ARIA **[grid interaction mode](/components/data-table-grid-mode)**: `role="grid"`, a roving single tab-stop, 2-D APG arrow-key cell navigation, range selection, and clipboard support.
|
|
162
|
+
*/
|
|
163
|
+
interactionMode?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Grid mode only. When `true`, a plain click on an **editable** cell opens its editor immediately (single-click-to-edit) instead of just activating the cell. Default `false` keeps click-to-activate (double-click opens the editor). Shift+click (range selection) and clicks on non-editable cells are unaffected.
|
|
166
|
+
*/
|
|
167
|
+
singleClickEdit?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Grid mode. When `true`, every committed data mutation (cell/row edit, paste, fill, cut, clear) becomes one undo step: Ctrl/Cmd+Z undoes, Ctrl/Cmd+Y or Ctrl/Cmd+Shift+Z redoes. Default `false` records no history and Ctrl+Z/Y are inert.
|
|
170
|
+
*/
|
|
171
|
+
undoable?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* The maximum number of undo steps retained (oldest evicted past this depth). Only consulted when `undoable` is `true`.
|
|
174
|
+
*/
|
|
175
|
+
undoLimit?: number;
|
|
176
|
+
/**
|
|
177
|
+
* Opt-in vertical **row windowing**. When `true`, only the visible slice of rows renders inside a bounded `rdt-scroll` container (with leading/trailing spacer rows preserving total scroll height), windowing over the full filtered + sorted (pre-pagination) model and suppressing the client pagination chrome. Default `false` is byte-identical to a non-virtual table.
|
|
178
|
+
*/
|
|
179
|
+
virtual?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Estimated row height (px) seeding the windowing engine before `measureElement` refines actual heights. Only consulted when `virtual` is on.
|
|
182
|
+
*/
|
|
183
|
+
estimateRowHeight?: number;
|
|
184
|
+
/**
|
|
185
|
+
* 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.
|
|
186
|
+
*/
|
|
187
|
+
maxHeight?: string;
|
|
188
|
+
onSortChange?: (...args: unknown[]) => void;
|
|
189
|
+
onExpandChange?: (...args: unknown[]) => void;
|
|
190
|
+
onGroupChange?: (...args: unknown[]) => void;
|
|
191
|
+
onFilterChange?: (...args: unknown[]) => void;
|
|
192
|
+
onPageChange?: (...args: unknown[]) => void;
|
|
193
|
+
onSelectionChange?: (...args: unknown[]) => void;
|
|
194
|
+
onVisibilityChange?: (...args: unknown[]) => void;
|
|
195
|
+
onResizeChange?: (...args: unknown[]) => void;
|
|
196
|
+
onReorderChange?: (...args: unknown[]) => void;
|
|
197
|
+
onPinChange?: (...args: unknown[]) => void;
|
|
198
|
+
onHistoryChange?: (...args: unknown[]) => void;
|
|
199
|
+
onActivecellChange?: (...args: unknown[]) => void;
|
|
200
|
+
onRangeChange?: (...args: unknown[]) => void;
|
|
201
|
+
onCellEditCommit?: (...args: unknown[]) => void;
|
|
202
|
+
onRowEditCommit?: (...args: unknown[]) => void;
|
|
203
|
+
children?: JSX.Element;
|
|
204
|
+
groupBarSlot?: (ctx: GroupBarSlotCtx) => JSX.Element;
|
|
205
|
+
selectAllSlot?: (ctx: SelectAllSlotCtx) => JSX.Element;
|
|
206
|
+
colHeaderSlot?: (ctx: ColHeaderSlotCtx) => JSX.Element;
|
|
207
|
+
filterSlot?: (ctx: FilterSlotCtx) => JSX.Element;
|
|
208
|
+
selectCellSlot?: (ctx: SelectCellSlotCtx) => JSX.Element;
|
|
209
|
+
cellSlot?: (ctx: CellSlotCtx) => JSX.Element;
|
|
210
|
+
editorSlot?: (ctx: EditorSlotCtx) => JSX.Element;
|
|
211
|
+
detailSlot?: (ctx: DetailSlotCtx) => JSX.Element;
|
|
212
|
+
slots?: Record<string, (ctx: any) => JSX.Element>;
|
|
213
|
+
ref?: (h: DataTableHandle) => void;
|
|
214
|
+
}
|
|
215
|
+
interface DataTableHandle {
|
|
216
|
+
sortColumn: (...args: any[]) => any;
|
|
217
|
+
clearSorting: (...args: any[]) => any;
|
|
218
|
+
toggleRowExpanded: (...args: any[]) => any;
|
|
219
|
+
expandAll: (...args: any[]) => any;
|
|
220
|
+
collapseAll: (...args: any[]) => any;
|
|
221
|
+
getExpandedRows: (...args: any[]) => any;
|
|
222
|
+
applyGrouping: (...args: any[]) => any;
|
|
223
|
+
clearGrouping: (...args: any[]) => any;
|
|
224
|
+
getFacetedUniqueValues: (...args: any[]) => any;
|
|
225
|
+
getFacetedMinMaxValues: (...args: any[]) => any;
|
|
226
|
+
getColumnDefs: (...args: any[]) => any;
|
|
227
|
+
toggleAllRows: (...args: any[]) => any;
|
|
228
|
+
clearSelection: (...args: any[]) => any;
|
|
229
|
+
getSelectedRows: (...args: any[]) => any;
|
|
230
|
+
setPage: (...args: any[]) => any;
|
|
231
|
+
setRowsPerPage: (...args: any[]) => any;
|
|
232
|
+
toggleColumnVisibility: (...args: any[]) => any;
|
|
233
|
+
applyColumnOrder: (...args: any[]) => any;
|
|
234
|
+
resetColumnSizing: (...args: any[]) => any;
|
|
235
|
+
pinColumn: (...args: any[]) => any;
|
|
236
|
+
focusCell: (...args: any[]) => any;
|
|
237
|
+
getActiveCell: (...args: any[]) => any;
|
|
238
|
+
clearActiveCell: (...args: any[]) => any;
|
|
239
|
+
getRowIndexRelativeToPage: (...args: any[]) => any;
|
|
240
|
+
editCell: (...args: any[]) => any;
|
|
241
|
+
commitEditing: (...args: any[]) => any;
|
|
242
|
+
editRow: (...args: any[]) => any;
|
|
243
|
+
getSelectedRange: (...args: any[]) => any;
|
|
244
|
+
cut: (...args: any[]) => any;
|
|
245
|
+
undo: (...args: any[]) => any;
|
|
246
|
+
redo: (...args: any[]) => any;
|
|
247
|
+
canUndo: (...args: any[]) => any;
|
|
248
|
+
canRedo: (...args: any[]) => any;
|
|
249
|
+
clearHistory: (...args: any[]) => any;
|
|
250
|
+
}
|
|
251
|
+
declare function DataTable(_props: DataTableProps): JSX.Element;
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region src/Column.d.ts
|
|
254
|
+
interface ColumnProps {
|
|
255
|
+
/**
|
|
256
|
+
* The column id. Optional — defaults to `field` when omitted. Used as the key in the id-keyed registry union and in the `#cell` / `#colHeader` slot dispatch.
|
|
257
|
+
*/
|
|
258
|
+
id?: string;
|
|
259
|
+
/**
|
|
260
|
+
* The row field this column reads (table-core `accessorKey`). The plain accessor value renders when the `#cell` slot falls through.
|
|
261
|
+
* @example
|
|
262
|
+
* <Column field="email" header="Email" />
|
|
263
|
+
*/
|
|
264
|
+
field?: string;
|
|
265
|
+
/**
|
|
266
|
+
* The header label, rendered when the parent `#colHeader` slot falls through to the plain label.
|
|
267
|
+
*/
|
|
268
|
+
header?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Whether this column participates in click-to-sort. Default `false`. Bind `:sortable="true"` (a bare attr only coerces on Vue+Lit).
|
|
271
|
+
*/
|
|
272
|
+
sortable?: boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Whether this column participates in per-column filtering (the `#filter` slot / faceted filter chrome). Default `false`.
|
|
275
|
+
*/
|
|
276
|
+
filterable?: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* Pin side: `''` (unpinned) | `'left'` | `'right'`. Reserved metadata carried into the parent's column pinning state.
|
|
279
|
+
*/
|
|
280
|
+
pinned?: string;
|
|
281
|
+
/**
|
|
282
|
+
* Optional fixed/initial column width — a CSS length string or a px number.
|
|
283
|
+
*/
|
|
284
|
+
width?: string | number;
|
|
285
|
+
/**
|
|
286
|
+
* Reserved per-column metadata flagging participation in the expand affordance. The expander chevron is its own auto-injected leading column on `<DataTable expandable>`, so this is forward-compat metadata, not the toggle host. Default `false`.
|
|
287
|
+
*/
|
|
288
|
+
expandable?: boolean;
|
|
289
|
+
/**
|
|
290
|
+
* Whether this column is offered to the headless `#groupBar` as a grouping target. Defaults `true` (opt-OUT via `:groupable="false"`); this only filters the groupable-columns list. Whether grouping is engaged is driven by the parent's `grouping` model, never this flag.
|
|
291
|
+
*/
|
|
292
|
+
groupable?: boolean;
|
|
293
|
+
/**
|
|
294
|
+
* The table-core aggregation for this column inside a group-header cell. Either a built-in name string — `'sum'` | `'min'` | `'max'` | `'extent'` | `'mean'` | `'median'` | `'unique'` | `'uniqueCount'` | `'count'` — or a custom function `(columnId, leafRows, childRows) => any` (defensively wrapped by the parent so a throw cannot crash grouping). Null → no aggregation (the group-header cell renders as a placeholder).
|
|
295
|
+
*/
|
|
296
|
+
aggregationFn?: (string | ((...args: unknown[]) => unknown)) | null;
|
|
297
|
+
/**
|
|
298
|
+
* Whether this column's cells are editable (opt-in). Default `false` → the column is read-only and the display↔editor branch never mounts an editor. Bind `:editable="true"` (a bare attr only coerces on Vue+Lit).
|
|
299
|
+
*/
|
|
300
|
+
editable?: boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Built-in editor type for this column: `'text'` | `'number'` | `'select'` | `'checkbox'`. Ignored when a custom `#editor` scoped slot handles the column. Default `'text'`.
|
|
303
|
+
*/
|
|
304
|
+
editor?: string;
|
|
305
|
+
/**
|
|
306
|
+
* Options for `editor: 'select'` — `[{ value, label }]`. Empty for other editor types.
|
|
307
|
+
*/
|
|
308
|
+
editorOptions?: any[];
|
|
309
|
+
/**
|
|
310
|
+
* Synchronous per-column validator `(value, row) => true | string`. A string return is the error message (the editor stays open and the aria-live region announces it). Null → no validation. The parent wraps it defensively against a thrown/non-bool/non-string return.
|
|
311
|
+
*/
|
|
312
|
+
validate?: ((...args: unknown[]) => unknown) | null;
|
|
313
|
+
}
|
|
314
|
+
declare function Column(_props: ColumnProps): JSX.Element;
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/EditorText.d.ts
|
|
317
|
+
interface EditorTextProps {
|
|
318
|
+
/**
|
|
319
|
+
* The column id (mirrors the `#editor` slot scope). Used as the input `aria-label` fallback.
|
|
320
|
+
*/
|
|
321
|
+
columnId?: string;
|
|
322
|
+
/**
|
|
323
|
+
* The table-core column object (opaque passthrough from the `#editor` slot scope).
|
|
324
|
+
*/
|
|
325
|
+
column?: (unknown) | null;
|
|
326
|
+
/**
|
|
327
|
+
* The consumer's row data object (opaque passthrough from the `#editor` slot scope).
|
|
328
|
+
*/
|
|
329
|
+
row?: (unknown) | null;
|
|
330
|
+
/**
|
|
331
|
+
* The current cell value the editor seeds its local draft from (setup-once).
|
|
332
|
+
*/
|
|
333
|
+
value?: (unknown) | null;
|
|
334
|
+
/**
|
|
335
|
+
* `(value) => void` — commit the edited cell value (from the `#editor` slot scope). Null-guarded at call sites.
|
|
336
|
+
*/
|
|
337
|
+
commit?: ((...args: unknown[]) => unknown) | null;
|
|
338
|
+
/**
|
|
339
|
+
* `() => void` — revert the edit and close the editor (from the `#editor` slot scope). Null-guarded at call sites.
|
|
340
|
+
*/
|
|
341
|
+
cancel?: ((...args: unknown[]) => unknown) | null;
|
|
342
|
+
}
|
|
343
|
+
declare function EditorText(_props: EditorTextProps): JSX.Element;
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/EditorNumber.d.ts
|
|
346
|
+
interface EditorNumberProps {
|
|
347
|
+
/**
|
|
348
|
+
* The column id (mirrors the `#editor` slot scope). Used as the input `aria-label`.
|
|
349
|
+
*/
|
|
350
|
+
columnId?: string;
|
|
351
|
+
/**
|
|
352
|
+
* The table-core column object (opaque passthrough from the `#editor` slot scope).
|
|
353
|
+
*/
|
|
354
|
+
column?: (unknown) | null;
|
|
355
|
+
/**
|
|
356
|
+
* The consumer's row data object (opaque passthrough from the `#editor` slot scope).
|
|
357
|
+
*/
|
|
358
|
+
row?: (unknown) | null;
|
|
359
|
+
/**
|
|
360
|
+
* The current cell value the local draft string seeds from (setup-once).
|
|
361
|
+
*/
|
|
362
|
+
value?: (unknown) | null;
|
|
363
|
+
/**
|
|
364
|
+
* `(value) => void` — commit the cell. The draft is coerced with `Number()` at commit time; an empty/whitespace or non-numeric draft commits `null` (never `NaN`). Null-guarded at call sites.
|
|
365
|
+
*/
|
|
366
|
+
commit?: ((...args: unknown[]) => unknown) | null;
|
|
367
|
+
/**
|
|
368
|
+
* `() => void` — revert the edit (Escape). Null-guarded at call sites.
|
|
369
|
+
*/
|
|
370
|
+
cancel?: ((...args: unknown[]) => unknown) | null;
|
|
371
|
+
}
|
|
372
|
+
declare function EditorNumber(_props: EditorNumberProps): JSX.Element;
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region src/EditorSelect.d.ts
|
|
375
|
+
interface EditorSelectProps {
|
|
376
|
+
/**
|
|
377
|
+
* The column id (mirrors the `#editor` slot scope). Used as the select `aria-label`.
|
|
378
|
+
*/
|
|
379
|
+
columnId?: string;
|
|
380
|
+
/**
|
|
381
|
+
* The table-core column object (opaque passthrough from the `#editor` slot scope).
|
|
382
|
+
*/
|
|
383
|
+
column?: (unknown) | null;
|
|
384
|
+
/**
|
|
385
|
+
* The consumer's row data object (opaque passthrough from the `#editor` slot scope).
|
|
386
|
+
*/
|
|
387
|
+
row?: (unknown) | null;
|
|
388
|
+
/**
|
|
389
|
+
* The current cell value the local draft seeds from (setup-once); String-coerced for the `<select>` binding.
|
|
390
|
+
*/
|
|
391
|
+
value?: (unknown) | null;
|
|
392
|
+
/**
|
|
393
|
+
* `(value) => void` — commit the cell with the selected value (Enter / blur). Null-guarded at call sites.
|
|
394
|
+
*/
|
|
395
|
+
commit?: ((...args: unknown[]) => unknown) | null;
|
|
396
|
+
/**
|
|
397
|
+
* `() => void` — revert the edit (Escape). Null-guarded at call sites.
|
|
398
|
+
*/
|
|
399
|
+
cancel?: ((...args: unknown[]) => unknown) | null;
|
|
400
|
+
/**
|
|
401
|
+
* The select options — `[{ value, label }]`. Mirrors `<Column editorOptions>`.
|
|
402
|
+
*/
|
|
403
|
+
options?: any[];
|
|
404
|
+
}
|
|
405
|
+
declare function EditorSelect(_props: EditorSelectProps): JSX.Element;
|
|
406
|
+
//#endregion
|
|
407
|
+
//#region src/EditorCheckbox.d.ts
|
|
408
|
+
interface EditorCheckboxProps {
|
|
409
|
+
/**
|
|
410
|
+
* The column id (mirrors the `#editor` slot scope). Used as the input `aria-label`.
|
|
411
|
+
*/
|
|
412
|
+
columnId?: string;
|
|
413
|
+
/**
|
|
414
|
+
* The table-core column object (opaque passthrough from the `#editor` slot scope).
|
|
415
|
+
*/
|
|
416
|
+
column?: (unknown) | null;
|
|
417
|
+
/**
|
|
418
|
+
* The consumer's row data object (opaque passthrough from the `#editor` slot scope).
|
|
419
|
+
*/
|
|
420
|
+
row?: (unknown) | null;
|
|
421
|
+
/**
|
|
422
|
+
* The current cell value — coerced to a real boolean via `!!` to seed the checkbox `checked` state.
|
|
423
|
+
*/
|
|
424
|
+
value?: (unknown) | null;
|
|
425
|
+
/**
|
|
426
|
+
* `(value) => void` — commit the cell. This editor immediately commits the boolean checked state on `@change`. Null-guarded at call sites.
|
|
427
|
+
*/
|
|
428
|
+
commit?: ((...args: unknown[]) => unknown) | null;
|
|
429
|
+
/**
|
|
430
|
+
* `() => void` — revert the edit (Escape). Null-guarded at call sites.
|
|
431
|
+
*/
|
|
432
|
+
cancel?: ((...args: unknown[]) => unknown) | null;
|
|
433
|
+
}
|
|
434
|
+
declare function EditorCheckbox(_props: EditorCheckboxProps): JSX.Element;
|
|
435
|
+
//#endregion
|
|
436
|
+
//#region src/EditorDate.d.ts
|
|
437
|
+
interface EditorDateProps {
|
|
438
|
+
/**
|
|
439
|
+
* The column id (mirrors the `#editor` slot scope). Used as the input `aria-label`.
|
|
440
|
+
*/
|
|
441
|
+
columnId?: string;
|
|
442
|
+
/**
|
|
443
|
+
* The table-core column object (opaque passthrough from the `#editor` slot scope).
|
|
444
|
+
*/
|
|
445
|
+
column?: (unknown) | null;
|
|
446
|
+
/**
|
|
447
|
+
* The consumer's row data object (opaque passthrough from the `#editor` slot scope).
|
|
448
|
+
*/
|
|
449
|
+
row?: (unknown) | null;
|
|
450
|
+
/**
|
|
451
|
+
* The current cell value the local draft seeds from (setup-once); String-coerced to an ISO `YYYY-MM-DD` string for the native date input.
|
|
452
|
+
*/
|
|
453
|
+
value?: (unknown) | null;
|
|
454
|
+
/**
|
|
455
|
+
* `(value) => void` — commit the cell with the ISO `YYYY-MM-DD` string (Enter / blur). Null-guarded at call sites.
|
|
456
|
+
*/
|
|
457
|
+
commit?: ((...args: unknown[]) => unknown) | null;
|
|
458
|
+
/**
|
|
459
|
+
* `() => void` — revert the edit (Escape). Null-guarded at call sites.
|
|
460
|
+
*/
|
|
461
|
+
cancel?: ((...args: unknown[]) => unknown) | null;
|
|
462
|
+
}
|
|
463
|
+
declare function EditorDate(_props: EditorDateProps): JSX.Element;
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region src/FilterText.d.ts
|
|
466
|
+
interface FilterTextProps {
|
|
467
|
+
/**
|
|
468
|
+
* The column id (mirrors the `#filter` slot scope) — used as the filter key and the input `aria-label`.
|
|
469
|
+
*/
|
|
470
|
+
columnId?: string;
|
|
471
|
+
/**
|
|
472
|
+
* The table-core column object (opaque passthrough from the `#filter` slot scope).
|
|
473
|
+
*/
|
|
474
|
+
column?: (unknown) | null;
|
|
475
|
+
/**
|
|
476
|
+
* The current column filter value the local draft seeds from (setup-once).
|
|
477
|
+
*/
|
|
478
|
+
value?: (unknown) | null;
|
|
479
|
+
/**
|
|
480
|
+
* `(columnId, value) => void` — apply the column filter (Enter / blur applies, Escape clears). Null-guarded at call sites.
|
|
481
|
+
*/
|
|
482
|
+
setFilter?: ((...args: unknown[]) => unknown) | null;
|
|
483
|
+
}
|
|
484
|
+
declare function FilterText(_props: FilterTextProps): JSX.Element;
|
|
485
|
+
//#endregion
|
|
486
|
+
//#region src/FilterNumberRange.d.ts
|
|
487
|
+
interface FilterNumberRangeProps {
|
|
488
|
+
/**
|
|
489
|
+
* The column id (mirrors the `#filter` slot scope) — used as the filter key and the input `aria-label` base.
|
|
490
|
+
*/
|
|
491
|
+
columnId?: string;
|
|
492
|
+
/**
|
|
493
|
+
* The table-core column object (opaque passthrough from the `#filter` slot scope).
|
|
494
|
+
*/
|
|
495
|
+
column?: (unknown) | null;
|
|
496
|
+
/**
|
|
497
|
+
* The current column filter value (`[min, max]` tuple or null) the two inputs seed from (setup-once).
|
|
498
|
+
*/
|
|
499
|
+
value?: (unknown) | null;
|
|
500
|
+
/**
|
|
501
|
+
* `(columnId, value) => void` — apply the column filter as a `[min, max]` tuple (each side coerced to a Number or `undefined`, so a one-sided range works); both empty clears the filter. Null-guarded at call sites.
|
|
502
|
+
*/
|
|
503
|
+
setFilter?: ((...args: unknown[]) => unknown) | null;
|
|
504
|
+
/**
|
|
505
|
+
* The faceted `[min, max]` bounds for this column (`[number, number]` or null) — drives the input placeholders only.
|
|
506
|
+
*/
|
|
507
|
+
minMax?: (unknown) | null;
|
|
508
|
+
}
|
|
509
|
+
declare function FilterNumberRange(_props: FilterNumberRangeProps): JSX.Element;
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region src/FilterSelect.d.ts
|
|
512
|
+
interface FilterSelectProps {
|
|
513
|
+
/**
|
|
514
|
+
* The column id (mirrors the `#filter` slot scope) — used as the filter key and the select `aria-label`.
|
|
515
|
+
*/
|
|
516
|
+
columnId?: string;
|
|
517
|
+
/**
|
|
518
|
+
* The table-core column object (opaque passthrough from the `#filter` slot scope).
|
|
519
|
+
*/
|
|
520
|
+
column?: (unknown) | null;
|
|
521
|
+
/**
|
|
522
|
+
* The current column filter value the select seeds from (String-coerced).
|
|
523
|
+
*/
|
|
524
|
+
value?: (unknown) | null;
|
|
525
|
+
/**
|
|
526
|
+
* `(columnId, value) => void` — apply the column filter on change; the leading empty "All" option clears it. Null-guarded at call sites.
|
|
527
|
+
*/
|
|
528
|
+
setFilter?: ((...args: unknown[]) => unknown) | null;
|
|
529
|
+
/**
|
|
530
|
+
* The faceted distinct keys for this column (cross-filtered, keys only — no occurrence counts) used to build the `<option>` list.
|
|
531
|
+
*/
|
|
532
|
+
uniqueValues?: any[];
|
|
533
|
+
}
|
|
534
|
+
declare function FilterSelect(_props: FilterSelectProps): JSX.Element;
|
|
535
|
+
//#endregion
|
|
536
|
+
//#region src/GroupBar.d.ts
|
|
537
|
+
interface GroupBarProps {
|
|
538
|
+
/**
|
|
539
|
+
* The ordered active grouping key array (read-only source of truth from the `#groupBar` slot scope). This drop-in never keeps its own copy — it always reads this and writes through `applyGrouping` / `clearGrouping`.
|
|
540
|
+
*/
|
|
541
|
+
grouping?: any[];
|
|
542
|
+
/**
|
|
543
|
+
* The columns offered as grouping targets — `[{ id, label }]` — rendered as draggable chips.
|
|
544
|
+
*/
|
|
545
|
+
groupableColumns?: any[];
|
|
546
|
+
/**
|
|
547
|
+
* `(cols: string[]) => void` — the only add/reorder writer for the grouping order. Null-guarded at call sites.
|
|
548
|
+
*/
|
|
549
|
+
applyGrouping?: ((...args: unknown[]) => unknown) | null;
|
|
550
|
+
/**
|
|
551
|
+
* `() => void` — the only clear writer; resets grouping to empty. Null-guarded at call sites.
|
|
552
|
+
*/
|
|
553
|
+
clearGrouping?: ((...args: unknown[]) => unknown) | null;
|
|
554
|
+
}
|
|
555
|
+
declare function GroupBar(_props: GroupBarProps): JSX.Element;
|
|
556
|
+
//#endregion
|
|
557
|
+
//#region src/DetailPanel.d.ts
|
|
558
|
+
interface DetailPanelProps {
|
|
559
|
+
/**
|
|
560
|
+
* The raw row object (the `#detail` slot scope `row` = `row.original`). This drop-in walks its own enumerable keys and String-coerces each value into a key/value definition list; a null row renders an empty list.
|
|
561
|
+
*/
|
|
562
|
+
row?: (unknown) | null;
|
|
563
|
+
}
|
|
564
|
+
declare function DetailPanel(_props: DetailPanelProps): JSX.Element;
|
|
565
|
+
//#endregion
|
|
566
|
+
export { Column, DataTable, DataTable as default, type DataTableHandle, DetailPanel, EditorCheckbox, EditorDate, EditorNumber, EditorSelect, EditorText, FilterNumberRange, FilterSelect, FilterText, GroupBar };
|