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
@@ -1,18 +1,24 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
4
5
|
var _base = require("../base");
|
5
6
|
var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
|
6
7
|
var _array = require("../../helpers/array");
|
7
8
|
var _object = require("../../helpers/object");
|
8
9
|
var _commandExecutor = require("./commandExecutor");
|
9
|
-
var _eventManager = _interopRequireDefault(require("../../eventManager"));
|
10
10
|
var _itemsFactory = require("./itemsFactory");
|
11
11
|
var _menu = require("./menu");
|
12
12
|
var _utils = require("./utils");
|
13
13
|
var _element = require("../../helpers/dom/element");
|
14
14
|
var _predefinedItems = require("./predefinedItems");
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
|
+
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
17
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
18
|
+
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; }
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
20
|
+
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); }
|
21
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
16
22
|
const PLUGIN_KEY = 'contextMenu';
|
17
23
|
exports.PLUGIN_KEY = PLUGIN_KEY;
|
18
24
|
const PLUGIN_PRIORITY = 70;
|
@@ -48,61 +54,71 @@ _pluginHooks.default.getSingleton().register('afterContextMenuExecute');
|
|
48
54
|
*
|
49
55
|
* @plugin ContextMenu
|
50
56
|
*/
|
57
|
+
var _onAfterOnCellContextMenu = /*#__PURE__*/new WeakSet();
|
58
|
+
var _onMenuBeforeOpen = /*#__PURE__*/new WeakSet();
|
59
|
+
var _onMenuAfterOpen = /*#__PURE__*/new WeakSet();
|
60
|
+
var _onMenuAfterClose = /*#__PURE__*/new WeakSet();
|
51
61
|
class ContextMenu extends _base.BasePlugin {
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
static get PLUGIN_DEPS() {
|
59
|
-
return ['plugin:AutoColumnSize'];
|
60
|
-
}
|
61
|
-
|
62
|
-
/**
|
63
|
-
* Context menu default items order when `contextMenu` options is set as `true`.
|
64
|
-
*
|
65
|
-
* @returns {string[]}
|
66
|
-
*/
|
67
|
-
static get DEFAULT_ITEMS() {
|
68
|
-
return [_predefinedItems.ROW_ABOVE, _predefinedItems.ROW_BELOW, _predefinedItems.SEPARATOR, _predefinedItems.COLUMN_LEFT, _predefinedItems.COLUMN_RIGHT, _predefinedItems.SEPARATOR, _predefinedItems.REMOVE_ROW, _predefinedItems.REMOVE_COLUMN, _predefinedItems.SEPARATOR, _predefinedItems.UNDO, _predefinedItems.REDO, _predefinedItems.SEPARATOR, _predefinedItems.READ_ONLY, _predefinedItems.SEPARATOR, _predefinedItems.ALIGNMENT];
|
69
|
-
}
|
70
|
-
|
71
|
-
/**
|
72
|
-
* @param {Core} hotInstance Handsontable instance.
|
73
|
-
*/
|
74
|
-
constructor(hotInstance) {
|
75
|
-
super(hotInstance);
|
62
|
+
constructor() {
|
63
|
+
super(...arguments);
|
64
|
+
/**
|
65
|
+
* On menu after close listener.
|
66
|
+
*/
|
67
|
+
_classPrivateMethodInitSpec(this, _onMenuAfterClose);
|
76
68
|
/**
|
77
|
-
*
|
69
|
+
* On menu after open listener.
|
70
|
+
*/
|
71
|
+
_classPrivateMethodInitSpec(this, _onMenuAfterOpen);
|
72
|
+
/**
|
73
|
+
* On menu before open listener.
|
74
|
+
*/
|
75
|
+
_classPrivateMethodInitSpec(this, _onMenuBeforeOpen);
|
76
|
+
/**
|
77
|
+
* On contextmenu listener.
|
78
78
|
*
|
79
|
-
* @
|
80
|
-
* @type {EventManager}
|
79
|
+
* @param {Event} event The mouse event object.
|
81
80
|
*/
|
82
|
-
this
|
81
|
+
_classPrivateMethodInitSpec(this, _onAfterOnCellContextMenu);
|
83
82
|
/**
|
84
83
|
* Instance of {@link CommandExecutor}.
|
85
84
|
*
|
86
85
|
* @private
|
87
86
|
* @type {CommandExecutor}
|
88
87
|
*/
|
89
|
-
this
|
88
|
+
_defineProperty(this, "commandExecutor", new _commandExecutor.CommandExecutor(this.hot));
|
90
89
|
/**
|
91
90
|
* Instance of {@link ItemsFactory}.
|
92
91
|
*
|
93
92
|
* @private
|
94
93
|
* @type {ItemsFactory}
|
95
94
|
*/
|
96
|
-
this
|
95
|
+
_defineProperty(this, "itemsFactory", null);
|
97
96
|
/**
|
98
97
|
* Instance of {@link Menu}.
|
99
98
|
*
|
100
99
|
* @private
|
101
100
|
* @type {Menu}
|
102
101
|
*/
|
103
|
-
this
|
102
|
+
_defineProperty(this, "menu", null);
|
103
|
+
}
|
104
|
+
static get PLUGIN_KEY() {
|
105
|
+
return PLUGIN_KEY;
|
106
|
+
}
|
107
|
+
static get PLUGIN_PRIORITY() {
|
108
|
+
return PLUGIN_PRIORITY;
|
109
|
+
}
|
110
|
+
static get PLUGIN_DEPS() {
|
111
|
+
return ['plugin:AutoColumnSize'];
|
104
112
|
}
|
105
113
|
|
114
|
+
/**
|
115
|
+
* Context menu default items order when `contextMenu` options is set as `true`.
|
116
|
+
*
|
117
|
+
* @returns {string[]}
|
118
|
+
*/
|
119
|
+
static get DEFAULT_ITEMS() {
|
120
|
+
return [_predefinedItems.ROW_ABOVE, _predefinedItems.ROW_BELOW, _predefinedItems.SEPARATOR, _predefinedItems.COLUMN_LEFT, _predefinedItems.COLUMN_RIGHT, _predefinedItems.SEPARATOR, _predefinedItems.REMOVE_ROW, _predefinedItems.REMOVE_COLUMN, _predefinedItems.SEPARATOR, _predefinedItems.UNDO, _predefinedItems.REDO, _predefinedItems.SEPARATOR, _predefinedItems.READ_ONLY, _predefinedItems.SEPARATOR, _predefinedItems.ALIGNMENT];
|
121
|
+
}
|
106
122
|
/**
|
107
123
|
* Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
|
108
124
|
* hook and if it returns `true` then the {@link ContextMenu#enablePlugin} method is called.
|
@@ -130,16 +146,16 @@ class ContextMenu extends _base.BasePlugin {
|
|
130
146
|
keepInViewport: true,
|
131
147
|
container: settings.uiContainer || this.hot.rootDocument.body
|
132
148
|
});
|
133
|
-
this.menu.addLocalHook('beforeOpen', () => this.
|
134
|
-
this.menu.addLocalHook('afterOpen', () => this.
|
135
|
-
this.menu.addLocalHook('afterClose', () => this.
|
149
|
+
this.menu.addLocalHook('beforeOpen', () => _classPrivateMethodGet(this, _onMenuBeforeOpen, _onMenuBeforeOpen2).call(this));
|
150
|
+
this.menu.addLocalHook('afterOpen', () => _classPrivateMethodGet(this, _onMenuAfterOpen, _onMenuAfterOpen2).call(this));
|
151
|
+
this.menu.addLocalHook('afterClose', () => _classPrivateMethodGet(this, _onMenuAfterClose, _onMenuAfterClose2).call(this));
|
136
152
|
this.menu.addLocalHook('executeCommand', function () {
|
137
153
|
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
138
154
|
params[_key] = arguments[_key];
|
139
155
|
}
|
140
156
|
return _this.executeCommand.call(_this, ...params);
|
141
157
|
});
|
142
|
-
this.addHook('afterOnCellContextMenu', event => this.
|
158
|
+
this.addHook('afterOnCellContextMenu', event => _classPrivateMethodGet(this, _onAfterOnCellContextMenu, _onAfterOnCellContextMenu2).call(this, event));
|
143
159
|
this.registerShortcuts();
|
144
160
|
super.enablePlugin();
|
145
161
|
}
|
@@ -308,85 +324,59 @@ class ContextMenu extends _base.BasePlugin {
|
|
308
324
|
// Register all commands. Predefined and added by user or by plugins
|
309
325
|
(0, _array.arrayEach)(menuItems, command => this.commandExecutor.registerCommand(command.key, command));
|
310
326
|
}
|
311
|
-
|
312
327
|
/**
|
313
|
-
*
|
314
|
-
*
|
315
|
-
* @private
|
316
|
-
* @param {Event} event The mouse event object.
|
328
|
+
* Destroys the plugin instance.
|
317
329
|
*/
|
318
|
-
|
319
|
-
const settings = this.hot.getSettings();
|
320
|
-
const showRowHeaders = settings.rowHeaders;
|
321
|
-
const showColHeaders = settings.colHeaders;
|
322
|
-
|
323
|
-
/**
|
324
|
-
* @private
|
325
|
-
* @param {HTMLElement} element The element to validate.
|
326
|
-
* @returns {boolean}
|
327
|
-
*/
|
328
|
-
function isValidElement(element) {
|
329
|
-
return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD';
|
330
|
-
}
|
331
|
-
const element = event.target;
|
330
|
+
destroy() {
|
332
331
|
this.close();
|
333
|
-
if (
|
334
|
-
|
335
|
-
}
|
336
|
-
event.preventDefault();
|
337
|
-
event.stopPropagation();
|
338
|
-
if (!(showRowHeaders || showColHeaders)) {
|
339
|
-
if (!isValidElement(element) && !((0, _element.hasClass)(element, 'current') && (0, _element.hasClass)(element, 'wtBorder'))) {
|
340
|
-
return;
|
341
|
-
}
|
332
|
+
if (this.menu) {
|
333
|
+
this.menu.destroy();
|
342
334
|
}
|
343
|
-
|
344
|
-
this.open({
|
345
|
-
top: event.clientY + offset.top,
|
346
|
-
left: event.clientX + offset.left
|
347
|
-
});
|
348
|
-
}
|
349
|
-
|
350
|
-
/**
|
351
|
-
* On menu before open listener.
|
352
|
-
*
|
353
|
-
* @private
|
354
|
-
*/
|
355
|
-
onMenuBeforeOpen() {
|
356
|
-
this.hot.runHooks('beforeContextMenuShow', this);
|
335
|
+
super.destroy();
|
357
336
|
}
|
337
|
+
}
|
338
|
+
exports.ContextMenu = ContextMenu;
|
339
|
+
function _onAfterOnCellContextMenu2(event) {
|
340
|
+
const settings = this.hot.getSettings();
|
341
|
+
const showRowHeaders = settings.rowHeaders;
|
342
|
+
const showColHeaders = settings.colHeaders;
|
358
343
|
|
359
344
|
/**
|
360
|
-
* On menu after open listener.
|
361
|
-
*
|
362
345
|
* @private
|
346
|
+
* @param {HTMLElement} element The element to validate.
|
347
|
+
* @returns {boolean}
|
363
348
|
*/
|
364
|
-
|
365
|
-
|
349
|
+
function isValidElement(element) {
|
350
|
+
return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD';
|
366
351
|
}
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
* @private
|
372
|
-
*/
|
373
|
-
onMenuAfterClose() {
|
374
|
-
this.hot.listen();
|
375
|
-
this.hot.runHooks('afterContextMenuHide', this);
|
352
|
+
const element = event.target;
|
353
|
+
this.close();
|
354
|
+
if ((0, _element.hasClass)(element, 'handsontableInput')) {
|
355
|
+
return;
|
376
356
|
}
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
this.close();
|
383
|
-
if (this.menu) {
|
384
|
-
this.menu.destroy();
|
357
|
+
event.preventDefault();
|
358
|
+
event.stopPropagation();
|
359
|
+
if (!(showRowHeaders || showColHeaders)) {
|
360
|
+
if (!isValidElement(element) && !((0, _element.hasClass)(element, 'current') && (0, _element.hasClass)(element, 'wtBorder'))) {
|
361
|
+
return;
|
385
362
|
}
|
386
|
-
super.destroy();
|
387
363
|
}
|
364
|
+
const offset = (0, _utils.getDocumentOffsetByElement)(this.menu.container, this.hot.rootDocument);
|
365
|
+
this.open({
|
366
|
+
top: event.clientY + offset.top,
|
367
|
+
left: event.clientX + offset.left
|
368
|
+
});
|
369
|
+
}
|
370
|
+
function _onMenuBeforeOpen2() {
|
371
|
+
this.hot.runHooks('beforeContextMenuShow', this);
|
372
|
+
}
|
373
|
+
function _onMenuAfterOpen2() {
|
374
|
+
this.hot.runHooks('afterContextMenuShow', this);
|
375
|
+
}
|
376
|
+
function _onMenuAfterClose2() {
|
377
|
+
this.hot.listen();
|
378
|
+
this.hot.runHooks('afterContextMenuHide', this);
|
388
379
|
}
|
389
|
-
exports.ContextMenu = ContextMenu;
|
390
380
|
ContextMenu.SEPARATOR = {
|
391
381
|
name: _predefinedItems.SEPARATOR
|
392
382
|
};
|
@@ -1,9 +1,15 @@
|
|
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 { BasePlugin } from "../base/index.mjs";
|
2
9
|
import Hooks from "../../pluginHooks.mjs";
|
3
10
|
import { arrayEach } from "../../helpers/array.mjs";
|
4
11
|
import { objectEach } from "../../helpers/object.mjs";
|
5
12
|
import { CommandExecutor } from "./commandExecutor.mjs";
|
6
|
-
import EventManager from "../../eventManager.mjs";
|
7
13
|
import { ItemsFactory } from "./itemsFactory.mjs";
|
8
14
|
import { Menu } from "./menu/index.mjs";
|
9
15
|
import { getDocumentOffsetByElement } from "./utils.mjs";
|
@@ -42,61 +48,71 @@ Hooks.getSingleton().register('afterContextMenuExecute');
|
|
42
48
|
*
|
43
49
|
* @plugin ContextMenu
|
44
50
|
*/
|
51
|
+
var _onAfterOnCellContextMenu = /*#__PURE__*/new WeakSet();
|
52
|
+
var _onMenuBeforeOpen = /*#__PURE__*/new WeakSet();
|
53
|
+
var _onMenuAfterOpen = /*#__PURE__*/new WeakSet();
|
54
|
+
var _onMenuAfterClose = /*#__PURE__*/new WeakSet();
|
45
55
|
export class ContextMenu extends BasePlugin {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
static get PLUGIN_DEPS() {
|
53
|
-
return ['plugin:AutoColumnSize'];
|
54
|
-
}
|
55
|
-
|
56
|
-
/**
|
57
|
-
* Context menu default items order when `contextMenu` options is set as `true`.
|
58
|
-
*
|
59
|
-
* @returns {string[]}
|
60
|
-
*/
|
61
|
-
static get DEFAULT_ITEMS() {
|
62
|
-
return [ROW_ABOVE, ROW_BELOW, SEPARATOR, COLUMN_LEFT, COLUMN_RIGHT, SEPARATOR, REMOVE_ROW, REMOVE_COLUMN, SEPARATOR, UNDO, REDO, SEPARATOR, READ_ONLY, SEPARATOR, ALIGNMENT];
|
63
|
-
}
|
64
|
-
|
65
|
-
/**
|
66
|
-
* @param {Core} hotInstance Handsontable instance.
|
67
|
-
*/
|
68
|
-
constructor(hotInstance) {
|
69
|
-
super(hotInstance);
|
56
|
+
constructor() {
|
57
|
+
super(...arguments);
|
58
|
+
/**
|
59
|
+
* On menu after close listener.
|
60
|
+
*/
|
61
|
+
_classPrivateMethodInitSpec(this, _onMenuAfterClose);
|
70
62
|
/**
|
71
|
-
*
|
63
|
+
* On menu after open listener.
|
64
|
+
*/
|
65
|
+
_classPrivateMethodInitSpec(this, _onMenuAfterOpen);
|
66
|
+
/**
|
67
|
+
* On menu before open listener.
|
68
|
+
*/
|
69
|
+
_classPrivateMethodInitSpec(this, _onMenuBeforeOpen);
|
70
|
+
/**
|
71
|
+
* On contextmenu listener.
|
72
72
|
*
|
73
|
-
* @
|
74
|
-
* @type {EventManager}
|
73
|
+
* @param {Event} event The mouse event object.
|
75
74
|
*/
|
76
|
-
this
|
75
|
+
_classPrivateMethodInitSpec(this, _onAfterOnCellContextMenu);
|
77
76
|
/**
|
78
77
|
* Instance of {@link CommandExecutor}.
|
79
78
|
*
|
80
79
|
* @private
|
81
80
|
* @type {CommandExecutor}
|
82
81
|
*/
|
83
|
-
this
|
82
|
+
_defineProperty(this, "commandExecutor", new CommandExecutor(this.hot));
|
84
83
|
/**
|
85
84
|
* Instance of {@link ItemsFactory}.
|
86
85
|
*
|
87
86
|
* @private
|
88
87
|
* @type {ItemsFactory}
|
89
88
|
*/
|
90
|
-
this
|
89
|
+
_defineProperty(this, "itemsFactory", null);
|
91
90
|
/**
|
92
91
|
* Instance of {@link Menu}.
|
93
92
|
*
|
94
93
|
* @private
|
95
94
|
* @type {Menu}
|
96
95
|
*/
|
97
|
-
this
|
96
|
+
_defineProperty(this, "menu", null);
|
97
|
+
}
|
98
|
+
static get PLUGIN_KEY() {
|
99
|
+
return PLUGIN_KEY;
|
100
|
+
}
|
101
|
+
static get PLUGIN_PRIORITY() {
|
102
|
+
return PLUGIN_PRIORITY;
|
103
|
+
}
|
104
|
+
static get PLUGIN_DEPS() {
|
105
|
+
return ['plugin:AutoColumnSize'];
|
98
106
|
}
|
99
107
|
|
108
|
+
/**
|
109
|
+
* Context menu default items order when `contextMenu` options is set as `true`.
|
110
|
+
*
|
111
|
+
* @returns {string[]}
|
112
|
+
*/
|
113
|
+
static get DEFAULT_ITEMS() {
|
114
|
+
return [ROW_ABOVE, ROW_BELOW, SEPARATOR, COLUMN_LEFT, COLUMN_RIGHT, SEPARATOR, REMOVE_ROW, REMOVE_COLUMN, SEPARATOR, UNDO, REDO, SEPARATOR, READ_ONLY, SEPARATOR, ALIGNMENT];
|
115
|
+
}
|
100
116
|
/**
|
101
117
|
* Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
|
102
118
|
* hook and if it returns `true` then the {@link ContextMenu#enablePlugin} method is called.
|
@@ -124,16 +140,16 @@ export class ContextMenu extends BasePlugin {
|
|
124
140
|
keepInViewport: true,
|
125
141
|
container: settings.uiContainer || this.hot.rootDocument.body
|
126
142
|
});
|
127
|
-
this.menu.addLocalHook('beforeOpen', () => this.
|
128
|
-
this.menu.addLocalHook('afterOpen', () => this.
|
129
|
-
this.menu.addLocalHook('afterClose', () => this.
|
143
|
+
this.menu.addLocalHook('beforeOpen', () => _classPrivateMethodGet(this, _onMenuBeforeOpen, _onMenuBeforeOpen2).call(this));
|
144
|
+
this.menu.addLocalHook('afterOpen', () => _classPrivateMethodGet(this, _onMenuAfterOpen, _onMenuAfterOpen2).call(this));
|
145
|
+
this.menu.addLocalHook('afterClose', () => _classPrivateMethodGet(this, _onMenuAfterClose, _onMenuAfterClose2).call(this));
|
130
146
|
this.menu.addLocalHook('executeCommand', function () {
|
131
147
|
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
132
148
|
params[_key] = arguments[_key];
|
133
149
|
}
|
134
150
|
return _this.executeCommand.call(_this, ...params);
|
135
151
|
});
|
136
|
-
this.addHook('afterOnCellContextMenu', event => this.
|
152
|
+
this.addHook('afterOnCellContextMenu', event => _classPrivateMethodGet(this, _onAfterOnCellContextMenu, _onAfterOnCellContextMenu2).call(this, event));
|
137
153
|
this.registerShortcuts();
|
138
154
|
super.enablePlugin();
|
139
155
|
}
|
@@ -302,83 +318,57 @@ export class ContextMenu extends BasePlugin {
|
|
302
318
|
// Register all commands. Predefined and added by user or by plugins
|
303
319
|
arrayEach(menuItems, command => this.commandExecutor.registerCommand(command.key, command));
|
304
320
|
}
|
305
|
-
|
306
321
|
/**
|
307
|
-
*
|
308
|
-
*
|
309
|
-
* @private
|
310
|
-
* @param {Event} event The mouse event object.
|
322
|
+
* Destroys the plugin instance.
|
311
323
|
*/
|
312
|
-
|
313
|
-
const settings = this.hot.getSettings();
|
314
|
-
const showRowHeaders = settings.rowHeaders;
|
315
|
-
const showColHeaders = settings.colHeaders;
|
316
|
-
|
317
|
-
/**
|
318
|
-
* @private
|
319
|
-
* @param {HTMLElement} element The element to validate.
|
320
|
-
* @returns {boolean}
|
321
|
-
*/
|
322
|
-
function isValidElement(element) {
|
323
|
-
return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD';
|
324
|
-
}
|
325
|
-
const element = event.target;
|
324
|
+
destroy() {
|
326
325
|
this.close();
|
327
|
-
if (
|
328
|
-
|
329
|
-
}
|
330
|
-
event.preventDefault();
|
331
|
-
event.stopPropagation();
|
332
|
-
if (!(showRowHeaders || showColHeaders)) {
|
333
|
-
if (!isValidElement(element) && !(hasClass(element, 'current') && hasClass(element, 'wtBorder'))) {
|
334
|
-
return;
|
335
|
-
}
|
326
|
+
if (this.menu) {
|
327
|
+
this.menu.destroy();
|
336
328
|
}
|
337
|
-
|
338
|
-
this.open({
|
339
|
-
top: event.clientY + offset.top,
|
340
|
-
left: event.clientX + offset.left
|
341
|
-
});
|
342
|
-
}
|
343
|
-
|
344
|
-
/**
|
345
|
-
* On menu before open listener.
|
346
|
-
*
|
347
|
-
* @private
|
348
|
-
*/
|
349
|
-
onMenuBeforeOpen() {
|
350
|
-
this.hot.runHooks('beforeContextMenuShow', this);
|
329
|
+
super.destroy();
|
351
330
|
}
|
331
|
+
}
|
332
|
+
function _onAfterOnCellContextMenu2(event) {
|
333
|
+
const settings = this.hot.getSettings();
|
334
|
+
const showRowHeaders = settings.rowHeaders;
|
335
|
+
const showColHeaders = settings.colHeaders;
|
352
336
|
|
353
337
|
/**
|
354
|
-
* On menu after open listener.
|
355
|
-
*
|
356
338
|
* @private
|
339
|
+
* @param {HTMLElement} element The element to validate.
|
340
|
+
* @returns {boolean}
|
357
341
|
*/
|
358
|
-
|
359
|
-
|
342
|
+
function isValidElement(element) {
|
343
|
+
return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD';
|
360
344
|
}
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
* @private
|
366
|
-
*/
|
367
|
-
onMenuAfterClose() {
|
368
|
-
this.hot.listen();
|
369
|
-
this.hot.runHooks('afterContextMenuHide', this);
|
345
|
+
const element = event.target;
|
346
|
+
this.close();
|
347
|
+
if (hasClass(element, 'handsontableInput')) {
|
348
|
+
return;
|
370
349
|
}
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
this.close();
|
377
|
-
if (this.menu) {
|
378
|
-
this.menu.destroy();
|
350
|
+
event.preventDefault();
|
351
|
+
event.stopPropagation();
|
352
|
+
if (!(showRowHeaders || showColHeaders)) {
|
353
|
+
if (!isValidElement(element) && !(hasClass(element, 'current') && hasClass(element, 'wtBorder'))) {
|
354
|
+
return;
|
379
355
|
}
|
380
|
-
super.destroy();
|
381
356
|
}
|
357
|
+
const offset = getDocumentOffsetByElement(this.menu.container, this.hot.rootDocument);
|
358
|
+
this.open({
|
359
|
+
top: event.clientY + offset.top,
|
360
|
+
left: event.clientX + offset.left
|
361
|
+
});
|
362
|
+
}
|
363
|
+
function _onMenuBeforeOpen2() {
|
364
|
+
this.hot.runHooks('beforeContextMenuShow', this);
|
365
|
+
}
|
366
|
+
function _onMenuAfterOpen2() {
|
367
|
+
this.hot.runHooks('afterContextMenuShow', this);
|
368
|
+
}
|
369
|
+
function _onMenuAfterClose2() {
|
370
|
+
this.hot.listen();
|
371
|
+
this.hot.runHooks('afterContextMenuHide', this);
|
382
372
|
}
|
383
373
|
ContextMenu.SEPARATOR = {
|
384
374
|
name: SEPARATOR
|
@@ -2,9 +2,13 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
require("core-js/modules/es.array.push.js");
|
5
|
+
require("core-js/modules/es.error.cause.js");
|
5
6
|
var _object = require("../../helpers/object");
|
6
7
|
var _array = require("../../helpers/array");
|
7
8
|
var _predefinedItems = require("./predefinedItems");
|
9
|
+
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; }
|
10
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
11
|
+
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); }
|
8
12
|
/**
|
9
13
|
* Predefined items class factory for menu items.
|
10
14
|
*
|
@@ -14,8 +18,19 @@ var _predefinedItems = require("./predefinedItems");
|
|
14
18
|
class ItemsFactory {
|
15
19
|
constructor(hotInstance) {
|
16
20
|
let orderPattern = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
21
|
+
/**
|
22
|
+
* @type {Core}
|
23
|
+
*/
|
24
|
+
_defineProperty(this, "hot", void 0);
|
25
|
+
/**
|
26
|
+
* @type {object}
|
27
|
+
*/
|
28
|
+
_defineProperty(this, "predefinedItems", (0, _predefinedItems.predefinedItems)());
|
29
|
+
/**
|
30
|
+
* @type {Array}
|
31
|
+
*/
|
32
|
+
_defineProperty(this, "defaultOrderPattern", void 0);
|
17
33
|
this.hot = hotInstance;
|
18
|
-
this.predefinedItems = (0, _predefinedItems.predefinedItems)();
|
19
34
|
this.defaultOrderPattern = orderPattern;
|
20
35
|
}
|
21
36
|
|
@@ -35,7 +50,7 @@ class ItemsFactory {
|
|
35
50
|
|
36
51
|
// Menu item added as a property to array
|
37
52
|
} else if (isNaN(parseInt(key, 10))) {
|
38
|
-
value.key = value.key ===
|
53
|
+
value.key = value.key === undefined ? key : value.key;
|
39
54
|
items[key] = value;
|
40
55
|
menuItemKey = value.key;
|
41
56
|
} else {
|
@@ -91,7 +106,7 @@ function getItems() {
|
|
91
106
|
name: item
|
92
107
|
};
|
93
108
|
}
|
94
|
-
if (item.key ===
|
109
|
+
if (item.key === undefined) {
|
95
110
|
item.key = key;
|
96
111
|
}
|
97
112
|
result.push(item);
|
@@ -113,7 +128,7 @@ function getItems() {
|
|
113
128
|
if ((0, _object.isObject)(name)) {
|
114
129
|
(0, _object.extend)(item, name);
|
115
130
|
}
|
116
|
-
if (item.key ===
|
131
|
+
if (item.key === undefined) {
|
117
132
|
item.key = key;
|
118
133
|
}
|
119
134
|
result.push(item);
|
@@ -1,4 +1,8 @@
|
|
1
1
|
import "core-js/modules/es.array.push.js";
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
5
|
+
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); }
|
2
6
|
import { objectEach, isObject, extend } from "../../helpers/object.mjs";
|
3
7
|
import { arrayEach } from "../../helpers/array.mjs";
|
4
8
|
import { SEPARATOR, ITEMS, predefinedItems } from "./predefinedItems/index.mjs";
|
@@ -11,8 +15,19 @@ import { SEPARATOR, ITEMS, predefinedItems } from "./predefinedItems/index.mjs";
|
|
11
15
|
export class ItemsFactory {
|
12
16
|
constructor(hotInstance) {
|
13
17
|
let orderPattern = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
18
|
+
/**
|
19
|
+
* @type {Core}
|
20
|
+
*/
|
21
|
+
_defineProperty(this, "hot", void 0);
|
22
|
+
/**
|
23
|
+
* @type {object}
|
24
|
+
*/
|
25
|
+
_defineProperty(this, "predefinedItems", predefinedItems());
|
26
|
+
/**
|
27
|
+
* @type {Array}
|
28
|
+
*/
|
29
|
+
_defineProperty(this, "defaultOrderPattern", void 0);
|
14
30
|
this.hot = hotInstance;
|
15
|
-
this.predefinedItems = predefinedItems();
|
16
31
|
this.defaultOrderPattern = orderPattern;
|
17
32
|
}
|
18
33
|
|
@@ -32,7 +47,7 @@ export class ItemsFactory {
|
|
32
47
|
|
33
48
|
// Menu item added as a property to array
|
34
49
|
} else if (isNaN(parseInt(key, 10))) {
|
35
|
-
value.key = value.key ===
|
50
|
+
value.key = value.key === undefined ? key : value.key;
|
36
51
|
items[key] = value;
|
37
52
|
menuItemKey = value.key;
|
38
53
|
} else {
|
@@ -87,7 +102,7 @@ function getItems() {
|
|
87
102
|
name: item
|
88
103
|
};
|
89
104
|
}
|
90
|
-
if (item.key ===
|
105
|
+
if (item.key === undefined) {
|
91
106
|
item.key = key;
|
92
107
|
}
|
93
108
|
result.push(item);
|
@@ -109,7 +124,7 @@ function getItems() {
|
|
109
124
|
if (isObject(name)) {
|
110
125
|
extend(item, name);
|
111
126
|
}
|
112
|
-
if (item.key ===
|
127
|
+
if (item.key === undefined) {
|
113
128
|
item.key = key;
|
114
129
|
}
|
115
130
|
result.push(item);
|