handsontable 0.0.0-next-08765b9-20230809 → 0.0.0-next-912c214-20230818

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/{selection/border/border.js → border.js} +12 -7
  2. package/3rdparty/walkontable/src/{selection/border/border.mjs → border.mjs} +12 -7
  3. package/3rdparty/walkontable/src/cell/coords.d.ts +1 -6
  4. package/3rdparty/walkontable/src/cell/coords.js +11 -50
  5. package/3rdparty/walkontable/src/cell/coords.mjs +11 -50
  6. package/3rdparty/walkontable/src/cell/range.d.ts +2 -9
  7. package/3rdparty/walkontable/src/cell/range.js +7 -38
  8. package/3rdparty/walkontable/src/cell/range.mjs +7 -38
  9. package/3rdparty/walkontable/src/core/_base.js +3 -9
  10. package/3rdparty/walkontable/src/core/_base.mjs +3 -9
  11. package/3rdparty/walkontable/src/core/clone.js +2 -2
  12. package/3rdparty/walkontable/src/core/clone.mjs +2 -2
  13. package/3rdparty/walkontable/src/core/core.js +2 -3
  14. package/3rdparty/walkontable/src/core/core.mjs +2 -3
  15. package/3rdparty/walkontable/src/event.js +7 -7
  16. package/3rdparty/walkontable/src/event.mjs +7 -7
  17. package/3rdparty/walkontable/src/facade/core.js +2 -2
  18. package/3rdparty/walkontable/src/facade/core.mjs +2 -2
  19. package/3rdparty/walkontable/src/index.js +2 -10
  20. package/3rdparty/walkontable/src/index.mjs +2 -2
  21. package/3rdparty/walkontable/src/overlay/_base.js +1 -1
  22. package/3rdparty/walkontable/src/overlay/_base.mjs +1 -1
  23. package/3rdparty/walkontable/src/overlay/inlineStart.js +6 -2
  24. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +6 -2
  25. package/3rdparty/walkontable/src/overlay/top.js +6 -2
  26. package/3rdparty/walkontable/src/overlay/top.mjs +6 -2
  27. package/3rdparty/walkontable/src/selection.js +295 -0
  28. package/3rdparty/walkontable/src/selection.mjs +290 -0
  29. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +0 -9
  30. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +0 -9
  31. package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +0 -9
  32. package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +0 -9
  33. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +0 -9
  34. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +0 -9
  35. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +0 -9
  36. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +0 -9
  37. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +0 -9
  38. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +0 -9
  39. package/3rdparty/walkontable/src/table.js +78 -6
  40. package/3rdparty/walkontable/src/table.mjs +79 -7
  41. package/base.js +2 -2
  42. package/base.mjs +2 -2
  43. package/common.d.ts +1 -1
  44. package/core.d.ts +3 -6
  45. package/core.js +290 -173
  46. package/core.mjs +290 -173
  47. package/dataMap/metaManager/metaSchema.js +0 -41
  48. package/dataMap/metaManager/metaSchema.mjs +0 -41
  49. package/dist/handsontable.css +4 -24
  50. package/dist/handsontable.full.css +4 -24
  51. package/dist/handsontable.full.js +5589 -8684
  52. package/dist/handsontable.full.min.css +3 -3
  53. package/dist/handsontable.full.min.js +25 -25
  54. package/dist/handsontable.js +8036 -11131
  55. package/dist/handsontable.min.css +3 -3
  56. package/dist/handsontable.min.js +19 -19
  57. package/editorManager.js +75 -11
  58. package/editorManager.mjs +74 -11
  59. package/editors/baseEditor/baseEditor.d.ts +1 -0
  60. package/editors/textEditor/textEditor.js +11 -3
  61. package/editors/textEditor/textEditor.mjs +12 -4
  62. package/helpers/mixed.js +1 -1
  63. package/helpers/mixed.mjs +1 -1
  64. package/helpers/number.d.ts +0 -1
  65. package/helpers/number.js +0 -18
  66. package/helpers/number.mjs +0 -17
  67. package/package.json +1 -1
  68. package/pluginHooks.d.ts +1 -7
  69. package/pluginHooks.js +1 -106
  70. package/pluginHooks.mjs +1 -106
  71. package/plugins/collapsibleColumns/collapsibleColumns.js +4 -58
  72. package/plugins/collapsibleColumns/collapsibleColumns.mjs +4 -58
  73. package/plugins/columnSorting/columnSorting.js +0 -38
  74. package/plugins/columnSorting/columnSorting.mjs +2 -38
  75. package/plugins/columnSorting/index.js +1 -3
  76. package/plugins/columnSorting/index.mjs +1 -1
  77. package/plugins/comments/commentEditor.js +0 -1
  78. package/plugins/comments/commentEditor.mjs +0 -1
  79. package/plugins/comments/comments.js +189 -251
  80. package/plugins/comments/comments.mjs +190 -250
  81. package/plugins/contextMenu/contextMenu.d.ts +1 -1
  82. package/plugins/contextMenu/contextMenu.js +30 -72
  83. package/plugins/contextMenu/contextMenu.mjs +31 -73
  84. package/plugins/contextMenu/predefinedItems/alignment.js +0 -7
  85. package/plugins/contextMenu/predefinedItems/alignment.mjs +0 -7
  86. package/plugins/contextMenu/predefinedItems/clearColumn.js +3 -5
  87. package/plugins/contextMenu/predefinedItems/clearColumn.mjs +3 -5
  88. package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -5
  89. package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -5
  90. package/plugins/contextMenu/predefinedItems/columnRight.js +3 -5
  91. package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -5
  92. package/plugins/contextMenu/predefinedItems/readOnly.js +0 -7
  93. package/plugins/contextMenu/predefinedItems/readOnly.mjs +0 -7
  94. package/plugins/contextMenu/predefinedItems/removeColumn.js +5 -7
  95. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +3 -5
  96. package/plugins/contextMenu/predefinedItems/removeRow.js +5 -7
  97. package/plugins/contextMenu/predefinedItems/removeRow.mjs +3 -5
  98. package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -5
  99. package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -5
  100. package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -5
  101. package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -5
  102. package/plugins/contextMenu/utils.js +16 -28
  103. package/plugins/contextMenu/utils.mjs +15 -27
  104. package/plugins/copyPaste/contextMenuItem/copy.js +0 -7
  105. package/plugins/copyPaste/contextMenuItem/copy.mjs +0 -7
  106. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +1 -9
  107. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +1 -9
  108. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +1 -9
  109. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +1 -9
  110. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +1 -9
  111. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +1 -9
  112. package/plugins/copyPaste/contextMenuItem/cut.js +0 -7
  113. package/plugins/copyPaste/contextMenuItem/cut.mjs +0 -7
  114. package/plugins/copyPaste/copyPaste.js +10 -14
  115. package/plugins/copyPaste/copyPaste.mjs +10 -14
  116. package/plugins/customBorders/customBorders.js +20 -23
  117. package/plugins/customBorders/customBorders.mjs +21 -24
  118. package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
  119. package/plugins/dropdownMenu/dropdownMenu.js +32 -89
  120. package/plugins/dropdownMenu/dropdownMenu.mjs +32 -89
  121. package/plugins/filters/filters.js +14 -31
  122. package/plugins/filters/filters.mjs +13 -30
  123. package/plugins/manualColumnResize/manualColumnResize.js +6 -0
  124. package/plugins/manualColumnResize/manualColumnResize.mjs +7 -1
  125. package/plugins/mergeCells/mergeCells.js +17 -5
  126. package/plugins/mergeCells/mergeCells.mjs +17 -5
  127. package/plugins/multiColumnSorting/multiColumnSorting.js +2 -37
  128. package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -37
  129. package/plugins/nestedHeaders/nestedHeaders.js +8 -121
  130. package/plugins/nestedHeaders/nestedHeaders.mjs +8 -121
  131. package/plugins/nestedHeaders/stateManager/index.js +0 -37
  132. package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
  133. package/plugins/nestedRows/nestedRows.js +0 -41
  134. package/plugins/nestedRows/nestedRows.mjs +0 -41
  135. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  136. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  137. package/selection/highlight/constants.js +15 -0
  138. package/selection/highlight/constants.mjs +6 -0
  139. package/selection/highlight/highlight.js +71 -256
  140. package/selection/highlight/highlight.mjs +71 -250
  141. package/selection/highlight/types/activeHeader.js +8 -10
  142. package/selection/highlight/types/activeHeader.mjs +8 -10
  143. package/selection/highlight/types/area.js +18 -6
  144. package/selection/highlight/types/area.mjs +18 -6
  145. package/selection/highlight/types/{focus.js → cell.js} +7 -5
  146. package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
  147. package/selection/highlight/types/customSelection.js +9 -7
  148. package/selection/highlight/types/customSelection.mjs +9 -7
  149. package/selection/highlight/types/fill.js +7 -5
  150. package/selection/highlight/types/fill.mjs +7 -5
  151. package/selection/highlight/types/header.js +18 -9
  152. package/selection/highlight/types/header.mjs +18 -9
  153. package/selection/highlight/types/index.js +35 -0
  154. package/selection/highlight/types/index.mjs +31 -0
  155. package/selection/highlight/visualSelection.js +27 -31
  156. package/selection/highlight/visualSelection.mjs +27 -31
  157. package/selection/index.js +7 -4
  158. package/selection/index.mjs +3 -2
  159. package/selection/mouseEventHandler.js +1 -1
  160. package/selection/mouseEventHandler.mjs +1 -1
  161. package/selection/range.js +8 -8
  162. package/selection/range.mjs +8 -8
  163. package/selection/selection.js +154 -290
  164. package/selection/selection.mjs +153 -287
  165. package/selection/transformation.js +90 -232
  166. package/selection/transformation.mjs +90 -232
  167. package/selection/utils.js +21 -15
  168. package/selection/utils.mjs +21 -16
  169. package/settings.d.ts +0 -2
  170. package/shortcuts/manager.js +0 -2
  171. package/shortcuts/manager.mjs +0 -2
  172. package/shortcuts/recorder.js +2 -2
  173. package/shortcuts/recorder.mjs +2 -2
  174. package/shortcuts/utils.js +5 -19
  175. package/shortcuts/utils.mjs +4 -18
  176. package/tableView.js +13 -67
  177. package/tableView.mjs +13 -67
  178. package/3rdparty/walkontable/src/selection/border/constants.js +0 -16
  179. package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -12
  180. package/3rdparty/walkontable/src/selection/constants.js +0 -62
  181. package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
  182. package/3rdparty/walkontable/src/selection/index.js +0 -26
  183. package/3rdparty/walkontable/src/selection/index.mjs +0 -5
  184. package/3rdparty/walkontable/src/selection/manager.js +0 -259
  185. package/3rdparty/walkontable/src/selection/manager.mjs +0 -254
  186. package/3rdparty/walkontable/src/selection/scanner.js +0 -270
  187. package/3rdparty/walkontable/src/selection/scanner.mjs +0 -267
  188. package/3rdparty/walkontable/src/selection/selection.js +0 -101
  189. package/3rdparty/walkontable/src/selection/selection.mjs +0 -96
  190. package/core/focusCatcher/focusDetector.js +0 -58
  191. package/core/focusCatcher/focusDetector.mjs +0 -54
  192. package/core/focusCatcher/index.js +0 -142
  193. package/core/focusCatcher/index.mjs +0 -138
  194. package/core/index.js +0 -9
  195. package/core/index.mjs +0 -1
  196. package/plugins/comments/contextMenuItem/addEditComment.js +0 -41
  197. package/plugins/comments/contextMenuItem/addEditComment.mjs +0 -35
  198. package/plugins/comments/contextMenuItem/readOnlyComment.js +0 -49
  199. package/plugins/comments/contextMenuItem/readOnlyComment.mjs +0 -43
  200. package/plugins/comments/contextMenuItem/removeComment.js +0 -38
  201. package/plugins/comments/contextMenuItem/removeComment.mjs +0 -32
  202. package/selection/highlight/types/areaLayered.js +0 -31
  203. package/selection/highlight/types/areaLayered.mjs +0 -26
  204. package/selection/highlight/types/column.js +0 -27
  205. package/selection/highlight/types/column.mjs +0 -22
  206. package/selection/highlight/types/row.js +0 -27
  207. package/selection/highlight/types/row.mjs +0 -22
  208. package/shortcutContexts/commands/editor/closeAndSave.js +0 -12
  209. package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -8
  210. package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -12
  211. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
  212. package/shortcutContexts/commands/editor/fastOpen.js +0 -16
  213. package/shortcutContexts/commands/editor/fastOpen.mjs +0 -12
  214. package/shortcutContexts/commands/editor/index.js +0 -16
  215. package/shortcutContexts/commands/editor/index.mjs +0 -12
  216. package/shortcutContexts/commands/editor/open.js +0 -27
  217. package/shortcutContexts/commands/editor/open.mjs +0 -23
  218. package/shortcutContexts/commands/emptySelectedCells.js +0 -11
  219. package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
  220. package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
  221. package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -11
  222. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -21
  223. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -17
  224. package/shortcutContexts/commands/extendCellsSelection/index.js +0 -26
  225. package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -22
  226. package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
  227. package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -11
  228. package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
  229. package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -11
  230. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +0 -19
  231. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +0 -15
  232. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -29
  233. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -25
  234. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -19
  235. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -15
  236. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -19
  237. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -15
  238. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -29
  239. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -25
  240. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -29
  241. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -25
  242. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -29
  243. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -25
  244. package/shortcutContexts/commands/extendCellsSelection/toRows.js +0 -19
  245. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +0 -15
  246. package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
  247. package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -11
  248. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -21
  249. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -17
  250. package/shortcutContexts/commands/index.js +0 -35
  251. package/shortcutContexts/commands/index.mjs +0 -31
  252. package/shortcutContexts/commands/moveCellSelection/down.js +0 -13
  253. package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -9
  254. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -31
  255. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -27
  256. package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
  257. package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
  258. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -12
  259. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
  260. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -12
  261. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
  262. package/shortcutContexts/commands/moveCellSelection/left.js +0 -10
  263. package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
  264. package/shortcutContexts/commands/moveCellSelection/right.js +0 -10
  265. package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
  266. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -17
  267. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -13
  268. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -18
  269. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -14
  270. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -14
  271. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -10
  272. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -17
  273. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -13
  274. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -19
  275. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -15
  276. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -21
  277. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -17
  278. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -17
  279. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -13
  280. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -19
  281. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -15
  282. package/shortcutContexts/commands/moveCellSelection/up.js +0 -13
  283. package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -9
  284. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -31
  285. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -27
  286. package/shortcutContexts/commands/populateSelectedCellsData.js +0 -29
  287. package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -25
  288. package/shortcutContexts/commands/scrollToFocusedCell.js +0 -36
  289. package/shortcutContexts/commands/scrollToFocusedCell.mjs +0 -32
  290. package/shortcutContexts/commands/selectAll.js +0 -10
  291. package/shortcutContexts/commands/selectAll.mjs +0 -6
  292. package/shortcutContexts/constants.js +0 -13
  293. package/shortcutContexts/constants.mjs +0 -8
  294. package/shortcutContexts/editor.js +0 -25
  295. package/shortcutContexts/editor.mjs +0 -21
  296. package/shortcutContexts/grid.js +0 -163
  297. package/shortcutContexts/grid.mjs +0 -159
  298. package/shortcutContexts/index.js +0 -24
  299. package/shortcutContexts/index.mjs +0 -11
package/core.js CHANGED
@@ -31,22 +31,12 @@ var _registry5 = require("./i18n/registry");
31
31
  var _utils = require("./i18n/utils");
32
32
  var _selection = require("./selection");
33
33
  var _dataMap = require("./dataMap");
34
- var _index3 = require("./core/index");
35
34
  var _uniqueMap = require("./utils/dataStructures/uniqueMap");
36
35
  var _shortcuts = require("./shortcuts");
37
- var _shortcutContexts = require("./shortcutContexts");
38
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
+ const SHORTCUTS_GROUP = 'gridDefault';
39
38
  let activeGuid = null;
40
39
 
41
- /**
42
- * Keeps the collection of the all Handsontable instances created on the same page. The
43
- * list is then used to trigger the "afterUnlisten" hook when the "listen()" method was
44
- * called on another instance.
45
- *
46
- * @type {Map<string, Core>}
47
- */
48
- const foreignHotInstances = new Map();
49
-
50
40
  /**
51
41
  * A set of deprecated feature names.
52
42
  *
@@ -106,8 +96,7 @@ const deprecationWarns = new Set();
106
96
  * @param {boolean} [rootInstanceSymbol=false] Indicates if the instance is root of all later instances created.
107
97
  */
108
98
  function Core(rootElement, userSettings) {
109
- var _userSettings$layoutD,
110
- _this = this;
99
+ var _userSettings$layoutD;
111
100
  let rootInstanceSymbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
112
101
  let preventScrollingToCell = false;
113
102
  let instance = this;
@@ -224,8 +213,6 @@ function Core(rootElement, userSettings) {
224
213
  }
225
214
  this.guid = `ht_${(0, _string.randomString)()}`; // this is the namespace for global events
226
215
 
227
- foreignHotInstances.set(this.guid, this);
228
-
229
216
  /**
230
217
  * Instance of index mapper which is responsible for managing the column indexes.
231
218
  *
@@ -274,16 +261,14 @@ function Core(rootElement, userSettings) {
274
261
  };
275
262
 
276
263
  let selection = new _selection.Selection(tableMeta, {
277
- rowIndexMapper: instance.rowIndexMapper,
278
- columnIndexMapper: instance.columnIndexMapper,
264
+ rowIndexMapper: () => instance.rowIndexMapper,
265
+ columnIndexMapper: () => instance.columnIndexMapper,
279
266
  countCols: () => instance.countCols(),
280
267
  countRows: () => instance.countRows(),
281
268
  propToCol: prop => datamap.propToCol(prop),
282
269
  isEditorOpened: () => instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false,
283
- countRenderableColumns: () => this.view.countRenderableColumns(),
284
- countRenderableRows: () => this.view.countRenderableRows(),
285
- countRowHeaders: () => this.countRowHeaders(),
286
- countColHeaders: () => this.countColHeaders(),
270
+ countColsTranslated: () => this.view.countRenderableColumns(),
271
+ countRowsTranslated: () => this.view.countRenderableRows(),
287
272
  getShortcutManager: () => instance.getShortcutManager(),
288
273
  createCellCoords: (row, column) => instance._createCellCoords(row, column),
289
274
  createCellRange: (highlight, from, to) => instance._createCellRange(highlight, from, to),
@@ -310,6 +295,12 @@ function Core(rootElement, userSettings) {
310
295
  });
311
296
  this.selection.addLocalHook('beforeSetRangeEnd', cellCoords => {
312
297
  this.runHooks('beforeSetRangeEnd', cellCoords);
298
+ if (cellCoords.row < 0) {
299
+ cellCoords.row = this.view._wt.wtTable.getFirstVisibleRow();
300
+ }
301
+ if (cellCoords.col < 0) {
302
+ cellCoords.col = this.view._wt.wtTable.getFirstVisibleColumn();
303
+ }
313
304
  });
314
305
  this.selection.addLocalHook('afterSetRangeEnd', cellCoords => {
315
306
  const preventScrolling = (0, _object.createObjectPropListener)(false);
@@ -336,14 +327,7 @@ function Core(rootElement, userSettings) {
336
327
  if (scrollToCell !== false) {
337
328
  if (!isSelectedByAnyHeader) {
338
329
  if (currentSelectedRange && !this.selection.isMultiple()) {
339
- const renderableCoords = visualToRenderableCoords(currentSelectedRange.from);
340
- if (renderableCoords.row < 0 && renderableCoords.col >= 0) {
341
- this.view.scrollViewportHorizontally(renderableCoords.col);
342
- } else if (renderableCoords.col < 0 && renderableCoords.row >= 0) {
343
- this.view.scrollViewportVertically(renderableCoords.row);
344
- } else {
345
- this.view.scrollViewport(renderableCoords);
346
- }
330
+ this.view.scrollViewport(visualToRenderableCoords(currentSelectedRange.from));
347
331
  } else {
348
332
  this.view.scrollViewport(visualToRenderableCoords(cellCoords));
349
333
  }
@@ -385,30 +369,6 @@ function Core(rootElement, userSettings) {
385
369
  isMultiple.value = changedIsMultiple;
386
370
  }
387
371
  });
388
- this.selection.addLocalHook('beforeSelectColumns', function () {
389
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
390
- args[_key] = arguments[_key];
391
- }
392
- return _this.runHooks('beforeSelectColumns', ...args);
393
- });
394
- this.selection.addLocalHook('afterSelectColumns', function () {
395
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
396
- args[_key2] = arguments[_key2];
397
- }
398
- return _this.runHooks('afterSelectColumns', ...args);
399
- });
400
- this.selection.addLocalHook('beforeSelectRows', function () {
401
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
402
- args[_key3] = arguments[_key3];
403
- }
404
- return _this.runHooks('beforeSelectRows', ...args);
405
- });
406
- this.selection.addLocalHook('afterSelectRows', function () {
407
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
408
- args[_key4] = arguments[_key4];
409
- }
410
- return _this.runHooks('afterSelectRows', ...args);
411
- });
412
372
  this.selection.addLocalHook('beforeModifyTransformStart', cellCoordsDelta => {
413
373
  this.runHooks('modifyTransformStart', cellCoordsDelta);
414
374
  });
@@ -1058,9 +1018,6 @@ function Core(rootElement, userSettings) {
1058
1018
  this.updateSettings(tableMeta, true);
1059
1019
  this.view = new _tableView.default(this);
1060
1020
  editorManager = _editorManager.default.getInstance(instance, tableMeta, selection);
1061
- if ((0, _rootInstance.isRootInstance)(this)) {
1062
- (0, _index3.installFocusCatcher)(instance);
1063
- }
1064
1021
  instance.runHooks('init');
1065
1022
  this.forceFullRender = true; // used when data was changed
1066
1023
  this.view.render();
@@ -1474,11 +1431,6 @@ function Core(rootElement, userSettings) {
1474
1431
  */
1475
1432
  this.listen = function () {
1476
1433
  if (instance && !instance.isListening()) {
1477
- foreignHotInstances.forEach(foreignHot => {
1478
- if (instance !== foreignHot) {
1479
- foreignHot.unlisten();
1480
- }
1481
- });
1482
1434
  activeGuid = instance.guid;
1483
1435
  instance.runHooks('afterListen');
1484
1436
  }
@@ -1563,8 +1515,8 @@ function Core(rootElement, userSettings) {
1563
1515
  * @returns {Array} Returns removed portion of columns.
1564
1516
  */
1565
1517
  this.spliceCol = function (column, index, amount) {
1566
- for (var _len5 = arguments.length, elements = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
1567
- elements[_key5 - 3] = arguments[_key5];
1518
+ for (var _len = arguments.length, elements = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
1519
+ elements[_key - 3] = arguments[_key];
1568
1520
  }
1569
1521
  return datamap.spliceCol(column, index, amount, ...elements);
1570
1522
  };
@@ -1581,8 +1533,8 @@ function Core(rootElement, userSettings) {
1581
1533
  * @returns {Array} Returns removed portion of rows.
1582
1534
  */
1583
1535
  this.spliceRow = function (row, index, amount) {
1584
- for (var _len6 = arguments.length, elements = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
1585
- elements[_key6 - 3] = arguments[_key6];
1536
+ for (var _len2 = arguments.length, elements = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
1537
+ elements[_key2 - 3] = arguments[_key2];
1586
1538
  }
1587
1539
  return datamap.spliceRow(row, index, amount, ...elements);
1588
1540
  };
@@ -1679,9 +1631,6 @@ function Core(rootElement, userSettings) {
1679
1631
  }
1680
1632
  const changes = [];
1681
1633
  (0, _array.arrayEach)(selection.getSelectedRange(), cellRange => {
1682
- if (cellRange.isSingleHeader()) {
1683
- return;
1684
- }
1685
1634
  const topStart = cellRange.getTopStartCorner();
1686
1635
  const bottomEnd = cellRange.getBottomEndCorner();
1687
1636
  (0, _number.rangeEach)(topStart.row, bottomEnd.row, row => {
@@ -2979,8 +2928,8 @@ function Core(rootElement, userSettings) {
2979
2928
  */
2980
2929
  this.spliceCellsMeta = function (visualIndex) {
2981
2930
  let deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2982
- for (var _len7 = arguments.length, cellMetaRows = new Array(_len7 > 2 ? _len7 - 2 : 0), _key7 = 2; _key7 < _len7; _key7++) {
2983
- cellMetaRows[_key7 - 2] = arguments[_key7];
2931
+ for (var _len3 = arguments.length, cellMetaRows = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
2932
+ cellMetaRows[_key3 - 2] = arguments[_key3];
2984
2933
  }
2985
2934
  if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
2986
2935
  throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
@@ -3671,30 +3620,6 @@ function Core(rootElement, userSettings) {
3671
3620
  return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
3672
3621
  };
3673
3622
 
3674
- /**
3675
- * Returns the number of rendered row headers.
3676
- *
3677
- * @since 14.0.0
3678
- * @memberof Core#
3679
- * @function countRowHeaders
3680
- * @returns {number} Number of row headers.
3681
- */
3682
- this.countRowHeaders = function () {
3683
- return this.view.getRowHeadersCount();
3684
- };
3685
-
3686
- /**
3687
- * Returns the number of rendered column headers.
3688
- *
3689
- * @since 14.0.0
3690
- * @memberof Core#
3691
- * @function countColHeaders
3692
- * @returns {number} Number of column headers.
3693
- */
3694
- this.countColHeaders = function () {
3695
- return this.view.getColumnHeadersCount();
3696
- };
3697
-
3698
3623
  /**
3699
3624
  * Returns the number of empty rows. If the optional ending parameter is `true`, returns the
3700
3625
  * number of empty rows at the bottom of the table.
@@ -3899,10 +3824,6 @@ function Core(rootElement, userSettings) {
3899
3824
  * hot.selectColumns('id');
3900
3825
  * // Select range of columns using visual indexes.
3901
3826
  * hot.selectColumns(1, 4);
3902
- * // Select range of columns using visual indexes and mark the first header as highlighted.
3903
- * hot.selectColumns(1, 2, -1);
3904
- * // Select range of columns using visual indexes and mark the second cell as highlighted.
3905
- * hot.selectColumns(2, 1, 1);
3906
3827
  * // Select range of columns using column properties.
3907
3828
  * hot.selectColumns('id', 'last_name');
3908
3829
  * ```
@@ -3913,15 +3834,11 @@ function Core(rootElement, userSettings) {
3913
3834
  * @param {number} startColumn The visual column index from which the selection starts.
3914
3835
  * @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
3915
3836
  * is not defined the column defined by `startColumn` will be selected.
3916
- * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
3917
- * The value can take visual row index from -N to N, where negative values
3918
- * point to the headers and positive values point to the cell range.
3919
3837
  * @returns {boolean} `true` if selection was successful, `false` otherwise.
3920
3838
  */
3921
3839
  this.selectColumns = function (startColumn) {
3922
3840
  let endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
3923
- let focusPosition = arguments.length > 2 ? arguments[2] : undefined;
3924
- return selection.selectColumns(startColumn, endColumn, focusPosition);
3841
+ return selection.selectColumns(startColumn, endColumn);
3925
3842
  };
3926
3843
 
3927
3844
  /**
@@ -3931,12 +3848,8 @@ function Core(rootElement, userSettings) {
3931
3848
  * ```js
3932
3849
  * // Select row using visual index.
3933
3850
  * hot.selectRows(1);
3934
- * // select a range of rows, using visual indexes.
3851
+ * // Select range of rows using visual indexes.
3935
3852
  * hot.selectRows(1, 4);
3936
- * // select a range of rows, using visual indexes, and mark the header as highlighted.
3937
- * hot.selectRows(1, 2, -1);
3938
- * // Select range of rows using visual indexes and mark the second cell as highlighted.
3939
- * hot.selectRows(2, 1, 1);
3940
3853
  * ```
3941
3854
  *
3942
3855
  * @memberof Core#
@@ -3945,15 +3858,11 @@ function Core(rootElement, userSettings) {
3945
3858
  * @param {number} startRow The visual row index from which the selection starts.
3946
3859
  * @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
3947
3860
  * is not defined the row defined by `startRow` will be selected.
3948
- * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
3949
- * The value can take visual column index from -N to N, where negative values
3950
- * point to the headers and positive values point to the cell range.
3951
3861
  * @returns {boolean} `true` if selection was successful, `false` otherwise.
3952
3862
  */
3953
3863
  this.selectRows = function (startRow) {
3954
3864
  let endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
3955
- let focusPosition = arguments.length > 2 ? arguments[2] : undefined;
3956
- return selection.selectRows(startRow, endRow, focusPosition);
3865
+ return selection.selectRows(startRow, endRow);
3957
3866
  };
3958
3867
 
3959
3868
  /**
@@ -3972,16 +3881,9 @@ function Core(rootElement, userSettings) {
3972
3881
  * The previous selection is overwritten.
3973
3882
  *
3974
3883
  * ```js
3975
- * // select all cells in the table, including all headers and the corner cell
3884
+ * // select all cells in the table, including all headers
3976
3885
  * hot.selectAll();
3977
3886
  *
3978
- * // select all cells in the table, including row headers but excluding the corner cell
3979
- * hot.selectAll(true, false);
3980
- *
3981
- * // select all cells in the table, including all headers and the corner cell, but move the focus
3982
- * // highlight to position -2, -1
3983
- * hot.selectAll(-2, -1);
3984
- *
3985
3887
  * // select all cells in the table, without headers
3986
3888
  * hot.selectAll(false);
3987
3889
  * ```
@@ -3989,20 +3891,15 @@ function Core(rootElement, userSettings) {
3989
3891
  * @since 0.38.2
3990
3892
  * @memberof Core#
3991
3893
  * @function selectAll
3992
- * @param {boolean} [includeRowHeaders=false] `true` If the selection should include the row headers,
3993
- * `false` otherwise.
3994
- * @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
3995
- * headers, `false` otherwise.
3996
- * @param {{row: number, col: number}} [focusPosition] The argument allows changing the cell/header
3997
- * focus position. The value takes an object with a `row` and `col` properties (visual indexes)
3998
- * from -N to N, where negative values point to the headers and positive values point to the cell range.
3894
+ * @param {boolean} [includeHeaders=true] `true`: include all row, column and corner headers.
3895
+ * `false`: don't include any headers.
3999
3896
  */
4000
3897
  this.selectAll = function () {
4001
- let includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4002
- let includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : includeRowHeaders;
4003
- let focusPosition = arguments.length > 2 ? arguments[2] : undefined;
3898
+ let includeHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
3899
+ const includeRowHeaders = includeHeaders && this.hasRowHeaders();
3900
+ const includeColumnHeaders = includeHeaders && this.hasColHeaders();
4004
3901
  preventScrollingToCell = true;
4005
- selection.selectAll(includeRowHeaders, includeColumnHeaders, focusPosition);
3902
+ selection.selectAll(includeRowHeaders, includeColumnHeaders);
4006
3903
  preventScrollingToCell = false;
4007
3904
  };
4008
3905
  const getIndexToScroll = (indexMapper, visualIndex) => {
@@ -4060,34 +3957,6 @@ function Core(rootElement, userSettings) {
4060
3957
  return false;
4061
3958
  };
4062
3959
 
4063
- /**
4064
- * Scrolls the viewport to coordinates specified by the currently focused cell.
4065
- *
4066
- * @since 14.0.0
4067
- * @memberof Core#
4068
- * @function scrollToFocusedCell
4069
- * @param {Function} callback The callback function to call after the viewport is scrolled.
4070
- */
4071
- this.scrollToFocusedCell = function () {
4072
- let callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : () => {};
4073
- if (!this.selection.isSelected()) {
4074
- return;
4075
- }
4076
- this.addHookOnce('afterScroll', callback);
4077
- const {
4078
- highlight
4079
- } = this.getSelectedRangeLast();
4080
- const renderableRowIndex = this.rowIndexMapper.getRenderableFromVisualIndex(highlight.row);
4081
- const renderableColumnIndex = this.columnIndexMapper.getRenderableFromVisualIndex(highlight.col);
4082
- const isScrolled = this.view.scrollViewport(this._createCellCoords(renderableRowIndex, renderableColumnIndex));
4083
- if (isScrolled) {
4084
- this.view.render();
4085
- } else {
4086
- this.removeHook('afterScroll', callback);
4087
- this._registerImmediate(() => callback());
4088
- }
4089
- };
4090
-
4091
3960
  /**
4092
3961
  * Removes the table from the DOM and destroys the instance of the Handsontable.
4093
3962
  *
@@ -4108,7 +3977,6 @@ function Core(rootElement, userSettings) {
4108
3977
  dataSource = null;
4109
3978
  this.getShortcutManager().destroy();
4110
3979
  metaManager.clearCache();
4111
- foreignHotInstances.delete(this.guid);
4112
3980
  if ((0, _rootInstance.isRootInstance)(instance)) {
4113
3981
  const licenseInfo = this.rootDocument.querySelector('.hot-display-license-info');
4114
3982
  if (licenseInfo) {
@@ -4432,16 +4300,6 @@ function Core(rootElement, userSettings) {
4432
4300
  }
4433
4301
  };
4434
4302
 
4435
- /**
4436
- * Gets the instance of the EditorManager.
4437
- *
4438
- * @private
4439
- * @returns {EditorManager}
4440
- */
4441
- this._getEditorManager = function () {
4442
- return editorManager;
4443
- };
4444
-
4445
4303
  /**
4446
4304
  * Check if currently it is RTL direction.
4447
4305
  *
@@ -4514,11 +4372,270 @@ function Core(rootElement, userSettings) {
4514
4372
  this.getShortcutManager = function () {
4515
4373
  return shortcutManager;
4516
4374
  };
4375
+ const gridContext = shortcutManager.addContext('grid');
4376
+ const gridConfig = {
4377
+ runOnlyIf: () => {
4378
+ return (0, _mixed.isDefined)(instance.getSelected()) && instance.countRenderedRows() > 0 && instance.countRenderedCols() > 0;
4379
+ },
4380
+ group: SHORTCUTS_GROUP
4381
+ };
4382
+ shortcutManager.setActiveContextName('grid');
4383
+ gridContext.addShortcuts([{
4384
+ keys: [['Control/Meta', 'A']],
4385
+ callback: () => {
4386
+ instance.selectAll();
4387
+ }
4388
+ }, {
4389
+ keys: [['Control/Meta', 'Enter']],
4390
+ callback: () => {
4391
+ const selectedRange = instance.getSelectedRange();
4392
+ const {
4393
+ row: highlightRow,
4394
+ col: highlightColumn
4395
+ } = selectedRange[selectedRange.length - 1].highlight;
4396
+ const valueToPopulate = instance.getDataAtCell(highlightRow, highlightColumn);
4397
+ const cellValues = new Map();
4398
+ for (let i = 0; i < selectedRange.length; i++) {
4399
+ selectedRange[i].forAll((row, column) => {
4400
+ if (row >= 0 && column >= 0 && (row !== highlightRow || column !== highlightColumn)) {
4401
+ const {
4402
+ readOnly
4403
+ } = instance.getCellMeta(row, column);
4404
+ if (!readOnly) {
4405
+ cellValues.set(`${row}x${column}`, [row, column, valueToPopulate]);
4406
+ }
4407
+ }
4408
+ });
4409
+ }
4410
+ instance.setDataAtCell(Array.from(cellValues.values()));
4411
+ },
4412
+ runOnlyIf: () => instance.getSelectedRangeLast().getCellsCount() > 1
4413
+ }, {
4414
+ keys: [['ArrowUp']],
4415
+ callback: () => {
4416
+ selection.transformStart(-1, 0);
4417
+ }
4418
+ }, {
4419
+ keys: [['ArrowUp', 'Control/Meta']],
4420
+ captureCtrl: true,
4421
+ callback: () => {
4422
+ selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1), instance.getSelectedRangeLast().highlight.col));
4423
+ }
4424
+ }, {
4425
+ keys: [['ArrowUp', 'Shift']],
4426
+ callback: () => {
4427
+ selection.transformEnd(-1, 0);
4428
+ }
4429
+ }, {
4430
+ keys: [['ArrowUp', 'Shift', 'Control/Meta']],
4431
+ captureCtrl: true,
4432
+ callback: () => {
4433
+ const {
4434
+ from,
4435
+ to
4436
+ } = instance.getSelectedRangeLast();
4437
+ const row = instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1);
4438
+ selection.setRangeStart(from.clone());
4439
+ selection.setRangeEnd(instance._createCellCoords(row, to.col));
4440
+ },
4441
+ runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader())
4442
+ }, {
4443
+ keys: [['ArrowDown']],
4444
+ callback: () => {
4445
+ selection.transformStart(1, 0);
4446
+ }
4447
+ }, {
4448
+ keys: [['ArrowDown', 'Control/Meta']],
4449
+ captureCtrl: true,
4450
+ callback: () => {
4451
+ selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1), instance.getSelectedRangeLast().highlight.col));
4452
+ }
4453
+ }, {
4454
+ keys: [['ArrowDown', 'Shift']],
4455
+ callback: () => {
4456
+ selection.transformEnd(1, 0);
4457
+ }
4458
+ }, {
4459
+ keys: [['ArrowDown', 'Shift', 'Control/Meta']],
4460
+ captureCtrl: true,
4461
+ callback: () => {
4462
+ const {
4463
+ from,
4464
+ to
4465
+ } = instance.getSelectedRangeLast();
4466
+ const row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1);
4467
+ selection.setRangeStart(from.clone());
4468
+ selection.setRangeEnd(instance._createCellCoords(row, to.col));
4469
+ },
4470
+ runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader())
4471
+ }, {
4472
+ keys: [['ArrowLeft']],
4473
+ callback: () => {
4474
+ selection.transformStart(0, -1 * instance.getDirectionFactor());
4475
+ }
4476
+ }, {
4477
+ keys: [['ArrowLeft', 'Control/Meta']],
4478
+ captureCtrl: true,
4479
+ callback: () => {
4480
+ const row = instance.getSelectedRangeLast().highlight.row;
4481
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
4482
+ selection.setRangeStart(instance._createCellCoords(row, column));
4483
+ }
4484
+ }, {
4485
+ keys: [['ArrowLeft', 'Shift']],
4486
+ callback: () => {
4487
+ selection.transformEnd(0, -1 * instance.getDirectionFactor());
4488
+ }
4489
+ }, {
4490
+ keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
4491
+ captureCtrl: true,
4492
+ callback: () => {
4493
+ const {
4494
+ from,
4495
+ to
4496
+ } = instance.getSelectedRangeLast();
4497
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
4498
+ selection.setRangeStart(from.clone());
4499
+ selection.setRangeEnd(instance._createCellCoords(to.row, column));
4500
+ },
4501
+ runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader())
4502
+ }, {
4503
+ keys: [['ArrowRight']],
4504
+ callback: () => {
4505
+ selection.transformStart(0, instance.getDirectionFactor());
4506
+ }
4507
+ }, {
4508
+ keys: [['ArrowRight', 'Control/Meta']],
4509
+ captureCtrl: true,
4510
+ callback: () => {
4511
+ const row = instance.getSelectedRangeLast().highlight.row;
4512
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
4513
+ selection.setRangeStart(instance._createCellCoords(row, column));
4514
+ }
4515
+ }, {
4516
+ keys: [['ArrowRight', 'Shift']],
4517
+ callback: () => {
4518
+ selection.transformEnd(0, instance.getDirectionFactor());
4519
+ }
4520
+ }, {
4521
+ keys: [['ArrowRight', 'Shift', 'Control/Meta']],
4522
+ captureCtrl: true,
4523
+ callback: () => {
4524
+ const {
4525
+ from,
4526
+ to
4527
+ } = instance.getSelectedRangeLast();
4528
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
4529
+ selection.setRangeStart(from.clone());
4530
+ selection.setRangeEnd(instance._createCellCoords(to.row, column));
4531
+ },
4532
+ runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader())
4533
+ }, {
4534
+ keys: [['Home']],
4535
+ captureCtrl: true,
4536
+ callback: () => {
4537
+ const fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
4538
+ const row = instance.getSelectedRangeLast().highlight.row;
4539
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
4540
+ selection.setRangeStart(instance._createCellCoords(row, column));
4541
+ },
4542
+ runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
4543
+ }, {
4544
+ keys: [['Home', 'Shift']],
4545
+ callback: () => {
4546
+ selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
4547
+ }
4548
+ }, {
4549
+ keys: [['Home', 'Control/Meta']],
4550
+ captureCtrl: true,
4551
+ callback: () => {
4552
+ const fixedRows = parseInt(instance.getSettings().fixedRowsTop, 10);
4553
+ const fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
4554
+ const row = instance.rowIndexMapper.getNearestNotHiddenIndex(fixedRows, 1);
4555
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
4556
+ selection.setRangeStart(instance._createCellCoords(row, column));
4557
+ },
4558
+ runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
4559
+ }, {
4560
+ keys: [['End']],
4561
+ captureCtrl: true,
4562
+ callback: () => {
4563
+ selection.setRangeStart(instance._createCellCoords(instance.getSelectedRangeLast().highlight.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
4564
+ },
4565
+ runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
4566
+ }, {
4567
+ keys: [['End', 'Shift']],
4568
+ callback: () => {
4569
+ selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
4570
+ }
4571
+ }, {
4572
+ keys: [['End', 'Control/Meta']],
4573
+ captureCtrl: true,
4574
+ callback: () => {
4575
+ const fixedRows = parseInt(instance.getSettings().fixedRowsBottom, 10);
4576
+ const row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - fixedRows - 1, -1);
4577
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1);
4578
+ selection.setRangeStart(instance._createCellCoords(row, column));
4579
+ },
4580
+ runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
4581
+ }, {
4582
+ keys: [['PageUp']],
4583
+ callback: () => {
4584
+ selection.transformStart(-instance.countVisibleRows(), 0);
4585
+ }
4586
+ }, {
4587
+ keys: [['PageUp', 'Shift']],
4588
+ callback: () => {
4589
+ const {
4590
+ to
4591
+ } = instance.getSelectedRangeLast();
4592
+ const nextRowIndexToSelect = Math.max(to.row - instance.countVisibleRows(), 0);
4593
+ const row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, 1);
4594
+ if (row !== null) {
4595
+ const coords = instance._createCellCoords(row, to.col);
4596
+ const scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
4597
+ const nextVerticalScroll = Math.max(coords.row - scrollPadding, 0);
4598
+ selection.setRangeEnd(coords);
4599
+ instance.scrollViewportTo(nextVerticalScroll);
4600
+ }
4601
+ }
4602
+ }, {
4603
+ keys: [['PageDown']],
4604
+ callback: () => {
4605
+ selection.transformStart(instance.countVisibleRows(), 0);
4606
+ }
4607
+ }, {
4608
+ keys: [['PageDown', 'Shift']],
4609
+ callback: () => {
4610
+ const {
4611
+ to
4612
+ } = instance.getSelectedRangeLast();
4613
+ const nextRowIndexToSelect = Math.min(to.row + instance.countVisibleRows(), instance.countRows() - 1);
4614
+ const row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, -1);
4615
+ if (row !== null) {
4616
+ const coords = instance._createCellCoords(row, to.col);
4617
+ const scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
4618
+ const nextVerticalScroll = Math.min(coords.row - scrollPadding, instance.countRows() - 1);
4619
+ selection.setRangeEnd(coords);
4620
+ instance.scrollViewportTo(nextVerticalScroll);
4621
+ }
4622
+ }
4623
+ }, {
4624
+ keys: [['Tab']],
4625
+ callback: event => {
4626
+ const tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
4627
+ selection.transformStart(tabMoves.row, tabMoves.col, true);
4628
+ }
4629
+ }, {
4630
+ keys: [['Shift', 'Tab']],
4631
+ callback: event => {
4632
+ const tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
4633
+ selection.transformStart(-tabMoves.row, -tabMoves.col);
4634
+ }
4635
+ }], gridConfig);
4517
4636
  (0, _registry.getPluginsNames)().forEach(pluginName => {
4518
4637
  const PluginClass = (0, _registry.getPlugin)(pluginName);
4519
4638
  pluginsRegistry.addItem(pluginName, new PluginClass(this));
4520
4639
  });
4521
- (0, _shortcutContexts.registerAllShortcutContexts)(instance);
4522
- shortcutManager.setActiveContextName('grid');
4523
4640
  _pluginHooks.default.getSingleton().run(instance, 'construct');
4524
4641
  }