@toolbox-web/grid 1.24.2 → 1.25.1

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 (422) hide show
  1. package/all.d.ts +0 -1
  2. package/all.js +2 -2
  3. package/all.js.map +1 -1
  4. package/index.d.ts +0 -1
  5. package/index.js +1 -1
  6. package/index.js.map +1 -1
  7. package/lib/core/constants.d.ts +0 -1
  8. package/lib/core/grid.d.ts +145 -33
  9. package/lib/core/internal/aggregators.d.ts +0 -1
  10. package/lib/core/internal/aria.d.ts +8 -1
  11. package/lib/core/internal/columns.d.ts +3 -4
  12. package/lib/core/internal/config-manager.d.ts +2 -54
  13. package/lib/core/internal/dom-builder.d.ts +0 -1
  14. package/lib/core/internal/event-delegation.d.ts +3 -4
  15. package/lib/core/internal/feature-hook.d.ts +0 -1
  16. package/lib/core/internal/focus-manager.d.ts +49 -0
  17. package/lib/core/internal/header.d.ts +2 -3
  18. package/lib/core/internal/idle-scheduler.d.ts +0 -1
  19. package/lib/core/internal/inference.d.ts +0 -1
  20. package/lib/core/internal/keyboard.d.ts +3 -4
  21. package/lib/core/internal/loading.d.ts +0 -1
  22. package/lib/core/internal/render-scheduler.d.ts +3 -66
  23. package/lib/core/internal/resize.d.ts +2 -3
  24. package/lib/core/internal/row-animation.d.ts +0 -1
  25. package/lib/core/internal/row-manager.d.ts +31 -0
  26. package/lib/core/internal/rows.d.ts +4 -5
  27. package/lib/core/internal/sanitize.d.ts +0 -1
  28. package/lib/core/internal/shell.d.ts +7 -25
  29. package/lib/core/internal/sorting.d.ts +3 -4
  30. package/lib/core/internal/style-injector.d.ts +0 -1
  31. package/lib/core/internal/touch-scroll.d.ts +31 -12
  32. package/lib/core/internal/utils.d.ts +8 -1
  33. package/lib/core/internal/validate-config.d.ts +4 -5
  34. package/lib/core/internal/virtualization-manager.d.ts +48 -0
  35. package/lib/core/internal/virtualization.d.ts +0 -1
  36. package/lib/core/plugin/base-plugin.d.ts +2 -3
  37. package/lib/core/plugin/expander-column.d.ts +0 -1
  38. package/lib/core/plugin/index.d.ts +0 -1
  39. package/lib/core/plugin/plugin-manager.d.ts +2 -1
  40. package/lib/core/plugin/types.d.ts +7 -2
  41. package/lib/core/styles/index.d.ts +0 -1
  42. package/lib/core/types.d.ts +364 -54
  43. package/lib/features/clipboard.d.ts +0 -1
  44. package/lib/features/column-virtualization.d.ts +0 -1
  45. package/lib/features/context-menu.d.ts +0 -1
  46. package/lib/features/editing.d.ts +0 -1
  47. package/lib/features/export.d.ts +0 -1
  48. package/lib/features/filtering.d.ts +0 -1
  49. package/lib/features/grouping-columns.d.ts +0 -1
  50. package/lib/features/grouping-rows.d.ts +0 -1
  51. package/lib/features/master-detail.d.ts +0 -1
  52. package/lib/features/multi-sort.d.ts +1 -2
  53. package/lib/features/multi-sort.js.map +1 -1
  54. package/lib/features/pinned-columns.d.ts +0 -1
  55. package/lib/features/pinned-rows.d.ts +0 -1
  56. package/lib/features/pivot.d.ts +0 -1
  57. package/lib/features/print.d.ts +0 -1
  58. package/lib/features/registry.d.ts +0 -1
  59. package/lib/features/reorder-columns.d.ts +1 -2
  60. package/lib/features/reorder-columns.js.map +1 -1
  61. package/lib/features/reorder-rows.d.ts +1 -2
  62. package/lib/features/reorder-rows.js.map +1 -1
  63. package/lib/features/responsive.d.ts +0 -1
  64. package/lib/features/selection.d.ts +0 -1
  65. package/lib/features/server-side.d.ts +0 -1
  66. package/lib/features/tree.d.ts +0 -1
  67. package/lib/features/undo-redo.d.ts +0 -1
  68. package/lib/features/visibility.d.ts +0 -1
  69. package/lib/plugins/clipboard/ClipboardPlugin.d.ts +0 -1
  70. package/lib/plugins/clipboard/copy.d.ts +0 -1
  71. package/lib/plugins/clipboard/index.d.ts +0 -1
  72. package/lib/plugins/clipboard/index.js +1 -1
  73. package/lib/plugins/clipboard/index.js.map +1 -1
  74. package/lib/plugins/clipboard/paste.d.ts +0 -1
  75. package/lib/plugins/clipboard/types.d.ts +6 -1
  76. package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts +0 -1
  77. package/lib/plugins/column-virtualization/column-virtualization.d.ts +0 -1
  78. package/lib/plugins/column-virtualization/index.d.ts +0 -1
  79. package/lib/plugins/column-virtualization/index.js +1 -1
  80. package/lib/plugins/column-virtualization/index.js.map +1 -1
  81. package/lib/plugins/column-virtualization/types.d.ts +0 -1
  82. package/lib/plugins/context-menu/ContextMenuPlugin.d.ts +16 -1
  83. package/lib/plugins/context-menu/index.d.ts +1 -2
  84. package/lib/plugins/context-menu/index.js +1 -1
  85. package/lib/plugins/context-menu/index.js.map +1 -1
  86. package/lib/plugins/context-menu/menu.d.ts +14 -1
  87. package/lib/plugins/context-menu/types.d.ts +13 -3
  88. package/lib/plugins/editing/EditingPlugin.d.ts +4 -6
  89. package/lib/plugins/editing/editors.d.ts +0 -1
  90. package/lib/plugins/editing/index.d.ts +0 -1
  91. package/lib/plugins/editing/index.js +1 -1
  92. package/lib/plugins/editing/index.js.map +1 -1
  93. package/lib/plugins/editing/internal/cell-validation.d.ts +0 -1
  94. package/lib/plugins/editing/internal/dirty-tracking-manager.d.ts +0 -1
  95. package/lib/plugins/editing/internal/dirty-tracking.d.ts +2 -2
  96. package/lib/plugins/editing/internal/editor-injection.d.ts +3 -4
  97. package/lib/plugins/editing/internal/helpers.d.ts +0 -1
  98. package/lib/plugins/editing/types.d.ts +15 -14
  99. package/lib/plugins/export/ExportPlugin.d.ts +0 -1
  100. package/lib/plugins/export/csv.d.ts +0 -1
  101. package/lib/plugins/export/excel.d.ts +0 -1
  102. package/lib/plugins/export/index.d.ts +0 -1
  103. package/lib/plugins/export/index.js +1 -1
  104. package/lib/plugins/export/index.js.map +1 -1
  105. package/lib/plugins/export/types.d.ts +4 -1
  106. package/lib/plugins/filtering/FilteringPlugin.d.ts +0 -1
  107. package/lib/plugins/filtering/filter-model.d.ts +0 -1
  108. package/lib/plugins/filtering/filter-panel-date.d.ts +0 -1
  109. package/lib/plugins/filtering/filter-panel-default.d.ts +0 -1
  110. package/lib/plugins/filtering/filter-panel-number.d.ts +0 -1
  111. package/lib/plugins/filtering/index.d.ts +0 -1
  112. package/lib/plugins/filtering/index.js +1 -1
  113. package/lib/plugins/filtering/index.js.map +1 -1
  114. package/lib/plugins/filtering/types.d.ts +4 -1
  115. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts +0 -1
  116. package/lib/plugins/grouping-columns/grouping-columns.d.ts +15 -2
  117. package/lib/plugins/grouping-columns/index.d.ts +1 -1
  118. package/lib/plugins/grouping-columns/index.js +1 -1
  119. package/lib/plugins/grouping-columns/index.js.map +1 -1
  120. package/lib/plugins/grouping-columns/types.d.ts +98 -9
  121. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +0 -1
  122. package/lib/plugins/grouping-rows/grouping-rows.d.ts +0 -1
  123. package/lib/plugins/grouping-rows/index.d.ts +0 -1
  124. package/lib/plugins/grouping-rows/index.js +1 -1
  125. package/lib/plugins/grouping-rows/index.js.map +1 -1
  126. package/lib/plugins/grouping-rows/types.d.ts +4 -1
  127. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +0 -1
  128. package/lib/plugins/master-detail/index.d.ts +0 -1
  129. package/lib/plugins/master-detail/index.js +1 -1
  130. package/lib/plugins/master-detail/index.js.map +1 -1
  131. package/lib/plugins/master-detail/master-detail.d.ts +0 -1
  132. package/lib/plugins/master-detail/types.d.ts +4 -1
  133. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts +3 -3
  134. package/lib/plugins/multi-sort/index.d.ts +1 -2
  135. package/lib/plugins/multi-sort/index.js +1 -1
  136. package/lib/plugins/multi-sort/index.js.map +1 -1
  137. package/lib/plugins/multi-sort/multi-sort.d.ts +0 -1
  138. package/lib/plugins/multi-sort/types.d.ts +5 -1
  139. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +0 -1
  140. package/lib/plugins/pinned-columns/index.d.ts +0 -1
  141. package/lib/plugins/pinned-columns/index.js +1 -1
  142. package/lib/plugins/pinned-columns/index.js.map +1 -1
  143. package/lib/plugins/pinned-columns/pinned-columns.d.ts +0 -1
  144. package/lib/plugins/pinned-columns/types.d.ts +0 -1
  145. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts +0 -1
  146. package/lib/plugins/pinned-rows/index.d.ts +0 -1
  147. package/lib/plugins/pinned-rows/index.js +1 -1
  148. package/lib/plugins/pinned-rows/index.js.map +1 -1
  149. package/lib/plugins/pinned-rows/pinned-rows.d.ts +0 -1
  150. package/lib/plugins/pinned-rows/types.d.ts +0 -1
  151. package/lib/plugins/pivot/PivotPlugin.d.ts +0 -1
  152. package/lib/plugins/pivot/index.d.ts +0 -1
  153. package/lib/plugins/pivot/index.js +1 -1
  154. package/lib/plugins/pivot/index.js.map +1 -1
  155. package/lib/plugins/pivot/pivot-engine.d.ts +0 -1
  156. package/lib/plugins/pivot/pivot-model.d.ts +0 -1
  157. package/lib/plugins/pivot/pivot-panel.d.ts +0 -1
  158. package/lib/plugins/pivot/pivot-rows.d.ts +0 -1
  159. package/lib/plugins/pivot/types.d.ts +0 -1
  160. package/lib/plugins/print/PrintPlugin.d.ts +0 -1
  161. package/lib/plugins/print/index.d.ts +0 -1
  162. package/lib/plugins/print/index.js +1 -1
  163. package/lib/plugins/print/index.js.map +1 -1
  164. package/lib/plugins/print/print-isolated.d.ts +0 -1
  165. package/lib/plugins/print/types.d.ts +6 -1
  166. package/lib/plugins/reorder-columns/ReorderPlugin.d.ts +5 -5
  167. package/lib/plugins/reorder-columns/column-drag.d.ts +3 -2
  168. package/lib/plugins/reorder-columns/index.d.ts +0 -1
  169. package/lib/plugins/reorder-columns/index.js +1 -1
  170. package/lib/plugins/reorder-columns/index.js.map +1 -1
  171. package/lib/plugins/reorder-columns/types.d.ts +4 -1
  172. package/lib/plugins/reorder-rows/RowReorderPlugin.d.ts +3 -3
  173. package/lib/plugins/reorder-rows/index.d.ts +0 -1
  174. package/lib/plugins/reorder-rows/index.js +1 -1
  175. package/lib/plugins/reorder-rows/index.js.map +1 -1
  176. package/lib/plugins/reorder-rows/types.d.ts +4 -1
  177. package/lib/plugins/responsive/ResponsivePlugin.d.ts +0 -1
  178. package/lib/plugins/responsive/index.d.ts +0 -1
  179. package/lib/plugins/responsive/index.js +1 -1
  180. package/lib/plugins/responsive/index.js.map +1 -1
  181. package/lib/plugins/responsive/types.d.ts +4 -1
  182. package/lib/plugins/selection/SelectionPlugin.d.ts +1 -3
  183. package/lib/plugins/selection/index.d.ts +0 -1
  184. package/lib/plugins/selection/index.js +1 -1
  185. package/lib/plugins/selection/index.js.map +1 -1
  186. package/lib/plugins/selection/range-selection.d.ts +0 -1
  187. package/lib/plugins/selection/row-selection.d.ts +0 -1
  188. package/lib/plugins/selection/types.d.ts +4 -1
  189. package/lib/plugins/server-side/ServerSidePlugin.d.ts +0 -1
  190. package/lib/plugins/server-side/cache.d.ts +0 -1
  191. package/lib/plugins/server-side/datasource.d.ts +0 -1
  192. package/lib/plugins/server-side/index.d.ts +0 -1
  193. package/lib/plugins/server-side/index.js +1 -1
  194. package/lib/plugins/server-side/index.js.map +1 -1
  195. package/lib/plugins/server-side/types.d.ts +0 -1
  196. package/lib/plugins/shared/data-collection.d.ts +0 -1
  197. package/lib/plugins/tree/TreePlugin.d.ts +0 -1
  198. package/lib/plugins/tree/index.d.ts +0 -1
  199. package/lib/plugins/tree/index.js +1 -1
  200. package/lib/plugins/tree/index.js.map +1 -1
  201. package/lib/plugins/tree/tree-data.d.ts +0 -1
  202. package/lib/plugins/tree/tree-detect.d.ts +0 -1
  203. package/lib/plugins/tree/types.d.ts +4 -1
  204. package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts +1 -2
  205. package/lib/plugins/undo-redo/history.d.ts +0 -1
  206. package/lib/plugins/undo-redo/index.d.ts +0 -1
  207. package/lib/plugins/undo-redo/index.js +1 -1
  208. package/lib/plugins/undo-redo/index.js.map +1 -1
  209. package/lib/plugins/undo-redo/types.d.ts +6 -1
  210. package/lib/plugins/visibility/VisibilityPlugin.d.ts +0 -1
  211. package/lib/plugins/visibility/index.d.ts +0 -1
  212. package/lib/plugins/visibility/index.js +1 -1
  213. package/lib/plugins/visibility/index.js.map +1 -1
  214. package/lib/plugins/visibility/types.d.ts +0 -1
  215. package/lib/plugins/visibility/visibility.d.ts +0 -1
  216. package/package.json +1 -1
  217. package/public.d.ts +31 -12
  218. package/umd/grid.all.umd.js +1 -1
  219. package/umd/grid.all.umd.js.map +1 -1
  220. package/umd/grid.umd.js +1 -1
  221. package/umd/grid.umd.js.map +1 -1
  222. package/umd/plugins/clipboard.umd.js +1 -1
  223. package/umd/plugins/clipboard.umd.js.map +1 -1
  224. package/umd/plugins/column-virtualization.umd.js +1 -1
  225. package/umd/plugins/column-virtualization.umd.js.map +1 -1
  226. package/umd/plugins/context-menu.umd.js +1 -1
  227. package/umd/plugins/context-menu.umd.js.map +1 -1
  228. package/umd/plugins/editing.umd.js +1 -1
  229. package/umd/plugins/editing.umd.js.map +1 -1
  230. package/umd/plugins/filtering.umd.js +1 -1
  231. package/umd/plugins/filtering.umd.js.map +1 -1
  232. package/umd/plugins/grouping-columns.umd.js +1 -1
  233. package/umd/plugins/grouping-columns.umd.js.map +1 -1
  234. package/umd/plugins/master-detail.umd.js +1 -1
  235. package/umd/plugins/master-detail.umd.js.map +1 -1
  236. package/umd/plugins/multi-sort.umd.js +1 -1
  237. package/umd/plugins/multi-sort.umd.js.map +1 -1
  238. package/umd/plugins/pinned-columns.umd.js +1 -1
  239. package/umd/plugins/pinned-columns.umd.js.map +1 -1
  240. package/umd/plugins/pinned-rows.umd.js +1 -1
  241. package/umd/plugins/pinned-rows.umd.js.map +1 -1
  242. package/umd/plugins/print.umd.js +1 -1
  243. package/umd/plugins/print.umd.js.map +1 -1
  244. package/umd/plugins/reorder-columns.umd.js +1 -1
  245. package/umd/plugins/reorder-columns.umd.js.map +1 -1
  246. package/umd/plugins/reorder-rows.umd.js +1 -1
  247. package/umd/plugins/reorder-rows.umd.js.map +1 -1
  248. package/umd/plugins/responsive.umd.js +1 -1
  249. package/umd/plugins/responsive.umd.js.map +1 -1
  250. package/umd/plugins/selection.umd.js +1 -1
  251. package/umd/plugins/selection.umd.js.map +1 -1
  252. package/umd/plugins/server-side.umd.js.map +1 -1
  253. package/umd/plugins/tree.umd.js +1 -1
  254. package/umd/plugins/tree.umd.js.map +1 -1
  255. package/umd/plugins/undo-redo.umd.js.map +1 -1
  256. package/umd/plugins/visibility.umd.js +1 -1
  257. package/umd/plugins/visibility.umd.js.map +1 -1
  258. package/all.d.ts.map +0 -1
  259. package/index.d.ts.map +0 -1
  260. package/lib/core/constants.d.ts.map +0 -1
  261. package/lib/core/grid.d.ts.map +0 -1
  262. package/lib/core/internal/aggregators.d.ts.map +0 -1
  263. package/lib/core/internal/aria.d.ts.map +0 -1
  264. package/lib/core/internal/columns.d.ts.map +0 -1
  265. package/lib/core/internal/config-manager.d.ts.map +0 -1
  266. package/lib/core/internal/dom-builder.d.ts.map +0 -1
  267. package/lib/core/internal/event-delegation.d.ts.map +0 -1
  268. package/lib/core/internal/feature-hook.d.ts.map +0 -1
  269. package/lib/core/internal/header.d.ts.map +0 -1
  270. package/lib/core/internal/idle-scheduler.d.ts.map +0 -1
  271. package/lib/core/internal/inference.d.ts.map +0 -1
  272. package/lib/core/internal/keyboard.d.ts.map +0 -1
  273. package/lib/core/internal/loading.d.ts.map +0 -1
  274. package/lib/core/internal/render-scheduler.d.ts.map +0 -1
  275. package/lib/core/internal/resize.d.ts.map +0 -1
  276. package/lib/core/internal/row-animation.d.ts.map +0 -1
  277. package/lib/core/internal/rows.d.ts.map +0 -1
  278. package/lib/core/internal/sanitize.d.ts.map +0 -1
  279. package/lib/core/internal/shell.d.ts.map +0 -1
  280. package/lib/core/internal/sorting.d.ts.map +0 -1
  281. package/lib/core/internal/style-injector.d.ts.map +0 -1
  282. package/lib/core/internal/touch-scroll.d.ts.map +0 -1
  283. package/lib/core/internal/utils.d.ts.map +0 -1
  284. package/lib/core/internal/validate-config.d.ts.map +0 -1
  285. package/lib/core/internal/virtualization.d.ts.map +0 -1
  286. package/lib/core/plugin/base-plugin.d.ts.map +0 -1
  287. package/lib/core/plugin/expander-column.d.ts.map +0 -1
  288. package/lib/core/plugin/index.d.ts.map +0 -1
  289. package/lib/core/plugin/plugin-manager.d.ts.map +0 -1
  290. package/lib/core/plugin/types.d.ts.map +0 -1
  291. package/lib/core/styles/index.d.ts.map +0 -1
  292. package/lib/core/types.d.ts.map +0 -1
  293. package/lib/features/clipboard.d.ts.map +0 -1
  294. package/lib/features/column-virtualization.d.ts.map +0 -1
  295. package/lib/features/context-menu.d.ts.map +0 -1
  296. package/lib/features/editing.d.ts.map +0 -1
  297. package/lib/features/export.d.ts.map +0 -1
  298. package/lib/features/filtering.d.ts.map +0 -1
  299. package/lib/features/grouping-columns.d.ts.map +0 -1
  300. package/lib/features/grouping-rows.d.ts.map +0 -1
  301. package/lib/features/magic-string.es-CkyDP9Ir.mjs.map +0 -1
  302. package/lib/features/master-detail.d.ts.map +0 -1
  303. package/lib/features/multi-sort.d.ts.map +0 -1
  304. package/lib/features/pinned-columns.d.ts.map +0 -1
  305. package/lib/features/pinned-rows.d.ts.map +0 -1
  306. package/lib/features/pivot.d.ts.map +0 -1
  307. package/lib/features/print.d.ts.map +0 -1
  308. package/lib/features/registry.d.ts.map +0 -1
  309. package/lib/features/registry.spec.js +0 -5
  310. package/lib/features/registry.spec.js.map +0 -1
  311. package/lib/features/reorder-columns.d.ts.map +0 -1
  312. package/lib/features/reorder-rows.d.ts.map +0 -1
  313. package/lib/features/responsive.d.ts.map +0 -1
  314. package/lib/features/selection.d.ts.map +0 -1
  315. package/lib/features/server-side.d.ts.map +0 -1
  316. package/lib/features/tree.d.ts.map +0 -1
  317. package/lib/features/undo-redo.d.ts.map +0 -1
  318. package/lib/features/visibility.d.ts.map +0 -1
  319. package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +0 -1
  320. package/lib/plugins/clipboard/copy.d.ts.map +0 -1
  321. package/lib/plugins/clipboard/index.d.ts.map +0 -1
  322. package/lib/plugins/clipboard/paste.d.ts.map +0 -1
  323. package/lib/plugins/clipboard/types.d.ts.map +0 -1
  324. package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts.map +0 -1
  325. package/lib/plugins/column-virtualization/column-virtualization.d.ts.map +0 -1
  326. package/lib/plugins/column-virtualization/index.d.ts.map +0 -1
  327. package/lib/plugins/column-virtualization/types.d.ts.map +0 -1
  328. package/lib/plugins/context-menu/ContextMenuPlugin.d.ts.map +0 -1
  329. package/lib/plugins/context-menu/index.d.ts.map +0 -1
  330. package/lib/plugins/context-menu/menu.d.ts.map +0 -1
  331. package/lib/plugins/context-menu/types.d.ts.map +0 -1
  332. package/lib/plugins/editing/EditingPlugin.d.ts.map +0 -1
  333. package/lib/plugins/editing/editors.d.ts.map +0 -1
  334. package/lib/plugins/editing/index.d.ts.map +0 -1
  335. package/lib/plugins/editing/internal/cell-validation.d.ts.map +0 -1
  336. package/lib/plugins/editing/internal/dirty-tracking-manager.d.ts.map +0 -1
  337. package/lib/plugins/editing/internal/dirty-tracking.d.ts.map +0 -1
  338. package/lib/plugins/editing/internal/editor-injection.d.ts.map +0 -1
  339. package/lib/plugins/editing/internal/helpers.d.ts.map +0 -1
  340. package/lib/plugins/editing/types.d.ts.map +0 -1
  341. package/lib/plugins/export/ExportPlugin.d.ts.map +0 -1
  342. package/lib/plugins/export/csv.d.ts.map +0 -1
  343. package/lib/plugins/export/excel.d.ts.map +0 -1
  344. package/lib/plugins/export/index.d.ts.map +0 -1
  345. package/lib/plugins/export/types.d.ts.map +0 -1
  346. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +0 -1
  347. package/lib/plugins/filtering/filter-model.d.ts.map +0 -1
  348. package/lib/plugins/filtering/filter-panel-date.d.ts.map +0 -1
  349. package/lib/plugins/filtering/filter-panel-default.d.ts.map +0 -1
  350. package/lib/plugins/filtering/filter-panel-number.d.ts.map +0 -1
  351. package/lib/plugins/filtering/index.d.ts.map +0 -1
  352. package/lib/plugins/filtering/types.d.ts.map +0 -1
  353. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +0 -1
  354. package/lib/plugins/grouping-columns/grouping-columns.d.ts.map +0 -1
  355. package/lib/plugins/grouping-columns/index.d.ts.map +0 -1
  356. package/lib/plugins/grouping-columns/types.d.ts.map +0 -1
  357. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +0 -1
  358. package/lib/plugins/grouping-rows/grouping-rows.d.ts.map +0 -1
  359. package/lib/plugins/grouping-rows/index.d.ts.map +0 -1
  360. package/lib/plugins/grouping-rows/types.d.ts.map +0 -1
  361. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +0 -1
  362. package/lib/plugins/master-detail/index.d.ts.map +0 -1
  363. package/lib/plugins/master-detail/master-detail.d.ts.map +0 -1
  364. package/lib/plugins/master-detail/types.d.ts.map +0 -1
  365. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +0 -1
  366. package/lib/plugins/multi-sort/index.d.ts.map +0 -1
  367. package/lib/plugins/multi-sort/multi-sort.d.ts.map +0 -1
  368. package/lib/plugins/multi-sort/types.d.ts.map +0 -1
  369. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +0 -1
  370. package/lib/plugins/pinned-columns/index.d.ts.map +0 -1
  371. package/lib/plugins/pinned-columns/pinned-columns.d.ts.map +0 -1
  372. package/lib/plugins/pinned-columns/types.d.ts.map +0 -1
  373. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +0 -1
  374. package/lib/plugins/pinned-rows/index.d.ts.map +0 -1
  375. package/lib/plugins/pinned-rows/pinned-rows.d.ts.map +0 -1
  376. package/lib/plugins/pinned-rows/types.d.ts.map +0 -1
  377. package/lib/plugins/pivot/PivotPlugin.d.ts.map +0 -1
  378. package/lib/plugins/pivot/index.d.ts.map +0 -1
  379. package/lib/plugins/pivot/pivot-engine.d.ts.map +0 -1
  380. package/lib/plugins/pivot/pivot-model.d.ts.map +0 -1
  381. package/lib/plugins/pivot/pivot-panel.d.ts.map +0 -1
  382. package/lib/plugins/pivot/pivot-rows.d.ts.map +0 -1
  383. package/lib/plugins/pivot/types.d.ts.map +0 -1
  384. package/lib/plugins/print/PrintPlugin.d.ts.map +0 -1
  385. package/lib/plugins/print/index.d.ts.map +0 -1
  386. package/lib/plugins/print/print-isolated.d.ts.map +0 -1
  387. package/lib/plugins/print/types.d.ts.map +0 -1
  388. package/lib/plugins/reorder-columns/ReorderPlugin.d.ts.map +0 -1
  389. package/lib/plugins/reorder-columns/column-drag.d.ts.map +0 -1
  390. package/lib/plugins/reorder-columns/index.d.ts.map +0 -1
  391. package/lib/plugins/reorder-columns/types.d.ts.map +0 -1
  392. package/lib/plugins/reorder-rows/RowReorderPlugin.d.ts.map +0 -1
  393. package/lib/plugins/reorder-rows/index.d.ts.map +0 -1
  394. package/lib/plugins/reorder-rows/types.d.ts.map +0 -1
  395. package/lib/plugins/responsive/ResponsivePlugin.d.ts.map +0 -1
  396. package/lib/plugins/responsive/index.d.ts.map +0 -1
  397. package/lib/plugins/responsive/types.d.ts.map +0 -1
  398. package/lib/plugins/selection/SelectionPlugin.d.ts.map +0 -1
  399. package/lib/plugins/selection/index.d.ts.map +0 -1
  400. package/lib/plugins/selection/range-selection.d.ts.map +0 -1
  401. package/lib/plugins/selection/row-selection.d.ts.map +0 -1
  402. package/lib/plugins/selection/types.d.ts.map +0 -1
  403. package/lib/plugins/server-side/ServerSidePlugin.d.ts.map +0 -1
  404. package/lib/plugins/server-side/cache.d.ts.map +0 -1
  405. package/lib/plugins/server-side/datasource.d.ts.map +0 -1
  406. package/lib/plugins/server-side/index.d.ts.map +0 -1
  407. package/lib/plugins/server-side/types.d.ts.map +0 -1
  408. package/lib/plugins/shared/data-collection.d.ts.map +0 -1
  409. package/lib/plugins/tree/TreePlugin.d.ts.map +0 -1
  410. package/lib/plugins/tree/index.d.ts.map +0 -1
  411. package/lib/plugins/tree/tree-data.d.ts.map +0 -1
  412. package/lib/plugins/tree/tree-detect.d.ts.map +0 -1
  413. package/lib/plugins/tree/types.d.ts.map +0 -1
  414. package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts.map +0 -1
  415. package/lib/plugins/undo-redo/history.d.ts.map +0 -1
  416. package/lib/plugins/undo-redo/index.d.ts.map +0 -1
  417. package/lib/plugins/undo-redo/types.d.ts.map +0 -1
  418. package/lib/plugins/visibility/VisibilityPlugin.d.ts.map +0 -1
  419. package/lib/plugins/visibility/index.d.ts.map +0 -1
  420. package/lib/plugins/visibility/types.d.ts.map +0 -1
  421. package/lib/plugins/visibility/visibility.d.ts.map +0 -1
  422. package/public.d.ts.map +0 -1
@@ -58,6 +58,10 @@ export interface ColumnMoveDetail {
58
58
  columnOrder: string[];
59
59
  }
60
60
  declare module '../../core/types' {
61
+ interface DataGridEventMap {
62
+ /** Fired when a column is reordered via drag-and-drop (cancelable). Call `preventDefault()` to reject the move. @group Column Reorder Events */
63
+ 'column-move': ColumnMoveDetail;
64
+ }
61
65
  interface PluginNameMap {
62
66
  /** Primary name for the column reorder plugin */
63
67
  reorderColumns: import('./ReorderPlugin').ReorderPlugin;
@@ -67,4 +71,3 @@ declare module '../../core/types' {
67
71
  reorder: import('./ReorderPlugin').ReorderPlugin;
68
72
  }
69
73
  }
70
- //# sourceMappingURL=types.d.ts.map
@@ -54,8 +54,8 @@ export declare const ROW_DRAG_HANDLE_FIELD = "__tbw_row_drag";
54
54
  * plugins: [new RowReorderPlugin()],
55
55
  * };
56
56
  *
57
- * grid.addEventListener('row-move', (e) => {
58
- * console.log('Row moved from', e.detail.fromIndex, 'to', e.detail.toIndex);
57
+ * grid.on('row-move', ({ fromIndex, toIndex }) => {
58
+ * console.log('Row moved from', fromIndex, 'to', toIndex);
59
59
  * });
60
60
  * ```
61
61
  *
@@ -73,6 +73,7 @@ export declare const ROW_DRAG_HANDLE_FIELD = "__tbw_row_drag";
73
73
  * @see {@link RowMoveDetail} for the event detail structure
74
74
  */
75
75
  export declare class RowReorderPlugin extends BaseGridPlugin<RowReorderConfig> {
76
+ #private;
76
77
  /** @internal */
77
78
  readonly name = "reorderRows";
78
79
  /** @internal */
@@ -170,4 +171,3 @@ export declare class RowReorderPlugin extends BaseGridPlugin<RowReorderConfig> {
170
171
  */
171
172
  private clearDebounceTimer;
172
173
  }
173
- //# sourceMappingURL=RowReorderPlugin.d.ts.map
@@ -6,4 +6,3 @@
6
6
  */
7
7
  export { ROW_DRAG_HANDLE_FIELD, RowReorderPlugin } from './RowReorderPlugin';
8
8
  export type { PendingMove, RowMoveDetail, RowReorderConfig } from './types';
9
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- document.createElement("template").innerHTML='<div class="cell" role="gridcell" part="cell"></div>';function e(e,t){if(e._virtualization?.enabled){const{rowHeight:t,container:r,viewportEl:i}=e._virtualization,o=r,n=i?.clientHeight??o?.clientHeight??0;if(o&&n>0){const r=e._focusRow*t;r<o.scrollTop?o.scrollTop=r:r+t>o.scrollTop+n&&(o.scrollTop=r-n+t)}}const r=void 0!==e._activeEditRows&&-1!==e._activeEditRows||!!e._isGridEditMode;var i;r||e.refreshVirtualWindow(!1),(i=e._bodyEl)&&i.querySelectorAll(".cell-focus").forEach(e=>e.classList.remove("cell-focus")),Array.from(e._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach(e=>{e.setAttribute("aria-selected","false")});const o=e._focusRow,n=e._virtualization.start??0,s=e._virtualization.end??e._rows.length;if(o>=n&&o<s){const i=e._bodyEl.querySelectorAll(".data-grid-row")[o-n];let s=i?.children[e._focusCol];if(s&&s.classList?.contains("cell")||(s=i?.querySelector(`.cell[data-col="${e._focusCol}"]`)??i?.querySelector(".cell[data-col]")),s){s.classList.add("cell-focus"),s.setAttribute("aria-selected","true");const o=e.querySelector(".tbw-scroll-area");if(o&&s&&(!r||t?.forceHorizontalScroll)){const t=e._getHorizontalScrollOffsets?.(i??void 0,s)??{left:0,right:0};if(!t.skipScroll){const e=s.getBoundingClientRect(),r=o.getBoundingClientRect(),i=e.left-r.left+o.scrollLeft,n=i+e.width,a=o.scrollLeft+t.left,l=o.scrollLeft+o.clientWidth-t.right;i<a?o.scrollLeft=i-t.left:n>l&&(o.scrollLeft=n-o.clientWidth+t.right)}}if(r&&s.classList.contains("editing")){const e=s.querySelector('input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])');if(e&&document.activeElement!==e)try{e.focus({preventScroll:!0})}catch{}}else if(r&&!s.contains(document.activeElement)){s.hasAttribute("tabindex")||s.setAttribute("tabindex","-1");try{s.focus({preventScroll:!0})}catch{}}else if(!r){const t=e;document.activeElement!==t&&t.focus({preventScroll:!0})}}}}document.createElement("template").innerHTML='<div class="data-grid-row" role="row" part="row"></div>';const t='<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>',r={expand:"▶",collapse:"▼",sortAsc:"▲",sortDesc:"▼",sortNone:"⇅",submenuArrow:"▶",dragHandle:"⋮⋮",toolPanel:"☰",filter:t,filterActive:t,print:"🖨️"};class i{static dependencies;static manifest;aliases;version="undefined"!=typeof __GRID_VERSION__?__GRID_VERSION__:"dev";styles;cellRenderers;headerRenderers;cellEditors;grid;config;userConfig;#e;get defaultConfig(){return{}}constructor(e={}){this.userConfig=e}attach(e){this.#e?.abort(),this.#e=new AbortController,this.grid=e,this.config={...this.defaultConfig,...this.userConfig}}detach(){this.#e?.abort(),this.#e=void 0}getPlugin(e){return this.grid?.getPlugin(e)}emit(e,t){this.grid?.dispatchEvent?.(new CustomEvent(e,{detail:t,bubbles:!0}))}emitCancelable(e,t){const r=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0});return this.grid?.dispatchEvent?.(r),r.defaultPrevented}on(e,t){this.grid?._pluginManager?.subscribe(this,e,t)}off(e){this.grid?._pluginManager?.unsubscribe(this,e)}emitPluginEvent(e,t){this.grid?._pluginManager?.emitPluginEvent(e,t)}requestRender(){this.grid?.requestRender?.()}requestColumnsRender(){this.grid?.requestColumnsRender?.()}requestRenderWithFocus(){this.grid?.requestRenderWithFocus?.()}requestAfterRender(){this.grid?.requestAfterRender?.()}requestVirtualRefresh(){this.grid?.requestVirtualRefresh?.()}get rows(){return this.grid?.rows??[]}get sourceRows(){return this.grid?.sourceRows??[]}get columns(){return this.grid?.columns??[]}get visibleColumns(){return this.grid?._visibleColumns??[]}get gridElement(){return this.grid}get disconnectSignal(){return this.#e?.signal??this.grid?.disconnectSignal}get gridIcons(){const e=this.grid?.gridConfig?.icons??{};return{...r,...e}}get isAnimationEnabled(){const e=this.grid?.effectiveConfig?.animation?.mode??"reduced-motion";if(!1===e||"off"===e)return!1;if(!0===e||"on"===e)return!0;const t=this.gridElement;if(t){return"0"!==getComputedStyle(t).getPropertyValue("--tbw-animation-enabled").trim()}return!0}get animationDuration(){const e=this.gridElement;if(e){const t=getComputedStyle(e).getPropertyValue("--tbw-animation-duration").trim(),r=parseInt(t,10);if(!isNaN(r))return r}return 200}resolveIcon(e,t){return void 0!==t?t:this.gridIcons[e]}setIcon(e,t){"string"==typeof t?e.innerHTML=t:t instanceof HTMLElement&&(e.innerHTML="",e.appendChild(t.cloneNode(!0)))}warn(e){console.warn(`[tbw-grid:${this.name}] ${e}`)}}const o="__tbw_row_drag";class n extends i{name="reorderRows";aliases=["rowReorder"];styles='@layer tbw-plugins{[data-field=__tbw_row_drag]{display:flex;align-items:center;justify-content:center}.dg-row-drag-handle{display:flex;align-items:center;justify-content:center;min-width:1em;min-height:1em;cursor:grab;-webkit-user-select:none;user-select:none;color:var(--tbw-row-reorder-handle-color, var(--tbw-color-fg-muted));transition:color var(--tbw-transition-duration, .12s) var(--tbw-transition-ease, ease);font-size:var(--tbw-font-size, 1em);letter-spacing:-2px}.dg-row-drag-handle:hover{color:var(--tbw-row-reorder-handle-hover, var(--tbw-color-fg))}.dg-row-drag-handle:active{cursor:grabbing}.data-grid-row.dragging{opacity:.6}.data-grid-row.drop-target{position:relative}.data-grid-row.drop-target.drop-before:before{content:"";position:absolute;top:0;left:0;right:0;height:2px;background-color:var(--tbw-row-reorder-indicator, var(--tbw-color-accent));z-index:10}.data-grid-row.drop-target.drop-after:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background-color:var(--tbw-row-reorder-indicator, var(--tbw-color-accent));z-index:10}.data-grid-row.keyboard-moving{background-color:var(--tbw-row-reorder-moving-bg, var(--tbw-focus-background));box-shadow:0 0 0 1px var(--tbw-row-reorder-moving-border, var(--tbw-color-accent)) inset}.data-grid-row.flip-animating{transition:transform var(--tbw-animation-duration, .2s) ease-out;will-change:transform;z-index:1}}';get defaultConfig(){return{enableKeyboard:!0,showDragHandle:!0,dragHandlePosition:"left",dragHandleWidth:40,debounceMs:150,animation:"flip"}}get animationType(){return!!this.isAnimationEnabled&&(void 0!==this.config.animation?this.config.animation:"flip")}isDragging=!1;draggedRowIndex=null;dropRowIndex=null;pendingMove=null;debounceTimer=null;lastFocusCol=0;attach(e){super.attach(e),this.setupDelegatedDragListeners()}detach(){this.clearDebounceTimer(),this.isDragging=!1,this.draggedRowIndex=null,this.dropRowIndex=null,this.pendingMove=null}processColumns(e){if(!this.config.showDragHandle)return[...e];const t={field:o,header:"",width:this.config.dragHandleWidth??40,resizable:!1,sortable:!1,filterable:!1,meta:{lockPosition:!0,suppressMovable:!0,utility:!0},viewRenderer:()=>{const e=document.createElement("div");return e.className="dg-row-drag-handle",e.setAttribute("aria-label","Drag to reorder"),e.setAttribute("role","button"),e.setAttribute("tabindex","-1"),e.draggable=!0,this.setIcon(e,this.resolveIcon("dragHandle")),e}};return"right"===this.config.dragHandlePosition?[...e,t]:[t,...e]}afterRender(){}onKeyDown(e){if(!this.config.enableKeyboard)return;if(!e.ctrlKey||"ArrowUp"!==e.key&&"ArrowDown"!==e.key)return;const t=this.grid,r=t._focusRow,i=t._rows??this.sourceRows;if(r<0||r>=i.length)return;const o="ArrowUp"===e.key?"up":"down",n="up"===o?r-1:r+1;if(n<0||n>=i.length)return;const s=i[r];return!this.config.canMove||this.config.canMove(s,r,n,o)?(this.handleKeyboardMove(s,r,n,o,t._focusCol),e.preventDefault(),e.stopPropagation(),!0):void 0}onCellClick(){this.flushPendingMove()}moveRow(e,t){const r=[...this.sourceRows];if(e<0||e>=r.length)return;if(t<0||t>=r.length)return;if(e===t)return;const i=t<e?"up":"down",o=r[e];this.config.canMove&&!this.config.canMove(o,e,t,i)||this.executeMove(o,e,t,"keyboard")}canMoveRow(e,t){const r=this.sourceRows;if(e<0||e>=r.length)return!1;if(t<0||t>=r.length)return!1;if(e===t)return!1;if(!this.config.canMove)return!0;const i=t<e?"up":"down";return this.config.canMove(r[e],e,t,i)}setupDelegatedDragListeners(){const e=this.gridElement;if(!e)return;const t=this.disconnectSignal;e.addEventListener("dragstart",e=>{const t=e,r=t.target.closest(".dg-row-drag-handle");if(!r)return;const i=r.closest(".data-grid-row");if(!i)return;const o=this.getRowIndex(i);o<0||(this.isDragging=!0,this.draggedRowIndex=o,t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",String(o))),i.classList.add("dragging"))},{signal:t}),e.addEventListener("dragend",()=>{this.isDragging=!1,this.draggedRowIndex=null,this.dropRowIndex=null,this.clearDragClasses()},{signal:t}),e.addEventListener("dragover",e=>{const t=e;if(!this.isDragging||null===this.draggedRowIndex)return;const r=t.target.closest(".data-grid-row");if(!r)return;t.preventDefault();const i=this.getRowIndex(r);if(i<0||i===this.draggedRowIndex)return;const o=r.getBoundingClientRect(),n=o.top+o.height/2,s=t.clientY<n;this.dropRowIndex=s?i:i+1,r.classList.add("drop-target"),r.classList.toggle("drop-before",s),r.classList.toggle("drop-after",!s)},{signal:t}),e.addEventListener("dragleave",e=>{const t=e.target.closest(".data-grid-row");t&&t.classList.remove("drop-target","drop-before","drop-after")},{signal:t}),e.addEventListener("drop",e=>{e.preventDefault();const t=this.draggedRowIndex;let r=this.dropRowIndex;if(this.isDragging&&null!==t&&null!==r&&(r>t&&r--,t!==r)){const e=this.sourceRows[t],i=r<t?"up":"down";this.config.canMove&&!this.config.canMove(e,t,r,i)||this.executeMove(e,t,r,"drag")}},{signal:t})}handleKeyboardMove(t,r,i,o,n){this.pendingMove?this.pendingMove.currentIndex=i:this.pendingMove={originalIndex:r,currentIndex:i,row:t},this.lastFocusCol=n;const s=this.grid,a=[...s._rows??this.sourceRows],[l]=a.splice(r,1);a.splice(i,0,l),s._rows=a,s._focusRow=i,s._focusCol=n,s.refreshVirtualWindow(!0),e(s),this.clearDebounceTimer(),this.debounceTimer=setTimeout(()=>{this.flushPendingMove()},this.config.debounceMs??300)}flushPendingMove(){if(this.clearDebounceTimer(),!this.pendingMove)return;const{originalIndex:t,currentIndex:r,row:i}=this.pendingMove;if(this.pendingMove=null,t===r)return;const o={row:i,fromIndex:t,toIndex:r,rows:[...this.sourceRows],source:"keyboard"};if(this.emitCancelable("row-move",o)){const i=[...this.sourceRows],[o]=i.splice(r,1);i.splice(t,0,o);const n=this.grid;n._rows=i,n._focusRow=t,n._focusCol=this.lastFocusCol,n.refreshVirtualWindow(!0),e(n)}}executeMove(e,t,r,i){const o=[...this.sourceRows],[n]=o.splice(t,1);o.splice(r,0,n);const s={row:e,fromIndex:t,toIndex:r,rows:o,source:i};if(!this.emitCancelable("row-move",s))if("flip"===this.animationType&&this.gridElement){const e=this.captureRowPositions();this.grid.rows=o,requestAnimationFrame(()=>{this.gridElement.offsetHeight,this.animateFLIP(e,t,r)})}else this.grid.rows=o}captureRowPositions(){const e=/* @__PURE__ */new Map;return this.gridElement?.querySelectorAll(".data-grid-row").forEach(t=>{const r=this.getRowIndex(t);r>=0&&e.set(r,t.getBoundingClientRect().top)}),e}animateFLIP(e,t,r){const i=this.gridElement;if(!i||0===e.size)return;const o=Math.min(t,r),n=Math.max(t,r),s=[];if(i.querySelectorAll(".data-grid-row").forEach(i=>{const a=i,l=this.getRowIndex(a);if(l<0||l<o||l>n)return;let d;d=l===r?t:t<r?l+1:l-1;const c=e.get(d);if(void 0===c)return;const g=c-a.getBoundingClientRect().top;Math.abs(g)>1&&s.push({el:a,deltaY:g})}),0===s.length)return;s.forEach(({el:e,deltaY:t})=>{e.style.transform=`translateY(${t}px)`}),i.offsetHeight;const a=this.animationDuration;requestAnimationFrame(()=>{s.forEach(({el:e})=>{e.classList.add("flip-animating"),e.style.transform=""}),setTimeout(()=>{s.forEach(({el:e})=>{e.style.transform="",e.classList.remove("flip-animating")})},a+50)})}getRowIndex(e){const t=e.querySelector(".cell[data-row]");return t?parseInt(t.getAttribute("data-row")??"-1",10):-1}clearDragClasses(){this.gridElement?.querySelectorAll(".data-grid-row").forEach(e=>{e.classList.remove("dragging","drop-target","drop-before","drop-after")})}clearDebounceTimer(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}}export{o as ROW_DRAG_HANDLE_FIELD,n as RowReorderPlugin};
1
+ document.createElement("template").innerHTML='<div class="cell" role="gridcell" part="cell"></div>';function e(e,t){if(e._virtualization?.enabled){const{rowHeight:t,container:r,viewportEl:i}=e._virtualization,o=r,n=i?.clientHeight??o?.clientHeight??0;if(o&&n>0){const r=e._focusRow*t;r<o.scrollTop?o.scrollTop=r:r+t>o.scrollTop+n&&(o.scrollTop=r-n+t)}}const r=void 0!==e._activeEditRows&&-1!==e._activeEditRows||!!e._isGridEditMode;var i;r||e.refreshVirtualWindow(!1),(i=e._bodyEl)&&i.querySelectorAll(".cell-focus").forEach(e=>e.classList.remove("cell-focus")),Array.from(e._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach(e=>{e.setAttribute("aria-selected","false")});const o=e._focusRow,n=e._virtualization.start??0,s=e._virtualization.end??e._rows.length;if(o>=n&&o<s){const i=e._bodyEl.querySelectorAll(".data-grid-row")[o-n];let s=i?.children[e._focusCol];if(s&&s.classList?.contains("cell")||(s=i?.querySelector(`.cell[data-col="${e._focusCol}"]`)??i?.querySelector(".cell[data-col]")),s){s.classList.add("cell-focus"),s.setAttribute("aria-selected","true");const o=e.querySelector(".tbw-scroll-area");if(o&&s&&(!r||t?.forceHorizontalScroll)){const t=e._getHorizontalScrollOffsets?.(i??void 0,s)??{left:0,right:0};if(!t.skipScroll){const e=s.getBoundingClientRect(),r=o.getBoundingClientRect(),i=e.left-r.left+o.scrollLeft,n=i+e.width,a=o.scrollLeft+t.left,l=o.scrollLeft+o.clientWidth-t.right;i<a?o.scrollLeft=i-t.left:n>l&&(o.scrollLeft=n-o.clientWidth+t.right)}}if(r&&s.classList.contains("editing")){const e=s.querySelector('input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])');if(e&&document.activeElement!==e)try{e.focus({preventScroll:!0})}catch{}}else if(r&&!s.contains(document.activeElement)){s.hasAttribute("tabindex")||s.setAttribute("tabindex","-1");try{s.focus({preventScroll:!0})}catch{}}else r||document.activeElement!==e&&e.focus({preventScroll:!0})}}}document.createElement("template").innerHTML='<div class="data-grid-row" role="row" part="row"></div>';const t='<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>',r={expand:"▶",collapse:"▼",sortAsc:"▲",sortDesc:"▼",sortNone:"⇅",submenuArrow:"▶",dragHandle:"⋮⋮",toolPanel:"☰",filter:t,filterActive:t,print:"🖨️"};class i{static dependencies;static manifest;aliases;version="undefined"!=typeof __GRID_VERSION__?__GRID_VERSION__:"dev";styles;cellRenderers;headerRenderers;cellEditors;grid;config;userConfig;#e;get defaultConfig(){return{}}constructor(e={}){this.userConfig=e}attach(e){this.#e?.abort(),this.#e=new AbortController,this.grid=e,this.config={...this.defaultConfig,...this.userConfig}}detach(){this.#e?.abort(),this.#e=void 0}getPlugin(e){return this.grid?.getPlugin(e)}emit(e,t){this.grid?.dispatchEvent?.(new CustomEvent(e,{detail:t,bubbles:!0}))}emitCancelable(e,t){const r=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0});return this.grid?.dispatchEvent?.(r),r.defaultPrevented}on(e,t){this.grid?._pluginManager?.subscribe(this,e,t)}off(e){this.grid?._pluginManager?.unsubscribe(this,e)}emitPluginEvent(e,t){this.grid?._pluginManager?.emitPluginEvent(e,t)}requestRender(){this.grid?.requestRender?.()}requestColumnsRender(){this.grid?.requestColumnsRender?.()}requestRenderWithFocus(){this.grid?.requestRenderWithFocus?.()}requestAfterRender(){this.grid?.requestAfterRender?.()}requestVirtualRefresh(){this.grid?.requestVirtualRefresh?.()}get rows(){return this.grid?.rows??[]}get sourceRows(){return this.grid?.sourceRows??[]}get columns(){return this.grid?.columns??[]}get visibleColumns(){return this.grid?._visibleColumns??[]}get gridElement(){return this.grid?._hostElement}get disconnectSignal(){return this.#e?.signal??this.grid?.disconnectSignal}get gridIcons(){const e=this.grid?.gridConfig?.icons??{};return{...r,...e}}get isAnimationEnabled(){const e=this.grid?.effectiveConfig?.animation?.mode??"reduced-motion";if(!1===e||"off"===e)return!1;if(!0===e||"on"===e)return!0;const t=this.gridElement;if(t){return"0"!==getComputedStyle(t).getPropertyValue("--tbw-animation-enabled").trim()}return!0}get animationDuration(){const e=this.gridElement;if(e){const t=getComputedStyle(e).getPropertyValue("--tbw-animation-duration").trim(),r=parseInt(t,10);if(!isNaN(r))return r}return 200}resolveIcon(e,t){return void 0!==t?t:this.gridIcons[e]}setIcon(e,t){"string"==typeof t?e.innerHTML=t:t instanceof HTMLElement&&(e.innerHTML="",e.appendChild(t.cloneNode(!0)))}warn(e){var t,r;console.warn(`${t=this.gridElement.id,r=this.name,`[tbw-grid${t?`#${t}`:""}${r?`:${r}`:""}]`} ${e}`)}}const o="__tbw_row_drag";class n extends i{name="reorderRows";aliases=["rowReorder"];styles='@layer tbw-plugins{[data-field=__tbw_row_drag]{display:flex;align-items:center;justify-content:center}.dg-row-drag-handle{display:flex;align-items:center;justify-content:center;min-width:1em;min-height:1em;cursor:grab;-webkit-user-select:none;user-select:none;color:var(--tbw-row-reorder-handle-color, var(--tbw-color-fg-muted));transition:color var(--tbw-transition-duration, .12s) var(--tbw-transition-ease, ease);font-size:var(--tbw-font-size, 1em);letter-spacing:-2px}.dg-row-drag-handle:hover{color:var(--tbw-row-reorder-handle-hover, var(--tbw-color-fg))}.dg-row-drag-handle:active{cursor:grabbing}.data-grid-row.dragging{opacity:.6}.data-grid-row.drop-target{position:relative}.data-grid-row.drop-target.drop-before:before{content:"";position:absolute;top:0;left:0;right:0;height:2px;background-color:var(--tbw-row-reorder-indicator, var(--tbw-color-accent));z-index:10}.data-grid-row.drop-target.drop-after:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background-color:var(--tbw-row-reorder-indicator, var(--tbw-color-accent));z-index:10}.data-grid-row.keyboard-moving{background-color:var(--tbw-row-reorder-moving-bg, var(--tbw-focus-background));box-shadow:0 0 0 1px var(--tbw-row-reorder-moving-border, var(--tbw-color-accent)) inset}.data-grid-row.flip-animating{transition:transform var(--tbw-animation-duration, .2s) ease-out;will-change:transform;z-index:1}}';get defaultConfig(){return{enableKeyboard:!0,showDragHandle:!0,dragHandlePosition:"left",dragHandleWidth:40,debounceMs:150,animation:"flip"}}get animationType(){return!!this.isAnimationEnabled&&(void 0!==this.config.animation?this.config.animation:"flip")}isDragging=!1;draggedRowIndex=null;dropRowIndex=null;pendingMove=null;debounceTimer=null;lastFocusCol=0;get#t(){return this.grid}attach(e){super.attach(e),this.setupDelegatedDragListeners()}detach(){this.clearDebounceTimer(),this.isDragging=!1,this.draggedRowIndex=null,this.dropRowIndex=null,this.pendingMove=null}processColumns(e){if(!this.config.showDragHandle)return[...e];const t={field:o,header:"",width:this.config.dragHandleWidth??40,resizable:!1,sortable:!1,filterable:!1,meta:{lockPosition:!0,suppressMovable:!0,utility:!0},viewRenderer:()=>{const e=document.createElement("div");return e.className="dg-row-drag-handle",e.setAttribute("aria-label","Drag to reorder"),e.setAttribute("role","button"),e.setAttribute("tabindex","-1"),e.draggable=!0,this.setIcon(e,this.resolveIcon("dragHandle")),e}};return"right"===this.config.dragHandlePosition?[...e,t]:[t,...e]}afterRender(){}onKeyDown(e){if(!this.config.enableKeyboard)return;if(!e.ctrlKey||"ArrowUp"!==e.key&&"ArrowDown"!==e.key)return;const t=this.#t,r=t._focusRow,i=t._rows??this.sourceRows;if(r<0||r>=i.length)return;const o="ArrowUp"===e.key?"up":"down",n="up"===o?r-1:r+1;if(n<0||n>=i.length)return;const s=i[r];return!this.config.canMove||this.config.canMove(s,r,n,o)?(this.handleKeyboardMove(s,r,n,o,t._focusCol),e.preventDefault(),e.stopPropagation(),!0):void 0}onCellClick(){this.flushPendingMove()}moveRow(e,t){const r=[...this.sourceRows];if(e<0||e>=r.length)return;if(t<0||t>=r.length)return;if(e===t)return;const i=t<e?"up":"down",o=r[e];this.config.canMove&&!this.config.canMove(o,e,t,i)||this.executeMove(o,e,t,"keyboard")}canMoveRow(e,t){const r=this.sourceRows;if(e<0||e>=r.length)return!1;if(t<0||t>=r.length)return!1;if(e===t)return!1;if(!this.config.canMove)return!0;const i=t<e?"up":"down";return this.config.canMove(r[e],e,t,i)}setupDelegatedDragListeners(){const e=this.gridElement;if(!e)return;const t=this.disconnectSignal;e.addEventListener("dragstart",e=>{const t=e,r=t.target.closest(".dg-row-drag-handle");if(!r)return;const i=r.closest(".data-grid-row");if(!i)return;const o=this.getRowIndex(i);o<0||(this.isDragging=!0,this.draggedRowIndex=o,t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",String(o))),i.classList.add("dragging"))},{signal:t}),e.addEventListener("dragend",()=>{this.isDragging=!1,this.draggedRowIndex=null,this.dropRowIndex=null,this.clearDragClasses()},{signal:t}),e.addEventListener("dragover",e=>{const t=e;if(!this.isDragging||null===this.draggedRowIndex)return;const r=t.target.closest(".data-grid-row");if(!r)return;t.preventDefault();const i=this.getRowIndex(r);if(i<0||i===this.draggedRowIndex)return;const o=r.getBoundingClientRect(),n=o.top+o.height/2,s=t.clientY<n;this.dropRowIndex=s?i:i+1,r.classList.add("drop-target"),r.classList.toggle("drop-before",s),r.classList.toggle("drop-after",!s)},{signal:t}),e.addEventListener("dragleave",e=>{const t=e.target.closest(".data-grid-row");t&&t.classList.remove("drop-target","drop-before","drop-after")},{signal:t}),e.addEventListener("drop",e=>{e.preventDefault();const t=this.draggedRowIndex;let r=this.dropRowIndex;if(this.isDragging&&null!==t&&null!==r&&(r>t&&r--,t!==r)){const e=this.sourceRows[t],i=r<t?"up":"down";this.config.canMove&&!this.config.canMove(e,t,r,i)||this.executeMove(e,t,r,"drag")}},{signal:t})}handleKeyboardMove(t,r,i,o,n){this.pendingMove?this.pendingMove.currentIndex=i:this.pendingMove={originalIndex:r,currentIndex:i,row:t},this.lastFocusCol=n;const s=this.#t,a=[...s._rows??this.sourceRows],[l]=a.splice(r,1);a.splice(i,0,l),s._rows=a,s._focusRow=i,s._focusCol=n,s.refreshVirtualWindow(!0),e(s),this.clearDebounceTimer(),this.debounceTimer=setTimeout(()=>{this.flushPendingMove()},this.config.debounceMs??300)}flushPendingMove(){if(this.clearDebounceTimer(),!this.pendingMove)return;const{originalIndex:t,currentIndex:r,row:i}=this.pendingMove;if(this.pendingMove=null,t===r)return;const o={row:i,fromIndex:t,toIndex:r,rows:[...this.sourceRows],source:"keyboard"};if(this.emitCancelable("row-move",o)){const i=[...this.sourceRows],[o]=i.splice(r,1);i.splice(t,0,o);const n=this.#t;n._rows=i,n._focusRow=t,n._focusCol=this.lastFocusCol,n.refreshVirtualWindow(!0),e(n)}}executeMove(e,t,r,i){const o=[...this.sourceRows],[n]=o.splice(t,1);o.splice(r,0,n);const s={row:e,fromIndex:t,toIndex:r,rows:o,source:i};if(!this.emitCancelable("row-move",s))if("flip"===this.animationType&&this.gridElement){const e=this.captureRowPositions();this.grid.rows=o,requestAnimationFrame(()=>{this.gridElement.offsetHeight,this.animateFLIP(e,t,r)})}else this.grid.rows=o}captureRowPositions(){const e=/* @__PURE__ */new Map;return this.gridElement?.querySelectorAll(".data-grid-row").forEach(t=>{const r=this.getRowIndex(t);r>=0&&e.set(r,t.getBoundingClientRect().top)}),e}animateFLIP(e,t,r){const i=this.gridElement;if(!i||0===e.size)return;const o=Math.min(t,r),n=Math.max(t,r),s=[];if(i.querySelectorAll(".data-grid-row").forEach(i=>{const a=i,l=this.getRowIndex(a);if(l<0||l<o||l>n)return;let d;d=l===r?t:t<r?l+1:l-1;const c=e.get(d);if(void 0===c)return;const g=c-a.getBoundingClientRect().top;Math.abs(g)>1&&s.push({el:a,deltaY:g})}),0===s.length)return;s.forEach(({el:e,deltaY:t})=>{e.style.transform=`translateY(${t}px)`}),i.offsetHeight;const a=this.animationDuration;requestAnimationFrame(()=>{s.forEach(({el:e})=>{e.classList.add("flip-animating"),e.style.transform=""}),setTimeout(()=>{s.forEach(({el:e})=>{e.style.transform="",e.classList.remove("flip-animating")})},a+50)})}getRowIndex(e){const t=e.querySelector(".cell[data-row]");return t?parseInt(t.getAttribute("data-row")??"-1",10):-1}clearDragClasses(){this.gridElement?.querySelectorAll(".data-grid-row").forEach(e=>{e.classList.remove("dragging","drop-target","drop-before","drop-after")})}clearDebounceTimer(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}}export{o as ROW_DRAG_HANDLE_FIELD,n as RowReorderPlugin};
2
2
  //# sourceMappingURL=index.js.map