handsontable 0.0.0-next-2b3d6d8-20230623 → 0.0.0-next-c3d199b-20230626
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/cell/coords.d.ts +6 -1
- package/3rdparty/walkontable/src/cell/coords.js +61 -12
- package/3rdparty/walkontable/src/cell/coords.mjs +61 -12
- package/3rdparty/walkontable/src/cell/range.d.ts +9 -2
- package/3rdparty/walkontable/src/cell/range.js +44 -7
- package/3rdparty/walkontable/src/cell/range.mjs +44 -7
- package/3rdparty/walkontable/src/core/_base.js +9 -3
- package/3rdparty/walkontable/src/core/_base.mjs +9 -3
- package/3rdparty/walkontable/src/core/clone.js +2 -2
- package/3rdparty/walkontable/src/core/clone.mjs +2 -2
- package/3rdparty/walkontable/src/core/core.js +3 -2
- package/3rdparty/walkontable/src/core/core.mjs +3 -2
- package/3rdparty/walkontable/src/event.js +7 -7
- package/3rdparty/walkontable/src/event.mjs +7 -7
- package/3rdparty/walkontable/src/facade/core.js +2 -2
- package/3rdparty/walkontable/src/facade/core.mjs +2 -2
- package/3rdparty/walkontable/src/index.js +10 -2
- package/3rdparty/walkontable/src/index.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/_base.js +1 -1
- package/3rdparty/walkontable/src/overlay/_base.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/inlineStart.js +2 -4
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -4
- package/3rdparty/walkontable/src/overlay/top.js +2 -4
- package/3rdparty/walkontable/src/overlay/top.mjs +2 -4
- package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
- package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
- package/3rdparty/walkontable/src/selection/border/constants.js +18 -0
- package/3rdparty/walkontable/src/selection/border/constants.mjs +13 -0
- package/3rdparty/walkontable/src/selection/constants.js +63 -0
- package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
- package/3rdparty/walkontable/src/selection/index.js +30 -0
- package/3rdparty/walkontable/src/selection/index.mjs +5 -0
- package/3rdparty/walkontable/src/selection/manager.js +329 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +323 -0
- package/3rdparty/walkontable/src/selection/scanner.js +364 -0
- package/3rdparty/walkontable/src/selection/scanner.mjs +360 -0
- package/3rdparty/walkontable/src/selection/selection.js +133 -0
- package/3rdparty/walkontable/src/selection/selection.mjs +127 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
- package/3rdparty/walkontable/src/table.js +7 -79
- package/3rdparty/walkontable/src/table.mjs +8 -80
- package/CHANGELOG.md +0 -31
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +5 -3
- package/core.js +127 -309
- package/core.mjs +127 -309
- package/dataMap/metaManager/metaSchema.js +19 -0
- package/dataMap/metaManager/metaSchema.mjs +19 -0
- package/dist/handsontable.css +8 -3
- package/dist/handsontable.full.css +8 -3
- package/dist/handsontable.full.js +15283 -12109
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +115 -115
- package/dist/handsontable.js +23364 -20190
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +4 -4
- package/editorManager.js +21 -94
- package/editorManager.mjs +26 -98
- package/editors/textEditor/textEditor.js +3 -11
- package/editors/textEditor/textEditor.mjs +4 -12
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/number.d.ts +1 -0
- package/helpers/number.js +18 -0
- package/helpers/number.mjs +17 -0
- package/package.json +1 -1
- package/pluginHooks.d.ts +5 -1
- package/pluginHooks.js +89 -1
- package/pluginHooks.mjs +89 -1
- package/plugins/collapsibleColumns/collapsibleColumns.js +81 -24
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +81 -24
- package/plugins/columnSorting/columnSorting.js +50 -8
- package/plugins/columnSorting/columnSorting.mjs +49 -9
- package/plugins/columnSorting/index.js +4 -2
- package/plugins/columnSorting/index.mjs +1 -1
- package/plugins/comments/commentEditor.js +1 -0
- package/plugins/comments/commentEditor.mjs +1 -0
- package/plugins/comments/comments.js +263 -224
- package/plugins/comments/comments.mjs +271 -234
- package/plugins/comments/contextMenuItem/addEditComment.js +51 -0
- package/plugins/comments/contextMenuItem/addEditComment.mjs +35 -0
- package/plugins/comments/contextMenuItem/readOnlyComment.js +63 -0
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +55 -0
- package/plugins/comments/contextMenuItem/removeComment.js +48 -0
- package/plugins/comments/contextMenuItem/removeComment.mjs +32 -0
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/contextMenu/contextMenu.js +80 -29
- package/plugins/contextMenu/contextMenu.mjs +81 -30
- package/plugins/contextMenu/predefinedItems/alignment.js +7 -0
- package/plugins/contextMenu/predefinedItems/alignment.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/clearColumn.js +5 -3
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/readOnly.js +7 -0
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/removeColumn.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/removeRow.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +5 -3
- package/plugins/contextMenu/utils.js +25 -16
- package/plugins/contextMenu/utils.mjs +24 -15
- package/plugins/copyPaste/contextMenuItem/copy.js +7 -0
- package/plugins/copyPaste/contextMenuItem/copy.mjs +7 -0
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/cut.js +7 -0
- package/plugins/copyPaste/contextMenuItem/cut.mjs +7 -0
- package/plugins/copyPaste/copyPaste.js +6 -2
- package/plugins/copyPaste/copyPaste.mjs +6 -2
- package/plugins/customBorders/customBorders.js +25 -53
- package/plugins/customBorders/customBorders.mjs +26 -54
- package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
- package/plugins/dropdownMenu/dropdownMenu.js +94 -30
- package/plugins/dropdownMenu/dropdownMenu.mjs +94 -30
- package/plugins/mergeCells/mergeCells.js +5 -18
- package/plugins/mergeCells/mergeCells.mjs +5 -18
- package/plugins/multiColumnSorting/multiColumnSorting.js +42 -3
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +42 -3
- package/plugins/nestedHeaders/nestedHeaders.js +132 -10
- package/plugins/nestedHeaders/nestedHeaders.mjs +132 -10
- package/plugins/nestedHeaders/stateManager/index.js +37 -0
- package/plugins/nestedHeaders/stateManager/index.mjs +37 -0
- package/plugins/nestedRows/nestedRows.js +52 -7
- package/plugins/nestedRows/nestedRows.mjs +52 -7
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/highlight.js +312 -89
- package/selection/highlight/highlight.mjs +302 -85
- package/selection/highlight/types/activeHeader.js +10 -9
- package/selection/highlight/types/activeHeader.mjs +10 -8
- package/selection/highlight/types/area.js +12 -27
- package/selection/highlight/types/area.mjs +16 -30
- package/selection/highlight/types/areaLayered.js +54 -0
- package/selection/highlight/types/areaLayered.mjs +49 -0
- package/selection/highlight/types/column.js +50 -0
- package/selection/highlight/types/column.mjs +45 -0
- package/selection/highlight/types/customSelection.js +7 -10
- package/selection/highlight/types/customSelection.mjs +7 -9
- package/selection/highlight/types/fill.js +5 -8
- package/selection/highlight/types/fill.mjs +5 -7
- package/selection/highlight/types/{cell.js → focus.js} +5 -8
- package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
- package/selection/highlight/types/header.js +10 -20
- package/selection/highlight/types/header.mjs +10 -19
- package/selection/highlight/types/{index.js → row.js} +27 -31
- package/selection/highlight/types/{index.mjs → row.mjs} +24 -29
- package/selection/highlight/visualSelection.js +31 -27
- package/selection/highlight/visualSelection.mjs +31 -27
- package/selection/index.js +4 -7
- package/selection/index.mjs +2 -3
- package/selection/mouseEventHandler.js +1 -1
- package/selection/mouseEventHandler.mjs +1 -1
- package/selection/range.js +8 -8
- package/selection/range.mjs +8 -8
- package/selection/selection.js +315 -181
- package/selection/selection.mjs +310 -180
- package/selection/transformation.js +233 -96
- package/selection/transformation.mjs +230 -93
- package/selection/utils.js +12 -36
- package/selection/utils.mjs +13 -36
- package/settings.d.ts +1 -0
- package/shortcutContexts/commands/editor/closeAndSave.js +15 -0
- package/shortcutContexts/commands/editor/closeAndSave.mjs +10 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.js +13 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +8 -0
- package/shortcutContexts/commands/editor/fastOpen.js +16 -0
- package/shortcutContexts/commands/editor/fastOpen.mjs +11 -0
- package/shortcutContexts/commands/editor/index.js +16 -0
- package/shortcutContexts/commands/editor/index.mjs +12 -0
- package/shortcutContexts/commands/editor/open.js +29 -0
- package/shortcutContexts/commands/editor/open.mjs +24 -0
- package/shortcutContexts/commands/emptySelectedCells.js +12 -0
- package/shortcutContexts/commands/emptySelectedCells.mjs +7 -0
- package/shortcutContexts/commands/extendCellsSelection/down.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +16 -0
- package/shortcutContexts/commands/extendCellsSelection/index.js +26 -0
- package/shortcutContexts/commands/extendCellsSelection/index.mjs +22 -0
- package/shortcutContexts/commands/extendCellsSelection/left.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/right.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +14 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +22 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +12 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +12 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +40 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +35 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +40 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +35 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +22 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +14 -0
- package/shortcutContexts/commands/extendCellsSelection/up.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +16 -0
- package/shortcutContexts/commands/index.js +52 -0
- package/shortcutContexts/commands/index.mjs +48 -0
- package/shortcutContexts/commands/moveCellSelection/down.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/down.mjs +7 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +29 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +24 -0
- package/shortcutContexts/commands/moveCellSelection/index.js +28 -0
- package/shortcutContexts/commands/moveCellSelection/index.mjs +24 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/left.js +11 -0
- package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/right.js +11 -0
- package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +16 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +11 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +12 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +16 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +11 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +36 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +31 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +36 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +31 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +16 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +11 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +18 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/up.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/up.mjs +7 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +29 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +24 -0
- package/shortcutContexts/commands/populateSelectedCellsData.js +35 -0
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +30 -0
- package/shortcutContexts/commands/selectAll.js +11 -0
- package/shortcutContexts/commands/selectAll.mjs +6 -0
- package/shortcutContexts/constants.js +19 -0
- package/shortcutContexts/constants.mjs +12 -0
- package/shortcutContexts/editor.js +29 -0
- package/shortcutContexts/editor.mjs +25 -0
- package/shortcutContexts/grid.js +247 -0
- package/shortcutContexts/grid.mjs +243 -0
- package/shortcutContexts/index.js +29 -0
- package/shortcutContexts/index.mjs +15 -0
- package/shortcuts/manager.js +2 -0
- package/shortcuts/manager.mjs +2 -0
- package/shortcuts/recorder.js +2 -2
- package/shortcuts/recorder.mjs +2 -2
- package/shortcuts/utils.js +21 -5
- package/shortcuts/utils.mjs +20 -4
- package/tableView.js +63 -11
- package/tableView.mjs +63 -11
- package/translations/indexMapper.d.ts +2 -0
- package/3rdparty/walkontable/src/selection.js +0 -355
- package/3rdparty/walkontable/src/selection.mjs +0 -349
- package/selection/highlight/constants.js +0 -16
- package/selection/highlight/constants.mjs +0 -6
package/pluginHooks.d.ts
CHANGED
@@ -110,8 +110,8 @@ export interface Events {
|
|
110
110
|
afterOnCellCornerDblClick?: (event: MouseEvent) => void;
|
111
111
|
afterOnCellCornerMouseDown?: (event: MouseEvent) => void;
|
112
112
|
afterOnCellMouseDown?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
113
|
-
afterOnCellMouseOver?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
114
113
|
afterOnCellMouseOut?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
114
|
+
afterOnCellMouseOver?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
115
115
|
afterOnCellMouseUp?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
116
116
|
afterPaste?: (data: CellValue[][], coords: RangeType[]) => void;
|
117
117
|
afterPluginsInitialized?: () => void;
|
@@ -128,10 +128,12 @@ export interface Events {
|
|
128
128
|
afterRowSequenceChange?: (source: 'init' | 'move' | 'insert' | 'remove' | 'update') => void;
|
129
129
|
afterScrollHorizontally?: () => void;
|
130
130
|
afterScrollVertically?: () => void;
|
131
|
+
afterSelectColumns?: (from: CellCoords, to: CellCoords, highlight: CellCoords) => void;
|
131
132
|
afterSelection?: (row: number, column: number, row2: number, column2: number, preventScrolling: { value: boolean }, selectionLayerLevel: number) => void;
|
132
133
|
afterSelectionByProp?: (row: number, prop: string, row2: number, prop2: string, preventScrolling: { value: boolean }, selectionLayerLevel: number) => void;
|
133
134
|
afterSelectionEnd?: (row: number, column: number, row2: number, column2: number, selectionLayerLevel: number) => void;
|
134
135
|
afterSelectionEndByProp?: (row: number, prop: string, row2: number, prop2: string, selectionLayerLevel: number) => void;
|
136
|
+
afterSelectRows?: (from: CellCoords, to: CellCoords, highlight: CellCoords) => void;
|
135
137
|
afterSetCellMeta?: (row: number, column: number, key: string, value: any) => void;
|
136
138
|
afterSetDataAtCell?: (changes: CellChange[], source?: ChangeSource) => void;
|
137
139
|
afterSetDataAtRowProp?: (changes: CellChange[], source?: ChangeSource) => void;
|
@@ -205,6 +207,8 @@ export interface Events {
|
|
205
207
|
beforeRenderer?: (TD: HTMLTableCellElement, row: number, column: number, prop: string | number, value: CellValue, cellProperties: CellProperties) => void;
|
206
208
|
beforeRowMove?: (movedRows: number[], finalIndex: number, dropIndex: number | undefined, movePossible: boolean) => void;
|
207
209
|
beforeRowResize?: (newSize: number, row: number, isDoubleClick: boolean) => number | void;
|
210
|
+
beforeSelectColumns?: (from: CellCoords, to: CellCoords, highlight: CellCoords) => void;
|
211
|
+
beforeSelectRows?: (from: CellCoords, to: CellCoords, highlight: CellCoords) => void;
|
208
212
|
beforeSetCellMeta?: (row: number, col: number, key: string, value: any) => boolean | void;
|
209
213
|
beforeSetRangeEnd?: (coords: CellCoords) => void;
|
210
214
|
beforeSetRangeStart?: (coords: CellCoords) => void;
|
package/pluginHooks.js
CHANGED
@@ -680,6 +680,94 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
680
680
|
* @param {number} selectionLayerLevel The number which indicates what selection layer is currently modified.
|
681
681
|
*/
|
682
682
|
'afterSelectionEndByProp',
|
683
|
+
/**
|
684
|
+
* Fired before one or more columns are selected (e.g. During mouse header click or {@link Core#selectColumns} API call).
|
685
|
+
*
|
686
|
+
* @since 13.0.0
|
687
|
+
* @event Hooks#beforeSelectColumns
|
688
|
+
* @param {CellCoords} from Selection start coords object.
|
689
|
+
* @param {CellCoords} to Selection end coords object.
|
690
|
+
* @param {CellCoords} highlight Selection cell focus coords object.
|
691
|
+
* @example
|
692
|
+
* ::: only-for javascript
|
693
|
+
* ```js
|
694
|
+
* new Handsontable(element, {
|
695
|
+
* beforeSelectColumns: (from, to, highlight) => {
|
696
|
+
* // Extend the column selection by one column left and one column right.
|
697
|
+
* from.col = Math.max(from.col - 1, 0);
|
698
|
+
* to.col = Math.min(to.col + 1, this.countCols() - 1);
|
699
|
+
* }
|
700
|
+
* })
|
701
|
+
* ```
|
702
|
+
* :::
|
703
|
+
*
|
704
|
+
* ::: only-for react
|
705
|
+
* ```jsx
|
706
|
+
* <HotTable
|
707
|
+
* beforeSelectColumns={(from, to, highlight) => {
|
708
|
+
* // Extend the column selection by one column left and one column right.
|
709
|
+
* from.col = Math.max(from.col - 1, 0);
|
710
|
+
* to.col = Math.min(to.col + 1, this.countCols() - 1);
|
711
|
+
* }}
|
712
|
+
* />
|
713
|
+
* ```
|
714
|
+
* :::
|
715
|
+
*/
|
716
|
+
'beforeSelectColumns',
|
717
|
+
/**
|
718
|
+
* Fired after one or more columns are selected (e.g. During mouse header click or {@link Core#selectColumns} API call).
|
719
|
+
*
|
720
|
+
* @since 13.0.0
|
721
|
+
* @event Hooks#afterSelectColumns
|
722
|
+
* @param {CellCoords} from Selection start coords object.
|
723
|
+
* @param {CellCoords} to Selection end coords object.
|
724
|
+
* @param {CellCoords} highlight Selection cell focus coords object.
|
725
|
+
*/
|
726
|
+
'afterSelectColumns',
|
727
|
+
/**
|
728
|
+
* Fired before one or more rows are selected (e.g. During mouse header click or {@link Core#selectRows} API call).
|
729
|
+
*
|
730
|
+
* @since 13.0.0
|
731
|
+
* @event Hooks#beforeSelectRows
|
732
|
+
* @param {CellCoords} from Selection start coords object.
|
733
|
+
* @param {CellCoords} to Selection end coords object.
|
734
|
+
* @param {CellCoords} highlight Selection cell focus coords object.
|
735
|
+
* @example
|
736
|
+
* ::: only-for javascript
|
737
|
+
* ```js
|
738
|
+
* new Handsontable(element, {
|
739
|
+
* beforeSelectRows: (from, to, highlight) => {
|
740
|
+
* // Extend the row selection by one row up and one row bottom more.
|
741
|
+
* from.row = Math.max(from.row - 1, 0);
|
742
|
+
* to.row = Math.min(to.row + 1, this.countRows() - 1);
|
743
|
+
* }
|
744
|
+
* })
|
745
|
+
* ```
|
746
|
+
* :::
|
747
|
+
*
|
748
|
+
* ::: only-for react
|
749
|
+
* ```jsx
|
750
|
+
* <HotTable
|
751
|
+
* beforeSelectRows={(from, to, highlight) => {
|
752
|
+
* // Extend the row selection by one row up and one row bottom more.
|
753
|
+
* from.row = Math.max(from.row - 1, 0);
|
754
|
+
* to.row = Math.min(to.row + 1, this.countRows() - 1);
|
755
|
+
* }}
|
756
|
+
* />
|
757
|
+
* ```
|
758
|
+
* :::
|
759
|
+
*/
|
760
|
+
'beforeSelectRows',
|
761
|
+
/**
|
762
|
+
* Fired after one or more rows are selected (e.g. During mouse header click or {@link Core#selectRows} API call).
|
763
|
+
*
|
764
|
+
* @since 13.0.0
|
765
|
+
* @event Hooks#afterSelectRows
|
766
|
+
* @param {CellCoords} from Selection start coords object.
|
767
|
+
* @param {CellCoords} to Selection end coords object.
|
768
|
+
* @param {CellCoords} highlight Selection cell focus coords object.
|
769
|
+
*/
|
770
|
+
'afterSelectRows',
|
683
771
|
/**
|
684
772
|
* Fired after cell meta is changed.
|
685
773
|
*
|
@@ -2403,7 +2491,7 @@ var REMOVED_HOOKS = new Map([['modifyRow', '8.0.0'], ['modifyCol', '8.0.0'], ['u
|
|
2403
2491
|
* @type {Map<string, string>}
|
2404
2492
|
*/
|
2405
2493
|
/* eslint-enable jsdoc/require-description-complete-sentence */
|
2406
|
-
var DEPRECATED_HOOKS = new Map([]);
|
2494
|
+
var DEPRECATED_HOOKS = new Map([['beforeRemoveCellClassNames', 'The hook "beforeRemoveCellClassNames" is deprecated and will be removed in the next major release.']]);
|
2407
2495
|
var Hooks = /*#__PURE__*/function () {
|
2408
2496
|
/**
|
2409
2497
|
*
|
package/pluginHooks.mjs
CHANGED
@@ -677,6 +677,94 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
677
677
|
* @param {number} selectionLayerLevel The number which indicates what selection layer is currently modified.
|
678
678
|
*/
|
679
679
|
'afterSelectionEndByProp',
|
680
|
+
/**
|
681
|
+
* Fired before one or more columns are selected (e.g. During mouse header click or {@link Core#selectColumns} API call).
|
682
|
+
*
|
683
|
+
* @since 13.0.0
|
684
|
+
* @event Hooks#beforeSelectColumns
|
685
|
+
* @param {CellCoords} from Selection start coords object.
|
686
|
+
* @param {CellCoords} to Selection end coords object.
|
687
|
+
* @param {CellCoords} highlight Selection cell focus coords object.
|
688
|
+
* @example
|
689
|
+
* ::: only-for javascript
|
690
|
+
* ```js
|
691
|
+
* new Handsontable(element, {
|
692
|
+
* beforeSelectColumns: (from, to, highlight) => {
|
693
|
+
* // Extend the column selection by one column left and one column right.
|
694
|
+
* from.col = Math.max(from.col - 1, 0);
|
695
|
+
* to.col = Math.min(to.col + 1, this.countCols() - 1);
|
696
|
+
* }
|
697
|
+
* })
|
698
|
+
* ```
|
699
|
+
* :::
|
700
|
+
*
|
701
|
+
* ::: only-for react
|
702
|
+
* ```jsx
|
703
|
+
* <HotTable
|
704
|
+
* beforeSelectColumns={(from, to, highlight) => {
|
705
|
+
* // Extend the column selection by one column left and one column right.
|
706
|
+
* from.col = Math.max(from.col - 1, 0);
|
707
|
+
* to.col = Math.min(to.col + 1, this.countCols() - 1);
|
708
|
+
* }}
|
709
|
+
* />
|
710
|
+
* ```
|
711
|
+
* :::
|
712
|
+
*/
|
713
|
+
'beforeSelectColumns',
|
714
|
+
/**
|
715
|
+
* Fired after one or more columns are selected (e.g. During mouse header click or {@link Core#selectColumns} API call).
|
716
|
+
*
|
717
|
+
* @since 13.0.0
|
718
|
+
* @event Hooks#afterSelectColumns
|
719
|
+
* @param {CellCoords} from Selection start coords object.
|
720
|
+
* @param {CellCoords} to Selection end coords object.
|
721
|
+
* @param {CellCoords} highlight Selection cell focus coords object.
|
722
|
+
*/
|
723
|
+
'afterSelectColumns',
|
724
|
+
/**
|
725
|
+
* Fired before one or more rows are selected (e.g. During mouse header click or {@link Core#selectRows} API call).
|
726
|
+
*
|
727
|
+
* @since 13.0.0
|
728
|
+
* @event Hooks#beforeSelectRows
|
729
|
+
* @param {CellCoords} from Selection start coords object.
|
730
|
+
* @param {CellCoords} to Selection end coords object.
|
731
|
+
* @param {CellCoords} highlight Selection cell focus coords object.
|
732
|
+
* @example
|
733
|
+
* ::: only-for javascript
|
734
|
+
* ```js
|
735
|
+
* new Handsontable(element, {
|
736
|
+
* beforeSelectRows: (from, to, highlight) => {
|
737
|
+
* // Extend the row selection by one row up and one row bottom more.
|
738
|
+
* from.row = Math.max(from.row - 1, 0);
|
739
|
+
* to.row = Math.min(to.row + 1, this.countRows() - 1);
|
740
|
+
* }
|
741
|
+
* })
|
742
|
+
* ```
|
743
|
+
* :::
|
744
|
+
*
|
745
|
+
* ::: only-for react
|
746
|
+
* ```jsx
|
747
|
+
* <HotTable
|
748
|
+
* beforeSelectRows={(from, to, highlight) => {
|
749
|
+
* // Extend the row selection by one row up and one row bottom more.
|
750
|
+
* from.row = Math.max(from.row - 1, 0);
|
751
|
+
* to.row = Math.min(to.row + 1, this.countRows() - 1);
|
752
|
+
* }}
|
753
|
+
* />
|
754
|
+
* ```
|
755
|
+
* :::
|
756
|
+
*/
|
757
|
+
'beforeSelectRows',
|
758
|
+
/**
|
759
|
+
* Fired after one or more rows are selected (e.g. During mouse header click or {@link Core#selectRows} API call).
|
760
|
+
*
|
761
|
+
* @since 13.0.0
|
762
|
+
* @event Hooks#afterSelectRows
|
763
|
+
* @param {CellCoords} from Selection start coords object.
|
764
|
+
* @param {CellCoords} to Selection end coords object.
|
765
|
+
* @param {CellCoords} highlight Selection cell focus coords object.
|
766
|
+
*/
|
767
|
+
'afterSelectRows',
|
680
768
|
/**
|
681
769
|
* Fired after cell meta is changed.
|
682
770
|
*
|
@@ -2400,7 +2488,7 @@ var REMOVED_HOOKS = new Map([['modifyRow', '8.0.0'], ['modifyCol', '8.0.0'], ['u
|
|
2400
2488
|
* @type {Map<string, string>}
|
2401
2489
|
*/
|
2402
2490
|
/* eslint-enable jsdoc/require-description-complete-sentence */
|
2403
|
-
var DEPRECATED_HOOKS = new Map([]);
|
2491
|
+
var DEPRECATED_HOOKS = new Map([['beforeRemoveCellClassNames', 'The hook "beforeRemoveCellClassNames" is deprecated and will be removed in the next major release.']]);
|
2404
2492
|
var Hooks = /*#__PURE__*/function () {
|
2405
2493
|
/**
|
2406
2494
|
*
|
@@ -69,6 +69,7 @@ var PLUGIN_PRIORITY = 290;
|
|
69
69
|
exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
|
70
70
|
var SETTING_KEYS = ['nestedHeaders'];
|
71
71
|
var COLLAPSIBLE_ELEMENT_CLASS = 'collapsibleIndicator';
|
72
|
+
var SHORTCUTS_GROUP = PLUGIN_KEY;
|
72
73
|
var actionDictionary = new Map([['collapse', {
|
73
74
|
hideColumn: true,
|
74
75
|
beforeHook: 'beforeColumnCollapse',
|
@@ -237,6 +238,7 @@ var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
237
238
|
this.addHook('beforeOnCellMouseDown', function (event, coords, TD) {
|
238
239
|
return _this2.onBeforeOnCellMouseDown(event, coords, TD);
|
239
240
|
});
|
241
|
+
this.registerShortcuts();
|
240
242
|
_get(_getPrototypeOf(CollapsibleColumns.prototype), "enablePlugin", this).call(this);
|
241
243
|
// @TODO: Workaround for broken plugin initialization abstraction (#6806).
|
242
244
|
this.updatePlugin();
|
@@ -287,10 +289,65 @@ var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
287
289
|
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
288
290
|
_classPrivateFieldSet(this, _collapsedColumnsMap, null);
|
289
291
|
this.nestedHeadersPlugin = null;
|
292
|
+
this.unregisterShortcuts();
|
290
293
|
this.clearButtons();
|
291
294
|
_get(_getPrototypeOf(CollapsibleColumns.prototype), "disablePlugin", this).call(this);
|
292
295
|
}
|
293
296
|
|
297
|
+
/**
|
298
|
+
* Register shortcuts responsible for toggling collapsible columns.
|
299
|
+
*
|
300
|
+
* @private
|
301
|
+
*/
|
302
|
+
}, {
|
303
|
+
key: "registerShortcuts",
|
304
|
+
value: function registerShortcuts() {
|
305
|
+
var _this3 = this;
|
306
|
+
this.hot.getShortcutManager().getContext('grid').addShortcut({
|
307
|
+
keys: [['Enter']],
|
308
|
+
callback: function callback() {
|
309
|
+
var _this3$headerStateMan;
|
310
|
+
var _this3$hot$getSelecte = _this3.hot.getSelectedRangeLast().highlight,
|
311
|
+
row = _this3$hot$getSelecte.row,
|
312
|
+
col = _this3$hot$getSelecte.col;
|
313
|
+
var _ref = (_this3$headerStateMan = _this3.headerStateManager.getHeaderTreeNodeData(row, col)) !== null && _this3$headerStateMan !== void 0 ? _this3$headerStateMan : {},
|
314
|
+
collapsible = _ref.collapsible,
|
315
|
+
isCollapsed = _ref.isCollapsed,
|
316
|
+
columnIndex = _ref.columnIndex;
|
317
|
+
if (!collapsible) {
|
318
|
+
return;
|
319
|
+
}
|
320
|
+
if (isCollapsed) {
|
321
|
+
_this3.expandSection({
|
322
|
+
row: row,
|
323
|
+
col: columnIndex
|
324
|
+
});
|
325
|
+
} else {
|
326
|
+
_this3.collapseSection({
|
327
|
+
row: row,
|
328
|
+
col: columnIndex
|
329
|
+
});
|
330
|
+
}
|
331
|
+
},
|
332
|
+
runOnlyIf: function runOnlyIf() {
|
333
|
+
var _this3$hot$getSelecte2;
|
334
|
+
return (_this3$hot$getSelecte2 = _this3.hot.getSelectedRangeLast()) === null || _this3$hot$getSelecte2 === void 0 ? void 0 : _this3$hot$getSelecte2.highlight.isHeader();
|
335
|
+
},
|
336
|
+
group: SHORTCUTS_GROUP
|
337
|
+
});
|
338
|
+
}
|
339
|
+
|
340
|
+
/**
|
341
|
+
* Unregister shortcuts responsible for toggling collapsible columns.
|
342
|
+
*
|
343
|
+
* @private
|
344
|
+
*/
|
345
|
+
}, {
|
346
|
+
key: "unregisterShortcuts",
|
347
|
+
value: function unregisterShortcuts() {
|
348
|
+
this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
|
349
|
+
}
|
350
|
+
|
294
351
|
/**
|
295
352
|
* Clears the expand/collapse buttons.
|
296
353
|
*
|
@@ -360,7 +417,7 @@ var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
360
417
|
}, {
|
361
418
|
key: "toggleAllCollapsibleSections",
|
362
419
|
value: function toggleAllCollapsibleSections(action) {
|
363
|
-
var
|
420
|
+
var _this4 = this;
|
364
421
|
var coords = this.headerStateManager.mapNodes(function (headerSettings) {
|
365
422
|
var collapsible = headerSettings.collapsible,
|
366
423
|
origColspan = headerSettings.origColspan,
|
@@ -369,7 +426,7 @@ var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
369
426
|
isCollapsed = headerSettings.isCollapsed;
|
370
427
|
if (collapsible === true && origColspan > 1 && (isCollapsed && action === 'expand' || !isCollapsed && action === 'collapse')) {
|
371
428
|
return {
|
372
|
-
row:
|
429
|
+
row: _this4.headerStateManager.levelToRowCoords(headerLevel),
|
373
430
|
col: columnIndex
|
374
431
|
};
|
375
432
|
}
|
@@ -408,7 +465,7 @@ var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
408
465
|
}, {
|
409
466
|
key: "toggleCollapsibleSection",
|
410
467
|
value: function toggleCollapsibleSection(coords, action) {
|
411
|
-
var
|
468
|
+
var _this5 = this;
|
412
469
|
if (!actionDictionary.has(action)) {
|
413
470
|
throw new Error("Unsupported action is passed (".concat(action, ")."));
|
414
471
|
}
|
@@ -417,18 +474,18 @@ var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
417
474
|
}
|
418
475
|
|
419
476
|
// Ignore coordinates which points to the cells range.
|
420
|
-
var filteredCoords = (0, _array.arrayFilter)(coords, function (
|
421
|
-
var row =
|
477
|
+
var filteredCoords = (0, _array.arrayFilter)(coords, function (_ref2) {
|
478
|
+
var row = _ref2.row;
|
422
479
|
return row < 0;
|
423
480
|
});
|
424
481
|
var isActionPossible = filteredCoords.length > 0;
|
425
|
-
(0, _array.arrayEach)(filteredCoords, function (
|
426
|
-
var
|
427
|
-
var row =
|
428
|
-
column =
|
429
|
-
var
|
430
|
-
collapsible =
|
431
|
-
isCollapsed =
|
482
|
+
(0, _array.arrayEach)(filteredCoords, function (_ref3) {
|
483
|
+
var _this5$headerStateMan;
|
484
|
+
var row = _ref3.row,
|
485
|
+
column = _ref3.col;
|
486
|
+
var _ref4 = (_this5$headerStateMan = _this5.headerStateManager.getHeaderSettings(row, column)) !== null && _this5$headerStateMan !== void 0 ? _this5$headerStateMan : {},
|
487
|
+
collapsible = _ref4.collapsible,
|
488
|
+
isCollapsed = _ref4.isCollapsed;
|
432
489
|
if (!collapsible || isCollapsed && action === 'collapse' || !isCollapsed && action === 'expand') {
|
433
490
|
isActionPossible = false;
|
434
491
|
return false;
|
@@ -437,13 +494,13 @@ var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
437
494
|
var nodeModRollbacks = [];
|
438
495
|
var affectedColumnsIndexes = [];
|
439
496
|
if (isActionPossible) {
|
440
|
-
(0, _array.arrayEach)(filteredCoords, function (
|
441
|
-
var row =
|
442
|
-
column =
|
443
|
-
var
|
444
|
-
colspanCompensation =
|
445
|
-
affectedColumns =
|
446
|
-
rollbackModification =
|
497
|
+
(0, _array.arrayEach)(filteredCoords, function (_ref5) {
|
498
|
+
var row = _ref5.row,
|
499
|
+
column = _ref5.col;
|
500
|
+
var _this5$headerStateMan2 = _this5.headerStateManager.triggerNodeModification(action, row, column),
|
501
|
+
colspanCompensation = _this5$headerStateMan2.colspanCompensation,
|
502
|
+
affectedColumns = _this5$headerStateMan2.affectedColumns,
|
503
|
+
rollbackModification = _this5$headerStateMan2.rollbackModification;
|
447
504
|
if (colspanCompensation > 0) {
|
448
505
|
affectedColumnsIndexes.push.apply(affectedColumnsIndexes, _toConsumableArray(affectedColumns));
|
449
506
|
nodeModRollbacks.push(rollbackModification);
|
@@ -470,7 +527,7 @@ var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
470
527
|
}
|
471
528
|
this.hot.batchExecution(function () {
|
472
529
|
(0, _array.arrayEach)(affectedColumnsIndexes, function (visualColumn) {
|
473
|
-
_classPrivateFieldGet(
|
530
|
+
_classPrivateFieldGet(_this5, _collapsedColumnsMap).setValueAtIndex(_this5.hot.toPhysicalColumn(visualColumn), actionTranslator.hideColumn);
|
474
531
|
});
|
475
532
|
}, true);
|
476
533
|
var isActionPerformed = this.getCollapsedColumns().length !== currentCollapsedColumns.length;
|
@@ -504,10 +561,10 @@ var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
504
561
|
key: "onAfterGetColHeader",
|
505
562
|
value: function onAfterGetColHeader(column, TH, headerLevel) {
|
506
563
|
var _this$headerStateMana;
|
507
|
-
var
|
508
|
-
collapsible =
|
509
|
-
origColspan =
|
510
|
-
isCollapsed =
|
564
|
+
var _ref6 = (_this$headerStateMana = this.headerStateManager.getHeaderSettings(headerLevel, column)) !== null && _this$headerStateMana !== void 0 ? _this$headerStateMana : {},
|
565
|
+
collapsible = _ref6.collapsible,
|
566
|
+
origColspan = _ref6.origColspan,
|
567
|
+
isCollapsed = _ref6.isCollapsed;
|
511
568
|
var isNodeCollapsible = collapsible && origColspan > 1 && column >= this.hot.getSettings().fixedColumnsStart;
|
512
569
|
var collapsibleElement = TH.querySelector(".".concat(COLLAPSIBLE_ELEMENT_CLASS));
|
513
570
|
if (isNodeCollapsible) {
|
@@ -62,6 +62,7 @@ export var PLUGIN_KEY = 'collapsibleColumns';
|
|
62
62
|
export var PLUGIN_PRIORITY = 290;
|
63
63
|
var SETTING_KEYS = ['nestedHeaders'];
|
64
64
|
var COLLAPSIBLE_ELEMENT_CLASS = 'collapsibleIndicator';
|
65
|
+
var SHORTCUTS_GROUP = PLUGIN_KEY;
|
65
66
|
var actionDictionary = new Map([['collapse', {
|
66
67
|
hideColumn: true,
|
67
68
|
beforeHook: 'beforeColumnCollapse',
|
@@ -230,6 +231,7 @@ export var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
230
231
|
this.addHook('beforeOnCellMouseDown', function (event, coords, TD) {
|
231
232
|
return _this2.onBeforeOnCellMouseDown(event, coords, TD);
|
232
233
|
});
|
234
|
+
this.registerShortcuts();
|
233
235
|
_get(_getPrototypeOf(CollapsibleColumns.prototype), "enablePlugin", this).call(this);
|
234
236
|
// @TODO: Workaround for broken plugin initialization abstraction (#6806).
|
235
237
|
this.updatePlugin();
|
@@ -280,10 +282,65 @@ export var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
280
282
|
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
281
283
|
_classPrivateFieldSet(this, _collapsedColumnsMap, null);
|
282
284
|
this.nestedHeadersPlugin = null;
|
285
|
+
this.unregisterShortcuts();
|
283
286
|
this.clearButtons();
|
284
287
|
_get(_getPrototypeOf(CollapsibleColumns.prototype), "disablePlugin", this).call(this);
|
285
288
|
}
|
286
289
|
|
290
|
+
/**
|
291
|
+
* Register shortcuts responsible for toggling collapsible columns.
|
292
|
+
*
|
293
|
+
* @private
|
294
|
+
*/
|
295
|
+
}, {
|
296
|
+
key: "registerShortcuts",
|
297
|
+
value: function registerShortcuts() {
|
298
|
+
var _this3 = this;
|
299
|
+
this.hot.getShortcutManager().getContext('grid').addShortcut({
|
300
|
+
keys: [['Enter']],
|
301
|
+
callback: function callback() {
|
302
|
+
var _this3$headerStateMan;
|
303
|
+
var _this3$hot$getSelecte = _this3.hot.getSelectedRangeLast().highlight,
|
304
|
+
row = _this3$hot$getSelecte.row,
|
305
|
+
col = _this3$hot$getSelecte.col;
|
306
|
+
var _ref = (_this3$headerStateMan = _this3.headerStateManager.getHeaderTreeNodeData(row, col)) !== null && _this3$headerStateMan !== void 0 ? _this3$headerStateMan : {},
|
307
|
+
collapsible = _ref.collapsible,
|
308
|
+
isCollapsed = _ref.isCollapsed,
|
309
|
+
columnIndex = _ref.columnIndex;
|
310
|
+
if (!collapsible) {
|
311
|
+
return;
|
312
|
+
}
|
313
|
+
if (isCollapsed) {
|
314
|
+
_this3.expandSection({
|
315
|
+
row: row,
|
316
|
+
col: columnIndex
|
317
|
+
});
|
318
|
+
} else {
|
319
|
+
_this3.collapseSection({
|
320
|
+
row: row,
|
321
|
+
col: columnIndex
|
322
|
+
});
|
323
|
+
}
|
324
|
+
},
|
325
|
+
runOnlyIf: function runOnlyIf() {
|
326
|
+
var _this3$hot$getSelecte2;
|
327
|
+
return (_this3$hot$getSelecte2 = _this3.hot.getSelectedRangeLast()) === null || _this3$hot$getSelecte2 === void 0 ? void 0 : _this3$hot$getSelecte2.highlight.isHeader();
|
328
|
+
},
|
329
|
+
group: SHORTCUTS_GROUP
|
330
|
+
});
|
331
|
+
}
|
332
|
+
|
333
|
+
/**
|
334
|
+
* Unregister shortcuts responsible for toggling collapsible columns.
|
335
|
+
*
|
336
|
+
* @private
|
337
|
+
*/
|
338
|
+
}, {
|
339
|
+
key: "unregisterShortcuts",
|
340
|
+
value: function unregisterShortcuts() {
|
341
|
+
this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
|
342
|
+
}
|
343
|
+
|
287
344
|
/**
|
288
345
|
* Clears the expand/collapse buttons.
|
289
346
|
*
|
@@ -353,7 +410,7 @@ export var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
353
410
|
}, {
|
354
411
|
key: "toggleAllCollapsibleSections",
|
355
412
|
value: function toggleAllCollapsibleSections(action) {
|
356
|
-
var
|
413
|
+
var _this4 = this;
|
357
414
|
var coords = this.headerStateManager.mapNodes(function (headerSettings) {
|
358
415
|
var collapsible = headerSettings.collapsible,
|
359
416
|
origColspan = headerSettings.origColspan,
|
@@ -362,7 +419,7 @@ export var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
362
419
|
isCollapsed = headerSettings.isCollapsed;
|
363
420
|
if (collapsible === true && origColspan > 1 && (isCollapsed && action === 'expand' || !isCollapsed && action === 'collapse')) {
|
364
421
|
return {
|
365
|
-
row:
|
422
|
+
row: _this4.headerStateManager.levelToRowCoords(headerLevel),
|
366
423
|
col: columnIndex
|
367
424
|
};
|
368
425
|
}
|
@@ -401,7 +458,7 @@ export var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
401
458
|
}, {
|
402
459
|
key: "toggleCollapsibleSection",
|
403
460
|
value: function toggleCollapsibleSection(coords, action) {
|
404
|
-
var
|
461
|
+
var _this5 = this;
|
405
462
|
if (!actionDictionary.has(action)) {
|
406
463
|
throw new Error("Unsupported action is passed (".concat(action, ")."));
|
407
464
|
}
|
@@ -410,18 +467,18 @@ export var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
410
467
|
}
|
411
468
|
|
412
469
|
// Ignore coordinates which points to the cells range.
|
413
|
-
var filteredCoords = arrayFilter(coords, function (
|
414
|
-
var row =
|
470
|
+
var filteredCoords = arrayFilter(coords, function (_ref2) {
|
471
|
+
var row = _ref2.row;
|
415
472
|
return row < 0;
|
416
473
|
});
|
417
474
|
var isActionPossible = filteredCoords.length > 0;
|
418
|
-
arrayEach(filteredCoords, function (
|
419
|
-
var
|
420
|
-
var row =
|
421
|
-
column =
|
422
|
-
var
|
423
|
-
collapsible =
|
424
|
-
isCollapsed =
|
475
|
+
arrayEach(filteredCoords, function (_ref3) {
|
476
|
+
var _this5$headerStateMan;
|
477
|
+
var row = _ref3.row,
|
478
|
+
column = _ref3.col;
|
479
|
+
var _ref4 = (_this5$headerStateMan = _this5.headerStateManager.getHeaderSettings(row, column)) !== null && _this5$headerStateMan !== void 0 ? _this5$headerStateMan : {},
|
480
|
+
collapsible = _ref4.collapsible,
|
481
|
+
isCollapsed = _ref4.isCollapsed;
|
425
482
|
if (!collapsible || isCollapsed && action === 'collapse' || !isCollapsed && action === 'expand') {
|
426
483
|
isActionPossible = false;
|
427
484
|
return false;
|
@@ -430,13 +487,13 @@ export var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
430
487
|
var nodeModRollbacks = [];
|
431
488
|
var affectedColumnsIndexes = [];
|
432
489
|
if (isActionPossible) {
|
433
|
-
arrayEach(filteredCoords, function (
|
434
|
-
var row =
|
435
|
-
column =
|
436
|
-
var
|
437
|
-
colspanCompensation =
|
438
|
-
affectedColumns =
|
439
|
-
rollbackModification =
|
490
|
+
arrayEach(filteredCoords, function (_ref5) {
|
491
|
+
var row = _ref5.row,
|
492
|
+
column = _ref5.col;
|
493
|
+
var _this5$headerStateMan2 = _this5.headerStateManager.triggerNodeModification(action, row, column),
|
494
|
+
colspanCompensation = _this5$headerStateMan2.colspanCompensation,
|
495
|
+
affectedColumns = _this5$headerStateMan2.affectedColumns,
|
496
|
+
rollbackModification = _this5$headerStateMan2.rollbackModification;
|
440
497
|
if (colspanCompensation > 0) {
|
441
498
|
affectedColumnsIndexes.push.apply(affectedColumnsIndexes, _toConsumableArray(affectedColumns));
|
442
499
|
nodeModRollbacks.push(rollbackModification);
|
@@ -463,7 +520,7 @@ export var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
463
520
|
}
|
464
521
|
this.hot.batchExecution(function () {
|
465
522
|
arrayEach(affectedColumnsIndexes, function (visualColumn) {
|
466
|
-
_classPrivateFieldGet(
|
523
|
+
_classPrivateFieldGet(_this5, _collapsedColumnsMap).setValueAtIndex(_this5.hot.toPhysicalColumn(visualColumn), actionTranslator.hideColumn);
|
467
524
|
});
|
468
525
|
}, true);
|
469
526
|
var isActionPerformed = this.getCollapsedColumns().length !== currentCollapsedColumns.length;
|
@@ -497,10 +554,10 @@ export var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
497
554
|
key: "onAfterGetColHeader",
|
498
555
|
value: function onAfterGetColHeader(column, TH, headerLevel) {
|
499
556
|
var _this$headerStateMana;
|
500
|
-
var
|
501
|
-
collapsible =
|
502
|
-
origColspan =
|
503
|
-
isCollapsed =
|
557
|
+
var _ref6 = (_this$headerStateMana = this.headerStateManager.getHeaderSettings(headerLevel, column)) !== null && _this$headerStateMana !== void 0 ? _this$headerStateMana : {},
|
558
|
+
collapsible = _ref6.collapsible,
|
559
|
+
origColspan = _ref6.origColspan,
|
560
|
+
isCollapsed = _ref6.isCollapsed;
|
504
561
|
var isNodeCollapsible = collapsible && origColspan > 1 && column >= this.hot.getSettings().fixedColumnsStart;
|
505
562
|
var collapsibleElement = TH.querySelector(".".concat(COLLAPSIBLE_ELEMENT_CLASS));
|
506
563
|
if (isNodeCollapsible) {
|