@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,228 @@
1
+ import { HeaderContentDefinition, IconValue, ShellConfig, ToolbarButtonConfig, ToolbarButtonInfo, ToolPanelDefinition } from '../types';
2
+ /**
3
+ * State for managing shell UI.
4
+ */
5
+ export interface ShellState {
6
+ /** Registered tool panels (from plugins + consumer API) */
7
+ toolPanels: Map<string, ToolPanelDefinition>;
8
+ /** Registered header content (from plugins + consumer API) */
9
+ headerContents: Map<string, HeaderContentDefinition>;
10
+ /** Custom toolbar buttons registered via API */
11
+ toolbarButtons: Map<string, ToolbarButtonConfig>;
12
+ /** Light DOM toolbar buttons */
13
+ lightDomButtons: HTMLElement[];
14
+ /** Light DOM header content elements */
15
+ lightDomHeaderContent: HTMLElement[];
16
+ /** Light DOM header title from <tbw-grid-header title="..."> */
17
+ lightDomTitle: string | null;
18
+ /** IDs of tool panels registered from light DOM (to avoid re-parsing) */
19
+ lightDomToolPanelIds: Set<string>;
20
+ /** Whether the tool panel sidebar is open */
21
+ isPanelOpen: boolean;
22
+ /** Which accordion sections are expanded (by panel ID) */
23
+ expandedSections: Set<string>;
24
+ /** Cleanup functions for header content render returns */
25
+ headerContentCleanups: Map<string, () => void>;
26
+ /** Cleanup functions for each panel section's render return */
27
+ panelCleanups: Map<string, () => void>;
28
+ /** Cleanup functions for toolbar button render returns */
29
+ toolbarButtonCleanups: Map<string, () => void>;
30
+ /** @deprecated Use isPanelOpen instead. Kept for backward compatibility. */
31
+ activePanel: string | null;
32
+ /** @deprecated Use panelCleanups instead. Kept for backward compatibility. */
33
+ activePanelCleanup: (() => void) | null;
34
+ }
35
+ /**
36
+ * Create initial shell state.
37
+ */
38
+ export declare function createShellState(): ShellState;
39
+ /**
40
+ * Determine if shell header should be rendered.
41
+ */
42
+ export declare function shouldRenderShellHeader(config: ShellConfig | undefined, state: ShellState): boolean;
43
+ /**
44
+ * Render the shell header HTML.
45
+ * @param toolPanelIcon - Icon for the tool panel toggle (from grid icon config)
46
+ */
47
+ export declare function renderShellHeader(config: ShellConfig | undefined, state: ShellState, toolPanelIcon?: IconValue): string;
48
+ /**
49
+ * Render the shell body wrapper HTML (contains grid content + accordion-style tool panel).
50
+ * @param icons - Optional icons for expand/collapse chevrons (from grid config)
51
+ */
52
+ export declare function renderShellBody(config: ShellConfig | undefined, state: ShellState, gridContentHtml: string, icons?: {
53
+ expand?: IconValue;
54
+ collapse?: IconValue;
55
+ }): string;
56
+ /**
57
+ * Parse light DOM shell elements (tbw-grid-header, etc.).
58
+ * Safe to call multiple times - will only parse once when elements are available.
59
+ */
60
+ export declare function parseLightDomShell(host: HTMLElement, state: ShellState): void;
61
+ /**
62
+ * Callback type for creating a tool panel renderer from a light DOM element.
63
+ * This is used by framework adapters (Angular, React, etc.) to create renderers
64
+ * from their template syntax.
65
+ */
66
+ export type ToolPanelRendererFactory = (element: HTMLElement) => ((container: HTMLElement) => void | (() => void)) | undefined;
67
+ /**
68
+ * Parse light DOM tool panel elements (<tbw-grid-tool-panel>).
69
+ * These can appear as direct children of <tbw-grid> for declarative tool panel configuration.
70
+ *
71
+ * Attributes:
72
+ * - `id` (required): Unique panel identifier
73
+ * - `title` (required): Panel title shown in accordion header
74
+ * - `icon`: Icon for accordion section header (emoji or text)
75
+ * - `tooltip`: Tooltip for accordion section header
76
+ * - `order`: Panel order priority (lower = first, default: 100)
77
+ *
78
+ * For vanilla JS, the element's innerHTML is used as the panel content.
79
+ * For framework adapters, the adapter can provide a custom renderer factory.
80
+ *
81
+ * @param host - The grid host element
82
+ * @param state - Shell state to update
83
+ * @param rendererFactory - Optional factory for creating renderers (used by framework adapters)
84
+ */
85
+ export declare function parseLightDomToolPanels(host: HTMLElement, state: ShellState, rendererFactory?: ToolPanelRendererFactory): void;
86
+ /**
87
+ * Set up event listeners for shell toolbar buttons and accordion.
88
+ */
89
+ export declare function setupShellEventListeners(shadowRoot: ShadowRoot, config: ShellConfig | undefined, state: ShellState, callbacks: {
90
+ onPanelToggle: () => void;
91
+ onSectionToggle: (sectionId: string) => void;
92
+ onToolbarButtonClick: (buttonId: string) => void;
93
+ }): void;
94
+ /**
95
+ * Set up resize handle for tool panel.
96
+ * Returns a cleanup function to remove event listeners.
97
+ */
98
+ export declare function setupToolPanelResize(shadowRoot: ShadowRoot, config: ShellConfig | undefined, onResize: (width: number) => void): () => void;
99
+ /**
100
+ * Render custom button elements/render functions into toolbar slots.
101
+ */
102
+ export declare function renderCustomToolbarButtons(shadowRoot: ShadowRoot, config: ShellConfig | undefined, state: ShellState): void;
103
+ /**
104
+ * Render header content from plugins into the shell content area.
105
+ */
106
+ export declare function renderHeaderContent(shadowRoot: ShadowRoot, state: ShellState): void;
107
+ /**
108
+ * Render content for expanded accordion sections.
109
+ * @param icons - Optional icons for expand/collapse chevrons (from grid config)
110
+ */
111
+ export declare function renderPanelContent(shadowRoot: ShadowRoot, state: ShellState, icons?: {
112
+ expand?: IconValue;
113
+ collapse?: IconValue;
114
+ }): void;
115
+ /**
116
+ * Update toolbar button active states.
117
+ */
118
+ export declare function updateToolbarActiveStates(shadowRoot: ShadowRoot, state: ShellState): void;
119
+ /**
120
+ * Update tool panel open/close state.
121
+ */
122
+ export declare function updatePanelState(shadowRoot: ShadowRoot, state: ShellState): void;
123
+ /**
124
+ * Get all toolbar button info.
125
+ */
126
+ export declare function getToolbarButtonsInfo(config: ShellConfig | undefined, state: ShellState): ToolbarButtonInfo[];
127
+ /**
128
+ * Cleanup all shell state when grid disconnects.
129
+ */
130
+ export declare function cleanupShellState(state: ShellState): void;
131
+ /**
132
+ * Callbacks for ShellController to communicate with the grid.
133
+ * This interface decouples the controller from grid internals.
134
+ */
135
+ export interface ShellControllerCallbacks {
136
+ /** Get the shadow root for DOM queries */
137
+ getShadow: () => ShadowRoot;
138
+ /** Get the current shell config */
139
+ getShellConfig: () => ShellConfig | undefined;
140
+ /** Get accordion expand/collapse icons */
141
+ getAccordionIcons: () => {
142
+ expand: IconValue;
143
+ collapse: IconValue;
144
+ };
145
+ /** Emit an event from the grid */
146
+ emit: (eventName: string, detail: unknown) => void;
147
+ /** Refresh the shell header (re-parse light DOM and re-render) */
148
+ refreshShellHeader: () => void;
149
+ }
150
+ /**
151
+ * Controller interface for managing shell/tool panel behavior.
152
+ */
153
+ export interface ShellController {
154
+ /** Whether the shell has been initialized */
155
+ readonly isInitialized: boolean;
156
+ /** Set the initialized state */
157
+ setInitialized(value: boolean): void;
158
+ /** Whether the tool panel is currently open */
159
+ readonly isPanelOpen: boolean;
160
+ /** Get the currently active panel ID (deprecated) */
161
+ readonly activePanel: string | null;
162
+ /** Get IDs of expanded accordion sections */
163
+ readonly expandedSections: string[];
164
+ /** Open the tool panel */
165
+ openToolPanel(): void;
166
+ /** Close the tool panel */
167
+ closeToolPanel(): void;
168
+ /** Toggle the tool panel */
169
+ toggleToolPanel(): void;
170
+ /** Toggle an accordion section */
171
+ toggleToolPanelSection(sectionId: string): void;
172
+ /** Get registered tool panels */
173
+ getToolPanels(): ToolPanelDefinition[];
174
+ /** Register a tool panel */
175
+ registerToolPanel(panel: ToolPanelDefinition): void;
176
+ /** Unregister a tool panel */
177
+ unregisterToolPanel(panelId: string): void;
178
+ /** Get registered header contents */
179
+ getHeaderContents(): HeaderContentDefinition[];
180
+ /** Register header content */
181
+ registerHeaderContent(content: HeaderContentDefinition): void;
182
+ /** Unregister header content */
183
+ unregisterHeaderContent(contentId: string): void;
184
+ /** Get all toolbar buttons info */
185
+ getToolbarButtons(): ToolbarButtonInfo[];
186
+ /** Register a toolbar button */
187
+ registerToolbarButton(button: ToolbarButtonConfig): void;
188
+ /** Unregister a toolbar button */
189
+ unregisterToolbarButton(buttonId: string): void;
190
+ /** Enable/disable a toolbar button */
191
+ setToolbarButtonDisabled(buttonId: string, disabled: boolean): void;
192
+ }
193
+ /**
194
+ * Create a ShellController instance.
195
+ * The controller encapsulates all tool panel orchestration logic.
196
+ */
197
+ export declare function createShellController(state: ShellState, callbacks: ShellControllerCallbacks): ShellController;
198
+ /**
199
+ * Core grid content HTML template.
200
+ * Uses faux scrollbar pattern for smooth virtualized scrolling.
201
+ */
202
+ export declare const GRID_CONTENT_HTML = "\n <div class=\"tbw-scroll-area\">\n <div class=\"rows-body-wrapper\">\n <div class=\"rows-body\" role=\"grid\">\n <div class=\"header\">\n <div class=\"header-row\" part=\"header-row\"></div>\n </div>\n <div class=\"rows-container\">\n <div class=\"rows-viewport\">\n <div class=\"rows\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"faux-vscroll\">\n <div class=\"faux-vscroll-spacer\"></div>\n </div>\n";
203
+ /**
204
+ * Render the complete grid HTML structure.
205
+ * @returns HTML string to set as shadow root innerHTML
206
+ * @deprecated Use buildGridDOM() for better performance
207
+ */
208
+ export declare function renderGridHtml(shellConfig: ShellConfig | undefined, state: ShellState, icons?: {
209
+ toolPanel?: IconValue;
210
+ expand?: IconValue;
211
+ collapse?: IconValue;
212
+ }): string;
213
+ /**
214
+ * Build the complete grid DOM structure using direct DOM construction.
215
+ * This is 2-3x faster than innerHTML for initial render.
216
+ *
217
+ * @param shadowRoot - The shadow root to render into (will be cleared)
218
+ * @param shellConfig - Shell configuration
219
+ * @param state - Shell state
220
+ * @param icons - Optional icons
221
+ * @returns Whether shell is active (for post-render setup)
222
+ */
223
+ export declare function buildGridDOMIntoShadow(shadowRoot: ShadowRoot, shellConfig: ShellConfig | undefined, state: ShellState, icons?: {
224
+ toolPanel?: IconValue;
225
+ expand?: IconValue;
226
+ collapse?: IconValue;
227
+ }): boolean;
228
+ //# sourceMappingURL=shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/shell.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAA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B,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACzD,kCAAkC;IAClC,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,sCAAsC;IACtC,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CACrE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,wBAAwB,GAAG,eAAe,CAwQ7G;AAgCD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,wgBAkB7B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,KAAK,EAAE,UAAU,EACjB,KAAK,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAC1E,MAAM,CA2BR;AAcD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,KAAK,EAAE,UAAU,EACjB,KAAK,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAC1E,OAAO,CA4ET"}
@@ -0,0 +1,24 @@
1
+ import { ColumnConfig, InternalGrid, SortState } from '../types';
2
+ /**
3
+ * Default comparator for sorting values.
4
+ * Handles nulls (pushed to end), numbers, and string fallback.
5
+ */
6
+ export declare function defaultComparator(a: unknown, b: unknown): number;
7
+ /**
8
+ * Built-in sort implementation using column comparator or default.
9
+ * This is the default sortHandler when none is configured.
10
+ */
11
+ export declare function builtInSort<T>(rows: T[], sortState: SortState, columns: ColumnConfig<T>[]): T[];
12
+ /**
13
+ * Cycle sort state for a column: none -> ascending -> descending -> none.
14
+ * Restores original row order when clearing sort.
15
+ */
16
+ export declare function toggleSort(grid: InternalGrid, col: ColumnConfig<any>): void;
17
+ /**
18
+ * Apply a concrete sort direction to rows.
19
+ *
20
+ * Uses custom sortHandler from gridConfig if provided, otherwise uses built-in sorting.
21
+ * Supports both sync and async handlers (for server-side sorting).
22
+ */
23
+ export declare function applySort(grid: InternalGrid, col: ColumnConfig<any>, dir: 1 | -1): void;
24
+ //# sourceMappingURL=sorting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sorting.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/sorting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAe,SAAS,EAAE,MAAM,UAAU,CAAC;AAGnF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAKhE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAQ/F;AAqBD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,CAAC,GAAG,CAAC,GAAG,IAAI,CA8B3E;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAqBvF"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Touch scrolling controller for mobile devices.
3
+ *
4
+ * Handles touch events for scrolling with momentum physics.
5
+ * Supports both vertical (faux scrollbar) and horizontal (scroll area) scrolling.
6
+ */
7
+ export interface TouchScrollState {
8
+ startY: number | null;
9
+ startX: number | null;
10
+ scrollTop: number | null;
11
+ scrollLeft: number | null;
12
+ lastY: number | null;
13
+ lastX: number | null;
14
+ lastTime: number | null;
15
+ velocityY: number;
16
+ velocityX: number;
17
+ momentumRaf: number;
18
+ }
19
+ export interface TouchScrollElements {
20
+ fauxScrollbar: HTMLElement;
21
+ scrollArea: HTMLElement | null;
22
+ }
23
+ /**
24
+ * Create initial touch scroll state.
25
+ */
26
+ export declare function createTouchScrollState(): TouchScrollState;
27
+ /**
28
+ * Reset touch scroll state (called on touchend or cleanup).
29
+ */
30
+ export declare function resetTouchState(state: TouchScrollState): void;
31
+ /**
32
+ * Cancel any ongoing momentum animation.
33
+ */
34
+ export declare function cancelMomentum(state: TouchScrollState): void;
35
+ /**
36
+ * Handle touchstart event.
37
+ */
38
+ export declare function handleTouchStart(e: TouchEvent, state: TouchScrollState, elements: TouchScrollElements): void;
39
+ /**
40
+ * Handle touchmove event.
41
+ * Returns true if the event should be prevented (grid scrolled).
42
+ */
43
+ export declare function handleTouchMove(e: TouchEvent, state: TouchScrollState, elements: TouchScrollElements): boolean;
44
+ /**
45
+ * Handle touchend event.
46
+ * Starts momentum scrolling if velocity is significant.
47
+ */
48
+ export declare function handleTouchEnd(state: TouchScrollState, elements: TouchScrollElements): void;
49
+ /**
50
+ * Set up touch scroll event listeners on the grid content element.
51
+ * Returns a cleanup function that removes all listeners.
52
+ */
53
+ export declare function setupTouchScrollListeners(gridContentEl: HTMLElement, state: TouchScrollState, elements: TouchScrollElements, signal: AbortSignal): void;
54
+ //# sourceMappingURL=touch-scroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"touch-scroll.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/touch-scroll.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;I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create a requestAnimationFrame-based debounce wrapper. Consecutive calls in the same frame
3
+ * cancel the previous scheduled callback ensuring it runs at most once per frame.
4
+ */
5
+ export declare function rafDebounce<T extends (...args: any[]) => void>(fn: T): T & {
6
+ cancel: () => void;
7
+ };
8
+ /**
9
+ * Generate accessible HTML for a boolean cell.
10
+ * Uses role="checkbox" with proper aria attributes.
11
+ */
12
+ export declare function booleanCellHTML(value: boolean): string;
13
+ /**
14
+ * Format a date value for display.
15
+ * Handles Date objects, timestamps, and date strings.
16
+ * Returns empty string for invalid dates.
17
+ */
18
+ export declare function formatDateValue(value: unknown): string;
19
+ /**
20
+ * Format a boolean value for text display (not HTML).
21
+ */
22
+ export declare function formatBooleanValue(value: unknown): string;
23
+ /**
24
+ * Get the row index from a cell element's data-row attribute.
25
+ * Returns -1 if no valid row index is found.
26
+ */
27
+ export declare function getRowIndexFromCell(cell: Element | null): number;
28
+ /**
29
+ * Get the column index from a cell element's data-col attribute.
30
+ * Returns -1 if no valid column index is found.
31
+ */
32
+ export declare function getColIndexFromCell(cell: Element | null): number;
33
+ /**
34
+ * Clear all cell-focus styling from a root element (shadowRoot or bodyEl).
35
+ * Used when changing focus or when selection plugin takes over focus management.
36
+ */
37
+ export declare function clearCellFocus(root: Element | ShadowRoot | null): void;
38
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,EAAE,EAAE,CAAC,GAajD,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAC7C;AAWD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAUtD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEzD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,GAAG,MAAM,CAIhE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,GAAG,MAAM,CAIhE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,GAAG,IAAI,CAGtE"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Row Virtualization Core Logic
3
+ *
4
+ * Pure functions for vertical row virtualization operations.
5
+ * Manages which rows are rendered based on scroll position and viewport size.
6
+ */
7
+ /** Result of computing a virtual window */
8
+ export interface VirtualWindow {
9
+ /** First row index to render (inclusive) */
10
+ start: number;
11
+ /** Last row index to render (exclusive) */
12
+ end: number;
13
+ /** Pixel offset to apply to the rows container (translateY) */
14
+ offsetY: number;
15
+ /** Total height of the scrollable content */
16
+ totalHeight: number;
17
+ }
18
+ /** Parameters for computing the virtual window */
19
+ export interface VirtualWindowParams {
20
+ /** Total number of rows */
21
+ totalRows: number;
22
+ /** Height of the viewport in pixels */
23
+ viewportHeight: number;
24
+ /** Current scroll top position */
25
+ scrollTop: number;
26
+ /** Height of each row in pixels */
27
+ rowHeight: number;
28
+ /** Number of extra rows to render above/below viewport */
29
+ overscan: number;
30
+ /** Previous scroll position for velocity calculation */
31
+ prevScrollTop?: number;
32
+ }
33
+ /**
34
+ * Compute the virtual row window based on scroll position and viewport.
35
+ * Uses directional overscan - renders more rows in the scroll direction.
36
+ *
37
+ * @param params - Parameters for computing the window
38
+ * @returns VirtualWindow with start/end indices and transforms
39
+ */
40
+ export declare function computeVirtualWindow(params: VirtualWindowParams): VirtualWindow;
41
+ /**
42
+ * Determine if virtualization should be bypassed for small datasets.
43
+ * When there are very few items, the overhead of virtualization isn't worth it.
44
+ *
45
+ * @param totalRows - Total number of items
46
+ * @param threshold - Bypass threshold (skip virtualization if totalRows <= threshold)
47
+ * @returns True if virtualization should be bypassed
48
+ */
49
+ export declare function shouldBypassVirtualization(totalRows: number, threshold: number): boolean;
50
+ /**
51
+ * Compute the row index from a Y pixel position.
52
+ *
53
+ * @param y - Y position in pixels (relative to content top)
54
+ * @param rowHeight - Height of each row
55
+ * @returns Row index at that position
56
+ */
57
+ export declare function getRowIndexFromY(y: number, rowHeight: number): number;
58
+ /**
59
+ * Compute the Y offset for a given row index.
60
+ *
61
+ * @param rowIndex - Row index
62
+ * @param rowHeight - Height of each row
63
+ * @returns Y position in pixels
64
+ */
65
+ export declare function getRowOffsetY(rowIndex: number, rowHeight: number): number;
66
+ //# sourceMappingURL=virtualization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtualization.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/virtualization.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,2CAA2C;AAC3C,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,kDAAkD;AAClD,MAAM,WAAW,mBAAmB;IAClC,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa,CAyB/E;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAExF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzE"}