react-glide-table 2.0.2 → 2.2.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 +35 -0
- package/dist/compound.cjs +590 -126
- package/dist/compound.d.cts +3 -3
- package/dist/compound.d.ts +3 -3
- package/dist/compound.js +571 -102
- package/dist/core.cjs +444 -11
- package/dist/core.d.cts +53 -14
- package/dist/core.d.ts +53 -14
- package/dist/core.js +443 -11
- package/dist/index.cjs +509 -33
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +492 -17
- package/dist/{types-bgEceyRV.d.cts → types-Iot4g4sq.d.cts} +38 -2
- package/dist/{types-bgEceyRV.d.ts → types-Iot4g4sq.d.ts} +38 -2
- package/package.json +1 -1
package/dist/core.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { W as CellEditType, c as CellRenderer, C as CellKind, a as CellRenderContext, i as DataTableClassNames, R as RowSelectionMode, g as ColumnFreezeOffset, p as SearchResultItem, q as SearchStatus, l as DataTableProps, k as DataTableLabels, j as DataTableCopyActions, P as PasteMode, o as RowsPastePayload } from './types-
|
|
2
|
-
export { B as BuiltinCellKind, b as CellRenderFn, d as ColumnFreezeColumnInput, e as ColumnFreezeEdgeSide, f as ColumnFreezeMeta, h as ColumnFreezeSide, D as DEFAULT_DATA_TABLE_LABELS, I as INLINE_SEARCH_MAX_RESULTS, S as SearchCorpusRow, t as buildColumnFreezeOffsets, u as buildFlatSearchCorpus, v as buildSearchMatchKey, w as buildSearchMatchKeys, x as buildTreeSearchCorpus, y as cellValueToSearchText, z as collectAncestorKeysToExpand, A as collectSearchMatchesInRange, E as createSearchRegex, F as escapeSearchRegex, G as formatSearchResultLabel, H as getColumnFreezeEdgeAttr, J as getColumnFreezeStyle, K as mapSearchResultToVisibleItem, L as mapSearchResultsToVisibleKeys, M as nextSearchIndex, N as nextSearchStride, O as previousSearchIndex, Q as resolveColumnFreezeSide, U as resolveDataTableLabels, V as resolveHeaderFreezeOffset } from './types-
|
|
3
|
-
import { Row, ColumnDef, CellContext, Table, Cell, Updater, RowSelectionState } from '@tanstack/react-table';
|
|
4
|
-
export { ColumnDef, ColumnResizeMode, ColumnSizingState, RowSelectionState } from '@tanstack/react-table';
|
|
1
|
+
import { W as CellEditType, c as CellRenderer, C as CellKind, a as CellRenderContext, i as DataTableClassNames, R as RowSelectionMode, g as ColumnFreezeOffset, p as SearchResultItem, q as SearchStatus, l as DataTableProps, k as DataTableLabels, j as DataTableCopyActions, P as PasteMode, o as RowsPastePayload } from './types-Iot4g4sq.cjs';
|
|
2
|
+
export { B as BuiltinCellKind, b as CellRenderFn, d as ColumnFreezeColumnInput, e as ColumnFreezeEdgeSide, f as ColumnFreezeMeta, h as ColumnFreezeSide, D as DEFAULT_DATA_TABLE_LABELS, I as INLINE_SEARCH_MAX_RESULTS, S as SearchCorpusRow, t as buildColumnFreezeOffsets, u as buildFlatSearchCorpus, v as buildSearchMatchKey, w as buildSearchMatchKeys, x as buildTreeSearchCorpus, y as cellValueToSearchText, z as collectAncestorKeysToExpand, A as collectSearchMatchesInRange, E as createSearchRegex, F as escapeSearchRegex, G as formatSearchResultLabel, H as getColumnFreezeEdgeAttr, J as getColumnFreezeStyle, K as mapSearchResultToVisibleItem, L as mapSearchResultsToVisibleKeys, M as nextSearchIndex, N as nextSearchStride, O as previousSearchIndex, Q as resolveColumnFreezeSide, U as resolveDataTableLabels, V as resolveHeaderFreezeOffset } from './types-Iot4g4sq.cjs';
|
|
3
|
+
import { Row, ColumnDef, CellContext, Table, Cell, ColumnOrderState, Updater, RowSelectionState } from '@tanstack/react-table';
|
|
4
|
+
export { ColumnDef, ColumnOrderState, ColumnResizeMode, ColumnSizingState, RowSelectionState } from '@tanstack/react-table';
|
|
5
5
|
import { Virtualizer, VirtualItem } from '@tanstack/react-virtual';
|
|
6
6
|
import * as react from 'react';
|
|
7
|
-
import { RefObject, CSSProperties } from 'react';
|
|
7
|
+
import { RefObject, CSSProperties, PointerEvent } from 'react';
|
|
8
8
|
|
|
9
9
|
/** Neutral default field names for tree conversion */
|
|
10
10
|
declare const DEFAULT_TREE_ID_FIELD = "id";
|
|
@@ -115,6 +115,15 @@ type RowSpanInfo = {
|
|
|
115
115
|
rowSpan: number;
|
|
116
116
|
isFirstInGroup: boolean;
|
|
117
117
|
};
|
|
118
|
+
type RowSpanColumnSpec = {
|
|
119
|
+
columnId: string;
|
|
120
|
+
rowSpanKey: string;
|
|
121
|
+
/**
|
|
122
|
+
* Column ids, rowSpanKeys, or row fields this merge cannot cross.
|
|
123
|
+
* Omit (or leave undefined) to merge independently of other rowSpan columns.
|
|
124
|
+
*/
|
|
125
|
+
rowSpanParent?: readonly string[];
|
|
126
|
+
};
|
|
118
127
|
type ColumnRowSpanMap = Map<string, RowSpanInfo[]>;
|
|
119
128
|
/**
|
|
120
129
|
* Returns the start row and rowSpan of the merged cell covering a given row.
|
|
@@ -126,15 +135,11 @@ declare function resolveRowSpanAt(rowSpans: RowSpanInfo[] | undefined, rowIndex:
|
|
|
126
135
|
};
|
|
127
136
|
/**
|
|
128
137
|
* Computes merge info for every column that has rowSpan meta.
|
|
138
|
+
* Columns without `rowSpanParent` merge independently. Columns with a parent
|
|
139
|
+
* only merge inside that parent field / column's groups.
|
|
129
140
|
*/
|
|
130
|
-
declare function buildColumnRowSpanMap<T extends Record<string, unknown>>(data: T[], columnKeys:
|
|
131
|
-
|
|
132
|
-
rowSpanKey: string;
|
|
133
|
-
}>): ColumnRowSpanMap;
|
|
134
|
-
declare function collectRowSpanColumns<T extends Record<string, unknown>>(columns: ColumnDef<T, unknown>[]): Array<{
|
|
135
|
-
columnId: string;
|
|
136
|
-
rowSpanKey: string;
|
|
137
|
-
}>;
|
|
141
|
+
declare function buildColumnRowSpanMap<T extends Record<string, unknown>>(data: T[], columnKeys: RowSpanColumnSpec[]): ColumnRowSpanMap;
|
|
142
|
+
declare function collectRowSpanColumns<T extends Record<string, unknown>>(columns: ColumnDef<T, unknown>[]): RowSpanColumnSpec[];
|
|
138
143
|
|
|
139
144
|
type RowData = Record<string, unknown>;
|
|
140
145
|
type DataTableRowContextValue = {
|
|
@@ -261,6 +266,7 @@ type UseGlideTableResult<T extends Record<string, unknown>> = {
|
|
|
261
266
|
selectionLabel: DataTableLabels["selection"];
|
|
262
267
|
enableCellSelection: boolean;
|
|
263
268
|
enableColumnResize: boolean;
|
|
269
|
+
enableColumnReorder: boolean;
|
|
264
270
|
enableColumnFreeze: boolean;
|
|
265
271
|
enableInlineSearch: boolean;
|
|
266
272
|
shouldVirtualize: boolean;
|
|
@@ -278,6 +284,7 @@ type UseGlideTableResult<T extends Record<string, unknown>> = {
|
|
|
278
284
|
getCellContext: <TValue>(cell: Cell<T, TValue>) => CellContextWithUpdate<T, TValue>;
|
|
279
285
|
handleToggleSelect: (row: Row<T>) => void;
|
|
280
286
|
clearHover: () => void;
|
|
287
|
+
setColumnOrder: (next: ColumnOrderState) => void;
|
|
281
288
|
copySelection: DataTableCopyActions["copySelection"];
|
|
282
289
|
inlineSearch: {
|
|
283
290
|
showSearch: boolean;
|
|
@@ -339,6 +346,38 @@ declare function getColumnSizeStyle(size: number, options?: {
|
|
|
339
346
|
lockMax?: boolean;
|
|
340
347
|
}): CSSProperties | undefined;
|
|
341
348
|
|
|
349
|
+
type ColumnDropEdge = "before" | "after";
|
|
350
|
+
declare function collectLeafColumnIds<T>(columns: readonly ColumnDef<T, unknown>[]): string[];
|
|
351
|
+
/** Keep known ids in the given order and append any new leaves at the end. */
|
|
352
|
+
declare function resolveLeafColumnOrder<T>(columns: readonly ColumnDef<T, unknown>[], order: readonly string[] | undefined): string[];
|
|
353
|
+
/**
|
|
354
|
+
* Reorder nested `ColumnDef`s by leaf id list.
|
|
355
|
+
* Consecutive leaves that still share a parent group stay wrapped together;
|
|
356
|
+
* interleaved groups split (Glide-style).
|
|
357
|
+
*/
|
|
358
|
+
declare function applyLeafColumnOrder<T>(columns: readonly ColumnDef<T, unknown>[], order: readonly string[] | undefined): ColumnDef<T, unknown>[];
|
|
359
|
+
declare function moveColumnIds(order: readonly string[], fromIds: readonly string[], targetIds: readonly string[], edge: ColumnDropEdge): string[];
|
|
360
|
+
declare function resolveDropEdge(clientX: number, rect: Pick<DOMRect, "left" | "width">): ColumnDropEdge;
|
|
361
|
+
|
|
362
|
+
type ColumnReorderDropTarget = {
|
|
363
|
+
columnId: string;
|
|
364
|
+
edge: ColumnDropEdge;
|
|
365
|
+
};
|
|
366
|
+
declare function useColumnReorder(options: {
|
|
367
|
+
enabled: boolean;
|
|
368
|
+
columnOrder: readonly string[];
|
|
369
|
+
onColumnOrderChange: (next: string[]) => void;
|
|
370
|
+
}): {
|
|
371
|
+
isReordering: boolean;
|
|
372
|
+
draggingColumnId: string | null;
|
|
373
|
+
dropTarget: ColumnReorderDropTarget | null;
|
|
374
|
+
onHeaderPointerDown: (event: PointerEvent<HTMLTableCellElement>, meta: {
|
|
375
|
+
columnId: string;
|
|
376
|
+
leafIds: string[];
|
|
377
|
+
canDrag: boolean;
|
|
378
|
+
}) => void;
|
|
379
|
+
};
|
|
380
|
+
|
|
342
381
|
type ParsedClipboardTSV = {
|
|
343
382
|
values: string[][];
|
|
344
383
|
/**
|
|
@@ -463,4 +502,4 @@ declare const useConvertTreeData: <T extends Record<string, unknown>>({ data, en
|
|
|
463
502
|
declare function resolveRowSelection(mode: RowSelectionMode, controlledSelection: RowSelectionState | undefined, internalSelection: RowSelectionState): RowSelectionState;
|
|
464
503
|
declare function applySelectionUpdater(mode: RowSelectionMode, updater: Updater<RowSelectionState>, previous: RowSelectionState): RowSelectionState;
|
|
465
504
|
|
|
466
|
-
export { BUILTIN_CELL_RENDERERS, CELL_SELECTION_EDGES_CLASS, type CellContextWithUpdate, CellKind, CellRenderContext, CellRenderer, type CellRendererRegistry, 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, ResolvedTableCell, 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, commitCellValue, createCellRendererRegistry, flattenSubtreeRows, formatCellValue, formatDefaultCellValue, getCellEditDraftValue, getCellSelectionEdgeStyle, getColumnEditType, getColumnSizeStyle, getRowIndexInMergedCell, hasCellSelectionEdges, isCellInSelection, isColumnEditable, isEditablePasteTarget, measureMergedSpanRowHeights, parseCellEditValue, parseClipboardTSV, parseClipboardTSVWithDepths, resolveCellRenderer, resolvePasteColumnIds, resolveRowSelection, resolveRowSpanAt, rowRangeToHeightRatios, serializeCopyRowsToTSV, serializeSelectionToTSV, toggleExpandedRowId, useCellEdit, useCellSelection, useConvertTreeData, useGlideTable, useInlineSearch, withCellUpdate, writeSelectionToClipboard };
|
|
505
|
+
export { BUILTIN_CELL_RENDERERS, CELL_SELECTION_EDGES_CLASS, type CellContextWithUpdate, CellKind, CellRenderContext, CellRenderer, type CellRendererRegistry, type CellSelectionBounds, type ColumnDropEdge, 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, ResolvedTableCell, RowSelectionMode, type RowSpanColumnSpec, type RowSpanInfo, RowsPastePayload, SearchResultItem, SearchStatus, type TreeRow, type UseConvertTreeDataParams, type UseGlideTableOptions, type UseGlideTableResult, type UseInlineSearchOptions, type UseInlineSearchResult, applyCellEdit, applyFillData, applyLeafColumnOrder, applySelectionUpdater, buildColumnRowSpanMap, buildRowsPastePayload, canExpandRow, collectCopyRowEntries, collectCopyRows, collectFillChanges, collectLeafColumnIds, collectRowSpanColumns, commitCellValue, createCellRendererRegistry, flattenSubtreeRows, formatCellValue, formatDefaultCellValue, getCellEditDraftValue, getCellSelectionEdgeStyle, getColumnEditType, getColumnSizeStyle, getRowIndexInMergedCell, hasCellSelectionEdges, isCellInSelection, isColumnEditable, isEditablePasteTarget, measureMergedSpanRowHeights, moveColumnIds, parseCellEditValue, parseClipboardTSV, parseClipboardTSVWithDepths, resolveCellRenderer, resolveDropEdge, resolveLeafColumnOrder, resolvePasteColumnIds, resolveRowSelection, resolveRowSpanAt, rowRangeToHeightRatios, serializeCopyRowsToTSV, serializeSelectionToTSV, toggleExpandedRowId, useCellEdit, useCellSelection, useColumnReorder, useConvertTreeData, useGlideTable, useInlineSearch, withCellUpdate, writeSelectionToClipboard };
|
package/dist/core.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { W as CellEditType, c as CellRenderer, C as CellKind, a as CellRenderContext, i as DataTableClassNames, R as RowSelectionMode, g as ColumnFreezeOffset, p as SearchResultItem, q as SearchStatus, l as DataTableProps, k as DataTableLabels, j as DataTableCopyActions, P as PasteMode, o as RowsPastePayload } from './types-
|
|
2
|
-
export { B as BuiltinCellKind, b as CellRenderFn, d as ColumnFreezeColumnInput, e as ColumnFreezeEdgeSide, f as ColumnFreezeMeta, h as ColumnFreezeSide, D as DEFAULT_DATA_TABLE_LABELS, I as INLINE_SEARCH_MAX_RESULTS, S as SearchCorpusRow, t as buildColumnFreezeOffsets, u as buildFlatSearchCorpus, v as buildSearchMatchKey, w as buildSearchMatchKeys, x as buildTreeSearchCorpus, y as cellValueToSearchText, z as collectAncestorKeysToExpand, A as collectSearchMatchesInRange, E as createSearchRegex, F as escapeSearchRegex, G as formatSearchResultLabel, H as getColumnFreezeEdgeAttr, J as getColumnFreezeStyle, K as mapSearchResultToVisibleItem, L as mapSearchResultsToVisibleKeys, M as nextSearchIndex, N as nextSearchStride, O as previousSearchIndex, Q as resolveColumnFreezeSide, U as resolveDataTableLabels, V as resolveHeaderFreezeOffset } from './types-
|
|
3
|
-
import { Row, ColumnDef, CellContext, Table, Cell, Updater, RowSelectionState } from '@tanstack/react-table';
|
|
4
|
-
export { ColumnDef, ColumnResizeMode, ColumnSizingState, RowSelectionState } from '@tanstack/react-table';
|
|
1
|
+
import { W as CellEditType, c as CellRenderer, C as CellKind, a as CellRenderContext, i as DataTableClassNames, R as RowSelectionMode, g as ColumnFreezeOffset, p as SearchResultItem, q as SearchStatus, l as DataTableProps, k as DataTableLabels, j as DataTableCopyActions, P as PasteMode, o as RowsPastePayload } from './types-Iot4g4sq.js';
|
|
2
|
+
export { B as BuiltinCellKind, b as CellRenderFn, d as ColumnFreezeColumnInput, e as ColumnFreezeEdgeSide, f as ColumnFreezeMeta, h as ColumnFreezeSide, D as DEFAULT_DATA_TABLE_LABELS, I as INLINE_SEARCH_MAX_RESULTS, S as SearchCorpusRow, t as buildColumnFreezeOffsets, u as buildFlatSearchCorpus, v as buildSearchMatchKey, w as buildSearchMatchKeys, x as buildTreeSearchCorpus, y as cellValueToSearchText, z as collectAncestorKeysToExpand, A as collectSearchMatchesInRange, E as createSearchRegex, F as escapeSearchRegex, G as formatSearchResultLabel, H as getColumnFreezeEdgeAttr, J as getColumnFreezeStyle, K as mapSearchResultToVisibleItem, L as mapSearchResultsToVisibleKeys, M as nextSearchIndex, N as nextSearchStride, O as previousSearchIndex, Q as resolveColumnFreezeSide, U as resolveDataTableLabels, V as resolveHeaderFreezeOffset } from './types-Iot4g4sq.js';
|
|
3
|
+
import { Row, ColumnDef, CellContext, Table, Cell, ColumnOrderState, Updater, RowSelectionState } from '@tanstack/react-table';
|
|
4
|
+
export { ColumnDef, ColumnOrderState, ColumnResizeMode, ColumnSizingState, RowSelectionState } from '@tanstack/react-table';
|
|
5
5
|
import { Virtualizer, VirtualItem } from '@tanstack/react-virtual';
|
|
6
6
|
import * as react from 'react';
|
|
7
|
-
import { RefObject, CSSProperties } from 'react';
|
|
7
|
+
import { RefObject, CSSProperties, PointerEvent } from 'react';
|
|
8
8
|
|
|
9
9
|
/** Neutral default field names for tree conversion */
|
|
10
10
|
declare const DEFAULT_TREE_ID_FIELD = "id";
|
|
@@ -115,6 +115,15 @@ type RowSpanInfo = {
|
|
|
115
115
|
rowSpan: number;
|
|
116
116
|
isFirstInGroup: boolean;
|
|
117
117
|
};
|
|
118
|
+
type RowSpanColumnSpec = {
|
|
119
|
+
columnId: string;
|
|
120
|
+
rowSpanKey: string;
|
|
121
|
+
/**
|
|
122
|
+
* Column ids, rowSpanKeys, or row fields this merge cannot cross.
|
|
123
|
+
* Omit (or leave undefined) to merge independently of other rowSpan columns.
|
|
124
|
+
*/
|
|
125
|
+
rowSpanParent?: readonly string[];
|
|
126
|
+
};
|
|
118
127
|
type ColumnRowSpanMap = Map<string, RowSpanInfo[]>;
|
|
119
128
|
/**
|
|
120
129
|
* Returns the start row and rowSpan of the merged cell covering a given row.
|
|
@@ -126,15 +135,11 @@ declare function resolveRowSpanAt(rowSpans: RowSpanInfo[] | undefined, rowIndex:
|
|
|
126
135
|
};
|
|
127
136
|
/**
|
|
128
137
|
* Computes merge info for every column that has rowSpan meta.
|
|
138
|
+
* Columns without `rowSpanParent` merge independently. Columns with a parent
|
|
139
|
+
* only merge inside that parent field / column's groups.
|
|
129
140
|
*/
|
|
130
|
-
declare function buildColumnRowSpanMap<T extends Record<string, unknown>>(data: T[], columnKeys:
|
|
131
|
-
|
|
132
|
-
rowSpanKey: string;
|
|
133
|
-
}>): ColumnRowSpanMap;
|
|
134
|
-
declare function collectRowSpanColumns<T extends Record<string, unknown>>(columns: ColumnDef<T, unknown>[]): Array<{
|
|
135
|
-
columnId: string;
|
|
136
|
-
rowSpanKey: string;
|
|
137
|
-
}>;
|
|
141
|
+
declare function buildColumnRowSpanMap<T extends Record<string, unknown>>(data: T[], columnKeys: RowSpanColumnSpec[]): ColumnRowSpanMap;
|
|
142
|
+
declare function collectRowSpanColumns<T extends Record<string, unknown>>(columns: ColumnDef<T, unknown>[]): RowSpanColumnSpec[];
|
|
138
143
|
|
|
139
144
|
type RowData = Record<string, unknown>;
|
|
140
145
|
type DataTableRowContextValue = {
|
|
@@ -261,6 +266,7 @@ type UseGlideTableResult<T extends Record<string, unknown>> = {
|
|
|
261
266
|
selectionLabel: DataTableLabels["selection"];
|
|
262
267
|
enableCellSelection: boolean;
|
|
263
268
|
enableColumnResize: boolean;
|
|
269
|
+
enableColumnReorder: boolean;
|
|
264
270
|
enableColumnFreeze: boolean;
|
|
265
271
|
enableInlineSearch: boolean;
|
|
266
272
|
shouldVirtualize: boolean;
|
|
@@ -278,6 +284,7 @@ type UseGlideTableResult<T extends Record<string, unknown>> = {
|
|
|
278
284
|
getCellContext: <TValue>(cell: Cell<T, TValue>) => CellContextWithUpdate<T, TValue>;
|
|
279
285
|
handleToggleSelect: (row: Row<T>) => void;
|
|
280
286
|
clearHover: () => void;
|
|
287
|
+
setColumnOrder: (next: ColumnOrderState) => void;
|
|
281
288
|
copySelection: DataTableCopyActions["copySelection"];
|
|
282
289
|
inlineSearch: {
|
|
283
290
|
showSearch: boolean;
|
|
@@ -339,6 +346,38 @@ declare function getColumnSizeStyle(size: number, options?: {
|
|
|
339
346
|
lockMax?: boolean;
|
|
340
347
|
}): CSSProperties | undefined;
|
|
341
348
|
|
|
349
|
+
type ColumnDropEdge = "before" | "after";
|
|
350
|
+
declare function collectLeafColumnIds<T>(columns: readonly ColumnDef<T, unknown>[]): string[];
|
|
351
|
+
/** Keep known ids in the given order and append any new leaves at the end. */
|
|
352
|
+
declare function resolveLeafColumnOrder<T>(columns: readonly ColumnDef<T, unknown>[], order: readonly string[] | undefined): string[];
|
|
353
|
+
/**
|
|
354
|
+
* Reorder nested `ColumnDef`s by leaf id list.
|
|
355
|
+
* Consecutive leaves that still share a parent group stay wrapped together;
|
|
356
|
+
* interleaved groups split (Glide-style).
|
|
357
|
+
*/
|
|
358
|
+
declare function applyLeafColumnOrder<T>(columns: readonly ColumnDef<T, unknown>[], order: readonly string[] | undefined): ColumnDef<T, unknown>[];
|
|
359
|
+
declare function moveColumnIds(order: readonly string[], fromIds: readonly string[], targetIds: readonly string[], edge: ColumnDropEdge): string[];
|
|
360
|
+
declare function resolveDropEdge(clientX: number, rect: Pick<DOMRect, "left" | "width">): ColumnDropEdge;
|
|
361
|
+
|
|
362
|
+
type ColumnReorderDropTarget = {
|
|
363
|
+
columnId: string;
|
|
364
|
+
edge: ColumnDropEdge;
|
|
365
|
+
};
|
|
366
|
+
declare function useColumnReorder(options: {
|
|
367
|
+
enabled: boolean;
|
|
368
|
+
columnOrder: readonly string[];
|
|
369
|
+
onColumnOrderChange: (next: string[]) => void;
|
|
370
|
+
}): {
|
|
371
|
+
isReordering: boolean;
|
|
372
|
+
draggingColumnId: string | null;
|
|
373
|
+
dropTarget: ColumnReorderDropTarget | null;
|
|
374
|
+
onHeaderPointerDown: (event: PointerEvent<HTMLTableCellElement>, meta: {
|
|
375
|
+
columnId: string;
|
|
376
|
+
leafIds: string[];
|
|
377
|
+
canDrag: boolean;
|
|
378
|
+
}) => void;
|
|
379
|
+
};
|
|
380
|
+
|
|
342
381
|
type ParsedClipboardTSV = {
|
|
343
382
|
values: string[][];
|
|
344
383
|
/**
|
|
@@ -463,4 +502,4 @@ declare const useConvertTreeData: <T extends Record<string, unknown>>({ data, en
|
|
|
463
502
|
declare function resolveRowSelection(mode: RowSelectionMode, controlledSelection: RowSelectionState | undefined, internalSelection: RowSelectionState): RowSelectionState;
|
|
464
503
|
declare function applySelectionUpdater(mode: RowSelectionMode, updater: Updater<RowSelectionState>, previous: RowSelectionState): RowSelectionState;
|
|
465
504
|
|
|
466
|
-
export { BUILTIN_CELL_RENDERERS, CELL_SELECTION_EDGES_CLASS, type CellContextWithUpdate, CellKind, CellRenderContext, CellRenderer, type CellRendererRegistry, 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, ResolvedTableCell, 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, commitCellValue, createCellRendererRegistry, flattenSubtreeRows, formatCellValue, formatDefaultCellValue, getCellEditDraftValue, getCellSelectionEdgeStyle, getColumnEditType, getColumnSizeStyle, getRowIndexInMergedCell, hasCellSelectionEdges, isCellInSelection, isColumnEditable, isEditablePasteTarget, measureMergedSpanRowHeights, parseCellEditValue, parseClipboardTSV, parseClipboardTSVWithDepths, resolveCellRenderer, resolvePasteColumnIds, resolveRowSelection, resolveRowSpanAt, rowRangeToHeightRatios, serializeCopyRowsToTSV, serializeSelectionToTSV, toggleExpandedRowId, useCellEdit, useCellSelection, useConvertTreeData, useGlideTable, useInlineSearch, withCellUpdate, writeSelectionToClipboard };
|
|
505
|
+
export { BUILTIN_CELL_RENDERERS, CELL_SELECTION_EDGES_CLASS, type CellContextWithUpdate, CellKind, CellRenderContext, CellRenderer, type CellRendererRegistry, type CellSelectionBounds, type ColumnDropEdge, 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, ResolvedTableCell, RowSelectionMode, type RowSpanColumnSpec, type RowSpanInfo, RowsPastePayload, SearchResultItem, SearchStatus, type TreeRow, type UseConvertTreeDataParams, type UseGlideTableOptions, type UseGlideTableResult, type UseInlineSearchOptions, type UseInlineSearchResult, applyCellEdit, applyFillData, applyLeafColumnOrder, applySelectionUpdater, buildColumnRowSpanMap, buildRowsPastePayload, canExpandRow, collectCopyRowEntries, collectCopyRows, collectFillChanges, collectLeafColumnIds, collectRowSpanColumns, commitCellValue, createCellRendererRegistry, flattenSubtreeRows, formatCellValue, formatDefaultCellValue, getCellEditDraftValue, getCellSelectionEdgeStyle, getColumnEditType, getColumnSizeStyle, getRowIndexInMergedCell, hasCellSelectionEdges, isCellInSelection, isColumnEditable, isEditablePasteTarget, measureMergedSpanRowHeights, moveColumnIds, parseCellEditValue, parseClipboardTSV, parseClipboardTSVWithDepths, resolveCellRenderer, resolveDropEdge, resolveLeafColumnOrder, resolvePasteColumnIds, resolveRowSelection, resolveRowSpanAt, rowRangeToHeightRatios, serializeCopyRowsToTSV, serializeSelectionToTSV, toggleExpandedRowId, useCellEdit, useCellSelection, useColumnReorder, useConvertTreeData, useGlideTable, useInlineSearch, withCellUpdate, writeSelectionToClipboard };
|