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
package/tableView.mjs CHANGED
@@ -1,4 +1,15 @@
1
1
  import "core-js/modules/es.array.push.js";
2
+ import "core-js/modules/es.error.cause.js";
3
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
4
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
9
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
10
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
11
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
12
+ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
2
13
  import { addClass, clearTextSelection, empty, fastInnerHTML, fastInnerText, getScrollbarWidth, hasClass, isChildOf, isInput, isOutsideInput } from "./helpers/dom/element.mjs";
3
14
  import EventManager from "./eventManager.mjs";
4
15
  import { isImmediatePropagationStopped, isRightClick, isLeftClick } from "./helpers/dom/event.mjs";
@@ -11,84 +22,91 @@ const privatePool = new WeakMap();
11
22
  * @class TableView
12
23
  * @private
13
24
  */
25
+ var _columnHeadersCount = /*#__PURE__*/new WeakMap();
26
+ var _rowHeadersCount = /*#__PURE__*/new WeakMap();
14
27
  class TableView {
15
- /**
16
- * Instance of {@link Handsontable}.
17
- *
18
- * @private
19
- * @type {Handsontable}
20
- */
21
- instance;
22
- /**
23
- * Instance of {@link EventManager}.
24
- *
25
- * @private
26
- * @type {EventManager}
27
- */
28
- eventManager;
29
- /**
30
- * Current Handsontable's GridSettings object.
31
- *
32
- * @private
33
- * @type {GridSettings}
34
- */
35
- settings;
36
- /**
37
- * Main <THEAD> element.
38
- *
39
- * @private
40
- * @type {HTMLTableSectionElement}
41
- */
42
- THEAD;
43
- /**
44
- * Main <TBODY> element.
45
- *
46
- * @private
47
- * @type {HTMLTableSectionElement}
48
- */
49
- TBODY;
50
- /**
51
- * Main Walkontable instance.
52
- *
53
- * @private
54
- * @type {Walkontable}
55
- */
56
- _wt;
57
- /**
58
- * Main Walkontable instance.
59
- *
60
- * @private
61
- * @type {Walkontable}
62
- */
63
- activeWt;
64
- /**
65
- * The total number of the column header renderers applied to the table through the
66
- * `afterGetColumnHeaderRenderers` hook.
67
- *
68
- * @type {number}
69
- */
70
- #columnHeadersCount = 0;
71
- /**
72
- * The total number of the row header renderers applied to the table through the
73
- * `afterGetRowHeaderRenderers` hook.
74
- *
75
- * @type {number}
76
- */
77
- #rowHeadersCount = 0;
78
- /**
79
- * The flag determines if the `adjustElementsSize` method call was made during
80
- * the render suspending. If true, the method has to be triggered once after render
81
- * resuming.
82
- *
83
- * @private
84
- * @type {boolean}
85
- */
86
- postponedAdjustElementsSize = false;
87
-
88
28
  /**
89
29
  * @param {Hanstontable} instance Instance of {@link Handsontable}.
90
30
  */
91
31
  constructor(instance) {
32
+ /**
33
+ * Instance of {@link Handsontable}.
34
+ *
35
+ * @private
36
+ * @type {Handsontable}
37
+ */
38
+ _defineProperty(this, "instance", void 0);
39
+ /**
40
+ * Instance of {@link EventManager}.
41
+ *
42
+ * @private
43
+ * @type {EventManager}
44
+ */
45
+ _defineProperty(this, "eventManager", void 0);
46
+ /**
47
+ * Current Handsontable's GridSettings object.
48
+ *
49
+ * @private
50
+ * @type {GridSettings}
51
+ */
52
+ _defineProperty(this, "settings", void 0);
53
+ /**
54
+ * Main <THEAD> element.
55
+ *
56
+ * @private
57
+ * @type {HTMLTableSectionElement}
58
+ */
59
+ _defineProperty(this, "THEAD", void 0);
60
+ /**
61
+ * Main <TBODY> element.
62
+ *
63
+ * @private
64
+ * @type {HTMLTableSectionElement}
65
+ */
66
+ _defineProperty(this, "TBODY", void 0);
67
+ /**
68
+ * Main Walkontable instance.
69
+ *
70
+ * @private
71
+ * @type {Walkontable}
72
+ */
73
+ _defineProperty(this, "_wt", void 0);
74
+ /**
75
+ * Main Walkontable instance.
76
+ *
77
+ * @private
78
+ * @type {Walkontable}
79
+ */
80
+ _defineProperty(this, "activeWt", void 0);
81
+ /**
82
+ * The total number of the column header renderers applied to the table through the
83
+ * `afterGetColumnHeaderRenderers` hook.
84
+ *
85
+ * @type {number}
86
+ */
87
+ _classPrivateFieldInitSpec(this, _columnHeadersCount, {
88
+ writable: true,
89
+ value: 0
90
+ });
91
+ /**
92
+ * The total number of the row header renderers applied to the table through the
93
+ * `afterGetRowHeaderRenderers` hook.
94
+ *
95
+ * @type {number}
96
+ */
97
+ _classPrivateFieldInitSpec(this, _rowHeadersCount, {
98
+ writable: true,
99
+ value: 0
100
+ });
101
+ /**
102
+ * The flag determines if the `adjustElementsSize` method call was made during
103
+ * the render suspending. If true, the method has to be triggered once after render
104
+ * resuming.
105
+ *
106
+ * @private
107
+ * @type {boolean}
108
+ */
109
+ _defineProperty(this, "postponedAdjustElementsSize", false);
92
110
  this.instance = instance;
93
111
  this.eventManager = new EventManager(this.instance);
94
112
  this.settings = this.instance.getSettings();
@@ -290,11 +308,14 @@ class TableView {
290
308
  });
291
309
  this.eventManager.addEventListener(documentElement, 'mouseup', event => {
292
310
  if (selection.isInProgress() && isLeftClick(event)) {
293
- // is left mouse button
294
311
  selection.finish();
295
312
  }
296
313
  priv.mouseDown = false;
297
- if (isOutsideInput(rootDocument.activeElement) || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !isRightClick(event)) {
314
+ const isOutsideInputElement = isOutsideInput(rootDocument.activeElement);
315
+ if (!isOutsideInputElement) {
316
+ return;
317
+ }
318
+ if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !isRightClick(event)) {
298
319
  this.instance.unlisten();
299
320
  }
300
321
  });
@@ -528,6 +549,40 @@ class TableView {
528
549
  return this.countNotHiddenRowIndexes(visualFixedRowsBottom, 1);
529
550
  }
530
551
 
552
+ /**
553
+ * The function returns the number of renderable column indexes within the passed range of the visual indexes.
554
+ *
555
+ * @param {number} columnStart The column visual start index.
556
+ * @param {number} columnEnd The column visual end index.
557
+ * @returns {number}
558
+ */
559
+ countRenderableColumnsInRange(columnStart, columnEnd) {
560
+ let count = 0;
561
+ for (let column = columnStart; column <= columnEnd; column++) {
562
+ if (this.instance.columnIndexMapper.getRenderableFromVisualIndex(column) !== null) {
563
+ count += 1;
564
+ }
565
+ }
566
+ return count;
567
+ }
568
+
569
+ /**
570
+ * The function returns the number of renderable row indexes within the passed range of the visual indexes.
571
+ *
572
+ * @param {number} rowStart The row visual start index.
573
+ * @param {number} rowEnd The row visual end index.
574
+ * @returns {number}
575
+ */
576
+ countRenderableRowsInRange(rowStart, rowEnd) {
577
+ let count = 0;
578
+ for (let row = rowStart; row <= rowEnd; row++) {
579
+ if (this.instance.rowIndexMapper.getRenderableFromVisualIndex(row) !== null) {
580
+ count += 1;
581
+ }
582
+ }
583
+ return count;
584
+ }
585
+
531
586
  /**
532
587
  * Checks if at least one cell than belongs to the main table is not covered by the top, left or
533
588
  * bottom overlay.
@@ -591,7 +646,7 @@ class TableView {
591
646
  });
592
647
  }
593
648
  this.instance.runHooks('afterGetRowHeaderRenderers', headerRenderers);
594
- this.#rowHeadersCount = headerRenderers.length;
649
+ _classPrivateFieldSet(this, _rowHeadersCount, headerRenderers.length);
595
650
  return headerRenderers;
596
651
  },
597
652
  columnHeaders: () => {
@@ -605,7 +660,7 @@ class TableView {
605
660
  });
606
661
  }
607
662
  this.instance.runHooks('afterGetColumnHeaderRenderers', headerRenderers);
608
- this.#columnHeadersCount = headerRenderers.length;
663
+ _classPrivateFieldSet(this, _columnHeadersCount, headerRenderers.length);
609
664
  return headerRenderers;
610
665
  },
611
666
  columnWidth: renderedColumnIndex => {
@@ -747,20 +802,40 @@ class TableView {
747
802
  },
748
803
  beforeDraw: (force, skipRender) => this.beforeRender(force, skipRender),
749
804
  onDraw: force => this.afterRender(force),
750
- onScrollVertically: () => this.instance.runHooks('afterScrollVertically'),
751
- onScrollHorizontally: () => this.instance.runHooks('afterScrollHorizontally'),
805
+ onScrollVertically: () => {
806
+ this.instance.runHooks('afterScrollVertically');
807
+ this.instance.runHooks('afterScroll');
808
+ },
809
+ onScrollHorizontally: () => {
810
+ this.instance.runHooks('afterScrollHorizontally');
811
+ this.instance.runHooks('afterScroll');
812
+ },
752
813
  onBeforeRemoveCellClassNames: () => this.instance.runHooks('beforeRemoveCellClassNames'),
753
814
  onBeforeHighlightingRowHeader: (renderableRow, headerLevel, highlightMeta) => {
754
815
  const rowMapper = this.instance.rowIndexMapper;
755
- const visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow);
816
+ const areColumnHeadersSelected = renderableRow < 0;
817
+ let visualRow = renderableRow;
818
+ if (!areColumnHeadersSelected) {
819
+ visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow);
820
+ }
756
821
  const newVisualRow = this.instance.runHooks('beforeHighlightingRowHeader', visualRow, headerLevel, highlightMeta);
757
- return rowMapper.getRenderableFromVisualIndex(rowMapper.getNearestNotHiddenIndex(newVisualRow, 1));
822
+ if (!areColumnHeadersSelected) {
823
+ return rowMapper.getRenderableFromVisualIndex(rowMapper.getNearestNotHiddenIndex(newVisualRow, 1));
824
+ }
825
+ return newVisualRow;
758
826
  },
759
827
  onBeforeHighlightingColumnHeader: (renderableColumn, headerLevel, highlightMeta) => {
760
828
  const columnMapper = this.instance.columnIndexMapper;
761
- const visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn);
829
+ const areRowHeadersSelected = renderableColumn < 0;
830
+ let visualColumn = renderableColumn;
831
+ if (!areRowHeadersSelected) {
832
+ visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn);
833
+ }
762
834
  const newVisualColumn = this.instance.runHooks('beforeHighlightingColumnHeader', visualColumn, headerLevel, highlightMeta);
763
- return columnMapper.getRenderableFromVisualIndex(columnMapper.getNearestNotHiddenIndex(newVisualColumn, 1));
835
+ if (!areRowHeadersSelected) {
836
+ return columnMapper.getRenderableFromVisualIndex(columnMapper.getNearestNotHiddenIndex(newVisualColumn, 1));
837
+ }
838
+ return newVisualColumn;
764
839
  },
765
840
  onAfterDrawSelection: (currentRow, currentColumn, layerLevel) => {
766
841
  let cornersOfSelection;
@@ -768,10 +843,7 @@ class TableView {
768
843
  const selectedRange = this.instance.selection.getSelectedRange();
769
844
  const selectionRangeSize = selectedRange.size();
770
845
  if (selectionRangeSize > 0) {
771
- // Selection layers are stored from the "oldest" to the "newest". We should calculate the offset.
772
- // Please look at the `SelectedRange` class and it's method for getting selection's layer for more information.
773
- const selectionOffset = (layerLevel != null ? layerLevel : 0) + 1 - selectionRangeSize;
774
- const selectionForLayer = selectedRange.peekByIndex(selectionOffset);
846
+ const selectionForLayer = selectedRange.peekByIndex(layerLevel !== null && layerLevel !== void 0 ? layerLevel : 0);
775
847
  cornersOfSelection = [selectionForLayer.from.row, selectionForLayer.from.col, selectionForLayer.to.row, selectionForLayer.to.col];
776
848
  }
777
849
  return this.instance.runHooks('afterDrawSelection', visualRowIndex, visualColumnIndex, cornersOfSelection, layerLevel);
@@ -923,8 +995,8 @@ class TableView {
923
995
  * @returns {boolean}
924
996
  */
925
997
  isSelectedOnlyCell() {
926
- var _this$instance$getSel;
927
- return (_this$instance$getSel = this.instance.getSelectedRangeLast()?.isSingle()) != null ? _this$instance$getSel : false;
998
+ var _this$instance$getSel, _this$instance$getSel2;
999
+ return (_this$instance$getSel = (_this$instance$getSel2 = this.instance.getSelectedRangeLast()) === null || _this$instance$getSel2 === void 0 ? void 0 : _this$instance$getSel2.isSingleCell()) !== null && _this$instance$getSel !== void 0 ? _this$instance$getSel : false;
928
1000
  }
929
1001
 
930
1002
  /**
@@ -1162,7 +1234,7 @@ class TableView {
1162
1234
  * @returns {number}
1163
1235
  */
1164
1236
  getColumnHeadersCount() {
1165
- return this.#columnHeadersCount;
1237
+ return _classPrivateFieldGet(this, _columnHeadersCount);
1166
1238
  }
1167
1239
 
1168
1240
  /**
@@ -1171,7 +1243,7 @@ class TableView {
1171
1243
  * @returns {number}
1172
1244
  */
1173
1245
  getRowHeadersCount() {
1174
- return this.#rowHeadersCount;
1246
+ return _classPrivateFieldGet(this, _rowHeadersCount);
1175
1247
  }
1176
1248
 
1177
1249
  /**
@@ -1,8 +1,16 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
+ require("core-js/modules/es.error.cause.js");
4
5
  var _observer = require("./observer");
5
6
  var _utils = require("./utils");
7
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
8
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
9
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
10
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
11
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
12
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
13
+ 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; } }
6
14
  /**
7
15
  * The ChangesObservable module is an object that represents a resource that provides
8
16
  * the ability to observe the changes that happened in the index map indexes during
@@ -11,53 +19,73 @@ var _utils = require("./utils");
11
19
  * @private
12
20
  * @class ChangesObservable
13
21
  */
22
+ var _observers = /*#__PURE__*/new WeakMap();
23
+ var _indexMatrix = /*#__PURE__*/new WeakMap();
24
+ var _currentIndexState = /*#__PURE__*/new WeakMap();
25
+ var _isMatrixIndexesInitialized = /*#__PURE__*/new WeakMap();
26
+ var _initialIndexValue = /*#__PURE__*/new WeakMap();
14
27
  class ChangesObservable {
15
- /**
16
- * The list of registered ChangesObserver instances.
17
- *
18
- * @type {ChangesObserver[]}
19
- */
20
- #observers = new Set();
21
- /**
22
- * An array with default values that act as a base array that will be compared with
23
- * the last saved index state. The changes are generated and immediately send through
24
- * the newly created ChangesObserver object. Thanks to that, the observer initially has
25
- * all information about what indexes are currently changed.
26
- *
27
- * @type {Array}
28
- */
29
- #indexMatrix = [];
30
- /**
31
- * An array that holds the indexes state that is currently valid. The value is changed on every
32
- * index mapper cache update.
33
- *
34
- * @type {Array}
35
- */
36
- #currentIndexState = [];
37
- /**
38
- * The flag determines if the observable is initialized or not. Not initialized object creates
39
- * index matrix once while emitting new changes.
40
- *
41
- * @type {boolean}
42
- */
43
- #isMatrixIndexesInitialized = false;
44
- /**
45
- * The initial index value allows control from what value the index matrix array will be created.
46
- * Changing that value changes how the array diff generates the changes for the initial data
47
- * sent to the subscribers. For example, the changes can be triggered by detecting the changes
48
- * from `false` to `true` value or vice versa. Generally, it depends on which index map type
49
- * the Observable will work with. For "hiding" or "trimming" index types, it will be boolean
50
- * values. For various index maps, it can be anything, but I suspect that the most appropriate
51
- * initial value will be "undefined" in that case.
52
- *
53
- * @type {boolean}
54
- */
55
- #initialIndexValue = false;
56
28
  constructor() {
57
29
  let {
58
30
  initialIndexValue
59
31
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
60
- this.#initialIndexValue = initialIndexValue != null ? initialIndexValue : false;
32
+ /**
33
+ * The list of registered ChangesObserver instances.
34
+ *
35
+ * @type {ChangesObserver[]}
36
+ */
37
+ _classPrivateFieldInitSpec(this, _observers, {
38
+ writable: true,
39
+ value: new Set()
40
+ });
41
+ /**
42
+ * An array with default values that act as a base array that will be compared with
43
+ * the last saved index state. The changes are generated and immediately send through
44
+ * the newly created ChangesObserver object. Thanks to that, the observer initially has
45
+ * all information about what indexes are currently changed.
46
+ *
47
+ * @type {Array}
48
+ */
49
+ _classPrivateFieldInitSpec(this, _indexMatrix, {
50
+ writable: true,
51
+ value: []
52
+ });
53
+ /**
54
+ * An array that holds the indexes state that is currently valid. The value is changed on every
55
+ * index mapper cache update.
56
+ *
57
+ * @type {Array}
58
+ */
59
+ _classPrivateFieldInitSpec(this, _currentIndexState, {
60
+ writable: true,
61
+ value: []
62
+ });
63
+ /**
64
+ * The flag determines if the observable is initialized or not. Not initialized object creates
65
+ * index matrix once while emitting new changes.
66
+ *
67
+ * @type {boolean}
68
+ */
69
+ _classPrivateFieldInitSpec(this, _isMatrixIndexesInitialized, {
70
+ writable: true,
71
+ value: false
72
+ });
73
+ /**
74
+ * The initial index value allows control from what value the index matrix array will be created.
75
+ * Changing that value changes how the array diff generates the changes for the initial data
76
+ * sent to the subscribers. For example, the changes can be triggered by detecting the changes
77
+ * from `false` to `true` value or vice versa. Generally, it depends on which index map type
78
+ * the Observable will work with. For "hiding" or "trimming" index types, it will be boolean
79
+ * values. For various index maps, it can be anything, but I suspect that the most appropriate
80
+ * initial value will be "undefined" in that case.
81
+ *
82
+ * @type {boolean}
83
+ */
84
+ _classPrivateFieldInitSpec(this, _initialIndexValue, {
85
+ writable: true,
86
+ value: false
87
+ });
88
+ _classPrivateFieldSet(this, _initialIndexValue, initialIndexValue !== null && initialIndexValue !== void 0 ? initialIndexValue : false);
61
89
  }
62
90
 
63
91
  /* eslint-disable jsdoc/require-description-complete-sentence */
@@ -86,11 +114,11 @@ class ChangesObservable {
86
114
  /* eslint-enable jsdoc/require-description-complete-sentence */
87
115
  createObserver() {
88
116
  const observer = new _observer.ChangesObserver();
89
- this.#observers.add(observer);
117
+ _classPrivateFieldGet(this, _observers).add(observer);
90
118
  observer.addLocalHook('unsubscribe', () => {
91
- this.#observers.delete(observer);
119
+ _classPrivateFieldGet(this, _observers).delete(observer);
92
120
  });
93
- observer._writeInitialChanges((0, _utils.arrayDiff)(this.#indexMatrix, this.#currentIndexState));
121
+ observer._writeInitialChanges((0, _utils.arrayDiff)(_classPrivateFieldGet(this, _indexMatrix), _classPrivateFieldGet(this, _currentIndexState)));
94
122
  return observer;
95
123
  }
96
124
 
@@ -102,21 +130,21 @@ class ChangesObservable {
102
130
  * @param {Array} indexesState An array with index map state.
103
131
  */
104
132
  emit(indexesState) {
105
- let currentIndexState = this.#currentIndexState;
106
- if (!this.#isMatrixIndexesInitialized || this.#indexMatrix.length !== indexesState.length) {
133
+ let currentIndexState = _classPrivateFieldGet(this, _currentIndexState);
134
+ if (!_classPrivateFieldGet(this, _isMatrixIndexesInitialized) || _classPrivateFieldGet(this, _indexMatrix).length !== indexesState.length) {
107
135
  if (indexesState.length === 0) {
108
- indexesState = new Array(currentIndexState.length).fill(this.#initialIndexValue);
136
+ indexesState = new Array(currentIndexState.length).fill(_classPrivateFieldGet(this, _initialIndexValue));
109
137
  } else {
110
- this.#indexMatrix = new Array(indexesState.length).fill(this.#initialIndexValue);
138
+ _classPrivateFieldSet(this, _indexMatrix, new Array(indexesState.length).fill(_classPrivateFieldGet(this, _initialIndexValue)));
111
139
  }
112
- if (!this.#isMatrixIndexesInitialized) {
113
- this.#isMatrixIndexesInitialized = true;
114
- currentIndexState = this.#indexMatrix;
140
+ if (!_classPrivateFieldGet(this, _isMatrixIndexesInitialized)) {
141
+ _classPrivateFieldSet(this, _isMatrixIndexesInitialized, true);
142
+ currentIndexState = _classPrivateFieldGet(this, _indexMatrix);
115
143
  }
116
144
  }
117
145
  const changes = (0, _utils.arrayDiff)(currentIndexState, indexesState);
118
- this.#observers.forEach(observer => observer._write(changes));
119
- this.#currentIndexState = indexesState;
146
+ _classPrivateFieldGet(this, _observers).forEach(observer => observer._write(changes));
147
+ _classPrivateFieldSet(this, _currentIndexState, indexesState);
120
148
  }
121
149
  }
122
150
  exports.ChangesObservable = ChangesObservable;