react-glide-table 1.4.0 → 1.6.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/README.md +32 -2
- package/dist/compound.cjs +1104 -107
- package/dist/compound.d.cts +2 -2
- package/dist/compound.d.ts +2 -2
- package/dist/compound.js +1106 -102
- package/dist/core.cjs +873 -47
- package/dist/core.d.cts +73 -6
- package/dist/core.d.ts +73 -6
- package/dist/core.js +867 -51
- package/dist/index.cjs +1152 -121
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1134 -113
- package/dist/{types-CHQnBz91.d.cts → types-tkOzBZ4V.d.cts} +93 -1
- package/dist/{types-CHQnBz91.d.ts → types-tkOzBZ4V.d.ts} +93 -1
- package/package.json +1 -1
package/dist/core.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { C as ColumnFreezeColumnInput, a as ColumnFreezeEdgeSide, b as ColumnFreezeMeta, d as ColumnFreezeSide, D as DEFAULT_DATA_TABLE_LABELS,
|
|
1
|
+
import { L as CellEditType, e as DataTableClassNames, R as RowSelectionMode, c as ColumnFreezeOffset, l as SearchResultItem, m as SearchStatus, h as DataTableProps, g as DataTableLabels, f as DataTableCopyActions, P as PasteMode, k as RowsPastePayload } from './types-tkOzBZ4V.cjs';
|
|
2
|
+
export { C as ColumnFreezeColumnInput, a as ColumnFreezeEdgeSide, b as ColumnFreezeMeta, d as ColumnFreezeSide, D as DEFAULT_DATA_TABLE_LABELS, I as INLINE_SEARCH_MAX_RESULTS, S as SearchCorpusRow, o as buildColumnFreezeOffsets, p as buildFlatSearchCorpus, q as buildSearchMatchKey, r as buildSearchMatchKeys, s as buildTreeSearchCorpus, t as cellValueToSearchText, u as collectAncestorKeysToExpand, v as collectSearchMatchesInRange, w as createSearchRegex, x as escapeSearchRegex, y as formatSearchResultLabel, z as getColumnFreezeEdgeAttr, A as getColumnFreezeStyle, B as mapSearchResultToVisibleItem, E as mapSearchResultsToVisibleKeys, F as nextSearchIndex, G as nextSearchStride, H as previousSearchIndex, J as resolveColumnFreezeSide, K as resolveDataTableLabels } from './types-tkOzBZ4V.cjs';
|
|
3
3
|
import { Row, ColumnDef, Table, Updater, RowSelectionState } from '@tanstack/react-table';
|
|
4
4
|
export { ColumnDef, ColumnResizeMode, ColumnSizingState, RowSelectionState } from '@tanstack/react-table';
|
|
5
5
|
import { Virtualizer, VirtualItem } from '@tanstack/react-virtual';
|
|
@@ -55,6 +55,9 @@ type DragState = {
|
|
|
55
55
|
fillAnchor: CellPosition | null;
|
|
56
56
|
fillEnd: CellPosition | null;
|
|
57
57
|
};
|
|
58
|
+
type CellMouseDownOptions = {
|
|
59
|
+
shiftKey?: boolean;
|
|
60
|
+
};
|
|
58
61
|
/**
|
|
59
62
|
* Reads per-row heights for a merged cell span from the table body.
|
|
60
63
|
* Expand + merge yields unequal row heights (e.g. parent 25px / child 22px);
|
|
@@ -149,7 +152,7 @@ type DataTableRowContextValue = {
|
|
|
149
152
|
enableCellSelection: boolean;
|
|
150
153
|
activeSelectionBounds: CellSelectionBounds | null;
|
|
151
154
|
dragState: DragState;
|
|
152
|
-
onCellMouseDown: (rowIndex: number, colIndex: number) => void;
|
|
155
|
+
onCellMouseDown: (rowIndex: number, colIndex: number, options?: CellMouseDownOptions) => void;
|
|
153
156
|
onCellMouseEnter: (rowIndex: number, colIndex: number) => void;
|
|
154
157
|
onFillHandleMouseDown: (rowIndex: number, colIndex: number) => void;
|
|
155
158
|
};
|
|
@@ -177,7 +180,50 @@ type DataTableRowContextValue = {
|
|
|
177
180
|
enableColumnFreeze: boolean;
|
|
178
181
|
offsets: Map<string, ColumnFreezeOffset>;
|
|
179
182
|
};
|
|
183
|
+
inlineSearch: {
|
|
184
|
+
enabled: boolean;
|
|
185
|
+
matchKeys: Set<string>;
|
|
186
|
+
activeMatch: SearchResultItem | null;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
type UseInlineSearchOptions = {
|
|
191
|
+
enabled?: boolean;
|
|
192
|
+
rowCount: number;
|
|
193
|
+
columnCount: number;
|
|
194
|
+
getCellValue: (rowIndex: number, colIndex: number) => unknown;
|
|
195
|
+
/** Prefer starting the scan near the visible window (virtualized tables). */
|
|
196
|
+
initialStartRow?: number;
|
|
197
|
+
showSearch?: boolean;
|
|
198
|
+
searchValue?: string;
|
|
199
|
+
searchResults?: readonly SearchResultItem[];
|
|
200
|
+
onSearchValueChange?: (value: string) => void;
|
|
201
|
+
onSearchClose?: () => void;
|
|
202
|
+
onSearchResultsChanged?: (results: readonly SearchResultItem[], navIndex: number) => void;
|
|
203
|
+
/** Select / scroll to the active match cell (corpus-indexed). */
|
|
204
|
+
onNavigateToResult?: (item: SearchResultItem) => void;
|
|
205
|
+
/** Scope Ctrl/Cmd+F to this element when provided. */
|
|
206
|
+
rootRef?: RefObject<HTMLElement | null>;
|
|
180
207
|
};
|
|
208
|
+
type UseInlineSearchResult = {
|
|
209
|
+
enabled: boolean;
|
|
210
|
+
showSearch: boolean;
|
|
211
|
+
searchValue: string;
|
|
212
|
+
searchResults: readonly SearchResultItem[];
|
|
213
|
+
searchStatus: SearchStatus | undefined;
|
|
214
|
+
searchMatchKeys: Set<string>;
|
|
215
|
+
activeMatch: SearchResultItem | null;
|
|
216
|
+
searchInputRef: RefObject<HTMLInputElement | null>;
|
|
217
|
+
searchInputId: string;
|
|
218
|
+
/** Close button is shown when uncontrolled, or when `onSearchClose` is provided. */
|
|
219
|
+
canClose: boolean;
|
|
220
|
+
openSearch: () => void;
|
|
221
|
+
closeSearch: () => void;
|
|
222
|
+
setSearchValue: (value: string) => void;
|
|
223
|
+
goToNext: () => void;
|
|
224
|
+
goToPrevious: () => void;
|
|
225
|
+
};
|
|
226
|
+
declare function useInlineSearch({ enabled, rowCount, columnCount, getCellValue, initialStartRow, showSearch: controlledShowSearch, searchValue: controlledSearchValue, searchResults: controlledSearchResults, onSearchValueChange, onSearchClose, onSearchResultsChanged, onNavigateToResult, rootRef, }: UseInlineSearchOptions): UseInlineSearchResult;
|
|
181
227
|
|
|
182
228
|
type UseGlideTableOptions<T extends Record<string, unknown>> = Omit<DataTableProps<T>, "className" | "classNames" | "slots" | "summary" | "toolbar" | "isPending" | "totalCount" | "filteredCount">;
|
|
183
229
|
type UseGlideTableResult<T extends Record<string, unknown>> = {
|
|
@@ -193,8 +239,10 @@ type UseGlideTableResult<T extends Record<string, unknown>> = {
|
|
|
193
239
|
enableCellSelection: boolean;
|
|
194
240
|
enableColumnResize: boolean;
|
|
195
241
|
enableColumnFreeze: boolean;
|
|
242
|
+
enableInlineSearch: boolean;
|
|
196
243
|
shouldVirtualize: boolean;
|
|
197
244
|
scrollRef: RefObject<HTMLDivElement | null>;
|
|
245
|
+
rootRef: RefObject<HTMLDivElement | null>;
|
|
198
246
|
rowVirtualizer: Virtualizer<HTMLDivElement, Element>;
|
|
199
247
|
virtualRows: VirtualItem[];
|
|
200
248
|
paddingTop: number;
|
|
@@ -203,6 +251,21 @@ type UseGlideTableResult<T extends Record<string, unknown>> = {
|
|
|
203
251
|
handleToggleSelect: (row: Row<T>) => void;
|
|
204
252
|
clearHover: () => void;
|
|
205
253
|
copySelection: DataTableCopyActions["copySelection"];
|
|
254
|
+
inlineSearch: {
|
|
255
|
+
showSearch: boolean;
|
|
256
|
+
searchValue: string;
|
|
257
|
+
searchStatus: ReturnType<typeof useInlineSearch>["searchStatus"];
|
|
258
|
+
searchInputRef: RefObject<HTMLInputElement | null>;
|
|
259
|
+
searchInputId: string;
|
|
260
|
+
canClose: boolean;
|
|
261
|
+
/** Total searchable rows (includes collapsed tree rows). */
|
|
262
|
+
searchRowCount: number;
|
|
263
|
+
setSearchValue: (value: string) => void;
|
|
264
|
+
closeSearch: () => void;
|
|
265
|
+
goToNext: () => void;
|
|
266
|
+
goToPrevious: () => void;
|
|
267
|
+
openSearch: () => void;
|
|
268
|
+
};
|
|
206
269
|
};
|
|
207
270
|
declare function useGlideTable<T extends Record<string, unknown>>(options: UseGlideTableOptions<T>): UseGlideTableResult<T>;
|
|
208
271
|
|
|
@@ -256,6 +319,8 @@ type UseCellSelectionOptions<T extends Record<string, unknown>> = {
|
|
|
256
319
|
data: T[];
|
|
257
320
|
rows: Row<T>[];
|
|
258
321
|
enabled?: boolean;
|
|
322
|
+
/** Visible leaf column count used to clamp keyboard navigation. */
|
|
323
|
+
columnCount?: number;
|
|
259
324
|
/** Enables Ctrl/Cmd+Shift+C subtree copy. Defaults to true when tree expand is enabled. */
|
|
260
325
|
enableSubtreeCopy?: boolean;
|
|
261
326
|
/** Enables Ctrl/Cmd+Shift+V insert paste. Defaults to true. */
|
|
@@ -267,11 +332,13 @@ type UseCellSelectionOptions<T extends Record<string, unknown>> = {
|
|
|
267
332
|
value: unknown;
|
|
268
333
|
}>) => void;
|
|
269
334
|
onRowsPaste?: (payload: RowsPastePayload) => void;
|
|
335
|
+
/** Called after keyboard navigation moves the active (end) cell. */
|
|
336
|
+
onCellNavigate?: (position: CellPosition) => void;
|
|
270
337
|
};
|
|
271
|
-
declare function useCellSelection<T extends Record<string, unknown>>({ data, rows, enabled, enableSubtreeCopy, enableInsertPaste, onDataChange, onBatchChange, onRowsPaste, }: UseCellSelectionOptions<T>): {
|
|
338
|
+
declare function useCellSelection<T extends Record<string, unknown>>({ data, rows, enabled, columnCount, enableSubtreeCopy, enableInsertPaste, onDataChange, onBatchChange, onRowsPaste, onCellNavigate, }: UseCellSelectionOptions<T>): {
|
|
272
339
|
dragState: DragState;
|
|
273
340
|
activeSelectionBounds: CellSelectionBounds | null;
|
|
274
|
-
handleCellMouseDown: (rowIndex: number, colIndex: number) => void;
|
|
341
|
+
handleCellMouseDown: (rowIndex: number, colIndex: number, options?: CellMouseDownOptions) => void;
|
|
275
342
|
handleCellMouseEnter: (rowIndex: number, colIndex: number) => void;
|
|
276
343
|
handleFillHandleMouseDown: (rowIndex: number, colIndex: number) => void;
|
|
277
344
|
copySelection: (options?: CopySelectionOptions) => Promise<boolean>;
|
|
@@ -342,4 +409,4 @@ declare const useConvertTreeData: <T extends Record<string, unknown>>({ data, en
|
|
|
342
409
|
declare function resolveRowSelection(mode: RowSelectionMode, controlledSelection: RowSelectionState | undefined, internalSelection: RowSelectionState): RowSelectionState;
|
|
343
410
|
declare function applySelectionUpdater(mode: RowSelectionMode, updater: Updater<RowSelectionState>, previous: RowSelectionState): RowSelectionState;
|
|
344
411
|
|
|
345
|
-
export { CELL_SELECTION_EDGES_CLASS, type CellSelectionBounds, ColumnFreezeOffset, type ColumnRowSpanMap, type CopyRowEntry, type CopySelectionMode, DEFAULT_TREE_CHILDREN_FIELD, DEFAULT_TREE_ID_FIELD, DEFAULT_TREE_PARENT_ID_FIELD, DEFAULT_TREE_QTY_FIELD, DataTableCopyActions, DataTableLabels, DataTableProps, type DragState, type EditingCell, PasteMode, RowSelectionMode, type RowSpanInfo, RowsPastePayload, type TreeRow, type UseConvertTreeDataParams, type UseGlideTableOptions, type UseGlideTableResult, applyCellEdit, applyFillData, applySelectionUpdater, buildColumnRowSpanMap, buildRowsPastePayload, canExpandRow, collectCopyRowEntries, collectCopyRows, collectFillChanges, collectRowSpanColumns, flattenSubtreeRows, getCellEditDraftValue, getCellSelectionEdgeStyle, getColumnEditType, getColumnSizeStyle, getRowIndexInMergedCell, hasCellSelectionEdges, isCellInSelection, isColumnEditable, isEditablePasteTarget, measureMergedSpanRowHeights, parseCellEditValue, parseClipboardTSV, parseClipboardTSVWithDepths, resolvePasteColumnIds, resolveRowSelection, resolveRowSpanAt, rowRangeToHeightRatios, serializeCopyRowsToTSV, serializeSelectionToTSV, toggleExpandedRowId, useCellEdit, useCellSelection, useConvertTreeData, useGlideTable, writeSelectionToClipboard };
|
|
412
|
+
export { CELL_SELECTION_EDGES_CLASS, type CellSelectionBounds, ColumnFreezeOffset, type ColumnRowSpanMap, type CopyRowEntry, type CopySelectionMode, DEFAULT_TREE_CHILDREN_FIELD, DEFAULT_TREE_ID_FIELD, DEFAULT_TREE_PARENT_ID_FIELD, DEFAULT_TREE_QTY_FIELD, DataTableCopyActions, DataTableLabels, DataTableProps, type DragState, type EditingCell, PasteMode, RowSelectionMode, type RowSpanInfo, RowsPastePayload, SearchResultItem, SearchStatus, type TreeRow, type UseConvertTreeDataParams, type UseGlideTableOptions, type UseGlideTableResult, type UseInlineSearchOptions, type UseInlineSearchResult, applyCellEdit, applyFillData, applySelectionUpdater, buildColumnRowSpanMap, buildRowsPastePayload, canExpandRow, collectCopyRowEntries, collectCopyRows, collectFillChanges, collectRowSpanColumns, flattenSubtreeRows, getCellEditDraftValue, getCellSelectionEdgeStyle, getColumnEditType, getColumnSizeStyle, getRowIndexInMergedCell, hasCellSelectionEdges, isCellInSelection, isColumnEditable, isEditablePasteTarget, measureMergedSpanRowHeights, parseCellEditValue, parseClipboardTSV, parseClipboardTSVWithDepths, resolvePasteColumnIds, resolveRowSelection, resolveRowSpanAt, rowRangeToHeightRatios, serializeCopyRowsToTSV, serializeSelectionToTSV, toggleExpandedRowId, useCellEdit, useCellSelection, useConvertTreeData, useGlideTable, useInlineSearch, writeSelectionToClipboard };
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { C as ColumnFreezeColumnInput, a as ColumnFreezeEdgeSide, b as ColumnFreezeMeta, d as ColumnFreezeSide, D as DEFAULT_DATA_TABLE_LABELS,
|
|
1
|
+
import { L as CellEditType, e as DataTableClassNames, R as RowSelectionMode, c as ColumnFreezeOffset, l as SearchResultItem, m as SearchStatus, h as DataTableProps, g as DataTableLabels, f as DataTableCopyActions, P as PasteMode, k as RowsPastePayload } from './types-tkOzBZ4V.js';
|
|
2
|
+
export { C as ColumnFreezeColumnInput, a as ColumnFreezeEdgeSide, b as ColumnFreezeMeta, d as ColumnFreezeSide, D as DEFAULT_DATA_TABLE_LABELS, I as INLINE_SEARCH_MAX_RESULTS, S as SearchCorpusRow, o as buildColumnFreezeOffsets, p as buildFlatSearchCorpus, q as buildSearchMatchKey, r as buildSearchMatchKeys, s as buildTreeSearchCorpus, t as cellValueToSearchText, u as collectAncestorKeysToExpand, v as collectSearchMatchesInRange, w as createSearchRegex, x as escapeSearchRegex, y as formatSearchResultLabel, z as getColumnFreezeEdgeAttr, A as getColumnFreezeStyle, B as mapSearchResultToVisibleItem, E as mapSearchResultsToVisibleKeys, F as nextSearchIndex, G as nextSearchStride, H as previousSearchIndex, J as resolveColumnFreezeSide, K as resolveDataTableLabels } from './types-tkOzBZ4V.js';
|
|
3
3
|
import { Row, ColumnDef, Table, Updater, RowSelectionState } from '@tanstack/react-table';
|
|
4
4
|
export { ColumnDef, ColumnResizeMode, ColumnSizingState, RowSelectionState } from '@tanstack/react-table';
|
|
5
5
|
import { Virtualizer, VirtualItem } from '@tanstack/react-virtual';
|
|
@@ -55,6 +55,9 @@ type DragState = {
|
|
|
55
55
|
fillAnchor: CellPosition | null;
|
|
56
56
|
fillEnd: CellPosition | null;
|
|
57
57
|
};
|
|
58
|
+
type CellMouseDownOptions = {
|
|
59
|
+
shiftKey?: boolean;
|
|
60
|
+
};
|
|
58
61
|
/**
|
|
59
62
|
* Reads per-row heights for a merged cell span from the table body.
|
|
60
63
|
* Expand + merge yields unequal row heights (e.g. parent 25px / child 22px);
|
|
@@ -149,7 +152,7 @@ type DataTableRowContextValue = {
|
|
|
149
152
|
enableCellSelection: boolean;
|
|
150
153
|
activeSelectionBounds: CellSelectionBounds | null;
|
|
151
154
|
dragState: DragState;
|
|
152
|
-
onCellMouseDown: (rowIndex: number, colIndex: number) => void;
|
|
155
|
+
onCellMouseDown: (rowIndex: number, colIndex: number, options?: CellMouseDownOptions) => void;
|
|
153
156
|
onCellMouseEnter: (rowIndex: number, colIndex: number) => void;
|
|
154
157
|
onFillHandleMouseDown: (rowIndex: number, colIndex: number) => void;
|
|
155
158
|
};
|
|
@@ -177,7 +180,50 @@ type DataTableRowContextValue = {
|
|
|
177
180
|
enableColumnFreeze: boolean;
|
|
178
181
|
offsets: Map<string, ColumnFreezeOffset>;
|
|
179
182
|
};
|
|
183
|
+
inlineSearch: {
|
|
184
|
+
enabled: boolean;
|
|
185
|
+
matchKeys: Set<string>;
|
|
186
|
+
activeMatch: SearchResultItem | null;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
type UseInlineSearchOptions = {
|
|
191
|
+
enabled?: boolean;
|
|
192
|
+
rowCount: number;
|
|
193
|
+
columnCount: number;
|
|
194
|
+
getCellValue: (rowIndex: number, colIndex: number) => unknown;
|
|
195
|
+
/** Prefer starting the scan near the visible window (virtualized tables). */
|
|
196
|
+
initialStartRow?: number;
|
|
197
|
+
showSearch?: boolean;
|
|
198
|
+
searchValue?: string;
|
|
199
|
+
searchResults?: readonly SearchResultItem[];
|
|
200
|
+
onSearchValueChange?: (value: string) => void;
|
|
201
|
+
onSearchClose?: () => void;
|
|
202
|
+
onSearchResultsChanged?: (results: readonly SearchResultItem[], navIndex: number) => void;
|
|
203
|
+
/** Select / scroll to the active match cell (corpus-indexed). */
|
|
204
|
+
onNavigateToResult?: (item: SearchResultItem) => void;
|
|
205
|
+
/** Scope Ctrl/Cmd+F to this element when provided. */
|
|
206
|
+
rootRef?: RefObject<HTMLElement | null>;
|
|
180
207
|
};
|
|
208
|
+
type UseInlineSearchResult = {
|
|
209
|
+
enabled: boolean;
|
|
210
|
+
showSearch: boolean;
|
|
211
|
+
searchValue: string;
|
|
212
|
+
searchResults: readonly SearchResultItem[];
|
|
213
|
+
searchStatus: SearchStatus | undefined;
|
|
214
|
+
searchMatchKeys: Set<string>;
|
|
215
|
+
activeMatch: SearchResultItem | null;
|
|
216
|
+
searchInputRef: RefObject<HTMLInputElement | null>;
|
|
217
|
+
searchInputId: string;
|
|
218
|
+
/** Close button is shown when uncontrolled, or when `onSearchClose` is provided. */
|
|
219
|
+
canClose: boolean;
|
|
220
|
+
openSearch: () => void;
|
|
221
|
+
closeSearch: () => void;
|
|
222
|
+
setSearchValue: (value: string) => void;
|
|
223
|
+
goToNext: () => void;
|
|
224
|
+
goToPrevious: () => void;
|
|
225
|
+
};
|
|
226
|
+
declare function useInlineSearch({ enabled, rowCount, columnCount, getCellValue, initialStartRow, showSearch: controlledShowSearch, searchValue: controlledSearchValue, searchResults: controlledSearchResults, onSearchValueChange, onSearchClose, onSearchResultsChanged, onNavigateToResult, rootRef, }: UseInlineSearchOptions): UseInlineSearchResult;
|
|
181
227
|
|
|
182
228
|
type UseGlideTableOptions<T extends Record<string, unknown>> = Omit<DataTableProps<T>, "className" | "classNames" | "slots" | "summary" | "toolbar" | "isPending" | "totalCount" | "filteredCount">;
|
|
183
229
|
type UseGlideTableResult<T extends Record<string, unknown>> = {
|
|
@@ -193,8 +239,10 @@ type UseGlideTableResult<T extends Record<string, unknown>> = {
|
|
|
193
239
|
enableCellSelection: boolean;
|
|
194
240
|
enableColumnResize: boolean;
|
|
195
241
|
enableColumnFreeze: boolean;
|
|
242
|
+
enableInlineSearch: boolean;
|
|
196
243
|
shouldVirtualize: boolean;
|
|
197
244
|
scrollRef: RefObject<HTMLDivElement | null>;
|
|
245
|
+
rootRef: RefObject<HTMLDivElement | null>;
|
|
198
246
|
rowVirtualizer: Virtualizer<HTMLDivElement, Element>;
|
|
199
247
|
virtualRows: VirtualItem[];
|
|
200
248
|
paddingTop: number;
|
|
@@ -203,6 +251,21 @@ type UseGlideTableResult<T extends Record<string, unknown>> = {
|
|
|
203
251
|
handleToggleSelect: (row: Row<T>) => void;
|
|
204
252
|
clearHover: () => void;
|
|
205
253
|
copySelection: DataTableCopyActions["copySelection"];
|
|
254
|
+
inlineSearch: {
|
|
255
|
+
showSearch: boolean;
|
|
256
|
+
searchValue: string;
|
|
257
|
+
searchStatus: ReturnType<typeof useInlineSearch>["searchStatus"];
|
|
258
|
+
searchInputRef: RefObject<HTMLInputElement | null>;
|
|
259
|
+
searchInputId: string;
|
|
260
|
+
canClose: boolean;
|
|
261
|
+
/** Total searchable rows (includes collapsed tree rows). */
|
|
262
|
+
searchRowCount: number;
|
|
263
|
+
setSearchValue: (value: string) => void;
|
|
264
|
+
closeSearch: () => void;
|
|
265
|
+
goToNext: () => void;
|
|
266
|
+
goToPrevious: () => void;
|
|
267
|
+
openSearch: () => void;
|
|
268
|
+
};
|
|
206
269
|
};
|
|
207
270
|
declare function useGlideTable<T extends Record<string, unknown>>(options: UseGlideTableOptions<T>): UseGlideTableResult<T>;
|
|
208
271
|
|
|
@@ -256,6 +319,8 @@ type UseCellSelectionOptions<T extends Record<string, unknown>> = {
|
|
|
256
319
|
data: T[];
|
|
257
320
|
rows: Row<T>[];
|
|
258
321
|
enabled?: boolean;
|
|
322
|
+
/** Visible leaf column count used to clamp keyboard navigation. */
|
|
323
|
+
columnCount?: number;
|
|
259
324
|
/** Enables Ctrl/Cmd+Shift+C subtree copy. Defaults to true when tree expand is enabled. */
|
|
260
325
|
enableSubtreeCopy?: boolean;
|
|
261
326
|
/** Enables Ctrl/Cmd+Shift+V insert paste. Defaults to true. */
|
|
@@ -267,11 +332,13 @@ type UseCellSelectionOptions<T extends Record<string, unknown>> = {
|
|
|
267
332
|
value: unknown;
|
|
268
333
|
}>) => void;
|
|
269
334
|
onRowsPaste?: (payload: RowsPastePayload) => void;
|
|
335
|
+
/** Called after keyboard navigation moves the active (end) cell. */
|
|
336
|
+
onCellNavigate?: (position: CellPosition) => void;
|
|
270
337
|
};
|
|
271
|
-
declare function useCellSelection<T extends Record<string, unknown>>({ data, rows, enabled, enableSubtreeCopy, enableInsertPaste, onDataChange, onBatchChange, onRowsPaste, }: UseCellSelectionOptions<T>): {
|
|
338
|
+
declare function useCellSelection<T extends Record<string, unknown>>({ data, rows, enabled, columnCount, enableSubtreeCopy, enableInsertPaste, onDataChange, onBatchChange, onRowsPaste, onCellNavigate, }: UseCellSelectionOptions<T>): {
|
|
272
339
|
dragState: DragState;
|
|
273
340
|
activeSelectionBounds: CellSelectionBounds | null;
|
|
274
|
-
handleCellMouseDown: (rowIndex: number, colIndex: number) => void;
|
|
341
|
+
handleCellMouseDown: (rowIndex: number, colIndex: number, options?: CellMouseDownOptions) => void;
|
|
275
342
|
handleCellMouseEnter: (rowIndex: number, colIndex: number) => void;
|
|
276
343
|
handleFillHandleMouseDown: (rowIndex: number, colIndex: number) => void;
|
|
277
344
|
copySelection: (options?: CopySelectionOptions) => Promise<boolean>;
|
|
@@ -342,4 +409,4 @@ declare const useConvertTreeData: <T extends Record<string, unknown>>({ data, en
|
|
|
342
409
|
declare function resolveRowSelection(mode: RowSelectionMode, controlledSelection: RowSelectionState | undefined, internalSelection: RowSelectionState): RowSelectionState;
|
|
343
410
|
declare function applySelectionUpdater(mode: RowSelectionMode, updater: Updater<RowSelectionState>, previous: RowSelectionState): RowSelectionState;
|
|
344
411
|
|
|
345
|
-
export { CELL_SELECTION_EDGES_CLASS, type CellSelectionBounds, ColumnFreezeOffset, type ColumnRowSpanMap, type CopyRowEntry, type CopySelectionMode, DEFAULT_TREE_CHILDREN_FIELD, DEFAULT_TREE_ID_FIELD, DEFAULT_TREE_PARENT_ID_FIELD, DEFAULT_TREE_QTY_FIELD, DataTableCopyActions, DataTableLabels, DataTableProps, type DragState, type EditingCell, PasteMode, RowSelectionMode, type RowSpanInfo, RowsPastePayload, type TreeRow, type UseConvertTreeDataParams, type UseGlideTableOptions, type UseGlideTableResult, applyCellEdit, applyFillData, applySelectionUpdater, buildColumnRowSpanMap, buildRowsPastePayload, canExpandRow, collectCopyRowEntries, collectCopyRows, collectFillChanges, collectRowSpanColumns, flattenSubtreeRows, getCellEditDraftValue, getCellSelectionEdgeStyle, getColumnEditType, getColumnSizeStyle, getRowIndexInMergedCell, hasCellSelectionEdges, isCellInSelection, isColumnEditable, isEditablePasteTarget, measureMergedSpanRowHeights, parseCellEditValue, parseClipboardTSV, parseClipboardTSVWithDepths, resolvePasteColumnIds, resolveRowSelection, resolveRowSpanAt, rowRangeToHeightRatios, serializeCopyRowsToTSV, serializeSelectionToTSV, toggleExpandedRowId, useCellEdit, useCellSelection, useConvertTreeData, useGlideTable, writeSelectionToClipboard };
|
|
412
|
+
export { CELL_SELECTION_EDGES_CLASS, type CellSelectionBounds, ColumnFreezeOffset, type ColumnRowSpanMap, type CopyRowEntry, type CopySelectionMode, DEFAULT_TREE_CHILDREN_FIELD, DEFAULT_TREE_ID_FIELD, DEFAULT_TREE_PARENT_ID_FIELD, DEFAULT_TREE_QTY_FIELD, DataTableCopyActions, DataTableLabels, DataTableProps, type DragState, type EditingCell, PasteMode, RowSelectionMode, type RowSpanInfo, RowsPastePayload, SearchResultItem, SearchStatus, type TreeRow, type UseConvertTreeDataParams, type UseGlideTableOptions, type UseGlideTableResult, type UseInlineSearchOptions, type UseInlineSearchResult, applyCellEdit, applyFillData, applySelectionUpdater, buildColumnRowSpanMap, buildRowsPastePayload, canExpandRow, collectCopyRowEntries, collectCopyRows, collectFillChanges, collectRowSpanColumns, flattenSubtreeRows, getCellEditDraftValue, getCellSelectionEdgeStyle, getColumnEditType, getColumnSizeStyle, getRowIndexInMergedCell, hasCellSelectionEdges, isCellInSelection, isColumnEditable, isEditablePasteTarget, measureMergedSpanRowHeights, parseCellEditValue, parseClipboardTSV, parseClipboardTSVWithDepths, resolvePasteColumnIds, resolveRowSelection, resolveRowSpanAt, rowRangeToHeightRatios, serializeCopyRowsToTSV, serializeSelectionToTSV, toggleExpandedRowId, useCellEdit, useCellSelection, useConvertTreeData, useGlideTable, useInlineSearch, writeSelectionToClipboard };
|