handsontable 14.5.0 → 14.6.0-next-6fbf568-20240930

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. package/3rdparty/walkontable/src/renderer/rows.js +10 -0
  2. package/3rdparty/walkontable/src/renderer/rows.mjs +11 -1
  3. package/3rdparty/walkontable/src/selection/manager.js +7 -7
  4. package/3rdparty/walkontable/src/selection/manager.mjs +7 -7
  5. package/3rdparty/walkontable/src/selection/scanner.js +7 -7
  6. package/3rdparty/walkontable/src/selection/scanner.mjs +7 -7
  7. package/CHANGELOG.md +29 -0
  8. package/base.js +2 -2
  9. package/base.mjs +2 -2
  10. package/core.d.ts +13 -2
  11. package/core.js +160 -9
  12. package/core.mjs +160 -9
  13. package/dataMap/metaManager/lazyFactoryMap.js +7 -7
  14. package/dataMap/metaManager/lazyFactoryMap.mjs +7 -7
  15. package/dataMap/metaManager/metaSchema.js +5 -6
  16. package/dataMap/metaManager/metaSchema.mjs +7 -8
  17. package/dataMap/metaManager/mods/dynamicCellMeta.js +7 -7
  18. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +7 -7
  19. package/dataMap/metaManager/mods/extendMetaProperties.js +7 -7
  20. package/dataMap/metaManager/mods/extendMetaProperties.mjs +7 -7
  21. package/dataMap/metaManager/utils.js +7 -7
  22. package/dataMap/metaManager/utils.mjs +7 -7
  23. package/dist/handsontable.css +3 -17
  24. package/dist/handsontable.full.css +3 -17
  25. package/dist/handsontable.full.js +3501 -3220
  26. package/dist/handsontable.full.min.css +3 -3
  27. package/dist/handsontable.full.min.js +109 -119
  28. package/dist/handsontable.js +3175 -2898
  29. package/dist/handsontable.min.css +3 -3
  30. package/dist/handsontable.min.js +19 -19
  31. package/editors/autocompleteEditor/autocompleteEditor.d.ts +1 -1
  32. package/helpers/a11y.js +2 -0
  33. package/helpers/a11y.mjs +1 -0
  34. package/helpers/array.js +7 -7
  35. package/helpers/array.mjs +7 -7
  36. package/helpers/mixed.js +2 -2
  37. package/helpers/mixed.mjs +2 -2
  38. package/helpers/number.js +7 -7
  39. package/helpers/number.mjs +7 -7
  40. package/package.json +1 -1
  41. package/pluginHooks.d.ts +1 -1
  42. package/pluginHooks.js +4 -1
  43. package/pluginHooks.mjs +4 -1
  44. package/plugins/autoRowSize/autoRowSize.js +1 -2
  45. package/plugins/autoRowSize/autoRowSize.mjs +1 -2
  46. package/plugins/columnSorting/columnSorting.js +10 -1
  47. package/plugins/columnSorting/columnSorting.mjs +10 -1
  48. package/plugins/columnSorting/utils.js +7 -7
  49. package/plugins/columnSorting/utils.mjs +7 -7
  50. package/plugins/contextMenu/contextMenu.js +7 -0
  51. package/plugins/contextMenu/contextMenu.mjs +7 -0
  52. package/plugins/contextMenu/menu/menu.js +47 -14
  53. package/plugins/contextMenu/menu/menu.mjs +48 -15
  54. package/plugins/contextMenu/menu/menuItemRenderer.js +3 -4
  55. package/plugins/contextMenu/menu/menuItemRenderer.mjs +5 -6
  56. package/plugins/contextMenu/menu/positioner.js +4 -12
  57. package/plugins/contextMenu/menu/positioner.mjs +4 -12
  58. package/plugins/contextMenu/menu/utils.js +11 -0
  59. package/plugins/contextMenu/menu/utils.mjs +10 -0
  60. package/plugins/contextMenu/predefinedItems/alignment.js +56 -49
  61. package/plugins/contextMenu/predefinedItems/alignment.mjs +57 -50
  62. package/plugins/contextMenu/predefinedItems/readOnly.js +8 -0
  63. package/plugins/contextMenu/predefinedItems/readOnly.mjs +8 -0
  64. package/plugins/contextMenu/utils.js +26 -0
  65. package/plugins/contextMenu/utils.mjs +24 -0
  66. package/plugins/copyPaste/copyPaste.js +14 -14
  67. package/plugins/copyPaste/copyPaste.mjs +14 -14
  68. package/plugins/dropdownMenu/dropdownMenu.js +10 -4
  69. package/plugins/dropdownMenu/dropdownMenu.mjs +10 -4
  70. package/plugins/filters/component/condition.js +6 -1
  71. package/plugins/filters/component/condition.mjs +6 -1
  72. package/plugins/filters/component/value.js +6 -1
  73. package/plugins/filters/component/value.mjs +6 -1
  74. package/plugins/filters/conditionCollection.d.ts +4 -3
  75. package/plugins/filters/conditionCollection.js +26 -0
  76. package/plugins/filters/conditionCollection.mjs +26 -0
  77. package/plugins/filters/filters.js +4 -1
  78. package/plugins/filters/filters.mjs +4 -1
  79. package/plugins/filters/ui/multipleSelect.js +7 -9
  80. package/plugins/filters/ui/multipleSelect.mjs +7 -9
  81. package/plugins/filters/utils.js +7 -7
  82. package/plugins/filters/utils.mjs +7 -7
  83. package/plugins/formulas/formulas.js +7 -7
  84. package/plugins/formulas/formulas.mjs +7 -7
  85. package/plugins/hiddenColumns/hiddenColumns.js +7 -7
  86. package/plugins/hiddenColumns/hiddenColumns.mjs +7 -7
  87. package/plugins/hiddenRows/hiddenRows.js +7 -7
  88. package/plugins/hiddenRows/hiddenRows.mjs +7 -7
  89. package/plugins/mergeCells/cellsCollection.js +18 -16
  90. package/plugins/mergeCells/cellsCollection.mjs +19 -17
  91. package/plugins/mergeCells/mergeCells.js +7 -7
  92. package/plugins/mergeCells/mergeCells.mjs +7 -7
  93. package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.js +7 -7
  94. package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +7 -7
  95. package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.js +7 -7
  96. package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.mjs +7 -7
  97. package/plugins/nestedRows/nestedRows.js +7 -7
  98. package/plugins/nestedRows/nestedRows.mjs +7 -7
  99. package/plugins/trimRows/trimRows.js +7 -7
  100. package/plugins/trimRows/trimRows.mjs +7 -7
  101. package/plugins/undoRedo/undoRedo.js +9 -5
  102. package/plugins/undoRedo/undoRedo.mjs +9 -5
  103. package/renderers/checkboxRenderer/checkboxRenderer.js +18 -6
  104. package/renderers/checkboxRenderer/checkboxRenderer.mjs +18 -6
  105. package/selection/selection.js +7 -7
  106. package/selection/selection.mjs +7 -7
  107. package/selection/utils.js +7 -7
  108. package/selection/utils.mjs +7 -7
  109. package/shortcutContexts/grid.js +10 -3
  110. package/shortcutContexts/grid.mjs +10 -3
  111. package/shortcuts/keyObserver.js +7 -7
  112. package/shortcuts/keyObserver.mjs +7 -7
  113. package/shortcuts/utils.js +3 -1
  114. package/shortcuts/utils.mjs +3 -1
  115. package/translations/changesObservable/observable.js +7 -7
  116. package/translations/changesObservable/observable.mjs +7 -7
  117. package/translations/indexMapper.js +7 -7
  118. package/translations/indexMapper.mjs +7 -7
  119. package/utils/dataStructures/uniqueSet.js +7 -7
  120. package/utils/dataStructures/uniqueSet.mjs +7 -7
  121. package/utils/ghostTable.js +11 -9
  122. package/utils/ghostTable.mjs +12 -10
  123. package/utils/paginator.js +7 -7
  124. package/utils/paginator.mjs +7 -7
@@ -1,13 +1,13 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
2
  import "core-js/modules/es.array.push.js";
3
3
  import "core-js/modules/es.array.unscopables.flat-map.js";
4
- import "core-js/modules/esnext.set.difference.v2.js";
5
- import "core-js/modules/esnext.set.intersection.v2.js";
6
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
7
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
8
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
9
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
10
- import "core-js/modules/esnext.set.union.v2.js";
4
+ import "core-js/modules/es.set.difference.v2.js";
5
+ import "core-js/modules/es.set.intersection.v2.js";
6
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
7
+ import "core-js/modules/es.set.is-subset-of.v2.js";
8
+ import "core-js/modules/es.set.is-superset-of.v2.js";
9
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
10
+ import "core-js/modules/es.set.union.v2.js";
11
11
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
12
12
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
13
13
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -15,7 +15,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
15
15
  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); }
16
16
  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"); }
17
17
  import MergedCellCoords from "./cellCoords.mjs";
18
- import { rangeEach, rangeEachReverse } from "../../helpers/number.mjs";
18
+ import { rangeEach } from "../../helpers/number.mjs";
19
19
  import { warn } from "../../helpers/console.mjs";
20
20
  import { arrayEach } from "../../helpers/array.mjs";
21
21
  import { toSingleLine } from "../../helpers/templateLiteralTag.mjs";
@@ -420,18 +420,20 @@ class MergedCellsCollection {
420
420
  break;
421
421
  default:
422
422
  }
423
- arrayEach(this.mergedCells, currentMerge => {
424
- _assertClassBrand(_MergedCellsCollection_brand, this, _removeMergedCellFromMatrix).call(this, currentMerge);
423
+ const removedMergedCells = [];
424
+ this.mergedCells.forEach(currentMerge => {
425
425
  currentMerge.shift(shiftVector, index);
426
- _assertClassBrand(_MergedCellsCollection_brand, this, _addMergedCellToMatrix).call(this, currentMerge);
427
- });
428
- rangeEachReverse(this.mergedCells.length - 1, 0, i => {
429
- const currentMerge = this.mergedCells[i];
430
- if (currentMerge && currentMerge.removed) {
431
- this.mergedCells.splice(this.mergedCells.indexOf(currentMerge), 1);
432
- _assertClassBrand(_MergedCellsCollection_brand, this, _removeMergedCellFromMatrix).call(this, currentMerge);
426
+ if (currentMerge.removed) {
427
+ removedMergedCells.push(currentMerge);
433
428
  }
434
429
  });
430
+ removedMergedCells.forEach(removedMerge => {
431
+ this.mergedCells.splice(this.mergedCells.indexOf(removedMerge), 1);
432
+ });
433
+ this.mergedCellsMatrix.clear();
434
+ this.mergedCells.forEach(currentMerge => {
435
+ _assertClassBrand(_MergedCellsCollection_brand, this, _addMergedCellToMatrix).call(this, currentMerge);
436
+ });
435
437
  }
436
438
 
437
439
  /**
@@ -3,13 +3,13 @@
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
5
  require("core-js/modules/es.array.push.js");
6
- require("core-js/modules/esnext.set.difference.v2.js");
7
- require("core-js/modules/esnext.set.intersection.v2.js");
8
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
9
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
10
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
11
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
12
- require("core-js/modules/esnext.set.union.v2.js");
6
+ require("core-js/modules/es.set.difference.v2.js");
7
+ require("core-js/modules/es.set.intersection.v2.js");
8
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
9
+ require("core-js/modules/es.set.is-subset-of.v2.js");
10
+ require("core-js/modules/es.set.is-superset-of.v2.js");
11
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
12
+ require("core-js/modules/es.set.union.v2.js");
13
13
  var _base = require("../base");
14
14
  var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
15
15
  var _cellsCollection = _interopRequireDefault(require("./cellsCollection"));
@@ -1,12 +1,12 @@
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/esnext.set.difference.v2.js";
4
- import "core-js/modules/esnext.set.intersection.v2.js";
5
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
6
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
7
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
8
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
9
- import "core-js/modules/esnext.set.union.v2.js";
3
+ import "core-js/modules/es.set.difference.v2.js";
4
+ import "core-js/modules/es.set.intersection.v2.js";
5
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
6
+ import "core-js/modules/es.set.is-subset-of.v2.js";
7
+ import "core-js/modules/es.set.is-superset-of.v2.js";
8
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
9
+ import "core-js/modules/es.set.union.v2.js";
10
10
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
11
11
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
12
12
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
@@ -2,13 +2,13 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.collapseNode = collapseNode;
5
- require("core-js/modules/esnext.set.difference.v2.js");
6
- require("core-js/modules/esnext.set.intersection.v2.js");
7
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
8
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
9
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
10
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
11
- require("core-js/modules/esnext.set.union.v2.js");
5
+ require("core-js/modules/es.set.difference.v2.js");
6
+ require("core-js/modules/es.set.intersection.v2.js");
7
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
8
+ require("core-js/modules/es.set.is-subset-of.v2.js");
9
+ require("core-js/modules/es.set.is-superset-of.v2.js");
10
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
11
+ require("core-js/modules/es.set.union.v2.js");
12
12
  var _array = require("../../../../helpers/array");
13
13
  var _expand = require("./expand");
14
14
  var _tree = require("./utils/tree");
@@ -1,10 +1,10 @@
1
- import "core-js/modules/esnext.set.difference.v2.js";
2
- import "core-js/modules/esnext.set.intersection.v2.js";
3
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
4
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
5
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
6
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
7
- import "core-js/modules/esnext.set.union.v2.js";
1
+ import "core-js/modules/es.set.difference.v2.js";
2
+ import "core-js/modules/es.set.intersection.v2.js";
3
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
4
+ import "core-js/modules/es.set.is-subset-of.v2.js";
5
+ import "core-js/modules/es.set.is-superset-of.v2.js";
6
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
7
+ import "core-js/modules/es.set.union.v2.js";
8
8
  import { arrayEach } from "../../../../helpers/array.mjs";
9
9
  import { expandNode } from "./expand.mjs";
10
10
  import { getFirstChildProperty, isNodeReflectsFirstChildColspan, traverseHiddenNodeColumnIndexes } from "./utils/tree.mjs";
@@ -2,13 +2,13 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.expandNode = expandNode;
5
- require("core-js/modules/esnext.set.difference.v2.js");
6
- require("core-js/modules/esnext.set.intersection.v2.js");
7
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
8
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
9
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
10
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
11
- require("core-js/modules/esnext.set.union.v2.js");
5
+ require("core-js/modules/es.set.difference.v2.js");
6
+ require("core-js/modules/es.set.intersection.v2.js");
7
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
8
+ require("core-js/modules/es.set.is-subset-of.v2.js");
9
+ require("core-js/modules/es.set.is-superset-of.v2.js");
10
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
11
+ require("core-js/modules/es.set.union.v2.js");
12
12
  var _array = require("../../../../helpers/array");
13
13
  var _collapse = require("./collapse");
14
14
  var _tree = require("./utils/tree");
@@ -1,10 +1,10 @@
1
- import "core-js/modules/esnext.set.difference.v2.js";
2
- import "core-js/modules/esnext.set.intersection.v2.js";
3
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
4
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
5
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
6
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
7
- import "core-js/modules/esnext.set.union.v2.js";
1
+ import "core-js/modules/es.set.difference.v2.js";
2
+ import "core-js/modules/es.set.intersection.v2.js";
3
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
4
+ import "core-js/modules/es.set.is-subset-of.v2.js";
5
+ import "core-js/modules/es.set.is-superset-of.v2.js";
6
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
7
+ import "core-js/modules/es.set.union.v2.js";
8
8
  import { arrayEach } from "../../../../helpers/array.mjs";
9
9
  import { collapseNode } from "./collapse.mjs";
10
10
  import { getFirstChildProperty, isNodeReflectsFirstChildColspan, traverseHiddenNodeColumnIndexes } from "./utils/tree.mjs";
@@ -3,13 +3,13 @@
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
5
  require("core-js/modules/es.array.push.js");
6
- require("core-js/modules/esnext.set.difference.v2.js");
7
- require("core-js/modules/esnext.set.intersection.v2.js");
8
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
9
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
10
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
11
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
12
- require("core-js/modules/esnext.set.union.v2.js");
6
+ require("core-js/modules/es.set.difference.v2.js");
7
+ require("core-js/modules/es.set.intersection.v2.js");
8
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
9
+ require("core-js/modules/es.set.is-subset-of.v2.js");
10
+ require("core-js/modules/es.set.is-superset-of.v2.js");
11
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
12
+ require("core-js/modules/es.set.union.v2.js");
13
13
  var _base = require("../base");
14
14
  var _dataManager = _interopRequireDefault(require("./data/dataManager"));
15
15
  var _collapsing = _interopRequireDefault(require("./ui/collapsing"));
@@ -1,12 +1,12 @@
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/esnext.set.difference.v2.js";
4
- import "core-js/modules/esnext.set.intersection.v2.js";
5
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
6
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
7
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
8
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
9
- import "core-js/modules/esnext.set.union.v2.js";
3
+ import "core-js/modules/es.set.difference.v2.js";
4
+ import "core-js/modules/es.set.intersection.v2.js";
5
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
6
+ import "core-js/modules/es.set.is-subset-of.v2.js";
7
+ import "core-js/modules/es.set.is-superset-of.v2.js";
8
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
9
+ import "core-js/modules/es.set.union.v2.js";
10
10
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
11
11
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
12
12
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
@@ -3,13 +3,13 @@
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
5
  require("core-js/modules/es.array.push.js");
6
- require("core-js/modules/esnext.set.difference.v2.js");
7
- require("core-js/modules/esnext.set.intersection.v2.js");
8
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
9
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
10
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
11
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
12
- require("core-js/modules/esnext.set.union.v2.js");
6
+ require("core-js/modules/es.set.difference.v2.js");
7
+ require("core-js/modules/es.set.intersection.v2.js");
8
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
9
+ require("core-js/modules/es.set.is-subset-of.v2.js");
10
+ require("core-js/modules/es.set.is-superset-of.v2.js");
11
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
12
+ require("core-js/modules/es.set.union.v2.js");
13
13
  var _base = require("../base");
14
14
  var _translations = require("../../translations");
15
15
  var _array = require("../../helpers/array");
@@ -1,12 +1,12 @@
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/esnext.set.difference.v2.js";
4
- import "core-js/modules/esnext.set.intersection.v2.js";
5
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
6
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
7
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
8
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
9
- import "core-js/modules/esnext.set.union.v2.js";
3
+ import "core-js/modules/es.set.difference.v2.js";
4
+ import "core-js/modules/es.set.intersection.v2.js";
5
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
6
+ import "core-js/modules/es.set.is-subset-of.v2.js";
7
+ import "core-js/modules/es.set.is-superset-of.v2.js";
8
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
9
+ import "core-js/modules/es.set.union.v2.js";
10
10
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
11
11
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
12
12
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -124,8 +124,8 @@ function UndoRedo(instance) {
124
124
  instance.addHook('beforeCellAlignment', (stateBefore, range, type, alignment) => {
125
125
  plugin.done(() => new UndoRedo.CellAlignmentAction(stateBefore, range, type, alignment));
126
126
  });
127
- instance.addHook('beforeFilter', conditionsStack => {
128
- plugin.done(() => new UndoRedo.FiltersAction(conditionsStack));
127
+ instance.addHook('beforeFilter', (conditionsStack, previousConditionsStack) => {
128
+ plugin.done(() => new UndoRedo.FiltersAction(conditionsStack, previousConditionsStack));
129
129
  });
130
130
  instance.addHook('beforeRowMove', (rows, finalIndex) => {
131
131
  if (rows === false) {
@@ -645,9 +645,11 @@ UndoRedo.CellAlignmentAction.prototype.redo = function (instance, undoneCallback
645
645
  * Filters action.
646
646
  *
647
647
  * @private
648
- * @param {Array} conditionsStack An array of the filter condition.
648
+ * @param {Array} conditionsStack An array of the filter conditions.
649
+ * @param {Array} previousConditionsStack An array of the previous filter conditions.
649
650
  */
650
- UndoRedo.FiltersAction = function (conditionsStack) {
651
+ UndoRedo.FiltersAction = function (conditionsStack, previousConditionsStack) {
652
+ this.previousConditionsStack = previousConditionsStack;
651
653
  this.conditionsStack = conditionsStack;
652
654
  this.actionType = 'filter';
653
655
  };
@@ -655,7 +657,9 @@ UndoRedo.FiltersAction = function (conditionsStack) {
655
657
  UndoRedo.FiltersAction.prototype.undo = function (instance, undoneCallback) {
656
658
  const filters = instance.getPlugin('filters');
657
659
  instance.addHookOnce('afterViewRender', undoneCallback);
658
- filters.conditionCollection.importAllConditions(this.conditionsStack.slice(0, this.conditionsStack.length - 1));
660
+ if (this.previousConditionsStack) {
661
+ filters.conditionCollection.importAllConditions(this.previousConditionsStack);
662
+ }
659
663
  filters.filter();
660
664
  };
661
665
  UndoRedo.FiltersAction.prototype.redo = function (instance, redoneCallback) {
@@ -120,8 +120,8 @@ function UndoRedo(instance) {
120
120
  instance.addHook('beforeCellAlignment', (stateBefore, range, type, alignment) => {
121
121
  plugin.done(() => new UndoRedo.CellAlignmentAction(stateBefore, range, type, alignment));
122
122
  });
123
- instance.addHook('beforeFilter', conditionsStack => {
124
- plugin.done(() => new UndoRedo.FiltersAction(conditionsStack));
123
+ instance.addHook('beforeFilter', (conditionsStack, previousConditionsStack) => {
124
+ plugin.done(() => new UndoRedo.FiltersAction(conditionsStack, previousConditionsStack));
125
125
  });
126
126
  instance.addHook('beforeRowMove', (rows, finalIndex) => {
127
127
  if (rows === false) {
@@ -641,9 +641,11 @@ UndoRedo.CellAlignmentAction.prototype.redo = function (instance, undoneCallback
641
641
  * Filters action.
642
642
  *
643
643
  * @private
644
- * @param {Array} conditionsStack An array of the filter condition.
644
+ * @param {Array} conditionsStack An array of the filter conditions.
645
+ * @param {Array} previousConditionsStack An array of the previous filter conditions.
645
646
  */
646
- UndoRedo.FiltersAction = function (conditionsStack) {
647
+ UndoRedo.FiltersAction = function (conditionsStack, previousConditionsStack) {
648
+ this.previousConditionsStack = previousConditionsStack;
647
649
  this.conditionsStack = conditionsStack;
648
650
  this.actionType = 'filter';
649
651
  };
@@ -651,7 +653,9 @@ inherit(UndoRedo.FiltersAction, UndoRedo.Action);
651
653
  UndoRedo.FiltersAction.prototype.undo = function (instance, undoneCallback) {
652
654
  const filters = instance.getPlugin('filters');
653
655
  instance.addHookOnce('afterViewRender', undoneCallback);
654
- filters.conditionCollection.importAllConditions(this.conditionsStack.slice(0, this.conditionsStack.length - 1));
656
+ if (this.previousConditionsStack) {
657
+ filters.conditionCollection.importAllConditions(this.previousConditionsStack);
658
+ }
655
659
  filters.filter();
656
660
  };
657
661
  UndoRedo.FiltersAction.prototype.redo = function (instance, redoneCallback) {
@@ -186,6 +186,7 @@ function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellProperties
186
186
  let uncheckCheckbox = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
187
187
  const selRange = hotInstance.getSelectedRange();
188
188
  const changesPerSubSelection = [];
189
+ const nonCheckboxChanges = new Map();
189
190
  let changes = [];
190
191
  let changeCounter = 0;
191
192
  if (!selRange) {
@@ -207,8 +208,19 @@ function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellProperties
207
208
  checkedTemplate: cachedCellProperties.checkedTemplate,
208
209
  uncheckedTemplate: cachedCellProperties.uncheckedTemplate
209
210
  };
211
+
212
+ // TODO: In the future it'd be better if non-checkbox changes were handled by the non-checkbox
213
+ // `delete` keypress logic.
214
+ /* eslint-disable no-continue */
210
215
  if (cachedCellProperties.type !== 'checkbox') {
211
- return;
216
+ if (uncheckCheckbox === true && !cachedCellProperties.readOnly) {
217
+ if (nonCheckboxChanges.has(changesPerSubSelection.length)) {
218
+ nonCheckboxChanges.set(changesPerSubSelection.length, [...nonCheckboxChanges.get(changesPerSubSelection.length), [visualRow, visualColumn, null]]);
219
+ } else {
220
+ nonCheckboxChanges.set(changesPerSubSelection.length, [[visualRow, visualColumn, null]]);
221
+ }
222
+ }
223
+ continue;
212
224
  }
213
225
 
214
226
  /* eslint-disable no-continue */
@@ -256,8 +268,11 @@ function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellProperties
256
268
  if (changes.length > 0) {
257
269
  // TODO: This is workaround for handsontable/dev-handsontable#1747 not being a breaking change.
258
270
  // Technically, the changes don't need to be split into chunks when sent to `setDataAtCell`.
259
- changesPerSubSelection.forEach(changesCount => {
260
- const changesChunk = changes.splice(0, changesCount);
271
+ changesPerSubSelection.forEach((changesCount, sectionCount) => {
272
+ let changesChunk = changes.splice(0, changesCount);
273
+ if (nonCheckboxChanges.size && nonCheckboxChanges.has(sectionCount)) {
274
+ changesChunk = [...changesChunk, ...nonCheckboxChanges.get(sectionCount)];
275
+ }
261
276
  hotInstance.setDataAtCell(changesChunk);
262
277
  });
263
278
  }
@@ -280,9 +295,6 @@ function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellProperties
280
295
  for (let visualRow = topLeft.row; visualRow <= bottomRight.row; visualRow++) {
281
296
  for (let visualColumn = topLeft.col; visualColumn <= bottomRight.col; visualColumn++) {
282
297
  const cachedCellProperties = hotInstance.getCellMeta(visualRow, visualColumn);
283
- if (cachedCellProperties.type !== 'checkbox') {
284
- return false;
285
- }
286
298
  const cell = hotInstance.getCell(visualRow, visualColumn);
287
299
  if (cell === null || cell === undefined) {
288
300
  return true;
@@ -181,6 +181,7 @@ export function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellPro
181
181
  let uncheckCheckbox = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
182
182
  const selRange = hotInstance.getSelectedRange();
183
183
  const changesPerSubSelection = [];
184
+ const nonCheckboxChanges = new Map();
184
185
  let changes = [];
185
186
  let changeCounter = 0;
186
187
  if (!selRange) {
@@ -202,8 +203,19 @@ export function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellPro
202
203
  checkedTemplate: cachedCellProperties.checkedTemplate,
203
204
  uncheckedTemplate: cachedCellProperties.uncheckedTemplate
204
205
  };
206
+
207
+ // TODO: In the future it'd be better if non-checkbox changes were handled by the non-checkbox
208
+ // `delete` keypress logic.
209
+ /* eslint-disable no-continue */
205
210
  if (cachedCellProperties.type !== 'checkbox') {
206
- return;
211
+ if (uncheckCheckbox === true && !cachedCellProperties.readOnly) {
212
+ if (nonCheckboxChanges.has(changesPerSubSelection.length)) {
213
+ nonCheckboxChanges.set(changesPerSubSelection.length, [...nonCheckboxChanges.get(changesPerSubSelection.length), [visualRow, visualColumn, null]]);
214
+ } else {
215
+ nonCheckboxChanges.set(changesPerSubSelection.length, [[visualRow, visualColumn, null]]);
216
+ }
217
+ }
218
+ continue;
207
219
  }
208
220
 
209
221
  /* eslint-disable no-continue */
@@ -251,8 +263,11 @@ export function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellPro
251
263
  if (changes.length > 0) {
252
264
  // TODO: This is workaround for handsontable/dev-handsontable#1747 not being a breaking change.
253
265
  // Technically, the changes don't need to be split into chunks when sent to `setDataAtCell`.
254
- changesPerSubSelection.forEach(changesCount => {
255
- const changesChunk = changes.splice(0, changesCount);
266
+ changesPerSubSelection.forEach((changesCount, sectionCount) => {
267
+ let changesChunk = changes.splice(0, changesCount);
268
+ if (nonCheckboxChanges.size && nonCheckboxChanges.has(sectionCount)) {
269
+ changesChunk = [...changesChunk, ...nonCheckboxChanges.get(sectionCount)];
270
+ }
256
271
  hotInstance.setDataAtCell(changesChunk);
257
272
  });
258
273
  }
@@ -275,9 +290,6 @@ export function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellPro
275
290
  for (let visualRow = topLeft.row; visualRow <= bottomRight.row; visualRow++) {
276
291
  for (let visualColumn = topLeft.col; visualColumn <= bottomRight.col; visualColumn++) {
277
292
  const cachedCellProperties = hotInstance.getCellMeta(visualRow, visualColumn);
278
- if (cachedCellProperties.type !== 'checkbox') {
279
- return false;
280
- }
281
293
  const cell = hotInstance.getCell(visualRow, visualColumn);
282
294
  if (cell === null || cell === undefined) {
283
295
  return true;
@@ -3,13 +3,13 @@
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
5
  require("core-js/modules/es.array.push.js");
6
- require("core-js/modules/esnext.set.difference.v2.js");
7
- require("core-js/modules/esnext.set.intersection.v2.js");
8
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
9
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
10
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
11
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
12
- require("core-js/modules/esnext.set.union.v2.js");
6
+ require("core-js/modules/es.set.difference.v2.js");
7
+ require("core-js/modules/es.set.intersection.v2.js");
8
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
9
+ require("core-js/modules/es.set.is-subset-of.v2.js");
10
+ require("core-js/modules/es.set.is-superset-of.v2.js");
11
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
12
+ require("core-js/modules/es.set.union.v2.js");
13
13
  var _highlight = _interopRequireWildcard(require("./highlight/highlight"));
14
14
  var _range = _interopRequireDefault(require("./range"));
15
15
  var _object = require("./../helpers/object");
@@ -1,12 +1,12 @@
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/esnext.set.difference.v2.js";
4
- import "core-js/modules/esnext.set.intersection.v2.js";
5
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
6
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
7
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
8
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
9
- import "core-js/modules/esnext.set.union.v2.js";
3
+ import "core-js/modules/es.set.difference.v2.js";
4
+ import "core-js/modules/es.set.intersection.v2.js";
5
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
6
+ import "core-js/modules/es.set.is-subset-of.v2.js";
7
+ import "core-js/modules/es.set.is-superset-of.v2.js";
8
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
9
+ import "core-js/modules/es.set.union.v2.js";
10
10
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
11
11
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
12
12
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -7,13 +7,13 @@ exports.transformSelectionToColumnDistance = transformSelectionToColumnDistance;
7
7
  exports.transformSelectionToRowDistance = transformSelectionToRowDistance;
8
8
  require("core-js/modules/es.error.cause.js");
9
9
  require("core-js/modules/es.array.push.js");
10
- require("core-js/modules/esnext.set.difference.v2.js");
11
- require("core-js/modules/esnext.set.intersection.v2.js");
12
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
13
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
14
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
15
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
16
- require("core-js/modules/esnext.set.union.v2.js");
10
+ require("core-js/modules/es.set.difference.v2.js");
11
+ require("core-js/modules/es.set.intersection.v2.js");
12
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
13
+ require("core-js/modules/es.set.is-subset-of.v2.js");
14
+ require("core-js/modules/es.set.is-superset-of.v2.js");
15
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
16
+ require("core-js/modules/es.set.union.v2.js");
17
17
  var _src = require("./../3rdparty/walkontable/src");
18
18
  var _array = require("./../helpers/array");
19
19
  var _mixed = require("./../helpers/mixed");
@@ -1,12 +1,12 @@
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/esnext.set.difference.v2.js";
4
- import "core-js/modules/esnext.set.intersection.v2.js";
5
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
6
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
7
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
8
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
9
- import "core-js/modules/esnext.set.union.v2.js";
3
+ import "core-js/modules/es.set.difference.v2.js";
4
+ import "core-js/modules/es.set.intersection.v2.js";
5
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
6
+ import "core-js/modules/es.set.is-subset-of.v2.js";
7
+ import "core-js/modules/es.set.is-superset-of.v2.js";
8
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
9
+ import "core-js/modules/es.set.union.v2.js";
10
10
  import { CellRange } from "./../3rdparty/walkontable/src/index.mjs";
11
11
  import { arrayEach, arrayReduce } from "./../helpers/array.mjs";
12
12
  import { isUndefined } from "./../helpers/mixed.mjs";
@@ -38,11 +38,17 @@ function shortcutsGridContext(hot) {
38
38
  context.addShortcuts([{
39
39
  keys: [['Control/Meta', 'A']],
40
40
  callback: () => commandsPool.selectAllCells(),
41
- runOnlyIf: () => !hot.getSelectedRangeLast().highlight.isHeader()
41
+ runOnlyIf: () => {
42
+ var _hot$getSelectedRange;
43
+ return !((_hot$getSelectedRange = hot.getSelectedRangeLast()) !== null && _hot$getSelectedRange !== void 0 && _hot$getSelectedRange.highlight.isHeader());
44
+ }
42
45
  }, {
43
46
  keys: [['Control/Meta', 'A']],
44
47
  callback: () => {},
45
- runOnlyIf: () => hot.getSelectedRangeLast().highlight.isHeader(),
48
+ runOnlyIf: () => {
49
+ var _hot$getSelectedRange2;
50
+ return (_hot$getSelectedRange2 = hot.getSelectedRangeLast()) === null || _hot$getSelectedRange2 === void 0 ? void 0 : _hot$getSelectedRange2.highlight.isHeader();
51
+ },
46
52
  preventDefault: true
47
53
  }, {
48
54
  keys: [['Control/Meta', 'Shift', 'Space']],
@@ -51,7 +57,8 @@ function shortcutsGridContext(hot) {
51
57
  keys: [['Control/Meta', 'Enter']],
52
58
  callback: () => commandsPool.populateSelectedCellsData(),
53
59
  runOnlyIf: () => {
54
- return !hot.getSelectedRangeLast().highlight.isHeader() && hot.getSelectedRangeLast().getCellsCount() > 1;
60
+ var _hot$getSelectedRange3, _hot$getSelectedRange4;
61
+ return !((_hot$getSelectedRange3 = hot.getSelectedRangeLast()) !== null && _hot$getSelectedRange3 !== void 0 && _hot$getSelectedRange3.highlight.isHeader()) && ((_hot$getSelectedRange4 = hot.getSelectedRangeLast()) === null || _hot$getSelectedRange4 === void 0 ? void 0 : _hot$getSelectedRange4.getCellsCount()) > 1;
55
62
  }
56
63
  }, {
57
64
  keys: [['Control', 'Space']],
@@ -34,11 +34,17 @@ export function shortcutsGridContext(hot) {
34
34
  context.addShortcuts([{
35
35
  keys: [['Control/Meta', 'A']],
36
36
  callback: () => commandsPool.selectAllCells(),
37
- runOnlyIf: () => !hot.getSelectedRangeLast().highlight.isHeader()
37
+ runOnlyIf: () => {
38
+ var _hot$getSelectedRange;
39
+ return !((_hot$getSelectedRange = hot.getSelectedRangeLast()) !== null && _hot$getSelectedRange !== void 0 && _hot$getSelectedRange.highlight.isHeader());
40
+ }
38
41
  }, {
39
42
  keys: [['Control/Meta', 'A']],
40
43
  callback: () => {},
41
- runOnlyIf: () => hot.getSelectedRangeLast().highlight.isHeader(),
44
+ runOnlyIf: () => {
45
+ var _hot$getSelectedRange2;
46
+ return (_hot$getSelectedRange2 = hot.getSelectedRangeLast()) === null || _hot$getSelectedRange2 === void 0 ? void 0 : _hot$getSelectedRange2.highlight.isHeader();
47
+ },
42
48
  preventDefault: true
43
49
  }, {
44
50
  keys: [['Control/Meta', 'Shift', 'Space']],
@@ -47,7 +53,8 @@ export function shortcutsGridContext(hot) {
47
53
  keys: [['Control/Meta', 'Enter']],
48
54
  callback: () => commandsPool.populateSelectedCellsData(),
49
55
  runOnlyIf: () => {
50
- return !hot.getSelectedRangeLast().highlight.isHeader() && hot.getSelectedRangeLast().getCellsCount() > 1;
56
+ var _hot$getSelectedRange3, _hot$getSelectedRange4;
57
+ return !((_hot$getSelectedRange3 = hot.getSelectedRangeLast()) !== null && _hot$getSelectedRange3 !== void 0 && _hot$getSelectedRange3.highlight.isHeader()) && ((_hot$getSelectedRange4 = hot.getSelectedRangeLast()) === null || _hot$getSelectedRange4 === void 0 ? void 0 : _hot$getSelectedRange4.getCellsCount()) > 1;
51
58
  }
52
59
  }, {
53
60
  keys: [['Control', 'Space']],