handsontable 0.0.0-next-53a190b-20240403 → 0.0.0-next-5a535ed-20240403

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 (284) hide show
  1. package/3rdparty/walkontable/src/calculator/viewportColumns.js +17 -12
  2. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +17 -12
  3. package/3rdparty/walkontable/src/calculator/viewportRows.js +15 -10
  4. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +15 -10
  5. package/3rdparty/walkontable/src/cell/coords.js +17 -12
  6. package/3rdparty/walkontable/src/cell/coords.mjs +17 -12
  7. package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
  8. package/3rdparty/walkontable/src/cell/range.js +28 -40
  9. package/3rdparty/walkontable/src/cell/range.mjs +28 -40
  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 +104 -72
  13. package/3rdparty/walkontable/src/event.mjs +104 -72
  14. package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -15
  15. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -16
  16. package/3rdparty/walkontable/src/overlay/top.js +0 -11
  17. package/3rdparty/walkontable/src/overlay/top.mjs +1 -12
  18. package/3rdparty/walkontable/src/overlays.js +4 -46
  19. package/3rdparty/walkontable/src/overlays.mjs +4 -46
  20. package/3rdparty/walkontable/src/scroll.js +17 -15
  21. package/3rdparty/walkontable/src/scroll.mjs +17 -15
  22. package/3rdparty/walkontable/src/selection/manager.js +69 -48
  23. package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
  24. package/3rdparty/walkontable/src/selection/scanner.js +42 -33
  25. package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
  26. package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
  27. package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
  28. package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
  29. package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
  30. package/base.js +2 -2
  31. package/base.mjs +2 -2
  32. package/core/viewportScroll/index.js +1 -4
  33. package/core/viewportScroll/index.mjs +1 -4
  34. package/core.d.ts +3 -4
  35. package/core.js +22 -77
  36. package/core.mjs +22 -77
  37. package/dataMap/dataSource.js +1 -1
  38. package/dataMap/dataSource.mjs +1 -1
  39. package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
  40. package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
  41. package/dataMap/metaManager/metaSchema.js +1 -1
  42. package/dataMap/metaManager/metaSchema.mjs +1 -1
  43. package/dataMap/replaceData.js +1 -1
  44. package/dataMap/replaceData.mjs +1 -1
  45. package/dist/handsontable.css +4 -4
  46. package/dist/handsontable.full.css +4 -4
  47. package/dist/handsontable.full.js +9121 -9062
  48. package/dist/handsontable.full.min.css +3 -3
  49. package/dist/handsontable.full.min.js +292 -292
  50. package/dist/handsontable.js +6573 -6967
  51. package/dist/handsontable.min.css +3 -3
  52. package/dist/handsontable.min.js +25 -25
  53. package/dist/languages/all.min.js +1 -1
  54. package/dist/languages/ar-AR.min.js +1 -1
  55. package/dist/languages/cs-CZ.min.js +1 -1
  56. package/dist/languages/de-CH.min.js +1 -1
  57. package/dist/languages/de-DE.min.js +1 -1
  58. package/dist/languages/en-US.min.js +1 -1
  59. package/dist/languages/es-MX.min.js +1 -1
  60. package/dist/languages/fr-FR.min.js +1 -1
  61. package/dist/languages/hr-HR.min.js +1 -1
  62. package/dist/languages/it-IT.min.js +1 -1
  63. package/dist/languages/ja-JP.min.js +1 -1
  64. package/dist/languages/ko-KR.min.js +1 -1
  65. package/dist/languages/lv-LV.min.js +1 -1
  66. package/dist/languages/nb-NO.min.js +1 -1
  67. package/dist/languages/nl-NL.min.js +1 -1
  68. package/dist/languages/pl-PL.min.js +1 -1
  69. package/dist/languages/pt-BR.min.js +1 -1
  70. package/dist/languages/ru-RU.min.js +1 -1
  71. package/dist/languages/sr-SP.min.js +1 -1
  72. package/dist/languages/zh-CN.min.js +1 -1
  73. package/dist/languages/zh-TW.min.js +1 -1
  74. package/editorManager.js +23 -25
  75. package/editorManager.mjs +23 -25
  76. package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
  77. package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
  78. package/editors/selectEditor/selectEditor.js +19 -20
  79. package/editors/selectEditor/selectEditor.mjs +19 -20
  80. package/eventManager.js +1 -1
  81. package/eventManager.mjs +1 -1
  82. package/focusManager.js +82 -64
  83. package/focusManager.mjs +82 -64
  84. package/helpers/dom/element.js +1 -23
  85. package/helpers/dom/element.mjs +1 -21
  86. package/helpers/mixed.js +1 -1
  87. package/helpers/mixed.mjs +1 -1
  88. package/helpers/object.js +2 -2
  89. package/helpers/object.mjs +2 -2
  90. package/index.d.ts +0 -10
  91. package/package.json +2 -7
  92. package/pluginHooks.d.ts +3 -4
  93. package/pluginHooks.js +38 -99
  94. package/pluginHooks.mjs +38 -99
  95. package/plugins/autoColumnSize/autoColumnSize.js +65 -49
  96. package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
  97. package/plugins/autoRowSize/autoRowSize.js +34 -28
  98. package/plugins/autoRowSize/autoRowSize.mjs +34 -28
  99. package/plugins/autofill/autofill.js +38 -30
  100. package/plugins/autofill/autofill.mjs +38 -30
  101. package/plugins/base/base.js +17 -12
  102. package/plugins/base/base.mjs +17 -12
  103. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
  104. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
  105. package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
  106. package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
  107. package/plugins/columnSorting/columnSorting.js +45 -49
  108. package/plugins/columnSorting/columnSorting.mjs +45 -49
  109. package/plugins/columnSummary/columnSummary.js +26 -22
  110. package/plugins/columnSummary/columnSummary.mjs +26 -22
  111. package/plugins/comments/comments.js +158 -116
  112. package/plugins/comments/comments.mjs +158 -116
  113. package/plugins/contextMenu/contextMenu.js +26 -20
  114. package/plugins/contextMenu/contextMenu.mjs +26 -20
  115. package/plugins/contextMenu/itemsFactory.js +1 -1
  116. package/plugins/contextMenu/itemsFactory.mjs +1 -1
  117. package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
  118. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
  119. package/plugins/contextMenu/menu/menu.js +21 -13
  120. package/plugins/contextMenu/menu/menu.mjs +21 -13
  121. package/plugins/contextMenu/menu/positioner.js +58 -41
  122. package/plugins/contextMenu/menu/positioner.mjs +58 -41
  123. package/plugins/copyPaste/copyPaste.js +157 -116
  124. package/plugins/copyPaste/copyPaste.mjs +157 -116
  125. package/plugins/copyPaste/copyableRanges.js +66 -43
  126. package/plugins/copyPaste/copyableRanges.mjs +66 -43
  127. package/plugins/customBorders/customBorders.js +13 -11
  128. package/plugins/customBorders/customBorders.mjs +13 -11
  129. package/plugins/dragToScroll/dragToScroll.js +6 -6
  130. package/plugins/dragToScroll/dragToScroll.mjs +6 -6
  131. package/plugins/dropdownMenu/dropdownMenu.js +106 -80
  132. package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
  133. package/plugins/exportFile/dataProvider.js +1 -1
  134. package/plugins/exportFile/dataProvider.mjs +1 -1
  135. package/plugins/filters/component/actionBar.js +9 -9
  136. package/plugins/filters/component/actionBar.mjs +8 -8
  137. package/plugins/filters/component/condition.js +15 -13
  138. package/plugins/filters/component/condition.mjs +15 -13
  139. package/plugins/filters/component/operators.js +6 -6
  140. package/plugins/filters/component/operators.mjs +6 -6
  141. package/plugins/filters/component/value.js +28 -24
  142. package/plugins/filters/component/value.mjs +28 -24
  143. package/plugins/filters/conditionUpdateObserver.js +24 -22
  144. package/plugins/filters/conditionUpdateObserver.mjs +24 -22
  145. package/plugins/filters/dataFilter.js +1 -1
  146. package/plugins/filters/dataFilter.mjs +1 -1
  147. package/plugins/filters/filters.js +95 -81
  148. package/plugins/filters/filters.mjs +95 -81
  149. package/plugins/filters/ui/input.js +19 -13
  150. package/plugins/filters/ui/input.mjs +19 -13
  151. package/plugins/filters/ui/link.js +13 -8
  152. package/plugins/filters/ui/link.mjs +13 -8
  153. package/plugins/filters/ui/multipleSelect.js +112 -85
  154. package/plugins/filters/ui/multipleSelect.mjs +112 -85
  155. package/plugins/filters/ui/radioInput.js +20 -12
  156. package/plugins/filters/ui/radioInput.mjs +20 -12
  157. package/plugins/filters/ui/select.js +72 -50
  158. package/plugins/filters/ui/select.mjs +71 -49
  159. package/plugins/formulas/formulas.js +326 -268
  160. package/plugins/formulas/formulas.mjs +327 -269
  161. package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
  162. package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
  163. package/plugins/formulas/indexSyncer/index.js +48 -25
  164. package/plugins/formulas/indexSyncer/index.mjs +48 -25
  165. package/plugins/hiddenColumns/hiddenColumns.js +83 -64
  166. package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
  167. package/plugins/hiddenRows/hiddenRows.js +82 -63
  168. package/plugins/hiddenRows/hiddenRows.mjs +82 -63
  169. package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
  170. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
  171. package/plugins/manualColumnMove/manualColumnMove.js +170 -126
  172. package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
  173. package/plugins/manualColumnResize/manualColumnResize.js +230 -169
  174. package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
  175. package/plugins/manualRowMove/manualRowMove.js +128 -99
  176. package/plugins/manualRowMove/manualRowMove.mjs +128 -99
  177. package/plugins/manualRowResize/manualRowResize.js +209 -150
  178. package/plugins/manualRowResize/manualRowResize.mjs +209 -150
  179. package/plugins/mergeCells/calculations/selection.js +71 -2
  180. package/plugins/mergeCells/calculations/selection.mjs +71 -2
  181. package/plugins/mergeCells/cellsCollection.js +1 -117
  182. package/plugins/mergeCells/cellsCollection.mjs +1 -117
  183. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
  184. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
  185. package/plugins/mergeCells/mergeCells.js +397 -499
  186. package/plugins/mergeCells/mergeCells.mjs +397 -499
  187. package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
  188. package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
  189. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
  190. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
  191. package/plugins/nestedHeaders/nestedHeaders.js +253 -205
  192. package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
  193. package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
  194. package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
  195. package/plugins/nestedHeaders/stateManager/index.js +41 -30
  196. package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
  197. package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
  198. package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
  199. package/plugins/nestedRows/data/dataManager.js +1 -1
  200. package/plugins/nestedRows/data/dataManager.mjs +1 -1
  201. package/plugins/nestedRows/nestedRows.js +182 -151
  202. package/plugins/nestedRows/nestedRows.mjs +183 -152
  203. package/plugins/nestedRows/ui/contextMenu.js +15 -11
  204. package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
  205. package/plugins/nestedRows/utils/rowMoveController.js +1 -1
  206. package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
  207. package/plugins/persistentState/storage.js +2 -2
  208. package/plugins/persistentState/storage.mjs +2 -2
  209. package/plugins/search/search.js +7 -7
  210. package/plugins/search/search.mjs +7 -7
  211. package/plugins/touchScroll/touchScroll.js +19 -15
  212. package/plugins/touchScroll/touchScroll.mjs +20 -16
  213. package/plugins/trimRows/trimRows.js +6 -6
  214. package/plugins/trimRows/trimRows.mjs +6 -6
  215. package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
  216. package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
  217. package/selection/highlight/highlight.js +14 -14
  218. package/selection/highlight/highlight.mjs +13 -13
  219. package/selection/highlight/visualSelection.js +0 -2
  220. package/selection/highlight/visualSelection.mjs +0 -2
  221. package/selection/selection.js +67 -225
  222. package/selection/selection.mjs +66 -224
  223. package/selection/transformation.js +118 -149
  224. package/selection/transformation.mjs +118 -149
  225. package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
  226. package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
  227. package/shortcutContexts/commands/editor/open.js +3 -18
  228. package/shortcutContexts/commands/editor/open.mjs +3 -18
  229. package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
  230. package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
  231. package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
  232. package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
  233. package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
  234. package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
  235. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
  236. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
  237. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
  238. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
  239. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
  240. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
  241. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
  242. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
  243. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
  244. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
  245. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
  246. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
  247. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
  248. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
  249. package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
  250. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
  251. package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
  252. package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
  253. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
  254. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
  255. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
  256. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
  257. package/shortcutContexts/grid.js +3 -9
  258. package/shortcutContexts/grid.mjs +3 -9
  259. package/shortcuts/context.js +1 -2
  260. package/shortcuts/context.mjs +1 -2
  261. package/tableView.js +78 -52
  262. package/tableView.mjs +78 -52
  263. package/translations/changesObservable/observable.js +38 -21
  264. package/translations/changesObservable/observable.mjs +38 -21
  265. package/translations/changesObservable/observer.js +12 -7
  266. package/translations/changesObservable/observer.mjs +11 -6
  267. package/translations/mapCollections/aggregatedCollection.js +1 -1
  268. package/translations/mapCollections/aggregatedCollection.mjs +1 -1
  269. package/translations/maps/indexMap.js +1 -1
  270. package/translations/maps/indexMap.mjs +1 -1
  271. package/utils/dataStructures/linkedList.js +1 -6
  272. package/utils/dataStructures/linkedList.mjs +1 -6
  273. package/utils/dataStructures/tree.js +1 -1
  274. package/utils/dataStructures/tree.mjs +1 -1
  275. package/utils/interval.js +44 -26
  276. package/utils/interval.mjs +44 -26
  277. package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
  278. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
  279. package/i18n/languages/ar-AR.d.ts +0 -5
  280. package/i18n/languages/cs-CZ.d.ts +0 -5
  281. package/i18n/languages/hr-HR.d.ts +0 -5
  282. package/i18n/languages/sr-SP.d.ts +0 -5
  283. package/plugins/mergeCells/focusOrder.js +0 -305
  284. package/plugins/mergeCells/focusOrder.mjs +0 -300
@@ -1,15 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- require("core-js/modules/es.error.cause.js");
5
4
  require("core-js/modules/es.array.push.js");
5
+ require("core-js/modules/es.error.cause.js");
6
6
  var _string = require("../../../helpers/string");
7
7
  var _moves = require("../../../helpers/moves");
8
8
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
9
9
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
10
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
11
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
12
- 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"); }
10
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
11
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
12
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
13
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
14
+ 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; } }
13
15
  /**
14
16
  * @private
15
17
  * @class IndexSyncer
@@ -34,52 +36,73 @@ class AxisSyncer {
34
36
  * @private
35
37
  * @type {'row'|'column'}
36
38
  */
37
- _classPrivateFieldInitSpec(this, _axis, void 0);
39
+ _classPrivateFieldInitSpec(this, _axis, {
40
+ writable: true,
41
+ value: void 0
42
+ });
38
43
  /**
39
44
  * Reference to index mapper.
40
45
  *
41
46
  * @private
42
47
  * @type {IndexMapper}
43
48
  */
44
- _classPrivateFieldInitSpec(this, _indexMapper, void 0);
49
+ _classPrivateFieldInitSpec(this, _indexMapper, {
50
+ writable: true,
51
+ value: void 0
52
+ });
45
53
  /**
46
54
  * The index synchronizer for both axis (is storing some more general information).
47
55
  *
48
56
  * @private
49
57
  * @type {IndexSyncer}
50
58
  */
51
- _classPrivateFieldInitSpec(this, _indexSyncer, void 0);
59
+ _classPrivateFieldInitSpec(this, _indexSyncer, {
60
+ writable: true,
61
+ value: void 0
62
+ });
52
63
  /**
53
64
  * Sequence of physical indexes stored for watching changes and calculating some transformations.
54
65
  *
55
66
  * @private
56
67
  * @type {Array<number>}
57
68
  */
58
- _classPrivateFieldInitSpec(this, _indexesSequence, []);
69
+ _classPrivateFieldInitSpec(this, _indexesSequence, {
70
+ writable: true,
71
+ value: []
72
+ });
59
73
  /**
60
74
  * List of moved HF indexes, stored before performing move on HOT to calculate transformation needed on HF's engine.
61
75
  *
62
76
  * @private
63
77
  * @type {Array<number>}
64
78
  */
65
- _classPrivateFieldInitSpec(this, _movedIndexes, []);
79
+ _classPrivateFieldInitSpec(this, _movedIndexes, {
80
+ writable: true,
81
+ value: []
82
+ });
66
83
  /**
67
84
  * Final HF's place where to move indexes, stored before performing move on HOT to calculate transformation needed on HF's engine.
68
85
  *
69
86
  * @private
70
87
  * @type {number|undefined}
71
88
  */
72
- _classPrivateFieldInitSpec(this, _finalIndex, void 0);
89
+ _classPrivateFieldInitSpec(this, _finalIndex, {
90
+ writable: true,
91
+ value: void 0
92
+ });
73
93
  /**
74
94
  * List of removed HF indexes, stored before performing removal on HOT to calculate transformation needed on HF's engine.
75
95
  *
76
96
  * @private
77
97
  * @type {Array<number>}
78
98
  */
79
- _classPrivateFieldInitSpec(this, _removedIndexes, []);
80
- _classPrivateFieldSet(_axis, this, axis);
81
- _classPrivateFieldSet(_indexMapper, this, indexMapper);
82
- _classPrivateFieldSet(_indexSyncer, this, indexSyncer);
99
+ _classPrivateFieldInitSpec(this, _removedIndexes, {
100
+ writable: true,
101
+ value: []
102
+ });
103
+ _classPrivateFieldSet(this, _axis, axis);
104
+ _classPrivateFieldSet(this, _indexMapper, indexMapper);
105
+ _classPrivateFieldSet(this, _indexSyncer, indexSyncer);
83
106
  }
84
107
 
85
108
  /**
@@ -89,11 +112,11 @@ class AxisSyncer {
89
112
  * @returns {Array<number>} List of removed visual indexes.
90
113
  */
91
114
  setRemovedHfIndexes(removedIndexes) {
92
- _classPrivateFieldSet(_removedIndexes, this, removedIndexes.map(physicalIndex => {
93
- const visualIndex = _classPrivateFieldGet(_indexMapper, this).getVisualFromPhysicalIndex(physicalIndex);
115
+ _classPrivateFieldSet(this, _removedIndexes, removedIndexes.map(physicalIndex => {
116
+ const visualIndex = _classPrivateFieldGet(this, _indexMapper).getVisualFromPhysicalIndex(physicalIndex);
94
117
  return this.getHfIndexFromVisualIndex(visualIndex);
95
118
  }));
96
- return _classPrivateFieldGet(_removedIndexes, this);
119
+ return _classPrivateFieldGet(this, _removedIndexes);
97
120
  }
98
121
 
99
122
  /**
@@ -102,7 +125,7 @@ class AxisSyncer {
102
125
  * @returns {Array<number>} List of removed HF indexes.
103
126
  */
104
127
  getRemovedHfIndexes() {
105
- return _classPrivateFieldGet(_removedIndexes, this);
128
+ return _classPrivateFieldGet(this, _removedIndexes);
106
129
  }
107
130
 
108
131
  /**
@@ -113,8 +136,8 @@ class AxisSyncer {
113
136
  * @returns {number}
114
137
  */
115
138
  getHfIndexFromVisualIndex(visualIndex) {
116
- const indexesSequence = _classPrivateFieldGet(_indexMapper, this).getIndexesSequence();
117
- const notTrimmedIndexes = _classPrivateFieldGet(_indexMapper, this).getNotTrimmedIndexes();
139
+ const indexesSequence = _classPrivateFieldGet(this, _indexMapper).getIndexesSequence();
140
+ const notTrimmedIndexes = _classPrivateFieldGet(this, _indexMapper).getNotTrimmedIndexes();
118
141
  return indexesSequence.indexOf(notTrimmedIndexes[visualIndex]);
119
142
  }
120
143
 
@@ -126,14 +149,14 @@ class AxisSyncer {
126
149
  */
127
150
  syncMoves(moves) {
128
151
  const NUMBER_OF_MOVED_INDEXES = 1;
129
- const SYNC_MOVE_METHOD_NAME = `move${(0, _string.toUpperCaseFirst)(_classPrivateFieldGet(_axis, this))}s`;
130
- _classPrivateFieldGet(_indexSyncer, this).getEngine().batch(() => {
152
+ const SYNC_MOVE_METHOD_NAME = `move${(0, _string.toUpperCaseFirst)(_classPrivateFieldGet(this, _axis))}s`;
153
+ _classPrivateFieldGet(this, _indexSyncer).getEngine().batch(() => {
131
154
  moves.forEach(move => {
132
155
  const moveToTheSamePosition = move.from !== move.to;
133
156
  // Moving from left to right (or top to bottom) to a line (drop index) right after already moved element.
134
157
  const anotherMoveWithoutEffect = move.from + 1 !== move.to;
135
158
  if (moveToTheSamePosition && anotherMoveWithoutEffect) {
136
- _classPrivateFieldGet(_indexSyncer, this).getEngine()[SYNC_MOVE_METHOD_NAME](_classPrivateFieldGet(_indexSyncer, this).getSheetId(), move.from, NUMBER_OF_MOVED_INDEXES, move.to);
159
+ _classPrivateFieldGet(this, _indexSyncer).getEngine()[SYNC_MOVE_METHOD_NAME](_classPrivateFieldGet(this, _indexSyncer).getSheetId(), move.from, NUMBER_OF_MOVED_INDEXES, move.to);
137
160
  }
138
161
  });
139
162
  });
@@ -150,8 +173,8 @@ class AxisSyncer {
150
173
  if (movePossible === false) {
151
174
  return;
152
175
  }
153
- _classPrivateFieldSet(_movedIndexes, this, movedVisualIndexes.map(index => this.getHfIndexFromVisualIndex(index)));
154
- _classPrivateFieldSet(_finalIndex, this, this.getHfIndexFromVisualIndex(visualFinalIndex));
176
+ _classPrivateFieldSet(this, _movedIndexes, movedVisualIndexes.map(index => this.getHfIndexFromVisualIndex(index)));
177
+ _classPrivateFieldSet(this, _finalIndex, this.getHfIndexFromVisualIndex(visualFinalIndex));
155
178
  }
156
179
 
157
180
  /**
@@ -161,15 +184,15 @@ class AxisSyncer {
161
184
  * @param {boolean} orderChanged Indicates if order of HOT indexes was changed by move.
162
185
  */
163
186
  calculateAndSyncMoves(movePossible, orderChanged) {
164
- if (_classPrivateFieldGet(_indexSyncer, this).isPerformingUndoRedo()) {
187
+ if (_classPrivateFieldGet(this, _indexSyncer).isPerformingUndoRedo()) {
165
188
  return;
166
189
  }
167
190
  if (movePossible === false || orderChanged === false) {
168
191
  return;
169
192
  }
170
- const calculatedMoves = (0, _moves.getMoves)(_classPrivateFieldGet(_movedIndexes, this), _classPrivateFieldGet(_finalIndex, this), _classPrivateFieldGet(_indexMapper, this).getNumberOfIndexes());
171
- if (_classPrivateFieldGet(_indexSyncer, this).getSheetId() === null) {
172
- _classPrivateFieldGet(_indexSyncer, this).getPostponeAction(() => this.syncMoves(calculatedMoves));
193
+ const calculatedMoves = (0, _moves.getMoves)(_classPrivateFieldGet(this, _movedIndexes), _classPrivateFieldGet(this, _finalIndex), _classPrivateFieldGet(this, _indexMapper).getNumberOfIndexes());
194
+ if (_classPrivateFieldGet(this, _indexSyncer).getSheetId() === null) {
195
+ _classPrivateFieldGet(this, _indexSyncer).getPostponeAction(() => this.syncMoves(calculatedMoves));
173
196
  } else {
174
197
  this.syncMoves(calculatedMoves);
175
198
  }
@@ -181,17 +204,17 @@ class AxisSyncer {
181
204
  * @returns {Function}
182
205
  */
183
206
  getIndexesChangeSyncMethod() {
184
- const SYNC_ORDER_CHANGE_METHOD_NAME = `set${(0, _string.toUpperCaseFirst)(_classPrivateFieldGet(_axis, this))}Order`;
207
+ const SYNC_ORDER_CHANGE_METHOD_NAME = `set${(0, _string.toUpperCaseFirst)(_classPrivateFieldGet(this, _axis))}Order`;
185
208
  return source => {
186
- if (_classPrivateFieldGet(_indexSyncer, this).isPerformingUndoRedo()) {
209
+ if (_classPrivateFieldGet(this, _indexSyncer).isPerformingUndoRedo()) {
187
210
  return;
188
211
  }
189
- const newSequence = _classPrivateFieldGet(_indexMapper, this).getIndexesSequence();
212
+ const newSequence = _classPrivateFieldGet(this, _indexMapper).getIndexesSequence();
190
213
  if (source === 'update' && newSequence.length > 0) {
191
- const relativeTransformation = _classPrivateFieldGet(_indexesSequence, this).map(index => newSequence.indexOf(index));
192
- const sheetDimensions = _classPrivateFieldGet(_indexSyncer, this).getEngine().getSheetDimensions(_classPrivateFieldGet(_indexSyncer, this).getSheetId());
214
+ const relativeTransformation = _classPrivateFieldGet(this, _indexesSequence).map(index => newSequence.indexOf(index));
215
+ const sheetDimensions = _classPrivateFieldGet(this, _indexSyncer).getEngine().getSheetDimensions(_classPrivateFieldGet(this, _indexSyncer).getSheetId());
193
216
  let sizeForAxis;
194
- if (_classPrivateFieldGet(_axis, this) === 'row') {
217
+ if (_classPrivateFieldGet(this, _axis) === 'row') {
195
218
  sizeForAxis = sheetDimensions.height;
196
219
  } else {
197
220
  sizeForAxis = sheetDimensions.width;
@@ -204,9 +227,9 @@ class AxisSyncer {
204
227
  for (let i = numberOfReorganisedIndexes; i < sizeForAxis; i += 1) {
205
228
  relativeTransformation.push(i);
206
229
  }
207
- _classPrivateFieldGet(_indexSyncer, this).getEngine()[SYNC_ORDER_CHANGE_METHOD_NAME](_classPrivateFieldGet(_indexSyncer, this).getSheetId(), relativeTransformation);
230
+ _classPrivateFieldGet(this, _indexSyncer).getEngine()[SYNC_ORDER_CHANGE_METHOD_NAME](_classPrivateFieldGet(this, _indexSyncer).getSheetId(), relativeTransformation);
208
231
  }
209
- _classPrivateFieldSet(_indexesSequence, this, newSequence);
232
+ _classPrivateFieldSet(this, _indexesSequence, newSequence);
210
233
  };
211
234
  }
212
235
 
@@ -214,7 +237,7 @@ class AxisSyncer {
214
237
  * Initialize the AxisSyncer.
215
238
  */
216
239
  init() {
217
- _classPrivateFieldSet(_indexesSequence, this, _classPrivateFieldGet(_indexMapper, this).getIndexesSequence());
240
+ _classPrivateFieldSet(this, _indexesSequence, _classPrivateFieldGet(this, _indexMapper).getIndexesSequence());
218
241
  }
219
242
  }
220
243
  var _default = exports.default = AxisSyncer;
@@ -1,10 +1,12 @@
1
- import "core-js/modules/es.error.cause.js";
2
1
  import "core-js/modules/es.array.push.js";
2
+ import "core-js/modules/es.error.cause.js";
3
3
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
4
4
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
5
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
6
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
7
- 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"); }
5
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
6
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
7
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
8
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
9
+ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
8
10
  import { toUpperCaseFirst } from "../../../helpers/string.mjs";
9
11
  import { getMoves } from "../../../helpers/moves.mjs";
10
12
  /**
@@ -31,52 +33,73 @@ class AxisSyncer {
31
33
  * @private
32
34
  * @type {'row'|'column'}
33
35
  */
34
- _classPrivateFieldInitSpec(this, _axis, void 0);
36
+ _classPrivateFieldInitSpec(this, _axis, {
37
+ writable: true,
38
+ value: void 0
39
+ });
35
40
  /**
36
41
  * Reference to index mapper.
37
42
  *
38
43
  * @private
39
44
  * @type {IndexMapper}
40
45
  */
41
- _classPrivateFieldInitSpec(this, _indexMapper, void 0);
46
+ _classPrivateFieldInitSpec(this, _indexMapper, {
47
+ writable: true,
48
+ value: void 0
49
+ });
42
50
  /**
43
51
  * The index synchronizer for both axis (is storing some more general information).
44
52
  *
45
53
  * @private
46
54
  * @type {IndexSyncer}
47
55
  */
48
- _classPrivateFieldInitSpec(this, _indexSyncer, void 0);
56
+ _classPrivateFieldInitSpec(this, _indexSyncer, {
57
+ writable: true,
58
+ value: void 0
59
+ });
49
60
  /**
50
61
  * Sequence of physical indexes stored for watching changes and calculating some transformations.
51
62
  *
52
63
  * @private
53
64
  * @type {Array<number>}
54
65
  */
55
- _classPrivateFieldInitSpec(this, _indexesSequence, []);
66
+ _classPrivateFieldInitSpec(this, _indexesSequence, {
67
+ writable: true,
68
+ value: []
69
+ });
56
70
  /**
57
71
  * List of moved HF indexes, stored before performing move on HOT to calculate transformation needed on HF's engine.
58
72
  *
59
73
  * @private
60
74
  * @type {Array<number>}
61
75
  */
62
- _classPrivateFieldInitSpec(this, _movedIndexes, []);
76
+ _classPrivateFieldInitSpec(this, _movedIndexes, {
77
+ writable: true,
78
+ value: []
79
+ });
63
80
  /**
64
81
  * Final HF's place where to move indexes, stored before performing move on HOT to calculate transformation needed on HF's engine.
65
82
  *
66
83
  * @private
67
84
  * @type {number|undefined}
68
85
  */
69
- _classPrivateFieldInitSpec(this, _finalIndex, void 0);
86
+ _classPrivateFieldInitSpec(this, _finalIndex, {
87
+ writable: true,
88
+ value: void 0
89
+ });
70
90
  /**
71
91
  * List of removed HF indexes, stored before performing removal on HOT to calculate transformation needed on HF's engine.
72
92
  *
73
93
  * @private
74
94
  * @type {Array<number>}
75
95
  */
76
- _classPrivateFieldInitSpec(this, _removedIndexes, []);
77
- _classPrivateFieldSet(_axis, this, axis);
78
- _classPrivateFieldSet(_indexMapper, this, indexMapper);
79
- _classPrivateFieldSet(_indexSyncer, this, indexSyncer);
96
+ _classPrivateFieldInitSpec(this, _removedIndexes, {
97
+ writable: true,
98
+ value: []
99
+ });
100
+ _classPrivateFieldSet(this, _axis, axis);
101
+ _classPrivateFieldSet(this, _indexMapper, indexMapper);
102
+ _classPrivateFieldSet(this, _indexSyncer, indexSyncer);
80
103
  }
81
104
 
82
105
  /**
@@ -86,11 +109,11 @@ class AxisSyncer {
86
109
  * @returns {Array<number>} List of removed visual indexes.
87
110
  */
88
111
  setRemovedHfIndexes(removedIndexes) {
89
- _classPrivateFieldSet(_removedIndexes, this, removedIndexes.map(physicalIndex => {
90
- const visualIndex = _classPrivateFieldGet(_indexMapper, this).getVisualFromPhysicalIndex(physicalIndex);
112
+ _classPrivateFieldSet(this, _removedIndexes, removedIndexes.map(physicalIndex => {
113
+ const visualIndex = _classPrivateFieldGet(this, _indexMapper).getVisualFromPhysicalIndex(physicalIndex);
91
114
  return this.getHfIndexFromVisualIndex(visualIndex);
92
115
  }));
93
- return _classPrivateFieldGet(_removedIndexes, this);
116
+ return _classPrivateFieldGet(this, _removedIndexes);
94
117
  }
95
118
 
96
119
  /**
@@ -99,7 +122,7 @@ class AxisSyncer {
99
122
  * @returns {Array<number>} List of removed HF indexes.
100
123
  */
101
124
  getRemovedHfIndexes() {
102
- return _classPrivateFieldGet(_removedIndexes, this);
125
+ return _classPrivateFieldGet(this, _removedIndexes);
103
126
  }
104
127
 
105
128
  /**
@@ -110,8 +133,8 @@ class AxisSyncer {
110
133
  * @returns {number}
111
134
  */
112
135
  getHfIndexFromVisualIndex(visualIndex) {
113
- const indexesSequence = _classPrivateFieldGet(_indexMapper, this).getIndexesSequence();
114
- const notTrimmedIndexes = _classPrivateFieldGet(_indexMapper, this).getNotTrimmedIndexes();
136
+ const indexesSequence = _classPrivateFieldGet(this, _indexMapper).getIndexesSequence();
137
+ const notTrimmedIndexes = _classPrivateFieldGet(this, _indexMapper).getNotTrimmedIndexes();
115
138
  return indexesSequence.indexOf(notTrimmedIndexes[visualIndex]);
116
139
  }
117
140
 
@@ -123,14 +146,14 @@ class AxisSyncer {
123
146
  */
124
147
  syncMoves(moves) {
125
148
  const NUMBER_OF_MOVED_INDEXES = 1;
126
- const SYNC_MOVE_METHOD_NAME = `move${toUpperCaseFirst(_classPrivateFieldGet(_axis, this))}s`;
127
- _classPrivateFieldGet(_indexSyncer, this).getEngine().batch(() => {
149
+ const SYNC_MOVE_METHOD_NAME = `move${toUpperCaseFirst(_classPrivateFieldGet(this, _axis))}s`;
150
+ _classPrivateFieldGet(this, _indexSyncer).getEngine().batch(() => {
128
151
  moves.forEach(move => {
129
152
  const moveToTheSamePosition = move.from !== move.to;
130
153
  // Moving from left to right (or top to bottom) to a line (drop index) right after already moved element.
131
154
  const anotherMoveWithoutEffect = move.from + 1 !== move.to;
132
155
  if (moveToTheSamePosition && anotherMoveWithoutEffect) {
133
- _classPrivateFieldGet(_indexSyncer, this).getEngine()[SYNC_MOVE_METHOD_NAME](_classPrivateFieldGet(_indexSyncer, this).getSheetId(), move.from, NUMBER_OF_MOVED_INDEXES, move.to);
156
+ _classPrivateFieldGet(this, _indexSyncer).getEngine()[SYNC_MOVE_METHOD_NAME](_classPrivateFieldGet(this, _indexSyncer).getSheetId(), move.from, NUMBER_OF_MOVED_INDEXES, move.to);
134
157
  }
135
158
  });
136
159
  });
@@ -147,8 +170,8 @@ class AxisSyncer {
147
170
  if (movePossible === false) {
148
171
  return;
149
172
  }
150
- _classPrivateFieldSet(_movedIndexes, this, movedVisualIndexes.map(index => this.getHfIndexFromVisualIndex(index)));
151
- _classPrivateFieldSet(_finalIndex, this, this.getHfIndexFromVisualIndex(visualFinalIndex));
173
+ _classPrivateFieldSet(this, _movedIndexes, movedVisualIndexes.map(index => this.getHfIndexFromVisualIndex(index)));
174
+ _classPrivateFieldSet(this, _finalIndex, this.getHfIndexFromVisualIndex(visualFinalIndex));
152
175
  }
153
176
 
154
177
  /**
@@ -158,15 +181,15 @@ class AxisSyncer {
158
181
  * @param {boolean} orderChanged Indicates if order of HOT indexes was changed by move.
159
182
  */
160
183
  calculateAndSyncMoves(movePossible, orderChanged) {
161
- if (_classPrivateFieldGet(_indexSyncer, this).isPerformingUndoRedo()) {
184
+ if (_classPrivateFieldGet(this, _indexSyncer).isPerformingUndoRedo()) {
162
185
  return;
163
186
  }
164
187
  if (movePossible === false || orderChanged === false) {
165
188
  return;
166
189
  }
167
- const calculatedMoves = getMoves(_classPrivateFieldGet(_movedIndexes, this), _classPrivateFieldGet(_finalIndex, this), _classPrivateFieldGet(_indexMapper, this).getNumberOfIndexes());
168
- if (_classPrivateFieldGet(_indexSyncer, this).getSheetId() === null) {
169
- _classPrivateFieldGet(_indexSyncer, this).getPostponeAction(() => this.syncMoves(calculatedMoves));
190
+ const calculatedMoves = getMoves(_classPrivateFieldGet(this, _movedIndexes), _classPrivateFieldGet(this, _finalIndex), _classPrivateFieldGet(this, _indexMapper).getNumberOfIndexes());
191
+ if (_classPrivateFieldGet(this, _indexSyncer).getSheetId() === null) {
192
+ _classPrivateFieldGet(this, _indexSyncer).getPostponeAction(() => this.syncMoves(calculatedMoves));
170
193
  } else {
171
194
  this.syncMoves(calculatedMoves);
172
195
  }
@@ -178,17 +201,17 @@ class AxisSyncer {
178
201
  * @returns {Function}
179
202
  */
180
203
  getIndexesChangeSyncMethod() {
181
- const SYNC_ORDER_CHANGE_METHOD_NAME = `set${toUpperCaseFirst(_classPrivateFieldGet(_axis, this))}Order`;
204
+ const SYNC_ORDER_CHANGE_METHOD_NAME = `set${toUpperCaseFirst(_classPrivateFieldGet(this, _axis))}Order`;
182
205
  return source => {
183
- if (_classPrivateFieldGet(_indexSyncer, this).isPerformingUndoRedo()) {
206
+ if (_classPrivateFieldGet(this, _indexSyncer).isPerformingUndoRedo()) {
184
207
  return;
185
208
  }
186
- const newSequence = _classPrivateFieldGet(_indexMapper, this).getIndexesSequence();
209
+ const newSequence = _classPrivateFieldGet(this, _indexMapper).getIndexesSequence();
187
210
  if (source === 'update' && newSequence.length > 0) {
188
- const relativeTransformation = _classPrivateFieldGet(_indexesSequence, this).map(index => newSequence.indexOf(index));
189
- const sheetDimensions = _classPrivateFieldGet(_indexSyncer, this).getEngine().getSheetDimensions(_classPrivateFieldGet(_indexSyncer, this).getSheetId());
211
+ const relativeTransformation = _classPrivateFieldGet(this, _indexesSequence).map(index => newSequence.indexOf(index));
212
+ const sheetDimensions = _classPrivateFieldGet(this, _indexSyncer).getEngine().getSheetDimensions(_classPrivateFieldGet(this, _indexSyncer).getSheetId());
190
213
  let sizeForAxis;
191
- if (_classPrivateFieldGet(_axis, this) === 'row') {
214
+ if (_classPrivateFieldGet(this, _axis) === 'row') {
192
215
  sizeForAxis = sheetDimensions.height;
193
216
  } else {
194
217
  sizeForAxis = sheetDimensions.width;
@@ -201,9 +224,9 @@ class AxisSyncer {
201
224
  for (let i = numberOfReorganisedIndexes; i < sizeForAxis; i += 1) {
202
225
  relativeTransformation.push(i);
203
226
  }
204
- _classPrivateFieldGet(_indexSyncer, this).getEngine()[SYNC_ORDER_CHANGE_METHOD_NAME](_classPrivateFieldGet(_indexSyncer, this).getSheetId(), relativeTransformation);
227
+ _classPrivateFieldGet(this, _indexSyncer).getEngine()[SYNC_ORDER_CHANGE_METHOD_NAME](_classPrivateFieldGet(this, _indexSyncer).getSheetId(), relativeTransformation);
205
228
  }
206
- _classPrivateFieldSet(_indexesSequence, this, newSequence);
229
+ _classPrivateFieldSet(this, _indexesSequence, newSequence);
207
230
  };
208
231
  }
209
232
 
@@ -211,7 +234,7 @@ class AxisSyncer {
211
234
  * Initialize the AxisSyncer.
212
235
  */
213
236
  init() {
214
- _classPrivateFieldSet(_indexesSequence, this, _classPrivateFieldGet(_indexMapper, this).getIndexesSequence());
237
+ _classPrivateFieldSet(this, _indexesSequence, _classPrivateFieldGet(this, _indexMapper).getIndexesSequence());
215
238
  }
216
239
  }
217
240
  export default AxisSyncer;
@@ -6,9 +6,11 @@ var _axisSyncer = _interopRequireDefault(require("./axisSyncer"));
6
6
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7
7
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
8
8
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
9
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
10
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
11
- 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"); }
9
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
10
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
11
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
12
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
13
+ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
12
14
  /**
13
15
  * @private
14
16
  * @class IndexSyncer
@@ -33,52 +35,73 @@ class IndexSyncer {
33
35
  * @private
34
36
  * @type {AxisSyncer}
35
37
  */
36
- _classPrivateFieldInitSpec(this, _rowIndexSyncer, void 0);
38
+ _classPrivateFieldInitSpec(this, _rowIndexSyncer, {
39
+ writable: true,
40
+ value: void 0
41
+ });
37
42
  /**
38
43
  * Indexes synchronizer for the axis of the columns.
39
44
  *
40
45
  * @private
41
46
  * @type {AxisSyncer}
42
47
  */
43
- _classPrivateFieldInitSpec(this, _columnIndexSyncer, void 0);
48
+ _classPrivateFieldInitSpec(this, _columnIndexSyncer, {
49
+ writable: true,
50
+ value: void 0
51
+ });
44
52
  /**
45
53
  * Method which will postpone execution of some action (needed when synchronization endpoint isn't setup yet).
46
54
  *
47
55
  * @private
48
56
  * @type {Function}
49
57
  */
50
- _classPrivateFieldInitSpec(this, _postponeAction, void 0);
58
+ _classPrivateFieldInitSpec(this, _postponeAction, {
59
+ writable: true,
60
+ value: void 0
61
+ });
51
62
  /**
52
63
  * Flag informing whether undo is already performed (we don't perform synchronization in such case).
53
64
  *
54
65
  * @private
55
66
  * @type {boolean}
56
67
  */
57
- _classPrivateFieldInitSpec(this, _isPerformingUndo, false);
68
+ _classPrivateFieldInitSpec(this, _isPerformingUndo, {
69
+ writable: true,
70
+ value: false
71
+ });
58
72
  /**
59
73
  * Flag informing whether redo is already performed (we don't perform synchronization in such case).
60
74
  *
61
75
  * @private
62
76
  * @type {boolean}
63
77
  */
64
- _classPrivateFieldInitSpec(this, _isPerformingRedo, false);
78
+ _classPrivateFieldInitSpec(this, _isPerformingRedo, {
79
+ writable: true,
80
+ value: false
81
+ });
65
82
  /**
66
83
  * The HF's engine instance which will be synced.
67
84
  *
68
85
  * @private
69
86
  * @type {HyperFormula|null}
70
87
  */
71
- _classPrivateFieldInitSpec(this, _engine, null);
88
+ _classPrivateFieldInitSpec(this, _engine, {
89
+ writable: true,
90
+ value: null
91
+ });
72
92
  /**
73
93
  * HyperFormula's sheet name.
74
94
  *
75
95
  * @private
76
96
  * @type {string|null}
77
97
  */
78
- _classPrivateFieldInitSpec(this, _sheetId, null);
79
- _classPrivateFieldSet(_rowIndexSyncer, this, new _axisSyncer.default('row', rowIndexMapper, this));
80
- _classPrivateFieldSet(_columnIndexSyncer, this, new _axisSyncer.default('column', columnIndexMapper, this));
81
- _classPrivateFieldSet(_postponeAction, this, postponeAction);
98
+ _classPrivateFieldInitSpec(this, _sheetId, {
99
+ writable: true,
100
+ value: null
101
+ });
102
+ _classPrivateFieldSet(this, _rowIndexSyncer, new _axisSyncer.default('row', rowIndexMapper, this));
103
+ _classPrivateFieldSet(this, _columnIndexSyncer, new _axisSyncer.default('column', columnIndexMapper, this));
104
+ _classPrivateFieldSet(this, _postponeAction, postponeAction);
82
105
  }
83
106
 
84
107
  /**
@@ -89,9 +112,9 @@ class IndexSyncer {
89
112
  */
90
113
  getForAxis(indexType) {
91
114
  if (indexType === 'row') {
92
- return _classPrivateFieldGet(_rowIndexSyncer, this);
115
+ return _classPrivateFieldGet(this, _rowIndexSyncer);
93
116
  }
94
- return _classPrivateFieldGet(_columnIndexSyncer, this);
117
+ return _classPrivateFieldGet(this, _columnIndexSyncer);
95
118
  }
96
119
 
97
120
  /**
@@ -100,7 +123,7 @@ class IndexSyncer {
100
123
  * @param {boolean} flagValue Boolean value for the flag.
101
124
  */
102
125
  setPerformUndo(flagValue) {
103
- _classPrivateFieldSet(_isPerformingUndo, this, flagValue);
126
+ _classPrivateFieldSet(this, _isPerformingUndo, flagValue);
104
127
  }
105
128
 
106
129
  /**
@@ -109,7 +132,7 @@ class IndexSyncer {
109
132
  * @param {boolean} flagValue Boolean value for the flag.
110
133
  */
111
134
  setPerformRedo(flagValue) {
112
- _classPrivateFieldSet(_isPerformingRedo, this, flagValue);
135
+ _classPrivateFieldSet(this, _isPerformingRedo, flagValue);
113
136
  }
114
137
 
115
138
  /**
@@ -119,7 +142,7 @@ class IndexSyncer {
119
142
  * @returns {boolean}
120
143
  */
121
144
  isPerformingUndoRedo() {
122
- return _classPrivateFieldGet(_isPerformingUndo, this) || _classPrivateFieldGet(_isPerformingRedo, this);
145
+ return _classPrivateFieldGet(this, _isPerformingUndo) || _classPrivateFieldGet(this, _isPerformingRedo);
123
146
  }
124
147
 
125
148
  /**
@@ -128,7 +151,7 @@ class IndexSyncer {
128
151
  * @returns {string|null}
129
152
  */
130
153
  getSheetId() {
131
- return _classPrivateFieldGet(_sheetId, this);
154
+ return _classPrivateFieldGet(this, _sheetId);
132
155
  }
133
156
 
134
157
  /**
@@ -137,7 +160,7 @@ class IndexSyncer {
137
160
  * @type {HyperFormula|null}
138
161
  */
139
162
  getEngine() {
140
- return _classPrivateFieldGet(_engine, this);
163
+ return _classPrivateFieldGet(this, _engine);
141
164
  }
142
165
 
143
166
  /**
@@ -146,7 +169,7 @@ class IndexSyncer {
146
169
  * @returns {Function}
147
170
  */
148
171
  getPostponeAction() {
149
- return _classPrivateFieldGet(_postponeAction, this);
172
+ return _classPrivateFieldGet(this, _postponeAction);
150
173
  }
151
174
 
152
175
  /**
@@ -156,10 +179,10 @@ class IndexSyncer {
156
179
  * @param {string|null} sheetId HyperFormula's sheet name.
157
180
  */
158
181
  setupSyncEndpoint(engine, sheetId) {
159
- _classPrivateFieldSet(_engine, this, engine);
160
- _classPrivateFieldSet(_sheetId, this, sheetId);
161
- _classPrivateFieldGet(_rowIndexSyncer, this).init();
162
- _classPrivateFieldGet(_columnIndexSyncer, this).init();
182
+ _classPrivateFieldSet(this, _engine, engine);
183
+ _classPrivateFieldSet(this, _sheetId, sheetId);
184
+ _classPrivateFieldGet(this, _rowIndexSyncer).init();
185
+ _classPrivateFieldGet(this, _columnIndexSyncer).init();
163
186
  }
164
187
  }
165
188
  var _default = exports.default = IndexSyncer;