@adaptabletools/adaptable 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 +1 -96
- 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.esm.tsbuildinfo +1 -1
|
@@ -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;
|
|
@@ -71,14 +71,14 @@ export class AdaptableModuleBase {
|
|
|
71
71
|
.getEntitlementService()
|
|
72
72
|
.getEntitlementAccessLevelForModule(this.moduleInfo.ModuleName);
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
createModuleMenuItem(source) {
|
|
75
75
|
if (this.isModuleAvailable() && this.moduleInfo.Popup) {
|
|
76
76
|
const moduleParams = {
|
|
77
77
|
source: source,
|
|
78
78
|
maxWidth: this.getPopupMaxWidth(),
|
|
79
79
|
};
|
|
80
80
|
return this.createMainMenuItemShowPopup({
|
|
81
|
-
Name: '
|
|
81
|
+
Name: '_navbar',
|
|
82
82
|
Label: this.moduleInfo.FriendlyName,
|
|
83
83
|
ComponentName: this.moduleInfo.Popup,
|
|
84
84
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -86,19 +86,15 @@ export class AdaptableModuleBase {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
createColumnMenuItems(column) {
|
|
90
90
|
// base class implementation which is empty
|
|
91
91
|
return undefined;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
createContextMenuItems(menuContext) {
|
|
94
94
|
// base class implementation which is empty
|
|
95
95
|
return undefined;
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
// base class implementation which is empty
|
|
99
|
-
return undefined;
|
|
100
|
-
}
|
|
101
|
-
// creates the menu items in the main dropdown
|
|
97
|
+
// creates the module menu items in the navbar
|
|
102
98
|
createMainMenuItemShowPopup({ Name, Label, ComponentName, Icon, PopupParams, }) {
|
|
103
99
|
return new MenuItemShowPopup(Name, Label, this.moduleInfo.ModuleName, ComponentName, Icon, true, PopupParams);
|
|
104
100
|
}
|
|
@@ -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;
|
|
@@ -71,7 +71,7 @@ export class AlertModule extends AdaptableModuleBase {
|
|
|
71
71
|
}
|
|
72
72
|
return this.api.namedQueryApi.internalApi.getReferencedNamedQueryNames(queryExpression);
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
createContextMenuItems(menuContext) {
|
|
75
75
|
const items = [];
|
|
76
76
|
if (!menuContext.isRowGroupColumn && this.isModuleAvailable()) {
|
|
77
77
|
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
|
}
|
|
@@ -11,7 +11,7 @@ export class BulkUpdateModule extends AdaptableModuleBase {
|
|
|
11
11
|
getViewAccessLevel() {
|
|
12
12
|
return 'Full';
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
createContextMenuItems(menuContext) {
|
|
15
15
|
let menuItemShowPopup = undefined;
|
|
16
16
|
if (!menuContext.isRowGroupColumn && this.isModuleEditable()) {
|
|
17
17
|
if (menuContext.adaptableColumn &&
|
|
@@ -22,7 +22,8 @@ export class BulkUpdateModule extends AdaptableModuleBase {
|
|
|
22
22
|
let popUpParams = {
|
|
23
23
|
source: 'ContextMenu',
|
|
24
24
|
};
|
|
25
|
-
menuItemShowPopup = this.createMainMenuItemShowPopup({
|
|
25
|
+
menuItemShowPopup = this.createMainMenuItemShowPopup({
|
|
26
|
+
Name: 'bulk-update-apply',
|
|
26
27
|
Label: 'Apply Bulk Update',
|
|
27
28
|
ComponentName: this.moduleInfo.Popup,
|
|
28
29
|
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): {
|
|
@@ -34,12 +34,12 @@ export class CalculatedColumnModule extends AdaptableModuleBase {
|
|
|
34
34
|
.getCalculatedColumns()
|
|
35
35
|
.find((cc) => cc.ColumnId == column.columnId)));
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
createColumnMenuItems(column) {
|
|
38
38
|
if (this.isModuleEditable() && this.isCalculatedColumn(column)) {
|
|
39
39
|
return this.createEditCalculatedColumnMenuItem(column);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
createContextMenuItems(menuContext) {
|
|
43
43
|
if (!this.isModuleAvailable()) {
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
@@ -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;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
|
|
2
2
|
import { ArrayExtensions } from '../Utilities/Extensions/ArrayExtensions';
|
|
3
3
|
import { Helper } from '../Utilities/Helpers/Helper';
|
|
4
|
+
import ObjectFactory from '../Utilities/ObjectFactory';
|
|
4
5
|
import { AggregatedScalarLiveValue } from '../Utilities/Services/AggregatedScalarLiveValue';
|
|
5
6
|
import { CellSummaryStatusPanel } from '../View/CellSummary/CellSummaryStatusPanel';
|
|
6
7
|
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
@@ -12,7 +13,7 @@ export class CellSummaryModule extends AdaptableModuleBase {
|
|
|
12
13
|
getViewAccessLevel() {
|
|
13
14
|
return 'Full';
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
+
createColumnMenuItems(column) {
|
|
16
17
|
if (!this.isModuleAvailable()) {
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
@@ -23,7 +24,7 @@ export class CellSummaryModule extends AdaptableModuleBase {
|
|
|
23
24
|
}),
|
|
24
25
|
];
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
+
createContextMenuItems(menuContext) {
|
|
27
28
|
if (!this.isModuleAvailable()) {
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
@@ -48,104 +49,63 @@ export class CellSummaryModule extends AdaptableModuleBase {
|
|
|
48
49
|
if (this.cachedCellSummary.has(selectedCellInfo)) {
|
|
49
50
|
return this.cachedCellSummary.get(selectedCellInfo);
|
|
50
51
|
}
|
|
51
|
-
let selectedCellSummary;
|
|
52
|
-
if (selectedCellInfo && ArrayExtensions.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// GridCell.column may be undefined for cells from synthetic columns created by AG Grid (ex. autoGroup columns)
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
if (ArrayExtensions.ContainsItem(numericColumns, selectedCell.column.columnId)) {
|
|
69
|
-
let valueAsNumber = Number(value);
|
|
70
|
-
// possible that its not a number despite it being a numeric column
|
|
71
|
-
if (!isNaN(Number(valueAsNumber))) {
|
|
72
|
-
numericValues.push(valueAsNumber);
|
|
52
|
+
let selectedCellSummary = ObjectFactory.CreateEmptyCellSummmary();
|
|
53
|
+
if (selectedCellInfo && ArrayExtensions.GetLength(selectedCellInfo.columns) === 1) {
|
|
54
|
+
const selectedColumn = selectedCellInfo.columns[0];
|
|
55
|
+
if (selectedColumn) {
|
|
56
|
+
const isNumericColumn = selectedColumn.dataType === 'Number';
|
|
57
|
+
const isDateColumn = selectedColumn.dataType === 'Date';
|
|
58
|
+
const rowNodes = selectedCellInfo.gridCells.map((gc) => gc.rowNode);
|
|
59
|
+
const handleExpression = (functionName) => {
|
|
60
|
+
const aggScalarValue = new AggregatedScalarLiveValue({
|
|
61
|
+
aggregatedScalarExpression: `${functionName}([${selectedColumn.columnId}])`,
|
|
62
|
+
}, ModuleConstants.CellSummaryModuleId, this.api, () => rowNodes);
|
|
63
|
+
let value = aggScalarValue.getGlobalAggregatedValue();
|
|
64
|
+
if (typeof value === 'number' && !isNaN(value)) {
|
|
65
|
+
value = Helper.roundNumber(value, 2);
|
|
73
66
|
}
|
|
74
|
-
|
|
75
|
-
});
|
|
76
|
-
// copying so that we keep the order - needed for others
|
|
77
|
-
const newNumericValues = [...numericValues];
|
|
78
|
-
let hasNumericColumns = numericValues.length > 0;
|
|
79
|
-
if (selectedCellInfo.columns.length > 1) {
|
|
80
|
-
return {
|
|
81
|
-
Sum: null,
|
|
82
|
-
Average: null,
|
|
83
|
-
Median: null,
|
|
84
|
-
Mode: null,
|
|
85
|
-
Distinct: null,
|
|
86
|
-
Max: null,
|
|
87
|
-
Min: null,
|
|
88
|
-
Count: null,
|
|
89
|
-
Std_Deviation: null,
|
|
90
|
-
Only: '',
|
|
67
|
+
return value;
|
|
91
68
|
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
69
|
+
const sumValue = isNumericColumn ? handleExpression('SUM') : null;
|
|
70
|
+
const avgValue = isNumericColumn ? Helper.roundNumber(handleExpression('AVG'), 2) : null;
|
|
71
|
+
const modeValue = isNumericColumn ? handleExpression('MODE') : null;
|
|
72
|
+
const medianValue = isNumericColumn ? handleExpression('MEDIAN') : null;
|
|
73
|
+
const distinctValue = handleExpression('DISTINCT');
|
|
74
|
+
const maxValue = isNumericColumn ? handleExpression('MAX') : null;
|
|
75
|
+
const minValue = isNumericColumn ? handleExpression('MIN') : null;
|
|
76
|
+
const oldestValue = isDateColumn ? handleExpression('OLDEST') : null;
|
|
77
|
+
const newestValue = isDateColumn ? handleExpression('NEWEST') : null;
|
|
78
|
+
const stdDeviation = isNumericColumn
|
|
79
|
+
? Helper.roundNumberTo4dp(handleExpression('STD_DEVIATION'))
|
|
80
|
+
: null;
|
|
81
|
+
selectedCellSummary = {
|
|
82
|
+
Sum: sumValue,
|
|
83
|
+
Average: avgValue,
|
|
84
|
+
Median: medianValue,
|
|
85
|
+
Mode: modeValue,
|
|
86
|
+
Distinct: distinctValue,
|
|
87
|
+
Max: maxValue,
|
|
88
|
+
Min: minValue,
|
|
89
|
+
Count: selectedCellInfo.gridCells.length,
|
|
90
|
+
Oldest: oldestValue,
|
|
91
|
+
Newest: newestValue,
|
|
92
|
+
Std_Deviation: stdDeviation,
|
|
93
|
+
Only: distinctValue == 1 ? JSON.stringify(selectedCellInfo.gridCells[0].rawValue) : '',
|
|
94
|
+
};
|
|
95
|
+
const weightedAverage = this.getWeightedAverageCellSummary(selectedColumn.columnId, rowNodes);
|
|
96
|
+
if (weightedAverage !== null) {
|
|
97
|
+
selectedCellSummary.Weighted_Average = weightedAverage;
|
|
102
98
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const stdDeviation = hasNumericColumns
|
|
113
|
-
? Helper.roundNumberTo4dp(handleExpression('STD_DEVIATION'))
|
|
114
|
-
: null;
|
|
115
|
-
selectedCellSummary = {
|
|
116
|
-
Sum: sumValue,
|
|
117
|
-
Average: avgValue,
|
|
118
|
-
Median: medianValue,
|
|
119
|
-
Mode: modeValue,
|
|
120
|
-
Distinct: distinctValue,
|
|
121
|
-
Max: maxValue,
|
|
122
|
-
Min: minValue,
|
|
123
|
-
Count: allValues.length,
|
|
124
|
-
Std_Deviation: stdDeviation,
|
|
125
|
-
Only: distinctValue == 1 ? JSON.stringify(allValues[0]) : '',
|
|
126
|
-
};
|
|
127
|
-
numericValues = [...newNumericValues];
|
|
128
|
-
const weightedAverage = this.getWeightedAverageCellSummary(columnId, rowNodes);
|
|
129
|
-
if (weightedAverage !== null) {
|
|
130
|
-
selectedCellSummary.Weighted_Average = weightedAverage;
|
|
99
|
+
const operationDefinitions = this.api.cellSummaryApi.getCellSummaryOperationDefinitions();
|
|
100
|
+
operationDefinitions === null || operationDefinitions === void 0 ? void 0 : operationDefinitions.forEach((operation) => {
|
|
101
|
+
if (operation.operationFunction) {
|
|
102
|
+
const cellSummaryOperationContext = Object.assign({ selectedCellInfo,
|
|
103
|
+
selectedColumn }, this.api.internalApi.buildBaseContext());
|
|
104
|
+
selectedCellSummary[operation.operationName] = operation.operationFunction(cellSummaryOperationContext);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
this.cachedCellSummary.set(selectedCellInfo, selectedCellSummary);
|
|
131
108
|
}
|
|
132
|
-
const operationDefinitions = this.api.cellSummaryApi.getCellSummaryOperationDefinitions();
|
|
133
|
-
operationDefinitions === null || operationDefinitions === void 0 ? void 0 : operationDefinitions.forEach((operation) => {
|
|
134
|
-
if (operation.operationFunction) {
|
|
135
|
-
const cellSummaryOperationContext = {
|
|
136
|
-
selectedCellInfo,
|
|
137
|
-
distinctCount: distinctValue,
|
|
138
|
-
allValues,
|
|
139
|
-
numericValues,
|
|
140
|
-
numericColumns,
|
|
141
|
-
adaptableApi: this.api,
|
|
142
|
-
userName: this.api.optionsApi.getUserName(),
|
|
143
|
-
adaptableId: this.api.optionsApi.getAdaptableId(),
|
|
144
|
-
};
|
|
145
|
-
selectedCellSummary[operation.operationName] = operation.operationFunction(cellSummaryOperationContext);
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
this.cachedCellSummary.set(selectedCellInfo, selectedCellSummary);
|
|
149
109
|
}
|
|
150
110
|
return selectedCellSummary;
|
|
151
111
|
}
|
|
@@ -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;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
2
2
|
import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
|
|
3
|
-
import ArrayExtensions from '../Utilities/Extensions/ArrayExtensions';
|
|
4
3
|
import * as LayoutRedux from '../Redux/ActionsReducers/LayoutRedux';
|
|
5
4
|
import * as SystemRedux from '../Redux/ActionsReducers/SystemRedux';
|
|
6
5
|
import { FilterStatusBarSubPanelPopover } from '../View/Filter/FilterStatusBarSubPanelPopover';
|
|
@@ -39,8 +38,8 @@ export class ColumnFilterModule extends AdaptableModuleBase {
|
|
|
39
38
|
}
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
|
-
|
|
43
|
-
let
|
|
41
|
+
createColumnMenuItems(column) {
|
|
42
|
+
let columnFilterMenuItems = [];
|
|
44
43
|
if (column &&
|
|
45
44
|
column.filterable &&
|
|
46
45
|
this.api.optionsApi.getColumnFilterOptions().useAdaptableColumnFiltering) {
|
|
@@ -48,35 +47,22 @@ export class ColumnFilterModule extends AdaptableModuleBase {
|
|
|
48
47
|
const isFilterVisible = this.api.columnFilterApi.isQuickFilterVisible();
|
|
49
48
|
if (this.isModuleEditable() &&
|
|
50
49
|
this.api.optionsApi.getColumnFilterOptions().useAdaptableColumnFiltering) {
|
|
51
|
-
|
|
50
|
+
columnFilterMenuItems.push(this.createMenuItemReduxAction(isFilterVisible ? 'column-filter-bar-hide' : 'column-filter-bar-show', isFilterVisible ? 'Hide Filter Bar' : 'Show Filter Bar', isFilterVisible ? 'unchecked' : 'check', isFilterVisible
|
|
52
51
|
? SystemRedux.SystemQuickFilterBarHide()
|
|
53
52
|
: SystemRedux.SystemQuickFilterBarShow()));
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
const existingColumnFilter = this.getExistingColumnFilter(column);
|
|
57
56
|
if (existingColumnFilter) {
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
columnFilterMenuItems.push(this.createMenuItemReduxAction('column-filter-clear', 'Clear Filter', 'close', LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)));
|
|
58
|
+
columnFilterMenuItems.push(this.createMenuItemReduxAction(existingColumnFilter.IsSuspended ? 'column-filter-unsuspend' : 'column-filter-suspend', existingColumnFilter.IsSuspended ? 'Unsuspend Filter' : 'Suspend Filter', existingColumnFilter.IsSuspended ? 'resume' : 'pause', existingColumnFilter.IsSuspended
|
|
60
59
|
? LayoutRedux.LayoutColumnFilterUnSuspend(existingColumnFilter)
|
|
61
60
|
: LayoutRedux.LayoutColumnFilterSuspend(existingColumnFilter)));
|
|
62
61
|
}
|
|
63
|
-
|
|
64
|
-
return [
|
|
65
|
-
{
|
|
66
|
-
name: 'column-filter-parent',
|
|
67
|
-
label: this.moduleInfo.FriendlyName,
|
|
68
|
-
isVisible: true,
|
|
69
|
-
module: this.moduleInfo.ModuleName,
|
|
70
|
-
icon: {
|
|
71
|
-
name: this.moduleInfo.Glyph,
|
|
72
|
-
},
|
|
73
|
-
subItems: filterSubMenuItems,
|
|
74
|
-
},
|
|
75
|
-
];
|
|
76
|
-
}
|
|
62
|
+
return columnFilterMenuItems;
|
|
77
63
|
}
|
|
78
64
|
}
|
|
79
|
-
|
|
65
|
+
createContextMenuItems(menuContext) {
|
|
80
66
|
if (!menuContext.isRowGroupColumn && this.isModuleAvailable()) {
|
|
81
67
|
if (menuContext.adaptableColumn &&
|
|
82
68
|
menuContext.adaptableColumn.filterable &&
|
|
@@ -98,28 +84,17 @@ export class ColumnFilterModule extends AdaptableModuleBase {
|
|
|
98
84
|
];
|
|
99
85
|
}
|
|
100
86
|
else {
|
|
101
|
-
let filterSubMenuItems = [];
|
|
102
|
-
filterSubMenuItems.push(this.createMenuItemReduxAction('column-filter-clear', 'Clear Filter', 'close', LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)));
|
|
103
|
-
filterSubMenuItems.push(this.createMenuItemClickFunction(existingColumnFilter.IsSuspended
|
|
104
|
-
? 'column-filter-unsuspend'
|
|
105
|
-
: 'column-filter-suspend', existingColumnFilter.IsSuspended ? 'Unsuspend Filter' : 'Suspend Filter', existingColumnFilter.IsSuspended ? 'resume' : 'pause', existingColumnFilter.IsSuspended
|
|
106
|
-
? () => {
|
|
107
|
-
this.api.columnFilterApi.unSuspendColumnFilter(existingColumnFilter);
|
|
108
|
-
}
|
|
109
|
-
: () => {
|
|
110
|
-
this.api.columnFilterApi.suspendColumnFilter(existingColumnFilter);
|
|
111
|
-
}));
|
|
112
87
|
return [
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
88
|
+
this.createMenuItemReduxAction('column-filter-clear', 'Clear Filter', 'close', LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)),
|
|
89
|
+
this.createMenuItemClickFunction(existingColumnFilter.IsSuspended
|
|
90
|
+
? 'column-filter-unsuspend'
|
|
91
|
+
: 'column-filter-suspend', existingColumnFilter.IsSuspended ? 'Unsuspend Filter' : 'Suspend Filter', existingColumnFilter.IsSuspended ? 'resume' : 'pause', existingColumnFilter.IsSuspended
|
|
92
|
+
? () => {
|
|
93
|
+
this.api.columnFilterApi.unSuspendColumnFilter(existingColumnFilter);
|
|
94
|
+
}
|
|
95
|
+
: () => {
|
|
96
|
+
this.api.columnFilterApi.suspendColumnFilter(existingColumnFilter);
|
|
97
|
+
}),
|
|
123
98
|
];
|
|
124
99
|
}
|
|
125
100
|
}
|
|
@@ -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
|
}
|
|
@@ -7,7 +7,7 @@ export class ColumnInfoModule extends AdaptableModuleBase {
|
|
|
7
7
|
getViewAccessLevel() {
|
|
8
8
|
return 'Full';
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
createColumnMenuItems(column) {
|
|
11
11
|
if (this.isModuleAvailable()) {
|
|
12
12
|
const columnPopUpParams = {
|
|
13
13
|
source: 'ColumnMenu',
|
|
@@ -24,7 +24,7 @@ export class ColumnInfoModule extends AdaptableModuleBase {
|
|
|
24
24
|
];
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
createContextMenuItems(menuContext) {
|
|
28
28
|
if (this.isModuleAvailable()) {
|
|
29
29
|
const columnPopUpParams = {
|
|
30
30
|
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
|
}
|
|
@@ -24,48 +24,47 @@ export class CommentModule extends AdaptableModuleBase {
|
|
|
24
24
|
.getCommentOptions()) === null || _a === void 0 ? void 0 : _a.loadCommentThreads) === null || _b === void 0 ? void 0 : _b.call(_a, createBaseContext(this.api)));
|
|
25
25
|
this.api.commentApi.setGridComments(commentThreads);
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
var _a, _b;
|
|
27
|
+
createContextMenuItems(menuContext) {
|
|
28
|
+
var _a, _b, _c, _d, _e;
|
|
29
29
|
if (!this.isModuleAvailable()) {
|
|
30
|
-
return
|
|
30
|
+
return;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (!isCellCommentable ||
|
|
35
|
-
isCellCommentable(Object.assign({ gridCell: menuContext.gridCell }, createBaseContext(this.api)))) {
|
|
36
|
-
items.push(...this.getAddRemoveCommentsMenuItems(menuContext));
|
|
32
|
+
if (!this.api.commentApi.internalApi.areCommentsSupported()) {
|
|
33
|
+
return;
|
|
37
34
|
}
|
|
38
|
-
return items;
|
|
39
|
-
}
|
|
40
|
-
getAddRemoveCommentsMenuItems(menuContext) {
|
|
41
|
-
var _a;
|
|
42
35
|
const items = [];
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
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'
|
|
37
|
+
? (_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 }, createBaseContext(this.api)))
|
|
38
|
+
: true;
|
|
39
|
+
if (!isCellCommentable) {
|
|
40
|
+
return;
|
|
45
41
|
}
|
|
46
42
|
const cellAddress = {
|
|
47
43
|
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
48
44
|
ColumnId: menuContext.adaptableColumn.columnId,
|
|
49
45
|
};
|
|
50
|
-
const cellComments = (
|
|
46
|
+
const cellComments = (_e = this.api.commentApi.getCommentThread(cellAddress)) === null || _e === void 0 ? void 0 : _e.Comments;
|
|
51
47
|
if (cellComments) {
|
|
52
|
-
|
|
53
|
-
this.
|
|
54
|
-
|
|
48
|
+
return [
|
|
49
|
+
this.createMenuItemClickFunction('comment-remove', 'Remove Comment', this.moduleInfo.Glyph, () => {
|
|
50
|
+
this.api.commentApi.deleteCommentThread(cellAddress);
|
|
51
|
+
}),
|
|
52
|
+
];
|
|
55
53
|
}
|
|
56
54
|
else {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
return [
|
|
56
|
+
this.createMenuItemClickFunction('comment-add', 'Add Comment', this.moduleInfo.Glyph, () => {
|
|
57
|
+
// add an empty one
|
|
58
|
+
this.api.commentApi.addCommentThread(Object.assign(Object.assign({}, cellAddress), { Comments: [] }));
|
|
59
|
+
requestAnimationFrame(() => {
|
|
60
|
+
this.api.internalApi.getCellPopupService().showPopup({
|
|
61
|
+
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
62
|
+
ColumnId: menuContext.adaptableColumn.columnId,
|
|
63
|
+
}, true);
|
|
64
|
+
this.api.internalApi.getCellPopupService().editFocusedEntity('Comment');
|
|
65
|
+
});
|
|
66
|
+
}),
|
|
67
|
+
];
|
|
68
68
|
}
|
|
69
|
-
return items;
|
|
70
69
|
}
|
|
71
70
|
}
|
|
@@ -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[];
|
|
@@ -18,7 +18,7 @@ export class CustomSortModule extends AdaptableModuleBase {
|
|
|
18
18
|
hasNamedQueryReferences() {
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
createColumnMenuItems(column) {
|
|
22
22
|
if (column && this.isModuleEditable() && column.sortable) {
|
|
23
23
|
let customSort = this.api.customSortApi
|
|
24
24
|
.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
|
}
|
|
@@ -17,10 +17,10 @@ export class DashboardModule extends AdaptableModuleBase {
|
|
|
17
17
|
this.api.dashboardApi.internalApi.fireDashboardChangedEvent('ADAPTABLE_READY', null, this.api.dashboardApi.getDashboardState());
|
|
18
18
|
}, 20);
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
createColumnMenuItems() {
|
|
21
21
|
return this.buildMenuItems();
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
createContextMenuItems(menuContext) {
|
|
24
24
|
return this.buildMenuItems();
|
|
25
25
|
}
|
|
26
26
|
buildMenuItems() {
|
|
@@ -47,18 +47,7 @@ export class DashboardModule extends AdaptableModuleBase {
|
|
|
47
47
|
else {
|
|
48
48
|
menuItems.push(this.createMenuItemReduxAction('dashboard-hide', 'Hide', 'visibility-off-bold', DashboardRedux.DashboardSetIsHidden(true)));
|
|
49
49
|
}
|
|
50
|
-
return
|
|
51
|
-
{
|
|
52
|
-
name: 'dashboard-parent',
|
|
53
|
-
label: this.moduleInfo.FriendlyName,
|
|
54
|
-
isVisible: true,
|
|
55
|
-
module: this.moduleInfo.ModuleName,
|
|
56
|
-
icon: {
|
|
57
|
-
name: 'dashboard',
|
|
58
|
-
},
|
|
59
|
-
subItems: menuItems,
|
|
60
|
-
},
|
|
61
|
-
];
|
|
50
|
+
return menuItems;
|
|
62
51
|
}
|
|
63
52
|
}
|
|
64
53
|
}
|