handsontable 12.1.1 → 12.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/3rdparty/walkontable/src/border.js +43 -28
  2. package/3rdparty/walkontable/src/border.mjs +43 -28
  3. package/3rdparty/walkontable/src/table.js +13 -10
  4. package/3rdparty/walkontable/src/table.mjs +13 -10
  5. package/CHANGELOG.md +31 -0
  6. package/base.js +2 -2
  7. package/base.mjs +2 -2
  8. package/core.d.ts +1 -3
  9. package/core.js +9 -1
  10. package/core.mjs +9 -1
  11. package/dataMap/dataMap.js +35 -16
  12. package/dataMap/dataMap.mjs +30 -13
  13. package/dataMap/metaManager/lazyFactoryMap.js +24 -5
  14. package/dataMap/metaManager/lazyFactoryMap.mjs +19 -4
  15. package/dataMap/metaManager/metaSchema.js +112 -80
  16. package/dataMap/metaManager/metaSchema.mjs +112 -80
  17. package/dist/handsontable.css +2 -2
  18. package/dist/handsontable.full.css +2 -2
  19. package/dist/handsontable.full.js +35200 -52208
  20. package/dist/handsontable.full.min.css +2 -2
  21. package/dist/handsontable.full.min.js +527 -284
  22. package/dist/handsontable.js +3046 -3279
  23. package/dist/handsontable.min.css +2 -2
  24. package/dist/handsontable.min.js +3 -3
  25. package/editorManager.js +69 -35
  26. package/editorManager.mjs +69 -35
  27. package/editors/baseEditor/baseEditor.js +1 -1
  28. package/editors/baseEditor/baseEditor.mjs +1 -1
  29. package/editors/dateEditor/dateEditor.js +17 -2
  30. package/editors/dateEditor/dateEditor.mjs +16 -0
  31. package/editors/textEditor/caretPositioner.js +0 -4
  32. package/editors/textEditor/caretPositioner.mjs +0 -2
  33. package/helpers/dom/element.js +2 -4
  34. package/helpers/dom/element.mjs +1 -2
  35. package/helpers/mixed.js +2 -4
  36. package/helpers/mixed.mjs +2 -3
  37. package/helpers/object.js +0 -4
  38. package/helpers/object.mjs +0 -2
  39. package/helpers/unicode.js +0 -4
  40. package/helpers/unicode.mjs +0 -2
  41. package/package.json +2 -2
  42. package/pluginHooks.d.ts +0 -1
  43. package/pluginHooks.js +17 -14
  44. package/pluginHooks.mjs +17 -14
  45. package/plugins/base/base.js +2 -4
  46. package/plugins/base/base.mjs +1 -2
  47. package/plugins/columnSorting/sortService/engine.js +2 -6
  48. package/plugins/columnSorting/sortService/engine.mjs +2 -2
  49. package/plugins/columnSummary/columnSummary.js +17 -11
  50. package/plugins/columnSummary/columnSummary.mjs +15 -9
  51. package/plugins/columnSummary/utils.js +14 -0
  52. package/plugins/columnSummary/utils.mjs +9 -0
  53. package/plugins/contextMenu/commandExecutor.js +0 -4
  54. package/plugins/contextMenu/commandExecutor.mjs +0 -2
  55. package/plugins/contextMenu/contextMenu.js +5 -1
  56. package/plugins/contextMenu/contextMenu.mjs +5 -1
  57. package/plugins/contextMenu/menu.js +4 -0
  58. package/plugins/contextMenu/menu.mjs +4 -0
  59. package/plugins/copyPaste/copyPaste.js +2 -0
  60. package/plugins/copyPaste/copyPaste.mjs +2 -0
  61. package/plugins/dropdownMenu/dropdownMenu.js +4 -0
  62. package/plugins/dropdownMenu/dropdownMenu.mjs +4 -0
  63. package/plugins/filters/component/condition.js +11 -29
  64. package/plugins/filters/component/condition.mjs +6 -21
  65. package/plugins/filters/component/value.js +12 -5
  66. package/plugins/filters/component/value.mjs +12 -5
  67. package/plugins/filters/filters.d.ts +1 -1
  68. package/plugins/filters/filters.js +62 -82
  69. package/plugins/filters/filters.mjs +63 -83
  70. package/plugins/hiddenColumns/hiddenColumns.js +0 -4
  71. package/plugins/hiddenColumns/hiddenColumns.mjs +0 -2
  72. package/plugins/hiddenRows/hiddenRows.js +0 -4
  73. package/plugins/hiddenRows/hiddenRows.mjs +0 -2
  74. package/plugins/multiColumnSorting/domHelpers.js +2 -4
  75. package/plugins/multiColumnSorting/domHelpers.mjs +1 -2
  76. package/plugins/nestedRows/nestedRows.js +1 -1
  77. package/plugins/nestedRows/nestedRows.mjs +1 -1
  78. package/plugins/search/search.js +0 -2
  79. package/plugins/search/search.mjs +0 -1
  80. package/plugins/trimRows/trimRows.js +3 -3
  81. package/plugins/trimRows/trimRows.mjs +3 -3
  82. package/renderers/numericRenderer/numericRenderer.js +0 -2
  83. package/renderers/numericRenderer/numericRenderer.mjs +0 -1
  84. package/renderers/textRenderer/textRenderer.js +1 -1
  85. package/renderers/textRenderer/textRenderer.mjs +1 -1
  86. package/shortcuts/recorder.js +14 -10
  87. package/shortcuts/recorder.mjs +13 -10
  88. package/shortcuts/utils.js +0 -4
  89. package/shortcuts/utils.mjs +0 -2
  90. package/translations/indexMapper.js +2 -2
  91. package/translations/indexMapper.mjs +2 -2
  92. package/utils/sortingAlgorithms/mergeSort.js +0 -120
  93. package/utils/sortingAlgorithms/mergeSort.mjs +0 -110
@@ -366,41 +366,53 @@ var Border = /*#__PURE__*/function () {
366
366
  value: function updateMultipleSelectionHandlesPosition(row, col, top, left, width, height) {
367
367
  var isRtl = this.wot.wtSettings.getSetting('rtlMode');
368
368
  var inlinePosProperty = isRtl ? 'right' : 'left';
369
- var handleWidth = parseInt(this.selectionHandles.styles.top.width, 10);
370
- var hitAreaWidth = parseInt(this.selectionHandles.styles.topHitArea.width, 10);
371
- this.selectionHandles.styles.top.top = "".concat(parseInt(top - handleWidth - 1, 10), "px");
372
- this.selectionHandles.styles.top[inlinePosProperty] = "".concat(parseInt(left - handleWidth - 1, 10), "px");
373
- this.selectionHandles.styles.topHitArea.top = "".concat(parseInt(top - hitAreaWidth / 4 * 3, 10), "px");
374
- this.selectionHandles.styles.topHitArea[inlinePosProperty] = "".concat(parseInt(left - hitAreaWidth / 4 * 3, 10), "px");
375
- this.selectionHandles.styles.bottom.top = "".concat(parseInt(top + height, 10), "px");
376
- this.selectionHandles.styles.bottom[inlinePosProperty] = "".concat(parseInt(left + width, 10), "px");
377
- this.selectionHandles.styles.bottomHitArea.top = "".concat(parseInt(top + height - hitAreaWidth / 4, 10), "px");
378
- this.selectionHandles.styles.bottomHitArea[inlinePosProperty] = "".concat(parseInt(left + width - hitAreaWidth / 4, 10), "px");
369
+ var _this$selectionHandle = this.selectionHandles.styles,
370
+ topStyles = _this$selectionHandle.top,
371
+ topHitAreaStyles = _this$selectionHandle.topHitArea,
372
+ bottomStyles = _this$selectionHandle.bottom,
373
+ bottomHitAreaStyles = _this$selectionHandle.bottomHitArea;
374
+ var handleBorderSize = parseInt(topStyles.borderWidth, 10);
375
+ var handleSize = parseInt(topStyles.width, 10);
376
+ var hitAreaSize = parseInt(topHitAreaStyles.width, 10);
377
+ var totalTableWidth = this.wot.wtTable.getWidth();
378
+ var totalTableHeight = this.wot.wtTable.getHeight();
379
+ topStyles.top = "".concat(parseInt(top - handleSize - 1, 10), "px");
380
+ topStyles[inlinePosProperty] = "".concat(parseInt(left - handleSize - 1, 10), "px");
381
+ topHitAreaStyles.top = "".concat(parseInt(top - hitAreaSize / 4 * 3, 10), "px");
382
+ topHitAreaStyles[inlinePosProperty] = "".concat(parseInt(left - hitAreaSize / 4 * 3, 10), "px");
383
+ var bottomHandlerInline = Math.min(parseInt(left + width, 10), totalTableWidth - handleSize - handleBorderSize * 2);
384
+ var bottomHandlerAreaInline = Math.min(parseInt(left + width - hitAreaSize / 4, 10), totalTableWidth - hitAreaSize - handleBorderSize * 2);
385
+ bottomStyles[inlinePosProperty] = "".concat(bottomHandlerInline, "px");
386
+ bottomHitAreaStyles[inlinePosProperty] = "".concat(bottomHandlerAreaInline, "px");
387
+ var bottomHandlerTop = Math.min(parseInt(top + height, 10), totalTableHeight - handleSize - handleBorderSize * 2);
388
+ var bottomHandlerAreaTop = Math.min(parseInt(top + height - hitAreaSize / 4, 10), totalTableHeight - hitAreaSize - handleBorderSize * 2);
389
+ bottomStyles.top = "".concat(bottomHandlerTop, "px");
390
+ bottomHitAreaStyles.top = "".concat(bottomHandlerAreaTop, "px");
379
391
 
380
392
  if (this.settings.border.cornerVisible && this.settings.border.cornerVisible()) {
381
- this.selectionHandles.styles.top.display = 'block';
382
- this.selectionHandles.styles.topHitArea.display = 'block';
393
+ topStyles.display = 'block';
394
+ topHitAreaStyles.display = 'block';
383
395
 
384
396
  if (this.isPartRange(row, col)) {
385
- this.selectionHandles.styles.bottom.display = 'none';
386
- this.selectionHandles.styles.bottomHitArea.display = 'none';
397
+ bottomStyles.display = 'none';
398
+ bottomHitAreaStyles.display = 'none';
387
399
  } else {
388
- this.selectionHandles.styles.bottom.display = 'block';
389
- this.selectionHandles.styles.bottomHitArea.display = 'block';
400
+ bottomStyles.display = 'block';
401
+ bottomHitAreaStyles.display = 'block';
390
402
  }
391
403
  } else {
392
- this.selectionHandles.styles.top.display = 'none';
393
- this.selectionHandles.styles.bottom.display = 'none';
394
- this.selectionHandles.styles.topHitArea.display = 'none';
395
- this.selectionHandles.styles.bottomHitArea.display = 'none';
404
+ topStyles.display = 'none';
405
+ bottomStyles.display = 'none';
406
+ topHitAreaStyles.display = 'none';
407
+ bottomHitAreaStyles.display = 'none';
396
408
  }
397
409
 
398
410
  if (row === this.wot.wtSettings.getSetting('fixedRowsTop') || col === this.wot.wtSettings.getSetting('fixedColumnsStart')) {
399
- this.selectionHandles.styles.top.zIndex = '9999';
400
- this.selectionHandles.styles.topHitArea.zIndex = '9999';
411
+ topStyles.zIndex = '9999';
412
+ topHitAreaStyles.zIndex = '9999';
401
413
  } else {
402
- this.selectionHandles.styles.top.zIndex = '';
403
- this.selectionHandles.styles.topHitArea.zIndex = '';
414
+ topStyles.zIndex = '';
415
+ topHitAreaStyles.zIndex = '';
404
416
  }
405
417
  }
406
418
  /**
@@ -594,6 +606,9 @@ var Border = /*#__PURE__*/function () {
594
606
  trimmingContainer = rootDocument.documentElement;
595
607
  }
596
608
 
609
+ var cornerHalfWidth = parseInt(this.cornerDefaultStyle.width, 10) / 2;
610
+ var cornerHalfHeight = parseInt(this.cornerDefaultStyle.height, 10) / 2;
611
+
597
612
  if (toColumn === this.wot.getSetting('totalColumns') - 1) {
598
613
  var toTdOffsetLeft = trimToWindow ? toTD.getBoundingClientRect().left : toTD.offsetLeft;
599
614
  var cornerOverlappingContainer = false;
@@ -608,8 +623,7 @@ var Border = /*#__PURE__*/function () {
608
623
  }
609
624
 
610
625
  if (cornerOverlappingContainer) {
611
- this.cornerStyle[inlinePosProperty] = "".concat(Math.floor(inlineStartPos + width + this.cornerCenterPointOffset - parseInt(this.cornerDefaultStyle.width, 10) / 2), "px"); // eslint-disable-line max-len
612
-
626
+ this.cornerStyle[inlinePosProperty] = "".concat(Math.floor(inlineStartPos + width + this.cornerCenterPointOffset - cornerHalfWidth), "px");
613
627
  this.cornerStyle[isRtl ? 'borderLeftWidth' : 'borderRightWidth'] = 0;
614
628
  }
615
629
  }
@@ -621,8 +635,7 @@ var Border = /*#__PURE__*/function () {
621
635
  var _cornerOverlappingContainer = cornerBottomEdge >= (0, _element.innerHeight)(trimmingContainer);
622
636
 
623
637
  if (_cornerOverlappingContainer) {
624
- this.cornerStyle.top = "".concat(Math.floor(top + height + this.cornerCenterPointOffset - parseInt(this.cornerDefaultStyle.height, 10) / 2), "px"); // eslint-disable-line max-len
625
-
638
+ this.cornerStyle.top = "".concat(Math.floor(top + height + this.cornerCenterPointOffset - cornerHalfHeight), "px");
626
639
  this.cornerStyle.borderBottomWidth = 0;
627
640
  }
628
641
  }
@@ -825,7 +838,9 @@ var Border = /*#__PURE__*/function () {
825
838
 
826
839
  if ((0, _browser.isMobileBrowser)()) {
827
840
  this.selectionHandles.styles.top.display = 'none';
841
+ this.selectionHandles.styles.topHitArea.display = 'none';
828
842
  this.selectionHandles.styles.bottom.display = 'none';
843
+ this.selectionHandles.styles.bottomHitArea.display = 'none';
829
844
  }
830
845
  }
831
846
  /**
@@ -347,41 +347,53 @@ var Border = /*#__PURE__*/function () {
347
347
  value: function updateMultipleSelectionHandlesPosition(row, col, top, left, width, height) {
348
348
  var isRtl = this.wot.wtSettings.getSetting('rtlMode');
349
349
  var inlinePosProperty = isRtl ? 'right' : 'left';
350
- var handleWidth = parseInt(this.selectionHandles.styles.top.width, 10);
351
- var hitAreaWidth = parseInt(this.selectionHandles.styles.topHitArea.width, 10);
352
- this.selectionHandles.styles.top.top = "".concat(parseInt(top - handleWidth - 1, 10), "px");
353
- this.selectionHandles.styles.top[inlinePosProperty] = "".concat(parseInt(left - handleWidth - 1, 10), "px");
354
- this.selectionHandles.styles.topHitArea.top = "".concat(parseInt(top - hitAreaWidth / 4 * 3, 10), "px");
355
- this.selectionHandles.styles.topHitArea[inlinePosProperty] = "".concat(parseInt(left - hitAreaWidth / 4 * 3, 10), "px");
356
- this.selectionHandles.styles.bottom.top = "".concat(parseInt(top + height, 10), "px");
357
- this.selectionHandles.styles.bottom[inlinePosProperty] = "".concat(parseInt(left + width, 10), "px");
358
- this.selectionHandles.styles.bottomHitArea.top = "".concat(parseInt(top + height - hitAreaWidth / 4, 10), "px");
359
- this.selectionHandles.styles.bottomHitArea[inlinePosProperty] = "".concat(parseInt(left + width - hitAreaWidth / 4, 10), "px");
350
+ var _this$selectionHandle = this.selectionHandles.styles,
351
+ topStyles = _this$selectionHandle.top,
352
+ topHitAreaStyles = _this$selectionHandle.topHitArea,
353
+ bottomStyles = _this$selectionHandle.bottom,
354
+ bottomHitAreaStyles = _this$selectionHandle.bottomHitArea;
355
+ var handleBorderSize = parseInt(topStyles.borderWidth, 10);
356
+ var handleSize = parseInt(topStyles.width, 10);
357
+ var hitAreaSize = parseInt(topHitAreaStyles.width, 10);
358
+ var totalTableWidth = this.wot.wtTable.getWidth();
359
+ var totalTableHeight = this.wot.wtTable.getHeight();
360
+ topStyles.top = "".concat(parseInt(top - handleSize - 1, 10), "px");
361
+ topStyles[inlinePosProperty] = "".concat(parseInt(left - handleSize - 1, 10), "px");
362
+ topHitAreaStyles.top = "".concat(parseInt(top - hitAreaSize / 4 * 3, 10), "px");
363
+ topHitAreaStyles[inlinePosProperty] = "".concat(parseInt(left - hitAreaSize / 4 * 3, 10), "px");
364
+ var bottomHandlerInline = Math.min(parseInt(left + width, 10), totalTableWidth - handleSize - handleBorderSize * 2);
365
+ var bottomHandlerAreaInline = Math.min(parseInt(left + width - hitAreaSize / 4, 10), totalTableWidth - hitAreaSize - handleBorderSize * 2);
366
+ bottomStyles[inlinePosProperty] = "".concat(bottomHandlerInline, "px");
367
+ bottomHitAreaStyles[inlinePosProperty] = "".concat(bottomHandlerAreaInline, "px");
368
+ var bottomHandlerTop = Math.min(parseInt(top + height, 10), totalTableHeight - handleSize - handleBorderSize * 2);
369
+ var bottomHandlerAreaTop = Math.min(parseInt(top + height - hitAreaSize / 4, 10), totalTableHeight - hitAreaSize - handleBorderSize * 2);
370
+ bottomStyles.top = "".concat(bottomHandlerTop, "px");
371
+ bottomHitAreaStyles.top = "".concat(bottomHandlerAreaTop, "px");
360
372
 
361
373
  if (this.settings.border.cornerVisible && this.settings.border.cornerVisible()) {
362
- this.selectionHandles.styles.top.display = 'block';
363
- this.selectionHandles.styles.topHitArea.display = 'block';
374
+ topStyles.display = 'block';
375
+ topHitAreaStyles.display = 'block';
364
376
 
365
377
  if (this.isPartRange(row, col)) {
366
- this.selectionHandles.styles.bottom.display = 'none';
367
- this.selectionHandles.styles.bottomHitArea.display = 'none';
378
+ bottomStyles.display = 'none';
379
+ bottomHitAreaStyles.display = 'none';
368
380
  } else {
369
- this.selectionHandles.styles.bottom.display = 'block';
370
- this.selectionHandles.styles.bottomHitArea.display = 'block';
381
+ bottomStyles.display = 'block';
382
+ bottomHitAreaStyles.display = 'block';
371
383
  }
372
384
  } else {
373
- this.selectionHandles.styles.top.display = 'none';
374
- this.selectionHandles.styles.bottom.display = 'none';
375
- this.selectionHandles.styles.topHitArea.display = 'none';
376
- this.selectionHandles.styles.bottomHitArea.display = 'none';
385
+ topStyles.display = 'none';
386
+ bottomStyles.display = 'none';
387
+ topHitAreaStyles.display = 'none';
388
+ bottomHitAreaStyles.display = 'none';
377
389
  }
378
390
 
379
391
  if (row === this.wot.wtSettings.getSetting('fixedRowsTop') || col === this.wot.wtSettings.getSetting('fixedColumnsStart')) {
380
- this.selectionHandles.styles.top.zIndex = '9999';
381
- this.selectionHandles.styles.topHitArea.zIndex = '9999';
392
+ topStyles.zIndex = '9999';
393
+ topHitAreaStyles.zIndex = '9999';
382
394
  } else {
383
- this.selectionHandles.styles.top.zIndex = '';
384
- this.selectionHandles.styles.topHitArea.zIndex = '';
395
+ topStyles.zIndex = '';
396
+ topHitAreaStyles.zIndex = '';
385
397
  }
386
398
  }
387
399
  /**
@@ -575,6 +587,9 @@ var Border = /*#__PURE__*/function () {
575
587
  trimmingContainer = rootDocument.documentElement;
576
588
  }
577
589
 
590
+ var cornerHalfWidth = parseInt(this.cornerDefaultStyle.width, 10) / 2;
591
+ var cornerHalfHeight = parseInt(this.cornerDefaultStyle.height, 10) / 2;
592
+
578
593
  if (toColumn === this.wot.getSetting('totalColumns') - 1) {
579
594
  var toTdOffsetLeft = trimToWindow ? toTD.getBoundingClientRect().left : toTD.offsetLeft;
580
595
  var cornerOverlappingContainer = false;
@@ -589,8 +604,7 @@ var Border = /*#__PURE__*/function () {
589
604
  }
590
605
 
591
606
  if (cornerOverlappingContainer) {
592
- this.cornerStyle[inlinePosProperty] = "".concat(Math.floor(inlineStartPos + width + this.cornerCenterPointOffset - parseInt(this.cornerDefaultStyle.width, 10) / 2), "px"); // eslint-disable-line max-len
593
-
607
+ this.cornerStyle[inlinePosProperty] = "".concat(Math.floor(inlineStartPos + width + this.cornerCenterPointOffset - cornerHalfWidth), "px");
594
608
  this.cornerStyle[isRtl ? 'borderLeftWidth' : 'borderRightWidth'] = 0;
595
609
  }
596
610
  }
@@ -602,8 +616,7 @@ var Border = /*#__PURE__*/function () {
602
616
  var _cornerOverlappingContainer = cornerBottomEdge >= innerHeight(trimmingContainer);
603
617
 
604
618
  if (_cornerOverlappingContainer) {
605
- this.cornerStyle.top = "".concat(Math.floor(top + height + this.cornerCenterPointOffset - parseInt(this.cornerDefaultStyle.height, 10) / 2), "px"); // eslint-disable-line max-len
606
-
619
+ this.cornerStyle.top = "".concat(Math.floor(top + height + this.cornerCenterPointOffset - cornerHalfHeight), "px");
607
620
  this.cornerStyle.borderBottomWidth = 0;
608
621
  }
609
622
  }
@@ -806,7 +819,9 @@ var Border = /*#__PURE__*/function () {
806
819
 
807
820
  if (isMobileBrowser()) {
808
821
  this.selectionHandles.styles.top.display = 'none';
822
+ this.selectionHandles.styles.topHitArea.display = 'none';
809
823
  this.selectionHandles.styles.bottom.display = 'none';
824
+ this.selectionHandles.styles.bottomHitArea.display = 'none';
810
825
  }
811
826
  }
812
827
  /**
@@ -453,8 +453,10 @@ var Table = /*#__PURE__*/function () {
453
453
  }
454
454
  }
455
455
 
456
+ var positionChanged = false;
457
+
456
458
  if (this.isMaster) {
457
- var positionChanged = wtOverlays.topOverlay.resetFixedPosition();
459
+ positionChanged = wtOverlays.topOverlay.resetFixedPosition();
458
460
 
459
461
  if (wtOverlays.bottomOverlay.clone) {
460
462
  positionChanged = wtOverlays.bottomOverlay.resetFixedPosition() || positionChanged;
@@ -469,17 +471,18 @@ var Table = /*#__PURE__*/function () {
469
471
  if (wtOverlays.bottomInlineStartCornerOverlay && wtOverlays.bottomInlineStartCornerOverlay.clone) {
470
472
  wtOverlays.bottomInlineStartCornerOverlay.resetFixedPosition();
471
473
  }
472
-
473
- if (positionChanged) {
474
- // It refreshes the cells borders caused by a 1px shift (introduced by overlays which add or
475
- // remove `innerBorderTop` and `innerBorderInlineStart` CSS classes to the DOM element. This happens
476
- // when there is a switch between rendering from 0 to N rows/columns and vice versa).
477
- wtOverlays.refreshAll();
478
- wtOverlays.adjustElementsSize();
479
- }
480
474
  }
481
475
 
482
- this.refreshSelections(runFastDraw);
476
+ if (positionChanged) {
477
+ // It refreshes the cells borders caused by a 1px shift (introduced by overlays which add or
478
+ // remove `innerBorderTop` and `innerBorderInlineStart` CSS classes to the DOM element. This happens
479
+ // when there is a switch between rendering from 0 to N rows/columns and vice versa).
480
+ wtOverlays.refreshAll(); // `refreshAll()` internally already calls `refreshSelections()` method
481
+
482
+ wtOverlays.adjustElementsSize();
483
+ } else {
484
+ this.refreshSelections(runFastDraw);
485
+ }
483
486
 
484
487
  if (syncScroll) {
485
488
  wtOverlays.syncScrollWithMaster();
@@ -427,8 +427,10 @@ var Table = /*#__PURE__*/function () {
427
427
  }
428
428
  }
429
429
 
430
+ var positionChanged = false;
431
+
430
432
  if (this.isMaster) {
431
- var positionChanged = wtOverlays.topOverlay.resetFixedPosition();
433
+ positionChanged = wtOverlays.topOverlay.resetFixedPosition();
432
434
 
433
435
  if (wtOverlays.bottomOverlay.clone) {
434
436
  positionChanged = wtOverlays.bottomOverlay.resetFixedPosition() || positionChanged;
@@ -443,17 +445,18 @@ var Table = /*#__PURE__*/function () {
443
445
  if (wtOverlays.bottomInlineStartCornerOverlay && wtOverlays.bottomInlineStartCornerOverlay.clone) {
444
446
  wtOverlays.bottomInlineStartCornerOverlay.resetFixedPosition();
445
447
  }
446
-
447
- if (positionChanged) {
448
- // It refreshes the cells borders caused by a 1px shift (introduced by overlays which add or
449
- // remove `innerBorderTop` and `innerBorderInlineStart` CSS classes to the DOM element. This happens
450
- // when there is a switch between rendering from 0 to N rows/columns and vice versa).
451
- wtOverlays.refreshAll();
452
- wtOverlays.adjustElementsSize();
453
- }
454
448
  }
455
449
 
456
- this.refreshSelections(runFastDraw);
450
+ if (positionChanged) {
451
+ // It refreshes the cells borders caused by a 1px shift (introduced by overlays which add or
452
+ // remove `innerBorderTop` and `innerBorderInlineStart` CSS classes to the DOM element. This happens
453
+ // when there is a switch between rendering from 0 to N rows/columns and vice versa).
454
+ wtOverlays.refreshAll(); // `refreshAll()` internally already calls `refreshSelections()` method
455
+
456
+ wtOverlays.adjustElementsSize();
457
+ } else {
458
+ this.refreshSelections(runFastDraw);
459
+ }
457
460
 
458
461
  if (syncScroll) {
459
462
  wtOverlays.syncScrollWithMaster();
package/CHANGELOG.md CHANGED
@@ -8,6 +8,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
 
9
9
  <!-- UNVERSIONED -->
10
10
 
11
+ ## [12.1.3] - 2022-09-22
12
+
13
+ For more information on this release, see:
14
+ - [Release notes](https://handsontable.com/docs/release-notes/#_12-1-3)
15
+ - [Blog post](https://handsontable.com/blog/)
16
+
17
+ ### Fixed
18
+ - Fixed incorrect date format conversion on input in the date editor. [#9681](https://github.com/handsontable/handsontable/issues/9681)
19
+ - Fixed an error when adding a large number of rows using the `alter` method. [#7840](https://github.com/handsontable/handsontable/issues/7840)
20
+ - Fixed IME text input in the editors. [#9586](https://github.com/handsontable/handsontable/issues/9586)
21
+ - Fixed an issue where the editor did not open on key events when the cell was outside the viewport. [#9022](https://github.com/handsontable/handsontable/issues/9022)
22
+ - Fixed an issue with "0" values being ignored by the Column Summary plugin. [#6385](https://github.com/handsontable/handsontable/issues/6385)
23
+ - Fixed an error when opening the column dropdown menu with the Filters plugin enabled. [#9561](https://github.com/handsontable/handsontable/issues/9561)
24
+ - Fixed an issue where the `trimWhitespace` option could not be used in the column and cell levels of the cascading configuration. [#7387](https://github.com/handsontable/handsontable/issues/7387)
25
+ - Fixed the flickering of the selection area at the edge of the table while scrolling. [#8317](https://github.com/handsontable/handsontable/issues/8317)
26
+ - Fixed misalignment on mobile devices when the edge cells were selected. [#9621](https://github.com/handsontable/handsontable/issues/9621)
27
+ - Fixed type definitions for the method `setSourceDataAtCell`. [#8599](https://github.com/handsontable/handsontable/issues/8599)
28
+
29
+ ### Removed
30
+ - Removed a custom stable sorting implementation in favor of the built-in sorting algorithm [#6091](https://github.com/handsontable/handsontable/issues/6091)
31
+ - Removed type definitions for non-existing methods `rowOffset` and `colOffset` and a non-existing hook `modifyRowSourceData`. [#8659](https://github.com/handsontable/handsontable/issues/8659), [#7317](https://github.com/handsontable/handsontable/issues/7317)
32
+
33
+ ## [12.1.2] - 2022-07-08
34
+
35
+ For more information on this release, see:
36
+ - [Release notes](https://handsontable.com/docs/release-notes/#_12-1-2)
37
+
38
+ ### Changed
39
+ - Changed the version of the Moment.js dependency from 2.29.3 to 2.29.4, in reaction to a recently-found Moment.js security vulnerability. The vulnerability did not affect a correct configuration of Handsontable. [#9638](https://github.com/handsontable/handsontable/issues/9638)
40
+ - *Vue:* Freezed the version of the Vue framework that is used in our build chain to ~2.6. This shouldn't affect apps that use Vue 2.7+. [#9624](https://github.com/handsontable/handsontable/issues/9624)
41
+
11
42
  ## [12.1.1] - 2022-07-05
12
43
 
13
44
  For more information on this release, see:
package/base.js CHANGED
@@ -52,8 +52,8 @@ Handsontable.Core = function (rootElement) {
52
52
  Handsontable.DefaultSettings = (0, _dataMap.metaSchemaFactory)();
53
53
  Handsontable.hooks = _pluginHooks.default.getSingleton();
54
54
  Handsontable.packageName = 'handsontable';
55
- Handsontable.buildDate = "05/07/2022 15:06:36";
56
- Handsontable.version = "12.1.1";
55
+ Handsontable.buildDate = "22/09/2022 09:54:31";
56
+ Handsontable.version = "12.1.3";
57
57
  Handsontable.languages = {
58
58
  dictionaryKeys: _registry.dictionaryKeys,
59
59
  getLanguageDictionary: _registry.getLanguageDictionary,
package/base.mjs CHANGED
@@ -37,8 +37,8 @@ Handsontable.Core = function (rootElement) {
37
37
  Handsontable.DefaultSettings = metaSchemaFactory();
38
38
  Handsontable.hooks = Hooks.getSingleton();
39
39
  Handsontable.packageName = 'handsontable';
40
- Handsontable.buildDate = "05/07/2022 15:06:41";
41
- Handsontable.version = "12.1.1";
40
+ Handsontable.buildDate = "22/09/2022 09:54:36";
41
+ Handsontable.version = "12.1.3";
42
42
  Handsontable.languages = {
43
43
  dictionaryKeys: dictionaryKeys,
44
44
  getLanguageDictionary: getLanguageDictionary,
package/core.d.ts CHANGED
@@ -27,7 +27,6 @@ export default class Core {
27
27
  batchRender<R>(wrappedOperations: () => R): R;
28
28
  clear(): void;
29
29
  clearUndo(): void;
30
- colOffset(): number;
31
30
  colToProp(col: number): string | number;
32
31
  columnIndexMapper: IndexMapper;
33
32
  constructor(element: Element, options: GridSettings);
@@ -125,7 +124,6 @@ export default class Core {
125
124
  rootElement: HTMLElement;
126
125
  rootWindow: Window;
127
126
  rowIndexMapper: IndexMapper;
128
- rowOffset(): number;
129
127
  runHooks(key: keyof Events, p1?: any, p2?: any, p3?: any, p4?: any, p5?: any, p6?: any): any;
130
128
  scrollViewportTo(row?: number, column?: number, snapToBottom?: boolean, snapToRight?: boolean, considerHiddenIndexes?: boolean): boolean;
131
129
  selectAll(): void;
@@ -141,7 +139,7 @@ export default class Core {
141
139
  setDataAtCell(row: number, col: number, value: CellValue, source?: string): void;
142
140
  setDataAtRowProp(changes: Array<[number, string | number, CellValue]>, source?: string): void;
143
141
  setDataAtRowProp(row: number, prop: string, value: CellValue, source?: string): void;
144
- setSourceDataAtCell(changes: Array<[number, string | number, CellValue]>): void;
142
+ setSourceDataAtCell(changes: Array<[number, string | number, CellValue]>, source?: string): void;
145
143
  setSourceDataAtCell(row: number, column: number | string, value: CellValue, source?: string): void;
146
144
  spliceCol(col: number, index: number, amount: number, ...elements: CellValue[]): void;
147
145
  spliceRow(row: number, index: number, amount: number, ...elements: CellValue[]): void;
package/core.js CHANGED
@@ -1731,9 +1731,11 @@ function Core(rootElement, userSettings) {
1731
1731
  instance._refreshBorders(revertOriginal, prepareEditorIfNeeded);
1732
1732
  };
1733
1733
  /**
1734
- * Populate cells at position with 2D input array (e.g. `[[1, 2], [3, 4]]`). Use `endRow`, `endCol` when you
1734
+ * Populates cells at position with 2D input array (e.g. `[[1, 2], [3, 4]]`). Use `endRow`, `endCol` when you
1735
1735
  * want to cut input when a certain row is reached.
1736
1736
  *
1737
+ * The `populateFromArray()` method can't change [`readOnly`](@/api/options.md#readonly) cells.
1738
+ *
1737
1739
  * Optional `method` argument has the same effect as pasteMode option (see {@link Options#pasteMode}).
1738
1740
  *
1739
1741
  * @memberof Core#
@@ -1949,6 +1951,9 @@ function Core(rootElement, userSettings) {
1949
1951
  * The method is intended to be used by advanced users. Suspending the rendering
1950
1952
  * process could cause visual glitches when wrongly implemented.
1951
1953
  *
1954
+ * Every [`suspendRender()`](@/api/core.md#suspendrender) call needs to correspond with one [`resumeRender()`](@/api/core.md#resumerender) call.
1955
+ * For example, if you call [`suspendRender()`](@/api/core.md#suspendrender) 5 times, you need to call [`resumeRender()`](@/api/core.md#resumerender) 5 times as well.
1956
+ *
1952
1957
  * @memberof Core#
1953
1958
  * @function suspendRender
1954
1959
  * @since 8.3.0
@@ -1981,6 +1986,9 @@ function Core(rootElement, userSettings) {
1981
1986
  * The method is intended to be used by advanced users. Suspending the rendering
1982
1987
  * process could cause visual glitches when wrongly implemented.
1983
1988
  *
1989
+ * Every [`suspendRender()`](@/api/core.md#suspendrender) call needs to correspond with one [`resumeRender()`](@/api/core.md#resumerender) call.
1990
+ * For example, if you call [`suspendRender()`](@/api/core.md#suspendrender) 5 times, you need to call [`resumeRender()`](@/api/core.md#resumerender) 5 times as well.
1991
+ *
1984
1992
  * @memberof Core#
1985
1993
  * @function resumeRender
1986
1994
  * @since 8.3.0
package/core.mjs CHANGED
@@ -1671,9 +1671,11 @@ export default function Core(rootElement, userSettings) {
1671
1671
  instance._refreshBorders(revertOriginal, prepareEditorIfNeeded);
1672
1672
  };
1673
1673
  /**
1674
- * Populate cells at position with 2D input array (e.g. `[[1, 2], [3, 4]]`). Use `endRow`, `endCol` when you
1674
+ * Populates cells at position with 2D input array (e.g. `[[1, 2], [3, 4]]`). Use `endRow`, `endCol` when you
1675
1675
  * want to cut input when a certain row is reached.
1676
1676
  *
1677
+ * The `populateFromArray()` method can't change [`readOnly`](@/api/options.md#readonly) cells.
1678
+ *
1677
1679
  * Optional `method` argument has the same effect as pasteMode option (see {@link Options#pasteMode}).
1678
1680
  *
1679
1681
  * @memberof Core#
@@ -1889,6 +1891,9 @@ export default function Core(rootElement, userSettings) {
1889
1891
  * The method is intended to be used by advanced users. Suspending the rendering
1890
1892
  * process could cause visual glitches when wrongly implemented.
1891
1893
  *
1894
+ * Every [`suspendRender()`](@/api/core.md#suspendrender) call needs to correspond with one [`resumeRender()`](@/api/core.md#resumerender) call.
1895
+ * For example, if you call [`suspendRender()`](@/api/core.md#suspendrender) 5 times, you need to call [`resumeRender()`](@/api/core.md#resumerender) 5 times as well.
1896
+ *
1892
1897
  * @memberof Core#
1893
1898
  * @function suspendRender
1894
1899
  * @since 8.3.0
@@ -1921,6 +1926,9 @@ export default function Core(rootElement, userSettings) {
1921
1926
  * The method is intended to be used by advanced users. Suspending the rendering
1922
1927
  * process could cause visual glitches when wrongly implemented.
1923
1928
  *
1929
+ * Every [`suspendRender()`](@/api/core.md#suspendrender) call needs to correspond with one [`resumeRender()`](@/api/core.md#resumerender) call.
1930
+ * For example, if you call [`suspendRender()`](@/api/core.md#suspendrender) 5 times, you need to call [`resumeRender()`](@/api/core.md#resumerender) 5 times as well.
1931
+ *
1924
1932
  * @memberof Core#
1925
1933
  * @function resumeRender
1926
1934
  * @since 8.3.0
@@ -6,6 +6,12 @@ require("core-js/modules/es.symbol.description.js");
6
6
 
7
7
  require("core-js/modules/es.symbol.iterator.js");
8
8
 
9
+ require("core-js/modules/es.array.from.js");
10
+
11
+ require("core-js/modules/es.function.name.js");
12
+
13
+ require("core-js/modules/es.regexp.exec.js");
14
+
9
15
  exports.__esModule = true;
10
16
  exports.default = void 0;
11
17
 
@@ -23,21 +29,19 @@ require("core-js/modules/es.number.is-integer.js");
23
29
 
24
30
  require("core-js/modules/es.number.constructor.js");
25
31
 
26
- require("core-js/modules/es.array.concat.js");
27
-
28
32
  require("core-js/modules/es.array.splice.js");
29
33
 
30
34
  require("core-js/modules/es.array.sort.js");
31
35
 
32
36
  require("core-js/modules/es.array.slice.js");
33
37
 
34
- require("core-js/modules/es.array.filter.js");
38
+ require("core-js/modules/es.array.concat.js");
35
39
 
36
- require("core-js/modules/es.array.index-of.js");
40
+ require("core-js/modules/web.dom-collections.for-each.js");
37
41
 
38
- require("core-js/modules/es.regexp.exec.js");
42
+ require("core-js/modules/es.array.filter.js");
39
43
 
40
- require("core-js/modules/es.string.split.js");
44
+ require("core-js/modules/es.array.index-of.js");
41
45
 
42
46
  var _SheetClip = require("../3rdparty/SheetClip");
43
47
 
@@ -51,6 +55,18 @@ var _number = require("../helpers/number");
51
55
 
52
56
  var _mixed = require("../helpers/mixed");
53
57
 
58
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
59
+
60
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
61
+
62
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
63
+
64
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
65
+
66
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
67
+
68
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
69
+
54
70
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
55
71
 
56
72
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -394,7 +410,7 @@ var DataMap = /*#__PURE__*/function () {
394
410
  }
395
411
 
396
412
  this.instance.rowIndexMapper.insertIndexes(rowIndex, numberOfCreatedRows);
397
- this.spliceData.apply(this, [physicalRowIndex, 0].concat(rowsToAdd));
413
+ this.spliceData(physicalRowIndex, 0, rowsToAdd);
398
414
  this.instance.runHooks('afterCreateRow', rowIndex, numberOfCreatedRows, source);
399
415
  this.instance.forceFullRender = true; // used when data was changed
400
416
 
@@ -661,23 +677,26 @@ var DataMap = /*#__PURE__*/function () {
661
677
  * Add/remove row(s) to/from the data source.
662
678
  *
663
679
  * @param {number} index Physical index of the element to add/remove.
664
- * @param {number} amount Number of rows to add/remove.
665
- * @param {...object} elements Row elements to be added.
680
+ * @param {number} deleteCount Number of rows to remove.
681
+ * @param {Array<object>} elements Row elements to be added.
666
682
  */
667
683
 
668
684
  }, {
669
685
  key: "spliceData",
670
- value: function spliceData(index, amount) {
671
- for (var _len3 = arguments.length, elements = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
672
- elements[_key3 - 2] = arguments[_key3];
673
- }
686
+ value: function spliceData(index, deleteCount, elements) {
687
+ var _this3 = this;
674
688
 
675
- var continueSplicing = this.instance.runHooks('beforeDataSplice', index, amount, elements);
689
+ var continueSplicing = this.instance.runHooks('beforeDataSplice', index, deleteCount, elements);
676
690
 
677
691
  if (continueSplicing !== false) {
678
- var _this$dataSource;
692
+ var newData = [].concat(_toConsumableArray(this.dataSource.slice(0, index)), _toConsumableArray(elements), _toConsumableArray(this.dataSource.slice(index))); // We try not to change the reference.
679
693
 
680
- (_this$dataSource = this.dataSource).splice.apply(_this$dataSource, [index, amount].concat(elements));
694
+ this.dataSource.length = 0; // Pushing to array instead of using `splice`, because Babel changes the code to one that uses the `apply` method.
695
+ // The used method was cause of the problem described within #7840.
696
+
697
+ newData.forEach(function (row) {
698
+ return _this3.dataSource.push(row);
699
+ });
681
700
  }
682
701
  }
683
702
  /**