handsontable 0.0.0-next-9410a76-20250416 → 0.0.0-next-723ad8c-20250417

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

package/base.js CHANGED
@@ -45,8 +45,8 @@ Handsontable.hooks = _hooks.Hooks.getSingleton();
45
45
  Handsontable.CellCoords = _src.CellCoords;
46
46
  Handsontable.CellRange = _src.CellRange;
47
47
  Handsontable.packageName = 'handsontable';
48
- Handsontable.buildDate = "16/04/2025 06:18:04";
49
- Handsontable.version = "0.0.0-next-9410a76-20250416";
48
+ Handsontable.buildDate = "17/04/2025 10:03:40";
49
+ Handsontable.version = "0.0.0-next-723ad8c-20250417";
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/2025 06:18:10";
39
- Handsontable.version = "0.0.0-next-9410a76-20250416";
38
+ Handsontable.buildDate = "17/04/2025 10:03:45";
39
+ Handsontable.version = "0.0.0-next-723ad8c-20250417";
40
40
  Handsontable.languages = {
41
41
  dictionaryKeys,
42
42
  getLanguageDictionary,
package/core.js CHANGED
@@ -4,6 +4,7 @@ exports.__esModule = true;
4
4
  exports.default = Core;
5
5
  require("core-js/modules/es.error.cause.js");
6
6
  require("core-js/modules/es.array.push.js");
7
+ require("core-js/modules/es.object.from-entries.js");
7
8
  require("core-js/modules/es.set.difference.v2.js");
8
9
  require("core-js/modules/es.set.intersection.v2.js");
9
10
  require("core-js/modules/es.set.is-disjoint-from.v2.js");
@@ -226,7 +227,11 @@ function Core(rootElement, userSettings) {
226
227
  return instance.isLtr() ? 1 : -1;
227
228
  };
228
229
  userSettings.language = (0, _registry5.getValidLanguageCode)(userSettings.language);
229
- const metaManager = new _dataMap.MetaManager(instance, userSettings, [_dataMap.DynamicCellMetaMod, _dataMap.ExtendMetaPropertiesMod]);
230
+ const settingsWithoutHooks = Object.fromEntries(Object.entries(userSettings).filter(_ref => {
231
+ let [key] = _ref;
232
+ return !(_hooks.Hooks.getSingleton().isRegistered(key) || _hooks.Hooks.getSingleton().isDeprecated(key));
233
+ }));
234
+ const metaManager = new _dataMap.MetaManager(instance, settingsWithoutHooks, [_dataMap.DynamicCellMetaMod, _dataMap.ExtendMetaPropertiesMod]);
230
235
  const tableMeta = metaManager.getTableMeta();
231
236
  const globalMeta = metaManager.getGlobalMeta();
232
237
  const pluginsRegistry = (0, _uniqueMap.createUniqueMap)();
@@ -340,10 +345,10 @@ function Core(rootElement, userSettings) {
340
345
  }
341
346
  });
342
347
  this.selection = selection;
343
- const onIndexMapperCacheUpdate = _ref => {
348
+ const onIndexMapperCacheUpdate = _ref2 => {
344
349
  let {
345
350
  hiddenIndexesChanged
346
- } = _ref;
351
+ } = _ref2;
347
352
  this.forceFullRender = true;
348
353
  if (hiddenIndexesChanged) {
349
354
  this.selection.commit();
@@ -523,9 +528,9 @@ function Core(rootElement, userSettings) {
523
528
  const sortedIndexes = [...indexes];
524
529
 
525
530
  // Sort the indexes in ascending order.
526
- sortedIndexes.sort((_ref2, _ref3) => {
527
- let [indexA] = _ref2;
528
- let [indexB] = _ref3;
531
+ sortedIndexes.sort((_ref3, _ref4) => {
532
+ let [indexA] = _ref3;
533
+ let [indexB] = _ref4;
529
534
  if (indexA === indexB) {
530
535
  return 0;
531
536
  }
@@ -533,8 +538,8 @@ function Core(rootElement, userSettings) {
533
538
  });
534
539
 
535
540
  // Normalize the {index, amount} groups into bigger groups.
536
- const normalizedIndexes = (0, _array.arrayReduce)(sortedIndexes, (acc, _ref4) => {
537
- let [groupIndex, groupAmount] = _ref4;
541
+ const normalizedIndexes = (0, _array.arrayReduce)(sortedIndexes, (acc, _ref5) => {
542
+ let [groupIndex, groupAmount] = _ref5;
538
543
  const previousItem = acc[acc.length - 1];
539
544
  const [prevIndex, prevAmount] = previousItem;
540
545
  const prevLastIndex = prevIndex + prevAmount;
@@ -602,8 +607,8 @@ function Core(rootElement, userSettings) {
602
607
  let offset = 0;
603
608
 
604
609
  // Normalize the {index, amount} groups into bigger groups.
605
- (0, _array.arrayEach)(indexes, _ref5 => {
606
- let [groupIndex, groupAmount] = _ref5;
610
+ (0, _array.arrayEach)(indexes, _ref6 => {
611
+ let [groupIndex, groupAmount] = _ref6;
607
612
  const calcIndex = (0, _mixed.isEmpty)(groupIndex) ? instance.countRows() - 1 : Math.max(groupIndex - offset, 0);
608
613
 
609
614
  // If the 'index' is an integer decrease it by 'offset' otherwise pass it through to make the value
@@ -657,8 +662,8 @@ function Core(rootElement, userSettings) {
657
662
  let offset = 0;
658
663
 
659
664
  // Normalize the {index, amount} groups into bigger groups.
660
- (0, _array.arrayEach)(indexes, _ref6 => {
661
- let [groupIndex, groupAmount] = _ref6;
665
+ (0, _array.arrayEach)(indexes, _ref7 => {
666
+ let [groupIndex, groupAmount] = _ref7;
662
667
  const calcIndex = (0, _mixed.isEmpty)(groupIndex) ? instance.countCols() - 1 : Math.max(groupIndex - offset, 0);
663
668
  let physicalColumnIndex = instance.toPhysicalColumn(calcIndex);
664
669
 
@@ -1036,7 +1041,7 @@ function Core(rootElement, userSettings) {
1036
1041
  if ((0, _browser.isMobileBrowser)() || (0, _browser.isIpadOS)()) {
1037
1042
  (0, _element.addClass)(instance.rootElement, 'mobile');
1038
1043
  }
1039
- this.updateSettings(tableMeta, true);
1044
+ this.updateSettings(userSettings, true);
1040
1045
  this.view = new _tableView.default(this);
1041
1046
  const themeName = tableMeta.themeName || (0, _themes.getThemeClassName)(instance.rootElement);
1042
1047
 
@@ -1627,11 +1632,11 @@ function Core(rootElement, userSettings) {
1627
1632
  this.getSelected = function () {
1628
1633
  // https://github.com/handsontable/handsontable/issues/44 //cjl
1629
1634
  if (selection.isSelected()) {
1630
- return (0, _array.arrayMap)(selection.getSelectedRange(), _ref7 => {
1635
+ return (0, _array.arrayMap)(selection.getSelectedRange(), _ref8 => {
1631
1636
  let {
1632
1637
  from,
1633
1638
  to
1634
- } = _ref7;
1639
+ } = _ref8;
1635
1640
  return [from.row, from.col, to.row, to.col];
1636
1641
  });
1637
1642
  }
@@ -2315,23 +2320,27 @@ function Core(rootElement, userSettings) {
2315
2320
  if ((0, _mixed.isDefined)(settings.ganttChart)) {
2316
2321
  throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');
2317
2322
  }
2323
+ if (settings.language) {
2324
+ setLanguage(settings.language);
2325
+ }
2318
2326
 
2319
2327
  // eslint-disable-next-line no-restricted-syntax
2320
2328
  for (i in settings) {
2321
- if (i === 'data') {
2322
- // Do nothing. loadData will be triggered later
2323
- } else if (i === 'language') {
2324
- setLanguage(settings.language);
2329
+ if (i === 'data' || i === 'language') {
2330
+ // Do nothing. loadData and language change will be triggered later
2325
2331
  } else if (i === 'className') {
2326
2332
  setClassName('className', settings.className);
2327
2333
  } else if (i === 'tableClassName' && instance.table) {
2328
2334
  setClassName('tableClassName', settings.tableClassName);
2329
2335
  instance.view._wt.wtOverlays.syncOverlayTableClassNames();
2330
2336
  } else if (_hooks.Hooks.getSingleton().isRegistered(i) || _hooks.Hooks.getSingleton().isDeprecated(i)) {
2331
- if ((0, _function.isFunction)(settings[i])) {
2332
- _hooks.Hooks.getSingleton().addAsFixed(i, settings[i], instance);
2333
- } else if (Array.isArray(settings[i])) {
2334
- _hooks.Hooks.getSingleton().add(i, settings[i], instance);
2337
+ const hook = settings[i];
2338
+ if ((0, _function.isFunction)(hook)) {
2339
+ _hooks.Hooks.getSingleton().addAsFixed(i, hook, instance);
2340
+ tableMeta[i] = hook;
2341
+ } else if (Array.isArray(hook)) {
2342
+ _hooks.Hooks.getSingleton().add(i, hook, instance);
2343
+ tableMeta[i] = hook;
2335
2344
  }
2336
2345
  } else if (!init && (0, _object.hasOwnProperty)(settings, i)) {
2337
2346
  // Update settings
@@ -2864,15 +2873,15 @@ function Core(rootElement, userSettings) {
2864
2873
  const isThereAnySetSourceListener = this.hasHook('afterSetSourceDataAtCell');
2865
2874
  const changesForHook = [];
2866
2875
  if (isThereAnySetSourceListener) {
2867
- (0, _array.arrayEach)(input, _ref8 => {
2868
- let [changeRow, changeProp, changeValue] = _ref8;
2876
+ (0, _array.arrayEach)(input, _ref9 => {
2877
+ let [changeRow, changeProp, changeValue] = _ref9;
2869
2878
  changesForHook.push([changeRow, changeProp, dataSource.getAtCell(changeRow, changeProp),
2870
2879
  // The previous value.
2871
2880
  changeValue]);
2872
2881
  });
2873
2882
  }
2874
- (0, _array.arrayEach)(input, _ref9 => {
2875
- let [changeRow, changeProp, changeValue] = _ref9;
2883
+ (0, _array.arrayEach)(input, _ref10 => {
2884
+ let [changeRow, changeProp, changeValue] = _ref10;
2876
2885
  dataSource.setAtCell(changeRow, changeProp, changeValue);
2877
2886
  });
2878
2887
  if (isThereAnySetSourceListener) {
@@ -4225,8 +4234,8 @@ function Core(rootElement, userSettings) {
4225
4234
  instance.batchExecution(() => {
4226
4235
  instance.rowIndexMapper.unregisterAll();
4227
4236
  instance.columnIndexMapper.unregisterAll();
4228
- pluginsRegistry.getItems().forEach(_ref10 => {
4229
- let [, plugin] = _ref10;
4237
+ pluginsRegistry.getItems().forEach(_ref11 => {
4238
+ let [, plugin] = _ref11;
4230
4239
  plugin.destroy();
4231
4240
  });
4232
4241
  pluginsRegistry.clear();
package/core.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
2
  import "core-js/modules/es.array.push.js";
3
+ import "core-js/modules/es.object.from-entries.js";
3
4
  import "core-js/modules/es.set.difference.v2.js";
4
5
  import "core-js/modules/es.set.intersection.v2.js";
5
6
  import "core-js/modules/es.set.is-disjoint-from.v2.js";
@@ -221,7 +222,11 @@ export default function Core(rootElement, userSettings) {
221
222
  return instance.isLtr() ? 1 : -1;
222
223
  };
223
224
  userSettings.language = getValidLanguageCode(userSettings.language);
224
- const metaManager = new MetaManager(instance, userSettings, [DynamicCellMetaMod, ExtendMetaPropertiesMod]);
225
+ const settingsWithoutHooks = Object.fromEntries(Object.entries(userSettings).filter(_ref => {
226
+ let [key] = _ref;
227
+ return !(Hooks.getSingleton().isRegistered(key) || Hooks.getSingleton().isDeprecated(key));
228
+ }));
229
+ const metaManager = new MetaManager(instance, settingsWithoutHooks, [DynamicCellMetaMod, ExtendMetaPropertiesMod]);
225
230
  const tableMeta = metaManager.getTableMeta();
226
231
  const globalMeta = metaManager.getGlobalMeta();
227
232
  const pluginsRegistry = createUniqueMap();
@@ -335,10 +340,10 @@ export default function Core(rootElement, userSettings) {
335
340
  }
336
341
  });
337
342
  this.selection = selection;
338
- const onIndexMapperCacheUpdate = _ref => {
343
+ const onIndexMapperCacheUpdate = _ref2 => {
339
344
  let {
340
345
  hiddenIndexesChanged
341
- } = _ref;
346
+ } = _ref2;
342
347
  this.forceFullRender = true;
343
348
  if (hiddenIndexesChanged) {
344
349
  this.selection.commit();
@@ -518,9 +523,9 @@ export default function Core(rootElement, userSettings) {
518
523
  const sortedIndexes = [...indexes];
519
524
 
520
525
  // Sort the indexes in ascending order.
521
- sortedIndexes.sort((_ref2, _ref3) => {
522
- let [indexA] = _ref2;
523
- let [indexB] = _ref3;
526
+ sortedIndexes.sort((_ref3, _ref4) => {
527
+ let [indexA] = _ref3;
528
+ let [indexB] = _ref4;
524
529
  if (indexA === indexB) {
525
530
  return 0;
526
531
  }
@@ -528,8 +533,8 @@ export default function Core(rootElement, userSettings) {
528
533
  });
529
534
 
530
535
  // Normalize the {index, amount} groups into bigger groups.
531
- const normalizedIndexes = arrayReduce(sortedIndexes, (acc, _ref4) => {
532
- let [groupIndex, groupAmount] = _ref4;
536
+ const normalizedIndexes = arrayReduce(sortedIndexes, (acc, _ref5) => {
537
+ let [groupIndex, groupAmount] = _ref5;
533
538
  const previousItem = acc[acc.length - 1];
534
539
  const [prevIndex, prevAmount] = previousItem;
535
540
  const prevLastIndex = prevIndex + prevAmount;
@@ -597,8 +602,8 @@ export default function Core(rootElement, userSettings) {
597
602
  let offset = 0;
598
603
 
599
604
  // Normalize the {index, amount} groups into bigger groups.
600
- arrayEach(indexes, _ref5 => {
601
- let [groupIndex, groupAmount] = _ref5;
605
+ arrayEach(indexes, _ref6 => {
606
+ let [groupIndex, groupAmount] = _ref6;
602
607
  const calcIndex = isEmpty(groupIndex) ? instance.countRows() - 1 : Math.max(groupIndex - offset, 0);
603
608
 
604
609
  // If the 'index' is an integer decrease it by 'offset' otherwise pass it through to make the value
@@ -652,8 +657,8 @@ export default function Core(rootElement, userSettings) {
652
657
  let offset = 0;
653
658
 
654
659
  // Normalize the {index, amount} groups into bigger groups.
655
- arrayEach(indexes, _ref6 => {
656
- let [groupIndex, groupAmount] = _ref6;
660
+ arrayEach(indexes, _ref7 => {
661
+ let [groupIndex, groupAmount] = _ref7;
657
662
  const calcIndex = isEmpty(groupIndex) ? instance.countCols() - 1 : Math.max(groupIndex - offset, 0);
658
663
  let physicalColumnIndex = instance.toPhysicalColumn(calcIndex);
659
664
 
@@ -1031,7 +1036,7 @@ export default function Core(rootElement, userSettings) {
1031
1036
  if (isMobileBrowser() || isIpadOS()) {
1032
1037
  addClass(instance.rootElement, 'mobile');
1033
1038
  }
1034
- this.updateSettings(tableMeta, true);
1039
+ this.updateSettings(userSettings, true);
1035
1040
  this.view = new TableView(this);
1036
1041
  const themeName = tableMeta.themeName || getThemeClassName(instance.rootElement);
1037
1042
 
@@ -1622,11 +1627,11 @@ export default function Core(rootElement, userSettings) {
1622
1627
  this.getSelected = function () {
1623
1628
  // https://github.com/handsontable/handsontable/issues/44 //cjl
1624
1629
  if (selection.isSelected()) {
1625
- return arrayMap(selection.getSelectedRange(), _ref7 => {
1630
+ return arrayMap(selection.getSelectedRange(), _ref8 => {
1626
1631
  let {
1627
1632
  from,
1628
1633
  to
1629
- } = _ref7;
1634
+ } = _ref8;
1630
1635
  return [from.row, from.col, to.row, to.col];
1631
1636
  });
1632
1637
  }
@@ -2310,23 +2315,27 @@ export default function Core(rootElement, userSettings) {
2310
2315
  if (isDefined(settings.ganttChart)) {
2311
2316
  throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');
2312
2317
  }
2318
+ if (settings.language) {
2319
+ setLanguage(settings.language);
2320
+ }
2313
2321
 
2314
2322
  // eslint-disable-next-line no-restricted-syntax
2315
2323
  for (i in settings) {
2316
- if (i === 'data') {
2317
- // Do nothing. loadData will be triggered later
2318
- } else if (i === 'language') {
2319
- setLanguage(settings.language);
2324
+ if (i === 'data' || i === 'language') {
2325
+ // Do nothing. loadData and language change will be triggered later
2320
2326
  } else if (i === 'className') {
2321
2327
  setClassName('className', settings.className);
2322
2328
  } else if (i === 'tableClassName' && instance.table) {
2323
2329
  setClassName('tableClassName', settings.tableClassName);
2324
2330
  instance.view._wt.wtOverlays.syncOverlayTableClassNames();
2325
2331
  } else if (Hooks.getSingleton().isRegistered(i) || Hooks.getSingleton().isDeprecated(i)) {
2326
- if (isFunction(settings[i])) {
2327
- Hooks.getSingleton().addAsFixed(i, settings[i], instance);
2328
- } else if (Array.isArray(settings[i])) {
2329
- Hooks.getSingleton().add(i, settings[i], instance);
2332
+ const hook = settings[i];
2333
+ if (isFunction(hook)) {
2334
+ Hooks.getSingleton().addAsFixed(i, hook, instance);
2335
+ tableMeta[i] = hook;
2336
+ } else if (Array.isArray(hook)) {
2337
+ Hooks.getSingleton().add(i, hook, instance);
2338
+ tableMeta[i] = hook;
2330
2339
  }
2331
2340
  } else if (!init && hasOwnProperty(settings, i)) {
2332
2341
  // Update settings
@@ -2859,15 +2868,15 @@ export default function Core(rootElement, userSettings) {
2859
2868
  const isThereAnySetSourceListener = this.hasHook('afterSetSourceDataAtCell');
2860
2869
  const changesForHook = [];
2861
2870
  if (isThereAnySetSourceListener) {
2862
- arrayEach(input, _ref8 => {
2863
- let [changeRow, changeProp, changeValue] = _ref8;
2871
+ arrayEach(input, _ref9 => {
2872
+ let [changeRow, changeProp, changeValue] = _ref9;
2864
2873
  changesForHook.push([changeRow, changeProp, dataSource.getAtCell(changeRow, changeProp),
2865
2874
  // The previous value.
2866
2875
  changeValue]);
2867
2876
  });
2868
2877
  }
2869
- arrayEach(input, _ref9 => {
2870
- let [changeRow, changeProp, changeValue] = _ref9;
2878
+ arrayEach(input, _ref10 => {
2879
+ let [changeRow, changeProp, changeValue] = _ref10;
2871
2880
  dataSource.setAtCell(changeRow, changeProp, changeValue);
2872
2881
  });
2873
2882
  if (isThereAnySetSourceListener) {
@@ -4220,8 +4229,8 @@ export default function Core(rootElement, userSettings) {
4220
4229
  instance.batchExecution(() => {
4221
4230
  instance.rowIndexMapper.unregisterAll();
4222
4231
  instance.columnIndexMapper.unregisterAll();
4223
- pluginsRegistry.getItems().forEach(_ref10 => {
4224
- let [, plugin] = _ref10;
4232
+ pluginsRegistry.getItems().forEach(_ref11 => {
4233
+ let [, plugin] = _ref11;
4225
4234
  plugin.destroy();
4226
4235
  });
4227
4236
  pluginsRegistry.clear();
@@ -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-9410a76-20250416
29
- * Release date: 19/03/2025 (built at 16/04/2025 06:18:34)
28
+ * Version: 0.0.0-next-723ad8c-20250417
29
+ * Release date: 19/03/2025 (built at 17/04/2025 10:04:07)
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-9410a76-20250416
29
- * Release date: 19/03/2025 (built at 16/04/2025 06:18:34)
28
+ * Version: 0.0.0-next-723ad8c-20250417
29
+ * Release date: 19/03/2025 (built at 17/04/2025 10:04:07)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles