handsontable 0.0.0-next-71bce98-20241210 → 0.0.0-next-cd0001d-20241212

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

Files changed (37) hide show
  1. package/base.js +2 -2
  2. package/base.mjs +2 -2
  3. package/core.js +4 -6
  4. package/core.mjs +4 -6
  5. package/dist/handsontable.css +2 -2
  6. package/dist/handsontable.full.css +2 -2
  7. package/dist/handsontable.full.js +123 -112
  8. package/dist/handsontable.full.min.css +2 -2
  9. package/dist/handsontable.full.min.js +61 -61
  10. package/dist/handsontable.js +123 -112
  11. package/dist/handsontable.min.css +2 -2
  12. package/dist/handsontable.min.js +12 -12
  13. package/helpers/mixed.js +1 -1
  14. package/helpers/mixed.mjs +1 -1
  15. package/package.json +1 -1
  16. package/plugins/filters/conditionCollection.js +8 -7
  17. package/plugins/filters/conditionCollection.mjs +8 -7
  18. package/plugins/filters/utils.js +7 -24
  19. package/plugins/filters/utils.mjs +7 -24
  20. package/plugins/mergeCells/calculations/autofill.js +60 -44
  21. package/plugins/mergeCells/calculations/autofill.mjs +60 -44
  22. package/plugins/mergeCells/cellsCollection.js +25 -8
  23. package/plugins/mergeCells/cellsCollection.mjs +25 -8
  24. package/plugins/mergeCells/mergeCells.js +10 -14
  25. package/plugins/mergeCells/mergeCells.mjs +10 -14
  26. package/plugins/undoRedo/actions/filters.js +1 -3
  27. package/plugins/undoRedo/actions/filters.mjs +1 -3
  28. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +1 -0
  29. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +1 -0
  30. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +2 -1
  31. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +2 -1
  32. package/styles/handsontable.css +6 -2
  33. package/styles/handsontable.min.css +3 -3
  34. package/styles/ht-theme-horizon.css +2 -2
  35. package/styles/ht-theme-horizon.min.css +2 -2
  36. package/styles/ht-theme-main.css +2 -2
  37. package/styles/ht-theme-main.min.css +2 -2
package/base.js CHANGED
@@ -45,8 +45,8 @@ Handsontable.hooks = _hooks.Hooks.getSingleton();
45
45
  Handsontable.CellCoords = _src.CellCoords;
46
46
  Handsontable.CellRange = _src.CellRange;
47
47
  Handsontable.packageName = 'handsontable';
48
- Handsontable.buildDate = "10/12/2024 16:44:21";
49
- Handsontable.version = "0.0.0-next-71bce98-20241210";
48
+ Handsontable.buildDate = "12/12/2024 09:48:01";
49
+ Handsontable.version = "0.0.0-next-cd0001d-20241212";
50
50
  Handsontable.languages = {
51
51
  dictionaryKeys: _registry.dictionaryKeys,
52
52
  getLanguageDictionary: _registry.getLanguageDictionary,
package/base.mjs CHANGED
@@ -35,8 +35,8 @@ Handsontable.hooks = Hooks.getSingleton();
35
35
  Handsontable.CellCoords = CellCoords;
36
36
  Handsontable.CellRange = CellRange;
37
37
  Handsontable.packageName = 'handsontable';
38
- Handsontable.buildDate = "10/12/2024 16:44:26";
39
- Handsontable.version = "0.0.0-next-71bce98-20241210";
38
+ Handsontable.buildDate = "12/12/2024 09:48:07";
39
+ Handsontable.version = "0.0.0-next-cd0001d-20241212";
40
40
  Handsontable.languages = {
41
41
  dictionaryKeys,
42
42
  getLanguageDictionary,
package/core.js CHANGED
@@ -711,10 +711,11 @@ function Core(rootElement, userSettings) {
711
711
  default:
712
712
  throw new Error(`There is no such action "${action}"`);
713
713
  }
714
- instance.view.render();
715
714
  if (!keepEmptyRows) {
716
715
  grid.adjustRowsAndCols(); // makes sure that we did not add rows that will be removed in next refresh
717
716
  }
717
+ instance.view.render();
718
+ instance.view.adjustElementsSize();
718
719
  },
719
720
  /**
720
721
  * Makes sure there are empty rows at the bottom of the table.
@@ -763,7 +764,7 @@ function Core(rootElement, userSettings) {
763
764
 
764
765
  // should I add empty cols to meet minCols?
765
766
  if (minCols && !tableMeta.columns && nrOfColumns < minCols) {
766
- // The synchronization with cell meta is not desired here. For `minSpareRows` option,
767
+ // The synchronization with cell meta is not desired here. For `minCols` option,
767
768
  // we don't want to touch/shift cell meta objects.
768
769
  const colsToCreate = minCols - nrOfColumns;
769
770
  emptyCols += colsToCreate;
@@ -777,16 +778,13 @@ function Core(rootElement, userSettings) {
777
778
  const emptyColsMissing = minSpareCols - emptyCols;
778
779
  const colsToCreate = Math.min(emptyColsMissing, tableMeta.maxCols - nrOfColumns);
779
780
 
780
- // The synchronization with cell meta is not desired here. For `minSpareRows` option,
781
+ // The synchronization with cell meta is not desired here. For `minSpareCols` option,
781
782
  // we don't want to touch/shift cell meta objects.
782
783
  datamap.createCol(nrOfColumns, colsToCreate, {
783
784
  source: 'auto'
784
785
  });
785
786
  }
786
787
  }
787
- if (instance.view) {
788
- instance.view.adjustElementsSize();
789
- }
790
788
  },
791
789
  /**
792
790
  * Populate the data from the provided 2d array from the given cell coordinates.
package/core.mjs CHANGED
@@ -706,10 +706,11 @@ export default function Core(rootElement, userSettings) {
706
706
  default:
707
707
  throw new Error(`There is no such action "${action}"`);
708
708
  }
709
- instance.view.render();
710
709
  if (!keepEmptyRows) {
711
710
  grid.adjustRowsAndCols(); // makes sure that we did not add rows that will be removed in next refresh
712
711
  }
712
+ instance.view.render();
713
+ instance.view.adjustElementsSize();
713
714
  },
714
715
  /**
715
716
  * Makes sure there are empty rows at the bottom of the table.
@@ -758,7 +759,7 @@ export default function Core(rootElement, userSettings) {
758
759
 
759
760
  // should I add empty cols to meet minCols?
760
761
  if (minCols && !tableMeta.columns && nrOfColumns < minCols) {
761
- // The synchronization with cell meta is not desired here. For `minSpareRows` option,
762
+ // The synchronization with cell meta is not desired here. For `minCols` option,
762
763
  // we don't want to touch/shift cell meta objects.
763
764
  const colsToCreate = minCols - nrOfColumns;
764
765
  emptyCols += colsToCreate;
@@ -772,16 +773,13 @@ export default function Core(rootElement, userSettings) {
772
773
  const emptyColsMissing = minSpareCols - emptyCols;
773
774
  const colsToCreate = Math.min(emptyColsMissing, tableMeta.maxCols - nrOfColumns);
774
775
 
775
- // The synchronization with cell meta is not desired here. For `minSpareRows` option,
776
+ // The synchronization with cell meta is not desired here. For `minSpareCols` option,
776
777
  // we don't want to touch/shift cell meta objects.
777
778
  datamap.createCol(nrOfColumns, colsToCreate, {
778
779
  source: 'auto'
779
780
  });
780
781
  }
781
782
  }
782
- if (instance.view) {
783
- instance.view.adjustElementsSize();
784
- }
785
783
  },
786
784
  /**
787
785
  * Populate the data from the provided 2d array from the given cell coordinates.
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-71bce98-20241210
29
- * Release date: 17/10/2024 (built at 10/12/2024 16:44:47)
28
+ * Version: 0.0.0-next-cd0001d-20241212
29
+ * Release date: 17/10/2024 (built at 12/12/2024 09:48:31)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-71bce98-20241210
29
- * Release date: 17/10/2024 (built at 10/12/2024 16:44:47)
28
+ * Version: 0.0.0-next-cd0001d-20241212
29
+ * Release date: 17/10/2024 (built at 12/12/2024 09:48:31)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-71bce98-20241210
29
- * Release date: 17/10/2024 (built at 10/12/2024 16:44:31)
28
+ * Version: 0.0.0-next-cd0001d-20241212
29
+ * Release date: 17/10/2024 (built at 12/12/2024 09:48:12)
30
30
  */
31
31
  (function webpackUniversalModuleDefinition(root, factory) {
32
32
  if(typeof exports === 'object' && typeof module === 'object')
@@ -42676,8 +42676,8 @@ Handsontable.hooks = _hooks.Hooks.getSingleton();
42676
42676
  Handsontable.CellCoords = _src.CellCoords;
42677
42677
  Handsontable.CellRange = _src.CellRange;
42678
42678
  Handsontable.packageName = 'handsontable';
42679
- Handsontable.buildDate = "10/12/2024 16:44:31";
42680
- Handsontable.version = "0.0.0-next-71bce98-20241210";
42679
+ Handsontable.buildDate = "12/12/2024 09:48:12";
42680
+ Handsontable.version = "0.0.0-next-cd0001d-20241212";
42681
42681
  Handsontable.languages = {
42682
42682
  dictionaryKeys: _registry.dictionaryKeys,
42683
42683
  getLanguageDictionary: _registry.getLanguageDictionary,
@@ -43411,10 +43411,11 @@ function Core(rootElement, userSettings) {
43411
43411
  default:
43412
43412
  throw new Error(`There is no such action "${action}"`);
43413
43413
  }
43414
- instance.view.render();
43415
43414
  if (!keepEmptyRows) {
43416
43415
  grid.adjustRowsAndCols(); // makes sure that we did not add rows that will be removed in next refresh
43417
43416
  }
43417
+ instance.view.render();
43418
+ instance.view.adjustElementsSize();
43418
43419
  },
43419
43420
  /**
43420
43421
  * Makes sure there are empty rows at the bottom of the table.
@@ -43463,7 +43464,7 @@ function Core(rootElement, userSettings) {
43463
43464
 
43464
43465
  // should I add empty cols to meet minCols?
43465
43466
  if (minCols && !tableMeta.columns && nrOfColumns < minCols) {
43466
- // The synchronization with cell meta is not desired here. For `minSpareRows` option,
43467
+ // The synchronization with cell meta is not desired here. For `minCols` option,
43467
43468
  // we don't want to touch/shift cell meta objects.
43468
43469
  const colsToCreate = minCols - nrOfColumns;
43469
43470
  emptyCols += colsToCreate;
@@ -43477,16 +43478,13 @@ function Core(rootElement, userSettings) {
43477
43478
  const emptyColsMissing = minSpareCols - emptyCols;
43478
43479
  const colsToCreate = Math.min(emptyColsMissing, tableMeta.maxCols - nrOfColumns);
43479
43480
 
43480
- // The synchronization with cell meta is not desired here. For `minSpareRows` option,
43481
+ // The synchronization with cell meta is not desired here. For `minSpareCols` option,
43481
43482
  // we don't want to touch/shift cell meta objects.
43482
43483
  datamap.createCol(nrOfColumns, colsToCreate, {
43483
43484
  source: 'auto'
43484
43485
  });
43485
43486
  }
43486
43487
  }
43487
- if (instance.view) {
43488
- instance.view.adjustElementsSize();
43489
- }
43490
43488
  },
43491
43489
  /**
43492
43490
  * Populate the data from the provided 2d array from the given cell coordinates.
@@ -53964,7 +53962,7 @@ const domMessages = {
53964
53962
  function _injectProductInfo(key, element) {
53965
53963
  const hasValidType = !isEmpty(key);
53966
53964
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
53967
- const hotVersion = "0.0.0-next-71bce98-20241210";
53965
+ const hotVersion = "0.0.0-next-cd0001d-20241212";
53968
53966
  let keyValidityDate;
53969
53967
  let consoleMessageState = 'invalid';
53970
53968
  let domMessageState = 'invalid';
@@ -98616,6 +98614,7 @@ const command = exports.command = {
98616
98614
  row
98617
98615
  } = hot.getSelectedRangeLast().highlight;
98618
98616
  let rowsStep = hot.countVisibleRows() + columnHeadersCount;
98617
+ rowsStep = rowsStep === 0 ? 1 : rowsStep;
98619
98618
 
98620
98619
  // if the last row is currently selected move the focus to the first row (if autoWrap is enabled)
98621
98620
  if (row === hot.countRows() - 1) {
@@ -98927,7 +98926,8 @@ const command = exports.command = {
98927
98926
  const {
98928
98927
  row
98929
98928
  } = hot.getSelectedRangeLast().highlight;
98930
- let rowsStep = -(hot.countVisibleRows() + columnHeadersCount);
98929
+ let rowsStep = hot.countVisibleRows() + columnHeadersCount;
98930
+ rowsStep = rowsStep === 0 ? -1 : -rowsStep;
98931
98931
 
98932
98932
  // if the first row is currently selected move the focus to the last row (if autoWrap is enabled)
98933
98933
  if (row === -columnHeadersCount) {
@@ -129198,8 +129198,10 @@ __webpack_require__(303);
129198
129198
  __webpack_require__(305);
129199
129199
  __webpack_require__(307);
129200
129200
  __webpack_require__(309);
129201
+ __webpack_require__(311);
129202
+ __webpack_require__(329);
129203
+ __webpack_require__(338);
129201
129204
  var _feature = __webpack_require__(502);
129202
- var _array = __webpack_require__(495);
129203
129205
  const sortCompare = (0, _feature.getComparisonFunction)();
129204
129206
 
129205
129207
  /**
@@ -129230,8 +129232,6 @@ function toVisualValue(value, defaultEmptyValue) {
129230
129232
  }
129231
129233
  return visualValue;
129232
129234
  }
129233
- const SUPPORT_SET_CONSTRUCTOR = new Set([1]).has(1);
129234
- const SUPPORT_FAST_DEDUPE = SUPPORT_SET_CONSTRUCTOR && typeof Array.from === 'function';
129235
129235
 
129236
129236
  /**
129237
129237
  * Create an array assertion to compare if an element exists in that array (in a more efficient way than .indexOf).
@@ -129240,19 +129240,9 @@ const SUPPORT_FAST_DEDUPE = SUPPORT_SET_CONSTRUCTOR && typeof Array.from === 'fu
129240
129240
  * @returns {Function}
129241
129241
  */
129242
129242
  function createArrayAssertion(initialData) {
129243
- let dataset = initialData;
129244
- if (SUPPORT_SET_CONSTRUCTOR) {
129245
- dataset = new Set(dataset);
129246
- }
129243
+ const dataset = new Set(initialData);
129247
129244
  return function (value) {
129248
- let result;
129249
- if (SUPPORT_SET_CONSTRUCTOR) {
129250
- result = dataset.has(value);
129251
- } else {
129252
- /* eslint-disable no-bitwise */
129253
- result = !!~dataset.indexOf(value);
129254
- }
129255
- return result;
129245
+ return dataset.has(value);
129256
129246
  };
129257
129247
  }
129258
129248
 
@@ -129273,13 +129263,7 @@ function toEmptyString(value) {
129273
129263
  * @returns {Array}
129274
129264
  */
129275
129265
  function unifyColumnValues(values) {
129276
- let unifiedValues = values;
129277
- if (SUPPORT_FAST_DEDUPE) {
129278
- unifiedValues = Array.from(new Set(unifiedValues));
129279
- } else {
129280
- unifiedValues = (0, _array.arrayUnique)(unifiedValues);
129281
- }
129282
- unifiedValues = unifiedValues.sort((a, b) => {
129266
+ return Array.from(new Set(values)).map(value => toEmptyString(value)).sort((a, b) => {
129283
129267
  if (typeof a === 'number' && typeof b === 'number') {
129284
129268
  return a - b;
129285
129269
  }
@@ -129288,7 +129272,6 @@ function unifyColumnValues(values) {
129288
129272
  }
129289
129273
  return a > b ? 1 : -1;
129290
129274
  });
129291
- return unifiedValues;
129292
129275
  }
129293
129276
 
129294
129277
  /**
@@ -129307,7 +129290,7 @@ function intersectValues(base, selected, defaultEmptyValue, callback) {
129307
129290
  if (!same) {
129308
129291
  selectedItemsAssertion = createArrayAssertion(selected);
129309
129292
  }
129310
- (0, _array.arrayEach)(base, value => {
129293
+ base.forEach(value => {
129311
129294
  let checked = false;
129312
129295
  if (same || selectedItemsAssertion(value)) {
129313
129296
  checked = true;
@@ -131296,10 +131279,11 @@ exports.__esModule = true;
131296
131279
  __webpack_require__(201);
131297
131280
  __webpack_require__(283);
131298
131281
  __webpack_require__(311);
131282
+ __webpack_require__(329);
131299
131283
  __webpack_require__(338);
131284
+ __webpack_require__(530);
131300
131285
  __webpack_require__(623);
131301
131286
  var _defineProperty2 = _interopRequireDefault(__webpack_require__(504));
131302
- var _array = __webpack_require__(495);
131303
131287
  var _object = __webpack_require__(499);
131304
131288
  var _templateLiteralTag = __webpack_require__(494);
131305
131289
  var _localHooks = _interopRequireDefault(__webpack_require__(599));
@@ -131410,7 +131394,7 @@ class ConditionCollection {
131410
131394
  let operation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _conjunction.OPERATION_ID;
131411
131395
  let position = arguments.length > 3 ? arguments[3] : undefined;
131412
131396
  const localeForColumn = this.hot.getCellMeta(0, column).locale;
131413
- const args = (0, _array.arrayMap)(conditionDefinition.args, v => typeof v === 'string' ? v.toLocaleLowerCase(localeForColumn) : v);
131397
+ const args = conditionDefinition.args.map(v => typeof v === 'string' ? v.toLocaleLowerCase(localeForColumn) : v);
131414
131398
  const name = conditionDefinition.name || conditionDefinition.command.key;
131415
131399
 
131416
131400
  // If there's no previous condition stack defined (which means the condition stack was not cleared after the
@@ -131504,7 +131488,7 @@ class ConditionCollection {
131504
131488
  * @returns {Array}
131505
131489
  */
131506
131490
  exportAllConditions() {
131507
- return (0, _array.arrayReduce)(this.filteringStates.getEntries(), (allConditions, _ref2) => {
131491
+ return this.filteringStates.getEntries().reduce((allConditions, _ref2) => {
131508
131492
  let [column, {
131509
131493
  operation,
131510
131494
  conditions
@@ -131512,14 +131496,14 @@ class ConditionCollection {
131512
131496
  allConditions.push({
131513
131497
  column,
131514
131498
  operation,
131515
- conditions: (0, _array.arrayMap)(conditions, _ref3 => {
131499
+ conditions: conditions.map(_ref3 => {
131516
131500
  let {
131517
131501
  name,
131518
131502
  args
131519
131503
  } = _ref3;
131520
131504
  return {
131521
131505
  name,
131522
- args
131506
+ args: [...args]
131523
131507
  };
131524
131508
  })
131525
131509
  });
@@ -131534,8 +131518,8 @@ class ConditionCollection {
131534
131518
  */
131535
131519
  importAllConditions(conditions) {
131536
131520
  this.clean();
131537
- (0, _array.arrayEach)(conditions, stack => {
131538
- (0, _array.arrayEach)(stack.conditions, condition => this.addCondition(stack.column, condition));
131521
+ conditions.forEach(stack => {
131522
+ stack.conditions.forEach(condition => this.addCondition(stack.column, condition));
131539
131523
  });
131540
131524
  }
131541
131525
 
@@ -140160,8 +140144,8 @@ class MergeCells extends _base.BasePlugin {
140160
140144
  /**
140161
140145
  * The `modifyAutofillRange` hook callback.
140162
140146
  *
140163
- * @param {Array} drag The drag area coordinates.
140164
- * @param {Array} select The selection information.
140147
+ * @param {Array} fullArea The drag + base area coordinates.
140148
+ * @param {Array} baseArea The selection information.
140165
140149
  * @returns {Array} The new drag area.
140166
140150
  */
140167
140151
  }
@@ -140545,23 +140529,19 @@ function _onAfterViewportColumnCalculatorOverride(calc) {
140545
140529
  this.modifyViewportColumnStart(calc, nrOfRows);
140546
140530
  this.modifyViewportColumnEnd(calc, nrOfRows);
140547
140531
  }
140548
- function _onModifyAutofillRange(drag, select) {
140549
- this.autofillCalculations.correctSelectionAreaSize(select);
140550
- const dragDirection = this.autofillCalculations.getDirection(select, drag);
140551
- let dragArea = drag;
140552
- if (this.autofillCalculations.dragAreaOverlapsCollections(select, dragArea, dragDirection)) {
140553
- dragArea = select;
140554
- return dragArea;
140532
+ function _onModifyAutofillRange(fullArea, baseArea) {
140533
+ const dragDirection = this.autofillCalculations.getDirection(baseArea, fullArea);
140534
+ if (this.autofillCalculations.dragAreaOverlapsCollections(baseArea, fullArea, dragDirection)) {
140535
+ return baseArea;
140555
140536
  }
140556
- const from = this.hot._createCellCoords(select[0], select[1]);
140557
- const to = this.hot._createCellCoords(select[2], select[3]);
140537
+ const from = this.hot._createCellCoords(baseArea[0], baseArea[1]);
140538
+ const to = this.hot._createCellCoords(baseArea[2], baseArea[3]);
140558
140539
  const range = this.hot._createCellRange(from, from, to);
140559
140540
  const mergedCellsWithinSelectionArea = this.mergedCellsCollection.getWithinRange(range);
140560
140541
  if (mergedCellsWithinSelectionArea.length === 0) {
140561
- return dragArea;
140542
+ return fullArea;
140562
140543
  }
140563
- dragArea = this.autofillCalculations.snapDragArea(select, dragArea, dragDirection, mergedCellsWithinSelectionArea);
140564
- return dragArea;
140544
+ return this.autofillCalculations.snapDragArea(baseArea, fullArea, dragDirection, mergedCellsWithinSelectionArea);
140565
140545
  }
140566
140546
  /**
140567
140547
  * `afterCreateCol` hook callback.
@@ -140873,18 +140853,33 @@ class MergedCellsCollection {
140873
140853
  /**
140874
140854
  * Get the first-found merged cell containing the provided range.
140875
140855
  *
140876
- * @param {CellRange|object} range The range to search merged cells for.
140877
- * @returns {MergedCellCoords|boolean}
140856
+ * @param {CellRange} range The range to search merged cells for.
140857
+ * @returns {MergedCellCoords | false}
140878
140858
  */
140879
140859
  getByRange(range) {
140860
+ const {
140861
+ row: rowStart,
140862
+ col: columnStart
140863
+ } = range.getTopStartCorner();
140864
+ const {
140865
+ row: rowEnd,
140866
+ col: columnEnd
140867
+ } = range.getBottomEndCorner();
140868
+ const mergedCellsLength = this.mergedCells.length;
140880
140869
  let result = false;
140881
- (0, _array.arrayEach)(this.mergedCells, mergedCell => {
140882
- if (mergedCell.row <= range.from.row && mergedCell.row + mergedCell.rowspan - 1 >= range.to.row && mergedCell.col <= range.from.col && mergedCell.col + mergedCell.colspan - 1 >= range.to.col) {
140870
+ for (let i = 0; i < mergedCellsLength; i++) {
140871
+ const mergedCell = this.mergedCells[i];
140872
+ const {
140873
+ row,
140874
+ col,
140875
+ rowspan,
140876
+ colspan
140877
+ } = mergedCell;
140878
+ if (row >= rowStart && row + rowspan - 1 <= rowEnd && col >= columnStart && col + colspan - 1 <= columnEnd) {
140883
140879
  result = mergedCell;
140884
- return result;
140880
+ break;
140885
140881
  }
140886
- return true;
140887
- });
140882
+ }
140888
140883
  return result;
140889
140884
  }
140890
140885
 
@@ -140994,7 +140989,9 @@ class MergedCellsCollection {
140994
140989
  _assertClassBrand(_MergedCellsCollection_brand, this, _addMergedCellToMatrix).call(this, newMergedCell);
140995
140990
  return newMergedCell;
140996
140991
  }
140997
- (0, _console.warn)(MergedCellsCollection.IS_OVERLAPPING_WARNING(newMergedCell));
140992
+ if (isOverlapping) {
140993
+ (0, _console.warn)(MergedCellsCollection.IS_OVERLAPPING_WARNING(newMergedCell));
140994
+ }
140998
140995
  return false;
140999
140996
  }
141000
140997
 
@@ -141758,6 +141755,8 @@ var _default = exports["default"] = MergedCellCoords;
141758
141755
 
141759
141756
  var _interopRequireDefault = __webpack_require__(197);
141760
141757
  exports.__esModule = true;
141758
+ __webpack_require__(311);
141759
+ __webpack_require__(619);
141761
141760
  var _defineProperty2 = _interopRequireDefault(__webpack_require__(504));
141762
141761
  var _object = __webpack_require__(499);
141763
141762
  var _array = __webpack_require__(495);
@@ -141792,35 +141791,20 @@ class AutofillCalculations {
141792
141791
  this.mergedCellsCollection = this.plugin.mergedCellsCollection;
141793
141792
  }
141794
141793
 
141795
- /**
141796
- * Correct the provided selection area, so it's not selecting only a part of a merged cell.
141797
- *
141798
- * @param {Array} selectionArea The selection to correct.
141799
- */
141800
- correctSelectionAreaSize(selectionArea) {
141801
- if (selectionArea[0] === selectionArea[2] && selectionArea[1] === selectionArea[3]) {
141802
- const mergedCell = this.mergedCellsCollection.get(selectionArea[0], selectionArea[1]);
141803
- if (mergedCell) {
141804
- selectionArea[2] = selectionArea[0] + mergedCell.rowspan - 1;
141805
- selectionArea[3] = selectionArea[1] + mergedCell.colspan - 1;
141806
- }
141807
- }
141808
- }
141809
-
141810
141794
  /**
141811
141795
  * Get the direction of the autofill process.
141812
141796
  *
141813
- * @param {Array} selectionArea The selection area.
141814
- * @param {Array} finalArea The final area (base + drag).
141797
+ * @param {Array} baseArea The selection area.
141798
+ * @param {Array} fullArea The final area (base + drag).
141815
141799
  * @returns {string} `up`, `down`, `left` or `right`.
141816
141800
  */
141817
- getDirection(selectionArea, finalArea) {
141801
+ getDirection(baseArea, fullArea) {
141818
141802
  let direction = null;
141819
- if (finalArea[0] === selectionArea[0] && finalArea[1] === selectionArea[1] && finalArea[3] === selectionArea[3]) {
141803
+ if (fullArea[0] === baseArea[0] && fullArea[1] === baseArea[1] && fullArea[3] === baseArea[3]) {
141820
141804
  direction = 'down';
141821
- } else if (finalArea[2] === selectionArea[2] && finalArea[1] === selectionArea[1] && finalArea[3] === selectionArea[3]) {
141805
+ } else if (fullArea[2] === baseArea[2] && fullArea[1] === baseArea[1] && fullArea[3] === baseArea[3]) {
141822
141806
  direction = 'up';
141823
- } else if (finalArea[1] === selectionArea[1] && finalArea[2] === selectionArea[2]) {
141807
+ } else if (fullArea[1] === baseArea[1] && fullArea[2] === baseArea[2]) {
141824
141808
  direction = 'right';
141825
141809
  } else {
141826
141810
  direction = 'left';
@@ -141832,20 +141816,20 @@ class AutofillCalculations {
141832
141816
  * Snap the drag area to the farthest merged cell, so it won't clip any of the merged cells.
141833
141817
  *
141834
141818
  * @param {Array} baseArea The base selected area.
141835
- * @param {Array} dragArea The drag area.
141819
+ * @param {Array} fullArea The drag area.
141836
141820
  * @param {string} dragDirection The autofill drag direction.
141837
141821
  * @param {Array} foundMergedCells MergeCellCoords found in the base selection area.
141838
141822
  * @returns {Array} The new drag area.
141839
141823
  */
141840
- snapDragArea(baseArea, dragArea, dragDirection, foundMergedCells) {
141841
- const newDragArea = dragArea.slice(0);
141842
- const fillSize = this.getAutofillSize(baseArea, dragArea, dragDirection);
141824
+ snapDragArea(baseArea, fullArea, dragDirection, foundMergedCells) {
141825
+ const newDragArea = fullArea.slice(0);
141826
+ const fillSize = this.getAutofillSize(baseArea, fullArea, dragDirection);
141843
141827
  const [baseAreaStartRow, baseAreaStartColumn, baseAreaEndRow, baseAreaEndColumn] = baseArea;
141844
141828
  const verticalDirection = ['up', 'down'].indexOf(dragDirection) > -1;
141845
141829
  const fullCycle = verticalDirection ? baseAreaEndRow - baseAreaStartRow + 1 : baseAreaEndColumn - baseAreaStartColumn + 1;
141846
141830
  const fulls = Math.floor(fillSize / fullCycle) * fullCycle;
141847
141831
  const partials = fillSize - fulls;
141848
- const farthestCollection = this.getFarthestCollection(baseArea, dragArea, dragDirection, foundMergedCells);
141832
+ const farthestCollection = this.getFarthestCollection(baseArea, fullArea, dragDirection, foundMergedCells);
141849
141833
  if (farthestCollection) {
141850
141834
  if (dragDirection === 'down') {
141851
141835
  const fill = farthestCollection.row + farthestCollection.rowspan - baseAreaStartRow - partials;
@@ -141910,13 +141894,13 @@ class AutofillCalculations {
141910
141894
  *
141911
141895
  * @private
141912
141896
  * @param {Array} baseArea The base selection area.
141913
- * @param {Array} dragArea The drag area (containing the base area).
141897
+ * @param {Array} fullArea The drag area (containing the base area).
141914
141898
  * @param {string} direction The drag direction.
141915
141899
  * @returns {number|null} The "length" (height or width, depending on the direction) of the drag.
141916
141900
  */
141917
- getAutofillSize(baseArea, dragArea, direction) {
141901
+ getAutofillSize(baseArea, fullArea, direction) {
141918
141902
  const [baseAreaStartRow, baseAreaStartColumn, baseAreaEndRow, baseAreaEndColumn] = baseArea;
141919
- const [dragAreaStartRow, dragAreaStartColumn, dragAreaEndRow, dragAreaEndColumn] = dragArea;
141903
+ const [dragAreaStartRow, dragAreaStartColumn, dragAreaEndRow, dragAreaEndColumn] = fullArea;
141920
141904
  switch (direction) {
141921
141905
  case 'up':
141922
141906
  return baseAreaStartRow - dragAreaStartRow;
@@ -141936,22 +141920,30 @@ class AutofillCalculations {
141936
141920
  *
141937
141921
  * @private
141938
141922
  * @param {Array} baseArea The base selection area.
141939
- * @param {Array} dragArea The base selection area extended by the drag area.
141923
+ * @param {Array} fullArea The base selection area extended by the drag area.
141940
141924
  * @param {string} direction Drag direction.
141941
141925
  * @returns {Array|null} Array representing the drag area coordinates.
141942
141926
  */
141943
- getDragArea(baseArea, dragArea, direction) {
141927
+ getDragArea(baseArea, fullArea, direction) {
141944
141928
  const [baseAreaStartRow, baseAreaStartColumn, baseAreaEndRow, baseAreaEndColumn] = baseArea;
141945
- const [dragAreaStartRow, dragAreaStartColumn, dragAreaEndRow, dragAreaEndColumn] = dragArea;
141929
+ const [fullAreaStartRow, fullAreaStartColumn, fullAreaEndRow, fullAreaEndColumn] = fullArea;
141946
141930
  switch (direction) {
141947
141931
  case 'up':
141948
- return [dragAreaStartRow, dragAreaStartColumn, baseAreaStartRow - 1, baseAreaEndColumn];
141932
+ return [fullAreaStartRow, fullAreaStartColumn, baseAreaStartRow - 1, baseAreaEndColumn];
141949
141933
  case 'down':
141950
- return [baseAreaEndRow + 1, baseAreaStartColumn, dragAreaEndRow, baseAreaEndColumn];
141934
+ {
141935
+ const mergedCell = this.mergedCellsCollection.get(fullAreaEndRow, baseAreaEndColumn);
141936
+ const rowShift = mergedCell ? mergedCell.rowspan - 1 : 0;
141937
+ return [baseAreaEndRow + 1, baseAreaStartColumn, fullAreaEndRow + rowShift, baseAreaEndColumn];
141938
+ }
141951
141939
  case 'left':
141952
- return [dragAreaStartRow, dragAreaStartColumn, baseAreaEndRow, baseAreaStartColumn - 1];
141940
+ return [fullAreaStartRow, fullAreaStartColumn, baseAreaEndRow, baseAreaStartColumn - 1];
141953
141941
  case 'right':
141954
- return [baseAreaStartRow, baseAreaEndColumn + 1, dragAreaEndRow, dragAreaEndColumn];
141942
+ {
141943
+ const mergedCell = this.mergedCellsCollection.get(fullAreaEndRow, baseAreaEndColumn);
141944
+ const columnShift = mergedCell ? mergedCell.colspan - 1 : 0;
141945
+ return [baseAreaStartRow, baseAreaEndColumn + columnShift, fullAreaEndRow, fullAreaEndColumn];
141946
+ }
141955
141947
  default:
141956
141948
  return null;
141957
141949
  }
@@ -141962,17 +141954,17 @@ class AutofillCalculations {
141962
141954
  *
141963
141955
  * @private
141964
141956
  * @param {Array} baseArea The base selection area.
141965
- * @param {Array} dragArea The drag area (containing the base area).
141957
+ * @param {Array} fullArea The drag area (containing the base area).
141966
141958
  * @param {string} direction The drag direction.
141967
141959
  * @param {Array} mergedCellArray Array of the merged cells found in the base area.
141968
141960
  * @returns {MergedCellCoords|null}
141969
141961
  */
141970
- getFarthestCollection(baseArea, dragArea, direction, mergedCellArray) {
141962
+ getFarthestCollection(baseArea, fullArea, direction, mergedCellArray) {
141971
141963
  const [baseAreaStartRow, baseAreaStartColumn, baseAreaEndRow, baseAreaEndColumn] = baseArea;
141972
141964
  const verticalDirection = ['up', 'down'].indexOf(direction) > -1;
141973
141965
  const baseEnd = verticalDirection ? baseAreaEndRow : baseAreaEndColumn;
141974
141966
  const baseStart = verticalDirection ? baseAreaStartRow : baseAreaStartColumn;
141975
- const fillSize = this.getAutofillSize(baseArea, dragArea, direction);
141967
+ const fillSize = this.getAutofillSize(baseArea, fullArea, direction);
141976
141968
  const fullCycle = verticalDirection ? baseAreaEndRow - baseAreaStartRow + 1 : baseAreaEndColumn - baseAreaStartColumn + 1;
141977
141969
  const fulls = Math.floor(fillSize / fullCycle) * fullCycle;
141978
141970
  const partials = fillSize - fulls;
@@ -142047,7 +142039,7 @@ class AutofillCalculations {
142047
142039
  rowspan: current.rowspan,
142048
142040
  col: current.col,
142049
142041
  colspan: current.colspan
142050
- });
142042
+ }, true);
142051
142043
  break;
142052
142044
  case 'down':
142053
142045
  this.plugin.mergedCellsCollection.add({
@@ -142055,7 +142047,7 @@ class AutofillCalculations {
142055
142047
  rowspan: current.rowspan,
142056
142048
  col: current.col,
142057
142049
  colspan: current.colspan
142058
- });
142050
+ }, true);
142059
142051
  break;
142060
142052
  case 'left':
142061
142053
  this.plugin.mergedCellsCollection.add({
@@ -142063,7 +142055,7 @@ class AutofillCalculations {
142063
142055
  rowspan: current.rowspan,
142064
142056
  col: current.col - fillOffset,
142065
142057
  colspan: current.colspan
142066
- });
142058
+ }, true);
142067
142059
  break;
142068
142060
  case 'right':
142069
142061
  this.plugin.mergedCellsCollection.add({
@@ -142071,7 +142063,7 @@ class AutofillCalculations {
142071
142063
  rowspan: current.rowspan,
142072
142064
  col: current.col + fillOffset,
142073
142065
  colspan: current.colspan
142074
- });
142066
+ }, true);
142075
142067
  break;
142076
142068
  default:
142077
142069
  }
@@ -142146,7 +142138,28 @@ class AutofillCalculations {
142146
142138
  const topLeft = this.plugin.hot._createCellCoords(dragAreaStartRow, dragAreaStartColumn);
142147
142139
  const bottomRight = this.plugin.hot._createCellCoords(dragAreaEndRow, dragAreaEndColumn);
142148
142140
  const dragRange = this.plugin.hot._createCellRange(topLeft, topLeft, bottomRight);
142149
- return this.mergedCellsCollection.getWithinRange(dragRange, true).length > 0;
142141
+ const mergedCellsWithPartials = this.mergedCellsCollection.getWithinRange(dragRange, true);
142142
+ if (mergedCellsWithPartials.length === 0) {
142143
+ return false;
142144
+ }
142145
+ const mergedCellsWithoutPartials = this.mergedCellsCollection.getWithinRange(dragRange, false);
142146
+ if (mergedCellsWithoutPartials.length === 0) {
142147
+ return true;
142148
+ }
142149
+ if (direction === 'up' || direction === 'down') {
142150
+ return !mergedCellsWithoutPartials.every(_ref => {
142151
+ let {
142152
+ colspan
142153
+ } = _ref;
142154
+ return colspan === dragRange.getWidth();
142155
+ });
142156
+ }
142157
+ return !mergedCellsWithoutPartials.every(_ref2 => {
142158
+ let {
142159
+ rowspan
142160
+ } = _ref2;
142161
+ return rowspan === dragRange.getHeight();
142162
+ });
142150
142163
  }
142151
142164
  }
142152
142165
  var _default = exports["default"] = AutofillCalculations;
@@ -152063,9 +152076,7 @@ class FiltersAction extends _base.BaseAction {
152063
152076
  undo(hot, undoneCallback) {
152064
152077
  const filters = hot.getPlugin('filters');
152065
152078
  hot.addHookOnce('afterViewRender', undoneCallback);
152066
- if (this.previousConditionsStack) {
152067
- filters.conditionCollection.importAllConditions(this.previousConditionsStack);
152068
- }
152079
+ filters.conditionCollection.importAllConditions(this.previousConditionsStack);
152069
152080
  filters.filter();
152070
152081
  }
152071
152082