handsontable 0.0.0-next-a01036f-20230508 → 0.0.0-next-48677e7-20230509

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

Files changed (227) hide show
  1. package/3rdparty/walkontable/src/cell/coords.js +40 -13
  2. package/3rdparty/walkontable/src/cell/coords.mjs +40 -13
  3. package/3rdparty/walkontable/src/cell/range.js +29 -25
  4. package/3rdparty/walkontable/src/cell/range.mjs +28 -24
  5. package/3rdparty/walkontable/src/core/_base.js +9 -3
  6. package/3rdparty/walkontable/src/core/_base.mjs +9 -3
  7. package/3rdparty/walkontable/src/core/clone.js +2 -2
  8. package/3rdparty/walkontable/src/core/clone.mjs +2 -2
  9. package/3rdparty/walkontable/src/core/core.js +3 -2
  10. package/3rdparty/walkontable/src/core/core.mjs +3 -2
  11. package/3rdparty/walkontable/src/event.js +12 -10
  12. package/3rdparty/walkontable/src/event.mjs +12 -10
  13. package/3rdparty/walkontable/src/facade/core.js +2 -2
  14. package/3rdparty/walkontable/src/facade/core.mjs +2 -2
  15. package/3rdparty/walkontable/src/index.js +10 -2
  16. package/3rdparty/walkontable/src/index.mjs +2 -2
  17. package/3rdparty/walkontable/src/overlay/_base.js +8 -7
  18. package/3rdparty/walkontable/src/overlay/_base.mjs +8 -7
  19. package/3rdparty/walkontable/src/overlay/bottom.js +7 -6
  20. package/3rdparty/walkontable/src/overlay/bottom.mjs +7 -6
  21. package/3rdparty/walkontable/src/overlay/inlineStart.js +2 -4
  22. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -4
  23. package/3rdparty/walkontable/src/overlay/top.js +9 -10
  24. package/3rdparty/walkontable/src/overlay/top.mjs +9 -10
  25. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +12 -10
  26. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +12 -10
  27. package/3rdparty/walkontable/src/overlays.js +64 -55
  28. package/3rdparty/walkontable/src/overlays.mjs +64 -55
  29. package/3rdparty/walkontable/src/renderer/table.js +2 -0
  30. package/3rdparty/walkontable/src/renderer/table.mjs +2 -0
  31. package/3rdparty/walkontable/src/scroll.js +23 -20
  32. package/3rdparty/walkontable/src/scroll.mjs +23 -20
  33. package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
  34. package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
  35. package/3rdparty/walkontable/src/selection/border/constants.js +18 -0
  36. package/3rdparty/walkontable/src/selection/border/constants.mjs +13 -0
  37. package/3rdparty/walkontable/src/selection/constants.js +63 -0
  38. package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
  39. package/3rdparty/walkontable/src/selection/index.js +30 -0
  40. package/3rdparty/walkontable/src/selection/index.mjs +5 -0
  41. package/3rdparty/walkontable/src/selection/manager.js +334 -0
  42. package/3rdparty/walkontable/src/selection/manager.mjs +328 -0
  43. package/3rdparty/walkontable/src/selection/scanner.js +363 -0
  44. package/3rdparty/walkontable/src/selection/scanner.mjs +359 -0
  45. package/3rdparty/walkontable/src/selection/selection.js +133 -0
  46. package/3rdparty/walkontable/src/selection/selection.mjs +127 -0
  47. package/3rdparty/walkontable/src/settings.js +15 -13
  48. package/3rdparty/walkontable/src/settings.mjs +15 -13
  49. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
  50. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
  51. package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
  52. package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
  53. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
  54. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
  55. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
  56. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
  57. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
  58. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
  59. package/3rdparty/walkontable/src/table.js +33 -101
  60. package/3rdparty/walkontable/src/table.mjs +34 -102
  61. package/base.js +4 -2
  62. package/base.mjs +2 -2
  63. package/core.d.ts +4 -0
  64. package/core.js +52 -19
  65. package/core.mjs +52 -19
  66. package/dataMap/dataSource.js +5 -5
  67. package/dataMap/dataSource.mjs +5 -5
  68. package/dataMap/metaManager/metaSchema.js +8 -1
  69. package/dataMap/metaManager/metaSchema.mjs +8 -1
  70. package/dist/handsontable.css +7 -2
  71. package/dist/handsontable.full.css +7 -2
  72. package/dist/handsontable.full.js +9413 -9096
  73. package/dist/handsontable.full.min.css +3 -3
  74. package/dist/handsontable.full.min.js +115 -123
  75. package/dist/handsontable.js +9501 -9183
  76. package/dist/handsontable.min.css +3 -3
  77. package/dist/handsontable.min.js +3 -11
  78. package/dist/languages/all.js +0 -133
  79. package/dist/languages/ar-AR.js +0 -7
  80. package/dist/languages/cs-CZ.js +0 -7
  81. package/dist/languages/de-CH.js +0 -7
  82. package/dist/languages/de-DE.js +0 -7
  83. package/dist/languages/en-US.js +0 -7
  84. package/dist/languages/es-MX.js +0 -7
  85. package/dist/languages/fr-FR.js +0 -7
  86. package/dist/languages/it-IT.js +0 -7
  87. package/dist/languages/ja-JP.js +0 -7
  88. package/dist/languages/ko-KR.js +0 -7
  89. package/dist/languages/lv-LV.js +0 -7
  90. package/dist/languages/nb-NO.js +0 -7
  91. package/dist/languages/nl-NL.js +0 -7
  92. package/dist/languages/pl-PL.js +0 -7
  93. package/dist/languages/pt-BR.js +0 -7
  94. package/dist/languages/ru-RU.js +0 -7
  95. package/dist/languages/sr-SP.js +0 -7
  96. package/dist/languages/zh-CN.js +0 -7
  97. package/dist/languages/zh-TW.js +0 -7
  98. package/editorManager.js +7 -3
  99. package/editorManager.mjs +7 -3
  100. package/editors/textEditor/textEditor.js +3 -16
  101. package/editors/textEditor/textEditor.mjs +4 -17
  102. package/focusManager.d.ts +12 -0
  103. package/focusManager.js +249 -0
  104. package/focusManager.mjs +245 -0
  105. package/helpers/dom/element.js +11 -0
  106. package/helpers/dom/element.mjs +10 -0
  107. package/helpers/mixed.js +1 -1
  108. package/helpers/mixed.mjs +1 -1
  109. package/i18n/languages/ar-AR.js +1 -7
  110. package/i18n/languages/cs-CZ.js +1 -7
  111. package/i18n/languages/de-CH.js +1 -7
  112. package/i18n/languages/de-DE.js +1 -7
  113. package/i18n/languages/en-US.js +1 -7
  114. package/i18n/languages/es-MX.js +1 -7
  115. package/i18n/languages/fr-FR.js +1 -7
  116. package/i18n/languages/it-IT.js +1 -7
  117. package/i18n/languages/ja-JP.js +1 -7
  118. package/i18n/languages/ko-KR.js +1 -7
  119. package/i18n/languages/lv-LV.js +1 -7
  120. package/i18n/languages/nb-NO.js +1 -7
  121. package/i18n/languages/nl-NL.js +1 -7
  122. package/i18n/languages/pl-PL.js +1 -7
  123. package/i18n/languages/pt-BR.js +1 -7
  124. package/i18n/languages/ru-RU.js +1 -7
  125. package/i18n/languages/sr-SP.js +1 -7
  126. package/i18n/languages/zh-CN.js +1 -7
  127. package/i18n/languages/zh-TW.js +1 -7
  128. package/languages/all.js +0 -133
  129. package/languages/ar-AR.js +0 -7
  130. package/languages/cs-CZ.js +0 -7
  131. package/languages/de-CH.js +0 -7
  132. package/languages/de-DE.js +0 -7
  133. package/languages/en-US.js +0 -7
  134. package/languages/es-MX.js +0 -7
  135. package/languages/fr-FR.js +0 -7
  136. package/languages/index.js +0 -133
  137. package/languages/it-IT.js +0 -7
  138. package/languages/ja-JP.js +0 -7
  139. package/languages/ko-KR.js +0 -7
  140. package/languages/lv-LV.js +0 -7
  141. package/languages/nb-NO.js +0 -7
  142. package/languages/nl-NL.js +0 -7
  143. package/languages/pl-PL.js +0 -7
  144. package/languages/pt-BR.js +0 -7
  145. package/languages/ru-RU.js +0 -7
  146. package/languages/sr-SP.js +0 -7
  147. package/languages/zh-CN.js +0 -7
  148. package/languages/zh-TW.js +0 -7
  149. package/package.json +2 -3
  150. package/pluginHooks.js +7 -17
  151. package/pluginHooks.mjs +4 -16
  152. package/plugins/autoRowSize/autoRowSize.js +2 -2
  153. package/plugins/autoRowSize/autoRowSize.mjs +2 -2
  154. package/plugins/copyPaste/copyPaste.js +12 -93
  155. package/plugins/copyPaste/copyPaste.mjs +12 -93
  156. package/plugins/copyPaste/copyableRanges.js +31 -25
  157. package/plugins/copyPaste/copyableRanges.mjs +24 -18
  158. package/plugins/customBorders/customBorders.js +6 -2
  159. package/plugins/customBorders/customBorders.mjs +7 -3
  160. package/plugins/filters/filters.js +0 -5
  161. package/plugins/filters/filters.mjs +0 -5
  162. package/plugins/formulas/formulas.js +168 -190
  163. package/plugins/formulas/formulas.mjs +168 -190
  164. package/plugins/mergeCells/mergeCells.js +0 -16
  165. package/plugins/mergeCells/mergeCells.mjs +0 -16
  166. package/plugins/nestedHeaders/nestedHeaders.js +3 -4
  167. package/plugins/nestedHeaders/nestedHeaders.mjs +3 -4
  168. package/plugins/nestedHeaders/stateManager/headersTree.js +26 -23
  169. package/plugins/nestedHeaders/stateManager/headersTree.mjs +23 -20
  170. package/plugins/nestedHeaders/stateManager/index.js +3 -3
  171. package/plugins/nestedHeaders/stateManager/matrixGenerator.js +0 -1
  172. package/plugins/nestedHeaders/stateManager/settingsNormalizer.js +1 -1
  173. package/plugins/nestedHeaders/utils/ghostTable.js +35 -30
  174. package/plugins/nestedHeaders/utils/ghostTable.mjs +35 -30
  175. package/plugins/registry.js +1 -3
  176. package/plugins/undoRedo/undoRedo.js +1 -0
  177. package/plugins/undoRedo/undoRedo.mjs +1 -0
  178. package/renderers/baseRenderer/baseRenderer.js +3 -0
  179. package/renderers/baseRenderer/baseRenderer.mjs +3 -0
  180. package/selection/highlight/highlight.js +335 -133
  181. package/selection/highlight/highlight.mjs +325 -129
  182. package/selection/highlight/types/activeHeader.js +10 -9
  183. package/selection/highlight/types/activeHeader.mjs +10 -8
  184. package/selection/highlight/types/area.js +12 -27
  185. package/selection/highlight/types/area.mjs +16 -30
  186. package/selection/highlight/types/areaLayered.js +54 -0
  187. package/selection/highlight/types/areaLayered.mjs +49 -0
  188. package/selection/highlight/types/column.js +50 -0
  189. package/selection/highlight/types/column.mjs +45 -0
  190. package/selection/highlight/types/customSelection.js +7 -10
  191. package/selection/highlight/types/customSelection.mjs +7 -9
  192. package/selection/highlight/types/fill.js +5 -8
  193. package/selection/highlight/types/fill.mjs +5 -7
  194. package/selection/highlight/types/{cell.js → focus.js} +5 -8
  195. package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
  196. package/selection/highlight/types/header.js +10 -20
  197. package/selection/highlight/types/header.mjs +10 -19
  198. package/selection/highlight/types/{index.js → row.js} +27 -31
  199. package/selection/highlight/types/{index.mjs → row.mjs} +24 -29
  200. package/selection/highlight/visualSelection.js +12 -21
  201. package/selection/highlight/visualSelection.mjs +12 -21
  202. package/selection/index.js +4 -7
  203. package/selection/index.mjs +2 -3
  204. package/selection/selection.js +88 -46
  205. package/selection/selection.mjs +82 -44
  206. package/settings.d.ts +1 -0
  207. package/tableView.js +94 -66
  208. package/tableView.mjs +94 -66
  209. package/translations/changesObservable/observable.js +46 -41
  210. package/translations/changesObservable/observable.mjs +41 -36
  211. package/translations/changesObservable/observer.js +1 -1
  212. package/translations/indexMapper.js +0 -21
  213. package/translations/indexMapper.mjs +0 -21
  214. package/utils/dataStructures/tree.js +18 -15
  215. package/utils/dataStructures/tree.mjs +18 -15
  216. package/utils/parseTable.js +1 -5
  217. package/utils/parseTable.mjs +1 -5
  218. package/3rdparty/walkontable/src/selection.js +0 -354
  219. package/3rdparty/walkontable/src/selection.mjs +0 -348
  220. package/plugins/copyPaste/focusableElement.js +0 -219
  221. package/plugins/copyPaste/focusableElement.mjs +0 -213
  222. package/plugins/formulas/indexSyncer/axisSyncer.js +0 -379
  223. package/plugins/formulas/indexSyncer/axisSyncer.mjs +0 -374
  224. package/plugins/formulas/indexSyncer/index.js +0 -225
  225. package/plugins/formulas/indexSyncer/index.mjs +0 -219
  226. package/selection/highlight/constants.js +0 -16
  227. package/selection/highlight/constants.mjs +0 -6
package/tableView.mjs CHANGED
@@ -53,88 +53,98 @@ var privatePool = new WeakMap();
53
53
  var _columnHeadersCount = /*#__PURE__*/new WeakMap();
54
54
  var _rowHeadersCount = /*#__PURE__*/new WeakMap();
55
55
  var TableView = /*#__PURE__*/function () {
56
+ /**
57
+ * Instance of {@link Handsontable}.
58
+ *
59
+ * @private
60
+ * @type {Handsontable}
61
+ */
62
+
63
+ /**
64
+ * Instance of {@link EventManager}.
65
+ *
66
+ * @private
67
+ * @type {EventManager}
68
+ */
69
+
70
+ /**
71
+ * Current Handsontable's GridSettings object.
72
+ *
73
+ * @private
74
+ * @type {GridSettings}
75
+ */
76
+
77
+ /**
78
+ * Main <THEAD> element.
79
+ *
80
+ * @private
81
+ * @type {HTMLTableSectionElement}
82
+ */
83
+
84
+ /**
85
+ * Main <TBODY> element.
86
+ *
87
+ * @private
88
+ * @type {HTMLTableSectionElement}
89
+ */
90
+
91
+ /**
92
+ * Main Walkontable instance.
93
+ *
94
+ * @private
95
+ * @type {Walkontable}
96
+ */
97
+
98
+ /**
99
+ * Main Walkontable instance.
100
+ *
101
+ * @private
102
+ * @type {Walkontable}
103
+ */
104
+
105
+ /**
106
+ * The total number of the column header renderers applied to the table through the
107
+ * `afterGetColumnHeaderRenderers` hook.
108
+ *
109
+ * @type {number}
110
+ */
111
+
112
+ /**
113
+ * The total number of the row header renderers applied to the table through the
114
+ * `afterGetRowHeaderRenderers` hook.
115
+ *
116
+ * @type {number}
117
+ */
118
+
119
+ /**
120
+ * The flag determines if the `adjustElementsSize` method call was made during
121
+ * the render suspending. If true, the method has to be triggered once after render
122
+ * resuming.
123
+ *
124
+ * @private
125
+ * @type {boolean}
126
+ */
127
+
56
128
  /**
57
129
  * @param {Hanstontable} instance Instance of {@link Handsontable}.
58
130
  */
59
131
  function TableView(instance) {
60
132
  _classCallCheck(this, TableView);
61
- /**
62
- * Instance of {@link Handsontable}.
63
- *
64
- * @private
65
- * @type {Handsontable}
66
- */
67
133
  _defineProperty(this, "instance", void 0);
68
- /**
69
- * Instance of {@link EventManager}.
70
- *
71
- * @private
72
- * @type {EventManager}
73
- */
74
134
  _defineProperty(this, "eventManager", void 0);
75
- /**
76
- * Current Handsontable's GridSettings object.
77
- *
78
- * @private
79
- * @type {GridSettings}
80
- */
81
135
  _defineProperty(this, "settings", void 0);
82
- /**
83
- * Main <THEAD> element.
84
- *
85
- * @private
86
- * @type {HTMLTableSectionElement}
87
- */
88
136
  _defineProperty(this, "THEAD", void 0);
89
- /**
90
- * Main <TBODY> element.
91
- *
92
- * @private
93
- * @type {HTMLTableSectionElement}
94
- */
95
137
  _defineProperty(this, "TBODY", void 0);
96
- /**
97
- * Main Walkontable instance.
98
- *
99
- * @private
100
- * @type {Walkontable}
101
- */
102
138
  _defineProperty(this, "_wt", void 0);
103
- /**
104
- * Main Walkontable instance.
105
- *
106
- * @private
107
- * @type {Walkontable}
108
- */
109
139
  _defineProperty(this, "activeWt", void 0);
110
- /**
111
- * The total number of the column header renderers applied to the table through the
112
- * `afterGetColumnHeaderRenderers` hook.
113
- *
114
- * @type {number}
115
- */
116
140
  _classPrivateFieldInitSpec(this, _columnHeadersCount, {
117
141
  writable: true,
118
142
  value: 0
119
143
  });
120
- /**
121
- * The total number of the row header renderers applied to the table through the
122
- * `afterGetRowHeaderRenderers` hook.
123
- *
124
- * @type {number}
125
- */
126
144
  _classPrivateFieldInitSpec(this, _rowHeadersCount, {
127
145
  writable: true,
128
146
  value: 0
129
147
  });
130
- /**
131
- * The flag determines if the `adjustElementsSize` method call was made during
132
- * the render suspending. If true, the method has to be triggered once after render
133
- * resuming.
134
- *
135
- * @private
136
- * @type {boolean}
137
- */
138
148
  _defineProperty(this, "postponedAdjustElementsSize", false);
139
149
  this.instance = instance;
140
150
  this.eventManager = new EventManager(this.instance);
@@ -282,6 +292,7 @@ var TableView = /*#__PURE__*/function () {
282
292
  }, {
283
293
  key: "createElements",
284
294
  value: function createElements() {
295
+ var _this$settings, _this$settings$data, _this$settings2, _this$settings2$data$;
285
296
  var priv = privatePool.get(this);
286
297
  var _this$instance = this.instance,
287
298
  rootElement = _this$instance.rootElement,
@@ -294,6 +305,9 @@ var TableView = /*#__PURE__*/function () {
294
305
  addClass(rootElement, 'handsontable');
295
306
  priv.table = rootDocument.createElement('TABLE');
296
307
  addClass(priv.table, 'htCore');
308
+ priv.table.ariaRowCount = (_this$settings = this.settings) === null || _this$settings === void 0 ? void 0 : (_this$settings$data = _this$settings.data) === null || _this$settings$data === void 0 ? void 0 : _this$settings$data.length;
309
+ priv.table.ariaColCount = (_this$settings2 = this.settings) === null || _this$settings2 === void 0 ? void 0 : (_this$settings2$data$ = _this$settings2.data[0]) === null || _this$settings2$data$ === void 0 ? void 0 : _this$settings2$data$.length;
310
+ priv.table.setAttribute('role', 'treegrid');
297
311
  if (this.instance.getSettings().tableClassName) {
298
312
  addClass(priv.table, this.instance.getSettings().tableClassName);
299
313
  }
@@ -878,15 +892,29 @@ var TableView = /*#__PURE__*/function () {
878
892
  },
879
893
  onBeforeHighlightingRowHeader: function onBeforeHighlightingRowHeader(renderableRow, headerLevel, highlightMeta) {
880
894
  var rowMapper = _this2.instance.rowIndexMapper;
881
- var visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow);
895
+ var areColumnHeadersSelected = renderableRow < 0;
896
+ var visualRow = renderableRow;
897
+ if (!areColumnHeadersSelected) {
898
+ visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow);
899
+ }
882
900
  var newVisualRow = _this2.instance.runHooks('beforeHighlightingRowHeader', visualRow, headerLevel, highlightMeta);
883
- return rowMapper.getRenderableFromVisualIndex(rowMapper.getNearestNotHiddenIndex(newVisualRow, 1));
901
+ if (!areColumnHeadersSelected) {
902
+ return rowMapper.getRenderableFromVisualIndex(rowMapper.getNearestNotHiddenIndex(newVisualRow, 1));
903
+ }
904
+ return newVisualRow;
884
905
  },
885
906
  onBeforeHighlightingColumnHeader: function onBeforeHighlightingColumnHeader(renderableColumn, headerLevel, highlightMeta) {
886
907
  var columnMapper = _this2.instance.columnIndexMapper;
887
- var visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn);
908
+ var areRowHeadersSelected = renderableColumn < 0;
909
+ var visualColumn = renderableColumn;
910
+ if (!areRowHeadersSelected) {
911
+ visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn);
912
+ }
888
913
  var newVisualColumn = _this2.instance.runHooks('beforeHighlightingColumnHeader', visualColumn, headerLevel, highlightMeta);
889
- return columnMapper.getRenderableFromVisualIndex(columnMapper.getNearestNotHiddenIndex(newVisualColumn, 1));
914
+ if (!areRowHeadersSelected) {
915
+ return columnMapper.getRenderableFromVisualIndex(columnMapper.getNearestNotHiddenIndex(newVisualColumn, 1));
916
+ }
917
+ return newVisualColumn;
890
918
  },
891
919
  onAfterDrawSelection: function onAfterDrawSelection(currentRow, currentColumn, layerLevel) {
892
920
  var cornersOfSelection;
@@ -31,6 +31,11 @@ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) {
31
31
  function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
32
32
  function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
33
33
  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; } }
34
+ var _observers = /*#__PURE__*/new WeakMap();
35
+ var _indexMatrix = /*#__PURE__*/new WeakMap();
36
+ var _currentIndexState = /*#__PURE__*/new WeakMap();
37
+ var _isMatrixIndexesInitialized = /*#__PURE__*/new WeakMap();
38
+ var _initialIndexValue = /*#__PURE__*/new WeakMap();
34
39
  /**
35
40
  * The ChangesObservable module is an object that represents a resource that provides
36
41
  * the ability to observe the changes that happened in the index map indexes during
@@ -39,68 +44,68 @@ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.
39
44
  * @private
40
45
  * @class ChangesObservable
41
46
  */
42
- var _observers = /*#__PURE__*/new WeakMap();
43
- var _indexMatrix = /*#__PURE__*/new WeakMap();
44
- var _currentIndexState = /*#__PURE__*/new WeakMap();
45
- var _isMatrixIndexesInitialized = /*#__PURE__*/new WeakMap();
46
- var _initialIndexValue = /*#__PURE__*/new WeakMap();
47
47
  var ChangesObservable = /*#__PURE__*/function () {
48
+ /**
49
+ * The list of registered ChangesObserver instances.
50
+ *
51
+ * @type {ChangesObserver[]}
52
+ */
53
+
54
+ /**
55
+ * An array with default values that act as a base array that will be compared with
56
+ * the last saved index state. The changes are generated and immediately send through
57
+ * the newly created ChangesObserver object. Thanks to that, the observer initially has
58
+ * all information about what indexes are currently changed.
59
+ *
60
+ * @type {Array}
61
+ */
62
+
63
+ /**
64
+ * An array that holds the indexes state that is currently valid. The value is changed on every
65
+ * index mapper cache update.
66
+ *
67
+ * @type {Array}
68
+ */
69
+
70
+ /**
71
+ * The flag determines if the observable is initialized or not. Not initialized object creates
72
+ * index matrix once while emitting new changes.
73
+ *
74
+ * @type {boolean}
75
+ */
76
+
77
+ /**
78
+ * The initial index value allows control from what value the index matrix array will be created.
79
+ * Changing that value changes how the array diff generates the changes for the initial data
80
+ * sent to the subscribers. For example, the changes can be triggered by detecting the changes
81
+ * from `false` to `true` value or vice versa. Generally, it depends on which index map type
82
+ * the Observable will work with. For "hiding" or "trimming" index types, it will be boolean
83
+ * values. For various index maps, it can be anything, but I suspect that the most appropriate
84
+ * initial value will be "undefined" in that case.
85
+ *
86
+ * @type {boolean}
87
+ */
88
+
48
89
  function ChangesObservable() {
49
90
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
50
91
  initialIndexValue = _ref.initialIndexValue;
51
92
  _classCallCheck(this, ChangesObservable);
52
- /**
53
- * The list of registered ChangesObserver instances.
54
- *
55
- * @type {ChangesObserver[]}
56
- */
57
93
  _classPrivateFieldInitSpec(this, _observers, {
58
94
  writable: true,
59
95
  value: new Set()
60
96
  });
61
- /**
62
- * An array with default values that act as a base array that will be compared with
63
- * the last saved index state. The changes are generated and immediately send through
64
- * the newly created ChangesObserver object. Thanks to that, the observer initially has
65
- * all information about what indexes are currently changed.
66
- *
67
- * @type {Array}
68
- */
69
97
  _classPrivateFieldInitSpec(this, _indexMatrix, {
70
98
  writable: true,
71
99
  value: []
72
100
  });
73
- /**
74
- * An array that holds the indexes state that is currently valid. The value is changed on every
75
- * index mapper cache update.
76
- *
77
- * @type {Array}
78
- */
79
101
  _classPrivateFieldInitSpec(this, _currentIndexState, {
80
102
  writable: true,
81
103
  value: []
82
104
  });
83
- /**
84
- * The flag determines if the observable is initialized or not. Not initialized object creates
85
- * index matrix once while emitting new changes.
86
- *
87
- * @type {boolean}
88
- */
89
105
  _classPrivateFieldInitSpec(this, _isMatrixIndexesInitialized, {
90
106
  writable: true,
91
107
  value: false
92
108
  });
93
- /**
94
- * The initial index value allows control from what value the index matrix array will be created.
95
- * Changing that value changes how the array diff generates the changes for the initial data
96
- * sent to the subscribers. For example, the changes can be triggered by detecting the changes
97
- * from `false` to `true` value or vice versa. Generally, it depends on which index map type
98
- * the Observable will work with. For "hiding" or "trimming" index types, it will be boolean
99
- * values. For various index maps, it can be anything, but I suspect that the most appropriate
100
- * initial value will be "undefined" in that case.
101
- *
102
- * @type {boolean}
103
- */
104
109
  _classPrivateFieldInitSpec(this, _initialIndexValue, {
105
110
  writable: true,
106
111
  value: false
@@ -41,62 +41,67 @@ var _currentIndexState = /*#__PURE__*/new WeakMap();
41
41
  var _isMatrixIndexesInitialized = /*#__PURE__*/new WeakMap();
42
42
  var _initialIndexValue = /*#__PURE__*/new WeakMap();
43
43
  export var ChangesObservable = /*#__PURE__*/function () {
44
+ /**
45
+ * The list of registered ChangesObserver instances.
46
+ *
47
+ * @type {ChangesObserver[]}
48
+ */
49
+
50
+ /**
51
+ * An array with default values that act as a base array that will be compared with
52
+ * the last saved index state. The changes are generated and immediately send through
53
+ * the newly created ChangesObserver object. Thanks to that, the observer initially has
54
+ * all information about what indexes are currently changed.
55
+ *
56
+ * @type {Array}
57
+ */
58
+
59
+ /**
60
+ * An array that holds the indexes state that is currently valid. The value is changed on every
61
+ * index mapper cache update.
62
+ *
63
+ * @type {Array}
64
+ */
65
+
66
+ /**
67
+ * The flag determines if the observable is initialized or not. Not initialized object creates
68
+ * index matrix once while emitting new changes.
69
+ *
70
+ * @type {boolean}
71
+ */
72
+
73
+ /**
74
+ * The initial index value allows control from what value the index matrix array will be created.
75
+ * Changing that value changes how the array diff generates the changes for the initial data
76
+ * sent to the subscribers. For example, the changes can be triggered by detecting the changes
77
+ * from `false` to `true` value or vice versa. Generally, it depends on which index map type
78
+ * the Observable will work with. For "hiding" or "trimming" index types, it will be boolean
79
+ * values. For various index maps, it can be anything, but I suspect that the most appropriate
80
+ * initial value will be "undefined" in that case.
81
+ *
82
+ * @type {boolean}
83
+ */
84
+
44
85
  function ChangesObservable() {
45
86
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
46
87
  initialIndexValue = _ref.initialIndexValue;
47
88
  _classCallCheck(this, ChangesObservable);
48
- /**
49
- * The list of registered ChangesObserver instances.
50
- *
51
- * @type {ChangesObserver[]}
52
- */
53
89
  _classPrivateFieldInitSpec(this, _observers, {
54
90
  writable: true,
55
91
  value: new Set()
56
92
  });
57
- /**
58
- * An array with default values that act as a base array that will be compared with
59
- * the last saved index state. The changes are generated and immediately send through
60
- * the newly created ChangesObserver object. Thanks to that, the observer initially has
61
- * all information about what indexes are currently changed.
62
- *
63
- * @type {Array}
64
- */
65
93
  _classPrivateFieldInitSpec(this, _indexMatrix, {
66
94
  writable: true,
67
95
  value: []
68
96
  });
69
- /**
70
- * An array that holds the indexes state that is currently valid. The value is changed on every
71
- * index mapper cache update.
72
- *
73
- * @type {Array}
74
- */
75
97
  _classPrivateFieldInitSpec(this, _currentIndexState, {
76
98
  writable: true,
77
99
  value: []
78
100
  });
79
- /**
80
- * The flag determines if the observable is initialized or not. Not initialized object creates
81
- * index matrix once while emitting new changes.
82
- *
83
- * @type {boolean}
84
- */
85
101
  _classPrivateFieldInitSpec(this, _isMatrixIndexesInitialized, {
86
102
  writable: true,
87
103
  value: false
88
104
  });
89
- /**
90
- * The initial index value allows control from what value the index matrix array will be created.
91
- * Changing that value changes how the array diff generates the changes for the initial data
92
- * sent to the subscribers. For example, the changes can be triggered by detecting the changes
93
- * from `false` to `true` value or vice versa. Generally, it depends on which index map type
94
- * the Observable will work with. For "hiding" or "trimming" index types, it will be boolean
95
- * values. For various index maps, it can be anything, but I suspect that the most appropriate
96
- * initial value will be "undefined" in that case.
97
- *
98
- * @type {boolean}
99
- */
100
105
  _classPrivateFieldInitSpec(this, _initialIndexValue, {
101
106
  writable: true,
102
107
  value: false
@@ -29,13 +29,13 @@ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.
29
29
  function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
30
30
  function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
31
31
  function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
32
+ var _currentInitialChanges = /*#__PURE__*/new WeakMap();
32
33
  /**
33
34
  * The ChangesObserver module is an object that represents a disposable resource
34
35
  * provided by the ChangesObservable module.
35
36
  *
36
37
  * @class ChangesObserver
37
38
  */
38
- var _currentInitialChanges = /*#__PURE__*/new WeakMap();
39
39
  var ChangesObserver = /*#__PURE__*/function () {
40
40
  function ChangesObserver() {
41
41
  _classCallCheck(this, ChangesObserver);
@@ -160,12 +160,6 @@ var IndexMapper = /*#__PURE__*/function () {
160
160
  * @type {boolean}
161
161
  */
162
162
  this.indexesSequenceChanged = false;
163
- /**
164
- * Flag informing about source of the change.
165
- *
166
- * @type {undefined|string}
167
- */
168
- this.indexesChangeSource = void 0;
169
163
  /**
170
164
  * Flag determining whether any action on trimmed indexes has been performed. It's used for cache management.
171
165
  *
@@ -206,7 +200,6 @@ var IndexMapper = /*#__PURE__*/function () {
206
200
 
207
201
  // Sequence of stored indexes might change.
208
202
  _this.updateCache();
209
- _this.runLocalHooks('indexesSequenceChange', _this.indexesChangeSource);
210
203
  _this.runLocalHooks('change', _this.indexesSequence, null);
211
204
  });
212
205
  this.trimmingMapsCollection.addLocalHook('change', function (changedMap) {
@@ -527,9 +520,7 @@ var IndexMapper = /*#__PURE__*/function () {
527
520
  this.notTrimmedIndexesCache = _toConsumableArray(new Array(length).keys());
528
521
  this.notHiddenIndexesCache = _toConsumableArray(new Array(length).keys());
529
522
  this.suspendOperations();
530
- this.indexesChangeSource = 'init';
531
523
  this.indexesSequence.init(length);
532
- this.indexesChangeSource = void 0;
533
524
  this.trimmingMapsCollection.initEvery(length);
534
525
  this.resumeOperations();
535
526
 
@@ -581,13 +572,7 @@ var IndexMapper = /*#__PURE__*/function () {
581
572
  }, {
582
573
  key: "setIndexesSequence",
583
574
  value: function setIndexesSequence(indexes) {
584
- if (this.indexesChangeSource === void 0) {
585
- this.indexesChangeSource = 'update';
586
- }
587
575
  this.indexesSequence.setValues(indexes);
588
- if (this.indexesChangeSource === 'update') {
589
- this.indexesChangeSource = void 0;
590
- }
591
576
  }
592
577
 
593
578
  /**
@@ -737,11 +722,9 @@ var IndexMapper = /*#__PURE__*/function () {
737
722
  })[finalIndex];
738
723
  destinationPosition = listWithRemovedItems.indexOf(physicalIndex);
739
724
  }
740
- this.indexesChangeSource = 'move';
741
725
 
742
726
  // Adding indexes without re-indexing.
743
727
  this.setIndexesSequence((0, _maps.getListWithInsertedItems)(listWithRemovedItems, destinationPosition, physicalMovedIndexes));
744
- this.indexesChangeSource = void 0;
745
728
  }
746
729
 
747
730
  /**
@@ -785,9 +768,7 @@ var IndexMapper = /*#__PURE__*/function () {
785
768
  return nextIndex + stepsFromStart;
786
769
  });
787
770
  this.suspendOperations();
788
- this.indexesChangeSource = 'insert';
789
771
  this.indexesSequence.insert(insertionIndex, insertedIndexes);
790
- this.indexesChangeSource = void 0;
791
772
  this.trimmingMapsCollection.insertToEvery(insertionIndex, insertedIndexes);
792
773
  this.hidingMapsCollection.insertToEvery(insertionIndex, insertedIndexes);
793
774
  this.variousMapsCollection.insertToEvery(insertionIndex, insertedIndexes);
@@ -804,9 +785,7 @@ var IndexMapper = /*#__PURE__*/function () {
804
785
  key: "removeIndexes",
805
786
  value: function removeIndexes(removedIndexes) {
806
787
  this.suspendOperations();
807
- this.indexesChangeSource = 'remove';
808
788
  this.indexesSequence.remove(removedIndexes);
809
- this.indexesChangeSource = void 0;
810
789
  this.trimmingMapsCollection.removeFromEvery(removedIndexes);
811
790
  this.hidingMapsCollection.removeFromEvery(removedIndexes);
812
791
  this.variousMapsCollection.removeFromEvery(removedIndexes);
@@ -155,12 +155,6 @@ export var IndexMapper = /*#__PURE__*/function () {
155
155
  * @type {boolean}
156
156
  */
157
157
  this.indexesSequenceChanged = false;
158
- /**
159
- * Flag informing about source of the change.
160
- *
161
- * @type {undefined|string}
162
- */
163
- this.indexesChangeSource = void 0;
164
158
  /**
165
159
  * Flag determining whether any action on trimmed indexes has been performed. It's used for cache management.
166
160
  *
@@ -201,7 +195,6 @@ export var IndexMapper = /*#__PURE__*/function () {
201
195
 
202
196
  // Sequence of stored indexes might change.
203
197
  _this.updateCache();
204
- _this.runLocalHooks('indexesSequenceChange', _this.indexesChangeSource);
205
198
  _this.runLocalHooks('change', _this.indexesSequence, null);
206
199
  });
207
200
  this.trimmingMapsCollection.addLocalHook('change', function (changedMap) {
@@ -522,9 +515,7 @@ export var IndexMapper = /*#__PURE__*/function () {
522
515
  this.notTrimmedIndexesCache = _toConsumableArray(new Array(length).keys());
523
516
  this.notHiddenIndexesCache = _toConsumableArray(new Array(length).keys());
524
517
  this.suspendOperations();
525
- this.indexesChangeSource = 'init';
526
518
  this.indexesSequence.init(length);
527
- this.indexesChangeSource = void 0;
528
519
  this.trimmingMapsCollection.initEvery(length);
529
520
  this.resumeOperations();
530
521
 
@@ -576,13 +567,7 @@ export var IndexMapper = /*#__PURE__*/function () {
576
567
  }, {
577
568
  key: "setIndexesSequence",
578
569
  value: function setIndexesSequence(indexes) {
579
- if (this.indexesChangeSource === void 0) {
580
- this.indexesChangeSource = 'update';
581
- }
582
570
  this.indexesSequence.setValues(indexes);
583
- if (this.indexesChangeSource === 'update') {
584
- this.indexesChangeSource = void 0;
585
- }
586
571
  }
587
572
 
588
573
  /**
@@ -732,11 +717,9 @@ export var IndexMapper = /*#__PURE__*/function () {
732
717
  })[finalIndex];
733
718
  destinationPosition = listWithRemovedItems.indexOf(physicalIndex);
734
719
  }
735
- this.indexesChangeSource = 'move';
736
720
 
737
721
  // Adding indexes without re-indexing.
738
722
  this.setIndexesSequence(getListWithInsertedItems(listWithRemovedItems, destinationPosition, physicalMovedIndexes));
739
- this.indexesChangeSource = void 0;
740
723
  }
741
724
 
742
725
  /**
@@ -780,9 +763,7 @@ export var IndexMapper = /*#__PURE__*/function () {
780
763
  return nextIndex + stepsFromStart;
781
764
  });
782
765
  this.suspendOperations();
783
- this.indexesChangeSource = 'insert';
784
766
  this.indexesSequence.insert(insertionIndex, insertedIndexes);
785
- this.indexesChangeSource = void 0;
786
767
  this.trimmingMapsCollection.insertToEvery(insertionIndex, insertedIndexes);
787
768
  this.hidingMapsCollection.insertToEvery(insertionIndex, insertedIndexes);
788
769
  this.variousMapsCollection.insertToEvery(insertionIndex, insertedIndexes);
@@ -799,9 +780,7 @@ export var IndexMapper = /*#__PURE__*/function () {
799
780
  key: "removeIndexes",
800
781
  value: function removeIndexes(removedIndexes) {
801
782
  this.suspendOperations();
802
- this.indexesChangeSource = 'remove';
803
783
  this.indexesSequence.remove(removedIndexes);
804
- this.indexesChangeSource = void 0;
805
784
  this.trimmingMapsCollection.removeFromEvery(removedIndexes);
806
785
  this.hidingMapsCollection.removeFromEvery(removedIndexes);
807
786
  this.variousMapsCollection.removeFromEvery(removedIndexes);
@@ -130,25 +130,28 @@ var TRAVERSAL_STRATEGIES = new Map([[TRAVERSAL_DF_PRE, depthFirstPreOrder], [TRA
130
130
  *
131
131
  */
132
132
  var TreeNode = /*#__PURE__*/function () {
133
+ /**
134
+ * A tree data.
135
+ *
136
+ * @type {object}
137
+ */
138
+
139
+ /**
140
+ * A parent node.
141
+ *
142
+ * @type {TreeNode}
143
+ */
144
+
145
+ /**
146
+ * A tree leaves.
147
+ *
148
+ * @type {TreeNode[]}
149
+ */
150
+
133
151
  function TreeNode(data) {
134
152
  _classCallCheck(this, TreeNode);
135
- /**
136
- * A tree data.
137
- *
138
- * @type {object}
139
- */
140
153
  _defineProperty(this, "data", {});
141
- /**
142
- * A parent node.
143
- *
144
- * @type {TreeNode}
145
- */
146
154
  _defineProperty(this, "parent", null);
147
- /**
148
- * A tree leaves.
149
- *
150
- * @type {TreeNode[]}
151
- */
152
155
  _defineProperty(this, "childs", []);
153
156
  this.data = data;
154
157
  }
@@ -122,25 +122,28 @@ var TRAVERSAL_STRATEGIES = new Map([[TRAVERSAL_DF_PRE, depthFirstPreOrder], [TRA
122
122
  *
123
123
  */
124
124
  var TreeNode = /*#__PURE__*/function () {
125
+ /**
126
+ * A tree data.
127
+ *
128
+ * @type {object}
129
+ */
130
+
131
+ /**
132
+ * A parent node.
133
+ *
134
+ * @type {TreeNode}
135
+ */
136
+
137
+ /**
138
+ * A tree leaves.
139
+ *
140
+ * @type {TreeNode[]}
141
+ */
142
+
125
143
  function TreeNode(data) {
126
144
  _classCallCheck(this, TreeNode);
127
- /**
128
- * A tree data.
129
- *
130
- * @type {object}
131
- */
132
145
  _defineProperty(this, "data", {});
133
- /**
134
- * A parent node.
135
- *
136
- * @type {TreeNode}
137
- */
138
146
  _defineProperty(this, "parent", null);
139
- /**
140
- * A tree leaves.
141
- *
142
- * @type {TreeNode[]}
143
- */
144
147
  _defineProperty(this, "childs", []);
145
148
  this.data = data;
146
149
  }