@adaptabletools/adaptable-cjs 18.0.0-canary.25 → 18.0.0-canary.27
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/AdaptableInterfaces/IAdaptable.d.ts +1 -1
- package/src/AdaptableOptions/CommentOptions.d.ts +2 -2
- package/src/AdaptableOptions/MenuOptions.d.ts +11 -23
- package/src/AdaptableOptions/MenuOptions.js +0 -98
- package/src/Api/GridApi.d.ts +2 -1
- package/src/Api/Implementation/ActionRowApiImpl.js +3 -7
- package/src/Api/Implementation/AlertApiImpl.js +5 -10
- package/src/Api/Implementation/CalendarApiImpl.js +1 -6
- package/src/Api/Implementation/ChartingApiImpl.js +3 -3
- package/src/Api/Implementation/ColumnApiImpl.js +6 -6
- package/src/Api/Implementation/ColumnFilterApiImpl.js +7 -7
- package/src/Api/Implementation/CommentsApiImpl.js +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +11 -17
- package/src/Api/Implementation/DashboardApiImpl.js +1 -6
- package/src/Api/Implementation/ExportApiImpl.js +5 -10
- package/src/Api/Implementation/ExpressionApiImpl.js +8 -13
- package/src/Api/Implementation/Fdc3ApiImpl.js +1 -1
- package/src/Api/Implementation/FlashingCellApiImpl.js +3 -8
- package/src/Api/Implementation/FormatColumnApiImpl.js +4 -4
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +1 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +2 -1
- package/src/Api/Implementation/GridApiImpl.js +11 -8
- package/src/Api/Implementation/LayoutApiImpl.d.ts +0 -7
- package/src/Api/Implementation/LayoutApiImpl.js +0 -15
- package/src/Api/Implementation/PredicateApiImpl.js +2 -2
- package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
- package/src/Api/Implementation/ScopeApiImpl.js +10 -10
- package/src/Api/Implementation/TeamSharingApiImpl.js +3 -15
- package/src/Api/Implementation/ThemeApiImpl.js +2 -7
- package/src/Api/Implementation/UserInterfaceApiImpl.js +4 -13
- package/src/Api/Internal/ActionRowInternalApi.js +7 -45
- package/src/Api/Internal/AdaptableInternalApi.js +2 -12
- package/src/Api/Internal/AlertInternalApi.js +4 -17
- package/src/Api/Internal/CalculatedColumnInternalApi.js +7 -14
- package/src/Api/Internal/ChartingInternalApi.js +13 -13
- package/src/Api/Internal/ColumnFilterInternalApi.js +18 -36
- package/src/Api/Internal/CommentsInternalApi.d.ts +1 -1
- package/src/Api/Internal/CommentsInternalApi.js +1 -1
- package/src/Api/Internal/CustomSortInternalApi.js +1 -1
- package/src/Api/Internal/DashboardInternalApi.js +4 -10
- package/src/Api/Internal/DataImportInternalApi.js +3 -9
- package/src/Api/Internal/DataSetInternalApi.js +2 -7
- package/src/Api/Internal/ExportInternalApi.js +4 -4
- package/src/Api/Internal/ExpressionInternalApi.js +2 -12
- package/src/Api/Internal/Fdc3InternalApi.js +1 -10
- package/src/Api/Internal/FormatColumnInternalApi.js +11 -20
- package/src/Api/Internal/FreeTextColumnInternalApi.js +1 -1
- package/src/Api/Internal/GridFilterInternalApi.js +2 -8
- package/src/Api/Internal/GridInternalApi.js +13 -40
- package/src/Api/Internal/LayoutInternalApi.d.ts +1 -0
- package/src/Api/Internal/LayoutInternalApi.js +10 -19
- package/src/Api/Internal/NoteInternalApi.d.ts +1 -1
- package/src/Api/Internal/NoteInternalApi.js +1 -1
- package/src/Api/Internal/PredicateInternalApi.js +5 -40
- package/src/Api/Internal/ScheduleInternalApi.js +1 -6
- package/src/Api/Internal/StyledColumnInternalApi.js +5 -5
- package/src/Api/Internal/SystemStatusInternalApi.js +1 -7
- package/src/Api/Internal/TeamSharingInternalApi.js +2 -7
- package/src/Api/Internal/ThemeInternalApi.js +1 -1
- package/src/Api/Internal/UserInterfaceInternalApi.js +1 -1
- package/src/Api/LayoutApi.d.ts +0 -11
- package/src/PredefinedConfig/Common/CellSummary.d.ts +5 -14
- package/src/PredefinedConfig/Common/Enums.d.ts +2 -0
- package/src/PredefinedConfig/Common/Enums.js +2 -0
- package/src/PredefinedConfig/Common/Menu.d.ts +4 -4
- package/src/PredefinedConfig/Common/Menu.js +17 -18
- package/src/PredefinedConfig/Common/RowSummary.d.ts +1 -1
- package/src/PredefinedConfig/Common/RowSummary.js +4 -4
- 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 +56 -96
- 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 +2 -2
- 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 +2 -2
- package/src/Strategy/Interface/IModule.d.ts +3 -3
- package/src/Strategy/LayoutModule.d.ts +4 -4
- package/src/Strategy/LayoutModule.js +51 -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 +10 -9
- package/src/Strategy/SystemStatusModule.d.ts +2 -2
- package/src/Strategy/SystemStatusModule.js +4 -3
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +19 -19
- package/src/Utilities/Helpers/AdaptableHelper.js +3 -2
- package/src/Utilities/ObjectFactory.js +2 -0
- package/src/Utilities/Services/ModuleService.js +2 -2
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -0
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +17 -1
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +5 -5
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
- package/src/agGrid/AdaptableAgGrid.js +1 -1
- package/src/agGrid/AgGridAdapter.d.ts +1 -2
- package/src/agGrid/AgGridColumnAdapter.js +2 -2
- package/src/agGrid/AgGridMenuAdapter.d.ts +18 -8
- package/src/agGrid/AgGridMenuAdapter.js +240 -51
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +8 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -4,17 +4,17 @@ exports.summarySupportedExpressions = exports.WEIGHTED_AVERAGE_AGGREATED_FUNCTIO
|
|
|
4
4
|
exports.ROW_SUMMARY_ROW_ID = '__ROW_SUMMARY_ROW_ID';
|
|
5
5
|
exports.WEIGHTED_AVERAGE_AGGREATED_FUNCTION = 'WEIGHTED_AVERAGE';
|
|
6
6
|
exports.summarySupportedExpressions = [
|
|
7
|
-
'SUM',
|
|
8
|
-
'AVG',
|
|
9
7
|
'MIN',
|
|
10
8
|
'MAX',
|
|
9
|
+
'SUM',
|
|
10
|
+
'AVG',
|
|
11
11
|
'COUNT',
|
|
12
12
|
'MEDIAN',
|
|
13
13
|
'MODE',
|
|
14
14
|
'DISTINCT',
|
|
15
15
|
'ONLY',
|
|
16
|
-
'STD_DEVIATION',
|
|
17
16
|
'OLDEST',
|
|
18
|
-
'
|
|
17
|
+
'NEWEST',
|
|
18
|
+
'STD_DEVIATION',
|
|
19
19
|
exports.WEIGHTED_AVERAGE_AGGREATED_FUNCTION,
|
|
20
20
|
];
|
|
@@ -36,10 +36,9 @@ export declare abstract class AdaptableModuleBase implements IModule {
|
|
|
36
36
|
onAdaptableReady(): void;
|
|
37
37
|
onAdaptableStateReloaded(adaptableStateReloadedInfo: AdaptableStateReloadedInfo): void;
|
|
38
38
|
setModuleEntitlement(): void;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
39
|
+
createModuleMenuItem(source: 'ModuleMenu' | 'ModuleButton'): AdaptableMenuItem | undefined;
|
|
40
|
+
createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
41
|
+
createContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
43
42
|
createMainMenuItemShowPopup({ Name, Label, ComponentName, Icon, PopupParams, }: {
|
|
44
43
|
Name: AdaptableColumnMenuItemName | AdaptableContextMenuItemName;
|
|
45
44
|
Label: string;
|
|
@@ -75,14 +75,14 @@ class AdaptableModuleBase {
|
|
|
75
75
|
.getEntitlementService()
|
|
76
76
|
.getEntitlementAccessLevelForModule(this.moduleInfo.ModuleName);
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
createModuleMenuItem(source) {
|
|
79
79
|
if (this.isModuleAvailable() && this.moduleInfo.Popup) {
|
|
80
80
|
const moduleParams = {
|
|
81
81
|
source: source,
|
|
82
82
|
maxWidth: this.getPopupMaxWidth(),
|
|
83
83
|
};
|
|
84
84
|
return this.createMainMenuItemShowPopup({
|
|
85
|
-
Name: '
|
|
85
|
+
Name: '_navbar',
|
|
86
86
|
Label: this.moduleInfo.FriendlyName,
|
|
87
87
|
ComponentName: this.moduleInfo.Popup,
|
|
88
88
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -90,19 +90,15 @@ class AdaptableModuleBase {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
createColumnMenuItems(column) {
|
|
94
94
|
// base class implementation which is empty
|
|
95
95
|
return undefined;
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
createContextMenuItems(menuContext) {
|
|
98
98
|
// base class implementation which is empty
|
|
99
99
|
return undefined;
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
// base class implementation which is empty
|
|
103
|
-
return undefined;
|
|
104
|
-
}
|
|
105
|
-
// creates the menu items in the main dropdown
|
|
101
|
+
// creates the module menu items in the navbar
|
|
106
102
|
createMainMenuItemShowPopup({ Name, Label, ComponentName, Icon, PopupParams, }) {
|
|
107
103
|
return new MenuItem_1.MenuItemShowPopup(Name, Label, this.moduleInfo.ModuleName, ComponentName, Icon, true, PopupParams);
|
|
108
104
|
}
|
|
@@ -14,7 +14,7 @@ export declare class AlertModule extends AdaptableModuleBase implements IModule
|
|
|
14
14
|
}): AdaptableObject[];
|
|
15
15
|
getExplicitlyReferencedColumnIds(alertDefinition: AlertDefinition): string[];
|
|
16
16
|
getReferencedNamedQueryNames(alertDefinition: AlertDefinition): string[];
|
|
17
|
-
|
|
17
|
+
createContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
18
18
|
private handleCellDataChanged;
|
|
19
19
|
private handleGridDataChanged;
|
|
20
20
|
private handleReactiveAlertTriggered;
|
|
@@ -75,7 +75,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
75
75
|
}
|
|
76
76
|
return this.api.namedQueryApi.internalApi.getReferencedNamedQueryNames(queryExpression);
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
createContextMenuItems(menuContext) {
|
|
79
79
|
const items = [];
|
|
80
80
|
if (!menuContext.isRowGroupColumn && this.isModuleAvailable()) {
|
|
81
81
|
if (menuContext.adaptableColumn && menuContext.rowNode) {
|
|
@@ -6,7 +6,7 @@ import { AccessLevel, AdaptableApi } from '../types';
|
|
|
6
6
|
export declare class BulkUpdateModule extends AdaptableModuleBase implements IBulkUpdateModule {
|
|
7
7
|
constructor(api: AdaptableApi);
|
|
8
8
|
getViewAccessLevel(): AccessLevel;
|
|
9
|
-
|
|
9
|
+
createContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
10
10
|
checkCorrectCellSelection(): BulkUpdateValidationResult;
|
|
11
11
|
buildPreviewValues(bulkUpdateValue: any): PreviewInfo;
|
|
12
12
|
}
|
|
@@ -15,7 +15,7 @@ class BulkUpdateModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
15
15
|
getViewAccessLevel() {
|
|
16
16
|
return 'Full';
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
createContextMenuItems(menuContext) {
|
|
19
19
|
let menuItemShowPopup = undefined;
|
|
20
20
|
if (!menuContext.isRowGroupColumn && this.isModuleEditable()) {
|
|
21
21
|
if (menuContext.adaptableColumn &&
|
|
@@ -26,7 +26,8 @@ class BulkUpdateModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
26
26
|
let popUpParams = {
|
|
27
27
|
source: 'ContextMenu',
|
|
28
28
|
};
|
|
29
|
-
menuItemShowPopup = this.createMainMenuItemShowPopup({
|
|
29
|
+
menuItemShowPopup = this.createMainMenuItemShowPopup({
|
|
30
|
+
Name: 'bulk-update-apply',
|
|
30
31
|
Label: 'Apply Bulk Update',
|
|
31
32
|
ComponentName: this.moduleInfo.Popup,
|
|
32
33
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -16,8 +16,8 @@ export declare class CalculatedColumnModule extends AdaptableModuleBase implemen
|
|
|
16
16
|
getExplicitlyReferencedColumnIds(calculatedColumn: CalculatedColumn): string[];
|
|
17
17
|
getReferencedNamedQueryNames(calculatedColumn: CalculatedColumn): string[];
|
|
18
18
|
private isCalculatedColumn;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
20
|
+
createContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
21
21
|
createEditCalculatedColumnMenuItem(column: AdaptableColumn): AdaptableMenuItem[];
|
|
22
22
|
getTeamSharingAction(): TeamSharingImportInfo<CalculatedColumn>;
|
|
23
23
|
toView(calculateColumn: CalculatedColumn): {
|
|
@@ -38,12 +38,12 @@ class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
38
38
|
.getCalculatedColumns()
|
|
39
39
|
.find((cc) => cc.ColumnId == column.columnId)));
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
createColumnMenuItems(column) {
|
|
42
42
|
if (this.isModuleEditable() && this.isCalculatedColumn(column)) {
|
|
43
43
|
return this.createEditCalculatedColumnMenuItem(column);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
createContextMenuItems(menuContext) {
|
|
47
47
|
if (!this.isModuleAvailable()) {
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
@@ -11,8 +11,8 @@ export declare class CellSummaryModule extends AdaptableModuleBase implements IC
|
|
|
11
11
|
cachedCellSummary: WeakMap<SelectedCellInfo<any>, CellSummmary>;
|
|
12
12
|
constructor(api: AdaptableApi);
|
|
13
13
|
getViewAccessLevel(): AccessLevel;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
15
|
+
createContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
16
16
|
private createCellSummaryMenuItem;
|
|
17
17
|
createCellSummary(selectedCellInfo: SelectedCellInfo): CellSummmary;
|
|
18
18
|
private getWeightedAverageCellSummary;
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
6
6
|
const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
|
|
7
7
|
const Helper_1 = require("../Utilities/Helpers/Helper");
|
|
8
|
+
const ObjectFactory_1 = tslib_1.__importDefault(require("../Utilities/ObjectFactory"));
|
|
8
9
|
const AggregatedScalarLiveValue_1 = require("../Utilities/Services/AggregatedScalarLiveValue");
|
|
9
10
|
const CellSummaryStatusPanel_1 = require("../View/CellSummary/CellSummaryStatusPanel");
|
|
10
11
|
const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
|
|
@@ -16,7 +17,7 @@ class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
16
17
|
getViewAccessLevel() {
|
|
17
18
|
return 'Full';
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
createColumnMenuItems(column) {
|
|
20
21
|
if (!this.isModuleAvailable()) {
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
@@ -27,7 +28,7 @@ class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
27
28
|
}),
|
|
28
29
|
];
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
+
createContextMenuItems(menuContext) {
|
|
31
32
|
if (!this.isModuleAvailable()) {
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
@@ -52,104 +53,63 @@ class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
52
53
|
if (this.cachedCellSummary.has(selectedCellInfo)) {
|
|
53
54
|
return this.cachedCellSummary.get(selectedCellInfo);
|
|
54
55
|
}
|
|
55
|
-
let selectedCellSummary;
|
|
56
|
-
if (selectedCellInfo && ArrayExtensions_1.ArrayExtensions.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// GridCell.column may be undefined for cells from synthetic columns created by AG Grid (ex. autoGroup columns)
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (ArrayExtensions_1.ArrayExtensions.ContainsItem(numericColumns, selectedCell.column.columnId)) {
|
|
73
|
-
let valueAsNumber = Number(value);
|
|
74
|
-
// possible that its not a number despite it being a numeric column
|
|
75
|
-
if (!isNaN(Number(valueAsNumber))) {
|
|
76
|
-
numericValues.push(valueAsNumber);
|
|
56
|
+
let selectedCellSummary = ObjectFactory_1.default.CreateEmptyCellSummmary();
|
|
57
|
+
if (selectedCellInfo && ArrayExtensions_1.ArrayExtensions.GetLength(selectedCellInfo.columns) === 1) {
|
|
58
|
+
const selectedColumn = selectedCellInfo.columns[0];
|
|
59
|
+
if (selectedColumn) {
|
|
60
|
+
const isNumericColumn = selectedColumn.dataType === 'Number';
|
|
61
|
+
const isDateColumn = selectedColumn.dataType === 'Date';
|
|
62
|
+
const rowNodes = selectedCellInfo.gridCells.map((gc) => gc.rowNode);
|
|
63
|
+
const handleExpression = (functionName) => {
|
|
64
|
+
const aggScalarValue = new AggregatedScalarLiveValue_1.AggregatedScalarLiveValue({
|
|
65
|
+
aggregatedScalarExpression: `${functionName}([${selectedColumn.columnId}])`,
|
|
66
|
+
}, ModuleConstants.CellSummaryModuleId, this.api, () => rowNodes);
|
|
67
|
+
let value = aggScalarValue.getGlobalAggregatedValue();
|
|
68
|
+
if (typeof value === 'number' && !isNaN(value)) {
|
|
69
|
+
value = Helper_1.Helper.roundNumber(value, 2);
|
|
77
70
|
}
|
|
78
|
-
|
|
79
|
-
});
|
|
80
|
-
// copying so that we keep the order - needed for others
|
|
81
|
-
const newNumericValues = [...numericValues];
|
|
82
|
-
let hasNumericColumns = numericValues.length > 0;
|
|
83
|
-
if (selectedCellInfo.columns.length > 1) {
|
|
84
|
-
return {
|
|
85
|
-
Sum: null,
|
|
86
|
-
Average: null,
|
|
87
|
-
Median: null,
|
|
88
|
-
Mode: null,
|
|
89
|
-
Distinct: null,
|
|
90
|
-
Max: null,
|
|
91
|
-
Min: null,
|
|
92
|
-
Count: null,
|
|
93
|
-
Std_Deviation: null,
|
|
94
|
-
Only: '',
|
|
71
|
+
return value;
|
|
95
72
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
73
|
+
const sumValue = isNumericColumn ? handleExpression('SUM') : null;
|
|
74
|
+
const avgValue = isNumericColumn ? Helper_1.Helper.roundNumber(handleExpression('AVG'), 2) : null;
|
|
75
|
+
const modeValue = isNumericColumn ? handleExpression('MODE') : null;
|
|
76
|
+
const medianValue = isNumericColumn ? handleExpression('MEDIAN') : null;
|
|
77
|
+
const distinctValue = handleExpression('DISTINCT');
|
|
78
|
+
const maxValue = isNumericColumn ? handleExpression('MAX') : null;
|
|
79
|
+
const minValue = isNumericColumn ? handleExpression('MIN') : null;
|
|
80
|
+
const oldestValue = isDateColumn ? handleExpression('OLDEST') : null;
|
|
81
|
+
const newestValue = isDateColumn ? handleExpression('NEWEST') : null;
|
|
82
|
+
const stdDeviation = isNumericColumn
|
|
83
|
+
? Helper_1.Helper.roundNumberTo4dp(handleExpression('STD_DEVIATION'))
|
|
84
|
+
: null;
|
|
85
|
+
selectedCellSummary = {
|
|
86
|
+
Sum: sumValue,
|
|
87
|
+
Average: avgValue,
|
|
88
|
+
Median: medianValue,
|
|
89
|
+
Mode: modeValue,
|
|
90
|
+
Distinct: distinctValue,
|
|
91
|
+
Max: maxValue,
|
|
92
|
+
Min: minValue,
|
|
93
|
+
Count: selectedCellInfo.gridCells.length,
|
|
94
|
+
Oldest: oldestValue,
|
|
95
|
+
Newest: newestValue,
|
|
96
|
+
Std_Deviation: stdDeviation,
|
|
97
|
+
Only: distinctValue == 1 ? JSON.stringify(selectedCellInfo.gridCells[0].rawValue) : '',
|
|
98
|
+
};
|
|
99
|
+
const weightedAverage = this.getWeightedAverageCellSummary(selectedColumn.columnId, rowNodes);
|
|
100
|
+
if (weightedAverage !== null) {
|
|
101
|
+
selectedCellSummary.Weighted_Average = weightedAverage;
|
|
106
102
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const stdDeviation = hasNumericColumns
|
|
117
|
-
? Helper_1.Helper.roundNumberTo4dp(handleExpression('STD_DEVIATION'))
|
|
118
|
-
: null;
|
|
119
|
-
selectedCellSummary = {
|
|
120
|
-
Sum: sumValue,
|
|
121
|
-
Average: avgValue,
|
|
122
|
-
Median: medianValue,
|
|
123
|
-
Mode: modeValue,
|
|
124
|
-
Distinct: distinctValue,
|
|
125
|
-
Max: maxValue,
|
|
126
|
-
Min: minValue,
|
|
127
|
-
Count: allValues.length,
|
|
128
|
-
Std_Deviation: stdDeviation,
|
|
129
|
-
Only: distinctValue == 1 ? JSON.stringify(allValues[0]) : '',
|
|
130
|
-
};
|
|
131
|
-
numericValues = [...newNumericValues];
|
|
132
|
-
const weightedAverage = this.getWeightedAverageCellSummary(columnId, rowNodes);
|
|
133
|
-
if (weightedAverage !== null) {
|
|
134
|
-
selectedCellSummary.Weighted_Average = weightedAverage;
|
|
103
|
+
const operationDefinitions = this.api.cellSummaryApi.getCellSummaryOperationDefinitions();
|
|
104
|
+
operationDefinitions === null || operationDefinitions === void 0 ? void 0 : operationDefinitions.forEach((operation) => {
|
|
105
|
+
if (operation.operationFunction) {
|
|
106
|
+
const cellSummaryOperationContext = Object.assign({ selectedCellInfo,
|
|
107
|
+
selectedColumn }, this.api.internalApi.buildBaseContext());
|
|
108
|
+
selectedCellSummary[operation.operationName] = operation.operationFunction(cellSummaryOperationContext);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
this.cachedCellSummary.set(selectedCellInfo, selectedCellSummary);
|
|
135
112
|
}
|
|
136
|
-
const operationDefinitions = this.api.cellSummaryApi.getCellSummaryOperationDefinitions();
|
|
137
|
-
operationDefinitions === null || operationDefinitions === void 0 ? void 0 : operationDefinitions.forEach((operation) => {
|
|
138
|
-
if (operation.operationFunction) {
|
|
139
|
-
const cellSummaryOperationContext = {
|
|
140
|
-
selectedCellInfo,
|
|
141
|
-
distinctCount: distinctValue,
|
|
142
|
-
allValues,
|
|
143
|
-
numericValues,
|
|
144
|
-
numericColumns,
|
|
145
|
-
adaptableApi: this.api,
|
|
146
|
-
userName: this.api.optionsApi.getUserName(),
|
|
147
|
-
adaptableId: this.api.optionsApi.getAdaptableId(),
|
|
148
|
-
};
|
|
149
|
-
selectedCellSummary[operation.operationName] = operation.operationFunction(cellSummaryOperationContext);
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
this.cachedCellSummary.set(selectedCellInfo, selectedCellSummary);
|
|
153
113
|
}
|
|
154
114
|
return selectedCellSummary;
|
|
155
115
|
}
|
|
@@ -13,8 +13,8 @@ export declare class ColumnFilterModule extends AdaptableModuleBase implements I
|
|
|
13
13
|
getExplicitlyReferencedColumnIds(columnFilter: ColumnFilter): string[];
|
|
14
14
|
hasNamedQueryReferences(): boolean;
|
|
15
15
|
onAdaptableReady(): void;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
17
|
+
createContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
18
18
|
private getExistingColumnFilter;
|
|
19
19
|
getTeamSharingAction(): TeamSharingImportInfo<ColumnFilter>;
|
|
20
20
|
toViewCompact(filter: ColumnFilter): AdaptableObjectCompactView;
|
|
@@ -4,7 +4,6 @@ exports.ColumnFilterModule = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
|
|
6
6
|
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
7
|
-
const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
|
|
8
7
|
const LayoutRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/LayoutRedux"));
|
|
9
8
|
const SystemRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/SystemRedux"));
|
|
10
9
|
const FilterStatusBarSubPanelPopover_1 = require("../View/Filter/FilterStatusBarSubPanelPopover");
|
|
@@ -43,8 +42,8 @@ class ColumnFilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
43
42
|
}
|
|
44
43
|
});
|
|
45
44
|
}
|
|
46
|
-
|
|
47
|
-
let
|
|
45
|
+
createColumnMenuItems(column) {
|
|
46
|
+
let columnFilterMenuItems = [];
|
|
48
47
|
if (column &&
|
|
49
48
|
column.filterable &&
|
|
50
49
|
this.api.optionsApi.getColumnFilterOptions().useAdaptableColumnFiltering) {
|
|
@@ -52,35 +51,22 @@ class ColumnFilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
52
51
|
const isFilterVisible = this.api.columnFilterApi.isQuickFilterVisible();
|
|
53
52
|
if (this.isModuleEditable() &&
|
|
54
53
|
this.api.optionsApi.getColumnFilterOptions().useAdaptableColumnFiltering) {
|
|
55
|
-
|
|
54
|
+
columnFilterMenuItems.push(this.createMenuItemReduxAction(isFilterVisible ? 'column-filter-bar-hide' : 'column-filter-bar-show', isFilterVisible ? 'Hide Filter Bar' : 'Show Filter Bar', isFilterVisible ? 'unchecked' : 'check', isFilterVisible
|
|
56
55
|
? SystemRedux.SystemQuickFilterBarHide()
|
|
57
56
|
: SystemRedux.SystemQuickFilterBarShow()));
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
const existingColumnFilter = this.getExistingColumnFilter(column);
|
|
61
60
|
if (existingColumnFilter) {
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
columnFilterMenuItems.push(this.createMenuItemReduxAction('column-filter-clear', 'Clear Filter', 'close', LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)));
|
|
62
|
+
columnFilterMenuItems.push(this.createMenuItemReduxAction(existingColumnFilter.IsSuspended ? 'column-filter-unsuspend' : 'column-filter-suspend', existingColumnFilter.IsSuspended ? 'Unsuspend Filter' : 'Suspend Filter', existingColumnFilter.IsSuspended ? 'resume' : 'pause', existingColumnFilter.IsSuspended
|
|
64
63
|
? LayoutRedux.LayoutColumnFilterUnSuspend(existingColumnFilter)
|
|
65
64
|
: LayoutRedux.LayoutColumnFilterSuspend(existingColumnFilter)));
|
|
66
65
|
}
|
|
67
|
-
|
|
68
|
-
return [
|
|
69
|
-
{
|
|
70
|
-
name: 'column-filter-parent',
|
|
71
|
-
label: this.moduleInfo.FriendlyName,
|
|
72
|
-
isVisible: true,
|
|
73
|
-
module: this.moduleInfo.ModuleName,
|
|
74
|
-
icon: {
|
|
75
|
-
name: this.moduleInfo.Glyph,
|
|
76
|
-
},
|
|
77
|
-
subItems: filterSubMenuItems,
|
|
78
|
-
},
|
|
79
|
-
];
|
|
80
|
-
}
|
|
66
|
+
return columnFilterMenuItems;
|
|
81
67
|
}
|
|
82
68
|
}
|
|
83
|
-
|
|
69
|
+
createContextMenuItems(menuContext) {
|
|
84
70
|
if (!menuContext.isRowGroupColumn && this.isModuleAvailable()) {
|
|
85
71
|
if (menuContext.adaptableColumn &&
|
|
86
72
|
menuContext.adaptableColumn.filterable &&
|
|
@@ -102,28 +88,17 @@ class ColumnFilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
102
88
|
];
|
|
103
89
|
}
|
|
104
90
|
else {
|
|
105
|
-
let filterSubMenuItems = [];
|
|
106
|
-
filterSubMenuItems.push(this.createMenuItemReduxAction('column-filter-clear', 'Clear Filter', 'close', LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)));
|
|
107
|
-
filterSubMenuItems.push(this.createMenuItemClickFunction(existingColumnFilter.IsSuspended
|
|
108
|
-
? 'column-filter-unsuspend'
|
|
109
|
-
: 'column-filter-suspend', existingColumnFilter.IsSuspended ? 'Unsuspend Filter' : 'Suspend Filter', existingColumnFilter.IsSuspended ? 'resume' : 'pause', existingColumnFilter.IsSuspended
|
|
110
|
-
? () => {
|
|
111
|
-
this.api.columnFilterApi.unSuspendColumnFilter(existingColumnFilter);
|
|
112
|
-
}
|
|
113
|
-
: () => {
|
|
114
|
-
this.api.columnFilterApi.suspendColumnFilter(existingColumnFilter);
|
|
115
|
-
}));
|
|
116
91
|
return [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
92
|
+
this.createMenuItemReduxAction('column-filter-clear', 'Clear Filter', 'close', LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)),
|
|
93
|
+
this.createMenuItemClickFunction(existingColumnFilter.IsSuspended
|
|
94
|
+
? 'column-filter-unsuspend'
|
|
95
|
+
: 'column-filter-suspend', existingColumnFilter.IsSuspended ? 'Unsuspend Filter' : 'Suspend Filter', existingColumnFilter.IsSuspended ? 'resume' : 'pause', existingColumnFilter.IsSuspended
|
|
96
|
+
? () => {
|
|
97
|
+
this.api.columnFilterApi.unSuspendColumnFilter(existingColumnFilter);
|
|
98
|
+
}
|
|
99
|
+
: () => {
|
|
100
|
+
this.api.columnFilterApi.suspendColumnFilter(existingColumnFilter);
|
|
101
|
+
}),
|
|
127
102
|
];
|
|
128
103
|
}
|
|
129
104
|
}
|
|
@@ -6,6 +6,6 @@ import { AdaptableColumn, AdaptableMenuItem, ContextMenuContext } from '../types
|
|
|
6
6
|
export declare class ColumnInfoModule extends AdaptableModuleBase implements IModule {
|
|
7
7
|
constructor(api: AdaptableApi);
|
|
8
8
|
getViewAccessLevel(): AccessLevel;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
10
|
+
createContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
11
11
|
}
|
|
@@ -11,7 +11,7 @@ class ColumnInfoModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
11
11
|
getViewAccessLevel() {
|
|
12
12
|
return 'Full';
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
createColumnMenuItems(column) {
|
|
15
15
|
if (this.isModuleAvailable()) {
|
|
16
16
|
const columnPopUpParams = {
|
|
17
17
|
source: 'ColumnMenu',
|
|
@@ -28,7 +28,7 @@ class ColumnInfoModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
28
28
|
];
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
createContextMenuItems(menuContext) {
|
|
32
32
|
if (this.isModuleAvailable()) {
|
|
33
33
|
const columnPopUpParams = {
|
|
34
34
|
source: 'ColumnMenu',
|
|
@@ -7,6 +7,5 @@ export declare class CommentModule extends AdaptableModuleBase implements IModul
|
|
|
7
7
|
onAdaptableReady(): void;
|
|
8
8
|
isModuleAvailable(): boolean;
|
|
9
9
|
private loadComments;
|
|
10
|
-
|
|
11
|
-
private getAddRemoveCommentsMenuItems;
|
|
10
|
+
createContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
12
11
|
}
|
|
@@ -28,49 +28,48 @@ class CommentModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
28
28
|
.getCommentOptions()) === null || _a === void 0 ? void 0 : _a.loadCommentThreads) === null || _b === void 0 ? void 0 : _b.call(_a, (0, ObjectFactory_1.createBaseContext)(this.api)));
|
|
29
29
|
this.api.commentApi.setGridComments(commentThreads);
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
var _a, _b;
|
|
31
|
+
createContextMenuItems(menuContext) {
|
|
32
|
+
var _a, _b, _c, _d, _e;
|
|
33
33
|
if (!this.isModuleAvailable()) {
|
|
34
|
-
return
|
|
34
|
+
return;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (!isCellCommentable ||
|
|
39
|
-
isCellCommentable(Object.assign({ gridCell: menuContext.gridCell }, (0, ObjectFactory_1.createBaseContext)(this.api)))) {
|
|
40
|
-
items.push(...this.getAddRemoveCommentsMenuItems(menuContext));
|
|
36
|
+
if (!this.api.commentApi.internalApi.areCommentsSupported()) {
|
|
37
|
+
return;
|
|
41
38
|
}
|
|
42
|
-
return items;
|
|
43
|
-
}
|
|
44
|
-
getAddRemoveCommentsMenuItems(menuContext) {
|
|
45
|
-
var _a;
|
|
46
39
|
const items = [];
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
const isCellCommentable = typeof ((_b = (_a = this.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getCommentOptions()) === null || _b === void 0 ? void 0 : _b.isCellCommentable) === 'function'
|
|
41
|
+
? (_d = (_c = this.api.optionsApi) === null || _c === void 0 ? void 0 : _c.getCommentOptions()) === null || _d === void 0 ? void 0 : _d.isCellCommentable(Object.assign({ gridCell: menuContext.gridCell }, (0, ObjectFactory_1.createBaseContext)(this.api)))
|
|
42
|
+
: true;
|
|
43
|
+
if (!isCellCommentable) {
|
|
44
|
+
return;
|
|
49
45
|
}
|
|
50
46
|
const cellAddress = {
|
|
51
47
|
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
52
48
|
ColumnId: menuContext.adaptableColumn.columnId,
|
|
53
49
|
};
|
|
54
|
-
const cellComments = (
|
|
50
|
+
const cellComments = (_e = this.api.commentApi.getCommentThread(cellAddress)) === null || _e === void 0 ? void 0 : _e.Comments;
|
|
55
51
|
if (cellComments) {
|
|
56
|
-
|
|
57
|
-
this.
|
|
58
|
-
|
|
52
|
+
return [
|
|
53
|
+
this.createMenuItemClickFunction('comment-remove', 'Remove Comment', this.moduleInfo.Glyph, () => {
|
|
54
|
+
this.api.commentApi.deleteCommentThread(cellAddress);
|
|
55
|
+
}),
|
|
56
|
+
];
|
|
59
57
|
}
|
|
60
58
|
else {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
59
|
+
return [
|
|
60
|
+
this.createMenuItemClickFunction('comment-add', 'Add Comment', this.moduleInfo.Glyph, () => {
|
|
61
|
+
// add an empty one
|
|
62
|
+
this.api.commentApi.addCommentThread(Object.assign(Object.assign({}, cellAddress), { Comments: [] }));
|
|
63
|
+
requestAnimationFrame(() => {
|
|
64
|
+
this.api.internalApi.getCellPopupService().showPopup({
|
|
65
|
+
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
66
|
+
ColumnId: menuContext.adaptableColumn.columnId,
|
|
67
|
+
}, true);
|
|
68
|
+
this.api.internalApi.getCellPopupService().editFocusedEntity('Comment');
|
|
69
|
+
});
|
|
70
|
+
}),
|
|
71
|
+
];
|
|
72
72
|
}
|
|
73
|
-
return items;
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
exports.CommentModule = CommentModule;
|
|
@@ -15,7 +15,7 @@ export declare class CustomSortModule extends AdaptableModuleBase implements IMo
|
|
|
15
15
|
}): AdaptableObject[];
|
|
16
16
|
getExplicitlyReferencedColumnIds(customSort: CustomSort): string[];
|
|
17
17
|
hasNamedQueryReferences(): boolean;
|
|
18
|
-
|
|
18
|
+
createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
19
19
|
getTeamSharingAction(): TeamSharingImportInfo<CustomSort>;
|
|
20
20
|
toView(customSort: CustomSort): AdaptableObjectView;
|
|
21
21
|
toViewAll(): AdaptableObjectView[];
|
|
@@ -22,7 +22,7 @@ class CustomSortModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
22
22
|
hasNamedQueryReferences() {
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
createColumnMenuItems(column) {
|
|
26
26
|
if (column && this.isModuleEditable() && column.sortable) {
|
|
27
27
|
let customSort = this.api.customSortApi
|
|
28
28
|
.getCustomSorts()
|
|
@@ -5,7 +5,7 @@ import { AdaptableApi } from '../Api/AdaptableApi';
|
|
|
5
5
|
export declare class DashboardModule extends AdaptableModuleBase implements IModule {
|
|
6
6
|
constructor(api: AdaptableApi);
|
|
7
7
|
onAdaptableReady(): void;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
createColumnMenuItems(): AdaptableMenuItem[] | undefined;
|
|
9
|
+
createContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
10
10
|
private buildMenuItems;
|
|
11
11
|
}
|