react-glide-table 2.2.1 → 2.3.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 +33 -30
- package/dist/compound.cjs +561 -139
- package/dist/compound.d.cts +2 -2
- package/dist/compound.d.ts +2 -2
- package/dist/compound.js +465 -43
- package/dist/core.cjs +491 -137
- package/dist/core.d.cts +46 -7
- package/dist/core.d.ts +46 -7
- package/dist/core.js +378 -25
- package/dist/index.cjs +590 -166
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +466 -43
- package/dist/{types-CnsQ8GZb.d.cts → types-DdeVn-9s.d.cts} +23 -6
- package/dist/{types-CnsQ8GZb.d.ts → types-DdeVn-9s.d.ts} +23 -6
- package/package.json +1 -1
package/dist/core.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
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-DdeVn-9s.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-DdeVn-9s.cjs';
|
|
3
3
|
import { Row, ColumnDef, CellContext, Table, Cell, ColumnOrderState, Updater, RowSelectionState } from '@tanstack/react-table';
|
|
4
4
|
export { ColumnDef, ColumnOrderState, ColumnResizeMode, ColumnSizingState, RowSelectionState } from '@tanstack/react-table';
|
|
5
5
|
import { Virtualizer, VirtualItem } from '@tanstack/react-virtual';
|
|
@@ -190,6 +190,8 @@ type DataTableRowContextValue = {
|
|
|
190
190
|
};
|
|
191
191
|
columnResize: {
|
|
192
192
|
enableColumnResize: boolean;
|
|
193
|
+
/** Resolved pixel widths for fixed / min-max columns (not resize mode). */
|
|
194
|
+
layoutWidths?: Map<string, number>;
|
|
193
195
|
};
|
|
194
196
|
columnFreeze: {
|
|
195
197
|
enableColumnFreeze: boolean;
|
|
@@ -347,7 +349,30 @@ type ColumnSizeStyleOptions = {
|
|
|
347
349
|
minWidth?: number;
|
|
348
350
|
/** CSS max-width for the cell. Ignored when `lockMax` is on. */
|
|
349
351
|
maxWidth?: number;
|
|
352
|
+
/**
|
|
353
|
+
* Layout-resolved width from `resolveColumnLayoutWidths`.
|
|
354
|
+
* When set (and not resize-locked), applied as the cell `width`.
|
|
355
|
+
*/
|
|
356
|
+
layoutWidth?: number;
|
|
357
|
+
};
|
|
358
|
+
type ColumnLayoutInput = {
|
|
359
|
+
id: string;
|
|
360
|
+
/** Present when `Column.width` was set. */
|
|
361
|
+
width?: number;
|
|
362
|
+
minWidth?: number;
|
|
363
|
+
maxWidth?: number;
|
|
350
364
|
};
|
|
365
|
+
/**
|
|
366
|
+
* Resolve pixel widths for fixed and bounded columns.
|
|
367
|
+
*
|
|
368
|
+
* - Explicit `width` columns keep that size (clamped by min/max when set).
|
|
369
|
+
* - Columns with only min/max resolve inside that range, preferring `maxWidth`
|
|
370
|
+
* so content can stay on one line when space allows.
|
|
371
|
+
* - Unconstrained columns (no `width`, no min/max) are omitted so they absorb
|
|
372
|
+
* leftover space after bounded columns take their preferred size.
|
|
373
|
+
* - When space is tight, bounded columns shrink toward `minWidth` first.
|
|
374
|
+
*/
|
|
375
|
+
declare function resolveColumnLayoutWidths(containerWidth: number, columns: ColumnLayoutInput[]): Map<string, number>;
|
|
351
376
|
/** Width styles for header/body cells when column sizing is active. */
|
|
352
377
|
declare function getColumnSizeStyle(size: number, options?: ColumnSizeStyleOptions): CSSProperties | undefined;
|
|
353
378
|
|
|
@@ -427,8 +452,12 @@ type UseCellSelectionOptions<T extends Record<string, unknown>> = {
|
|
|
427
452
|
onRowsPaste?: (payload: RowsPastePayload) => void;
|
|
428
453
|
/** Called after keyboard navigation moves the active (end) cell. */
|
|
429
454
|
onCellNavigate?: (position: CellPosition) => void;
|
|
455
|
+
/** Resolves `meta.kind` renderers so copied text matches the visible cell. */
|
|
456
|
+
cellRendererRegistry?: CellRendererRegistry;
|
|
457
|
+
/** Scopes copy's DOM image-url lookup to this table when several are mounted at once. */
|
|
458
|
+
rootRef?: RefObject<HTMLElement | null>;
|
|
430
459
|
};
|
|
431
|
-
declare function useCellSelection<T extends Record<string, unknown>>({ data, rows, enabled, columnCount, enableSubtreeCopy, enableInsertPaste, onDataChange, onBatchChange, onRowsPaste, onCellNavigate, }: UseCellSelectionOptions<T>): {
|
|
460
|
+
declare function useCellSelection<T extends Record<string, unknown>>({ data, rows, enabled, columnCount, enableSubtreeCopy, enableInsertPaste, onDataChange, onBatchChange, onRowsPaste, onCellNavigate, cellRendererRegistry, rootRef, }: UseCellSelectionOptions<T>): {
|
|
432
461
|
dragState: DragState;
|
|
433
462
|
activeSelectionBounds: CellSelectionBounds | null;
|
|
434
463
|
handleCellMouseDown: (rowIndex: number, colIndex: number, options?: CellMouseDownOptions) => void;
|
|
@@ -443,6 +472,16 @@ type CopyRowEntry<T extends Record<string, unknown>> = {
|
|
|
443
472
|
/** Tree depth relative to the table root (0 = top-level). */
|
|
444
473
|
depth: number;
|
|
445
474
|
};
|
|
475
|
+
/**
|
|
476
|
+
* `registry` resolves `meta.kind` renderers (built-ins like `protected`, plus
|
|
477
|
+
* custom `cellRenderers`) so copy text matches the visible cell instead of the
|
|
478
|
+
* raw value. `root` scopes the DOM image-url lookup to one table when several
|
|
479
|
+
* are mounted at once.
|
|
480
|
+
*/
|
|
481
|
+
type CopyRenderOptions = {
|
|
482
|
+
registry?: CellRendererRegistry;
|
|
483
|
+
root?: ParentNode | null;
|
|
484
|
+
};
|
|
446
485
|
/**
|
|
447
486
|
* Clipboard / Excel paste expects one plain string per cell.
|
|
448
487
|
* Avoids `String(object)` → `[object Object]` and joins arrays with `, `.
|
|
@@ -455,9 +494,9 @@ declare function flattenSubtreeRows<T extends Record<string, unknown>>(row: T):
|
|
|
455
494
|
*/
|
|
456
495
|
declare function collectCopyRowEntries<T extends Record<string, unknown>>(visibleRows: Row<T>[], bounds: CellSelectionBounds, mode?: CopySelectionMode): CopyRowEntry<T>[];
|
|
457
496
|
declare function collectCopyRows<T extends Record<string, unknown>>(visibleRows: Row<T>[], bounds: CellSelectionBounds, mode?: CopySelectionMode): T[];
|
|
458
|
-
declare function serializeCopyRowsToTSV<T extends Record<string, unknown>>(copyRows: T[], visibleRows: Row<T>[], bounds: CellSelectionBounds, depths?: number[]): string;
|
|
459
|
-
declare function serializeSelectionToTSV<T extends Record<string, unknown>>(visibleRows: Row<T>[], bounds: CellSelectionBounds, mode?: CopySelectionMode): string;
|
|
460
|
-
declare function writeSelectionToClipboard<T extends Record<string, unknown>>(visibleRows: Row<T>[], bounds: CellSelectionBounds, mode?: CopySelectionMode): Promise<boolean>;
|
|
497
|
+
declare function serializeCopyRowsToTSV<T extends Record<string, unknown>>(copyRows: T[], visibleRows: Row<T>[], bounds: CellSelectionBounds, depths?: number[], options?: CopyRenderOptions): string;
|
|
498
|
+
declare function serializeSelectionToTSV<T extends Record<string, unknown>>(visibleRows: Row<T>[], bounds: CellSelectionBounds, mode?: CopySelectionMode, options?: CopyRenderOptions): string;
|
|
499
|
+
declare function writeSelectionToClipboard<T extends Record<string, unknown>>(visibleRows: Row<T>[], bounds: CellSelectionBounds, mode?: CopySelectionMode, options?: CopyRenderOptions): Promise<boolean>;
|
|
461
500
|
|
|
462
501
|
type CellChange = {
|
|
463
502
|
rowId: string;
|
|
@@ -507,4 +546,4 @@ declare const useConvertTreeData: <T extends Record<string, unknown>>({ data, en
|
|
|
507
546
|
declare function resolveRowSelection(mode: RowSelectionMode, controlledSelection: RowSelectionState | undefined, internalSelection: RowSelectionState): RowSelectionState;
|
|
508
547
|
declare function applySelectionUpdater(mode: RowSelectionMode, updater: Updater<RowSelectionState>, previous: RowSelectionState): RowSelectionState;
|
|
509
548
|
|
|
510
|
-
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 };
|
|
549
|
+
export { BUILTIN_CELL_RENDERERS, CELL_SELECTION_EDGES_CLASS, type CellContextWithUpdate, CellKind, CellRenderContext, CellRenderer, type CellRendererRegistry, type CellSelectionBounds, type ColumnDropEdge, ColumnFreezeOffset, type ColumnLayoutInput, 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, resolveColumnLayoutWidths, resolveDropEdge, resolveLeafColumnOrder, resolvePasteColumnIds, resolveRowSelection, resolveRowSpanAt, rowRangeToHeightRatios, serializeCopyRowsToTSV, serializeSelectionToTSV, toggleExpandedRowId, useCellEdit, useCellSelection, useColumnReorder, useConvertTreeData, useGlideTable, useInlineSearch, withCellUpdate, writeSelectionToClipboard };
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
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-DdeVn-9s.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-DdeVn-9s.js';
|
|
3
3
|
import { Row, ColumnDef, CellContext, Table, Cell, ColumnOrderState, Updater, RowSelectionState } from '@tanstack/react-table';
|
|
4
4
|
export { ColumnDef, ColumnOrderState, ColumnResizeMode, ColumnSizingState, RowSelectionState } from '@tanstack/react-table';
|
|
5
5
|
import { Virtualizer, VirtualItem } from '@tanstack/react-virtual';
|
|
@@ -190,6 +190,8 @@ type DataTableRowContextValue = {
|
|
|
190
190
|
};
|
|
191
191
|
columnResize: {
|
|
192
192
|
enableColumnResize: boolean;
|
|
193
|
+
/** Resolved pixel widths for fixed / min-max columns (not resize mode). */
|
|
194
|
+
layoutWidths?: Map<string, number>;
|
|
193
195
|
};
|
|
194
196
|
columnFreeze: {
|
|
195
197
|
enableColumnFreeze: boolean;
|
|
@@ -347,7 +349,30 @@ type ColumnSizeStyleOptions = {
|
|
|
347
349
|
minWidth?: number;
|
|
348
350
|
/** CSS max-width for the cell. Ignored when `lockMax` is on. */
|
|
349
351
|
maxWidth?: number;
|
|
352
|
+
/**
|
|
353
|
+
* Layout-resolved width from `resolveColumnLayoutWidths`.
|
|
354
|
+
* When set (and not resize-locked), applied as the cell `width`.
|
|
355
|
+
*/
|
|
356
|
+
layoutWidth?: number;
|
|
357
|
+
};
|
|
358
|
+
type ColumnLayoutInput = {
|
|
359
|
+
id: string;
|
|
360
|
+
/** Present when `Column.width` was set. */
|
|
361
|
+
width?: number;
|
|
362
|
+
minWidth?: number;
|
|
363
|
+
maxWidth?: number;
|
|
350
364
|
};
|
|
365
|
+
/**
|
|
366
|
+
* Resolve pixel widths for fixed and bounded columns.
|
|
367
|
+
*
|
|
368
|
+
* - Explicit `width` columns keep that size (clamped by min/max when set).
|
|
369
|
+
* - Columns with only min/max resolve inside that range, preferring `maxWidth`
|
|
370
|
+
* so content can stay on one line when space allows.
|
|
371
|
+
* - Unconstrained columns (no `width`, no min/max) are omitted so they absorb
|
|
372
|
+
* leftover space after bounded columns take their preferred size.
|
|
373
|
+
* - When space is tight, bounded columns shrink toward `minWidth` first.
|
|
374
|
+
*/
|
|
375
|
+
declare function resolveColumnLayoutWidths(containerWidth: number, columns: ColumnLayoutInput[]): Map<string, number>;
|
|
351
376
|
/** Width styles for header/body cells when column sizing is active. */
|
|
352
377
|
declare function getColumnSizeStyle(size: number, options?: ColumnSizeStyleOptions): CSSProperties | undefined;
|
|
353
378
|
|
|
@@ -427,8 +452,12 @@ type UseCellSelectionOptions<T extends Record<string, unknown>> = {
|
|
|
427
452
|
onRowsPaste?: (payload: RowsPastePayload) => void;
|
|
428
453
|
/** Called after keyboard navigation moves the active (end) cell. */
|
|
429
454
|
onCellNavigate?: (position: CellPosition) => void;
|
|
455
|
+
/** Resolves `meta.kind` renderers so copied text matches the visible cell. */
|
|
456
|
+
cellRendererRegistry?: CellRendererRegistry;
|
|
457
|
+
/** Scopes copy's DOM image-url lookup to this table when several are mounted at once. */
|
|
458
|
+
rootRef?: RefObject<HTMLElement | null>;
|
|
430
459
|
};
|
|
431
|
-
declare function useCellSelection<T extends Record<string, unknown>>({ data, rows, enabled, columnCount, enableSubtreeCopy, enableInsertPaste, onDataChange, onBatchChange, onRowsPaste, onCellNavigate, }: UseCellSelectionOptions<T>): {
|
|
460
|
+
declare function useCellSelection<T extends Record<string, unknown>>({ data, rows, enabled, columnCount, enableSubtreeCopy, enableInsertPaste, onDataChange, onBatchChange, onRowsPaste, onCellNavigate, cellRendererRegistry, rootRef, }: UseCellSelectionOptions<T>): {
|
|
432
461
|
dragState: DragState;
|
|
433
462
|
activeSelectionBounds: CellSelectionBounds | null;
|
|
434
463
|
handleCellMouseDown: (rowIndex: number, colIndex: number, options?: CellMouseDownOptions) => void;
|
|
@@ -443,6 +472,16 @@ type CopyRowEntry<T extends Record<string, unknown>> = {
|
|
|
443
472
|
/** Tree depth relative to the table root (0 = top-level). */
|
|
444
473
|
depth: number;
|
|
445
474
|
};
|
|
475
|
+
/**
|
|
476
|
+
* `registry` resolves `meta.kind` renderers (built-ins like `protected`, plus
|
|
477
|
+
* custom `cellRenderers`) so copy text matches the visible cell instead of the
|
|
478
|
+
* raw value. `root` scopes the DOM image-url lookup to one table when several
|
|
479
|
+
* are mounted at once.
|
|
480
|
+
*/
|
|
481
|
+
type CopyRenderOptions = {
|
|
482
|
+
registry?: CellRendererRegistry;
|
|
483
|
+
root?: ParentNode | null;
|
|
484
|
+
};
|
|
446
485
|
/**
|
|
447
486
|
* Clipboard / Excel paste expects one plain string per cell.
|
|
448
487
|
* Avoids `String(object)` → `[object Object]` and joins arrays with `, `.
|
|
@@ -455,9 +494,9 @@ declare function flattenSubtreeRows<T extends Record<string, unknown>>(row: T):
|
|
|
455
494
|
*/
|
|
456
495
|
declare function collectCopyRowEntries<T extends Record<string, unknown>>(visibleRows: Row<T>[], bounds: CellSelectionBounds, mode?: CopySelectionMode): CopyRowEntry<T>[];
|
|
457
496
|
declare function collectCopyRows<T extends Record<string, unknown>>(visibleRows: Row<T>[], bounds: CellSelectionBounds, mode?: CopySelectionMode): T[];
|
|
458
|
-
declare function serializeCopyRowsToTSV<T extends Record<string, unknown>>(copyRows: T[], visibleRows: Row<T>[], bounds: CellSelectionBounds, depths?: number[]): string;
|
|
459
|
-
declare function serializeSelectionToTSV<T extends Record<string, unknown>>(visibleRows: Row<T>[], bounds: CellSelectionBounds, mode?: CopySelectionMode): string;
|
|
460
|
-
declare function writeSelectionToClipboard<T extends Record<string, unknown>>(visibleRows: Row<T>[], bounds: CellSelectionBounds, mode?: CopySelectionMode): Promise<boolean>;
|
|
497
|
+
declare function serializeCopyRowsToTSV<T extends Record<string, unknown>>(copyRows: T[], visibleRows: Row<T>[], bounds: CellSelectionBounds, depths?: number[], options?: CopyRenderOptions): string;
|
|
498
|
+
declare function serializeSelectionToTSV<T extends Record<string, unknown>>(visibleRows: Row<T>[], bounds: CellSelectionBounds, mode?: CopySelectionMode, options?: CopyRenderOptions): string;
|
|
499
|
+
declare function writeSelectionToClipboard<T extends Record<string, unknown>>(visibleRows: Row<T>[], bounds: CellSelectionBounds, mode?: CopySelectionMode, options?: CopyRenderOptions): Promise<boolean>;
|
|
461
500
|
|
|
462
501
|
type CellChange = {
|
|
463
502
|
rowId: string;
|
|
@@ -507,4 +546,4 @@ declare const useConvertTreeData: <T extends Record<string, unknown>>({ data, en
|
|
|
507
546
|
declare function resolveRowSelection(mode: RowSelectionMode, controlledSelection: RowSelectionState | undefined, internalSelection: RowSelectionState): RowSelectionState;
|
|
508
547
|
declare function applySelectionUpdater(mode: RowSelectionMode, updater: Updater<RowSelectionState>, previous: RowSelectionState): RowSelectionState;
|
|
509
548
|
|
|
510
|
-
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 };
|
|
549
|
+
export { BUILTIN_CELL_RENDERERS, CELL_SELECTION_EDGES_CLASS, type CellContextWithUpdate, CellKind, CellRenderContext, CellRenderer, type CellRendererRegistry, type CellSelectionBounds, type ColumnDropEdge, ColumnFreezeOffset, type ColumnLayoutInput, 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, resolveColumnLayoutWidths, resolveDropEdge, resolveLeafColumnOrder, resolvePasteColumnIds, resolveRowSelection, resolveRowSpanAt, rowRangeToHeightRatios, serializeCopyRowsToTSV, serializeSelectionToTSV, toggleExpandedRowId, useCellEdit, useCellSelection, useColumnReorder, useConvertTreeData, useGlideTable, useInlineSearch, withCellUpdate, writeSelectionToClipboard };
|