@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.
Files changed (273) hide show
  1. package/README.md +13 -13
  2. package/all.d.ts +25 -5659
  3. package/all.d.ts.map +1 -0
  4. package/all.js +524 -450
  5. package/all.js.map +1 -1
  6. package/index.d.ts +8 -2678
  7. package/index.d.ts.map +1 -0
  8. package/index.js +3929 -25
  9. package/index.js.map +1 -1
  10. package/lib/core/constants.d.ts +114 -0
  11. package/lib/core/constants.d.ts.map +1 -0
  12. package/lib/core/grid.d.ts +337 -0
  13. package/lib/core/grid.d.ts.map +1 -0
  14. package/lib/core/internal/aggregators.d.ts +67 -0
  15. package/lib/core/internal/aggregators.d.ts.map +1 -0
  16. package/lib/core/internal/column-state.d.ts +124 -0
  17. package/lib/core/internal/column-state.d.ts.map +1 -0
  18. package/lib/core/internal/columns.d.ts +107 -0
  19. package/lib/core/internal/columns.d.ts.map +1 -0
  20. package/lib/core/internal/dom-builder.d.ts +115 -0
  21. package/lib/core/internal/dom-builder.d.ts.map +1 -0
  22. package/lib/core/internal/editing.d.ts +76 -0
  23. package/lib/core/internal/editing.d.ts.map +1 -0
  24. package/lib/core/internal/editors.d.ts +8 -0
  25. package/lib/core/internal/editors.d.ts.map +1 -0
  26. package/lib/core/internal/event-delegation.d.ts +11 -0
  27. package/lib/core/internal/event-delegation.d.ts.map +1 -0
  28. package/lib/core/internal/grid-internals.d.ts +83 -0
  29. package/lib/core/internal/grid-internals.d.ts.map +1 -0
  30. package/lib/core/internal/header.d.ts +7 -0
  31. package/lib/core/internal/header.d.ts.map +1 -0
  32. package/lib/core/internal/idle-scheduler.d.ts +65 -0
  33. package/lib/core/internal/idle-scheduler.d.ts.map +1 -0
  34. package/lib/core/internal/inference.d.ts +12 -0
  35. package/lib/core/internal/inference.d.ts.map +1 -0
  36. package/lib/core/internal/keyboard.d.ts +18 -0
  37. package/lib/core/internal/keyboard.d.ts.map +1 -0
  38. package/lib/core/internal/resize.d.ts +3 -0
  39. package/lib/core/internal/resize.d.ts.map +1 -0
  40. package/lib/core/internal/rows.d.ts +35 -0
  41. package/lib/core/internal/rows.d.ts.map +1 -0
  42. package/lib/core/internal/sanitize.d.ts +13 -0
  43. package/lib/core/internal/sanitize.d.ts.map +1 -0
  44. package/lib/core/internal/shell.d.ts +228 -0
  45. package/lib/core/internal/shell.d.ts.map +1 -0
  46. package/lib/core/internal/sorting.d.ts +24 -0
  47. package/lib/core/internal/sorting.d.ts.map +1 -0
  48. package/lib/core/internal/touch-scroll.d.ts +54 -0
  49. package/lib/core/internal/touch-scroll.d.ts.map +1 -0
  50. package/lib/core/internal/utils.d.ts +38 -0
  51. package/lib/core/internal/utils.d.ts.map +1 -0
  52. package/lib/core/internal/virtualization.d.ts +66 -0
  53. package/lib/core/internal/virtualization.d.ts.map +1 -0
  54. package/lib/core/plugin/base-plugin.d.ts +616 -0
  55. package/lib/core/plugin/base-plugin.d.ts.map +1 -0
  56. package/lib/core/plugin/index.d.ts +11 -0
  57. package/lib/core/plugin/index.d.ts.map +1 -0
  58. package/lib/core/plugin/plugin-manager.d.ts +183 -0
  59. package/lib/core/plugin/plugin-manager.d.ts.map +1 -0
  60. package/lib/core/plugin/types.d.ts +196 -0
  61. package/lib/core/plugin/types.d.ts.map +1 -0
  62. package/lib/core/types.d.ts +841 -0
  63. package/lib/core/types.d.ts.map +1 -0
  64. package/lib/plugins/clipboard/ClipboardPlugin.d.ts +46 -0
  65. package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -0
  66. package/lib/plugins/clipboard/copy.d.ts +47 -0
  67. package/lib/plugins/clipboard/copy.d.ts.map +1 -0
  68. package/lib/plugins/clipboard/index.d.ts +7 -0
  69. package/lib/plugins/clipboard/index.d.ts.map +1 -0
  70. package/lib/plugins/clipboard/index.js.map +1 -1
  71. package/lib/plugins/clipboard/paste.d.ts +25 -0
  72. package/lib/plugins/clipboard/paste.d.ts.map +1 -0
  73. package/lib/plugins/clipboard/types.d.ts +40 -0
  74. package/lib/plugins/clipboard/types.d.ts.map +1 -0
  75. package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts +54 -0
  76. package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts.map +1 -0
  77. package/lib/plugins/column-virtualization/column-virtualization.d.ts +53 -0
  78. package/lib/plugins/column-virtualization/column-virtualization.d.ts.map +1 -0
  79. package/lib/plugins/column-virtualization/index.d.ts +7 -0
  80. package/lib/plugins/column-virtualization/index.d.ts.map +1 -0
  81. package/lib/plugins/column-virtualization/index.js.map +1 -1
  82. package/lib/plugins/column-virtualization/types.d.ts +41 -0
  83. package/lib/plugins/column-virtualization/types.d.ts.map +1 -0
  84. package/lib/plugins/context-menu/ContextMenuPlugin.d.ts +52 -0
  85. package/lib/plugins/context-menu/ContextMenuPlugin.d.ts.map +1 -0
  86. package/lib/plugins/context-menu/index.d.ts +7 -0
  87. package/lib/plugins/context-menu/index.d.ts.map +1 -0
  88. package/lib/plugins/context-menu/index.js +24 -24
  89. package/lib/plugins/context-menu/index.js.map +1 -1
  90. package/lib/plugins/context-menu/menu.d.ts +38 -0
  91. package/lib/plugins/context-menu/menu.d.ts.map +1 -0
  92. package/lib/plugins/context-menu/types.d.ts +77 -0
  93. package/lib/plugins/context-menu/types.d.ts.map +1 -0
  94. package/lib/plugins/export/ExportPlugin.d.ts +53 -0
  95. package/lib/plugins/export/ExportPlugin.d.ts.map +1 -0
  96. package/lib/plugins/export/csv.d.ts +31 -0
  97. package/lib/plugins/export/csv.d.ts.map +1 -0
  98. package/lib/plugins/export/excel.d.ts +12 -0
  99. package/lib/plugins/export/excel.d.ts.map +1 -0
  100. package/lib/plugins/export/index.d.ts +7 -0
  101. package/lib/plugins/export/index.d.ts.map +1 -0
  102. package/lib/plugins/export/index.js.map +1 -1
  103. package/lib/plugins/export/types.d.ts +57 -0
  104. package/lib/plugins/export/types.d.ts.map +1 -0
  105. package/lib/plugins/filtering/FilteringPlugin.d.ts +128 -0
  106. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -0
  107. package/lib/plugins/filtering/filter-model.d.ts +38 -0
  108. package/lib/plugins/filtering/filter-model.d.ts.map +1 -0
  109. package/lib/plugins/filtering/index.d.ts +7 -0
  110. package/lib/plugins/filtering/index.d.ts.map +1 -0
  111. package/lib/plugins/filtering/index.js +5 -5
  112. package/lib/plugins/filtering/index.js.map +1 -1
  113. package/lib/plugins/filtering/types.d.ts +157 -0
  114. package/lib/plugins/filtering/types.d.ts.map +1 -0
  115. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +51 -0
  116. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -0
  117. package/lib/plugins/grouping-columns/grouping-columns.d.ts +41 -0
  118. package/lib/plugins/grouping-columns/grouping-columns.d.ts.map +1 -0
  119. package/lib/plugins/grouping-columns/index.d.ts +7 -0
  120. package/lib/plugins/grouping-columns/index.d.ts.map +1 -0
  121. package/lib/plugins/grouping-columns/index.js +58 -42
  122. package/lib/plugins/grouping-columns/index.js.map +1 -1
  123. package/lib/plugins/grouping-columns/types.d.ts +91 -0
  124. package/lib/plugins/grouping-columns/types.d.ts.map +1 -0
  125. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +120 -0
  126. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -0
  127. package/lib/plugins/grouping-rows/grouping-rows.d.ts +51 -0
  128. package/lib/plugins/grouping-rows/grouping-rows.d.ts.map +1 -0
  129. package/lib/plugins/grouping-rows/index.d.ts +7 -0
  130. package/lib/plugins/grouping-rows/index.d.ts.map +1 -0
  131. package/lib/plugins/grouping-rows/index.js +51 -51
  132. package/lib/plugins/grouping-rows/index.js.map +1 -1
  133. package/lib/plugins/grouping-rows/types.d.ts +95 -0
  134. package/lib/plugins/grouping-rows/types.d.ts.map +1 -0
  135. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +147 -0
  136. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -0
  137. package/lib/plugins/master-detail/index.d.ts +7 -0
  138. package/lib/plugins/master-detail/index.d.ts.map +1 -0
  139. package/lib/plugins/master-detail/index.js +235 -78
  140. package/lib/plugins/master-detail/index.js.map +1 -1
  141. package/lib/plugins/master-detail/master-detail.d.ts +30 -0
  142. package/lib/plugins/master-detail/master-detail.d.ts.map +1 -0
  143. package/lib/plugins/master-detail/types.d.ts +40 -0
  144. package/lib/plugins/master-detail/types.d.ts.map +1 -0
  145. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts +58 -0
  146. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -0
  147. package/lib/plugins/multi-sort/index.d.ts +7 -0
  148. package/lib/plugins/multi-sort/index.d.ts.map +1 -0
  149. package/lib/plugins/multi-sort/index.js.map +1 -1
  150. package/lib/plugins/multi-sort/multi-sort.d.ts +51 -0
  151. package/lib/plugins/multi-sort/multi-sort.d.ts.map +1 -0
  152. package/lib/plugins/multi-sort/types.d.ts +25 -0
  153. package/lib/plugins/multi-sort/types.d.ts.map +1 -0
  154. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +58 -0
  155. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -0
  156. package/lib/plugins/pinned-columns/index.d.ts +7 -0
  157. package/lib/plugins/pinned-columns/index.d.ts.map +1 -0
  158. package/lib/plugins/pinned-columns/index.js.map +1 -1
  159. package/lib/plugins/pinned-columns/pinned-columns.d.ts +62 -0
  160. package/lib/plugins/pinned-columns/pinned-columns.d.ts.map +1 -0
  161. package/lib/plugins/pinned-columns/types.d.ts +20 -0
  162. package/lib/plugins/pinned-columns/types.d.ts.map +1 -0
  163. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts +64 -0
  164. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -0
  165. package/lib/plugins/pinned-rows/index.d.ts +7 -0
  166. package/lib/plugins/pinned-rows/index.d.ts.map +1 -0
  167. package/lib/plugins/pinned-rows/index.js +1 -1
  168. package/lib/plugins/pinned-rows/index.js.map +1 -1
  169. package/lib/plugins/pinned-rows/pinned-rows.d.ts +43 -0
  170. package/lib/plugins/pinned-rows/pinned-rows.d.ts.map +1 -0
  171. package/lib/plugins/pinned-rows/types.d.ts +95 -0
  172. package/lib/plugins/pinned-rows/types.d.ts.map +1 -0
  173. package/lib/plugins/pivot/PivotPlugin.d.ts +94 -0
  174. package/lib/plugins/pivot/PivotPlugin.d.ts.map +1 -0
  175. package/lib/plugins/pivot/index.d.ts +7 -0
  176. package/lib/plugins/pivot/index.d.ts.map +1 -0
  177. package/lib/plugins/pivot/index.js.map +1 -1
  178. package/lib/plugins/pivot/pivot-engine.d.ts +50 -0
  179. package/lib/plugins/pivot/pivot-engine.d.ts.map +1 -0
  180. package/lib/plugins/pivot/pivot-model.d.ts +6 -0
  181. package/lib/plugins/pivot/pivot-model.d.ts.map +1 -0
  182. package/lib/plugins/pivot/pivot-panel.d.ts +25 -0
  183. package/lib/plugins/pivot/pivot-panel.d.ts.map +1 -0
  184. package/lib/plugins/pivot/pivot-rows.d.ts +33 -0
  185. package/lib/plugins/pivot/pivot-rows.d.ts.map +1 -0
  186. package/lib/plugins/pivot/types.d.ts +62 -0
  187. package/lib/plugins/pivot/types.d.ts.map +1 -0
  188. package/lib/plugins/reorder/ReorderPlugin.d.ts +81 -0
  189. package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -0
  190. package/lib/plugins/reorder/column-drag.d.ts +41 -0
  191. package/lib/plugins/reorder/column-drag.d.ts.map +1 -0
  192. package/lib/plugins/reorder/index.d.ts +7 -0
  193. package/lib/plugins/reorder/index.d.ts.map +1 -0
  194. package/lib/plugins/reorder/index.js +51 -48
  195. package/lib/plugins/reorder/index.js.map +1 -1
  196. package/lib/plugins/reorder/types.d.ts +54 -0
  197. package/lib/plugins/reorder/types.d.ts.map +1 -0
  198. package/lib/plugins/selection/SelectionPlugin.d.ts +77 -0
  199. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -0
  200. package/lib/plugins/selection/index.d.ts +8 -0
  201. package/lib/plugins/selection/index.d.ts.map +1 -0
  202. package/lib/plugins/selection/index.js +86 -75
  203. package/lib/plugins/selection/index.js.map +1 -1
  204. package/lib/plugins/selection/range-selection.d.ts +109 -0
  205. package/lib/plugins/selection/range-selection.d.ts.map +1 -0
  206. package/lib/plugins/selection/row-selection.d.ts +48 -0
  207. package/lib/plugins/selection/row-selection.d.ts.map +1 -0
  208. package/lib/plugins/selection/types.d.ts +80 -0
  209. package/lib/plugins/selection/types.d.ts.map +1 -0
  210. package/lib/plugins/server-side/ServerSidePlugin.d.ts +56 -0
  211. package/lib/plugins/server-side/ServerSidePlugin.d.ts.map +1 -0
  212. package/lib/plugins/server-side/cache.d.ts +14 -0
  213. package/lib/plugins/server-side/cache.d.ts.map +1 -0
  214. package/lib/plugins/server-side/datasource.d.ts +12 -0
  215. package/lib/plugins/server-side/datasource.d.ts.map +1 -0
  216. package/lib/plugins/server-side/index.d.ts +7 -0
  217. package/lib/plugins/server-side/index.d.ts.map +1 -0
  218. package/lib/plugins/server-side/index.js.map +1 -1
  219. package/lib/plugins/server-side/types.d.ts +43 -0
  220. package/lib/plugins/server-side/types.d.ts.map +1 -0
  221. package/lib/plugins/tree/TreePlugin.d.ts +49 -0
  222. package/lib/plugins/tree/TreePlugin.d.ts.map +1 -0
  223. package/lib/plugins/tree/index.d.ts +8 -0
  224. package/lib/plugins/tree/index.d.ts.map +1 -0
  225. package/lib/plugins/tree/index.js.map +1 -1
  226. package/lib/plugins/tree/tree-data.d.ts +42 -0
  227. package/lib/plugins/tree/tree-data.d.ts.map +1 -0
  228. package/lib/plugins/tree/tree-detect.d.ts +24 -0
  229. package/lib/plugins/tree/tree-detect.d.ts.map +1 -0
  230. package/lib/plugins/tree/types.d.ts +61 -0
  231. package/lib/plugins/tree/types.d.ts.map +1 -0
  232. package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts +68 -0
  233. package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts.map +1 -0
  234. package/lib/plugins/undo-redo/history.d.ts +64 -0
  235. package/lib/plugins/undo-redo/history.d.ts.map +1 -0
  236. package/lib/plugins/undo-redo/index.d.ts +7 -0
  237. package/lib/plugins/undo-redo/index.d.ts.map +1 -0
  238. package/lib/plugins/undo-redo/index.js.map +1 -1
  239. package/lib/plugins/undo-redo/types.d.ts +41 -0
  240. package/lib/plugins/undo-redo/types.d.ts.map +1 -0
  241. package/lib/plugins/visibility/VisibilityPlugin.d.ts +135 -0
  242. package/lib/plugins/visibility/VisibilityPlugin.d.ts.map +1 -0
  243. package/lib/plugins/visibility/index.d.ts +8 -0
  244. package/lib/plugins/visibility/index.d.ts.map +1 -0
  245. package/lib/plugins/visibility/index.js.map +1 -1
  246. package/lib/plugins/visibility/types.d.ts +33 -0
  247. package/lib/plugins/visibility/types.d.ts.map +1 -0
  248. package/lib/plugins/visibility/visibility.d.ts +30 -0
  249. package/lib/plugins/visibility/visibility.d.ts.map +1 -0
  250. package/package.json +6 -2
  251. package/public.d.ts +52 -0
  252. package/public.d.ts.map +1 -0
  253. package/umd/grid.all.umd.js +32 -74
  254. package/umd/grid.all.umd.js.map +1 -1
  255. package/umd/grid.umd.js +22 -64
  256. package/umd/grid.umd.js.map +1 -1
  257. package/umd/plugins/context-menu.umd.js +1 -1
  258. package/umd/plugins/context-menu.umd.js.map +1 -1
  259. package/umd/plugins/filtering.umd.js +1 -1
  260. package/umd/plugins/filtering.umd.js.map +1 -1
  261. package/umd/plugins/grouping-columns.umd.js +1 -1
  262. package/umd/plugins/grouping-columns.umd.js.map +1 -1
  263. package/umd/plugins/grouping-rows.umd.js +1 -1
  264. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  265. package/umd/plugins/master-detail.umd.js +1 -1
  266. package/umd/plugins/master-detail.umd.js.map +1 -1
  267. package/umd/plugins/pinned-rows.umd.js +1 -1
  268. package/umd/plugins/pinned-rows.umd.js.map +1 -1
  269. package/umd/plugins/pivot.umd.js.map +1 -1
  270. package/umd/plugins/selection.umd.js +1 -1
  271. package/umd/plugins/selection.umd.js.map +1 -1
  272. package/index-DG2CZ_Zo.js +0 -3229
  273. 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
- const f = {
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 w {
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 { ...f, ...e };
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 R(s) {
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 g(s) {
183
- return s.map(R);
190
+ function u(s) {
191
+ return s.map(m);
184
192
  }
185
- function C(s, e, t) {
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 u(s, e, t) {
190
- return t.some((r) => C(s, e, r));
197
+ function f(s, e, t) {
198
+ return t.some((r) => p(s, e, r));
191
199
  }
192
- function m(s) {
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 o = t.startCol; o <= t.endCol; o++)
196
- e.push({ row: r, col: o });
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 m(t))
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 d(s, e) {
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 p = ':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)}';
215
- function b(s, e, t) {
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((o) => ({
228
- from: { row: o, col: 0 },
229
- to: { row: o, col: t - 1 }
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: g(e.ranges) } : { mode: s, ranges: [] };
241
+ return s === "range" && e.ranges.length > 0 ? { mode: s, ranges: u(e.ranges) } : { mode: s, ranges: [] };
234
242
  }
235
- class v extends w {
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: o } = e, { mode: n } = this.config;
266
- if (n === "cell")
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 (n === "row")
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 (n === "range") {
271
- const c = o.shiftKey, l = o.ctrlKey || o.metaKey;
278
+ if (o === "range") {
279
+ const c = n.shiftKey, l = n.ctrlKey || n.metaKey;
272
280
  if (c && this.cellAnchor) {
273
- const i = d(this.cellAnchor, { row: t, col: r });
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, o = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Tab", "Home", "End", "PageUp", "PageDown"].includes(e.key);
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" && o)
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" && o)
309
- return e.shiftKey && !this.cellAnchor && (this.cellAnchor = { row: this.grid._focusRow, col: this.grid._focusCol }), this.pendingKeyboardUpdate = { shiftKey: e.shiftKey }, queueMicrotask(() => this.requestAfterRender()), !1;
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 n = this.rows.length, c = this.columns.length;
312
- if (n > 0 && c > 0) {
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: n - 1,
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 n = {
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(n), this.activeRange = n, this.emit("selection-change", this.#e()), this.requestAfterRender(), !0;
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 = d(this.cellAnchor, { row: e.rowIndex, col: e.colIndex });
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((n) => {
356
- n.classList.remove("selected", "top", "bottom", "first", "last");
365
+ e.querySelectorAll(".cell").forEach((o) => {
366
+ o.classList.remove("selected", "top", "bottom", "first", "last");
357
367
  });
358
- const o = e.querySelectorAll(".data-grid-row");
359
- if (o.forEach((n) => {
360
- n.classList.remove("selected", "row-focus");
361
- }), t === "row" && (e.querySelectorAll(".cell-focus").forEach((n) => n.classList.remove("cell-focus")), o.forEach((n) => {
362
- const c = n.querySelector(".cell[data-row]"), l = parseInt(c?.getAttribute("data-row") ?? "-1", 10);
363
- l >= 0 && this.selected.has(l) && n.classList.add("selected", "row-focus");
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
- const n = this.activeRange ? h(this.activeRange) : null;
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 && u(i, a, this.ranges) && (l.classList.add("selected"), l.classList.remove("cell-focus"), n && (i === n.startRow && l.classList.add("top"), i === n.endRow && l.classList.add("bottom"), a === n.startCol && l.classList.add("first"), a === n.endCol && l.classList.add("last")));
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.querySelectorAll(".cell-focus").forEach((n) => n.classList.remove("cell-focus"));
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: o } = this.pendingKeyboardUpdate;
389
+ const { shiftKey: n } = this.pendingKeyboardUpdate;
379
390
  this.pendingKeyboardUpdate = null;
380
- const n = this.grid._focusRow, c = this.grid._focusCol;
381
- if (o && this.cellAnchor) {
382
- const l = d(this.cellAnchor, { row: n, col: c });
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 o || (this.ranges = [], this.activeRange = null, this.cellAnchor = { row: n, col: c });
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 g(this.ranges);
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 u(e, t, this.ranges);
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: g(this.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 b(
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 = p;
474
+ styles = y;
464
475
  // #endregion
465
476
  }
466
- function K(s, e, t, r) {
467
- const o = new Set(s.selected);
468
- let n = s.anchor;
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
- o.clear(), o.add(e), n = e;
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
- o.add(a);
477
- } else c ? (o.has(e) ? o.delete(e) : o.add(e), n = e) : (o.clear(), o.add(e), n = e);
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: o, lastSelected: e, anchor: n };
490
+ return { selected: n, lastSelected: e, anchor: o };
480
491
  }
481
- function q(s) {
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 S(s, e) {
498
+ function I(s, e) {
488
499
  const t = [], r = [];
489
- for (const o of e)
490
- s.has(o) || t.push(o);
491
- for (const o of s)
492
- e.has(o) || r.push(o);
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
- v as SelectionPlugin,
497
- S as computeSelectionDiff,
498
- K as handleRowClick,
499
- q as selectAll
507
+ q as SelectionPlugin,
508
+ I as computeSelectionDiff,
509
+ S as handleRowClick,
510
+ x as selectAll
500
511
  };
501
512
  //# sourceMappingURL=index.js.map