handsontable 0.0.0-next-a417c2b-20231124 → 0.0.0-next-301795f-20231127

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

Files changed (43) hide show
  1. package/3rdparty/walkontable/src/overlay/_base.js +2 -2
  2. package/3rdparty/walkontable/src/overlay/_base.mjs +2 -2
  3. package/3rdparty/walkontable/src/renderer/columnHeaders.js +1 -1
  4. package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +2 -2
  5. package/3rdparty/walkontable/src/renderer/rows.js +1 -1
  6. package/3rdparty/walkontable/src/renderer/rows.mjs +2 -2
  7. package/base.js +2 -2
  8. package/base.mjs +2 -2
  9. package/dataMap/replaceData.js +3 -1
  10. package/dataMap/replaceData.mjs +3 -1
  11. package/dist/handsontable.css +2 -2
  12. package/dist/handsontable.full.css +2 -2
  13. package/dist/handsontable.full.js +115 -99
  14. package/dist/handsontable.full.min.css +2 -2
  15. package/dist/handsontable.full.min.js +6 -6
  16. package/dist/handsontable.js +115 -99
  17. package/dist/handsontable.min.css +2 -2
  18. package/dist/handsontable.min.js +31 -31
  19. package/editors/dateEditor/dateEditor.js +0 -7
  20. package/editors/dateEditor/dateEditor.mjs +1 -8
  21. package/editors/handsontableEditor/handsontableEditor.js +0 -7
  22. package/editors/handsontableEditor/handsontableEditor.mjs +1 -8
  23. package/editors/passwordEditor/passwordEditor.js +4 -0
  24. package/editors/passwordEditor/passwordEditor.mjs +5 -1
  25. package/focusManager.js +56 -44
  26. package/focusManager.mjs +56 -44
  27. package/helpers/a11y.js +2 -0
  28. package/helpers/a11y.mjs +1 -0
  29. package/helpers/mixed.js +1 -1
  30. package/helpers/mixed.mjs +1 -1
  31. package/package.json +1 -1
  32. package/renderers/autocompleteRenderer/autocompleteRenderer.js +0 -3
  33. package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +1 -4
  34. package/renderers/checkboxRenderer/checkboxRenderer.js +0 -1
  35. package/renderers/checkboxRenderer/checkboxRenderer.mjs +0 -1
  36. package/renderers/dateRenderer/dateRenderer.js +0 -5
  37. package/renderers/dateRenderer/dateRenderer.mjs +0 -5
  38. package/renderers/handsontableRenderer/handsontableRenderer.js +0 -5
  39. package/renderers/handsontableRenderer/handsontableRenderer.mjs +0 -5
  40. package/renderers/selectRenderer/selectRenderer.js +0 -5
  41. package/renderers/selectRenderer/selectRenderer.mjs +0 -5
  42. package/tableView.js +31 -2
  43. package/tableView.mjs +31 -2
@@ -7,7 +7,6 @@ var _pikaday = _interopRequireDefault(require("pikaday"));
7
7
  var _textEditor = require("../textEditor");
8
8
  var _eventManager = _interopRequireDefault(require("../../eventManager"));
9
9
  var _element = require("../../helpers/dom/element");
10
- var _a11y = require("../../helpers/a11y");
11
10
  var _object = require("../../helpers/object");
12
11
  var _unicode = require("../../helpers/unicode");
13
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -134,9 +133,6 @@ class DateEditor extends _textEditor.TextEditor {
134
133
  const editorContext = shortcutManager.getContext('editor');
135
134
  super.open();
136
135
  this.showDatepicker(event);
137
- if (this.hot.getSettings().ariaTags) {
138
- (0, _element.setAttribute)(this.TD, [(0, _a11y.A11Y_EXPANDED)('true')]);
139
- }
140
136
  editorContext.addShortcut({
141
137
  keys: [['Enter']],
142
138
  callback: keyboardEvent => {
@@ -162,9 +158,6 @@ class DateEditor extends _textEditor.TextEditor {
162
158
  this.hot._registerTimeout(() => {
163
159
  this.hot._refreshBorders();
164
160
  });
165
- if (this.TD && this.hot.getSettings().ariaTags) {
166
- (0, _element.setAttribute)(this.TD, [(0, _a11y.A11Y_EXPANDED)('false')]);
167
- }
168
161
  const shortcutManager = this.hot.getShortcutManager();
169
162
  const editorContext = shortcutManager.getContext('editor');
170
163
  editorContext.removeShortcutsByGroup(SHORTCUTS_GROUP_EDITOR);
@@ -6,8 +6,7 @@ import moment from 'moment';
6
6
  import Pikaday from 'pikaday';
7
7
  import { TextEditor } from "../textEditor/index.mjs";
8
8
  import EventManager from "../../eventManager.mjs";
9
- import { addClass, hasClass, outerHeight, outerWidth, setAttribute } from "../../helpers/dom/element.mjs";
10
- import { A11Y_EXPANDED } from "../../helpers/a11y.mjs";
9
+ import { addClass, hasClass, outerHeight, outerWidth } from "../../helpers/dom/element.mjs";
11
10
  import { deepExtend } from "../../helpers/object.mjs";
12
11
  import { isFunctionKey } from "../../helpers/unicode.mjs";
13
12
  export const EDITOR_TYPE = 'date';
@@ -129,9 +128,6 @@ export class DateEditor extends TextEditor {
129
128
  const editorContext = shortcutManager.getContext('editor');
130
129
  super.open();
131
130
  this.showDatepicker(event);
132
- if (this.hot.getSettings().ariaTags) {
133
- setAttribute(this.TD, [A11Y_EXPANDED('true')]);
134
- }
135
131
  editorContext.addShortcut({
136
132
  keys: [['Enter']],
137
133
  callback: keyboardEvent => {
@@ -157,9 +153,6 @@ export class DateEditor extends TextEditor {
157
153
  this.hot._registerTimeout(() => {
158
154
  this.hot._refreshBorders();
159
155
  });
160
- if (this.TD && this.hot.getSettings().ariaTags) {
161
- setAttribute(this.TD, [A11Y_EXPANDED('false')]);
162
- }
163
156
  const shortcutManager = this.hot.getShortcutManager();
164
157
  const editorContext = shortcutManager.getContext('editor');
165
158
  editorContext.removeShortcutsByGroup(SHORTCUTS_GROUP_EDITOR);
@@ -6,7 +6,6 @@ var _element = require("../../helpers/dom/element");
6
6
  var _event = require("../../helpers/dom/event");
7
7
  var _object = require("../../helpers/object");
8
8
  var _editorManager = require("../../editorManager");
9
- var _a11y = require("../../helpers/a11y");
10
9
  const SHORTCUTS_GROUP = 'handsontableEditor';
11
10
  const EDITOR_TYPE = 'handsontable';
12
11
 
@@ -43,9 +42,6 @@ class HandsontableEditor extends _textEditor.TextEditor {
43
42
  }
44
43
  (0, _element.setCaretPosition)(this.TEXTAREA, 0, this.TEXTAREA.value.length);
45
44
  this.refreshDimensions();
46
- if (this.hot.getSettings().ariaTags) {
47
- (0, _element.setAttribute)(this.TD, [(0, _a11y.A11Y_EXPANDED)('true')]);
48
- }
49
45
  }
50
46
 
51
47
  /**
@@ -57,9 +53,6 @@ class HandsontableEditor extends _textEditor.TextEditor {
57
53
  }
58
54
  this.removeHooksByKey('beforeKeyDown');
59
55
  super.close();
60
- if (this.TD && this.hot.getSettings().ariaTags) {
61
- (0, _element.setAttribute)(this.TD, [(0, _a11y.A11Y_EXPANDED)('false')]);
62
- }
63
56
  }
64
57
 
65
58
  /**
@@ -1,9 +1,8 @@
1
1
  import { TextEditor } from "../textEditor/index.mjs";
2
- import { setAttribute, setCaretPosition } from "../../helpers/dom/element.mjs";
2
+ import { setCaretPosition } from "../../helpers/dom/element.mjs";
3
3
  import { stopImmediatePropagation } from "../../helpers/dom/event.mjs";
4
4
  import { extend } from "../../helpers/object.mjs";
5
5
  import { SHORTCUTS_GROUP_NAVIGATION } from "../../editorManager.mjs";
6
- import { A11Y_EXPANDED } from "../../helpers/a11y.mjs";
7
6
  const SHORTCUTS_GROUP = 'handsontableEditor';
8
7
  export const EDITOR_TYPE = 'handsontable';
9
8
 
@@ -39,9 +38,6 @@ export class HandsontableEditor extends TextEditor {
39
38
  }
40
39
  setCaretPosition(this.TEXTAREA, 0, this.TEXTAREA.value.length);
41
40
  this.refreshDimensions();
42
- if (this.hot.getSettings().ariaTags) {
43
- setAttribute(this.TD, [A11Y_EXPANDED('true')]);
44
- }
45
41
  }
46
42
 
47
43
  /**
@@ -53,9 +49,6 @@ export class HandsontableEditor extends TextEditor {
53
49
  }
54
50
  this.removeHooksByKey('beforeKeyDown');
55
51
  super.close();
56
- if (this.TD && this.hot.getSettings().ariaTags) {
57
- setAttribute(this.TD, [A11Y_EXPANDED('false')]);
58
- }
59
52
  }
60
53
 
61
54
  /**
@@ -3,6 +3,7 @@
3
3
  exports.__esModule = true;
4
4
  var _textEditor = require("../textEditor");
5
5
  var _element = require("../../helpers/dom/element");
6
+ var _a11y = require("../../helpers/a11y");
6
7
  const EDITOR_TYPE = 'password';
7
8
 
8
9
  /**
@@ -23,6 +24,9 @@ class PasswordEditor extends _textEditor.TextEditor {
23
24
  this.textareaStyle = this.TEXTAREA.style;
24
25
  this.textareaStyle.width = 0;
25
26
  this.textareaStyle.height = 0;
27
+ if (this.hot.getSettings().ariaTags) {
28
+ (0, _element.setAttribute)(this.TEXTAREA, [(0, _a11y.A11Y_HIDDEN)()]);
29
+ }
26
30
  (0, _element.empty)(this.TEXTAREA_PARENT);
27
31
  this.TEXTAREA_PARENT.appendChild(this.TEXTAREA);
28
32
  }
@@ -1,5 +1,6 @@
1
1
  import { TextEditor } from "../textEditor/index.mjs";
2
- import { empty } from "../../helpers/dom/element.mjs";
2
+ import { empty, setAttribute } from "../../helpers/dom/element.mjs";
3
+ import { A11Y_HIDDEN } from "../../helpers/a11y.mjs";
3
4
  export const EDITOR_TYPE = 'password';
4
5
 
5
6
  /**
@@ -19,6 +20,9 @@ export class PasswordEditor extends TextEditor {
19
20
  this.textareaStyle = this.TEXTAREA.style;
20
21
  this.textareaStyle.width = 0;
21
22
  this.textareaStyle.height = 0;
23
+ if (this.hot.getSettings().ariaTags) {
24
+ setAttribute(this.TEXTAREA, [A11Y_HIDDEN()]);
25
+ }
22
26
  empty(this.TEXTAREA_PARENT);
23
27
  this.TEXTAREA_PARENT.appendChild(this.TEXTAREA);
24
28
  }
package/focusManager.js CHANGED
@@ -33,7 +33,6 @@ var _hot = /*#__PURE__*/new WeakMap();
33
33
  var _focusMode = /*#__PURE__*/new WeakMap();
34
34
  var _refocusDelay = /*#__PURE__*/new WeakMap();
35
35
  var _refocusElementGetter = /*#__PURE__*/new WeakMap();
36
- var _getCurrentHighlightCoords = /*#__PURE__*/new WeakSet();
37
36
  var _getSelectedCell = /*#__PURE__*/new WeakSet();
38
37
  var _manageFocus = /*#__PURE__*/new WeakSet();
39
38
  var _onUpdateSettings = /*#__PURE__*/new WeakSet();
@@ -57,15 +56,9 @@ class FocusManager {
57
56
  * Get and return the currently selected and highlighted cell/header element.
58
57
  *
59
58
  * @private
60
- * @returns {HTMLTableCellElement}
59
+ * @param {Function} [callback] Callback function to be called after the cell element is retrieved.
61
60
  */
62
61
  _classPrivateMethodInitSpec(this, _getSelectedCell);
63
- /**
64
- * Get the coordinates of the highlight of the currently selected cell/header.
65
- *
66
- * @returns {CellCoords}
67
- */
68
- _classPrivateMethodInitSpec(this, _getCurrentHighlightCoords);
69
62
  /**
70
63
  * The Handsontable instance.
71
64
  */
@@ -195,17 +188,26 @@ class FocusManager {
195
188
  * @param {HTMLTableCellElement} [selectedCell] The highlighted cell/header element.
196
189
  */
197
190
  focusOnHighlightedCell(selectedCell) {
198
- var _classPrivateFieldGet3;
199
- const currentHighlightCoords = _classPrivateMethodGet(this, _getCurrentHighlightCoords, _getCurrentHighlightCoords2).call(this);
200
- const currentlySelectedHighlight = selectedCell || _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this);
201
- let elementToBeFocused = _classPrivateFieldGet(this, _hot).runHooks('modifyFocusedElement', currentHighlightCoords.row, currentHighlightCoords.col, currentlySelectedHighlight);
202
- if (!(elementToBeFocused instanceof HTMLElement)) {
203
- elementToBeFocused = currentlySelectedHighlight;
204
- }
205
- if (elementToBeFocused && !((_classPrivateFieldGet3 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet3 !== void 0 && _classPrivateFieldGet3.isOpened())) {
206
- elementToBeFocused.focus({
207
- preventScroll: true
208
- });
191
+ const focusElement = element => {
192
+ var _classPrivateFieldGet3, _classPrivateFieldGet4;
193
+ const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.highlight;
194
+ if (!currentHighlightCoords || !element) {
195
+ return;
196
+ }
197
+ let elementToBeFocused = _classPrivateFieldGet(this, _hot).runHooks('modifyFocusedElement', currentHighlightCoords.row, currentHighlightCoords.col, element);
198
+ if (!(elementToBeFocused instanceof HTMLElement)) {
199
+ elementToBeFocused = element;
200
+ }
201
+ if (elementToBeFocused && !((_classPrivateFieldGet4 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet4 !== void 0 && _classPrivateFieldGet4.isOpened())) {
202
+ elementToBeFocused.focus({
203
+ preventScroll: true
204
+ });
205
+ }
206
+ };
207
+ if (selectedCell) {
208
+ focusElement(selectedCell);
209
+ } else {
210
+ _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, element => focusElement(element));
209
211
  }
210
212
  }
211
213
 
@@ -216,12 +218,12 @@ class FocusManager {
216
218
  * @param {number} delay Delay in milliseconds.
217
219
  */
218
220
  refocusToEditorTextarea() {
219
- var _classPrivateFieldGet4;
221
+ var _classPrivateFieldGet5;
220
222
  let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _classPrivateFieldGet(this, _refocusDelay);
221
223
  const refocusElement = this.getRefocusElement();
222
224
 
223
225
  // Re-focus on the editor's `TEXTAREA` element (or a predefined element) if the `imeFastEdit` option is enabled.
224
- if (_classPrivateFieldGet(this, _hot).getSettings().imeFastEdit && !((_classPrivateFieldGet4 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet4 !== void 0 && _classPrivateFieldGet4.isOpened()) && !!refocusElement) {
226
+ if (_classPrivateFieldGet(this, _hot).getSettings().imeFastEdit && !((_classPrivateFieldGet5 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet5 !== void 0 && _classPrivateFieldGet5.isOpened()) && !!refocusElement) {
225
227
  _classPrivateFieldGet(this, _hot)._registerTimeout(() => {
226
228
  refocusElement.select();
227
229
  }, delay);
@@ -229,34 +231,44 @@ class FocusManager {
229
231
  }
230
232
  }
231
233
  exports.FocusManager = FocusManager;
232
- function _getCurrentHighlightCoords2() {
233
- const lastSelectedRange = _classPrivateFieldGet(this, _hot).getSelectedRangeLast();
234
- return lastSelectedRange.highlight;
235
- }
236
234
  function _getSelectedCell2() {
237
- const selectedCellCoords = _classPrivateMethodGet(this, _getCurrentHighlightCoords, _getCurrentHighlightCoords2).call(this);
238
- return _classPrivateFieldGet(this, _hot).getCell(selectedCellCoords.row, selectedCellCoords.col, true);
239
- }
240
- function _manageFocus2() {
241
- const selectedCell = _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this);
242
- const {
243
- activeElement
244
- } = _classPrivateFieldGet(this, _hot).rootDocument;
245
-
246
- // Blurring the `activeElement` removes the unwanted border around the focusable element (#6877)
247
- // and resets the `document.activeElement` property. The blurring should happen only when the
248
- // previously selected input element has not belonged to the Handsontable editor. If blurring is
249
- // triggered for all elements, there is a problem with the disappearing IME editor (#9672).
250
- if (activeElement && (0, _element.isOutsideInput)(activeElement)) {
251
- activeElement.blur();
235
+ var _classPrivateFieldGet6;
236
+ let callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : () => {};
237
+ const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet6 === void 0 ? void 0 : _classPrivateFieldGet6.highlight;
238
+ if (!highlight) {
239
+ _classPrivateFieldGet(this, _hot)._registerTimeout(() => callback(null));
240
+ return;
252
241
  }
253
- this.focusOnHighlightedCell(selectedCell);
254
- if (this.getFocusMode() === FOCUS_MODES.MIXED && selectedCell.nodeName === 'TD') {
255
- _classPrivateFieldGet(this, _hot).addHookOnce('afterSelectionEnd', () => {
256
- this.refocusToEditorTextarea();
242
+ const cell = _classPrivateFieldGet(this, _hot).getCell(highlight.row, highlight.col, true);
243
+ if (cell === null) {
244
+ _classPrivateFieldGet(this, _hot).addHookOnce('afterScroll', () => {
245
+ callback(_classPrivateFieldGet(this, _hot).getCell(highlight.row, highlight.col, true));
257
246
  });
247
+ } else {
248
+ callback(cell);
258
249
  }
259
250
  }
251
+ function _manageFocus2() {
252
+ _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, selectedCell => {
253
+ const {
254
+ activeElement
255
+ } = _classPrivateFieldGet(this, _hot).rootDocument;
256
+
257
+ // Blurring the `activeElement` removes the unwanted border around the focusable element (#6877)
258
+ // and resets the `document.activeElement` property. The blurring should happen only when the
259
+ // previously selected input element has not belonged to the Handsontable editor. If blurring is
260
+ // triggered for all elements, there is a problem with the disappearing IME editor (#9672).
261
+ if (activeElement && (0, _element.isOutsideInput)(activeElement)) {
262
+ activeElement.blur();
263
+ }
264
+ this.focusOnHighlightedCell(selectedCell);
265
+ if (this.getFocusMode() === FOCUS_MODES.MIXED && selectedCell.nodeName === 'TD') {
266
+ _classPrivateFieldGet(this, _hot).addHookOnce('afterSelectionEnd', () => {
267
+ this.refocusToEditorTextarea();
268
+ });
269
+ }
270
+ });
271
+ }
260
272
  function _onUpdateSettings2(newSettings) {
261
273
  if (newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.MIXED) {
262
274
  this.setFocusMode(FOCUS_MODES.MIXED);
package/focusManager.mjs CHANGED
@@ -30,7 +30,6 @@ var _hot = /*#__PURE__*/new WeakMap();
30
30
  var _focusMode = /*#__PURE__*/new WeakMap();
31
31
  var _refocusDelay = /*#__PURE__*/new WeakMap();
32
32
  var _refocusElementGetter = /*#__PURE__*/new WeakMap();
33
- var _getCurrentHighlightCoords = /*#__PURE__*/new WeakSet();
34
33
  var _getSelectedCell = /*#__PURE__*/new WeakSet();
35
34
  var _manageFocus = /*#__PURE__*/new WeakSet();
36
35
  var _onUpdateSettings = /*#__PURE__*/new WeakSet();
@@ -54,15 +53,9 @@ export class FocusManager {
54
53
  * Get and return the currently selected and highlighted cell/header element.
55
54
  *
56
55
  * @private
57
- * @returns {HTMLTableCellElement}
56
+ * @param {Function} [callback] Callback function to be called after the cell element is retrieved.
58
57
  */
59
58
  _classPrivateMethodInitSpec(this, _getSelectedCell);
60
- /**
61
- * Get the coordinates of the highlight of the currently selected cell/header.
62
- *
63
- * @returns {CellCoords}
64
- */
65
- _classPrivateMethodInitSpec(this, _getCurrentHighlightCoords);
66
59
  /**
67
60
  * The Handsontable instance.
68
61
  */
@@ -192,17 +185,26 @@ export class FocusManager {
192
185
  * @param {HTMLTableCellElement} [selectedCell] The highlighted cell/header element.
193
186
  */
194
187
  focusOnHighlightedCell(selectedCell) {
195
- var _classPrivateFieldGet3;
196
- const currentHighlightCoords = _classPrivateMethodGet(this, _getCurrentHighlightCoords, _getCurrentHighlightCoords2).call(this);
197
- const currentlySelectedHighlight = selectedCell || _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this);
198
- let elementToBeFocused = _classPrivateFieldGet(this, _hot).runHooks('modifyFocusedElement', currentHighlightCoords.row, currentHighlightCoords.col, currentlySelectedHighlight);
199
- if (!(elementToBeFocused instanceof HTMLElement)) {
200
- elementToBeFocused = currentlySelectedHighlight;
201
- }
202
- if (elementToBeFocused && !((_classPrivateFieldGet3 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet3 !== void 0 && _classPrivateFieldGet3.isOpened())) {
203
- elementToBeFocused.focus({
204
- preventScroll: true
205
- });
188
+ const focusElement = element => {
189
+ var _classPrivateFieldGet3, _classPrivateFieldGet4;
190
+ const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.highlight;
191
+ if (!currentHighlightCoords || !element) {
192
+ return;
193
+ }
194
+ let elementToBeFocused = _classPrivateFieldGet(this, _hot).runHooks('modifyFocusedElement', currentHighlightCoords.row, currentHighlightCoords.col, element);
195
+ if (!(elementToBeFocused instanceof HTMLElement)) {
196
+ elementToBeFocused = element;
197
+ }
198
+ if (elementToBeFocused && !((_classPrivateFieldGet4 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet4 !== void 0 && _classPrivateFieldGet4.isOpened())) {
199
+ elementToBeFocused.focus({
200
+ preventScroll: true
201
+ });
202
+ }
203
+ };
204
+ if (selectedCell) {
205
+ focusElement(selectedCell);
206
+ } else {
207
+ _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, element => focusElement(element));
206
208
  }
207
209
  }
208
210
 
@@ -213,46 +215,56 @@ export class FocusManager {
213
215
  * @param {number} delay Delay in milliseconds.
214
216
  */
215
217
  refocusToEditorTextarea() {
216
- var _classPrivateFieldGet4;
218
+ var _classPrivateFieldGet5;
217
219
  let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _classPrivateFieldGet(this, _refocusDelay);
218
220
  const refocusElement = this.getRefocusElement();
219
221
 
220
222
  // Re-focus on the editor's `TEXTAREA` element (or a predefined element) if the `imeFastEdit` option is enabled.
221
- if (_classPrivateFieldGet(this, _hot).getSettings().imeFastEdit && !((_classPrivateFieldGet4 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet4 !== void 0 && _classPrivateFieldGet4.isOpened()) && !!refocusElement) {
223
+ if (_classPrivateFieldGet(this, _hot).getSettings().imeFastEdit && !((_classPrivateFieldGet5 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet5 !== void 0 && _classPrivateFieldGet5.isOpened()) && !!refocusElement) {
222
224
  _classPrivateFieldGet(this, _hot)._registerTimeout(() => {
223
225
  refocusElement.select();
224
226
  }, delay);
225
227
  }
226
228
  }
227
229
  }
228
- function _getCurrentHighlightCoords2() {
229
- const lastSelectedRange = _classPrivateFieldGet(this, _hot).getSelectedRangeLast();
230
- return lastSelectedRange.highlight;
231
- }
232
230
  function _getSelectedCell2() {
233
- const selectedCellCoords = _classPrivateMethodGet(this, _getCurrentHighlightCoords, _getCurrentHighlightCoords2).call(this);
234
- return _classPrivateFieldGet(this, _hot).getCell(selectedCellCoords.row, selectedCellCoords.col, true);
235
- }
236
- function _manageFocus2() {
237
- const selectedCell = _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this);
238
- const {
239
- activeElement
240
- } = _classPrivateFieldGet(this, _hot).rootDocument;
241
-
242
- // Blurring the `activeElement` removes the unwanted border around the focusable element (#6877)
243
- // and resets the `document.activeElement` property. The blurring should happen only when the
244
- // previously selected input element has not belonged to the Handsontable editor. If blurring is
245
- // triggered for all elements, there is a problem with the disappearing IME editor (#9672).
246
- if (activeElement && isOutsideInput(activeElement)) {
247
- activeElement.blur();
231
+ var _classPrivateFieldGet6;
232
+ let callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : () => {};
233
+ const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet6 === void 0 ? void 0 : _classPrivateFieldGet6.highlight;
234
+ if (!highlight) {
235
+ _classPrivateFieldGet(this, _hot)._registerTimeout(() => callback(null));
236
+ return;
248
237
  }
249
- this.focusOnHighlightedCell(selectedCell);
250
- if (this.getFocusMode() === FOCUS_MODES.MIXED && selectedCell.nodeName === 'TD') {
251
- _classPrivateFieldGet(this, _hot).addHookOnce('afterSelectionEnd', () => {
252
- this.refocusToEditorTextarea();
238
+ const cell = _classPrivateFieldGet(this, _hot).getCell(highlight.row, highlight.col, true);
239
+ if (cell === null) {
240
+ _classPrivateFieldGet(this, _hot).addHookOnce('afterScroll', () => {
241
+ callback(_classPrivateFieldGet(this, _hot).getCell(highlight.row, highlight.col, true));
253
242
  });
243
+ } else {
244
+ callback(cell);
254
245
  }
255
246
  }
247
+ function _manageFocus2() {
248
+ _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, selectedCell => {
249
+ const {
250
+ activeElement
251
+ } = _classPrivateFieldGet(this, _hot).rootDocument;
252
+
253
+ // Blurring the `activeElement` removes the unwanted border around the focusable element (#6877)
254
+ // and resets the `document.activeElement` property. The blurring should happen only when the
255
+ // previously selected input element has not belonged to the Handsontable editor. If blurring is
256
+ // triggered for all elements, there is a problem with the disappearing IME editor (#9672).
257
+ if (activeElement && isOutsideInput(activeElement)) {
258
+ activeElement.blur();
259
+ }
260
+ this.focusOnHighlightedCell(selectedCell);
261
+ if (this.getFocusMode() === FOCUS_MODES.MIXED && selectedCell.nodeName === 'TD') {
262
+ _classPrivateFieldGet(this, _hot).addHookOnce('afterSelectionEnd', () => {
263
+ this.refocusToEditorTextarea();
264
+ });
265
+ }
266
+ });
267
+ }
256
268
  function _onUpdateSettings2(newSettings) {
257
269
  if (newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.MIXED) {
258
270
  this.setFocusMode(FOCUS_MODES.MIXED);
package/helpers/a11y.js CHANGED
@@ -11,6 +11,8 @@ const A11Y_GRIDCELL = () => ['role', 'gridcell'];
11
11
  exports.A11Y_GRIDCELL = A11Y_GRIDCELL;
12
12
  const A11Y_ROWHEADER = () => ['role', 'rowheader'];
13
13
  exports.A11Y_ROWHEADER = A11Y_ROWHEADER;
14
+ const A11Y_ROWGROUP = () => ['role', 'rowgroup'];
15
+ exports.A11Y_ROWGROUP = A11Y_ROWGROUP;
14
16
  const A11Y_COLUMNHEADER = () => ['role', 'columnheader'];
15
17
  exports.A11Y_COLUMNHEADER = A11Y_COLUMNHEADER;
16
18
  const A11Y_ROW = () => ['role', 'row'];
package/helpers/a11y.mjs CHANGED
@@ -3,6 +3,7 @@ export const A11Y_TREEGRID = () => ['role', 'treegrid'];
3
3
  export const A11Y_PRESENTATION = () => ['role', 'presentation'];
4
4
  export const A11Y_GRIDCELL = () => ['role', 'gridcell'];
5
5
  export const A11Y_ROWHEADER = () => ['role', 'rowheader'];
6
+ export const A11Y_ROWGROUP = () => ['role', 'rowgroup'];
6
7
  export const A11Y_COLUMNHEADER = () => ['role', 'columnheader'];
7
8
  export const A11Y_ROW = () => ['role', 'row'];
8
9
  export const A11Y_MENU = () => ['role', 'menu'];
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-a417c2b-20231124";
137
+ const hotVersion = "0.0.0-next-301795f-20231127";
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-a417c2b-20231124";
127
+ const hotVersion = "0.0.0-next-301795f-20231127";
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-a417c2b-20231124",
13
+ "version": "0.0.0-next-301795f-20231127",
14
14
  "main": "index",
15
15
  "module": "index.mjs",
16
16
  "jsnext:main": "index.mjs",
@@ -45,9 +45,6 @@ function autocompleteRenderer(hotInstance, TD, row, col, prop, value, cellProper
45
45
 
46
46
  TD.insertBefore(ARROW, TD.firstChild);
47
47
  (0, _element.addClass)(TD, 'htAutocomplete');
48
- if (isAriaEnabled) {
49
- TD.setAttribute(...(0, _a11y.A11Y_HASPOPUP)('listbox'));
50
- }
51
48
  if (!hotInstance.acArrowListener) {
52
49
  const eventManager = new _eventManager.default(hotInstance);
53
50
 
@@ -2,7 +2,7 @@ import { htmlRenderer } from "../htmlRenderer/index.mjs";
2
2
  import { textRenderer } from "../textRenderer/index.mjs";
3
3
  import EventManager from "../../eventManager.mjs";
4
4
  import { addClass, hasClass } from "../../helpers/dom/element.mjs";
5
- import { A11Y_HASPOPUP, A11Y_HIDDEN } from "../../helpers/a11y.mjs";
5
+ import { A11Y_HIDDEN } from "../../helpers/a11y.mjs";
6
6
  export const RENDERER_TYPE = 'autocomplete';
7
7
 
8
8
  /**
@@ -39,9 +39,6 @@ export function autocompleteRenderer(hotInstance, TD, row, col, prop, value, cel
39
39
 
40
40
  TD.insertBefore(ARROW, TD.firstChild);
41
41
  addClass(TD, 'htAutocomplete');
42
- if (isAriaEnabled) {
43
- TD.setAttribute(...A11Y_HASPOPUP('listbox'));
44
- }
45
42
  if (!hotInstance.acArrowListener) {
46
43
  const eventManager = new EventManager(hotInstance);
47
44
 
@@ -295,7 +295,6 @@ function createInput(rootDocument) {
295
295
  const input = rootDocument.createElement('input');
296
296
  input.className = 'htCheckboxRendererInput';
297
297
  input.type = 'checkbox';
298
- input.setAttribute('autocomplete', 'off');
299
298
  input.setAttribute('tabindex', '-1');
300
299
  return input.cloneNode(false);
301
300
  }
@@ -289,7 +289,6 @@ function createInput(rootDocument) {
289
289
  const input = rootDocument.createElement('input');
290
290
  input.className = 'htCheckboxRendererInput';
291
291
  input.type = 'checkbox';
292
- input.setAttribute('autocomplete', 'off');
293
292
  input.setAttribute('tabindex', '-1');
294
293
  return input.cloneNode(false);
295
294
  }
@@ -3,8 +3,6 @@
3
3
  exports.__esModule = true;
4
4
  exports.dateRenderer = dateRenderer;
5
5
  var _autocompleteRenderer = require("../autocompleteRenderer");
6
- var _a11y = require("../../helpers/a11y");
7
- var _element = require("../../helpers/dom/element");
8
6
  const RENDERER_TYPE = 'date';
9
7
 
10
8
  /**
@@ -22,8 +20,5 @@ const RENDERER_TYPE = 'date';
22
20
  exports.RENDERER_TYPE = RENDERER_TYPE;
23
21
  function dateRenderer(hotInstance, TD, row, col, prop, value, cellProperties) {
24
22
  _autocompleteRenderer.autocompleteRenderer.apply(this, [hotInstance, TD, row, col, prop, value, cellProperties]);
25
- if (hotInstance.getSettings().ariaTags) {
26
- (0, _element.setAttribute)(TD, [(0, _a11y.A11Y_HASPOPUP)('dialog'), (0, _a11y.A11Y_EXPANDED)('false')]);
27
- }
28
23
  }
29
24
  dateRenderer.RENDERER_TYPE = RENDERER_TYPE;
@@ -1,6 +1,4 @@
1
1
  import { autocompleteRenderer } from "../autocompleteRenderer/index.mjs";
2
- import { A11Y_EXPANDED, A11Y_HASPOPUP } from "../../helpers/a11y.mjs";
3
- import { setAttribute } from "../../helpers/dom/element.mjs";
4
2
  export const RENDERER_TYPE = 'date';
5
3
 
6
4
  /**
@@ -17,8 +15,5 @@ export const RENDERER_TYPE = 'date';
17
15
  */
18
16
  export function dateRenderer(hotInstance, TD, row, col, prop, value, cellProperties) {
19
17
  autocompleteRenderer.apply(this, [hotInstance, TD, row, col, prop, value, cellProperties]);
20
- if (hotInstance.getSettings().ariaTags) {
21
- setAttribute(TD, [A11Y_HASPOPUP('dialog'), A11Y_EXPANDED('false')]);
22
- }
23
18
  }
24
19
  dateRenderer.RENDERER_TYPE = RENDERER_TYPE;
@@ -3,8 +3,6 @@
3
3
  exports.__esModule = true;
4
4
  exports.handsontableRenderer = handsontableRenderer;
5
5
  var _autocompleteRenderer = require("../autocompleteRenderer");
6
- var _a11y = require("../../helpers/a11y");
7
- var _element = require("../../helpers/dom/element");
8
6
  const RENDERER_TYPE = 'handsontable';
9
7
 
10
8
  /**
@@ -22,8 +20,5 @@ const RENDERER_TYPE = 'handsontable';
22
20
  exports.RENDERER_TYPE = RENDERER_TYPE;
23
21
  function handsontableRenderer(hotInstance, TD, row, col, prop, value, cellProperties) {
24
22
  _autocompleteRenderer.autocompleteRenderer.apply(this, [hotInstance, TD, row, col, prop, value, cellProperties]);
25
- if (hotInstance.getSettings().ariaTags) {
26
- (0, _element.setAttribute)(TD, [(0, _a11y.A11Y_HASPOPUP)('true'), (0, _a11y.A11Y_EXPANDED)('false')]);
27
- }
28
23
  }
29
24
  handsontableRenderer.RENDERER_TYPE = RENDERER_TYPE;
@@ -1,6 +1,4 @@
1
1
  import { autocompleteRenderer } from "../autocompleteRenderer/index.mjs";
2
- import { A11Y_EXPANDED, A11Y_HASPOPUP } from "../../helpers/a11y.mjs";
3
- import { setAttribute } from "../../helpers/dom/element.mjs";
4
2
  export const RENDERER_TYPE = 'handsontable';
5
3
 
6
4
  /**
@@ -17,8 +15,5 @@ export const RENDERER_TYPE = 'handsontable';
17
15
  */
18
16
  export function handsontableRenderer(hotInstance, TD, row, col, prop, value, cellProperties) {
19
17
  autocompleteRenderer.apply(this, [hotInstance, TD, row, col, prop, value, cellProperties]);
20
- if (hotInstance.getSettings().ariaTags) {
21
- setAttribute(TD, [A11Y_HASPOPUP('true'), A11Y_EXPANDED('false')]);
22
- }
23
18
  }
24
19
  handsontableRenderer.RENDERER_TYPE = RENDERER_TYPE;
@@ -3,8 +3,6 @@
3
3
  exports.__esModule = true;
4
4
  exports.selectRenderer = selectRenderer;
5
5
  var _textRenderer = require("../textRenderer");
6
- var _a11y = require("../../helpers/a11y");
7
- var _element = require("../../helpers/dom/element");
8
6
  const RENDERER_TYPE = 'select';
9
7
 
10
8
  /**
@@ -20,8 +18,5 @@ const RENDERER_TYPE = 'select';
20
18
  exports.RENDERER_TYPE = RENDERER_TYPE;
21
19
  function selectRenderer(hotInstance, TD, row, col, prop, value, cellProperties) {
22
20
  _textRenderer.textRenderer.apply(this, [hotInstance, TD, row, col, prop, value, cellProperties]);
23
- if (hotInstance.getSettings().ariaTags) {
24
- (0, _element.setAttribute)(TD, ...(0, _a11y.A11Y_HASPOPUP)('listbox'));
25
- }
26
21
  }
27
22
  selectRenderer.RENDERER_TYPE = RENDERER_TYPE;