handsontable 12.0.1 → 12.1.0

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 (301) hide show
  1. package/3rdparty/walkontable/src/core/clone.js +2 -2
  2. package/3rdparty/walkontable/src/core/clone.mjs +2 -2
  3. package/3rdparty/walkontable/src/core/core.js +2 -2
  4. package/3rdparty/walkontable/src/core/core.mjs +2 -2
  5. package/3rdparty/walkontable/src/overlay/bottom.js +20 -14
  6. package/3rdparty/walkontable/src/overlay/bottom.mjs +20 -14
  7. package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.js +14 -8
  8. package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.mjs +14 -8
  9. package/3rdparty/walkontable/src/overlay/inlineStart.js +14 -5
  10. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +14 -5
  11. package/3rdparty/walkontable/src/overlay/top.js +12 -3
  12. package/3rdparty/walkontable/src/overlay/top.mjs +12 -3
  13. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +3 -3
  14. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +3 -3
  15. package/3rdparty/walkontable/src/overlays.js +2 -2
  16. package/3rdparty/walkontable/src/overlays.mjs +2 -2
  17. package/3rdparty/walkontable/src/renderer/cells.js +2 -2
  18. package/3rdparty/walkontable/src/renderer/cells.mjs +2 -2
  19. package/3rdparty/walkontable/src/renderer/colGroup.js +2 -2
  20. package/3rdparty/walkontable/src/renderer/colGroup.mjs +2 -2
  21. package/3rdparty/walkontable/src/renderer/columnHeaders.js +2 -2
  22. package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +2 -2
  23. package/3rdparty/walkontable/src/renderer/rowHeaders.js +2 -2
  24. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +2 -2
  25. package/3rdparty/walkontable/src/renderer/rows.js +2 -2
  26. package/3rdparty/walkontable/src/renderer/rows.mjs +2 -2
  27. package/3rdparty/walkontable/src/scroll.js +111 -63
  28. package/3rdparty/walkontable/src/scroll.mjs +110 -63
  29. package/3rdparty/walkontable/src/table/bottom.js +2 -2
  30. package/3rdparty/walkontable/src/table/bottom.mjs +2 -2
  31. package/3rdparty/walkontable/src/table/bottomInlineStartCorner.js +2 -2
  32. package/3rdparty/walkontable/src/table/bottomInlineStartCorner.mjs +2 -2
  33. package/3rdparty/walkontable/src/table/inlineStart.js +2 -2
  34. package/3rdparty/walkontable/src/table/inlineStart.mjs +2 -2
  35. package/3rdparty/walkontable/src/table/master.js +2 -2
  36. package/3rdparty/walkontable/src/table/master.mjs +2 -2
  37. package/3rdparty/walkontable/src/table/top.js +2 -2
  38. package/3rdparty/walkontable/src/table/top.mjs +2 -2
  39. package/3rdparty/walkontable/src/table/topInlineStartCorner.js +2 -2
  40. package/3rdparty/walkontable/src/table/topInlineStartCorner.mjs +2 -2
  41. package/3rdparty/walkontable/src/utils/orderView/sharedView.js +2 -2
  42. package/3rdparty/walkontable/src/utils/orderView/sharedView.mjs +2 -2
  43. package/3rdparty/walkontable/src/viewport.js +14 -22
  44. package/3rdparty/walkontable/src/viewport.mjs +14 -22
  45. package/CHANGELOG.md +32 -0
  46. package/LICENSE.txt +1 -1
  47. package/base.js +2 -2
  48. package/base.mjs +2 -2
  49. package/core.js +38 -30
  50. package/core.mjs +38 -30
  51. package/dataMap/metaManager/metaSchema.js +165 -168
  52. package/dataMap/metaManager/metaSchema.mjs +165 -168
  53. package/dist/handsontable.css +18 -18
  54. package/dist/handsontable.full.css +19 -29
  55. package/dist/handsontable.full.js +13389 -12669
  56. package/dist/handsontable.full.min.css +5 -5
  57. package/dist/handsontable.full.min.js +134 -135
  58. package/dist/handsontable.js +3961 -3794
  59. package/dist/handsontable.min.css +4 -4
  60. package/dist/handsontable.min.js +4 -4
  61. package/dist/languages/all.js +97 -33
  62. package/dist/languages/all.min.js +1 -1
  63. package/dist/languages/cs-CZ.js +167 -0
  64. package/dist/languages/cs-CZ.min.js +1 -0
  65. package/dist/languages/de-CH.js +3 -2
  66. package/dist/languages/de-CH.min.js +1 -1
  67. package/dist/languages/de-DE.js +3 -2
  68. package/dist/languages/de-DE.min.js +1 -1
  69. package/dist/languages/en-US.js +3 -2
  70. package/dist/languages/en-US.min.js +1 -1
  71. package/dist/languages/es-MX.js +3 -2
  72. package/dist/languages/es-MX.min.js +1 -1
  73. package/dist/languages/fr-FR.js +3 -2
  74. package/dist/languages/fr-FR.min.js +1 -1
  75. package/dist/languages/it-IT.js +3 -2
  76. package/dist/languages/it-IT.min.js +1 -1
  77. package/dist/languages/ja-JP.js +36 -39
  78. package/dist/languages/ja-JP.min.js +1 -1
  79. package/dist/languages/ko-KR.js +2 -2
  80. package/dist/languages/ko-KR.min.js +1 -1
  81. package/dist/languages/lv-LV.js +2 -2
  82. package/dist/languages/lv-LV.min.js +1 -1
  83. package/dist/languages/nb-NO.js +2 -2
  84. package/dist/languages/nb-NO.min.js +1 -1
  85. package/dist/languages/nl-NL.js +2 -2
  86. package/dist/languages/nl-NL.min.js +1 -1
  87. package/dist/languages/pl-PL.js +2 -2
  88. package/dist/languages/pl-PL.min.js +1 -1
  89. package/dist/languages/pt-BR.js +2 -2
  90. package/dist/languages/pt-BR.min.js +1 -1
  91. package/dist/languages/ru-RU.js +2 -2
  92. package/dist/languages/ru-RU.min.js +1 -1
  93. package/dist/languages/sr-SP.js +171 -0
  94. package/dist/languages/sr-SP.min.js +1 -0
  95. package/dist/languages/zh-CN.js +24 -24
  96. package/dist/languages/zh-CN.min.js +1 -1
  97. package/dist/languages/zh-TW.js +2 -2
  98. package/dist/languages/zh-TW.min.js +1 -1
  99. package/editors/autocompleteEditor/autocompleteEditor.js +13 -14
  100. package/editors/autocompleteEditor/autocompleteEditor.mjs +13 -14
  101. package/editors/baseEditor/baseEditor.js +2 -2
  102. package/editors/baseEditor/baseEditor.mjs +2 -2
  103. package/editors/checkboxEditor/checkboxEditor.js +2 -2
  104. package/editors/checkboxEditor/checkboxEditor.mjs +2 -2
  105. package/editors/dateEditor/dateEditor.js +3 -3
  106. package/editors/dateEditor/dateEditor.mjs +3 -3
  107. package/editors/dropdownEditor/dropdownEditor.js +3 -3
  108. package/editors/dropdownEditor/dropdownEditor.mjs +3 -3
  109. package/editors/handsontableEditor/handsontableEditor.js +3 -3
  110. package/editors/handsontableEditor/handsontableEditor.mjs +3 -3
  111. package/editors/numericEditor/numericEditor.js +2 -2
  112. package/editors/numericEditor/numericEditor.mjs +2 -2
  113. package/editors/passwordEditor/passwordEditor.js +3 -3
  114. package/editors/passwordEditor/passwordEditor.mjs +3 -3
  115. package/editors/selectEditor/selectEditor.js +3 -3
  116. package/editors/selectEditor/selectEditor.mjs +3 -3
  117. package/editors/textEditor/textEditor.js +3 -3
  118. package/editors/textEditor/textEditor.mjs +3 -3
  119. package/editors/timeEditor/timeEditor.js +3 -3
  120. package/editors/timeEditor/timeEditor.mjs +3 -3
  121. package/helpers/mixed.js +2 -2
  122. package/helpers/mixed.mjs +2 -2
  123. package/i18n/languages/cs-CZ.js +40 -0
  124. package/i18n/languages/cs-CZ.mjs +16 -0
  125. package/i18n/languages/index.js +8 -0
  126. package/i18n/languages/index.mjs +3 -1
  127. package/i18n/languages/sr-SP.js +40 -0
  128. package/i18n/languages/sr-SP.mjs +16 -0
  129. package/languages/all.js +97 -33
  130. package/languages/cs-CZ.js +167 -0
  131. package/languages/cs-CZ.mjs +18 -0
  132. package/languages/de-CH.js +3 -2
  133. package/languages/de-DE.js +3 -2
  134. package/languages/en-US.js +3 -2
  135. package/languages/es-MX.js +3 -2
  136. package/languages/fr-FR.js +3 -2
  137. package/languages/index.js +97 -33
  138. package/languages/index.mjs +3 -1
  139. package/languages/it-IT.js +3 -2
  140. package/languages/ja-JP.js +36 -39
  141. package/languages/ko-KR.js +2 -2
  142. package/languages/lv-LV.js +2 -2
  143. package/languages/nb-NO.js +2 -2
  144. package/languages/nl-NL.js +2 -2
  145. package/languages/pl-PL.js +2 -2
  146. package/languages/pt-BR.js +2 -2
  147. package/languages/ru-RU.js +2 -2
  148. package/languages/sr-SP.js +171 -0
  149. package/languages/sr-SP.mjs +18 -0
  150. package/languages/zh-CN.js +24 -24
  151. package/languages/zh-TW.js +2 -2
  152. package/package.json +22 -2
  153. package/pluginHooks.js +46 -8
  154. package/pluginHooks.mjs +46 -8
  155. package/plugins/autoColumnSize/autoColumnSize.js +3 -3
  156. package/plugins/autoColumnSize/autoColumnSize.mjs +3 -3
  157. package/plugins/autoRowSize/autoRowSize.js +3 -3
  158. package/plugins/autoRowSize/autoRowSize.mjs +3 -3
  159. package/plugins/autofill/autofill.js +3 -3
  160. package/plugins/autofill/autofill.mjs +3 -3
  161. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +3 -3
  162. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +3 -3
  163. package/plugins/bindRowsWithHeaders/maps/looseBindsMap.js +3 -3
  164. package/plugins/bindRowsWithHeaders/maps/looseBindsMap.mjs +3 -3
  165. package/plugins/bindRowsWithHeaders/maps/strictBindsMap.js +3 -3
  166. package/plugins/bindRowsWithHeaders/maps/strictBindsMap.mjs +3 -3
  167. package/plugins/collapsibleColumns/collapsibleColumns.js +3 -3
  168. package/plugins/collapsibleColumns/collapsibleColumns.mjs +3 -3
  169. package/plugins/columnSorting/columnSorting.js +3 -3
  170. package/plugins/columnSorting/columnSorting.mjs +3 -3
  171. package/plugins/columnSummary/columnSummary.js +3 -3
  172. package/plugins/columnSummary/columnSummary.mjs +3 -3
  173. package/plugins/comments/commentEditor.js +2 -2
  174. package/plugins/comments/commentEditor.mjs +2 -2
  175. package/plugins/comments/comments.js +39 -31
  176. package/plugins/comments/comments.mjs +40 -32
  177. package/plugins/contextMenu/contextMenu.js +3 -3
  178. package/plugins/contextMenu/contextMenu.mjs +3 -3
  179. package/plugins/copyPaste/copyPaste.js +6 -6
  180. package/plugins/copyPaste/copyPaste.mjs +6 -6
  181. package/plugins/customBorders/customBorders.js +3 -3
  182. package/plugins/customBorders/customBorders.mjs +3 -3
  183. package/plugins/dragToScroll/dragToScroll.js +3 -3
  184. package/plugins/dragToScroll/dragToScroll.mjs +3 -3
  185. package/plugins/dropdownMenu/dropdownMenu.js +5 -4
  186. package/plugins/dropdownMenu/dropdownMenu.mjs +5 -4
  187. package/plugins/exportFile/exportFile.js +2 -2
  188. package/plugins/exportFile/exportFile.mjs +2 -2
  189. package/plugins/exportFile/types/csv.js +2 -2
  190. package/plugins/exportFile/types/csv.mjs +2 -2
  191. package/plugins/filters/component/actionBar.js +2 -2
  192. package/plugins/filters/component/actionBar.mjs +2 -2
  193. package/plugins/filters/component/condition.js +3 -3
  194. package/plugins/filters/component/condition.mjs +3 -3
  195. package/plugins/filters/component/operators.js +2 -2
  196. package/plugins/filters/component/operators.mjs +2 -2
  197. package/plugins/filters/component/value.js +3 -3
  198. package/plugins/filters/component/value.mjs +3 -3
  199. package/plugins/filters/filters.js +3 -3
  200. package/plugins/filters/filters.mjs +3 -3
  201. package/plugins/filters/ui/input.js +3 -3
  202. package/plugins/filters/ui/input.mjs +3 -3
  203. package/plugins/filters/ui/link.js +3 -3
  204. package/plugins/filters/ui/link.mjs +3 -3
  205. package/plugins/filters/ui/multipleSelect.js +3 -3
  206. package/plugins/filters/ui/multipleSelect.mjs +3 -3
  207. package/plugins/filters/ui/radioInput.js +3 -3
  208. package/plugins/filters/ui/radioInput.mjs +3 -3
  209. package/plugins/filters/ui/select.js +3 -3
  210. package/plugins/filters/ui/select.mjs +3 -3
  211. package/plugins/formulas/formulas.js +3 -3
  212. package/plugins/formulas/formulas.mjs +3 -3
  213. package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +2 -4
  214. package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +2 -4
  215. package/plugins/hiddenColumns/contextMenuItem/showColumn.js +3 -3
  216. package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +3 -3
  217. package/plugins/hiddenColumns/hiddenColumns.js +3 -3
  218. package/plugins/hiddenColumns/hiddenColumns.mjs +3 -3
  219. package/plugins/hiddenRows/contextMenuItem/hideRow.js +2 -4
  220. package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +2 -4
  221. package/plugins/hiddenRows/contextMenuItem/showRow.js +3 -3
  222. package/plugins/hiddenRows/contextMenuItem/showRow.mjs +3 -3
  223. package/plugins/hiddenRows/hiddenRows.js +3 -3
  224. package/plugins/hiddenRows/hiddenRows.mjs +3 -3
  225. package/plugins/manualColumnFreeze/manualColumnFreeze.js +46 -20
  226. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +41 -20
  227. package/plugins/manualColumnMove/manualColumnMove.js +7 -18
  228. package/plugins/manualColumnMove/manualColumnMove.mjs +7 -18
  229. package/plugins/manualColumnMove/ui/backlight.js +3 -3
  230. package/plugins/manualColumnMove/ui/backlight.mjs +3 -3
  231. package/plugins/manualColumnMove/ui/guideline.js +3 -3
  232. package/plugins/manualColumnMove/ui/guideline.mjs +3 -3
  233. package/plugins/manualColumnResize/manualColumnResize.js +3 -3
  234. package/plugins/manualColumnResize/manualColumnResize.mjs +3 -3
  235. package/plugins/manualRowMove/manualRowMove.js +11 -29
  236. package/plugins/manualRowMove/manualRowMove.mjs +11 -29
  237. package/plugins/manualRowMove/ui/backlight.js +3 -3
  238. package/plugins/manualRowMove/ui/backlight.mjs +3 -3
  239. package/plugins/manualRowMove/ui/guideline.js +3 -3
  240. package/plugins/manualRowMove/ui/guideline.mjs +3 -3
  241. package/plugins/manualRowResize/manualRowResize.js +3 -3
  242. package/plugins/manualRowResize/manualRowResize.mjs +3 -3
  243. package/plugins/mergeCells/cellsCollection.js +3 -3
  244. package/plugins/mergeCells/cellsCollection.mjs +3 -3
  245. package/plugins/mergeCells/mergeCells.js +15 -15
  246. package/plugins/mergeCells/mergeCells.mjs +15 -15
  247. package/plugins/multiColumnSorting/multiColumnSorting.js +3 -3
  248. package/plugins/multiColumnSorting/multiColumnSorting.mjs +3 -3
  249. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +3 -3
  250. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +3 -3
  251. package/plugins/nestedHeaders/nestedHeaders.js +10 -6
  252. package/plugins/nestedHeaders/nestedHeaders.mjs +10 -6
  253. package/plugins/nestedHeaders/stateManager/utils.js +3 -4
  254. package/plugins/nestedHeaders/stateManager/utils.mjs +3 -4
  255. package/plugins/nestedHeaders/utils/ghostTable.js +94 -56
  256. package/plugins/nestedHeaders/utils/ghostTable.mjs +94 -56
  257. package/plugins/nestedRows/nestedRows.js +3 -3
  258. package/plugins/nestedRows/nestedRows.mjs +3 -3
  259. package/plugins/nestedRows/ui/collapsing.js +2 -2
  260. package/plugins/nestedRows/ui/collapsing.mjs +2 -2
  261. package/plugins/nestedRows/ui/contextMenu.js +2 -2
  262. package/plugins/nestedRows/ui/contextMenu.mjs +2 -2
  263. package/plugins/nestedRows/ui/headers.js +2 -2
  264. package/plugins/nestedRows/ui/headers.mjs +2 -2
  265. package/plugins/persistentState/persistentState.js +3 -3
  266. package/plugins/persistentState/persistentState.mjs +3 -3
  267. package/plugins/search/search.js +3 -3
  268. package/plugins/search/search.mjs +3 -3
  269. package/plugins/touchScroll/touchScroll.js +3 -3
  270. package/plugins/touchScroll/touchScroll.mjs +3 -3
  271. package/plugins/trimRows/trimRows.js +3 -3
  272. package/plugins/trimRows/trimRows.mjs +3 -3
  273. package/plugins/undoRedo/undoRedo.js +2 -2
  274. package/plugins/undoRedo/undoRedo.mjs +2 -2
  275. package/selection/highlight/visualSelection.js +83 -210
  276. package/selection/highlight/visualSelection.mjs +79 -202
  277. package/selection/selection.js +9 -3
  278. package/selection/selection.mjs +9 -3
  279. package/shortcuts/context.js +1 -1
  280. package/shortcuts/context.mjs +1 -1
  281. package/shortcuts/manager.js +3 -1
  282. package/shortcuts/manager.mjs +3 -1
  283. package/shortcuts/recorder.js +11 -2
  284. package/shortcuts/recorder.mjs +11 -2
  285. package/tableView.js +27 -5
  286. package/tableView.mjs +27 -5
  287. package/translations/indexMapper.d.ts +3 -1
  288. package/translations/indexMapper.js +88 -10
  289. package/translations/indexMapper.mjs +90 -19
  290. package/translations/mapCollections/aggregatedCollection.js +2 -2
  291. package/translations/mapCollections/aggregatedCollection.mjs +2 -2
  292. package/translations/maps/hidingMap.js +2 -2
  293. package/translations/maps/hidingMap.mjs +2 -2
  294. package/translations/maps/indexesSequence.js +3 -3
  295. package/translations/maps/indexesSequence.mjs +3 -3
  296. package/translations/maps/linkedPhysicalIndexToValueMap.js +3 -3
  297. package/translations/maps/linkedPhysicalIndexToValueMap.mjs +3 -3
  298. package/translations/maps/physicalIndexToValueMap.js +3 -3
  299. package/translations/maps/physicalIndexToValueMap.mjs +3 -3
  300. package/translations/maps/trimmingMap.js +2 -2
  301. package/translations/maps/trimmingMap.mjs +2 -2
@@ -12,22 +12,6 @@ import "core-js/modules/es.symbol.iterator.js";
12
12
  import "core-js/modules/es.array.iterator.js";
13
13
  import "core-js/modules/es.string.iterator.js";
14
14
  import "core-js/modules/web.dom-collections.iterator.js";
15
- import "core-js/modules/es.array.slice.js";
16
- import "core-js/modules/es.function.name.js";
17
- import "core-js/modules/es.array.from.js";
18
- import "core-js/modules/es.regexp.exec.js";
19
-
20
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
21
-
22
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
23
-
24
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
25
-
26
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
27
-
28
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
29
-
30
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
15
 
32
16
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33
17
 
@@ -35,13 +19,13 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
35
19
 
36
20
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
37
21
 
38
- function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
22
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
39
23
 
40
24
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
41
25
 
42
26
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
43
27
 
44
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
28
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
45
29
 
46
30
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
47
31
 
@@ -51,7 +35,9 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
51
35
 
52
36
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
53
37
 
54
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
38
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
+
40
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
55
41
 
56
42
  import { Selection } from "./../../3rdparty/walkontable/src/index.mjs";
57
43
 
@@ -60,17 +46,19 @@ var VisualSelection = /*#__PURE__*/function (_Selection) {
60
46
 
61
47
  var _super = _createSuper(VisualSelection);
62
48
 
49
+ /**
50
+ * Range of selection visually. Visual representation may have representation in a rendered selection.
51
+ *
52
+ * @type {null|CellRange}
53
+ */
63
54
  function VisualSelection(settings, visualCellRange) {
64
55
  var _this;
65
56
 
66
57
  _classCallCheck(this, VisualSelection);
67
58
 
68
59
  _this = _super.call(this, settings, null);
69
- /**
70
- * Range of selection visually. Visual representation may have representation in a rendered selection.
71
- *
72
- * @type {null|CellRange}
73
- */
60
+
61
+ _defineProperty(_assertThisInitialized(_this), "visualCellRange", null);
74
62
 
75
63
  _this.visualCellRange = visualCellRange || null;
76
64
 
@@ -110,146 +98,95 @@ var VisualSelection = /*#__PURE__*/function (_Selection) {
110
98
  return _get(_getPrototypeOf(VisualSelection.prototype), "clear", this).call(this);
111
99
  }
112
100
  /**
113
- * Search for the first visible coordinates in the range as range may start and/or end with the hidden index.
101
+ * Trims the passed cell range object by removing all coordinates that points to the hidden rows
102
+ * or columns. The result is a new cell range object that points only to the visible indexes or `null`.
114
103
  *
115
104
  * @private
116
- * @param {CellCoords} startCoords Visual start coordinates for the range. Starting point for finding destination coordinates
117
- * with visible coordinates (we are going from the starting coordinates to the end coordinates until the criteria are met).
118
- * @param {CellCoords} endCoords Visual end coordinates for the range.
119
- * @param {number} incrementByRow We are searching for a next visible rows by increasing (to be precise, or decreasing) indexes.
120
- * This variable represent indexes shift. We are looking for an index:
121
- * - for rows: from the left to the right (increasing indexes, then variable should have value 1) or
122
- * other way around (decreasing indexes, then variable should have the value -1)
123
- * - for columns: from the top to the bottom (increasing indexes, then variable should have value 1)
124
- * or other way around (decreasing indexes, then variable should have the value -1).
125
- * @param {number} incrementByColumn As above, just indexes shift for columns.
126
- * @returns {null|CellCoords} Visual cell coordinates.
105
+ * @param {CellRange} cellRange Cells range object to be trimmed.
106
+ * @returns {CellRange} Visual non-hidden cells range coordinates.
127
107
  */
128
108
 
129
109
  }, {
130
- key: "findVisibleCoordsInRange",
131
- value: function findVisibleCoordsInRange(startCoords, endCoords, incrementByRow) {
132
- var incrementByColumn = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : incrementByRow;
133
- var nextVisibleRow = this.findVisibleCoordsInRowsRange(startCoords.row, endCoords.row, incrementByRow); // There are no more visual rows in the range.
134
-
135
- if (nextVisibleRow === null) {
110
+ key: "trimToVisibleCellsRangeOnly",
111
+ value: function trimToVisibleCellsRangeOnly(_ref) {
112
+ var from = _ref.from,
113
+ to = _ref.to;
114
+ var visibleFromCoords = this.getNearestNotHiddenCoords(from, 1);
115
+ var visibleToCoords = this.getNearestNotHiddenCoords(to, -1);
116
+
117
+ if (visibleFromCoords === null || visibleToCoords === null) {
136
118
  return null;
137
119
  }
138
120
 
139
- var nextVisibleColumn = this.findVisibleCoordsInColumnsRange(startCoords.col, endCoords.col, incrementByColumn); // There are no more visual columns in the range.
121
+ if (visibleFromCoords.row > visibleToCoords.row || visibleFromCoords.col > visibleToCoords.col) {
122
+ var isHeaderTypeSelection = this.settings.type === 'header' || this.settings.type === 'active-header';
140
123
 
141
- if (nextVisibleColumn === null) {
142
- return null;
124
+ if (!isHeaderTypeSelection) {
125
+ return null;
126
+ }
127
+
128
+ visibleFromCoords = from;
129
+ visibleToCoords = to;
143
130
  }
144
131
 
145
- return this.settings.createCellCoords(nextVisibleRow, nextVisibleColumn);
132
+ return this.settings.createCellRange(visibleFromCoords, visibleFromCoords, visibleToCoords);
146
133
  }
147
134
  /**
148
- * Searches the nearest visible row index, which is not hidden (is renderable).
135
+ * Gets nearest coordinates that points to the visible row and column indexes. If there are no visible
136
+ * rows and/or columns the `null` value is returned.
149
137
  *
150
138
  * @private
151
- * @param {CellCoords} startVisibleRow Visual row index which starts the range. Starting point for finding
152
- * destination coordinates with visible coordinates (we are going from the starting coordinates to the end
153
- * coordinates until the criteria are met).
154
- * @param {CellCoords} endVisibleRow Visual row index which ends the range.
155
- * @param {number} incrementBy We are searching for a next visible rows by increasing (to be precise, or decreasing)
156
- * indexes. This variable represent indexes shift. From the left to the right (increasing indexes, then variable
157
- * should have value 1) or other way around (decreasing indexes, then variable should have the value -1).
158
- * @returns {number|null} The visual row index.
139
+ * @param {CellCoords} coords The coords object as starting point for finding the nearest visible coordinates.
140
+ * @param {1|-1} rowSearchDirection The search direction. For value 1, it means searching from top to bottom for
141
+ * rows and from left to right for columns. For -1, it is the other way around.
142
+ * @param {1|-1} columnSearchDirection The same as above but for rows.
143
+ * @returns {CellCoords|null} Visual cell coordinates.
159
144
  */
160
145
 
161
146
  }, {
162
- key: "findVisibleCoordsInRowsRange",
163
- value: function findVisibleCoordsInRowsRange(startVisibleRow, endVisibleRow, incrementBy) {
164
- var _this$settings$visual = this.settings.visualToRenderableCoords({
165
- row: startVisibleRow,
166
- col: -1
167
- }),
168
- startRowRenderable = _this$settings$visual.row; // There are no more visual rows in the range.
169
-
147
+ key: "getNearestNotHiddenCoords",
148
+ value: function getNearestNotHiddenCoords(coords, rowSearchDirection) {
149
+ var columnSearchDirection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : rowSearchDirection;
150
+ var nextVisibleRow = this.getNearestNotHiddenIndex(this.settings.rowIndexMapper(), coords.row, rowSearchDirection); // There are no more visual rows in the range.
170
151
 
171
- if (endVisibleRow === startVisibleRow && startRowRenderable === null) {
152
+ if (nextVisibleRow === null) {
172
153
  return null;
173
- } // We are looking for a next visible row in the range.
174
-
154
+ }
175
155
 
176
- if (startRowRenderable === null) {
177
- return this.findVisibleCoordsInRowsRange(startVisibleRow + incrementBy, endVisibleRow, incrementBy);
178
- } // We found visible row index in the range.
156
+ var nextVisibleColumn = this.getNearestNotHiddenIndex(this.settings.columnIndexMapper(), coords.col, columnSearchDirection); // There are no more visual columns in the range.
179
157
 
158
+ if (nextVisibleColumn === null) {
159
+ return null;
160
+ }
180
161
 
181
- return startVisibleRow;
162
+ return this.settings.createCellCoords(nextVisibleRow, nextVisibleColumn);
182
163
  }
183
164
  /**
184
- * Searches the nearest visible column index, which is not hidden (is renderable).
165
+ * Gets nearest visual index. If there are no visible rows or columns the `null` value is returned.
185
166
  *
186
167
  * @private
187
- * @param {CellCoords} startVisibleColumn Visual column index which starts the range. Starting point for finding
188
- * destination coordinates with visible coordinates (we are going from the starting coordinates to the end
189
- * coordinates until the criteria are met).
190
- * @param {CellCoords} endVisibleColumn Visual column index which ends the range.
191
- * @param {number} incrementBy We are searching for a next visible columns by increasing (to be precise, or decreasing)
192
- * indexes. This variable represent indexes shift. From the top to the bottom (increasing indexes, then variable
193
- * should have value 1) or other way around (decreasing indexes, then variable should have the value -1).
194
- * @returns {number|null} The visual column index.
168
+ * @param {IndexMapper} indexMapper The IndexMapper instance for specific axis.
169
+ * @param {number} visualIndex The index as starting point for finding the nearest visible index.
170
+ * @param {1|-1} searchDirection The search direction. For value 1, it means searching from top to bottom for
171
+ * rows and from left to right for columns. For -1, it is the other way around.
172
+ * @returns {number|null} Visual row/column index.
195
173
  */
196
174
 
197
175
  }, {
198
- key: "findVisibleCoordsInColumnsRange",
199
- value: function findVisibleCoordsInColumnsRange(startVisibleColumn, endVisibleColumn, incrementBy) {
200
- var _this$settings$visual2 = this.settings.visualToRenderableCoords({
201
- row: -1,
202
- col: startVisibleColumn
203
- }),
204
- startColumnRenderable = _this$settings$visual2.col; // There are no more visual columns in the range.
205
-
206
-
207
- if (endVisibleColumn === startVisibleColumn && startColumnRenderable === null) {
208
- return null;
209
- } // We are looking for a next visible column in the range.
210
-
211
-
212
- if (startColumnRenderable === null) {
213
- return this.findVisibleCoordsInColumnsRange(startVisibleColumn + incrementBy, endVisibleColumn, incrementBy);
214
- } // We found visible column index in the range.
176
+ key: "getNearestNotHiddenIndex",
177
+ value: function getNearestNotHiddenIndex(indexMapper, visualIndex, searchDirection) {
178
+ if (visualIndex < 0) {
179
+ return visualIndex;
180
+ }
215
181
 
182
+ var nearestVisualIndex = indexMapper.getNearestNotHiddenIndex(visualIndex, searchDirection);
183
+ var isHeaderSelectionType = this.settings.type === 'header' || this.settings.type === 'active-header';
216
184
 
217
- return startVisibleColumn;
218
- }
219
- /**
220
- * Searches the nearest visible column and row index, which is not hidden (is renderable). If one
221
- * of the axes' range is entirely hidden, then created CellCoords object will hold the `null` value
222
- * under a specific axis. For example, when we select the hidden column, then the calculated `col`
223
- * prop will be `null`. In that case, rows are calculated further (regardless of the column result)
224
- * to make rows header highlightable.
225
- *
226
- * @private
227
- * @param {CellCoords} visualFromCoords Visual start coordinates for the range. Starting point for finding destination coordinates
228
- * with visible coordinates (we are going from the starting coordinates to the end coordinates until the criteria are met).
229
- * @param {CellCoords} visualToCoords Visual end coordinates for the range.
230
- * @param {number} incrementByRow We are searching for a next visible rows by increasing (to be precise, or decreasing) indexes.
231
- * This variable represent indexes shift. We are looking for an index:
232
- * - for rows: from the left to the right (increasing indexes, then variable should have value 1) or
233
- * other way around (decreasing indexes, then variable should have the value -1)
234
- * - for columns: from the top to the bottom (increasing indexes, then variable should have value 1)
235
- * or other way around (decreasing indexes, then variable should have the value -1).
236
- * @param {number} incrementByColumn As above, just indexes shift for columns.
237
- * @returns {CellCoords[]|null} Visual cell coordinates.
238
- */
239
-
240
- }, {
241
- key: "findVisibleHeaderRange",
242
- value: function findVisibleHeaderRange(visualFromCoords, visualToCoords, incrementByRow, incrementByColumn) {
243
- var fromRangeVisualRow = this.findVisibleCoordsInRowsRange(visualFromCoords.row, visualToCoords.row, incrementByRow);
244
- var toRangeVisualRow = this.findVisibleCoordsInRowsRange(visualToCoords.row, visualFromCoords.row, -incrementByRow);
245
- var fromRangeVisualColumn = this.findVisibleCoordsInColumnsRange(visualFromCoords.col, visualToCoords.col, incrementByColumn);
246
- var toRangeVisualColumn = this.findVisibleCoordsInColumnsRange(visualToCoords.col, visualFromCoords.col, -incrementByColumn); // All rows and columns ranges are hidden.
247
-
248
- if (fromRangeVisualRow === null && toRangeVisualRow === null && fromRangeVisualColumn === null && toRangeVisualColumn === null) {
249
- return null;
185
+ if (isHeaderSelectionType && nearestVisualIndex === null) {
186
+ return -1;
250
187
  }
251
188
 
252
- return [this.settings.createCellCoords(fromRangeVisualRow, fromRangeVisualColumn), this.settings.createCellCoords(toRangeVisualRow, toRangeVisualColumn)];
189
+ return nearestVisualIndex;
253
190
  }
254
191
  /**
255
192
  * Override internally stored visual indexes added by the Selection's `add` function. It should be executed
@@ -266,39 +203,18 @@ var VisualSelection = /*#__PURE__*/function (_Selection) {
266
203
  return this;
267
204
  }
268
205
 
269
- var _this$visualCellRange = this.visualCellRange,
270
- visualFromCoords = _this$visualCellRange.from,
271
- visualToCoords = _this$visualCellRange.to; // We may move in two different directions while searching for visible rows and visible columns.
206
+ var trimmedCellRange = this.trimToVisibleCellsRangeOnly(this.visualCellRange); // There is no visual start point (and also visual end point) in the range.
272
207
 
273
- var incrementByRow = this.getRowSearchDirection(this.visualCellRange);
274
- var incrementByColumn = this.getColumnSearchDirection(this.visualCellRange);
275
- var fromRangeVisual = this.findVisibleCoordsInRange(visualFromCoords, visualToCoords, incrementByRow, incrementByColumn);
276
- var toRangeVisual = this.findVisibleCoordsInRange(visualToCoords, visualFromCoords, -incrementByRow, -incrementByColumn); // There is no visual start point (and also visual end point) in the range.
277
- // We are looking for the first visible cell in a broader range.
278
-
279
- if (fromRangeVisual === null || toRangeVisual === null) {
280
- var isHeaderSelectionType = this.settings.type === 'header';
281
- var cellRange = null; // For the "header" selection type, find rows and column indexes, which should be
282
- // highlighted, although one of the axes is completely hidden.
283
-
284
- if (isHeaderSelectionType) {
285
- var _this$findVisibleHead = this.findVisibleHeaderRange(visualFromCoords, visualToCoords, incrementByRow, incrementByColumn),
286
- _this$findVisibleHead2 = _slicedToArray(_this$findVisibleHead, 2),
287
- fromRangeVisualHeader = _this$findVisibleHead2[0],
288
- toRangeVisualHeader = _this$findVisibleHead2[1];
289
-
290
- cellRange = this.createRenderableCellRange(fromRangeVisualHeader, toRangeVisualHeader);
291
- }
292
-
293
- this.cellRange = cellRange;
208
+ if (trimmedCellRange === null) {
209
+ this.cellRange = null;
294
210
  } else {
295
- this.cellRange = this.createRenderableCellRange(fromRangeVisual, toRangeVisual);
211
+ this.cellRange = this.createRenderableCellRange(trimmedCellRange.from, trimmedCellRange.to);
296
212
  }
297
213
 
298
214
  return this;
299
215
  }
300
216
  /**
301
- * Some selection may be a part of broader cell range. This function adjusting coordinates of current selection
217
+ * Some selection may be a part of broader cell range. This function sync coordinates of current selection
302
218
  * and the broader cell range when needed (current selection can't be presented visually).
303
219
  *
304
220
  * @param {CellRange} broaderCellRange Visual range. Actual cell range may be contained in the broader cell range.
@@ -310,16 +226,13 @@ var VisualSelection = /*#__PURE__*/function (_Selection) {
310
226
  */
311
227
 
312
228
  }, {
313
- key: "adjustCoordinates",
314
- value: function adjustCoordinates(broaderCellRange) {
315
- // We may move in two different directions while searching for visible rows and visible columns.
316
- var incrementByRow = this.getRowSearchDirection(broaderCellRange);
317
- var incrementByColumn = this.getColumnSearchDirection(broaderCellRange);
318
- var normFromCoords = broaderCellRange.from.clone().normalize();
319
- var normToCoords = broaderCellRange.to.clone().normalize();
320
- var singleCellRangeVisual = this.findVisibleCoordsInRange(normFromCoords, normToCoords, incrementByRow, incrementByColumn);
321
-
322
- if (singleCellRangeVisual !== null) {
229
+ key: "syncWith",
230
+ value: function syncWith(broaderCellRange) {
231
+ var rowDirection = broaderCellRange.getVerticalDirection() === 'N-S' ? 1 : -1;
232
+ var columnDirection = broaderCellRange.getHorizontalDirection() === 'W-E' ? 1 : -1;
233
+ var singleCellRangeVisual = this.getNearestNotHiddenCoords(broaderCellRange.from.clone().normalize(), rowDirection, columnDirection);
234
+
235
+ if (singleCellRangeVisual !== null && broaderCellRange.overlaps(singleCellRangeVisual)) {
323
236
  // We can't show selection visually now, but we found fist visible range in the broader cell range.
324
237
  if (this.cellRange === null) {
325
238
  var singleCellRangeRenderable = this.settings.visualToRenderableCoords(singleCellRangeVisual);
@@ -389,42 +302,6 @@ var VisualSelection = /*#__PURE__*/function (_Selection) {
389
302
  var renderableToCoords = this.settings.visualToRenderableCoords(visualToCoords);
390
303
  return this.settings.createCellRange(renderableFromCoords, renderableFromCoords, renderableToCoords);
391
304
  }
392
- /**
393
- * It returns rows shift needed for searching visual row.
394
- *
395
- * @private
396
- * @param {CellRange} cellRange Selection range.
397
- * @returns {number} Rows shift. It return 1 when we should increase indexes (moving from the top to the bottom) or
398
- * -1 when we should decrease indexes (moving other way around).
399
- */
400
-
401
- }, {
402
- key: "getRowSearchDirection",
403
- value: function getRowSearchDirection(cellRange) {
404
- if (cellRange.from.row < cellRange.to.row) {
405
- return 1; // Increasing row indexes.
406
- }
407
-
408
- return -1; // Decreasing row indexes.
409
- }
410
- /**
411
- * It returns columns shift needed for searching visual column.
412
- *
413
- * @private
414
- * @param {CellRange} cellRange Selection range.
415
- * @returns {number} Columns shift. It return 1 when we should increase indexes (moving from the left to the right) or
416
- * -1 when we should decrease indexes (moving other way around).
417
- */
418
-
419
- }, {
420
- key: "getColumnSearchDirection",
421
- value: function getColumnSearchDirection(cellRange) {
422
- if (cellRange.from.col < cellRange.to.col) {
423
- return 1; // Increasing column indexes.
424
- }
425
-
426
- return -1; // Decreasing column indexes.
427
- }
428
305
  }]);
429
306
 
430
307
  return VisualSelection;
@@ -178,6 +178,12 @@ var Selection = /*#__PURE__*/function () {
178
178
  },
179
179
  createCellRange: function createCellRange(highlight, from, to) {
180
180
  return _this.tableProps.createCellRange(highlight, from, to);
181
+ },
182
+ rowIndexMapper: function rowIndexMapper() {
183
+ return _this.tableProps.rowIndexMapper();
184
+ },
185
+ columnIndexMapper: function columnIndexMapper() {
186
+ return _this.tableProps.columnIndexMapper();
181
187
  }
182
188
  });
183
189
  /**
@@ -394,7 +400,7 @@ var Selection = /*#__PURE__*/function () {
394
400
  this.highlight.getCell().clear();
395
401
 
396
402
  if (this.highlight.isEnabledFor(_constants.CELL_TYPE, cellRange.highlight)) {
397
- this.highlight.getCell().add(this.selectedRange.current().highlight).commit().adjustCoordinates(cellRange);
403
+ this.highlight.getCell().add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
398
404
  }
399
405
 
400
406
  var layerLevel = this.getLayerLevel(); // If the next layer level is lower than previous then clear all area and header highlights. This is the
@@ -429,7 +435,7 @@ var Selection = /*#__PURE__*/function () {
429
435
  // based on previous coordinates. It only occurs when the previous selection wasn't select multiple cells.
430
436
  var previousRange = this.selectedRange.previous();
431
437
  this.highlight.useLayerLevel(layerLevel - 1).createOrGetArea().add(previousRange.from).commit() // Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
432
- .adjustCoordinates(previousRange);
438
+ .syncWith(previousRange);
433
439
  this.highlight.useLayerLevel(layerLevel);
434
440
  }
435
441
  }
@@ -865,7 +871,7 @@ var Selection = /*#__PURE__*/function () {
865
871
 
866
872
  var cellHighlight = this.highlight.getCell();
867
873
  var currentLayer = this.getLayerLevel();
868
- cellHighlight.commit().adjustCoordinates(this.selectedRange.current()); // Rewriting rendered ranges going through all layers.
874
+ cellHighlight.commit().syncWith(this.selectedRange.current()); // Rewriting rendered ranges going through all layers.
869
875
 
870
876
  for (var layerLevel = 0; layerLevel < this.selectedRange.size(); layerLevel += 1) {
871
877
  this.highlight.useLayerLevel(layerLevel);
@@ -145,6 +145,12 @@ var Selection = /*#__PURE__*/function () {
145
145
  },
146
146
  createCellRange: function createCellRange(highlight, from, to) {
147
147
  return _this.tableProps.createCellRange(highlight, from, to);
148
+ },
149
+ rowIndexMapper: function rowIndexMapper() {
150
+ return _this.tableProps.rowIndexMapper();
151
+ },
152
+ columnIndexMapper: function columnIndexMapper() {
153
+ return _this.tableProps.columnIndexMapper();
148
154
  }
149
155
  });
150
156
  /**
@@ -361,7 +367,7 @@ var Selection = /*#__PURE__*/function () {
361
367
  this.highlight.getCell().clear();
362
368
 
363
369
  if (this.highlight.isEnabledFor(CELL_TYPE, cellRange.highlight)) {
364
- this.highlight.getCell().add(this.selectedRange.current().highlight).commit().adjustCoordinates(cellRange);
370
+ this.highlight.getCell().add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
365
371
  }
366
372
 
367
373
  var layerLevel = this.getLayerLevel(); // If the next layer level is lower than previous then clear all area and header highlights. This is the
@@ -396,7 +402,7 @@ var Selection = /*#__PURE__*/function () {
396
402
  // based on previous coordinates. It only occurs when the previous selection wasn't select multiple cells.
397
403
  var previousRange = this.selectedRange.previous();
398
404
  this.highlight.useLayerLevel(layerLevel - 1).createOrGetArea().add(previousRange.from).commit() // Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
399
- .adjustCoordinates(previousRange);
405
+ .syncWith(previousRange);
400
406
  this.highlight.useLayerLevel(layerLevel);
401
407
  }
402
408
  }
@@ -832,7 +838,7 @@ var Selection = /*#__PURE__*/function () {
832
838
 
833
839
  var cellHighlight = this.highlight.getCell();
834
840
  var currentLayer = this.getLayerLevel();
835
- cellHighlight.commit().adjustCoordinates(this.selectedRange.current()); // Rewriting rendered ranges going through all layers.
841
+ cellHighlight.commit().syncWith(this.selectedRange.current()); // Rewriting rendered ranges going through all layers.
836
842
 
837
843
  for (var layerLevel = 0; layerLevel < this.selectedRange.size(); layerLevel += 1) {
838
844
  this.highlight.useLayerLevel(layerLevel);
@@ -92,7 +92,7 @@ var createContext = function createContext(name) {
92
92
  }
93
93
  });
94
94
  /**
95
- * Add a keyboard shortcut to this `ShortcutContext`.
95
+ * Add a keyboard shortcut to this context.
96
96
  *
97
97
  * @memberof ShortcutContext#
98
98
  * @param {object} options The shortcut's options
@@ -66,7 +66,7 @@ export var createContext = function createContext(name) {
66
66
  }
67
67
  });
68
68
  /**
69
- * Add a keyboard shortcut to this `ShortcutContext`.
69
+ * Add a keyboard shortcut to this context.
70
70
  *
71
71
  * @memberof ShortcutContext#
72
72
  * @param {object} options The shortcut's options
@@ -22,11 +22,13 @@ var _recorder = require("./recorder");
22
22
  * @class ShortcutManager
23
23
  * @param {object} options The manager's options
24
24
  * @param {EventTarget} options.ownerWindow A starting `window` element
25
+ * @param {Function} options.handleEvent A condition on which `event` is handled.
25
26
  * @param {Function} options.beforeKeyDown A hook fired before the `keydown` event is handled. You can use it to [block a keyboard shortcut's actions](@/guides/accessories-and-menus/keyboard-shortcuts.md#blocking-a-keyboard-shortcut-s-actions).
26
27
  * @param {Function} options.afterKeyDown A hook fired after the `keydown` event is handled
27
28
  */
28
29
  var createShortcutManager = function createShortcutManager(_ref) {
29
30
  var ownerWindow = _ref.ownerWindow,
31
+ handleEvent = _ref.handleEvent,
30
32
  beforeKeyDown = _ref.beforeKeyDown,
31
33
  afterKeyDown = _ref.afterKeyDown;
32
34
 
@@ -110,7 +112,7 @@ var createShortcutManager = function createShortcutManager(_ref) {
110
112
  * @private
111
113
  */
112
114
 
113
- var keyRecorder = (0, _recorder.useRecorder)(ownerWindow, beforeKeyDown, afterKeyDown, function (event, keys) {
115
+ var keyRecorder = (0, _recorder.useRecorder)(ownerWindow, handleEvent, beforeKeyDown, afterKeyDown, function (event, keys) {
114
116
  var activeContext = getContext(getActiveContextName());
115
117
  var isExecutionCancelled = false;
116
118
 
@@ -14,12 +14,14 @@ import { useRecorder } from "./recorder.mjs";
14
14
  * @class ShortcutManager
15
15
  * @param {object} options The manager's options
16
16
  * @param {EventTarget} options.ownerWindow A starting `window` element
17
+ * @param {Function} options.handleEvent A condition on which `event` is handled.
17
18
  * @param {Function} options.beforeKeyDown A hook fired before the `keydown` event is handled. You can use it to [block a keyboard shortcut's actions](@/guides/accessories-and-menus/keyboard-shortcuts.md#blocking-a-keyboard-shortcut-s-actions).
18
19
  * @param {Function} options.afterKeyDown A hook fired after the `keydown` event is handled
19
20
  */
20
21
 
21
22
  export var createShortcutManager = function createShortcutManager(_ref) {
22
23
  var ownerWindow = _ref.ownerWindow,
24
+ handleEvent = _ref.handleEvent,
23
25
  beforeKeyDown = _ref.beforeKeyDown,
24
26
  afterKeyDown = _ref.afterKeyDown;
25
27
 
@@ -103,7 +105,7 @@ export var createShortcutManager = function createShortcutManager(_ref) {
103
105
  * @private
104
106
  */
105
107
 
106
- var keyRecorder = useRecorder(ownerWindow, beforeKeyDown, afterKeyDown, function (event, keys) {
108
+ var keyRecorder = useRecorder(ownerWindow, handleEvent, beforeKeyDown, afterKeyDown, function (event, keys) {
107
109
  var activeContext = getContext(getActiveContextName());
108
110
  var isExecutionCancelled = false;
109
111
 
@@ -25,13 +25,14 @@ var modifierKeysObserver = (0, _keyObserver.createKeysObserver)();
25
25
  * A key recorder, used for tracking key events.
26
26
  *
27
27
  * @param {EventTarget} ownerWindow A starting `window` element
28
- * @param {Function} beforeKeyDown A hook fired before the `keydown` event is handled. You can use it to [block a keyboard shortcut's actions](@/guides/accessories-and-menus/keyboard-shortcuts.md#blocking-a-keyboard-shortcut-s-actions).
28
+ * @param {Function} handleEvent A condition on which event is handled.
29
+ * @param {Function} beforeKeyDown A hook fired before the `keydown` event is handled.
29
30
  * @param {Function} afterKeyDown A hook fired after the `keydown` event is handled
30
31
  * @param {Function} callback `KeyEvent`'s listener's callback function
31
32
  * @returns {object}
32
33
  */
33
34
 
34
- function useRecorder(ownerWindow, beforeKeyDown, afterKeyDown, callback) {
35
+ function useRecorder(ownerWindow, handleEvent, beforeKeyDown, afterKeyDown, callback) {
35
36
  /**
36
37
  * Check if a pressed key is tracked or not.
37
38
  *
@@ -90,6 +91,10 @@ function useRecorder(ownerWindow, beforeKeyDown, afterKeyDown, callback) {
90
91
 
91
92
 
92
93
  var onkeydown = function onkeydown(event) {
94
+ if (handleEvent(event) === false) {
95
+ return;
96
+ }
97
+
93
98
  var result = beforeKeyDown(event);
94
99
 
95
100
  if (result === false || (0, _event.isImmediatePropagationStopped)(event)) {
@@ -124,6 +129,10 @@ function useRecorder(ownerWindow, beforeKeyDown, afterKeyDown, callback) {
124
129
 
125
130
 
126
131
  var onkeyup = function onkeyup(event) {
132
+ if (handleEvent(event) === false) {
133
+ return;
134
+ }
135
+
127
136
  var pressedKey = (0, _utils.normalizeEventKey)(event.key);
128
137
 
129
138
  if (isModifierKey(pressedKey) === false) {
@@ -13,13 +13,14 @@ var modifierKeysObserver = createKeysObserver();
13
13
  * A key recorder, used for tracking key events.
14
14
  *
15
15
  * @param {EventTarget} ownerWindow A starting `window` element
16
- * @param {Function} beforeKeyDown A hook fired before the `keydown` event is handled. You can use it to [block a keyboard shortcut's actions](@/guides/accessories-and-menus/keyboard-shortcuts.md#blocking-a-keyboard-shortcut-s-actions).
16
+ * @param {Function} handleEvent A condition on which event is handled.
17
+ * @param {Function} beforeKeyDown A hook fired before the `keydown` event is handled.
17
18
  * @param {Function} afterKeyDown A hook fired after the `keydown` event is handled
18
19
  * @param {Function} callback `KeyEvent`'s listener's callback function
19
20
  * @returns {object}
20
21
  */
21
22
 
22
- export function useRecorder(ownerWindow, beforeKeyDown, afterKeyDown, callback) {
23
+ export function useRecorder(ownerWindow, handleEvent, beforeKeyDown, afterKeyDown, callback) {
23
24
  /**
24
25
  * Check if a pressed key is tracked or not.
25
26
  *
@@ -78,6 +79,10 @@ export function useRecorder(ownerWindow, beforeKeyDown, afterKeyDown, callback)
78
79
 
79
80
 
80
81
  var onkeydown = function onkeydown(event) {
82
+ if (handleEvent(event) === false) {
83
+ return;
84
+ }
85
+
81
86
  var result = beforeKeyDown(event);
82
87
 
83
88
  if (result === false || isImmediatePropagationStopped(event)) {
@@ -112,6 +117,10 @@ export function useRecorder(ownerWindow, beforeKeyDown, afterKeyDown, callback)
112
117
 
113
118
 
114
119
  var onkeyup = function onkeyup(event) {
120
+ if (handleEvent(event) === false) {
121
+ return;
122
+ }
123
+
115
124
  var pressedKey = normalizeEventKey(event.key);
116
125
 
117
126
  if (isModifierKey(pressedKey) === false) {