handsontable 0.0.0-next-b7cca45-20230605 → 0.0.0-next-aa25cac-20230607
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 +328 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +322 -0
- package/3rdparty/walkontable/src/selection/scanner.js +363 -0
- package/3rdparty/walkontable/src/selection/scanner.mjs +359 -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/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +5 -3
- package/core.js +123 -308
- package/core.mjs +123 -308
- package/dataMap/metaManager/metaSchema.js +15 -0
- package/dataMap/metaManager/metaSchema.mjs +15 -0
- package/dist/handsontable.css +8 -3
- package/dist/handsontable.full.css +8 -3
- package/dist/handsontable.full.js +12578 -10028
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +120 -120
- package/dist/handsontable.js +18881 -16331
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +4 -4
- package/editorManager.js +21 -82
- package/editorManager.mjs +26 -86
- package/editors/textEditor/textEditor.js +3 -11
- package/editors/textEditor/textEditor.mjs +4 -12
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/number.d.ts +1 -0
- package/helpers/number.js +18 -0
- package/helpers/number.mjs +17 -0
- package/package.json +1 -1
- package/pluginHooks.d.ts +5 -1
- package/pluginHooks.js +89 -1
- package/pluginHooks.mjs +89 -1
- package/plugins/copyPaste/copyPaste.js +5 -1
- package/plugins/copyPaste/copyPaste.mjs +5 -1
- package/plugins/customBorders/customBorders.js +18 -52
- package/plugins/customBorders/customBorders.mjs +19 -53
- package/plugins/mergeCells/mergeCells.js +5 -18
- package/plugins/mergeCells/mergeCells.mjs +5 -18
- 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/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/highlight.js +311 -88
- package/selection/highlight/highlight.mjs +301 -84
- 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 -180
- package/selection/selection.mjs +310 -179
- package/selection/transformation.js +233 -96
- package/selection/transformation.mjs +230 -93
- package/selection/utils.js +12 -35
- package/selection/utils.mjs +13 -35
- 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 +39 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +34 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +39 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +34 -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 +51 -0
- package/shortcutContexts/commands/index.mjs +47 -0
- package/shortcutContexts/commands/moveCellSelection/down.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/down.mjs +7 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +11 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +6 -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 +35 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +30 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +35 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +30 -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 +11 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +6 -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 +244 -0
- package/shortcutContexts/grid.mjs +240 -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/tableView.js +58 -9
- package/tableView.mjs +58 -9
- package/3rdparty/walkontable/src/selection.js +0 -354
- package/3rdparty/walkontable/src/selection.mjs +0 -348
- package/selection/highlight/constants.js +0 -16
- package/selection/highlight/constants.mjs +0 -6
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
|
*
|
@@ -2414,7 +2502,7 @@ var REMOVED_HOOKS = new Map([['modifyRow', '8.0.0'], ['modifyCol', '8.0.0'], ['u
|
|
2414
2502
|
* @type {Map<string, string>}
|
2415
2503
|
*/
|
2416
2504
|
/* eslint-enable jsdoc/require-description-complete-sentence */
|
2417
|
-
var DEPRECATED_HOOKS = new Map([['beforeAutofillInsidePopulate', 'The plugin hook "beforeAutofillInsidePopulate" is deprecated and will be removed in the next major release.']]);
|
2505
|
+
var DEPRECATED_HOOKS = new Map([['beforeAutofillInsidePopulate', 'The plugin hook "beforeAutofillInsidePopulate" is deprecated and will be removed in the next major release.'], ['beforeRemoveCellClassNames', 'The hook "beforeRemoveCellClassNames" is deprecated and will be removed in the next major release.']]);
|
2418
2506
|
var Hooks = /*#__PURE__*/function () {
|
2419
2507
|
/**
|
2420
2508
|
*
|
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
|
*
|
@@ -2411,7 +2499,7 @@ var REMOVED_HOOKS = new Map([['modifyRow', '8.0.0'], ['modifyCol', '8.0.0'], ['u
|
|
2411
2499
|
* @type {Map<string, string>}
|
2412
2500
|
*/
|
2413
2501
|
/* eslint-enable jsdoc/require-description-complete-sentence */
|
2414
|
-
var DEPRECATED_HOOKS = new Map([['beforeAutofillInsidePopulate', 'The plugin hook "beforeAutofillInsidePopulate" is deprecated and will be removed in the next major release.']]);
|
2502
|
+
var DEPRECATED_HOOKS = new Map([['beforeAutofillInsidePopulate', 'The plugin hook "beforeAutofillInsidePopulate" is deprecated and will be removed in the next major release.'], ['beforeRemoveCellClassNames', 'The hook "beforeRemoveCellClassNames" is deprecated and will be removed in the next major release.']]);
|
2415
2503
|
var Hooks = /*#__PURE__*/function () {
|
2416
2504
|
/**
|
2417
2505
|
*
|
@@ -527,6 +527,10 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
527
527
|
if (!selectionRange) {
|
528
528
|
return;
|
529
529
|
}
|
530
|
+
if (selectionRange.isSingleHeader()) {
|
531
|
+
this.copyableRanges = [];
|
532
|
+
return;
|
533
|
+
}
|
530
534
|
_classPrivateFieldGet(this, _copyableRangesFactory).setSelectedRange(selectionRange);
|
531
535
|
var groupedRanges = new Map([['headers', null], ['cells', null]]);
|
532
536
|
if (_classPrivateFieldGet(this, _copyMode) === 'column-headers-only') {
|
@@ -755,7 +759,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
755
759
|
if (typeof pastedData === 'string') {
|
756
760
|
pastedData = (0, _SheetClip.parse)(pastedData);
|
757
761
|
}
|
758
|
-
if (pastedData && pastedData.length === 0) {
|
762
|
+
if (pastedData === void 0 || pastedData && pastedData.length === 0) {
|
759
763
|
return;
|
760
764
|
}
|
761
765
|
if (this.hot.runHooks('beforePaste', pastedData, this.copyableRanges) === false) {
|
@@ -520,6 +520,10 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
520
520
|
if (!selectionRange) {
|
521
521
|
return;
|
522
522
|
}
|
523
|
+
if (selectionRange.isSingleHeader()) {
|
524
|
+
this.copyableRanges = [];
|
525
|
+
return;
|
526
|
+
}
|
523
527
|
_classPrivateFieldGet(this, _copyableRangesFactory).setSelectedRange(selectionRange);
|
524
528
|
var groupedRanges = new Map([['headers', null], ['cells', null]]);
|
525
529
|
if (_classPrivateFieldGet(this, _copyMode) === 'column-headers-only') {
|
@@ -748,7 +752,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
748
752
|
if (typeof pastedData === 'string') {
|
749
753
|
pastedData = parse(pastedData);
|
750
754
|
}
|
751
|
-
if (pastedData && pastedData.length === 0) {
|
755
|
+
if (pastedData === void 0 || pastedData && pastedData.length === 0) {
|
752
756
|
return;
|
753
757
|
}
|
754
758
|
if (this.hot.runHooks('beforePaste', pastedData, this.copyableRanges) === false) {
|
@@ -9,10 +9,6 @@ require("core-js/modules/es.symbol.iterator.js");
|
|
9
9
|
require("core-js/modules/es.array.iterator.js");
|
10
10
|
require("core-js/modules/es.string.iterator.js");
|
11
11
|
require("core-js/modules/web.dom-collections.iterator.js");
|
12
|
-
require("core-js/modules/es.array.slice.js");
|
13
|
-
require("core-js/modules/es.function.name.js");
|
14
|
-
require("core-js/modules/es.array.from.js");
|
15
|
-
require("core-js/modules/es.regexp.exec.js");
|
16
12
|
require("core-js/modules/es.weak-map.js");
|
17
13
|
exports.__esModule = true;
|
18
14
|
exports.PLUGIN_PRIORITY = exports.PLUGIN_KEY = exports.CustomBorders = void 0;
|
@@ -38,12 +34,6 @@ var _selection = require("../../selection");
|
|
38
34
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
39
35
|
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; }
|
40
36
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
41
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
42
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
43
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
44
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
45
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
46
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
47
37
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
48
38
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
49
39
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
@@ -229,25 +219,11 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
229
219
|
var selectionType = (0, _selection.detectSelectionType)(selectionRanges);
|
230
220
|
var selectionSchemaNormalizer = (0, _selection.normalizeSelectionFactory)(selectionType);
|
231
221
|
(0, _array.arrayEach)(selectionRanges, function (selection) {
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
columnEnd = _selectionSchemaNorma2[3];
|
238
|
-
var _loop = function _loop(row) {
|
239
|
-
var _loop2 = function _loop2(col) {
|
240
|
-
(0, _array.arrayEach)(borderKeys, function (borderKey) {
|
241
|
-
_this3.prepareBorderFromCustomAdded(row, col, normBorder, (0, _utils.toInlinePropName)(borderKey));
|
242
|
-
});
|
243
|
-
};
|
244
|
-
for (var col = columnStart; col <= columnEnd; col += 1) {
|
245
|
-
_loop2(col);
|
246
|
-
}
|
247
|
-
};
|
248
|
-
for (var row = rowStart; row <= rowEnd; row += 1) {
|
249
|
-
_loop(row);
|
250
|
-
}
|
222
|
+
selectionSchemaNormalizer(selection).forAll(function (row, col) {
|
223
|
+
(0, _array.arrayEach)(borderKeys, function (borderKey) {
|
224
|
+
_this3.prepareBorderFromCustomAdded(row, col, normBorder, (0, _utils.toInlinePropName)(borderKey));
|
225
|
+
});
|
226
|
+
});
|
251
227
|
});
|
252
228
|
|
253
229
|
/*
|
@@ -290,27 +266,13 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
290
266
|
var selectionSchemaNormalizer = (0, _selection.normalizeSelectionFactory)(selectionType);
|
291
267
|
var selectedBorders = [];
|
292
268
|
(0, _array.arrayEach)(selectionRanges, function (selection) {
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
var _loop4 = function _loop4(col) {
|
301
|
-
(0, _array.arrayEach)(_this4.savedBorders, function (border) {
|
302
|
-
if (border.row === row && border.col === col) {
|
303
|
-
selectedBorders.push((0, _utils.denormalizeBorder)(border));
|
304
|
-
}
|
305
|
-
});
|
306
|
-
};
|
307
|
-
for (var col = columnStart; col <= columnEnd; col += 1) {
|
308
|
-
_loop4(col);
|
309
|
-
}
|
310
|
-
};
|
311
|
-
for (var row = rowStart; row <= rowEnd; row += 1) {
|
312
|
-
_loop3(row);
|
313
|
-
}
|
269
|
+
selectionSchemaNormalizer(selection).forAll(function (row, col) {
|
270
|
+
(0, _array.arrayEach)(_this4.savedBorders, function (border) {
|
271
|
+
if (border.row === row && border.col === col) {
|
272
|
+
selectedBorders.push((0, _utils.denormalizeBorder)(border));
|
273
|
+
}
|
274
|
+
});
|
275
|
+
});
|
314
276
|
});
|
315
277
|
return selectedBorders;
|
316
278
|
}
|
@@ -735,10 +697,12 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
735
697
|
}, {
|
736
698
|
key: "checkCustomSelectionsFromContextMenu",
|
737
699
|
value: function checkCustomSelectionsFromContextMenu(border, place, remove) {
|
700
|
+
var _this12 = this;
|
738
701
|
var check = false;
|
739
702
|
(0, _array.arrayEach)(this.hot.selection.highlight.customSelections, function (customSelection) {
|
740
703
|
if (border.id === customSelection.settings.id) {
|
741
|
-
|
704
|
+
var borders = _this12.hot.view._wt.selectionManager.getBorderInstances(customSelection);
|
705
|
+
(0, _array.arrayEach)(borders, function (borderObject) {
|
742
706
|
borderObject.toggleHiddenClass(place, remove); // TODO this also bad?
|
743
707
|
});
|
744
708
|
|
@@ -763,6 +727,7 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
763
727
|
}, {
|
764
728
|
key: "checkCustomSelections",
|
765
729
|
value: function checkCustomSelections(border, cellRange, place) {
|
730
|
+
var _this13 = this;
|
766
731
|
var hideCount = this.countHide(border);
|
767
732
|
var check = false;
|
768
733
|
if (hideCount === 4) {
|
@@ -774,7 +739,8 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
774
739
|
customSelection.visualCellRange = cellRange;
|
775
740
|
customSelection.commit();
|
776
741
|
if (place) {
|
777
|
-
|
742
|
+
var borders = _this13.hot.view._wt.selectionManager.getBorderInstances(customSelection);
|
743
|
+
(0, _array.arrayEach)(borders, function (borderObject) {
|
778
744
|
borderObject.changeBorderStyle(place, border);
|
779
745
|
});
|
780
746
|
}
|
@@ -1,10 +1,4 @@
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
2
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
3
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
4
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
5
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
6
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
7
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
8
2
|
import "core-js/modules/es.array.concat.js";
|
9
3
|
import "core-js/modules/es.object.keys.js";
|
10
4
|
import "core-js/modules/es.object.assign.js";
|
@@ -25,10 +19,6 @@ import "core-js/modules/es.symbol.iterator.js";
|
|
25
19
|
import "core-js/modules/es.array.iterator.js";
|
26
20
|
import "core-js/modules/es.string.iterator.js";
|
27
21
|
import "core-js/modules/web.dom-collections.iterator.js";
|
28
|
-
import "core-js/modules/es.array.slice.js";
|
29
|
-
import "core-js/modules/es.function.name.js";
|
30
|
-
import "core-js/modules/es.array.from.js";
|
31
|
-
import "core-js/modules/es.regexp.exec.js";
|
32
22
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
33
23
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
34
24
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
@@ -45,7 +35,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
45
35
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
46
36
|
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); }
|
47
37
|
import { BasePlugin } from "../base/index.mjs";
|
48
|
-
import { hasOwnProperty,
|
38
|
+
import { hasOwnProperty, deepClone } from "../../helpers/object.mjs";
|
49
39
|
import { rangeEach } from "../../helpers/number.mjs";
|
50
40
|
import { arrayEach, arrayReduce, arrayMap } from "../../helpers/array.mjs";
|
51
41
|
import * as C from "../../i18n/constants.mjs";
|
@@ -220,25 +210,11 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
220
210
|
var selectionType = detectSelectionType(selectionRanges);
|
221
211
|
var selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
|
222
212
|
arrayEach(selectionRanges, function (selection) {
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
columnEnd = _selectionSchemaNorma2[3];
|
229
|
-
var _loop = function _loop(row) {
|
230
|
-
var _loop2 = function _loop2(col) {
|
231
|
-
arrayEach(borderKeys, function (borderKey) {
|
232
|
-
_this3.prepareBorderFromCustomAdded(row, col, normBorder, toInlinePropName(borderKey));
|
233
|
-
});
|
234
|
-
};
|
235
|
-
for (var col = columnStart; col <= columnEnd; col += 1) {
|
236
|
-
_loop2(col);
|
237
|
-
}
|
238
|
-
};
|
239
|
-
for (var row = rowStart; row <= rowEnd; row += 1) {
|
240
|
-
_loop(row);
|
241
|
-
}
|
213
|
+
selectionSchemaNormalizer(selection).forAll(function (row, col) {
|
214
|
+
arrayEach(borderKeys, function (borderKey) {
|
215
|
+
_this3.prepareBorderFromCustomAdded(row, col, normBorder, toInlinePropName(borderKey));
|
216
|
+
});
|
217
|
+
});
|
242
218
|
});
|
243
219
|
|
244
220
|
/*
|
@@ -281,27 +257,13 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
281
257
|
var selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
|
282
258
|
var selectedBorders = [];
|
283
259
|
arrayEach(selectionRanges, function (selection) {
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
var _loop4 = function _loop4(col) {
|
292
|
-
arrayEach(_this4.savedBorders, function (border) {
|
293
|
-
if (border.row === row && border.col === col) {
|
294
|
-
selectedBorders.push(denormalizeBorder(border));
|
295
|
-
}
|
296
|
-
});
|
297
|
-
};
|
298
|
-
for (var col = columnStart; col <= columnEnd; col += 1) {
|
299
|
-
_loop4(col);
|
300
|
-
}
|
301
|
-
};
|
302
|
-
for (var row = rowStart; row <= rowEnd; row += 1) {
|
303
|
-
_loop3(row);
|
304
|
-
}
|
260
|
+
selectionSchemaNormalizer(selection).forAll(function (row, col) {
|
261
|
+
arrayEach(_this4.savedBorders, function (border) {
|
262
|
+
if (border.row === row && border.col === col) {
|
263
|
+
selectedBorders.push(denormalizeBorder(border));
|
264
|
+
}
|
265
|
+
});
|
266
|
+
});
|
305
267
|
});
|
306
268
|
return selectedBorders;
|
307
269
|
}
|
@@ -726,10 +688,12 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
726
688
|
}, {
|
727
689
|
key: "checkCustomSelectionsFromContextMenu",
|
728
690
|
value: function checkCustomSelectionsFromContextMenu(border, place, remove) {
|
691
|
+
var _this12 = this;
|
729
692
|
var check = false;
|
730
693
|
arrayEach(this.hot.selection.highlight.customSelections, function (customSelection) {
|
731
694
|
if (border.id === customSelection.settings.id) {
|
732
|
-
|
695
|
+
var borders = _this12.hot.view._wt.selectionManager.getBorderInstances(customSelection);
|
696
|
+
arrayEach(borders, function (borderObject) {
|
733
697
|
borderObject.toggleHiddenClass(place, remove); // TODO this also bad?
|
734
698
|
});
|
735
699
|
|
@@ -754,6 +718,7 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
754
718
|
}, {
|
755
719
|
key: "checkCustomSelections",
|
756
720
|
value: function checkCustomSelections(border, cellRange, place) {
|
721
|
+
var _this13 = this;
|
757
722
|
var hideCount = this.countHide(border);
|
758
723
|
var check = false;
|
759
724
|
if (hideCount === 4) {
|
@@ -765,7 +730,8 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
765
730
|
customSelection.visualCellRange = cellRange;
|
766
731
|
customSelection.commit();
|
767
732
|
if (place) {
|
768
|
-
|
733
|
+
var borders = _this13.hot.view._wt.selectionManager.getBorderInstances(customSelection);
|
734
|
+
arrayEach(borders, function (borderObject) {
|
769
735
|
borderObject.changeBorderStyle(place, border);
|
770
736
|
});
|
771
737
|
}
|
@@ -242,9 +242,6 @@ var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
242
242
|
this.addHook('afterDrawSelection', function () {
|
243
243
|
return _this2.onAfterDrawSelection.apply(_this2, arguments);
|
244
244
|
});
|
245
|
-
this.addHook('beforeRemoveCellClassNames', function () {
|
246
|
-
return _this2.onBeforeRemoveCellClassNames.apply(_this2, arguments);
|
247
|
-
});
|
248
245
|
this.addHook('beforeUndoStackChange', function (action, source) {
|
249
246
|
if (source === 'MergeCells') {
|
250
247
|
return false;
|
@@ -661,8 +658,11 @@ var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
661
658
|
gridContext.addShortcut({
|
662
659
|
keys: [['Control', 'm']],
|
663
660
|
callback: function callback() {
|
664
|
-
_this7.
|
665
|
-
|
661
|
+
var range = _this7.hot.getSelectedRangeLast();
|
662
|
+
if (range && !range.isSingleHeader()) {
|
663
|
+
_this7.toggleMerge(range);
|
664
|
+
_this7.hot.render();
|
665
|
+
}
|
666
666
|
},
|
667
667
|
runOnlyIf: function runOnlyIf(event) {
|
668
668
|
return !event.altKey;
|
@@ -1339,19 +1339,6 @@ var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
1339
1339
|
}
|
1340
1340
|
return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel);
|
1341
1341
|
}
|
1342
|
-
|
1343
|
-
/**
|
1344
|
-
* `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table.
|
1345
|
-
*
|
1346
|
-
* @private
|
1347
|
-
* @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from
|
1348
|
-
* all the cells in the table.
|
1349
|
-
*/
|
1350
|
-
}, {
|
1351
|
-
key: "onBeforeRemoveCellClassNames",
|
1352
|
-
value: function onBeforeRemoveCellClassNames() {
|
1353
|
-
return this.selectionCalculations.getSelectedMergedCellClassNameToRemove();
|
1354
|
-
}
|
1355
1342
|
}], [{
|
1356
1343
|
key: "PLUGIN_KEY",
|
1357
1344
|
get: function get() {
|
@@ -235,9 +235,6 @@ export var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
235
235
|
this.addHook('afterDrawSelection', function () {
|
236
236
|
return _this2.onAfterDrawSelection.apply(_this2, arguments);
|
237
237
|
});
|
238
|
-
this.addHook('beforeRemoveCellClassNames', function () {
|
239
|
-
return _this2.onBeforeRemoveCellClassNames.apply(_this2, arguments);
|
240
|
-
});
|
241
238
|
this.addHook('beforeUndoStackChange', function (action, source) {
|
242
239
|
if (source === 'MergeCells') {
|
243
240
|
return false;
|
@@ -654,8 +651,11 @@ export var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
654
651
|
gridContext.addShortcut({
|
655
652
|
keys: [['Control', 'm']],
|
656
653
|
callback: function callback() {
|
657
|
-
_this7.
|
658
|
-
|
654
|
+
var range = _this7.hot.getSelectedRangeLast();
|
655
|
+
if (range && !range.isSingleHeader()) {
|
656
|
+
_this7.toggleMerge(range);
|
657
|
+
_this7.hot.render();
|
658
|
+
}
|
659
659
|
},
|
660
660
|
runOnlyIf: function runOnlyIf(event) {
|
661
661
|
return !event.altKey;
|
@@ -1332,19 +1332,6 @@ export var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
1332
1332
|
}
|
1333
1333
|
return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel);
|
1334
1334
|
}
|
1335
|
-
|
1336
|
-
/**
|
1337
|
-
* `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table.
|
1338
|
-
*
|
1339
|
-
* @private
|
1340
|
-
* @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from
|
1341
|
-
* all the cells in the table.
|
1342
|
-
*/
|
1343
|
-
}, {
|
1344
|
-
key: "onBeforeRemoveCellClassNames",
|
1345
|
-
value: function onBeforeRemoveCellClassNames() {
|
1346
|
-
return this.selectionCalculations.getSelectedMergedCellClassNameToRemove();
|
1347
|
-
}
|
1348
1335
|
}], [{
|
1349
1336
|
key: "PLUGIN_KEY",
|
1350
1337
|
get: function get() {
|