@gp-grid/core 0.10.3 → 0.11.1
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/dist/index.d.ts +347 -180
- package/dist/index.js +136 -261
- package/dist/styles.css +950 -0
- package/package.json +9 -3
package/dist/index.d.ts
CHANGED
|
@@ -890,138 +890,144 @@ declare class FillManager {
|
|
|
890
890
|
private applyPattern;
|
|
891
891
|
}
|
|
892
892
|
//#endregion
|
|
893
|
+
//#region src/input/column-resize-drag.d.ts
|
|
894
|
+
declare class ColumnResizeDrag<TData = unknown> {
|
|
895
|
+
private active;
|
|
896
|
+
private colIndex;
|
|
897
|
+
private startX;
|
|
898
|
+
private initialWidth;
|
|
899
|
+
private currentWidth;
|
|
900
|
+
private readonly core;
|
|
901
|
+
constructor(core: GridCore<TData>);
|
|
902
|
+
get isActive(): boolean;
|
|
903
|
+
start(colIndex: number, colWidth: number, event: PointerEventData): InputResult;
|
|
904
|
+
move(event: PointerEventData, bounds: ContainerBounds): DragMoveResult;
|
|
905
|
+
end(): void;
|
|
906
|
+
getState(): ColumnResizeDragState | null;
|
|
907
|
+
}
|
|
908
|
+
//#endregion
|
|
909
|
+
//#region src/input/column-move-drag.d.ts
|
|
910
|
+
declare class ColumnMoveDrag<TData = unknown> {
|
|
911
|
+
private active;
|
|
912
|
+
private sourceColIndex;
|
|
913
|
+
private startX;
|
|
914
|
+
private startY;
|
|
915
|
+
private thresholdMet;
|
|
916
|
+
private shiftKey;
|
|
917
|
+
private ghostWidth;
|
|
918
|
+
private ghostHeight;
|
|
919
|
+
private currentX;
|
|
920
|
+
private currentY;
|
|
921
|
+
private dropTargetIndex;
|
|
922
|
+
private readonly core;
|
|
923
|
+
private deps;
|
|
924
|
+
constructor(core: GridCore<TData>, deps: InputHandlerDeps);
|
|
925
|
+
updateDeps(deps: InputHandlerDeps): void;
|
|
926
|
+
get isActive(): boolean;
|
|
927
|
+
get isDraggingForDisplay(): boolean;
|
|
928
|
+
start(colIndex: number, colWidth: number, colHeight: number, event: PointerEventData): InputResult;
|
|
929
|
+
move(event: PointerEventData, bounds: ContainerBounds): DragMoveResult | null;
|
|
930
|
+
end(cycleSortDirection: (current: SortDirection | null | undefined) => SortDirection | null): void;
|
|
931
|
+
private commitMove;
|
|
932
|
+
private treatAsHeaderClick;
|
|
933
|
+
private reset;
|
|
934
|
+
getState(): ColumnMoveDragState | null;
|
|
935
|
+
}
|
|
936
|
+
//#endregion
|
|
937
|
+
//#region src/input/row-drag.d.ts
|
|
938
|
+
declare class RowDrag<TData = unknown> {
|
|
939
|
+
private active;
|
|
940
|
+
private sourceRowIndex;
|
|
941
|
+
private startX;
|
|
942
|
+
private startY;
|
|
943
|
+
private thresholdMet;
|
|
944
|
+
private currentX;
|
|
945
|
+
private currentY;
|
|
946
|
+
private dropTargetIndex;
|
|
947
|
+
private readonly core;
|
|
948
|
+
private deps;
|
|
949
|
+
constructor(core: GridCore<TData>, deps: InputHandlerDeps);
|
|
950
|
+
updateDeps(deps: InputHandlerDeps): void;
|
|
951
|
+
get isActive(): boolean;
|
|
952
|
+
get isDraggingForDisplay(): boolean;
|
|
953
|
+
start(sourceRowIndex: number, clientX: number, clientY: number): void;
|
|
954
|
+
move(event: PointerEventData, bounds: ContainerBounds): DragMoveResult | null;
|
|
955
|
+
end(): void;
|
|
956
|
+
getState(): RowDragState | null;
|
|
957
|
+
}
|
|
958
|
+
//#endregion
|
|
959
|
+
//#region src/input/selection-drag.d.ts
|
|
960
|
+
declare class SelectionDrag<TData = unknown> {
|
|
961
|
+
private active;
|
|
962
|
+
private readonly core;
|
|
963
|
+
constructor(core: GridCore<TData>);
|
|
964
|
+
get isActive(): boolean;
|
|
965
|
+
start(): void;
|
|
966
|
+
moveToTarget(row: number, col: number): void;
|
|
967
|
+
end(): void;
|
|
968
|
+
}
|
|
969
|
+
//#endregion
|
|
970
|
+
//#region src/input/fill-drag.d.ts
|
|
971
|
+
declare class FillDrag<TData = unknown> {
|
|
972
|
+
private active;
|
|
973
|
+
private sourceRange;
|
|
974
|
+
private target;
|
|
975
|
+
private readonly core;
|
|
976
|
+
constructor(core: GridCore<TData>);
|
|
977
|
+
get isActive(): boolean;
|
|
978
|
+
get stateSnapshot(): {
|
|
979
|
+
sourceRange: CellRange | null;
|
|
980
|
+
target: {
|
|
981
|
+
row: number;
|
|
982
|
+
col: number;
|
|
983
|
+
} | null;
|
|
984
|
+
};
|
|
985
|
+
start(activeCell: CellPosition | null, selectionRange: CellRange | null): InputResult;
|
|
986
|
+
moveToTarget(row: number, col: number): void;
|
|
987
|
+
end(): void;
|
|
988
|
+
}
|
|
989
|
+
//#endregion
|
|
893
990
|
//#region src/input-handler.d.ts
|
|
894
991
|
declare class InputHandler<TData = unknown> {
|
|
895
992
|
private readonly core;
|
|
896
993
|
private deps;
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
private
|
|
903
|
-
private
|
|
904
|
-
private resizeInitialWidth;
|
|
905
|
-
private resizeCurrentWidth;
|
|
906
|
-
private isDraggingColumnMove;
|
|
907
|
-
private moveSourceColIndex;
|
|
908
|
-
private moveStartX;
|
|
909
|
-
private moveStartY;
|
|
910
|
-
private moveThresholdMet;
|
|
911
|
-
private moveShiftKey;
|
|
912
|
-
private moveGhostWidth;
|
|
913
|
-
private moveGhostHeight;
|
|
914
|
-
private moveCurrentX;
|
|
915
|
-
private moveCurrentY;
|
|
916
|
-
private moveDropTargetIndex;
|
|
917
|
-
private isDraggingRow;
|
|
918
|
-
private rowDragSourceIndex;
|
|
919
|
-
private rowDragStartX;
|
|
920
|
-
private rowDragStartY;
|
|
921
|
-
private rowDragThresholdMet;
|
|
922
|
-
private rowDragCurrentX;
|
|
923
|
-
private rowDragCurrentY;
|
|
924
|
-
private rowDragDropTargetIndex;
|
|
925
|
-
private pendingRowDrag;
|
|
994
|
+
readonly columnResize: ColumnResizeDrag<TData>;
|
|
995
|
+
readonly columnMove: ColumnMoveDrag<TData>;
|
|
996
|
+
readonly rowDrag: RowDrag<TData>;
|
|
997
|
+
readonly selectionDrag: SelectionDrag<TData>;
|
|
998
|
+
readonly fillDrag: FillDrag<TData>;
|
|
999
|
+
private readonly pendingRowDrag;
|
|
1000
|
+
private readonly keyboard;
|
|
926
1001
|
constructor(core: GridCore<TData>, deps: InputHandlerDeps);
|
|
927
|
-
/**
|
|
928
|
-
* Update dependencies (called when options change)
|
|
929
|
-
*/
|
|
1002
|
+
/** Update dependencies (called when options change) */
|
|
930
1003
|
updateDeps(deps: Partial<InputHandlerDeps>): void;
|
|
931
|
-
/**
|
|
932
|
-
* Get current drag state for UI rendering
|
|
933
|
-
*/
|
|
934
1004
|
getDragState(): DragState;
|
|
935
1005
|
private getDragType;
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
*/
|
|
1006
|
+
handleHeaderMouseDown(colIndex: number, colWidth: number, colHeight: number, event: PointerEventData): InputResult;
|
|
1007
|
+
handleHeaderResizeMouseDown(colIndex: number, colWidth: number, event: PointerEventData): InputResult;
|
|
939
1008
|
handleCellMouseDown(rowIndex: number, colIndex: number, event: PointerEventData): InputResult;
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
1009
|
+
private startPendingRowDrag;
|
|
1010
|
+
private startRowDrag;
|
|
1011
|
+
private startSelectionClick;
|
|
943
1012
|
handleCellDoubleClick(rowIndex: number, colIndex: number): void;
|
|
944
|
-
/**
|
|
945
|
-
* Handle cell mouse enter event (for hover highlighting)
|
|
946
|
-
*/
|
|
947
1013
|
handleCellMouseEnter(rowIndex: number, colIndex: number): void;
|
|
948
|
-
/**
|
|
949
|
-
* Handle cell mouse leave event (for hover highlighting)
|
|
950
|
-
*/
|
|
951
1014
|
handleCellMouseLeave(): void;
|
|
952
|
-
/**
|
|
953
|
-
* Handle fill handle mouse down event
|
|
954
|
-
*/
|
|
955
1015
|
handleFillHandleMouseDown(activeCell: CellPosition | null, selectionRange: CellRange | null, _event: PointerEventData): InputResult;
|
|
956
|
-
/**
|
|
957
|
-
* Handle header click event (cycle sort direction)
|
|
958
|
-
*/
|
|
959
1016
|
handleHeaderClick(colId: string, addToExisting: boolean): void;
|
|
960
|
-
/**
|
|
961
|
-
* Handle mousedown on the resize handle of a header cell.
|
|
962
|
-
* Returns InputResult with startDrag: "column-resize".
|
|
963
|
-
*/
|
|
964
|
-
handleHeaderResizeMouseDown(colIndex: number, colWidth: number, event: PointerEventData): InputResult;
|
|
965
|
-
/**
|
|
966
|
-
* Handle mousedown on a header cell for potential column move.
|
|
967
|
-
* Uses a drag threshold to distinguish click (sort) vs drag (move).
|
|
968
|
-
*/
|
|
969
|
-
handleHeaderMouseDown(colIndex: number, colWidth: number, colHeight: number, event: PointerEventData): InputResult;
|
|
970
|
-
/**
|
|
971
|
-
* Start selection drag (called by framework after handleCellMouseDown returns startDrag: 'selection')
|
|
972
|
-
*/
|
|
973
1017
|
startSelectionDrag(): void;
|
|
974
|
-
/**
|
|
975
|
-
* Confirm a pending row drag (called by framework after long-press timer fires).
|
|
976
|
-
* Returns true if the row drag was activated, false if the pending drag was already cancelled.
|
|
977
|
-
*/
|
|
978
1018
|
confirmPendingRowDrag(): boolean;
|
|
979
|
-
/**
|
|
980
|
-
* Cancel a pending row drag (called when the pointer moves before the hold timer fires).
|
|
981
|
-
*/
|
|
982
1019
|
cancelPendingRowDrag(): void;
|
|
983
|
-
/**
|
|
984
|
-
* Handle drag move event (selection, fill, column-resize, column-move, or row-drag)
|
|
985
|
-
*/
|
|
986
1020
|
handleDragMove(event: PointerEventData, bounds: ContainerBounds): DragMoveResult | null;
|
|
987
|
-
private
|
|
988
|
-
private handleColumnMoveDragMove;
|
|
989
|
-
private handleRowDragDragMove;
|
|
990
|
-
private handleSelectionFillDragMove;
|
|
991
|
-
/**
|
|
992
|
-
* Handle drag end event
|
|
993
|
-
*/
|
|
1021
|
+
private selectionFillMove;
|
|
994
1022
|
handleDragEnd(): void;
|
|
995
|
-
private endColumnResizeDrag;
|
|
996
|
-
private endColumnMoveDrag;
|
|
997
|
-
private endRowDrag;
|
|
998
|
-
private endSelectionFillDrag;
|
|
999
|
-
/**
|
|
1000
|
-
* Handle wheel event with dampening for large datasets
|
|
1001
|
-
* Returns scroll deltas or null if no dampening needed
|
|
1002
|
-
*/
|
|
1003
1023
|
handleWheel(deltaY: number, deltaX: number, dampening: number): {
|
|
1004
1024
|
dy: number;
|
|
1005
1025
|
dx: number;
|
|
1006
1026
|
} | null;
|
|
1007
|
-
/**
|
|
1008
|
-
* Handle keyboard event
|
|
1009
|
-
*/
|
|
1010
1027
|
handleKeyDown(event: KeyEventData, activeCell: CellPosition | null, editingCell: {
|
|
1011
1028
|
row: number;
|
|
1012
1029
|
col: number;
|
|
1013
1030
|
} | null, filterPopupOpen: boolean): KeyboardResult;
|
|
1014
|
-
private handleKeyAction;
|
|
1015
|
-
private handleNonEditingKey;
|
|
1016
|
-
private keyToDirection;
|
|
1017
|
-
/**
|
|
1018
|
-
* Cycle sort direction: undefined/null → asc → desc → null
|
|
1019
|
-
*/
|
|
1020
|
-
private cycleSortDirection;
|
|
1021
|
-
/**
|
|
1022
|
-
* Calculate auto-scroll deltas based on mouse position
|
|
1023
|
-
*/
|
|
1024
|
-
private calculateAutoScroll;
|
|
1025
1031
|
}
|
|
1026
1032
|
//#endregion
|
|
1027
1033
|
//#region src/managers/highlight-manager.d.ts
|
|
@@ -1283,8 +1289,14 @@ declare class SortFilterManager<TData = Record<string, unknown>> {
|
|
|
1283
1289
|
* For array-type columns (like tags), each unique array combination is returned.
|
|
1284
1290
|
* Arrays are sorted internally for consistent comparison.
|
|
1285
1291
|
* Limited to maxValues distinct results and maxScanRows rows scanned.
|
|
1286
|
-
*
|
|
1287
|
-
*
|
|
1292
|
+
*
|
|
1293
|
+
* When the total exceeds maxScanRows we stride-sample across the full
|
|
1294
|
+
* dataset instead of scanning the first N rows. Sequential scan was
|
|
1295
|
+
* broken under an active sort: Map iteration follows insertion order,
|
|
1296
|
+
* which after sort is the sorted order — so the first 100k rows only
|
|
1297
|
+
* covered the "smallest" values of the column. Stride sampling covers
|
|
1298
|
+
* the whole range at the cost of possibly missing rare values, which
|
|
1299
|
+
* the maxValues cap would have dropped anyway.
|
|
1288
1300
|
*/
|
|
1289
1301
|
getDistinctValuesForColumn(colId: string, maxValues?: number, maxScanRows?: number): CellValue[];
|
|
1290
1302
|
/**
|
|
@@ -1402,9 +1414,10 @@ declare class IndexedDataStore<TData = unknown> {
|
|
|
1402
1414
|
*/
|
|
1403
1415
|
private addRow;
|
|
1404
1416
|
/**
|
|
1405
|
-
* Remove rows by ID.
|
|
1417
|
+
* Remove rows by ID. Returns the number of rows actually removed (unknown
|
|
1418
|
+
* ids are ignored).
|
|
1406
1419
|
*/
|
|
1407
|
-
removeRows(ids: RowId[]):
|
|
1420
|
+
removeRows(ids: RowId[]): number;
|
|
1408
1421
|
/**
|
|
1409
1422
|
* Remove a single row by index.
|
|
1410
1423
|
*/
|
|
@@ -1474,18 +1487,29 @@ declare class IndexedDataStore<TData = unknown> {
|
|
|
1474
1487
|
*/
|
|
1475
1488
|
private rebuildDistinctValues;
|
|
1476
1489
|
/**
|
|
1477
|
-
* Update distinct
|
|
1490
|
+
* Update distinct-value refcounts when a row is added or removed.
|
|
1491
|
+
* Skips null/undefined cell values — they never enter the filter popup.
|
|
1478
1492
|
*/
|
|
1479
1493
|
private updateDistinctValuesForRow;
|
|
1480
1494
|
/**
|
|
1481
|
-
* Update distinct
|
|
1495
|
+
* Update distinct-value refcounts when a cell value changes: decrement
|
|
1496
|
+
* the old value's count (evicting it if this was the last reference)
|
|
1497
|
+
* and increment the new value's count.
|
|
1482
1498
|
*/
|
|
1483
1499
|
private updateDistinctValueForField;
|
|
1484
1500
|
/**
|
|
1485
|
-
* Add a value (scalar or array) to the distinct
|
|
1486
|
-
* Creates the
|
|
1501
|
+
* Add a value (scalar or array) to the distinct-value refcount map.
|
|
1502
|
+
* Creates the field's count map lazily. For arrays, each non-null item
|
|
1503
|
+
* is counted individually so tag-column filters see element-level
|
|
1504
|
+
* distinct values.
|
|
1487
1505
|
*/
|
|
1488
1506
|
private addToDistinctValues;
|
|
1507
|
+
/**
|
|
1508
|
+
* Decrement refcount(s) for a value (scalar or array). When a count
|
|
1509
|
+
* reaches zero the key is deleted so getDistinctValues() no longer
|
|
1510
|
+
* returns stale values after the last holder is removed.
|
|
1511
|
+
*/
|
|
1512
|
+
private decrementDistinctValues;
|
|
1489
1513
|
}
|
|
1490
1514
|
//#endregion
|
|
1491
1515
|
//#region src/indexed-data-store/field-helpers.d.ts
|
|
@@ -1653,10 +1677,7 @@ declare class GridCore<TData = unknown> {
|
|
|
1653
1677
|
private readonly onRowDragEnd?;
|
|
1654
1678
|
private readonly onColumnResized?;
|
|
1655
1679
|
private readonly onColumnMoved?;
|
|
1656
|
-
private
|
|
1657
|
-
private scrollLeft;
|
|
1658
|
-
private viewportWidth;
|
|
1659
|
-
private viewportHeight;
|
|
1680
|
+
private readonly viewport;
|
|
1660
1681
|
private readonly currentPageIndex;
|
|
1661
1682
|
private readonly pageSize;
|
|
1662
1683
|
private cachedRows;
|
|
@@ -1670,8 +1691,7 @@ declare class GridCore<TData = unknown> {
|
|
|
1670
1691
|
private readonly slotPool;
|
|
1671
1692
|
private readonly editManager;
|
|
1672
1693
|
private columnPositions;
|
|
1673
|
-
private
|
|
1674
|
-
private instructionBuffer;
|
|
1694
|
+
private readonly batcher;
|
|
1675
1695
|
private readonly scrollVirtualization;
|
|
1676
1696
|
private isDestroyed;
|
|
1677
1697
|
private _isDataLoading;
|
|
@@ -1681,18 +1701,6 @@ declare class GridCore<TData = unknown> {
|
|
|
1681
1701
|
* Batch listeners receive arrays of instructions instead of individual ones.
|
|
1682
1702
|
*/
|
|
1683
1703
|
onBatchInstruction(listener: BatchInstructionListener): () => void;
|
|
1684
|
-
/**
|
|
1685
|
-
* Start buffering instructions. All emit/emitBatch calls will accumulate
|
|
1686
|
-
* into an internal buffer until flushBatch() is called.
|
|
1687
|
-
*/
|
|
1688
|
-
private startBatch;
|
|
1689
|
-
/**
|
|
1690
|
-
* Flush buffered instructions to listeners as a single batch, then
|
|
1691
|
-
* stop buffering.
|
|
1692
|
-
*/
|
|
1693
|
-
private flushBatch;
|
|
1694
|
-
private emit;
|
|
1695
|
-
private emitBatch;
|
|
1696
1704
|
/**
|
|
1697
1705
|
* Initialize the grid and load initial data.
|
|
1698
1706
|
*/
|
|
@@ -1727,6 +1735,7 @@ declare class GridCore<TData = unknown> {
|
|
|
1727
1735
|
private computeColumnPositions;
|
|
1728
1736
|
private emitContentSize;
|
|
1729
1737
|
private emitHeaders;
|
|
1738
|
+
private emitVisibleRange;
|
|
1730
1739
|
/**
|
|
1731
1740
|
* Set the width of a column and recompute layout.
|
|
1732
1741
|
*/
|
|
@@ -1744,12 +1753,6 @@ declare class GridCore<TData = unknown> {
|
|
|
1744
1753
|
* performed, then only update the affected slots.
|
|
1745
1754
|
*/
|
|
1746
1755
|
commitRowDrag(sourceIndex: number, targetIndex: number): void;
|
|
1747
|
-
/**
|
|
1748
|
-
* Update cachedRows in-place to mirror the splice the data source performed.
|
|
1749
|
-
* The data source does: splice(from, 1) then splice(adjustedTo, 0, row).
|
|
1750
|
-
* Uses a unified loop with step direction instead of two separate branch loops.
|
|
1751
|
-
*/
|
|
1752
|
-
private reorderCachedRows;
|
|
1753
1756
|
/**
|
|
1754
1757
|
* Whether the entire row is draggable.
|
|
1755
1758
|
*/
|
|
@@ -1994,7 +1997,7 @@ declare const findSlotForRow: (slots: Map<string, SlotData>, rowIndex: number) =
|
|
|
1994
1997
|
*/
|
|
1995
1998
|
declare const scrollCellIntoView: (core: {
|
|
1996
1999
|
getScrollTopForRow(row: number): number;
|
|
1997
|
-
}, container:
|
|
2000
|
+
}, container: HTMLElement, row: number, rowHeight: number, slots: Map<string, SlotData>, rowsWrapperOffset?: number) => void;
|
|
1998
2001
|
//#endregion
|
|
1999
2002
|
//#region src/utils/format-helpers.d.ts
|
|
2000
2003
|
/**
|
|
@@ -2235,51 +2238,20 @@ declare class ParallelSortManager {
|
|
|
2235
2238
|
private readonly minChunkSize;
|
|
2236
2239
|
private isTerminated;
|
|
2237
2240
|
constructor(options?: ParallelSortOptions);
|
|
2238
|
-
/**
|
|
2239
|
-
* Check if the manager is available for use.
|
|
2240
|
-
*/
|
|
2241
2241
|
isAvailable(): boolean;
|
|
2242
|
-
/**
|
|
2243
|
-
* Terminate all workers and clean up resources.
|
|
2244
|
-
*/
|
|
2245
2242
|
terminate(): void;
|
|
2246
|
-
/**
|
|
2247
|
-
* Sort indices using values array.
|
|
2248
|
-
* Automatically uses parallel sorting for large datasets.
|
|
2249
|
-
*/
|
|
2250
2243
|
sortIndices(values: number[], direction: "asc" | "desc"): Promise<Uint32Array>;
|
|
2251
|
-
/**
|
|
2252
|
-
* Sort string hashes with collision detection.
|
|
2253
|
-
* Automatically uses parallel sorting for large datasets.
|
|
2254
|
-
*/
|
|
2255
2244
|
sortStringHashes(hashChunks: Float64Array[], direction: "asc" | "desc", originalStrings: string[]): Promise<Uint32Array>;
|
|
2256
|
-
/**
|
|
2257
|
-
* Multi-column sort.
|
|
2258
|
-
* Automatically uses parallel sorting for large datasets.
|
|
2259
|
-
*/
|
|
2260
2245
|
sortMultiColumn(columns: number[][], directions: ("asc" | "desc")[]): Promise<Uint32Array>;
|
|
2246
|
+
private assertNotTerminated;
|
|
2261
2247
|
private sortIndicesSingle;
|
|
2262
2248
|
private sortStringHashesSingle;
|
|
2263
2249
|
private sortMultiColumnSingle;
|
|
2250
|
+
private boundariesFor;
|
|
2251
|
+
private runChunks;
|
|
2264
2252
|
private sortIndicesParallel;
|
|
2265
2253
|
private sortStringHashesParallel;
|
|
2266
2254
|
private sortMultiColumnParallel;
|
|
2267
|
-
/**
|
|
2268
|
-
* Split data into chunks for parallel processing.
|
|
2269
|
-
*/
|
|
2270
|
-
private splitIntoChunks;
|
|
2271
|
-
/**
|
|
2272
|
-
* Calculate chunk boundaries without copying data.
|
|
2273
|
-
*/
|
|
2274
|
-
private calculateChunkBoundaries;
|
|
2275
|
-
/**
|
|
2276
|
-
* Detect collisions at chunk boundaries for string sorting.
|
|
2277
|
-
*/
|
|
2278
|
-
private detectBoundaryCollisionsForStrings;
|
|
2279
|
-
/**
|
|
2280
|
-
* Resolve hash collisions using localeCompare.
|
|
2281
|
-
*/
|
|
2282
|
-
private resolveCollisions;
|
|
2283
2255
|
}
|
|
2284
2256
|
//#endregion
|
|
2285
2257
|
//#region src/sorting/worker-pool.d.ts
|
|
@@ -2517,15 +2489,10 @@ declare const rowDragStyles: string;
|
|
|
2517
2489
|
//#endregion
|
|
2518
2490
|
//#region src/styles/index.d.ts
|
|
2519
2491
|
/**
|
|
2520
|
-
* Combined grid styles from all modules
|
|
2492
|
+
* Combined grid styles from all modules.
|
|
2493
|
+
* Use `@gp-grid/core/dist/styles.css` in your app instead of consuming this directly.
|
|
2521
2494
|
*/
|
|
2522
2495
|
declare const gridStyles: string;
|
|
2523
|
-
/**
|
|
2524
|
-
* Inject grid styles into the document head.
|
|
2525
|
-
* This is called automatically when the Grid component mounts.
|
|
2526
|
-
* Styles are only injected once, even if multiple Grid instances exist.
|
|
2527
|
-
*/
|
|
2528
|
-
declare function injectStyles(): void;
|
|
2529
2496
|
//#endregion
|
|
2530
2497
|
//#region src/state-reducer.d.ts
|
|
2531
2498
|
/**
|
|
@@ -2536,4 +2503,204 @@ declare function injectStyles(): void;
|
|
|
2536
2503
|
*/
|
|
2537
2504
|
declare const applyInstruction: <TData = unknown>(instruction: GridInstruction, slots: Map<string, SlotData<TData>>, headers: Map<number, HeaderData>) => Partial<GridState<TData>> | null;
|
|
2538
2505
|
//#endregion
|
|
2539
|
-
|
|
2506
|
+
//#region src/adapter/pointer-event.d.ts
|
|
2507
|
+
/**
|
|
2508
|
+
* Convert a DOM PointerEvent into the framework-agnostic PointerEventData
|
|
2509
|
+
* shape consumed by core.input.*.
|
|
2510
|
+
*
|
|
2511
|
+
* Used by framework wrappers so each pointer-down handler doesn't have to
|
|
2512
|
+
* spell out the 8-field literal.
|
|
2513
|
+
*/
|
|
2514
|
+
declare const toPointerEventData: (event: PointerEvent) => PointerEventData;
|
|
2515
|
+
//#endregion
|
|
2516
|
+
//#region src/adapter/auto-scroll.d.ts
|
|
2517
|
+
/**
|
|
2518
|
+
* Continuous scroll driver used while a drag (selection, fill, row-drag)
|
|
2519
|
+
* leaves the viewport. The caller provides the scroll element getter and
|
|
2520
|
+
* a tick callback that re-processes the most recent pointer event after
|
|
2521
|
+
* each programmatic scroll, so the visible region catches up under the
|
|
2522
|
+
* pointer.
|
|
2523
|
+
*
|
|
2524
|
+
* Framework-agnostic: accepts plain getter/callback functions and relies
|
|
2525
|
+
* only on setInterval + element.scrollTop/scrollLeft.
|
|
2526
|
+
*/
|
|
2527
|
+
declare class AutoScrollDriver {
|
|
2528
|
+
private intervalId;
|
|
2529
|
+
private lastPointerEvent;
|
|
2530
|
+
private readonly getBodyEl;
|
|
2531
|
+
private readonly onTick;
|
|
2532
|
+
constructor(getBodyEl: () => HTMLElement | null, onTick: (event: PointerEvent) => void);
|
|
2533
|
+
recordPointer(event: PointerEvent): void;
|
|
2534
|
+
clearPointer(): void;
|
|
2535
|
+
start(dx: number, dy: number): void;
|
|
2536
|
+
stop(): void;
|
|
2537
|
+
}
|
|
2538
|
+
//#endregion
|
|
2539
|
+
//#region src/adapter/pending-row-drag.d.ts
|
|
2540
|
+
interface PendingRowDragDeps<TData = unknown> {
|
|
2541
|
+
getCore: () => GridCore<TData> | null;
|
|
2542
|
+
getContainer: () => HTMLElement | null;
|
|
2543
|
+
isBrowser: boolean;
|
|
2544
|
+
onDragConfirmed: (state: DragState) => void;
|
|
2545
|
+
}
|
|
2546
|
+
/**
|
|
2547
|
+
* Row-drag pending state machine. When a row-drag handle is pressed, we
|
|
2548
|
+
* must distinguish a tap/click (no drag) from an intentional hold (drag).
|
|
2549
|
+
*
|
|
2550
|
+
* Algorithm:
|
|
2551
|
+
* - start() arms a 300ms timer and listens for pointermove/up on document.
|
|
2552
|
+
* - If the pointer moves >10px before the timer fires → cancel (treat as tap).
|
|
2553
|
+
* - If the pointer releases before the timer fires → cancel.
|
|
2554
|
+
* - If the timer fires first → confirm: lock container overflow, block
|
|
2555
|
+
* touchmove, capture the pointer, and tell the caller the drag is live.
|
|
2556
|
+
*
|
|
2557
|
+
* Framework-agnostic: accepts plain getter/callback deps and touches only
|
|
2558
|
+
* the document/element DOM APIs. Wrappers gate construction on browser.
|
|
2559
|
+
*/
|
|
2560
|
+
declare class PendingRowDragController<TData = unknown> {
|
|
2561
|
+
private timer;
|
|
2562
|
+
private capture;
|
|
2563
|
+
private savedContainerOverflow;
|
|
2564
|
+
private readonly blockTouchMove;
|
|
2565
|
+
private readonly deps;
|
|
2566
|
+
constructor(deps: PendingRowDragDeps<TData>);
|
|
2567
|
+
start(event: PointerEvent): void;
|
|
2568
|
+
cancel(): void;
|
|
2569
|
+
releaseLocks(): void;
|
|
2570
|
+
private confirm;
|
|
2571
|
+
private lockContainer;
|
|
2572
|
+
private applyPointerCapture;
|
|
2573
|
+
}
|
|
2574
|
+
//#endregion
|
|
2575
|
+
//#region src/adapter/batch-applier.d.ts
|
|
2576
|
+
type EditingCell = {
|
|
2577
|
+
row: number;
|
|
2578
|
+
col: number;
|
|
2579
|
+
initialValue: CellValue;
|
|
2580
|
+
} | null;
|
|
2581
|
+
/**
|
|
2582
|
+
* A "setters bag" the wrapper provides. Each setter pokes a framework-
|
|
2583
|
+
* specific reactive primitive (signal.set, ref.value =, dispatch action).
|
|
2584
|
+
* The batch applier itself is pure and reactivity-agnostic.
|
|
2585
|
+
*/
|
|
2586
|
+
interface BatchChangeSetters {
|
|
2587
|
+
setContentWidth: (v: number) => void;
|
|
2588
|
+
setContentHeight: (v: number) => void;
|
|
2589
|
+
setRowsWrapperOffset: (v: number) => void;
|
|
2590
|
+
setIsLoading: (v: boolean) => void;
|
|
2591
|
+
setErrorMessage: (v: string | null) => void;
|
|
2592
|
+
setPendingScrollTop: (v: number | null) => void;
|
|
2593
|
+
setActiveCell: (v: CellPosition | null) => void;
|
|
2594
|
+
setSelectionRange: (v: CellRange | null) => void;
|
|
2595
|
+
setEditingCell: (v: EditingCell) => void;
|
|
2596
|
+
setHoverPosition: (v: CellPosition | null) => void;
|
|
2597
|
+
setColumnsOverride: (v: ColumnDefinition[]) => void;
|
|
2598
|
+
onFilterPopupChange: (v: FilterPopupState | null) => void;
|
|
2599
|
+
}
|
|
2600
|
+
type MutableMaps = {
|
|
2601
|
+
slots: Map<string, SlotData>;
|
|
2602
|
+
headers: Map<number, HeaderData>;
|
|
2603
|
+
};
|
|
2604
|
+
/**
|
|
2605
|
+
* Apply a batch of grid instructions to a snapshot of slots/headers while
|
|
2606
|
+
* dispatching scalar changes through the provided setters. Returns the
|
|
2607
|
+
* new slot/header maps so the wrapper can commit them to its reactive
|
|
2608
|
+
* containers in one step.
|
|
2609
|
+
*/
|
|
2610
|
+
declare const applyBatchInstructions: (instructions: readonly GridInstruction[], currentSlots: Map<string, SlotData>, currentHeaders: Map<number, HeaderData>, setters: BatchChangeSetters) => MutableMaps;
|
|
2611
|
+
//#endregion
|
|
2612
|
+
//#region src/adapter/data-source-owner.d.ts
|
|
2613
|
+
/**
|
|
2614
|
+
* Manages the "owned vs. provided" DataSource lifecycle shared by every
|
|
2615
|
+
* framework wrapper: wrap a raw `rows` array when the user didn't provide
|
|
2616
|
+
* their own DataSource, detect changes to `rows` / `columns` between
|
|
2617
|
+
* renders so we don't re-apply unchanged inputs, and destroy the owned
|
|
2618
|
+
* DataSource on teardown.
|
|
2619
|
+
*
|
|
2620
|
+
* The owner is framework-agnostic: it doesn't subscribe to anything.
|
|
2621
|
+
* Wrappers drive it from their own reactivity system (signal effects,
|
|
2622
|
+
* useEffect, watch) and react to its return values.
|
|
2623
|
+
*/
|
|
2624
|
+
declare class DataSourceOwner<TData = unknown> {
|
|
2625
|
+
private owned;
|
|
2626
|
+
private lastAppliedRows;
|
|
2627
|
+
private lastAppliedColumns;
|
|
2628
|
+
/**
|
|
2629
|
+
* Call once on setup. If the user provided a DataSource, use it.
|
|
2630
|
+
* Otherwise build one from the initial rows array and remember it
|
|
2631
|
+
* for later destruction.
|
|
2632
|
+
*/
|
|
2633
|
+
initialize(provided: DataSource<TData> | null, initialRows: TData[]): DataSource<TData>;
|
|
2634
|
+
/**
|
|
2635
|
+
* Call when the `rows` input changes. Returns a new owned DataSource
|
|
2636
|
+
* if one was rebuilt (caller should push it to core via setDataSource),
|
|
2637
|
+
* or null if nothing changed or a provided DataSource is in use.
|
|
2638
|
+
*/
|
|
2639
|
+
syncRows(rows: TData[], provided: DataSource<TData> | null): DataSource<TData> | null;
|
|
2640
|
+
/**
|
|
2641
|
+
* Call when the `columns` input changes. Returns true if the reference
|
|
2642
|
+
* is new and the caller should push to core via setColumns; false if
|
|
2643
|
+
* unchanged.
|
|
2644
|
+
*/
|
|
2645
|
+
syncColumns(columns: ColumnDefinition[]): boolean;
|
|
2646
|
+
/** Destroy the owned DataSource, if any. Safe to call multiple times. */
|
|
2647
|
+
destroy(): void;
|
|
2648
|
+
}
|
|
2649
|
+
//#endregion
|
|
2650
|
+
//#region src/adapter/input-event-adapter.d.ts
|
|
2651
|
+
interface InputEventAdapterDeps<TData = unknown> {
|
|
2652
|
+
getCore: () => GridCore<TData> | null;
|
|
2653
|
+
getBodyEl: () => HTMLElement | null;
|
|
2654
|
+
autoScroll: AutoScrollDriver;
|
|
2655
|
+
pendingRowDrag: PendingRowDragController<TData>;
|
|
2656
|
+
onDragStateChange: (state: DragState) => void;
|
|
2657
|
+
}
|
|
2658
|
+
interface CellPointerAction {
|
|
2659
|
+
preventDefault: boolean;
|
|
2660
|
+
focusContainer: boolean;
|
|
2661
|
+
}
|
|
2662
|
+
interface FillPointerAction {
|
|
2663
|
+
preventDefault: boolean;
|
|
2664
|
+
stopPropagation: boolean;
|
|
2665
|
+
}
|
|
2666
|
+
interface DragEndResult {
|
|
2667
|
+
wasRowDrag: boolean;
|
|
2668
|
+
}
|
|
2669
|
+
/**
|
|
2670
|
+
* Shared event-to-core adapter consumed by every framework wrapper.
|
|
2671
|
+
*
|
|
2672
|
+
* Each method accepts a DOM event (PointerEvent/KeyboardEvent) plus any
|
|
2673
|
+
* caller-side state the core needs, converts the event to the framework-
|
|
2674
|
+
* agnostic PointerEventData/KeyEventData shape, forwards it to core's
|
|
2675
|
+
* input handler, and performs the side effects that would otherwise be
|
|
2676
|
+
* reimplemented in each wrapper (drag-start dispatch, pointer capture,
|
|
2677
|
+
* auto-scroll start/stop, row-drag teardown).
|
|
2678
|
+
*
|
|
2679
|
+
* Methods return primitive "hint" objects so the wrapper can apply the
|
|
2680
|
+
* DOM actions that are framework-specific (preventDefault, focus, scroll
|
|
2681
|
+
* to cell, release container locks).
|
|
2682
|
+
*/
|
|
2683
|
+
declare class InputEventAdapter<TData = unknown> {
|
|
2684
|
+
private readonly deps;
|
|
2685
|
+
constructor(deps: InputEventAdapterDeps<TData>);
|
|
2686
|
+
headerPointerDown(colIndex: number, colWidth: number, colHeight: number, event: PointerEvent): boolean;
|
|
2687
|
+
resizePointerDown(colIndex: number, colWidth: number, event: PointerEvent): boolean;
|
|
2688
|
+
cellPointerDown(rowIndex: number, colIndex: number, event: PointerEvent): CellPointerAction;
|
|
2689
|
+
cellPointerEnter(rowIndex: number, colIndex: number): void;
|
|
2690
|
+
cellPointerLeave(): void;
|
|
2691
|
+
fillHandlePointerDown(activeCell: CellPosition | null, selectionRange: CellRange | null, event: PointerEvent): FillPointerAction;
|
|
2692
|
+
dragMove(event: PointerEvent): void;
|
|
2693
|
+
documentPointerMove(event: PointerEvent): boolean;
|
|
2694
|
+
documentPointerUp(): DragEndResult;
|
|
2695
|
+
wheel(deltaY: number, deltaX: number, dampening: number): {
|
|
2696
|
+
dy: number;
|
|
2697
|
+
dx: number;
|
|
2698
|
+
} | null;
|
|
2699
|
+
keyDown(event: KeyboardEvent, activeCell: CellPosition | null, editingCell: {
|
|
2700
|
+
row: number;
|
|
2701
|
+
col: number;
|
|
2702
|
+
} | null, filterPopupOpen: boolean): KeyboardResult;
|
|
2703
|
+
private dispatchCellDragStart;
|
|
2704
|
+
}
|
|
2705
|
+
//#endregion
|
|
2706
|
+
export { type AssignSlotInstruction, AutoScrollDriver, type BatchChangeSetters, type BatchInstructionListener, type CalculateFillHandlePositionParams, type CancelColumnMoveInstruction, type CancelColumnResizeInstruction, type CancelFillInstruction, type CancelRowDragInstruction, type CellDataType, type CellPointerAction, type CellPosition, type CellRange, type CellRendererParams, type CellValue, type CellValueChangedEvent, type CloseFilterPopupInstruction, type ColumnDefinition, type ColumnFilterModel, type ColumnMoveDragState, type ColumnResizeDragState, type ColumnsChangedInstruction, type CommitColumnMoveInstruction, type CommitColumnResizeInstruction, type CommitEditInstruction, type CommitFillInstruction, type CommitRowDragInstruction, type ContainerBounds, type CreateSlotInstruction, type DataChangeListener, type DataErrorInstruction, type DataLoadedInstruction, type DataLoadingInstruction, type DataSource, DataSourceOwner, type DataSourceRequest, type DataSourceResponse, type DateFilterCondition, type DateFilterOperator, type DestroySlotInstruction, type Direction, type DragEndResult, type DragMoveResult, type DragState, EditManager, type EditManagerOptions, type EditRendererParams, type EditState, type FillHandlePosition, type FillHandleState, FillManager, type FillPointerAction, type FilterCombination, type FilterCondition, type FilterModel, type FilterPopupState, GridCore, type GridCoreOptions, type GridInstruction, type GridState, type HeaderData, type HeaderRendererParams, type HighlightContext, HighlightManager, type HighlightingOptions, IndexedDataStore, type IndexedDataStoreOptions, type InitialStateArgs, InputEventAdapter, type InputEventAdapterDeps, InputHandler, type InputHandlerDeps, type InputResult, type InstructionListener, type KeyEventData, type KeyboardResult, type MoveSlotInstruction, type MultiColumnSortedChunk, type MutableClientDataSourceOptions, type MutableDataSource, type NumberFilterCondition, type NumberFilterOperator, type OpenFilterPopupInstruction, ParallelSortManager, type ParallelSortOptions, PendingRowDragController, type PendingRowDragDeps, type PointerEventData, type PopupPosition, type RowDragState, type RowId, RowMutationManager, type RowMutationManagerOptions, type RowSortCache, type RowsAddedInstruction, type RowsRemovedInstruction, type RowsUpdatedInstruction, ScrollVirtualizationManager, type ScrollVirtualizationManagerOptions, SelectionManager, type SelectionState, type SetActiveCellInstruction, type SetContentSizeInstruction, type SetHoverPositionInstruction, type SetSelectionRangeInstruction, type SlotData, type BatchInstructionListener$1 as SlotPoolBatchListener, SlotPoolManager, type SlotPoolManagerOptions, type SlotState, type SortDirection, SortFilterManager, type SortFilterManagerOptions, type SortModel, type SortedChunk, type StartColumnMoveInstruction, type StartColumnResizeInstruction, type StartEditInstruction, type StartFillInstruction, type StartRowDragInstruction, type StopEditInstruction, type TextFilterCondition, type TextFilterOperator, type Transaction, TransactionManager, type TransactionManagerOptions, type TransactionProcessedInstruction, type TransactionResult, type UpdateColumnMoveInstruction, type UpdateColumnResizeInstruction, type UpdateFillInstruction, type UpdateHeaderInstruction, type UpdateRowDragInstruction, type VisibleColumnInfo, WorkerPool, type WorkerPoolOptions, applyBatchInstructions, applyInstruction, buildCellClasses, calculateColumnPositions, calculateFillHandlePosition, calculateFilterPopupPosition, calculateScaledColumnPositions, cellStyles, compareValues, computeValueHash, containerStyles, createClientDataSource, createDataSourceFromArray, createInitialState, createMutableClientDataSource, createServerDataSource, detectBoundaryCollisions, evaluateColumnFilter, evaluateDateCondition, evaluateNumberCondition, evaluateTextCondition, filtersStyles, findColumnAtX, findSlotForRow, formatCellValue, getFieldValue, getTotalWidth, gridStyles, headerStyles, isCellActive, isCellEditing, isCellInFillPreview, isCellSelected, isColumnInSelectionRange, isRowInSelectionRange, isRowVisible, isSameDay, kWayMerge, kWayMergeMultiColumn, rowDragStyles, rowPassesFilter, scrollCellIntoView, scrollbarStyles, setFieldValue, statesStyles, stringToSortableNumber, toPointerEventData, variablesStyles };
|