handsontable 0.0.0-next-6d7bdba-20230620 → 0.0.0-next-06a64be-20230621
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/walkontable/src/{selection/border/border.js → border.js} +12 -7
- package/3rdparty/walkontable/src/{selection/border/border.mjs → border.mjs} +12 -7
- package/3rdparty/walkontable/src/cell/coords.d.ts +1 -6
- package/3rdparty/walkontable/src/cell/coords.js +12 -61
- package/3rdparty/walkontable/src/cell/coords.mjs +12 -61
- package/3rdparty/walkontable/src/cell/range.d.ts +2 -9
- package/3rdparty/walkontable/src/cell/range.js +7 -44
- package/3rdparty/walkontable/src/cell/range.mjs +7 -44
- package/3rdparty/walkontable/src/core/_base.js +3 -9
- package/3rdparty/walkontable/src/core/_base.mjs +3 -9
- package/3rdparty/walkontable/src/core/clone.js +2 -2
- package/3rdparty/walkontable/src/core/clone.mjs +2 -2
- package/3rdparty/walkontable/src/core/core.js +2 -3
- package/3rdparty/walkontable/src/core/core.mjs +2 -3
- package/3rdparty/walkontable/src/event.js +7 -7
- package/3rdparty/walkontable/src/event.mjs +7 -7
- package/3rdparty/walkontable/src/facade/core.js +2 -2
- package/3rdparty/walkontable/src/facade/core.mjs +2 -2
- package/3rdparty/walkontable/src/index.js +2 -10
- package/3rdparty/walkontable/src/index.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/_base.js +1 -1
- package/3rdparty/walkontable/src/overlay/_base.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/inlineStart.js +4 -2
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +4 -2
- package/3rdparty/walkontable/src/overlay/top.js +4 -2
- package/3rdparty/walkontable/src/overlay/top.mjs +4 -2
- package/3rdparty/walkontable/src/selection.js +355 -0
- package/3rdparty/walkontable/src/selection.mjs +349 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +0 -9
- package/3rdparty/walkontable/src/table.js +79 -7
- package/3rdparty/walkontable/src/table.mjs +80 -8
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +3 -5
- package/core.js +309 -127
- package/core.mjs +309 -127
- package/dataMap/metaManager/metaSchema.js +0 -19
- package/dataMap/metaManager/metaSchema.mjs +0 -19
- package/dist/handsontable.css +3 -8
- package/dist/handsontable.full.css +3 -8
- package/dist/handsontable.full.js +10685 -13607
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +112 -112
- package/dist/handsontable.js +13664 -16586
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +4 -4
- package/editorManager.js +94 -21
- package/editorManager.mjs +98 -26
- package/editors/textEditor/textEditor.js +11 -3
- package/editors/textEditor/textEditor.mjs +12 -4
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/number.d.ts +0 -1
- package/helpers/number.js +0 -18
- package/helpers/number.mjs +0 -17
- package/package.json +1 -1
- package/pluginHooks.d.ts +1 -5
- package/pluginHooks.js +1 -89
- package/pluginHooks.mjs +1 -89
- package/plugins/collapsibleColumns/collapsibleColumns.js +24 -81
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +24 -81
- package/plugins/columnSorting/columnSorting.js +8 -50
- package/plugins/columnSorting/columnSorting.mjs +9 -49
- package/plugins/columnSorting/index.js +2 -4
- package/plugins/columnSorting/index.mjs +1 -1
- package/plugins/comments/comments.js +4 -11
- package/plugins/comments/comments.mjs +4 -11
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/contextMenu/contextMenu.js +29 -80
- package/plugins/contextMenu/contextMenu.mjs +30 -81
- package/plugins/contextMenu/predefinedItems/alignment.js +0 -7
- package/plugins/contextMenu/predefinedItems/alignment.mjs +0 -7
- package/plugins/contextMenu/predefinedItems/clearColumn.js +3 -5
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +3 -5
- package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -5
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -5
- package/plugins/contextMenu/predefinedItems/columnRight.js +3 -5
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -5
- package/plugins/contextMenu/predefinedItems/readOnly.js +0 -7
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +0 -7
- package/plugins/contextMenu/predefinedItems/removeColumn.js +5 -7
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +3 -5
- package/plugins/contextMenu/predefinedItems/removeRow.js +5 -7
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +3 -5
- package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -5
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -5
- package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -5
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -5
- package/plugins/contextMenu/utils.js +16 -25
- package/plugins/contextMenu/utils.mjs +15 -24
- package/plugins/copyPaste/contextMenuItem/copy.js +0 -7
- package/plugins/copyPaste/contextMenuItem/copy.mjs +0 -7
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +1 -9
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +1 -9
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +1 -9
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +1 -9
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +1 -9
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +1 -9
- package/plugins/copyPaste/contextMenuItem/cut.js +0 -7
- package/plugins/copyPaste/contextMenuItem/cut.mjs +0 -7
- package/plugins/copyPaste/copyPaste.js +1 -5
- package/plugins/copyPaste/copyPaste.mjs +1 -5
- package/plugins/customBorders/customBorders.js +53 -25
- package/plugins/customBorders/customBorders.mjs +54 -26
- package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
- package/plugins/dropdownMenu/dropdownMenu.js +30 -94
- package/plugins/dropdownMenu/dropdownMenu.mjs +30 -94
- package/plugins/manualColumnResize/manualColumnResize.js +36 -5
- package/plugins/manualColumnResize/manualColumnResize.mjs +36 -5
- package/plugins/manualRowResize/manualRowResize.js +40 -9
- package/plugins/manualRowResize/manualRowResize.mjs +40 -9
- package/plugins/mergeCells/mergeCells.js +18 -5
- package/plugins/mergeCells/mergeCells.mjs +18 -5
- package/plugins/multiColumnSorting/multiColumnSorting.js +3 -42
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +3 -42
- package/plugins/nestedHeaders/nestedHeaders.js +10 -132
- package/plugins/nestedHeaders/nestedHeaders.mjs +10 -132
- package/plugins/nestedHeaders/stateManager/index.js +0 -37
- package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
- package/plugins/nestedRows/nestedRows.js +7 -52
- package/plugins/nestedRows/nestedRows.mjs +7 -52
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/constants.js +16 -0
- package/selection/highlight/constants.mjs +6 -0
- package/selection/highlight/highlight.js +89 -312
- package/selection/highlight/highlight.mjs +85 -302
- package/selection/highlight/types/activeHeader.js +9 -10
- package/selection/highlight/types/activeHeader.mjs +8 -10
- package/selection/highlight/types/area.js +27 -12
- package/selection/highlight/types/area.mjs +30 -16
- package/selection/highlight/types/{focus.js → cell.js} +8 -5
- package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
- package/selection/highlight/types/customSelection.js +10 -7
- package/selection/highlight/types/customSelection.mjs +9 -7
- package/selection/highlight/types/fill.js +8 -5
- package/selection/highlight/types/fill.mjs +7 -5
- package/selection/highlight/types/header.js +20 -10
- package/selection/highlight/types/header.mjs +19 -10
- package/selection/highlight/types/{row.js → index.js} +31 -27
- package/selection/highlight/types/{row.mjs → index.mjs} +29 -24
- package/selection/highlight/visualSelection.js +27 -31
- package/selection/highlight/visualSelection.mjs +27 -31
- package/selection/index.js +7 -4
- package/selection/index.mjs +3 -2
- package/selection/mouseEventHandler.js +1 -1
- package/selection/mouseEventHandler.mjs +1 -1
- package/selection/range.js +8 -8
- package/selection/range.mjs +8 -8
- package/selection/selection.js +181 -315
- package/selection/selection.mjs +180 -310
- package/selection/transformation.js +96 -233
- package/selection/transformation.mjs +93 -230
- package/selection/utils.js +36 -12
- package/selection/utils.mjs +36 -13
- package/settings.d.ts +0 -1
- package/shortcuts/manager.js +0 -2
- package/shortcuts/manager.mjs +0 -2
- package/shortcuts/recorder.js +2 -2
- package/shortcuts/recorder.mjs +2 -2
- package/shortcuts/utils.js +5 -21
- package/shortcuts/utils.mjs +4 -20
- package/tableView.js +9 -58
- package/tableView.mjs +9 -58
- package/translations/indexMapper.js +9 -8
- package/translations/indexMapper.mjs +9 -8
- package/3rdparty/walkontable/src/selection/border/constants.js +0 -18
- package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -13
- package/3rdparty/walkontable/src/selection/constants.js +0 -63
- package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
- package/3rdparty/walkontable/src/selection/index.js +0 -30
- package/3rdparty/walkontable/src/selection/index.mjs +0 -5
- package/3rdparty/walkontable/src/selection/manager.js +0 -329
- package/3rdparty/walkontable/src/selection/manager.mjs +0 -323
- package/3rdparty/walkontable/src/selection/scanner.js +0 -364
- package/3rdparty/walkontable/src/selection/scanner.mjs +0 -360
- package/3rdparty/walkontable/src/selection/selection.js +0 -133
- package/3rdparty/walkontable/src/selection/selection.mjs +0 -127
- package/selection/highlight/types/areaLayered.js +0 -54
- package/selection/highlight/types/areaLayered.mjs +0 -49
- package/selection/highlight/types/column.js +0 -50
- package/selection/highlight/types/column.mjs +0 -45
- package/shortcutContexts/commands/editor/closeAndSave.js +0 -15
- package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -10
- package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -13
- package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
- package/shortcutContexts/commands/editor/fastOpen.js +0 -16
- package/shortcutContexts/commands/editor/fastOpen.mjs +0 -11
- package/shortcutContexts/commands/editor/index.js +0 -16
- package/shortcutContexts/commands/editor/index.mjs +0 -12
- package/shortcutContexts/commands/editor/open.js +0 -29
- package/shortcutContexts/commands/editor/open.mjs +0 -24
- package/shortcutContexts/commands/emptySelectedCells.js +0 -12
- package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
- package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -10
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -21
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -16
- package/shortcutContexts/commands/extendCellsSelection/index.js +0 -26
- package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -22
- package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -10
- package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -10
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +0 -19
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +0 -14
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -22
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -17
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -17
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -12
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -17
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -12
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -40
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -35
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -40
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -35
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -22
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -17
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +0 -19
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +0 -14
- package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -10
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -21
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -16
- package/shortcutContexts/commands/index.js +0 -52
- package/shortcutContexts/commands/index.mjs +0 -48
- package/shortcutContexts/commands/moveCellSelection/down.js +0 -12
- package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -7
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -29
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -24
- package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
- package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -13
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -13
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
- package/shortcutContexts/commands/moveCellSelection/left.js +0 -11
- package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
- package/shortcutContexts/commands/moveCellSelection/right.js +0 -11
- package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -16
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -11
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -17
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -12
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -13
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -8
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -16
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -11
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -36
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -31
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -36
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -31
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -16
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -11
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -18
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -13
- package/shortcutContexts/commands/moveCellSelection/up.js +0 -12
- package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -7
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -29
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -24
- package/shortcutContexts/commands/populateSelectedCellsData.js +0 -35
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -30
- package/shortcutContexts/commands/selectAll.js +0 -11
- package/shortcutContexts/commands/selectAll.mjs +0 -6
- package/shortcutContexts/constants.js +0 -19
- package/shortcutContexts/constants.mjs +0 -12
- package/shortcutContexts/editor.js +0 -29
- package/shortcutContexts/editor.mjs +0 -25
- package/shortcutContexts/grid.js +0 -244
- package/shortcutContexts/grid.mjs +0 -240
- package/shortcutContexts/index.js +0 -29
- package/shortcutContexts/index.mjs +0 -15
@@ -22,9 +22,7 @@ require("core-js/modules/es.object.set-prototype-of.js");
|
|
22
22
|
require("core-js/modules/es.object.get-prototype-of.js");
|
23
23
|
var _base = require("../base");
|
24
24
|
var _array = require("../../helpers/array");
|
25
|
-
var _object = require("../../helpers/object");
|
26
25
|
var _commandExecutor = _interopRequireDefault(require("../contextMenu/commandExecutor"));
|
27
|
-
var _utils = require("../contextMenu/utils");
|
28
26
|
var _eventManager = _interopRequireDefault(require("../../eventManager"));
|
29
27
|
var _element = require("../../helpers/dom/element");
|
30
28
|
var _itemsFactory = _interopRequireDefault(require("../contextMenu/itemsFactory"));
|
@@ -56,7 +54,6 @@ exports.PLUGIN_KEY = PLUGIN_KEY;
|
|
56
54
|
var PLUGIN_PRIORITY = 230;
|
57
55
|
exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
|
58
56
|
var BUTTON_CLASS_NAME = 'changeType';
|
59
|
-
var SHORTCUTS_GROUP = PLUGIN_KEY;
|
60
57
|
|
61
58
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
62
59
|
/**
|
@@ -185,7 +182,6 @@ var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
|
|
185
182
|
if (typeof settings.callback === 'function') {
|
186
183
|
this.commandExecutor.setCommonCallback(settings.callback);
|
187
184
|
}
|
188
|
-
this.registerShortcuts();
|
189
185
|
_get(_getPrototypeOf(DropdownMenu.prototype), "enablePlugin", this).call(this);
|
190
186
|
this.callOnPluginsReady(function () {
|
191
187
|
_this2.hot.runHooks('afterDropdownMenuDefaultOptions', predefinedItems);
|
@@ -249,71 +245,9 @@ var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
|
|
249
245
|
if (this.menu) {
|
250
246
|
this.menu.destroy();
|
251
247
|
}
|
252
|
-
this.unregisterShortcuts();
|
253
248
|
_get(_getPrototypeOf(DropdownMenu.prototype), "disablePlugin", this).call(this);
|
254
249
|
}
|
255
250
|
|
256
|
-
/**
|
257
|
-
* Register shortcuts responsible for toggling dropdown menu.
|
258
|
-
*
|
259
|
-
* @private
|
260
|
-
*/
|
261
|
-
}, {
|
262
|
-
key: "registerShortcuts",
|
263
|
-
value: function registerShortcuts() {
|
264
|
-
var _this3 = this;
|
265
|
-
var context = this.hot.getShortcutManager().getContext('grid');
|
266
|
-
var callback = function callback() {
|
267
|
-
var _this3$hot$getSelecte = _this3.hot.getSelectedRangeLast(),
|
268
|
-
highlight = _this3$hot$getSelecte.highlight;
|
269
|
-
if ((highlight.isHeader() && highlight.row === -1 || highlight.isCell()) && highlight.col >= 0) {
|
270
|
-
_this3.hot.selectColumns(highlight.col, highlight.col, -1);
|
271
|
-
var _this3$hot$getSelecte2 = _this3.hot.getSelectedRangeLast(),
|
272
|
-
from = _this3$hot$getSelecte2.from;
|
273
|
-
var offset = (0, _utils.getDocumentOffsetByElement)(_this3.menu.container, _this3.hot.rootDocument);
|
274
|
-
var target = _this3.hot.getCell(-1, from.col, true);
|
275
|
-
var rect = target.getBoundingClientRect();
|
276
|
-
_this3.open({
|
277
|
-
left: rect.left + offset.left,
|
278
|
-
top: rect.top + target.offsetHeight + offset.top
|
279
|
-
}, {
|
280
|
-
left: rect.width
|
281
|
-
});
|
282
|
-
_this3.hot._registerTimeout(function () {
|
283
|
-
_this3.menu.selectFirstCell();
|
284
|
-
});
|
285
|
-
}
|
286
|
-
};
|
287
|
-
context.addShortcuts([{
|
288
|
-
keys: [['Shift', 'Alt', 'ArrowDown'], ['Shift', 'Enter']],
|
289
|
-
callback: callback,
|
290
|
-
runOnlyIf: function runOnlyIf() {
|
291
|
-
var _this3$hot$getSelecte3;
|
292
|
-
return ((_this3$hot$getSelecte3 = _this3.hot.getSelectedRangeLast()) === null || _this3$hot$getSelecte3 === void 0 ? void 0 : _this3$hot$getSelecte3.highlight.isHeader()) && !_this3.menu.isOpened();
|
293
|
-
},
|
294
|
-
group: SHORTCUTS_GROUP
|
295
|
-
}, {
|
296
|
-
keys: [['Shift', 'Alt', 'ArrowDown']],
|
297
|
-
callback: callback,
|
298
|
-
runOnlyIf: function runOnlyIf() {
|
299
|
-
var _this3$hot$getSelecte4;
|
300
|
-
return ((_this3$hot$getSelecte4 = _this3.hot.getSelectedRangeLast()) === null || _this3$hot$getSelecte4 === void 0 ? void 0 : _this3$hot$getSelecte4.highlight.isCell()) && !_this3.menu.isOpened();
|
301
|
-
},
|
302
|
-
group: SHORTCUTS_GROUP
|
303
|
-
}]);
|
304
|
-
}
|
305
|
-
|
306
|
-
/**
|
307
|
-
* Unregister shortcuts responsible for toggling dropdown menu.
|
308
|
-
*
|
309
|
-
* @private
|
310
|
-
*/
|
311
|
-
}, {
|
312
|
-
key: "unregisterShortcuts",
|
313
|
-
value: function unregisterShortcuts() {
|
314
|
-
this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
|
315
|
-
}
|
316
|
-
|
317
251
|
/**
|
318
252
|
* Registers the DOM listeners.
|
319
253
|
*
|
@@ -322,42 +256,33 @@ var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
|
|
322
256
|
}, {
|
323
257
|
key: "registerEvents",
|
324
258
|
value: function registerEvents() {
|
325
|
-
var
|
259
|
+
var _this3 = this;
|
326
260
|
this.eventManager.addEventListener(this.hot.rootElement, 'click', function (event) {
|
327
|
-
return
|
261
|
+
return _this3.onTableClick(event);
|
328
262
|
});
|
329
263
|
}
|
330
264
|
|
331
265
|
/**
|
332
266
|
* Opens menu and re-position it based on the passed coordinates.
|
333
267
|
*
|
334
|
-
* @param {
|
335
|
-
*
|
336
|
-
*
|
337
|
-
*
|
338
|
-
*
|
339
|
-
* the offset to the menu position.
|
268
|
+
* @param {object|Event} position An object with `pageX` and `pageY` properties which contains values relative to
|
269
|
+
* the top left of the fully rendered content area in the browser or with `clientX`
|
270
|
+
* and `clientY` properties which contains values relative to the upper left edge
|
271
|
+
* of the content area (the viewport) of the browser window. This object is structurally
|
272
|
+
* compatible with native mouse event so it can be used either.
|
340
273
|
* @fires Hooks#beforeDropdownMenuShow
|
341
274
|
* @fires Hooks#afterDropdownMenuShow
|
342
275
|
*/
|
343
276
|
}, {
|
344
277
|
key: "open",
|
345
278
|
value: function open(position) {
|
346
|
-
|
347
|
-
_this5 = this;
|
348
|
-
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
349
|
-
above: 0,
|
350
|
-
below: 0,
|
351
|
-
left: 0,
|
352
|
-
right: 0
|
353
|
-
};
|
354
|
-
if ((_this$menu = this.menu) !== null && _this$menu !== void 0 && _this$menu.isOpened()) {
|
279
|
+
if (!this.menu) {
|
355
280
|
return;
|
356
281
|
}
|
357
282
|
this.menu.open();
|
358
|
-
(
|
359
|
-
|
360
|
-
}
|
283
|
+
if (position.width) {
|
284
|
+
this.menu.setOffset('left', position.width);
|
285
|
+
}
|
361
286
|
this.menu.setPosition(position);
|
362
287
|
}
|
363
288
|
|
@@ -367,8 +292,10 @@ var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
|
|
367
292
|
}, {
|
368
293
|
key: "close",
|
369
294
|
value: function close() {
|
370
|
-
|
371
|
-
|
295
|
+
if (!this.menu) {
|
296
|
+
return;
|
297
|
+
}
|
298
|
+
this.menu.close();
|
372
299
|
}
|
373
300
|
|
374
301
|
/**
|
@@ -440,14 +367,23 @@ var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
|
|
440
367
|
key: "onTableClick",
|
441
368
|
value: function onTableClick(event) {
|
442
369
|
event.stopPropagation();
|
443
|
-
if ((0, _element.hasClass)(event.target, BUTTON_CLASS_NAME)) {
|
444
|
-
var
|
370
|
+
if ((0, _element.hasClass)(event.target, BUTTON_CLASS_NAME) && !this.menu.isOpened()) {
|
371
|
+
var offsetTop = 0;
|
372
|
+
var offsetLeft = 0;
|
373
|
+
if (this.hot.rootDocument !== this.menu.container.ownerDocument) {
|
374
|
+
var frameElement = this.hot.rootWindow.frameElement;
|
375
|
+
var _frameElement$getBoun = frameElement.getBoundingClientRect(),
|
376
|
+
top = _frameElement$getBoun.top,
|
377
|
+
left = _frameElement$getBoun.left;
|
378
|
+
offsetTop = top;
|
379
|
+
offsetLeft = left;
|
380
|
+
}
|
445
381
|
var rect = event.target.getBoundingClientRect();
|
446
382
|
this.open({
|
447
|
-
left: rect.left +
|
448
|
-
top: rect.top + event.target.offsetHeight + 3 +
|
449
|
-
|
450
|
-
|
383
|
+
left: rect.left + offsetLeft,
|
384
|
+
top: rect.top + event.target.offsetHeight + 3 + offsetTop,
|
385
|
+
width: rect.width,
|
386
|
+
height: rect.height
|
451
387
|
});
|
452
388
|
}
|
453
389
|
}
|
@@ -32,9 +32,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
32
32
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
33
33
|
import { BasePlugin } from "../base/index.mjs";
|
34
34
|
import { arrayEach } from "../../helpers/array.mjs";
|
35
|
-
import { objectEach } from "../../helpers/object.mjs";
|
36
35
|
import CommandExecutor from "../contextMenu/commandExecutor.mjs";
|
37
|
-
import { getDocumentOffsetByElement } from "../contextMenu/utils.mjs";
|
38
36
|
import EventManager from "../../eventManager.mjs";
|
39
37
|
import { hasClass } from "../../helpers/dom/element.mjs";
|
40
38
|
import ItemsFactory from "../contextMenu/itemsFactory.mjs";
|
@@ -49,7 +47,6 @@ Hooks.getSingleton().register('afterDropdownMenuExecute');
|
|
49
47
|
export var PLUGIN_KEY = 'dropdownMenu';
|
50
48
|
export var PLUGIN_PRIORITY = 230;
|
51
49
|
var BUTTON_CLASS_NAME = 'changeType';
|
52
|
-
var SHORTCUTS_GROUP = PLUGIN_KEY;
|
53
50
|
|
54
51
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
55
52
|
/**
|
@@ -179,7 +176,6 @@ export var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
|
|
179
176
|
if (typeof settings.callback === 'function') {
|
180
177
|
this.commandExecutor.setCommonCallback(settings.callback);
|
181
178
|
}
|
182
|
-
this.registerShortcuts();
|
183
179
|
_get(_getPrototypeOf(DropdownMenu.prototype), "enablePlugin", this).call(this);
|
184
180
|
this.callOnPluginsReady(function () {
|
185
181
|
_this2.hot.runHooks('afterDropdownMenuDefaultOptions', predefinedItems);
|
@@ -243,71 +239,9 @@ export var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
|
|
243
239
|
if (this.menu) {
|
244
240
|
this.menu.destroy();
|
245
241
|
}
|
246
|
-
this.unregisterShortcuts();
|
247
242
|
_get(_getPrototypeOf(DropdownMenu.prototype), "disablePlugin", this).call(this);
|
248
243
|
}
|
249
244
|
|
250
|
-
/**
|
251
|
-
* Register shortcuts responsible for toggling dropdown menu.
|
252
|
-
*
|
253
|
-
* @private
|
254
|
-
*/
|
255
|
-
}, {
|
256
|
-
key: "registerShortcuts",
|
257
|
-
value: function registerShortcuts() {
|
258
|
-
var _this3 = this;
|
259
|
-
var context = this.hot.getShortcutManager().getContext('grid');
|
260
|
-
var callback = function callback() {
|
261
|
-
var _this3$hot$getSelecte = _this3.hot.getSelectedRangeLast(),
|
262
|
-
highlight = _this3$hot$getSelecte.highlight;
|
263
|
-
if ((highlight.isHeader() && highlight.row === -1 || highlight.isCell()) && highlight.col >= 0) {
|
264
|
-
_this3.hot.selectColumns(highlight.col, highlight.col, -1);
|
265
|
-
var _this3$hot$getSelecte2 = _this3.hot.getSelectedRangeLast(),
|
266
|
-
from = _this3$hot$getSelecte2.from;
|
267
|
-
var offset = getDocumentOffsetByElement(_this3.menu.container, _this3.hot.rootDocument);
|
268
|
-
var target = _this3.hot.getCell(-1, from.col, true);
|
269
|
-
var rect = target.getBoundingClientRect();
|
270
|
-
_this3.open({
|
271
|
-
left: rect.left + offset.left,
|
272
|
-
top: rect.top + target.offsetHeight + offset.top
|
273
|
-
}, {
|
274
|
-
left: rect.width
|
275
|
-
});
|
276
|
-
_this3.hot._registerTimeout(function () {
|
277
|
-
_this3.menu.selectFirstCell();
|
278
|
-
});
|
279
|
-
}
|
280
|
-
};
|
281
|
-
context.addShortcuts([{
|
282
|
-
keys: [['Shift', 'Alt', 'ArrowDown'], ['Shift', 'Enter']],
|
283
|
-
callback: callback,
|
284
|
-
runOnlyIf: function runOnlyIf() {
|
285
|
-
var _this3$hot$getSelecte3;
|
286
|
-
return ((_this3$hot$getSelecte3 = _this3.hot.getSelectedRangeLast()) === null || _this3$hot$getSelecte3 === void 0 ? void 0 : _this3$hot$getSelecte3.highlight.isHeader()) && !_this3.menu.isOpened();
|
287
|
-
},
|
288
|
-
group: SHORTCUTS_GROUP
|
289
|
-
}, {
|
290
|
-
keys: [['Shift', 'Alt', 'ArrowDown']],
|
291
|
-
callback: callback,
|
292
|
-
runOnlyIf: function runOnlyIf() {
|
293
|
-
var _this3$hot$getSelecte4;
|
294
|
-
return ((_this3$hot$getSelecte4 = _this3.hot.getSelectedRangeLast()) === null || _this3$hot$getSelecte4 === void 0 ? void 0 : _this3$hot$getSelecte4.highlight.isCell()) && !_this3.menu.isOpened();
|
295
|
-
},
|
296
|
-
group: SHORTCUTS_GROUP
|
297
|
-
}]);
|
298
|
-
}
|
299
|
-
|
300
|
-
/**
|
301
|
-
* Unregister shortcuts responsible for toggling dropdown menu.
|
302
|
-
*
|
303
|
-
* @private
|
304
|
-
*/
|
305
|
-
}, {
|
306
|
-
key: "unregisterShortcuts",
|
307
|
-
value: function unregisterShortcuts() {
|
308
|
-
this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
|
309
|
-
}
|
310
|
-
|
311
245
|
/**
|
312
246
|
* Registers the DOM listeners.
|
313
247
|
*
|
@@ -316,42 +250,33 @@ export var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
|
|
316
250
|
}, {
|
317
251
|
key: "registerEvents",
|
318
252
|
value: function registerEvents() {
|
319
|
-
var
|
253
|
+
var _this3 = this;
|
320
254
|
this.eventManager.addEventListener(this.hot.rootElement, 'click', function (event) {
|
321
|
-
return
|
255
|
+
return _this3.onTableClick(event);
|
322
256
|
});
|
323
257
|
}
|
324
258
|
|
325
259
|
/**
|
326
260
|
* Opens menu and re-position it based on the passed coordinates.
|
327
261
|
*
|
328
|
-
* @param {
|
329
|
-
*
|
330
|
-
*
|
331
|
-
*
|
332
|
-
*
|
333
|
-
* the offset to the menu position.
|
262
|
+
* @param {object|Event} position An object with `pageX` and `pageY` properties which contains values relative to
|
263
|
+
* the top left of the fully rendered content area in the browser or with `clientX`
|
264
|
+
* and `clientY` properties which contains values relative to the upper left edge
|
265
|
+
* of the content area (the viewport) of the browser window. This object is structurally
|
266
|
+
* compatible with native mouse event so it can be used either.
|
334
267
|
* @fires Hooks#beforeDropdownMenuShow
|
335
268
|
* @fires Hooks#afterDropdownMenuShow
|
336
269
|
*/
|
337
270
|
}, {
|
338
271
|
key: "open",
|
339
272
|
value: function open(position) {
|
340
|
-
|
341
|
-
_this5 = this;
|
342
|
-
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
343
|
-
above: 0,
|
344
|
-
below: 0,
|
345
|
-
left: 0,
|
346
|
-
right: 0
|
347
|
-
};
|
348
|
-
if ((_this$menu = this.menu) !== null && _this$menu !== void 0 && _this$menu.isOpened()) {
|
273
|
+
if (!this.menu) {
|
349
274
|
return;
|
350
275
|
}
|
351
276
|
this.menu.open();
|
352
|
-
|
353
|
-
|
354
|
-
}
|
277
|
+
if (position.width) {
|
278
|
+
this.menu.setOffset('left', position.width);
|
279
|
+
}
|
355
280
|
this.menu.setPosition(position);
|
356
281
|
}
|
357
282
|
|
@@ -361,8 +286,10 @@ export var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
|
|
361
286
|
}, {
|
362
287
|
key: "close",
|
363
288
|
value: function close() {
|
364
|
-
|
365
|
-
|
289
|
+
if (!this.menu) {
|
290
|
+
return;
|
291
|
+
}
|
292
|
+
this.menu.close();
|
366
293
|
}
|
367
294
|
|
368
295
|
/**
|
@@ -434,14 +361,23 @@ export var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
|
|
434
361
|
key: "onTableClick",
|
435
362
|
value: function onTableClick(event) {
|
436
363
|
event.stopPropagation();
|
437
|
-
if (hasClass(event.target, BUTTON_CLASS_NAME)) {
|
438
|
-
var
|
364
|
+
if (hasClass(event.target, BUTTON_CLASS_NAME) && !this.menu.isOpened()) {
|
365
|
+
var offsetTop = 0;
|
366
|
+
var offsetLeft = 0;
|
367
|
+
if (this.hot.rootDocument !== this.menu.container.ownerDocument) {
|
368
|
+
var frameElement = this.hot.rootWindow.frameElement;
|
369
|
+
var _frameElement$getBoun = frameElement.getBoundingClientRect(),
|
370
|
+
top = _frameElement$getBoun.top,
|
371
|
+
left = _frameElement$getBoun.left;
|
372
|
+
offsetTop = top;
|
373
|
+
offsetLeft = left;
|
374
|
+
}
|
439
375
|
var rect = event.target.getBoundingClientRect();
|
440
376
|
this.open({
|
441
|
-
left: rect.left +
|
442
|
-
top: rect.top + event.target.offsetHeight + 3 +
|
443
|
-
|
444
|
-
|
377
|
+
left: rect.left + offsetLeft,
|
378
|
+
top: rect.top + event.target.offsetHeight + 3 + offsetTop,
|
379
|
+
width: rect.width,
|
380
|
+
height: rect.height
|
445
381
|
});
|
446
382
|
}
|
447
383
|
}
|
@@ -87,6 +87,7 @@ var ManualColumnResize = /*#__PURE__*/function (_BasePlugin) {
|
|
87
87
|
_this.guide = rootDocument.createElement('DIV');
|
88
88
|
_this.eventManager = new _eventManager.default(_assertThisInitialized(_this));
|
89
89
|
_this.pressed = null;
|
90
|
+
_this.isTriggeredByRMB = false;
|
90
91
|
_this.dblclick = 0;
|
91
92
|
_this.autoresizeTimeout = null;
|
92
93
|
|
@@ -437,6 +438,11 @@ var ManualColumnResize = /*#__PURE__*/function (_BasePlugin) {
|
|
437
438
|
if ((0, _element.isDetached)(event.target)) {
|
438
439
|
return;
|
439
440
|
}
|
441
|
+
|
442
|
+
// A "mouseover" action is triggered right after executing "contextmenu" event. It should be ignored.
|
443
|
+
if (this.isTriggeredByRMB === true) {
|
444
|
+
return;
|
445
|
+
}
|
440
446
|
if (this.checkIfColumnHeader(event.target)) {
|
441
447
|
var th = this.getClosestTHParent(event.target);
|
442
448
|
if (!th) {
|
@@ -593,6 +599,28 @@ var ManualColumnResize = /*#__PURE__*/function (_BasePlugin) {
|
|
593
599
|
}
|
594
600
|
}
|
595
601
|
|
602
|
+
/**
|
603
|
+
* Callback for "contextmenu" event triggered on element showing move handle. It removes handle and guide elements.
|
604
|
+
*
|
605
|
+
* @private
|
606
|
+
*/
|
607
|
+
}, {
|
608
|
+
key: "onContextMenu",
|
609
|
+
value: function onContextMenu() {
|
610
|
+
var _this9 = this;
|
611
|
+
this.hideHandleAndGuide();
|
612
|
+
this.hot.rootElement.removeChild(this.handle);
|
613
|
+
this.hot.rootElement.removeChild(this.guide);
|
614
|
+
this.pressed = false;
|
615
|
+
this.isTriggeredByRMB = true;
|
616
|
+
|
617
|
+
// There is thrown "mouseover" event right after opening a context menu. This flag inform that handle
|
618
|
+
// shouldn't be drawn just after removing it.
|
619
|
+
this.hot._registerImmediate(function () {
|
620
|
+
_this9.isTriggeredByRMB = false;
|
621
|
+
});
|
622
|
+
}
|
623
|
+
|
596
624
|
/**
|
597
625
|
* Binds the mouse events.
|
598
626
|
*
|
@@ -601,21 +629,24 @@ var ManualColumnResize = /*#__PURE__*/function (_BasePlugin) {
|
|
601
629
|
}, {
|
602
630
|
key: "bindEvents",
|
603
631
|
value: function bindEvents() {
|
604
|
-
var
|
632
|
+
var _this10 = this;
|
605
633
|
var _this$hot = this.hot,
|
606
634
|
rootWindow = _this$hot.rootWindow,
|
607
635
|
rootElement = _this$hot.rootElement;
|
608
636
|
this.eventManager.addEventListener(rootElement, 'mouseover', function (e) {
|
609
|
-
return
|
637
|
+
return _this10.onMouseOver(e);
|
610
638
|
});
|
611
639
|
this.eventManager.addEventListener(rootElement, 'mousedown', function (e) {
|
612
|
-
return
|
640
|
+
return _this10.onMouseDown(e);
|
613
641
|
});
|
614
642
|
this.eventManager.addEventListener(rootWindow, 'mousemove', function (e) {
|
615
|
-
return
|
643
|
+
return _this10.onMouseMove(e);
|
616
644
|
});
|
617
645
|
this.eventManager.addEventListener(rootWindow, 'mouseup', function () {
|
618
|
-
return
|
646
|
+
return _this10.onMouseUp();
|
647
|
+
});
|
648
|
+
this.eventManager.addEventListener(this.handle, 'contextmenu', function () {
|
649
|
+
return _this10.onContextMenu();
|
619
650
|
});
|
620
651
|
}
|
621
652
|
|
@@ -78,6 +78,7 @@ export var ManualColumnResize = /*#__PURE__*/function (_BasePlugin) {
|
|
78
78
|
_this.guide = rootDocument.createElement('DIV');
|
79
79
|
_this.eventManager = new EventManager(_assertThisInitialized(_this));
|
80
80
|
_this.pressed = null;
|
81
|
+
_this.isTriggeredByRMB = false;
|
81
82
|
_this.dblclick = 0;
|
82
83
|
_this.autoresizeTimeout = null;
|
83
84
|
|
@@ -428,6 +429,11 @@ export var ManualColumnResize = /*#__PURE__*/function (_BasePlugin) {
|
|
428
429
|
if (isDetached(event.target)) {
|
429
430
|
return;
|
430
431
|
}
|
432
|
+
|
433
|
+
// A "mouseover" action is triggered right after executing "contextmenu" event. It should be ignored.
|
434
|
+
if (this.isTriggeredByRMB === true) {
|
435
|
+
return;
|
436
|
+
}
|
431
437
|
if (this.checkIfColumnHeader(event.target)) {
|
432
438
|
var th = this.getClosestTHParent(event.target);
|
433
439
|
if (!th) {
|
@@ -584,6 +590,28 @@ export var ManualColumnResize = /*#__PURE__*/function (_BasePlugin) {
|
|
584
590
|
}
|
585
591
|
}
|
586
592
|
|
593
|
+
/**
|
594
|
+
* Callback for "contextmenu" event triggered on element showing move handle. It removes handle and guide elements.
|
595
|
+
*
|
596
|
+
* @private
|
597
|
+
*/
|
598
|
+
}, {
|
599
|
+
key: "onContextMenu",
|
600
|
+
value: function onContextMenu() {
|
601
|
+
var _this9 = this;
|
602
|
+
this.hideHandleAndGuide();
|
603
|
+
this.hot.rootElement.removeChild(this.handle);
|
604
|
+
this.hot.rootElement.removeChild(this.guide);
|
605
|
+
this.pressed = false;
|
606
|
+
this.isTriggeredByRMB = true;
|
607
|
+
|
608
|
+
// There is thrown "mouseover" event right after opening a context menu. This flag inform that handle
|
609
|
+
// shouldn't be drawn just after removing it.
|
610
|
+
this.hot._registerImmediate(function () {
|
611
|
+
_this9.isTriggeredByRMB = false;
|
612
|
+
});
|
613
|
+
}
|
614
|
+
|
587
615
|
/**
|
588
616
|
* Binds the mouse events.
|
589
617
|
*
|
@@ -592,21 +620,24 @@ export var ManualColumnResize = /*#__PURE__*/function (_BasePlugin) {
|
|
592
620
|
}, {
|
593
621
|
key: "bindEvents",
|
594
622
|
value: function bindEvents() {
|
595
|
-
var
|
623
|
+
var _this10 = this;
|
596
624
|
var _this$hot = this.hot,
|
597
625
|
rootWindow = _this$hot.rootWindow,
|
598
626
|
rootElement = _this$hot.rootElement;
|
599
627
|
this.eventManager.addEventListener(rootElement, 'mouseover', function (e) {
|
600
|
-
return
|
628
|
+
return _this10.onMouseOver(e);
|
601
629
|
});
|
602
630
|
this.eventManager.addEventListener(rootElement, 'mousedown', function (e) {
|
603
|
-
return
|
631
|
+
return _this10.onMouseDown(e);
|
604
632
|
});
|
605
633
|
this.eventManager.addEventListener(rootWindow, 'mousemove', function (e) {
|
606
|
-
return
|
634
|
+
return _this10.onMouseMove(e);
|
607
635
|
});
|
608
636
|
this.eventManager.addEventListener(rootWindow, 'mouseup', function () {
|
609
|
-
return
|
637
|
+
return _this10.onMouseUp();
|
638
|
+
});
|
639
|
+
this.eventManager.addEventListener(this.handle, 'contextmenu', function () {
|
640
|
+
return _this10.onContextMenu();
|
610
641
|
});
|
611
642
|
}
|
612
643
|
|
@@ -88,6 +88,7 @@ var ManualRowResize = /*#__PURE__*/function (_BasePlugin) {
|
|
88
88
|
_this.guide = rootDocument.createElement('DIV');
|
89
89
|
_this.eventManager = new _eventManager.default(_assertThisInitialized(_this));
|
90
90
|
_this.pressed = null;
|
91
|
+
_this.isTriggeredByRMB = false;
|
91
92
|
_this.dblclick = 0;
|
92
93
|
_this.autoresizeTimeout = null;
|
93
94
|
|
@@ -409,6 +410,11 @@ var ManualRowResize = /*#__PURE__*/function (_BasePlugin) {
|
|
409
410
|
if ((0, _element.isDetached)(event.target)) {
|
410
411
|
return;
|
411
412
|
}
|
413
|
+
|
414
|
+
// A "mouseover" action is triggered right after executing "contextmenu" event. It should be ignored.
|
415
|
+
if (this.isTriggeredByRMB === true) {
|
416
|
+
return;
|
417
|
+
}
|
412
418
|
if (this.checkIfRowHeader(event.target)) {
|
413
419
|
var th = this.getClosestTHParent(event.target);
|
414
420
|
if (th) {
|
@@ -555,6 +561,28 @@ var ManualRowResize = /*#__PURE__*/function (_BasePlugin) {
|
|
555
561
|
}
|
556
562
|
}
|
557
563
|
|
564
|
+
/**
|
565
|
+
* Callback for "contextmenu" event triggered on element showing move handle. It removes handle and guide elements.
|
566
|
+
*
|
567
|
+
* @private
|
568
|
+
*/
|
569
|
+
}, {
|
570
|
+
key: "onContextMenu",
|
571
|
+
value: function onContextMenu() {
|
572
|
+
var _this8 = this;
|
573
|
+
this.hideHandleAndGuide();
|
574
|
+
this.hot.rootElement.removeChild(this.handle);
|
575
|
+
this.hot.rootElement.removeChild(this.guide);
|
576
|
+
this.pressed = false;
|
577
|
+
this.isTriggeredByRMB = true;
|
578
|
+
|
579
|
+
// There is thrown "mouseover" event right after opening a context menu. This flag inform that handle
|
580
|
+
// shouldn't be drawn just after removing it.
|
581
|
+
this.hot._registerImmediate(function () {
|
582
|
+
_this8.isTriggeredByRMB = false;
|
583
|
+
});
|
584
|
+
}
|
585
|
+
|
558
586
|
/**
|
559
587
|
* Binds the mouse events.
|
560
588
|
*
|
@@ -563,21 +591,24 @@ var ManualRowResize = /*#__PURE__*/function (_BasePlugin) {
|
|
563
591
|
}, {
|
564
592
|
key: "bindEvents",
|
565
593
|
value: function bindEvents() {
|
566
|
-
var
|
594
|
+
var _this9 = this;
|
567
595
|
var _this$hot = this.hot,
|
568
596
|
rootElement = _this$hot.rootElement,
|
569
597
|
rootWindow = _this$hot.rootWindow;
|
570
598
|
this.eventManager.addEventListener(rootElement, 'mouseover', function (e) {
|
571
|
-
return
|
599
|
+
return _this9.onMouseOver(e);
|
572
600
|
});
|
573
601
|
this.eventManager.addEventListener(rootElement, 'mousedown', function (e) {
|
574
|
-
return
|
602
|
+
return _this9.onMouseDown(e);
|
575
603
|
});
|
576
604
|
this.eventManager.addEventListener(rootWindow, 'mousemove', function (e) {
|
577
|
-
return
|
605
|
+
return _this9.onMouseMove(e);
|
578
606
|
});
|
579
607
|
this.eventManager.addEventListener(rootWindow, 'mouseup', function () {
|
580
|
-
return
|
608
|
+
return _this9.onMouseUp();
|
609
|
+
});
|
610
|
+
this.eventManager.addEventListener(this.handle, 'contextmenu', function () {
|
611
|
+
return _this9.onContextMenu();
|
581
612
|
});
|
582
613
|
}
|
583
614
|
|
@@ -611,23 +642,23 @@ var ManualRowResize = /*#__PURE__*/function (_BasePlugin) {
|
|
611
642
|
}, {
|
612
643
|
key: "onMapInit",
|
613
644
|
value: function onMapInit() {
|
614
|
-
var
|
645
|
+
var _this10 = this;
|
615
646
|
var priv = privatePool.get(this);
|
616
647
|
var initialSetting = this.hot.getSettings()[PLUGIN_KEY];
|
617
648
|
var loadedManualRowHeights = this.loadManualRowHeights();
|
618
649
|
this.hot.batchExecution(function () {
|
619
650
|
if (typeof loadedManualRowHeights !== 'undefined') {
|
620
651
|
loadedManualRowHeights.forEach(function (height, index) {
|
621
|
-
|
652
|
+
_this10.rowHeightsMap.setValueAtIndex(index, height);
|
622
653
|
});
|
623
654
|
} else if (Array.isArray(initialSetting)) {
|
624
655
|
initialSetting.forEach(function (height, index) {
|
625
|
-
|
656
|
+
_this10.rowHeightsMap.setValueAtIndex(index, height);
|
626
657
|
});
|
627
658
|
priv.config = initialSetting;
|
628
659
|
} else if (initialSetting === true && Array.isArray(priv.config)) {
|
629
660
|
priv.config.forEach(function (height, index) {
|
630
|
-
|
661
|
+
_this10.rowHeightsMap.setValueAtIndex(index, height);
|
631
662
|
});
|
632
663
|
}
|
633
664
|
}, true);
|