handsontable 0.0.0-next-2becb78-20240313 → 0.0.0-next-bff5041-20240315

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

Files changed (272) hide show
  1. package/3rdparty/walkontable/src/calculator/viewportColumns.js +12 -17
  2. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +12 -17
  3. package/3rdparty/walkontable/src/calculator/viewportRows.js +10 -15
  4. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +10 -15
  5. package/3rdparty/walkontable/src/cell/coords.js +12 -17
  6. package/3rdparty/walkontable/src/cell/coords.mjs +12 -17
  7. package/3rdparty/walkontable/src/cell/range.d.ts +0 -1
  8. package/3rdparty/walkontable/src/cell/range.js +23 -45
  9. package/3rdparty/walkontable/src/cell/range.mjs +23 -45
  10. package/3rdparty/walkontable/src/core/_base.js +1 -1
  11. package/3rdparty/walkontable/src/core/_base.mjs +1 -1
  12. package/3rdparty/walkontable/src/event.js +72 -104
  13. package/3rdparty/walkontable/src/event.mjs +72 -104
  14. package/3rdparty/walkontable/src/overlays.js +1 -1
  15. package/3rdparty/walkontable/src/overlays.mjs +1 -1
  16. package/3rdparty/walkontable/src/scroll.js +15 -17
  17. package/3rdparty/walkontable/src/scroll.mjs +15 -17
  18. package/3rdparty/walkontable/src/selection/manager.js +48 -69
  19. package/3rdparty/walkontable/src/selection/manager.mjs +48 -69
  20. package/3rdparty/walkontable/src/selection/scanner.js +33 -42
  21. package/3rdparty/walkontable/src/selection/scanner.mjs +33 -42
  22. package/3rdparty/walkontable/src/utils/columnStretching.js +27 -44
  23. package/3rdparty/walkontable/src/utils/columnStretching.mjs +27 -44
  24. package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
  25. package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
  26. package/base.js +2 -2
  27. package/base.mjs +2 -2
  28. package/core/viewportScroll/index.js +1 -4
  29. package/core/viewportScroll/index.mjs +1 -4
  30. package/core.d.ts +3 -4
  31. package/core.js +22 -82
  32. package/core.mjs +22 -82
  33. package/dataMap/dataSource.js +1 -1
  34. package/dataMap/dataSource.mjs +1 -1
  35. package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
  36. package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
  37. package/dataMap/replaceData.js +1 -1
  38. package/dataMap/replaceData.mjs +1 -1
  39. package/dist/handsontable.css +2 -2
  40. package/dist/handsontable.full.css +2 -2
  41. package/dist/handsontable.full.js +7619 -10404
  42. package/dist/handsontable.full.min.css +2 -2
  43. package/dist/handsontable.full.min.js +277 -277
  44. package/dist/handsontable.js +5525 -7857
  45. package/dist/handsontable.min.css +2 -2
  46. package/dist/handsontable.min.js +33 -33
  47. package/dist/languages/all.min.js +1 -1
  48. package/dist/languages/ar-AR.min.js +1 -1
  49. package/dist/languages/cs-CZ.min.js +1 -1
  50. package/dist/languages/de-CH.min.js +1 -1
  51. package/dist/languages/de-DE.min.js +1 -1
  52. package/dist/languages/en-US.min.js +1 -1
  53. package/dist/languages/es-MX.min.js +1 -1
  54. package/dist/languages/fr-FR.min.js +1 -1
  55. package/dist/languages/hr-HR.min.js +1 -1
  56. package/dist/languages/it-IT.min.js +1 -1
  57. package/dist/languages/ja-JP.min.js +1 -1
  58. package/dist/languages/ko-KR.min.js +1 -1
  59. package/dist/languages/lv-LV.min.js +1 -1
  60. package/dist/languages/nb-NO.min.js +1 -1
  61. package/dist/languages/nl-NL.min.js +1 -1
  62. package/dist/languages/pl-PL.min.js +1 -1
  63. package/dist/languages/pt-BR.min.js +1 -1
  64. package/dist/languages/ru-RU.min.js +1 -1
  65. package/dist/languages/sr-SP.min.js +1 -1
  66. package/dist/languages/zh-CN.min.js +1 -1
  67. package/dist/languages/zh-TW.min.js +1 -1
  68. package/editorManager.js +21 -27
  69. package/editorManager.mjs +21 -27
  70. package/editors/autocompleteEditor/autocompleteEditor.js +6 -10
  71. package/editors/autocompleteEditor/autocompleteEditor.mjs +6 -10
  72. package/eventManager.js +1 -1
  73. package/eventManager.mjs +1 -1
  74. package/focusManager.js +58 -82
  75. package/focusManager.mjs +58 -82
  76. package/helpers/dom/element.js +1 -1
  77. package/helpers/dom/element.mjs +1 -1
  78. package/helpers/mixed.js +1 -1
  79. package/helpers/mixed.mjs +1 -1
  80. package/helpers/object.js +2 -2
  81. package/helpers/object.mjs +2 -2
  82. package/index.d.ts +10 -0
  83. package/package.json +2 -1
  84. package/pluginHooks.d.ts +0 -4
  85. package/pluginHooks.js +2 -44
  86. package/pluginHooks.mjs +2 -44
  87. package/plugins/autoColumnSize/autoColumnSize.js +49 -65
  88. package/plugins/autoColumnSize/autoColumnSize.mjs +49 -65
  89. package/plugins/autoRowSize/autoRowSize.js +28 -34
  90. package/plugins/autoRowSize/autoRowSize.mjs +28 -34
  91. package/plugins/autofill/autofill.js +30 -38
  92. package/plugins/autofill/autofill.mjs +30 -38
  93. package/plugins/base/base.js +12 -17
  94. package/plugins/base/base.mjs +12 -17
  95. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
  96. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
  97. package/plugins/collapsibleColumns/collapsibleColumns.js +36 -54
  98. package/plugins/collapsibleColumns/collapsibleColumns.mjs +36 -54
  99. package/plugins/columnSorting/columnSorting.js +40 -46
  100. package/plugins/columnSorting/columnSorting.mjs +40 -46
  101. package/plugins/columnSummary/columnSummary.js +22 -26
  102. package/plugins/columnSummary/columnSummary.mjs +22 -26
  103. package/plugins/comments/comments.js +116 -158
  104. package/plugins/comments/comments.mjs +116 -158
  105. package/plugins/contextMenu/contextMenu.js +20 -26
  106. package/plugins/contextMenu/contextMenu.mjs +20 -26
  107. package/plugins/contextMenu/itemsFactory.js +1 -1
  108. package/plugins/contextMenu/itemsFactory.mjs +1 -1
  109. package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
  110. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
  111. package/plugins/contextMenu/menu/menu.js +13 -21
  112. package/plugins/contextMenu/menu/menu.mjs +13 -21
  113. package/plugins/contextMenu/menu/positioner.js +41 -58
  114. package/plugins/contextMenu/menu/positioner.mjs +41 -58
  115. package/plugins/copyPaste/copyPaste.js +113 -154
  116. package/plugins/copyPaste/copyPaste.mjs +113 -154
  117. package/plugins/copyPaste/copyableRanges.js +43 -66
  118. package/plugins/copyPaste/copyableRanges.mjs +43 -66
  119. package/plugins/customBorders/customBorders.js +11 -13
  120. package/plugins/customBorders/customBorders.mjs +11 -13
  121. package/plugins/dragToScroll/dragToScroll.js +6 -6
  122. package/plugins/dragToScroll/dragToScroll.mjs +6 -6
  123. package/plugins/dropdownMenu/dropdownMenu.js +78 -100
  124. package/plugins/dropdownMenu/dropdownMenu.mjs +78 -100
  125. package/plugins/exportFile/dataProvider.js +1 -1
  126. package/plugins/exportFile/dataProvider.mjs +1 -1
  127. package/plugins/filters/component/actionBar.js +9 -9
  128. package/plugins/filters/component/actionBar.mjs +8 -8
  129. package/plugins/filters/component/condition.js +13 -15
  130. package/plugins/filters/component/condition.mjs +13 -15
  131. package/plugins/filters/component/operators.js +6 -6
  132. package/plugins/filters/component/operators.mjs +6 -6
  133. package/plugins/filters/component/value.js +24 -28
  134. package/plugins/filters/component/value.mjs +24 -28
  135. package/plugins/filters/conditionUpdateObserver.js +22 -24
  136. package/plugins/filters/conditionUpdateObserver.mjs +22 -24
  137. package/plugins/filters/dataFilter.js +1 -1
  138. package/plugins/filters/dataFilter.mjs +1 -1
  139. package/plugins/filters/filters.js +81 -95
  140. package/plugins/filters/filters.mjs +81 -95
  141. package/plugins/filters/ui/input.js +13 -19
  142. package/plugins/filters/ui/input.mjs +13 -19
  143. package/plugins/filters/ui/link.js +8 -13
  144. package/plugins/filters/ui/link.mjs +8 -13
  145. package/plugins/filters/ui/multipleSelect.js +85 -112
  146. package/plugins/filters/ui/multipleSelect.mjs +85 -112
  147. package/plugins/filters/ui/radioInput.js +12 -20
  148. package/plugins/filters/ui/radioInput.mjs +12 -20
  149. package/plugins/filters/ui/select.js +50 -72
  150. package/plugins/filters/ui/select.mjs +49 -71
  151. package/plugins/formulas/formulas.js +268 -326
  152. package/plugins/formulas/formulas.mjs +269 -327
  153. package/plugins/formulas/indexSyncer/axisSyncer.js +38 -61
  154. package/plugins/formulas/indexSyncer/axisSyncer.mjs +38 -61
  155. package/plugins/formulas/indexSyncer/index.js +25 -48
  156. package/plugins/formulas/indexSyncer/index.mjs +25 -48
  157. package/plugins/hiddenColumns/hiddenColumns.js +64 -83
  158. package/plugins/hiddenColumns/hiddenColumns.mjs +64 -83
  159. package/plugins/hiddenRows/hiddenRows.js +63 -82
  160. package/plugins/hiddenRows/hiddenRows.mjs +63 -82
  161. package/plugins/manualColumnFreeze/manualColumnFreeze.js +24 -32
  162. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +25 -33
  163. package/plugins/manualColumnMove/manualColumnMove.js +126 -170
  164. package/plugins/manualColumnMove/manualColumnMove.mjs +126 -170
  165. package/plugins/manualColumnResize/manualColumnResize.js +169 -230
  166. package/plugins/manualColumnResize/manualColumnResize.mjs +169 -230
  167. package/plugins/manualRowMove/manualRowMove.js +99 -128
  168. package/plugins/manualRowMove/manualRowMove.mjs +99 -128
  169. package/plugins/manualRowResize/manualRowResize.js +150 -209
  170. package/plugins/manualRowResize/manualRowResize.mjs +150 -209
  171. package/plugins/mergeCells/calculations/selection.js +71 -2
  172. package/plugins/mergeCells/calculations/selection.mjs +71 -2
  173. package/plugins/mergeCells/cellsCollection.js +1 -117
  174. package/plugins/mergeCells/cellsCollection.mjs +1 -117
  175. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
  176. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
  177. package/plugins/mergeCells/mergeCells.js +353 -593
  178. package/plugins/mergeCells/mergeCells.mjs +353 -593
  179. package/plugins/multiColumnSorting/multiColumnSorting.js +0 -6
  180. package/plugins/multiColumnSorting/multiColumnSorting.mjs +0 -6
  181. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
  182. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
  183. package/plugins/nestedHeaders/nestedHeaders.js +204 -254
  184. package/plugins/nestedHeaders/nestedHeaders.mjs +205 -255
  185. package/plugins/nestedHeaders/stateManager/headersTree.js +21 -32
  186. package/plugins/nestedHeaders/stateManager/headersTree.mjs +21 -32
  187. package/plugins/nestedHeaders/stateManager/index.js +30 -41
  188. package/plugins/nestedHeaders/stateManager/index.mjs +30 -41
  189. package/plugins/nestedHeaders/stateManager/sourceSettings.js +19 -30
  190. package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +19 -30
  191. package/plugins/nestedRows/data/dataManager.js +1 -1
  192. package/plugins/nestedRows/data/dataManager.mjs +1 -1
  193. package/plugins/nestedRows/nestedRows.js +138 -179
  194. package/plugins/nestedRows/nestedRows.mjs +139 -180
  195. package/plugins/nestedRows/ui/contextMenu.js +11 -15
  196. package/plugins/nestedRows/ui/contextMenu.mjs +10 -14
  197. package/plugins/nestedRows/utils/rowMoveController.js +1 -1
  198. package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
  199. package/plugins/persistentState/storage.js +2 -2
  200. package/plugins/persistentState/storage.mjs +2 -2
  201. package/plugins/search/search.js +7 -7
  202. package/plugins/search/search.mjs +7 -7
  203. package/plugins/touchScroll/touchScroll.js +15 -19
  204. package/plugins/touchScroll/touchScroll.mjs +16 -20
  205. package/plugins/trimRows/trimRows.js +6 -6
  206. package/plugins/trimRows/trimRows.mjs +6 -6
  207. package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
  208. package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
  209. package/selection/highlight/highlight.js +14 -14
  210. package/selection/highlight/highlight.mjs +13 -13
  211. package/selection/highlight/visualSelection.js +2 -16
  212. package/selection/highlight/visualSelection.mjs +2 -16
  213. package/selection/selection.js +60 -255
  214. package/selection/selection.mjs +59 -254
  215. package/selection/transformation.js +101 -175
  216. package/selection/transformation.mjs +101 -175
  217. package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
  218. package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
  219. package/shortcutContexts/commands/editor/open.js +3 -18
  220. package/shortcutContexts/commands/editor/open.mjs +3 -18
  221. package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
  222. package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
  223. package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
  224. package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
  225. package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
  226. package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
  227. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
  228. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
  229. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
  230. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
  231. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
  232. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
  233. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
  234. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
  235. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
  236. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
  237. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
  238. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
  239. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
  240. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
  241. package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
  242. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
  243. package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
  244. package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
  245. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
  246. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
  247. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
  248. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
  249. package/shortcutContexts/grid.js +2 -2
  250. package/shortcutContexts/grid.mjs +2 -2
  251. package/shortcuts/context.js +1 -2
  252. package/shortcuts/context.mjs +1 -2
  253. package/tableView.js +52 -98
  254. package/tableView.mjs +52 -98
  255. package/translations/changesObservable/observable.js +21 -38
  256. package/translations/changesObservable/observable.mjs +21 -38
  257. package/translations/changesObservable/observer.js +7 -12
  258. package/translations/changesObservable/observer.mjs +6 -11
  259. package/translations/mapCollections/aggregatedCollection.js +1 -1
  260. package/translations/mapCollections/aggregatedCollection.mjs +1 -1
  261. package/translations/maps/indexMap.js +1 -1
  262. package/translations/maps/indexMap.mjs +1 -1
  263. package/utils/dataStructures/linkedList.js +1 -6
  264. package/utils/dataStructures/linkedList.mjs +1 -6
  265. package/utils/dataStructures/tree.js +1 -1
  266. package/utils/dataStructures/tree.mjs +1 -1
  267. package/utils/interval.js +26 -44
  268. package/utils/interval.mjs +26 -44
  269. package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
  270. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
  271. package/plugins/mergeCells/focusOrder.js +0 -327
  272. package/plugins/mergeCells/focusOrder.mjs +0 -322
@@ -8,12 +8,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
8
8
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
9
9
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
10
10
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
11
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
12
- function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
13
- function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
14
- function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
15
- function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
16
- function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
11
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
12
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
13
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
17
14
  /**
18
15
  * The Transformation class implements algorithms for transforming coordinates based on current settings
19
16
  * passed to the Handsontable. The class performs the calculations based on the renderable indexes.
@@ -32,77 +29,29 @@ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.
32
29
  var _range = /*#__PURE__*/new WeakMap();
33
30
  var _options = /*#__PURE__*/new WeakMap();
34
31
  var _offset = /*#__PURE__*/new WeakMap();
35
- var _clampCoords = /*#__PURE__*/new WeakSet();
36
- var _getTableSize = /*#__PURE__*/new WeakSet();
37
- var _findFirstNonHiddenZeroBasedRow = /*#__PURE__*/new WeakSet();
38
- var _findFirstNonHiddenZeroBasedColumn = /*#__PURE__*/new WeakSet();
39
- var _visualToZeroBasedCoords = /*#__PURE__*/new WeakSet();
40
- var _zeroBasedToVisualCoords = /*#__PURE__*/new WeakSet();
32
+ var _Transformation_brand = /*#__PURE__*/new WeakSet();
41
33
  class Transformation {
42
34
  constructor(range, options) {
43
35
  /**
44
- * Translates the zero-based coordinates to visual ones.
36
+ * Sets the additional offset in table size that may occur when the `navigableHeaders` option
37
+ * is enabled.
45
38
  *
46
- * @param {CellCoords} zeroBasedCoords The coordinates to process.
47
- * @returns {CellCoords}
39
+ * @param {{x: number, y: number}} offset Offset as x and y properties.
48
40
  */
49
- _classPrivateMethodInitSpec(this, _zeroBasedToVisualCoords);
50
- /**
51
- * Translates the visual coordinates to zero-based ones.
52
- *
53
- * @param {CellCoords} visualCoords The visual coords to process.
54
- * @returns {CellCoords}
55
- */
56
- _classPrivateMethodInitSpec(this, _visualToZeroBasedCoords);
57
- /**
58
- * Finds the first non-hidden zero-based column in the table range.
59
- *
60
- * @param {number} visualColumnFrom The visual column from which the search should start.
61
- * @param {number} visualColumnTo The visual column to which the search should end.
62
- * @returns {number | null}
63
- */
64
- _classPrivateMethodInitSpec(this, _findFirstNonHiddenZeroBasedColumn);
65
- /**
66
- * Finds the first non-hidden zero-based row in the table range.
67
- *
68
- * @param {number} visualRowFrom The visual row from which the search should start.
69
- * @param {number} visualRowTo The visual row to which the search should end.
70
- * @returns {number | null}
71
- */
72
- _classPrivateMethodInitSpec(this, _findFirstNonHiddenZeroBasedRow);
73
- /**
74
- * Gets the table size in number of rows with headers as "height" and number of columns with
75
- * headers as "width".
76
- *
77
- * @returns {{width: number, height: number}}
78
- */
79
- _classPrivateMethodInitSpec(this, _getTableSize);
80
- /**
81
- * Clamps the coords to make sure they points to the cell (or header) in the table range.
82
- *
83
- * @param {CellCoords} zeroBasedCoords The coords object to clamp.
84
- * @returns {{rowDir: 1|0|-1, colDir: 1|0|-1}}
85
- */
86
- _classPrivateMethodInitSpec(this, _clampCoords);
41
+ _classPrivateMethodInitSpec(this, _Transformation_brand);
87
42
  /**
88
43
  * Instance of the SelectionRange, holder for visual coordinates applied to the table.
89
44
  *
90
45
  * @type {SelectionRange}
91
46
  */
92
- _classPrivateFieldInitSpec(this, _range, {
93
- writable: true,
94
- value: void 0
95
- });
47
+ _classPrivateFieldInitSpec(this, _range, void 0);
96
48
  /**
97
49
  * Additional options which define the state of the settings which can infer transformation and
98
50
  * give the possibility to translate indexes.
99
51
  *
100
52
  * @type {object}
101
53
  */
102
- _classPrivateFieldInitSpec(this, _options, {
103
- writable: true,
104
- value: void 0
105
- });
54
+ _classPrivateFieldInitSpec(this, _options, void 0);
106
55
  /**
107
56
  * Increases the table size by applying the offsets. The option is used by the `navigableHeaders`
108
57
  * option.
@@ -110,14 +59,11 @@ class Transformation {
110
59
  * @type {{ x: number, y: number }}
111
60
  */
112
61
  _classPrivateFieldInitSpec(this, _offset, {
113
- writable: true,
114
- value: {
115
- x: 0,
116
- y: 0
117
- }
62
+ x: 0,
63
+ y: 0
118
64
  });
119
- _classPrivateFieldSet(this, _range, range);
120
- _classPrivateFieldSet(this, _options, options);
65
+ _classPrivateFieldSet(_range, this, range);
66
+ _classPrivateFieldSet(_options, this, options);
121
67
  }
122
68
 
123
69
  /**
@@ -131,9 +77,13 @@ class Transformation {
131
77
  */
132
78
  transformStart(rowDelta, colDelta) {
133
79
  let createMissingRecords = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
134
- const delta = _classPrivateFieldGet(this, _options).createCellCoords(rowDelta, colDelta);
135
- let visualCoords = _classPrivateFieldGet(this, _range).current().highlight;
136
- const highlightRenderableCoords = _classPrivateFieldGet(this, _options).visualToRenderableCoords(visualCoords);
80
+ _assertClassBrand(_Transformation_brand, this, _setOffsetSize).call(this, {
81
+ x: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countRowHeaders() : 0,
82
+ y: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countColHeaders() : 0
83
+ });
84
+ const delta = _classPrivateFieldGet(_options, this).createCellCoords(rowDelta, colDelta);
85
+ let visualCoords = _classPrivateFieldGet(_range, this).current().highlight;
86
+ const highlightRenderableCoords = _classPrivateFieldGet(_options, this).visualToRenderableCoords(visualCoords);
137
87
  let rowTransformDir = 0;
138
88
  let colTransformDir = 0;
139
89
  this.runLocalHooks('beforeTransformStart', delta);
@@ -141,32 +91,32 @@ class Transformation {
141
91
  const {
142
92
  width,
143
93
  height
144
- } = _classPrivateMethodGet(this, _getTableSize, _getTableSize2).call(this);
94
+ } = _assertClassBrand(_Transformation_brand, this, _getTableSize).call(this);
145
95
  const {
146
96
  row,
147
97
  col
148
- } = _classPrivateMethodGet(this, _visualToZeroBasedCoords, _visualToZeroBasedCoords2).call(this, visualCoords);
149
- const fixedRowsBottom = _classPrivateFieldGet(this, _options).fixedRowsBottom();
150
- const minSpareRows = _classPrivateFieldGet(this, _options).minSpareRows();
151
- const minSpareCols = _classPrivateFieldGet(this, _options).minSpareCols();
152
- const autoWrapRow = _classPrivateFieldGet(this, _options).autoWrapRow();
153
- const autoWrapCol = _classPrivateFieldGet(this, _options).autoWrapCol();
154
- const zeroBasedCoords = _classPrivateFieldGet(this, _options).createCellCoords(row + delta.row, col + delta.col);
98
+ } = _assertClassBrand(_Transformation_brand, this, _visualToZeroBasedCoords).call(this, visualCoords);
99
+ const fixedRowsBottom = _classPrivateFieldGet(_options, this).fixedRowsBottom();
100
+ const minSpareRows = _classPrivateFieldGet(_options, this).minSpareRows();
101
+ const minSpareCols = _classPrivateFieldGet(_options, this).minSpareCols();
102
+ const autoWrapRow = _classPrivateFieldGet(_options, this).autoWrapRow();
103
+ const autoWrapCol = _classPrivateFieldGet(_options, this).autoWrapCol();
104
+ const zeroBasedCoords = _classPrivateFieldGet(_options, this).createCellCoords(row + delta.row, col + delta.col);
155
105
  if (zeroBasedCoords.row >= height) {
156
106
  const isActionInterrupted = (0, _object.createObjectPropListener)(createMissingRecords && minSpareRows > 0 && fixedRowsBottom === 0);
157
107
  const nextColumn = zeroBasedCoords.col + 1;
158
- const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(zeroBasedCoords.row - height, nextColumn >= width ? nextColumn - width : nextColumn);
159
- this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), nextColumn >= width);
108
+ const newCoords = _classPrivateFieldGet(_options, this).createCellCoords(zeroBasedCoords.row - height, nextColumn >= width ? nextColumn - width : nextColumn);
109
+ this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, newCoords), nextColumn >= width);
160
110
  if (isActionInterrupted.value) {
161
- this.runLocalHooks('insertRowRequire', _classPrivateFieldGet(this, _options).countRenderableRows());
111
+ this.runLocalHooks('insertRowRequire', _classPrivateFieldGet(_options, this).countRenderableRows());
162
112
  } else if (autoWrapCol) {
163
113
  zeroBasedCoords.assign(newCoords);
164
114
  }
165
115
  } else if (zeroBasedCoords.row < 0) {
166
116
  const isActionInterrupted = (0, _object.createObjectPropListener)(autoWrapCol);
167
117
  const previousColumn = zeroBasedCoords.col - 1;
168
- const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(height + zeroBasedCoords.row, previousColumn < 0 ? width + previousColumn : previousColumn);
169
- this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), previousColumn < 0);
118
+ const newCoords = _classPrivateFieldGet(_options, this).createCellCoords(height + zeroBasedCoords.row, previousColumn < 0 ? width + previousColumn : previousColumn);
119
+ this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, newCoords), previousColumn < 0);
170
120
  if (autoWrapCol) {
171
121
  zeroBasedCoords.assign(newCoords);
172
122
  }
@@ -174,18 +124,18 @@ class Transformation {
174
124
  if (zeroBasedCoords.col >= width) {
175
125
  const isActionInterrupted = (0, _object.createObjectPropListener)(createMissingRecords && minSpareCols > 0);
176
126
  const nextRow = zeroBasedCoords.row + 1;
177
- const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(nextRow >= height ? nextRow - height : nextRow, zeroBasedCoords.col - width);
178
- this.runLocalHooks('beforeRowWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), nextRow >= height);
127
+ const newCoords = _classPrivateFieldGet(_options, this).createCellCoords(nextRow >= height ? nextRow - height : nextRow, zeroBasedCoords.col - width);
128
+ this.runLocalHooks('beforeRowWrap', isActionInterrupted, _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, newCoords), nextRow >= height);
179
129
  if (isActionInterrupted.value) {
180
- this.runLocalHooks('insertColRequire', _classPrivateFieldGet(this, _options).countRenderableColumns());
130
+ this.runLocalHooks('insertColRequire', _classPrivateFieldGet(_options, this).countRenderableColumns());
181
131
  } else if (autoWrapRow) {
182
132
  zeroBasedCoords.assign(newCoords);
183
133
  }
184
134
  } else if (zeroBasedCoords.col < 0) {
185
135
  const isActionInterrupted = (0, _object.createObjectPropListener)(autoWrapRow);
186
136
  const previousRow = zeroBasedCoords.row - 1;
187
- const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(previousRow < 0 ? height + previousRow : previousRow, width + zeroBasedCoords.col);
188
- this.runLocalHooks('beforeRowWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), previousRow < 0);
137
+ const newCoords = _classPrivateFieldGet(_options, this).createCellCoords(previousRow < 0 ? height + previousRow : previousRow, width + zeroBasedCoords.col);
138
+ this.runLocalHooks('beforeRowWrap', isActionInterrupted, _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, newCoords), previousRow < 0);
189
139
  if (autoWrapRow) {
190
140
  zeroBasedCoords.assign(newCoords);
191
141
  }
@@ -193,10 +143,10 @@ class Transformation {
193
143
  const {
194
144
  rowDir,
195
145
  colDir
196
- } = _classPrivateMethodGet(this, _clampCoords, _clampCoords2).call(this, zeroBasedCoords);
146
+ } = _assertClassBrand(_Transformation_brand, this, _clampCoords).call(this, zeroBasedCoords);
197
147
  rowTransformDir = rowDir;
198
148
  colTransformDir = colDir;
199
- visualCoords = _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, zeroBasedCoords);
149
+ visualCoords = _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, zeroBasedCoords);
200
150
  }
201
151
  this.runLocalHooks('afterTransformStart', visualCoords, rowTransformDir, colTransformDir);
202
152
  return visualCoords;
@@ -210,54 +160,30 @@ class Transformation {
210
160
  * @returns {CellCoords} Visual coordinates after transformation.
211
161
  */
212
162
  transformEnd(rowDelta, colDelta) {
213
- const delta = _classPrivateFieldGet(this, _options).createCellCoords(rowDelta, colDelta);
214
- const cellRange = _classPrivateFieldGet(this, _range).current();
215
- const highlightRenderableCoords = _classPrivateFieldGet(this, _options).visualToRenderableCoords(cellRange.highlight);
216
- const toRow = _classPrivateMethodGet(this, _findFirstNonHiddenZeroBasedRow, _findFirstNonHiddenZeroBasedRow2).call(this, cellRange.to.row, cellRange.from.row);
217
- const toColumn = _classPrivateMethodGet(this, _findFirstNonHiddenZeroBasedColumn, _findFirstNonHiddenZeroBasedColumn2).call(this, cellRange.to.col, cellRange.from.col);
163
+ _assertClassBrand(_Transformation_brand, this, _setOffsetSize).call(this, {
164
+ x: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countRowHeaders() : 0,
165
+ y: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countColHeaders() : 0
166
+ });
167
+ const delta = _classPrivateFieldGet(_options, this).createCellCoords(rowDelta, colDelta);
168
+ const cellRange = _classPrivateFieldGet(_range, this).current();
169
+ const highlightRenderableCoords = _classPrivateFieldGet(_options, this).visualToRenderableCoords(cellRange.highlight);
218
170
  const visualCoords = cellRange.to.clone();
219
171
  let rowTransformDir = 0;
220
172
  let colTransformDir = 0;
221
173
  this.runLocalHooks('beforeTransformEnd', delta);
222
- if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null && toRow !== null && toColumn !== null) {
174
+ if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null) {
223
175
  const {
224
- row: highlightRow,
225
- col: highlightColumn
226
- } = _classPrivateMethodGet(this, _visualToZeroBasedCoords, _visualToZeroBasedCoords2).call(this, cellRange.highlight);
227
- const coords = _classPrivateFieldGet(this, _options).createCellCoords(toRow + delta.row, toColumn + delta.col);
228
- const restDelta = {
229
- row: coords.row - highlightRow,
230
- col: coords.col - highlightColumn
231
- };
232
- this.runLocalHooks('modifyTransformEndRestDelta', restDelta, delta, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, coords));
233
- const topStartCorner = cellRange.getTopStartCorner();
234
- const topEndCorner = cellRange.getTopEndCorner();
235
- const bottomEndCorner = cellRange.getBottomEndCorner();
236
- if (delta.col < 0) {
237
- if (toColumn >= highlightColumn && coords.col < highlightColumn) {
238
- coords.col = _classPrivateMethodGet(this, _findFirstNonHiddenZeroBasedColumn, _findFirstNonHiddenZeroBasedColumn2).call(this, topStartCorner.col, topEndCorner.col) + restDelta.col;
239
- }
240
- } else if (delta.col > 0) {
241
- if (toColumn <= highlightColumn && coords.col > highlightColumn) {
242
- coords.col = _classPrivateMethodGet(this, _findFirstNonHiddenZeroBasedColumn, _findFirstNonHiddenZeroBasedColumn2).call(this, topEndCorner.col, topStartCorner.col) + restDelta.col;
243
- }
244
- }
245
- if (delta.row < 0) {
246
- if (toRow >= highlightRow && coords.row < highlightRow) {
247
- coords.row = _classPrivateMethodGet(this, _findFirstNonHiddenZeroBasedRow, _findFirstNonHiddenZeroBasedRow2).call(this, topStartCorner.row, bottomEndCorner.row) + restDelta.row;
248
- }
249
- } else if (delta.row > 0) {
250
- if (toRow <= highlightRow && coords.row > highlightRow) {
251
- coords.row = _classPrivateMethodGet(this, _findFirstNonHiddenZeroBasedRow, _findFirstNonHiddenZeroBasedRow2).call(this, bottomEndCorner.row, topStartCorner.row) + restDelta.row;
252
- }
253
- }
176
+ row,
177
+ col
178
+ } = _assertClassBrand(_Transformation_brand, this, _visualToZeroBasedCoords).call(this, cellRange.to);
179
+ const coords = _classPrivateFieldGet(_options, this).createCellCoords(row + delta.row, col + delta.col);
254
180
  const {
255
181
  rowDir,
256
182
  colDir
257
- } = _classPrivateMethodGet(this, _clampCoords, _clampCoords2).call(this, coords);
183
+ } = _assertClassBrand(_Transformation_brand, this, _clampCoords).call(this, coords);
258
184
  rowTransformDir = rowDir;
259
185
  colTransformDir = colDir;
260
- const newVisualCoords = _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, coords);
186
+ const newVisualCoords = _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, coords);
261
187
  if (delta.row === 0 && delta.col !== 0) {
262
188
  visualCoords.col = newVisualCoords.col;
263
189
  } else if (delta.row !== 0 && delta.col === 0) {
@@ -270,29 +196,28 @@ class Transformation {
270
196
  this.runLocalHooks('afterTransformEnd', visualCoords, rowTransformDir, colTransformDir);
271
197
  return visualCoords;
272
198
  }
273
-
274
- /**
275
- * Sets the additional offset in table size that may occur when the `navigableHeaders` option
276
- * is enabled.
277
- *
278
- * @param {{x: number, y: number}} offset Offset as x and y properties.
279
- */
280
- setOffsetSize(_ref) {
281
- let {
282
- x,
283
- y
284
- } = _ref;
285
- _classPrivateFieldSet(this, _offset, {
286
- x,
287
- y
288
- });
289
- }
290
199
  }
291
- function _clampCoords2(zeroBasedCoords) {
200
+ function _setOffsetSize(_ref) {
201
+ let {
202
+ x,
203
+ y
204
+ } = _ref;
205
+ _classPrivateFieldSet(_offset, this, {
206
+ x,
207
+ y
208
+ });
209
+ }
210
+ /**
211
+ * Clamps the coords to make sure they points to the cell (or header) in the table range.
212
+ *
213
+ * @param {CellCoords} zeroBasedCoords The coords object to clamp.
214
+ * @returns {{rowDir: 1|0|-1, colDir: 1|0|-1}}
215
+ */
216
+ function _clampCoords(zeroBasedCoords) {
292
217
  const {
293
218
  width,
294
219
  height
295
- } = _classPrivateMethodGet(this, _getTableSize, _getTableSize2).call(this);
220
+ } = _assertClassBrand(_Transformation_brand, this, _getTableSize).call(this);
296
221
  let rowDir = 0;
297
222
  let colDir = 0;
298
223
  if (zeroBasedCoords.row < 0) {
@@ -314,41 +239,42 @@ function _clampCoords2(zeroBasedCoords) {
314
239
  colDir
315
240
  };
316
241
  }
317
- function _getTableSize2() {
242
+ /**
243
+ * Gets the table size in number of rows with headers as "height" and number of columns with
244
+ * headers as "width".
245
+ *
246
+ * @returns {{width: number, height: number}}
247
+ */
248
+ function _getTableSize() {
318
249
  return {
319
- width: _classPrivateFieldGet(this, _offset).x + _classPrivateFieldGet(this, _options).countRenderableColumns(),
320
- height: _classPrivateFieldGet(this, _offset).y + _classPrivateFieldGet(this, _options).countRenderableRows()
250
+ width: _classPrivateFieldGet(_offset, this).x + _classPrivateFieldGet(_options, this).countRenderableColumns(),
251
+ height: _classPrivateFieldGet(_offset, this).y + _classPrivateFieldGet(_options, this).countRenderableRows()
321
252
  };
322
253
  }
323
- function _findFirstNonHiddenZeroBasedRow2(visualRowFrom, visualRowTo) {
324
- const row = _classPrivateFieldGet(this, _options).findFirstNonHiddenRenderableRow(visualRowFrom, visualRowTo);
325
- if (row === null) {
326
- return null;
327
- }
328
- return _classPrivateFieldGet(this, _offset).y + row;
329
- }
330
- function _findFirstNonHiddenZeroBasedColumn2(visualColumnFrom, visualColumnTo) {
331
- const column = _classPrivateFieldGet(this, _options).findFirstNonHiddenRenderableColumn(visualColumnFrom, visualColumnTo);
332
- if (column === null) {
333
- return null;
334
- }
335
- return _classPrivateFieldGet(this, _offset).x + column;
336
- }
337
- function _visualToZeroBasedCoords2(visualCoords) {
254
+ /**
255
+ * Translates the visual coordinates to zero-based ones.
256
+ *
257
+ * @param {CellCoords} visualCoords The visual coords to process.
258
+ * @returns {CellCoords}
259
+ */
260
+ function _visualToZeroBasedCoords(visualCoords) {
338
261
  const {
339
262
  row,
340
263
  col
341
- } = _classPrivateFieldGet(this, _options).visualToRenderableCoords(visualCoords);
342
- if (row === null || col === null) {
343
- throw new Error('Renderable coords are not visible.');
344
- }
345
- return _classPrivateFieldGet(this, _options).createCellCoords(_classPrivateFieldGet(this, _offset).y + row, _classPrivateFieldGet(this, _offset).x + col);
264
+ } = _classPrivateFieldGet(_options, this).visualToRenderableCoords(visualCoords);
265
+ return _classPrivateFieldGet(_options, this).createCellCoords(_classPrivateFieldGet(_offset, this).y + row, _classPrivateFieldGet(_offset, this).x + col);
346
266
  }
347
- function _zeroBasedToVisualCoords2(zeroBasedCoords) {
267
+ /**
268
+ * Translates the zero-based coordinates to visual ones.
269
+ *
270
+ * @param {CellCoords} zeroBasedCoords The coordinates to process.
271
+ * @returns {CellCoords}
272
+ */
273
+ function _zeroBasedToVisualCoords(zeroBasedCoords) {
348
274
  const coords = zeroBasedCoords.clone();
349
- coords.col = zeroBasedCoords.col - _classPrivateFieldGet(this, _offset).x;
350
- coords.row = zeroBasedCoords.row - _classPrivateFieldGet(this, _offset).y;
351
- return _classPrivateFieldGet(this, _options).renderableToVisualCoords(coords);
275
+ coords.col = zeroBasedCoords.col - _classPrivateFieldGet(_offset, this).x;
276
+ coords.row = zeroBasedCoords.row - _classPrivateFieldGet(_offset, this).y;
277
+ return _classPrivateFieldGet(_options, this).renderableToVisualCoords(coords);
352
278
  }
353
279
  (0, _object.mixin)(Transformation, _localHooks.default);
354
280
  var _default = exports.default = Transformation;