handsontable 14.0.0-next-07c0a60-20231107 → 14.0.0-next-7ee54cb-20231108
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.
- package/3rdparty/SheetClip/SheetClip.js +2 -2
- package/3rdparty/SheetClip/SheetClip.mjs +2 -2
- package/3rdparty/autoResize/autoResize.js +2 -2
- package/3rdparty/autoResize/autoResize.mjs +2 -2
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +108 -85
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +108 -85
- package/3rdparty/walkontable/src/calculator/viewportRows.js +60 -52
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +60 -52
- package/3rdparty/walkontable/src/cell/coords.js +7 -5
- package/3rdparty/walkontable/src/cell/coords.mjs +7 -5
- package/3rdparty/walkontable/src/core/clone.js +6 -0
- package/3rdparty/walkontable/src/core/clone.mjs +6 -0
- package/3rdparty/walkontable/src/event.js +125 -74
- package/3rdparty/walkontable/src/event.mjs +125 -74
- package/3rdparty/walkontable/src/filter/column.js +16 -0
- package/3rdparty/walkontable/src/filter/column.mjs +16 -0
- package/3rdparty/walkontable/src/filter/row.js +16 -0
- package/3rdparty/walkontable/src/filter/row.mjs +16 -0
- package/3rdparty/walkontable/src/overlay/bottom.js +1 -1
- package/3rdparty/walkontable/src/overlay/bottom.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/top.js +1 -1
- package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/_base.js +12 -5
- package/3rdparty/walkontable/src/renderer/_base.mjs +12 -5
- package/3rdparty/walkontable/src/renderer/cells.js +6 -2
- package/3rdparty/walkontable/src/renderer/cells.mjs +6 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +6 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +6 -2
- package/3rdparty/walkontable/src/renderer/rows.js +5 -0
- package/3rdparty/walkontable/src/renderer/rows.mjs +5 -0
- package/3rdparty/walkontable/src/renderer/table.js +24 -17
- package/3rdparty/walkontable/src/renderer/table.mjs +24 -17
- package/3rdparty/walkontable/src/scroll.js +2 -2
- package/3rdparty/walkontable/src/scroll.mjs +2 -2
- package/3rdparty/walkontable/src/selection/border/border.js +1 -1
- package/3rdparty/walkontable/src/selection/border/border.mjs +1 -1
- package/3rdparty/walkontable/src/settings.js +10 -10
- package/3rdparty/walkontable/src/settings.mjs +10 -10
- package/3rdparty/walkontable/src/table.js +3 -3
- package/3rdparty/walkontable/src/table.mjs +3 -3
- package/3rdparty/walkontable/src/utils/column.js +19 -4
- package/3rdparty/walkontable/src/utils/column.mjs +19 -4
- package/3rdparty/walkontable/src/utils/nodesPool.js +5 -0
- package/3rdparty/walkontable/src/utils/nodesPool.mjs +5 -0
- package/3rdparty/walkontable/src/utils/orderView/view.js +13 -6
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +13 -6
- package/3rdparty/walkontable/src/utils/orderView/viewSize.js +9 -6
- package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +9 -6
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +7 -4
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +7 -4
- package/3rdparty/walkontable/src/utils/row.js +14 -2
- package/3rdparty/walkontable/src/utils/row.mjs +14 -2
- package/3rdparty/walkontable/src/viewport.js +9 -9
- package/3rdparty/walkontable/src/viewport.mjs +9 -9
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.js +31 -26
- package/core.mjs +31 -26
- package/dataMap/dataMap.js +99 -90
- package/dataMap/dataMap.mjs +99 -90
- package/dataMap/dataSource.js +14 -8
- package/dataMap/dataSource.mjs +14 -8
- package/dataMap/metaManager/lazyFactoryMap.js +19 -7
- package/dataMap/metaManager/lazyFactoryMap.mjs +19 -7
- package/dataMap/metaManager/metaLayers/cellMeta.js +8 -3
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +8 -3
- package/dataMap/metaManager/metaLayers/columnMeta.js +7 -1
- package/dataMap/metaManager/metaLayers/columnMeta.mjs +7 -1
- package/dataMap/metaManager/metaLayers/globalMeta.js +6 -1
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +6 -1
- package/dataMap/metaManager/metaLayers/tableMeta.js +6 -2
- package/dataMap/metaManager/metaLayers/tableMeta.mjs +6 -2
- package/dataMap/metaManager/metaSchema.js +55 -55
- package/dataMap/metaManager/metaSchema.mjs +55 -55
- package/dataMap/metaManager/mods/dynamicCellMeta.js +7 -2
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +7 -2
- package/dataMap/metaManager/mods/extendMetaProperties.js +8 -4
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +8 -4
- package/dataMap/metaManager/utils.js +2 -2
- package/dataMap/metaManager/utils.mjs +2 -2
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +7337 -6394
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +154 -154
- package/dist/handsontable.js +7336 -6393
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +28 -28
- package/editorManager.js +105 -95
- package/editorManager.mjs +105 -95
- package/editors/autocompleteEditor/autocompleteEditor.js +47 -46
- package/editors/autocompleteEditor/autocompleteEditor.mjs +46 -45
- package/editors/baseEditor/baseEditor.js +23 -26
- package/editors/baseEditor/baseEditor.mjs +23 -26
- package/editors/dateEditor/dateEditor.js +24 -15
- package/editors/dateEditor/dateEditor.mjs +24 -15
- package/editors/dropdownEditor/dropdownEditor.js +1 -1
- package/editors/dropdownEditor/dropdownEditor.mjs +1 -1
- package/editors/handsontableEditor/handsontableEditor.js +4 -4
- package/editors/handsontableEditor/handsontableEditor.mjs +4 -4
- package/editors/textEditor/textEditor.js +23 -17
- package/editors/textEditor/textEditor.mjs +24 -18
- package/eventManager.js +8 -0
- package/eventManager.mjs +8 -0
- package/helpers/array.js +2 -2
- package/helpers/array.mjs +2 -2
- package/helpers/dom/element.js +7 -7
- package/helpers/dom/element.mjs +7 -7
- package/helpers/function.js +1 -1
- package/helpers/function.mjs +1 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +4 -4
- package/helpers/object.mjs +4 -4
- package/helpers/string.js +1 -1
- package/helpers/string.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +0 -2
- package/pluginHooks.js +12 -3
- package/pluginHooks.mjs +12 -3
- package/plugins/autoColumnSize/autoColumnSize.js +141 -130
- package/plugins/autoColumnSize/autoColumnSize.mjs +140 -129
- package/plugins/autoRowSize/autoRowSize.js +112 -125
- package/plugins/autoRowSize/autoRowSize.mjs +110 -123
- package/plugins/autofill/autofill.js +98 -102
- package/plugins/autofill/autofill.mjs +97 -101
- package/plugins/base/base.js +61 -28
- package/plugins/base/base.mjs +60 -28
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +29 -24
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +28 -23
- package/plugins/collapsibleColumns/collapsibleColumns.js +104 -107
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +102 -104
- package/plugins/columnSorting/columnSorting.js +107 -99
- package/plugins/columnSorting/columnSorting.mjs +106 -98
- package/plugins/columnSorting/columnStatesManager.js +12 -6
- package/plugins/columnSorting/columnStatesManager.mjs +12 -6
- package/plugins/columnSummary/columnSummary.js +71 -58
- package/plugins/columnSummary/columnSummary.mjs +70 -57
- package/plugins/columnSummary/endpoints.js +20 -14
- package/plugins/columnSummary/endpoints.mjs +20 -14
- package/plugins/comments/commentEditor.js +30 -2
- package/plugins/comments/commentEditor.mjs +30 -2
- package/plugins/comments/comments.js +158 -169
- package/plugins/comments/comments.mjs +157 -168
- package/plugins/comments/displaySwitch.js +7 -3
- package/plugins/comments/displaySwitch.mjs +7 -3
- package/plugins/contextMenu/commandExecutor.js +15 -2
- package/plugins/contextMenu/commandExecutor.mjs +15 -2
- package/plugins/contextMenu/contextMenu.js +96 -102
- package/plugins/contextMenu/contextMenu.mjs +95 -101
- package/plugins/contextMenu/itemsFactory.js +19 -4
- package/plugins/contextMenu/itemsFactory.mjs +19 -4
- package/plugins/contextMenu/menu/cursor.js +36 -0
- package/plugins/contextMenu/menu/cursor.mjs +36 -0
- package/plugins/contextMenu/menu/menu.js +57 -5
- package/plugins/contextMenu/menu/menu.mjs +57 -5
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
- package/plugins/copyPaste/copyPaste.js +74 -75
- package/plugins/copyPaste/copyPaste.mjs +74 -75
- package/plugins/customBorders/customBorders.js +57 -50
- package/plugins/customBorders/customBorders.mjs +56 -49
- package/plugins/dragToScroll/dragToScroll.js +50 -54
- package/plugins/dragToScroll/dragToScroll.mjs +49 -52
- package/plugins/dropdownMenu/dropdownMenu.js +136 -131
- package/plugins/dropdownMenu/dropdownMenu.mjs +136 -131
- package/plugins/exportFile/dataProvider.js +7 -2
- package/plugins/exportFile/dataProvider.mjs +7 -2
- package/plugins/exportFile/exportFile.js +1 -1
- package/plugins/exportFile/exportFile.mjs +1 -1
- package/plugins/exportFile/types/_base.js +14 -6
- package/plugins/exportFile/types/_base.mjs +14 -6
- package/plugins/filters/component/actionBar.js +9 -0
- package/plugins/filters/component/actionBar.mjs +9 -0
- package/plugins/filters/component/condition.js +13 -0
- package/plugins/filters/component/condition.mjs +13 -0
- package/plugins/filters/component/operators.js +9 -0
- package/plugins/filters/component/operators.mjs +9 -0
- package/plugins/filters/component/value.js +9 -0
- package/plugins/filters/component/value.mjs +9 -0
- package/plugins/filters/conditionCollection.js +9 -4
- package/plugins/filters/conditionCollection.mjs +9 -4
- package/plugins/filters/conditionUpdateObserver.js +53 -42
- package/plugins/filters/conditionUpdateObserver.mjs +53 -42
- package/plugins/filters/dataFilter.js +9 -3
- package/plugins/filters/dataFilter.mjs +9 -3
- package/plugins/filters/filters.js +184 -189
- package/plugins/filters/filters.mjs +182 -187
- package/plugins/filters/ui/_base.js +1 -1
- package/plugins/filters/ui/_base.mjs +1 -1
- package/plugins/filters/utils.js +1 -1
- package/plugins/filters/utils.mjs +1 -1
- package/plugins/formulas/engine/settings.js +1 -1
- package/plugins/formulas/engine/settings.mjs +1 -1
- package/plugins/formulas/formulas.js +684 -602
- package/plugins/formulas/formulas.mjs +682 -600
- package/plugins/hiddenColumns/hiddenColumns.js +174 -169
- package/plugins/hiddenColumns/hiddenColumns.mjs +173 -168
- package/plugins/hiddenRows/hiddenRows.js +170 -165
- package/plugins/hiddenRows/hiddenRows.mjs +169 -164
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +66 -53
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +64 -51
- package/plugins/manualColumnMove/manualColumnMove.js +287 -232
- package/plugins/manualColumnMove/manualColumnMove.mjs +286 -231
- package/plugins/manualColumnMove/ui/_base.js +9 -3
- package/plugins/manualColumnMove/ui/_base.mjs +9 -3
- package/plugins/manualColumnResize/manualColumnResize.js +291 -246
- package/plugins/manualColumnResize/manualColumnResize.mjs +290 -244
- package/plugins/manualRowMove/manualRowMove.js +223 -208
- package/plugins/manualRowMove/manualRowMove.mjs +222 -207
- package/plugins/manualRowMove/ui/_base.js +10 -5
- package/plugins/manualRowMove/ui/_base.mjs +10 -5
- package/plugins/manualRowResize/manualRowResize.js +254 -209
- package/plugins/manualRowResize/manualRowResize.mjs +253 -207
- package/plugins/mergeCells/calculations/autofill.js +9 -3
- package/plugins/mergeCells/calculations/autofill.mjs +9 -3
- package/plugins/mergeCells/calculations/selection.js +10 -4
- package/plugins/mergeCells/calculations/selection.mjs +10 -4
- package/plugins/mergeCells/cellCoords.js +16 -6
- package/plugins/mergeCells/cellCoords.mjs +16 -6
- package/plugins/mergeCells/cellsCollection.js +10 -4
- package/plugins/mergeCells/cellsCollection.mjs +10 -4
- package/plugins/mergeCells/mergeCells.js +582 -502
- package/plugins/mergeCells/mergeCells.mjs +580 -500
- package/plugins/multiColumnSorting/multiColumnSorting.js +15 -11
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +15 -11
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +16 -28
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +16 -27
- package/plugins/nestedHeaders/nestedHeaders.js +542 -499
- package/plugins/nestedHeaders/nestedHeaders.mjs +554 -511
- package/plugins/nestedHeaders/stateManager/index.js +1 -1
- package/plugins/nestedHeaders/stateManager/index.mjs +1 -1
- package/plugins/nestedRows/data/dataManager.js +21 -15
- package/plugins/nestedRows/data/dataManager.mjs +21 -15
- package/plugins/nestedRows/nestedRows.js +328 -279
- package/plugins/nestedRows/nestedRows.mjs +327 -278
- package/plugins/nestedRows/ui/_base.js +7 -1
- package/plugins/nestedRows/ui/_base.mjs +7 -1
- package/plugins/nestedRows/ui/collapsing.js +2 -2
- package/plugins/nestedRows/ui/collapsing.mjs +2 -2
- package/plugins/nestedRows/ui/contextMenu.js +28 -18
- package/plugins/nestedRows/ui/contextMenu.mjs +28 -18
- package/plugins/nestedRows/utils/rowMoveController.js +12 -4
- package/plugins/nestedRows/utils/rowMoveController.mjs +12 -4
- package/plugins/persistentState/persistentState.js +14 -11
- package/plugins/persistentState/persistentState.mjs +14 -11
- package/plugins/persistentState/storage.js +11 -6
- package/plugins/persistentState/storage.mjs +11 -6
- package/plugins/registry.js +2 -2
- package/plugins/registry.mjs +2 -2
- package/plugins/search/search.js +57 -46
- package/plugins/search/search.mjs +56 -45
- package/plugins/touchScroll/touchScroll.js +102 -100
- package/plugins/touchScroll/touchScroll.mjs +100 -98
- package/plugins/trimRows/trimRows.js +33 -28
- package/plugins/trimRows/trimRows.mjs +32 -27
- package/plugins/undoRedo/undoRedo.js +2 -2
- package/plugins/undoRedo/undoRedo.mjs +2 -2
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +11 -11
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +11 -11
- package/renderers/baseRenderer/baseRenderer.js +2 -2
- package/renderers/baseRenderer/baseRenderer.mjs +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.js +23 -23
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +23 -23
- package/renderers/dateRenderer/dateRenderer.js +4 -4
- package/renderers/dateRenderer/dateRenderer.mjs +4 -4
- package/renderers/handsontableRenderer/handsontableRenderer.js +4 -4
- package/renderers/handsontableRenderer/handsontableRenderer.mjs +4 -4
- package/renderers/htmlRenderer/htmlRenderer.js +4 -4
- package/renderers/htmlRenderer/htmlRenderer.mjs +4 -4
- package/renderers/numericRenderer/numericRenderer.js +3 -3
- package/renderers/numericRenderer/numericRenderer.mjs +3 -3
- package/renderers/passwordRenderer/passwordRenderer.js +3 -3
- package/renderers/passwordRenderer/passwordRenderer.mjs +3 -3
- package/renderers/selectRenderer/selectRenderer.js +4 -4
- package/renderers/selectRenderer/selectRenderer.mjs +4 -4
- package/renderers/textRenderer/textRenderer.js +5 -5
- package/renderers/textRenderer/textRenderer.mjs +5 -5
- package/renderers/timeRenderer/timeRenderer.js +3 -3
- package/renderers/timeRenderer/timeRenderer.mjs +3 -3
- package/selection/highlight/highlight.js +1 -4
- package/selection/highlight/highlight.mjs +1 -4
- package/selection/range.js +12 -2
- package/selection/range.mjs +12 -2
- package/selection/selection.js +28 -10
- package/selection/selection.mjs +28 -10
- package/selection/utils.js +24 -14
- package/selection/utils.mjs +25 -15
- package/shortcuts/manager.js +1 -1
- package/shortcuts/manager.mjs +1 -1
- package/tableView.js +208 -200
- package/tableView.mjs +208 -200
- package/translations/changesObservable/utils.js +2 -2
- package/translations/changesObservable/utils.mjs +2 -2
- package/translations/indexMapper.js +25 -22
- package/translations/indexMapper.mjs +25 -22
- package/translations/mapCollections/aggregatedCollection.js +8 -2
- package/translations/mapCollections/aggregatedCollection.mjs +8 -2
- package/translations/mapCollections/mapCollection.js +5 -2
- package/translations/mapCollections/mapCollection.mjs +5 -2
- package/translations/maps/indexMap.js +6 -1
- package/translations/maps/indexMap.mjs +6 -1
- package/translations/maps/utils/physicallyIndexed.js +2 -2
- package/translations/maps/utils/physicallyIndexed.mjs +2 -2
- package/utils/dataStructures/linkedList.js +10 -6
- package/utils/dataStructures/linkedList.mjs +10 -6
- package/utils/dataStructures/queue.js +1 -1
- package/utils/dataStructures/queue.mjs +1 -1
- package/utils/dataStructures/stack.js +1 -1
- package/utils/dataStructures/stack.mjs +1 -1
- package/utils/ghostTable.js +2 -2
- package/utils/ghostTable.mjs +2 -2
- package/utils/interval.js +73 -36
- package/utils/interval.mjs +73 -36
- package/utils/parseTable.js +1 -1
- package/utils/parseTable.mjs +1 -1
- package/validators/autocompleteValidator/autocompleteValidator.js +1 -1
- package/validators/autocompleteValidator/autocompleteValidator.mjs +1 -1
- package/validators/dateValidator/dateValidator.js +1 -1
- package/validators/dateValidator/dateValidator.mjs +1 -1
- package/validators/numericValidator/numericValidator.js +1 -1
- package/validators/numericValidator/numericValidator.mjs +1 -1
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
require("core-js/modules/es.error.cause.js");
|
4
3
|
exports.__esModule = true;
|
5
4
|
require("core-js/modules/es.array.unscopables.flat.js");
|
6
5
|
require("core-js/modules/es.array.push.js");
|
6
|
+
require("core-js/modules/es.error.cause.js");
|
7
7
|
var _base = require("../base");
|
8
8
|
var _array = require("../../helpers/array");
|
9
9
|
var _templateLiteralTag = require("../../helpers/templateLiteralTag");
|
@@ -27,6 +27,7 @@ var _translations = require("../../translations");
|
|
27
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
28
28
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
29
29
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
30
|
+
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
30
31
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
31
32
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
32
33
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
@@ -37,6 +38,7 @@ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.
|
|
37
38
|
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
38
39
|
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
39
40
|
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
41
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
40
42
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'filters';
|
41
43
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 250;
|
42
44
|
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
@@ -77,6 +79,15 @@ const SHORTCUTS_GROUP = PLUGIN_KEY;
|
|
77
79
|
* :::
|
78
80
|
*/
|
79
81
|
var _menuFocusNavigator = /*#__PURE__*/new WeakMap();
|
82
|
+
var _onAfterChange = /*#__PURE__*/new WeakSet();
|
83
|
+
var _onAfterDropdownMenuShow = /*#__PURE__*/new WeakSet();
|
84
|
+
var _onAfterDropdownMenuHide = /*#__PURE__*/new WeakSet();
|
85
|
+
var _onAfterDropdownMenuDefaultOptions = /*#__PURE__*/new WeakSet();
|
86
|
+
var _onActionBarSubmit = /*#__PURE__*/new WeakSet();
|
87
|
+
var _onComponentChange = /*#__PURE__*/new WeakSet();
|
88
|
+
var _onSelectUIClosed = /*#__PURE__*/new WeakSet();
|
89
|
+
var _onAfterGetColHeader = /*#__PURE__*/new WeakSet();
|
90
|
+
var _updateComponents = /*#__PURE__*/new WeakSet();
|
80
91
|
class Filters extends _base.BasePlugin {
|
81
92
|
static get PLUGIN_KEY() {
|
82
93
|
return PLUGIN_KEY;
|
@@ -98,6 +109,59 @@ class Filters extends _base.BasePlugin {
|
|
98
109
|
constructor(hotInstance) {
|
99
110
|
super(hotInstance);
|
100
111
|
// One listener for the enable/disable functionality
|
112
|
+
/**
|
113
|
+
* It updates the components state. The state is triggered by ConditionUpdateObserver, which
|
114
|
+
* reacts to any condition added to the condition collection. It may be added through the UI
|
115
|
+
* components or by API call.
|
116
|
+
*
|
117
|
+
* @param {object} conditionsState An object with the state generated by UI components.
|
118
|
+
*/
|
119
|
+
_classPrivateMethodInitSpec(this, _updateComponents);
|
120
|
+
/**
|
121
|
+
* On after get column header listener.
|
122
|
+
*
|
123
|
+
* @param {number} col Visual column index.
|
124
|
+
* @param {HTMLTableCellElement} TH Header's TH element.
|
125
|
+
*/
|
126
|
+
_classPrivateMethodInitSpec(this, _onAfterGetColHeader);
|
127
|
+
/**
|
128
|
+
* On component SelectUI closed listener.
|
129
|
+
*/
|
130
|
+
_classPrivateMethodInitSpec(this, _onSelectUIClosed);
|
131
|
+
/**
|
132
|
+
* On component change listener.
|
133
|
+
*
|
134
|
+
* @param {BaseComponent} component Component inheriting BaseComponent.
|
135
|
+
* @param {object} command Menu item object (command).
|
136
|
+
*/
|
137
|
+
_classPrivateMethodInitSpec(this, _onComponentChange);
|
138
|
+
/**
|
139
|
+
* On action bar submit listener.
|
140
|
+
*
|
141
|
+
* @private
|
142
|
+
* @param {string} submitType The submit type.
|
143
|
+
*/
|
144
|
+
_classPrivateMethodInitSpec(this, _onActionBarSubmit);
|
145
|
+
/**
|
146
|
+
* After dropdown menu default options listener.
|
147
|
+
*
|
148
|
+
* @param {object} defaultOptions ContextMenu default item options.
|
149
|
+
*/
|
150
|
+
_classPrivateMethodInitSpec(this, _onAfterDropdownMenuDefaultOptions);
|
151
|
+
/**
|
152
|
+
* After dropdown menu hide listener.
|
153
|
+
*/
|
154
|
+
_classPrivateMethodInitSpec(this, _onAfterDropdownMenuHide);
|
155
|
+
/**
|
156
|
+
* After dropdown menu show listener.
|
157
|
+
*/
|
158
|
+
_classPrivateMethodInitSpec(this, _onAfterDropdownMenuShow);
|
159
|
+
/**
|
160
|
+
* `afterChange` listener.
|
161
|
+
*
|
162
|
+
* @param {Array} changes Array of changes.
|
163
|
+
*/
|
164
|
+
_classPrivateMethodInitSpec(this, _onAfterChange);
|
101
165
|
_defineProperty(this, "dropdownMenuPlugin", null);
|
102
166
|
/**
|
103
167
|
* Instance of {@link ConditionCollection}.
|
@@ -136,7 +200,7 @@ class Filters extends _base.BasePlugin {
|
|
136
200
|
writable: true,
|
137
201
|
value: void 0
|
138
202
|
});
|
139
|
-
this.hot.addHook('afterGetColHeader', (col, TH) => this.
|
203
|
+
this.hot.addHook('afterGetColHeader', (col, TH) => _classPrivateMethodGet(this, _onAfterGetColHeader, _onAfterGetColHeader2).call(this, col, TH));
|
140
204
|
}
|
141
205
|
|
142
206
|
/**
|
@@ -162,9 +226,9 @@ class Filters extends _base.BasePlugin {
|
|
162
226
|
const dropdownSettings = this.hot.getSettings().dropdownMenu;
|
163
227
|
const menuContainer = dropdownSettings && dropdownSettings.uiContainer || this.hot.rootDocument.body;
|
164
228
|
const addConfirmationHooks = component => {
|
165
|
-
component.addLocalHook('accept', () => this.
|
166
|
-
component.addLocalHook('cancel', () => this.
|
167
|
-
component.addLocalHook('change', command => this.
|
229
|
+
component.addLocalHook('accept', () => _classPrivateMethodGet(this, _onActionBarSubmit, _onActionBarSubmit2).call(this, 'accept'));
|
230
|
+
component.addLocalHook('cancel', () => _classPrivateMethodGet(this, _onActionBarSubmit, _onActionBarSubmit2).call(this, 'cancel'));
|
231
|
+
component.addLocalHook('change', command => _classPrivateMethodGet(this, _onComponentChange, _onComponentChange2).call(this, component, command));
|
168
232
|
return component;
|
169
233
|
};
|
170
234
|
const filterByConditionLabel = () => `${this.hot.getTranslatedPhrase(constants.FILTERS_DIVS_FILTER_BY_CONDITION)}:`;
|
@@ -176,7 +240,7 @@ class Filters extends _base.BasePlugin {
|
|
176
240
|
addSeparator: false,
|
177
241
|
menuContainer
|
178
242
|
});
|
179
|
-
conditionComponent.addLocalHook('afterClose', () => this.
|
243
|
+
conditionComponent.addLocalHook('afterClose', () => _classPrivateMethodGet(this, _onSelectUIClosed, _onSelectUIClosed2).call(this));
|
180
244
|
this.components.set('filter_by_condition', addConfirmationHooks(conditionComponent));
|
181
245
|
}
|
182
246
|
if (!this.components.get('filter_operators')) {
|
@@ -192,7 +256,7 @@ class Filters extends _base.BasePlugin {
|
|
192
256
|
addSeparator: true,
|
193
257
|
menuContainer
|
194
258
|
});
|
195
|
-
conditionComponent.addLocalHook('afterClose', () => this.
|
259
|
+
conditionComponent.addLocalHook('afterClose', () => _classPrivateMethodGet(this, _onSelectUIClosed, _onSelectUIClosed2).call(this));
|
196
260
|
this.components.set('filter_by_condition2', addConfirmationHooks(conditionComponent));
|
197
261
|
}
|
198
262
|
if (!this.components.get('filter_by_value')) {
|
@@ -212,13 +276,13 @@ class Filters extends _base.BasePlugin {
|
|
212
276
|
}
|
213
277
|
if (!this.conditionUpdateObserver) {
|
214
278
|
this.conditionUpdateObserver = new _conditionUpdateObserver.default(this.hot, this.conditionCollection, physicalColumn => this.getDataMapAtColumn(physicalColumn));
|
215
|
-
this.conditionUpdateObserver.addLocalHook('update', conditionState => this.
|
279
|
+
this.conditionUpdateObserver.addLocalHook('update', conditionState => _classPrivateMethodGet(this, _updateComponents, _updateComponents2).call(this, conditionState));
|
216
280
|
}
|
217
281
|
this.components.forEach(component => component.show());
|
218
|
-
this.addHook('afterDropdownMenuDefaultOptions', defaultOptions => this.
|
219
|
-
this.addHook('afterDropdownMenuShow', () => this.
|
220
|
-
this.addHook('afterDropdownMenuHide', () => this.
|
221
|
-
this.addHook('afterChange', changes => this.
|
282
|
+
this.addHook('afterDropdownMenuDefaultOptions', defaultOptions => _classPrivateMethodGet(this, _onAfterDropdownMenuDefaultOptions, _onAfterDropdownMenuDefaultOptions2).call(this, defaultOptions));
|
283
|
+
this.addHook('afterDropdownMenuShow', () => _classPrivateMethodGet(this, _onAfterDropdownMenuShow, _onAfterDropdownMenuShow2).call(this));
|
284
|
+
this.addHook('afterDropdownMenuHide', () => _classPrivateMethodGet(this, _onAfterDropdownMenuHide, _onAfterDropdownMenuHide2).call(this));
|
285
|
+
this.addHook('afterChange', changes => _classPrivateMethodGet(this, _onAfterChange, _onAfterChange2).call(this, changes));
|
222
286
|
|
223
287
|
// Temp. solution (extending menu items bug in contextMenu/dropdownMenu)
|
224
288
|
if (this.hot.getSettings().dropdownMenu && this.dropdownMenuPlugin) {
|
@@ -449,7 +513,7 @@ class Filters extends _base.BasePlugin {
|
|
449
513
|
* @param {number} [column] Visual column index.
|
450
514
|
*/
|
451
515
|
clearConditions(column) {
|
452
|
-
if (column ===
|
516
|
+
if (column === undefined) {
|
453
517
|
this.conditionCollection.clean();
|
454
518
|
} else {
|
455
519
|
const physicalColumn = this.hot.toPhysicalColumn(column);
|
@@ -560,25 +624,6 @@ class Filters extends _base.BasePlugin {
|
|
560
624
|
});
|
561
625
|
return data;
|
562
626
|
}
|
563
|
-
|
564
|
-
/**
|
565
|
-
* `afterChange` listener.
|
566
|
-
*
|
567
|
-
* @private
|
568
|
-
* @param {Array} changes Array of changes.
|
569
|
-
*/
|
570
|
-
onAfterChange(changes) {
|
571
|
-
if (changes) {
|
572
|
-
(0, _array.arrayEach)(changes, change => {
|
573
|
-
const [, prop] = change;
|
574
|
-
const columnIndex = this.hot.propToCol(prop);
|
575
|
-
if (this.conditionCollection.hasConditions(columnIndex)) {
|
576
|
-
this.updateValueComponentCondition(columnIndex);
|
577
|
-
}
|
578
|
-
});
|
579
|
-
}
|
580
|
-
}
|
581
|
-
|
582
627
|
/**
|
583
628
|
* Update the condition of ValueComponent, based on the handled changes.
|
584
629
|
*
|
@@ -608,41 +653,6 @@ class Filters extends _base.BasePlugin {
|
|
608
653
|
});
|
609
654
|
this.updateDependentComponentsVisibility();
|
610
655
|
}
|
611
|
-
|
612
|
-
/**
|
613
|
-
* After dropdown menu show listener.
|
614
|
-
*
|
615
|
-
* @private
|
616
|
-
*/
|
617
|
-
onAfterDropdownMenuShow() {
|
618
|
-
this.restoreComponents(Array.from(this.components.values()));
|
619
|
-
}
|
620
|
-
|
621
|
-
/**
|
622
|
-
* After dropdown menu hide listener.
|
623
|
-
*
|
624
|
-
* @private
|
625
|
-
*/
|
626
|
-
onAfterDropdownMenuHide() {
|
627
|
-
this.components.get('filter_by_condition').getSelectElement().closeOptions();
|
628
|
-
this.components.get('filter_by_condition2').getSelectElement().closeOptions();
|
629
|
-
}
|
630
|
-
|
631
|
-
/**
|
632
|
-
* After dropdown menu default options listener.
|
633
|
-
*
|
634
|
-
* @private
|
635
|
-
* @param {object} defaultOptions ContextMenu default item options.
|
636
|
-
*/
|
637
|
-
onAfterDropdownMenuDefaultOptions(defaultOptions) {
|
638
|
-
defaultOptions.items.push({
|
639
|
-
name: _predefinedItems.SEPARATOR
|
640
|
-
});
|
641
|
-
this.components.forEach(component => {
|
642
|
-
defaultOptions.items.push(component.getMenuItemDescriptor());
|
643
|
-
});
|
644
|
-
}
|
645
|
-
|
646
656
|
/**
|
647
657
|
* Get an operation, based on the number and types of arguments (where arguments are states of components).
|
648
658
|
*
|
@@ -664,75 +674,6 @@ class Filters extends _base.BasePlugin {
|
|
664
674
|
}
|
665
675
|
return operation;
|
666
676
|
}
|
667
|
-
|
668
|
-
/**
|
669
|
-
* On action bar submit listener.
|
670
|
-
*
|
671
|
-
* @private
|
672
|
-
* @param {string} submitType The submit type.
|
673
|
-
*/
|
674
|
-
onActionBarSubmit(submitType) {
|
675
|
-
var _this$dropdownMenuPlu3;
|
676
|
-
if (submitType === 'accept') {
|
677
|
-
const selectedColumn = this.getSelectedColumn();
|
678
|
-
if (selectedColumn === null) {
|
679
|
-
var _this$dropdownMenuPlu2;
|
680
|
-
(_this$dropdownMenuPlu2 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu2 === void 0 || _this$dropdownMenuPlu2.close();
|
681
|
-
return;
|
682
|
-
}
|
683
|
-
const {
|
684
|
-
physicalIndex
|
685
|
-
} = selectedColumn;
|
686
|
-
const byConditionState1 = this.components.get('filter_by_condition').getState();
|
687
|
-
const byConditionState2 = this.components.get('filter_by_condition2').getState();
|
688
|
-
const byValueState = this.components.get('filter_by_value').getState();
|
689
|
-
const operation = this.getOperationBasedOnArguments(this.components.get('filter_operators').getActiveOperationId(), byConditionState1, byConditionState2, byValueState);
|
690
|
-
this.conditionUpdateObserver.groupChanges();
|
691
|
-
let columnStackPosition = this.conditionCollection.getColumnStackPosition(physicalIndex);
|
692
|
-
if (columnStackPosition === -1) {
|
693
|
-
columnStackPosition = void 0;
|
694
|
-
}
|
695
|
-
this.conditionCollection.removeConditions(physicalIndex);
|
696
|
-
if (byConditionState1.command.key !== _constants2.CONDITION_NONE) {
|
697
|
-
this.conditionCollection.addCondition(physicalIndex, byConditionState1, operation, columnStackPosition);
|
698
|
-
if (byConditionState2.command.key !== _constants2.CONDITION_NONE) {
|
699
|
-
this.conditionCollection.addCondition(physicalIndex, byConditionState2, operation, columnStackPosition);
|
700
|
-
}
|
701
|
-
}
|
702
|
-
if (byValueState.command.key !== _constants2.CONDITION_NONE) {
|
703
|
-
this.conditionCollection.addCondition(physicalIndex, byValueState, operation, columnStackPosition);
|
704
|
-
}
|
705
|
-
this.conditionUpdateObserver.flush();
|
706
|
-
this.components.forEach(component => component.saveState(physicalIndex));
|
707
|
-
this.filtersRowsMap.clear();
|
708
|
-
this.filter();
|
709
|
-
}
|
710
|
-
(_this$dropdownMenuPlu3 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu3 === void 0 || _this$dropdownMenuPlu3.close();
|
711
|
-
}
|
712
|
-
|
713
|
-
/**
|
714
|
-
* On component change listener.
|
715
|
-
*
|
716
|
-
* @private
|
717
|
-
* @param {BaseComponent} component Component inheriting BaseComponent.
|
718
|
-
* @param {object} command Menu item object (command).
|
719
|
-
*/
|
720
|
-
onComponentChange(component, command) {
|
721
|
-
this.updateDependentComponentsVisibility();
|
722
|
-
if (component.constructor === _condition.ConditionComponent && !command.inputsCount) {
|
723
|
-
this.setListeningDropdownMenu();
|
724
|
-
}
|
725
|
-
}
|
726
|
-
|
727
|
-
/**
|
728
|
-
* On component SelectUI closed listener.
|
729
|
-
*
|
730
|
-
* @private
|
731
|
-
*/
|
732
|
-
onSelectUIClosed() {
|
733
|
-
this.setListeningDropdownMenu();
|
734
|
-
}
|
735
|
-
|
736
677
|
/**
|
737
678
|
* Listen to the keyboard input on document body and forward events to instance of Handsontable
|
738
679
|
* created by DropdownMenu plugin.
|
@@ -762,23 +703,6 @@ class Filters extends _base.BasePlugin {
|
|
762
703
|
this.hideComponents(...componentsToShow);
|
763
704
|
}
|
764
705
|
}
|
765
|
-
|
766
|
-
/**
|
767
|
-
* On after get column header listener.
|
768
|
-
*
|
769
|
-
* @private
|
770
|
-
* @param {number} col Visual column index.
|
771
|
-
* @param {HTMLTableCellElement} TH Header's TH element.
|
772
|
-
*/
|
773
|
-
onAfterGetColHeader(col, TH) {
|
774
|
-
const physicalColumn = this.hot.toPhysicalColumn(col);
|
775
|
-
if (this.enabled && this.conditionCollection.hasConditions(physicalColumn)) {
|
776
|
-
(0, _element.addClass)(TH, 'htFiltersActive');
|
777
|
-
} else {
|
778
|
-
(0, _element.removeClass)(TH, 'htFiltersActive');
|
779
|
-
}
|
780
|
-
}
|
781
|
-
|
782
706
|
/**
|
783
707
|
* Creates DataFilter instance based on condition collection.
|
784
708
|
*
|
@@ -790,41 +714,6 @@ class Filters extends _base.BasePlugin {
|
|
790
714
|
let conditionCollection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.conditionCollection;
|
791
715
|
return new _dataFilter.default(conditionCollection, physicalColumn => this.getDataMapAtColumn(physicalColumn));
|
792
716
|
}
|
793
|
-
|
794
|
-
/**
|
795
|
-
* It updates the components state. The state is triggered by ConditionUpdateObserver, which
|
796
|
-
* reacts to any condition added to the condition collection. It may be added through the UI
|
797
|
-
* components or by API call.
|
798
|
-
*
|
799
|
-
* @private
|
800
|
-
* @param {object} conditionsState An object with the state generated by UI components.
|
801
|
-
*/
|
802
|
-
updateComponents(conditionsState) {
|
803
|
-
var _this$dropdownMenuPlu4;
|
804
|
-
if (!((_this$dropdownMenuPlu4 = this.dropdownMenuPlugin) !== null && _this$dropdownMenuPlu4 !== void 0 && _this$dropdownMenuPlu4.enabled)) {
|
805
|
-
return;
|
806
|
-
}
|
807
|
-
const {
|
808
|
-
editedConditionStack: {
|
809
|
-
conditions,
|
810
|
-
column
|
811
|
-
}
|
812
|
-
} = conditionsState;
|
813
|
-
const conditionsByValue = conditions.filter(condition => condition.name === _constants2.CONDITION_BY_VALUE);
|
814
|
-
const conditionsWithoutByValue = conditions.filter(condition => condition.name !== _constants2.CONDITION_BY_VALUE);
|
815
|
-
if (conditionsByValue.length >= 2 || conditionsWithoutByValue.length >= 3) {
|
816
|
-
(0, _console.warn)((0, _templateLiteralTag.toSingleLine)`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
|
817
|
-
The overall amount of conditions exceed the capability of the dropdown menu.\x20
|
818
|
-
For more details see the documentation.`);
|
819
|
-
} else {
|
820
|
-
const operationType = this.conditionCollection.getOperation(column);
|
821
|
-
this.components.get('filter_by_condition').updateState(conditionsWithoutByValue[0], column);
|
822
|
-
this.components.get('filter_by_condition2').updateState(conditionsWithoutByValue[1], column);
|
823
|
-
this.components.get('filter_operators').updateState(operationType, column);
|
824
|
-
this.components.get('filter_by_value').updateState(conditionsState);
|
825
|
-
}
|
826
|
-
}
|
827
|
-
|
828
717
|
/**
|
829
718
|
* Returns indexes of passed components inside list of `dropdownMenu` items.
|
830
719
|
*
|
@@ -922,4 +811,110 @@ class Filters extends _base.BasePlugin {
|
|
922
811
|
super.destroy();
|
923
812
|
}
|
924
813
|
}
|
925
|
-
exports.Filters = Filters;
|
814
|
+
exports.Filters = Filters;
|
815
|
+
function _onAfterChange2(changes) {
|
816
|
+
if (changes) {
|
817
|
+
(0, _array.arrayEach)(changes, change => {
|
818
|
+
const [, prop] = change;
|
819
|
+
const columnIndex = this.hot.propToCol(prop);
|
820
|
+
if (this.conditionCollection.hasConditions(columnIndex)) {
|
821
|
+
this.updateValueComponentCondition(columnIndex);
|
822
|
+
}
|
823
|
+
});
|
824
|
+
}
|
825
|
+
}
|
826
|
+
function _onAfterDropdownMenuShow2() {
|
827
|
+
this.restoreComponents(Array.from(this.components.values()));
|
828
|
+
}
|
829
|
+
function _onAfterDropdownMenuHide2() {
|
830
|
+
this.components.get('filter_by_condition').getSelectElement().closeOptions();
|
831
|
+
this.components.get('filter_by_condition2').getSelectElement().closeOptions();
|
832
|
+
}
|
833
|
+
function _onAfterDropdownMenuDefaultOptions2(defaultOptions) {
|
834
|
+
defaultOptions.items.push({
|
835
|
+
name: _predefinedItems.SEPARATOR
|
836
|
+
});
|
837
|
+
this.components.forEach(component => {
|
838
|
+
defaultOptions.items.push(component.getMenuItemDescriptor());
|
839
|
+
});
|
840
|
+
}
|
841
|
+
function _onActionBarSubmit2(submitType) {
|
842
|
+
var _this$dropdownMenuPlu3;
|
843
|
+
if (submitType === 'accept') {
|
844
|
+
const selectedColumn = this.getSelectedColumn();
|
845
|
+
if (selectedColumn === null) {
|
846
|
+
var _this$dropdownMenuPlu2;
|
847
|
+
(_this$dropdownMenuPlu2 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu2 === void 0 || _this$dropdownMenuPlu2.close();
|
848
|
+
return;
|
849
|
+
}
|
850
|
+
const {
|
851
|
+
physicalIndex
|
852
|
+
} = selectedColumn;
|
853
|
+
const byConditionState1 = this.components.get('filter_by_condition').getState();
|
854
|
+
const byConditionState2 = this.components.get('filter_by_condition2').getState();
|
855
|
+
const byValueState = this.components.get('filter_by_value').getState();
|
856
|
+
const operation = this.getOperationBasedOnArguments(this.components.get('filter_operators').getActiveOperationId(), byConditionState1, byConditionState2, byValueState);
|
857
|
+
this.conditionUpdateObserver.groupChanges();
|
858
|
+
let columnStackPosition = this.conditionCollection.getColumnStackPosition(physicalIndex);
|
859
|
+
if (columnStackPosition === -1) {
|
860
|
+
columnStackPosition = undefined;
|
861
|
+
}
|
862
|
+
this.conditionCollection.removeConditions(physicalIndex);
|
863
|
+
if (byConditionState1.command.key !== _constants2.CONDITION_NONE) {
|
864
|
+
this.conditionCollection.addCondition(physicalIndex, byConditionState1, operation, columnStackPosition);
|
865
|
+
if (byConditionState2.command.key !== _constants2.CONDITION_NONE) {
|
866
|
+
this.conditionCollection.addCondition(physicalIndex, byConditionState2, operation, columnStackPosition);
|
867
|
+
}
|
868
|
+
}
|
869
|
+
if (byValueState.command.key !== _constants2.CONDITION_NONE) {
|
870
|
+
this.conditionCollection.addCondition(physicalIndex, byValueState, operation, columnStackPosition);
|
871
|
+
}
|
872
|
+
this.conditionUpdateObserver.flush();
|
873
|
+
this.components.forEach(component => component.saveState(physicalIndex));
|
874
|
+
this.filtersRowsMap.clear();
|
875
|
+
this.filter();
|
876
|
+
}
|
877
|
+
(_this$dropdownMenuPlu3 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu3 === void 0 || _this$dropdownMenuPlu3.close();
|
878
|
+
}
|
879
|
+
function _onComponentChange2(component, command) {
|
880
|
+
this.updateDependentComponentsVisibility();
|
881
|
+
if (component.constructor === _condition.ConditionComponent && !command.inputsCount) {
|
882
|
+
this.setListeningDropdownMenu();
|
883
|
+
}
|
884
|
+
}
|
885
|
+
function _onSelectUIClosed2() {
|
886
|
+
this.setListeningDropdownMenu();
|
887
|
+
}
|
888
|
+
function _onAfterGetColHeader2(col, TH) {
|
889
|
+
const physicalColumn = this.hot.toPhysicalColumn(col);
|
890
|
+
if (this.enabled && this.conditionCollection.hasConditions(physicalColumn)) {
|
891
|
+
(0, _element.addClass)(TH, 'htFiltersActive');
|
892
|
+
} else {
|
893
|
+
(0, _element.removeClass)(TH, 'htFiltersActive');
|
894
|
+
}
|
895
|
+
}
|
896
|
+
function _updateComponents2(conditionsState) {
|
897
|
+
var _this$dropdownMenuPlu4;
|
898
|
+
if (!((_this$dropdownMenuPlu4 = this.dropdownMenuPlugin) !== null && _this$dropdownMenuPlu4 !== void 0 && _this$dropdownMenuPlu4.enabled)) {
|
899
|
+
return;
|
900
|
+
}
|
901
|
+
const {
|
902
|
+
editedConditionStack: {
|
903
|
+
conditions,
|
904
|
+
column
|
905
|
+
}
|
906
|
+
} = conditionsState;
|
907
|
+
const conditionsByValue = conditions.filter(condition => condition.name === _constants2.CONDITION_BY_VALUE);
|
908
|
+
const conditionsWithoutByValue = conditions.filter(condition => condition.name !== _constants2.CONDITION_BY_VALUE);
|
909
|
+
if (conditionsByValue.length >= 2 || conditionsWithoutByValue.length >= 3) {
|
910
|
+
(0, _console.warn)((0, _templateLiteralTag.toSingleLine)`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
|
911
|
+
The overall amount of conditions exceed the capability of the dropdown menu.\x20
|
912
|
+
For more details see the documentation.`);
|
913
|
+
} else {
|
914
|
+
const operationType = this.conditionCollection.getOperation(column);
|
915
|
+
this.components.get('filter_by_condition').updateState(conditionsWithoutByValue[0], column);
|
916
|
+
this.components.get('filter_by_condition2').updateState(conditionsWithoutByValue[1], column);
|
917
|
+
this.components.get('filter_operators').updateState(operationType, column);
|
918
|
+
this.components.get('filter_by_value').updateState(conditionsState);
|
919
|
+
}
|
920
|
+
}
|