react-glide-table 1.1.1 → 1.1.3

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.
@@ -0,0 +1,256 @@
1
+ import { C as CellEditType, a as DataTableClassNames, R as RowSelectionMode, c as DataTableProps, b as DataTableLabels } from './types-BfthylVR.cjs';
2
+ export { D as DEFAULT_DATA_TABLE_LABELS, r as resolveDataTableLabels } from './types-BfthylVR.cjs';
3
+ import { Row, ColumnDef, Table, Updater, RowSelectionState } from '@tanstack/react-table';
4
+ export { ColumnDef, RowSelectionState } from '@tanstack/react-table';
5
+ import { Virtualizer, VirtualItem } from '@tanstack/react-virtual';
6
+ import * as react from 'react';
7
+ import { RefObject } from 'react';
8
+
9
+ /** Neutral default field names for tree conversion */
10
+ declare const DEFAULT_TREE_ID_FIELD = "id";
11
+ declare const DEFAULT_TREE_PARENT_ID_FIELD = "parentId";
12
+ declare const DEFAULT_TREE_CHILDREN_FIELD = "children";
13
+ declare const DEFAULT_TREE_QTY_FIELD = "qty";
14
+
15
+ type EditingCell = {
16
+ rowIndex: number;
17
+ colIndex: number;
18
+ };
19
+ type ColumnDefLike = {
20
+ id?: string;
21
+ accessorKey?: unknown;
22
+ meta?: {
23
+ editable?: boolean;
24
+ editType?: CellEditType;
25
+ };
26
+ };
27
+ declare function isColumnEditable(columnDef: ColumnDefLike): boolean;
28
+ declare function getColumnEditType(columnDef: ColumnDefLike): CellEditType;
29
+ declare function parseCellEditValue(raw: string, editType: CellEditType): {
30
+ ok: true;
31
+ value: string | number | null;
32
+ } | {
33
+ ok: false;
34
+ };
35
+ declare function getCellEditDraftValue(value: unknown): string;
36
+ /** Returns updated data on success; null if parsing fails or the cell is not editable */
37
+ declare function applyCellEdit<T extends Record<string, unknown>>(data: T[], rows: Row<T>[], rowIndex: number, colIndex: number, raw: string): T[] | null;
38
+
39
+ type CellPosition = {
40
+ row: number;
41
+ col: number;
42
+ };
43
+ type CellSelectionBounds = {
44
+ startRow: number;
45
+ endRow: number;
46
+ startCol: number;
47
+ endCol: number;
48
+ };
49
+ type DragState = {
50
+ isSelecting: boolean;
51
+ isFillDragging: boolean;
52
+ start: CellPosition | null;
53
+ end: CellPosition | null;
54
+ /** Fixed anchor opposite the fill handle (top-left) */
55
+ fillAnchor: CellPosition | null;
56
+ fillEnd: CellPosition | null;
57
+ };
58
+ declare function getRowIndexInMergedCell(clientY: number, cellElement: HTMLElement, rowIndex: number, rowSpan: number): number;
59
+ declare function isCellInSelection(rowIndex: number, colIndex: number, bounds: CellSelectionBounds | null, rowSpan?: number): boolean;
60
+ declare const CELL_SELECTION_EDGES_CLASS = "cell-selection-edges";
61
+ type CellSelectionEdgeStyle = {
62
+ /** Full-side inset border applied via ::after */
63
+ ["--selection-edge-shadows"]?: string;
64
+ /** Partial vertical border for merged-cell step (stair) segments */
65
+ ["--selection-edge-gradients"]?: string;
66
+ ["--selection-edge-sizes"]?: string;
67
+ ["--selection-edge-positions"]?: string;
68
+ /** Hide internal horizontal grid lines inside the selection with background color */
69
+ borderBottomColor?: string;
70
+ };
71
+ /**
72
+ * Draws the selection border with ::after (extended -1px at the bottom) plus
73
+ * inset box-shadow / partial gradients so it does not break on the cell's
74
+ * border-bottom.
75
+ *
76
+ * @param isVisuallySelectedAt Whether a logical cell is visually selected
77
+ * (including adjacent merged cells). Used to suppress internal step borders
78
+ * when multiple columns have rowSpan.
79
+ */
80
+ declare function getCellSelectionEdgeStyle(rowIndex: number, colIndex: number, bounds: CellSelectionBounds | null, rowSpan?: number, isVisuallySelectedAt?: (row: number, col: number) => boolean): CellSelectionEdgeStyle | undefined;
81
+ declare function hasCellSelectionEdges(style: CellSelectionEdgeStyle | undefined): boolean;
82
+
83
+ type RowSpanInfo = {
84
+ /** 0 means skip render (merged into a parent row) */
85
+ rowSpan: number;
86
+ isFirstInGroup: boolean;
87
+ };
88
+ type ColumnRowSpanMap = Map<string, RowSpanInfo[]>;
89
+ /**
90
+ * Returns the start row and rowSpan of the merged cell covering a given row.
91
+ * Rows with rowSpan === 0 walk up to the merge origin.
92
+ */
93
+ declare function resolveRowSpanAt(rowSpans: RowSpanInfo[] | undefined, rowIndex: number): {
94
+ startRow: number;
95
+ rowSpan: number;
96
+ };
97
+ /**
98
+ * Computes merge info for every column that has rowSpan meta.
99
+ */
100
+ declare function buildColumnRowSpanMap<T extends Record<string, unknown>>(data: T[], columnKeys: Array<{
101
+ columnId: string;
102
+ rowSpanKey: string;
103
+ }>): ColumnRowSpanMap;
104
+ declare function collectRowSpanColumns<T extends Record<string, unknown>>(columns: ColumnDef<T, unknown>[]): Array<{
105
+ columnId: string;
106
+ rowSpanKey: string;
107
+ }>;
108
+
109
+ type RowData = Record<string, unknown>;
110
+ type DataTableRowContextValue = {
111
+ classNames?: DataTableClassNames;
112
+ rowSpan: {
113
+ enableRowSpan: boolean;
114
+ primaryRowSpanKey?: string;
115
+ columnRowSpanMap: ColumnRowSpanMap;
116
+ hoveredRowIndex: number | null;
117
+ hoveredGroupKey: string | null;
118
+ selectedGroupKeys: Set<string>;
119
+ onRowHover: (rowIndex: number, rowData: RowData) => void;
120
+ };
121
+ selection: {
122
+ rowSelectionMode: RowSelectionMode;
123
+ selectOnRowClick: boolean;
124
+ onRowClick?: (row: RowData, index: number) => void;
125
+ getRowClassName?: (row: RowData, index: number) => string | undefined;
126
+ };
127
+ cellSelection: {
128
+ enableCellSelection: boolean;
129
+ activeSelectionBounds: CellSelectionBounds | null;
130
+ dragState: DragState;
131
+ onCellMouseDown: (rowIndex: number, colIndex: number) => void;
132
+ onCellMouseEnter: (rowIndex: number, colIndex: number) => void;
133
+ onFillHandleMouseDown: (rowIndex: number, colIndex: number) => void;
134
+ };
135
+ cellEdit: {
136
+ editingCell: EditingCell | null;
137
+ draftValue: string;
138
+ onDraftValueChange: (value: string) => void;
139
+ onStartEdit: (rowIndex: number, colIndex: number) => void;
140
+ onCommitEdit: (raw?: string) => boolean;
141
+ onCancelEdit: () => void;
142
+ };
143
+ expand: {
144
+ enableExpand: boolean;
145
+ toggleField?: string;
146
+ expandedRows?: Set<string>;
147
+ preventExpand: boolean;
148
+ onToggleExpand?: (rowKey: string) => void;
149
+ expandRowLabel: string;
150
+ collapseRowLabel: string;
151
+ };
152
+ };
153
+
154
+ type UseGlideTableOptions<T extends Record<string, unknown>> = Omit<DataTableProps<T>, "className" | "classNames" | "slots" | "summary" | "toolbar" | "isPending" | "totalCount" | "filteredCount">;
155
+ type UseGlideTableResult<T extends Record<string, unknown>> = {
156
+ table: Table<T>;
157
+ tableData: T[];
158
+ rows: Row<T>[];
159
+ columnCount: number;
160
+ selectedCount: number;
161
+ labels: DataTableLabels;
162
+ emptyText: string;
163
+ loadingText: string;
164
+ selectionLabel: DataTableLabels["selection"];
165
+ enableCellSelection: boolean;
166
+ shouldVirtualize: boolean;
167
+ scrollRef: RefObject<HTMLDivElement | null>;
168
+ rowVirtualizer: Virtualizer<HTMLDivElement, Element>;
169
+ virtualRows: VirtualItem[];
170
+ paddingTop: number;
171
+ paddingBottom: number;
172
+ rowContextValue: DataTableRowContextValue;
173
+ handleToggleSelect: (row: Row<T>) => void;
174
+ clearHover: () => void;
175
+ };
176
+ declare function useGlideTable<T extends Record<string, unknown>>(options: UseGlideTableOptions<T>): UseGlideTableResult<T>;
177
+
178
+ type UseCellEditOptions<T extends Record<string, unknown>> = {
179
+ data: T[];
180
+ rows: Row<T>[];
181
+ onDataChange?: (data: T[]) => void;
182
+ onCellChange?: (rowId: string, columnId: string, value: unknown) => void;
183
+ };
184
+ declare function useCellEdit<T extends Record<string, unknown>>({ data, rows, onDataChange, onCellChange, }: UseCellEditOptions<T>): {
185
+ editingCell: EditingCell | null;
186
+ draftValue: string;
187
+ setDraftValue: react.Dispatch<react.SetStateAction<string>>;
188
+ startEdit: (rowIndex: number, colIndex: number) => void;
189
+ commitEdit: (raw?: string) => boolean;
190
+ cancelEdit: () => void;
191
+ };
192
+
193
+ type UseCellSelectionOptions<T extends Record<string, unknown>> = {
194
+ data: T[];
195
+ rows: Row<T>[];
196
+ enabled?: boolean;
197
+ onDataChange?: (data: T[]) => void;
198
+ onBatchChange?: (changes: Array<{
199
+ rowId: string;
200
+ columnId: string;
201
+ value: unknown;
202
+ }>) => void;
203
+ };
204
+ declare function useCellSelection<T extends Record<string, unknown>>({ data, rows, enabled, onDataChange, onBatchChange, }: UseCellSelectionOptions<T>): {
205
+ dragState: DragState;
206
+ activeSelectionBounds: CellSelectionBounds | null;
207
+ handleCellMouseDown: (rowIndex: number, colIndex: number) => void;
208
+ handleCellMouseEnter: (rowIndex: number, colIndex: number) => void;
209
+ handleFillHandleMouseDown: (rowIndex: number, colIndex: number) => void;
210
+ };
211
+
212
+ type CellChange = {
213
+ rowId: string;
214
+ columnId: string;
215
+ value: unknown;
216
+ };
217
+ declare function collectFillChanges<T extends Record<string, unknown>>(rows: Row<T>[], sourceBounds: CellSelectionBounds, fillBounds: CellSelectionBounds): CellChange[];
218
+ declare function applyFillData<T extends Record<string, unknown>>(data: T[], rows: Row<T>[], sourceBounds: CellSelectionBounds, fillBounds: CellSelectionBounds): T[];
219
+
220
+ type TreeRow<T extends Record<string, unknown> = Record<string, unknown>> = T & {
221
+ level: number;
222
+ children: TreeRow<T>[];
223
+ treeNo?: string;
224
+ uniqueId?: string;
225
+ parentCount?: number;
226
+ processed?: boolean;
227
+ };
228
+ type UseConvertTreeDataParams<T extends Record<string, unknown>> = {
229
+ data: T[] | null;
230
+ /** When false, returns data unchanged (plain DataTable) */
231
+ enabled?: boolean;
232
+ /** Row id / expand key field (idField). Defaults to `id` */
233
+ toggleField?: string;
234
+ /** Child → parent reference field (parentIdField). Defaults to `parentId` */
235
+ childField?: string;
236
+ /** Nested children array field (childrenField). Defaults to `children` */
237
+ flattenField?: string;
238
+ /** Parent quantity field (qtyField). Used for parentCount. Defaults to `qty` */
239
+ qtyField?: string;
240
+ preventExpand?: boolean;
241
+ startIndex?: number;
242
+ expandedRows?: Set<string>;
243
+ onExpandedRowsChange?: (next: Set<string>) => void;
244
+ };
245
+ declare function canExpandRow(row: Record<string, unknown>): boolean;
246
+ declare function toggleExpandedRowId(rowId: string, previous: Set<string>): Set<string>;
247
+ /**
248
+ * Builds a tree from flat/nested data, then returns only rows visible under expandedRows.
249
+ * When enabled=false, returns data as-is.
250
+ */
251
+ declare const useConvertTreeData: <T extends Record<string, unknown>>({ data, enabled, toggleField, childField, flattenField, qtyField, preventExpand, startIndex, expandedRows, onExpandedRowsChange, }: UseConvertTreeDataParams<T>) => T[];
252
+
253
+ declare function resolveRowSelection(mode: RowSelectionMode, controlledSelection: RowSelectionState | undefined, internalSelection: RowSelectionState): RowSelectionState;
254
+ declare function applySelectionUpdater(mode: RowSelectionMode, updater: Updater<RowSelectionState>, previous: RowSelectionState): RowSelectionState;
255
+
256
+ export { CELL_SELECTION_EDGES_CLASS, type CellSelectionBounds, type ColumnRowSpanMap, DEFAULT_TREE_CHILDREN_FIELD, DEFAULT_TREE_ID_FIELD, DEFAULT_TREE_PARENT_ID_FIELD, DEFAULT_TREE_QTY_FIELD, DataTableLabels, DataTableProps, type DragState, type EditingCell, RowSelectionMode, type RowSpanInfo, type TreeRow, type UseConvertTreeDataParams, type UseGlideTableOptions, type UseGlideTableResult, applyCellEdit, applyFillData, applySelectionUpdater, buildColumnRowSpanMap, canExpandRow, collectFillChanges, collectRowSpanColumns, getCellEditDraftValue, getCellSelectionEdgeStyle, getColumnEditType, getRowIndexInMergedCell, hasCellSelectionEdges, isCellInSelection, isColumnEditable, parseCellEditValue, resolveRowSelection, resolveRowSpanAt, toggleExpandedRowId, useCellEdit, useCellSelection, useConvertTreeData, useGlideTable };
package/dist/core.d.ts ADDED
@@ -0,0 +1,256 @@
1
+ import { C as CellEditType, a as DataTableClassNames, R as RowSelectionMode, c as DataTableProps, b as DataTableLabels } from './types-BfthylVR.js';
2
+ export { D as DEFAULT_DATA_TABLE_LABELS, r as resolveDataTableLabels } from './types-BfthylVR.js';
3
+ import { Row, ColumnDef, Table, Updater, RowSelectionState } from '@tanstack/react-table';
4
+ export { ColumnDef, RowSelectionState } from '@tanstack/react-table';
5
+ import { Virtualizer, VirtualItem } from '@tanstack/react-virtual';
6
+ import * as react from 'react';
7
+ import { RefObject } from 'react';
8
+
9
+ /** Neutral default field names for tree conversion */
10
+ declare const DEFAULT_TREE_ID_FIELD = "id";
11
+ declare const DEFAULT_TREE_PARENT_ID_FIELD = "parentId";
12
+ declare const DEFAULT_TREE_CHILDREN_FIELD = "children";
13
+ declare const DEFAULT_TREE_QTY_FIELD = "qty";
14
+
15
+ type EditingCell = {
16
+ rowIndex: number;
17
+ colIndex: number;
18
+ };
19
+ type ColumnDefLike = {
20
+ id?: string;
21
+ accessorKey?: unknown;
22
+ meta?: {
23
+ editable?: boolean;
24
+ editType?: CellEditType;
25
+ };
26
+ };
27
+ declare function isColumnEditable(columnDef: ColumnDefLike): boolean;
28
+ declare function getColumnEditType(columnDef: ColumnDefLike): CellEditType;
29
+ declare function parseCellEditValue(raw: string, editType: CellEditType): {
30
+ ok: true;
31
+ value: string | number | null;
32
+ } | {
33
+ ok: false;
34
+ };
35
+ declare function getCellEditDraftValue(value: unknown): string;
36
+ /** Returns updated data on success; null if parsing fails or the cell is not editable */
37
+ declare function applyCellEdit<T extends Record<string, unknown>>(data: T[], rows: Row<T>[], rowIndex: number, colIndex: number, raw: string): T[] | null;
38
+
39
+ type CellPosition = {
40
+ row: number;
41
+ col: number;
42
+ };
43
+ type CellSelectionBounds = {
44
+ startRow: number;
45
+ endRow: number;
46
+ startCol: number;
47
+ endCol: number;
48
+ };
49
+ type DragState = {
50
+ isSelecting: boolean;
51
+ isFillDragging: boolean;
52
+ start: CellPosition | null;
53
+ end: CellPosition | null;
54
+ /** Fixed anchor opposite the fill handle (top-left) */
55
+ fillAnchor: CellPosition | null;
56
+ fillEnd: CellPosition | null;
57
+ };
58
+ declare function getRowIndexInMergedCell(clientY: number, cellElement: HTMLElement, rowIndex: number, rowSpan: number): number;
59
+ declare function isCellInSelection(rowIndex: number, colIndex: number, bounds: CellSelectionBounds | null, rowSpan?: number): boolean;
60
+ declare const CELL_SELECTION_EDGES_CLASS = "cell-selection-edges";
61
+ type CellSelectionEdgeStyle = {
62
+ /** Full-side inset border applied via ::after */
63
+ ["--selection-edge-shadows"]?: string;
64
+ /** Partial vertical border for merged-cell step (stair) segments */
65
+ ["--selection-edge-gradients"]?: string;
66
+ ["--selection-edge-sizes"]?: string;
67
+ ["--selection-edge-positions"]?: string;
68
+ /** Hide internal horizontal grid lines inside the selection with background color */
69
+ borderBottomColor?: string;
70
+ };
71
+ /**
72
+ * Draws the selection border with ::after (extended -1px at the bottom) plus
73
+ * inset box-shadow / partial gradients so it does not break on the cell's
74
+ * border-bottom.
75
+ *
76
+ * @param isVisuallySelectedAt Whether a logical cell is visually selected
77
+ * (including adjacent merged cells). Used to suppress internal step borders
78
+ * when multiple columns have rowSpan.
79
+ */
80
+ declare function getCellSelectionEdgeStyle(rowIndex: number, colIndex: number, bounds: CellSelectionBounds | null, rowSpan?: number, isVisuallySelectedAt?: (row: number, col: number) => boolean): CellSelectionEdgeStyle | undefined;
81
+ declare function hasCellSelectionEdges(style: CellSelectionEdgeStyle | undefined): boolean;
82
+
83
+ type RowSpanInfo = {
84
+ /** 0 means skip render (merged into a parent row) */
85
+ rowSpan: number;
86
+ isFirstInGroup: boolean;
87
+ };
88
+ type ColumnRowSpanMap = Map<string, RowSpanInfo[]>;
89
+ /**
90
+ * Returns the start row and rowSpan of the merged cell covering a given row.
91
+ * Rows with rowSpan === 0 walk up to the merge origin.
92
+ */
93
+ declare function resolveRowSpanAt(rowSpans: RowSpanInfo[] | undefined, rowIndex: number): {
94
+ startRow: number;
95
+ rowSpan: number;
96
+ };
97
+ /**
98
+ * Computes merge info for every column that has rowSpan meta.
99
+ */
100
+ declare function buildColumnRowSpanMap<T extends Record<string, unknown>>(data: T[], columnKeys: Array<{
101
+ columnId: string;
102
+ rowSpanKey: string;
103
+ }>): ColumnRowSpanMap;
104
+ declare function collectRowSpanColumns<T extends Record<string, unknown>>(columns: ColumnDef<T, unknown>[]): Array<{
105
+ columnId: string;
106
+ rowSpanKey: string;
107
+ }>;
108
+
109
+ type RowData = Record<string, unknown>;
110
+ type DataTableRowContextValue = {
111
+ classNames?: DataTableClassNames;
112
+ rowSpan: {
113
+ enableRowSpan: boolean;
114
+ primaryRowSpanKey?: string;
115
+ columnRowSpanMap: ColumnRowSpanMap;
116
+ hoveredRowIndex: number | null;
117
+ hoveredGroupKey: string | null;
118
+ selectedGroupKeys: Set<string>;
119
+ onRowHover: (rowIndex: number, rowData: RowData) => void;
120
+ };
121
+ selection: {
122
+ rowSelectionMode: RowSelectionMode;
123
+ selectOnRowClick: boolean;
124
+ onRowClick?: (row: RowData, index: number) => void;
125
+ getRowClassName?: (row: RowData, index: number) => string | undefined;
126
+ };
127
+ cellSelection: {
128
+ enableCellSelection: boolean;
129
+ activeSelectionBounds: CellSelectionBounds | null;
130
+ dragState: DragState;
131
+ onCellMouseDown: (rowIndex: number, colIndex: number) => void;
132
+ onCellMouseEnter: (rowIndex: number, colIndex: number) => void;
133
+ onFillHandleMouseDown: (rowIndex: number, colIndex: number) => void;
134
+ };
135
+ cellEdit: {
136
+ editingCell: EditingCell | null;
137
+ draftValue: string;
138
+ onDraftValueChange: (value: string) => void;
139
+ onStartEdit: (rowIndex: number, colIndex: number) => void;
140
+ onCommitEdit: (raw?: string) => boolean;
141
+ onCancelEdit: () => void;
142
+ };
143
+ expand: {
144
+ enableExpand: boolean;
145
+ toggleField?: string;
146
+ expandedRows?: Set<string>;
147
+ preventExpand: boolean;
148
+ onToggleExpand?: (rowKey: string) => void;
149
+ expandRowLabel: string;
150
+ collapseRowLabel: string;
151
+ };
152
+ };
153
+
154
+ type UseGlideTableOptions<T extends Record<string, unknown>> = Omit<DataTableProps<T>, "className" | "classNames" | "slots" | "summary" | "toolbar" | "isPending" | "totalCount" | "filteredCount">;
155
+ type UseGlideTableResult<T extends Record<string, unknown>> = {
156
+ table: Table<T>;
157
+ tableData: T[];
158
+ rows: Row<T>[];
159
+ columnCount: number;
160
+ selectedCount: number;
161
+ labels: DataTableLabels;
162
+ emptyText: string;
163
+ loadingText: string;
164
+ selectionLabel: DataTableLabels["selection"];
165
+ enableCellSelection: boolean;
166
+ shouldVirtualize: boolean;
167
+ scrollRef: RefObject<HTMLDivElement | null>;
168
+ rowVirtualizer: Virtualizer<HTMLDivElement, Element>;
169
+ virtualRows: VirtualItem[];
170
+ paddingTop: number;
171
+ paddingBottom: number;
172
+ rowContextValue: DataTableRowContextValue;
173
+ handleToggleSelect: (row: Row<T>) => void;
174
+ clearHover: () => void;
175
+ };
176
+ declare function useGlideTable<T extends Record<string, unknown>>(options: UseGlideTableOptions<T>): UseGlideTableResult<T>;
177
+
178
+ type UseCellEditOptions<T extends Record<string, unknown>> = {
179
+ data: T[];
180
+ rows: Row<T>[];
181
+ onDataChange?: (data: T[]) => void;
182
+ onCellChange?: (rowId: string, columnId: string, value: unknown) => void;
183
+ };
184
+ declare function useCellEdit<T extends Record<string, unknown>>({ data, rows, onDataChange, onCellChange, }: UseCellEditOptions<T>): {
185
+ editingCell: EditingCell | null;
186
+ draftValue: string;
187
+ setDraftValue: react.Dispatch<react.SetStateAction<string>>;
188
+ startEdit: (rowIndex: number, colIndex: number) => void;
189
+ commitEdit: (raw?: string) => boolean;
190
+ cancelEdit: () => void;
191
+ };
192
+
193
+ type UseCellSelectionOptions<T extends Record<string, unknown>> = {
194
+ data: T[];
195
+ rows: Row<T>[];
196
+ enabled?: boolean;
197
+ onDataChange?: (data: T[]) => void;
198
+ onBatchChange?: (changes: Array<{
199
+ rowId: string;
200
+ columnId: string;
201
+ value: unknown;
202
+ }>) => void;
203
+ };
204
+ declare function useCellSelection<T extends Record<string, unknown>>({ data, rows, enabled, onDataChange, onBatchChange, }: UseCellSelectionOptions<T>): {
205
+ dragState: DragState;
206
+ activeSelectionBounds: CellSelectionBounds | null;
207
+ handleCellMouseDown: (rowIndex: number, colIndex: number) => void;
208
+ handleCellMouseEnter: (rowIndex: number, colIndex: number) => void;
209
+ handleFillHandleMouseDown: (rowIndex: number, colIndex: number) => void;
210
+ };
211
+
212
+ type CellChange = {
213
+ rowId: string;
214
+ columnId: string;
215
+ value: unknown;
216
+ };
217
+ declare function collectFillChanges<T extends Record<string, unknown>>(rows: Row<T>[], sourceBounds: CellSelectionBounds, fillBounds: CellSelectionBounds): CellChange[];
218
+ declare function applyFillData<T extends Record<string, unknown>>(data: T[], rows: Row<T>[], sourceBounds: CellSelectionBounds, fillBounds: CellSelectionBounds): T[];
219
+
220
+ type TreeRow<T extends Record<string, unknown> = Record<string, unknown>> = T & {
221
+ level: number;
222
+ children: TreeRow<T>[];
223
+ treeNo?: string;
224
+ uniqueId?: string;
225
+ parentCount?: number;
226
+ processed?: boolean;
227
+ };
228
+ type UseConvertTreeDataParams<T extends Record<string, unknown>> = {
229
+ data: T[] | null;
230
+ /** When false, returns data unchanged (plain DataTable) */
231
+ enabled?: boolean;
232
+ /** Row id / expand key field (idField). Defaults to `id` */
233
+ toggleField?: string;
234
+ /** Child → parent reference field (parentIdField). Defaults to `parentId` */
235
+ childField?: string;
236
+ /** Nested children array field (childrenField). Defaults to `children` */
237
+ flattenField?: string;
238
+ /** Parent quantity field (qtyField). Used for parentCount. Defaults to `qty` */
239
+ qtyField?: string;
240
+ preventExpand?: boolean;
241
+ startIndex?: number;
242
+ expandedRows?: Set<string>;
243
+ onExpandedRowsChange?: (next: Set<string>) => void;
244
+ };
245
+ declare function canExpandRow(row: Record<string, unknown>): boolean;
246
+ declare function toggleExpandedRowId(rowId: string, previous: Set<string>): Set<string>;
247
+ /**
248
+ * Builds a tree from flat/nested data, then returns only rows visible under expandedRows.
249
+ * When enabled=false, returns data as-is.
250
+ */
251
+ declare const useConvertTreeData: <T extends Record<string, unknown>>({ data, enabled, toggleField, childField, flattenField, qtyField, preventExpand, startIndex, expandedRows, onExpandedRowsChange, }: UseConvertTreeDataParams<T>) => T[];
252
+
253
+ declare function resolveRowSelection(mode: RowSelectionMode, controlledSelection: RowSelectionState | undefined, internalSelection: RowSelectionState): RowSelectionState;
254
+ declare function applySelectionUpdater(mode: RowSelectionMode, updater: Updater<RowSelectionState>, previous: RowSelectionState): RowSelectionState;
255
+
256
+ export { CELL_SELECTION_EDGES_CLASS, type CellSelectionBounds, type ColumnRowSpanMap, DEFAULT_TREE_CHILDREN_FIELD, DEFAULT_TREE_ID_FIELD, DEFAULT_TREE_PARENT_ID_FIELD, DEFAULT_TREE_QTY_FIELD, DataTableLabels, DataTableProps, type DragState, type EditingCell, RowSelectionMode, type RowSpanInfo, type TreeRow, type UseConvertTreeDataParams, type UseGlideTableOptions, type UseGlideTableResult, applyCellEdit, applyFillData, applySelectionUpdater, buildColumnRowSpanMap, canExpandRow, collectFillChanges, collectRowSpanColumns, getCellEditDraftValue, getCellSelectionEdgeStyle, getColumnEditType, getRowIndexInMergedCell, hasCellSelectionEdges, isCellInSelection, isColumnEditable, parseCellEditValue, resolveRowSelection, resolveRowSpanAt, toggleExpandedRowId, useCellEdit, useCellSelection, useConvertTreeData, useGlideTable };