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,12 @@
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 _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
6
+ 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; } }
7
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
8
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
9
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
2
10
  import { arrayMap, arrayReduce } from "../../../helpers/array.mjs";
3
11
  import SourceSettings from "./sourceSettings.mjs";
4
12
  import HeadersTree from "./headersTree.mjs";
@@ -32,29 +40,42 @@ import { generateMatrix } from "./matrixGenerator.mjs";
32
40
  *
33
41
  * @class StateManager
34
42
  */
43
+ var _sourceSettings = /*#__PURE__*/new WeakMap();
44
+ var _headersTree = /*#__PURE__*/new WeakMap();
45
+ var _stateMatrix = /*#__PURE__*/new WeakMap();
35
46
  export default class StateManager {
36
- /**
37
- * The instance of the source settings class.
38
- *
39
- * @private
40
- * @type {SourceSettings}
41
- */
42
- #sourceSettings = new SourceSettings();
43
- /**
44
- * The instance of the headers tree. The tree is generated after setting new configuration data.
45
- *
46
- * @private
47
- * @type {HeadersTree}
48
- */
49
- #headersTree = new HeadersTree(this.#sourceSettings);
50
- /**
51
- * Cached matrix which is generated from the tree structure.
52
- *
53
- * @private
54
- * @type {Array[]}
55
- */
56
- #stateMatrix = [[]];
57
-
47
+ constructor() {
48
+ /**
49
+ * The instance of the source settings class.
50
+ *
51
+ * @private
52
+ * @type {SourceSettings}
53
+ */
54
+ _classPrivateFieldInitSpec(this, _sourceSettings, {
55
+ writable: true,
56
+ value: new SourceSettings()
57
+ });
58
+ /**
59
+ * The instance of the headers tree. The tree is generated after setting new configuration data.
60
+ *
61
+ * @private
62
+ * @type {HeadersTree}
63
+ */
64
+ _classPrivateFieldInitSpec(this, _headersTree, {
65
+ writable: true,
66
+ value: new HeadersTree(_classPrivateFieldGet(this, _sourceSettings))
67
+ });
68
+ /**
69
+ * Cached matrix which is generated from the tree structure.
70
+ *
71
+ * @private
72
+ * @type {Array[]}
73
+ */
74
+ _classPrivateFieldInitSpec(this, _stateMatrix, {
75
+ writable: true,
76
+ value: [[]]
77
+ });
78
+ }
58
79
  /**
59
80
  * Sets a new state for the nested headers plugin based on settings passed
60
81
  * directly to the plugin.
@@ -63,16 +84,16 @@ export default class StateManager {
63
84
  * @returns {boolean} Returns `true` if the settings are processed correctly, `false` otherwise.
64
85
  */
65
86
  setState(nestedHeadersSettings) {
66
- this.#sourceSettings.setData(nestedHeadersSettings);
87
+ _classPrivateFieldGet(this, _sourceSettings).setData(nestedHeadersSettings);
67
88
  let hasError = false;
68
89
  try {
69
- this.#headersTree.buildTree();
90
+ _classPrivateFieldGet(this, _headersTree).buildTree();
70
91
  } catch (ex) {
71
- this.#headersTree.clear();
72
- this.#sourceSettings.clear();
92
+ _classPrivateFieldGet(this, _headersTree).clear();
93
+ _classPrivateFieldGet(this, _sourceSettings).clear();
73
94
  hasError = true;
74
95
  }
75
- this.#stateMatrix = generateMatrix(this.#headersTree.getRoots());
96
+ _classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
76
97
  return hasError;
77
98
  }
78
99
 
@@ -83,7 +104,7 @@ export default class StateManager {
83
104
  * @param {number} columnsCount The number of columns to limit to.
84
105
  */
85
106
  setColumnsLimit(columnsCount) {
86
- this.#sourceSettings.setColumnsLimit(columnsCount);
107
+ _classPrivateFieldGet(this, _sourceSettings).setColumnsLimit(columnsCount);
87
108
  }
88
109
 
89
110
  /**
@@ -107,9 +128,9 @@ export default class StateManager {
107
128
  ...rest
108
129
  };
109
130
  });
110
- this.#sourceSettings.mergeWith(transformedSettings);
111
- this.#headersTree.buildTree();
112
- this.#stateMatrix = generateMatrix(this.#headersTree.getRoots());
131
+ _classPrivateFieldGet(this, _sourceSettings).mergeWith(transformedSettings);
132
+ _classPrivateFieldGet(this, _headersTree).buildTree();
133
+ _classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
113
134
  }
114
135
 
115
136
  /**
@@ -124,9 +145,9 @@ export default class StateManager {
124
145
  * header settings.
125
146
  */
126
147
  mapState(callback) {
127
- this.#sourceSettings.map(callback);
128
- this.#headersTree.buildTree();
129
- this.#stateMatrix = generateMatrix(this.#headersTree.getRoots());
148
+ _classPrivateFieldGet(this, _sourceSettings).map(callback);
149
+ _classPrivateFieldGet(this, _headersTree).buildTree();
150
+ _classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
130
151
  }
131
152
 
132
153
  /**
@@ -139,7 +160,7 @@ export default class StateManager {
139
160
  * @returns {Array}
140
161
  */
141
162
  mapNodes(callback) {
142
- return arrayReduce(this.#headersTree.getRoots(), (acc, rootNode) => {
163
+ return arrayReduce(_classPrivateFieldGet(this, _headersTree).getRoots(), (acc, rootNode) => {
143
164
  rootNode.walkDown(node => {
144
165
  const result = callback(node.data);
145
166
  if (result !== void 0) {
@@ -164,13 +185,13 @@ export default class StateManager {
164
185
  if (headerLevel < 0) {
165
186
  headerLevel = this.rowCoordsToLevel(headerLevel);
166
187
  }
167
- const nodeToProcess = this.#headersTree.getNode(headerLevel, columnIndex);
188
+ const nodeToProcess = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex);
168
189
  let actionResult;
169
190
  if (nodeToProcess) {
170
191
  actionResult = triggerNodeModification(action, nodeToProcess, columnIndex);
171
192
 
172
193
  // TODO (perf-tip): Trigger matrix generation once after multiple node modifications.
173
- this.#stateMatrix = generateMatrix(this.#headersTree.getRoots());
194
+ _classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
174
195
  }
175
196
  return actionResult;
176
197
  }
@@ -272,14 +293,14 @@ export default class StateManager {
272
293
  * @returns {object|null}
273
294
  */
274
295
  getHeaderSettings(headerLevel, columnIndex) {
275
- var _this$stateMatrix$hea;
296
+ var _classPrivateFieldGet2, _classPrivateFieldGet3;
276
297
  if (headerLevel < 0) {
277
298
  headerLevel = this.rowCoordsToLevel(headerLevel);
278
299
  }
279
300
  if (headerLevel === null || headerLevel >= this.getLayersCount()) {
280
301
  return null;
281
302
  }
282
- return (_this$stateMatrix$hea = this.#stateMatrix[headerLevel]?.[columnIndex]) != null ? _this$stateMatrix$hea : null;
303
+ return (_classPrivateFieldGet2 = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateMatrix)[headerLevel]) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3[columnIndex]) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : null;
283
304
  }
284
305
 
285
306
  /**
@@ -298,7 +319,7 @@ export default class StateManager {
298
319
  if (headerLevel === null || headerLevel >= this.getLayersCount()) {
299
320
  return null;
300
321
  }
301
- const node = this.#headersTree.getNode(headerLevel, columnIndex);
322
+ const node = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex);
302
323
  if (!node) {
303
324
  return null;
304
325
  }
@@ -320,7 +341,7 @@ export default class StateManager {
320
341
  var _this$getHeaderSettin;
321
342
  const {
322
343
  isRoot
323
- } = (_this$getHeaderSettin = this.getHeaderSettings(headerLevel, columnIndex)) != null ? _this$getHeaderSettin : {
344
+ } = (_this$getHeaderSettin = this.getHeaderSettings(headerLevel, columnIndex)) !== null && _this$getHeaderSettin !== void 0 ? _this$getHeaderSettin : {
324
345
  isRoot: true
325
346
  };
326
347
  if (isRoot) {
@@ -331,7 +352,7 @@ export default class StateManager {
331
352
  var _this$getHeaderSettin2;
332
353
  const {
333
354
  isRoot: isRootNode
334
- } = (_this$getHeaderSettin2 = this.getHeaderSettings(headerLevel, stepBackColumn)) != null ? _this$getHeaderSettin2 : {
355
+ } = (_this$getHeaderSettin2 = this.getHeaderSettings(headerLevel, stepBackColumn)) !== null && _this$getHeaderSettin2 !== void 0 ? _this$getHeaderSettin2 : {
335
356
  isRoot: true
336
357
  };
337
358
  if (isRootNode) {
@@ -342,13 +363,50 @@ export default class StateManager {
342
363
  return stepBackColumn;
343
364
  }
344
365
 
366
+ /**
367
+ * The method is helpful in cases where the column index targets in-between currently
368
+ * collapsed column. In that case, the method returns the right-most column index
369
+ * where the nested header ends.
370
+ *
371
+ * @param {number} headerLevel Header level (there is support for negative and positive values).
372
+ * @param {number} columnIndex A visual column index.
373
+ * @returns {number}
374
+ */
375
+ findRightMostColumnIndex(headerLevel, columnIndex) {
376
+ var _this$getHeaderSettin3;
377
+ const {
378
+ isRoot,
379
+ origColspan
380
+ } = (_this$getHeaderSettin3 = this.getHeaderSettings(headerLevel, columnIndex)) !== null && _this$getHeaderSettin3 !== void 0 ? _this$getHeaderSettin3 : {
381
+ isRoot: true,
382
+ origColspan: 1
383
+ };
384
+ if (isRoot) {
385
+ return columnIndex + origColspan - 1;
386
+ }
387
+ let stepForthColumn = columnIndex + 1;
388
+ while (stepForthColumn < this.getColumnsCount()) {
389
+ var _this$getHeaderSettin4;
390
+ const {
391
+ isRoot: isRootNode
392
+ } = (_this$getHeaderSettin4 = this.getHeaderSettings(headerLevel, stepForthColumn)) !== null && _this$getHeaderSettin4 !== void 0 ? _this$getHeaderSettin4 : {
393
+ isRoot: true
394
+ };
395
+ if (isRootNode) {
396
+ break;
397
+ }
398
+ stepForthColumn += 1;
399
+ }
400
+ return stepForthColumn - 1;
401
+ }
402
+
345
403
  /**
346
404
  * Gets a total number of headers levels.
347
405
  *
348
406
  * @returns {number}
349
407
  */
350
408
  getLayersCount() {
351
- return this.#sourceSettings.getLayersCount();
409
+ return _classPrivateFieldGet(this, _sourceSettings).getLayersCount();
352
410
  }
353
411
 
354
412
  /**
@@ -357,15 +415,15 @@ export default class StateManager {
357
415
  * @returns {number}
358
416
  */
359
417
  getColumnsCount() {
360
- return this.#sourceSettings.getColumnsCount();
418
+ return _classPrivateFieldGet(this, _sourceSettings).getColumnsCount();
361
419
  }
362
420
 
363
421
  /**
364
422
  * Clears the column state manager to the initial state.
365
423
  */
366
424
  clear() {
367
- this.#stateMatrix = [];
368
- this.#sourceSettings.clear();
369
- this.#headersTree.clear();
425
+ _classPrivateFieldSet(this, _stateMatrix, []);
426
+ _classPrivateFieldGet(this, _sourceSettings).clear();
427
+ _classPrivateFieldGet(this, _headersTree).clear();
370
428
  }
371
429
  }
@@ -76,7 +76,7 @@ function collapseNode(nodeToProcess) {
76
76
 
77
77
  // Calculate by how many colspan it needs to reduce the headings to match them to
78
78
  // the first child colspan width.
79
- const colspanCompensation = nodeData.colspan - ((_getFirstChildPropert = (0, _tree.getFirstChildProperty)(nodeToProcess, 'colspan')) != null ? _getFirstChildPropert : 1);
79
+ const colspanCompensation = nodeData.colspan - ((_getFirstChildPropert = (0, _tree.getFirstChildProperty)(nodeToProcess, 'colspan')) !== null && _getFirstChildPropert !== void 0 ? _getFirstChildPropert : 1);
80
80
  nodeToProcess.walkUp(node => {
81
81
  const {
82
82
  data
@@ -72,7 +72,7 @@ export function collapseNode(nodeToProcess) {
72
72
 
73
73
  // Calculate by how many colspan it needs to reduce the headings to match them to
74
74
  // the first child colspan width.
75
- const colspanCompensation = nodeData.colspan - ((_getFirstChildPropert = getFirstChildProperty(nodeToProcess, 'colspan')) != null ? _getFirstChildPropert : 1);
75
+ const colspanCompensation = nodeData.colspan - ((_getFirstChildPropert = getFirstChildProperty(nodeToProcess, 'colspan')) !== null && _getFirstChildPropert !== void 0 ? _getFirstChildPropert : 1);
76
76
  nodeToProcess.walkUp(node => {
77
77
  const {
78
78
  data
@@ -6,6 +6,13 @@ require("core-js/modules/es.array.push.js");
6
6
  var _object = require("../../../helpers/object");
7
7
  var _array = require("../../../helpers/array");
8
8
  var _settingsNormalizer = require("./settingsNormalizer");
9
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
10
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
11
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
12
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
13
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
14
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
15
+ 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; } }
9
16
  /**
10
17
  * List of properties which are configurable. That properties can be changed using public API.
11
18
  *
@@ -22,30 +29,43 @@ const HEADER_CONFIGURABLE_PROPS = ['label', 'collapsible'];
22
29
  * @class SourceSettings
23
30
  */
24
31
  exports.HEADER_CONFIGURABLE_PROPS = HEADER_CONFIGURABLE_PROPS;
32
+ var _data = /*#__PURE__*/new WeakMap();
33
+ var _dataLength = /*#__PURE__*/new WeakMap();
34
+ var _columnsLimit = /*#__PURE__*/new WeakMap();
25
35
  class SourceSettings {
26
- /**
27
- * The normalized source data (normalized user-defined settings for nested headers).
28
- *
29
- * @private
30
- * @type {Array[]}
31
- */
32
- #data = [];
33
- /**
34
- * The total length of the nested header layers.
35
- *
36
- * @private
37
- * @type {number}
38
- */
39
- #dataLength = 0;
40
- /**
41
- * Columns count limit value trims source settings to that value. If columns
42
- * count limit intersects nested header, the header's colspan value is reduced
43
- * to keep the whole structure stable (trimmed precisely where the limit is set).
44
- *
45
- * @type {number}
46
- */
47
- #columnsLimit = Infinity;
48
-
36
+ constructor() {
37
+ /**
38
+ * The normalized source data (normalized user-defined settings for nested headers).
39
+ *
40
+ * @private
41
+ * @type {Array[]}
42
+ */
43
+ _classPrivateFieldInitSpec(this, _data, {
44
+ writable: true,
45
+ value: []
46
+ });
47
+ /**
48
+ * The total length of the nested header layers.
49
+ *
50
+ * @private
51
+ * @type {number}
52
+ */
53
+ _classPrivateFieldInitSpec(this, _dataLength, {
54
+ writable: true,
55
+ value: 0
56
+ });
57
+ /**
58
+ * Columns count limit value trims source settings to that value. If columns
59
+ * count limit intersects nested header, the header's colspan value is reduced
60
+ * to keep the whole structure stable (trimmed precisely where the limit is set).
61
+ *
62
+ * @type {number}
63
+ */
64
+ _classPrivateFieldInitSpec(this, _columnsLimit, {
65
+ writable: true,
66
+ value: Infinity
67
+ });
68
+ }
49
69
  /**
50
70
  * Sets columns limit to the source settings will be trimmed. All headers which
51
71
  * overlap the column limit will be reduced to keep the structure solid.
@@ -53,7 +73,7 @@ class SourceSettings {
53
73
  * @param {number} columnsCount The number of columns to limit to.
54
74
  */
55
75
  setColumnsLimit(columnsCount) {
56
- this.#columnsLimit = columnsCount;
76
+ _classPrivateFieldSet(this, _columnsLimit, columnsCount);
57
77
  }
58
78
 
59
79
  /**
@@ -63,8 +83,8 @@ class SourceSettings {
63
83
  */
64
84
  setData() {
65
85
  let nestedHeadersSettings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
66
- this.#data = (0, _settingsNormalizer.normalizeSettings)(nestedHeadersSettings, this.#columnsLimit);
67
- this.#dataLength = this.#data.length;
86
+ _classPrivateFieldSet(this, _data, (0, _settingsNormalizer.normalizeSettings)(nestedHeadersSettings, _classPrivateFieldGet(this, _columnsLimit)));
87
+ _classPrivateFieldSet(this, _dataLength, _classPrivateFieldGet(this, _data).length);
68
88
  }
69
89
 
70
90
  /**
@@ -73,7 +93,7 @@ class SourceSettings {
73
93
  * @returns {Array[]}
74
94
  */
75
95
  getData() {
76
- return this.#data;
96
+ return _classPrivateFieldGet(this, _data);
77
97
  }
78
98
 
79
99
  /**
@@ -105,7 +125,7 @@ class SourceSettings {
105
125
  * header settings.
106
126
  */
107
127
  map(callback) {
108
- (0, _array.arrayEach)(this.#data, header => {
128
+ (0, _array.arrayEach)(_classPrivateFieldGet(this, _data), header => {
109
129
  (0, _array.arrayEach)(header, headerSettings => {
110
130
  const propsToExtend = callback({
111
131
  ...headerSettings
@@ -128,14 +148,14 @@ class SourceSettings {
128
148
  */
129
149
  getHeaderSettings(headerLevel, columnIndex) {
130
150
  var _headersSettings$colu;
131
- if (headerLevel >= this.#dataLength || headerLevel < 0) {
151
+ if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
132
152
  return null;
133
153
  }
134
- const headersSettings = this.#data[headerLevel];
154
+ const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
135
155
  if (columnIndex >= headersSettings.length) {
136
156
  return null;
137
157
  }
138
- return (_headersSettings$colu = headersSettings[columnIndex]) != null ? _headersSettings$colu : null;
158
+ return (_headersSettings$colu = headersSettings[columnIndex]) !== null && _headersSettings$colu !== void 0 ? _headersSettings$colu : null;
139
159
  }
140
160
 
141
161
  /**
@@ -151,10 +171,10 @@ class SourceSettings {
151
171
  getHeadersSettings(headerLevel, columnIndex) {
152
172
  let columnsLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
153
173
  const headersSettingsChunks = [];
154
- if (headerLevel >= this.#dataLength || headerLevel < 0) {
174
+ if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
155
175
  return headersSettingsChunks;
156
176
  }
157
- const headersSettings = this.#data[headerLevel];
177
+ const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
158
178
  let currentLength = 0;
159
179
  for (let i = columnIndex; i < headersSettings.length; i++) {
160
180
  const headerSettings = headersSettings[i];
@@ -185,7 +205,7 @@ class SourceSettings {
185
205
  * @returns {number}
186
206
  */
187
207
  getLayersCount() {
188
- return this.#dataLength;
208
+ return _classPrivateFieldGet(this, _dataLength);
189
209
  }
190
210
 
191
211
  /**
@@ -194,15 +214,15 @@ class SourceSettings {
194
214
  * @returns {number}
195
215
  */
196
216
  getColumnsCount() {
197
- return this.#dataLength > 0 ? this.#data[0].length : 0;
217
+ return _classPrivateFieldGet(this, _dataLength) > 0 ? _classPrivateFieldGet(this, _data)[0].length : 0;
198
218
  }
199
219
 
200
220
  /**
201
221
  * Clears the data.
202
222
  */
203
223
  clear() {
204
- this.#data = [];
205
- this.#dataLength = 0;
224
+ _classPrivateFieldSet(this, _data, []);
225
+ _classPrivateFieldSet(this, _dataLength, 0);
206
226
  }
207
227
  }
208
228
  exports.default = SourceSettings;
@@ -1,5 +1,12 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
2
  import "core-js/modules/es.array.push.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 _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
6
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
7
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
8
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
9
+ 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; } }
3
10
  import { extend, isObject } from "../../../helpers/object.mjs";
4
11
  import { arrayEach } from "../../../helpers/array.mjs";
5
12
  import { normalizeSettings } from "./settingsNormalizer.mjs";
@@ -18,30 +25,43 @@ export const HEADER_CONFIGURABLE_PROPS = ['label', 'collapsible'];
18
25
  * @private
19
26
  * @class SourceSettings
20
27
  */
28
+ var _data = /*#__PURE__*/new WeakMap();
29
+ var _dataLength = /*#__PURE__*/new WeakMap();
30
+ var _columnsLimit = /*#__PURE__*/new WeakMap();
21
31
  export default class SourceSettings {
22
- /**
23
- * The normalized source data (normalized user-defined settings for nested headers).
24
- *
25
- * @private
26
- * @type {Array[]}
27
- */
28
- #data = [];
29
- /**
30
- * The total length of the nested header layers.
31
- *
32
- * @private
33
- * @type {number}
34
- */
35
- #dataLength = 0;
36
- /**
37
- * Columns count limit value trims source settings to that value. If columns
38
- * count limit intersects nested header, the header's colspan value is reduced
39
- * to keep the whole structure stable (trimmed precisely where the limit is set).
40
- *
41
- * @type {number}
42
- */
43
- #columnsLimit = Infinity;
44
-
32
+ constructor() {
33
+ /**
34
+ * The normalized source data (normalized user-defined settings for nested headers).
35
+ *
36
+ * @private
37
+ * @type {Array[]}
38
+ */
39
+ _classPrivateFieldInitSpec(this, _data, {
40
+ writable: true,
41
+ value: []
42
+ });
43
+ /**
44
+ * The total length of the nested header layers.
45
+ *
46
+ * @private
47
+ * @type {number}
48
+ */
49
+ _classPrivateFieldInitSpec(this, _dataLength, {
50
+ writable: true,
51
+ value: 0
52
+ });
53
+ /**
54
+ * Columns count limit value trims source settings to that value. If columns
55
+ * count limit intersects nested header, the header's colspan value is reduced
56
+ * to keep the whole structure stable (trimmed precisely where the limit is set).
57
+ *
58
+ * @type {number}
59
+ */
60
+ _classPrivateFieldInitSpec(this, _columnsLimit, {
61
+ writable: true,
62
+ value: Infinity
63
+ });
64
+ }
45
65
  /**
46
66
  * Sets columns limit to the source settings will be trimmed. All headers which
47
67
  * overlap the column limit will be reduced to keep the structure solid.
@@ -49,7 +69,7 @@ export default class SourceSettings {
49
69
  * @param {number} columnsCount The number of columns to limit to.
50
70
  */
51
71
  setColumnsLimit(columnsCount) {
52
- this.#columnsLimit = columnsCount;
72
+ _classPrivateFieldSet(this, _columnsLimit, columnsCount);
53
73
  }
54
74
 
55
75
  /**
@@ -59,8 +79,8 @@ export default class SourceSettings {
59
79
  */
60
80
  setData() {
61
81
  let nestedHeadersSettings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
62
- this.#data = normalizeSettings(nestedHeadersSettings, this.#columnsLimit);
63
- this.#dataLength = this.#data.length;
82
+ _classPrivateFieldSet(this, _data, normalizeSettings(nestedHeadersSettings, _classPrivateFieldGet(this, _columnsLimit)));
83
+ _classPrivateFieldSet(this, _dataLength, _classPrivateFieldGet(this, _data).length);
64
84
  }
65
85
 
66
86
  /**
@@ -69,7 +89,7 @@ export default class SourceSettings {
69
89
  * @returns {Array[]}
70
90
  */
71
91
  getData() {
72
- return this.#data;
92
+ return _classPrivateFieldGet(this, _data);
73
93
  }
74
94
 
75
95
  /**
@@ -101,7 +121,7 @@ export default class SourceSettings {
101
121
  * header settings.
102
122
  */
103
123
  map(callback) {
104
- arrayEach(this.#data, header => {
124
+ arrayEach(_classPrivateFieldGet(this, _data), header => {
105
125
  arrayEach(header, headerSettings => {
106
126
  const propsToExtend = callback({
107
127
  ...headerSettings
@@ -124,14 +144,14 @@ export default class SourceSettings {
124
144
  */
125
145
  getHeaderSettings(headerLevel, columnIndex) {
126
146
  var _headersSettings$colu;
127
- if (headerLevel >= this.#dataLength || headerLevel < 0) {
147
+ if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
128
148
  return null;
129
149
  }
130
- const headersSettings = this.#data[headerLevel];
150
+ const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
131
151
  if (columnIndex >= headersSettings.length) {
132
152
  return null;
133
153
  }
134
- return (_headersSettings$colu = headersSettings[columnIndex]) != null ? _headersSettings$colu : null;
154
+ return (_headersSettings$colu = headersSettings[columnIndex]) !== null && _headersSettings$colu !== void 0 ? _headersSettings$colu : null;
135
155
  }
136
156
 
137
157
  /**
@@ -147,10 +167,10 @@ export default class SourceSettings {
147
167
  getHeadersSettings(headerLevel, columnIndex) {
148
168
  let columnsLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
149
169
  const headersSettingsChunks = [];
150
- if (headerLevel >= this.#dataLength || headerLevel < 0) {
170
+ if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
151
171
  return headersSettingsChunks;
152
172
  }
153
- const headersSettings = this.#data[headerLevel];
173
+ const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
154
174
  let currentLength = 0;
155
175
  for (let i = columnIndex; i < headersSettings.length; i++) {
156
176
  const headerSettings = headersSettings[i];
@@ -181,7 +201,7 @@ export default class SourceSettings {
181
201
  * @returns {number}
182
202
  */
183
203
  getLayersCount() {
184
- return this.#dataLength;
204
+ return _classPrivateFieldGet(this, _dataLength);
185
205
  }
186
206
 
187
207
  /**
@@ -190,14 +210,14 @@ export default class SourceSettings {
190
210
  * @returns {number}
191
211
  */
192
212
  getColumnsCount() {
193
- return this.#dataLength > 0 ? this.#data[0].length : 0;
213
+ return _classPrivateFieldGet(this, _dataLength) > 0 ? _classPrivateFieldGet(this, _data)[0].length : 0;
194
214
  }
195
215
 
196
216
  /**
197
217
  * Clears the data.
198
218
  */
199
219
  clear() {
200
- this.#data = [];
201
- this.#dataLength = 0;
220
+ _classPrivateFieldSet(this, _data, []);
221
+ _classPrivateFieldSet(this, _dataLength, 0);
202
222
  }
203
223
  }