handsontable 16.1.1 → 16.2.0-next-216dbd0-20251112
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/overlays.js +1 -1
- package/3rdparty/walkontable/src/overlays.mjs +1 -1
- package/3rdparty/walkontable/src/selection/border/border.js +19 -3
- package/3rdparty/walkontable/src/selection/border/border.mjs +19 -3
- package/CHANGELOG.md +39 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/coordsMapper/index.js +11 -0
- package/core/coordsMapper/index.mjs +1 -0
- package/core/hooks/bucket.js +7 -1
- package/core/hooks/bucket.mjs +7 -1
- package/core/hooks/constants.js +54 -0
- package/core/hooks/constants.mjs +54 -0
- package/core/hooks/index.d.ts +6 -0
- package/core/index.js +10 -4
- package/core/index.mjs +2 -1
- package/core.d.ts +3 -2
- package/core.js +67 -26
- package/core.mjs +56 -15
- package/dataMap/metaManager/metaSchema.js +197 -20
- package/dataMap/metaManager/metaSchema.mjs +197 -20
- package/dist/handsontable.css +175 -3
- package/dist/handsontable.full.css +175 -3
- package/dist/handsontable.full.js +10864 -8426
- package/dist/handsontable.full.min.css +5 -4
- package/dist/handsontable.full.min.js +194 -193
- package/dist/handsontable.js +7126 -4827
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +43 -42
- package/dist/languages/all.js +168 -21
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.js +8 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.js +8 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.js +8 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.js +8 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.js +8 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.js +8 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fa-IR.js +8 -1
- package/dist/languages/fa-IR.min.js +1 -1
- package/dist/languages/fr-FR.js +8 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.js +8 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.js +8 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.js +8 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.js +8 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.js +8 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.js +8 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.js +8 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.js +8 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.js +8 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.js +8 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.js +8 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.js +8 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.js +8 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editors/autocompleteEditor/autocompleteEditor.js +21 -1
- package/editors/autocompleteEditor/autocompleteEditor.mjs +22 -2
- package/focusManager/constants.js +25 -0
- package/focusManager/constants.mjs +22 -0
- package/focusManager/eventListener.js +107 -0
- package/focusManager/eventListener.mjs +103 -0
- package/{focusManager.d.ts → focusManager/grid.d.ts} +1 -1
- package/{focusManager.js → focusManager/grid.js} +48 -17
- package/{focusManager.mjs → focusManager/grid.mjs} +47 -16
- package/focusManager/index.d.ts +2 -0
- package/focusManager/index.js +20 -0
- package/focusManager/index.mjs +20 -0
- package/focusManager/scope.js +133 -0
- package/focusManager/scope.mjs +129 -0
- package/focusManager/scopeManager.d.ts +19 -0
- package/focusManager/scopeManager.js +268 -0
- package/focusManager/scopeManager.mjs +263 -0
- package/focusManager/scopes/grid.js +120 -0
- package/focusManager/scopes/grid.mjs +116 -0
- package/focusManager/scopes/index.js +13 -0
- package/focusManager/scopes/index.mjs +9 -0
- package/{utils → focusManager/utils}/focusDetector.js +21 -31
- package/{utils → focusManager/utils}/focusDetector.mjs +21 -31
- package/focusManager/utils/utils.js +95 -0
- package/focusManager/utils/utils.mjs +89 -0
- package/helpers/dom/element.js +1 -1
- package/helpers/dom/element.mjs +2 -2
- package/helpers/dom/event.js +1 -1
- package/helpers/dom/event.mjs +1 -1
- package/helpers/mixed.js +2 -65
- package/helpers/mixed.mjs +2 -63
- package/i18n/constants.js +10 -1
- package/i18n/constants.mjs +10 -1
- package/i18n/languages/ar-AR.js +8 -1
- package/i18n/languages/ar-AR.mjs +8 -1
- package/i18n/languages/cs-CZ.js +8 -1
- package/i18n/languages/cs-CZ.mjs +8 -1
- package/i18n/languages/de-CH.js +8 -1
- package/i18n/languages/de-CH.mjs +8 -1
- package/i18n/languages/de-DE.js +8 -1
- package/i18n/languages/de-DE.mjs +8 -1
- package/i18n/languages/en-US.js +8 -1
- package/i18n/languages/en-US.mjs +8 -1
- package/i18n/languages/es-MX.js +8 -1
- package/i18n/languages/es-MX.mjs +8 -1
- package/i18n/languages/fa-IR.js +8 -1
- package/i18n/languages/fa-IR.mjs +8 -1
- package/i18n/languages/fr-FR.js +8 -1
- package/i18n/languages/fr-FR.mjs +8 -1
- package/i18n/languages/hr-HR.js +8 -1
- package/i18n/languages/hr-HR.mjs +8 -1
- package/i18n/languages/it-IT.js +8 -1
- package/i18n/languages/it-IT.mjs +8 -1
- package/i18n/languages/ja-JP.js +8 -1
- package/i18n/languages/ja-JP.mjs +8 -1
- package/i18n/languages/ko-KR.js +8 -1
- package/i18n/languages/ko-KR.mjs +8 -1
- package/i18n/languages/lv-LV.js +8 -1
- package/i18n/languages/lv-LV.mjs +8 -1
- package/i18n/languages/nb-NO.js +8 -1
- package/i18n/languages/nb-NO.mjs +8 -1
- package/i18n/languages/nl-NL.js +8 -1
- package/i18n/languages/nl-NL.mjs +8 -1
- package/i18n/languages/pl-PL.js +8 -1
- package/i18n/languages/pl-PL.mjs +8 -1
- package/i18n/languages/pt-BR.js +8 -1
- package/i18n/languages/pt-BR.mjs +8 -1
- package/i18n/languages/ru-RU.js +8 -1
- package/i18n/languages/ru-RU.mjs +8 -1
- package/i18n/languages/sr-SP.js +8 -1
- package/i18n/languages/sr-SP.mjs +8 -1
- package/i18n/languages/zh-CN.js +8 -1
- package/i18n/languages/zh-CN.mjs +8 -1
- package/i18n/languages/zh-TW.js +8 -1
- package/i18n/languages/zh-TW.mjs +8 -1
- package/index.d.ts +9 -0
- package/languages/all.js +168 -21
- package/languages/ar-AR.js +8 -1
- package/languages/ar-AR.mjs +8 -1
- package/languages/cs-CZ.js +8 -1
- package/languages/cs-CZ.mjs +8 -1
- package/languages/de-CH.js +8 -1
- package/languages/de-CH.mjs +8 -1
- package/languages/de-DE.js +8 -1
- package/languages/de-DE.mjs +8 -1
- package/languages/en-US.js +8 -1
- package/languages/en-US.mjs +8 -1
- package/languages/es-MX.js +8 -1
- package/languages/es-MX.mjs +8 -1
- package/languages/fa-IR.js +8 -1
- package/languages/fa-IR.mjs +8 -1
- package/languages/fr-FR.js +8 -1
- package/languages/fr-FR.mjs +8 -1
- package/languages/hr-HR.js +8 -1
- package/languages/hr-HR.mjs +8 -1
- package/languages/index.js +168 -21
- package/languages/it-IT.js +8 -1
- package/languages/it-IT.mjs +8 -1
- package/languages/ja-JP.js +8 -1
- package/languages/ja-JP.mjs +8 -1
- package/languages/ko-KR.js +8 -1
- package/languages/ko-KR.mjs +8 -1
- package/languages/lv-LV.js +8 -1
- package/languages/lv-LV.mjs +8 -1
- package/languages/nb-NO.js +8 -1
- package/languages/nb-NO.mjs +8 -1
- package/languages/nl-NL.js +8 -1
- package/languages/nl-NL.mjs +8 -1
- package/languages/pl-PL.js +8 -1
- package/languages/pl-PL.mjs +8 -1
- package/languages/pt-BR.js +8 -1
- package/languages/pt-BR.mjs +8 -1
- package/languages/ru-RU.js +8 -1
- package/languages/ru-RU.mjs +8 -1
- package/languages/sr-SP.js +8 -1
- package/languages/sr-SP.mjs +8 -1
- package/languages/zh-CN.js +8 -1
- package/languages/zh-CN.mjs +8 -1
- package/languages/zh-TW.js +8 -1
- package/languages/zh-TW.mjs +8 -1
- package/package.json +25 -7
- package/plugins/autoRowSize/autoRowSize.js +8 -1
- package/plugins/autoRowSize/autoRowSize.mjs +8 -1
- package/plugins/base/base.js +36 -10
- package/plugins/base/base.mjs +36 -10
- package/plugins/columnSummary/endpoints.js +13 -3
- package/plugins/columnSummary/endpoints.mjs +13 -3
- package/plugins/customBorders/customBorders.d.ts +1 -0
- package/plugins/customBorders/customBorders.js +32 -2
- package/plugins/customBorders/customBorders.mjs +32 -2
- package/plugins/dialog/constants.js +7 -0
- package/plugins/dialog/constants.mjs +4 -0
- package/plugins/dialog/dialog.d.ts +22 -2
- package/plugins/dialog/dialog.js +197 -81
- package/plugins/dialog/dialog.mjs +196 -81
- package/plugins/dialog/templates/base.js +60 -0
- package/plugins/dialog/templates/base.mjs +56 -0
- package/plugins/dialog/templates/confirm.js +106 -0
- package/plugins/dialog/templates/confirm.mjs +102 -0
- package/plugins/dialog/templates/index.js +6 -0
- package/plugins/dialog/templates/index.mjs +4 -0
- package/plugins/dialog/ui.js +125 -41
- package/plugins/dialog/ui.mjs +119 -35
- package/plugins/emptyDataState/emptyDataState.d.ts +24 -0
- package/plugins/emptyDataState/emptyDataState.js +526 -0
- package/plugins/emptyDataState/emptyDataState.mjs +521 -0
- package/plugins/emptyDataState/index.d.ts +1 -0
- package/plugins/emptyDataState/index.js +7 -0
- package/plugins/emptyDataState/index.mjs +1 -0
- package/plugins/emptyDataState/ui.js +282 -0
- package/plugins/emptyDataState/ui.mjs +278 -0
- package/plugins/filters/component/value.js +16 -1
- package/plugins/filters/component/value.mjs +16 -1
- package/plugins/filters/filters.d.ts +5 -1
- package/plugins/filters/filters.js +22 -1
- package/plugins/filters/filters.mjs +22 -1
- package/plugins/filters/ui/multipleSelect.js +90 -79
- package/plugins/filters/ui/multipleSelect.mjs +90 -79
- package/plugins/index.d.ts +3 -0
- package/plugins/index.js +3 -0
- package/plugins/index.mjs +3 -1
- package/plugins/mergeCells/utils.js +1 -5
- package/plugins/mergeCells/utils.mjs +1 -5
- package/plugins/pagination/pagination.js +37 -175
- package/plugins/pagination/pagination.mjs +37 -175
- package/plugins/pagination/strategies/autoPageSize.js +2 -2
- package/plugins/pagination/strategies/autoPageSize.mjs +2 -2
- package/plugins/pagination/ui.js +6 -10
- package/plugins/pagination/ui.mjs +7 -11
- package/plugins/stretchColumns/calculator.js +3 -1
- package/plugins/stretchColumns/calculator.mjs +3 -1
- package/plugins/undoRedo/undoRedo.js +16 -6
- package/plugins/undoRedo/undoRedo.mjs +16 -5
- package/renderers/checkboxRenderer/checkboxRenderer.js +12 -15
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +12 -15
- package/selection/selection.js +1 -1
- package/selection/selection.mjs +1 -1
- package/settings.d.ts +3 -0
- package/shortcutContexts/commands/index.js +2 -1
- package/shortcutContexts/commands/index.mjs +2 -1
- package/shortcutContexts/commands/tabNavigation.js +51 -0
- package/shortcutContexts/commands/tabNavigation.mjs +48 -0
- package/shortcutContexts/constants.js +16 -1
- package/shortcutContexts/constants.mjs +16 -1
- package/shortcutContexts/editor.js +2 -2
- package/shortcutContexts/editor.mjs +3 -3
- package/shortcutContexts/grid.js +19 -3
- package/shortcutContexts/grid.mjs +20 -4
- package/shortcuts/manager.d.ts +1 -0
- package/shortcuts/manager.js +17 -2
- package/shortcuts/manager.mjs +17 -2
- package/styles/handsontable.css +192 -35
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-icons-horizon.css +233 -0
- package/styles/ht-icons-horizon.min.css +30 -0
- package/styles/ht-icons-main.css +233 -0
- package/styles/ht-icons-main.min.css +30 -0
- package/styles/ht-theme-classic-no-icons.css +399 -0
- package/styles/ht-theme-classic-no-icons.min.css +30 -0
- package/styles/ht-theme-classic.css +308 -556
- package/styles/ht-theme-classic.min.css +3 -3
- package/styles/ht-theme-horizon-no-icons.css +405 -0
- package/styles/ht-theme-horizon-no-icons.min.css +30 -0
- package/styles/ht-theme-horizon.css +312 -556
- package/styles/ht-theme-horizon.min.css +3 -3
- package/styles/ht-theme-main-no-icons.css +396 -0
- package/styles/ht-theme-main-no-icons.min.css +30 -0
- package/styles/ht-theme-main.css +303 -556
- package/styles/ht-theme-main.min.css +3 -3
- package/tableView.js +23 -5
- package/tableView.mjs +23 -5
- package/utils/dataStructures/uniqueMap.js +10 -0
- package/utils/dataStructures/uniqueMap.mjs +10 -0
- package/utils/ghostTable.js +0 -3
- package/utils/ghostTable.mjs +0 -3
- package/utils/stylesHandler.js +19 -4
- package/utils/stylesHandler.mjs +19 -4
- package/core/focusCatcher/index.js +0 -131
- package/core/focusCatcher/index.mjs +0 -127
- package/core/focusCatcher/utils.js +0 -31
- package/core/focusCatcher/utils.mjs +0 -27
- package/plugins/pagination/focusController.js +0 -27
- package/plugins/pagination/focusController.mjs +0 -23
package/core.js
CHANGED
|
@@ -24,7 +24,6 @@ var _browser = require("./helpers/browser");
|
|
|
24
24
|
var _editorManager = _interopRequireDefault(require("./editorManager"));
|
|
25
25
|
var _eventManager = _interopRequireDefault(require("./eventManager"));
|
|
26
26
|
var _object = require("./helpers/object");
|
|
27
|
-
var _focusManager = require("./focusManager");
|
|
28
27
|
var _array = require("./helpers/array");
|
|
29
28
|
var _parseTable = require("./utils/parseTable");
|
|
30
29
|
var _staticRegister = require("./utils/staticRegister");
|
|
@@ -40,19 +39,18 @@ var _data = require("./helpers/data");
|
|
|
40
39
|
var _translations = require("./translations");
|
|
41
40
|
var _rootInstance = require("./utils/rootInstance");
|
|
42
41
|
var _src = require("./3rdparty/walkontable/src");
|
|
43
|
-
var _hooks = require("./core/hooks");
|
|
44
42
|
var _registry5 = require("./i18n/registry");
|
|
45
43
|
var _utils = require("./i18n/utils");
|
|
46
44
|
var _selection = require("./selection");
|
|
47
45
|
var _dataMap = require("./dataMap");
|
|
48
46
|
var _index = require("./core/index");
|
|
47
|
+
var _focusManager = require("./focusManager");
|
|
49
48
|
var _uniqueMap = require("./utils/dataStructures/uniqueMap");
|
|
50
49
|
var _shortcuts = require("./shortcuts");
|
|
51
50
|
var _shortcutContexts = require("./shortcutContexts");
|
|
52
51
|
var _themes = require("./helpers/themes");
|
|
53
52
|
var _stylesHandler = require("./utils/stylesHandler");
|
|
54
53
|
var _console = require("./helpers/console");
|
|
55
|
-
var _rangeToRenderableMapper = require("./core/coordsMapper/rangeToRenderableMapper");
|
|
56
54
|
var _a11yAnnouncer = require("./utils/a11yAnnouncer");
|
|
57
55
|
var _valueAccessors = require("./utils/valueAccessors");
|
|
58
56
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -182,7 +180,7 @@ function Core(rootContainer, userSettings) {
|
|
|
182
180
|
let dataSource;
|
|
183
181
|
let grid;
|
|
184
182
|
let editorManager;
|
|
185
|
-
let
|
|
183
|
+
let focusGridManager;
|
|
186
184
|
let viewportScroller;
|
|
187
185
|
let firstRun = true;
|
|
188
186
|
const mergedUserSettings = {
|
|
@@ -342,6 +340,7 @@ function Core(rootContainer, userSettings) {
|
|
|
342
340
|
* @type {StylesHandler}
|
|
343
341
|
*/
|
|
344
342
|
this.stylesHandler = new _stylesHandler.StylesHandler({
|
|
343
|
+
hot: instance,
|
|
345
344
|
rootElement: instance.rootElement,
|
|
346
345
|
rootDocument: instance.rootDocument,
|
|
347
346
|
onThemeChange: validThemeName => {
|
|
@@ -362,7 +361,7 @@ function Core(rootContainer, userSettings) {
|
|
|
362
361
|
mergedUserSettings.language = (0, _registry5.getValidLanguageCode)(mergedUserSettings.language);
|
|
363
362
|
const settingsWithoutHooks = Object.fromEntries(Object.entries(mergedUserSettings).filter(_ref => {
|
|
364
363
|
let [key] = _ref;
|
|
365
|
-
return !(
|
|
364
|
+
return !(_index.Hooks.getSingleton().isRegistered(key) || _index.Hooks.getSingleton().isDeprecated(key));
|
|
366
365
|
}));
|
|
367
366
|
const metaManager = new _dataMap.MetaManager(instance, settingsWithoutHooks, [_dataMap.DynamicCellMetaMod, _dataMap.ExtendMetaPropertiesMod]);
|
|
368
367
|
const tableMeta = metaManager.getTableMeta();
|
|
@@ -402,7 +401,7 @@ function Core(rootContainer, userSettings) {
|
|
|
402
401
|
});
|
|
403
402
|
dataSource = new _dataSource.default(instance);
|
|
404
403
|
const moduleRegisterer = (0, _staticRegister.staticRegister)(this.guid);
|
|
405
|
-
moduleRegisterer.register('cellRangeMapper', new
|
|
404
|
+
moduleRegisterer.register('cellRangeMapper', new _index.CellRangeToRenderableMapper({
|
|
406
405
|
rowIndexMapper: this.rowIndexMapper,
|
|
407
406
|
columnIndexMapper: this.columnIndexMapper
|
|
408
407
|
}));
|
|
@@ -489,8 +488,14 @@ function Core(rootContainer, userSettings) {
|
|
|
489
488
|
this.selection.commit();
|
|
490
489
|
}
|
|
491
490
|
};
|
|
492
|
-
this.columnIndexMapper.addLocalHook('cacheUpdated',
|
|
493
|
-
|
|
491
|
+
this.columnIndexMapper.addLocalHook('cacheUpdated', indexesChangesState => {
|
|
492
|
+
onIndexMapperCacheUpdate(indexesChangesState);
|
|
493
|
+
this.runHooks('afterColumnSequenceCacheUpdate', indexesChangesState);
|
|
494
|
+
});
|
|
495
|
+
this.rowIndexMapper.addLocalHook('cacheUpdated', indexesChangesState => {
|
|
496
|
+
onIndexMapperCacheUpdate(indexesChangesState);
|
|
497
|
+
this.runHooks('afterRowSequenceCacheUpdate', indexesChangesState);
|
|
498
|
+
});
|
|
494
499
|
this.selection.addLocalHook('afterSetRangeEnd', (cellCoords, isLastSelectionLayer) => {
|
|
495
500
|
const preventScrolling = (0, _object.createObjectPropListener)(false);
|
|
496
501
|
const selectionRange = this.selection.getSelectedRange();
|
|
@@ -1207,9 +1212,8 @@ function Core(rootContainer, userSettings) {
|
|
|
1207
1212
|
this.view = new _tableView.default(this);
|
|
1208
1213
|
editorManager = _editorManager.default.getInstance(instance, tableMeta, selection);
|
|
1209
1214
|
viewportScroller = (0, _index.createViewportScroller)(instance);
|
|
1210
|
-
|
|
1215
|
+
focusGridManager.init();
|
|
1211
1216
|
if ((0, _rootInstance.isRootInstance)(this)) {
|
|
1212
|
-
(0, _index.installFocusCatcher)(instance);
|
|
1213
1217
|
(0, _a11yAnnouncer.install)(instance.rootPortalElement);
|
|
1214
1218
|
(0, _mixed._injectProductInfo)(mergedUserSettings.licenseKey, this.rootWrapperElement);
|
|
1215
1219
|
}
|
|
@@ -2509,6 +2513,9 @@ function Core(rootContainer, userSettings) {
|
|
|
2509
2513
|
if ((0, _mixed.isDefined)(settings.ganttChart)) {
|
|
2510
2514
|
throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');
|
|
2511
2515
|
}
|
|
2516
|
+
if ((0, _mixed.isDefined)(settings.rowHeights) && (0, _mixed.isDefined)(settings.minRowHeights)) {
|
|
2517
|
+
(0, _console.warn)('Both `rowHeights` and `minRowHeights` are defined in your configuration. ' + 'As one is the alias of the other, only one of them can be used at a time. ' + '`rowHeights` will be used as the row height configuration.');
|
|
2518
|
+
}
|
|
2512
2519
|
|
|
2513
2520
|
// eslint-disable-next-line no-restricted-syntax
|
|
2514
2521
|
for (i in settings) {
|
|
@@ -2519,13 +2526,13 @@ function Core(rootContainer, userSettings) {
|
|
|
2519
2526
|
} else if (i === 'tableClassName' && instance.table) {
|
|
2520
2527
|
setClassName('tableClassName', settings.tableClassName);
|
|
2521
2528
|
instance.view._wt.wtOverlays.syncOverlayTableClassNames();
|
|
2522
|
-
} else if (
|
|
2529
|
+
} else if (_index.Hooks.getSingleton().isRegistered(i) || _index.Hooks.getSingleton().isDeprecated(i)) {
|
|
2523
2530
|
const hook = settings[i];
|
|
2524
2531
|
if ((0, _function.isFunction)(hook)) {
|
|
2525
|
-
|
|
2532
|
+
_index.Hooks.getSingleton().addAsFixed(i, hook, instance);
|
|
2526
2533
|
tableMeta[i] = hook;
|
|
2527
2534
|
} else if (Array.isArray(hook)) {
|
|
2528
|
-
|
|
2535
|
+
_index.Hooks.getSingleton().add(i, hook, instance);
|
|
2529
2536
|
tableMeta[i] = hook;
|
|
2530
2537
|
}
|
|
2531
2538
|
} else if (!init && (0, _object.hasOwnProperty)(settings, i)) {
|
|
@@ -2548,7 +2555,7 @@ function Core(rootContainer, userSettings) {
|
|
|
2548
2555
|
}
|
|
2549
2556
|
if ((0, _rootInstance.isRootInstance)(instance) && !deprecatedWarnInstances.has(instance) && instance.stylesHandler.isClassicTheme()) {
|
|
2550
2557
|
// eslint-disable-next-line max-len
|
|
2551
|
-
(0, _console.deprecatedWarn)('
|
|
2558
|
+
(0, _console.deprecatedWarn)('The stylesheet you are using is deprecated and will be removed in version 17.0. Please update your theme configuration to ensure compatibility with future releases.');
|
|
2552
2559
|
deprecatedWarnInstances.add(instance);
|
|
2553
2560
|
}
|
|
2554
2561
|
|
|
@@ -3757,7 +3764,7 @@ function Core(rootContainer, userSettings) {
|
|
|
3757
3764
|
break;
|
|
3758
3765
|
}
|
|
3759
3766
|
if (typeof width === 'string') {
|
|
3760
|
-
width = parseInt(width, 10);
|
|
3767
|
+
width = Number.parseInt(width, 10);
|
|
3761
3768
|
}
|
|
3762
3769
|
}
|
|
3763
3770
|
return width;
|
|
@@ -3792,8 +3799,9 @@ function Core(rootContainer, userSettings) {
|
|
|
3792
3799
|
* @returns {number}
|
|
3793
3800
|
*/
|
|
3794
3801
|
this._getRowHeightFromSettings = function (row) {
|
|
3795
|
-
|
|
3796
|
-
|
|
3802
|
+
var _tableMeta$rowHeights;
|
|
3803
|
+
const defaultRowHeight = instance.stylesHandler.getDefaultRowHeight(row);
|
|
3804
|
+
let height = (_tableMeta$rowHeights = tableMeta.rowHeights) !== null && _tableMeta$rowHeights !== void 0 ? _tableMeta$rowHeights : tableMeta.minRowHeights;
|
|
3797
3805
|
if (height !== undefined && height !== null) {
|
|
3798
3806
|
switch (typeof height) {
|
|
3799
3807
|
case 'object':
|
|
@@ -3807,7 +3815,7 @@ function Core(rootContainer, userSettings) {
|
|
|
3807
3815
|
break;
|
|
3808
3816
|
}
|
|
3809
3817
|
if (typeof height === 'string') {
|
|
3810
|
-
height = parseInt(height, 10);
|
|
3818
|
+
height = Number.parseInt(height, 10);
|
|
3811
3819
|
}
|
|
3812
3820
|
}
|
|
3813
3821
|
return height !== undefined && height !== null && height < defaultRowHeight ? defaultRowHeight : height;
|
|
@@ -4448,6 +4456,7 @@ function Core(rootContainer, userSettings) {
|
|
|
4448
4456
|
dataSource = null;
|
|
4449
4457
|
if ((0, _rootInstance.isRootInstance)(this)) {
|
|
4450
4458
|
(0, _a11yAnnouncer.uninstall)();
|
|
4459
|
+
this.getFocusScopeManager().destroy();
|
|
4451
4460
|
}
|
|
4452
4461
|
this.getShortcutManager().destroy();
|
|
4453
4462
|
moduleRegisterer.clear();
|
|
@@ -4476,7 +4485,7 @@ function Core(rootContainer, userSettings) {
|
|
|
4476
4485
|
pluginsRegistry.clear();
|
|
4477
4486
|
instance.runHooks('afterDestroy');
|
|
4478
4487
|
}, true);
|
|
4479
|
-
|
|
4488
|
+
_index.Hooks.getSingleton().destroy(instance);
|
|
4480
4489
|
(0, _object.objectEach)(instance, (property, key, obj) => {
|
|
4481
4490
|
// replace instance methods with post mortem
|
|
4482
4491
|
if ((0, _function.isFunction)(property)) {
|
|
@@ -4734,7 +4743,7 @@ function Core(rootContainer, userSettings) {
|
|
|
4734
4743
|
* ```
|
|
4735
4744
|
*/
|
|
4736
4745
|
this.addHook = function (key, callback, orderIndex) {
|
|
4737
|
-
|
|
4746
|
+
_index.Hooks.getSingleton().add(key, callback, instance, orderIndex);
|
|
4738
4747
|
};
|
|
4739
4748
|
|
|
4740
4749
|
/**
|
|
@@ -4753,7 +4762,7 @@ function Core(rootContainer, userSettings) {
|
|
|
4753
4762
|
* ```
|
|
4754
4763
|
*/
|
|
4755
4764
|
this.hasHook = function (key) {
|
|
4756
|
-
return
|
|
4765
|
+
return _index.Hooks.getSingleton().has(key, instance) || _index.Hooks.getSingleton().has(key);
|
|
4757
4766
|
};
|
|
4758
4767
|
|
|
4759
4768
|
/**
|
|
@@ -4775,7 +4784,7 @@ function Core(rootContainer, userSettings) {
|
|
|
4775
4784
|
* ```
|
|
4776
4785
|
*/
|
|
4777
4786
|
this.addHookOnce = function (key, callback, orderIndex) {
|
|
4778
|
-
|
|
4787
|
+
_index.Hooks.getSingleton().once(key, callback, instance, orderIndex);
|
|
4779
4788
|
};
|
|
4780
4789
|
|
|
4781
4790
|
/**
|
|
@@ -4793,7 +4802,7 @@ function Core(rootContainer, userSettings) {
|
|
|
4793
4802
|
* ```
|
|
4794
4803
|
*/
|
|
4795
4804
|
this.removeHook = function (key, callback) {
|
|
4796
|
-
|
|
4805
|
+
_index.Hooks.getSingleton().remove(key, callback, instance);
|
|
4797
4806
|
};
|
|
4798
4807
|
|
|
4799
4808
|
/**
|
|
@@ -4820,7 +4829,7 @@ function Core(rootContainer, userSettings) {
|
|
|
4820
4829
|
* ```
|
|
4821
4830
|
*/
|
|
4822
4831
|
this.runHooks = function (key, p1, p2, p3, p4, p5, p6) {
|
|
4823
|
-
return
|
|
4832
|
+
return _index.Hooks.getSingleton().run(instance, key, p1, p2, p3, p4, p5, p6);
|
|
4824
4833
|
};
|
|
4825
4834
|
|
|
4826
4835
|
/**
|
|
@@ -5031,6 +5040,8 @@ function Core(rootContainer, userSettings) {
|
|
|
5031
5040
|
this.getShortcutManager = function () {
|
|
5032
5041
|
return shortcutManager;
|
|
5033
5042
|
};
|
|
5043
|
+
focusGridManager = new _focusManager.FocusGridManager(instance);
|
|
5044
|
+
const focusScopeManager = (0, _rootInstance.isRootInstance)(this) ? (0, _focusManager.createFocusScopeManager)(instance) : null;
|
|
5034
5045
|
|
|
5035
5046
|
/**
|
|
5036
5047
|
* Return the Focus Manager responsible for managing the browser's focus in the table.
|
|
@@ -5041,13 +5052,43 @@ function Core(rootContainer, userSettings) {
|
|
|
5041
5052
|
* @returns {FocusManager}
|
|
5042
5053
|
*/
|
|
5043
5054
|
this.getFocusManager = function () {
|
|
5044
|
-
return
|
|
5055
|
+
return focusGridManager;
|
|
5056
|
+
};
|
|
5057
|
+
|
|
5058
|
+
/**
|
|
5059
|
+
* Returns the Focus Scope Manager. The module allows to register focus scopes for different parts of the grid
|
|
5060
|
+
* e.g. for dialogs, pagination, and other plugins that have own UI elements and need separate context.
|
|
5061
|
+
*
|
|
5062
|
+
* @memberof Core#
|
|
5063
|
+
* @since 16.2.0
|
|
5064
|
+
* @function getFocusScopeManager
|
|
5065
|
+
* @returns {FocusScopeManager} Instance of {@link FocusScopeManager}
|
|
5066
|
+
*
|
|
5067
|
+
* @example
|
|
5068
|
+
* ```js
|
|
5069
|
+
* hot.getFocusScopeManager().registerScope('myPluginName', containerElement, {
|
|
5070
|
+
* shortcutsContextName: 'plugin:myPluginName',
|
|
5071
|
+
* onActivate: (focusSource) => {
|
|
5072
|
+
* // Focus the internal focusable element within the plugin UI element
|
|
5073
|
+
* // depends on the activation focus source.
|
|
5074
|
+
* },
|
|
5075
|
+
* });
|
|
5076
|
+
* ```
|
|
5077
|
+
*/
|
|
5078
|
+
this.getFocusScopeManager = function () {
|
|
5079
|
+
if (!(0, _rootInstance.isRootInstance)(instance)) {
|
|
5080
|
+
throw new Error('The FocusScopeManager is only available for the main Handsontable instance.');
|
|
5081
|
+
}
|
|
5082
|
+
return focusScopeManager;
|
|
5045
5083
|
};
|
|
5046
5084
|
(0, _registry.getPluginsNames)().forEach(pluginName => {
|
|
5047
5085
|
const PluginClass = (0, _registry.getPlugin)(pluginName);
|
|
5048
5086
|
pluginsRegistry.addItem(pluginName, new PluginClass(this));
|
|
5049
5087
|
});
|
|
5050
5088
|
(0, _shortcutContexts.registerAllShortcutContexts)(instance);
|
|
5089
|
+
if ((0, _rootInstance.isRootInstance)(this)) {
|
|
5090
|
+
(0, _focusManager.registerAllFocusScopes)(instance);
|
|
5091
|
+
}
|
|
5051
5092
|
shortcutManager.setActiveContextName('grid');
|
|
5052
|
-
|
|
5093
|
+
_index.Hooks.getSingleton().run(instance, 'construct');
|
|
5053
5094
|
}
|
package/core.mjs
CHANGED
|
@@ -20,7 +20,6 @@ import { isMobileBrowser, isIpadOS } from "./helpers/browser.mjs";
|
|
|
20
20
|
import EditorManager from "./editorManager.mjs";
|
|
21
21
|
import EventManager from "./eventManager.mjs";
|
|
22
22
|
import { deepClone, duckSchema, isObjectEqual, isObject, deepObjectSize, hasOwnProperty, createObjectPropListener, objectEach } from "./helpers/object.mjs";
|
|
23
|
-
import { FocusManager } from "./focusManager.mjs";
|
|
24
23
|
import { arrayMap, arrayEach, arrayReduce, getDifferenceOfArrays, stringToArray, pivot } from "./helpers/array.mjs";
|
|
25
24
|
import { instanceToHTML } from "./utils/parseTable.mjs";
|
|
26
25
|
import { staticRegister } from "./utils/staticRegister.mjs";
|
|
@@ -36,19 +35,18 @@ import { spreadsheetColumnLabel } from "./helpers/data.mjs";
|
|
|
36
35
|
import { IndexMapper } from "./translations/index.mjs";
|
|
37
36
|
import { registerAsRootInstance, hasValidParameter, isRootInstance } from "./utils/rootInstance.mjs";
|
|
38
37
|
import { DEFAULT_COLUMN_WIDTH } from "./3rdparty/walkontable/src/index.mjs";
|
|
39
|
-
import { Hooks } from "./core/hooks/index.mjs";
|
|
40
38
|
import { hasLanguageDictionary, getValidLanguageCode, getTranslatedPhrase } from "./i18n/registry.mjs";
|
|
41
39
|
import { warnUserAboutLanguageRegistration, normalizeLanguageCode } from "./i18n/utils.mjs";
|
|
42
40
|
import { Selection } from "./selection/index.mjs";
|
|
43
41
|
import { MetaManager, DynamicCellMetaMod, ExtendMetaPropertiesMod, replaceData } from "./dataMap/index.mjs";
|
|
44
|
-
import {
|
|
42
|
+
import { createViewportScroller, Hooks, CellRangeToRenderableMapper } from "./core/index.mjs";
|
|
43
|
+
import { FocusGridManager, createFocusScopeManager, registerAllFocusScopes } from "./focusManager/index.mjs";
|
|
45
44
|
import { createUniqueMap } from "./utils/dataStructures/uniqueMap.mjs";
|
|
46
45
|
import { createShortcutManager } from "./shortcuts/index.mjs";
|
|
47
46
|
import { registerAllShortcutContexts } from "./shortcutContexts/index.mjs";
|
|
48
47
|
import { getThemeClassName } from "./helpers/themes.mjs";
|
|
49
48
|
import { StylesHandler } from "./utils/stylesHandler.mjs";
|
|
50
49
|
import { deprecatedWarn, warn } from "./helpers/console.mjs";
|
|
51
|
-
import { CellRangeToRenderableMapper } from "./core/coordsMapper/rangeToRenderableMapper.mjs";
|
|
52
50
|
import { install as installAccessibilityAnnouncer, uninstall as uninstallAccessibilityAnnouncer } from "./utils/a11yAnnouncer.mjs";
|
|
53
51
|
import { getValueSetterValue } from "./utils/valueAccessors.mjs";
|
|
54
52
|
let activeGuid = null;
|
|
@@ -177,7 +175,7 @@ export default function Core(rootContainer, userSettings) {
|
|
|
177
175
|
let dataSource;
|
|
178
176
|
let grid;
|
|
179
177
|
let editorManager;
|
|
180
|
-
let
|
|
178
|
+
let focusGridManager;
|
|
181
179
|
let viewportScroller;
|
|
182
180
|
let firstRun = true;
|
|
183
181
|
const mergedUserSettings = {
|
|
@@ -337,6 +335,7 @@ export default function Core(rootContainer, userSettings) {
|
|
|
337
335
|
* @type {StylesHandler}
|
|
338
336
|
*/
|
|
339
337
|
this.stylesHandler = new StylesHandler({
|
|
338
|
+
hot: instance,
|
|
340
339
|
rootElement: instance.rootElement,
|
|
341
340
|
rootDocument: instance.rootDocument,
|
|
342
341
|
onThemeChange: validThemeName => {
|
|
@@ -484,8 +483,14 @@ export default function Core(rootContainer, userSettings) {
|
|
|
484
483
|
this.selection.commit();
|
|
485
484
|
}
|
|
486
485
|
};
|
|
487
|
-
this.columnIndexMapper.addLocalHook('cacheUpdated',
|
|
488
|
-
|
|
486
|
+
this.columnIndexMapper.addLocalHook('cacheUpdated', indexesChangesState => {
|
|
487
|
+
onIndexMapperCacheUpdate(indexesChangesState);
|
|
488
|
+
this.runHooks('afterColumnSequenceCacheUpdate', indexesChangesState);
|
|
489
|
+
});
|
|
490
|
+
this.rowIndexMapper.addLocalHook('cacheUpdated', indexesChangesState => {
|
|
491
|
+
onIndexMapperCacheUpdate(indexesChangesState);
|
|
492
|
+
this.runHooks('afterRowSequenceCacheUpdate', indexesChangesState);
|
|
493
|
+
});
|
|
489
494
|
this.selection.addLocalHook('afterSetRangeEnd', (cellCoords, isLastSelectionLayer) => {
|
|
490
495
|
const preventScrolling = createObjectPropListener(false);
|
|
491
496
|
const selectionRange = this.selection.getSelectedRange();
|
|
@@ -1202,9 +1207,8 @@ export default function Core(rootContainer, userSettings) {
|
|
|
1202
1207
|
this.view = new TableView(this);
|
|
1203
1208
|
editorManager = EditorManager.getInstance(instance, tableMeta, selection);
|
|
1204
1209
|
viewportScroller = createViewportScroller(instance);
|
|
1205
|
-
|
|
1210
|
+
focusGridManager.init();
|
|
1206
1211
|
if (isRootInstance(this)) {
|
|
1207
|
-
installFocusCatcher(instance);
|
|
1208
1212
|
installAccessibilityAnnouncer(instance.rootPortalElement);
|
|
1209
1213
|
_injectProductInfo(mergedUserSettings.licenseKey, this.rootWrapperElement);
|
|
1210
1214
|
}
|
|
@@ -2504,6 +2508,9 @@ export default function Core(rootContainer, userSettings) {
|
|
|
2504
2508
|
if (isDefined(settings.ganttChart)) {
|
|
2505
2509
|
throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');
|
|
2506
2510
|
}
|
|
2511
|
+
if (isDefined(settings.rowHeights) && isDefined(settings.minRowHeights)) {
|
|
2512
|
+
warn('Both `rowHeights` and `minRowHeights` are defined in your configuration. ' + 'As one is the alias of the other, only one of them can be used at a time. ' + '`rowHeights` will be used as the row height configuration.');
|
|
2513
|
+
}
|
|
2507
2514
|
|
|
2508
2515
|
// eslint-disable-next-line no-restricted-syntax
|
|
2509
2516
|
for (i in settings) {
|
|
@@ -2543,7 +2550,7 @@ export default function Core(rootContainer, userSettings) {
|
|
|
2543
2550
|
}
|
|
2544
2551
|
if (isRootInstance(instance) && !deprecatedWarnInstances.has(instance) && instance.stylesHandler.isClassicTheme()) {
|
|
2545
2552
|
// eslint-disable-next-line max-len
|
|
2546
|
-
deprecatedWarn('
|
|
2553
|
+
deprecatedWarn('The stylesheet you are using is deprecated and will be removed in version 17.0. Please update your theme configuration to ensure compatibility with future releases.');
|
|
2547
2554
|
deprecatedWarnInstances.add(instance);
|
|
2548
2555
|
}
|
|
2549
2556
|
|
|
@@ -3752,7 +3759,7 @@ export default function Core(rootContainer, userSettings) {
|
|
|
3752
3759
|
break;
|
|
3753
3760
|
}
|
|
3754
3761
|
if (typeof width === 'string') {
|
|
3755
|
-
width = parseInt(width, 10);
|
|
3762
|
+
width = Number.parseInt(width, 10);
|
|
3756
3763
|
}
|
|
3757
3764
|
}
|
|
3758
3765
|
return width;
|
|
@@ -3787,8 +3794,9 @@ export default function Core(rootContainer, userSettings) {
|
|
|
3787
3794
|
* @returns {number}
|
|
3788
3795
|
*/
|
|
3789
3796
|
this._getRowHeightFromSettings = function (row) {
|
|
3790
|
-
|
|
3791
|
-
|
|
3797
|
+
var _tableMeta$rowHeights;
|
|
3798
|
+
const defaultRowHeight = instance.stylesHandler.getDefaultRowHeight(row);
|
|
3799
|
+
let height = (_tableMeta$rowHeights = tableMeta.rowHeights) !== null && _tableMeta$rowHeights !== void 0 ? _tableMeta$rowHeights : tableMeta.minRowHeights;
|
|
3792
3800
|
if (height !== undefined && height !== null) {
|
|
3793
3801
|
switch (typeof height) {
|
|
3794
3802
|
case 'object':
|
|
@@ -3802,7 +3810,7 @@ export default function Core(rootContainer, userSettings) {
|
|
|
3802
3810
|
break;
|
|
3803
3811
|
}
|
|
3804
3812
|
if (typeof height === 'string') {
|
|
3805
|
-
height = parseInt(height, 10);
|
|
3813
|
+
height = Number.parseInt(height, 10);
|
|
3806
3814
|
}
|
|
3807
3815
|
}
|
|
3808
3816
|
return height !== undefined && height !== null && height < defaultRowHeight ? defaultRowHeight : height;
|
|
@@ -4443,6 +4451,7 @@ export default function Core(rootContainer, userSettings) {
|
|
|
4443
4451
|
dataSource = null;
|
|
4444
4452
|
if (isRootInstance(this)) {
|
|
4445
4453
|
uninstallAccessibilityAnnouncer();
|
|
4454
|
+
this.getFocusScopeManager().destroy();
|
|
4446
4455
|
}
|
|
4447
4456
|
this.getShortcutManager().destroy();
|
|
4448
4457
|
moduleRegisterer.clear();
|
|
@@ -5026,6 +5035,8 @@ export default function Core(rootContainer, userSettings) {
|
|
|
5026
5035
|
this.getShortcutManager = function () {
|
|
5027
5036
|
return shortcutManager;
|
|
5028
5037
|
};
|
|
5038
|
+
focusGridManager = new FocusGridManager(instance);
|
|
5039
|
+
const focusScopeManager = isRootInstance(this) ? createFocusScopeManager(instance) : null;
|
|
5029
5040
|
|
|
5030
5041
|
/**
|
|
5031
5042
|
* Return the Focus Manager responsible for managing the browser's focus in the table.
|
|
@@ -5036,13 +5047,43 @@ export default function Core(rootContainer, userSettings) {
|
|
|
5036
5047
|
* @returns {FocusManager}
|
|
5037
5048
|
*/
|
|
5038
5049
|
this.getFocusManager = function () {
|
|
5039
|
-
return
|
|
5050
|
+
return focusGridManager;
|
|
5051
|
+
};
|
|
5052
|
+
|
|
5053
|
+
/**
|
|
5054
|
+
* Returns the Focus Scope Manager. The module allows to register focus scopes for different parts of the grid
|
|
5055
|
+
* e.g. for dialogs, pagination, and other plugins that have own UI elements and need separate context.
|
|
5056
|
+
*
|
|
5057
|
+
* @memberof Core#
|
|
5058
|
+
* @since 16.2.0
|
|
5059
|
+
* @function getFocusScopeManager
|
|
5060
|
+
* @returns {FocusScopeManager} Instance of {@link FocusScopeManager}
|
|
5061
|
+
*
|
|
5062
|
+
* @example
|
|
5063
|
+
* ```js
|
|
5064
|
+
* hot.getFocusScopeManager().registerScope('myPluginName', containerElement, {
|
|
5065
|
+
* shortcutsContextName: 'plugin:myPluginName',
|
|
5066
|
+
* onActivate: (focusSource) => {
|
|
5067
|
+
* // Focus the internal focusable element within the plugin UI element
|
|
5068
|
+
* // depends on the activation focus source.
|
|
5069
|
+
* },
|
|
5070
|
+
* });
|
|
5071
|
+
* ```
|
|
5072
|
+
*/
|
|
5073
|
+
this.getFocusScopeManager = function () {
|
|
5074
|
+
if (!isRootInstance(instance)) {
|
|
5075
|
+
throw new Error('The FocusScopeManager is only available for the main Handsontable instance.');
|
|
5076
|
+
}
|
|
5077
|
+
return focusScopeManager;
|
|
5040
5078
|
};
|
|
5041
5079
|
getPluginsNames().forEach(pluginName => {
|
|
5042
5080
|
const PluginClass = getPlugin(pluginName);
|
|
5043
5081
|
pluginsRegistry.addItem(pluginName, new PluginClass(this));
|
|
5044
5082
|
});
|
|
5045
5083
|
registerAllShortcutContexts(instance);
|
|
5084
|
+
if (isRootInstance(this)) {
|
|
5085
|
+
registerAllFocusScopes(instance);
|
|
5086
|
+
}
|
|
5046
5087
|
shortcutManager.setActiveContextName('grid');
|
|
5047
5088
|
Hooks.getSingleton().run(instance, 'construct');
|
|
5048
5089
|
}
|