handsontable 0.0.0-next-7026906-20231107 → 0.0.0-next-7b93b7d-20231107
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/SheetClip/SheetClip.js +2 -2
- package/3rdparty/SheetClip/SheetClip.mjs +2 -2
- package/3rdparty/autoResize/autoResize.js +2 -2
- package/3rdparty/autoResize/autoResize.mjs +2 -2
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +108 -85
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +108 -85
- package/3rdparty/walkontable/src/calculator/viewportRows.js +60 -52
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +60 -52
- package/3rdparty/walkontable/src/core/clone.js +6 -0
- package/3rdparty/walkontable/src/core/clone.mjs +6 -0
- package/3rdparty/walkontable/src/event.js +125 -74
- package/3rdparty/walkontable/src/event.mjs +125 -74
- package/3rdparty/walkontable/src/filter/column.js +16 -0
- package/3rdparty/walkontable/src/filter/column.mjs +16 -0
- package/3rdparty/walkontable/src/filter/row.js +16 -0
- package/3rdparty/walkontable/src/filter/row.mjs +16 -0
- package/3rdparty/walkontable/src/overlay/bottom.js +1 -1
- package/3rdparty/walkontable/src/overlay/bottom.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/top.js +1 -1
- package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/_base.js +12 -5
- package/3rdparty/walkontable/src/renderer/_base.mjs +12 -5
- package/3rdparty/walkontable/src/renderer/cells.js +6 -2
- package/3rdparty/walkontable/src/renderer/cells.mjs +6 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +6 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +6 -2
- package/3rdparty/walkontable/src/renderer/rows.js +5 -0
- package/3rdparty/walkontable/src/renderer/rows.mjs +5 -0
- package/3rdparty/walkontable/src/renderer/table.js +24 -17
- package/3rdparty/walkontable/src/renderer/table.mjs +24 -17
- package/3rdparty/walkontable/src/scroll.js +2 -2
- package/3rdparty/walkontable/src/scroll.mjs +2 -2
- package/3rdparty/walkontable/src/selection/border/border.js +1 -1
- package/3rdparty/walkontable/src/selection/border/border.mjs +1 -1
- package/3rdparty/walkontable/src/settings.js +10 -10
- package/3rdparty/walkontable/src/settings.mjs +10 -10
- package/3rdparty/walkontable/src/table.js +3 -3
- package/3rdparty/walkontable/src/table.mjs +3 -3
- package/3rdparty/walkontable/src/utils/column.js +19 -4
- package/3rdparty/walkontable/src/utils/column.mjs +19 -4
- package/3rdparty/walkontable/src/utils/nodesPool.js +5 -0
- package/3rdparty/walkontable/src/utils/nodesPool.mjs +5 -0
- package/3rdparty/walkontable/src/utils/orderView/view.js +13 -6
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +13 -6
- package/3rdparty/walkontable/src/utils/orderView/viewSize.js +9 -6
- package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +9 -6
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +7 -4
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +7 -4
- package/3rdparty/walkontable/src/utils/row.js +14 -2
- package/3rdparty/walkontable/src/utils/row.mjs +14 -2
- package/3rdparty/walkontable/src/viewport.js +9 -9
- package/3rdparty/walkontable/src/viewport.mjs +9 -9
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.js +25 -25
- package/core.mjs +25 -25
- package/dataMap/dataMap.js +99 -90
- package/dataMap/dataMap.mjs +99 -90
- package/dataMap/dataSource.js +14 -8
- package/dataMap/dataSource.mjs +14 -8
- package/dataMap/metaManager/lazyFactoryMap.js +19 -7
- package/dataMap/metaManager/lazyFactoryMap.mjs +19 -7
- package/dataMap/metaManager/metaLayers/cellMeta.js +8 -3
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +8 -3
- package/dataMap/metaManager/metaLayers/columnMeta.js +7 -1
- package/dataMap/metaManager/metaLayers/columnMeta.mjs +7 -1
- package/dataMap/metaManager/metaLayers/globalMeta.js +6 -1
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +6 -1
- package/dataMap/metaManager/metaLayers/tableMeta.js +6 -2
- package/dataMap/metaManager/metaLayers/tableMeta.mjs +6 -2
- package/dataMap/metaManager/metaSchema.js +55 -55
- package/dataMap/metaManager/metaSchema.mjs +55 -55
- package/dataMap/metaManager/mods/dynamicCellMeta.js +7 -2
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +7 -2
- package/dataMap/metaManager/mods/extendMetaProperties.js +8 -4
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +8 -4
- package/dataMap/metaManager/utils.js +2 -2
- package/dataMap/metaManager/utils.mjs +2 -2
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +7244 -6347
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +120 -120
- package/dist/handsontable.js +7243 -6346
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +28 -28
- package/editorManager.js +105 -95
- package/editorManager.mjs +105 -95
- package/editors/autocompleteEditor/autocompleteEditor.js +47 -46
- package/editors/autocompleteEditor/autocompleteEditor.mjs +46 -45
- package/editors/baseEditor/baseEditor.js +23 -26
- package/editors/baseEditor/baseEditor.mjs +23 -26
- package/editors/dateEditor/dateEditor.js +24 -15
- package/editors/dateEditor/dateEditor.mjs +24 -15
- package/editors/dropdownEditor/dropdownEditor.js +1 -1
- package/editors/dropdownEditor/dropdownEditor.mjs +1 -1
- package/editors/handsontableEditor/handsontableEditor.js +4 -4
- package/editors/handsontableEditor/handsontableEditor.mjs +4 -4
- package/editors/textEditor/textEditor.js +23 -17
- package/editors/textEditor/textEditor.mjs +24 -18
- package/eventManager.js +8 -0
- package/eventManager.mjs +8 -0
- package/helpers/array.js +2 -2
- package/helpers/array.mjs +2 -2
- package/helpers/dom/element.js +7 -7
- package/helpers/dom/element.mjs +7 -7
- package/helpers/function.js +1 -1
- package/helpers/function.mjs +1 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +4 -4
- package/helpers/object.mjs +4 -4
- package/helpers/string.js +1 -1
- package/helpers/string.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +0 -2
- package/pluginHooks.js +12 -3
- package/pluginHooks.mjs +12 -3
- package/plugins/autoColumnSize/autoColumnSize.js +141 -130
- package/plugins/autoColumnSize/autoColumnSize.mjs +140 -129
- package/plugins/autoRowSize/autoRowSize.js +112 -125
- package/plugins/autoRowSize/autoRowSize.mjs +110 -123
- package/plugins/autofill/autofill.js +97 -102
- package/plugins/autofill/autofill.mjs +96 -101
- package/plugins/base/base.js +57 -22
- package/plugins/base/base.mjs +56 -22
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +29 -24
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +28 -23
- package/plugins/collapsibleColumns/collapsibleColumns.js +104 -107
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +102 -104
- package/plugins/columnSorting/columnSorting.js +105 -98
- package/plugins/columnSorting/columnSorting.mjs +104 -97
- package/plugins/columnSorting/columnStatesManager.js +12 -6
- package/plugins/columnSorting/columnStatesManager.mjs +12 -6
- package/plugins/columnSummary/columnSummary.js +71 -58
- package/plugins/columnSummary/columnSummary.mjs +70 -57
- package/plugins/columnSummary/endpoints.js +20 -14
- package/plugins/columnSummary/endpoints.mjs +20 -14
- package/plugins/comments/commentEditor.js +30 -2
- package/plugins/comments/commentEditor.mjs +30 -2
- package/plugins/comments/comments.js +158 -169
- package/plugins/comments/comments.mjs +157 -168
- package/plugins/comments/displaySwitch.js +7 -3
- package/plugins/comments/displaySwitch.mjs +7 -3
- package/plugins/contextMenu/commandExecutor.js +15 -2
- package/plugins/contextMenu/commandExecutor.mjs +15 -2
- package/plugins/contextMenu/contextMenu.js +91 -101
- package/plugins/contextMenu/contextMenu.mjs +90 -100
- package/plugins/contextMenu/itemsFactory.js +19 -4
- package/plugins/contextMenu/itemsFactory.mjs +19 -4
- package/plugins/contextMenu/menu/cursor.js +36 -0
- package/plugins/contextMenu/menu/cursor.mjs +36 -0
- package/plugins/contextMenu/menu/menu.js +57 -5
- package/plugins/contextMenu/menu/menu.mjs +57 -5
- package/plugins/copyPaste/copyPaste.js +74 -75
- package/plugins/copyPaste/copyPaste.mjs +74 -75
- package/plugins/customBorders/customBorders.js +49 -48
- package/plugins/customBorders/customBorders.mjs +48 -47
- package/plugins/dragToScroll/dragToScroll.js +50 -54
- package/plugins/dragToScroll/dragToScroll.mjs +49 -52
- package/plugins/dropdownMenu/dropdownMenu.js +132 -129
- package/plugins/dropdownMenu/dropdownMenu.mjs +132 -129
- package/plugins/exportFile/dataProvider.js +7 -2
- package/plugins/exportFile/dataProvider.mjs +7 -2
- package/plugins/exportFile/exportFile.js +1 -1
- package/plugins/exportFile/exportFile.mjs +1 -1
- package/plugins/exportFile/types/_base.js +14 -6
- package/plugins/exportFile/types/_base.mjs +14 -6
- package/plugins/filters/component/actionBar.js +9 -0
- package/plugins/filters/component/actionBar.mjs +9 -0
- package/plugins/filters/component/condition.js +13 -0
- package/plugins/filters/component/condition.mjs +13 -0
- package/plugins/filters/component/operators.js +9 -0
- package/plugins/filters/component/operators.mjs +9 -0
- package/plugins/filters/component/value.js +9 -0
- package/plugins/filters/component/value.mjs +9 -0
- package/plugins/filters/conditionCollection.js +9 -4
- package/plugins/filters/conditionCollection.mjs +9 -4
- package/plugins/filters/conditionUpdateObserver.js +53 -42
- package/plugins/filters/conditionUpdateObserver.mjs +53 -42
- package/plugins/filters/dataFilter.js +9 -3
- package/plugins/filters/dataFilter.mjs +9 -3
- package/plugins/filters/filters.js +184 -189
- package/plugins/filters/filters.mjs +182 -187
- package/plugins/filters/ui/_base.js +1 -1
- package/plugins/filters/ui/_base.mjs +1 -1
- package/plugins/filters/utils.js +1 -1
- package/plugins/filters/utils.mjs +1 -1
- package/plugins/formulas/engine/settings.js +1 -1
- package/plugins/formulas/engine/settings.mjs +1 -1
- package/plugins/formulas/formulas.js +684 -602
- package/plugins/formulas/formulas.mjs +682 -600
- package/plugins/hiddenColumns/hiddenColumns.js +174 -169
- package/plugins/hiddenColumns/hiddenColumns.mjs +173 -168
- package/plugins/hiddenRows/hiddenRows.js +170 -165
- package/plugins/hiddenRows/hiddenRows.mjs +169 -164
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +67 -54
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +64 -51
- package/plugins/manualColumnMove/manualColumnMove.js +287 -232
- package/plugins/manualColumnMove/manualColumnMove.mjs +286 -231
- package/plugins/manualColumnMove/ui/_base.js +9 -3
- package/plugins/manualColumnMove/ui/_base.mjs +9 -3
- package/plugins/manualColumnResize/manualColumnResize.js +291 -246
- package/plugins/manualColumnResize/manualColumnResize.mjs +290 -244
- package/plugins/manualRowMove/manualRowMove.js +223 -208
- package/plugins/manualRowMove/manualRowMove.mjs +222 -207
- package/plugins/manualRowMove/ui/_base.js +10 -5
- package/plugins/manualRowMove/ui/_base.mjs +10 -5
- package/plugins/manualRowResize/manualRowResize.js +254 -209
- package/plugins/manualRowResize/manualRowResize.mjs +253 -207
- package/plugins/mergeCells/calculations/autofill.js +9 -3
- package/plugins/mergeCells/calculations/autofill.mjs +9 -3
- package/plugins/mergeCells/calculations/selection.js +10 -4
- package/plugins/mergeCells/calculations/selection.mjs +10 -4
- package/plugins/mergeCells/cellCoords.js +16 -6
- package/plugins/mergeCells/cellCoords.mjs +16 -6
- package/plugins/mergeCells/cellsCollection.js +10 -4
- package/plugins/mergeCells/cellsCollection.mjs +10 -4
- package/plugins/mergeCells/mergeCells.js +582 -502
- package/plugins/mergeCells/mergeCells.mjs +580 -500
- package/plugins/multiColumnSorting/multiColumnSorting.js +13 -10
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +13 -10
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +16 -28
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +16 -27
- package/plugins/nestedHeaders/nestedHeaders.js +542 -499
- package/plugins/nestedHeaders/nestedHeaders.mjs +554 -511
- package/plugins/nestedHeaders/stateManager/index.js +1 -1
- package/plugins/nestedHeaders/stateManager/index.mjs +1 -1
- package/plugins/nestedRows/data/dataManager.js +21 -15
- package/plugins/nestedRows/data/dataManager.mjs +21 -15
- package/plugins/nestedRows/nestedRows.js +326 -278
- package/plugins/nestedRows/nestedRows.mjs +325 -277
- package/plugins/nestedRows/ui/_base.js +7 -1
- package/plugins/nestedRows/ui/_base.mjs +7 -1
- package/plugins/nestedRows/ui/collapsing.js +2 -2
- package/plugins/nestedRows/ui/collapsing.mjs +2 -2
- package/plugins/nestedRows/ui/contextMenu.js +28 -18
- package/plugins/nestedRows/ui/contextMenu.mjs +28 -18
- package/plugins/nestedRows/utils/rowMoveController.js +12 -4
- package/plugins/nestedRows/utils/rowMoveController.mjs +12 -4
- package/plugins/persistentState/persistentState.js +14 -11
- package/plugins/persistentState/persistentState.mjs +14 -11
- package/plugins/persistentState/storage.js +11 -6
- package/plugins/persistentState/storage.mjs +11 -6
- package/plugins/registry.js +2 -2
- package/plugins/registry.mjs +2 -2
- package/plugins/search/search.js +57 -46
- package/plugins/search/search.mjs +56 -45
- package/plugins/touchScroll/touchScroll.js +102 -100
- package/plugins/touchScroll/touchScroll.mjs +100 -98
- package/plugins/trimRows/trimRows.js +33 -28
- package/plugins/trimRows/trimRows.mjs +32 -27
- package/plugins/undoRedo/undoRedo.js +2 -2
- package/plugins/undoRedo/undoRedo.mjs +2 -2
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +11 -11
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +11 -11
- package/renderers/baseRenderer/baseRenderer.js +2 -2
- package/renderers/baseRenderer/baseRenderer.mjs +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.js +23 -23
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +23 -23
- package/renderers/dateRenderer/dateRenderer.js +4 -4
- package/renderers/dateRenderer/dateRenderer.mjs +4 -4
- package/renderers/handsontableRenderer/handsontableRenderer.js +4 -4
- package/renderers/handsontableRenderer/handsontableRenderer.mjs +4 -4
- package/renderers/htmlRenderer/htmlRenderer.js +4 -4
- package/renderers/htmlRenderer/htmlRenderer.mjs +4 -4
- package/renderers/numericRenderer/numericRenderer.js +3 -3
- package/renderers/numericRenderer/numericRenderer.mjs +3 -3
- package/renderers/passwordRenderer/passwordRenderer.js +3 -3
- package/renderers/passwordRenderer/passwordRenderer.mjs +3 -3
- package/renderers/selectRenderer/selectRenderer.js +4 -4
- package/renderers/selectRenderer/selectRenderer.mjs +4 -4
- package/renderers/textRenderer/textRenderer.js +5 -5
- package/renderers/textRenderer/textRenderer.mjs +5 -5
- package/renderers/timeRenderer/timeRenderer.js +3 -3
- package/renderers/timeRenderer/timeRenderer.mjs +3 -3
- package/selection/range.js +12 -2
- package/selection/range.mjs +12 -2
- package/selection/selection.js +3 -3
- package/selection/selection.mjs +3 -3
- package/tableView.js +208 -200
- package/tableView.mjs +208 -200
- package/translations/changesObservable/utils.js +2 -2
- package/translations/changesObservable/utils.mjs +2 -2
- package/translations/indexMapper.js +25 -22
- package/translations/indexMapper.mjs +25 -22
- package/translations/mapCollections/aggregatedCollection.js +8 -2
- package/translations/mapCollections/aggregatedCollection.mjs +8 -2
- package/translations/mapCollections/mapCollection.js +5 -2
- package/translations/mapCollections/mapCollection.mjs +5 -2
- package/translations/maps/indexMap.js +6 -1
- package/translations/maps/indexMap.mjs +6 -1
- package/translations/maps/utils/physicallyIndexed.js +2 -2
- package/translations/maps/utils/physicallyIndexed.mjs +2 -2
- package/utils/dataStructures/linkedList.js +10 -6
- package/utils/dataStructures/linkedList.mjs +10 -6
- package/utils/dataStructures/queue.js +1 -1
- package/utils/dataStructures/queue.mjs +1 -1
- package/utils/dataStructures/stack.js +1 -1
- package/utils/dataStructures/stack.mjs +1 -1
- package/utils/ghostTable.js +2 -2
- package/utils/ghostTable.mjs +2 -2
- package/utils/interval.js +73 -36
- package/utils/interval.mjs +73 -36
- package/utils/parseTable.js +1 -1
- package/utils/parseTable.mjs +1 -1
- package/validators/autocompleteValidator/autocompleteValidator.js +1 -1
- package/validators/autocompleteValidator/autocompleteValidator.mjs +1 -1
- package/validators/dateValidator/dateValidator.js +1 -1
- package/validators/dateValidator/dateValidator.mjs +1 -1
- package/validators/numericValidator/numericValidator.js +1 -1
- package/validators/numericValidator/numericValidator.mjs +1 -1
package/editorManager.js
CHANGED
@@ -1,85 +1,112 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
4
5
|
var _unicode = require("./helpers/unicode");
|
5
6
|
var _event = require("./helpers/dom/event");
|
6
7
|
var _registry = require("./editors/registry");
|
7
8
|
var _eventManager = _interopRequireDefault(require("./eventManager"));
|
8
9
|
var _mixed = require("./helpers/mixed");
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
+
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
12
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
13
|
+
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; }
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
15
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
16
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
10
17
|
const SHORTCUTS_GROUP_NAVIGATION = 'editorManager.navigation';
|
11
18
|
exports.SHORTCUTS_GROUP_NAVIGATION = SHORTCUTS_GROUP_NAVIGATION;
|
19
|
+
var _onAfterDocumentKeyDown = /*#__PURE__*/new WeakSet();
|
20
|
+
var _onCellDblClick = /*#__PURE__*/new WeakSet();
|
12
21
|
class EditorManager {
|
13
22
|
/**
|
14
|
-
* @param {Core}
|
23
|
+
* @param {Core} hotInstance The Handsontable instance.
|
15
24
|
* @param {TableMeta} tableMeta The table meta instance.
|
16
25
|
* @param {Selection} selection The selection instance.
|
17
26
|
*/
|
18
|
-
constructor(
|
27
|
+
constructor(hotInstance, tableMeta, _selection) {
|
28
|
+
/**
|
29
|
+
* OnCellDblClick callback.
|
30
|
+
*
|
31
|
+
* @param {MouseEvent} event The mouse event object.
|
32
|
+
* @param {object} coords The cell coordinates.
|
33
|
+
* @param {HTMLTableCellElement|HTMLTableHeaderCellElement} elem The element which triggers the action.
|
34
|
+
*/
|
35
|
+
_classPrivateMethodInitSpec(this, _onCellDblClick);
|
36
|
+
/**
|
37
|
+
* OnAfterDocumentKeyDown callback.
|
38
|
+
*
|
39
|
+
* @param {KeyboardEvent} event The keyboard event object.
|
40
|
+
*/
|
41
|
+
_classPrivateMethodInitSpec(this, _onAfterDocumentKeyDown);
|
19
42
|
/**
|
20
43
|
* Instance of {@link Handsontable}.
|
21
44
|
*
|
22
45
|
* @private
|
23
46
|
* @type {Handsontable}
|
24
47
|
*/
|
25
|
-
this
|
48
|
+
_defineProperty(this, "hot", void 0);
|
26
49
|
/**
|
27
50
|
* Reference to an instance's private GridSettings object.
|
28
51
|
*
|
29
52
|
* @private
|
30
53
|
* @type {GridSettings}
|
31
54
|
*/
|
32
|
-
this
|
55
|
+
_defineProperty(this, "tableMeta", void 0);
|
33
56
|
/**
|
34
57
|
* Instance of {@link Selection}.
|
35
58
|
*
|
36
59
|
* @private
|
37
60
|
* @type {Selection}
|
38
61
|
*/
|
39
|
-
this
|
62
|
+
_defineProperty(this, "selection", void 0);
|
40
63
|
/**
|
41
64
|
* Instance of {@link EventManager}.
|
42
65
|
*
|
43
66
|
* @private
|
44
67
|
* @type {EventManager}
|
45
68
|
*/
|
46
|
-
this
|
69
|
+
_defineProperty(this, "eventManager", void 0);
|
47
70
|
/**
|
48
71
|
* Determines if EditorManager is destroyed.
|
49
72
|
*
|
50
73
|
* @private
|
51
74
|
* @type {boolean}
|
52
75
|
*/
|
53
|
-
this
|
76
|
+
_defineProperty(this, "destroyed", false);
|
54
77
|
/**
|
55
78
|
* Determines if EditorManager is locked.
|
56
79
|
*
|
57
80
|
* @private
|
58
81
|
* @type {boolean}
|
59
82
|
*/
|
60
|
-
this
|
83
|
+
_defineProperty(this, "lock", false);
|
61
84
|
/**
|
62
85
|
* A reference to an instance of the activeEditor.
|
63
86
|
*
|
64
87
|
* @private
|
65
88
|
* @type {BaseEditor}
|
66
89
|
*/
|
67
|
-
this
|
90
|
+
_defineProperty(this, "activeEditor", void 0);
|
68
91
|
/**
|
69
92
|
* Keeps a reference to the cell's properties object.
|
70
93
|
*
|
71
94
|
* @type {object}
|
72
95
|
*/
|
73
|
-
this
|
74
|
-
this.
|
96
|
+
_defineProperty(this, "cellProperties", void 0);
|
97
|
+
this.hot = hotInstance;
|
98
|
+
this.tableMeta = tableMeta;
|
99
|
+
this.selection = _selection;
|
100
|
+
this.eventManager = new _eventManager.default(hotInstance);
|
101
|
+
this.hot.addHook('afterDocumentKeyDown', event => _classPrivateMethodGet(this, _onAfterDocumentKeyDown, _onAfterDocumentKeyDown2).call(this, event));
|
75
102
|
|
76
103
|
// Open editor when text composition is started (IME editor)
|
77
|
-
this.eventManager.addEventListener(this.
|
78
|
-
if (!this.destroyed && this.
|
104
|
+
this.eventManager.addEventListener(this.hot.rootDocument.documentElement, 'compositionstart', event => {
|
105
|
+
if (!this.destroyed && this.hot.isListening()) {
|
79
106
|
this.openEditor('', event);
|
80
107
|
}
|
81
108
|
});
|
82
|
-
this.
|
109
|
+
this.hot.view._wt.update('onCellDblClick', (event, coords, elem) => _classPrivateMethodGet(this, _onCellDblClick, _onCellDblClick2).call(this, event, coords, elem));
|
83
110
|
}
|
84
111
|
|
85
112
|
/**
|
@@ -136,7 +163,7 @@ class EditorManager {
|
|
136
163
|
}
|
137
164
|
const {
|
138
165
|
highlight
|
139
|
-
} = this.
|
166
|
+
} = this.hot.getSelectedRangeLast();
|
140
167
|
if (highlight.isHeader()) {
|
141
168
|
return;
|
142
169
|
}
|
@@ -144,7 +171,7 @@ class EditorManager {
|
|
144
171
|
row,
|
145
172
|
col
|
146
173
|
} = highlight;
|
147
|
-
const modifiedCellCoords = this.
|
174
|
+
const modifiedCellCoords = this.hot.runHooks('modifyGetCellCoords', row, col);
|
148
175
|
let visualRowToCheck = row;
|
149
176
|
let visualColumnToCheck = col;
|
150
177
|
if (Array.isArray(modifiedCellCoords)) {
|
@@ -152,20 +179,20 @@ class EditorManager {
|
|
152
179
|
}
|
153
180
|
|
154
181
|
// Getting values using the modified coordinates.
|
155
|
-
this.cellProperties = this.
|
182
|
+
this.cellProperties = this.hot.getCellMeta(visualRowToCheck, visualColumnToCheck);
|
156
183
|
if (!this.isCellEditable()) {
|
157
184
|
this.clearActiveEditor();
|
158
185
|
return;
|
159
186
|
}
|
160
|
-
const td = this.
|
187
|
+
const td = this.hot.getCell(row, col, true);
|
161
188
|
|
162
189
|
// Skip the preparation when the cell is not rendered in the DOM. The cell is scrolled out of
|
163
190
|
// the table's viewport.
|
164
191
|
if (td) {
|
165
|
-
const editorClass = this.
|
166
|
-
const prop = this.
|
167
|
-
const originalValue = this.
|
168
|
-
this.activeEditor = (0, _registry.getEditorInstance)(editorClass, this.
|
192
|
+
const editorClass = this.hot.getCellEditor(this.cellProperties);
|
193
|
+
const prop = this.hot.colToProp(visualColumnToCheck);
|
194
|
+
const originalValue = this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(visualRowToCheck), visualColumnToCheck);
|
195
|
+
this.activeEditor = (0, _registry.getEditorInstance)(editorClass, this.hot);
|
169
196
|
// Using not modified coordinates, as we need to get the table element using selection coordinates.
|
170
197
|
// There is an extra translation in the editor for saving value.
|
171
198
|
this.activeEditor.prepare(row, col, prop, td, originalValue, this.cellProperties);
|
@@ -196,7 +223,7 @@ class EditorManager {
|
|
196
223
|
return;
|
197
224
|
}
|
198
225
|
if (!this.activeEditor) {
|
199
|
-
this.
|
226
|
+
this.hot.scrollToFocusedCell();
|
200
227
|
this.prepareEditor();
|
201
228
|
}
|
202
229
|
if (this.activeEditor) {
|
@@ -246,7 +273,7 @@ class EditorManager {
|
|
246
273
|
* @private
|
247
274
|
*/
|
248
275
|
clearActiveEditor() {
|
249
|
-
this.activeEditor =
|
276
|
+
this.activeEditor = undefined;
|
250
277
|
}
|
251
278
|
|
252
279
|
/**
|
@@ -260,11 +287,11 @@ class EditorManager {
|
|
260
287
|
* @returns {boolean}
|
261
288
|
*/
|
262
289
|
isCellEditable() {
|
263
|
-
const selection = this.
|
290
|
+
const selection = this.hot.getSelectedRangeLast();
|
264
291
|
if (!selection) {
|
265
292
|
return false;
|
266
293
|
}
|
267
|
-
const editorClass = this.
|
294
|
+
const editorClass = this.hot.getCellEditor(this.cellProperties);
|
268
295
|
const {
|
269
296
|
row,
|
270
297
|
col
|
@@ -272,8 +299,8 @@ class EditorManager {
|
|
272
299
|
const {
|
273
300
|
rowIndexMapper,
|
274
301
|
columnIndexMapper
|
275
|
-
} = this.
|
276
|
-
const isCellHidden = rowIndexMapper.isHidden(this.
|
302
|
+
} = this.hot;
|
303
|
+
const isCellHidden = rowIndexMapper.isHidden(this.hot.toPhysicalRow(row)) || columnIndexMapper.isHidden(this.hot.toPhysicalColumn(col));
|
277
304
|
if (this.cellProperties.readOnly || !editorClass || isCellHidden) {
|
278
305
|
return false;
|
279
306
|
}
|
@@ -296,73 +323,6 @@ class EditorManager {
|
|
296
323
|
this.selection.transformStart(enterMoves.row, enterMoves.col, true);
|
297
324
|
}
|
298
325
|
}
|
299
|
-
|
300
|
-
/**
|
301
|
-
* OnAfterDocumentKeyDown callback.
|
302
|
-
*
|
303
|
-
* @private
|
304
|
-
* @param {KeyboardEvent} event The keyboard event object.
|
305
|
-
*/
|
306
|
-
onAfterDocumentKeyDown(event) {
|
307
|
-
const selection = this.instance.getSelectedRangeLast();
|
308
|
-
if (!this.instance.isListening() || !selection || selection.highlight.isHeader() || (0, _event.isImmediatePropagationStopped)(event)) {
|
309
|
-
return;
|
310
|
-
}
|
311
|
-
const {
|
312
|
-
keyCode
|
313
|
-
} = event;
|
314
|
-
|
315
|
-
// catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
|
316
|
-
const isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
|
317
|
-
if (!this.activeEditor || this.activeEditor && !this.activeEditor.isWaiting()) {
|
318
|
-
if (!(0, _unicode.isFunctionKey)(keyCode) && !(0, _unicode.isCtrlMetaKey)(keyCode) && !isCtrlPressed && !this.isEditorOpened()) {
|
319
|
-
const shortcutManager = this.instance.getShortcutManager();
|
320
|
-
const editorContext = shortcutManager.getContext('editor');
|
321
|
-
const runOnlySelectedConfig = {
|
322
|
-
runOnlyIf: () => (0, _mixed.isDefined)(this.instance.getSelected()),
|
323
|
-
group: SHORTCUTS_GROUP_NAVIGATION
|
324
|
-
};
|
325
|
-
editorContext.addShortcuts([{
|
326
|
-
keys: [['ArrowUp']],
|
327
|
-
callback: () => {
|
328
|
-
this.instance.selection.transformStart(-1, 0);
|
329
|
-
}
|
330
|
-
}, {
|
331
|
-
keys: [['ArrowDown']],
|
332
|
-
callback: () => {
|
333
|
-
this.instance.selection.transformStart(1, 0);
|
334
|
-
}
|
335
|
-
}, {
|
336
|
-
keys: [['ArrowLeft']],
|
337
|
-
callback: () => {
|
338
|
-
this.instance.selection.transformStart(0, -1 * this.instance.getDirectionFactor());
|
339
|
-
}
|
340
|
-
}, {
|
341
|
-
keys: [['ArrowRight']],
|
342
|
-
callback: () => {
|
343
|
-
this.instance.selection.transformStart(0, this.instance.getDirectionFactor());
|
344
|
-
}
|
345
|
-
}], runOnlySelectedConfig);
|
346
|
-
this.openEditor('', event);
|
347
|
-
}
|
348
|
-
}
|
349
|
-
}
|
350
|
-
|
351
|
-
/**
|
352
|
-
* OnCellDblClick callback.
|
353
|
-
*
|
354
|
-
* @private
|
355
|
-
* @param {MouseEvent} event The mouse event object.
|
356
|
-
* @param {object} coords The cell coordinates.
|
357
|
-
* @param {HTMLTableCellElement|HTMLTableHeaderCellElement} elem The element which triggers the action.
|
358
|
-
*/
|
359
|
-
onCellDblClick(event, coords, elem) {
|
360
|
-
// may be TD or TH
|
361
|
-
if (elem.nodeName === 'TD') {
|
362
|
-
this.openEditor(null, event, true);
|
363
|
-
}
|
364
|
-
}
|
365
|
-
|
366
326
|
/**
|
367
327
|
* Destroy the instance.
|
368
328
|
*/
|
@@ -371,6 +331,56 @@ class EditorManager {
|
|
371
331
|
this.eventManager.destroy();
|
372
332
|
}
|
373
333
|
}
|
334
|
+
function _onAfterDocumentKeyDown2(event) {
|
335
|
+
const selection = this.hot.getSelectedRangeLast();
|
336
|
+
if (!this.hot.isListening() || !selection || selection.highlight.isHeader() || (0, _event.isImmediatePropagationStopped)(event)) {
|
337
|
+
return;
|
338
|
+
}
|
339
|
+
const {
|
340
|
+
keyCode
|
341
|
+
} = event;
|
342
|
+
|
343
|
+
// catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
|
344
|
+
const isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
|
345
|
+
if (!this.activeEditor || this.activeEditor && !this.activeEditor.isWaiting()) {
|
346
|
+
if (!(0, _unicode.isFunctionKey)(keyCode) && !(0, _unicode.isCtrlMetaKey)(keyCode) && !isCtrlPressed && !this.isEditorOpened()) {
|
347
|
+
const shortcutManager = this.hot.getShortcutManager();
|
348
|
+
const editorContext = shortcutManager.getContext('editor');
|
349
|
+
const runOnlySelectedConfig = {
|
350
|
+
runOnlyIf: () => (0, _mixed.isDefined)(this.hot.getSelected()),
|
351
|
+
group: SHORTCUTS_GROUP_NAVIGATION
|
352
|
+
};
|
353
|
+
editorContext.addShortcuts([{
|
354
|
+
keys: [['ArrowUp']],
|
355
|
+
callback: () => {
|
356
|
+
this.hot.selection.transformStart(-1, 0);
|
357
|
+
}
|
358
|
+
}, {
|
359
|
+
keys: [['ArrowDown']],
|
360
|
+
callback: () => {
|
361
|
+
this.hot.selection.transformStart(1, 0);
|
362
|
+
}
|
363
|
+
}, {
|
364
|
+
keys: [['ArrowLeft']],
|
365
|
+
callback: () => {
|
366
|
+
this.hot.selection.transformStart(0, -1 * this.hot.getDirectionFactor());
|
367
|
+
}
|
368
|
+
}, {
|
369
|
+
keys: [['ArrowRight']],
|
370
|
+
callback: () => {
|
371
|
+
this.hot.selection.transformStart(0, this.hot.getDirectionFactor());
|
372
|
+
}
|
373
|
+
}], runOnlySelectedConfig);
|
374
|
+
this.openEditor('', event);
|
375
|
+
}
|
376
|
+
}
|
377
|
+
}
|
378
|
+
function _onCellDblClick2(event, coords, elem) {
|
379
|
+
// may be TD or TH
|
380
|
+
if (elem.nodeName === 'TD') {
|
381
|
+
this.openEditor(null, event, true);
|
382
|
+
}
|
383
|
+
}
|
374
384
|
const instances = new WeakMap();
|
375
385
|
|
376
386
|
/**
|
package/editorManager.mjs
CHANGED
@@ -1,80 +1,107 @@
|
|
1
|
+
import "core-js/modules/es.error.cause.js";
|
2
|
+
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
3
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
6
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
7
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
1
8
|
import { isFunctionKey, isCtrlMetaKey } from "./helpers/unicode.mjs";
|
2
9
|
import { isImmediatePropagationStopped } from "./helpers/dom/event.mjs";
|
3
10
|
import { getEditorInstance } from "./editors/registry.mjs";
|
4
11
|
import EventManager from "./eventManager.mjs";
|
5
12
|
import { isDefined } from "./helpers/mixed.mjs";
|
6
13
|
export const SHORTCUTS_GROUP_NAVIGATION = 'editorManager.navigation';
|
14
|
+
var _onAfterDocumentKeyDown = /*#__PURE__*/new WeakSet();
|
15
|
+
var _onCellDblClick = /*#__PURE__*/new WeakSet();
|
7
16
|
class EditorManager {
|
8
17
|
/**
|
9
|
-
* @param {Core}
|
18
|
+
* @param {Core} hotInstance The Handsontable instance.
|
10
19
|
* @param {TableMeta} tableMeta The table meta instance.
|
11
20
|
* @param {Selection} selection The selection instance.
|
12
21
|
*/
|
13
|
-
constructor(
|
22
|
+
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
|
+
* @param {HTMLTableCellElement|HTMLTableHeaderCellElement} elem The element which triggers the action.
|
29
|
+
*/
|
30
|
+
_classPrivateMethodInitSpec(this, _onCellDblClick);
|
31
|
+
/**
|
32
|
+
* OnAfterDocumentKeyDown callback.
|
33
|
+
*
|
34
|
+
* @param {KeyboardEvent} event The keyboard event object.
|
35
|
+
*/
|
36
|
+
_classPrivateMethodInitSpec(this, _onAfterDocumentKeyDown);
|
14
37
|
/**
|
15
38
|
* Instance of {@link Handsontable}.
|
16
39
|
*
|
17
40
|
* @private
|
18
41
|
* @type {Handsontable}
|
19
42
|
*/
|
20
|
-
this
|
43
|
+
_defineProperty(this, "hot", void 0);
|
21
44
|
/**
|
22
45
|
* Reference to an instance's private GridSettings object.
|
23
46
|
*
|
24
47
|
* @private
|
25
48
|
* @type {GridSettings}
|
26
49
|
*/
|
27
|
-
this
|
50
|
+
_defineProperty(this, "tableMeta", void 0);
|
28
51
|
/**
|
29
52
|
* Instance of {@link Selection}.
|
30
53
|
*
|
31
54
|
* @private
|
32
55
|
* @type {Selection}
|
33
56
|
*/
|
34
|
-
this
|
57
|
+
_defineProperty(this, "selection", void 0);
|
35
58
|
/**
|
36
59
|
* Instance of {@link EventManager}.
|
37
60
|
*
|
38
61
|
* @private
|
39
62
|
* @type {EventManager}
|
40
63
|
*/
|
41
|
-
this
|
64
|
+
_defineProperty(this, "eventManager", void 0);
|
42
65
|
/**
|
43
66
|
* Determines if EditorManager is destroyed.
|
44
67
|
*
|
45
68
|
* @private
|
46
69
|
* @type {boolean}
|
47
70
|
*/
|
48
|
-
this
|
71
|
+
_defineProperty(this, "destroyed", false);
|
49
72
|
/**
|
50
73
|
* Determines if EditorManager is locked.
|
51
74
|
*
|
52
75
|
* @private
|
53
76
|
* @type {boolean}
|
54
77
|
*/
|
55
|
-
this
|
78
|
+
_defineProperty(this, "lock", false);
|
56
79
|
/**
|
57
80
|
* A reference to an instance of the activeEditor.
|
58
81
|
*
|
59
82
|
* @private
|
60
83
|
* @type {BaseEditor}
|
61
84
|
*/
|
62
|
-
this
|
85
|
+
_defineProperty(this, "activeEditor", void 0);
|
63
86
|
/**
|
64
87
|
* Keeps a reference to the cell's properties object.
|
65
88
|
*
|
66
89
|
* @type {object}
|
67
90
|
*/
|
68
|
-
this
|
69
|
-
this.
|
91
|
+
_defineProperty(this, "cellProperties", void 0);
|
92
|
+
this.hot = hotInstance;
|
93
|
+
this.tableMeta = tableMeta;
|
94
|
+
this.selection = _selection;
|
95
|
+
this.eventManager = new EventManager(hotInstance);
|
96
|
+
this.hot.addHook('afterDocumentKeyDown', event => _classPrivateMethodGet(this, _onAfterDocumentKeyDown, _onAfterDocumentKeyDown2).call(this, event));
|
70
97
|
|
71
98
|
// Open editor when text composition is started (IME editor)
|
72
|
-
this.eventManager.addEventListener(this.
|
73
|
-
if (!this.destroyed && this.
|
99
|
+
this.eventManager.addEventListener(this.hot.rootDocument.documentElement, 'compositionstart', event => {
|
100
|
+
if (!this.destroyed && this.hot.isListening()) {
|
74
101
|
this.openEditor('', event);
|
75
102
|
}
|
76
103
|
});
|
77
|
-
this.
|
104
|
+
this.hot.view._wt.update('onCellDblClick', (event, coords, elem) => _classPrivateMethodGet(this, _onCellDblClick, _onCellDblClick2).call(this, event, coords, elem));
|
78
105
|
}
|
79
106
|
|
80
107
|
/**
|
@@ -131,7 +158,7 @@ class EditorManager {
|
|
131
158
|
}
|
132
159
|
const {
|
133
160
|
highlight
|
134
|
-
} = this.
|
161
|
+
} = this.hot.getSelectedRangeLast();
|
135
162
|
if (highlight.isHeader()) {
|
136
163
|
return;
|
137
164
|
}
|
@@ -139,7 +166,7 @@ class EditorManager {
|
|
139
166
|
row,
|
140
167
|
col
|
141
168
|
} = highlight;
|
142
|
-
const modifiedCellCoords = this.
|
169
|
+
const modifiedCellCoords = this.hot.runHooks('modifyGetCellCoords', row, col);
|
143
170
|
let visualRowToCheck = row;
|
144
171
|
let visualColumnToCheck = col;
|
145
172
|
if (Array.isArray(modifiedCellCoords)) {
|
@@ -147,20 +174,20 @@ class EditorManager {
|
|
147
174
|
}
|
148
175
|
|
149
176
|
// Getting values using the modified coordinates.
|
150
|
-
this.cellProperties = this.
|
177
|
+
this.cellProperties = this.hot.getCellMeta(visualRowToCheck, visualColumnToCheck);
|
151
178
|
if (!this.isCellEditable()) {
|
152
179
|
this.clearActiveEditor();
|
153
180
|
return;
|
154
181
|
}
|
155
|
-
const td = this.
|
182
|
+
const td = this.hot.getCell(row, col, true);
|
156
183
|
|
157
184
|
// Skip the preparation when the cell is not rendered in the DOM. The cell is scrolled out of
|
158
185
|
// the table's viewport.
|
159
186
|
if (td) {
|
160
|
-
const editorClass = this.
|
161
|
-
const prop = this.
|
162
|
-
const originalValue = this.
|
163
|
-
this.activeEditor = getEditorInstance(editorClass, this.
|
187
|
+
const editorClass = this.hot.getCellEditor(this.cellProperties);
|
188
|
+
const prop = this.hot.colToProp(visualColumnToCheck);
|
189
|
+
const originalValue = this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(visualRowToCheck), visualColumnToCheck);
|
190
|
+
this.activeEditor = getEditorInstance(editorClass, this.hot);
|
164
191
|
// Using not modified coordinates, as we need to get the table element using selection coordinates.
|
165
192
|
// There is an extra translation in the editor for saving value.
|
166
193
|
this.activeEditor.prepare(row, col, prop, td, originalValue, this.cellProperties);
|
@@ -191,7 +218,7 @@ class EditorManager {
|
|
191
218
|
return;
|
192
219
|
}
|
193
220
|
if (!this.activeEditor) {
|
194
|
-
this.
|
221
|
+
this.hot.scrollToFocusedCell();
|
195
222
|
this.prepareEditor();
|
196
223
|
}
|
197
224
|
if (this.activeEditor) {
|
@@ -241,7 +268,7 @@ class EditorManager {
|
|
241
268
|
* @private
|
242
269
|
*/
|
243
270
|
clearActiveEditor() {
|
244
|
-
this.activeEditor =
|
271
|
+
this.activeEditor = undefined;
|
245
272
|
}
|
246
273
|
|
247
274
|
/**
|
@@ -255,11 +282,11 @@ class EditorManager {
|
|
255
282
|
* @returns {boolean}
|
256
283
|
*/
|
257
284
|
isCellEditable() {
|
258
|
-
const selection = this.
|
285
|
+
const selection = this.hot.getSelectedRangeLast();
|
259
286
|
if (!selection) {
|
260
287
|
return false;
|
261
288
|
}
|
262
|
-
const editorClass = this.
|
289
|
+
const editorClass = this.hot.getCellEditor(this.cellProperties);
|
263
290
|
const {
|
264
291
|
row,
|
265
292
|
col
|
@@ -267,8 +294,8 @@ class EditorManager {
|
|
267
294
|
const {
|
268
295
|
rowIndexMapper,
|
269
296
|
columnIndexMapper
|
270
|
-
} = this.
|
271
|
-
const isCellHidden = rowIndexMapper.isHidden(this.
|
297
|
+
} = this.hot;
|
298
|
+
const isCellHidden = rowIndexMapper.isHidden(this.hot.toPhysicalRow(row)) || columnIndexMapper.isHidden(this.hot.toPhysicalColumn(col));
|
272
299
|
if (this.cellProperties.readOnly || !editorClass || isCellHidden) {
|
273
300
|
return false;
|
274
301
|
}
|
@@ -291,73 +318,6 @@ class EditorManager {
|
|
291
318
|
this.selection.transformStart(enterMoves.row, enterMoves.col, true);
|
292
319
|
}
|
293
320
|
}
|
294
|
-
|
295
|
-
/**
|
296
|
-
* OnAfterDocumentKeyDown callback.
|
297
|
-
*
|
298
|
-
* @private
|
299
|
-
* @param {KeyboardEvent} event The keyboard event object.
|
300
|
-
*/
|
301
|
-
onAfterDocumentKeyDown(event) {
|
302
|
-
const selection = this.instance.getSelectedRangeLast();
|
303
|
-
if (!this.instance.isListening() || !selection || selection.highlight.isHeader() || isImmediatePropagationStopped(event)) {
|
304
|
-
return;
|
305
|
-
}
|
306
|
-
const {
|
307
|
-
keyCode
|
308
|
-
} = event;
|
309
|
-
|
310
|
-
// catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
|
311
|
-
const isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
|
312
|
-
if (!this.activeEditor || this.activeEditor && !this.activeEditor.isWaiting()) {
|
313
|
-
if (!isFunctionKey(keyCode) && !isCtrlMetaKey(keyCode) && !isCtrlPressed && !this.isEditorOpened()) {
|
314
|
-
const shortcutManager = this.instance.getShortcutManager();
|
315
|
-
const editorContext = shortcutManager.getContext('editor');
|
316
|
-
const runOnlySelectedConfig = {
|
317
|
-
runOnlyIf: () => isDefined(this.instance.getSelected()),
|
318
|
-
group: SHORTCUTS_GROUP_NAVIGATION
|
319
|
-
};
|
320
|
-
editorContext.addShortcuts([{
|
321
|
-
keys: [['ArrowUp']],
|
322
|
-
callback: () => {
|
323
|
-
this.instance.selection.transformStart(-1, 0);
|
324
|
-
}
|
325
|
-
}, {
|
326
|
-
keys: [['ArrowDown']],
|
327
|
-
callback: () => {
|
328
|
-
this.instance.selection.transformStart(1, 0);
|
329
|
-
}
|
330
|
-
}, {
|
331
|
-
keys: [['ArrowLeft']],
|
332
|
-
callback: () => {
|
333
|
-
this.instance.selection.transformStart(0, -1 * this.instance.getDirectionFactor());
|
334
|
-
}
|
335
|
-
}, {
|
336
|
-
keys: [['ArrowRight']],
|
337
|
-
callback: () => {
|
338
|
-
this.instance.selection.transformStart(0, this.instance.getDirectionFactor());
|
339
|
-
}
|
340
|
-
}], runOnlySelectedConfig);
|
341
|
-
this.openEditor('', event);
|
342
|
-
}
|
343
|
-
}
|
344
|
-
}
|
345
|
-
|
346
|
-
/**
|
347
|
-
* OnCellDblClick callback.
|
348
|
-
*
|
349
|
-
* @private
|
350
|
-
* @param {MouseEvent} event The mouse event object.
|
351
|
-
* @param {object} coords The cell coordinates.
|
352
|
-
* @param {HTMLTableCellElement|HTMLTableHeaderCellElement} elem The element which triggers the action.
|
353
|
-
*/
|
354
|
-
onCellDblClick(event, coords, elem) {
|
355
|
-
// may be TD or TH
|
356
|
-
if (elem.nodeName === 'TD') {
|
357
|
-
this.openEditor(null, event, true);
|
358
|
-
}
|
359
|
-
}
|
360
|
-
|
361
321
|
/**
|
362
322
|
* Destroy the instance.
|
363
323
|
*/
|
@@ -366,6 +326,56 @@ class EditorManager {
|
|
366
326
|
this.eventManager.destroy();
|
367
327
|
}
|
368
328
|
}
|
329
|
+
function _onAfterDocumentKeyDown2(event) {
|
330
|
+
const selection = this.hot.getSelectedRangeLast();
|
331
|
+
if (!this.hot.isListening() || !selection || selection.highlight.isHeader() || isImmediatePropagationStopped(event)) {
|
332
|
+
return;
|
333
|
+
}
|
334
|
+
const {
|
335
|
+
keyCode
|
336
|
+
} = event;
|
337
|
+
|
338
|
+
// catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
|
339
|
+
const isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
|
340
|
+
if (!this.activeEditor || this.activeEditor && !this.activeEditor.isWaiting()) {
|
341
|
+
if (!isFunctionKey(keyCode) && !isCtrlMetaKey(keyCode) && !isCtrlPressed && !this.isEditorOpened()) {
|
342
|
+
const shortcutManager = this.hot.getShortcutManager();
|
343
|
+
const editorContext = shortcutManager.getContext('editor');
|
344
|
+
const runOnlySelectedConfig = {
|
345
|
+
runOnlyIf: () => isDefined(this.hot.getSelected()),
|
346
|
+
group: SHORTCUTS_GROUP_NAVIGATION
|
347
|
+
};
|
348
|
+
editorContext.addShortcuts([{
|
349
|
+
keys: [['ArrowUp']],
|
350
|
+
callback: () => {
|
351
|
+
this.hot.selection.transformStart(-1, 0);
|
352
|
+
}
|
353
|
+
}, {
|
354
|
+
keys: [['ArrowDown']],
|
355
|
+
callback: () => {
|
356
|
+
this.hot.selection.transformStart(1, 0);
|
357
|
+
}
|
358
|
+
}, {
|
359
|
+
keys: [['ArrowLeft']],
|
360
|
+
callback: () => {
|
361
|
+
this.hot.selection.transformStart(0, -1 * this.hot.getDirectionFactor());
|
362
|
+
}
|
363
|
+
}, {
|
364
|
+
keys: [['ArrowRight']],
|
365
|
+
callback: () => {
|
366
|
+
this.hot.selection.transformStart(0, this.hot.getDirectionFactor());
|
367
|
+
}
|
368
|
+
}], runOnlySelectedConfig);
|
369
|
+
this.openEditor('', event);
|
370
|
+
}
|
371
|
+
}
|
372
|
+
}
|
373
|
+
function _onCellDblClick2(event, coords, elem) {
|
374
|
+
// may be TD or TH
|
375
|
+
if (elem.nodeName === 'TD') {
|
376
|
+
this.openEditor(null, event, true);
|
377
|
+
}
|
378
|
+
}
|
369
379
|
const instances = new WeakMap();
|
370
380
|
|
371
381
|
/**
|