handsontable 0.0.0-next-93e34dc-20230601 → 0.0.0-next-b7cca45-20230605

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.

Files changed (216) hide show
  1. package/3rdparty/walkontable/src/{selection/border/border.js → border.js} +12 -7
  2. package/3rdparty/walkontable/src/{selection/border/border.mjs → border.mjs} +12 -7
  3. package/3rdparty/walkontable/src/cell/coords.d.ts +1 -6
  4. package/3rdparty/walkontable/src/cell/coords.js +12 -61
  5. package/3rdparty/walkontable/src/cell/coords.mjs +12 -61
  6. package/3rdparty/walkontable/src/cell/range.d.ts +2 -9
  7. package/3rdparty/walkontable/src/cell/range.js +7 -44
  8. package/3rdparty/walkontable/src/cell/range.mjs +7 -44
  9. package/3rdparty/walkontable/src/core/_base.js +3 -9
  10. package/3rdparty/walkontable/src/core/_base.mjs +3 -9
  11. package/3rdparty/walkontable/src/core/clone.js +2 -2
  12. package/3rdparty/walkontable/src/core/clone.mjs +2 -2
  13. package/3rdparty/walkontable/src/core/core.js +2 -3
  14. package/3rdparty/walkontable/src/core/core.mjs +2 -3
  15. package/3rdparty/walkontable/src/event.js +7 -7
  16. package/3rdparty/walkontable/src/event.mjs +7 -7
  17. package/3rdparty/walkontable/src/facade/core.js +2 -2
  18. package/3rdparty/walkontable/src/facade/core.mjs +2 -2
  19. package/3rdparty/walkontable/src/index.js +2 -10
  20. package/3rdparty/walkontable/src/index.mjs +2 -2
  21. package/3rdparty/walkontable/src/overlay/_base.js +1 -1
  22. package/3rdparty/walkontable/src/overlay/_base.mjs +1 -1
  23. package/3rdparty/walkontable/src/overlay/inlineStart.js +4 -2
  24. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +4 -2
  25. package/3rdparty/walkontable/src/overlay/top.js +4 -2
  26. package/3rdparty/walkontable/src/overlay/top.mjs +4 -2
  27. package/3rdparty/walkontable/src/selection.js +354 -0
  28. package/3rdparty/walkontable/src/selection.mjs +348 -0
  29. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +0 -9
  30. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +0 -9
  31. package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +0 -9
  32. package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +0 -9
  33. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +0 -9
  34. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +0 -9
  35. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +0 -9
  36. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +0 -9
  37. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +0 -9
  38. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +0 -9
  39. package/3rdparty/walkontable/src/table.js +79 -7
  40. package/3rdparty/walkontable/src/table.mjs +80 -8
  41. package/base.js +2 -2
  42. package/base.mjs +2 -2
  43. package/core.d.ts +3 -5
  44. package/core.js +300 -82
  45. package/core.mjs +300 -82
  46. package/dataMap/metaManager/metaSchema.js +0 -15
  47. package/dataMap/metaManager/metaSchema.mjs +0 -15
  48. package/dist/handsontable.css +3 -8
  49. package/dist/handsontable.full.css +3 -8
  50. package/dist/handsontable.full.js +9926 -12218
  51. package/dist/handsontable.full.min.css +3 -3
  52. package/dist/handsontable.full.min.js +120 -120
  53. package/dist/handsontable.js +14628 -16920
  54. package/dist/handsontable.min.css +3 -3
  55. package/dist/handsontable.min.js +4 -4
  56. package/editorManager.js +82 -20
  57. package/editorManager.mjs +86 -25
  58. package/editors/textEditor/textEditor.js +11 -3
  59. package/editors/textEditor/textEditor.mjs +12 -4
  60. package/helpers/mixed.js +1 -1
  61. package/helpers/mixed.mjs +1 -1
  62. package/helpers/number.d.ts +0 -1
  63. package/helpers/number.js +0 -18
  64. package/helpers/number.mjs +0 -17
  65. package/package.json +1 -1
  66. package/pluginHooks.js +1 -1
  67. package/pluginHooks.mjs +1 -1
  68. package/plugins/copyPaste/copyPaste.js +1 -5
  69. package/plugins/copyPaste/copyPaste.mjs +1 -5
  70. package/plugins/customBorders/customBorders.js +52 -18
  71. package/plugins/customBorders/customBorders.mjs +53 -19
  72. package/plugins/mergeCells/mergeCells.js +18 -5
  73. package/plugins/mergeCells/mergeCells.mjs +18 -5
  74. package/plugins/nestedHeaders/nestedHeaders.js +9 -89
  75. package/plugins/nestedHeaders/nestedHeaders.mjs +9 -89
  76. package/plugins/nestedHeaders/stateManager/index.js +0 -37
  77. package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
  78. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  79. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  80. package/selection/highlight/constants.js +16 -0
  81. package/selection/highlight/constants.mjs +6 -0
  82. package/selection/highlight/highlight.js +88 -311
  83. package/selection/highlight/highlight.mjs +84 -301
  84. package/selection/highlight/types/activeHeader.js +9 -10
  85. package/selection/highlight/types/activeHeader.mjs +8 -10
  86. package/selection/highlight/types/area.js +27 -12
  87. package/selection/highlight/types/area.mjs +30 -16
  88. package/selection/highlight/types/{focus.js → cell.js} +8 -5
  89. package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
  90. package/selection/highlight/types/customSelection.js +10 -7
  91. package/selection/highlight/types/customSelection.mjs +9 -7
  92. package/selection/highlight/types/fill.js +8 -5
  93. package/selection/highlight/types/fill.mjs +7 -5
  94. package/selection/highlight/types/header.js +20 -10
  95. package/selection/highlight/types/header.mjs +19 -10
  96. package/selection/highlight/types/{row.js → index.js} +31 -27
  97. package/selection/highlight/types/{row.mjs → index.mjs} +29 -24
  98. package/selection/highlight/visualSelection.js +28 -23
  99. package/selection/highlight/visualSelection.mjs +28 -23
  100. package/selection/index.js +7 -4
  101. package/selection/index.mjs +3 -2
  102. package/selection/mouseEventHandler.js +1 -1
  103. package/selection/mouseEventHandler.mjs +1 -1
  104. package/selection/range.js +8 -8
  105. package/selection/range.mjs +8 -8
  106. package/selection/selection.js +180 -296
  107. package/selection/selection.mjs +179 -291
  108. package/selection/transformation.js +96 -233
  109. package/selection/transformation.mjs +93 -230
  110. package/selection/utils.js +35 -12
  111. package/selection/utils.mjs +35 -13
  112. package/settings.d.ts +0 -1
  113. package/tableView.js +9 -58
  114. package/tableView.mjs +9 -58
  115. package/3rdparty/walkontable/src/selection/border/constants.js +0 -18
  116. package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -13
  117. package/3rdparty/walkontable/src/selection/constants.js +0 -63
  118. package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
  119. package/3rdparty/walkontable/src/selection/index.js +0 -30
  120. package/3rdparty/walkontable/src/selection/index.mjs +0 -5
  121. package/3rdparty/walkontable/src/selection/manager.js +0 -328
  122. package/3rdparty/walkontable/src/selection/manager.mjs +0 -322
  123. package/3rdparty/walkontable/src/selection/scanner.js +0 -363
  124. package/3rdparty/walkontable/src/selection/scanner.mjs +0 -359
  125. package/3rdparty/walkontable/src/selection/selection.js +0 -133
  126. package/3rdparty/walkontable/src/selection/selection.mjs +0 -127
  127. package/selection/highlight/types/areaLayered.js +0 -54
  128. package/selection/highlight/types/areaLayered.mjs +0 -49
  129. package/selection/highlight/types/column.js +0 -50
  130. package/selection/highlight/types/column.mjs +0 -45
  131. package/shortcutContexts/commands/editor/closeAndSave.js +0 -15
  132. package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -10
  133. package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -13
  134. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
  135. package/shortcutContexts/commands/editor/fastOpen.js +0 -16
  136. package/shortcutContexts/commands/editor/fastOpen.mjs +0 -11
  137. package/shortcutContexts/commands/editor/index.js +0 -16
  138. package/shortcutContexts/commands/editor/index.mjs +0 -12
  139. package/shortcutContexts/commands/editor/open.js +0 -29
  140. package/shortcutContexts/commands/editor/open.mjs +0 -24
  141. package/shortcutContexts/commands/emptySelectedCells.js +0 -12
  142. package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
  143. package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
  144. package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -10
  145. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -21
  146. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -16
  147. package/shortcutContexts/commands/extendCellsSelection/index.js +0 -24
  148. package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -20
  149. package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
  150. package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -10
  151. package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
  152. package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -10
  153. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -22
  154. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -17
  155. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -17
  156. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -12
  157. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -17
  158. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -12
  159. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -39
  160. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -34
  161. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -39
  162. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -34
  163. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -22
  164. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -17
  165. package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
  166. package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -10
  167. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -21
  168. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -16
  169. package/shortcutContexts/commands/index.js +0 -51
  170. package/shortcutContexts/commands/index.mjs +0 -47
  171. package/shortcutContexts/commands/moveCellSelection/down.js +0 -12
  172. package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -7
  173. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -11
  174. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -6
  175. package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
  176. package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
  177. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -13
  178. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
  179. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -13
  180. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
  181. package/shortcutContexts/commands/moveCellSelection/left.js +0 -11
  182. package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
  183. package/shortcutContexts/commands/moveCellSelection/right.js +0 -11
  184. package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
  185. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -16
  186. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -11
  187. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -17
  188. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -12
  189. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -13
  190. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -8
  191. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -16
  192. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -11
  193. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -35
  194. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -30
  195. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -35
  196. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -30
  197. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -16
  198. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -11
  199. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -18
  200. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -13
  201. package/shortcutContexts/commands/moveCellSelection/up.js +0 -12
  202. package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -7
  203. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -11
  204. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -6
  205. package/shortcutContexts/commands/populateSelectedCellsData.js +0 -35
  206. package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -30
  207. package/shortcutContexts/commands/selectAll.js +0 -11
  208. package/shortcutContexts/commands/selectAll.mjs +0 -6
  209. package/shortcutContexts/constants.js +0 -19
  210. package/shortcutContexts/constants.mjs +0 -12
  211. package/shortcutContexts/editor.js +0 -29
  212. package/shortcutContexts/editor.mjs +0 -25
  213. package/shortcutContexts/grid.js +0 -232
  214. package/shortcutContexts/grid.mjs +0 -228
  215. package/shortcutContexts/index.js +0 -29
  216. package/shortcutContexts/index.mjs +0 -15
@@ -1,232 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.shortcutsGridContext = shortcutsGridContext;
5
- var _mixed = require("../helpers/mixed");
6
- var _constants = require("./constants");
7
- var _commands = require("./commands");
8
- /**
9
- * The context that defines shortcut list available for selected cell or cells.
10
- *
11
- * @param {Handsontable} hot The Handsontable instance.
12
- */
13
- function shortcutsGridContext(hot) {
14
- var context = hot.getShortcutManager().addContext('grid');
15
- var commandsPool = (0, _commands.createKeyboardShortcutCommandsPool)(hot);
16
- var config = {
17
- runOnlyIf: function runOnlyIf() {
18
- var _hot$getSettings = hot.getSettings(),
19
- navigableHeaders = _hot$getSettings.navigableHeaders;
20
- return (0, _mixed.isDefined)(hot.getSelected()) && (navigableHeaders || !navigableHeaders && hot.countRenderedRows() > 0 && hot.countRenderedCols() > 0);
21
- },
22
- group: _constants.GRID_GROUP
23
- };
24
- context.addShortcuts([{
25
- keys: [['F2']],
26
- callback: function callback(event) {
27
- return commandsPool.editorFastOpen(event);
28
- }
29
- }, {
30
- keys: [['Enter'], ['Enter', 'Shift']],
31
- callback: function callback(event, keys) {
32
- return commandsPool.editorOpen(event, keys);
33
- }
34
- }, {
35
- keys: [['Backspace'], ['Delete']],
36
- callback: function callback() {
37
- return commandsPool.emptySelectedCells();
38
- }
39
- }], {
40
- group: _constants.EDITOR_EDIT_GROUP
41
- });
42
- context.addShortcuts([{
43
- keys: [['Control/Meta', 'A'], ['Control/Meta', 'Shift', 'Space']],
44
- callback: function callback() {
45
- return commandsPool.selectAll();
46
- }
47
- }, {
48
- keys: [['Control/Meta', 'Enter']],
49
- callback: function callback() {
50
- return commandsPool.populateSelectedCellsData();
51
- },
52
- runOnlyIf: function runOnlyIf() {
53
- return hot.getSelectedRangeLast().getCellsCount() > 1;
54
- }
55
- }, {
56
- keys: [['ArrowUp']],
57
- callback: function callback() {
58
- return commandsPool.moveCellSelectionUp();
59
- }
60
- }, {
61
- keys: [['ArrowUp', 'Control/Meta']],
62
- captureCtrl: true,
63
- callback: function callback() {
64
- return commandsPool.moveCellSelectionToMostTop();
65
- }
66
- }, {
67
- keys: [['ArrowUp', 'Shift']],
68
- callback: function callback() {
69
- return commandsPool.extendCellsSelectionUp();
70
- }
71
- }, {
72
- keys: [['ArrowUp', 'Shift', 'Control/Meta']],
73
- captureCtrl: true,
74
- callback: function callback() {
75
- return commandsPool.extendCellsSelectionToMostTop();
76
- },
77
- runOnlyIf: function runOnlyIf() {
78
- return !(hot.selection.isSelectedByCorner() || hot.selection.isSelectedByColumnHeader());
79
- }
80
- }, {
81
- keys: [['ArrowDown']],
82
- callback: function callback() {
83
- return commandsPool.moveCellSelectionDown();
84
- }
85
- }, {
86
- keys: [['ArrowDown', 'Control/Meta']],
87
- captureCtrl: true,
88
- callback: function callback() {
89
- return commandsPool.moveCellSelectionToMostBottom();
90
- }
91
- }, {
92
- keys: [['ArrowDown', 'Shift']],
93
- callback: function callback() {
94
- return commandsPool.extendCellsSelectionDown();
95
- }
96
- }, {
97
- keys: [['ArrowDown', 'Shift', 'Control/Meta']],
98
- captureCtrl: true,
99
- callback: function callback() {
100
- return commandsPool.extendCellsSelectionToMostBottom();
101
- },
102
- runOnlyIf: function runOnlyIf() {
103
- return !(hot.selection.isSelectedByCorner() || hot.selection.isSelectedByColumnHeader());
104
- }
105
- }, {
106
- keys: [['ArrowLeft']],
107
- callback: function callback() {
108
- return commandsPool.moveCellSelectionLeft();
109
- }
110
- }, {
111
- keys: [['ArrowLeft', 'Control/Meta']],
112
- captureCtrl: true,
113
- callback: function callback() {
114
- return commandsPool.moveCellSelectionToMostLeft();
115
- }
116
- }, {
117
- keys: [['ArrowLeft', 'Shift']],
118
- callback: function callback() {
119
- return commandsPool.extendCellsSelectionLeft();
120
- }
121
- }, {
122
- keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
123
- captureCtrl: true,
124
- callback: function callback() {
125
- return commandsPool.extendCellsSelectionToMostLeft();
126
- },
127
- runOnlyIf: function runOnlyIf() {
128
- return !(hot.selection.isSelectedByCorner() || hot.selection.isSelectedByRowHeader());
129
- }
130
- }, {
131
- keys: [['ArrowRight']],
132
- callback: function callback() {
133
- return commandsPool.moveCellSelectionRight();
134
- }
135
- }, {
136
- keys: [['ArrowRight', 'Control/Meta']],
137
- captureCtrl: true,
138
- callback: function callback() {
139
- return commandsPool.moveCellSelectionToMostRight();
140
- }
141
- }, {
142
- keys: [['ArrowRight', 'Shift']],
143
- callback: function callback() {
144
- return commandsPool.extendCellsSelectionRight();
145
- }
146
- }, {
147
- keys: [['ArrowRight', 'Shift', 'Control/Meta']],
148
- captureCtrl: true,
149
- callback: function callback() {
150
- return commandsPool.extendCellsSelectionToMostRight();
151
- },
152
- runOnlyIf: function runOnlyIf() {
153
- return !(hot.selection.isSelectedByCorner() || hot.selection.isSelectedByRowHeader());
154
- }
155
- }, {
156
- keys: [['Home']],
157
- captureCtrl: true,
158
- callback: function callback() {
159
- return commandsPool.moveCellSelectionToMostInlineStart();
160
- },
161
- runOnlyIf: function runOnlyIf() {
162
- return hot.view.isMainTableNotFullyCoveredByOverlays();
163
- }
164
- }, {
165
- keys: [['Home', 'Shift']],
166
- callback: function callback() {
167
- return commandsPool.extendCellsSelectionToMostInlineStart();
168
- }
169
- }, {
170
- keys: [['Home', 'Control/Meta']],
171
- captureCtrl: true,
172
- callback: function callback() {
173
- return commandsPool.moveCellSelectionToMostTopInlineStart();
174
- },
175
- runOnlyIf: function runOnlyIf() {
176
- return hot.view.isMainTableNotFullyCoveredByOverlays();
177
- }
178
- }, {
179
- keys: [['End']],
180
- captureCtrl: true,
181
- callback: function callback() {
182
- return commandsPool.moveCellSelectionToMostInlineEnd();
183
- },
184
- runOnlyIf: function runOnlyIf() {
185
- return hot.view.isMainTableNotFullyCoveredByOverlays();
186
- }
187
- }, {
188
- keys: [['End', 'Shift']],
189
- callback: function callback() {
190
- return commandsPool.extendCellsSelectionToMostInlineEnd();
191
- }
192
- }, {
193
- keys: [['End', 'Control/Meta']],
194
- captureCtrl: true,
195
- callback: function callback() {
196
- return commandsPool.moveCellSelectionToMostBottomInlineEnd();
197
- },
198
- runOnlyIf: function runOnlyIf() {
199
- return hot.view.isMainTableNotFullyCoveredByOverlays();
200
- }
201
- }, {
202
- keys: [['PageUp']],
203
- callback: function callback() {
204
- return commandsPool.moveCellSelectionUpByViewportHight();
205
- }
206
- }, {
207
- keys: [['PageUp', 'Shift']],
208
- callback: function callback() {
209
- return commandsPool.extendCellsSelectionUpByViewportHeight();
210
- }
211
- }, {
212
- keys: [['PageDown']],
213
- callback: function callback() {
214
- return commandsPool.moveCellSelectionDownByViewportHeight();
215
- }
216
- }, {
217
- keys: [['PageDown', 'Shift']],
218
- callback: function callback() {
219
- return commandsPool.extendCellsSelectionDownByViewportHeight();
220
- }
221
- }, {
222
- keys: [['Tab']],
223
- callback: function callback() {
224
- return commandsPool.moveCellSelectionInlineStart();
225
- }
226
- }, {
227
- keys: [['Shift', 'Tab']],
228
- callback: function callback() {
229
- return commandsPool.moveCellSelectionInlineEnd();
230
- }
231
- }], config);
232
- }
@@ -1,228 +0,0 @@
1
- import { isDefined } from "../helpers/mixed.mjs";
2
- import { GRID_GROUP, EDITOR_EDIT_GROUP } from "./constants.mjs";
3
- import { createKeyboardShortcutCommandsPool } from "./commands/index.mjs";
4
- /**
5
- * The context that defines shortcut list available for selected cell or cells.
6
- *
7
- * @param {Handsontable} hot The Handsontable instance.
8
- */
9
- export function shortcutsGridContext(hot) {
10
- var context = hot.getShortcutManager().addContext('grid');
11
- var commandsPool = createKeyboardShortcutCommandsPool(hot);
12
- var config = {
13
- runOnlyIf: function runOnlyIf() {
14
- var _hot$getSettings = hot.getSettings(),
15
- navigableHeaders = _hot$getSettings.navigableHeaders;
16
- return isDefined(hot.getSelected()) && (navigableHeaders || !navigableHeaders && hot.countRenderedRows() > 0 && hot.countRenderedCols() > 0);
17
- },
18
- group: GRID_GROUP
19
- };
20
- context.addShortcuts([{
21
- keys: [['F2']],
22
- callback: function callback(event) {
23
- return commandsPool.editorFastOpen(event);
24
- }
25
- }, {
26
- keys: [['Enter'], ['Enter', 'Shift']],
27
- callback: function callback(event, keys) {
28
- return commandsPool.editorOpen(event, keys);
29
- }
30
- }, {
31
- keys: [['Backspace'], ['Delete']],
32
- callback: function callback() {
33
- return commandsPool.emptySelectedCells();
34
- }
35
- }], {
36
- group: EDITOR_EDIT_GROUP
37
- });
38
- context.addShortcuts([{
39
- keys: [['Control/Meta', 'A'], ['Control/Meta', 'Shift', 'Space']],
40
- callback: function callback() {
41
- return commandsPool.selectAll();
42
- }
43
- }, {
44
- keys: [['Control/Meta', 'Enter']],
45
- callback: function callback() {
46
- return commandsPool.populateSelectedCellsData();
47
- },
48
- runOnlyIf: function runOnlyIf() {
49
- return hot.getSelectedRangeLast().getCellsCount() > 1;
50
- }
51
- }, {
52
- keys: [['ArrowUp']],
53
- callback: function callback() {
54
- return commandsPool.moveCellSelectionUp();
55
- }
56
- }, {
57
- keys: [['ArrowUp', 'Control/Meta']],
58
- captureCtrl: true,
59
- callback: function callback() {
60
- return commandsPool.moveCellSelectionToMostTop();
61
- }
62
- }, {
63
- keys: [['ArrowUp', 'Shift']],
64
- callback: function callback() {
65
- return commandsPool.extendCellsSelectionUp();
66
- }
67
- }, {
68
- keys: [['ArrowUp', 'Shift', 'Control/Meta']],
69
- captureCtrl: true,
70
- callback: function callback() {
71
- return commandsPool.extendCellsSelectionToMostTop();
72
- },
73
- runOnlyIf: function runOnlyIf() {
74
- return !(hot.selection.isSelectedByCorner() || hot.selection.isSelectedByColumnHeader());
75
- }
76
- }, {
77
- keys: [['ArrowDown']],
78
- callback: function callback() {
79
- return commandsPool.moveCellSelectionDown();
80
- }
81
- }, {
82
- keys: [['ArrowDown', 'Control/Meta']],
83
- captureCtrl: true,
84
- callback: function callback() {
85
- return commandsPool.moveCellSelectionToMostBottom();
86
- }
87
- }, {
88
- keys: [['ArrowDown', 'Shift']],
89
- callback: function callback() {
90
- return commandsPool.extendCellsSelectionDown();
91
- }
92
- }, {
93
- keys: [['ArrowDown', 'Shift', 'Control/Meta']],
94
- captureCtrl: true,
95
- callback: function callback() {
96
- return commandsPool.extendCellsSelectionToMostBottom();
97
- },
98
- runOnlyIf: function runOnlyIf() {
99
- return !(hot.selection.isSelectedByCorner() || hot.selection.isSelectedByColumnHeader());
100
- }
101
- }, {
102
- keys: [['ArrowLeft']],
103
- callback: function callback() {
104
- return commandsPool.moveCellSelectionLeft();
105
- }
106
- }, {
107
- keys: [['ArrowLeft', 'Control/Meta']],
108
- captureCtrl: true,
109
- callback: function callback() {
110
- return commandsPool.moveCellSelectionToMostLeft();
111
- }
112
- }, {
113
- keys: [['ArrowLeft', 'Shift']],
114
- callback: function callback() {
115
- return commandsPool.extendCellsSelectionLeft();
116
- }
117
- }, {
118
- keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
119
- captureCtrl: true,
120
- callback: function callback() {
121
- return commandsPool.extendCellsSelectionToMostLeft();
122
- },
123
- runOnlyIf: function runOnlyIf() {
124
- return !(hot.selection.isSelectedByCorner() || hot.selection.isSelectedByRowHeader());
125
- }
126
- }, {
127
- keys: [['ArrowRight']],
128
- callback: function callback() {
129
- return commandsPool.moveCellSelectionRight();
130
- }
131
- }, {
132
- keys: [['ArrowRight', 'Control/Meta']],
133
- captureCtrl: true,
134
- callback: function callback() {
135
- return commandsPool.moveCellSelectionToMostRight();
136
- }
137
- }, {
138
- keys: [['ArrowRight', 'Shift']],
139
- callback: function callback() {
140
- return commandsPool.extendCellsSelectionRight();
141
- }
142
- }, {
143
- keys: [['ArrowRight', 'Shift', 'Control/Meta']],
144
- captureCtrl: true,
145
- callback: function callback() {
146
- return commandsPool.extendCellsSelectionToMostRight();
147
- },
148
- runOnlyIf: function runOnlyIf() {
149
- return !(hot.selection.isSelectedByCorner() || hot.selection.isSelectedByRowHeader());
150
- }
151
- }, {
152
- keys: [['Home']],
153
- captureCtrl: true,
154
- callback: function callback() {
155
- return commandsPool.moveCellSelectionToMostInlineStart();
156
- },
157
- runOnlyIf: function runOnlyIf() {
158
- return hot.view.isMainTableNotFullyCoveredByOverlays();
159
- }
160
- }, {
161
- keys: [['Home', 'Shift']],
162
- callback: function callback() {
163
- return commandsPool.extendCellsSelectionToMostInlineStart();
164
- }
165
- }, {
166
- keys: [['Home', 'Control/Meta']],
167
- captureCtrl: true,
168
- callback: function callback() {
169
- return commandsPool.moveCellSelectionToMostTopInlineStart();
170
- },
171
- runOnlyIf: function runOnlyIf() {
172
- return hot.view.isMainTableNotFullyCoveredByOverlays();
173
- }
174
- }, {
175
- keys: [['End']],
176
- captureCtrl: true,
177
- callback: function callback() {
178
- return commandsPool.moveCellSelectionToMostInlineEnd();
179
- },
180
- runOnlyIf: function runOnlyIf() {
181
- return hot.view.isMainTableNotFullyCoveredByOverlays();
182
- }
183
- }, {
184
- keys: [['End', 'Shift']],
185
- callback: function callback() {
186
- return commandsPool.extendCellsSelectionToMostInlineEnd();
187
- }
188
- }, {
189
- keys: [['End', 'Control/Meta']],
190
- captureCtrl: true,
191
- callback: function callback() {
192
- return commandsPool.moveCellSelectionToMostBottomInlineEnd();
193
- },
194
- runOnlyIf: function runOnlyIf() {
195
- return hot.view.isMainTableNotFullyCoveredByOverlays();
196
- }
197
- }, {
198
- keys: [['PageUp']],
199
- callback: function callback() {
200
- return commandsPool.moveCellSelectionUpByViewportHight();
201
- }
202
- }, {
203
- keys: [['PageUp', 'Shift']],
204
- callback: function callback() {
205
- return commandsPool.extendCellsSelectionUpByViewportHeight();
206
- }
207
- }, {
208
- keys: [['PageDown']],
209
- callback: function callback() {
210
- return commandsPool.moveCellSelectionDownByViewportHeight();
211
- }
212
- }, {
213
- keys: [['PageDown', 'Shift']],
214
- callback: function callback() {
215
- return commandsPool.extendCellsSelectionDownByViewportHeight();
216
- }
217
- }, {
218
- keys: [['Tab']],
219
- callback: function callback() {
220
- return commandsPool.moveCellSelectionInlineStart();
221
- }
222
- }, {
223
- keys: [['Shift', 'Tab']],
224
- callback: function callback() {
225
- return commandsPool.moveCellSelectionInlineEnd();
226
- }
227
- }], config);
228
- }
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.object.keys.js");
4
- exports.__esModule = true;
5
- var _exportNames = {
6
- registerAllShortcutContexts: true
7
- };
8
- exports.registerAllShortcutContexts = registerAllShortcutContexts;
9
- require("core-js/modules/es.object.to-string.js");
10
- require("core-js/modules/web.dom-collections.for-each.js");
11
- var _editor = require("./editor");
12
- var _grid = require("./grid");
13
- var _constants = require("./constants");
14
- Object.keys(_constants).forEach(function (key) {
15
- if (key === "default" || key === "__esModule") return;
16
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
17
- if (key in exports && exports[key] === _constants[key]) return;
18
- exports[key] = _constants[key];
19
- });
20
- /**
21
- * Register all shortcut contexts.
22
- *
23
- * @param {Handsontable} hotInstance The Handsontable instance.
24
- */
25
- function registerAllShortcutContexts(hotInstance) {
26
- [_editor.shortcutsEditorContext, _grid.shortcutsGridContext].forEach(function (context) {
27
- return context(hotInstance);
28
- });
29
- }
@@ -1,15 +0,0 @@
1
- import "core-js/modules/es.object.to-string.js";
2
- import "core-js/modules/web.dom-collections.for-each.js";
3
- import { shortcutsEditorContext } from "./editor.mjs";
4
- import { shortcutsGridContext } from "./grid.mjs";
5
- export * from "./constants.mjs";
6
- /**
7
- * Register all shortcut contexts.
8
- *
9
- * @param {Handsontable} hotInstance The Handsontable instance.
10
- */
11
- export function registerAllShortcutContexts(hotInstance) {
12
- [shortcutsEditorContext, shortcutsGridContext].forEach(function (context) {
13
- return context(hotInstance);
14
- });
15
- }