@lemon-fe/components 1.2.14 → 1.3.0-alpha.0
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/es/data-grid/cell-editors/date.d.ts +2 -2
- package/es/data-grid/cell-editors/number.d.ts +2 -2
- package/es/data-grid/cell-editors/number.js +1 -4
- package/es/data-grid/cell-editors/row.d.ts +2 -2
- package/es/data-grid/cell-editors/select.d.ts +3 -3
- package/es/data-grid/cell-editors/text.d.ts +2 -2
- package/es/data-grid/cell-editors/utils.d.ts +1 -1
- package/es/data-grid/components/custom-panel/index.d.ts +1 -1
- package/es/data-grid/components/custom-panel/item.d.ts +1 -1
- package/es/data-grid/components/custom-panel/typings.d.ts +1 -1
- package/es/data-grid/index.d.ts +8 -7
- package/es/data-grid/index.js +39 -21
- package/es/data-grid/index.less +1 -1
- package/es/data-grid/locale/en_US.js +3 -1
- package/es/data-grid/locale/zh_CN.js +3 -1
- package/es/data-grid/renderer/actions-renderer.d.ts +1 -1
- package/es/data-grid/renderer/actions.d.ts +1 -1
- package/es/data-grid/renderer/cell-delete-renderer.d.ts +1 -1
- package/es/data-grid/renderer/cell-index-renderer.d.ts +1 -1
- package/es/data-grid/renderer/cell-renderer.d.ts +1 -1
- package/es/data-grid/renderer/detali-cell-renderer.d.ts +1 -1
- package/es/data-grid/renderer/header-renderer.d.ts +1 -1
- package/es/data-grid/renderer/header-renderer.js +0 -1
- package/es/data-grid/typings.d.ts +2 -2
- package/es/data-grid/utils.d.ts +1 -1
- package/es/index.d.ts +4 -3
- package/es/index.js +4 -2
- package/es/select-view/index.d.ts +1 -1
- package/package.json +5 -14
- package/es/data-grid/modules/clipboard/clipboard/clipboardService.d.ts +0 -62
- package/es/data-grid/modules/clipboard/clipboard/clipboardService.js +0 -1007
- package/es/data-grid/modules/clipboard/clipboardModule.d.ts +0 -2
- package/es/data-grid/modules/clipboard/clipboardModule.js +0 -10
- package/es/data-grid/modules/clipboard/main.d.ts +0 -1
- package/es/data-grid/modules/clipboard/main.js +0 -1
- package/es/data-grid/modules/clipboard/version.d.ts +0 -1
- package/es/data-grid/modules/clipboard/version.js +0 -2
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnModelItem.d.ts +0 -26
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnModelItem.js +0 -94
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnToolPanel.d.ts +0 -32
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnToolPanel.js +0 -272
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/modelItemUtils.d.ts +0 -16
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/modelItemUtils.js +0 -209
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/pivotModePanel.d.ts +0 -9
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/pivotModePanel.js +0 -68
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.d.ts +0 -32
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.js +0 -150
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.d.ts +0 -44
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.js +0 -455
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.d.ts +0 -26
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.js +0 -224
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.d.ts +0 -24
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.js +0 -123
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.d.ts +0 -37
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.js +0 -314
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.d.ts +0 -51
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.js +0 -406
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.d.ts +0 -24
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.js +0 -264
- package/es/data-grid/modules/column-tool-panel/columnsToolPanelModule.d.ts +0 -2
- package/es/data-grid/modules/column-tool-panel/columnsToolPanelModule.js +0 -29
- package/es/data-grid/modules/column-tool-panel/main.d.ts +0 -2
- package/es/data-grid/modules/column-tool-panel/main.js +0 -3
- package/es/data-grid/modules/column-tool-panel/version.d.ts +0 -1
- package/es/data-grid/modules/column-tool-panel/version.js +0 -2
- package/es/data-grid/modules/master-detail/main.d.ts +0 -1
- package/es/data-grid/modules/master-detail/main.js +0 -1
- package/es/data-grid/modules/master-detail/masterDetail/detailCellRenderer.d.ts +0 -14
- package/es/data-grid/modules/master-detail/masterDetail/detailCellRenderer.js +0 -144
- package/es/data-grid/modules/master-detail/masterDetail/detailCellRendererCtrl.d.ts +0 -19
- package/es/data-grid/modules/master-detail/masterDetail/detailCellRendererCtrl.js +0 -203
- package/es/data-grid/modules/master-detail/masterDetailModule.d.ts +0 -2
- package/es/data-grid/modules/master-detail/masterDetailModule.js +0 -18
- package/es/data-grid/modules/master-detail/version.d.ts +0 -1
- package/es/data-grid/modules/master-detail/version.js +0 -2
- package/es/data-grid/modules/menu/main.d.ts +0 -1
- package/es/data-grid/modules/menu/main.js +0 -1
- package/es/data-grid/modules/menu/menu/chartMenuItemMapper.d.ts +0 -13
- package/es/data-grid/modules/menu/menu/chartMenuItemMapper.js +0 -351
- package/es/data-grid/modules/menu/menu/contextMenu.d.ts +0 -13
- package/es/data-grid/modules/menu/menu/contextMenu.js +0 -267
- package/es/data-grid/modules/menu/menu/enterpriseMenu.d.ts +0 -66
- package/es/data-grid/modules/menu/menu/enterpriseMenu.js +0 -592
- package/es/data-grid/modules/menu/menu/menuItemMapper.d.ts +0 -13
- package/es/data-grid/modules/menu/menu/menuItemMapper.js +0 -328
- package/es/data-grid/modules/menu/menuModule.d.ts +0 -2
- package/es/data-grid/modules/menu/menuModule.js +0 -12
- package/es/data-grid/modules/menu/version.d.ts +0 -1
- package/es/data-grid/modules/menu/version.js +0 -2
- package/es/data-grid/modules/row-grouping/main.d.ts +0 -4
- package/es/data-grid/modules/row-grouping/main.js +0 -4
- package/es/data-grid/modules/row-grouping/rowGrouping/aggFuncService.d.ts +0 -23
- package/es/data-grid/modules/row-grouping/rowGrouping/aggFuncService.js +0 -250
- package/es/data-grid/modules/row-grouping/rowGrouping/aggregationStage.d.ts +0 -22
- package/es/data-grid/modules/row-grouping/rowGrouping/aggregationStage.js +0 -285
- package/es/data-grid/modules/row-grouping/rowGrouping/batchRemover.d.ts +0 -12
- package/es/data-grid/modules/row-grouping/rowGrouping/batchRemover.js +0 -77
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.d.ts +0 -75
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.js +0 -516
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.d.ts +0 -40
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.js +0 -367
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.d.ts +0 -11
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.js +0 -85
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.d.ts +0 -17
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.js +0 -139
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.d.ts +0 -15
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.js +0 -105
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.d.ts +0 -15
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.js +0 -105
- package/es/data-grid/modules/row-grouping/rowGrouping/filterAggregatesStage.d.ts +0 -9
- package/es/data-grid/modules/row-grouping/rowGrouping/filterAggregatesStage.js +0 -136
- package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFilter.d.ts +0 -39
- package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFilter.js +0 -319
- package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFloatingFilter.d.ts +0 -23
- package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFloatingFilter.js +0 -163
- package/es/data-grid/modules/row-grouping/rowGrouping/groupStage.d.ts +0 -48
- package/es/data-grid/modules/row-grouping/rowGrouping/groupStage.js +0 -740
- package/es/data-grid/modules/row-grouping/rowGrouping/pivotColDefService.d.ts +0 -24
- package/es/data-grid/modules/row-grouping/rowGrouping/pivotColDefService.js +0 -396
- package/es/data-grid/modules/row-grouping/rowGrouping/pivotStage.d.ts +0 -19
- package/es/data-grid/modules/row-grouping/rowGrouping/pivotStage.js +0 -182
- package/es/data-grid/modules/row-grouping/rowGroupingModule.d.ts +0 -2
- package/es/data-grid/modules/row-grouping/rowGroupingModule.js +0 -28
- package/es/data-grid/modules/row-grouping/version.d.ts +0 -1
- package/es/data-grid/modules/row-grouping/version.js +0 -2
- package/es/data-grid/modules/side-bar/main.d.ts +0 -2
- package/es/data-grid/modules/side-bar/main.js +0 -2
- package/es/data-grid/modules/side-bar/sideBar/common/toolPanelColDefService.d.ts +0 -11
- package/es/data-grid/modules/side-bar/sideBar/common/toolPanelColDefService.js +0 -216
- package/es/data-grid/modules/side-bar/sideBar/horizontalResizeComp.d.ts +0 -19
- package/es/data-grid/modules/side-bar/sideBar/horizontalResizeComp.js +0 -108
- package/es/data-grid/modules/side-bar/sideBar/sideBarButtonComp.d.ts +0 -16
- package/es/data-grid/modules/side-bar/sideBar/sideBarButtonComp.js +0 -84
- package/es/data-grid/modules/side-bar/sideBar/sideBarButtonsComp.d.ts +0 -18
- package/es/data-grid/modules/side-bar/sideBar/sideBarButtonsComp.js +0 -89
- package/es/data-grid/modules/side-bar/sideBar/sideBarComp.d.ts +0 -28
- package/es/data-grid/modules/side-bar/sideBar/sideBarComp.js +0 -325
- package/es/data-grid/modules/side-bar/sideBar/sideBarDefParser.d.ts +0 -10
- package/es/data-grid/modules/side-bar/sideBar/sideBarDefParser.js +0 -95
- package/es/data-grid/modules/side-bar/sideBar/toolPanelWrapper.d.ts +0 -17
- package/es/data-grid/modules/side-bar/sideBar/toolPanelWrapper.js +0 -103
- package/es/data-grid/modules/side-bar/sideBarModule.d.ts +0 -2
- package/es/data-grid/modules/side-bar/sideBarModule.js +0 -22
- package/es/data-grid/modules/side-bar/version.d.ts +0 -1
- package/es/data-grid/modules/side-bar/version.js +0 -2
|
@@ -1,455 +0,0 @@
|
|
|
1
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
2
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
3
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
4
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
5
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
7
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
8
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
-
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
10
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
14
|
-
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
|
|
15
|
-
var c = arguments.length,
|
|
16
|
-
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
17
|
-
d;
|
|
18
|
-
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
19
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20
|
-
};
|
|
21
|
-
import { _, Autowired, Component, Events, ProvidedColumnGroup, VirtualList, PreDestroy } from "@ag-grid-community/core";
|
|
22
|
-
import { PrimaryColsListPanelItemDragFeature } from "./primaryColsListPanelItemDragFeature";
|
|
23
|
-
import { ToolPanelColumnGroupComp } from "./toolPanelColumnGroupComp";
|
|
24
|
-
import { ToolPanelColumnComp } from "./toolPanelColumnComp";
|
|
25
|
-
import { ExpandState } from "./primaryColsHeaderPanel";
|
|
26
|
-
import { ColumnModelItem } from "./columnModelItem";
|
|
27
|
-
var UIColumnModel = /*#__PURE__*/function () {
|
|
28
|
-
function UIColumnModel(items) {
|
|
29
|
-
_classCallCheck(this, UIColumnModel);
|
|
30
|
-
this.items = items;
|
|
31
|
-
}
|
|
32
|
-
_createClass(UIColumnModel, [{
|
|
33
|
-
key: "getRowCount",
|
|
34
|
-
value: function getRowCount() {
|
|
35
|
-
return this.items.length;
|
|
36
|
-
}
|
|
37
|
-
}, {
|
|
38
|
-
key: "getRow",
|
|
39
|
-
value: function getRow(index) {
|
|
40
|
-
return this.items[index];
|
|
41
|
-
}
|
|
42
|
-
}]);
|
|
43
|
-
return UIColumnModel;
|
|
44
|
-
}();
|
|
45
|
-
var PRIMARY_COLS_LIST_PANEL_CLASS = 'ag-column-select-list';
|
|
46
|
-
export var PrimaryColsListPanel = /*#__PURE__*/function (_Component) {
|
|
47
|
-
_inherits(PrimaryColsListPanel, _Component);
|
|
48
|
-
var _super = _createSuper(PrimaryColsListPanel);
|
|
49
|
-
function PrimaryColsListPanel() {
|
|
50
|
-
var _this;
|
|
51
|
-
_classCallCheck(this, PrimaryColsListPanel);
|
|
52
|
-
_this = _super.call(this, PrimaryColsListPanel.TEMPLATE);
|
|
53
|
-
_this.destroyColumnItemFuncs = [];
|
|
54
|
-
return _this;
|
|
55
|
-
}
|
|
56
|
-
_createClass(PrimaryColsListPanel, [{
|
|
57
|
-
key: "destroyColumnTree",
|
|
58
|
-
value: function destroyColumnTree() {
|
|
59
|
-
this.allColsTree = [];
|
|
60
|
-
this.destroyColumnItemFuncs.forEach(function (f) {
|
|
61
|
-
return f();
|
|
62
|
-
});
|
|
63
|
-
this.destroyColumnItemFuncs = [];
|
|
64
|
-
}
|
|
65
|
-
}, {
|
|
66
|
-
key: "init",
|
|
67
|
-
value: function init(params, allowDragging, eventType) {
|
|
68
|
-
var _this2 = this;
|
|
69
|
-
this.params = params;
|
|
70
|
-
this.allowDragging = allowDragging;
|
|
71
|
-
this.eventType = eventType;
|
|
72
|
-
if (!this.params.suppressSyncLayoutWithGrid) {
|
|
73
|
-
this.addManagedListener(this.eventService, Events.EVENT_COLUMN_MOVED, this.onColumnsChanged.bind(this));
|
|
74
|
-
}
|
|
75
|
-
this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.onColumnsChanged.bind(this));
|
|
76
|
-
var eventsImpactingCheckedState = [Events.EVENT_COLUMN_PIVOT_CHANGED, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, Events.EVENT_COLUMN_VALUE_CHANGED, Events.EVENT_COLUMN_VISIBLE, Events.EVENT_NEW_COLUMNS_LOADED];
|
|
77
|
-
eventsImpactingCheckedState.forEach(function (event) {
|
|
78
|
-
// update header select all checkbox with current selection state
|
|
79
|
-
_this2.addManagedListener(_this2.eventService, event, _this2.fireSelectionChangedEvent.bind(_this2));
|
|
80
|
-
});
|
|
81
|
-
this.expandGroupsByDefault = !this.params.contractColumnSelection;
|
|
82
|
-
var translate = this.localeService.getLocaleTextFunc();
|
|
83
|
-
var columnListName = translate('ariaColumnList', 'Column List');
|
|
84
|
-
this.virtualList = this.createManagedBean(new VirtualList('column-select', 'tree', columnListName));
|
|
85
|
-
this.appendChild(this.virtualList.getGui());
|
|
86
|
-
this.virtualList.setComponentCreator(function (item, listItemElement) {
|
|
87
|
-
_.setAriaLevel(listItemElement, item.getDept() + 1);
|
|
88
|
-
return _this2.createComponentFromItem(item, listItemElement);
|
|
89
|
-
});
|
|
90
|
-
if (this.columnModel.isReady()) {
|
|
91
|
-
this.onColumnsChanged();
|
|
92
|
-
}
|
|
93
|
-
if (!params.suppressColumnMove && !this.gridOptionsService.is('suppressMovableColumns')) {
|
|
94
|
-
this.createManagedBean(new PrimaryColsListPanelItemDragFeature(this, this.virtualList));
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}, {
|
|
98
|
-
key: "createComponentFromItem",
|
|
99
|
-
value: function createComponentFromItem(item, listItemElement) {
|
|
100
|
-
if (item.isGroup()) {
|
|
101
|
-
var renderedGroup = new ToolPanelColumnGroupComp(item, this.allowDragging, this.eventType, listItemElement);
|
|
102
|
-
this.getContext().createBean(renderedGroup);
|
|
103
|
-
return renderedGroup;
|
|
104
|
-
}
|
|
105
|
-
var columnComp = new ToolPanelColumnComp(item.getColumn(), item.getDept(), this.allowDragging, this.groupsExist, listItemElement);
|
|
106
|
-
this.getContext().createBean(columnComp);
|
|
107
|
-
return columnComp;
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
key: "onColumnsChanged",
|
|
111
|
-
value: function onColumnsChanged() {
|
|
112
|
-
var expandedStates = this.getExpandedStates();
|
|
113
|
-
var pivotModeActive = this.columnModel.isPivotMode();
|
|
114
|
-
var shouldSyncColumnLayoutWithGrid = !this.params.suppressSyncLayoutWithGrid && !pivotModeActive;
|
|
115
|
-
if (shouldSyncColumnLayoutWithGrid) {
|
|
116
|
-
this.buildTreeFromWhatGridIsDisplaying();
|
|
117
|
-
} else {
|
|
118
|
-
this.buildTreeFromProvidedColumnDefs();
|
|
119
|
-
}
|
|
120
|
-
this.setExpandedStates(expandedStates);
|
|
121
|
-
this.markFilteredColumns();
|
|
122
|
-
this.flattenAndFilterModel();
|
|
123
|
-
}
|
|
124
|
-
}, {
|
|
125
|
-
key: "getDisplayedColsList",
|
|
126
|
-
value: function getDisplayedColsList() {
|
|
127
|
-
return this.displayedColsList;
|
|
128
|
-
}
|
|
129
|
-
}, {
|
|
130
|
-
key: "getExpandedStates",
|
|
131
|
-
value: function getExpandedStates() {
|
|
132
|
-
if (!this.allColsTree) {
|
|
133
|
-
return {};
|
|
134
|
-
}
|
|
135
|
-
var res = {};
|
|
136
|
-
this.forEachItem(function (item) {
|
|
137
|
-
if (!item.isGroup()) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
var colGroup = item.getColumnGroup();
|
|
141
|
-
if (colGroup) {
|
|
142
|
-
// group should always exist, this is defensive
|
|
143
|
-
res[colGroup.getId()] = item.isExpanded();
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
return res;
|
|
147
|
-
}
|
|
148
|
-
}, {
|
|
149
|
-
key: "setExpandedStates",
|
|
150
|
-
value: function setExpandedStates(states) {
|
|
151
|
-
if (!this.allColsTree) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
this.forEachItem(function (item) {
|
|
155
|
-
if (!item.isGroup()) {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
var colGroup = item.getColumnGroup();
|
|
159
|
-
if (colGroup) {
|
|
160
|
-
// group should always exist, this is defensive
|
|
161
|
-
var expanded = states[colGroup.getId()];
|
|
162
|
-
var groupExistedLastTime = expanded != null;
|
|
163
|
-
if (groupExistedLastTime) {
|
|
164
|
-
item.setExpanded(expanded);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}, {
|
|
170
|
-
key: "buildTreeFromWhatGridIsDisplaying",
|
|
171
|
-
value: function buildTreeFromWhatGridIsDisplaying() {
|
|
172
|
-
this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this));
|
|
173
|
-
}
|
|
174
|
-
}, {
|
|
175
|
-
key: "setColumnLayout",
|
|
176
|
-
value: function setColumnLayout(colDefs) {
|
|
177
|
-
var columnTree = this.colDefService.createColumnTree(colDefs);
|
|
178
|
-
this.buildListModel(columnTree);
|
|
179
|
-
// using col defs to check if groups exist as it could be a custom layout
|
|
180
|
-
this.groupsExist = colDefs.some(function (colDef) {
|
|
181
|
-
return colDef && typeof colDef.children !== 'undefined';
|
|
182
|
-
});
|
|
183
|
-
this.markFilteredColumns();
|
|
184
|
-
this.flattenAndFilterModel();
|
|
185
|
-
}
|
|
186
|
-
}, {
|
|
187
|
-
key: "buildTreeFromProvidedColumnDefs",
|
|
188
|
-
value: function buildTreeFromProvidedColumnDefs() {
|
|
189
|
-
// add column / group comps to tool panel
|
|
190
|
-
this.buildListModel(this.columnModel.getPrimaryColumnTree());
|
|
191
|
-
this.groupsExist = this.columnModel.isPrimaryColumnGroupsPresent();
|
|
192
|
-
}
|
|
193
|
-
}, {
|
|
194
|
-
key: "buildListModel",
|
|
195
|
-
value: function buildListModel(columnTree) {
|
|
196
|
-
var _this3 = this;
|
|
197
|
-
var columnExpandedListener = this.onColumnExpanded.bind(this);
|
|
198
|
-
var addListeners = function addListeners(item) {
|
|
199
|
-
item.addEventListener(ColumnModelItem.EVENT_EXPANDED_CHANGED, columnExpandedListener);
|
|
200
|
-
var removeFunc = item.removeEventListener.bind(item, ColumnModelItem.EVENT_EXPANDED_CHANGED, columnExpandedListener);
|
|
201
|
-
_this3.destroyColumnItemFuncs.push(removeFunc);
|
|
202
|
-
};
|
|
203
|
-
var recursivelyBuild = function recursivelyBuild(tree, dept, parentList) {
|
|
204
|
-
tree.forEach(function (child) {
|
|
205
|
-
if (child instanceof ProvidedColumnGroup) {
|
|
206
|
-
createGroupItem(child, dept, parentList);
|
|
207
|
-
} else {
|
|
208
|
-
createColumnItem(child, dept, parentList);
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
};
|
|
212
|
-
var createGroupItem = function createGroupItem(columnGroup, dept, parentList) {
|
|
213
|
-
var columnGroupDef = columnGroup.getColGroupDef();
|
|
214
|
-
var skipThisGroup = columnGroupDef && columnGroupDef.suppressColumnsToolPanel;
|
|
215
|
-
if (skipThisGroup) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
if (columnGroup.isPadding()) {
|
|
219
|
-
recursivelyBuild(columnGroup.getChildren(), dept, parentList);
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
var displayName = _this3.columnModel.getDisplayNameForProvidedColumnGroup(null, columnGroup, _this3.eventType);
|
|
223
|
-
var item = new ColumnModelItem(displayName, columnGroup, dept, true, _this3.expandGroupsByDefault);
|
|
224
|
-
parentList.push(item);
|
|
225
|
-
addListeners(item);
|
|
226
|
-
recursivelyBuild(columnGroup.getChildren(), dept + 1, item.getChildren());
|
|
227
|
-
};
|
|
228
|
-
var createColumnItem = function createColumnItem(column, dept, parentList) {
|
|
229
|
-
var skipThisColumn = column.getColDef() && column.getColDef().suppressColumnsToolPanel;
|
|
230
|
-
if (skipThisColumn) {
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
var displayName = _this3.columnModel.getDisplayNameForColumn(column, 'columnToolPanel');
|
|
234
|
-
parentList.push(new ColumnModelItem(displayName, column, dept));
|
|
235
|
-
};
|
|
236
|
-
this.destroyColumnTree();
|
|
237
|
-
recursivelyBuild(columnTree, 0, this.allColsTree);
|
|
238
|
-
}
|
|
239
|
-
}, {
|
|
240
|
-
key: "onColumnExpanded",
|
|
241
|
-
value: function onColumnExpanded() {
|
|
242
|
-
this.flattenAndFilterModel();
|
|
243
|
-
}
|
|
244
|
-
}, {
|
|
245
|
-
key: "flattenAndFilterModel",
|
|
246
|
-
value: function flattenAndFilterModel() {
|
|
247
|
-
var _this4 = this;
|
|
248
|
-
this.displayedColsList = [];
|
|
249
|
-
var recursiveFunc = function recursiveFunc(item) {
|
|
250
|
-
if (!item.isPassesFilter()) {
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
_this4.displayedColsList.push(item);
|
|
254
|
-
if (item.isGroup() && item.isExpanded()) {
|
|
255
|
-
item.getChildren().forEach(recursiveFunc);
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
this.allColsTree.forEach(recursiveFunc);
|
|
259
|
-
this.virtualList.setModel(new UIColumnModel(this.displayedColsList));
|
|
260
|
-
var focusedRow = this.virtualList.getLastFocusedRow();
|
|
261
|
-
this.virtualList.refresh();
|
|
262
|
-
if (focusedRow != null) {
|
|
263
|
-
this.focusRowIfAlive(focusedRow);
|
|
264
|
-
}
|
|
265
|
-
this.notifyListeners();
|
|
266
|
-
}
|
|
267
|
-
}, {
|
|
268
|
-
key: "focusRowIfAlive",
|
|
269
|
-
value: function focusRowIfAlive(rowIndex) {
|
|
270
|
-
var _this5 = this;
|
|
271
|
-
window.setTimeout(function () {
|
|
272
|
-
if (_this5.isAlive()) {
|
|
273
|
-
_this5.virtualList.focusRow(rowIndex);
|
|
274
|
-
}
|
|
275
|
-
}, 0);
|
|
276
|
-
}
|
|
277
|
-
}, {
|
|
278
|
-
key: "forEachItem",
|
|
279
|
-
value: function forEachItem(callback) {
|
|
280
|
-
var recursiveFunc = function recursiveFunc(items) {
|
|
281
|
-
items.forEach(function (item) {
|
|
282
|
-
callback(item);
|
|
283
|
-
if (item.isGroup()) {
|
|
284
|
-
recursiveFunc(item.getChildren());
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
};
|
|
288
|
-
recursiveFunc(this.allColsTree);
|
|
289
|
-
}
|
|
290
|
-
}, {
|
|
291
|
-
key: "doSetExpandedAll",
|
|
292
|
-
value: function doSetExpandedAll(value) {
|
|
293
|
-
this.forEachItem(function (item) {
|
|
294
|
-
if (item.isGroup()) {
|
|
295
|
-
item.setExpanded(value);
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
}, {
|
|
300
|
-
key: "setGroupsExpanded",
|
|
301
|
-
value: function setGroupsExpanded(expand, groupIds) {
|
|
302
|
-
if (!groupIds) {
|
|
303
|
-
this.doSetExpandedAll(expand);
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
var expandedGroupIds = [];
|
|
307
|
-
this.forEachItem(function (item) {
|
|
308
|
-
if (!item.isGroup()) {
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
var groupId = item.getColumnGroup().getId();
|
|
312
|
-
if (groupIds.indexOf(groupId) >= 0) {
|
|
313
|
-
item.setExpanded(expand);
|
|
314
|
-
expandedGroupIds.push(groupId);
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
var unrecognisedGroupIds = groupIds.filter(function (groupId) {
|
|
318
|
-
return !_.includes(expandedGroupIds, groupId);
|
|
319
|
-
});
|
|
320
|
-
if (unrecognisedGroupIds.length > 0) {
|
|
321
|
-
console.warn('AG Grid: unable to find group(s) for supplied groupIds:', unrecognisedGroupIds);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}, {
|
|
325
|
-
key: "getExpandState",
|
|
326
|
-
value: function getExpandState() {
|
|
327
|
-
var expandedCount = 0;
|
|
328
|
-
var notExpandedCount = 0;
|
|
329
|
-
this.forEachItem(function (item) {
|
|
330
|
-
if (!item.isGroup()) {
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
if (item.isExpanded()) {
|
|
334
|
-
expandedCount++;
|
|
335
|
-
} else {
|
|
336
|
-
notExpandedCount++;
|
|
337
|
-
}
|
|
338
|
-
});
|
|
339
|
-
if (expandedCount > 0 && notExpandedCount > 0) {
|
|
340
|
-
return ExpandState.INDETERMINATE;
|
|
341
|
-
}
|
|
342
|
-
if (notExpandedCount > 0) {
|
|
343
|
-
return ExpandState.COLLAPSED;
|
|
344
|
-
}
|
|
345
|
-
return ExpandState.EXPANDED;
|
|
346
|
-
}
|
|
347
|
-
}, {
|
|
348
|
-
key: "doSetSelectedAll",
|
|
349
|
-
value: function doSetSelectedAll(selectAllChecked) {
|
|
350
|
-
this.modelItemUtils.selectAllChildren(this.allColsTree, selectAllChecked, this.eventType);
|
|
351
|
-
}
|
|
352
|
-
}, {
|
|
353
|
-
key: "getSelectionState",
|
|
354
|
-
value: function getSelectionState() {
|
|
355
|
-
var checkedCount = 0;
|
|
356
|
-
var uncheckedCount = 0;
|
|
357
|
-
var pivotMode = this.columnModel.isPivotMode();
|
|
358
|
-
this.forEachItem(function (item) {
|
|
359
|
-
if (item.isGroup()) {
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
if (!item.isPassesFilter()) {
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
var column = item.getColumn();
|
|
366
|
-
var colDef = column.getColDef();
|
|
367
|
-
var checked;
|
|
368
|
-
if (pivotMode) {
|
|
369
|
-
var noPivotModeOptionsAllowed = !column.isAllowPivot() && !column.isAllowRowGroup() && !column.isAllowValue();
|
|
370
|
-
if (noPivotModeOptionsAllowed) {
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
checked = column.isValueActive() || column.isPivotActive() || column.isRowGroupActive();
|
|
374
|
-
} else {
|
|
375
|
-
if (colDef.lockVisible) {
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
checked = column.isVisible();
|
|
379
|
-
}
|
|
380
|
-
checked ? checkedCount++ : uncheckedCount++;
|
|
381
|
-
});
|
|
382
|
-
if (checkedCount > 0 && uncheckedCount > 0) {
|
|
383
|
-
return undefined;
|
|
384
|
-
}
|
|
385
|
-
return !(checkedCount === 0 || uncheckedCount > 0);
|
|
386
|
-
}
|
|
387
|
-
}, {
|
|
388
|
-
key: "setFilterText",
|
|
389
|
-
value: function setFilterText(filterText) {
|
|
390
|
-
this.filterText = _.exists(filterText) ? filterText.toLowerCase() : null;
|
|
391
|
-
this.markFilteredColumns();
|
|
392
|
-
this.flattenAndFilterModel();
|
|
393
|
-
}
|
|
394
|
-
}, {
|
|
395
|
-
key: "markFilteredColumns",
|
|
396
|
-
value: function markFilteredColumns() {
|
|
397
|
-
var _this6 = this;
|
|
398
|
-
var passesFilter = function passesFilter(item) {
|
|
399
|
-
if (!_.exists(_this6.filterText)) {
|
|
400
|
-
return true;
|
|
401
|
-
}
|
|
402
|
-
var displayName = item.getDisplayName();
|
|
403
|
-
return displayName == null || displayName.toLowerCase().indexOf(_this6.filterText) !== -1;
|
|
404
|
-
};
|
|
405
|
-
var recursivelyCheckFilter = function recursivelyCheckFilter(item, parentPasses) {
|
|
406
|
-
var atLeastOneChildPassed = false;
|
|
407
|
-
if (item.isGroup()) {
|
|
408
|
-
var groupPasses = passesFilter(item);
|
|
409
|
-
item.getChildren().forEach(function (child) {
|
|
410
|
-
var childPasses = recursivelyCheckFilter(child, groupPasses || parentPasses);
|
|
411
|
-
if (childPasses) {
|
|
412
|
-
atLeastOneChildPassed = childPasses;
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
var filterPasses = parentPasses || atLeastOneChildPassed ? true : passesFilter(item);
|
|
417
|
-
item.setPassesFilter(filterPasses);
|
|
418
|
-
return filterPasses;
|
|
419
|
-
};
|
|
420
|
-
this.allColsTree.forEach(function (item) {
|
|
421
|
-
return recursivelyCheckFilter(item, false);
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
}, {
|
|
425
|
-
key: "notifyListeners",
|
|
426
|
-
value: function notifyListeners() {
|
|
427
|
-
this.fireGroupExpandedEvent();
|
|
428
|
-
this.fireSelectionChangedEvent();
|
|
429
|
-
}
|
|
430
|
-
}, {
|
|
431
|
-
key: "fireGroupExpandedEvent",
|
|
432
|
-
value: function fireGroupExpandedEvent() {
|
|
433
|
-
var expandState = this.getExpandState();
|
|
434
|
-
this.dispatchEvent({
|
|
435
|
-
type: 'groupExpanded',
|
|
436
|
-
state: expandState
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
}, {
|
|
440
|
-
key: "fireSelectionChangedEvent",
|
|
441
|
-
value: function fireSelectionChangedEvent() {
|
|
442
|
-
var selectionState = this.getSelectionState();
|
|
443
|
-
this.dispatchEvent({
|
|
444
|
-
type: 'selectionChanged',
|
|
445
|
-
state: selectionState
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
}]);
|
|
449
|
-
return PrimaryColsListPanel;
|
|
450
|
-
}(Component);
|
|
451
|
-
PrimaryColsListPanel.TEMPLATE = "<div class=\"".concat(PRIMARY_COLS_LIST_PANEL_CLASS, "\" role=\"presentation\"></div>");
|
|
452
|
-
__decorate([Autowired('columnModel')], PrimaryColsListPanel.prototype, "columnModel", void 0);
|
|
453
|
-
__decorate([Autowired('toolPanelColDefService')], PrimaryColsListPanel.prototype, "colDefService", void 0);
|
|
454
|
-
__decorate([Autowired('modelItemUtils')], PrimaryColsListPanel.prototype, "modelItemUtils", void 0);
|
|
455
|
-
__decorate([PreDestroy], PrimaryColsListPanel.prototype, "destroyColumnTree", null);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { BeanStub, VirtualList } from "@ag-grid-community/core";
|
|
2
|
-
import { PrimaryColsListPanel } from "./primaryColsListPanel";
|
|
3
|
-
export declare class PrimaryColsListPanelItemDragFeature extends BeanStub {
|
|
4
|
-
private readonly comp;
|
|
5
|
-
private readonly virtualList;
|
|
6
|
-
private columnModel;
|
|
7
|
-
private dragAndDropService;
|
|
8
|
-
private currentDragColumn;
|
|
9
|
-
private lastHoveredColumnItem;
|
|
10
|
-
private autoScrollService;
|
|
11
|
-
private moveBlocked;
|
|
12
|
-
constructor(comp: PrimaryColsListPanel, virtualList: VirtualList);
|
|
13
|
-
private postConstruct;
|
|
14
|
-
private columnPanelItemDragStart;
|
|
15
|
-
private columnPanelItemDragEnd;
|
|
16
|
-
private createDropTarget;
|
|
17
|
-
private createAutoScrollService;
|
|
18
|
-
private onDragging;
|
|
19
|
-
private getDragColumnItem;
|
|
20
|
-
private onDragStop;
|
|
21
|
-
private getMoveDiff;
|
|
22
|
-
private getCurrentColumns;
|
|
23
|
-
private getTargetIndex;
|
|
24
|
-
private onDragLeave;
|
|
25
|
-
private clearHoveredItems;
|
|
26
|
-
}
|