handsontable 12.1.2 → 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 +27 -4
  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 +40800 -57808
  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 +1 -1
  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
@@ -69,7 +69,7 @@ import { toSingleLine } from "../../helpers/templateLiteralTag.mjs";
69
69
  import { warn } from "../../helpers/console.mjs";
70
70
  import { rangeEach } from "../../helpers/number.mjs";
71
71
  import EventManager from "../../eventManager.mjs";
72
- import { addClass, removeClass, closest } from "../../helpers/dom/element.mjs";
72
+ import { addClass, removeClass } from "../../helpers/dom/element.mjs";
73
73
  import { SEPARATOR } from "../contextMenu/predefinedItems.mjs";
74
74
  import * as constants from "../../i18n/constants.mjs";
75
75
  import ConditionComponent from "./component/condition.mjs";
@@ -299,7 +299,6 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
299
299
  this.components.forEach(function (component) {
300
300
  return component.show();
301
301
  });
302
- this.registerEvents();
303
302
  this.addHook('beforeDropdownMenuSetItems', function (items) {
304
303
  return _this2.onBeforeDropdownMenuSetItems(items);
305
304
  });
@@ -323,21 +322,6 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
323
322
 
324
323
  _get(_getPrototypeOf(Filters.prototype), "enablePlugin", this).call(this);
325
324
  }
326
- /**
327
- * Registers the DOM listeners.
328
- *
329
- * @private
330
- */
331
-
332
- }, {
333
- key: "registerEvents",
334
- value: function registerEvents() {
335
- var _this3 = this;
336
-
337
- this.eventManager.addEventListener(this.hot.rootElement, 'click', function (event) {
338
- return _this3.onTableClick(event);
339
- });
340
- }
341
325
  /**
342
326
  * Disables the plugin functionality for this Handsontable instance.
343
327
  */
@@ -345,7 +329,7 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
345
329
  }, {
346
330
  key: "disablePlugin",
347
331
  value: function disablePlugin() {
348
- var _this4 = this;
332
+ var _this3 = this;
349
333
 
350
334
  if (this.enabled) {
351
335
  var _this$dropdownMenuPlu;
@@ -357,7 +341,7 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
357
341
  this.components.forEach(function (component, key) {
358
342
  component.destroy();
359
343
 
360
- _this4.components.set(key, null);
344
+ _this3.components.set(key, null);
361
345
  });
362
346
  this.conditionCollection.destroy();
363
347
  this.conditionCollection = null;
@@ -490,7 +474,7 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
490
474
  }, {
491
475
  key: "filter",
492
476
  value: function filter() {
493
- var _this5 = this;
477
+ var _this4 = this;
494
478
 
495
479
  var dataFilter = this._createDataFilter();
496
480
 
@@ -503,19 +487,19 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
503
487
  if (needToFilter) {
504
488
  var trimmedRows = [];
505
489
  this.hot.batchExecution(function () {
506
- _this5.filtersRowsMap.clear();
490
+ _this4.filtersRowsMap.clear();
507
491
 
508
492
  visibleVisualRows = arrayMap(dataFilter.filter(), function (rowData) {
509
493
  return rowData.meta.visualRow;
510
494
  });
511
495
  var visibleVisualRowsAssertion = createArrayAssertion(visibleVisualRows);
512
- rangeEach(_this5.hot.countSourceRows() - 1, function (row) {
496
+ rangeEach(_this4.hot.countSourceRows() - 1, function (row) {
513
497
  if (!visibleVisualRowsAssertion(row)) {
514
498
  trimmedRows.push(row);
515
499
  }
516
500
  });
517
501
  arrayEach(trimmedRows, function (physicalRow) {
518
- _this5.filtersRowsMap.setValueAtIndex(physicalRow, true);
502
+ _this4.filtersRowsMap.setValueAtIndex(physicalRow, true);
519
503
  });
520
504
  }, true);
521
505
 
@@ -535,14 +519,26 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
535
519
  /**
536
520
  * Gets last selected column index.
537
521
  *
538
- * @returns {object|null} Return `null` when column isn't selected otherwise
539
- * object containing information about selected column with keys `visualIndex` and `physicalIndex`.
522
+ * @returns {{visualIndex: number, physicalIndex: number} | null} Returns `null` when a column is
523
+ * not selected. Otherwise, returns an object with `visualIndex` and `physicalIndex` properties containing
524
+ * the index of the column.
540
525
  */
541
526
 
542
527
  }, {
543
528
  key: "getSelectedColumn",
544
529
  value: function getSelectedColumn() {
545
- return this.lastSelectedColumn;
530
+ var _this$hot$getSelected;
531
+
532
+ var highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
533
+
534
+ if (!highlight) {
535
+ return null;
536
+ }
537
+
538
+ return {
539
+ visualIndex: highlight.col,
540
+ physicalIndex: this.hot.toPhysicalColumn(highlight.col)
541
+ };
546
542
  }
547
543
  /**
548
544
  * Clears column selection.
@@ -553,12 +549,10 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
553
549
  }, {
554
550
  key: "clearColumnSelection",
555
551
  value: function clearColumnSelection() {
556
- var _this$hot$getSelected;
552
+ var selectedColumn = this.getSelectedColumn();
557
553
 
558
- var coords = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.getTopStartCorner();
559
-
560
- if (coords !== void 0) {
561
- this.hot.selectCell(coords.row, coords.col);
554
+ if (selectedColumn !== null) {
555
+ this.hot.selectCell(0, selectedColumn.visualIndex);
562
556
  }
563
557
  }
564
558
  /**
@@ -571,24 +565,24 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
571
565
  }, {
572
566
  key: "getDataMapAtColumn",
573
567
  value: function getDataMapAtColumn(column) {
574
- var _this6 = this;
568
+ var _this5 = this;
575
569
 
576
570
  var visualColumn = this.hot.toVisualColumn(column);
577
571
  var data = [];
578
572
  arrayEach(this.hot.getSourceDataAtCol(visualColumn), function (value, rowIndex) {
579
- var _this6$hot$getDataAtC;
580
-
581
- var _this6$hot$getCellMet = _this6.hot.getCellMeta(rowIndex, visualColumn),
582
- row = _this6$hot$getCellMet.row,
583
- col = _this6$hot$getCellMet.col,
584
- visualCol = _this6$hot$getCellMet.visualCol,
585
- visualRow = _this6$hot$getCellMet.visualRow,
586
- type = _this6$hot$getCellMet.type,
587
- instance = _this6$hot$getCellMet.instance,
588
- dateFormat = _this6$hot$getCellMet.dateFormat,
589
- locale = _this6$hot$getCellMet.locale;
590
-
591
- var dataValue = (_this6$hot$getDataAtC = _this6.hot.getDataAtCell(_this6.hot.toVisualRow(rowIndex), visualColumn)) !== null && _this6$hot$getDataAtC !== void 0 ? _this6$hot$getDataAtC : value;
573
+ var _this5$hot$getDataAtC;
574
+
575
+ var _this5$hot$getCellMet = _this5.hot.getCellMeta(rowIndex, visualColumn),
576
+ row = _this5$hot$getCellMet.row,
577
+ col = _this5$hot$getCellMet.col,
578
+ visualCol = _this5$hot$getCellMet.visualCol,
579
+ visualRow = _this5$hot$getCellMet.visualRow,
580
+ type = _this5$hot$getCellMet.type,
581
+ instance = _this5$hot$getCellMet.instance,
582
+ dateFormat = _this5$hot$getCellMet.dateFormat,
583
+ locale = _this5$hot$getCellMet.locale;
584
+
585
+ var dataValue = (_this5$hot$getDataAtC = _this5.hot.getDataAtCell(_this5.hot.toVisualRow(rowIndex), visualColumn)) !== null && _this5$hot$getDataAtC !== void 0 ? _this5$hot$getDataAtC : value;
592
586
  data.push({
593
587
  meta: {
594
588
  row: row,
@@ -615,17 +609,17 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
615
609
  }, {
616
610
  key: "onAfterChange",
617
611
  value: function onAfterChange(changes) {
618
- var _this7 = this;
612
+ var _this6 = this;
619
613
 
620
614
  if (changes) {
621
615
  arrayEach(changes, function (change) {
622
616
  var _change = _slicedToArray(change, 2),
623
617
  prop = _change[1];
624
618
 
625
- var columnIndex = _this7.hot.propToCol(prop);
619
+ var columnIndex = _this6.hot.propToCol(prop);
626
620
 
627
- if (_this7.conditionCollection.hasConditions(columnIndex)) {
628
- _this7.updateValueComponentCondition(columnIndex);
621
+ if (_this6.conditionCollection.hasConditions(columnIndex)) {
622
+ _this6.updateValueComponentCondition(columnIndex);
629
623
  }
630
624
  });
631
625
  }
@@ -698,11 +692,11 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
698
692
  }, {
699
693
  key: "onBeforeDropdownMenuSetItems",
700
694
  value: function onBeforeDropdownMenuSetItems() {
701
- var _this8 = this;
695
+ var _this7 = this;
702
696
 
703
697
  if (this.dropdownMenuPlugin) {
704
698
  this.dropdownMenuPlugin.menu.addLocalHook('afterOpen', function () {
705
- _this8.dropdownMenuPlugin.menu.hotMenu.updateSettings({
699
+ _this7.dropdownMenuPlugin.menu.hotMenu.updateSettings({
706
700
  hiddenRows: true
707
701
  });
708
702
  });
@@ -761,10 +755,19 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
761
755
  }, {
762
756
  key: "onActionBarSubmit",
763
757
  value: function onActionBarSubmit(submitType) {
758
+ var _this$dropdownMenuPlu3;
759
+
764
760
  if (submitType === 'accept') {
765
- var _this$getSelectedColu2;
761
+ var selectedColumn = this.getSelectedColumn();
766
762
 
767
- var physicalIndex = (_this$getSelectedColu2 = this.getSelectedColumn()) === null || _this$getSelectedColu2 === void 0 ? void 0 : _this$getSelectedColu2.physicalIndex;
763
+ if (selectedColumn === null) {
764
+ var _this$dropdownMenuPlu2;
765
+
766
+ (_this$dropdownMenuPlu2 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu2 === void 0 ? void 0 : _this$dropdownMenuPlu2.close();
767
+ return;
768
+ }
769
+
770
+ var physicalIndex = selectedColumn.physicalIndex;
768
771
  var byConditionState1 = this.components.get('filter_by_condition').getState();
769
772
  var byConditionState2 = this.components.get('filter_by_condition2').getState();
770
773
  var byValueState = this.components.get('filter_by_value').getState();
@@ -798,9 +801,7 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
798
801
  this.filter();
799
802
  }
800
803
 
801
- if (this.dropdownMenuPlugin) {
802
- this.dropdownMenuPlugin.close();
803
- }
804
+ (_this$dropdownMenuPlu3 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu3 === void 0 ? void 0 : _this$dropdownMenuPlu3.close();
804
805
  }
805
806
  /**
806
807
  * On component change listener.
@@ -885,27 +886,6 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
885
886
  removeClass(TH, 'htFiltersActive');
886
887
  }
887
888
  }
888
- /**
889
- * On table click listener.
890
- *
891
- * @private
892
- * @param {Event} event DOM Event.
893
- */
894
-
895
- }, {
896
- key: "onTableClick",
897
- value: function onTableClick(event) {
898
- var th = closest(event.target, 'TH');
899
-
900
- if (th) {
901
- var visualIndex = this.hot.getCoords(th).col;
902
- var physicalIndex = this.hot.toPhysicalColumn(visualIndex);
903
- this.lastSelectedColumn = {
904
- visualIndex: visualIndex,
905
- physicalIndex: physicalIndex
906
- };
907
- }
908
- }
909
889
  /**
910
890
  * Creates DataFilter instance based on condition collection.
911
891
  *
@@ -917,11 +897,11 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
917
897
  }, {
918
898
  key: "_createDataFilter",
919
899
  value: function _createDataFilter() {
920
- var _this9 = this;
900
+ var _this8 = this;
921
901
 
922
902
  var conditionCollection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.conditionCollection;
923
903
  return new DataFilter(conditionCollection, function (physicalColumn) {
924
- return _this9.getDataMapAtColumn(physicalColumn);
904
+ return _this8.getDataMapAtColumn(physicalColumn);
925
905
  });
926
906
  }
927
907
  /**
@@ -936,9 +916,9 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
936
916
  }, {
937
917
  key: "updateComponents",
938
918
  value: function updateComponents(conditionsState) {
939
- var _this$dropdownMenuPlu2;
919
+ var _this$dropdownMenuPlu4;
940
920
 
941
- if (!((_this$dropdownMenuPlu2 = this.dropdownMenuPlugin) !== null && _this$dropdownMenuPlu2 !== void 0 && _this$dropdownMenuPlu2.enabled)) {
921
+ if (!((_this$dropdownMenuPlu4 = this.dropdownMenuPlugin) !== null && _this$dropdownMenuPlu4 !== void 0 && _this$dropdownMenuPlu4.enabled)) {
942
922
  return;
943
923
  }
944
924
 
@@ -1068,14 +1048,14 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
1068
1048
  }, {
1069
1049
  key: "destroy",
1070
1050
  value: function destroy() {
1071
- var _this10 = this;
1051
+ var _this9 = this;
1072
1052
 
1073
1053
  if (this.enabled) {
1074
1054
  this.components.forEach(function (component, key) {
1075
1055
  if (component !== null) {
1076
1056
  component.destroy();
1077
1057
 
1078
- _this10.components.set(key, null);
1058
+ _this9.components.set(key, null);
1079
1059
  }
1080
1060
  });
1081
1061
  this.conditionCollection.destroy();
@@ -45,10 +45,6 @@ require("core-js/modules/es.number.constructor.js");
45
45
 
46
46
  require("core-js/modules/es.array.index-of.js");
47
47
 
48
- require("core-js/modules/es.regexp.exec.js");
49
-
50
- require("core-js/modules/es.string.split.js");
51
-
52
48
  require("core-js/modules/es.array.splice.js");
53
49
 
54
50
  require("core-js/modules/es.array.join.js");
@@ -12,8 +12,6 @@ import "core-js/modules/web.dom-collections.iterator.js";
12
12
  import "core-js/modules/es.number.is-integer.js";
13
13
  import "core-js/modules/es.number.constructor.js";
14
14
  import "core-js/modules/es.array.index-of.js";
15
- import "core-js/modules/es.regexp.exec.js";
16
- import "core-js/modules/es.string.split.js";
17
15
  import "core-js/modules/es.array.splice.js";
18
16
  import "core-js/modules/es.array.join.js";
19
17
  import "core-js/modules/es.weak-map.js";
@@ -45,10 +45,6 @@ require("core-js/modules/es.number.constructor.js");
45
45
 
46
46
  require("core-js/modules/es.array.index-of.js");
47
47
 
48
- require("core-js/modules/es.regexp.exec.js");
49
-
50
- require("core-js/modules/es.string.split.js");
51
-
52
48
  require("core-js/modules/es.array.splice.js");
53
49
 
54
50
  require("core-js/modules/es.array.join.js");
@@ -12,8 +12,6 @@ import "core-js/modules/web.dom-collections.iterator.js";
12
12
  import "core-js/modules/es.number.is-integer.js";
13
13
  import "core-js/modules/es.number.constructor.js";
14
14
  import "core-js/modules/es.array.index-of.js";
15
- import "core-js/modules/es.regexp.exec.js";
16
- import "core-js/modules/es.string.split.js";
17
15
  import "core-js/modules/es.array.splice.js";
18
16
  import "core-js/modules/es.array.join.js";
19
17
  import "core-js/modules/es.weak-map.js";
@@ -4,12 +4,10 @@ exports.__esModule = true;
4
4
  exports.getClassesToAdd = getClassesToAdd;
5
5
  exports.getClassesToRemove = getClassesToRemove;
6
6
 
7
- require("core-js/modules/es.regexp.exec.js");
8
-
9
- require("core-js/modules/es.string.split.js");
10
-
11
7
  require("core-js/modules/es.regexp.constructor.js");
12
8
 
9
+ require("core-js/modules/es.regexp.exec.js");
10
+
13
11
  require("core-js/modules/es.regexp.to-string.js");
14
12
 
15
13
  require("core-js/modules/es.array.filter.js");
@@ -1,6 +1,5 @@
1
- import "core-js/modules/es.regexp.exec.js";
2
- import "core-js/modules/es.string.split.js";
3
1
  import "core-js/modules/es.regexp.constructor.js";
2
+ import "core-js/modules/es.regexp.exec.js";
4
3
  import "core-js/modules/es.regexp.to-string.js";
5
4
  import "core-js/modules/es.array.filter.js";
6
5
  import "core-js/modules/es.object.to-string.js";
@@ -525,7 +525,7 @@ var NestedRows = /*#__PURE__*/function (_BasePlugin) {
525
525
  }, new Set())); // Modifying hook's argument by the reference.
526
526
 
527
527
  physicalRows.length = 0;
528
- physicalRows.push.apply(physicalRows, _toConsumableArray(modifiedPhysicalRows));
528
+ physicalRows.push.apply(physicalRows, modifiedPhysicalRows);
529
529
  }
530
530
  /**
531
531
  * `beforeAddChild` hook callback.
@@ -486,7 +486,7 @@ export var NestedRows = /*#__PURE__*/function (_BasePlugin) {
486
486
  }, new Set())); // Modifying hook's argument by the reference.
487
487
 
488
488
  physicalRows.length = 0;
489
- physicalRows.push.apply(physicalRows, _toConsumableArray(modifiedPhysicalRows));
489
+ physicalRows.push.apply(physicalRows, modifiedPhysicalRows);
490
490
  }
491
491
  /**
492
492
  * `beforeAddChild` hook callback.
@@ -43,8 +43,6 @@ require("core-js/modules/es.regexp.exec.js");
43
43
 
44
44
  require("core-js/modules/es.string.search.js");
45
45
 
46
- require("core-js/modules/es.string.split.js");
47
-
48
46
  require("core-js/modules/es.array.includes.js");
49
47
 
50
48
  require("core-js/modules/es.string.includes.js");
@@ -41,7 +41,6 @@ import "core-js/modules/es.object.to-string.js";
41
41
  import "core-js/modules/es.regexp.to-string.js";
42
42
  import "core-js/modules/es.regexp.exec.js";
43
43
  import "core-js/modules/es.string.search.js";
44
- import "core-js/modules/es.string.split.js";
45
44
  import "core-js/modules/es.array.includes.js";
46
45
  import "core-js/modules/es.string.includes.js";
47
46
  import "core-js/modules/es.array.splice.js";
@@ -262,7 +262,7 @@ var TrimRows = /*#__PURE__*/function (_BasePlugin) {
262
262
  this.hot.runHooks('afterTrimRow', currentTrimConfig, destinationTrimConfig, isValidConfig, isValidConfig && destinationTrimConfig.length > currentTrimConfig.length);
263
263
  }
264
264
  /**
265
- * Trims the row provided as physical row index (counting from 0).
265
+ * Trims the row provided as a physical row index (counting from 0).
266
266
  *
267
267
  * @param {...number} row Physical row index.
268
268
  */
@@ -321,7 +321,7 @@ var TrimRows = /*#__PURE__*/function (_BasePlugin) {
321
321
  this.hot.runHooks('afterUntrimRow', currentTrimConfig, destinationTrimConfig, isValidConfig && isAnyRowUntrimmed, isValidConfig && destinationTrimConfig.length < currentTrimConfig.length);
322
322
  }
323
323
  /**
324
- * Untrims the row provided as row index (counting from 0).
324
+ * Untrims the row provided as a physical row index (counting from 0).
325
325
  *
326
326
  * @param {...number} row Physical row index.
327
327
  */
@@ -357,7 +357,7 @@ var TrimRows = /*#__PURE__*/function (_BasePlugin) {
357
357
  this.untrimRows(this.getTrimmedRows());
358
358
  }
359
359
  /**
360
- * Get if trim config is valid. Check whether all of the provided row indexes are within source data.
360
+ * Get if trim config is valid. Check whether all of the provided physical row indexes are within source data.
361
361
  *
362
362
  * @param {Array} trimmedRows List of physical row indexes.
363
363
  * @returns {boolean}
@@ -234,7 +234,7 @@ export var TrimRows = /*#__PURE__*/function (_BasePlugin) {
234
234
  this.hot.runHooks('afterTrimRow', currentTrimConfig, destinationTrimConfig, isValidConfig, isValidConfig && destinationTrimConfig.length > currentTrimConfig.length);
235
235
  }
236
236
  /**
237
- * Trims the row provided as physical row index (counting from 0).
237
+ * Trims the row provided as a physical row index (counting from 0).
238
238
  *
239
239
  * @param {...number} row Physical row index.
240
240
  */
@@ -293,7 +293,7 @@ export var TrimRows = /*#__PURE__*/function (_BasePlugin) {
293
293
  this.hot.runHooks('afterUntrimRow', currentTrimConfig, destinationTrimConfig, isValidConfig && isAnyRowUntrimmed, isValidConfig && destinationTrimConfig.length < currentTrimConfig.length);
294
294
  }
295
295
  /**
296
- * Untrims the row provided as row index (counting from 0).
296
+ * Untrims the row provided as a physical row index (counting from 0).
297
297
  *
298
298
  * @param {...number} row Physical row index.
299
299
  */
@@ -329,7 +329,7 @@ export var TrimRows = /*#__PURE__*/function (_BasePlugin) {
329
329
  this.untrimRows(this.getTrimmedRows());
330
330
  }
331
331
  /**
332
- * Get if trim config is valid. Check whether all of the provided row indexes are within source data.
332
+ * Get if trim config is valid. Check whether all of the provided physical row indexes are within source data.
333
333
  *
334
334
  * @param {Array} trimmedRows List of physical row indexes.
335
335
  * @returns {boolean}
@@ -6,8 +6,6 @@ exports.numericRenderer = numericRenderer;
6
6
 
7
7
  require("core-js/modules/es.regexp.exec.js");
8
8
 
9
- require("core-js/modules/es.string.split.js");
10
-
11
9
  require("core-js/modules/es.string.replace.js");
12
10
 
13
11
  require("core-js/modules/es.array.index-of.js");
@@ -1,5 +1,4 @@
1
1
  import "core-js/modules/es.regexp.exec.js";
2
- import "core-js/modules/es.string.split.js";
3
2
  import "core-js/modules/es.string.replace.js";
4
3
  import "core-js/modules/es.array.index-of.js";
5
4
  import "core-js/modules/es.array.join.js";
@@ -39,7 +39,7 @@ function textRenderer(instance, TD, row, col, prop, value, cellProperties) {
39
39
 
40
40
  escaped = (0, _mixed.stringify)(escaped);
41
41
 
42
- if (instance.getSettings().trimWhitespace) {
42
+ if (cellProperties.trimWhitespace) {
43
43
  escaped = escaped.trim();
44
44
  }
45
45
 
@@ -26,7 +26,7 @@ export function textRenderer(instance, TD, row, col, prop, value, cellProperties
26
26
 
27
27
  escaped = stringify(escaped);
28
28
 
29
- if (instance.getSettings().trimWhitespace) {
29
+ if (cellProperties.trimWhitespace) {
30
30
  escaped = escaped.trim();
31
31
  }
32
32
 
@@ -15,6 +15,8 @@ var _utils = require("./utils");
15
15
 
16
16
  var _event = require("../helpers/dom/event");
17
17
 
18
+ var _element = require("../helpers/dom/element");
19
+
18
20
  var _browser = require("../helpers/browser");
19
21
 
20
22
  var MODIFIER_KEYS = ['meta', 'alt', 'shift', 'control'];
@@ -95,9 +97,11 @@ function useRecorder(ownerWindow, handleEvent, beforeKeyDown, afterKeyDown, call
95
97
  return;
96
98
  }
97
99
 
98
- var result = beforeKeyDown(event);
100
+ var result = beforeKeyDown(event); // keyCode 229 aka 'uninitialized' doesn't take into account with editors. This key code is
101
+ // produced when unfinished character is entering using the IME editor. It is fired on macOS,
102
+ // Windows and linux (ubuntu) with installed ibus-pinyin package.
99
103
 
100
- if (result === false || (0, _event.isImmediatePropagationStopped)(event)) {
104
+ if (event.keyCode === 229 || result === false || (0, _event.isImmediatePropagationStopped)(event)) {
101
105
  return;
102
106
  }
103
107
 
@@ -160,10 +164,10 @@ function useRecorder(ownerWindow, handleEvent, beforeKeyDown, afterKeyDown, call
160
164
  var eventTarget = ownerWindow;
161
165
 
162
166
  while (eventTarget) {
163
- eventTarget.addEventListener('keydown', onkeydown);
164
- eventTarget.addEventListener('keyup', onkeyup);
165
- eventTarget.addEventListener('blur', onblur);
166
- eventTarget = eventTarget.frameElement;
167
+ eventTarget.document.documentElement.addEventListener('keydown', onkeydown);
168
+ eventTarget.document.documentElement.addEventListener('keyup', onkeyup);
169
+ eventTarget.document.documentElement.addEventListener('blur', onblur);
170
+ eventTarget = (0, _element.getParentWindow)(eventTarget);
167
171
  }
168
172
  };
169
173
  /**
@@ -175,10 +179,10 @@ function useRecorder(ownerWindow, handleEvent, beforeKeyDown, afterKeyDown, call
175
179
  var eventTarget = ownerWindow;
176
180
 
177
181
  while (eventTarget) {
178
- eventTarget.removeEventListener('keydown', onkeydown);
179
- eventTarget.removeEventListener('keyup', onkeyup);
180
- eventTarget.removeEventListener('blur', onblur);
181
- eventTarget = eventTarget.frameElement;
182
+ eventTarget.document.documentElement.removeEventListener('keydown', onkeydown);
183
+ eventTarget.document.documentElement.removeEventListener('keyup', onkeyup);
184
+ eventTarget.document.documentElement.removeEventListener('blur', onblur);
185
+ eventTarget = (0, _element.getParentWindow)(eventTarget);
182
186
  }
183
187
  };
184
188
 
@@ -4,6 +4,7 @@ import "core-js/modules/es.string.includes.js";
4
4
  import { createKeysObserver } from "./keyObserver.mjs";
5
5
  import { normalizeEventKey } from "./utils.mjs";
6
6
  import { isImmediatePropagationStopped } from "../helpers/dom/event.mjs";
7
+ import { getParentWindow } from "../helpers/dom/element.mjs";
7
8
  import { isMacOS } from "../helpers/browser.mjs";
8
9
  var MODIFIER_KEYS = ['meta', 'alt', 'shift', 'control'];
9
10
  var modifierKeysObserver = createKeysObserver();
@@ -83,9 +84,11 @@ export function useRecorder(ownerWindow, handleEvent, beforeKeyDown, afterKeyDow
83
84
  return;
84
85
  }
85
86
 
86
- var result = beforeKeyDown(event);
87
+ var result = beforeKeyDown(event); // keyCode 229 aka 'uninitialized' doesn't take into account with editors. This key code is
88
+ // produced when unfinished character is entering using the IME editor. It is fired on macOS,
89
+ // Windows and linux (ubuntu) with installed ibus-pinyin package.
87
90
 
88
- if (result === false || isImmediatePropagationStopped(event)) {
91
+ if (event.keyCode === 229 || result === false || isImmediatePropagationStopped(event)) {
89
92
  return;
90
93
  }
91
94
 
@@ -148,10 +151,10 @@ export function useRecorder(ownerWindow, handleEvent, beforeKeyDown, afterKeyDow
148
151
  var eventTarget = ownerWindow;
149
152
 
150
153
  while (eventTarget) {
151
- eventTarget.addEventListener('keydown', onkeydown);
152
- eventTarget.addEventListener('keyup', onkeyup);
153
- eventTarget.addEventListener('blur', onblur);
154
- eventTarget = eventTarget.frameElement;
154
+ eventTarget.document.documentElement.addEventListener('keydown', onkeydown);
155
+ eventTarget.document.documentElement.addEventListener('keyup', onkeyup);
156
+ eventTarget.document.documentElement.addEventListener('blur', onblur);
157
+ eventTarget = getParentWindow(eventTarget);
155
158
  }
156
159
  };
157
160
  /**
@@ -163,10 +166,10 @@ export function useRecorder(ownerWindow, handleEvent, beforeKeyDown, afterKeyDow
163
166
  var eventTarget = ownerWindow;
164
167
 
165
168
  while (eventTarget) {
166
- eventTarget.removeEventListener('keydown', onkeydown);
167
- eventTarget.removeEventListener('keyup', onkeyup);
168
- eventTarget.removeEventListener('blur', onblur);
169
- eventTarget = eventTarget.frameElement;
169
+ eventTarget.document.documentElement.removeEventListener('keydown', onkeydown);
170
+ eventTarget.document.documentElement.removeEventListener('keyup', onkeyup);
171
+ eventTarget.document.documentElement.removeEventListener('blur', onblur);
172
+ eventTarget = getParentWindow(eventTarget);
170
173
  }
171
174
  };
172
175
 
@@ -19,10 +19,6 @@ require("core-js/modules/es.array.sort.js");
19
19
 
20
20
  require("core-js/modules/es.array.map.js");
21
21
 
22
- require("core-js/modules/es.regexp.exec.js");
23
-
24
- require("core-js/modules/es.string.split.js");
25
-
26
22
  // This file handles key-name discrepancies between browsers.
27
23
  // For the list of discrepancies, go to: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.
28
24
  var mappings = new Map([[' ', 'space'], // custom mapping
@@ -6,8 +6,6 @@ import "core-js/modules/web.dom-collections.iterator.js";
6
6
  import "core-js/modules/es.array.join.js";
7
7
  import "core-js/modules/es.array.sort.js";
8
8
  import "core-js/modules/es.array.map.js";
9
- import "core-js/modules/es.regexp.exec.js";
10
- import "core-js/modules/es.string.split.js";
11
9
  // This file handles key-name discrepancies between browsers.
12
10
  // For the list of discrepancies, go to: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.
13
11
  var mappings = new Map([[' ', 'space'], // custom mapping
@@ -486,9 +486,9 @@ var IndexMapper = /*#__PURE__*/function () {
486
486
  * point when handled index is NOT hidden.
487
487
  * @param {number} incrementBy We are searching for a next visible indexes by increasing (to be precise, or decreasing) indexes.
488
488
  * This variable represent indexes shift. We are looking for an index:
489
- * - for rows: from the left to the right (increasing indexes, then variable should have value 1) or
489
+ * - for rows: from the top to the bottom (increasing indexes, then variable should have value 1) or
490
490
  * other way around (decreasing indexes, then variable should have the value -1)
491
- * - for columns: from the top to the bottom (increasing indexes, then variable should have value 1)
491
+ * - for columns: from the left to the right (increasing indexes, then variable should have value 1)
492
492
  * or other way around (decreasing indexes, then variable should have the value -1).
493
493
  * @param {boolean} searchAlsoOtherWayAround The argument determine if an additional other way around search should be
494
494
  * performed, when the search in the first direction had no effect in finding visual index.