handsontable 0.0.0-next-08765b9-20230809 → 0.0.0-next-912c214-20230818
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 +5589 -8684
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +25 -25
- package/dist/handsontable.js +8036 -11131
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +19 -19
- 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
@@ -50,8 +50,8 @@ class WalkontableFacade {
|
|
50
50
|
return this._wot.cloneOverlay; // todo create facade
|
51
51
|
}
|
52
52
|
|
53
|
-
get
|
54
|
-
return this._wot.
|
53
|
+
get selections() {
|
54
|
+
return this._wot.selections; // todo create facade
|
55
55
|
}
|
56
56
|
|
57
57
|
get wtViewport() {
|
@@ -46,8 +46,8 @@ export default class WalkontableFacade {
|
|
46
46
|
return this._wot.cloneOverlay; // todo create facade
|
47
47
|
}
|
48
48
|
|
49
|
-
get
|
50
|
-
return this._wot.
|
49
|
+
get selections() {
|
50
|
+
return this._wot.selections; // todo create facade
|
51
51
|
}
|
52
52
|
|
53
53
|
get wtViewport() {
|
@@ -12,16 +12,8 @@ exports.CellRange = _range.default;
|
|
12
12
|
var _core = _interopRequireDefault(require("./facade/core"));
|
13
13
|
exports.default = _core.default;
|
14
14
|
exports.Core = _core.default;
|
15
|
-
var _selection = require("./selection");
|
16
|
-
exports.Selection = _selection.
|
17
|
-
exports.HIGHLIGHT_ACTIVE_HEADER_TYPE = _selection.ACTIVE_HEADER_TYPE;
|
18
|
-
exports.HIGHLIGHT_AREA_TYPE = _selection.AREA_TYPE;
|
19
|
-
exports.HIGHLIGHT_FOCUS_TYPE = _selection.FOCUS_TYPE;
|
20
|
-
exports.HIGHLIGHT_FILL_TYPE = _selection.FILL_TYPE;
|
21
|
-
exports.HIGHLIGHT_HEADER_TYPE = _selection.HEADER_TYPE;
|
22
|
-
exports.HIGHLIGHT_ROW_TYPE = _selection.ROW_TYPE;
|
23
|
-
exports.HIGHLIGHT_COLUMN_TYPE = _selection.COLUMN_TYPE;
|
24
|
-
exports.HIGHLIGHT_CUSTOM_SELECTION_TYPE = _selection.CUSTOM_SELECTION_TYPE;
|
15
|
+
var _selection = _interopRequireDefault(require("./selection"));
|
16
|
+
exports.Selection = _selection.default;
|
25
17
|
var Renderer = _interopRequireWildcard(require("./renderer"));
|
26
18
|
exports.Renderer = Renderer;
|
27
19
|
var _orderView = require("./utils/orderView");
|
@@ -3,8 +3,8 @@ import ViewportRowsCalculator from "./calculator/viewportRows.mjs";
|
|
3
3
|
import CellCoords from "./cell/coords.mjs";
|
4
4
|
import CellRange from "./cell/range.mjs";
|
5
5
|
import Walkontable from "./facade/core.mjs";
|
6
|
-
import
|
6
|
+
import Selection from "./selection.mjs";
|
7
7
|
import * as Renderer from "./renderer/index.mjs";
|
8
8
|
import { OrderView, SharedOrderView } from "./utils/orderView/index.mjs";
|
9
9
|
import { getListenersCounter } from "../../../eventManager.mjs";
|
10
|
-
export { ViewportColumnsCalculator, ViewportRowsCalculator, CellCoords, CellRange, Walkontable as default, Walkontable as Core, Selection,
|
10
|
+
export { ViewportColumnsCalculator, ViewportRowsCalculator, CellCoords, CellRange, Walkontable as default, Walkontable as Core, Selection, Renderer, OrderView, SharedOrderView, getListenersCounter };
|
@@ -281,7 +281,7 @@ class Overlay {
|
|
281
281
|
// todo ioc , or factor func if used only here
|
282
282
|
event: this.wot.wtEvent,
|
283
283
|
// todo ioc , or factory func if used only here
|
284
|
-
|
284
|
+
selections: this.wot.selections // todo ioc , or factory func if used only here
|
285
285
|
});
|
286
286
|
}
|
287
287
|
|
@@ -277,7 +277,7 @@ export class Overlay {
|
|
277
277
|
// todo ioc , or factor func if used only here
|
278
278
|
event: this.wot.wtEvent,
|
279
279
|
// todo ioc , or factory func if used only here
|
280
|
-
|
280
|
+
selections: this.wot.selections // todo ioc , or factory func if used only here
|
281
281
|
});
|
282
282
|
}
|
283
283
|
|
@@ -5,7 +5,6 @@ require("core-js/modules/es.error.cause.js");
|
|
5
5
|
var _element = require("../../../../helpers/dom/element");
|
6
6
|
var _inlineStart = _interopRequireDefault(require("../table/inlineStart"));
|
7
7
|
var _base = require("./_base");
|
8
|
-
var _selection = require("../selection");
|
9
8
|
var _constants = require("./constants");
|
10
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
10
|
/**
|
@@ -173,10 +172,15 @@ class InlineStartOverlay extends _base.Overlay {
|
|
173
172
|
* Adjust overlay root childs size.
|
174
173
|
*/
|
175
174
|
adjustRootChildrenSize() {
|
175
|
+
var _selections$getCell$g;
|
176
176
|
const {
|
177
177
|
holder
|
178
178
|
} = this.clone.wtTable;
|
179
|
-
const
|
179
|
+
const {
|
180
|
+
selections
|
181
|
+
} = this.wot;
|
182
|
+
const facade = this.facadeGetter();
|
183
|
+
const selectionCornerOffset = Math.abs((_selections$getCell$g = selections === null || selections === void 0 ? void 0 : selections.getCell().getBorder(facade).cornerCenterPointOffset) !== null && _selections$getCell$g !== void 0 ? _selections$getCell$g : 0);
|
180
184
|
this.clone.wtTable.hider.style.height = this.hider.style.height;
|
181
185
|
holder.style.height = holder.parentNode.style.height;
|
182
186
|
// Add selection corner protruding part to the holder total width to make sure that
|
@@ -2,7 +2,6 @@ import "core-js/modules/es.error.cause.js";
|
|
2
2
|
import { addClass, getScrollbarWidth, getScrollLeft, getWindowScrollTop, hasClass, outerWidth, removeClass, setOverlayPosition, resetCssTransform } from "../../../../helpers/dom/element.mjs";
|
3
3
|
import InlineStartOverlayTable from "../table/inlineStart.mjs";
|
4
4
|
import { Overlay } from "./_base.mjs";
|
5
|
-
import { CORNER_DEFAULT_STYLE } from "../selection/index.mjs";
|
6
5
|
import { CLONE_INLINE_START } from "./constants.mjs";
|
7
6
|
/**
|
8
7
|
* @class InlineStartOverlay
|
@@ -169,10 +168,15 @@ export class InlineStartOverlay extends Overlay {
|
|
169
168
|
* Adjust overlay root childs size.
|
170
169
|
*/
|
171
170
|
adjustRootChildrenSize() {
|
171
|
+
var _selections$getCell$g;
|
172
172
|
const {
|
173
173
|
holder
|
174
174
|
} = this.clone.wtTable;
|
175
|
-
const
|
175
|
+
const {
|
176
|
+
selections
|
177
|
+
} = this.wot;
|
178
|
+
const facade = this.facadeGetter();
|
179
|
+
const selectionCornerOffset = Math.abs((_selections$getCell$g = selections === null || selections === void 0 ? void 0 : selections.getCell().getBorder(facade).cornerCenterPointOffset) !== null && _selections$getCell$g !== void 0 ? _selections$getCell$g : 0);
|
176
180
|
this.clone.wtTable.hider.style.height = this.hider.style.height;
|
177
181
|
holder.style.height = holder.parentNode.style.height;
|
178
182
|
// Add selection corner protruding part to the holder total width to make sure that
|
@@ -5,7 +5,6 @@ require("core-js/modules/es.error.cause.js");
|
|
5
5
|
var _element = require("../../../../helpers/dom/element");
|
6
6
|
var _top = _interopRequireDefault(require("./../table/top"));
|
7
7
|
var _base = require("./_base");
|
8
|
-
var _selection = require("../selection");
|
9
8
|
var _constants = require("./constants");
|
10
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
10
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
@@ -200,10 +199,15 @@ class TopOverlay extends _base.Overlay {
|
|
200
199
|
* Adjust overlay root childs size.
|
201
200
|
*/
|
202
201
|
adjustRootChildrenSize() {
|
202
|
+
var _selections$getCell$g;
|
203
203
|
const {
|
204
204
|
holder
|
205
205
|
} = this.clone.wtTable;
|
206
|
-
const
|
206
|
+
const {
|
207
|
+
selections
|
208
|
+
} = this.wot;
|
209
|
+
const facade = this.facadeGetter();
|
210
|
+
const selectionCornerOffset = Math.abs((_selections$getCell$g = selections === null || selections === void 0 ? void 0 : selections.getCell().getBorder(facade).cornerCenterPointOffset) !== null && _selections$getCell$g !== void 0 ? _selections$getCell$g : 0);
|
207
211
|
this.clone.wtTable.hider.style.width = this.hider.style.width;
|
208
212
|
holder.style.width = holder.parentNode.style.width;
|
209
213
|
// Add selection corner protruding part to the holder total height to make sure that
|
@@ -5,7 +5,6 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
5
5
|
import { addClass, getScrollbarWidth, getScrollTop, getWindowScrollLeft, hasClass, outerHeight, removeClass, setOverlayPosition, resetCssTransform } from "../../../../helpers/dom/element.mjs";
|
6
6
|
import TopOverlayTable from "./../table/top.mjs";
|
7
7
|
import { Overlay } from "./_base.mjs";
|
8
|
-
import { CORNER_DEFAULT_STYLE } from "../selection/index.mjs";
|
9
8
|
import { CLONE_TOP } from "./constants.mjs";
|
10
9
|
/**
|
11
10
|
* @class TopOverlay
|
@@ -196,10 +195,15 @@ export class TopOverlay extends Overlay {
|
|
196
195
|
* Adjust overlay root childs size.
|
197
196
|
*/
|
198
197
|
adjustRootChildrenSize() {
|
198
|
+
var _selections$getCell$g;
|
199
199
|
const {
|
200
200
|
holder
|
201
201
|
} = this.clone.wtTable;
|
202
|
-
const
|
202
|
+
const {
|
203
|
+
selections
|
204
|
+
} = this.wot;
|
205
|
+
const facade = this.facadeGetter();
|
206
|
+
const selectionCornerOffset = Math.abs((_selections$getCell$g = selections === null || selections === void 0 ? void 0 : selections.getCell().getBorder(facade).cornerCenterPointOffset) !== null && _selections$getCell$g !== void 0 ? _selections$getCell$g : 0);
|
203
207
|
this.clone.wtTable.hider.style.width = this.hider.style.width;
|
204
208
|
holder.style.width = holder.parentNode.style.width;
|
205
209
|
// Add selection corner protruding part to the holder total height to make sure that
|
@@ -0,0 +1,295 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.array.push.js");
|
5
|
+
var _element = require("./../../../helpers/dom/element");
|
6
|
+
var _border = _interopRequireDefault(require("./border"));
|
7
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
+
/**
|
9
|
+
* @class Selection
|
10
|
+
*/
|
11
|
+
class Selection {
|
12
|
+
/**
|
13
|
+
* @param {object} settings The selection settings object. @todo type.
|
14
|
+
* @param {CellRange} cellRange The cell range instance.
|
15
|
+
*/
|
16
|
+
constructor(settings, cellRange) {
|
17
|
+
this.settings = settings;
|
18
|
+
this.cellRange = cellRange || null;
|
19
|
+
this.instanceBorders = {};
|
20
|
+
this.classNames = [this.settings.className];
|
21
|
+
this.classNameGenerator = this.linearClassNameGenerator(this.settings.className, this.settings.layerLevel);
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Each Walkontable clone requires it's own border for every selection. This method creates and returns selection
|
26
|
+
* borders per instance.
|
27
|
+
*
|
28
|
+
* @param {WalkontableFacade} wotInstance The Walkontable instance.
|
29
|
+
* @returns {Border}
|
30
|
+
*/
|
31
|
+
getBorder(wotInstance) {
|
32
|
+
if (!this.instanceBorders[wotInstance.guid]) {
|
33
|
+
this.instanceBorders[wotInstance.guid] = new _border.default(wotInstance, this.settings);
|
34
|
+
}
|
35
|
+
return this.instanceBorders[wotInstance.guid];
|
36
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Checks if selection is empty.
|
40
|
+
*
|
41
|
+
* @returns {boolean}
|
42
|
+
*/
|
43
|
+
isEmpty() {
|
44
|
+
return this.cellRange === null;
|
45
|
+
}
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Adds a cell coords to the selection.
|
49
|
+
*
|
50
|
+
* @param {CellCoords} coords The cell coordinates to add.
|
51
|
+
* @returns {Selection}
|
52
|
+
*/
|
53
|
+
add(coords) {
|
54
|
+
if (this.isEmpty()) {
|
55
|
+
this.cellRange = this.settings.createCellRange(coords);
|
56
|
+
} else {
|
57
|
+
this.cellRange.expand(coords);
|
58
|
+
}
|
59
|
+
return this;
|
60
|
+
}
|
61
|
+
|
62
|
+
/**
|
63
|
+
* If selection range from or to property equals oldCoords, replace it with newCoords. Return boolean
|
64
|
+
* information about success.
|
65
|
+
*
|
66
|
+
* @param {CellCoords} oldCoords An old cell coordinates to replace.
|
67
|
+
* @param {CellCoords} newCoords The new cell coordinates.
|
68
|
+
* @returns {boolean}
|
69
|
+
*/
|
70
|
+
replace(oldCoords, newCoords) {
|
71
|
+
if (!this.isEmpty()) {
|
72
|
+
if (this.cellRange.from.isEqual(oldCoords)) {
|
73
|
+
this.cellRange.from = newCoords;
|
74
|
+
return true;
|
75
|
+
}
|
76
|
+
if (this.cellRange.to.isEqual(oldCoords)) {
|
77
|
+
this.cellRange.to = newCoords;
|
78
|
+
return true;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
return false;
|
82
|
+
}
|
83
|
+
|
84
|
+
/**
|
85
|
+
* Clears selection.
|
86
|
+
*
|
87
|
+
* @returns {Selection}
|
88
|
+
*/
|
89
|
+
clear() {
|
90
|
+
this.cellRange = null;
|
91
|
+
return this;
|
92
|
+
}
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Returns the top left (or top right in RTL) and bottom right (or bottom left in RTL) selection coordinates.
|
96
|
+
*
|
97
|
+
* @returns {Array} Returns array of coordinates for example `[1, 1, 5, 5]`.
|
98
|
+
*/
|
99
|
+
getCorners() {
|
100
|
+
const topStart = this.cellRange.getOuterTopStartCorner();
|
101
|
+
const bottomEnd = this.cellRange.getOuterBottomEndCorner();
|
102
|
+
return [topStart.row, topStart.col, bottomEnd.row, bottomEnd.col];
|
103
|
+
}
|
104
|
+
|
105
|
+
/**
|
106
|
+
* Adds class name to cell element at given coords.
|
107
|
+
*
|
108
|
+
* @param {WalkontableFacade} wotInstance Walkontable instance.
|
109
|
+
* @param {number} sourceRow Cell row coord.
|
110
|
+
* @param {number} sourceColumn Cell column coord.
|
111
|
+
* @param {string} className Class name.
|
112
|
+
* @param {boolean} [markIntersections=false] If `true`, linear className generator will be used to add CSS classes
|
113
|
+
* in a continuous way.
|
114
|
+
* @returns {Selection}
|
115
|
+
*/
|
116
|
+
addClassAtCoords(wotInstance, sourceRow, sourceColumn, className) {
|
117
|
+
let markIntersections = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
118
|
+
const TD = wotInstance.wtTable.getCell(this.settings.createCellCoords(sourceRow, sourceColumn));
|
119
|
+
if (typeof TD === 'object') {
|
120
|
+
let cellClassName = className;
|
121
|
+
if (markIntersections) {
|
122
|
+
cellClassName = this.classNameGenerator(TD);
|
123
|
+
if (!this.classNames.includes(cellClassName)) {
|
124
|
+
this.classNames.push(cellClassName);
|
125
|
+
}
|
126
|
+
}
|
127
|
+
(0, _element.addClass)(TD, cellClassName);
|
128
|
+
}
|
129
|
+
return this;
|
130
|
+
}
|
131
|
+
|
132
|
+
/**
|
133
|
+
* Generate helper for calculating classNames based on previously added base className.
|
134
|
+
* The generated className is always generated as a continuation of the previous className. For example, when
|
135
|
+
* the currently checked element has 'area-2' className the generated new className will be 'area-3'. When
|
136
|
+
* the element doesn't have any classNames than the base className will be returned ('area');.
|
137
|
+
*
|
138
|
+
* @param {string} baseClassName Base className to be used.
|
139
|
+
* @param {number} layerLevelOwner Layer level which the instance of the Selection belongs to.
|
140
|
+
* @returns {Function}
|
141
|
+
*/
|
142
|
+
linearClassNameGenerator(baseClassName, layerLevelOwner) {
|
143
|
+
// TODO: Make this recursive function Proper Tail Calls (TCO/PTC) friendly.
|
144
|
+
return function calcClassName(element) {
|
145
|
+
let previousIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
|
146
|
+
if (layerLevelOwner === 0 || previousIndex === 0) {
|
147
|
+
return baseClassName;
|
148
|
+
}
|
149
|
+
let index = previousIndex >= 0 ? previousIndex : layerLevelOwner;
|
150
|
+
let className = baseClassName;
|
151
|
+
index -= 1;
|
152
|
+
const previousClassName = index === 0 ? baseClassName : `${baseClassName}-${index}`;
|
153
|
+
if ((0, _element.hasClass)(element, previousClassName)) {
|
154
|
+
const currentLayer = index + 1;
|
155
|
+
className = `${baseClassName}-${currentLayer}`;
|
156
|
+
} else {
|
157
|
+
className = calcClassName(element, index);
|
158
|
+
}
|
159
|
+
return className;
|
160
|
+
};
|
161
|
+
}
|
162
|
+
|
163
|
+
/**
|
164
|
+
* @param {WalkontableFacade} wotInstance The Walkontable instance.
|
165
|
+
*/
|
166
|
+
draw(wotInstance) {
|
167
|
+
if (this.isEmpty()) {
|
168
|
+
if (this.settings.border) {
|
169
|
+
this.getBorder(wotInstance).disappear();
|
170
|
+
}
|
171
|
+
return;
|
172
|
+
}
|
173
|
+
const renderedRows = wotInstance.wtTable.getRenderedRowsCount();
|
174
|
+
const renderedColumns = wotInstance.wtTable.getRenderedColumnsCount();
|
175
|
+
const corners = this.getCorners();
|
176
|
+
const [topRow, topColumn, bottomRow, bottomColumn] = corners;
|
177
|
+
const {
|
178
|
+
highlightHeaderClassName,
|
179
|
+
highlightColumnClassName,
|
180
|
+
highlightRowClassName,
|
181
|
+
highlightOnlyClosestHeader,
|
182
|
+
selectionType
|
183
|
+
} = this.settings;
|
184
|
+
const isHeaderSelectionType = selectionType === void 0 || ['active-header', 'header'].includes(selectionType);
|
185
|
+
if (isHeaderSelectionType && topColumn !== null && bottomColumn !== null) {
|
186
|
+
let selectionColumnCursor = 0;
|
187
|
+
for (let column = 0; column < renderedColumns; column += 1) {
|
188
|
+
const sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column);
|
189
|
+
if (sourceCol >= topColumn && sourceCol <= bottomColumn) {
|
190
|
+
let THs = wotInstance.wtTable.getColumnHeaders(sourceCol);
|
191
|
+
const closestHeaderLevel = THs.length - 1;
|
192
|
+
if (highlightOnlyClosestHeader && THs.length > 1) {
|
193
|
+
THs = [THs[closestHeaderLevel]];
|
194
|
+
}
|
195
|
+
for (let headerLevel = 0; headerLevel < THs.length; headerLevel += 1) {
|
196
|
+
const newClasses = [];
|
197
|
+
let TH = THs[headerLevel];
|
198
|
+
if (highlightHeaderClassName) {
|
199
|
+
newClasses.push(highlightHeaderClassName);
|
200
|
+
}
|
201
|
+
if (highlightColumnClassName) {
|
202
|
+
newClasses.push(highlightColumnClassName);
|
203
|
+
}
|
204
|
+
headerLevel = highlightOnlyClosestHeader ? closestHeaderLevel : headerLevel;
|
205
|
+
const newSourceCol = wotInstance.getSetting('onBeforeHighlightingColumnHeader', sourceCol, headerLevel, {
|
206
|
+
selectionType,
|
207
|
+
columnCursor: selectionColumnCursor,
|
208
|
+
selectionWidth: bottomColumn - topColumn + 1,
|
209
|
+
classNames: newClasses
|
210
|
+
});
|
211
|
+
if (newSourceCol !== sourceCol) {
|
212
|
+
TH = wotInstance.wtTable.getColumnHeader(newSourceCol, headerLevel);
|
213
|
+
}
|
214
|
+
(0, _element.addClass)(TH, newClasses);
|
215
|
+
}
|
216
|
+
selectionColumnCursor += 1;
|
217
|
+
}
|
218
|
+
}
|
219
|
+
}
|
220
|
+
if (topRow !== null && bottomRow !== null) {
|
221
|
+
let selectionRowCursor = 0;
|
222
|
+
for (let row = 0; row < renderedRows; row += 1) {
|
223
|
+
const sourceRow = wotInstance.wtTable.rowFilter.renderedToSource(row);
|
224
|
+
if (isHeaderSelectionType && sourceRow >= topRow && sourceRow <= bottomRow) {
|
225
|
+
let THs = wotInstance.wtTable.getRowHeaders(sourceRow);
|
226
|
+
const closestHeaderLevel = THs.length - 1;
|
227
|
+
if (highlightOnlyClosestHeader && THs.length > 1) {
|
228
|
+
THs = [THs[closestHeaderLevel]];
|
229
|
+
}
|
230
|
+
for (let headerLevel = 0; headerLevel < THs.length; headerLevel += 1) {
|
231
|
+
const newClasses = [];
|
232
|
+
let TH = THs[headerLevel];
|
233
|
+
if (highlightHeaderClassName) {
|
234
|
+
newClasses.push(highlightHeaderClassName);
|
235
|
+
}
|
236
|
+
if (highlightRowClassName) {
|
237
|
+
newClasses.push(highlightRowClassName);
|
238
|
+
}
|
239
|
+
headerLevel = highlightOnlyClosestHeader ? closestHeaderLevel : headerLevel;
|
240
|
+
const newSourceRow = wotInstance.getSetting('onBeforeHighlightingRowHeader', sourceRow, headerLevel, {
|
241
|
+
selectionType,
|
242
|
+
rowCursor: selectionRowCursor,
|
243
|
+
selectionHeight: bottomRow - topRow + 1,
|
244
|
+
classNames: newClasses
|
245
|
+
});
|
246
|
+
if (newSourceRow !== sourceRow) {
|
247
|
+
TH = wotInstance.wtTable.getRowHeader(newSourceRow, headerLevel);
|
248
|
+
}
|
249
|
+
(0, _element.addClass)(TH, newClasses);
|
250
|
+
}
|
251
|
+
selectionRowCursor += 1;
|
252
|
+
}
|
253
|
+
if (topColumn !== null && bottomColumn !== null) {
|
254
|
+
for (let column = 0; column < renderedColumns; column += 1) {
|
255
|
+
const sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column);
|
256
|
+
if (sourceRow >= topRow && sourceRow <= bottomRow && sourceCol >= topColumn && sourceCol <= bottomColumn) {
|
257
|
+
// selected cell
|
258
|
+
if (this.settings.className) {
|
259
|
+
this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.className, this.settings.markIntersections);
|
260
|
+
}
|
261
|
+
} else if (sourceRow >= topRow && sourceRow <= bottomRow) {
|
262
|
+
// selection is in this row
|
263
|
+
if (highlightRowClassName) {
|
264
|
+
this.addClassAtCoords(wotInstance, sourceRow, sourceCol, highlightRowClassName);
|
265
|
+
}
|
266
|
+
} else if (sourceCol >= topColumn && sourceCol <= bottomColumn) {
|
267
|
+
// selection is in this column
|
268
|
+
if (highlightColumnClassName) {
|
269
|
+
this.addClassAtCoords(wotInstance, sourceRow, sourceCol, highlightColumnClassName);
|
270
|
+
}
|
271
|
+
}
|
272
|
+
const additionalSelectionClass = wotInstance.getSetting('onAfterDrawSelection', sourceRow, sourceCol, this.settings.layerLevel);
|
273
|
+
if (typeof additionalSelectionClass === 'string') {
|
274
|
+
this.addClassAtCoords(wotInstance, sourceRow, sourceCol, additionalSelectionClass);
|
275
|
+
}
|
276
|
+
}
|
277
|
+
}
|
278
|
+
}
|
279
|
+
}
|
280
|
+
wotInstance.getSetting('onBeforeDrawBorders', corners, this.settings.className);
|
281
|
+
if (this.settings.border) {
|
282
|
+
// warning! border.appear modifies corners!
|
283
|
+
this.getBorder(wotInstance).appear(corners);
|
284
|
+
}
|
285
|
+
}
|
286
|
+
|
287
|
+
/**
|
288
|
+
* Cleans up all the DOM state related to a Selection instance. Call this prior to deleting a Selection instance.
|
289
|
+
*/
|
290
|
+
destroy() {
|
291
|
+
Object.values(this.instanceBorders).forEach(border => border.destroy());
|
292
|
+
}
|
293
|
+
}
|
294
|
+
var _default = Selection;
|
295
|
+
exports.default = _default;
|