handsontable 14.0.0-next-104f8c6-20231124 → 14.0.0-next-dd92f79-20231124
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/3rdparty/walkontable/src/renderer/columnHeaders.js +1 -1
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +1 -1
- 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/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +46 -18
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +6 -6
- package/dist/handsontable.js +46 -18
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +6 -6
- 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/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-
|
137
|
+
const hotVersion = "14.0.0-next-dd92f79-20231124";
|
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-
|
127
|
+
const hotVersion = "14.0.0-next-dd92f79-20231124";
|
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-
|
13
|
+
"version": "14.0.0-next-dd92f79-20231124",
|
14
14
|
"main": "index",
|
15
15
|
"module": "index.mjs",
|
16
16
|
"jsnext:main": "index.mjs",
|
@@ -295,7 +295,16 @@ class Filters extends _base.BasePlugin {
|
|
295
295
|
// A fake menu item that once focused allows escaping from the focus navigation (using Tab keys)
|
296
296
|
// to the menu navigation using arrow keys.
|
297
297
|
{
|
298
|
-
focus: () =>
|
298
|
+
focus: () => {
|
299
|
+
const menuNavigator = mainMenu.getNavigator();
|
300
|
+
const lastSelectedMenuItem = _classPrivateFieldGet(this, _menuFocusNavigator).getLastMenuPage();
|
301
|
+
mainMenu.focus();
|
302
|
+
if (lastSelectedMenuItem > 0) {
|
303
|
+
menuNavigator.setCurrentPage(lastSelectedMenuItem);
|
304
|
+
} else {
|
305
|
+
menuNavigator.toFirstItem();
|
306
|
+
}
|
307
|
+
}
|
299
308
|
}, ...Array.from(this.components).map(_ref => {
|
300
309
|
let [, component] = _ref;
|
301
310
|
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
|
}
|