handsontable 0.0.0-next-85c3085-20230713 → 0.0.0-next-08765b9-20230714
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/cell/coords.d.ts +6 -1
- package/3rdparty/walkontable/src/cell/coords.js +50 -11
- package/3rdparty/walkontable/src/cell/coords.mjs +50 -11
- package/3rdparty/walkontable/src/cell/range.d.ts +9 -2
- package/3rdparty/walkontable/src/cell/range.js +38 -7
- package/3rdparty/walkontable/src/cell/range.mjs +38 -7
- package/3rdparty/walkontable/src/core/_base.js +9 -3
- package/3rdparty/walkontable/src/core/_base.mjs +9 -3
- 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 +3 -2
- package/3rdparty/walkontable/src/core/core.mjs +3 -2
- 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 +10 -2
- 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 +2 -6
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -6
- package/3rdparty/walkontable/src/overlay/top.js +2 -6
- package/3rdparty/walkontable/src/overlay/top.mjs +2 -6
- package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
- package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
- package/3rdparty/walkontable/src/selection/border/constants.js +16 -0
- package/3rdparty/walkontable/src/selection/border/constants.mjs +12 -0
- package/3rdparty/walkontable/src/selection/constants.js +62 -0
- package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
- package/3rdparty/walkontable/src/selection/index.js +26 -0
- package/3rdparty/walkontable/src/selection/index.mjs +5 -0
- package/3rdparty/walkontable/src/selection/manager.js +259 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +254 -0
- package/3rdparty/walkontable/src/selection/scanner.js +270 -0
- package/3rdparty/walkontable/src/selection/scanner.mjs +267 -0
- package/3rdparty/walkontable/src/selection/selection.js +101 -0
- package/3rdparty/walkontable/src/selection/selection.mjs +96 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
- package/3rdparty/walkontable/src/table.js +6 -78
- package/3rdparty/walkontable/src/table.mjs +7 -79
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/focusDetector.js +58 -0
- package/core/focusCatcher/focusDetector.mjs +54 -0
- package/core/focusCatcher/index.js +142 -0
- package/core/focusCatcher/index.mjs +138 -0
- package/core/index.js +9 -0
- package/core/index.mjs +1 -0
- package/core.d.ts +6 -3
- package/core.js +173 -290
- package/core.mjs +173 -290
- package/dataMap/metaManager/metaSchema.js +41 -0
- package/dataMap/metaManager/metaSchema.mjs +41 -0
- package/dist/handsontable.css +19 -3
- package/dist/handsontable.full.css +19 -3
- package/dist/handsontable.full.js +8668 -5366
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +25 -25
- package/dist/handsontable.js +10976 -7674
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +19 -19
- package/editorManager.js +11 -75
- package/editorManager.mjs +11 -74
- package/editors/textEditor/textEditor.js +3 -11
- package/editors/textEditor/textEditor.mjs +4 -12
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/number.d.ts +1 -0
- package/helpers/number.js +18 -0
- package/helpers/number.mjs +17 -0
- package/package.json +1 -1
- package/pluginHooks.d.ts +7 -1
- package/pluginHooks.js +106 -1
- package/pluginHooks.mjs +106 -1
- package/plugins/collapsibleColumns/collapsibleColumns.js +58 -4
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +58 -4
- package/plugins/columnSorting/columnSorting.js +38 -0
- package/plugins/columnSorting/columnSorting.mjs +38 -2
- package/plugins/columnSorting/index.js +3 -1
- package/plugins/columnSorting/index.mjs +1 -1
- package/plugins/comments/commentEditor.js +1 -0
- package/plugins/comments/commentEditor.mjs +1 -0
- package/plugins/comments/comments.js +251 -189
- package/plugins/comments/comments.mjs +250 -190
- package/plugins/comments/contextMenuItem/addEditComment.js +41 -0
- package/plugins/comments/contextMenuItem/addEditComment.mjs +35 -0
- package/plugins/comments/contextMenuItem/readOnlyComment.js +49 -0
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +43 -0
- package/plugins/comments/contextMenuItem/removeComment.js +38 -0
- package/plugins/comments/contextMenuItem/removeComment.mjs +32 -0
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/contextMenu/contextMenu.js +72 -30
- package/plugins/contextMenu/contextMenu.mjs +73 -31
- package/plugins/contextMenu/predefinedItems/alignment.js +7 -0
- package/plugins/contextMenu/predefinedItems/alignment.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/clearColumn.js +5 -3
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/readOnly.js +7 -0
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/removeColumn.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/removeRow.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +5 -3
- package/plugins/contextMenu/utils.js +28 -16
- package/plugins/contextMenu/utils.mjs +27 -15
- package/plugins/copyPaste/contextMenuItem/copy.js +7 -0
- package/plugins/copyPaste/contextMenuItem/copy.mjs +7 -0
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/cut.js +7 -0
- package/plugins/copyPaste/contextMenuItem/cut.mjs +7 -0
- package/plugins/copyPaste/copyPaste.js +6 -2
- package/plugins/copyPaste/copyPaste.mjs +6 -2
- package/plugins/customBorders/customBorders.js +23 -20
- package/plugins/customBorders/customBorders.mjs +24 -21
- package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
- package/plugins/dropdownMenu/dropdownMenu.js +89 -32
- package/plugins/dropdownMenu/dropdownMenu.mjs +89 -32
- package/plugins/filters/filters.js +31 -14
- package/plugins/filters/filters.mjs +30 -13
- package/plugins/mergeCells/mergeCells.js +5 -16
- package/plugins/mergeCells/mergeCells.mjs +5 -16
- package/plugins/multiColumnSorting/multiColumnSorting.js +37 -2
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +37 -2
- package/plugins/nestedHeaders/nestedHeaders.js +121 -8
- package/plugins/nestedHeaders/nestedHeaders.mjs +121 -8
- package/plugins/nestedHeaders/stateManager/index.js +37 -0
- package/plugins/nestedHeaders/stateManager/index.mjs +37 -0
- package/plugins/nestedRows/nestedRows.js +41 -0
- package/plugins/nestedRows/nestedRows.mjs +41 -0
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/highlight.js +256 -71
- package/selection/highlight/highlight.mjs +250 -71
- package/selection/highlight/types/activeHeader.js +10 -8
- package/selection/highlight/types/activeHeader.mjs +10 -8
- package/selection/highlight/types/area.js +6 -18
- package/selection/highlight/types/area.mjs +6 -18
- package/selection/highlight/types/areaLayered.js +31 -0
- package/selection/highlight/types/areaLayered.mjs +26 -0
- package/selection/highlight/types/column.js +27 -0
- package/selection/highlight/types/column.mjs +22 -0
- package/selection/highlight/types/customSelection.js +7 -9
- package/selection/highlight/types/customSelection.mjs +7 -9
- package/selection/highlight/types/fill.js +5 -7
- package/selection/highlight/types/fill.mjs +5 -7
- package/selection/highlight/types/{cell.js → focus.js} +5 -7
- package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
- package/selection/highlight/types/header.js +9 -18
- package/selection/highlight/types/header.mjs +9 -18
- package/selection/highlight/types/row.js +27 -0
- package/selection/highlight/types/row.mjs +22 -0
- package/selection/highlight/visualSelection.js +31 -27
- package/selection/highlight/visualSelection.mjs +31 -27
- package/selection/index.js +4 -7
- package/selection/index.mjs +2 -3
- 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 +290 -154
- package/selection/selection.mjs +287 -153
- package/selection/transformation.js +232 -90
- package/selection/transformation.mjs +232 -90
- package/selection/utils.js +15 -21
- package/selection/utils.mjs +16 -21
- package/settings.d.ts +2 -0
- package/shortcutContexts/commands/editor/closeAndSave.js +12 -0
- package/shortcutContexts/commands/editor/closeAndSave.mjs +8 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.js +12 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +8 -0
- package/shortcutContexts/commands/editor/fastOpen.js +16 -0
- package/shortcutContexts/commands/editor/fastOpen.mjs +12 -0
- package/shortcutContexts/commands/editor/index.js +16 -0
- package/shortcutContexts/commands/editor/index.mjs +12 -0
- package/shortcutContexts/commands/editor/open.js +27 -0
- package/shortcutContexts/commands/editor/open.mjs +23 -0
- package/shortcutContexts/commands/emptySelectedCells.js +11 -0
- package/shortcutContexts/commands/emptySelectedCells.mjs +7 -0
- package/shortcutContexts/commands/extendCellsSelection/down.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +17 -0
- package/shortcutContexts/commands/extendCellsSelection/index.js +26 -0
- package/shortcutContexts/commands/extendCellsSelection/index.mjs +22 -0
- package/shortcutContexts/commands/extendCellsSelection/left.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/right.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/up.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +17 -0
- package/shortcutContexts/commands/index.js +35 -0
- package/shortcutContexts/commands/index.mjs +31 -0
- package/shortcutContexts/commands/moveCellSelection/down.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/down.mjs +9 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +31 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +27 -0
- package/shortcutContexts/commands/moveCellSelection/index.js +28 -0
- package/shortcutContexts/commands/moveCellSelection/index.mjs +24 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/left.js +10 -0
- package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/right.js +10 -0
- package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +18 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +14 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +14 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +10 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +19 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +15 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +21 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +19 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +15 -0
- package/shortcutContexts/commands/moveCellSelection/up.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/up.mjs +9 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +31 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +27 -0
- package/shortcutContexts/commands/populateSelectedCellsData.js +29 -0
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +25 -0
- package/shortcutContexts/commands/scrollToFocusedCell.js +36 -0
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +32 -0
- package/shortcutContexts/commands/selectAll.js +10 -0
- package/shortcutContexts/commands/selectAll.mjs +6 -0
- package/shortcutContexts/constants.js +13 -0
- package/shortcutContexts/constants.mjs +8 -0
- package/shortcutContexts/editor.js +25 -0
- package/shortcutContexts/editor.mjs +21 -0
- package/shortcutContexts/grid.js +163 -0
- package/shortcutContexts/grid.mjs +159 -0
- package/shortcutContexts/index.js +24 -0
- package/shortcutContexts/index.mjs +11 -0
- package/shortcuts/manager.js +2 -0
- package/shortcuts/manager.mjs +2 -0
- package/shortcuts/recorder.js +2 -2
- package/shortcuts/recorder.mjs +2 -2
- package/shortcuts/utils.js +19 -5
- package/shortcuts/utils.mjs +18 -4
- package/tableView.js +67 -13
- package/tableView.mjs +67 -13
- package/3rdparty/walkontable/src/selection.js +0 -295
- package/3rdparty/walkontable/src/selection.mjs +0 -290
- package/selection/highlight/constants.js +0 -15
- package/selection/highlight/constants.mjs +0 -6
- package/selection/highlight/types/index.js +0 -35
- package/selection/highlight/types/index.mjs +0 -31
@@ -27,6 +27,8 @@ 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;
|
30
32
|
|
31
33
|
/**
|
32
34
|
* @plugin Filters
|
@@ -63,7 +65,6 @@ const PLUGIN_PRIORITY = 250;
|
|
63
65
|
* ```
|
64
66
|
* :::
|
65
67
|
*/
|
66
|
-
exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
|
67
68
|
class Filters extends _base.BasePlugin {
|
68
69
|
static get PLUGIN_KEY() {
|
69
70
|
return PLUGIN_KEY;
|
@@ -210,6 +211,7 @@ class Filters extends _base.BasePlugin {
|
|
210
211
|
this.dropdownMenuPlugin.disablePlugin();
|
211
212
|
this.dropdownMenuPlugin.enablePlugin();
|
212
213
|
}
|
214
|
+
this.registerShortcuts();
|
213
215
|
super.enablePlugin();
|
214
216
|
}
|
215
217
|
|
@@ -230,9 +232,36 @@ class Filters extends _base.BasePlugin {
|
|
230
232
|
this.conditionCollection = null;
|
231
233
|
this.hot.rowIndexMapper.unregisterMap(this.pluginName);
|
232
234
|
}
|
235
|
+
this.unregisterShortcuts();
|
233
236
|
super.disablePlugin();
|
234
237
|
}
|
235
238
|
|
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
|
+
|
236
265
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
237
266
|
/**
|
238
267
|
* @memberof Filters#
|
@@ -422,7 +451,6 @@ class Filters extends _base.BasePlugin {
|
|
422
451
|
this.hot.runHooks('afterFilter', conditions);
|
423
452
|
this.hot.view.adjustElementsSize(true);
|
424
453
|
this.hot.render();
|
425
|
-
this.clearColumnSelection();
|
426
454
|
}
|
427
455
|
|
428
456
|
/**
|
@@ -444,18 +472,6 @@ class Filters extends _base.BasePlugin {
|
|
444
472
|
};
|
445
473
|
}
|
446
474
|
|
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
|
-
|
459
475
|
/**
|
460
476
|
* Returns handsontable source data with cell meta based on current selection.
|
461
477
|
*
|
@@ -655,6 +671,7 @@ class Filters extends _base.BasePlugin {
|
|
655
671
|
this.components.forEach(component => component.saveState(physicalIndex));
|
656
672
|
this.filtersRowsMap.clear();
|
657
673
|
this.filter();
|
674
|
+
this.hot.selectCell(0, selectedColumn.visualIndex);
|
658
675
|
}
|
659
676
|
(_this$dropdownMenuPlu3 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu3 === void 0 ? void 0 : _this$dropdownMenuPlu3.close();
|
660
677
|
}
|
@@ -20,6 +20,7 @@ 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;
|
23
24
|
|
24
25
|
/**
|
25
26
|
* @plugin Filters
|
@@ -202,6 +203,7 @@ export class Filters extends BasePlugin {
|
|
202
203
|
this.dropdownMenuPlugin.disablePlugin();
|
203
204
|
this.dropdownMenuPlugin.enablePlugin();
|
204
205
|
}
|
206
|
+
this.registerShortcuts();
|
205
207
|
super.enablePlugin();
|
206
208
|
}
|
207
209
|
|
@@ -222,9 +224,36 @@ export class Filters extends BasePlugin {
|
|
222
224
|
this.conditionCollection = null;
|
223
225
|
this.hot.rowIndexMapper.unregisterMap(this.pluginName);
|
224
226
|
}
|
227
|
+
this.unregisterShortcuts();
|
225
228
|
super.disablePlugin();
|
226
229
|
}
|
227
230
|
|
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
|
+
|
228
257
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
229
258
|
/**
|
230
259
|
* @memberof Filters#
|
@@ -414,7 +443,6 @@ export class Filters extends BasePlugin {
|
|
414
443
|
this.hot.runHooks('afterFilter', conditions);
|
415
444
|
this.hot.view.adjustElementsSize(true);
|
416
445
|
this.hot.render();
|
417
|
-
this.clearColumnSelection();
|
418
446
|
}
|
419
447
|
|
420
448
|
/**
|
@@ -436,18 +464,6 @@ export class Filters extends BasePlugin {
|
|
436
464
|
};
|
437
465
|
}
|
438
466
|
|
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
|
-
|
451
467
|
/**
|
452
468
|
* Returns handsontable source data with cell meta based on current selection.
|
453
469
|
*
|
@@ -647,6 +663,7 @@ export class Filters extends BasePlugin {
|
|
647
663
|
this.components.forEach(component => component.saveState(physicalIndex));
|
648
664
|
this.filtersRowsMap.clear();
|
649
665
|
this.filter();
|
666
|
+
this.hot.selectCell(0, selectedColumn.visualIndex);
|
650
667
|
}
|
651
668
|
(_this$dropdownMenuPlu3 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu3 === void 0 ? void 0 : _this$dropdownMenuPlu3.close();
|
652
669
|
}
|
@@ -188,9 +188,6 @@ class MergeCells extends _base.BasePlugin {
|
|
188
188
|
this.addHook('afterDrawSelection', function () {
|
189
189
|
return _this.onAfterDrawSelection(...arguments);
|
190
190
|
});
|
191
|
-
this.addHook('beforeRemoveCellClassNames', function () {
|
192
|
-
return _this.onBeforeRemoveCellClassNames(...arguments);
|
193
|
-
});
|
194
191
|
this.addHook('beforeUndoStackChange', (action, source) => {
|
195
192
|
if (source === 'MergeCells') {
|
196
193
|
return false;
|
@@ -574,8 +571,11 @@ class MergeCells extends _base.BasePlugin {
|
|
574
571
|
gridContext.addShortcut({
|
575
572
|
keys: [['Control', 'm']],
|
576
573
|
callback: () => {
|
577
|
-
this.
|
578
|
-
|
574
|
+
const range = this.hot.getSelectedRangeLast();
|
575
|
+
if (range && !range.isSingleHeader()) {
|
576
|
+
this.toggleMerge(range);
|
577
|
+
this.hot.render();
|
578
|
+
}
|
579
579
|
},
|
580
580
|
runOnlyIf: event => !event.altKey,
|
581
581
|
// right ALT in some systems triggers ALT+CTRL
|
@@ -1198,16 +1198,5 @@ class MergeCells extends _base.BasePlugin {
|
|
1198
1198
|
}
|
1199
1199
|
return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel);
|
1200
1200
|
}
|
1201
|
-
|
1202
|
-
/**
|
1203
|
-
* `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table.
|
1204
|
-
*
|
1205
|
-
* @private
|
1206
|
-
* @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from
|
1207
|
-
* all the cells in the table.
|
1208
|
-
*/
|
1209
|
-
onBeforeRemoveCellClassNames() {
|
1210
|
-
return this.selectionCalculations.getSelectedMergedCellClassNameToRemove();
|
1211
|
-
}
|
1212
1201
|
}
|
1213
1202
|
exports.MergeCells = MergeCells;
|
@@ -182,9 +182,6 @@ export class MergeCells extends BasePlugin {
|
|
182
182
|
this.addHook('afterDrawSelection', function () {
|
183
183
|
return _this.onAfterDrawSelection(...arguments);
|
184
184
|
});
|
185
|
-
this.addHook('beforeRemoveCellClassNames', function () {
|
186
|
-
return _this.onBeforeRemoveCellClassNames(...arguments);
|
187
|
-
});
|
188
185
|
this.addHook('beforeUndoStackChange', (action, source) => {
|
189
186
|
if (source === 'MergeCells') {
|
190
187
|
return false;
|
@@ -568,8 +565,11 @@ export class MergeCells extends BasePlugin {
|
|
568
565
|
gridContext.addShortcut({
|
569
566
|
keys: [['Control', 'm']],
|
570
567
|
callback: () => {
|
571
|
-
this.
|
572
|
-
|
568
|
+
const range = this.hot.getSelectedRangeLast();
|
569
|
+
if (range && !range.isSingleHeader()) {
|
570
|
+
this.toggleMerge(range);
|
571
|
+
this.hot.render();
|
572
|
+
}
|
573
573
|
},
|
574
574
|
runOnlyIf: event => !event.altKey,
|
575
575
|
// right ALT in some systems triggers ALT+CTRL
|
@@ -1192,15 +1192,4 @@ export class MergeCells extends BasePlugin {
|
|
1192
1192
|
}
|
1193
1193
|
return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel);
|
1194
1194
|
}
|
1195
|
-
|
1196
|
-
/**
|
1197
|
-
* `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table.
|
1198
|
-
*
|
1199
|
-
* @private
|
1200
|
-
* @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from
|
1201
|
-
* all the cells in the table.
|
1202
|
-
*/
|
1203
|
-
onBeforeRemoveCellClassNames() {
|
1204
|
-
return this.selectionCalculations.getSelectedMergedCellClassNameToRemove();
|
1205
|
-
}
|
1206
1195
|
}
|
@@ -12,8 +12,8 @@ const PLUGIN_KEY = 'multiColumnSorting';
|
|
12
12
|
exports.PLUGIN_KEY = PLUGIN_KEY;
|
13
13
|
const PLUGIN_PRIORITY = 170;
|
14
14
|
exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
|
15
|
-
const APPEND_COLUMN_CONFIG_STRATEGY = 'append';
|
16
15
|
const CONFLICTED_PLUGIN_KEY = 'columnSorting';
|
16
|
+
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
17
17
|
(0, _sortService.registerRootComparator)(PLUGIN_KEY, _rootComparator.rootComparator);
|
18
18
|
|
19
19
|
/**
|
@@ -113,6 +113,41 @@ class MultiColumnSorting extends _columnSorting.ColumnSorting {
|
|
113
113
|
super.disablePlugin();
|
114
114
|
}
|
115
115
|
|
116
|
+
/**
|
117
|
+
* Register shortcuts responsible for toggling column sorting functionality.
|
118
|
+
*
|
119
|
+
* @private
|
120
|
+
*/
|
121
|
+
registerShortcuts() {
|
122
|
+
super.registerShortcuts();
|
123
|
+
this.hot.getShortcutManager().getContext('grid').addShortcut({
|
124
|
+
keys: [['Control/Meta', 'Enter']],
|
125
|
+
callback: () => {
|
126
|
+
const {
|
127
|
+
highlight
|
128
|
+
} = this.hot.getSelectedRangeLast();
|
129
|
+
if (highlight.row === -1 && highlight.col >= 0) {
|
130
|
+
this.sort(this.getNextSortConfig(highlight.col, _columnSorting.APPEND_COLUMN_CONFIG_STRATEGY));
|
131
|
+
}
|
132
|
+
},
|
133
|
+
runOnlyIf: () => {
|
134
|
+
var _this$hot$getSelected;
|
135
|
+
return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
|
136
|
+
},
|
137
|
+
group: SHORTCUTS_GROUP
|
138
|
+
});
|
139
|
+
}
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Unregister shortcuts responsible for toggling column sorting functionality.
|
143
|
+
*
|
144
|
+
* @private
|
145
|
+
*/
|
146
|
+
unregisterShortcuts() {
|
147
|
+
super.unregisterShortcuts();
|
148
|
+
this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
|
149
|
+
}
|
150
|
+
|
116
151
|
/**
|
117
152
|
* Sorts the table by chosen columns and orders.
|
118
153
|
*
|
@@ -262,7 +297,7 @@ class MultiColumnSorting extends _columnSorting.ColumnSorting {
|
|
262
297
|
if (this.hot.getShortcutManager().isCtrlPressed()) {
|
263
298
|
this.hot.deselectCell();
|
264
299
|
this.hot.selectColumns(coords.col);
|
265
|
-
this.sort(this.getNextSortConfig(coords.col, APPEND_COLUMN_CONFIG_STRATEGY));
|
300
|
+
this.sort(this.getNextSortConfig(coords.col, _columnSorting.APPEND_COLUMN_CONFIG_STRATEGY));
|
266
301
|
} else {
|
267
302
|
this.sort(this.getColumnNextConfig(coords.col));
|
268
303
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ColumnSorting } from "../columnSorting/index.mjs";
|
1
|
+
import { APPEND_COLUMN_CONFIG_STRATEGY, ColumnSorting } from "../columnSorting/index.mjs";
|
2
2
|
import { registerRootComparator } from "../columnSorting/sortService/index.mjs";
|
3
3
|
import { wasHeaderClickedProperly } from "../columnSorting/utils.mjs";
|
4
4
|
import { addClass, removeClass } from "../../helpers/dom/element.mjs";
|
@@ -7,8 +7,8 @@ import { warnAboutPluginsConflict } from "./utils.mjs";
|
|
7
7
|
import { getClassesToAdd, getClassesToRemove } from "./domHelpers.mjs";
|
8
8
|
export const PLUGIN_KEY = 'multiColumnSorting';
|
9
9
|
export const PLUGIN_PRIORITY = 170;
|
10
|
-
const APPEND_COLUMN_CONFIG_STRATEGY = 'append';
|
11
10
|
const CONFLICTED_PLUGIN_KEY = 'columnSorting';
|
11
|
+
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
12
12
|
registerRootComparator(PLUGIN_KEY, rootComparator);
|
13
13
|
|
14
14
|
/**
|
@@ -108,6 +108,41 @@ export class MultiColumnSorting extends ColumnSorting {
|
|
108
108
|
super.disablePlugin();
|
109
109
|
}
|
110
110
|
|
111
|
+
/**
|
112
|
+
* Register shortcuts responsible for toggling column sorting functionality.
|
113
|
+
*
|
114
|
+
* @private
|
115
|
+
*/
|
116
|
+
registerShortcuts() {
|
117
|
+
super.registerShortcuts();
|
118
|
+
this.hot.getShortcutManager().getContext('grid').addShortcut({
|
119
|
+
keys: [['Control/Meta', 'Enter']],
|
120
|
+
callback: () => {
|
121
|
+
const {
|
122
|
+
highlight
|
123
|
+
} = this.hot.getSelectedRangeLast();
|
124
|
+
if (highlight.row === -1 && highlight.col >= 0) {
|
125
|
+
this.sort(this.getNextSortConfig(highlight.col, APPEND_COLUMN_CONFIG_STRATEGY));
|
126
|
+
}
|
127
|
+
},
|
128
|
+
runOnlyIf: () => {
|
129
|
+
var _this$hot$getSelected;
|
130
|
+
return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
|
131
|
+
},
|
132
|
+
group: SHORTCUTS_GROUP
|
133
|
+
});
|
134
|
+
}
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Unregister shortcuts responsible for toggling column sorting functionality.
|
138
|
+
*
|
139
|
+
* @private
|
140
|
+
*/
|
141
|
+
unregisterShortcuts() {
|
142
|
+
super.unregisterShortcuts();
|
143
|
+
this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
|
144
|
+
}
|
145
|
+
|
111
146
|
/**
|
112
147
|
* Sorts the table by chosen columns and orders.
|
113
148
|
*
|
@@ -5,8 +5,8 @@ exports.__esModule = true;
|
|
5
5
|
require("core-js/modules/es.array.push.js");
|
6
6
|
var _element = require("../../helpers/dom/element");
|
7
7
|
var _number = require("../../helpers/number");
|
8
|
-
var _event = require("../../helpers/dom/event");
|
9
8
|
var _templateLiteralTag = require("../../helpers/templateLiteralTag");
|
9
|
+
var _event = require("../../helpers/dom/event");
|
10
10
|
var _console = require("../../helpers/console");
|
11
11
|
var _selection = require("../../selection");
|
12
12
|
var _base = require("../base");
|
@@ -158,6 +158,10 @@ class NestedHeaders extends _base.BasePlugin {
|
|
158
158
|
this.addHook('beforeOnCellMouseOver', function () {
|
159
159
|
return _this.onBeforeOnCellMouseOver(...arguments);
|
160
160
|
});
|
161
|
+
this.addHook('modifyTransformStart', function () {
|
162
|
+
return _this.onModifyTransformStart(...arguments);
|
163
|
+
});
|
164
|
+
this.addHook('afterSelection', () => this.updateFocusHighlightPosition());
|
161
165
|
this.addHook('afterGetColumnHeaderRenderers', array => this.onAfterGetColumnHeaderRenderers(array));
|
162
166
|
this.addHook('modifyColWidth', function () {
|
163
167
|
return _this.onModifyColWidth(...arguments);
|
@@ -171,9 +175,14 @@ class NestedHeaders extends _base.BasePlugin {
|
|
171
175
|
this.addHook('beforeCopy', function () {
|
172
176
|
return _this.onBeforeCopy(...arguments);
|
173
177
|
});
|
178
|
+
this.addHook('beforeSelectColumns', function () {
|
179
|
+
return _this.onBeforeSelectColumns(...arguments);
|
180
|
+
});
|
174
181
|
this.addHook('afterViewportColumnCalculatorOverride', function () {
|
175
182
|
return _this.onAfterViewportColumnCalculatorOverride(...arguments);
|
176
183
|
});
|
184
|
+
this.hot.columnIndexMapper.addLocalHook('cacheUpdated', () => this.updateFocusHighlightPosition());
|
185
|
+
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', () => this.updateFocusHighlightPosition());
|
177
186
|
super.enablePlugin();
|
178
187
|
this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
|
179
188
|
}
|
@@ -389,6 +398,34 @@ class NestedHeaders extends _base.BasePlugin {
|
|
389
398
|
return this.hot.getColHeader(visualColumnIndex, headerLevel);
|
390
399
|
}
|
391
400
|
|
401
|
+
/**
|
402
|
+
* Updates the selection focus highlight position to point to the nested header root element (TH)
|
403
|
+
* even when the logical coordinates point in-between the header.
|
404
|
+
*
|
405
|
+
* @private
|
406
|
+
*/
|
407
|
+
updateFocusHighlightPosition() {
|
408
|
+
var _this$hot;
|
409
|
+
const selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeLast();
|
410
|
+
if (!selection) {
|
411
|
+
return;
|
412
|
+
}
|
413
|
+
const {
|
414
|
+
highlight
|
415
|
+
} = selection;
|
416
|
+
const isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
|
417
|
+
if (isNestedHeadersRange) {
|
418
|
+
const columnIndex = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(highlight.row, highlight.col);
|
419
|
+
const focusHighlight = this.hot.selection.highlight.getFocus();
|
420
|
+
|
421
|
+
// Correct the highlight/focus selection to highlight the correct TH element
|
422
|
+
focusHighlight.visualCellRange.highlight.col = columnIndex;
|
423
|
+
focusHighlight.visualCellRange.from.col = columnIndex;
|
424
|
+
focusHighlight.visualCellRange.to.col = columnIndex;
|
425
|
+
focusHighlight.commit();
|
426
|
+
}
|
427
|
+
}
|
428
|
+
|
392
429
|
/**
|
393
430
|
* Allows to control which header DOM element will be used to highlight.
|
394
431
|
*
|
@@ -404,7 +441,6 @@ class NestedHeaders extends _base.BasePlugin {
|
|
404
441
|
return visualColumn;
|
405
442
|
}
|
406
443
|
const {
|
407
|
-
classNames,
|
408
444
|
columnCursor,
|
409
445
|
selectionType,
|
410
446
|
selectionWidth
|
@@ -419,8 +455,8 @@ class NestedHeaders extends _base.BasePlugin {
|
|
419
455
|
}
|
420
456
|
} else if (selectionType === _selection.ACTIVE_HEADER_TYPE) {
|
421
457
|
if (colspan > selectionWidth - columnCursor || !isRoot) {
|
422
|
-
//
|
423
|
-
|
458
|
+
// Prevents adding any CSS class names to the TH element
|
459
|
+
return null;
|
424
460
|
}
|
425
461
|
}
|
426
462
|
return visualColumn;
|
@@ -574,13 +610,90 @@ class NestedHeaders extends _base.BasePlugin {
|
|
574
610
|
controller.cell = true;
|
575
611
|
const columnsToSelect = [];
|
576
612
|
if (coords.col < from.col) {
|
577
|
-
columnsToSelect.push(bottomEndCoords.col, columnIndex);
|
613
|
+
columnsToSelect.push(bottomEndCoords.col, columnIndex, coords.row);
|
578
614
|
} else if (coords.col > from.col) {
|
579
|
-
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1);
|
615
|
+
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1, coords.row);
|
580
616
|
} else {
|
581
|
-
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1);
|
617
|
+
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1, coords.row);
|
618
|
+
}
|
619
|
+
this.hot.selection.selectColumns(...columnsToSelect);
|
620
|
+
}
|
621
|
+
|
622
|
+
/**
|
623
|
+
* `modifyTransformStart` hook is called every time the keyboard navigation is used.
|
624
|
+
*
|
625
|
+
* @private
|
626
|
+
* @param {object} delta The transformation delta.
|
627
|
+
*/
|
628
|
+
onModifyTransformStart(delta) {
|
629
|
+
const {
|
630
|
+
highlight
|
631
|
+
} = this.hot.getSelectedRangeLast();
|
632
|
+
const nextCoords = this.hot._createCellCoords(highlight.row + delta.row, highlight.col + delta.col);
|
633
|
+
const isNestedHeadersRange = nextCoords.isHeader() && nextCoords.col >= 0;
|
634
|
+
if (!isNestedHeadersRange) {
|
635
|
+
return;
|
636
|
+
}
|
637
|
+
const visualColumnIndexStart = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(nextCoords.row, nextCoords.col);
|
638
|
+
const visualColumnIndexEnd = _classPrivateFieldGet(this, _stateManager).findRightMostColumnIndex(nextCoords.row, nextCoords.col);
|
639
|
+
if (delta.col < 0) {
|
640
|
+
const nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexStart - 1 : visualColumnIndexEnd;
|
641
|
+
const notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, -1);
|
642
|
+
if (notHiddenColumnIndex === null) {
|
643
|
+
// There are no visible columns anymore, so move the selection out of the table edge. This will
|
644
|
+
// be processed by the selection Transformer class as a move selection to the previous row (if autoWrapRow is enabled).
|
645
|
+
delta.col = -this.hot.view.countRenderableColumnsInRange(0, highlight.col);
|
646
|
+
} else {
|
647
|
+
delta.col = -Math.max(this.hot.view.countRenderableColumnsInRange(notHiddenColumnIndex, highlight.col) - 1, 1);
|
648
|
+
}
|
649
|
+
} else if (delta.col > 0) {
|
650
|
+
const nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexEnd + 1 : visualColumnIndexStart;
|
651
|
+
const notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, 1);
|
652
|
+
if (notHiddenColumnIndex === null) {
|
653
|
+
// There are no visible columns anymore, so move the selection out of the table edge. This will
|
654
|
+
// be processed by the selection Transformer class as a move selection to the next row (if autoWrapRow is enabled).
|
655
|
+
delta.col = this.hot.view.countRenderableColumnsInRange(highlight.col, this.hot.countCols());
|
656
|
+
} else {
|
657
|
+
delta.col = Math.max(this.hot.view.countRenderableColumnsInRange(highlight.col, notHiddenColumnIndex) - 1, 1);
|
658
|
+
}
|
659
|
+
}
|
660
|
+
}
|
661
|
+
|
662
|
+
/**
|
663
|
+
* The hook observes the column selection from the Selection API and modifies the column range to
|
664
|
+
* ensure that the whole nested column will be covered.
|
665
|
+
*
|
666
|
+
* @private
|
667
|
+
* @param {*} from The coords object where the selection starts.
|
668
|
+
* @param {*} to The coords object where the selection ends.
|
669
|
+
*/
|
670
|
+
onBeforeSelectColumns(from, to) {
|
671
|
+
const headerLevel = from.row;
|
672
|
+
const startNodeData = this._getHeaderTreeNodeDataByCoords({
|
673
|
+
row: headerLevel,
|
674
|
+
col: from.col
|
675
|
+
});
|
676
|
+
const endNodeData = this._getHeaderTreeNodeDataByCoords({
|
677
|
+
row: headerLevel,
|
678
|
+
col: to.col
|
679
|
+
});
|
680
|
+
if (to.col < from.col) {
|
681
|
+
// Column selection from right to left
|
682
|
+
if (startNodeData) {
|
683
|
+
from.col = startNodeData.columnIndex + startNodeData.origColspan - 1;
|
684
|
+
}
|
685
|
+
if (endNodeData) {
|
686
|
+
to.col = endNodeData.columnIndex;
|
687
|
+
}
|
688
|
+
} else if (to.col >= from.col) {
|
689
|
+
// Column selection from left to right or a single column selection
|
690
|
+
if (startNodeData) {
|
691
|
+
from.col = startNodeData.columnIndex;
|
692
|
+
}
|
693
|
+
if (endNodeData) {
|
694
|
+
to.col = endNodeData.columnIndex + endNodeData.origColspan - 1;
|
695
|
+
}
|
582
696
|
}
|
583
|
-
this.hot.selectColumns(...columnsToSelect);
|
584
697
|
}
|
585
698
|
|
586
699
|
/**
|