handsontable 0.0.0-next-612100d-20240219 → 0.0.0-next-d96e9b5-20240220

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 (89) hide show
  1. package/3rdparty/walkontable/src/cell/range.d.ts +1 -0
  2. package/3rdparty/walkontable/src/cell/range.js +12 -0
  3. package/3rdparty/walkontable/src/cell/range.mjs +12 -0
  4. package/base.js +2 -2
  5. package/base.mjs +2 -2
  6. package/core/viewportScroll/index.js +4 -1
  7. package/core/viewportScroll/index.mjs +4 -1
  8. package/core/viewportScroll/scrollStrategies/focusScroll.js +15 -0
  9. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +11 -0
  10. package/core.js +14 -0
  11. package/core.mjs +14 -0
  12. package/dist/handsontable.css +2 -2
  13. package/dist/handsontable.full.css +2 -2
  14. package/dist/handsontable.full.js +1606 -1328
  15. package/dist/handsontable.full.min.css +2 -2
  16. package/dist/handsontable.full.min.js +151 -151
  17. package/dist/handsontable.js +1606 -1328
  18. package/dist/handsontable.min.css +2 -2
  19. package/dist/handsontable.min.js +19 -19
  20. package/editorManager.js +12 -8
  21. package/editorManager.mjs +12 -8
  22. package/helpers/mixed.js +1 -1
  23. package/helpers/mixed.mjs +1 -1
  24. package/package.json +1 -1
  25. package/pluginHooks.d.ts +1 -0
  26. package/pluginHooks.js +43 -1
  27. package/pluginHooks.mjs +43 -1
  28. package/plugins/collapsibleColumns/collapsibleColumns.js +7 -1
  29. package/plugins/collapsibleColumns/collapsibleColumns.mjs +7 -1
  30. package/plugins/columnSorting/columnSorting.js +6 -0
  31. package/plugins/columnSorting/columnSorting.mjs +6 -0
  32. package/plugins/contextMenu/menu/defaultShortcutsList.js +26 -10
  33. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +26 -10
  34. package/plugins/mergeCells/calculations/selection.js +1 -70
  35. package/plugins/mergeCells/calculations/selection.mjs +1 -70
  36. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +11 -1
  37. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +11 -1
  38. package/plugins/mergeCells/mergeCells.js +182 -207
  39. package/plugins/mergeCells/mergeCells.mjs +182 -207
  40. package/plugins/multiColumnSorting/multiColumnSorting.js +6 -0
  41. package/plugins/multiColumnSorting/multiColumnSorting.mjs +6 -0
  42. package/plugins/nestedHeaders/nestedHeaders.js +1 -0
  43. package/plugins/nestedHeaders/nestedHeaders.mjs +1 -0
  44. package/plugins/nestedRows/nestedRows.js +7 -1
  45. package/plugins/nestedRows/nestedRows.mjs +7 -1
  46. package/renderers/checkboxRenderer/checkboxRenderer.js +4 -4
  47. package/renderers/checkboxRenderer/checkboxRenderer.mjs +4 -4
  48. package/selection/highlight/visualSelection.js +2 -0
  49. package/selection/highlight/visualSelection.mjs +2 -0
  50. package/selection/selection.js +195 -34
  51. package/selection/selection.mjs +194 -33
  52. package/selection/transformation.js +45 -30
  53. package/selection/transformation.mjs +45 -30
  54. package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
  55. package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
  56. package/shortcutContexts/commands/editor/open.js +18 -3
  57. package/shortcutContexts/commands/editor/open.mjs +18 -3
  58. package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
  59. package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
  60. package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
  61. package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
  62. package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
  63. package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
  64. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
  65. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
  66. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +3 -1
  67. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +3 -1
  68. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +9 -3
  69. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +9 -3
  70. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +10 -3
  71. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +10 -3
  72. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +3 -1
  73. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +3 -1
  74. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +3 -1
  75. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +3 -1
  76. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +3 -1
  77. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +3 -1
  78. package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
  79. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
  80. package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
  81. package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
  82. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +6 -1
  83. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +6 -1
  84. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +6 -1
  85. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +6 -1
  86. package/shortcutContexts/grid.js +2 -2
  87. package/shortcutContexts/grid.mjs +2 -2
  88. package/shortcuts/context.js +2 -1
  89. package/shortcuts/context.mjs +2 -1
@@ -6,20 +6,35 @@ 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();
9
10
  const {
10
11
  highlight
11
- } = hot.getSelectedRangeLast();
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
+ }
12
25
  if (highlight.isHeader()) {
13
26
  return;
14
27
  }
28
+
29
+ // supports editor opening with enter key
15
30
  if (hot.getSettings().enterBeginsEditing) {
16
31
  if (editorManager.cellProperties.readOnly) {
17
- editorManager.moveSelectionAfterEnter();
32
+ editorManager.moveSelectionAfterEnter(event);
18
33
  } else {
19
34
  editorManager.openEditor(null, event, true);
20
35
  }
21
36
  } else {
22
- editorManager.moveSelectionAfterEnter(keys.includes('shift'));
37
+ editorManager.moveSelectionAfterEnter(event);
23
38
  }
24
39
  (0, _event.stopImmediatePropagation)(event); // required by HandsontableEditor
25
40
  }
@@ -3,20 +3,35 @@ export const command = {
3
3
  name: 'editorOpen',
4
4
  callback(hot, event, keys) {
5
5
  const editorManager = hot._getEditorManager();
6
+ const selectedRange = hot.getSelectedRangeLast();
6
7
  const {
7
8
  highlight
8
- } = hot.getSelectedRangeLast();
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
+ }
9
22
  if (highlight.isHeader()) {
10
23
  return;
11
24
  }
25
+
26
+ // supports editor opening with enter key
12
27
  if (hot.getSettings().enterBeginsEditing) {
13
28
  if (editorManager.cellProperties.readOnly) {
14
- editorManager.moveSelectionAfterEnter();
29
+ editorManager.moveSelectionAfterEnter(event);
15
30
  } else {
16
31
  editorManager.openEditor(null, event, true);
17
32
  }
18
33
  } else {
19
- editorManager.moveSelectionAfterEnter(keys.includes('shift'));
34
+ editorManager.moveSelectionAfterEnter(event);
20
35
  }
21
36
  stopImmediatePropagation(event); // required by HandsontableEditor
22
37
  }
@@ -7,7 +7,7 @@ const command = exports.command = {
7
7
  const {
8
8
  highlight
9
9
  } = hot.getSelectedRangeLast();
10
- if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
10
+ if (!hot.selection.isSelectedByColumnHeader() && !hot.selection.isSelectedByCorner() && (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 (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
7
+ if (!hot.selection.isSelectedByColumnHeader() && !hot.selection.isSelectedByCorner() && (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 (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
10
+ if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && (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 (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
7
+ if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && (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 (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
10
+ if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && (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 (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
7
+ if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && (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.row);
15
+ hot.selectColumns(from.col, to.col, highlight);
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.row);
12
+ hot.selectColumns(from.col, to.col, highlight);
13
13
  }
14
14
  }
15
15
  };
@@ -16,7 +16,9 @@ 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
- selection.setRangeStart(from.clone());
19
+ const newFrom = from.clone();
20
+ newFrom.row = highlight.row;
21
+ selection.setRangeStart(newFrom, undefined, false, highlight.clone());
20
22
 
21
23
  // Restore the row highlight by header flag after setting up a new selection.
22
24
  if (isFocusHighlightedByHeader) {
@@ -13,7 +13,9 @@ 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
- selection.setRangeStart(from.clone());
16
+ const newFrom = from.clone();
17
+ newFrom.row = highlight.row;
18
+ selection.setRangeStart(newFrom, undefined, false, highlight.clone());
17
19
 
18
20
  // Restore the row highlight by header flag after setting up a new selection.
19
21
  if (isFocusHighlightedByHeader) {
@@ -9,10 +9,16 @@ const command = exports.command = {
9
9
  columnIndexMapper
10
10
  } = hot;
11
11
  const {
12
- highlight
12
+ highlight,
13
+ from,
14
+ to
13
15
  } = hot.getSelectedRangeLast();
14
- if (highlight.isCell()) {
15
- selection.setRangeEnd(hot._createCellCoords(selection.selectedRange.current().from.row, columnIndexMapper.getNearestNotHiddenIndex(hot.countCols() - 1, -1)));
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));
16
22
  }
17
23
  }
18
24
  };
@@ -6,10 +6,16 @@ export const command = {
6
6
  columnIndexMapper
7
7
  } = hot;
8
8
  const {
9
- highlight
9
+ highlight,
10
+ from,
11
+ to
10
12
  } = hot.getSelectedRangeLast();
11
- if (highlight.isCell()) {
12
- selection.setRangeEnd(hot._createCellCoords(selection.selectedRange.current().from.row, columnIndexMapper.getNearestNotHiddenIndex(hot.countCols() - 1, -1)));
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));
13
19
  }
14
20
  }
15
21
  };
@@ -9,10 +9,17 @@ const command = exports.command = {
9
9
  columnIndexMapper
10
10
  } = hot;
11
11
  const {
12
- highlight
12
+ highlight,
13
+ from,
14
+ to
13
15
  } = hot.getSelectedRangeLast();
14
- if (highlight.isCell()) {
15
- selection.setRangeEnd(hot._createCellCoords(selection.selectedRange.current().from.row, columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
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));
16
23
  }
17
24
  }
18
25
  };
@@ -6,10 +6,17 @@ export const command = {
6
6
  columnIndexMapper
7
7
  } = hot;
8
8
  const {
9
- highlight
9
+ highlight,
10
+ from,
11
+ to
10
12
  } = hot.getSelectedRangeLast();
11
- if (highlight.isCell()) {
12
- selection.setRangeEnd(hot._createCellCoords(selection.selectedRange.current().from.row, columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
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));
13
20
  }
14
21
  }
15
22
  };
@@ -16,7 +16,9 @@ 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
- selection.setRangeStart(from.clone());
19
+ const newFrom = from.clone();
20
+ newFrom.col = highlight.col;
21
+ selection.setRangeStart(newFrom, undefined, false, highlight.clone());
20
22
 
21
23
  // Restore the column highlight by header flag after setting up a new selection.
22
24
  if (isFocusHighlightedByHeader) {
@@ -13,7 +13,9 @@ 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
- selection.setRangeStart(from.clone());
16
+ const newFrom = from.clone();
17
+ newFrom.col = highlight.col;
18
+ selection.setRangeStart(newFrom, undefined, false, highlight.clone());
17
19
 
18
20
  // Restore the column highlight by header flag after setting up a new selection.
19
21
  if (isFocusHighlightedByHeader) {
@@ -16,7 +16,9 @@ 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
- selection.setRangeStart(from.clone());
19
+ const newFrom = from.clone();
20
+ newFrom.col = highlight.col;
21
+ selection.setRangeStart(newFrom, undefined, false, highlight.clone());
20
22
 
21
23
  // Restore the column highlight by header flag after setting up a new selection.
22
24
  if (isFocusHighlightedByHeader) {
@@ -13,7 +13,9 @@ 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
- selection.setRangeStart(from.clone());
16
+ const newFrom = from.clone();
17
+ newFrom.col = highlight.col;
18
+ selection.setRangeStart(newFrom, undefined, false, highlight.clone());
17
19
 
18
20
  // Restore the column highlight by header flag after setting up a new selection.
19
21
  if (isFocusHighlightedByHeader) {
@@ -16,7 +16,9 @@ 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
- selection.setRangeStart(from.clone());
19
+ const newFrom = from.clone();
20
+ newFrom.row = highlight.row;
21
+ selection.setRangeStart(newFrom, undefined, false, highlight.clone());
20
22
 
21
23
  // Restore the row highlight by header flag after setting up a new selection.
22
24
  if (isFocusHighlightedByHeader) {
@@ -13,7 +13,9 @@ 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
- selection.setRangeStart(from.clone());
16
+ const newFrom = from.clone();
17
+ newFrom.row = highlight.row;
18
+ selection.setRangeStart(newFrom, undefined, false, highlight.clone());
17
19
 
18
20
  // Restore the row highlight by header flag after setting up a new selection.
19
21
  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.col);
15
+ hot.selectRows(from.row, to.row, highlight);
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.col);
12
+ hot.selectRows(from.row, to.row, highlight);
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 (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
10
+ if (!hot.selection.isSelectedByColumnHeader() && !hot.selection.isSelectedByCorner() && (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 (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
7
+ if (!hot.selection.isSelectedByColumnHeader() && !hot.selection.isSelectedByCorner() && (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader())) {
8
8
  hot.selection.transformEnd(-1, 0);
9
9
  }
10
10
  }
@@ -5,7 +5,12 @@ const command = exports.command = {
5
5
  name: 'moveCellSelectionInlineEnd',
6
6
  callback(hot, event) {
7
7
  const settings = hot.getSettings();
8
+ const selectedRange = hot.getSelectedRangeLast();
8
9
  const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
9
- hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
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
+ }
10
15
  }
11
16
  };
@@ -2,7 +2,12 @@ export const command = {
2
2
  name: 'moveCellSelectionInlineEnd',
3
3
  callback(hot, event) {
4
4
  const settings = hot.getSettings();
5
+ const selectedRange = hot.getSelectedRangeLast();
5
6
  const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
6
- hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
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
+ }
7
12
  }
8
13
  };
@@ -5,7 +5,12 @@ const command = exports.command = {
5
5
  name: 'moveCellSelectionInlineStart',
6
6
  callback(hot, event) {
7
7
  const settings = hot.getSettings();
8
+ const selectedRange = hot.getSelectedRangeLast();
8
9
  const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
9
- hot.selection.transformStart(tabMoves.row, tabMoves.col);
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
+ }
10
15
  }
11
16
  };
@@ -2,7 +2,12 @@ export const command = {
2
2
  name: 'moveCellSelectionInlineStart',
3
3
  callback(hot, event) {
4
4
  const settings = hot.getSettings();
5
+ const selectedRange = hot.getSelectedRangeLast();
5
6
  const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
6
- hot.selection.transformStart(tabMoves.row, tabMoves.col);
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
+ }
7
12
  }
8
13
  };
@@ -157,12 +157,12 @@ function shortcutsGridContext(hot) {
157
157
  keys: [['Tab']],
158
158
  // The property value is controlled by focusCatcher module (https://github.com/handsontable/handsontable/blob/master/handsontable/src/core/focusCatcher/index.js)
159
159
  preventDefault: false,
160
- callback: () => commandsPool.moveCellSelectionInlineStart()
160
+ callback: event => commandsPool.moveCellSelectionInlineStart(event)
161
161
  }, {
162
162
  keys: [['Shift', 'Tab']],
163
163
  // The property value is controlled by focusCatcher module (https://github.com/handsontable/handsontable/blob/master/handsontable/src/core/focusCatcher/index.js)
164
164
  preventDefault: false,
165
- callback: () => commandsPool.moveCellSelectionInlineEnd()
165
+ callback: event => commandsPool.moveCellSelectionInlineEnd(event)
166
166
  }, {
167
167
  keys: [['Control/Meta', 'Backspace']],
168
168
  callback: () => commandsPool.scrollToFocusedCell()
@@ -153,12 +153,12 @@ export function shortcutsGridContext(hot) {
153
153
  keys: [['Tab']],
154
154
  // The property value is controlled by focusCatcher module (https://github.com/handsontable/handsontable/blob/master/handsontable/src/core/focusCatcher/index.js)
155
155
  preventDefault: false,
156
- callback: () => commandsPool.moveCellSelectionInlineStart()
156
+ callback: event => commandsPool.moveCellSelectionInlineStart(event)
157
157
  }, {
158
158
  keys: [['Shift', 'Tab']],
159
159
  // The property value is controlled by focusCatcher module (https://github.com/handsontable/handsontable/blob/master/handsontable/src/core/focusCatcher/index.js)
160
160
  preventDefault: false,
161
- callback: () => commandsPool.moveCellSelectionInlineEnd()
161
+ callback: event => commandsPool.moveCellSelectionInlineEnd(event)
162
162
  }, {
163
163
  keys: [['Control/Meta', 'Backspace']],
164
164
  callback: () => commandsPool.scrollToFocusedCell()
@@ -90,7 +90,8 @@ const createContext = name => {
90
90
  stopPropagation
91
91
  };
92
92
  if ((0, _mixed.isDefined)(relativeToGroup)) {
93
- [newShortcut.relativeToGroup, newShortcut.position] = [relativeToGroup, position];
93
+ newShortcut.relativeToGroup = relativeToGroup;
94
+ newShortcut.position = position;
94
95
  }
95
96
  if (isContextObject(forwardToContext)) {
96
97
  newShortcut.forwardToContext = forwardToContext;
@@ -86,7 +86,8 @@ export const createContext = name => {
86
86
  stopPropagation
87
87
  };
88
88
  if (isDefined(relativeToGroup)) {
89
- [newShortcut.relativeToGroup, newShortcut.position] = [relativeToGroup, position];
89
+ newShortcut.relativeToGroup = relativeToGroup;
90
+ newShortcut.position = position;
90
91
  }
91
92
  if (isContextObject(forwardToContext)) {
92
93
  newShortcut.forwardToContext = forwardToContext;