handsontable 0.0.0-next-d1c8e0e-20230621 → 0.0.0-next-c765185-20230622

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 (280) 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 +355 -0
  28. package/3rdparty/walkontable/src/selection.mjs +349 -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/CHANGELOG.md +31 -0
  42. package/base.js +2 -2
  43. package/base.mjs +2 -2
  44. package/core.d.ts +3 -5
  45. package/core.js +309 -127
  46. package/core.mjs +309 -127
  47. package/dataMap/metaManager/metaSchema.js +0 -19
  48. package/dataMap/metaManager/metaSchema.mjs +0 -19
  49. package/dist/handsontable.css +3 -8
  50. package/dist/handsontable.full.css +3 -8
  51. package/dist/handsontable.full.js +10826 -13821
  52. package/dist/handsontable.full.min.css +3 -3
  53. package/dist/handsontable.full.min.js +115 -115
  54. package/dist/handsontable.js +13565 -16560
  55. package/dist/handsontable.min.css +3 -3
  56. package/dist/handsontable.min.js +4 -4
  57. package/editorManager.js +94 -21
  58. package/editorManager.mjs +98 -26
  59. package/editors/textEditor/textEditor.js +11 -3
  60. package/editors/textEditor/textEditor.mjs +12 -4
  61. package/helpers/mixed.js +2 -2
  62. package/helpers/mixed.mjs +2 -2
  63. package/helpers/number.d.ts +0 -1
  64. package/helpers/number.js +0 -18
  65. package/helpers/number.mjs +0 -17
  66. package/package.json +1 -1
  67. package/pluginHooks.d.ts +1 -5
  68. package/pluginHooks.js +1 -89
  69. package/pluginHooks.mjs +1 -89
  70. package/plugins/collapsibleColumns/collapsibleColumns.js +24 -81
  71. package/plugins/collapsibleColumns/collapsibleColumns.mjs +24 -81
  72. package/plugins/columnSorting/columnSorting.js +8 -50
  73. package/plugins/columnSorting/columnSorting.mjs +9 -49
  74. package/plugins/columnSorting/index.js +2 -4
  75. package/plugins/columnSorting/index.mjs +1 -1
  76. package/plugins/comments/comments.js +4 -11
  77. package/plugins/comments/comments.mjs +4 -11
  78. package/plugins/contextMenu/contextMenu.d.ts +1 -1
  79. package/plugins/contextMenu/contextMenu.js +29 -80
  80. package/plugins/contextMenu/contextMenu.mjs +30 -81
  81. package/plugins/contextMenu/predefinedItems/alignment.js +0 -7
  82. package/plugins/contextMenu/predefinedItems/alignment.mjs +0 -7
  83. package/plugins/contextMenu/predefinedItems/clearColumn.js +3 -5
  84. package/plugins/contextMenu/predefinedItems/clearColumn.mjs +3 -5
  85. package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -5
  86. package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -5
  87. package/plugins/contextMenu/predefinedItems/columnRight.js +3 -5
  88. package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -5
  89. package/plugins/contextMenu/predefinedItems/readOnly.js +0 -7
  90. package/plugins/contextMenu/predefinedItems/readOnly.mjs +0 -7
  91. package/plugins/contextMenu/predefinedItems/removeColumn.js +5 -7
  92. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +3 -5
  93. package/plugins/contextMenu/predefinedItems/removeRow.js +5 -7
  94. package/plugins/contextMenu/predefinedItems/removeRow.mjs +3 -5
  95. package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -5
  96. package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -5
  97. package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -5
  98. package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -5
  99. package/plugins/contextMenu/utils.js +16 -25
  100. package/plugins/contextMenu/utils.mjs +15 -24
  101. package/plugins/copyPaste/contextMenuItem/copy.js +0 -7
  102. package/plugins/copyPaste/contextMenuItem/copy.mjs +0 -7
  103. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +1 -9
  104. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +1 -9
  105. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +1 -9
  106. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +1 -9
  107. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +1 -9
  108. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +1 -9
  109. package/plugins/copyPaste/contextMenuItem/cut.js +0 -7
  110. package/plugins/copyPaste/contextMenuItem/cut.mjs +0 -7
  111. package/plugins/copyPaste/copyPaste.js +1 -5
  112. package/plugins/copyPaste/copyPaste.mjs +1 -5
  113. package/plugins/customBorders/customBorders.js +53 -25
  114. package/plugins/customBorders/customBorders.mjs +54 -26
  115. package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
  116. package/plugins/dropdownMenu/dropdownMenu.js +30 -94
  117. package/plugins/dropdownMenu/dropdownMenu.mjs +30 -94
  118. package/plugins/filters/filters.js +42 -62
  119. package/plugins/filters/filters.mjs +41 -61
  120. package/plugins/mergeCells/mergeCells.js +18 -5
  121. package/plugins/mergeCells/mergeCells.mjs +18 -5
  122. package/plugins/multiColumnSorting/multiColumnSorting.js +3 -42
  123. package/plugins/multiColumnSorting/multiColumnSorting.mjs +3 -42
  124. package/plugins/nestedHeaders/nestedHeaders.js +10 -132
  125. package/plugins/nestedHeaders/nestedHeaders.mjs +10 -132
  126. package/plugins/nestedHeaders/stateManager/index.js +0 -37
  127. package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
  128. package/plugins/nestedRows/nestedRows.js +7 -52
  129. package/plugins/nestedRows/nestedRows.mjs +7 -52
  130. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  131. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  132. package/selection/highlight/constants.js +16 -0
  133. package/selection/highlight/constants.mjs +6 -0
  134. package/selection/highlight/highlight.js +89 -312
  135. package/selection/highlight/highlight.mjs +85 -302
  136. package/selection/highlight/types/activeHeader.js +9 -10
  137. package/selection/highlight/types/activeHeader.mjs +8 -10
  138. package/selection/highlight/types/area.js +27 -12
  139. package/selection/highlight/types/area.mjs +30 -16
  140. package/selection/highlight/types/{focus.js → cell.js} +8 -5
  141. package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
  142. package/selection/highlight/types/customSelection.js +10 -7
  143. package/selection/highlight/types/customSelection.mjs +9 -7
  144. package/selection/highlight/types/fill.js +8 -5
  145. package/selection/highlight/types/fill.mjs +7 -5
  146. package/selection/highlight/types/header.js +20 -10
  147. package/selection/highlight/types/header.mjs +19 -10
  148. package/selection/highlight/types/{row.js → index.js} +31 -27
  149. package/selection/highlight/types/{row.mjs → index.mjs} +29 -24
  150. package/selection/highlight/visualSelection.js +27 -31
  151. package/selection/highlight/visualSelection.mjs +27 -31
  152. package/selection/index.js +7 -4
  153. package/selection/index.mjs +3 -2
  154. package/selection/mouseEventHandler.js +1 -1
  155. package/selection/mouseEventHandler.mjs +1 -1
  156. package/selection/range.js +8 -8
  157. package/selection/range.mjs +8 -8
  158. package/selection/selection.js +181 -315
  159. package/selection/selection.mjs +180 -310
  160. package/selection/transformation.js +96 -233
  161. package/selection/transformation.mjs +93 -230
  162. package/selection/utils.js +36 -12
  163. package/selection/utils.mjs +36 -13
  164. package/settings.d.ts +0 -1
  165. package/shortcuts/manager.js +0 -2
  166. package/shortcuts/manager.mjs +0 -2
  167. package/shortcuts/recorder.js +2 -2
  168. package/shortcuts/recorder.mjs +2 -2
  169. package/shortcuts/utils.js +5 -21
  170. package/shortcuts/utils.mjs +4 -20
  171. package/tableView.js +9 -58
  172. package/tableView.mjs +9 -58
  173. package/translations/indexMapper.js +9 -8
  174. package/translations/indexMapper.mjs +9 -8
  175. package/3rdparty/walkontable/src/selection/border/constants.js +0 -18
  176. package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -13
  177. package/3rdparty/walkontable/src/selection/constants.js +0 -63
  178. package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
  179. package/3rdparty/walkontable/src/selection/index.js +0 -30
  180. package/3rdparty/walkontable/src/selection/index.mjs +0 -5
  181. package/3rdparty/walkontable/src/selection/manager.js +0 -329
  182. package/3rdparty/walkontable/src/selection/manager.mjs +0 -323
  183. package/3rdparty/walkontable/src/selection/scanner.js +0 -364
  184. package/3rdparty/walkontable/src/selection/scanner.mjs +0 -360
  185. package/3rdparty/walkontable/src/selection/selection.js +0 -133
  186. package/3rdparty/walkontable/src/selection/selection.mjs +0 -127
  187. package/selection/highlight/types/areaLayered.js +0 -54
  188. package/selection/highlight/types/areaLayered.mjs +0 -49
  189. package/selection/highlight/types/column.js +0 -50
  190. package/selection/highlight/types/column.mjs +0 -45
  191. package/shortcutContexts/commands/editor/closeAndSave.js +0 -15
  192. package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -10
  193. package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -13
  194. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
  195. package/shortcutContexts/commands/editor/fastOpen.js +0 -16
  196. package/shortcutContexts/commands/editor/fastOpen.mjs +0 -11
  197. package/shortcutContexts/commands/editor/index.js +0 -16
  198. package/shortcutContexts/commands/editor/index.mjs +0 -12
  199. package/shortcutContexts/commands/editor/open.js +0 -29
  200. package/shortcutContexts/commands/editor/open.mjs +0 -24
  201. package/shortcutContexts/commands/emptySelectedCells.js +0 -12
  202. package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
  203. package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
  204. package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -10
  205. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -21
  206. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -16
  207. package/shortcutContexts/commands/extendCellsSelection/index.js +0 -26
  208. package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -22
  209. package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
  210. package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -10
  211. package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
  212. package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -10
  213. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +0 -19
  214. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +0 -14
  215. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -22
  216. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -17
  217. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -17
  218. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -12
  219. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -17
  220. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -12
  221. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -40
  222. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -35
  223. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -40
  224. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -35
  225. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -22
  226. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -17
  227. package/shortcutContexts/commands/extendCellsSelection/toRows.js +0 -19
  228. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +0 -14
  229. package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
  230. package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -10
  231. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -21
  232. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -16
  233. package/shortcutContexts/commands/index.js +0 -52
  234. package/shortcutContexts/commands/index.mjs +0 -48
  235. package/shortcutContexts/commands/moveCellSelection/down.js +0 -12
  236. package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -7
  237. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -29
  238. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -24
  239. package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
  240. package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
  241. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -13
  242. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
  243. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -13
  244. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
  245. package/shortcutContexts/commands/moveCellSelection/left.js +0 -11
  246. package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
  247. package/shortcutContexts/commands/moveCellSelection/right.js +0 -11
  248. package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
  249. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -16
  250. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -11
  251. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -17
  252. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -12
  253. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -13
  254. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -8
  255. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -16
  256. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -11
  257. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -36
  258. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -31
  259. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -36
  260. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -31
  261. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -16
  262. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -11
  263. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -18
  264. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -13
  265. package/shortcutContexts/commands/moveCellSelection/up.js +0 -12
  266. package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -7
  267. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -29
  268. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -24
  269. package/shortcutContexts/commands/populateSelectedCellsData.js +0 -35
  270. package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -30
  271. package/shortcutContexts/commands/selectAll.js +0 -11
  272. package/shortcutContexts/commands/selectAll.mjs +0 -6
  273. package/shortcutContexts/constants.js +0 -19
  274. package/shortcutContexts/constants.mjs +0 -12
  275. package/shortcutContexts/editor.js +0 -29
  276. package/shortcutContexts/editor.mjs +0 -25
  277. package/shortcutContexts/grid.js +0 -247
  278. package/shortcutContexts/grid.mjs +0 -243
  279. package/shortcutContexts/index.js +0 -29
  280. package/shortcutContexts/index.mjs +0 -15
@@ -19,7 +19,7 @@ require("core-js/modules/es.regexp.to-string.js");
19
19
  require("core-js/modules/es.function.name.js");
20
20
  require("core-js/modules/es.regexp.exec.js");
21
21
  exports.__esModule = true;
22
- exports.REPLACE_COLUMN_CONFIG_STRATEGY = exports.PLUGIN_PRIORITY = exports.PLUGIN_KEY = exports.ColumnSorting = exports.APPEND_COLUMN_CONFIG_STRATEGY = void 0;
22
+ exports.PLUGIN_PRIORITY = exports.PLUGIN_KEY = exports.ColumnSorting = void 0;
23
23
  require("core-js/modules/es.array.sort.js");
24
24
  require("core-js/modules/es.array.slice.js");
25
25
  require("core-js/modules/es.object.to-string.js");
@@ -79,10 +79,7 @@ exports.PLUGIN_KEY = PLUGIN_KEY;
79
79
  var PLUGIN_PRIORITY = 50;
80
80
  exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
81
81
  var APPEND_COLUMN_CONFIG_STRATEGY = 'append';
82
- exports.APPEND_COLUMN_CONFIG_STRATEGY = APPEND_COLUMN_CONFIG_STRATEGY;
83
82
  var REPLACE_COLUMN_CONFIG_STRATEGY = 'replace';
84
- exports.REPLACE_COLUMN_CONFIG_STRATEGY = REPLACE_COLUMN_CONFIG_STRATEGY;
85
- var SHORTCUTS_GROUP = PLUGIN_KEY;
86
83
  (0, _sortService.registerRootComparator)(PLUGIN_KEY, _rootComparator.rootComparator);
87
84
  _pluginHooks.default.getSingleton().register('beforeColumnSort');
88
85
  _pluginHooks.default.getSingleton().register('afterColumnSort');
@@ -226,7 +223,6 @@ var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
226
223
  if (this.hot.view) {
227
224
  this.loadOrSortBySettings();
228
225
  }
229
- this.registerShortcuts();
230
226
  _get(_getPrototypeOf(ColumnSorting.prototype), "enablePlugin", this).call(this);
231
227
  }
232
228
 
@@ -260,47 +256,9 @@ var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
260
256
  this.columnStatesManager.destroy();
261
257
  this.columnMetaCache = null;
262
258
  this.columnStatesManager = null;
263
- this.unregisterShortcuts();
264
259
  _get(_getPrototypeOf(ColumnSorting.prototype), "disablePlugin", this).call(this);
265
260
  }
266
261
 
267
- /**
268
- * Register shortcuts responsible for toggling column sorting functionality.
269
- *
270
- * @private
271
- */
272
- }, {
273
- key: "registerShortcuts",
274
- value: function registerShortcuts() {
275
- var _this4 = this;
276
- this.hot.getShortcutManager().getContext('grid').addShortcut({
277
- keys: [['Enter']],
278
- callback: function callback() {
279
- var _this4$hot$getSelecte = _this4.hot.getSelectedRangeLast(),
280
- highlight = _this4$hot$getSelecte.highlight;
281
- if (highlight.row === -1 && highlight.col >= 0) {
282
- _this4.sort(_this4.getColumnNextConfig(highlight.col));
283
- }
284
- },
285
- runOnlyIf: function runOnlyIf() {
286
- var _this4$hot$getSelecte2;
287
- return (_this4$hot$getSelecte2 = _this4.hot.getSelectedRangeLast()) === null || _this4$hot$getSelecte2 === void 0 ? void 0 : _this4$hot$getSelecte2.highlight.isHeader();
288
- },
289
- group: SHORTCUTS_GROUP
290
- });
291
- }
292
-
293
- /**
294
- * Unregister shortcuts responsible for toggling column sorting functionality.
295
- *
296
- * @private
297
- */
298
- }, {
299
- key: "unregisterShortcuts",
300
- value: function unregisterShortcuts() {
301
- this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
302
- }
303
-
304
262
  // DIFF - MultiColumnSorting & ColumnSorting: changed function documentation.
305
263
  /**
306
264
  * Sorts the table by chosen columns and orders.
@@ -470,13 +428,13 @@ var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
470
428
  }, {
471
429
  key: "saveAllSortSettings",
472
430
  value: function saveAllSortSettings(sortConfigs) {
473
- var _this5 = this;
431
+ var _this4 = this;
474
432
  var allSortSettings = this.columnStatesManager.getAllColumnsProperties();
475
433
  var translateColumnToPhysical = function translateColumnToPhysical(_ref2) {
476
434
  var visualColumn = _ref2.column,
477
435
  restOfProperties = _objectWithoutProperties(_ref2, _excluded);
478
436
  return _objectSpread({
479
- column: _this5.hot.toPhysicalColumn(visualColumn)
437
+ column: _this4.hot.toPhysicalColumn(visualColumn)
480
438
  }, restOfProperties);
481
439
  };
482
440
  allSortSettings.initialConfig = (0, _array.arrayMap)(sortConfigs, translateColumnToPhysical);
@@ -494,7 +452,7 @@ var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
494
452
  }, {
495
453
  key: "getAllSavedSortSettings",
496
454
  value: function getAllSavedSortSettings() {
497
- var _this6 = this;
455
+ var _this5 = this;
498
456
  var storedAllSortSettings = {};
499
457
  this.hot.runHooks('persistentStateLoad', 'columnSorting', storedAllSortSettings);
500
458
  var allSortSettings = storedAllSortSettings.value;
@@ -502,7 +460,7 @@ var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
502
460
  var physicalColumn = _ref3.column,
503
461
  restOfProperties = _objectWithoutProperties(_ref3, _excluded2);
504
462
  return _objectSpread({
505
- column: _this6.hot.toVisualColumn(physicalColumn)
463
+ column: _this5.hot.toVisualColumn(physicalColumn)
506
464
  }, restOfProperties);
507
465
  };
508
466
  if ((0, _mixed.isDefined)(allSortSettings) && Array.isArray(allSortSettings.initialConfig)) {
@@ -667,7 +625,7 @@ var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
667
625
  }, {
668
626
  key: "sortByPresetSortStates",
669
627
  value: function sortByPresetSortStates(sortConfigs) {
670
- var _this7 = this;
628
+ var _this6 = this;
671
629
  if (sortConfigs.length === 0) {
672
630
  this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues());
673
631
  return;
@@ -676,7 +634,7 @@ var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
676
634
  var numberOfRows = this.hot.countRows();
677
635
  var getDataForSortedColumns = function getDataForSortedColumns(visualRowIndex) {
678
636
  return (0, _array.arrayMap)(sortConfigs, function (sortConfig) {
679
- return _this7.hot.getDataAtCell(visualRowIndex, sortConfig.column);
637
+ return _this6.hot.getDataAtCell(visualRowIndex, sortConfig.column);
680
638
  });
681
639
  };
682
640
  for (var visualRowIndex = 0; visualRowIndex < this.getNumberOfRowsToSort(numberOfRows); visualRowIndex += 1) {
@@ -688,7 +646,7 @@ var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
688
646
  (0, _sortService.sort)(indexesWithData, this.pluginKey, (0, _array.arrayMap)(sortConfigs, function (sortConfig) {
689
647
  return sortConfig.sortOrder;
690
648
  }), (0, _array.arrayMap)(sortConfigs, function (sortConfig) {
691
- return _this7.getFirstCellSettings(sortConfig.column);
649
+ return _this6.getFirstCellSettings(sortConfig.column);
692
650
  }));
693
651
 
694
652
  // Append spareRows
@@ -71,9 +71,8 @@ import { rootComparator } from "./rootComparator.mjs";
71
71
  import { registerRootComparator, sort } from "./sortService/index.mjs";
72
72
  export var PLUGIN_KEY = 'columnSorting';
73
73
  export var PLUGIN_PRIORITY = 50;
74
- export var APPEND_COLUMN_CONFIG_STRATEGY = 'append';
75
- export var REPLACE_COLUMN_CONFIG_STRATEGY = 'replace';
76
- var SHORTCUTS_GROUP = PLUGIN_KEY;
74
+ var APPEND_COLUMN_CONFIG_STRATEGY = 'append';
75
+ var REPLACE_COLUMN_CONFIG_STRATEGY = 'replace';
77
76
  registerRootComparator(PLUGIN_KEY, rootComparator);
78
77
  Hooks.getSingleton().register('beforeColumnSort');
79
78
  Hooks.getSingleton().register('afterColumnSort');
@@ -217,7 +216,6 @@ export var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
217
216
  if (this.hot.view) {
218
217
  this.loadOrSortBySettings();
219
218
  }
220
- this.registerShortcuts();
221
219
  _get(_getPrototypeOf(ColumnSorting.prototype), "enablePlugin", this).call(this);
222
220
  }
223
221
 
@@ -251,47 +249,9 @@ export var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
251
249
  this.columnStatesManager.destroy();
252
250
  this.columnMetaCache = null;
253
251
  this.columnStatesManager = null;
254
- this.unregisterShortcuts();
255
252
  _get(_getPrototypeOf(ColumnSorting.prototype), "disablePlugin", this).call(this);
256
253
  }
257
254
 
258
- /**
259
- * Register shortcuts responsible for toggling column sorting functionality.
260
- *
261
- * @private
262
- */
263
- }, {
264
- key: "registerShortcuts",
265
- value: function registerShortcuts() {
266
- var _this4 = this;
267
- this.hot.getShortcutManager().getContext('grid').addShortcut({
268
- keys: [['Enter']],
269
- callback: function callback() {
270
- var _this4$hot$getSelecte = _this4.hot.getSelectedRangeLast(),
271
- highlight = _this4$hot$getSelecte.highlight;
272
- if (highlight.row === -1 && highlight.col >= 0) {
273
- _this4.sort(_this4.getColumnNextConfig(highlight.col));
274
- }
275
- },
276
- runOnlyIf: function runOnlyIf() {
277
- var _this4$hot$getSelecte2;
278
- return (_this4$hot$getSelecte2 = _this4.hot.getSelectedRangeLast()) === null || _this4$hot$getSelecte2 === void 0 ? void 0 : _this4$hot$getSelecte2.highlight.isHeader();
279
- },
280
- group: SHORTCUTS_GROUP
281
- });
282
- }
283
-
284
- /**
285
- * Unregister shortcuts responsible for toggling column sorting functionality.
286
- *
287
- * @private
288
- */
289
- }, {
290
- key: "unregisterShortcuts",
291
- value: function unregisterShortcuts() {
292
- this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
293
- }
294
-
295
255
  // DIFF - MultiColumnSorting & ColumnSorting: changed function documentation.
296
256
  /**
297
257
  * Sorts the table by chosen columns and orders.
@@ -461,13 +421,13 @@ export var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
461
421
  }, {
462
422
  key: "saveAllSortSettings",
463
423
  value: function saveAllSortSettings(sortConfigs) {
464
- var _this5 = this;
424
+ var _this4 = this;
465
425
  var allSortSettings = this.columnStatesManager.getAllColumnsProperties();
466
426
  var translateColumnToPhysical = function translateColumnToPhysical(_ref2) {
467
427
  var visualColumn = _ref2.column,
468
428
  restOfProperties = _objectWithoutProperties(_ref2, _excluded);
469
429
  return _objectSpread({
470
- column: _this5.hot.toPhysicalColumn(visualColumn)
430
+ column: _this4.hot.toPhysicalColumn(visualColumn)
471
431
  }, restOfProperties);
472
432
  };
473
433
  allSortSettings.initialConfig = arrayMap(sortConfigs, translateColumnToPhysical);
@@ -485,7 +445,7 @@ export var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
485
445
  }, {
486
446
  key: "getAllSavedSortSettings",
487
447
  value: function getAllSavedSortSettings() {
488
- var _this6 = this;
448
+ var _this5 = this;
489
449
  var storedAllSortSettings = {};
490
450
  this.hot.runHooks('persistentStateLoad', 'columnSorting', storedAllSortSettings);
491
451
  var allSortSettings = storedAllSortSettings.value;
@@ -493,7 +453,7 @@ export var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
493
453
  var physicalColumn = _ref3.column,
494
454
  restOfProperties = _objectWithoutProperties(_ref3, _excluded2);
495
455
  return _objectSpread({
496
- column: _this6.hot.toVisualColumn(physicalColumn)
456
+ column: _this5.hot.toVisualColumn(physicalColumn)
497
457
  }, restOfProperties);
498
458
  };
499
459
  if (isDefined(allSortSettings) && Array.isArray(allSortSettings.initialConfig)) {
@@ -658,7 +618,7 @@ export var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
658
618
  }, {
659
619
  key: "sortByPresetSortStates",
660
620
  value: function sortByPresetSortStates(sortConfigs) {
661
- var _this7 = this;
621
+ var _this6 = this;
662
622
  if (sortConfigs.length === 0) {
663
623
  this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues());
664
624
  return;
@@ -667,7 +627,7 @@ export var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
667
627
  var numberOfRows = this.hot.countRows();
668
628
  var getDataForSortedColumns = function getDataForSortedColumns(visualRowIndex) {
669
629
  return arrayMap(sortConfigs, function (sortConfig) {
670
- return _this7.hot.getDataAtCell(visualRowIndex, sortConfig.column);
630
+ return _this6.hot.getDataAtCell(visualRowIndex, sortConfig.column);
671
631
  });
672
632
  };
673
633
  for (var visualRowIndex = 0; visualRowIndex < this.getNumberOfRowsToSort(numberOfRows); visualRowIndex += 1) {
@@ -679,7 +639,7 @@ export var ColumnSorting = /*#__PURE__*/function (_BasePlugin) {
679
639
  sort(indexesWithData, this.pluginKey, arrayMap(sortConfigs, function (sortConfig) {
680
640
  return sortConfig.sortOrder;
681
641
  }), arrayMap(sortConfigs, function (sortConfig) {
682
- return _this7.getFirstCellSettings(sortConfig.column);
642
+ return _this6.getFirstCellSettings(sortConfig.column);
683
643
  }));
684
644
 
685
645
  // Append spareRows
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.REPLACE_COLUMN_CONFIG_STRATEGY = exports.PLUGIN_PRIORITY = exports.PLUGIN_KEY = exports.ColumnSorting = exports.APPEND_COLUMN_CONFIG_STRATEGY = void 0;
4
+ exports.PLUGIN_PRIORITY = exports.PLUGIN_KEY = exports.ColumnSorting = void 0;
5
5
  var _columnSorting = require("./columnSorting");
6
6
  exports.PLUGIN_KEY = _columnSorting.PLUGIN_KEY;
7
7
  exports.PLUGIN_PRIORITY = _columnSorting.PLUGIN_PRIORITY;
8
- exports.ColumnSorting = _columnSorting.ColumnSorting;
9
- exports.APPEND_COLUMN_CONFIG_STRATEGY = _columnSorting.APPEND_COLUMN_CONFIG_STRATEGY;
10
- exports.REPLACE_COLUMN_CONFIG_STRATEGY = _columnSorting.REPLACE_COLUMN_CONFIG_STRATEGY;
8
+ exports.ColumnSorting = _columnSorting.ColumnSorting;
@@ -1 +1 @@
1
- export { PLUGIN_KEY, PLUGIN_PRIORITY, ColumnSorting, APPEND_COLUMN_CONFIG_STRATEGY, REPLACE_COLUMN_CONFIG_STRATEGY } from "./columnSorting.mjs";
1
+ export { PLUGIN_KEY, PLUGIN_PRIORITY, ColumnSorting } from "./columnSorting.mjs";
@@ -835,14 +835,7 @@ var Comments = /*#__PURE__*/function (_BasePlugin) {
835
835
  key: "addToContextMenu",
836
836
  value: function addToContextMenu(defaultOptions) {
837
837
  var _this6 = this;
838
- var isThereAnySelectedCellToProcess = function isThereAnySelectedCellToProcess() {
839
- var range = _this6.hot.getSelectedRangeLast();
840
- if (!range) {
841
- return false;
842
- }
843
- if (range.isSingleHeader() || range.highlight.isHeader()) {
844
- return false;
845
- }
838
+ var isThereAnyCellRendered = function isThereAnyCellRendered() {
846
839
  return _this6.hot.rowIndexMapper.getRenderableIndexesLength() > 0 && _this6.hot.columnIndexMapper.getRenderableIndexesLength() > 0;
847
840
  };
848
841
  defaultOptions.items.push({
@@ -859,7 +852,7 @@ var Comments = /*#__PURE__*/function (_BasePlugin) {
859
852
  return _this6.onContextMenuAddComment();
860
853
  },
861
854
  disabled: function disabled() {
862
- if (!isThereAnySelectedCellToProcess()) {
855
+ if (!isThereAnyCellRendered()) {
863
856
  return true;
864
857
  }
865
858
  return !(_this6.hot.getSelectedLast() && !_this6.hot.selection.isSelectedByCorner());
@@ -873,7 +866,7 @@ var Comments = /*#__PURE__*/function (_BasePlugin) {
873
866
  return _this6.onContextMenuRemoveComment();
874
867
  },
875
868
  disabled: function disabled() {
876
- if (!isThereAnySelectedCellToProcess()) {
869
+ if (!isThereAnyCellRendered()) {
877
870
  return true;
878
871
  }
879
872
  return !(_this6.hot.getSelectedLast() && !_this6.hot.selection.isSelectedByCorner());
@@ -901,7 +894,7 @@ var Comments = /*#__PURE__*/function (_BasePlugin) {
901
894
  return _this6.onContextMenuMakeReadOnly();
902
895
  },
903
896
  disabled: function disabled() {
904
- if (!isThereAnySelectedCellToProcess()) {
897
+ if (!isThereAnyCellRendered()) {
905
898
  return true;
906
899
  }
907
900
  return !(_this6.hot.getSelectedLast() && !_this6.hot.selection.isSelectedByCorner()) || !_this6.checkSelectionCommentsConsistency();
@@ -826,14 +826,7 @@ export var Comments = /*#__PURE__*/function (_BasePlugin) {
826
826
  key: "addToContextMenu",
827
827
  value: function addToContextMenu(defaultOptions) {
828
828
  var _this6 = this;
829
- var isThereAnySelectedCellToProcess = function isThereAnySelectedCellToProcess() {
830
- var range = _this6.hot.getSelectedRangeLast();
831
- if (!range) {
832
- return false;
833
- }
834
- if (range.isSingleHeader() || range.highlight.isHeader()) {
835
- return false;
836
- }
829
+ var isThereAnyCellRendered = function isThereAnyCellRendered() {
837
830
  return _this6.hot.rowIndexMapper.getRenderableIndexesLength() > 0 && _this6.hot.columnIndexMapper.getRenderableIndexesLength() > 0;
838
831
  };
839
832
  defaultOptions.items.push({
@@ -850,7 +843,7 @@ export var Comments = /*#__PURE__*/function (_BasePlugin) {
850
843
  return _this6.onContextMenuAddComment();
851
844
  },
852
845
  disabled: function disabled() {
853
- if (!isThereAnySelectedCellToProcess()) {
846
+ if (!isThereAnyCellRendered()) {
854
847
  return true;
855
848
  }
856
849
  return !(_this6.hot.getSelectedLast() && !_this6.hot.selection.isSelectedByCorner());
@@ -864,7 +857,7 @@ export var Comments = /*#__PURE__*/function (_BasePlugin) {
864
857
  return _this6.onContextMenuRemoveComment();
865
858
  },
866
859
  disabled: function disabled() {
867
- if (!isThereAnySelectedCellToProcess()) {
860
+ if (!isThereAnyCellRendered()) {
868
861
  return true;
869
862
  }
870
863
  return !(_this6.hot.getSelectedLast() && !_this6.hot.selection.isSelectedByCorner());
@@ -892,7 +885,7 @@ export var Comments = /*#__PURE__*/function (_BasePlugin) {
892
885
  return _this6.onContextMenuMakeReadOnly();
893
886
  },
894
887
  disabled: function disabled() {
895
- if (!isThereAnySelectedCellToProcess()) {
888
+ if (!isThereAnyCellRendered()) {
896
889
  return true;
897
890
  }
898
891
  return !(_this6.hot.getSelectedLast() && !_this6.hot.selection.isSelectedByCorner()) || !_this6.checkSelectionCommentsConsistency();
@@ -60,7 +60,7 @@ export class ContextMenu extends BasePlugin {
60
60
 
61
61
  constructor(hotInstance: Core);
62
62
  isEnabled(): boolean;
63
- open(position: { left: number, top: number } | Event, offset?: { above?: number, below?: number, left?: number, right?: number }): void;
63
+ open(event: Event): void;
64
64
  close(): void;
65
65
  executeCommand(commandName: string, ...params: any): void;
66
66
  }
@@ -22,12 +22,10 @@ require("core-js/modules/es.object.get-prototype-of.js");
22
22
  var _base = require("../base");
23
23
  var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
24
24
  var _array = require("../../helpers/array");
25
- var _object = require("../../helpers/object");
26
25
  var _commandExecutor = _interopRequireDefault(require("./commandExecutor"));
27
26
  var _eventManager = _interopRequireDefault(require("../../eventManager"));
28
27
  var _itemsFactory = _interopRequireDefault(require("./itemsFactory"));
29
28
  var _menu = _interopRequireDefault(require("./menu"));
30
- var _utils = require("./utils");
31
29
  var _element = require("../../helpers/dom/element");
32
30
  var _predefinedItems = require("./predefinedItems");
33
31
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -49,7 +47,6 @@ var PLUGIN_KEY = 'contextMenu';
49
47
  exports.PLUGIN_KEY = PLUGIN_KEY;
50
48
  var PLUGIN_PRIORITY = 70;
51
49
  exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
52
- var SHORTCUTS_GROUP = PLUGIN_KEY;
53
50
  _pluginHooks.default.getSingleton().register('afterContextMenuDefaultOptions');
54
51
  _pluginHooks.default.getSingleton().register('beforeContextMenuShow');
55
52
  _pluginHooks.default.getSingleton().register('afterContextMenuShow');
@@ -171,7 +168,6 @@ var ContextMenu = /*#__PURE__*/function (_BasePlugin) {
171
168
  this.addHook('afterOnCellContextMenu', function (event) {
172
169
  return _this2.onAfterOnCellContextMenu(event);
173
170
  });
174
- this.registerShortcuts();
175
171
  _get(_getPrototypeOf(ContextMenu.prototype), "enablePlugin", this).call(this);
176
172
  }
177
173
 
@@ -186,7 +182,6 @@ var ContextMenu = /*#__PURE__*/function (_BasePlugin) {
186
182
  value: function updatePlugin() {
187
183
  this.disablePlugin();
188
184
  this.enablePlugin();
189
- this.unregisterShortcuts();
190
185
  _get(_getPrototypeOf(ContextMenu.prototype), "updatePlugin", this).call(this);
191
186
  }
192
187
 
@@ -204,83 +199,39 @@ var ContextMenu = /*#__PURE__*/function (_BasePlugin) {
204
199
  _get(_getPrototypeOf(ContextMenu.prototype), "disablePlugin", this).call(this);
205
200
  }
206
201
 
207
- /**
208
- * Register shortcuts responsible for toggling context menu.
209
- *
210
- * @private
211
- */
212
- }, {
213
- key: "registerShortcuts",
214
- value: function registerShortcuts() {
215
- var _this3 = this;
216
- this.hot.getShortcutManager().getContext('grid').addShortcut({
217
- keys: [['Control/Meta', 'Shift', '\\'], ['Shift', 'F10']],
218
- callback: function callback() {
219
- var _this3$hot$getSelecte = _this3.hot.getSelectedRangeLast(),
220
- highlight = _this3$hot$getSelecte.highlight;
221
- var rect = _this3.hot.getCell(highlight.row, highlight.col, true).getBoundingClientRect();
222
- var offset = (0, _utils.getDocumentOffsetByElement)(_this3.menu.container, _this3.hot.rootDocument);
223
- _this3.open({
224
- left: rect.left + offset.left,
225
- top: rect.top + offset.top - 1 + rect.height
226
- }, {
227
- left: rect.width,
228
- above: -rect.height
229
- });
230
- _this3.hot._registerTimeout(function () {
231
- _this3.menu.selectFirstCell();
232
- });
233
- },
234
- runOnlyIf: function runOnlyIf() {
235
- return _this3.hot.getSelectedRangeLast() && !_this3.menu.isOpened();
236
- },
237
- group: SHORTCUTS_GROUP
238
- });
239
- }
240
-
241
- /**
242
- * Unregister shortcuts responsible for toggling context menu.
243
- *
244
- * @private
245
- */
246
- }, {
247
- key: "unregisterShortcuts",
248
- value: function unregisterShortcuts() {
249
- this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
250
- }
251
-
252
202
  /**
253
203
  * Opens menu and re-position it based on the passed coordinates.
254
204
  *
255
- * @param {{ top: number, left: number }|Event} position An object with `top` and `left` properties
256
- * which contains coordinates relative to the browsers viewport (without included scroll offsets).
257
- * Or if the native event is passed the menu will be positioned based on the `pageX` and `pageY`
258
- * coordinates.
259
- * @param {{ above: number, below: number, left: number, right: number }} offset An object allows applying
260
- * the offset to the menu position.
261
- * @fires Hooks#beforeContextMenuShow
262
- * @fires Hooks#afterContextMenuShow
205
+ * @param {Event} event The mouse event object.
263
206
  */
264
207
  }, {
265
208
  key: "open",
266
- value: function open(position) {
267
- var _this$menu,
268
- _this4 = this;
269
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
270
- above: 0,
271
- below: 0,
272
- left: 0,
273
- right: 0
274
- };
275
- if ((_this$menu = this.menu) !== null && _this$menu !== void 0 && _this$menu.isOpened()) {
209
+ value: function open(event) {
210
+ if (!this.menu) {
276
211
  return;
277
212
  }
278
213
  this.prepareMenuItems();
279
214
  this.menu.open();
280
- (0, _object.objectEach)(offset, function (value, key) {
281
- _this4.menu.setOffset(key, value);
215
+ if (!this.menu.isOpened()) {
216
+ return;
217
+ }
218
+ var offsetTop = 0;
219
+ var offsetLeft = 0;
220
+ if (this.hot.rootDocument !== this.menu.container.ownerDocument) {
221
+ var frameElement = this.hot.rootWindow.frameElement;
222
+ var _frameElement$getBoun = frameElement.getBoundingClientRect(),
223
+ top = _frameElement$getBoun.top,
224
+ left = _frameElement$getBoun.left;
225
+ offsetTop = top - (0, _element.getWindowScrollTop)(event.view);
226
+ offsetLeft = left - (0, _element.getWindowScrollLeft)(event.view);
227
+ } else {
228
+ offsetTop = -1 * (0, _element.getWindowScrollTop)(this.menu.hotMenu.rootWindow);
229
+ offsetLeft = -1 * (0, _element.getWindowScrollLeft)(this.menu.hotMenu.rootWindow);
230
+ }
231
+ this.menu.setPosition({
232
+ top: parseInt(event.pageY, 10) + offsetTop,
233
+ left: parseInt(event.pageX, 10) + offsetLeft
282
234
  });
283
- this.menu.setPosition(position);
284
235
  }
285
236
 
286
237
  /**
@@ -289,8 +240,10 @@ var ContextMenu = /*#__PURE__*/function (_BasePlugin) {
289
240
  }, {
290
241
  key: "close",
291
242
  value: function close() {
292
- var _this$menu2;
293
- (_this$menu2 = this.menu) === null || _this$menu2 === void 0 ? void 0 : _this$menu2.close();
243
+ if (!this.menu) {
244
+ return;
245
+ }
246
+ this.menu.close();
294
247
  this.itemsFactory = null;
295
248
  }
296
249
 
@@ -347,7 +300,7 @@ var ContextMenu = /*#__PURE__*/function (_BasePlugin) {
347
300
  }, {
348
301
  key: "prepareMenuItems",
349
302
  value: function prepareMenuItems() {
350
- var _this5 = this;
303
+ var _this3 = this;
351
304
  this.itemsFactory = new _itemsFactory.default(this.hot, ContextMenu.DEFAULT_ITEMS);
352
305
  var settings = this.hot.getSettings()[PLUGIN_KEY];
353
306
  var predefinedItems = {
@@ -361,7 +314,7 @@ var ContextMenu = /*#__PURE__*/function (_BasePlugin) {
361
314
 
362
315
  // Register all commands. Predefined and added by user or by plugins
363
316
  (0, _array.arrayEach)(menuItems, function (command) {
364
- return _this5.commandExecutor.registerCommand(command.key, command);
317
+ return _this3.commandExecutor.registerCommand(command.key, command);
365
318
  });
366
319
  }
367
320
 
@@ -398,11 +351,7 @@ var ContextMenu = /*#__PURE__*/function (_BasePlugin) {
398
351
  return;
399
352
  }
400
353
  }
401
- var offset = (0, _utils.getDocumentOffsetByElement)(this.menu.container, this.hot.rootDocument);
402
- this.open({
403
- top: event.clientY + offset.top,
404
- left: event.clientX + offset.left
405
- });
354
+ this.open(event);
406
355
  }
407
356
 
408
357
  /**