@lemon-fe/components 1.2.15 → 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/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 +3 -11
- package/es/data-grid/index.less +1 -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/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,328 +0,0 @@
|
|
|
1
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
-
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); } }
|
|
3
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
|
-
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); }
|
|
6
|
-
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); }
|
|
7
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
8
|
-
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); }; }
|
|
9
|
-
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); }
|
|
10
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
11
|
-
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; } }
|
|
12
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
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, Bean, BeanStub, ModuleNames, ModuleRegistry, Optional } from '@ag-grid-community/core';
|
|
22
|
-
var MenuItemMapper = /*#__PURE__*/function (_BeanStub) {
|
|
23
|
-
_inherits(MenuItemMapper, _BeanStub);
|
|
24
|
-
var _super = _createSuper(MenuItemMapper);
|
|
25
|
-
function MenuItemMapper() {
|
|
26
|
-
_classCallCheck(this, MenuItemMapper);
|
|
27
|
-
return _super.apply(this, arguments);
|
|
28
|
-
}
|
|
29
|
-
_createClass(MenuItemMapper, [{
|
|
30
|
-
key: "mapWithStockItems",
|
|
31
|
-
value: function mapWithStockItems(originalList, column) {
|
|
32
|
-
var _this = this;
|
|
33
|
-
if (!originalList) {
|
|
34
|
-
return [];
|
|
35
|
-
}
|
|
36
|
-
var resultList = [];
|
|
37
|
-
originalList.forEach(function (menuItemOrString) {
|
|
38
|
-
var result;
|
|
39
|
-
if (typeof menuItemOrString === 'string') {
|
|
40
|
-
result = _this.getStockMenuItem(menuItemOrString, column);
|
|
41
|
-
} else {
|
|
42
|
-
// Spread to prevent leaking mapped subMenus back into the original menuItem
|
|
43
|
-
result = Object.assign({}, menuItemOrString);
|
|
44
|
-
}
|
|
45
|
-
// if no mapping, can happen when module is not loaded but user tries to use module anyway
|
|
46
|
-
if (!result) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
var resultDef = result;
|
|
50
|
-
var subMenu = resultDef.subMenu;
|
|
51
|
-
if (subMenu && subMenu instanceof Array) {
|
|
52
|
-
resultDef.subMenu = _this.mapWithStockItems(subMenu, column);
|
|
53
|
-
}
|
|
54
|
-
if (result != null) {
|
|
55
|
-
resultList.push(result);
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
return resultList;
|
|
59
|
-
}
|
|
60
|
-
}, {
|
|
61
|
-
key: "getStockMenuItem",
|
|
62
|
-
value: function getStockMenuItem(key, column) {
|
|
63
|
-
var _this2 = this;
|
|
64
|
-
var _a;
|
|
65
|
-
var localeTextFunc = this.localeService.getLocaleTextFunc();
|
|
66
|
-
var skipHeaderOnAutoSize = this.gridOptionsService.is('skipHeaderOnAutoSize');
|
|
67
|
-
switch (key) {
|
|
68
|
-
case 'pinSubMenu':
|
|
69
|
-
return {
|
|
70
|
-
name: localeTextFunc('pinColumn', 'Pin Column'),
|
|
71
|
-
icon: _.createIconNoSpan('menuPin', this.gridOptionsService, null),
|
|
72
|
-
subMenu: ['clearPinned', 'pinLeft', 'pinRight']
|
|
73
|
-
};
|
|
74
|
-
case 'pinLeft':
|
|
75
|
-
return {
|
|
76
|
-
name: localeTextFunc('pinLeft', 'Pin Left'),
|
|
77
|
-
action: function action() {
|
|
78
|
-
return _this2.columnModel.setColumnPinned(column, 'left', "contextMenu");
|
|
79
|
-
},
|
|
80
|
-
checked: !!column && column.isPinnedLeft()
|
|
81
|
-
};
|
|
82
|
-
case 'pinRight':
|
|
83
|
-
return {
|
|
84
|
-
name: localeTextFunc('pinRight', 'Pin Right'),
|
|
85
|
-
action: function action() {
|
|
86
|
-
return _this2.columnModel.setColumnPinned(column, 'right', "contextMenu");
|
|
87
|
-
},
|
|
88
|
-
checked: !!column && column.isPinnedRight()
|
|
89
|
-
};
|
|
90
|
-
case 'clearPinned':
|
|
91
|
-
return {
|
|
92
|
-
name: localeTextFunc('noPin', 'No Pin'),
|
|
93
|
-
action: function action() {
|
|
94
|
-
return _this2.columnModel.setColumnPinned(column, null, "contextMenu");
|
|
95
|
-
},
|
|
96
|
-
checked: !!column && !column.isPinned()
|
|
97
|
-
};
|
|
98
|
-
case 'valueAggSubMenu':
|
|
99
|
-
if (ModuleRegistry.assertRegistered(ModuleNames.RowGroupingModule, 'Aggregation from Menu')) {
|
|
100
|
-
if (!(column === null || column === void 0 ? void 0 : column.isPrimary()) && !(column === null || column === void 0 ? void 0 : column.getColDef().pivotValueColumn)) {
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
name: localeTextFunc('valueAggregation', 'Value Aggregation'),
|
|
105
|
-
icon: _.createIconNoSpan('menuValue', this.gridOptionsService, null),
|
|
106
|
-
subMenu: this.createAggregationSubMenu(column)
|
|
107
|
-
};
|
|
108
|
-
} else {
|
|
109
|
-
return null;
|
|
110
|
-
}
|
|
111
|
-
case 'autoSizeThis':
|
|
112
|
-
return {
|
|
113
|
-
name: localeTextFunc('autosizeThiscolumn', 'Autosize This Column'),
|
|
114
|
-
action: function action() {
|
|
115
|
-
return _this2.columnModel.autoSizeColumn(column, skipHeaderOnAutoSize, "contextMenu");
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
case 'autoSizeAll':
|
|
119
|
-
return {
|
|
120
|
-
name: localeTextFunc('autosizeAllColumns', 'Autosize All Columns'),
|
|
121
|
-
action: function action() {
|
|
122
|
-
return _this2.columnModel.autoSizeAllColumns(skipHeaderOnAutoSize, "contextMenu");
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
case 'rowGroup':
|
|
126
|
-
return {
|
|
127
|
-
name: localeTextFunc('groupBy', 'Group by') + ' ' + _.escapeString(this.columnModel.getDisplayNameForColumn(column, 'header')),
|
|
128
|
-
action: function action() {
|
|
129
|
-
return _this2.columnModel.addRowGroupColumn(column, "contextMenu");
|
|
130
|
-
},
|
|
131
|
-
icon: _.createIconNoSpan('menuAddRowGroup', this.gridOptionsService, null)
|
|
132
|
-
};
|
|
133
|
-
case 'rowUnGroup':
|
|
134
|
-
return {
|
|
135
|
-
name: localeTextFunc('ungroupBy', 'Un-Group by') + ' ' + _.escapeString(this.columnModel.getDisplayNameForColumn(column, 'header')),
|
|
136
|
-
action: function action() {
|
|
137
|
-
return _this2.columnModel.removeRowGroupColumn(column, "contextMenu");
|
|
138
|
-
},
|
|
139
|
-
icon: _.createIconNoSpan('menuRemoveRowGroup', this.gridOptionsService, null)
|
|
140
|
-
};
|
|
141
|
-
case 'resetColumns':
|
|
142
|
-
return {
|
|
143
|
-
name: localeTextFunc('resetColumns', 'Reset Columns'),
|
|
144
|
-
action: function action() {
|
|
145
|
-
return _this2.columnModel.resetColumnState("contextMenu");
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
case 'expandAll':
|
|
149
|
-
return {
|
|
150
|
-
name: localeTextFunc('expandAll', 'Expand All'),
|
|
151
|
-
action: function action() {
|
|
152
|
-
return _this2.gridApi.expandAll();
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
case 'contractAll':
|
|
156
|
-
return {
|
|
157
|
-
name: localeTextFunc('collapseAll', 'Collapse All'),
|
|
158
|
-
action: function action() {
|
|
159
|
-
return _this2.gridApi.collapseAll();
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
case 'copy':
|
|
163
|
-
if (ModuleRegistry.assertRegistered(ModuleNames.ClipboardModule, 'Copy from Menu')) {
|
|
164
|
-
return {
|
|
165
|
-
name: localeTextFunc('copy', 'Copy'),
|
|
166
|
-
shortcut: localeTextFunc('ctrlC', 'Ctrl+C'),
|
|
167
|
-
icon: _.createIconNoSpan('clipboardCopy', this.gridOptionsService, null),
|
|
168
|
-
action: function action() {
|
|
169
|
-
return _this2.clipboardService.copyToClipboard();
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
} else {
|
|
173
|
-
return null;
|
|
174
|
-
}
|
|
175
|
-
case 'copyWithHeaders':
|
|
176
|
-
if (ModuleRegistry.assertRegistered(ModuleNames.ClipboardModule, 'Copy with Headers from Menu')) {
|
|
177
|
-
return {
|
|
178
|
-
name: localeTextFunc('copyWithHeaders', 'Copy with Headers'),
|
|
179
|
-
// shortcut: localeTextFunc('ctrlC','Ctrl+C'),
|
|
180
|
-
icon: _.createIconNoSpan('clipboardCopy', this.gridOptionsService, null),
|
|
181
|
-
action: function action() {
|
|
182
|
-
return _this2.clipboardService.copyToClipboard({
|
|
183
|
-
includeHeaders: true
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
} else {
|
|
188
|
-
return null;
|
|
189
|
-
}
|
|
190
|
-
case 'copyWithGroupHeaders':
|
|
191
|
-
if (ModuleRegistry.assertRegistered(ModuleNames.ClipboardModule, 'Copy with Group Headers from Menu')) {
|
|
192
|
-
return {
|
|
193
|
-
name: localeTextFunc('copyWithGroupHeaders', 'Copy with Group Headers'),
|
|
194
|
-
// shortcut: localeTextFunc('ctrlC','Ctrl+C'),
|
|
195
|
-
icon: _.createIconNoSpan('clipboardCopy', this.gridOptionsService, null),
|
|
196
|
-
action: function action() {
|
|
197
|
-
return _this2.clipboardService.copyToClipboard({
|
|
198
|
-
includeHeaders: true,
|
|
199
|
-
includeGroupHeaders: true
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
} else {
|
|
204
|
-
return null;
|
|
205
|
-
}
|
|
206
|
-
case 'cut':
|
|
207
|
-
if (ModuleRegistry.assertRegistered(ModuleNames.ClipboardModule, 'Cut from Menu')) {
|
|
208
|
-
var focusedCell = this.focusService.getFocusedCell();
|
|
209
|
-
var rowNode = focusedCell ? this.rowPositionUtils.getRowNode(focusedCell) : null;
|
|
210
|
-
var isEditable = rowNode ? focusedCell === null || focusedCell === void 0 ? void 0 : focusedCell.column.isCellEditable(rowNode) : false;
|
|
211
|
-
return {
|
|
212
|
-
name: localeTextFunc('cut', 'Cut'),
|
|
213
|
-
shortcut: localeTextFunc('ctrlX', 'Ctrl+X'),
|
|
214
|
-
icon: _.createIconNoSpan('clipboardCut', this.gridOptionsService, null),
|
|
215
|
-
disabled: !isEditable || this.gridOptionsService.is('suppressCutToClipboard'),
|
|
216
|
-
action: function action() {
|
|
217
|
-
return _this2.clipboardService.cutToClipboard();
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
} else {
|
|
221
|
-
return null;
|
|
222
|
-
}
|
|
223
|
-
case 'paste':
|
|
224
|
-
if (ModuleRegistry.assertRegistered(ModuleNames.ClipboardModule, 'Paste from Clipboard')) {
|
|
225
|
-
return {
|
|
226
|
-
name: localeTextFunc('paste', 'Paste'),
|
|
227
|
-
shortcut: localeTextFunc('ctrlV', 'Ctrl+V'),
|
|
228
|
-
disabled: true,
|
|
229
|
-
icon: _.createIconNoSpan('clipboardPaste', this.gridOptionsService, null),
|
|
230
|
-
action: function action() {
|
|
231
|
-
return _this2.clipboardService.pasteFromClipboard();
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
} else {
|
|
235
|
-
return null;
|
|
236
|
-
}
|
|
237
|
-
case 'export':
|
|
238
|
-
var exportSubMenuItems = [];
|
|
239
|
-
var csvModuleLoaded = ModuleRegistry.isRegistered(ModuleNames.CsvExportModule);
|
|
240
|
-
var excelModuleLoaded = ModuleRegistry.isRegistered(ModuleNames.ExcelExportModule);
|
|
241
|
-
if (!this.gridOptionsService.is('suppressCsvExport') && csvModuleLoaded) {
|
|
242
|
-
exportSubMenuItems.push('csvExport');
|
|
243
|
-
}
|
|
244
|
-
if (!this.gridOptionsService.is('suppressExcelExport') && excelModuleLoaded) {
|
|
245
|
-
exportSubMenuItems.push('excelExport');
|
|
246
|
-
}
|
|
247
|
-
return {
|
|
248
|
-
name: localeTextFunc('export', 'Export'),
|
|
249
|
-
subMenu: exportSubMenuItems,
|
|
250
|
-
icon: _.createIconNoSpan('save', this.gridOptionsService, null)
|
|
251
|
-
};
|
|
252
|
-
case 'csvExport':
|
|
253
|
-
return {
|
|
254
|
-
name: localeTextFunc('csvExport', 'CSV Export'),
|
|
255
|
-
icon: _.createIconNoSpan('csvExport', this.gridOptionsService, null),
|
|
256
|
-
action: function action() {
|
|
257
|
-
return _this2.gridApi.exportDataAsCsv({});
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
case 'excelExport':
|
|
261
|
-
return {
|
|
262
|
-
name: localeTextFunc('excelExport', 'Excel Export'),
|
|
263
|
-
icon: _.createIconNoSpan('excelExport', this.gridOptionsService, null),
|
|
264
|
-
action: function action() {
|
|
265
|
-
return _this2.gridApi.exportDataAsExcel();
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
case 'separator':
|
|
269
|
-
return 'separator';
|
|
270
|
-
case 'pivotChart':
|
|
271
|
-
case 'chartRange':
|
|
272
|
-
return (_a = this.chartMenuItemMapper.getChartItems(key)) !== null && _a !== void 0 ? _a : null;
|
|
273
|
-
default:
|
|
274
|
-
{
|
|
275
|
-
console.warn("AG Grid: unknown menu item type ".concat(key));
|
|
276
|
-
return null;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}, {
|
|
281
|
-
key: "createAggregationSubMenu",
|
|
282
|
-
value: function createAggregationSubMenu(column) {
|
|
283
|
-
var _this3 = this;
|
|
284
|
-
var localeTextFunc = this.localeService.getLocaleTextFunc();
|
|
285
|
-
var columnToUse;
|
|
286
|
-
if (column.isPrimary()) {
|
|
287
|
-
columnToUse = column;
|
|
288
|
-
} else {
|
|
289
|
-
var pivotValueColumn = column.getColDef().pivotValueColumn;
|
|
290
|
-
columnToUse = _.exists(pivotValueColumn) ? pivotValueColumn : undefined;
|
|
291
|
-
}
|
|
292
|
-
var result = [];
|
|
293
|
-
if (columnToUse) {
|
|
294
|
-
var columnIsAlreadyAggValue = columnToUse.isValueActive();
|
|
295
|
-
var funcNames = this.aggFuncService.getFuncNames(columnToUse);
|
|
296
|
-
result.push({
|
|
297
|
-
name: localeTextFunc('noAggregation', 'None'),
|
|
298
|
-
action: function action() {
|
|
299
|
-
_this3.columnModel.removeValueColumn(columnToUse, "contextMenu");
|
|
300
|
-
_this3.columnModel.setColumnAggFunc(columnToUse, undefined, "contextMenu");
|
|
301
|
-
},
|
|
302
|
-
checked: !columnIsAlreadyAggValue
|
|
303
|
-
});
|
|
304
|
-
funcNames.forEach(function (funcName) {
|
|
305
|
-
result.push({
|
|
306
|
-
name: localeTextFunc(funcName, _.capitalise(funcName)),
|
|
307
|
-
action: function action() {
|
|
308
|
-
_this3.columnModel.setColumnAggFunc(columnToUse, funcName, "contextMenu");
|
|
309
|
-
_this3.columnModel.addValueColumn(columnToUse, "contextMenu");
|
|
310
|
-
},
|
|
311
|
-
checked: columnIsAlreadyAggValue && columnToUse.getAggFunc() === funcName
|
|
312
|
-
});
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
return result;
|
|
316
|
-
}
|
|
317
|
-
}]);
|
|
318
|
-
return MenuItemMapper;
|
|
319
|
-
}(BeanStub);
|
|
320
|
-
__decorate([Autowired('columnModel')], MenuItemMapper.prototype, "columnModel", void 0);
|
|
321
|
-
__decorate([Autowired('gridApi')], MenuItemMapper.prototype, "gridApi", void 0);
|
|
322
|
-
__decorate([Optional('clipboardService')], MenuItemMapper.prototype, "clipboardService", void 0);
|
|
323
|
-
__decorate([Optional('aggFuncService')], MenuItemMapper.prototype, "aggFuncService", void 0);
|
|
324
|
-
__decorate([Autowired('focusService')], MenuItemMapper.prototype, "focusService", void 0);
|
|
325
|
-
__decorate([Autowired('rowPositionUtils')], MenuItemMapper.prototype, "rowPositionUtils", void 0);
|
|
326
|
-
__decorate([Autowired('chartMenuItemMapper')], MenuItemMapper.prototype, "chartMenuItemMapper", void 0);
|
|
327
|
-
MenuItemMapper = __decorate([Bean('menuItemMapper')], MenuItemMapper);
|
|
328
|
-
export { MenuItemMapper };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ModuleNames } from "@ag-grid-community/core";
|
|
2
|
-
import { EnterpriseMenuFactory } from "./menu/enterpriseMenu";
|
|
3
|
-
import { ContextMenuFactory } from "./menu/contextMenu";
|
|
4
|
-
import { MenuItemMapper } from "./menu/menuItemMapper";
|
|
5
|
-
import { VERSION } from "./version";
|
|
6
|
-
import { ChartMenuItemMapper } from "./menu/chartMenuItemMapper";
|
|
7
|
-
export var MenuModule = {
|
|
8
|
-
version: VERSION,
|
|
9
|
-
moduleName: ModuleNames.MenuModule,
|
|
10
|
-
beans: [EnterpriseMenuFactory, ContextMenuFactory, MenuItemMapper, ChartMenuItemMapper],
|
|
11
|
-
dependantModules: []
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const VERSION = "29.2.0";
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { RowGroupingModule } from "./rowGroupingModule";
|
|
2
|
-
export { RowGroupDropZonePanel } from "./rowGrouping/columnDropZones/rowGroupDropZonePanel";
|
|
3
|
-
export { ValuesDropZonePanel } from "./rowGrouping/columnDropZones/valueDropZonePanel";
|
|
4
|
-
export { PivotDropZonePanel } from "./rowGrouping/columnDropZones/pivotDropZonePanel";
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { RowGroupingModule } from "./rowGroupingModule";
|
|
2
|
-
export { RowGroupDropZonePanel } from "./rowGrouping/columnDropZones/rowGroupDropZonePanel";
|
|
3
|
-
export { ValuesDropZonePanel } from "./rowGrouping/columnDropZones/valueDropZonePanel";
|
|
4
|
-
export { PivotDropZonePanel } from "./rowGrouping/columnDropZones/pivotDropZonePanel";
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BeanStub, Column, IAggFunc, IAggFuncService } from '@ag-grid-community/core';
|
|
2
|
-
export declare class AggFuncService extends BeanStub implements IAggFuncService {
|
|
3
|
-
private static AGG_SUM;
|
|
4
|
-
private static AGG_FIRST;
|
|
5
|
-
private static AGG_LAST;
|
|
6
|
-
private static AGG_MIN;
|
|
7
|
-
private static AGG_MAX;
|
|
8
|
-
private static AGG_COUNT;
|
|
9
|
-
private static AGG_AVG;
|
|
10
|
-
private aggFuncsMap;
|
|
11
|
-
private initialised;
|
|
12
|
-
private init;
|
|
13
|
-
private initialiseWithDefaultAggregations;
|
|
14
|
-
private isAggFuncPossible;
|
|
15
|
-
getDefaultAggFunc(column: Column): string | null;
|
|
16
|
-
addAggFuncs(aggFuncs?: {
|
|
17
|
-
[key: string]: IAggFunc;
|
|
18
|
-
}): void;
|
|
19
|
-
addAggFunc(key: string, aggFunc: IAggFunc): void;
|
|
20
|
-
getAggFunc(name: string): IAggFunc;
|
|
21
|
-
getFuncNames(column: Column): string[];
|
|
22
|
-
clear(): void;
|
|
23
|
-
}
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
-
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); } }
|
|
3
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
|
-
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); }
|
|
6
|
-
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); }
|
|
7
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
8
|
-
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); }; }
|
|
9
|
-
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); }
|
|
10
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
11
|
-
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; } }
|
|
12
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
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
|
-
var AggFuncService_1;
|
|
22
|
-
import { Bean, BeanStub, PostConstruct, _ } from '@ag-grid-community/core';
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
var AGBigInt = typeof BigInt === 'undefined' ? null : BigInt;
|
|
25
|
-
var AggFuncService = AggFuncService_1 = /*#__PURE__*/function (_BeanStub) {
|
|
26
|
-
_inherits(AggFuncService, _BeanStub);
|
|
27
|
-
var _super = _createSuper(AggFuncService);
|
|
28
|
-
function AggFuncService() {
|
|
29
|
-
var _this;
|
|
30
|
-
_classCallCheck(this, AggFuncService);
|
|
31
|
-
_this = _super.apply(this, arguments);
|
|
32
|
-
_this.aggFuncsMap = {};
|
|
33
|
-
_this.initialised = false;
|
|
34
|
-
return _this;
|
|
35
|
-
}
|
|
36
|
-
_createClass(AggFuncService, [{
|
|
37
|
-
key: "init",
|
|
38
|
-
value: function init() {
|
|
39
|
-
if (this.initialised) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
this.initialiseWithDefaultAggregations();
|
|
43
|
-
this.addAggFuncs(this.gridOptionsService.get('aggFuncs'));
|
|
44
|
-
}
|
|
45
|
-
}, {
|
|
46
|
-
key: "initialiseWithDefaultAggregations",
|
|
47
|
-
value: function initialiseWithDefaultAggregations() {
|
|
48
|
-
this.aggFuncsMap[AggFuncService_1.AGG_SUM] = aggSum;
|
|
49
|
-
this.aggFuncsMap[AggFuncService_1.AGG_FIRST] = aggFirst;
|
|
50
|
-
this.aggFuncsMap[AggFuncService_1.AGG_LAST] = aggLast;
|
|
51
|
-
this.aggFuncsMap[AggFuncService_1.AGG_MIN] = aggMin;
|
|
52
|
-
this.aggFuncsMap[AggFuncService_1.AGG_MAX] = aggMax;
|
|
53
|
-
this.aggFuncsMap[AggFuncService_1.AGG_COUNT] = aggCount;
|
|
54
|
-
this.aggFuncsMap[AggFuncService_1.AGG_AVG] = aggAvg;
|
|
55
|
-
this.initialised = true;
|
|
56
|
-
}
|
|
57
|
-
}, {
|
|
58
|
-
key: "isAggFuncPossible",
|
|
59
|
-
value: function isAggFuncPossible(column, func) {
|
|
60
|
-
var allKeys = this.getFuncNames(column);
|
|
61
|
-
var allowed = _.includes(allKeys, func);
|
|
62
|
-
var funcExists = _.exists(this.aggFuncsMap[func]);
|
|
63
|
-
return allowed && funcExists;
|
|
64
|
-
}
|
|
65
|
-
}, {
|
|
66
|
-
key: "getDefaultAggFunc",
|
|
67
|
-
value: function getDefaultAggFunc(column) {
|
|
68
|
-
var defaultAgg = column.getColDef().defaultAggFunc;
|
|
69
|
-
if (_.exists(defaultAgg) && this.isAggFuncPossible(column, defaultAgg)) {
|
|
70
|
-
return defaultAgg;
|
|
71
|
-
}
|
|
72
|
-
if (this.isAggFuncPossible(column, AggFuncService_1.AGG_SUM)) {
|
|
73
|
-
return AggFuncService_1.AGG_SUM;
|
|
74
|
-
}
|
|
75
|
-
var allKeys = this.getFuncNames(column);
|
|
76
|
-
return _.existsAndNotEmpty(allKeys) ? allKeys[0] : null;
|
|
77
|
-
}
|
|
78
|
-
}, {
|
|
79
|
-
key: "addAggFuncs",
|
|
80
|
-
value: function addAggFuncs(aggFuncs) {
|
|
81
|
-
_.iterateObject(aggFuncs, this.addAggFunc.bind(this));
|
|
82
|
-
}
|
|
83
|
-
}, {
|
|
84
|
-
key: "addAggFunc",
|
|
85
|
-
value: function addAggFunc(key, aggFunc) {
|
|
86
|
-
this.init();
|
|
87
|
-
this.aggFuncsMap[key] = aggFunc;
|
|
88
|
-
}
|
|
89
|
-
}, {
|
|
90
|
-
key: "getAggFunc",
|
|
91
|
-
value: function getAggFunc(name) {
|
|
92
|
-
this.init();
|
|
93
|
-
return this.aggFuncsMap[name];
|
|
94
|
-
}
|
|
95
|
-
}, {
|
|
96
|
-
key: "getFuncNames",
|
|
97
|
-
value: function getFuncNames(column) {
|
|
98
|
-
var userAllowedFuncs = column.getColDef().allowedAggFuncs;
|
|
99
|
-
return userAllowedFuncs == null ? Object.keys(this.aggFuncsMap).sort() : userAllowedFuncs;
|
|
100
|
-
}
|
|
101
|
-
}, {
|
|
102
|
-
key: "clear",
|
|
103
|
-
value: function clear() {
|
|
104
|
-
this.aggFuncsMap = {};
|
|
105
|
-
}
|
|
106
|
-
}]);
|
|
107
|
-
return AggFuncService;
|
|
108
|
-
}(BeanStub);
|
|
109
|
-
AggFuncService.AGG_SUM = 'sum';
|
|
110
|
-
AggFuncService.AGG_FIRST = 'first';
|
|
111
|
-
AggFuncService.AGG_LAST = 'last';
|
|
112
|
-
AggFuncService.AGG_MIN = 'min';
|
|
113
|
-
AggFuncService.AGG_MAX = 'max';
|
|
114
|
-
AggFuncService.AGG_COUNT = 'count';
|
|
115
|
-
AggFuncService.AGG_AVG = 'avg';
|
|
116
|
-
__decorate([PostConstruct], AggFuncService.prototype, "init", null);
|
|
117
|
-
AggFuncService = AggFuncService_1 = __decorate([Bean('aggFuncService')], AggFuncService);
|
|
118
|
-
export { AggFuncService };
|
|
119
|
-
function aggSum(params) {
|
|
120
|
-
var values = params.values;
|
|
121
|
-
var result = null; // the logic ensures that we never combine bigint arithmetic with numbers, but TS is hard to please
|
|
122
|
-
// for optimum performance, we use a for loop here rather than calling any helper methods or using functional code
|
|
123
|
-
for (var i = 0; i < values.length; i++) {
|
|
124
|
-
var value = values[i];
|
|
125
|
-
if (typeof value === 'number') {
|
|
126
|
-
if (result === null) {
|
|
127
|
-
result = value;
|
|
128
|
-
} else {
|
|
129
|
-
if (AGBigInt) {
|
|
130
|
-
result += typeof result === 'number' ? value : AGBigInt(value);
|
|
131
|
-
} else {
|
|
132
|
-
result += value;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
} else if (typeof value === 'bigint') {
|
|
136
|
-
if (result === null) {
|
|
137
|
-
result = value;
|
|
138
|
-
} else {
|
|
139
|
-
result = (typeof result === 'bigint' ? result : AGBigInt(result)) + value;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return result;
|
|
144
|
-
}
|
|
145
|
-
function aggFirst(params) {
|
|
146
|
-
return params.values.length > 0 ? params.values[0] : null;
|
|
147
|
-
}
|
|
148
|
-
function aggLast(params) {
|
|
149
|
-
return params.values.length > 0 ? _.last(params.values) : null;
|
|
150
|
-
}
|
|
151
|
-
function aggMin(params) {
|
|
152
|
-
var values = params.values;
|
|
153
|
-
var result = null;
|
|
154
|
-
// for optimum performance, we use a for loop here rather than calling any helper methods or using functional code
|
|
155
|
-
for (var i = 0; i < values.length; i++) {
|
|
156
|
-
var value = values[i];
|
|
157
|
-
if ((typeof value === 'number' || typeof value === 'bigint') && (result === null || result > value)) {
|
|
158
|
-
result = value;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return result;
|
|
162
|
-
}
|
|
163
|
-
function aggMax(params) {
|
|
164
|
-
var values = params.values;
|
|
165
|
-
var result = null;
|
|
166
|
-
// for optimum performance, we use a for loop here rather than calling any helper methods or using functional code
|
|
167
|
-
for (var i = 0; i < values.length; i++) {
|
|
168
|
-
var value = values[i];
|
|
169
|
-
if ((typeof value === 'number' || typeof value === 'bigint') && (result === null || result < value)) {
|
|
170
|
-
result = value;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return result;
|
|
174
|
-
}
|
|
175
|
-
function aggCount(params) {
|
|
176
|
-
var values = params.values;
|
|
177
|
-
var result = 0;
|
|
178
|
-
// for optimum performance, we use a for loop here rather than calling any helper methods or using functional code
|
|
179
|
-
for (var i = 0; i < values.length; i++) {
|
|
180
|
-
var value = values[i];
|
|
181
|
-
// check if the value is from a group, in which case use the group's count
|
|
182
|
-
result += value != null && typeof value.value === 'number' ? value.value : 1;
|
|
183
|
-
}
|
|
184
|
-
return result;
|
|
185
|
-
}
|
|
186
|
-
// the average function is tricky as the multiple levels require weighted averages
|
|
187
|
-
// for the non-leaf node aggregations.
|
|
188
|
-
function aggAvg(params) {
|
|
189
|
-
var _a, _b, _c;
|
|
190
|
-
var values = params.values;
|
|
191
|
-
var sum = 0; // the logic ensures that we never combine bigint arithmetic with numbers, but TS is hard to please
|
|
192
|
-
var count = 0;
|
|
193
|
-
// for optimum performance, we use a for loop here rather than calling any helper methods or using functional code
|
|
194
|
-
for (var i = 0; i < values.length; i++) {
|
|
195
|
-
var currentValue = values[i];
|
|
196
|
-
var valueToAdd = null;
|
|
197
|
-
if (typeof currentValue === 'number' || typeof currentValue === 'bigint') {
|
|
198
|
-
valueToAdd = currentValue;
|
|
199
|
-
count++;
|
|
200
|
-
} else if (currentValue != null && (typeof currentValue.value === 'number' || typeof currentValue.value === 'bigint') && typeof currentValue.count === 'number') {
|
|
201
|
-
// we are aggregating groups, so we take the aggregated values to calculated a weighted average
|
|
202
|
-
if (AGBigInt) {
|
|
203
|
-
valueToAdd = currentValue.value * (typeof currentValue.value === 'number' ? currentValue.count : AGBigInt(currentValue.count));
|
|
204
|
-
} else {
|
|
205
|
-
valueToAdd = currentValue.value * currentValue.count;
|
|
206
|
-
}
|
|
207
|
-
count += currentValue.count;
|
|
208
|
-
}
|
|
209
|
-
if (typeof valueToAdd === 'number') {
|
|
210
|
-
if (AGBigInt) {
|
|
211
|
-
sum += typeof sum === 'number' ? valueToAdd : AGBigInt(valueToAdd);
|
|
212
|
-
} else {
|
|
213
|
-
sum += valueToAdd;
|
|
214
|
-
}
|
|
215
|
-
} else if (typeof valueToAdd === 'bigint') {
|
|
216
|
-
sum = (typeof sum === 'bigint' ? sum : AGBigInt(sum)) + valueToAdd;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
var value = null;
|
|
220
|
-
// avoid divide by zero error
|
|
221
|
-
if (count > 0) {
|
|
222
|
-
if (AGBigInt) {
|
|
223
|
-
value = sum / (typeof sum === 'number' ? count : AGBigInt(count));
|
|
224
|
-
} else {
|
|
225
|
-
value = sum / count;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
// the previous aggregation data
|
|
229
|
-
var existingAggData = (_b = (_a = params.rowNode) === null || _a === void 0 ? void 0 : _a.aggData) === null || _b === void 0 ? void 0 : _b[(_c = params.column) === null || _c === void 0 ? void 0 : _c.getColId()];
|
|
230
|
-
if (existingAggData && existingAggData.count === count && existingAggData.value === value) {
|
|
231
|
-
// the underlying values haven't changed, return the old object to avoid triggering change detection
|
|
232
|
-
return existingAggData;
|
|
233
|
-
}
|
|
234
|
-
// the result will be an object. when this cell is rendered, only the avg is shown.
|
|
235
|
-
// however when this cell is part of another aggregation, the count is also needed
|
|
236
|
-
// to create a weighted average for the next level.
|
|
237
|
-
return {
|
|
238
|
-
count: count,
|
|
239
|
-
value: value,
|
|
240
|
-
// the grid by default uses toString to render values for an object, so this
|
|
241
|
-
// is a trick to get the default cellRenderer to display the avg value
|
|
242
|
-
toString: function toString() {
|
|
243
|
-
return typeof this.value === 'number' || typeof this.value === 'bigint' ? this.value.toString() : '';
|
|
244
|
-
},
|
|
245
|
-
// used for sorting
|
|
246
|
-
toNumber: function toNumber() {
|
|
247
|
-
return this.value;
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { BeanStub, IRowNodeStage, RowNode, Column, StageExecuteParams, IAggFunc, GetGroupRowAggParams } from "@ag-grid-community/core";
|
|
2
|
-
export declare class AggregationStage extends BeanStub implements IRowNodeStage {
|
|
3
|
-
private columnModel;
|
|
4
|
-
private valueService;
|
|
5
|
-
private pivotStage;
|
|
6
|
-
private aggFuncService;
|
|
7
|
-
private gridApi;
|
|
8
|
-
private columnApi;
|
|
9
|
-
private filteredOnly;
|
|
10
|
-
execute(params: StageExecuteParams): any;
|
|
11
|
-
getGroupRowAggFunc(): ((params: Pick<GetGroupRowAggParams<any, any>, "nodes">) => any) | undefined;
|
|
12
|
-
private createAggDetails;
|
|
13
|
-
private isSuppressAggFilteredOnly;
|
|
14
|
-
private recursivelyCreateAggData;
|
|
15
|
-
private aggregateRowNode;
|
|
16
|
-
private aggregateRowNodeUsingValuesAndPivot;
|
|
17
|
-
private aggregateRowNodeUsingValuesOnly;
|
|
18
|
-
private getValuesPivotNonLeaf;
|
|
19
|
-
private getValuesFromMappedSet;
|
|
20
|
-
private getValuesNormal;
|
|
21
|
-
aggregateValues(values: any[], aggFuncOrString: string | IAggFunc, column?: Column, rowNode?: RowNode): any;
|
|
22
|
-
}
|