handsontable 0.0.0-next-b66c79f-20230713 → 0.0.0-next-08765b9-20230714

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

Files changed (373) hide show
  1. package/3rdparty/walkontable/src/cell/coords.d.ts +6 -1
  2. package/3rdparty/walkontable/src/cell/coords.js +87 -33
  3. package/3rdparty/walkontable/src/cell/coords.mjs +87 -33
  4. package/3rdparty/walkontable/src/cell/range.d.ts +9 -2
  5. package/3rdparty/walkontable/src/cell/range.js +92 -46
  6. package/3rdparty/walkontable/src/cell/range.mjs +92 -46
  7. package/3rdparty/walkontable/src/core/_base.js +41 -33
  8. package/3rdparty/walkontable/src/core/_base.mjs +41 -33
  9. package/3rdparty/walkontable/src/core/clone.js +8 -5
  10. package/3rdparty/walkontable/src/core/clone.mjs +8 -5
  11. package/3rdparty/walkontable/src/core/core.js +3 -2
  12. package/3rdparty/walkontable/src/core/core.mjs +3 -2
  13. package/3rdparty/walkontable/src/event.js +9 -8
  14. package/3rdparty/walkontable/src/event.mjs +9 -8
  15. package/3rdparty/walkontable/src/facade/core.js +2 -2
  16. package/3rdparty/walkontable/src/facade/core.mjs +2 -2
  17. package/3rdparty/walkontable/src/index.js +10 -2
  18. package/3rdparty/walkontable/src/index.mjs +2 -2
  19. package/3rdparty/walkontable/src/overlay/_base.js +11 -9
  20. package/3rdparty/walkontable/src/overlay/_base.mjs +11 -9
  21. package/3rdparty/walkontable/src/overlay/bottom.js +10 -8
  22. package/3rdparty/walkontable/src/overlay/bottom.mjs +10 -8
  23. package/3rdparty/walkontable/src/overlay/inlineStart.js +2 -6
  24. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -6
  25. package/3rdparty/walkontable/src/overlay/top.js +12 -14
  26. package/3rdparty/walkontable/src/overlay/top.mjs +12 -14
  27. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +16 -13
  28. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +16 -13
  29. package/3rdparty/walkontable/src/overlays.js +75 -80
  30. package/3rdparty/walkontable/src/overlays.mjs +75 -80
  31. package/3rdparty/walkontable/src/scroll.js +27 -24
  32. package/3rdparty/walkontable/src/scroll.mjs +27 -24
  33. package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
  34. package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
  35. package/3rdparty/walkontable/src/selection/border/constants.js +16 -0
  36. package/3rdparty/walkontable/src/selection/border/constants.mjs +12 -0
  37. package/3rdparty/walkontable/src/selection/constants.js +62 -0
  38. package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
  39. package/3rdparty/walkontable/src/selection/index.js +26 -0
  40. package/3rdparty/walkontable/src/selection/index.mjs +5 -0
  41. package/3rdparty/walkontable/src/selection/manager.js +259 -0
  42. package/3rdparty/walkontable/src/selection/manager.mjs +254 -0
  43. package/3rdparty/walkontable/src/selection/scanner.js +270 -0
  44. package/3rdparty/walkontable/src/selection/scanner.mjs +267 -0
  45. package/3rdparty/walkontable/src/selection/selection.js +101 -0
  46. package/3rdparty/walkontable/src/selection/selection.mjs +96 -0
  47. package/3rdparty/walkontable/src/settings.js +18 -17
  48. package/3rdparty/walkontable/src/settings.mjs +18 -17
  49. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
  50. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
  51. package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
  52. package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
  53. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
  54. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
  55. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
  56. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
  57. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
  58. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
  59. package/3rdparty/walkontable/src/table.js +48 -115
  60. package/3rdparty/walkontable/src/table.mjs +49 -116
  61. package/base.js +2 -2
  62. package/base.mjs +2 -2
  63. package/core/focusCatcher/focusDetector.js +58 -0
  64. package/core/focusCatcher/focusDetector.mjs +54 -0
  65. package/core/focusCatcher/index.js +142 -0
  66. package/core/focusCatcher/index.mjs +138 -0
  67. package/core/index.js +9 -0
  68. package/core/index.mjs +1 -0
  69. package/core.d.ts +6 -3
  70. package/core.js +181 -298
  71. package/core.mjs +181 -298
  72. package/dataMap/metaManager/metaLayers/cellMeta.js +2 -1
  73. package/dataMap/metaManager/metaLayers/cellMeta.mjs +2 -1
  74. package/dataMap/metaManager/metaLayers/globalMeta.js +1 -1
  75. package/dataMap/metaManager/metaLayers/globalMeta.mjs +1 -1
  76. package/dataMap/metaManager/metaSchema.js +41 -0
  77. package/dataMap/metaManager/metaSchema.mjs +41 -0
  78. package/dataMap/metaManager/mods/dynamicCellMeta.js +3 -2
  79. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +3 -2
  80. package/dataMap/metaManager/utils.js +4 -2
  81. package/dataMap/metaManager/utils.mjs +4 -2
  82. package/dist/handsontable.css +19 -3
  83. package/dist/handsontable.full.css +19 -3
  84. package/dist/handsontable.full.js +10739 -7037
  85. package/dist/handsontable.full.min.css +3 -3
  86. package/dist/handsontable.full.min.js +25 -25
  87. package/dist/handsontable.js +24884 -21182
  88. package/dist/handsontable.min.css +3 -3
  89. package/dist/handsontable.min.js +19 -19
  90. package/editorManager.js +11 -75
  91. package/editorManager.mjs +11 -74
  92. package/editors/autocompleteEditor/autocompleteEditor.js +70 -67
  93. package/editors/autocompleteEditor/autocompleteEditor.mjs +70 -67
  94. package/editors/baseEditor/baseEditor.js +1 -1
  95. package/editors/baseEditor/baseEditor.mjs +1 -1
  96. package/editors/dateEditor/dateEditor.js +2 -1
  97. package/editors/dateEditor/dateEditor.mjs +2 -1
  98. package/editors/textEditor/textEditor.js +3 -11
  99. package/editors/textEditor/textEditor.mjs +4 -12
  100. package/helpers/mixed.js +1 -1
  101. package/helpers/mixed.mjs +1 -1
  102. package/helpers/number.d.ts +1 -0
  103. package/helpers/number.js +18 -0
  104. package/helpers/number.mjs +17 -0
  105. package/helpers/object.js +1 -0
  106. package/helpers/object.mjs +1 -0
  107. package/index.js +5 -5
  108. package/index.mjs +5 -5
  109. package/package.json +1 -1
  110. package/pluginHooks.d.ts +7 -1
  111. package/pluginHooks.js +106 -1
  112. package/pluginHooks.mjs +106 -1
  113. package/plugins/autoColumnSize/autoColumnSize.js +4 -1
  114. package/plugins/autoColumnSize/autoColumnSize.mjs +4 -1
  115. package/plugins/collapsibleColumns/collapsibleColumns.js +110 -40
  116. package/plugins/collapsibleColumns/collapsibleColumns.mjs +110 -40
  117. package/plugins/columnSorting/columnSorting.js +40 -1
  118. package/plugins/columnSorting/columnSorting.mjs +40 -3
  119. package/plugins/columnSorting/columnStatesManager.js +2 -1
  120. package/plugins/columnSorting/columnStatesManager.mjs +2 -1
  121. package/plugins/columnSorting/index.js +3 -1
  122. package/plugins/columnSorting/index.mjs +1 -1
  123. package/plugins/comments/commentEditor.js +1 -0
  124. package/plugins/comments/commentEditor.mjs +1 -0
  125. package/plugins/comments/comments.js +253 -191
  126. package/plugins/comments/comments.mjs +252 -192
  127. package/plugins/comments/contextMenuItem/addEditComment.js +41 -0
  128. package/plugins/comments/contextMenuItem/addEditComment.mjs +35 -0
  129. package/plugins/comments/contextMenuItem/readOnlyComment.js +49 -0
  130. package/plugins/comments/contextMenuItem/readOnlyComment.mjs +43 -0
  131. package/plugins/comments/contextMenuItem/removeComment.js +38 -0
  132. package/plugins/comments/contextMenuItem/removeComment.mjs +32 -0
  133. package/plugins/contextMenu/contextMenu.d.ts +1 -1
  134. package/plugins/contextMenu/contextMenu.js +72 -30
  135. package/plugins/contextMenu/contextMenu.mjs +73 -31
  136. package/plugins/contextMenu/predefinedItems/alignment.js +7 -0
  137. package/plugins/contextMenu/predefinedItems/alignment.mjs +7 -0
  138. package/plugins/contextMenu/predefinedItems/clearColumn.js +5 -3
  139. package/plugins/contextMenu/predefinedItems/clearColumn.mjs +5 -3
  140. package/plugins/contextMenu/predefinedItems/columnLeft.js +5 -3
  141. package/plugins/contextMenu/predefinedItems/columnLeft.mjs +5 -3
  142. package/plugins/contextMenu/predefinedItems/columnRight.js +5 -3
  143. package/plugins/contextMenu/predefinedItems/columnRight.mjs +5 -3
  144. package/plugins/contextMenu/predefinedItems/readOnly.js +7 -0
  145. package/plugins/contextMenu/predefinedItems/readOnly.mjs +7 -0
  146. package/plugins/contextMenu/predefinedItems/removeColumn.js +7 -5
  147. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +5 -3
  148. package/plugins/contextMenu/predefinedItems/removeRow.js +7 -5
  149. package/plugins/contextMenu/predefinedItems/removeRow.mjs +5 -3
  150. package/plugins/contextMenu/predefinedItems/rowAbove.js +5 -3
  151. package/plugins/contextMenu/predefinedItems/rowAbove.mjs +5 -3
  152. package/plugins/contextMenu/predefinedItems/rowBelow.js +5 -3
  153. package/plugins/contextMenu/predefinedItems/rowBelow.mjs +5 -3
  154. package/plugins/contextMenu/utils.js +28 -16
  155. package/plugins/contextMenu/utils.mjs +27 -15
  156. package/plugins/copyPaste/contextMenuItem/copy.js +7 -0
  157. package/plugins/copyPaste/contextMenuItem/copy.mjs +7 -0
  158. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +9 -1
  159. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +9 -1
  160. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +9 -1
  161. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +9 -1
  162. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +9 -1
  163. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +9 -1
  164. package/plugins/copyPaste/contextMenuItem/cut.js +7 -0
  165. package/plugins/copyPaste/contextMenuItem/cut.mjs +7 -0
  166. package/plugins/copyPaste/copyPaste.js +12 -6
  167. package/plugins/copyPaste/copyPaste.mjs +12 -6
  168. package/plugins/customBorders/customBorders.js +36 -29
  169. package/plugins/customBorders/customBorders.mjs +37 -30
  170. package/plugins/customBorders/utils.js +3 -3
  171. package/plugins/customBorders/utils.mjs +3 -3
  172. package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
  173. package/plugins/dropdownMenu/dropdownMenu.js +89 -32
  174. package/plugins/dropdownMenu/dropdownMenu.mjs +89 -32
  175. package/plugins/filters/conditionCollection.js +6 -5
  176. package/plugins/filters/conditionCollection.mjs +6 -5
  177. package/plugins/filters/filters.js +44 -21
  178. package/plugins/filters/filters.mjs +43 -20
  179. package/plugins/formulas/engine/register.js +3 -3
  180. package/plugins/formulas/engine/register.mjs +3 -3
  181. package/plugins/formulas/engine/settings.js +6 -3
  182. package/plugins/formulas/engine/settings.mjs +6 -3
  183. package/plugins/formulas/formulas.js +151 -143
  184. package/plugins/formulas/formulas.mjs +151 -143
  185. package/plugins/formulas/indexSyncer/axisSyncer.js +115 -79
  186. package/plugins/formulas/indexSyncer/axisSyncer.mjs +115 -79
  187. package/plugins/formulas/indexSyncer/index.js +100 -64
  188. package/plugins/formulas/indexSyncer/index.mjs +100 -64
  189. package/plugins/hiddenColumns/contextMenuItem/showColumn.js +2 -2
  190. package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +2 -2
  191. package/plugins/hiddenColumns/hiddenColumns.js +51 -34
  192. package/plugins/hiddenColumns/hiddenColumns.mjs +51 -34
  193. package/plugins/hiddenRows/contextMenuItem/showRow.js +2 -2
  194. package/plugins/hiddenRows/contextMenuItem/showRow.mjs +2 -2
  195. package/plugins/hiddenRows/hiddenRows.js +50 -33
  196. package/plugins/hiddenRows/hiddenRows.mjs +50 -33
  197. package/plugins/manualRowResize/manualRowResize.js +2 -1
  198. package/plugins/manualRowResize/manualRowResize.mjs +2 -1
  199. package/plugins/mergeCells/mergeCells.js +6 -17
  200. package/plugins/mergeCells/mergeCells.mjs +6 -17
  201. package/plugins/multiColumnSorting/multiColumnSorting.js +37 -2
  202. package/plugins/multiColumnSorting/multiColumnSorting.mjs +37 -2
  203. package/plugins/nestedHeaders/nestedHeaders.js +209 -75
  204. package/plugins/nestedHeaders/nestedHeaders.mjs +208 -74
  205. package/plugins/nestedHeaders/stateManager/headersTree.js +58 -38
  206. package/plugins/nestedHeaders/stateManager/headersTree.mjs +58 -38
  207. package/plugins/nestedHeaders/stateManager/index.js +107 -49
  208. package/plugins/nestedHeaders/stateManager/index.mjs +105 -47
  209. package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.js +1 -1
  210. package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +1 -1
  211. package/plugins/nestedHeaders/stateManager/sourceSettings.js +57 -37
  212. package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +57 -37
  213. package/plugins/nestedHeaders/utils/ghostTable.js +39 -35
  214. package/plugins/nestedHeaders/utils/ghostTable.mjs +39 -35
  215. package/plugins/nestedRows/data/dataManager.js +4 -2
  216. package/plugins/nestedRows/data/dataManager.mjs +4 -2
  217. package/plugins/nestedRows/nestedRows.js +41 -0
  218. package/plugins/nestedRows/nestedRows.mjs +41 -0
  219. package/plugins/persistentState/storage.js +1 -0
  220. package/plugins/persistentState/storage.mjs +1 -0
  221. package/plugins/undoRedo/undoRedo.js +2 -1
  222. package/plugins/undoRedo/undoRedo.mjs +2 -1
  223. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  224. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  225. package/selection/highlight/highlight.js +256 -71
  226. package/selection/highlight/highlight.mjs +250 -71
  227. package/selection/highlight/types/activeHeader.js +10 -8
  228. package/selection/highlight/types/activeHeader.mjs +10 -8
  229. package/selection/highlight/types/area.js +6 -18
  230. package/selection/highlight/types/area.mjs +6 -18
  231. package/selection/highlight/types/areaLayered.js +31 -0
  232. package/selection/highlight/types/areaLayered.mjs +26 -0
  233. package/selection/highlight/types/column.js +27 -0
  234. package/selection/highlight/types/column.mjs +22 -0
  235. package/selection/highlight/types/customSelection.js +7 -9
  236. package/selection/highlight/types/customSelection.mjs +7 -9
  237. package/selection/highlight/types/fill.js +5 -7
  238. package/selection/highlight/types/fill.mjs +5 -7
  239. package/selection/highlight/types/{cell.js → focus.js} +5 -7
  240. package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
  241. package/selection/highlight/types/header.js +9 -18
  242. package/selection/highlight/types/header.mjs +9 -18
  243. package/selection/highlight/types/row.js +27 -0
  244. package/selection/highlight/types/row.mjs +22 -0
  245. package/selection/highlight/visualSelection.js +41 -33
  246. package/selection/highlight/visualSelection.mjs +41 -33
  247. package/selection/index.js +4 -7
  248. package/selection/index.mjs +2 -3
  249. package/selection/mouseEventHandler.js +1 -1
  250. package/selection/mouseEventHandler.mjs +1 -1
  251. package/selection/range.js +8 -8
  252. package/selection/range.mjs +8 -8
  253. package/selection/selection.js +290 -154
  254. package/selection/selection.mjs +287 -153
  255. package/selection/transformation.js +232 -90
  256. package/selection/transformation.mjs +232 -90
  257. package/selection/utils.js +15 -21
  258. package/selection/utils.mjs +16 -21
  259. package/settings.d.ts +2 -0
  260. package/shortcutContexts/commands/editor/closeAndSave.js +12 -0
  261. package/shortcutContexts/commands/editor/closeAndSave.mjs +8 -0
  262. package/shortcutContexts/commands/editor/closeWithoutSaving.js +12 -0
  263. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +8 -0
  264. package/shortcutContexts/commands/editor/fastOpen.js +16 -0
  265. package/shortcutContexts/commands/editor/fastOpen.mjs +12 -0
  266. package/shortcutContexts/commands/editor/index.js +16 -0
  267. package/shortcutContexts/commands/editor/index.mjs +12 -0
  268. package/shortcutContexts/commands/editor/open.js +27 -0
  269. package/shortcutContexts/commands/editor/open.mjs +23 -0
  270. package/shortcutContexts/commands/emptySelectedCells.js +11 -0
  271. package/shortcutContexts/commands/emptySelectedCells.mjs +7 -0
  272. package/shortcutContexts/commands/extendCellsSelection/down.js +15 -0
  273. package/shortcutContexts/commands/extendCellsSelection/down.mjs +11 -0
  274. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +21 -0
  275. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +17 -0
  276. package/shortcutContexts/commands/extendCellsSelection/index.js +26 -0
  277. package/shortcutContexts/commands/extendCellsSelection/index.mjs +22 -0
  278. package/shortcutContexts/commands/extendCellsSelection/left.js +15 -0
  279. package/shortcutContexts/commands/extendCellsSelection/left.mjs +11 -0
  280. package/shortcutContexts/commands/extendCellsSelection/right.js +15 -0
  281. package/shortcutContexts/commands/extendCellsSelection/right.mjs +11 -0
  282. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +19 -0
  283. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +15 -0
  284. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +29 -0
  285. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +25 -0
  286. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +19 -0
  287. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +15 -0
  288. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +19 -0
  289. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +15 -0
  290. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +29 -0
  291. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +25 -0
  292. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +29 -0
  293. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +25 -0
  294. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +29 -0
  295. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +25 -0
  296. package/shortcutContexts/commands/extendCellsSelection/toRows.js +19 -0
  297. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +15 -0
  298. package/shortcutContexts/commands/extendCellsSelection/up.js +15 -0
  299. package/shortcutContexts/commands/extendCellsSelection/up.mjs +11 -0
  300. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +21 -0
  301. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +17 -0
  302. package/shortcutContexts/commands/index.js +35 -0
  303. package/shortcutContexts/commands/index.mjs +31 -0
  304. package/shortcutContexts/commands/moveCellSelection/down.js +13 -0
  305. package/shortcutContexts/commands/moveCellSelection/down.mjs +9 -0
  306. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +31 -0
  307. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +27 -0
  308. package/shortcutContexts/commands/moveCellSelection/index.js +28 -0
  309. package/shortcutContexts/commands/moveCellSelection/index.mjs +24 -0
  310. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +12 -0
  311. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -0
  312. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +12 -0
  313. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -0
  314. package/shortcutContexts/commands/moveCellSelection/left.js +10 -0
  315. package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -0
  316. package/shortcutContexts/commands/moveCellSelection/right.js +10 -0
  317. package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -0
  318. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +17 -0
  319. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +13 -0
  320. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +18 -0
  321. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +14 -0
  322. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +14 -0
  323. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +10 -0
  324. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +17 -0
  325. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +13 -0
  326. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +19 -0
  327. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +15 -0
  328. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +21 -0
  329. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +17 -0
  330. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +17 -0
  331. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +13 -0
  332. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +19 -0
  333. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +15 -0
  334. package/shortcutContexts/commands/moveCellSelection/up.js +13 -0
  335. package/shortcutContexts/commands/moveCellSelection/up.mjs +9 -0
  336. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +31 -0
  337. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +27 -0
  338. package/shortcutContexts/commands/populateSelectedCellsData.js +29 -0
  339. package/shortcutContexts/commands/populateSelectedCellsData.mjs +25 -0
  340. package/shortcutContexts/commands/scrollToFocusedCell.js +36 -0
  341. package/shortcutContexts/commands/scrollToFocusedCell.mjs +32 -0
  342. package/shortcutContexts/commands/selectAll.js +10 -0
  343. package/shortcutContexts/commands/selectAll.mjs +6 -0
  344. package/shortcutContexts/constants.js +13 -0
  345. package/shortcutContexts/constants.mjs +8 -0
  346. package/shortcutContexts/editor.js +25 -0
  347. package/shortcutContexts/editor.mjs +21 -0
  348. package/shortcutContexts/grid.js +163 -0
  349. package/shortcutContexts/grid.mjs +159 -0
  350. package/shortcutContexts/index.js +24 -0
  351. package/shortcutContexts/index.mjs +11 -0
  352. package/shortcuts/manager.js +2 -0
  353. package/shortcuts/manager.mjs +2 -0
  354. package/shortcuts/recorder.js +2 -2
  355. package/shortcuts/recorder.mjs +2 -2
  356. package/shortcuts/utils.js +19 -5
  357. package/shortcuts/utils.mjs +18 -4
  358. package/tableView.js +163 -91
  359. package/tableView.mjs +163 -91
  360. package/translations/changesObservable/observable.js +82 -54
  361. package/translations/changesObservable/observable.mjs +82 -54
  362. package/translations/changesObservable/observer.js +24 -11
  363. package/translations/changesObservable/observer.mjs +24 -11
  364. package/translations/maps/linkedPhysicalIndexToValueMap.js +14 -8
  365. package/translations/maps/linkedPhysicalIndexToValueMap.mjs +14 -8
  366. package/utils/dataStructures/tree.js +21 -18
  367. package/utils/dataStructures/tree.mjs +21 -18
  368. package/3rdparty/walkontable/src/selection.js +0 -295
  369. package/3rdparty/walkontable/src/selection.mjs +0 -290
  370. package/selection/highlight/constants.js +0 -15
  371. package/selection/highlight/constants.mjs +0 -6
  372. package/selection/highlight/types/index.js +0 -35
  373. package/selection/highlight/types/index.mjs +0 -31
@@ -1,4 +1,15 @@
1
1
  import "core-js/modules/es.array.push.js";
2
+ import "core-js/modules/es.error.cause.js";
3
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
4
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
5
+ 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; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
9
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
10
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
11
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
12
+ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
2
13
  import CellCoords from "./../cell/coords.mjs";
3
14
  /* eslint-disable jsdoc/require-description-complete-sentence */
4
15
  /**
@@ -19,43 +30,47 @@ import CellCoords from "./../cell/coords.mjs";
19
30
  * import Handsontable, { CellRange } from '/handsontable/base';
20
31
  * ```
21
32
  */
33
+ var _isRtl = /*#__PURE__*/new WeakMap();
22
34
  class CellRange {
23
- /**
24
- * Used to draw bold border around a cell where selection was started and to edit the cell
25
- * when you press Enter. The highlight cannot point to headers (negative values) so its
26
- * coordinates object is normalized while assigning.
27
- *
28
- * @private
29
- * @type {CellCoords}
30
- */
31
- highlight = null;
32
- /**
33
- * Usually the same as highlight, but in Excel there is distinction - one can change
34
- * highlight within a selection.
35
- *
36
- * @private
37
- * @type {CellCoords}
38
- */
39
- from = null;
40
- /**
41
- * End selection.
42
- *
43
- * @private
44
- * @type {CellCoords}
45
- */
46
- to = null;
47
- /**
48
- * @type {boolean}
49
- */
50
- #isRtl = false;
51
35
  constructor(highlight) {
52
36
  let from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : highlight;
53
37
  let to = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : highlight;
54
38
  let isRtl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
55
- this.highlight = highlight.clone().normalize();
39
+ /**
40
+ * Used to draw bold border around a cell where selection was started and to edit the cell
41
+ * when you press Enter. The highlight cannot point to headers (negative values) so its
42
+ * coordinates object is normalized while assigning.
43
+ *
44
+ * @private
45
+ * @type {CellCoords}
46
+ */
47
+ _defineProperty(this, "highlight", null);
48
+ /**
49
+ * Usually the same as highlight, but in Excel there is distinction - one can change
50
+ * highlight within a selection.
51
+ *
52
+ * @private
53
+ * @type {CellCoords}
54
+ */
55
+ _defineProperty(this, "from", null);
56
+ /**
57
+ * End selection.
58
+ *
59
+ * @private
60
+ * @type {CellCoords}
61
+ */
62
+ _defineProperty(this, "to", null);
63
+ /**
64
+ * @type {boolean}
65
+ */
66
+ _classPrivateFieldInitSpec(this, _isRtl, {
67
+ writable: true,
68
+ value: false
69
+ });
70
+ this.highlight = highlight.clone();
56
71
  this.from = from.clone();
57
72
  this.to = to.clone();
58
- this.#isRtl = isRtl;
73
+ _classPrivateFieldSet(this, _isRtl, isRtl);
59
74
  }
60
75
 
61
76
  /**
@@ -65,7 +80,7 @@ class CellRange {
65
80
  * @returns {CellRange}
66
81
  */
67
82
  setHighlight(coords) {
68
- this.highlight = coords.clone().normalize();
83
+ this.highlight = coords.clone();
69
84
  return this;
70
85
  }
71
86
 
@@ -93,26 +108,57 @@ class CellRange {
93
108
 
94
109
  /**
95
110
  * Checks if the coordinates in your `CellRange` instance are valid
96
- * in the context of a given Walkontable instance.
111
+ * in the context of given table parameters.
97
112
  *
98
113
  * See the [`isValid()`](@/api/cellCoords.md#isvalid) method of the [`CellCoords`](@/api/cellCoords.md) class.
99
114
  *
100
- * @param {Walkontable} wot A Walkontable instance.
115
+ * @param {object} tableParams An object with a defined table size.
116
+ * @param {number} tableParams.countRows The total number of rows.
117
+ * @param {number} tableParams.countCols The total number of columns.
118
+ * @param {number} tableParams.countRowHeaders A number of row headers.
119
+ * @param {number} tableParams.countColHeaders A number of column headers.
101
120
  * @returns {boolean}
102
121
  */
103
- isValid(wot) {
104
- return this.from.isValid(wot) && this.to.isValid(wot);
122
+ isValid(tableParams) {
123
+ return this.from.isValid(tableParams) && this.to.isValid(tableParams);
105
124
  }
106
125
 
107
126
  /**
108
- * Checks if your range is just a single cell.
127
+ * Checks if your range is just a single cell or header.
109
128
  *
110
129
  * @returns {boolean}
111
130
  */
112
131
  isSingle() {
132
+ return this.isSingleCell() || this.isSingleHeader();
133
+ }
134
+
135
+ /**
136
+ * Checks if your range is just a single cell.
137
+ *
138
+ * @returns {boolean}
139
+ */
140
+ isSingleCell() {
113
141
  return this.from.row >= 0 && this.from.row === this.to.row && this.from.col >= 0 && this.from.col === this.to.col;
114
142
  }
115
143
 
144
+ /**
145
+ * Checks if your range is just a single header.
146
+ *
147
+ * @returns {boolean}
148
+ */
149
+ isSingleHeader() {
150
+ return (this.from.row < 0 || this.from.col < 0) && this.from.row === this.to.row && this.from.col === this.to.col;
151
+ }
152
+
153
+ /**
154
+ * Checks if your range overlaps headers range (negative coordinates).
155
+ *
156
+ * @returns {boolean}
157
+ */
158
+ containsHeaders() {
159
+ return this.from.isHeader() || this.to.isHeader();
160
+ }
161
+
116
162
  /**
117
163
  * Returns the height of your range (as a number of rows, including row headers).
118
164
  *
@@ -448,7 +494,7 @@ class CellRange {
448
494
  * @returns {CellCoords}
449
495
  */
450
496
  getTopLeftCorner() {
451
- return this.#isRtl ? this.getTopEndCorner() : this.getTopStartCorner();
497
+ return _classPrivateFieldGet(this, _isRtl) ? this.getTopEndCorner() : this.getTopStartCorner();
452
498
  }
453
499
 
454
500
  /**
@@ -473,7 +519,7 @@ class CellRange {
473
519
  * @returns {CellCoords}
474
520
  */
475
521
  getBottomRightCorner() {
476
- return this.#isRtl ? this.getBottomStartCorner() : this.getBottomEndCorner();
522
+ return _classPrivateFieldGet(this, _isRtl) ? this.getBottomStartCorner() : this.getBottomEndCorner();
477
523
  }
478
524
 
479
525
  /**
@@ -498,7 +544,7 @@ class CellRange {
498
544
  * @returns {CellCoords}
499
545
  */
500
546
  getTopRightCorner() {
501
- return this.#isRtl ? this.getTopStartCorner() : this.getTopEndCorner();
547
+ return _classPrivateFieldGet(this, _isRtl) ? this.getTopStartCorner() : this.getTopEndCorner();
502
548
  }
503
549
 
504
550
  /**
@@ -523,7 +569,7 @@ class CellRange {
523
569
  * @returns {CellCoords}
524
570
  */
525
571
  getBottomLeftCorner() {
526
- return this.#isRtl ? this.getBottomEndCorner() : this.getBottomStartCorner();
572
+ return _classPrivateFieldGet(this, _isRtl) ? this.getBottomEndCorner() : this.getBottomStartCorner();
527
573
  }
528
574
 
529
575
  /**
@@ -548,7 +594,7 @@ class CellRange {
548
594
  * @returns {CellCoords}
549
595
  */
550
596
  getOuterTopLeftCorner() {
551
- return this.#isRtl ? this.getOuterTopEndCorner() : this.getOuterTopStartCorner();
597
+ return _classPrivateFieldGet(this, _isRtl) ? this.getOuterTopEndCorner() : this.getOuterTopStartCorner();
552
598
  }
553
599
 
554
600
  /**
@@ -573,7 +619,7 @@ class CellRange {
573
619
  * @returns {CellCoords}
574
620
  */
575
621
  getOuterBottomRightCorner() {
576
- return this.#isRtl ? this.getOuterBottomStartCorner() : this.getOuterBottomEndCorner();
622
+ return _classPrivateFieldGet(this, _isRtl) ? this.getOuterBottomStartCorner() : this.getOuterBottomEndCorner();
577
623
  }
578
624
 
579
625
  /**
@@ -598,7 +644,7 @@ class CellRange {
598
644
  * @returns {CellCoords}
599
645
  */
600
646
  getOuterTopRightCorner() {
601
- return this.#isRtl ? this.getOuterTopStartCorner() : this.getOuterTopEndCorner();
647
+ return _classPrivateFieldGet(this, _isRtl) ? this.getOuterTopStartCorner() : this.getOuterTopEndCorner();
602
648
  }
603
649
 
604
650
  /**
@@ -623,7 +669,7 @@ class CellRange {
623
669
  * @returns {CellCoords}
624
670
  */
625
671
  getOuterBottomLeftCorner() {
626
- return this.#isRtl ? this.getOuterBottomEndCorner() : this.getOuterBottomStartCorner();
672
+ return _classPrivateFieldGet(this, _isRtl) ? this.getOuterBottomEndCorner() : this.getOuterBottomStartCorner();
627
673
  }
628
674
 
629
675
  /**
@@ -792,7 +838,7 @@ class CellRange {
792
838
  * @returns {CellRange}
793
839
  */
794
840
  clone() {
795
- return new CellRange(this.highlight, this.from, this.to, this.#isRtl);
841
+ return new CellRange(this.highlight, this.from, this.to, _classPrivateFieldGet(this, _isRtl));
796
842
  }
797
843
 
798
844
  /**
@@ -826,7 +872,7 @@ class CellRange {
826
872
  * @returns {CellCoords}
827
873
  */
828
874
  _createCellCoords(row, column) {
829
- return new CellCoords(row, column, this.#isRtl);
875
+ return new CellCoords(row, column, _classPrivateFieldGet(this, _isRtl));
830
876
  }
831
877
  }
832
878
  export default CellRange;
@@ -2,6 +2,7 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.array.push.js");
5
+ require("core-js/modules/es.error.cause.js");
5
6
  var _element = require("../../../../helpers/dom/element");
6
7
  var _string = require("../../../../helpers/string");
7
8
  var _eventManager = _interopRequireDefault(require("../../../../eventManager"));
@@ -9,42 +10,14 @@ var _scroll = _interopRequireDefault(require("../scroll"));
9
10
  var _coords = _interopRequireDefault(require("../cell/coords"));
10
11
  var _range = _interopRequireDefault(require("../cell/range"));
11
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
15
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
16
  /**
13
17
  * @abstract
14
18
  * @class Walkontable
15
19
  */
16
20
  class CoreAbstract {
17
- wtTable;
18
- wtScroll;
19
- wtViewport;
20
- wtOverlays;
21
- selections;
22
- wtEvent;
23
- /**
24
- * The walkontable instance id.
25
- *
26
- * @public
27
- * @type {Readonly<string>}
28
- */
29
- guid = `wt_${(0, _string.randomString)()}`;
30
- drawInterrupted = false;
31
- drawn = false;
32
-
33
- /**
34
- * The DOM bindings.
35
- *
36
- * @public
37
- * @type {DomBindings}
38
- */
39
- domBindings;
40
-
41
- /**
42
- * Settings.
43
- *
44
- * @public
45
- * @type {Settings}
46
- */
47
- wtSettings;
48
21
  get eventManager() {
49
22
  return new _eventManager.default(this);
50
23
  }
@@ -54,6 +27,35 @@ class CoreAbstract {
54
27
  * @param {Settings} settings The Walkontable settings.
55
28
  */
56
29
  constructor(table, settings) {
30
+ _defineProperty(this, "wtTable", void 0);
31
+ _defineProperty(this, "wtScroll", void 0);
32
+ _defineProperty(this, "wtViewport", void 0);
33
+ _defineProperty(this, "wtOverlays", void 0);
34
+ _defineProperty(this, "selectionManager", void 0);
35
+ _defineProperty(this, "wtEvent", void 0);
36
+ /**
37
+ * The walkontable instance id.
38
+ *
39
+ * @public
40
+ * @type {Readonly<string>}
41
+ */
42
+ _defineProperty(this, "guid", `wt_${(0, _string.randomString)()}`);
43
+ _defineProperty(this, "drawInterrupted", false);
44
+ _defineProperty(this, "drawn", false);
45
+ /**
46
+ * The DOM bindings.
47
+ *
48
+ * @public
49
+ * @type {DomBindings}
50
+ */
51
+ _defineProperty(this, "domBindings", void 0);
52
+ /**
53
+ * Settings.
54
+ *
55
+ * @public
56
+ * @type {Settings}
57
+ */
58
+ _defineProperty(this, "wtSettings", void 0);
57
59
  this.domBindings = {
58
60
  rootTable: table,
59
61
  rootDocument: table.ownerDocument,
@@ -307,8 +309,8 @@ class CoreAbstract {
307
309
  return wot.wtOverlays; // TODO refactoring: move outside dao, use IOC
308
310
  },
309
311
 
310
- get selections() {
311
- return wot.selections; // TODO refactoring: move outside dao, use IOC
312
+ get selectionManager() {
313
+ return wot.selectionManager; // TODO refactoring: move outside dao, use IOC
312
314
  },
313
315
 
314
316
  get drawn() {
@@ -357,6 +359,12 @@ class CoreAbstract {
357
359
  },
358
360
  get countRowsVisible() {
359
361
  return wot.wtViewport.rowsVisibleCalculator.count;
362
+ },
363
+ get columnHeaders() {
364
+ return wot.wtSettings.getSetting('columnHeaders');
365
+ },
366
+ get rowHeaders() {
367
+ return wot.wtSettings.getSetting('rowHeaders');
360
368
  }
361
369
  };
362
370
  }
@@ -1,4 +1,8 @@
1
1
  import "core-js/modules/es.array.push.js";
2
+ import "core-js/modules/es.error.cause.js";
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
6
  import { fastInnerText } from "../../../../helpers/dom/element.mjs";
3
7
  import { randomString } from "../../../../helpers/string.mjs";
4
8
  import EventManager from "../../../../eventManager.mjs";
@@ -10,37 +14,6 @@ import CellRange from "../cell/range.mjs";
10
14
  * @class Walkontable
11
15
  */
12
16
  export default class CoreAbstract {
13
- wtTable;
14
- wtScroll;
15
- wtViewport;
16
- wtOverlays;
17
- selections;
18
- wtEvent;
19
- /**
20
- * The walkontable instance id.
21
- *
22
- * @public
23
- * @type {Readonly<string>}
24
- */
25
- guid = `wt_${randomString()}`;
26
- drawInterrupted = false;
27
- drawn = false;
28
-
29
- /**
30
- * The DOM bindings.
31
- *
32
- * @public
33
- * @type {DomBindings}
34
- */
35
- domBindings;
36
-
37
- /**
38
- * Settings.
39
- *
40
- * @public
41
- * @type {Settings}
42
- */
43
- wtSettings;
44
17
  get eventManager() {
45
18
  return new EventManager(this);
46
19
  }
@@ -50,6 +23,35 @@ export default class CoreAbstract {
50
23
  * @param {Settings} settings The Walkontable settings.
51
24
  */
52
25
  constructor(table, settings) {
26
+ _defineProperty(this, "wtTable", void 0);
27
+ _defineProperty(this, "wtScroll", void 0);
28
+ _defineProperty(this, "wtViewport", void 0);
29
+ _defineProperty(this, "wtOverlays", void 0);
30
+ _defineProperty(this, "selectionManager", void 0);
31
+ _defineProperty(this, "wtEvent", void 0);
32
+ /**
33
+ * The walkontable instance id.
34
+ *
35
+ * @public
36
+ * @type {Readonly<string>}
37
+ */
38
+ _defineProperty(this, "guid", `wt_${randomString()}`);
39
+ _defineProperty(this, "drawInterrupted", false);
40
+ _defineProperty(this, "drawn", false);
41
+ /**
42
+ * The DOM bindings.
43
+ *
44
+ * @public
45
+ * @type {DomBindings}
46
+ */
47
+ _defineProperty(this, "domBindings", void 0);
48
+ /**
49
+ * Settings.
50
+ *
51
+ * @public
52
+ * @type {Settings}
53
+ */
54
+ _defineProperty(this, "wtSettings", void 0);
53
55
  this.domBindings = {
54
56
  rootTable: table,
55
57
  rootDocument: table.ownerDocument,
@@ -303,8 +305,8 @@ export default class CoreAbstract {
303
305
  return wot.wtOverlays; // TODO refactoring: move outside dao, use IOC
304
306
  },
305
307
 
306
- get selections() {
307
- return wot.selections; // TODO refactoring: move outside dao, use IOC
308
+ get selectionManager() {
309
+ return wot.selectionManager; // TODO refactoring: move outside dao, use IOC
308
310
  },
309
311
 
310
312
  get drawn() {
@@ -353,6 +355,12 @@ export default class CoreAbstract {
353
355
  },
354
356
  get countRowsVisible() {
355
357
  return wot.wtViewport.rowsVisibleCalculator.count;
358
+ },
359
+ get columnHeaders() {
360
+ return wot.wtSettings.getSetting('columnHeaders');
361
+ },
362
+ get rowHeaders() {
363
+ return wot.wtSettings.getSetting('rowHeaders');
356
364
  }
357
365
  };
358
366
  }
@@ -1,16 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
+ require("core-js/modules/es.error.cause.js");
4
5
  var _event = _interopRequireDefault(require("../event"));
5
6
  var _base = _interopRequireDefault(require("./_base"));
6
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
+ 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; }
9
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
10
+ 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
11
  /**
8
12
  * @class Walkontable
9
13
  */
10
14
  class Clone extends _base.default {
11
- cloneSource;
12
- cloneOverlay;
13
-
14
15
  /**
15
16
  * @param {HTMLTableElement} table Main table.
16
17
  * @param {SettingsPure|Settings} settings The Walkontable settings.
@@ -18,13 +19,15 @@ class Clone extends _base.default {
18
19
  */
19
20
  constructor(table, settings, clone) {
20
21
  super(table, settings);
22
+ _defineProperty(this, "cloneSource", void 0);
23
+ _defineProperty(this, "cloneOverlay", void 0);
21
24
  const facadeGetter = this.wtSettings.getSetting('facade', this);
22
25
  this.cloneSource = clone.source;
23
26
  this.cloneOverlay = clone.overlay;
24
27
  this.wtTable = this.cloneOverlay.createTable(this.getTableDao(), facadeGetter, this.domBindings, this.wtSettings);
25
28
  this.wtViewport = clone.viewport;
26
- this.selections = clone.selections;
27
- this.wtEvent = new _event.default(facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable, this.selections, clone.event);
29
+ this.selectionManager = clone.selectionManager;
30
+ this.wtEvent = new _event.default(facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable, this.selectionManager, clone.event);
28
31
  this.findOriginalHeaders();
29
32
  }
30
33
  }
@@ -1,12 +1,13 @@
1
+ import "core-js/modules/es.error.cause.js";
2
+ 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; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
+ 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); }
1
5
  import Event from "../event.mjs";
2
6
  import CoreAbstract from "./_base.mjs";
3
7
  /**
4
8
  * @class Walkontable
5
9
  */
6
10
  export default class Clone extends CoreAbstract {
7
- cloneSource;
8
- cloneOverlay;
9
-
10
11
  /**
11
12
  * @param {HTMLTableElement} table Main table.
12
13
  * @param {SettingsPure|Settings} settings The Walkontable settings.
@@ -14,13 +15,15 @@ export default class Clone extends CoreAbstract {
14
15
  */
15
16
  constructor(table, settings, clone) {
16
17
  super(table, settings);
18
+ _defineProperty(this, "cloneSource", void 0);
19
+ _defineProperty(this, "cloneOverlay", void 0);
17
20
  const facadeGetter = this.wtSettings.getSetting('facade', this);
18
21
  this.cloneSource = clone.source;
19
22
  this.cloneOverlay = clone.overlay;
20
23
  this.wtTable = this.cloneOverlay.createTable(this.getTableDao(), facadeGetter, this.domBindings, this.wtSettings);
21
24
  this.wtViewport = clone.viewport;
22
- this.selections = clone.selections;
23
- this.wtEvent = new Event(facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable, this.selections, clone.event);
25
+ this.selectionManager = clone.selectionManager;
26
+ this.wtEvent = new Event(facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable, this.selectionManager, clone.event);
24
27
  this.findOriginalHeaders();
25
28
  }
26
29
  }
@@ -8,6 +8,7 @@ var _settings = _interopRequireDefault(require("../settings"));
8
8
  var _master = _interopRequireDefault(require("../table/master"));
9
9
  var _viewport = _interopRequireDefault(require("../viewport"));
10
10
  var _base = _interopRequireDefault(require("./_base"));
11
+ var _manager = require("../selection/manager");
11
12
  var _object = require("../../../../helpers/object");
12
13
  var _element = require("../../../../helpers/dom/element");
13
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -25,8 +26,8 @@ class Walkontable extends _base.default {
25
26
 
26
27
  this.wtTable = new _master.default(this.getTableDao(), facadeGetter, this.domBindings, this.wtSettings);
27
28
  this.wtViewport = new _viewport.default(this.getViewportDao(), this.domBindings, this.wtSettings, this.eventManager, this.wtTable);
28
- this.selections = this.wtSettings.getSetting('selections');
29
- this.wtEvent = new _event.default(facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable, this.selections);
29
+ this.selectionManager = new _manager.SelectionManager(this.wtSettings.getSetting('selections'));
30
+ this.wtEvent = new _event.default(facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable, this.selectionManager);
30
31
  this.wtOverlays = new _overlays.default(
31
32
  // TODO create DAO and remove reference to the Walkontable instance.
32
33
  this, facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable);
@@ -5,6 +5,7 @@ import Settings from "../settings.mjs";
5
5
  import MasterTable from "../table/master.mjs";
6
6
  import Viewport from "../viewport.mjs";
7
7
  import CoreAbstract from "./_base.mjs";
8
+ import { SelectionManager } from "../selection/manager.mjs";
8
9
  import { objectEach } from "../../../../helpers/object.mjs";
9
10
  import { addClass, removeClass } from "../../../../helpers/dom/element.mjs";
10
11
  /**
@@ -21,8 +22,8 @@ export default class Walkontable extends CoreAbstract {
21
22
 
22
23
  this.wtTable = new MasterTable(this.getTableDao(), facadeGetter, this.domBindings, this.wtSettings);
23
24
  this.wtViewport = new Viewport(this.getViewportDao(), this.domBindings, this.wtSettings, this.eventManager, this.wtTable);
24
- this.selections = this.wtSettings.getSetting('selections');
25
- this.wtEvent = new Event(facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable, this.selections);
25
+ this.selectionManager = new SelectionManager(this.wtSettings.getSetting('selections'));
26
+ this.wtEvent = new Event(facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable, this.selectionManager);
26
27
  this.wtOverlays = new Overlays(
27
28
  // TODO create DAO and remove reference to the Walkontable instance.
28
29
  this, facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable);
@@ -18,15 +18,15 @@ class Event {
18
18
  * @param {Settings} wtSettings The walkontable settings.
19
19
  * @param {EventManager} eventManager The walkontable event manager.
20
20
  * @param {Table} wtTable The table.
21
- * @param {Selections} selections Selections.
21
+ * @param {SelectionManager} selectionManager Selections.
22
22
  * @param {Event} [parent=null] The main Event instance.
23
23
  */
24
- constructor(facadeGetter, domBindings, wtSettings, eventManager, wtTable, selections) {
24
+ constructor(facadeGetter, domBindings, wtSettings, eventManager, wtTable, selectionManager) {
25
25
  let parent = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
26
26
  this.wtSettings = wtSettings;
27
27
  this.domBindings = domBindings;
28
28
  this.wtTable = wtTable;
29
- this.selections = selections;
29
+ this.selectionManager = selectionManager;
30
30
  this.parent = parent;
31
31
 
32
32
  /**
@@ -134,11 +134,11 @@ class Event {
134
134
  cell.coords = this.wtTable.getCoords(TD);
135
135
  cell.TD = TD;
136
136
  } else if ((0, _element.hasClass)(elem, 'wtBorder') && (0, _element.hasClass)(elem, 'current')) {
137
- cell.coords = this.selections.getCell().cellRange.highlight;
137
+ cell.coords = this.selectionManager.getFocusSelection().cellRange.highlight;
138
138
  cell.TD = this.wtTable.getCell(cell.coords);
139
139
  } else if ((0, _element.hasClass)(elem, 'wtBorder') && (0, _element.hasClass)(elem, 'area')) {
140
- if (this.selections.createOrGetArea().cellRange) {
141
- cell.coords = this.selections.createOrGetArea().cellRange.to;
140
+ if (this.selectionManager.getAreaSelection().cellRange) {
141
+ cell.coords = this.selectionManager.getAreaSelection().cellRange.to;
142
142
  cell.TD = this.wtTable.getCell(cell.coords);
143
143
  }
144
144
  }
@@ -276,7 +276,7 @@ class Event {
276
276
  */
277
277
  onTouchStart(event) {
278
278
  const priv = privatePool.get(this);
279
- priv.selectedCellBeforeTouchEnd = this.selections.getCell().cellRange;
279
+ priv.selectedCellBeforeTouchEnd = this.selectionManager.getFocusSelection().cellRange;
280
280
  this.touchApplied = true;
281
281
  this.onMouseDown(event);
282
282
  }
@@ -288,8 +288,9 @@ class Event {
288
288
  * @param {MouseEvent} event The mouse event object.
289
289
  */
290
290
  onTouchEnd(event) {
291
+ var _this$parentCell;
291
292
  const target = event.target;
292
- const parentCellCoords = this.parentCell(target)?.coords;
293
+ const parentCellCoords = (_this$parentCell = this.parentCell(target)) === null || _this$parentCell === void 0 ? void 0 : _this$parentCell.coords;
293
294
  const isCellsRange = (0, _mixed.isDefined)(parentCellCoords) && parentCellCoords.row >= 0 && parentCellCoords.col >= 0;
294
295
  const isEventCancelable = event.cancelable && isCellsRange && this.wtSettings.getSetting('isDataViewInstance');
295
296