handsontable 14.0.0-next-c080457-20231107 → 14.0.0-next-bfad250-20231108

Sign up to get free protection for your applications and to get access to all the features.
Files changed (327) hide show
  1. package/3rdparty/SheetClip/SheetClip.js +2 -2
  2. package/3rdparty/SheetClip/SheetClip.mjs +2 -2
  3. package/3rdparty/autoResize/autoResize.js +2 -2
  4. package/3rdparty/autoResize/autoResize.mjs +2 -2
  5. package/3rdparty/walkontable/src/calculator/viewportColumns.js +108 -85
  6. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +108 -85
  7. package/3rdparty/walkontable/src/calculator/viewportRows.js +60 -52
  8. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +60 -52
  9. package/3rdparty/walkontable/src/cell/coords.js +7 -5
  10. package/3rdparty/walkontable/src/cell/coords.mjs +7 -5
  11. package/3rdparty/walkontable/src/core/clone.js +6 -0
  12. package/3rdparty/walkontable/src/core/clone.mjs +6 -0
  13. package/3rdparty/walkontable/src/event.js +125 -74
  14. package/3rdparty/walkontable/src/event.mjs +125 -74
  15. package/3rdparty/walkontable/src/filter/column.js +16 -0
  16. package/3rdparty/walkontable/src/filter/column.mjs +16 -0
  17. package/3rdparty/walkontable/src/filter/row.js +16 -0
  18. package/3rdparty/walkontable/src/filter/row.mjs +16 -0
  19. package/3rdparty/walkontable/src/overlay/bottom.js +1 -1
  20. package/3rdparty/walkontable/src/overlay/bottom.mjs +1 -1
  21. package/3rdparty/walkontable/src/overlay/top.js +1 -1
  22. package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
  23. package/3rdparty/walkontable/src/renderer/_base.js +12 -5
  24. package/3rdparty/walkontable/src/renderer/_base.mjs +12 -5
  25. package/3rdparty/walkontable/src/renderer/cells.js +6 -2
  26. package/3rdparty/walkontable/src/renderer/cells.mjs +6 -2
  27. package/3rdparty/walkontable/src/renderer/rowHeaders.js +6 -2
  28. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +6 -2
  29. package/3rdparty/walkontable/src/renderer/rows.js +5 -0
  30. package/3rdparty/walkontable/src/renderer/rows.mjs +5 -0
  31. package/3rdparty/walkontable/src/renderer/table.js +24 -17
  32. package/3rdparty/walkontable/src/renderer/table.mjs +24 -17
  33. package/3rdparty/walkontable/src/scroll.js +2 -2
  34. package/3rdparty/walkontable/src/scroll.mjs +2 -2
  35. package/3rdparty/walkontable/src/selection/border/border.js +1 -1
  36. package/3rdparty/walkontable/src/selection/border/border.mjs +1 -1
  37. package/3rdparty/walkontable/src/settings.js +10 -10
  38. package/3rdparty/walkontable/src/settings.mjs +10 -10
  39. package/3rdparty/walkontable/src/table.js +3 -3
  40. package/3rdparty/walkontable/src/table.mjs +3 -3
  41. package/3rdparty/walkontable/src/utils/column.js +19 -4
  42. package/3rdparty/walkontable/src/utils/column.mjs +19 -4
  43. package/3rdparty/walkontable/src/utils/nodesPool.js +5 -0
  44. package/3rdparty/walkontable/src/utils/nodesPool.mjs +5 -0
  45. package/3rdparty/walkontable/src/utils/orderView/view.js +13 -6
  46. package/3rdparty/walkontable/src/utils/orderView/view.mjs +13 -6
  47. package/3rdparty/walkontable/src/utils/orderView/viewSize.js +9 -6
  48. package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +9 -6
  49. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +7 -4
  50. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +7 -4
  51. package/3rdparty/walkontable/src/utils/row.js +14 -2
  52. package/3rdparty/walkontable/src/utils/row.mjs +14 -2
  53. package/3rdparty/walkontable/src/viewport.js +9 -9
  54. package/3rdparty/walkontable/src/viewport.mjs +9 -9
  55. package/base.js +2 -2
  56. package/base.mjs +2 -2
  57. package/core.js +25 -25
  58. package/core.mjs +25 -25
  59. package/dataMap/dataMap.js +99 -90
  60. package/dataMap/dataMap.mjs +99 -90
  61. package/dataMap/dataSource.js +14 -8
  62. package/dataMap/dataSource.mjs +14 -8
  63. package/dataMap/metaManager/lazyFactoryMap.js +19 -7
  64. package/dataMap/metaManager/lazyFactoryMap.mjs +19 -7
  65. package/dataMap/metaManager/metaLayers/cellMeta.js +8 -3
  66. package/dataMap/metaManager/metaLayers/cellMeta.mjs +8 -3
  67. package/dataMap/metaManager/metaLayers/columnMeta.js +7 -1
  68. package/dataMap/metaManager/metaLayers/columnMeta.mjs +7 -1
  69. package/dataMap/metaManager/metaLayers/globalMeta.js +6 -1
  70. package/dataMap/metaManager/metaLayers/globalMeta.mjs +6 -1
  71. package/dataMap/metaManager/metaLayers/tableMeta.js +6 -2
  72. package/dataMap/metaManager/metaLayers/tableMeta.mjs +6 -2
  73. package/dataMap/metaManager/metaSchema.js +55 -55
  74. package/dataMap/metaManager/metaSchema.mjs +55 -55
  75. package/dataMap/metaManager/mods/dynamicCellMeta.js +7 -2
  76. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +7 -2
  77. package/dataMap/metaManager/mods/extendMetaProperties.js +8 -4
  78. package/dataMap/metaManager/mods/extendMetaProperties.mjs +8 -4
  79. package/dataMap/metaManager/utils.js +2 -2
  80. package/dataMap/metaManager/utils.mjs +2 -2
  81. package/dist/handsontable.css +2 -2
  82. package/dist/handsontable.full.css +2 -2
  83. package/dist/handsontable.full.js +7337 -6389
  84. package/dist/handsontable.full.min.css +2 -2
  85. package/dist/handsontable.full.min.js +154 -154
  86. package/dist/handsontable.js +7336 -6388
  87. package/dist/handsontable.min.css +2 -2
  88. package/dist/handsontable.min.js +28 -28
  89. package/editorManager.js +105 -95
  90. package/editorManager.mjs +105 -95
  91. package/editors/autocompleteEditor/autocompleteEditor.js +47 -46
  92. package/editors/autocompleteEditor/autocompleteEditor.mjs +46 -45
  93. package/editors/baseEditor/baseEditor.js +23 -26
  94. package/editors/baseEditor/baseEditor.mjs +23 -26
  95. package/editors/dateEditor/dateEditor.js +24 -15
  96. package/editors/dateEditor/dateEditor.mjs +24 -15
  97. package/editors/dropdownEditor/dropdownEditor.js +1 -1
  98. package/editors/dropdownEditor/dropdownEditor.mjs +1 -1
  99. package/editors/handsontableEditor/handsontableEditor.js +4 -4
  100. package/editors/handsontableEditor/handsontableEditor.mjs +4 -4
  101. package/editors/textEditor/textEditor.js +23 -17
  102. package/editors/textEditor/textEditor.mjs +24 -18
  103. package/eventManager.js +8 -0
  104. package/eventManager.mjs +8 -0
  105. package/helpers/array.js +2 -2
  106. package/helpers/array.mjs +2 -2
  107. package/helpers/dom/element.js +7 -7
  108. package/helpers/dom/element.mjs +7 -7
  109. package/helpers/function.js +1 -1
  110. package/helpers/function.mjs +1 -1
  111. package/helpers/mixed.js +1 -1
  112. package/helpers/mixed.mjs +1 -1
  113. package/helpers/object.js +4 -4
  114. package/helpers/object.mjs +4 -4
  115. package/helpers/string.js +1 -1
  116. package/helpers/string.mjs +1 -1
  117. package/package.json +1 -1
  118. package/pluginHooks.d.ts +0 -2
  119. package/pluginHooks.js +12 -3
  120. package/pluginHooks.mjs +12 -3
  121. package/plugins/autoColumnSize/autoColumnSize.js +141 -130
  122. package/plugins/autoColumnSize/autoColumnSize.mjs +140 -129
  123. package/plugins/autoRowSize/autoRowSize.js +112 -125
  124. package/plugins/autoRowSize/autoRowSize.mjs +110 -123
  125. package/plugins/autofill/autofill.d.ts +0 -1
  126. package/plugins/autofill/autofill.js +98 -102
  127. package/plugins/autofill/autofill.mjs +97 -101
  128. package/plugins/base/base.js +61 -28
  129. package/plugins/base/base.mjs +60 -28
  130. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +29 -24
  131. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +28 -23
  132. package/plugins/collapsibleColumns/collapsibleColumns.js +104 -107
  133. package/plugins/collapsibleColumns/collapsibleColumns.mjs +102 -104
  134. package/plugins/columnSorting/columnSorting.js +107 -99
  135. package/plugins/columnSorting/columnSorting.mjs +106 -98
  136. package/plugins/columnSorting/columnStatesManager.js +12 -6
  137. package/plugins/columnSorting/columnStatesManager.mjs +12 -6
  138. package/plugins/columnSummary/columnSummary.js +71 -58
  139. package/plugins/columnSummary/columnSummary.mjs +70 -57
  140. package/plugins/columnSummary/endpoints.js +20 -14
  141. package/plugins/columnSummary/endpoints.mjs +20 -14
  142. package/plugins/comments/commentEditor.js +30 -2
  143. package/plugins/comments/commentEditor.mjs +30 -2
  144. package/plugins/comments/comments.js +158 -169
  145. package/plugins/comments/comments.mjs +157 -168
  146. package/plugins/comments/displaySwitch.js +7 -3
  147. package/plugins/comments/displaySwitch.mjs +7 -3
  148. package/plugins/contextMenu/commandExecutor.js +15 -2
  149. package/plugins/contextMenu/commandExecutor.mjs +15 -2
  150. package/plugins/contextMenu/contextMenu.js +96 -102
  151. package/plugins/contextMenu/contextMenu.mjs +95 -101
  152. package/plugins/contextMenu/itemsFactory.js +19 -4
  153. package/plugins/contextMenu/itemsFactory.mjs +19 -4
  154. package/plugins/contextMenu/menu/cursor.js +36 -0
  155. package/plugins/contextMenu/menu/cursor.mjs +36 -0
  156. package/plugins/contextMenu/menu/menu.js +57 -5
  157. package/plugins/contextMenu/menu/menu.mjs +57 -5
  158. package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
  159. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
  160. package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
  161. package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
  162. package/plugins/copyPaste/copyPaste.js +74 -75
  163. package/plugins/copyPaste/copyPaste.mjs +74 -75
  164. package/plugins/customBorders/customBorders.js +57 -50
  165. package/plugins/customBorders/customBorders.mjs +56 -49
  166. package/plugins/dragToScroll/dragToScroll.js +50 -54
  167. package/plugins/dragToScroll/dragToScroll.mjs +49 -52
  168. package/plugins/dropdownMenu/dropdownMenu.js +136 -131
  169. package/plugins/dropdownMenu/dropdownMenu.mjs +136 -131
  170. package/plugins/exportFile/dataProvider.js +7 -2
  171. package/plugins/exportFile/dataProvider.mjs +7 -2
  172. package/plugins/exportFile/exportFile.js +1 -1
  173. package/plugins/exportFile/exportFile.mjs +1 -1
  174. package/plugins/exportFile/types/_base.js +14 -6
  175. package/plugins/exportFile/types/_base.mjs +14 -6
  176. package/plugins/filters/component/actionBar.js +9 -0
  177. package/plugins/filters/component/actionBar.mjs +9 -0
  178. package/plugins/filters/component/condition.js +13 -0
  179. package/plugins/filters/component/condition.mjs +13 -0
  180. package/plugins/filters/component/operators.js +9 -0
  181. package/plugins/filters/component/operators.mjs +9 -0
  182. package/plugins/filters/component/value.js +9 -0
  183. package/plugins/filters/component/value.mjs +9 -0
  184. package/plugins/filters/conditionCollection.js +9 -4
  185. package/plugins/filters/conditionCollection.mjs +9 -4
  186. package/plugins/filters/conditionUpdateObserver.js +53 -42
  187. package/plugins/filters/conditionUpdateObserver.mjs +53 -42
  188. package/plugins/filters/dataFilter.js +9 -3
  189. package/plugins/filters/dataFilter.mjs +9 -3
  190. package/plugins/filters/filters.js +184 -189
  191. package/plugins/filters/filters.mjs +182 -187
  192. package/plugins/filters/ui/_base.js +1 -1
  193. package/plugins/filters/ui/_base.mjs +1 -1
  194. package/plugins/filters/utils.js +1 -1
  195. package/plugins/filters/utils.mjs +1 -1
  196. package/plugins/formulas/engine/settings.js +1 -1
  197. package/plugins/formulas/engine/settings.mjs +1 -1
  198. package/plugins/formulas/formulas.js +684 -602
  199. package/plugins/formulas/formulas.mjs +682 -600
  200. package/plugins/hiddenColumns/hiddenColumns.js +174 -169
  201. package/plugins/hiddenColumns/hiddenColumns.mjs +173 -168
  202. package/plugins/hiddenRows/hiddenRows.js +170 -165
  203. package/plugins/hiddenRows/hiddenRows.mjs +169 -164
  204. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
  205. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
  206. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
  207. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
  208. package/plugins/manualColumnFreeze/manualColumnFreeze.js +66 -53
  209. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +64 -51
  210. package/plugins/manualColumnMove/manualColumnMove.js +287 -232
  211. package/plugins/manualColumnMove/manualColumnMove.mjs +286 -231
  212. package/plugins/manualColumnMove/ui/_base.js +9 -3
  213. package/plugins/manualColumnMove/ui/_base.mjs +9 -3
  214. package/plugins/manualColumnResize/manualColumnResize.js +291 -246
  215. package/plugins/manualColumnResize/manualColumnResize.mjs +290 -244
  216. package/plugins/manualRowMove/manualRowMove.js +223 -208
  217. package/plugins/manualRowMove/manualRowMove.mjs +222 -207
  218. package/plugins/manualRowMove/ui/_base.js +10 -5
  219. package/plugins/manualRowMove/ui/_base.mjs +10 -5
  220. package/plugins/manualRowResize/manualRowResize.js +254 -209
  221. package/plugins/manualRowResize/manualRowResize.mjs +253 -207
  222. package/plugins/mergeCells/calculations/autofill.js +9 -3
  223. package/plugins/mergeCells/calculations/autofill.mjs +9 -3
  224. package/plugins/mergeCells/calculations/selection.js +10 -4
  225. package/plugins/mergeCells/calculations/selection.mjs +10 -4
  226. package/plugins/mergeCells/cellCoords.js +16 -6
  227. package/plugins/mergeCells/cellCoords.mjs +16 -6
  228. package/plugins/mergeCells/cellsCollection.js +10 -4
  229. package/plugins/mergeCells/cellsCollection.mjs +10 -4
  230. package/plugins/mergeCells/mergeCells.js +582 -502
  231. package/plugins/mergeCells/mergeCells.mjs +580 -500
  232. package/plugins/multiColumnSorting/multiColumnSorting.js +15 -11
  233. package/plugins/multiColumnSorting/multiColumnSorting.mjs +15 -11
  234. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +16 -28
  235. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +16 -27
  236. package/plugins/nestedHeaders/nestedHeaders.js +542 -499
  237. package/plugins/nestedHeaders/nestedHeaders.mjs +554 -511
  238. package/plugins/nestedHeaders/stateManager/index.js +1 -1
  239. package/plugins/nestedHeaders/stateManager/index.mjs +1 -1
  240. package/plugins/nestedRows/data/dataManager.js +21 -15
  241. package/plugins/nestedRows/data/dataManager.mjs +21 -15
  242. package/plugins/nestedRows/nestedRows.js +335 -279
  243. package/plugins/nestedRows/nestedRows.mjs +334 -278
  244. package/plugins/nestedRows/ui/_base.js +7 -1
  245. package/plugins/nestedRows/ui/_base.mjs +7 -1
  246. package/plugins/nestedRows/ui/collapsing.js +2 -2
  247. package/plugins/nestedRows/ui/collapsing.mjs +2 -2
  248. package/plugins/nestedRows/ui/contextMenu.js +28 -18
  249. package/plugins/nestedRows/ui/contextMenu.mjs +28 -18
  250. package/plugins/nestedRows/utils/rowMoveController.js +12 -4
  251. package/plugins/nestedRows/utils/rowMoveController.mjs +12 -4
  252. package/plugins/persistentState/persistentState.js +14 -11
  253. package/plugins/persistentState/persistentState.mjs +14 -11
  254. package/plugins/persistentState/storage.js +11 -6
  255. package/plugins/persistentState/storage.mjs +11 -6
  256. package/plugins/registry.js +2 -2
  257. package/plugins/registry.mjs +2 -2
  258. package/plugins/search/search.js +57 -46
  259. package/plugins/search/search.mjs +56 -45
  260. package/plugins/touchScroll/touchScroll.js +102 -100
  261. package/plugins/touchScroll/touchScroll.mjs +100 -98
  262. package/plugins/trimRows/trimRows.js +33 -28
  263. package/plugins/trimRows/trimRows.mjs +32 -27
  264. package/plugins/undoRedo/undoRedo.js +2 -2
  265. package/plugins/undoRedo/undoRedo.mjs +2 -2
  266. package/renderers/autocompleteRenderer/autocompleteRenderer.js +11 -11
  267. package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +11 -11
  268. package/renderers/baseRenderer/baseRenderer.js +2 -2
  269. package/renderers/baseRenderer/baseRenderer.mjs +2 -2
  270. package/renderers/checkboxRenderer/checkboxRenderer.js +23 -23
  271. package/renderers/checkboxRenderer/checkboxRenderer.mjs +23 -23
  272. package/renderers/dateRenderer/dateRenderer.js +4 -4
  273. package/renderers/dateRenderer/dateRenderer.mjs +4 -4
  274. package/renderers/handsontableRenderer/handsontableRenderer.js +4 -4
  275. package/renderers/handsontableRenderer/handsontableRenderer.mjs +4 -4
  276. package/renderers/htmlRenderer/htmlRenderer.js +4 -4
  277. package/renderers/htmlRenderer/htmlRenderer.mjs +4 -4
  278. package/renderers/numericRenderer/numericRenderer.js +3 -3
  279. package/renderers/numericRenderer/numericRenderer.mjs +3 -3
  280. package/renderers/passwordRenderer/passwordRenderer.js +3 -3
  281. package/renderers/passwordRenderer/passwordRenderer.mjs +3 -3
  282. package/renderers/selectRenderer/selectRenderer.js +4 -4
  283. package/renderers/selectRenderer/selectRenderer.mjs +4 -4
  284. package/renderers/textRenderer/textRenderer.js +5 -5
  285. package/renderers/textRenderer/textRenderer.mjs +5 -5
  286. package/renderers/timeRenderer/timeRenderer.js +3 -3
  287. package/renderers/timeRenderer/timeRenderer.mjs +3 -3
  288. package/selection/range.js +12 -2
  289. package/selection/range.mjs +12 -2
  290. package/selection/selection.js +28 -10
  291. package/selection/selection.mjs +28 -10
  292. package/selection/utils.js +24 -14
  293. package/selection/utils.mjs +25 -15
  294. package/shortcuts/manager.js +1 -1
  295. package/shortcuts/manager.mjs +1 -1
  296. package/tableView.js +208 -200
  297. package/tableView.mjs +208 -200
  298. package/translations/changesObservable/utils.js +2 -2
  299. package/translations/changesObservable/utils.mjs +2 -2
  300. package/translations/indexMapper.js +25 -22
  301. package/translations/indexMapper.mjs +25 -22
  302. package/translations/mapCollections/aggregatedCollection.js +8 -2
  303. package/translations/mapCollections/aggregatedCollection.mjs +8 -2
  304. package/translations/mapCollections/mapCollection.js +5 -2
  305. package/translations/mapCollections/mapCollection.mjs +5 -2
  306. package/translations/maps/indexMap.js +6 -1
  307. package/translations/maps/indexMap.mjs +6 -1
  308. package/translations/maps/utils/physicallyIndexed.js +2 -2
  309. package/translations/maps/utils/physicallyIndexed.mjs +2 -2
  310. package/utils/dataStructures/linkedList.js +10 -6
  311. package/utils/dataStructures/linkedList.mjs +10 -6
  312. package/utils/dataStructures/queue.js +1 -1
  313. package/utils/dataStructures/queue.mjs +1 -1
  314. package/utils/dataStructures/stack.js +1 -1
  315. package/utils/dataStructures/stack.mjs +1 -1
  316. package/utils/ghostTable.js +2 -2
  317. package/utils/ghostTable.mjs +2 -2
  318. package/utils/interval.js +73 -36
  319. package/utils/interval.mjs +73 -36
  320. package/utils/parseTable.js +1 -1
  321. package/utils/parseTable.mjs +1 -1
  322. package/validators/autocompleteValidator/autocompleteValidator.js +1 -1
  323. package/validators/autocompleteValidator/autocompleteValidator.mjs +1 -1
  324. package/validators/dateValidator/dateValidator.js +1 -1
  325. package/validators/dateValidator/dateValidator.mjs +1 -1
  326. package/validators/numericValidator/numericValidator.js +1 -1
  327. package/validators/numericValidator/numericValidator.mjs +1 -1
@@ -1,5 +1,8 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
2
  import "core-js/modules/es.array.push.js";
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3
6
  import { stringify } from "../3rdparty/SheetClip/index.mjs";
4
7
  import { countFirstRowKeys } from "../helpers/data.mjs";
5
8
  import { createObjectPropListener, deepClone, deepExtend, deepObjectSize, duckSchema, hasOwnProperty, isObject, objectEach } from "../helpers/object.mjs";
@@ -52,56 +55,62 @@ class DataMap {
52
55
  }
53
56
 
54
57
  /**
55
- * @param {object} instance Instance of Handsontable.
58
+ * Instance of {@link Handsontable}.
59
+ *
60
+ * @private
61
+ * @type {Handsontable}
62
+ */
63
+
64
+ /**
65
+ * @param {object} hotInstance Instance of Handsontable.
56
66
  * @param {Array} data Array of arrays or array of objects containing data.
57
67
  * @param {MetaManager} metaManager The meta manager instance.
58
68
  */
59
- constructor(instance, data, metaManager) {
60
- /**
61
- * Instance of {@link Handsontable}.
62
- *
63
- * @private
64
- * @type {Handsontable}
65
- */
66
- this.instance = instance;
69
+ constructor(hotInstance, data, metaManager) {
70
+ _defineProperty(this, "hot", void 0);
67
71
  /**
68
72
  * Instance of {@link MetaManager}.
69
73
  *
70
74
  * @private
71
75
  * @type {MetaManager}
72
76
  */
73
- this.metaManager = metaManager;
77
+ _defineProperty(this, "metaManager", void 0);
74
78
  /**
75
79
  * Instance of {@link TableMeta}.
76
80
  *
77
81
  * @private
78
82
  * @type {TableMeta}
79
83
  */
80
- this.tableMeta = metaManager.getTableMeta();
84
+ _defineProperty(this, "tableMeta", void 0);
81
85
  /**
82
86
  * Reference to the original dataset.
83
87
  *
84
88
  * @type {*}
85
89
  */
86
- this.dataSource = data;
90
+ _defineProperty(this, "dataSource", void 0);
87
91
  /**
88
92
  * Generated schema based on the first row from the source data.
89
93
  *
90
94
  * @type {object}
91
95
  */
92
- this.duckSchema = this.createDuckSchema();
96
+ _defineProperty(this, "duckSchema", void 0);
93
97
  /**
94
98
  * Cached array of properties to columns.
95
99
  *
96
100
  * @type {Array}
97
101
  */
98
- this.colToPropCache = void 0;
102
+ _defineProperty(this, "colToPropCache", void 0);
99
103
  /**
100
104
  * Cached map of properties to columns.
101
105
  *
102
106
  * @type {Map}
103
107
  */
104
- this.propToColCache = void 0;
108
+ _defineProperty(this, "propToColCache", void 0);
109
+ this.hot = hotInstance;
110
+ this.metaManager = metaManager;
111
+ this.tableMeta = metaManager.getTableMeta();
112
+ this.dataSource = data;
113
+ this.duckSchema = this.createDuckSchema();
105
114
  this.createMap();
106
115
  }
107
116
 
@@ -197,7 +206,7 @@ class DataMap {
197
206
  if (Number.isInteger(column) === false) {
198
207
  return column;
199
208
  }
200
- const physicalColumn = this.instance.toPhysicalColumn(column);
209
+ const physicalColumn = this.hot.toPhysicalColumn(column);
201
210
 
202
211
  // Out of range, not visible column index.
203
212
  if (physicalColumn === null) {
@@ -220,11 +229,11 @@ class DataMap {
220
229
  propToCol(prop) {
221
230
  const cachedPhysicalIndex = this.propToColCache.get(prop);
222
231
  if (isDefined(cachedPhysicalIndex)) {
223
- return this.instance.toVisualColumn(cachedPhysicalIndex);
232
+ return this.hot.toVisualColumn(cachedPhysicalIndex);
224
233
  }
225
234
 
226
235
  // Property may be a physical column index.
227
- const visualColumn = this.instance.toVisualColumn(prop);
236
+ const visualColumn = this.hot.toVisualColumn(prop);
228
237
  if (visualColumn === null) {
229
238
  return prop;
230
239
  }
@@ -280,17 +289,17 @@ class DataMap {
280
289
  source,
281
290
  mode = 'above'
282
291
  } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
283
- const sourceRowsCount = this.instance.countSourceRows();
292
+ const sourceRowsCount = this.hot.countSourceRows();
284
293
  let physicalRowIndex = sourceRowsCount;
285
294
  let numberOfCreatedRows = 0;
286
295
  let rowIndex = index;
287
296
  if (typeof rowIndex !== 'number' || rowIndex >= sourceRowsCount) {
288
297
  rowIndex = sourceRowsCount;
289
298
  }
290
- if (rowIndex < this.instance.countRows()) {
291
- physicalRowIndex = this.instance.toPhysicalRow(rowIndex);
299
+ if (rowIndex < this.hot.countRows()) {
300
+ physicalRowIndex = this.hot.toPhysicalRow(rowIndex);
292
301
  }
293
- const continueProcess = this.instance.runHooks('beforeCreateRow', rowIndex, amount, source);
302
+ const continueProcess = this.hot.runHooks('beforeCreateRow', rowIndex, amount, source);
294
303
  if (continueProcess === false || physicalRowIndex === null) {
295
304
  return {
296
305
  delta: 0
@@ -301,7 +310,7 @@ class DataMap {
301
310
  const rowsToAdd = [];
302
311
  while (numberOfCreatedRows < amount && sourceRowsCount + numberOfCreatedRows < maxRows) {
303
312
  let row = null;
304
- if (this.instance.dataType === 'array') {
313
+ if (this.hot.dataType === 'array') {
305
314
  if (this.tableMeta.dataSchema) {
306
315
  // Clone template array
307
316
  row = deepClone(this.getSchema());
@@ -310,7 +319,7 @@ class DataMap {
310
319
  /* eslint-disable no-loop-func */
311
320
  rangeEach(columnCount - 1, () => row.push(null));
312
321
  }
313
- } else if (this.instance.dataType === 'function') {
322
+ } else if (this.hot.dataType === 'function') {
314
323
  row = this.tableMeta.dataSchema(rowIndex + numberOfCreatedRows);
315
324
  } else {
316
325
  row = {};
@@ -319,20 +328,20 @@ class DataMap {
319
328
  rowsToAdd.push(row);
320
329
  numberOfCreatedRows += 1;
321
330
  }
322
- this.instance.rowIndexMapper.insertIndexes(rowIndex, numberOfCreatedRows);
331
+ this.hot.rowIndexMapper.insertIndexes(rowIndex, numberOfCreatedRows);
323
332
  if (mode === 'below') {
324
333
  physicalRowIndex = Math.min(physicalRowIndex + 1, sourceRowsCount);
325
334
  }
326
335
  this.spliceData(physicalRowIndex, 0, rowsToAdd);
327
- const newVisualRowIndex = this.instance.toVisualRow(physicalRowIndex);
336
+ const newVisualRowIndex = this.hot.toVisualRow(physicalRowIndex);
328
337
 
329
338
  // In case the created rows are the only ones in the table, the column index mappers need to be rebuilt based on
330
339
  // the number of columns created in the row or the schema.
331
- if (this.instance.countSourceRows() === rowsToAdd.length) {
332
- this.instance.columnIndexMapper.initToLength(this.instance.getInitialColumnCount());
340
+ if (this.hot.countSourceRows() === rowsToAdd.length) {
341
+ this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount());
333
342
  }
334
343
  if (numberOfCreatedRows > 0) {
335
- if (index === void 0 || index === null) {
344
+ if (index === undefined || index === null) {
336
345
  // Creates the meta rows at the end of the rows collection without shifting the cells
337
346
  // that were defined out of the range of the dataset.
338
347
  this.metaManager.createRow(null, numberOfCreatedRows);
@@ -340,8 +349,8 @@ class DataMap {
340
349
  this.metaManager.createRow(physicalRowIndex, amount);
341
350
  }
342
351
  }
343
- this.instance.runHooks('afterCreateRow', newVisualRowIndex, numberOfCreatedRows, source);
344
- this.instance.forceFullRender = true; // used when data was changed
352
+ this.hot.runHooks('afterCreateRow', newVisualRowIndex, numberOfCreatedRows, source);
353
+ this.hot.forceFullRender = true; // used when data was changed
345
354
 
346
355
  return {
347
356
  delta: numberOfCreatedRows,
@@ -367,28 +376,28 @@ class DataMap {
367
376
  source,
368
377
  mode = 'start'
369
378
  } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
370
- if (!this.instance.isColumnModificationAllowed()) {
379
+ if (!this.hot.isColumnModificationAllowed()) {
371
380
  throw new Error('Cannot create new column. When data source in an object, ' + 'you can only have as much columns as defined in first data row, data schema or in the \'columns\' setting.' + 'If you want to be able to add new columns, you have to use array datasource.');
372
381
  }
373
382
  const dataSource = this.dataSource;
374
383
  const maxCols = this.tableMeta.maxCols;
375
- const countSourceCols = this.instance.countSourceCols();
384
+ const countSourceCols = this.hot.countSourceCols();
376
385
  let columnIndex = index;
377
386
  if (typeof columnIndex !== 'number' || columnIndex >= countSourceCols) {
378
387
  columnIndex = countSourceCols;
379
388
  }
380
- const continueProcess = this.instance.runHooks('beforeCreateCol', columnIndex, amount, source);
389
+ const continueProcess = this.hot.runHooks('beforeCreateCol', columnIndex, amount, source);
381
390
  if (continueProcess === false) {
382
391
  return {
383
392
  delta: 0
384
393
  };
385
394
  }
386
395
  let physicalColumnIndex = countSourceCols;
387
- if (columnIndex < this.instance.countCols()) {
388
- physicalColumnIndex = this.instance.toPhysicalColumn(columnIndex);
396
+ if (columnIndex < this.hot.countCols()) {
397
+ physicalColumnIndex = this.hot.toPhysicalColumn(columnIndex);
389
398
  }
390
- const numberOfSourceRows = this.instance.countSourceRows();
391
- let nrOfColumns = this.instance.countCols();
399
+ const numberOfSourceRows = this.hot.countSourceRows();
400
+ let nrOfColumns = this.hot.countCols();
392
401
  let numberOfCreatedCols = 0;
393
402
  let currentIndex = physicalColumnIndex;
394
403
  if (mode === 'end') {
@@ -416,9 +425,9 @@ class DataMap {
416
425
  currentIndex += 1;
417
426
  nrOfColumns += 1;
418
427
  }
419
- this.instance.columnIndexMapper.insertIndexes(columnIndex, numberOfCreatedCols);
428
+ this.hot.columnIndexMapper.insertIndexes(columnIndex, numberOfCreatedCols);
420
429
  if (numberOfCreatedCols > 0) {
421
- if (index === void 0 || index === null) {
430
+ if (index === undefined || index === null) {
422
431
  // Creates the meta columns at the end of the columns collection without shifting the cells
423
432
  // that were defined out of the range of the dataset.
424
433
  this.metaManager.createColumn(null, numberOfCreatedCols);
@@ -426,9 +435,9 @@ class DataMap {
426
435
  this.metaManager.createColumn(startPhysicalIndex, amount);
427
436
  }
428
437
  }
429
- const newVisualColumnIndex = this.instance.toVisualColumn(startPhysicalIndex);
430
- this.instance.runHooks('afterCreateCol', newVisualColumnIndex, numberOfCreatedCols, source);
431
- this.instance.forceFullRender = true; // used when data was changed
438
+ const newVisualColumnIndex = this.hot.toVisualColumn(startPhysicalIndex);
439
+ this.hot.runHooks('afterCreateCol', newVisualColumnIndex, numberOfCreatedCols, source);
440
+ this.hot.forceFullRender = true; // used when data was changed
432
441
 
433
442
  this.refreshDuckSchema();
434
443
  return {
@@ -452,11 +461,11 @@ class DataMap {
452
461
  let source = arguments.length > 2 ? arguments[2] : undefined;
453
462
  let rowIndex = Number.isInteger(index) ? index : -amount; // -amount = taking indexes from the end.
454
463
  const removedPhysicalIndexes = this.visualRowsToPhysical(rowIndex, amount);
455
- const sourceRowsLength = this.instance.countSourceRows();
464
+ const sourceRowsLength = this.hot.countSourceRows();
456
465
  rowIndex = (sourceRowsLength + rowIndex) % sourceRowsLength;
457
466
 
458
467
  // It handle also callback from the `NestedRows` plugin. Removing parent node has effect in removing children nodes.
459
- const actionWasNotCancelled = this.instance.runHooks('beforeRemoveRow', rowIndex, removedPhysicalIndexes.length, removedPhysicalIndexes, source);
468
+ const actionWasNotCancelled = this.hot.runHooks('beforeRemoveRow', rowIndex, removedPhysicalIndexes.length, removedPhysicalIndexes, source);
460
469
  if (actionWasNotCancelled === false) {
461
470
  return false;
462
471
  }
@@ -466,21 +475,21 @@ class DataMap {
466
475
  this.filterData(rowIndex, numberOfRemovedIndexes, removedPhysicalIndexes);
467
476
 
468
477
  // TODO: Function `removeRow` should validate fully, probably above.
469
- if (rowIndex < this.instance.countRows()) {
470
- this.instance.rowIndexMapper.removeIndexes(removedPhysicalIndexes);
478
+ if (rowIndex < this.hot.countRows()) {
479
+ this.hot.rowIndexMapper.removeIndexes(removedPhysicalIndexes);
471
480
  const customDefinedColumns = isDefined(this.tableMeta.columns) || isDefined(this.tableMeta.dataSchema);
472
481
 
473
482
  // All rows have been removed. There shouldn't be any columns.
474
- if (this.instance.rowIndexMapper.getNotTrimmedIndexesLength() === 0 && customDefinedColumns === false) {
475
- this.instance.columnIndexMapper.setIndexesSequence([]);
483
+ if (this.hot.rowIndexMapper.getNotTrimmedIndexesLength() === 0 && customDefinedColumns === false) {
484
+ this.hot.columnIndexMapper.setIndexesSequence([]);
476
485
  }
477
486
  }
478
487
  const descendingPhysicalRows = removedPhysicalIndexes.slice(0).sort((a, b) => b - a);
479
488
  descendingPhysicalRows.forEach(rowPhysicalIndex => {
480
489
  this.metaManager.removeRow(rowPhysicalIndex, 1);
481
490
  });
482
- this.instance.runHooks('afterRemoveRow', rowIndex, numberOfRemovedIndexes, removedPhysicalIndexes, source);
483
- this.instance.forceFullRender = true; // used when data was changed
491
+ this.hot.runHooks('afterRemoveRow', rowIndex, numberOfRemovedIndexes, removedPhysicalIndexes, source);
492
+ this.hot.forceFullRender = true; // used when data was changed
484
493
 
485
494
  return true;
486
495
  }
@@ -498,14 +507,14 @@ class DataMap {
498
507
  removeCol(index) {
499
508
  let amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
500
509
  let source = arguments.length > 2 ? arguments[2] : undefined;
501
- if (this.instance.dataType === 'object' || this.tableMeta.columns) {
510
+ if (this.hot.dataType === 'object' || this.tableMeta.columns) {
502
511
  throw new Error('cannot remove column with object data source or columns option specified');
503
512
  }
504
513
  let columnIndex = typeof index !== 'number' ? -amount : index;
505
- columnIndex = (this.instance.countCols() + columnIndex) % this.instance.countCols();
514
+ columnIndex = (this.hot.countCols() + columnIndex) % this.hot.countCols();
506
515
  const removedPhysicalIndexes = this.visualColumnsToPhysical(columnIndex, amount);
507
516
  const descendingPhysicalColumns = removedPhysicalIndexes.slice(0).sort((a, b) => b - a);
508
- const actionWasNotCancelled = this.instance.runHooks('beforeRemoveCol', columnIndex, amount, removedPhysicalIndexes, source);
517
+ const actionWasNotCancelled = this.hot.runHooks('beforeRemoveCol', columnIndex, amount, removedPhysicalIndexes, source);
509
518
  if (actionWasNotCancelled === false) {
510
519
  return false;
511
520
  }
@@ -518,14 +527,14 @@ class DataMap {
518
527
  }
519
528
  }
520
529
  if (isTableUniform) {
521
- for (let r = 0, rlen = this.instance.countSourceRows(); r < rlen; r++) {
530
+ for (let r = 0, rlen = this.hot.countSourceRows(); r < rlen; r++) {
522
531
  data[r].splice(removedPhysicalIndexes[0], amount);
523
532
  if (r === 0) {
524
533
  this.metaManager.removeColumn(removedPhysicalIndexes[0], amount);
525
534
  }
526
535
  }
527
536
  } else {
528
- for (let r = 0, rlen = this.instance.countSourceRows(); r < rlen; r++) {
537
+ for (let r = 0, rlen = this.hot.countSourceRows(); r < rlen; r++) {
529
538
  for (let c = 0; c < removedColumnsCount; c++) {
530
539
  data[r].splice(descendingPhysicalColumns[c], 1);
531
540
  if (r === 0) {
@@ -536,16 +545,16 @@ class DataMap {
536
545
  }
537
546
 
538
547
  // TODO: Function `removeCol` should validate fully, probably above.
539
- if (columnIndex < this.instance.countCols()) {
540
- this.instance.columnIndexMapper.removeIndexes(removedPhysicalIndexes);
548
+ if (columnIndex < this.hot.countCols()) {
549
+ this.hot.columnIndexMapper.removeIndexes(removedPhysicalIndexes);
541
550
 
542
551
  // All columns have been removed. There shouldn't be any rows.
543
- if (this.instance.columnIndexMapper.getNotTrimmedIndexesLength() === 0) {
544
- this.instance.rowIndexMapper.setIndexesSequence([]);
552
+ if (this.hot.columnIndexMapper.getNotTrimmedIndexesLength() === 0) {
553
+ this.hot.rowIndexMapper.setIndexesSequence([]);
545
554
  }
546
555
  }
547
- this.instance.runHooks('afterRemoveCol', columnIndex, amount, removedPhysicalIndexes, source);
548
- this.instance.forceFullRender = true; // used when data was changed
556
+ this.hot.runHooks('afterRemoveCol', columnIndex, amount, removedPhysicalIndexes, source);
557
+ this.hot.forceFullRender = true; // used when data was changed
549
558
  this.refreshDuckSchema();
550
559
  return true;
551
560
  }
@@ -560,7 +569,7 @@ class DataMap {
560
569
  * @returns {Array} Returns removed portion of columns.
561
570
  */
562
571
  spliceCol(col, index, amount) {
563
- const colData = this.instance.getDataAtCol(col);
572
+ const colData = this.hot.getDataAtCol(col);
564
573
  const removed = colData.slice(index, index + amount);
565
574
  const after = colData.slice(index + amount);
566
575
  for (var _len = arguments.length, elements = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
@@ -573,7 +582,7 @@ class DataMap {
573
582
  i += 1;
574
583
  }
575
584
  to2dArray(elements);
576
- this.instance.populateFromArray(index, col, elements, null, null, 'spliceCol');
585
+ this.hot.populateFromArray(index, col, elements, null, null, 'spliceCol');
577
586
  return removed;
578
587
  }
579
588
 
@@ -587,7 +596,7 @@ class DataMap {
587
596
  * @returns {Array} Returns removed portion of rows.
588
597
  */
589
598
  spliceRow(row, index, amount) {
590
- const rowData = this.instance.getSourceDataAtRow(row);
599
+ const rowData = this.hot.getSourceDataAtRow(row);
591
600
  const removed = rowData.slice(index, index + amount);
592
601
  const after = rowData.slice(index + amount);
593
602
  for (var _len2 = arguments.length, elements = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
@@ -599,7 +608,7 @@ class DataMap {
599
608
  elements.push(null); // add null in place of removed elements
600
609
  i += 1;
601
610
  }
602
- this.instance.populateFromArray(row, index, [elements], null, null, 'spliceRow');
611
+ this.hot.populateFromArray(row, index, [elements], null, null, 'spliceRow');
603
612
  return removed;
604
613
  }
605
614
 
@@ -611,7 +620,7 @@ class DataMap {
611
620
  * @param {Array<object>} elements Row elements to be added.
612
621
  */
613
622
  spliceData(index, deleteCount, elements) {
614
- const continueSplicing = this.instance.runHooks('beforeDataSplice', index, deleteCount, elements);
623
+ const continueSplicing = this.hot.runHooks('beforeDataSplice', index, deleteCount, elements);
615
624
  if (continueSplicing !== false) {
616
625
  const newData = [...this.dataSource.slice(0, index), ...elements, ...this.dataSource.slice(index)];
617
626
 
@@ -633,7 +642,7 @@ class DataMap {
633
642
  */
634
643
  filterData(index, amount, physicalRows) {
635
644
  // Custom data filtering (run as a consequence of calling the below hook) provide an array containing new data.
636
- let data = this.instance.runHooks('filterData', index, amount, physicalRows);
645
+ let data = this.hot.runHooks('filterData', index, amount, physicalRows);
637
646
 
638
647
  // Hooks by default returns first argument (when there is no callback changing execution result).
639
648
  if (Array.isArray(data) === false) {
@@ -651,10 +660,10 @@ class DataMap {
651
660
  * @returns {*}
652
661
  */
653
662
  get(row, prop) {
654
- const physicalRow = this.instance.toPhysicalRow(row);
663
+ const physicalRow = this.hot.toPhysicalRow(row);
655
664
  let dataRow = this.dataSource[physicalRow];
656
665
  // TODO: To remove, use 'modifyData' hook instead (see below)
657
- const modifiedRowData = this.instance.runHooks('modifyRowData', physicalRow);
666
+ const modifiedRowData = this.hot.runHooks('modifyRowData', physicalRow);
658
667
  dataRow = isNaN(modifiedRowData) ? modifiedRowData : dataRow;
659
668
  //
660
669
 
@@ -679,9 +688,9 @@ class DataMap {
679
688
  } else if (typeof prop === 'function') {
680
689
  value = prop(this.dataSource.slice(physicalRow, physicalRow + 1)[0]);
681
690
  }
682
- if (this.instance.hasHook('modifyData')) {
691
+ if (this.hot.hasHook('modifyData')) {
683
692
  const valueHolder = createObjectPropListener(value);
684
- this.instance.runHooks('modifyData', physicalRow, this.propToCol(prop), valueHolder, 'get');
693
+ this.hot.runHooks('modifyData', physicalRow, this.propToCol(prop), valueHolder, 'get');
685
694
  if (valueHolder.isTouched()) {
686
695
  value = valueHolder.value;
687
696
  }
@@ -697,7 +706,7 @@ class DataMap {
697
706
  * @returns {string}
698
707
  */
699
708
  getCopyable(row, prop) {
700
- if (this.instance.getCellMeta(row, this.propToCol(prop)).copyable) {
709
+ if (this.hot.getCellMeta(row, this.propToCol(prop)).copyable) {
701
710
  return this.get(row, prop);
702
711
  }
703
712
  return '';
@@ -711,17 +720,17 @@ class DataMap {
711
720
  * @param {string} value The value to set.
712
721
  */
713
722
  set(row, prop, value) {
714
- const physicalRow = this.instance.toPhysicalRow(row);
723
+ const physicalRow = this.hot.toPhysicalRow(row);
715
724
  let newValue = value;
716
725
  let dataRow = this.dataSource[physicalRow];
717
726
  // TODO: To remove, use 'modifyData' hook instead (see below)
718
- const modifiedRowData = this.instance.runHooks('modifyRowData', physicalRow);
727
+ const modifiedRowData = this.hot.runHooks('modifyRowData', physicalRow);
719
728
  dataRow = isNaN(modifiedRowData) ? modifiedRowData : dataRow;
720
729
  //
721
730
 
722
- if (this.instance.hasHook('modifyData')) {
731
+ if (this.hot.hasHook('modifyData')) {
723
732
  const valueHolder = createObjectPropListener(newValue);
724
- this.instance.runHooks('modifyData', physicalRow, this.propToCol(prop), valueHolder, 'set');
733
+ this.hot.runHooks('modifyData', physicalRow, this.propToCol(prop), valueHolder, 'set');
725
734
  if (valueHolder.isTouched()) {
726
735
  newValue = valueHolder.value;
727
736
  }
@@ -759,13 +768,13 @@ class DataMap {
759
768
  * @returns {number}
760
769
  */
761
770
  visualRowsToPhysical(index, amount) {
762
- const totalRows = this.instance.countSourceRows();
771
+ const totalRows = this.hot.countSourceRows();
763
772
  const logicRows = [];
764
773
  let physicRow = (totalRows + index) % totalRows;
765
774
  let rowsToRemove = amount;
766
775
  let row;
767
776
  while (physicRow < totalRows && rowsToRemove) {
768
- row = this.instance.toPhysicalRow(physicRow);
777
+ row = this.hot.toPhysicalRow(physicRow);
769
778
  logicRows.push(row);
770
779
  rowsToRemove -= 1;
771
780
  physicRow += 1;
@@ -780,12 +789,12 @@ class DataMap {
780
789
  * @returns {Array}
781
790
  */
782
791
  visualColumnsToPhysical(index, amount) {
783
- const totalCols = this.instance.countCols();
792
+ const totalCols = this.hot.countCols();
784
793
  const visualCols = [];
785
794
  let physicalCol = (totalCols + index) % totalCols;
786
795
  let colsToRemove = amount;
787
796
  while (physicalCol < totalCols && colsToRemove) {
788
- const col = this.instance.toPhysicalColumn(physicalCol);
797
+ const col = this.hot.toPhysicalColumn(physicalCol);
789
798
  visualCols.push(col);
790
799
  colsToRemove -= 1;
791
800
  physicalCol += 1;
@@ -797,8 +806,8 @@ class DataMap {
797
806
  * Clears the data array.
798
807
  */
799
808
  clear() {
800
- for (let r = 0; r < this.instance.countSourceRows(); r++) {
801
- for (let c = 0; c < this.instance.countCols(); c++) {
809
+ for (let r = 0; r < this.hot.countSourceRows(); r++) {
810
+ for (let c = 0; c < this.hot.countCols(); c++) {
802
811
  this.set(r, this.colToProp(c), '');
803
812
  }
804
813
  }
@@ -817,7 +826,7 @@ class DataMap {
817
826
  } else {
818
827
  maxRows = maxRowsFromSettings || Infinity;
819
828
  }
820
- const length = this.instance.rowIndexMapper.getNotTrimmedIndexesLength();
829
+ const length = this.hot.rowIndexMapper.getNotTrimmedIndexesLength();
821
830
  return Math.min(length, maxRows);
822
831
  }
823
832
 
@@ -832,10 +841,10 @@ class DataMap {
832
841
  col: 0
833
842
  };
834
843
  const end = {
835
- row: Math.max(this.instance.countRows() - 1, 0),
836
- col: Math.max(this.instance.countCols() - 1, 0)
844
+ row: Math.max(this.hot.countRows() - 1, 0),
845
+ col: Math.max(this.hot.countCols() - 1, 0)
837
846
  };
838
- if (start.row - end.row === 0 && !this.instance.countSourceRows()) {
847
+ if (start.row - end.row === 0 && !this.hot.countSourceRows()) {
839
848
  return [];
840
849
  }
841
850
  return this.getRange(start, end, DataMap.DESTINATION_RENDERER);
@@ -874,7 +883,7 @@ class DataMap {
874
883
  for (r = Math.min(start.row, end.row); r <= rlen; r++) {
875
884
  row = [];
876
885
  // We just store indexes for rows without headers.
877
- const physicalRow = r >= 0 ? this.instance.toPhysicalRow(r) : r;
886
+ const physicalRow = r >= 0 ? this.hot.toPhysicalRow(r) : r;
878
887
  for (c = Math.min(start.col, end.col); c <= clen; c++) {
879
888
  if (physicalRow === null) {
880
889
  break;
@@ -914,13 +923,13 @@ class DataMap {
914
923
  * Destroy instance.
915
924
  */
916
925
  destroy() {
917
- this.instance = null;
926
+ this.hot = null;
918
927
  this.metaManager = null;
919
928
  this.dataSource = null;
920
929
  this.duckSchema = null;
921
930
  this.colToPropCache.length = 0;
922
931
  this.propToColCache.clear();
923
- this.propToColCache = void 0;
932
+ this.propToColCache = undefined;
924
933
  }
925
934
  }
926
935
  export default DataMap;
@@ -2,11 +2,15 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.array.push.js");
5
+ require("core-js/modules/es.error.cause.js");
5
6
  var _object = require("../helpers/object");
6
7
  var _data = require("../helpers/data");
7
8
  var _array = require("../helpers/array");
8
9
  var _number = require("../helpers/number");
9
10
  var _function = require("../helpers/function");
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); }
10
14
  /**
11
15
  * @class DataSource
12
16
  * @private
@@ -19,22 +23,24 @@ class DataSource {
19
23
  *
20
24
  * @type {Handsontable}
21
25
  */
22
- this.hot = hotInstance;
26
+ _defineProperty(this, "hot", void 0);
23
27
  /**
24
28
  * Data source.
25
29
  *
26
30
  * @type {Array}
27
31
  */
28
- this.data = dataSource;
32
+ _defineProperty(this, "data", void 0);
29
33
  /**
30
34
  * Type of data source.
31
35
  *
32
36
  * @type {string}
33
37
  * @default 'array'
34
38
  */
35
- this.dataType = 'array';
36
- this.colToProp = () => {};
37
- this.propToCol = () => {};
39
+ _defineProperty(this, "dataType", 'array');
40
+ _defineProperty(this, "colToProp", () => {});
41
+ _defineProperty(this, "propToCol", () => {});
42
+ this.hot = hotInstance;
43
+ this.data = dataSource;
38
44
  }
39
45
 
40
46
  /**
@@ -49,7 +55,7 @@ class DataSource {
49
55
  if (this.hot.hasHook('modifyRowData')) {
50
56
  modifyRowData = this.hot.runHooks('modifyRowData', rowIndex);
51
57
  }
52
- return modifyRowData !== void 0 && !Number.isInteger(modifyRowData) ? modifyRowData : this.data[rowIndex];
58
+ return modifyRowData !== undefined && !Number.isInteger(modifyRowData) ? modifyRowData : this.data[rowIndex];
53
59
  }
54
60
 
55
61
  /**
@@ -103,7 +109,7 @@ class DataSource {
103
109
  */
104
110
  getAtRow(row, startColumn, endColumn) {
105
111
  let toArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
106
- const getAllProps = startColumn === void 0 && endColumn === void 0;
112
+ const getAllProps = startColumn === undefined && endColumn === undefined;
107
113
  let dataRow = null;
108
114
  let newDataRow = null;
109
115
  dataRow = this.modifyRowData(row);
@@ -247,7 +253,7 @@ class DataSource {
247
253
  }
248
254
  const result = [];
249
255
  (0, _number.rangeEach)(startRow, endRow, currentRow => {
250
- result.push(getAllProps ? this.getAtRow(currentRow, void 0, void 0, toArray) : this.getAtRow(currentRow, startCol, endCol, toArray));
256
+ result.push(getAllProps ? this.getAtRow(currentRow, undefined, undefined, toArray) : this.getAtRow(currentRow, startCol, endCol, toArray));
251
257
  });
252
258
  return result;
253
259
  }