handsontable 14.0.0-next-07c0a60-20231107 → 14.0.0-next-7ee54cb-20231108

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) 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/cell/coords.js +7 -5
  10. package/3rdparty/walkontable/src/cell/coords.mjs +7 -5
  11. package/3rdparty/walkontable/src/core/clone.js +6 -0
  12. package/3rdparty/walkontable/src/core/clone.mjs +6 -0
  13. package/3rdparty/walkontable/src/event.js +125 -74
  14. package/3rdparty/walkontable/src/event.mjs +125 -74
  15. package/3rdparty/walkontable/src/filter/column.js +16 -0
  16. package/3rdparty/walkontable/src/filter/column.mjs +16 -0
  17. package/3rdparty/walkontable/src/filter/row.js +16 -0
  18. package/3rdparty/walkontable/src/filter/row.mjs +16 -0
  19. package/3rdparty/walkontable/src/overlay/bottom.js +1 -1
  20. package/3rdparty/walkontable/src/overlay/bottom.mjs +1 -1
  21. package/3rdparty/walkontable/src/overlay/top.js +1 -1
  22. package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
  23. package/3rdparty/walkontable/src/renderer/_base.js +12 -5
  24. package/3rdparty/walkontable/src/renderer/_base.mjs +12 -5
  25. package/3rdparty/walkontable/src/renderer/cells.js +6 -2
  26. package/3rdparty/walkontable/src/renderer/cells.mjs +6 -2
  27. package/3rdparty/walkontable/src/renderer/rowHeaders.js +6 -2
  28. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +6 -2
  29. package/3rdparty/walkontable/src/renderer/rows.js +5 -0
  30. package/3rdparty/walkontable/src/renderer/rows.mjs +5 -0
  31. package/3rdparty/walkontable/src/renderer/table.js +24 -17
  32. package/3rdparty/walkontable/src/renderer/table.mjs +24 -17
  33. package/3rdparty/walkontable/src/scroll.js +2 -2
  34. package/3rdparty/walkontable/src/scroll.mjs +2 -2
  35. package/3rdparty/walkontable/src/selection/border/border.js +1 -1
  36. package/3rdparty/walkontable/src/selection/border/border.mjs +1 -1
  37. package/3rdparty/walkontable/src/settings.js +10 -10
  38. package/3rdparty/walkontable/src/settings.mjs +10 -10
  39. package/3rdparty/walkontable/src/table.js +3 -3
  40. package/3rdparty/walkontable/src/table.mjs +3 -3
  41. package/3rdparty/walkontable/src/utils/column.js +19 -4
  42. package/3rdparty/walkontable/src/utils/column.mjs +19 -4
  43. package/3rdparty/walkontable/src/utils/nodesPool.js +5 -0
  44. package/3rdparty/walkontable/src/utils/nodesPool.mjs +5 -0
  45. package/3rdparty/walkontable/src/utils/orderView/view.js +13 -6
  46. package/3rdparty/walkontable/src/utils/orderView/view.mjs +13 -6
  47. package/3rdparty/walkontable/src/utils/orderView/viewSize.js +9 -6
  48. package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +9 -6
  49. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +7 -4
  50. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +7 -4
  51. package/3rdparty/walkontable/src/utils/row.js +14 -2
  52. package/3rdparty/walkontable/src/utils/row.mjs +14 -2
  53. package/3rdparty/walkontable/src/viewport.js +9 -9
  54. package/3rdparty/walkontable/src/viewport.mjs +9 -9
  55. package/base.js +2 -2
  56. package/base.mjs +2 -2
  57. package/core.js +31 -26
  58. package/core.mjs +31 -26
  59. package/dataMap/dataMap.js +99 -90
  60. package/dataMap/dataMap.mjs +99 -90
  61. package/dataMap/dataSource.js +14 -8
  62. package/dataMap/dataSource.mjs +14 -8
  63. package/dataMap/metaManager/lazyFactoryMap.js +19 -7
  64. package/dataMap/metaManager/lazyFactoryMap.mjs +19 -7
  65. package/dataMap/metaManager/metaLayers/cellMeta.js +8 -3
  66. package/dataMap/metaManager/metaLayers/cellMeta.mjs +8 -3
  67. package/dataMap/metaManager/metaLayers/columnMeta.js +7 -1
  68. package/dataMap/metaManager/metaLayers/columnMeta.mjs +7 -1
  69. package/dataMap/metaManager/metaLayers/globalMeta.js +6 -1
  70. package/dataMap/metaManager/metaLayers/globalMeta.mjs +6 -1
  71. package/dataMap/metaManager/metaLayers/tableMeta.js +6 -2
  72. package/dataMap/metaManager/metaLayers/tableMeta.mjs +6 -2
  73. package/dataMap/metaManager/metaSchema.js +55 -55
  74. package/dataMap/metaManager/metaSchema.mjs +55 -55
  75. package/dataMap/metaManager/mods/dynamicCellMeta.js +7 -2
  76. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +7 -2
  77. package/dataMap/metaManager/mods/extendMetaProperties.js +8 -4
  78. package/dataMap/metaManager/mods/extendMetaProperties.mjs +8 -4
  79. package/dataMap/metaManager/utils.js +2 -2
  80. package/dataMap/metaManager/utils.mjs +2 -2
  81. package/dist/handsontable.css +2 -2
  82. package/dist/handsontable.full.css +2 -2
  83. package/dist/handsontable.full.js +7337 -6394
  84. package/dist/handsontable.full.min.css +2 -2
  85. package/dist/handsontable.full.min.js +154 -154
  86. package/dist/handsontable.js +7336 -6393
  87. package/dist/handsontable.min.css +2 -2
  88. package/dist/handsontable.min.js +28 -28
  89. package/editorManager.js +105 -95
  90. package/editorManager.mjs +105 -95
  91. package/editors/autocompleteEditor/autocompleteEditor.js +47 -46
  92. package/editors/autocompleteEditor/autocompleteEditor.mjs +46 -45
  93. package/editors/baseEditor/baseEditor.js +23 -26
  94. package/editors/baseEditor/baseEditor.mjs +23 -26
  95. package/editors/dateEditor/dateEditor.js +24 -15
  96. package/editors/dateEditor/dateEditor.mjs +24 -15
  97. package/editors/dropdownEditor/dropdownEditor.js +1 -1
  98. package/editors/dropdownEditor/dropdownEditor.mjs +1 -1
  99. package/editors/handsontableEditor/handsontableEditor.js +4 -4
  100. package/editors/handsontableEditor/handsontableEditor.mjs +4 -4
  101. package/editors/textEditor/textEditor.js +23 -17
  102. package/editors/textEditor/textEditor.mjs +24 -18
  103. package/eventManager.js +8 -0
  104. package/eventManager.mjs +8 -0
  105. package/helpers/array.js +2 -2
  106. package/helpers/array.mjs +2 -2
  107. package/helpers/dom/element.js +7 -7
  108. package/helpers/dom/element.mjs +7 -7
  109. package/helpers/function.js +1 -1
  110. package/helpers/function.mjs +1 -1
  111. package/helpers/mixed.js +1 -1
  112. package/helpers/mixed.mjs +1 -1
  113. package/helpers/object.js +4 -4
  114. package/helpers/object.mjs +4 -4
  115. package/helpers/string.js +1 -1
  116. package/helpers/string.mjs +1 -1
  117. package/package.json +1 -1
  118. package/pluginHooks.d.ts +0 -2
  119. package/pluginHooks.js +12 -3
  120. package/pluginHooks.mjs +12 -3
  121. package/plugins/autoColumnSize/autoColumnSize.js +141 -130
  122. package/plugins/autoColumnSize/autoColumnSize.mjs +140 -129
  123. package/plugins/autoRowSize/autoRowSize.js +112 -125
  124. package/plugins/autoRowSize/autoRowSize.mjs +110 -123
  125. package/plugins/autofill/autofill.js +98 -102
  126. package/plugins/autofill/autofill.mjs +97 -101
  127. package/plugins/base/base.js +61 -28
  128. package/plugins/base/base.mjs +60 -28
  129. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +29 -24
  130. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +28 -23
  131. package/plugins/collapsibleColumns/collapsibleColumns.js +104 -107
  132. package/plugins/collapsibleColumns/collapsibleColumns.mjs +102 -104
  133. package/plugins/columnSorting/columnSorting.js +107 -99
  134. package/plugins/columnSorting/columnSorting.mjs +106 -98
  135. package/plugins/columnSorting/columnStatesManager.js +12 -6
  136. package/plugins/columnSorting/columnStatesManager.mjs +12 -6
  137. package/plugins/columnSummary/columnSummary.js +71 -58
  138. package/plugins/columnSummary/columnSummary.mjs +70 -57
  139. package/plugins/columnSummary/endpoints.js +20 -14
  140. package/plugins/columnSummary/endpoints.mjs +20 -14
  141. package/plugins/comments/commentEditor.js +30 -2
  142. package/plugins/comments/commentEditor.mjs +30 -2
  143. package/plugins/comments/comments.js +158 -169
  144. package/plugins/comments/comments.mjs +157 -168
  145. package/plugins/comments/displaySwitch.js +7 -3
  146. package/plugins/comments/displaySwitch.mjs +7 -3
  147. package/plugins/contextMenu/commandExecutor.js +15 -2
  148. package/plugins/contextMenu/commandExecutor.mjs +15 -2
  149. package/plugins/contextMenu/contextMenu.js +96 -102
  150. package/plugins/contextMenu/contextMenu.mjs +95 -101
  151. package/plugins/contextMenu/itemsFactory.js +19 -4
  152. package/plugins/contextMenu/itemsFactory.mjs +19 -4
  153. package/plugins/contextMenu/menu/cursor.js +36 -0
  154. package/plugins/contextMenu/menu/cursor.mjs +36 -0
  155. package/plugins/contextMenu/menu/menu.js +57 -5
  156. package/plugins/contextMenu/menu/menu.mjs +57 -5
  157. package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
  158. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
  159. package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
  160. package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
  161. package/plugins/copyPaste/copyPaste.js +74 -75
  162. package/plugins/copyPaste/copyPaste.mjs +74 -75
  163. package/plugins/customBorders/customBorders.js +57 -50
  164. package/plugins/customBorders/customBorders.mjs +56 -49
  165. package/plugins/dragToScroll/dragToScroll.js +50 -54
  166. package/plugins/dragToScroll/dragToScroll.mjs +49 -52
  167. package/plugins/dropdownMenu/dropdownMenu.js +136 -131
  168. package/plugins/dropdownMenu/dropdownMenu.mjs +136 -131
  169. package/plugins/exportFile/dataProvider.js +7 -2
  170. package/plugins/exportFile/dataProvider.mjs +7 -2
  171. package/plugins/exportFile/exportFile.js +1 -1
  172. package/plugins/exportFile/exportFile.mjs +1 -1
  173. package/plugins/exportFile/types/_base.js +14 -6
  174. package/plugins/exportFile/types/_base.mjs +14 -6
  175. package/plugins/filters/component/actionBar.js +9 -0
  176. package/plugins/filters/component/actionBar.mjs +9 -0
  177. package/plugins/filters/component/condition.js +13 -0
  178. package/plugins/filters/component/condition.mjs +13 -0
  179. package/plugins/filters/component/operators.js +9 -0
  180. package/plugins/filters/component/operators.mjs +9 -0
  181. package/plugins/filters/component/value.js +9 -0
  182. package/plugins/filters/component/value.mjs +9 -0
  183. package/plugins/filters/conditionCollection.js +9 -4
  184. package/plugins/filters/conditionCollection.mjs +9 -4
  185. package/plugins/filters/conditionUpdateObserver.js +53 -42
  186. package/plugins/filters/conditionUpdateObserver.mjs +53 -42
  187. package/plugins/filters/dataFilter.js +9 -3
  188. package/plugins/filters/dataFilter.mjs +9 -3
  189. package/plugins/filters/filters.js +184 -189
  190. package/plugins/filters/filters.mjs +182 -187
  191. package/plugins/filters/ui/_base.js +1 -1
  192. package/plugins/filters/ui/_base.mjs +1 -1
  193. package/plugins/filters/utils.js +1 -1
  194. package/plugins/filters/utils.mjs +1 -1
  195. package/plugins/formulas/engine/settings.js +1 -1
  196. package/plugins/formulas/engine/settings.mjs +1 -1
  197. package/plugins/formulas/formulas.js +684 -602
  198. package/plugins/formulas/formulas.mjs +682 -600
  199. package/plugins/hiddenColumns/hiddenColumns.js +174 -169
  200. package/plugins/hiddenColumns/hiddenColumns.mjs +173 -168
  201. package/plugins/hiddenRows/hiddenRows.js +170 -165
  202. package/plugins/hiddenRows/hiddenRows.mjs +169 -164
  203. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
  204. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
  205. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
  206. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
  207. package/plugins/manualColumnFreeze/manualColumnFreeze.js +66 -53
  208. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +64 -51
  209. package/plugins/manualColumnMove/manualColumnMove.js +287 -232
  210. package/plugins/manualColumnMove/manualColumnMove.mjs +286 -231
  211. package/plugins/manualColumnMove/ui/_base.js +9 -3
  212. package/plugins/manualColumnMove/ui/_base.mjs +9 -3
  213. package/plugins/manualColumnResize/manualColumnResize.js +291 -246
  214. package/plugins/manualColumnResize/manualColumnResize.mjs +290 -244
  215. package/plugins/manualRowMove/manualRowMove.js +223 -208
  216. package/plugins/manualRowMove/manualRowMove.mjs +222 -207
  217. package/plugins/manualRowMove/ui/_base.js +10 -5
  218. package/plugins/manualRowMove/ui/_base.mjs +10 -5
  219. package/plugins/manualRowResize/manualRowResize.js +254 -209
  220. package/plugins/manualRowResize/manualRowResize.mjs +253 -207
  221. package/plugins/mergeCells/calculations/autofill.js +9 -3
  222. package/plugins/mergeCells/calculations/autofill.mjs +9 -3
  223. package/plugins/mergeCells/calculations/selection.js +10 -4
  224. package/plugins/mergeCells/calculations/selection.mjs +10 -4
  225. package/plugins/mergeCells/cellCoords.js +16 -6
  226. package/plugins/mergeCells/cellCoords.mjs +16 -6
  227. package/plugins/mergeCells/cellsCollection.js +10 -4
  228. package/plugins/mergeCells/cellsCollection.mjs +10 -4
  229. package/plugins/mergeCells/mergeCells.js +582 -502
  230. package/plugins/mergeCells/mergeCells.mjs +580 -500
  231. package/plugins/multiColumnSorting/multiColumnSorting.js +15 -11
  232. package/plugins/multiColumnSorting/multiColumnSorting.mjs +15 -11
  233. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +16 -28
  234. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +16 -27
  235. package/plugins/nestedHeaders/nestedHeaders.js +542 -499
  236. package/plugins/nestedHeaders/nestedHeaders.mjs +554 -511
  237. package/plugins/nestedHeaders/stateManager/index.js +1 -1
  238. package/plugins/nestedHeaders/stateManager/index.mjs +1 -1
  239. package/plugins/nestedRows/data/dataManager.js +21 -15
  240. package/plugins/nestedRows/data/dataManager.mjs +21 -15
  241. package/plugins/nestedRows/nestedRows.js +328 -279
  242. package/plugins/nestedRows/nestedRows.mjs +327 -278
  243. package/plugins/nestedRows/ui/_base.js +7 -1
  244. package/plugins/nestedRows/ui/_base.mjs +7 -1
  245. package/plugins/nestedRows/ui/collapsing.js +2 -2
  246. package/plugins/nestedRows/ui/collapsing.mjs +2 -2
  247. package/plugins/nestedRows/ui/contextMenu.js +28 -18
  248. package/plugins/nestedRows/ui/contextMenu.mjs +28 -18
  249. package/plugins/nestedRows/utils/rowMoveController.js +12 -4
  250. package/plugins/nestedRows/utils/rowMoveController.mjs +12 -4
  251. package/plugins/persistentState/persistentState.js +14 -11
  252. package/plugins/persistentState/persistentState.mjs +14 -11
  253. package/plugins/persistentState/storage.js +11 -6
  254. package/plugins/persistentState/storage.mjs +11 -6
  255. package/plugins/registry.js +2 -2
  256. package/plugins/registry.mjs +2 -2
  257. package/plugins/search/search.js +57 -46
  258. package/plugins/search/search.mjs +56 -45
  259. package/plugins/touchScroll/touchScroll.js +102 -100
  260. package/plugins/touchScroll/touchScroll.mjs +100 -98
  261. package/plugins/trimRows/trimRows.js +33 -28
  262. package/plugins/trimRows/trimRows.mjs +32 -27
  263. package/plugins/undoRedo/undoRedo.js +2 -2
  264. package/plugins/undoRedo/undoRedo.mjs +2 -2
  265. package/renderers/autocompleteRenderer/autocompleteRenderer.js +11 -11
  266. package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +11 -11
  267. package/renderers/baseRenderer/baseRenderer.js +2 -2
  268. package/renderers/baseRenderer/baseRenderer.mjs +2 -2
  269. package/renderers/checkboxRenderer/checkboxRenderer.js +23 -23
  270. package/renderers/checkboxRenderer/checkboxRenderer.mjs +23 -23
  271. package/renderers/dateRenderer/dateRenderer.js +4 -4
  272. package/renderers/dateRenderer/dateRenderer.mjs +4 -4
  273. package/renderers/handsontableRenderer/handsontableRenderer.js +4 -4
  274. package/renderers/handsontableRenderer/handsontableRenderer.mjs +4 -4
  275. package/renderers/htmlRenderer/htmlRenderer.js +4 -4
  276. package/renderers/htmlRenderer/htmlRenderer.mjs +4 -4
  277. package/renderers/numericRenderer/numericRenderer.js +3 -3
  278. package/renderers/numericRenderer/numericRenderer.mjs +3 -3
  279. package/renderers/passwordRenderer/passwordRenderer.js +3 -3
  280. package/renderers/passwordRenderer/passwordRenderer.mjs +3 -3
  281. package/renderers/selectRenderer/selectRenderer.js +4 -4
  282. package/renderers/selectRenderer/selectRenderer.mjs +4 -4
  283. package/renderers/textRenderer/textRenderer.js +5 -5
  284. package/renderers/textRenderer/textRenderer.mjs +5 -5
  285. package/renderers/timeRenderer/timeRenderer.js +3 -3
  286. package/renderers/timeRenderer/timeRenderer.mjs +3 -3
  287. package/selection/highlight/highlight.js +1 -4
  288. package/selection/highlight/highlight.mjs +1 -4
  289. package/selection/range.js +12 -2
  290. package/selection/range.mjs +12 -2
  291. package/selection/selection.js +28 -10
  292. package/selection/selection.mjs +28 -10
  293. package/selection/utils.js +24 -14
  294. package/selection/utils.mjs +25 -15
  295. package/shortcuts/manager.js +1 -1
  296. package/shortcuts/manager.mjs +1 -1
  297. package/tableView.js +208 -200
  298. package/tableView.mjs +208 -200
  299. package/translations/changesObservable/utils.js +2 -2
  300. package/translations/changesObservable/utils.mjs +2 -2
  301. package/translations/indexMapper.js +25 -22
  302. package/translations/indexMapper.mjs +25 -22
  303. package/translations/mapCollections/aggregatedCollection.js +8 -2
  304. package/translations/mapCollections/aggregatedCollection.mjs +8 -2
  305. package/translations/mapCollections/mapCollection.js +5 -2
  306. package/translations/mapCollections/mapCollection.mjs +5 -2
  307. package/translations/maps/indexMap.js +6 -1
  308. package/translations/maps/indexMap.mjs +6 -1
  309. package/translations/maps/utils/physicallyIndexed.js +2 -2
  310. package/translations/maps/utils/physicallyIndexed.mjs +2 -2
  311. package/utils/dataStructures/linkedList.js +10 -6
  312. package/utils/dataStructures/linkedList.mjs +10 -6
  313. package/utils/dataStructures/queue.js +1 -1
  314. package/utils/dataStructures/queue.mjs +1 -1
  315. package/utils/dataStructures/stack.js +1 -1
  316. package/utils/dataStructures/stack.mjs +1 -1
  317. package/utils/ghostTable.js +2 -2
  318. package/utils/ghostTable.mjs +2 -2
  319. package/utils/interval.js +73 -36
  320. package/utils/interval.mjs +73 -36
  321. package/utils/parseTable.js +1 -1
  322. package/utils/parseTable.mjs +1 -1
  323. package/validators/autocompleteValidator/autocompleteValidator.js +1 -1
  324. package/validators/autocompleteValidator/autocompleteValidator.mjs +1 -1
  325. package/validators/dateValidator/dateValidator.js +1 -1
  326. package/validators/dateValidator/dateValidator.mjs +1 -1
  327. package/validators/numericValidator/numericValidator.js +1 -1
  328. package/validators/numericValidator/numericValidator.mjs +1 -1
@@ -1,18 +1,24 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
+ require("core-js/modules/es.error.cause.js");
4
5
  var _base = require("../base");
5
6
  var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
6
7
  var _array = require("../../helpers/array");
7
8
  var _object = require("../../helpers/object");
8
9
  var _commandExecutor = require("./commandExecutor");
9
- var _eventManager = _interopRequireDefault(require("../../eventManager"));
10
10
  var _itemsFactory = require("./itemsFactory");
11
11
  var _menu = require("./menu");
12
12
  var _utils = require("./utils");
13
13
  var _element = require("../../helpers/dom/element");
14
14
  var _predefinedItems = require("./predefinedItems");
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
17
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
18
+ 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; }
19
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
20
+ 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); }
21
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
16
22
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'contextMenu';
17
23
  const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 70;
18
24
  const SHORTCUTS_GROUP = PLUGIN_KEY;
@@ -46,61 +52,71 @@ _pluginHooks.default.getSingleton().register('afterContextMenuExecute');
46
52
  *
47
53
  * @plugin ContextMenu
48
54
  */
55
+ var _onAfterOnCellContextMenu = /*#__PURE__*/new WeakSet();
56
+ var _onMenuBeforeOpen = /*#__PURE__*/new WeakSet();
57
+ var _onMenuAfterOpen = /*#__PURE__*/new WeakSet();
58
+ var _onMenuAfterClose = /*#__PURE__*/new WeakSet();
49
59
  class ContextMenu extends _base.BasePlugin {
50
- static get PLUGIN_KEY() {
51
- return PLUGIN_KEY;
52
- }
53
- static get PLUGIN_PRIORITY() {
54
- return PLUGIN_PRIORITY;
55
- }
56
- static get PLUGIN_DEPS() {
57
- return ['plugin:AutoColumnSize'];
58
- }
59
-
60
- /**
61
- * Context menu default items order when `contextMenu` options is set as `true`.
62
- *
63
- * @returns {string[]}
64
- */
65
- static get DEFAULT_ITEMS() {
66
- return [_predefinedItems.ROW_ABOVE, _predefinedItems.ROW_BELOW, _predefinedItems.SEPARATOR, _predefinedItems.COLUMN_LEFT, _predefinedItems.COLUMN_RIGHT, _predefinedItems.SEPARATOR, _predefinedItems.REMOVE_ROW, _predefinedItems.REMOVE_COLUMN, _predefinedItems.SEPARATOR, _predefinedItems.UNDO, _predefinedItems.REDO, _predefinedItems.SEPARATOR, _predefinedItems.READ_ONLY, _predefinedItems.SEPARATOR, _predefinedItems.ALIGNMENT];
67
- }
68
-
69
- /**
70
- * @param {Core} hotInstance Handsontable instance.
71
- */
72
- constructor(hotInstance) {
73
- super(hotInstance);
60
+ constructor() {
61
+ super(...arguments);
74
62
  /**
75
- * Instance of {@link EventManager}.
63
+ * On menu after close listener.
64
+ */
65
+ _classPrivateMethodInitSpec(this, _onMenuAfterClose);
66
+ /**
67
+ * On menu after open listener.
68
+ */
69
+ _classPrivateMethodInitSpec(this, _onMenuAfterOpen);
70
+ /**
71
+ * On menu before open listener.
72
+ */
73
+ _classPrivateMethodInitSpec(this, _onMenuBeforeOpen);
74
+ /**
75
+ * On contextmenu listener.
76
76
  *
77
- * @private
78
- * @type {EventManager}
77
+ * @param {Event} event The mouse event object.
79
78
  */
80
- this.eventManager = new _eventManager.default(this);
79
+ _classPrivateMethodInitSpec(this, _onAfterOnCellContextMenu);
81
80
  /**
82
81
  * Instance of {@link CommandExecutor}.
83
82
  *
84
83
  * @private
85
84
  * @type {CommandExecutor}
86
85
  */
87
- this.commandExecutor = new _commandExecutor.CommandExecutor(this.hot);
86
+ _defineProperty(this, "commandExecutor", new _commandExecutor.CommandExecutor(this.hot));
88
87
  /**
89
88
  * Instance of {@link ItemsFactory}.
90
89
  *
91
90
  * @private
92
91
  * @type {ItemsFactory}
93
92
  */
94
- this.itemsFactory = null;
93
+ _defineProperty(this, "itemsFactory", null);
95
94
  /**
96
95
  * Instance of {@link Menu}.
97
96
  *
98
97
  * @private
99
98
  * @type {Menu}
100
99
  */
101
- this.menu = null;
100
+ _defineProperty(this, "menu", null);
101
+ }
102
+ static get PLUGIN_KEY() {
103
+ return PLUGIN_KEY;
104
+ }
105
+ static get PLUGIN_PRIORITY() {
106
+ return PLUGIN_PRIORITY;
107
+ }
108
+ static get PLUGIN_DEPS() {
109
+ return ['plugin:AutoColumnSize'];
102
110
  }
103
111
 
112
+ /**
113
+ * Context menu default items order when `contextMenu` options is set as `true`.
114
+ *
115
+ * @returns {string[]}
116
+ */
117
+ static get DEFAULT_ITEMS() {
118
+ return [_predefinedItems.ROW_ABOVE, _predefinedItems.ROW_BELOW, _predefinedItems.SEPARATOR, _predefinedItems.COLUMN_LEFT, _predefinedItems.COLUMN_RIGHT, _predefinedItems.SEPARATOR, _predefinedItems.REMOVE_ROW, _predefinedItems.REMOVE_COLUMN, _predefinedItems.SEPARATOR, _predefinedItems.UNDO, _predefinedItems.REDO, _predefinedItems.SEPARATOR, _predefinedItems.READ_ONLY, _predefinedItems.SEPARATOR, _predefinedItems.ALIGNMENT];
119
+ }
104
120
  /**
105
121
  * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
106
122
  * hook and if it returns `true` then the {@link ContextMenu#enablePlugin} method is called.
@@ -128,16 +144,16 @@ class ContextMenu extends _base.BasePlugin {
128
144
  keepInViewport: true,
129
145
  container: settings.uiContainer || this.hot.rootDocument.body
130
146
  });
131
- this.menu.addLocalHook('beforeOpen', () => this.onMenuBeforeOpen());
132
- this.menu.addLocalHook('afterOpen', () => this.onMenuAfterOpen());
133
- this.menu.addLocalHook('afterClose', () => this.onMenuAfterClose());
147
+ this.menu.addLocalHook('beforeOpen', () => _classPrivateMethodGet(this, _onMenuBeforeOpen, _onMenuBeforeOpen2).call(this));
148
+ this.menu.addLocalHook('afterOpen', () => _classPrivateMethodGet(this, _onMenuAfterOpen, _onMenuAfterOpen2).call(this));
149
+ this.menu.addLocalHook('afterClose', () => _classPrivateMethodGet(this, _onMenuAfterClose, _onMenuAfterClose2).call(this));
134
150
  this.menu.addLocalHook('executeCommand', function () {
135
151
  for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
136
152
  params[_key] = arguments[_key];
137
153
  }
138
154
  return _this.executeCommand.call(_this, ...params);
139
155
  });
140
- this.addHook('afterOnCellContextMenu', event => this.onAfterOnCellContextMenu(event));
156
+ this.addHook('afterOnCellContextMenu', event => _classPrivateMethodGet(this, _onAfterOnCellContextMenu, _onAfterOnCellContextMenu2).call(this, event));
141
157
  this.registerShortcuts();
142
158
  super.enablePlugin();
143
159
  }
@@ -190,7 +206,11 @@ class ContextMenu extends _base.BasePlugin {
190
206
  above: -rect.height
191
207
  });
192
208
  },
193
- runOnlyIf: () => this.hot.getSelectedRangeLast() && !this.menu.isOpened(),
209
+ runOnlyIf: () => {
210
+ var _this$hot$getSelected;
211
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
212
+ return highlight && this.hot.selection.isCellVisible(highlight) && !this.menu.isOpened();
213
+ },
194
214
  group: SHORTCUTS_GROUP
195
215
  });
196
216
  }
@@ -306,85 +326,59 @@ class ContextMenu extends _base.BasePlugin {
306
326
  // Register all commands. Predefined and added by user or by plugins
307
327
  (0, _array.arrayEach)(menuItems, command => this.commandExecutor.registerCommand(command.key, command));
308
328
  }
309
-
310
329
  /**
311
- * On contextmenu listener.
312
- *
313
- * @private
314
- * @param {Event} event The mouse event object.
330
+ * Destroys the plugin instance.
315
331
  */
316
- onAfterOnCellContextMenu(event) {
317
- const settings = this.hot.getSettings();
318
- const showRowHeaders = settings.rowHeaders;
319
- const showColHeaders = settings.colHeaders;
320
-
321
- /**
322
- * @private
323
- * @param {HTMLElement} element The element to validate.
324
- * @returns {boolean}
325
- */
326
- function isValidElement(element) {
327
- return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD';
328
- }
329
- const element = event.target;
332
+ destroy() {
330
333
  this.close();
331
- if ((0, _element.hasClass)(element, 'handsontableInput')) {
332
- return;
333
- }
334
- event.preventDefault();
335
- event.stopPropagation();
336
- if (!(showRowHeaders || showColHeaders)) {
337
- if (!isValidElement(element) && !((0, _element.hasClass)(element, 'current') && (0, _element.hasClass)(element, 'wtBorder'))) {
338
- return;
339
- }
334
+ if (this.menu) {
335
+ this.menu.destroy();
340
336
  }
341
- const offset = (0, _utils.getDocumentOffsetByElement)(this.menu.container, this.hot.rootDocument);
342
- this.open({
343
- top: event.clientY + offset.top,
344
- left: event.clientX + offset.left
345
- });
346
- }
347
-
348
- /**
349
- * On menu before open listener.
350
- *
351
- * @private
352
- */
353
- onMenuBeforeOpen() {
354
- this.hot.runHooks('beforeContextMenuShow', this);
337
+ super.destroy();
355
338
  }
339
+ }
340
+ exports.ContextMenu = ContextMenu;
341
+ function _onAfterOnCellContextMenu2(event) {
342
+ const settings = this.hot.getSettings();
343
+ const showRowHeaders = settings.rowHeaders;
344
+ const showColHeaders = settings.colHeaders;
356
345
 
357
346
  /**
358
- * On menu after open listener.
359
- *
360
347
  * @private
348
+ * @param {HTMLElement} element The element to validate.
349
+ * @returns {boolean}
361
350
  */
362
- onMenuAfterOpen() {
363
- this.hot.runHooks('afterContextMenuShow', this);
351
+ function isValidElement(element) {
352
+ return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD';
364
353
  }
365
-
366
- /**
367
- * On menu after close listener.
368
- *
369
- * @private
370
- */
371
- onMenuAfterClose() {
372
- this.hot.listen();
373
- this.hot.runHooks('afterContextMenuHide', this);
354
+ const element = event.target;
355
+ this.close();
356
+ if ((0, _element.hasClass)(element, 'handsontableInput')) {
357
+ return;
374
358
  }
375
-
376
- /**
377
- * Destroys the plugin instance.
378
- */
379
- destroy() {
380
- this.close();
381
- if (this.menu) {
382
- this.menu.destroy();
359
+ event.preventDefault();
360
+ event.stopPropagation();
361
+ if (!(showRowHeaders || showColHeaders)) {
362
+ if (!isValidElement(element) && !((0, _element.hasClass)(element, 'current') && (0, _element.hasClass)(element, 'wtBorder'))) {
363
+ return;
383
364
  }
384
- super.destroy();
385
365
  }
366
+ const offset = (0, _utils.getDocumentOffsetByElement)(this.menu.container, this.hot.rootDocument);
367
+ this.open({
368
+ top: event.clientY + offset.top,
369
+ left: event.clientX + offset.left
370
+ });
371
+ }
372
+ function _onMenuBeforeOpen2() {
373
+ this.hot.runHooks('beforeContextMenuShow', this);
374
+ }
375
+ function _onMenuAfterOpen2() {
376
+ this.hot.runHooks('afterContextMenuShow', this);
377
+ }
378
+ function _onMenuAfterClose2() {
379
+ this.hot.listen();
380
+ this.hot.runHooks('afterContextMenuHide', this);
386
381
  }
387
- exports.ContextMenu = ContextMenu;
388
382
  ContextMenu.SEPARATOR = {
389
383
  name: _predefinedItems.SEPARATOR
390
384
  };
@@ -1,9 +1,15 @@
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 { BasePlugin } from "../base/index.mjs";
2
9
  import Hooks from "../../pluginHooks.mjs";
3
10
  import { arrayEach } from "../../helpers/array.mjs";
4
11
  import { objectEach } from "../../helpers/object.mjs";
5
12
  import { CommandExecutor } from "./commandExecutor.mjs";
6
- import EventManager from "../../eventManager.mjs";
7
13
  import { ItemsFactory } from "./itemsFactory.mjs";
8
14
  import { Menu } from "./menu/index.mjs";
9
15
  import { getDocumentOffsetByElement } from "./utils.mjs";
@@ -42,61 +48,71 @@ Hooks.getSingleton().register('afterContextMenuExecute');
42
48
  *
43
49
  * @plugin ContextMenu
44
50
  */
51
+ var _onAfterOnCellContextMenu = /*#__PURE__*/new WeakSet();
52
+ var _onMenuBeforeOpen = /*#__PURE__*/new WeakSet();
53
+ var _onMenuAfterOpen = /*#__PURE__*/new WeakSet();
54
+ var _onMenuAfterClose = /*#__PURE__*/new WeakSet();
45
55
  export class ContextMenu extends BasePlugin {
46
- static get PLUGIN_KEY() {
47
- return PLUGIN_KEY;
48
- }
49
- static get PLUGIN_PRIORITY() {
50
- return PLUGIN_PRIORITY;
51
- }
52
- static get PLUGIN_DEPS() {
53
- return ['plugin:AutoColumnSize'];
54
- }
55
-
56
- /**
57
- * Context menu default items order when `contextMenu` options is set as `true`.
58
- *
59
- * @returns {string[]}
60
- */
61
- static get DEFAULT_ITEMS() {
62
- return [ROW_ABOVE, ROW_BELOW, SEPARATOR, COLUMN_LEFT, COLUMN_RIGHT, SEPARATOR, REMOVE_ROW, REMOVE_COLUMN, SEPARATOR, UNDO, REDO, SEPARATOR, READ_ONLY, SEPARATOR, ALIGNMENT];
63
- }
64
-
65
- /**
66
- * @param {Core} hotInstance Handsontable instance.
67
- */
68
- constructor(hotInstance) {
69
- super(hotInstance);
56
+ constructor() {
57
+ super(...arguments);
58
+ /**
59
+ * On menu after close listener.
60
+ */
61
+ _classPrivateMethodInitSpec(this, _onMenuAfterClose);
70
62
  /**
71
- * Instance of {@link EventManager}.
63
+ * On menu after open listener.
64
+ */
65
+ _classPrivateMethodInitSpec(this, _onMenuAfterOpen);
66
+ /**
67
+ * On menu before open listener.
68
+ */
69
+ _classPrivateMethodInitSpec(this, _onMenuBeforeOpen);
70
+ /**
71
+ * On contextmenu listener.
72
72
  *
73
- * @private
74
- * @type {EventManager}
73
+ * @param {Event} event The mouse event object.
75
74
  */
76
- this.eventManager = new EventManager(this);
75
+ _classPrivateMethodInitSpec(this, _onAfterOnCellContextMenu);
77
76
  /**
78
77
  * Instance of {@link CommandExecutor}.
79
78
  *
80
79
  * @private
81
80
  * @type {CommandExecutor}
82
81
  */
83
- this.commandExecutor = new CommandExecutor(this.hot);
82
+ _defineProperty(this, "commandExecutor", new CommandExecutor(this.hot));
84
83
  /**
85
84
  * Instance of {@link ItemsFactory}.
86
85
  *
87
86
  * @private
88
87
  * @type {ItemsFactory}
89
88
  */
90
- this.itemsFactory = null;
89
+ _defineProperty(this, "itemsFactory", null);
91
90
  /**
92
91
  * Instance of {@link Menu}.
93
92
  *
94
93
  * @private
95
94
  * @type {Menu}
96
95
  */
97
- this.menu = null;
96
+ _defineProperty(this, "menu", null);
97
+ }
98
+ static get PLUGIN_KEY() {
99
+ return PLUGIN_KEY;
100
+ }
101
+ static get PLUGIN_PRIORITY() {
102
+ return PLUGIN_PRIORITY;
103
+ }
104
+ static get PLUGIN_DEPS() {
105
+ return ['plugin:AutoColumnSize'];
98
106
  }
99
107
 
108
+ /**
109
+ * Context menu default items order when `contextMenu` options is set as `true`.
110
+ *
111
+ * @returns {string[]}
112
+ */
113
+ static get DEFAULT_ITEMS() {
114
+ return [ROW_ABOVE, ROW_BELOW, SEPARATOR, COLUMN_LEFT, COLUMN_RIGHT, SEPARATOR, REMOVE_ROW, REMOVE_COLUMN, SEPARATOR, UNDO, REDO, SEPARATOR, READ_ONLY, SEPARATOR, ALIGNMENT];
115
+ }
100
116
  /**
101
117
  * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
102
118
  * hook and if it returns `true` then the {@link ContextMenu#enablePlugin} method is called.
@@ -124,16 +140,16 @@ export class ContextMenu extends BasePlugin {
124
140
  keepInViewport: true,
125
141
  container: settings.uiContainer || this.hot.rootDocument.body
126
142
  });
127
- this.menu.addLocalHook('beforeOpen', () => this.onMenuBeforeOpen());
128
- this.menu.addLocalHook('afterOpen', () => this.onMenuAfterOpen());
129
- this.menu.addLocalHook('afterClose', () => this.onMenuAfterClose());
143
+ this.menu.addLocalHook('beforeOpen', () => _classPrivateMethodGet(this, _onMenuBeforeOpen, _onMenuBeforeOpen2).call(this));
144
+ this.menu.addLocalHook('afterOpen', () => _classPrivateMethodGet(this, _onMenuAfterOpen, _onMenuAfterOpen2).call(this));
145
+ this.menu.addLocalHook('afterClose', () => _classPrivateMethodGet(this, _onMenuAfterClose, _onMenuAfterClose2).call(this));
130
146
  this.menu.addLocalHook('executeCommand', function () {
131
147
  for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
132
148
  params[_key] = arguments[_key];
133
149
  }
134
150
  return _this.executeCommand.call(_this, ...params);
135
151
  });
136
- this.addHook('afterOnCellContextMenu', event => this.onAfterOnCellContextMenu(event));
152
+ this.addHook('afterOnCellContextMenu', event => _classPrivateMethodGet(this, _onAfterOnCellContextMenu, _onAfterOnCellContextMenu2).call(this, event));
137
153
  this.registerShortcuts();
138
154
  super.enablePlugin();
139
155
  }
@@ -186,7 +202,11 @@ export class ContextMenu extends BasePlugin {
186
202
  above: -rect.height
187
203
  });
188
204
  },
189
- runOnlyIf: () => this.hot.getSelectedRangeLast() && !this.menu.isOpened(),
205
+ runOnlyIf: () => {
206
+ var _this$hot$getSelected;
207
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
208
+ return highlight && this.hot.selection.isCellVisible(highlight) && !this.menu.isOpened();
209
+ },
190
210
  group: SHORTCUTS_GROUP
191
211
  });
192
212
  }
@@ -302,83 +322,57 @@ export class ContextMenu extends BasePlugin {
302
322
  // Register all commands. Predefined and added by user or by plugins
303
323
  arrayEach(menuItems, command => this.commandExecutor.registerCommand(command.key, command));
304
324
  }
305
-
306
325
  /**
307
- * On contextmenu listener.
308
- *
309
- * @private
310
- * @param {Event} event The mouse event object.
326
+ * Destroys the plugin instance.
311
327
  */
312
- onAfterOnCellContextMenu(event) {
313
- const settings = this.hot.getSettings();
314
- const showRowHeaders = settings.rowHeaders;
315
- const showColHeaders = settings.colHeaders;
316
-
317
- /**
318
- * @private
319
- * @param {HTMLElement} element The element to validate.
320
- * @returns {boolean}
321
- */
322
- function isValidElement(element) {
323
- return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD';
324
- }
325
- const element = event.target;
328
+ destroy() {
326
329
  this.close();
327
- if (hasClass(element, 'handsontableInput')) {
328
- return;
329
- }
330
- event.preventDefault();
331
- event.stopPropagation();
332
- if (!(showRowHeaders || showColHeaders)) {
333
- if (!isValidElement(element) && !(hasClass(element, 'current') && hasClass(element, 'wtBorder'))) {
334
- return;
335
- }
330
+ if (this.menu) {
331
+ this.menu.destroy();
336
332
  }
337
- const offset = getDocumentOffsetByElement(this.menu.container, this.hot.rootDocument);
338
- this.open({
339
- top: event.clientY + offset.top,
340
- left: event.clientX + offset.left
341
- });
342
- }
343
-
344
- /**
345
- * On menu before open listener.
346
- *
347
- * @private
348
- */
349
- onMenuBeforeOpen() {
350
- this.hot.runHooks('beforeContextMenuShow', this);
333
+ super.destroy();
351
334
  }
335
+ }
336
+ function _onAfterOnCellContextMenu2(event) {
337
+ const settings = this.hot.getSettings();
338
+ const showRowHeaders = settings.rowHeaders;
339
+ const showColHeaders = settings.colHeaders;
352
340
 
353
341
  /**
354
- * On menu after open listener.
355
- *
356
342
  * @private
343
+ * @param {HTMLElement} element The element to validate.
344
+ * @returns {boolean}
357
345
  */
358
- onMenuAfterOpen() {
359
- this.hot.runHooks('afterContextMenuShow', this);
346
+ function isValidElement(element) {
347
+ return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD';
360
348
  }
361
-
362
- /**
363
- * On menu after close listener.
364
- *
365
- * @private
366
- */
367
- onMenuAfterClose() {
368
- this.hot.listen();
369
- this.hot.runHooks('afterContextMenuHide', this);
349
+ const element = event.target;
350
+ this.close();
351
+ if (hasClass(element, 'handsontableInput')) {
352
+ return;
370
353
  }
371
-
372
- /**
373
- * Destroys the plugin instance.
374
- */
375
- destroy() {
376
- this.close();
377
- if (this.menu) {
378
- this.menu.destroy();
354
+ event.preventDefault();
355
+ event.stopPropagation();
356
+ if (!(showRowHeaders || showColHeaders)) {
357
+ if (!isValidElement(element) && !(hasClass(element, 'current') && hasClass(element, 'wtBorder'))) {
358
+ return;
379
359
  }
380
- super.destroy();
381
360
  }
361
+ const offset = getDocumentOffsetByElement(this.menu.container, this.hot.rootDocument);
362
+ this.open({
363
+ top: event.clientY + offset.top,
364
+ left: event.clientX + offset.left
365
+ });
366
+ }
367
+ function _onMenuBeforeOpen2() {
368
+ this.hot.runHooks('beforeContextMenuShow', this);
369
+ }
370
+ function _onMenuAfterOpen2() {
371
+ this.hot.runHooks('afterContextMenuShow', this);
372
+ }
373
+ function _onMenuAfterClose2() {
374
+ this.hot.listen();
375
+ this.hot.runHooks('afterContextMenuHide', this);
382
376
  }
383
377
  ContextMenu.SEPARATOR = {
384
378
  name: SEPARATOR
@@ -2,9 +2,13 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.array.push.js");
5
+ require("core-js/modules/es.error.cause.js");
5
6
  var _object = require("../../helpers/object");
6
7
  var _array = require("../../helpers/array");
7
8
  var _predefinedItems = require("./predefinedItems");
9
+ 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; }
10
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
11
+ 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); }
8
12
  /**
9
13
  * Predefined items class factory for menu items.
10
14
  *
@@ -14,8 +18,19 @@ var _predefinedItems = require("./predefinedItems");
14
18
  class ItemsFactory {
15
19
  constructor(hotInstance) {
16
20
  let orderPattern = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
21
+ /**
22
+ * @type {Core}
23
+ */
24
+ _defineProperty(this, "hot", void 0);
25
+ /**
26
+ * @type {object}
27
+ */
28
+ _defineProperty(this, "predefinedItems", (0, _predefinedItems.predefinedItems)());
29
+ /**
30
+ * @type {Array}
31
+ */
32
+ _defineProperty(this, "defaultOrderPattern", void 0);
17
33
  this.hot = hotInstance;
18
- this.predefinedItems = (0, _predefinedItems.predefinedItems)();
19
34
  this.defaultOrderPattern = orderPattern;
20
35
  }
21
36
 
@@ -35,7 +50,7 @@ class ItemsFactory {
35
50
 
36
51
  // Menu item added as a property to array
37
52
  } else if (isNaN(parseInt(key, 10))) {
38
- value.key = value.key === void 0 ? key : value.key;
53
+ value.key = value.key === undefined ? key : value.key;
39
54
  items[key] = value;
40
55
  menuItemKey = value.key;
41
56
  } else {
@@ -91,7 +106,7 @@ function getItems() {
91
106
  name: item
92
107
  };
93
108
  }
94
- if (item.key === void 0) {
109
+ if (item.key === undefined) {
95
110
  item.key = key;
96
111
  }
97
112
  result.push(item);
@@ -113,7 +128,7 @@ function getItems() {
113
128
  if ((0, _object.isObject)(name)) {
114
129
  (0, _object.extend)(item, name);
115
130
  }
116
- if (item.key === void 0) {
131
+ if (item.key === undefined) {
117
132
  item.key = key;
118
133
  }
119
134
  result.push(item);
@@ -1,4 +1,8 @@
1
1
  import "core-js/modules/es.array.push.js";
2
+ import "core-js/modules/es.error.cause.js";
3
+ 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; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
+ 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); }
2
6
  import { objectEach, isObject, extend } from "../../helpers/object.mjs";
3
7
  import { arrayEach } from "../../helpers/array.mjs";
4
8
  import { SEPARATOR, ITEMS, predefinedItems } from "./predefinedItems/index.mjs";
@@ -11,8 +15,19 @@ import { SEPARATOR, ITEMS, predefinedItems } from "./predefinedItems/index.mjs";
11
15
  export class ItemsFactory {
12
16
  constructor(hotInstance) {
13
17
  let orderPattern = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
18
+ /**
19
+ * @type {Core}
20
+ */
21
+ _defineProperty(this, "hot", void 0);
22
+ /**
23
+ * @type {object}
24
+ */
25
+ _defineProperty(this, "predefinedItems", predefinedItems());
26
+ /**
27
+ * @type {Array}
28
+ */
29
+ _defineProperty(this, "defaultOrderPattern", void 0);
14
30
  this.hot = hotInstance;
15
- this.predefinedItems = predefinedItems();
16
31
  this.defaultOrderPattern = orderPattern;
17
32
  }
18
33
 
@@ -32,7 +47,7 @@ export class ItemsFactory {
32
47
 
33
48
  // Menu item added as a property to array
34
49
  } else if (isNaN(parseInt(key, 10))) {
35
- value.key = value.key === void 0 ? key : value.key;
50
+ value.key = value.key === undefined ? key : value.key;
36
51
  items[key] = value;
37
52
  menuItemKey = value.key;
38
53
  } else {
@@ -87,7 +102,7 @@ function getItems() {
87
102
  name: item
88
103
  };
89
104
  }
90
- if (item.key === void 0) {
105
+ if (item.key === undefined) {
91
106
  item.key = key;
92
107
  }
93
108
  result.push(item);
@@ -109,7 +124,7 @@ function getItems() {
109
124
  if (isObject(name)) {
110
125
  extend(item, name);
111
126
  }
112
- if (item.key === void 0) {
127
+ if (item.key === undefined) {
113
128
  item.key = key;
114
129
  }
115
130
  result.push(item);