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
package/editorManager.js CHANGED
@@ -310,22 +310,18 @@ class EditorManager {
310
310
  }
311
311
 
312
312
  /**
313
- * Controls selection's behavior after clicking `Enter`.
313
+ * Controls selection's behaviour after clicking `Enter`.
314
314
  *
315
315
  * @private
316
- * @param {KeyboardEvent} event The keyboard event object.
316
+ * @param {boolean} isShiftPressed If `true`, then the selection will move up after hit enter.
317
317
  */
318
- moveSelectionAfterEnter(event) {
319
- const enterMoves = {
320
- ...(typeof this.tableMeta.enterMoves === 'function' ? this.tableMeta.enterMoves(event) : this.tableMeta.enterMoves)
321
- };
322
- if (event.shiftKey) {
323
- enterMoves.row = -enterMoves.row;
324
- enterMoves.col = -enterMoves.col;
325
- }
326
- if (this.hot.selection.isMultiple()) {
327
- this.selection.transformFocus(enterMoves.row, enterMoves.col);
318
+ moveSelectionAfterEnter(isShiftPressed) {
319
+ const enterMoves = typeof this.tableMeta.enterMoves === 'function' ? this.tableMeta.enterMoves(event) : this.tableMeta.enterMoves;
320
+ if (isShiftPressed) {
321
+ // move selection up
322
+ this.selection.transformStart(-enterMoves.row, -enterMoves.col);
328
323
  } else {
324
+ // move selection down (add a new row if needed)
329
325
  this.selection.transformStart(enterMoves.row, enterMoves.col, true);
330
326
  }
331
327
  }
package/editorManager.mjs CHANGED
@@ -306,22 +306,18 @@ class EditorManager {
306
306
  }
307
307
 
308
308
  /**
309
- * Controls selection's behavior after clicking `Enter`.
309
+ * Controls selection's behaviour after clicking `Enter`.
310
310
  *
311
311
  * @private
312
- * @param {KeyboardEvent} event The keyboard event object.
312
+ * @param {boolean} isShiftPressed If `true`, then the selection will move up after hit enter.
313
313
  */
314
- moveSelectionAfterEnter(event) {
315
- const enterMoves = {
316
- ...(typeof this.tableMeta.enterMoves === 'function' ? this.tableMeta.enterMoves(event) : this.tableMeta.enterMoves)
317
- };
318
- if (event.shiftKey) {
319
- enterMoves.row = -enterMoves.row;
320
- enterMoves.col = -enterMoves.col;
321
- }
322
- if (this.hot.selection.isMultiple()) {
323
- this.selection.transformFocus(enterMoves.row, enterMoves.col);
314
+ moveSelectionAfterEnter(isShiftPressed) {
315
+ const enterMoves = typeof this.tableMeta.enterMoves === 'function' ? this.tableMeta.enterMoves(event) : this.tableMeta.enterMoves;
316
+ if (isShiftPressed) {
317
+ // move selection up
318
+ this.selection.transformStart(-enterMoves.row, -enterMoves.col);
324
319
  } else {
320
+ // move selection down (add a new row if needed)
325
321
  this.selection.transformStart(enterMoves.row, enterMoves.col, true);
326
322
  }
327
323
  }
package/focusManager.js CHANGED
@@ -92,16 +92,10 @@ class FocusManager {
92
92
  }
93
93
  return _assertClassBrand(_FocusManager_brand, _this, _focusCell).call(_this, ...args);
94
94
  });
95
- _classPrivateFieldGet(_hot, this).addHook('afterSelectionFocusSet', function () {
95
+ _classPrivateFieldGet(_hot, this).addHook('afterSelectionEnd', function () {
96
96
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
97
97
  args[_key3] = arguments[_key3];
98
98
  }
99
- return _assertClassBrand(_FocusManager_brand, _this, _focusCell).call(_this, ...args);
100
- });
101
- _classPrivateFieldGet(_hot, this).addHook('afterSelectionEnd', function () {
102
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
103
- args[_key4] = arguments[_key4];
104
- }
105
99
  return _assertClassBrand(_FocusManager_brand, _this, _focusEditorElement).call(_this, ...args);
106
100
  });
107
101
  }
package/focusManager.mjs CHANGED
@@ -89,16 +89,10 @@ export class FocusManager {
89
89
  }
90
90
  return _assertClassBrand(_FocusManager_brand, _this, _focusCell).call(_this, ...args);
91
91
  });
92
- _classPrivateFieldGet(_hot, this).addHook('afterSelectionFocusSet', function () {
92
+ _classPrivateFieldGet(_hot, this).addHook('afterSelectionEnd', function () {
93
93
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
94
94
  args[_key3] = arguments[_key3];
95
95
  }
96
- return _assertClassBrand(_FocusManager_brand, _this, _focusCell).call(_this, ...args);
97
- });
98
- _classPrivateFieldGet(_hot, this).addHook('afterSelectionEnd', function () {
99
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
100
- args[_key4] = arguments[_key4];
101
- }
102
96
  return _assertClassBrand(_FocusManager_brand, _this, _focusEditorElement).call(_this, ...args);
103
97
  });
104
98
  }
package/helpers/mixed.js CHANGED
@@ -134,7 +134,7 @@ const domMessages = {
134
134
  function _injectProductInfo(key, element) {
135
135
  const hasValidType = !isEmpty(key);
136
136
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
137
- const hotVersion = "0.0.0-next-e5dbebc-20240319";
137
+ const hotVersion = "0.0.0-next-923e108-20240319";
138
138
  let keyValidityDate;
139
139
  let consoleMessageState = 'invalid';
140
140
  let domMessageState = 'invalid';
package/helpers/mixed.mjs CHANGED
@@ -124,7 +124,7 @@ const domMessages = {
124
124
  export function _injectProductInfo(key, element) {
125
125
  const hasValidType = !isEmpty(key);
126
126
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
127
- const hotVersion = "0.0.0-next-e5dbebc-20240319";
127
+ const hotVersion = "0.0.0-next-923e108-20240319";
128
128
  let keyValidityDate;
129
129
  let consoleMessageState = 'invalid';
130
130
  let domMessageState = 'invalid';
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/handsontable/handsontable/issues"
11
11
  },
12
12
  "author": "Handsoncode <hello@handsontable.com>",
13
- "version": "0.0.0-next-e5dbebc-20240319",
13
+ "version": "0.0.0-next-923e108-20240319",
14
14
  "main": "index",
15
15
  "module": "index.mjs",
16
16
  "jsnext:main": "index.mjs",
package/pluginHooks.d.ts CHANGED
@@ -98,7 +98,6 @@ export interface Events {
98
98
  afterLoadData?: (sourceData: CellValue[], initialLoad: boolean, source: string | undefined) => void;
99
99
  afterMergeCells?: (cellRange: CellRange, mergeParent: MergeCellsSettings, auto: boolean) => void;
100
100
  afterModifyTransformEnd?: (coords: CellCoords, rowTransformDir: -1 | 0, colTransformDir: -1 | 0) => void;
101
- afterModifyTransformFocus?: (coords: CellCoords, rowTransformDir: -1 | 0, colTransformDir: -1 | 0) => void;
102
101
  afterModifyTransformStart?: (coords: CellCoords, rowTransformDir: -1 | 0, colTransformDir: -1 | 0) => void;
103
102
  afterMomentumScroll?: () => void;
104
103
  afterNamedExpressionAdded?: (namedExpressionName: string, changes: ExportedChange[]) => void;
@@ -131,7 +130,6 @@ export interface Events {
131
130
  afterSelectionByProp?: (row: number, prop: string, row2: number, prop2: string, preventScrolling: { value: boolean }, selectionLayerLevel: number) => void;
132
131
  afterSelectionEnd?: (row: number, column: number, row2: number, column2: number, selectionLayerLevel: number) => void;
133
132
  afterSelectionEndByProp?: (row: number, prop: string, row2: number, prop2: string, selectionLayerLevel: number) => void;
134
- afterSelectionFocusSet?: (row: number, column: number, preventScrolling: { value: boolean }) => void;
135
133
  afterSelectRows?: (from: CellCoords, to: CellCoords, highlight: CellCoords) => void;
136
134
  afterSetCellMeta?: (row: number, column: number, key: string, value: any) => void;
137
135
  afterSetDataAtCell?: (changes: CellChange[], source?: ChangeSource) => void;
@@ -210,7 +208,6 @@ export interface Events {
210
208
  beforeRowResize?: (newSize: number, row: number, isDoubleClick: boolean) => number | void;
211
209
  beforeRowWrap?: (isActionInterrupted: { value: boolean }, newCoords: CellCoords, isRowFlipped: boolean) => void;
212
210
  beforeSelectColumns?: (from: CellCoords, to: CellCoords, highlight: CellCoords) => void;
213
- beforeSelectionFocusSet?: (coords: CellCoords) => void;
214
211
  beforeSelectionHighlightSet?: () => void;
215
212
  beforeSelectRows?: (from: CellCoords, to: CellCoords, highlight: CellCoords) => void;
216
213
  beforeSetCellMeta?: (row: number, column: number, key: string, value: any) => boolean | void;
@@ -253,7 +250,6 @@ export interface Events {
253
250
  modifyRowHeight?: (height: number, row: number) => void;
254
251
  modifySourceData?: (row: number, column: number, valueHolder: { value: CellValue }, ioMode: 'get' | 'set') => void;
255
252
  modifyTransformEnd?: (delta: CellCoords) => void;
256
- modifyTransformFocus?: (delta: CellCoords) => void;
257
253
  modifyTransformStart?: (delta: CellCoords) => void;
258
254
  persistentStateLoad?: (key: string, valuePlaceholder: { value: any }) => void;
259
255
  persistentStateReset?: (key: string) => void;
package/pluginHooks.js CHANGED
@@ -650,9 +650,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
650
650
  * @param {string} prop Selection start data source object property name.
651
651
  * @param {number} row2 Selection end visual row index.
652
652
  * @param {string} prop2 Selection end data source object property name.
653
- * @param {object} preventScrolling A reference to the observable object with the `value` property.
654
- * Property `preventScrolling.value` expects a boolean value that
655
- * Handsontable uses to control scroll behavior after selection.
653
+ * @param {object} preventScrolling Object with `value` property where its value change will be observed.
656
654
  * @param {number} selectionLayerLevel The number which indicates what selection layer is currently modified.
657
655
  * @example
658
656
  * ```js
@@ -702,46 +700,6 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
702
700
  * @param {number} selectionLayerLevel The number which indicates what selection layer is currently modified.
703
701
  */
704
702
  'afterSelectionEndByProp',
705
- /**
706
- * Fired after the focus position within a selected range is changed.
707
- *
708
- * @since 14.2.0
709
- * @event Hooks#afterSelectionFocusSet
710
- * @param {number} row The focus visual row index position.
711
- * @param {number} column The focus visual column index position.
712
- * @param {object} preventScrolling A reference to the observable object with the `value` property.
713
- * Property `preventScrolling.value` expects a boolean value that
714
- * Handsontable uses to control scroll behavior after selection.
715
- * @example
716
- * ```js
717
- * ::: only-for javascript
718
- * new Handsontable(element, {
719
- * afterSelectionFocusSet: (row, column, preventScrolling) => {
720
- * // If set to `false` (default): when focused cell selection is outside the viewport,
721
- * // Handsontable scrolls the viewport to that cell.
722
- * // If set to `true`: when focused cell selection is outside the viewport,
723
- * // Handsontable doesn't scroll the viewport.
724
- * preventScrolling.value = true;
725
- * }
726
- * })
727
- * ```
728
- * :::
729
- *
730
- * ::: only-for react
731
- * ```jsx
732
- * <HotTable
733
- * afterSelectionFocusSet={(row, column, preventScrolling) => {
734
- * // If set to `false` (default): when focused cell selection is outside the viewport,
735
- * // Handsontable scrolls the viewport to that cell.
736
- * // If set to `true`: when focused cell selection is outside the viewport,
737
- * // Handsontable doesn't scroll the viewport.
738
- * preventScrolling.value = true;
739
- * }}
740
- * />
741
- * ```
742
- * :::
743
- */
744
- 'afterSelectionFocusSet',
745
703
  /**
746
704
  * Fired before one or more columns are selected (e.g. During mouse header click or {@link Core#selectColumns} API call).
747
705
  *
@@ -1296,14 +1254,6 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1296
1254
  * @returns {boolean|undefined} If false is returned the action is canceled.
1297
1255
  */
1298
1256
  'beforeSetCellMeta',
1299
- /**
1300
- * Fired before setting focus selection.
1301
- *
1302
- * @since 14.3.0
1303
- * @event Hooks#beforeSelectionFocusSet
1304
- * @param {CellCoords} coords CellCoords instance.
1305
- */
1306
- 'beforeSelectionFocusSet',
1307
1257
  /**
1308
1258
  * Fired before setting range is started but not finished yet.
1309
1259
  *
@@ -2213,14 +2163,6 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
2213
2163
  * @param {number} rowHeaderWidth Row header width.
2214
2164
  */
2215
2165
  'modifyRowHeaderWidth',
2216
- /**
2217
- * Fired when the focus of the selection is being modified (e.g. Moving the focus with the enter/tab keys).
2218
- *
2219
- * @since 14.3.0
2220
- * @event Hooks#modifyTransformFocus
2221
- * @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.
2222
- */
2223
- 'modifyTransformFocus',
2224
2166
  /**
2225
2167
  * Fired when the start of the selection is being modified (e.g. Moving the selection with the arrow keys).
2226
2168
  *
@@ -2235,16 +2177,6 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
2235
2177
  * @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.
2236
2178
  */
2237
2179
  'modifyTransformEnd',
2238
- /**
2239
- * Fired after the focus of the selection is being modified (e.g. Moving the focus with the enter/tab keys).
2240
- *
2241
- * @since 14.3.0
2242
- * @event Hooks#afterModifyTransformFocus
2243
- * @param {CellCoords} coords Coords of the freshly focused cell.
2244
- * @param {number} rowTransformDir `-1` if trying to focus a cell with a negative row index. `0` otherwise.
2245
- * @param {number} colTransformDir `-1` if trying to focus a cell with a negative column index. `0` otherwise.
2246
- */
2247
- 'afterModifyTransformFocus',
2248
2180
  /**
2249
2181
  * Fired after the start of the selection is being modified (e.g. Moving the selection with the arrow keys).
2250
2182
  *
package/pluginHooks.mjs CHANGED
@@ -646,9 +646,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
646
646
  * @param {string} prop Selection start data source object property name.
647
647
  * @param {number} row2 Selection end visual row index.
648
648
  * @param {string} prop2 Selection end data source object property name.
649
- * @param {object} preventScrolling A reference to the observable object with the `value` property.
650
- * Property `preventScrolling.value` expects a boolean value that
651
- * Handsontable uses to control scroll behavior after selection.
649
+ * @param {object} preventScrolling Object with `value` property where its value change will be observed.
652
650
  * @param {number} selectionLayerLevel The number which indicates what selection layer is currently modified.
653
651
  * @example
654
652
  * ```js
@@ -698,46 +696,6 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
698
696
  * @param {number} selectionLayerLevel The number which indicates what selection layer is currently modified.
699
697
  */
700
698
  'afterSelectionEndByProp',
701
- /**
702
- * Fired after the focus position within a selected range is changed.
703
- *
704
- * @since 14.2.0
705
- * @event Hooks#afterSelectionFocusSet
706
- * @param {number} row The focus visual row index position.
707
- * @param {number} column The focus visual column index position.
708
- * @param {object} preventScrolling A reference to the observable object with the `value` property.
709
- * Property `preventScrolling.value` expects a boolean value that
710
- * Handsontable uses to control scroll behavior after selection.
711
- * @example
712
- * ```js
713
- * ::: only-for javascript
714
- * new Handsontable(element, {
715
- * afterSelectionFocusSet: (row, column, preventScrolling) => {
716
- * // If set to `false` (default): when focused cell selection is outside the viewport,
717
- * // Handsontable scrolls the viewport to that cell.
718
- * // If set to `true`: when focused cell selection is outside the viewport,
719
- * // Handsontable doesn't scroll the viewport.
720
- * preventScrolling.value = true;
721
- * }
722
- * })
723
- * ```
724
- * :::
725
- *
726
- * ::: only-for react
727
- * ```jsx
728
- * <HotTable
729
- * afterSelectionFocusSet={(row, column, preventScrolling) => {
730
- * // If set to `false` (default): when focused cell selection is outside the viewport,
731
- * // Handsontable scrolls the viewport to that cell.
732
- * // If set to `true`: when focused cell selection is outside the viewport,
733
- * // Handsontable doesn't scroll the viewport.
734
- * preventScrolling.value = true;
735
- * }}
736
- * />
737
- * ```
738
- * :::
739
- */
740
- 'afterSelectionFocusSet',
741
699
  /**
742
700
  * Fired before one or more columns are selected (e.g. During mouse header click or {@link Core#selectColumns} API call).
743
701
  *
@@ -1292,14 +1250,6 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1292
1250
  * @returns {boolean|undefined} If false is returned the action is canceled.
1293
1251
  */
1294
1252
  'beforeSetCellMeta',
1295
- /**
1296
- * Fired before setting focus selection.
1297
- *
1298
- * @since 14.3.0
1299
- * @event Hooks#beforeSelectionFocusSet
1300
- * @param {CellCoords} coords CellCoords instance.
1301
- */
1302
- 'beforeSelectionFocusSet',
1303
1253
  /**
1304
1254
  * Fired before setting range is started but not finished yet.
1305
1255
  *
@@ -2209,14 +2159,6 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
2209
2159
  * @param {number} rowHeaderWidth Row header width.
2210
2160
  */
2211
2161
  'modifyRowHeaderWidth',
2212
- /**
2213
- * Fired when the focus of the selection is being modified (e.g. Moving the focus with the enter/tab keys).
2214
- *
2215
- * @since 14.3.0
2216
- * @event Hooks#modifyTransformFocus
2217
- * @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.
2218
- */
2219
- 'modifyTransformFocus',
2220
2162
  /**
2221
2163
  * Fired when the start of the selection is being modified (e.g. Moving the selection with the arrow keys).
2222
2164
  *
@@ -2231,16 +2173,6 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
2231
2173
  * @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.
2232
2174
  */
2233
2175
  'modifyTransformEnd',
2234
- /**
2235
- * Fired after the focus of the selection is being modified (e.g. Moving the focus with the enter/tab keys).
2236
- *
2237
- * @since 14.3.0
2238
- * @event Hooks#afterModifyTransformFocus
2239
- * @param {CellCoords} coords Coords of the freshly focused cell.
2240
- * @param {number} rowTransformDir `-1` if trying to focus a cell with a negative row index. `0` otherwise.
2241
- * @param {number} colTransformDir `-1` if trying to focus a cell with a negative column index. `0` otherwise.
2242
- */
2243
- 'afterModifyTransformFocus',
2244
2176
  /**
2245
2177
  * Fired after the start of the selection is being modified (e.g. Moving the selection with the arrow keys).
2246
2178
  *
@@ -9,7 +9,6 @@ var _number = require("../../helpers/number");
9
9
  var _console = require("../../helpers/console");
10
10
  var _element = require("../../helpers/dom/element");
11
11
  var _event = require("../../helpers/dom/event");
12
- var _shortcutContexts = require("../../shortcutContexts");
13
12
  var _a11y = require("../../helpers/a11y");
14
13
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
15
14
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
@@ -281,17 +280,12 @@ class CollapsibleColumns extends _base.BasePlugin {
281
280
  col: columnIndex
282
281
  });
283
282
  }
284
-
285
- // prevent default Enter behavior (move to the next row within a selection range)
286
- return false;
287
283
  },
288
284
  runOnlyIf: () => {
289
- var _this$hot$getSelected, _this$hot$getSelected2;
290
- return ((_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.isSingle()) && ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isHeader());
285
+ var _this$hot$getSelected;
286
+ return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
291
287
  },
292
- group: SHORTCUTS_GROUP,
293
- relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
294
- position: 'before'
288
+ group: SHORTCUTS_GROUP
295
289
  });
296
290
  }
297
291
 
@@ -15,7 +15,6 @@ import { rangeEach } from "../../helpers/number.mjs";
15
15
  import { warn } from "../../helpers/console.mjs";
16
16
  import { addClass, hasClass, removeClass, fastInnerText, removeAttribute, setAttribute } from "../../helpers/dom/element.mjs";
17
17
  import { stopImmediatePropagation } from "../../helpers/dom/event.mjs";
18
- import { EDITOR_EDIT_GROUP as SHORTCUTS_GROUP_EDITOR } from "../../shortcutContexts/index.mjs";
19
18
  import { A11Y_EXPANDED, A11Y_HIDDEN } from "../../helpers/a11y.mjs";
20
19
  export const PLUGIN_KEY = 'collapsibleColumns';
21
20
  export const PLUGIN_PRIORITY = 290;
@@ -278,17 +277,12 @@ export class CollapsibleColumns extends BasePlugin {
278
277
  col: columnIndex
279
278
  });
280
279
  }
281
-
282
- // prevent default Enter behavior (move to the next row within a selection range)
283
- return false;
284
280
  },
285
281
  runOnlyIf: () => {
286
- var _this$hot$getSelected, _this$hot$getSelected2;
287
- return ((_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.isSingle()) && ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isHeader());
282
+ var _this$hot$getSelected;
283
+ return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
288
284
  },
289
- group: SHORTCUTS_GROUP,
290
- relativeToGroup: SHORTCUTS_GROUP_EDITOR,
291
- position: 'before'
285
+ group: SHORTCUTS_GROUP
292
286
  });
293
287
  }
294
288
 
@@ -12,7 +12,6 @@ var _base = require("../base");
12
12
  var _translations = require("../../translations");
13
13
  var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
14
14
  var _columnStatesManager = require("./columnStatesManager");
15
- var _shortcutContexts = require("../../shortcutContexts");
16
15
  var _utils = require("./utils");
17
16
  var _domHelpers = require("./domHelpers");
18
17
  var _rootComparator = require("./rootComparator");
@@ -224,17 +223,12 @@ class ColumnSorting extends _base.BasePlugin {
224
223
  if (highlight.row === -1 && highlight.col >= 0) {
225
224
  this.sort(this.getColumnNextConfig(highlight.col));
226
225
  }
227
-
228
- // prevent default Enter behavior (move to the next row within a selection range)
229
- return false;
230
226
  },
231
227
  runOnlyIf: () => {
232
- var _this$hot$getSelected, _this$hot$getSelected2;
228
+ var _this$hot$getSelected;
233
229
  const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
234
- return highlight && ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingle()) && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
230
+ return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
235
231
  },
236
- relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
237
- position: 'before',
238
232
  group: SHORTCUTS_GROUP
239
233
  });
240
234
  }
@@ -15,7 +15,6 @@ import { BasePlugin } from "../base/index.mjs";
15
15
  import { IndexesSequence, PhysicalIndexToValueMap as IndexToValueMap } from "../../translations/index.mjs";
16
16
  import Hooks from "../../pluginHooks.mjs";
17
17
  import { ColumnStatesManager } from "./columnStatesManager.mjs";
18
- import { EDITOR_EDIT_GROUP as SHORTCUTS_GROUP_EDITOR } from "../../shortcutContexts/index.mjs";
19
18
  import { HEADER_SPAN_CLASS, getNextSortOrder, areValidSortStates, getHeaderSpanElement, isFirstLevelColumnHeader, wasHeaderClickedProperly } from "./utils.mjs";
20
19
  import { getClassesToRemove, getClassesToAdd } from "./domHelpers.mjs";
21
20
  import { rootComparator } from "./rootComparator.mjs";
@@ -220,17 +219,12 @@ export class ColumnSorting extends BasePlugin {
220
219
  if (highlight.row === -1 && highlight.col >= 0) {
221
220
  this.sort(this.getColumnNextConfig(highlight.col));
222
221
  }
223
-
224
- // prevent default Enter behavior (move to the next row within a selection range)
225
- return false;
226
222
  },
227
223
  runOnlyIf: () => {
228
- var _this$hot$getSelected, _this$hot$getSelected2;
224
+ var _this$hot$getSelected;
229
225
  const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
230
- return highlight && ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingle()) && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
226
+ return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
231
227
  },
232
- relativeToGroup: SHORTCUTS_GROUP_EDITOR,
233
- position: 'before',
234
228
  group: SHORTCUTS_GROUP
235
229
  });
236
230
  }
@@ -9,26 +9,10 @@ exports.createDefaultShortcutsList = createDefaultShortcutsList;
9
9
  * @returns {KeyboardShortcut[]}
10
10
  */
11
11
  function createDefaultShortcutsList(menu) {
12
- const {
13
- hot,
14
- hotMenu
15
- } = menu;
16
12
  return [{
17
- keys: [['Control/Meta', 'A']],
18
- forwardToContext: hot.getShortcutManager().getContext('grid'),
13
+ keys: [['Tab'], ['Shift', 'Tab'], ['Control/Meta', 'A']],
14
+ forwardToContext: menu.hot.getShortcutManager().getContext('grid'),
19
15
  callback: () => menu.close(true)
20
- }, {
21
- keys: [['Tab'], ['Shift', 'Tab']],
22
- callback: (event, keys) => {
23
- const settings = hot.getSettings();
24
- const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
25
- if (keys.includes('shift')) {
26
- hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
27
- } else {
28
- hot.selection.transformStart(tabMoves.row, tabMoves.col);
29
- }
30
- menu.close(true);
31
- }
32
16
  }, {
33
17
  keys: [['Escape']],
34
18
  callback: () => menu.close()
@@ -41,7 +25,7 @@ function createDefaultShortcutsList(menu) {
41
25
  }, {
42
26
  keys: [['ArrowRight']],
43
27
  callback: () => {
44
- const selection = hotMenu.getSelectedLast();
28
+ const selection = menu.hotMenu.getSelectedLast();
45
29
  if (selection) {
46
30
  const subMenu = menu.openSubMenu(selection[0]);
47
31
  if (subMenu) {
@@ -52,7 +36,7 @@ function createDefaultShortcutsList(menu) {
52
36
  }, {
53
37
  keys: [['ArrowLeft']],
54
38
  callback: () => {
55
- const selection = hotMenu.getSelectedLast();
39
+ const selection = menu.hotMenu.getSelectedLast();
56
40
  if (selection && menu.isSubMenu()) {
57
41
  menu.close();
58
42
  if (menu.isSubMenu()) {
@@ -69,11 +53,11 @@ function createDefaultShortcutsList(menu) {
69
53
  }, {
70
54
  keys: [['Enter'], ['Space']],
71
55
  callback: event => {
72
- const selection = hotMenu.getSelectedLast();
56
+ const selection = menu.hotMenu.getSelectedLast();
73
57
  if (!selection) {
74
58
  return;
75
59
  }
76
- if (hotMenu.getSourceDataAtRow(selection[0]).submenu) {
60
+ if (menu.hotMenu.getSourceDataAtRow(selection[0]).submenu) {
77
61
  menu.openSubMenu(selection[0]).getNavigator().toFirstItem();
78
62
  } else {
79
63
  menu.executeCommand(event);
@@ -83,9 +67,9 @@ function createDefaultShortcutsList(menu) {
83
67
  }, {
84
68
  keys: [['PageUp']],
85
69
  callback: () => {
86
- const selection = hotMenu.getSelectedLast();
70
+ const selection = menu.hotMenu.getSelectedLast();
87
71
  if (selection) {
88
- hotMenu.selection.transformStart(-hotMenu.countVisibleRows(), 0);
72
+ menu.hotMenu.selection.transformStart(-menu.hotMenu.countVisibleRows(), 0);
89
73
  } else {
90
74
  menu.getNavigator().toFirstItem();
91
75
  }
@@ -93,9 +77,9 @@ function createDefaultShortcutsList(menu) {
93
77
  }, {
94
78
  keys: [['PageDown']],
95
79
  callback: () => {
96
- const selection = hotMenu.getSelectedLast();
80
+ const selection = menu.hotMenu.getSelectedLast();
97
81
  if (selection) {
98
- hotMenu.selection.transformStart(hotMenu.countVisibleRows(), 0);
82
+ menu.hotMenu.selection.transformStart(menu.hotMenu.countVisibleRows(), 0);
99
83
  } else {
100
84
  menu.getNavigator().toLastItem();
101
85
  }
@@ -5,26 +5,10 @@
5
5
  * @returns {KeyboardShortcut[]}
6
6
  */
7
7
  export function createDefaultShortcutsList(menu) {
8
- const {
9
- hot,
10
- hotMenu
11
- } = menu;
12
8
  return [{
13
- keys: [['Control/Meta', 'A']],
14
- forwardToContext: hot.getShortcutManager().getContext('grid'),
9
+ keys: [['Tab'], ['Shift', 'Tab'], ['Control/Meta', 'A']],
10
+ forwardToContext: menu.hot.getShortcutManager().getContext('grid'),
15
11
  callback: () => menu.close(true)
16
- }, {
17
- keys: [['Tab'], ['Shift', 'Tab']],
18
- callback: (event, keys) => {
19
- const settings = hot.getSettings();
20
- const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
21
- if (keys.includes('shift')) {
22
- hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
23
- } else {
24
- hot.selection.transformStart(tabMoves.row, tabMoves.col);
25
- }
26
- menu.close(true);
27
- }
28
12
  }, {
29
13
  keys: [['Escape']],
30
14
  callback: () => menu.close()
@@ -37,7 +21,7 @@ export function createDefaultShortcutsList(menu) {
37
21
  }, {
38
22
  keys: [['ArrowRight']],
39
23
  callback: () => {
40
- const selection = hotMenu.getSelectedLast();
24
+ const selection = menu.hotMenu.getSelectedLast();
41
25
  if (selection) {
42
26
  const subMenu = menu.openSubMenu(selection[0]);
43
27
  if (subMenu) {
@@ -48,7 +32,7 @@ export function createDefaultShortcutsList(menu) {
48
32
  }, {
49
33
  keys: [['ArrowLeft']],
50
34
  callback: () => {
51
- const selection = hotMenu.getSelectedLast();
35
+ const selection = menu.hotMenu.getSelectedLast();
52
36
  if (selection && menu.isSubMenu()) {
53
37
  menu.close();
54
38
  if (menu.isSubMenu()) {
@@ -65,11 +49,11 @@ export function createDefaultShortcutsList(menu) {
65
49
  }, {
66
50
  keys: [['Enter'], ['Space']],
67
51
  callback: event => {
68
- const selection = hotMenu.getSelectedLast();
52
+ const selection = menu.hotMenu.getSelectedLast();
69
53
  if (!selection) {
70
54
  return;
71
55
  }
72
- if (hotMenu.getSourceDataAtRow(selection[0]).submenu) {
56
+ if (menu.hotMenu.getSourceDataAtRow(selection[0]).submenu) {
73
57
  menu.openSubMenu(selection[0]).getNavigator().toFirstItem();
74
58
  } else {
75
59
  menu.executeCommand(event);
@@ -79,9 +63,9 @@ export function createDefaultShortcutsList(menu) {
79
63
  }, {
80
64
  keys: [['PageUp']],
81
65
  callback: () => {
82
- const selection = hotMenu.getSelectedLast();
66
+ const selection = menu.hotMenu.getSelectedLast();
83
67
  if (selection) {
84
- hotMenu.selection.transformStart(-hotMenu.countVisibleRows(), 0);
68
+ menu.hotMenu.selection.transformStart(-menu.hotMenu.countVisibleRows(), 0);
85
69
  } else {
86
70
  menu.getNavigator().toFirstItem();
87
71
  }
@@ -89,9 +73,9 @@ export function createDefaultShortcutsList(menu) {
89
73
  }, {
90
74
  keys: [['PageDown']],
91
75
  callback: () => {
92
- const selection = hotMenu.getSelectedLast();
76
+ const selection = menu.hotMenu.getSelectedLast();
93
77
  if (selection) {
94
- hotMenu.selection.transformStart(hotMenu.countVisibleRows(), 0);
78
+ menu.hotMenu.selection.transformStart(menu.hotMenu.countVisibleRows(), 0);
95
79
  } else {
96
80
  menu.getNavigator().toLastItem();
97
81
  }