handsontable 0.0.0-next-b66c79f-20230713 → 0.0.0-next-85c3085-20230713

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 (133) hide show
  1. package/3rdparty/walkontable/src/cell/coords.js +37 -22
  2. package/3rdparty/walkontable/src/cell/coords.mjs +37 -22
  3. package/3rdparty/walkontable/src/cell/range.js +54 -39
  4. package/3rdparty/walkontable/src/cell/range.mjs +54 -39
  5. package/3rdparty/walkontable/src/core/_base.js +33 -31
  6. package/3rdparty/walkontable/src/core/_base.mjs +33 -31
  7. package/3rdparty/walkontable/src/core/clone.js +6 -3
  8. package/3rdparty/walkontable/src/core/clone.mjs +6 -3
  9. package/3rdparty/walkontable/src/event.js +2 -1
  10. package/3rdparty/walkontable/src/event.mjs +2 -1
  11. package/3rdparty/walkontable/src/overlay/_base.js +10 -8
  12. package/3rdparty/walkontable/src/overlay/_base.mjs +10 -8
  13. package/3rdparty/walkontable/src/overlay/bottom.js +10 -8
  14. package/3rdparty/walkontable/src/overlay/bottom.mjs +10 -8
  15. package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -1
  16. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +1 -1
  17. package/3rdparty/walkontable/src/overlay/top.js +11 -9
  18. package/3rdparty/walkontable/src/overlay/top.mjs +11 -9
  19. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +16 -13
  20. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +16 -13
  21. package/3rdparty/walkontable/src/overlays.js +75 -80
  22. package/3rdparty/walkontable/src/overlays.mjs +75 -80
  23. package/3rdparty/walkontable/src/scroll.js +27 -24
  24. package/3rdparty/walkontable/src/scroll.mjs +27 -24
  25. package/3rdparty/walkontable/src/settings.js +18 -17
  26. package/3rdparty/walkontable/src/settings.mjs +18 -17
  27. package/3rdparty/walkontable/src/table.js +42 -37
  28. package/3rdparty/walkontable/src/table.mjs +42 -37
  29. package/base.js +2 -2
  30. package/base.mjs +2 -2
  31. package/core.js +8 -8
  32. package/core.mjs +8 -8
  33. package/dataMap/metaManager/metaLayers/cellMeta.js +2 -1
  34. package/dataMap/metaManager/metaLayers/cellMeta.mjs +2 -1
  35. package/dataMap/metaManager/metaLayers/globalMeta.js +1 -1
  36. package/dataMap/metaManager/metaLayers/globalMeta.mjs +1 -1
  37. package/dataMap/metaManager/mods/dynamicCellMeta.js +3 -2
  38. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +3 -2
  39. package/dataMap/metaManager/utils.js +4 -2
  40. package/dataMap/metaManager/utils.mjs +4 -2
  41. package/dist/handsontable.css +2 -2
  42. package/dist/handsontable.full.css +2 -2
  43. package/dist/handsontable.full.js +3247 -2847
  44. package/dist/handsontable.full.min.css +2 -2
  45. package/dist/handsontable.full.min.js +17 -17
  46. package/dist/handsontable.js +3249 -2849
  47. package/dist/handsontable.min.css +2 -2
  48. package/dist/handsontable.min.js +17 -17
  49. package/editors/autocompleteEditor/autocompleteEditor.js +70 -67
  50. package/editors/autocompleteEditor/autocompleteEditor.mjs +70 -67
  51. package/editors/baseEditor/baseEditor.js +1 -1
  52. package/editors/baseEditor/baseEditor.mjs +1 -1
  53. package/editors/dateEditor/dateEditor.js +2 -1
  54. package/editors/dateEditor/dateEditor.mjs +2 -1
  55. package/helpers/mixed.js +1 -1
  56. package/helpers/mixed.mjs +1 -1
  57. package/helpers/object.js +1 -0
  58. package/helpers/object.mjs +1 -0
  59. package/index.js +5 -5
  60. package/index.mjs +5 -5
  61. package/package.json +1 -1
  62. package/plugins/autoColumnSize/autoColumnSize.js +4 -1
  63. package/plugins/autoColumnSize/autoColumnSize.mjs +4 -1
  64. package/plugins/collapsibleColumns/collapsibleColumns.js +54 -38
  65. package/plugins/collapsibleColumns/collapsibleColumns.mjs +54 -38
  66. package/plugins/columnSorting/columnSorting.js +2 -1
  67. package/plugins/columnSorting/columnSorting.mjs +2 -1
  68. package/plugins/columnSorting/columnStatesManager.js +2 -1
  69. package/plugins/columnSorting/columnStatesManager.mjs +2 -1
  70. package/plugins/comments/comments.js +2 -2
  71. package/plugins/comments/comments.mjs +2 -2
  72. package/plugins/copyPaste/copyPaste.js +6 -4
  73. package/plugins/copyPaste/copyPaste.mjs +6 -4
  74. package/plugins/customBorders/customBorders.js +13 -9
  75. package/plugins/customBorders/customBorders.mjs +13 -9
  76. package/plugins/customBorders/utils.js +3 -3
  77. package/plugins/customBorders/utils.mjs +3 -3
  78. package/plugins/filters/conditionCollection.js +6 -5
  79. package/plugins/filters/conditionCollection.mjs +6 -5
  80. package/plugins/filters/filters.js +13 -7
  81. package/plugins/filters/filters.mjs +13 -7
  82. package/plugins/formulas/engine/register.js +3 -3
  83. package/plugins/formulas/engine/register.mjs +3 -3
  84. package/plugins/formulas/engine/settings.js +6 -3
  85. package/plugins/formulas/engine/settings.mjs +6 -3
  86. package/plugins/formulas/formulas.js +151 -143
  87. package/plugins/formulas/formulas.mjs +151 -143
  88. package/plugins/formulas/indexSyncer/axisSyncer.js +115 -79
  89. package/plugins/formulas/indexSyncer/axisSyncer.mjs +115 -79
  90. package/plugins/formulas/indexSyncer/index.js +100 -64
  91. package/plugins/formulas/indexSyncer/index.mjs +100 -64
  92. package/plugins/hiddenColumns/contextMenuItem/showColumn.js +2 -2
  93. package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +2 -2
  94. package/plugins/hiddenColumns/hiddenColumns.js +51 -34
  95. package/plugins/hiddenColumns/hiddenColumns.mjs +51 -34
  96. package/plugins/hiddenRows/contextMenuItem/showRow.js +2 -2
  97. package/plugins/hiddenRows/contextMenuItem/showRow.mjs +2 -2
  98. package/plugins/hiddenRows/hiddenRows.js +50 -33
  99. package/plugins/hiddenRows/hiddenRows.mjs +50 -33
  100. package/plugins/manualRowResize/manualRowResize.js +2 -1
  101. package/plugins/manualRowResize/manualRowResize.mjs +2 -1
  102. package/plugins/mergeCells/mergeCells.js +1 -1
  103. package/plugins/mergeCells/mergeCells.mjs +1 -1
  104. package/plugins/nestedHeaders/nestedHeaders.js +88 -67
  105. package/plugins/nestedHeaders/nestedHeaders.mjs +87 -66
  106. package/plugins/nestedHeaders/stateManager/headersTree.js +58 -38
  107. package/plugins/nestedHeaders/stateManager/headersTree.mjs +58 -38
  108. package/plugins/nestedHeaders/stateManager/index.js +70 -49
  109. package/plugins/nestedHeaders/stateManager/index.mjs +68 -47
  110. package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.js +1 -1
  111. package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +1 -1
  112. package/plugins/nestedHeaders/stateManager/sourceSettings.js +57 -37
  113. package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +57 -37
  114. package/plugins/nestedHeaders/utils/ghostTable.js +39 -35
  115. package/plugins/nestedHeaders/utils/ghostTable.mjs +39 -35
  116. package/plugins/nestedRows/data/dataManager.js +4 -2
  117. package/plugins/nestedRows/data/dataManager.mjs +4 -2
  118. package/plugins/persistentState/storage.js +1 -0
  119. package/plugins/persistentState/storage.mjs +1 -0
  120. package/plugins/undoRedo/undoRedo.js +2 -1
  121. package/plugins/undoRedo/undoRedo.mjs +2 -1
  122. package/selection/highlight/visualSelection.js +10 -6
  123. package/selection/highlight/visualSelection.mjs +10 -6
  124. package/tableView.js +98 -80
  125. package/tableView.mjs +98 -80
  126. package/translations/changesObservable/observable.js +82 -54
  127. package/translations/changesObservable/observable.mjs +82 -54
  128. package/translations/changesObservable/observer.js +24 -11
  129. package/translations/changesObservable/observer.mjs +24 -11
  130. package/translations/maps/linkedPhysicalIndexToValueMap.js +14 -8
  131. package/translations/maps/linkedPhysicalIndexToValueMap.mjs +14 -8
  132. package/utils/dataStructures/tree.js +21 -18
  133. package/utils/dataStructures/tree.mjs +21 -18
@@ -1,4 +1,15 @@
1
1
  import "core-js/modules/es.array.push.js";
2
+ import "core-js/modules/es.error.cause.js";
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
7
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
8
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
9
+ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
10
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
11
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
12
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
2
13
  import { addClass, removeClass } from "../../helpers/dom/element.mjs";
3
14
  import { isNumeric } from "../../helpers/number.mjs";
4
15
  import { isLeftClick, isRightClick } from "../../helpers/dom/event.mjs";
@@ -56,46 +67,54 @@ export const PLUGIN_PRIORITY = 280;
56
67
  * ```
57
68
  * :::
58
69
  */
70
+ var _stateManager = /*#__PURE__*/new WeakMap();
71
+ var _hidingIndexMapObserver = /*#__PURE__*/new WeakMap();
59
72
  export class NestedHeaders extends BasePlugin {
73
+ constructor() {
74
+ super(...arguments);
75
+ /**
76
+ * The state manager for the nested headers.
77
+ *
78
+ * @private
79
+ * @type {StateManager}
80
+ */
81
+ _classPrivateFieldInitSpec(this, _stateManager, {
82
+ writable: true,
83
+ value: new StateManager()
84
+ });
85
+ /**
86
+ * The instance of the ChangesObservable class that allows track the changes that happens in the
87
+ * column indexes.
88
+ *
89
+ * @private
90
+ * @type {ChangesObservable}
91
+ */
92
+ _classPrivateFieldInitSpec(this, _hidingIndexMapObserver, {
93
+ writable: true,
94
+ value: null
95
+ });
96
+ /**
97
+ * Custom helper for getting widths of the nested headers.
98
+ *
99
+ * @private
100
+ * @type {GhostTable}
101
+ */
102
+ // @TODO This should be changed after refactor handsontable/utils/ghostTable.
103
+ _defineProperty(this, "ghostTable", new GhostTable(this.hot, (row, column) => this.getHeaderSettings(row, column)));
104
+ /**
105
+ * The flag which determines that the nested header settings contains overlapping headers
106
+ * configuration.
107
+ *
108
+ * @type {boolean}
109
+ */
110
+ _defineProperty(this, "detectedOverlappedHeaders", false);
111
+ }
60
112
  static get PLUGIN_KEY() {
61
113
  return PLUGIN_KEY;
62
114
  }
63
115
  static get PLUGIN_PRIORITY() {
64
116
  return PLUGIN_PRIORITY;
65
117
  }
66
-
67
- /**
68
- * The state manager for the nested headers.
69
- *
70
- * @private
71
- * @type {StateManager}
72
- */
73
- #stateManager = new StateManager();
74
- /**
75
- * The instance of the ChangesObservable class that allows track the changes that happens in the
76
- * column indexes.
77
- *
78
- * @private
79
- * @type {ChangesObservable}
80
- */
81
- #hidingIndexMapObserver = null;
82
- /**
83
- * Custom helper for getting widths of the nested headers.
84
- *
85
- * @private
86
- * @type {GhostTable}
87
- */
88
- // @TODO This should be changed after refactor handsontable/utils/ghostTable.
89
- ghostTable = new GhostTable(this.hot, (row, column) => this.getHeaderSettings(row, column));
90
-
91
- /**
92
- * The flag which determines that the nested header settings contains overlapping headers
93
- * configuration.
94
- *
95
- * @type {boolean}
96
- */
97
- detectedOverlappedHeaders = false;
98
-
99
118
  /**
100
119
  * Check if plugin is enabled.
101
120
  *
@@ -167,9 +186,9 @@ export class NestedHeaders extends BasePlugin {
167
186
  const {
168
187
  nestedHeaders
169
188
  } = this.hot.getSettings();
170
- this.#stateManager.setColumnsLimit(this.hot.countCols());
189
+ _classPrivateFieldGet(this, _stateManager).setColumnsLimit(this.hot.countCols());
171
190
  if (Array.isArray(nestedHeaders)) {
172
- this.detectedOverlappedHeaders = this.#stateManager.setState(nestedHeaders);
191
+ this.detectedOverlappedHeaders = _classPrivateFieldGet(this, _stateManager).setState(nestedHeaders);
173
192
  }
174
193
  if (this.detectedOverlappedHeaders) {
175
194
  warn(toSingleLine`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
@@ -181,11 +200,11 @@ export class NestedHeaders extends BasePlugin {
181
200
  // as if all the columns are visible, needs to be modified to be in sync with a dataset.
182
201
  this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((isColumnHidden, physicalColumnIndex) => {
183
202
  const actionName = isColumnHidden === true ? 'hide-column' : 'show-column';
184
- this.#stateManager.triggerColumnModification(actionName, physicalColumnIndex);
203
+ _classPrivateFieldGet(this, _stateManager).triggerColumnModification(actionName, physicalColumnIndex);
185
204
  });
186
205
  }
187
- if (!this.#hidingIndexMapObserver && this.enabled) {
188
- this.#hidingIndexMapObserver = this.hot.columnIndexMapper.createChangesObserver('hiding').subscribe(changes => {
206
+ if (!_classPrivateFieldGet(this, _hidingIndexMapObserver) && this.enabled) {
207
+ _classPrivateFieldSet(this, _hidingIndexMapObserver, this.hot.columnIndexMapper.createChangesObserver('hiding').subscribe(changes => {
189
208
  changes.forEach(_ref => {
190
209
  let {
191
210
  op,
@@ -194,11 +213,11 @@ export class NestedHeaders extends BasePlugin {
194
213
  } = _ref;
195
214
  if (op === 'replace') {
196
215
  const actionName = newValue === true ? 'hide-column' : 'show-column';
197
- this.#stateManager.triggerColumnModification(actionName, columnIndex);
216
+ _classPrivateFieldGet(this, _stateManager).triggerColumnModification(actionName, columnIndex);
198
217
  }
199
218
  });
200
219
  this.ghostTable.buildWidthsMap();
201
- });
220
+ }));
202
221
  }
203
222
  this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap();
204
223
  super.updatePlugin();
@@ -209,9 +228,9 @@ export class NestedHeaders extends BasePlugin {
209
228
  */
210
229
  disablePlugin() {
211
230
  this.clearColspans();
212
- this.#stateManager.clear();
213
- this.#hidingIndexMapObserver.unsubscribe();
214
- this.#hidingIndexMapObserver = null;
231
+ _classPrivateFieldGet(this, _stateManager).clear();
232
+ _classPrivateFieldGet(this, _hidingIndexMapObserver).unsubscribe();
233
+ _classPrivateFieldSet(this, _hidingIndexMapObserver, null);
215
234
  this.ghostTable.clear();
216
235
  super.disablePlugin();
217
236
  }
@@ -223,7 +242,7 @@ export class NestedHeaders extends BasePlugin {
223
242
  * @returns {StateManager}
224
243
  */
225
244
  getStateManager() {
226
- return this.#stateManager;
245
+ return _classPrivateFieldGet(this, _stateManager);
227
246
  }
228
247
 
229
248
  /**
@@ -233,7 +252,7 @@ export class NestedHeaders extends BasePlugin {
233
252
  * @returns {number}
234
253
  */
235
254
  getLayersCount() {
236
- return this.#stateManager.getLayersCount();
255
+ return _classPrivateFieldGet(this, _stateManager).getLayersCount();
237
256
  }
238
257
 
239
258
  /**
@@ -247,7 +266,7 @@ export class NestedHeaders extends BasePlugin {
247
266
  * @returns {object}
248
267
  */
249
268
  getHeaderSettings(headerLevel, columnIndex) {
250
- return this.#stateManager.getHeaderSettings(headerLevel, columnIndex);
269
+ return _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, columnIndex);
251
270
  }
252
271
 
253
272
  /**
@@ -301,7 +320,7 @@ export class NestedHeaders extends BasePlugin {
301
320
  var _this2 = this;
302
321
  const fixedColumnsStart = this.hot.view._wt.getSetting('fixedColumnsStart');
303
322
  return (renderedColumnIndex, TH) => {
304
- var _this$stateManager$ge;
323
+ var _classPrivateFieldGet2;
305
324
  const {
306
325
  columnIndexMapper,
307
326
  view
@@ -316,17 +335,18 @@ export class NestedHeaders extends BasePlugin {
316
335
  colspan,
317
336
  isHidden,
318
337
  isPlaceholder
319
- } = (_this$stateManager$ge = this.#stateManager.getHeaderSettings(headerLevel, visualColumnIndex)) != null ? _this$stateManager$ge : {
338
+ } = (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : {
320
339
  label: ''
321
340
  };
322
341
  if (isPlaceholder || isHidden) {
323
342
  addClass(TH, 'hiddenHeader');
324
343
  } else if (colspan > 1) {
344
+ var _wtOverlays$topInline, _wtOverlays$inlineSta;
325
345
  const {
326
346
  wtOverlays
327
347
  } = view._wt;
328
- const isTopInlineStartOverlay = wtOverlays.topInlineStartCornerOverlay?.clone.wtTable.THEAD.contains(TH);
329
- const isInlineStartOverlay = wtOverlays.inlineStartOverlay?.clone.wtTable.THEAD.contains(TH);
348
+ const isTopInlineStartOverlay = (_wtOverlays$topInline = wtOverlays.topInlineStartCornerOverlay) === null || _wtOverlays$topInline === void 0 ? void 0 : _wtOverlays$topInline.clone.wtTable.THEAD.contains(TH);
349
+ const isInlineStartOverlay = (_wtOverlays$inlineSta = wtOverlays.inlineStartOverlay) === null || _wtOverlays$inlineSta === void 0 ? void 0 : _wtOverlays$inlineSta.clone.wtTable.THEAD.contains(TH);
330
350
 
331
351
  // Check if there is a fixed column enabled, if so then reduce colspan to fixed column width.
332
352
  const correctedColspan = isTopInlineStartOverlay || isInlineStartOverlay ? Math.min(colspan, fixedColumnsStart - renderedColumnIndex) : colspan;
@@ -352,11 +372,11 @@ export class NestedHeaders extends BasePlugin {
352
372
  * @returns {string} Returns the column header value to update.
353
373
  */
354
374
  getColumnHeaderValue(visualColumnIndex, headerLevel) {
355
- var _this$stateManager$ge2;
375
+ var _classPrivateFieldGet3;
356
376
  const {
357
377
  isHidden,
358
378
  isPlaceholder
359
- } = (_this$stateManager$ge2 = this.#stateManager.getHeaderSettings(headerLevel, visualColumnIndex)) != null ? _this$stateManager$ge2 : {};
379
+ } = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : {};
360
380
  if (isPlaceholder || isHidden) {
361
381
  return '';
362
382
  }
@@ -373,7 +393,7 @@ export class NestedHeaders extends BasePlugin {
373
393
  * @returns {number}
374
394
  */
375
395
  onBeforeHighlightingColumnHeader(visualColumn, headerLevel, highlightMeta) {
376
- const headerNodeData = this.#stateManager.getHeaderTreeNodeData(headerLevel, visualColumn);
396
+ const headerNodeData = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumn);
377
397
  if (!headerNodeData) {
378
398
  return visualColumn;
379
399
  }
@@ -386,7 +406,7 @@ export class NestedHeaders extends BasePlugin {
386
406
  const {
387
407
  isRoot,
388
408
  colspan
389
- } = this.#stateManager.getHeaderSettings(headerLevel, visualColumn);
409
+ } = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumn);
390
410
  if (selectionType === HEADER_TYPE) {
391
411
  if (!isRoot) {
392
412
  return headerNodeData.columnIndex;
@@ -435,13 +455,14 @@ export class NestedHeaders extends BasePlugin {
435
455
  }
436
456
  for (let column = startCol; column <= endCol; column++) {
437
457
  for (let row = startRow; row <= endRow; row++) {
458
+ var _classPrivateFieldGet4;
438
459
  const zeroBasedColumnHeaderLevel = rowsCount + row;
439
460
  const zeroBasedColumnIndex = column - startCol;
440
461
  if (zeroBasedColumnIndex === 0) {
441
462
  continue; // eslint-disable-line no-continue
442
463
  }
443
464
 
444
- const isRoot = this.#stateManager.getHeaderTreeNodeData(row, column)?.isRoot;
465
+ const isRoot = (_classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(row, column)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4.isRoot;
445
466
  if (isRoot === false) {
446
467
  data[zeroBasedColumnHeaderLevel][zeroBasedColumnIndex] = '';
447
468
  }
@@ -564,7 +585,7 @@ export class NestedHeaders extends BasePlugin {
564
585
  */
565
586
  onAfterGetColumnHeaderRenderers(renderersArray) {
566
587
  renderersArray.length = 0;
567
- for (let headerLayer = 0; headerLayer < this.#stateManager.getLayersCount(); headerLayer++) {
588
+ for (let headerLayer = 0; headerLayer < _classPrivateFieldGet(this, _stateManager).getLayersCount(); headerLayer++) {
568
589
  renderersArray.push(this.headerRendererFactory(headerLayer));
569
590
  }
570
591
  }
@@ -576,11 +597,11 @@ export class NestedHeaders extends BasePlugin {
576
597
  * @param {object} calc Viewport column calculator.
577
598
  */
578
599
  onAfterViewportColumnCalculatorOverride(calc) {
579
- const headerLayersCount = this.#stateManager.getLayersCount();
600
+ const headerLayersCount = _classPrivateFieldGet(this, _stateManager).getLayersCount();
580
601
  let newStartColumn = calc.startColumn;
581
602
  let nonRenderable = !!headerLayersCount;
582
603
  for (let headerLayer = 0; headerLayer < headerLayersCount; headerLayer++) {
583
- const startColumn = this.#stateManager.findLeftMostColumnIndex(headerLayer, calc.startColumn);
604
+ const startColumn = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(headerLayer, calc.startColumn);
584
605
  const renderedStartColumn = this.hot.columnIndexMapper.getRenderableFromVisualIndex(startColumn);
585
606
 
586
607
  // If any of the headers for that column index is rendered, all of them should be rendered properly, see
@@ -599,7 +620,7 @@ export class NestedHeaders extends BasePlugin {
599
620
 
600
621
  // If no headers for the provided column index are renderable, start rendering from the beginning of the upmost
601
622
  // header for that position.
602
- calc.startColumn = nonRenderable ? this.#stateManager.getHeaderTreeNodeData(0, newStartColumn).columnIndex : newStartColumn;
623
+ calc.startColumn = nonRenderable ? _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(0, newStartColumn).columnIndex : newStartColumn;
603
624
  }
604
625
 
605
626
  /**
@@ -629,10 +650,10 @@ export class NestedHeaders extends BasePlugin {
629
650
  * @returns {string} Returns the column header value to update.
630
651
  */
631
652
  onModifyColumnHeaderValue(value, visualColumnIndex, headerLevel) {
632
- var _this$stateManager$ge3;
653
+ var _classPrivateFieldGet5;
633
654
  const {
634
655
  label
635
- } = (_this$stateManager$ge3 = this.#stateManager.getHeaderTreeNodeData(headerLevel, visualColumnIndex)) != null ? _this$stateManager$ge3 : {
656
+ } = (_classPrivateFieldGet5 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet5 !== void 0 ? _classPrivateFieldGet5 : {
636
657
  label: ''
637
658
  };
638
659
  return label;
@@ -666,10 +687,10 @@ export class NestedHeaders extends BasePlugin {
666
687
  * Destroys the plugin instance.
667
688
  */
668
689
  destroy() {
669
- this.#stateManager = null;
670
- if (this.#hidingIndexMapObserver !== null) {
671
- this.#hidingIndexMapObserver.unsubscribe();
672
- this.#hidingIndexMapObserver = null;
690
+ _classPrivateFieldSet(this, _stateManager, null);
691
+ if (_classPrivateFieldGet(this, _hidingIndexMapObserver) !== null) {
692
+ _classPrivateFieldGet(this, _hidingIndexMapObserver).unsubscribe();
693
+ _classPrivateFieldSet(this, _hidingIndexMapObserver, null);
673
694
  }
674
695
  super.destroy();
675
696
  }
@@ -685,6 +706,6 @@ export class NestedHeaders extends BasePlugin {
685
706
  if (coords.row >= 0 || coords.col < 0) {
686
707
  return;
687
708
  }
688
- return this.#stateManager.getHeaderTreeNodeData(coords.row, coords.col);
709
+ return _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(coords.row, coords.col);
689
710
  }
690
711
  }
@@ -1,9 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
+ require("core-js/modules/es.error.cause.js");
4
5
  var _array = require("../../../helpers/array");
5
6
  var _tree = _interopRequireDefault(require("../../../utils/dataStructures/tree"));
6
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
9
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
10
+ function _classPrivateFieldGet(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; } }
7
15
  /* eslint-disable jsdoc/require-description-complete-sentence */
8
16
  /**
9
17
  * @private
@@ -40,32 +48,44 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
40
48
  *
41
49
  */
42
50
  /* eslint-enable jsdoc/require-description-complete-sentence */
51
+ var _rootNodes = /*#__PURE__*/new WeakMap();
52
+ var _rootsIndex = /*#__PURE__*/new WeakMap();
53
+ var _sourceSettings = /*#__PURE__*/new WeakMap();
43
54
  class HeadersTree {
44
- /**
45
- * The collection of nested headers settings structured into trees. The root trees are stored
46
- * under the visual column index.
47
- *
48
- * @private
49
- * @type {Map<number, TreeNode>}
50
- */
51
- #rootNodes = new Map();
52
- /**
53
- * A map that translates the visual column indexes that intersect the range
54
- * defined by the header colspan width to the root index.
55
- *
56
- * @private
57
- * @type {Map<number, number>}
58
- */
59
- #rootsIndex = new Map();
60
- /**
61
- * The instance of the SourceSettings class.
62
- *
63
- * @private
64
- * @type {SourceSettings}
65
- */
66
- #sourceSettings = null;
67
55
  constructor(sourceSettings) {
68
- this.#sourceSettings = sourceSettings;
56
+ /**
57
+ * The collection of nested headers settings structured into trees. The root trees are stored
58
+ * under the visual column index.
59
+ *
60
+ * @private
61
+ * @type {Map<number, TreeNode>}
62
+ */
63
+ _classPrivateFieldInitSpec(this, _rootNodes, {
64
+ writable: true,
65
+ value: new Map()
66
+ });
67
+ /**
68
+ * A map that translates the visual column indexes that intersect the range
69
+ * defined by the header colspan width to the root index.
70
+ *
71
+ * @private
72
+ * @type {Map<number, number>}
73
+ */
74
+ _classPrivateFieldInitSpec(this, _rootsIndex, {
75
+ writable: true,
76
+ value: new Map()
77
+ });
78
+ /**
79
+ * The instance of the SourceSettings class.
80
+ *
81
+ * @private
82
+ * @type {SourceSettings}
83
+ */
84
+ _classPrivateFieldInitSpec(this, _sourceSettings, {
85
+ writable: true,
86
+ value: null
87
+ });
88
+ _classPrivateFieldSet(this, _sourceSettings, sourceSettings);
69
89
  }
70
90
 
71
91
  /**
@@ -74,7 +94,7 @@ class HeadersTree {
74
94
  * @returns {TreeNode[]}
75
95
  */
76
96
  getRoots() {
77
- return Array.from(this.#rootNodes.values());
97
+ return Array.from(_classPrivateFieldGet(this, _rootNodes).values());
78
98
  }
79
99
 
80
100
  /**
@@ -85,8 +105,8 @@ class HeadersTree {
85
105
  */
86
106
  getRootByColumn(columnIndex) {
87
107
  let node;
88
- if (this.#rootsIndex.has(columnIndex)) {
89
- node = this.#rootNodes.get(this.#rootsIndex.get(columnIndex));
108
+ if (_classPrivateFieldGet(this, _rootsIndex).has(columnIndex)) {
109
+ node = _classPrivateFieldGet(this, _rootNodes).get(_classPrivateFieldGet(this, _rootsIndex).get(columnIndex));
90
110
  }
91
111
  return node;
92
112
  }
@@ -106,7 +126,7 @@ class HeadersTree {
106
126
 
107
127
  // Normalize the visual column index to a 0-based system for a specific "box" defined
108
128
  // by root node colspan width.
109
- const normColumnIndex = columnIndex - this.#rootsIndex.get(columnIndex);
129
+ const normColumnIndex = columnIndex - _classPrivateFieldGet(this, _rootsIndex).get(columnIndex);
110
130
  let columnCursor = 0;
111
131
  let treeNode;
112
132
 
@@ -136,8 +156,8 @@ class HeadersTree {
136
156
  */
137
157
  rebuildTreeIndex() {
138
158
  let columnIndex = 0;
139
- this.#rootsIndex.clear();
140
- (0, _array.arrayEach)(this.#rootNodes, _ref => {
159
+ _classPrivateFieldGet(this, _rootsIndex).clear();
160
+ (0, _array.arrayEach)(_classPrivateFieldGet(this, _rootNodes), _ref => {
141
161
  let [, {
142
162
  data: {
143
163
  colspan
@@ -145,7 +165,7 @@ class HeadersTree {
145
165
  }] = _ref;
146
166
  // Map tree range (colspan range/width) into visual column index of the root node.
147
167
  for (let i = columnIndex; i < columnIndex + colspan; i++) {
148
- this.#rootsIndex.set(i, columnIndex);
168
+ _classPrivateFieldGet(this, _rootsIndex).set(i, columnIndex);
149
169
  }
150
170
  columnIndex += colspan;
151
171
  });
@@ -157,12 +177,12 @@ class HeadersTree {
157
177
  */
158
178
  buildTree() {
159
179
  this.clear();
160
- const columnsCount = this.#sourceSettings.getColumnsCount();
180
+ const columnsCount = _classPrivateFieldGet(this, _sourceSettings).getColumnsCount();
161
181
  let columnIndex = 0;
162
182
  while (columnIndex < columnsCount) {
163
- const columnSettings = this.#sourceSettings.getHeaderSettings(0, columnIndex);
183
+ const columnSettings = _classPrivateFieldGet(this, _sourceSettings).getHeaderSettings(0, columnIndex);
164
184
  const rootNode = new _tree.default();
165
- this.#rootNodes.set(columnIndex, rootNode);
185
+ _classPrivateFieldGet(this, _rootNodes).set(columnIndex, rootNode);
166
186
  this.buildLeaves(rootNode, columnIndex, 0, columnSettings.origColspan);
167
187
  columnIndex += columnSettings.origColspan;
168
188
  }
@@ -179,7 +199,7 @@ class HeadersTree {
179
199
  */
180
200
  buildLeaves(parentNode, columnIndex, headerLevel) {
181
201
  let extractionLength = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
182
- const columnsSettings = this.#sourceSettings.getHeadersSettings(headerLevel, columnIndex, extractionLength);
202
+ const columnsSettings = _classPrivateFieldGet(this, _sourceSettings).getHeadersSettings(headerLevel, columnIndex, extractionLength);
183
203
  headerLevel += 1;
184
204
  (0, _array.arrayEach)(columnsSettings, columnSettings => {
185
205
  const nodeData = {
@@ -206,7 +226,7 @@ class HeadersTree {
206
226
  node = new _tree.default(nodeData);
207
227
  parentNode.addChild(node);
208
228
  }
209
- if (headerLevel < this.#sourceSettings.getLayersCount()) {
229
+ if (headerLevel < _classPrivateFieldGet(this, _sourceSettings).getLayersCount()) {
210
230
  this.buildLeaves(node, columnIndex, headerLevel, columnSettings.origColspan);
211
231
  }
212
232
  columnIndex += columnSettings.origColspan;
@@ -217,8 +237,8 @@ class HeadersTree {
217
237
  * Clears the tree to the initial state.
218
238
  */
219
239
  clear() {
220
- this.#rootNodes.clear();
221
- this.#rootsIndex.clear();
240
+ _classPrivateFieldGet(this, _rootNodes).clear();
241
+ _classPrivateFieldGet(this, _rootsIndex).clear();
222
242
  }
223
243
  }
224
244
  exports.default = HeadersTree;
@@ -1,3 +1,11 @@
1
+ import "core-js/modules/es.error.cause.js";
2
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
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(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; } }
1
9
  import { arrayEach } from "../../../helpers/array.mjs";
2
10
  import TreeNode from "../../../utils/dataStructures/tree.mjs";
3
11
  /* eslint-disable jsdoc/require-description-complete-sentence */
@@ -36,32 +44,44 @@ import TreeNode from "../../../utils/dataStructures/tree.mjs";
36
44
  *
37
45
  */
38
46
  /* eslint-enable jsdoc/require-description-complete-sentence */
47
+ var _rootNodes = /*#__PURE__*/new WeakMap();
48
+ var _rootsIndex = /*#__PURE__*/new WeakMap();
49
+ var _sourceSettings = /*#__PURE__*/new WeakMap();
39
50
  export default class HeadersTree {
40
- /**
41
- * The collection of nested headers settings structured into trees. The root trees are stored
42
- * under the visual column index.
43
- *
44
- * @private
45
- * @type {Map<number, TreeNode>}
46
- */
47
- #rootNodes = new Map();
48
- /**
49
- * A map that translates the visual column indexes that intersect the range
50
- * defined by the header colspan width to the root index.
51
- *
52
- * @private
53
- * @type {Map<number, number>}
54
- */
55
- #rootsIndex = new Map();
56
- /**
57
- * The instance of the SourceSettings class.
58
- *
59
- * @private
60
- * @type {SourceSettings}
61
- */
62
- #sourceSettings = null;
63
51
  constructor(sourceSettings) {
64
- this.#sourceSettings = sourceSettings;
52
+ /**
53
+ * The collection of nested headers settings structured into trees. The root trees are stored
54
+ * under the visual column index.
55
+ *
56
+ * @private
57
+ * @type {Map<number, TreeNode>}
58
+ */
59
+ _classPrivateFieldInitSpec(this, _rootNodes, {
60
+ writable: true,
61
+ value: new Map()
62
+ });
63
+ /**
64
+ * A map that translates the visual column indexes that intersect the range
65
+ * defined by the header colspan width to the root index.
66
+ *
67
+ * @private
68
+ * @type {Map<number, number>}
69
+ */
70
+ _classPrivateFieldInitSpec(this, _rootsIndex, {
71
+ writable: true,
72
+ value: new Map()
73
+ });
74
+ /**
75
+ * The instance of the SourceSettings class.
76
+ *
77
+ * @private
78
+ * @type {SourceSettings}
79
+ */
80
+ _classPrivateFieldInitSpec(this, _sourceSettings, {
81
+ writable: true,
82
+ value: null
83
+ });
84
+ _classPrivateFieldSet(this, _sourceSettings, sourceSettings);
65
85
  }
66
86
 
67
87
  /**
@@ -70,7 +90,7 @@ export default class HeadersTree {
70
90
  * @returns {TreeNode[]}
71
91
  */
72
92
  getRoots() {
73
- return Array.from(this.#rootNodes.values());
93
+ return Array.from(_classPrivateFieldGet(this, _rootNodes).values());
74
94
  }
75
95
 
76
96
  /**
@@ -81,8 +101,8 @@ export default class HeadersTree {
81
101
  */
82
102
  getRootByColumn(columnIndex) {
83
103
  let node;
84
- if (this.#rootsIndex.has(columnIndex)) {
85
- node = this.#rootNodes.get(this.#rootsIndex.get(columnIndex));
104
+ if (_classPrivateFieldGet(this, _rootsIndex).has(columnIndex)) {
105
+ node = _classPrivateFieldGet(this, _rootNodes).get(_classPrivateFieldGet(this, _rootsIndex).get(columnIndex));
86
106
  }
87
107
  return node;
88
108
  }
@@ -102,7 +122,7 @@ export default class HeadersTree {
102
122
 
103
123
  // Normalize the visual column index to a 0-based system for a specific "box" defined
104
124
  // by root node colspan width.
105
- const normColumnIndex = columnIndex - this.#rootsIndex.get(columnIndex);
125
+ const normColumnIndex = columnIndex - _classPrivateFieldGet(this, _rootsIndex).get(columnIndex);
106
126
  let columnCursor = 0;
107
127
  let treeNode;
108
128
 
@@ -132,8 +152,8 @@ export default class HeadersTree {
132
152
  */
133
153
  rebuildTreeIndex() {
134
154
  let columnIndex = 0;
135
- this.#rootsIndex.clear();
136
- arrayEach(this.#rootNodes, _ref => {
155
+ _classPrivateFieldGet(this, _rootsIndex).clear();
156
+ arrayEach(_classPrivateFieldGet(this, _rootNodes), _ref => {
137
157
  let [, {
138
158
  data: {
139
159
  colspan
@@ -141,7 +161,7 @@ export default class HeadersTree {
141
161
  }] = _ref;
142
162
  // Map tree range (colspan range/width) into visual column index of the root node.
143
163
  for (let i = columnIndex; i < columnIndex + colspan; i++) {
144
- this.#rootsIndex.set(i, columnIndex);
164
+ _classPrivateFieldGet(this, _rootsIndex).set(i, columnIndex);
145
165
  }
146
166
  columnIndex += colspan;
147
167
  });
@@ -153,12 +173,12 @@ export default class HeadersTree {
153
173
  */
154
174
  buildTree() {
155
175
  this.clear();
156
- const columnsCount = this.#sourceSettings.getColumnsCount();
176
+ const columnsCount = _classPrivateFieldGet(this, _sourceSettings).getColumnsCount();
157
177
  let columnIndex = 0;
158
178
  while (columnIndex < columnsCount) {
159
- const columnSettings = this.#sourceSettings.getHeaderSettings(0, columnIndex);
179
+ const columnSettings = _classPrivateFieldGet(this, _sourceSettings).getHeaderSettings(0, columnIndex);
160
180
  const rootNode = new TreeNode();
161
- this.#rootNodes.set(columnIndex, rootNode);
181
+ _classPrivateFieldGet(this, _rootNodes).set(columnIndex, rootNode);
162
182
  this.buildLeaves(rootNode, columnIndex, 0, columnSettings.origColspan);
163
183
  columnIndex += columnSettings.origColspan;
164
184
  }
@@ -175,7 +195,7 @@ export default class HeadersTree {
175
195
  */
176
196
  buildLeaves(parentNode, columnIndex, headerLevel) {
177
197
  let extractionLength = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
178
- const columnsSettings = this.#sourceSettings.getHeadersSettings(headerLevel, columnIndex, extractionLength);
198
+ const columnsSettings = _classPrivateFieldGet(this, _sourceSettings).getHeadersSettings(headerLevel, columnIndex, extractionLength);
179
199
  headerLevel += 1;
180
200
  arrayEach(columnsSettings, columnSettings => {
181
201
  const nodeData = {
@@ -202,7 +222,7 @@ export default class HeadersTree {
202
222
  node = new TreeNode(nodeData);
203
223
  parentNode.addChild(node);
204
224
  }
205
- if (headerLevel < this.#sourceSettings.getLayersCount()) {
225
+ if (headerLevel < _classPrivateFieldGet(this, _sourceSettings).getLayersCount()) {
206
226
  this.buildLeaves(node, columnIndex, headerLevel, columnSettings.origColspan);
207
227
  }
208
228
  columnIndex += columnSettings.origColspan;
@@ -213,7 +233,7 @@ export default class HeadersTree {
213
233
  * Clears the tree to the initial state.
214
234
  */
215
235
  clear() {
216
- this.#rootNodes.clear();
217
- this.#rootsIndex.clear();
236
+ _classPrivateFieldGet(this, _rootNodes).clear();
237
+ _classPrivateFieldGet(this, _rootsIndex).clear();
218
238
  }
219
239
  }