handsontable 0.0.0-next-200799f-20240311 → 0.0.0-next-bff5041-20240315
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 +12 -17
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +12 -17
- package/3rdparty/walkontable/src/calculator/viewportRows.js +10 -15
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +10 -15
- package/3rdparty/walkontable/src/cell/coords.js +12 -17
- package/3rdparty/walkontable/src/cell/coords.mjs +12 -17
- package/3rdparty/walkontable/src/cell/range.d.ts +0 -1
- package/3rdparty/walkontable/src/cell/range.js +23 -45
- package/3rdparty/walkontable/src/cell/range.mjs +23 -45
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +72 -104
- package/3rdparty/walkontable/src/event.mjs +72 -104
- package/3rdparty/walkontable/src/overlays.js +1 -1
- package/3rdparty/walkontable/src/overlays.mjs +1 -1
- package/3rdparty/walkontable/src/scroll.js +15 -17
- package/3rdparty/walkontable/src/scroll.mjs +15 -17
- package/3rdparty/walkontable/src/selection/manager.js +48 -69
- package/3rdparty/walkontable/src/selection/manager.mjs +48 -69
- package/3rdparty/walkontable/src/selection/scanner.js +33 -42
- package/3rdparty/walkontable/src/selection/scanner.mjs +33 -42
- package/3rdparty/walkontable/src/utils/columnStretching.js +27 -44
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +27 -44
- 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 -79
- package/core.mjs +22 -79
- 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/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +7620 -10327
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +277 -277
- package/dist/handsontable.js +5525 -7779
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +33 -33
- 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 +21 -27
- package/editorManager.mjs +21 -27
- package/editors/autocompleteEditor/autocompleteEditor.js +6 -10
- package/editors/autocompleteEditor/autocompleteEditor.mjs +6 -10
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +58 -82
- package/focusManager.mjs +58 -82
- 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 +10 -0
- package/package.json +2 -1
- package/pluginHooks.d.ts +0 -4
- package/pluginHooks.js +2 -44
- package/pluginHooks.mjs +2 -44
- package/plugins/autoColumnSize/autoColumnSize.js +49 -65
- package/plugins/autoColumnSize/autoColumnSize.mjs +49 -65
- package/plugins/autoRowSize/autoRowSize.js +28 -34
- package/plugins/autoRowSize/autoRowSize.mjs +28 -34
- package/plugins/autofill/autofill.js +30 -38
- package/plugins/autofill/autofill.mjs +30 -38
- package/plugins/base/base.js +12 -17
- package/plugins/base/base.mjs +12 -17
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +36 -54
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +36 -54
- package/plugins/columnSorting/columnSorting.js +40 -46
- package/plugins/columnSorting/columnSorting.mjs +40 -46
- package/plugins/columnSummary/columnSummary.js +22 -26
- package/plugins/columnSummary/columnSummary.mjs +22 -26
- package/plugins/comments/comments.js +116 -158
- package/plugins/comments/comments.mjs +116 -158
- package/plugins/contextMenu/contextMenu.js +20 -26
- package/plugins/contextMenu/contextMenu.mjs +20 -26
- 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 +13 -21
- package/plugins/contextMenu/menu/menu.mjs +13 -21
- package/plugins/contextMenu/menu/positioner.js +41 -58
- package/plugins/contextMenu/menu/positioner.mjs +41 -58
- package/plugins/copyPaste/copyPaste.js +113 -154
- package/plugins/copyPaste/copyPaste.mjs +113 -154
- package/plugins/copyPaste/copyableRanges.js +43 -66
- package/plugins/copyPaste/copyableRanges.mjs +43 -66
- package/plugins/customBorders/customBorders.js +11 -13
- package/plugins/customBorders/customBorders.mjs +11 -13
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +78 -100
- package/plugins/dropdownMenu/dropdownMenu.mjs +78 -100
- 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 +13 -15
- package/plugins/filters/component/condition.mjs +13 -15
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +24 -28
- package/plugins/filters/component/value.mjs +24 -28
- package/plugins/filters/conditionUpdateObserver.js +22 -24
- package/plugins/filters/conditionUpdateObserver.mjs +22 -24
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +81 -95
- package/plugins/filters/filters.mjs +81 -95
- package/plugins/filters/ui/input.js +13 -19
- package/plugins/filters/ui/input.mjs +13 -19
- package/plugins/filters/ui/link.js +8 -13
- package/plugins/filters/ui/link.mjs +8 -13
- package/plugins/filters/ui/multipleSelect.js +85 -112
- package/plugins/filters/ui/multipleSelect.mjs +85 -112
- package/plugins/filters/ui/radioInput.js +12 -20
- package/plugins/filters/ui/radioInput.mjs +12 -20
- package/plugins/filters/ui/select.js +50 -72
- package/plugins/filters/ui/select.mjs +49 -71
- package/plugins/formulas/formulas.js +268 -326
- package/plugins/formulas/formulas.mjs +269 -327
- package/plugins/formulas/indexSyncer/axisSyncer.js +38 -61
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +38 -61
- package/plugins/formulas/indexSyncer/index.js +25 -48
- package/plugins/formulas/indexSyncer/index.mjs +25 -48
- package/plugins/hiddenColumns/hiddenColumns.js +64 -83
- package/plugins/hiddenColumns/hiddenColumns.mjs +64 -83
- package/plugins/hiddenRows/hiddenRows.js +63 -82
- package/plugins/hiddenRows/hiddenRows.mjs +63 -82
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +24 -32
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +25 -33
- package/plugins/manualColumnMove/manualColumnMove.js +126 -170
- package/plugins/manualColumnMove/manualColumnMove.mjs +126 -170
- package/plugins/manualColumnResize/manualColumnResize.js +169 -230
- package/plugins/manualColumnResize/manualColumnResize.mjs +169 -230
- package/plugins/manualRowMove/manualRowMove.js +99 -128
- package/plugins/manualRowMove/manualRowMove.mjs +99 -128
- package/plugins/manualRowResize/manualRowResize.js +150 -209
- package/plugins/manualRowResize/manualRowResize.mjs +150 -209
- 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 +355 -595
- package/plugins/mergeCells/mergeCells.mjs +355 -595
- package/plugins/multiColumnSorting/multiColumnSorting.js +0 -6
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +0 -6
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +204 -254
- package/plugins/nestedHeaders/nestedHeaders.mjs +205 -255
- package/plugins/nestedHeaders/stateManager/headersTree.js +21 -32
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +21 -32
- package/plugins/nestedHeaders/stateManager/index.js +30 -41
- package/plugins/nestedHeaders/stateManager/index.mjs +30 -41
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +19 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +19 -30
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +138 -179
- package/plugins/nestedRows/nestedRows.mjs +139 -180
- package/plugins/nestedRows/ui/contextMenu.js +11 -15
- package/plugins/nestedRows/ui/contextMenu.mjs +10 -14
- 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 +15 -19
- package/plugins/touchScroll/touchScroll.mjs +16 -20
- package/plugins/trimRows/trimRows.js +6 -6
- package/plugins/trimRows/trimRows.mjs +6 -6
- package/renderers/checkboxRenderer/checkboxRenderer.js +4 -4
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +4 -4
- package/selection/highlight/highlight.js +14 -14
- package/selection/highlight/highlight.mjs +13 -13
- package/selection/highlight/visualSelection.js +2 -16
- package/selection/highlight/visualSelection.mjs +2 -16
- package/selection/selection.js +60 -252
- package/selection/selection.mjs +59 -251
- package/selection/transformation.js +101 -175
- package/selection/transformation.mjs +101 -175
- 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 +2 -2
- package/shortcutContexts/grid.mjs +2 -2
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/tableView.js +52 -98
- package/tableView.mjs +52 -98
- package/translations/changesObservable/observable.js +21 -38
- package/translations/changesObservable/observable.mjs +21 -38
- package/translations/changesObservable/observer.js +7 -12
- package/translations/changesObservable/observer.mjs +6 -11
- 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 +26 -44
- package/utils/interval.mjs +26 -44
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/plugins/mergeCells/focusOrder.js +0 -258
- package/plugins/mergeCells/focusOrder.mjs +0 -253
package/editorManager.mjs
CHANGED
@@ -4,15 +4,14 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
6
6
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
7
|
-
function
|
7
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
8
8
|
import { isFunctionKey, isCtrlMetaKey } from "./helpers/unicode.mjs";
|
9
9
|
import { isImmediatePropagationStopped } from "./helpers/dom/event.mjs";
|
10
10
|
import { getEditorInstance } from "./editors/registry.mjs";
|
11
11
|
import EventManager from "./eventManager.mjs";
|
12
12
|
import { isDefined } from "./helpers/mixed.mjs";
|
13
13
|
export const SHORTCUTS_GROUP_NAVIGATION = 'editorManager.navigation';
|
14
|
-
var
|
15
|
-
var _onCellDblClick = /*#__PURE__*/new WeakSet();
|
14
|
+
var _EditorManager_brand = /*#__PURE__*/new WeakSet();
|
16
15
|
class EditorManager {
|
17
16
|
/**
|
18
17
|
* @param {Core} hotInstance The Handsontable instance.
|
@@ -20,19 +19,12 @@ class EditorManager {
|
|
20
19
|
* @param {Selection} selection The selection instance.
|
21
20
|
*/
|
22
21
|
constructor(hotInstance, tableMeta, _selection) {
|
23
|
-
/**
|
24
|
-
* OnCellDblClick callback.
|
25
|
-
*
|
26
|
-
* @param {MouseEvent} event The mouse event object.
|
27
|
-
* @param {object} coords The cell coordinates.
|
28
|
-
*/
|
29
|
-
_classPrivateMethodInitSpec(this, _onCellDblClick);
|
30
22
|
/**
|
31
23
|
* OnAfterDocumentKeyDown callback.
|
32
24
|
*
|
33
25
|
* @param {KeyboardEvent} event The keyboard event object.
|
34
26
|
*/
|
35
|
-
_classPrivateMethodInitSpec(this,
|
27
|
+
_classPrivateMethodInitSpec(this, _EditorManager_brand);
|
36
28
|
/**
|
37
29
|
* Instance of {@link Handsontable}.
|
38
30
|
*
|
@@ -92,7 +84,7 @@ class EditorManager {
|
|
92
84
|
this.tableMeta = tableMeta;
|
93
85
|
this.selection = _selection;
|
94
86
|
this.eventManager = new EventManager(hotInstance);
|
95
|
-
this.hot.addHook('afterDocumentKeyDown', event =>
|
87
|
+
this.hot.addHook('afterDocumentKeyDown', event => _assertClassBrand(_EditorManager_brand, this, _onAfterDocumentKeyDown).call(this, event));
|
96
88
|
|
97
89
|
// Open editor when text composition is started (IME editor)
|
98
90
|
this.eventManager.addEventListener(this.hot.rootDocument.documentElement, 'compositionstart', event => {
|
@@ -100,7 +92,7 @@ class EditorManager {
|
|
100
92
|
this.openEditor('', event);
|
101
93
|
}
|
102
94
|
});
|
103
|
-
this.hot.view._wt.update('onCellDblClick', (event, coords, elem) =>
|
95
|
+
this.hot.view._wt.update('onCellDblClick', (event, coords, elem) => _assertClassBrand(_EditorManager_brand, this, _onCellDblClick).call(this, event, coords, elem));
|
104
96
|
}
|
105
97
|
|
106
98
|
/**
|
@@ -314,22 +306,18 @@ class EditorManager {
|
|
314
306
|
}
|
315
307
|
|
316
308
|
/**
|
317
|
-
* Controls selection's
|
309
|
+
* Controls selection's behaviour after clicking `Enter`.
|
318
310
|
*
|
319
311
|
* @private
|
320
|
-
* @param {
|
312
|
+
* @param {boolean} isShiftPressed If `true`, then the selection will move up after hit enter.
|
321
313
|
*/
|
322
|
-
moveSelectionAfterEnter(
|
323
|
-
const enterMoves =
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
enterMoves.row = -enterMoves.row;
|
328
|
-
enterMoves.col = -enterMoves.col;
|
329
|
-
}
|
330
|
-
if (this.hot.selection.isMultiple()) {
|
331
|
-
this.selection.transformFocus(enterMoves.row, enterMoves.col);
|
314
|
+
moveSelectionAfterEnter(isShiftPressed) {
|
315
|
+
const enterMoves = typeof this.tableMeta.enterMoves === 'function' ? this.tableMeta.enterMoves(event) : this.tableMeta.enterMoves;
|
316
|
+
if (isShiftPressed) {
|
317
|
+
// move selection up
|
318
|
+
this.selection.transformStart(-enterMoves.row, -enterMoves.col);
|
332
319
|
} else {
|
320
|
+
// move selection down (add a new row if needed)
|
333
321
|
this.selection.transformStart(enterMoves.row, enterMoves.col, true);
|
334
322
|
}
|
335
323
|
}
|
@@ -341,7 +329,7 @@ class EditorManager {
|
|
341
329
|
this.eventManager.destroy();
|
342
330
|
}
|
343
331
|
}
|
344
|
-
function
|
332
|
+
function _onAfterDocumentKeyDown(event) {
|
345
333
|
const selection = this.hot.getSelectedRangeLast();
|
346
334
|
if (!this.hot.isListening() || !selection || selection.highlight.isHeader() || isImmediatePropagationStopped(event)) {
|
347
335
|
return;
|
@@ -385,7 +373,13 @@ function _onAfterDocumentKeyDown2(event) {
|
|
385
373
|
}
|
386
374
|
}
|
387
375
|
}
|
388
|
-
|
376
|
+
/**
|
377
|
+
* OnCellDblClick callback.
|
378
|
+
*
|
379
|
+
* @param {MouseEvent} event The mouse event object.
|
380
|
+
* @param {object} coords The cell coordinates.
|
381
|
+
*/
|
382
|
+
function _onCellDblClick(event, coords) {
|
389
383
|
if (coords.isCell()) {
|
390
384
|
this.openEditor(null, event, true);
|
391
385
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
require("core-js/modules/es.error.cause.js");
|
4
3
|
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
5
5
|
require("core-js/modules/es.array.push.js");
|
6
6
|
var _handsontableEditor = require("../handsontableEditor");
|
7
7
|
var _array = require("../../helpers/array");
|
@@ -17,9 +17,8 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
17
17
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
18
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
19
19
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
20
|
-
function _classPrivateFieldGet(
|
21
|
-
function
|
22
|
-
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
20
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
21
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
23
22
|
const EDITOR_TYPE = exports.EDITOR_TYPE = 'autocomplete';
|
24
23
|
|
25
24
|
/**
|
@@ -53,10 +52,7 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
53
52
|
*
|
54
53
|
* @type {string}
|
55
54
|
*/
|
56
|
-
_classPrivateFieldInitSpec(this, _idPrefix,
|
57
|
-
writable: true,
|
58
|
-
value: this.hot.guid.slice(0, 9)
|
59
|
-
});
|
55
|
+
_classPrivateFieldInitSpec(this, _idPrefix, this.hot.guid.slice(0, 9));
|
60
56
|
/**
|
61
57
|
* Filters and sorts by relevance.
|
62
58
|
*
|
@@ -168,7 +164,7 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
168
164
|
prepare(row, col, prop, td, value, cellProperties) {
|
169
165
|
super.prepare(row, col, prop, td, value, cellProperties);
|
170
166
|
if (this.hot.getSettings().ariaTags) {
|
171
|
-
(0, _element.setAttribute)(this.TEXTAREA, [(0, _a11y.A11Y_EXPANDED)('false'), (0, _a11y.A11Y_CONTROLS)(`${_classPrivateFieldGet(
|
167
|
+
(0, _element.setAttribute)(this.TEXTAREA, [(0, _a11y.A11Y_EXPANDED)('false'), (0, _a11y.A11Y_CONTROLS)(`${_classPrivateFieldGet(_idPrefix, this)}-listbox-${row}-${col}`)]);
|
172
168
|
}
|
173
169
|
}
|
174
170
|
|
@@ -232,7 +228,7 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
232
228
|
if (rootInstanceAriaTagsEnabled) {
|
233
229
|
// Add `role=presentation` to the main table to prevent the readers from treating the option list as a table.
|
234
230
|
(0, _element.setAttribute)(this.htEditor.view._wt.wtOverlays.wtTable.TABLE, ...(0, _a11y.A11Y_PRESENTATION)());
|
235
|
-
(0, _element.setAttribute)(this.htEditor.rootElement, [(0, _a11y.A11Y_LISTBOX)(), (0, _a11y.A11Y_LIVE)('polite'), (0, _a11y.A11Y_RELEVANT)('text'), ['id', `${_classPrivateFieldGet(
|
231
|
+
(0, _element.setAttribute)(this.htEditor.rootElement, [(0, _a11y.A11Y_LISTBOX)(), (0, _a11y.A11Y_LIVE)('polite'), (0, _a11y.A11Y_RELEVANT)('text'), ['id', `${_classPrivateFieldGet(_idPrefix, this)}-listbox-${rowIndex}-${colIndex}`]]);
|
236
232
|
(0, _element.setAttribute)(this.TEXTAREA, ...(0, _a11y.A11Y_EXPANDED)('true'));
|
237
233
|
}
|
238
234
|
this.hot._registerTimeout(() => {
|
@@ -1,13 +1,12 @@
|
|
1
|
-
import "core-js/modules/es.array.push.js";
|
2
1
|
import "core-js/modules/es.error.cause.js";
|
2
|
+
import "core-js/modules/es.array.push.js";
|
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
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
7
7
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
8
|
-
function _classPrivateFieldGet(
|
9
|
-
function
|
10
|
-
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
8
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
9
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
11
10
|
import { HandsontableEditor } from "../handsontableEditor/index.mjs";
|
12
11
|
import { arrayMap, pivot } from "../../helpers/array.mjs";
|
13
12
|
import { addClass, getCaretPosition, getScrollbarWidth, getSelectionEndPosition, getTrimmingContainer, offset, outerHeight, outerWidth, setAttribute, setCaretPosition } from "../../helpers/dom/element.mjs";
|
@@ -50,10 +49,7 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
50
49
|
*
|
51
50
|
* @type {string}
|
52
51
|
*/
|
53
|
-
_classPrivateFieldInitSpec(this, _idPrefix,
|
54
|
-
writable: true,
|
55
|
-
value: this.hot.guid.slice(0, 9)
|
56
|
-
});
|
52
|
+
_classPrivateFieldInitSpec(this, _idPrefix, this.hot.guid.slice(0, 9));
|
57
53
|
/**
|
58
54
|
* Filters and sorts by relevance.
|
59
55
|
*
|
@@ -165,7 +161,7 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
165
161
|
prepare(row, col, prop, td, value, cellProperties) {
|
166
162
|
super.prepare(row, col, prop, td, value, cellProperties);
|
167
163
|
if (this.hot.getSettings().ariaTags) {
|
168
|
-
setAttribute(this.TEXTAREA, [A11Y_EXPANDED('false'), A11Y_CONTROLS(`${_classPrivateFieldGet(
|
164
|
+
setAttribute(this.TEXTAREA, [A11Y_EXPANDED('false'), A11Y_CONTROLS(`${_classPrivateFieldGet(_idPrefix, this)}-listbox-${row}-${col}`)]);
|
169
165
|
}
|
170
166
|
}
|
171
167
|
|
@@ -229,7 +225,7 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
229
225
|
if (rootInstanceAriaTagsEnabled) {
|
230
226
|
// Add `role=presentation` to the main table to prevent the readers from treating the option list as a table.
|
231
227
|
setAttribute(this.htEditor.view._wt.wtOverlays.wtTable.TABLE, ...A11Y_PRESENTATION());
|
232
|
-
setAttribute(this.htEditor.rootElement, [A11Y_LISTBOX(), A11Y_LIVE('polite'), A11Y_RELEVANT('text'), ['id', `${_classPrivateFieldGet(
|
228
|
+
setAttribute(this.htEditor.rootElement, [A11Y_LISTBOX(), A11Y_LIVE('polite'), A11Y_RELEVANT('text'), ['id', `${_classPrivateFieldGet(_idPrefix, this)}-listbox-${rowIndex}-${colIndex}`]]);
|
233
229
|
setAttribute(this.TEXTAREA, ...A11Y_EXPANDED('true'));
|
234
230
|
}
|
235
231
|
this.hot._registerTimeout(() => {
|
package/eventManager.js
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.getListenersCounter = getListenersCounter;
|
5
|
-
require("core-js/modules/es.array.push.js");
|
6
5
|
require("core-js/modules/es.error.cause.js");
|
6
|
+
require("core-js/modules/es.array.push.js");
|
7
7
|
var _event = require("./helpers/dom/event");
|
8
8
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
9
9
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
package/eventManager.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import "core-js/modules/es.array.push.js";
|
2
1
|
import "core-js/modules/es.error.cause.js";
|
2
|
+
import "core-js/modules/es.array.push.js";
|
3
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
package/focusManager.js
CHANGED
@@ -8,12 +8,9 @@ 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
|
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; } }
|
11
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
12
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
13
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
17
14
|
/**
|
18
15
|
* Possible focus modes.
|
19
16
|
* - CELL - The browser's focus stays on the lastly selected cell element.
|
@@ -35,40 +32,20 @@ var _focusMode = /*#__PURE__*/new WeakMap();
|
|
35
32
|
var _refocusDelay = /*#__PURE__*/new WeakMap();
|
36
33
|
var _refocusElementGetter = /*#__PURE__*/new WeakMap();
|
37
34
|
var _debouncedSelect = /*#__PURE__*/new WeakMap();
|
38
|
-
var
|
39
|
-
var _focusCell = /*#__PURE__*/new WeakSet();
|
40
|
-
var _focusEditorElement = /*#__PURE__*/new WeakSet();
|
41
|
-
var _onUpdateSettings = /*#__PURE__*/new WeakSet();
|
35
|
+
var _FocusManager_brand = /*#__PURE__*/new WeakSet();
|
42
36
|
class FocusManager {
|
43
37
|
constructor(hotInstance) {
|
44
38
|
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);
|
59
39
|
/**
|
60
40
|
* Get and return the currently selected and highlighted cell/header element.
|
61
41
|
*
|
62
42
|
* @param {Function} callback Callback function to be called after the cell element is retrieved.
|
63
43
|
*/
|
64
|
-
_classPrivateMethodInitSpec(this,
|
44
|
+
_classPrivateMethodInitSpec(this, _FocusManager_brand);
|
65
45
|
/**
|
66
46
|
* The Handsontable instance.
|
67
47
|
*/
|
68
|
-
_classPrivateFieldInitSpec(this, _hot,
|
69
|
-
writable: true,
|
70
|
-
value: void 0
|
71
|
-
});
|
48
|
+
_classPrivateFieldInitSpec(this, _hot, void 0);
|
72
49
|
/**
|
73
50
|
* The currently enabled focus mode.
|
74
51
|
* Can be either:
|
@@ -79,59 +56,47 @@ class FocusManager {
|
|
79
56
|
*
|
80
57
|
* @type {'cell' | 'mixed'}
|
81
58
|
*/
|
82
|
-
_classPrivateFieldInitSpec(this, _focusMode,
|
83
|
-
writable: true,
|
84
|
-
value: void 0
|
85
|
-
});
|
59
|
+
_classPrivateFieldInitSpec(this, _focusMode, void 0);
|
86
60
|
/**
|
87
61
|
* The delay after which the focus switches from the lastly selected cell to the active editor's `TEXTAREA`
|
88
62
|
* element if the focus mode is set to 'mixed'.
|
89
63
|
*
|
90
64
|
* @type {number}
|
91
65
|
*/
|
92
|
-
_classPrivateFieldInitSpec(this, _refocusDelay,
|
93
|
-
writable: true,
|
94
|
-
value: 50
|
95
|
-
});
|
66
|
+
_classPrivateFieldInitSpec(this, _refocusDelay, 50);
|
96
67
|
/**
|
97
68
|
* Getter function for the element to be used when refocusing the browser after a delay. If `null`, the active
|
98
69
|
* editor's `TEXTAREA` element will be used.
|
99
70
|
*
|
100
71
|
* @type {null|Function}
|
101
72
|
*/
|
102
|
-
_classPrivateFieldInitSpec(this, _refocusElementGetter,
|
103
|
-
writable: true,
|
104
|
-
value: null
|
105
|
-
});
|
73
|
+
_classPrivateFieldInitSpec(this, _refocusElementGetter, null);
|
106
74
|
/**
|
107
75
|
* Map of the debounced `select` functions.
|
108
76
|
*
|
109
77
|
* @type {Map<number, Function>}
|
110
78
|
*/
|
111
|
-
_classPrivateFieldInitSpec(this, _debouncedSelect,
|
112
|
-
writable: true,
|
113
|
-
value: new Map()
|
114
|
-
});
|
79
|
+
_classPrivateFieldInitSpec(this, _debouncedSelect, new Map());
|
115
80
|
const hotSettings = hotInstance.getSettings();
|
116
|
-
_classPrivateFieldSet(
|
117
|
-
_classPrivateFieldSet(
|
118
|
-
_classPrivateFieldGet(
|
81
|
+
_classPrivateFieldSet(_hot, this, hotInstance);
|
82
|
+
_classPrivateFieldSet(_focusMode, this, hotSettings.imeFastEdit ? FOCUS_MODES.MIXED : FOCUS_MODES.CELL);
|
83
|
+
_classPrivateFieldGet(_hot, this).addHook('afterUpdateSettings', function () {
|
119
84
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
120
85
|
args[_key] = arguments[_key];
|
121
86
|
}
|
122
|
-
return
|
87
|
+
return _assertClassBrand(_FocusManager_brand, _this, _onUpdateSettings).call(_this, ...args);
|
123
88
|
});
|
124
|
-
_classPrivateFieldGet(
|
89
|
+
_classPrivateFieldGet(_hot, this).addHook('afterSelection', function () {
|
125
90
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
126
91
|
args[_key2] = arguments[_key2];
|
127
92
|
}
|
128
|
-
return
|
93
|
+
return _assertClassBrand(_FocusManager_brand, _this, _focusCell).call(_this, ...args);
|
129
94
|
});
|
130
|
-
_classPrivateFieldGet(
|
95
|
+
_classPrivateFieldGet(_hot, this).addHook('afterSelectionEnd', function () {
|
131
96
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
132
97
|
args[_key3] = arguments[_key3];
|
133
98
|
}
|
134
|
-
return
|
99
|
+
return _assertClassBrand(_FocusManager_brand, _this, _focusEditorElement).call(_this, ...args);
|
135
100
|
});
|
136
101
|
}
|
137
102
|
|
@@ -141,7 +106,7 @@ class FocusManager {
|
|
141
106
|
* @returns {'cell' | 'mixed'}
|
142
107
|
*/
|
143
108
|
getFocusMode() {
|
144
|
-
return _classPrivateFieldGet(
|
109
|
+
return _classPrivateFieldGet(_focusMode, this);
|
145
110
|
}
|
146
111
|
|
147
112
|
/**
|
@@ -151,7 +116,7 @@ class FocusManager {
|
|
151
116
|
*/
|
152
117
|
setFocusMode(focusMode) {
|
153
118
|
if (Object.values(FOCUS_MODES).includes(focusMode)) {
|
154
|
-
_classPrivateFieldSet(
|
119
|
+
_classPrivateFieldSet(_focusMode, this, focusMode);
|
155
120
|
} else {
|
156
121
|
(0, _console.warn)(`"${focusMode}" is not a valid focus mode.`);
|
157
122
|
}
|
@@ -164,7 +129,7 @@ class FocusManager {
|
|
164
129
|
* @returns {number} Delay in milliseconds.
|
165
130
|
*/
|
166
131
|
getRefocusDelay() {
|
167
|
-
return _classPrivateFieldGet(
|
132
|
+
return _classPrivateFieldGet(_refocusDelay, this);
|
168
133
|
}
|
169
134
|
|
170
135
|
/**
|
@@ -174,7 +139,7 @@ class FocusManager {
|
|
174
139
|
* @param {number} delay Delay in milliseconds.
|
175
140
|
*/
|
176
141
|
setRefocusDelay(delay) {
|
177
|
-
_classPrivateFieldSet(
|
142
|
+
_classPrivateFieldSet(_refocusDelay, this, delay);
|
178
143
|
}
|
179
144
|
|
180
145
|
/**
|
@@ -183,7 +148,7 @@ class FocusManager {
|
|
183
148
|
* @param {Function} getRefocusElementFunction The refocus element getter.
|
184
149
|
*/
|
185
150
|
setRefocusElementGetter(getRefocusElementFunction) {
|
186
|
-
_classPrivateFieldSet(
|
151
|
+
_classPrivateFieldSet(_refocusElementGetter, this, getRefocusElementFunction);
|
187
152
|
}
|
188
153
|
|
189
154
|
/**
|
@@ -192,11 +157,11 @@ class FocusManager {
|
|
192
157
|
* @returns {HTMLTextAreaElement|HTMLElement|undefined}
|
193
158
|
*/
|
194
159
|
getRefocusElement() {
|
195
|
-
if (typeof _classPrivateFieldGet(
|
196
|
-
return _classPrivateFieldGet(
|
160
|
+
if (typeof _classPrivateFieldGet(_refocusElementGetter, this) === 'function') {
|
161
|
+
return _classPrivateFieldGet(_refocusElementGetter, this).call(this);
|
197
162
|
} else {
|
198
163
|
var _classPrivateFieldGet2;
|
199
|
-
return (_classPrivateFieldGet2 = _classPrivateFieldGet(
|
164
|
+
return (_classPrivateFieldGet2 = _classPrivateFieldGet(_hot, this).getActiveEditor()) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.TEXTAREA;
|
200
165
|
}
|
201
166
|
}
|
202
167
|
|
@@ -208,15 +173,15 @@ class FocusManager {
|
|
208
173
|
focusOnHighlightedCell(selectedCell) {
|
209
174
|
const focusElement = element => {
|
210
175
|
var _classPrivateFieldGet3, _classPrivateFieldGet4;
|
211
|
-
const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(
|
176
|
+
const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(_hot, this).getSelectedRangeLast()) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.highlight;
|
212
177
|
if (!currentHighlightCoords) {
|
213
178
|
return;
|
214
179
|
}
|
215
|
-
let elementToBeFocused = _classPrivateFieldGet(
|
180
|
+
let elementToBeFocused = _classPrivateFieldGet(_hot, this).runHooks('modifyFocusedElement', currentHighlightCoords.row, currentHighlightCoords.col, element);
|
216
181
|
if (!(elementToBeFocused instanceof HTMLElement)) {
|
217
182
|
elementToBeFocused = element;
|
218
183
|
}
|
219
|
-
if (elementToBeFocused && !((_classPrivateFieldGet4 = _classPrivateFieldGet(
|
184
|
+
if (elementToBeFocused && !((_classPrivateFieldGet4 = _classPrivateFieldGet(_hot, this).getActiveEditor()) !== null && _classPrivateFieldGet4 !== void 0 && _classPrivateFieldGet4.isOpened())) {
|
220
185
|
elementToBeFocused.focus({
|
221
186
|
preventScroll: true
|
222
187
|
});
|
@@ -225,7 +190,7 @@ class FocusManager {
|
|
225
190
|
if (selectedCell) {
|
226
191
|
focusElement(selectedCell);
|
227
192
|
} else {
|
228
|
-
|
193
|
+
_assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, element => focusElement(element));
|
229
194
|
}
|
230
195
|
}
|
231
196
|
|
@@ -237,42 +202,45 @@ class FocusManager {
|
|
237
202
|
*/
|
238
203
|
refocusToEditorTextarea() {
|
239
204
|
var _classPrivateFieldGet5;
|
240
|
-
let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _classPrivateFieldGet(
|
205
|
+
let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _classPrivateFieldGet(_refocusDelay, this);
|
241
206
|
const refocusElement = this.getRefocusElement();
|
242
207
|
|
243
208
|
// Re-focus on the editor's `TEXTAREA` element (or a predefined element) if the `imeFastEdit` option is enabled.
|
244
|
-
if (_classPrivateFieldGet(
|
245
|
-
if (!_classPrivateFieldGet(
|
246
|
-
_classPrivateFieldGet(
|
209
|
+
if (_classPrivateFieldGet(_hot, this).getSettings().imeFastEdit && !((_classPrivateFieldGet5 = _classPrivateFieldGet(_hot, this).getActiveEditor()) !== null && _classPrivateFieldGet5 !== void 0 && _classPrivateFieldGet5.isOpened()) && !!refocusElement) {
|
210
|
+
if (!_classPrivateFieldGet(_debouncedSelect, this).has(delay)) {
|
211
|
+
_classPrivateFieldGet(_debouncedSelect, this).set(delay, (0, _function.debounce)(() => {
|
247
212
|
refocusElement.select();
|
248
213
|
}, delay));
|
249
214
|
}
|
250
|
-
_classPrivateFieldGet(
|
215
|
+
_classPrivateFieldGet(_debouncedSelect, this).get(delay)();
|
251
216
|
}
|
252
217
|
}
|
253
218
|
}
|
254
219
|
exports.FocusManager = FocusManager;
|
255
|
-
function
|
220
|
+
function _getSelectedCell(callback) {
|
256
221
|
var _classPrivateFieldGet6;
|
257
|
-
const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(
|
258
|
-
if (!highlight || !_classPrivateFieldGet(
|
222
|
+
const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(_hot, this).getSelectedRangeLast()) === null || _classPrivateFieldGet6 === void 0 ? void 0 : _classPrivateFieldGet6.highlight;
|
223
|
+
if (!highlight || !_classPrivateFieldGet(_hot, this).selection.isCellVisible(highlight)) {
|
259
224
|
callback(null);
|
260
225
|
return;
|
261
226
|
}
|
262
|
-
const cell = _classPrivateFieldGet(
|
227
|
+
const cell = _classPrivateFieldGet(_hot, this).getCell(highlight.row, highlight.col, true);
|
263
228
|
if (cell === null) {
|
264
|
-
_classPrivateFieldGet(
|
265
|
-
callback(_classPrivateFieldGet(
|
229
|
+
_classPrivateFieldGet(_hot, this).addHookOnce('afterScroll', () => {
|
230
|
+
callback(_classPrivateFieldGet(_hot, this).getCell(highlight.row, highlight.col, true));
|
266
231
|
});
|
267
232
|
} else {
|
268
233
|
callback(cell);
|
269
234
|
}
|
270
235
|
}
|
271
|
-
|
272
|
-
|
236
|
+
/**
|
237
|
+
* Manage the browser's focus after each cell selection change.
|
238
|
+
*/
|
239
|
+
function _focusCell() {
|
240
|
+
_assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, selectedCell => {
|
273
241
|
const {
|
274
242
|
activeElement
|
275
|
-
} = _classPrivateFieldGet(
|
243
|
+
} = _classPrivateFieldGet(_hot, this).rootDocument;
|
276
244
|
|
277
245
|
// Blurring the `activeElement` removes the unwanted border around the focusable element (#6877)
|
278
246
|
// and resets the `document.activeElement` property. The blurring should happen only when the
|
@@ -284,14 +252,22 @@ function _focusCell2() {
|
|
284
252
|
this.focusOnHighlightedCell(selectedCell);
|
285
253
|
});
|
286
254
|
}
|
287
|
-
|
288
|
-
|
255
|
+
/**
|
256
|
+
* Manage the browser's focus after cell selection end.
|
257
|
+
*/
|
258
|
+
function _focusEditorElement() {
|
259
|
+
_assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, selectedCell => {
|
289
260
|
if (this.getFocusMode() === FOCUS_MODES.MIXED && selectedCell.nodeName === 'TD') {
|
290
261
|
this.refocusToEditorTextarea();
|
291
262
|
}
|
292
263
|
});
|
293
264
|
}
|
294
|
-
|
265
|
+
/**
|
266
|
+
* Update the manager configuration after calling `updateSettings`.
|
267
|
+
*
|
268
|
+
* @param {object} newSettings The new settings passed to the `updateSettings` method.
|
269
|
+
*/
|
270
|
+
function _onUpdateSettings(newSettings) {
|
295
271
|
if (newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.MIXED) {
|
296
272
|
this.setFocusMode(FOCUS_MODES.MIXED);
|
297
273
|
} else if (!newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.CELL) {
|