@adaptabletools/adaptable 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 +1 -96
- 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 +4 -0
- package/src/components/icons/grid-info.d.ts +3 -0
- package/src/components/icons/grid-info.js +4 -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 +4 -0
- package/src/components/icons/select-fwd.d.ts +3 -0
- package/src/components/icons/select-fwd.js +4 -0
- package/src/components/icons/select-off.d.ts +3 -0
- package/src/components/icons/select-off.js +4 -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.esm.tsbuildinfo +1 -1
|
@@ -5,20 +5,21 @@ export class SystemStatusModule extends AdaptableModuleBase {
|
|
|
5
5
|
constructor(api) {
|
|
6
6
|
super(ModuleConstants.SystemStatusModuleId, ModuleConstants.SystemStatusFriendlyName, 'traffic-lights', 'SystemStatusPopup', 'Provide messages about the Status of your application', api);
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
createColumnMenuItems(column) {
|
|
9
9
|
if (this.isModuleAvailable()) {
|
|
10
10
|
return [
|
|
11
11
|
this.createMenuItemShowPopup('system-status-show', 'Show System Status', this.moduleInfo.Popup, this.moduleInfo.Glyph),
|
|
12
12
|
];
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
createContextMenuItems(menuContext) {
|
|
16
16
|
if (this.isModuleAvailable()) {
|
|
17
17
|
let popUpParams = {
|
|
18
18
|
source: 'ContextMenu',
|
|
19
19
|
};
|
|
20
20
|
return [
|
|
21
|
-
this.createMainMenuItemShowPopup({
|
|
21
|
+
this.createMainMenuItemShowPopup({
|
|
22
|
+
Name: 'system-status-show',
|
|
22
23
|
Label: 'Show System Status',
|
|
23
24
|
ComponentName: this.moduleInfo.Popup,
|
|
24
25
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -1100,13 +1100,15 @@ const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, c
|
|
|
1100
1100
|
if ((_a = aggregationEvaluation.context) === null || _a === void 0 ? void 0 : _a.weightParam) {
|
|
1101
1101
|
// weighted average
|
|
1102
1102
|
const weightValue = (_b = context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, aggregationEvaluation.context.weightParam.value)) !== null && _b !== void 0 ? _b : 0;
|
|
1103
|
-
cumulationBag.currentValue =
|
|
1103
|
+
cumulationBag.currentValue =
|
|
1104
|
+
cumulationBag.currentValue + rowValue * weightValue;
|
|
1104
1105
|
cumulationBag.numberOfCumulatedValues =
|
|
1105
1106
|
cumulationBag.numberOfCumulatedValues + weightValue;
|
|
1106
1107
|
}
|
|
1107
1108
|
else {
|
|
1108
1109
|
cumulationBag.currentValue = cumulationBag.currentValue + rowValue;
|
|
1109
|
-
cumulationBag.numberOfCumulatedValues =
|
|
1110
|
+
cumulationBag.numberOfCumulatedValues =
|
|
1111
|
+
cumulationBag.numberOfCumulatedValues + 1;
|
|
1110
1112
|
}
|
|
1111
1113
|
}
|
|
1112
1114
|
if (cumulationBag.numberOfCumulatedValues !== 0) {
|
|
@@ -10,13 +10,13 @@ export class ModuleService {
|
|
|
10
10
|
const settingsPanelMenuItems = [];
|
|
11
11
|
const buttonMenuItems = [];
|
|
12
12
|
this.getModuleCollection().forEach((module) => {
|
|
13
|
-
const settingsPanelMenuItem = module.
|
|
13
|
+
const settingsPanelMenuItem = module.createModuleMenuItem('ModuleMenu');
|
|
14
14
|
if (Helper.objectExists(settingsPanelMenuItem)) {
|
|
15
15
|
if (settingsPanelMenuItems.findIndex((m) => m.module == settingsPanelMenuItem.module) == -1) {
|
|
16
16
|
settingsPanelMenuItems.push(settingsPanelMenuItem);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
const buttonMenuItem = module.
|
|
19
|
+
const buttonMenuItem = module.createModuleMenuItem('ModuleButton');
|
|
20
20
|
if (Helper.objectExists(buttonMenuItem)) {
|
|
21
21
|
if (buttonMenuItems.findIndex((m) => m.module == buttonMenuItem.module) == -1) {
|
|
22
22
|
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;
|
|
@@ -1690,7 +1690,8 @@ export class AdaptableAgGrid {
|
|
|
1690
1690
|
return acc;
|
|
1691
1691
|
}
|
|
1692
1692
|
const ColumnGroupId = columnGroup.getGroupId();
|
|
1693
|
-
const AllowGroupSplit = !columnGroup.getProvidedColumnGroup().getColGroupDef()
|
|
1693
|
+
const AllowGroupSplit = !columnGroup.getProvidedColumnGroup().getColGroupDef()
|
|
1694
|
+
.marryChildren;
|
|
1694
1695
|
const FriendlyName = (_c = columnGroup.getProvidedColumnGroup().getColGroupDef().headerName) !== null && _c !== void 0 ? _c : ColumnGroupId;
|
|
1695
1696
|
const columnsInGroup = columnGroup.getLeafColumns();
|
|
1696
1697
|
columnsInGroup.forEach((col) => {
|
|
@@ -570,7 +570,7 @@ export class AgGridColumnAdapter {
|
|
|
570
570
|
if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Note')) {
|
|
571
571
|
return;
|
|
572
572
|
}
|
|
573
|
-
if (!this.adaptableApi.noteApi.internalApi.
|
|
573
|
+
if (!this.adaptableApi.noteApi.internalApi.areNotesSupported()) {
|
|
574
574
|
return;
|
|
575
575
|
}
|
|
576
576
|
const cellPosition = {
|
|
@@ -587,7 +587,7 @@ export class AgGridColumnAdapter {
|
|
|
587
587
|
if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Comment')) {
|
|
588
588
|
return;
|
|
589
589
|
}
|
|
590
|
-
if (!this.adaptableApi.commentApi.internalApi.
|
|
590
|
+
if (!this.adaptableApi.commentApi.internalApi.areCommentsSupported()) {
|
|
591
591
|
return;
|
|
592
592
|
}
|
|
593
593
|
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
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE, DEFAULT_ADAPTABLE_CONTEXT_MENU_STRUCTURE, } from '../AdaptableOptions/MenuOptions';
|
|
2
1
|
import { isAdaptableElementIcon } from '../components/Icon';
|
|
3
2
|
import { iconToString } from '../components/icons';
|
|
4
3
|
import ArrayExtensions from '../Utilities/Extensions/ArrayExtensions';
|
|
@@ -25,7 +24,8 @@ export class AgGridMenuAdapter {
|
|
|
25
24
|
}
|
|
26
25
|
const adaptableColumn = this.adaptableApi.columnApi.getColumnWithColumnId((_a = params.column) === null || _a === void 0 ? void 0 : _a.getColId());
|
|
27
26
|
const menuContext = this.createColumnMenuContextObject(adaptableColumn, params.column);
|
|
28
|
-
const
|
|
27
|
+
const adaptableMenuItems = this.createAdaptableColumnMenuItems(menuContext);
|
|
28
|
+
const defaultColumnMenuStructure = this.buildColumnMenuDefaultStructure(adaptableMenuItems, menuContext);
|
|
29
29
|
// 1. first check if there is a custom column menu defined
|
|
30
30
|
if (typeof menuOptions.customColumnMenu === 'function') {
|
|
31
31
|
const defaultAgGridMenuItems = agGridMenuItems.map((itemName) => ({
|
|
@@ -35,7 +35,7 @@ export class AgGridMenuAdapter {
|
|
|
35
35
|
const defaultAdaptableMenuItems = adaptableMenuItems.map((adaptableItem) => (Object.assign({ menuType: 'Adaptable' }, adaptableItem)));
|
|
36
36
|
const customMenuItems = menuOptions
|
|
37
37
|
.customColumnMenu(Object.assign(Object.assign({}, menuContext), { defaultAgGridMenuItems,
|
|
38
|
-
defaultAdaptableMenuItems,
|
|
38
|
+
defaultAdaptableMenuItems, defaultAdaptableMenuStructure: this.mapAdaptableMenuItemToSystemMenuItems(defaultColumnMenuStructure) }))
|
|
39
39
|
.filter(Boolean);
|
|
40
40
|
return customMenuItems
|
|
41
41
|
.map((customMenuItem) => this.mapCustomMenuItemToAgGridMenuDefinition(customMenuItem, menuContext))
|
|
@@ -45,16 +45,10 @@ export class AgGridMenuAdapter {
|
|
|
45
45
|
const defaultContextMenu = [
|
|
46
46
|
...agGridMenuItems,
|
|
47
47
|
'separator',
|
|
48
|
-
...
|
|
48
|
+
...defaultColumnMenuStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
|
|
49
49
|
];
|
|
50
50
|
return defaultContextMenu;
|
|
51
51
|
}
|
|
52
|
-
buildStructuredAdaptableColumnItems(menuContext) {
|
|
53
|
-
const adaptableMenuItems = this.createAdaptableColumnMenuItems(menuContext);
|
|
54
|
-
// sort Adaptable menu items by default order
|
|
55
|
-
const structuredAdaptableMenuItems = this.buildGroupedModuleItems(DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE, adaptableMenuItems);
|
|
56
|
-
return { adaptableMenuItems, structuredAdaptableMenuItems };
|
|
57
|
-
}
|
|
58
52
|
buildContextMenu(params, originalGetContextMenuItems) {
|
|
59
53
|
var _a;
|
|
60
54
|
// we do this in order to refresh the internal state of selected cells (technically query the AG Grid cellRanges)
|
|
@@ -69,8 +63,7 @@ export class AgGridMenuAdapter {
|
|
|
69
63
|
const adaptableColumn = this.adaptableApi.columnApi.getColumnWithColumnId((_a = params.column) === null || _a === void 0 ? void 0 : _a.getColId());
|
|
70
64
|
const menuContext = this.createContextMenuContextObject(params, adaptableColumn);
|
|
71
65
|
const adaptableMenuItems = this.createAdaptableContextMenuItems(menuContext);
|
|
72
|
-
|
|
73
|
-
const structuredAdaptableMenuItems = this.buildGroupedModuleItems(DEFAULT_ADAPTABLE_CONTEXT_MENU_STRUCTURE, adaptableMenuItems);
|
|
66
|
+
const defaultContextMenuStructure = this.buildContextMenuDefaultStructure(adaptableMenuItems, menuContext);
|
|
74
67
|
// 1. first check if there is a custom context menu defined
|
|
75
68
|
if (typeof menuOptions.customContextMenu === 'function') {
|
|
76
69
|
const defaultAgGridMenuItems = agGridMenuItems.map((itemName) => ({
|
|
@@ -80,7 +73,7 @@ export class AgGridMenuAdapter {
|
|
|
80
73
|
const defaultAdaptableMenuItems = adaptableMenuItems.map((adaptableItem) => (Object.assign({ menuType: 'Adaptable' }, adaptableItem)));
|
|
81
74
|
const customMenuItems = menuOptions
|
|
82
75
|
.customContextMenu(Object.assign(Object.assign({}, menuContext), { defaultAgGridMenuItems,
|
|
83
|
-
defaultAdaptableMenuItems,
|
|
76
|
+
defaultAdaptableMenuItems, defaultAdaptableMenuStructure: this.mapAdaptableMenuItemToSystemMenuItems(defaultContextMenuStructure) }))
|
|
84
77
|
.filter(Boolean);
|
|
85
78
|
return customMenuItems
|
|
86
79
|
.map((customMenuItem) => this.mapCustomMenuItemToAgGridMenuDefinition(customMenuItem, menuContext))
|
|
@@ -90,7 +83,7 @@ export class AgGridMenuAdapter {
|
|
|
90
83
|
const defaultContextMenu = [
|
|
91
84
|
...agGridMenuItems,
|
|
92
85
|
'separator',
|
|
93
|
-
...
|
|
86
|
+
...defaultContextMenuStructure.map((adaptableItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)),
|
|
94
87
|
];
|
|
95
88
|
return defaultContextMenu;
|
|
96
89
|
}
|
|
@@ -100,7 +93,7 @@ export class AgGridMenuAdapter {
|
|
|
100
93
|
createAdaptableContextMenuItems(menuContext) {
|
|
101
94
|
let contextMenuItems = [];
|
|
102
95
|
this.adaptableInstance.adaptableModules.forEach((module) => {
|
|
103
|
-
let menuItems = module.
|
|
96
|
+
let menuItems = module.createContextMenuItems(menuContext);
|
|
104
97
|
if (menuItems) {
|
|
105
98
|
contextMenuItems.push(...menuItems.filter(Boolean).filter((item) => item.isVisible !== false));
|
|
106
99
|
}
|
|
@@ -140,6 +133,9 @@ export class AgGridMenuAdapter {
|
|
|
140
133
|
}
|
|
141
134
|
mapAdaptableMenuItemToAgGridMenuDefinition(adaptableMenuItem) {
|
|
142
135
|
var _a;
|
|
136
|
+
if (adaptableMenuItem === '-') {
|
|
137
|
+
return 'separator';
|
|
138
|
+
}
|
|
143
139
|
return {
|
|
144
140
|
name: adaptableMenuItem.label,
|
|
145
141
|
action: adaptableMenuItem.onClick
|
|
@@ -197,43 +193,312 @@ export class AgGridMenuAdapter {
|
|
|
197
193
|
}).filter(Boolean),
|
|
198
194
|
};
|
|
199
195
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
196
|
+
buildContextMenuDefaultStructure(availableMenuItems, menuContext) {
|
|
197
|
+
// Alert
|
|
198
|
+
const alertMenuItems = this.getModuleSpecificStructure('Alert', availableMenuItems);
|
|
199
|
+
// BulkUpdate
|
|
200
|
+
const bulkUpdateMenuItems = this.getModuleSpecificStructure('BulkUpdate', availableMenuItems);
|
|
201
|
+
// CalculatedColumn
|
|
202
|
+
const calculatedColumnMenuItems = this.getModuleSpecificStructure('CalculatedColumn', availableMenuItems);
|
|
203
|
+
// CellSummary
|
|
204
|
+
const cellSummaryMenuItems = this.getModuleSpecificStructure('CellSummary', availableMenuItems);
|
|
205
|
+
// ColumnFilter
|
|
206
|
+
const columnFilterMenuItems = this.getModuleSpecificStructure('ColumnFilter', availableMenuItems);
|
|
207
|
+
// ColumnInfo
|
|
208
|
+
const columnInfoMenuItems = this.getModuleSpecificStructure('ColumnInfo', availableMenuItems);
|
|
209
|
+
// Comment
|
|
210
|
+
const commentMenuItems = this.getModuleSpecificStructure('Comment', availableMenuItems);
|
|
211
|
+
// Dashboard
|
|
212
|
+
const dashboardMenuItems = this.getModuleSpecificStructure('Dashboard', availableMenuItems);
|
|
213
|
+
// DataImport
|
|
214
|
+
const dataImportMenuItems = this.getModuleSpecificStructure('DataImport', availableMenuItems);
|
|
215
|
+
// Export
|
|
216
|
+
const exportMenuItems = this.getExportContextMenuStructure(availableMenuItems);
|
|
217
|
+
// FDC3
|
|
218
|
+
const fdc3MenuItems = this.getModuleSpecificStructure('Fdc3', availableMenuItems);
|
|
219
|
+
// FlashingCell
|
|
220
|
+
const flashingCellMenuItems = this.getModuleSpecificStructure('FlashingCell', availableMenuItems);
|
|
221
|
+
// GridInfo
|
|
222
|
+
const gridInfoMenuItems = this.getModuleSpecificStructure('GridInfo', availableMenuItems);
|
|
223
|
+
// Layout
|
|
224
|
+
const [gridActionItems, otherLayoutItems] = this.getLayoutContextMenuStructure(availableMenuItems);
|
|
225
|
+
// Note
|
|
226
|
+
const noteMenuItems = this.getModuleSpecificStructure('Note', availableMenuItems);
|
|
227
|
+
// SettingsPanel
|
|
228
|
+
const settingsPanelMenuItems = this.getModuleSpecificStructure('SettingsPanel', availableMenuItems);
|
|
229
|
+
// SmartEdit
|
|
230
|
+
const smartEditMenuItems = this.getModuleSpecificStructure('SmartEdit', availableMenuItems);
|
|
231
|
+
// SystemStatus
|
|
232
|
+
const systemStatusMenuItems = this.getModuleSpecificStructure('SystemStatus', availableMenuItems);
|
|
233
|
+
/**
|
|
234
|
+
* Custom structures
|
|
235
|
+
*/
|
|
236
|
+
const gridMenuItem = {
|
|
237
|
+
name: 'grid-group',
|
|
238
|
+
label: 'Grid',
|
|
239
|
+
// TODO
|
|
240
|
+
module: 'ColumnInfo',
|
|
241
|
+
isVisible: true,
|
|
242
|
+
icon: {
|
|
243
|
+
name: 'grid',
|
|
244
|
+
},
|
|
245
|
+
subItems: [
|
|
246
|
+
...gridActionItems,
|
|
247
|
+
...otherLayoutItems,
|
|
248
|
+
...cellSummaryMenuItems,
|
|
249
|
+
...dataImportMenuItems,
|
|
250
|
+
...systemStatusMenuItems,
|
|
251
|
+
...gridInfoMenuItems,
|
|
252
|
+
],
|
|
253
|
+
};
|
|
254
|
+
const columnMenuItem = {
|
|
255
|
+
name: 'column-group',
|
|
256
|
+
label: 'Column',
|
|
257
|
+
// TODO
|
|
258
|
+
module: 'ColumnInfo',
|
|
259
|
+
isVisible: true,
|
|
260
|
+
icon: {
|
|
261
|
+
name: 'columns',
|
|
262
|
+
},
|
|
263
|
+
subItems: [
|
|
264
|
+
...bulkUpdateMenuItems,
|
|
265
|
+
...smartEditMenuItems,
|
|
266
|
+
...calculatedColumnMenuItems,
|
|
267
|
+
...columnInfoMenuItems,
|
|
268
|
+
],
|
|
269
|
+
};
|
|
270
|
+
return [
|
|
271
|
+
...noteMenuItems,
|
|
272
|
+
...commentMenuItems,
|
|
273
|
+
'-',
|
|
274
|
+
...settingsPanelMenuItems,
|
|
275
|
+
...dashboardMenuItems,
|
|
276
|
+
...columnFilterMenuItems,
|
|
277
|
+
gridMenuItem,
|
|
278
|
+
columnMenuItem,
|
|
279
|
+
...exportMenuItems,
|
|
280
|
+
...flashingCellMenuItems,
|
|
281
|
+
...alertMenuItems,
|
|
282
|
+
...fdc3MenuItems,
|
|
283
|
+
];
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Default strategy for menu items: return as is if there is only one item, otherwise group them under a parent item
|
|
287
|
+
*/
|
|
288
|
+
getModuleSpecificStructure(module, menuItems) {
|
|
289
|
+
const moduleItems = menuItems.filter((menuItem) => menuItem.module === module);
|
|
290
|
+
if (moduleItems.length > 1) {
|
|
291
|
+
const moduleInfo = this.adaptableInstance.ModuleService.getModuleInfoByModule(module);
|
|
292
|
+
return [this.buildMenuGroupParent(module, moduleItems)];
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
return moduleItems;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
getExportContextMenuStructure(menuItems) {
|
|
299
|
+
const exportMenuItems = menuItems.filter((menuItem) => menuItem.module === 'Export');
|
|
300
|
+
if (!exportMenuItems.length) {
|
|
301
|
+
return [];
|
|
302
|
+
}
|
|
303
|
+
const cellSelectionItems = exportMenuItems.filter((item) => item.name.startsWith('export-cells'));
|
|
304
|
+
const canExportCells = cellSelectionItems.length;
|
|
305
|
+
const rowSelectionItems = exportMenuItems.filter((item) => item.name.startsWith('export-rows'));
|
|
306
|
+
const canExportRows = rowSelectionItems.length;
|
|
307
|
+
if (canExportCells && !canExportRows) {
|
|
308
|
+
return [
|
|
309
|
+
this.buildMenuGroupParent('Export', cellSelectionItems, {
|
|
310
|
+
label: 'Export Selected Cells',
|
|
311
|
+
}),
|
|
312
|
+
];
|
|
313
|
+
}
|
|
314
|
+
if (!canExportCells && canExportRows) {
|
|
315
|
+
return [
|
|
316
|
+
this.buildMenuGroupParent('Export', rowSelectionItems, {
|
|
317
|
+
label: 'Export Selected Rows',
|
|
318
|
+
}),
|
|
319
|
+
];
|
|
320
|
+
}
|
|
321
|
+
if (canExportCells && canExportRows) {
|
|
322
|
+
const cellsSubMenu = this.buildMenuGroupParent('Export', cellSelectionItems, {
|
|
323
|
+
label: 'Cells',
|
|
324
|
+
});
|
|
325
|
+
const rowsSubMenu = this.buildMenuGroupParent('Export', rowSelectionItems, { label: 'Rows' });
|
|
326
|
+
return [
|
|
327
|
+
this.buildMenuGroupParent('Export', [cellsSubMenu, rowsSubMenu], {
|
|
328
|
+
label: 'Export Selected',
|
|
329
|
+
}),
|
|
330
|
+
];
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
getLayoutContextMenuStructure(menuItems) {
|
|
334
|
+
const layoutMenuItems = menuItems.filter((menuItem) => menuItem.module === 'Layout');
|
|
335
|
+
if (!layoutMenuItems.length) {
|
|
336
|
+
return [[], []];
|
|
337
|
+
}
|
|
338
|
+
const gridActionsItemNames = [
|
|
339
|
+
'layout-clear-selection',
|
|
340
|
+
'layout-select-all',
|
|
341
|
+
'layout-auto-size',
|
|
342
|
+
];
|
|
343
|
+
const gridActionsItems = layoutMenuItems.filter((item) => gridActionsItemNames.includes(item.name));
|
|
344
|
+
const otherLayoutItems = layoutMenuItems.filter((item) => !gridActionsItemNames.includes(item.name));
|
|
345
|
+
return [gridActionsItems, otherLayoutItems];
|
|
346
|
+
}
|
|
347
|
+
buildMenuGroupParent(module, menuItems, config) {
|
|
348
|
+
var _a, _b;
|
|
349
|
+
const moduleInfo = this.adaptableInstance.ModuleService.getModuleInfoByModule(module);
|
|
350
|
+
return {
|
|
351
|
+
name: 'menu-group',
|
|
352
|
+
label: (_a = config === null || config === void 0 ? void 0 : config.label) !== null && _a !== void 0 ? _a : moduleInfo.FriendlyName,
|
|
353
|
+
isVisible: true,
|
|
354
|
+
module: moduleInfo.ModuleName,
|
|
355
|
+
icon: {
|
|
356
|
+
name: (_b = config === null || config === void 0 ? void 0 : config.icon) !== null && _b !== void 0 ? _b : moduleInfo.Glyph,
|
|
357
|
+
},
|
|
358
|
+
subItems: menuItems,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
buildColumnMenuDefaultStructure(availableMenuItems, menuContext) {
|
|
362
|
+
// CalculatedColumn
|
|
363
|
+
const calculatedColumnMenuItems = this.getModuleSpecificStructure('CalculatedColumn', availableMenuItems);
|
|
364
|
+
// CellSummary
|
|
365
|
+
const cellSummaryMenuItems = this.getModuleSpecificStructure('CellSummary', availableMenuItems);
|
|
366
|
+
// ColumnFilter
|
|
367
|
+
const [columnFilterGroup, filterVisibilityItems] = this.getColumnFilterColumnMenuStructure(availableMenuItems);
|
|
368
|
+
// ColumnInfo
|
|
369
|
+
const columnInfoMenuItems = this.getModuleSpecificStructure('ColumnInfo', availableMenuItems);
|
|
370
|
+
// CustomSort
|
|
371
|
+
const customSortMenuItems = this.getModuleSpecificStructure('CustomSort', availableMenuItems);
|
|
372
|
+
// Dashboard
|
|
373
|
+
const dashboardMenuItems = this.getModuleSpecificStructure('Dashboard', availableMenuItems);
|
|
374
|
+
// DataImport
|
|
375
|
+
const dataImportMenuItems = this.getModuleSpecificStructure('DataImport', availableMenuItems);
|
|
376
|
+
// FlashingCell
|
|
377
|
+
const flashingCellMenuItems = this.getModuleSpecificStructure('FlashingCell', availableMenuItems);
|
|
378
|
+
// FormatColumn
|
|
379
|
+
const formatColumnMenuItems = this.getModuleSpecificStructure('FormatColumn', availableMenuItems);
|
|
380
|
+
// FreeTextColumn
|
|
381
|
+
const freeTextColumnMenuItems = this.getModuleSpecificStructure('FreeTextColumn', availableMenuItems);
|
|
382
|
+
// GridInfo
|
|
383
|
+
const gridInfoMenuItems = this.getModuleSpecificStructure('GridInfo', availableMenuItems);
|
|
384
|
+
// Layout
|
|
385
|
+
const [gridSelectItems, columnSelectItems, columnActionGroup, otherLayoutItems] = this.getLayoutColumnMenuStructure(availableMenuItems);
|
|
386
|
+
// PlusMinus
|
|
387
|
+
const plusMinusMenuItems = this.getModuleSpecificStructure('PlusMinus', availableMenuItems);
|
|
388
|
+
// SettingsPanel
|
|
389
|
+
const settingsPanelMenuItems = this.getModuleSpecificStructure('SettingsPanel', availableMenuItems);
|
|
390
|
+
// StyledColumn
|
|
391
|
+
const styledColumnMenuItems = this.getStyledColumnColumnMenuStructure(availableMenuItems);
|
|
392
|
+
// SystemStatus
|
|
393
|
+
const systemStatusMenuItems = this.getModuleSpecificStructure('SystemStatus', availableMenuItems);
|
|
394
|
+
/**
|
|
395
|
+
* Custom structures
|
|
396
|
+
*/
|
|
397
|
+
const gridMenuItem = {
|
|
398
|
+
name: 'grid-group',
|
|
399
|
+
label: 'Grid',
|
|
400
|
+
// TODO
|
|
401
|
+
module: 'ColumnInfo',
|
|
402
|
+
isVisible: true,
|
|
403
|
+
icon: {
|
|
404
|
+
name: 'grid',
|
|
405
|
+
},
|
|
406
|
+
subItems: [
|
|
407
|
+
...otherLayoutItems,
|
|
408
|
+
...filterVisibilityItems,
|
|
409
|
+
...gridSelectItems,
|
|
410
|
+
...cellSummaryMenuItems,
|
|
411
|
+
...dataImportMenuItems,
|
|
412
|
+
...systemStatusMenuItems,
|
|
413
|
+
...gridInfoMenuItems,
|
|
414
|
+
],
|
|
415
|
+
};
|
|
416
|
+
const columnMenuItem = {
|
|
417
|
+
name: 'column-group',
|
|
418
|
+
label: 'Column',
|
|
419
|
+
// TODO
|
|
420
|
+
module: 'ColumnInfo',
|
|
421
|
+
isVisible: true,
|
|
422
|
+
icon: {
|
|
423
|
+
name: 'columns',
|
|
424
|
+
},
|
|
425
|
+
subItems: [
|
|
426
|
+
...columnActionGroup,
|
|
427
|
+
...calculatedColumnMenuItems,
|
|
428
|
+
...freeTextColumnMenuItems,
|
|
429
|
+
...customSortMenuItems,
|
|
430
|
+
...plusMinusMenuItems,
|
|
431
|
+
...columnSelectItems,
|
|
432
|
+
...columnInfoMenuItems,
|
|
433
|
+
],
|
|
434
|
+
};
|
|
435
|
+
const createStyleMenuItem = {
|
|
436
|
+
name: 'styling-group',
|
|
437
|
+
label: 'Styling',
|
|
438
|
+
// TODO
|
|
439
|
+
module: 'ColumnInfo',
|
|
440
|
+
isVisible: true,
|
|
441
|
+
icon: {
|
|
442
|
+
name: 'brush',
|
|
443
|
+
},
|
|
444
|
+
subItems: [...flashingCellMenuItems, ...formatColumnMenuItems, ...styledColumnMenuItems],
|
|
445
|
+
};
|
|
446
|
+
return [
|
|
447
|
+
...settingsPanelMenuItems,
|
|
448
|
+
...dashboardMenuItems,
|
|
449
|
+
...columnFilterGroup,
|
|
450
|
+
createStyleMenuItem,
|
|
451
|
+
gridMenuItem,
|
|
452
|
+
columnMenuItem,
|
|
453
|
+
];
|
|
454
|
+
}
|
|
455
|
+
getColumnFilterColumnMenuStructure(menuItems) {
|
|
456
|
+
const columnFilterMenuItems = menuItems.filter((menuItem) => menuItem.module === 'ColumnFilter');
|
|
457
|
+
const filterVisibilityItems = columnFilterMenuItems.filter((item) => ['column-filter-bar-hide', 'column-filter-bar-show'].includes(item.name));
|
|
458
|
+
const filterActionItems = columnFilterMenuItems.filter((item) => ['column-filter-clear', 'column-filter-suspend', 'column-filter-unsuspend'].includes(item.name));
|
|
459
|
+
const columnFilterGroup = filterActionItems.length
|
|
460
|
+
? [
|
|
461
|
+
{
|
|
462
|
+
name: 'column-filter-group',
|
|
463
|
+
label: 'Filter',
|
|
464
|
+
module: 'ColumnFilter',
|
|
465
|
+
isVisible: true,
|
|
466
|
+
icon: {
|
|
467
|
+
name: 'filter',
|
|
214
468
|
},
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
469
|
+
subItems: filterActionItems,
|
|
470
|
+
},
|
|
471
|
+
]
|
|
472
|
+
: [];
|
|
473
|
+
return [columnFilterGroup, filterVisibilityItems];
|
|
474
|
+
}
|
|
475
|
+
getLayoutColumnMenuStructure(menuItems) {
|
|
476
|
+
const layoutMenuItems = menuItems.filter((menuItem) => menuItem.module === 'Layout');
|
|
477
|
+
if (!layoutMenuItems.length) {
|
|
478
|
+
return [[], [], [], []];
|
|
479
|
+
}
|
|
480
|
+
const columnSelectItemNames = [
|
|
481
|
+
'layout-column-select-preserve',
|
|
482
|
+
'layout-column-select-reset',
|
|
483
|
+
'layout-column-select',
|
|
484
|
+
];
|
|
485
|
+
const columnSelectItems = layoutMenuItems.filter((item) => columnSelectItemNames.includes(item.name));
|
|
486
|
+
const gridSelectItems = layoutMenuItems.filter((item) => item.name === 'layout-grid-select');
|
|
487
|
+
const columnActionGroup = layoutMenuItems.filter((item) => ['layout-column-caption-change', 'layout-column-hide'].includes(item.name));
|
|
488
|
+
const otherLayoutItems = layoutMenuItems.filter((item) => !columnSelectItemNames.includes(item.name) &&
|
|
489
|
+
!['layout-column-caption-change', 'layout-column-hide'].includes(item.name) &&
|
|
490
|
+
item.name !== 'layout-grid-select');
|
|
491
|
+
return [gridSelectItems, columnSelectItems, columnActionGroup, otherLayoutItems];
|
|
492
|
+
}
|
|
493
|
+
getStyledColumnColumnMenuStructure(menuItems) {
|
|
494
|
+
const styledColumnMenuItems = menuItems.filter((menuItem) => menuItem.module === 'StyledColumn');
|
|
495
|
+
return styledColumnMenuItems;
|
|
234
496
|
}
|
|
235
497
|
mapAdaptableMenuItemToSystemMenuItems(adaptableMenuItems) {
|
|
236
498
|
return (adaptableMenuItems !== null && adaptableMenuItems !== void 0 ? adaptableMenuItems : []).map((menuItem) => {
|
|
499
|
+
if (menuItem === '-') {
|
|
500
|
+
return menuItem;
|
|
501
|
+
}
|
|
237
502
|
let subItems = menuItem.subItems;
|
|
238
503
|
if (subItems && subItems.length > 0) {
|
|
239
504
|
subItems = subItems.map((subItem) => this.mapAdaptableMenuItemToSystemMenuItems(subItem.subItems));
|
|
@@ -244,7 +509,7 @@ export class AgGridMenuAdapter {
|
|
|
244
509
|
createAdaptableColumnMenuItems(menuContext) {
|
|
245
510
|
let contextMenuItems = [];
|
|
246
511
|
this.adaptableInstance.adaptableModules.forEach((s) => {
|
|
247
|
-
let menuItems = s.
|
|
512
|
+
let menuItems = s.createColumnMenuItems(menuContext.adaptableColumn);
|
|
248
513
|
if (menuItems) {
|
|
249
514
|
contextMenuItems.push(...menuItems.filter(Boolean).filter((item) => item.isVisible !== false));
|
|
250
515
|
}
|
|
@@ -269,9 +534,13 @@ export class AgGridMenuAdapter {
|
|
|
269
534
|
});
|
|
270
535
|
}
|
|
271
536
|
}
|
|
537
|
+
/**
|
|
538
|
+
* The output of this function is used to build the column header menu if the AG Grid Menu Module is NOT present
|
|
539
|
+
* This is controlled by the AdaptableAgGrid.embedColumnMenu property
|
|
540
|
+
*/
|
|
272
541
|
buildStandaloneColumnHeader(adaptableColumn) {
|
|
273
542
|
const agGridColumn = this.adaptableInstance.getAgGridColumnForColumnId(adaptableColumn.columnId);
|
|
274
543
|
const menuContext = this.createColumnMenuContextObject(adaptableColumn, agGridColumn);
|
|
275
|
-
return this.
|
|
544
|
+
return this.createAdaptableColumnMenuItems(menuContext);
|
|
276
545
|
}
|
|
277
546
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import DefaultIcon from './DefaultIcon';
|
|
3
|
+
export default (props) => (React.createElement(DefaultIcon, Object.assign({}, props, { viewBox: "0 -960 960 960" }),
|
|
4
|
+
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,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import DefaultIcon from './DefaultIcon';
|
|
3
|
+
export default (props) => (React.createElement(DefaultIcon, Object.assign({}, props, { viewBox: "0 -960 960 960" }),
|
|
4
|
+
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" })));
|