@adaptabletools/adaptable 18.0.0-canary.16 → 18.0.0-canary.18
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 +0 -2
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +4 -3
- package/src/Api/GridApi.d.ts +1 -1
- package/src/Api/Implementation/CellSummaryApiImpl.d.ts +0 -5
- package/src/Api/Implementation/CellSummaryApiImpl.js +2 -23
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
- package/src/Api/Implementation/GridApiImpl.js +1 -1
- package/src/Api/Internal/AdaptableInternalApi.d.ts +0 -2
- package/src/Api/Internal/AdaptableInternalApi.js +0 -3
- package/src/Api/Internal/GridFilterInternalApi.d.ts +5 -0
- package/src/Api/Internal/GridFilterInternalApi.js +6 -0
- package/src/PredefinedConfig/Common/Enums.d.ts +2 -1
- package/src/PredefinedConfig/Common/Enums.js +1 -0
- package/src/PredefinedConfig/Common/Menu.d.ts +15 -1
- package/src/PredefinedConfig/Common/Menu.js +97 -1
- package/src/PredefinedConfig/Common/RowSummary.d.ts +3 -1
- package/src/PredefinedConfig/Common/RowSummary.js +16 -0
- package/src/Redux/Store/AdaptableStore.js +11 -6
- package/src/Strategy/AdaptableModuleBase.d.ts +6 -5
- package/src/Strategy/AdaptableModuleBase.js +9 -8
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/BulkUpdateModule.js +1 -1
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.d.ts +7 -6
- package/src/Strategy/CellSummaryModule.js +37 -12
- package/src/Strategy/ColumnFilterModule.d.ts +1 -1
- package/src/Strategy/ColumnFilterModule.js +43 -39
- package/src/Strategy/ColumnInfoModule.js +2 -0
- package/src/Strategy/CommentModule.js +2 -2
- package/src/Strategy/CustomSortModule.js +2 -1
- package/src/Strategy/DashboardModule.js +8 -7
- package/src/Strategy/DataImportModule.js +1 -1
- package/src/Strategy/ExportModule.d.ts +1 -0
- package/src/Strategy/ExportModule.js +17 -2
- package/src/Strategy/Fdc3Module.js +3 -0
- package/src/Strategy/FlashingCellModule.js +4 -4
- package/src/Strategy/FormatColumnModule.js +6 -4
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/GridInfoModule.js +2 -0
- package/src/Strategy/LayoutModule.js +32 -23
- package/src/Strategy/NoteModule.js +2 -2
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/SettingsPanelModule.js +3 -3
- package/src/Strategy/SmartEditModule.js +1 -1
- package/src/Strategy/StyledColumnModule.d.ts +1 -0
- package/src/Strategy/StyledColumnModule.js +26 -5
- package/src/Strategy/SystemStatusModule.js +2 -2
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +2 -2
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +124 -3
- package/src/Utilities/MenuItem.d.ts +7 -4
- package/src/Utilities/MenuItem.js +6 -3
- package/src/Utilities/Services/LicenseService/index.js +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +5 -2
- package/src/View/Components/FilterForm/QuickFilterForm.js +1 -1
- package/src/View/Components/ValueSelector/index.js +1 -1
- package/src/View/Layout/Wizard/LayoutWizard.js +26 -2
- package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +1 -0
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +26 -2
- package/src/agGrid/AdaptableAgGrid.d.ts +0 -2
- package/src/agGrid/AdaptableAgGrid.js +7 -3
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +1 -1
- package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -2
- package/src/agGrid/weightedAverage.d.ts +0 -2
- package/src/agGrid/weightedAverage.js +0 -54
- package/src/components/Datepicker/index.js +3 -1
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Utilities/Services/Interface/ISummaryService.d.ts +0 -17
- package/src/Utilities/Services/Interface/ISummaryService.js +0 -12
- package/src/Utilities/Services/SummaryService.d.ts +0 -10
- package/src/Utilities/Services/SummaryService.js +0 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "18.0.0-canary.
|
|
3
|
+
"version": "18.0.0-canary.18",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -31,7 +31,6 @@ import { AgGridAdapter } from '../agGrid/AgGridAdapter';
|
|
|
31
31
|
import { AgGridColumnAdapter } from '../agGrid/AgGridColumnAdapter';
|
|
32
32
|
import { AgGridMenuAdapter } from '../agGrid/AgGridMenuAdapter';
|
|
33
33
|
import { RowEditService } from '../Utilities/Services/RowEditService';
|
|
34
|
-
import { ISummaryService } from '../Utilities/Services/Interface/ISummaryService';
|
|
35
34
|
/**
|
|
36
35
|
* Contains AG Grid Options and Modules - used when instantiating AdapTable vanilla
|
|
37
36
|
*/
|
|
@@ -91,7 +90,6 @@ export interface IAdaptable {
|
|
|
91
90
|
RowEditService: RowEditService;
|
|
92
91
|
Fdc3Service: Fdc3Service;
|
|
93
92
|
CellPopupService: CellPopupService;
|
|
94
|
-
SummaryService: ISummaryService;
|
|
95
93
|
/**
|
|
96
94
|
* INTERNAL ADAPTABLE EVENTS
|
|
97
95
|
* These are not called externally - for that we use eventapi
|
|
@@ -103,9 +103,10 @@ export interface ColumnFilterOptions<TData = any> {
|
|
|
103
103
|
*/
|
|
104
104
|
showSuspendFilterButton?: boolean;
|
|
105
105
|
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* @
|
|
106
|
+
* Show Date Picker (or Date Input) in Filter controls
|
|
107
|
+
* @gridInfoItem
|
|
108
|
+
* @noCodeItem
|
|
109
|
+
* @defaultValue true
|
|
109
110
|
*/
|
|
110
111
|
showDatePicker?: boolean;
|
|
111
112
|
}
|
package/src/Api/GridApi.d.ts
CHANGED
|
@@ -9,9 +9,4 @@ export declare class CellSummaryApiImpl extends ApiBase implements CellSummaryAp
|
|
|
9
9
|
setCurrentCellSummaryOperation(operation: SummaryOperation | string): void;
|
|
10
10
|
getCellSummaryOperationValue(operation: SummaryOperation | string): any;
|
|
11
11
|
getCurrentCellSummaryOperationValue(): any;
|
|
12
|
-
/**
|
|
13
|
-
* Weighted average is availabe only if the current layout has at leat a Weighted Average aggregation defined.
|
|
14
|
-
*/
|
|
15
|
-
private isWeightedAverageCellSummaryAvailable;
|
|
16
|
-
private getWeightedAverageCellSummaryOperation;
|
|
17
12
|
}
|
|
@@ -2,7 +2,6 @@ import { ApiBase } from './ApiBase';
|
|
|
2
2
|
import * as ModuleConstants from '../../Utilities/Constants/ModuleConstants';
|
|
3
3
|
import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
|
|
4
4
|
import { SummaryOperation } from '../../PredefinedConfig/Common/Enums';
|
|
5
|
-
import { cellSummaryWeightedAverage } from '../../agGrid/weightedAverage';
|
|
6
5
|
export class CellSummaryApiImpl extends ApiBase {
|
|
7
6
|
openCellSummaryPopupSettingsPanel() {
|
|
8
7
|
this.showModulePopup(ModuleConstants.CellSummaryModuleId);
|
|
@@ -13,12 +12,6 @@ export class CellSummaryApiImpl extends ApiBase {
|
|
|
13
12
|
getCellSummaryOperationDefinitions() {
|
|
14
13
|
var _a;
|
|
15
14
|
let cellSummaryOperations = (_a = this.getCellSummaryOptions().cellSummaryOperations) !== null && _a !== void 0 ? _a : [];
|
|
16
|
-
if (this.isWeightedAverageCellSummaryAvailable()) {
|
|
17
|
-
cellSummaryOperations = [
|
|
18
|
-
...cellSummaryOperations,
|
|
19
|
-
this.getWeightedAverageCellSummaryOperation(),
|
|
20
|
-
];
|
|
21
|
-
}
|
|
22
15
|
return cellSummaryOperations;
|
|
23
16
|
}
|
|
24
17
|
setCurrentCellSummaryOperation(operation) {
|
|
@@ -50,6 +43,8 @@ export class CellSummaryApiImpl extends ApiBase {
|
|
|
50
43
|
return cellSummary.Std_Deviation;
|
|
51
44
|
case SummaryOperation.Only:
|
|
52
45
|
return cellSummary.Only;
|
|
46
|
+
case SummaryOperation.Weighted_Average:
|
|
47
|
+
return cellSummary.Weighted_Average;
|
|
53
48
|
default:
|
|
54
49
|
return cellSummary[operation];
|
|
55
50
|
}
|
|
@@ -61,20 +56,4 @@ export class CellSummaryApiImpl extends ApiBase {
|
|
|
61
56
|
: cellSummaryOperation.operationName;
|
|
62
57
|
return this.getCellSummaryOperationValue(summaryOperation);
|
|
63
58
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Weighted average is availabe only if the current layout has at leat a Weighted Average aggregation defined.
|
|
66
|
-
*/
|
|
67
|
-
isWeightedAverageCellSummaryAvailable() {
|
|
68
|
-
const currentLayout = this.getAdaptableApi().layoutApi.getCurrentLayout();
|
|
69
|
-
if (currentLayout.AggregationColumns == undefined) {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
return Object.values(currentLayout.AggregationColumns).some((aggCol) => typeof aggCol === 'object' && aggCol.type === 'weightedAverage');
|
|
73
|
-
}
|
|
74
|
-
getWeightedAverageCellSummaryOperation() {
|
|
75
|
-
return {
|
|
76
|
-
operationName: 'Weighted Avg',
|
|
77
|
-
operationFunction: cellSummaryWeightedAverage,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
59
|
}
|
|
@@ -132,5 +132,5 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
|
|
|
132
132
|
openGridInfoSettingsPanel(): void;
|
|
133
133
|
getAgGridRowModelType(): RowModelType;
|
|
134
134
|
getVisibleRowCount(): number;
|
|
135
|
-
showTransposedView(transposeConfig
|
|
135
|
+
showTransposedView(transposeConfig?: TransposeConfig): void;
|
|
136
136
|
}
|
|
@@ -525,7 +525,7 @@ export class GridApiImpl extends ApiBase {
|
|
|
525
525
|
logDeprecation(this.adaptable.logger, 'GridApi', 'getVisibleRowCount', 'getRowCount');
|
|
526
526
|
return this.getRowCount();
|
|
527
527
|
}
|
|
528
|
-
showTransposedView(transposeConfig) {
|
|
528
|
+
showTransposedView(transposeConfig = {}) {
|
|
529
529
|
var _a, _b, _c, _d;
|
|
530
530
|
const transposedColumnId = (_a = transposeConfig.transposedColumnId) !== null && _a !== void 0 ? _a : this.getAdaptableApi().optionsApi.getPrimaryKey();
|
|
531
531
|
const hideTransposedColumn = (_b = transposeConfig.hideTransposedColumn) !== null && _b !== void 0 ? _b : true;
|
|
@@ -27,7 +27,6 @@ import { AdaptableObjectTag, AdaptableObjectWithScope } from '../../PredefinedCo
|
|
|
27
27
|
import { Fdc3Service } from '../../Utilities/Services/Fdc3Service';
|
|
28
28
|
import { CellPopupService } from '../../Utilities/Services/CellPopupService';
|
|
29
29
|
import { RowEditService } from '../../Utilities/Services/RowEditService';
|
|
30
|
-
import { ISummaryService } from '../../Utilities/Services/Interface/ISummaryService';
|
|
31
30
|
export declare class AdaptableInternalApi extends ApiBase {
|
|
32
31
|
getSystemState(): SystemState;
|
|
33
32
|
showPopupConfirmation(confirmation: UIConfirmation): void;
|
|
@@ -61,7 +60,6 @@ export declare class AdaptableInternalApi extends ApiBase {
|
|
|
61
60
|
getReportService(): IReportService;
|
|
62
61
|
getCalculatedColumnExpressionService(): ICalculatedColumnExpressionService;
|
|
63
62
|
getEntitlementService(): IEntitlementService;
|
|
64
|
-
getSummaryService(): ISummaryService;
|
|
65
63
|
getQueryLanguageService(): IQueryLanguageService;
|
|
66
64
|
getAlertService(): IAlertService;
|
|
67
65
|
getTeamSharingService(): ITeamSharingService;
|
|
@@ -102,9 +102,6 @@ export class AdaptableInternalApi extends ApiBase {
|
|
|
102
102
|
getEntitlementService() {
|
|
103
103
|
return this.adaptable.EntitlementService;
|
|
104
104
|
}
|
|
105
|
-
getSummaryService() {
|
|
106
|
-
return this.adaptable.SummaryService;
|
|
107
|
-
}
|
|
108
105
|
getQueryLanguageService() {
|
|
109
106
|
return this.adaptable.QueryLanguageService;
|
|
110
107
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
|
+
import { GridFilter } from '../../types';
|
|
2
3
|
export declare class GridFilterInternalApi extends ApiBase {
|
|
3
4
|
fireGridFilterAppliedEvent(): void;
|
|
5
|
+
/**
|
|
6
|
+
* Compares to Grid Filters to see if they are identical
|
|
7
|
+
*/
|
|
8
|
+
isGridFilterDifferent(oldFilter: GridFilter, newFilter: GridFilter): boolean;
|
|
4
9
|
}
|
|
@@ -16,4 +16,10 @@ export class GridFilterInternalApi extends ApiBase {
|
|
|
16
16
|
adaptableApi.eventApi.emit('GridFilterApplied', gridFilterAppliedInfo);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Compares to Grid Filters to see if they are identical
|
|
21
|
+
*/
|
|
22
|
+
isGridFilterDifferent(oldFilter, newFilter) {
|
|
23
|
+
return (oldFilter === null || oldFilter === void 0 ? void 0 : oldFilter.Expression) === (newFilter === null || newFilter === void 0 ? void 0 : newFilter.Expression);
|
|
24
|
+
}
|
|
19
25
|
}
|
|
@@ -60,7 +60,8 @@ export declare enum SummaryOperation {
|
|
|
60
60
|
Min = "Min",
|
|
61
61
|
Count = "Count",
|
|
62
62
|
Std_Deviation = "Std Deviation",
|
|
63
|
-
Only = "Only"
|
|
63
|
+
Only = "Only",
|
|
64
|
+
Weighted_Average = "Weighted Avg"
|
|
64
65
|
}
|
|
65
66
|
export declare enum FilterOnDataChangeOptions {
|
|
66
67
|
Always = "Always",
|
|
@@ -75,6 +75,7 @@ export var SummaryOperation;
|
|
|
75
75
|
SummaryOperation["Count"] = "Count";
|
|
76
76
|
SummaryOperation["Std_Deviation"] = "Std Deviation";
|
|
77
77
|
SummaryOperation["Only"] = "Only";
|
|
78
|
+
SummaryOperation["Weighted_Average"] = "Weighted Avg";
|
|
78
79
|
})(SummaryOperation || (SummaryOperation = {}));
|
|
79
80
|
export var FilterOnDataChangeOptions;
|
|
80
81
|
(function (FilterOnDataChangeOptions) {
|
|
@@ -5,12 +5,26 @@ import { SelectedCellInfo } from '../Selection/SelectedCellInfo';
|
|
|
5
5
|
import { SelectedRowInfo } from '../Selection/SelectedRowInfo';
|
|
6
6
|
import { Column, IRowNode } from '@ag-grid-community/core';
|
|
7
7
|
import { AdaptableIcon, BaseContext } from '../../types';
|
|
8
|
+
export type AdaptableColumnMenuItemName = (typeof ADAPTABLE_COLUMN_MENU_ITEMS)[number];
|
|
9
|
+
export type AdaptableContextMenuItemName = (typeof ADAPTABLE_CONTEXT_MENU_ITEMS)[number];
|
|
10
|
+
/**
|
|
11
|
+
* List of Shipped Adaptable Column Menu Items
|
|
12
|
+
*/
|
|
13
|
+
export declare const ADAPTABLE_COLUMN_MENU_ITEMS: readonly ["calculated-column-edit", "cell-summary-show", "column-filter-bar-hide", "column-filter-bar-show", "column-filter-clear", "column-filter-on-cell-value", "column-filter-suspend", "column-filter-unsuspend", "column-info-show", "custom-sort-add", "custom-sort-edit", "dashboard-collapse", "dashboard-configure", "dashboard-dock", "dashboard-expand", "dashboard-float", "dashboard-hide", "dashboard-show", "data-import", "flashing-cell-add", "flashing-cell-delete", "format-column-add", "format-column-edit", "free-text-column-edit", "grid-info-show", "layout-column-caption-change", "layout-column-hide", "layout-column-select", "layout-column-select-preserve", "layout-column-select-reset", "layout-edit", "layout-grid-parent", "layout-select-parent", "layout-select-all", "plus-minus-add", "settings-panel-open", "styled-column-badge-add", "styled-column-badge-edit", "styled-column-gradient-add", "styled-column-gradient-edit", "styled-column-percent-bar-add", "styled-column-percent-bar-edit", "styled-column-sparkline-add", "styled-column-sparkline-edit", "system-status-show", "internal", "parent"];
|
|
14
|
+
/**
|
|
15
|
+
* List of Shipped Adaptable Context Menu Items
|
|
16
|
+
*/
|
|
17
|
+
export declare const ADAPTABLE_CONTEXT_MENU_ITEMS: readonly ["alert-clear", "bulk-update-apply", "calculated-column-edit", "cell-summary-show", "column-filter-on-cell-value", "column-filter-clear", "column-filter-suspend", "column-filter-unsuspend", "column-info-show", "comment-add", "comment-remove", "dashboard-collapse", "dashboard-configure", "dashboard-dock", "dashboard-expand", "dashboard-float", "dashboard-hide", "dashboard-show", "data-import", "export-clipboard", "export-csv", "export-excel", "export-json", "export-table", "export-custom-destination", "fdc3-broadcast", "fdc3-raise-intent", "flashing-cell-clear", "flashing-row-clear", "grid-info-show", "layout-aggregated-view", "layout-auto-size", "layout-clear-selection", "layout-edit", "layout-select-all", "note-add", "note-remove", "settings-panel-open", "smart-edit-apply", "system-status-show"];
|
|
8
18
|
/**
|
|
9
19
|
* Menu item used by Adaptable in both Column and Context Menus
|
|
10
20
|
*/
|
|
11
21
|
export interface AdaptableMenuItem {
|
|
12
22
|
/**
|
|
13
|
-
*
|
|
23
|
+
* Unique name for the Menu Item
|
|
24
|
+
*/
|
|
25
|
+
name: AdaptableColumnMenuItemName | AdaptableContextMenuItemName;
|
|
26
|
+
/**
|
|
27
|
+
* Text that appears in the menu
|
|
14
28
|
*/
|
|
15
29
|
label: string;
|
|
16
30
|
/**
|
|
@@ -1 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* List of Shipped Adaptable Column Menu Items
|
|
3
|
+
*/
|
|
4
|
+
export const ADAPTABLE_COLUMN_MENU_ITEMS = [
|
|
5
|
+
'calculated-column-edit',
|
|
6
|
+
'cell-summary-show',
|
|
7
|
+
'column-filter-bar-hide',
|
|
8
|
+
'column-filter-bar-show',
|
|
9
|
+
'column-filter-clear',
|
|
10
|
+
'column-filter-on-cell-value',
|
|
11
|
+
'column-filter-suspend',
|
|
12
|
+
'column-filter-unsuspend',
|
|
13
|
+
'column-info-show',
|
|
14
|
+
'custom-sort-add',
|
|
15
|
+
'custom-sort-edit',
|
|
16
|
+
'dashboard-collapse',
|
|
17
|
+
'dashboard-configure',
|
|
18
|
+
'dashboard-dock',
|
|
19
|
+
'dashboard-expand',
|
|
20
|
+
'dashboard-float',
|
|
21
|
+
'dashboard-hide',
|
|
22
|
+
'dashboard-show',
|
|
23
|
+
'data-import',
|
|
24
|
+
'flashing-cell-add',
|
|
25
|
+
'flashing-cell-delete',
|
|
26
|
+
'format-column-add',
|
|
27
|
+
'format-column-edit',
|
|
28
|
+
'free-text-column-edit',
|
|
29
|
+
'grid-info-show',
|
|
30
|
+
'layout-column-caption-change',
|
|
31
|
+
'layout-column-hide',
|
|
32
|
+
'layout-column-select',
|
|
33
|
+
'layout-column-select-preserve',
|
|
34
|
+
'layout-column-select-reset',
|
|
35
|
+
'layout-edit',
|
|
36
|
+
'layout-grid-parent',
|
|
37
|
+
'layout-select-parent',
|
|
38
|
+
'layout-select-all',
|
|
39
|
+
'plus-minus-add',
|
|
40
|
+
'settings-panel-open',
|
|
41
|
+
'styled-column-badge-add',
|
|
42
|
+
'styled-column-badge-edit',
|
|
43
|
+
'styled-column-gradient-add',
|
|
44
|
+
'styled-column-gradient-edit',
|
|
45
|
+
'styled-column-percent-bar-add',
|
|
46
|
+
'styled-column-percent-bar-edit',
|
|
47
|
+
'styled-column-sparkline-add',
|
|
48
|
+
'styled-column-sparkline-edit',
|
|
49
|
+
'system-status-show',
|
|
50
|
+
'internal',
|
|
51
|
+
'parent',
|
|
52
|
+
];
|
|
53
|
+
/**
|
|
54
|
+
* List of Shipped Adaptable Context Menu Items
|
|
55
|
+
*/
|
|
56
|
+
export const ADAPTABLE_CONTEXT_MENU_ITEMS = [
|
|
57
|
+
'alert-clear',
|
|
58
|
+
'bulk-update-apply',
|
|
59
|
+
'calculated-column-edit',
|
|
60
|
+
'cell-summary-show',
|
|
61
|
+
'column-filter-on-cell-value',
|
|
62
|
+
'column-filter-clear',
|
|
63
|
+
'column-filter-suspend',
|
|
64
|
+
'column-filter-unsuspend',
|
|
65
|
+
'column-info-show',
|
|
66
|
+
'comment-add',
|
|
67
|
+
'comment-remove',
|
|
68
|
+
'dashboard-collapse',
|
|
69
|
+
'dashboard-configure',
|
|
70
|
+
'dashboard-dock',
|
|
71
|
+
'dashboard-expand',
|
|
72
|
+
'dashboard-float',
|
|
73
|
+
'dashboard-hide',
|
|
74
|
+
'dashboard-show',
|
|
75
|
+
'data-import',
|
|
76
|
+
'export-clipboard',
|
|
77
|
+
'export-csv',
|
|
78
|
+
'export-excel',
|
|
79
|
+
'export-json',
|
|
80
|
+
'export-table',
|
|
81
|
+
'export-custom-destination',
|
|
82
|
+
'fdc3-broadcast',
|
|
83
|
+
'fdc3-raise-intent',
|
|
84
|
+
'flashing-cell-clear',
|
|
85
|
+
'flashing-row-clear',
|
|
86
|
+
'grid-info-show',
|
|
87
|
+
'layout-aggregated-view',
|
|
88
|
+
'layout-auto-size',
|
|
89
|
+
'layout-clear-selection',
|
|
90
|
+
'layout-edit',
|
|
91
|
+
'layout-select-all',
|
|
92
|
+
'note-add',
|
|
93
|
+
'note-remove',
|
|
94
|
+
'settings-panel-open',
|
|
95
|
+
'smart-edit-apply',
|
|
96
|
+
'system-status-show',
|
|
97
|
+
];
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { SummarySupportedExpression } from "../../Utilities/Services/Interface/ISummaryService";
|
|
2
1
|
export declare const ROW_SUMMARY_ROW_ID = "__ROW_SUMMARY_ROW_ID";
|
|
2
|
+
export declare const WEIGHTED_AVERAGE_AGGREATED_FUNCTION = "WEIGHTED_AVERAGE";
|
|
3
|
+
export declare const summarySupportedExpressions: readonly ["SUM", "AVG", "MIN", "MAX", "COUNT", "MEDIAN", "MODE", "DISTINCT", "ONLY", "STD_DEVIATION", "OLDEST", "YOUNGEST", "WEIGHTED_AVERAGE"];
|
|
4
|
+
export type SummarySupportedExpression = (typeof summarySupportedExpressions)[number];
|
|
3
5
|
/**
|
|
4
6
|
* Position of Row Summary - 'Top' or 'Bottom'
|
|
5
7
|
*/
|
|
@@ -1 +1,17 @@
|
|
|
1
1
|
export const ROW_SUMMARY_ROW_ID = '__ROW_SUMMARY_ROW_ID';
|
|
2
|
+
export const WEIGHTED_AVERAGE_AGGREATED_FUNCTION = 'WEIGHTED_AVERAGE';
|
|
3
|
+
export const summarySupportedExpressions = [
|
|
4
|
+
'SUM',
|
|
5
|
+
'AVG',
|
|
6
|
+
'MIN',
|
|
7
|
+
'MAX',
|
|
8
|
+
'COUNT',
|
|
9
|
+
'MEDIAN',
|
|
10
|
+
'MODE',
|
|
11
|
+
'DISTINCT',
|
|
12
|
+
'ONLY',
|
|
13
|
+
'STD_DEVIATION',
|
|
14
|
+
'OLDEST',
|
|
15
|
+
'YOUNGEST',
|
|
16
|
+
WEIGHTED_AVERAGE_AGGREATED_FUNCTION,
|
|
17
|
+
];
|
|
@@ -262,7 +262,7 @@ export class AdaptableStore {
|
|
|
262
262
|
const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
263
263
|
return function (next) {
|
|
264
264
|
return function (action) {
|
|
265
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
265
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
266
266
|
switch (action.type) {
|
|
267
267
|
/*******************
|
|
268
268
|
* NAMED QUERY ACTIONS
|
|
@@ -770,7 +770,6 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
770
770
|
draftLayoutAction = GridRedux.LayoutDraftColumnFilterUnsuspendAll();
|
|
771
771
|
break;
|
|
772
772
|
}
|
|
773
|
-
// GRID FILTER
|
|
774
773
|
returnAction = next(draftLayoutAction);
|
|
775
774
|
}
|
|
776
775
|
setTimeout(() => {
|
|
@@ -800,7 +799,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
800
799
|
returnAction = action;
|
|
801
800
|
}
|
|
802
801
|
else {
|
|
803
|
-
//
|
|
802
|
+
// This is different to what we do with column filters?
|
|
804
803
|
switch (action.type) {
|
|
805
804
|
case LayoutRedux.LAYOUT_GRID_FILTER_SET:
|
|
806
805
|
returnAction = GridRedux.LayoutDraftGridFilterSet(Object.assign(Object.assign({}, currentLayout.GridFilter), { Expression: action.gridFilter }));
|
|
@@ -1011,12 +1010,18 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
1011
1010
|
let returnAction = next(action);
|
|
1012
1011
|
const newLayoutState = middlewareAPI.getState().Layout;
|
|
1013
1012
|
adaptable.api.layoutApi.internalApi.fireLayoutChangedEvent(action.type, oldLayoutState, newLayoutState);
|
|
1013
|
+
// Tell Grid to apply column filtering if filters have been changed in a loaded Layout
|
|
1014
1014
|
const oldFilters = (_k = oldLayoutState.Layouts.find((l) => l.Name == oldLayoutState.CurrentLayout)) === null || _k === void 0 ? void 0 : _k.ColumnFilters;
|
|
1015
1015
|
const newFilters = (_l = newLayoutState.Layouts.find((l) => l.Name == newLayoutState.CurrentLayout)) === null || _l === void 0 ? void 0 : _l.ColumnFilters;
|
|
1016
|
-
// Tell Grid to apply filtering if filters have been changed in a loaded Layout
|
|
1017
1016
|
if (adaptable.api.columnFilterApi.internalApi.areColumnFiltersDifferent(oldFilters, newFilters)) {
|
|
1018
1017
|
adaptable.applyColumnFiltering();
|
|
1019
1018
|
}
|
|
1019
|
+
// Tell Grid to apply filtering if filters have been changed in a loaded Layout
|
|
1020
|
+
const oldGridFilter = (_m = oldLayoutState.Layouts.find((l) => l.Name == oldLayoutState.CurrentLayout)) === null || _m === void 0 ? void 0 : _m.GridFilter;
|
|
1021
|
+
const newGridFilter = (_o = newLayoutState.Layouts.find((l) => l.Name == newLayoutState.CurrentLayout)) === null || _o === void 0 ? void 0 : _o.GridFilter;
|
|
1022
|
+
if (adaptable.api.gridFilterApi.internalApi.isGridFilterDifferent(oldGridFilter, newGridFilter)) {
|
|
1023
|
+
adaptable.applyGridFiltering();
|
|
1024
|
+
}
|
|
1020
1025
|
if (returnAction.type == LayoutRedux.LAYOUT_SELECT ||
|
|
1021
1026
|
returnAction.type == LayoutRedux.LAYOUT_DELETE ||
|
|
1022
1027
|
returnAction.type == LayoutRedux.LAYOUT_SET_COLUMN_CAPTION) {
|
|
@@ -1029,7 +1034,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
1029
1034
|
// tell grid the layout has been selected
|
|
1030
1035
|
adaptable.setLayout(currentLayout);
|
|
1031
1036
|
}
|
|
1032
|
-
if (!((
|
|
1037
|
+
if (!((_p = adaptable.adaptableOptions.layoutOptions) === null || _p === void 0 ? void 0 : _p.autoSaveLayouts)) {
|
|
1033
1038
|
middlewareAPI.dispatch(GridRedux.LayoutUpdateCurrentDraft(currentLayout));
|
|
1034
1039
|
}
|
|
1035
1040
|
}
|
|
@@ -1037,7 +1042,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
1037
1042
|
returnAction.type == LayoutRedux.LAYOUT_SAVE) {
|
|
1038
1043
|
const actionTyped = action;
|
|
1039
1044
|
// if autosave is false
|
|
1040
|
-
if (!((
|
|
1045
|
+
if (!((_q = adaptable.adaptableOptions.layoutOptions) === null || _q === void 0 ? void 0 : _q.autoSaveLayouts)) {
|
|
1041
1046
|
// and the current layout is saved, make sure we also update the draft
|
|
1042
1047
|
if (actionTyped.layout.Name === newLayoutState.CurrentLayout) {
|
|
1043
1048
|
middlewareAPI.dispatch(GridRedux.LayoutUpdateCurrentDraft(actionTyped.layout));
|
|
@@ -3,7 +3,7 @@ import { Action } from 'redux';
|
|
|
3
3
|
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
4
4
|
import { ModuleParams } from '../View/Components/SharedProps/ModuleViewPopupProps';
|
|
5
5
|
import { MenuItemShowPopup, MenuItemDoReduxAction, MenuItemDoClickFunction } from '../Utilities/MenuItem';
|
|
6
|
-
import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
|
|
6
|
+
import { AdaptableMenuItem, AdaptableContextMenuItemName, ContextMenuContext, AdaptableColumnMenuItemName } from '../PredefinedConfig/Common/Menu';
|
|
7
7
|
import { AdaptableModule } from '../PredefinedConfig/Common/Types';
|
|
8
8
|
import { TeamSharingImportInfo } from '../PredefinedConfig/TeamSharingState';
|
|
9
9
|
import { AdaptableObject } from '../PredefinedConfig/Common/AdaptableObject';
|
|
@@ -40,15 +40,16 @@ export declare abstract class AdaptableModuleBase implements IModule {
|
|
|
40
40
|
addModuleButtonMenuItem(): AdaptableMenuItem | undefined;
|
|
41
41
|
addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
42
42
|
addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
43
|
-
createMainMenuItemShowPopup({ Label, ComponentName, Icon, PopupParams, }: {
|
|
43
|
+
createMainMenuItemShowPopup({ Name, Label, ComponentName, Icon, PopupParams, }: {
|
|
44
|
+
Name: AdaptableColumnMenuItemName | AdaptableContextMenuItemName;
|
|
44
45
|
Label: string;
|
|
45
46
|
ComponentName: string;
|
|
46
47
|
Icon: AdaptableSystemIconName;
|
|
47
48
|
PopupParams?: ModuleParams;
|
|
48
49
|
}): MenuItemShowPopup;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
createMenuItemClickFunction(Name: AdaptableColumnMenuItemName | AdaptableContextMenuItemName, Label: string, Icon: AdaptableSystemIconName, ClickFunction: () => void): MenuItemDoClickFunction;
|
|
51
|
+
createMenuItemReduxAction(Name: AdaptableColumnMenuItemName | AdaptableContextMenuItemName, Label: string, Icon: AdaptableSystemIconName, Action: Action): MenuItemDoReduxAction;
|
|
52
|
+
createMenuItemShowPopup(Name: AdaptableColumnMenuItemName | AdaptableContextMenuItemName, Label: string, ComponentName: string, Icon: AdaptableSystemIconName, PopupParams?: ModuleParams): MenuItemShowPopup;
|
|
52
53
|
getTeamSharingAction(): TeamSharingImportInfo<AdaptableObject> | undefined;
|
|
53
54
|
getModuleNamedQueryReferences(): string[];
|
|
54
55
|
getModuleCalculatedColumnReferences(): CalculatedColumn[];
|
|
@@ -78,6 +78,7 @@ export class AdaptableModuleBase {
|
|
|
78
78
|
maxWidth: this.getPopupMaxWidth(),
|
|
79
79
|
};
|
|
80
80
|
return this.createMainMenuItemShowPopup({
|
|
81
|
+
Name: 'internal',
|
|
81
82
|
Label: this.moduleInfo.FriendlyName,
|
|
82
83
|
ComponentName: this.moduleInfo.Popup,
|
|
83
84
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -98,20 +99,20 @@ export class AdaptableModuleBase {
|
|
|
98
99
|
return undefined;
|
|
99
100
|
}
|
|
100
101
|
// creates the menu items in the main dropdown
|
|
101
|
-
createMainMenuItemShowPopup({ Label, ComponentName, Icon, PopupParams, }) {
|
|
102
|
-
return new MenuItemShowPopup(Label, this.moduleInfo.ModuleName, ComponentName, Icon, true, PopupParams);
|
|
102
|
+
createMainMenuItemShowPopup({ Name, Label, ComponentName, Icon, PopupParams, }) {
|
|
103
|
+
return new MenuItemShowPopup(Name, Label, this.moduleInfo.ModuleName, ComponentName, Icon, true, PopupParams);
|
|
103
104
|
}
|
|
104
105
|
// creates a menu item for the column menu to perform a function
|
|
105
|
-
|
|
106
|
-
return new MenuItemDoClickFunction(Label, this.moduleInfo.ModuleName, ClickFunction, Icon, true);
|
|
106
|
+
createMenuItemClickFunction(Name, Label, Icon, ClickFunction) {
|
|
107
|
+
return new MenuItemDoClickFunction(Name, Label, this.moduleInfo.ModuleName, ClickFunction, Icon, true);
|
|
107
108
|
}
|
|
108
109
|
// creates a menu item for the column menu to enact a Redux action
|
|
109
|
-
|
|
110
|
-
return new MenuItemDoReduxAction(Label, this.moduleInfo.ModuleName, Action, Icon, true);
|
|
110
|
+
createMenuItemReduxAction(Name, Label, Icon, Action) {
|
|
111
|
+
return new MenuItemDoReduxAction(Name, Label, this.moduleInfo.ModuleName, Action, Icon, true);
|
|
111
112
|
}
|
|
112
113
|
// popups called by the column menu - invisible if module is hidden or readonly
|
|
113
|
-
|
|
114
|
-
return new MenuItemShowPopup(Label, this.moduleInfo.ModuleName, ComponentName, Icon, true, PopupParams);
|
|
114
|
+
createMenuItemShowPopup(Name, Label, ComponentName, Icon, PopupParams) {
|
|
115
|
+
return new MenuItemShowPopup(Name, Label, this.moduleInfo.ModuleName, ComponentName, Icon, true, PopupParams);
|
|
115
116
|
}
|
|
116
117
|
getTeamSharingAction() {
|
|
117
118
|
return undefined;
|
|
@@ -83,7 +83,7 @@ export class AlertModule extends AdaptableModuleBase {
|
|
|
83
83
|
relevantAlert = this.api.alertApi.internalApi.getAdaptableAlertWithHighlightRow(menuContext.rowNode);
|
|
84
84
|
}
|
|
85
85
|
if (relevantAlert) {
|
|
86
|
-
items.push(this.
|
|
86
|
+
items.push(this.createMenuItemReduxAction('alert-clear', 'Clear Alert', this.moduleInfo.Glyph, SystemRedux.SystemAlertDelete(relevantAlert)));
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -22,7 +22,7 @@ export class BulkUpdateModule extends AdaptableModuleBase {
|
|
|
22
22
|
let popUpParams = {
|
|
23
23
|
source: 'ContextMenu',
|
|
24
24
|
};
|
|
25
|
-
menuItemShowPopup = this.createMainMenuItemShowPopup({
|
|
25
|
+
menuItemShowPopup = this.createMainMenuItemShowPopup({ Name: 'bulk-update-apply',
|
|
26
26
|
Label: 'Apply Bulk Update',
|
|
27
27
|
ComponentName: this.moduleInfo.Popup,
|
|
28
28
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -57,7 +57,7 @@ export class CalculatedColumnModule extends AdaptableModuleBase {
|
|
|
57
57
|
source: 'ColumnMenu',
|
|
58
58
|
};
|
|
59
59
|
return [
|
|
60
|
-
this.
|
|
60
|
+
this.createMenuItemShowPopup('calculated-column-edit', 'Edit Calculated Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
61
61
|
];
|
|
62
62
|
}
|
|
63
63
|
getTeamSharingAction() {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
3
|
-
import { ICellSummaryModule } from './Interface/ICellSummaryModule';
|
|
4
|
-
import { SelectedCellInfo } from '../PredefinedConfig/Selection/SelectedCellInfo';
|
|
5
|
-
import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
|
|
6
2
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
7
|
-
import { AccessLevel } from '../PredefinedConfig/Common/Entitlement';
|
|
8
|
-
import { CellSummmary } from '../PredefinedConfig/Common/CellSummary';
|
|
9
3
|
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
4
|
+
import { CellSummmary } from '../PredefinedConfig/Common/CellSummary';
|
|
5
|
+
import { AccessLevel } from '../PredefinedConfig/Common/Entitlement';
|
|
6
|
+
import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
|
|
7
|
+
import { SelectedCellInfo } from '../PredefinedConfig/Selection/SelectedCellInfo';
|
|
8
|
+
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
9
|
+
import { ICellSummaryModule } from './Interface/ICellSummaryModule';
|
|
10
10
|
export declare class CellSummaryModule extends AdaptableModuleBase implements ICellSummaryModule {
|
|
11
11
|
cachedCellSummary: WeakMap<SelectedCellInfo<any>, CellSummmary>;
|
|
12
12
|
constructor(api: AdaptableApi);
|
|
@@ -15,6 +15,7 @@ export declare class CellSummaryModule extends AdaptableModuleBase implements IC
|
|
|
15
15
|
addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
16
16
|
private createCellSummaryMenuItem;
|
|
17
17
|
createCellSummary(selectedCellInfo: SelectedCellInfo): CellSummmary;
|
|
18
|
+
private getWeightedAverageCellSummary;
|
|
18
19
|
getViewProperties(): {
|
|
19
20
|
getStatusBarPanelProps(): {
|
|
20
21
|
view: () => JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
2
1
|
import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
|
|
3
2
|
import { ArrayExtensions } from '../Utilities/Extensions/ArrayExtensions';
|
|
4
3
|
import { Helper } from '../Utilities/Helpers/Helper';
|
|
4
|
+
import { AggregatedScalarLiveValue } from '../Utilities/Services/AggregatedScalarLiveValue';
|
|
5
5
|
import { CellSummaryStatusPanel } from '../View/CellSummary/CellSummaryStatusPanel';
|
|
6
|
+
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
6
7
|
export class CellSummaryModule extends AdaptableModuleBase {
|
|
7
8
|
constructor(api) {
|
|
8
9
|
super(ModuleConstants.CellSummaryModuleId, ModuleConstants.CellSummaryFriendlyName, 'cells', 'CellSummaryPopup', 'See summary information on a group of cells using multiple summary operations', api);
|
|
@@ -36,6 +37,7 @@ export class CellSummaryModule extends AdaptableModuleBase {
|
|
|
36
37
|
}
|
|
37
38
|
createCellSummaryMenuItem(popUpParams) {
|
|
38
39
|
return this.createMainMenuItemShowPopup({
|
|
40
|
+
Name: 'cell-summary-show',
|
|
39
41
|
Label: 'See Cell Summary',
|
|
40
42
|
ComponentName: this.moduleInfo.Popup,
|
|
41
43
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -88,17 +90,17 @@ export class CellSummaryModule extends AdaptableModuleBase {
|
|
|
88
90
|
Only: '',
|
|
89
91
|
};
|
|
90
92
|
}
|
|
93
|
+
const columnId = selectedCellInfo.columns[0].columnId;
|
|
94
|
+
const rowNodes = selectedCellInfo.gridCells.map((gc) => gc.rowNode);
|
|
91
95
|
const handleExpression = (functionName) => {
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
getRowNodes: () => rowNodes,
|
|
101
|
-
}, ModuleConstants.CellSummaryModuleId);
|
|
96
|
+
const aggScalarValue = new AggregatedScalarLiveValue({
|
|
97
|
+
aggregatedScalarExpression: `${functionName}([${columnId}])`,
|
|
98
|
+
}, ModuleConstants.CellSummaryModuleId, this.api, () => rowNodes);
|
|
99
|
+
let value = aggScalarValue.getGlobalAggregatedValue();
|
|
100
|
+
if (typeof value === 'number' && !isNaN(value)) {
|
|
101
|
+
value = Helper.roundNumber(value, 2);
|
|
102
|
+
}
|
|
103
|
+
return value;
|
|
102
104
|
};
|
|
103
105
|
const sumValue = hasNumericColumns ? handleExpression('SUM') : null;
|
|
104
106
|
const avgValue = hasNumericColumns ? Helper.roundNumber(handleExpression('AVG'), 2) : null;
|
|
@@ -123,8 +125,11 @@ export class CellSummaryModule extends AdaptableModuleBase {
|
|
|
123
125
|
Only: distinctValue == 1 ? JSON.stringify(allValues[0]) : '',
|
|
124
126
|
};
|
|
125
127
|
numericValues = [...newNumericValues];
|
|
128
|
+
const weightedAverage = this.getWeightedAverageCellSummary(columnId, rowNodes);
|
|
129
|
+
if (weightedAverage !== null) {
|
|
130
|
+
selectedCellSummary.Weighted_Average = weightedAverage;
|
|
131
|
+
}
|
|
126
132
|
const operationDefinitions = this.api.cellSummaryApi.getCellSummaryOperationDefinitions();
|
|
127
|
-
const api = this.api;
|
|
128
133
|
operationDefinitions === null || operationDefinitions === void 0 ? void 0 : operationDefinitions.forEach((operation) => {
|
|
129
134
|
if (operation.operationFunction) {
|
|
130
135
|
const cellSummaryOperationContext = {
|
|
@@ -144,6 +149,26 @@ export class CellSummaryModule extends AdaptableModuleBase {
|
|
|
144
149
|
this.cachedCellSummary.set(selectedCellInfo, selectedCellSummary);
|
|
145
150
|
return selectedCellSummary;
|
|
146
151
|
}
|
|
152
|
+
getWeightedAverageCellSummary(columnId, rowNodes) {
|
|
153
|
+
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
154
|
+
if (currentLayout.AggregationColumns == undefined) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
const weightedAverageConfig = Object.entries(currentLayout.AggregationColumns).find(([colId, aggCol]) => typeof aggCol === 'object' && aggCol.type === 'weightedAverage' && colId === columnId);
|
|
158
|
+
if (!weightedAverageConfig) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
const { weightedColumnId } = weightedAverageConfig[1];
|
|
162
|
+
const expression = `AVG([${columnId}], WEIGHT([${weightedColumnId}]))`;
|
|
163
|
+
const aggScalarValue = new AggregatedScalarLiveValue({
|
|
164
|
+
aggregatedScalarExpression: expression,
|
|
165
|
+
}, ModuleConstants.CellSummaryModuleId, this.api, () => rowNodes);
|
|
166
|
+
let value = aggScalarValue.getGlobalAggregatedValue();
|
|
167
|
+
if (typeof value === 'number' && !isNaN(value)) {
|
|
168
|
+
value = Helper.roundNumber(value, 2);
|
|
169
|
+
}
|
|
170
|
+
return value;
|
|
171
|
+
}
|
|
147
172
|
getViewProperties() {
|
|
148
173
|
return {
|
|
149
174
|
getStatusBarPanelProps() {
|