@adaptabletools/adaptable-cjs 18.0.0-canary.26 → 18.0.0-canary.28
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/base.css.map +1 -1
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableOptions/MenuOptions.d.ts +7 -19
- package/src/AdaptableOptions/MenuOptions.js +0 -98
- package/src/Api/Implementation/ColumnApiImpl.js +6 -6
- package/src/Api/Implementation/ExpressionApiImpl.js +12 -12
- package/src/Api/Implementation/GridApiImpl.js +2 -2
- package/src/Api/Implementation/LayoutApiImpl.d.ts +0 -9
- package/src/Api/Implementation/LayoutApiImpl.js +0 -4
- package/src/Api/Implementation/ScopeApiImpl.js +4 -4
- package/src/Api/Internal/ColumnFilterInternalApi.js +2 -2
- package/src/Api/Internal/CommentsInternalApi.d.ts +1 -1
- package/src/Api/Internal/CommentsInternalApi.js +1 -1
- package/src/Api/Internal/DashboardInternalApi.js +2 -2
- package/src/Api/Internal/FormatColumnInternalApi.js +5 -3
- package/src/Api/Internal/GridFilterInternalApi.d.ts +2 -2
- package/src/Api/Internal/GridFilterInternalApi.js +2 -2
- package/src/Api/Internal/NoteInternalApi.d.ts +1 -1
- package/src/Api/Internal/NoteInternalApi.js +1 -1
- package/src/Api/LayoutApi.d.ts +0 -12
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/Fdc3Intent.d.ts +2 -2
- package/src/PredefinedConfig/Common/Menu.d.ts +2 -2
- package/src/PredefinedConfig/Common/Menu.js +22 -20
- package/src/PredefinedConfig/Common/TransposeConfig.d.ts +3 -3
- package/src/Strategy/AdaptableModuleBase.d.ts +3 -4
- package/src/Strategy/AdaptableModuleBase.js +5 -9
- package/src/Strategy/AlertModule.d.ts +1 -1
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/BulkUpdateModule.d.ts +1 -1
- package/src/Strategy/BulkUpdateModule.js +3 -2
- package/src/Strategy/CalculatedColumnModule.d.ts +2 -2
- package/src/Strategy/CalculatedColumnModule.js +2 -2
- package/src/Strategy/CellSummaryModule.d.ts +2 -2
- package/src/Strategy/CellSummaryModule.js +2 -2
- package/src/Strategy/ColumnFilterModule.d.ts +2 -2
- package/src/Strategy/ColumnFilterModule.js +17 -42
- package/src/Strategy/ColumnInfoModule.d.ts +2 -2
- package/src/Strategy/ColumnInfoModule.js +4 -4
- package/src/Strategy/CommentModule.d.ts +1 -2
- package/src/Strategy/CommentModule.js +29 -30
- package/src/Strategy/CustomSortModule.d.ts +1 -1
- package/src/Strategy/CustomSortModule.js +1 -1
- package/src/Strategy/DashboardModule.d.ts +2 -2
- package/src/Strategy/DashboardModule.js +3 -14
- package/src/Strategy/DataImportModule.d.ts +3 -3
- package/src/Strategy/DataImportModule.js +3 -3
- package/src/Strategy/ExportModule.d.ts +1 -2
- package/src/Strategy/ExportModule.js +12 -41
- package/src/Strategy/Fdc3Module.d.ts +1 -1
- package/src/Strategy/Fdc3Module.js +1 -14
- package/src/Strategy/FlashingCellModule.d.ts +2 -2
- package/src/Strategy/FlashingCellModule.js +2 -2
- package/src/Strategy/FormatColumnModule.d.ts +1 -1
- package/src/Strategy/FormatColumnModule.js +28 -47
- package/src/Strategy/FreeTextColumnModule.d.ts +1 -1
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/GridInfoModule.d.ts +2 -2
- package/src/Strategy/GridInfoModule.js +3 -3
- package/src/Strategy/Interface/IModule.d.ts +3 -3
- package/src/Strategy/LayoutModule.d.ts +4 -4
- package/src/Strategy/LayoutModule.js +47 -72
- package/src/Strategy/NoteModule.d.ts +1 -2
- package/src/Strategy/NoteModule.js +28 -30
- package/src/Strategy/PlusMinusModule.d.ts +1 -1
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/SettingsPanelModule.d.ts +3 -3
- package/src/Strategy/SettingsPanelModule.js +3 -3
- package/src/Strategy/SmartEditModule.d.ts +1 -1
- package/src/Strategy/SmartEditModule.js +3 -2
- package/src/Strategy/StyledColumnModule.d.ts +1 -1
- package/src/Strategy/StyledColumnModule.js +17 -15
- package/src/Strategy/SystemStatusModule.d.ts +2 -2
- package/src/Strategy/SystemStatusModule.js +4 -3
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +4 -2
- package/src/Utilities/Services/ModuleService.js +2 -2
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
- package/src/agGrid/AdaptableAgGrid.js +2 -1
- package/src/agGrid/AgGridColumnAdapter.js +2 -2
- package/src/agGrid/AgGridMenuAdapter.d.ts +19 -8
- package/src/agGrid/AgGridMenuAdapter.js +319 -50
- package/src/components/icons/filter-off.d.ts +3 -0
- package/src/components/icons/filter-off.js +7 -0
- package/src/components/icons/grid-info.d.ts +3 -0
- package/src/components/icons/grid-info.js +7 -0
- package/src/components/icons/index.js +10 -0
- package/src/components/icons/select-all.d.ts +3 -0
- package/src/components/icons/select-all.js +7 -0
- package/src/components/icons/select-fwd.d.ts +3 -0
- package/src/components/icons/select-fwd.js +7 -0
- package/src/components/icons/select-off.d.ts +3 -0
- package/src/components/icons/select-off.js +7 -0
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/parser.js +1218 -55
- package/src/parser/src/predicate/mapQlPredicateToExpression.js +1 -3
- package/src/parser/src/types.js +1 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -9,20 +9,21 @@ class SystemStatusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
9
9
|
constructor(api) {
|
|
10
10
|
super(ModuleConstants.SystemStatusModuleId, ModuleConstants.SystemStatusFriendlyName, 'traffic-lights', 'SystemStatusPopup', 'Provide messages about the Status of your application', api);
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
createColumnMenuItems(column) {
|
|
13
13
|
if (this.isModuleAvailable()) {
|
|
14
14
|
return [
|
|
15
15
|
this.createMenuItemShowPopup('system-status-show', 'Show System Status', this.moduleInfo.Popup, this.moduleInfo.Glyph),
|
|
16
16
|
];
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
createContextMenuItems(menuContext) {
|
|
20
20
|
if (this.isModuleAvailable()) {
|
|
21
21
|
let popUpParams = {
|
|
22
22
|
source: 'ContextMenu',
|
|
23
23
|
};
|
|
24
24
|
return [
|
|
25
|
-
this.createMainMenuItemShowPopup({
|
|
25
|
+
this.createMainMenuItemShowPopup({
|
|
26
|
+
Name: 'system-status-show',
|
|
26
27
|
Label: 'Show System Status',
|
|
27
28
|
ComponentName: this.moduleInfo.Popup,
|
|
28
29
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -1104,13 +1104,15 @@ const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, c
|
|
|
1104
1104
|
if ((_a = aggregationEvaluation.context) === null || _a === void 0 ? void 0 : _a.weightParam) {
|
|
1105
1105
|
// weighted average
|
|
1106
1106
|
const weightValue = (_b = context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, aggregationEvaluation.context.weightParam.value)) !== null && _b !== void 0 ? _b : 0;
|
|
1107
|
-
cumulationBag.currentValue =
|
|
1107
|
+
cumulationBag.currentValue =
|
|
1108
|
+
cumulationBag.currentValue + rowValue * weightValue;
|
|
1108
1109
|
cumulationBag.numberOfCumulatedValues =
|
|
1109
1110
|
cumulationBag.numberOfCumulatedValues + weightValue;
|
|
1110
1111
|
}
|
|
1111
1112
|
else {
|
|
1112
1113
|
cumulationBag.currentValue = cumulationBag.currentValue + rowValue;
|
|
1113
|
-
cumulationBag.numberOfCumulatedValues =
|
|
1114
|
+
cumulationBag.numberOfCumulatedValues =
|
|
1115
|
+
cumulationBag.numberOfCumulatedValues + 1;
|
|
1114
1116
|
}
|
|
1115
1117
|
}
|
|
1116
1118
|
if (cumulationBag.numberOfCumulatedValues !== 0) {
|
|
@@ -14,13 +14,13 @@ class ModuleService {
|
|
|
14
14
|
const settingsPanelMenuItems = [];
|
|
15
15
|
const buttonMenuItems = [];
|
|
16
16
|
this.getModuleCollection().forEach((module) => {
|
|
17
|
-
const settingsPanelMenuItem = module.
|
|
17
|
+
const settingsPanelMenuItem = module.createModuleMenuItem('ModuleMenu');
|
|
18
18
|
if (Helper_1.default.objectExists(settingsPanelMenuItem)) {
|
|
19
19
|
if (settingsPanelMenuItems.findIndex((m) => m.module == settingsPanelMenuItem.module) == -1) {
|
|
20
20
|
settingsPanelMenuItems.push(settingsPanelMenuItem);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
const buttonMenuItem = module.
|
|
23
|
+
const buttonMenuItem = module.createModuleMenuItem('ModuleButton');
|
|
24
24
|
if (Helper_1.default.objectExists(buttonMenuItem)) {
|
|
25
25
|
if (buttonMenuItems.findIndex((m) => m.module == buttonMenuItem.module) == -1) {
|
|
26
26
|
buttonMenuItems.push(buttonMenuItem);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { CalculatedColumn } from '../../../types';
|
|
3
3
|
import { AdaptableOnePageWizardProps } from '../../Wizard/Interface/IAdaptableWizard';
|
|
4
4
|
export declare const calculatedColumnTypes: readonly ["ScalarExpression", "AggregatedScalarExpression", "CumulativeAggregatedExpression", "QuantileAggregatedExpression"];
|
|
5
|
-
export type ExpressionType = typeof calculatedColumnTypes[number];
|
|
5
|
+
export type ExpressionType = (typeof calculatedColumnTypes)[number];
|
|
6
6
|
export interface CalculatedColumnWizardProps extends AdaptableOnePageWizardProps<CalculatedColumn> {
|
|
7
7
|
}
|
|
8
8
|
export declare const CalculatedColumnWizard: (props: CalculatedColumnWizardProps) => JSX.Element;
|
|
@@ -1694,7 +1694,8 @@ class AdaptableAgGrid {
|
|
|
1694
1694
|
return acc;
|
|
1695
1695
|
}
|
|
1696
1696
|
const ColumnGroupId = columnGroup.getGroupId();
|
|
1697
|
-
const AllowGroupSplit = !columnGroup.getProvidedColumnGroup().getColGroupDef()
|
|
1697
|
+
const AllowGroupSplit = !columnGroup.getProvidedColumnGroup().getColGroupDef()
|
|
1698
|
+
.marryChildren;
|
|
1698
1699
|
const FriendlyName = (_c = columnGroup.getProvidedColumnGroup().getColGroupDef().headerName) !== null && _c !== void 0 ? _c : ColumnGroupId;
|
|
1699
1700
|
const columnsInGroup = columnGroup.getLeafColumns();
|
|
1700
1701
|
columnsInGroup.forEach((col) => {
|
|
@@ -574,7 +574,7 @@ class AgGridColumnAdapter {
|
|
|
574
574
|
if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Note')) {
|
|
575
575
|
return;
|
|
576
576
|
}
|
|
577
|
-
if (!this.adaptableApi.noteApi.internalApi.
|
|
577
|
+
if (!this.adaptableApi.noteApi.internalApi.areNotesSupported()) {
|
|
578
578
|
return;
|
|
579
579
|
}
|
|
580
580
|
const cellPosition = {
|
|
@@ -591,7 +591,7 @@ class AgGridColumnAdapter {
|
|
|
591
591
|
if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Comment')) {
|
|
592
592
|
return;
|
|
593
593
|
}
|
|
594
|
-
if (!this.adaptableApi.commentApi.internalApi.
|
|
594
|
+
if (!this.adaptableApi.commentApi.internalApi.areCommentsSupported()) {
|
|
595
595
|
return;
|
|
596
596
|
}
|
|
597
597
|
const position = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AdaptableAgGrid } from './AdaptableAgGrid';
|
|
2
|
-
import {
|
|
2
|
+
import { GetContextMenuItems, GetContextMenuItemsParams, GetMainMenuItems, GetMainMenuItemsParams, MenuItemDef } from '@ag-grid-community/core';
|
|
3
3
|
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
4
|
-
import { AdaptableMenuItem
|
|
4
|
+
import { AdaptableMenuItem } from '../PredefinedConfig/Common/Menu';
|
|
5
5
|
export declare class AgGridMenuAdapter {
|
|
6
6
|
private adaptableInstance;
|
|
7
7
|
constructor(adaptableInstance: AdaptableAgGrid);
|
|
@@ -9,20 +9,31 @@ export declare class AgGridMenuAdapter {
|
|
|
9
9
|
private get adaptableApi();
|
|
10
10
|
destroy(): void;
|
|
11
11
|
buildColumnMenu(params: GetMainMenuItemsParams, originalGetMainMenuItems: GetMainMenuItems): (string | MenuItemDef)[];
|
|
12
|
-
buildStructuredAdaptableColumnItems(menuContext: ColumnMenuContext): {
|
|
13
|
-
adaptableMenuItems: AdaptableMenuItem[];
|
|
14
|
-
structuredAdaptableMenuItems: AdaptableMenuItem[];
|
|
15
|
-
};
|
|
16
12
|
buildContextMenu(params: GetContextMenuItemsParams, originalGetContextMenuItems: GetContextMenuItems): (string | MenuItemDef)[];
|
|
17
|
-
createColumnMenuContextObject
|
|
13
|
+
private createColumnMenuContextObject;
|
|
18
14
|
private createAdaptableContextMenuItems;
|
|
19
15
|
private createContextMenuContextObject;
|
|
20
16
|
private mapAdaptableMenuItemToAgGridMenuDefinition;
|
|
21
17
|
private mapCustomMenuItemToAgGridMenuDefinition;
|
|
22
18
|
private mapUserMenuItemToAgGridMenuDefinition;
|
|
23
|
-
private
|
|
19
|
+
private buildContextMenuDefaultStructure;
|
|
20
|
+
/**
|
|
21
|
+
* Default strategy for menu items: return as is if there is only one item, otherwise group them under a parent item
|
|
22
|
+
*/
|
|
23
|
+
private getModuleSpecificStructure;
|
|
24
|
+
private getExportContextMenuStructure;
|
|
25
|
+
private getLayoutContextMenuStructure;
|
|
26
|
+
private buildMenuGroupParent;
|
|
27
|
+
private buildColumnMenuDefaultStructure;
|
|
28
|
+
private getColumnFilterColumnMenuStructure;
|
|
29
|
+
private getLayoutColumnMenuStructure;
|
|
30
|
+
private getStyledColumnColumnMenuStructure;
|
|
24
31
|
private mapAdaptableMenuItemToSystemMenuItems;
|
|
25
32
|
private createAdaptableColumnMenuItems;
|
|
26
33
|
private mapAdaptableIconToAgGridIcon;
|
|
34
|
+
/**
|
|
35
|
+
* The output of this function is used to build the column header menu if the AG Grid Menu Module is NOT present
|
|
36
|
+
* This is controlled by the AdaptableAgGrid.embedColumnMenu property
|
|
37
|
+
*/
|
|
27
38
|
buildStandaloneColumnHeader(adaptableColumn: AdaptableColumn): AdaptableMenuItem[];
|
|
28
39
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AgGridMenuAdapter = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const MenuOptions_1 = require("../AdaptableOptions/MenuOptions");
|
|
6
5
|
const Icon_1 = require("../components/Icon");
|
|
7
6
|
const icons_1 = require("../components/icons");
|
|
8
7
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
|
|
@@ -29,7 +28,8 @@ class AgGridMenuAdapter {
|
|
|
29
28
|
}
|
|
30
29
|
const adaptableColumn = this.adaptableApi.columnApi.getColumnWithColumnId((_a = params.column) === null || _a === void 0 ? void 0 : _a.getColId());
|
|
31
30
|
const menuContext = this.createColumnMenuContextObject(adaptableColumn, params.column);
|
|
32
|
-
const
|
|
31
|
+
const adaptableMenuItems = this.createAdaptableColumnMenuItems(menuContext);
|
|
32
|
+
const defaultColumnMenuStructure = this.buildColumnMenuDefaultStructure(adaptableMenuItems, menuContext);
|
|
33
33
|
// 1. first check if there is a custom column menu defined
|
|
34
34
|
if (typeof menuOptions.customColumnMenu === 'function') {
|
|
35
35
|
const defaultAgGridMenuItems = agGridMenuItems.map((itemName) => ({
|
|
@@ -39,7 +39,7 @@ class AgGridMenuAdapter {
|
|
|
39
39
|
const defaultAdaptableMenuItems = adaptableMenuItems.map((adaptableItem) => (Object.assign({ menuType: 'Adaptable' }, adaptableItem)));
|
|
40
40
|
const customMenuItems = menuOptions
|
|
41
41
|
.customColumnMenu(Object.assign(Object.assign({}, menuContext), { defaultAgGridMenuItems,
|
|
42
|
-
defaultAdaptableMenuItems,
|
|
42
|
+
defaultAdaptableMenuItems, defaultAdaptableMenuStructure: this.mapAdaptableMenuItemToSystemMenuItems(defaultColumnMenuStructure) }))
|
|
43
43
|
.filter(Boolean);
|
|
44
44
|
return customMenuItems
|
|
45
45
|
.map((customMenuItem) => this.mapCustomMenuItemToAgGridMenuDefinition(customMenuItem, menuContext))
|
|
@@ -49,16 +49,10 @@ class AgGridMenuAdapter {
|
|
|
49
49
|
const defaultContextMenu = [
|
|
50
50
|
...agGridMenuItems,
|
|
51
51
|
'separator',
|
|
52
|
-
...
|
|
52
|
+
...defaultColumnMenuStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
|
|
53
53
|
];
|
|
54
54
|
return defaultContextMenu;
|
|
55
55
|
}
|
|
56
|
-
buildStructuredAdaptableColumnItems(menuContext) {
|
|
57
|
-
const adaptableMenuItems = this.createAdaptableColumnMenuItems(menuContext);
|
|
58
|
-
// sort Adaptable menu items by default order
|
|
59
|
-
const structuredAdaptableMenuItems = this.buildGroupedModuleItems(MenuOptions_1.DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE, adaptableMenuItems);
|
|
60
|
-
return { adaptableMenuItems, structuredAdaptableMenuItems };
|
|
61
|
-
}
|
|
62
56
|
buildContextMenu(params, originalGetContextMenuItems) {
|
|
63
57
|
var _a;
|
|
64
58
|
// we do this in order to refresh the internal state of selected cells (technically query the AG Grid cellRanges)
|
|
@@ -73,8 +67,7 @@ class AgGridMenuAdapter {
|
|
|
73
67
|
const adaptableColumn = this.adaptableApi.columnApi.getColumnWithColumnId((_a = params.column) === null || _a === void 0 ? void 0 : _a.getColId());
|
|
74
68
|
const menuContext = this.createContextMenuContextObject(params, adaptableColumn);
|
|
75
69
|
const adaptableMenuItems = this.createAdaptableContextMenuItems(menuContext);
|
|
76
|
-
|
|
77
|
-
const structuredAdaptableMenuItems = this.buildGroupedModuleItems(MenuOptions_1.DEFAULT_ADAPTABLE_CONTEXT_MENU_STRUCTURE, adaptableMenuItems);
|
|
70
|
+
const defaultContextMenuStructure = this.buildContextMenuDefaultStructure(adaptableMenuItems, menuContext);
|
|
78
71
|
// 1. first check if there is a custom context menu defined
|
|
79
72
|
if (typeof menuOptions.customContextMenu === 'function') {
|
|
80
73
|
const defaultAgGridMenuItems = agGridMenuItems.map((itemName) => ({
|
|
@@ -84,7 +77,7 @@ class AgGridMenuAdapter {
|
|
|
84
77
|
const defaultAdaptableMenuItems = adaptableMenuItems.map((adaptableItem) => (Object.assign({ menuType: 'Adaptable' }, adaptableItem)));
|
|
85
78
|
const customMenuItems = menuOptions
|
|
86
79
|
.customContextMenu(Object.assign(Object.assign({}, menuContext), { defaultAgGridMenuItems,
|
|
87
|
-
defaultAdaptableMenuItems,
|
|
80
|
+
defaultAdaptableMenuItems, defaultAdaptableMenuStructure: this.mapAdaptableMenuItemToSystemMenuItems(defaultContextMenuStructure) }))
|
|
88
81
|
.filter(Boolean);
|
|
89
82
|
return customMenuItems
|
|
90
83
|
.map((customMenuItem) => this.mapCustomMenuItemToAgGridMenuDefinition(customMenuItem, menuContext))
|
|
@@ -94,7 +87,7 @@ class AgGridMenuAdapter {
|
|
|
94
87
|
const defaultContextMenu = [
|
|
95
88
|
...agGridMenuItems,
|
|
96
89
|
'separator',
|
|
97
|
-
...
|
|
90
|
+
...defaultContextMenuStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
|
|
98
91
|
];
|
|
99
92
|
return defaultContextMenu;
|
|
100
93
|
}
|
|
@@ -104,7 +97,7 @@ class AgGridMenuAdapter {
|
|
|
104
97
|
createAdaptableContextMenuItems(menuContext) {
|
|
105
98
|
let contextMenuItems = [];
|
|
106
99
|
this.adaptableInstance.adaptableModules.forEach((module) => {
|
|
107
|
-
let menuItems = module.
|
|
100
|
+
let menuItems = module.createContextMenuItems(menuContext);
|
|
108
101
|
if (menuItems) {
|
|
109
102
|
contextMenuItems.push(...menuItems.filter(Boolean).filter((item) => item.isVisible !== false));
|
|
110
103
|
}
|
|
@@ -144,6 +137,9 @@ class AgGridMenuAdapter {
|
|
|
144
137
|
}
|
|
145
138
|
mapAdaptableMenuItemToAgGridMenuDefinition(adaptableMenuItem) {
|
|
146
139
|
var _a;
|
|
140
|
+
if (adaptableMenuItem === '-') {
|
|
141
|
+
return 'separator';
|
|
142
|
+
}
|
|
147
143
|
return {
|
|
148
144
|
name: adaptableMenuItem.label,
|
|
149
145
|
action: adaptableMenuItem.onClick
|
|
@@ -201,43 +197,312 @@ class AgGridMenuAdapter {
|
|
|
201
197
|
}).filter(Boolean),
|
|
202
198
|
};
|
|
203
199
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
200
|
+
buildContextMenuDefaultStructure(availableMenuItems, menuContext) {
|
|
201
|
+
// Alert
|
|
202
|
+
const alertMenuItems = this.getModuleSpecificStructure('Alert', availableMenuItems);
|
|
203
|
+
// BulkUpdate
|
|
204
|
+
const bulkUpdateMenuItems = this.getModuleSpecificStructure('BulkUpdate', availableMenuItems);
|
|
205
|
+
// CalculatedColumn
|
|
206
|
+
const calculatedColumnMenuItems = this.getModuleSpecificStructure('CalculatedColumn', availableMenuItems);
|
|
207
|
+
// CellSummary
|
|
208
|
+
const cellSummaryMenuItems = this.getModuleSpecificStructure('CellSummary', availableMenuItems);
|
|
209
|
+
// ColumnFilter
|
|
210
|
+
const columnFilterMenuItems = this.getModuleSpecificStructure('ColumnFilter', availableMenuItems);
|
|
211
|
+
// ColumnInfo
|
|
212
|
+
const columnInfoMenuItems = this.getModuleSpecificStructure('ColumnInfo', availableMenuItems);
|
|
213
|
+
// Comment
|
|
214
|
+
const commentMenuItems = this.getModuleSpecificStructure('Comment', availableMenuItems);
|
|
215
|
+
// Dashboard
|
|
216
|
+
const dashboardMenuItems = this.getModuleSpecificStructure('Dashboard', availableMenuItems);
|
|
217
|
+
// DataImport
|
|
218
|
+
const dataImportMenuItems = this.getModuleSpecificStructure('DataImport', availableMenuItems);
|
|
219
|
+
// Export
|
|
220
|
+
const exportMenuItems = this.getExportContextMenuStructure(availableMenuItems);
|
|
221
|
+
// FDC3
|
|
222
|
+
const fdc3MenuItems = this.getModuleSpecificStructure('Fdc3', availableMenuItems);
|
|
223
|
+
// FlashingCell
|
|
224
|
+
const flashingCellMenuItems = this.getModuleSpecificStructure('FlashingCell', availableMenuItems);
|
|
225
|
+
// GridInfo
|
|
226
|
+
const gridInfoMenuItems = this.getModuleSpecificStructure('GridInfo', availableMenuItems);
|
|
227
|
+
// Layout
|
|
228
|
+
const [gridActionItems, otherLayoutItems] = this.getLayoutContextMenuStructure(availableMenuItems);
|
|
229
|
+
// Note
|
|
230
|
+
const noteMenuItems = this.getModuleSpecificStructure('Note', availableMenuItems);
|
|
231
|
+
// SettingsPanel
|
|
232
|
+
const settingsPanelMenuItems = this.getModuleSpecificStructure('SettingsPanel', availableMenuItems);
|
|
233
|
+
// SmartEdit
|
|
234
|
+
const smartEditMenuItems = this.getModuleSpecificStructure('SmartEdit', availableMenuItems);
|
|
235
|
+
// SystemStatus
|
|
236
|
+
const systemStatusMenuItems = this.getModuleSpecificStructure('SystemStatus', availableMenuItems);
|
|
237
|
+
/**
|
|
238
|
+
* Custom structures
|
|
239
|
+
*/
|
|
240
|
+
const gridMenuItem = {
|
|
241
|
+
name: 'grid-group',
|
|
242
|
+
label: 'Grid',
|
|
243
|
+
// TODO
|
|
244
|
+
module: 'ColumnInfo',
|
|
245
|
+
isVisible: true,
|
|
246
|
+
icon: {
|
|
247
|
+
name: 'grid',
|
|
248
|
+
},
|
|
249
|
+
subItems: [
|
|
250
|
+
...gridActionItems,
|
|
251
|
+
...otherLayoutItems,
|
|
252
|
+
...cellSummaryMenuItems,
|
|
253
|
+
...dataImportMenuItems,
|
|
254
|
+
...systemStatusMenuItems,
|
|
255
|
+
...gridInfoMenuItems,
|
|
256
|
+
],
|
|
257
|
+
};
|
|
258
|
+
const columnMenuItem = {
|
|
259
|
+
name: 'column-group',
|
|
260
|
+
label: 'Column',
|
|
261
|
+
// TODO
|
|
262
|
+
module: 'ColumnInfo',
|
|
263
|
+
isVisible: true,
|
|
264
|
+
icon: {
|
|
265
|
+
name: 'columns',
|
|
266
|
+
},
|
|
267
|
+
subItems: [
|
|
268
|
+
...bulkUpdateMenuItems,
|
|
269
|
+
...smartEditMenuItems,
|
|
270
|
+
...calculatedColumnMenuItems,
|
|
271
|
+
...columnInfoMenuItems,
|
|
272
|
+
],
|
|
273
|
+
};
|
|
274
|
+
return [
|
|
275
|
+
...noteMenuItems,
|
|
276
|
+
...commentMenuItems,
|
|
277
|
+
'-',
|
|
278
|
+
...settingsPanelMenuItems,
|
|
279
|
+
...dashboardMenuItems,
|
|
280
|
+
...columnFilterMenuItems,
|
|
281
|
+
gridMenuItem,
|
|
282
|
+
columnMenuItem,
|
|
283
|
+
...exportMenuItems,
|
|
284
|
+
...flashingCellMenuItems,
|
|
285
|
+
...alertMenuItems,
|
|
286
|
+
...fdc3MenuItems,
|
|
287
|
+
];
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Default strategy for menu items: return as is if there is only one item, otherwise group them under a parent item
|
|
291
|
+
*/
|
|
292
|
+
getModuleSpecificStructure(module, menuItems) {
|
|
293
|
+
const moduleItems = menuItems.filter((menuItem) => menuItem.module === module);
|
|
294
|
+
if (moduleItems.length > 1) {
|
|
295
|
+
const moduleInfo = this.adaptableInstance.ModuleService.getModuleInfoByModule(module);
|
|
296
|
+
return [this.buildMenuGroupParent(module, moduleItems)];
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
return moduleItems;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
getExportContextMenuStructure(menuItems) {
|
|
303
|
+
const exportMenuItems = menuItems.filter((menuItem) => menuItem.module === 'Export');
|
|
304
|
+
if (!exportMenuItems.length) {
|
|
305
|
+
return [];
|
|
306
|
+
}
|
|
307
|
+
const cellSelectionItems = exportMenuItems.filter((item) => item.name.startsWith('export-cells'));
|
|
308
|
+
const canExportCells = cellSelectionItems.length;
|
|
309
|
+
const rowSelectionItems = exportMenuItems.filter((item) => item.name.startsWith('export-rows'));
|
|
310
|
+
const canExportRows = rowSelectionItems.length;
|
|
311
|
+
if (canExportCells && !canExportRows) {
|
|
312
|
+
return [
|
|
313
|
+
this.buildMenuGroupParent('Export', cellSelectionItems, {
|
|
314
|
+
label: 'Export Selected Cells',
|
|
315
|
+
}),
|
|
316
|
+
];
|
|
317
|
+
}
|
|
318
|
+
if (!canExportCells && canExportRows) {
|
|
319
|
+
return [
|
|
320
|
+
this.buildMenuGroupParent('Export', rowSelectionItems, {
|
|
321
|
+
label: 'Export Selected Rows',
|
|
322
|
+
}),
|
|
323
|
+
];
|
|
324
|
+
}
|
|
325
|
+
if (canExportCells && canExportRows) {
|
|
326
|
+
const cellsSubMenu = this.buildMenuGroupParent('Export', cellSelectionItems, {
|
|
327
|
+
label: 'Cells',
|
|
328
|
+
});
|
|
329
|
+
const rowsSubMenu = this.buildMenuGroupParent('Export', rowSelectionItems, { label: 'Rows' });
|
|
330
|
+
return [
|
|
331
|
+
this.buildMenuGroupParent('Export', [cellsSubMenu, rowsSubMenu], {
|
|
332
|
+
label: 'Export Selected',
|
|
333
|
+
}),
|
|
334
|
+
];
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
getLayoutContextMenuStructure(menuItems) {
|
|
338
|
+
const layoutMenuItems = menuItems.filter((menuItem) => menuItem.module === 'Layout');
|
|
339
|
+
if (!layoutMenuItems.length) {
|
|
340
|
+
return [[], []];
|
|
341
|
+
}
|
|
342
|
+
const gridActionsItemNames = [
|
|
343
|
+
'layout-clear-selection',
|
|
344
|
+
'layout-select-all',
|
|
345
|
+
'layout-auto-size',
|
|
346
|
+
];
|
|
347
|
+
const gridActionsItems = layoutMenuItems.filter((item) => gridActionsItemNames.includes(item.name));
|
|
348
|
+
const otherLayoutItems = layoutMenuItems.filter((item) => !gridActionsItemNames.includes(item.name));
|
|
349
|
+
return [gridActionsItems, otherLayoutItems];
|
|
350
|
+
}
|
|
351
|
+
buildMenuGroupParent(module, menuItems, config) {
|
|
352
|
+
var _a, _b;
|
|
353
|
+
const moduleInfo = this.adaptableInstance.ModuleService.getModuleInfoByModule(module);
|
|
354
|
+
return {
|
|
355
|
+
name: 'menu-group',
|
|
356
|
+
label: (_a = config === null || config === void 0 ? void 0 : config.label) !== null && _a !== void 0 ? _a : moduleInfo.FriendlyName,
|
|
357
|
+
isVisible: true,
|
|
358
|
+
module: moduleInfo.ModuleName,
|
|
359
|
+
icon: {
|
|
360
|
+
name: (_b = config === null || config === void 0 ? void 0 : config.icon) !== null && _b !== void 0 ? _b : moduleInfo.Glyph,
|
|
361
|
+
},
|
|
362
|
+
subItems: menuItems,
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
buildColumnMenuDefaultStructure(availableMenuItems, menuContext) {
|
|
366
|
+
// CalculatedColumn
|
|
367
|
+
const calculatedColumnMenuItems = this.getModuleSpecificStructure('CalculatedColumn', availableMenuItems);
|
|
368
|
+
// CellSummary
|
|
369
|
+
const cellSummaryMenuItems = this.getModuleSpecificStructure('CellSummary', availableMenuItems);
|
|
370
|
+
// ColumnFilter
|
|
371
|
+
const [columnFilterGroup, filterVisibilityItems] = this.getColumnFilterColumnMenuStructure(availableMenuItems);
|
|
372
|
+
// ColumnInfo
|
|
373
|
+
const columnInfoMenuItems = this.getModuleSpecificStructure('ColumnInfo', availableMenuItems);
|
|
374
|
+
// CustomSort
|
|
375
|
+
const customSortMenuItems = this.getModuleSpecificStructure('CustomSort', availableMenuItems);
|
|
376
|
+
// Dashboard
|
|
377
|
+
const dashboardMenuItems = this.getModuleSpecificStructure('Dashboard', availableMenuItems);
|
|
378
|
+
// DataImport
|
|
379
|
+
const dataImportMenuItems = this.getModuleSpecificStructure('DataImport', availableMenuItems);
|
|
380
|
+
// FlashingCell
|
|
381
|
+
const flashingCellMenuItems = this.getModuleSpecificStructure('FlashingCell', availableMenuItems);
|
|
382
|
+
// FormatColumn
|
|
383
|
+
const formatColumnMenuItems = this.getModuleSpecificStructure('FormatColumn', availableMenuItems);
|
|
384
|
+
// FreeTextColumn
|
|
385
|
+
const freeTextColumnMenuItems = this.getModuleSpecificStructure('FreeTextColumn', availableMenuItems);
|
|
386
|
+
// GridInfo
|
|
387
|
+
const gridInfoMenuItems = this.getModuleSpecificStructure('GridInfo', availableMenuItems);
|
|
388
|
+
// Layout
|
|
389
|
+
const [gridSelectItems, columnSelectItems, columnActionGroup, otherLayoutItems] = this.getLayoutColumnMenuStructure(availableMenuItems);
|
|
390
|
+
// PlusMinus
|
|
391
|
+
const plusMinusMenuItems = this.getModuleSpecificStructure('PlusMinus', availableMenuItems);
|
|
392
|
+
// SettingsPanel
|
|
393
|
+
const settingsPanelMenuItems = this.getModuleSpecificStructure('SettingsPanel', availableMenuItems);
|
|
394
|
+
// StyledColumn
|
|
395
|
+
const styledColumnMenuItems = this.getStyledColumnColumnMenuStructure(availableMenuItems);
|
|
396
|
+
// SystemStatus
|
|
397
|
+
const systemStatusMenuItems = this.getModuleSpecificStructure('SystemStatus', availableMenuItems);
|
|
398
|
+
/**
|
|
399
|
+
* Custom structures
|
|
400
|
+
*/
|
|
401
|
+
const gridMenuItem = {
|
|
402
|
+
name: 'grid-group',
|
|
403
|
+
label: 'Grid',
|
|
404
|
+
// TODO
|
|
405
|
+
module: 'ColumnInfo',
|
|
406
|
+
isVisible: true,
|
|
407
|
+
icon: {
|
|
408
|
+
name: 'grid',
|
|
409
|
+
},
|
|
410
|
+
subItems: [
|
|
411
|
+
...otherLayoutItems,
|
|
412
|
+
...filterVisibilityItems,
|
|
413
|
+
...gridSelectItems,
|
|
414
|
+
...cellSummaryMenuItems,
|
|
415
|
+
...dataImportMenuItems,
|
|
416
|
+
...systemStatusMenuItems,
|
|
417
|
+
...gridInfoMenuItems,
|
|
418
|
+
],
|
|
419
|
+
};
|
|
420
|
+
const columnMenuItem = {
|
|
421
|
+
name: 'column-group',
|
|
422
|
+
label: 'Column',
|
|
423
|
+
// TODO
|
|
424
|
+
module: 'ColumnInfo',
|
|
425
|
+
isVisible: true,
|
|
426
|
+
icon: {
|
|
427
|
+
name: 'columns',
|
|
428
|
+
},
|
|
429
|
+
subItems: [
|
|
430
|
+
...columnActionGroup,
|
|
431
|
+
...calculatedColumnMenuItems,
|
|
432
|
+
...freeTextColumnMenuItems,
|
|
433
|
+
...customSortMenuItems,
|
|
434
|
+
...plusMinusMenuItems,
|
|
435
|
+
...columnSelectItems,
|
|
436
|
+
...columnInfoMenuItems,
|
|
437
|
+
],
|
|
438
|
+
};
|
|
439
|
+
const createStyleMenuItem = {
|
|
440
|
+
name: 'styling-group',
|
|
441
|
+
label: 'Styling',
|
|
442
|
+
// TODO
|
|
443
|
+
module: 'ColumnInfo',
|
|
444
|
+
isVisible: true,
|
|
445
|
+
icon: {
|
|
446
|
+
name: 'brush',
|
|
447
|
+
},
|
|
448
|
+
subItems: [...flashingCellMenuItems, ...formatColumnMenuItems, ...styledColumnMenuItems],
|
|
449
|
+
};
|
|
450
|
+
return [
|
|
451
|
+
...settingsPanelMenuItems,
|
|
452
|
+
...dashboardMenuItems,
|
|
453
|
+
...columnFilterGroup,
|
|
454
|
+
createStyleMenuItem,
|
|
455
|
+
gridMenuItem,
|
|
456
|
+
columnMenuItem,
|
|
457
|
+
];
|
|
458
|
+
}
|
|
459
|
+
getColumnFilterColumnMenuStructure(menuItems) {
|
|
460
|
+
const columnFilterMenuItems = menuItems.filter((menuItem) => menuItem.module === 'ColumnFilter');
|
|
461
|
+
const filterVisibilityItems = columnFilterMenuItems.filter((item) => ['column-filter-bar-hide', 'column-filter-bar-show'].includes(item.name));
|
|
462
|
+
const filterActionItems = columnFilterMenuItems.filter((item) => ['column-filter-clear', 'column-filter-suspend', 'column-filter-unsuspend'].includes(item.name));
|
|
463
|
+
const columnFilterGroup = filterActionItems.length
|
|
464
|
+
? [
|
|
465
|
+
{
|
|
466
|
+
name: 'column-filter-group',
|
|
467
|
+
label: 'Filter',
|
|
468
|
+
module: 'ColumnFilter',
|
|
469
|
+
isVisible: true,
|
|
470
|
+
icon: {
|
|
471
|
+
name: 'filter',
|
|
218
472
|
},
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
473
|
+
subItems: filterActionItems,
|
|
474
|
+
},
|
|
475
|
+
]
|
|
476
|
+
: [];
|
|
477
|
+
return [columnFilterGroup, filterVisibilityItems];
|
|
478
|
+
}
|
|
479
|
+
getLayoutColumnMenuStructure(menuItems) {
|
|
480
|
+
const layoutMenuItems = menuItems.filter((menuItem) => menuItem.module === 'Layout');
|
|
481
|
+
if (!layoutMenuItems.length) {
|
|
482
|
+
return [[], [], [], []];
|
|
483
|
+
}
|
|
484
|
+
const columnSelectItemNames = [
|
|
485
|
+
'layout-column-select-preserve',
|
|
486
|
+
'layout-column-select-reset',
|
|
487
|
+
'layout-column-select',
|
|
488
|
+
];
|
|
489
|
+
const columnSelectItems = layoutMenuItems.filter((item) => columnSelectItemNames.includes(item.name));
|
|
490
|
+
const gridSelectItems = layoutMenuItems.filter((item) => item.name === 'layout-grid-select');
|
|
491
|
+
const columnActionGroup = layoutMenuItems.filter((item) => ['layout-column-caption-change', 'layout-column-hide'].includes(item.name));
|
|
492
|
+
const otherLayoutItems = layoutMenuItems.filter((item) => !columnSelectItemNames.includes(item.name) &&
|
|
493
|
+
!['layout-column-caption-change', 'layout-column-hide'].includes(item.name) &&
|
|
494
|
+
item.name !== 'layout-grid-select');
|
|
495
|
+
return [gridSelectItems, columnSelectItems, columnActionGroup, otherLayoutItems];
|
|
496
|
+
}
|
|
497
|
+
getStyledColumnColumnMenuStructure(menuItems) {
|
|
498
|
+
const styledColumnMenuItems = menuItems.filter((menuItem) => menuItem.module === 'StyledColumn');
|
|
499
|
+
return styledColumnMenuItems;
|
|
238
500
|
}
|
|
239
501
|
mapAdaptableMenuItemToSystemMenuItems(adaptableMenuItems) {
|
|
240
502
|
return (adaptableMenuItems !== null && adaptableMenuItems !== void 0 ? adaptableMenuItems : []).map((menuItem) => {
|
|
503
|
+
if (menuItem === '-') {
|
|
504
|
+
return menuItem;
|
|
505
|
+
}
|
|
241
506
|
let subItems = menuItem.subItems;
|
|
242
507
|
if (subItems && subItems.length > 0) {
|
|
243
508
|
subItems = subItems.map((subItem) => this.mapAdaptableMenuItemToSystemMenuItems(subItem.subItems));
|
|
@@ -248,7 +513,7 @@ class AgGridMenuAdapter {
|
|
|
248
513
|
createAdaptableColumnMenuItems(menuContext) {
|
|
249
514
|
let contextMenuItems = [];
|
|
250
515
|
this.adaptableInstance.adaptableModules.forEach((s) => {
|
|
251
|
-
let menuItems = s.
|
|
516
|
+
let menuItems = s.createColumnMenuItems(menuContext.adaptableColumn);
|
|
252
517
|
if (menuItems) {
|
|
253
518
|
contextMenuItems.push(...menuItems.filter(Boolean).filter((item) => item.isVisible !== false));
|
|
254
519
|
}
|
|
@@ -273,10 +538,14 @@ class AgGridMenuAdapter {
|
|
|
273
538
|
});
|
|
274
539
|
}
|
|
275
540
|
}
|
|
541
|
+
/**
|
|
542
|
+
* The output of this function is used to build the column header menu if the AG Grid Menu Module is NOT present
|
|
543
|
+
* This is controlled by the AdaptableAgGrid.embedColumnMenu property
|
|
544
|
+
*/
|
|
276
545
|
buildStandaloneColumnHeader(adaptableColumn) {
|
|
277
546
|
const agGridColumn = this.adaptableInstance.getAgGridColumnForColumnId(adaptableColumn.columnId);
|
|
278
547
|
const menuContext = this.createColumnMenuContextObject(adaptableColumn, agGridColumn);
|
|
279
|
-
return this.
|
|
548
|
+
return this.createAdaptableColumnMenuItems(menuContext);
|
|
280
549
|
}
|
|
281
550
|
}
|
|
282
551
|
exports.AgGridMenuAdapter = AgGridMenuAdapter;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
|
|
6
|
+
exports.default = (props) => (React.createElement(DefaultIcon_1.default, Object.assign({}, props, { viewBox: "0 -960 960 960" }),
|
|
7
|
+
React.createElement("path", { d: "m592-481-57-57 143-182H353l-80-80h487q25 0 36 22t-4 42L592-481ZM791-56 560-287v87q0 17-11.5 28.5T520-160h-80q-17 0-28.5-11.5T400-200v-247L56-791l56-57 736 736-57 56ZM535-538Z" })));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
|
|
6
|
+
exports.default = (props) => (React.createElement(DefaultIcon_1.default, Object.assign({}, props, { viewBox: "0 -960 960 960" }),
|
|
7
|
+
React.createElement("path", { d: "M143-192v-72h432v72H143Zm480.774-240Q544-432 488-488.226t-56-136Q432-704 488.226-760t136-56Q704-816 760-759.774t56 136Q816-544 759.774-488t-136 56ZM143-492v-72h224q5 20 12 37.5t17 34.5H143Zm0 150v-72h322q24.227 18.242 51.613 30.621Q544-371 575-365v23H143Zm457-186h48v-96h-48v96Zm24-144q9.6 0 16.8-7.2 7.2-7.2 7.2-16.8 0-9.6-7.2-16.8-7.2-7.2-16.8-7.2-9.6 0-16.8 7.2-7.2 7.2-7.2 16.8 0 9.6 7.2 16.8 7.2 7.2 16.8 7.2Z" })));
|