handsontable 0.0.0-next-9379dd1-20231020 → 0.0.0-next-9059914-20231025

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 (414) 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 +10 -12
  16. package/3rdparty/walkontable/src/event.mjs +10 -12
  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 +2 -13
  22. package/3rdparty/walkontable/src/overlay/_base.mjs +3 -14
  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/renderer/cells.js +0 -10
  28. package/3rdparty/walkontable/src/renderer/cells.mjs +1 -11
  29. package/3rdparty/walkontable/src/renderer/columnHeaders.js +0 -10
  30. package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +1 -11
  31. package/3rdparty/walkontable/src/renderer/rowHeaders.js +0 -5
  32. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +0 -5
  33. package/3rdparty/walkontable/src/renderer/rows.js +0 -13
  34. package/3rdparty/walkontable/src/renderer/rows.mjs +0 -13
  35. package/3rdparty/walkontable/src/renderer/table.js +0 -9
  36. package/3rdparty/walkontable/src/renderer/table.mjs +0 -9
  37. package/3rdparty/walkontable/src/scroll.js +0 -2
  38. package/3rdparty/walkontable/src/scroll.mjs +0 -2
  39. package/3rdparty/walkontable/src/selection.js +295 -0
  40. package/3rdparty/walkontable/src/selection.mjs +290 -0
  41. package/3rdparty/walkontable/src/settings.js +4 -13
  42. package/3rdparty/walkontable/src/settings.mjs +4 -13
  43. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +0 -9
  44. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +0 -9
  45. package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +0 -9
  46. package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +0 -9
  47. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +0 -9
  48. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +0 -9
  49. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +0 -9
  50. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +0 -9
  51. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +0 -9
  52. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +0 -9
  53. package/3rdparty/walkontable/src/table.js +78 -19
  54. package/3rdparty/walkontable/src/table.mjs +79 -20
  55. package/base.js +2 -2
  56. package/base.mjs +2 -2
  57. package/cellTypes/dateType/dateType.d.ts +3 -3
  58. package/cellTypes/dateType/dateType.js +2 -2
  59. package/cellTypes/dateType/dateType.mjs +2 -2
  60. package/cellTypes/handsontableType/handsontableType.d.ts +3 -3
  61. package/cellTypes/handsontableType/handsontableType.js +2 -2
  62. package/cellTypes/handsontableType/handsontableType.mjs +2 -2
  63. package/cellTypes/index.d.ts +0 -3
  64. package/cellTypes/index.js +0 -4
  65. package/cellTypes/index.mjs +1 -3
  66. package/core.d.ts +4 -9
  67. package/core.js +327 -285
  68. package/core.mjs +327 -285
  69. package/dataMap/metaManager/metaSchema.js +0 -65
  70. package/dataMap/metaManager/metaSchema.mjs +0 -65
  71. package/dataMap/metaManager/mods/extendMetaProperties.js +1 -7
  72. package/dataMap/metaManager/mods/extendMetaProperties.mjs +1 -7
  73. package/dataMap/replaceData.js +0 -5
  74. package/dataMap/replaceData.mjs +0 -5
  75. package/dist/handsontable.css +5 -40
  76. package/dist/handsontable.full.css +5 -40
  77. package/dist/handsontable.full.js +8038 -12837
  78. package/dist/handsontable.full.min.css +4 -4
  79. package/dist/handsontable.full.min.js +141 -141
  80. package/dist/handsontable.js +11488 -16287
  81. package/dist/handsontable.min.css +3 -3
  82. package/dist/handsontable.min.js +21 -21
  83. package/dist/languages/all.js +2 -6
  84. package/dist/languages/all.min.js +1 -1
  85. package/dist/languages/en-US.js +1 -3
  86. package/dist/languages/en-US.min.js +1 -1
  87. package/dist/languages/pl-PL.js +1 -3
  88. package/dist/languages/pl-PL.min.js +1 -1
  89. package/editorManager.js +87 -15
  90. package/editorManager.mjs +87 -16
  91. package/editors/autocompleteEditor/autocompleteEditor.js +2 -53
  92. package/editors/autocompleteEditor/autocompleteEditor.mjs +3 -54
  93. package/editors/dateEditor/dateEditor.js +7 -26
  94. package/editors/dateEditor/dateEditor.mjs +8 -27
  95. package/editors/handsontableEditor/handsontableEditor.js +1 -9
  96. package/editors/handsontableEditor/handsontableEditor.mjs +2 -10
  97. package/editors/textEditor/textEditor.js +27 -19
  98. package/editors/textEditor/textEditor.mjs +30 -22
  99. package/helpers/dom/element.js +9 -188
  100. package/helpers/dom/element.mjs +9 -182
  101. package/helpers/mixed.js +1 -1
  102. package/helpers/mixed.mjs +1 -1
  103. package/helpers/number.d.ts +0 -1
  104. package/helpers/number.js +0 -18
  105. package/helpers/number.mjs +0 -17
  106. package/i18n/constants.js +1 -7
  107. package/i18n/constants.mjs +1 -4
  108. package/i18n/languages/en-US.js +1 -3
  109. package/i18n/languages/en-US.mjs +1 -3
  110. package/i18n/languages/pl-PL.js +1 -3
  111. package/i18n/languages/pl-PL.mjs +1 -3
  112. package/languages/all.js +2 -6
  113. package/languages/en-US.js +1 -3
  114. package/languages/en-US.mjs +1 -3
  115. package/languages/index.js +2 -6
  116. package/languages/pl-PL.js +1 -3
  117. package/languages/pl-PL.mjs +1 -3
  118. package/package.json +99 -116
  119. package/pluginHooks.d.ts +1 -12
  120. package/pluginHooks.js +1 -152
  121. package/pluginHooks.mjs +1 -152
  122. package/plugins/collapsibleColumns/collapsibleColumns.js +4 -74
  123. package/plugins/collapsibleColumns/collapsibleColumns.mjs +5 -75
  124. package/plugins/columnSorting/columnSorting.js +0 -43
  125. package/plugins/columnSorting/columnSorting.mjs +3 -44
  126. package/plugins/columnSorting/index.js +1 -3
  127. package/plugins/columnSorting/index.mjs +1 -1
  128. package/plugins/comments/commentEditor.js +0 -1
  129. package/plugins/comments/commentEditor.mjs +0 -1
  130. package/plugins/comments/comments.js +189 -252
  131. package/plugins/comments/comments.mjs +190 -251
  132. package/plugins/contextMenu/commandExecutor.js +3 -2
  133. package/plugins/contextMenu/commandExecutor.mjs +3 -2
  134. package/plugins/contextMenu/contextMenu.d.ts +1 -1
  135. package/plugins/contextMenu/contextMenu.js +36 -75
  136. package/plugins/contextMenu/contextMenu.mjs +35 -74
  137. package/plugins/contextMenu/{menu/cursor.mjs → cursor.js} +10 -4
  138. package/plugins/contextMenu/{menu/cursor.js → cursor.mjs} +4 -6
  139. package/plugins/contextMenu/itemsFactory.js +3 -2
  140. package/plugins/contextMenu/itemsFactory.mjs +4 -3
  141. package/plugins/contextMenu/{menu/menu.js → menu.js} +308 -96
  142. package/plugins/contextMenu/{menu/menu.mjs → menu.mjs} +309 -97
  143. package/plugins/contextMenu/predefinedItems/alignment.js +0 -7
  144. package/plugins/contextMenu/predefinedItems/alignment.mjs +0 -7
  145. package/plugins/contextMenu/predefinedItems/clearColumn.js +3 -5
  146. package/plugins/contextMenu/predefinedItems/clearColumn.mjs +3 -5
  147. package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -5
  148. package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -5
  149. package/plugins/contextMenu/predefinedItems/columnRight.js +3 -5
  150. package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -5
  151. package/plugins/contextMenu/predefinedItems/readOnly.js +0 -7
  152. package/plugins/contextMenu/predefinedItems/readOnly.mjs +0 -7
  153. package/plugins/contextMenu/predefinedItems/removeColumn.js +5 -7
  154. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +3 -5
  155. package/plugins/contextMenu/predefinedItems/removeRow.js +5 -7
  156. package/plugins/contextMenu/predefinedItems/removeRow.mjs +3 -5
  157. package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -5
  158. package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -5
  159. package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -5
  160. package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -5
  161. package/plugins/contextMenu/{predefinedItems/index.js → predefinedItems.js} +14 -14
  162. package/plugins/contextMenu/predefinedItems.mjs +68 -0
  163. package/plugins/contextMenu/utils.js +151 -35
  164. package/plugins/contextMenu/utils.mjs +144 -35
  165. package/plugins/copyPaste/contextMenuItem/copy.js +0 -7
  166. package/plugins/copyPaste/contextMenuItem/copy.mjs +0 -7
  167. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +1 -9
  168. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +1 -9
  169. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +1 -9
  170. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +1 -9
  171. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +1 -9
  172. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +1 -9
  173. package/plugins/copyPaste/contextMenuItem/cut.js +0 -7
  174. package/plugins/copyPaste/contextMenuItem/cut.mjs +0 -7
  175. package/plugins/copyPaste/copyPaste.js +78 -127
  176. package/plugins/copyPaste/copyPaste.mjs +79 -128
  177. package/plugins/copyPaste/focusableElement.js +186 -0
  178. package/plugins/copyPaste/focusableElement.mjs +180 -0
  179. package/plugins/customBorders/customBorders.js +20 -23
  180. package/plugins/customBorders/customBorders.mjs +21 -24
  181. package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
  182. package/plugins/dropdownMenu/dropdownMenu.js +38 -97
  183. package/plugins/dropdownMenu/dropdownMenu.mjs +37 -96
  184. package/plugins/filters/constants.mjs +1 -1
  185. package/plugins/filters/filters.js +14 -31
  186. package/plugins/filters/filters.mjs +14 -31
  187. package/plugins/filters/ui/select.js +3 -3
  188. package/plugins/filters/ui/select.mjs +2 -2
  189. package/plugins/hiddenColumns/hiddenColumns.mjs +1 -1
  190. package/plugins/hiddenRows/hiddenRows.mjs +1 -1
  191. package/plugins/manualColumnMove/manualColumnMove.js +1 -3
  192. package/plugins/manualColumnMove/manualColumnMove.mjs +1 -3
  193. package/plugins/mergeCells/mergeCells.js +16 -5
  194. package/plugins/mergeCells/mergeCells.mjs +16 -5
  195. package/plugins/multiColumnSorting/multiColumnSorting.js +2 -37
  196. package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -37
  197. package/plugins/nestedHeaders/nestedHeaders.js +10 -240
  198. package/plugins/nestedHeaders/nestedHeaders.mjs +11 -241
  199. package/plugins/nestedHeaders/stateManager/index.js +3 -102
  200. package/plugins/nestedHeaders/stateManager/index.mjs +3 -102
  201. package/plugins/nestedRows/nestedRows.js +0 -41
  202. package/plugins/nestedRows/nestedRows.mjs +0 -41
  203. package/plugins/nestedRows/ui/headers.js +0 -11
  204. package/plugins/nestedRows/ui/headers.mjs +1 -12
  205. package/renderers/autocompleteRenderer/autocompleteRenderer.js +0 -8
  206. package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +0 -8
  207. package/renderers/baseRenderer/baseRenderer.js +0 -17
  208. package/renderers/baseRenderer/baseRenderer.mjs +1 -18
  209. package/renderers/checkboxRenderer/checkboxRenderer.js +4 -9
  210. package/renderers/checkboxRenderer/checkboxRenderer.mjs +4 -9
  211. package/renderers/index.d.ts +0 -9
  212. package/selection/highlight/constants.js +15 -0
  213. package/selection/highlight/constants.mjs +6 -0
  214. package/selection/highlight/highlight.js +71 -256
  215. package/selection/highlight/highlight.mjs +71 -250
  216. package/selection/highlight/types/activeHeader.js +8 -10
  217. package/selection/highlight/types/activeHeader.mjs +8 -10
  218. package/selection/highlight/types/area.js +18 -6
  219. package/selection/highlight/types/area.mjs +18 -6
  220. package/selection/highlight/types/{focus.js → cell.js} +7 -5
  221. package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
  222. package/selection/highlight/types/customSelection.js +9 -7
  223. package/selection/highlight/types/customSelection.mjs +9 -7
  224. package/selection/highlight/types/fill.js +7 -5
  225. package/selection/highlight/types/fill.mjs +7 -5
  226. package/selection/highlight/types/header.js +18 -9
  227. package/selection/highlight/types/header.mjs +18 -9
  228. package/selection/highlight/types/index.js +35 -0
  229. package/selection/highlight/types/index.mjs +31 -0
  230. package/selection/highlight/visualSelection.js +27 -31
  231. package/selection/highlight/visualSelection.mjs +27 -31
  232. package/selection/index.js +7 -4
  233. package/selection/index.mjs +3 -2
  234. package/selection/mouseEventHandler.js +1 -7
  235. package/selection/mouseEventHandler.mjs +1 -7
  236. package/selection/range.js +8 -8
  237. package/selection/range.mjs +8 -8
  238. package/selection/selection.js +152 -321
  239. package/selection/selection.mjs +151 -318
  240. package/selection/transformation.js +90 -232
  241. package/selection/transformation.mjs +90 -232
  242. package/selection/utils.js +21 -15
  243. package/selection/utils.mjs +21 -16
  244. package/settings.d.ts +0 -4
  245. package/shortcuts/context.js +2 -20
  246. package/shortcuts/context.mjs +3 -20
  247. package/shortcuts/manager.js +7 -25
  248. package/shortcuts/manager.mjs +7 -26
  249. package/shortcuts/recorder.js +3 -3
  250. package/shortcuts/recorder.mjs +3 -3
  251. package/shortcuts/utils.js +5 -19
  252. package/shortcuts/utils.mjs +4 -18
  253. package/tableView.js +13 -111
  254. package/tableView.mjs +14 -112
  255. package/3rdparty/walkontable/src/selection/border/constants.js +0 -16
  256. package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -12
  257. package/3rdparty/walkontable/src/selection/constants.js +0 -62
  258. package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
  259. package/3rdparty/walkontable/src/selection/index.js +0 -26
  260. package/3rdparty/walkontable/src/selection/index.mjs +0 -5
  261. package/3rdparty/walkontable/src/selection/manager.js +0 -274
  262. package/3rdparty/walkontable/src/selection/manager.mjs +0 -269
  263. package/3rdparty/walkontable/src/selection/scanner.js +0 -270
  264. package/3rdparty/walkontable/src/selection/scanner.mjs +0 -267
  265. package/3rdparty/walkontable/src/selection/selection.js +0 -101
  266. package/3rdparty/walkontable/src/selection/selection.mjs +0 -96
  267. package/cellTypes/selectType/index.d.ts +0 -1
  268. package/cellTypes/selectType/index.js +0 -6
  269. package/cellTypes/selectType/index.mjs +0 -1
  270. package/cellTypes/selectType/selectType.d.ts +0 -14
  271. package/cellTypes/selectType/selectType.js +0 -13
  272. package/cellTypes/selectType/selectType.mjs +0 -8
  273. package/core/focusCatcher/focusDetector.js +0 -63
  274. package/core/focusCatcher/focusDetector.mjs +0 -59
  275. package/core/focusCatcher/index.js +0 -142
  276. package/core/focusCatcher/index.mjs +0 -138
  277. package/core/index.js +0 -9
  278. package/core/index.mjs +0 -1
  279. package/focusManager.d.ts +0 -12
  280. package/focusManager.js +0 -265
  281. package/focusManager.mjs +0 -261
  282. package/helpers/a11y.js +0 -79
  283. package/helpers/a11y.mjs +0 -38
  284. package/plugins/comments/contextMenuItem/addEditComment.js +0 -41
  285. package/plugins/comments/contextMenuItem/addEditComment.mjs +0 -35
  286. package/plugins/comments/contextMenuItem/readOnlyComment.js +0 -49
  287. package/plugins/comments/contextMenuItem/readOnlyComment.mjs +0 -43
  288. package/plugins/comments/contextMenuItem/removeComment.js +0 -38
  289. package/plugins/comments/contextMenuItem/removeComment.mjs +0 -32
  290. package/plugins/contextMenu/menu/index.js +0 -9
  291. package/plugins/contextMenu/menu/index.mjs +0 -1
  292. package/plugins/contextMenu/menu/navigator.js +0 -152
  293. package/plugins/contextMenu/menu/navigator.mjs +0 -148
  294. package/plugins/contextMenu/menu/positioner.js +0 -213
  295. package/plugins/contextMenu/menu/positioner.mjs +0 -209
  296. package/plugins/contextMenu/menu/utils.js +0 -177
  297. package/plugins/contextMenu/menu/utils.mjs +0 -163
  298. package/plugins/contextMenu/predefinedItems/index.mjs +0 -68
  299. package/renderers/dateRenderer/dateRenderer.d.ts +0 -5
  300. package/renderers/dateRenderer/dateRenderer.js +0 -29
  301. package/renderers/dateRenderer/dateRenderer.mjs +0 -24
  302. package/renderers/dateRenderer/index.d.ts +0 -1
  303. package/renderers/dateRenderer/index.js +0 -6
  304. package/renderers/dateRenderer/index.mjs +0 -1
  305. package/renderers/handsontableRenderer/handsontableRenderer.d.ts +0 -5
  306. package/renderers/handsontableRenderer/handsontableRenderer.js +0 -29
  307. package/renderers/handsontableRenderer/handsontableRenderer.mjs +0 -24
  308. package/renderers/handsontableRenderer/index.d.ts +0 -1
  309. package/renderers/handsontableRenderer/index.js +0 -6
  310. package/renderers/handsontableRenderer/index.mjs +0 -1
  311. package/renderers/selectRenderer/index.d.ts +0 -1
  312. package/renderers/selectRenderer/index.js +0 -6
  313. package/renderers/selectRenderer/index.mjs +0 -1
  314. package/renderers/selectRenderer/selectRenderer.d.ts +0 -5
  315. package/renderers/selectRenderer/selectRenderer.js +0 -27
  316. package/renderers/selectRenderer/selectRenderer.mjs +0 -22
  317. package/selection/highlight/types/areaLayered.js +0 -31
  318. package/selection/highlight/types/areaLayered.mjs +0 -26
  319. package/selection/highlight/types/column.js +0 -27
  320. package/selection/highlight/types/column.mjs +0 -22
  321. package/selection/highlight/types/row.js +0 -27
  322. package/selection/highlight/types/row.mjs +0 -22
  323. package/shortcutContexts/commands/editor/closeAndSave.js +0 -12
  324. package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -8
  325. package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -12
  326. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
  327. package/shortcutContexts/commands/editor/fastOpen.js +0 -16
  328. package/shortcutContexts/commands/editor/fastOpen.mjs +0 -12
  329. package/shortcutContexts/commands/editor/index.js +0 -16
  330. package/shortcutContexts/commands/editor/index.mjs +0 -12
  331. package/shortcutContexts/commands/editor/open.js +0 -27
  332. package/shortcutContexts/commands/editor/open.mjs +0 -23
  333. package/shortcutContexts/commands/emptySelectedCells.js +0 -11
  334. package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
  335. package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
  336. package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -11
  337. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -25
  338. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -21
  339. package/shortcutContexts/commands/extendCellsSelection/index.js +0 -26
  340. package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -22
  341. package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
  342. package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -11
  343. package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
  344. package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -11
  345. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +0 -19
  346. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +0 -15
  347. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -29
  348. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -25
  349. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -19
  350. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -15
  351. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -19
  352. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -15
  353. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -29
  354. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -25
  355. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -29
  356. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -25
  357. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -29
  358. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -25
  359. package/shortcutContexts/commands/extendCellsSelection/toRows.js +0 -19
  360. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +0 -15
  361. package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
  362. package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -11
  363. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -25
  364. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -21
  365. package/shortcutContexts/commands/index.js +0 -35
  366. package/shortcutContexts/commands/index.mjs +0 -31
  367. package/shortcutContexts/commands/moveCellSelection/down.js +0 -13
  368. package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -9
  369. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -33
  370. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -29
  371. package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
  372. package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
  373. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -12
  374. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
  375. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -12
  376. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
  377. package/shortcutContexts/commands/moveCellSelection/left.js +0 -10
  378. package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
  379. package/shortcutContexts/commands/moveCellSelection/right.js +0 -10
  380. package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
  381. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -17
  382. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -13
  383. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -18
  384. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -14
  385. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -14
  386. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -10
  387. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -17
  388. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -13
  389. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -19
  390. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -15
  391. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -21
  392. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -17
  393. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -17
  394. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -13
  395. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -19
  396. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -15
  397. package/shortcutContexts/commands/moveCellSelection/up.js +0 -13
  398. package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -9
  399. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -33
  400. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -29
  401. package/shortcutContexts/commands/populateSelectedCellsData.js +0 -29
  402. package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -25
  403. package/shortcutContexts/commands/scrollToFocusedCell.js +0 -35
  404. package/shortcutContexts/commands/scrollToFocusedCell.mjs +0 -31
  405. package/shortcutContexts/commands/selectAll.js +0 -12
  406. package/shortcutContexts/commands/selectAll.mjs +0 -8
  407. package/shortcutContexts/constants.js +0 -13
  408. package/shortcutContexts/constants.mjs +0 -8
  409. package/shortcutContexts/editor.js +0 -25
  410. package/shortcutContexts/editor.mjs +0 -21
  411. package/shortcutContexts/grid.js +0 -163
  412. package/shortcutContexts/grid.mjs +0 -159
  413. package/shortcutContexts/index.js +0 -24
  414. package/shortcutContexts/index.mjs +0 -11
package/core.js CHANGED
@@ -12,7 +12,6 @@ var _browser = require("./helpers/browser");
12
12
  var _editorManager = _interopRequireDefault(require("./editorManager"));
13
13
  var _eventManager = _interopRequireDefault(require("./eventManager"));
14
14
  var _object = require("./helpers/object");
15
- var _focusManager = require("./focusManager");
16
15
  var _array = require("./helpers/array");
17
16
  var _parseTable = require("./utils/parseTable");
18
17
  var _registry = require("./plugins/registry");
@@ -32,22 +31,12 @@ var _registry5 = require("./i18n/registry");
32
31
  var _utils = require("./i18n/utils");
33
32
  var _selection = require("./selection");
34
33
  var _dataMap = require("./dataMap");
35
- var _index3 = require("./core/index");
36
34
  var _uniqueMap = require("./utils/dataStructures/uniqueMap");
37
35
  var _shortcuts = require("./shortcuts");
38
- var _shortcutContexts = require("./shortcutContexts");
39
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
+ const SHORTCUTS_GROUP = 'gridDefault';
40
38
  let activeGuid = null;
41
39
 
42
- /**
43
- * Keeps the collection of the all Handsontable instances created on the same page. The
44
- * list is then used to trigger the "afterUnlisten" hook when the "listen()" method was
45
- * called on another instance.
46
- *
47
- * @type {Map<string, Core>}
48
- */
49
- const foreignHotInstances = new Map();
50
-
51
40
  /**
52
41
  * A set of deprecated feature names.
53
42
  *
@@ -107,8 +96,7 @@ const deprecationWarns = new Set();
107
96
  * @param {boolean} [rootInstanceSymbol=false] Indicates if the instance is root of all later instances created.
108
97
  */
109
98
  function Core(rootElement, userSettings) {
110
- var _userSettings$layoutD,
111
- _this = this;
99
+ var _userSettings$layoutD;
112
100
  let rootInstanceSymbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
113
101
  let preventScrollingToCell = false;
114
102
  let instance = this;
@@ -117,7 +105,6 @@ function Core(rootElement, userSettings) {
117
105
  let dataSource;
118
106
  let grid;
119
107
  let editorManager;
120
- let focusManager;
121
108
  let firstRun = true;
122
109
  if ((0, _rootInstance.hasValidParameter)(rootInstanceSymbol)) {
123
110
  (0, _rootInstance.registerAsRootInstance)(this);
@@ -226,8 +213,6 @@ function Core(rootElement, userSettings) {
226
213
  }
227
214
  this.guid = `ht_${(0, _string.randomString)()}`; // this is the namespace for global events
228
215
 
229
- foreignHotInstances.set(this.guid, this);
230
-
231
216
  /**
232
217
  * Instance of index mapper which is responsible for managing the column indexes.
233
218
  *
@@ -276,16 +261,14 @@ function Core(rootElement, userSettings) {
276
261
  };
277
262
 
278
263
  let selection = new _selection.Selection(tableMeta, {
279
- rowIndexMapper: instance.rowIndexMapper,
280
- columnIndexMapper: instance.columnIndexMapper,
264
+ rowIndexMapper: () => instance.rowIndexMapper,
265
+ columnIndexMapper: () => instance.columnIndexMapper,
281
266
  countCols: () => instance.countCols(),
282
267
  countRows: () => instance.countRows(),
283
268
  propToCol: prop => datamap.propToCol(prop),
284
269
  isEditorOpened: () => instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false,
285
- countRenderableColumns: () => this.view.countRenderableColumns(),
286
- countRenderableRows: () => this.view.countRenderableRows(),
287
- countRowHeaders: () => this.countRowHeaders(),
288
- countColHeaders: () => this.countColHeaders(),
270
+ countColsTranslated: () => this.view.countRenderableColumns(),
271
+ countRowsTranslated: () => this.view.countRenderableRows(),
289
272
  getShortcutManager: () => instance.getShortcutManager(),
290
273
  createCellCoords: (row, column) => instance._createCellCoords(row, column),
291
274
  createCellRange: (highlight, from, to) => instance._createCellRange(highlight, from, to),
@@ -304,9 +287,6 @@ function Core(rootElement, userSettings) {
304
287
  };
305
288
  this.columnIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
306
289
  this.rowIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
307
- this.selection.addLocalHook('beforeHighlightSet', () => {
308
- this.runHooks('beforeSelectionHighlightSet');
309
- });
310
290
  this.selection.addLocalHook('beforeSetRangeStart', cellCoords => {
311
291
  this.runHooks('beforeSetRangeStart', cellCoords);
312
292
  });
@@ -315,6 +295,12 @@ function Core(rootElement, userSettings) {
315
295
  });
316
296
  this.selection.addLocalHook('beforeSetRangeEnd', cellCoords => {
317
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
+ }
318
304
  });
319
305
  this.selection.addLocalHook('afterSetRangeEnd', cellCoords => {
320
306
  const preventScrolling = (0, _object.createObjectPropListener)(false);
@@ -327,6 +313,8 @@ function Core(rootElement, userSettings) {
327
313
  this.runHooks('afterSelection', from.row, from.col, to.row, to.col, preventScrolling, selectionLayerLevel);
328
314
  this.runHooks('afterSelectionByProp', from.row, instance.colToProp(from.col), to.row, instance.colToProp(to.col), preventScrolling, selectionLayerLevel); // eslint-disable-line max-len
329
315
 
316
+ const isSelectedByAnyHeader = this.selection.isSelectedByAnyHeader();
317
+ const currentSelectedRange = this.selection.selectedRange.current();
330
318
  let scrollToCell = true;
331
319
  if (preventScrollingToCell) {
332
320
  scrollToCell = false;
@@ -334,42 +322,19 @@ function Core(rootElement, userSettings) {
334
322
  if (preventScrolling.isTouched()) {
335
323
  scrollToCell = !preventScrolling.value;
336
324
  }
337
- const currentSelectedRange = this.selection.selectedRange.current();
338
- const isSelectedByAnyHeader = this.selection.isSelectedByAnyHeader();
339
325
  const isSelectedByRowHeader = this.selection.isSelectedByRowHeader();
340
326
  const isSelectedByColumnHeader = this.selection.isSelectedByColumnHeader();
341
327
  if (scrollToCell !== false) {
342
328
  if (!isSelectedByAnyHeader) {
343
329
  if (currentSelectedRange && !this.selection.isMultiple()) {
344
- const {
345
- row,
346
- col
347
- } = currentSelectedRange.from;
348
- if (row < 0 && col >= 0) {
349
- this.scrollViewportTo({
350
- col
351
- });
352
- } else if (col < 0 && row >= 0) {
353
- this.scrollViewportTo({
354
- row
355
- });
356
- } else {
357
- this.scrollViewportTo({
358
- row,
359
- col
360
- });
361
- }
330
+ this.view.scrollViewport(visualToRenderableCoords(currentSelectedRange.from));
362
331
  } else {
363
- this.scrollViewportTo(cellCoords.toObject());
332
+ this.view.scrollViewport(visualToRenderableCoords(cellCoords));
364
333
  }
365
334
  } else if (isSelectedByRowHeader) {
366
- this.scrollViewportTo({
367
- row: cellCoords.row
368
- });
335
+ this.view.scrollViewportVertically(instance.rowIndexMapper.getRenderableFromVisualIndex(cellCoords.row));
369
336
  } else if (isSelectedByColumnHeader) {
370
- this.scrollViewportTo({
371
- col: cellCoords.col
372
- });
337
+ this.view.scrollViewportHorizontally(instance.columnIndexMapper.getRenderableFromVisualIndex(cellCoords.col));
373
338
  }
374
339
  }
375
340
 
@@ -404,30 +369,6 @@ function Core(rootElement, userSettings) {
404
369
  isMultiple.value = changedIsMultiple;
405
370
  }
406
371
  });
407
- this.selection.addLocalHook('beforeSelectColumns', function () {
408
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
409
- args[_key] = arguments[_key];
410
- }
411
- return _this.runHooks('beforeSelectColumns', ...args);
412
- });
413
- this.selection.addLocalHook('afterSelectColumns', function () {
414
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
415
- args[_key2] = arguments[_key2];
416
- }
417
- return _this.runHooks('afterSelectColumns', ...args);
418
- });
419
- this.selection.addLocalHook('beforeSelectRows', function () {
420
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
421
- args[_key3] = arguments[_key3];
422
- }
423
- return _this.runHooks('beforeSelectRows', ...args);
424
- });
425
- this.selection.addLocalHook('afterSelectRows', function () {
426
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
427
- args[_key4] = arguments[_key4];
428
- }
429
- return _this.runHooks('afterSelectRows', ...args);
430
- });
431
372
  this.selection.addLocalHook('beforeModifyTransformStart', cellCoordsDelta => {
432
373
  this.runHooks('modifyTransformStart', cellCoordsDelta);
433
374
  });
@@ -533,9 +474,7 @@ function Core(rootElement, userSettings) {
533
474
  const currentFromRow = currentFromRange === null || currentFromRange === void 0 ? void 0 : currentFromRange.row;
534
475
  const startVisualRowIndex = instance.toVisualRow(startRowPhysicalIndex);
535
476
  if (selection.isSelectedByCorner()) {
536
- selection.selectAll(true, true, {
537
- disableHeadersHighlight: true
538
- });
477
+ instance.selectAll();
539
478
  } else if ((0, _mixed.isDefined)(currentFromRow) && currentFromRow >= startVisualRowIndex) {
540
479
  // Moving the selection (if it exists) downward – it should be applied to the "old" row.
541
480
  // TODO: The logic here should be handled by selection module.
@@ -589,9 +528,7 @@ function Core(rootElement, userSettings) {
589
528
  const currentFromColumn = currentFromRange === null || currentFromRange === void 0 ? void 0 : currentFromRange.col;
590
529
  const startVisualColumnIndex = instance.toVisualColumn(startColumnPhysicalIndex);
591
530
  if (selection.isSelectedByCorner()) {
592
- selection.selectAll(true, true, {
593
- disableHeadersHighlight: true
594
- });
531
+ instance.selectAll();
595
532
  } else if ((0, _mixed.isDefined)(currentFromColumn) && currentFromColumn >= startVisualColumnIndex) {
596
533
  // Moving the selection (if it exists) rightward – it should be applied to the "old" column.
597
534
  // TODO: The logic here should be handled by selection module.
@@ -1081,10 +1018,6 @@ function Core(rootElement, userSettings) {
1081
1018
  this.updateSettings(tableMeta, true);
1082
1019
  this.view = new _tableView.default(this);
1083
1020
  editorManager = _editorManager.default.getInstance(instance, tableMeta, selection);
1084
- focusManager = new _focusManager.FocusManager(instance);
1085
- if ((0, _rootInstance.isRootInstance)(this)) {
1086
- (0, _index3.installFocusCatcher)(instance);
1087
- }
1088
1021
  instance.runHooks('init');
1089
1022
  this.forceFullRender = true; // used when data was changed
1090
1023
  this.view.render();
@@ -1498,11 +1431,6 @@ function Core(rootElement, userSettings) {
1498
1431
  */
1499
1432
  this.listen = function () {
1500
1433
  if (instance && !instance.isListening()) {
1501
- foreignHotInstances.forEach(foreignHot => {
1502
- if (instance !== foreignHot) {
1503
- foreignHot.unlisten();
1504
- }
1505
- });
1506
1434
  activeGuid = instance.guid;
1507
1435
  instance.runHooks('afterListen');
1508
1436
  }
@@ -1587,8 +1515,8 @@ function Core(rootElement, userSettings) {
1587
1515
  * @returns {Array} Returns removed portion of columns.
1588
1516
  */
1589
1517
  this.spliceCol = function (column, index, amount) {
1590
- for (var _len5 = arguments.length, elements = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
1591
- 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];
1592
1520
  }
1593
1521
  return datamap.spliceCol(column, index, amount, ...elements);
1594
1522
  };
@@ -1605,8 +1533,8 @@ function Core(rootElement, userSettings) {
1605
1533
  * @returns {Array} Returns removed portion of rows.
1606
1534
  */
1607
1535
  this.spliceRow = function (row, index, amount) {
1608
- for (var _len6 = arguments.length, elements = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
1609
- 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];
1610
1538
  }
1611
1539
  return datamap.spliceRow(row, index, amount, ...elements);
1612
1540
  };
@@ -1703,9 +1631,6 @@ function Core(rootElement, userSettings) {
1703
1631
  }
1704
1632
  const changes = [];
1705
1633
  (0, _array.arrayEach)(selection.getSelectedRange(), cellRange => {
1706
- if (cellRange.isSingleHeader()) {
1707
- return;
1708
- }
1709
1634
  const topStart = cellRange.getTopStartCorner();
1710
1635
  const bottomEnd = cellRange.getBottomEndCorner();
1711
1636
  (0, _number.rangeEach)(topStart.row, bottomEnd.row, row => {
@@ -3003,8 +2928,8 @@ function Core(rootElement, userSettings) {
3003
2928
  */
3004
2929
  this.spliceCellsMeta = function (visualIndex) {
3005
2930
  let deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3006
- for (var _len7 = arguments.length, cellMetaRows = new Array(_len7 > 2 ? _len7 - 2 : 0), _key7 = 2; _key7 < _len7; _key7++) {
3007
- 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];
3008
2933
  }
3009
2934
  if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
3010
2935
  throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
@@ -3695,30 +3620,6 @@ function Core(rootElement, userSettings) {
3695
3620
  return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
3696
3621
  };
3697
3622
 
3698
- /**
3699
- * Returns the number of rendered row headers.
3700
- *
3701
- * @since 14.0.0
3702
- * @memberof Core#
3703
- * @function countRowHeaders
3704
- * @returns {number} Number of row headers.
3705
- */
3706
- this.countRowHeaders = function () {
3707
- return this.view.getRowHeadersCount();
3708
- };
3709
-
3710
- /**
3711
- * Returns the number of rendered column headers.
3712
- *
3713
- * @since 14.0.0
3714
- * @memberof Core#
3715
- * @function countColHeaders
3716
- * @returns {number} Number of column headers.
3717
- */
3718
- this.countColHeaders = function () {
3719
- return this.view.getColumnHeadersCount();
3720
- };
3721
-
3722
3623
  /**
3723
3624
  * Returns the number of empty rows. If the optional ending parameter is `true`, returns the
3724
3625
  * number of empty rows at the bottom of the table.
@@ -3923,10 +3824,6 @@ function Core(rootElement, userSettings) {
3923
3824
  * hot.selectColumns('id');
3924
3825
  * // Select range of columns using visual indexes.
3925
3826
  * hot.selectColumns(1, 4);
3926
- * // Select range of columns using visual indexes and mark the first header as highlighted.
3927
- * hot.selectColumns(1, 2, -1);
3928
- * // Select range of columns using visual indexes and mark the second cell as highlighted.
3929
- * hot.selectColumns(2, 1, 1);
3930
3827
  * // Select range of columns using column properties.
3931
3828
  * hot.selectColumns('id', 'last_name');
3932
3829
  * ```
@@ -3937,15 +3834,11 @@ function Core(rootElement, userSettings) {
3937
3834
  * @param {number} startColumn The visual column index from which the selection starts.
3938
3835
  * @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
3939
3836
  * is not defined the column defined by `startColumn` will be selected.
3940
- * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
3941
- * The value can take visual row index from -N to N, where negative values
3942
- * point to the headers and positive values point to the cell range.
3943
3837
  * @returns {boolean} `true` if selection was successful, `false` otherwise.
3944
3838
  */
3945
3839
  this.selectColumns = function (startColumn) {
3946
3840
  let endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
3947
- let focusPosition = arguments.length > 2 ? arguments[2] : undefined;
3948
- return selection.selectColumns(startColumn, endColumn, focusPosition);
3841
+ return selection.selectColumns(startColumn, endColumn);
3949
3842
  };
3950
3843
 
3951
3844
  /**
@@ -3955,12 +3848,8 @@ function Core(rootElement, userSettings) {
3955
3848
  * ```js
3956
3849
  * // Select row using visual index.
3957
3850
  * hot.selectRows(1);
3958
- * // select a range of rows, using visual indexes.
3851
+ * // Select range of rows using visual indexes.
3959
3852
  * hot.selectRows(1, 4);
3960
- * // select a range of rows, using visual indexes, and mark the header as highlighted.
3961
- * hot.selectRows(1, 2, -1);
3962
- * // Select range of rows using visual indexes and mark the second cell as highlighted.
3963
- * hot.selectRows(2, 1, 1);
3964
3853
  * ```
3965
3854
  *
3966
3855
  * @memberof Core#
@@ -3969,15 +3858,11 @@ function Core(rootElement, userSettings) {
3969
3858
  * @param {number} startRow The visual row index from which the selection starts.
3970
3859
  * @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
3971
3860
  * is not defined the row defined by `startRow` will be selected.
3972
- * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
3973
- * The value can take visual column index from -N to N, where negative values
3974
- * point to the headers and positive values point to the cell range.
3975
3861
  * @returns {boolean} `true` if selection was successful, `false` otherwise.
3976
3862
  */
3977
3863
  this.selectRows = function (startRow) {
3978
3864
  let endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
3979
- let focusPosition = arguments.length > 2 ? arguments[2] : undefined;
3980
- return selection.selectRows(startRow, endRow, focusPosition);
3865
+ return selection.selectRows(startRow, endRow);
3981
3866
  };
3982
3867
 
3983
3868
  /**
@@ -3996,16 +3881,9 @@ function Core(rootElement, userSettings) {
3996
3881
  * The previous selection is overwritten.
3997
3882
  *
3998
3883
  * ```js
3999
- * // select all cells in the table, including all headers and the corner cell
3884
+ * // select all cells in the table, including all headers
4000
3885
  * hot.selectAll();
4001
3886
  *
4002
- * // select all cells in the table, including row headers but excluding the corner cell
4003
- * hot.selectAll(true, false);
4004
- *
4005
- * // select all cells in the table, including all headers and the corner cell, but move the focus
4006
- * // highlight to position -2, -1
4007
- * hot.selectAll(-2, -1);
4008
- *
4009
3887
  * // select all cells in the table, without headers
4010
3888
  * hot.selectAll(false);
4011
3889
  * ```
@@ -4013,25 +3891,15 @@ function Core(rootElement, userSettings) {
4013
3891
  * @since 0.38.2
4014
3892
  * @memberof Core#
4015
3893
  * @function selectAll
4016
- * @param {boolean} [includeRowHeaders=false] `true` If the selection should include the row headers,
4017
- * `false` otherwise.
4018
- * @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
4019
- * headers, `false` otherwise.
4020
- *
4021
- * @param {object} [options] Additional object with options.
4022
- * @param {{row: number, col: number} | boolean} [options.focusPosition] The argument allows changing the cell/header
4023
- * focus position. The value takes an object with a `row` and `col` properties from -N to N, where
4024
- * negative values point to the headers and positive values point to the cell range. If `false`, the focus
4025
- * position won't be changed.
4026
- * @param {boolean} [options.disableHeadersHighlight] If `true`, disables highlighting the headers even when
4027
- * the logical coordinates points on them.
3894
+ * @param {boolean} [includeHeaders=true] `true`: include all row, column and corner headers.
3895
+ * `false`: don't include any headers.
4028
3896
  */
4029
3897
  this.selectAll = function () {
4030
- let includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4031
- let includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : includeRowHeaders;
4032
- let options = 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();
4033
3901
  preventScrollingToCell = true;
4034
- selection.selectAll(includeRowHeaders, includeColumnHeaders, options);
3902
+ selection.selectAll(includeRowHeaders, includeColumnHeaders);
4035
3903
  preventScrollingToCell = false;
4036
3904
  };
4037
3905
  const getIndexToScroll = (indexMapper, visualIndex) => {
@@ -4040,117 +3908,55 @@ function Core(rootElement, userSettings) {
4040
3908
  };
4041
3909
 
4042
3910
  /**
4043
- * Scroll viewport to coordinates specified by the `row` and/or `col` object properties.
4044
- *
4045
- * ```js
4046
- * // scroll the viewport to the visual row index (leave the horizontal scroll untouched)
4047
- * hot.scrollViewportTo({ row: 50 });
4048
- *
4049
- * // scroll the viewport to the passed coordinates so that the cell at 50, 50 will be snapped to
4050
- * // the bottom-end table's edge.
4051
- * hot.scrollViewportTo({
4052
- * row: 50,
4053
- * col: 50,
4054
- * verticalSnap: 'bottom',
4055
- * horizontalSnap: 'end',
4056
- * });
4057
- * ```
3911
+ * Scroll viewport to coordinates specified by the `row` and `column` arguments.
4058
3912
  *
4059
3913
  * @memberof Core#
4060
3914
  * @function scrollViewportTo
4061
- * @param {object} options A dictionary containing the following parameters:
4062
- * @param {number} [options.row] Specifies the number of visual rows along the Y axis to scroll the viewport.
4063
- * @param {number} [options.col] Specifies the number of visual columns along the X axis to scroll the viewport.
4064
- * @param {'top' | 'bottom'} [options.verticalSnap] Determines to which edge of the table the viewport will be scrolled based on the passed coordinates.
4065
- * This option is a string which must take one of the following values:
4066
- * - `top`: The viewport will be scrolled to a row in such a way that it will be positioned on the top of the viewport;
4067
- * - `bottom`: The viewport will be scrolled to a row in such a way that it will be positioned on the bottom of the viewport;
4068
- * - If the property is not defined the vertical auto-snapping is enabled. Depending on where the viewport is scrolled from, a row will
4069
- * be positioned at the top or bottom of the viewport.
4070
- * @param {'start' | 'end'} [options.horizontalSnap] Determines to which edge of the table the viewport will be scrolled based on the passed coordinates.
4071
- * This option is a string which must take one of the following values:
4072
- * - `start`: The viewport will be scrolled to a column in such a way that it will be positioned on the start (left edge or right, if the layout direction is set to `rtl`) of the viewport;
4073
- * - `end`: The viewport will be scrolled to a column in such a way that it will be positioned on the end (right edge or left, if the layout direction is set to `rtl`) of the viewport;
4074
- * - If the property is not defined the horizontal auto-snapping is enabled. Depending on where the viewport is scrolled from, a column will
4075
- * be positioned at the start or end of the viewport.
4076
- * @param {boolean} [options.considerHiddenIndexes=true] If `true`, we handle visual indexes, otherwise we handle only indexes which
3915
+ * @param {number} [row] Row index. If the last argument isn't defined we treat the index as a visual row index. Otherwise,
3916
+ * we are using the index for numbering only this rows which may be rendered (we don't consider hidden rows).
3917
+ * @param {number} [column] Column index. If the last argument isn't defined we treat the index as a visual column index.
3918
+ * Otherwise, we are using the index for numbering only this columns which may be rendered (we don't consider hidden columns).
3919
+ * @param {boolean} [snapToBottom=false] If `true`, the viewport is scrolled to show the cell at the bottom of the table.
3920
+ * However, if the cell's height is greater than the table's viewport height, the cell is snapped to the top edge.
3921
+ * @param {boolean} [snapToRight=false] If `true`, the viewport is scrolled to show the cell at the right side of the table.
3922
+ * However, if the cell is wider than the table's viewport width, the cell is snapped to the left edge (or to the right edge, if the layout direction is set to `rtl`).
3923
+ * @param {boolean} [considerHiddenIndexes=true] If `true`, we handle visual indexes, otherwise we handle only indexes which
4077
3924
  * may be rendered when they are in the viewport (we don't consider hidden indexes as they aren't rendered).
4078
- * @returns {boolean} `true` if viewport was scrolled, `false` otherwise.
4079
- */
4080
- this.scrollViewportTo = function () {
4081
- let {
4082
- row,
4083
- col,
4084
- verticalSnap,
4085
- horizontalSnap,
4086
- considerHiddenIndexes
4087
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4088
- let snapToTop;
4089
- let snapToBottom;
4090
- let snapToInlineStart;
4091
- let snapToInlineEnd;
4092
- if (verticalSnap !== undefined) {
4093
- snapToTop = verticalSnap === 'top';
4094
- snapToBottom = !snapToTop;
4095
- }
4096
- if (horizontalSnap !== undefined) {
4097
- snapToInlineStart = horizontalSnap === 'start';
4098
- snapToInlineEnd = !snapToInlineStart;
4099
- }
3925
+ * @returns {boolean} `true` if scroll was successful, `false` otherwise.
3926
+ */
3927
+ this.scrollViewportTo = function (row, column) {
3928
+ let snapToBottom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
3929
+ let snapToRight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
3930
+ let considerHiddenIndexes = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
3931
+ const snapToTop = !snapToBottom;
3932
+ const snapToLeft = !snapToRight;
4100
3933
  let renderableRow = row;
4101
- let renderableColumn = col;
4102
- if (considerHiddenIndexes === undefined || considerHiddenIndexes) {
4103
- const isValidRowGrid = Number.isInteger(row) && row >= 0;
4104
- const isValidColumnGrid = Number.isInteger(col) && col >= 0;
4105
- const visualRowToScroll = isValidRowGrid ? getIndexToScroll(this.rowIndexMapper, row) : undefined;
4106
- const visualColumnToScroll = isValidColumnGrid ? getIndexToScroll(this.columnIndexMapper, col) : undefined;
3934
+ let renderableColumn = column;
3935
+ if (considerHiddenIndexes) {
3936
+ const isRowInteger = Number.isInteger(row);
3937
+ const isColumnInteger = Number.isInteger(column);
3938
+ const visualRowToScroll = isRowInteger ? getIndexToScroll(this.rowIndexMapper, row) : void 0;
3939
+ const visualColumnToScroll = isColumnInteger ? getIndexToScroll(this.columnIndexMapper, column) : void 0;
4107
3940
  if (visualRowToScroll === null || visualColumnToScroll === null) {
4108
3941
  return false;
4109
3942
  }
4110
- renderableRow = isValidRowGrid ? instance.rowIndexMapper.getRenderableFromVisualIndex(visualRowToScroll) : row;
4111
- renderableColumn = isValidColumnGrid ? instance.columnIndexMapper.getRenderableFromVisualIndex(visualColumnToScroll) : col;
3943
+ renderableRow = isRowInteger ? instance.rowIndexMapper.getRenderableFromVisualIndex(visualRowToScroll) : void 0;
3944
+ renderableColumn = isColumnInteger ? instance.columnIndexMapper.getRenderableFromVisualIndex(visualColumnToScroll) : void 0;
4112
3945
  }
4113
3946
  const isRowInteger = Number.isInteger(renderableRow);
4114
3947
  const isColumnInteger = Number.isInteger(renderableColumn);
4115
- if (isRowInteger && renderableRow >= 0 && isColumnInteger && renderableColumn >= 0) {
4116
- return instance.view.scrollViewport(instance._createCellCoords(renderableRow, renderableColumn), snapToTop, snapToInlineEnd, snapToBottom, snapToInlineStart);
3948
+ if (isRowInteger && isColumnInteger) {
3949
+ return instance.view.scrollViewport(instance._createCellCoords(renderableRow, renderableColumn), snapToTop, snapToRight, snapToBottom, snapToLeft);
4117
3950
  }
4118
- if (isRowInteger && renderableRow >= 0 && (isColumnInteger && renderableColumn < 0 || !isColumnInteger)) {
3951
+ if (isRowInteger && isColumnInteger === false) {
4119
3952
  return instance.view.scrollViewportVertically(renderableRow, snapToTop, snapToBottom);
4120
3953
  }
4121
- if (isColumnInteger && renderableColumn >= 0 && (isRowInteger && renderableRow < 0 || !isRowInteger)) {
4122
- return instance.view.scrollViewportHorizontally(renderableColumn, snapToInlineEnd, snapToInlineStart);
3954
+ if (isColumnInteger && isRowInteger === false) {
3955
+ return instance.view.scrollViewportHorizontally(renderableColumn, snapToRight, snapToLeft);
4123
3956
  }
4124
3957
  return false;
4125
3958
  };
4126
3959
 
4127
- /**
4128
- * Scrolls the viewport to coordinates specified by the currently focused cell.
4129
- *
4130
- * @since 14.0.0
4131
- * @memberof Core#
4132
- * @fires Hooks#afterScroll
4133
- * @function scrollToFocusedCell
4134
- * @param {Function} callback The callback function to call after the viewport is scrolled.
4135
- */
4136
- this.scrollToFocusedCell = function () {
4137
- let callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : () => {};
4138
- if (!this.selection.isSelected()) {
4139
- return;
4140
- }
4141
- this.addHookOnce('afterScroll', callback);
4142
- const {
4143
- highlight
4144
- } = this.getSelectedRangeLast();
4145
- const isScrolled = this.scrollViewportTo(highlight.toObject());
4146
- if (isScrolled) {
4147
- this.view.render();
4148
- } else {
4149
- this.removeHook('afterScroll', callback);
4150
- this._registerImmediate(() => callback());
4151
- }
4152
- };
4153
-
4154
3960
  /**
4155
3961
  * Removes the table from the DOM and destroys the instance of the Handsontable.
4156
3962
  *
@@ -4171,7 +3977,6 @@ function Core(rootElement, userSettings) {
4171
3977
  dataSource = null;
4172
3978
  this.getShortcutManager().destroy();
4173
3979
  metaManager.clearCache();
4174
- foreignHotInstances.delete(this.guid);
4175
3980
  if ((0, _rootInstance.isRootInstance)(instance)) {
4176
3981
  const licenseInfo = this.rootDocument.querySelector('.hot-display-license-info');
4177
3982
  if (licenseInfo) {
@@ -4495,16 +4300,6 @@ function Core(rootElement, userSettings) {
4495
4300
  }
4496
4301
  };
4497
4302
 
4498
- /**
4499
- * Gets the instance of the EditorManager.
4500
- *
4501
- * @private
4502
- * @returns {EditorManager}
4503
- */
4504
- this._getEditorManager = function () {
4505
- return editorManager;
4506
- };
4507
-
4508
4303
  /**
4509
4304
  * Check if currently it is RTL direction.
4510
4305
  *
@@ -4575,23 +4370,270 @@ function Core(rootElement, userSettings) {
4575
4370
  this.getShortcutManager = function () {
4576
4371
  return shortcutManager;
4577
4372
  };
4578
-
4579
- /**
4580
- * Return the Focus Manager responsible for managing the browser's focus in the table.
4581
- *
4582
- * @memberof Core#
4583
- * @since 14.0.0
4584
- * @function getFocusManager
4585
- * @returns {FocusManager}
4586
- */
4587
- this.getFocusManager = function () {
4588
- return focusManager;
4373
+ const gridContext = shortcutManager.addContext('grid');
4374
+ const gridConfig = {
4375
+ runOnlyIf: () => {
4376
+ return (0, _mixed.isDefined)(instance.getSelected()) && instance.countRenderedRows() > 0 && instance.countRenderedCols() > 0;
4377
+ },
4378
+ group: SHORTCUTS_GROUP
4589
4379
  };
4380
+ shortcutManager.setActiveContextName('grid');
4381
+ gridContext.addShortcuts([{
4382
+ keys: [['Control/Meta', 'A']],
4383
+ callback: () => {
4384
+ instance.selectAll();
4385
+ }
4386
+ }, {
4387
+ keys: [['Control/Meta', 'Enter']],
4388
+ callback: () => {
4389
+ const selectedRange = instance.getSelectedRange();
4390
+ const {
4391
+ row: highlightRow,
4392
+ col: highlightColumn
4393
+ } = selectedRange[selectedRange.length - 1].highlight;
4394
+ const valueToPopulate = instance.getDataAtCell(highlightRow, highlightColumn);
4395
+ const cellValues = new Map();
4396
+ for (let i = 0; i < selectedRange.length; i++) {
4397
+ selectedRange[i].forAll((row, column) => {
4398
+ if (row >= 0 && column >= 0 && (row !== highlightRow || column !== highlightColumn)) {
4399
+ const {
4400
+ readOnly
4401
+ } = instance.getCellMeta(row, column);
4402
+ if (!readOnly) {
4403
+ cellValues.set(`${row}x${column}`, [row, column, valueToPopulate]);
4404
+ }
4405
+ }
4406
+ });
4407
+ }
4408
+ instance.setDataAtCell(Array.from(cellValues.values()));
4409
+ },
4410
+ runOnlyIf: () => instance.getSelectedRangeLast().getCellsCount() > 1
4411
+ }, {
4412
+ keys: [['ArrowUp']],
4413
+ callback: () => {
4414
+ selection.transformStart(-1, 0);
4415
+ }
4416
+ }, {
4417
+ keys: [['ArrowUp', 'Control/Meta']],
4418
+ captureCtrl: true,
4419
+ callback: () => {
4420
+ selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1), instance.getSelectedRangeLast().highlight.col));
4421
+ }
4422
+ }, {
4423
+ keys: [['ArrowUp', 'Shift']],
4424
+ callback: () => {
4425
+ selection.transformEnd(-1, 0);
4426
+ }
4427
+ }, {
4428
+ keys: [['ArrowUp', 'Shift', 'Control/Meta']],
4429
+ captureCtrl: true,
4430
+ callback: () => {
4431
+ const {
4432
+ from,
4433
+ to
4434
+ } = instance.getSelectedRangeLast();
4435
+ const row = instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1);
4436
+ selection.setRangeStart(from.clone());
4437
+ selection.setRangeEnd(instance._createCellCoords(row, to.col));
4438
+ },
4439
+ runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader())
4440
+ }, {
4441
+ keys: [['ArrowDown']],
4442
+ callback: () => {
4443
+ selection.transformStart(1, 0);
4444
+ }
4445
+ }, {
4446
+ keys: [['ArrowDown', 'Control/Meta']],
4447
+ captureCtrl: true,
4448
+ callback: () => {
4449
+ selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1), instance.getSelectedRangeLast().highlight.col));
4450
+ }
4451
+ }, {
4452
+ keys: [['ArrowDown', 'Shift']],
4453
+ callback: () => {
4454
+ selection.transformEnd(1, 0);
4455
+ }
4456
+ }, {
4457
+ keys: [['ArrowDown', 'Shift', 'Control/Meta']],
4458
+ captureCtrl: true,
4459
+ callback: () => {
4460
+ const {
4461
+ from,
4462
+ to
4463
+ } = instance.getSelectedRangeLast();
4464
+ const row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1);
4465
+ selection.setRangeStart(from.clone());
4466
+ selection.setRangeEnd(instance._createCellCoords(row, to.col));
4467
+ },
4468
+ runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader())
4469
+ }, {
4470
+ keys: [['ArrowLeft']],
4471
+ callback: () => {
4472
+ selection.transformStart(0, -1 * instance.getDirectionFactor());
4473
+ }
4474
+ }, {
4475
+ keys: [['ArrowLeft', 'Control/Meta']],
4476
+ captureCtrl: true,
4477
+ callback: () => {
4478
+ const row = instance.getSelectedRangeLast().highlight.row;
4479
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
4480
+ selection.setRangeStart(instance._createCellCoords(row, column));
4481
+ }
4482
+ }, {
4483
+ keys: [['ArrowLeft', 'Shift']],
4484
+ callback: () => {
4485
+ selection.transformEnd(0, -1 * instance.getDirectionFactor());
4486
+ }
4487
+ }, {
4488
+ keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
4489
+ captureCtrl: true,
4490
+ callback: () => {
4491
+ const {
4492
+ from,
4493
+ to
4494
+ } = instance.getSelectedRangeLast();
4495
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
4496
+ selection.setRangeStart(from.clone());
4497
+ selection.setRangeEnd(instance._createCellCoords(to.row, column));
4498
+ },
4499
+ runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader())
4500
+ }, {
4501
+ keys: [['ArrowRight']],
4502
+ callback: () => {
4503
+ selection.transformStart(0, instance.getDirectionFactor());
4504
+ }
4505
+ }, {
4506
+ keys: [['ArrowRight', 'Control/Meta']],
4507
+ captureCtrl: true,
4508
+ callback: () => {
4509
+ const row = instance.getSelectedRangeLast().highlight.row;
4510
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
4511
+ selection.setRangeStart(instance._createCellCoords(row, column));
4512
+ }
4513
+ }, {
4514
+ keys: [['ArrowRight', 'Shift']],
4515
+ callback: () => {
4516
+ selection.transformEnd(0, instance.getDirectionFactor());
4517
+ }
4518
+ }, {
4519
+ keys: [['ArrowRight', 'Shift', 'Control/Meta']],
4520
+ captureCtrl: true,
4521
+ callback: () => {
4522
+ const {
4523
+ from,
4524
+ to
4525
+ } = instance.getSelectedRangeLast();
4526
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
4527
+ selection.setRangeStart(from.clone());
4528
+ selection.setRangeEnd(instance._createCellCoords(to.row, column));
4529
+ },
4530
+ runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader())
4531
+ }, {
4532
+ keys: [['Home']],
4533
+ captureCtrl: true,
4534
+ callback: () => {
4535
+ const fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
4536
+ const row = instance.getSelectedRangeLast().highlight.row;
4537
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
4538
+ selection.setRangeStart(instance._createCellCoords(row, column));
4539
+ },
4540
+ runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
4541
+ }, {
4542
+ keys: [['Home', 'Shift']],
4543
+ callback: () => {
4544
+ selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
4545
+ }
4546
+ }, {
4547
+ keys: [['Home', 'Control/Meta']],
4548
+ captureCtrl: true,
4549
+ callback: () => {
4550
+ const fixedRows = parseInt(instance.getSettings().fixedRowsTop, 10);
4551
+ const fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
4552
+ const row = instance.rowIndexMapper.getNearestNotHiddenIndex(fixedRows, 1);
4553
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
4554
+ selection.setRangeStart(instance._createCellCoords(row, column));
4555
+ },
4556
+ runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
4557
+ }, {
4558
+ keys: [['End']],
4559
+ captureCtrl: true,
4560
+ callback: () => {
4561
+ selection.setRangeStart(instance._createCellCoords(instance.getSelectedRangeLast().highlight.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
4562
+ },
4563
+ runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
4564
+ }, {
4565
+ keys: [['End', 'Shift']],
4566
+ callback: () => {
4567
+ selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
4568
+ }
4569
+ }, {
4570
+ keys: [['End', 'Control/Meta']],
4571
+ captureCtrl: true,
4572
+ callback: () => {
4573
+ const fixedRows = parseInt(instance.getSettings().fixedRowsBottom, 10);
4574
+ const row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - fixedRows - 1, -1);
4575
+ const column = instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1);
4576
+ selection.setRangeStart(instance._createCellCoords(row, column));
4577
+ },
4578
+ runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
4579
+ }, {
4580
+ keys: [['PageUp']],
4581
+ callback: () => {
4582
+ selection.transformStart(-instance.countVisibleRows(), 0);
4583
+ }
4584
+ }, {
4585
+ keys: [['PageUp', 'Shift']],
4586
+ callback: () => {
4587
+ const {
4588
+ to
4589
+ } = instance.getSelectedRangeLast();
4590
+ const nextRowIndexToSelect = Math.max(to.row - instance.countVisibleRows(), 0);
4591
+ const row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, 1);
4592
+ if (row !== null) {
4593
+ const coords = instance._createCellCoords(row, to.col);
4594
+ const scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
4595
+ const nextVerticalScroll = Math.max(coords.row - scrollPadding, 0);
4596
+ selection.setRangeEnd(coords);
4597
+ instance.scrollViewportTo(nextVerticalScroll);
4598
+ }
4599
+ }
4600
+ }, {
4601
+ keys: [['PageDown']],
4602
+ callback: () => {
4603
+ selection.transformStart(instance.countVisibleRows(), 0);
4604
+ }
4605
+ }, {
4606
+ keys: [['PageDown', 'Shift']],
4607
+ callback: () => {
4608
+ const {
4609
+ to
4610
+ } = instance.getSelectedRangeLast();
4611
+ const nextRowIndexToSelect = Math.min(to.row + instance.countVisibleRows(), instance.countRows() - 1);
4612
+ const row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, -1);
4613
+ if (row !== null) {
4614
+ const coords = instance._createCellCoords(row, to.col);
4615
+ const scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
4616
+ const nextVerticalScroll = Math.min(coords.row - scrollPadding, instance.countRows() - 1);
4617
+ selection.setRangeEnd(coords);
4618
+ instance.scrollViewportTo(nextVerticalScroll);
4619
+ }
4620
+ }
4621
+ }, {
4622
+ keys: [['Tab']],
4623
+ callback: event => {
4624
+ const tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
4625
+ selection.transformStart(tabMoves.row, tabMoves.col, true);
4626
+ }
4627
+ }, {
4628
+ keys: [['Shift', 'Tab']],
4629
+ callback: event => {
4630
+ const tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
4631
+ selection.transformStart(-tabMoves.row, -tabMoves.col);
4632
+ }
4633
+ }], gridConfig);
4590
4634
  (0, _registry.getPluginsNames)().forEach(pluginName => {
4591
4635
  const PluginClass = (0, _registry.getPlugin)(pluginName);
4592
4636
  pluginsRegistry.addItem(pluginName, new PluginClass(this));
4593
4637
  });
4594
- (0, _shortcutContexts.registerAllShortcutContexts)(instance);
4595
- shortcutManager.setActiveContextName('grid');
4596
4638
  _pluginHooks.default.getSingleton().run(instance, 'construct');
4597
4639
  }