handsontable 0.0.0-next-baf2fcf-20230809 → 0.0.0-next-08765b9-20230809

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

Files changed (299) hide show
  1. package/3rdparty/walkontable/src/cell/coords.d.ts +6 -1
  2. package/3rdparty/walkontable/src/cell/coords.js +50 -11
  3. package/3rdparty/walkontable/src/cell/coords.mjs +50 -11
  4. package/3rdparty/walkontable/src/cell/range.d.ts +9 -2
  5. package/3rdparty/walkontable/src/cell/range.js +38 -7
  6. package/3rdparty/walkontable/src/cell/range.mjs +38 -7
  7. package/3rdparty/walkontable/src/core/_base.js +9 -3
  8. package/3rdparty/walkontable/src/core/_base.mjs +9 -3
  9. package/3rdparty/walkontable/src/core/clone.js +2 -2
  10. package/3rdparty/walkontable/src/core/clone.mjs +2 -2
  11. package/3rdparty/walkontable/src/core/core.js +3 -2
  12. package/3rdparty/walkontable/src/core/core.mjs +3 -2
  13. package/3rdparty/walkontable/src/event.js +7 -7
  14. package/3rdparty/walkontable/src/event.mjs +7 -7
  15. package/3rdparty/walkontable/src/facade/core.js +2 -2
  16. package/3rdparty/walkontable/src/facade/core.mjs +2 -2
  17. package/3rdparty/walkontable/src/index.js +10 -2
  18. package/3rdparty/walkontable/src/index.mjs +2 -2
  19. package/3rdparty/walkontable/src/overlay/_base.js +1 -1
  20. package/3rdparty/walkontable/src/overlay/_base.mjs +1 -1
  21. package/3rdparty/walkontable/src/overlay/inlineStart.js +2 -6
  22. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -6
  23. package/3rdparty/walkontable/src/overlay/top.js +2 -6
  24. package/3rdparty/walkontable/src/overlay/top.mjs +2 -6
  25. package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
  26. package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
  27. package/3rdparty/walkontable/src/selection/border/constants.js +16 -0
  28. package/3rdparty/walkontable/src/selection/border/constants.mjs +12 -0
  29. package/3rdparty/walkontable/src/selection/constants.js +62 -0
  30. package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
  31. package/3rdparty/walkontable/src/selection/index.js +26 -0
  32. package/3rdparty/walkontable/src/selection/index.mjs +5 -0
  33. package/3rdparty/walkontable/src/selection/manager.js +259 -0
  34. package/3rdparty/walkontable/src/selection/manager.mjs +254 -0
  35. package/3rdparty/walkontable/src/selection/scanner.js +270 -0
  36. package/3rdparty/walkontable/src/selection/scanner.mjs +267 -0
  37. package/3rdparty/walkontable/src/selection/selection.js +101 -0
  38. package/3rdparty/walkontable/src/selection/selection.mjs +96 -0
  39. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
  40. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
  41. package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
  42. package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
  43. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
  44. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
  45. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
  46. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
  47. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
  48. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
  49. package/3rdparty/walkontable/src/table.js +6 -78
  50. package/3rdparty/walkontable/src/table.mjs +7 -79
  51. package/base.js +2 -2
  52. package/base.mjs +2 -2
  53. package/common.d.ts +1 -1
  54. package/core/focusCatcher/focusDetector.js +58 -0
  55. package/core/focusCatcher/focusDetector.mjs +54 -0
  56. package/core/focusCatcher/index.js +142 -0
  57. package/core/focusCatcher/index.mjs +138 -0
  58. package/core/index.js +9 -0
  59. package/core/index.mjs +1 -0
  60. package/core.d.ts +6 -3
  61. package/core.js +173 -290
  62. package/core.mjs +173 -290
  63. package/dataMap/metaManager/metaSchema.js +41 -0
  64. package/dataMap/metaManager/metaSchema.mjs +41 -0
  65. package/dist/handsontable.css +24 -4
  66. package/dist/handsontable.full.css +24 -4
  67. package/dist/handsontable.full.js +8676 -5381
  68. package/dist/handsontable.full.min.css +3 -3
  69. package/dist/handsontable.full.min.js +25 -25
  70. package/dist/handsontable.js +10984 -7689
  71. package/dist/handsontable.min.css +3 -3
  72. package/dist/handsontable.min.js +19 -19
  73. package/editorManager.js +11 -75
  74. package/editorManager.mjs +11 -74
  75. package/editors/baseEditor/baseEditor.d.ts +0 -1
  76. package/editors/textEditor/textEditor.js +3 -11
  77. package/editors/textEditor/textEditor.mjs +4 -12
  78. package/helpers/mixed.js +1 -1
  79. package/helpers/mixed.mjs +1 -1
  80. package/helpers/number.d.ts +1 -0
  81. package/helpers/number.js +18 -0
  82. package/helpers/number.mjs +17 -0
  83. package/package.json +1 -1
  84. package/pluginHooks.d.ts +7 -1
  85. package/pluginHooks.js +106 -1
  86. package/pluginHooks.mjs +106 -1
  87. package/plugins/collapsibleColumns/collapsibleColumns.js +58 -4
  88. package/plugins/collapsibleColumns/collapsibleColumns.mjs +58 -4
  89. package/plugins/columnSorting/columnSorting.js +38 -0
  90. package/plugins/columnSorting/columnSorting.mjs +38 -2
  91. package/plugins/columnSorting/index.js +3 -1
  92. package/plugins/columnSorting/index.mjs +1 -1
  93. package/plugins/comments/commentEditor.js +1 -0
  94. package/plugins/comments/commentEditor.mjs +1 -0
  95. package/plugins/comments/comments.js +251 -189
  96. package/plugins/comments/comments.mjs +250 -190
  97. package/plugins/comments/contextMenuItem/addEditComment.js +41 -0
  98. package/plugins/comments/contextMenuItem/addEditComment.mjs +35 -0
  99. package/plugins/comments/contextMenuItem/readOnlyComment.js +49 -0
  100. package/plugins/comments/contextMenuItem/readOnlyComment.mjs +43 -0
  101. package/plugins/comments/contextMenuItem/removeComment.js +38 -0
  102. package/plugins/comments/contextMenuItem/removeComment.mjs +32 -0
  103. package/plugins/contextMenu/contextMenu.d.ts +1 -1
  104. package/plugins/contextMenu/contextMenu.js +72 -30
  105. package/plugins/contextMenu/contextMenu.mjs +73 -31
  106. package/plugins/contextMenu/predefinedItems/alignment.js +7 -0
  107. package/plugins/contextMenu/predefinedItems/alignment.mjs +7 -0
  108. package/plugins/contextMenu/predefinedItems/clearColumn.js +5 -3
  109. package/plugins/contextMenu/predefinedItems/clearColumn.mjs +5 -3
  110. package/plugins/contextMenu/predefinedItems/columnLeft.js +5 -3
  111. package/plugins/contextMenu/predefinedItems/columnLeft.mjs +5 -3
  112. package/plugins/contextMenu/predefinedItems/columnRight.js +5 -3
  113. package/plugins/contextMenu/predefinedItems/columnRight.mjs +5 -3
  114. package/plugins/contextMenu/predefinedItems/readOnly.js +7 -0
  115. package/plugins/contextMenu/predefinedItems/readOnly.mjs +7 -0
  116. package/plugins/contextMenu/predefinedItems/removeColumn.js +7 -5
  117. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +5 -3
  118. package/plugins/contextMenu/predefinedItems/removeRow.js +7 -5
  119. package/plugins/contextMenu/predefinedItems/removeRow.mjs +5 -3
  120. package/plugins/contextMenu/predefinedItems/rowAbove.js +5 -3
  121. package/plugins/contextMenu/predefinedItems/rowAbove.mjs +5 -3
  122. package/plugins/contextMenu/predefinedItems/rowBelow.js +5 -3
  123. package/plugins/contextMenu/predefinedItems/rowBelow.mjs +5 -3
  124. package/plugins/contextMenu/utils.js +28 -16
  125. package/plugins/contextMenu/utils.mjs +27 -15
  126. package/plugins/copyPaste/contextMenuItem/copy.js +7 -0
  127. package/plugins/copyPaste/contextMenuItem/copy.mjs +7 -0
  128. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +9 -1
  129. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +9 -1
  130. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +9 -1
  131. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +9 -1
  132. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +9 -1
  133. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +9 -1
  134. package/plugins/copyPaste/contextMenuItem/cut.js +7 -0
  135. package/plugins/copyPaste/contextMenuItem/cut.mjs +7 -0
  136. package/plugins/copyPaste/copyPaste.js +14 -10
  137. package/plugins/copyPaste/copyPaste.mjs +14 -10
  138. package/plugins/customBorders/customBorders.js +23 -20
  139. package/plugins/customBorders/customBorders.mjs +24 -21
  140. package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
  141. package/plugins/dropdownMenu/dropdownMenu.js +89 -32
  142. package/plugins/dropdownMenu/dropdownMenu.mjs +89 -32
  143. package/plugins/filters/filters.js +31 -14
  144. package/plugins/filters/filters.mjs +30 -13
  145. package/plugins/manualColumnResize/manualColumnResize.js +0 -6
  146. package/plugins/manualColumnResize/manualColumnResize.mjs +1 -7
  147. package/plugins/mergeCells/mergeCells.js +5 -17
  148. package/plugins/mergeCells/mergeCells.mjs +5 -17
  149. package/plugins/multiColumnSorting/multiColumnSorting.js +37 -2
  150. package/plugins/multiColumnSorting/multiColumnSorting.mjs +37 -2
  151. package/plugins/nestedHeaders/nestedHeaders.js +121 -8
  152. package/plugins/nestedHeaders/nestedHeaders.mjs +121 -8
  153. package/plugins/nestedHeaders/stateManager/index.js +37 -0
  154. package/plugins/nestedHeaders/stateManager/index.mjs +37 -0
  155. package/plugins/nestedRows/nestedRows.js +41 -0
  156. package/plugins/nestedRows/nestedRows.mjs +41 -0
  157. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  158. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  159. package/selection/highlight/highlight.js +256 -71
  160. package/selection/highlight/highlight.mjs +250 -71
  161. package/selection/highlight/types/activeHeader.js +10 -8
  162. package/selection/highlight/types/activeHeader.mjs +10 -8
  163. package/selection/highlight/types/area.js +6 -18
  164. package/selection/highlight/types/area.mjs +6 -18
  165. package/selection/highlight/types/areaLayered.js +31 -0
  166. package/selection/highlight/types/areaLayered.mjs +26 -0
  167. package/selection/highlight/types/column.js +27 -0
  168. package/selection/highlight/types/column.mjs +22 -0
  169. package/selection/highlight/types/customSelection.js +7 -9
  170. package/selection/highlight/types/customSelection.mjs +7 -9
  171. package/selection/highlight/types/fill.js +5 -7
  172. package/selection/highlight/types/fill.mjs +5 -7
  173. package/selection/highlight/types/{cell.js → focus.js} +5 -7
  174. package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
  175. package/selection/highlight/types/header.js +9 -18
  176. package/selection/highlight/types/header.mjs +9 -18
  177. package/selection/highlight/types/row.js +27 -0
  178. package/selection/highlight/types/row.mjs +22 -0
  179. package/selection/highlight/visualSelection.js +31 -27
  180. package/selection/highlight/visualSelection.mjs +31 -27
  181. package/selection/index.js +4 -7
  182. package/selection/index.mjs +2 -3
  183. package/selection/mouseEventHandler.js +1 -1
  184. package/selection/mouseEventHandler.mjs +1 -1
  185. package/selection/range.js +8 -8
  186. package/selection/range.mjs +8 -8
  187. package/selection/selection.js +290 -154
  188. package/selection/selection.mjs +287 -153
  189. package/selection/transformation.js +232 -90
  190. package/selection/transformation.mjs +232 -90
  191. package/selection/utils.js +15 -21
  192. package/selection/utils.mjs +16 -21
  193. package/settings.d.ts +2 -0
  194. package/shortcutContexts/commands/editor/closeAndSave.js +12 -0
  195. package/shortcutContexts/commands/editor/closeAndSave.mjs +8 -0
  196. package/shortcutContexts/commands/editor/closeWithoutSaving.js +12 -0
  197. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +8 -0
  198. package/shortcutContexts/commands/editor/fastOpen.js +16 -0
  199. package/shortcutContexts/commands/editor/fastOpen.mjs +12 -0
  200. package/shortcutContexts/commands/editor/index.js +16 -0
  201. package/shortcutContexts/commands/editor/index.mjs +12 -0
  202. package/shortcutContexts/commands/editor/open.js +27 -0
  203. package/shortcutContexts/commands/editor/open.mjs +23 -0
  204. package/shortcutContexts/commands/emptySelectedCells.js +11 -0
  205. package/shortcutContexts/commands/emptySelectedCells.mjs +7 -0
  206. package/shortcutContexts/commands/extendCellsSelection/down.js +15 -0
  207. package/shortcutContexts/commands/extendCellsSelection/down.mjs +11 -0
  208. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +21 -0
  209. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +17 -0
  210. package/shortcutContexts/commands/extendCellsSelection/index.js +26 -0
  211. package/shortcutContexts/commands/extendCellsSelection/index.mjs +22 -0
  212. package/shortcutContexts/commands/extendCellsSelection/left.js +15 -0
  213. package/shortcutContexts/commands/extendCellsSelection/left.mjs +11 -0
  214. package/shortcutContexts/commands/extendCellsSelection/right.js +15 -0
  215. package/shortcutContexts/commands/extendCellsSelection/right.mjs +11 -0
  216. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +19 -0
  217. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +15 -0
  218. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +29 -0
  219. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +25 -0
  220. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +19 -0
  221. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +15 -0
  222. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +19 -0
  223. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +15 -0
  224. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +29 -0
  225. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +25 -0
  226. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +29 -0
  227. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +25 -0
  228. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +29 -0
  229. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +25 -0
  230. package/shortcutContexts/commands/extendCellsSelection/toRows.js +19 -0
  231. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +15 -0
  232. package/shortcutContexts/commands/extendCellsSelection/up.js +15 -0
  233. package/shortcutContexts/commands/extendCellsSelection/up.mjs +11 -0
  234. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +21 -0
  235. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +17 -0
  236. package/shortcutContexts/commands/index.js +35 -0
  237. package/shortcutContexts/commands/index.mjs +31 -0
  238. package/shortcutContexts/commands/moveCellSelection/down.js +13 -0
  239. package/shortcutContexts/commands/moveCellSelection/down.mjs +9 -0
  240. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +31 -0
  241. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +27 -0
  242. package/shortcutContexts/commands/moveCellSelection/index.js +28 -0
  243. package/shortcutContexts/commands/moveCellSelection/index.mjs +24 -0
  244. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +12 -0
  245. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -0
  246. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +12 -0
  247. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -0
  248. package/shortcutContexts/commands/moveCellSelection/left.js +10 -0
  249. package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -0
  250. package/shortcutContexts/commands/moveCellSelection/right.js +10 -0
  251. package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -0
  252. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +17 -0
  253. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +13 -0
  254. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +18 -0
  255. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +14 -0
  256. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +14 -0
  257. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +10 -0
  258. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +17 -0
  259. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +13 -0
  260. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +19 -0
  261. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +15 -0
  262. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +21 -0
  263. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +17 -0
  264. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +17 -0
  265. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +13 -0
  266. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +19 -0
  267. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +15 -0
  268. package/shortcutContexts/commands/moveCellSelection/up.js +13 -0
  269. package/shortcutContexts/commands/moveCellSelection/up.mjs +9 -0
  270. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +31 -0
  271. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +27 -0
  272. package/shortcutContexts/commands/populateSelectedCellsData.js +29 -0
  273. package/shortcutContexts/commands/populateSelectedCellsData.mjs +25 -0
  274. package/shortcutContexts/commands/scrollToFocusedCell.js +36 -0
  275. package/shortcutContexts/commands/scrollToFocusedCell.mjs +32 -0
  276. package/shortcutContexts/commands/selectAll.js +10 -0
  277. package/shortcutContexts/commands/selectAll.mjs +6 -0
  278. package/shortcutContexts/constants.js +13 -0
  279. package/shortcutContexts/constants.mjs +8 -0
  280. package/shortcutContexts/editor.js +25 -0
  281. package/shortcutContexts/editor.mjs +21 -0
  282. package/shortcutContexts/grid.js +163 -0
  283. package/shortcutContexts/grid.mjs +159 -0
  284. package/shortcutContexts/index.js +24 -0
  285. package/shortcutContexts/index.mjs +11 -0
  286. package/shortcuts/manager.js +2 -0
  287. package/shortcuts/manager.mjs +2 -0
  288. package/shortcuts/recorder.js +2 -2
  289. package/shortcuts/recorder.mjs +2 -2
  290. package/shortcuts/utils.js +19 -5
  291. package/shortcuts/utils.mjs +18 -4
  292. package/tableView.js +67 -13
  293. package/tableView.mjs +67 -13
  294. package/3rdparty/walkontable/src/selection.js +0 -295
  295. package/3rdparty/walkontable/src/selection.mjs +0 -290
  296. package/selection/highlight/constants.js +0 -15
  297. package/selection/highlight/constants.mjs +0 -6
  298. package/selection/highlight/types/index.js +0 -35
  299. package/selection/highlight/types/index.mjs +0 -31
package/pluginHooks.mjs CHANGED
@@ -552,6 +552,13 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
552
552
  * @event Hooks#afterScrollVertically
553
553
  */
554
554
  'afterScrollVertically',
555
+ /**
556
+ * Fired after the vertical or horizontal scroll event.
557
+ *
558
+ * @since 14.0.0
559
+ * @event Hooks#afterScroll
560
+ */
561
+ 'afterScroll',
555
562
  /**
556
563
  * Fired after one or more cells are selected (e.g. During mouse move).
557
564
  *
@@ -655,6 +662,94 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
655
662
  * @param {number} selectionLayerLevel The number which indicates what selection layer is currently modified.
656
663
  */
657
664
  'afterSelectionEndByProp',
665
+ /**
666
+ * Fired before one or more columns are selected (e.g. During mouse header click or {@link Core#selectColumns} API call).
667
+ *
668
+ * @since 14.0.0
669
+ * @event Hooks#beforeSelectColumns
670
+ * @param {CellCoords} from Selection start coords object.
671
+ * @param {CellCoords} to Selection end coords object.
672
+ * @param {CellCoords} highlight Selection cell focus coords object.
673
+ * @example
674
+ * ::: only-for javascript
675
+ * ```js
676
+ * new Handsontable(element, {
677
+ * beforeSelectColumns: (from, to, highlight) => {
678
+ * // Extend the column selection by one column left and one column right.
679
+ * from.col = Math.max(from.col - 1, 0);
680
+ * to.col = Math.min(to.col + 1, this.countCols() - 1);
681
+ * }
682
+ * })
683
+ * ```
684
+ * :::
685
+ *
686
+ * ::: only-for react
687
+ * ```jsx
688
+ * <HotTable
689
+ * beforeSelectColumns={(from, to, highlight) => {
690
+ * // Extend the column selection by one column left and one column right.
691
+ * from.col = Math.max(from.col - 1, 0);
692
+ * to.col = Math.min(to.col + 1, this.countCols() - 1);
693
+ * }}
694
+ * />
695
+ * ```
696
+ * :::
697
+ */
698
+ 'beforeSelectColumns',
699
+ /**
700
+ * Fired after one or more columns are selected (e.g. During mouse header click or {@link Core#selectColumns} API call).
701
+ *
702
+ * @since 14.0.0
703
+ * @event Hooks#afterSelectColumns
704
+ * @param {CellCoords} from Selection start coords object.
705
+ * @param {CellCoords} to Selection end coords object.
706
+ * @param {CellCoords} highlight Selection cell focus coords object.
707
+ */
708
+ 'afterSelectColumns',
709
+ /**
710
+ * Fired before one or more rows are selected (e.g. During mouse header click or {@link Core#selectRows} API call).
711
+ *
712
+ * @since 14.0.0
713
+ * @event Hooks#beforeSelectRows
714
+ * @param {CellCoords} from Selection start coords object.
715
+ * @param {CellCoords} to Selection end coords object.
716
+ * @param {CellCoords} highlight Selection cell focus coords object.
717
+ * @example
718
+ * ::: only-for javascript
719
+ * ```js
720
+ * new Handsontable(element, {
721
+ * beforeSelectRows: (from, to, highlight) => {
722
+ * // Extend the row selection by one row up and one row bottom more.
723
+ * from.row = Math.max(from.row - 1, 0);
724
+ * to.row = Math.min(to.row + 1, this.countRows() - 1);
725
+ * }
726
+ * })
727
+ * ```
728
+ * :::
729
+ *
730
+ * ::: only-for react
731
+ * ```jsx
732
+ * <HotTable
733
+ * beforeSelectRows={(from, to, highlight) => {
734
+ * // Extend the row selection by one row up and one row bottom more.
735
+ * from.row = Math.max(from.row - 1, 0);
736
+ * to.row = Math.min(to.row + 1, this.countRows() - 1);
737
+ * }}
738
+ * />
739
+ * ```
740
+ * :::
741
+ */
742
+ 'beforeSelectRows',
743
+ /**
744
+ * Fired after one or more rows are selected (e.g. During mouse header click or {@link Core#selectRows} API call).
745
+ *
746
+ * @since 14.0.0
747
+ * @event Hooks#afterSelectRows
748
+ * @param {CellCoords} from Selection start coords object.
749
+ * @param {CellCoords} to Selection end coords object.
750
+ * @param {CellCoords} highlight Selection cell focus coords object.
751
+ */
752
+ 'afterSelectRows',
658
753
  /**
659
754
  * Fired after cell meta is changed.
660
755
  *
@@ -1223,6 +1318,16 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1223
1318
  * @returns {undefined|number[]}
1224
1319
  */
1225
1320
  'modifyGetCellCoords',
1321
+ /**
1322
+ * Used to modify the cell coordinates when the table is activated (going into the listen mode).
1323
+ *
1324
+ * @event Hooks#modifyFocusOnTabNavigation
1325
+ * @since 14.0.0
1326
+ * @param {'from_above' | 'from_below'} tabActivationDir The browsers Tab navigation direction. Depending on
1327
+ * whether the user activated the table from the element above or below, another cell can be selected.
1328
+ * @param {CellCoords} visualCoords The coords that will be used to select a cell.
1329
+ */
1330
+ 'modifyFocusOnTabNavigation',
1226
1331
  /**
1227
1332
  * Allows modify the visual row index that is used to retrieve the row header element (TH) before it's
1228
1333
  * highlighted (proper CSS class names are added). Modifying the visual row index allows building a custom
@@ -2380,7 +2485,7 @@ const REMOVED_HOOKS = new Map([['modifyRow', '8.0.0'], ['modifyCol', '8.0.0'], [
2380
2485
  * @type {Map<string, string>}
2381
2486
  */
2382
2487
  /* eslint-enable jsdoc/require-description-complete-sentence */
2383
- const DEPRECATED_HOOKS = new Map([]);
2488
+ const DEPRECATED_HOOKS = new Map([['beforeRemoveCellClassNames', 'The hook "beforeRemoveCellClassNames" is deprecated and will be removed in the next major release.']]);
2384
2489
  class Hooks {
2385
2490
  static getSingleton() {
2386
2491
  return getGlobalSingleton();
@@ -27,6 +27,7 @@ const PLUGIN_PRIORITY = 290;
27
27
  exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
28
28
  const SETTING_KEYS = ['nestedHeaders'];
29
29
  const COLLAPSIBLE_ELEMENT_CLASS = 'collapsibleIndicator';
30
+ const SHORTCUTS_GROUP = PLUGIN_KEY;
30
31
  const actionDictionary = new Map([['collapse', {
31
32
  hideColumn: true,
32
33
  beforeHook: 'beforeColumnCollapse',
@@ -191,6 +192,7 @@ class CollapsibleColumns extends _base.BasePlugin {
191
192
  return _this.onAfterGetColHeader(...arguments);
192
193
  });
193
194
  this.addHook('beforeOnCellMouseDown', (event, coords, TD) => this.onBeforeOnCellMouseDown(event, coords, TD));
195
+ this.registerShortcuts();
194
196
  super.enablePlugin();
195
197
  // @TODO: Workaround for broken plugin initialization abstraction (#6806).
196
198
  this.updatePlugin();
@@ -238,10 +240,62 @@ class CollapsibleColumns extends _base.BasePlugin {
238
240
  this.hot.columnIndexMapper.unregisterMap(this.pluginName);
239
241
  _classPrivateFieldSet(this, _collapsedColumnsMap, null);
240
242
  this.nestedHeadersPlugin = null;
243
+ this.unregisterShortcuts();
241
244
  this.clearButtons();
242
245
  super.disablePlugin();
243
246
  }
244
247
 
248
+ /**
249
+ * Register shortcuts responsible for toggling collapsible columns.
250
+ *
251
+ * @private
252
+ */
253
+ registerShortcuts() {
254
+ this.hot.getShortcutManager().getContext('grid').addShortcut({
255
+ keys: [['Enter']],
256
+ callback: () => {
257
+ var _this$headerStateMana;
258
+ const {
259
+ row,
260
+ col
261
+ } = this.hot.getSelectedRangeLast().highlight;
262
+ const {
263
+ collapsible,
264
+ isCollapsed,
265
+ columnIndex
266
+ } = (_this$headerStateMana = this.headerStateManager.getHeaderTreeNodeData(row, col)) !== null && _this$headerStateMana !== void 0 ? _this$headerStateMana : {};
267
+ if (!collapsible) {
268
+ return;
269
+ }
270
+ if (isCollapsed) {
271
+ this.expandSection({
272
+ row,
273
+ col: columnIndex
274
+ });
275
+ } else {
276
+ this.collapseSection({
277
+ row,
278
+ col: columnIndex
279
+ });
280
+ }
281
+ },
282
+ runOnlyIf: () => {
283
+ var _this$hot$getSelected;
284
+ return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
285
+ },
286
+ group: SHORTCUTS_GROUP
287
+ });
288
+ }
289
+
290
+ /**
291
+ * Unregister shortcuts responsible for toggling collapsible columns.
292
+ *
293
+ * @private
294
+ */
295
+ unregisterShortcuts() {
296
+ this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
297
+ }
298
+
245
299
  /**
246
300
  * Clears the expand/collapse buttons.
247
301
  *
@@ -362,7 +416,7 @@ class CollapsibleColumns extends _base.BasePlugin {
362
416
  });
363
417
  let isActionPossible = filteredCoords.length > 0;
364
418
  (0, _array.arrayEach)(filteredCoords, _ref2 => {
365
- var _this$headerStateMana;
419
+ var _this$headerStateMana2;
366
420
  let {
367
421
  row,
368
422
  col: column
@@ -370,7 +424,7 @@ class CollapsibleColumns extends _base.BasePlugin {
370
424
  const {
371
425
  collapsible,
372
426
  isCollapsed
373
- } = (_this$headerStateMana = this.headerStateManager.getHeaderSettings(row, column)) !== null && _this$headerStateMana !== void 0 ? _this$headerStateMana : {};
427
+ } = (_this$headerStateMana2 = this.headerStateManager.getHeaderSettings(row, column)) !== null && _this$headerStateMana2 !== void 0 ? _this$headerStateMana2 : {};
374
428
  if (!collapsible || isCollapsed && action === 'collapse' || !isCollapsed && action === 'expand') {
375
429
  isActionPossible = false;
376
430
  return false;
@@ -442,12 +496,12 @@ class CollapsibleColumns extends _base.BasePlugin {
442
496
  * values counting from 0 to N).
443
497
  */
444
498
  onAfterGetColHeader(column, TH, headerLevel) {
445
- var _this$headerStateMana2;
499
+ var _this$headerStateMana3;
446
500
  const {
447
501
  collapsible,
448
502
  origColspan,
449
503
  isCollapsed
450
- } = (_this$headerStateMana2 = this.headerStateManager.getHeaderSettings(headerLevel, column)) !== null && _this$headerStateMana2 !== void 0 ? _this$headerStateMana2 : {};
504
+ } = (_this$headerStateMana3 = this.headerStateManager.getHeaderSettings(headerLevel, column)) !== null && _this$headerStateMana3 !== void 0 ? _this$headerStateMana3 : {};
451
505
  const isNodeCollapsible = collapsible && origColspan > 1 && column >= this.hot.getSettings().fixedColumnsStart;
452
506
  let collapsibleElement = TH.querySelector(`.${COLLAPSIBLE_ELEMENT_CLASS}`);
453
507
  if (isNodeCollapsible) {
@@ -21,6 +21,7 @@ export const PLUGIN_KEY = 'collapsibleColumns';
21
21
  export const PLUGIN_PRIORITY = 290;
22
22
  const SETTING_KEYS = ['nestedHeaders'];
23
23
  const COLLAPSIBLE_ELEMENT_CLASS = 'collapsibleIndicator';
24
+ const SHORTCUTS_GROUP = PLUGIN_KEY;
24
25
  const actionDictionary = new Map([['collapse', {
25
26
  hideColumn: true,
26
27
  beforeHook: 'beforeColumnCollapse',
@@ -185,6 +186,7 @@ export class CollapsibleColumns extends BasePlugin {
185
186
  return _this.onAfterGetColHeader(...arguments);
186
187
  });
187
188
  this.addHook('beforeOnCellMouseDown', (event, coords, TD) => this.onBeforeOnCellMouseDown(event, coords, TD));
189
+ this.registerShortcuts();
188
190
  super.enablePlugin();
189
191
  // @TODO: Workaround for broken plugin initialization abstraction (#6806).
190
192
  this.updatePlugin();
@@ -232,10 +234,62 @@ export class CollapsibleColumns extends BasePlugin {
232
234
  this.hot.columnIndexMapper.unregisterMap(this.pluginName);
233
235
  _classPrivateFieldSet(this, _collapsedColumnsMap, null);
234
236
  this.nestedHeadersPlugin = null;
237
+ this.unregisterShortcuts();
235
238
  this.clearButtons();
236
239
  super.disablePlugin();
237
240
  }
238
241
 
242
+ /**
243
+ * Register shortcuts responsible for toggling collapsible columns.
244
+ *
245
+ * @private
246
+ */
247
+ registerShortcuts() {
248
+ this.hot.getShortcutManager().getContext('grid').addShortcut({
249
+ keys: [['Enter']],
250
+ callback: () => {
251
+ var _this$headerStateMana;
252
+ const {
253
+ row,
254
+ col
255
+ } = this.hot.getSelectedRangeLast().highlight;
256
+ const {
257
+ collapsible,
258
+ isCollapsed,
259
+ columnIndex
260
+ } = (_this$headerStateMana = this.headerStateManager.getHeaderTreeNodeData(row, col)) !== null && _this$headerStateMana !== void 0 ? _this$headerStateMana : {};
261
+ if (!collapsible) {
262
+ return;
263
+ }
264
+ if (isCollapsed) {
265
+ this.expandSection({
266
+ row,
267
+ col: columnIndex
268
+ });
269
+ } else {
270
+ this.collapseSection({
271
+ row,
272
+ col: columnIndex
273
+ });
274
+ }
275
+ },
276
+ runOnlyIf: () => {
277
+ var _this$hot$getSelected;
278
+ return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
279
+ },
280
+ group: SHORTCUTS_GROUP
281
+ });
282
+ }
283
+
284
+ /**
285
+ * Unregister shortcuts responsible for toggling collapsible columns.
286
+ *
287
+ * @private
288
+ */
289
+ unregisterShortcuts() {
290
+ this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
291
+ }
292
+
239
293
  /**
240
294
  * Clears the expand/collapse buttons.
241
295
  *
@@ -356,7 +410,7 @@ export class CollapsibleColumns extends BasePlugin {
356
410
  });
357
411
  let isActionPossible = filteredCoords.length > 0;
358
412
  arrayEach(filteredCoords, _ref2 => {
359
- var _this$headerStateMana;
413
+ var _this$headerStateMana2;
360
414
  let {
361
415
  row,
362
416
  col: column
@@ -364,7 +418,7 @@ export class CollapsibleColumns extends BasePlugin {
364
418
  const {
365
419
  collapsible,
366
420
  isCollapsed
367
- } = (_this$headerStateMana = this.headerStateManager.getHeaderSettings(row, column)) !== null && _this$headerStateMana !== void 0 ? _this$headerStateMana : {};
421
+ } = (_this$headerStateMana2 = this.headerStateManager.getHeaderSettings(row, column)) !== null && _this$headerStateMana2 !== void 0 ? _this$headerStateMana2 : {};
368
422
  if (!collapsible || isCollapsed && action === 'collapse' || !isCollapsed && action === 'expand') {
369
423
  isActionPossible = false;
370
424
  return false;
@@ -436,12 +490,12 @@ export class CollapsibleColumns extends BasePlugin {
436
490
  * values counting from 0 to N).
437
491
  */
438
492
  onAfterGetColHeader(column, TH, headerLevel) {
439
- var _this$headerStateMana2;
493
+ var _this$headerStateMana3;
440
494
  const {
441
495
  collapsible,
442
496
  origColspan,
443
497
  isCollapsed
444
- } = (_this$headerStateMana2 = this.headerStateManager.getHeaderSettings(headerLevel, column)) !== null && _this$headerStateMana2 !== void 0 ? _this$headerStateMana2 : {};
498
+ } = (_this$headerStateMana3 = this.headerStateManager.getHeaderSettings(headerLevel, column)) !== null && _this$headerStateMana3 !== void 0 ? _this$headerStateMana3 : {};
445
499
  const isNodeCollapsible = collapsible && origColspan > 1 && column >= this.hot.getSettings().fixedColumnsStart;
446
500
  let collapsibleElement = TH.querySelector(`.${COLLAPSIBLE_ELEMENT_CLASS}`);
447
501
  if (isNodeCollapsible) {
@@ -21,7 +21,10 @@ exports.PLUGIN_KEY = PLUGIN_KEY;
21
21
  const PLUGIN_PRIORITY = 50;
22
22
  exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
23
23
  const APPEND_COLUMN_CONFIG_STRATEGY = 'append';
24
+ exports.APPEND_COLUMN_CONFIG_STRATEGY = APPEND_COLUMN_CONFIG_STRATEGY;
24
25
  const REPLACE_COLUMN_CONFIG_STRATEGY = 'replace';
26
+ exports.REPLACE_COLUMN_CONFIG_STRATEGY = REPLACE_COLUMN_CONFIG_STRATEGY;
27
+ const SHORTCUTS_GROUP = PLUGIN_KEY;
25
28
  (0, _sortService.registerRootComparator)(PLUGIN_KEY, _rootComparator.rootComparator);
26
29
  _pluginHooks.default.getSingleton().register('beforeColumnSort');
27
30
  _pluginHooks.default.getSingleton().register('afterColumnSort');
@@ -156,6 +159,7 @@ class ColumnSorting extends _base.BasePlugin {
156
159
  if (this.hot.view) {
157
160
  this.loadOrSortBySettings();
158
161
  }
162
+ this.registerShortcuts();
159
163
  super.enablePlugin();
160
164
  }
161
165
 
@@ -186,9 +190,43 @@ class ColumnSorting extends _base.BasePlugin {
186
190
  this.columnStatesManager.destroy();
187
191
  this.columnMetaCache = null;
188
192
  this.columnStatesManager = null;
193
+ this.unregisterShortcuts();
189
194
  super.disablePlugin();
190
195
  }
191
196
 
197
+ /**
198
+ * Register shortcuts responsible for toggling column sorting functionality.
199
+ *
200
+ * @private
201
+ */
202
+ registerShortcuts() {
203
+ this.hot.getShortcutManager().getContext('grid').addShortcut({
204
+ keys: [['Enter']],
205
+ callback: () => {
206
+ const {
207
+ highlight
208
+ } = this.hot.getSelectedRangeLast();
209
+ if (highlight.row === -1 && highlight.col >= 0) {
210
+ this.sort(this.getColumnNextConfig(highlight.col));
211
+ }
212
+ },
213
+ runOnlyIf: () => {
214
+ var _this$hot$getSelected;
215
+ return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
216
+ },
217
+ group: SHORTCUTS_GROUP
218
+ });
219
+ }
220
+
221
+ /**
222
+ * Unregister shortcuts responsible for toggling column sorting functionality.
223
+ *
224
+ * @private
225
+ */
226
+ unregisterShortcuts() {
227
+ this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
228
+ }
229
+
192
230
  // DIFF - MultiColumnSorting & ColumnSorting: changed function documentation.
193
231
  /**
194
232
  * Sorts the table by chosen columns and orders.
@@ -14,8 +14,9 @@ import { rootComparator } from "./rootComparator.mjs";
14
14
  import { registerRootComparator, sort } from "./sortService/index.mjs";
15
15
  export const PLUGIN_KEY = 'columnSorting';
16
16
  export const PLUGIN_PRIORITY = 50;
17
- const APPEND_COLUMN_CONFIG_STRATEGY = 'append';
18
- const REPLACE_COLUMN_CONFIG_STRATEGY = 'replace';
17
+ export const APPEND_COLUMN_CONFIG_STRATEGY = 'append';
18
+ export const REPLACE_COLUMN_CONFIG_STRATEGY = 'replace';
19
+ const SHORTCUTS_GROUP = PLUGIN_KEY;
19
20
  registerRootComparator(PLUGIN_KEY, rootComparator);
20
21
  Hooks.getSingleton().register('beforeColumnSort');
21
22
  Hooks.getSingleton().register('afterColumnSort');
@@ -150,6 +151,7 @@ export class ColumnSorting extends BasePlugin {
150
151
  if (this.hot.view) {
151
152
  this.loadOrSortBySettings();
152
153
  }
154
+ this.registerShortcuts();
153
155
  super.enablePlugin();
154
156
  }
155
157
 
@@ -180,9 +182,43 @@ export class ColumnSorting extends BasePlugin {
180
182
  this.columnStatesManager.destroy();
181
183
  this.columnMetaCache = null;
182
184
  this.columnStatesManager = null;
185
+ this.unregisterShortcuts();
183
186
  super.disablePlugin();
184
187
  }
185
188
 
189
+ /**
190
+ * Register shortcuts responsible for toggling column sorting functionality.
191
+ *
192
+ * @private
193
+ */
194
+ registerShortcuts() {
195
+ this.hot.getShortcutManager().getContext('grid').addShortcut({
196
+ keys: [['Enter']],
197
+ callback: () => {
198
+ const {
199
+ highlight
200
+ } = this.hot.getSelectedRangeLast();
201
+ if (highlight.row === -1 && highlight.col >= 0) {
202
+ this.sort(this.getColumnNextConfig(highlight.col));
203
+ }
204
+ },
205
+ runOnlyIf: () => {
206
+ var _this$hot$getSelected;
207
+ return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
208
+ },
209
+ group: SHORTCUTS_GROUP
210
+ });
211
+ }
212
+
213
+ /**
214
+ * Unregister shortcuts responsible for toggling column sorting functionality.
215
+ *
216
+ * @private
217
+ */
218
+ unregisterShortcuts() {
219
+ this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
220
+ }
221
+
186
222
  // DIFF - MultiColumnSorting & ColumnSorting: changed function documentation.
187
223
  /**
188
224
  * Sorts the table by chosen columns and orders.
@@ -4,4 +4,6 @@ exports.__esModule = true;
4
4
  var _columnSorting = require("./columnSorting");
5
5
  exports.PLUGIN_KEY = _columnSorting.PLUGIN_KEY;
6
6
  exports.PLUGIN_PRIORITY = _columnSorting.PLUGIN_PRIORITY;
7
- exports.ColumnSorting = _columnSorting.ColumnSorting;
7
+ exports.ColumnSorting = _columnSorting.ColumnSorting;
8
+ exports.APPEND_COLUMN_CONFIG_STRATEGY = _columnSorting.APPEND_COLUMN_CONFIG_STRATEGY;
9
+ exports.REPLACE_COLUMN_CONFIG_STRATEGY = _columnSorting.REPLACE_COLUMN_CONFIG_STRATEGY;
@@ -1 +1 @@
1
- export { PLUGIN_KEY, PLUGIN_PRIORITY, ColumnSorting } from "./columnSorting.mjs";
1
+ export { PLUGIN_KEY, PLUGIN_PRIORITY, ColumnSorting, APPEND_COLUMN_CONFIG_STRATEGY, REPLACE_COLUMN_CONFIG_STRATEGY } from "./columnSorting.mjs";
@@ -165,6 +165,7 @@ class CommentEditor {
165
165
  this.rootDocument.body.appendChild(this.container);
166
166
  (0, _element.addClass)(editor, CommentEditor.CLASS_EDITOR);
167
167
  (0, _element.addClass)(textArea, CommentEditor.CLASS_INPUT);
168
+ textArea.setAttribute('data-hot-input', true);
168
169
  editor.appendChild(textArea);
169
170
  this.container.appendChild(editor);
170
171
  return editor;
@@ -162,6 +162,7 @@ class CommentEditor {
162
162
  this.rootDocument.body.appendChild(this.container);
163
163
  addClass(editor, CommentEditor.CLASS_EDITOR);
164
164
  addClass(textArea, CommentEditor.CLASS_INPUT);
165
+ textArea.setAttribute('data-hot-input', true);
165
166
  editor.appendChild(textArea);
166
167
  this.container.appendChild(editor);
167
168
  return editor;