@adaptabletools/adaptable 16.0.9 → 16.1.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agGrid.d.ts +4 -0
- package/agGrid.js +4 -0
- package/base.css +16 -14
- package/base.css.map +1 -1
- package/bundle.cjs.js +171 -170
- package/index.css +18 -14
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +12 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +7 -2
- package/src/AdaptableOptions/ChartingOptions.d.ts +48 -3
- package/src/AdaptableOptions/ColumnOptions.d.ts +17 -0
- package/src/AdaptableOptions/DataImportOptions.d.ts +57 -0
- package/src/AdaptableOptions/MenuOptions.d.ts +147 -8
- package/src/AdaptableOptions/MenuOptions.js +75 -0
- package/src/AdaptableOptions/NotesOptions.d.ts +23 -0
- package/src/AdaptableOptions/QuickSearchOptions.d.ts +8 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +2 -0
- package/src/Api/AdaptableApi.d.ts +8 -3
- package/src/Api/ChartingApi.d.ts +30 -0
- package/src/Api/ColumnApi.d.ts +5 -0
- package/src/Api/ConfigApi.d.ts +4 -3
- package/src/Api/DataImportApi.d.ts +9 -0
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +4 -2
- package/src/Api/Implementation/AdaptableApiImpl.js +4 -2
- package/src/Api/Implementation/ApiBase.d.ts +2 -2
- package/src/Api/Implementation/ApiBase.js +2 -2
- package/src/Api/Implementation/ChartingApiImpl.d.ts +8 -2
- package/src/Api/Implementation/ChartingApiImpl.js +64 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +4 -0
- package/src/Api/Implementation/ConfigApiImpl.d.ts +3 -2
- package/src/Api/Implementation/ConfigApiImpl.js +9 -9
- package/src/Api/Implementation/DataImportApiImpl.d.ts +10 -0
- package/src/Api/Implementation/DataImportApiImpl.js +14 -0
- package/src/Api/Implementation/ExpressionApiImpl.js +1 -1
- package/src/Api/Implementation/NotesApiImpl.d.ts +20 -0
- package/src/Api/Implementation/NotesApiImpl.js +58 -0
- package/src/Api/Implementation/OptionsApiImpl.d.ts +3 -2
- package/src/Api/Implementation/OptionsApiImpl.js +5 -2
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +7 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.js +30 -0
- package/src/Api/Internal/AdaptableInternalApi.d.ts +0 -2
- package/src/Api/Internal/AdaptableInternalApi.js +0 -6
- package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/CalculatedColumnInternalApi.js +12 -0
- package/src/Api/Internal/ChartingInternalApi.d.ts +7 -0
- package/src/Api/Internal/ChartingInternalApi.js +45 -0
- package/src/Api/Internal/ColumnInternalApi.d.ts +3 -0
- package/src/Api/Internal/ColumnInternalApi.js +3 -0
- package/src/Api/Internal/DataImportInternalApi.d.ts +4 -0
- package/src/Api/Internal/DataImportInternalApi.js +49 -0
- package/src/Api/NotesAPi.d.ts +50 -0
- package/src/Api/NotesAPi.js +2 -0
- package/src/Api/OptionsApi.d.ts +8 -3
- package/src/Api/UserInterfaceApi.d.ts +22 -0
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -2
- package/src/PredefinedConfig/ChartingState.d.ts +22 -0
- package/src/PredefinedConfig/ChartingState.js +9 -0
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +12 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/Menu.d.ts +2 -7
- package/src/PredefinedConfig/Common/Types.d.ts +4 -4
- package/src/PredefinedConfig/Common/Types.js +3 -1
- package/src/PredefinedConfig/NotesState.d.ts +59 -0
- package/src/PredefinedConfig/NotesState.js +2 -0
- package/src/PredefinedConfig/PredefinedConfig.d.ts +2 -2
- package/src/PredefinedConfig/SystemState.d.ts +5 -3
- package/src/Redux/ActionsReducers/ChartingRedux.d.ts +28 -3
- package/src/Redux/ActionsReducers/ChartingRedux.js +52 -5
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +39 -0
- package/src/Redux/ActionsReducers/NotesRedux.js +88 -0
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +10 -10
- package/src/Redux/ActionsReducers/SystemRedux.js +23 -22
- package/src/Redux/Store/AdaptableStore.js +19 -11
- package/src/Strategy/ChartingModule.d.ts +5 -2
- package/src/Strategy/ChartingModule.js +28 -7
- package/src/Strategy/ColumnInfoModule.d.ts +11 -0
- package/src/Strategy/ColumnInfoModule.js +47 -0
- package/src/Strategy/DataImportModule.d.ts +11 -0
- package/src/Strategy/DataImportModule.js +36 -0
- package/src/Strategy/DataSetModule.js +1 -0
- package/src/Strategy/Fdc3Module.js +3 -2
- package/src/Strategy/FilterModule.js +5 -0
- package/src/Strategy/GridInfoModule.js +13 -82
- package/src/Strategy/Interface/IModule.d.ts +2 -0
- package/src/Strategy/LayoutModule.js +1 -0
- package/src/Strategy/{CommentsModule.d.ts → NotesModule.d.ts} +6 -6
- package/src/Strategy/{CommentsModule.js → NotesModule.js} +41 -41
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.d.ts +2 -0
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +20 -18
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.js +2 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +9 -3
- package/src/Utilities/Constants/ModuleConstants.js +11 -5
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +5 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +3 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +3 -2
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +36 -10
- package/src/Utilities/Extensions/ObjectExtensions.d.ts +1 -0
- package/src/Utilities/Extensions/ObjectExtensions.js +5 -1
- package/src/Utilities/Helpers/AdaptableHelper.js +2 -0
- package/src/Utilities/Interface/MessagePopups.d.ts +2 -2
- package/src/Utilities/ObjectFactory.d.ts +2 -1
- package/src/Utilities/ObjectFactory.js +10 -2
- package/src/Utilities/Services/Interface/IEntitlementService.d.ts +4 -0
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/ModuleService.js +2 -0
- package/src/Utilities/Services/QueryLanguageService.d.ts +1 -2
- package/src/Utilities/Services/QueryLanguageService.js +1 -6
- package/src/Utilities/Services/ValidationService.js +15 -5
- package/src/View/AdaptableView.js +2 -2
- package/src/View/AdaptableViewFactory.js +7 -3
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +20 -4
- package/src/View/Alert/Wizard/AlertWizard.js +14 -7
- package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.d.ts +2 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +25 -46
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.d.ts +8 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +19 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +2 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +44 -3
- package/src/View/CalculatedColumn/utils.d.ts +2 -0
- package/src/View/CalculatedColumn/utils.js +14 -0
- package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.d.ts +6 -0
- package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +47 -0
- package/src/View/Charting/ChartingWizard/{PreviewChartSection.d.ts → AgChargingWizard/PreviewChartSection.d.ts} +1 -1
- package/src/View/Charting/ChartingWizard/{PreviewChartSection.js → AgChargingWizard/PreviewChartSection.js} +2 -2
- package/src/View/Charting/ChartingWizard/{SettingsSection.d.ts → AgChargingWizard/SettingsSection.d.ts} +1 -1
- package/src/View/Charting/ChartingWizard/{SettingsSection.js → AgChargingWizard/SettingsSection.js} +4 -4
- package/src/View/Charting/ChartingWizard/AgChargingWizard/index.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/AgChargingWizard/index.js +4 -0
- package/src/View/Charting/ChartingWizard/ChartingWizard.d.ts +4 -3
- package/src/View/Charting/ChartingWizard/ChartingWizard.js +12 -39
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.d.ts +6 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +59 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +9 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +25 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/index.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/index.js +4 -0
- package/src/View/Charting/ChartingWizard/index.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/index.js +4 -0
- package/src/View/Charting/DeleteChartButton.d.ts +2 -1
- package/src/View/Charting/DeleteChartButton.js +4 -2
- package/src/View/Charting/EditChartButton.d.ts +2 -1
- package/src/View/Charting/ShowChartButton.js +47 -16
- package/src/View/Charting/{useChartState.d.ts → useAgChartState.d.ts} +1 -1
- package/src/View/Charting/{useChartState.js → useAgChartState.js} +7 -7
- package/src/View/Charting/useChartingElements.d.ts +2 -1
- package/src/View/Charting/useChartingElements.js +36 -26
- package/src/View/Charting/useExternalChartState.d.ts +7 -0
- package/src/View/Charting/useExternalChartState.js +56 -0
- package/src/View/ColumnInfo/ColumnInfo.d.ts +5 -0
- package/src/View/ColumnInfo/ColumnInfo.js +185 -0
- package/src/View/ColumnInfo/ColumnInfoPopup.d.ts +3 -0
- package/src/View/ColumnInfo/ColumnInfoPopup.js +15 -0
- package/src/View/Components/AdaptableIconSelector/index.d.ts +1 -1
- package/src/View/Components/ExternalRenderer.d.ts +1 -0
- package/src/View/Components/ExternalRenderer.js +2 -1
- package/src/View/Components/Panels/PanelWithImage.js +3 -3
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +4 -1
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +3 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +1 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +12 -2
- package/src/View/Components/Selectors/ColumnSelector.js +1 -1
- package/src/View/DataImport/DataImportPopup.d.ts +6 -0
- package/src/View/DataImport/DataImportPopup.js +32 -0
- package/src/View/DataImport/DataImportWizard/DataImportWizard.d.ts +8 -0
- package/src/View/DataImport/DataImportWizard/DataImportWizard.js +176 -0
- package/src/View/DataImport/DataImportWizard/index.d.ts +1 -0
- package/src/View/DataImport/DataImportWizard/index.js +4 -0
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.d.ts +10 -0
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +154 -0
- package/src/View/DataImport/DataImportWizard/sections/ImportSection.d.ts +9 -0
- package/src/View/DataImport/DataImportWizard/sections/ImportSection.js +24 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadFileSection.d.ts +8 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadFileSection.js +11 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.d.ts +13 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +23 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.d.ts +8 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +13 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/index.d.ts +1 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/index.js +4 -0
- package/src/View/DataImport/DataImportWizard/sections/ValidationSection.d.ts +11 -0
- package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +35 -0
- package/src/View/DataImport/systemFileHandlers.d.ts +3 -0
- package/src/View/DataImport/systemFileHandlers.js +44 -0
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +6 -1
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +9 -0
- package/src/View/GridInfo/{AdaptableObjectsSummary.js → GridInfoPopup/AdaptableObjectsSummary.js} +2 -2
- package/src/View/GridInfo/{AdaptableOptionsComponent.d.ts → GridInfoPopup/AdaptableOptionsComponent.d.ts} +1 -1
- package/src/View/GridInfo/{AdaptableOptionsComponent.js → GridInfoPopup/AdaptableOptionsComponent.js} +6 -6
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.d.ts +6 -0
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +82 -0
- package/src/View/GridInfo/GridInfoPopup/index.d.ts +1 -0
- package/src/View/GridInfo/GridInfoPopup/index.js +4 -0
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
- package/src/View/Notes/NotesListing.d.ts +2 -0
- package/src/View/{Comments/CommentListing.js → Notes/NotesListing.js} +13 -14
- package/src/View/Notes/NotesPopup.d.ts +2 -0
- package/src/View/{Comments/CommentPopup.js → Notes/NotesPopup.js} +21 -21
- package/src/View/Shortcut/Wizard/ShortcutWizard.js +6 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +14 -0
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +1 -0
- package/src/View/Wizard/OnePageWizards.d.ts +1 -0
- package/src/View/Wizard/OnePageWizards.js +2 -2
- package/src/agGrid/Adaptable.d.ts +1 -1
- package/src/agGrid/Adaptable.js +28 -16
- package/src/agGrid/agGridHelper.d.ts +3 -3
- package/src/agGrid/agGridHelper.js +58 -30
- package/src/agGrid/agGridMenuHelper.d.ts +20 -9
- package/src/agGrid/agGridMenuHelper.js +292 -135
- package/src/components/ExpressionEditor/EditorInput.d.ts +1 -1
- package/src/components/ExpressionEditor/EditorInput.js +15 -6
- package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +5 -10
- package/src/components/ExpressionEditor/editorButtonsCumulativeAggregatedScalar.js +5 -5
- package/src/components/ExpressionEditor/editorButtonsQuantileAggregatedScalar.d.ts +2 -0
- package/src/components/ExpressionEditor/editorButtonsQuantileAggregatedScalar.js +25 -0
- package/src/components/ExpressionEditor/index.d.ts +1 -1
- package/src/components/ExpressionEditor/index.js +2 -1
- package/src/components/FileDroppable/index.d.ts +2 -1
- package/src/components/FileDroppable/index.js +8 -7
- package/src/components/icons/import.d.ts +3 -0
- package/src/components/icons/import.js +7 -0
- package/src/components/icons/index.js +4 -0
- package/src/components/icons/note.d.ts +3 -0
- package/src/components/icons/note.js +7 -0
- package/src/metamodel/adaptable.metamodel.d.ts +243 -61
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/index.d.ts +2 -2
- package/src/parser/src/index.js +4 -4
- package/src/parser/src/tokenizer.d.ts +1 -1
- package/src/parser/src/tokenizer.js +14 -6
- package/src/parser/src/types.d.ts +2 -2
- package/src/types.d.ts +9 -8
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/AdaptableOptions/CommentsOptions.d.ts +0 -23
- package/src/Api/CommentsApi.d.ts +0 -50
- package/src/Api/Implementation/CommentsApiImpl.d.ts +0 -20
- package/src/Api/Implementation/CommentsApiImpl.js +0 -58
- package/src/PredefinedConfig/CommentsState.d.ts +0 -59
- package/src/Redux/ActionsReducers/CommentsRedux.d.ts +0 -39
- package/src/Redux/ActionsReducers/CommentsRedux.js +0 -92
- package/src/View/Comments/CommentListing.d.ts +0 -2
- package/src/View/Comments/CommentPopup.d.ts +0 -2
- package/src/View/GridInfo/ColumnInfoComponent.d.ts +0 -20
- package/src/View/GridInfo/ColumnInfoComponent.js +0 -176
- package/src/View/GridInfo/GridInfoPopup.d.ts +0 -16
- package/src/View/GridInfo/GridInfoPopup.js +0 -117
- package/src/View/GridInfo/GridOptionsComponent.d.ts +0 -16
- package/src/View/GridInfo/GridOptionsComponent.js +0 -36
- /package/src/AdaptableOptions/{CommentsOptions.js → DataImportOptions.js} +0 -0
- /package/src/{Api/CommentsApi.js → AdaptableOptions/NotesOptions.js} +0 -0
- /package/src/{PredefinedConfig/CommentsState.js → Api/DataImportApi.js} +0 -0
- /package/src/View/GridInfo/{AdaptableObjectsSummary.d.ts → GridInfoPopup/AdaptableObjectsSummary.d.ts} +0 -0
|
@@ -6,6 +6,8 @@ const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
|
|
|
6
6
|
const icons_1 = require("../components/icons");
|
|
7
7
|
const flatten_1 = tslib_1.__importDefault(require("lodash/flatten"));
|
|
8
8
|
const Icon_1 = require("../components/Icon");
|
|
9
|
+
const logDeprecation_1 = require("../Utilities/logDeprecation");
|
|
10
|
+
const MenuOptions_1 = require("../AdaptableOptions/MenuOptions");
|
|
9
11
|
// tslint:disable-next-line: class-name
|
|
10
12
|
class agGridMenuHelper {
|
|
11
13
|
constructor(adaptable, gridOptions) {
|
|
@@ -16,139 +18,183 @@ class agGridMenuHelper {
|
|
|
16
18
|
this.adaptable = null;
|
|
17
19
|
this.gridOptions = null;
|
|
18
20
|
}
|
|
19
|
-
buildColumnMenu(params,
|
|
20
|
-
|
|
21
|
-
const colId = params.column.getColId();
|
|
22
|
-
let agGridColumnMenuItems = [];
|
|
23
|
-
let adaptableColumnMenuItems = [];
|
|
24
|
-
let userColumnMenuItems = [];
|
|
21
|
+
buildColumnMenu(params, originalGetMainMenuItems) {
|
|
22
|
+
var _a;
|
|
25
23
|
const menuOptions = this.adaptable.adaptableOptions.menuOptions;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
agGridColumnMenuItems.push('separator');
|
|
24
|
+
this.logMenuDeprecation(menuOptions);
|
|
25
|
+
const agGridMenuItems = (params.defaultItems ? [...params.defaultItems] : []);
|
|
26
|
+
if (!params.column) {
|
|
27
|
+
// return only AG Grid context if the Adaptable column is not found (should not happen)
|
|
28
|
+
return agGridMenuItems;
|
|
32
29
|
}
|
|
33
|
-
const adaptableColumn = this.adaptable.api.columnApi.getColumnWithColumnId(
|
|
30
|
+
const adaptableColumn = this.adaptable.api.columnApi.getColumnWithColumnId((_a = params.column) === null || _a === void 0 ? void 0 : _a.getColId());
|
|
34
31
|
const menuContext = this.createColumnMenuContextObject(adaptableColumn, params.column);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
//
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (menuItemsArray != null && typeof menuItemsArray === 'function') {
|
|
57
|
-
arr = menuItemsArray({
|
|
58
|
-
adaptableApi: this.adaptable.api,
|
|
59
|
-
userName: this.adaptable.adaptableOptions.userName,
|
|
60
|
-
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
61
|
-
column: adaptableColumn,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
arr = menuItemsArray;
|
|
32
|
+
const adaptableMenuItems = this.createAdaptableColumnMenuItems(menuContext);
|
|
33
|
+
// sort Adaptable menu items by default order
|
|
34
|
+
adaptableMenuItems.sort((first, second) => {
|
|
35
|
+
const firstPriority = MenuOptions_1.DEFAULT_ADAPTABLE_COLUMN_MENU_ORDER.indexOf(first.module);
|
|
36
|
+
const secondPriority = MenuOptions_1.DEFAULT_ADAPTABLE_COLUMN_MENU_ORDER.indexOf(second.module);
|
|
37
|
+
return firstPriority - secondPriority;
|
|
38
|
+
});
|
|
39
|
+
// 1. first check if there is a custom column menu defined
|
|
40
|
+
if (typeof menuOptions.customColumnMenu === 'function') {
|
|
41
|
+
const defaultAgGridMenuItems = agGridMenuItems.map((itemName) => ({
|
|
42
|
+
menuType: 'AgGrid',
|
|
43
|
+
name: itemName,
|
|
44
|
+
}));
|
|
45
|
+
const defaultAdaptableMenuItems = adaptableMenuItems.map((adaptableItem) => (Object.assign({ menuType: 'Adaptable' }, adaptableItem)));
|
|
46
|
+
const customMenuItems = menuOptions
|
|
47
|
+
.customColumnMenu(Object.assign(Object.assign({}, menuContext), { defaultAgGridMenuItems,
|
|
48
|
+
defaultAdaptableMenuItems }))
|
|
49
|
+
.filter(Boolean);
|
|
50
|
+
return customMenuItems
|
|
51
|
+
.map((customMenuItem) => this.mapCustomMenuItemToAgGridMenuDefinition(customMenuItem, menuContext))
|
|
52
|
+
.filter(Boolean);
|
|
66
53
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
// !! Uncomment once the deprecated options are removed
|
|
55
|
+
// 2. if not, return the default context menu
|
|
56
|
+
// const defaultContextMenu: (string | MenuItemDef)[] = [
|
|
57
|
+
// ...agGridMenuItems,
|
|
58
|
+
// 'separator',
|
|
59
|
+
// ...adaptableMenuItems.map((adaptableItem) =>
|
|
60
|
+
// this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)
|
|
61
|
+
// ),
|
|
62
|
+
// ];
|
|
63
|
+
// return defaultContextMenu;
|
|
64
|
+
return this.buildColumnMenuDeprecated(params, originalGetMainMenuItems);
|
|
70
65
|
}
|
|
71
|
-
buildContextMenu(params,
|
|
66
|
+
buildContextMenu(params, originalGetContextMenuItems) {
|
|
67
|
+
var _a;
|
|
72
68
|
// we do this in order to refresh the internal state of selected cells (technically query the AG Grid cellRanges)
|
|
73
69
|
// (right-click selected the current cell, but this was not reflected in the internal state of the selected cells)
|
|
74
70
|
this.adaptable.setSelectedCells();
|
|
75
|
-
let agGridContextMenuItems = [];
|
|
76
|
-
let adaptableContextMenuItems = [];
|
|
77
|
-
let userContextMenuItems = [];
|
|
78
71
|
const menuOptions = this.adaptable.adaptableOptions.menuOptions;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (agGridMenuItems === null || agGridMenuItems === void 0 ? void 0 : agGridMenuItems.length) {
|
|
85
|
-
agGridContextMenuItems.push(...agGridMenuItems);
|
|
86
|
-
if (hasAdaptableContextMenuItems || hasUserDefinedContextMenuItems) {
|
|
87
|
-
agGridContextMenuItems.push('separator');
|
|
88
|
-
}
|
|
72
|
+
this.logMenuDeprecation(menuOptions);
|
|
73
|
+
const agGridMenuItems = (params.defaultItems ? [...params.defaultItems] : []);
|
|
74
|
+
if (!params.column) {
|
|
75
|
+
// return only AG Grid context if the Adaptable column is not found (should not happen)
|
|
76
|
+
return agGridMenuItems;
|
|
89
77
|
}
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
78
|
+
const adaptableColumn = this.adaptable.api.columnApi.getColumnWithColumnId((_a = params.column) === null || _a === void 0 ? void 0 : _a.getColId());
|
|
79
|
+
const menuContext = this.createContextMenuContextObject(params, adaptableColumn);
|
|
80
|
+
const adaptableMenuItems = this.createAdaptableContextMenuItems(menuContext);
|
|
81
|
+
// sort Adaptable menu items by default order
|
|
82
|
+
adaptableMenuItems.sort((first, second) => {
|
|
83
|
+
const firstPriority = MenuOptions_1.DEFAULT_ADAPTABLE_CONTEXT_MENU_ORDER.indexOf(first.module);
|
|
84
|
+
const secondPriority = MenuOptions_1.DEFAULT_ADAPTABLE_CONTEXT_MENU_ORDER.indexOf(second.module);
|
|
85
|
+
return firstPriority - secondPriority;
|
|
86
|
+
});
|
|
87
|
+
// 1. first check if there is a custom context menu defined
|
|
88
|
+
if (typeof menuOptions.customContextMenu === 'function') {
|
|
89
|
+
const defaultAgGridMenuItems = agGridMenuItems.map((itemName) => ({
|
|
90
|
+
menuType: 'AgGrid',
|
|
91
|
+
name: itemName,
|
|
92
|
+
}));
|
|
93
|
+
const defaultAdaptableMenuItems = adaptableMenuItems.map((adaptableItem) => (Object.assign({ menuType: 'Adaptable' }, adaptableItem)));
|
|
94
|
+
const customMenuItems = menuOptions
|
|
95
|
+
.customContextMenu(Object.assign(Object.assign({}, menuContext), { defaultAgGridMenuItems,
|
|
96
|
+
defaultAdaptableMenuItems }))
|
|
97
|
+
.filter(Boolean);
|
|
98
|
+
return customMenuItems
|
|
99
|
+
.map((customMenuItem) => this.mapCustomMenuItemToAgGridMenuDefinition(customMenuItem, menuContext))
|
|
100
|
+
.filter(Boolean);
|
|
101
|
+
}
|
|
102
|
+
// !! Uncomment once the deprecated options are removed
|
|
103
|
+
// 2. if not, return the default context menu
|
|
104
|
+
// const defaultContextMenu: (string | MenuItemDef)[] = [
|
|
105
|
+
// ...agGridMenuItems,
|
|
106
|
+
// 'separator',
|
|
107
|
+
// ...adaptableMenuItems.map((adaptableItem) =>
|
|
108
|
+
// this.mapAdaptableMenuItemToAgGridMenuDefinition(adaptableItem)
|
|
109
|
+
// ),
|
|
110
|
+
// ];
|
|
111
|
+
// return defaultContextMenu;
|
|
112
|
+
return this.buildContextMenuDeprecated(params, originalGetContextMenuItems);
|
|
113
|
+
}
|
|
114
|
+
createAdaptableColumnMenuItems(menuContext) {
|
|
115
|
+
let contextMenuItems = [];
|
|
116
|
+
this.adaptable.adaptableModules.forEach((s) => {
|
|
117
|
+
let menuItems = s.addColumnMenuItems(menuContext.adaptableColumn);
|
|
118
|
+
if (menuItems) {
|
|
119
|
+
contextMenuItems.push(...menuItems.filter(Boolean).filter((item) => item.isVisible !== false));
|
|
111
120
|
}
|
|
121
|
+
});
|
|
122
|
+
return contextMenuItems;
|
|
123
|
+
}
|
|
124
|
+
mapCustomMenuItemToAgGridMenuDefinition(customMenuItem, menuContext) {
|
|
125
|
+
var _a;
|
|
126
|
+
if (customMenuItem === '-') {
|
|
127
|
+
return 'separator';
|
|
112
128
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
125
|
-
column: adaptableColumn,
|
|
126
|
-
});
|
|
129
|
+
if (customMenuItem.menuType === 'Group') {
|
|
130
|
+
return {
|
|
131
|
+
name: customMenuItem.label,
|
|
132
|
+
icon: this.mapAdaptableIconToAgGridIcon(customMenuItem.icon, {
|
|
133
|
+
fill: 'var(--ab-color-text-on-primary)',
|
|
134
|
+
}),
|
|
135
|
+
disabled: customMenuItem.disabled,
|
|
136
|
+
subMenu: !customMenuItem.disabled
|
|
137
|
+
? (_a = customMenuItem.subMenuItems) === null || _a === void 0 ? void 0 : _a.map((subMenuItem) => this.mapCustomMenuItemToAgGridMenuDefinition(subMenuItem, menuContext)).filter(Boolean)
|
|
138
|
+
: undefined,
|
|
139
|
+
};
|
|
127
140
|
}
|
|
128
|
-
|
|
129
|
-
|
|
141
|
+
if (customMenuItem.menuType === 'AgGrid') {
|
|
142
|
+
return customMenuItem.name;
|
|
130
143
|
}
|
|
131
|
-
|
|
132
|
-
return
|
|
133
|
-
}
|
|
144
|
+
if (customMenuItem.menuType === 'Adaptable') {
|
|
145
|
+
return this.mapAdaptableMenuItemToAgGridMenuDefinition(customMenuItem);
|
|
146
|
+
}
|
|
147
|
+
if (customMenuItem.menuType === 'User') {
|
|
148
|
+
return this.mapUserMenuItemToAgGridMenuDefinition(customMenuItem, menuContext);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
mapAdaptableMenuItemToAgGridMenuDefinition(adaptableMenuItem) {
|
|
152
|
+
var _a;
|
|
153
|
+
return {
|
|
154
|
+
name: adaptableMenuItem.label,
|
|
155
|
+
action: adaptableMenuItem.onClick
|
|
156
|
+
? adaptableMenuItem.onClick
|
|
157
|
+
: adaptableMenuItem.reduxAction
|
|
158
|
+
? () => this.adaptable.api.internalApi.dispatchReduxAction(adaptableMenuItem.reduxAction)
|
|
159
|
+
: undefined,
|
|
160
|
+
icon: this.mapAdaptableIconToAgGridIcon(adaptableMenuItem.icon, {
|
|
161
|
+
fill: 'var(--ab-color-text-on-primary)',
|
|
162
|
+
}),
|
|
163
|
+
subMenu: (_a = adaptableMenuItem.subItems) === null || _a === void 0 ? void 0 : _a.map((subMenuItem) => this.mapAdaptableMenuItemToAgGridMenuDefinition(subMenuItem)),
|
|
164
|
+
};
|
|
134
165
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
// );
|
|
141
|
-
createRemoveGroupsMenuItem(x) {
|
|
166
|
+
mapUserMenuItemToAgGridMenuDefinition(userMenuItem, menuContext) {
|
|
167
|
+
var _a;
|
|
168
|
+
if (userMenuItem.hidden) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
142
171
|
return {
|
|
143
|
-
name:
|
|
144
|
-
action:
|
|
145
|
-
|
|
146
|
-
: () => this.adaptable.api.internalApi.dispatchReduxAction(x.reduxAction),
|
|
147
|
-
icon: this.mapAdaptableIconToAgGridIcon(x.icon, {
|
|
172
|
+
name: userMenuItem.label,
|
|
173
|
+
action: () => (userMenuItem.onClick ? userMenuItem.onClick(menuContext) : null),
|
|
174
|
+
icon: this.mapAdaptableIconToAgGridIcon(userMenuItem.icon, {
|
|
148
175
|
fill: 'var(--ab-color-text-on-primary)',
|
|
149
176
|
}),
|
|
177
|
+
disabled: userMenuItem.disabled,
|
|
178
|
+
subMenu: (_a = userMenuItem.subMenuItems) === null || _a === void 0 ? void 0 : _a.map((subMenuItem) => {
|
|
179
|
+
return this.mapCustomMenuItemToAgGridMenuDefinition(subMenuItem, menuContext);
|
|
180
|
+
}).filter(Boolean),
|
|
150
181
|
};
|
|
151
182
|
}
|
|
183
|
+
logMenuDeprecation(menuOptions) {
|
|
184
|
+
const deprecatedProps = [
|
|
185
|
+
'contextMenuItems',
|
|
186
|
+
'contextMenuOrder',
|
|
187
|
+
'showAdaptableContextMenu',
|
|
188
|
+
'columnMenuItems',
|
|
189
|
+
'columnMenuOrder',
|
|
190
|
+
'showAdaptableColumnMenu',
|
|
191
|
+
];
|
|
192
|
+
deprecatedProps.forEach((propName) => {
|
|
193
|
+
if (menuOptions[propName]) {
|
|
194
|
+
(0, logDeprecation_1.logDeprecation)(this.adaptable.logger, 'MenuOptions', propName, 'customContextMenu');
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
152
198
|
createAgGridMenuDefFromAdaptableMenu(adaptableMenuItem) {
|
|
153
199
|
const subMenuItems = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(adaptableMenuItem.subItems)
|
|
154
200
|
? adaptableMenuItem.subItems.map((amu) => {
|
|
@@ -171,10 +217,11 @@ class agGridMenuHelper {
|
|
|
171
217
|
createAgGridColumnMenuDefFromUserMenu(menuItem, menuContext) {
|
|
172
218
|
const fn = menuItem.onClick;
|
|
173
219
|
const disabled = menuItem.disabled && menuItem.disabled(menuContext);
|
|
220
|
+
const icon = typeof menuItem.icon === 'function' ? menuItem.icon(menuContext) : menuItem.icon;
|
|
174
221
|
return {
|
|
175
222
|
name: this.getLabelFromUserColumnMenuItem(menuItem, menuContext),
|
|
176
223
|
action: () => (fn ? fn(menuContext) : null),
|
|
177
|
-
icon: this.mapAdaptableIconToAgGridIcon(
|
|
224
|
+
icon: this.mapAdaptableIconToAgGridIcon(icon, {
|
|
178
225
|
fill: 'var(--ab-color-text-on-primary)',
|
|
179
226
|
}),
|
|
180
227
|
disabled: disabled,
|
|
@@ -188,10 +235,11 @@ class agGridMenuHelper {
|
|
|
188
235
|
createAgGridContextMenuDefFromUserMenu(menuItem, menuContext) {
|
|
189
236
|
const fn = menuItem.onClick;
|
|
190
237
|
const disabled = menuItem.disabled && menuItem.disabled(menuContext);
|
|
238
|
+
const icon = typeof menuItem.icon === 'function' ? menuItem.icon(menuContext) : menuItem.icon;
|
|
191
239
|
return {
|
|
192
240
|
name: this.getLabelFromUserContextMenuItem(menuItem, menuContext),
|
|
193
241
|
action: () => (fn ? fn(menuContext) : null),
|
|
194
|
-
icon: this.mapAdaptableIconToAgGridIcon(
|
|
242
|
+
icon: this.mapAdaptableIconToAgGridIcon(icon, {
|
|
195
243
|
fill: 'var(--ab-color-text-on-primary)',
|
|
196
244
|
}),
|
|
197
245
|
disabled: disabled,
|
|
@@ -222,6 +270,7 @@ class agGridMenuHelper {
|
|
|
222
270
|
createAdaptableColumnMenuItemFromUserMenu(menuItem, menuContext) {
|
|
223
271
|
const fn = menuItem.onClick;
|
|
224
272
|
let adaptableMenuItem = {
|
|
273
|
+
module: 'General',
|
|
225
274
|
label: this.getLabelFromUserColumnMenuItem(menuItem, menuContext),
|
|
226
275
|
reduxAction: null,
|
|
227
276
|
onClick: () => (fn ? fn(menuContext) : null),
|
|
@@ -236,25 +285,16 @@ class agGridMenuHelper {
|
|
|
236
285
|
? originalgetMainMenuItems(params)
|
|
237
286
|
: params.defaultItems.slice(0);
|
|
238
287
|
}
|
|
239
|
-
|
|
240
|
-
if (this.adaptable.adaptableOptions.menuOptions.showUngroupColumnMenuItem) {
|
|
241
|
-
let groupedCols = this.gridOptions.columnApi.getRowGroupColumns();
|
|
242
|
-
let ungroupMenuItem = {
|
|
243
|
-
label: groupedCols.length == 1 ? 'Ungroup Column' : 'Ungroup All',
|
|
244
|
-
onClick: () => this.gridOptions.columnApi.setRowGroupColumns([]),
|
|
245
|
-
isVisible: true,
|
|
246
|
-
icon: {
|
|
247
|
-
name: 'undo',
|
|
248
|
-
},
|
|
249
|
-
};
|
|
250
|
-
let menuItem = this.createAgGridMenuDefFromAdaptableMenu(ungroupMenuItem);
|
|
251
|
-
return menuItem;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
createAdaptableColumnMenuItems(adaptableColumn, menuContext) {
|
|
288
|
+
createAdaptableColumnMenuItems_DEPRECATED(adaptableColumn, menuContext) {
|
|
255
289
|
let columnMenuItems = [];
|
|
256
290
|
// First get all the Module based Adaptable Menu Items
|
|
257
291
|
const adaptableMenuItems = this.getAdaptableMenuItemsColumnHeader(adaptableColumn, menuContext);
|
|
292
|
+
// sort Adaptable menu items by default order
|
|
293
|
+
adaptableMenuItems.sort((first, second) => {
|
|
294
|
+
const firstPriority = MenuOptions_1.DEFAULT_ADAPTABLE_COLUMN_MENU_ORDER.indexOf(first.module);
|
|
295
|
+
const secondPriority = MenuOptions_1.DEFAULT_ADAPTABLE_COLUMN_MENU_ORDER.indexOf(second.module);
|
|
296
|
+
return firstPriority - secondPriority;
|
|
297
|
+
});
|
|
258
298
|
// And then convert them into Menu Item Defs
|
|
259
299
|
adaptableMenuItems.forEach((adaptableMenuItem) => {
|
|
260
300
|
let menuItem = this.createAgGridMenuDefFromAdaptableMenu(adaptableMenuItem);
|
|
@@ -337,18 +377,18 @@ class agGridMenuHelper {
|
|
|
337
377
|
: [];
|
|
338
378
|
}
|
|
339
379
|
createAdaptableContextMenuItems(menuContext) {
|
|
340
|
-
let
|
|
380
|
+
let contextMenuItems = [];
|
|
341
381
|
this.adaptable.adaptableModules.forEach((s) => {
|
|
342
382
|
let menuItems = s.addContextMenuItems(menuContext);
|
|
343
383
|
if (menuItems) {
|
|
344
|
-
|
|
384
|
+
contextMenuItems.push(...menuItems.filter(Boolean).filter((item) => item.isVisible !== false));
|
|
345
385
|
}
|
|
346
386
|
});
|
|
347
387
|
this.adaptable._emitSync('CreateAdaptableContextMenuItems', {
|
|
348
|
-
items:
|
|
388
|
+
items: contextMenuItems,
|
|
349
389
|
menuContext: menuContext,
|
|
350
390
|
});
|
|
351
|
-
return
|
|
391
|
+
return contextMenuItems;
|
|
352
392
|
}
|
|
353
393
|
createAgGridAdaptableContextMenuItems(adaptableMenuItems, menuContext) {
|
|
354
394
|
// here we create agGrid Menu items based on Adaptable Menu Items
|
|
@@ -447,5 +487,122 @@ class agGridMenuHelper {
|
|
|
447
487
|
}
|
|
448
488
|
return returnMenuItems;
|
|
449
489
|
}
|
|
490
|
+
/**
|
|
491
|
+
* !!! This should be deleted once MenuOptions loses all the deprecated options
|
|
492
|
+
*/
|
|
493
|
+
buildContextMenuDeprecated(params, originalGetContextMenuItems) {
|
|
494
|
+
let agGridContextMenuItems = [];
|
|
495
|
+
let adaptableContextMenuItems = [];
|
|
496
|
+
let userContextMenuItems = [];
|
|
497
|
+
const menuOptions = this.adaptable.adaptableOptions.menuOptions;
|
|
498
|
+
let showAdaptableContextMenu = menuOptions.showAdaptableContextMenu;
|
|
499
|
+
let hasAdaptableContextMenuItems = showAdaptableContextMenu == null || showAdaptableContextMenu !== false;
|
|
500
|
+
let userDefinedContextMenuItems = menuOptions.contextMenuItems;
|
|
501
|
+
let hasUserDefinedContextMenuItems = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(userDefinedContextMenuItems);
|
|
502
|
+
const agGridMenuItems = this.createAgGridContextMenuItems(originalGetContextMenuItems, params);
|
|
503
|
+
if (agGridMenuItems === null || agGridMenuItems === void 0 ? void 0 : agGridMenuItems.length) {
|
|
504
|
+
agGridContextMenuItems.push(...agGridMenuItems);
|
|
505
|
+
if (hasAdaptableContextMenuItems || hasUserDefinedContextMenuItems) {
|
|
506
|
+
agGridContextMenuItems.push('separator');
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
const adaptableMenuItems = [];
|
|
510
|
+
const agGridColumn = params.column;
|
|
511
|
+
let adaptableColumn;
|
|
512
|
+
if (agGridColumn) {
|
|
513
|
+
adaptableColumn = this.adaptable.api.columnApi.getColumnWithColumnId(agGridColumn.getColId());
|
|
514
|
+
// if (adaptableColumn != undefined) {
|
|
515
|
+
let menuContext = this.createContextMenuContextObject(params, adaptableColumn);
|
|
516
|
+
// keep it simple for now - if its a grouped cell then don't add the shipped menu items
|
|
517
|
+
// if (adaptableColumn && !params.node.group) {
|
|
518
|
+
const allAdaptableMenuItems = this.createAdaptableContextMenuItems(menuContext);
|
|
519
|
+
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(allAdaptableMenuItems)) {
|
|
520
|
+
adaptableMenuItems.push(...allAdaptableMenuItems);
|
|
521
|
+
}
|
|
522
|
+
adaptableMenuItems.sort((first, second) => {
|
|
523
|
+
const firstPriority = MenuOptions_1.DEFAULT_ADAPTABLE_CONTEXT_MENU_ORDER.indexOf(first.module);
|
|
524
|
+
const secondPriority = MenuOptions_1.DEFAULT_ADAPTABLE_CONTEXT_MENU_ORDER.indexOf(second.module);
|
|
525
|
+
return firstPriority - secondPriority;
|
|
526
|
+
});
|
|
527
|
+
// }
|
|
528
|
+
// create agGrid Menu items based on Adaptable Menu Items - user can decide whether to show or not
|
|
529
|
+
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(adaptableMenuItems) && hasAdaptableContextMenuItems) {
|
|
530
|
+
adaptableContextMenuItems.push(...this.createAgGridAdaptableContextMenuItems(adaptableMenuItems, menuContext));
|
|
531
|
+
}
|
|
532
|
+
// create agGrid Menu items based on User Menu Items - user can decide whether to show or not
|
|
533
|
+
if (hasUserDefinedContextMenuItems) {
|
|
534
|
+
userContextMenuItems.push(...this.createAgGridUserContextMenuItems(userDefinedContextMenuItems, menuContext));
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
const map = {
|
|
538
|
+
aggrid: agGridContextMenuItems,
|
|
539
|
+
adaptable: adaptableContextMenuItems,
|
|
540
|
+
user: userContextMenuItems,
|
|
541
|
+
};
|
|
542
|
+
const menuItemsArray = menuOptions.contextMenuOrder;
|
|
543
|
+
let arr = [];
|
|
544
|
+
if (menuItemsArray != null && typeof menuItemsArray === 'function') {
|
|
545
|
+
arr = menuItemsArray({
|
|
546
|
+
adaptableApi: this.adaptable.api,
|
|
547
|
+
userName: this.adaptable.adaptableOptions.userName,
|
|
548
|
+
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
549
|
+
column: adaptableColumn,
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
else {
|
|
553
|
+
arr = menuItemsArray;
|
|
554
|
+
}
|
|
555
|
+
return (0, flatten_1.default)(arr.map((c) => {
|
|
556
|
+
return map[c];
|
|
557
|
+
}));
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* !!! This should be deleted once MenuOptions loses all the deprecated options
|
|
561
|
+
*/
|
|
562
|
+
buildColumnMenuDeprecated(params, originalgetMainMenuItems) {
|
|
563
|
+
// couldnt find a way to listen for menu close. There is a Menu Item Select, but you can also close menu from filter and clicking outside menu....
|
|
564
|
+
const colId = params.column.getColId();
|
|
565
|
+
let agGridColumnMenuItems = [];
|
|
566
|
+
let adaptableColumnMenuItems = [];
|
|
567
|
+
let userColumnMenuItems = [];
|
|
568
|
+
const menuOptions = this.adaptable.adaptableOptions.menuOptions;
|
|
569
|
+
//First get Ag Grid Column Items
|
|
570
|
+
agGridColumnMenuItems.push(...this.createAgGridColumnMenuItems(originalgetMainMenuItems, params));
|
|
571
|
+
let showAdaptableColumnMenu = menuOptions.showAdaptableColumnMenu;
|
|
572
|
+
let hasAdaptableColumnMenuItems = showAdaptableColumnMenu == null || showAdaptableColumnMenu !== false;
|
|
573
|
+
if (hasAdaptableColumnMenuItems) {
|
|
574
|
+
agGridColumnMenuItems.push('separator');
|
|
575
|
+
}
|
|
576
|
+
const adaptableColumn = this.adaptable.api.columnApi.getColumnWithColumnId(colId);
|
|
577
|
+
const menuContext = this.createColumnMenuContextObject(adaptableColumn, params.column);
|
|
578
|
+
// if (adaptableColumn != undefined) {
|
|
579
|
+
if (hasAdaptableColumnMenuItems) {
|
|
580
|
+
adaptableColumnMenuItems.push(...this.createAdaptableColumnMenuItems_DEPRECATED(adaptableColumn, menuContext));
|
|
581
|
+
}
|
|
582
|
+
// }
|
|
583
|
+
// Finally get all the User Menu Items
|
|
584
|
+
userColumnMenuItems.push(...this.createUserColumnMenuItems(menuContext));
|
|
585
|
+
const map = {
|
|
586
|
+
aggrid: agGridColumnMenuItems,
|
|
587
|
+
adaptable: adaptableColumnMenuItems,
|
|
588
|
+
user: userColumnMenuItems,
|
|
589
|
+
};
|
|
590
|
+
const menuItemsArray = menuOptions.columnMenuOrder;
|
|
591
|
+
let arr = [];
|
|
592
|
+
if (menuItemsArray != null && typeof menuItemsArray === 'function') {
|
|
593
|
+
arr = menuItemsArray({
|
|
594
|
+
adaptableApi: this.adaptable.api,
|
|
595
|
+
userName: this.adaptable.adaptableOptions.userName,
|
|
596
|
+
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
597
|
+
column: adaptableColumn,
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
arr = menuItemsArray;
|
|
602
|
+
}
|
|
603
|
+
return (0, flatten_1.default)(arr.map((c) => {
|
|
604
|
+
return map[c];
|
|
605
|
+
}));
|
|
606
|
+
}
|
|
450
607
|
}
|
|
451
608
|
exports.agGridMenuHelper = agGridMenuHelper;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
3
3
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
4
4
|
interface EditorInputProps {
|
|
5
|
-
type: 'boolean' | 'scalar' | 'aggregatedScalar' | 'cumulativeAggregatedScalar';
|
|
5
|
+
type: 'boolean' | 'scalar' | 'aggregatedScalar' | 'cumulativeAggregatedScalar' | 'quantileAggregatedScalar';
|
|
6
6
|
module: AdaptableModule;
|
|
7
7
|
value: string;
|
|
8
8
|
onChange: (value: string) => void;
|
|
@@ -2,22 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const react_1 = require("react");
|
|
5
6
|
const BaseEditorInput_1 = require("./BaseEditorInput");
|
|
6
7
|
const editorButtonsSearch_1 = require("./editorButtonsSearch");
|
|
7
8
|
const EditorContext_1 = require("./EditorContext");
|
|
8
9
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
9
10
|
const editorButtonsAggregatedScalar_1 = require("./editorButtonsAggregatedScalar");
|
|
10
|
-
const react_1 = require("react");
|
|
11
11
|
const aggregatedScalarExpressionFunctions_1 = require("../../Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions");
|
|
12
12
|
const editorButtonsCumulativeAggregatedScalar_1 = require("./editorButtonsCumulativeAggregatedScalar");
|
|
13
|
+
const editorButtonsQuantileAggregatedScalar_1 = require("./editorButtonsQuantileAggregatedScalar");
|
|
13
14
|
function EditorInput(props) {
|
|
14
15
|
const moduleExpressionFunctions = props.api.internalApi
|
|
15
16
|
.getQueryLanguageService()
|
|
16
17
|
.getModuleExpressionFunctionsMap(props.module);
|
|
17
18
|
const getFilteredAggregatedExpressionFunctions = (availableAggregatedExpressionFunctions, type) => {
|
|
18
|
-
const sourceExpressionFunctions = type === '
|
|
19
|
-
? aggregatedScalarExpressionFunctions_1.
|
|
20
|
-
:
|
|
19
|
+
const sourceExpressionFunctions = type === 'cumulativeAggregatedScalar'
|
|
20
|
+
? aggregatedScalarExpressionFunctions_1.cumulativeAggregatedExpressionFunctions
|
|
21
|
+
: type === 'quantileAggregatedScalar'
|
|
22
|
+
? aggregatedScalarExpressionFunctions_1.quantileAggregatedExpressionFunctions
|
|
23
|
+
: aggregatedScalarExpressionFunctions_1.aggregatedExpressionFunctions;
|
|
21
24
|
return Object.keys(availableAggregatedExpressionFunctions)
|
|
22
25
|
.filter((key) => sourceExpressionFunctions.includes(key))
|
|
23
26
|
.reduce((obj, key) => {
|
|
@@ -26,7 +29,9 @@ function EditorInput(props) {
|
|
|
26
29
|
}, {});
|
|
27
30
|
};
|
|
28
31
|
const expressionFunctions = (0, react_1.useMemo)(() => {
|
|
29
|
-
return props.type === 'aggregatedScalar' ||
|
|
32
|
+
return props.type === 'aggregatedScalar' ||
|
|
33
|
+
props.type === 'cumulativeAggregatedScalar' ||
|
|
34
|
+
props.type === 'quantileAggregatedScalar'
|
|
30
35
|
? getFilteredAggregatedExpressionFunctions(moduleExpressionFunctions.aggregatedScalarFunctions, props.type)
|
|
31
36
|
: Object.assign(Object.assign({}, moduleExpressionFunctions.booleanFunctions), moduleExpressionFunctions.scalarFunctions);
|
|
32
37
|
}, [props.type]);
|
|
@@ -36,6 +41,10 @@ function EditorInput(props) {
|
|
|
36
41
|
? editorButtonsAggregatedScalar_1.editorButtonsAggregatedScalar
|
|
37
42
|
: props.type === 'cumulativeAggregatedScalar'
|
|
38
43
|
? editorButtonsCumulativeAggregatedScalar_1.editorButtonsCumulativeAggregatedScalar
|
|
39
|
-
:
|
|
44
|
+
: props.type === 'quantileAggregatedScalar'
|
|
45
|
+
? editorButtonsQuantileAggregatedScalar_1.editorButtonsQuantileAggregatedScalar
|
|
46
|
+
: editorButtonsSearch_1.editorButtonsSearch, testData: props.testData, isFullExpression: props.isFullExpression, hideResultPreview: props.type === 'aggregatedScalar' ||
|
|
47
|
+
props.type === 'cumulativeAggregatedScalar' ||
|
|
48
|
+
props.type === 'quantileAggregatedScalar', api: props.api }));
|
|
40
49
|
}
|
|
41
50
|
exports.default = EditorInput;
|
|
@@ -12,11 +12,6 @@ exports.editorButtonsAggregatedScalar = [
|
|
|
12
12
|
data: 'PERCENTAGE()',
|
|
13
13
|
text: 'Percentage',
|
|
14
14
|
},
|
|
15
|
-
{
|
|
16
|
-
functionName: 'AVG',
|
|
17
|
-
data: 'AVG()',
|
|
18
|
-
text: 'Average',
|
|
19
|
-
},
|
|
20
15
|
{
|
|
21
16
|
functionName: 'MIN',
|
|
22
17
|
data: 'MIN()',
|
|
@@ -27,16 +22,16 @@ exports.editorButtonsAggregatedScalar = [
|
|
|
27
22
|
data: 'MAX()',
|
|
28
23
|
text: 'Max',
|
|
29
24
|
},
|
|
30
|
-
{
|
|
31
|
-
functionName: 'QUANT',
|
|
32
|
-
data: 'QUANT()',
|
|
33
|
-
text: 'Quantile',
|
|
34
|
-
},
|
|
35
25
|
{
|
|
36
26
|
functionName: 'COUNT',
|
|
37
27
|
data: 'COUNT()',
|
|
38
28
|
text: 'Count',
|
|
39
29
|
},
|
|
30
|
+
{
|
|
31
|
+
functionName: 'AVG',
|
|
32
|
+
data: 'AVG()',
|
|
33
|
+
text: 'Average',
|
|
34
|
+
},
|
|
40
35
|
{
|
|
41
36
|
functionName: 'WEIGHT',
|
|
42
37
|
data: 'WEIGHT()',
|
|
@@ -22,11 +22,6 @@ exports.editorButtonsCumulativeAggregatedScalar = [
|
|
|
22
22
|
data: 'PERCENTAGE()',
|
|
23
23
|
text: 'Percentage',
|
|
24
24
|
},
|
|
25
|
-
{
|
|
26
|
-
functionName: 'AVG',
|
|
27
|
-
data: 'AVG()',
|
|
28
|
-
text: 'Average',
|
|
29
|
-
},
|
|
30
25
|
{
|
|
31
26
|
functionName: 'MIN',
|
|
32
27
|
data: 'MIN()',
|
|
@@ -37,6 +32,11 @@ exports.editorButtonsCumulativeAggregatedScalar = [
|
|
|
37
32
|
data: 'MAX()',
|
|
38
33
|
text: 'Max',
|
|
39
34
|
},
|
|
35
|
+
{
|
|
36
|
+
functionName: 'AVG',
|
|
37
|
+
data: 'AVG()',
|
|
38
|
+
text: 'Average',
|
|
39
|
+
},
|
|
40
40
|
{
|
|
41
41
|
functionName: 'WEIGHT',
|
|
42
42
|
data: 'WEIGHT()',
|