handsontable 0.0.0-next-bfaf0f9-20230613 → 0.0.0-next-ea1e0b3-20230620

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 (236) 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 +12 -61
  5. package/3rdparty/walkontable/src/cell/coords.mjs +12 -61
  6. package/3rdparty/walkontable/src/cell/range.d.ts +2 -9
  7. package/3rdparty/walkontable/src/cell/range.js +7 -44
  8. package/3rdparty/walkontable/src/cell/range.mjs +7 -44
  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 +4 -2
  24. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +4 -2
  25. package/3rdparty/walkontable/src/overlay/top.js +4 -2
  26. package/3rdparty/walkontable/src/overlay/top.mjs +4 -2
  27. package/3rdparty/walkontable/src/selection.js +355 -0
  28. package/3rdparty/walkontable/src/selection.mjs +349 -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 +79 -7
  40. package/3rdparty/walkontable/src/table.mjs +80 -8
  41. package/base.js +2 -2
  42. package/base.mjs +2 -2
  43. package/common.d.ts +1 -1
  44. package/core.d.ts +6 -9
  45. package/core.js +390 -235
  46. package/core.mjs +395 -240
  47. package/dataMap/metaManager/metaSchema.js +0 -19
  48. package/dataMap/metaManager/metaSchema.mjs +0 -19
  49. package/dist/handsontable.css +3 -8
  50. package/dist/handsontable.full.css +3 -8
  51. package/dist/handsontable.full.js +9243 -11930
  52. package/dist/handsontable.full.min.css +3 -3
  53. package/dist/handsontable.full.min.js +107 -107
  54. package/dist/handsontable.js +12402 -15089
  55. package/dist/handsontable.min.css +3 -3
  56. package/dist/handsontable.min.js +4 -4
  57. package/editorManager.js +94 -21
  58. package/editorManager.mjs +98 -26
  59. package/editors/textEditor/textEditor.js +11 -3
  60. package/editors/textEditor/textEditor.mjs +12 -4
  61. package/helpers/mixed.js +1 -1
  62. package/helpers/mixed.mjs +1 -1
  63. package/helpers/number.d.ts +0 -1
  64. package/helpers/number.js +0 -18
  65. package/helpers/number.mjs +0 -17
  66. package/package.json +1 -1
  67. package/pluginHooks.d.ts +1 -6
  68. package/pluginHooks.js +1 -100
  69. package/pluginHooks.mjs +1 -100
  70. package/plugins/autofill/autofill.js +1 -2
  71. package/plugins/autofill/autofill.mjs +2 -3
  72. package/plugins/autofill/utils.js +1 -39
  73. package/plugins/autofill/utils.mjs +0 -37
  74. package/plugins/copyPaste/copyPaste.js +1 -5
  75. package/plugins/copyPaste/copyPaste.mjs +1 -5
  76. package/plugins/customBorders/customBorders.js +53 -18
  77. package/plugins/customBorders/customBorders.mjs +54 -19
  78. package/plugins/manualColumnResize/manualColumnResize.js +36 -5
  79. package/plugins/manualColumnResize/manualColumnResize.mjs +36 -5
  80. package/plugins/manualRowResize/manualRowResize.js +40 -9
  81. package/plugins/manualRowResize/manualRowResize.mjs +40 -9
  82. package/plugins/mergeCells/mergeCells.js +18 -5
  83. package/plugins/mergeCells/mergeCells.mjs +18 -5
  84. package/plugins/nestedHeaders/nestedHeaders.js +10 -132
  85. package/plugins/nestedHeaders/nestedHeaders.mjs +10 -132
  86. package/plugins/nestedHeaders/stateManager/index.js +0 -37
  87. package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
  88. package/plugins/nestedRows/nestedRows.js +7 -52
  89. package/plugins/nestedRows/nestedRows.mjs +7 -52
  90. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  91. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  92. package/selection/highlight/constants.js +16 -0
  93. package/selection/highlight/constants.mjs +6 -0
  94. package/selection/highlight/highlight.js +89 -312
  95. package/selection/highlight/highlight.mjs +85 -302
  96. package/selection/highlight/types/activeHeader.js +9 -10
  97. package/selection/highlight/types/activeHeader.mjs +8 -10
  98. package/selection/highlight/types/area.js +27 -12
  99. package/selection/highlight/types/area.mjs +30 -16
  100. package/selection/highlight/types/{focus.js → cell.js} +8 -5
  101. package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
  102. package/selection/highlight/types/customSelection.js +10 -7
  103. package/selection/highlight/types/customSelection.mjs +9 -7
  104. package/selection/highlight/types/fill.js +8 -5
  105. package/selection/highlight/types/fill.mjs +7 -5
  106. package/selection/highlight/types/header.js +20 -10
  107. package/selection/highlight/types/header.mjs +19 -10
  108. package/selection/highlight/types/{row.js → index.js} +31 -27
  109. package/selection/highlight/types/{row.mjs → index.mjs} +29 -24
  110. package/selection/highlight/visualSelection.js +27 -31
  111. package/selection/highlight/visualSelection.mjs +27 -31
  112. package/selection/index.js +7 -4
  113. package/selection/index.mjs +3 -2
  114. package/selection/mouseEventHandler.js +1 -1
  115. package/selection/mouseEventHandler.mjs +1 -1
  116. package/selection/range.js +8 -8
  117. package/selection/range.mjs +8 -8
  118. package/selection/selection.js +181 -315
  119. package/selection/selection.mjs +180 -310
  120. package/selection/transformation.js +96 -233
  121. package/selection/transformation.mjs +93 -230
  122. package/selection/utils.js +36 -12
  123. package/selection/utils.mjs +36 -13
  124. package/settings.d.ts +0 -1
  125. package/shortcuts/manager.js +0 -2
  126. package/shortcuts/manager.mjs +0 -2
  127. package/tableView.js +9 -58
  128. package/tableView.mjs +9 -58
  129. package/translations/indexMapper.js +7 -56
  130. package/translations/indexMapper.mjs +8 -56
  131. package/3rdparty/walkontable/src/selection/border/constants.js +0 -18
  132. package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -13
  133. package/3rdparty/walkontable/src/selection/constants.js +0 -63
  134. package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
  135. package/3rdparty/walkontable/src/selection/index.js +0 -30
  136. package/3rdparty/walkontable/src/selection/index.mjs +0 -5
  137. package/3rdparty/walkontable/src/selection/manager.js +0 -329
  138. package/3rdparty/walkontable/src/selection/manager.mjs +0 -323
  139. package/3rdparty/walkontable/src/selection/scanner.js +0 -364
  140. package/3rdparty/walkontable/src/selection/scanner.mjs +0 -360
  141. package/3rdparty/walkontable/src/selection/selection.js +0 -133
  142. package/3rdparty/walkontable/src/selection/selection.mjs +0 -127
  143. package/selection/highlight/types/areaLayered.js +0 -54
  144. package/selection/highlight/types/areaLayered.mjs +0 -49
  145. package/selection/highlight/types/column.js +0 -50
  146. package/selection/highlight/types/column.mjs +0 -45
  147. package/shortcutContexts/commands/editor/closeAndSave.js +0 -15
  148. package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -10
  149. package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -13
  150. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
  151. package/shortcutContexts/commands/editor/fastOpen.js +0 -16
  152. package/shortcutContexts/commands/editor/fastOpen.mjs +0 -11
  153. package/shortcutContexts/commands/editor/index.js +0 -16
  154. package/shortcutContexts/commands/editor/index.mjs +0 -12
  155. package/shortcutContexts/commands/editor/open.js +0 -29
  156. package/shortcutContexts/commands/editor/open.mjs +0 -24
  157. package/shortcutContexts/commands/emptySelectedCells.js +0 -12
  158. package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
  159. package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
  160. package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -10
  161. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -21
  162. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -16
  163. package/shortcutContexts/commands/extendCellsSelection/index.js +0 -26
  164. package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -22
  165. package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
  166. package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -10
  167. package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
  168. package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -10
  169. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +0 -19
  170. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +0 -14
  171. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -22
  172. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -17
  173. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -17
  174. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -12
  175. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -17
  176. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -12
  177. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -40
  178. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -35
  179. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -40
  180. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -35
  181. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -22
  182. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -17
  183. package/shortcutContexts/commands/extendCellsSelection/toRows.js +0 -19
  184. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +0 -14
  185. package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
  186. package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -10
  187. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -21
  188. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -16
  189. package/shortcutContexts/commands/index.js +0 -52
  190. package/shortcutContexts/commands/index.mjs +0 -48
  191. package/shortcutContexts/commands/moveCellSelection/down.js +0 -12
  192. package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -7
  193. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -29
  194. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -24
  195. package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
  196. package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
  197. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -13
  198. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
  199. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -13
  200. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
  201. package/shortcutContexts/commands/moveCellSelection/left.js +0 -11
  202. package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
  203. package/shortcutContexts/commands/moveCellSelection/right.js +0 -11
  204. package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
  205. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -16
  206. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -11
  207. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -17
  208. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -12
  209. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -13
  210. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -8
  211. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -16
  212. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -11
  213. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -36
  214. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -31
  215. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -36
  216. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -31
  217. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -16
  218. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -11
  219. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -18
  220. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -13
  221. package/shortcutContexts/commands/moveCellSelection/up.js +0 -12
  222. package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -7
  223. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -29
  224. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -24
  225. package/shortcutContexts/commands/populateSelectedCellsData.js +0 -35
  226. package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -30
  227. package/shortcutContexts/commands/selectAll.js +0 -11
  228. package/shortcutContexts/commands/selectAll.mjs +0 -6
  229. package/shortcutContexts/constants.js +0 -19
  230. package/shortcutContexts/constants.mjs +0 -12
  231. package/shortcutContexts/editor.js +0 -29
  232. package/shortcutContexts/editor.mjs +0 -25
  233. package/shortcutContexts/grid.js +0 -244
  234. package/shortcutContexts/grid.mjs +0 -240
  235. package/shortcutContexts/index.js +0 -29
  236. package/shortcutContexts/index.mjs +0 -15
package/core.mjs CHANGED
@@ -1,12 +1,4 @@
1
- import "core-js/modules/es.symbol.js";
2
- import "core-js/modules/es.symbol.description.js";
3
- import "core-js/modules/es.symbol.iterator.js";
4
- import "core-js/modules/es.regexp.to-string.js";
5
- import "core-js/modules/es.function.name.js";
6
- import "core-js/modules/es.object.freeze.js";
7
- var _templateObject, _templateObject2;
8
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
10
2
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
3
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
4
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
@@ -23,28 +15,33 @@ import "core-js/modules/es.set.js";
23
15
  import "core-js/modules/es.string.iterator.js";
24
16
  import "core-js/modules/web.dom-collections.iterator.js";
25
17
  import "core-js/modules/es.array.includes.js";
26
- import "core-js/modules/es.array.concat.js";
27
18
  import "core-js/modules/es.array.sort.js";
28
19
  import "core-js/modules/es.array.splice.js";
29
20
  import "core-js/modules/es.number.is-integer.js";
30
21
  import "core-js/modules/es.number.constructor.js";
31
22
  import "core-js/modules/es.array.slice.js";
23
+ import "core-js/modules/es.array.concat.js";
32
24
  import "core-js/modules/es.array.fill.js";
33
25
  import "core-js/modules/es.array.map.js";
34
26
  import "core-js/modules/es.regexp.exec.js";
35
27
  import "core-js/modules/es.string.replace.js";
28
+ import "core-js/modules/es.array.filter.js";
36
29
  import "core-js/modules/es.array.from.js";
37
30
  import "core-js/modules/es.array.index-of.js";
38
31
  import "core-js/modules/es.array.reverse.js";
39
32
  import "core-js/modules/web.dom-collections.for-each.js";
40
33
  import "core-js/modules/web.timers.js";
41
34
  import "core-js/modules/web.immediate.js";
35
+ import "core-js/modules/es.map.js";
36
+ import "core-js/modules/es.symbol.js";
37
+ import "core-js/modules/es.symbol.description.js";
38
+ import "core-js/modules/es.symbol.iterator.js";
39
+ import "core-js/modules/es.regexp.to-string.js";
40
+ import "core-js/modules/es.function.name.js";
42
41
  import { addClass, empty, observeVisibilityChangeOnce, removeClass } from "./helpers/dom/element.mjs";
43
42
  import { isFunction } from "./helpers/function.mjs";
44
43
  import { isDefined, isUndefined, isRegExp, _injectProductInfo, isEmpty } from "./helpers/mixed.mjs";
45
44
  import { isMobileBrowser, isIpadOS } from "./helpers/browser.mjs";
46
- import { warn } from "./helpers/console.mjs";
47
- import { toSingleLine } from "./helpers/templateLiteralTag.mjs";
48
45
  import EditorManager from "./editorManager.mjs";
49
46
  import EventManager from "./eventManager.mjs";
50
47
  import { deepClone, duckSchema, isObjectEqual, isObject, deepObjectSize, hasOwnProperty, createObjectPropListener, objectEach } from "./helpers/object.mjs";
@@ -69,8 +66,15 @@ import { Selection } from "./selection/index.mjs";
69
66
  import { MetaManager, DynamicCellMetaMod, ExtendMetaPropertiesMod, replaceData } from "./dataMap/index.mjs";
70
67
  import { createUniqueMap } from "./utils/dataStructures/uniqueMap.mjs";
71
68
  import { createShortcutManager } from "./shortcuts/index.mjs";
72
- import { registerAllShortcutContexts } from "./shortcutContexts/index.mjs";
69
+ var SHORTCUTS_GROUP = 'gridDefault';
73
70
  var activeGuid = null;
71
+
72
+ /**
73
+ * A set of deprecated feature names.
74
+ *
75
+ * @type {Set<string>}
76
+ */
77
+ // eslint-disable-next-line no-unused-vars
74
78
  var deprecationWarns = new Set();
75
79
 
76
80
  /* eslint-disable jsdoc/require-description-complete-sentence */
@@ -286,8 +290,12 @@ export default function Core(rootElement, userSettings) {
286
290
  };
287
291
 
288
292
  var selection = new Selection(tableMeta, {
289
- rowIndexMapper: instance.rowIndexMapper,
290
- columnIndexMapper: instance.columnIndexMapper,
293
+ rowIndexMapper: function rowIndexMapper() {
294
+ return instance.rowIndexMapper;
295
+ },
296
+ columnIndexMapper: function columnIndexMapper() {
297
+ return instance.columnIndexMapper;
298
+ },
291
299
  countCols: function countCols() {
292
300
  return instance.countCols();
293
301
  },
@@ -300,18 +308,12 @@ export default function Core(rootElement, userSettings) {
300
308
  isEditorOpened: function isEditorOpened() {
301
309
  return instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false;
302
310
  },
303
- countRenderableColumns: function countRenderableColumns() {
311
+ countColsTranslated: function countColsTranslated() {
304
312
  return _this.view.countRenderableColumns();
305
313
  },
306
- countRenderableRows: function countRenderableRows() {
314
+ countRowsTranslated: function countRowsTranslated() {
307
315
  return _this.view.countRenderableRows();
308
316
  },
309
- countRowHeaders: function countRowHeaders() {
310
- return _this.countRowHeaders();
311
- },
312
- countColHeaders: function countColHeaders() {
313
- return _this.countColHeaders();
314
- },
315
317
  getShortcutManager: function getShortcutManager() {
316
318
  return instance.getShortcutManager();
317
319
  },
@@ -344,6 +346,12 @@ export default function Core(rootElement, userSettings) {
344
346
  });
345
347
  this.selection.addLocalHook('beforeSetRangeEnd', function (cellCoords) {
346
348
  _this.runHooks('beforeSetRangeEnd', cellCoords);
349
+ if (cellCoords.row < 0) {
350
+ cellCoords.row = _this.view._wt.wtTable.getFirstVisibleRow();
351
+ }
352
+ if (cellCoords.col < 0) {
353
+ cellCoords.col = _this.view._wt.wtTable.getFirstVisibleColumn();
354
+ }
347
355
  });
348
356
  this.selection.addLocalHook('afterSetRangeEnd', function (cellCoords) {
349
357
  var preventScrolling = createObjectPropListener(false);
@@ -369,14 +377,7 @@ export default function Core(rootElement, userSettings) {
369
377
  if (scrollToCell !== false) {
370
378
  if (!isSelectedByAnyHeader) {
371
379
  if (currentSelectedRange && !_this.selection.isMultiple()) {
372
- var renderableCoords = visualToRenderableCoords(currentSelectedRange.from);
373
- if (renderableCoords.row < 0 && renderableCoords.col >= 0) {
374
- _this.view.scrollViewportHorizontally(renderableCoords.col);
375
- } else if (renderableCoords.col < 0 && renderableCoords.row >= 0) {
376
- _this.view.scrollViewportVertically(renderableCoords.row);
377
- } else {
378
- _this.view.scrollViewport(renderableCoords);
379
- }
380
+ _this.view.scrollViewport(visualToRenderableCoords(currentSelectedRange.from));
380
381
  } else {
381
382
  _this.view.scrollViewport(visualToRenderableCoords(cellCoords));
382
383
  }
@@ -417,30 +418,6 @@ export default function Core(rootElement, userSettings) {
417
418
  isMultiple.value = changedIsMultiple;
418
419
  }
419
420
  });
420
- this.selection.addLocalHook('beforeSelectColumns', function () {
421
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
422
- args[_key] = arguments[_key];
423
- }
424
- return _this.runHooks.apply(_this, ['beforeSelectColumns'].concat(args));
425
- });
426
- this.selection.addLocalHook('afterSelectColumns', function () {
427
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
428
- args[_key2] = arguments[_key2];
429
- }
430
- return _this.runHooks.apply(_this, ['afterSelectColumns'].concat(args));
431
- });
432
- this.selection.addLocalHook('beforeSelectRows', function () {
433
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
434
- args[_key3] = arguments[_key3];
435
- }
436
- return _this.runHooks.apply(_this, ['beforeSelectRows'].concat(args));
437
- });
438
- this.selection.addLocalHook('afterSelectRows', function () {
439
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
440
- args[_key4] = arguments[_key4];
441
- }
442
- return _this.runHooks.apply(_this, ['afterSelectRows'].concat(args));
443
- });
444
421
  this.selection.addLocalHook('beforeModifyTransformStart', function (cellCoordsDelta) {
445
422
  _this.runHooks('modifyTransformStart', cellCoordsDelta);
446
423
  });
@@ -526,13 +503,6 @@ export default function Core(rootElement, userSettings) {
526
503
 
527
504
  /* eslint-disable no-case-declarations */
528
505
  switch (action) {
529
- case 'insert_row':
530
- // backward compatibility
531
- if (!deprecationWarns.has(action)) {
532
- deprecationWarns.add(action);
533
- warn(toSingleLine(_templateObject || (_templateObject = _taggedTemplateLiteral(["The `", "` action of the `alter()` method is deprecated and will be removed \n in the next major release of Handsontable. Use the `insert_row_above` action instead."], ["The \\`", "\\` action of the \\`alter()\\` method is deprecated and will be removed\\x20\n in the next major release of Handsontable. Use the \\`insert_row_above\\` action instead."])), action));
534
- }
535
- // falls through
536
506
  case 'insert_row_below':
537
507
  case 'insert_row_above':
538
508
  var numberOfSourceRows = instance.countSourceRows();
@@ -543,11 +513,9 @@ export default function Core(rootElement, userSettings) {
543
513
  // `above` is the default behavior for creating new rows
544
514
  var insertRowMode = action === 'insert_row_below' ? 'below' : 'above';
545
515
 
546
- // The line below ensures backward compatibility of the `alter()` method's `insert_row` action.
547
- // Calling the `insert_row` action with no arguments adds a new row at the end of the data set.
548
516
  // Calling the `insert_row_above` action adds a new row at the beginning of the data set.
549
517
  // eslint-disable-next-line no-param-reassign
550
- index = (_index = index) !== null && _index !== void 0 ? _index : action === 'insert_row' || insertRowMode === 'below' ? numberOfSourceRows : 0;
518
+ index = (_index = index) !== null && _index !== void 0 ? _index : insertRowMode === 'below' ? numberOfSourceRows : 0;
551
519
  var _datamap$createRow = datamap.createRow(index, amount, {
552
520
  source: source,
553
521
  mode: insertRowMode
@@ -586,23 +554,14 @@ export default function Core(rootElement, userSettings) {
586
554
  }
587
555
 
588
556
  break;
589
- case 'insert_col':
590
- // backward compatibility
591
- if (!deprecationWarns.has(action)) {
592
- deprecationWarns.add(action);
593
- warn(toSingleLine(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["The `", "` action of the `alter()` method is deprecated and will be removed \n in the next major release of Handsontable. Use the `insert_col_start` action instead."], ["The \\`", "\\` action of the \\`alter()\\` method is deprecated and will be removed\\x20\n in the next major release of Handsontable. Use the \\`insert_col_start\\` action instead."])), action));
594
- }
595
- // falls through
596
557
  case 'insert_col_start':
597
558
  case 'insert_col_end':
598
559
  // "start" is a default behavior for creating new columns
599
560
  var insertColumnMode = action === 'insert_col_end' ? 'end' : 'start';
600
561
 
601
- // The line below ensures backward compatibility of the `alter()` method's `insert_col` action.
602
- // Calling the `insert_col` action with no arguments adds a new column to the right of the data set.
603
562
  // Calling the `insert_col_start` action adds a new column to the left of the data set.
604
563
  // eslint-disable-next-line no-param-reassign
605
- index = (_index2 = index) !== null && _index2 !== void 0 ? _index2 : action === 'insert_col' || insertColumnMode === 'end' ? instance.countSourceCols() : 0;
564
+ index = (_index2 = index) !== null && _index2 !== void 0 ? _index2 : insertColumnMode === 'end' ? instance.countSourceCols() : 0;
606
565
  var _datamap$createCol = datamap.createCol(index, amount, {
607
566
  source: source,
608
567
  mode: insertColumnMode
@@ -873,13 +832,9 @@ export default function Core(rootElement, userSettings) {
873
832
  * @param {object} [end] End selection position (only for drag-down mode). Visual indexes.
874
833
  * @param {string} [source="populateFromArray"] Source information string.
875
834
  * @param {string} [method="overwrite"] Populate method. Possible options: `shift_down`, `shift_right`, `overwrite`.
876
- * @param {string} direction (left|right|up|down) String specifying the direction.
877
- * @param {Array} deltas The deltas array. A difference between values of adjacent cells.
878
- * Useful **only** when the type of handled cells is `numeric`.
879
835
  * @returns {object|undefined} Ending td in pasted area (only if any cell was changed).
880
836
  */
881
- populateFromArray: function populateFromArray(start, input, end, source, method, direction, deltas) {
882
- // TODO: either remove or implement the `direction` argument. Currently it's not working at all.
837
+ populateFromArray: function populateFromArray(start, input, end, source, method) {
883
838
  var r;
884
839
  var rlen;
885
840
  var c;
@@ -967,11 +922,6 @@ export default function Core(rootElement, userSettings) {
967
922
  // overwrite and other not specified options
968
923
  current.row = start.row;
969
924
  current.col = start.col;
970
- var selected = {
971
- // selected range
972
- row: end && start ? end.row - start.row + 1 : 1,
973
- col: end && start ? end.col - start.col + 1 : 1
974
- };
975
925
  var skippedRow = 0;
976
926
  var skippedColumn = 0;
977
927
  var pushData = true;
@@ -1032,16 +982,6 @@ export default function Core(rootElement, userSettings) {
1032
982
  var visualColumn = c - skippedColumn;
1033
983
  var value = getInputValue(visualRow, visualColumn);
1034
984
  var orgValue = instance.getDataAtCell(current.row, current.col);
1035
- var index = {
1036
- row: visualRow,
1037
- col: visualColumn
1038
- };
1039
- if (source === 'Autofill.fill') {
1040
- var result = instance.runHooks('beforeAutofillInsidePopulate', index, direction, input, deltas, {}, selected);
1041
- if (result) {
1042
- value = isUndefined(result.value) ? value : result.value;
1043
- }
1044
- }
1045
985
  if (value !== null && _typeof(value) === 'object') {
1046
986
  // when 'value' is array and 'orgValue' is null, set 'orgValue' to
1047
987
  // an empty array so that the null value can be compared to 'value'
@@ -1211,15 +1151,8 @@ export default function Core(rootElement, userSettings) {
1211
1151
  return;
1212
1152
  }
1213
1153
  var activeEditor = instance.getActiveEditor();
1214
- var beforeChangeResult = instance.runHooks('beforeChange', changes, source || 'edit');
1215
- var shouldBeCanceled = true;
1216
- if (beforeChangeResult === false) {
1217
- if (activeEditor) {
1218
- activeEditor.cancelChanges();
1219
- }
1220
- return;
1221
- }
1222
1154
  var waitingForValidator = new ValidatorsQueue();
1155
+ var shouldBeCanceled = true;
1223
1156
  waitingForValidator.onQueueEmpty = function (isValid) {
1224
1157
  if (activeEditor && shouldBeCanceled) {
1225
1158
  activeEditor.cancelChanges();
@@ -1228,43 +1161,37 @@ export default function Core(rootElement, userSettings) {
1228
1161
  };
1229
1162
 
1230
1163
  for (var i = changes.length - 1; i >= 0; i--) {
1231
- if (changes[i] === null) {
1232
- changes.splice(i, 1);
1233
- } else {
1234
- var _changes$i = _slicedToArray(changes[i], 4),
1235
- row = _changes$i[0],
1236
- prop = _changes$i[1],
1237
- newValue = _changes$i[3];
1238
- var col = datamap.propToCol(prop);
1239
- var cellProperties = instance.getCellMeta(row, col);
1240
- if (cellProperties.type === 'numeric' && typeof newValue === 'string' && isNumericLike(newValue)) {
1241
- changes[i][3] = getParsedNumber(newValue);
1242
- }
1164
+ var _changes$i = _slicedToArray(changes[i], 4),
1165
+ row = _changes$i[0],
1166
+ prop = _changes$i[1],
1167
+ newValue = _changes$i[3];
1168
+ var col = datamap.propToCol(prop);
1169
+ var cellProperties = instance.getCellMeta(row, col);
1170
+ if (cellProperties.type === 'numeric' && typeof newValue === 'string' && isNumericLike(newValue)) {
1171
+ changes[i][3] = getParsedNumber(newValue);
1172
+ }
1243
1173
 
1244
- /* eslint-disable no-loop-func */
1245
- if (instance.getCellValidator(cellProperties)) {
1246
- waitingForValidator.addValidatorToQueue();
1247
- instance.validateCell(changes[i][3], cellProperties, function (index, cellPropertiesReference) {
1248
- return function (result) {
1249
- if (typeof result !== 'boolean') {
1250
- throw new Error('Validation error: result is not boolean');
1251
- }
1252
- if (result === false && cellPropertiesReference.allowInvalid === false) {
1253
- shouldBeCanceled = false;
1254
- changes.splice(index, 1); // cancel the change
1255
- cellPropertiesReference.valid = true; // we cancelled the change, so cell value is still valid
1256
-
1257
- var cell = instance.getCell(cellPropertiesReference.visualRow, cellPropertiesReference.visualCol);
1258
- if (cell !== null) {
1259
- removeClass(cell, tableMeta.invalidCellClassName);
1260
- }
1261
- // index -= 1;
1174
+ /* eslint-disable no-loop-func */
1175
+ if (instance.getCellValidator(cellProperties)) {
1176
+ waitingForValidator.addValidatorToQueue();
1177
+ instance.validateCell(changes[i][3], cellProperties, function (index, cellPropertiesReference) {
1178
+ return function (result) {
1179
+ if (typeof result !== 'boolean') {
1180
+ throw new Error('Validation error: result is not boolean');
1181
+ }
1182
+ if (result === false && cellPropertiesReference.allowInvalid === false) {
1183
+ shouldBeCanceled = false;
1184
+ changes.splice(index, 1); // cancel the change
1185
+ cellPropertiesReference.valid = true; // we cancelled the change, so cell value is still valid
1186
+
1187
+ var cell = instance.getCell(cellPropertiesReference.visualRow, cellPropertiesReference.visualCol);
1188
+ if (cell !== null) {
1189
+ removeClass(cell, tableMeta.invalidCellClassName);
1262
1190
  }
1263
-
1264
- waitingForValidator.removeValidatorFormQueue();
1265
- };
1266
- }(i, cellProperties), source);
1267
- }
1191
+ }
1192
+ waitingForValidator.removeValidatorFormQueue();
1193
+ };
1194
+ }(i, cellProperties), source);
1268
1195
  }
1269
1196
  }
1270
1197
  waitingForValidator.checkIfQueueIsEmpty();
@@ -1454,6 +1381,31 @@ export default function Core(rootElement, userSettings) {
1454
1381
  return [[row, propOrCol, value]];
1455
1382
  }
1456
1383
 
1384
+ /**
1385
+ * Process changes prepared for applying to the dataset (unifying list of changes, closing an editor - when needed,
1386
+ * calling a hook).
1387
+ *
1388
+ * @private
1389
+ * @param {Array} changes Array of changes in format `[[row, col, value],...]`.
1390
+ * @param {string} [source] String that identifies how this change will be described in the changes array (useful in afterChange or beforeChange callback). Set to 'edit' if left empty.
1391
+ * @returns {Array} List of changes finally applied to the dataset.
1392
+ */
1393
+ function processChanges(changes, source) {
1394
+ var activeEditor = instance.getActiveEditor();
1395
+ var beforeChangeResult = instance.runHooks('beforeChange', changes, source || 'edit');
1396
+ // The `beforeChange` hook could add a `null` for purpose of cancelling some dataset's change.
1397
+ var filteredChanges = changes.filter(function (change) {
1398
+ return change !== null;
1399
+ });
1400
+ if (beforeChangeResult === false || filteredChanges.length === 0) {
1401
+ if (activeEditor) {
1402
+ activeEditor.cancelChanges();
1403
+ }
1404
+ return [];
1405
+ }
1406
+ return filteredChanges;
1407
+ }
1408
+
1457
1409
  /**
1458
1410
  * @description
1459
1411
  * Set new value to a cell. To change many cells at once (recommended way), pass an array of `changes` in format
@@ -1491,9 +1443,10 @@ export default function Core(rootElement, userSettings) {
1491
1443
  if (!changeSource && _typeof(row) === 'object') {
1492
1444
  changeSource = column;
1493
1445
  }
1494
- instance.runHooks('afterSetDataAtCell', changes, changeSource);
1495
- validateChanges(changes, changeSource, function () {
1496
- applyChanges(changes, changeSource);
1446
+ var processedChanges = processChanges(changes, source);
1447
+ instance.runHooks('afterSetDataAtCell', processedChanges, changeSource);
1448
+ validateChanges(processedChanges, changeSource, function () {
1449
+ applyChanges(processedChanges, changeSource);
1497
1450
  });
1498
1451
  };
1499
1452
 
@@ -1521,9 +1474,10 @@ export default function Core(rootElement, userSettings) {
1521
1474
  if (!changeSource && _typeof(row) === 'object') {
1522
1475
  changeSource = prop;
1523
1476
  }
1524
- instance.runHooks('afterSetDataAtRowProp', changes, changeSource);
1525
- validateChanges(changes, changeSource, function () {
1526
- applyChanges(changes, changeSource);
1477
+ var processedChanges = processChanges(changes, source);
1478
+ instance.runHooks('afterSetDataAtRowProp', processedChanges, changeSource);
1479
+ validateChanges(processedChanges, changeSource, function () {
1480
+ applyChanges(processedChanges, changeSource);
1527
1481
  });
1528
1482
  };
1529
1483
 
@@ -1598,18 +1552,15 @@ export default function Core(rootElement, userSettings) {
1598
1552
  * @param {number} [endCol] End visual column index (use when you want to cut input when certain column is reached).
1599
1553
  * @param {string} [source=populateFromArray] Used to identify this call in the resulting events (beforeChange, afterChange).
1600
1554
  * @param {string} [method=overwrite] Populate method, possible values: `'shift_down'`, `'shift_right'`, `'overwrite'`.
1601
- * @param {string} direction Populate direction, possible values: `'left'`, `'right'`, `'up'`, `'down'`.
1602
- * @param {Array} deltas The deltas array. A difference between values of adjacent cells.
1603
- * Useful **only** when the type of handled cells is `numeric`.
1604
1555
  * @returns {object|undefined} Ending td in pasted area (only if any cell was changed).
1605
1556
  */
1606
- this.populateFromArray = function (row, column, input, endRow, endCol, source, method, direction, deltas) {
1557
+ this.populateFromArray = function (row, column, input, endRow, endCol, source, method) {
1607
1558
  if (!(_typeof(input) === 'object' && _typeof(input[0]) === 'object')) {
1608
1559
  throw new Error('populateFromArray parameter `input` must be an array of arrays'); // API changed in 0.9-beta2, let's check if you use it correctly
1609
1560
  }
1610
1561
 
1611
1562
  var c = typeof endRow === 'number' ? instance._createCellCoords(endRow, endCol) : null;
1612
- return grid.populateFromArray(instance._createCellCoords(row, column), input, c, source, method, direction, deltas);
1563
+ return grid.populateFromArray(instance._createCellCoords(row, column), input, c, source, method);
1613
1564
  };
1614
1565
 
1615
1566
  /**
@@ -1625,8 +1576,8 @@ export default function Core(rootElement, userSettings) {
1625
1576
  */
1626
1577
  this.spliceCol = function (column, index, amount) {
1627
1578
  var _datamap;
1628
- for (var _len5 = arguments.length, elements = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
1629
- elements[_key5 - 3] = arguments[_key5];
1579
+ for (var _len = arguments.length, elements = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
1580
+ elements[_key - 3] = arguments[_key];
1630
1581
  }
1631
1582
  return (_datamap = datamap).spliceCol.apply(_datamap, [column, index, amount].concat(elements));
1632
1583
  };
@@ -1644,8 +1595,8 @@ export default function Core(rootElement, userSettings) {
1644
1595
  */
1645
1596
  this.spliceRow = function (row, index, amount) {
1646
1597
  var _datamap2;
1647
- for (var _len6 = arguments.length, elements = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
1648
- elements[_key6 - 3] = arguments[_key6];
1598
+ for (var _len2 = arguments.length, elements = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
1599
+ elements[_key2 - 3] = arguments[_key2];
1649
1600
  }
1650
1601
  return (_datamap2 = datamap).spliceRow.apply(_datamap2, [row, index, amount].concat(elements));
1651
1602
  };
@@ -1741,9 +1692,6 @@ export default function Core(rootElement, userSettings) {
1741
1692
  }
1742
1693
  var changes = [];
1743
1694
  arrayEach(selection.getSelectedRange(), function (cellRange) {
1744
- if (cellRange.isSingleHeader()) {
1745
- return;
1746
- }
1747
1695
  var topStart = cellRange.getTopStartCorner();
1748
1696
  var bottomEnd = cellRange.getBottomEndCorner();
1749
1697
  rangeEach(topStart.row, bottomEnd.row, function (row) {
@@ -2532,16 +2480,14 @@ export default function Core(rootElement, userSettings) {
2532
2480
  *
2533
2481
  * | Action | With `index` | Without `index` |
2534
2482
  * | -------------------- | ------------ | --------------- |
2535
- * | `'insert_row_above'` | Inserts rows above the `index` row.<br><br>Works the same as the deprecated `insert_row` with an `index`. | Inserts rows above the first row. |
2536
- * | `'insert_row_below'` | Inserts rows below the `index` row. | Inserts rows below the last row.<br><br>Works the same as the deprecated `insert_row` with no `index`. |
2483
+ * | `'insert_row_above'` | Inserts rows above the `index` row. | Inserts rows above the first row. |
2484
+ * | `'insert_row_below'` | Inserts rows below the `index` row. | Inserts rows below the last row. |
2537
2485
  * | `'remove_row'` | Removes rows, starting from the `index` row. | Removes rows, starting from the last row. |
2538
- * | `'insert_col_start'` | Inserts columns before the `index` column.<br><br>Works the same as the deprecated `insert_col` with an `index`. | Inserts columns before the first column. |
2539
- * | `'insert_col_end'` | Inserts columns after the `index` column. | Inserts columns after the last column.<br><br>Works the same as the deprecated `insert_col` with no `index`. |
2486
+ * | `'insert_col_start'` | Inserts columns before the `index` column. | Inserts columns before the first column. |
2487
+ * | `'insert_col_end'` | Inserts columns after the `index` column. | Inserts columns after the last column. |
2540
2488
  * | `'remove_col'` | Removes columns, starting from the `index` column. | Removes columns, starting from the last column. |
2541
- * | `'insert_row'` (<b>Deprecated</b>) | Inserts rows above the `index` row.<br><br>Works the same as `insert_row_above` with an `index`. | Inserts rows below the last row.<br><br>Works the same as `insert_row_below` with no `index`. |
2542
- * | `'insert_col'` (<b>Deprecated</b>) | Inserts columns before the `index` column.<br><br>Works the same as `insert_col_start` with an `index`.| Inserts columns after the last column.<br><br>Works the same as `insert_col_end` with no `index`. |
2543
2489
  *
2544
- * Additional information about `'insert_col_start'`, `'insert_col_end'`, and `'insert_col'`:
2490
+ * Additional information about `'insert_col_start'` and `'insert_col_end'`:
2545
2491
  * - Their behavior depends on your [`layoutDirection`](@/api/options.md#layoutdirection).
2546
2492
  * - If the provided `index` is higher than the actual number of columns, Handsontable doesn't generate
2547
2493
  * the columns missing in between. Instead, the new columns are inserted next to the last column.
@@ -2556,8 +2502,6 @@ export default function Core(rootElement, userSettings) {
2556
2502
  * <li> `'insert_col_start'` </li>
2557
2503
  * <li> `'insert_col_end'` </li>
2558
2504
  * <li> `'remove_col'` </li>
2559
- * <li> `'insert_row'` (<b>Deprecated</b>) </li>
2560
- * <li> `'insert_col'` (<b>Deprecated</b>) </li>
2561
2505
  * </ul>
2562
2506
  * @param {number|number[]} [index] A visual index of the row/column before or after which the new row/column will be
2563
2507
  * inserted or removed. Can also be an array of arrays, in format `[[index, amount],...]`.
@@ -3062,8 +3006,8 @@ export default function Core(rootElement, userSettings) {
3062
3006
  this.spliceCellsMeta = function (visualIndex) {
3063
3007
  var _this5 = this;
3064
3008
  var deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3065
- for (var _len7 = arguments.length, cellMetaRows = new Array(_len7 > 2 ? _len7 - 2 : 0), _key7 = 2; _key7 < _len7; _key7++) {
3066
- cellMetaRows[_key7 - 2] = arguments[_key7];
3009
+ for (var _len3 = arguments.length, cellMetaRows = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
3010
+ cellMetaRows[_key3 - 2] = arguments[_key3];
3067
3011
  }
3068
3012
  if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
3069
3013
  throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
@@ -3757,30 +3701,6 @@ export default function Core(rootElement, userSettings) {
3757
3701
  return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
3758
3702
  };
3759
3703
 
3760
- /**
3761
- * Returns the number of rendered row headers.
3762
- *
3763
- * @since 13.0.0
3764
- * @memberof Core#
3765
- * @function countRowHeaders
3766
- * @returns {number} Number of row headers.
3767
- */
3768
- this.countRowHeaders = function () {
3769
- return this.view.getRowHeadersCount();
3770
- };
3771
-
3772
- /**
3773
- * Returns the number of rendered column headers.
3774
- *
3775
- * @since 13.0.0
3776
- * @memberof Core#
3777
- * @function countColHeaders
3778
- * @returns {number} Number of column headers.
3779
- */
3780
- this.countColHeaders = function () {
3781
- return this.view.getColumnHeadersCount();
3782
- };
3783
-
3784
3704
  /**
3785
3705
  * Returns the number of empty rows. If the optional ending parameter is `true`, returns the
3786
3706
  * number of empty rows at the bottom of the table.
@@ -3985,10 +3905,6 @@ export default function Core(rootElement, userSettings) {
3985
3905
  * hot.selectColumns('id');
3986
3906
  * // Select range of columns using visual indexes.
3987
3907
  * hot.selectColumns(1, 4);
3988
- * // Select range of columns using visual indexes and mark the first header as highlighted.
3989
- * hot.selectColumns(1, 2, -1);
3990
- * // Select range of columns using visual indexes and mark the second cell as highlighted.
3991
- * hot.selectColumns(2, 1, 1);
3992
3908
  * // Select range of columns using column properties.
3993
3909
  * hot.selectColumns('id', 'last_name');
3994
3910
  * ```
@@ -3999,15 +3915,11 @@ export default function Core(rootElement, userSettings) {
3999
3915
  * @param {number} startColumn The visual column index from which the selection starts.
4000
3916
  * @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
4001
3917
  * is not defined the column defined by `startColumn` will be selected.
4002
- * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
4003
- * The value can take visual row index from -N to N, where negative values
4004
- * point to the headers and positive values point to the cell range.
4005
3918
  * @returns {boolean} `true` if selection was successful, `false` otherwise.
4006
3919
  */
4007
3920
  this.selectColumns = function (startColumn) {
4008
3921
  var endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
4009
- var focusPosition = arguments.length > 2 ? arguments[2] : undefined;
4010
- return selection.selectColumns(startColumn, endColumn, focusPosition);
3922
+ return selection.selectColumns(startColumn, endColumn);
4011
3923
  };
4012
3924
 
4013
3925
  /**
@@ -4017,12 +3929,8 @@ export default function Core(rootElement, userSettings) {
4017
3929
  * ```js
4018
3930
  * // Select row using visual index.
4019
3931
  * hot.selectRows(1);
4020
- * // select a range of rows, using visual indexes.
3932
+ * // Select range of rows using visual indexes.
4021
3933
  * hot.selectRows(1, 4);
4022
- * // select a range of rows, using visual indexes, and mark the header as highlighted.
4023
- * hot.selectRows(1, 2, -1);
4024
- * // Select range of rows using visual indexes and mark the second cell as highlighted.
4025
- * hot.selectRows(2, 1, 1);
4026
3934
  * ```
4027
3935
  *
4028
3936
  * @memberof Core#
@@ -4031,15 +3939,11 @@ export default function Core(rootElement, userSettings) {
4031
3939
  * @param {number} startRow The visual row index from which the selection starts.
4032
3940
  * @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
4033
3941
  * is not defined the row defined by `startRow` will be selected.
4034
- * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
4035
- * The value can take visual column index from -N to N, where negative values
4036
- * point to the headers and positive values point to the cell range.
4037
3942
  * @returns {boolean} `true` if selection was successful, `false` otherwise.
4038
3943
  */
4039
3944
  this.selectRows = function (startRow) {
4040
3945
  var endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
4041
- var focusPosition = arguments.length > 2 ? arguments[2] : undefined;
4042
- return selection.selectRows(startRow, endRow, focusPosition);
3946
+ return selection.selectRows(startRow, endRow);
4043
3947
  };
4044
3948
 
4045
3949
  /**
@@ -4058,16 +3962,9 @@ export default function Core(rootElement, userSettings) {
4058
3962
  * The previous selection is overwritten.
4059
3963
  *
4060
3964
  * ```js
4061
- * // select all cells in the table, including all headers and the corner cell
3965
+ * // select all cells in the table, including all headers
4062
3966
  * hot.selectAll();
4063
3967
  *
4064
- * // select all cells in the table, including row headers but excluding the corner cell
4065
- * hot.selectAll(true, false);
4066
- *
4067
- * // select all cells in the table, including all headers and the corner cell, but move the focus
4068
- * // highlight to position -2, -1
4069
- * hot.selectAll(-2, -1);
4070
- *
4071
3968
  * // select all cells in the table, without headers
4072
3969
  * hot.selectAll(false);
4073
3970
  * ```
@@ -4075,20 +3972,15 @@ export default function Core(rootElement, userSettings) {
4075
3972
  * @since 0.38.2
4076
3973
  * @memberof Core#
4077
3974
  * @function selectAll
4078
- * @param {boolean} [includeRowHeaders=false] `true` If the selection should include the row headers,
4079
- * `false` otherwise.
4080
- * @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
4081
- * headers, `false` otherwise.
4082
- * @param {{row: number, col: number}} [focusPosition] The argument allows changing the cell/header
4083
- * focus position. The value takes an object with a `row` and `col` properties (visual indexes)
4084
- * from -N to N, where negative values point to the headers and positive values point to the cell range.
3975
+ * @param {boolean} [includeHeaders=true] `true`: include all row, column and corner headers.
3976
+ * `false`: don't include any headers.
4085
3977
  */
4086
3978
  this.selectAll = function () {
4087
- var includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4088
- var includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : includeRowHeaders;
4089
- var focusPosition = arguments.length > 2 ? arguments[2] : undefined;
3979
+ var includeHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
3980
+ var includeRowHeaders = includeHeaders && this.hasRowHeaders();
3981
+ var includeColumnHeaders = includeHeaders && this.hasColHeaders();
4090
3982
  preventScrollingToCell = true;
4091
- selection.selectAll(includeRowHeaders, includeColumnHeaders, focusPosition);
3983
+ selection.selectAll(includeRowHeaders, includeColumnHeaders);
4092
3984
  preventScrollingToCell = false;
4093
3985
  };
4094
3986
  var getIndexToScroll = function getIndexToScroll(indexMapper, visualIndex) {
@@ -4492,16 +4384,6 @@ export default function Core(rootElement, userSettings) {
4492
4384
  }
4493
4385
  };
4494
4386
 
4495
- /**
4496
- * Gets the instance of the EditorManager.
4497
- *
4498
- * @private
4499
- * @returns {EditorManager}
4500
- */
4501
- this._getEditorManager = function () {
4502
- return editorManager;
4503
- };
4504
-
4505
4387
  /**
4506
4388
  * Check if currently it is RTL direction.
4507
4389
  *
@@ -4574,11 +4456,284 @@ export default function Core(rootElement, userSettings) {
4574
4456
  this.getShortcutManager = function () {
4575
4457
  return shortcutManager;
4576
4458
  };
4459
+ var gridContext = shortcutManager.addContext('grid');
4460
+ var gridConfig = {
4461
+ runOnlyIf: function runOnlyIf() {
4462
+ return isDefined(instance.getSelected()) && instance.countRenderedRows() > 0 && instance.countRenderedCols() > 0;
4463
+ },
4464
+ group: SHORTCUTS_GROUP
4465
+ };
4466
+ shortcutManager.setActiveContextName('grid');
4467
+ gridContext.addShortcuts([{
4468
+ keys: [['Control/Meta', 'A']],
4469
+ callback: function callback() {
4470
+ instance.selectAll();
4471
+ }
4472
+ }, {
4473
+ keys: [['Control/Meta', 'Enter']],
4474
+ callback: function callback() {
4475
+ var selectedRange = instance.getSelectedRange();
4476
+ var _selectedRange$highli = selectedRange[selectedRange.length - 1].highlight,
4477
+ highlightRow = _selectedRange$highli.row,
4478
+ highlightColumn = _selectedRange$highli.col;
4479
+ var valueToPopulate = instance.getDataAtCell(highlightRow, highlightColumn);
4480
+ var cellValues = new Map();
4481
+ for (var i = 0; i < selectedRange.length; i++) {
4482
+ selectedRange[i].forAll(function (row, column) {
4483
+ if (row >= 0 && column >= 0 && (row !== highlightRow || column !== highlightColumn)) {
4484
+ var _instance$getCellMeta = instance.getCellMeta(row, column),
4485
+ readOnly = _instance$getCellMeta.readOnly;
4486
+ if (!readOnly) {
4487
+ cellValues.set("".concat(row, "x").concat(column), [row, column, valueToPopulate]);
4488
+ }
4489
+ }
4490
+ });
4491
+ }
4492
+ instance.setDataAtCell(Array.from(cellValues.values()));
4493
+ },
4494
+ runOnlyIf: function runOnlyIf() {
4495
+ return instance.getSelectedRangeLast().getCellsCount() > 1;
4496
+ }
4497
+ }, {
4498
+ keys: [['ArrowUp']],
4499
+ callback: function callback() {
4500
+ selection.transformStart(-1, 0);
4501
+ }
4502
+ }, {
4503
+ keys: [['ArrowUp', 'Control/Meta']],
4504
+ captureCtrl: true,
4505
+ callback: function callback() {
4506
+ selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1), instance.getSelectedRangeLast().highlight.col));
4507
+ }
4508
+ }, {
4509
+ keys: [['ArrowUp', 'Shift']],
4510
+ callback: function callback() {
4511
+ selection.transformEnd(-1, 0);
4512
+ }
4513
+ }, {
4514
+ keys: [['ArrowUp', 'Shift', 'Control/Meta']],
4515
+ captureCtrl: true,
4516
+ callback: function callback() {
4517
+ var _instance$getSelected = instance.getSelectedRangeLast(),
4518
+ from = _instance$getSelected.from,
4519
+ to = _instance$getSelected.to;
4520
+ var row = instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1);
4521
+ selection.setRangeStart(from.clone());
4522
+ selection.setRangeEnd(instance._createCellCoords(row, to.col));
4523
+ },
4524
+ runOnlyIf: function runOnlyIf() {
4525
+ return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
4526
+ }
4527
+ }, {
4528
+ keys: [['ArrowDown']],
4529
+ callback: function callback() {
4530
+ selection.transformStart(1, 0);
4531
+ }
4532
+ }, {
4533
+ keys: [['ArrowDown', 'Control/Meta']],
4534
+ captureCtrl: true,
4535
+ callback: function callback() {
4536
+ selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1), instance.getSelectedRangeLast().highlight.col));
4537
+ }
4538
+ }, {
4539
+ keys: [['ArrowDown', 'Shift']],
4540
+ callback: function callback() {
4541
+ selection.transformEnd(1, 0);
4542
+ }
4543
+ }, {
4544
+ keys: [['ArrowDown', 'Shift', 'Control/Meta']],
4545
+ captureCtrl: true,
4546
+ callback: function callback() {
4547
+ var _instance$getSelected2 = instance.getSelectedRangeLast(),
4548
+ from = _instance$getSelected2.from,
4549
+ to = _instance$getSelected2.to;
4550
+ var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1);
4551
+ selection.setRangeStart(from.clone());
4552
+ selection.setRangeEnd(instance._createCellCoords(row, to.col));
4553
+ },
4554
+ runOnlyIf: function runOnlyIf() {
4555
+ return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
4556
+ }
4557
+ }, {
4558
+ keys: [['ArrowLeft']],
4559
+ callback: function callback() {
4560
+ selection.transformStart(0, -1 * instance.getDirectionFactor());
4561
+ }
4562
+ }, {
4563
+ keys: [['ArrowLeft', 'Control/Meta']],
4564
+ captureCtrl: true,
4565
+ callback: function callback() {
4566
+ var _instance$columnIndex;
4567
+ var row = instance.getSelectedRangeLast().highlight.row;
4568
+ var column = (_instance$columnIndex = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
4569
+ selection.setRangeStart(instance._createCellCoords(row, column));
4570
+ }
4571
+ }, {
4572
+ keys: [['ArrowLeft', 'Shift']],
4573
+ callback: function callback() {
4574
+ selection.transformEnd(0, -1 * instance.getDirectionFactor());
4575
+ }
4576
+ }, {
4577
+ keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
4578
+ captureCtrl: true,
4579
+ callback: function callback() {
4580
+ var _instance$columnIndex2;
4581
+ var _instance$getSelected3 = instance.getSelectedRangeLast(),
4582
+ from = _instance$getSelected3.from,
4583
+ to = _instance$getSelected3.to;
4584
+ var column = (_instance$columnIndex2 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex2, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
4585
+ selection.setRangeStart(from.clone());
4586
+ selection.setRangeEnd(instance._createCellCoords(to.row, column));
4587
+ },
4588
+ runOnlyIf: function runOnlyIf() {
4589
+ return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
4590
+ }
4591
+ }, {
4592
+ keys: [['ArrowRight']],
4593
+ callback: function callback() {
4594
+ selection.transformStart(0, instance.getDirectionFactor());
4595
+ }
4596
+ }, {
4597
+ keys: [['ArrowRight', 'Control/Meta']],
4598
+ captureCtrl: true,
4599
+ callback: function callback() {
4600
+ var _instance$columnIndex3;
4601
+ var row = instance.getSelectedRangeLast().highlight.row;
4602
+ var column = (_instance$columnIndex3 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex3, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
4603
+ selection.setRangeStart(instance._createCellCoords(row, column));
4604
+ }
4605
+ }, {
4606
+ keys: [['ArrowRight', 'Shift']],
4607
+ callback: function callback() {
4608
+ selection.transformEnd(0, instance.getDirectionFactor());
4609
+ }
4610
+ }, {
4611
+ keys: [['ArrowRight', 'Shift', 'Control/Meta']],
4612
+ captureCtrl: true,
4613
+ callback: function callback() {
4614
+ var _instance$columnIndex4;
4615
+ var _instance$getSelected4 = instance.getSelectedRangeLast(),
4616
+ from = _instance$getSelected4.from,
4617
+ to = _instance$getSelected4.to;
4618
+ var column = (_instance$columnIndex4 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex4, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
4619
+ selection.setRangeStart(from.clone());
4620
+ selection.setRangeEnd(instance._createCellCoords(to.row, column));
4621
+ },
4622
+ runOnlyIf: function runOnlyIf() {
4623
+ return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
4624
+ }
4625
+ }, {
4626
+ keys: [['Home']],
4627
+ captureCtrl: true,
4628
+ callback: function callback() {
4629
+ var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
4630
+ var row = instance.getSelectedRangeLast().highlight.row;
4631
+ var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
4632
+ selection.setRangeStart(instance._createCellCoords(row, column));
4633
+ },
4634
+ runOnlyIf: function runOnlyIf() {
4635
+ return instance.view.isMainTableNotFullyCoveredByOverlays();
4636
+ }
4637
+ }, {
4638
+ keys: [['Home', 'Shift']],
4639
+ callback: function callback() {
4640
+ selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
4641
+ }
4642
+ }, {
4643
+ keys: [['Home', 'Control/Meta']],
4644
+ captureCtrl: true,
4645
+ callback: function callback() {
4646
+ var fixedRows = parseInt(instance.getSettings().fixedRowsTop, 10);
4647
+ var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
4648
+ var row = instance.rowIndexMapper.getNearestNotHiddenIndex(fixedRows, 1);
4649
+ var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
4650
+ selection.setRangeStart(instance._createCellCoords(row, column));
4651
+ },
4652
+ runOnlyIf: function runOnlyIf() {
4653
+ return instance.view.isMainTableNotFullyCoveredByOverlays();
4654
+ }
4655
+ }, {
4656
+ keys: [['End']],
4657
+ captureCtrl: true,
4658
+ callback: function callback() {
4659
+ selection.setRangeStart(instance._createCellCoords(instance.getSelectedRangeLast().highlight.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
4660
+ },
4661
+ runOnlyIf: function runOnlyIf() {
4662
+ return instance.view.isMainTableNotFullyCoveredByOverlays();
4663
+ }
4664
+ }, {
4665
+ keys: [['End', 'Shift']],
4666
+ callback: function callback() {
4667
+ selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
4668
+ }
4669
+ }, {
4670
+ keys: [['End', 'Control/Meta']],
4671
+ captureCtrl: true,
4672
+ callback: function callback() {
4673
+ var fixedRows = parseInt(instance.getSettings().fixedRowsBottom, 10);
4674
+ var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - fixedRows - 1, -1);
4675
+ var column = instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1);
4676
+ selection.setRangeStart(instance._createCellCoords(row, column));
4677
+ },
4678
+ runOnlyIf: function runOnlyIf() {
4679
+ return instance.view.isMainTableNotFullyCoveredByOverlays();
4680
+ }
4681
+ }, {
4682
+ keys: [['PageUp']],
4683
+ callback: function callback() {
4684
+ selection.transformStart(-instance.countVisibleRows(), 0);
4685
+ }
4686
+ }, {
4687
+ keys: [['PageUp', 'Shift']],
4688
+ callback: function callback() {
4689
+ var _instance$getSelected5 = instance.getSelectedRangeLast(),
4690
+ to = _instance$getSelected5.to;
4691
+ var nextRowIndexToSelect = Math.max(to.row - instance.countVisibleRows(), 0);
4692
+ var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, 1);
4693
+ if (row !== null) {
4694
+ var coords = instance._createCellCoords(row, to.col);
4695
+ var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
4696
+ var nextVerticalScroll = Math.max(coords.row - scrollPadding, 0);
4697
+ selection.setRangeEnd(coords);
4698
+ instance.scrollViewportTo(nextVerticalScroll);
4699
+ }
4700
+ }
4701
+ }, {
4702
+ keys: [['PageDown']],
4703
+ callback: function callback() {
4704
+ selection.transformStart(instance.countVisibleRows(), 0);
4705
+ }
4706
+ }, {
4707
+ keys: [['PageDown', 'Shift']],
4708
+ callback: function callback() {
4709
+ var _instance$getSelected6 = instance.getSelectedRangeLast(),
4710
+ to = _instance$getSelected6.to;
4711
+ var nextRowIndexToSelect = Math.min(to.row + instance.countVisibleRows(), instance.countRows() - 1);
4712
+ var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, -1);
4713
+ if (row !== null) {
4714
+ var coords = instance._createCellCoords(row, to.col);
4715
+ var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
4716
+ var nextVerticalScroll = Math.min(coords.row - scrollPadding, instance.countRows() - 1);
4717
+ selection.setRangeEnd(coords);
4718
+ instance.scrollViewportTo(nextVerticalScroll);
4719
+ }
4720
+ }
4721
+ }, {
4722
+ keys: [['Tab']],
4723
+ callback: function callback(event) {
4724
+ var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
4725
+ selection.transformStart(tabMoves.row, tabMoves.col, true);
4726
+ }
4727
+ }, {
4728
+ keys: [['Shift', 'Tab']],
4729
+ callback: function callback(event) {
4730
+ var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
4731
+ selection.transformStart(-tabMoves.row, -tabMoves.col);
4732
+ }
4733
+ }], gridConfig);
4577
4734
  getPluginsNames().forEach(function (pluginName) {
4578
4735
  var PluginClass = getPlugin(pluginName);
4579
4736
  pluginsRegistry.addItem(pluginName, new PluginClass(_this));
4580
4737
  });
4581
- registerAllShortcutContexts(instance);
4582
- shortcutManager.setActiveContextName('grid');
4583
4738
  Hooks.getSingleton().run(instance, 'construct');
4584
4739
  }