handsontable 15.2.0 → 15.3.0-next-6f5f494-20250424

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 (224) hide show
  1. package/3rdparty/walkontable/src/cell/range.js +14 -0
  2. package/3rdparty/walkontable/src/cell/range.mjs +14 -0
  3. package/3rdparty/walkontable/src/core/_base.js +2 -2
  4. package/3rdparty/walkontable/src/core/_base.mjs +3 -3
  5. package/3rdparty/walkontable/src/overlay/_base.js +0 -2
  6. package/3rdparty/walkontable/src/overlay/_base.mjs +0 -2
  7. package/3rdparty/walkontable/src/overlay/bottom.js +9 -6
  8. package/3rdparty/walkontable/src/overlay/bottom.mjs +9 -6
  9. package/3rdparty/walkontable/src/overlay/inlineStart.js +8 -5
  10. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +8 -5
  11. package/3rdparty/walkontable/src/overlay/top.js +11 -6
  12. package/3rdparty/walkontable/src/overlay/top.mjs +11 -6
  13. package/3rdparty/walkontable/src/overlays.js +15 -11
  14. package/3rdparty/walkontable/src/overlays.mjs +15 -11
  15. package/3rdparty/walkontable/src/renderer/rowHeaders.js +4 -1
  16. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +4 -1
  17. package/3rdparty/walkontable/src/selection/border/border.js +5 -0
  18. package/3rdparty/walkontable/src/selection/border/border.mjs +5 -0
  19. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +3 -4
  20. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +3 -4
  21. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +8 -10
  22. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +8 -10
  23. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +3 -4
  24. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +3 -4
  25. package/3rdparty/walkontable/src/table.js +5 -2
  26. package/3rdparty/walkontable/src/table.mjs +5 -2
  27. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.js +0 -2
  28. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.mjs +0 -2
  29. package/CHANGELOG.md +45 -1
  30. package/README.md +1 -1
  31. package/base.js +2 -2
  32. package/base.mjs +2 -2
  33. package/core/focusCatcher/focusDetector.js +1 -1
  34. package/core/focusCatcher/focusDetector.mjs +2 -2
  35. package/core/hooks/constants.js +8 -0
  36. package/core/hooks/constants.mjs +8 -0
  37. package/core/hooks/index.d.ts +1 -0
  38. package/core/viewportScroll/scrollStrategies/columnHeaderScroll.js +7 -5
  39. package/core/viewportScroll/scrollStrategies/columnHeaderScroll.mjs +7 -5
  40. package/core/viewportScroll/scrollStrategies/focusScroll.js +8 -1
  41. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +8 -1
  42. package/core/viewportScroll/scrollStrategies/multipleScroll.js +13 -1
  43. package/core/viewportScroll/scrollStrategies/multipleScroll.mjs +13 -1
  44. package/core/viewportScroll/scrollStrategies/noncontiguousScroll.js +13 -1
  45. package/core/viewportScroll/scrollStrategies/noncontiguousScroll.mjs +13 -1
  46. package/core/viewportScroll/scrollStrategies/rowHeaderScroll.js +7 -5
  47. package/core/viewportScroll/scrollStrategies/rowHeaderScroll.mjs +7 -5
  48. package/core/viewportScroll/scrollStrategies/singleScroll.js +8 -4
  49. package/core/viewportScroll/scrollStrategies/singleScroll.mjs +8 -4
  50. package/core/viewportScroll/utils.js +111 -0
  51. package/core/viewportScroll/utils.mjs +106 -0
  52. package/core.d.ts +2 -3
  53. package/core.js +125 -71
  54. package/core.mjs +126 -72
  55. package/dataMap/dataMap.js +0 -7
  56. package/dataMap/dataMap.mjs +0 -7
  57. package/dataMap/metaManager/index.js +8 -9
  58. package/dataMap/metaManager/index.mjs +8 -9
  59. package/dataMap/metaManager/mods/dynamicCellMeta.js +4 -1
  60. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +4 -1
  61. package/dist/handsontable.css +4 -15
  62. package/dist/handsontable.full.css +4 -17
  63. package/dist/handsontable.full.js +4573 -4013
  64. package/dist/handsontable.full.min.css +3 -3
  65. package/dist/handsontable.full.min.js +148 -148
  66. package/dist/handsontable.js +4287 -3730
  67. package/dist/handsontable.min.css +3 -3
  68. package/dist/handsontable.min.js +19 -19
  69. package/editorManager.js +1 -7
  70. package/editorManager.mjs +1 -7
  71. package/editors/autocompleteEditor/autocompleteEditor.js +31 -7
  72. package/editors/autocompleteEditor/autocompleteEditor.mjs +31 -7
  73. package/focusManager.js +4 -2
  74. package/focusManager.mjs +4 -2
  75. package/helpers/browser.js +1 -1
  76. package/helpers/browser.mjs +1 -1
  77. package/helpers/dom/element.d.ts +1 -0
  78. package/helpers/dom/element.js +20 -0
  79. package/helpers/dom/element.mjs +19 -0
  80. package/helpers/mixed.js +2 -2
  81. package/helpers/mixed.mjs +2 -2
  82. package/helpers/object.js +3 -0
  83. package/helpers/object.mjs +3 -0
  84. package/package.json +1 -1
  85. package/plugins/autoColumnSize/autoColumnSize.js +38 -17
  86. package/plugins/autoColumnSize/autoColumnSize.mjs +38 -17
  87. package/plugins/autoRowSize/autoRowSize.js +12 -6
  88. package/plugins/autoRowSize/autoRowSize.mjs +12 -6
  89. package/plugins/columnSorting/columnSorting.js +0 -4
  90. package/plugins/columnSorting/columnSorting.mjs +0 -4
  91. package/plugins/comments/comments.js +1 -0
  92. package/plugins/comments/comments.mjs +1 -0
  93. package/plugins/contextMenu/menu/defaultShortcutsList.js +2 -2
  94. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +2 -2
  95. package/plugins/contextMenu/menu/menu.js +1 -0
  96. package/plugins/contextMenu/menu/menu.mjs +1 -0
  97. package/plugins/contextMenu/menu/positioner.js +10 -2
  98. package/plugins/contextMenu/menu/positioner.mjs +10 -2
  99. package/plugins/contextMenu/predefinedItems/redo.js +3 -3
  100. package/plugins/contextMenu/predefinedItems/redo.mjs +3 -3
  101. package/plugins/contextMenu/predefinedItems/undo.js +3 -3
  102. package/plugins/contextMenu/predefinedItems/undo.mjs +3 -3
  103. package/plugins/copyPaste/copyPaste.js +12 -9
  104. package/plugins/copyPaste/copyPaste.mjs +12 -9
  105. package/plugins/copyPaste/pasteEvent.js +3 -0
  106. package/plugins/copyPaste/pasteEvent.mjs +3 -0
  107. package/plugins/exportFile/exportFile.d.ts +1 -0
  108. package/plugins/exportFile/exportFile.js +2 -1
  109. package/plugins/exportFile/exportFile.mjs +2 -1
  110. package/plugins/exportFile/types/csv.js +76 -11
  111. package/plugins/exportFile/types/csv.mjs +76 -11
  112. package/plugins/filters/filters.js +24 -23
  113. package/plugins/filters/filters.mjs +24 -23
  114. package/plugins/filters/ui/multipleSelect.js +7 -1
  115. package/plugins/filters/ui/multipleSelect.mjs +7 -1
  116. package/plugins/formulas/formulas.d.ts +1 -1
  117. package/plugins/formulas/formulas.js +57 -60
  118. package/plugins/formulas/formulas.mjs +59 -62
  119. package/plugins/formulas/indexSyncer/axisSyncer.js +5 -1
  120. package/plugins/formulas/indexSyncer/axisSyncer.mjs +5 -1
  121. package/plugins/hiddenColumns/hiddenColumns.js +1 -1
  122. package/plugins/hiddenColumns/hiddenColumns.mjs +1 -1
  123. package/plugins/hiddenRows/hiddenRows.js +1 -1
  124. package/plugins/hiddenRows/hiddenRows.mjs +1 -1
  125. package/plugins/manualColumnResize/manualColumnResize.js +4 -6
  126. package/plugins/manualColumnResize/manualColumnResize.mjs +4 -6
  127. package/plugins/manualRowResize/manualRowResize.js +4 -6
  128. package/plugins/manualRowResize/manualRowResize.mjs +4 -6
  129. package/plugins/mergeCells/mergeCells.js +10 -30
  130. package/plugins/mergeCells/mergeCells.mjs +10 -30
  131. package/plugins/mergeCells/renderer.js +15 -0
  132. package/plugins/mergeCells/renderer.mjs +15 -0
  133. package/plugins/mergeCells/utils.js +31 -0
  134. package/plugins/mergeCells/utils.mjs +27 -0
  135. package/plugins/nestedRows/data/dataManager.js +2 -2
  136. package/plugins/nestedRows/data/dataManager.mjs +2 -2
  137. package/plugins/undoRedo/actions/index.js +0 -2
  138. package/plugins/undoRedo/actions/index.mjs +0 -2
  139. package/plugins/undoRedo/actions/removeColumn.js +19 -14
  140. package/plugins/undoRedo/actions/removeColumn.mjs +19 -14
  141. package/plugins/undoRedo/actions/removeRow.js +12 -4
  142. package/plugins/undoRedo/actions/removeRow.mjs +12 -4
  143. package/selection/selection.js +3 -1
  144. package/selection/selection.mjs +3 -1
  145. package/shortcutContexts/commands/extendCellsSelection/down.js +7 -2
  146. package/shortcutContexts/commands/extendCellsSelection/down.mjs +7 -2
  147. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +8 -2
  148. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +8 -2
  149. package/shortcutContexts/commands/extendCellsSelection/left.js +7 -2
  150. package/shortcutContexts/commands/extendCellsSelection/left.mjs +7 -2
  151. package/shortcutContexts/commands/extendCellsSelection/right.js +7 -2
  152. package/shortcutContexts/commands/extendCellsSelection/right.mjs +7 -2
  153. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +7 -2
  154. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +7 -2
  155. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +3 -1
  156. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +3 -1
  157. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -1
  158. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -1
  159. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -1
  160. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -1
  161. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +3 -1
  162. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +3 -1
  163. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +3 -1
  164. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +3 -1
  165. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +3 -1
  166. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +3 -1
  167. package/shortcutContexts/commands/extendCellsSelection/toRows.js +7 -2
  168. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +7 -2
  169. package/shortcutContexts/commands/extendCellsSelection/up.js +7 -2
  170. package/shortcutContexts/commands/extendCellsSelection/up.mjs +7 -2
  171. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +8 -2
  172. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +8 -2
  173. package/shortcutContexts/commands/index.js +0 -2
  174. package/shortcutContexts/commands/index.mjs +0 -2
  175. package/shortcutContexts/commands/moveCellSelection/down.js +2 -0
  176. package/shortcutContexts/commands/moveCellSelection/down.mjs +2 -0
  177. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +6 -1
  178. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +6 -1
  179. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +8 -3
  180. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -3
  181. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +8 -3
  182. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -3
  183. package/shortcutContexts/commands/moveCellSelection/left.js +6 -1
  184. package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -1
  185. package/shortcutContexts/commands/moveCellSelection/right.js +6 -1
  186. package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -1
  187. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +4 -1
  188. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +4 -1
  189. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +2 -0
  190. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +2 -0
  191. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +2 -0
  192. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +2 -0
  193. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +2 -0
  194. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +2 -0
  195. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +2 -0
  196. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +2 -0
  197. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +2 -0
  198. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +2 -0
  199. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +6 -1
  200. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +6 -1
  201. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +2 -0
  202. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +2 -0
  203. package/shortcutContexts/commands/moveCellSelection/up.js +2 -0
  204. package/shortcutContexts/commands/moveCellSelection/up.mjs +2 -0
  205. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +6 -1
  206. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +6 -1
  207. package/shortcutContexts/commands/selectAllCells.js +7 -2
  208. package/shortcutContexts/commands/selectAllCells.mjs +7 -2
  209. package/shortcutContexts/commands/selectAllCellsAndHeaders.js +7 -2
  210. package/shortcutContexts/commands/selectAllCellsAndHeaders.mjs +7 -2
  211. package/shortcutContexts/index.js +2 -2
  212. package/shortcutContexts/index.mjs +0 -2
  213. package/styles/handsontable.css +15 -17
  214. package/styles/handsontable.min.css +3 -3
  215. package/styles/ht-theme-horizon.css +2 -2
  216. package/styles/ht-theme-horizon.min.css +2 -2
  217. package/styles/ht-theme-main.css +2 -2
  218. package/styles/ht-theme-main.min.css +2 -2
  219. package/tableView.js +5 -8
  220. package/tableView.mjs +5 -8
  221. package/translations/indexMapper.js +0 -1
  222. package/translations/indexMapper.mjs +0 -1
  223. package/utils/ghostTable.js +3 -0
  224. package/utils/ghostTable.mjs +3 -0
package/CHANGELOG.md CHANGED
@@ -9,6 +9,51 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
9
9
 
10
10
  <!-- UNVERSIONED -->
11
11
 
12
+ ## [15.3.0] - 2025-04-29
13
+
14
+ ### Added
15
+ - Added missing boolean type to the editor in the react wrapper [#11514](https://github.com/handsontable/handsontable/pull/11514)
16
+ - Fixed comments for IME and add a new `beforeCompositionstart` hook. [#11521](https://github.com/handsontable/handsontable/pull/11521)
17
+ - Added horizontal scroll to the Filter's by value component [#11561](https://github.com/handsontable/handsontable/pull/11561)
18
+ - Add optional formula sanitization for csv export to prevent CSV Injection attacks [#11592](https://github.com/handsontable/handsontable/pull/11592)
19
+
20
+ ### Changed
21
+ - Improved the initialization time of Handsontable with formulas enabled [#11474](https://github.com/handsontable/handsontable/pull/11474)
22
+ - Changed the size of the manual row and row resize guide line [#11507](https://github.com/handsontable/handsontable/pull/11507)
23
+ - Improve viewport scrolling behavior [#11577](https://github.com/handsontable/handsontable/pull/11577)
24
+
25
+ ### Fixed
26
+ - Fixing issue with NestedRows plugin duplicating rows when moving children [#11362](https://github.com/handsontable/handsontable/pull/11362)
27
+ - Fixed an issue with row resize line alignment and resize handle flickering [#11500](https://github.com/handsontable/handsontable/pull/11500)
28
+ - Fixed an issue with autocomplete caret position after using scroll on a list of choices and dropdown width fixer [#11503](https://github.com/handsontable/handsontable/pull/11503)
29
+ - Fixed copy, cut an paste actions on tables with a selection reaching outside of the rendered viewport. [#11504](https://github.com/handsontable/handsontable/pull/11504)
30
+ - Fix submenu positiongin for all themes. [#11505](https://github.com/handsontable/handsontable/pull/11505)
31
+ - Fixed a problem where re-enabling the Hidden Columns configuration caused an error to be thrown if a selection was a part of the hidden range. [#11508](https://github.com/handsontable/handsontable/pull/11508)
32
+ - Fixed an issue with empty parentNode in the table getCords method [#11509](https://github.com/handsontable/handsontable/pull/11509)
33
+ - Improved undo/redo working for removed rows/columns [#11515](https://github.com/handsontable/handsontable/pull/11515)
34
+ - Fixed rows height calculations for merged cells on Safari [#11517](https://github.com/handsontable/handsontable/pull/11517)
35
+ - Fixed missing (incorrect) render call after dataset change [#11529](https://github.com/handsontable/handsontable/pull/11529)
36
+ - Fixed an issue with the mobile keyboard closing after clicking the filter search input on Android devices [#11532](https://github.com/handsontable/handsontable/pull/11532)
37
+ - Fixed a problem with multiple row header levels being rendered in reverse order. [#11533](https://github.com/handsontable/handsontable/pull/11533)
38
+ - Fixed `TypeError` error for AutoRowSize plugin [#11537](https://github.com/handsontable/handsontable/pull/11537)
39
+ - Allow changing the selection after filter is applied [#11538](https://github.com/handsontable/handsontable/pull/11538)
40
+ - Fixed a problem with the autocomplete editor rendering very slowly when provided with a long list of choices. [#11552](https://github.com/handsontable/handsontable/pull/11552)
41
+ - Fixed an issue with focus catcher accessibility [#11553](https://github.com/handsontable/handsontable/pull/11553)
42
+ - Fixed `TypeError` for rows removal for bottom overlay [#11555](https://github.com/handsontable/handsontable/pull/11555)
43
+ - Fixed calculating the first row height [#11557](https://github.com/handsontable/handsontable/pull/11557)
44
+ - Fixed an issue with highlighting the cell after call updateData [#11558](https://github.com/handsontable/handsontable/pull/11558)
45
+ - Fixed unmerge cells action triggered form keyboard shortcut [#11559](https://github.com/handsontable/handsontable/pull/11559)
46
+ - Fixed arrow left/right shortcuts for menu when the table was configured as `layoutDirection: rtl`. [#11562](https://github.com/handsontable/handsontable/pull/11562)
47
+ - Fixed an issue with duplicate boolean values in filters [#11563](https://github.com/handsontable/handsontable/pull/11563)
48
+ - Fixed an issue with data source for non-string values in the `name` property [#11565](https://github.com/handsontable/handsontable/pull/11565)
49
+ - Fixed settings object not being updated after new hooks [#11566](https://github.com/handsontable/handsontable/pull/11566)
50
+ - Fixed a problem with the table rendering all rows when it's configured to have `0px` height. [#11567](https://github.com/handsontable/handsontable/pull/11567)
51
+ - Fixed copy/paste/cut functionalities for web components [#11572](https://github.com/handsontable/handsontable/pull/11572)
52
+ - Fixed the `allowInvalid` option (both `true` and `false`) for the Dropdown Editor. [#11587](https://github.com/handsontable/handsontable/pull/11587)
53
+ - Fixed a problem with a deprecation warnings being thrown when using Context Menu's Undo and Redo items. [#11588](https://github.com/handsontable/handsontable/pull/11588)
54
+ - Fixed an error being thrown when editing a Autocomplete-typed cells with a long list of choices rendered in a small container. [#11589](https://github.com/handsontable/handsontable/pull/11589)
55
+ - Ensured that there's a single `@charset` entry in the classic theme's CSS files and that it's placed at the beginning of those files. [#11591](https://github.com/handsontable/handsontable/pull/11591)
56
+
12
57
  ## [15.2.0] - 2025-03-19
13
58
 
14
59
  ### Added
@@ -32,7 +77,6 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
32
77
  - Fixed the Context Menu's items' state rendering. [#11422](https://github.com/handsontable/handsontable/pull/11422)
33
78
  - Corrected the checkbox visibility in the no-theme variant. [#11427](https://github.com/handsontable/handsontable/pull/11427)
34
79
  - Fixed problems with the cell content reading with `imeFastEdit` enabled. [#11442](https://github.com/handsontable/handsontable/pull/11442)
35
- - Fixed a problem, where clicking on the Comments' editor element deselected the currently selected cells. [#11446](https://github.com/handsontable/handsontable/pull/11446)
36
80
  - Fixed `hasVerticalScroll` and `hasHorizontalScroll` methods. [#11455](https://github.com/handsontable/handsontable/pull/11455)
37
81
  - Fixed the editor border radius on mobile devices. [#11457](https://github.com/handsontable/handsontable/pull/11457)
38
82
  - Fixed the wrong height of the first row. [#11458](https://github.com/handsontable/handsontable/pull/11458)
package/README.md CHANGED
@@ -81,7 +81,7 @@ You can also use [Yarn](https://yarnpkg.com/package/handsontable), [NuGet](https
81
81
 
82
82
  ```html
83
83
  <!-- Set the container's ID and apply the desired theme -->
84
- <div id="handsontable-example" class="ht-theme-main-dark-auto"></div>
84
+ <div id="handsontable-grid" class="ht-theme-main-dark-auto"></div>
85
85
  ```
86
86
 
87
87
  ### Setup
package/base.js CHANGED
@@ -45,8 +45,8 @@ Handsontable.hooks = _hooks.Hooks.getSingleton();
45
45
  Handsontable.CellCoords = _src.CellCoords;
46
46
  Handsontable.CellRange = _src.CellRange;
47
47
  Handsontable.packageName = 'handsontable';
48
- Handsontable.buildDate = "19/03/2025 09:41:49";
49
- Handsontable.version = "15.2.0";
48
+ Handsontable.buildDate = "24/04/2025 11:28:31";
49
+ Handsontable.version = "15.3.0-next-6f5f494-20250424";
50
50
  Handsontable.languages = {
51
51
  dictionaryKeys: _registry.dictionaryKeys,
52
52
  getLanguageDictionary: _registry.getLanguageDictionary,
package/base.mjs CHANGED
@@ -35,8 +35,8 @@ Handsontable.hooks = Hooks.getSingleton();
35
35
  Handsontable.CellCoords = CellCoords;
36
36
  Handsontable.CellRange = CellRange;
37
37
  Handsontable.packageName = 'handsontable';
38
- Handsontable.buildDate = "19/03/2025 09:41:52";
39
- Handsontable.version = "15.2.0";
38
+ Handsontable.buildDate = "24/04/2025 11:28:36";
39
+ Handsontable.version = "15.3.0-next-6f5f494-20250424";
40
40
  Handsontable.languages = {
41
41
  dictionaryKeys,
42
42
  getLanguageDictionary,
@@ -58,7 +58,7 @@ function createInputElement(hot) {
58
58
  input.name = '__htFocusCatcher';
59
59
  input.classList.add('htFocusCatcher');
60
60
  if (hot.getSettings().ariaTags) {
61
- (0, _element.setAttribute)(input, [(0, _a11y.A11Y_PRESENTATION)(), (0, _a11y.A11Y_HIDDEN)()]);
61
+ (0, _element.setAttribute)(input, [(0, _a11y.A11Y_LABEL)('Focus catcher')]);
62
62
  }
63
63
  return input;
64
64
  }
@@ -1,5 +1,5 @@
1
1
  import { setAttribute } from "../../helpers/dom/element.mjs";
2
- import { A11Y_PRESENTATION, A11Y_HIDDEN } from "../../helpers/a11y.mjs";
2
+ import { A11Y_LABEL } from "../../helpers/a11y.mjs";
3
3
  /**
4
4
  * Installs a focus detector module. The module appends two input elements into the DOM side by side.
5
5
  * When the first input is focused, then it means that a user entered to the component using the TAB key
@@ -54,7 +54,7 @@ function createInputElement(hot) {
54
54
  input.name = '__htFocusCatcher';
55
55
  input.classList.add('htFocusCatcher');
56
56
  if (hot.getSettings().ariaTags) {
57
- setAttribute(input, [A11Y_PRESENTATION(), A11Y_HIDDEN()]);
57
+ setAttribute(input, [A11Y_LABEL('Focus catcher')]);
58
58
  }
59
59
  return input;
60
60
  }
@@ -336,6 +336,14 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
336
336
  * @returns {string[]|undefined} Can return an `Array` of `String`s. Each of these strings will act like class names to be removed from all the cells in the table.
337
337
  */
338
338
  'beforeRemoveCellClassNames',
339
+ /**
340
+ * Hook fired after `compositionstart` event is handled.
341
+ *
342
+ * @event Hooks#beforeCompositionStart
343
+ * @since 15.3.0
344
+ * @param {Event} event A native `composition` event object.
345
+ */
346
+ 'beforeCompositionStart',
339
347
  /**
340
348
  * Fired after getting the cell settings.
341
349
  *
@@ -333,6 +333,14 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
333
333
  * @returns {string[]|undefined} Can return an `Array` of `String`s. Each of these strings will act like class names to be removed from all the cells in the table.
334
334
  */
335
335
  'beforeRemoveCellClassNames',
336
+ /**
337
+ * Hook fired after `compositionstart` event is handled.
338
+ *
339
+ * @event Hooks#beforeCompositionStart
340
+ * @since 15.3.0
341
+ * @param {Event} event A native `composition` event object.
342
+ */
343
+ 'beforeCompositionStart',
336
344
  /**
337
345
  * Fired after getting the cell settings.
338
346
  *
@@ -167,6 +167,7 @@ export interface Events {
167
167
  beforeColumnSort?: (currentSortConfig: ColumnSortingConfig[], destinationSortConfigs: ColumnSortingConfig[]) => void | boolean;
168
168
  beforeColumnWrap?: (isActionInterrupted: { value: boolean }, newCoords: CellCoords, isColumnFlipped: boolean) => void;
169
169
  beforeColumnUnfreeze?: (columnIndex: number, isUnfreezingPerformed: boolean) => void | boolean;
170
+ beforeCompositionStart?: (event: CompositionEvent) => void;
170
171
  beforeContextMenuSetItems?: (menuItems: ContextMenuMenuItemConfig[]) => void;
171
172
  beforeContextMenuShow?: (context: ContextMenu) => void;
172
173
  beforeCopy?: (data: CellValue[][], coords: RangeType[], copiedHeadersCount: { columnHeadersCount: number }) => void | boolean;
@@ -2,6 +2,7 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.columnHeaderScrollStrategy = columnHeaderScrollStrategy;
5
+ var _utils = require("../utils");
5
6
  /**
6
7
  * Scroll strategy for column header selection.
7
8
  *
@@ -9,12 +10,13 @@ exports.columnHeaderScrollStrategy = columnHeaderScrollStrategy;
9
10
  * @returns {function(): function(CellCoords): void}
10
11
  */
11
12
  function columnHeaderScrollStrategy(hot) {
12
- return _ref => {
13
- let {
14
- col
15
- } = _ref;
13
+ return cellCoords => {
14
+ const scrollColumnTarget = (0, _utils.createScrollTargetCalculator)(hot).getComputedColumnTarget(cellCoords);
16
15
  hot.scrollViewportTo({
17
- col
16
+ col: scrollColumnTarget
17
+ }, () => {
18
+ const hasColumnHeaders = !!hot.getSettings().colHeaders;
19
+ (0, _utils.scrollWindowToCell)(hot.getCell(hasColumnHeaders ? -1 : 0, scrollColumnTarget, true));
18
20
  });
19
21
  };
20
22
  }
@@ -1,3 +1,4 @@
1
+ import { scrollWindowToCell, createScrollTargetCalculator } from "../utils.mjs";
1
2
  /**
2
3
  * Scroll strategy for column header selection.
3
4
  *
@@ -5,12 +6,13 @@
5
6
  * @returns {function(): function(CellCoords): void}
6
7
  */
7
8
  export function columnHeaderScrollStrategy(hot) {
8
- return _ref => {
9
- let {
10
- col
11
- } = _ref;
9
+ return cellCoords => {
10
+ const scrollColumnTarget = createScrollTargetCalculator(hot).getComputedColumnTarget(cellCoords);
12
11
  hot.scrollViewportTo({
13
- col
12
+ col: scrollColumnTarget
13
+ }, () => {
14
+ const hasColumnHeaders = !!hot.getSettings().colHeaders;
15
+ scrollWindowToCell(hot.getCell(hasColumnHeaders ? -1 : 0, scrollColumnTarget, true));
14
16
  });
15
17
  };
16
18
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.focusScrollStrategy = focusScrollStrategy;
5
+ var _utils = require("../utils");
5
6
  /**
6
7
  * Scroll strategy for changed the focus position of the selection.
7
8
  *
@@ -10,6 +11,12 @@ exports.focusScrollStrategy = focusScrollStrategy;
10
11
  */
11
12
  function focusScrollStrategy(hot) {
12
13
  return cellCoords => {
13
- hot.scrollViewportTo(cellCoords.toObject());
14
+ hot.scrollViewportTo(cellCoords.toObject(), () => {
15
+ const {
16
+ row,
17
+ col
18
+ } = hot.getSelectedRangeLast().highlight;
19
+ (0, _utils.scrollWindowToCell)(hot.getCell(row, col, true));
20
+ });
14
21
  };
15
22
  }
@@ -1,3 +1,4 @@
1
+ import { scrollWindowToCell } from "../utils.mjs";
1
2
  /**
2
3
  * Scroll strategy for changed the focus position of the selection.
3
4
  *
@@ -6,6 +7,12 @@
6
7
  */
7
8
  export function focusScrollStrategy(hot) {
8
9
  return cellCoords => {
9
- hot.scrollViewportTo(cellCoords.toObject());
10
+ hot.scrollViewportTo(cellCoords.toObject(), () => {
11
+ const {
12
+ row,
13
+ col
14
+ } = hot.getSelectedRangeLast().highlight;
15
+ scrollWindowToCell(hot.getCell(row, col, true));
16
+ });
10
17
  };
11
18
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.multipleScrollStrategy = multipleScrollStrategy;
5
+ var _utils = require("../utils");
5
6
  /**
6
7
  * Scroll strategy for multiple selections.
7
8
  *
@@ -10,6 +11,17 @@ exports.multipleScrollStrategy = multipleScrollStrategy;
10
11
  */
11
12
  function multipleScrollStrategy(hot) {
12
13
  return cellCoords => {
13
- hot.scrollViewportTo(cellCoords.toObject());
14
+ const scrollTargetCalc = (0, _utils.createScrollTargetCalculator)(hot);
15
+ const targetScroll = {
16
+ row: scrollTargetCalc.getComputedRowTarget(cellCoords),
17
+ col: scrollTargetCalc.getComputedColumnTarget(cellCoords)
18
+ };
19
+ hot.scrollViewportTo(targetScroll, () => {
20
+ const {
21
+ row,
22
+ col
23
+ } = targetScroll;
24
+ (0, _utils.scrollWindowToCell)(hot.getCell(row, col, true));
25
+ });
14
26
  };
15
27
  }
@@ -1,3 +1,4 @@
1
+ import { scrollWindowToCell, createScrollTargetCalculator } from "../utils.mjs";
1
2
  /**
2
3
  * Scroll strategy for multiple selections.
3
4
  *
@@ -6,6 +7,17 @@
6
7
  */
7
8
  export function multipleScrollStrategy(hot) {
8
9
  return cellCoords => {
9
- hot.scrollViewportTo(cellCoords.toObject());
10
+ const scrollTargetCalc = createScrollTargetCalculator(hot);
11
+ const targetScroll = {
12
+ row: scrollTargetCalc.getComputedRowTarget(cellCoords),
13
+ col: scrollTargetCalc.getComputedColumnTarget(cellCoords)
14
+ };
15
+ hot.scrollViewportTo(targetScroll, () => {
16
+ const {
17
+ row,
18
+ col
19
+ } = targetScroll;
20
+ scrollWindowToCell(hot.getCell(row, col, true));
21
+ });
10
22
  };
11
23
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.noncontiguousScrollStrategy = noncontiguousScrollStrategy;
5
+ var _utils = require("../utils");
5
6
  /**
6
7
  * Scroll strategy for non-contiguous selections.
7
8
  *
@@ -10,6 +11,17 @@ exports.noncontiguousScrollStrategy = noncontiguousScrollStrategy;
10
11
  */
11
12
  function noncontiguousScrollStrategy(hot) {
12
13
  return cellCoords => {
13
- hot.scrollViewportTo(cellCoords.toObject());
14
+ const scrollTargetCalc = (0, _utils.createScrollTargetCalculator)(hot);
15
+ const targetScroll = {
16
+ row: scrollTargetCalc.getComputedRowTarget(cellCoords),
17
+ col: scrollTargetCalc.getComputedColumnTarget(cellCoords)
18
+ };
19
+ hot.scrollViewportTo(targetScroll, () => {
20
+ const {
21
+ row,
22
+ col
23
+ } = targetScroll;
24
+ (0, _utils.scrollWindowToCell)(hot.getCell(row, col, true));
25
+ });
14
26
  };
15
27
  }
@@ -1,3 +1,4 @@
1
+ import { scrollWindowToCell, createScrollTargetCalculator } from "../utils.mjs";
1
2
  /**
2
3
  * Scroll strategy for non-contiguous selections.
3
4
  *
@@ -6,6 +7,17 @@
6
7
  */
7
8
  export function noncontiguousScrollStrategy(hot) {
8
9
  return cellCoords => {
9
- hot.scrollViewportTo(cellCoords.toObject());
10
+ const scrollTargetCalc = createScrollTargetCalculator(hot);
11
+ const targetScroll = {
12
+ row: scrollTargetCalc.getComputedRowTarget(cellCoords),
13
+ col: scrollTargetCalc.getComputedColumnTarget(cellCoords)
14
+ };
15
+ hot.scrollViewportTo(targetScroll, () => {
16
+ const {
17
+ row,
18
+ col
19
+ } = targetScroll;
20
+ scrollWindowToCell(hot.getCell(row, col, true));
21
+ });
10
22
  };
11
23
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.rowHeaderScrollStrategy = rowHeaderScrollStrategy;
5
+ var _utils = require("../utils");
5
6
  /**
6
7
  * Scroll strategy for row header selection.
7
8
  *
@@ -9,12 +10,13 @@ exports.rowHeaderScrollStrategy = rowHeaderScrollStrategy;
9
10
  * @returns {function(): function(CellCoords): void}
10
11
  */
11
12
  function rowHeaderScrollStrategy(hot) {
12
- return _ref => {
13
- let {
14
- row
15
- } = _ref;
13
+ return cellCoords => {
14
+ const scrollRowTarget = (0, _utils.createScrollTargetCalculator)(hot).getComputedRowTarget(cellCoords);
16
15
  hot.scrollViewportTo({
17
- row
16
+ row: scrollRowTarget
17
+ }, () => {
18
+ const hasRowHeaders = !!hot.getSettings().rowHeaders;
19
+ (0, _utils.scrollWindowToCell)(hot.getCell(scrollRowTarget, hasRowHeaders ? -1 : 0, true));
18
20
  });
19
21
  };
20
22
  }
@@ -1,3 +1,4 @@
1
+ import { scrollWindowToCell, createScrollTargetCalculator } from "../utils.mjs";
1
2
  /**
2
3
  * Scroll strategy for row header selection.
3
4
  *
@@ -5,12 +6,13 @@
5
6
  * @returns {function(): function(CellCoords): void}
6
7
  */
7
8
  export function rowHeaderScrollStrategy(hot) {
8
- return _ref => {
9
- let {
10
- row
11
- } = _ref;
9
+ return cellCoords => {
10
+ const scrollRowTarget = createScrollTargetCalculator(hot).getComputedRowTarget(cellCoords);
12
11
  hot.scrollViewportTo({
13
- row
12
+ row: scrollRowTarget
13
+ }, () => {
14
+ const hasRowHeaders = !!hot.getSettings().rowHeaders;
15
+ scrollWindowToCell(hot.getCell(scrollRowTarget, hasRowHeaders ? -1 : 0, true));
14
16
  });
15
17
  };
16
18
  }
@@ -2,11 +2,12 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.singleScrollStrategy = singleScrollStrategy;
5
+ var _utils = require("../utils");
5
6
  /**
6
7
  * Scroll strategy for single cell selection.
7
8
  *
8
9
  * @param {Core} hot Handsontable instance.
9
- * @returns {function(): function(CellCoords): { row: number, col: number } | void }
10
+ * @returns {function(): function(CellCoords): void}
10
11
  */
11
12
  function singleScrollStrategy(hot) {
12
13
  return cellCoords => {
@@ -15,20 +16,23 @@ function singleScrollStrategy(hot) {
15
16
  row,
16
17
  col
17
18
  } = cellCoords;
19
+ const scrollWindow = () => {
20
+ (0, _utils.scrollWindowToCell)(hot.getCell(row, col, true));
21
+ };
18
22
 
19
23
  // navigating through the column headers (when `navigableHeaders` is enabled)
20
24
  // scrolls the viewport horizontally only
21
25
  if (row < 0 && col >= 0) {
22
26
  hot.scrollViewportTo({
23
27
  col
24
- });
28
+ }, scrollWindow);
25
29
 
26
30
  // navigating through the row headers (when `navigableHeaders` is enabled)
27
31
  // scrolls the viewport vertically only
28
32
  } else if (col < 0 && row >= 0) {
29
33
  hot.scrollViewportTo({
30
34
  row
31
- });
35
+ }, scrollWindow);
32
36
 
33
37
  // navigating through the cells
34
38
  } else {
@@ -40,7 +44,7 @@ function singleScrollStrategy(hot) {
40
44
  hot.scrollViewportTo({
41
45
  row,
42
46
  col
43
- });
47
+ }, scrollWindow);
44
48
  }
45
49
  };
46
50
  }
@@ -1,8 +1,9 @@
1
+ import { scrollWindowToCell } from "../utils.mjs";
1
2
  /**
2
3
  * Scroll strategy for single cell selection.
3
4
  *
4
5
  * @param {Core} hot Handsontable instance.
5
- * @returns {function(): function(CellCoords): { row: number, col: number } | void }
6
+ * @returns {function(): function(CellCoords): void}
6
7
  */
7
8
  export function singleScrollStrategy(hot) {
8
9
  return cellCoords => {
@@ -11,20 +12,23 @@ export function singleScrollStrategy(hot) {
11
12
  row,
12
13
  col
13
14
  } = cellCoords;
15
+ const scrollWindow = () => {
16
+ scrollWindowToCell(hot.getCell(row, col, true));
17
+ };
14
18
 
15
19
  // navigating through the column headers (when `navigableHeaders` is enabled)
16
20
  // scrolls the viewport horizontally only
17
21
  if (row < 0 && col >= 0) {
18
22
  hot.scrollViewportTo({
19
23
  col
20
- });
24
+ }, scrollWindow);
21
25
 
22
26
  // navigating through the row headers (when `navigableHeaders` is enabled)
23
27
  // scrolls the viewport vertically only
24
28
  } else if (col < 0 && row >= 0) {
25
29
  hot.scrollViewportTo({
26
30
  row
27
- });
31
+ }, scrollWindow);
28
32
 
29
33
  // navigating through the cells
30
34
  } else {
@@ -36,7 +40,7 @@ export function singleScrollStrategy(hot) {
36
40
  hot.scrollViewportTo({
37
41
  row,
38
42
  col
39
- });
43
+ }, scrollWindow);
40
44
  }
41
45
  };
42
46
  }
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.createScrollTargetCalculator = createScrollTargetCalculator;
5
+ exports.scrollWindowToCell = scrollWindowToCell;
6
+ var _element = require("../../helpers/dom/element");
7
+ /**
8
+ * Scrolls the browser's viewport to the specified element.
9
+ *
10
+ * @param {HTMLElement} element The element to scroll.
11
+ */
12
+ function scrollWindowToCell(element) {
13
+ if ((0, _element.isHTMLElement)(element)) {
14
+ element.scrollIntoView({
15
+ block: 'nearest',
16
+ inline: 'nearest'
17
+ });
18
+ }
19
+ }
20
+
21
+ /**
22
+ * Creates a scroll target calculator that calculates the target row and column best viewport
23
+ * scroll position based on the current selection.
24
+ *
25
+ * @param {Core} hotInstance The Handsontable instance.
26
+ * @returns {{ getComputedColumnTarget: Function, getComputedRowTarget: Function }}
27
+ */
28
+ function createScrollTargetCalculator(hotInstance) {
29
+ const {
30
+ selection,
31
+ view
32
+ } = hotInstance;
33
+ const cellRange = hotInstance.getSelectedRangeLast();
34
+ const source = selection.getSelectionSource();
35
+ const firstVisibleColumn = view.getFirstFullyVisibleColumn();
36
+ const lastVisibleColumn = view.getLastFullyVisibleColumn();
37
+ const selectionFirstColumn = cellRange.getTopStartCorner().col;
38
+ const selectionLastColumn = cellRange.getBottomEndCorner().col;
39
+ const isSelectionOutsideStartViewport = selectionFirstColumn <= firstVisibleColumn;
40
+ const isSelectionOutsideEndViewport = selectionLastColumn >= lastVisibleColumn;
41
+ const firstVisibleRow = view.getFirstFullyVisibleRow();
42
+ const lastVisibleRow = view.getLastFullyVisibleRow();
43
+ const selectionFirstRow = cellRange.getTopStartCorner().row;
44
+ const selectionLastRow = cellRange.getBottomEndCorner().row;
45
+ const isSelectionOutsideTopViewport = selectionFirstRow <= firstVisibleRow;
46
+ const isSelectionOutsideBottomViewport = selectionLastRow >= lastVisibleRow;
47
+ return {
48
+ /**
49
+ * Calculates the target column for scrolling.
50
+ *
51
+ * @param {CellCoords} lastSelectionCoords The last selection coordinates.
52
+ * @returns {number}
53
+ */
54
+ getComputedColumnTarget(lastSelectionCoords) {
55
+ if (source === 'mouse' || source === 'keyboard') {
56
+ // For mouse or keyboard selection, always scroll to the last column
57
+ // defined by the last selection coords
58
+ return lastSelectionCoords.col;
59
+ }
60
+ if (isSelectionOutsideStartViewport && isSelectionOutsideEndViewport) {
61
+ // If the selection is outside both ends of the viewport, scroll to the
62
+ // column where the focused cell is located
63
+ return cellRange.highlight.col;
64
+ }
65
+ if (isSelectionOutsideStartViewport) {
66
+ // If the selection is outside the start (left) of the viewport, scroll to
67
+ // the first column of the selection range
68
+ return selectionFirstColumn;
69
+ }
70
+ if (isSelectionOutsideEndViewport) {
71
+ // If the selection is outside the end (right) of the viewport, scroll to
72
+ // the last column of the selection range
73
+ return selectionLastColumn;
74
+ }
75
+
76
+ // For other cases, scroll to the column defined by the last selection coords
77
+ return lastSelectionCoords.col;
78
+ },
79
+ /**
80
+ * Calculates the target row for scrolling.
81
+ *
82
+ * @param {CellCoords} lastSelectionCoords The last selection coordinates.
83
+ * @returns {number}
84
+ */
85
+ getComputedRowTarget(lastSelectionCoords) {
86
+ if (source === 'mouse' || source === 'keyboard') {
87
+ // For mouse or keyboard selection, always scroll to the last row
88
+ // defined by the coords
89
+ return lastSelectionCoords.row;
90
+ }
91
+ if (isSelectionOutsideTopViewport && isSelectionOutsideBottomViewport) {
92
+ // If the selection is outside both ends of the viewport, scroll to the
93
+ // row where the focused cell is located
94
+ return cellRange.highlight.row;
95
+ }
96
+ if (isSelectionOutsideTopViewport) {
97
+ // If the selection is outside the top of the viewport, scroll to
98
+ // the first row of the selection range
99
+ return selectionFirstRow;
100
+ }
101
+ if (isSelectionOutsideBottomViewport) {
102
+ // If the selection is outside the bottom of the viewport, scroll to
103
+ // the last row of the selection range
104
+ return selectionLastRow;
105
+ }
106
+
107
+ // For other cases, scroll to the row defined by the last selection coords
108
+ return lastSelectionCoords.row;
109
+ }
110
+ };
111
+ }