handsontable 0.0.0-next-08765b9-20230809 → 0.0.0-next-7e1ba35-20230821
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 +11 -50
- package/3rdparty/walkontable/src/cell/coords.mjs +11 -50
- package/3rdparty/walkontable/src/cell/range.d.ts +2 -9
- package/3rdparty/walkontable/src/cell/range.js +7 -38
- package/3rdparty/walkontable/src/cell/range.mjs +7 -38
- 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 +6 -2
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +6 -2
- package/3rdparty/walkontable/src/overlay/top.js +6 -2
- package/3rdparty/walkontable/src/overlay/top.mjs +6 -2
- package/3rdparty/walkontable/src/selection.js +295 -0
- package/3rdparty/walkontable/src/selection.mjs +290 -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 +78 -6
- package/3rdparty/walkontable/src/table.mjs +79 -7
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/common.d.ts +1 -1
- package/core.d.ts +3 -6
- package/core.js +290 -173
- package/core.mjs +290 -173
- package/dataMap/metaManager/metaSchema.js +0 -41
- package/dataMap/metaManager/metaSchema.mjs +0 -41
- package/dist/handsontable.css +4 -24
- package/dist/handsontable.full.css +4 -24
- package/dist/handsontable.full.js +5384 -8679
- package/dist/handsontable.full.min.css +3 -4
- package/dist/handsontable.full.min.js +960 -29
- package/dist/handsontable.js +8132 -11427
- package/dist/handsontable.min.css +3 -4
- package/dist/handsontable.min.js +61 -24
- package/editorManager.js +75 -11
- package/editorManager.mjs +74 -11
- package/editors/baseEditor/baseEditor.d.ts +1 -0
- 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 -7
- package/pluginHooks.js +1 -106
- package/pluginHooks.mjs +1 -106
- package/plugins/collapsibleColumns/collapsibleColumns.js +4 -58
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +4 -58
- package/plugins/columnSorting/columnSorting.js +0 -38
- package/plugins/columnSorting/columnSorting.mjs +2 -38
- package/plugins/columnSorting/index.js +1 -3
- package/plugins/columnSorting/index.mjs +1 -1
- package/plugins/comments/commentEditor.js +0 -1
- package/plugins/comments/commentEditor.mjs +0 -1
- package/plugins/comments/comments.js +189 -251
- package/plugins/comments/comments.mjs +190 -250
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/contextMenu/contextMenu.js +30 -72
- package/plugins/contextMenu/contextMenu.mjs +31 -73
- 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 -28
- package/plugins/contextMenu/utils.mjs +15 -27
- 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 +10 -14
- package/plugins/copyPaste/copyPaste.mjs +10 -14
- package/plugins/customBorders/customBorders.js +20 -23
- package/plugins/customBorders/customBorders.mjs +21 -24
- package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
- package/plugins/dropdownMenu/dropdownMenu.js +32 -89
- package/plugins/dropdownMenu/dropdownMenu.mjs +32 -89
- package/plugins/filters/filters.js +14 -31
- package/plugins/filters/filters.mjs +13 -30
- package/plugins/manualColumnResize/manualColumnResize.js +6 -0
- package/plugins/manualColumnResize/manualColumnResize.mjs +7 -1
- package/plugins/mergeCells/mergeCells.js +17 -5
- package/plugins/mergeCells/mergeCells.mjs +17 -5
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -37
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -37
- package/plugins/nestedHeaders/nestedHeaders.js +8 -121
- package/plugins/nestedHeaders/nestedHeaders.mjs +8 -121
- package/plugins/nestedHeaders/stateManager/index.js +0 -37
- package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
- package/plugins/nestedRows/nestedRows.js +0 -41
- package/plugins/nestedRows/nestedRows.mjs +0 -41
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/constants.js +15 -0
- package/selection/highlight/constants.mjs +6 -0
- package/selection/highlight/highlight.js +71 -256
- package/selection/highlight/highlight.mjs +71 -250
- package/selection/highlight/types/activeHeader.js +8 -10
- package/selection/highlight/types/activeHeader.mjs +8 -10
- package/selection/highlight/types/area.js +18 -6
- package/selection/highlight/types/area.mjs +18 -6
- package/selection/highlight/types/{focus.js → cell.js} +7 -5
- package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
- package/selection/highlight/types/customSelection.js +9 -7
- package/selection/highlight/types/customSelection.mjs +9 -7
- package/selection/highlight/types/fill.js +7 -5
- package/selection/highlight/types/fill.mjs +7 -5
- package/selection/highlight/types/header.js +18 -9
- package/selection/highlight/types/header.mjs +18 -9
- package/selection/highlight/types/index.js +35 -0
- package/selection/highlight/types/index.mjs +31 -0
- 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 +154 -290
- package/selection/selection.mjs +153 -287
- package/selection/transformation.js +90 -232
- package/selection/transformation.mjs +90 -232
- package/selection/utils.js +21 -15
- package/selection/utils.mjs +21 -16
- package/settings.d.ts +0 -2
- 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 -19
- package/shortcuts/utils.mjs +4 -18
- package/tableView.js +13 -67
- package/tableView.mjs +13 -67
- package/3rdparty/walkontable/src/selection/border/constants.js +0 -16
- package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -12
- package/3rdparty/walkontable/src/selection/constants.js +0 -62
- package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
- package/3rdparty/walkontable/src/selection/index.js +0 -26
- package/3rdparty/walkontable/src/selection/index.mjs +0 -5
- package/3rdparty/walkontable/src/selection/manager.js +0 -259
- package/3rdparty/walkontable/src/selection/manager.mjs +0 -254
- package/3rdparty/walkontable/src/selection/scanner.js +0 -270
- package/3rdparty/walkontable/src/selection/scanner.mjs +0 -267
- package/3rdparty/walkontable/src/selection/selection.js +0 -101
- package/3rdparty/walkontable/src/selection/selection.mjs +0 -96
- package/core/focusCatcher/focusDetector.js +0 -58
- package/core/focusCatcher/focusDetector.mjs +0 -54
- package/core/focusCatcher/index.js +0 -142
- package/core/focusCatcher/index.mjs +0 -138
- package/core/index.js +0 -9
- package/core/index.mjs +0 -1
- package/plugins/comments/contextMenuItem/addEditComment.js +0 -41
- package/plugins/comments/contextMenuItem/addEditComment.mjs +0 -35
- package/plugins/comments/contextMenuItem/readOnlyComment.js +0 -49
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +0 -43
- package/plugins/comments/contextMenuItem/removeComment.js +0 -38
- package/plugins/comments/contextMenuItem/removeComment.mjs +0 -32
- package/selection/highlight/types/areaLayered.js +0 -31
- package/selection/highlight/types/areaLayered.mjs +0 -26
- package/selection/highlight/types/column.js +0 -27
- package/selection/highlight/types/column.mjs +0 -22
- package/selection/highlight/types/row.js +0 -27
- package/selection/highlight/types/row.mjs +0 -22
- package/shortcutContexts/commands/editor/closeAndSave.js +0 -12
- package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -8
- package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -12
- package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
- package/shortcutContexts/commands/editor/fastOpen.js +0 -16
- package/shortcutContexts/commands/editor/fastOpen.mjs +0 -12
- package/shortcutContexts/commands/editor/index.js +0 -16
- package/shortcutContexts/commands/editor/index.mjs +0 -12
- package/shortcutContexts/commands/editor/open.js +0 -27
- package/shortcutContexts/commands/editor/open.mjs +0 -23
- package/shortcutContexts/commands/emptySelectedCells.js +0 -11
- package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
- package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -11
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -21
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -17
- 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 -11
- package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -11
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +0 -19
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +0 -15
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -29
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -25
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -19
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -15
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -19
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -15
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -29
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -25
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -29
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -25
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -29
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -25
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +0 -19
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +0 -15
- package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -11
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -21
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -17
- package/shortcutContexts/commands/index.js +0 -35
- package/shortcutContexts/commands/index.mjs +0 -31
- package/shortcutContexts/commands/moveCellSelection/down.js +0 -13
- package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -9
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -31
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -27
- package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
- package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -12
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -12
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
- package/shortcutContexts/commands/moveCellSelection/left.js +0 -10
- package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
- package/shortcutContexts/commands/moveCellSelection/right.js +0 -10
- package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -17
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -13
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -18
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -14
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -14
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -10
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -17
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -13
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -19
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -15
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -21
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -17
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -17
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -13
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -19
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -15
- package/shortcutContexts/commands/moveCellSelection/up.js +0 -13
- package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -9
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -31
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -27
- package/shortcutContexts/commands/populateSelectedCellsData.js +0 -29
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -25
- package/shortcutContexts/commands/scrollToFocusedCell.js +0 -36
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +0 -32
- package/shortcutContexts/commands/selectAll.js +0 -10
- package/shortcutContexts/commands/selectAll.mjs +0 -6
- package/shortcutContexts/constants.js +0 -13
- package/shortcutContexts/constants.mjs +0 -8
- package/shortcutContexts/editor.js +0 -25
- package/shortcutContexts/editor.mjs +0 -21
- package/shortcutContexts/grid.js +0 -163
- package/shortcutContexts/grid.mjs +0 -159
- package/shortcutContexts/index.js +0 -24
- package/shortcutContexts/index.mjs +0 -11
@@ -4,7 +4,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
4
4
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
5
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); }
|
6
6
|
import { BasePlugin } from "../base/index.mjs";
|
7
|
-
import { hasOwnProperty, deepClone } from "../../helpers/object.mjs";
|
7
|
+
import { hasOwnProperty, objectEach, deepClone } from "../../helpers/object.mjs";
|
8
8
|
import { rangeEach } from "../../helpers/number.mjs";
|
9
9
|
import { arrayEach, arrayReduce, arrayMap } from "../../helpers/array.mjs";
|
10
10
|
import * as C from "../../i18n/constants.mjs";
|
@@ -160,11 +160,14 @@ export class CustomBorders extends BasePlugin {
|
|
160
160
|
const selectionType = detectSelectionType(selectionRanges);
|
161
161
|
const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
|
162
162
|
arrayEach(selectionRanges, selection => {
|
163
|
-
selectionSchemaNormalizer(selection)
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
163
|
+
const [rowStart, columnStart, rowEnd, columnEnd] = selectionSchemaNormalizer(selection);
|
164
|
+
for (let row = rowStart; row <= rowEnd; row += 1) {
|
165
|
+
for (let col = columnStart; col <= columnEnd; col += 1) {
|
166
|
+
arrayEach(borderKeys, borderKey => {
|
167
|
+
this.prepareBorderFromCustomAdded(row, col, normBorder, toInlinePropName(borderKey));
|
168
|
+
});
|
169
|
+
}
|
170
|
+
}
|
168
171
|
});
|
169
172
|
|
170
173
|
/*
|
@@ -204,13 +207,16 @@ export class CustomBorders extends BasePlugin {
|
|
204
207
|
const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
|
205
208
|
const selectedBorders = [];
|
206
209
|
arrayEach(selectionRanges, selection => {
|
207
|
-
selectionSchemaNormalizer(selection)
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
210
|
+
const [rowStart, columnStart, rowEnd, columnEnd] = selectionSchemaNormalizer(selection);
|
211
|
+
for (let row = rowStart; row <= rowEnd; row += 1) {
|
212
|
+
for (let col = columnStart; col <= columnEnd; col += 1) {
|
213
|
+
arrayEach(this.savedBorders, border => {
|
214
|
+
if (border.row === row && border.col === col) {
|
215
|
+
selectedBorders.push(denormalizeBorder(border));
|
216
|
+
}
|
217
|
+
});
|
218
|
+
}
|
219
|
+
}
|
214
220
|
});
|
215
221
|
return selectedBorders;
|
216
222
|
}
|
@@ -601,8 +607,7 @@ export class CustomBorders extends BasePlugin {
|
|
601
607
|
let check = false;
|
602
608
|
arrayEach(this.hot.selection.highlight.customSelections, customSelection => {
|
603
609
|
if (border.id === customSelection.settings.id) {
|
604
|
-
|
605
|
-
arrayEach(borders, borderObject => {
|
610
|
+
objectEach(customSelection.instanceBorders, borderObject => {
|
606
611
|
borderObject.toggleHiddenClass(place, remove); // TODO this also bad?
|
607
612
|
});
|
608
613
|
|
@@ -636,8 +641,7 @@ export class CustomBorders extends BasePlugin {
|
|
636
641
|
customSelection.visualCellRange = cellRange;
|
637
642
|
customSelection.commit();
|
638
643
|
if (place) {
|
639
|
-
|
640
|
-
arrayEach(borders, borderObject => {
|
644
|
+
objectEach(customSelection.instanceBorders, borderObject => {
|
641
645
|
borderObject.changeBorderStyle(place, border);
|
642
646
|
});
|
643
647
|
}
|
@@ -705,13 +709,6 @@ export class CustomBorders extends BasePlugin {
|
|
705
709
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_BORDERS);
|
706
710
|
},
|
707
711
|
disabled() {
|
708
|
-
const range = this.getSelectedRangeLast();
|
709
|
-
if (!range) {
|
710
|
-
return true;
|
711
|
-
}
|
712
|
-
if (range.isSingleHeader()) {
|
713
|
-
return true;
|
714
|
-
}
|
715
712
|
return this.selection.isSelectedByCorner();
|
716
713
|
},
|
717
714
|
submenu: {
|
@@ -18,7 +18,7 @@ export class DropdownMenu extends BasePlugin {
|
|
18
18
|
|
19
19
|
constructor(hotInstance: Core);
|
20
20
|
isEnabled(): boolean;
|
21
|
-
open(
|
21
|
+
open(event: Event): void;
|
22
22
|
close(): void;
|
23
23
|
executeCommand(commandName: string, ...params: any): void;
|
24
24
|
}
|
@@ -3,9 +3,7 @@
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
var _base = require("../base");
|
5
5
|
var _array = require("../../helpers/array");
|
6
|
-
var _object = require("../../helpers/object");
|
7
6
|
var _commandExecutor = _interopRequireDefault(require("../contextMenu/commandExecutor"));
|
8
|
-
var _utils = require("../contextMenu/utils");
|
9
7
|
var _eventManager = _interopRequireDefault(require("../../eventManager"));
|
10
8
|
var _element = require("../../helpers/dom/element");
|
11
9
|
var _itemsFactory = _interopRequireDefault(require("../contextMenu/itemsFactory"));
|
@@ -23,7 +21,6 @@ exports.PLUGIN_KEY = PLUGIN_KEY;
|
|
23
21
|
const PLUGIN_PRIORITY = 230;
|
24
22
|
exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
|
25
23
|
const BUTTON_CLASS_NAME = 'changeType';
|
26
|
-
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
27
24
|
|
28
25
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
29
26
|
/**
|
@@ -160,7 +157,6 @@ class DropdownMenu extends _base.BasePlugin {
|
|
160
157
|
if (typeof settings.callback === 'function') {
|
161
158
|
this.commandExecutor.setCommonCallback(settings.callback);
|
162
159
|
}
|
163
|
-
this.registerShortcuts();
|
164
160
|
super.enablePlugin();
|
165
161
|
this.callOnPluginsReady(() => {
|
166
162
|
this.hot.runHooks('afterDropdownMenuDefaultOptions', predefinedItems);
|
@@ -211,68 +207,9 @@ class DropdownMenu extends _base.BasePlugin {
|
|
211
207
|
if (this.menu) {
|
212
208
|
this.menu.destroy();
|
213
209
|
}
|
214
|
-
this.unregisterShortcuts();
|
215
210
|
super.disablePlugin();
|
216
211
|
}
|
217
212
|
|
218
|
-
/**
|
219
|
-
* Register shortcuts responsible for toggling dropdown menu.
|
220
|
-
*
|
221
|
-
* @private
|
222
|
-
*/
|
223
|
-
registerShortcuts() {
|
224
|
-
const context = this.hot.getShortcutManager().getContext('grid');
|
225
|
-
const callback = () => {
|
226
|
-
const {
|
227
|
-
highlight
|
228
|
-
} = this.hot.getSelectedRangeLast();
|
229
|
-
if ((highlight.isHeader() && highlight.row === -1 || highlight.isCell()) && highlight.col >= 0) {
|
230
|
-
this.hot.selectColumns(highlight.col, highlight.col, -1);
|
231
|
-
const {
|
232
|
-
from
|
233
|
-
} = this.hot.getSelectedRangeLast();
|
234
|
-
const offset = (0, _utils.getDocumentOffsetByElement)(this.menu.container, this.hot.rootDocument);
|
235
|
-
const target = this.hot.getCell(-1, from.col, true);
|
236
|
-
const rect = target.getBoundingClientRect();
|
237
|
-
this.open({
|
238
|
-
left: rect.left + offset.left,
|
239
|
-
top: rect.top + target.offsetHeight + offset.top
|
240
|
-
}, {
|
241
|
-
left: rect.width
|
242
|
-
});
|
243
|
-
this.hot._registerTimeout(() => {
|
244
|
-
this.menu.selectFirstCell();
|
245
|
-
});
|
246
|
-
}
|
247
|
-
};
|
248
|
-
context.addShortcuts([{
|
249
|
-
keys: [['Shift', 'Alt', 'ArrowDown'], ['Shift', 'Enter']],
|
250
|
-
callback,
|
251
|
-
runOnlyIf: () => {
|
252
|
-
var _this$hot$getSelected;
|
253
|
-
return ((_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader()) && !this.menu.isOpened();
|
254
|
-
},
|
255
|
-
group: SHORTCUTS_GROUP
|
256
|
-
}, {
|
257
|
-
keys: [['Shift', 'Alt', 'ArrowDown']],
|
258
|
-
callback,
|
259
|
-
runOnlyIf: () => {
|
260
|
-
var _this$hot$getSelected2;
|
261
|
-
return ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isCell()) && !this.menu.isOpened();
|
262
|
-
},
|
263
|
-
group: SHORTCUTS_GROUP
|
264
|
-
}]);
|
265
|
-
}
|
266
|
-
|
267
|
-
/**
|
268
|
-
* Unregister shortcuts responsible for toggling dropdown menu.
|
269
|
-
*
|
270
|
-
* @private
|
271
|
-
*/
|
272
|
-
unregisterShortcuts() {
|
273
|
-
this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
|
274
|
-
}
|
275
|
-
|
276
213
|
/**
|
277
214
|
* Registers the DOM listeners.
|
278
215
|
*
|
@@ -285,30 +222,23 @@ class DropdownMenu extends _base.BasePlugin {
|
|
285
222
|
/**
|
286
223
|
* Opens menu and re-position it based on the passed coordinates.
|
287
224
|
*
|
288
|
-
* @param {
|
289
|
-
*
|
290
|
-
*
|
291
|
-
*
|
292
|
-
*
|
293
|
-
* the offset to the menu position.
|
225
|
+
* @param {object|Event} position An object with `pageX` and `pageY` properties which contains values relative to
|
226
|
+
* the top left of the fully rendered content area in the browser or with `clientX`
|
227
|
+
* and `clientY` properties which contains values relative to the upper left edge
|
228
|
+
* of the content area (the viewport) of the browser window. This object is structurally
|
229
|
+
* compatible with native mouse event so it can be used either.
|
294
230
|
* @fires Hooks#beforeDropdownMenuShow
|
295
231
|
* @fires Hooks#afterDropdownMenuShow
|
296
232
|
*/
|
233
|
+
|
297
234
|
open(position) {
|
298
|
-
|
299
|
-
let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
300
|
-
above: 0,
|
301
|
-
below: 0,
|
302
|
-
left: 0,
|
303
|
-
right: 0
|
304
|
-
};
|
305
|
-
if ((_this$menu = this.menu) !== null && _this$menu !== void 0 && _this$menu.isOpened()) {
|
235
|
+
if (!this.menu) {
|
306
236
|
return;
|
307
237
|
}
|
308
238
|
this.menu.open();
|
309
|
-
(
|
310
|
-
this.menu.setOffset(
|
311
|
-
}
|
239
|
+
if (position.width) {
|
240
|
+
this.menu.setOffset('left', position.width);
|
241
|
+
}
|
312
242
|
this.menu.setPosition(position);
|
313
243
|
}
|
314
244
|
|
@@ -316,8 +246,10 @@ class DropdownMenu extends _base.BasePlugin {
|
|
316
246
|
* Closes dropdown menu.
|
317
247
|
*/
|
318
248
|
close() {
|
319
|
-
|
320
|
-
|
249
|
+
if (!this.menu) {
|
250
|
+
return;
|
251
|
+
}
|
252
|
+
this.menu.close();
|
321
253
|
}
|
322
254
|
|
323
255
|
/**
|
@@ -382,14 +314,26 @@ class DropdownMenu extends _base.BasePlugin {
|
|
382
314
|
*/
|
383
315
|
onTableClick(event) {
|
384
316
|
event.stopPropagation();
|
385
|
-
if ((0, _element.hasClass)(event.target, BUTTON_CLASS_NAME)) {
|
386
|
-
|
317
|
+
if ((0, _element.hasClass)(event.target, BUTTON_CLASS_NAME) && !this.menu.isOpened()) {
|
318
|
+
let offsetTop = 0;
|
319
|
+
let offsetLeft = 0;
|
320
|
+
if (this.hot.rootDocument !== this.menu.container.ownerDocument) {
|
321
|
+
const {
|
322
|
+
frameElement
|
323
|
+
} = this.hot.rootWindow;
|
324
|
+
const {
|
325
|
+
top,
|
326
|
+
left
|
327
|
+
} = frameElement.getBoundingClientRect();
|
328
|
+
offsetTop = top;
|
329
|
+
offsetLeft = left;
|
330
|
+
}
|
387
331
|
const rect = event.target.getBoundingClientRect();
|
388
332
|
this.open({
|
389
|
-
left: rect.left +
|
390
|
-
top: rect.top + event.target.offsetHeight + 3 +
|
391
|
-
|
392
|
-
|
333
|
+
left: rect.left + offsetLeft,
|
334
|
+
top: rect.top + event.target.offsetHeight + 3 + offsetTop,
|
335
|
+
width: rect.width,
|
336
|
+
height: rect.height
|
393
337
|
});
|
394
338
|
}
|
395
339
|
}
|
@@ -428,7 +372,6 @@ class DropdownMenu extends _base.BasePlugin {
|
|
428
372
|
const button = this.hot.rootDocument.createElement('button');
|
429
373
|
button.className = BUTTON_CLASS_NAME;
|
430
374
|
button.type = 'button';
|
431
|
-
button.tabIndex = -1;
|
432
375
|
|
433
376
|
// prevent page reload on button click
|
434
377
|
button.onclick = function () {
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import { BasePlugin } from "../base/index.mjs";
|
2
2
|
import { arrayEach } from "../../helpers/array.mjs";
|
3
|
-
import { objectEach } from "../../helpers/object.mjs";
|
4
3
|
import CommandExecutor from "../contextMenu/commandExecutor.mjs";
|
5
|
-
import { getDocumentOffsetByElement } from "../contextMenu/utils.mjs";
|
6
4
|
import EventManager from "../../eventManager.mjs";
|
7
5
|
import { hasClass } from "../../helpers/dom/element.mjs";
|
8
6
|
import ItemsFactory from "../contextMenu/itemsFactory.mjs";
|
@@ -17,7 +15,6 @@ Hooks.getSingleton().register('afterDropdownMenuExecute');
|
|
17
15
|
export const PLUGIN_KEY = 'dropdownMenu';
|
18
16
|
export const PLUGIN_PRIORITY = 230;
|
19
17
|
const BUTTON_CLASS_NAME = 'changeType';
|
20
|
-
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
21
18
|
|
22
19
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
23
20
|
/**
|
@@ -154,7 +151,6 @@ export class DropdownMenu extends BasePlugin {
|
|
154
151
|
if (typeof settings.callback === 'function') {
|
155
152
|
this.commandExecutor.setCommonCallback(settings.callback);
|
156
153
|
}
|
157
|
-
this.registerShortcuts();
|
158
154
|
super.enablePlugin();
|
159
155
|
this.callOnPluginsReady(() => {
|
160
156
|
this.hot.runHooks('afterDropdownMenuDefaultOptions', predefinedItems);
|
@@ -205,68 +201,9 @@ export class DropdownMenu extends BasePlugin {
|
|
205
201
|
if (this.menu) {
|
206
202
|
this.menu.destroy();
|
207
203
|
}
|
208
|
-
this.unregisterShortcuts();
|
209
204
|
super.disablePlugin();
|
210
205
|
}
|
211
206
|
|
212
|
-
/**
|
213
|
-
* Register shortcuts responsible for toggling dropdown menu.
|
214
|
-
*
|
215
|
-
* @private
|
216
|
-
*/
|
217
|
-
registerShortcuts() {
|
218
|
-
const context = this.hot.getShortcutManager().getContext('grid');
|
219
|
-
const callback = () => {
|
220
|
-
const {
|
221
|
-
highlight
|
222
|
-
} = this.hot.getSelectedRangeLast();
|
223
|
-
if ((highlight.isHeader() && highlight.row === -1 || highlight.isCell()) && highlight.col >= 0) {
|
224
|
-
this.hot.selectColumns(highlight.col, highlight.col, -1);
|
225
|
-
const {
|
226
|
-
from
|
227
|
-
} = this.hot.getSelectedRangeLast();
|
228
|
-
const offset = getDocumentOffsetByElement(this.menu.container, this.hot.rootDocument);
|
229
|
-
const target = this.hot.getCell(-1, from.col, true);
|
230
|
-
const rect = target.getBoundingClientRect();
|
231
|
-
this.open({
|
232
|
-
left: rect.left + offset.left,
|
233
|
-
top: rect.top + target.offsetHeight + offset.top
|
234
|
-
}, {
|
235
|
-
left: rect.width
|
236
|
-
});
|
237
|
-
this.hot._registerTimeout(() => {
|
238
|
-
this.menu.selectFirstCell();
|
239
|
-
});
|
240
|
-
}
|
241
|
-
};
|
242
|
-
context.addShortcuts([{
|
243
|
-
keys: [['Shift', 'Alt', 'ArrowDown'], ['Shift', 'Enter']],
|
244
|
-
callback,
|
245
|
-
runOnlyIf: () => {
|
246
|
-
var _this$hot$getSelected;
|
247
|
-
return ((_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader()) && !this.menu.isOpened();
|
248
|
-
},
|
249
|
-
group: SHORTCUTS_GROUP
|
250
|
-
}, {
|
251
|
-
keys: [['Shift', 'Alt', 'ArrowDown']],
|
252
|
-
callback,
|
253
|
-
runOnlyIf: () => {
|
254
|
-
var _this$hot$getSelected2;
|
255
|
-
return ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isCell()) && !this.menu.isOpened();
|
256
|
-
},
|
257
|
-
group: SHORTCUTS_GROUP
|
258
|
-
}]);
|
259
|
-
}
|
260
|
-
|
261
|
-
/**
|
262
|
-
* Unregister shortcuts responsible for toggling dropdown menu.
|
263
|
-
*
|
264
|
-
* @private
|
265
|
-
*/
|
266
|
-
unregisterShortcuts() {
|
267
|
-
this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
|
268
|
-
}
|
269
|
-
|
270
207
|
/**
|
271
208
|
* Registers the DOM listeners.
|
272
209
|
*
|
@@ -279,30 +216,23 @@ export class DropdownMenu extends BasePlugin {
|
|
279
216
|
/**
|
280
217
|
* Opens menu and re-position it based on the passed coordinates.
|
281
218
|
*
|
282
|
-
* @param {
|
283
|
-
*
|
284
|
-
*
|
285
|
-
*
|
286
|
-
*
|
287
|
-
* the offset to the menu position.
|
219
|
+
* @param {object|Event} position An object with `pageX` and `pageY` properties which contains values relative to
|
220
|
+
* the top left of the fully rendered content area in the browser or with `clientX`
|
221
|
+
* and `clientY` properties which contains values relative to the upper left edge
|
222
|
+
* of the content area (the viewport) of the browser window. This object is structurally
|
223
|
+
* compatible with native mouse event so it can be used either.
|
288
224
|
* @fires Hooks#beforeDropdownMenuShow
|
289
225
|
* @fires Hooks#afterDropdownMenuShow
|
290
226
|
*/
|
227
|
+
|
291
228
|
open(position) {
|
292
|
-
|
293
|
-
let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
294
|
-
above: 0,
|
295
|
-
below: 0,
|
296
|
-
left: 0,
|
297
|
-
right: 0
|
298
|
-
};
|
299
|
-
if ((_this$menu = this.menu) !== null && _this$menu !== void 0 && _this$menu.isOpened()) {
|
229
|
+
if (!this.menu) {
|
300
230
|
return;
|
301
231
|
}
|
302
232
|
this.menu.open();
|
303
|
-
|
304
|
-
this.menu.setOffset(
|
305
|
-
}
|
233
|
+
if (position.width) {
|
234
|
+
this.menu.setOffset('left', position.width);
|
235
|
+
}
|
306
236
|
this.menu.setPosition(position);
|
307
237
|
}
|
308
238
|
|
@@ -310,8 +240,10 @@ export class DropdownMenu extends BasePlugin {
|
|
310
240
|
* Closes dropdown menu.
|
311
241
|
*/
|
312
242
|
close() {
|
313
|
-
|
314
|
-
|
243
|
+
if (!this.menu) {
|
244
|
+
return;
|
245
|
+
}
|
246
|
+
this.menu.close();
|
315
247
|
}
|
316
248
|
|
317
249
|
/**
|
@@ -376,14 +308,26 @@ export class DropdownMenu extends BasePlugin {
|
|
376
308
|
*/
|
377
309
|
onTableClick(event) {
|
378
310
|
event.stopPropagation();
|
379
|
-
if (hasClass(event.target, BUTTON_CLASS_NAME)) {
|
380
|
-
|
311
|
+
if (hasClass(event.target, BUTTON_CLASS_NAME) && !this.menu.isOpened()) {
|
312
|
+
let offsetTop = 0;
|
313
|
+
let offsetLeft = 0;
|
314
|
+
if (this.hot.rootDocument !== this.menu.container.ownerDocument) {
|
315
|
+
const {
|
316
|
+
frameElement
|
317
|
+
} = this.hot.rootWindow;
|
318
|
+
const {
|
319
|
+
top,
|
320
|
+
left
|
321
|
+
} = frameElement.getBoundingClientRect();
|
322
|
+
offsetTop = top;
|
323
|
+
offsetLeft = left;
|
324
|
+
}
|
381
325
|
const rect = event.target.getBoundingClientRect();
|
382
326
|
this.open({
|
383
|
-
left: rect.left +
|
384
|
-
top: rect.top + event.target.offsetHeight + 3 +
|
385
|
-
|
386
|
-
|
327
|
+
left: rect.left + offsetLeft,
|
328
|
+
top: rect.top + event.target.offsetHeight + 3 + offsetTop,
|
329
|
+
width: rect.width,
|
330
|
+
height: rect.height
|
387
331
|
});
|
388
332
|
}
|
389
333
|
}
|
@@ -422,7 +366,6 @@ export class DropdownMenu extends BasePlugin {
|
|
422
366
|
const button = this.hot.rootDocument.createElement('button');
|
423
367
|
button.className = BUTTON_CLASS_NAME;
|
424
368
|
button.type = 'button';
|
425
|
-
button.tabIndex = -1;
|
426
369
|
|
427
370
|
// prevent page reload on button click
|
428
371
|
button.onclick = function () {
|
@@ -27,8 +27,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
27
27
|
const PLUGIN_KEY = 'filters';
|
28
28
|
exports.PLUGIN_KEY = PLUGIN_KEY;
|
29
29
|
const PLUGIN_PRIORITY = 250;
|
30
|
-
exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
|
31
|
-
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
32
30
|
|
33
31
|
/**
|
34
32
|
* @plugin Filters
|
@@ -65,6 +63,7 @@ const SHORTCUTS_GROUP = PLUGIN_KEY;
|
|
65
63
|
* ```
|
66
64
|
* :::
|
67
65
|
*/
|
66
|
+
exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
|
68
67
|
class Filters extends _base.BasePlugin {
|
69
68
|
static get PLUGIN_KEY() {
|
70
69
|
return PLUGIN_KEY;
|
@@ -211,7 +210,6 @@ class Filters extends _base.BasePlugin {
|
|
211
210
|
this.dropdownMenuPlugin.disablePlugin();
|
212
211
|
this.dropdownMenuPlugin.enablePlugin();
|
213
212
|
}
|
214
|
-
this.registerShortcuts();
|
215
213
|
super.enablePlugin();
|
216
214
|
}
|
217
215
|
|
@@ -232,36 +230,9 @@ class Filters extends _base.BasePlugin {
|
|
232
230
|
this.conditionCollection = null;
|
233
231
|
this.hot.rowIndexMapper.unregisterMap(this.pluginName);
|
234
232
|
}
|
235
|
-
this.unregisterShortcuts();
|
236
233
|
super.disablePlugin();
|
237
234
|
}
|
238
235
|
|
239
|
-
/**
|
240
|
-
* Register shortcuts responsible for clearing the filters.
|
241
|
-
*
|
242
|
-
* @private
|
243
|
-
*/
|
244
|
-
registerShortcuts() {
|
245
|
-
this.hot.getShortcutManager().getContext('grid').addShortcut({
|
246
|
-
keys: [['Alt', 'A']],
|
247
|
-
stopPropagation: true,
|
248
|
-
callback: () => {
|
249
|
-
this.clearConditions();
|
250
|
-
this.filter();
|
251
|
-
},
|
252
|
-
group: SHORTCUTS_GROUP
|
253
|
-
});
|
254
|
-
}
|
255
|
-
|
256
|
-
/**
|
257
|
-
* Unregister shortcuts responsible for clearing the filters.
|
258
|
-
*
|
259
|
-
* @private
|
260
|
-
*/
|
261
|
-
unregisterShortcuts() {
|
262
|
-
this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
|
263
|
-
}
|
264
|
-
|
265
236
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
266
237
|
/**
|
267
238
|
* @memberof Filters#
|
@@ -451,6 +422,7 @@ class Filters extends _base.BasePlugin {
|
|
451
422
|
this.hot.runHooks('afterFilter', conditions);
|
452
423
|
this.hot.view.adjustElementsSize(true);
|
453
424
|
this.hot.render();
|
425
|
+
this.clearColumnSelection();
|
454
426
|
}
|
455
427
|
|
456
428
|
/**
|
@@ -472,6 +444,18 @@ class Filters extends _base.BasePlugin {
|
|
472
444
|
};
|
473
445
|
}
|
474
446
|
|
447
|
+
/**
|
448
|
+
* Clears column selection.
|
449
|
+
*
|
450
|
+
* @private
|
451
|
+
*/
|
452
|
+
clearColumnSelection() {
|
453
|
+
const selectedColumn = this.getSelectedColumn();
|
454
|
+
if (selectedColumn !== null) {
|
455
|
+
this.hot.selectCell(0, selectedColumn.visualIndex);
|
456
|
+
}
|
457
|
+
}
|
458
|
+
|
475
459
|
/**
|
476
460
|
* Returns handsontable source data with cell meta based on current selection.
|
477
461
|
*
|
@@ -671,7 +655,6 @@ class Filters extends _base.BasePlugin {
|
|
671
655
|
this.components.forEach(component => component.saveState(physicalIndex));
|
672
656
|
this.filtersRowsMap.clear();
|
673
657
|
this.filter();
|
674
|
-
this.hot.selectCell(0, selectedColumn.visualIndex);
|
675
658
|
}
|
676
659
|
(_this$dropdownMenuPlu3 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu3 === void 0 ? void 0 : _this$dropdownMenuPlu3.close();
|
677
660
|
}
|
@@ -20,7 +20,6 @@ import { CONDITION_NONE, CONDITION_BY_VALUE, OPERATION_AND, OPERATION_OR, OPERAT
|
|
20
20
|
import { TrimmingMap } from "../../translations/index.mjs";
|
21
21
|
export const PLUGIN_KEY = 'filters';
|
22
22
|
export const PLUGIN_PRIORITY = 250;
|
23
|
-
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
24
23
|
|
25
24
|
/**
|
26
25
|
* @plugin Filters
|
@@ -203,7 +202,6 @@ export class Filters extends BasePlugin {
|
|
203
202
|
this.dropdownMenuPlugin.disablePlugin();
|
204
203
|
this.dropdownMenuPlugin.enablePlugin();
|
205
204
|
}
|
206
|
-
this.registerShortcuts();
|
207
205
|
super.enablePlugin();
|
208
206
|
}
|
209
207
|
|
@@ -224,36 +222,9 @@ export class Filters extends BasePlugin {
|
|
224
222
|
this.conditionCollection = null;
|
225
223
|
this.hot.rowIndexMapper.unregisterMap(this.pluginName);
|
226
224
|
}
|
227
|
-
this.unregisterShortcuts();
|
228
225
|
super.disablePlugin();
|
229
226
|
}
|
230
227
|
|
231
|
-
/**
|
232
|
-
* Register shortcuts responsible for clearing the filters.
|
233
|
-
*
|
234
|
-
* @private
|
235
|
-
*/
|
236
|
-
registerShortcuts() {
|
237
|
-
this.hot.getShortcutManager().getContext('grid').addShortcut({
|
238
|
-
keys: [['Alt', 'A']],
|
239
|
-
stopPropagation: true,
|
240
|
-
callback: () => {
|
241
|
-
this.clearConditions();
|
242
|
-
this.filter();
|
243
|
-
},
|
244
|
-
group: SHORTCUTS_GROUP
|
245
|
-
});
|
246
|
-
}
|
247
|
-
|
248
|
-
/**
|
249
|
-
* Unregister shortcuts responsible for clearing the filters.
|
250
|
-
*
|
251
|
-
* @private
|
252
|
-
*/
|
253
|
-
unregisterShortcuts() {
|
254
|
-
this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
|
255
|
-
}
|
256
|
-
|
257
228
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
258
229
|
/**
|
259
230
|
* @memberof Filters#
|
@@ -443,6 +414,7 @@ export class Filters extends BasePlugin {
|
|
443
414
|
this.hot.runHooks('afterFilter', conditions);
|
444
415
|
this.hot.view.adjustElementsSize(true);
|
445
416
|
this.hot.render();
|
417
|
+
this.clearColumnSelection();
|
446
418
|
}
|
447
419
|
|
448
420
|
/**
|
@@ -464,6 +436,18 @@ export class Filters extends BasePlugin {
|
|
464
436
|
};
|
465
437
|
}
|
466
438
|
|
439
|
+
/**
|
440
|
+
* Clears column selection.
|
441
|
+
*
|
442
|
+
* @private
|
443
|
+
*/
|
444
|
+
clearColumnSelection() {
|
445
|
+
const selectedColumn = this.getSelectedColumn();
|
446
|
+
if (selectedColumn !== null) {
|
447
|
+
this.hot.selectCell(0, selectedColumn.visualIndex);
|
448
|
+
}
|
449
|
+
}
|
450
|
+
|
467
451
|
/**
|
468
452
|
* Returns handsontable source data with cell meta based on current selection.
|
469
453
|
*
|
@@ -663,7 +647,6 @@ export class Filters extends BasePlugin {
|
|
663
647
|
this.components.forEach(component => component.saveState(physicalIndex));
|
664
648
|
this.filtersRowsMap.clear();
|
665
649
|
this.filter();
|
666
|
-
this.hot.selectCell(0, selectedColumn.visualIndex);
|
667
650
|
}
|
668
651
|
(_this$dropdownMenuPlu3 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu3 === void 0 ? void 0 : _this$dropdownMenuPlu3.close();
|
669
652
|
}
|
@@ -221,6 +221,12 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
221
221
|
return;
|
222
222
|
}
|
223
223
|
this.currentTH = TH;
|
224
|
+
const hotRootElement = this.hot.rootElement;
|
225
|
+
|
226
|
+
// Handling elements placed only inside columns header of the main instance.
|
227
|
+
if ((0, _element.overlayContainsElement)('top_inline_start_corner', this.currentTH, hotRootElement) === false && (0, _element.overlayContainsElement)('top', this.currentTH, hotRootElement) === false) {
|
228
|
+
return;
|
229
|
+
}
|
224
230
|
const {
|
225
231
|
_wt: wt
|
226
232
|
} = this.hot.view;
|