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
@@ -260,13 +260,16 @@ class DropdownMenu extends _base.BasePlugin {
260
260
  from
261
261
  } = this.hot.getSelectedRangeLast();
262
262
  const offset = (0, _utils.getDocumentOffsetByElement)(this.menu.container, this.hot.rootDocument);
263
- const target = this.hot.getCell(-1, from.col, true);
263
+ const target = this.hot.getCell(-1, from.col, true).querySelector(`.${BUTTON_CLASS_NAME}`);
264
264
  const rect = target.getBoundingClientRect();
265
265
  this.open({
266
266
  left: rect.left + offset.left,
267
267
  top: rect.top + target.offsetHeight + offset.top
268
268
  }, {
269
- left: rect.width
269
+ left: rect.width,
270
+ right: 0,
271
+ above: 0,
272
+ below: 3
270
273
  });
271
274
  // Make sure the first item is selected (role=menuitem). Otherwise, screen readers
272
275
  // will block the Esc key for the whole menu.
@@ -433,9 +436,12 @@ function _onTableClick(event) {
433
436
  _classPrivateFieldSet(_isButtonClicked, this, false);
434
437
  this.open({
435
438
  left: rect.left + offset.left,
436
- top: rect.top + event.target.offsetHeight + 3 + offset.top
439
+ top: rect.top + event.target.offsetHeight + offset.top
437
440
  }, {
438
- left: rect.width
441
+ left: rect.width,
442
+ right: 0,
443
+ above: 0,
444
+ below: 3
439
445
  });
440
446
  }
441
447
  }
@@ -256,13 +256,16 @@ export class DropdownMenu extends BasePlugin {
256
256
  from
257
257
  } = this.hot.getSelectedRangeLast();
258
258
  const offset = getDocumentOffsetByElement(this.menu.container, this.hot.rootDocument);
259
- const target = this.hot.getCell(-1, from.col, true);
259
+ const target = this.hot.getCell(-1, from.col, true).querySelector(`.${BUTTON_CLASS_NAME}`);
260
260
  const rect = target.getBoundingClientRect();
261
261
  this.open({
262
262
  left: rect.left + offset.left,
263
263
  top: rect.top + target.offsetHeight + offset.top
264
264
  }, {
265
- left: rect.width
265
+ left: rect.width,
266
+ right: 0,
267
+ above: 0,
268
+ below: 3
266
269
  });
267
270
  // Make sure the first item is selected (role=menuitem). Otherwise, screen readers
268
271
  // will block the Esc key for the whole menu.
@@ -428,9 +431,12 @@ function _onTableClick(event) {
428
431
  _classPrivateFieldSet(_isButtonClicked, this, false);
429
432
  this.open({
430
433
  left: rect.left + offset.left,
431
- top: rect.top + event.target.offsetHeight + 3 + offset.top
434
+ top: rect.top + event.target.offsetHeight + offset.top
432
435
  }, {
433
- left: rect.width
436
+ left: rect.width,
437
+ right: 0,
438
+ above: 0,
439
+ below: 3
434
440
  });
435
441
  }
436
442
  }
@@ -191,7 +191,12 @@ class ConditionComponent extends _base.BaseComponent {
191
191
  (0, _element.addClass)(label, 'htFiltersMenuLabel');
192
192
  label.textContent = value;
193
193
  wrapper.appendChild(label);
194
- (0, _array.arrayEach)(this.elements, ui => wrapper.appendChild(ui.element));
194
+
195
+ // The SelectUI should not extend the menu width (it should adjust to the menu item width only).
196
+ // That's why it's skipped from rendering when the GhostTable tries to render it.
197
+ if (!wrapper.parentElement.hasAttribute('ghost-table')) {
198
+ (0, _array.arrayEach)(this.elements, ui => wrapper.appendChild(ui.element));
199
+ }
195
200
  return wrapper;
196
201
  }
197
202
  };
@@ -186,7 +186,12 @@ export class ConditionComponent extends BaseComponent {
186
186
  addClass(label, 'htFiltersMenuLabel');
187
187
  label.textContent = value;
188
188
  wrapper.appendChild(label);
189
- arrayEach(this.elements, ui => wrapper.appendChild(ui.element));
189
+
190
+ // The SelectUI should not extend the menu width (it should adjust to the menu item width only).
191
+ // That's why it's skipped from rendering when the GhostTable tries to render it.
192
+ if (!wrapper.parentElement.hasAttribute('ghost-table')) {
193
+ arrayEach(this.elements, ui => wrapper.appendChild(ui.element));
194
+ }
190
195
  return wrapper;
191
196
  }
192
197
  };
@@ -177,7 +177,12 @@ class ValueComponent extends _base.BaseComponent {
177
177
  (0, _element.addClass)(label, 'htFiltersMenuLabel');
178
178
  label.textContent = value;
179
179
  wrapper.appendChild(label);
180
- (0, _array.arrayEach)(this.elements, ui => wrapper.appendChild(ui.element));
180
+
181
+ // The MultipleSelectUI should not extend the menu width (it should adjust to the menu item width only).
182
+ // That's why it's skipped from rendering when the GhostTable tries to render it.
183
+ if (!wrapper.parentElement.hasAttribute('ghost-table')) {
184
+ (0, _array.arrayEach)(this.elements, ui => wrapper.appendChild(ui.element));
185
+ }
181
186
  return wrapper;
182
187
  }
183
188
  };
@@ -172,7 +172,12 @@ export class ValueComponent extends BaseComponent {
172
172
  addClass(label, 'htFiltersMenuLabel');
173
173
  label.textContent = value;
174
174
  wrapper.appendChild(label);
175
- arrayEach(this.elements, ui => wrapper.appendChild(ui.element));
175
+
176
+ // The MultipleSelectUI should not extend the menu width (it should adjust to the menu item width only).
177
+ // That's why it's skipped from rendering when the GhostTable tries to render it.
178
+ if (!wrapper.parentElement.hasAttribute('ghost-table')) {
179
+ arrayEach(this.elements, ui => wrapper.appendChild(ui.element));
180
+ }
176
181
  return wrapper;
177
182
  }
178
183
  };
@@ -5,9 +5,10 @@ import {
5
5
  ColumnConditions,
6
6
  } from './filters';
7
7
 
8
- export type ConditionName = 'begins_with' | 'between' | 'by_value' | 'contains' | 'empty' | 'ends_with' |
9
- 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'not_between' | 'not_contains' |
10
- 'not_empty' | 'neq';
8
+ export type ConditionName = 'begins_with' | 'between' | 'by_value' | 'contains' |
9
+ 'date_after' | 'date_before' | 'date_today' | 'date_tomorrow' | 'date_yesterday' |
10
+ 'empty' | 'ends_with' | 'eq' | 'gt' | 'gte' | 'lt' | 'lte' |
11
+ 'not_between' | 'not_contains' | 'not_empty' | 'neq' | 'none';
11
12
 
12
13
  export interface Condition {
13
14
  name: ConditionName;
@@ -45,6 +45,13 @@ class ConditionCollection {
45
45
  * @type {LinkedPhysicalIndexToValueMap}
46
46
  */
47
47
  _defineProperty(this, "filteringStates", new _translations.LinkedPhysicalIndexToValueMap());
48
+ /**
49
+ * Stores the previous state of the condition stack before the latest filter operation.
50
+ * This is used in the `beforeFilter` plugin to allow performing the undo operation.
51
+ *
52
+ * @type {null|Array}
53
+ */
54
+ _defineProperty(this, "previousConditionStack", null);
48
55
  this.hot = hot;
49
56
  this.isMapRegistrable = isMapRegistrable;
50
57
  if (this.isMapRegistrable === true) {
@@ -113,6 +120,13 @@ class ConditionCollection {
113
120
  const localeForColumn = this.hot.getCellMeta(0, column).locale;
114
121
  const args = (0, _array.arrayMap)(conditionDefinition.args, v => typeof v === 'string' ? v.toLocaleLowerCase(localeForColumn) : v);
115
122
  const name = conditionDefinition.name || conditionDefinition.command.key;
123
+
124
+ // If there's no previous condition stack defined (which means the condition stack was not cleared after the
125
+ // previous filter operation or that there was no filter operation performed yet), store the current conditions as
126
+ // the previous condition stack.
127
+ if (this.previousConditionStack === null) {
128
+ this.setPreviousConditionStack(this.exportAllConditions());
129
+ }
116
130
  this.runLocalHooks('beforeAdd', column);
117
131
  const columnType = this.getOperation(column);
118
132
  if (columnType) {
@@ -241,6 +255,8 @@ class ConditionCollection {
241
255
  * @fires ConditionCollection#afterRemove
242
256
  */
243
257
  removeConditions(column) {
258
+ // Store the current conditions as the previous condition stack before it's cleared.
259
+ this.setPreviousConditionStack(this.exportAllConditions());
244
260
  this.runLocalHooks('beforeRemove', column);
245
261
  this.filteringStates.clearValue(column);
246
262
  this.runLocalHooks('afterRemove', column);
@@ -274,6 +290,16 @@ class ConditionCollection {
274
290
  return conditions.length > 0;
275
291
  }
276
292
 
293
+ /**
294
+ * Updates the `previousConditionStack` property with the provided stack.
295
+ * It is used to store the current conditions before they are modified, allowing for undo operations.
296
+ *
297
+ * @param {Array|null} previousConditionStack The stack of previous conditions.
298
+ */
299
+ setPreviousConditionStack(previousConditionStack) {
300
+ this.previousConditionStack = previousConditionStack;
301
+ }
302
+
277
303
  /**
278
304
  * Destroy object.
279
305
  */
@@ -41,6 +41,13 @@ class ConditionCollection {
41
41
  * @type {LinkedPhysicalIndexToValueMap}
42
42
  */
43
43
  _defineProperty(this, "filteringStates", new IndexToValueMap());
44
+ /**
45
+ * Stores the previous state of the condition stack before the latest filter operation.
46
+ * This is used in the `beforeFilter` plugin to allow performing the undo operation.
47
+ *
48
+ * @type {null|Array}
49
+ */
50
+ _defineProperty(this, "previousConditionStack", null);
44
51
  this.hot = hot;
45
52
  this.isMapRegistrable = isMapRegistrable;
46
53
  if (this.isMapRegistrable === true) {
@@ -109,6 +116,13 @@ class ConditionCollection {
109
116
  const localeForColumn = this.hot.getCellMeta(0, column).locale;
110
117
  const args = arrayMap(conditionDefinition.args, v => typeof v === 'string' ? v.toLocaleLowerCase(localeForColumn) : v);
111
118
  const name = conditionDefinition.name || conditionDefinition.command.key;
119
+
120
+ // If there's no previous condition stack defined (which means the condition stack was not cleared after the
121
+ // previous filter operation or that there was no filter operation performed yet), store the current conditions as
122
+ // the previous condition stack.
123
+ if (this.previousConditionStack === null) {
124
+ this.setPreviousConditionStack(this.exportAllConditions());
125
+ }
112
126
  this.runLocalHooks('beforeAdd', column);
113
127
  const columnType = this.getOperation(column);
114
128
  if (columnType) {
@@ -237,6 +251,8 @@ class ConditionCollection {
237
251
  * @fires ConditionCollection#afterRemove
238
252
  */
239
253
  removeConditions(column) {
254
+ // Store the current conditions as the previous condition stack before it's cleared.
255
+ this.setPreviousConditionStack(this.exportAllConditions());
240
256
  this.runLocalHooks('beforeRemove', column);
241
257
  this.filteringStates.clearValue(column);
242
258
  this.runLocalHooks('afterRemove', column);
@@ -270,6 +286,16 @@ class ConditionCollection {
270
286
  return conditions.length > 0;
271
287
  }
272
288
 
289
+ /**
290
+ * Updates the `previousConditionStack` property with the provided stack.
291
+ * It is used to store the current conditions before they are modified, allowing for undo operations.
292
+ *
293
+ * @param {Array|null} previousConditionStack The stack of previous conditions.
294
+ */
295
+ setPreviousConditionStack(previousConditionStack) {
296
+ this.previousConditionStack = previousConditionStack;
297
+ }
298
+
273
299
  /**
274
300
  * Destroy object.
275
301
  */
@@ -483,7 +483,7 @@ class Filters extends _base.BasePlugin {
483
483
  const needToFilter = !this.conditionCollection.isEmpty();
484
484
  let visibleVisualRows = [];
485
485
  const conditions = this.conditionCollection.exportAllConditions();
486
- const allowFiltering = this.hot.runHooks('beforeFilter', conditions);
486
+ const allowFiltering = this.hot.runHooks('beforeFilter', conditions, this.conditionCollection.previousConditionStack);
487
487
  if (allowFiltering !== false) {
488
488
  if (needToFilter) {
489
489
  const trimmedRows = [];
@@ -508,6 +508,7 @@ class Filters extends _base.BasePlugin {
508
508
  }
509
509
  }
510
510
  this.hot.runHooks('afterFilter', conditions);
511
+ this.conditionCollection.setPreviousConditionStack(null);
511
512
  this.hot.view.adjustElementsSize();
512
513
  this.hot.render();
513
514
  if (this.hot.selection.isSelected()) {
@@ -802,7 +803,9 @@ function _onAfterChange(changes) {
802
803
  }
803
804
  }
804
805
  function _onAfterDropdownMenuShow() {
806
+ const menu = this.dropdownMenuPlugin.menu;
805
807
  this.restoreComponents(Array.from(this.components.values()));
808
+ menu.updateMenuDimensions();
806
809
  }
807
810
  /**
808
811
  * After dropdown menu hide listener.
@@ -477,7 +477,7 @@ export class Filters extends BasePlugin {
477
477
  const needToFilter = !this.conditionCollection.isEmpty();
478
478
  let visibleVisualRows = [];
479
479
  const conditions = this.conditionCollection.exportAllConditions();
480
- const allowFiltering = this.hot.runHooks('beforeFilter', conditions);
480
+ const allowFiltering = this.hot.runHooks('beforeFilter', conditions, this.conditionCollection.previousConditionStack);
481
481
  if (allowFiltering !== false) {
482
482
  if (needToFilter) {
483
483
  const trimmedRows = [];
@@ -502,6 +502,7 @@ export class Filters extends BasePlugin {
502
502
  }
503
503
  }
504
504
  this.hot.runHooks('afterFilter', conditions);
505
+ this.conditionCollection.setPreviousConditionStack(null);
505
506
  this.hot.view.adjustElementsSize();
506
507
  this.hot.render();
507
508
  if (this.hot.selection.isSelected()) {
@@ -795,7 +796,9 @@ function _onAfterChange(changes) {
795
796
  }
796
797
  }
797
798
  function _onAfterDropdownMenuShow() {
799
+ const menu = this.dropdownMenuPlugin.menu;
798
800
  this.restoreComponents(Array.from(this.components.values()));
801
+ menu.updateMenuDimensions();
799
802
  }
800
803
  /**
801
804
  * After dropdown menu hide listener.
@@ -128,10 +128,9 @@ class MultipleSelectUI extends _base.BaseUI {
128
128
  * @param {Array} items Array of objects with `checked` and `label` property.
129
129
  */
130
130
  setItems(items) {
131
+ var _classPrivateFieldGet2;
131
132
  _classPrivateFieldSet(_items, this, items);
132
- if (_classPrivateFieldGet(_itemsBox, this)) {
133
- _classPrivateFieldGet(_itemsBox, this).loadData(_classPrivateFieldGet(_items, this));
134
- }
133
+ (_classPrivateFieldGet2 = _classPrivateFieldGet(_itemsBox, this)) === null || _classPrivateFieldGet2 === void 0 || _classPrivateFieldGet2.loadData(_classPrivateFieldGet(_items, this));
135
134
  }
136
135
 
137
136
  /**
@@ -223,13 +222,13 @@ class MultipleSelectUI extends _base.BaseUI {
223
222
  this._element.appendChild(selectionControl.element);
224
223
  this._element.appendChild(itemsBoxWrapper);
225
224
  const hotInitializer = wrapper => {
225
+ var _classPrivateFieldGet3;
226
226
  if (!this._element) {
227
227
  return;
228
228
  }
229
- if (_classPrivateFieldGet(_itemsBox, this)) {
230
- _classPrivateFieldGet(_itemsBox, this).destroy();
231
- }
229
+ (_classPrivateFieldGet3 = _classPrivateFieldGet(_itemsBox, this)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.destroy();
232
230
  (0, _element.addClass)(wrapper, 'htUIMultipleSelectHot');
231
+
233
232
  // Constructs and initializes a new Handsontable instance
234
233
  _classPrivateFieldSet(_itemsBox, this, new this.hot.constructor(wrapper, {
235
234
  data: _classPrivateFieldGet(_items, this),
@@ -323,9 +322,8 @@ class MultipleSelectUI extends _base.BaseUI {
323
322
  * Destroy instance.
324
323
  */
325
324
  destroy() {
326
- if (_classPrivateFieldGet(_itemsBox, this)) {
327
- _classPrivateFieldGet(_itemsBox, this).destroy();
328
- }
325
+ var _classPrivateFieldGet4;
326
+ (_classPrivateFieldGet4 = _classPrivateFieldGet(_itemsBox, this)) === null || _classPrivateFieldGet4 === void 0 || _classPrivateFieldGet4.destroy();
329
327
  _classPrivateFieldGet(_searchInput, this).destroy();
330
328
  _classPrivateFieldGet(_clearAllUI, this).destroy();
331
329
  _classPrivateFieldGet(_selectAllUI, this).destroy();
@@ -123,10 +123,9 @@ export class MultipleSelectUI extends BaseUI {
123
123
  * @param {Array} items Array of objects with `checked` and `label` property.
124
124
  */
125
125
  setItems(items) {
126
+ var _classPrivateFieldGet2;
126
127
  _classPrivateFieldSet(_items, this, items);
127
- if (_classPrivateFieldGet(_itemsBox, this)) {
128
- _classPrivateFieldGet(_itemsBox, this).loadData(_classPrivateFieldGet(_items, this));
129
- }
128
+ (_classPrivateFieldGet2 = _classPrivateFieldGet(_itemsBox, this)) === null || _classPrivateFieldGet2 === void 0 || _classPrivateFieldGet2.loadData(_classPrivateFieldGet(_items, this));
130
129
  }
131
130
 
132
131
  /**
@@ -218,13 +217,13 @@ export class MultipleSelectUI extends BaseUI {
218
217
  this._element.appendChild(selectionControl.element);
219
218
  this._element.appendChild(itemsBoxWrapper);
220
219
  const hotInitializer = wrapper => {
220
+ var _classPrivateFieldGet3;
221
221
  if (!this._element) {
222
222
  return;
223
223
  }
224
- if (_classPrivateFieldGet(_itemsBox, this)) {
225
- _classPrivateFieldGet(_itemsBox, this).destroy();
226
- }
224
+ (_classPrivateFieldGet3 = _classPrivateFieldGet(_itemsBox, this)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.destroy();
227
225
  addClass(wrapper, 'htUIMultipleSelectHot');
226
+
228
227
  // Constructs and initializes a new Handsontable instance
229
228
  _classPrivateFieldSet(_itemsBox, this, new this.hot.constructor(wrapper, {
230
229
  data: _classPrivateFieldGet(_items, this),
@@ -318,9 +317,8 @@ export class MultipleSelectUI extends BaseUI {
318
317
  * Destroy instance.
319
318
  */
320
319
  destroy() {
321
- if (_classPrivateFieldGet(_itemsBox, this)) {
322
- _classPrivateFieldGet(_itemsBox, this).destroy();
323
- }
320
+ var _classPrivateFieldGet4;
321
+ (_classPrivateFieldGet4 = _classPrivateFieldGet(_itemsBox, this)) === null || _classPrivateFieldGet4 === void 0 || _classPrivateFieldGet4.destroy();
324
322
  _classPrivateFieldGet(_searchInput, this).destroy();
325
323
  _classPrivateFieldGet(_clearAllUI, this).destroy();
326
324
  _classPrivateFieldGet(_selectAllUI, this).destroy();
@@ -8,13 +8,13 @@ exports.toEmptyString = toEmptyString;
8
8
  exports.toVisualValue = toVisualValue;
9
9
  exports.unifyColumnValues = unifyColumnValues;
10
10
  require("core-js/modules/es.array.push.js");
11
- require("core-js/modules/esnext.set.difference.v2.js");
12
- require("core-js/modules/esnext.set.intersection.v2.js");
13
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
14
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
15
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
16
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
17
- require("core-js/modules/esnext.set.union.v2.js");
11
+ require("core-js/modules/es.set.difference.v2.js");
12
+ require("core-js/modules/es.set.intersection.v2.js");
13
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
14
+ require("core-js/modules/es.set.is-subset-of.v2.js");
15
+ require("core-js/modules/es.set.is-superset-of.v2.js");
16
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
17
+ require("core-js/modules/es.set.union.v2.js");
18
18
  var _feature = require("../../helpers/feature");
19
19
  var _array = require("../../helpers/array");
20
20
  const sortCompare = (0, _feature.getComparisonFunction)();
@@ -1,11 +1,11 @@
1
1
  import "core-js/modules/es.array.push.js";
2
- import "core-js/modules/esnext.set.difference.v2.js";
3
- import "core-js/modules/esnext.set.intersection.v2.js";
4
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
5
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
6
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
7
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
8
- import "core-js/modules/esnext.set.union.v2.js";
2
+ import "core-js/modules/es.set.difference.v2.js";
3
+ import "core-js/modules/es.set.intersection.v2.js";
4
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
5
+ import "core-js/modules/es.set.is-subset-of.v2.js";
6
+ import "core-js/modules/es.set.is-superset-of.v2.js";
7
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
8
+ import "core-js/modules/es.set.union.v2.js";
9
9
  import { getComparisonFunction } from "../../helpers/feature.mjs";
10
10
  import { arrayUnique, arrayEach } from "../../helpers/array.mjs";
11
11
  const sortCompare = getComparisonFunction();
@@ -4,13 +4,13 @@ exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
5
  require("core-js/modules/es.array.push.js");
6
6
  require("core-js/modules/es.json.stringify.js");
7
- require("core-js/modules/esnext.set.difference.v2.js");
8
- require("core-js/modules/esnext.set.intersection.v2.js");
9
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
10
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
11
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
12
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
13
- require("core-js/modules/esnext.set.union.v2.js");
7
+ require("core-js/modules/es.set.difference.v2.js");
8
+ require("core-js/modules/es.set.intersection.v2.js");
9
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
10
+ require("core-js/modules/es.set.is-subset-of.v2.js");
11
+ require("core-js/modules/es.set.is-superset-of.v2.js");
12
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
13
+ require("core-js/modules/es.set.union.v2.js");
14
14
  var _base = require("../base");
15
15
  var _staticRegister = _interopRequireDefault(require("../../utils/staticRegister"));
16
16
  var _console = require("../../helpers/console");
@@ -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.json.stringify.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 _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; }
13
13
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
@@ -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 _element = require("../../helpers/dom/element");
15
15
  var _number = require("../../helpers/number");
@@ -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 _element = require("../../helpers/dom/element");
15
15
  var _number = require("../../helpers/number");
@@ -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"); }
@@ -4,13 +4,13 @@ exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
5
  require("core-js/modules/es.array.push.js");
6
6
  require("core-js/modules/es.array.unscopables.flat-map.js");
7
- require("core-js/modules/esnext.set.difference.v2.js");
8
- require("core-js/modules/esnext.set.intersection.v2.js");
9
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
10
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
11
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
12
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
13
- require("core-js/modules/esnext.set.union.v2.js");
7
+ require("core-js/modules/es.set.difference.v2.js");
8
+ require("core-js/modules/es.set.intersection.v2.js");
9
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
10
+ require("core-js/modules/es.set.is-subset-of.v2.js");
11
+ require("core-js/modules/es.set.is-superset-of.v2.js");
12
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
13
+ require("core-js/modules/es.set.union.v2.js");
14
14
  var _cellCoords = _interopRequireDefault(require("./cellCoords"));
15
15
  var _number = require("../../helpers/number");
16
16
  var _console = require("../../helpers/console");
@@ -424,18 +424,20 @@ class MergedCellsCollection {
424
424
  break;
425
425
  default:
426
426
  }
427
- (0, _array.arrayEach)(this.mergedCells, currentMerge => {
428
- _assertClassBrand(_MergedCellsCollection_brand, this, _removeMergedCellFromMatrix).call(this, currentMerge);
427
+ const removedMergedCells = [];
428
+ this.mergedCells.forEach(currentMerge => {
429
429
  currentMerge.shift(shiftVector, index);
430
- _assertClassBrand(_MergedCellsCollection_brand, this, _addMergedCellToMatrix).call(this, currentMerge);
431
- });
432
- (0, _number.rangeEachReverse)(this.mergedCells.length - 1, 0, i => {
433
- const currentMerge = this.mergedCells[i];
434
- if (currentMerge && currentMerge.removed) {
435
- this.mergedCells.splice(this.mergedCells.indexOf(currentMerge), 1);
436
- _assertClassBrand(_MergedCellsCollection_brand, this, _removeMergedCellFromMatrix).call(this, currentMerge);
430
+ if (currentMerge.removed) {
431
+ removedMergedCells.push(currentMerge);
437
432
  }
438
433
  });
434
+ removedMergedCells.forEach(removedMerge => {
435
+ this.mergedCells.splice(this.mergedCells.indexOf(removedMerge), 1);
436
+ });
437
+ this.mergedCellsMatrix.clear();
438
+ this.mergedCells.forEach(currentMerge => {
439
+ _assertClassBrand(_MergedCellsCollection_brand, this, _addMergedCellToMatrix).call(this, currentMerge);
440
+ });
439
441
  }
440
442
 
441
443
  /**