@lemon-fe/components 1.2.14 → 1.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/data-grid/cell-editors/date.d.ts +2 -2
- package/es/data-grid/cell-editors/number.d.ts +2 -2
- package/es/data-grid/cell-editors/number.js +1 -4
- package/es/data-grid/cell-editors/row.d.ts +2 -2
- package/es/data-grid/cell-editors/select.d.ts +3 -3
- package/es/data-grid/cell-editors/text.d.ts +2 -2
- package/es/data-grid/cell-editors/utils.d.ts +1 -1
- package/es/data-grid/components/custom-panel/index.d.ts +1 -1
- package/es/data-grid/components/custom-panel/item.d.ts +1 -1
- package/es/data-grid/components/custom-panel/typings.d.ts +1 -1
- package/es/data-grid/index.d.ts +8 -7
- package/es/data-grid/index.js +39 -21
- package/es/data-grid/index.less +1 -1
- package/es/data-grid/locale/en_US.js +3 -1
- package/es/data-grid/locale/zh_CN.js +3 -1
- package/es/data-grid/renderer/actions-renderer.d.ts +1 -1
- package/es/data-grid/renderer/actions.d.ts +1 -1
- package/es/data-grid/renderer/cell-delete-renderer.d.ts +1 -1
- package/es/data-grid/renderer/cell-index-renderer.d.ts +1 -1
- package/es/data-grid/renderer/cell-renderer.d.ts +1 -1
- package/es/data-grid/renderer/detali-cell-renderer.d.ts +1 -1
- package/es/data-grid/renderer/header-renderer.d.ts +1 -1
- package/es/data-grid/renderer/header-renderer.js +0 -1
- package/es/data-grid/typings.d.ts +2 -2
- package/es/data-grid/utils.d.ts +1 -1
- package/es/index.d.ts +4 -3
- package/es/index.js +4 -2
- package/es/select-view/index.d.ts +1 -1
- package/package.json +5 -14
- package/es/data-grid/modules/clipboard/clipboard/clipboardService.d.ts +0 -62
- package/es/data-grid/modules/clipboard/clipboard/clipboardService.js +0 -1007
- package/es/data-grid/modules/clipboard/clipboardModule.d.ts +0 -2
- package/es/data-grid/modules/clipboard/clipboardModule.js +0 -10
- package/es/data-grid/modules/clipboard/main.d.ts +0 -1
- package/es/data-grid/modules/clipboard/main.js +0 -1
- package/es/data-grid/modules/clipboard/version.d.ts +0 -1
- package/es/data-grid/modules/clipboard/version.js +0 -2
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnModelItem.d.ts +0 -26
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnModelItem.js +0 -94
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnToolPanel.d.ts +0 -32
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnToolPanel.js +0 -272
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/modelItemUtils.d.ts +0 -16
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/modelItemUtils.js +0 -209
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/pivotModePanel.d.ts +0 -9
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/pivotModePanel.js +0 -68
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.d.ts +0 -32
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.js +0 -150
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.d.ts +0 -44
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.js +0 -455
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.d.ts +0 -26
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.js +0 -224
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.d.ts +0 -24
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.js +0 -123
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.d.ts +0 -37
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.js +0 -314
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.d.ts +0 -51
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.js +0 -406
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.d.ts +0 -24
- package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.js +0 -264
- package/es/data-grid/modules/column-tool-panel/columnsToolPanelModule.d.ts +0 -2
- package/es/data-grid/modules/column-tool-panel/columnsToolPanelModule.js +0 -29
- package/es/data-grid/modules/column-tool-panel/main.d.ts +0 -2
- package/es/data-grid/modules/column-tool-panel/main.js +0 -3
- package/es/data-grid/modules/column-tool-panel/version.d.ts +0 -1
- package/es/data-grid/modules/column-tool-panel/version.js +0 -2
- package/es/data-grid/modules/master-detail/main.d.ts +0 -1
- package/es/data-grid/modules/master-detail/main.js +0 -1
- package/es/data-grid/modules/master-detail/masterDetail/detailCellRenderer.d.ts +0 -14
- package/es/data-grid/modules/master-detail/masterDetail/detailCellRenderer.js +0 -144
- package/es/data-grid/modules/master-detail/masterDetail/detailCellRendererCtrl.d.ts +0 -19
- package/es/data-grid/modules/master-detail/masterDetail/detailCellRendererCtrl.js +0 -203
- package/es/data-grid/modules/master-detail/masterDetailModule.d.ts +0 -2
- package/es/data-grid/modules/master-detail/masterDetailModule.js +0 -18
- package/es/data-grid/modules/master-detail/version.d.ts +0 -1
- package/es/data-grid/modules/master-detail/version.js +0 -2
- package/es/data-grid/modules/menu/main.d.ts +0 -1
- package/es/data-grid/modules/menu/main.js +0 -1
- package/es/data-grid/modules/menu/menu/chartMenuItemMapper.d.ts +0 -13
- package/es/data-grid/modules/menu/menu/chartMenuItemMapper.js +0 -351
- package/es/data-grid/modules/menu/menu/contextMenu.d.ts +0 -13
- package/es/data-grid/modules/menu/menu/contextMenu.js +0 -267
- package/es/data-grid/modules/menu/menu/enterpriseMenu.d.ts +0 -66
- package/es/data-grid/modules/menu/menu/enterpriseMenu.js +0 -592
- package/es/data-grid/modules/menu/menu/menuItemMapper.d.ts +0 -13
- package/es/data-grid/modules/menu/menu/menuItemMapper.js +0 -328
- package/es/data-grid/modules/menu/menuModule.d.ts +0 -2
- package/es/data-grid/modules/menu/menuModule.js +0 -12
- package/es/data-grid/modules/menu/version.d.ts +0 -1
- package/es/data-grid/modules/menu/version.js +0 -2
- package/es/data-grid/modules/row-grouping/main.d.ts +0 -4
- package/es/data-grid/modules/row-grouping/main.js +0 -4
- package/es/data-grid/modules/row-grouping/rowGrouping/aggFuncService.d.ts +0 -23
- package/es/data-grid/modules/row-grouping/rowGrouping/aggFuncService.js +0 -250
- package/es/data-grid/modules/row-grouping/rowGrouping/aggregationStage.d.ts +0 -22
- package/es/data-grid/modules/row-grouping/rowGrouping/aggregationStage.js +0 -285
- package/es/data-grid/modules/row-grouping/rowGrouping/batchRemover.d.ts +0 -12
- package/es/data-grid/modules/row-grouping/rowGrouping/batchRemover.js +0 -77
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.d.ts +0 -75
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.js +0 -516
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.d.ts +0 -40
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.js +0 -367
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.d.ts +0 -11
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.js +0 -85
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.d.ts +0 -17
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.js +0 -139
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.d.ts +0 -15
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.js +0 -105
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.d.ts +0 -15
- package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.js +0 -105
- package/es/data-grid/modules/row-grouping/rowGrouping/filterAggregatesStage.d.ts +0 -9
- package/es/data-grid/modules/row-grouping/rowGrouping/filterAggregatesStage.js +0 -136
- package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFilter.d.ts +0 -39
- package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFilter.js +0 -319
- package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFloatingFilter.d.ts +0 -23
- package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFloatingFilter.js +0 -163
- package/es/data-grid/modules/row-grouping/rowGrouping/groupStage.d.ts +0 -48
- package/es/data-grid/modules/row-grouping/rowGrouping/groupStage.js +0 -740
- package/es/data-grid/modules/row-grouping/rowGrouping/pivotColDefService.d.ts +0 -24
- package/es/data-grid/modules/row-grouping/rowGrouping/pivotColDefService.js +0 -396
- package/es/data-grid/modules/row-grouping/rowGrouping/pivotStage.d.ts +0 -19
- package/es/data-grid/modules/row-grouping/rowGrouping/pivotStage.js +0 -182
- package/es/data-grid/modules/row-grouping/rowGroupingModule.d.ts +0 -2
- package/es/data-grid/modules/row-grouping/rowGroupingModule.js +0 -28
- package/es/data-grid/modules/row-grouping/version.d.ts +0 -1
- package/es/data-grid/modules/row-grouping/version.js +0 -2
- package/es/data-grid/modules/side-bar/main.d.ts +0 -2
- package/es/data-grid/modules/side-bar/main.js +0 -2
- package/es/data-grid/modules/side-bar/sideBar/common/toolPanelColDefService.d.ts +0 -11
- package/es/data-grid/modules/side-bar/sideBar/common/toolPanelColDefService.js +0 -216
- package/es/data-grid/modules/side-bar/sideBar/horizontalResizeComp.d.ts +0 -19
- package/es/data-grid/modules/side-bar/sideBar/horizontalResizeComp.js +0 -108
- package/es/data-grid/modules/side-bar/sideBar/sideBarButtonComp.d.ts +0 -16
- package/es/data-grid/modules/side-bar/sideBar/sideBarButtonComp.js +0 -84
- package/es/data-grid/modules/side-bar/sideBar/sideBarButtonsComp.d.ts +0 -18
- package/es/data-grid/modules/side-bar/sideBar/sideBarButtonsComp.js +0 -89
- package/es/data-grid/modules/side-bar/sideBar/sideBarComp.d.ts +0 -28
- package/es/data-grid/modules/side-bar/sideBar/sideBarComp.js +0 -325
- package/es/data-grid/modules/side-bar/sideBar/sideBarDefParser.d.ts +0 -10
- package/es/data-grid/modules/side-bar/sideBar/sideBarDefParser.js +0 -95
- package/es/data-grid/modules/side-bar/sideBar/toolPanelWrapper.d.ts +0 -17
- package/es/data-grid/modules/side-bar/sideBar/toolPanelWrapper.js +0 -103
- package/es/data-grid/modules/side-bar/sideBarModule.d.ts +0 -2
- package/es/data-grid/modules/side-bar/sideBarModule.js +0 -22
- package/es/data-grid/modules/side-bar/version.d.ts +0 -1
- package/es/data-grid/modules/side-bar/version.js +0 -2
|
@@ -1,406 +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 _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
7
|
-
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
8
|
-
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); }
|
|
9
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
10
|
-
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); }; }
|
|
11
|
-
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); }
|
|
12
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
13
|
-
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; } }
|
|
14
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
15
|
-
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); }
|
|
16
|
-
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
|
|
17
|
-
var c = arguments.length,
|
|
18
|
-
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
19
|
-
d;
|
|
20
|
-
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;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
import { _, AgCheckbox, Autowired, Column, Component, CssClassApplier, DragAndDropService, DragSourceType, Events, KeyCode, PostConstruct, RefSelector, TouchListener } from "@ag-grid-community/core";
|
|
24
|
-
import { ColumnModelItem } from "./columnModelItem";
|
|
25
|
-
import { ToolPanelContextMenu } from "./toolPanelContextMenu";
|
|
26
|
-
export var ToolPanelColumnGroupComp = /*#__PURE__*/function (_Component) {
|
|
27
|
-
_inherits(ToolPanelColumnGroupComp, _Component);
|
|
28
|
-
var _super = _createSuper(ToolPanelColumnGroupComp);
|
|
29
|
-
function ToolPanelColumnGroupComp(modelItem, allowDragging, eventType, focusWrapper) {
|
|
30
|
-
var _this;
|
|
31
|
-
_classCallCheck(this, ToolPanelColumnGroupComp);
|
|
32
|
-
_this = _super.call(this);
|
|
33
|
-
_this.modelItem = modelItem;
|
|
34
|
-
_this.allowDragging = allowDragging;
|
|
35
|
-
_this.eventType = eventType;
|
|
36
|
-
_this.focusWrapper = focusWrapper;
|
|
37
|
-
_this.processingColumnStateChange = false;
|
|
38
|
-
_this.modelItem = modelItem;
|
|
39
|
-
_this.columnGroup = modelItem.getColumnGroup();
|
|
40
|
-
_this.columnDept = modelItem.getDept();
|
|
41
|
-
_this.allowDragging = allowDragging;
|
|
42
|
-
return _this;
|
|
43
|
-
}
|
|
44
|
-
_createClass(ToolPanelColumnGroupComp, [{
|
|
45
|
-
key: "init",
|
|
46
|
-
value: function init() {
|
|
47
|
-
var _this2 = this;
|
|
48
|
-
this.setTemplate(ToolPanelColumnGroupComp.TEMPLATE);
|
|
49
|
-
this.eDragHandle = _.createIconNoSpan('columnDrag', this.gridOptionsService);
|
|
50
|
-
this.eDragHandle.classList.add('ag-drag-handle', 'ag-column-select-column-group-drag-handle');
|
|
51
|
-
var checkboxGui = this.cbSelect.getGui();
|
|
52
|
-
var checkboxInput = this.cbSelect.getInputElement();
|
|
53
|
-
checkboxGui.insertAdjacentElement('afterend', this.eDragHandle);
|
|
54
|
-
checkboxInput.setAttribute('tabindex', '-1');
|
|
55
|
-
this.displayName = this.columnModel.getDisplayNameForProvidedColumnGroup(null, this.columnGroup, this.eventType);
|
|
56
|
-
if (_.missing(this.displayName)) {
|
|
57
|
-
this.displayName = '>>';
|
|
58
|
-
}
|
|
59
|
-
this.eLabel.innerHTML = this.displayName ? this.displayName : '';
|
|
60
|
-
this.setupExpandContract();
|
|
61
|
-
this.addCssClass('ag-column-select-indent-' + this.columnDept);
|
|
62
|
-
this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.onColumnStateChanged.bind(this));
|
|
63
|
-
this.addManagedListener(this.eLabel, 'click', this.onLabelClicked.bind(this));
|
|
64
|
-
this.addManagedListener(this.cbSelect, AgCheckbox.EVENT_CHANGED, this.onCheckboxChanged.bind(this));
|
|
65
|
-
this.addManagedListener(this.modelItem, ColumnModelItem.EVENT_EXPANDED_CHANGED, this.onExpandChanged.bind(this));
|
|
66
|
-
this.addManagedListener(this.focusWrapper, 'keydown', this.handleKeyDown.bind(this));
|
|
67
|
-
this.addManagedListener(this.focusWrapper, 'contextmenu', this.onContextMenu.bind(this));
|
|
68
|
-
this.setOpenClosedIcons();
|
|
69
|
-
this.setupDragging();
|
|
70
|
-
this.onColumnStateChanged();
|
|
71
|
-
this.addVisibilityListenersToAllChildren();
|
|
72
|
-
this.refreshAriaExpanded();
|
|
73
|
-
this.refreshAriaLabel();
|
|
74
|
-
this.setupTooltip();
|
|
75
|
-
var classes = CssClassApplier.getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(), this.gridOptionsService, null, this.columnGroup);
|
|
76
|
-
classes.forEach(function (c) {
|
|
77
|
-
return _this2.addOrRemoveCssClass(c, true);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}, {
|
|
81
|
-
key: "getColumns",
|
|
82
|
-
value: function getColumns() {
|
|
83
|
-
return this.columnGroup.getLeafColumns();
|
|
84
|
-
}
|
|
85
|
-
}, {
|
|
86
|
-
key: "setupTooltip",
|
|
87
|
-
value: function setupTooltip() {
|
|
88
|
-
var _this3 = this;
|
|
89
|
-
var colGroupDef = this.columnGroup.getColGroupDef();
|
|
90
|
-
if (!colGroupDef) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
var refresh = function refresh() {
|
|
94
|
-
var newTooltipText = colGroupDef.headerTooltip;
|
|
95
|
-
_this3.setTooltip(newTooltipText);
|
|
96
|
-
};
|
|
97
|
-
refresh();
|
|
98
|
-
this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, refresh);
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
key: "getTooltipParams",
|
|
102
|
-
value: function getTooltipParams() {
|
|
103
|
-
var res = _get(_getPrototypeOf(ToolPanelColumnGroupComp.prototype), "getTooltipParams", this).call(this);
|
|
104
|
-
res.location = 'columnToolPanelColumnGroup';
|
|
105
|
-
return res;
|
|
106
|
-
}
|
|
107
|
-
}, {
|
|
108
|
-
key: "handleKeyDown",
|
|
109
|
-
value: function handleKeyDown(e) {
|
|
110
|
-
switch (e.key) {
|
|
111
|
-
case KeyCode.LEFT:
|
|
112
|
-
e.preventDefault();
|
|
113
|
-
this.modelItem.setExpanded(false);
|
|
114
|
-
break;
|
|
115
|
-
case KeyCode.RIGHT:
|
|
116
|
-
e.preventDefault();
|
|
117
|
-
this.modelItem.setExpanded(true);
|
|
118
|
-
break;
|
|
119
|
-
case KeyCode.SPACE:
|
|
120
|
-
e.preventDefault();
|
|
121
|
-
if (this.isSelectable()) {
|
|
122
|
-
this.onSelectAllChanged(!this.isSelected());
|
|
123
|
-
}
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}, {
|
|
128
|
-
key: "onContextMenu",
|
|
129
|
-
value: function onContextMenu(e) {
|
|
130
|
-
var _this4 = this;
|
|
131
|
-
var columnGroup = this.columnGroup,
|
|
132
|
-
gridOptionsService = this.gridOptionsService;
|
|
133
|
-
if (gridOptionsService.is('functionsReadOnly')) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
var contextMenu = this.createBean(new ToolPanelContextMenu(columnGroup, e, this.focusWrapper));
|
|
137
|
-
this.addDestroyFunc(function () {
|
|
138
|
-
if (contextMenu.isAlive()) {
|
|
139
|
-
_this4.destroyBean(contextMenu);
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}, {
|
|
144
|
-
key: "addVisibilityListenersToAllChildren",
|
|
145
|
-
value: function addVisibilityListenersToAllChildren() {
|
|
146
|
-
var _this5 = this;
|
|
147
|
-
this.columnGroup.getLeafColumns().forEach(function (column) {
|
|
148
|
-
_this5.addManagedListener(column, Column.EVENT_VISIBLE_CHANGED, _this5.onColumnStateChanged.bind(_this5));
|
|
149
|
-
_this5.addManagedListener(column, Column.EVENT_VALUE_CHANGED, _this5.onColumnStateChanged.bind(_this5));
|
|
150
|
-
_this5.addManagedListener(column, Column.EVENT_PIVOT_CHANGED, _this5.onColumnStateChanged.bind(_this5));
|
|
151
|
-
_this5.addManagedListener(column, Column.EVENT_ROW_GROUP_CHANGED, _this5.onColumnStateChanged.bind(_this5));
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
}, {
|
|
155
|
-
key: "setupDragging",
|
|
156
|
-
value: function setupDragging() {
|
|
157
|
-
var _this6 = this;
|
|
158
|
-
if (!this.allowDragging) {
|
|
159
|
-
_.setDisplayed(this.eDragHandle, false);
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
var hideColumnOnExit = !this.gridOptionsService.is('suppressDragLeaveHidesColumns');
|
|
163
|
-
var dragSource = {
|
|
164
|
-
type: DragSourceType.ToolPanel,
|
|
165
|
-
eElement: this.eDragHandle,
|
|
166
|
-
dragItemName: this.displayName,
|
|
167
|
-
defaultIconName: hideColumnOnExit ? DragAndDropService.ICON_HIDE : DragAndDropService.ICON_NOT_ALLOWED,
|
|
168
|
-
getDragItem: function getDragItem() {
|
|
169
|
-
return _this6.createDragItem();
|
|
170
|
-
},
|
|
171
|
-
onDragStarted: function onDragStarted() {
|
|
172
|
-
var event = {
|
|
173
|
-
type: Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,
|
|
174
|
-
column: _this6.columnGroup
|
|
175
|
-
};
|
|
176
|
-
_this6.eventService.dispatchEvent(event);
|
|
177
|
-
},
|
|
178
|
-
onDragStopped: function onDragStopped() {
|
|
179
|
-
var event = {
|
|
180
|
-
type: Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END
|
|
181
|
-
};
|
|
182
|
-
_this6.eventService.dispatchEvent(event);
|
|
183
|
-
},
|
|
184
|
-
onGridEnter: function onGridEnter() {
|
|
185
|
-
if (hideColumnOnExit) {
|
|
186
|
-
// when dragged into the grid, mimic what happens when checkbox is enabled
|
|
187
|
-
// this handles the behaviour for pivot which is different to just hiding a column.
|
|
188
|
-
_this6.onChangeCommon(true);
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
onGridExit: function onGridExit() {
|
|
192
|
-
if (hideColumnOnExit) {
|
|
193
|
-
// when dragged outside of the grid, mimic what happens when checkbox is disabled
|
|
194
|
-
// this handles the behaviour for pivot which is different to just hiding a column.
|
|
195
|
-
_this6.onChangeCommon(false);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
this.dragAndDropService.addDragSource(dragSource, true);
|
|
200
|
-
this.addDestroyFunc(function () {
|
|
201
|
-
return _this6.dragAndDropService.removeDragSource(dragSource);
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
}, {
|
|
205
|
-
key: "createDragItem",
|
|
206
|
-
value: function createDragItem() {
|
|
207
|
-
var visibleState = {};
|
|
208
|
-
this.columnGroup.getLeafColumns().forEach(function (col) {
|
|
209
|
-
visibleState[col.getId()] = col.isVisible();
|
|
210
|
-
});
|
|
211
|
-
return {
|
|
212
|
-
columns: this.columnGroup.getLeafColumns(),
|
|
213
|
-
visibleState: visibleState
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
}, {
|
|
217
|
-
key: "setupExpandContract",
|
|
218
|
-
value: function setupExpandContract() {
|
|
219
|
-
this.eGroupClosedIcon.appendChild(_.createIcon('columnSelectClosed', this.gridOptionsService, null));
|
|
220
|
-
this.eGroupOpenedIcon.appendChild(_.createIcon('columnSelectOpen', this.gridOptionsService, null));
|
|
221
|
-
this.addManagedListener(this.eGroupClosedIcon, 'click', this.onExpandOrContractClicked.bind(this));
|
|
222
|
-
this.addManagedListener(this.eGroupOpenedIcon, 'click', this.onExpandOrContractClicked.bind(this));
|
|
223
|
-
var touchListener = new TouchListener(this.eColumnGroupIcons, true);
|
|
224
|
-
this.addManagedListener(touchListener, TouchListener.EVENT_TAP, this.onExpandOrContractClicked.bind(this));
|
|
225
|
-
this.addDestroyFunc(touchListener.destroy.bind(touchListener));
|
|
226
|
-
}
|
|
227
|
-
}, {
|
|
228
|
-
key: "onLabelClicked",
|
|
229
|
-
value: function onLabelClicked() {
|
|
230
|
-
var nextState = !this.cbSelect.getValue();
|
|
231
|
-
this.onChangeCommon(nextState);
|
|
232
|
-
}
|
|
233
|
-
}, {
|
|
234
|
-
key: "onCheckboxChanged",
|
|
235
|
-
value: function onCheckboxChanged(event) {
|
|
236
|
-
this.onChangeCommon(event.selected);
|
|
237
|
-
}
|
|
238
|
-
}, {
|
|
239
|
-
key: "getVisibleLeafColumns",
|
|
240
|
-
value: function getVisibleLeafColumns() {
|
|
241
|
-
var childColumns = [];
|
|
242
|
-
var extractCols = function extractCols(children) {
|
|
243
|
-
children.forEach(function (child) {
|
|
244
|
-
if (!child.isPassesFilter()) {
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
if (child.isGroup()) {
|
|
248
|
-
extractCols(child.getChildren());
|
|
249
|
-
} else {
|
|
250
|
-
childColumns.push(child.getColumn());
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
};
|
|
254
|
-
extractCols(this.modelItem.getChildren());
|
|
255
|
-
return childColumns;
|
|
256
|
-
}
|
|
257
|
-
}, {
|
|
258
|
-
key: "onChangeCommon",
|
|
259
|
-
value: function onChangeCommon(nextState) {
|
|
260
|
-
this.refreshAriaLabel();
|
|
261
|
-
if (this.processingColumnStateChange) {
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(), nextState, this.eventType);
|
|
265
|
-
}
|
|
266
|
-
}, {
|
|
267
|
-
key: "refreshAriaLabel",
|
|
268
|
-
value: function refreshAriaLabel() {
|
|
269
|
-
var translate = this.localeService.getLocaleTextFunc();
|
|
270
|
-
var columnLabel = translate('ariaColumnGroup', 'Column Group');
|
|
271
|
-
var checkboxValue = this.cbSelect.getValue();
|
|
272
|
-
var state = checkboxValue === undefined ? translate('ariaIndeterminate', 'indeterminate') : checkboxValue ? translate('ariaVisible', 'visible') : translate('ariaHidden', 'hidden');
|
|
273
|
-
var visibilityLabel = translate('ariaToggleVisibility', 'Press SPACE to toggle visibility');
|
|
274
|
-
_.setAriaLabel(this.focusWrapper, "".concat(this.displayName, " ").concat(columnLabel));
|
|
275
|
-
this.cbSelect.setInputAriaLabel("".concat(visibilityLabel, " (").concat(state, ")"));
|
|
276
|
-
_.setAriaDescribedBy(this.focusWrapper, this.cbSelect.getInputElement().id);
|
|
277
|
-
}
|
|
278
|
-
}, {
|
|
279
|
-
key: "onColumnStateChanged",
|
|
280
|
-
value: function onColumnStateChanged() {
|
|
281
|
-
var selectedValue = this.workOutSelectedValue();
|
|
282
|
-
var readOnlyValue = this.workOutReadOnlyValue();
|
|
283
|
-
this.processingColumnStateChange = true;
|
|
284
|
-
this.cbSelect.setValue(selectedValue);
|
|
285
|
-
this.cbSelect.setReadOnly(readOnlyValue);
|
|
286
|
-
this.addOrRemoveCssClass('ag-column-select-column-group-readonly', readOnlyValue);
|
|
287
|
-
this.processingColumnStateChange = false;
|
|
288
|
-
}
|
|
289
|
-
}, {
|
|
290
|
-
key: "workOutSelectedValue",
|
|
291
|
-
value: function workOutSelectedValue() {
|
|
292
|
-
var _this7 = this;
|
|
293
|
-
var pivotMode = this.columnModel.isPivotMode();
|
|
294
|
-
var visibleLeafColumns = this.getVisibleLeafColumns();
|
|
295
|
-
var checkedCount = 0;
|
|
296
|
-
var uncheckedCount = 0;
|
|
297
|
-
visibleLeafColumns.forEach(function (column) {
|
|
298
|
-
if (!pivotMode && column.getColDef().lockVisible) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
if (_this7.isColumnChecked(column, pivotMode)) {
|
|
302
|
-
checkedCount++;
|
|
303
|
-
} else {
|
|
304
|
-
uncheckedCount++;
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
if (checkedCount > 0 && uncheckedCount > 0) {
|
|
308
|
-
return undefined;
|
|
309
|
-
}
|
|
310
|
-
return checkedCount > 0;
|
|
311
|
-
}
|
|
312
|
-
}, {
|
|
313
|
-
key: "workOutReadOnlyValue",
|
|
314
|
-
value: function workOutReadOnlyValue() {
|
|
315
|
-
var pivotMode = this.columnModel.isPivotMode();
|
|
316
|
-
var colsThatCanAction = 0;
|
|
317
|
-
this.columnGroup.getLeafColumns().forEach(function (col) {
|
|
318
|
-
if (pivotMode) {
|
|
319
|
-
if (col.isAnyFunctionAllowed()) {
|
|
320
|
-
colsThatCanAction++;
|
|
321
|
-
}
|
|
322
|
-
} else {
|
|
323
|
-
if (!col.getColDef().lockVisible) {
|
|
324
|
-
colsThatCanAction++;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
return colsThatCanAction === 0;
|
|
329
|
-
}
|
|
330
|
-
}, {
|
|
331
|
-
key: "isColumnChecked",
|
|
332
|
-
value: function isColumnChecked(column, pivotMode) {
|
|
333
|
-
if (pivotMode) {
|
|
334
|
-
var pivoted = column.isPivotActive();
|
|
335
|
-
var grouped = column.isRowGroupActive();
|
|
336
|
-
var aggregated = column.isValueActive();
|
|
337
|
-
return pivoted || grouped || aggregated;
|
|
338
|
-
}
|
|
339
|
-
return column.isVisible();
|
|
340
|
-
}
|
|
341
|
-
}, {
|
|
342
|
-
key: "onExpandOrContractClicked",
|
|
343
|
-
value: function onExpandOrContractClicked() {
|
|
344
|
-
var oldState = this.modelItem.isExpanded();
|
|
345
|
-
this.modelItem.setExpanded(!oldState);
|
|
346
|
-
}
|
|
347
|
-
}, {
|
|
348
|
-
key: "onExpandChanged",
|
|
349
|
-
value: function onExpandChanged() {
|
|
350
|
-
this.setOpenClosedIcons();
|
|
351
|
-
this.refreshAriaExpanded();
|
|
352
|
-
}
|
|
353
|
-
}, {
|
|
354
|
-
key: "setOpenClosedIcons",
|
|
355
|
-
value: function setOpenClosedIcons() {
|
|
356
|
-
var folderOpen = this.modelItem.isExpanded();
|
|
357
|
-
_.setDisplayed(this.eGroupClosedIcon, !folderOpen);
|
|
358
|
-
_.setDisplayed(this.eGroupOpenedIcon, folderOpen);
|
|
359
|
-
}
|
|
360
|
-
}, {
|
|
361
|
-
key: "refreshAriaExpanded",
|
|
362
|
-
value: function refreshAriaExpanded() {
|
|
363
|
-
_.setAriaExpanded(this.focusWrapper, this.modelItem.isExpanded());
|
|
364
|
-
}
|
|
365
|
-
}, {
|
|
366
|
-
key: "getDisplayName",
|
|
367
|
-
value: function getDisplayName() {
|
|
368
|
-
return this.displayName;
|
|
369
|
-
}
|
|
370
|
-
}, {
|
|
371
|
-
key: "onSelectAllChanged",
|
|
372
|
-
value: function onSelectAllChanged(value) {
|
|
373
|
-
var cbValue = this.cbSelect.getValue();
|
|
374
|
-
var readOnly = this.cbSelect.isReadOnly();
|
|
375
|
-
if (!readOnly && (value && !cbValue || !value && cbValue)) {
|
|
376
|
-
this.cbSelect.toggle();
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}, {
|
|
380
|
-
key: "isSelected",
|
|
381
|
-
value: function isSelected() {
|
|
382
|
-
return this.cbSelect.getValue();
|
|
383
|
-
}
|
|
384
|
-
}, {
|
|
385
|
-
key: "isSelectable",
|
|
386
|
-
value: function isSelectable() {
|
|
387
|
-
return !this.cbSelect.isReadOnly();
|
|
388
|
-
}
|
|
389
|
-
}, {
|
|
390
|
-
key: "setSelected",
|
|
391
|
-
value: function setSelected(selected) {
|
|
392
|
-
this.cbSelect.setValue(selected, true);
|
|
393
|
-
}
|
|
394
|
-
}]);
|
|
395
|
-
return ToolPanelColumnGroupComp;
|
|
396
|
-
}(Component);
|
|
397
|
-
ToolPanelColumnGroupComp.TEMPLATE = "<div class=\"ag-column-select-column-group\" aria-hidden=\"true\">\n <span class=\"ag-column-group-icons\" ref=\"eColumnGroupIcons\" >\n <span class=\"ag-column-group-closed-icon\" ref=\"eGroupClosedIcon\"></span>\n <span class=\"ag-column-group-opened-icon\" ref=\"eGroupOpenedIcon\"></span>\n </span>\n <ag-checkbox ref=\"cbSelect\" class=\"ag-column-select-checkbox\"></ag-checkbox>\n <span class=\"ag-column-select-column-label\" ref=\"eLabel\"></span>\n </div>";
|
|
398
|
-
__decorate([Autowired('columnModel')], ToolPanelColumnGroupComp.prototype, "columnModel", void 0);
|
|
399
|
-
__decorate([Autowired('dragAndDropService')], ToolPanelColumnGroupComp.prototype, "dragAndDropService", void 0);
|
|
400
|
-
__decorate([Autowired('modelItemUtils')], ToolPanelColumnGroupComp.prototype, "modelItemUtils", void 0);
|
|
401
|
-
__decorate([RefSelector('cbSelect')], ToolPanelColumnGroupComp.prototype, "cbSelect", void 0);
|
|
402
|
-
__decorate([RefSelector('eLabel')], ToolPanelColumnGroupComp.prototype, "eLabel", void 0);
|
|
403
|
-
__decorate([RefSelector('eGroupOpenedIcon')], ToolPanelColumnGroupComp.prototype, "eGroupOpenedIcon", void 0);
|
|
404
|
-
__decorate([RefSelector('eGroupClosedIcon')], ToolPanelColumnGroupComp.prototype, "eGroupClosedIcon", void 0);
|
|
405
|
-
__decorate([RefSelector('eColumnGroupIcons')], ToolPanelColumnGroupComp.prototype, "eColumnGroupIcons", void 0);
|
|
406
|
-
__decorate([PostConstruct], ToolPanelColumnGroupComp.prototype, "init", null);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Column, Component, ProvidedColumnGroup } from "@ag-grid-community/core";
|
|
2
|
-
export declare class ToolPanelContextMenu extends Component {
|
|
3
|
-
private readonly column;
|
|
4
|
-
private readonly mouseEvent;
|
|
5
|
-
private readonly parentEl;
|
|
6
|
-
private columns;
|
|
7
|
-
private allowGrouping;
|
|
8
|
-
private allowValues;
|
|
9
|
-
private allowPivoting;
|
|
10
|
-
private menuItemMap;
|
|
11
|
-
private displayName;
|
|
12
|
-
private readonly columnModel;
|
|
13
|
-
private readonly popupService;
|
|
14
|
-
private readonly focusService;
|
|
15
|
-
constructor(column: Column | ProvidedColumnGroup, mouseEvent: MouseEvent, parentEl: HTMLElement);
|
|
16
|
-
private postConstruct;
|
|
17
|
-
private initializeProperties;
|
|
18
|
-
private buildMenuItemMap;
|
|
19
|
-
private addColumnsToList;
|
|
20
|
-
private removeColumnsFromList;
|
|
21
|
-
private displayContextMenu;
|
|
22
|
-
private isActive;
|
|
23
|
-
private getMappedMenuItems;
|
|
24
|
-
}
|