handsontable 0.0.0-next-85c3085-20230713 → 0.0.0-next-08765b9-20230714

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 (295) 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/core/focusCatcher/focusDetector.js +58 -0
  54. package/core/focusCatcher/focusDetector.mjs +54 -0
  55. package/core/focusCatcher/index.js +142 -0
  56. package/core/focusCatcher/index.mjs +138 -0
  57. package/core/index.js +9 -0
  58. package/core/index.mjs +1 -0
  59. package/core.d.ts +6 -3
  60. package/core.js +173 -290
  61. package/core.mjs +173 -290
  62. package/dataMap/metaManager/metaSchema.js +41 -0
  63. package/dataMap/metaManager/metaSchema.mjs +41 -0
  64. package/dist/handsontable.css +19 -3
  65. package/dist/handsontable.full.css +19 -3
  66. package/dist/handsontable.full.js +8668 -5366
  67. package/dist/handsontable.full.min.css +3 -3
  68. package/dist/handsontable.full.min.js +25 -25
  69. package/dist/handsontable.js +10976 -7674
  70. package/dist/handsontable.min.css +3 -3
  71. package/dist/handsontable.min.js +19 -19
  72. package/editorManager.js +11 -75
  73. package/editorManager.mjs +11 -74
  74. package/editors/textEditor/textEditor.js +3 -11
  75. package/editors/textEditor/textEditor.mjs +4 -12
  76. package/helpers/mixed.js +1 -1
  77. package/helpers/mixed.mjs +1 -1
  78. package/helpers/number.d.ts +1 -0
  79. package/helpers/number.js +18 -0
  80. package/helpers/number.mjs +17 -0
  81. package/package.json +1 -1
  82. package/pluginHooks.d.ts +7 -1
  83. package/pluginHooks.js +106 -1
  84. package/pluginHooks.mjs +106 -1
  85. package/plugins/collapsibleColumns/collapsibleColumns.js +58 -4
  86. package/plugins/collapsibleColumns/collapsibleColumns.mjs +58 -4
  87. package/plugins/columnSorting/columnSorting.js +38 -0
  88. package/plugins/columnSorting/columnSorting.mjs +38 -2
  89. package/plugins/columnSorting/index.js +3 -1
  90. package/plugins/columnSorting/index.mjs +1 -1
  91. package/plugins/comments/commentEditor.js +1 -0
  92. package/plugins/comments/commentEditor.mjs +1 -0
  93. package/plugins/comments/comments.js +251 -189
  94. package/plugins/comments/comments.mjs +250 -190
  95. package/plugins/comments/contextMenuItem/addEditComment.js +41 -0
  96. package/plugins/comments/contextMenuItem/addEditComment.mjs +35 -0
  97. package/plugins/comments/contextMenuItem/readOnlyComment.js +49 -0
  98. package/plugins/comments/contextMenuItem/readOnlyComment.mjs +43 -0
  99. package/plugins/comments/contextMenuItem/removeComment.js +38 -0
  100. package/plugins/comments/contextMenuItem/removeComment.mjs +32 -0
  101. package/plugins/contextMenu/contextMenu.d.ts +1 -1
  102. package/plugins/contextMenu/contextMenu.js +72 -30
  103. package/plugins/contextMenu/contextMenu.mjs +73 -31
  104. package/plugins/contextMenu/predefinedItems/alignment.js +7 -0
  105. package/plugins/contextMenu/predefinedItems/alignment.mjs +7 -0
  106. package/plugins/contextMenu/predefinedItems/clearColumn.js +5 -3
  107. package/plugins/contextMenu/predefinedItems/clearColumn.mjs +5 -3
  108. package/plugins/contextMenu/predefinedItems/columnLeft.js +5 -3
  109. package/plugins/contextMenu/predefinedItems/columnLeft.mjs +5 -3
  110. package/plugins/contextMenu/predefinedItems/columnRight.js +5 -3
  111. package/plugins/contextMenu/predefinedItems/columnRight.mjs +5 -3
  112. package/plugins/contextMenu/predefinedItems/readOnly.js +7 -0
  113. package/plugins/contextMenu/predefinedItems/readOnly.mjs +7 -0
  114. package/plugins/contextMenu/predefinedItems/removeColumn.js +7 -5
  115. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +5 -3
  116. package/plugins/contextMenu/predefinedItems/removeRow.js +7 -5
  117. package/plugins/contextMenu/predefinedItems/removeRow.mjs +5 -3
  118. package/plugins/contextMenu/predefinedItems/rowAbove.js +5 -3
  119. package/plugins/contextMenu/predefinedItems/rowAbove.mjs +5 -3
  120. package/plugins/contextMenu/predefinedItems/rowBelow.js +5 -3
  121. package/plugins/contextMenu/predefinedItems/rowBelow.mjs +5 -3
  122. package/plugins/contextMenu/utils.js +28 -16
  123. package/plugins/contextMenu/utils.mjs +27 -15
  124. package/plugins/copyPaste/contextMenuItem/copy.js +7 -0
  125. package/plugins/copyPaste/contextMenuItem/copy.mjs +7 -0
  126. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +9 -1
  127. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +9 -1
  128. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +9 -1
  129. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +9 -1
  130. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +9 -1
  131. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +9 -1
  132. package/plugins/copyPaste/contextMenuItem/cut.js +7 -0
  133. package/plugins/copyPaste/contextMenuItem/cut.mjs +7 -0
  134. package/plugins/copyPaste/copyPaste.js +6 -2
  135. package/plugins/copyPaste/copyPaste.mjs +6 -2
  136. package/plugins/customBorders/customBorders.js +23 -20
  137. package/plugins/customBorders/customBorders.mjs +24 -21
  138. package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
  139. package/plugins/dropdownMenu/dropdownMenu.js +89 -32
  140. package/plugins/dropdownMenu/dropdownMenu.mjs +89 -32
  141. package/plugins/filters/filters.js +31 -14
  142. package/plugins/filters/filters.mjs +30 -13
  143. package/plugins/mergeCells/mergeCells.js +5 -16
  144. package/plugins/mergeCells/mergeCells.mjs +5 -16
  145. package/plugins/multiColumnSorting/multiColumnSorting.js +37 -2
  146. package/plugins/multiColumnSorting/multiColumnSorting.mjs +37 -2
  147. package/plugins/nestedHeaders/nestedHeaders.js +121 -8
  148. package/plugins/nestedHeaders/nestedHeaders.mjs +121 -8
  149. package/plugins/nestedHeaders/stateManager/index.js +37 -0
  150. package/plugins/nestedHeaders/stateManager/index.mjs +37 -0
  151. package/plugins/nestedRows/nestedRows.js +41 -0
  152. package/plugins/nestedRows/nestedRows.mjs +41 -0
  153. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  154. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  155. package/selection/highlight/highlight.js +256 -71
  156. package/selection/highlight/highlight.mjs +250 -71
  157. package/selection/highlight/types/activeHeader.js +10 -8
  158. package/selection/highlight/types/activeHeader.mjs +10 -8
  159. package/selection/highlight/types/area.js +6 -18
  160. package/selection/highlight/types/area.mjs +6 -18
  161. package/selection/highlight/types/areaLayered.js +31 -0
  162. package/selection/highlight/types/areaLayered.mjs +26 -0
  163. package/selection/highlight/types/column.js +27 -0
  164. package/selection/highlight/types/column.mjs +22 -0
  165. package/selection/highlight/types/customSelection.js +7 -9
  166. package/selection/highlight/types/customSelection.mjs +7 -9
  167. package/selection/highlight/types/fill.js +5 -7
  168. package/selection/highlight/types/fill.mjs +5 -7
  169. package/selection/highlight/types/{cell.js → focus.js} +5 -7
  170. package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
  171. package/selection/highlight/types/header.js +9 -18
  172. package/selection/highlight/types/header.mjs +9 -18
  173. package/selection/highlight/types/row.js +27 -0
  174. package/selection/highlight/types/row.mjs +22 -0
  175. package/selection/highlight/visualSelection.js +31 -27
  176. package/selection/highlight/visualSelection.mjs +31 -27
  177. package/selection/index.js +4 -7
  178. package/selection/index.mjs +2 -3
  179. package/selection/mouseEventHandler.js +1 -1
  180. package/selection/mouseEventHandler.mjs +1 -1
  181. package/selection/range.js +8 -8
  182. package/selection/range.mjs +8 -8
  183. package/selection/selection.js +290 -154
  184. package/selection/selection.mjs +287 -153
  185. package/selection/transformation.js +232 -90
  186. package/selection/transformation.mjs +232 -90
  187. package/selection/utils.js +15 -21
  188. package/selection/utils.mjs +16 -21
  189. package/settings.d.ts +2 -0
  190. package/shortcutContexts/commands/editor/closeAndSave.js +12 -0
  191. package/shortcutContexts/commands/editor/closeAndSave.mjs +8 -0
  192. package/shortcutContexts/commands/editor/closeWithoutSaving.js +12 -0
  193. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +8 -0
  194. package/shortcutContexts/commands/editor/fastOpen.js +16 -0
  195. package/shortcutContexts/commands/editor/fastOpen.mjs +12 -0
  196. package/shortcutContexts/commands/editor/index.js +16 -0
  197. package/shortcutContexts/commands/editor/index.mjs +12 -0
  198. package/shortcutContexts/commands/editor/open.js +27 -0
  199. package/shortcutContexts/commands/editor/open.mjs +23 -0
  200. package/shortcutContexts/commands/emptySelectedCells.js +11 -0
  201. package/shortcutContexts/commands/emptySelectedCells.mjs +7 -0
  202. package/shortcutContexts/commands/extendCellsSelection/down.js +15 -0
  203. package/shortcutContexts/commands/extendCellsSelection/down.mjs +11 -0
  204. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +21 -0
  205. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +17 -0
  206. package/shortcutContexts/commands/extendCellsSelection/index.js +26 -0
  207. package/shortcutContexts/commands/extendCellsSelection/index.mjs +22 -0
  208. package/shortcutContexts/commands/extendCellsSelection/left.js +15 -0
  209. package/shortcutContexts/commands/extendCellsSelection/left.mjs +11 -0
  210. package/shortcutContexts/commands/extendCellsSelection/right.js +15 -0
  211. package/shortcutContexts/commands/extendCellsSelection/right.mjs +11 -0
  212. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +19 -0
  213. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +15 -0
  214. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +29 -0
  215. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +25 -0
  216. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +19 -0
  217. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +15 -0
  218. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +19 -0
  219. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +15 -0
  220. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +29 -0
  221. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +25 -0
  222. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +29 -0
  223. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +25 -0
  224. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +29 -0
  225. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +25 -0
  226. package/shortcutContexts/commands/extendCellsSelection/toRows.js +19 -0
  227. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +15 -0
  228. package/shortcutContexts/commands/extendCellsSelection/up.js +15 -0
  229. package/shortcutContexts/commands/extendCellsSelection/up.mjs +11 -0
  230. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +21 -0
  231. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +17 -0
  232. package/shortcutContexts/commands/index.js +35 -0
  233. package/shortcutContexts/commands/index.mjs +31 -0
  234. package/shortcutContexts/commands/moveCellSelection/down.js +13 -0
  235. package/shortcutContexts/commands/moveCellSelection/down.mjs +9 -0
  236. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +31 -0
  237. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +27 -0
  238. package/shortcutContexts/commands/moveCellSelection/index.js +28 -0
  239. package/shortcutContexts/commands/moveCellSelection/index.mjs +24 -0
  240. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +12 -0
  241. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -0
  242. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +12 -0
  243. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -0
  244. package/shortcutContexts/commands/moveCellSelection/left.js +10 -0
  245. package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -0
  246. package/shortcutContexts/commands/moveCellSelection/right.js +10 -0
  247. package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -0
  248. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +17 -0
  249. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +13 -0
  250. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +18 -0
  251. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +14 -0
  252. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +14 -0
  253. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +10 -0
  254. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +17 -0
  255. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +13 -0
  256. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +19 -0
  257. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +15 -0
  258. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +21 -0
  259. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +17 -0
  260. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +17 -0
  261. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +13 -0
  262. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +19 -0
  263. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +15 -0
  264. package/shortcutContexts/commands/moveCellSelection/up.js +13 -0
  265. package/shortcutContexts/commands/moveCellSelection/up.mjs +9 -0
  266. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +31 -0
  267. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +27 -0
  268. package/shortcutContexts/commands/populateSelectedCellsData.js +29 -0
  269. package/shortcutContexts/commands/populateSelectedCellsData.mjs +25 -0
  270. package/shortcutContexts/commands/scrollToFocusedCell.js +36 -0
  271. package/shortcutContexts/commands/scrollToFocusedCell.mjs +32 -0
  272. package/shortcutContexts/commands/selectAll.js +10 -0
  273. package/shortcutContexts/commands/selectAll.mjs +6 -0
  274. package/shortcutContexts/constants.js +13 -0
  275. package/shortcutContexts/constants.mjs +8 -0
  276. package/shortcutContexts/editor.js +25 -0
  277. package/shortcutContexts/editor.mjs +21 -0
  278. package/shortcutContexts/grid.js +163 -0
  279. package/shortcutContexts/grid.mjs +159 -0
  280. package/shortcutContexts/index.js +24 -0
  281. package/shortcutContexts/index.mjs +11 -0
  282. package/shortcuts/manager.js +2 -0
  283. package/shortcuts/manager.mjs +2 -0
  284. package/shortcuts/recorder.js +2 -2
  285. package/shortcuts/recorder.mjs +2 -2
  286. package/shortcuts/utils.js +19 -5
  287. package/shortcuts/utils.mjs +18 -4
  288. package/tableView.js +67 -13
  289. package/tableView.mjs +67 -13
  290. package/3rdparty/walkontable/src/selection.js +0 -295
  291. package/3rdparty/walkontable/src/selection.mjs +0 -290
  292. package/selection/highlight/constants.js +0 -15
  293. package/selection/highlight/constants.mjs +0 -6
  294. package/selection/highlight/types/index.js +0 -35
  295. package/selection/highlight/types/index.mjs +0 -31
@@ -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
  }
@@ -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;
@@ -574,8 +571,11 @@ class MergeCells extends _base.BasePlugin {
574
571
  gridContext.addShortcut({
575
572
  keys: [['Control', 'm']],
576
573
  callback: () => {
577
- this.toggleMerge(this.hot.getSelectedRangeLast());
578
- this.hot.render();
574
+ const range = this.hot.getSelectedRangeLast();
575
+ if (range && !range.isSingleHeader()) {
576
+ this.toggleMerge(range);
577
+ this.hot.render();
578
+ }
579
579
  },
580
580
  runOnlyIf: event => !event.altKey,
581
581
  // right ALT in some systems triggers ALT+CTRL
@@ -1198,16 +1198,5 @@ class MergeCells extends _base.BasePlugin {
1198
1198
  }
1199
1199
  return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel);
1200
1200
  }
1201
-
1202
- /**
1203
- * `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table.
1204
- *
1205
- * @private
1206
- * @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from
1207
- * all the cells in the table.
1208
- */
1209
- onBeforeRemoveCellClassNames() {
1210
- return this.selectionCalculations.getSelectedMergedCellClassNameToRemove();
1211
- }
1212
1201
  }
1213
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;
@@ -568,8 +565,11 @@ export class MergeCells extends BasePlugin {
568
565
  gridContext.addShortcut({
569
566
  keys: [['Control', 'm']],
570
567
  callback: () => {
571
- this.toggleMerge(this.hot.getSelectedRangeLast());
572
- this.hot.render();
568
+ const range = this.hot.getSelectedRangeLast();
569
+ if (range && !range.isSingleHeader()) {
570
+ this.toggleMerge(range);
571
+ this.hot.render();
572
+ }
573
573
  },
574
574
  runOnlyIf: event => !event.altKey,
575
575
  // right ALT in some systems triggers ALT+CTRL
@@ -1192,15 +1192,4 @@ export class MergeCells extends BasePlugin {
1192
1192
  }
1193
1193
  return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel);
1194
1194
  }
1195
-
1196
- /**
1197
- * `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table.
1198
- *
1199
- * @private
1200
- * @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from
1201
- * all the cells in the table.
1202
- */
1203
- onBeforeRemoveCellClassNames() {
1204
- return this.selectionCalculations.getSelectedMergedCellClassNameToRemove();
1205
- }
1206
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
  *
@@ -5,8 +5,8 @@ exports.__esModule = true;
5
5
  require("core-js/modules/es.array.push.js");
6
6
  var _element = require("../../helpers/dom/element");
7
7
  var _number = require("../../helpers/number");
8
- var _event = require("../../helpers/dom/event");
9
8
  var _templateLiteralTag = require("../../helpers/templateLiteralTag");
9
+ var _event = require("../../helpers/dom/event");
10
10
  var _console = require("../../helpers/console");
11
11
  var _selection = require("../../selection");
12
12
  var _base = require("../base");
@@ -158,6 +158,10 @@ class NestedHeaders extends _base.BasePlugin {
158
158
  this.addHook('beforeOnCellMouseOver', function () {
159
159
  return _this.onBeforeOnCellMouseOver(...arguments);
160
160
  });
161
+ this.addHook('modifyTransformStart', function () {
162
+ return _this.onModifyTransformStart(...arguments);
163
+ });
164
+ this.addHook('afterSelection', () => this.updateFocusHighlightPosition());
161
165
  this.addHook('afterGetColumnHeaderRenderers', array => this.onAfterGetColumnHeaderRenderers(array));
162
166
  this.addHook('modifyColWidth', function () {
163
167
  return _this.onModifyColWidth(...arguments);
@@ -171,9 +175,14 @@ class NestedHeaders extends _base.BasePlugin {
171
175
  this.addHook('beforeCopy', function () {
172
176
  return _this.onBeforeCopy(...arguments);
173
177
  });
178
+ this.addHook('beforeSelectColumns', function () {
179
+ return _this.onBeforeSelectColumns(...arguments);
180
+ });
174
181
  this.addHook('afterViewportColumnCalculatorOverride', function () {
175
182
  return _this.onAfterViewportColumnCalculatorOverride(...arguments);
176
183
  });
184
+ this.hot.columnIndexMapper.addLocalHook('cacheUpdated', () => this.updateFocusHighlightPosition());
185
+ this.hot.rowIndexMapper.addLocalHook('cacheUpdated', () => this.updateFocusHighlightPosition());
177
186
  super.enablePlugin();
178
187
  this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
179
188
  }
@@ -389,6 +398,34 @@ class NestedHeaders extends _base.BasePlugin {
389
398
  return this.hot.getColHeader(visualColumnIndex, headerLevel);
390
399
  }
391
400
 
401
+ /**
402
+ * Updates the selection focus highlight position to point to the nested header root element (TH)
403
+ * even when the logical coordinates point in-between the header.
404
+ *
405
+ * @private
406
+ */
407
+ updateFocusHighlightPosition() {
408
+ var _this$hot;
409
+ const selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeLast();
410
+ if (!selection) {
411
+ return;
412
+ }
413
+ const {
414
+ highlight
415
+ } = selection;
416
+ const isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
417
+ if (isNestedHeadersRange) {
418
+ const columnIndex = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(highlight.row, highlight.col);
419
+ const focusHighlight = this.hot.selection.highlight.getFocus();
420
+
421
+ // Correct the highlight/focus selection to highlight the correct TH element
422
+ focusHighlight.visualCellRange.highlight.col = columnIndex;
423
+ focusHighlight.visualCellRange.from.col = columnIndex;
424
+ focusHighlight.visualCellRange.to.col = columnIndex;
425
+ focusHighlight.commit();
426
+ }
427
+ }
428
+
392
429
  /**
393
430
  * Allows to control which header DOM element will be used to highlight.
394
431
  *
@@ -404,7 +441,6 @@ class NestedHeaders extends _base.BasePlugin {
404
441
  return visualColumn;
405
442
  }
406
443
  const {
407
- classNames,
408
444
  columnCursor,
409
445
  selectionType,
410
446
  selectionWidth
@@ -419,8 +455,8 @@ class NestedHeaders extends _base.BasePlugin {
419
455
  }
420
456
  } else if (selectionType === _selection.ACTIVE_HEADER_TYPE) {
421
457
  if (colspan > selectionWidth - columnCursor || !isRoot) {
422
- // Reset the class names array so the generated TH element won't be modified.
423
- classNames.length = 0;
458
+ // Prevents adding any CSS class names to the TH element
459
+ return null;
424
460
  }
425
461
  }
426
462
  return visualColumn;
@@ -574,13 +610,90 @@ class NestedHeaders extends _base.BasePlugin {
574
610
  controller.cell = true;
575
611
  const columnsToSelect = [];
576
612
  if (coords.col < from.col) {
577
- columnsToSelect.push(bottomEndCoords.col, columnIndex);
613
+ columnsToSelect.push(bottomEndCoords.col, columnIndex, coords.row);
578
614
  } else if (coords.col > from.col) {
579
- columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1);
615
+ columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1, coords.row);
580
616
  } else {
581
- columnsToSelect.push(columnIndex, columnIndex + origColspan - 1);
617
+ columnsToSelect.push(columnIndex, columnIndex + origColspan - 1, coords.row);
618
+ }
619
+ this.hot.selection.selectColumns(...columnsToSelect);
620
+ }
621
+
622
+ /**
623
+ * `modifyTransformStart` hook is called every time the keyboard navigation is used.
624
+ *
625
+ * @private
626
+ * @param {object} delta The transformation delta.
627
+ */
628
+ onModifyTransformStart(delta) {
629
+ const {
630
+ highlight
631
+ } = this.hot.getSelectedRangeLast();
632
+ const nextCoords = this.hot._createCellCoords(highlight.row + delta.row, highlight.col + delta.col);
633
+ const isNestedHeadersRange = nextCoords.isHeader() && nextCoords.col >= 0;
634
+ if (!isNestedHeadersRange) {
635
+ return;
636
+ }
637
+ const visualColumnIndexStart = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(nextCoords.row, nextCoords.col);
638
+ const visualColumnIndexEnd = _classPrivateFieldGet(this, _stateManager).findRightMostColumnIndex(nextCoords.row, nextCoords.col);
639
+ if (delta.col < 0) {
640
+ const nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexStart - 1 : visualColumnIndexEnd;
641
+ const notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, -1);
642
+ if (notHiddenColumnIndex === null) {
643
+ // There are no visible columns anymore, so move the selection out of the table edge. This will
644
+ // be processed by the selection Transformer class as a move selection to the previous row (if autoWrapRow is enabled).
645
+ delta.col = -this.hot.view.countRenderableColumnsInRange(0, highlight.col);
646
+ } else {
647
+ delta.col = -Math.max(this.hot.view.countRenderableColumnsInRange(notHiddenColumnIndex, highlight.col) - 1, 1);
648
+ }
649
+ } else if (delta.col > 0) {
650
+ const nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexEnd + 1 : visualColumnIndexStart;
651
+ const notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, 1);
652
+ if (notHiddenColumnIndex === null) {
653
+ // There are no visible columns anymore, so move the selection out of the table edge. This will
654
+ // be processed by the selection Transformer class as a move selection to the next row (if autoWrapRow is enabled).
655
+ delta.col = this.hot.view.countRenderableColumnsInRange(highlight.col, this.hot.countCols());
656
+ } else {
657
+ delta.col = Math.max(this.hot.view.countRenderableColumnsInRange(highlight.col, notHiddenColumnIndex) - 1, 1);
658
+ }
659
+ }
660
+ }
661
+
662
+ /**
663
+ * The hook observes the column selection from the Selection API and modifies the column range to
664
+ * ensure that the whole nested column will be covered.
665
+ *
666
+ * @private
667
+ * @param {*} from The coords object where the selection starts.
668
+ * @param {*} to The coords object where the selection ends.
669
+ */
670
+ onBeforeSelectColumns(from, to) {
671
+ const headerLevel = from.row;
672
+ const startNodeData = this._getHeaderTreeNodeDataByCoords({
673
+ row: headerLevel,
674
+ col: from.col
675
+ });
676
+ const endNodeData = this._getHeaderTreeNodeDataByCoords({
677
+ row: headerLevel,
678
+ col: to.col
679
+ });
680
+ if (to.col < from.col) {
681
+ // Column selection from right to left
682
+ if (startNodeData) {
683
+ from.col = startNodeData.columnIndex + startNodeData.origColspan - 1;
684
+ }
685
+ if (endNodeData) {
686
+ to.col = endNodeData.columnIndex;
687
+ }
688
+ } else if (to.col >= from.col) {
689
+ // Column selection from left to right or a single column selection
690
+ if (startNodeData) {
691
+ from.col = startNodeData.columnIndex;
692
+ }
693
+ if (endNodeData) {
694
+ to.col = endNodeData.columnIndex + endNodeData.origColspan - 1;
695
+ }
582
696
  }
583
- this.hot.selectColumns(...columnsToSelect);
584
697
  }
585
698
 
586
699
  /**