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
@@ -1,6 +1,8 @@
1
1
  import { BasePlugin } from "../base/index.mjs";
2
2
  import { arrayEach } from "../../helpers/array.mjs";
3
+ import { objectEach } from "../../helpers/object.mjs";
3
4
  import CommandExecutor from "../contextMenu/commandExecutor.mjs";
5
+ import { getDocumentOffsetByElement } from "../contextMenu/utils.mjs";
4
6
  import EventManager from "../../eventManager.mjs";
5
7
  import { hasClass } from "../../helpers/dom/element.mjs";
6
8
  import ItemsFactory from "../contextMenu/itemsFactory.mjs";
@@ -15,6 +17,7 @@ Hooks.getSingleton().register('afterDropdownMenuExecute');
15
17
  export const PLUGIN_KEY = 'dropdownMenu';
16
18
  export const PLUGIN_PRIORITY = 230;
17
19
  const BUTTON_CLASS_NAME = 'changeType';
20
+ const SHORTCUTS_GROUP = PLUGIN_KEY;
18
21
 
19
22
  /* eslint-disable jsdoc/require-description-complete-sentence */
20
23
  /**
@@ -151,6 +154,7 @@ export class DropdownMenu extends BasePlugin {
151
154
  if (typeof settings.callback === 'function') {
152
155
  this.commandExecutor.setCommonCallback(settings.callback);
153
156
  }
157
+ this.registerShortcuts();
154
158
  super.enablePlugin();
155
159
  this.callOnPluginsReady(() => {
156
160
  this.hot.runHooks('afterDropdownMenuDefaultOptions', predefinedItems);
@@ -201,9 +205,68 @@ export class DropdownMenu extends BasePlugin {
201
205
  if (this.menu) {
202
206
  this.menu.destroy();
203
207
  }
208
+ this.unregisterShortcuts();
204
209
  super.disablePlugin();
205
210
  }
206
211
 
212
+ /**
213
+ * Register shortcuts responsible for toggling dropdown menu.
214
+ *
215
+ * @private
216
+ */
217
+ registerShortcuts() {
218
+ const context = this.hot.getShortcutManager().getContext('grid');
219
+ const callback = () => {
220
+ const {
221
+ highlight
222
+ } = this.hot.getSelectedRangeLast();
223
+ if ((highlight.isHeader() && highlight.row === -1 || highlight.isCell()) && highlight.col >= 0) {
224
+ this.hot.selectColumns(highlight.col, highlight.col, -1);
225
+ const {
226
+ from
227
+ } = this.hot.getSelectedRangeLast();
228
+ const offset = getDocumentOffsetByElement(this.menu.container, this.hot.rootDocument);
229
+ const target = this.hot.getCell(-1, from.col, true);
230
+ const rect = target.getBoundingClientRect();
231
+ this.open({
232
+ left: rect.left + offset.left,
233
+ top: rect.top + target.offsetHeight + offset.top
234
+ }, {
235
+ left: rect.width
236
+ });
237
+ this.hot._registerTimeout(() => {
238
+ this.menu.selectFirstCell();
239
+ });
240
+ }
241
+ };
242
+ context.addShortcuts([{
243
+ keys: [['Shift', 'Alt', 'ArrowDown'], ['Shift', 'Enter']],
244
+ callback,
245
+ runOnlyIf: () => {
246
+ var _this$hot$getSelected;
247
+ return ((_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader()) && !this.menu.isOpened();
248
+ },
249
+ group: SHORTCUTS_GROUP
250
+ }, {
251
+ keys: [['Shift', 'Alt', 'ArrowDown']],
252
+ callback,
253
+ runOnlyIf: () => {
254
+ var _this$hot$getSelected2;
255
+ return ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isCell()) && !this.menu.isOpened();
256
+ },
257
+ group: SHORTCUTS_GROUP
258
+ }]);
259
+ }
260
+
261
+ /**
262
+ * Unregister shortcuts responsible for toggling dropdown menu.
263
+ *
264
+ * @private
265
+ */
266
+ unregisterShortcuts() {
267
+ this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
268
+ }
269
+
207
270
  /**
208
271
  * Registers the DOM listeners.
209
272
  *
@@ -216,23 +279,30 @@ export class DropdownMenu extends BasePlugin {
216
279
  /**
217
280
  * Opens menu and re-position it based on the passed coordinates.
218
281
  *
219
- * @param {object|Event} position An object with `pageX` and `pageY` properties which contains values relative to
220
- * the top left of the fully rendered content area in the browser or with `clientX`
221
- * and `clientY` properties which contains values relative to the upper left edge
222
- * of the content area (the viewport) of the browser window. This object is structurally
223
- * compatible with native mouse event so it can be used either.
282
+ * @param {{ top: number, left: number }|Event} position An object with `top` and `left` properties
283
+ * which contains coordinates relative to the browsers viewport (without included scroll offsets).
284
+ * Or if the native event is passed the menu will be positioned based on the `pageX` and `pageY`
285
+ * coordinates.
286
+ * @param {{ above: number, below: number, left: number, right: number }} offset An object allows applying
287
+ * the offset to the menu position.
224
288
  * @fires Hooks#beforeDropdownMenuShow
225
289
  * @fires Hooks#afterDropdownMenuShow
226
290
  */
227
-
228
291
  open(position) {
229
- if (!this.menu) {
292
+ var _this$menu;
293
+ let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
294
+ above: 0,
295
+ below: 0,
296
+ left: 0,
297
+ right: 0
298
+ };
299
+ if ((_this$menu = this.menu) !== null && _this$menu !== void 0 && _this$menu.isOpened()) {
230
300
  return;
231
301
  }
232
302
  this.menu.open();
233
- if (position.width) {
234
- this.menu.setOffset('left', position.width);
235
- }
303
+ objectEach(offset, (value, key) => {
304
+ this.menu.setOffset(key, value);
305
+ });
236
306
  this.menu.setPosition(position);
237
307
  }
238
308
 
@@ -240,10 +310,8 @@ export class DropdownMenu extends BasePlugin {
240
310
  * Closes dropdown menu.
241
311
  */
242
312
  close() {
243
- if (!this.menu) {
244
- return;
245
- }
246
- this.menu.close();
313
+ var _this$menu2;
314
+ (_this$menu2 = this.menu) === null || _this$menu2 === void 0 ? void 0 : _this$menu2.close();
247
315
  }
248
316
 
249
317
  /**
@@ -308,26 +376,14 @@ export class DropdownMenu extends BasePlugin {
308
376
  */
309
377
  onTableClick(event) {
310
378
  event.stopPropagation();
311
- if (hasClass(event.target, BUTTON_CLASS_NAME) && !this.menu.isOpened()) {
312
- let offsetTop = 0;
313
- let offsetLeft = 0;
314
- if (this.hot.rootDocument !== this.menu.container.ownerDocument) {
315
- const {
316
- frameElement
317
- } = this.hot.rootWindow;
318
- const {
319
- top,
320
- left
321
- } = frameElement.getBoundingClientRect();
322
- offsetTop = top;
323
- offsetLeft = left;
324
- }
379
+ if (hasClass(event.target, BUTTON_CLASS_NAME)) {
380
+ const offset = getDocumentOffsetByElement(this.menu.container, this.hot.rootDocument);
325
381
  const rect = event.target.getBoundingClientRect();
326
382
  this.open({
327
- left: rect.left + offsetLeft,
328
- top: rect.top + event.target.offsetHeight + 3 + offsetTop,
329
- width: rect.width,
330
- height: rect.height
383
+ left: rect.left + offset.left,
384
+ top: rect.top + event.target.offsetHeight + 3 + offset.top
385
+ }, {
386
+ left: rect.width
331
387
  });
332
388
  }
333
389
  }
@@ -366,6 +422,7 @@ export class DropdownMenu extends BasePlugin {
366
422
  const button = this.hot.rootDocument.createElement('button');
367
423
  button.className = BUTTON_CLASS_NAME;
368
424
  button.type = 'button';
425
+ button.tabIndex = -1;
369
426
 
370
427
  // prevent page reload on button click
371
428
  button.onclick = function () {
@@ -27,6 +27,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
27
27
  const PLUGIN_KEY = 'filters';
28
28
  exports.PLUGIN_KEY = PLUGIN_KEY;
29
29
  const PLUGIN_PRIORITY = 250;
30
+ exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
31
+ const SHORTCUTS_GROUP = PLUGIN_KEY;
30
32
 
31
33
  /**
32
34
  * @plugin Filters
@@ -63,7 +65,6 @@ const PLUGIN_PRIORITY = 250;
63
65
  * ```
64
66
  * :::
65
67
  */
66
- exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
67
68
  class Filters extends _base.BasePlugin {
68
69
  static get PLUGIN_KEY() {
69
70
  return PLUGIN_KEY;
@@ -210,6 +211,7 @@ class Filters extends _base.BasePlugin {
210
211
  this.dropdownMenuPlugin.disablePlugin();
211
212
  this.dropdownMenuPlugin.enablePlugin();
212
213
  }
214
+ this.registerShortcuts();
213
215
  super.enablePlugin();
214
216
  }
215
217
 
@@ -230,9 +232,36 @@ class Filters extends _base.BasePlugin {
230
232
  this.conditionCollection = null;
231
233
  this.hot.rowIndexMapper.unregisterMap(this.pluginName);
232
234
  }
235
+ this.unregisterShortcuts();
233
236
  super.disablePlugin();
234
237
  }
235
238
 
239
+ /**
240
+ * Register shortcuts responsible for clearing the filters.
241
+ *
242
+ * @private
243
+ */
244
+ registerShortcuts() {
245
+ this.hot.getShortcutManager().getContext('grid').addShortcut({
246
+ keys: [['Alt', 'A']],
247
+ stopPropagation: true,
248
+ callback: () => {
249
+ this.clearConditions();
250
+ this.filter();
251
+ },
252
+ group: SHORTCUTS_GROUP
253
+ });
254
+ }
255
+
256
+ /**
257
+ * Unregister shortcuts responsible for clearing the filters.
258
+ *
259
+ * @private
260
+ */
261
+ unregisterShortcuts() {
262
+ this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
263
+ }
264
+
236
265
  /* eslint-disable jsdoc/require-description-complete-sentence */
237
266
  /**
238
267
  * @memberof Filters#
@@ -422,7 +451,6 @@ class Filters extends _base.BasePlugin {
422
451
  this.hot.runHooks('afterFilter', conditions);
423
452
  this.hot.view.adjustElementsSize(true);
424
453
  this.hot.render();
425
- this.clearColumnSelection();
426
454
  }
427
455
 
428
456
  /**
@@ -444,18 +472,6 @@ class Filters extends _base.BasePlugin {
444
472
  };
445
473
  }
446
474
 
447
- /**
448
- * Clears column selection.
449
- *
450
- * @private
451
- */
452
- clearColumnSelection() {
453
- const selectedColumn = this.getSelectedColumn();
454
- if (selectedColumn !== null) {
455
- this.hot.selectCell(0, selectedColumn.visualIndex);
456
- }
457
- }
458
-
459
475
  /**
460
476
  * Returns handsontable source data with cell meta based on current selection.
461
477
  *
@@ -655,6 +671,7 @@ class Filters extends _base.BasePlugin {
655
671
  this.components.forEach(component => component.saveState(physicalIndex));
656
672
  this.filtersRowsMap.clear();
657
673
  this.filter();
674
+ this.hot.selectCell(0, selectedColumn.visualIndex);
658
675
  }
659
676
  (_this$dropdownMenuPlu3 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu3 === void 0 ? void 0 : _this$dropdownMenuPlu3.close();
660
677
  }
@@ -20,6 +20,7 @@ import { CONDITION_NONE, CONDITION_BY_VALUE, OPERATION_AND, OPERATION_OR, OPERAT
20
20
  import { TrimmingMap } from "../../translations/index.mjs";
21
21
  export const PLUGIN_KEY = 'filters';
22
22
  export const PLUGIN_PRIORITY = 250;
23
+ const SHORTCUTS_GROUP = PLUGIN_KEY;
23
24
 
24
25
  /**
25
26
  * @plugin Filters
@@ -202,6 +203,7 @@ export class Filters extends BasePlugin {
202
203
  this.dropdownMenuPlugin.disablePlugin();
203
204
  this.dropdownMenuPlugin.enablePlugin();
204
205
  }
206
+ this.registerShortcuts();
205
207
  super.enablePlugin();
206
208
  }
207
209
 
@@ -222,9 +224,36 @@ export class Filters extends BasePlugin {
222
224
  this.conditionCollection = null;
223
225
  this.hot.rowIndexMapper.unregisterMap(this.pluginName);
224
226
  }
227
+ this.unregisterShortcuts();
225
228
  super.disablePlugin();
226
229
  }
227
230
 
231
+ /**
232
+ * Register shortcuts responsible for clearing the filters.
233
+ *
234
+ * @private
235
+ */
236
+ registerShortcuts() {
237
+ this.hot.getShortcutManager().getContext('grid').addShortcut({
238
+ keys: [['Alt', 'A']],
239
+ stopPropagation: true,
240
+ callback: () => {
241
+ this.clearConditions();
242
+ this.filter();
243
+ },
244
+ group: SHORTCUTS_GROUP
245
+ });
246
+ }
247
+
248
+ /**
249
+ * Unregister shortcuts responsible for clearing the filters.
250
+ *
251
+ * @private
252
+ */
253
+ unregisterShortcuts() {
254
+ this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
255
+ }
256
+
228
257
  /* eslint-disable jsdoc/require-description-complete-sentence */
229
258
  /**
230
259
  * @memberof Filters#
@@ -414,7 +443,6 @@ export class Filters extends BasePlugin {
414
443
  this.hot.runHooks('afterFilter', conditions);
415
444
  this.hot.view.adjustElementsSize(true);
416
445
  this.hot.render();
417
- this.clearColumnSelection();
418
446
  }
419
447
 
420
448
  /**
@@ -436,18 +464,6 @@ export class Filters extends BasePlugin {
436
464
  };
437
465
  }
438
466
 
439
- /**
440
- * Clears column selection.
441
- *
442
- * @private
443
- */
444
- clearColumnSelection() {
445
- const selectedColumn = this.getSelectedColumn();
446
- if (selectedColumn !== null) {
447
- this.hot.selectCell(0, selectedColumn.visualIndex);
448
- }
449
- }
450
-
451
467
  /**
452
468
  * Returns handsontable source data with cell meta based on current selection.
453
469
  *
@@ -647,6 +663,7 @@ export class Filters extends BasePlugin {
647
663
  this.components.forEach(component => component.saveState(physicalIndex));
648
664
  this.filtersRowsMap.clear();
649
665
  this.filter();
666
+ this.hot.selectCell(0, selectedColumn.visualIndex);
650
667
  }
651
668
  (_this$dropdownMenuPlu3 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu3 === void 0 ? void 0 : _this$dropdownMenuPlu3.close();
652
669
  }
@@ -221,12 +221,6 @@ class ManualColumnResize extends _base.BasePlugin {
221
221
  return;
222
222
  }
223
223
  this.currentTH = TH;
224
- const hotRootElement = this.hot.rootElement;
225
-
226
- // Handling elements placed only inside columns header of the main instance.
227
- if ((0, _element.overlayContainsElement)('top_inline_start_corner', this.currentTH, hotRootElement) === false && (0, _element.overlayContainsElement)('top', this.currentTH, hotRootElement) === false) {
228
- return;
229
- }
230
224
  const {
231
225
  _wt: wt
232
226
  } = this.hot.view;
@@ -1,6 +1,6 @@
1
1
  import "core-js/modules/es.array.push.js";
2
2
  import { BasePlugin } from "../base/index.mjs";
3
- import { addClass, closest, hasClass, removeClass, outerHeight, isDetached, overlayContainsElement } from "../../helpers/dom/element.mjs";
3
+ import { addClass, closest, hasClass, removeClass, outerHeight, isDetached } from "../../helpers/dom/element.mjs";
4
4
  import EventManager from "../../eventManager.mjs";
5
5
  import { arrayEach } from "../../helpers/array.mjs";
6
6
  import { rangeEach } from "../../helpers/number.mjs";
@@ -213,12 +213,6 @@ export class ManualColumnResize extends BasePlugin {
213
213
  return;
214
214
  }
215
215
  this.currentTH = TH;
216
- const hotRootElement = this.hot.rootElement;
217
-
218
- // Handling elements placed only inside columns header of the main instance.
219
- if (overlayContainsElement('top_inline_start_corner', this.currentTH, hotRootElement) === false && overlayContainsElement('top', this.currentTH, hotRootElement) === false) {
220
- return;
221
- }
222
216
  const {
223
217
  _wt: wt
224
218
  } = this.hot.view;
@@ -188,9 +188,6 @@ class MergeCells extends _base.BasePlugin {
188
188
  this.addHook('afterDrawSelection', function () {
189
189
  return _this.onAfterDrawSelection(...arguments);
190
190
  });
191
- this.addHook('beforeRemoveCellClassNames', function () {
192
- return _this.onBeforeRemoveCellClassNames(...arguments);
193
- });
194
191
  this.addHook('beforeUndoStackChange', (action, source) => {
195
192
  if (source === 'MergeCells') {
196
193
  return false;
@@ -497,7 +494,6 @@ class MergeCells extends _base.BasePlugin {
497
494
  (0, _number.rangeEach)(0, currentCollection.rowspan - 1, i => {
498
495
  (0, _number.rangeEach)(0, currentCollection.colspan - 1, j => {
499
496
  this.hot.removeCellMeta(currentCollection.row + i, currentCollection.col + j, 'hidden');
500
- this.hot.removeCellMeta(currentCollection.row + i, currentCollection.col + j, 'copyable');
501
497
  });
502
498
  });
503
499
  this.hot.removeCellMeta(currentCollection.row, currentCollection.col, 'spanned');
@@ -575,8 +571,11 @@ class MergeCells extends _base.BasePlugin {
575
571
  gridContext.addShortcut({
576
572
  keys: [['Control', 'm']],
577
573
  callback: () => {
578
- this.toggleMerge(this.hot.getSelectedRangeLast());
579
- this.hot.render();
574
+ const range = this.hot.getSelectedRangeLast();
575
+ if (range && !range.isSingleHeader()) {
576
+ this.toggleMerge(range);
577
+ this.hot.render();
578
+ }
580
579
  },
581
580
  runOnlyIf: event => !event.altKey,
582
581
  // right ALT in some systems triggers ALT+CTRL
@@ -1199,16 +1198,5 @@ class MergeCells extends _base.BasePlugin {
1199
1198
  }
1200
1199
  return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel);
1201
1200
  }
1202
-
1203
- /**
1204
- * `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table.
1205
- *
1206
- * @private
1207
- * @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from
1208
- * all the cells in the table.
1209
- */
1210
- onBeforeRemoveCellClassNames() {
1211
- return this.selectionCalculations.getSelectedMergedCellClassNameToRemove();
1212
- }
1213
1201
  }
1214
1202
  exports.MergeCells = MergeCells;
@@ -182,9 +182,6 @@ export class MergeCells extends BasePlugin {
182
182
  this.addHook('afterDrawSelection', function () {
183
183
  return _this.onAfterDrawSelection(...arguments);
184
184
  });
185
- this.addHook('beforeRemoveCellClassNames', function () {
186
- return _this.onBeforeRemoveCellClassNames(...arguments);
187
- });
188
185
  this.addHook('beforeUndoStackChange', (action, source) => {
189
186
  if (source === 'MergeCells') {
190
187
  return false;
@@ -491,7 +488,6 @@ export class MergeCells extends BasePlugin {
491
488
  rangeEach(0, currentCollection.rowspan - 1, i => {
492
489
  rangeEach(0, currentCollection.colspan - 1, j => {
493
490
  this.hot.removeCellMeta(currentCollection.row + i, currentCollection.col + j, 'hidden');
494
- this.hot.removeCellMeta(currentCollection.row + i, currentCollection.col + j, 'copyable');
495
491
  });
496
492
  });
497
493
  this.hot.removeCellMeta(currentCollection.row, currentCollection.col, 'spanned');
@@ -569,8 +565,11 @@ export class MergeCells extends BasePlugin {
569
565
  gridContext.addShortcut({
570
566
  keys: [['Control', 'm']],
571
567
  callback: () => {
572
- this.toggleMerge(this.hot.getSelectedRangeLast());
573
- this.hot.render();
568
+ const range = this.hot.getSelectedRangeLast();
569
+ if (range && !range.isSingleHeader()) {
570
+ this.toggleMerge(range);
571
+ this.hot.render();
572
+ }
574
573
  },
575
574
  runOnlyIf: event => !event.altKey,
576
575
  // right ALT in some systems triggers ALT+CTRL
@@ -1193,15 +1192,4 @@ export class MergeCells extends BasePlugin {
1193
1192
  }
1194
1193
  return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel);
1195
1194
  }
1196
-
1197
- /**
1198
- * `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table.
1199
- *
1200
- * @private
1201
- * @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from
1202
- * all the cells in the table.
1203
- */
1204
- onBeforeRemoveCellClassNames() {
1205
- return this.selectionCalculations.getSelectedMergedCellClassNameToRemove();
1206
- }
1207
1195
  }
@@ -12,8 +12,8 @@ const PLUGIN_KEY = 'multiColumnSorting';
12
12
  exports.PLUGIN_KEY = PLUGIN_KEY;
13
13
  const PLUGIN_PRIORITY = 170;
14
14
  exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
15
- const APPEND_COLUMN_CONFIG_STRATEGY = 'append';
16
15
  const CONFLICTED_PLUGIN_KEY = 'columnSorting';
16
+ const SHORTCUTS_GROUP = PLUGIN_KEY;
17
17
  (0, _sortService.registerRootComparator)(PLUGIN_KEY, _rootComparator.rootComparator);
18
18
 
19
19
  /**
@@ -113,6 +113,41 @@ class MultiColumnSorting extends _columnSorting.ColumnSorting {
113
113
  super.disablePlugin();
114
114
  }
115
115
 
116
+ /**
117
+ * Register shortcuts responsible for toggling column sorting functionality.
118
+ *
119
+ * @private
120
+ */
121
+ registerShortcuts() {
122
+ super.registerShortcuts();
123
+ this.hot.getShortcutManager().getContext('grid').addShortcut({
124
+ keys: [['Control/Meta', 'Enter']],
125
+ callback: () => {
126
+ const {
127
+ highlight
128
+ } = this.hot.getSelectedRangeLast();
129
+ if (highlight.row === -1 && highlight.col >= 0) {
130
+ this.sort(this.getNextSortConfig(highlight.col, _columnSorting.APPEND_COLUMN_CONFIG_STRATEGY));
131
+ }
132
+ },
133
+ runOnlyIf: () => {
134
+ var _this$hot$getSelected;
135
+ return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
136
+ },
137
+ group: SHORTCUTS_GROUP
138
+ });
139
+ }
140
+
141
+ /**
142
+ * Unregister shortcuts responsible for toggling column sorting functionality.
143
+ *
144
+ * @private
145
+ */
146
+ unregisterShortcuts() {
147
+ super.unregisterShortcuts();
148
+ this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
149
+ }
150
+
116
151
  /**
117
152
  * Sorts the table by chosen columns and orders.
118
153
  *
@@ -262,7 +297,7 @@ class MultiColumnSorting extends _columnSorting.ColumnSorting {
262
297
  if (this.hot.getShortcutManager().isCtrlPressed()) {
263
298
  this.hot.deselectCell();
264
299
  this.hot.selectColumns(coords.col);
265
- this.sort(this.getNextSortConfig(coords.col, APPEND_COLUMN_CONFIG_STRATEGY));
300
+ this.sort(this.getNextSortConfig(coords.col, _columnSorting.APPEND_COLUMN_CONFIG_STRATEGY));
266
301
  } else {
267
302
  this.sort(this.getColumnNextConfig(coords.col));
268
303
  }
@@ -1,4 +1,4 @@
1
- import { ColumnSorting } from "../columnSorting/index.mjs";
1
+ import { APPEND_COLUMN_CONFIG_STRATEGY, ColumnSorting } from "../columnSorting/index.mjs";
2
2
  import { registerRootComparator } from "../columnSorting/sortService/index.mjs";
3
3
  import { wasHeaderClickedProperly } from "../columnSorting/utils.mjs";
4
4
  import { addClass, removeClass } from "../../helpers/dom/element.mjs";
@@ -7,8 +7,8 @@ import { warnAboutPluginsConflict } from "./utils.mjs";
7
7
  import { getClassesToAdd, getClassesToRemove } from "./domHelpers.mjs";
8
8
  export const PLUGIN_KEY = 'multiColumnSorting';
9
9
  export const PLUGIN_PRIORITY = 170;
10
- const APPEND_COLUMN_CONFIG_STRATEGY = 'append';
11
10
  const CONFLICTED_PLUGIN_KEY = 'columnSorting';
11
+ const SHORTCUTS_GROUP = PLUGIN_KEY;
12
12
  registerRootComparator(PLUGIN_KEY, rootComparator);
13
13
 
14
14
  /**
@@ -108,6 +108,41 @@ export class MultiColumnSorting extends ColumnSorting {
108
108
  super.disablePlugin();
109
109
  }
110
110
 
111
+ /**
112
+ * Register shortcuts responsible for toggling column sorting functionality.
113
+ *
114
+ * @private
115
+ */
116
+ registerShortcuts() {
117
+ super.registerShortcuts();
118
+ this.hot.getShortcutManager().getContext('grid').addShortcut({
119
+ keys: [['Control/Meta', 'Enter']],
120
+ callback: () => {
121
+ const {
122
+ highlight
123
+ } = this.hot.getSelectedRangeLast();
124
+ if (highlight.row === -1 && highlight.col >= 0) {
125
+ this.sort(this.getNextSortConfig(highlight.col, APPEND_COLUMN_CONFIG_STRATEGY));
126
+ }
127
+ },
128
+ runOnlyIf: () => {
129
+ var _this$hot$getSelected;
130
+ return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
131
+ },
132
+ group: SHORTCUTS_GROUP
133
+ });
134
+ }
135
+
136
+ /**
137
+ * Unregister shortcuts responsible for toggling column sorting functionality.
138
+ *
139
+ * @private
140
+ */
141
+ unregisterShortcuts() {
142
+ super.unregisterShortcuts();
143
+ this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
144
+ }
145
+
111
146
  /**
112
147
  * Sorts the table by chosen columns and orders.
113
148
  *