@toolbox-web/grid 0.2.8 → 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-YjW60MHD.js +0 -3235
  273. package/index-YjW60MHD.js.map +0 -1
@@ -0,0 +1,109 @@
1
+ import { InternalCellRange, CellRange } from './types';
2
+ /**
3
+ * Normalize a range so startRow/startCol are always <= endRow/endCol.
4
+ * This handles cases where user drags from bottom-right to top-left.
5
+ *
6
+ * @param range - The range to normalize
7
+ * @returns Normalized range with start <= end for both dimensions
8
+ */
9
+ export declare function normalizeRange(range: InternalCellRange): InternalCellRange;
10
+ /**
11
+ * Convert an internal range to the public event format.
12
+ *
13
+ * @param range - The internal range to convert
14
+ * @returns Public CellRange format with from/to coordinates
15
+ */
16
+ export declare function toPublicRange(range: InternalCellRange): CellRange;
17
+ /**
18
+ * Convert multiple internal ranges to public format.
19
+ *
20
+ * @param ranges - Array of internal ranges
21
+ * @returns Array of public CellRange format
22
+ */
23
+ export declare function toPublicRanges(ranges: InternalCellRange[]): CellRange[];
24
+ /**
25
+ * Check if a cell is within a specific range.
26
+ *
27
+ * @param row - The row index to check
28
+ * @param col - The column index to check
29
+ * @param range - The range to check against
30
+ * @returns True if the cell is within the range
31
+ */
32
+ export declare function isCellInRange(row: number, col: number, range: InternalCellRange): boolean;
33
+ /**
34
+ * Check if a cell is within any of the provided ranges.
35
+ *
36
+ * @param row - The row index to check
37
+ * @param col - The column index to check
38
+ * @param ranges - Array of ranges to check against
39
+ * @returns True if the cell is within any range
40
+ */
41
+ export declare function isCellInAnyRange(row: number, col: number, ranges: InternalCellRange[]): boolean;
42
+ /**
43
+ * Get all cells within a range as an array of {row, col} objects.
44
+ *
45
+ * @param range - The range to enumerate
46
+ * @returns Array of all cell coordinates in the range
47
+ */
48
+ export declare function getCellsInRange(range: InternalCellRange): Array<{
49
+ row: number;
50
+ col: number;
51
+ }>;
52
+ /**
53
+ * Get all unique cells across multiple ranges.
54
+ * Deduplicates cells that appear in overlapping ranges.
55
+ *
56
+ * @param ranges - Array of ranges to enumerate
57
+ * @returns Array of unique cell coordinates
58
+ */
59
+ export declare function getAllCellsInRanges(ranges: InternalCellRange[]): Array<{
60
+ row: number;
61
+ col: number;
62
+ }>;
63
+ /**
64
+ * Merge overlapping or adjacent ranges into fewer ranges.
65
+ * Simple implementation - returns ranges as-is for now.
66
+ * More complex merging logic can be added later for optimization.
67
+ *
68
+ * @param ranges - Array of ranges to merge
69
+ * @returns Merged array of ranges
70
+ */
71
+ export declare function mergeRanges(ranges: InternalCellRange[]): InternalCellRange[];
72
+ /**
73
+ * Create a range from an anchor cell to a current cell position.
74
+ * The range is not normalized - it preserves the direction of selection.
75
+ *
76
+ * @param anchor - The anchor cell (where selection started)
77
+ * @param current - The current cell (where selection ends)
78
+ * @returns An InternalCellRange from anchor to current
79
+ */
80
+ export declare function createRangeFromAnchor(anchor: {
81
+ row: number;
82
+ col: number;
83
+ }, current: {
84
+ row: number;
85
+ col: number;
86
+ }): InternalCellRange;
87
+ /**
88
+ * Calculate the number of cells in a range.
89
+ *
90
+ * @param range - The range to measure
91
+ * @returns Total number of cells in the range
92
+ */
93
+ export declare function getRangeCellCount(range: InternalCellRange): number;
94
+ /**
95
+ * Check if two ranges are equal (same boundaries).
96
+ *
97
+ * @param a - First range
98
+ * @param b - Second range
99
+ * @returns True if ranges have same boundaries after normalization
100
+ */
101
+ export declare function rangesEqual(a: InternalCellRange, b: InternalCellRange): boolean;
102
+ /**
103
+ * Check if a range is a single cell (1x1).
104
+ *
105
+ * @param range - The range to check
106
+ * @returns True if the range is exactly one cell
107
+ */
108
+ export declare function isSingleCell(range: InternalCellRange): boolean;
109
+ //# sourceMappingURL=range-selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range-selection.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/selection/range-selection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE5D;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,iBAAiB,CAO1E;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAMjE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB,EAAE,GAAG,SAAS,EAAE,CAEvE;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAKzF;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAE/F;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAW7F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAUpG;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,iBAAiB,EAAE,GAAG,iBAAiB,EAAE,CAG5E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACpC,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACpC,iBAAiB,CAOnB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAKlE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAS/E;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAG9D"}
@@ -0,0 +1,48 @@
1
+ import { SelectionMode, SelectionState } from './types';
2
+ /** Click modifier keys state */
3
+ export interface ClickModifiers {
4
+ shiftKey: boolean;
5
+ ctrlKey: boolean;
6
+ metaKey: boolean;
7
+ }
8
+ /** Result from handling a row click for selection */
9
+ export interface RowClickResult {
10
+ selected: Set<number>;
11
+ lastSelected: number;
12
+ anchor: number | null;
13
+ }
14
+ /**
15
+ * Handle a row click event for selection purposes.
16
+ *
17
+ * In single mode: always selects the clicked row, clearing others.
18
+ * In multiple mode:
19
+ * - Plain click: clears selection and selects clicked row
20
+ * - Ctrl/Cmd+click: toggles the clicked row
21
+ * - Shift+click: range select from anchor to clicked row
22
+ *
23
+ * @param state - Current selection state
24
+ * @param rowIndex - The clicked row index
25
+ * @param mode - Selection mode ('single' or 'multiple')
26
+ * @param modifiers - Keyboard modifiers held during click
27
+ * @returns Updated selection state values
28
+ */
29
+ export declare function handleRowClick(state: SelectionState, rowIndex: number, mode: SelectionMode, modifiers: ClickModifiers): RowClickResult;
30
+ /**
31
+ * Create a set containing all row indices (for select all).
32
+ *
33
+ * @param rowCount - Total number of rows
34
+ * @returns Set containing indices 0 to rowCount-1
35
+ */
36
+ export declare function selectAll(rowCount: number): Set<number>;
37
+ /**
38
+ * Compute the difference between two selection states.
39
+ *
40
+ * @param oldSelected - Previous selection set
41
+ * @param newSelected - New selection set
42
+ * @returns Object with added and removed row indices
43
+ */
44
+ export declare function computeSelectionDiff(oldSelected: Set<number>, newSelected: Set<number>): {
45
+ added: number[];
46
+ removed: number[];
47
+ };
48
+ //# sourceMappingURL=row-selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"row-selection.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/selection/row-selection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE7D,gCAAgC;AAChC,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,aAAa,EACnB,SAAS,EAAE,cAAc,GACxB,cAAc,CAmChB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAMvD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EACxB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,GACvB;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAYxC"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Selection Plugin Types
3
+ *
4
+ * Type definitions for the selection feature.
5
+ */
6
+ /**
7
+ * Selection mode for the grid:
8
+ * - 'cell': Single cell selection (default). No border, just focus highlight.
9
+ * - 'row': Row selection. Clicking a cell selects the entire row. Uses focus outline color.
10
+ * - 'range': Range selection. Shift+click or drag to select rectangular cell ranges. Uses success border color.
11
+ */
12
+ export type SelectionMode = 'cell' | 'row' | 'range';
13
+ /** Configuration options for the selection plugin */
14
+ export interface SelectionConfig {
15
+ /** Selection mode (default: 'cell') */
16
+ mode: SelectionMode;
17
+ }
18
+ /** Internal state managed by the selection plugin */
19
+ export interface SelectionState {
20
+ /** Set of selected row indices */
21
+ selected: Set<number>;
22
+ /** Last selected row index (for keyboard navigation) */
23
+ lastSelected: number | null;
24
+ /** Anchor row for shift+click range selection */
25
+ anchor: number | null;
26
+ }
27
+ /** Internal representation of a rectangular cell range */
28
+ export interface InternalCellRange {
29
+ /** Starting row index */
30
+ startRow: number;
31
+ /** Starting column index */
32
+ startCol: number;
33
+ /** Ending row index */
34
+ endRow: number;
35
+ /** Ending column index */
36
+ endCol: number;
37
+ }
38
+ /** Public representation of a cell range (for events) */
39
+ export interface CellRange {
40
+ /** Starting cell coordinates */
41
+ from: {
42
+ row: number;
43
+ col: number;
44
+ };
45
+ /** Ending cell coordinates */
46
+ to: {
47
+ row: number;
48
+ col: number;
49
+ };
50
+ }
51
+ /**
52
+ * Unified event detail emitted when selection changes (all modes).
53
+ * Provides a consistent structure for consumers to handle selection state.
54
+ */
55
+ export interface SelectionChangeDetail {
56
+ /** The selection mode that triggered this event */
57
+ mode: SelectionMode;
58
+ /** Selected cell ranges. For cell mode, contains a single-cell range. For row mode, contains full-row ranges. */
59
+ ranges: CellRange[];
60
+ }
61
+ /** Internal state for selection plugin */
62
+ export interface SelectionPluginState extends SelectionState {
63
+ /** All selected cell ranges (for range mode) - uses internal format */
64
+ ranges: InternalCellRange[];
65
+ /** The currently active (most recent) range */
66
+ activeRange: InternalCellRange | null;
67
+ /** Anchor cell for range extension */
68
+ cellAnchor: {
69
+ row: number;
70
+ col: number;
71
+ } | null;
72
+ /** Whether a range drag is in progress */
73
+ isDragging: boolean;
74
+ /** Selected cell (for cell mode) */
75
+ selectedCell: {
76
+ row: number;
77
+ col: number;
78
+ } | null;
79
+ }
80
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/selection/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;AAErD,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,kCAAkC;IAClC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,wDAAwD;IACxD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,iDAAiD;IACjD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAID,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,yDAAyD;AACzD,MAAM,WAAW,SAAS;IACxB,gCAAgC;IAChC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,8BAA8B;IAC9B,EAAE,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,IAAI,EAAE,aAAa,CAAC;IACpB,iHAAiH;IACjH,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,0CAA0C;AAC1C,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,uEAAuE;IACvE,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,+CAA+C;IAC/C,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACtC,sCAAsC;IACtC,UAAU,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAChD,0CAA0C;IAC1C,UAAU,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,YAAY,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACnD"}
@@ -0,0 +1,56 @@
1
+ import { BaseGridPlugin, ScrollEvent } from '../../core/plugin/base-plugin';
2
+ import { ServerSideConfig, ServerSideDataSource } from './types';
3
+ /**
4
+ * Server-Side Plugin for tbw-grid
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * const plugin = new ServerSidePlugin({ cacheBlockSize: 100 });
9
+ * plugin.setDataSource(myDataSource);
10
+ * ```
11
+ */
12
+ export declare class ServerSidePlugin extends BaseGridPlugin<ServerSideConfig> {
13
+ readonly name = "serverSide";
14
+ readonly version = "1.0.0";
15
+ protected get defaultConfig(): Partial<ServerSideConfig>;
16
+ private dataSource;
17
+ private totalRowCount;
18
+ private loadedBlocks;
19
+ private loadingBlocks;
20
+ private lastRequestId;
21
+ private scrollDebounceTimer?;
22
+ detach(): void;
23
+ /**
24
+ * Check current viewport and load any missing blocks.
25
+ */
26
+ private loadRequiredBlocks;
27
+ processRows(rows: readonly unknown[]): unknown[];
28
+ onScroll(event: ScrollEvent): void;
29
+ /**
30
+ * Set the data source for server-side loading.
31
+ * @param dataSource - Data source implementing the getRows method
32
+ */
33
+ setDataSource(dataSource: ServerSideDataSource): void;
34
+ /**
35
+ * Refresh all data from the server.
36
+ */
37
+ refresh(): void;
38
+ /**
39
+ * Clear all cached data without refreshing.
40
+ */
41
+ purgeCache(): void;
42
+ /**
43
+ * Get the total row count from the server.
44
+ */
45
+ getTotalRowCount(): number;
46
+ /**
47
+ * Check if a specific row is loaded in the cache.
48
+ * @param rowIndex - Row index to check
49
+ */
50
+ isRowLoaded(rowIndex: number): boolean;
51
+ /**
52
+ * Get the number of loaded cache blocks.
53
+ */
54
+ getLoadedBlockCount(): number;
55
+ }
56
+ //# sourceMappingURL=ServerSidePlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerSidePlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/server-side/ServerSidePlugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAKtE;;;;;;;;GAQG;AACH,qBAAa,gBAAiB,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IACpE,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,SAAkB,OAAO,WAAW;IAEpC,cAAuB,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAMhE;IAGD,OAAO,CAAC,UAAU,CAAqC;IACvD,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,YAAY,CAAgC;IACpD,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,mBAAmB,CAAC,CAAgC;IAKnD,MAAM,IAAI,IAAI;IAevB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA0CjB,WAAW,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE;IAahD,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAkB3C;;;OAGG;IACH,aAAa,CAAC,UAAU,EAAE,oBAAoB,GAAG,IAAI;IAcrD;;OAEG;IACH,OAAO,IAAI,IAAI;IAOf;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;OAEG;IACH,gBAAgB,IAAI,MAAM;IAI1B;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAMtC;;OAEG;IACH,mBAAmB,IAAI,MAAM;CAI9B"}
@@ -0,0 +1,14 @@
1
+ export declare class BlockCache<T> {
2
+ private maxSize;
3
+ private cache;
4
+ private accessOrder;
5
+ constructor(maxSize: number);
6
+ get(key: number): T | undefined;
7
+ set(key: number, value: T): void;
8
+ has(key: number): boolean;
9
+ clear(): void;
10
+ get size(): number;
11
+ private touch;
12
+ private evict;
13
+ }
14
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/server-side/cache.ts"],"names":[],"mappings":"AAAA,qBAAa,UAAU,CAAC,CAAC;IAIX,OAAO,CAAC,OAAO;IAH3B,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,WAAW,CAAgB;gBAEf,OAAO,EAAE,MAAM;IAEnC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAQ/B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAehC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzB,KAAK,IAAI,IAAI;IAKb,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,OAAO,CAAC,KAAK;IAQb,OAAO,CAAC,KAAK;CAMd"}
@@ -0,0 +1,12 @@
1
+ import { ServerSideDataSource, GetRowsParams, GetRowsResult } from './types';
2
+ export declare function getBlockNumber(rowIndex: number, blockSize: number): number;
3
+ export declare function getBlockRange(blockNumber: number, blockSize: number): {
4
+ start: number;
5
+ end: number;
6
+ };
7
+ export declare function getRequiredBlocks(startRow: number, endRow: number, blockSize: number): number[];
8
+ export declare function loadBlock(dataSource: ServerSideDataSource, blockNumber: number, blockSize: number, params: Partial<GetRowsParams>): Promise<GetRowsResult>;
9
+ export declare function getRowFromCache(rowIndex: number, blockSize: number, loadedBlocks: Map<number, any[]>): any | undefined;
10
+ export declare function isBlockLoaded(blockNumber: number, loadedBlocks: Map<number, any[]>): boolean;
11
+ export declare function isBlockLoading(blockNumber: number, loadingBlocks: Set<number>): boolean;
12
+ //# sourceMappingURL=datasource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/server-side/datasource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAElF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAKpG;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAS/F;AAED,wBAAsB,SAAS,CAC7B,UAAU,EAAE,oBAAoB,EAChC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,GAC7B,OAAO,CAAC,aAAa,CAAC,CASxB;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAC/B,GAAG,GAAG,SAAS,CAOjB;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAE5F;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAEvF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Server Side Plugin Entry Point
3
+ * Re-exports plugin class and types for tree-shakeable imports.
4
+ */
5
+ export { ServerSidePlugin } from './ServerSidePlugin';
6
+ export type { ServerSideConfig, ServerSideDataSource, GetRowsParams, GetRowsResult } from './types';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/server-side/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}