handsontable 0.0.0-next-7026906-20231107 → 0.0.0-next-7b93b7d-20231107

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 (316) hide show
  1. package/3rdparty/SheetClip/SheetClip.js +2 -2
  2. package/3rdparty/SheetClip/SheetClip.mjs +2 -2
  3. package/3rdparty/autoResize/autoResize.js +2 -2
  4. package/3rdparty/autoResize/autoResize.mjs +2 -2
  5. package/3rdparty/walkontable/src/calculator/viewportColumns.js +108 -85
  6. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +108 -85
  7. package/3rdparty/walkontable/src/calculator/viewportRows.js +60 -52
  8. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +60 -52
  9. package/3rdparty/walkontable/src/core/clone.js +6 -0
  10. package/3rdparty/walkontable/src/core/clone.mjs +6 -0
  11. package/3rdparty/walkontable/src/event.js +125 -74
  12. package/3rdparty/walkontable/src/event.mjs +125 -74
  13. package/3rdparty/walkontable/src/filter/column.js +16 -0
  14. package/3rdparty/walkontable/src/filter/column.mjs +16 -0
  15. package/3rdparty/walkontable/src/filter/row.js +16 -0
  16. package/3rdparty/walkontable/src/filter/row.mjs +16 -0
  17. package/3rdparty/walkontable/src/overlay/bottom.js +1 -1
  18. package/3rdparty/walkontable/src/overlay/bottom.mjs +1 -1
  19. package/3rdparty/walkontable/src/overlay/top.js +1 -1
  20. package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
  21. package/3rdparty/walkontable/src/renderer/_base.js +12 -5
  22. package/3rdparty/walkontable/src/renderer/_base.mjs +12 -5
  23. package/3rdparty/walkontable/src/renderer/cells.js +6 -2
  24. package/3rdparty/walkontable/src/renderer/cells.mjs +6 -2
  25. package/3rdparty/walkontable/src/renderer/rowHeaders.js +6 -2
  26. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +6 -2
  27. package/3rdparty/walkontable/src/renderer/rows.js +5 -0
  28. package/3rdparty/walkontable/src/renderer/rows.mjs +5 -0
  29. package/3rdparty/walkontable/src/renderer/table.js +24 -17
  30. package/3rdparty/walkontable/src/renderer/table.mjs +24 -17
  31. package/3rdparty/walkontable/src/scroll.js +2 -2
  32. package/3rdparty/walkontable/src/scroll.mjs +2 -2
  33. package/3rdparty/walkontable/src/selection/border/border.js +1 -1
  34. package/3rdparty/walkontable/src/selection/border/border.mjs +1 -1
  35. package/3rdparty/walkontable/src/settings.js +10 -10
  36. package/3rdparty/walkontable/src/settings.mjs +10 -10
  37. package/3rdparty/walkontable/src/table.js +3 -3
  38. package/3rdparty/walkontable/src/table.mjs +3 -3
  39. package/3rdparty/walkontable/src/utils/column.js +19 -4
  40. package/3rdparty/walkontable/src/utils/column.mjs +19 -4
  41. package/3rdparty/walkontable/src/utils/nodesPool.js +5 -0
  42. package/3rdparty/walkontable/src/utils/nodesPool.mjs +5 -0
  43. package/3rdparty/walkontable/src/utils/orderView/view.js +13 -6
  44. package/3rdparty/walkontable/src/utils/orderView/view.mjs +13 -6
  45. package/3rdparty/walkontable/src/utils/orderView/viewSize.js +9 -6
  46. package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +9 -6
  47. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +7 -4
  48. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +7 -4
  49. package/3rdparty/walkontable/src/utils/row.js +14 -2
  50. package/3rdparty/walkontable/src/utils/row.mjs +14 -2
  51. package/3rdparty/walkontable/src/viewport.js +9 -9
  52. package/3rdparty/walkontable/src/viewport.mjs +9 -9
  53. package/base.js +2 -2
  54. package/base.mjs +2 -2
  55. package/core.js +25 -25
  56. package/core.mjs +25 -25
  57. package/dataMap/dataMap.js +99 -90
  58. package/dataMap/dataMap.mjs +99 -90
  59. package/dataMap/dataSource.js +14 -8
  60. package/dataMap/dataSource.mjs +14 -8
  61. package/dataMap/metaManager/lazyFactoryMap.js +19 -7
  62. package/dataMap/metaManager/lazyFactoryMap.mjs +19 -7
  63. package/dataMap/metaManager/metaLayers/cellMeta.js +8 -3
  64. package/dataMap/metaManager/metaLayers/cellMeta.mjs +8 -3
  65. package/dataMap/metaManager/metaLayers/columnMeta.js +7 -1
  66. package/dataMap/metaManager/metaLayers/columnMeta.mjs +7 -1
  67. package/dataMap/metaManager/metaLayers/globalMeta.js +6 -1
  68. package/dataMap/metaManager/metaLayers/globalMeta.mjs +6 -1
  69. package/dataMap/metaManager/metaLayers/tableMeta.js +6 -2
  70. package/dataMap/metaManager/metaLayers/tableMeta.mjs +6 -2
  71. package/dataMap/metaManager/metaSchema.js +55 -55
  72. package/dataMap/metaManager/metaSchema.mjs +55 -55
  73. package/dataMap/metaManager/mods/dynamicCellMeta.js +7 -2
  74. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +7 -2
  75. package/dataMap/metaManager/mods/extendMetaProperties.js +8 -4
  76. package/dataMap/metaManager/mods/extendMetaProperties.mjs +8 -4
  77. package/dataMap/metaManager/utils.js +2 -2
  78. package/dataMap/metaManager/utils.mjs +2 -2
  79. package/dist/handsontable.css +2 -2
  80. package/dist/handsontable.full.css +2 -2
  81. package/dist/handsontable.full.js +7244 -6347
  82. package/dist/handsontable.full.min.css +2 -2
  83. package/dist/handsontable.full.min.js +120 -120
  84. package/dist/handsontable.js +7243 -6346
  85. package/dist/handsontable.min.css +2 -2
  86. package/dist/handsontable.min.js +28 -28
  87. package/editorManager.js +105 -95
  88. package/editorManager.mjs +105 -95
  89. package/editors/autocompleteEditor/autocompleteEditor.js +47 -46
  90. package/editors/autocompleteEditor/autocompleteEditor.mjs +46 -45
  91. package/editors/baseEditor/baseEditor.js +23 -26
  92. package/editors/baseEditor/baseEditor.mjs +23 -26
  93. package/editors/dateEditor/dateEditor.js +24 -15
  94. package/editors/dateEditor/dateEditor.mjs +24 -15
  95. package/editors/dropdownEditor/dropdownEditor.js +1 -1
  96. package/editors/dropdownEditor/dropdownEditor.mjs +1 -1
  97. package/editors/handsontableEditor/handsontableEditor.js +4 -4
  98. package/editors/handsontableEditor/handsontableEditor.mjs +4 -4
  99. package/editors/textEditor/textEditor.js +23 -17
  100. package/editors/textEditor/textEditor.mjs +24 -18
  101. package/eventManager.js +8 -0
  102. package/eventManager.mjs +8 -0
  103. package/helpers/array.js +2 -2
  104. package/helpers/array.mjs +2 -2
  105. package/helpers/dom/element.js +7 -7
  106. package/helpers/dom/element.mjs +7 -7
  107. package/helpers/function.js +1 -1
  108. package/helpers/function.mjs +1 -1
  109. package/helpers/mixed.js +1 -1
  110. package/helpers/mixed.mjs +1 -1
  111. package/helpers/object.js +4 -4
  112. package/helpers/object.mjs +4 -4
  113. package/helpers/string.js +1 -1
  114. package/helpers/string.mjs +1 -1
  115. package/package.json +1 -1
  116. package/pluginHooks.d.ts +0 -2
  117. package/pluginHooks.js +12 -3
  118. package/pluginHooks.mjs +12 -3
  119. package/plugins/autoColumnSize/autoColumnSize.js +141 -130
  120. package/plugins/autoColumnSize/autoColumnSize.mjs +140 -129
  121. package/plugins/autoRowSize/autoRowSize.js +112 -125
  122. package/plugins/autoRowSize/autoRowSize.mjs +110 -123
  123. package/plugins/autofill/autofill.js +97 -102
  124. package/plugins/autofill/autofill.mjs +96 -101
  125. package/plugins/base/base.js +57 -22
  126. package/plugins/base/base.mjs +56 -22
  127. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +29 -24
  128. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +28 -23
  129. package/plugins/collapsibleColumns/collapsibleColumns.js +104 -107
  130. package/plugins/collapsibleColumns/collapsibleColumns.mjs +102 -104
  131. package/plugins/columnSorting/columnSorting.js +105 -98
  132. package/plugins/columnSorting/columnSorting.mjs +104 -97
  133. package/plugins/columnSorting/columnStatesManager.js +12 -6
  134. package/plugins/columnSorting/columnStatesManager.mjs +12 -6
  135. package/plugins/columnSummary/columnSummary.js +71 -58
  136. package/plugins/columnSummary/columnSummary.mjs +70 -57
  137. package/plugins/columnSummary/endpoints.js +20 -14
  138. package/plugins/columnSummary/endpoints.mjs +20 -14
  139. package/plugins/comments/commentEditor.js +30 -2
  140. package/plugins/comments/commentEditor.mjs +30 -2
  141. package/plugins/comments/comments.js +158 -169
  142. package/plugins/comments/comments.mjs +157 -168
  143. package/plugins/comments/displaySwitch.js +7 -3
  144. package/plugins/comments/displaySwitch.mjs +7 -3
  145. package/plugins/contextMenu/commandExecutor.js +15 -2
  146. package/plugins/contextMenu/commandExecutor.mjs +15 -2
  147. package/plugins/contextMenu/contextMenu.js +91 -101
  148. package/plugins/contextMenu/contextMenu.mjs +90 -100
  149. package/plugins/contextMenu/itemsFactory.js +19 -4
  150. package/plugins/contextMenu/itemsFactory.mjs +19 -4
  151. package/plugins/contextMenu/menu/cursor.js +36 -0
  152. package/plugins/contextMenu/menu/cursor.mjs +36 -0
  153. package/plugins/contextMenu/menu/menu.js +57 -5
  154. package/plugins/contextMenu/menu/menu.mjs +57 -5
  155. package/plugins/copyPaste/copyPaste.js +74 -75
  156. package/plugins/copyPaste/copyPaste.mjs +74 -75
  157. package/plugins/customBorders/customBorders.js +49 -48
  158. package/plugins/customBorders/customBorders.mjs +48 -47
  159. package/plugins/dragToScroll/dragToScroll.js +50 -54
  160. package/plugins/dragToScroll/dragToScroll.mjs +49 -52
  161. package/plugins/dropdownMenu/dropdownMenu.js +132 -129
  162. package/plugins/dropdownMenu/dropdownMenu.mjs +132 -129
  163. package/plugins/exportFile/dataProvider.js +7 -2
  164. package/plugins/exportFile/dataProvider.mjs +7 -2
  165. package/plugins/exportFile/exportFile.js +1 -1
  166. package/plugins/exportFile/exportFile.mjs +1 -1
  167. package/plugins/exportFile/types/_base.js +14 -6
  168. package/plugins/exportFile/types/_base.mjs +14 -6
  169. package/plugins/filters/component/actionBar.js +9 -0
  170. package/plugins/filters/component/actionBar.mjs +9 -0
  171. package/plugins/filters/component/condition.js +13 -0
  172. package/plugins/filters/component/condition.mjs +13 -0
  173. package/plugins/filters/component/operators.js +9 -0
  174. package/plugins/filters/component/operators.mjs +9 -0
  175. package/plugins/filters/component/value.js +9 -0
  176. package/plugins/filters/component/value.mjs +9 -0
  177. package/plugins/filters/conditionCollection.js +9 -4
  178. package/plugins/filters/conditionCollection.mjs +9 -4
  179. package/plugins/filters/conditionUpdateObserver.js +53 -42
  180. package/plugins/filters/conditionUpdateObserver.mjs +53 -42
  181. package/plugins/filters/dataFilter.js +9 -3
  182. package/plugins/filters/dataFilter.mjs +9 -3
  183. package/plugins/filters/filters.js +184 -189
  184. package/plugins/filters/filters.mjs +182 -187
  185. package/plugins/filters/ui/_base.js +1 -1
  186. package/plugins/filters/ui/_base.mjs +1 -1
  187. package/plugins/filters/utils.js +1 -1
  188. package/plugins/filters/utils.mjs +1 -1
  189. package/plugins/formulas/engine/settings.js +1 -1
  190. package/plugins/formulas/engine/settings.mjs +1 -1
  191. package/plugins/formulas/formulas.js +684 -602
  192. package/plugins/formulas/formulas.mjs +682 -600
  193. package/plugins/hiddenColumns/hiddenColumns.js +174 -169
  194. package/plugins/hiddenColumns/hiddenColumns.mjs +173 -168
  195. package/plugins/hiddenRows/hiddenRows.js +170 -165
  196. package/plugins/hiddenRows/hiddenRows.mjs +169 -164
  197. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
  198. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
  199. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
  200. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
  201. package/plugins/manualColumnFreeze/manualColumnFreeze.js +67 -54
  202. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +64 -51
  203. package/plugins/manualColumnMove/manualColumnMove.js +287 -232
  204. package/plugins/manualColumnMove/manualColumnMove.mjs +286 -231
  205. package/plugins/manualColumnMove/ui/_base.js +9 -3
  206. package/plugins/manualColumnMove/ui/_base.mjs +9 -3
  207. package/plugins/manualColumnResize/manualColumnResize.js +291 -246
  208. package/plugins/manualColumnResize/manualColumnResize.mjs +290 -244
  209. package/plugins/manualRowMove/manualRowMove.js +223 -208
  210. package/plugins/manualRowMove/manualRowMove.mjs +222 -207
  211. package/plugins/manualRowMove/ui/_base.js +10 -5
  212. package/plugins/manualRowMove/ui/_base.mjs +10 -5
  213. package/plugins/manualRowResize/manualRowResize.js +254 -209
  214. package/plugins/manualRowResize/manualRowResize.mjs +253 -207
  215. package/plugins/mergeCells/calculations/autofill.js +9 -3
  216. package/plugins/mergeCells/calculations/autofill.mjs +9 -3
  217. package/plugins/mergeCells/calculations/selection.js +10 -4
  218. package/plugins/mergeCells/calculations/selection.mjs +10 -4
  219. package/plugins/mergeCells/cellCoords.js +16 -6
  220. package/plugins/mergeCells/cellCoords.mjs +16 -6
  221. package/plugins/mergeCells/cellsCollection.js +10 -4
  222. package/plugins/mergeCells/cellsCollection.mjs +10 -4
  223. package/plugins/mergeCells/mergeCells.js +582 -502
  224. package/plugins/mergeCells/mergeCells.mjs +580 -500
  225. package/plugins/multiColumnSorting/multiColumnSorting.js +13 -10
  226. package/plugins/multiColumnSorting/multiColumnSorting.mjs +13 -10
  227. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +16 -28
  228. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +16 -27
  229. package/plugins/nestedHeaders/nestedHeaders.js +542 -499
  230. package/plugins/nestedHeaders/nestedHeaders.mjs +554 -511
  231. package/plugins/nestedHeaders/stateManager/index.js +1 -1
  232. package/plugins/nestedHeaders/stateManager/index.mjs +1 -1
  233. package/plugins/nestedRows/data/dataManager.js +21 -15
  234. package/plugins/nestedRows/data/dataManager.mjs +21 -15
  235. package/plugins/nestedRows/nestedRows.js +326 -278
  236. package/plugins/nestedRows/nestedRows.mjs +325 -277
  237. package/plugins/nestedRows/ui/_base.js +7 -1
  238. package/plugins/nestedRows/ui/_base.mjs +7 -1
  239. package/plugins/nestedRows/ui/collapsing.js +2 -2
  240. package/plugins/nestedRows/ui/collapsing.mjs +2 -2
  241. package/plugins/nestedRows/ui/contextMenu.js +28 -18
  242. package/plugins/nestedRows/ui/contextMenu.mjs +28 -18
  243. package/plugins/nestedRows/utils/rowMoveController.js +12 -4
  244. package/plugins/nestedRows/utils/rowMoveController.mjs +12 -4
  245. package/plugins/persistentState/persistentState.js +14 -11
  246. package/plugins/persistentState/persistentState.mjs +14 -11
  247. package/plugins/persistentState/storage.js +11 -6
  248. package/plugins/persistentState/storage.mjs +11 -6
  249. package/plugins/registry.js +2 -2
  250. package/plugins/registry.mjs +2 -2
  251. package/plugins/search/search.js +57 -46
  252. package/plugins/search/search.mjs +56 -45
  253. package/plugins/touchScroll/touchScroll.js +102 -100
  254. package/plugins/touchScroll/touchScroll.mjs +100 -98
  255. package/plugins/trimRows/trimRows.js +33 -28
  256. package/plugins/trimRows/trimRows.mjs +32 -27
  257. package/plugins/undoRedo/undoRedo.js +2 -2
  258. package/plugins/undoRedo/undoRedo.mjs +2 -2
  259. package/renderers/autocompleteRenderer/autocompleteRenderer.js +11 -11
  260. package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +11 -11
  261. package/renderers/baseRenderer/baseRenderer.js +2 -2
  262. package/renderers/baseRenderer/baseRenderer.mjs +2 -2
  263. package/renderers/checkboxRenderer/checkboxRenderer.js +23 -23
  264. package/renderers/checkboxRenderer/checkboxRenderer.mjs +23 -23
  265. package/renderers/dateRenderer/dateRenderer.js +4 -4
  266. package/renderers/dateRenderer/dateRenderer.mjs +4 -4
  267. package/renderers/handsontableRenderer/handsontableRenderer.js +4 -4
  268. package/renderers/handsontableRenderer/handsontableRenderer.mjs +4 -4
  269. package/renderers/htmlRenderer/htmlRenderer.js +4 -4
  270. package/renderers/htmlRenderer/htmlRenderer.mjs +4 -4
  271. package/renderers/numericRenderer/numericRenderer.js +3 -3
  272. package/renderers/numericRenderer/numericRenderer.mjs +3 -3
  273. package/renderers/passwordRenderer/passwordRenderer.js +3 -3
  274. package/renderers/passwordRenderer/passwordRenderer.mjs +3 -3
  275. package/renderers/selectRenderer/selectRenderer.js +4 -4
  276. package/renderers/selectRenderer/selectRenderer.mjs +4 -4
  277. package/renderers/textRenderer/textRenderer.js +5 -5
  278. package/renderers/textRenderer/textRenderer.mjs +5 -5
  279. package/renderers/timeRenderer/timeRenderer.js +3 -3
  280. package/renderers/timeRenderer/timeRenderer.mjs +3 -3
  281. package/selection/range.js +12 -2
  282. package/selection/range.mjs +12 -2
  283. package/selection/selection.js +3 -3
  284. package/selection/selection.mjs +3 -3
  285. package/tableView.js +208 -200
  286. package/tableView.mjs +208 -200
  287. package/translations/changesObservable/utils.js +2 -2
  288. package/translations/changesObservable/utils.mjs +2 -2
  289. package/translations/indexMapper.js +25 -22
  290. package/translations/indexMapper.mjs +25 -22
  291. package/translations/mapCollections/aggregatedCollection.js +8 -2
  292. package/translations/mapCollections/aggregatedCollection.mjs +8 -2
  293. package/translations/mapCollections/mapCollection.js +5 -2
  294. package/translations/mapCollections/mapCollection.mjs +5 -2
  295. package/translations/maps/indexMap.js +6 -1
  296. package/translations/maps/indexMap.mjs +6 -1
  297. package/translations/maps/utils/physicallyIndexed.js +2 -2
  298. package/translations/maps/utils/physicallyIndexed.mjs +2 -2
  299. package/utils/dataStructures/linkedList.js +10 -6
  300. package/utils/dataStructures/linkedList.mjs +10 -6
  301. package/utils/dataStructures/queue.js +1 -1
  302. package/utils/dataStructures/queue.mjs +1 -1
  303. package/utils/dataStructures/stack.js +1 -1
  304. package/utils/dataStructures/stack.mjs +1 -1
  305. package/utils/ghostTable.js +2 -2
  306. package/utils/ghostTable.mjs +2 -2
  307. package/utils/interval.js +73 -36
  308. package/utils/interval.mjs +73 -36
  309. package/utils/parseTable.js +1 -1
  310. package/utils/parseTable.mjs +1 -1
  311. package/validators/autocompleteValidator/autocompleteValidator.js +1 -1
  312. package/validators/autocompleteValidator/autocompleteValidator.mjs +1 -1
  313. package/validators/dateValidator/dateValidator.js +1 -1
  314. package/validators/dateValidator/dateValidator.mjs +1 -1
  315. package/validators/numericValidator/numericValidator.js +1 -1
  316. package/validators/numericValidator/numericValidator.mjs +1 -1
package/editorManager.js CHANGED
@@ -1,85 +1,112 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
+ require("core-js/modules/es.error.cause.js");
4
5
  var _unicode = require("./helpers/unicode");
5
6
  var _event = require("./helpers/dom/event");
6
7
  var _registry = require("./editors/registry");
7
8
  var _eventManager = _interopRequireDefault(require("./eventManager"));
8
9
  var _mixed = require("./helpers/mixed");
9
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
12
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
13
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
15
+ 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); }
16
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
10
17
  const SHORTCUTS_GROUP_NAVIGATION = 'editorManager.navigation';
11
18
  exports.SHORTCUTS_GROUP_NAVIGATION = SHORTCUTS_GROUP_NAVIGATION;
19
+ var _onAfterDocumentKeyDown = /*#__PURE__*/new WeakSet();
20
+ var _onCellDblClick = /*#__PURE__*/new WeakSet();
12
21
  class EditorManager {
13
22
  /**
14
- * @param {Core} instance The Handsontable instance.
23
+ * @param {Core} hotInstance The Handsontable instance.
15
24
  * @param {TableMeta} tableMeta The table meta instance.
16
25
  * @param {Selection} selection The selection instance.
17
26
  */
18
- constructor(instance, tableMeta, selection) {
27
+ constructor(hotInstance, tableMeta, _selection) {
28
+ /**
29
+ * OnCellDblClick callback.
30
+ *
31
+ * @param {MouseEvent} event The mouse event object.
32
+ * @param {object} coords The cell coordinates.
33
+ * @param {HTMLTableCellElement|HTMLTableHeaderCellElement} elem The element which triggers the action.
34
+ */
35
+ _classPrivateMethodInitSpec(this, _onCellDblClick);
36
+ /**
37
+ * OnAfterDocumentKeyDown callback.
38
+ *
39
+ * @param {KeyboardEvent} event The keyboard event object.
40
+ */
41
+ _classPrivateMethodInitSpec(this, _onAfterDocumentKeyDown);
19
42
  /**
20
43
  * Instance of {@link Handsontable}.
21
44
  *
22
45
  * @private
23
46
  * @type {Handsontable}
24
47
  */
25
- this.instance = instance;
48
+ _defineProperty(this, "hot", void 0);
26
49
  /**
27
50
  * Reference to an instance's private GridSettings object.
28
51
  *
29
52
  * @private
30
53
  * @type {GridSettings}
31
54
  */
32
- this.tableMeta = tableMeta;
55
+ _defineProperty(this, "tableMeta", void 0);
33
56
  /**
34
57
  * Instance of {@link Selection}.
35
58
  *
36
59
  * @private
37
60
  * @type {Selection}
38
61
  */
39
- this.selection = selection;
62
+ _defineProperty(this, "selection", void 0);
40
63
  /**
41
64
  * Instance of {@link EventManager}.
42
65
  *
43
66
  * @private
44
67
  * @type {EventManager}
45
68
  */
46
- this.eventManager = new _eventManager.default(instance);
69
+ _defineProperty(this, "eventManager", void 0);
47
70
  /**
48
71
  * Determines if EditorManager is destroyed.
49
72
  *
50
73
  * @private
51
74
  * @type {boolean}
52
75
  */
53
- this.destroyed = false;
76
+ _defineProperty(this, "destroyed", false);
54
77
  /**
55
78
  * Determines if EditorManager is locked.
56
79
  *
57
80
  * @private
58
81
  * @type {boolean}
59
82
  */
60
- this.lock = false;
83
+ _defineProperty(this, "lock", false);
61
84
  /**
62
85
  * A reference to an instance of the activeEditor.
63
86
  *
64
87
  * @private
65
88
  * @type {BaseEditor}
66
89
  */
67
- this.activeEditor = void 0;
90
+ _defineProperty(this, "activeEditor", void 0);
68
91
  /**
69
92
  * Keeps a reference to the cell's properties object.
70
93
  *
71
94
  * @type {object}
72
95
  */
73
- this.cellProperties = void 0;
74
- this.instance.addHook('afterDocumentKeyDown', event => this.onAfterDocumentKeyDown(event));
96
+ _defineProperty(this, "cellProperties", void 0);
97
+ this.hot = hotInstance;
98
+ this.tableMeta = tableMeta;
99
+ this.selection = _selection;
100
+ this.eventManager = new _eventManager.default(hotInstance);
101
+ this.hot.addHook('afterDocumentKeyDown', event => _classPrivateMethodGet(this, _onAfterDocumentKeyDown, _onAfterDocumentKeyDown2).call(this, event));
75
102
 
76
103
  // Open editor when text composition is started (IME editor)
77
- this.eventManager.addEventListener(this.instance.rootDocument.documentElement, 'compositionstart', event => {
78
- if (!this.destroyed && this.instance.isListening()) {
104
+ this.eventManager.addEventListener(this.hot.rootDocument.documentElement, 'compositionstart', event => {
105
+ if (!this.destroyed && this.hot.isListening()) {
79
106
  this.openEditor('', event);
80
107
  }
81
108
  });
82
- this.instance.view._wt.update('onCellDblClick', (event, coords, elem) => this.onCellDblClick(event, coords, elem));
109
+ this.hot.view._wt.update('onCellDblClick', (event, coords, elem) => _classPrivateMethodGet(this, _onCellDblClick, _onCellDblClick2).call(this, event, coords, elem));
83
110
  }
84
111
 
85
112
  /**
@@ -136,7 +163,7 @@ class EditorManager {
136
163
  }
137
164
  const {
138
165
  highlight
139
- } = this.instance.getSelectedRangeLast();
166
+ } = this.hot.getSelectedRangeLast();
140
167
  if (highlight.isHeader()) {
141
168
  return;
142
169
  }
@@ -144,7 +171,7 @@ class EditorManager {
144
171
  row,
145
172
  col
146
173
  } = highlight;
147
- const modifiedCellCoords = this.instance.runHooks('modifyGetCellCoords', row, col);
174
+ const modifiedCellCoords = this.hot.runHooks('modifyGetCellCoords', row, col);
148
175
  let visualRowToCheck = row;
149
176
  let visualColumnToCheck = col;
150
177
  if (Array.isArray(modifiedCellCoords)) {
@@ -152,20 +179,20 @@ class EditorManager {
152
179
  }
153
180
 
154
181
  // Getting values using the modified coordinates.
155
- this.cellProperties = this.instance.getCellMeta(visualRowToCheck, visualColumnToCheck);
182
+ this.cellProperties = this.hot.getCellMeta(visualRowToCheck, visualColumnToCheck);
156
183
  if (!this.isCellEditable()) {
157
184
  this.clearActiveEditor();
158
185
  return;
159
186
  }
160
- const td = this.instance.getCell(row, col, true);
187
+ const td = this.hot.getCell(row, col, true);
161
188
 
162
189
  // Skip the preparation when the cell is not rendered in the DOM. The cell is scrolled out of
163
190
  // the table's viewport.
164
191
  if (td) {
165
- const editorClass = this.instance.getCellEditor(this.cellProperties);
166
- const prop = this.instance.colToProp(visualColumnToCheck);
167
- const originalValue = this.instance.getSourceDataAtCell(this.instance.toPhysicalRow(visualRowToCheck), visualColumnToCheck);
168
- this.activeEditor = (0, _registry.getEditorInstance)(editorClass, this.instance);
192
+ const editorClass = this.hot.getCellEditor(this.cellProperties);
193
+ const prop = this.hot.colToProp(visualColumnToCheck);
194
+ const originalValue = this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(visualRowToCheck), visualColumnToCheck);
195
+ this.activeEditor = (0, _registry.getEditorInstance)(editorClass, this.hot);
169
196
  // Using not modified coordinates, as we need to get the table element using selection coordinates.
170
197
  // There is an extra translation in the editor for saving value.
171
198
  this.activeEditor.prepare(row, col, prop, td, originalValue, this.cellProperties);
@@ -196,7 +223,7 @@ class EditorManager {
196
223
  return;
197
224
  }
198
225
  if (!this.activeEditor) {
199
- this.instance.scrollToFocusedCell();
226
+ this.hot.scrollToFocusedCell();
200
227
  this.prepareEditor();
201
228
  }
202
229
  if (this.activeEditor) {
@@ -246,7 +273,7 @@ class EditorManager {
246
273
  * @private
247
274
  */
248
275
  clearActiveEditor() {
249
- this.activeEditor = void 0;
276
+ this.activeEditor = undefined;
250
277
  }
251
278
 
252
279
  /**
@@ -260,11 +287,11 @@ class EditorManager {
260
287
  * @returns {boolean}
261
288
  */
262
289
  isCellEditable() {
263
- const selection = this.instance.getSelectedRangeLast();
290
+ const selection = this.hot.getSelectedRangeLast();
264
291
  if (!selection) {
265
292
  return false;
266
293
  }
267
- const editorClass = this.instance.getCellEditor(this.cellProperties);
294
+ const editorClass = this.hot.getCellEditor(this.cellProperties);
268
295
  const {
269
296
  row,
270
297
  col
@@ -272,8 +299,8 @@ class EditorManager {
272
299
  const {
273
300
  rowIndexMapper,
274
301
  columnIndexMapper
275
- } = this.instance;
276
- const isCellHidden = rowIndexMapper.isHidden(this.instance.toPhysicalRow(row)) || columnIndexMapper.isHidden(this.instance.toPhysicalColumn(col));
302
+ } = this.hot;
303
+ const isCellHidden = rowIndexMapper.isHidden(this.hot.toPhysicalRow(row)) || columnIndexMapper.isHidden(this.hot.toPhysicalColumn(col));
277
304
  if (this.cellProperties.readOnly || !editorClass || isCellHidden) {
278
305
  return false;
279
306
  }
@@ -296,73 +323,6 @@ class EditorManager {
296
323
  this.selection.transformStart(enterMoves.row, enterMoves.col, true);
297
324
  }
298
325
  }
299
-
300
- /**
301
- * OnAfterDocumentKeyDown callback.
302
- *
303
- * @private
304
- * @param {KeyboardEvent} event The keyboard event object.
305
- */
306
- onAfterDocumentKeyDown(event) {
307
- const selection = this.instance.getSelectedRangeLast();
308
- if (!this.instance.isListening() || !selection || selection.highlight.isHeader() || (0, _event.isImmediatePropagationStopped)(event)) {
309
- return;
310
- }
311
- const {
312
- keyCode
313
- } = event;
314
-
315
- // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
316
- const isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
317
- if (!this.activeEditor || this.activeEditor && !this.activeEditor.isWaiting()) {
318
- if (!(0, _unicode.isFunctionKey)(keyCode) && !(0, _unicode.isCtrlMetaKey)(keyCode) && !isCtrlPressed && !this.isEditorOpened()) {
319
- const shortcutManager = this.instance.getShortcutManager();
320
- const editorContext = shortcutManager.getContext('editor');
321
- const runOnlySelectedConfig = {
322
- runOnlyIf: () => (0, _mixed.isDefined)(this.instance.getSelected()),
323
- group: SHORTCUTS_GROUP_NAVIGATION
324
- };
325
- editorContext.addShortcuts([{
326
- keys: [['ArrowUp']],
327
- callback: () => {
328
- this.instance.selection.transformStart(-1, 0);
329
- }
330
- }, {
331
- keys: [['ArrowDown']],
332
- callback: () => {
333
- this.instance.selection.transformStart(1, 0);
334
- }
335
- }, {
336
- keys: [['ArrowLeft']],
337
- callback: () => {
338
- this.instance.selection.transformStart(0, -1 * this.instance.getDirectionFactor());
339
- }
340
- }, {
341
- keys: [['ArrowRight']],
342
- callback: () => {
343
- this.instance.selection.transformStart(0, this.instance.getDirectionFactor());
344
- }
345
- }], runOnlySelectedConfig);
346
- this.openEditor('', event);
347
- }
348
- }
349
- }
350
-
351
- /**
352
- * OnCellDblClick callback.
353
- *
354
- * @private
355
- * @param {MouseEvent} event The mouse event object.
356
- * @param {object} coords The cell coordinates.
357
- * @param {HTMLTableCellElement|HTMLTableHeaderCellElement} elem The element which triggers the action.
358
- */
359
- onCellDblClick(event, coords, elem) {
360
- // may be TD or TH
361
- if (elem.nodeName === 'TD') {
362
- this.openEditor(null, event, true);
363
- }
364
- }
365
-
366
326
  /**
367
327
  * Destroy the instance.
368
328
  */
@@ -371,6 +331,56 @@ class EditorManager {
371
331
  this.eventManager.destroy();
372
332
  }
373
333
  }
334
+ function _onAfterDocumentKeyDown2(event) {
335
+ const selection = this.hot.getSelectedRangeLast();
336
+ if (!this.hot.isListening() || !selection || selection.highlight.isHeader() || (0, _event.isImmediatePropagationStopped)(event)) {
337
+ return;
338
+ }
339
+ const {
340
+ keyCode
341
+ } = event;
342
+
343
+ // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
344
+ const isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
345
+ if (!this.activeEditor || this.activeEditor && !this.activeEditor.isWaiting()) {
346
+ if (!(0, _unicode.isFunctionKey)(keyCode) && !(0, _unicode.isCtrlMetaKey)(keyCode) && !isCtrlPressed && !this.isEditorOpened()) {
347
+ const shortcutManager = this.hot.getShortcutManager();
348
+ const editorContext = shortcutManager.getContext('editor');
349
+ const runOnlySelectedConfig = {
350
+ runOnlyIf: () => (0, _mixed.isDefined)(this.hot.getSelected()),
351
+ group: SHORTCUTS_GROUP_NAVIGATION
352
+ };
353
+ editorContext.addShortcuts([{
354
+ keys: [['ArrowUp']],
355
+ callback: () => {
356
+ this.hot.selection.transformStart(-1, 0);
357
+ }
358
+ }, {
359
+ keys: [['ArrowDown']],
360
+ callback: () => {
361
+ this.hot.selection.transformStart(1, 0);
362
+ }
363
+ }, {
364
+ keys: [['ArrowLeft']],
365
+ callback: () => {
366
+ this.hot.selection.transformStart(0, -1 * this.hot.getDirectionFactor());
367
+ }
368
+ }, {
369
+ keys: [['ArrowRight']],
370
+ callback: () => {
371
+ this.hot.selection.transformStart(0, this.hot.getDirectionFactor());
372
+ }
373
+ }], runOnlySelectedConfig);
374
+ this.openEditor('', event);
375
+ }
376
+ }
377
+ }
378
+ function _onCellDblClick2(event, coords, elem) {
379
+ // may be TD or TH
380
+ if (elem.nodeName === 'TD') {
381
+ this.openEditor(null, event, true);
382
+ }
383
+ }
374
384
  const instances = new WeakMap();
375
385
 
376
386
  /**
package/editorManager.mjs CHANGED
@@ -1,80 +1,107 @@
1
+ import "core-js/modules/es.error.cause.js";
2
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
3
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
6
+ 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); }
7
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
1
8
  import { isFunctionKey, isCtrlMetaKey } from "./helpers/unicode.mjs";
2
9
  import { isImmediatePropagationStopped } from "./helpers/dom/event.mjs";
3
10
  import { getEditorInstance } from "./editors/registry.mjs";
4
11
  import EventManager from "./eventManager.mjs";
5
12
  import { isDefined } from "./helpers/mixed.mjs";
6
13
  export const SHORTCUTS_GROUP_NAVIGATION = 'editorManager.navigation';
14
+ var _onAfterDocumentKeyDown = /*#__PURE__*/new WeakSet();
15
+ var _onCellDblClick = /*#__PURE__*/new WeakSet();
7
16
  class EditorManager {
8
17
  /**
9
- * @param {Core} instance The Handsontable instance.
18
+ * @param {Core} hotInstance The Handsontable instance.
10
19
  * @param {TableMeta} tableMeta The table meta instance.
11
20
  * @param {Selection} selection The selection instance.
12
21
  */
13
- constructor(instance, tableMeta, selection) {
22
+ constructor(hotInstance, tableMeta, _selection) {
23
+ /**
24
+ * OnCellDblClick callback.
25
+ *
26
+ * @param {MouseEvent} event The mouse event object.
27
+ * @param {object} coords The cell coordinates.
28
+ * @param {HTMLTableCellElement|HTMLTableHeaderCellElement} elem The element which triggers the action.
29
+ */
30
+ _classPrivateMethodInitSpec(this, _onCellDblClick);
31
+ /**
32
+ * OnAfterDocumentKeyDown callback.
33
+ *
34
+ * @param {KeyboardEvent} event The keyboard event object.
35
+ */
36
+ _classPrivateMethodInitSpec(this, _onAfterDocumentKeyDown);
14
37
  /**
15
38
  * Instance of {@link Handsontable}.
16
39
  *
17
40
  * @private
18
41
  * @type {Handsontable}
19
42
  */
20
- this.instance = instance;
43
+ _defineProperty(this, "hot", void 0);
21
44
  /**
22
45
  * Reference to an instance's private GridSettings object.
23
46
  *
24
47
  * @private
25
48
  * @type {GridSettings}
26
49
  */
27
- this.tableMeta = tableMeta;
50
+ _defineProperty(this, "tableMeta", void 0);
28
51
  /**
29
52
  * Instance of {@link Selection}.
30
53
  *
31
54
  * @private
32
55
  * @type {Selection}
33
56
  */
34
- this.selection = selection;
57
+ _defineProperty(this, "selection", void 0);
35
58
  /**
36
59
  * Instance of {@link EventManager}.
37
60
  *
38
61
  * @private
39
62
  * @type {EventManager}
40
63
  */
41
- this.eventManager = new EventManager(instance);
64
+ _defineProperty(this, "eventManager", void 0);
42
65
  /**
43
66
  * Determines if EditorManager is destroyed.
44
67
  *
45
68
  * @private
46
69
  * @type {boolean}
47
70
  */
48
- this.destroyed = false;
71
+ _defineProperty(this, "destroyed", false);
49
72
  /**
50
73
  * Determines if EditorManager is locked.
51
74
  *
52
75
  * @private
53
76
  * @type {boolean}
54
77
  */
55
- this.lock = false;
78
+ _defineProperty(this, "lock", false);
56
79
  /**
57
80
  * A reference to an instance of the activeEditor.
58
81
  *
59
82
  * @private
60
83
  * @type {BaseEditor}
61
84
  */
62
- this.activeEditor = void 0;
85
+ _defineProperty(this, "activeEditor", void 0);
63
86
  /**
64
87
  * Keeps a reference to the cell's properties object.
65
88
  *
66
89
  * @type {object}
67
90
  */
68
- this.cellProperties = void 0;
69
- this.instance.addHook('afterDocumentKeyDown', event => this.onAfterDocumentKeyDown(event));
91
+ _defineProperty(this, "cellProperties", void 0);
92
+ this.hot = hotInstance;
93
+ this.tableMeta = tableMeta;
94
+ this.selection = _selection;
95
+ this.eventManager = new EventManager(hotInstance);
96
+ this.hot.addHook('afterDocumentKeyDown', event => _classPrivateMethodGet(this, _onAfterDocumentKeyDown, _onAfterDocumentKeyDown2).call(this, event));
70
97
 
71
98
  // Open editor when text composition is started (IME editor)
72
- this.eventManager.addEventListener(this.instance.rootDocument.documentElement, 'compositionstart', event => {
73
- if (!this.destroyed && this.instance.isListening()) {
99
+ this.eventManager.addEventListener(this.hot.rootDocument.documentElement, 'compositionstart', event => {
100
+ if (!this.destroyed && this.hot.isListening()) {
74
101
  this.openEditor('', event);
75
102
  }
76
103
  });
77
- this.instance.view._wt.update('onCellDblClick', (event, coords, elem) => this.onCellDblClick(event, coords, elem));
104
+ this.hot.view._wt.update('onCellDblClick', (event, coords, elem) => _classPrivateMethodGet(this, _onCellDblClick, _onCellDblClick2).call(this, event, coords, elem));
78
105
  }
79
106
 
80
107
  /**
@@ -131,7 +158,7 @@ class EditorManager {
131
158
  }
132
159
  const {
133
160
  highlight
134
- } = this.instance.getSelectedRangeLast();
161
+ } = this.hot.getSelectedRangeLast();
135
162
  if (highlight.isHeader()) {
136
163
  return;
137
164
  }
@@ -139,7 +166,7 @@ class EditorManager {
139
166
  row,
140
167
  col
141
168
  } = highlight;
142
- const modifiedCellCoords = this.instance.runHooks('modifyGetCellCoords', row, col);
169
+ const modifiedCellCoords = this.hot.runHooks('modifyGetCellCoords', row, col);
143
170
  let visualRowToCheck = row;
144
171
  let visualColumnToCheck = col;
145
172
  if (Array.isArray(modifiedCellCoords)) {
@@ -147,20 +174,20 @@ class EditorManager {
147
174
  }
148
175
 
149
176
  // Getting values using the modified coordinates.
150
- this.cellProperties = this.instance.getCellMeta(visualRowToCheck, visualColumnToCheck);
177
+ this.cellProperties = this.hot.getCellMeta(visualRowToCheck, visualColumnToCheck);
151
178
  if (!this.isCellEditable()) {
152
179
  this.clearActiveEditor();
153
180
  return;
154
181
  }
155
- const td = this.instance.getCell(row, col, true);
182
+ const td = this.hot.getCell(row, col, true);
156
183
 
157
184
  // Skip the preparation when the cell is not rendered in the DOM. The cell is scrolled out of
158
185
  // the table's viewport.
159
186
  if (td) {
160
- const editorClass = this.instance.getCellEditor(this.cellProperties);
161
- const prop = this.instance.colToProp(visualColumnToCheck);
162
- const originalValue = this.instance.getSourceDataAtCell(this.instance.toPhysicalRow(visualRowToCheck), visualColumnToCheck);
163
- this.activeEditor = getEditorInstance(editorClass, this.instance);
187
+ const editorClass = this.hot.getCellEditor(this.cellProperties);
188
+ const prop = this.hot.colToProp(visualColumnToCheck);
189
+ const originalValue = this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(visualRowToCheck), visualColumnToCheck);
190
+ this.activeEditor = getEditorInstance(editorClass, this.hot);
164
191
  // Using not modified coordinates, as we need to get the table element using selection coordinates.
165
192
  // There is an extra translation in the editor for saving value.
166
193
  this.activeEditor.prepare(row, col, prop, td, originalValue, this.cellProperties);
@@ -191,7 +218,7 @@ class EditorManager {
191
218
  return;
192
219
  }
193
220
  if (!this.activeEditor) {
194
- this.instance.scrollToFocusedCell();
221
+ this.hot.scrollToFocusedCell();
195
222
  this.prepareEditor();
196
223
  }
197
224
  if (this.activeEditor) {
@@ -241,7 +268,7 @@ class EditorManager {
241
268
  * @private
242
269
  */
243
270
  clearActiveEditor() {
244
- this.activeEditor = void 0;
271
+ this.activeEditor = undefined;
245
272
  }
246
273
 
247
274
  /**
@@ -255,11 +282,11 @@ class EditorManager {
255
282
  * @returns {boolean}
256
283
  */
257
284
  isCellEditable() {
258
- const selection = this.instance.getSelectedRangeLast();
285
+ const selection = this.hot.getSelectedRangeLast();
259
286
  if (!selection) {
260
287
  return false;
261
288
  }
262
- const editorClass = this.instance.getCellEditor(this.cellProperties);
289
+ const editorClass = this.hot.getCellEditor(this.cellProperties);
263
290
  const {
264
291
  row,
265
292
  col
@@ -267,8 +294,8 @@ class EditorManager {
267
294
  const {
268
295
  rowIndexMapper,
269
296
  columnIndexMapper
270
- } = this.instance;
271
- const isCellHidden = rowIndexMapper.isHidden(this.instance.toPhysicalRow(row)) || columnIndexMapper.isHidden(this.instance.toPhysicalColumn(col));
297
+ } = this.hot;
298
+ const isCellHidden = rowIndexMapper.isHidden(this.hot.toPhysicalRow(row)) || columnIndexMapper.isHidden(this.hot.toPhysicalColumn(col));
272
299
  if (this.cellProperties.readOnly || !editorClass || isCellHidden) {
273
300
  return false;
274
301
  }
@@ -291,73 +318,6 @@ class EditorManager {
291
318
  this.selection.transformStart(enterMoves.row, enterMoves.col, true);
292
319
  }
293
320
  }
294
-
295
- /**
296
- * OnAfterDocumentKeyDown callback.
297
- *
298
- * @private
299
- * @param {KeyboardEvent} event The keyboard event object.
300
- */
301
- onAfterDocumentKeyDown(event) {
302
- const selection = this.instance.getSelectedRangeLast();
303
- if (!this.instance.isListening() || !selection || selection.highlight.isHeader() || isImmediatePropagationStopped(event)) {
304
- return;
305
- }
306
- const {
307
- keyCode
308
- } = event;
309
-
310
- // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
311
- const isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
312
- if (!this.activeEditor || this.activeEditor && !this.activeEditor.isWaiting()) {
313
- if (!isFunctionKey(keyCode) && !isCtrlMetaKey(keyCode) && !isCtrlPressed && !this.isEditorOpened()) {
314
- const shortcutManager = this.instance.getShortcutManager();
315
- const editorContext = shortcutManager.getContext('editor');
316
- const runOnlySelectedConfig = {
317
- runOnlyIf: () => isDefined(this.instance.getSelected()),
318
- group: SHORTCUTS_GROUP_NAVIGATION
319
- };
320
- editorContext.addShortcuts([{
321
- keys: [['ArrowUp']],
322
- callback: () => {
323
- this.instance.selection.transformStart(-1, 0);
324
- }
325
- }, {
326
- keys: [['ArrowDown']],
327
- callback: () => {
328
- this.instance.selection.transformStart(1, 0);
329
- }
330
- }, {
331
- keys: [['ArrowLeft']],
332
- callback: () => {
333
- this.instance.selection.transformStart(0, -1 * this.instance.getDirectionFactor());
334
- }
335
- }, {
336
- keys: [['ArrowRight']],
337
- callback: () => {
338
- this.instance.selection.transformStart(0, this.instance.getDirectionFactor());
339
- }
340
- }], runOnlySelectedConfig);
341
- this.openEditor('', event);
342
- }
343
- }
344
- }
345
-
346
- /**
347
- * OnCellDblClick callback.
348
- *
349
- * @private
350
- * @param {MouseEvent} event The mouse event object.
351
- * @param {object} coords The cell coordinates.
352
- * @param {HTMLTableCellElement|HTMLTableHeaderCellElement} elem The element which triggers the action.
353
- */
354
- onCellDblClick(event, coords, elem) {
355
- // may be TD or TH
356
- if (elem.nodeName === 'TD') {
357
- this.openEditor(null, event, true);
358
- }
359
- }
360
-
361
321
  /**
362
322
  * Destroy the instance.
363
323
  */
@@ -366,6 +326,56 @@ class EditorManager {
366
326
  this.eventManager.destroy();
367
327
  }
368
328
  }
329
+ function _onAfterDocumentKeyDown2(event) {
330
+ const selection = this.hot.getSelectedRangeLast();
331
+ if (!this.hot.isListening() || !selection || selection.highlight.isHeader() || isImmediatePropagationStopped(event)) {
332
+ return;
333
+ }
334
+ const {
335
+ keyCode
336
+ } = event;
337
+
338
+ // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
339
+ const isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
340
+ if (!this.activeEditor || this.activeEditor && !this.activeEditor.isWaiting()) {
341
+ if (!isFunctionKey(keyCode) && !isCtrlMetaKey(keyCode) && !isCtrlPressed && !this.isEditorOpened()) {
342
+ const shortcutManager = this.hot.getShortcutManager();
343
+ const editorContext = shortcutManager.getContext('editor');
344
+ const runOnlySelectedConfig = {
345
+ runOnlyIf: () => isDefined(this.hot.getSelected()),
346
+ group: SHORTCUTS_GROUP_NAVIGATION
347
+ };
348
+ editorContext.addShortcuts([{
349
+ keys: [['ArrowUp']],
350
+ callback: () => {
351
+ this.hot.selection.transformStart(-1, 0);
352
+ }
353
+ }, {
354
+ keys: [['ArrowDown']],
355
+ callback: () => {
356
+ this.hot.selection.transformStart(1, 0);
357
+ }
358
+ }, {
359
+ keys: [['ArrowLeft']],
360
+ callback: () => {
361
+ this.hot.selection.transformStart(0, -1 * this.hot.getDirectionFactor());
362
+ }
363
+ }, {
364
+ keys: [['ArrowRight']],
365
+ callback: () => {
366
+ this.hot.selection.transformStart(0, this.hot.getDirectionFactor());
367
+ }
368
+ }], runOnlySelectedConfig);
369
+ this.openEditor('', event);
370
+ }
371
+ }
372
+ }
373
+ function _onCellDblClick2(event, coords, elem) {
374
+ // may be TD or TH
375
+ if (elem.nodeName === 'TD') {
376
+ this.openEditor(null, event, true);
377
+ }
378
+ }
369
379
  const instances = new WeakMap();
370
380
 
371
381
  /**