handsontable 0.0.0-next-e5dbebc-20240319 → 0.0.0-next-923e108-20240319

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

Files changed (98) hide show
  1. package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
  2. package/3rdparty/walkontable/src/cell/range.js +5 -22
  3. package/3rdparty/walkontable/src/cell/range.mjs +5 -22
  4. package/base.js +2 -2
  5. package/base.mjs +2 -2
  6. package/core/viewportScroll/index.js +1 -4
  7. package/core/viewportScroll/index.mjs +1 -4
  8. package/core.d.ts +3 -4
  9. package/core.js +21 -76
  10. package/core.mjs +21 -76
  11. package/dist/handsontable.css +2 -2
  12. package/dist/handsontable.full.css +2 -2
  13. package/dist/handsontable.full.js +1357 -2619
  14. package/dist/handsontable.full.min.css +2 -2
  15. package/dist/handsontable.full.min.js +71 -71
  16. package/dist/handsontable.js +1361 -2623
  17. package/dist/handsontable.min.css +2 -2
  18. package/dist/handsontable.min.js +19 -19
  19. package/editorManager.js +8 -12
  20. package/editorManager.mjs +8 -12
  21. package/focusManager.js +1 -7
  22. package/focusManager.mjs +1 -7
  23. package/helpers/mixed.js +1 -1
  24. package/helpers/mixed.mjs +1 -1
  25. package/package.json +1 -1
  26. package/pluginHooks.d.ts +0 -4
  27. package/pluginHooks.js +1 -69
  28. package/pluginHooks.mjs +1 -69
  29. package/plugins/collapsibleColumns/collapsibleColumns.js +3 -9
  30. package/plugins/collapsibleColumns/collapsibleColumns.mjs +3 -9
  31. package/plugins/columnSorting/columnSorting.js +2 -8
  32. package/plugins/columnSorting/columnSorting.mjs +2 -8
  33. package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
  34. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
  35. package/plugins/mergeCells/calculations/selection.js +70 -1
  36. package/plugins/mergeCells/calculations/selection.mjs +70 -1
  37. package/plugins/mergeCells/cellsCollection.js +0 -116
  38. package/plugins/mergeCells/cellsCollection.mjs +0 -116
  39. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
  40. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
  41. package/plugins/mergeCells/mergeCells.js +196 -337
  42. package/plugins/mergeCells/mergeCells.mjs +196 -337
  43. package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
  44. package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
  45. package/plugins/nestedHeaders/nestedHeaders.js +0 -1
  46. package/plugins/nestedHeaders/nestedHeaders.mjs +0 -1
  47. package/plugins/nestedRows/nestedRows.js +3 -9
  48. package/plugins/nestedRows/nestedRows.mjs +3 -9
  49. package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
  50. package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
  51. package/selection/highlight/visualSelection.js +0 -2
  52. package/selection/highlight/visualSelection.mjs +0 -2
  53. package/selection/selection.js +40 -209
  54. package/selection/selection.mjs +39 -208
  55. package/selection/transformation.js +32 -83
  56. package/selection/transformation.mjs +32 -83
  57. package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
  58. package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
  59. package/shortcutContexts/commands/editor/open.js +3 -18
  60. package/shortcutContexts/commands/editor/open.mjs +3 -18
  61. package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
  62. package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
  63. package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
  64. package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
  65. package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
  66. package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
  67. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
  68. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
  69. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
  70. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
  71. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
  72. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
  73. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
  74. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
  75. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
  76. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
  77. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
  78. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
  79. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
  80. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
  81. package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
  82. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
  83. package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
  84. package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
  85. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
  86. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
  87. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
  88. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
  89. package/shortcutContexts/grid.js +2 -2
  90. package/shortcutContexts/grid.mjs +2 -2
  91. package/shortcuts/context.js +1 -2
  92. package/shortcuts/context.mjs +1 -2
  93. package/utils/dataStructures/linkedList.js +1 -6
  94. package/utils/dataStructures/linkedList.mjs +1 -6
  95. package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
  96. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
  97. package/plugins/mergeCells/focusOrder.js +0 -303
  98. package/plugins/mergeCells/focusOrder.mjs +0 -298
@@ -29,10 +29,10 @@ var _Transformation_brand = /*#__PURE__*/new WeakSet();
29
29
  class Transformation {
30
30
  constructor(range, options) {
31
31
  /**
32
- * Clamps the coords to make sure they points to the cell (or header) in the table range.
32
+ * Sets the additional offset in table size that may occur when the `navigableHeaders` option
33
+ * is enabled.
33
34
  *
34
- * @param {CellCoords} zeroBasedCoords The coords object to clamp.
35
- * @returns {{rowDir: 1|0|-1, colDir: 1|0|-1}}
35
+ * @param {{x: number, y: number}} offset Offset as x and y properties.
36
36
  */
37
37
  _classPrivateMethodInitSpec(this, _Transformation_brand);
38
38
  /**
@@ -73,6 +73,10 @@ class Transformation {
73
73
  */
74
74
  transformStart(rowDelta, colDelta) {
75
75
  let createMissingRecords = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
76
+ _assertClassBrand(_Transformation_brand, this, _setOffsetSize).call(this, {
77
+ x: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countRowHeaders() : 0,
78
+ y: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countColHeaders() : 0
79
+ });
76
80
  const delta = _classPrivateFieldGet(_options, this).createCellCoords(rowDelta, colDelta);
77
81
  let visualCoords = _classPrivateFieldGet(_range, this).current().highlight;
78
82
  const highlightRenderableCoords = _classPrivateFieldGet(_options, this).visualToRenderableCoords(visualCoords);
@@ -152,46 +156,23 @@ class Transformation {
152
156
  * @returns {CellCoords} Visual coordinates after transformation.
153
157
  */
154
158
  transformEnd(rowDelta, colDelta) {
159
+ _assertClassBrand(_Transformation_brand, this, _setOffsetSize).call(this, {
160
+ x: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countRowHeaders() : 0,
161
+ y: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countColHeaders() : 0
162
+ });
155
163
  const delta = _classPrivateFieldGet(_options, this).createCellCoords(rowDelta, colDelta);
156
164
  const cellRange = _classPrivateFieldGet(_range, this).current();
157
165
  const highlightRenderableCoords = _classPrivateFieldGet(_options, this).visualToRenderableCoords(cellRange.highlight);
158
- const toRow = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedRow).call(this, cellRange.to.row, cellRange.from.row);
159
- const toColumn = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedColumn).call(this, cellRange.to.col, cellRange.from.col);
160
166
  const visualCoords = cellRange.to.clone();
161
167
  let rowTransformDir = 0;
162
168
  let colTransformDir = 0;
163
169
  this.runLocalHooks('beforeTransformEnd', delta);
164
- if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null && toRow !== null && toColumn !== null) {
170
+ if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null) {
165
171
  const {
166
- row: highlightRow,
167
- col: highlightColumn
168
- } = _assertClassBrand(_Transformation_brand, this, _visualToZeroBasedCoords).call(this, cellRange.highlight);
169
- const coords = _classPrivateFieldGet(_options, this).createCellCoords(toRow + delta.row, toColumn + delta.col);
170
- const topStartCorner = cellRange.getTopStartCorner();
171
- const topEndCorner = cellRange.getTopEndCorner();
172
- const bottomEndCorner = cellRange.getBottomEndCorner();
173
- const restDelta = {
174
- row: coords.row - highlightRow,
175
- col: coords.col - highlightColumn
176
- };
177
- if (delta.col < 0) {
178
- if (toColumn >= highlightColumn && coords.col < highlightColumn) {
179
- coords.col = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedColumn).call(this, topStartCorner.col, topEndCorner.col) + restDelta.col;
180
- }
181
- } else if (delta.col > 0) {
182
- if (toColumn <= highlightColumn && coords.col > highlightColumn) {
183
- coords.col = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedColumn).call(this, topEndCorner.col, topStartCorner.col) + restDelta.col;
184
- }
185
- }
186
- if (delta.row < 0) {
187
- if (toRow >= highlightRow && coords.row < highlightRow) {
188
- coords.row = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedRow).call(this, topStartCorner.row, bottomEndCorner.row) + restDelta.row;
189
- }
190
- } else if (delta.row > 0) {
191
- if (toRow <= highlightRow && coords.row > highlightRow) {
192
- coords.row = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedRow).call(this, bottomEndCorner.row, topStartCorner.row) + restDelta.row;
193
- }
194
- }
172
+ row,
173
+ col
174
+ } = _assertClassBrand(_Transformation_brand, this, _visualToZeroBasedCoords).call(this, cellRange.to);
175
+ const coords = _classPrivateFieldGet(_options, this).createCellCoords(row + delta.row, col + delta.col);
195
176
  const {
196
177
  rowDir,
197
178
  colDir
@@ -211,24 +192,23 @@ class Transformation {
211
192
  this.runLocalHooks('afterTransformEnd', visualCoords, rowTransformDir, colTransformDir);
212
193
  return visualCoords;
213
194
  }
214
-
215
- /**
216
- * Sets the additional offset in table size that may occur when the `navigableHeaders` option
217
- * is enabled.
218
- *
219
- * @param {{x: number, y: number}} offset Offset as x and y properties.
220
- */
221
- setOffsetSize(_ref) {
222
- let {
223
- x,
224
- y
225
- } = _ref;
226
- _classPrivateFieldSet(_offset, this, {
227
- x,
228
- y
229
- });
230
- }
231
195
  }
196
+ function _setOffsetSize(_ref) {
197
+ let {
198
+ x,
199
+ y
200
+ } = _ref;
201
+ _classPrivateFieldSet(_offset, this, {
202
+ x,
203
+ y
204
+ });
205
+ }
206
+ /**
207
+ * Clamps the coords to make sure they points to the cell (or header) in the table range.
208
+ *
209
+ * @param {CellCoords} zeroBasedCoords The coords object to clamp.
210
+ * @returns {{rowDir: 1|0|-1, colDir: 1|0|-1}}
211
+ */
232
212
  function _clampCoords(zeroBasedCoords) {
233
213
  const {
234
214
  width,
@@ -267,34 +247,6 @@ function _getTableSize() {
267
247
  height: _classPrivateFieldGet(_offset, this).y + _classPrivateFieldGet(_options, this).countRenderableRows()
268
248
  };
269
249
  }
270
- /**
271
- * Finds the first non-hidden zero-based row in the table range.
272
- *
273
- * @param {number} visualRowFrom The visual row from which the search should start.
274
- * @param {number} visualRowTo The visual row to which the search should end.
275
- * @returns {number | null}
276
- */
277
- function _findFirstNonHiddenZeroBasedRow(visualRowFrom, visualRowTo) {
278
- const row = _classPrivateFieldGet(_options, this).findFirstNonHiddenRenderableRow(visualRowFrom, visualRowTo);
279
- if (row === null) {
280
- return null;
281
- }
282
- return _classPrivateFieldGet(_offset, this).y + row;
283
- }
284
- /**
285
- * Finds the first non-hidden zero-based column in the table range.
286
- *
287
- * @param {number} visualColumnFrom The visual column from which the search should start.
288
- * @param {number} visualColumnTo The visual column to which the search should end.
289
- * @returns {number | null}
290
- */
291
- function _findFirstNonHiddenZeroBasedColumn(visualColumnFrom, visualColumnTo) {
292
- const column = _classPrivateFieldGet(_options, this).findFirstNonHiddenRenderableColumn(visualColumnFrom, visualColumnTo);
293
- if (column === null) {
294
- return null;
295
- }
296
- return _classPrivateFieldGet(_offset, this).x + column;
297
- }
298
250
  /**
299
251
  * Translates the visual coordinates to zero-based ones.
300
252
  *
@@ -306,9 +258,6 @@ function _visualToZeroBasedCoords(visualCoords) {
306
258
  row,
307
259
  col
308
260
  } = _classPrivateFieldGet(_options, this).visualToRenderableCoords(visualCoords);
309
- if (row === null || col === null) {
310
- throw new Error('Renderable coords are not visible.');
311
- }
312
261
  return _classPrivateFieldGet(_options, this).createCellCoords(_classPrivateFieldGet(_offset, this).y + row, _classPrivateFieldGet(_offset, this).x + col);
313
262
  }
314
263
  /**
@@ -3,9 +3,9 @@
3
3
  exports.__esModule = true;
4
4
  const command = exports.command = {
5
5
  name: 'editorCloseAndSave',
6
- callback(hot, event) {
6
+ callback(hot, event, keys) {
7
7
  const editorManager = hot._getEditorManager();
8
8
  editorManager.closeEditorAndSaveChanges(event.ctrlKey || event.metaKey);
9
- editorManager.moveSelectionAfterEnter(event);
9
+ editorManager.moveSelectionAfterEnter(keys.includes('shift'));
10
10
  }
11
11
  };
@@ -1,8 +1,8 @@
1
1
  export const command = {
2
2
  name: 'editorCloseAndSave',
3
- callback(hot, event) {
3
+ callback(hot, event, keys) {
4
4
  const editorManager = hot._getEditorManager();
5
5
  editorManager.closeEditorAndSaveChanges(event.ctrlKey || event.metaKey);
6
- editorManager.moveSelectionAfterEnter(event);
6
+ editorManager.moveSelectionAfterEnter(keys.includes('shift'));
7
7
  }
8
8
  };
@@ -6,35 +6,20 @@ const command = exports.command = {
6
6
  name: 'editorOpen',
7
7
  callback(hot, event, keys) {
8
8
  const editorManager = hot._getEditorManager();
9
- const selectedRange = hot.getSelectedRangeLast();
10
9
  const {
11
10
  highlight
12
- } = selectedRange;
13
-
14
- // supports for navigating with enter key when multiple cells are selected
15
- if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
16
- const settings = hot.getSettings();
17
- const enterMoves = typeof settings.enterMoves === 'function' ? settings.enterMoves(event) : settings.enterMoves;
18
- if (keys.includes('shift')) {
19
- hot.selection.transformFocus(-enterMoves.row, -enterMoves.col);
20
- } else {
21
- hot.selection.transformFocus(enterMoves.row, enterMoves.col);
22
- }
23
- return;
24
- }
11
+ } = hot.getSelectedRangeLast();
25
12
  if (highlight.isHeader()) {
26
13
  return;
27
14
  }
28
-
29
- // supports editor opening with enter key
30
15
  if (hot.getSettings().enterBeginsEditing) {
31
16
  if (editorManager.cellProperties.readOnly) {
32
- editorManager.moveSelectionAfterEnter(event);
17
+ editorManager.moveSelectionAfterEnter();
33
18
  } else {
34
19
  editorManager.openEditor(null, event, true);
35
20
  }
36
21
  } else {
37
- editorManager.moveSelectionAfterEnter(event);
22
+ editorManager.moveSelectionAfterEnter(keys.includes('shift'));
38
23
  }
39
24
  (0, _event.stopImmediatePropagation)(event); // required by HandsontableEditor
40
25
  }
@@ -3,35 +3,20 @@ export const command = {
3
3
  name: 'editorOpen',
4
4
  callback(hot, event, keys) {
5
5
  const editorManager = hot._getEditorManager();
6
- const selectedRange = hot.getSelectedRangeLast();
7
6
  const {
8
7
  highlight
9
- } = selectedRange;
10
-
11
- // supports for navigating with enter key when multiple cells are selected
12
- if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
13
- const settings = hot.getSettings();
14
- const enterMoves = typeof settings.enterMoves === 'function' ? settings.enterMoves(event) : settings.enterMoves;
15
- if (keys.includes('shift')) {
16
- hot.selection.transformFocus(-enterMoves.row, -enterMoves.col);
17
- } else {
18
- hot.selection.transformFocus(enterMoves.row, enterMoves.col);
19
- }
20
- return;
21
- }
8
+ } = hot.getSelectedRangeLast();
22
9
  if (highlight.isHeader()) {
23
10
  return;
24
11
  }
25
-
26
- // supports editor opening with enter key
27
12
  if (hot.getSettings().enterBeginsEditing) {
28
13
  if (editorManager.cellProperties.readOnly) {
29
- editorManager.moveSelectionAfterEnter(event);
14
+ editorManager.moveSelectionAfterEnter();
30
15
  } else {
31
16
  editorManager.openEditor(null, event, true);
32
17
  }
33
18
  } else {
34
- editorManager.moveSelectionAfterEnter(event);
19
+ editorManager.moveSelectionAfterEnter(keys.includes('shift'));
35
20
  }
36
21
  stopImmediatePropagation(event); // required by HandsontableEditor
37
22
  }
@@ -7,7 +7,7 @@ const command = exports.command = {
7
7
  const {
8
8
  highlight
9
9
  } = hot.getSelectedRangeLast();
10
- if (!hot.selection.isSelectedByColumnHeader() && !hot.selection.isSelectedByCorner() && (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader())) {
10
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
11
11
  hot.selection.transformEnd(1, 0);
12
12
  }
13
13
  }
@@ -4,7 +4,7 @@ export const command = {
4
4
  const {
5
5
  highlight
6
6
  } = hot.getSelectedRangeLast();
7
- if (!hot.selection.isSelectedByColumnHeader() && !hot.selection.isSelectedByCorner() && (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader())) {
7
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
8
8
  hot.selection.transformEnd(1, 0);
9
9
  }
10
10
  }
@@ -7,7 +7,7 @@ const command = exports.command = {
7
7
  const {
8
8
  highlight
9
9
  } = hot.getSelectedRangeLast();
10
- if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader())) {
10
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
11
11
  hot.selection.transformEnd(0, -1 * hot.getDirectionFactor());
12
12
  }
13
13
  }
@@ -4,7 +4,7 @@ export const command = {
4
4
  const {
5
5
  highlight
6
6
  } = hot.getSelectedRangeLast();
7
- if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader())) {
7
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
8
8
  hot.selection.transformEnd(0, -1 * hot.getDirectionFactor());
9
9
  }
10
10
  }
@@ -7,7 +7,7 @@ const command = exports.command = {
7
7
  const {
8
8
  highlight
9
9
  } = hot.getSelectedRangeLast();
10
- if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader())) {
10
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
11
11
  hot.selection.transformEnd(0, hot.getDirectionFactor());
12
12
  }
13
13
  }
@@ -4,7 +4,7 @@ export const command = {
4
4
  const {
5
5
  highlight
6
6
  } = hot.getSelectedRangeLast();
7
- if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader())) {
7
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
8
8
  hot.selection.transformEnd(0, hot.getDirectionFactor());
9
9
  }
10
10
  }
@@ -12,7 +12,7 @@ const command = exports.command = {
12
12
  if (hot.selection.isSelectedByRowHeader()) {
13
13
  hot.selection.selectAll(true, true);
14
14
  } else {
15
- hot.selectColumns(from.col, to.col, highlight);
15
+ hot.selectColumns(from.col, to.col, highlight.row);
16
16
  }
17
17
  }
18
18
  };
@@ -9,7 +9,7 @@ export const command = {
9
9
  if (hot.selection.isSelectedByRowHeader()) {
10
10
  hot.selection.selectAll(true, true);
11
11
  } else {
12
- hot.selectColumns(from.col, to.col, highlight);
12
+ hot.selectColumns(from.col, to.col, highlight.row);
13
13
  }
14
14
  }
15
15
  };
@@ -16,9 +16,7 @@ const command = exports.command = {
16
16
  const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
17
17
  if (highlight.isCell() || isFocusHighlightedByHeader) {
18
18
  const row = rowIndexMapper.getNearestNotHiddenIndex(hot.countRows() - 1, -1);
19
- const newFrom = from.clone();
20
- newFrom.row = highlight.row;
21
- selection.setRangeStart(newFrom, undefined, false, highlight.clone());
19
+ selection.setRangeStart(from.clone());
22
20
 
23
21
  // Restore the row highlight by header flag after setting up a new selection.
24
22
  if (isFocusHighlightedByHeader) {
@@ -13,9 +13,7 @@ export const command = {
13
13
  const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
14
14
  if (highlight.isCell() || isFocusHighlightedByHeader) {
15
15
  const row = rowIndexMapper.getNearestNotHiddenIndex(hot.countRows() - 1, -1);
16
- const newFrom = from.clone();
17
- newFrom.row = highlight.row;
18
- selection.setRangeStart(newFrom, undefined, false, highlight.clone());
16
+ selection.setRangeStart(from.clone());
19
17
 
20
18
  // Restore the row highlight by header flag after setting up a new selection.
21
19
  if (isFocusHighlightedByHeader) {
@@ -9,16 +9,10 @@ const command = exports.command = {
9
9
  columnIndexMapper
10
10
  } = hot;
11
11
  const {
12
- highlight,
13
- from,
14
- to
12
+ highlight
15
13
  } = hot.getSelectedRangeLast();
16
- if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && highlight.isCell()) {
17
- const column = columnIndexMapper.getNearestNotHiddenIndex(hot.countCols() - 1, -1);
18
- const newFrom = from.clone();
19
- newFrom.col = highlight.col;
20
- selection.setRangeStart(newFrom, undefined, false, highlight.clone());
21
- selection.setRangeEnd(hot._createCellCoords(to.row, column));
14
+ if (highlight.isCell()) {
15
+ selection.setRangeEnd(hot._createCellCoords(selection.selectedRange.current().from.row, columnIndexMapper.getNearestNotHiddenIndex(hot.countCols() - 1, -1)));
22
16
  }
23
17
  }
24
18
  };
@@ -6,16 +6,10 @@ export const command = {
6
6
  columnIndexMapper
7
7
  } = hot;
8
8
  const {
9
- highlight,
10
- from,
11
- to
9
+ highlight
12
10
  } = hot.getSelectedRangeLast();
13
- if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && highlight.isCell()) {
14
- const column = columnIndexMapper.getNearestNotHiddenIndex(hot.countCols() - 1, -1);
15
- const newFrom = from.clone();
16
- newFrom.col = highlight.col;
17
- selection.setRangeStart(newFrom, undefined, false, highlight.clone());
18
- selection.setRangeEnd(hot._createCellCoords(to.row, column));
11
+ if (highlight.isCell()) {
12
+ selection.setRangeEnd(hot._createCellCoords(selection.selectedRange.current().from.row, columnIndexMapper.getNearestNotHiddenIndex(hot.countCols() - 1, -1)));
19
13
  }
20
14
  }
21
15
  };
@@ -9,17 +9,10 @@ const command = exports.command = {
9
9
  columnIndexMapper
10
10
  } = hot;
11
11
  const {
12
- highlight,
13
- from,
14
- to
12
+ highlight
15
13
  } = hot.getSelectedRangeLast();
16
- if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && highlight.isCell()) {
17
- const fixedColumns = parseInt(hot.getSettings().fixedColumnsStart, 10);
18
- const column = columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
19
- const newFrom = from.clone();
20
- newFrom.col = highlight.col;
21
- selection.setRangeStart(newFrom, undefined, false, highlight.clone());
22
- selection.setRangeEnd(hot._createCellCoords(to.row, column));
14
+ if (highlight.isCell()) {
15
+ selection.setRangeEnd(hot._createCellCoords(selection.selectedRange.current().from.row, columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
23
16
  }
24
17
  }
25
18
  };
@@ -6,17 +6,10 @@ export const command = {
6
6
  columnIndexMapper
7
7
  } = hot;
8
8
  const {
9
- highlight,
10
- from,
11
- to
9
+ highlight
12
10
  } = hot.getSelectedRangeLast();
13
- if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && highlight.isCell()) {
14
- const fixedColumns = parseInt(hot.getSettings().fixedColumnsStart, 10);
15
- const column = columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
16
- const newFrom = from.clone();
17
- newFrom.col = highlight.col;
18
- selection.setRangeStart(newFrom, undefined, false, highlight.clone());
19
- selection.setRangeEnd(hot._createCellCoords(to.row, column));
11
+ if (highlight.isCell()) {
12
+ selection.setRangeEnd(hot._createCellCoords(selection.selectedRange.current().from.row, columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
20
13
  }
21
14
  }
22
15
  };
@@ -16,9 +16,7 @@ const command = exports.command = {
16
16
  const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
17
17
  if (highlight.isCell() || isFocusHighlightedByHeader) {
18
18
  const column = columnIndexMapper.getNearestNotHiddenIndex(...(hot.isRtl() ? [hot.countCols() - 1, -1] : [0, 1]));
19
- const newFrom = from.clone();
20
- newFrom.col = highlight.col;
21
- selection.setRangeStart(newFrom, undefined, false, highlight.clone());
19
+ selection.setRangeStart(from.clone());
22
20
 
23
21
  // Restore the column highlight by header flag after setting up a new selection.
24
22
  if (isFocusHighlightedByHeader) {
@@ -13,9 +13,7 @@ export const command = {
13
13
  const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
14
14
  if (highlight.isCell() || isFocusHighlightedByHeader) {
15
15
  const column = columnIndexMapper.getNearestNotHiddenIndex(...(hot.isRtl() ? [hot.countCols() - 1, -1] : [0, 1]));
16
- const newFrom = from.clone();
17
- newFrom.col = highlight.col;
18
- selection.setRangeStart(newFrom, undefined, false, highlight.clone());
16
+ selection.setRangeStart(from.clone());
19
17
 
20
18
  // Restore the column highlight by header flag after setting up a new selection.
21
19
  if (isFocusHighlightedByHeader) {
@@ -16,9 +16,7 @@ const command = exports.command = {
16
16
  const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
17
17
  if (highlight.isCell() || isFocusHighlightedByHeader) {
18
18
  const column = columnIndexMapper.getNearestNotHiddenIndex(...(hot.isRtl() ? [0, 1] : [hot.countCols() - 1, -1]));
19
- const newFrom = from.clone();
20
- newFrom.col = highlight.col;
21
- selection.setRangeStart(newFrom, undefined, false, highlight.clone());
19
+ selection.setRangeStart(from.clone());
22
20
 
23
21
  // Restore the column highlight by header flag after setting up a new selection.
24
22
  if (isFocusHighlightedByHeader) {
@@ -13,9 +13,7 @@ export const command = {
13
13
  const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
14
14
  if (highlight.isCell() || isFocusHighlightedByHeader) {
15
15
  const column = columnIndexMapper.getNearestNotHiddenIndex(...(hot.isRtl() ? [0, 1] : [hot.countCols() - 1, -1]));
16
- const newFrom = from.clone();
17
- newFrom.col = highlight.col;
18
- selection.setRangeStart(newFrom, undefined, false, highlight.clone());
16
+ selection.setRangeStart(from.clone());
19
17
 
20
18
  // Restore the column highlight by header flag after setting up a new selection.
21
19
  if (isFocusHighlightedByHeader) {
@@ -16,9 +16,7 @@ const command = exports.command = {
16
16
  const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
17
17
  if (highlight.isCell() || isFocusHighlightedByHeader) {
18
18
  const row = rowIndexMapper.getNearestNotHiddenIndex(0, 1);
19
- const newFrom = from.clone();
20
- newFrom.row = highlight.row;
21
- selection.setRangeStart(newFrom, undefined, false, highlight.clone());
19
+ selection.setRangeStart(from.clone());
22
20
 
23
21
  // Restore the row highlight by header flag after setting up a new selection.
24
22
  if (isFocusHighlightedByHeader) {
@@ -13,9 +13,7 @@ export const command = {
13
13
  const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
14
14
  if (highlight.isCell() || isFocusHighlightedByHeader) {
15
15
  const row = rowIndexMapper.getNearestNotHiddenIndex(0, 1);
16
- const newFrom = from.clone();
17
- newFrom.row = highlight.row;
18
- selection.setRangeStart(newFrom, undefined, false, highlight.clone());
16
+ selection.setRangeStart(from.clone());
19
17
 
20
18
  // Restore the row highlight by header flag after setting up a new selection.
21
19
  if (isFocusHighlightedByHeader) {
@@ -12,7 +12,7 @@ const command = exports.command = {
12
12
  if (hot.selection.isSelectedByColumnHeader()) {
13
13
  hot.selection.selectAll(true, true);
14
14
  } else {
15
- hot.selectRows(from.row, to.row, highlight);
15
+ hot.selectRows(from.row, to.row, highlight.col);
16
16
  }
17
17
  }
18
18
  };
@@ -9,7 +9,7 @@ export const command = {
9
9
  if (hot.selection.isSelectedByColumnHeader()) {
10
10
  hot.selection.selectAll(true, true);
11
11
  } else {
12
- hot.selectRows(from.row, to.row, highlight);
12
+ hot.selectRows(from.row, to.row, highlight.col);
13
13
  }
14
14
  }
15
15
  };
@@ -7,7 +7,7 @@ const command = exports.command = {
7
7
  const {
8
8
  highlight
9
9
  } = hot.getSelectedRangeLast();
10
- if (!hot.selection.isSelectedByColumnHeader() && !hot.selection.isSelectedByCorner() && (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader())) {
10
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
11
11
  hot.selection.transformEnd(-1, 0);
12
12
  }
13
13
  }
@@ -4,7 +4,7 @@ export const command = {
4
4
  const {
5
5
  highlight
6
6
  } = hot.getSelectedRangeLast();
7
- if (!hot.selection.isSelectedByColumnHeader() && !hot.selection.isSelectedByCorner() && (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader())) {
7
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
8
8
  hot.selection.transformEnd(-1, 0);
9
9
  }
10
10
  }
@@ -5,12 +5,7 @@ const command = exports.command = {
5
5
  name: 'moveCellSelectionInlineEnd',
6
6
  callback(hot, event) {
7
7
  const settings = hot.getSettings();
8
- const selectedRange = hot.getSelectedRangeLast();
9
8
  const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
10
- if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
11
- hot.selection.transformFocus(-tabMoves.row, -tabMoves.col);
12
- } else {
13
- hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
14
- }
9
+ hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
15
10
  }
16
11
  };
@@ -2,12 +2,7 @@ export const command = {
2
2
  name: 'moveCellSelectionInlineEnd',
3
3
  callback(hot, event) {
4
4
  const settings = hot.getSettings();
5
- const selectedRange = hot.getSelectedRangeLast();
6
5
  const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
7
- if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
8
- hot.selection.transformFocus(-tabMoves.row, -tabMoves.col);
9
- } else {
10
- hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
11
- }
6
+ hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
12
7
  }
13
8
  };
@@ -5,12 +5,7 @@ const command = exports.command = {
5
5
  name: 'moveCellSelectionInlineStart',
6
6
  callback(hot, event) {
7
7
  const settings = hot.getSettings();
8
- const selectedRange = hot.getSelectedRangeLast();
9
8
  const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
10
- if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
11
- hot.selection.transformFocus(tabMoves.row, tabMoves.col);
12
- } else {
13
- hot.selection.transformStart(tabMoves.row, tabMoves.col);
14
- }
9
+ hot.selection.transformStart(tabMoves.row, tabMoves.col);
15
10
  }
16
11
  };
@@ -2,12 +2,7 @@ export const command = {
2
2
  name: 'moveCellSelectionInlineStart',
3
3
  callback(hot, event) {
4
4
  const settings = hot.getSettings();
5
- const selectedRange = hot.getSelectedRangeLast();
6
5
  const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
7
- if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
8
- hot.selection.transformFocus(tabMoves.row, tabMoves.col);
9
- } else {
10
- hot.selection.transformStart(tabMoves.row, tabMoves.col);
11
- }
6
+ hot.selection.transformStart(tabMoves.row, tabMoves.col);
12
7
  }
13
8
  };