handsontable 0.0.0-next-bfb0e3a-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 (280) 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/overlays.js +1 -1
  15. package/3rdparty/walkontable/src/overlays.mjs +1 -1
  16. package/3rdparty/walkontable/src/scroll.js +17 -15
  17. package/3rdparty/walkontable/src/scroll.mjs +17 -15
  18. package/3rdparty/walkontable/src/selection/manager.js +69 -48
  19. package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
  20. package/3rdparty/walkontable/src/selection/scanner.js +42 -33
  21. package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
  22. package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
  23. package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
  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 -77
  32. package/core.mjs +22 -77
  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/metaManager/metaSchema.js +1 -1
  38. package/dataMap/metaManager/metaSchema.mjs +1 -1
  39. package/dataMap/replaceData.js +1 -1
  40. package/dataMap/replaceData.mjs +1 -1
  41. package/dist/handsontable.css +4 -4
  42. package/dist/handsontable.full.css +4 -4
  43. package/dist/handsontable.full.js +9117 -8969
  44. package/dist/handsontable.full.min.css +3 -3
  45. package/dist/handsontable.full.min.js +292 -292
  46. package/dist/handsontable.js +6569 -6874
  47. package/dist/handsontable.min.css +3 -3
  48. package/dist/handsontable.min.js +25 -25
  49. package/dist/languages/all.min.js +1 -1
  50. package/dist/languages/ar-AR.min.js +1 -1
  51. package/dist/languages/cs-CZ.min.js +1 -1
  52. package/dist/languages/de-CH.min.js +1 -1
  53. package/dist/languages/de-DE.min.js +1 -1
  54. package/dist/languages/en-US.min.js +1 -1
  55. package/dist/languages/es-MX.min.js +1 -1
  56. package/dist/languages/fr-FR.min.js +1 -1
  57. package/dist/languages/hr-HR.min.js +1 -1
  58. package/dist/languages/it-IT.min.js +1 -1
  59. package/dist/languages/ja-JP.min.js +1 -1
  60. package/dist/languages/ko-KR.min.js +1 -1
  61. package/dist/languages/lv-LV.min.js +1 -1
  62. package/dist/languages/nb-NO.min.js +1 -1
  63. package/dist/languages/nl-NL.min.js +1 -1
  64. package/dist/languages/pl-PL.min.js +1 -1
  65. package/dist/languages/pt-BR.min.js +1 -1
  66. package/dist/languages/ru-RU.min.js +1 -1
  67. package/dist/languages/sr-SP.min.js +1 -1
  68. package/dist/languages/zh-CN.min.js +1 -1
  69. package/dist/languages/zh-TW.min.js +1 -1
  70. package/editorManager.js +23 -25
  71. package/editorManager.mjs +23 -25
  72. package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
  73. package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
  74. package/editors/selectEditor/selectEditor.js +19 -20
  75. package/editors/selectEditor/selectEditor.mjs +19 -20
  76. package/eventManager.js +1 -1
  77. package/eventManager.mjs +1 -1
  78. package/focusManager.js +82 -64
  79. package/focusManager.mjs +82 -64
  80. package/helpers/dom/element.js +1 -1
  81. package/helpers/dom/element.mjs +1 -1
  82. package/helpers/mixed.js +1 -1
  83. package/helpers/mixed.mjs +1 -1
  84. package/helpers/object.js +2 -2
  85. package/helpers/object.mjs +2 -2
  86. package/index.d.ts +0 -10
  87. package/package.json +2 -7
  88. package/pluginHooks.d.ts +3 -4
  89. package/pluginHooks.js +38 -99
  90. package/pluginHooks.mjs +38 -99
  91. package/plugins/autoColumnSize/autoColumnSize.js +65 -49
  92. package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
  93. package/plugins/autoRowSize/autoRowSize.js +34 -28
  94. package/plugins/autoRowSize/autoRowSize.mjs +34 -28
  95. package/plugins/autofill/autofill.js +38 -30
  96. package/plugins/autofill/autofill.mjs +38 -30
  97. package/plugins/base/base.js +17 -12
  98. package/plugins/base/base.mjs +17 -12
  99. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
  100. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
  101. package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
  102. package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
  103. package/plugins/columnSorting/columnSorting.js +45 -49
  104. package/plugins/columnSorting/columnSorting.mjs +45 -49
  105. package/plugins/columnSummary/columnSummary.js +26 -22
  106. package/plugins/columnSummary/columnSummary.mjs +26 -22
  107. package/plugins/comments/comments.js +158 -116
  108. package/plugins/comments/comments.mjs +158 -116
  109. package/plugins/contextMenu/contextMenu.js +26 -20
  110. package/plugins/contextMenu/contextMenu.mjs +26 -20
  111. package/plugins/contextMenu/itemsFactory.js +1 -1
  112. package/plugins/contextMenu/itemsFactory.mjs +1 -1
  113. package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
  114. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
  115. package/plugins/contextMenu/menu/menu.js +21 -13
  116. package/plugins/contextMenu/menu/menu.mjs +21 -13
  117. package/plugins/contextMenu/menu/positioner.js +58 -41
  118. package/plugins/contextMenu/menu/positioner.mjs +58 -41
  119. package/plugins/copyPaste/copyPaste.js +157 -116
  120. package/plugins/copyPaste/copyPaste.mjs +157 -116
  121. package/plugins/copyPaste/copyableRanges.js +66 -43
  122. package/plugins/copyPaste/copyableRanges.mjs +66 -43
  123. package/plugins/customBorders/customBorders.js +13 -11
  124. package/plugins/customBorders/customBorders.mjs +13 -11
  125. package/plugins/dragToScroll/dragToScroll.js +6 -6
  126. package/plugins/dragToScroll/dragToScroll.mjs +6 -6
  127. package/plugins/dropdownMenu/dropdownMenu.js +106 -80
  128. package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
  129. package/plugins/exportFile/dataProvider.js +1 -1
  130. package/plugins/exportFile/dataProvider.mjs +1 -1
  131. package/plugins/filters/component/actionBar.js +9 -9
  132. package/plugins/filters/component/actionBar.mjs +8 -8
  133. package/plugins/filters/component/condition.js +15 -13
  134. package/plugins/filters/component/condition.mjs +15 -13
  135. package/plugins/filters/component/operators.js +6 -6
  136. package/plugins/filters/component/operators.mjs +6 -6
  137. package/plugins/filters/component/value.js +28 -24
  138. package/plugins/filters/component/value.mjs +28 -24
  139. package/plugins/filters/conditionUpdateObserver.js +24 -22
  140. package/plugins/filters/conditionUpdateObserver.mjs +24 -22
  141. package/plugins/filters/dataFilter.js +1 -1
  142. package/plugins/filters/dataFilter.mjs +1 -1
  143. package/plugins/filters/filters.js +95 -81
  144. package/plugins/filters/filters.mjs +95 -81
  145. package/plugins/filters/ui/input.js +19 -13
  146. package/plugins/filters/ui/input.mjs +19 -13
  147. package/plugins/filters/ui/link.js +13 -8
  148. package/plugins/filters/ui/link.mjs +13 -8
  149. package/plugins/filters/ui/multipleSelect.js +112 -85
  150. package/plugins/filters/ui/multipleSelect.mjs +112 -85
  151. package/plugins/filters/ui/radioInput.js +20 -12
  152. package/plugins/filters/ui/radioInput.mjs +20 -12
  153. package/plugins/filters/ui/select.js +72 -50
  154. package/plugins/filters/ui/select.mjs +71 -49
  155. package/plugins/formulas/formulas.js +326 -268
  156. package/plugins/formulas/formulas.mjs +327 -269
  157. package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
  158. package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
  159. package/plugins/formulas/indexSyncer/index.js +48 -25
  160. package/plugins/formulas/indexSyncer/index.mjs +48 -25
  161. package/plugins/hiddenColumns/hiddenColumns.js +83 -64
  162. package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
  163. package/plugins/hiddenRows/hiddenRows.js +82 -63
  164. package/plugins/hiddenRows/hiddenRows.mjs +82 -63
  165. package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
  166. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
  167. package/plugins/manualColumnMove/manualColumnMove.js +170 -126
  168. package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
  169. package/plugins/manualColumnResize/manualColumnResize.js +230 -169
  170. package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
  171. package/plugins/manualRowMove/manualRowMove.js +128 -99
  172. package/plugins/manualRowMove/manualRowMove.mjs +128 -99
  173. package/plugins/manualRowResize/manualRowResize.js +209 -150
  174. package/plugins/manualRowResize/manualRowResize.mjs +209 -150
  175. package/plugins/mergeCells/calculations/selection.js +71 -2
  176. package/plugins/mergeCells/calculations/selection.mjs +71 -2
  177. package/plugins/mergeCells/cellsCollection.js +1 -117
  178. package/plugins/mergeCells/cellsCollection.mjs +1 -117
  179. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
  180. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
  181. package/plugins/mergeCells/mergeCells.js +397 -499
  182. package/plugins/mergeCells/mergeCells.mjs +397 -499
  183. package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
  184. package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
  185. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
  186. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
  187. package/plugins/nestedHeaders/nestedHeaders.js +253 -205
  188. package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
  189. package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
  190. package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
  191. package/plugins/nestedHeaders/stateManager/index.js +41 -30
  192. package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
  193. package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
  194. package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
  195. package/plugins/nestedRows/data/dataManager.js +1 -1
  196. package/plugins/nestedRows/data/dataManager.mjs +1 -1
  197. package/plugins/nestedRows/nestedRows.js +182 -151
  198. package/plugins/nestedRows/nestedRows.mjs +183 -152
  199. package/plugins/nestedRows/ui/contextMenu.js +15 -11
  200. package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
  201. package/plugins/nestedRows/utils/rowMoveController.js +1 -1
  202. package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
  203. package/plugins/persistentState/storage.js +2 -2
  204. package/plugins/persistentState/storage.mjs +2 -2
  205. package/plugins/search/search.js +7 -7
  206. package/plugins/search/search.mjs +7 -7
  207. package/plugins/touchScroll/touchScroll.js +19 -15
  208. package/plugins/touchScroll/touchScroll.mjs +20 -16
  209. package/plugins/trimRows/trimRows.js +6 -6
  210. package/plugins/trimRows/trimRows.mjs +6 -6
  211. package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
  212. package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
  213. package/selection/highlight/highlight.js +14 -14
  214. package/selection/highlight/highlight.mjs +13 -13
  215. package/selection/highlight/visualSelection.js +0 -2
  216. package/selection/highlight/visualSelection.mjs +0 -2
  217. package/selection/selection.js +67 -225
  218. package/selection/selection.mjs +66 -224
  219. package/selection/transformation.js +118 -149
  220. package/selection/transformation.mjs +118 -149
  221. package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
  222. package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
  223. package/shortcutContexts/commands/editor/open.js +3 -18
  224. package/shortcutContexts/commands/editor/open.mjs +3 -18
  225. package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
  226. package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
  227. package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
  228. package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
  229. package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
  230. package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
  231. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
  232. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
  233. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
  234. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
  235. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
  236. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
  237. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
  238. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
  239. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
  240. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
  241. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
  242. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
  243. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
  244. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
  245. package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
  246. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
  247. package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
  248. package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
  249. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
  250. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
  251. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
  252. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
  253. package/shortcutContexts/grid.js +3 -9
  254. package/shortcutContexts/grid.mjs +3 -9
  255. package/shortcuts/context.js +1 -2
  256. package/shortcuts/context.mjs +1 -2
  257. package/tableView.js +78 -52
  258. package/tableView.mjs +78 -52
  259. package/translations/changesObservable/observable.js +38 -21
  260. package/translations/changesObservable/observable.mjs +38 -21
  261. package/translations/changesObservable/observer.js +12 -7
  262. package/translations/changesObservable/observer.mjs +11 -6
  263. package/translations/mapCollections/aggregatedCollection.js +1 -1
  264. package/translations/mapCollections/aggregatedCollection.mjs +1 -1
  265. package/translations/maps/indexMap.js +1 -1
  266. package/translations/maps/indexMap.mjs +1 -1
  267. package/utils/dataStructures/linkedList.js +1 -6
  268. package/utils/dataStructures/linkedList.mjs +1 -6
  269. package/utils/dataStructures/tree.js +1 -1
  270. package/utils/dataStructures/tree.mjs +1 -1
  271. package/utils/interval.js +44 -26
  272. package/utils/interval.mjs +44 -26
  273. package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
  274. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
  275. package/i18n/languages/ar-AR.d.ts +0 -5
  276. package/i18n/languages/cs-CZ.d.ts +0 -5
  277. package/i18n/languages/hr-HR.d.ts +0 -5
  278. package/i18n/languages/sr-SP.d.ts +0 -5
  279. package/plugins/mergeCells/focusOrder.js +0 -305
  280. package/plugins/mergeCells/focusOrder.mjs +0 -300
package/tableView.mjs CHANGED
@@ -1,14 +1,17 @@
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 _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
4
4
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
5
5
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
6
6
  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; }
7
7
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
8
8
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
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 _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
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; } }
12
15
  import { addClass, clearTextSelection, empty, fastInnerHTML, fastInnerText, getScrollbarWidth, hasClass, isChildOf, isInput, isOutsideInput, isVisible, setAttribute, getParentWindow } from "./helpers/dom/element.mjs";
13
16
  import EventManager from "./eventManager.mjs";
14
17
  import { isImmediatePropagationStopped, isRightClick, isLeftClick } from "./helpers/dom/event.mjs";
@@ -27,18 +30,25 @@ var _mouseDown = /*#__PURE__*/new WeakMap();
27
30
  var _table = /*#__PURE__*/new WeakMap();
28
31
  var _lastWidth = /*#__PURE__*/new WeakMap();
29
32
  var _lastHeight = /*#__PURE__*/new WeakMap();
30
- var _TableView_brand = /*#__PURE__*/new WeakSet();
33
+ var _getAriaColcount = /*#__PURE__*/new WeakSet();
34
+ var _updateAriaColcount = /*#__PURE__*/new WeakSet();
31
35
  class TableView {
32
36
  /**
33
37
  * @param {Hanstontable} hotInstance Instance of {@link Handsontable}.
34
38
  */
35
39
  constructor(hotInstance) {
40
+ /**
41
+ * Update the `aria-colcount` attribute by the provided value.
42
+ *
43
+ * @param {number} delta The number of columns to add or remove to the aria tag.
44
+ */
45
+ _classPrivateMethodInitSpec(this, _updateAriaColcount);
36
46
  /**
37
47
  * Return the value of the `aria-colcount` attribute.
38
48
  *
39
49
  * @returns {number} The value of the `aria-colcount` attribute.
40
50
  */
41
- _classPrivateMethodInitSpec(this, _TableView_brand);
51
+ _classPrivateMethodInitSpec(this, _getAriaColcount);
42
52
  /**
43
53
  * Instance of {@link Handsontable}.
44
54
  *
@@ -93,14 +103,20 @@ class TableView {
93
103
  *
94
104
  * @type {number}
95
105
  */
96
- _classPrivateFieldInitSpec(this, _columnHeadersCount, 0);
106
+ _classPrivateFieldInitSpec(this, _columnHeadersCount, {
107
+ writable: true,
108
+ value: 0
109
+ });
97
110
  /**
98
111
  * The total number of the row header renderers applied to the table through the
99
112
  * `afterGetRowHeaderRenderers` hook.
100
113
  *
101
114
  * @type {number}
102
115
  */
103
- _classPrivateFieldInitSpec(this, _rowHeadersCount, 0);
116
+ _classPrivateFieldInitSpec(this, _rowHeadersCount, {
117
+ writable: true,
118
+ value: 0
119
+ });
104
120
  /**
105
121
  * The flag determines if the `adjustElementsSize` method call was made during
106
122
  * the render suspending. If true, the method has to be triggered once after render
@@ -115,29 +131,44 @@ class TableView {
115
131
  *
116
132
  * @type {boolean}
117
133
  */
118
- _classPrivateFieldInitSpec(this, _selectionMouseDown, false);
134
+ _classPrivateFieldInitSpec(this, _selectionMouseDown, {
135
+ writable: true,
136
+ value: false
137
+ });
119
138
  /**
120
139
  * @type {boolean}
121
140
  */
122
- _classPrivateFieldInitSpec(this, _mouseDown, void 0);
141
+ _classPrivateFieldInitSpec(this, _mouseDown, {
142
+ writable: true,
143
+ value: void 0
144
+ });
123
145
  /**
124
146
  * Main <TABLE> element.
125
147
  *
126
148
  * @type {HTMLTableElement}
127
149
  */
128
- _classPrivateFieldInitSpec(this, _table, void 0);
150
+ _classPrivateFieldInitSpec(this, _table, {
151
+ writable: true,
152
+ value: void 0
153
+ });
129
154
  /**
130
155
  * Cached width of the rootElement.
131
156
  *
132
157
  * @type {number}
133
158
  */
134
- _classPrivateFieldInitSpec(this, _lastWidth, 0);
159
+ _classPrivateFieldInitSpec(this, _lastWidth, {
160
+ writable: true,
161
+ value: 0
162
+ });
135
163
  /**
136
164
  * Cached height of the rootElement.
137
165
  *
138
166
  * @type {number}
139
167
  */
140
- _classPrivateFieldInitSpec(this, _lastHeight, 0);
168
+ _classPrivateFieldInitSpec(this, _lastHeight, {
169
+ writable: true,
170
+ value: 0
171
+ });
141
172
  this.hot = hotInstance;
142
173
  this.eventManager = new EventManager(this.hot);
143
174
  this.settings = this.hot.getSettings();
@@ -246,21 +277,21 @@ class TableView {
246
277
  rootElement.setAttribute('data-originalstyle', originalStyle); // needed to retrieve original style in jsFiddle link generator in HT examples. may be removed in future versions
247
278
  }
248
279
  addClass(rootElement, 'handsontable');
249
- _classPrivateFieldSet(_table, this, rootDocument.createElement('TABLE'));
250
- addClass(_classPrivateFieldGet(_table, this), 'htCore');
280
+ _classPrivateFieldSet(this, _table, rootDocument.createElement('TABLE'));
281
+ addClass(_classPrivateFieldGet(this, _table), 'htCore');
251
282
  if (this.hot.getSettings().tableClassName) {
252
- addClass(_classPrivateFieldGet(_table, this), this.hot.getSettings().tableClassName);
283
+ addClass(_classPrivateFieldGet(this, _table), this.hot.getSettings().tableClassName);
253
284
  }
254
285
  if (this.settings.ariaTags) {
255
- setAttribute(_classPrivateFieldGet(_table, this), [A11Y_PRESENTATION()]);
286
+ setAttribute(_classPrivateFieldGet(this, _table), [A11Y_PRESENTATION()]);
256
287
  setAttribute(rootElement, [A11Y_TREEGRID(), A11Y_ROWCOUNT(-1), A11Y_COLCOUNT(this.hot.countCols()), A11Y_MULTISELECTABLE()]);
257
288
  }
258
289
  this.THEAD = rootDocument.createElement('THEAD');
259
- _classPrivateFieldGet(_table, this).appendChild(this.THEAD);
290
+ _classPrivateFieldGet(this, _table).appendChild(this.THEAD);
260
291
  this.TBODY = rootDocument.createElement('TBODY');
261
- _classPrivateFieldGet(_table, this).appendChild(this.TBODY);
262
- this.hot.table = _classPrivateFieldGet(_table, this);
263
- this.hot.container.insertBefore(_classPrivateFieldGet(_table, this), this.hot.container.firstChild);
292
+ _classPrivateFieldGet(this, _table).appendChild(this.TBODY);
293
+ this.hot.table = _classPrivateFieldGet(this, _table);
294
+ this.hot.container.insertBefore(_classPrivateFieldGet(this, _table), this.hot.container.firstChild);
264
295
  }
265
296
 
266
297
  /**
@@ -277,7 +308,7 @@ class TableView {
277
308
  } = this.hot;
278
309
  const documentElement = rootDocument.documentElement;
279
310
  this.eventManager.addEventListener(rootElement, 'mousedown', event => {
280
- _classPrivateFieldSet(_selectionMouseDown, this, true);
311
+ _classPrivateFieldSet(this, _selectionMouseDown, true);
281
312
  if (!this.isTextSelectionAllowed(event.target)) {
282
313
  clearTextSelection(rootWindow);
283
314
  event.preventDefault();
@@ -285,10 +316,10 @@ class TableView {
285
316
  }
286
317
  });
287
318
  this.eventManager.addEventListener(rootElement, 'mouseup', () => {
288
- _classPrivateFieldSet(_selectionMouseDown, this, false);
319
+ _classPrivateFieldSet(this, _selectionMouseDown, false);
289
320
  });
290
321
  this.eventManager.addEventListener(rootElement, 'mousemove', event => {
291
- if (_classPrivateFieldGet(_selectionMouseDown, this) && !this.isTextSelectionAllowed(event.target)) {
322
+ if (_classPrivateFieldGet(this, _selectionMouseDown) && !this.isTextSelectionAllowed(event.target)) {
292
323
  // Clear selection only when fragmentSelection is enabled, otherwise clearing selection breaks the IME editor.
293
324
  if (this.settings.fragmentSelection) {
294
325
  clearTextSelection(rootWindow);
@@ -306,7 +337,7 @@ class TableView {
306
337
  if (selection.isInProgress() && isLeftClick(event)) {
307
338
  selection.finish();
308
339
  }
309
- _classPrivateFieldSet(_mouseDown, this, false);
340
+ _classPrivateFieldSet(this, _mouseDown, false);
310
341
  const isOutsideInputElement = isOutsideInput(rootDocument.activeElement);
311
342
  if (isInput(rootDocument.activeElement) && !isOutsideInputElement) {
312
343
  return;
@@ -318,21 +349,21 @@ class TableView {
318
349
  this.eventManager.addEventListener(documentElement, 'contextmenu', event => {
319
350
  if (selection.isInProgress() && isRightClick(event)) {
320
351
  selection.finish();
321
- _classPrivateFieldSet(_mouseDown, this, false);
352
+ _classPrivateFieldSet(this, _mouseDown, false);
322
353
  }
323
354
  });
324
355
  this.eventManager.addEventListener(documentElement, 'touchend', () => {
325
356
  if (selection.isInProgress()) {
326
357
  selection.finish();
327
358
  }
328
- _classPrivateFieldSet(_mouseDown, this, false);
359
+ _classPrivateFieldSet(this, _mouseDown, false);
329
360
  });
330
361
  this.eventManager.addEventListener(documentElement, 'mousedown', event => {
331
362
  const originalTarget = event.target;
332
363
  const eventX = event.x || event.clientX;
333
364
  const eventY = event.y || event.clientY;
334
365
  let next = event.target;
335
- if (_classPrivateFieldGet(_mouseDown, this) || !rootElement || !this.hot.view) {
366
+ if (_classPrivateFieldGet(this, _mouseDown) || !rootElement || !this.hot.view) {
336
367
  return; // it must have been started in a cell
337
368
  }
338
369
 
@@ -378,7 +409,7 @@ class TableView {
378
409
  });
379
410
  parentWindow = getParentWindow(parentWindow);
380
411
  }
381
- this.eventManager.addEventListener(_classPrivateFieldGet(_table, this), 'selectstart', event => {
412
+ this.eventManager.addEventListener(_classPrivateFieldGet(this, _table), 'selectstart', event => {
382
413
  if (this.settings.fragmentSelection || isInput(event.target)) {
383
414
  return;
384
415
  }
@@ -608,7 +639,7 @@ class TableView {
608
639
  ariaTags: this.settings.ariaTags,
609
640
  rtlMode: this.hot.isRtl(),
610
641
  externalRowCalculator: this.hot.getPlugin('autoRowSize') && this.hot.getPlugin('autoRowSize').isEnabled(),
611
- table: _classPrivateFieldGet(_table, this),
642
+ table: _classPrivateFieldGet(this, _table),
612
643
  isDataViewInstance: () => isRootInstance(this.hot),
613
644
  preventOverflow: () => this.settings.preventOverflow,
614
645
  preventWheel: () => this.settings.preventWheel,
@@ -650,12 +681,12 @@ class TableView {
650
681
  });
651
682
  }
652
683
  this.hot.runHooks('afterGetRowHeaderRenderers', headerRenderers);
653
- _classPrivateFieldSet(_rowHeadersCount, this, headerRenderers.length);
684
+ _classPrivateFieldSet(this, _rowHeadersCount, headerRenderers.length);
654
685
  if (this.hot.getSettings().ariaTags) {
655
686
  // Update the aria-colcount attribute.
656
687
  // Only needs to be done once after initialization/data update.
657
- if (_assertClassBrand(_TableView_brand, this, _getAriaColcount).call(this) === this.hot.countCols()) {
658
- _assertClassBrand(_TableView_brand, this, _updateAriaColcount).call(this, _classPrivateFieldGet(_rowHeadersCount, this));
688
+ if (_classPrivateMethodGet(this, _getAriaColcount, _getAriaColcount2).call(this) === this.hot.countCols()) {
689
+ _classPrivateMethodGet(this, _updateAriaColcount, _updateAriaColcount2).call(this, _classPrivateFieldGet(this, _rowHeadersCount));
659
690
  }
660
691
  }
661
692
  return headerRenderers;
@@ -671,7 +702,7 @@ class TableView {
671
702
  });
672
703
  }
673
704
  this.hot.runHooks('afterGetColumnHeaderRenderers', headerRenderers);
674
- _classPrivateFieldSet(_columnHeadersCount, this, headerRenderers.length);
705
+ _classPrivateFieldSet(this, _columnHeadersCount, headerRenderers.length);
675
706
  return headerRenderers;
676
707
  },
677
708
  columnWidth: renderedColumnIndex => {
@@ -727,7 +758,7 @@ class TableView {
727
758
  };
728
759
  this.hot.listen();
729
760
  this.activeWt = wt;
730
- _classPrivateFieldSet(_mouseDown, this, true);
761
+ _classPrivateFieldSet(this, _mouseDown, true);
731
762
  this.hot.runHooks('beforeOnCellMouseDown', event, visualCoords, TD, controller);
732
763
  if (isImmediatePropagationStopped(event)) {
733
764
  return;
@@ -744,7 +775,7 @@ class TableView {
744
775
  onCellContextMenu: (event, coords, TD, wt) => {
745
776
  const visualCoords = this.translateFromRenderableToVisualCoords(coords);
746
777
  this.activeWt = wt;
747
- _classPrivateFieldSet(_mouseDown, this, false);
778
+ _classPrivateFieldSet(this, _mouseDown, false);
748
779
  if (this.hot.selection.isInProgress()) {
749
780
  this.hot.selection.finish();
750
781
  }
@@ -777,7 +808,7 @@ class TableView {
777
808
  if (isImmediatePropagationStopped(event)) {
778
809
  return;
779
810
  }
780
- if (_classPrivateFieldGet(_mouseDown, this)) {
811
+ if (_classPrivateFieldGet(this, _mouseDown)) {
781
812
  handleMouseEvent(event, {
782
813
  coords: visualCoords,
783
814
  selection: this.hot.selection,
@@ -1034,7 +1065,7 @@ class TableView {
1034
1065
  * @returns {boolean}
1035
1066
  */
1036
1067
  isMouseDown() {
1037
- return _classPrivateFieldGet(_mouseDown, this);
1068
+ return _classPrivateFieldGet(this, _mouseDown);
1038
1069
  }
1039
1070
 
1040
1071
  /**
@@ -1228,8 +1259,8 @@ class TableView {
1228
1259
  * @param {number} height The table height.
1229
1260
  */
1230
1261
  setLastSize(width, height) {
1231
- _classPrivateFieldSet(_lastWidth, this, width);
1232
- _classPrivateFieldSet(_lastHeight, this, height);
1262
+ _classPrivateFieldSet(this, _lastWidth, width);
1263
+ _classPrivateFieldSet(this, _lastHeight, height);
1233
1264
  }
1234
1265
 
1235
1266
  /**
@@ -1239,8 +1270,8 @@ class TableView {
1239
1270
  */
1240
1271
  getLastSize() {
1241
1272
  return {
1242
- width: _classPrivateFieldGet(_lastWidth, this),
1243
- height: _classPrivateFieldGet(_lastHeight, this)
1273
+ width: _classPrivateFieldGet(this, _lastWidth),
1274
+ height: _classPrivateFieldGet(this, _lastHeight)
1244
1275
  };
1245
1276
  }
1246
1277
 
@@ -1322,7 +1353,7 @@ class TableView {
1322
1353
  * @returns {number}
1323
1354
  */
1324
1355
  getColumnHeadersCount() {
1325
- return _classPrivateFieldGet(_columnHeadersCount, this);
1356
+ return _classPrivateFieldGet(this, _columnHeadersCount);
1326
1357
  }
1327
1358
 
1328
1359
  /**
@@ -1331,7 +1362,7 @@ class TableView {
1331
1362
  * @returns {number}
1332
1363
  */
1333
1364
  getRowHeadersCount() {
1334
- return _classPrivateFieldGet(_rowHeadersCount, this);
1365
+ return _classPrivateFieldGet(this, _rowHeadersCount);
1335
1366
  }
1336
1367
 
1337
1368
  /**
@@ -1383,16 +1414,11 @@ class TableView {
1383
1414
  this.eventManager.destroy();
1384
1415
  }
1385
1416
  }
1386
- function _getAriaColcount() {
1417
+ function _getAriaColcount2() {
1387
1418
  return parseInt(this.hot.rootElement.getAttribute(A11Y_COLCOUNT()[0]), 10);
1388
1419
  }
1389
- /**
1390
- * Update the `aria-colcount` attribute by the provided value.
1391
- *
1392
- * @param {number} delta The number of columns to add or remove to the aria tag.
1393
- */
1394
- function _updateAriaColcount(delta) {
1395
- const colCount = _assertClassBrand(_TableView_brand, this, _getAriaColcount).call(this) + delta;
1420
+ function _updateAriaColcount2(delta) {
1421
+ const colCount = _classPrivateMethodGet(this, _getAriaColcount, _getAriaColcount2).call(this) + delta;
1396
1422
  setAttribute(this.hot.rootElement, ...A11Y_COLCOUNT(colCount));
1397
1423
  }
1398
1424
  export default TableView;
@@ -6,9 +6,11 @@ var _observer = require("./observer");
6
6
  var _utils = require("./utils");
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
  * The ChangesObservable module is an object that represents a resource that provides
14
16
  * the ability to observe the changes that happened in the index map indexes during
@@ -32,7 +34,10 @@ class ChangesObservable {
32
34
  *
33
35
  * @type {ChangesObserver[]}
34
36
  */
35
- _classPrivateFieldInitSpec(this, _observers, new Set());
37
+ _classPrivateFieldInitSpec(this, _observers, {
38
+ writable: true,
39
+ value: new Set()
40
+ });
36
41
  /**
37
42
  * An array with default values that act as a base array that will be compared with
38
43
  * the last saved index state. The changes are generated and immediately send through
@@ -41,21 +46,30 @@ class ChangesObservable {
41
46
  *
42
47
  * @type {Array}
43
48
  */
44
- _classPrivateFieldInitSpec(this, _indexMatrix, []);
49
+ _classPrivateFieldInitSpec(this, _indexMatrix, {
50
+ writable: true,
51
+ value: []
52
+ });
45
53
  /**
46
54
  * An array that holds the indexes state that is currently valid. The value is changed on every
47
55
  * index mapper cache update.
48
56
  *
49
57
  * @type {Array}
50
58
  */
51
- _classPrivateFieldInitSpec(this, _currentIndexState, []);
59
+ _classPrivateFieldInitSpec(this, _currentIndexState, {
60
+ writable: true,
61
+ value: []
62
+ });
52
63
  /**
53
64
  * The flag determines if the observable is initialized or not. Not initialized object creates
54
65
  * index matrix once while emitting new changes.
55
66
  *
56
67
  * @type {boolean}
57
68
  */
58
- _classPrivateFieldInitSpec(this, _isMatrixIndexesInitialized, false);
69
+ _classPrivateFieldInitSpec(this, _isMatrixIndexesInitialized, {
70
+ writable: true,
71
+ value: false
72
+ });
59
73
  /**
60
74
  * The initial index value allows control from what value the index matrix array will be created.
61
75
  * Changing that value changes how the array diff generates the changes for the initial data
@@ -67,8 +81,11 @@ class ChangesObservable {
67
81
  *
68
82
  * @type {boolean}
69
83
  */
70
- _classPrivateFieldInitSpec(this, _initialIndexValue, false);
71
- _classPrivateFieldSet(_initialIndexValue, this, initialIndexValue !== null && initialIndexValue !== void 0 ? initialIndexValue : false);
84
+ _classPrivateFieldInitSpec(this, _initialIndexValue, {
85
+ writable: true,
86
+ value: false
87
+ });
88
+ _classPrivateFieldSet(this, _initialIndexValue, initialIndexValue !== null && initialIndexValue !== void 0 ? initialIndexValue : false);
72
89
  }
73
90
 
74
91
  /* eslint-disable jsdoc/require-description-complete-sentence */
@@ -97,11 +114,11 @@ class ChangesObservable {
97
114
  /* eslint-enable jsdoc/require-description-complete-sentence */
98
115
  createObserver() {
99
116
  const observer = new _observer.ChangesObserver();
100
- _classPrivateFieldGet(_observers, this).add(observer);
117
+ _classPrivateFieldGet(this, _observers).add(observer);
101
118
  observer.addLocalHook('unsubscribe', () => {
102
- _classPrivateFieldGet(_observers, this).delete(observer);
119
+ _classPrivateFieldGet(this, _observers).delete(observer);
103
120
  });
104
- observer._writeInitialChanges((0, _utils.arrayDiff)(_classPrivateFieldGet(_indexMatrix, this), _classPrivateFieldGet(_currentIndexState, this)));
121
+ observer._writeInitialChanges((0, _utils.arrayDiff)(_classPrivateFieldGet(this, _indexMatrix), _classPrivateFieldGet(this, _currentIndexState)));
105
122
  return observer;
106
123
  }
107
124
 
@@ -113,21 +130,21 @@ class ChangesObservable {
113
130
  * @param {Array} indexesState An array with index map state.
114
131
  */
115
132
  emit(indexesState) {
116
- let currentIndexState = _classPrivateFieldGet(_currentIndexState, this);
117
- if (!_classPrivateFieldGet(_isMatrixIndexesInitialized, this) || _classPrivateFieldGet(_indexMatrix, this).length !== indexesState.length) {
133
+ let currentIndexState = _classPrivateFieldGet(this, _currentIndexState);
134
+ if (!_classPrivateFieldGet(this, _isMatrixIndexesInitialized) || _classPrivateFieldGet(this, _indexMatrix).length !== indexesState.length) {
118
135
  if (indexesState.length === 0) {
119
- indexesState = new Array(currentIndexState.length).fill(_classPrivateFieldGet(_initialIndexValue, this));
136
+ indexesState = new Array(currentIndexState.length).fill(_classPrivateFieldGet(this, _initialIndexValue));
120
137
  } else {
121
- _classPrivateFieldSet(_indexMatrix, this, new Array(indexesState.length).fill(_classPrivateFieldGet(_initialIndexValue, this)));
138
+ _classPrivateFieldSet(this, _indexMatrix, new Array(indexesState.length).fill(_classPrivateFieldGet(this, _initialIndexValue)));
122
139
  }
123
- if (!_classPrivateFieldGet(_isMatrixIndexesInitialized, this)) {
124
- _classPrivateFieldSet(_isMatrixIndexesInitialized, this, true);
125
- currentIndexState = _classPrivateFieldGet(_indexMatrix, this);
140
+ if (!_classPrivateFieldGet(this, _isMatrixIndexesInitialized)) {
141
+ _classPrivateFieldSet(this, _isMatrixIndexesInitialized, true);
142
+ currentIndexState = _classPrivateFieldGet(this, _indexMatrix);
126
143
  }
127
144
  }
128
145
  const changes = (0, _utils.arrayDiff)(currentIndexState, indexesState);
129
- _classPrivateFieldGet(_observers, this).forEach(observer => observer._write(changes));
130
- _classPrivateFieldSet(_currentIndexState, this, indexesState);
146
+ _classPrivateFieldGet(this, _observers).forEach(observer => observer._write(changes));
147
+ _classPrivateFieldSet(this, _currentIndexState, indexesState);
131
148
  }
132
149
  }
133
150
  exports.ChangesObservable = ChangesObservable;
@@ -1,9 +1,11 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
2
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
3
3
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
4
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
5
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
6
- 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"); }
4
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
5
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
6
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
7
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
8
+ 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; } }
7
9
  import { ChangesObserver } from "./observer.mjs";
8
10
  import { arrayDiff } from "./utils.mjs";
9
11
  /**
@@ -29,7 +31,10 @@ export class ChangesObservable {
29
31
  *
30
32
  * @type {ChangesObserver[]}
31
33
  */
32
- _classPrivateFieldInitSpec(this, _observers, new Set());
34
+ _classPrivateFieldInitSpec(this, _observers, {
35
+ writable: true,
36
+ value: new Set()
37
+ });
33
38
  /**
34
39
  * An array with default values that act as a base array that will be compared with
35
40
  * the last saved index state. The changes are generated and immediately send through
@@ -38,21 +43,30 @@ export class ChangesObservable {
38
43
  *
39
44
  * @type {Array}
40
45
  */
41
- _classPrivateFieldInitSpec(this, _indexMatrix, []);
46
+ _classPrivateFieldInitSpec(this, _indexMatrix, {
47
+ writable: true,
48
+ value: []
49
+ });
42
50
  /**
43
51
  * An array that holds the indexes state that is currently valid. The value is changed on every
44
52
  * index mapper cache update.
45
53
  *
46
54
  * @type {Array}
47
55
  */
48
- _classPrivateFieldInitSpec(this, _currentIndexState, []);
56
+ _classPrivateFieldInitSpec(this, _currentIndexState, {
57
+ writable: true,
58
+ value: []
59
+ });
49
60
  /**
50
61
  * The flag determines if the observable is initialized or not. Not initialized object creates
51
62
  * index matrix once while emitting new changes.
52
63
  *
53
64
  * @type {boolean}
54
65
  */
55
- _classPrivateFieldInitSpec(this, _isMatrixIndexesInitialized, false);
66
+ _classPrivateFieldInitSpec(this, _isMatrixIndexesInitialized, {
67
+ writable: true,
68
+ value: false
69
+ });
56
70
  /**
57
71
  * The initial index value allows control from what value the index matrix array will be created.
58
72
  * Changing that value changes how the array diff generates the changes for the initial data
@@ -64,8 +78,11 @@ export class ChangesObservable {
64
78
  *
65
79
  * @type {boolean}
66
80
  */
67
- _classPrivateFieldInitSpec(this, _initialIndexValue, false);
68
- _classPrivateFieldSet(_initialIndexValue, this, initialIndexValue !== null && initialIndexValue !== void 0 ? initialIndexValue : false);
81
+ _classPrivateFieldInitSpec(this, _initialIndexValue, {
82
+ writable: true,
83
+ value: false
84
+ });
85
+ _classPrivateFieldSet(this, _initialIndexValue, initialIndexValue !== null && initialIndexValue !== void 0 ? initialIndexValue : false);
69
86
  }
70
87
 
71
88
  /* eslint-disable jsdoc/require-description-complete-sentence */
@@ -94,11 +111,11 @@ export class ChangesObservable {
94
111
  /* eslint-enable jsdoc/require-description-complete-sentence */
95
112
  createObserver() {
96
113
  const observer = new ChangesObserver();
97
- _classPrivateFieldGet(_observers, this).add(observer);
114
+ _classPrivateFieldGet(this, _observers).add(observer);
98
115
  observer.addLocalHook('unsubscribe', () => {
99
- _classPrivateFieldGet(_observers, this).delete(observer);
116
+ _classPrivateFieldGet(this, _observers).delete(observer);
100
117
  });
101
- observer._writeInitialChanges(arrayDiff(_classPrivateFieldGet(_indexMatrix, this), _classPrivateFieldGet(_currentIndexState, this)));
118
+ observer._writeInitialChanges(arrayDiff(_classPrivateFieldGet(this, _indexMatrix), _classPrivateFieldGet(this, _currentIndexState)));
102
119
  return observer;
103
120
  }
104
121
 
@@ -110,20 +127,20 @@ export class ChangesObservable {
110
127
  * @param {Array} indexesState An array with index map state.
111
128
  */
112
129
  emit(indexesState) {
113
- let currentIndexState = _classPrivateFieldGet(_currentIndexState, this);
114
- if (!_classPrivateFieldGet(_isMatrixIndexesInitialized, this) || _classPrivateFieldGet(_indexMatrix, this).length !== indexesState.length) {
130
+ let currentIndexState = _classPrivateFieldGet(this, _currentIndexState);
131
+ if (!_classPrivateFieldGet(this, _isMatrixIndexesInitialized) || _classPrivateFieldGet(this, _indexMatrix).length !== indexesState.length) {
115
132
  if (indexesState.length === 0) {
116
- indexesState = new Array(currentIndexState.length).fill(_classPrivateFieldGet(_initialIndexValue, this));
133
+ indexesState = new Array(currentIndexState.length).fill(_classPrivateFieldGet(this, _initialIndexValue));
117
134
  } else {
118
- _classPrivateFieldSet(_indexMatrix, this, new Array(indexesState.length).fill(_classPrivateFieldGet(_initialIndexValue, this)));
135
+ _classPrivateFieldSet(this, _indexMatrix, new Array(indexesState.length).fill(_classPrivateFieldGet(this, _initialIndexValue)));
119
136
  }
120
- if (!_classPrivateFieldGet(_isMatrixIndexesInitialized, this)) {
121
- _classPrivateFieldSet(_isMatrixIndexesInitialized, this, true);
122
- currentIndexState = _classPrivateFieldGet(_indexMatrix, this);
137
+ if (!_classPrivateFieldGet(this, _isMatrixIndexesInitialized)) {
138
+ _classPrivateFieldSet(this, _isMatrixIndexesInitialized, true);
139
+ currentIndexState = _classPrivateFieldGet(this, _indexMatrix);
123
140
  }
124
141
  }
125
142
  const changes = arrayDiff(currentIndexState, indexesState);
126
- _classPrivateFieldGet(_observers, this).forEach(observer => observer._write(changes));
127
- _classPrivateFieldSet(_currentIndexState, this, indexesState);
143
+ _classPrivateFieldGet(this, _observers).forEach(observer => observer._write(changes));
144
+ _classPrivateFieldSet(this, _currentIndexState, indexesState);
128
145
  }
129
146
  }
@@ -1,15 +1,17 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
4
3
  require("core-js/modules/es.error.cause.js");
4
+ exports.__esModule = true;
5
5
  var _object = require("../../helpers/object");
6
6
  var _localHooks = _interopRequireDefault(require("../../mixins/localHooks"));
7
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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 _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
11
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
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 _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
11
+ 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
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
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 _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
13
15
  /**
14
16
  * The ChangesObserver module is an object that represents a disposable resource
15
17
  * provided by the ChangesObservable module.
@@ -26,7 +28,10 @@ class ChangesObserver {
26
28
  *
27
29
  * @type {Array}
28
30
  */
29
- _classPrivateFieldInitSpec(this, _currentInitialChanges, []);
31
+ _classPrivateFieldInitSpec(this, _currentInitialChanges, {
32
+ writable: true,
33
+ value: []
34
+ });
30
35
  }
31
36
  /**
32
37
  * Subscribes to the observer.
@@ -36,7 +41,7 @@ class ChangesObserver {
36
41
  */
37
42
  subscribe(callback) {
38
43
  this.addLocalHook('change', callback);
39
- this._write(_classPrivateFieldGet(_currentInitialChanges, this));
44
+ this._write(_classPrivateFieldGet(this, _currentInitialChanges));
40
45
  return this;
41
46
  }
42
47
 
@@ -75,7 +80,7 @@ class ChangesObserver {
75
80
  * @param {object} initialChanges The chunk of changes produced by the ChangesObservable module.
76
81
  */
77
82
  _writeInitialChanges(initialChanges) {
78
- _classPrivateFieldSet(_currentInitialChanges, this, initialChanges);
83
+ _classPrivateFieldSet(this, _currentInitialChanges, initialChanges);
79
84
  }
80
85
  }
81
86
  exports.ChangesObserver = ChangesObserver;