handsontable 0.0.0-next-93e34dc-20230601 → 0.0.0-next-b7cca45-20230605

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 (216) 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 +354 -0
  28. package/3rdparty/walkontable/src/selection.mjs +348 -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/core.d.ts +3 -5
  44. package/core.js +300 -82
  45. package/core.mjs +300 -82
  46. package/dataMap/metaManager/metaSchema.js +0 -15
  47. package/dataMap/metaManager/metaSchema.mjs +0 -15
  48. package/dist/handsontable.css +3 -8
  49. package/dist/handsontable.full.css +3 -8
  50. package/dist/handsontable.full.js +9926 -12218
  51. package/dist/handsontable.full.min.css +3 -3
  52. package/dist/handsontable.full.min.js +120 -120
  53. package/dist/handsontable.js +14628 -16920
  54. package/dist/handsontable.min.css +3 -3
  55. package/dist/handsontable.min.js +4 -4
  56. package/editorManager.js +82 -20
  57. package/editorManager.mjs +86 -25
  58. package/editors/textEditor/textEditor.js +11 -3
  59. package/editors/textEditor/textEditor.mjs +12 -4
  60. package/helpers/mixed.js +1 -1
  61. package/helpers/mixed.mjs +1 -1
  62. package/helpers/number.d.ts +0 -1
  63. package/helpers/number.js +0 -18
  64. package/helpers/number.mjs +0 -17
  65. package/package.json +1 -1
  66. package/pluginHooks.js +1 -1
  67. package/pluginHooks.mjs +1 -1
  68. package/plugins/copyPaste/copyPaste.js +1 -5
  69. package/plugins/copyPaste/copyPaste.mjs +1 -5
  70. package/plugins/customBorders/customBorders.js +52 -18
  71. package/plugins/customBorders/customBorders.mjs +53 -19
  72. package/plugins/mergeCells/mergeCells.js +18 -5
  73. package/plugins/mergeCells/mergeCells.mjs +18 -5
  74. package/plugins/nestedHeaders/nestedHeaders.js +9 -89
  75. package/plugins/nestedHeaders/nestedHeaders.mjs +9 -89
  76. package/plugins/nestedHeaders/stateManager/index.js +0 -37
  77. package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
  78. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  79. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  80. package/selection/highlight/constants.js +16 -0
  81. package/selection/highlight/constants.mjs +6 -0
  82. package/selection/highlight/highlight.js +88 -311
  83. package/selection/highlight/highlight.mjs +84 -301
  84. package/selection/highlight/types/activeHeader.js +9 -10
  85. package/selection/highlight/types/activeHeader.mjs +8 -10
  86. package/selection/highlight/types/area.js +27 -12
  87. package/selection/highlight/types/area.mjs +30 -16
  88. package/selection/highlight/types/{focus.js → cell.js} +8 -5
  89. package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
  90. package/selection/highlight/types/customSelection.js +10 -7
  91. package/selection/highlight/types/customSelection.mjs +9 -7
  92. package/selection/highlight/types/fill.js +8 -5
  93. package/selection/highlight/types/fill.mjs +7 -5
  94. package/selection/highlight/types/header.js +20 -10
  95. package/selection/highlight/types/header.mjs +19 -10
  96. package/selection/highlight/types/{row.js → index.js} +31 -27
  97. package/selection/highlight/types/{row.mjs → index.mjs} +29 -24
  98. package/selection/highlight/visualSelection.js +28 -23
  99. package/selection/highlight/visualSelection.mjs +28 -23
  100. package/selection/index.js +7 -4
  101. package/selection/index.mjs +3 -2
  102. package/selection/mouseEventHandler.js +1 -1
  103. package/selection/mouseEventHandler.mjs +1 -1
  104. package/selection/range.js +8 -8
  105. package/selection/range.mjs +8 -8
  106. package/selection/selection.js +180 -296
  107. package/selection/selection.mjs +179 -291
  108. package/selection/transformation.js +96 -233
  109. package/selection/transformation.mjs +93 -230
  110. package/selection/utils.js +35 -12
  111. package/selection/utils.mjs +35 -13
  112. package/settings.d.ts +0 -1
  113. package/tableView.js +9 -58
  114. package/tableView.mjs +9 -58
  115. package/3rdparty/walkontable/src/selection/border/constants.js +0 -18
  116. package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -13
  117. package/3rdparty/walkontable/src/selection/constants.js +0 -63
  118. package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
  119. package/3rdparty/walkontable/src/selection/index.js +0 -30
  120. package/3rdparty/walkontable/src/selection/index.mjs +0 -5
  121. package/3rdparty/walkontable/src/selection/manager.js +0 -328
  122. package/3rdparty/walkontable/src/selection/manager.mjs +0 -322
  123. package/3rdparty/walkontable/src/selection/scanner.js +0 -363
  124. package/3rdparty/walkontable/src/selection/scanner.mjs +0 -359
  125. package/3rdparty/walkontable/src/selection/selection.js +0 -133
  126. package/3rdparty/walkontable/src/selection/selection.mjs +0 -127
  127. package/selection/highlight/types/areaLayered.js +0 -54
  128. package/selection/highlight/types/areaLayered.mjs +0 -49
  129. package/selection/highlight/types/column.js +0 -50
  130. package/selection/highlight/types/column.mjs +0 -45
  131. package/shortcutContexts/commands/editor/closeAndSave.js +0 -15
  132. package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -10
  133. package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -13
  134. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
  135. package/shortcutContexts/commands/editor/fastOpen.js +0 -16
  136. package/shortcutContexts/commands/editor/fastOpen.mjs +0 -11
  137. package/shortcutContexts/commands/editor/index.js +0 -16
  138. package/shortcutContexts/commands/editor/index.mjs +0 -12
  139. package/shortcutContexts/commands/editor/open.js +0 -29
  140. package/shortcutContexts/commands/editor/open.mjs +0 -24
  141. package/shortcutContexts/commands/emptySelectedCells.js +0 -12
  142. package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
  143. package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
  144. package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -10
  145. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -21
  146. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -16
  147. package/shortcutContexts/commands/extendCellsSelection/index.js +0 -24
  148. package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -20
  149. package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
  150. package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -10
  151. package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
  152. package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -10
  153. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -22
  154. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -17
  155. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -17
  156. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -12
  157. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -17
  158. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -12
  159. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -39
  160. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -34
  161. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -39
  162. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -34
  163. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -22
  164. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -17
  165. package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
  166. package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -10
  167. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -21
  168. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -16
  169. package/shortcutContexts/commands/index.js +0 -51
  170. package/shortcutContexts/commands/index.mjs +0 -47
  171. package/shortcutContexts/commands/moveCellSelection/down.js +0 -12
  172. package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -7
  173. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -11
  174. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -6
  175. package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
  176. package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
  177. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -13
  178. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
  179. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -13
  180. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
  181. package/shortcutContexts/commands/moveCellSelection/left.js +0 -11
  182. package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
  183. package/shortcutContexts/commands/moveCellSelection/right.js +0 -11
  184. package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
  185. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -16
  186. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -11
  187. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -17
  188. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -12
  189. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -13
  190. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -8
  191. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -16
  192. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -11
  193. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -35
  194. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -30
  195. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -35
  196. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -30
  197. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -16
  198. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -11
  199. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -18
  200. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -13
  201. package/shortcutContexts/commands/moveCellSelection/up.js +0 -12
  202. package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -7
  203. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -11
  204. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -6
  205. package/shortcutContexts/commands/populateSelectedCellsData.js +0 -35
  206. package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -30
  207. package/shortcutContexts/commands/selectAll.js +0 -11
  208. package/shortcutContexts/commands/selectAll.mjs +0 -6
  209. package/shortcutContexts/constants.js +0 -19
  210. package/shortcutContexts/constants.mjs +0 -12
  211. package/shortcutContexts/editor.js +0 -29
  212. package/shortcutContexts/editor.mjs +0 -25
  213. package/shortcutContexts/grid.js +0 -232
  214. package/shortcutContexts/grid.mjs +0 -228
  215. package/shortcutContexts/index.js +0 -29
  216. package/shortcutContexts/index.mjs +0 -15
package/core.js CHANGED
@@ -29,6 +29,7 @@ require("core-js/modules/es.array.reverse.js");
29
29
  require("core-js/modules/web.dom-collections.for-each.js");
30
30
  require("core-js/modules/web.timers.js");
31
31
  require("core-js/modules/web.immediate.js");
32
+ require("core-js/modules/es.map.js");
32
33
  var _element = require("./helpers/dom/element");
33
34
  var _function = require("./helpers/function");
34
35
  var _mixed = require("./helpers/mixed");
@@ -59,7 +60,6 @@ var _selection = require("./selection");
59
60
  var _dataMap = require("./dataMap");
60
61
  var _uniqueMap = require("./utils/dataStructures/uniqueMap");
61
62
  var _shortcuts = require("./shortcuts");
62
- var _shortcutContexts = require("./shortcutContexts");
63
63
  var _templateObject, _templateObject2;
64
64
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
65
65
  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); }
@@ -74,6 +74,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
74
74
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
75
75
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
76
76
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
77
+ var SHORTCUTS_GROUP = 'gridDefault';
77
78
  var activeGuid = null;
78
79
  var deprecationWarns = new Set();
79
80
 
@@ -290,8 +291,12 @@ function Core(rootElement, userSettings) {
290
291
  };
291
292
 
292
293
  var selection = new _selection.Selection(tableMeta, {
293
- rowIndexMapper: instance.rowIndexMapper,
294
- columnIndexMapper: instance.columnIndexMapper,
294
+ rowIndexMapper: function rowIndexMapper() {
295
+ return instance.rowIndexMapper;
296
+ },
297
+ columnIndexMapper: function columnIndexMapper() {
298
+ return instance.columnIndexMapper;
299
+ },
295
300
  countCols: function countCols() {
296
301
  return instance.countCols();
297
302
  },
@@ -304,18 +309,12 @@ function Core(rootElement, userSettings) {
304
309
  isEditorOpened: function isEditorOpened() {
305
310
  return instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false;
306
311
  },
307
- countRenderableColumns: function countRenderableColumns() {
312
+ countColsTranslated: function countColsTranslated() {
308
313
  return _this.view.countRenderableColumns();
309
314
  },
310
- countRenderableRows: function countRenderableRows() {
315
+ countRowsTranslated: function countRowsTranslated() {
311
316
  return _this.view.countRenderableRows();
312
317
  },
313
- countRowHeaders: function countRowHeaders() {
314
- return _this.countRowHeaders();
315
- },
316
- countColHeaders: function countColHeaders() {
317
- return _this.countColHeaders();
318
- },
319
318
  getShortcutManager: function getShortcutManager() {
320
319
  return instance.getShortcutManager();
321
320
  },
@@ -348,6 +347,12 @@ function Core(rootElement, userSettings) {
348
347
  });
349
348
  this.selection.addLocalHook('beforeSetRangeEnd', function (cellCoords) {
350
349
  _this.runHooks('beforeSetRangeEnd', cellCoords);
350
+ if (cellCoords.row < 0) {
351
+ cellCoords.row = _this.view._wt.wtTable.getFirstVisibleRow();
352
+ }
353
+ if (cellCoords.col < 0) {
354
+ cellCoords.col = _this.view._wt.wtTable.getFirstVisibleColumn();
355
+ }
351
356
  });
352
357
  this.selection.addLocalHook('afterSetRangeEnd', function (cellCoords) {
353
358
  var preventScrolling = (0, _object.createObjectPropListener)(false);
@@ -373,14 +378,7 @@ function Core(rootElement, userSettings) {
373
378
  if (scrollToCell !== false) {
374
379
  if (!isSelectedByAnyHeader) {
375
380
  if (currentSelectedRange && !_this.selection.isMultiple()) {
376
- var renderableCoords = visualToRenderableCoords(currentSelectedRange.from);
377
- if (renderableCoords.row < 0 && renderableCoords.col >= 0) {
378
- _this.view.scrollViewportHorizontally(renderableCoords.col);
379
- } else if (renderableCoords.col < 0 && renderableCoords.row >= 0) {
380
- _this.view.scrollViewportVertically(renderableCoords.row);
381
- } else {
382
- _this.view.scrollViewport(renderableCoords);
383
- }
381
+ _this.view.scrollViewport(visualToRenderableCoords(currentSelectedRange.from));
384
382
  } else {
385
383
  _this.view.scrollViewport(visualToRenderableCoords(cellCoords));
386
384
  }
@@ -3734,30 +3732,6 @@ function Core(rootElement, userSettings) {
3734
3732
  return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
3735
3733
  };
3736
3734
 
3737
- /**
3738
- * Returns the number of rendered row headers.
3739
- *
3740
- * @since 13.0.0
3741
- * @memberof Core#
3742
- * @function countRowHeaders
3743
- * @returns {number} Number of row headers.
3744
- */
3745
- this.countRowHeaders = function () {
3746
- return this.view.getRowHeadersCount();
3747
- };
3748
-
3749
- /**
3750
- * Returns the number of rendered column headers.
3751
- *
3752
- * @since 13.0.0
3753
- * @memberof Core#
3754
- * @function countColHeaders
3755
- * @returns {number} Number of column headers.
3756
- */
3757
- this.countColHeaders = function () {
3758
- return this.view.getColumnHeadersCount();
3759
- };
3760
-
3761
3735
  /**
3762
3736
  * Returns the number of empty rows. If the optional ending parameter is `true`, returns the
3763
3737
  * number of empty rows at the bottom of the table.
@@ -3962,8 +3936,6 @@ function Core(rootElement, userSettings) {
3962
3936
  * hot.selectColumns('id');
3963
3937
  * // Select range of columns using visual indexes.
3964
3938
  * hot.selectColumns(1, 4);
3965
- * // Select range of columns using visual indexes and mark the header as highlighted.
3966
- * hot.selectColumns(1, 2, -1);
3967
3939
  * // Select range of columns using column properties.
3968
3940
  * hot.selectColumns('id', 'last_name');
3969
3941
  * ```
@@ -3974,15 +3946,11 @@ function Core(rootElement, userSettings) {
3974
3946
  * @param {number} startColumn The visual column index from which the selection starts.
3975
3947
  * @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
3976
3948
  * is not defined the column defined by `startColumn` will be selected.
3977
- * @param {number} [headerLevel=0] The header level allows changing the cell/header highlight position. The value can
3978
- * take 0 to -N, where 0 means highlighting the cell nearest the column header, -1
3979
- * means the highlighting header starting from the header closest to the cells.
3980
3949
  * @returns {boolean} `true` if selection was successful, `false` otherwise.
3981
3950
  */
3982
3951
  this.selectColumns = function (startColumn) {
3983
3952
  var endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
3984
- var headerLevel = arguments.length > 2 ? arguments[2] : undefined;
3985
- return selection.selectColumns(startColumn, endColumn, headerLevel);
3953
+ return selection.selectColumns(startColumn, endColumn);
3986
3954
  };
3987
3955
 
3988
3956
  /**
@@ -3994,8 +3962,6 @@ function Core(rootElement, userSettings) {
3994
3962
  * hot.selectRows(1);
3995
3963
  * // Select range of rows using visual indexes.
3996
3964
  * hot.selectRows(1, 4);
3997
- * // Select range of rows using visual indexes and mark the header as highlighted.
3998
- * hot.selectRows(1, 2, -1);
3999
3965
  * ```
4000
3966
  *
4001
3967
  * @memberof Core#
@@ -4004,15 +3970,11 @@ function Core(rootElement, userSettings) {
4004
3970
  * @param {number} startRow The visual row index from which the selection starts.
4005
3971
  * @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
4006
3972
  * is not defined the row defined by `startRow` will be selected.
4007
- * @param {number} [headerLevel=0] The header level allows changing the cell/header highlight position. The value can
4008
- * take 0 to -N, where 0 means highlighting the cell nearest the row header, -1
4009
- * means the highlighting header starting from the header closest to the cells.
4010
3973
  * @returns {boolean} `true` if selection was successful, `false` otherwise.
4011
3974
  */
4012
3975
  this.selectRows = function (startRow) {
4013
3976
  var endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
4014
- var headerLevel = arguments.length > 2 ? arguments[2] : undefined;
4015
- return selection.selectRows(startRow, endRow, headerLevel);
3977
+ return selection.selectRows(startRow, endRow);
4016
3978
  };
4017
3979
 
4018
3980
  /**
@@ -4031,16 +3993,9 @@ function Core(rootElement, userSettings) {
4031
3993
  * The previous selection is overwritten.
4032
3994
  *
4033
3995
  * ```js
4034
- * // select all cells in the table, including all headers with corner
3996
+ * // select all cells in the table, including all headers
4035
3997
  * hot.selectAll();
4036
3998
  *
4037
- * // select all cells in the table, including row headers without corner
4038
- * hot.selectAll(true, false);
4039
- *
4040
- * // select all cells in the table, including all headers with corner but move the focus
4041
- * // highlight to position -2,-1
4042
- * hot.selectAll(-2, -1);
4043
- *
4044
3999
  * // select all cells in the table, without headers
4045
4000
  * hot.selectAll(false);
4046
4001
  * ```
@@ -4048,15 +4003,15 @@ function Core(rootElement, userSettings) {
4048
4003
  * @since 0.38.2
4049
4004
  * @memberof Core#
4050
4005
  * @function selectAll
4051
- * @param {boolean|number} [rowHeaderLevel=true] `true`: include all row headers.
4052
- * @param {boolean|number} [columnHeaderLevel=true] `true`: include all column headers.
4006
+ * @param {boolean} [includeHeaders=true] `true`: include all row, column and corner headers.
4053
4007
  * `false`: don't include any headers.
4054
4008
  */
4055
4009
  this.selectAll = function () {
4056
- var rowHeaderLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4057
- var columnHeaderLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : rowHeaderLevel;
4010
+ var includeHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
4011
+ var includeRowHeaders = includeHeaders && this.hasRowHeaders();
4012
+ var includeColumnHeaders = includeHeaders && this.hasColHeaders();
4058
4013
  preventScrollingToCell = true;
4059
- selection.selectAll(rowHeaderLevel, columnHeaderLevel);
4014
+ selection.selectAll(includeRowHeaders, includeColumnHeaders);
4060
4015
  preventScrollingToCell = false;
4061
4016
  };
4062
4017
  var getIndexToScroll = function getIndexToScroll(indexMapper, visualIndex) {
@@ -4460,16 +4415,6 @@ function Core(rootElement, userSettings) {
4460
4415
  }
4461
4416
  };
4462
4417
 
4463
- /**
4464
- * Gets the instance of the EditorManager.
4465
- *
4466
- * @private
4467
- * @returns {EditorManager}
4468
- */
4469
- this._getEditorManager = function () {
4470
- return editorManager;
4471
- };
4472
-
4473
4418
  /**
4474
4419
  * Check if currently it is RTL direction.
4475
4420
  *
@@ -4542,11 +4487,284 @@ function Core(rootElement, userSettings) {
4542
4487
  this.getShortcutManager = function () {
4543
4488
  return shortcutManager;
4544
4489
  };
4490
+ var gridContext = shortcutManager.addContext('grid');
4491
+ var gridConfig = {
4492
+ runOnlyIf: function runOnlyIf() {
4493
+ return (0, _mixed.isDefined)(instance.getSelected()) && instance.countRenderedRows() > 0 && instance.countRenderedCols() > 0;
4494
+ },
4495
+ group: SHORTCUTS_GROUP
4496
+ };
4497
+ shortcutManager.setActiveContextName('grid');
4498
+ gridContext.addShortcuts([{
4499
+ keys: [['Control/Meta', 'A']],
4500
+ callback: function callback() {
4501
+ instance.selectAll();
4502
+ }
4503
+ }, {
4504
+ keys: [['Control/Meta', 'Enter']],
4505
+ callback: function callback() {
4506
+ var selectedRange = instance.getSelectedRange();
4507
+ var _selectedRange$highli = selectedRange[selectedRange.length - 1].highlight,
4508
+ highlightRow = _selectedRange$highli.row,
4509
+ highlightColumn = _selectedRange$highli.col;
4510
+ var valueToPopulate = instance.getDataAtCell(highlightRow, highlightColumn);
4511
+ var cellValues = new Map();
4512
+ for (var i = 0; i < selectedRange.length; i++) {
4513
+ selectedRange[i].forAll(function (row, column) {
4514
+ if (row >= 0 && column >= 0 && (row !== highlightRow || column !== highlightColumn)) {
4515
+ var _instance$getCellMeta = instance.getCellMeta(row, column),
4516
+ readOnly = _instance$getCellMeta.readOnly;
4517
+ if (!readOnly) {
4518
+ cellValues.set("".concat(row, "x").concat(column), [row, column, valueToPopulate]);
4519
+ }
4520
+ }
4521
+ });
4522
+ }
4523
+ instance.setDataAtCell(Array.from(cellValues.values()));
4524
+ },
4525
+ runOnlyIf: function runOnlyIf() {
4526
+ return instance.getSelectedRangeLast().getCellsCount() > 1;
4527
+ }
4528
+ }, {
4529
+ keys: [['ArrowUp']],
4530
+ callback: function callback() {
4531
+ selection.transformStart(-1, 0);
4532
+ }
4533
+ }, {
4534
+ keys: [['ArrowUp', 'Control/Meta']],
4535
+ captureCtrl: true,
4536
+ callback: function callback() {
4537
+ selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1), instance.getSelectedRangeLast().highlight.col));
4538
+ }
4539
+ }, {
4540
+ keys: [['ArrowUp', 'Shift']],
4541
+ callback: function callback() {
4542
+ selection.transformEnd(-1, 0);
4543
+ }
4544
+ }, {
4545
+ keys: [['ArrowUp', 'Shift', 'Control/Meta']],
4546
+ captureCtrl: true,
4547
+ callback: function callback() {
4548
+ var _instance$getSelected = instance.getSelectedRangeLast(),
4549
+ from = _instance$getSelected.from,
4550
+ to = _instance$getSelected.to;
4551
+ var row = instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1);
4552
+ selection.setRangeStart(from.clone());
4553
+ selection.setRangeEnd(instance._createCellCoords(row, to.col));
4554
+ },
4555
+ runOnlyIf: function runOnlyIf() {
4556
+ return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
4557
+ }
4558
+ }, {
4559
+ keys: [['ArrowDown']],
4560
+ callback: function callback() {
4561
+ selection.transformStart(1, 0);
4562
+ }
4563
+ }, {
4564
+ keys: [['ArrowDown', 'Control/Meta']],
4565
+ captureCtrl: true,
4566
+ callback: function callback() {
4567
+ selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1), instance.getSelectedRangeLast().highlight.col));
4568
+ }
4569
+ }, {
4570
+ keys: [['ArrowDown', 'Shift']],
4571
+ callback: function callback() {
4572
+ selection.transformEnd(1, 0);
4573
+ }
4574
+ }, {
4575
+ keys: [['ArrowDown', 'Shift', 'Control/Meta']],
4576
+ captureCtrl: true,
4577
+ callback: function callback() {
4578
+ var _instance$getSelected2 = instance.getSelectedRangeLast(),
4579
+ from = _instance$getSelected2.from,
4580
+ to = _instance$getSelected2.to;
4581
+ var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1);
4582
+ selection.setRangeStart(from.clone());
4583
+ selection.setRangeEnd(instance._createCellCoords(row, to.col));
4584
+ },
4585
+ runOnlyIf: function runOnlyIf() {
4586
+ return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
4587
+ }
4588
+ }, {
4589
+ keys: [['ArrowLeft']],
4590
+ callback: function callback() {
4591
+ selection.transformStart(0, -1 * instance.getDirectionFactor());
4592
+ }
4593
+ }, {
4594
+ keys: [['ArrowLeft', 'Control/Meta']],
4595
+ captureCtrl: true,
4596
+ callback: function callback() {
4597
+ var _instance$columnIndex;
4598
+ var row = instance.getSelectedRangeLast().highlight.row;
4599
+ var column = (_instance$columnIndex = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
4600
+ selection.setRangeStart(instance._createCellCoords(row, column));
4601
+ }
4602
+ }, {
4603
+ keys: [['ArrowLeft', 'Shift']],
4604
+ callback: function callback() {
4605
+ selection.transformEnd(0, -1 * instance.getDirectionFactor());
4606
+ }
4607
+ }, {
4608
+ keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
4609
+ captureCtrl: true,
4610
+ callback: function callback() {
4611
+ var _instance$columnIndex2;
4612
+ var _instance$getSelected3 = instance.getSelectedRangeLast(),
4613
+ from = _instance$getSelected3.from,
4614
+ to = _instance$getSelected3.to;
4615
+ var column = (_instance$columnIndex2 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex2, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
4616
+ selection.setRangeStart(from.clone());
4617
+ selection.setRangeEnd(instance._createCellCoords(to.row, column));
4618
+ },
4619
+ runOnlyIf: function runOnlyIf() {
4620
+ return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
4621
+ }
4622
+ }, {
4623
+ keys: [['ArrowRight']],
4624
+ callback: function callback() {
4625
+ selection.transformStart(0, instance.getDirectionFactor());
4626
+ }
4627
+ }, {
4628
+ keys: [['ArrowRight', 'Control/Meta']],
4629
+ captureCtrl: true,
4630
+ callback: function callback() {
4631
+ var _instance$columnIndex3;
4632
+ var row = instance.getSelectedRangeLast().highlight.row;
4633
+ var column = (_instance$columnIndex3 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex3, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
4634
+ selection.setRangeStart(instance._createCellCoords(row, column));
4635
+ }
4636
+ }, {
4637
+ keys: [['ArrowRight', 'Shift']],
4638
+ callback: function callback() {
4639
+ selection.transformEnd(0, instance.getDirectionFactor());
4640
+ }
4641
+ }, {
4642
+ keys: [['ArrowRight', 'Shift', 'Control/Meta']],
4643
+ captureCtrl: true,
4644
+ callback: function callback() {
4645
+ var _instance$columnIndex4;
4646
+ var _instance$getSelected4 = instance.getSelectedRangeLast(),
4647
+ from = _instance$getSelected4.from,
4648
+ to = _instance$getSelected4.to;
4649
+ var column = (_instance$columnIndex4 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex4, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
4650
+ selection.setRangeStart(from.clone());
4651
+ selection.setRangeEnd(instance._createCellCoords(to.row, column));
4652
+ },
4653
+ runOnlyIf: function runOnlyIf() {
4654
+ return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
4655
+ }
4656
+ }, {
4657
+ keys: [['Home']],
4658
+ captureCtrl: true,
4659
+ callback: function callback() {
4660
+ var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
4661
+ var row = instance.getSelectedRangeLast().highlight.row;
4662
+ var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
4663
+ selection.setRangeStart(instance._createCellCoords(row, column));
4664
+ },
4665
+ runOnlyIf: function runOnlyIf() {
4666
+ return instance.view.isMainTableNotFullyCoveredByOverlays();
4667
+ }
4668
+ }, {
4669
+ keys: [['Home', 'Shift']],
4670
+ callback: function callback() {
4671
+ selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
4672
+ }
4673
+ }, {
4674
+ keys: [['Home', 'Control/Meta']],
4675
+ captureCtrl: true,
4676
+ callback: function callback() {
4677
+ var fixedRows = parseInt(instance.getSettings().fixedRowsTop, 10);
4678
+ var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
4679
+ var row = instance.rowIndexMapper.getNearestNotHiddenIndex(fixedRows, 1);
4680
+ var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
4681
+ selection.setRangeStart(instance._createCellCoords(row, column));
4682
+ },
4683
+ runOnlyIf: function runOnlyIf() {
4684
+ return instance.view.isMainTableNotFullyCoveredByOverlays();
4685
+ }
4686
+ }, {
4687
+ keys: [['End']],
4688
+ captureCtrl: true,
4689
+ callback: function callback() {
4690
+ selection.setRangeStart(instance._createCellCoords(instance.getSelectedRangeLast().highlight.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
4691
+ },
4692
+ runOnlyIf: function runOnlyIf() {
4693
+ return instance.view.isMainTableNotFullyCoveredByOverlays();
4694
+ }
4695
+ }, {
4696
+ keys: [['End', 'Shift']],
4697
+ callback: function callback() {
4698
+ selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
4699
+ }
4700
+ }, {
4701
+ keys: [['End', 'Control/Meta']],
4702
+ captureCtrl: true,
4703
+ callback: function callback() {
4704
+ var fixedRows = parseInt(instance.getSettings().fixedRowsBottom, 10);
4705
+ var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - fixedRows - 1, -1);
4706
+ var column = instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1);
4707
+ selection.setRangeStart(instance._createCellCoords(row, column));
4708
+ },
4709
+ runOnlyIf: function runOnlyIf() {
4710
+ return instance.view.isMainTableNotFullyCoveredByOverlays();
4711
+ }
4712
+ }, {
4713
+ keys: [['PageUp']],
4714
+ callback: function callback() {
4715
+ selection.transformStart(-instance.countVisibleRows(), 0);
4716
+ }
4717
+ }, {
4718
+ keys: [['PageUp', 'Shift']],
4719
+ callback: function callback() {
4720
+ var _instance$getSelected5 = instance.getSelectedRangeLast(),
4721
+ to = _instance$getSelected5.to;
4722
+ var nextRowIndexToSelect = Math.max(to.row - instance.countVisibleRows(), 0);
4723
+ var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, 1);
4724
+ if (row !== null) {
4725
+ var coords = instance._createCellCoords(row, to.col);
4726
+ var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
4727
+ var nextVerticalScroll = Math.max(coords.row - scrollPadding, 0);
4728
+ selection.setRangeEnd(coords);
4729
+ instance.scrollViewportTo(nextVerticalScroll);
4730
+ }
4731
+ }
4732
+ }, {
4733
+ keys: [['PageDown']],
4734
+ callback: function callback() {
4735
+ selection.transformStart(instance.countVisibleRows(), 0);
4736
+ }
4737
+ }, {
4738
+ keys: [['PageDown', 'Shift']],
4739
+ callback: function callback() {
4740
+ var _instance$getSelected6 = instance.getSelectedRangeLast(),
4741
+ to = _instance$getSelected6.to;
4742
+ var nextRowIndexToSelect = Math.min(to.row + instance.countVisibleRows(), instance.countRows() - 1);
4743
+ var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, -1);
4744
+ if (row !== null) {
4745
+ var coords = instance._createCellCoords(row, to.col);
4746
+ var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
4747
+ var nextVerticalScroll = Math.min(coords.row - scrollPadding, instance.countRows() - 1);
4748
+ selection.setRangeEnd(coords);
4749
+ instance.scrollViewportTo(nextVerticalScroll);
4750
+ }
4751
+ }
4752
+ }, {
4753
+ keys: [['Tab']],
4754
+ callback: function callback(event) {
4755
+ var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
4756
+ selection.transformStart(tabMoves.row, tabMoves.col, true);
4757
+ }
4758
+ }, {
4759
+ keys: [['Shift', 'Tab']],
4760
+ callback: function callback(event) {
4761
+ var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
4762
+ selection.transformStart(-tabMoves.row, -tabMoves.col);
4763
+ }
4764
+ }], gridConfig);
4545
4765
  (0, _registry.getPluginsNames)().forEach(function (pluginName) {
4546
4766
  var PluginClass = (0, _registry.getPlugin)(pluginName);
4547
4767
  pluginsRegistry.addItem(pluginName, new PluginClass(_this));
4548
4768
  });
4549
- (0, _shortcutContexts.registerAllShortcutContexts)(instance);
4550
- shortcutManager.setActiveContextName('grid');
4551
4769
  _pluginHooks.default.getSingleton().run(instance, 'construct');
4552
4770
  }