@toolbox-web/grid 0.2.7 → 0.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 +13 -13
- package/all.d.ts +25 -5659
- package/all.d.ts.map +1 -0
- package/all.js +524 -450
- package/all.js.map +1 -1
- package/index.d.ts +8 -2678
- package/index.d.ts.map +1 -0
- package/index.js +3929 -25
- package/index.js.map +1 -1
- package/lib/core/constants.d.ts +114 -0
- package/lib/core/constants.d.ts.map +1 -0
- package/lib/core/grid.d.ts +337 -0
- package/lib/core/grid.d.ts.map +1 -0
- package/lib/core/internal/aggregators.d.ts +67 -0
- package/lib/core/internal/aggregators.d.ts.map +1 -0
- package/lib/core/internal/column-state.d.ts +124 -0
- package/lib/core/internal/column-state.d.ts.map +1 -0
- package/lib/core/internal/columns.d.ts +107 -0
- package/lib/core/internal/columns.d.ts.map +1 -0
- package/lib/core/internal/dom-builder.d.ts +115 -0
- package/lib/core/internal/dom-builder.d.ts.map +1 -0
- package/lib/core/internal/editing.d.ts +76 -0
- package/lib/core/internal/editing.d.ts.map +1 -0
- package/lib/core/internal/editors.d.ts +8 -0
- package/lib/core/internal/editors.d.ts.map +1 -0
- package/lib/core/internal/event-delegation.d.ts +11 -0
- package/lib/core/internal/event-delegation.d.ts.map +1 -0
- package/lib/core/internal/grid-internals.d.ts +83 -0
- package/lib/core/internal/grid-internals.d.ts.map +1 -0
- package/lib/core/internal/header.d.ts +7 -0
- package/lib/core/internal/header.d.ts.map +1 -0
- package/lib/core/internal/idle-scheduler.d.ts +65 -0
- package/lib/core/internal/idle-scheduler.d.ts.map +1 -0
- package/lib/core/internal/inference.d.ts +12 -0
- package/lib/core/internal/inference.d.ts.map +1 -0
- package/lib/core/internal/keyboard.d.ts +18 -0
- package/lib/core/internal/keyboard.d.ts.map +1 -0
- package/lib/core/internal/resize.d.ts +3 -0
- package/lib/core/internal/resize.d.ts.map +1 -0
- package/lib/core/internal/rows.d.ts +35 -0
- package/lib/core/internal/rows.d.ts.map +1 -0
- package/lib/core/internal/sanitize.d.ts +13 -0
- package/lib/core/internal/sanitize.d.ts.map +1 -0
- package/lib/core/internal/shell.d.ts +228 -0
- package/lib/core/internal/shell.d.ts.map +1 -0
- package/lib/core/internal/sorting.d.ts +24 -0
- package/lib/core/internal/sorting.d.ts.map +1 -0
- package/lib/core/internal/touch-scroll.d.ts +54 -0
- package/lib/core/internal/touch-scroll.d.ts.map +1 -0
- package/lib/core/internal/utils.d.ts +38 -0
- package/lib/core/internal/utils.d.ts.map +1 -0
- package/lib/core/internal/virtualization.d.ts +66 -0
- package/lib/core/internal/virtualization.d.ts.map +1 -0
- package/lib/core/plugin/base-plugin.d.ts +616 -0
- package/lib/core/plugin/base-plugin.d.ts.map +1 -0
- package/lib/core/plugin/index.d.ts +11 -0
- package/lib/core/plugin/index.d.ts.map +1 -0
- package/lib/core/plugin/plugin-manager.d.ts +183 -0
- package/lib/core/plugin/plugin-manager.d.ts.map +1 -0
- package/lib/core/plugin/types.d.ts +196 -0
- package/lib/core/plugin/types.d.ts.map +1 -0
- package/lib/core/types.d.ts +841 -0
- package/lib/core/types.d.ts.map +1 -0
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts +46 -0
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -0
- package/lib/plugins/clipboard/copy.d.ts +47 -0
- package/lib/plugins/clipboard/copy.d.ts.map +1 -0
- package/lib/plugins/clipboard/index.d.ts +7 -0
- package/lib/plugins/clipboard/index.d.ts.map +1 -0
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/clipboard/paste.d.ts +25 -0
- package/lib/plugins/clipboard/paste.d.ts.map +1 -0
- package/lib/plugins/clipboard/types.d.ts +40 -0
- package/lib/plugins/clipboard/types.d.ts.map +1 -0
- package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts +54 -0
- package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts.map +1 -0
- package/lib/plugins/column-virtualization/column-virtualization.d.ts +53 -0
- package/lib/plugins/column-virtualization/column-virtualization.d.ts.map +1 -0
- package/lib/plugins/column-virtualization/index.d.ts +7 -0
- package/lib/plugins/column-virtualization/index.d.ts.map +1 -0
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/column-virtualization/types.d.ts +41 -0
- package/lib/plugins/column-virtualization/types.d.ts.map +1 -0
- package/lib/plugins/context-menu/ContextMenuPlugin.d.ts +52 -0
- package/lib/plugins/context-menu/ContextMenuPlugin.d.ts.map +1 -0
- package/lib/plugins/context-menu/index.d.ts +7 -0
- package/lib/plugins/context-menu/index.d.ts.map +1 -0
- package/lib/plugins/context-menu/index.js +24 -24
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/context-menu/menu.d.ts +38 -0
- package/lib/plugins/context-menu/menu.d.ts.map +1 -0
- package/lib/plugins/context-menu/types.d.ts +77 -0
- package/lib/plugins/context-menu/types.d.ts.map +1 -0
- package/lib/plugins/export/ExportPlugin.d.ts +53 -0
- package/lib/plugins/export/ExportPlugin.d.ts.map +1 -0
- package/lib/plugins/export/csv.d.ts +31 -0
- package/lib/plugins/export/csv.d.ts.map +1 -0
- package/lib/plugins/export/excel.d.ts +12 -0
- package/lib/plugins/export/excel.d.ts.map +1 -0
- package/lib/plugins/export/index.d.ts +7 -0
- package/lib/plugins/export/index.d.ts.map +1 -0
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/export/types.d.ts +57 -0
- package/lib/plugins/export/types.d.ts.map +1 -0
- package/lib/plugins/filtering/FilteringPlugin.d.ts +128 -0
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -0
- package/lib/plugins/filtering/filter-model.d.ts +38 -0
- package/lib/plugins/filtering/filter-model.d.ts.map +1 -0
- package/lib/plugins/filtering/index.d.ts +7 -0
- package/lib/plugins/filtering/index.d.ts.map +1 -0
- package/lib/plugins/filtering/index.js +5 -5
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/filtering/types.d.ts +157 -0
- package/lib/plugins/filtering/types.d.ts.map +1 -0
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +51 -0
- package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -0
- package/lib/plugins/grouping-columns/grouping-columns.d.ts +41 -0
- package/lib/plugins/grouping-columns/grouping-columns.d.ts.map +1 -0
- package/lib/plugins/grouping-columns/index.d.ts +7 -0
- package/lib/plugins/grouping-columns/index.d.ts.map +1 -0
- package/lib/plugins/grouping-columns/index.js +58 -42
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-columns/types.d.ts +91 -0
- package/lib/plugins/grouping-columns/types.d.ts.map +1 -0
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +120 -0
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -0
- package/lib/plugins/grouping-rows/grouping-rows.d.ts +51 -0
- package/lib/plugins/grouping-rows/grouping-rows.d.ts.map +1 -0
- package/lib/plugins/grouping-rows/index.d.ts +7 -0
- package/lib/plugins/grouping-rows/index.d.ts.map +1 -0
- package/lib/plugins/grouping-rows/index.js +51 -51
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/grouping-rows/types.d.ts +95 -0
- package/lib/plugins/grouping-rows/types.d.ts.map +1 -0
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +147 -0
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -0
- package/lib/plugins/master-detail/index.d.ts +7 -0
- package/lib/plugins/master-detail/index.d.ts.map +1 -0
- package/lib/plugins/master-detail/index.js +235 -78
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/master-detail/master-detail.d.ts +30 -0
- package/lib/plugins/master-detail/master-detail.d.ts.map +1 -0
- package/lib/plugins/master-detail/types.d.ts +40 -0
- package/lib/plugins/master-detail/types.d.ts.map +1 -0
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts +58 -0
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -0
- package/lib/plugins/multi-sort/index.d.ts +7 -0
- package/lib/plugins/multi-sort/index.d.ts.map +1 -0
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/multi-sort/multi-sort.d.ts +51 -0
- package/lib/plugins/multi-sort/multi-sort.d.ts.map +1 -0
- package/lib/plugins/multi-sort/types.d.ts +25 -0
- package/lib/plugins/multi-sort/types.d.ts.map +1 -0
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +58 -0
- package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -0
- package/lib/plugins/pinned-columns/index.d.ts +7 -0
- package/lib/plugins/pinned-columns/index.d.ts.map +1 -0
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-columns/pinned-columns.d.ts +62 -0
- package/lib/plugins/pinned-columns/pinned-columns.d.ts.map +1 -0
- package/lib/plugins/pinned-columns/types.d.ts +20 -0
- package/lib/plugins/pinned-columns/types.d.ts.map +1 -0
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts +64 -0
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -0
- package/lib/plugins/pinned-rows/index.d.ts +7 -0
- package/lib/plugins/pinned-rows/index.d.ts.map +1 -0
- package/lib/plugins/pinned-rows/index.js +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pinned-rows/pinned-rows.d.ts +43 -0
- package/lib/plugins/pinned-rows/pinned-rows.d.ts.map +1 -0
- package/lib/plugins/pinned-rows/types.d.ts +95 -0
- package/lib/plugins/pinned-rows/types.d.ts.map +1 -0
- package/lib/plugins/pivot/PivotPlugin.d.ts +94 -0
- package/lib/plugins/pivot/PivotPlugin.d.ts.map +1 -0
- package/lib/plugins/pivot/index.d.ts +7 -0
- package/lib/plugins/pivot/index.d.ts.map +1 -0
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/pivot/pivot-engine.d.ts +50 -0
- package/lib/plugins/pivot/pivot-engine.d.ts.map +1 -0
- package/lib/plugins/pivot/pivot-model.d.ts +6 -0
- package/lib/plugins/pivot/pivot-model.d.ts.map +1 -0
- package/lib/plugins/pivot/pivot-panel.d.ts +25 -0
- package/lib/plugins/pivot/pivot-panel.d.ts.map +1 -0
- package/lib/plugins/pivot/pivot-rows.d.ts +33 -0
- package/lib/plugins/pivot/pivot-rows.d.ts.map +1 -0
- package/lib/plugins/pivot/types.d.ts +62 -0
- package/lib/plugins/pivot/types.d.ts.map +1 -0
- package/lib/plugins/reorder/ReorderPlugin.d.ts +81 -0
- package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -0
- package/lib/plugins/reorder/column-drag.d.ts +41 -0
- package/lib/plugins/reorder/column-drag.d.ts.map +1 -0
- package/lib/plugins/reorder/index.d.ts +7 -0
- package/lib/plugins/reorder/index.d.ts.map +1 -0
- package/lib/plugins/reorder/index.js +51 -48
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/reorder/types.d.ts +54 -0
- package/lib/plugins/reorder/types.d.ts.map +1 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts +77 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -0
- package/lib/plugins/selection/index.d.ts +8 -0
- package/lib/plugins/selection/index.d.ts.map +1 -0
- package/lib/plugins/selection/index.js +86 -75
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/range-selection.d.ts +109 -0
- package/lib/plugins/selection/range-selection.d.ts.map +1 -0
- package/lib/plugins/selection/row-selection.d.ts +48 -0
- package/lib/plugins/selection/row-selection.d.ts.map +1 -0
- package/lib/plugins/selection/types.d.ts +80 -0
- package/lib/plugins/selection/types.d.ts.map +1 -0
- package/lib/plugins/server-side/ServerSidePlugin.d.ts +56 -0
- package/lib/plugins/server-side/ServerSidePlugin.d.ts.map +1 -0
- package/lib/plugins/server-side/cache.d.ts +14 -0
- package/lib/plugins/server-side/cache.d.ts.map +1 -0
- package/lib/plugins/server-side/datasource.d.ts +12 -0
- package/lib/plugins/server-side/datasource.d.ts.map +1 -0
- package/lib/plugins/server-side/index.d.ts +7 -0
- package/lib/plugins/server-side/index.d.ts.map +1 -0
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/server-side/types.d.ts +43 -0
- package/lib/plugins/server-side/types.d.ts.map +1 -0
- package/lib/plugins/tree/TreePlugin.d.ts +49 -0
- package/lib/plugins/tree/TreePlugin.d.ts.map +1 -0
- package/lib/plugins/tree/index.d.ts +8 -0
- package/lib/plugins/tree/index.d.ts.map +1 -0
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/tree/tree-data.d.ts +42 -0
- package/lib/plugins/tree/tree-data.d.ts.map +1 -0
- package/lib/plugins/tree/tree-detect.d.ts +24 -0
- package/lib/plugins/tree/tree-detect.d.ts.map +1 -0
- package/lib/plugins/tree/types.d.ts +61 -0
- package/lib/plugins/tree/types.d.ts.map +1 -0
- package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts +68 -0
- package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts.map +1 -0
- package/lib/plugins/undo-redo/history.d.ts +64 -0
- package/lib/plugins/undo-redo/history.d.ts.map +1 -0
- package/lib/plugins/undo-redo/index.d.ts +7 -0
- package/lib/plugins/undo-redo/index.d.ts.map +1 -0
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/undo-redo/types.d.ts +41 -0
- package/lib/plugins/undo-redo/types.d.ts.map +1 -0
- package/lib/plugins/visibility/VisibilityPlugin.d.ts +135 -0
- package/lib/plugins/visibility/VisibilityPlugin.d.ts.map +1 -0
- package/lib/plugins/visibility/index.d.ts +8 -0
- package/lib/plugins/visibility/index.d.ts.map +1 -0
- package/lib/plugins/visibility/index.js.map +1 -1
- package/lib/plugins/visibility/types.d.ts +33 -0
- package/lib/plugins/visibility/types.d.ts.map +1 -0
- package/lib/plugins/visibility/visibility.d.ts +30 -0
- package/lib/plugins/visibility/visibility.d.ts.map +1 -0
- package/package.json +6 -2
- package/public.d.ts +52 -0
- package/public.d.ts.map +1 -0
- package/umd/grid.all.umd.js +32 -74
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +22 -64
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/context-menu.umd.js +1 -1
- package/umd/plugins/context-menu.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/grouping-columns.umd.js +1 -1
- package/umd/plugins/grouping-columns.umd.js.map +1 -1
- package/umd/plugins/grouping-rows.umd.js +1 -1
- package/umd/plugins/grouping-rows.umd.js.map +1 -1
- package/umd/plugins/master-detail.umd.js +1 -1
- package/umd/plugins/master-detail.umd.js.map +1 -1
- package/umd/plugins/pinned-rows.umd.js +1 -1
- package/umd/plugins/pinned-rows.umd.js.map +1 -1
- package/umd/plugins/pivot.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +1 -1
- package/umd/plugins/selection.umd.js.map +1 -1
- package/index-DG2CZ_Zo.js +0 -3229
- package/index-DG2CZ_Zo.js.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column Reordering Plugin Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the column reordering feature.
|
|
5
|
+
*/
|
|
6
|
+
/** Animation type for column reordering */
|
|
7
|
+
export type ReorderAnimation = false | 'flip' | 'fade';
|
|
8
|
+
/** Configuration options for the reorder plugin */
|
|
9
|
+
export interface ReorderConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Animation type for column movement.
|
|
12
|
+
* - `false`: No animation, instant reorder
|
|
13
|
+
* - `'flip'`: FLIP animation (slides columns smoothly)
|
|
14
|
+
* - `'fade'`: View Transitions API (cross-fade effect)
|
|
15
|
+
* @default 'flip'
|
|
16
|
+
*/
|
|
17
|
+
animation?: ReorderAnimation;
|
|
18
|
+
/**
|
|
19
|
+
* Animation duration in milliseconds.
|
|
20
|
+
* Applies to FLIP animation. View Transitions use browser defaults.
|
|
21
|
+
* @default 200
|
|
22
|
+
*/
|
|
23
|
+
animationDuration?: number;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use `animation` instead. Will be removed in next major version.
|
|
26
|
+
* Use View Transitions API for smooth column movement.
|
|
27
|
+
*/
|
|
28
|
+
viewTransition?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Internal state managed by the reorder plugin */
|
|
31
|
+
export interface ReorderState {
|
|
32
|
+
/** Whether a drag operation is in progress */
|
|
33
|
+
isDragging: boolean;
|
|
34
|
+
/** The field name of the currently dragged column */
|
|
35
|
+
draggedField: string | null;
|
|
36
|
+
/** The original index of the dragged column */
|
|
37
|
+
draggedIndex: number | null;
|
|
38
|
+
/** The target drop index */
|
|
39
|
+
dropIndex: number | null;
|
|
40
|
+
/** Field names in display order */
|
|
41
|
+
columnOrder: string[];
|
|
42
|
+
}
|
|
43
|
+
/** Event detail emitted when a column is moved */
|
|
44
|
+
export interface ColumnMoveDetail {
|
|
45
|
+
/** The field name of the moved column */
|
|
46
|
+
field: string;
|
|
47
|
+
/** The original index of the column */
|
|
48
|
+
fromIndex: number;
|
|
49
|
+
/** The new index of the column */
|
|
50
|
+
toIndex: number;
|
|
51
|
+
/** The complete column order after the move */
|
|
52
|
+
columnOrder: string[];
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/reorder/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,2CAA2C;AAC3C,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvD,mDAAmD;AACnD,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAE7B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,UAAU,EAAE,OAAO,CAAC;IACpB,qDAAqD;IACrD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,+CAA+C;IAC/C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,4BAA4B;IAC5B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mCAAmC;IACnC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { BaseGridPlugin, CellClickEvent, CellMouseEvent } from '../../core/plugin/base-plugin';
|
|
2
|
+
import { CellRange, SelectionConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Selection Plugin for tbw-grid
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* new SelectionPlugin({ mode: 'range' })
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare class SelectionPlugin extends BaseGridPlugin<SelectionConfig> {
|
|
12
|
+
#private;
|
|
13
|
+
readonly name = "selection";
|
|
14
|
+
readonly version = "1.0.0";
|
|
15
|
+
protected get defaultConfig(): Partial<SelectionConfig>;
|
|
16
|
+
/** Row selection state (row mode) */
|
|
17
|
+
private selected;
|
|
18
|
+
private lastSelected;
|
|
19
|
+
private anchor;
|
|
20
|
+
/** Range selection state (range mode) */
|
|
21
|
+
private ranges;
|
|
22
|
+
private activeRange;
|
|
23
|
+
private cellAnchor;
|
|
24
|
+
private isDragging;
|
|
25
|
+
/** Pending keyboard navigation update (processed in afterRender) */
|
|
26
|
+
private pendingKeyboardUpdate;
|
|
27
|
+
/** Cell selection state (cell mode) */
|
|
28
|
+
private selectedCell;
|
|
29
|
+
detach(): void;
|
|
30
|
+
onCellClick(event: CellClickEvent): boolean;
|
|
31
|
+
onKeyDown(event: KeyboardEvent): boolean;
|
|
32
|
+
onCellMouseDown(event: CellMouseEvent): boolean | void;
|
|
33
|
+
onCellMouseMove(event: CellMouseEvent): boolean | void;
|
|
34
|
+
onCellMouseUp(_event: CellMouseEvent): boolean | void;
|
|
35
|
+
afterRender(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Called after scroll-triggered row rendering.
|
|
38
|
+
* Reapplies selection classes to recycled DOM elements.
|
|
39
|
+
*/
|
|
40
|
+
onScrollRender(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Get the selected cell (cell mode only).
|
|
43
|
+
*/
|
|
44
|
+
getSelectedCell(): {
|
|
45
|
+
row: number;
|
|
46
|
+
col: number;
|
|
47
|
+
} | null;
|
|
48
|
+
/**
|
|
49
|
+
* Get all selected row indices (row mode).
|
|
50
|
+
*/
|
|
51
|
+
getSelectedRows(): number[];
|
|
52
|
+
/**
|
|
53
|
+
* Get all selected cell ranges in public format.
|
|
54
|
+
*/
|
|
55
|
+
getRanges(): CellRange[];
|
|
56
|
+
/**
|
|
57
|
+
* Get all selected cells across all ranges.
|
|
58
|
+
*/
|
|
59
|
+
getSelectedCells(): Array<{
|
|
60
|
+
row: number;
|
|
61
|
+
col: number;
|
|
62
|
+
}>;
|
|
63
|
+
/**
|
|
64
|
+
* Check if a specific cell is in range selection.
|
|
65
|
+
*/
|
|
66
|
+
isCellSelected(row: number, col: number): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Clear all selection.
|
|
69
|
+
*/
|
|
70
|
+
clearSelection(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Set selected ranges programmatically.
|
|
73
|
+
*/
|
|
74
|
+
setRanges(ranges: CellRange[]): void;
|
|
75
|
+
readonly styles: string;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=SelectionPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/selection/SelectionPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAS/F,OAAO,KAAK,EAAE,SAAS,EAA4C,eAAe,EAAiB,MAAM,SAAS,CAAC;AAyCnH;;;;;;;GAOG;AACH,qBAAa,eAAgB,SAAQ,cAAc,CAAC,eAAe,CAAC;;IAClE,QAAQ,CAAC,IAAI,eAAe;IAC5B,SAAkB,OAAO,WAAW;IAEpC,cAAuB,aAAa,IAAI,OAAO,CAAC,eAAe,CAAC,CAI/D;IAGD,qCAAqC;IACrC,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,MAAM,CAAuB;IAErC,yCAAyC;IACzC,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,UAAU,CAA6C;IAC/D,OAAO,CAAC,UAAU,CAAS;IAE3B,oEAAoE;IACpE,OAAO,CAAC,qBAAqB,CAAsC;IAEnE,uCAAuC;IACvC,OAAO,CAAC,YAAY,CAA6C;IAMxD,MAAM,IAAI,IAAI;IAcd,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO;IAyE3C,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IA4FxC,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IAmCtD,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IAoBtD,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IA8ErD,WAAW,IAAI,IAAI;IA0C5B;;;OAGG;IACM,cAAc,IAAI,IAAI;IAQ/B;;OAEG;IACH,eAAe,IAAI;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAItD;;OAEG;IACH,eAAe,IAAI,MAAM,EAAE;IAI3B;;OAEG;IACH,SAAS,IAAI,SAAS,EAAE;IAIxB;;OAEG;IACH,gBAAgB,IAAI,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAIvD;;OAEG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAIjD;;OAEG;IACH,cAAc,IAAI,IAAI;IAWtB;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI;IAmCpC,SAAkB,MAAM,SAAU;CAGnC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selection Plugin Entry Point
|
|
3
|
+
* Re-exports plugin class and types for tree-shakeable imports.
|
|
4
|
+
*/
|
|
5
|
+
export { SelectionPlugin } from './SelectionPlugin';
|
|
6
|
+
export { computeSelectionDiff, handleRowClick, selectAll } from './row-selection';
|
|
7
|
+
export type { SelectionConfig, SelectionMode, SelectionChangeDetail, CellRange } from './types';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/selection/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClF,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
function w(s) {
|
|
2
|
+
if (!s) return -1;
|
|
3
|
+
const e = s.getAttribute("data-row");
|
|
4
|
+
return e ? parseInt(e, 10) : -1;
|
|
5
|
+
}
|
|
6
|
+
function d(s) {
|
|
7
|
+
s && s.querySelectorAll(".cell-focus").forEach((e) => e.classList.remove("cell-focus"));
|
|
8
|
+
}
|
|
9
|
+
const R = {
|
|
2
10
|
expand: "▶",
|
|
3
11
|
collapse: "▼",
|
|
4
12
|
sortAsc: "▲",
|
|
@@ -8,7 +16,7 @@ const f = {
|
|
|
8
16
|
dragHandle: "⋮⋮",
|
|
9
17
|
toolPanel: "☰"
|
|
10
18
|
};
|
|
11
|
-
class
|
|
19
|
+
class C {
|
|
12
20
|
/** Plugin version - override in subclass if needed */
|
|
13
21
|
version = "1.0.0";
|
|
14
22
|
/** CSS styles to inject into the grid's shadow DOM */
|
|
@@ -133,7 +141,7 @@ class w {
|
|
|
133
141
|
*/
|
|
134
142
|
get gridIcons() {
|
|
135
143
|
const e = this.grid?.gridConfig?.icons ?? {};
|
|
136
|
-
return { ...
|
|
144
|
+
return { ...R, ...e };
|
|
137
145
|
}
|
|
138
146
|
/**
|
|
139
147
|
* Resolve an icon value to string or HTMLElement.
|
|
@@ -172,38 +180,38 @@ function h(s) {
|
|
|
172
180
|
endCol: Math.max(s.startCol, s.endCol)
|
|
173
181
|
};
|
|
174
182
|
}
|
|
175
|
-
function
|
|
183
|
+
function m(s) {
|
|
176
184
|
const e = h(s);
|
|
177
185
|
return {
|
|
178
186
|
from: { row: e.startRow, col: e.startCol },
|
|
179
187
|
to: { row: e.endRow, col: e.endCol }
|
|
180
188
|
};
|
|
181
189
|
}
|
|
182
|
-
function
|
|
183
|
-
return s.map(
|
|
190
|
+
function u(s) {
|
|
191
|
+
return s.map(m);
|
|
184
192
|
}
|
|
185
|
-
function
|
|
193
|
+
function p(s, e, t) {
|
|
186
194
|
const r = h(t);
|
|
187
195
|
return s >= r.startRow && s <= r.endRow && e >= r.startCol && e <= r.endCol;
|
|
188
196
|
}
|
|
189
|
-
function
|
|
190
|
-
return t.some((r) =>
|
|
197
|
+
function f(s, e, t) {
|
|
198
|
+
return t.some((r) => p(s, e, r));
|
|
191
199
|
}
|
|
192
|
-
function
|
|
200
|
+
function b(s) {
|
|
193
201
|
const e = [], t = h(s);
|
|
194
202
|
for (let r = t.startRow; r <= t.endRow; r++)
|
|
195
|
-
for (let
|
|
196
|
-
e.push({ row: r, col:
|
|
203
|
+
for (let n = t.startCol; n <= t.endCol; n++)
|
|
204
|
+
e.push({ row: r, col: n });
|
|
197
205
|
return e;
|
|
198
206
|
}
|
|
199
207
|
function A(s) {
|
|
200
208
|
const e = /* @__PURE__ */ new Map();
|
|
201
209
|
for (const t of s)
|
|
202
|
-
for (const r of
|
|
210
|
+
for (const r of b(t))
|
|
203
211
|
e.set(`${r.row},${r.col}`, r);
|
|
204
212
|
return [...e.values()];
|
|
205
213
|
}
|
|
206
|
-
function
|
|
214
|
+
function g(s, e) {
|
|
207
215
|
return {
|
|
208
216
|
startRow: s.row,
|
|
209
217
|
startCol: s.col,
|
|
@@ -211,8 +219,8 @@ function d(s, e) {
|
|
|
211
219
|
endCol: e.col
|
|
212
220
|
};
|
|
213
221
|
}
|
|
214
|
-
const
|
|
215
|
-
function
|
|
222
|
+
const y = ':host .selecting .data-grid-row>.cell{-webkit-user-select:none;user-select:none}:host .data-grid-row.row-focus{background-color:var(--tbw-focus-background, rgba(from var(--tbw-color-accent) r g b / 12%))}:host([data-selection-mode="row"]) .cell-focus{outline:none}:host .data-grid-row>.cell.selected{background-color:var(--tbw-range-selection-bg)}:host .data-grid-row>.cell.selected.top{border-top:2px solid var(--tbw-range-border-color)}:host .data-grid-row>.cell.selected.bottom{border-bottom:2px solid var(--tbw-range-border-color)}:host .data-grid-row>.cell.selected.first{border-left:2px solid var(--tbw-range-border-color)}:host .data-grid-row>.cell.selected.last{border-right:2px solid var(--tbw-range-border-color)}:host .tbw-selection-summary{font-size:13px;color:var(--tbw-color-fg-muted);white-space:nowrap}';
|
|
223
|
+
function v(s, e, t) {
|
|
216
224
|
if (s === "cell" && e.selectedCell)
|
|
217
225
|
return {
|
|
218
226
|
mode: s,
|
|
@@ -224,15 +232,15 @@ function b(s, e, t) {
|
|
|
224
232
|
]
|
|
225
233
|
};
|
|
226
234
|
if (s === "row" && e.selected.size > 0) {
|
|
227
|
-
const r = [...e.selected].map((
|
|
228
|
-
from: { row:
|
|
229
|
-
to: { row:
|
|
235
|
+
const r = [...e.selected].map((n) => ({
|
|
236
|
+
from: { row: n, col: 0 },
|
|
237
|
+
to: { row: n, col: t - 1 }
|
|
230
238
|
}));
|
|
231
239
|
return { mode: s, ranges: r };
|
|
232
240
|
}
|
|
233
|
-
return s === "range" && e.ranges.length > 0 ? { mode: s, ranges:
|
|
241
|
+
return s === "range" && e.ranges.length > 0 ? { mode: s, ranges: u(e.ranges) } : { mode: s, ranges: [] };
|
|
234
242
|
}
|
|
235
|
-
class
|
|
243
|
+
class q extends C {
|
|
236
244
|
name = "selection";
|
|
237
245
|
version = "1.0.0";
|
|
238
246
|
get defaultConfig() {
|
|
@@ -262,15 +270,15 @@ class v extends w {
|
|
|
262
270
|
// #endregion
|
|
263
271
|
// #region Event Handlers
|
|
264
272
|
onCellClick(e) {
|
|
265
|
-
const { rowIndex: t, colIndex: r, originalEvent:
|
|
266
|
-
if (
|
|
273
|
+
const { rowIndex: t, colIndex: r, originalEvent: n } = e, { mode: o } = this.config;
|
|
274
|
+
if (o === "cell")
|
|
267
275
|
return this.selectedCell = { row: t, col: r }, this.emit("selection-change", this.#e()), this.requestAfterRender(), !1;
|
|
268
|
-
if (
|
|
276
|
+
if (o === "row")
|
|
269
277
|
return this.selected.clear(), this.selected.add(t), this.lastSelected = t, this.emit("selection-change", this.#e()), this.requestAfterRender(), !1;
|
|
270
|
-
if (
|
|
271
|
-
const c =
|
|
278
|
+
if (o === "range") {
|
|
279
|
+
const c = n.shiftKey, l = n.ctrlKey || n.metaKey;
|
|
272
280
|
if (c && this.cellAnchor) {
|
|
273
|
-
const i =
|
|
281
|
+
const i = g(this.cellAnchor, { row: t, col: r });
|
|
274
282
|
l ? this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] = i : this.ranges.push(i) : this.ranges = [i], this.activeRange = i;
|
|
275
283
|
} else if (l) {
|
|
276
284
|
const i = {
|
|
@@ -294,10 +302,10 @@ class v extends w {
|
|
|
294
302
|
return !1;
|
|
295
303
|
}
|
|
296
304
|
onKeyDown(e) {
|
|
297
|
-
const { mode: t } = this.config,
|
|
305
|
+
const { mode: t } = this.config, n = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Tab", "Home", "End", "PageUp", "PageDown"].includes(e.key);
|
|
298
306
|
if (e.key === "Escape")
|
|
299
307
|
return t === "cell" ? this.selectedCell = null : t === "row" ? (this.selected.clear(), this.anchor = null) : t === "range" && (this.ranges = [], this.activeRange = null, this.cellAnchor = null), this.emit("selection-change", this.#e()), this.requestAfterRender(), !0;
|
|
300
|
-
if (t === "cell" &&
|
|
308
|
+
if (t === "cell" && n)
|
|
301
309
|
return queueMicrotask(() => {
|
|
302
310
|
this.selectedCell = { row: this.grid._focusRow, col: this.grid._focusCol }, this.emit("selection-change", this.#e()), this.requestAfterRender();
|
|
303
311
|
}), !1;
|
|
@@ -305,15 +313,17 @@ class v extends w {
|
|
|
305
313
|
return queueMicrotask(() => {
|
|
306
314
|
this.selected.clear(), this.selected.add(this.grid._focusRow), this.lastSelected = this.grid._focusRow, this.emit("selection-change", this.#e()), this.requestAfterRender();
|
|
307
315
|
}), !1;
|
|
308
|
-
if (t === "range" &&
|
|
309
|
-
|
|
316
|
+
if (t === "range" && n) {
|
|
317
|
+
const o = e.key === "Tab", c = e.shiftKey && !o;
|
|
318
|
+
return c && !this.cellAnchor && (this.cellAnchor = { row: this.grid._focusRow, col: this.grid._focusCol }), this.pendingKeyboardUpdate = { shiftKey: c }, queueMicrotask(() => this.requestAfterRender()), !1;
|
|
319
|
+
}
|
|
310
320
|
if (t === "range" && e.key === "a" && (e.ctrlKey || e.metaKey)) {
|
|
311
|
-
const
|
|
312
|
-
if (
|
|
321
|
+
const o = this.rows.length, c = this.columns.length;
|
|
322
|
+
if (o > 0 && c > 0) {
|
|
313
323
|
const l = {
|
|
314
324
|
startRow: 0,
|
|
315
325
|
startCol: 0,
|
|
316
|
-
endRow:
|
|
326
|
+
endRow: o - 1,
|
|
317
327
|
endCol: c - 1
|
|
318
328
|
};
|
|
319
329
|
return this.ranges = [l], this.activeRange = l, this.emit("selection-change", this.#e()), this.requestAfterRender(), !0;
|
|
@@ -327,17 +337,17 @@ class v extends w {
|
|
|
327
337
|
this.isDragging = !0;
|
|
328
338
|
const t = e.rowIndex, r = e.colIndex;
|
|
329
339
|
this.cellAnchor = { row: t, col: r }, e.originalEvent.ctrlKey || e.originalEvent.metaKey || (this.ranges = []);
|
|
330
|
-
const
|
|
340
|
+
const o = {
|
|
331
341
|
startRow: t,
|
|
332
342
|
startCol: r,
|
|
333
343
|
endRow: t,
|
|
334
344
|
endCol: r
|
|
335
345
|
};
|
|
336
|
-
return this.ranges.push(
|
|
346
|
+
return this.ranges.push(o), this.activeRange = o, this.emit("selection-change", this.#e()), this.requestAfterRender(), !0;
|
|
337
347
|
}
|
|
338
348
|
onCellMouseMove(e) {
|
|
339
349
|
if (this.config.mode !== "range" || !this.isDragging || !this.cellAnchor || e.rowIndex === void 0 || e.colIndex === void 0 || e.rowIndex < 0) return;
|
|
340
|
-
const t =
|
|
350
|
+
const t = g(this.cellAnchor, { row: e.rowIndex, col: e.colIndex });
|
|
341
351
|
return this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] = t : this.ranges.push(t), this.activeRange = t, this.emit("selection-change", this.#e()), this.requestAfterRender(), !0;
|
|
342
352
|
}
|
|
343
353
|
onCellMouseUp(e) {
|
|
@@ -352,36 +362,37 @@ class v extends w {
|
|
|
352
362
|
const e = this.shadowRoot;
|
|
353
363
|
if (!e) return;
|
|
354
364
|
const { mode: t } = this.config;
|
|
355
|
-
e.querySelectorAll(".cell").forEach((
|
|
356
|
-
|
|
365
|
+
e.querySelectorAll(".cell").forEach((o) => {
|
|
366
|
+
o.classList.remove("selected", "top", "bottom", "first", "last");
|
|
357
367
|
});
|
|
358
|
-
const
|
|
359
|
-
if (
|
|
360
|
-
|
|
361
|
-
}), t === "row" && (e
|
|
362
|
-
const c =
|
|
363
|
-
l >= 0 && this.selected.has(l) &&
|
|
368
|
+
const n = e.querySelectorAll(".data-grid-row");
|
|
369
|
+
if (n.forEach((o) => {
|
|
370
|
+
o.classList.remove("selected", "row-focus");
|
|
371
|
+
}), t === "row" && (d(e), n.forEach((o) => {
|
|
372
|
+
const c = o.querySelector(".cell[data-row]"), l = w(c);
|
|
373
|
+
l >= 0 && this.selected.has(l) && o.classList.add("selected", "row-focus");
|
|
364
374
|
})), t === "range" && this.ranges.length > 0) {
|
|
365
|
-
|
|
375
|
+
d(e);
|
|
376
|
+
const o = this.activeRange ? h(this.activeRange) : null;
|
|
366
377
|
e.querySelectorAll(".cell[data-row][data-col]").forEach((l) => {
|
|
367
378
|
const i = parseInt(l.getAttribute("data-row") ?? "-1", 10), a = parseInt(l.getAttribute("data-col") ?? "-1", 10);
|
|
368
|
-
i >= 0 && a >= 0 &&
|
|
379
|
+
i >= 0 && a >= 0 && f(i, a, this.ranges) && (l.classList.add("selected"), o && (i === o.startRow && l.classList.add("top"), i === o.endRow && l.classList.add("bottom"), a === o.startCol && l.classList.add("first"), a === o.endCol && l.classList.add("last")));
|
|
369
380
|
});
|
|
370
381
|
}
|
|
371
|
-
t === "cell" && this.selectedCell && e
|
|
382
|
+
t === "cell" && this.selectedCell && d(e);
|
|
372
383
|
}
|
|
373
384
|
afterRender() {
|
|
374
385
|
const e = this.shadowRoot;
|
|
375
386
|
if (!e) return;
|
|
376
387
|
const t = e.children[0], { mode: r } = this.config;
|
|
377
388
|
if (this.pendingKeyboardUpdate && r === "range") {
|
|
378
|
-
const { shiftKey:
|
|
389
|
+
const { shiftKey: n } = this.pendingKeyboardUpdate;
|
|
379
390
|
this.pendingKeyboardUpdate = null;
|
|
380
|
-
const
|
|
381
|
-
if (
|
|
382
|
-
const l =
|
|
391
|
+
const o = this.grid._focusRow, c = this.grid._focusCol;
|
|
392
|
+
if (n && this.cellAnchor) {
|
|
393
|
+
const l = g(this.cellAnchor, { row: o, col: c });
|
|
383
394
|
this.ranges = [l], this.activeRange = l;
|
|
384
|
-
} else
|
|
395
|
+
} else n || (this.ranges = [], this.activeRange = null, this.cellAnchor = { row: o, col: c });
|
|
385
396
|
this.emit("selection-change", this.#e());
|
|
386
397
|
}
|
|
387
398
|
this.grid.setAttribute("data-selection-mode", r), t && t.classList.toggle("selecting", this.isDragging), this.#t();
|
|
@@ -411,7 +422,7 @@ class v extends w {
|
|
|
411
422
|
* Get all selected cell ranges in public format.
|
|
412
423
|
*/
|
|
413
424
|
getRanges() {
|
|
414
|
-
return
|
|
425
|
+
return u(this.ranges);
|
|
415
426
|
}
|
|
416
427
|
/**
|
|
417
428
|
* Get all selected cells across all ranges.
|
|
@@ -423,7 +434,7 @@ class v extends w {
|
|
|
423
434
|
* Check if a specific cell is in range selection.
|
|
424
435
|
*/
|
|
425
436
|
isCellSelected(e, t) {
|
|
426
|
-
return
|
|
437
|
+
return f(e, t, this.ranges);
|
|
427
438
|
}
|
|
428
439
|
/**
|
|
429
440
|
* Clear all selection.
|
|
@@ -442,13 +453,13 @@ class v extends w {
|
|
|
442
453
|
endCol: t.to.col
|
|
443
454
|
})), this.activeRange = this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] : null, this.emit("selection-change", {
|
|
444
455
|
mode: this.config.mode,
|
|
445
|
-
ranges:
|
|
456
|
+
ranges: u(this.ranges)
|
|
446
457
|
}), this.requestAfterRender();
|
|
447
458
|
}
|
|
448
459
|
// #endregion
|
|
449
460
|
// #region Private Helpers
|
|
450
461
|
#e() {
|
|
451
|
-
return
|
|
462
|
+
return v(
|
|
452
463
|
this.config.mode,
|
|
453
464
|
{
|
|
454
465
|
selectedCell: this.selectedCell,
|
|
@@ -460,42 +471,42 @@ class v extends w {
|
|
|
460
471
|
}
|
|
461
472
|
// #endregion
|
|
462
473
|
// #region Styles
|
|
463
|
-
styles =
|
|
474
|
+
styles = y;
|
|
464
475
|
// #endregion
|
|
465
476
|
}
|
|
466
|
-
function
|
|
467
|
-
const
|
|
468
|
-
let
|
|
477
|
+
function S(s, e, t, r) {
|
|
478
|
+
const n = new Set(s.selected);
|
|
479
|
+
let o = s.anchor;
|
|
469
480
|
if (t === "single")
|
|
470
|
-
|
|
481
|
+
n.clear(), n.add(e), o = e;
|
|
471
482
|
else if (t === "multiple") {
|
|
472
483
|
const c = r.ctrlKey || r.metaKey;
|
|
473
484
|
if (r.shiftKey && s.anchor !== null) {
|
|
474
485
|
const l = Math.min(s.anchor, e), i = Math.max(s.anchor, e);
|
|
475
486
|
for (let a = l; a <= i; a++)
|
|
476
|
-
|
|
477
|
-
} else c ? (
|
|
487
|
+
n.add(a);
|
|
488
|
+
} else c ? (n.has(e) ? n.delete(e) : n.add(e), o = e) : (n.clear(), n.add(e), o = e);
|
|
478
489
|
}
|
|
479
|
-
return { selected:
|
|
490
|
+
return { selected: n, lastSelected: e, anchor: o };
|
|
480
491
|
}
|
|
481
|
-
function
|
|
492
|
+
function x(s) {
|
|
482
493
|
const e = /* @__PURE__ */ new Set();
|
|
483
494
|
for (let t = 0; t < s; t++)
|
|
484
495
|
e.add(t);
|
|
485
496
|
return e;
|
|
486
497
|
}
|
|
487
|
-
function
|
|
498
|
+
function I(s, e) {
|
|
488
499
|
const t = [], r = [];
|
|
489
|
-
for (const
|
|
490
|
-
s.has(
|
|
491
|
-
for (const
|
|
492
|
-
e.has(
|
|
500
|
+
for (const n of e)
|
|
501
|
+
s.has(n) || t.push(n);
|
|
502
|
+
for (const n of s)
|
|
503
|
+
e.has(n) || r.push(n);
|
|
493
504
|
return { added: t, removed: r };
|
|
494
505
|
}
|
|
495
506
|
export {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
507
|
+
q as SelectionPlugin,
|
|
508
|
+
I as computeSelectionDiff,
|
|
509
|
+
S as handleRowClick,
|
|
510
|
+
x as selectAll
|
|
500
511
|
};
|
|
501
512
|
//# sourceMappingURL=index.js.map
|