handsontable 0.0.0-next-8dc7078-20240322 → 0.0.0-next-28fc088-20240325
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/range.d.ts +2 -1
- package/3rdparty/walkontable/src/cell/range.js +22 -5
- package/3rdparty/walkontable/src/cell/range.mjs +22 -5
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +4 -1
- package/core/viewportScroll/index.mjs +4 -1
- package/core/viewportScroll/scrollStrategies/focusScroll.js +15 -0
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +11 -0
- package/core.d.ts +4 -3
- package/core.js +76 -21
- package/core.mjs +76 -21
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +2649 -1389
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +71 -71
- package/dist/handsontable.js +2653 -1393
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +19 -19
- package/editorManager.js +12 -8
- package/editorManager.mjs +12 -8
- package/focusManager.js +7 -1
- package/focusManager.mjs +7 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +4 -0
- package/pluginHooks.js +98 -37
- package/pluginHooks.mjs +98 -37
- package/plugins/collapsibleColumns/collapsibleColumns.js +9 -3
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +9 -3
- package/plugins/columnSorting/columnSorting.js +8 -2
- package/plugins/columnSorting/columnSorting.mjs +8 -2
- package/plugins/contextMenu/menu/defaultShortcutsList.js +26 -10
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +26 -10
- package/plugins/mergeCells/calculations/selection.js +1 -70
- package/plugins/mergeCells/calculations/selection.mjs +1 -70
- package/plugins/mergeCells/cellsCollection.js +116 -0
- package/plugins/mergeCells/cellsCollection.mjs +116 -0
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +11 -1
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +11 -1
- package/plugins/mergeCells/focusOrder.js +305 -0
- package/plugins/mergeCells/focusOrder.mjs +300 -0
- package/plugins/mergeCells/mergeCells.js +336 -192
- package/plugins/mergeCells/mergeCells.mjs +336 -192
- package/plugins/multiColumnSorting/multiColumnSorting.js +8 -2
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +8 -2
- package/plugins/nestedHeaders/nestedHeaders.js +1 -0
- package/plugins/nestedHeaders/nestedHeaders.mjs +1 -0
- package/plugins/nestedRows/nestedRows.js +9 -3
- package/plugins/nestedRows/nestedRows.mjs +9 -3
- package/renderers/checkboxRenderer/checkboxRenderer.js +8 -5
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +8 -5
- package/selection/highlight/visualSelection.js +2 -0
- package/selection/highlight/visualSelection.mjs +2 -0
- package/selection/selection.js +209 -40
- package/selection/selection.mjs +208 -39
- package/selection/transformation.js +83 -32
- package/selection/transformation.mjs +83 -32
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +18 -3
- package/shortcutContexts/commands/editor/open.mjs +18 -3
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +9 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +9 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +10 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +10 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +6 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +6 -1
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +6 -1
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +6 -1
- package/shortcutContexts/grid.js +2 -2
- package/shortcutContexts/grid.mjs +2 -2
- package/shortcuts/context.js +2 -1
- package/shortcuts/context.mjs +2 -1
- package/utils/dataStructures/linkedList.js +6 -1
- package/utils/dataStructures/linkedList.mjs +6 -1
package/pluginHooks.mjs
CHANGED
@@ -130,7 +130,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
130
130
|
'afterCellMetaReset',
|
131
131
|
/**
|
132
132
|
* Fired after one or more cells has been changed. The changes are triggered in any situation when the
|
133
|
-
* value is entered using an editor or changed using API (e.q setDataAtCell).
|
133
|
+
* value is entered using an editor or changed using API (e.q [`setDataAtCell`](@/api/core.md#setdataatcell) method).
|
134
134
|
*
|
135
135
|
* __Note:__ For performance reasons, the `changes` array is null for `"loadData"` source.
|
136
136
|
*
|
@@ -173,7 +173,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
173
173
|
'afterContextMenuDefaultOptions',
|
174
174
|
/**
|
175
175
|
* Fired each time user opens {@link ContextMenu} plugin before setting up the Context Menu's items but after filtering these options by
|
176
|
-
* user (`contextMenu` option). This hook can by helpful to determine if user use specified menu item or to set up
|
176
|
+
* user ([`contextMenu`](@/api/options.md#contextmenu) option). This hook can by helpful to determine if user use specified menu item or to set up
|
177
177
|
* one of the menu item to by always visible.
|
178
178
|
*
|
179
179
|
* @event Hooks#beforeContextMenuSetItems
|
@@ -191,7 +191,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
191
191
|
'afterDropdownMenuDefaultOptions',
|
192
192
|
/**
|
193
193
|
* Fired by {@link DropdownMenu} plugin before setting up the Dropdown Menu's items but after filtering these options
|
194
|
-
* by user (`dropdownMenu` option). This hook can by helpful to determine if user use specified menu item or to set
|
194
|
+
* by user ([`dropdownMenu`](@/api/options.md#dropdownmenu) option). This hook can by helpful to determine if user use specified menu item or to set
|
195
195
|
* up one of the menu item to by always visible.
|
196
196
|
*
|
197
197
|
* @event Hooks#beforeDropdownMenuSetItems
|
@@ -318,7 +318,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
318
318
|
*/
|
319
319
|
'afterDestroy',
|
320
320
|
/**
|
321
|
-
* Hook fired after keydown event is handled.
|
321
|
+
* Hook fired after `keydown` event is handled.
|
322
322
|
*
|
323
323
|
* @event Hooks#afterDocumentKeyDown
|
324
324
|
* @param {Event} event A native `keydown` event object.
|
@@ -410,7 +410,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
410
410
|
*/
|
411
411
|
'afterUpdateData',
|
412
412
|
/**
|
413
|
-
* Fired after a scroll event, which is identified as a momentum scroll (e.g.
|
413
|
+
* Fired after a scroll event, which is identified as a momentum scroll (e.g. on an iPad).
|
414
414
|
*
|
415
415
|
* @event Hooks#afterMomentumScroll
|
416
416
|
*/
|
@@ -594,7 +594,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
594
594
|
*/
|
595
595
|
'afterScroll',
|
596
596
|
/**
|
597
|
-
* Fired after one or more cells are selected (e.g.
|
597
|
+
* Fired after one or more cells are selected (e.g. during mouse move).
|
598
598
|
*
|
599
599
|
* @event Hooks#afterSelection
|
600
600
|
* @param {number} row Selection start visual row index.
|
@@ -646,7 +646,9 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
646
646
|
* @param {string} prop Selection start data source object property name.
|
647
647
|
* @param {number} row2 Selection end visual row index.
|
648
648
|
* @param {string} prop2 Selection end data source object property name.
|
649
|
-
* @param {object} preventScrolling
|
649
|
+
* @param {object} preventScrolling A reference to the observable object with the `value` property.
|
650
|
+
* Property `preventScrolling.value` expects a boolean value that
|
651
|
+
* Handsontable uses to control scroll behavior after selection.
|
650
652
|
* @param {number} selectionLayerLevel The number which indicates what selection layer is currently modified.
|
651
653
|
* @example
|
652
654
|
* ```js
|
@@ -673,7 +675,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
673
675
|
*/
|
674
676
|
'afterSelectionByProp',
|
675
677
|
/**
|
676
|
-
* Fired after one or more cells are selected (e.g.
|
678
|
+
* Fired after one or more cells are selected (e.g. on mouse up).
|
677
679
|
*
|
678
680
|
* @event Hooks#afterSelectionEnd
|
679
681
|
* @param {number} row Selection start visual row index.
|
@@ -684,7 +686,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
684
686
|
*/
|
685
687
|
'afterSelectionEnd',
|
686
688
|
/**
|
687
|
-
* Fired after one or more cells are selected (e.g.
|
689
|
+
* Fired after one or more cells are selected (e.g. on mouse up).
|
688
690
|
*
|
689
691
|
* The `prop` and `prop2` arguments represent the source object property name instead of the column number.
|
690
692
|
*
|
@@ -696,6 +698,46 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
696
698
|
* @param {number} selectionLayerLevel The number which indicates what selection layer is currently modified.
|
697
699
|
*/
|
698
700
|
'afterSelectionEndByProp',
|
701
|
+
/**
|
702
|
+
* Fired after the focus position within a selected range is changed.
|
703
|
+
*
|
704
|
+
* @since 14.3.0
|
705
|
+
* @event Hooks#afterSelectionFocusSet
|
706
|
+
* @param {number} row The focus visual row index position.
|
707
|
+
* @param {number} column The focus visual column index position.
|
708
|
+
* @param {object} preventScrolling A reference to the observable object with the `value` property.
|
709
|
+
* Property `preventScrolling.value` expects a boolean value that
|
710
|
+
* Handsontable uses to control scroll behavior after selection.
|
711
|
+
* @example
|
712
|
+
* ```js
|
713
|
+
* ::: only-for javascript
|
714
|
+
* new Handsontable(element, {
|
715
|
+
* afterSelectionFocusSet: (row, column, preventScrolling) => {
|
716
|
+
* // If set to `false` (default): when focused cell selection is outside the viewport,
|
717
|
+
* // Handsontable scrolls the viewport to that cell.
|
718
|
+
* // If set to `true`: when focused cell selection is outside the viewport,
|
719
|
+
* // Handsontable doesn't scroll the viewport.
|
720
|
+
* preventScrolling.value = true;
|
721
|
+
* }
|
722
|
+
* })
|
723
|
+
* ```
|
724
|
+
* :::
|
725
|
+
*
|
726
|
+
* ::: only-for react
|
727
|
+
* ```jsx
|
728
|
+
* <HotTable
|
729
|
+
* afterSelectionFocusSet={(row, column, preventScrolling) => {
|
730
|
+
* // If set to `false` (default): when focused cell selection is outside the viewport,
|
731
|
+
* // Handsontable scrolls the viewport to that cell.
|
732
|
+
* // If set to `true`: when focused cell selection is outside the viewport,
|
733
|
+
* // Handsontable doesn't scroll the viewport.
|
734
|
+
* preventScrolling.value = true;
|
735
|
+
* }}
|
736
|
+
* />
|
737
|
+
* ```
|
738
|
+
* :::
|
739
|
+
*/
|
740
|
+
'afterSelectionFocusSet',
|
699
741
|
/**
|
700
742
|
* Fired before one or more columns are selected (e.g. During mouse header click or {@link Core#selectColumns} API call).
|
701
743
|
*
|
@@ -731,7 +773,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
731
773
|
*/
|
732
774
|
'beforeSelectColumns',
|
733
775
|
/**
|
734
|
-
* Fired after one or more columns are selected (e.g.
|
776
|
+
* Fired after one or more columns are selected (e.g. during mouse header click or {@link Core#selectColumns} API call).
|
735
777
|
*
|
736
778
|
* @since 14.0.0
|
737
779
|
* @event Hooks#afterSelectColumns
|
@@ -741,7 +783,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
741
783
|
*/
|
742
784
|
'afterSelectColumns',
|
743
785
|
/**
|
744
|
-
* Fired before one or more rows are selected (e.g.
|
786
|
+
* Fired before one or more rows are selected (e.g. during mouse header click or {@link Core#selectRows} API call).
|
745
787
|
*
|
746
788
|
* @since 14.0.0
|
747
789
|
* @event Hooks#beforeSelectRows
|
@@ -775,7 +817,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
775
817
|
*/
|
776
818
|
'beforeSelectRows',
|
777
819
|
/**
|
778
|
-
* Fired after one or more rows are selected (e.g.
|
820
|
+
* Fired after one or more rows are selected (e.g. during mouse header click or {@link Core#selectRows} API call).
|
779
821
|
*
|
780
822
|
* @since 14.0.0
|
781
823
|
* @event Hooks#afterSelectRows
|
@@ -815,7 +857,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
815
857
|
'afterSetDataAtCell',
|
816
858
|
/**
|
817
859
|
* Fired after cell data was changed.
|
818
|
-
* Called only when `setDataAtRowProp` was executed.
|
860
|
+
* Called only when [`setDataAtRowProp`](@/api/core.md#setdataatrowprop) was executed.
|
819
861
|
*
|
820
862
|
* @event Hooks#afterSetDataAtRowProp
|
821
863
|
* @param {Array} changes An array of changes in format `[[row, prop, oldValue, value], ...]`.
|
@@ -833,7 +875,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
833
875
|
*/
|
834
876
|
'afterSetSourceDataAtCell',
|
835
877
|
/**
|
836
|
-
* Fired after calling the `updateSettings` method.
|
878
|
+
* Fired after calling the [`updateSettings`](@/api/core.md#updatesettings) method.
|
837
879
|
*
|
838
880
|
* @event Hooks#afterUpdateSettings
|
839
881
|
* @param {object} newSettings New settings object.
|
@@ -883,7 +925,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
883
925
|
* @param {string} direction Declares the direction of the autofill. Possible values: `up`, `down`, `left`, `right`.
|
884
926
|
*
|
885
927
|
* @returns {boolean|Array[]} If false, the operation is cancelled. If array of arrays, the returned data
|
886
|
-
* will be passed into `populateFromArray` instead of the default autofill
|
928
|
+
* will be passed into [`populateFromArray`](@/api/core.md#populatefromarray) instead of the default autofill
|
887
929
|
* algorithm's result.
|
888
930
|
*/
|
889
931
|
'beforeAutofill',
|
@@ -905,17 +947,10 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
905
947
|
*
|
906
948
|
* @event Hooks#beforeCellAlignment
|
907
949
|
* @param {object} stateBefore An object with class names defining the cell alignment.
|
908
|
-
* @param {CellRange[]} range An array of CellRange coordinates where the alignment will be applied.
|
950
|
+
* @param {CellRange[]} range An array of `CellRange` coordinates where the alignment will be applied.
|
909
951
|
* @param {string} type Type of the alignment - either `horizontal` or `vertical`.
|
910
952
|
* @param {string} alignmentClass String defining the alignment class added to the cell.
|
911
|
-
* Possible values:
|
912
|
-
* * `htLeft`
|
913
|
-
* * `htCenter`
|
914
|
-
* * `htRight`
|
915
|
-
* * `htJustify`
|
916
|
-
* * `htTop`
|
917
|
-
* * `htMiddle`
|
918
|
-
* * `htBottom`.
|
953
|
+
* Possible values: `htLeft` , `htCenter`, `htRight`, `htJustify`, `htTop`, `htMiddle`, `htBottom`.
|
919
954
|
*/
|
920
955
|
'beforeCellAlignment',
|
921
956
|
/**
|
@@ -1076,7 +1111,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1076
1111
|
*/
|
1077
1112
|
'beforeUpdateData',
|
1078
1113
|
/**
|
1079
|
-
* Hook fired before keydown event is handled. It can be used to stop default key bindings.
|
1114
|
+
* Hook fired before `keydown` event is handled. It can be used to stop default key bindings.
|
1080
1115
|
*
|
1081
1116
|
* __Note__: To prevent default behavior you need to call `false` in your `beforeKeyDown` handler.
|
1082
1117
|
*
|
@@ -1250,25 +1285,33 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1250
1285
|
* @returns {boolean|undefined} If false is returned the action is canceled.
|
1251
1286
|
*/
|
1252
1287
|
'beforeSetCellMeta',
|
1288
|
+
/**
|
1289
|
+
* Fired before setting focus selection.
|
1290
|
+
*
|
1291
|
+
* @since 14.3.0
|
1292
|
+
* @event Hooks#beforeSelectionFocusSet
|
1293
|
+
* @param {CellCoords} coords CellCoords instance.
|
1294
|
+
*/
|
1295
|
+
'beforeSelectionFocusSet',
|
1253
1296
|
/**
|
1254
1297
|
* Fired before setting range is started but not finished yet.
|
1255
1298
|
*
|
1256
1299
|
* @event Hooks#beforeSetRangeStartOnly
|
1257
|
-
* @param {CellCoords} coords CellCoords instance.
|
1300
|
+
* @param {CellCoords} coords `CellCoords` instance.
|
1258
1301
|
*/
|
1259
1302
|
'beforeSetRangeStartOnly',
|
1260
1303
|
/**
|
1261
1304
|
* Fired before setting range is started.
|
1262
1305
|
*
|
1263
1306
|
* @event Hooks#beforeSetRangeStart
|
1264
|
-
* @param {CellCoords} coords CellCoords instance.
|
1307
|
+
* @param {CellCoords} coords `CellCoords` instance.
|
1265
1308
|
*/
|
1266
1309
|
'beforeSetRangeStart',
|
1267
1310
|
/**
|
1268
1311
|
* Fired before setting range is ended.
|
1269
1312
|
*
|
1270
1313
|
* @event Hooks#beforeSetRangeEnd
|
1271
|
-
* @param {CellCoords} coords CellCoords instance.
|
1314
|
+
* @param {CellCoords} coords `CellCoords` instance.
|
1272
1315
|
*/
|
1273
1316
|
'beforeSetRangeEnd',
|
1274
1317
|
/**
|
@@ -1401,7 +1444,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1401
1444
|
*/
|
1402
1445
|
'modifyRowData',
|
1403
1446
|
/**
|
1404
|
-
* Used to modify the cell coordinates when using the `getCell` method, opening editor, getting value from the editor
|
1447
|
+
* Used to modify the cell coordinates when using the [`getCell`](@/api/core.md#getcell) method, opening editor, getting value from the editor
|
1405
1448
|
* and saving values from the closed editor.
|
1406
1449
|
*
|
1407
1450
|
* @event Hooks#modifyGetCellCoords
|
@@ -2070,9 +2113,9 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2070
2113
|
* @event Hooks#modifyColumnHeaderValue
|
2071
2114
|
* @param {string} value A column header value.
|
2072
2115
|
* @param {number} visualColumnIndex A visual column index.
|
2073
|
-
* @param {number} [headerLevel=0] Header level index. Accepts positive (0 to n)
|
2074
|
-
* and negative (
|
2075
|
-
* topmost header. For negative values,
|
2116
|
+
* @param {number} [headerLevel=0] Header level index. Accepts positive (`0` to `n`)
|
2117
|
+
* and negative (`-1` to `-n`) values. For positive values, `0` points to the
|
2118
|
+
* topmost header. For negative values, `-1` points to the bottom-most
|
2076
2119
|
* header (the header closest to the cells).
|
2077
2120
|
* @returns {string} The column header value to be updated.
|
2078
2121
|
*/
|
@@ -2159,6 +2202,14 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2159
2202
|
* @param {number} rowHeaderWidth Row header width.
|
2160
2203
|
*/
|
2161
2204
|
'modifyRowHeaderWidth',
|
2205
|
+
/**
|
2206
|
+
* Fired when the focus of the selection is being modified (e.g. Moving the focus with the enter/tab keys).
|
2207
|
+
*
|
2208
|
+
* @since 14.3.0
|
2209
|
+
* @event Hooks#modifyTransformFocus
|
2210
|
+
* @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.
|
2211
|
+
*/
|
2212
|
+
'modifyTransformFocus',
|
2162
2213
|
/**
|
2163
2214
|
* Fired when the start of the selection is being modified (e.g. Moving the selection with the arrow keys).
|
2164
2215
|
*
|
@@ -2173,6 +2224,16 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2173
2224
|
* @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.
|
2174
2225
|
*/
|
2175
2226
|
'modifyTransformEnd',
|
2227
|
+
/**
|
2228
|
+
* Fired after the focus of the selection is being modified (e.g. Moving the focus with the enter/tab keys).
|
2229
|
+
*
|
2230
|
+
* @since 14.3.0
|
2231
|
+
* @event Hooks#afterModifyTransformFocus
|
2232
|
+
* @param {CellCoords} coords Coords of the freshly focused cell.
|
2233
|
+
* @param {number} rowTransformDir `-1` if trying to focus a cell with a negative row index. `0` otherwise.
|
2234
|
+
* @param {number} colTransformDir `-1` if trying to focus a cell with a negative column index. `0` otherwise.
|
2235
|
+
*/
|
2236
|
+
'afterModifyTransformFocus',
|
2176
2237
|
/**
|
2177
2238
|
* Fired after the start of the selection is being modified (e.g. Moving the selection with the arrow keys).
|
2178
2239
|
*
|
@@ -2348,7 +2409,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2348
2409
|
* option is enabled.
|
2349
2410
|
*
|
2350
2411
|
* @event Hooks#beforeDropdownMenuShow
|
2351
|
-
* @param {DropdownMenu} dropdownMenu The DropdownMenu instance.
|
2412
|
+
* @param {DropdownMenu} dropdownMenu The `DropdownMenu` instance.
|
2352
2413
|
*/
|
2353
2414
|
'beforeDropdownMenuShow',
|
2354
2415
|
/**
|
@@ -2356,7 +2417,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2356
2417
|
* option is enabled.
|
2357
2418
|
*
|
2358
2419
|
* @event Hooks#afterDropdownMenuShow
|
2359
|
-
* @param {DropdownMenu} dropdownMenu The DropdownMenu instance.
|
2420
|
+
* @param {DropdownMenu} dropdownMenu The `DropdownMenu` instance.
|
2360
2421
|
*/
|
2361
2422
|
'afterDropdownMenuShow',
|
2362
2423
|
/**
|
@@ -2364,11 +2425,11 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2364
2425
|
* option is enabled.
|
2365
2426
|
*
|
2366
2427
|
* @event Hooks#afterDropdownMenuHide
|
2367
|
-
* @param {DropdownMenu} instance The DropdownMenu instance.
|
2428
|
+
* @param {DropdownMenu} instance The `DropdownMenu` instance.
|
2368
2429
|
*/
|
2369
2430
|
'afterDropdownMenuHide',
|
2370
2431
|
/**
|
2371
|
-
* Fired by {@link NestedRows} plugin before adding a children to the NestedRows structure. This hook is fired when
|
2432
|
+
* Fired by {@link NestedRows} plugin before adding a children to the `NestedRows` structure. This hook is fired when
|
2372
2433
|
* {@link Options#nestedRows} option is enabled.
|
2373
2434
|
*
|
2374
2435
|
* @event Hooks#beforeAddChild
|
@@ -2378,7 +2439,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2378
2439
|
*/
|
2379
2440
|
'beforeAddChild',
|
2380
2441
|
/**
|
2381
|
-
* Fired by {@link NestedRows} plugin after adding a children to the NestedRows structure. This hook is fired when
|
2442
|
+
* Fired by {@link NestedRows} plugin after adding a children to the `NestedRows` structure. This hook is fired when
|
2382
2443
|
* {@link Options#nestedRows} option is enabled.
|
2383
2444
|
*
|
2384
2445
|
* @event Hooks#afterAddChild
|
@@ -9,6 +9,7 @@ var _number = require("../../helpers/number");
|
|
9
9
|
var _console = require("../../helpers/console");
|
10
10
|
var _element = require("../../helpers/dom/element");
|
11
11
|
var _event = require("../../helpers/dom/event");
|
12
|
+
var _shortcutContexts = require("../../shortcutContexts");
|
12
13
|
var _a11y = require("../../helpers/a11y");
|
13
14
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
14
15
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
@@ -280,12 +281,17 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
280
281
|
col: columnIndex
|
281
282
|
});
|
282
283
|
}
|
284
|
+
|
285
|
+
// prevent default Enter behavior (move to the next row within a selection range)
|
286
|
+
return false;
|
283
287
|
},
|
284
288
|
runOnlyIf: () => {
|
285
|
-
var _this$hot$getSelected;
|
286
|
-
return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
|
289
|
+
var _this$hot$getSelected, _this$hot$getSelected2;
|
290
|
+
return ((_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.isSingle()) && ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isHeader());
|
287
291
|
},
|
288
|
-
group: SHORTCUTS_GROUP
|
292
|
+
group: SHORTCUTS_GROUP,
|
293
|
+
relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
|
294
|
+
position: 'before'
|
289
295
|
});
|
290
296
|
}
|
291
297
|
|
@@ -15,6 +15,7 @@ import { rangeEach } from "../../helpers/number.mjs";
|
|
15
15
|
import { warn } from "../../helpers/console.mjs";
|
16
16
|
import { addClass, hasClass, removeClass, fastInnerText, removeAttribute, setAttribute } from "../../helpers/dom/element.mjs";
|
17
17
|
import { stopImmediatePropagation } from "../../helpers/dom/event.mjs";
|
18
|
+
import { EDITOR_EDIT_GROUP as SHORTCUTS_GROUP_EDITOR } from "../../shortcutContexts/index.mjs";
|
18
19
|
import { A11Y_EXPANDED, A11Y_HIDDEN } from "../../helpers/a11y.mjs";
|
19
20
|
export const PLUGIN_KEY = 'collapsibleColumns';
|
20
21
|
export const PLUGIN_PRIORITY = 290;
|
@@ -277,12 +278,17 @@ export class CollapsibleColumns extends BasePlugin {
|
|
277
278
|
col: columnIndex
|
278
279
|
});
|
279
280
|
}
|
281
|
+
|
282
|
+
// prevent default Enter behavior (move to the next row within a selection range)
|
283
|
+
return false;
|
280
284
|
},
|
281
285
|
runOnlyIf: () => {
|
282
|
-
var _this$hot$getSelected;
|
283
|
-
return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
|
286
|
+
var _this$hot$getSelected, _this$hot$getSelected2;
|
287
|
+
return ((_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.isSingle()) && ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isHeader());
|
284
288
|
},
|
285
|
-
group: SHORTCUTS_GROUP
|
289
|
+
group: SHORTCUTS_GROUP,
|
290
|
+
relativeToGroup: SHORTCUTS_GROUP_EDITOR,
|
291
|
+
position: 'before'
|
286
292
|
});
|
287
293
|
}
|
288
294
|
|
@@ -12,6 +12,7 @@ var _base = require("../base");
|
|
12
12
|
var _translations = require("../../translations");
|
13
13
|
var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
|
14
14
|
var _columnStatesManager = require("./columnStatesManager");
|
15
|
+
var _shortcutContexts = require("../../shortcutContexts");
|
15
16
|
var _utils = require("./utils");
|
16
17
|
var _domHelpers = require("./domHelpers");
|
17
18
|
var _rootComparator = require("./rootComparator");
|
@@ -223,12 +224,17 @@ class ColumnSorting extends _base.BasePlugin {
|
|
223
224
|
if (highlight.row === -1 && highlight.col >= 0) {
|
224
225
|
this.sort(this.getColumnNextConfig(highlight.col));
|
225
226
|
}
|
227
|
+
|
228
|
+
// prevent default Enter behavior (move to the next row within a selection range)
|
229
|
+
return false;
|
226
230
|
},
|
227
231
|
runOnlyIf: () => {
|
228
|
-
var _this$hot$getSelected;
|
232
|
+
var _this$hot$getSelected, _this$hot$getSelected2;
|
229
233
|
const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
230
|
-
return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
|
234
|
+
return highlight && ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingle()) && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
|
231
235
|
},
|
236
|
+
relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
|
237
|
+
position: 'before',
|
232
238
|
group: SHORTCUTS_GROUP
|
233
239
|
});
|
234
240
|
}
|
@@ -15,6 +15,7 @@ import { BasePlugin } from "../base/index.mjs";
|
|
15
15
|
import { IndexesSequence, PhysicalIndexToValueMap as IndexToValueMap } from "../../translations/index.mjs";
|
16
16
|
import Hooks from "../../pluginHooks.mjs";
|
17
17
|
import { ColumnStatesManager } from "./columnStatesManager.mjs";
|
18
|
+
import { EDITOR_EDIT_GROUP as SHORTCUTS_GROUP_EDITOR } from "../../shortcutContexts/index.mjs";
|
18
19
|
import { HEADER_SPAN_CLASS, getNextSortOrder, areValidSortStates, getHeaderSpanElement, isFirstLevelColumnHeader, wasHeaderClickedProperly } from "./utils.mjs";
|
19
20
|
import { getClassesToRemove, getClassesToAdd } from "./domHelpers.mjs";
|
20
21
|
import { rootComparator } from "./rootComparator.mjs";
|
@@ -219,12 +220,17 @@ export class ColumnSorting extends BasePlugin {
|
|
219
220
|
if (highlight.row === -1 && highlight.col >= 0) {
|
220
221
|
this.sort(this.getColumnNextConfig(highlight.col));
|
221
222
|
}
|
223
|
+
|
224
|
+
// prevent default Enter behavior (move to the next row within a selection range)
|
225
|
+
return false;
|
222
226
|
},
|
223
227
|
runOnlyIf: () => {
|
224
|
-
var _this$hot$getSelected;
|
228
|
+
var _this$hot$getSelected, _this$hot$getSelected2;
|
225
229
|
const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
226
|
-
return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
|
230
|
+
return highlight && ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingle()) && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
|
227
231
|
},
|
232
|
+
relativeToGroup: SHORTCUTS_GROUP_EDITOR,
|
233
|
+
position: 'before',
|
228
234
|
group: SHORTCUTS_GROUP
|
229
235
|
});
|
230
236
|
}
|
@@ -9,10 +9,26 @@ exports.createDefaultShortcutsList = createDefaultShortcutsList;
|
|
9
9
|
* @returns {KeyboardShortcut[]}
|
10
10
|
*/
|
11
11
|
function createDefaultShortcutsList(menu) {
|
12
|
+
const {
|
13
|
+
hot,
|
14
|
+
hotMenu
|
15
|
+
} = menu;
|
12
16
|
return [{
|
13
|
-
keys: [['
|
14
|
-
forwardToContext:
|
17
|
+
keys: [['Control/Meta', 'A']],
|
18
|
+
forwardToContext: hot.getShortcutManager().getContext('grid'),
|
15
19
|
callback: () => menu.close(true)
|
20
|
+
}, {
|
21
|
+
keys: [['Tab'], ['Shift', 'Tab']],
|
22
|
+
callback: (event, keys) => {
|
23
|
+
const settings = hot.getSettings();
|
24
|
+
const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
|
25
|
+
if (keys.includes('shift')) {
|
26
|
+
hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
|
27
|
+
} else {
|
28
|
+
hot.selection.transformStart(tabMoves.row, tabMoves.col);
|
29
|
+
}
|
30
|
+
menu.close(true);
|
31
|
+
}
|
16
32
|
}, {
|
17
33
|
keys: [['Escape']],
|
18
34
|
callback: () => menu.close()
|
@@ -25,7 +41,7 @@ function createDefaultShortcutsList(menu) {
|
|
25
41
|
}, {
|
26
42
|
keys: [['ArrowRight']],
|
27
43
|
callback: () => {
|
28
|
-
const selection =
|
44
|
+
const selection = hotMenu.getSelectedLast();
|
29
45
|
if (selection) {
|
30
46
|
const subMenu = menu.openSubMenu(selection[0]);
|
31
47
|
if (subMenu) {
|
@@ -36,7 +52,7 @@ function createDefaultShortcutsList(menu) {
|
|
36
52
|
}, {
|
37
53
|
keys: [['ArrowLeft']],
|
38
54
|
callback: () => {
|
39
|
-
const selection =
|
55
|
+
const selection = hotMenu.getSelectedLast();
|
40
56
|
if (selection && menu.isSubMenu()) {
|
41
57
|
menu.close();
|
42
58
|
if (menu.isSubMenu()) {
|
@@ -53,11 +69,11 @@ function createDefaultShortcutsList(menu) {
|
|
53
69
|
}, {
|
54
70
|
keys: [['Enter'], ['Space']],
|
55
71
|
callback: event => {
|
56
|
-
const selection =
|
72
|
+
const selection = hotMenu.getSelectedLast();
|
57
73
|
if (!selection) {
|
58
74
|
return;
|
59
75
|
}
|
60
|
-
if (
|
76
|
+
if (hotMenu.getSourceDataAtRow(selection[0]).submenu) {
|
61
77
|
menu.openSubMenu(selection[0]).getNavigator().toFirstItem();
|
62
78
|
} else {
|
63
79
|
menu.executeCommand(event);
|
@@ -67,9 +83,9 @@ function createDefaultShortcutsList(menu) {
|
|
67
83
|
}, {
|
68
84
|
keys: [['PageUp']],
|
69
85
|
callback: () => {
|
70
|
-
const selection =
|
86
|
+
const selection = hotMenu.getSelectedLast();
|
71
87
|
if (selection) {
|
72
|
-
|
88
|
+
hotMenu.selection.transformStart(-hotMenu.countVisibleRows(), 0);
|
73
89
|
} else {
|
74
90
|
menu.getNavigator().toFirstItem();
|
75
91
|
}
|
@@ -77,9 +93,9 @@ function createDefaultShortcutsList(menu) {
|
|
77
93
|
}, {
|
78
94
|
keys: [['PageDown']],
|
79
95
|
callback: () => {
|
80
|
-
const selection =
|
96
|
+
const selection = hotMenu.getSelectedLast();
|
81
97
|
if (selection) {
|
82
|
-
|
98
|
+
hotMenu.selection.transformStart(hotMenu.countVisibleRows(), 0);
|
83
99
|
} else {
|
84
100
|
menu.getNavigator().toLastItem();
|
85
101
|
}
|
@@ -5,10 +5,26 @@
|
|
5
5
|
* @returns {KeyboardShortcut[]}
|
6
6
|
*/
|
7
7
|
export function createDefaultShortcutsList(menu) {
|
8
|
+
const {
|
9
|
+
hot,
|
10
|
+
hotMenu
|
11
|
+
} = menu;
|
8
12
|
return [{
|
9
|
-
keys: [['
|
10
|
-
forwardToContext:
|
13
|
+
keys: [['Control/Meta', 'A']],
|
14
|
+
forwardToContext: hot.getShortcutManager().getContext('grid'),
|
11
15
|
callback: () => menu.close(true)
|
16
|
+
}, {
|
17
|
+
keys: [['Tab'], ['Shift', 'Tab']],
|
18
|
+
callback: (event, keys) => {
|
19
|
+
const settings = hot.getSettings();
|
20
|
+
const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
|
21
|
+
if (keys.includes('shift')) {
|
22
|
+
hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
|
23
|
+
} else {
|
24
|
+
hot.selection.transformStart(tabMoves.row, tabMoves.col);
|
25
|
+
}
|
26
|
+
menu.close(true);
|
27
|
+
}
|
12
28
|
}, {
|
13
29
|
keys: [['Escape']],
|
14
30
|
callback: () => menu.close()
|
@@ -21,7 +37,7 @@ export function createDefaultShortcutsList(menu) {
|
|
21
37
|
}, {
|
22
38
|
keys: [['ArrowRight']],
|
23
39
|
callback: () => {
|
24
|
-
const selection =
|
40
|
+
const selection = hotMenu.getSelectedLast();
|
25
41
|
if (selection) {
|
26
42
|
const subMenu = menu.openSubMenu(selection[0]);
|
27
43
|
if (subMenu) {
|
@@ -32,7 +48,7 @@ export function createDefaultShortcutsList(menu) {
|
|
32
48
|
}, {
|
33
49
|
keys: [['ArrowLeft']],
|
34
50
|
callback: () => {
|
35
|
-
const selection =
|
51
|
+
const selection = hotMenu.getSelectedLast();
|
36
52
|
if (selection && menu.isSubMenu()) {
|
37
53
|
menu.close();
|
38
54
|
if (menu.isSubMenu()) {
|
@@ -49,11 +65,11 @@ export function createDefaultShortcutsList(menu) {
|
|
49
65
|
}, {
|
50
66
|
keys: [['Enter'], ['Space']],
|
51
67
|
callback: event => {
|
52
|
-
const selection =
|
68
|
+
const selection = hotMenu.getSelectedLast();
|
53
69
|
if (!selection) {
|
54
70
|
return;
|
55
71
|
}
|
56
|
-
if (
|
72
|
+
if (hotMenu.getSourceDataAtRow(selection[0]).submenu) {
|
57
73
|
menu.openSubMenu(selection[0]).getNavigator().toFirstItem();
|
58
74
|
} else {
|
59
75
|
menu.executeCommand(event);
|
@@ -63,9 +79,9 @@ export function createDefaultShortcutsList(menu) {
|
|
63
79
|
}, {
|
64
80
|
keys: [['PageUp']],
|
65
81
|
callback: () => {
|
66
|
-
const selection =
|
82
|
+
const selection = hotMenu.getSelectedLast();
|
67
83
|
if (selection) {
|
68
|
-
|
84
|
+
hotMenu.selection.transformStart(-hotMenu.countVisibleRows(), 0);
|
69
85
|
} else {
|
70
86
|
menu.getNavigator().toFirstItem();
|
71
87
|
}
|
@@ -73,9 +89,9 @@ export function createDefaultShortcutsList(menu) {
|
|
73
89
|
}, {
|
74
90
|
keys: [['PageDown']],
|
75
91
|
callback: () => {
|
76
|
-
const selection =
|
92
|
+
const selection = hotMenu.getSelectedLast();
|
77
93
|
if (selection) {
|
78
|
-
|
94
|
+
hotMenu.selection.transformStart(hotMenu.countVisibleRows(), 0);
|
79
95
|
} else {
|
80
96
|
menu.getNavigator().toLastItem();
|
81
97
|
}
|