handsontable 0.0.0-next-f11b1a2-20231123 → 0.0.0-next-44acfea-20231127
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.
- package/3rdparty/walkontable/src/overlay/_base.js +2 -2
- package/3rdparty/walkontable/src/overlay/_base.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +2 -2
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +3 -3
- package/3rdparty/walkontable/src/renderer/rows.js +1 -1
- package/3rdparty/walkontable/src/renderer/rows.mjs +2 -2
- package/3rdparty/walkontable/src/selection/manager.js +8 -8
- package/3rdparty/walkontable/src/selection/manager.mjs +8 -8
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/focusDetector.js +1 -1
- package/core/focusCatcher/focusDetector.mjs +2 -2
- package/dataMap/replaceData.js +3 -1
- package/dataMap/replaceData.mjs +3 -1
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +103 -73
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +8 -8
- package/dist/handsontable.js +103 -73
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +31 -31
- package/editors/dateEditor/dateEditor.js +0 -7
- package/editors/dateEditor/dateEditor.mjs +1 -8
- package/editors/handsontableEditor/handsontableEditor.js +0 -7
- package/editors/handsontableEditor/handsontableEditor.mjs +1 -8
- package/editors/passwordEditor/passwordEditor.js +4 -0
- package/editors/passwordEditor/passwordEditor.mjs +5 -1
- package/helpers/a11y.js +2 -0
- package/helpers/a11y.mjs +1 -0
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/plugins/filters/filters.js +10 -1
- package/plugins/filters/filters.mjs +10 -1
- package/plugins/filters/menu/focusController.js +29 -10
- package/plugins/filters/menu/focusController.mjs +29 -10
- package/plugins/nestedRows/nestedRows.js +3 -0
- package/plugins/nestedRows/nestedRows.mjs +3 -0
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +0 -3
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +1 -4
- package/renderers/checkboxRenderer/checkboxRenderer.js +0 -1
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +0 -1
- package/renderers/dateRenderer/dateRenderer.js +0 -5
- package/renderers/dateRenderer/dateRenderer.mjs +0 -5
- package/renderers/handsontableRenderer/handsontableRenderer.js +0 -5
- package/renderers/handsontableRenderer/handsontableRenderer.mjs +0 -5
- package/renderers/selectRenderer/selectRenderer.js +0 -5
- package/renderers/selectRenderer/selectRenderer.mjs +0 -5
- package/selection/highlight/types/focus.js +2 -6
- package/selection/highlight/types/focus.mjs +2 -6
- package/selection/selection.js +0 -1
- package/selection/selection.mjs +0 -1
- package/tableView.js +31 -2
- 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
|
|
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 {
|
|
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/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-
|
|
137
|
+
const hotVersion = "0.0.0-next-44acfea-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-
|
|
127
|
+
const hotVersion = "0.0.0-next-44acfea-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-
|
|
13
|
+
"version": "0.0.0-next-44acfea-20231127",
|
|
14
14
|
"main": "index",
|
|
15
15
|
"module": "index.mjs",
|
|
16
16
|
"jsnext:main": "index.mjs",
|
|
@@ -297,7 +297,16 @@ class Filters extends _base.BasePlugin {
|
|
|
297
297
|
// A fake menu item that once focused allows escaping from the focus navigation (using Tab keys)
|
|
298
298
|
// to the menu navigation using arrow keys.
|
|
299
299
|
{
|
|
300
|
-
focus: () =>
|
|
300
|
+
focus: () => {
|
|
301
|
+
const menuNavigator = mainMenu.getNavigator();
|
|
302
|
+
const lastSelectedMenuItem = _classPrivateFieldGet(this, _menuFocusNavigator).getLastMenuPage();
|
|
303
|
+
mainMenu.focus();
|
|
304
|
+
if (lastSelectedMenuItem > 0) {
|
|
305
|
+
menuNavigator.setCurrentPage(lastSelectedMenuItem);
|
|
306
|
+
} else {
|
|
307
|
+
menuNavigator.toFirstItem();
|
|
308
|
+
}
|
|
309
|
+
}
|
|
301
310
|
}, ...Array.from(this.components).map(_ref => {
|
|
302
311
|
let [, component] = _ref;
|
|
303
312
|
return component.getElements();
|
|
@@ -289,7 +289,16 @@ export class Filters extends BasePlugin {
|
|
|
289
289
|
// A fake menu item that once focused allows escaping from the focus navigation (using Tab keys)
|
|
290
290
|
// to the menu navigation using arrow keys.
|
|
291
291
|
{
|
|
292
|
-
focus: () =>
|
|
292
|
+
focus: () => {
|
|
293
|
+
const menuNavigator = mainMenu.getNavigator();
|
|
294
|
+
const lastSelectedMenuItem = _classPrivateFieldGet(this, _menuFocusNavigator).getLastMenuPage();
|
|
295
|
+
mainMenu.focus();
|
|
296
|
+
if (lastSelectedMenuItem > 0) {
|
|
297
|
+
menuNavigator.setCurrentPage(lastSelectedMenuItem);
|
|
298
|
+
} else {
|
|
299
|
+
menuNavigator.toFirstItem();
|
|
300
|
+
}
|
|
301
|
+
}
|
|
293
302
|
}, ...Array.from(this.components).map(_ref => {
|
|
294
303
|
let [, component] = _ref;
|
|
295
304
|
return component.getElements();
|
|
@@ -27,12 +27,17 @@ const SHORTCUTS_MENU_CONTEXT = 'filters';
|
|
|
27
27
|
* @returns {Paginator}
|
|
28
28
|
*/
|
|
29
29
|
function createMenuFocusController(mainMenu, menuItems) {
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* @type {number} The last selected menu item (before clearing the the menu state after going
|
|
32
|
+
* into the focus mode triggered by the TAB or SHIFT+TAB keys).
|
|
33
|
+
*/
|
|
34
|
+
let lastSelectedMenuItem = -1;
|
|
35
|
+
const focusNavigator = (0, _focusNavigator.createFocusNavigator)(menuItems);
|
|
31
36
|
const updateNavigatorPosition = element => () => {
|
|
32
37
|
if (mainMenu.isOpened()) {
|
|
33
38
|
mainMenu.getKeyboardShortcutsCtrl().listen(SHORTCUTS_MENU_CONTEXT);
|
|
34
39
|
}
|
|
35
|
-
|
|
40
|
+
focusNavigator.setCurrentPage(menuItems.indexOf(element));
|
|
36
41
|
};
|
|
37
42
|
|
|
38
43
|
// update navigator position (internal state) to element that was recently clicked or focused
|
|
@@ -45,7 +50,7 @@ function createMenuFocusController(mainMenu, menuItems) {
|
|
|
45
50
|
});
|
|
46
51
|
mainMenu.addLocalHook('afterSelectionChange', selectedItem => {
|
|
47
52
|
if (!selectedItem.key.startsWith('filter_')) {
|
|
48
|
-
|
|
53
|
+
focusNavigator.clear();
|
|
49
54
|
}
|
|
50
55
|
});
|
|
51
56
|
|
|
@@ -57,7 +62,7 @@ function createMenuFocusController(mainMenu, menuItems) {
|
|
|
57
62
|
function addKeyboardShortcuts(menu) {
|
|
58
63
|
const mainMenuShortcutsCtrl = mainMenu.getKeyboardShortcutsCtrl();
|
|
59
64
|
const currentMenuShortcutsCtrl = menu.getKeyboardShortcutsCtrl();
|
|
60
|
-
|
|
65
|
+
focusNavigator.clear();
|
|
61
66
|
currentMenuShortcutsCtrl.addCustomShortcuts([{
|
|
62
67
|
keys: [['Tab'], ['Shift', 'Tab']],
|
|
63
68
|
forwardToContext: mainMenuShortcutsCtrl.getContext(SHORTCUTS_MENU_CONTEXT),
|
|
@@ -74,11 +79,15 @@ function createMenuFocusController(mainMenu, menuItems) {
|
|
|
74
79
|
mainMenuShortcutsCtrl.addCustomShortcuts([{
|
|
75
80
|
keys: [['Tab'], ['Shift', 'Tab']],
|
|
76
81
|
callback: event => {
|
|
77
|
-
mainMenu.getNavigator()
|
|
82
|
+
const menuNavigator = mainMenu.getNavigator();
|
|
83
|
+
if (menuNavigator.getCurrentPage() > -1) {
|
|
84
|
+
lastSelectedMenuItem = menuNavigator.getCurrentPage();
|
|
85
|
+
}
|
|
86
|
+
menuNavigator.clear();
|
|
78
87
|
if (event.shiftKey) {
|
|
79
|
-
|
|
88
|
+
focusNavigator.toPreviousItem();
|
|
80
89
|
} else {
|
|
81
|
-
|
|
90
|
+
focusNavigator.toNextItem();
|
|
82
91
|
}
|
|
83
92
|
}
|
|
84
93
|
}, {
|
|
@@ -90,7 +99,7 @@ function createMenuFocusController(mainMenu, menuItems) {
|
|
|
90
99
|
keys: [['Enter'], ['Space']],
|
|
91
100
|
preventDefault: false,
|
|
92
101
|
callback: event => {
|
|
93
|
-
const element = menuItems[
|
|
102
|
+
const element = menuItems[focusNavigator.getCurrentPage()];
|
|
94
103
|
if (element instanceof _select.SelectUI) {
|
|
95
104
|
element.openOptions();
|
|
96
105
|
event.preventDefault();
|
|
@@ -116,8 +125,18 @@ function createMenuFocusController(mainMenu, menuItems) {
|
|
|
116
125
|
mainMenu.focus();
|
|
117
126
|
mainMenu.getKeyboardShortcutsCtrl().listen(SHORTCUTS_MENU_CONTEXT);
|
|
118
127
|
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Retrieves the last selected menu item (before clearing the state after going into the focus mode).
|
|
131
|
+
*
|
|
132
|
+
* @returns {number} The last selected menu item.
|
|
133
|
+
*/
|
|
134
|
+
function getLastMenuPage() {
|
|
135
|
+
return lastSelectedMenuItem;
|
|
136
|
+
}
|
|
119
137
|
return {
|
|
120
|
-
...
|
|
121
|
-
listen
|
|
138
|
+
...focusNavigator,
|
|
139
|
+
listen,
|
|
140
|
+
getLastMenuPage
|
|
122
141
|
};
|
|
123
142
|
}
|
|
@@ -23,12 +23,17 @@ const SHORTCUTS_MENU_CONTEXT = 'filters';
|
|
|
23
23
|
* @returns {Paginator}
|
|
24
24
|
*/
|
|
25
25
|
export function createMenuFocusController(mainMenu, menuItems) {
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @type {number} The last selected menu item (before clearing the the menu state after going
|
|
28
|
+
* into the focus mode triggered by the TAB or SHIFT+TAB keys).
|
|
29
|
+
*/
|
|
30
|
+
let lastSelectedMenuItem = -1;
|
|
31
|
+
const focusNavigator = createFocusNavigator(menuItems);
|
|
27
32
|
const updateNavigatorPosition = element => () => {
|
|
28
33
|
if (mainMenu.isOpened()) {
|
|
29
34
|
mainMenu.getKeyboardShortcutsCtrl().listen(SHORTCUTS_MENU_CONTEXT);
|
|
30
35
|
}
|
|
31
|
-
|
|
36
|
+
focusNavigator.setCurrentPage(menuItems.indexOf(element));
|
|
32
37
|
};
|
|
33
38
|
|
|
34
39
|
// update navigator position (internal state) to element that was recently clicked or focused
|
|
@@ -41,7 +46,7 @@ export function createMenuFocusController(mainMenu, menuItems) {
|
|
|
41
46
|
});
|
|
42
47
|
mainMenu.addLocalHook('afterSelectionChange', selectedItem => {
|
|
43
48
|
if (!selectedItem.key.startsWith('filter_')) {
|
|
44
|
-
|
|
49
|
+
focusNavigator.clear();
|
|
45
50
|
}
|
|
46
51
|
});
|
|
47
52
|
|
|
@@ -53,7 +58,7 @@ export function createMenuFocusController(mainMenu, menuItems) {
|
|
|
53
58
|
function addKeyboardShortcuts(menu) {
|
|
54
59
|
const mainMenuShortcutsCtrl = mainMenu.getKeyboardShortcutsCtrl();
|
|
55
60
|
const currentMenuShortcutsCtrl = menu.getKeyboardShortcutsCtrl();
|
|
56
|
-
|
|
61
|
+
focusNavigator.clear();
|
|
57
62
|
currentMenuShortcutsCtrl.addCustomShortcuts([{
|
|
58
63
|
keys: [['Tab'], ['Shift', 'Tab']],
|
|
59
64
|
forwardToContext: mainMenuShortcutsCtrl.getContext(SHORTCUTS_MENU_CONTEXT),
|
|
@@ -70,11 +75,15 @@ export function createMenuFocusController(mainMenu, menuItems) {
|
|
|
70
75
|
mainMenuShortcutsCtrl.addCustomShortcuts([{
|
|
71
76
|
keys: [['Tab'], ['Shift', 'Tab']],
|
|
72
77
|
callback: event => {
|
|
73
|
-
mainMenu.getNavigator()
|
|
78
|
+
const menuNavigator = mainMenu.getNavigator();
|
|
79
|
+
if (menuNavigator.getCurrentPage() > -1) {
|
|
80
|
+
lastSelectedMenuItem = menuNavigator.getCurrentPage();
|
|
81
|
+
}
|
|
82
|
+
menuNavigator.clear();
|
|
74
83
|
if (event.shiftKey) {
|
|
75
|
-
|
|
84
|
+
focusNavigator.toPreviousItem();
|
|
76
85
|
} else {
|
|
77
|
-
|
|
86
|
+
focusNavigator.toNextItem();
|
|
78
87
|
}
|
|
79
88
|
}
|
|
80
89
|
}, {
|
|
@@ -86,7 +95,7 @@ export function createMenuFocusController(mainMenu, menuItems) {
|
|
|
86
95
|
keys: [['Enter'], ['Space']],
|
|
87
96
|
preventDefault: false,
|
|
88
97
|
callback: event => {
|
|
89
|
-
const element = menuItems[
|
|
98
|
+
const element = menuItems[focusNavigator.getCurrentPage()];
|
|
90
99
|
if (element instanceof SelectUI) {
|
|
91
100
|
element.openOptions();
|
|
92
101
|
event.preventDefault();
|
|
@@ -112,8 +121,18 @@ export function createMenuFocusController(mainMenu, menuItems) {
|
|
|
112
121
|
mainMenu.focus();
|
|
113
122
|
mainMenu.getKeyboardShortcutsCtrl().listen(SHORTCUTS_MENU_CONTEXT);
|
|
114
123
|
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Retrieves the last selected menu item (before clearing the state after going into the focus mode).
|
|
127
|
+
*
|
|
128
|
+
* @returns {number} The last selected menu item.
|
|
129
|
+
*/
|
|
130
|
+
function getLastMenuPage() {
|
|
131
|
+
return lastSelectedMenuItem;
|
|
132
|
+
}
|
|
115
133
|
return {
|
|
116
|
-
...
|
|
117
|
-
listen
|
|
134
|
+
...focusNavigator,
|
|
135
|
+
listen,
|
|
136
|
+
getLastMenuPage
|
|
118
137
|
};
|
|
119
138
|
}
|
|
@@ -441,6 +441,7 @@ class NestedRows extends _base.BasePlugin {
|
|
|
441
441
|
/**
|
|
442
442
|
* The modifyRowData hook callback.
|
|
443
443
|
*
|
|
444
|
+
* @private
|
|
444
445
|
* @param {number} row Visual row index.
|
|
445
446
|
* @returns {boolean}
|
|
446
447
|
*/
|
|
@@ -454,6 +455,7 @@ class NestedRows extends _base.BasePlugin {
|
|
|
454
455
|
/**
|
|
455
456
|
* Modify the source data length to match the length of the nested structure.
|
|
456
457
|
*
|
|
458
|
+
* @private
|
|
457
459
|
* @returns {number}
|
|
458
460
|
*/
|
|
459
461
|
onModifySourceLength() {
|
|
@@ -464,6 +466,7 @@ class NestedRows extends _base.BasePlugin {
|
|
|
464
466
|
}
|
|
465
467
|
|
|
466
468
|
/**
|
|
469
|
+
* @private
|
|
467
470
|
* @param {number} index The index where the data was spliced.
|
|
468
471
|
* @param {number} amount An amount of items to remove.
|
|
469
472
|
* @param {object} element An element to add.
|
|
@@ -435,6 +435,7 @@ export class NestedRows extends BasePlugin {
|
|
|
435
435
|
/**
|
|
436
436
|
* The modifyRowData hook callback.
|
|
437
437
|
*
|
|
438
|
+
* @private
|
|
438
439
|
* @param {number} row Visual row index.
|
|
439
440
|
* @returns {boolean}
|
|
440
441
|
*/
|
|
@@ -448,6 +449,7 @@ export class NestedRows extends BasePlugin {
|
|
|
448
449
|
/**
|
|
449
450
|
* Modify the source data length to match the length of the nested structure.
|
|
450
451
|
*
|
|
452
|
+
* @private
|
|
451
453
|
* @returns {number}
|
|
452
454
|
*/
|
|
453
455
|
onModifySourceLength() {
|
|
@@ -458,6 +460,7 @@ export class NestedRows extends BasePlugin {
|
|
|
458
460
|
}
|
|
459
461
|
|
|
460
462
|
/**
|
|
463
|
+
* @private
|
|
461
464
|
* @param {number} index The index where the data was spliced.
|
|
462
465
|
* @param {number} amount An amount of items to remove.
|
|
463
466
|
* @param {object} element An element to add.
|
|
@@ -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 {
|
|
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;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { textRenderer } from "../textRenderer/index.mjs";
|
|
2
|
-
import { A11Y_HASPOPUP } from "../../helpers/a11y.mjs";
|
|
3
|
-
import { setAttribute } from "../../helpers/dom/element.mjs";
|
|
4
2
|
export const RENDERER_TYPE = 'select';
|
|
5
3
|
|
|
6
4
|
/**
|
|
@@ -15,8 +13,5 @@ export const RENDERER_TYPE = 'select';
|
|
|
15
13
|
*/
|
|
16
14
|
export function selectRenderer(hotInstance, TD, row, col, prop, value, cellProperties) {
|
|
17
15
|
textRenderer.apply(this, [hotInstance, TD, row, col, prop, value, cellProperties]);
|
|
18
|
-
if (hotInstance.getSettings().ariaTags) {
|
|
19
|
-
setAttribute(TD, ...A11Y_HASPOPUP('listbox'));
|
|
20
|
-
}
|
|
21
16
|
}
|
|
22
17
|
selectRenderer.RENDERER_TYPE = RENDERER_TYPE;
|
|
@@ -4,6 +4,7 @@ exports.__esModule = true;
|
|
|
4
4
|
exports.createHighlight = createHighlight;
|
|
5
5
|
var _src = require("../../../3rdparty/walkontable/src");
|
|
6
6
|
var _visualSelection = _interopRequireDefault(require("../visualSelection"));
|
|
7
|
+
var _a11y = require("../../../helpers/a11y");
|
|
7
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8
9
|
/**
|
|
9
10
|
* Creates the new instance of Selection responsible for highlighting currently selected cell. This type of selection
|
|
@@ -11,21 +12,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
11
12
|
*
|
|
12
13
|
* @param {object} highlightParams A configuration object to create a highlight.
|
|
13
14
|
* @param {Function} highlightParams.cellCornerVisible Function to determine if cell's corner should be visible.
|
|
14
|
-
* @param {Function} highlightParams.cellAttributes Array of cell attributes.
|
|
15
|
-
* @param {Function} highlightParams.headerAttributes Array of header attributes.
|
|
16
15
|
* @returns {Selection}
|
|
17
16
|
*/
|
|
18
17
|
function createHighlight(_ref) {
|
|
19
18
|
let {
|
|
20
19
|
cellCornerVisible,
|
|
21
|
-
cellAttributes,
|
|
22
|
-
headerAttributes,
|
|
23
20
|
...restOptions
|
|
24
21
|
} = _ref;
|
|
25
22
|
return new _visualSelection.default({
|
|
26
23
|
className: 'current',
|
|
27
|
-
|
|
28
|
-
focusedHeaderAttributes: headerAttributes,
|
|
24
|
+
headerAttributes: [(0, _a11y.A11Y_SELECTED)()],
|
|
29
25
|
border: {
|
|
30
26
|
width: 2,
|
|
31
27
|
color: '#4b89ff',
|