handsontable 0.0.0-next-bfb0e3a-20240403 → 0.0.0-next-5a535ed-20240403
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/calculator/viewportColumns.js +17 -12
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +17 -12
- package/3rdparty/walkontable/src/calculator/viewportRows.js +15 -10
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +15 -10
- package/3rdparty/walkontable/src/cell/coords.js +17 -12
- package/3rdparty/walkontable/src/cell/coords.mjs +17 -12
- package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
- package/3rdparty/walkontable/src/cell/range.js +28 -40
- package/3rdparty/walkontable/src/cell/range.mjs +28 -40
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +104 -72
- package/3rdparty/walkontable/src/event.mjs +104 -72
- package/3rdparty/walkontable/src/overlays.js +1 -1
- package/3rdparty/walkontable/src/overlays.mjs +1 -1
- package/3rdparty/walkontable/src/scroll.js +17 -15
- package/3rdparty/walkontable/src/scroll.mjs +17 -15
- package/3rdparty/walkontable/src/selection/manager.js +69 -48
- package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
- package/3rdparty/walkontable/src/selection/scanner.js +42 -33
- package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
- package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
- package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +1 -4
- package/core/viewportScroll/index.mjs +1 -4
- package/core.d.ts +3 -4
- package/core.js +22 -77
- package/core.mjs +22 -77
- package/dataMap/dataSource.js +1 -1
- package/dataMap/dataSource.mjs +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
- package/dataMap/metaManager/metaSchema.js +1 -1
- package/dataMap/metaManager/metaSchema.mjs +1 -1
- package/dataMap/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +4 -4
- package/dist/handsontable.full.css +4 -4
- package/dist/handsontable.full.js +9117 -8969
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +292 -292
- package/dist/handsontable.js +6569 -6874
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +25 -25
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +23 -25
- package/editorManager.mjs +23 -25
- package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
- package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
- package/editors/selectEditor/selectEditor.js +19 -20
- package/editors/selectEditor/selectEditor.mjs +19 -20
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +82 -64
- package/focusManager.mjs +82 -64
- package/helpers/dom/element.js +1 -1
- package/helpers/dom/element.mjs +1 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +2 -2
- package/helpers/object.mjs +2 -2
- package/index.d.ts +0 -10
- package/package.json +2 -7
- package/pluginHooks.d.ts +3 -4
- package/pluginHooks.js +38 -99
- package/pluginHooks.mjs +38 -99
- package/plugins/autoColumnSize/autoColumnSize.js +65 -49
- package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
- package/plugins/autoRowSize/autoRowSize.js +34 -28
- package/plugins/autoRowSize/autoRowSize.mjs +34 -28
- package/plugins/autofill/autofill.js +38 -30
- package/plugins/autofill/autofill.mjs +38 -30
- package/plugins/base/base.js +17 -12
- package/plugins/base/base.mjs +17 -12
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
- package/plugins/columnSorting/columnSorting.js +45 -49
- package/plugins/columnSorting/columnSorting.mjs +45 -49
- package/plugins/columnSummary/columnSummary.js +26 -22
- package/plugins/columnSummary/columnSummary.mjs +26 -22
- package/plugins/comments/comments.js +158 -116
- package/plugins/comments/comments.mjs +158 -116
- package/plugins/contextMenu/contextMenu.js +26 -20
- package/plugins/contextMenu/contextMenu.mjs +26 -20
- package/plugins/contextMenu/itemsFactory.js +1 -1
- package/plugins/contextMenu/itemsFactory.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
- package/plugins/contextMenu/menu/menu.js +21 -13
- package/plugins/contextMenu/menu/menu.mjs +21 -13
- package/plugins/contextMenu/menu/positioner.js +58 -41
- package/plugins/contextMenu/menu/positioner.mjs +58 -41
- package/plugins/copyPaste/copyPaste.js +157 -116
- package/plugins/copyPaste/copyPaste.mjs +157 -116
- package/plugins/copyPaste/copyableRanges.js +66 -43
- package/plugins/copyPaste/copyableRanges.mjs +66 -43
- package/plugins/customBorders/customBorders.js +13 -11
- package/plugins/customBorders/customBorders.mjs +13 -11
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +106 -80
- package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
- package/plugins/exportFile/dataProvider.js +1 -1
- package/plugins/exportFile/dataProvider.mjs +1 -1
- package/plugins/filters/component/actionBar.js +9 -9
- package/plugins/filters/component/actionBar.mjs +8 -8
- package/plugins/filters/component/condition.js +15 -13
- package/plugins/filters/component/condition.mjs +15 -13
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +28 -24
- package/plugins/filters/component/value.mjs +28 -24
- package/plugins/filters/conditionUpdateObserver.js +24 -22
- package/plugins/filters/conditionUpdateObserver.mjs +24 -22
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +95 -81
- package/plugins/filters/filters.mjs +95 -81
- package/plugins/filters/ui/input.js +19 -13
- package/plugins/filters/ui/input.mjs +19 -13
- package/plugins/filters/ui/link.js +13 -8
- package/plugins/filters/ui/link.mjs +13 -8
- package/plugins/filters/ui/multipleSelect.js +112 -85
- package/plugins/filters/ui/multipleSelect.mjs +112 -85
- package/plugins/filters/ui/radioInput.js +20 -12
- package/plugins/filters/ui/radioInput.mjs +20 -12
- package/plugins/filters/ui/select.js +72 -50
- package/plugins/filters/ui/select.mjs +71 -49
- package/plugins/formulas/formulas.js +326 -268
- package/plugins/formulas/formulas.mjs +327 -269
- package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
- package/plugins/formulas/indexSyncer/index.js +48 -25
- package/plugins/formulas/indexSyncer/index.mjs +48 -25
- package/plugins/hiddenColumns/hiddenColumns.js +83 -64
- package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
- package/plugins/hiddenRows/hiddenRows.js +82 -63
- package/plugins/hiddenRows/hiddenRows.mjs +82 -63
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
- package/plugins/manualColumnMove/manualColumnMove.js +170 -126
- package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
- package/plugins/manualColumnResize/manualColumnResize.js +230 -169
- package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
- package/plugins/manualRowMove/manualRowMove.js +128 -99
- package/plugins/manualRowMove/manualRowMove.mjs +128 -99
- package/plugins/manualRowResize/manualRowResize.js +209 -150
- package/plugins/manualRowResize/manualRowResize.mjs +209 -150
- package/plugins/mergeCells/calculations/selection.js +71 -2
- package/plugins/mergeCells/calculations/selection.mjs +71 -2
- package/plugins/mergeCells/cellsCollection.js +1 -117
- package/plugins/mergeCells/cellsCollection.mjs +1 -117
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
- package/plugins/mergeCells/mergeCells.js +397 -499
- package/plugins/mergeCells/mergeCells.mjs +397 -499
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +253 -205
- package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
- package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
- package/plugins/nestedHeaders/stateManager/index.js +41 -30
- package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +182 -151
- package/plugins/nestedRows/nestedRows.mjs +183 -152
- package/plugins/nestedRows/ui/contextMenu.js +15 -11
- package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
- package/plugins/nestedRows/utils/rowMoveController.js +1 -1
- package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
- package/plugins/persistentState/storage.js +2 -2
- package/plugins/persistentState/storage.mjs +2 -2
- package/plugins/search/search.js +7 -7
- package/plugins/search/search.mjs +7 -7
- package/plugins/touchScroll/touchScroll.js +19 -15
- package/plugins/touchScroll/touchScroll.mjs +20 -16
- package/plugins/trimRows/trimRows.js +6 -6
- package/plugins/trimRows/trimRows.mjs +6 -6
- package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
- package/selection/highlight/highlight.js +14 -14
- package/selection/highlight/highlight.mjs +13 -13
- package/selection/highlight/visualSelection.js +0 -2
- package/selection/highlight/visualSelection.mjs +0 -2
- package/selection/selection.js +67 -225
- package/selection/selection.mjs +66 -224
- package/selection/transformation.js +118 -149
- package/selection/transformation.mjs +118 -149
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +3 -18
- package/shortcutContexts/commands/editor/open.mjs +3 -18
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
- package/shortcutContexts/grid.js +3 -9
- package/shortcutContexts/grid.mjs +3 -9
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/tableView.js +78 -52
- package/tableView.mjs +78 -52
- package/translations/changesObservable/observable.js +38 -21
- package/translations/changesObservable/observable.mjs +38 -21
- package/translations/changesObservable/observer.js +12 -7
- package/translations/changesObservable/observer.mjs +11 -6
- package/translations/mapCollections/aggregatedCollection.js +1 -1
- package/translations/mapCollections/aggregatedCollection.mjs +1 -1
- package/translations/maps/indexMap.js +1 -1
- package/translations/maps/indexMap.mjs +1 -1
- package/utils/dataStructures/linkedList.js +1 -6
- package/utils/dataStructures/linkedList.mjs +1 -6
- package/utils/dataStructures/tree.js +1 -1
- package/utils/dataStructures/tree.mjs +1 -1
- package/utils/interval.js +44 -26
- package/utils/interval.mjs +44 -26
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/i18n/languages/ar-AR.d.ts +0 -5
- package/i18n/languages/cs-CZ.d.ts +0 -5
- package/i18n/languages/hr-HR.d.ts +0 -5
- package/i18n/languages/sr-SP.d.ts +0 -5
- package/plugins/mergeCells/focusOrder.js +0 -305
- package/plugins/mergeCells/focusOrder.mjs +0 -300
package/focusManager.js
CHANGED
@@ -8,9 +8,12 @@ var _function = require("./helpers/function");
|
|
8
8
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
9
9
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
10
10
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
11
|
-
function
|
12
|
-
function
|
13
|
-
function
|
11
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
12
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
13
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
14
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
15
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
16
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
14
17
|
/**
|
15
18
|
* Possible focus modes.
|
16
19
|
* - CELL - The browser's focus stays on the lastly selected cell element.
|
@@ -32,20 +35,40 @@ var _focusMode = /*#__PURE__*/new WeakMap();
|
|
32
35
|
var _refocusDelay = /*#__PURE__*/new WeakMap();
|
33
36
|
var _refocusElementGetter = /*#__PURE__*/new WeakMap();
|
34
37
|
var _debouncedSelect = /*#__PURE__*/new WeakMap();
|
35
|
-
var
|
38
|
+
var _getSelectedCell = /*#__PURE__*/new WeakSet();
|
39
|
+
var _focusCell = /*#__PURE__*/new WeakSet();
|
40
|
+
var _focusEditorElement = /*#__PURE__*/new WeakSet();
|
41
|
+
var _onUpdateSettings = /*#__PURE__*/new WeakSet();
|
36
42
|
class FocusManager {
|
37
43
|
constructor(hotInstance) {
|
38
44
|
var _this = this;
|
45
|
+
/**
|
46
|
+
* Update the manager configuration after calling `updateSettings`.
|
47
|
+
*
|
48
|
+
* @param {object} newSettings The new settings passed to the `updateSettings` method.
|
49
|
+
*/
|
50
|
+
_classPrivateMethodInitSpec(this, _onUpdateSettings);
|
51
|
+
/**
|
52
|
+
* Manage the browser's focus after cell selection end.
|
53
|
+
*/
|
54
|
+
_classPrivateMethodInitSpec(this, _focusEditorElement);
|
55
|
+
/**
|
56
|
+
* Manage the browser's focus after each cell selection change.
|
57
|
+
*/
|
58
|
+
_classPrivateMethodInitSpec(this, _focusCell);
|
39
59
|
/**
|
40
60
|
* Get and return the currently selected and highlighted cell/header element.
|
41
61
|
*
|
42
62
|
* @param {Function} callback Callback function to be called after the cell element is retrieved.
|
43
63
|
*/
|
44
|
-
_classPrivateMethodInitSpec(this,
|
64
|
+
_classPrivateMethodInitSpec(this, _getSelectedCell);
|
45
65
|
/**
|
46
66
|
* The Handsontable instance.
|
47
67
|
*/
|
48
|
-
_classPrivateFieldInitSpec(this, _hot,
|
68
|
+
_classPrivateFieldInitSpec(this, _hot, {
|
69
|
+
writable: true,
|
70
|
+
value: void 0
|
71
|
+
});
|
49
72
|
/**
|
50
73
|
* The currently enabled focus mode.
|
51
74
|
* Can be either:
|
@@ -56,53 +79,59 @@ class FocusManager {
|
|
56
79
|
*
|
57
80
|
* @type {'cell' | 'mixed'}
|
58
81
|
*/
|
59
|
-
_classPrivateFieldInitSpec(this, _focusMode,
|
82
|
+
_classPrivateFieldInitSpec(this, _focusMode, {
|
83
|
+
writable: true,
|
84
|
+
value: void 0
|
85
|
+
});
|
60
86
|
/**
|
61
87
|
* The delay after which the focus switches from the lastly selected cell to the active editor's `TEXTAREA`
|
62
88
|
* element if the focus mode is set to 'mixed'.
|
63
89
|
*
|
64
90
|
* @type {number}
|
65
91
|
*/
|
66
|
-
_classPrivateFieldInitSpec(this, _refocusDelay,
|
92
|
+
_classPrivateFieldInitSpec(this, _refocusDelay, {
|
93
|
+
writable: true,
|
94
|
+
value: 50
|
95
|
+
});
|
67
96
|
/**
|
68
97
|
* Getter function for the element to be used when refocusing the browser after a delay. If `null`, the active
|
69
98
|
* editor's `TEXTAREA` element will be used.
|
70
99
|
*
|
71
100
|
* @type {null|Function}
|
72
101
|
*/
|
73
|
-
_classPrivateFieldInitSpec(this, _refocusElementGetter,
|
102
|
+
_classPrivateFieldInitSpec(this, _refocusElementGetter, {
|
103
|
+
writable: true,
|
104
|
+
value: null
|
105
|
+
});
|
74
106
|
/**
|
75
107
|
* Map of the debounced `select` functions.
|
76
108
|
*
|
77
109
|
* @type {Map<number, Function>}
|
78
110
|
*/
|
79
|
-
_classPrivateFieldInitSpec(this, _debouncedSelect,
|
111
|
+
_classPrivateFieldInitSpec(this, _debouncedSelect, {
|
112
|
+
writable: true,
|
113
|
+
value: new Map()
|
114
|
+
});
|
80
115
|
const hotSettings = hotInstance.getSettings();
|
81
|
-
_classPrivateFieldSet(
|
82
|
-
_classPrivateFieldSet(
|
83
|
-
_classPrivateFieldGet(
|
116
|
+
_classPrivateFieldSet(this, _hot, hotInstance);
|
117
|
+
_classPrivateFieldSet(this, _focusMode, hotSettings.imeFastEdit ? FOCUS_MODES.MIXED : FOCUS_MODES.CELL);
|
118
|
+
_classPrivateFieldGet(this, _hot).addHook('afterUpdateSettings', function () {
|
84
119
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
85
120
|
args[_key] = arguments[_key];
|
86
121
|
}
|
87
|
-
return
|
122
|
+
return _classPrivateMethodGet(_this, _onUpdateSettings, _onUpdateSettings2).call(_this, ...args);
|
88
123
|
});
|
89
|
-
_classPrivateFieldGet(
|
124
|
+
_classPrivateFieldGet(this, _hot).addHook('afterSelection', function () {
|
90
125
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
91
126
|
args[_key2] = arguments[_key2];
|
92
127
|
}
|
93
|
-
return
|
128
|
+
return _classPrivateMethodGet(_this, _focusCell, _focusCell2).call(_this, ...args);
|
94
129
|
});
|
95
|
-
_classPrivateFieldGet(
|
130
|
+
_classPrivateFieldGet(this, _hot).addHook('afterSelectionEnd', function () {
|
96
131
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
97
132
|
args[_key3] = arguments[_key3];
|
98
133
|
}
|
99
|
-
return
|
100
|
-
});
|
101
|
-
_classPrivateFieldGet(_hot, this).addHook('afterSelectionEnd', function () {
|
102
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
103
|
-
args[_key4] = arguments[_key4];
|
104
|
-
}
|
105
|
-
return _assertClassBrand(_FocusManager_brand, _this, _focusEditorElement).call(_this, ...args);
|
134
|
+
return _classPrivateMethodGet(_this, _focusEditorElement, _focusEditorElement2).call(_this, ...args);
|
106
135
|
});
|
107
136
|
}
|
108
137
|
|
@@ -112,7 +141,7 @@ class FocusManager {
|
|
112
141
|
* @returns {'cell' | 'mixed'}
|
113
142
|
*/
|
114
143
|
getFocusMode() {
|
115
|
-
return _classPrivateFieldGet(
|
144
|
+
return _classPrivateFieldGet(this, _focusMode);
|
116
145
|
}
|
117
146
|
|
118
147
|
/**
|
@@ -122,7 +151,7 @@ class FocusManager {
|
|
122
151
|
*/
|
123
152
|
setFocusMode(focusMode) {
|
124
153
|
if (Object.values(FOCUS_MODES).includes(focusMode)) {
|
125
|
-
_classPrivateFieldSet(
|
154
|
+
_classPrivateFieldSet(this, _focusMode, focusMode);
|
126
155
|
} else {
|
127
156
|
(0, _console.warn)(`"${focusMode}" is not a valid focus mode.`);
|
128
157
|
}
|
@@ -135,7 +164,7 @@ class FocusManager {
|
|
135
164
|
* @returns {number} Delay in milliseconds.
|
136
165
|
*/
|
137
166
|
getRefocusDelay() {
|
138
|
-
return _classPrivateFieldGet(
|
167
|
+
return _classPrivateFieldGet(this, _refocusDelay);
|
139
168
|
}
|
140
169
|
|
141
170
|
/**
|
@@ -145,7 +174,7 @@ class FocusManager {
|
|
145
174
|
* @param {number} delay Delay in milliseconds.
|
146
175
|
*/
|
147
176
|
setRefocusDelay(delay) {
|
148
|
-
_classPrivateFieldSet(
|
177
|
+
_classPrivateFieldSet(this, _refocusDelay, delay);
|
149
178
|
}
|
150
179
|
|
151
180
|
/**
|
@@ -154,7 +183,7 @@ class FocusManager {
|
|
154
183
|
* @param {Function} getRefocusElementFunction The refocus element getter.
|
155
184
|
*/
|
156
185
|
setRefocusElementGetter(getRefocusElementFunction) {
|
157
|
-
_classPrivateFieldSet(
|
186
|
+
_classPrivateFieldSet(this, _refocusElementGetter, getRefocusElementFunction);
|
158
187
|
}
|
159
188
|
|
160
189
|
/**
|
@@ -163,11 +192,11 @@ class FocusManager {
|
|
163
192
|
* @returns {HTMLTextAreaElement|HTMLElement|undefined}
|
164
193
|
*/
|
165
194
|
getRefocusElement() {
|
166
|
-
if (typeof _classPrivateFieldGet(
|
167
|
-
return _classPrivateFieldGet(
|
195
|
+
if (typeof _classPrivateFieldGet(this, _refocusElementGetter) === 'function') {
|
196
|
+
return _classPrivateFieldGet(this, _refocusElementGetter).call(this);
|
168
197
|
} else {
|
169
198
|
var _classPrivateFieldGet2;
|
170
|
-
return (_classPrivateFieldGet2 = _classPrivateFieldGet(
|
199
|
+
return (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _hot).getActiveEditor()) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.TEXTAREA;
|
171
200
|
}
|
172
201
|
}
|
173
202
|
|
@@ -179,15 +208,15 @@ class FocusManager {
|
|
179
208
|
focusOnHighlightedCell(selectedCell) {
|
180
209
|
const focusElement = element => {
|
181
210
|
var _classPrivateFieldGet3, _classPrivateFieldGet4;
|
182
|
-
const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(
|
211
|
+
const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.highlight;
|
183
212
|
if (!currentHighlightCoords) {
|
184
213
|
return;
|
185
214
|
}
|
186
|
-
let elementToBeFocused = _classPrivateFieldGet(
|
215
|
+
let elementToBeFocused = _classPrivateFieldGet(this, _hot).runHooks('modifyFocusedElement', currentHighlightCoords.row, currentHighlightCoords.col, element);
|
187
216
|
if (!(elementToBeFocused instanceof HTMLElement)) {
|
188
217
|
elementToBeFocused = element;
|
189
218
|
}
|
190
|
-
if (elementToBeFocused && !((_classPrivateFieldGet4 = _classPrivateFieldGet(
|
219
|
+
if (elementToBeFocused && !((_classPrivateFieldGet4 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet4 !== void 0 && _classPrivateFieldGet4.isOpened())) {
|
191
220
|
elementToBeFocused.focus({
|
192
221
|
preventScroll: true
|
193
222
|
});
|
@@ -196,7 +225,7 @@ class FocusManager {
|
|
196
225
|
if (selectedCell) {
|
197
226
|
focusElement(selectedCell);
|
198
227
|
} else {
|
199
|
-
|
228
|
+
_classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, element => focusElement(element));
|
200
229
|
}
|
201
230
|
}
|
202
231
|
|
@@ -208,45 +237,42 @@ class FocusManager {
|
|
208
237
|
*/
|
209
238
|
refocusToEditorTextarea() {
|
210
239
|
var _classPrivateFieldGet5;
|
211
|
-
let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _classPrivateFieldGet(
|
240
|
+
let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _classPrivateFieldGet(this, _refocusDelay);
|
212
241
|
const refocusElement = this.getRefocusElement();
|
213
242
|
|
214
243
|
// Re-focus on the editor's `TEXTAREA` element (or a predefined element) if the `imeFastEdit` option is enabled.
|
215
|
-
if (_classPrivateFieldGet(
|
216
|
-
if (!_classPrivateFieldGet(
|
217
|
-
_classPrivateFieldGet(
|
244
|
+
if (_classPrivateFieldGet(this, _hot).getSettings().imeFastEdit && !((_classPrivateFieldGet5 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet5 !== void 0 && _classPrivateFieldGet5.isOpened()) && !!refocusElement) {
|
245
|
+
if (!_classPrivateFieldGet(this, _debouncedSelect).has(delay)) {
|
246
|
+
_classPrivateFieldGet(this, _debouncedSelect).set(delay, (0, _function.debounce)(() => {
|
218
247
|
refocusElement.select();
|
219
248
|
}, delay));
|
220
249
|
}
|
221
|
-
_classPrivateFieldGet(
|
250
|
+
_classPrivateFieldGet(this, _debouncedSelect).get(delay)();
|
222
251
|
}
|
223
252
|
}
|
224
253
|
}
|
225
254
|
exports.FocusManager = FocusManager;
|
226
|
-
function
|
255
|
+
function _getSelectedCell2(callback) {
|
227
256
|
var _classPrivateFieldGet6;
|
228
|
-
const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(
|
229
|
-
if (!highlight || !_classPrivateFieldGet(
|
257
|
+
const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet6 === void 0 ? void 0 : _classPrivateFieldGet6.highlight;
|
258
|
+
if (!highlight || !_classPrivateFieldGet(this, _hot).selection.isCellVisible(highlight)) {
|
230
259
|
callback(null);
|
231
260
|
return;
|
232
261
|
}
|
233
|
-
const cell = _classPrivateFieldGet(
|
262
|
+
const cell = _classPrivateFieldGet(this, _hot).getCell(highlight.row, highlight.col, true);
|
234
263
|
if (cell === null) {
|
235
|
-
_classPrivateFieldGet(
|
236
|
-
callback(_classPrivateFieldGet(
|
264
|
+
_classPrivateFieldGet(this, _hot).addHookOnce('afterScroll', () => {
|
265
|
+
callback(_classPrivateFieldGet(this, _hot).getCell(highlight.row, highlight.col, true));
|
237
266
|
});
|
238
267
|
} else {
|
239
268
|
callback(cell);
|
240
269
|
}
|
241
270
|
}
|
242
|
-
|
243
|
-
|
244
|
-
*/
|
245
|
-
function _focusCell() {
|
246
|
-
_assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, selectedCell => {
|
271
|
+
function _focusCell2() {
|
272
|
+
_classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, selectedCell => {
|
247
273
|
const {
|
248
274
|
activeElement
|
249
|
-
} = _classPrivateFieldGet(
|
275
|
+
} = _classPrivateFieldGet(this, _hot).rootDocument;
|
250
276
|
|
251
277
|
// Blurring the `activeElement` removes the unwanted border around the focusable element (#6877)
|
252
278
|
// and resets the `document.activeElement` property. The blurring should happen only when the
|
@@ -258,22 +284,14 @@ function _focusCell() {
|
|
258
284
|
this.focusOnHighlightedCell(selectedCell);
|
259
285
|
});
|
260
286
|
}
|
261
|
-
|
262
|
-
|
263
|
-
*/
|
264
|
-
function _focusEditorElement() {
|
265
|
-
_assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, selectedCell => {
|
287
|
+
function _focusEditorElement2() {
|
288
|
+
_classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, selectedCell => {
|
266
289
|
if (this.getFocusMode() === FOCUS_MODES.MIXED && selectedCell.nodeName === 'TD') {
|
267
290
|
this.refocusToEditorTextarea();
|
268
291
|
}
|
269
292
|
});
|
270
293
|
}
|
271
|
-
|
272
|
-
* Update the manager configuration after calling `updateSettings`.
|
273
|
-
*
|
274
|
-
* @param {object} newSettings The new settings passed to the `updateSettings` method.
|
275
|
-
*/
|
276
|
-
function _onUpdateSettings(newSettings) {
|
294
|
+
function _onUpdateSettings2(newSettings) {
|
277
295
|
if (newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.MIXED) {
|
278
296
|
this.setFocusMode(FOCUS_MODES.MIXED);
|
279
297
|
} else if (!newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.CELL) {
|
package/focusManager.mjs
CHANGED
@@ -2,9 +2,12 @@ import "core-js/modules/es.error.cause.js";
|
|
2
2
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
3
3
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
4
4
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
5
|
-
function
|
6
|
-
function
|
7
|
-
function
|
5
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
6
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
7
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
8
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
9
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
10
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
8
11
|
import { warn } from "./helpers/console.mjs";
|
9
12
|
import { isOutsideInput } from "./helpers/dom/element.mjs";
|
10
13
|
import { debounce } from "./helpers/function.mjs";
|
@@ -29,20 +32,40 @@ var _focusMode = /*#__PURE__*/new WeakMap();
|
|
29
32
|
var _refocusDelay = /*#__PURE__*/new WeakMap();
|
30
33
|
var _refocusElementGetter = /*#__PURE__*/new WeakMap();
|
31
34
|
var _debouncedSelect = /*#__PURE__*/new WeakMap();
|
32
|
-
var
|
35
|
+
var _getSelectedCell = /*#__PURE__*/new WeakSet();
|
36
|
+
var _focusCell = /*#__PURE__*/new WeakSet();
|
37
|
+
var _focusEditorElement = /*#__PURE__*/new WeakSet();
|
38
|
+
var _onUpdateSettings = /*#__PURE__*/new WeakSet();
|
33
39
|
export class FocusManager {
|
34
40
|
constructor(hotInstance) {
|
35
41
|
var _this = this;
|
42
|
+
/**
|
43
|
+
* Update the manager configuration after calling `updateSettings`.
|
44
|
+
*
|
45
|
+
* @param {object} newSettings The new settings passed to the `updateSettings` method.
|
46
|
+
*/
|
47
|
+
_classPrivateMethodInitSpec(this, _onUpdateSettings);
|
48
|
+
/**
|
49
|
+
* Manage the browser's focus after cell selection end.
|
50
|
+
*/
|
51
|
+
_classPrivateMethodInitSpec(this, _focusEditorElement);
|
52
|
+
/**
|
53
|
+
* Manage the browser's focus after each cell selection change.
|
54
|
+
*/
|
55
|
+
_classPrivateMethodInitSpec(this, _focusCell);
|
36
56
|
/**
|
37
57
|
* Get and return the currently selected and highlighted cell/header element.
|
38
58
|
*
|
39
59
|
* @param {Function} callback Callback function to be called after the cell element is retrieved.
|
40
60
|
*/
|
41
|
-
_classPrivateMethodInitSpec(this,
|
61
|
+
_classPrivateMethodInitSpec(this, _getSelectedCell);
|
42
62
|
/**
|
43
63
|
* The Handsontable instance.
|
44
64
|
*/
|
45
|
-
_classPrivateFieldInitSpec(this, _hot,
|
65
|
+
_classPrivateFieldInitSpec(this, _hot, {
|
66
|
+
writable: true,
|
67
|
+
value: void 0
|
68
|
+
});
|
46
69
|
/**
|
47
70
|
* The currently enabled focus mode.
|
48
71
|
* Can be either:
|
@@ -53,53 +76,59 @@ export class FocusManager {
|
|
53
76
|
*
|
54
77
|
* @type {'cell' | 'mixed'}
|
55
78
|
*/
|
56
|
-
_classPrivateFieldInitSpec(this, _focusMode,
|
79
|
+
_classPrivateFieldInitSpec(this, _focusMode, {
|
80
|
+
writable: true,
|
81
|
+
value: void 0
|
82
|
+
});
|
57
83
|
/**
|
58
84
|
* The delay after which the focus switches from the lastly selected cell to the active editor's `TEXTAREA`
|
59
85
|
* element if the focus mode is set to 'mixed'.
|
60
86
|
*
|
61
87
|
* @type {number}
|
62
88
|
*/
|
63
|
-
_classPrivateFieldInitSpec(this, _refocusDelay,
|
89
|
+
_classPrivateFieldInitSpec(this, _refocusDelay, {
|
90
|
+
writable: true,
|
91
|
+
value: 50
|
92
|
+
});
|
64
93
|
/**
|
65
94
|
* Getter function for the element to be used when refocusing the browser after a delay. If `null`, the active
|
66
95
|
* editor's `TEXTAREA` element will be used.
|
67
96
|
*
|
68
97
|
* @type {null|Function}
|
69
98
|
*/
|
70
|
-
_classPrivateFieldInitSpec(this, _refocusElementGetter,
|
99
|
+
_classPrivateFieldInitSpec(this, _refocusElementGetter, {
|
100
|
+
writable: true,
|
101
|
+
value: null
|
102
|
+
});
|
71
103
|
/**
|
72
104
|
* Map of the debounced `select` functions.
|
73
105
|
*
|
74
106
|
* @type {Map<number, Function>}
|
75
107
|
*/
|
76
|
-
_classPrivateFieldInitSpec(this, _debouncedSelect,
|
108
|
+
_classPrivateFieldInitSpec(this, _debouncedSelect, {
|
109
|
+
writable: true,
|
110
|
+
value: new Map()
|
111
|
+
});
|
77
112
|
const hotSettings = hotInstance.getSettings();
|
78
|
-
_classPrivateFieldSet(
|
79
|
-
_classPrivateFieldSet(
|
80
|
-
_classPrivateFieldGet(
|
113
|
+
_classPrivateFieldSet(this, _hot, hotInstance);
|
114
|
+
_classPrivateFieldSet(this, _focusMode, hotSettings.imeFastEdit ? FOCUS_MODES.MIXED : FOCUS_MODES.CELL);
|
115
|
+
_classPrivateFieldGet(this, _hot).addHook('afterUpdateSettings', function () {
|
81
116
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
82
117
|
args[_key] = arguments[_key];
|
83
118
|
}
|
84
|
-
return
|
119
|
+
return _classPrivateMethodGet(_this, _onUpdateSettings, _onUpdateSettings2).call(_this, ...args);
|
85
120
|
});
|
86
|
-
_classPrivateFieldGet(
|
121
|
+
_classPrivateFieldGet(this, _hot).addHook('afterSelection', function () {
|
87
122
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
88
123
|
args[_key2] = arguments[_key2];
|
89
124
|
}
|
90
|
-
return
|
125
|
+
return _classPrivateMethodGet(_this, _focusCell, _focusCell2).call(_this, ...args);
|
91
126
|
});
|
92
|
-
_classPrivateFieldGet(
|
127
|
+
_classPrivateFieldGet(this, _hot).addHook('afterSelectionEnd', function () {
|
93
128
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
94
129
|
args[_key3] = arguments[_key3];
|
95
130
|
}
|
96
|
-
return
|
97
|
-
});
|
98
|
-
_classPrivateFieldGet(_hot, this).addHook('afterSelectionEnd', function () {
|
99
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
100
|
-
args[_key4] = arguments[_key4];
|
101
|
-
}
|
102
|
-
return _assertClassBrand(_FocusManager_brand, _this, _focusEditorElement).call(_this, ...args);
|
131
|
+
return _classPrivateMethodGet(_this, _focusEditorElement, _focusEditorElement2).call(_this, ...args);
|
103
132
|
});
|
104
133
|
}
|
105
134
|
|
@@ -109,7 +138,7 @@ export class FocusManager {
|
|
109
138
|
* @returns {'cell' | 'mixed'}
|
110
139
|
*/
|
111
140
|
getFocusMode() {
|
112
|
-
return _classPrivateFieldGet(
|
141
|
+
return _classPrivateFieldGet(this, _focusMode);
|
113
142
|
}
|
114
143
|
|
115
144
|
/**
|
@@ -119,7 +148,7 @@ export class FocusManager {
|
|
119
148
|
*/
|
120
149
|
setFocusMode(focusMode) {
|
121
150
|
if (Object.values(FOCUS_MODES).includes(focusMode)) {
|
122
|
-
_classPrivateFieldSet(
|
151
|
+
_classPrivateFieldSet(this, _focusMode, focusMode);
|
123
152
|
} else {
|
124
153
|
warn(`"${focusMode}" is not a valid focus mode.`);
|
125
154
|
}
|
@@ -132,7 +161,7 @@ export class FocusManager {
|
|
132
161
|
* @returns {number} Delay in milliseconds.
|
133
162
|
*/
|
134
163
|
getRefocusDelay() {
|
135
|
-
return _classPrivateFieldGet(
|
164
|
+
return _classPrivateFieldGet(this, _refocusDelay);
|
136
165
|
}
|
137
166
|
|
138
167
|
/**
|
@@ -142,7 +171,7 @@ export class FocusManager {
|
|
142
171
|
* @param {number} delay Delay in milliseconds.
|
143
172
|
*/
|
144
173
|
setRefocusDelay(delay) {
|
145
|
-
_classPrivateFieldSet(
|
174
|
+
_classPrivateFieldSet(this, _refocusDelay, delay);
|
146
175
|
}
|
147
176
|
|
148
177
|
/**
|
@@ -151,7 +180,7 @@ export class FocusManager {
|
|
151
180
|
* @param {Function} getRefocusElementFunction The refocus element getter.
|
152
181
|
*/
|
153
182
|
setRefocusElementGetter(getRefocusElementFunction) {
|
154
|
-
_classPrivateFieldSet(
|
183
|
+
_classPrivateFieldSet(this, _refocusElementGetter, getRefocusElementFunction);
|
155
184
|
}
|
156
185
|
|
157
186
|
/**
|
@@ -160,11 +189,11 @@ export class FocusManager {
|
|
160
189
|
* @returns {HTMLTextAreaElement|HTMLElement|undefined}
|
161
190
|
*/
|
162
191
|
getRefocusElement() {
|
163
|
-
if (typeof _classPrivateFieldGet(
|
164
|
-
return _classPrivateFieldGet(
|
192
|
+
if (typeof _classPrivateFieldGet(this, _refocusElementGetter) === 'function') {
|
193
|
+
return _classPrivateFieldGet(this, _refocusElementGetter).call(this);
|
165
194
|
} else {
|
166
195
|
var _classPrivateFieldGet2;
|
167
|
-
return (_classPrivateFieldGet2 = _classPrivateFieldGet(
|
196
|
+
return (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _hot).getActiveEditor()) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.TEXTAREA;
|
168
197
|
}
|
169
198
|
}
|
170
199
|
|
@@ -176,15 +205,15 @@ export class FocusManager {
|
|
176
205
|
focusOnHighlightedCell(selectedCell) {
|
177
206
|
const focusElement = element => {
|
178
207
|
var _classPrivateFieldGet3, _classPrivateFieldGet4;
|
179
|
-
const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(
|
208
|
+
const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.highlight;
|
180
209
|
if (!currentHighlightCoords) {
|
181
210
|
return;
|
182
211
|
}
|
183
|
-
let elementToBeFocused = _classPrivateFieldGet(
|
212
|
+
let elementToBeFocused = _classPrivateFieldGet(this, _hot).runHooks('modifyFocusedElement', currentHighlightCoords.row, currentHighlightCoords.col, element);
|
184
213
|
if (!(elementToBeFocused instanceof HTMLElement)) {
|
185
214
|
elementToBeFocused = element;
|
186
215
|
}
|
187
|
-
if (elementToBeFocused && !((_classPrivateFieldGet4 = _classPrivateFieldGet(
|
216
|
+
if (elementToBeFocused && !((_classPrivateFieldGet4 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet4 !== void 0 && _classPrivateFieldGet4.isOpened())) {
|
188
217
|
elementToBeFocused.focus({
|
189
218
|
preventScroll: true
|
190
219
|
});
|
@@ -193,7 +222,7 @@ export class FocusManager {
|
|
193
222
|
if (selectedCell) {
|
194
223
|
focusElement(selectedCell);
|
195
224
|
} else {
|
196
|
-
|
225
|
+
_classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, element => focusElement(element));
|
197
226
|
}
|
198
227
|
}
|
199
228
|
|
@@ -205,44 +234,41 @@ export class FocusManager {
|
|
205
234
|
*/
|
206
235
|
refocusToEditorTextarea() {
|
207
236
|
var _classPrivateFieldGet5;
|
208
|
-
let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _classPrivateFieldGet(
|
237
|
+
let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _classPrivateFieldGet(this, _refocusDelay);
|
209
238
|
const refocusElement = this.getRefocusElement();
|
210
239
|
|
211
240
|
// Re-focus on the editor's `TEXTAREA` element (or a predefined element) if the `imeFastEdit` option is enabled.
|
212
|
-
if (_classPrivateFieldGet(
|
213
|
-
if (!_classPrivateFieldGet(
|
214
|
-
_classPrivateFieldGet(
|
241
|
+
if (_classPrivateFieldGet(this, _hot).getSettings().imeFastEdit && !((_classPrivateFieldGet5 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet5 !== void 0 && _classPrivateFieldGet5.isOpened()) && !!refocusElement) {
|
242
|
+
if (!_classPrivateFieldGet(this, _debouncedSelect).has(delay)) {
|
243
|
+
_classPrivateFieldGet(this, _debouncedSelect).set(delay, debounce(() => {
|
215
244
|
refocusElement.select();
|
216
245
|
}, delay));
|
217
246
|
}
|
218
|
-
_classPrivateFieldGet(
|
247
|
+
_classPrivateFieldGet(this, _debouncedSelect).get(delay)();
|
219
248
|
}
|
220
249
|
}
|
221
250
|
}
|
222
|
-
function
|
251
|
+
function _getSelectedCell2(callback) {
|
223
252
|
var _classPrivateFieldGet6;
|
224
|
-
const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(
|
225
|
-
if (!highlight || !_classPrivateFieldGet(
|
253
|
+
const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet6 === void 0 ? void 0 : _classPrivateFieldGet6.highlight;
|
254
|
+
if (!highlight || !_classPrivateFieldGet(this, _hot).selection.isCellVisible(highlight)) {
|
226
255
|
callback(null);
|
227
256
|
return;
|
228
257
|
}
|
229
|
-
const cell = _classPrivateFieldGet(
|
258
|
+
const cell = _classPrivateFieldGet(this, _hot).getCell(highlight.row, highlight.col, true);
|
230
259
|
if (cell === null) {
|
231
|
-
_classPrivateFieldGet(
|
232
|
-
callback(_classPrivateFieldGet(
|
260
|
+
_classPrivateFieldGet(this, _hot).addHookOnce('afterScroll', () => {
|
261
|
+
callback(_classPrivateFieldGet(this, _hot).getCell(highlight.row, highlight.col, true));
|
233
262
|
});
|
234
263
|
} else {
|
235
264
|
callback(cell);
|
236
265
|
}
|
237
266
|
}
|
238
|
-
|
239
|
-
|
240
|
-
*/
|
241
|
-
function _focusCell() {
|
242
|
-
_assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, selectedCell => {
|
267
|
+
function _focusCell2() {
|
268
|
+
_classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, selectedCell => {
|
243
269
|
const {
|
244
270
|
activeElement
|
245
|
-
} = _classPrivateFieldGet(
|
271
|
+
} = _classPrivateFieldGet(this, _hot).rootDocument;
|
246
272
|
|
247
273
|
// Blurring the `activeElement` removes the unwanted border around the focusable element (#6877)
|
248
274
|
// and resets the `document.activeElement` property. The blurring should happen only when the
|
@@ -254,22 +280,14 @@ function _focusCell() {
|
|
254
280
|
this.focusOnHighlightedCell(selectedCell);
|
255
281
|
});
|
256
282
|
}
|
257
|
-
|
258
|
-
|
259
|
-
*/
|
260
|
-
function _focusEditorElement() {
|
261
|
-
_assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, selectedCell => {
|
283
|
+
function _focusEditorElement2() {
|
284
|
+
_classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, selectedCell => {
|
262
285
|
if (this.getFocusMode() === FOCUS_MODES.MIXED && selectedCell.nodeName === 'TD') {
|
263
286
|
this.refocusToEditorTextarea();
|
264
287
|
}
|
265
288
|
});
|
266
289
|
}
|
267
|
-
|
268
|
-
* Update the manager configuration after calling `updateSettings`.
|
269
|
-
*
|
270
|
-
* @param {object} newSettings The new settings passed to the `updateSettings` method.
|
271
|
-
*/
|
272
|
-
function _onUpdateSettings(newSettings) {
|
290
|
+
function _onUpdateSettings2(newSettings) {
|
273
291
|
if (newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.MIXED) {
|
274
292
|
this.setFocusMode(FOCUS_MODES.MIXED);
|
275
293
|
} else if (!newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.CELL) {
|
package/helpers/dom/element.js
CHANGED
@@ -56,8 +56,8 @@ exports.selectElementIfAllowed = selectElementIfAllowed;
|
|
56
56
|
exports.setAttribute = setAttribute;
|
57
57
|
exports.setCaretPosition = setCaretPosition;
|
58
58
|
exports.setOverlayPosition = setOverlayPosition;
|
59
|
-
require("core-js/modules/es.error.cause.js");
|
60
59
|
require("core-js/modules/es.array.push.js");
|
60
|
+
require("core-js/modules/es.error.cause.js");
|
61
61
|
var _string = require("../string");
|
62
62
|
var _a11y = require("../a11y");
|
63
63
|
/**
|
package/helpers/dom/element.mjs
CHANGED
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-5a535ed-20240403";
|
138
138
|
let keyValidityDate;
|
139
139
|
let consoleMessageState = 'invalid';
|
140
140
|
let domMessageState = 'invalid';
|