@lemon-fe/components 1.2.15 → 1.3.0-alpha.1
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/LICENSE +9 -0
- package/README.md +17 -0
- 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 +9 -18
- 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,11 +0,0 @@
|
|
|
1
|
-
import { AbstractColDef, BeanStub, IProvidedColumn } from "@ag-grid-community/core";
|
|
2
|
-
export declare class ToolPanelColDefService extends BeanStub {
|
|
3
|
-
private columnModel;
|
|
4
|
-
createColumnTree(colDefs: AbstractColDef[]): IProvidedColumn[];
|
|
5
|
-
syncLayoutWithGrid(syncLayoutCallback: (colDefs: AbstractColDef[]) => void): void;
|
|
6
|
-
private getLeafPathTrees;
|
|
7
|
-
private mergeLeafPathTrees;
|
|
8
|
-
private addChildrenToGroup;
|
|
9
|
-
private isColGroupDef;
|
|
10
|
-
private getId;
|
|
11
|
-
}
|
|
@@ -1,216 +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, ProvidedColumnGroup } from "@ag-grid-community/core";
|
|
22
|
-
var ToolPanelColDefService = /*#__PURE__*/function (_BeanStub) {
|
|
23
|
-
_inherits(ToolPanelColDefService, _BeanStub);
|
|
24
|
-
var _super = _createSuper(ToolPanelColDefService);
|
|
25
|
-
function ToolPanelColDefService() {
|
|
26
|
-
var _this;
|
|
27
|
-
_classCallCheck(this, ToolPanelColDefService);
|
|
28
|
-
_this = _super.apply(this, arguments);
|
|
29
|
-
_this.isColGroupDef = function (colDef) {
|
|
30
|
-
return colDef && typeof colDef.children !== 'undefined';
|
|
31
|
-
};
|
|
32
|
-
_this.getId = function (colDef) {
|
|
33
|
-
return _this.isColGroupDef(colDef) ? colDef.groupId : colDef.colId;
|
|
34
|
-
};
|
|
35
|
-
return _this;
|
|
36
|
-
}
|
|
37
|
-
_createClass(ToolPanelColDefService, [{
|
|
38
|
-
key: "createColumnTree",
|
|
39
|
-
value: function createColumnTree(colDefs) {
|
|
40
|
-
var _this2 = this;
|
|
41
|
-
var invalidColIds = [];
|
|
42
|
-
var createDummyColGroup = function createDummyColGroup(abstractColDef, depth) {
|
|
43
|
-
if (_this2.isColGroupDef(abstractColDef)) {
|
|
44
|
-
// creating 'dummy' group which is not associated with grid column group
|
|
45
|
-
var groupDef = abstractColDef;
|
|
46
|
-
var groupId = typeof groupDef.groupId !== 'undefined' ? groupDef.groupId : groupDef.headerName;
|
|
47
|
-
var group = new ProvidedColumnGroup(groupDef, groupId, false, depth);
|
|
48
|
-
var children = [];
|
|
49
|
-
groupDef.children.forEach(function (def) {
|
|
50
|
-
var child = createDummyColGroup(def, depth + 1);
|
|
51
|
-
// check column exists in case invalid colDef is supplied for primary column
|
|
52
|
-
if (child) {
|
|
53
|
-
children.push(child);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
group.setChildren(children);
|
|
57
|
-
return group;
|
|
58
|
-
} else {
|
|
59
|
-
var colDef = abstractColDef;
|
|
60
|
-
var key = colDef.colId ? colDef.colId : colDef.field;
|
|
61
|
-
var column = _this2.columnModel.getPrimaryColumn(key);
|
|
62
|
-
if (!column) {
|
|
63
|
-
invalidColIds.push(colDef);
|
|
64
|
-
}
|
|
65
|
-
return column;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
var mappedResults = [];
|
|
69
|
-
colDefs.forEach(function (colDef) {
|
|
70
|
-
var result = createDummyColGroup(colDef, 0);
|
|
71
|
-
if (result) {
|
|
72
|
-
// only return correctly mapped colDef results
|
|
73
|
-
mappedResults.push(result);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
if (invalidColIds.length > 0) {
|
|
77
|
-
console.warn('AG Grid: unable to find grid columns for the supplied colDef(s):', invalidColIds);
|
|
78
|
-
}
|
|
79
|
-
return mappedResults;
|
|
80
|
-
}
|
|
81
|
-
}, {
|
|
82
|
-
key: "syncLayoutWithGrid",
|
|
83
|
-
value: function syncLayoutWithGrid(syncLayoutCallback) {
|
|
84
|
-
// extract ordered list of leaf path trees (column group hierarchy for each individual leaf column)
|
|
85
|
-
var leafPathTrees = this.getLeafPathTrees();
|
|
86
|
-
// merge leaf path tree taking split column groups into account
|
|
87
|
-
var mergedColumnTrees = this.mergeLeafPathTrees(leafPathTrees);
|
|
88
|
-
// sync layout with merged column trees
|
|
89
|
-
syncLayoutCallback(mergedColumnTrees);
|
|
90
|
-
}
|
|
91
|
-
}, {
|
|
92
|
-
key: "getLeafPathTrees",
|
|
93
|
-
value: function getLeafPathTrees() {
|
|
94
|
-
// leaf tree paths are obtained by walking up the tree starting at a column until we reach the top level group.
|
|
95
|
-
var getLeafPathTree = function getLeafPathTree(node, childDef) {
|
|
96
|
-
var leafPathTree;
|
|
97
|
-
// build up tree in reverse order
|
|
98
|
-
if (node instanceof ProvidedColumnGroup) {
|
|
99
|
-
if (node.isPadding()) {
|
|
100
|
-
// skip over padding groups
|
|
101
|
-
leafPathTree = childDef;
|
|
102
|
-
} else {
|
|
103
|
-
var groupDef = Object.assign({}, node.getColGroupDef());
|
|
104
|
-
// ensure group contains groupId
|
|
105
|
-
groupDef.groupId = node.getGroupId();
|
|
106
|
-
groupDef.children = [childDef];
|
|
107
|
-
leafPathTree = groupDef;
|
|
108
|
-
}
|
|
109
|
-
} else {
|
|
110
|
-
var colDef = Object.assign({}, node.getColDef());
|
|
111
|
-
// ensure col contains colId
|
|
112
|
-
colDef.colId = node.getColId();
|
|
113
|
-
leafPathTree = colDef;
|
|
114
|
-
}
|
|
115
|
-
// walk tree
|
|
116
|
-
var parent = node.getOriginalParent();
|
|
117
|
-
if (parent) {
|
|
118
|
-
// keep walking up the tree until we reach the root
|
|
119
|
-
return getLeafPathTree(parent, leafPathTree);
|
|
120
|
-
} else {
|
|
121
|
-
// we have reached the root - exit with resulting leaf path tree
|
|
122
|
-
return leafPathTree;
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
// obtain a sorted list of all grid columns
|
|
126
|
-
var allGridColumns = this.columnModel.getAllGridColumns();
|
|
127
|
-
// only primary columns and non row group columns should appear in the tool panel
|
|
128
|
-
var allPrimaryGridColumns = allGridColumns.filter(function (column) {
|
|
129
|
-
var colDef = column.getColDef();
|
|
130
|
-
return column.isPrimary() && !colDef.showRowGroup;
|
|
131
|
-
});
|
|
132
|
-
// construct a leaf path tree for each column
|
|
133
|
-
return allPrimaryGridColumns.map(function (col) {
|
|
134
|
-
return getLeafPathTree(col, col.getColDef());
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
}, {
|
|
138
|
-
key: "mergeLeafPathTrees",
|
|
139
|
-
value: function mergeLeafPathTrees(leafPathTrees) {
|
|
140
|
-
var _this3 = this;
|
|
141
|
-
var matchingRootGroupIds = function matchingRootGroupIds(pathA, pathB) {
|
|
142
|
-
var bothPathsAreGroups = _this3.isColGroupDef(pathA) && _this3.isColGroupDef(pathB);
|
|
143
|
-
return bothPathsAreGroups && _this3.getId(pathA) === _this3.getId(pathB);
|
|
144
|
-
};
|
|
145
|
-
var mergeTrees = function mergeTrees(treeA, treeB) {
|
|
146
|
-
if (!_this3.isColGroupDef(treeB)) {
|
|
147
|
-
return treeA;
|
|
148
|
-
}
|
|
149
|
-
var mergeResult = treeA;
|
|
150
|
-
var groupToMerge = treeB;
|
|
151
|
-
if (groupToMerge.children && groupToMerge.groupId) {
|
|
152
|
-
var added = _this3.addChildrenToGroup(mergeResult, groupToMerge.groupId, groupToMerge.children[0]);
|
|
153
|
-
if (added) {
|
|
154
|
-
return mergeResult;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
groupToMerge.children.forEach(function (child) {
|
|
158
|
-
return mergeTrees(mergeResult, child);
|
|
159
|
-
});
|
|
160
|
-
return mergeResult;
|
|
161
|
-
};
|
|
162
|
-
// we can't just merge the leaf path trees as groups can be split apart - instead only merge if leaf
|
|
163
|
-
// path groups with the same root group id are contiguous.
|
|
164
|
-
var mergeColDefs = [];
|
|
165
|
-
for (var i = 1; i <= leafPathTrees.length; i++) {
|
|
166
|
-
var first = leafPathTrees[i - 1];
|
|
167
|
-
var second = leafPathTrees[i];
|
|
168
|
-
if (matchingRootGroupIds(first, second)) {
|
|
169
|
-
leafPathTrees[i] = mergeTrees(first, second);
|
|
170
|
-
} else {
|
|
171
|
-
mergeColDefs.push(first);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return mergeColDefs;
|
|
175
|
-
}
|
|
176
|
-
}, {
|
|
177
|
-
key: "addChildrenToGroup",
|
|
178
|
-
value: function addChildrenToGroup(tree, groupId, colDef) {
|
|
179
|
-
var _this4 = this;
|
|
180
|
-
var subGroupIsSplit = function subGroupIsSplit(currentSubGroup, currentSubGroupToAdd) {
|
|
181
|
-
var existingChildIds = currentSubGroup.children.map(_this4.getId);
|
|
182
|
-
var childGroupAlreadyExists = _.includes(existingChildIds, _this4.getId(currentSubGroupToAdd));
|
|
183
|
-
var lastChild = _.last(currentSubGroup.children);
|
|
184
|
-
var lastChildIsDifferent = lastChild && _this4.getId(lastChild) !== _this4.getId(currentSubGroupToAdd);
|
|
185
|
-
return childGroupAlreadyExists && lastChildIsDifferent;
|
|
186
|
-
};
|
|
187
|
-
if (!this.isColGroupDef(tree)) {
|
|
188
|
-
return true;
|
|
189
|
-
}
|
|
190
|
-
var currentGroup = tree;
|
|
191
|
-
var groupToAdd = colDef;
|
|
192
|
-
if (subGroupIsSplit(currentGroup, groupToAdd)) {
|
|
193
|
-
currentGroup.children.push(groupToAdd);
|
|
194
|
-
return true;
|
|
195
|
-
}
|
|
196
|
-
if (currentGroup.groupId === groupId) {
|
|
197
|
-
// add children that don't already exist to group
|
|
198
|
-
var existingChildIds = currentGroup.children.map(this.getId);
|
|
199
|
-
var colDefAlreadyPresent = _.includes(existingChildIds, this.getId(groupToAdd));
|
|
200
|
-
if (!colDefAlreadyPresent) {
|
|
201
|
-
currentGroup.children.push(groupToAdd);
|
|
202
|
-
return true;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
// recurse until correct group is found to add children
|
|
206
|
-
currentGroup.children.forEach(function (subGroup) {
|
|
207
|
-
return _this4.addChildrenToGroup(subGroup, groupId, colDef);
|
|
208
|
-
});
|
|
209
|
-
return false;
|
|
210
|
-
}
|
|
211
|
-
}]);
|
|
212
|
-
return ToolPanelColDefService;
|
|
213
|
-
}(BeanStub);
|
|
214
|
-
__decorate([Autowired('columnModel')], ToolPanelColDefService.prototype, "columnModel", void 0);
|
|
215
|
-
ToolPanelColDefService = __decorate([Bean('toolPanelColDefService')], ToolPanelColDefService);
|
|
216
|
-
export { ToolPanelColDefService };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Component } from "@ag-grid-community/core";
|
|
2
|
-
export declare class HorizontalResizeComp extends Component {
|
|
3
|
-
private horizontalResizeService;
|
|
4
|
-
private startingWidth;
|
|
5
|
-
private elementToResize;
|
|
6
|
-
private inverted;
|
|
7
|
-
private minWidth;
|
|
8
|
-
private maxWidth;
|
|
9
|
-
constructor();
|
|
10
|
-
setElementToResize(elementToResize: HTMLElement): void;
|
|
11
|
-
private postConstruct;
|
|
12
|
-
private dispatchResizeEvent;
|
|
13
|
-
private onResizeStart;
|
|
14
|
-
private onResizeEnd;
|
|
15
|
-
private onResizing;
|
|
16
|
-
setInverted(inverted: boolean): void;
|
|
17
|
-
setMaxWidth(value: number | null): void;
|
|
18
|
-
setMinWidth(value: number | null): void;
|
|
19
|
-
}
|
|
@@ -1,108 +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, Component, PostConstruct, Events } from "@ag-grid-community/core";
|
|
22
|
-
export var HorizontalResizeComp = /*#__PURE__*/function (_Component) {
|
|
23
|
-
_inherits(HorizontalResizeComp, _Component);
|
|
24
|
-
var _super = _createSuper(HorizontalResizeComp);
|
|
25
|
-
function HorizontalResizeComp() {
|
|
26
|
-
var _this;
|
|
27
|
-
_classCallCheck(this, HorizontalResizeComp);
|
|
28
|
-
_this = _super.call(this, /* html */"<div class=\"ag-tool-panel-horizontal-resize\"></div>");
|
|
29
|
-
_this.minWidth = 100;
|
|
30
|
-
_this.maxWidth = null;
|
|
31
|
-
return _this;
|
|
32
|
-
}
|
|
33
|
-
_createClass(HorizontalResizeComp, [{
|
|
34
|
-
key: "setElementToResize",
|
|
35
|
-
value: function setElementToResize(elementToResize) {
|
|
36
|
-
this.elementToResize = elementToResize;
|
|
37
|
-
}
|
|
38
|
-
}, {
|
|
39
|
-
key: "postConstruct",
|
|
40
|
-
value: function postConstruct() {
|
|
41
|
-
var finishedWithResizeFunc = this.horizontalResizeService.addResizeBar({
|
|
42
|
-
eResizeBar: this.getGui(),
|
|
43
|
-
dragStartPixels: 1,
|
|
44
|
-
onResizeStart: this.onResizeStart.bind(this),
|
|
45
|
-
onResizing: this.onResizing.bind(this),
|
|
46
|
-
onResizeEnd: this.onResizeEnd.bind(this)
|
|
47
|
-
});
|
|
48
|
-
this.addDestroyFunc(finishedWithResizeFunc);
|
|
49
|
-
this.setInverted(this.gridOptionsService.is('enableRtl'));
|
|
50
|
-
}
|
|
51
|
-
}, {
|
|
52
|
-
key: "dispatchResizeEvent",
|
|
53
|
-
value: function dispatchResizeEvent(start, end, width) {
|
|
54
|
-
var event = {
|
|
55
|
-
type: Events.EVENT_TOOL_PANEL_SIZE_CHANGED,
|
|
56
|
-
width: width,
|
|
57
|
-
started: start,
|
|
58
|
-
ended: end
|
|
59
|
-
};
|
|
60
|
-
this.eventService.dispatchEvent(event);
|
|
61
|
-
}
|
|
62
|
-
}, {
|
|
63
|
-
key: "onResizeStart",
|
|
64
|
-
value: function onResizeStart() {
|
|
65
|
-
this.startingWidth = this.elementToResize.offsetWidth;
|
|
66
|
-
this.dispatchResizeEvent(true, false, this.startingWidth);
|
|
67
|
-
}
|
|
68
|
-
}, {
|
|
69
|
-
key: "onResizeEnd",
|
|
70
|
-
value: function onResizeEnd(delta) {
|
|
71
|
-
return this.onResizing(delta, true);
|
|
72
|
-
}
|
|
73
|
-
}, {
|
|
74
|
-
key: "onResizing",
|
|
75
|
-
value: function onResizing(delta) {
|
|
76
|
-
var isEnd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
77
|
-
var direction = this.inverted ? -1 : 1;
|
|
78
|
-
var newWidth = Math.max(this.minWidth, Math.floor(this.startingWidth - delta * direction));
|
|
79
|
-
if (this.maxWidth != null) {
|
|
80
|
-
newWidth = Math.min(this.maxWidth, newWidth);
|
|
81
|
-
}
|
|
82
|
-
this.elementToResize.style.width = "".concat(newWidth, "px");
|
|
83
|
-
this.dispatchResizeEvent(false, isEnd, newWidth);
|
|
84
|
-
}
|
|
85
|
-
}, {
|
|
86
|
-
key: "setInverted",
|
|
87
|
-
value: function setInverted(inverted) {
|
|
88
|
-
this.inverted = inverted;
|
|
89
|
-
}
|
|
90
|
-
}, {
|
|
91
|
-
key: "setMaxWidth",
|
|
92
|
-
value: function setMaxWidth(value) {
|
|
93
|
-
this.maxWidth = value;
|
|
94
|
-
}
|
|
95
|
-
}, {
|
|
96
|
-
key: "setMinWidth",
|
|
97
|
-
value: function setMinWidth(value) {
|
|
98
|
-
if (value != null) {
|
|
99
|
-
this.minWidth = value;
|
|
100
|
-
} else {
|
|
101
|
-
this.minWidth = 100;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}]);
|
|
105
|
-
return HorizontalResizeComp;
|
|
106
|
-
}(Component);
|
|
107
|
-
__decorate([Autowired('horizontalResizeService')], HorizontalResizeComp.prototype, "horizontalResizeService", void 0);
|
|
108
|
-
__decorate([PostConstruct], HorizontalResizeComp.prototype, "postConstruct", null);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Component, ToolPanelDef } from "@ag-grid-community/core";
|
|
2
|
-
export declare class SideBarButtonComp extends Component {
|
|
3
|
-
static EVENT_TOGGLE_BUTTON_CLICKED: string;
|
|
4
|
-
private eToggleButton;
|
|
5
|
-
private eIconWrapper;
|
|
6
|
-
private eLabel;
|
|
7
|
-
private readonly toolPanelDef;
|
|
8
|
-
constructor(toolPanelDef: ToolPanelDef);
|
|
9
|
-
getToolPanelId(): string;
|
|
10
|
-
private postConstruct;
|
|
11
|
-
private createTemplate;
|
|
12
|
-
private setLabel;
|
|
13
|
-
private setIcon;
|
|
14
|
-
private onButtonPressed;
|
|
15
|
-
setSelected(selected: boolean): void;
|
|
16
|
-
}
|
|
@@ -1,84 +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 { Component, PostConstruct, RefSelector, _ } from "@ag-grid-community/core";
|
|
22
|
-
export var SideBarButtonComp = /*#__PURE__*/function (_Component) {
|
|
23
|
-
_inherits(SideBarButtonComp, _Component);
|
|
24
|
-
var _super = _createSuper(SideBarButtonComp);
|
|
25
|
-
function SideBarButtonComp(toolPanelDef) {
|
|
26
|
-
var _this;
|
|
27
|
-
_classCallCheck(this, SideBarButtonComp);
|
|
28
|
-
_this = _super.call(this);
|
|
29
|
-
_this.toolPanelDef = toolPanelDef;
|
|
30
|
-
return _this;
|
|
31
|
-
}
|
|
32
|
-
_createClass(SideBarButtonComp, [{
|
|
33
|
-
key: "getToolPanelId",
|
|
34
|
-
value: function getToolPanelId() {
|
|
35
|
-
return this.toolPanelDef.id;
|
|
36
|
-
}
|
|
37
|
-
}, {
|
|
38
|
-
key: "postConstruct",
|
|
39
|
-
value: function postConstruct() {
|
|
40
|
-
var template = this.createTemplate();
|
|
41
|
-
this.setTemplate(template);
|
|
42
|
-
this.setLabel();
|
|
43
|
-
this.setIcon();
|
|
44
|
-
this.addManagedListener(this.eToggleButton, 'click', this.onButtonPressed.bind(this));
|
|
45
|
-
}
|
|
46
|
-
}, {
|
|
47
|
-
key: "createTemplate",
|
|
48
|
-
value: function createTemplate() {
|
|
49
|
-
var res = /* html */"<div class=\"ag-side-button\" role=\"presentation\">\n <button type=\"button\" ref=\"eToggleButton\" tabindex=\"-1\" role=\"tab\" class=\"ag-side-button-button\">\n <div ref=\"eIconWrapper\" class=\"ag-side-button-icon-wrapper\" aria-hidden=\"true\"></div>\n <span ref =\"eLabel\" class=\"ag-side-button-label\"></span>\n </button>\n </div>";
|
|
50
|
-
return res;
|
|
51
|
-
}
|
|
52
|
-
}, {
|
|
53
|
-
key: "setLabel",
|
|
54
|
-
value: function setLabel() {
|
|
55
|
-
var translate = this.localeService.getLocaleTextFunc();
|
|
56
|
-
var def = this.toolPanelDef;
|
|
57
|
-
var label = translate(def.labelKey, def.labelDefault);
|
|
58
|
-
this.eLabel.innerText = label;
|
|
59
|
-
}
|
|
60
|
-
}, {
|
|
61
|
-
key: "setIcon",
|
|
62
|
-
value: function setIcon() {
|
|
63
|
-
this.eIconWrapper.insertAdjacentElement('afterbegin', _.createIconNoSpan(this.toolPanelDef.iconKey, this.gridOptionsService));
|
|
64
|
-
}
|
|
65
|
-
}, {
|
|
66
|
-
key: "onButtonPressed",
|
|
67
|
-
value: function onButtonPressed() {
|
|
68
|
-
this.dispatchEvent({
|
|
69
|
-
type: SideBarButtonComp.EVENT_TOGGLE_BUTTON_CLICKED
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
key: "setSelected",
|
|
74
|
-
value: function setSelected(selected) {
|
|
75
|
-
this.addOrRemoveCssClass('ag-selected', selected);
|
|
76
|
-
}
|
|
77
|
-
}]);
|
|
78
|
-
return SideBarButtonComp;
|
|
79
|
-
}(Component);
|
|
80
|
-
SideBarButtonComp.EVENT_TOGGLE_BUTTON_CLICKED = 'toggleButtonClicked';
|
|
81
|
-
__decorate([RefSelector('eToggleButton')], SideBarButtonComp.prototype, "eToggleButton", void 0);
|
|
82
|
-
__decorate([RefSelector('eIconWrapper')], SideBarButtonComp.prototype, "eIconWrapper", void 0);
|
|
83
|
-
__decorate([RefSelector('eLabel')], SideBarButtonComp.prototype, "eLabel", void 0);
|
|
84
|
-
__decorate([PostConstruct], SideBarButtonComp.prototype, "postConstruct", null);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AgEvent, Component, ToolPanelDef } from "@ag-grid-community/core";
|
|
2
|
-
export interface SideBarButtonClickedEvent extends AgEvent {
|
|
3
|
-
toolPanelId: string;
|
|
4
|
-
}
|
|
5
|
-
export declare class SideBarButtonsComp extends Component {
|
|
6
|
-
static EVENT_SIDE_BAR_BUTTON_CLICKED: string;
|
|
7
|
-
private static readonly TEMPLATE;
|
|
8
|
-
private buttonComps;
|
|
9
|
-
private focusService;
|
|
10
|
-
private columnModel;
|
|
11
|
-
constructor();
|
|
12
|
-
private postConstruct;
|
|
13
|
-
private handleKeyDown;
|
|
14
|
-
setToolPanelDefs(toolPanelDefs: ToolPanelDef[]): void;
|
|
15
|
-
setActiveButton(id: string | undefined): void;
|
|
16
|
-
private addButtonComp;
|
|
17
|
-
clearButtons(): void;
|
|
18
|
-
}
|
|
@@ -1,89 +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, Component, PostConstruct, PreDestroy, _, KeyCode } from "@ag-grid-community/core";
|
|
22
|
-
import { SideBarButtonComp } from "./sideBarButtonComp";
|
|
23
|
-
export var SideBarButtonsComp = /*#__PURE__*/function (_Component) {
|
|
24
|
-
_inherits(SideBarButtonsComp, _Component);
|
|
25
|
-
var _super = _createSuper(SideBarButtonsComp);
|
|
26
|
-
function SideBarButtonsComp() {
|
|
27
|
-
var _this;
|
|
28
|
-
_classCallCheck(this, SideBarButtonsComp);
|
|
29
|
-
_this = _super.call(this, SideBarButtonsComp.TEMPLATE);
|
|
30
|
-
_this.buttonComps = [];
|
|
31
|
-
return _this;
|
|
32
|
-
}
|
|
33
|
-
_createClass(SideBarButtonsComp, [{
|
|
34
|
-
key: "postConstruct",
|
|
35
|
-
value: function postConstruct() {
|
|
36
|
-
this.addManagedListener(this.getFocusableElement(), 'keydown', this.handleKeyDown.bind(this));
|
|
37
|
-
}
|
|
38
|
-
}, {
|
|
39
|
-
key: "handleKeyDown",
|
|
40
|
-
value: function handleKeyDown(e) {
|
|
41
|
-
if (e.key !== KeyCode.TAB || !e.shiftKey) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
var lastColumn = _.last(this.columnModel.getAllDisplayedColumns());
|
|
45
|
-
if (this.focusService.focusGridView(lastColumn, true)) {
|
|
46
|
-
e.preventDefault();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}, {
|
|
50
|
-
key: "setToolPanelDefs",
|
|
51
|
-
value: function setToolPanelDefs(toolPanelDefs) {
|
|
52
|
-
toolPanelDefs.forEach(this.addButtonComp.bind(this));
|
|
53
|
-
}
|
|
54
|
-
}, {
|
|
55
|
-
key: "setActiveButton",
|
|
56
|
-
value: function setActiveButton(id) {
|
|
57
|
-
this.buttonComps.forEach(function (comp) {
|
|
58
|
-
comp.setSelected(id === comp.getToolPanelId());
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}, {
|
|
62
|
-
key: "addButtonComp",
|
|
63
|
-
value: function addButtonComp(def) {
|
|
64
|
-
var _this2 = this;
|
|
65
|
-
var buttonComp = this.createBean(new SideBarButtonComp(def));
|
|
66
|
-
this.buttonComps.push(buttonComp);
|
|
67
|
-
this.appendChild(buttonComp);
|
|
68
|
-
buttonComp.addEventListener(SideBarButtonComp.EVENT_TOGGLE_BUTTON_CLICKED, function () {
|
|
69
|
-
_this2.dispatchEvent({
|
|
70
|
-
type: SideBarButtonsComp.EVENT_SIDE_BAR_BUTTON_CLICKED,
|
|
71
|
-
toolPanelId: def.id
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}, {
|
|
76
|
-
key: "clearButtons",
|
|
77
|
-
value: function clearButtons() {
|
|
78
|
-
this.buttonComps = this.destroyBeans(this.buttonComps);
|
|
79
|
-
_.clearElement(this.getGui());
|
|
80
|
-
}
|
|
81
|
-
}]);
|
|
82
|
-
return SideBarButtonsComp;
|
|
83
|
-
}(Component);
|
|
84
|
-
SideBarButtonsComp.EVENT_SIDE_BAR_BUTTON_CLICKED = 'sideBarButtonClicked';
|
|
85
|
-
SideBarButtonsComp.TEMPLATE = "<div class=\"ag-side-buttons\" role=\"tablist\"></div>";
|
|
86
|
-
__decorate([Autowired('focusService')], SideBarButtonsComp.prototype, "focusService", void 0);
|
|
87
|
-
__decorate([Autowired('columnModel')], SideBarButtonsComp.prototype, "columnModel", void 0);
|
|
88
|
-
__decorate([PostConstruct], SideBarButtonsComp.prototype, "postConstruct", null);
|
|
89
|
-
__decorate([PreDestroy], SideBarButtonsComp.prototype, "clearButtons", null);
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Component, ISideBar, IToolPanel, SideBarDef } from "@ag-grid-community/core";
|
|
2
|
-
export declare class SideBarComp extends Component implements ISideBar {
|
|
3
|
-
private gridApi;
|
|
4
|
-
private focusService;
|
|
5
|
-
private sideBarButtonsComp;
|
|
6
|
-
private toolPanelWrappers;
|
|
7
|
-
private sideBar;
|
|
8
|
-
private static readonly TEMPLATE;
|
|
9
|
-
constructor();
|
|
10
|
-
private postConstruct;
|
|
11
|
-
protected onTabKeyDown(e: KeyboardEvent): void;
|
|
12
|
-
protected handleKeyDown(e: KeyboardEvent): void;
|
|
13
|
-
private onToolPanelButtonClicked;
|
|
14
|
-
private clearDownUi;
|
|
15
|
-
private setSideBarDef;
|
|
16
|
-
getDef(): SideBarDef | undefined;
|
|
17
|
-
setSideBarPosition(position?: 'left' | 'right'): this;
|
|
18
|
-
private setupToolPanels;
|
|
19
|
-
refresh(): void;
|
|
20
|
-
openToolPanel(key: string | undefined, source?: 'sideBarButtonClicked' | 'sideBarInitializing' | 'api'): void;
|
|
21
|
-
getToolPanelInstance(key: string): IToolPanel | undefined;
|
|
22
|
-
private raiseToolPanelVisibleEvent;
|
|
23
|
-
close(source?: 'sideBarButtonClicked' | 'sideBarInitializing' | 'api'): void;
|
|
24
|
-
isToolPanelShowing(): boolean;
|
|
25
|
-
openedItem(): string | null;
|
|
26
|
-
private destroyToolPanelWrappers;
|
|
27
|
-
protected destroy(): void;
|
|
28
|
-
}
|