handsontable 0.0.0-next-b0a4ea2-20231024 → 0.0.0-next-9059914-20231025
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 +10 -12
- package/3rdparty/walkontable/src/event.mjs +10 -12
- 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 +2 -13
- package/3rdparty/walkontable/src/overlay/_base.mjs +3 -14
- 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/renderer/cells.js +0 -10
- package/3rdparty/walkontable/src/renderer/cells.mjs +1 -11
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +0 -10
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +1 -11
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +0 -5
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +0 -5
- package/3rdparty/walkontable/src/renderer/rows.js +0 -13
- package/3rdparty/walkontable/src/renderer/rows.mjs +0 -13
- package/3rdparty/walkontable/src/renderer/table.js +0 -9
- package/3rdparty/walkontable/src/renderer/table.mjs +0 -9
- package/3rdparty/walkontable/src/scroll.js +0 -2
- package/3rdparty/walkontable/src/scroll.mjs +0 -2
- package/3rdparty/walkontable/src/selection.js +295 -0
- package/3rdparty/walkontable/src/selection.mjs +290 -0
- package/3rdparty/walkontable/src/settings.js +4 -13
- package/3rdparty/walkontable/src/settings.mjs +4 -13
- 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 -19
- package/3rdparty/walkontable/src/table.mjs +79 -20
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/dateType/dateType.d.ts +3 -3
- package/cellTypes/dateType/dateType.js +2 -2
- package/cellTypes/dateType/dateType.mjs +2 -2
- package/cellTypes/handsontableType/handsontableType.d.ts +3 -3
- package/cellTypes/handsontableType/handsontableType.js +2 -2
- package/cellTypes/handsontableType/handsontableType.mjs +2 -2
- package/cellTypes/index.d.ts +0 -3
- package/cellTypes/index.js +0 -4
- package/cellTypes/index.mjs +1 -3
- package/core.d.ts +4 -9
- package/core.js +327 -285
- package/core.mjs +327 -285
- package/dataMap/metaManager/metaSchema.js +0 -65
- package/dataMap/metaManager/metaSchema.mjs +0 -65
- package/dataMap/metaManager/mods/extendMetaProperties.js +1 -7
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +1 -7
- package/dataMap/replaceData.js +0 -5
- package/dataMap/replaceData.mjs +0 -5
- package/dist/handsontable.css +15 -51
- package/dist/handsontable.full.css +15 -51
- package/dist/handsontable.full.js +8668 -14188
- package/dist/handsontable.full.min.css +7 -7
- package/dist/handsontable.full.min.js +136 -136
- package/dist/handsontable.js +22829 -28349
- package/dist/handsontable.min.css +6 -6
- package/dist/handsontable.min.js +24 -24
- package/dist/languages/all.js +2 -6
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/en-US.js +1 -3
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/pl-PL.js +1 -3
- package/dist/languages/pl-PL.min.js +1 -1
- package/editorManager.js +87 -15
- package/editorManager.mjs +87 -16
- package/editors/autocompleteEditor/autocompleteEditor.js +2 -53
- package/editors/autocompleteEditor/autocompleteEditor.mjs +3 -54
- package/editors/dateEditor/dateEditor.js +7 -26
- package/editors/dateEditor/dateEditor.mjs +8 -27
- package/editors/handsontableEditor/handsontableEditor.js +1 -9
- package/editors/handsontableEditor/handsontableEditor.mjs +2 -10
- package/editors/textEditor/textEditor.js +27 -19
- package/editors/textEditor/textEditor.mjs +30 -22
- package/helpers/dom/element.js +9 -188
- package/helpers/dom/element.mjs +9 -182
- 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/i18n/constants.js +1 -7
- package/i18n/constants.mjs +1 -4
- package/i18n/languages/en-US.js +1 -3
- package/i18n/languages/en-US.mjs +1 -3
- package/i18n/languages/pl-PL.js +1 -3
- package/i18n/languages/pl-PL.mjs +1 -3
- package/languages/all.js +2 -6
- package/languages/en-US.js +1 -3
- package/languages/en-US.mjs +1 -3
- package/languages/index.js +2 -6
- package/languages/pl-PL.js +1 -3
- package/languages/pl-PL.mjs +1 -3
- package/package.json +99 -116
- package/pluginHooks.d.ts +1 -12
- package/pluginHooks.js +1 -152
- package/pluginHooks.mjs +1 -152
- package/plugins/collapsibleColumns/collapsibleColumns.js +4 -74
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +5 -75
- package/plugins/columnSorting/columnSorting.js +0 -43
- package/plugins/columnSorting/columnSorting.mjs +3 -44
- 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 -252
- package/plugins/comments/comments.mjs +190 -251
- package/plugins/contextMenu/commandExecutor.js +3 -2
- package/plugins/contextMenu/commandExecutor.mjs +3 -2
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/contextMenu/contextMenu.js +36 -75
- package/plugins/contextMenu/contextMenu.mjs +35 -74
- package/plugins/contextMenu/{menu/cursor.mjs → cursor.js} +10 -4
- package/plugins/contextMenu/{menu/cursor.js → cursor.mjs} +4 -6
- package/plugins/contextMenu/itemsFactory.js +3 -2
- package/plugins/contextMenu/itemsFactory.mjs +4 -3
- package/plugins/contextMenu/{menu/menu.js → menu.js} +421 -145
- package/plugins/contextMenu/{menu/menu.mjs → menu.mjs} +422 -146
- 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/{predefinedItems/index.js → predefinedItems.js} +14 -14
- package/plugins/contextMenu/predefinedItems.mjs +68 -0
- package/plugins/contextMenu/utils.js +151 -35
- package/plugins/contextMenu/utils.mjs +144 -35
- 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 +78 -127
- package/plugins/copyPaste/copyPaste.mjs +79 -128
- package/plugins/copyPaste/focusableElement.js +186 -0
- package/plugins/copyPaste/focusableElement.mjs +180 -0
- 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 +40 -127
- package/plugins/dropdownMenu/dropdownMenu.mjs +39 -126
- package/plugins/filters/component/_base.js +8 -23
- package/plugins/filters/component/_base.mjs +8 -23
- package/plugins/filters/component/actionBar.js +27 -29
- package/plugins/filters/component/actionBar.mjs +23 -26
- package/plugins/filters/component/condition.js +59 -46
- package/plugins/filters/component/condition.mjs +52 -40
- package/plugins/filters/component/operators.js +22 -21
- package/plugins/filters/component/operators.mjs +18 -18
- package/plugins/filters/component/value.js +26 -35
- package/plugins/filters/component/value.mjs +22 -32
- package/plugins/filters/constants.mjs +1 -1
- package/plugins/filters/filters.js +62 -106
- package/plugins/filters/filters.mjs +55 -99
- package/plugins/filters/ui/_base.js +13 -35
- package/plugins/filters/ui/_base.mjs +13 -35
- package/plugins/filters/ui/input.js +32 -43
- package/plugins/filters/ui/input.mjs +30 -42
- package/plugins/filters/ui/link.js +12 -44
- package/plugins/filters/ui/link.mjs +11 -44
- package/plugins/filters/ui/multipleSelect.js +129 -234
- package/plugins/filters/ui/multipleSelect.mjs +127 -232
- package/plugins/filters/ui/radioInput.js +18 -42
- package/plugins/filters/ui/radioInput.mjs +17 -42
- package/plugins/filters/ui/select.js +75 -144
- package/plugins/filters/ui/select.mjs +72 -142
- package/plugins/hiddenColumns/hiddenColumns.mjs +1 -1
- package/plugins/hiddenRows/hiddenRows.mjs +1 -1
- package/plugins/manualColumnMove/manualColumnMove.js +1 -3
- package/plugins/manualColumnMove/manualColumnMove.mjs +1 -3
- package/plugins/mergeCells/mergeCells.js +16 -5
- package/plugins/mergeCells/mergeCells.mjs +16 -5
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -37
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -37
- package/plugins/nestedHeaders/nestedHeaders.js +10 -240
- package/plugins/nestedHeaders/nestedHeaders.mjs +11 -241
- package/plugins/nestedHeaders/stateManager/index.js +3 -102
- package/plugins/nestedHeaders/stateManager/index.mjs +3 -102
- package/plugins/nestedRows/nestedRows.js +0 -41
- package/plugins/nestedRows/nestedRows.mjs +0 -41
- package/plugins/nestedRows/ui/headers.js +0 -11
- package/plugins/nestedRows/ui/headers.mjs +1 -12
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +0 -8
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +0 -8
- package/renderers/baseRenderer/baseRenderer.js +0 -17
- package/renderers/baseRenderer/baseRenderer.mjs +1 -18
- package/renderers/checkboxRenderer/checkboxRenderer.js +4 -9
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +4 -9
- package/renderers/index.d.ts +0 -9
- 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 -7
- package/selection/mouseEventHandler.mjs +1 -7
- package/selection/range.js +8 -8
- package/selection/range.mjs +8 -8
- package/selection/selection.js +152 -321
- package/selection/selection.mjs +151 -318
- 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 -4
- package/shortcuts/context.js +4 -23
- package/shortcuts/context.mjs +5 -23
- package/shortcuts/manager.js +7 -25
- package/shortcuts/manager.mjs +7 -26
- package/shortcuts/recorder.js +3 -3
- package/shortcuts/recorder.mjs +3 -3
- package/shortcuts/utils.js +5 -19
- package/shortcuts/utils.mjs +4 -18
- package/tableView.js +13 -111
- package/tableView.mjs +14 -112
- 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 -274
- package/3rdparty/walkontable/src/selection/manager.mjs +0 -269
- 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/cellTypes/selectType/index.d.ts +0 -1
- package/cellTypes/selectType/index.js +0 -6
- package/cellTypes/selectType/index.mjs +0 -1
- package/cellTypes/selectType/selectType.d.ts +0 -14
- package/cellTypes/selectType/selectType.js +0 -13
- package/cellTypes/selectType/selectType.mjs +0 -8
- package/core/focusCatcher/focusDetector.js +0 -63
- package/core/focusCatcher/focusDetector.mjs +0 -59
- 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/focusManager.d.ts +0 -12
- package/focusManager.js +0 -265
- package/focusManager.mjs +0 -261
- package/helpers/a11y.js +0 -79
- package/helpers/a11y.mjs +0 -38
- 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/plugins/contextMenu/menu/defaultShortcutsList.js +0 -88
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +0 -84
- package/plugins/contextMenu/menu/index.js +0 -9
- package/plugins/contextMenu/menu/index.mjs +0 -1
- package/plugins/contextMenu/menu/menuItemRenderer.js +0 -58
- package/plugins/contextMenu/menu/menuItemRenderer.mjs +0 -54
- package/plugins/contextMenu/menu/navigator.js +0 -27
- package/plugins/contextMenu/menu/navigator.mjs +0 -23
- package/plugins/contextMenu/menu/positioner.js +0 -213
- package/plugins/contextMenu/menu/positioner.mjs +0 -209
- package/plugins/contextMenu/menu/shortcuts.js +0 -114
- package/plugins/contextMenu/menu/shortcuts.mjs +0 -110
- package/plugins/contextMenu/menu/utils.js +0 -177
- package/plugins/contextMenu/menu/utils.mjs +0 -163
- package/plugins/contextMenu/predefinedItems/index.mjs +0 -68
- package/plugins/filters/menu/focusController.js +0 -123
- package/plugins/filters/menu/focusController.mjs +0 -119
- package/plugins/filters/menu/focusNavigator.js +0 -30
- package/plugins/filters/menu/focusNavigator.mjs +0 -26
- package/renderers/dateRenderer/dateRenderer.d.ts +0 -5
- package/renderers/dateRenderer/dateRenderer.js +0 -29
- package/renderers/dateRenderer/dateRenderer.mjs +0 -24
- package/renderers/dateRenderer/index.d.ts +0 -1
- package/renderers/dateRenderer/index.js +0 -6
- package/renderers/dateRenderer/index.mjs +0 -1
- package/renderers/handsontableRenderer/handsontableRenderer.d.ts +0 -5
- package/renderers/handsontableRenderer/handsontableRenderer.js +0 -29
- package/renderers/handsontableRenderer/handsontableRenderer.mjs +0 -24
- package/renderers/handsontableRenderer/index.d.ts +0 -1
- package/renderers/handsontableRenderer/index.js +0 -6
- package/renderers/handsontableRenderer/index.mjs +0 -1
- package/renderers/selectRenderer/index.d.ts +0 -1
- package/renderers/selectRenderer/index.js +0 -6
- package/renderers/selectRenderer/index.mjs +0 -1
- package/renderers/selectRenderer/selectRenderer.d.ts +0 -5
- package/renderers/selectRenderer/selectRenderer.js +0 -27
- package/renderers/selectRenderer/selectRenderer.mjs +0 -22
- 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 -25
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -21
- 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 -25
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -21
- 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 -33
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -29
- 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 -33
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -29
- package/shortcutContexts/commands/populateSelectedCellsData.js +0 -29
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -25
- package/shortcutContexts/commands/scrollToFocusedCell.js +0 -35
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +0 -31
- package/shortcutContexts/commands/selectAll.js +0 -12
- package/shortcutContexts/commands/selectAll.mjs +0 -8
- 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
- package/utils/paginator.js +0 -151
- package/utils/paginator.mjs +0 -147
package/selection/selection.js
CHANGED
@@ -2,36 +2,21 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
require("core-js/modules/es.error.cause.js");
|
5
|
-
var
|
6
|
-
var
|
5
|
+
var _highlight = _interopRequireDefault(require("./highlight/highlight"));
|
6
|
+
var _constants = require("./highlight/constants");
|
7
7
|
var _range = _interopRequireDefault(require("./range"));
|
8
8
|
var _object = require("./../helpers/object");
|
9
9
|
var _mixed = require("./../helpers/mixed");
|
10
|
-
var _number = require("./../helpers/number");
|
11
10
|
var _array = require("./../helpers/array");
|
12
11
|
var _localHooks = _interopRequireDefault(require("./../mixins/localHooks"));
|
13
12
|
var _transformation = _interopRequireDefault(require("./transformation"));
|
14
13
|
var _utils = require("./utils");
|
15
14
|
var _templateLiteralTag = require("./../helpers/templateLiteralTag");
|
16
|
-
var _a11y = require("../helpers/a11y");
|
17
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
20
|
-
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
21
|
-
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
22
|
-
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; }
|
23
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
24
|
-
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); }
|
25
|
-
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
26
|
-
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
27
|
-
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
28
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
29
|
-
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
30
16
|
/**
|
31
17
|
* @class Selection
|
32
18
|
* @util
|
33
19
|
*/
|
34
|
-
var _disableHeadersHighlight = /*#__PURE__*/new WeakMap();
|
35
20
|
class Selection {
|
36
21
|
constructor(settings, tableProps) {
|
37
22
|
var _this = this;
|
@@ -40,73 +25,57 @@ class Selection {
|
|
40
25
|
*
|
41
26
|
* @type {GridSettings}
|
42
27
|
*/
|
43
|
-
|
28
|
+
this.settings = settings;
|
44
29
|
/**
|
45
30
|
* An additional object with dynamically defined properties which describes table state.
|
46
31
|
*
|
47
32
|
* @type {object}
|
48
33
|
*/
|
49
|
-
|
34
|
+
this.tableProps = tableProps;
|
50
35
|
/**
|
51
36
|
* The flag which determines if the selection is in progress.
|
52
37
|
*
|
53
38
|
* @type {boolean}
|
54
39
|
*/
|
55
|
-
|
56
|
-
/**
|
57
|
-
* Selection data layer (handle visual coordinates).
|
58
|
-
*
|
59
|
-
* @type {SelectionRange}
|
60
|
-
*/
|
61
|
-
_defineProperty(this, "selectedRange", new _range.default((highlight, from, to) => {
|
62
|
-
return this.tableProps.createCellRange(highlight, from, to);
|
63
|
-
}));
|
64
|
-
/**
|
65
|
-
* Visualization layer.
|
66
|
-
*
|
67
|
-
* @type {Highlight}
|
68
|
-
*/
|
69
|
-
_defineProperty(this, "highlight", void 0);
|
40
|
+
this.inProgress = false;
|
70
41
|
/**
|
71
|
-
* The
|
42
|
+
* The flag indicates that selection was performed by clicking the corner overlay.
|
72
43
|
*
|
73
|
-
* @type {
|
44
|
+
* @type {boolean}
|
74
45
|
*/
|
75
|
-
|
46
|
+
this.selectedByCorner = false;
|
76
47
|
/**
|
77
48
|
* The collection of the selection layer levels where the whole row was selected using the row header or
|
78
49
|
* the corner header.
|
79
50
|
*
|
80
|
-
* @type {Set
|
51
|
+
* @type {Set.<number>}
|
81
52
|
*/
|
82
|
-
|
53
|
+
this.selectedByRowHeader = new Set();
|
83
54
|
/**
|
84
55
|
* The collection of the selection layer levels where the whole column was selected using the column header or
|
85
56
|
* the corner header.
|
86
57
|
*
|
87
|
-
* @type {Set
|
58
|
+
* @type {Set.<number>}
|
88
59
|
*/
|
89
|
-
|
60
|
+
this.selectedByColumnHeader = new Set();
|
90
61
|
/**
|
91
|
-
*
|
62
|
+
* Selection data layer (handle visual coordinates).
|
92
63
|
*
|
93
|
-
* @type {
|
64
|
+
* @type {SelectionRange}
|
94
65
|
*/
|
95
|
-
|
96
|
-
|
97
|
-
value: false
|
66
|
+
this.selectedRange = new _range.default((highlight, from, to) => {
|
67
|
+
return this.tableProps.createCellRange(highlight, from, to);
|
98
68
|
});
|
99
|
-
|
100
|
-
|
69
|
+
/**
|
70
|
+
* Visualization layer.
|
71
|
+
*
|
72
|
+
* @type {Highlight}
|
73
|
+
*/
|
101
74
|
this.highlight = new _highlight.default({
|
102
75
|
headerClassName: settings.currentHeaderClassName,
|
103
|
-
headerAttributes: [(0, _a11y.A11Y_SELECTED)()],
|
104
76
|
activeHeaderClassName: settings.activeHeaderClassName,
|
105
77
|
rowClassName: settings.currentRowClassName,
|
106
78
|
columnClassName: settings.currentColClassName,
|
107
|
-
cellAttributes: [(0, _a11y.A11Y_SELECTED)()],
|
108
|
-
rowIndexMapper: this.tableProps.rowIndexMapper,
|
109
|
-
columnIndexMapper: this.tableProps.columnIndexMapper,
|
110
79
|
disabledCellSelection: (row, column) => this.tableProps.isDisabledCellSelection(row, column),
|
111
80
|
cellCornerVisible: function () {
|
112
81
|
return _this.isCellCornerVisible(...arguments);
|
@@ -117,19 +86,21 @@ class Selection {
|
|
117
86
|
visualToRenderableCoords: coords => this.tableProps.visualToRenderableCoords(coords),
|
118
87
|
renderableToVisualCoords: coords => this.tableProps.renderableToVisualCoords(coords),
|
119
88
|
createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
|
120
|
-
createCellRange: (highlight, from, to) => this.tableProps.createCellRange(highlight, from, to)
|
89
|
+
createCellRange: (highlight, from, to) => this.tableProps.createCellRange(highlight, from, to),
|
90
|
+
rowIndexMapper: () => this.tableProps.rowIndexMapper(),
|
91
|
+
columnIndexMapper: () => this.tableProps.columnIndexMapper()
|
121
92
|
});
|
93
|
+
/**
|
94
|
+
* The module for modifying coordinates.
|
95
|
+
*
|
96
|
+
* @type {Transformation}
|
97
|
+
*/
|
122
98
|
this.transformation = new _transformation.default(this.selectedRange, {
|
123
|
-
|
124
|
-
|
125
|
-
countRenderableRows: () => this.tableProps.countRenderableRows(),
|
126
|
-
countRenderableColumns: () => this.tableProps.countRenderableColumns(),
|
127
|
-
countRowHeaders: () => this.tableProps.countRowHeaders(),
|
128
|
-
countColHeaders: () => this.tableProps.countColHeaders(),
|
99
|
+
countRows: () => this.tableProps.countRowsTranslated(),
|
100
|
+
countCols: () => this.tableProps.countColsTranslated(),
|
129
101
|
visualToRenderableCoords: coords => this.tableProps.visualToRenderableCoords(coords),
|
130
102
|
renderableToVisualCoords: coords => this.tableProps.renderableToVisualCoords(coords),
|
131
103
|
createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
|
132
|
-
navigableHeaders: () => settings.navigableHeaders,
|
133
104
|
fixedRowsBottom: () => settings.fixedRowsBottom,
|
134
105
|
minSpareRows: () => settings.minSpareRows,
|
135
106
|
minSpareCols: () => settings.minSpareCols,
|
@@ -184,14 +155,14 @@ class Selection {
|
|
184
155
|
}
|
185
156
|
|
186
157
|
/**
|
187
|
-
* Indicate that selection process began. It sets
|
158
|
+
* Indicate that selection process began. It sets internaly `.inProgress` property to `true`.
|
188
159
|
*/
|
189
160
|
begin() {
|
190
161
|
this.inProgress = true;
|
191
162
|
}
|
192
163
|
|
193
164
|
/**
|
194
|
-
* Indicate that selection process finished. It sets
|
165
|
+
* Indicate that selection process finished. It sets internaly `.inProgress` property to `false`.
|
195
166
|
*/
|
196
167
|
finish() {
|
197
168
|
this.runLocalHooks('afterSelectionFinished', Array.from(this.selectedRange));
|
@@ -216,25 +187,33 @@ class Selection {
|
|
216
187
|
* the default trigger will be used.
|
217
188
|
* @param {boolean} [fragment=false] If `true`, the selection will be treated as a partial selection where the
|
218
189
|
* `setRangeEnd` method won't be called on every `setRangeStart` call.
|
219
|
-
* @param {CellCoords} [highlightCoords] If set, allows changing the coordinates of the highlight/focus cell.
|
220
190
|
*/
|
221
191
|
setRangeStart(coords, multipleSelection) {
|
222
192
|
let fragment = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
223
|
-
let highlightCoords = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : coords;
|
224
193
|
const isMultipleMode = this.settings.selectionMode === 'multiple';
|
225
194
|
const isMultipleSelection = (0, _mixed.isUndefined)(multipleSelection) ? this.tableProps.getShortcutManager().isCtrlPressed() : multipleSelection;
|
195
|
+
const isRowNegative = coords.row < 0;
|
196
|
+
const isColumnNegative = coords.col < 0;
|
197
|
+
const selectedByCorner = isRowNegative && isColumnNegative;
|
226
198
|
// We are creating copy. We would like to modify just the start of the selection by below hook. Then original coords
|
227
199
|
// should be handled by next methods.
|
228
200
|
const coordsClone = coords.clone();
|
201
|
+
this.selectedByCorner = selectedByCorner;
|
229
202
|
this.runLocalHooks(`beforeSetRangeStart${fragment ? 'Only' : ''}`, coordsClone);
|
230
203
|
if (!isMultipleMode || isMultipleMode && !isMultipleSelection && (0, _mixed.isUndefined)(multipleSelection)) {
|
231
204
|
this.selectedRange.clear();
|
232
205
|
}
|
233
|
-
this.selectedRange.add(coordsClone)
|
206
|
+
this.selectedRange.add(coordsClone);
|
234
207
|
if (this.getLayerLevel() === 0) {
|
235
208
|
this.selectedByRowHeader.clear();
|
236
209
|
this.selectedByColumnHeader.clear();
|
237
210
|
}
|
211
|
+
if (!selectedByCorner && isColumnNegative) {
|
212
|
+
this.selectedByRowHeader.add(this.getLayerLevel());
|
213
|
+
}
|
214
|
+
if (!selectedByCorner && isRowNegative) {
|
215
|
+
this.selectedByColumnHeader.add(this.getLayerLevel());
|
216
|
+
}
|
238
217
|
if (!fragment) {
|
239
218
|
this.setRangeEnd(coords);
|
240
219
|
}
|
@@ -247,11 +226,9 @@ class Selection {
|
|
247
226
|
* @param {boolean} [multipleSelection] If `true`, selection will be worked in 'multiple' mode. This option works
|
248
227
|
* only when 'selectionMode' is set as 'multiple'. If the argument is not defined
|
249
228
|
* the default trigger will be used.
|
250
|
-
* @param {CellCoords} [highlightCoords] If set, allows changing the coordinates of the highlight/focus cell.
|
251
229
|
*/
|
252
230
|
setRangeStartOnly(coords, multipleSelection) {
|
253
|
-
|
254
|
-
this.setRangeStart(coords, multipleSelection, true, highlightCoords);
|
231
|
+
this.setRangeStart(coords, multipleSelection, true);
|
255
232
|
}
|
256
233
|
|
257
234
|
/**
|
@@ -263,40 +240,21 @@ class Selection {
|
|
263
240
|
if (this.selectedRange.isEmpty()) {
|
264
241
|
return;
|
265
242
|
}
|
266
|
-
const coordsClone = coords.clone();
|
267
|
-
const countRows = this.tableProps.countRows();
|
268
|
-
const countCols = this.tableProps.countCols();
|
269
|
-
const isSingle = this.selectedRange.current().clone().setTo(coords).isSingleHeader();
|
270
243
|
|
271
|
-
//
|
272
|
-
//
|
273
|
-
|
274
|
-
return;
|
275
|
-
}
|
244
|
+
// We are creating copy. We would like to modify just the end of the selection by below hook. Then original coords
|
245
|
+
// should be handled by next methods.
|
246
|
+
const coordsClone = coords.clone();
|
276
247
|
this.runLocalHooks('beforeSetRangeEnd', coordsClone);
|
277
248
|
this.begin();
|
278
249
|
const cellRange = this.selectedRange.current();
|
279
|
-
if (
|
280
|
-
cellRange.
|
281
|
-
}
|
282
|
-
if (this.settings.selectionMode === 'single') {
|
283
|
-
cellRange.setFrom(cellRange.highlight);
|
284
|
-
cellRange.setTo(cellRange.highlight);
|
285
|
-
} else {
|
286
|
-
cellRange.setTo(coordsClone);
|
250
|
+
if (this.settings.selectionMode !== 'single') {
|
251
|
+
cellRange.setTo(this.tableProps.createCellCoords(coordsClone.row, coordsClone.col));
|
287
252
|
}
|
288
253
|
|
289
|
-
//
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
}
|
294
|
-
}
|
295
|
-
this.runLocalHooks('beforeHighlightSet');
|
296
|
-
const focusHighlight = this.highlight.getFocus();
|
297
|
-
focusHighlight.clear();
|
298
|
-
if (this.highlight.isEnabledFor(_highlight.FOCUS_TYPE, cellRange.highlight)) {
|
299
|
-
focusHighlight.add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
|
254
|
+
// Set up current selection.
|
255
|
+
this.highlight.getCell().clear();
|
256
|
+
if (this.highlight.isEnabledFor(_constants.CELL_TYPE, cellRange.highlight)) {
|
257
|
+
this.highlight.getCell().add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
|
300
258
|
}
|
301
259
|
const layerLevel = this.getLayerLevel();
|
302
260
|
|
@@ -304,80 +262,69 @@ class Selection {
|
|
304
262
|
// indication that the new selection is performing.
|
305
263
|
if (layerLevel < this.highlight.layerLevel) {
|
306
264
|
(0, _array.arrayEach)(this.highlight.getAreas(), highlight => void highlight.clear());
|
307
|
-
(0, _array.arrayEach)(this.highlight.
|
308
|
-
(0, _array.arrayEach)(this.highlight.
|
309
|
-
(0, _array.arrayEach)(this.highlight.getColumnHeaders(), highlight => void highlight.clear());
|
310
|
-
(0, _array.arrayEach)(this.highlight.getActiveRowHeaders(), highlight => void highlight.clear());
|
311
|
-
(0, _array.arrayEach)(this.highlight.getActiveColumnHeaders(), highlight => void highlight.clear());
|
312
|
-
(0, _array.arrayEach)(this.highlight.getActiveCornerHeaders(), highlight => void highlight.clear());
|
313
|
-
(0, _array.arrayEach)(this.highlight.getRowHighlights(), highlight => void highlight.clear());
|
314
|
-
(0, _array.arrayEach)(this.highlight.getColumnHighlights(), highlight => void highlight.clear());
|
265
|
+
(0, _array.arrayEach)(this.highlight.getHeaders(), highlight => void highlight.clear());
|
266
|
+
(0, _array.arrayEach)(this.highlight.getActiveHeaders(), highlight => void highlight.clear());
|
315
267
|
}
|
316
268
|
this.highlight.useLayerLevel(layerLevel);
|
317
|
-
const areaHighlight = this.highlight.
|
318
|
-
const
|
319
|
-
const
|
320
|
-
const columnHeaderHighlight = this.highlight.createColumnHeader();
|
321
|
-
const activeRowHeaderHighlight = this.highlight.createActiveRowHeader();
|
322
|
-
const activeColumnHeaderHighlight = this.highlight.createActiveColumnHeader();
|
323
|
-
const activeCornerHeaderHighlight = this.highlight.createActiveCornerHeader();
|
324
|
-
const rowHighlight = this.highlight.createRowHighlight();
|
325
|
-
const columnHighlight = this.highlight.createColumnHighlight();
|
269
|
+
const areaHighlight = this.highlight.createOrGetArea();
|
270
|
+
const headerHighlight = this.highlight.createOrGetHeader();
|
271
|
+
const activeHeaderHighlight = this.highlight.createOrGetActiveHeader();
|
326
272
|
areaHighlight.clear();
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
activeRowHeaderHighlight.clear();
|
331
|
-
activeColumnHeaderHighlight.clear();
|
332
|
-
activeCornerHeaderHighlight.clear();
|
333
|
-
rowHighlight.clear();
|
334
|
-
columnHighlight.clear();
|
335
|
-
if (this.highlight.isEnabledFor(_highlight.AREA_TYPE, cellRange.highlight) && (this.isMultiple() || layerLevel >= 1)) {
|
273
|
+
headerHighlight.clear();
|
274
|
+
activeHeaderHighlight.clear();
|
275
|
+
if (this.highlight.isEnabledFor(_constants.AREA_TYPE, cellRange.highlight) && (this.isMultiple() || layerLevel >= 1)) {
|
336
276
|
areaHighlight.add(cellRange.from).add(cellRange.to).commit();
|
337
|
-
layeredAreaHighlight.add(cellRange.from).add(cellRange.to).commit();
|
338
277
|
if (layerLevel === 1) {
|
339
278
|
// For single cell selection in the same layer, we do not create area selection to prevent blue background.
|
340
279
|
// When non-consecutive selection is performed we have to add that missing area selection to the previous layer
|
341
280
|
// based on previous coordinates. It only occurs when the previous selection wasn't select multiple cells.
|
342
281
|
const previousRange = this.selectedRange.previous();
|
343
|
-
this.highlight.useLayerLevel(layerLevel - 1)
|
344
|
-
this.highlight.createArea().add(previousRange.from).commit()
|
345
|
-
// Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
|
346
|
-
.syncWith(previousRange);
|
347
|
-
this.highlight.createLayeredArea().add(previousRange.from).commit()
|
282
|
+
this.highlight.useLayerLevel(layerLevel - 1).createOrGetArea().add(previousRange.from).commit()
|
348
283
|
// Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
|
349
284
|
.syncWith(previousRange);
|
350
285
|
this.highlight.useLayerLevel(layerLevel);
|
351
286
|
}
|
352
287
|
}
|
353
|
-
if (this.highlight.isEnabledFor(
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
columnHighlight.add(columnCoordsFrom).commit();
|
364
|
-
} else {
|
365
|
-
rowHeaderHighlight.add(rowCoordsFrom).add(rowCoordsTo).commit();
|
366
|
-
columnHeaderHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
|
367
|
-
rowHighlight.add(rowCoordsFrom).add(rowCoordsTo).commit();
|
368
|
-
columnHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
|
369
|
-
}
|
288
|
+
if (this.highlight.isEnabledFor(_constants.HEADER_TYPE, cellRange.highlight)) {
|
289
|
+
// The header selection generally contains cell selection. In a case when all rows (or columns)
|
290
|
+
// are hidden that visual coordinates are translated to renderable coordinates that do not exist.
|
291
|
+
// Hence no header highlight is generated. In that case, to make a column (or a row) header
|
292
|
+
// highlight, the row and column index has to point to the header (the negative value). See #7052.
|
293
|
+
const areAnyRowsRendered = this.tableProps.countRowsTranslated() === 0;
|
294
|
+
const areAnyColumnsRendered = this.tableProps.countColsTranslated() === 0;
|
295
|
+
let headerCellRange = cellRange;
|
296
|
+
if (areAnyRowsRendered || areAnyColumnsRendered) {
|
297
|
+
headerCellRange = cellRange.clone();
|
370
298
|
}
|
371
|
-
|
372
|
-
|
373
|
-
if (highlightRowHeaders) {
|
374
|
-
activeRowHeaderHighlight.add(this.tableProps.createCellCoords(Math.max(cellRange.from.row, 0), Math.min(-this.tableProps.countRowHeaders(), -1))).add(this.tableProps.createCellCoords(Math.max(cellRange.to.row, 0), -1)).commit();
|
299
|
+
if (areAnyRowsRendered) {
|
300
|
+
headerCellRange.from.row = -1;
|
375
301
|
}
|
376
|
-
if (
|
377
|
-
|
302
|
+
if (areAnyColumnsRendered) {
|
303
|
+
headerCellRange.from.col = -1;
|
378
304
|
}
|
379
|
-
if (
|
380
|
-
|
305
|
+
if (this.settings.selectionMode === 'single') {
|
306
|
+
if (this.isSelectedByAnyHeader()) {
|
307
|
+
headerCellRange.from.normalize();
|
308
|
+
}
|
309
|
+
headerHighlight.add(headerCellRange.from).commit();
|
310
|
+
} else {
|
311
|
+
headerHighlight.add(headerCellRange.from).add(headerCellRange.to).commit();
|
312
|
+
}
|
313
|
+
if (this.isEntireRowSelected()) {
|
314
|
+
const isRowSelected = this.tableProps.countCols() === cellRange.getWidth();
|
315
|
+
|
316
|
+
// Make sure that the whole row is selected (in case where selectionMode is set to 'single')
|
317
|
+
if (isRowSelected) {
|
318
|
+
activeHeaderHighlight.add(this.tableProps.createCellCoords(cellRange.from.row, -1)).add(this.tableProps.createCellCoords(cellRange.to.row, -1)).commit();
|
319
|
+
}
|
320
|
+
}
|
321
|
+
if (this.isEntireColumnSelected()) {
|
322
|
+
const isColumnSelected = this.tableProps.countRows() === cellRange.getHeight();
|
323
|
+
|
324
|
+
// Make sure that the whole column is selected (in case where selectionMode is set to 'single')
|
325
|
+
if (isColumnSelected) {
|
326
|
+
activeHeaderHighlight.add(this.tableProps.createCellCoords(-1, cellRange.from.col)).add(this.tableProps.createCellCoords(-1, cellRange.to.col)).commit();
|
327
|
+
}
|
381
328
|
}
|
382
329
|
}
|
383
330
|
this.runLocalHooks('afterSetRangeEnd', coords);
|
@@ -400,12 +347,12 @@ class Selection {
|
|
400
347
|
*
|
401
348
|
* @param {number} rowDelta Rows number to move, value can be passed as negative number.
|
402
349
|
* @param {number} colDelta Columns number to move, value can be passed as negative number.
|
403
|
-
* @param {boolean} [
|
404
|
-
*
|
350
|
+
* @param {boolean} [force=false] If `true` the new rows/columns will be created if necessary. Otherwise, row/column will
|
351
|
+
* be created according to `minSpareRows/minSpareCols` settings of Handsontable.
|
405
352
|
*/
|
406
353
|
transformStart(rowDelta, colDelta) {
|
407
|
-
let
|
408
|
-
this.setRangeStart(this.transformation.transformStart(rowDelta, colDelta,
|
354
|
+
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
355
|
+
this.setRangeStart(this.transformation.transformStart(rowDelta, colDelta, force));
|
409
356
|
}
|
410
357
|
|
411
358
|
/**
|
@@ -446,7 +393,7 @@ class Selection {
|
|
446
393
|
*/
|
447
394
|
isSelectedByRowHeader() {
|
448
395
|
let layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel();
|
449
|
-
return !this.isSelectedByCorner(layerLevel) &&
|
396
|
+
return !this.isSelectedByCorner(layerLevel) && this.isEntireRowSelected(layerLevel);
|
450
397
|
}
|
451
398
|
|
452
399
|
/**
|
@@ -458,19 +405,7 @@ class Selection {
|
|
458
405
|
*/
|
459
406
|
isEntireRowSelected() {
|
460
407
|
let layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel();
|
461
|
-
|
462
|
-
const {
|
463
|
-
col
|
464
|
-
} = range.getOuterTopStartCorner();
|
465
|
-
const rowHeaders = this.tableProps.countRowHeaders();
|
466
|
-
const countCols = this.tableProps.countCols();
|
467
|
-
return (rowHeaders > 0 && col < 0 || rowHeaders === 0) && range.getWidth() === countCols;
|
468
|
-
};
|
469
|
-
if (layerLevel === -1) {
|
470
|
-
return Array.from(this.selectedRange).some(range => tester(range));
|
471
|
-
}
|
472
|
-
const range = this.selectedRange.peekByIndex(layerLevel);
|
473
|
-
return range ? tester(range) : false;
|
408
|
+
return layerLevel === -1 ? this.selectedByRowHeader.size > 0 : this.selectedByRowHeader.has(layerLevel);
|
474
409
|
}
|
475
410
|
|
476
411
|
/**
|
@@ -483,7 +418,7 @@ class Selection {
|
|
483
418
|
*/
|
484
419
|
isSelectedByColumnHeader() {
|
485
420
|
let layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel();
|
486
|
-
return !this.isSelectedByCorner() &&
|
421
|
+
return !this.isSelectedByCorner() && this.isEntireColumnSelected(layerLevel);
|
487
422
|
}
|
488
423
|
|
489
424
|
/**
|
@@ -495,19 +430,7 @@ class Selection {
|
|
495
430
|
*/
|
496
431
|
isEntireColumnSelected() {
|
497
432
|
let layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel();
|
498
|
-
|
499
|
-
const {
|
500
|
-
row
|
501
|
-
} = range.getOuterTopStartCorner();
|
502
|
-
const colHeaders = this.tableProps.countColHeaders();
|
503
|
-
const countRows = this.tableProps.countRows();
|
504
|
-
return (colHeaders > 0 && row < 0 || colHeaders === 0) && range.getHeight() === countRows;
|
505
|
-
};
|
506
|
-
if (layerLevel === -1) {
|
507
|
-
return Array.from(this.selectedRange).some(range => tester(range));
|
508
|
-
}
|
509
|
-
const range = this.selectedRange.peekByIndex(layerLevel);
|
510
|
-
return range ? tester(range) : false;
|
433
|
+
return layerLevel === -1 ? this.selectedByColumnHeader.size > 0 : this.selectedByColumnHeader.has(layerLevel);
|
511
434
|
}
|
512
435
|
|
513
436
|
/**
|
@@ -525,7 +448,7 @@ class Selection {
|
|
525
448
|
* @returns {boolean}
|
526
449
|
*/
|
527
450
|
isSelectedByCorner() {
|
528
|
-
return this.
|
451
|
+
return this.selectedByCorner;
|
529
452
|
}
|
530
453
|
|
531
454
|
/**
|
@@ -584,61 +507,31 @@ class Selection {
|
|
584
507
|
}
|
585
508
|
|
586
509
|
/**
|
587
|
-
*
|
510
|
+
* Select all cells.
|
588
511
|
*
|
589
|
-
* @param {boolean} [includeRowHeaders=false] `true` If the selection should include the row headers,
|
590
|
-
*
|
591
|
-
* @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
|
592
|
-
*
|
593
|
-
* @param {object} [options] Additional object with options.
|
594
|
-
* @param {{row: number, col: number} | boolean} [options.focusPosition] The argument allows changing the cell/header
|
595
|
-
* focus position. The value takes an object with a `row` and `col` properties from -N to N, where
|
596
|
-
* negative values point to the headers and positive values point to the cell range. If `false`, the focus
|
597
|
-
* position won't be changed.
|
598
|
-
* @param {boolean} [options.disableHeadersHighlight] If `true`, disables highlighting the headers even when
|
599
|
-
* the logical coordinates points on them.
|
512
|
+
* @param {boolean} [includeRowHeaders=false] `true` If the selection should include the row headers, `false`
|
513
|
+
* otherwise.
|
514
|
+
* @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column headers, `false`
|
515
|
+
* otherwise.
|
600
516
|
*/
|
601
517
|
selectAll() {
|
602
|
-
var _this$getSelectedRang;
|
603
518
|
let includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
604
519
|
let includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
605
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
606
|
-
focusPosition: false,
|
607
|
-
disableHeadersHighlight: false
|
608
|
-
};
|
609
520
|
const nrOfRows = this.tableProps.countRows();
|
610
521
|
const nrOfColumns = this.tableProps.countCols();
|
611
|
-
const countRowHeaders = this.tableProps.countRowHeaders();
|
612
|
-
const countColHeaders = this.tableProps.countColHeaders();
|
613
|
-
const rowFrom = includeColumnHeaders ? -countColHeaders : 0;
|
614
|
-
const columnFrom = includeRowHeaders ? -countRowHeaders : 0;
|
615
522
|
|
616
523
|
// We can't select cells when there is no data.
|
617
|
-
if (
|
524
|
+
if (!includeRowHeaders && !includeColumnHeaders && (nrOfRows === 0 || nrOfColumns === 0)) {
|
618
525
|
return;
|
619
526
|
}
|
620
|
-
|
621
|
-
const {
|
622
|
-
focusPosition,
|
623
|
-
disableHeadersHighlight
|
624
|
-
} = options;
|
625
|
-
_classPrivateFieldSet(this, _disableHeadersHighlight, disableHeadersHighlight);
|
626
|
-
if (focusPosition && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
|
627
|
-
highlight = this.tableProps.createCellCoords((0, _number.clamp)(focusPosition.row, rowFrom, nrOfRows - 1), (0, _number.clamp)(focusPosition.col, columnFrom, nrOfColumns - 1));
|
628
|
-
}
|
629
|
-
const startCoords = this.tableProps.createCellCoords(rowFrom, columnFrom);
|
527
|
+
const startCoords = this.tableProps.createCellCoords(includeColumnHeaders ? -1 : 0, includeRowHeaders ? -1 : 0);
|
630
528
|
const endCoords = this.tableProps.createCellCoords(nrOfRows - 1, nrOfColumns - 1);
|
631
529
|
this.clear();
|
632
|
-
this.setRangeStartOnly(startCoords
|
633
|
-
|
634
|
-
|
635
|
-
}
|
636
|
-
if (rowFrom < 0) {
|
637
|
-
this.selectedByColumnHeader.add(this.getLayerLevel());
|
638
|
-
}
|
530
|
+
this.setRangeStartOnly(startCoords);
|
531
|
+
this.selectedByRowHeader.add(this.getLayerLevel());
|
532
|
+
this.selectedByColumnHeader.add(this.getLayerLevel());
|
639
533
|
this.setRangeEnd(endCoords);
|
640
534
|
this.finish();
|
641
|
-
_classPrivateFieldSet(this, _disableHeadersHighlight, false);
|
642
535
|
}
|
643
536
|
|
644
537
|
/**
|
@@ -663,29 +556,21 @@ class Selection {
|
|
663
556
|
propToCol: prop => this.tableProps.propToCol(prop),
|
664
557
|
keepDirection: true
|
665
558
|
});
|
666
|
-
const
|
667
|
-
const
|
668
|
-
countRows: this.tableProps.countRows(),
|
669
|
-
countCols: this.tableProps.countCols(),
|
670
|
-
countRowHeaders: navigableHeaders ? this.tableProps.countRowHeaders() : 0,
|
671
|
-
countColHeaders: navigableHeaders ? this.tableProps.countColHeaders() : 0
|
672
|
-
};
|
559
|
+
const nrOfRows = this.tableProps.countRows();
|
560
|
+
const nrOfColumns = this.tableProps.countCols();
|
673
561
|
|
674
562
|
// Check if every layer of the coordinates are valid.
|
675
563
|
const isValid = !selectionRanges.some(selection => {
|
676
|
-
const
|
677
|
-
const
|
678
|
-
return !
|
564
|
+
const [rowStart, columnStart, rowEnd, columnEnd] = selectionSchemaNormalizer(selection);
|
565
|
+
const _isValid = (0, _utils.isValidCoord)(rowStart, nrOfRows) && (0, _utils.isValidCoord)(columnStart, nrOfColumns) && (0, _utils.isValidCoord)(rowEnd, nrOfRows) && (0, _utils.isValidCoord)(columnEnd, nrOfColumns);
|
566
|
+
return !_isValid;
|
679
567
|
});
|
680
568
|
if (isValid) {
|
681
569
|
this.clear();
|
682
570
|
(0, _array.arrayEach)(selectionRanges, selection => {
|
683
|
-
const
|
684
|
-
|
685
|
-
|
686
|
-
} = selectionSchemaNormalizer(selection);
|
687
|
-
this.setRangeStartOnly(from.clone(), false);
|
688
|
-
this.setRangeEnd(to.clone());
|
571
|
+
const [rowStart, columnStart, rowEnd, columnEnd] = selectionSchemaNormalizer(selection);
|
572
|
+
this.setRangeStartOnly(this.tableProps.createCellCoords(rowStart, columnStart), false);
|
573
|
+
this.setRangeEnd(this.tableProps.createCellCoords(rowEnd, columnEnd));
|
689
574
|
this.finish();
|
690
575
|
});
|
691
576
|
}
|
@@ -698,43 +583,22 @@ class Selection {
|
|
698
583
|
*
|
699
584
|
* @param {number|string} startColumn Visual column index or column property from which the selection starts.
|
700
585
|
* @param {number|string} [endColumn] Visual column index or column property from to the selection finishes.
|
701
|
-
* @param {number} [
|
702
|
-
*
|
703
|
-
*
|
586
|
+
* @param {number} [headerLevel=-1] A row header index that triggers the column selection. The value can
|
587
|
+
* take -1 to -N, where -1 means the header closest to the cells.
|
588
|
+
*
|
704
589
|
* @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
|
705
590
|
*/
|
706
591
|
selectColumns(startColumn) {
|
707
592
|
let endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
|
708
|
-
let
|
593
|
+
let headerLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
|
709
594
|
const start = typeof startColumn === 'string' ? this.tableProps.propToCol(startColumn) : startColumn;
|
710
595
|
const end = typeof endColumn === 'string' ? this.tableProps.propToCol(endColumn) : endColumn;
|
711
|
-
const
|
712
|
-
const
|
713
|
-
const
|
714
|
-
const columnHeaderLastIndex = countColHeaders === 0 ? 0 : -countColHeaders;
|
715
|
-
const fromCoords = new _src.CellCoords(columnHeaderLastIndex, start);
|
716
|
-
const toCoords = new _src.CellCoords(countRows - 1, end);
|
717
|
-
const isValid = new _src.CellRange(fromCoords, fromCoords, toCoords).isValid({
|
718
|
-
countRows,
|
719
|
-
countCols,
|
720
|
-
countRowHeaders: 0,
|
721
|
-
countColHeaders
|
722
|
-
});
|
596
|
+
const nrOfColumns = this.tableProps.countCols();
|
597
|
+
const nrOfRows = this.tableProps.countRows();
|
598
|
+
const isValid = (0, _utils.isValidCoord)(start, nrOfColumns) && (0, _utils.isValidCoord)(end, nrOfColumns);
|
723
599
|
if (isValid) {
|
724
|
-
|
725
|
-
|
726
|
-
const from = this.tableProps.createCellCoords(fromRow, start);
|
727
|
-
const to = this.tableProps.createCellCoords(toRow, end);
|
728
|
-
const highlight = this.tableProps.createCellCoords((0, _number.clamp)(focusPosition, columnHeaderLastIndex, countRows - 1), start);
|
729
|
-
this.runLocalHooks('beforeSelectColumns', from, to, highlight);
|
730
|
-
|
731
|
-
// disallow modifying row axis for that hooks
|
732
|
-
from.row = fromRow;
|
733
|
-
to.row = toRow;
|
734
|
-
this.setRangeStartOnly(from, void 0, highlight);
|
735
|
-
this.selectedByColumnHeader.add(this.getLayerLevel());
|
736
|
-
this.setRangeEnd(to);
|
737
|
-
this.runLocalHooks('afterSelectColumns', from, to, highlight);
|
600
|
+
this.setRangeStartOnly(this.tableProps.createCellCoords(headerLevel, start));
|
601
|
+
this.setRangeEnd(this.tableProps.createCellCoords(nrOfRows - 1, end));
|
738
602
|
this.finish();
|
739
603
|
}
|
740
604
|
return isValid;
|
@@ -745,41 +609,20 @@ class Selection {
|
|
745
609
|
*
|
746
610
|
* @param {number} startRow Visual row index from which the selection starts.
|
747
611
|
* @param {number} [endRow] Visual row index from to the selection finishes.
|
748
|
-
* @param {number} [
|
749
|
-
*
|
750
|
-
*
|
612
|
+
* @param {number} [headerLevel=-1] A column header index that triggers the row selection.
|
613
|
+
* The value can take -1 to -N, where -1 means the header
|
614
|
+
* closest to the cells.
|
751
615
|
* @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
|
752
616
|
*/
|
753
617
|
selectRows(startRow) {
|
754
618
|
let endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
|
755
|
-
let
|
756
|
-
const
|
757
|
-
const
|
758
|
-
const
|
759
|
-
const rowHeaderLastIndex = countRowHeaders === 0 ? 0 : -countRowHeaders;
|
760
|
-
const fromCoords = new _src.CellCoords(startRow, rowHeaderLastIndex);
|
761
|
-
const toCoords = new _src.CellCoords(endRow, countCols - 1);
|
762
|
-
const isValid = new _src.CellRange(fromCoords, fromCoords, toCoords).isValid({
|
763
|
-
countRows,
|
764
|
-
countCols,
|
765
|
-
countRowHeaders,
|
766
|
-
countColHeaders: 0
|
767
|
-
});
|
619
|
+
let headerLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
|
620
|
+
const nrOfRows = this.tableProps.countRows();
|
621
|
+
const nrOfColumns = this.tableProps.countCols();
|
622
|
+
const isValid = (0, _utils.isValidCoord)(startRow, nrOfRows) && (0, _utils.isValidCoord)(endRow, nrOfRows);
|
768
623
|
if (isValid) {
|
769
|
-
|
770
|
-
|
771
|
-
const from = this.tableProps.createCellCoords(startRow, fromColumn);
|
772
|
-
const to = this.tableProps.createCellCoords(endRow, toColumn);
|
773
|
-
const highlight = this.tableProps.createCellCoords(startRow, (0, _number.clamp)(focusPosition, rowHeaderLastIndex, countCols - 1));
|
774
|
-
this.runLocalHooks('beforeSelectRows', from, to, highlight);
|
775
|
-
|
776
|
-
// disallow modifying column axis for that hooks
|
777
|
-
from.col = fromColumn;
|
778
|
-
to.col = toColumn;
|
779
|
-
this.setRangeStartOnly(from, void 0, highlight);
|
780
|
-
this.selectedByRowHeader.add(this.getLayerLevel());
|
781
|
-
this.setRangeEnd(to);
|
782
|
-
this.runLocalHooks('afterSelectRows', from, to, highlight);
|
624
|
+
this.setRangeStartOnly(this.tableProps.createCellCoords(startRow, headerLevel));
|
625
|
+
this.setRangeEnd(this.tableProps.createCellCoords(endRow, nrOfColumns - 1));
|
783
626
|
this.finish();
|
784
627
|
}
|
785
628
|
return isValid;
|
@@ -796,31 +639,19 @@ class Selection {
|
|
796
639
|
if (!this.isSelected()) {
|
797
640
|
return;
|
798
641
|
}
|
799
|
-
const
|
642
|
+
const cellHighlight = this.highlight.getCell();
|
800
643
|
const currentLayer = this.getLayerLevel();
|
801
|
-
|
644
|
+
cellHighlight.commit().syncWith(this.selectedRange.current());
|
802
645
|
|
803
646
|
// Rewriting rendered ranges going through all layers.
|
804
647
|
for (let layerLevel = 0; layerLevel < this.selectedRange.size(); layerLevel += 1) {
|
805
648
|
this.highlight.useLayerLevel(layerLevel);
|
806
|
-
const areaHighlight = this.highlight.
|
807
|
-
const
|
808
|
-
const
|
809
|
-
const columnHeaderHighlight = this.highlight.createColumnHeader();
|
810
|
-
const activeRowHeaderHighlight = this.highlight.createActiveRowHeader();
|
811
|
-
const activeColumnHeaderHighlight = this.highlight.createActiveColumnHeader();
|
812
|
-
const activeCornerHeaderHighlight = this.highlight.createActiveCornerHeader();
|
813
|
-
const rowHighlight = this.highlight.createRowHighlight();
|
814
|
-
const columnHighlight = this.highlight.createColumnHighlight();
|
649
|
+
const areaHighlight = this.highlight.createOrGetArea();
|
650
|
+
const headerHighlight = this.highlight.createOrGetHeader();
|
651
|
+
const activeHeaderHighlight = this.highlight.createOrGetActiveHeader();
|
815
652
|
areaHighlight.commit();
|
816
|
-
|
817
|
-
|
818
|
-
columnHeaderHighlight.commit();
|
819
|
-
activeRowHeaderHighlight.commit();
|
820
|
-
activeColumnHeaderHighlight.commit();
|
821
|
-
activeCornerHeaderHighlight.commit();
|
822
|
-
rowHighlight.commit();
|
823
|
-
columnHighlight.commit();
|
653
|
+
headerHighlight.commit();
|
654
|
+
activeHeaderHighlight.commit();
|
824
655
|
}
|
825
656
|
|
826
657
|
// Reverting starting layer for the Highlight.
|