@adaptabletools/adaptable 18.0.0-canary.34 → 18.0.0-canary.36
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/package.json +1 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +10 -3
- package/src/AdaptableOptions/ColumnMenuOptions.d.ts +94 -0
- package/src/AdaptableOptions/ColumnMenuOptions.js +1 -0
- package/src/AdaptableOptions/ContextMenuOptions.d.ts +94 -0
- package/src/AdaptableOptions/ContextMenuOptions.js +1 -0
- package/src/Api/AdaptableApi.d.ts +10 -0
- package/src/Api/ColumnMenuApi.d.ts +5 -0
- package/src/Api/ColumnMenuApi.js +1 -0
- package/src/Api/ContextMenuApi.d.ts +5 -0
- package/src/Api/ContextMenuApi.js +1 -0
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +3 -1
- package/src/Api/Implementation/ApiBase.d.ts +3 -2
- package/src/Api/Implementation/ApiBase.js +5 -2
- package/src/Api/Implementation/OptionsApiImpl.d.ts +3 -2
- package/src/Api/Implementation/OptionsApiImpl.js +5 -2
- package/src/Api/OptionsApi.d.ts +7 -3
- package/src/PredefinedConfig/Common/Menu.d.ts +14 -1
- package/src/Strategy/AdaptableModuleBase.d.ts +4 -4
- package/src/Utilities/MenuItem.d.ts +3 -3
- package/src/agGrid/AgGridMenuAdapter.js +6 -6
- package/src/agGrid/defaultAdaptableOptions.js +5 -2
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +46 -36
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +5 -2
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/AdaptableOptions/MenuOptions.d.ts +0 -194
- package/src/AdaptableOptions/MenuOptions.js +0 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "18.0.0-canary.
|
|
3
|
+
"version": "18.0.0-canary.36",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -7,7 +7,6 @@ import { UserInterfaceOptions } from './UserInterfaceOptions';
|
|
|
7
7
|
import { AdaptablePlugin } from './AdaptablePlugin';
|
|
8
8
|
import { ExportOptions } from './ExportOptions';
|
|
9
9
|
import { TeamSharingOptions } from './TeamSharingOptions';
|
|
10
|
-
import { MenuOptions } from './MenuOptions';
|
|
11
10
|
import { EntitlementOptions } from './EntitlementOptions';
|
|
12
11
|
import { NotificationsOptions } from './NotificationsOptions';
|
|
13
12
|
import { DashboardOptions } from './DashboardOptions';
|
|
@@ -35,6 +34,8 @@ import { DataImportOptions } from './DataImportOptions';
|
|
|
35
34
|
import { ColumnFilterOptions } from './ColumnFilterOptions';
|
|
36
35
|
import { GridFilterOptions } from './GridFilterOptions';
|
|
37
36
|
import { CommentOptions } from './CommentOptions';
|
|
37
|
+
import { ColumnMenuOptions } from './ColumnMenuOptions';
|
|
38
|
+
import { ContextMenuOptions } from './ContextMenuOptions';
|
|
38
39
|
/**
|
|
39
40
|
* Large group of options enabling developers to set up AdapTable at design time to fit precise requirements
|
|
40
41
|
*/
|
|
@@ -220,11 +221,17 @@ export interface AdaptableOptions<TData = any> {
|
|
|
220
221
|
*/
|
|
221
222
|
layoutOptions?: LayoutOptions;
|
|
222
223
|
/**
|
|
223
|
-
* Options for managing AdapTable
|
|
224
|
+
* Options for managing AdapTable Column Menu
|
|
224
225
|
*
|
|
225
226
|
* @gridInfoContainer
|
|
226
227
|
*/
|
|
227
|
-
|
|
228
|
+
columnMenuOptions?: ColumnMenuOptions<TData>;
|
|
229
|
+
/**
|
|
230
|
+
* Options for managing AdapTable Context Menu
|
|
231
|
+
*
|
|
232
|
+
* @gridInfoContainer
|
|
233
|
+
*/
|
|
234
|
+
contextMenuOptions?: ContextMenuOptions<TData>;
|
|
228
235
|
/**
|
|
229
236
|
* Options for managing Notifications in AdapTable
|
|
230
237
|
*
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { AdaptableColumnMenuItemName, AdaptableMenuItem, AgGridMenuItem, ColumnMenuContext } from '../PredefinedConfig/Common/Menu';
|
|
2
|
+
import { AdaptableIcon } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Options for managing menus in AdapTable – provided using 2 collections
|
|
5
|
+
*/
|
|
6
|
+
export interface ColumnMenuOptions<TData = any> {
|
|
7
|
+
/**
|
|
8
|
+
* Customises Column Menu (default column menu items are available in the provided context)
|
|
9
|
+
*/
|
|
10
|
+
customColumnMenu?: (menuContext: CustomColumnMenuContext<TData>) => CustomColumnMenuItem[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Context info provided when building Custom Column Menus
|
|
14
|
+
*/
|
|
15
|
+
export interface CustomColumnMenuContext<TData = any> extends ColumnMenuContext<TData> {
|
|
16
|
+
/**
|
|
17
|
+
* Flat list of all available AdapTable Menu Items
|
|
18
|
+
*/
|
|
19
|
+
defaultAdaptableMenuItems: AdaptableSystemColumnMenuItem<AdaptableColumnMenuItemName>[];
|
|
20
|
+
/**
|
|
21
|
+
* Flat list of all available AG Grid Menu Items
|
|
22
|
+
*/
|
|
23
|
+
defaultAgGridMenuItems: AgGridMenuItem<AgGridColumnMenuItemType>[];
|
|
24
|
+
/**
|
|
25
|
+
* Default structure of Adaptable Menu Items
|
|
26
|
+
*/
|
|
27
|
+
defaultAdaptableMenuStructure: (AdaptableSystemColumnMenuItem<AdaptableColumnMenuItemName> | '-')[];
|
|
28
|
+
/**
|
|
29
|
+
* Default structure of AG Grid Menu Items
|
|
30
|
+
*/
|
|
31
|
+
defaultAgGridMenuStructure: (AgGridMenuItem<AgGridColumnMenuItemType> | {
|
|
32
|
+
menuType: 'Group';
|
|
33
|
+
label: string;
|
|
34
|
+
subMenuItems: AgGridMenuItem<AgGridColumnMenuItemType>[];
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
icon?: AdaptableIcon;
|
|
37
|
+
})[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Custom Column Menu Item
|
|
41
|
+
*/
|
|
42
|
+
export type CustomColumnMenuItem = AgGridMenuItem<AgGridColumnMenuItemType> | AdaptableSystemColumnMenuItem<AdaptableColumnMenuItemName> | UserColumnMenuItem | '-' | {
|
|
43
|
+
menuType: 'Group';
|
|
44
|
+
label: string;
|
|
45
|
+
subMenuItems: CustomColumnMenuItem[];
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
icon?: AdaptableIcon;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* System Menu Item that is provided by AdapTable
|
|
51
|
+
*/
|
|
52
|
+
export interface AdaptableSystemColumnMenuItem<MENU_TYPE_NAME extends AdaptableColumnMenuItemName> extends AdaptableMenuItem<MENU_TYPE_NAME> {
|
|
53
|
+
/**
|
|
54
|
+
* Type of Menu - always 'Adaptable'
|
|
55
|
+
*/
|
|
56
|
+
menuType: 'Adaptable';
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Column Menu Item that is provided by User
|
|
60
|
+
*/
|
|
61
|
+
export interface UserColumnMenuItem {
|
|
62
|
+
/**
|
|
63
|
+
* Type of Menu - always 'User'
|
|
64
|
+
*/
|
|
65
|
+
menuType: 'User';
|
|
66
|
+
/**
|
|
67
|
+
* Text to appear in the Menu Item
|
|
68
|
+
*/
|
|
69
|
+
label: string;
|
|
70
|
+
/**
|
|
71
|
+
* Function invoked when the Menu Item is clicked
|
|
72
|
+
*/
|
|
73
|
+
onClick?: (menuContext: ColumnMenuContext) => void;
|
|
74
|
+
/**
|
|
75
|
+
* Whether menu item is disabled
|
|
76
|
+
*/
|
|
77
|
+
disabled?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Whether menu item is hidden
|
|
80
|
+
*/
|
|
81
|
+
hidden?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Optional icon to display
|
|
84
|
+
*/
|
|
85
|
+
icon?: AdaptableIcon;
|
|
86
|
+
/**
|
|
87
|
+
* Array of Menu Items, enabling limitless levels of menus
|
|
88
|
+
*/
|
|
89
|
+
subMenuItems?: CustomColumnMenuItem[];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Defines AG Grid Column Menu Items
|
|
93
|
+
*/
|
|
94
|
+
export type AgGridColumnMenuItemType = 'pinSubMenu' | 'valueAggSubMenu' | 'autoSizeThis' | 'autoSizeAll' | 'rowGroup' | 'rowUnGroup' | 'resetColumns' | 'expandAll' | 'contractAll' | 'separator';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { AdaptableContextMenuItemName, AdaptableMenuItem, AgGridMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
|
|
2
|
+
import { AdaptableIcon } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Options for managing menus in AdapTable – provided using 2 collections
|
|
5
|
+
*/
|
|
6
|
+
export interface ContextMenuOptions<TData = any> {
|
|
7
|
+
/**
|
|
8
|
+
* Customises Context Menu (default context menu items are available in provided context)
|
|
9
|
+
*/
|
|
10
|
+
customContextMenu?: (menuContext: CustomContextMenuContext<TData>) => CustomContextMenuItem[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Context info provided when building Custom Context Menus
|
|
14
|
+
*/
|
|
15
|
+
export interface CustomContextMenuContext<TData = any> extends ContextMenuContext<TData> {
|
|
16
|
+
/**
|
|
17
|
+
* Flat list of all available AdapTable Menu Items
|
|
18
|
+
*/
|
|
19
|
+
defaultAdaptableMenuItems: AdaptableSystemContextMenuItem<AdaptableContextMenuItemName>[];
|
|
20
|
+
/**
|
|
21
|
+
* Flat list of all available AG Grid Menu Items
|
|
22
|
+
*/
|
|
23
|
+
defaultAgGridMenuItems: AgGridMenuItem<AgGridContextMenuItemType>[];
|
|
24
|
+
/**
|
|
25
|
+
* Default structure of Adaptable Menu Items
|
|
26
|
+
*/
|
|
27
|
+
defaultAdaptableMenuStructure: (AdaptableSystemContextMenuItem<AdaptableContextMenuItemName> | '-')[];
|
|
28
|
+
/**
|
|
29
|
+
* Default structure of AG Grid Menu Items
|
|
30
|
+
*/
|
|
31
|
+
defaultAgGridMenuStructure: (AgGridMenuItem<AgGridContextMenuItemType> | {
|
|
32
|
+
menuType: 'Group';
|
|
33
|
+
label: string;
|
|
34
|
+
subMenuItems: AgGridMenuItem<AgGridContextMenuItemType>[];
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
icon?: AdaptableIcon;
|
|
37
|
+
})[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Custom Context Menu Item
|
|
41
|
+
*/
|
|
42
|
+
export type CustomContextMenuItem = AgGridMenuItem<AgGridContextMenuItemType> | AdaptableSystemContextMenuItem<AdaptableContextMenuItemName> | UserContextMenuItem | '-' | {
|
|
43
|
+
menuType: 'Group';
|
|
44
|
+
label: string;
|
|
45
|
+
subMenuItems: CustomContextMenuItem[];
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
icon?: AdaptableIcon;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* System Menu Item that is provided by AdapTable
|
|
51
|
+
*/
|
|
52
|
+
export interface AdaptableSystemContextMenuItem<MENU_TYPE_NAME extends AdaptableContextMenuItemName> extends AdaptableMenuItem<MENU_TYPE_NAME> {
|
|
53
|
+
/**
|
|
54
|
+
* Type of Menu - always 'Adaptable'
|
|
55
|
+
*/
|
|
56
|
+
menuType: 'Adaptable';
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Context Menu Item that is provided by User
|
|
60
|
+
*/
|
|
61
|
+
export interface UserContextMenuItem {
|
|
62
|
+
/**
|
|
63
|
+
* Type of Menu - always 'User'
|
|
64
|
+
*/
|
|
65
|
+
menuType: 'User';
|
|
66
|
+
/**
|
|
67
|
+
* Text to appear in the Menu Item
|
|
68
|
+
*/
|
|
69
|
+
label: string;
|
|
70
|
+
/**
|
|
71
|
+
* Function invoked when the Menu Item is clicked
|
|
72
|
+
*/
|
|
73
|
+
onClick?: (menuContext: ContextMenuContext) => void;
|
|
74
|
+
/**
|
|
75
|
+
* Whether menu item is disabled
|
|
76
|
+
*/
|
|
77
|
+
disabled?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Whether menu item is hidden
|
|
80
|
+
*/
|
|
81
|
+
hidden?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Optional icon to display
|
|
84
|
+
*/
|
|
85
|
+
icon?: AdaptableIcon;
|
|
86
|
+
/**
|
|
87
|
+
* Array of Menu Items, enabling limitless levels of menus
|
|
88
|
+
*/
|
|
89
|
+
subMenuItems?: CustomContextMenuItem[];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Defines AG Grid Context Menu Items
|
|
93
|
+
*/
|
|
94
|
+
export type AgGridContextMenuItemType = 'autoSizeAll' | 'expandAll' | 'contractAll' | 'copy' | 'copyWithHeaders' | 'copyWithGroupHeaders' | 'cut' | 'paste' | 'resetColumns' | 'export' | 'csvExport' | 'excelExport' | 'chartRange' | 'pivotChart' | 'separator';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -47,6 +47,8 @@ import { GridFilterApi } from './GridFilterApi';
|
|
|
47
47
|
import { NamedQueryApi } from './NamedQueryApi';
|
|
48
48
|
import { ColumnFilterApi } from './ColumnFilterApi';
|
|
49
49
|
import { CommentApi } from './CommentApi';
|
|
50
|
+
import { ColumnMenuApi } from './ColumnMenuApi';
|
|
51
|
+
import { ContextMenuApi } from './ContextMenuApi';
|
|
50
52
|
/**
|
|
51
53
|
*
|
|
52
54
|
* The `AdaptableApi` provides developers with run-time access to AdapTable.
|
|
@@ -234,6 +236,14 @@ export interface AdaptableApi {
|
|
|
234
236
|
* Provides access to the Note Module
|
|
235
237
|
*/
|
|
236
238
|
noteApi: NoteApi;
|
|
239
|
+
/**
|
|
240
|
+
* Provides access to Column Menu
|
|
241
|
+
*/
|
|
242
|
+
columnMenuApi: ColumnMenuApi;
|
|
243
|
+
/**
|
|
244
|
+
* Provides access to Context Menu
|
|
245
|
+
*/
|
|
246
|
+
contextMenuApi: ContextMenuApi;
|
|
237
247
|
/**
|
|
238
248
|
* Provides access to the Comment Module
|
|
239
249
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
2
2
|
import { AdaptableInternalApi } from '../Internal/AdaptableInternalApi';
|
|
3
|
-
import { AdaptableApi, DataImportApi, NamedQueryApi, OptionsApi, SettingsPanelApi } from '../../types';
|
|
3
|
+
import { AdaptableApi, ColumnMenuApi, ContextMenuApi, DataImportApi, NamedQueryApi, OptionsApi, SettingsPanelApi } from '../../types';
|
|
4
4
|
import { AlertApi } from '../AlertApi';
|
|
5
5
|
import { BulkUpdateApi } from '../BulkUpdateApi';
|
|
6
6
|
import { CalendarApi } from '../CalendarApi';
|
|
@@ -91,6 +91,8 @@ export declare class AdaptableApiImpl implements AdaptableApi {
|
|
|
91
91
|
chartingApi: ChartingApi;
|
|
92
92
|
statusBarApi: StatusBarApi;
|
|
93
93
|
noteApi: NoteApi;
|
|
94
|
+
columnMenuApi: ColumnMenuApi;
|
|
95
|
+
contextMenuApi: ContextMenuApi;
|
|
94
96
|
fdc3Api: Fdc3Api;
|
|
95
97
|
dataImportApi: DataImportApi;
|
|
96
98
|
gridFilterApi: GridFilterApi;
|
|
@@ -7,7 +7,7 @@ import { ModuleInfo } from '../../Strategy/Interface/IModule';
|
|
|
7
7
|
import { AdaptableOptions } from '../../AdaptableOptions/AdaptableOptions';
|
|
8
8
|
import { AdaptableApi } from '../AdaptableApi';
|
|
9
9
|
import { ExportOptions } from '../../AdaptableOptions/ExportOptions';
|
|
10
|
-
import { ActionColumnApi, ActionColumnOptions, ActionRowApi, ActionRowOptions, AlertApi, AlertOptions, ApplicationApi, BulkUpdateApi, CalculatedColumnApi, CalendarApi, CalendarOptions, CellSummaryApi, CellSummaryOptions, ChartingApi, ChartingOptions, ColumnApi, ColumnFilterApi, ColumnFilterOptions, ColumnOptions, CommentOptions, ConfigApi, ContainerOptions, CustomSortApi, CustomSortOptions, DashboardApi, DashboardOptions, DataChangeHistoryApi, DataChangeHistoryOptions, DataSetApi, DataSetOptions, EditOptions, EntitlementApi, EntitlementOptions, EventApi, ExportApi, ExpressionApi, ExpressionOptions, Fdc3Api, Fdc3Options, FlashingCellApi, FlashingCellOptions, FormatColumnApi, FormatColumnOptions, FreeTextColumnApi, GridApi, GridFilterApi, GroupingOptions, LayoutApi, LayoutAssociatedObject, LayoutOptions,
|
|
10
|
+
import { ActionColumnApi, ActionColumnOptions, ActionRowApi, ActionRowOptions, AlertApi, AlertOptions, ApplicationApi, BulkUpdateApi, CalculatedColumnApi, CalendarApi, CalendarOptions, CellSummaryApi, CellSummaryOptions, ChartingApi, ChartingOptions, ColumnApi, ColumnFilterApi, ColumnFilterOptions, ColumnOptions, CommentOptions, ConfigApi, ContainerOptions, CustomSortApi, CustomSortOptions, DashboardApi, DashboardOptions, DataChangeHistoryApi, DataChangeHistoryOptions, DataSetApi, DataSetOptions, EditOptions, EntitlementApi, EntitlementOptions, EventApi, ExportApi, ExpressionApi, ExpressionOptions, Fdc3Api, Fdc3Options, FlashingCellApi, FlashingCellOptions, FormatColumnApi, FormatColumnOptions, FreeTextColumnApi, GridApi, GridFilterApi, GroupingOptions, LayoutApi, LayoutAssociatedObject, LayoutOptions, NamedQueryApi, NoteOptions, NotificationsOptions, PluginsApi, PlusMinusApi, PredicateApi, PredicateOptions, QuickSearchApi, QuickSearchOptions, ScheduleApi, ColumnScopeApi, SettingsPanelApi, SettingsPanelOptions, ShortcutApi, SmartEditApi, StateOptions, StatusBarApi, StyledColumnApi, SystemStatusApi, TeamSharingApi, TeamSharingOptions, ThemeApi, ToolPanelApi, ToolPanelOptions, UserInterfaceApi, UserInterfaceOptions, ColumnMenuOptions, ContextMenuOptions } from '../../types';
|
|
11
11
|
import { ModuleParams } from '../../View/Components/SharedProps/ModuleViewPopupProps';
|
|
12
12
|
export declare abstract class ApiBase {
|
|
13
13
|
protected adaptable: IAdaptable;
|
|
@@ -67,7 +67,8 @@ export declare abstract class ApiBase {
|
|
|
67
67
|
protected getExportOptions(): ExportOptions;
|
|
68
68
|
protected getGroupingOptions(): GroupingOptions;
|
|
69
69
|
protected getLayoutOptions(): LayoutOptions;
|
|
70
|
-
protected
|
|
70
|
+
protected getColumnMenuOptions(): ColumnMenuOptions;
|
|
71
|
+
protected getContextMenuOptions(): ContextMenuOptions;
|
|
71
72
|
protected getColumnFilterOptions(): ColumnFilterOptions;
|
|
72
73
|
protected getExpressionOptions(): ExpressionOptions;
|
|
73
74
|
protected getPredicateOptions(): PredicateOptions;
|
|
@@ -143,8 +143,11 @@ export class ApiBase {
|
|
|
143
143
|
getLayoutOptions() {
|
|
144
144
|
return this.getOptions().layoutOptions;
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
return this.getOptions().
|
|
146
|
+
getColumnMenuOptions() {
|
|
147
|
+
return this.getOptions().columnMenuOptions;
|
|
148
|
+
}
|
|
149
|
+
getContextMenuOptions() {
|
|
150
|
+
return this.getOptions().contextMenuOptions;
|
|
148
151
|
}
|
|
149
152
|
getColumnFilterOptions() {
|
|
150
153
|
return this.getOptions().columnFilterOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiBase } from './ApiBase';
|
|
2
|
-
import { ActionColumnOptions, ActionRowOptions, AdaptableOptions, AlertOptions, CalendarOptions, CellSummaryOptions, ChartingOptions, ColumnOptions, NoteOptions, ContainerOptions, DashboardOptions, DataChangeHistoryOptions, DataSetOptions, EditOptions, EntitlementOptions, ExportOptions, FlashingCellOptions, FormatColumnOptions, LayoutOptions,
|
|
2
|
+
import { ActionColumnOptions, ActionRowOptions, AdaptableOptions, AlertOptions, CalendarOptions, CellSummaryOptions, ChartingOptions, ColumnOptions, NoteOptions, ContainerOptions, DashboardOptions, DataChangeHistoryOptions, DataSetOptions, EditOptions, EntitlementOptions, ExportOptions, FlashingCellOptions, FormatColumnOptions, LayoutOptions, NotificationsOptions, OptionsApi, QuickSearchOptions, SettingsPanelOptions, StateOptions, TeamSharingOptions, ToolPanelOptions, UserInterfaceOptions, GridFilterOptions, ColumnMenuOptions, ContextMenuOptions } from '../../types';
|
|
3
3
|
import { GroupingOptions } from '../../AdaptableOptions/GroupingOptions';
|
|
4
4
|
import { CustomSortOptions } from '../../AdaptableOptions/CustomSortOptions';
|
|
5
5
|
import { Fdc3Options } from '../../AdaptableOptions/Fdc3Options';
|
|
@@ -31,7 +31,8 @@ export declare class OptionsApiImpl extends ApiBase implements OptionsApi {
|
|
|
31
31
|
getExportOptions(): ExportOptions;
|
|
32
32
|
getGroupingOptions(): GroupingOptions;
|
|
33
33
|
getLayoutOptions(): LayoutOptions;
|
|
34
|
-
|
|
34
|
+
getColumnMenuOptions(): ColumnMenuOptions;
|
|
35
|
+
getContextMenuOptions(): ContextMenuOptions;
|
|
35
36
|
getColumnFilterOptions(): ColumnFilterOptions;
|
|
36
37
|
getGridFilterOptions(): Readonly<GridFilterOptions<any>>;
|
|
37
38
|
getExpressionOptions(): ExpressionOptions;
|
|
@@ -72,8 +72,11 @@ export class OptionsApiImpl extends ApiBase {
|
|
|
72
72
|
getLayoutOptions() {
|
|
73
73
|
return this.getOptions().layoutOptions;
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
return this.getOptions().
|
|
75
|
+
getColumnMenuOptions() {
|
|
76
|
+
return this.getOptions().columnMenuOptions;
|
|
77
|
+
}
|
|
78
|
+
getContextMenuOptions() {
|
|
79
|
+
return this.getOptions().contextMenuOptions;
|
|
77
80
|
}
|
|
78
81
|
getColumnFilterOptions() {
|
|
79
82
|
return this.getOptions().columnFilterOptions;
|
package/src/Api/OptionsApi.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CustomSortOptions } from '../AdaptableOptions/CustomSortOptions';
|
|
2
2
|
import { DataSetOptions } from '../AdaptableOptions/DataSetOptions';
|
|
3
3
|
import { GroupingOptions } from '../AdaptableOptions/GroupingOptions';
|
|
4
|
-
import { ActionColumnOptions, ActionRowOptions, AdaptableOptions, AlertOptions, CalendarOptions, CellSummaryOptions, ChartingOptions, ColumnFilterOptions, ColumnOptions, ContainerOptions, DashboardOptions, DataChangeHistoryOptions, EditOptions, EntitlementOptions, ExportOptions, FlashingCellOptions, FormatColumnOptions, GridFilterOptions, LayoutOptions,
|
|
4
|
+
import { ActionColumnOptions, ActionRowOptions, AdaptableOptions, AlertOptions, CalendarOptions, CellSummaryOptions, ChartingOptions, ColumnFilterOptions, ColumnMenuOptions, ColumnOptions, ContainerOptions, ContextMenuOptions, DashboardOptions, DataChangeHistoryOptions, EditOptions, EntitlementOptions, ExportOptions, FlashingCellOptions, FormatColumnOptions, GridFilterOptions, LayoutOptions, NoteOptions, NotificationsOptions, QuickSearchOptions, SettingsPanelOptions, StateOptions, TeamSharingOptions, ToolPanelOptions, UserInterfaceOptions } from '../types';
|
|
5
5
|
import { Fdc3Options } from '../AdaptableOptions/Fdc3Options';
|
|
6
6
|
import { ExpressionOptions } from '../AdaptableOptions/ExpressionOptions';
|
|
7
7
|
import { DataImportOptions } from '../AdaptableOptions/DataImportOptions';
|
|
@@ -127,9 +127,13 @@ export interface OptionsApi {
|
|
|
127
127
|
*/
|
|
128
128
|
getLayoutOptions(): Readonly<LayoutOptions>;
|
|
129
129
|
/**
|
|
130
|
-
* Returns `AdaptableOptions.
|
|
130
|
+
* Returns `AdaptableOptions.columnMenuOptions`
|
|
131
131
|
*/
|
|
132
|
-
|
|
132
|
+
getColumnMenuOptions(): Readonly<ColumnMenuOptions>;
|
|
133
|
+
/**
|
|
134
|
+
* Returns `AdaptableOptions.contextMenuOptions`
|
|
135
|
+
*/
|
|
136
|
+
getContextMenuOptions(): Readonly<ContextMenuOptions>;
|
|
133
137
|
/**
|
|
134
138
|
* Returns `AdaptableOptions.notificationsOptions`
|
|
135
139
|
*/
|
|
@@ -26,7 +26,7 @@ export type AdaptableColumnMenuItem = AdaptableMenuItem<AdaptableContextMenuItem
|
|
|
26
26
|
/**
|
|
27
27
|
* Generic Menu item used by Adaptable in Column or Context Menus
|
|
28
28
|
*/
|
|
29
|
-
export interface AdaptableMenuItem<MENU_TYPE_NAME = AdaptableColumnMenuItemName | AdaptableContextMenuItemName> {
|
|
29
|
+
export interface AdaptableMenuItem<MENU_TYPE_NAME extends AdaptableColumnMenuItemName | AdaptableContextMenuItemName = AdaptableColumnMenuItemName | AdaptableContextMenuItemName> {
|
|
30
30
|
/**
|
|
31
31
|
* Unique name for the Menu Item
|
|
32
32
|
*/
|
|
@@ -159,3 +159,16 @@ export interface ContextMenuContext<TData = any> extends BaseContext {
|
|
|
159
159
|
*/
|
|
160
160
|
selectedRowInfo: SelectedRowInfo<TData>;
|
|
161
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Menu Item that is provided by AG Grid
|
|
164
|
+
*/
|
|
165
|
+
export interface AgGridMenuItem<MENU_TYPE> {
|
|
166
|
+
/**
|
|
167
|
+
* Type of Menu - always 'AgGrid'
|
|
168
|
+
*/
|
|
169
|
+
menuType: 'AgGrid';
|
|
170
|
+
/**
|
|
171
|
+
* Name of the Menu Type
|
|
172
|
+
*/
|
|
173
|
+
name: MENU_TYPE;
|
|
174
|
+
}
|
|
@@ -39,16 +39,16 @@ export declare abstract class AdaptableModuleBase implements IModule {
|
|
|
39
39
|
createModuleMenuItem(source: 'ModuleMenu' | 'ModuleButton'): AdaptableMenuItem | undefined;
|
|
40
40
|
createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem<AdaptableColumnMenuItemName>[] | undefined;
|
|
41
41
|
createContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem<AdaptableContextMenuItemName>[] | undefined;
|
|
42
|
-
createMainMenuItemShowPopup<MENU_TYPE_NAME = AdaptableColumnMenuItemName | AdaptableContextMenuItemName>({ Name, Label, ComponentName, Icon, PopupParams, }: {
|
|
42
|
+
createMainMenuItemShowPopup<MENU_TYPE_NAME extends AdaptableColumnMenuItemName | AdaptableContextMenuItemName = AdaptableColumnMenuItemName | AdaptableContextMenuItemName>({ Name, Label, ComponentName, Icon, PopupParams, }: {
|
|
43
43
|
Name: MENU_TYPE_NAME;
|
|
44
44
|
Label: string;
|
|
45
45
|
ComponentName: string;
|
|
46
46
|
Icon: AdaptableSystemIconName;
|
|
47
47
|
PopupParams?: ModuleParams;
|
|
48
48
|
}): MenuItemShowPopup<MENU_TYPE_NAME>;
|
|
49
|
-
createMenuItemClickFunction<MENU_TYPE_NAME = AdaptableColumnMenuItemName | AdaptableContextMenuItemName>(Name: MENU_TYPE_NAME, Label: string, Icon: AdaptableSystemIconName, ClickFunction: () => void): MenuItemDoClickFunction<MENU_TYPE_NAME>;
|
|
50
|
-
createMenuItemReduxAction<MENU_TYPE_NAME = AdaptableColumnMenuItemName | AdaptableContextMenuItemName>(Name: MENU_TYPE_NAME, Label: string, Icon: AdaptableSystemIconName, Action: Action): MenuItemDoReduxAction<MENU_TYPE_NAME>;
|
|
51
|
-
createMenuItemShowPopup<MENU_TYPE_NAME = AdaptableColumnMenuItemName | AdaptableContextMenuItemName>(Name: MENU_TYPE_NAME, Label: string, ComponentName: string, Icon: AdaptableSystemIconName, PopupParams?: ModuleParams): MenuItemShowPopup<MENU_TYPE_NAME>;
|
|
49
|
+
createMenuItemClickFunction<MENU_TYPE_NAME extends AdaptableColumnMenuItemName | AdaptableContextMenuItemName = AdaptableColumnMenuItemName | AdaptableContextMenuItemName>(Name: MENU_TYPE_NAME, Label: string, Icon: AdaptableSystemIconName, ClickFunction: () => void): MenuItemDoClickFunction<MENU_TYPE_NAME>;
|
|
50
|
+
createMenuItemReduxAction<MENU_TYPE_NAME extends AdaptableColumnMenuItemName | AdaptableContextMenuItemName = AdaptableColumnMenuItemName | AdaptableContextMenuItemName>(Name: MENU_TYPE_NAME, Label: string, Icon: AdaptableSystemIconName, Action: Action): MenuItemDoReduxAction<MENU_TYPE_NAME>;
|
|
51
|
+
createMenuItemShowPopup<MENU_TYPE_NAME extends AdaptableColumnMenuItemName | AdaptableContextMenuItemName = AdaptableColumnMenuItemName | AdaptableContextMenuItemName>(Name: MENU_TYPE_NAME, Label: string, ComponentName: string, Icon: AdaptableSystemIconName, PopupParams?: ModuleParams): MenuItemShowPopup<MENU_TYPE_NAME>;
|
|
52
52
|
getTeamSharingAction(): TeamSharingImportInfo<AdaptableObject> | undefined;
|
|
53
53
|
getModuleNamedQueryReferences(): string[];
|
|
54
54
|
getModuleCalculatedColumnReferences(): CalculatedColumn[];
|
|
@@ -3,7 +3,7 @@ import { ModuleParams } from '../View/Components/SharedProps/ModuleViewPopupProp
|
|
|
3
3
|
import { AdaptableMenuItem, AdaptableContextMenuItemName, AdaptableColumnMenuItemName } from '../PredefinedConfig/Common/Menu';
|
|
4
4
|
import { AdaptableModule } from '../PredefinedConfig/Common/Types';
|
|
5
5
|
import { AdaptableIcon, AdaptableSystemIconName } from '../PredefinedConfig/Common/AdaptableIcon';
|
|
6
|
-
export declare class MenuItemDoReduxAction<MENU_TYPE_NAME = AdaptableColumnMenuItemName | AdaptableContextMenuItemName> implements AdaptableMenuItem<MENU_TYPE_NAME> {
|
|
6
|
+
export declare class MenuItemDoReduxAction<MENU_TYPE_NAME extends AdaptableColumnMenuItemName | AdaptableContextMenuItemName = AdaptableColumnMenuItemName | AdaptableContextMenuItemName> implements AdaptableMenuItem<MENU_TYPE_NAME> {
|
|
7
7
|
constructor(name: MENU_TYPE_NAME, label: string, module: AdaptableModule, reduxAction: Redux.Action, icon: AdaptableSystemIconName, isVisible: boolean);
|
|
8
8
|
name: MENU_TYPE_NAME;
|
|
9
9
|
reduxAction: Redux.Action;
|
|
@@ -12,7 +12,7 @@ export declare class MenuItemDoReduxAction<MENU_TYPE_NAME = AdaptableColumnMenuI
|
|
|
12
12
|
isVisible: boolean;
|
|
13
13
|
icon: AdaptableIcon;
|
|
14
14
|
}
|
|
15
|
-
export declare class MenuItemDoClickFunction<MENU_TYPE_NAME = AdaptableColumnMenuItemName | AdaptableContextMenuItemName> implements AdaptableMenuItem<MENU_TYPE_NAME> {
|
|
15
|
+
export declare class MenuItemDoClickFunction<MENU_TYPE_NAME extends AdaptableColumnMenuItemName | AdaptableContextMenuItemName = AdaptableColumnMenuItemName | AdaptableContextMenuItemName> implements AdaptableMenuItem<MENU_TYPE_NAME> {
|
|
16
16
|
constructor(name: MENU_TYPE_NAME, label: string, module: AdaptableModule, clickFunction: () => void, icon: AdaptableSystemIconName, isVisible: boolean);
|
|
17
17
|
name: MENU_TYPE_NAME;
|
|
18
18
|
onClick: () => void;
|
|
@@ -21,7 +21,7 @@ export declare class MenuItemDoClickFunction<MENU_TYPE_NAME = AdaptableColumnMen
|
|
|
21
21
|
isVisible: boolean;
|
|
22
22
|
icon: AdaptableIcon;
|
|
23
23
|
}
|
|
24
|
-
export declare class MenuItemShowPopup<MENU_TYPE_NAME = AdaptableColumnMenuItemName | AdaptableContextMenuItemName> implements AdaptableMenuItem<MENU_TYPE_NAME> {
|
|
24
|
+
export declare class MenuItemShowPopup<MENU_TYPE_NAME extends AdaptableColumnMenuItemName | AdaptableContextMenuItemName = AdaptableColumnMenuItemName | AdaptableContextMenuItemName> implements AdaptableMenuItem<MENU_TYPE_NAME> {
|
|
25
25
|
constructor(name: MENU_TYPE_NAME, label: string, module: AdaptableModule, componentName: string, icon: AdaptableSystemIconName, isVisible: boolean, popupParams?: ModuleParams);
|
|
26
26
|
name: MENU_TYPE_NAME;
|
|
27
27
|
reduxAction: Redux.Action;
|
|
@@ -16,7 +16,7 @@ export class AgGridMenuAdapter {
|
|
|
16
16
|
}
|
|
17
17
|
buildColumnMenu(params, originalGetMainMenuItems) {
|
|
18
18
|
var _a;
|
|
19
|
-
const
|
|
19
|
+
const columnMenuOptions = this.adaptableOptions.columnMenuOptions;
|
|
20
20
|
const agGridMenuItems = (params.defaultItems ? [...params.defaultItems] : []);
|
|
21
21
|
if (!params.column) {
|
|
22
22
|
// return only AG Grid context if the Adaptable column is not found (should not happen)
|
|
@@ -31,10 +31,10 @@ export class AgGridMenuAdapter {
|
|
|
31
31
|
const adaptableMenuItems = this.createAdaptableColumnMenuItems(menuContext);
|
|
32
32
|
const defaultColumnMenuStructure = this.buildColumnMenuDefaultStructure(adaptableMenuItems, menuContext);
|
|
33
33
|
// 1. first check if there is a custom column menu defined
|
|
34
|
-
if (typeof
|
|
34
|
+
if (typeof columnMenuOptions.customColumnMenu === 'function') {
|
|
35
35
|
const defaultAgGridMenuItems = agGridMenuItems.map((itemName) => this.mapAgGridItemTypeToAgGridMenuItem(itemName));
|
|
36
36
|
const defaultAdaptableMenuItems = adaptableMenuItems.map((adaptableItem) => (Object.assign({ menuType: 'Adaptable' }, adaptableItem)));
|
|
37
|
-
const customMenuItems =
|
|
37
|
+
const customMenuItems = columnMenuOptions
|
|
38
38
|
.customColumnMenu(Object.assign(Object.assign({}, menuContext), { defaultAgGridMenuItems,
|
|
39
39
|
defaultAdaptableMenuItems, defaultAdaptableMenuStructure: this.mapAdaptableMenuItemToSystemMenuItems(defaultColumnMenuStructure), defaultAgGridMenuStructure: agGridDefaultStructure }))
|
|
40
40
|
.filter(Boolean);
|
|
@@ -58,7 +58,7 @@ export class AgGridMenuAdapter {
|
|
|
58
58
|
// we do this in order to refresh the internal state of selected cells (technically query the AG Grid cellRanges)
|
|
59
59
|
// (right-click selected the current cell, but this was not reflected in the internal state of the selected cells)
|
|
60
60
|
this.adaptableInstance.refreshSelectedCellsState();
|
|
61
|
-
const
|
|
61
|
+
const contextMenuOptions = this.adaptableOptions.contextMenuOptions;
|
|
62
62
|
const adaptableColumn = this.adaptableApi.columnApi.getColumnWithColumnId((_a = params.column) === null || _a === void 0 ? void 0 : _a.getColId());
|
|
63
63
|
const menuContext = this.createContextMenuContextObject(params, adaptableColumn);
|
|
64
64
|
/**
|
|
@@ -91,10 +91,10 @@ export class AgGridMenuAdapter {
|
|
|
91
91
|
* Build the context menu
|
|
92
92
|
*/
|
|
93
93
|
// 1. first check if there is a custom context menu defined
|
|
94
|
-
if (typeof
|
|
94
|
+
if (typeof contextMenuOptions.customContextMenu === 'function') {
|
|
95
95
|
const defaultAgGridMenuItems = agGridMenuItems.map((itemName) => this.mapAgGridItemTypeToAgGridMenuItem(itemName));
|
|
96
96
|
const defaultAdaptableMenuItems = adaptableMenuItems.map((adaptableItem) => (Object.assign({ menuType: 'Adaptable' }, adaptableItem)));
|
|
97
|
-
const customMenuItems =
|
|
97
|
+
const customMenuItems = contextMenuOptions
|
|
98
98
|
.customContextMenu(Object.assign(Object.assign({}, menuContext), { defaultAgGridMenuItems,
|
|
99
99
|
defaultAdaptableMenuItems, defaultAdaptableMenuStructure: this.mapAdaptableMenuItemToSystemMenuItems(adaptableDefaultStructure), defaultAgGridMenuStructure: agGridDefaultStructure }))
|
|
100
100
|
.filter(Boolean);
|
|
@@ -164,8 +164,10 @@ const DefaultAdaptableOptions = {
|
|
|
164
164
|
autoCheckTagsForLayouts: false,
|
|
165
165
|
},
|
|
166
166
|
},
|
|
167
|
-
|
|
167
|
+
columnMenuOptions: {
|
|
168
168
|
customColumnMenu: undefined,
|
|
169
|
+
},
|
|
170
|
+
contextMenuOptions: {
|
|
169
171
|
customContextMenu: undefined,
|
|
170
172
|
},
|
|
171
173
|
columnFilterOptions: {
|
|
@@ -356,7 +358,8 @@ export function applyDefaultAdaptableOptions(adaptableOptions) {
|
|
|
356
358
|
adaptableOptsWithDefaults.gridFilterOptions = Object.assign({}, DefaultAdaptableOptions.gridFilterOptions, adaptableOptions.gridFilterOptions);
|
|
357
359
|
adaptableOptsWithDefaults.userInterfaceOptions = Object.assign({}, DefaultAdaptableOptions.userInterfaceOptions, adaptableOptions.userInterfaceOptions);
|
|
358
360
|
adaptableOptsWithDefaults.userInterfaceOptions.dateInputOptions = Object.assign({}, DefaultAdaptableOptions.userInterfaceOptions.dateInputOptions, adaptableOptsWithDefaults.userInterfaceOptions.dateInputOptions);
|
|
359
|
-
adaptableOptsWithDefaults.
|
|
361
|
+
adaptableOptsWithDefaults.columnMenuOptions = Object.assign({}, DefaultAdaptableOptions.columnMenuOptions, adaptableOptions.columnMenuOptions);
|
|
362
|
+
adaptableOptsWithDefaults.contextMenuOptions = Object.assign({}, DefaultAdaptableOptions.contextMenuOptions, adaptableOptions.contextMenuOptions);
|
|
360
363
|
adaptableOptsWithDefaults.stateOptions = Object.assign({}, DefaultAdaptableOptions.stateOptions, adaptableOptions.stateOptions);
|
|
361
364
|
adaptableOptsWithDefaults.exportOptions = Object.assign({}, DefaultAdaptableOptions.exportOptions, adaptableOptions.exportOptions);
|
|
362
365
|
adaptableOptsWithDefaults.teamSharingOptions = Object.assign({}, DefaultAdaptableOptions.teamSharingOptions, adaptableOptions.teamSharingOptions);
|
package/src/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
3
|
-
PUBLISH_TIMESTAMP:
|
|
4
|
-
VERSION: "18.0.0-canary.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1713090178193 || Date.now(),
|
|
4
|
+
VERSION: "18.0.0-canary.36" || '--current-version--',
|
|
5
5
|
};
|