handsontable 14.0.0-next-b112557-20231129 → 14.0.0-next-ecaa005-20231130

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.
package/focusManager.js CHANGED
@@ -209,7 +209,7 @@ class FocusManager {
209
209
  const focusElement = element => {
210
210
  var _classPrivateFieldGet3, _classPrivateFieldGet4;
211
211
  const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.highlight;
212
- if (!currentHighlightCoords || !element) {
212
+ if (!currentHighlightCoords) {
213
213
  return;
214
214
  }
215
215
  let elementToBeFocused = _classPrivateFieldGet(this, _hot).runHooks('modifyFocusedElement', currentHighlightCoords.row, currentHighlightCoords.col, element);
@@ -255,7 +255,7 @@ exports.FocusManager = FocusManager;
255
255
  function _getSelectedCell2(callback) {
256
256
  var _classPrivateFieldGet6;
257
257
  const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet6 === void 0 ? void 0 : _classPrivateFieldGet6.highlight;
258
- if (!highlight) {
258
+ if (!highlight || !_classPrivateFieldGet(this, _hot).selection.isCellVisible(highlight)) {
259
259
  callback(null);
260
260
  return;
261
261
  }
package/focusManager.mjs CHANGED
@@ -206,7 +206,7 @@ export class FocusManager {
206
206
  const focusElement = element => {
207
207
  var _classPrivateFieldGet3, _classPrivateFieldGet4;
208
208
  const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.highlight;
209
- if (!currentHighlightCoords || !element) {
209
+ if (!currentHighlightCoords) {
210
210
  return;
211
211
  }
212
212
  let elementToBeFocused = _classPrivateFieldGet(this, _hot).runHooks('modifyFocusedElement', currentHighlightCoords.row, currentHighlightCoords.col, element);
@@ -251,7 +251,7 @@ export class FocusManager {
251
251
  function _getSelectedCell2(callback) {
252
252
  var _classPrivateFieldGet6;
253
253
  const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet6 === void 0 ? void 0 : _classPrivateFieldGet6.highlight;
254
- if (!highlight) {
254
+ if (!highlight || !_classPrivateFieldGet(this, _hot).selection.isCellVisible(highlight)) {
255
255
  callback(null);
256
256
  return;
257
257
  }
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 = "14.0.0-next-b112557-20231129";
137
+ const hotVersion = "14.0.0-next-ecaa005-20231130";
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 = "14.0.0-next-b112557-20231129";
127
+ const hotVersion = "14.0.0-next-ecaa005-20231130";
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": "14.0.0-next-b112557-20231129",
13
+ "version": "14.0.0-next-ecaa005-20231130",
14
14
  "main": "index",
15
15
  "module": "index.mjs",
16
16
  "jsnext:main": "index.mjs",
package/pluginHooks.js CHANGED
@@ -1217,7 +1217,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1217
1217
  * This is due to the priority of other options that may block the feature.
1218
1218
  * For example, when the {@link Options#minSpareCols} is defined, the {@link Options#autoWrapRow} option is not checked.
1219
1219
  * Thus, row wrapping is off.
1220
- * @param {CellCoords} newCoords The new focus position.
1220
+ * @param {CellCoords} newCoords The new focus position. It is an object with keys `row` and `col`, where a value of `-1` indicates a header.
1221
1221
  * @param {boolean} isFlipped `true` if the row index was flipped, `false` otherwise.
1222
1222
  * Flipped index means that the user reached the last row and the focus is moved to the first row or vice versa.
1223
1223
  */
@@ -1233,7 +1233,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1233
1233
  * This is due to the priority of other options that may block the feature.
1234
1234
  * For example, when the {@link Options#minSpareRows} is defined, the {@link Options#autoWrapCol} option is not checked.
1235
1235
  * Thus, column wrapping is off.
1236
- * @param {CellCoords} newCoords The new focus position.
1236
+ * @param {CellCoords} newCoords The new focus position. It is an object with keys `row` and `col`, where a value of `-1` indicates a header.
1237
1237
  * @param {boolean} isFlipped `true` if the column index was flipped, `false` otherwise.
1238
1238
  * Flipped index means that the user reached the last column and the focus is moved to the first column or vice versa.
1239
1239
  */
@@ -1273,6 +1273,8 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1273
1273
  'beforeSetRangeEnd',
1274
1274
  /**
1275
1275
  * Fired before applying selection coordinates to the renderable coordinates for Walkontable (rendering engine).
1276
+ * It occurs even when cell coordinates remain unchanged and activates during cell selection and drag selection.
1277
+ * The behavior of Shift+Tab differs from Arrow Left when there's no further movement possible.
1276
1278
  *
1277
1279
  * @since 14.0.0
1278
1280
  * @event Hooks#beforeSelectionHighlightSet
@@ -1342,7 +1344,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1342
1344
  * @event Hooks#modifyFocusedElement
1343
1345
  * @param {number} row Row index.
1344
1346
  * @param {number} column Column index.
1345
- * @param {HTMLElement|undefined} focusedElement The element to be focused.
1347
+ * @param {HTMLElement|undefined} focusedElement The element to be focused. `null` for focusedElement is intended when focused cell is hidden.
1346
1348
  */
1347
1349
  'modifyFocusedElement',
1348
1350
  /**
package/pluginHooks.mjs CHANGED
@@ -1215,7 +1215,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1215
1215
  * This is due to the priority of other options that may block the feature.
1216
1216
  * For example, when the {@link Options#minSpareCols} is defined, the {@link Options#autoWrapRow} option is not checked.
1217
1217
  * Thus, row wrapping is off.
1218
- * @param {CellCoords} newCoords The new focus position.
1218
+ * @param {CellCoords} newCoords The new focus position. It is an object with keys `row` and `col`, where a value of `-1` indicates a header.
1219
1219
  * @param {boolean} isFlipped `true` if the row index was flipped, `false` otherwise.
1220
1220
  * Flipped index means that the user reached the last row and the focus is moved to the first row or vice versa.
1221
1221
  */
@@ -1231,7 +1231,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1231
1231
  * This is due to the priority of other options that may block the feature.
1232
1232
  * For example, when the {@link Options#minSpareRows} is defined, the {@link Options#autoWrapCol} option is not checked.
1233
1233
  * Thus, column wrapping is off.
1234
- * @param {CellCoords} newCoords The new focus position.
1234
+ * @param {CellCoords} newCoords The new focus position. It is an object with keys `row` and `col`, where a value of `-1` indicates a header.
1235
1235
  * @param {boolean} isFlipped `true` if the column index was flipped, `false` otherwise.
1236
1236
  * Flipped index means that the user reached the last column and the focus is moved to the first column or vice versa.
1237
1237
  */
@@ -1271,6 +1271,8 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1271
1271
  'beforeSetRangeEnd',
1272
1272
  /**
1273
1273
  * Fired before applying selection coordinates to the renderable coordinates for Walkontable (rendering engine).
1274
+ * It occurs even when cell coordinates remain unchanged and activates during cell selection and drag selection.
1275
+ * The behavior of Shift+Tab differs from Arrow Left when there's no further movement possible.
1274
1276
  *
1275
1277
  * @since 14.0.0
1276
1278
  * @event Hooks#beforeSelectionHighlightSet
@@ -1340,7 +1342,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1340
1342
  * @event Hooks#modifyFocusedElement
1341
1343
  * @param {number} row Row index.
1342
1344
  * @param {number} column Column index.
1343
- * @param {HTMLElement|undefined} focusedElement The element to be focused.
1345
+ * @param {HTMLElement|undefined} focusedElement The element to be focused. `null` for focusedElement is intended when focused cell is hidden.
1344
1346
  */
1345
1347
  'modifyFocusedElement',
1346
1348
  /**
@@ -205,6 +205,9 @@ class ContextMenu extends _base.BasePlugin {
205
205
  left: rect.width,
206
206
  above: -rect.height
207
207
  });
208
+ // Make sure the first item is selected (role=menuitem). Otherwise, screen readers
209
+ // will block the Esc key for the whole menu.
210
+ this.menu.getNavigator().toFirstItem();
208
211
  },
209
212
  runOnlyIf: () => {
210
213
  var _this$hot$getSelected;
@@ -201,6 +201,9 @@ export class ContextMenu extends BasePlugin {
201
201
  left: rect.width,
202
202
  above: -rect.height
203
203
  });
204
+ // Make sure the first item is selected (role=menuitem). Otherwise, screen readers
205
+ // will block the Esc key for the whole menu.
206
+ this.menu.getNavigator().toFirstItem();
204
207
  },
205
208
  runOnlyIf: () => {
206
209
  var _this$hot$getSelected;
@@ -296,6 +296,9 @@ class DropdownMenu extends _base.BasePlugin {
296
296
  }, {
297
297
  left: rect.width
298
298
  });
299
+ // Make sure the first item is selected (role=menuitem). Otherwise, screen readers
300
+ // will block the Esc key for the whole menu.
301
+ this.menu.getNavigator().toFirstItem();
299
302
  }
300
303
  };
301
304
  gridContext.addShortcuts([{
@@ -292,6 +292,9 @@ export class DropdownMenu extends BasePlugin {
292
292
  }, {
293
293
  left: rect.width
294
294
  });
295
+ // Make sure the first item is selected (role=menuitem). Otherwise, screen readers
296
+ // will block the Esc key for the whole menu.
297
+ this.menu.getNavigator().toFirstItem();
295
298
  }
296
299
  };
297
300
  gridContext.addShortcuts([{
@@ -122,7 +122,7 @@ class MergeCells extends _base.BasePlugin {
122
122
  _classPrivateMethodInitSpec(this, _onAfterDrawSelection);
123
123
  /**
124
124
  * `afterModifyTransformStart` hook callback. Fixes a problem with navigating through merged cells at the edges of
125
- * the table with the ENTER/SHIFT+ENTER/TAB/SHIFT+TAB keys.
125
+ * the table with the <kbd>**Enter**</kbd>/<kbd>**Shift**</kbd>+<kbd>**Enter**</kbd>/<kbd>**Tab**</kbd>/<kbd>**Shift**</kbd>+<kbd>**Tab**</kbd> keys.
126
126
  *
127
127
  * @param {CellCoords} coords Coordinates of the to-be-selected cell.
128
128
  * @param {number} rowTransformDir Row transformation direction (negative value = up, 0 = none, positive value =
@@ -118,7 +118,7 @@ export class MergeCells extends BasePlugin {
118
118
  _classPrivateMethodInitSpec(this, _onAfterDrawSelection);
119
119
  /**
120
120
  * `afterModifyTransformStart` hook callback. Fixes a problem with navigating through merged cells at the edges of
121
- * the table with the ENTER/SHIFT+ENTER/TAB/SHIFT+TAB keys.
121
+ * the table with the <kbd>**Enter**</kbd>/<kbd>**Shift**</kbd>+<kbd>**Enter**</kbd>/<kbd>**Tab**</kbd>/<kbd>**Shift**</kbd>+<kbd>**Tab**</kbd> keys.
122
122
  *
123
123
  * @param {CellCoords} coords Coordinates of the to-be-selected cell.
124
124
  * @param {number} rowTransformDir Row transformation direction (negative value = up, 0 = none, positive value =
@@ -24,7 +24,7 @@ function isContextObject(objectToCheck) {
24
24
 
25
25
  /* eslint-disable jsdoc/require-description-complete-sentence */
26
26
  /**
27
- * The `ShortcutContext` API lets you store and manage [keyboard shortcuts](@/guides/accessories-and-menus/keyboard-shortcuts.md) in a given [context](@/guides/accessories-and-menus/keyboard-shortcuts.md#keyboard-shortcut-contexts).
27
+ * The `ShortcutContext` API lets you store and manage [keyboard shortcuts](@/guides/navigation/keyboard-shortcuts.md) in a given [context](@/guides/navigation/keyboard-shortcuts.md#keyboard-shortcut-contexts).
28
28
  *
29
29
  * Each `ShortcutContext` object stores and manages its own set of keyboard shortcuts.
30
30
  *
@@ -20,7 +20,7 @@ export function isContextObject(objectToCheck) {
20
20
 
21
21
  /* eslint-disable jsdoc/require-description-complete-sentence */
22
22
  /**
23
- * The `ShortcutContext` API lets you store and manage [keyboard shortcuts](@/guides/accessories-and-menus/keyboard-shortcuts.md) in a given [context](@/guides/accessories-and-menus/keyboard-shortcuts.md#keyboard-shortcut-contexts).
23
+ * The `ShortcutContext` API lets you store and manage [keyboard shortcuts](@/guides/navigation/keyboard-shortcuts.md) in a given [context](@/guides/navigation/keyboard-shortcuts.md#keyboard-shortcut-contexts).
24
24
  *
25
25
  * Each `ShortcutContext` object stores and manages its own set of keyboard shortcuts.
26
26
  *
@@ -9,7 +9,7 @@ var _recorder = require("./recorder");
9
9
  var _templateLiteralTag = require("../helpers/templateLiteralTag");
10
10
  /* eslint-disable jsdoc/require-description-complete-sentence */
11
11
  /**
12
- * The `ShortcutManager` API lets you store and manage [keyboard shortcut contexts](@/guides/accessories-and-menus/keyboard-shortcuts.md#keyboard-shortcut-contexts) ([`ShortcutContext`](@/api/shortcutContext.md)).
12
+ * The `ShortcutManager` API lets you store and manage [keyboard shortcut contexts](@/guides/navigation/keyboard-shortcuts.md#keyboard-shortcut-contexts) ([`ShortcutContext`](@/api/shortcutContext.md)).
13
13
  *
14
14
  * Each `ShortcutManager` object:
15
15
  * - Stores and manages its own set of keyboard shortcut contexts.
@@ -20,7 +20,7 @@ var _templateLiteralTag = require("../helpers/templateLiteralTag");
20
20
  * @param {object} options The manager's options
21
21
  * @param {EventTarget} options.ownerWindow A starting `window` element
22
22
  * @param {Function} options.handleEvent A condition on which `event` is handled.
23
- * @param {Function} options.beforeKeyDown A hook fired before the `keydown` event is handled. You can use it to [block a keyboard shortcut's actions](@/guides/accessories-and-menus/keyboard-shortcuts.md#block-a-keyboard-shortcut-s-actions).
23
+ * @param {Function} options.beforeKeyDown A hook fired before the `keydown` event is handled. You can use it to [block a keyboard shortcut's actions](@/guides/navigation/keyboard-shortcuts.md#block-a-keyboard-shortcut-s-actions).
24
24
  * @param {Function} options.afterKeyDown A hook fired after the `keydown` event is handled
25
25
  */
26
26
  const createShortcutManager = _ref => {
@@ -6,7 +6,7 @@ import { useRecorder } from "./recorder.mjs";
6
6
  import { toSingleLine } from "../helpers/templateLiteralTag.mjs";
7
7
  /* eslint-disable jsdoc/require-description-complete-sentence */
8
8
  /**
9
- * The `ShortcutManager` API lets you store and manage [keyboard shortcut contexts](@/guides/accessories-and-menus/keyboard-shortcuts.md#keyboard-shortcut-contexts) ([`ShortcutContext`](@/api/shortcutContext.md)).
9
+ * The `ShortcutManager` API lets you store and manage [keyboard shortcut contexts](@/guides/navigation/keyboard-shortcuts.md#keyboard-shortcut-contexts) ([`ShortcutContext`](@/api/shortcutContext.md)).
10
10
  *
11
11
  * Each `ShortcutManager` object:
12
12
  * - Stores and manages its own set of keyboard shortcut contexts.
@@ -17,7 +17,7 @@ import { toSingleLine } from "../helpers/templateLiteralTag.mjs";
17
17
  * @param {object} options The manager's options
18
18
  * @param {EventTarget} options.ownerWindow A starting `window` element
19
19
  * @param {Function} options.handleEvent A condition on which `event` is handled.
20
- * @param {Function} options.beforeKeyDown A hook fired before the `keydown` event is handled. You can use it to [block a keyboard shortcut's actions](@/guides/accessories-and-menus/keyboard-shortcuts.md#block-a-keyboard-shortcut-s-actions).
20
+ * @param {Function} options.beforeKeyDown A hook fired before the `keydown` event is handled. You can use it to [block a keyboard shortcut's actions](@/guides/navigation/keyboard-shortcuts.md#block-a-keyboard-shortcut-s-actions).
21
21
  * @param {Function} options.afterKeyDown A hook fired after the `keydown` event is handled
22
22
  */
23
23
  export const createShortcutManager = _ref => {