@toolbox-web/grid 0.6.0 → 1.0.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.
Files changed (180) hide show
  1. package/README.md +79 -26
  2. package/all.js +731 -1739
  3. package/all.js.map +1 -1
  4. package/index.js +1382 -2410
  5. package/index.js.map +1 -1
  6. package/lib/core/constants.d.ts +8 -0
  7. package/lib/core/constants.d.ts.map +1 -1
  8. package/lib/core/grid.d.ts +704 -55
  9. package/lib/core/grid.d.ts.map +1 -1
  10. package/lib/core/internal/config-manager.d.ts +3 -7
  11. package/lib/core/internal/config-manager.d.ts.map +1 -1
  12. package/lib/core/internal/dom-builder.d.ts +2 -10
  13. package/lib/core/internal/dom-builder.d.ts.map +1 -1
  14. package/lib/core/internal/inference.d.ts.map +1 -1
  15. package/lib/core/internal/keyboard.d.ts.map +1 -1
  16. package/lib/core/internal/render-scheduler.d.ts +2 -0
  17. package/lib/core/internal/render-scheduler.d.ts.map +1 -1
  18. package/lib/core/internal/rows.d.ts +9 -1
  19. package/lib/core/internal/rows.d.ts.map +1 -1
  20. package/lib/core/internal/shell.d.ts +41 -41
  21. package/lib/core/internal/shell.d.ts.map +1 -1
  22. package/lib/core/internal/validate-config.d.ts.map +1 -1
  23. package/lib/core/plugin/base-plugin.d.ts +2 -15
  24. package/lib/core/plugin/base-plugin.d.ts.map +1 -1
  25. package/lib/core/plugin/types.d.ts +33 -6
  26. package/lib/core/plugin/types.d.ts.map +1 -1
  27. package/lib/core/types.d.ts +376 -68
  28. package/lib/core/types.d.ts.map +1 -1
  29. package/lib/plugins/clipboard/ClipboardPlugin.d.ts +89 -2
  30. package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
  31. package/lib/plugins/clipboard/index.d.ts +2 -0
  32. package/lib/plugins/clipboard/index.d.ts.map +1 -1
  33. package/lib/plugins/clipboard/index.js +24 -35
  34. package/lib/plugins/clipboard/index.js.map +1 -1
  35. package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts +57 -2
  36. package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts.map +1 -1
  37. package/lib/plugins/column-virtualization/index.d.ts +2 -0
  38. package/lib/plugins/column-virtualization/index.d.ts.map +1 -1
  39. package/lib/plugins/column-virtualization/index.js +7 -17
  40. package/lib/plugins/column-virtualization/index.js.map +1 -1
  41. package/lib/plugins/context-menu/ContextMenuPlugin.d.ts +75 -5
  42. package/lib/plugins/context-menu/ContextMenuPlugin.d.ts.map +1 -1
  43. package/lib/plugins/context-menu/index.d.ts +3 -1
  44. package/lib/plugins/context-menu/index.d.ts.map +1 -1
  45. package/lib/plugins/context-menu/index.js +15 -27
  46. package/lib/plugins/context-menu/index.js.map +1 -1
  47. package/lib/plugins/editing/EditingPlugin.d.ts +101 -9
  48. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  49. package/lib/plugins/editing/editors.d.ts +9 -1
  50. package/lib/plugins/editing/editors.d.ts.map +1 -1
  51. package/lib/plugins/editing/index.d.ts +4 -2
  52. package/lib/plugins/editing/index.d.ts.map +1 -1
  53. package/lib/plugins/editing/index.js +412 -279
  54. package/lib/plugins/editing/index.js.map +1 -1
  55. package/lib/plugins/editing/types.d.ts +88 -0
  56. package/lib/plugins/editing/types.d.ts.map +1 -1
  57. package/lib/plugins/export/ExportPlugin.d.ts +73 -7
  58. package/lib/plugins/export/ExportPlugin.d.ts.map +1 -1
  59. package/lib/plugins/export/index.d.ts +2 -0
  60. package/lib/plugins/export/index.d.ts.map +1 -1
  61. package/lib/plugins/export/index.js +4 -19
  62. package/lib/plugins/export/index.js.map +1 -1
  63. package/lib/plugins/filtering/FilteringPlugin.d.ts +98 -2
  64. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  65. package/lib/plugins/filtering/index.d.ts +2 -0
  66. package/lib/plugins/filtering/index.d.ts.map +1 -1
  67. package/lib/plugins/filtering/index.js +50 -58
  68. package/lib/plugins/filtering/index.js.map +1 -1
  69. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +80 -6
  70. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -1
  71. package/lib/plugins/grouping-columns/index.d.ts +2 -0
  72. package/lib/plugins/grouping-columns/index.d.ts.map +1 -1
  73. package/lib/plugins/grouping-columns/index.js +10 -21
  74. package/lib/plugins/grouping-columns/index.js.map +1 -1
  75. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +81 -5
  76. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
  77. package/lib/plugins/grouping-rows/index.d.ts +3 -1
  78. package/lib/plugins/grouping-rows/index.d.ts.map +1 -1
  79. package/lib/plugins/grouping-rows/index.js +13 -21
  80. package/lib/plugins/grouping-rows/index.js.map +1 -1
  81. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +90 -5
  82. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
  83. package/lib/plugins/master-detail/index.d.ts +2 -0
  84. package/lib/plugins/master-detail/index.d.ts.map +1 -1
  85. package/lib/plugins/master-detail/index.js +11 -17
  86. package/lib/plugins/master-detail/index.js.map +1 -1
  87. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts +83 -2
  88. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
  89. package/lib/plugins/multi-sort/index.d.ts +2 -0
  90. package/lib/plugins/multi-sort/index.d.ts.map +1 -1
  91. package/lib/plugins/multi-sort/index.js +11 -19
  92. package/lib/plugins/multi-sort/index.js.map +1 -1
  93. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +61 -2
  94. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -1
  95. package/lib/plugins/pinned-columns/index.d.ts +3 -1
  96. package/lib/plugins/pinned-columns/index.d.ts.map +1 -1
  97. package/lib/plugins/pinned-columns/index.js +7 -17
  98. package/lib/plugins/pinned-columns/index.js.map +1 -1
  99. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts +71 -10
  100. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
  101. package/lib/plugins/pinned-rows/index.d.ts +3 -1
  102. package/lib/plugins/pinned-rows/index.d.ts.map +1 -1
  103. package/lib/plugins/pinned-rows/index.js +5 -17
  104. package/lib/plugins/pinned-rows/index.js.map +1 -1
  105. package/lib/plugins/pivot/PivotPlugin.d.ts +81 -4
  106. package/lib/plugins/pivot/PivotPlugin.d.ts.map +1 -1
  107. package/lib/plugins/pivot/index.d.ts +2 -0
  108. package/lib/plugins/pivot/index.d.ts.map +1 -1
  109. package/lib/plugins/pivot/index.js +10 -17
  110. package/lib/plugins/pivot/index.js.map +1 -1
  111. package/lib/plugins/reorder/ReorderPlugin.d.ts +71 -3
  112. package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -1
  113. package/lib/plugins/reorder/index.d.ts +2 -0
  114. package/lib/plugins/reorder/index.d.ts.map +1 -1
  115. package/lib/plugins/reorder/index.js +8 -18
  116. package/lib/plugins/reorder/index.js.map +1 -1
  117. package/lib/plugins/reorder/types.d.ts +0 -5
  118. package/lib/plugins/reorder/types.d.ts.map +1 -1
  119. package/lib/plugins/selection/SelectionPlugin.d.ts +84 -20
  120. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  121. package/lib/plugins/selection/index.d.ts +2 -1
  122. package/lib/plugins/selection/index.d.ts.map +1 -1
  123. package/lib/plugins/selection/index.js +70 -131
  124. package/lib/plugins/selection/index.js.map +1 -1
  125. package/lib/plugins/selection/types.d.ts +25 -4
  126. package/lib/plugins/selection/types.d.ts.map +1 -1
  127. package/lib/plugins/server-side/ServerSidePlugin.d.ts +65 -4
  128. package/lib/plugins/server-side/ServerSidePlugin.d.ts.map +1 -1
  129. package/lib/plugins/server-side/index.d.ts +3 -1
  130. package/lib/plugins/server-side/index.d.ts.map +1 -1
  131. package/lib/plugins/server-side/index.js +5 -17
  132. package/lib/plugins/server-side/index.js.map +1 -1
  133. package/lib/plugins/tree/TreePlugin.d.ts +89 -2
  134. package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
  135. package/lib/plugins/tree/index.d.ts +3 -2
  136. package/lib/plugins/tree/index.d.ts.map +1 -1
  137. package/lib/plugins/tree/index.js +59 -94
  138. package/lib/plugins/tree/index.js.map +1 -1
  139. package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts +66 -3
  140. package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts.map +1 -1
  141. package/lib/plugins/undo-redo/index.d.ts +3 -1
  142. package/lib/plugins/undo-redo/index.d.ts.map +1 -1
  143. package/lib/plugins/undo-redo/index.js +5 -17
  144. package/lib/plugins/undo-redo/index.js.map +1 -1
  145. package/lib/plugins/visibility/VisibilityPlugin.d.ts +86 -2
  146. package/lib/plugins/visibility/VisibilityPlugin.d.ts.map +1 -1
  147. package/lib/plugins/visibility/index.d.ts +2 -0
  148. package/lib/plugins/visibility/index.d.ts.map +1 -1
  149. package/lib/plugins/visibility/index.js +6 -17
  150. package/lib/plugins/visibility/index.js.map +1 -1
  151. package/package.json +1 -1
  152. package/public.d.ts +30 -2
  153. package/public.d.ts.map +1 -1
  154. package/umd/grid.all.umd.js +19 -19
  155. package/umd/grid.all.umd.js.map +1 -1
  156. package/umd/grid.umd.js +11 -11
  157. package/umd/grid.umd.js.map +1 -1
  158. package/umd/plugins/clipboard.umd.js.map +1 -1
  159. package/umd/plugins/column-virtualization.umd.js.map +1 -1
  160. package/umd/plugins/context-menu.umd.js.map +1 -1
  161. package/umd/plugins/editing.umd.js +1 -1
  162. package/umd/plugins/editing.umd.js.map +1 -1
  163. package/umd/plugins/export.umd.js.map +1 -1
  164. package/umd/plugins/filtering.umd.js.map +1 -1
  165. package/umd/plugins/grouping-columns.umd.js.map +1 -1
  166. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  167. package/umd/plugins/master-detail.umd.js.map +1 -1
  168. package/umd/plugins/multi-sort.umd.js.map +1 -1
  169. package/umd/plugins/pinned-columns.umd.js.map +1 -1
  170. package/umd/plugins/pinned-rows.umd.js.map +1 -1
  171. package/umd/plugins/pivot.umd.js.map +1 -1
  172. package/umd/plugins/reorder.umd.js +1 -1
  173. package/umd/plugins/reorder.umd.js.map +1 -1
  174. package/umd/plugins/selection.umd.js +1 -1
  175. package/umd/plugins/selection.umd.js.map +1 -1
  176. package/umd/plugins/server-side.umd.js.map +1 -1
  177. package/umd/plugins/tree.umd.js +1 -1
  178. package/umd/plugins/tree.umd.js.map +1 -1
  179. package/umd/plugins/undo-redo.umd.js.map +1 -1
  180. package/umd/plugins/visibility.umd.js.map +1 -1
@@ -21,11 +21,6 @@ export interface ReorderConfig {
21
21
  * @default 200
22
22
  */
23
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
24
  }
30
25
  /** Internal state managed by the reorder plugin */
31
26
  export interface ReorderState {
@@ -1 +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"}
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;CAC5B;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"}
@@ -3,15 +3,89 @@ import { CellRange, SelectionConfig, SelectionResult } from './types';
3
3
  /**
4
4
  * Selection Plugin for tbw-grid
5
5
  *
6
- * @example
6
+ * Adds cell, row, and range selection capabilities to the grid with full keyboard support.
7
+ * Whether you need simple cell highlighting or complex multi-range selections, this plugin has you covered.
8
+ *
9
+ * ## Installation
10
+ *
11
+ * ```ts
12
+ * import { SelectionPlugin } from '@toolbox-web/grid/plugins/selection';
13
+ * ```
14
+ *
15
+ * ## Selection Modes
16
+ *
17
+ * Configure the plugin with one of three modes via {@link SelectionConfig}:
18
+ *
19
+ * - **`'cell'`** - Single cell selection (default). Click cells to select individually.
20
+ * - **`'row'`** - Full row selection. Click anywhere in a row to select the entire row.
21
+ * - **`'range'`** - Rectangular selection. Click and drag or Shift+Click to select ranges.
22
+ *
23
+ * ## Keyboard Shortcuts
24
+ *
25
+ * | Shortcut | Action |
26
+ * |----------|--------|
27
+ * | `Arrow Keys` | Move selection |
28
+ * | `Shift + Arrow` | Extend selection (range mode) |
29
+ * | `Ctrl/Cmd + Click` | Toggle selection (multi-select) |
30
+ * | `Shift + Click` | Extend to clicked cell/row |
31
+ * | `Ctrl/Cmd + A` | Select all (range mode) |
32
+ * | `Escape` | Clear selection |
33
+ *
34
+ * ## CSS Custom Properties
35
+ *
36
+ * | Property | Description |
37
+ * |----------|-------------|
38
+ * | `--tbw-focus-background` | Focused row background |
39
+ * | `--tbw-range-selection-bg` | Range selection fill |
40
+ * | `--tbw-range-border-color` | Range selection border |
41
+ *
42
+ * @example Basic row selection
7
43
  * ```ts
8
- * new SelectionPlugin({ mode: 'range' })
44
+ * grid.gridConfig = {
45
+ * columns: [...],
46
+ * plugins: [new SelectionPlugin({ mode: 'row' })],
47
+ * };
48
+ * ```
49
+ *
50
+ * @example Range selection with event handling
51
+ * ```ts
52
+ * grid.gridConfig = {
53
+ * plugins: [new SelectionPlugin({ mode: 'range' })],
54
+ * };
55
+ *
56
+ * grid.addEventListener('selection-change', (e) => {
57
+ * const { mode, ranges } = e.detail;
58
+ * console.log(`Selected ${ranges.length} ranges in ${mode} mode`);
59
+ * });
9
60
  * ```
61
+ *
62
+ * @example Programmatic selection control
63
+ * ```ts
64
+ * const plugin = grid.getPlugin(SelectionPlugin);
65
+ *
66
+ * // Get current selection
67
+ * const selection = plugin.getSelection();
68
+ * console.log(selection.ranges);
69
+ *
70
+ * // Set selection programmatically
71
+ * plugin.setRanges([{ from: { row: 0, col: 0 }, to: { row: 5, col: 3 } }]);
72
+ *
73
+ * // Clear all selection
74
+ * plugin.clearSelection();
75
+ * ```
76
+ *
77
+ * @see {@link SelectionMode} for detailed mode descriptions
78
+ * @see {@link SelectionConfig} for configuration options
79
+ * @see {@link SelectionResult} for the selection result structure
80
+ * @see [Live Demos](?path=/docs/grid-plugins-selection--docs) for interactive examples
10
81
  */
11
82
  export declare class SelectionPlugin extends BaseGridPlugin<SelectionConfig> {
12
83
  #private;
84
+ /** @internal */
13
85
  readonly name = "selection";
86
+ /** @internal */
14
87
  readonly styles: string;
88
+ /** @internal */
15
89
  protected get defaultConfig(): Partial<SelectionConfig>;
16
90
  /** Row selection state (row mode) */
17
91
  private selected;
@@ -26,16 +100,24 @@ export declare class SelectionPlugin extends BaseGridPlugin<SelectionConfig> {
26
100
  private pendingKeyboardUpdate;
27
101
  /** Cell selection state (cell mode) */
28
102
  private selectedCell;
103
+ /** @internal */
29
104
  detach(): void;
105
+ /** @internal */
30
106
  onCellClick(event: CellClickEvent): boolean;
107
+ /** @internal */
31
108
  onKeyDown(event: KeyboardEvent): boolean;
109
+ /** @internal */
32
110
  onCellMouseDown(event: CellMouseEvent): boolean | void;
111
+ /** @internal */
33
112
  onCellMouseMove(event: CellMouseEvent): boolean | void;
113
+ /** @internal */
34
114
  onCellMouseUp(_event: CellMouseEvent): boolean | void;
115
+ /** @internal */
35
116
  afterRender(): void;
36
117
  /**
37
118
  * Called after scroll-triggered row rendering.
38
119
  * Reapplies selection classes to recycled DOM elements.
120
+ * @internal
39
121
  */
40
122
  onScrollRender(): void;
41
123
  /**
@@ -54,24 +136,6 @@ export declare class SelectionPlugin extends BaseGridPlugin<SelectionConfig> {
54
136
  * ```
55
137
  */
56
138
  getSelection(): SelectionResult;
57
- /**
58
- * Get the selected cell (cell mode only).
59
- * @deprecated Use `getSelection()` instead for a unified API across all modes.
60
- */
61
- getSelectedCell(): {
62
- row: number;
63
- col: number;
64
- } | null;
65
- /**
66
- * Get all selected row indices (row mode).
67
- * @deprecated Use `getSelection().ranges` instead - each range represents a full row.
68
- */
69
- getSelectedRows(): number[];
70
- /**
71
- * Get all selected cell ranges in public format.
72
- * @deprecated Use `getSelection().ranges` instead.
73
- */
74
- getRanges(): CellRange[];
75
139
  /**
76
140
  * Get all selected cells across all ranges.
77
141
  */
@@ -1 +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;AAU/F,OAAO,KAAK,EACV,SAAS,EAGT,eAAe,EAEf,eAAe,EAChB,MAAM,SAAS,CAAC;AAyCjB;;;;;;;GAOG;AACH,qBAAa,eAAgB,SAAQ,cAAc,CAAC,eAAe,CAAC;;IAClE,QAAQ,CAAC,IAAI,eAAe;IAC5B,SAAkB,MAAM,SAAU;IAElC,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;IAqF3C,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IA4FxC,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IAyCtD,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IA+BtD,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IAuFrD,WAAW,IAAI,IAAI;IA0C5B;;;OAGG;IACM,cAAc,IAAI,IAAI;IAQ/B;;;;;;;;;;;;;;OAcG;IACH,YAAY,IAAI,eAAe;IAQ/B;;;OAGG;IACH,eAAe,IAAI;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAQtD;;;OAGG;IACH,eAAe,IAAI,MAAM,EAAE;IAQ3B;;;OAGG;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;CAgCrC"}
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;AAU/F,OAAO,KAAK,EACV,SAAS,EAGT,eAAe,EAEf,eAAe,EAChB,MAAM,SAAS,CAAC;AAyCjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8EG;AACH,qBAAa,eAAgB,SAAQ,cAAc,CAAC,eAAe,CAAC;;IAClE,gBAAgB;IAChB,QAAQ,CAAC,IAAI,eAAe;IAC5B,gBAAgB;IAChB,SAAkB,MAAM,SAAU;IAElC,gBAAgB;IAChB,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;IAMjE,gBAAgB;IACP,MAAM,IAAI,IAAI;IAcvB,gBAAgB;IACP,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO;IAqFpD,gBAAgB;IACP,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IA4FjD,gBAAgB;IACP,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IAyC/D,gBAAgB;IACP,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IA+B/D,gBAAgB;IACP,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IAuF9D,gBAAgB;IACP,WAAW,IAAI,IAAI;IA0C5B;;;;OAIG;IACM,cAAc,IAAI,IAAI;IAQ/B;;;;;;;;;;;;;;OAcG;IACH,YAAY,IAAI,eAAe;IAQ/B;;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;CAgCrC"}
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * Selection Plugin Entry Point
3
3
  * Re-exports plugin class and types for tree-shakeable imports.
4
+ *
5
+ * @module Plugins/Selection
4
6
  */
5
- export { computeSelectionDiff, handleRowClick, selectAll } from './row-selection';
6
7
  export { SelectionPlugin } from './SelectionPlugin';
7
8
  export type { CellRange, SelectionChangeDetail, SelectionConfig, SelectionMode, SelectionResult } from './types';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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,oBAAoB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,SAAS,EAAE,qBAAqB,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/selection/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,SAAS,EAAE,qBAAqB,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -1,32 +1,3 @@
1
- function x(r, e, t, s) {
2
- const n = new Set(r.selected);
3
- let o = r.anchor;
4
- if (t === "single")
5
- n.clear(), n.add(e), o = e;
6
- else if (t === "multiple") {
7
- const i = s.ctrlKey || s.metaKey;
8
- if (s.shiftKey && r.anchor !== null) {
9
- const c = Math.min(r.anchor, e), a = Math.max(r.anchor, e);
10
- for (let d = c; d <= a; d++)
11
- n.add(d);
12
- } else i ? (n.has(e) ? n.delete(e) : n.add(e), o = e) : (n.clear(), n.add(e), o = e);
13
- }
14
- return { selected: n, lastSelected: e, anchor: o };
15
- }
16
- function _(r) {
17
- const e = /* @__PURE__ */ new Set();
18
- for (let t = 0; t < r; t++)
19
- e.add(t);
20
- return e;
21
- }
22
- function D(r, e) {
23
- const t = [], s = [];
24
- for (const n of e)
25
- r.has(n) || t.push(n);
26
- for (const n of r)
27
- e.has(n) || s.push(n);
28
- return { added: t, removed: s };
29
- }
30
1
  function b(r) {
31
2
  if (!r) return -1;
32
3
  const e = r.getAttribute("data-row");
@@ -35,9 +6,9 @@ function b(r) {
35
6
  if (!t) return -1;
36
7
  const s = t.parentElement;
37
8
  if (!s) return -1;
38
- const n = s.querySelectorAll(":scope > .data-grid-row");
39
- for (let o = 0; o < n.length; o++)
40
- if (n[o] === t) return o;
9
+ const o = s.querySelectorAll(":scope > .data-grid-row");
10
+ for (let n = 0; n < o.length; n++)
11
+ if (o[n] === t) return n;
41
12
  return -1;
42
13
  }
43
14
  function w(r) {
@@ -53,7 +24,7 @@ const p = {
53
24
  dragHandle: "⋮⋮",
54
25
  toolPanel: "☰"
55
26
  };
56
- class y {
27
+ class A {
57
28
  /**
58
29
  * Plugin dependencies - declare other plugins this one requires.
59
30
  *
@@ -229,23 +200,6 @@ class y {
229
200
  get gridElement() {
230
201
  return this.grid;
231
202
  }
232
- /**
233
- * Get the render root of the grid for DOM queries.
234
- * @deprecated Use `gridElement` instead. This getter exists only for backward compatibility.
235
- *
236
- * With Shadow DOM removed, the grid element itself is the render root.
237
- * All new code should use `this.gridElement` for DOM queries.
238
- *
239
- * @example
240
- * // OLD (deprecated)
241
- * const rows = this.shadowRoot?.querySelector('.rows');
242
- *
243
- * // NEW (preferred)
244
- * const rows = this.gridElement.querySelector('.rows');
245
- */
246
- get shadowRoot() {
247
- return this.gridElement;
248
- }
249
203
  /**
250
204
  * Get the disconnect signal for event listener cleanup.
251
205
  * This signal is aborted when the grid disconnects from the DOM.
@@ -359,7 +313,7 @@ function g(r) {
359
313
  endCol: Math.max(r.startCol, r.endCol)
360
314
  };
361
315
  }
362
- function A(r) {
316
+ function y(r) {
363
317
  const e = g(r);
364
318
  return {
365
319
  from: { row: e.startRow, col: e.startCol },
@@ -367,26 +321,26 @@ function A(r) {
367
321
  };
368
322
  }
369
323
  function R(r) {
370
- return r.map(A);
324
+ return r.map(y);
371
325
  }
372
- function v(r, e, t) {
326
+ function I(r, e, t) {
373
327
  const s = g(t);
374
328
  return r >= s.startRow && r <= s.endRow && e >= s.startCol && e <= s.endCol;
375
329
  }
376
330
  function m(r, e, t) {
377
- return t.some((s) => v(r, e, s));
331
+ return t.some((s) => I(r, e, s));
378
332
  }
379
- function S(r) {
333
+ function v(r) {
380
334
  const e = [], t = g(r);
381
335
  for (let s = t.startRow; s <= t.endRow; s++)
382
- for (let n = t.startCol; n <= t.endCol; n++)
383
- e.push({ row: s, col: n });
336
+ for (let o = t.startCol; o <= t.endCol; o++)
337
+ e.push({ row: s, col: o });
384
338
  return e;
385
339
  }
386
340
  function E(r) {
387
341
  const e = /* @__PURE__ */ new Map();
388
342
  for (const t of r)
389
- for (const s of S(t))
343
+ for (const s of v(t))
390
344
  e.set(`${s.row},${s.col}`, s);
391
345
  return [...e.values()];
392
346
  }
@@ -398,8 +352,8 @@ function u(r, e) {
398
352
  endCol: e.col
399
353
  };
400
354
  }
401
- const I = "@layer tbw-plugins{tbw-grid.selecting .data-grid-row>.cell{-webkit-user-select:none;user-select:none}tbw-grid[data-has-focus] .data-grid-row.row-focus{background-color:var(--tbw-focus-background, rgba(from var(--tbw-color-accent) r g b / 12%))}tbw-grid[data-selection-mode=row] .cell-focus{outline:none}tbw-grid .data-grid-row>.cell.selected{background-color:var(--tbw-range-selection-bg)}tbw-grid .data-grid-row>.cell.selected.top{border-top:2px solid var(--tbw-range-border-color)}tbw-grid .data-grid-row>.cell.selected.bottom{border-bottom:2px solid var(--tbw-range-border-color)}tbw-grid .data-grid-row>.cell.selected.first{border-left:2px solid var(--tbw-range-border-color)}tbw-grid .data-grid-row>.cell.selected.last{border-right:2px solid var(--tbw-range-border-color)}tbw-grid .tbw-selection-summary{font-size:var(--tbw-font-size-sm, .8125rem);color:var(--tbw-color-fg-muted);white-space:nowrap}}";
402
- function K(r, e, t) {
355
+ const x = "@layer tbw-plugins{tbw-grid.selecting .data-grid-row>.cell{-webkit-user-select:none;user-select:none}tbw-grid[data-has-focus] .data-grid-row.row-focus{background-color:var(--tbw-focus-background, rgba(from var(--tbw-color-accent) r g b / 12%))}tbw-grid[data-selection-mode=row] .cell-focus{outline:none}tbw-grid .data-grid-row>.cell.selected{background-color:var(--tbw-range-selection-bg)}tbw-grid .data-grid-row>.cell.selected.top{border-top:2px solid var(--tbw-range-border-color)}tbw-grid .data-grid-row>.cell.selected.bottom{border-bottom:2px solid var(--tbw-range-border-color)}tbw-grid .data-grid-row>.cell.selected.first{border-left:2px solid var(--tbw-range-border-color)}tbw-grid .data-grid-row>.cell.selected.last{border-right:2px solid var(--tbw-range-border-color)}tbw-grid .tbw-selection-summary{font-size:var(--tbw-font-size-sm, .8125rem);color:var(--tbw-color-fg-muted);white-space:nowrap}}";
356
+ function q(r, e, t) {
403
357
  if (r === "cell" && e.selectedCell)
404
358
  return {
405
359
  mode: r,
@@ -411,17 +365,20 @@ function K(r, e, t) {
411
365
  ]
412
366
  };
413
367
  if (r === "row" && e.selected.size > 0) {
414
- const s = [...e.selected].map((n) => ({
415
- from: { row: n, col: 0 },
416
- to: { row: n, col: t - 1 }
368
+ const s = [...e.selected].map((o) => ({
369
+ from: { row: o, col: 0 },
370
+ to: { row: o, col: t - 1 }
417
371
  }));
418
372
  return { mode: r, ranges: s };
419
373
  }
420
374
  return r === "range" && e.ranges.length > 0 ? { mode: r, ranges: R(e.ranges) } : { mode: r, ranges: [] };
421
375
  }
422
- class M extends y {
376
+ class K extends A {
377
+ /** @internal */
423
378
  name = "selection";
424
- styles = I;
379
+ /** @internal */
380
+ styles = x;
381
+ /** @internal */
425
382
  get defaultConfig() {
426
383
  return {
427
384
  mode: "cell"
@@ -443,21 +400,23 @@ class M extends y {
443
400
  selectedCell = null;
444
401
  // #endregion
445
402
  // #region Lifecycle
403
+ /** @internal */
446
404
  detach() {
447
405
  this.selected.clear(), this.ranges = [], this.activeRange = null, this.cellAnchor = null, this.isDragging = !1, this.selectedCell = null, this.pendingKeyboardUpdate = null;
448
406
  }
449
407
  // #endregion
450
408
  // #region Event Handlers
409
+ /** @internal */
451
410
  onCellClick(e) {
452
- const { rowIndex: t, colIndex: s, originalEvent: n } = e, { mode: o } = this.config, i = this.columns[s], c = i && h(i);
453
- if (o === "cell")
411
+ const { rowIndex: t, colIndex: s, originalEvent: o } = e, { mode: n } = this.config, i = this.columns[s], c = i && h(i);
412
+ if (n === "cell")
454
413
  return c || (this.selectedCell = { row: t, col: s }, this.emit("selection-change", this.#e()), this.requestAfterRender()), !1;
455
- if (o === "row")
414
+ if (n === "row")
456
415
  return this.selected.clear(), this.selected.add(t), this.lastSelected = t, this.emit("selection-change", this.#e()), this.requestAfterRender(), !1;
457
- if (o === "range") {
416
+ if (n === "range") {
458
417
  if (c)
459
418
  return !1;
460
- const a = n.shiftKey, d = n.ctrlKey || n.metaKey;
419
+ const a = o.shiftKey, d = o.ctrlKey || o.metaKey;
461
420
  if (a && this.cellAnchor) {
462
421
  const l = u(this.cellAnchor, { row: t, col: s });
463
422
  d ? this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] = l : this.ranges.push(l) : this.ranges = [l], this.activeRange = l;
@@ -482,11 +441,12 @@ class M extends y {
482
441
  }
483
442
  return !1;
484
443
  }
444
+ /** @internal */
485
445
  onKeyDown(e) {
486
- const { mode: t } = this.config, n = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Tab", "Home", "End", "PageUp", "PageDown"].includes(e.key);
446
+ const { mode: t } = this.config, o = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Tab", "Home", "End", "PageUp", "PageDown"].includes(e.key);
487
447
  if (e.key === "Escape")
488
448
  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;
489
- if (t === "cell" && n)
449
+ if (t === "cell" && o)
490
450
  return queueMicrotask(() => {
491
451
  this.selectedCell = { row: this.grid._focusRow, col: this.grid._focusCol }, this.emit("selection-change", this.#e()), this.requestAfterRender();
492
452
  }), !1;
@@ -494,17 +454,17 @@ class M extends y {
494
454
  return queueMicrotask(() => {
495
455
  this.selected.clear(), this.selected.add(this.grid._focusRow), this.lastSelected = this.grid._focusRow, this.emit("selection-change", this.#e()), this.requestAfterRender();
496
456
  }), !1;
497
- if (t === "range" && n) {
498
- const o = e.key === "Tab", i = e.shiftKey && !o;
457
+ if (t === "range" && o) {
458
+ const n = e.key === "Tab", i = e.shiftKey && !n;
499
459
  return i && !this.cellAnchor && (this.cellAnchor = { row: this.grid._focusRow, col: this.grid._focusCol }), this.pendingKeyboardUpdate = { shiftKey: i }, queueMicrotask(() => this.requestAfterRender()), !1;
500
460
  }
501
461
  if (t === "range" && e.key === "a" && (e.ctrlKey || e.metaKey)) {
502
- const o = this.rows.length, i = this.columns.length;
503
- if (o > 0 && i > 0) {
462
+ const n = this.rows.length, i = this.columns.length;
463
+ if (n > 0 && i > 0) {
504
464
  const c = {
505
465
  startRow: 0,
506
466
  startCol: 0,
507
- endRow: o - 1,
467
+ endRow: n - 1,
508
468
  endCol: i - 1
509
469
  };
510
470
  return this.ranges = [c], this.activeRange = c, this.emit("selection-change", this.#e()), this.requestAfterRender(), !0;
@@ -512,33 +472,36 @@ class M extends y {
512
472
  }
513
473
  return !1;
514
474
  }
475
+ /** @internal */
515
476
  onCellMouseDown(e) {
516
477
  if (this.config.mode !== "range" || e.rowIndex === void 0 || e.colIndex === void 0 || e.rowIndex < 0) return;
517
478
  const t = this.columns[e.colIndex];
518
479
  if (t && h(t) || e.originalEvent.shiftKey && this.cellAnchor)
519
480
  return;
520
481
  this.isDragging = !0;
521
- const s = e.rowIndex, n = e.colIndex;
522
- this.cellAnchor = { row: s, col: n }, e.originalEvent.ctrlKey || e.originalEvent.metaKey || (this.ranges = []);
482
+ const s = e.rowIndex, o = e.colIndex;
483
+ this.cellAnchor = { row: s, col: o }, e.originalEvent.ctrlKey || e.originalEvent.metaKey || (this.ranges = []);
523
484
  const i = {
524
485
  startRow: s,
525
- startCol: n,
486
+ startCol: o,
526
487
  endRow: s,
527
- endCol: n
488
+ endCol: o
528
489
  };
529
490
  return this.ranges.push(i), this.activeRange = i, this.emit("selection-change", this.#e()), this.requestAfterRender(), !0;
530
491
  }
492
+ /** @internal */
531
493
  onCellMouseMove(e) {
532
494
  if (this.config.mode !== "range" || !this.isDragging || !this.cellAnchor || e.rowIndex === void 0 || e.colIndex === void 0 || e.rowIndex < 0) return;
533
495
  let t = e.colIndex;
534
496
  const s = this.columns[t];
535
497
  if (s && h(s)) {
536
- const o = this.columns.findIndex((i) => !h(i));
537
- o >= 0 && (t = o);
498
+ const n = this.columns.findIndex((i) => !h(i));
499
+ n >= 0 && (t = n);
538
500
  }
539
- const n = u(this.cellAnchor, { row: e.rowIndex, col: t });
540
- return this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] = n : this.ranges.push(n), this.activeRange = n, this.emit("selection-change", this.#e()), this.requestAfterRender(), !0;
501
+ const o = u(this.cellAnchor, { row: e.rowIndex, col: t });
502
+ return this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] = o : this.ranges.push(o), this.activeRange = o, this.emit("selection-change", this.#e()), this.requestAfterRender(), !0;
541
503
  }
504
+ /** @internal */
542
505
  onCellMouseUp(e) {
543
506
  if (this.config.mode === "range" && this.isDragging)
544
507
  return this.isDragging = !1, !0;
@@ -551,45 +514,46 @@ class M extends y {
551
514
  const e = this.gridElement;
552
515
  if (!e) return;
553
516
  const { mode: t } = this.config;
554
- e.querySelectorAll(".cell").forEach((o) => {
555
- o.classList.remove("selected", "top", "bottom", "first", "last");
517
+ e.querySelectorAll(".cell").forEach((n) => {
518
+ n.classList.remove("selected", "top", "bottom", "first", "last");
556
519
  });
557
- const n = e.querySelectorAll(".data-grid-row");
558
- if (n.forEach((o) => {
559
- o.classList.remove("selected", "row-focus");
560
- }), t === "row" && (w(e), n.forEach((o) => {
561
- const i = o.querySelector(".cell[data-row]"), c = b(i);
562
- c >= 0 && this.selected.has(c) && o.classList.add("selected", "row-focus");
520
+ const o = e.querySelectorAll(".data-grid-row");
521
+ if (o.forEach((n) => {
522
+ n.classList.remove("selected", "row-focus");
523
+ }), t === "row" && (w(e), o.forEach((n) => {
524
+ const i = n.querySelector(".cell[data-row]"), c = b(i);
525
+ c >= 0 && this.selected.has(c) && n.classList.add("selected", "row-focus");
563
526
  })), t === "range" && this.ranges.length > 0) {
564
527
  w(e);
565
- const o = this.activeRange ? g(this.activeRange) : null, i = this.columns.findIndex((a) => !h(a));
528
+ const n = this.activeRange ? g(this.activeRange) : null, i = this.columns.findIndex((a) => !h(a));
566
529
  this.columns.length - 1, e.querySelectorAll(".cell[data-row][data-col]").forEach((a) => {
567
530
  const d = parseInt(a.getAttribute("data-row") ?? "-1", 10), l = parseInt(a.getAttribute("data-col") ?? "-1", 10);
568
531
  if (d >= 0 && l >= 0) {
569
532
  const f = this.columns[l];
570
533
  if (f && h(f))
571
534
  return;
572
- if (m(d, l, this.ranges) && (a.classList.add("selected"), o)) {
573
- d === o.startRow && a.classList.add("top"), d === o.endRow && a.classList.add("bottom");
574
- const C = Math.max(o.startCol, i);
575
- l === C && a.classList.add("first"), l === o.endCol && a.classList.add("last");
535
+ if (m(d, l, this.ranges) && (a.classList.add("selected"), n)) {
536
+ d === n.startRow && a.classList.add("top"), d === n.endRow && a.classList.add("bottom");
537
+ const C = Math.max(n.startCol, i);
538
+ l === C && a.classList.add("first"), l === n.endCol && a.classList.add("last");
576
539
  }
577
540
  }
578
541
  });
579
542
  }
580
543
  }
544
+ /** @internal */
581
545
  afterRender() {
582
546
  const e = this.gridElement;
583
547
  if (!e) return;
584
548
  const t = e.children[0], { mode: s } = this.config;
585
549
  if (this.pendingKeyboardUpdate && s === "range") {
586
- const { shiftKey: n } = this.pendingKeyboardUpdate;
550
+ const { shiftKey: o } = this.pendingKeyboardUpdate;
587
551
  this.pendingKeyboardUpdate = null;
588
- const o = this.grid._focusRow, i = this.grid._focusCol;
589
- if (n && this.cellAnchor) {
590
- const c = u(this.cellAnchor, { row: o, col: i });
552
+ const n = this.grid._focusRow, i = this.grid._focusCol;
553
+ if (o && this.cellAnchor) {
554
+ const c = u(this.cellAnchor, { row: n, col: i });
591
555
  this.ranges = [c], this.activeRange = c;
592
- } else n || (this.ranges = [], this.activeRange = null, this.cellAnchor = { row: o, col: i });
556
+ } else o || (this.ranges = [], this.activeRange = null, this.cellAnchor = { row: n, col: i });
593
557
  this.emit("selection-change", this.#e());
594
558
  }
595
559
  this.grid.setAttribute("data-selection-mode", s), t && t.classList.toggle("selecting", this.isDragging), this.#t();
@@ -597,6 +561,7 @@ class M extends y {
597
561
  /**
598
562
  * Called after scroll-triggered row rendering.
599
563
  * Reapplies selection classes to recycled DOM elements.
564
+ * @internal
600
565
  */
601
566
  onScrollRender() {
602
567
  this.#t();
@@ -625,29 +590,6 @@ class M extends y {
625
590
  anchor: this.cellAnchor
626
591
  };
627
592
  }
628
- /**
629
- * Get the selected cell (cell mode only).
630
- * @deprecated Use `getSelection()` instead for a unified API across all modes.
631
- */
632
- getSelectedCell() {
633
- const { mode: e, ranges: t } = this.getSelection();
634
- return e === "cell" && t.length > 0 ? t[0].from : null;
635
- }
636
- /**
637
- * Get all selected row indices (row mode).
638
- * @deprecated Use `getSelection().ranges` instead - each range represents a full row.
639
- */
640
- getSelectedRows() {
641
- const { mode: e, ranges: t } = this.getSelection();
642
- return e === "row" ? t.map((s) => s.from.row) : [];
643
- }
644
- /**
645
- * Get all selected cell ranges in public format.
646
- * @deprecated Use `getSelection().ranges` instead.
647
- */
648
- getRanges() {
649
- return this.getSelection().ranges;
650
- }
651
593
  /**
652
594
  * Get all selected cells across all ranges.
653
595
  */
@@ -683,7 +625,7 @@ class M extends y {
683
625
  // #endregion
684
626
  // #region Private Helpers
685
627
  #e() {
686
- return K(
628
+ return q(
687
629
  this.config.mode,
688
630
  {
689
631
  selectedCell: this.selectedCell,
@@ -696,9 +638,6 @@ class M extends y {
696
638
  // #endregion
697
639
  }
698
640
  export {
699
- M as SelectionPlugin,
700
- D as computeSelectionDiff,
701
- x as handleRowClick,
702
- _ as selectAll
641
+ K as SelectionPlugin
703
642
  };
704
643
  //# sourceMappingURL=index.js.map