@skygraph/react 0.0.0-placeholder.0 → 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/LICENSE +21 -0
- package/dist/Table-BqN2u5ma.d.cts +1015 -0
- package/dist/Table-IvijKCyd.d.ts +1015 -0
- package/dist/chunk-2OCEO636.js +91 -0
- package/dist/chunk-2OCEO636.js.map +1 -0
- package/dist/chunk-6SHHUUAE.js +1667 -0
- package/dist/chunk-6SHHUUAE.js.map +1 -0
- package/dist/chunk-BNMJSYI2.js +54 -0
- package/dist/chunk-BNMJSYI2.js.map +1 -0
- package/dist/chunk-DRBAZI46.js +57 -0
- package/dist/chunk-DRBAZI46.js.map +1 -0
- package/dist/chunk-GJDDPZH7.js +226 -0
- package/dist/chunk-GJDDPZH7.js.map +1 -0
- package/dist/chunk-KCFWFDSP.js +847 -0
- package/dist/chunk-KCFWFDSP.js.map +1 -0
- package/dist/chunk-MJAEAFPN.js +3791 -0
- package/dist/chunk-MJAEAFPN.js.map +1 -0
- package/dist/chunk-MLEBVELO.js +1412 -0
- package/dist/chunk-MLEBVELO.js.map +1 -0
- package/dist/chunk-SEQI65CF.js +61 -0
- package/dist/chunk-SEQI65CF.js.map +1 -0
- package/dist/chunk-ZJF6SJLP.js +200 -0
- package/dist/chunk-ZJF6SJLP.js.map +1 -0
- package/dist/common-CdpocIEz.d.cts +27 -0
- package/dist/common-CdpocIEz.d.ts +27 -0
- package/dist/datagrid-B6hg5yJh.d.cts +200 -0
- package/dist/datagrid-B6hg5yJh.d.ts +200 -0
- package/dist/datagrid.cjs +1052 -0
- package/dist/datagrid.cjs.map +1 -0
- package/dist/datagrid.d.cts +2 -0
- package/dist/datagrid.d.ts +2 -0
- package/dist/datagrid.js +10 -0
- package/dist/datagrid.js.map +1 -0
- package/dist/devtools.cjs +253 -0
- package/dist/devtools.cjs.map +1 -0
- package/dist/devtools.d.cts +29 -0
- package/dist/devtools.d.ts +29 -0
- package/dist/devtools.js +9 -0
- package/dist/devtools.js.map +1 -0
- package/dist/form.cjs +1723 -0
- package/dist/form.cjs.map +1 -0
- package/dist/form.d.cts +530 -0
- package/dist/form.d.ts +530 -0
- package/dist/form.js +49 -0
- package/dist/form.js.map +1 -0
- package/dist/index.cjs +22419 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3671 -0
- package/dist/index.d.ts +3671 -0
- package/dist/index.js +14087 -0
- package/dist/index.js.map +1 -0
- package/dist/table.cjs +4130 -0
- package/dist/table.cjs.map +1 -0
- package/dist/table.d.cts +31 -0
- package/dist/table.d.ts +31 -0
- package/dist/table.js +26 -0
- package/dist/table.js.map +1 -0
- package/dist/tree.cjs +1821 -0
- package/dist/tree.cjs.map +1 -0
- package/dist/tree.d.cts +348 -0
- package/dist/tree.d.ts +348 -0
- package/dist/tree.js +13 -0
- package/dist/tree.js.map +1 -0
- package/dist/virtual.cjs +145 -0
- package/dist/virtual.cjs.map +1 -0
- package/dist/virtual.d.cts +50 -0
- package/dist/virtual.d.ts +50 -0
- package/dist/virtual.js +11 -0
- package/dist/virtual.js.map +1 -0
- package/package.json +108 -18
- package/README.md +0 -12
- package/index.js +0 -3
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
/** Scalar value stored in or edited for a grid cell. */
|
|
4
|
+
type CellValue = string | number | boolean | null | undefined;
|
|
5
|
+
/** Column definition: display, sizing, sorting, editing, and optional formula. */
|
|
6
|
+
interface DataGridColumn<R = Record<string, unknown>> {
|
|
7
|
+
/** Field key on each row object. */
|
|
8
|
+
key: string;
|
|
9
|
+
/** Header cell content. */
|
|
10
|
+
title: React__default.ReactNode;
|
|
11
|
+
/** Initial column width in pixels. */
|
|
12
|
+
width?: number;
|
|
13
|
+
/** Minimum width when resizing. */
|
|
14
|
+
minWidth?: number;
|
|
15
|
+
/** Maximum width when resizing. */
|
|
16
|
+
maxWidth?: number;
|
|
17
|
+
/** Pins the column to the left or right of the scroll body. */
|
|
18
|
+
frozen?: 'left' | 'right';
|
|
19
|
+
/** When `false`, disables drag-to-resize on this column. */
|
|
20
|
+
resizable?: boolean;
|
|
21
|
+
/** Enables click-to-sort when `onSort` is provided. */
|
|
22
|
+
sortable?: boolean;
|
|
23
|
+
/** Enables in-cell editing, or per-row gate via function. */
|
|
24
|
+
editable?: boolean | ((row: R, rowIndex: number) => boolean);
|
|
25
|
+
/** Cell text alignment. */
|
|
26
|
+
align?: 'left' | 'center' | 'right';
|
|
27
|
+
/** Custom cell body; defaults to stringified `value`. */
|
|
28
|
+
render?: (value: CellValue, row: R, rowIndex: number) => React__default.ReactNode;
|
|
29
|
+
/** Custom in-place editor component for this column. */
|
|
30
|
+
editor?: (props: CellEditorProps<R>) => React__default.ReactNode;
|
|
31
|
+
/** Derives displayed value without mutating row data. */
|
|
32
|
+
formula?: (row: R) => CellValue;
|
|
33
|
+
/** Class name on body cells. */
|
|
34
|
+
className?: string;
|
|
35
|
+
/** Class name on the header cell. */
|
|
36
|
+
headerClassName?: string;
|
|
37
|
+
}
|
|
38
|
+
/** Props passed to a custom cell editor implementation. */
|
|
39
|
+
interface CellEditorProps<R = Record<string, unknown>> {
|
|
40
|
+
/** Value being edited. */
|
|
41
|
+
value: CellValue;
|
|
42
|
+
/** Row record. */
|
|
43
|
+
row: R;
|
|
44
|
+
/** Row index in `data`. */
|
|
45
|
+
rowIndex: number;
|
|
46
|
+
/** Column definition for this cell. */
|
|
47
|
+
column: DataGridColumn<R>;
|
|
48
|
+
/** Updates the draft value (commit via `onCommit`). */
|
|
49
|
+
onChange: (value: CellValue) => void;
|
|
50
|
+
/** Accepts the draft and closes the editor. */
|
|
51
|
+
onCommit: () => void;
|
|
52
|
+
/** Discards edits and closes the editor. */
|
|
53
|
+
onCancel: () => void;
|
|
54
|
+
}
|
|
55
|
+
/** Zero-based row and column indices of one cell. */
|
|
56
|
+
interface CellPosition {
|
|
57
|
+
/** Row index in `data`. */
|
|
58
|
+
row: number;
|
|
59
|
+
/** Column index in the rendered column order. */
|
|
60
|
+
col: number;
|
|
61
|
+
}
|
|
62
|
+
/** Inclusive rectangular selection between two cells. */
|
|
63
|
+
interface CellRange {
|
|
64
|
+
/** Anchor corner of the range. */
|
|
65
|
+
start: CellPosition;
|
|
66
|
+
/** Opposite corner of the range. */
|
|
67
|
+
end: CellPosition;
|
|
68
|
+
}
|
|
69
|
+
/** Summary row definition for the DataGrid footer. */
|
|
70
|
+
interface DataGridSummaryRow<R = Record<string, unknown>> {
|
|
71
|
+
/** Returns content for each column key. */
|
|
72
|
+
render: (columnKey: string, data: R[]) => React__default.ReactNode;
|
|
73
|
+
/** Optional class for the summary row. */
|
|
74
|
+
className?: string;
|
|
75
|
+
}
|
|
76
|
+
/** Context menu item for cells. */
|
|
77
|
+
interface DataGridContextMenuItem {
|
|
78
|
+
key: string;
|
|
79
|
+
label: React__default.ReactNode;
|
|
80
|
+
onClick: () => void;
|
|
81
|
+
danger?: boolean;
|
|
82
|
+
disabled?: boolean;
|
|
83
|
+
divider?: boolean;
|
|
84
|
+
}
|
|
85
|
+
/** Props for the virtualized keyboard-driven data grid. */
|
|
86
|
+
interface DataGridProps<R = Record<string, unknown>> {
|
|
87
|
+
/** Column definitions in base order (frozen columns are reordered internally). */
|
|
88
|
+
columns: DataGridColumn<R>[];
|
|
89
|
+
/** Row records to render. */
|
|
90
|
+
data: R[];
|
|
91
|
+
/** Row React `key` field name or resolver function. */
|
|
92
|
+
rowKey: keyof R | ((row: R, index: number) => React__default.Key);
|
|
93
|
+
/**
|
|
94
|
+
* Body row height in pixels.
|
|
95
|
+
* @default 36
|
|
96
|
+
*/
|
|
97
|
+
rowHeight?: number;
|
|
98
|
+
/**
|
|
99
|
+
* Header row height in pixels.
|
|
100
|
+
* @default 40
|
|
101
|
+
*/
|
|
102
|
+
headerHeight?: number;
|
|
103
|
+
/**
|
|
104
|
+
* Grid width.
|
|
105
|
+
* @default '100%'
|
|
106
|
+
*/
|
|
107
|
+
width?: number | string;
|
|
108
|
+
/**
|
|
109
|
+
* Total grid height including header.
|
|
110
|
+
* @default 400
|
|
111
|
+
*/
|
|
112
|
+
height?: number | string;
|
|
113
|
+
/** Root element class name. */
|
|
114
|
+
className?: string;
|
|
115
|
+
/** Root element inline styles. */
|
|
116
|
+
style?: React__default.CSSProperties;
|
|
117
|
+
/** Controlled set of selected row keys. */
|
|
118
|
+
selectedRows?: Set<React__default.Key>;
|
|
119
|
+
/** Row selection change handler. */
|
|
120
|
+
onSelectedRowsChange?: (keys: Set<React__default.Key>) => void;
|
|
121
|
+
/** Persists a cell value after inline edit commit. */
|
|
122
|
+
onCellEdit?: (rowIndex: number, columnKey: string, value: CellValue) => void;
|
|
123
|
+
/** Current sort column `key` for header indicators. */
|
|
124
|
+
sortColumn?: string;
|
|
125
|
+
/** Current sort direction for `sortColumn`. */
|
|
126
|
+
sortDirection?: 'asc' | 'desc';
|
|
127
|
+
/** Request sort by column key and direction. */
|
|
128
|
+
onSort?: (column: string, direction: 'asc' | 'desc') => void;
|
|
129
|
+
/** Copy handler for Ctrl/Cmd+C from the active cell. */
|
|
130
|
+
onCopy?: (data: string) => void;
|
|
131
|
+
/** Paste handler for Ctrl/Cmd+V into the active cell. */
|
|
132
|
+
onPaste?: (data: string, target: CellPosition) => void;
|
|
133
|
+
/** Optional per-keydown hook (not wired in default grid body). */
|
|
134
|
+
onCellKeyDown?: (e: React__default.KeyboardEvent, cell: CellPosition) => void;
|
|
135
|
+
/**
|
|
136
|
+
* Extra rows rendered above/below the viewport for smooth scrolling.
|
|
137
|
+
* @default 5
|
|
138
|
+
*/
|
|
139
|
+
overscan?: number;
|
|
140
|
+
/** Localized strings for empty and selection UI. */
|
|
141
|
+
locale?: DataGridLocale;
|
|
142
|
+
/** Shows a checkbox column for row selection. */
|
|
143
|
+
rowSelection?: boolean;
|
|
144
|
+
/** Zebra-striped rows. */
|
|
145
|
+
striped?: boolean;
|
|
146
|
+
/** Highlight row on hover. @default true */
|
|
147
|
+
highlightOnHover?: boolean;
|
|
148
|
+
/** Prepend a row number column. */
|
|
149
|
+
showRowNumber?: boolean;
|
|
150
|
+
/** Summary/footer rows at the bottom of the grid. */
|
|
151
|
+
summaryRows?: DataGridSummaryRow<R>[];
|
|
152
|
+
/** Conditional class name per cell for styling. */
|
|
153
|
+
cellClassName?: (value: CellValue, row: R, rowIndex: number, column: DataGridColumn<R>) => string | undefined;
|
|
154
|
+
/** Conditional inline style per cell. */
|
|
155
|
+
cellStyle?: (value: CellValue, row: R, rowIndex: number, column: DataGridColumn<R>) => React__default.CSSProperties | undefined;
|
|
156
|
+
/** Enables column drag reorder. */
|
|
157
|
+
columnReorder?: boolean;
|
|
158
|
+
/** Fires after column order changes via drag. */
|
|
159
|
+
onColumnOrderChange?: (columnKeys: string[]) => void;
|
|
160
|
+
/** Builds context menu items for right-click on a cell. */
|
|
161
|
+
onContextMenu?: (rowIndex: number, columnKey: string, row: R) => DataGridContextMenuItem[];
|
|
162
|
+
/** Called when a row is clicked. */
|
|
163
|
+
onRowClick?: (row: R, rowIndex: number) => void;
|
|
164
|
+
/** Called when a row is double-clicked. */
|
|
165
|
+
onRowDoubleClick?: (row: R, rowIndex: number) => void;
|
|
166
|
+
/** Row class name or function for conditional row styling. */
|
|
167
|
+
rowClassName?: string | ((row: R, rowIndex: number) => string);
|
|
168
|
+
/** Loading overlay. */
|
|
169
|
+
loading?: boolean;
|
|
170
|
+
/** Custom empty state content. */
|
|
171
|
+
emptyContent?: React__default.ReactNode;
|
|
172
|
+
}
|
|
173
|
+
/** Strings for empty state and future selection UI. */
|
|
174
|
+
interface DataGridLocale {
|
|
175
|
+
/** Message when `data` is empty. */
|
|
176
|
+
noData?: string;
|
|
177
|
+
/** Label for select-all control when implemented. */
|
|
178
|
+
selectAll?: string;
|
|
179
|
+
}
|
|
180
|
+
/** Imperative handles for scroll and focus APIs. */
|
|
181
|
+
interface DataGridRef {
|
|
182
|
+
/** Scrolls the virtual body so the row index is visible. */
|
|
183
|
+
scrollToRow: (index: number, align?: 'start' | 'center' | 'end') => void;
|
|
184
|
+
/** Placeholder for horizontal scroll-to-column (not implemented). */
|
|
185
|
+
scrollToColumn: (index: number) => void;
|
|
186
|
+
/** Returns the focused cell position, if any. */
|
|
187
|
+
getActiveCell: () => CellPosition | null;
|
|
188
|
+
/** Sets the focused cell or clears focus. */
|
|
189
|
+
setActiveCell: (pos: CellPosition | null) => void;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Virtualized table grid with sortable headers, resizable columns, inline editing,
|
|
194
|
+
* row selection, striped rows, summary footer, context menu, column reorder, and clipboard hooks.
|
|
195
|
+
*/
|
|
196
|
+
declare const DataGrid: <R extends Record<string, unknown>>(props: DataGridProps<R> & {
|
|
197
|
+
ref?: React__default.Ref<DataGridRef>;
|
|
198
|
+
}) => React__default.ReactElement;
|
|
199
|
+
|
|
200
|
+
export { type CellEditorProps as C, DataGrid as D, type CellPosition as a, type CellRange as b, type CellValue as c, type DataGridColumn as d, type DataGridContextMenuItem as e, type DataGridLocale as f, type DataGridProps as g, type DataGridRef as h, type DataGridSummaryRow as i };
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
/** Scalar value stored in or edited for a grid cell. */
|
|
4
|
+
type CellValue = string | number | boolean | null | undefined;
|
|
5
|
+
/** Column definition: display, sizing, sorting, editing, and optional formula. */
|
|
6
|
+
interface DataGridColumn<R = Record<string, unknown>> {
|
|
7
|
+
/** Field key on each row object. */
|
|
8
|
+
key: string;
|
|
9
|
+
/** Header cell content. */
|
|
10
|
+
title: React__default.ReactNode;
|
|
11
|
+
/** Initial column width in pixels. */
|
|
12
|
+
width?: number;
|
|
13
|
+
/** Minimum width when resizing. */
|
|
14
|
+
minWidth?: number;
|
|
15
|
+
/** Maximum width when resizing. */
|
|
16
|
+
maxWidth?: number;
|
|
17
|
+
/** Pins the column to the left or right of the scroll body. */
|
|
18
|
+
frozen?: 'left' | 'right';
|
|
19
|
+
/** When `false`, disables drag-to-resize on this column. */
|
|
20
|
+
resizable?: boolean;
|
|
21
|
+
/** Enables click-to-sort when `onSort` is provided. */
|
|
22
|
+
sortable?: boolean;
|
|
23
|
+
/** Enables in-cell editing, or per-row gate via function. */
|
|
24
|
+
editable?: boolean | ((row: R, rowIndex: number) => boolean);
|
|
25
|
+
/** Cell text alignment. */
|
|
26
|
+
align?: 'left' | 'center' | 'right';
|
|
27
|
+
/** Custom cell body; defaults to stringified `value`. */
|
|
28
|
+
render?: (value: CellValue, row: R, rowIndex: number) => React__default.ReactNode;
|
|
29
|
+
/** Custom in-place editor component for this column. */
|
|
30
|
+
editor?: (props: CellEditorProps<R>) => React__default.ReactNode;
|
|
31
|
+
/** Derives displayed value without mutating row data. */
|
|
32
|
+
formula?: (row: R) => CellValue;
|
|
33
|
+
/** Class name on body cells. */
|
|
34
|
+
className?: string;
|
|
35
|
+
/** Class name on the header cell. */
|
|
36
|
+
headerClassName?: string;
|
|
37
|
+
}
|
|
38
|
+
/** Props passed to a custom cell editor implementation. */
|
|
39
|
+
interface CellEditorProps<R = Record<string, unknown>> {
|
|
40
|
+
/** Value being edited. */
|
|
41
|
+
value: CellValue;
|
|
42
|
+
/** Row record. */
|
|
43
|
+
row: R;
|
|
44
|
+
/** Row index in `data`. */
|
|
45
|
+
rowIndex: number;
|
|
46
|
+
/** Column definition for this cell. */
|
|
47
|
+
column: DataGridColumn<R>;
|
|
48
|
+
/** Updates the draft value (commit via `onCommit`). */
|
|
49
|
+
onChange: (value: CellValue) => void;
|
|
50
|
+
/** Accepts the draft and closes the editor. */
|
|
51
|
+
onCommit: () => void;
|
|
52
|
+
/** Discards edits and closes the editor. */
|
|
53
|
+
onCancel: () => void;
|
|
54
|
+
}
|
|
55
|
+
/** Zero-based row and column indices of one cell. */
|
|
56
|
+
interface CellPosition {
|
|
57
|
+
/** Row index in `data`. */
|
|
58
|
+
row: number;
|
|
59
|
+
/** Column index in the rendered column order. */
|
|
60
|
+
col: number;
|
|
61
|
+
}
|
|
62
|
+
/** Inclusive rectangular selection between two cells. */
|
|
63
|
+
interface CellRange {
|
|
64
|
+
/** Anchor corner of the range. */
|
|
65
|
+
start: CellPosition;
|
|
66
|
+
/** Opposite corner of the range. */
|
|
67
|
+
end: CellPosition;
|
|
68
|
+
}
|
|
69
|
+
/** Summary row definition for the DataGrid footer. */
|
|
70
|
+
interface DataGridSummaryRow<R = Record<string, unknown>> {
|
|
71
|
+
/** Returns content for each column key. */
|
|
72
|
+
render: (columnKey: string, data: R[]) => React__default.ReactNode;
|
|
73
|
+
/** Optional class for the summary row. */
|
|
74
|
+
className?: string;
|
|
75
|
+
}
|
|
76
|
+
/** Context menu item for cells. */
|
|
77
|
+
interface DataGridContextMenuItem {
|
|
78
|
+
key: string;
|
|
79
|
+
label: React__default.ReactNode;
|
|
80
|
+
onClick: () => void;
|
|
81
|
+
danger?: boolean;
|
|
82
|
+
disabled?: boolean;
|
|
83
|
+
divider?: boolean;
|
|
84
|
+
}
|
|
85
|
+
/** Props for the virtualized keyboard-driven data grid. */
|
|
86
|
+
interface DataGridProps<R = Record<string, unknown>> {
|
|
87
|
+
/** Column definitions in base order (frozen columns are reordered internally). */
|
|
88
|
+
columns: DataGridColumn<R>[];
|
|
89
|
+
/** Row records to render. */
|
|
90
|
+
data: R[];
|
|
91
|
+
/** Row React `key` field name or resolver function. */
|
|
92
|
+
rowKey: keyof R | ((row: R, index: number) => React__default.Key);
|
|
93
|
+
/**
|
|
94
|
+
* Body row height in pixels.
|
|
95
|
+
* @default 36
|
|
96
|
+
*/
|
|
97
|
+
rowHeight?: number;
|
|
98
|
+
/**
|
|
99
|
+
* Header row height in pixels.
|
|
100
|
+
* @default 40
|
|
101
|
+
*/
|
|
102
|
+
headerHeight?: number;
|
|
103
|
+
/**
|
|
104
|
+
* Grid width.
|
|
105
|
+
* @default '100%'
|
|
106
|
+
*/
|
|
107
|
+
width?: number | string;
|
|
108
|
+
/**
|
|
109
|
+
* Total grid height including header.
|
|
110
|
+
* @default 400
|
|
111
|
+
*/
|
|
112
|
+
height?: number | string;
|
|
113
|
+
/** Root element class name. */
|
|
114
|
+
className?: string;
|
|
115
|
+
/** Root element inline styles. */
|
|
116
|
+
style?: React__default.CSSProperties;
|
|
117
|
+
/** Controlled set of selected row keys. */
|
|
118
|
+
selectedRows?: Set<React__default.Key>;
|
|
119
|
+
/** Row selection change handler. */
|
|
120
|
+
onSelectedRowsChange?: (keys: Set<React__default.Key>) => void;
|
|
121
|
+
/** Persists a cell value after inline edit commit. */
|
|
122
|
+
onCellEdit?: (rowIndex: number, columnKey: string, value: CellValue) => void;
|
|
123
|
+
/** Current sort column `key` for header indicators. */
|
|
124
|
+
sortColumn?: string;
|
|
125
|
+
/** Current sort direction for `sortColumn`. */
|
|
126
|
+
sortDirection?: 'asc' | 'desc';
|
|
127
|
+
/** Request sort by column key and direction. */
|
|
128
|
+
onSort?: (column: string, direction: 'asc' | 'desc') => void;
|
|
129
|
+
/** Copy handler for Ctrl/Cmd+C from the active cell. */
|
|
130
|
+
onCopy?: (data: string) => void;
|
|
131
|
+
/** Paste handler for Ctrl/Cmd+V into the active cell. */
|
|
132
|
+
onPaste?: (data: string, target: CellPosition) => void;
|
|
133
|
+
/** Optional per-keydown hook (not wired in default grid body). */
|
|
134
|
+
onCellKeyDown?: (e: React__default.KeyboardEvent, cell: CellPosition) => void;
|
|
135
|
+
/**
|
|
136
|
+
* Extra rows rendered above/below the viewport for smooth scrolling.
|
|
137
|
+
* @default 5
|
|
138
|
+
*/
|
|
139
|
+
overscan?: number;
|
|
140
|
+
/** Localized strings for empty and selection UI. */
|
|
141
|
+
locale?: DataGridLocale;
|
|
142
|
+
/** Shows a checkbox column for row selection. */
|
|
143
|
+
rowSelection?: boolean;
|
|
144
|
+
/** Zebra-striped rows. */
|
|
145
|
+
striped?: boolean;
|
|
146
|
+
/** Highlight row on hover. @default true */
|
|
147
|
+
highlightOnHover?: boolean;
|
|
148
|
+
/** Prepend a row number column. */
|
|
149
|
+
showRowNumber?: boolean;
|
|
150
|
+
/** Summary/footer rows at the bottom of the grid. */
|
|
151
|
+
summaryRows?: DataGridSummaryRow<R>[];
|
|
152
|
+
/** Conditional class name per cell for styling. */
|
|
153
|
+
cellClassName?: (value: CellValue, row: R, rowIndex: number, column: DataGridColumn<R>) => string | undefined;
|
|
154
|
+
/** Conditional inline style per cell. */
|
|
155
|
+
cellStyle?: (value: CellValue, row: R, rowIndex: number, column: DataGridColumn<R>) => React__default.CSSProperties | undefined;
|
|
156
|
+
/** Enables column drag reorder. */
|
|
157
|
+
columnReorder?: boolean;
|
|
158
|
+
/** Fires after column order changes via drag. */
|
|
159
|
+
onColumnOrderChange?: (columnKeys: string[]) => void;
|
|
160
|
+
/** Builds context menu items for right-click on a cell. */
|
|
161
|
+
onContextMenu?: (rowIndex: number, columnKey: string, row: R) => DataGridContextMenuItem[];
|
|
162
|
+
/** Called when a row is clicked. */
|
|
163
|
+
onRowClick?: (row: R, rowIndex: number) => void;
|
|
164
|
+
/** Called when a row is double-clicked. */
|
|
165
|
+
onRowDoubleClick?: (row: R, rowIndex: number) => void;
|
|
166
|
+
/** Row class name or function for conditional row styling. */
|
|
167
|
+
rowClassName?: string | ((row: R, rowIndex: number) => string);
|
|
168
|
+
/** Loading overlay. */
|
|
169
|
+
loading?: boolean;
|
|
170
|
+
/** Custom empty state content. */
|
|
171
|
+
emptyContent?: React__default.ReactNode;
|
|
172
|
+
}
|
|
173
|
+
/** Strings for empty state and future selection UI. */
|
|
174
|
+
interface DataGridLocale {
|
|
175
|
+
/** Message when `data` is empty. */
|
|
176
|
+
noData?: string;
|
|
177
|
+
/** Label for select-all control when implemented. */
|
|
178
|
+
selectAll?: string;
|
|
179
|
+
}
|
|
180
|
+
/** Imperative handles for scroll and focus APIs. */
|
|
181
|
+
interface DataGridRef {
|
|
182
|
+
/** Scrolls the virtual body so the row index is visible. */
|
|
183
|
+
scrollToRow: (index: number, align?: 'start' | 'center' | 'end') => void;
|
|
184
|
+
/** Placeholder for horizontal scroll-to-column (not implemented). */
|
|
185
|
+
scrollToColumn: (index: number) => void;
|
|
186
|
+
/** Returns the focused cell position, if any. */
|
|
187
|
+
getActiveCell: () => CellPosition | null;
|
|
188
|
+
/** Sets the focused cell or clears focus. */
|
|
189
|
+
setActiveCell: (pos: CellPosition | null) => void;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Virtualized table grid with sortable headers, resizable columns, inline editing,
|
|
194
|
+
* row selection, striped rows, summary footer, context menu, column reorder, and clipboard hooks.
|
|
195
|
+
*/
|
|
196
|
+
declare const DataGrid: <R extends Record<string, unknown>>(props: DataGridProps<R> & {
|
|
197
|
+
ref?: React__default.Ref<DataGridRef>;
|
|
198
|
+
}) => React__default.ReactElement;
|
|
199
|
+
|
|
200
|
+
export { type CellEditorProps as C, DataGrid as D, type CellPosition as a, type CellRange as b, type CellValue as c, type DataGridColumn as d, type DataGridContextMenuItem as e, type DataGridLocale as f, type DataGridProps as g, type DataGridRef as h, type DataGridSummaryRow as i };
|