handsontable 14.0.0 → 14.1.0-next-ba8c2b0-20240110

Sign up to get free protection for your applications and to get access to all the features.
Files changed (350) hide show
  1. package/3rdparty/walkontable/src/calculator/index.js +11 -6
  2. package/3rdparty/walkontable/src/calculator/index.mjs +5 -3
  3. package/3rdparty/walkontable/src/calculator/renderAllColumns.js +50 -0
  4. package/3rdparty/walkontable/src/calculator/renderAllColumns.mjs +46 -0
  5. package/3rdparty/walkontable/src/calculator/renderAllRows.js +50 -0
  6. package/3rdparty/walkontable/src/calculator/renderAllRows.mjs +46 -0
  7. package/3rdparty/walkontable/src/calculator/viewportColumns.js +3 -124
  8. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +4 -126
  9. package/3rdparty/walkontable/src/calculator/viewportRows.js +3 -3
  10. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +4 -5
  11. package/3rdparty/walkontable/src/cell/coords.d.ts +5 -5
  12. package/3rdparty/walkontable/src/cell/coords.js +2 -2
  13. package/3rdparty/walkontable/src/cell/coords.mjs +2 -2
  14. package/3rdparty/walkontable/src/cell/range.d.ts +5 -5
  15. package/3rdparty/walkontable/src/cell/range.js +16 -41
  16. package/3rdparty/walkontable/src/cell/range.mjs +16 -41
  17. package/3rdparty/walkontable/src/core/_base.js +2 -14
  18. package/3rdparty/walkontable/src/core/_base.mjs +2 -14
  19. package/3rdparty/walkontable/src/core/clone.js +2 -2
  20. package/3rdparty/walkontable/src/core/clone.mjs +2 -2
  21. package/3rdparty/walkontable/src/core/core.js +0 -2
  22. package/3rdparty/walkontable/src/core/core.mjs +0 -2
  23. package/3rdparty/walkontable/src/facade/core.js +0 -9
  24. package/3rdparty/walkontable/src/facade/core.mjs +0 -9
  25. package/3rdparty/walkontable/src/filter/column.js +2 -2
  26. package/3rdparty/walkontable/src/filter/column.mjs +2 -2
  27. package/3rdparty/walkontable/src/filter/row.js +2 -2
  28. package/3rdparty/walkontable/src/filter/row.mjs +2 -2
  29. package/3rdparty/walkontable/src/index.js +3 -4
  30. package/3rdparty/walkontable/src/index.mjs +1 -2
  31. package/3rdparty/walkontable/src/overlay/_base.js +2 -2
  32. package/3rdparty/walkontable/src/overlay/_base.mjs +2 -2
  33. package/3rdparty/walkontable/src/overlay/bottom.js +2 -2
  34. package/3rdparty/walkontable/src/overlay/bottom.mjs +2 -2
  35. package/3rdparty/walkontable/src/overlay/top.js +2 -2
  36. package/3rdparty/walkontable/src/overlay/top.mjs +2 -2
  37. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +2 -2
  38. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +2 -2
  39. package/3rdparty/walkontable/src/overlays.js +2 -5
  40. package/3rdparty/walkontable/src/overlays.mjs +2 -6
  41. package/3rdparty/walkontable/src/renderer/_base.js +2 -2
  42. package/3rdparty/walkontable/src/renderer/_base.mjs +2 -2
  43. package/3rdparty/walkontable/src/renderer/cells.js +2 -2
  44. package/3rdparty/walkontable/src/renderer/cells.mjs +2 -2
  45. package/3rdparty/walkontable/src/renderer/colGroup.js +10 -0
  46. package/3rdparty/walkontable/src/renderer/colGroup.mjs +10 -0
  47. package/3rdparty/walkontable/src/renderer/rowHeaders.js +2 -2
  48. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +2 -2
  49. package/3rdparty/walkontable/src/renderer/rows.js +6 -5
  50. package/3rdparty/walkontable/src/renderer/rows.mjs +6 -5
  51. package/3rdparty/walkontable/src/renderer/table.js +2 -2
  52. package/3rdparty/walkontable/src/renderer/table.mjs +2 -2
  53. package/3rdparty/walkontable/src/scroll.js +4 -60
  54. package/3rdparty/walkontable/src/scroll.mjs +4 -60
  55. package/3rdparty/walkontable/src/selection/manager.js +0 -1
  56. package/3rdparty/walkontable/src/selection/manager.mjs +0 -1
  57. package/3rdparty/walkontable/src/settings.js +5 -2
  58. package/3rdparty/walkontable/src/settings.mjs +4 -2
  59. package/3rdparty/walkontable/src/table.js +2 -3
  60. package/3rdparty/walkontable/src/table.mjs +2 -3
  61. package/3rdparty/walkontable/src/utils/column.js +29 -14
  62. package/3rdparty/walkontable/src/utils/column.mjs +29 -14
  63. package/3rdparty/walkontable/src/utils/columnStretching.js +219 -0
  64. package/3rdparty/walkontable/src/utils/columnStretching.mjs +215 -0
  65. package/3rdparty/walkontable/src/utils/nodesPool.js +2 -2
  66. package/3rdparty/walkontable/src/utils/nodesPool.mjs +2 -2
  67. package/3rdparty/walkontable/src/utils/orderView/view.js +2 -2
  68. package/3rdparty/walkontable/src/utils/orderView/view.mjs +2 -2
  69. package/3rdparty/walkontable/src/utils/orderView/viewSize.js +2 -2
  70. package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +2 -2
  71. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +2 -2
  72. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +2 -2
  73. package/3rdparty/walkontable/src/utils/row.js +2 -2
  74. package/3rdparty/walkontable/src/utils/row.mjs +2 -2
  75. package/3rdparty/walkontable/src/viewport.js +22 -17
  76. package/3rdparty/walkontable/src/viewport.mjs +23 -18
  77. package/CHANGELOG.md +36 -0
  78. package/base.js +4 -2
  79. package/base.mjs +2 -2
  80. package/cellTypes/dropdownType/dropdownType.d.ts +6 -6
  81. package/cellTypes/dropdownType/dropdownType.js +4 -4
  82. package/cellTypes/dropdownType/dropdownType.mjs +4 -4
  83. package/core/focusCatcher/index.js +44 -6
  84. package/core/focusCatcher/index.mjs +44 -6
  85. package/core.d.ts +19 -19
  86. package/core.js +7 -12
  87. package/core.mjs +7 -12
  88. package/dataMap/dataMap.js +3 -2
  89. package/dataMap/dataMap.mjs +2 -2
  90. package/dataMap/dataSource.js +2 -2
  91. package/dataMap/dataSource.mjs +2 -2
  92. package/dataMap/metaManager/lazyFactoryMap.js +2 -2
  93. package/dataMap/metaManager/lazyFactoryMap.mjs +2 -2
  94. package/dataMap/metaManager/metaLayers/cellMeta.js +2 -2
  95. package/dataMap/metaManager/metaLayers/cellMeta.mjs +2 -2
  96. package/dataMap/metaManager/metaLayers/columnMeta.js +2 -2
  97. package/dataMap/metaManager/metaLayers/columnMeta.mjs +2 -2
  98. package/dataMap/metaManager/metaLayers/globalMeta.js +2 -2
  99. package/dataMap/metaManager/metaLayers/globalMeta.mjs +2 -2
  100. package/dataMap/metaManager/metaLayers/tableMeta.js +2 -2
  101. package/dataMap/metaManager/metaLayers/tableMeta.mjs +2 -2
  102. package/dataMap/metaManager/metaSchema.js +40 -25
  103. package/dataMap/metaManager/metaSchema.mjs +40 -25
  104. package/dataMap/metaManager/mods/dynamicCellMeta.js +2 -2
  105. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +2 -2
  106. package/dataMap/metaManager/mods/extendMetaProperties.js +14 -2
  107. package/dataMap/metaManager/mods/extendMetaProperties.mjs +14 -2
  108. package/dist/handsontable.css +5 -5
  109. package/dist/handsontable.full.css +6 -6
  110. package/dist/handsontable.full.js +4835 -4508
  111. package/dist/handsontable.full.min.css +4 -4
  112. package/dist/handsontable.full.min.js +156 -154
  113. package/dist/handsontable.js +3441 -2825
  114. package/dist/handsontable.min.css +3 -3
  115. package/dist/handsontable.min.js +18 -15
  116. package/editorManager.js +5 -6
  117. package/editorManager.mjs +5 -6
  118. package/editors/autocompleteEditor/autocompleteEditor.js +2 -4
  119. package/editors/autocompleteEditor/autocompleteEditor.mjs +2 -4
  120. package/editors/baseEditor/baseEditor.d.ts +1 -1
  121. package/editors/baseEditor/baseEditor.js +2 -2
  122. package/editors/baseEditor/baseEditor.mjs +2 -2
  123. package/editors/dateEditor/dateEditor.d.ts +1 -1
  124. package/editors/dateEditor/dateEditor.js +29 -33
  125. package/editors/dateEditor/dateEditor.mjs +29 -33
  126. package/editors/handsontableEditor/handsontableEditor.js +0 -1
  127. package/editors/handsontableEditor/handsontableEditor.mjs +0 -1
  128. package/editors/selectEditor/selectEditor.js +8 -2
  129. package/editors/selectEditor/selectEditor.mjs +8 -2
  130. package/editors/textEditor/textEditor.js +2 -6
  131. package/editors/textEditor/textEditor.mjs +2 -6
  132. package/eventManager.js +4 -3
  133. package/eventManager.mjs +4 -3
  134. package/helpers/browser.js +5 -2
  135. package/helpers/browser.mjs +5 -2
  136. package/helpers/feature.js +10 -0
  137. package/helpers/feature.mjs +9 -0
  138. package/helpers/mixed.js +2 -2
  139. package/helpers/mixed.mjs +2 -2
  140. package/index.d.ts +12 -0
  141. package/package.json +13 -4
  142. package/pluginHooks.d.ts +10 -9
  143. package/pluginHooks.js +10 -8
  144. package/pluginHooks.mjs +7 -7
  145. package/plugins/autoColumnSize/autoColumnSize.d.ts +2 -2
  146. package/plugins/autoColumnSize/autoColumnSize.js +2 -2
  147. package/plugins/autoColumnSize/autoColumnSize.mjs +2 -2
  148. package/plugins/autoRowSize/autoRowSize.d.ts +3 -3
  149. package/plugins/autoRowSize/autoRowSize.js +2 -2
  150. package/plugins/autoRowSize/autoRowSize.mjs +2 -2
  151. package/plugins/autofill/autofill.js +2 -2
  152. package/plugins/autofill/autofill.mjs +2 -2
  153. package/plugins/base/base.js +2 -2
  154. package/plugins/base/base.mjs +2 -2
  155. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.d.ts +1 -1
  156. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +2 -2
  157. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +2 -2
  158. package/plugins/collapsibleColumns/collapsibleColumns.js +2 -2
  159. package/plugins/collapsibleColumns/collapsibleColumns.mjs +2 -2
  160. package/plugins/columnSorting/columnSorting.js +2 -2
  161. package/plugins/columnSorting/columnSorting.mjs +2 -2
  162. package/plugins/columnSorting/columnStatesManager.js +2 -2
  163. package/plugins/columnSorting/columnStatesManager.mjs +2 -2
  164. package/plugins/columnSummary/columnSummary.d.ts +11 -11
  165. package/plugins/columnSummary/columnSummary.js +20 -5
  166. package/plugins/columnSummary/columnSummary.mjs +20 -5
  167. package/plugins/columnSummary/endpoints.js +19 -5
  168. package/plugins/columnSummary/endpoints.mjs +19 -5
  169. package/plugins/comments/commentEditor.js +2 -2
  170. package/plugins/comments/commentEditor.mjs +2 -2
  171. package/plugins/comments/comments.js +2 -2
  172. package/plugins/comments/comments.mjs +2 -2
  173. package/plugins/comments/displaySwitch.js +2 -2
  174. package/plugins/comments/displaySwitch.mjs +2 -2
  175. package/plugins/contextMenu/commandExecutor.js +2 -2
  176. package/plugins/contextMenu/commandExecutor.mjs +2 -2
  177. package/plugins/contextMenu/contextMenu.js +2 -2
  178. package/plugins/contextMenu/contextMenu.mjs +2 -2
  179. package/plugins/contextMenu/itemsFactory.js +2 -2
  180. package/plugins/contextMenu/itemsFactory.mjs +2 -2
  181. package/plugins/contextMenu/menu/cursor.js +2 -2
  182. package/plugins/contextMenu/menu/cursor.mjs +2 -2
  183. package/plugins/contextMenu/menu/menu.js +2 -2
  184. package/plugins/contextMenu/menu/menu.mjs +2 -2
  185. package/plugins/copyPaste/copyPaste.js +40 -6
  186. package/plugins/copyPaste/copyPaste.mjs +40 -6
  187. package/plugins/customBorders/customBorders.d.ts +17 -8
  188. package/plugins/customBorders/customBorders.js +2 -7
  189. package/plugins/customBorders/customBorders.mjs +2 -7
  190. package/plugins/customBorders/utils.js +0 -1
  191. package/plugins/customBorders/utils.mjs +0 -1
  192. package/plugins/dragToScroll/dragToScroll.d.ts +8 -1
  193. package/plugins/dragToScroll/dragToScroll.js +18 -22
  194. package/plugins/dragToScroll/dragToScroll.mjs +18 -22
  195. package/plugins/dropdownMenu/dropdownMenu.js +2 -2
  196. package/plugins/dropdownMenu/dropdownMenu.mjs +2 -2
  197. package/plugins/exportFile/dataProvider.js +2 -2
  198. package/plugins/exportFile/dataProvider.mjs +2 -2
  199. package/plugins/exportFile/exportFile.d.ts +18 -3
  200. package/plugins/exportFile/types/_base.js +2 -2
  201. package/plugins/exportFile/types/_base.mjs +2 -2
  202. package/plugins/filters/component/_base.js +2 -2
  203. package/plugins/filters/component/_base.mjs +2 -2
  204. package/plugins/filters/component/actionBar.js +2 -2
  205. package/plugins/filters/component/actionBar.mjs +2 -2
  206. package/plugins/filters/component/condition.js +2 -2
  207. package/plugins/filters/component/condition.mjs +2 -2
  208. package/plugins/filters/component/operators.js +2 -2
  209. package/plugins/filters/component/operators.mjs +2 -2
  210. package/plugins/filters/component/value.js +2 -2
  211. package/plugins/filters/component/value.mjs +2 -2
  212. package/plugins/filters/conditionCollection.js +2 -2
  213. package/plugins/filters/conditionCollection.mjs +2 -2
  214. package/plugins/filters/conditionUpdateObserver.js +2 -2
  215. package/plugins/filters/conditionUpdateObserver.mjs +2 -2
  216. package/plugins/filters/dataFilter.js +2 -2
  217. package/plugins/filters/dataFilter.mjs +2 -2
  218. package/plugins/filters/filters.js +2 -2
  219. package/plugins/filters/filters.mjs +2 -2
  220. package/plugins/filters/ui/_base.js +2 -2
  221. package/plugins/filters/ui/_base.mjs +2 -2
  222. package/plugins/filters/ui/radioInput.js +1 -1
  223. package/plugins/filters/ui/radioInput.mjs +1 -1
  224. package/plugins/formulas/formulas.d.ts +1 -0
  225. package/plugins/formulas/formulas.js +2 -4
  226. package/plugins/formulas/formulas.mjs +2 -4
  227. package/plugins/formulas/indexSyncer/axisSyncer.js +0 -1
  228. package/plugins/formulas/indexSyncer/axisSyncer.mjs +0 -1
  229. package/plugins/manualColumnMove/ui/_base.js +2 -2
  230. package/plugins/manualColumnMove/ui/_base.mjs +2 -2
  231. package/plugins/manualColumnResize/manualColumnResize.js +6 -2
  232. package/plugins/manualColumnResize/manualColumnResize.mjs +6 -2
  233. package/plugins/manualRowMove/ui/_base.js +2 -2
  234. package/plugins/manualRowMove/ui/_base.mjs +2 -2
  235. package/plugins/manualRowResize/manualRowResize.js +7 -3
  236. package/plugins/manualRowResize/manualRowResize.mjs +7 -3
  237. package/plugins/mergeCells/calculations/autofill.js +2 -2
  238. package/plugins/mergeCells/calculations/autofill.mjs +2 -2
  239. package/plugins/mergeCells/calculations/selection.js +2 -2
  240. package/plugins/mergeCells/calculations/selection.mjs +2 -2
  241. package/plugins/mergeCells/cellCoords.js +2 -2
  242. package/plugins/mergeCells/cellCoords.mjs +2 -2
  243. package/plugins/mergeCells/cellsCollection.js +2 -2
  244. package/plugins/mergeCells/cellsCollection.mjs +2 -2
  245. package/plugins/mergeCells/mergeCells.js +2 -4
  246. package/plugins/mergeCells/mergeCells.mjs +2 -4
  247. package/plugins/multiColumnSorting/multiColumnSorting.js +2 -2
  248. package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -2
  249. package/plugins/multipleSelectionHandles/multipleSelectionHandles.d.ts +8 -1
  250. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +2 -2
  251. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +2 -2
  252. package/plugins/nestedHeaders/nestedHeaders.js +2 -3
  253. package/plugins/nestedHeaders/nestedHeaders.mjs +2 -3
  254. package/plugins/nestedHeaders/stateManager/headersTree.js +0 -1
  255. package/plugins/nestedHeaders/stateManager/headersTree.mjs +0 -1
  256. package/plugins/nestedHeaders/stateManager/sourceSettings.js +1 -1
  257. package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +1 -1
  258. package/plugins/nestedHeaders/utils/ghostTable.js +2 -2
  259. package/plugins/nestedHeaders/utils/ghostTable.mjs +2 -2
  260. package/plugins/nestedRows/data/dataManager.js +2 -2
  261. package/plugins/nestedRows/data/dataManager.mjs +2 -2
  262. package/plugins/nestedRows/nestedRows.js +2 -2
  263. package/plugins/nestedRows/nestedRows.mjs +2 -2
  264. package/plugins/nestedRows/ui/_base.js +2 -2
  265. package/plugins/nestedRows/ui/_base.mjs +2 -2
  266. package/plugins/nestedRows/ui/contextMenu.js +2 -2
  267. package/plugins/nestedRows/ui/contextMenu.mjs +2 -2
  268. package/plugins/nestedRows/utils/rowMoveController.js +2 -2
  269. package/plugins/nestedRows/utils/rowMoveController.mjs +2 -2
  270. package/plugins/persistentState/persistentState.d.ts +5 -2
  271. package/plugins/persistentState/persistentState.js +2 -2
  272. package/plugins/persistentState/persistentState.mjs +2 -2
  273. package/plugins/persistentState/storage.js +2 -2
  274. package/plugins/persistentState/storage.mjs +2 -2
  275. package/plugins/search/search.js +2 -2
  276. package/plugins/search/search.mjs +2 -2
  277. package/plugins/touchScroll/touchScroll.js +2 -2
  278. package/plugins/touchScroll/touchScroll.mjs +2 -2
  279. package/plugins/trimRows/trimRows.js +2 -2
  280. package/plugins/trimRows/trimRows.mjs +2 -2
  281. package/plugins/undoRedo/undoRedo.d.ts +3 -0
  282. package/plugins/undoRedo/undoRedo.js +64 -7
  283. package/plugins/undoRedo/undoRedo.mjs +64 -7
  284. package/renderers/autocompleteRenderer/autocompleteRenderer.d.ts +1 -1
  285. package/renderers/autocompleteRenderer/autocompleteRenderer.js +0 -1
  286. package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +0 -1
  287. package/renderers/baseRenderer/baseRenderer.d.ts +1 -1
  288. package/renderers/checkboxRenderer/checkboxRenderer.d.ts +1 -1
  289. package/renderers/checkboxRenderer/checkboxRenderer.js +0 -2
  290. package/renderers/checkboxRenderer/checkboxRenderer.mjs +0 -2
  291. package/renderers/dateRenderer/dateRenderer.d.ts +1 -1
  292. package/renderers/dropdownRenderer/dropdownRenderer.d.ts +5 -0
  293. package/renderers/dropdownRenderer/dropdownRenderer.js +23 -0
  294. package/renderers/dropdownRenderer/dropdownRenderer.mjs +19 -0
  295. package/renderers/dropdownRenderer/index.d.ts +1 -0
  296. package/renderers/dropdownRenderer/index.js +6 -0
  297. package/renderers/dropdownRenderer/index.mjs +1 -0
  298. package/renderers/handsontableRenderer/handsontableRenderer.d.ts +1 -1
  299. package/renderers/htmlRenderer/htmlRenderer.d.ts +1 -1
  300. package/renderers/index.d.ts +3 -0
  301. package/renderers/index.js +12 -0
  302. package/renderers/index.mjs +7 -1
  303. package/renderers/numericRenderer/numericRenderer.d.ts +1 -1
  304. package/renderers/passwordRenderer/passwordRenderer.d.ts +1 -1
  305. package/renderers/selectRenderer/selectRenderer.d.ts +1 -1
  306. package/renderers/textRenderer/textRenderer.d.ts +1 -1
  307. package/renderers/timeRenderer/timeRenderer.d.ts +1 -1
  308. package/selection/highlight/highlight.js +2 -3
  309. package/selection/highlight/highlight.mjs +2 -3
  310. package/selection/highlight/visualSelection.js +2 -2
  311. package/selection/highlight/visualSelection.mjs +2 -2
  312. package/selection/range.js +2 -2
  313. package/selection/range.mjs +2 -2
  314. package/selection/selection.js +2 -2
  315. package/selection/selection.mjs +2 -2
  316. package/settings.d.ts +27 -14
  317. package/tableView.js +4 -5
  318. package/tableView.mjs +4 -5
  319. package/translations/indexMapper.d.ts +1 -1
  320. package/translations/indexMapper.js +4 -3
  321. package/translations/indexMapper.mjs +2 -2
  322. package/translations/mapCollections/aggregatedCollection.js +2 -2
  323. package/translations/mapCollections/aggregatedCollection.mjs +2 -2
  324. package/translations/mapCollections/mapCollection.js +2 -2
  325. package/translations/mapCollections/mapCollection.mjs +2 -2
  326. package/translations/maps/indexMap.js +2 -2
  327. package/translations/maps/indexMap.mjs +2 -2
  328. package/translations/maps/linkedPhysicalIndexToValueMap.js +2 -2
  329. package/translations/maps/linkedPhysicalIndexToValueMap.mjs +2 -2
  330. package/utils/dataStructures/linkedList.js +2 -2
  331. package/utils/dataStructures/linkedList.mjs +2 -2
  332. package/utils/dataStructures/tree.js +2 -2
  333. package/utils/dataStructures/tree.mjs +2 -2
  334. package/utils/ghostTable.js +2 -2
  335. package/utils/ghostTable.mjs +2 -2
  336. package/utils/interval.js +2 -2
  337. package/utils/interval.mjs +2 -2
  338. package/utils/samplesGenerator.js +2 -2
  339. package/utils/samplesGenerator.mjs +2 -2
  340. package/validators/dropdownValidator/dropdownValidator.d.ts +5 -0
  341. package/validators/dropdownValidator/dropdownValidator.js +18 -0
  342. package/validators/dropdownValidator/dropdownValidator.mjs +14 -0
  343. package/validators/dropdownValidator/index.d.ts +1 -0
  344. package/validators/dropdownValidator/index.js +6 -0
  345. package/validators/dropdownValidator/index.mjs +1 -0
  346. package/validators/index.d.ts +2 -0
  347. package/validators/index.js +4 -0
  348. package/validators/index.mjs +3 -1
  349. package/validators/timeValidator/timeValidator.js +0 -1
  350. package/validators/timeValidator/timeValidator.mjs +0 -1
@@ -1,8 +1,8 @@
1
1
  import "core-js/modules/es.array.push.js";
2
2
  import "core-js/modules/es.error.cause.js";
3
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
6
  import { isUndefined } from "../../../helpers/mixed.mjs";
7
7
  import { warn } from "../../../helpers/console.mjs";
8
8
  import { toSingleLine } from "../../../helpers/templateLiteralTag.mjs";
@@ -2,12 +2,15 @@ import Core from '../../core';
2
2
  import { CellValue } from '../../common';
3
3
  import { BasePlugin } from '../base';
4
4
 
5
+ export interface ValueHolder {
6
+ value: any;
7
+ }
5
8
  export type Settings = boolean;
6
9
 
7
10
  export class PersistentState extends BasePlugin {
8
11
  constructor(hotInstance: Core);
9
12
  isEnabled(): boolean;
10
- loadValue(key: string, saveTo: CellValue): void;
13
+ loadValue(key: string, saveTo: ValueHolder): void;
11
14
  saveValue(key: string, value: CellValue): void;
12
- resetValue(key: string): void;
15
+ resetValue(key?: string): void;
13
16
  }
@@ -7,8 +7,8 @@ var _storage = _interopRequireDefault(require("./storage"));
7
7
  var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
9
  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; }
10
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
11
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
11
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
12
  _pluginHooks.default.getSingleton().register('persistentStateSave');
13
13
  _pluginHooks.default.getSingleton().register('persistentStateLoad');
14
14
  _pluginHooks.default.getSingleton().register('persistentStateReset');
@@ -1,7 +1,7 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
2
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
4
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
5
  import { BasePlugin } from "../base/index.mjs";
6
6
  import Storage from "./storage.mjs";
7
7
  import Hooks from "../../pluginHooks.mjs";
@@ -6,8 +6,8 @@ require("core-js/modules/es.array.push.js");
6
6
  require("core-js/modules/es.error.cause.js");
7
7
  var _array = require("../../helpers/array");
8
8
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
10
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
10
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
11
  /**
12
12
  * @private
13
13
  * @class Storage
@@ -2,8 +2,8 @@ import "core-js/modules/es.json.stringify.js";
2
2
  import "core-js/modules/es.array.push.js";
3
3
  import "core-js/modules/es.error.cause.js";
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import { arrayEach } from "../../helpers/array.mjs";
8
8
  /**
9
9
  * @private
@@ -10,8 +10,8 @@ var _mixed = require("../../helpers/mixed");
10
10
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
11
11
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
12
12
  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; }
13
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
- 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); }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
14
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
15
  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
16
16
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'search';
17
17
  const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 190;
@@ -3,8 +3,8 @@ import "core-js/modules/es.error.cause.js";
3
3
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
4
4
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
5
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); }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
8
  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
9
9
  import { BasePlugin } from "../base/index.mjs";
10
10
  import { isObject } from "../../helpers/object.mjs";
@@ -10,8 +10,8 @@ var _feature = require("../../helpers/feature");
10
10
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
11
11
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
12
12
  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; }
13
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
- 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); }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
14
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
15
  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
16
16
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'touchScroll';
17
17
  const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 200;
@@ -3,8 +3,8 @@ import "core-js/modules/es.error.cause.js";
3
3
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
4
4
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
5
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); }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
8
  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
9
9
  import { addClass, removeClass } from "../../helpers/dom/element.mjs";
10
10
  import { arrayEach } from "../../helpers/array.mjs";
@@ -9,8 +9,8 @@ var _array = require("../../helpers/array");
9
9
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
10
10
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
11
11
  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; }
12
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
13
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
13
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
14
  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
15
15
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'trimRows';
16
16
  const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 330;
@@ -3,8 +3,8 @@ import "core-js/modules/es.error.cause.js";
3
3
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
4
4
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
5
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); }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
8
  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
9
9
  import { BasePlugin } from "../base/index.mjs";
10
10
  import { TrimmingMap } from "../../translations/index.mjs";
@@ -46,4 +46,7 @@ export class UndoRedo extends BasePlugin {
46
46
  constructor(hotInstance: Core);
47
47
  undo(): void;
48
48
  redo(): void;
49
+ isUndoAvailable(): boolean;
50
+ isRedoAvailable(): boolean;
51
+ clear(): void;
49
52
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.array.push.js");
5
+ require("core-js/modules/es.object.from-entries.js");
5
6
  var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
6
7
  var _array = require("../../helpers/array");
7
8
  var _number = require("../../helpers/number");
@@ -59,11 +60,30 @@ function UndoRedo(instance) {
59
60
  instance.addHook('afterCreateRow', (index, amount, source) => {
60
61
  plugin.done(() => new UndoRedo.CreateRowAction(index, amount), source);
61
62
  });
63
+ const getCellMetas = (fromRow, toRow, fromColumn, toColumn) => {
64
+ const genericKeys = ['visualRow', 'visualCol', 'row', 'col', 'prop'];
65
+ const genericKeysLength = genericKeys.length;
66
+ const cellMetas = [];
67
+ (0, _number.rangeEach)(fromColumn, toColumn, columnIndex => {
68
+ (0, _number.rangeEach)(fromRow, toRow, rowIndex => {
69
+ const cellMeta = instance.getCellMeta(rowIndex, columnIndex);
70
+ if (Object.keys(cellMeta).length !== genericKeysLength) {
71
+ const uniqueMeta = Object.fromEntries(Object.entries(cellMeta).filter(_ref => {
72
+ let [key] = _ref;
73
+ return genericKeys.includes(key) === false;
74
+ }));
75
+ cellMetas.push([cellMeta.visualRow, cellMeta.visualCol, uniqueMeta]);
76
+ }
77
+ });
78
+ });
79
+ return cellMetas;
80
+ };
62
81
  instance.addHook('beforeRemoveRow', (index, amount, logicRows, source) => {
63
82
  const wrappedAction = () => {
64
83
  const physicalRowIndex = instance.toPhysicalRow(index);
84
+ const lastRowIndex = physicalRowIndex + amount - 1;
65
85
  const removedData = (0, _object.deepClone)(plugin.instance.getSourceData(physicalRowIndex, 0, physicalRowIndex + amount - 1, plugin.instance.countSourceCols() - 1));
66
- return new UndoRedo.RemoveRowAction(physicalRowIndex, removedData, instance.getSettings().fixedRowsBottom, instance.getSettings().fixedRowsTop, instance.rowIndexMapper.getIndexesSequence());
86
+ return new UndoRedo.RemoveRowAction(physicalRowIndex, removedData, instance.getSettings().fixedRowsBottom, instance.getSettings().fixedRowsTop, instance.rowIndexMapper.getIndexesSequence(), getCellMetas(physicalRowIndex, lastRowIndex, 0, instance.countCols() - 1));
67
87
  };
68
88
  plugin.done(wrappedAction, source);
69
89
  });
@@ -74,13 +94,14 @@ function UndoRedo(instance) {
74
94
  const wrappedAction = () => {
75
95
  const originalData = plugin.instance.getSourceDataArray();
76
96
  const columnIndex = (plugin.instance.countCols() + index) % plugin.instance.countCols();
97
+ const lastColumnIndex = columnIndex + amount - 1;
77
98
  const removedData = [];
78
99
  const headers = [];
79
100
  const indexes = [];
80
101
  (0, _number.rangeEach)(originalData.length - 1, i => {
81
102
  const column = [];
82
103
  const origRow = originalData[i];
83
- (0, _number.rangeEach)(columnIndex, columnIndex + (amount - 1), j => {
104
+ (0, _number.rangeEach)(columnIndex, lastColumnIndex, j => {
84
105
  column.push(origRow[instance.toPhysicalColumn(j)]);
85
106
  });
86
107
  removedData.push(column);
@@ -95,7 +116,7 @@ function UndoRedo(instance) {
95
116
  }
96
117
  const columnsMap = instance.columnIndexMapper.getIndexesSequence();
97
118
  const rowsMap = instance.rowIndexMapper.getIndexesSequence();
98
- return new UndoRedo.RemoveColumnAction(columnIndex, indexes, removedData, headers, columnsMap, rowsMap, instance.getSettings().fixedColumnsStart);
119
+ return new UndoRedo.RemoveColumnAction(columnIndex, indexes, removedData, headers, columnsMap, rowsMap, instance.getSettings().fixedColumnsStart, getCellMetas(0, instance.countRows(), columnIndex, lastColumnIndex));
99
120
  };
100
121
  plugin.done(wrappedAction, source);
101
122
  });
@@ -363,6 +384,32 @@ UndoRedo.ChangeAction.prototype.undo = function (instance, undoneCallback) {
363
384
  instance.undoRedo.doneActions.pop();
364
385
  }
365
386
  }
387
+ const selectedLast = instance.getSelectedLast();
388
+ if (selectedLast !== undefined) {
389
+ const [changedRow, changedColumn] = data[0];
390
+ const [selectedRow, selectedColumn] = selectedLast;
391
+ const firstFullyVisibleRow = instance.view.getFirstFullyVisibleRow();
392
+ const firstFullyVisibleColumn = instance.view.getFirstFullyVisibleColumn();
393
+ const isInVerticalViewPort = changedRow >= firstFullyVisibleRow;
394
+ const isInHorizontalViewPort = changedColumn >= firstFullyVisibleColumn;
395
+ const isInViewport = isInVerticalViewPort && isInHorizontalViewPort;
396
+ const isChangedSelection = selectedRow !== changedRow || selectedColumn !== changedColumn;
397
+
398
+ // Performing scroll only when selection has been changed right after editing a cell.
399
+ if (isInViewport === false && isChangedSelection === true) {
400
+ const scrollConfig = {
401
+ row: changedRow,
402
+ col: changedColumn
403
+ };
404
+ if (isInVerticalViewPort === false) {
405
+ scrollConfig.verticalSnap = 'top';
406
+ }
407
+ if (isInHorizontalViewPort === false) {
408
+ scrollConfig.horizontalSnap = 'start';
409
+ }
410
+ instance.scrollViewportTo(scrollConfig);
411
+ }
412
+ }
366
413
  instance.selectCells(this.selected, false, false);
367
414
  };
368
415
  UndoRedo.ChangeAction.prototype.redo = function (instance, onFinishCallback) {
@@ -396,7 +443,6 @@ UndoRedo.CreateRowAction.prototype.undo = function (instance, undoneCallback) {
396
443
  if (this.index >= rowCount && this.index - minSpareRows < rowCount) {
397
444
  this.index -= minSpareRows; // work around the situation where the needed row was removed due to an 'undo' of a made change
398
445
  }
399
-
400
446
  instance.addHookOnce('afterRemoveRow', undoneCallback);
401
447
  instance.alter('remove_row', this.index, this.amount, 'UndoRedo.undo');
402
448
  };
@@ -414,14 +460,16 @@ UndoRedo.CreateRowAction.prototype.redo = function (instance, redoneCallback) {
414
460
  * @param {number} fixedRowsBottom Number of fixed rows on the bottom. Remove row action change it sometimes.
415
461
  * @param {number} fixedRowsTop Number of fixed rows on the top. Remove row action change it sometimes.
416
462
  * @param {Array} rowIndexesSequence Row index sequence taken from the row index mapper.
463
+ * @param {Array} removedCellMetas List of removed cell metas.
417
464
  */
418
- UndoRedo.RemoveRowAction = function (index, data, fixedRowsBottom, fixedRowsTop, rowIndexesSequence) {
465
+ UndoRedo.RemoveRowAction = function (index, data, fixedRowsBottom, fixedRowsTop, rowIndexesSequence, removedCellMetas) {
419
466
  this.index = index;
420
467
  this.data = data;
421
468
  this.actionType = 'remove_row';
422
469
  this.fixedRowsBottom = fixedRowsBottom;
423
470
  this.fixedRowsTop = fixedRowsTop;
424
471
  this.rowIndexesSequence = rowIndexesSequence;
472
+ this.removedCellMetas = removedCellMetas;
425
473
  };
426
474
  (0, _object.inherit)(UndoRedo.RemoveRowAction, UndoRedo.Action);
427
475
  UndoRedo.RemoveRowAction.prototype.undo = function (instance, undoneCallback) {
@@ -440,6 +488,10 @@ UndoRedo.RemoveRowAction.prototype.undo = function (instance, undoneCallback) {
440
488
  });
441
489
  });
442
490
  instance.alter('insert_row_above', this.index, this.data.length, 'UndoRedo.undo');
491
+ this.removedCellMetas.forEach(_ref2 => {
492
+ let [rowIndex, columnIndex, cellMeta] = _ref2;
493
+ instance.setCellMetaObject(rowIndex, columnIndex, cellMeta);
494
+ });
443
495
  instance.addHookOnce('afterViewRender', undoneCallback);
444
496
  instance.setSourceDataAtCell(changes, null, null, 'UndoRedo.undo');
445
497
  instance.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence);
@@ -482,8 +534,9 @@ UndoRedo.CreateColumnAction.prototype.redo = function (instance, redoneCallback)
482
534
  * @param {number[]} columnPositions The column position.
483
535
  * @param {number[]} rowPositions The row position.
484
536
  * @param {number} fixedColumnsStart Number of fixed columns on the left. Remove column action change it sometimes.
537
+ * @param {Array} removedCellMetas List of removed cell metas.
485
538
  */
486
- UndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPositions, rowPositions, fixedColumnsStart) {
539
+ UndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPositions, rowPositions, fixedColumnsStart, removedCellMetas) {
487
540
  // eslint-disable-line max-len
488
541
  this.index = index;
489
542
  this.indexes = indexes;
@@ -494,6 +547,7 @@ UndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPos
494
547
  this.rowPositions = rowPositions.slice(0);
495
548
  this.actionType = 'remove_col';
496
549
  this.fixedColumnsStart = fixedColumnsStart;
550
+ this.removedCellMetas = removedCellMetas;
497
551
  };
498
552
  (0, _object.inherit)(UndoRedo.RemoveColumnAction, UndoRedo.Action);
499
553
  UndoRedo.RemoveColumnAction.prototype.undo = function (instance, undoneCallback) {
@@ -523,6 +577,10 @@ UndoRedo.RemoveColumnAction.prototype.undo = function (instance, undoneCallback)
523
577
  instance.getSettings().colHeaders[ascendingIndexes[columnIndex]] = headerData;
524
578
  });
525
579
  }
580
+ this.removedCellMetas.forEach(_ref3 => {
581
+ let [rowIndex, columnIndex, cellMeta] = _ref3;
582
+ instance.setCellMetaObject(rowIndex, columnIndex, cellMeta);
583
+ });
526
584
  instance.batchExecution(() => {
527
585
  // Restore row sequence in a case when all columns are removed. the original
528
586
  // row sequence is lost in that case.
@@ -716,7 +774,6 @@ UndoRedo.prototype.registerShortcuts = function () {
716
774
  const runOnlyIf = event => {
717
775
  return !event.altKey; // right ALT in some systems triggers ALT+CTR
718
776
  };
719
-
720
777
  const config = {
721
778
  runOnlyIf,
722
779
  group: SHORTCUTS_GROUP
@@ -1,4 +1,5 @@
1
1
  import "core-js/modules/es.array.push.js";
2
+ import "core-js/modules/es.object.from-entries.js";
2
3
  import Hooks from "../../pluginHooks.mjs";
3
4
  import { arrayMap, arrayEach } from "../../helpers/array.mjs";
4
5
  import { rangeEach } from "../../helpers/number.mjs";
@@ -55,11 +56,30 @@ function UndoRedo(instance) {
55
56
  instance.addHook('afterCreateRow', (index, amount, source) => {
56
57
  plugin.done(() => new UndoRedo.CreateRowAction(index, amount), source);
57
58
  });
59
+ const getCellMetas = (fromRow, toRow, fromColumn, toColumn) => {
60
+ const genericKeys = ['visualRow', 'visualCol', 'row', 'col', 'prop'];
61
+ const genericKeysLength = genericKeys.length;
62
+ const cellMetas = [];
63
+ rangeEach(fromColumn, toColumn, columnIndex => {
64
+ rangeEach(fromRow, toRow, rowIndex => {
65
+ const cellMeta = instance.getCellMeta(rowIndex, columnIndex);
66
+ if (Object.keys(cellMeta).length !== genericKeysLength) {
67
+ const uniqueMeta = Object.fromEntries(Object.entries(cellMeta).filter(_ref => {
68
+ let [key] = _ref;
69
+ return genericKeys.includes(key) === false;
70
+ }));
71
+ cellMetas.push([cellMeta.visualRow, cellMeta.visualCol, uniqueMeta]);
72
+ }
73
+ });
74
+ });
75
+ return cellMetas;
76
+ };
58
77
  instance.addHook('beforeRemoveRow', (index, amount, logicRows, source) => {
59
78
  const wrappedAction = () => {
60
79
  const physicalRowIndex = instance.toPhysicalRow(index);
80
+ const lastRowIndex = physicalRowIndex + amount - 1;
61
81
  const removedData = deepClone(plugin.instance.getSourceData(physicalRowIndex, 0, physicalRowIndex + amount - 1, plugin.instance.countSourceCols() - 1));
62
- return new UndoRedo.RemoveRowAction(physicalRowIndex, removedData, instance.getSettings().fixedRowsBottom, instance.getSettings().fixedRowsTop, instance.rowIndexMapper.getIndexesSequence());
82
+ return new UndoRedo.RemoveRowAction(physicalRowIndex, removedData, instance.getSettings().fixedRowsBottom, instance.getSettings().fixedRowsTop, instance.rowIndexMapper.getIndexesSequence(), getCellMetas(physicalRowIndex, lastRowIndex, 0, instance.countCols() - 1));
63
83
  };
64
84
  plugin.done(wrappedAction, source);
65
85
  });
@@ -70,13 +90,14 @@ function UndoRedo(instance) {
70
90
  const wrappedAction = () => {
71
91
  const originalData = plugin.instance.getSourceDataArray();
72
92
  const columnIndex = (plugin.instance.countCols() + index) % plugin.instance.countCols();
93
+ const lastColumnIndex = columnIndex + amount - 1;
73
94
  const removedData = [];
74
95
  const headers = [];
75
96
  const indexes = [];
76
97
  rangeEach(originalData.length - 1, i => {
77
98
  const column = [];
78
99
  const origRow = originalData[i];
79
- rangeEach(columnIndex, columnIndex + (amount - 1), j => {
100
+ rangeEach(columnIndex, lastColumnIndex, j => {
80
101
  column.push(origRow[instance.toPhysicalColumn(j)]);
81
102
  });
82
103
  removedData.push(column);
@@ -91,7 +112,7 @@ function UndoRedo(instance) {
91
112
  }
92
113
  const columnsMap = instance.columnIndexMapper.getIndexesSequence();
93
114
  const rowsMap = instance.rowIndexMapper.getIndexesSequence();
94
- return new UndoRedo.RemoveColumnAction(columnIndex, indexes, removedData, headers, columnsMap, rowsMap, instance.getSettings().fixedColumnsStart);
115
+ return new UndoRedo.RemoveColumnAction(columnIndex, indexes, removedData, headers, columnsMap, rowsMap, instance.getSettings().fixedColumnsStart, getCellMetas(0, instance.countRows(), columnIndex, lastColumnIndex));
95
116
  };
96
117
  plugin.done(wrappedAction, source);
97
118
  });
@@ -359,6 +380,32 @@ UndoRedo.ChangeAction.prototype.undo = function (instance, undoneCallback) {
359
380
  instance.undoRedo.doneActions.pop();
360
381
  }
361
382
  }
383
+ const selectedLast = instance.getSelectedLast();
384
+ if (selectedLast !== undefined) {
385
+ const [changedRow, changedColumn] = data[0];
386
+ const [selectedRow, selectedColumn] = selectedLast;
387
+ const firstFullyVisibleRow = instance.view.getFirstFullyVisibleRow();
388
+ const firstFullyVisibleColumn = instance.view.getFirstFullyVisibleColumn();
389
+ const isInVerticalViewPort = changedRow >= firstFullyVisibleRow;
390
+ const isInHorizontalViewPort = changedColumn >= firstFullyVisibleColumn;
391
+ const isInViewport = isInVerticalViewPort && isInHorizontalViewPort;
392
+ const isChangedSelection = selectedRow !== changedRow || selectedColumn !== changedColumn;
393
+
394
+ // Performing scroll only when selection has been changed right after editing a cell.
395
+ if (isInViewport === false && isChangedSelection === true) {
396
+ const scrollConfig = {
397
+ row: changedRow,
398
+ col: changedColumn
399
+ };
400
+ if (isInVerticalViewPort === false) {
401
+ scrollConfig.verticalSnap = 'top';
402
+ }
403
+ if (isInHorizontalViewPort === false) {
404
+ scrollConfig.horizontalSnap = 'start';
405
+ }
406
+ instance.scrollViewportTo(scrollConfig);
407
+ }
408
+ }
362
409
  instance.selectCells(this.selected, false, false);
363
410
  };
364
411
  UndoRedo.ChangeAction.prototype.redo = function (instance, onFinishCallback) {
@@ -392,7 +439,6 @@ UndoRedo.CreateRowAction.prototype.undo = function (instance, undoneCallback) {
392
439
  if (this.index >= rowCount && this.index - minSpareRows < rowCount) {
393
440
  this.index -= minSpareRows; // work around the situation where the needed row was removed due to an 'undo' of a made change
394
441
  }
395
-
396
442
  instance.addHookOnce('afterRemoveRow', undoneCallback);
397
443
  instance.alter('remove_row', this.index, this.amount, 'UndoRedo.undo');
398
444
  };
@@ -410,14 +456,16 @@ UndoRedo.CreateRowAction.prototype.redo = function (instance, redoneCallback) {
410
456
  * @param {number} fixedRowsBottom Number of fixed rows on the bottom. Remove row action change it sometimes.
411
457
  * @param {number} fixedRowsTop Number of fixed rows on the top. Remove row action change it sometimes.
412
458
  * @param {Array} rowIndexesSequence Row index sequence taken from the row index mapper.
459
+ * @param {Array} removedCellMetas List of removed cell metas.
413
460
  */
414
- UndoRedo.RemoveRowAction = function (index, data, fixedRowsBottom, fixedRowsTop, rowIndexesSequence) {
461
+ UndoRedo.RemoveRowAction = function (index, data, fixedRowsBottom, fixedRowsTop, rowIndexesSequence, removedCellMetas) {
415
462
  this.index = index;
416
463
  this.data = data;
417
464
  this.actionType = 'remove_row';
418
465
  this.fixedRowsBottom = fixedRowsBottom;
419
466
  this.fixedRowsTop = fixedRowsTop;
420
467
  this.rowIndexesSequence = rowIndexesSequence;
468
+ this.removedCellMetas = removedCellMetas;
421
469
  };
422
470
  inherit(UndoRedo.RemoveRowAction, UndoRedo.Action);
423
471
  UndoRedo.RemoveRowAction.prototype.undo = function (instance, undoneCallback) {
@@ -436,6 +484,10 @@ UndoRedo.RemoveRowAction.prototype.undo = function (instance, undoneCallback) {
436
484
  });
437
485
  });
438
486
  instance.alter('insert_row_above', this.index, this.data.length, 'UndoRedo.undo');
487
+ this.removedCellMetas.forEach(_ref2 => {
488
+ let [rowIndex, columnIndex, cellMeta] = _ref2;
489
+ instance.setCellMetaObject(rowIndex, columnIndex, cellMeta);
490
+ });
439
491
  instance.addHookOnce('afterViewRender', undoneCallback);
440
492
  instance.setSourceDataAtCell(changes, null, null, 'UndoRedo.undo');
441
493
  instance.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence);
@@ -478,8 +530,9 @@ UndoRedo.CreateColumnAction.prototype.redo = function (instance, redoneCallback)
478
530
  * @param {number[]} columnPositions The column position.
479
531
  * @param {number[]} rowPositions The row position.
480
532
  * @param {number} fixedColumnsStart Number of fixed columns on the left. Remove column action change it sometimes.
533
+ * @param {Array} removedCellMetas List of removed cell metas.
481
534
  */
482
- UndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPositions, rowPositions, fixedColumnsStart) {
535
+ UndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPositions, rowPositions, fixedColumnsStart, removedCellMetas) {
483
536
  // eslint-disable-line max-len
484
537
  this.index = index;
485
538
  this.indexes = indexes;
@@ -490,6 +543,7 @@ UndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPos
490
543
  this.rowPositions = rowPositions.slice(0);
491
544
  this.actionType = 'remove_col';
492
545
  this.fixedColumnsStart = fixedColumnsStart;
546
+ this.removedCellMetas = removedCellMetas;
493
547
  };
494
548
  inherit(UndoRedo.RemoveColumnAction, UndoRedo.Action);
495
549
  UndoRedo.RemoveColumnAction.prototype.undo = function (instance, undoneCallback) {
@@ -519,6 +573,10 @@ UndoRedo.RemoveColumnAction.prototype.undo = function (instance, undoneCallback)
519
573
  instance.getSettings().colHeaders[ascendingIndexes[columnIndex]] = headerData;
520
574
  });
521
575
  }
576
+ this.removedCellMetas.forEach(_ref3 => {
577
+ let [rowIndex, columnIndex, cellMeta] = _ref3;
578
+ instance.setCellMetaObject(rowIndex, columnIndex, cellMeta);
579
+ });
522
580
  instance.batchExecution(() => {
523
581
  // Restore row sequence in a case when all columns are removed. the original
524
582
  // row sequence is lost in that case.
@@ -712,7 +770,6 @@ UndoRedo.prototype.registerShortcuts = function () {
712
770
  const runOnlyIf = event => {
713
771
  return !event.altKey; // right ALT in some systems triggers ALT+CTR
714
772
  };
715
-
716
773
  const config = {
717
774
  runOnlyIf,
718
775
  group: SHORTCUTS_GROUP
@@ -2,4 +2,4 @@ import Core from '../../core';
2
2
  import { CellProperties } from '../../settings';
3
3
 
4
4
  export const RENDERER_TYPE: 'autocomplete';
5
- export function autocompleteRenderer(instance: Core, TD: HTMLTableCellElement, row: number, col: number, prop: string | number, value: any, cellProperties: CellProperties): void;
5
+ export function autocompleteRenderer(instance: Core, TD: HTMLTableCellElement, row: number, column: number, prop: string | number, value: any, cellProperties: CellProperties): void;
@@ -41,7 +41,6 @@ function autocompleteRenderer(hotInstance, TD, row, col, prop, value, cellProper
41
41
  TD.appendChild(rootDocument.createTextNode(String.fromCharCode(160))); // workaround for https://github.com/handsontable/handsontable/issues/1946
42
42
  // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips
43
43
  }
44
-
45
44
  TD.insertBefore(ARROW, TD.firstChild);
46
45
  (0, _element.addClass)(TD, 'htAutocomplete');
47
46
  if (!hotInstance.acArrowListener) {
@@ -36,7 +36,6 @@ export function autocompleteRenderer(hotInstance, TD, row, col, prop, value, cel
36
36
  TD.appendChild(rootDocument.createTextNode(String.fromCharCode(160))); // workaround for https://github.com/handsontable/handsontable/issues/1946
37
37
  // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips
38
38
  }
39
-
40
39
  TD.insertBefore(ARROW, TD.firstChild);
41
40
  addClass(TD, 'htAutocomplete');
42
41
  if (!hotInstance.acArrowListener) {
@@ -2,4 +2,4 @@ import Core from '../../core';
2
2
  import { CellProperties } from '../../settings';
3
3
 
4
4
  export const RENDERER_TYPE: 'base';
5
- export function baseRenderer(instance: Core, TD: HTMLTableCellElement, row: number, col: number, prop: string | number, value: any, cellProperties: CellProperties): void;
5
+ export function baseRenderer(instance: Core, TD: HTMLTableCellElement, row: number, column: number, prop: string | number, value: any, cellProperties: CellProperties): void;
@@ -2,4 +2,4 @@ import Core from '../../core';
2
2
  import { CellProperties } from '../../settings';
3
3
 
4
4
  export const RENDERER_TYPE: 'checkbox';
5
- export function checkboxRenderer(instance: Core, TD: HTMLTableCellElement, row: number, col: number, prop: string | number, value: any, cellProperties: CellProperties): void;
5
+ export function checkboxRenderer(instance: Core, TD: HTMLTableCellElement, row: number, column: number, prop: string | number, value: any, cellProperties: CellProperties): void;
@@ -153,7 +153,6 @@ function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellProperties
153
153
  changeSelectedCheckboxesState();
154
154
  return !areSelectedCheckboxCells(); // False blocks next action associated with the keyboard shortcut.
155
155
  },
156
-
157
156
  runOnlyIf: () => hotInstance.getSettings().enterBeginsEditing
158
157
  }, {
159
158
  keys: [['delete'], ['backspace']],
@@ -161,7 +160,6 @@ function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellProperties
161
160
  changeSelectedCheckboxesState(true);
162
161
  return !areSelectedCheckboxCells(); // False blocks next action associated with the keyboard shortcut.
163
162
  },
164
-
165
163
  relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
166
164
  position: 'before'
167
165
  }], config);
@@ -148,7 +148,6 @@ export function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellPro
148
148
  changeSelectedCheckboxesState();
149
149
  return !areSelectedCheckboxCells(); // False blocks next action associated with the keyboard shortcut.
150
150
  },
151
-
152
151
  runOnlyIf: () => hotInstance.getSettings().enterBeginsEditing
153
152
  }, {
154
153
  keys: [['delete'], ['backspace']],
@@ -156,7 +155,6 @@ export function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellPro
156
155
  changeSelectedCheckboxesState(true);
157
156
  return !areSelectedCheckboxCells(); // False blocks next action associated with the keyboard shortcut.
158
157
  },
159
-
160
158
  relativeToGroup: SHORTCUTS_GROUP_EDITOR,
161
159
  position: 'before'
162
160
  }], config);
@@ -2,4 +2,4 @@ import Core from '../../core';
2
2
  import { CellProperties } from '../../settings';
3
3
 
4
4
  export const RENDERER_TYPE: 'date';
5
- export function dateRenderer(instance: Core, TD: HTMLTableCellElement, row: number, col: number, prop: string | number, value: any, cellProperties: CellProperties): void;
5
+ export function dateRenderer(instance: Core, TD: HTMLTableCellElement, row: number, column: number, prop: string | number, value: any, cellProperties: CellProperties): void;
@@ -0,0 +1,5 @@
1
+ import Core from '../../core';
2
+ import { CellProperties } from '../../settings';
3
+
4
+ export const RENDERER_TYPE: 'dropdown';
5
+ export function dropdownRenderer(instance: Core, TD: HTMLTableCellElement, row: number, column: number, prop: string | number, value: any, cellProperties: CellProperties): void;