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
@@ -8,25 +8,19 @@ require("core-js/modules/es.reflect.get.js");
8
8
 
9
9
  require("core-js/modules/es.object.get-own-property-descriptor.js");
10
10
 
11
- require("core-js/modules/es.symbol.js");
12
-
13
- require("core-js/modules/es.symbol.description.js");
14
-
15
- require("core-js/modules/es.symbol.iterator.js");
16
-
17
11
  require("core-js/modules/es.array.iterator.js");
18
12
 
19
13
  require("core-js/modules/es.string.iterator.js");
20
14
 
21
- require("core-js/modules/web.dom-collections.iterator.js");
15
+ require("core-js/modules/es.weak-map.js");
22
16
 
23
- require("core-js/modules/es.array.from.js");
17
+ require("core-js/modules/web.dom-collections.iterator.js");
24
18
 
25
- require("core-js/modules/es.array.slice.js");
19
+ require("core-js/modules/es.symbol.js");
26
20
 
27
- require("core-js/modules/es.regexp.exec.js");
21
+ require("core-js/modules/es.symbol.description.js");
28
22
 
29
- require("core-js/modules/es.weak-map.js");
23
+ require("core-js/modules/es.symbol.iterator.js");
30
24
 
31
25
  exports.__esModule = true;
32
26
  exports.default = void 0;
@@ -73,18 +67,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
73
67
 
74
68
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
75
69
 
76
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
77
-
78
- 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."); }
79
-
80
- 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); }
81
-
82
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
83
-
84
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
85
-
86
- 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; }
87
-
88
70
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
89
71
 
90
72
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -344,14 +326,14 @@ var ConditionComponent = /*#__PURE__*/function (_BaseComponent) {
344
326
  }, {
345
327
  key: "reset",
346
328
  value: function reset() {
347
- var _this$hot;
329
+ var selectedColumn = this.hot.getPlugin('filters').getSelectedColumn();
330
+ var items = [(0, _conditionRegisterer.getConditionDescriptor)(_constants2.CONDITION_NONE)];
348
331
 
349
- var lastSelectedColumn = this.hot.getPlugin('filters').getSelectedColumn();
350
- var visualIndex = lastSelectedColumn && lastSelectedColumn.visualIndex;
351
-
352
- var columnType = (_this$hot = this.hot).getDataType.apply(_this$hot, _toConsumableArray(this.hot.getSelectedLast() || [0, visualIndex]));
332
+ if (selectedColumn !== null) {
333
+ var visualIndex = selectedColumn.visualIndex;
334
+ items = (0, _constants2.default)(this.hot.getDataType(0, visualIndex, this.hot.countRows(), visualIndex));
335
+ }
353
336
 
354
- var items = (0, _constants2.default)(columnType);
355
337
  (0, _array.arrayEach)(this.getInputElements(), function (element) {
356
338
  return element.hide();
357
339
  });
@@ -1,17 +1,5 @@
1
1
  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); }
2
2
 
3
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
-
5
- 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."); }
6
-
7
- 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); }
8
-
9
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
-
11
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12
-
13
- 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; }
14
-
15
3
  import "core-js/modules/es.function.name.js";
16
4
  import "core-js/modules/es.string.starts-with.js";
17
5
  import "core-js/modules/web.timers.js";
@@ -28,9 +16,6 @@ import "core-js/modules/es.symbol.iterator.js";
28
16
  import "core-js/modules/es.array.iterator.js";
29
17
  import "core-js/modules/es.string.iterator.js";
30
18
  import "core-js/modules/web.dom-collections.iterator.js";
31
- import "core-js/modules/es.array.from.js";
32
- import "core-js/modules/es.array.slice.js";
33
- import "core-js/modules/es.regexp.exec.js";
34
19
 
35
20
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
36
21
 
@@ -303,14 +288,14 @@ var ConditionComponent = /*#__PURE__*/function (_BaseComponent) {
303
288
  }, {
304
289
  key: "reset",
305
290
  value: function reset() {
306
- var _this$hot;
291
+ var selectedColumn = this.hot.getPlugin('filters').getSelectedColumn();
292
+ var items = [getConditionDescriptor(CONDITION_NONE)];
307
293
 
308
- var lastSelectedColumn = this.hot.getPlugin('filters').getSelectedColumn();
309
- var visualIndex = lastSelectedColumn && lastSelectedColumn.visualIndex;
310
-
311
- var columnType = (_this$hot = this.hot).getDataType.apply(_this$hot, _toConsumableArray(this.hot.getSelectedLast() || [0, visualIndex]));
294
+ if (selectedColumn !== null) {
295
+ var visualIndex = selectedColumn.visualIndex;
296
+ items = getOptionsList(this.hot.getDataType(0, visualIndex, this.hot.countRows(), visualIndex));
297
+ }
312
298
 
313
- var items = getOptionsList(columnType);
314
299
  arrayEach(this.getInputElements(), function (element) {
315
300
  return element.hide();
316
301
  });
@@ -308,8 +308,11 @@ var ValueComponent = /*#__PURE__*/function (_BaseComponent) {
308
308
  _get(_getPrototypeOf(ValueComponent.prototype), "reset", this).call(this);
309
309
 
310
310
  this.getMultipleSelectElement().setValue(values);
311
- var lastSelectedColumn = this.hot.getPlugin('filters').getSelectedColumn().visualIndex;
312
- this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0, lastSelectedColumn).locale);
311
+ var selectedColumn = this.hot.getPlugin('filters').getSelectedColumn();
312
+
313
+ if (selectedColumn !== null) {
314
+ this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0, selectedColumn.visualIndex).locale);
315
+ }
313
316
  }
314
317
  /**
315
318
  * Key down listener.
@@ -336,9 +339,13 @@ var ValueComponent = /*#__PURE__*/function (_BaseComponent) {
336
339
  }, {
337
340
  key: "_getColumnVisibleValues",
338
341
  value: function _getColumnVisibleValues() {
339
- var lastSelectedColumn = this.hot.getPlugin('filters').getSelectedColumn();
340
- var visualIndex = lastSelectedColumn && lastSelectedColumn.visualIndex;
341
- return (0, _array.arrayMap)(this.hot.getDataAtCol(visualIndex), function (v) {
342
+ var selectedColumn = this.hot.getPlugin('filters').getSelectedColumn();
343
+
344
+ if (selectedColumn === null) {
345
+ return [];
346
+ }
347
+
348
+ return (0, _array.arrayMap)(this.hot.getDataAtCol(selectedColumn.visualIndex), function (v) {
342
349
  return (0, _utils.toEmptyString)(v);
343
350
  });
344
351
  }
@@ -270,8 +270,11 @@ var ValueComponent = /*#__PURE__*/function (_BaseComponent) {
270
270
  _get(_getPrototypeOf(ValueComponent.prototype), "reset", this).call(this);
271
271
 
272
272
  this.getMultipleSelectElement().setValue(values);
273
- var lastSelectedColumn = this.hot.getPlugin('filters').getSelectedColumn().visualIndex;
274
- this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0, lastSelectedColumn).locale);
273
+ var selectedColumn = this.hot.getPlugin('filters').getSelectedColumn();
274
+
275
+ if (selectedColumn !== null) {
276
+ this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0, selectedColumn.visualIndex).locale);
277
+ }
275
278
  }
276
279
  /**
277
280
  * Key down listener.
@@ -298,9 +301,13 @@ var ValueComponent = /*#__PURE__*/function (_BaseComponent) {
298
301
  }, {
299
302
  key: "_getColumnVisibleValues",
300
303
  value: function _getColumnVisibleValues() {
301
- var lastSelectedColumn = this.hot.getPlugin('filters').getSelectedColumn();
302
- var visualIndex = lastSelectedColumn && lastSelectedColumn.visualIndex;
303
- return arrayMap(this.hot.getDataAtCol(visualIndex), function (v) {
304
+ var selectedColumn = this.hot.getPlugin('filters').getSelectedColumn();
305
+
306
+ if (selectedColumn === null) {
307
+ return [];
308
+ }
309
+
310
+ return arrayMap(this.hot.getDataAtCol(selectedColumn.visualIndex), function (v) {
304
311
  return toEmptyString(v);
305
312
  });
306
313
  }
@@ -51,6 +51,6 @@ export declare class Filters extends BasePlugin {
51
51
  removeConditions(column: number): void;
52
52
  clearConditions(column?: number): void;
53
53
  filter(): void;
54
- getSelectedColumn(): number;
54
+ getSelectedColumn(): { physicalIndex: number, visualIndex: number } | null;
55
55
  getDataMapAtColumn(column?: number): CellLikeData[];
56
56
  }
@@ -353,7 +353,6 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
353
353
  this.components.forEach(function (component) {
354
354
  return component.show();
355
355
  });
356
- this.registerEvents();
357
356
  this.addHook('beforeDropdownMenuSetItems', function (items) {
358
357
  return _this2.onBeforeDropdownMenuSetItems(items);
359
358
  });
@@ -377,21 +376,6 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
377
376
 
378
377
  _get(_getPrototypeOf(Filters.prototype), "enablePlugin", this).call(this);
379
378
  }
380
- /**
381
- * Registers the DOM listeners.
382
- *
383
- * @private
384
- */
385
-
386
- }, {
387
- key: "registerEvents",
388
- value: function registerEvents() {
389
- var _this3 = this;
390
-
391
- this.eventManager.addEventListener(this.hot.rootElement, 'click', function (event) {
392
- return _this3.onTableClick(event);
393
- });
394
- }
395
379
  /**
396
380
  * Disables the plugin functionality for this Handsontable instance.
397
381
  */
@@ -399,7 +383,7 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
399
383
  }, {
400
384
  key: "disablePlugin",
401
385
  value: function disablePlugin() {
402
- var _this4 = this;
386
+ var _this3 = this;
403
387
 
404
388
  if (this.enabled) {
405
389
  var _this$dropdownMenuPlu;
@@ -411,7 +395,7 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
411
395
  this.components.forEach(function (component, key) {
412
396
  component.destroy();
413
397
 
414
- _this4.components.set(key, null);
398
+ _this3.components.set(key, null);
415
399
  });
416
400
  this.conditionCollection.destroy();
417
401
  this.conditionCollection = null;
@@ -544,7 +528,7 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
544
528
  }, {
545
529
  key: "filter",
546
530
  value: function filter() {
547
- var _this5 = this;
531
+ var _this4 = this;
548
532
 
549
533
  var dataFilter = this._createDataFilter();
550
534
 
@@ -557,19 +541,19 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
557
541
  if (needToFilter) {
558
542
  var trimmedRows = [];
559
543
  this.hot.batchExecution(function () {
560
- _this5.filtersRowsMap.clear();
544
+ _this4.filtersRowsMap.clear();
561
545
 
562
546
  visibleVisualRows = (0, _array.arrayMap)(dataFilter.filter(), function (rowData) {
563
547
  return rowData.meta.visualRow;
564
548
  });
565
549
  var visibleVisualRowsAssertion = (0, _utils.createArrayAssertion)(visibleVisualRows);
566
- (0, _number.rangeEach)(_this5.hot.countSourceRows() - 1, function (row) {
550
+ (0, _number.rangeEach)(_this4.hot.countSourceRows() - 1, function (row) {
567
551
  if (!visibleVisualRowsAssertion(row)) {
568
552
  trimmedRows.push(row);
569
553
  }
570
554
  });
571
555
  (0, _array.arrayEach)(trimmedRows, function (physicalRow) {
572
- _this5.filtersRowsMap.setValueAtIndex(physicalRow, true);
556
+ _this4.filtersRowsMap.setValueAtIndex(physicalRow, true);
573
557
  });
574
558
  }, true);
575
559
 
@@ -589,14 +573,26 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
589
573
  /**
590
574
  * Gets last selected column index.
591
575
  *
592
- * @returns {object|null} Return `null` when column isn't selected otherwise
593
- * object containing information about selected column with keys `visualIndex` and `physicalIndex`.
576
+ * @returns {{visualIndex: number, physicalIndex: number} | null} Returns `null` when a column is
577
+ * not selected. Otherwise, returns an object with `visualIndex` and `physicalIndex` properties containing
578
+ * the index of the column.
594
579
  */
595
580
 
596
581
  }, {
597
582
  key: "getSelectedColumn",
598
583
  value: function getSelectedColumn() {
599
- return this.lastSelectedColumn;
584
+ var _this$hot$getSelected;
585
+
586
+ var highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
587
+
588
+ if (!highlight) {
589
+ return null;
590
+ }
591
+
592
+ return {
593
+ visualIndex: highlight.col,
594
+ physicalIndex: this.hot.toPhysicalColumn(highlight.col)
595
+ };
600
596
  }
601
597
  /**
602
598
  * Clears column selection.
@@ -607,12 +603,10 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
607
603
  }, {
608
604
  key: "clearColumnSelection",
609
605
  value: function clearColumnSelection() {
610
- var _this$hot$getSelected;
606
+ var selectedColumn = this.getSelectedColumn();
611
607
 
612
- var coords = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.getTopStartCorner();
613
-
614
- if (coords !== void 0) {
615
- this.hot.selectCell(coords.row, coords.col);
608
+ if (selectedColumn !== null) {
609
+ this.hot.selectCell(0, selectedColumn.visualIndex);
616
610
  }
617
611
  }
618
612
  /**
@@ -625,24 +619,24 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
625
619
  }, {
626
620
  key: "getDataMapAtColumn",
627
621
  value: function getDataMapAtColumn(column) {
628
- var _this6 = this;
622
+ var _this5 = this;
629
623
 
630
624
  var visualColumn = this.hot.toVisualColumn(column);
631
625
  var data = [];
632
626
  (0, _array.arrayEach)(this.hot.getSourceDataAtCol(visualColumn), function (value, rowIndex) {
633
- var _this6$hot$getDataAtC;
634
-
635
- var _this6$hot$getCellMet = _this6.hot.getCellMeta(rowIndex, visualColumn),
636
- row = _this6$hot$getCellMet.row,
637
- col = _this6$hot$getCellMet.col,
638
- visualCol = _this6$hot$getCellMet.visualCol,
639
- visualRow = _this6$hot$getCellMet.visualRow,
640
- type = _this6$hot$getCellMet.type,
641
- instance = _this6$hot$getCellMet.instance,
642
- dateFormat = _this6$hot$getCellMet.dateFormat,
643
- locale = _this6$hot$getCellMet.locale;
644
-
645
- var dataValue = (_this6$hot$getDataAtC = _this6.hot.getDataAtCell(_this6.hot.toVisualRow(rowIndex), visualColumn)) !== null && _this6$hot$getDataAtC !== void 0 ? _this6$hot$getDataAtC : value;
627
+ var _this5$hot$getDataAtC;
628
+
629
+ var _this5$hot$getCellMet = _this5.hot.getCellMeta(rowIndex, visualColumn),
630
+ row = _this5$hot$getCellMet.row,
631
+ col = _this5$hot$getCellMet.col,
632
+ visualCol = _this5$hot$getCellMet.visualCol,
633
+ visualRow = _this5$hot$getCellMet.visualRow,
634
+ type = _this5$hot$getCellMet.type,
635
+ instance = _this5$hot$getCellMet.instance,
636
+ dateFormat = _this5$hot$getCellMet.dateFormat,
637
+ locale = _this5$hot$getCellMet.locale;
638
+
639
+ var dataValue = (_this5$hot$getDataAtC = _this5.hot.getDataAtCell(_this5.hot.toVisualRow(rowIndex), visualColumn)) !== null && _this5$hot$getDataAtC !== void 0 ? _this5$hot$getDataAtC : value;
646
640
  data.push({
647
641
  meta: {
648
642
  row: row,
@@ -669,17 +663,17 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
669
663
  }, {
670
664
  key: "onAfterChange",
671
665
  value: function onAfterChange(changes) {
672
- var _this7 = this;
666
+ var _this6 = this;
673
667
 
674
668
  if (changes) {
675
669
  (0, _array.arrayEach)(changes, function (change) {
676
670
  var _change = _slicedToArray(change, 2),
677
671
  prop = _change[1];
678
672
 
679
- var columnIndex = _this7.hot.propToCol(prop);
673
+ var columnIndex = _this6.hot.propToCol(prop);
680
674
 
681
- if (_this7.conditionCollection.hasConditions(columnIndex)) {
682
- _this7.updateValueComponentCondition(columnIndex);
675
+ if (_this6.conditionCollection.hasConditions(columnIndex)) {
676
+ _this6.updateValueComponentCondition(columnIndex);
683
677
  }
684
678
  });
685
679
  }
@@ -752,11 +746,11 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
752
746
  }, {
753
747
  key: "onBeforeDropdownMenuSetItems",
754
748
  value: function onBeforeDropdownMenuSetItems() {
755
- var _this8 = this;
749
+ var _this7 = this;
756
750
 
757
751
  if (this.dropdownMenuPlugin) {
758
752
  this.dropdownMenuPlugin.menu.addLocalHook('afterOpen', function () {
759
- _this8.dropdownMenuPlugin.menu.hotMenu.updateSettings({
753
+ _this7.dropdownMenuPlugin.menu.hotMenu.updateSettings({
760
754
  hiddenRows: true
761
755
  });
762
756
  });
@@ -815,10 +809,19 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
815
809
  }, {
816
810
  key: "onActionBarSubmit",
817
811
  value: function onActionBarSubmit(submitType) {
812
+ var _this$dropdownMenuPlu3;
813
+
818
814
  if (submitType === 'accept') {
819
- var _this$getSelectedColu2;
815
+ var selectedColumn = this.getSelectedColumn();
820
816
 
821
- var physicalIndex = (_this$getSelectedColu2 = this.getSelectedColumn()) === null || _this$getSelectedColu2 === void 0 ? void 0 : _this$getSelectedColu2.physicalIndex;
817
+ if (selectedColumn === null) {
818
+ var _this$dropdownMenuPlu2;
819
+
820
+ (_this$dropdownMenuPlu2 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu2 === void 0 ? void 0 : _this$dropdownMenuPlu2.close();
821
+ return;
822
+ }
823
+
824
+ var physicalIndex = selectedColumn.physicalIndex;
822
825
  var byConditionState1 = this.components.get('filter_by_condition').getState();
823
826
  var byConditionState2 = this.components.get('filter_by_condition2').getState();
824
827
  var byValueState = this.components.get('filter_by_value').getState();
@@ -852,9 +855,7 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
852
855
  this.filter();
853
856
  }
854
857
 
855
- if (this.dropdownMenuPlugin) {
856
- this.dropdownMenuPlugin.close();
857
- }
858
+ (_this$dropdownMenuPlu3 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu3 === void 0 ? void 0 : _this$dropdownMenuPlu3.close();
858
859
  }
859
860
  /**
860
861
  * On component change listener.
@@ -939,27 +940,6 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
939
940
  (0, _element.removeClass)(TH, 'htFiltersActive');
940
941
  }
941
942
  }
942
- /**
943
- * On table click listener.
944
- *
945
- * @private
946
- * @param {Event} event DOM Event.
947
- */
948
-
949
- }, {
950
- key: "onTableClick",
951
- value: function onTableClick(event) {
952
- var th = (0, _element.closest)(event.target, 'TH');
953
-
954
- if (th) {
955
- var visualIndex = this.hot.getCoords(th).col;
956
- var physicalIndex = this.hot.toPhysicalColumn(visualIndex);
957
- this.lastSelectedColumn = {
958
- visualIndex: visualIndex,
959
- physicalIndex: physicalIndex
960
- };
961
- }
962
- }
963
943
  /**
964
944
  * Creates DataFilter instance based on condition collection.
965
945
  *
@@ -971,11 +951,11 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
971
951
  }, {
972
952
  key: "_createDataFilter",
973
953
  value: function _createDataFilter() {
974
- var _this9 = this;
954
+ var _this8 = this;
975
955
 
976
956
  var conditionCollection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.conditionCollection;
977
957
  return new _dataFilter.default(conditionCollection, function (physicalColumn) {
978
- return _this9.getDataMapAtColumn(physicalColumn);
958
+ return _this8.getDataMapAtColumn(physicalColumn);
979
959
  });
980
960
  }
981
961
  /**
@@ -990,9 +970,9 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
990
970
  }, {
991
971
  key: "updateComponents",
992
972
  value: function updateComponents(conditionsState) {
993
- var _this$dropdownMenuPlu2;
973
+ var _this$dropdownMenuPlu4;
994
974
 
995
- if (!((_this$dropdownMenuPlu2 = this.dropdownMenuPlugin) !== null && _this$dropdownMenuPlu2 !== void 0 && _this$dropdownMenuPlu2.enabled)) {
975
+ if (!((_this$dropdownMenuPlu4 = this.dropdownMenuPlugin) !== null && _this$dropdownMenuPlu4 !== void 0 && _this$dropdownMenuPlu4.enabled)) {
996
976
  return;
997
977
  }
998
978
 
@@ -1122,14 +1102,14 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
1122
1102
  }, {
1123
1103
  key: "destroy",
1124
1104
  value: function destroy() {
1125
- var _this10 = this;
1105
+ var _this9 = this;
1126
1106
 
1127
1107
  if (this.enabled) {
1128
1108
  this.components.forEach(function (component, key) {
1129
1109
  if (component !== null) {
1130
1110
  component.destroy();
1131
1111
 
1132
- _this10.components.set(key, null);
1112
+ _this9.components.set(key, null);
1133
1113
  }
1134
1114
  });
1135
1115
  this.conditionCollection.destroy();