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,17 +1,28 @@
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");
5
6
  var _element = require("../../helpers/dom/element");
6
7
  var _number = require("../../helpers/number");
7
- var _event = require("../../helpers/dom/event");
8
8
  var _templateLiteralTag = require("../../helpers/templateLiteralTag");
9
+ var _event = require("../../helpers/dom/event");
9
10
  var _console = require("../../helpers/console");
10
11
  var _selection = require("../../selection");
11
12
  var _base = require("../base");
12
- var _stateManager = _interopRequireDefault(require("./stateManager"));
13
+ var _stateManager2 = _interopRequireDefault(require("./stateManager"));
13
14
  var _ghostTable = _interopRequireDefault(require("./utils/ghostTable"));
14
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+ 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; }
17
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
18
+ 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); }
19
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
20
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
21
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
22
+ 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; } }
23
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
24
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
25
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
15
26
  const PLUGIN_KEY = 'nestedHeaders';
16
27
  exports.PLUGIN_KEY = PLUGIN_KEY;
17
28
  const PLUGIN_PRIORITY = 280;
@@ -62,46 +73,54 @@ const PLUGIN_PRIORITY = 280;
62
73
  * :::
63
74
  */
64
75
  exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
76
+ var _stateManager = /*#__PURE__*/new WeakMap();
77
+ var _hidingIndexMapObserver = /*#__PURE__*/new WeakMap();
65
78
  class NestedHeaders extends _base.BasePlugin {
79
+ constructor() {
80
+ super(...arguments);
81
+ /**
82
+ * The state manager for the nested headers.
83
+ *
84
+ * @private
85
+ * @type {StateManager}
86
+ */
87
+ _classPrivateFieldInitSpec(this, _stateManager, {
88
+ writable: true,
89
+ value: new _stateManager2.default()
90
+ });
91
+ /**
92
+ * The instance of the ChangesObservable class that allows track the changes that happens in the
93
+ * column indexes.
94
+ *
95
+ * @private
96
+ * @type {ChangesObservable}
97
+ */
98
+ _classPrivateFieldInitSpec(this, _hidingIndexMapObserver, {
99
+ writable: true,
100
+ value: null
101
+ });
102
+ /**
103
+ * Custom helper for getting widths of the nested headers.
104
+ *
105
+ * @private
106
+ * @type {GhostTable}
107
+ */
108
+ // @TODO This should be changed after refactor handsontable/utils/ghostTable.
109
+ _defineProperty(this, "ghostTable", new _ghostTable.default(this.hot, (row, column) => this.getHeaderSettings(row, column)));
110
+ /**
111
+ * The flag which determines that the nested header settings contains overlapping headers
112
+ * configuration.
113
+ *
114
+ * @type {boolean}
115
+ */
116
+ _defineProperty(this, "detectedOverlappedHeaders", false);
117
+ }
66
118
  static get PLUGIN_KEY() {
67
119
  return PLUGIN_KEY;
68
120
  }
69
121
  static get PLUGIN_PRIORITY() {
70
122
  return PLUGIN_PRIORITY;
71
123
  }
72
-
73
- /**
74
- * The state manager for the nested headers.
75
- *
76
- * @private
77
- * @type {StateManager}
78
- */
79
- #stateManager = new _stateManager.default();
80
- /**
81
- * The instance of the ChangesObservable class that allows track the changes that happens in the
82
- * column indexes.
83
- *
84
- * @private
85
- * @type {ChangesObservable}
86
- */
87
- #hidingIndexMapObserver = null;
88
- /**
89
- * Custom helper for getting widths of the nested headers.
90
- *
91
- * @private
92
- * @type {GhostTable}
93
- */
94
- // @TODO This should be changed after refactor handsontable/utils/ghostTable.
95
- ghostTable = new _ghostTable.default(this.hot, (row, column) => this.getHeaderSettings(row, column));
96
-
97
- /**
98
- * The flag which determines that the nested header settings contains overlapping headers
99
- * configuration.
100
- *
101
- * @type {boolean}
102
- */
103
- detectedOverlappedHeaders = false;
104
-
105
124
  /**
106
125
  * Check if plugin is enabled.
107
126
  *
@@ -139,6 +158,10 @@ class NestedHeaders extends _base.BasePlugin {
139
158
  this.addHook('beforeOnCellMouseOver', function () {
140
159
  return _this.onBeforeOnCellMouseOver(...arguments);
141
160
  });
161
+ this.addHook('modifyTransformStart', function () {
162
+ return _this.onModifyTransformStart(...arguments);
163
+ });
164
+ this.addHook('afterSelection', () => this.updateFocusHighlightPosition());
142
165
  this.addHook('afterGetColumnHeaderRenderers', array => this.onAfterGetColumnHeaderRenderers(array));
143
166
  this.addHook('modifyColWidth', function () {
144
167
  return _this.onModifyColWidth(...arguments);
@@ -152,9 +175,14 @@ class NestedHeaders extends _base.BasePlugin {
152
175
  this.addHook('beforeCopy', function () {
153
176
  return _this.onBeforeCopy(...arguments);
154
177
  });
178
+ this.addHook('beforeSelectColumns', function () {
179
+ return _this.onBeforeSelectColumns(...arguments);
180
+ });
155
181
  this.addHook('afterViewportColumnCalculatorOverride', function () {
156
182
  return _this.onAfterViewportColumnCalculatorOverride(...arguments);
157
183
  });
184
+ this.hot.columnIndexMapper.addLocalHook('cacheUpdated', () => this.updateFocusHighlightPosition());
185
+ this.hot.rowIndexMapper.addLocalHook('cacheUpdated', () => this.updateFocusHighlightPosition());
158
186
  super.enablePlugin();
159
187
  this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
160
188
  }
@@ -173,9 +201,9 @@ class NestedHeaders extends _base.BasePlugin {
173
201
  const {
174
202
  nestedHeaders
175
203
  } = this.hot.getSettings();
176
- this.#stateManager.setColumnsLimit(this.hot.countCols());
204
+ _classPrivateFieldGet(this, _stateManager).setColumnsLimit(this.hot.countCols());
177
205
  if (Array.isArray(nestedHeaders)) {
178
- this.detectedOverlappedHeaders = this.#stateManager.setState(nestedHeaders);
206
+ this.detectedOverlappedHeaders = _classPrivateFieldGet(this, _stateManager).setState(nestedHeaders);
179
207
  }
180
208
  if (this.detectedOverlappedHeaders) {
181
209
  (0, _console.warn)((0, _templateLiteralTag.toSingleLine)`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
@@ -187,11 +215,11 @@ class NestedHeaders extends _base.BasePlugin {
187
215
  // as if all the columns are visible, needs to be modified to be in sync with a dataset.
188
216
  this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((isColumnHidden, physicalColumnIndex) => {
189
217
  const actionName = isColumnHidden === true ? 'hide-column' : 'show-column';
190
- this.#stateManager.triggerColumnModification(actionName, physicalColumnIndex);
218
+ _classPrivateFieldGet(this, _stateManager).triggerColumnModification(actionName, physicalColumnIndex);
191
219
  });
192
220
  }
193
- if (!this.#hidingIndexMapObserver && this.enabled) {
194
- this.#hidingIndexMapObserver = this.hot.columnIndexMapper.createChangesObserver('hiding').subscribe(changes => {
221
+ if (!_classPrivateFieldGet(this, _hidingIndexMapObserver) && this.enabled) {
222
+ _classPrivateFieldSet(this, _hidingIndexMapObserver, this.hot.columnIndexMapper.createChangesObserver('hiding').subscribe(changes => {
195
223
  changes.forEach(_ref => {
196
224
  let {
197
225
  op,
@@ -200,11 +228,11 @@ class NestedHeaders extends _base.BasePlugin {
200
228
  } = _ref;
201
229
  if (op === 'replace') {
202
230
  const actionName = newValue === true ? 'hide-column' : 'show-column';
203
- this.#stateManager.triggerColumnModification(actionName, columnIndex);
231
+ _classPrivateFieldGet(this, _stateManager).triggerColumnModification(actionName, columnIndex);
204
232
  }
205
233
  });
206
234
  this.ghostTable.buildWidthsMap();
207
- });
235
+ }));
208
236
  }
209
237
  this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap();
210
238
  super.updatePlugin();
@@ -215,9 +243,9 @@ class NestedHeaders extends _base.BasePlugin {
215
243
  */
216
244
  disablePlugin() {
217
245
  this.clearColspans();
218
- this.#stateManager.clear();
219
- this.#hidingIndexMapObserver.unsubscribe();
220
- this.#hidingIndexMapObserver = null;
246
+ _classPrivateFieldGet(this, _stateManager).clear();
247
+ _classPrivateFieldGet(this, _hidingIndexMapObserver).unsubscribe();
248
+ _classPrivateFieldSet(this, _hidingIndexMapObserver, null);
221
249
  this.ghostTable.clear();
222
250
  super.disablePlugin();
223
251
  }
@@ -229,7 +257,7 @@ class NestedHeaders extends _base.BasePlugin {
229
257
  * @returns {StateManager}
230
258
  */
231
259
  getStateManager() {
232
- return this.#stateManager;
260
+ return _classPrivateFieldGet(this, _stateManager);
233
261
  }
234
262
 
235
263
  /**
@@ -239,7 +267,7 @@ class NestedHeaders extends _base.BasePlugin {
239
267
  * @returns {number}
240
268
  */
241
269
  getLayersCount() {
242
- return this.#stateManager.getLayersCount();
270
+ return _classPrivateFieldGet(this, _stateManager).getLayersCount();
243
271
  }
244
272
 
245
273
  /**
@@ -253,7 +281,7 @@ class NestedHeaders extends _base.BasePlugin {
253
281
  * @returns {object}
254
282
  */
255
283
  getHeaderSettings(headerLevel, columnIndex) {
256
- return this.#stateManager.getHeaderSettings(headerLevel, columnIndex);
284
+ return _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, columnIndex);
257
285
  }
258
286
 
259
287
  /**
@@ -307,7 +335,7 @@ class NestedHeaders extends _base.BasePlugin {
307
335
  var _this2 = this;
308
336
  const fixedColumnsStart = this.hot.view._wt.getSetting('fixedColumnsStart');
309
337
  return (renderedColumnIndex, TH) => {
310
- var _this$stateManager$ge;
338
+ var _classPrivateFieldGet2;
311
339
  const {
312
340
  columnIndexMapper,
313
341
  view
@@ -322,17 +350,18 @@ class NestedHeaders extends _base.BasePlugin {
322
350
  colspan,
323
351
  isHidden,
324
352
  isPlaceholder
325
- } = (_this$stateManager$ge = this.#stateManager.getHeaderSettings(headerLevel, visualColumnIndex)) != null ? _this$stateManager$ge : {
353
+ } = (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : {
326
354
  label: ''
327
355
  };
328
356
  if (isPlaceholder || isHidden) {
329
357
  (0, _element.addClass)(TH, 'hiddenHeader');
330
358
  } else if (colspan > 1) {
359
+ var _wtOverlays$topInline, _wtOverlays$inlineSta;
331
360
  const {
332
361
  wtOverlays
333
362
  } = view._wt;
334
- const isTopInlineStartOverlay = wtOverlays.topInlineStartCornerOverlay?.clone.wtTable.THEAD.contains(TH);
335
- const isInlineStartOverlay = wtOverlays.inlineStartOverlay?.clone.wtTable.THEAD.contains(TH);
363
+ const isTopInlineStartOverlay = (_wtOverlays$topInline = wtOverlays.topInlineStartCornerOverlay) === null || _wtOverlays$topInline === void 0 ? void 0 : _wtOverlays$topInline.clone.wtTable.THEAD.contains(TH);
364
+ const isInlineStartOverlay = (_wtOverlays$inlineSta = wtOverlays.inlineStartOverlay) === null || _wtOverlays$inlineSta === void 0 ? void 0 : _wtOverlays$inlineSta.clone.wtTable.THEAD.contains(TH);
336
365
 
337
366
  // Check if there is a fixed column enabled, if so then reduce colspan to fixed column width.
338
367
  const correctedColspan = isTopInlineStartOverlay || isInlineStartOverlay ? Math.min(colspan, fixedColumnsStart - renderedColumnIndex) : colspan;
@@ -358,17 +387,45 @@ class NestedHeaders extends _base.BasePlugin {
358
387
  * @returns {string} Returns the column header value to update.
359
388
  */
360
389
  getColumnHeaderValue(visualColumnIndex, headerLevel) {
361
- var _this$stateManager$ge2;
390
+ var _classPrivateFieldGet3;
362
391
  const {
363
392
  isHidden,
364
393
  isPlaceholder
365
- } = (_this$stateManager$ge2 = this.#stateManager.getHeaderSettings(headerLevel, visualColumnIndex)) != null ? _this$stateManager$ge2 : {};
394
+ } = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : {};
366
395
  if (isPlaceholder || isHidden) {
367
396
  return '';
368
397
  }
369
398
  return this.hot.getColHeader(visualColumnIndex, headerLevel);
370
399
  }
371
400
 
401
+ /**
402
+ * Updates the selection focus highlight position to point to the nested header root element (TH)
403
+ * even when the logical coordinates point in-between the header.
404
+ *
405
+ * @private
406
+ */
407
+ updateFocusHighlightPosition() {
408
+ var _this$hot;
409
+ const selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeLast();
410
+ if (!selection) {
411
+ return;
412
+ }
413
+ const {
414
+ highlight
415
+ } = selection;
416
+ const isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
417
+ if (isNestedHeadersRange) {
418
+ const columnIndex = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(highlight.row, highlight.col);
419
+ const focusHighlight = this.hot.selection.highlight.getFocus();
420
+
421
+ // Correct the highlight/focus selection to highlight the correct TH element
422
+ focusHighlight.visualCellRange.highlight.col = columnIndex;
423
+ focusHighlight.visualCellRange.from.col = columnIndex;
424
+ focusHighlight.visualCellRange.to.col = columnIndex;
425
+ focusHighlight.commit();
426
+ }
427
+ }
428
+
372
429
  /**
373
430
  * Allows to control which header DOM element will be used to highlight.
374
431
  *
@@ -379,12 +436,11 @@ class NestedHeaders extends _base.BasePlugin {
379
436
  * @returns {number}
380
437
  */
381
438
  onBeforeHighlightingColumnHeader(visualColumn, headerLevel, highlightMeta) {
382
- const headerNodeData = this.#stateManager.getHeaderTreeNodeData(headerLevel, visualColumn);
439
+ const headerNodeData = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumn);
383
440
  if (!headerNodeData) {
384
441
  return visualColumn;
385
442
  }
386
443
  const {
387
- classNames,
388
444
  columnCursor,
389
445
  selectionType,
390
446
  selectionWidth
@@ -392,15 +448,15 @@ class NestedHeaders extends _base.BasePlugin {
392
448
  const {
393
449
  isRoot,
394
450
  colspan
395
- } = this.#stateManager.getHeaderSettings(headerLevel, visualColumn);
451
+ } = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumn);
396
452
  if (selectionType === _selection.HEADER_TYPE) {
397
453
  if (!isRoot) {
398
454
  return headerNodeData.columnIndex;
399
455
  }
400
456
  } else if (selectionType === _selection.ACTIVE_HEADER_TYPE) {
401
457
  if (colspan > selectionWidth - columnCursor || !isRoot) {
402
- // Reset the class names array so the generated TH element won't be modified.
403
- classNames.length = 0;
458
+ // Prevents adding any CSS class names to the TH element
459
+ return null;
404
460
  }
405
461
  }
406
462
  return visualColumn;
@@ -441,13 +497,14 @@ class NestedHeaders extends _base.BasePlugin {
441
497
  }
442
498
  for (let column = startCol; column <= endCol; column++) {
443
499
  for (let row = startRow; row <= endRow; row++) {
500
+ var _classPrivateFieldGet4;
444
501
  const zeroBasedColumnHeaderLevel = rowsCount + row;
445
502
  const zeroBasedColumnIndex = column - startCol;
446
503
  if (zeroBasedColumnIndex === 0) {
447
504
  continue; // eslint-disable-line no-continue
448
505
  }
449
506
 
450
- const isRoot = this.#stateManager.getHeaderTreeNodeData(row, column)?.isRoot;
507
+ const isRoot = (_classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(row, column)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4.isRoot;
451
508
  if (isRoot === false) {
452
509
  data[zeroBasedColumnHeaderLevel][zeroBasedColumnIndex] = '';
453
510
  }
@@ -553,13 +610,90 @@ class NestedHeaders extends _base.BasePlugin {
553
610
  controller.cell = true;
554
611
  const columnsToSelect = [];
555
612
  if (coords.col < from.col) {
556
- columnsToSelect.push(bottomEndCoords.col, columnIndex);
613
+ columnsToSelect.push(bottomEndCoords.col, columnIndex, coords.row);
557
614
  } else if (coords.col > from.col) {
558
- columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1);
615
+ columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1, coords.row);
559
616
  } else {
560
- columnsToSelect.push(columnIndex, columnIndex + origColspan - 1);
617
+ columnsToSelect.push(columnIndex, columnIndex + origColspan - 1, coords.row);
618
+ }
619
+ this.hot.selection.selectColumns(...columnsToSelect);
620
+ }
621
+
622
+ /**
623
+ * `modifyTransformStart` hook is called every time the keyboard navigation is used.
624
+ *
625
+ * @private
626
+ * @param {object} delta The transformation delta.
627
+ */
628
+ onModifyTransformStart(delta) {
629
+ const {
630
+ highlight
631
+ } = this.hot.getSelectedRangeLast();
632
+ const nextCoords = this.hot._createCellCoords(highlight.row + delta.row, highlight.col + delta.col);
633
+ const isNestedHeadersRange = nextCoords.isHeader() && nextCoords.col >= 0;
634
+ if (!isNestedHeadersRange) {
635
+ return;
636
+ }
637
+ const visualColumnIndexStart = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(nextCoords.row, nextCoords.col);
638
+ const visualColumnIndexEnd = _classPrivateFieldGet(this, _stateManager).findRightMostColumnIndex(nextCoords.row, nextCoords.col);
639
+ if (delta.col < 0) {
640
+ const nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexStart - 1 : visualColumnIndexEnd;
641
+ const notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, -1);
642
+ if (notHiddenColumnIndex === null) {
643
+ // There are no visible columns anymore, so move the selection out of the table edge. This will
644
+ // be processed by the selection Transformer class as a move selection to the previous row (if autoWrapRow is enabled).
645
+ delta.col = -this.hot.view.countRenderableColumnsInRange(0, highlight.col);
646
+ } else {
647
+ delta.col = -Math.max(this.hot.view.countRenderableColumnsInRange(notHiddenColumnIndex, highlight.col) - 1, 1);
648
+ }
649
+ } else if (delta.col > 0) {
650
+ const nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexEnd + 1 : visualColumnIndexStart;
651
+ const notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, 1);
652
+ if (notHiddenColumnIndex === null) {
653
+ // There are no visible columns anymore, so move the selection out of the table edge. This will
654
+ // be processed by the selection Transformer class as a move selection to the next row (if autoWrapRow is enabled).
655
+ delta.col = this.hot.view.countRenderableColumnsInRange(highlight.col, this.hot.countCols());
656
+ } else {
657
+ delta.col = Math.max(this.hot.view.countRenderableColumnsInRange(highlight.col, notHiddenColumnIndex) - 1, 1);
658
+ }
659
+ }
660
+ }
661
+
662
+ /**
663
+ * The hook observes the column selection from the Selection API and modifies the column range to
664
+ * ensure that the whole nested column will be covered.
665
+ *
666
+ * @private
667
+ * @param {*} from The coords object where the selection starts.
668
+ * @param {*} to The coords object where the selection ends.
669
+ */
670
+ onBeforeSelectColumns(from, to) {
671
+ const headerLevel = from.row;
672
+ const startNodeData = this._getHeaderTreeNodeDataByCoords({
673
+ row: headerLevel,
674
+ col: from.col
675
+ });
676
+ const endNodeData = this._getHeaderTreeNodeDataByCoords({
677
+ row: headerLevel,
678
+ col: to.col
679
+ });
680
+ if (to.col < from.col) {
681
+ // Column selection from right to left
682
+ if (startNodeData) {
683
+ from.col = startNodeData.columnIndex + startNodeData.origColspan - 1;
684
+ }
685
+ if (endNodeData) {
686
+ to.col = endNodeData.columnIndex;
687
+ }
688
+ } else if (to.col >= from.col) {
689
+ // Column selection from left to right or a single column selection
690
+ if (startNodeData) {
691
+ from.col = startNodeData.columnIndex;
692
+ }
693
+ if (endNodeData) {
694
+ to.col = endNodeData.columnIndex + endNodeData.origColspan - 1;
695
+ }
561
696
  }
562
- this.hot.selectColumns(...columnsToSelect);
563
697
  }
564
698
 
565
699
  /**
@@ -570,7 +704,7 @@ class NestedHeaders extends _base.BasePlugin {
570
704
  */
571
705
  onAfterGetColumnHeaderRenderers(renderersArray) {
572
706
  renderersArray.length = 0;
573
- for (let headerLayer = 0; headerLayer < this.#stateManager.getLayersCount(); headerLayer++) {
707
+ for (let headerLayer = 0; headerLayer < _classPrivateFieldGet(this, _stateManager).getLayersCount(); headerLayer++) {
574
708
  renderersArray.push(this.headerRendererFactory(headerLayer));
575
709
  }
576
710
  }
@@ -582,11 +716,11 @@ class NestedHeaders extends _base.BasePlugin {
582
716
  * @param {object} calc Viewport column calculator.
583
717
  */
584
718
  onAfterViewportColumnCalculatorOverride(calc) {
585
- const headerLayersCount = this.#stateManager.getLayersCount();
719
+ const headerLayersCount = _classPrivateFieldGet(this, _stateManager).getLayersCount();
586
720
  let newStartColumn = calc.startColumn;
587
721
  let nonRenderable = !!headerLayersCount;
588
722
  for (let headerLayer = 0; headerLayer < headerLayersCount; headerLayer++) {
589
- const startColumn = this.#stateManager.findLeftMostColumnIndex(headerLayer, calc.startColumn);
723
+ const startColumn = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(headerLayer, calc.startColumn);
590
724
  const renderedStartColumn = this.hot.columnIndexMapper.getRenderableFromVisualIndex(startColumn);
591
725
 
592
726
  // If any of the headers for that column index is rendered, all of them should be rendered properly, see
@@ -605,7 +739,7 @@ class NestedHeaders extends _base.BasePlugin {
605
739
 
606
740
  // If no headers for the provided column index are renderable, start rendering from the beginning of the upmost
607
741
  // header for that position.
608
- calc.startColumn = nonRenderable ? this.#stateManager.getHeaderTreeNodeData(0, newStartColumn).columnIndex : newStartColumn;
742
+ calc.startColumn = nonRenderable ? _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(0, newStartColumn).columnIndex : newStartColumn;
609
743
  }
610
744
 
611
745
  /**
@@ -635,10 +769,10 @@ class NestedHeaders extends _base.BasePlugin {
635
769
  * @returns {string} Returns the column header value to update.
636
770
  */
637
771
  onModifyColumnHeaderValue(value, visualColumnIndex, headerLevel) {
638
- var _this$stateManager$ge3;
772
+ var _classPrivateFieldGet5;
639
773
  const {
640
774
  label
641
- } = (_this$stateManager$ge3 = this.#stateManager.getHeaderTreeNodeData(headerLevel, visualColumnIndex)) != null ? _this$stateManager$ge3 : {
775
+ } = (_classPrivateFieldGet5 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet5 !== void 0 ? _classPrivateFieldGet5 : {
642
776
  label: ''
643
777
  };
644
778
  return label;
@@ -672,10 +806,10 @@ class NestedHeaders extends _base.BasePlugin {
672
806
  * Destroys the plugin instance.
673
807
  */
674
808
  destroy() {
675
- this.#stateManager = null;
676
- if (this.#hidingIndexMapObserver !== null) {
677
- this.#hidingIndexMapObserver.unsubscribe();
678
- this.#hidingIndexMapObserver = null;
809
+ _classPrivateFieldSet(this, _stateManager, null);
810
+ if (_classPrivateFieldGet(this, _hidingIndexMapObserver) !== null) {
811
+ _classPrivateFieldGet(this, _hidingIndexMapObserver).unsubscribe();
812
+ _classPrivateFieldSet(this, _hidingIndexMapObserver, null);
679
813
  }
680
814
  super.destroy();
681
815
  }
@@ -691,7 +825,7 @@ class NestedHeaders extends _base.BasePlugin {
691
825
  if (coords.row >= 0 || coords.col < 0) {
692
826
  return;
693
827
  }
694
- return this.#stateManager.getHeaderTreeNodeData(coords.row, coords.col);
828
+ return _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(coords.row, coords.col);
695
829
  }
696
830
  }
697
831
  exports.NestedHeaders = NestedHeaders;