handsontable 0.0.0-next-02c94b0-20240416 → 0.0.0-next-534415d-20240418

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 (63) hide show
  1. package/3rdparty/walkontable/src/calculator/viewportColumns.js +2 -2
  2. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +2 -2
  3. package/3rdparty/walkontable/src/calculator/viewportRows.js +1 -1
  4. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +1 -1
  5. package/3rdparty/walkontable/src/overlay/_base.js +24 -20
  6. package/3rdparty/walkontable/src/overlay/_base.mjs +24 -20
  7. package/3rdparty/walkontable/src/overlay/bottom.js +3 -6
  8. package/3rdparty/walkontable/src/overlay/bottom.mjs +3 -6
  9. package/3rdparty/walkontable/src/overlay/inlineStart.js +3 -6
  10. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +3 -6
  11. package/3rdparty/walkontable/src/overlay/top.js +3 -6
  12. package/3rdparty/walkontable/src/overlay/top.mjs +3 -6
  13. package/3rdparty/walkontable/src/overlays.js +46 -24
  14. package/3rdparty/walkontable/src/overlays.mjs +46 -24
  15. package/3rdparty/walkontable/src/table.js +10 -11
  16. package/3rdparty/walkontable/src/table.mjs +10 -11
  17. package/base.js +2 -2
  18. package/base.mjs +2 -2
  19. package/dataMap/metaManager/mods/extendMetaProperties.js +37 -31
  20. package/dataMap/metaManager/mods/extendMetaProperties.mjs +37 -31
  21. package/dist/handsontable.css +2 -2
  22. package/dist/handsontable.full.css +2 -2
  23. package/dist/handsontable.full.js +169 -152
  24. package/dist/handsontable.full.min.css +2 -2
  25. package/dist/handsontable.full.min.js +10 -10
  26. package/dist/handsontable.js +169 -152
  27. package/dist/handsontable.min.css +2 -2
  28. package/dist/handsontable.min.js +10 -10
  29. package/helpers/mixed.js +1 -1
  30. package/helpers/mixed.mjs +1 -1
  31. package/package.json +1 -1
  32. package/plugins/autoRowSize/autoRowSize.js +2 -2
  33. package/plugins/autoRowSize/autoRowSize.mjs +2 -2
  34. package/plugins/collapsibleColumns/collapsibleColumns.js +1 -1
  35. package/plugins/collapsibleColumns/collapsibleColumns.mjs +1 -1
  36. package/plugins/comments/comments.js +2 -8
  37. package/plugins/comments/comments.mjs +2 -8
  38. package/plugins/filters/filters.js +1 -1
  39. package/plugins/filters/filters.mjs +1 -1
  40. package/plugins/filters/ui/multipleSelect.js +15 -12
  41. package/plugins/filters/ui/multipleSelect.mjs +15 -12
  42. package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +1 -1
  43. package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +1 -1
  44. package/plugins/hiddenColumns/contextMenuItem/showColumn.js +1 -1
  45. package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +1 -1
  46. package/plugins/hiddenRows/contextMenuItem/hideRow.js +1 -1
  47. package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +1 -1
  48. package/plugins/hiddenRows/contextMenuItem/showRow.js +1 -1
  49. package/plugins/hiddenRows/contextMenuItem/showRow.mjs +1 -1
  50. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
  51. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
  52. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
  53. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
  54. package/plugins/manualColumnMove/manualColumnMove.js +1 -1
  55. package/plugins/manualColumnMove/manualColumnMove.mjs +1 -1
  56. package/plugins/manualColumnResize/manualColumnResize.js +2 -2
  57. package/plugins/manualColumnResize/manualColumnResize.mjs +2 -2
  58. package/plugins/manualRowMove/manualRowMove.js +1 -1
  59. package/plugins/manualRowMove/manualRowMove.mjs +1 -1
  60. package/plugins/manualRowResize/manualRowResize.js +2 -2
  61. package/plugins/manualRowResize/manualRowResize.mjs +2 -2
  62. package/tableView.js +1 -4
  63. package/tableView.mjs +1 -4
@@ -1,8 +1,13 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
2
  import "core-js/modules/es.array.push.js";
3
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
4
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
3
5
  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
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
7
  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); }
8
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
9
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
10
+ 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"); }
6
11
  import { getScrollableElement, getScrollbarWidth } from "../../../helpers/dom/element.mjs";
7
12
  import { requestAnimationFrame } from "../../../helpers/feature.mjs";
8
13
  import { arrayEach } from "../../../helpers/array.mjs";
@@ -12,6 +17,8 @@ import { InlineStartOverlay, TopOverlay, TopInlineStartCornerOverlay, BottomOver
12
17
  /**
13
18
  * @class Overlays
14
19
  */
20
+ var _overlays = /*#__PURE__*/new WeakMap();
21
+ var _hasRenderingStateChanged = /*#__PURE__*/new WeakMap();
15
22
  class Overlays {
16
23
  /**
17
24
  * @param {Walkontable} wotInstance The Walkontable instance. @todo refactoring remove.
@@ -29,6 +36,12 @@ class Overlays {
29
36
  * @type {Walkontable}
30
37
  */
31
38
  _defineProperty(this, "wot", null);
39
+ /**
40
+ * An array of the all overlays.
41
+ *
42
+ * @type {Overlay[]}
43
+ */
44
+ _classPrivateFieldInitSpec(this, _overlays, []);
32
45
  /**
33
46
  * Refer to the TopOverlay instance.
34
47
  *
@@ -78,6 +91,12 @@ class Overlays {
78
91
  * @type {Settings}
79
92
  */
80
93
  _defineProperty(this, "wtSettings", null);
94
+ /**
95
+ * Indicates whether the rendering state has changed for one of the overlays.
96
+ *
97
+ * @type {boolean}
98
+ */
99
+ _classPrivateFieldInitSpec(this, _hasRenderingStateChanged, false);
81
100
  /**
82
101
  * The instance of the ResizeObserver that observes the size of the Walkontable wrapper element.
83
102
  * In case of the size change detection the `onContainerElementResize` is fired.
@@ -137,7 +156,7 @@ class Overlays {
137
156
  */
138
157
  getOverlays() {
139
158
  let includeMaster = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
140
- const overlays = [this.topOverlay, this.topInlineStartCornerOverlay, this.inlineStartOverlay, this.bottomOverlay, this.bottomInlineStartCornerOverlay];
159
+ const overlays = [..._classPrivateFieldGet(_overlays, this)];
141
160
  if (includeMaster) {
142
161
  overlays.push(this.wtTable);
143
162
  }
@@ -182,29 +201,31 @@ class Overlays {
182
201
  // TODO cond. Has no any visual impact. They're initially hidden in same way like left, top, and bottom overlays.
183
202
  this.topInlineStartCornerOverlay = new TopInlineStartCornerOverlay(...args, this.topOverlay, this.inlineStartOverlay);
184
203
  this.bottomInlineStartCornerOverlay = new BottomInlineStartCornerOverlay(...args, this.bottomOverlay, this.inlineStartOverlay);
204
+ _classPrivateFieldSet(_overlays, this, [this.topOverlay, this.bottomOverlay, this.inlineStartOverlay, this.topInlineStartCornerOverlay, this.bottomInlineStartCornerOverlay]);
185
205
  }
186
206
 
187
207
  /**
188
- * Update state of rendering, check if changed.
189
- *
190
- * @package
191
- * @returns {boolean} Returns `true` if changes applied to overlay needs scroll synchronization.
208
+ * Runs logic for the overlays before the table is drawn.
192
209
  */
193
- updateStateOfRendering() {
194
- let syncScroll = this.topOverlay.updateStateOfRendering();
195
- syncScroll = this.bottomOverlay.updateStateOfRendering() || syncScroll;
196
- syncScroll = this.inlineStartOverlay.updateStateOfRendering() || syncScroll;
210
+ beforeDraw() {
211
+ _classPrivateFieldSet(_hasRenderingStateChanged, this, _classPrivateFieldGet(_overlays, this).reduce((acc, overlay) => {
212
+ return overlay.hasRenderingStateChanged() || acc;
213
+ }, false));
214
+ _classPrivateFieldGet(_overlays, this).forEach(overlay => overlay.updateStateOfRendering('before'));
215
+ }
197
216
 
198
- // todo refactoring: move conditions into updateStateOfRendering(),
199
- if (this.inlineStartOverlay.needFullRender) {
200
- if (this.topOverlay.needFullRender) {
201
- syncScroll = this.topInlineStartCornerOverlay.updateStateOfRendering() || syncScroll;
202
- }
203
- if (this.bottomOverlay.needFullRender) {
204
- syncScroll = this.bottomInlineStartCornerOverlay.updateStateOfRendering() || syncScroll;
217
+ /**
218
+ * Runs logic for the overlays after the table is drawn.
219
+ */
220
+ afterDraw() {
221
+ this.syncScrollWithMaster();
222
+ _classPrivateFieldGet(_overlays, this).forEach(overlay => {
223
+ const hasRenderingStateChanged = overlay.hasRenderingStateChanged();
224
+ overlay.updateStateOfRendering('after');
225
+ if (hasRenderingStateChanged && !overlay.needFullRender) {
226
+ overlay.reset();
205
227
  }
206
- }
207
- return syncScroll;
228
+ });
208
229
  }
209
230
 
210
231
  /**
@@ -444,6 +465,9 @@ class Overlays {
444
465
  * Synchronize overlay scrollbars with the master scrollbar.
445
466
  */
446
467
  syncScrollWithMaster() {
468
+ if (!_classPrivateFieldGet(_hasRenderingStateChanged, this)) {
469
+ return;
470
+ }
447
471
  const master = this.topOverlay.mainTableScrollableElement;
448
472
  const {
449
473
  scrollLeft,
@@ -458,6 +482,7 @@ class Overlays {
458
482
  if (this.inlineStartOverlay.needFullRender) {
459
483
  this.inlineStartOverlay.clone.wtTable.holder.scrollTop = scrollTop; // todo rethink, *overlay.setScroll*()
460
484
  }
485
+ _classPrivateFieldSet(_hasRenderingStateChanged, this, false);
461
486
  }
462
487
 
463
488
  /**
@@ -548,11 +573,8 @@ class Overlays {
548
573
 
549
574
  /**
550
575
  * Adjust overlays elements size and master table size.
551
- *
552
- * @param {boolean} [force=false] When `true`, it adjust the DOM nodes sizes for all overlays.
553
576
  */
554
577
  adjustElementsSize() {
555
- let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
556
578
  const {
557
579
  wtViewport
558
580
  } = this.wot;
@@ -602,9 +624,9 @@ class Overlays {
602
624
  this.hasScrollbarRight = true;
603
625
  }
604
626
  }
605
- this.topOverlay.adjustElementsSize(force);
606
- this.inlineStartOverlay.adjustElementsSize(force);
607
- this.bottomOverlay.adjustElementsSize(force);
627
+ this.topOverlay.adjustElementsSize();
628
+ this.inlineStartOverlay.adjustElementsSize();
629
+ this.bottomOverlay.adjustElementsSize();
608
630
  }
609
631
 
610
632
  /**
@@ -251,7 +251,6 @@ class Table {
251
251
  const rowHeadersCount = rowHeaders.length;
252
252
  const columnHeaders = wtSettings.getSetting('columnHeaders');
253
253
  const columnHeadersCount = columnHeaders.length;
254
- let syncScroll = false;
255
254
  let runFastDraw = fastDraw;
256
255
  if (this.isMaster) {
257
256
  this.holderOffset = (0, _element.offset)(this.holder);
@@ -266,7 +265,7 @@ class Table {
266
265
  }
267
266
  }
268
267
  if (this.isMaster) {
269
- syncScroll = wtOverlays.updateStateOfRendering();
268
+ wtOverlays.beforeDraw();
270
269
  }
271
270
  if (runFastDraw) {
272
271
  if (this.isMaster) {
@@ -307,7 +306,7 @@ class Table {
307
306
  let workspaceWidth;
308
307
  if (this.isMaster) {
309
308
  workspaceWidth = this.dataAccessObject.workspaceWidth;
310
- this.dataAccessObject.wtViewport.containerWidth = null;
309
+ wtViewport.containerWidth = null;
311
310
  this.markOversizedColumnHeaders();
312
311
  }
313
312
  this.adjustColumnHeaderHeights();
@@ -315,10 +314,10 @@ class Table {
315
314
  this.markOversizedRows();
316
315
  }
317
316
  if (this.isMaster) {
318
- this.dataAccessObject.wtViewport.createVisibleCalculators();
319
- this.dataAccessObject.wtViewport.createPartiallyVisibleCalculators();
320
- this.dataAccessObject.wtOverlays.refresh(false);
321
- this.dataAccessObject.wtOverlays.applyToDOM();
317
+ wtViewport.createVisibleCalculators();
318
+ wtViewport.createPartiallyVisibleCalculators();
319
+ wtOverlays.refresh(false);
320
+ wtOverlays.applyToDOM();
322
321
  const hiderWidth = (0, _element.outerWidth)(this.hider);
323
322
  const tableWidth = (0, _element.outerWidth)(this.TABLE);
324
323
  if (hiderWidth !== 0 && tableWidth !== hiderWidth) {
@@ -326,9 +325,9 @@ class Table {
326
325
  this.columnUtils.calculateWidths();
327
326
  this.tableRenderer.renderer.colGroup.render();
328
327
  }
329
- if (workspaceWidth !== this.dataAccessObject.wtViewport.getWorkspaceWidth()) {
328
+ if (workspaceWidth !== wtViewport.getWorkspaceWidth()) {
330
329
  // workspace width changed though to shown/hidden vertical scrollbar. Let's reapply stretching
331
- this.dataAccessObject.wtViewport.containerWidth = null;
330
+ wtViewport.containerWidth = null;
332
331
  this.columnUtils.calculateWidths();
333
332
  this.tableRenderer.renderer.colGroup.render();
334
333
  }
@@ -361,8 +360,8 @@ class Table {
361
360
  } else {
362
361
  this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(runFastDraw);
363
362
  }
364
- if (syncScroll) {
365
- wtOverlays.syncScrollWithMaster();
363
+ if (this.isMaster) {
364
+ wtOverlays.afterDraw();
366
365
  }
367
366
  this.dataAccessObject.drawn = true;
368
367
  return this;
@@ -247,7 +247,6 @@ class Table {
247
247
  const rowHeadersCount = rowHeaders.length;
248
248
  const columnHeaders = wtSettings.getSetting('columnHeaders');
249
249
  const columnHeadersCount = columnHeaders.length;
250
- let syncScroll = false;
251
250
  let runFastDraw = fastDraw;
252
251
  if (this.isMaster) {
253
252
  this.holderOffset = offset(this.holder);
@@ -262,7 +261,7 @@ class Table {
262
261
  }
263
262
  }
264
263
  if (this.isMaster) {
265
- syncScroll = wtOverlays.updateStateOfRendering();
264
+ wtOverlays.beforeDraw();
266
265
  }
267
266
  if (runFastDraw) {
268
267
  if (this.isMaster) {
@@ -303,7 +302,7 @@ class Table {
303
302
  let workspaceWidth;
304
303
  if (this.isMaster) {
305
304
  workspaceWidth = this.dataAccessObject.workspaceWidth;
306
- this.dataAccessObject.wtViewport.containerWidth = null;
305
+ wtViewport.containerWidth = null;
307
306
  this.markOversizedColumnHeaders();
308
307
  }
309
308
  this.adjustColumnHeaderHeights();
@@ -311,10 +310,10 @@ class Table {
311
310
  this.markOversizedRows();
312
311
  }
313
312
  if (this.isMaster) {
314
- this.dataAccessObject.wtViewport.createVisibleCalculators();
315
- this.dataAccessObject.wtViewport.createPartiallyVisibleCalculators();
316
- this.dataAccessObject.wtOverlays.refresh(false);
317
- this.dataAccessObject.wtOverlays.applyToDOM();
313
+ wtViewport.createVisibleCalculators();
314
+ wtViewport.createPartiallyVisibleCalculators();
315
+ wtOverlays.refresh(false);
316
+ wtOverlays.applyToDOM();
318
317
  const hiderWidth = outerWidth(this.hider);
319
318
  const tableWidth = outerWidth(this.TABLE);
320
319
  if (hiderWidth !== 0 && tableWidth !== hiderWidth) {
@@ -322,9 +321,9 @@ class Table {
322
321
  this.columnUtils.calculateWidths();
323
322
  this.tableRenderer.renderer.colGroup.render();
324
323
  }
325
- if (workspaceWidth !== this.dataAccessObject.wtViewport.getWorkspaceWidth()) {
324
+ if (workspaceWidth !== wtViewport.getWorkspaceWidth()) {
326
325
  // workspace width changed though to shown/hidden vertical scrollbar. Let's reapply stretching
327
- this.dataAccessObject.wtViewport.containerWidth = null;
326
+ wtViewport.containerWidth = null;
328
327
  this.columnUtils.calculateWidths();
329
328
  this.tableRenderer.renderer.colGroup.render();
330
329
  }
@@ -357,8 +356,8 @@ class Table {
357
356
  } else {
358
357
  this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(runFastDraw);
359
358
  }
360
- if (syncScroll) {
361
- wtOverlays.syncScrollWithMaster();
359
+ if (this.isMaster) {
360
+ wtOverlays.afterDraw();
362
361
  }
363
362
  this.dataAccessObject.drawn = true;
364
363
  return this;
package/base.js CHANGED
@@ -45,8 +45,8 @@ Handsontable.hooks = _pluginHooks.default.getSingleton();
45
45
  Handsontable.CellCoords = _src.CellCoords;
46
46
  Handsontable.CellRange = _src.CellRange;
47
47
  Handsontable.packageName = 'handsontable';
48
- Handsontable.buildDate = "16/04/2024 08:48:05";
49
- Handsontable.version = "0.0.0-next-02c94b0-20240416";
48
+ Handsontable.buildDate = "18/04/2024 11:27:59";
49
+ Handsontable.version = "0.0.0-next-534415d-20240418";
50
50
  Handsontable.languages = {
51
51
  dictionaryKeys: _registry.dictionaryKeys,
52
52
  getLanguageDictionary: _registry.getLanguageDictionary,
package/base.mjs CHANGED
@@ -35,8 +35,8 @@ Handsontable.hooks = Hooks.getSingleton();
35
35
  Handsontable.CellCoords = CellCoords;
36
36
  Handsontable.CellRange = CellRange;
37
37
  Handsontable.packageName = 'handsontable';
38
- Handsontable.buildDate = "16/04/2024 08:48:11";
39
- Handsontable.version = "0.0.0-next-02c94b0-20240416";
38
+ Handsontable.buildDate = "18/04/2024 11:28:06";
39
+ Handsontable.version = "0.0.0-next-534415d-20240418";
40
40
  Handsontable.languages = {
41
41
  dictionaryKeys,
42
42
  getLanguageDictionary,
@@ -2,9 +2,15 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
+ require("core-js/modules/es.array.push.js");
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"); } }
5
8
  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; }
6
9
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
7
10
  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); }
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"); }
13
+ var _initOnlyCallback = /*#__PURE__*/new WeakMap();
8
14
  /**
9
15
  * @class ExtendMetaPropertiesMod
10
16
  */
@@ -22,11 +28,7 @@ class ExtendMetaPropertiesMod {
22
28
  * @type {Map}
23
29
  */
24
30
  _defineProperty(this, "propDescriptors", new Map([['ariaTags', {
25
- onChange(propName, value, isInitialChange) {
26
- if (!isInitialChange) {
27
- throw new Error(`The \`${propName}\` option can not be updated after the Handsontable instance was initialized.`);
28
- }
29
- }
31
+ initOnly: true
30
32
  }], ['fixedColumnsLeft', {
31
33
  target: 'fixedColumnsStart',
32
34
  onChange(propName) {
@@ -39,48 +41,52 @@ class ExtendMetaPropertiesMod {
39
41
  }
40
42
  }
41
43
  }], ['layoutDirection', {
42
- onChange(propName, value, isInitialChange) {
43
- if (!isInitialChange) {
44
- throw new Error(`The \`${propName}\` option can not be updated after the Handsontable is initialized.`);
45
- }
44
+ initOnly: true
45
+ }], ['renderAllColumns', {
46
+ initOnly: true
47
+ }], ['renderAllRows', {
48
+ initOnly: true
49
+ }]]));
50
+ /**
51
+ * Callback called when the prop is marked as `initOnly`.
52
+ *
53
+ * @param {string} propName The property name.
54
+ * @param {*} value The new value.
55
+ * @param {boolean} isInitialChange Is the change initial.
56
+ */
57
+ _classPrivateFieldInitSpec(this, _initOnlyCallback, (propName, value, isInitialChange) => {
58
+ if (!isInitialChange) {
59
+ throw new Error(`The \`${propName}\` option can not be updated after the Handsontable is initialized.`);
46
60
  }
47
- }]
48
- // Temporary commented out due to the bug in the React wrapper.
49
- // ['renderAllColumns', {
50
- // onChange(propName, value, isInitialChange) {
51
- // if (!isInitialChange) {
52
- // throw new Error(`The \`${propName}\` option can not be updated after the Handsontable is initialized.`);
53
- // }
54
- // }
55
- // }],
56
- // ['renderAllRows', {
57
- // onChange(propName, value, isInitialChange) {
58
- // if (!isInitialChange) {
59
- // throw new Error(`The \`${propName}\` option can not be updated after the Handsontable is initialized.`);
60
- // }
61
- // }
62
- // }],
63
- ]));
61
+ });
64
62
  this.metaManager = metaManager;
65
63
  this.extendMetaProps();
66
64
  }
67
-
68
65
  /**
69
66
  * Extends the meta options based on the object descriptors from the `propDescriptors` list.
70
67
  */
71
68
  extendMetaProps() {
72
69
  this.propDescriptors.forEach((descriptor, alias) => {
73
70
  const {
71
+ initOnly,
74
72
  target,
75
- onChange = () => {}
73
+ onChange
76
74
  } = descriptor;
77
75
  const hasTarget = typeof target === 'string';
78
76
  const targetProp = hasTarget ? target : alias;
79
77
  const origProp = `_${targetProp}`;
80
78
  this.metaManager.globalMeta.meta[origProp] = this.metaManager.globalMeta.meta[targetProp];
81
- this.installPropWatcher(alias, origProp, onChange);
82
- if (hasTarget) {
83
- this.installPropWatcher(target, origProp, onChange);
79
+ if (onChange) {
80
+ this.installPropWatcher(alias, origProp, onChange);
81
+ if (hasTarget) {
82
+ this.installPropWatcher(target, origProp, onChange);
83
+ }
84
+ } else if (initOnly) {
85
+ this.installPropWatcher(alias, origProp, _classPrivateFieldGet(_initOnlyCallback, this));
86
+ if (!this.metaManager.globalMeta.meta._initOnlySettings) {
87
+ this.metaManager.globalMeta.meta._initOnlySettings = [];
88
+ }
89
+ this.metaManager.globalMeta.meta._initOnlySettings.push(alias);
84
90
  }
85
91
  });
86
92
  }
@@ -1,7 +1,13 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
+ import "core-js/modules/es.array.push.js";
3
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
4
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
2
5
  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; }
3
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
7
  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); }
8
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
9
+ 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
+ var _initOnlyCallback = /*#__PURE__*/new WeakMap();
5
11
  /**
6
12
  * @class ExtendMetaPropertiesMod
7
13
  */
@@ -19,11 +25,7 @@ export class ExtendMetaPropertiesMod {
19
25
  * @type {Map}
20
26
  */
21
27
  _defineProperty(this, "propDescriptors", new Map([['ariaTags', {
22
- onChange(propName, value, isInitialChange) {
23
- if (!isInitialChange) {
24
- throw new Error(`The \`${propName}\` option can not be updated after the Handsontable instance was initialized.`);
25
- }
26
- }
28
+ initOnly: true
27
29
  }], ['fixedColumnsLeft', {
28
30
  target: 'fixedColumnsStart',
29
31
  onChange(propName) {
@@ -36,48 +38,52 @@ export class ExtendMetaPropertiesMod {
36
38
  }
37
39
  }
38
40
  }], ['layoutDirection', {
39
- onChange(propName, value, isInitialChange) {
40
- if (!isInitialChange) {
41
- throw new Error(`The \`${propName}\` option can not be updated after the Handsontable is initialized.`);
42
- }
41
+ initOnly: true
42
+ }], ['renderAllColumns', {
43
+ initOnly: true
44
+ }], ['renderAllRows', {
45
+ initOnly: true
46
+ }]]));
47
+ /**
48
+ * Callback called when the prop is marked as `initOnly`.
49
+ *
50
+ * @param {string} propName The property name.
51
+ * @param {*} value The new value.
52
+ * @param {boolean} isInitialChange Is the change initial.
53
+ */
54
+ _classPrivateFieldInitSpec(this, _initOnlyCallback, (propName, value, isInitialChange) => {
55
+ if (!isInitialChange) {
56
+ throw new Error(`The \`${propName}\` option can not be updated after the Handsontable is initialized.`);
43
57
  }
44
- }]
45
- // Temporary commented out due to the bug in the React wrapper.
46
- // ['renderAllColumns', {
47
- // onChange(propName, value, isInitialChange) {
48
- // if (!isInitialChange) {
49
- // throw new Error(`The \`${propName}\` option can not be updated after the Handsontable is initialized.`);
50
- // }
51
- // }
52
- // }],
53
- // ['renderAllRows', {
54
- // onChange(propName, value, isInitialChange) {
55
- // if (!isInitialChange) {
56
- // throw new Error(`The \`${propName}\` option can not be updated after the Handsontable is initialized.`);
57
- // }
58
- // }
59
- // }],
60
- ]));
58
+ });
61
59
  this.metaManager = metaManager;
62
60
  this.extendMetaProps();
63
61
  }
64
-
65
62
  /**
66
63
  * Extends the meta options based on the object descriptors from the `propDescriptors` list.
67
64
  */
68
65
  extendMetaProps() {
69
66
  this.propDescriptors.forEach((descriptor, alias) => {
70
67
  const {
68
+ initOnly,
71
69
  target,
72
- onChange = () => {}
70
+ onChange
73
71
  } = descriptor;
74
72
  const hasTarget = typeof target === 'string';
75
73
  const targetProp = hasTarget ? target : alias;
76
74
  const origProp = `_${targetProp}`;
77
75
  this.metaManager.globalMeta.meta[origProp] = this.metaManager.globalMeta.meta[targetProp];
78
- this.installPropWatcher(alias, origProp, onChange);
79
- if (hasTarget) {
80
- this.installPropWatcher(target, origProp, onChange);
76
+ if (onChange) {
77
+ this.installPropWatcher(alias, origProp, onChange);
78
+ if (hasTarget) {
79
+ this.installPropWatcher(target, origProp, onChange);
80
+ }
81
+ } else if (initOnly) {
82
+ this.installPropWatcher(alias, origProp, _classPrivateFieldGet(_initOnlyCallback, this));
83
+ if (!this.metaManager.globalMeta.meta._initOnlySettings) {
84
+ this.metaManager.globalMeta.meta._initOnlySettings = [];
85
+ }
86
+ this.metaManager.globalMeta.meta._initOnlySettings.push(alias);
81
87
  }
82
88
  });
83
89
  }
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-02c94b0-20240416
29
- * Release date: 16/04/2024 (built at 16/04/2024 08:48:15)
28
+ * Version: 0.0.0-next-534415d-20240418
29
+ * Release date: 16/04/2024 (built at 18/04/2024 11:28:10)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-02c94b0-20240416
29
- * Release date: 16/04/2024 (built at 16/04/2024 08:48:15)
28
+ * Version: 0.0.0-next-534415d-20240418
29
+ * Release date: 16/04/2024 (built at 18/04/2024 11:28:10)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles