handsontable 12.1.1 → 12.1.3

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.
Files changed (93) hide show
  1. package/3rdparty/walkontable/src/border.js +43 -28
  2. package/3rdparty/walkontable/src/border.mjs +43 -28
  3. package/3rdparty/walkontable/src/table.js +13 -10
  4. package/3rdparty/walkontable/src/table.mjs +13 -10
  5. package/CHANGELOG.md +31 -0
  6. package/base.js +2 -2
  7. package/base.mjs +2 -2
  8. package/core.d.ts +1 -3
  9. package/core.js +9 -1
  10. package/core.mjs +9 -1
  11. package/dataMap/dataMap.js +35 -16
  12. package/dataMap/dataMap.mjs +30 -13
  13. package/dataMap/metaManager/lazyFactoryMap.js +24 -5
  14. package/dataMap/metaManager/lazyFactoryMap.mjs +19 -4
  15. package/dataMap/metaManager/metaSchema.js +112 -80
  16. package/dataMap/metaManager/metaSchema.mjs +112 -80
  17. package/dist/handsontable.css +2 -2
  18. package/dist/handsontable.full.css +2 -2
  19. package/dist/handsontable.full.js +35200 -52208
  20. package/dist/handsontable.full.min.css +2 -2
  21. package/dist/handsontable.full.min.js +527 -284
  22. package/dist/handsontable.js +3046 -3279
  23. package/dist/handsontable.min.css +2 -2
  24. package/dist/handsontable.min.js +3 -3
  25. package/editorManager.js +69 -35
  26. package/editorManager.mjs +69 -35
  27. package/editors/baseEditor/baseEditor.js +1 -1
  28. package/editors/baseEditor/baseEditor.mjs +1 -1
  29. package/editors/dateEditor/dateEditor.js +17 -2
  30. package/editors/dateEditor/dateEditor.mjs +16 -0
  31. package/editors/textEditor/caretPositioner.js +0 -4
  32. package/editors/textEditor/caretPositioner.mjs +0 -2
  33. package/helpers/dom/element.js +2 -4
  34. package/helpers/dom/element.mjs +1 -2
  35. package/helpers/mixed.js +2 -4
  36. package/helpers/mixed.mjs +2 -3
  37. package/helpers/object.js +0 -4
  38. package/helpers/object.mjs +0 -2
  39. package/helpers/unicode.js +0 -4
  40. package/helpers/unicode.mjs +0 -2
  41. package/package.json +2 -2
  42. package/pluginHooks.d.ts +0 -1
  43. package/pluginHooks.js +17 -14
  44. package/pluginHooks.mjs +17 -14
  45. package/plugins/base/base.js +2 -4
  46. package/plugins/base/base.mjs +1 -2
  47. package/plugins/columnSorting/sortService/engine.js +2 -6
  48. package/plugins/columnSorting/sortService/engine.mjs +2 -2
  49. package/plugins/columnSummary/columnSummary.js +17 -11
  50. package/plugins/columnSummary/columnSummary.mjs +15 -9
  51. package/plugins/columnSummary/utils.js +14 -0
  52. package/plugins/columnSummary/utils.mjs +9 -0
  53. package/plugins/contextMenu/commandExecutor.js +0 -4
  54. package/plugins/contextMenu/commandExecutor.mjs +0 -2
  55. package/plugins/contextMenu/contextMenu.js +5 -1
  56. package/plugins/contextMenu/contextMenu.mjs +5 -1
  57. package/plugins/contextMenu/menu.js +4 -0
  58. package/plugins/contextMenu/menu.mjs +4 -0
  59. package/plugins/copyPaste/copyPaste.js +2 -0
  60. package/plugins/copyPaste/copyPaste.mjs +2 -0
  61. package/plugins/dropdownMenu/dropdownMenu.js +4 -0
  62. package/plugins/dropdownMenu/dropdownMenu.mjs +4 -0
  63. package/plugins/filters/component/condition.js +11 -29
  64. package/plugins/filters/component/condition.mjs +6 -21
  65. package/plugins/filters/component/value.js +12 -5
  66. package/plugins/filters/component/value.mjs +12 -5
  67. package/plugins/filters/filters.d.ts +1 -1
  68. package/plugins/filters/filters.js +62 -82
  69. package/plugins/filters/filters.mjs +63 -83
  70. package/plugins/hiddenColumns/hiddenColumns.js +0 -4
  71. package/plugins/hiddenColumns/hiddenColumns.mjs +0 -2
  72. package/plugins/hiddenRows/hiddenRows.js +0 -4
  73. package/plugins/hiddenRows/hiddenRows.mjs +0 -2
  74. package/plugins/multiColumnSorting/domHelpers.js +2 -4
  75. package/plugins/multiColumnSorting/domHelpers.mjs +1 -2
  76. package/plugins/nestedRows/nestedRows.js +1 -1
  77. package/plugins/nestedRows/nestedRows.mjs +1 -1
  78. package/plugins/search/search.js +0 -2
  79. package/plugins/search/search.mjs +0 -1
  80. package/plugins/trimRows/trimRows.js +3 -3
  81. package/plugins/trimRows/trimRows.mjs +3 -3
  82. package/renderers/numericRenderer/numericRenderer.js +0 -2
  83. package/renderers/numericRenderer/numericRenderer.mjs +0 -1
  84. package/renderers/textRenderer/textRenderer.js +1 -1
  85. package/renderers/textRenderer/textRenderer.mjs +1 -1
  86. package/shortcuts/recorder.js +14 -10
  87. package/shortcuts/recorder.mjs +13 -10
  88. package/shortcuts/utils.js +0 -4
  89. package/shortcuts/utils.mjs +0 -2
  90. package/translations/indexMapper.js +2 -2
  91. package/translations/indexMapper.mjs +2 -2
  92. package/utils/sortingAlgorithms/mergeSort.js +0 -120
  93. package/utils/sortingAlgorithms/mergeSort.mjs +0 -110
@@ -1,3 +1,15 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
+
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
+
11
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
12
+
1
13
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
14
 
3
15
  import "core-js/modules/es.array.iterator.js";
@@ -7,17 +19,19 @@ import "core-js/modules/es.string.iterator.js";
7
19
  import "core-js/modules/web.dom-collections.iterator.js";
8
20
  import "core-js/modules/es.number.is-integer.js";
9
21
  import "core-js/modules/es.number.constructor.js";
10
- import "core-js/modules/es.array.concat.js";
11
22
  import "core-js/modules/es.array.splice.js";
12
23
  import "core-js/modules/es.array.sort.js";
13
24
  import "core-js/modules/es.array.slice.js";
25
+ import "core-js/modules/es.array.concat.js";
26
+ import "core-js/modules/web.dom-collections.for-each.js";
14
27
  import "core-js/modules/es.array.filter.js";
15
28
  import "core-js/modules/es.array.index-of.js";
16
- import "core-js/modules/es.regexp.exec.js";
17
- import "core-js/modules/es.string.split.js";
18
29
  import "core-js/modules/es.symbol.js";
19
30
  import "core-js/modules/es.symbol.description.js";
20
31
  import "core-js/modules/es.symbol.iterator.js";
32
+ import "core-js/modules/es.array.from.js";
33
+ import "core-js/modules/es.function.name.js";
34
+ import "core-js/modules/es.regexp.exec.js";
21
35
 
22
36
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
37
 
@@ -366,7 +380,7 @@ var DataMap = /*#__PURE__*/function () {
366
380
  }
367
381
 
368
382
  this.instance.rowIndexMapper.insertIndexes(rowIndex, numberOfCreatedRows);
369
- this.spliceData.apply(this, [physicalRowIndex, 0].concat(rowsToAdd));
383
+ this.spliceData(physicalRowIndex, 0, rowsToAdd);
370
384
  this.instance.runHooks('afterCreateRow', rowIndex, numberOfCreatedRows, source);
371
385
  this.instance.forceFullRender = true; // used when data was changed
372
386
 
@@ -633,23 +647,26 @@ var DataMap = /*#__PURE__*/function () {
633
647
  * Add/remove row(s) to/from the data source.
634
648
  *
635
649
  * @param {number} index Physical index of the element to add/remove.
636
- * @param {number} amount Number of rows to add/remove.
637
- * @param {...object} elements Row elements to be added.
650
+ * @param {number} deleteCount Number of rows to remove.
651
+ * @param {Array<object>} elements Row elements to be added.
638
652
  */
639
653
 
640
654
  }, {
641
655
  key: "spliceData",
642
- value: function spliceData(index, amount) {
643
- for (var _len3 = arguments.length, elements = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
644
- elements[_key3 - 2] = arguments[_key3];
645
- }
656
+ value: function spliceData(index, deleteCount, elements) {
657
+ var _this3 = this;
646
658
 
647
- var continueSplicing = this.instance.runHooks('beforeDataSplice', index, amount, elements);
659
+ var continueSplicing = this.instance.runHooks('beforeDataSplice', index, deleteCount, elements);
648
660
 
649
661
  if (continueSplicing !== false) {
650
- var _this$dataSource;
662
+ var newData = [].concat(_toConsumableArray(this.dataSource.slice(0, index)), _toConsumableArray(elements), _toConsumableArray(this.dataSource.slice(index))); // We try not to change the reference.
663
+
664
+ this.dataSource.length = 0; // Pushing to array instead of using `splice`, because Babel changes the code to one that uses the `apply` method.
665
+ // The used method was cause of the problem described within #7840.
651
666
 
652
- (_this$dataSource = this.dataSource).splice.apply(_this$dataSource, [index, amount].concat(elements));
667
+ newData.forEach(function (row) {
668
+ return _this3.dataSource.push(row);
669
+ });
653
670
  }
654
671
  }
655
672
  /**
@@ -1,5 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.array.from.js");
4
+
5
+ require("core-js/modules/es.function.name.js");
6
+
7
+ require("core-js/modules/es.regexp.exec.js");
8
+
3
9
  exports.__esModule = true;
4
10
  exports.default = void 0;
5
11
 
@@ -13,10 +19,12 @@ require("core-js/modules/es.string.iterator.js");
13
19
 
14
20
  require("core-js/modules/web.dom-collections.iterator.js");
15
21
 
16
- require("core-js/modules/es.array.splice.js");
17
-
18
22
  require("core-js/modules/es.array.concat.js");
19
23
 
24
+ require("core-js/modules/es.array.slice.js");
25
+
26
+ require("core-js/modules/es.array.splice.js");
27
+
20
28
  require("core-js/modules/es.symbol.iterator.js");
21
29
 
22
30
  require("core-js/modules/es.symbol.js");
@@ -29,6 +37,18 @@ var _array = require("../../helpers/array");
29
37
 
30
38
  var _utils = require("./utils");
31
39
 
40
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
41
+
42
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
43
+
44
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
45
+
46
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
47
+
48
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
49
+
50
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
51
+
32
52
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33
53
 
34
54
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -245,8 +265,6 @@ var LazyFactoryMap = /*#__PURE__*/function (_Symbol$iterator) {
245
265
  }, {
246
266
  key: "insert",
247
267
  value: function insert(key) {
248
- var _this$index;
249
-
250
268
  var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
251
269
  (0, _utils.assert)(function () {
252
270
  return (0, _utils.isUnsignedNumber)(key) || (0, _utils.isNullish)(key);
@@ -259,7 +277,8 @@ var LazyFactoryMap = /*#__PURE__*/function (_Symbol$iterator) {
259
277
  this.data.push(void 0);
260
278
  }
261
279
 
262
- (_this$index = this.index).splice.apply(_this$index, [(0, _utils.isNullish)(key) ? this.index.length : key, 0].concat(newIndexes));
280
+ var insertionIndex = (0, _utils.isNullish)(key) ? this.index.length : key;
281
+ this.index = [].concat(_toConsumableArray(this.index.slice(0, insertionIndex)), newIndexes, _toConsumableArray(this.index.slice(insertionIndex)));
263
282
  }
264
283
  /**
265
284
  * Removes (soft remove) data from "index" and according to the amount of data.
@@ -1,14 +1,30 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
+
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
+
11
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
12
+
1
13
  import "core-js/modules/es.array.iterator.js";
2
14
  import "core-js/modules/es.object.to-string.js";
3
15
  import "core-js/modules/es.set.js";
4
16
  import "core-js/modules/es.string.iterator.js";
5
17
  import "core-js/modules/web.dom-collections.iterator.js";
6
- import "core-js/modules/es.array.splice.js";
7
18
  import "core-js/modules/es.array.concat.js";
19
+ import "core-js/modules/es.array.slice.js";
20
+ import "core-js/modules/es.array.splice.js";
8
21
  import "core-js/modules/es.symbol.iterator.js";
9
22
  import "core-js/modules/es.symbol.js";
10
23
  import "core-js/modules/es.symbol.description.js";
11
24
  import "core-js/modules/es.array.index-of.js";
25
+ import "core-js/modules/es.array.from.js";
26
+ import "core-js/modules/es.function.name.js";
27
+ import "core-js/modules/es.regexp.exec.js";
12
28
 
13
29
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14
30
 
@@ -229,8 +245,6 @@ var LazyFactoryMap = /*#__PURE__*/function (_Symbol$iterator) {
229
245
  }, {
230
246
  key: "insert",
231
247
  value: function insert(key) {
232
- var _this$index;
233
-
234
248
  var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
235
249
  assert(function () {
236
250
  return isUnsignedNumber(key) || isNullish(key);
@@ -243,7 +257,8 @@ var LazyFactoryMap = /*#__PURE__*/function (_Symbol$iterator) {
243
257
  this.data.push(void 0);
244
258
  }
245
259
 
246
- (_this$index = this.index).splice.apply(_this$index, [isNullish(key) ? this.index.length : key, 0].concat(newIndexes));
260
+ var insertionIndex = isNullish(key) ? this.index.length : key;
261
+ this.index = [].concat(_toConsumableArray(this.index.slice(0, insertionIndex)), newIndexes, _toConsumableArray(this.index.slice(insertionIndex)));
247
262
  }
248
263
  /**
249
264
  * Removes (soft remove) data from "index" and according to the amount of data.