@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.
Files changed (145) hide show
  1. package/es/data-grid/cell-editors/date.d.ts +2 -2
  2. package/es/data-grid/cell-editors/number.d.ts +2 -2
  3. package/es/data-grid/cell-editors/number.js +1 -4
  4. package/es/data-grid/cell-editors/row.d.ts +2 -2
  5. package/es/data-grid/cell-editors/select.d.ts +3 -3
  6. package/es/data-grid/cell-editors/text.d.ts +2 -2
  7. package/es/data-grid/cell-editors/utils.d.ts +1 -1
  8. package/es/data-grid/components/custom-panel/index.d.ts +1 -1
  9. package/es/data-grid/components/custom-panel/item.d.ts +1 -1
  10. package/es/data-grid/components/custom-panel/typings.d.ts +1 -1
  11. package/es/data-grid/index.d.ts +8 -7
  12. package/es/data-grid/index.js +39 -21
  13. package/es/data-grid/index.less +1 -1
  14. package/es/data-grid/locale/en_US.js +3 -1
  15. package/es/data-grid/locale/zh_CN.js +3 -1
  16. package/es/data-grid/renderer/actions-renderer.d.ts +1 -1
  17. package/es/data-grid/renderer/actions.d.ts +1 -1
  18. package/es/data-grid/renderer/cell-delete-renderer.d.ts +1 -1
  19. package/es/data-grid/renderer/cell-index-renderer.d.ts +1 -1
  20. package/es/data-grid/renderer/cell-renderer.d.ts +1 -1
  21. package/es/data-grid/renderer/detali-cell-renderer.d.ts +1 -1
  22. package/es/data-grid/renderer/header-renderer.d.ts +1 -1
  23. package/es/data-grid/renderer/header-renderer.js +0 -1
  24. package/es/data-grid/typings.d.ts +2 -2
  25. package/es/data-grid/utils.d.ts +1 -1
  26. package/es/index.d.ts +4 -3
  27. package/es/index.js +4 -2
  28. package/es/select-view/index.d.ts +1 -1
  29. package/package.json +5 -14
  30. package/es/data-grid/modules/clipboard/clipboard/clipboardService.d.ts +0 -62
  31. package/es/data-grid/modules/clipboard/clipboard/clipboardService.js +0 -1007
  32. package/es/data-grid/modules/clipboard/clipboardModule.d.ts +0 -2
  33. package/es/data-grid/modules/clipboard/clipboardModule.js +0 -10
  34. package/es/data-grid/modules/clipboard/main.d.ts +0 -1
  35. package/es/data-grid/modules/clipboard/main.js +0 -1
  36. package/es/data-grid/modules/clipboard/version.d.ts +0 -1
  37. package/es/data-grid/modules/clipboard/version.js +0 -2
  38. package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnModelItem.d.ts +0 -26
  39. package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnModelItem.js +0 -94
  40. package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnToolPanel.d.ts +0 -32
  41. package/es/data-grid/modules/column-tool-panel/columnToolPanel/columnToolPanel.js +0 -272
  42. package/es/data-grid/modules/column-tool-panel/columnToolPanel/modelItemUtils.d.ts +0 -16
  43. package/es/data-grid/modules/column-tool-panel/columnToolPanel/modelItemUtils.js +0 -209
  44. package/es/data-grid/modules/column-tool-panel/columnToolPanel/pivotModePanel.d.ts +0 -9
  45. package/es/data-grid/modules/column-tool-panel/columnToolPanel/pivotModePanel.js +0 -68
  46. package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.d.ts +0 -32
  47. package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.js +0 -150
  48. package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.d.ts +0 -44
  49. package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.js +0 -455
  50. package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.d.ts +0 -26
  51. package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.js +0 -224
  52. package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.d.ts +0 -24
  53. package/es/data-grid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.js +0 -123
  54. package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.d.ts +0 -37
  55. package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.js +0 -314
  56. package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.d.ts +0 -51
  57. package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.js +0 -406
  58. package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.d.ts +0 -24
  59. package/es/data-grid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.js +0 -264
  60. package/es/data-grid/modules/column-tool-panel/columnsToolPanelModule.d.ts +0 -2
  61. package/es/data-grid/modules/column-tool-panel/columnsToolPanelModule.js +0 -29
  62. package/es/data-grid/modules/column-tool-panel/main.d.ts +0 -2
  63. package/es/data-grid/modules/column-tool-panel/main.js +0 -3
  64. package/es/data-grid/modules/column-tool-panel/version.d.ts +0 -1
  65. package/es/data-grid/modules/column-tool-panel/version.js +0 -2
  66. package/es/data-grid/modules/master-detail/main.d.ts +0 -1
  67. package/es/data-grid/modules/master-detail/main.js +0 -1
  68. package/es/data-grid/modules/master-detail/masterDetail/detailCellRenderer.d.ts +0 -14
  69. package/es/data-grid/modules/master-detail/masterDetail/detailCellRenderer.js +0 -144
  70. package/es/data-grid/modules/master-detail/masterDetail/detailCellRendererCtrl.d.ts +0 -19
  71. package/es/data-grid/modules/master-detail/masterDetail/detailCellRendererCtrl.js +0 -203
  72. package/es/data-grid/modules/master-detail/masterDetailModule.d.ts +0 -2
  73. package/es/data-grid/modules/master-detail/masterDetailModule.js +0 -18
  74. package/es/data-grid/modules/master-detail/version.d.ts +0 -1
  75. package/es/data-grid/modules/master-detail/version.js +0 -2
  76. package/es/data-grid/modules/menu/main.d.ts +0 -1
  77. package/es/data-grid/modules/menu/main.js +0 -1
  78. package/es/data-grid/modules/menu/menu/chartMenuItemMapper.d.ts +0 -13
  79. package/es/data-grid/modules/menu/menu/chartMenuItemMapper.js +0 -351
  80. package/es/data-grid/modules/menu/menu/contextMenu.d.ts +0 -13
  81. package/es/data-grid/modules/menu/menu/contextMenu.js +0 -267
  82. package/es/data-grid/modules/menu/menu/enterpriseMenu.d.ts +0 -66
  83. package/es/data-grid/modules/menu/menu/enterpriseMenu.js +0 -592
  84. package/es/data-grid/modules/menu/menu/menuItemMapper.d.ts +0 -13
  85. package/es/data-grid/modules/menu/menu/menuItemMapper.js +0 -328
  86. package/es/data-grid/modules/menu/menuModule.d.ts +0 -2
  87. package/es/data-grid/modules/menu/menuModule.js +0 -12
  88. package/es/data-grid/modules/menu/version.d.ts +0 -1
  89. package/es/data-grid/modules/menu/version.js +0 -2
  90. package/es/data-grid/modules/row-grouping/main.d.ts +0 -4
  91. package/es/data-grid/modules/row-grouping/main.js +0 -4
  92. package/es/data-grid/modules/row-grouping/rowGrouping/aggFuncService.d.ts +0 -23
  93. package/es/data-grid/modules/row-grouping/rowGrouping/aggFuncService.js +0 -250
  94. package/es/data-grid/modules/row-grouping/rowGrouping/aggregationStage.d.ts +0 -22
  95. package/es/data-grid/modules/row-grouping/rowGrouping/aggregationStage.js +0 -285
  96. package/es/data-grid/modules/row-grouping/rowGrouping/batchRemover.d.ts +0 -12
  97. package/es/data-grid/modules/row-grouping/rowGrouping/batchRemover.js +0 -77
  98. package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.d.ts +0 -75
  99. package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.js +0 -516
  100. package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.d.ts +0 -40
  101. package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.js +0 -367
  102. package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.d.ts +0 -11
  103. package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.js +0 -85
  104. package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.d.ts +0 -17
  105. package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.js +0 -139
  106. package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.d.ts +0 -15
  107. package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.js +0 -105
  108. package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.d.ts +0 -15
  109. package/es/data-grid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.js +0 -105
  110. package/es/data-grid/modules/row-grouping/rowGrouping/filterAggregatesStage.d.ts +0 -9
  111. package/es/data-grid/modules/row-grouping/rowGrouping/filterAggregatesStage.js +0 -136
  112. package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFilter.d.ts +0 -39
  113. package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFilter.js +0 -319
  114. package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFloatingFilter.d.ts +0 -23
  115. package/es/data-grid/modules/row-grouping/rowGrouping/groupFilter/groupFloatingFilter.js +0 -163
  116. package/es/data-grid/modules/row-grouping/rowGrouping/groupStage.d.ts +0 -48
  117. package/es/data-grid/modules/row-grouping/rowGrouping/groupStage.js +0 -740
  118. package/es/data-grid/modules/row-grouping/rowGrouping/pivotColDefService.d.ts +0 -24
  119. package/es/data-grid/modules/row-grouping/rowGrouping/pivotColDefService.js +0 -396
  120. package/es/data-grid/modules/row-grouping/rowGrouping/pivotStage.d.ts +0 -19
  121. package/es/data-grid/modules/row-grouping/rowGrouping/pivotStage.js +0 -182
  122. package/es/data-grid/modules/row-grouping/rowGroupingModule.d.ts +0 -2
  123. package/es/data-grid/modules/row-grouping/rowGroupingModule.js +0 -28
  124. package/es/data-grid/modules/row-grouping/version.d.ts +0 -1
  125. package/es/data-grid/modules/row-grouping/version.js +0 -2
  126. package/es/data-grid/modules/side-bar/main.d.ts +0 -2
  127. package/es/data-grid/modules/side-bar/main.js +0 -2
  128. package/es/data-grid/modules/side-bar/sideBar/common/toolPanelColDefService.d.ts +0 -11
  129. package/es/data-grid/modules/side-bar/sideBar/common/toolPanelColDefService.js +0 -216
  130. package/es/data-grid/modules/side-bar/sideBar/horizontalResizeComp.d.ts +0 -19
  131. package/es/data-grid/modules/side-bar/sideBar/horizontalResizeComp.js +0 -108
  132. package/es/data-grid/modules/side-bar/sideBar/sideBarButtonComp.d.ts +0 -16
  133. package/es/data-grid/modules/side-bar/sideBar/sideBarButtonComp.js +0 -84
  134. package/es/data-grid/modules/side-bar/sideBar/sideBarButtonsComp.d.ts +0 -18
  135. package/es/data-grid/modules/side-bar/sideBar/sideBarButtonsComp.js +0 -89
  136. package/es/data-grid/modules/side-bar/sideBar/sideBarComp.d.ts +0 -28
  137. package/es/data-grid/modules/side-bar/sideBar/sideBarComp.js +0 -325
  138. package/es/data-grid/modules/side-bar/sideBar/sideBarDefParser.d.ts +0 -10
  139. package/es/data-grid/modules/side-bar/sideBar/sideBarDefParser.js +0 -95
  140. package/es/data-grid/modules/side-bar/sideBar/toolPanelWrapper.d.ts +0 -17
  141. package/es/data-grid/modules/side-bar/sideBar/toolPanelWrapper.js +0 -103
  142. package/es/data-grid/modules/side-bar/sideBarModule.d.ts +0 -2
  143. package/es/data-grid/modules/side-bar/sideBarModule.js +0 -22
  144. package/es/data-grid/modules/side-bar/version.d.ts +0 -1
  145. package/es/data-grid/modules/side-bar/version.js +0 -2
@@ -1,267 +0,0 @@
1
- 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); }
2
- function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
3
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
- 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); } }
5
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
- 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); }
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 { _, AgMenuItemComponent, AgMenuList, Autowired, Bean, BeanStub, Component, ModuleNames, ModuleRegistry, Optional, PostConstruct } from "@ag-grid-community/core";
24
- var CSS_MENU = 'ag-menu';
25
- var CSS_CONTEXT_MENU_OPEN = 'ag-context-menu-open';
26
- var ContextMenuFactory = /*#__PURE__*/function (_BeanStub) {
27
- _inherits(ContextMenuFactory, _BeanStub);
28
- var _super = _createSuper(ContextMenuFactory);
29
- function ContextMenuFactory() {
30
- _classCallCheck(this, ContextMenuFactory);
31
- return _super.apply(this, arguments);
32
- }
33
- _createClass(ContextMenuFactory, [{
34
- key: "hideActiveMenu",
35
- value: function hideActiveMenu() {
36
- this.destroyBean(this.activeMenu);
37
- }
38
- }, {
39
- key: "getMenuItems",
40
- value: function getMenuItems(node, column, value) {
41
- var defaultMenuOptions = [];
42
- if (_.exists(node) && ModuleRegistry.isRegistered(ModuleNames.ClipboardModule)) {
43
- if (column) {
44
- // only makes sense if column exists, could have originated from a row
45
- if (!this.gridOptionsService.is('suppressCutToClipboard')) {
46
- defaultMenuOptions.push('cut');
47
- }
48
- defaultMenuOptions.push('copy', 'copyWithHeaders', 'copyWithGroupHeaders', 'paste', 'separator');
49
- }
50
- }
51
- if (this.gridOptionsService.is('enableCharts') && ModuleRegistry.isRegistered(ModuleNames.GridChartsModule)) {
52
- if (this.columnModel.isPivotMode()) {
53
- defaultMenuOptions.push('pivotChart');
54
- }
55
- if (this.rangeService && !this.rangeService.isEmpty()) {
56
- defaultMenuOptions.push('chartRange');
57
- }
58
- }
59
- if (_.exists(node)) {
60
- // if user clicks a cell
61
- var csvModuleMissing = !ModuleRegistry.isRegistered(ModuleNames.CsvExportModule);
62
- var excelModuleMissing = !ModuleRegistry.isRegistered(ModuleNames.ExcelExportModule);
63
- var suppressExcel = this.gridOptionsService.is('suppressExcelExport') || excelModuleMissing;
64
- var suppressCsv = this.gridOptionsService.is('suppressCsvExport') || csvModuleMissing;
65
- var onIPad = _.isIOSUserAgent();
66
- var anyExport = !onIPad && (!suppressExcel || !suppressCsv);
67
- if (anyExport) {
68
- defaultMenuOptions.push('export');
69
- }
70
- }
71
- var userFunc = this.gridOptionsService.getCallback('getContextMenuItems');
72
- if (userFunc) {
73
- var params = {
74
- node: node,
75
- column: column,
76
- value: value,
77
- defaultItems: defaultMenuOptions.length ? defaultMenuOptions : undefined
78
- };
79
- return userFunc(params);
80
- }
81
- return defaultMenuOptions;
82
- }
83
- }, {
84
- key: "onContextMenu",
85
- value: function onContextMenu(mouseEvent, touchEvent, rowNode, column, value, anchorToElement) {
86
- // to allow us to debug in chrome, we ignore the event if ctrl is pressed.
87
- // not everyone wants this, so first 'if' below allows to turn this hack off.
88
- if (!this.gridOptionsService.is('allowContextMenuWithControlKey')) {
89
- // then do the check
90
- if (mouseEvent && (mouseEvent.ctrlKey || mouseEvent.metaKey)) {
91
- return;
92
- }
93
- }
94
- // need to do this regardless of context menu showing or not, so doing
95
- // before the isSuppressContextMenu() check
96
- if (mouseEvent) {
97
- this.blockMiddleClickScrollsIfNeeded(mouseEvent);
98
- }
99
- if (this.gridOptionsService.is('suppressContextMenu')) {
100
- return;
101
- }
102
- var eventOrTouch = mouseEvent ? mouseEvent : touchEvent.touches[0];
103
- if (this.showMenu(rowNode, column, value, eventOrTouch, anchorToElement)) {
104
- var event = mouseEvent ? mouseEvent : touchEvent;
105
- event.preventDefault();
106
- }
107
- }
108
- }, {
109
- key: "blockMiddleClickScrollsIfNeeded",
110
- value: function blockMiddleClickScrollsIfNeeded(mouseEvent) {
111
- // if we don't do this, then middle click will never result in a 'click' event, as 'mousedown'
112
- // will be consumed by the browser to mean 'scroll' (as you can scroll with the middle mouse
113
- // button in the browser). so this property allows the user to receive middle button clicks if
114
- // they want.
115
- var gridOptionsService = this.gridOptionsService;
116
- var which = mouseEvent.which;
117
- if (gridOptionsService.is('suppressMiddleClickScrolls') && which === 2) {
118
- mouseEvent.preventDefault();
119
- }
120
- }
121
- }, {
122
- key: "showMenu",
123
- value: function showMenu(node, column, value, mouseEvent, anchorToElement) {
124
- var _this = this;
125
- var menuItems = this.getMenuItems(node, column, value);
126
- var eGridBodyGui = this.ctrlsService.getGridBodyCtrl().getGui();
127
- if (menuItems === undefined || _.missingOrEmpty(menuItems)) {
128
- return false;
129
- }
130
- var menu = new ContextMenu(menuItems);
131
- this.createBean(menu);
132
- var eMenuGui = menu.getGui();
133
- var positionParams = {
134
- column: column,
135
- rowNode: node,
136
- type: 'contextMenu',
137
- mouseEvent: mouseEvent,
138
- ePopup: eMenuGui,
139
- // move one pixel away so that accidentally double clicking
140
- // won't show the browser's contextmenu
141
- nudgeY: 1
142
- };
143
- var translate = this.localeService.getLocaleTextFunc();
144
- var addPopupRes = this.popupService.addPopup({
145
- modal: true,
146
- eChild: eMenuGui,
147
- closeOnEsc: true,
148
- closedCallback: function closedCallback() {
149
- eGridBodyGui.classList.remove(CSS_CONTEXT_MENU_OPEN);
150
- _this.destroyBean(menu);
151
- },
152
- click: mouseEvent,
153
- positionCallback: function positionCallback() {
154
- var isRtl = _this.gridOptionsService.is('enableRtl');
155
- _this.popupService.positionPopupUnderMouseEvent(Object.assign(Object.assign({}, positionParams), {
156
- nudgeX: isRtl ? (eMenuGui.offsetWidth + 1) * -1 : 1
157
- }));
158
- },
159
- // so when browser is scrolled down, or grid is scrolled, context menu stays with cell
160
- anchorToElement: anchorToElement,
161
- ariaLabel: translate('ariaLabelContextMenu', 'Context Menu')
162
- });
163
- if (addPopupRes) {
164
- eGridBodyGui.classList.add(CSS_CONTEXT_MENU_OPEN);
165
- menu.afterGuiAttached({
166
- container: 'contextMenu',
167
- hidePopup: addPopupRes.hideFunc
168
- });
169
- }
170
- // there should never be an active menu at this point, however it was found
171
- // that you could right click a second time just 1 or 2 pixels from the first
172
- // click, and another menu would pop up. so somehow the logic for closing the
173
- // first menu (clicking outside should close it) was glitchy somehow. an easy
174
- // way to avoid this is just remove the old context menu here if it exists.
175
- if (this.activeMenu) {
176
- this.hideActiveMenu();
177
- }
178
- this.activeMenu = menu;
179
- menu.addEventListener(BeanStub.EVENT_DESTROYED, function () {
180
- if (_this.activeMenu === menu) {
181
- _this.activeMenu = null;
182
- }
183
- });
184
- // hide the popup if something gets selected
185
- if (addPopupRes) {
186
- menu.addEventListener(AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED, addPopupRes.hideFunc);
187
- }
188
- return true;
189
- }
190
- }]);
191
- return ContextMenuFactory;
192
- }(BeanStub);
193
- __decorate([Autowired('popupService')], ContextMenuFactory.prototype, "popupService", void 0);
194
- __decorate([Optional('rangeService')], ContextMenuFactory.prototype, "rangeService", void 0);
195
- __decorate([Autowired('ctrlsService')], ContextMenuFactory.prototype, "ctrlsService", void 0);
196
- __decorate([Autowired('columnModel')], ContextMenuFactory.prototype, "columnModel", void 0);
197
- ContextMenuFactory = __decorate([Bean('contextMenuFactory')], ContextMenuFactory);
198
- export { ContextMenuFactory };
199
- var ContextMenu = /*#__PURE__*/function (_Component) {
200
- _inherits(ContextMenu, _Component);
201
- var _super2 = _createSuper(ContextMenu);
202
- function ContextMenu(menuItems) {
203
- var _this2;
204
- _classCallCheck(this, ContextMenu);
205
- _this2 = _super2.call(this, /* html */"<div class=\"".concat(CSS_MENU, "\" role=\"presentation\"></div>"));
206
- _this2.menuList = null;
207
- _this2.focusedCell = null;
208
- _this2.menuItems = menuItems;
209
- return _this2;
210
- }
211
- _createClass(ContextMenu, [{
212
- key: "addMenuItems",
213
- value: function addMenuItems() {
214
- var _this3 = this;
215
- var menuList = this.createManagedBean(new AgMenuList());
216
- var menuItemsMapped = this.menuItemMapper.mapWithStockItems(this.menuItems, null);
217
- menuList.addMenuItems(menuItemsMapped);
218
- this.appendChild(menuList);
219
- this.menuList = menuList;
220
- menuList.addEventListener(AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED, function (e) {
221
- return _this3.dispatchEvent(e);
222
- });
223
- }
224
- }, {
225
- key: "afterGuiAttached",
226
- value: function afterGuiAttached(params) {
227
- if (params.hidePopup) {
228
- this.addDestroyFunc(params.hidePopup);
229
- }
230
- this.focusedCell = this.focusService.getFocusedCell();
231
- if (this.menuList) {
232
- this.focusService.focusInto(this.menuList.getGui());
233
- }
234
- }
235
- }, {
236
- key: "restoreFocusedCell",
237
- value: function restoreFocusedCell() {
238
- var currentFocusedCell = this.focusService.getFocusedCell();
239
- if (currentFocusedCell && this.focusedCell && this.cellPositionUtils.equals(currentFocusedCell, this.focusedCell)) {
240
- var _this$focusedCell = this.focusedCell,
241
- rowIndex = _this$focusedCell.rowIndex,
242
- rowPinned = _this$focusedCell.rowPinned,
243
- column = _this$focusedCell.column;
244
- var doc = this.gridOptionsService.getDocument();
245
- if (doc.activeElement === doc.body) {
246
- this.focusService.setFocusedCell({
247
- rowIndex: rowIndex,
248
- column: column,
249
- rowPinned: rowPinned,
250
- forceBrowserFocus: true
251
- });
252
- }
253
- }
254
- }
255
- }, {
256
- key: "destroy",
257
- value: function destroy() {
258
- this.restoreFocusedCell();
259
- _get(_getPrototypeOf(ContextMenu.prototype), "destroy", this).call(this);
260
- }
261
- }]);
262
- return ContextMenu;
263
- }(Component);
264
- __decorate([Autowired('menuItemMapper')], ContextMenu.prototype, "menuItemMapper", void 0);
265
- __decorate([Autowired('focusService')], ContextMenu.prototype, "focusService", void 0);
266
- __decorate([Autowired('cellPositionUtils')], ContextMenu.prototype, "cellPositionUtils", void 0);
267
- __decorate([PostConstruct], ContextMenu.prototype, "addMenuItems", null);
@@ -1,66 +0,0 @@
1
- import { AgEvent, BeanStub, Column, ColumnMenuTab, IMenuFactory, IAfterGuiAttachedParams, ContainerType } from '@ag-grid-community/core';
2
- export interface TabSelectedEvent extends AgEvent {
3
- key: string;
4
- }
5
- export declare class EnterpriseMenuFactory extends BeanStub implements IMenuFactory {
6
- private readonly popupService;
7
- private readonly focusService;
8
- private readonly headerNavigationService;
9
- private readonly ctrlsService;
10
- private readonly columnModel;
11
- private lastSelectedTab;
12
- private activeMenu;
13
- hideActiveMenu(): void;
14
- showMenuAfterMouseEvent(column: Column, mouseEvent: MouseEvent, defaultTab?: string): void;
15
- showMenuAfterButtonClick(column: Column, eventSource: HTMLElement, containerType: ContainerType, defaultTab?: string, restrictToTabs?: ColumnMenuTab[]): void;
16
- private showMenu;
17
- private getClosedCallback;
18
- private addStopAnchoring;
19
- private getMenuParams;
20
- isMenuEnabled(column: Column): boolean;
21
- }
22
- export declare class EnterpriseMenu extends BeanStub {
23
- static EVENT_TAB_SELECTED: string;
24
- static TAB_FILTER: 'filterMenuTab';
25
- static TAB_GENERAL: 'generalMenuTab';
26
- static TAB_COLUMNS: 'columnsMenuTab';
27
- static TABS_DEFAULT: ColumnMenuTab[];
28
- static MENU_ITEM_SEPARATOR: string;
29
- private readonly columnModel;
30
- private readonly filterManager;
31
- private readonly gridApi;
32
- private readonly columnApi;
33
- private readonly menuItemMapper;
34
- private readonly rowModel;
35
- private readonly focusService;
36
- private tabbedLayout;
37
- private hidePopupFunc;
38
- private column;
39
- private mainMenuList;
40
- private tabItemFilter;
41
- private tabItemGeneral;
42
- private tabItemColumns;
43
- private initialSelection;
44
- private tabFactories;
45
- private includeChecks;
46
- private restrictTo?;
47
- constructor(column: Column, initialSelection: string, restrictTo?: ColumnMenuTab[]);
48
- init(): void;
49
- private getTabsToCreate;
50
- private isModuleLoaded;
51
- private isValidMenuTabItem;
52
- private isNotSuppressed;
53
- private createTab;
54
- showTabBasedOnPreviousSelection(): void;
55
- showTab(toShow: string): void;
56
- private onTabItemClicked;
57
- private activateTab;
58
- private getMenuItems;
59
- private getDefaultMenuOptions;
60
- private createMainPanel;
61
- private onHidePopup;
62
- private createFilterPanel;
63
- private createColumnsPanel;
64
- afterGuiAttached(params: IAfterGuiAttachedParams): void;
65
- getGui(): HTMLElement;
66
- }