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
@@ -9,7 +9,7 @@ const RENDERER_TYPE = exports.RENDERER_TYPE = 'time';
9
9
  * Default time renderer.
10
10
  *
11
11
  * @private
12
- * @param {Core} instance The Handsontable instance.
12
+ * @param {Core} hotInstance The Handsontable instance.
13
13
  * @param {HTMLTableCellElement} TD The rendered cell element.
14
14
  * @param {number} row The visual row index.
15
15
  * @param {number} col The visual column index.
@@ -17,8 +17,8 @@ const RENDERER_TYPE = exports.RENDERER_TYPE = 'time';
17
17
  * @param {*} value The rendered value.
18
18
  * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).
19
19
  */
20
- function timeRenderer(instance, TD, row, col, prop, value, cellProperties) {
21
- _textRenderer.textRenderer.apply(this, [instance, TD, row, col, prop, value, cellProperties]);
20
+ function timeRenderer(hotInstance, TD, row, col, prop, value, cellProperties) {
21
+ _textRenderer.textRenderer.apply(this, [hotInstance, TD, row, col, prop, value, cellProperties]);
22
22
  TD.dir = 'ltr';
23
23
  }
24
24
  timeRenderer.RENDERER_TYPE = RENDERER_TYPE;
@@ -5,7 +5,7 @@ export const RENDERER_TYPE = 'time';
5
5
  * Default time renderer.
6
6
  *
7
7
  * @private
8
- * @param {Core} instance The Handsontable instance.
8
+ * @param {Core} hotInstance The Handsontable instance.
9
9
  * @param {HTMLTableCellElement} TD The rendered cell element.
10
10
  * @param {number} row The visual row index.
11
11
  * @param {number} col The visual column index.
@@ -13,8 +13,8 @@ export const RENDERER_TYPE = 'time';
13
13
  * @param {*} value The rendered value.
14
14
  * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).
15
15
  */
16
- export function timeRenderer(instance, TD, row, col, prop, value, cellProperties) {
17
- textRenderer.apply(this, [instance, TD, row, col, prop, value, cellProperties]);
16
+ export function timeRenderer(hotInstance, TD, row, col, prop, value, cellProperties) {
17
+ textRenderer.apply(this, [hotInstance, TD, row, col, prop, value, cellProperties]);
18
18
  TD.dir = 'ltr';
19
19
  }
20
20
  timeRenderer.RENDERER_TYPE = RENDERER_TYPE;
@@ -179,10 +179,7 @@ class Highlight {
179
179
  type = 'current'; // One from settings for `disableVisualSelection` up to Handsontable 0.36/Handsontable Pro 1.16.0.
180
180
  }
181
181
 
182
- let disableHighlight = false;
183
- if (coords.isCell()) {
184
- disableHighlight = this.options.disabledCellSelection(coords.row, coords.col);
185
- }
182
+ let disableHighlight = this.options.disabledCellSelection(coords.row, coords.col);
186
183
  if (typeof disableHighlight === 'string') {
187
184
  disableHighlight = [disableHighlight];
188
185
  }
@@ -170,10 +170,7 @@ class Highlight {
170
170
  type = 'current'; // One from settings for `disableVisualSelection` up to Handsontable 0.36/Handsontable Pro 1.16.0.
171
171
  }
172
172
 
173
- let disableHighlight = false;
174
- if (coords.isCell()) {
175
- disableHighlight = this.options.disabledCellSelection(coords.row, coords.col);
176
- }
173
+ let disableHighlight = this.options.disabledCellSelection(coords.row, coords.col);
177
174
  if (typeof disableHighlight === 'string') {
178
175
  disableHighlight = [disableHighlight];
179
176
  }
@@ -1,7 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.error.cause.js");
3
4
  exports.__esModule = true;
4
5
  require("core-js/modules/es.array.push.js");
6
+ let _Symbol$iterator;
7
+ 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; }
8
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
9
+ 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); }
10
+ _Symbol$iterator = Symbol.iterator;
5
11
  /**
6
12
  * The SelectionRange class is a simple CellRanges collection designed for easy manipulation of the multiple
7
13
  * consecutive and non-consecutive selections.
@@ -16,7 +22,11 @@ class SelectionRange {
16
22
  *
17
23
  * @type {CellRange[]}
18
24
  */
19
- this.ranges = [];
25
+ _defineProperty(this, "ranges", []);
26
+ /**
27
+ * @type {function(CellCoords): CellRange}
28
+ */
29
+ _defineProperty(this, "createCellRange", void 0);
20
30
  this.createCellRange = createCellRange;
21
31
  }
22
32
 
@@ -126,7 +136,7 @@ class SelectionRange {
126
136
  }
127
137
  return cellRange;
128
138
  }
129
- [Symbol.iterator]() {
139
+ [_Symbol$iterator]() {
130
140
  return this.ranges[Symbol.iterator]();
131
141
  }
132
142
  }
@@ -1,4 +1,10 @@
1
+ import "core-js/modules/es.error.cause.js";
2
+ let _Symbol$iterator;
1
3
  import "core-js/modules/es.array.push.js";
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
+ _Symbol$iterator = Symbol.iterator;
2
8
  /**
3
9
  * The SelectionRange class is a simple CellRanges collection designed for easy manipulation of the multiple
4
10
  * consecutive and non-consecutive selections.
@@ -13,7 +19,11 @@ class SelectionRange {
13
19
  *
14
20
  * @type {CellRange[]}
15
21
  */
16
- this.ranges = [];
22
+ _defineProperty(this, "ranges", []);
23
+ /**
24
+ * @type {function(CellCoords): CellRange}
25
+ */
26
+ _defineProperty(this, "createCellRange", void 0);
17
27
  this.createCellRange = createCellRange;
18
28
  }
19
29
 
@@ -123,7 +133,7 @@ class SelectionRange {
123
133
  }
124
134
  return cellRange;
125
135
  }
126
- [Symbol.iterator]() {
136
+ [_Symbol$iterator]() {
127
137
  return this.ranges[Symbol.iterator]();
128
138
  }
129
139
  }
@@ -2,7 +2,6 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
- var _src = require("./../3rdparty/walkontable/src");
6
5
  var _highlight = _interopRequireWildcard(require("./highlight/highlight"));
7
6
  var _range = _interopRequireDefault(require("./range"));
8
7
  var _object = require("./../helpers/object");
@@ -561,6 +560,18 @@ class Selection {
561
560
  return this.settings.fillHandle && !this.tableProps.isEditorOpened() && !this.isMultiple();
562
561
  }
563
562
 
563
+ /**
564
+ * Returns `true` if the cell coordinates are visible (renderable).
565
+ *
566
+ * @private
567
+ * @param {CellCoords} coords The cell coordinates to check.
568
+ * @returns {boolean}
569
+ */
570
+ isCellVisible(coords) {
571
+ const renderableCoords = this.tableProps.visualToRenderableCoords(coords);
572
+ return renderableCoords.row !== null && renderableCoords.col !== null;
573
+ }
574
+
564
575
  /**
565
576
  * Returns `true` if the area corner should be visible.
566
577
  *
@@ -641,7 +652,7 @@ class Selection {
641
652
  const startCoords = this.tableProps.createCellCoords(rowFrom, columnFrom);
642
653
  const endCoords = this.tableProps.createCellCoords(nrOfRows - 1, nrOfColumns - 1);
643
654
  this.clear();
644
- this.setRangeStartOnly(startCoords, void 0, highlight);
655
+ this.setRangeStartOnly(startCoords, undefined, highlight);
645
656
  if (columnFrom < 0) {
646
657
  this.selectedByRowHeader.add(this.getLayerLevel());
647
658
  }
@@ -663,6 +674,7 @@ class Selection {
663
674
  * @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
664
675
  */
665
676
  selectCells(selectionRanges) {
677
+ var _this2 = this;
666
678
  const selectionType = (0, _utils.detectSelectionType)(selectionRanges);
667
679
  if (selectionType === _utils.SELECTION_TYPE_EMPTY) {
668
680
  return false;
@@ -672,6 +684,12 @@ class Selection {
672
684
  columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);
673
685
  }
674
686
  const selectionSchemaNormalizer = (0, _utils.normalizeSelectionFactory)(selectionType, {
687
+ createCellCoords: function () {
688
+ return _this2.tableProps.createCellCoords(...arguments);
689
+ },
690
+ createCellRange: function () {
691
+ return _this2.tableProps.createCellRange(...arguments);
692
+ },
675
693
  propToCol: prop => this.tableProps.propToCol(prop),
676
694
  keepDirection: true
677
695
  });
@@ -724,9 +742,9 @@ class Selection {
724
742
  const countCols = this.tableProps.countCols();
725
743
  const countColHeaders = this.tableProps.countColHeaders();
726
744
  const columnHeaderLastIndex = countColHeaders === 0 ? 0 : -countColHeaders;
727
- const fromCoords = new _src.CellCoords(columnHeaderLastIndex, start);
728
- const toCoords = new _src.CellCoords(countRows - 1, end);
729
- const isValid = new _src.CellRange(fromCoords, fromCoords, toCoords).isValid({
745
+ const fromCoords = this.tableProps.createCellCoords(columnHeaderLastIndex, start);
746
+ const toCoords = this.tableProps.createCellCoords(countRows - 1, end);
747
+ const isValid = this.tableProps.createCellRange(fromCoords, fromCoords, toCoords).isValid({
730
748
  countRows,
731
749
  countCols,
732
750
  countRowHeaders: 0,
@@ -743,7 +761,7 @@ class Selection {
743
761
  // disallow modifying row axis for that hooks
744
762
  from.row = fromRow;
745
763
  to.row = toRow;
746
- this.setRangeStartOnly(from, void 0, highlight);
764
+ this.setRangeStartOnly(from, undefined, highlight);
747
765
  this.selectedByColumnHeader.add(this.getLayerLevel());
748
766
  this.setRangeEnd(to);
749
767
  this.runLocalHooks('afterSelectColumns', from, to, highlight);
@@ -769,9 +787,9 @@ class Selection {
769
787
  const countCols = this.tableProps.countCols();
770
788
  const countRowHeaders = this.tableProps.countRowHeaders();
771
789
  const rowHeaderLastIndex = countRowHeaders === 0 ? 0 : -countRowHeaders;
772
- const fromCoords = new _src.CellCoords(startRow, rowHeaderLastIndex);
773
- const toCoords = new _src.CellCoords(endRow, countCols - 1);
774
- const isValid = new _src.CellRange(fromCoords, fromCoords, toCoords).isValid({
790
+ const fromCoords = this.tableProps.createCellCoords(startRow, rowHeaderLastIndex);
791
+ const toCoords = this.tableProps.createCellCoords(endRow, countCols - 1);
792
+ const isValid = this.tableProps.createCellRange(fromCoords, fromCoords, toCoords).isValid({
775
793
  countRows,
776
794
  countCols,
777
795
  countRowHeaders,
@@ -788,7 +806,7 @@ class Selection {
788
806
  // disallow modifying column axis for that hooks
789
807
  from.col = fromColumn;
790
808
  to.col = toColumn;
791
- this.setRangeStartOnly(from, void 0, highlight);
809
+ this.setRangeStartOnly(from, undefined, highlight);
792
810
  this.selectedByRowHeader.add(this.getLayerLevel());
793
811
  this.setRangeEnd(to);
794
812
  this.runLocalHooks('afterSelectRows', from, to, highlight);
@@ -9,7 +9,6 @@ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.
9
9
  function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
10
10
  function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
11
11
  function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
12
- import { CellCoords, CellRange } from "./../3rdparty/walkontable/src/index.mjs";
13
12
  import Highlight, { AREA_TYPE, HEADER_TYPE, FOCUS_TYPE } from "./highlight/highlight.mjs";
14
13
  import SelectionRange from "./range.mjs";
15
14
  import { createObjectPropListener, mixin } from "./../helpers/object.mjs";
@@ -555,6 +554,18 @@ class Selection {
555
554
  return this.settings.fillHandle && !this.tableProps.isEditorOpened() && !this.isMultiple();
556
555
  }
557
556
 
557
+ /**
558
+ * Returns `true` if the cell coordinates are visible (renderable).
559
+ *
560
+ * @private
561
+ * @param {CellCoords} coords The cell coordinates to check.
562
+ * @returns {boolean}
563
+ */
564
+ isCellVisible(coords) {
565
+ const renderableCoords = this.tableProps.visualToRenderableCoords(coords);
566
+ return renderableCoords.row !== null && renderableCoords.col !== null;
567
+ }
568
+
558
569
  /**
559
570
  * Returns `true` if the area corner should be visible.
560
571
  *
@@ -635,7 +646,7 @@ class Selection {
635
646
  const startCoords = this.tableProps.createCellCoords(rowFrom, columnFrom);
636
647
  const endCoords = this.tableProps.createCellCoords(nrOfRows - 1, nrOfColumns - 1);
637
648
  this.clear();
638
- this.setRangeStartOnly(startCoords, void 0, highlight);
649
+ this.setRangeStartOnly(startCoords, undefined, highlight);
639
650
  if (columnFrom < 0) {
640
651
  this.selectedByRowHeader.add(this.getLayerLevel());
641
652
  }
@@ -657,6 +668,7 @@ class Selection {
657
668
  * @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
658
669
  */
659
670
  selectCells(selectionRanges) {
671
+ var _this2 = this;
660
672
  const selectionType = detectSelectionType(selectionRanges);
661
673
  if (selectionType === SELECTION_TYPE_EMPTY) {
662
674
  return false;
@@ -666,6 +678,12 @@ class Selection {
666
678
  columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);
667
679
  }
668
680
  const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType, {
681
+ createCellCoords: function () {
682
+ return _this2.tableProps.createCellCoords(...arguments);
683
+ },
684
+ createCellRange: function () {
685
+ return _this2.tableProps.createCellRange(...arguments);
686
+ },
669
687
  propToCol: prop => this.tableProps.propToCol(prop),
670
688
  keepDirection: true
671
689
  });
@@ -718,9 +736,9 @@ class Selection {
718
736
  const countCols = this.tableProps.countCols();
719
737
  const countColHeaders = this.tableProps.countColHeaders();
720
738
  const columnHeaderLastIndex = countColHeaders === 0 ? 0 : -countColHeaders;
721
- const fromCoords = new CellCoords(columnHeaderLastIndex, start);
722
- const toCoords = new CellCoords(countRows - 1, end);
723
- const isValid = new CellRange(fromCoords, fromCoords, toCoords).isValid({
739
+ const fromCoords = this.tableProps.createCellCoords(columnHeaderLastIndex, start);
740
+ const toCoords = this.tableProps.createCellCoords(countRows - 1, end);
741
+ const isValid = this.tableProps.createCellRange(fromCoords, fromCoords, toCoords).isValid({
724
742
  countRows,
725
743
  countCols,
726
744
  countRowHeaders: 0,
@@ -737,7 +755,7 @@ class Selection {
737
755
  // disallow modifying row axis for that hooks
738
756
  from.row = fromRow;
739
757
  to.row = toRow;
740
- this.setRangeStartOnly(from, void 0, highlight);
758
+ this.setRangeStartOnly(from, undefined, highlight);
741
759
  this.selectedByColumnHeader.add(this.getLayerLevel());
742
760
  this.setRangeEnd(to);
743
761
  this.runLocalHooks('afterSelectColumns', from, to, highlight);
@@ -763,9 +781,9 @@ class Selection {
763
781
  const countCols = this.tableProps.countCols();
764
782
  const countRowHeaders = this.tableProps.countRowHeaders();
765
783
  const rowHeaderLastIndex = countRowHeaders === 0 ? 0 : -countRowHeaders;
766
- const fromCoords = new CellCoords(startRow, rowHeaderLastIndex);
767
- const toCoords = new CellCoords(endRow, countCols - 1);
768
- const isValid = new CellRange(fromCoords, fromCoords, toCoords).isValid({
784
+ const fromCoords = this.tableProps.createCellCoords(startRow, rowHeaderLastIndex);
785
+ const toCoords = this.tableProps.createCellCoords(endRow, countCols - 1);
786
+ const isValid = this.tableProps.createCellRange(fromCoords, fromCoords, toCoords).isValid({
769
787
  countRows,
770
788
  countCols,
771
789
  countRowHeaders,
@@ -782,7 +800,7 @@ class Selection {
782
800
  // disallow modifying column axis for that hooks
783
801
  from.col = fromColumn;
784
802
  to.col = toColumn;
785
- this.setRangeStartOnly(from, void 0, highlight);
803
+ this.setRangeStartOnly(from, undefined, highlight);
786
804
  this.selectedByRowHeader.add(this.getLayerLevel());
787
805
  this.setRangeEnd(to);
788
806
  this.runLocalHooks('afterSelectRows', from, to, highlight);
@@ -59,7 +59,9 @@ function detectSelectionType(selectionRanges) {
59
59
  * Factory function designed for normalization data schema from different data structures of the selection ranges.
60
60
  *
61
61
  * @param {number} type Selection type which will be processed.
62
- * @param {object} [options] The normalization options.
62
+ * @param {object} options The normalization options.
63
+ * @param {function(number, number): CellCoords} options.createCellCoords The factory function that returns an instance of the `CellCoords` class.
64
+ * @param {function(CellCoords, CellCoords, CellCoords): CellRange} options.createCellRange The factory function that returns an instance of the `CellRange` class.
63
65
  * @param {boolean} [options.keepDirection=false] If `true`, the coordinates which contain the direction of the
64
66
  * selected cells won't be changed. Otherwise, the selection will be
65
67
  * normalized to values starting from top-left to bottom-right.
@@ -69,6 +71,8 @@ function detectSelectionType(selectionRanges) {
69
71
  */
70
72
  function normalizeSelectionFactory(type) {
71
73
  let {
74
+ createCellCoords,
75
+ createCellRange,
72
76
  keepDirection = false,
73
77
  propToCol
74
78
  } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -105,9 +109,9 @@ function normalizeSelectionFactory(type) {
105
109
  rowEnd = Math.max(origRowStart, origRowEnd);
106
110
  columnEnd = Math.max(origColumnStart, origColumnEnd);
107
111
  }
108
- const from = new _src.CellCoords(rowStart, columnStart);
109
- const to = new _src.CellCoords(rowEnd, columnEnd);
110
- return new _src.CellRange(from, from, to);
112
+ const from = createCellCoords(rowStart, columnStart);
113
+ const to = createCellCoords(rowEnd, columnEnd);
114
+ return createCellRange(from, from, to);
111
115
  };
112
116
  }
113
117
 
@@ -117,22 +121,25 @@ function normalizeSelectionFactory(type) {
117
121
  * contains an array of arrays. The single item contains at index 0 visual column index from the selection was
118
122
  * started and at index 1 distance as a count of selected columns.
119
123
  *
120
- * @param {Array[]|CellRange[]} selectionRanges Selection ranges produced by Handsontable.
124
+ * @param {Core} hotInstance The Handsontable instance.
121
125
  * @returns {Array[]} Returns an array of arrays with ranges defines in that schema:
122
126
  * `[[visualColumnStart, distance], [visualColumnStart, distance], ...]`.
123
127
  * The column distances are always created starting from the left (zero index) to the
124
128
  * right (the latest column index).
125
129
  */
126
- function transformSelectionToColumnDistance(selectionRanges) {
127
- const selectionType = detectSelectionType(selectionRanges);
130
+ function transformSelectionToColumnDistance(hotInstance) {
131
+ const selectionType = detectSelectionType(hotInstance.getSelected());
128
132
  if (selectionType === SELECTION_TYPE_UNRECOGNIZED || selectionType === SELECTION_TYPE_EMPTY) {
129
133
  return [];
130
134
  }
131
- const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
135
+ const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType, {
136
+ createCellCoords: hotInstance._createCellCoords.bind(hotInstance),
137
+ createCellRange: hotInstance._createCellRange.bind(hotInstance)
138
+ });
132
139
  const unorderedIndexes = new Set();
133
140
 
134
141
  // Iterate through all ranges and collect all column indexes which are not saved yet.
135
- (0, _array.arrayEach)(selectionRanges, selection => {
142
+ (0, _array.arrayEach)(hotInstance.getSelected(), selection => {
136
143
  const {
137
144
  from,
138
145
  to
@@ -165,22 +172,25 @@ function transformSelectionToColumnDistance(selectionRanges) {
165
172
  * contains an array of arrays. The single item contains at index 0 visual column index from the selection was
166
173
  * started and at index 1 distance as a count of selected columns.
167
174
  *
168
- * @param {Array[]|CellRange[]} selectionRanges Selection ranges produced by Handsontable.
175
+ * @param {Core} hotInstance The Handsontable instance.
169
176
  * @returns {Array[]} Returns an array of arrays with ranges defines in that schema:
170
177
  * `[[visualColumnStart, distance], [visualColumnStart, distance], ...]`.
171
178
  * The column distances are always created starting from the left (zero index) to the
172
179
  * right (the latest column index).
173
180
  */
174
- function transformSelectionToRowDistance(selectionRanges) {
175
- const selectionType = detectSelectionType(selectionRanges);
181
+ function transformSelectionToRowDistance(hotInstance) {
182
+ const selectionType = detectSelectionType(hotInstance.getSelected());
176
183
  if (selectionType === SELECTION_TYPE_UNRECOGNIZED || selectionType === SELECTION_TYPE_EMPTY) {
177
184
  return [];
178
185
  }
179
- const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
186
+ const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType, {
187
+ createCellCoords: hotInstance._createCellCoords.bind(hotInstance),
188
+ createCellRange: hotInstance._createCellRange.bind(hotInstance)
189
+ });
180
190
  const unorderedIndexes = new Set();
181
191
 
182
192
  // Iterate through all ranges and collect all column indexes which are not saved yet.
183
- (0, _array.arrayEach)(selectionRanges, selection => {
193
+ (0, _array.arrayEach)(hotInstance.getSelected(), selection => {
184
194
  const {
185
195
  from,
186
196
  to
@@ -1,6 +1,6 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
2
  import "core-js/modules/es.array.push.js";
3
- import { CellRange, CellCoords } from "./../3rdparty/walkontable/src/index.mjs";
3
+ import { CellRange } from "./../3rdparty/walkontable/src/index.mjs";
4
4
  import { arrayEach, arrayReduce } from "./../helpers/array.mjs";
5
5
  import { isUndefined } from "./../helpers/mixed.mjs";
6
6
  export const SELECTION_TYPE_UNRECOGNIZED = 0;
@@ -52,7 +52,9 @@ export function detectSelectionType(selectionRanges) {
52
52
  * Factory function designed for normalization data schema from different data structures of the selection ranges.
53
53
  *
54
54
  * @param {number} type Selection type which will be processed.
55
- * @param {object} [options] The normalization options.
55
+ * @param {object} options The normalization options.
56
+ * @param {function(number, number): CellCoords} options.createCellCoords The factory function that returns an instance of the `CellCoords` class.
57
+ * @param {function(CellCoords, CellCoords, CellCoords): CellRange} options.createCellRange The factory function that returns an instance of the `CellRange` class.
56
58
  * @param {boolean} [options.keepDirection=false] If `true`, the coordinates which contain the direction of the
57
59
  * selected cells won't be changed. Otherwise, the selection will be
58
60
  * normalized to values starting from top-left to bottom-right.
@@ -62,6 +64,8 @@ export function detectSelectionType(selectionRanges) {
62
64
  */
63
65
  export function normalizeSelectionFactory(type) {
64
66
  let {
67
+ createCellCoords,
68
+ createCellRange,
65
69
  keepDirection = false,
66
70
  propToCol
67
71
  } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -98,9 +102,9 @@ export function normalizeSelectionFactory(type) {
98
102
  rowEnd = Math.max(origRowStart, origRowEnd);
99
103
  columnEnd = Math.max(origColumnStart, origColumnEnd);
100
104
  }
101
- const from = new CellCoords(rowStart, columnStart);
102
- const to = new CellCoords(rowEnd, columnEnd);
103
- return new CellRange(from, from, to);
105
+ const from = createCellCoords(rowStart, columnStart);
106
+ const to = createCellCoords(rowEnd, columnEnd);
107
+ return createCellRange(from, from, to);
104
108
  };
105
109
  }
106
110
 
@@ -110,22 +114,25 @@ export function normalizeSelectionFactory(type) {
110
114
  * contains an array of arrays. The single item contains at index 0 visual column index from the selection was
111
115
  * started and at index 1 distance as a count of selected columns.
112
116
  *
113
- * @param {Array[]|CellRange[]} selectionRanges Selection ranges produced by Handsontable.
117
+ * @param {Core} hotInstance The Handsontable instance.
114
118
  * @returns {Array[]} Returns an array of arrays with ranges defines in that schema:
115
119
  * `[[visualColumnStart, distance], [visualColumnStart, distance], ...]`.
116
120
  * The column distances are always created starting from the left (zero index) to the
117
121
  * right (the latest column index).
118
122
  */
119
- export function transformSelectionToColumnDistance(selectionRanges) {
120
- const selectionType = detectSelectionType(selectionRanges);
123
+ export function transformSelectionToColumnDistance(hotInstance) {
124
+ const selectionType = detectSelectionType(hotInstance.getSelected());
121
125
  if (selectionType === SELECTION_TYPE_UNRECOGNIZED || selectionType === SELECTION_TYPE_EMPTY) {
122
126
  return [];
123
127
  }
124
- const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
128
+ const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType, {
129
+ createCellCoords: hotInstance._createCellCoords.bind(hotInstance),
130
+ createCellRange: hotInstance._createCellRange.bind(hotInstance)
131
+ });
125
132
  const unorderedIndexes = new Set();
126
133
 
127
134
  // Iterate through all ranges and collect all column indexes which are not saved yet.
128
- arrayEach(selectionRanges, selection => {
135
+ arrayEach(hotInstance.getSelected(), selection => {
129
136
  const {
130
137
  from,
131
138
  to
@@ -158,22 +165,25 @@ export function transformSelectionToColumnDistance(selectionRanges) {
158
165
  * contains an array of arrays. The single item contains at index 0 visual column index from the selection was
159
166
  * started and at index 1 distance as a count of selected columns.
160
167
  *
161
- * @param {Array[]|CellRange[]} selectionRanges Selection ranges produced by Handsontable.
168
+ * @param {Core} hotInstance The Handsontable instance.
162
169
  * @returns {Array[]} Returns an array of arrays with ranges defines in that schema:
163
170
  * `[[visualColumnStart, distance], [visualColumnStart, distance], ...]`.
164
171
  * The column distances are always created starting from the left (zero index) to the
165
172
  * right (the latest column index).
166
173
  */
167
- export function transformSelectionToRowDistance(selectionRanges) {
168
- const selectionType = detectSelectionType(selectionRanges);
174
+ export function transformSelectionToRowDistance(hotInstance) {
175
+ const selectionType = detectSelectionType(hotInstance.getSelected());
169
176
  if (selectionType === SELECTION_TYPE_UNRECOGNIZED || selectionType === SELECTION_TYPE_EMPTY) {
170
177
  return [];
171
178
  }
172
- const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
179
+ const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType, {
180
+ createCellCoords: hotInstance._createCellCoords.bind(hotInstance),
181
+ createCellRange: hotInstance._createCellRange.bind(hotInstance)
182
+ });
173
183
  const unorderedIndexes = new Set();
174
184
 
175
185
  // Iterate through all ranges and collect all column indexes which are not saved yet.
176
- arrayEach(selectionRanges, selection => {
186
+ arrayEach(hotInstance.getSelected(), selection => {
177
187
  const {
178
188
  from,
179
189
  to
@@ -131,7 +131,7 @@ const createShortcutManager = _ref => {
131
131
  captureCtrl,
132
132
  forwardToContext
133
133
  } = shortcuts[index];
134
- if (runOnlyIf(event) !== false) {
134
+ if (runOnlyIf(event) === true) {
135
135
  isCtrlKeySilenced = captureCtrl;
136
136
  isExecutionCancelled = callback(event, keys) === false;
137
137
  isCtrlKeySilenced = false;
@@ -128,7 +128,7 @@ export const createShortcutManager = _ref => {
128
128
  captureCtrl,
129
129
  forwardToContext
130
130
  } = shortcuts[index];
131
- if (runOnlyIf(event) !== false) {
131
+ if (runOnlyIf(event) === true) {
132
132
  isCtrlKeySilenced = captureCtrl;
133
133
  isExecutionCancelled = callback(event, keys) === false;
134
134
  isCtrlKeySilenced = false;