@adaptabletools/adaptable-cjs 18.0.0-canary.16 → 18.0.0-canary.17
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/PredefinedConfig/Common/Enums.d.ts +2 -1
- package/src/PredefinedConfig/Common/Enums.js +1 -0
- package/src/PredefinedConfig/Common/Menu.d.ts +10 -1
- package/src/PredefinedConfig/Common/Menu.js +72 -0
- package/src/PredefinedConfig/Common/RowSummary.d.ts +3 -1
- package/src/PredefinedConfig/Common/RowSummary.js +17 -1
- 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.js +8 -7
- 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 +31 -22
- 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 +23 -5
- package/src/Strategy/SystemStatusModule.js +2 -2
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +2 -2
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +125 -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 +25 -1
- package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +1 -0
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +29 -4
- package/src/agGrid/AdaptableAgGrid.d.ts +0 -2
- package/src/agGrid/AdaptableAgGrid.js +7 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -2
- package/src/agGrid/weightedAverage.d.ts +0 -2
- package/src/agGrid/weightedAverage.js +1 -56
- package/src/components/Datepicker/index.js +3 -1
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +6 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/Utilities/Services/Interface/ISummaryService.d.ts +0 -17
- package/src/Utilities/Services/Interface/ISummaryService.js +0 -15
- package/src/Utilities/Services/SummaryService.d.ts +0 -10
- package/src/Utilities/Services/SummaryService.js +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
3
|
-
"version": "18.0.0-canary.
|
|
3
|
+
"version": "18.0.0-canary.17",
|
|
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
|
}
|
|
@@ -6,7 +6,6 @@ const ApiBase_1 = require("./ApiBase");
|
|
|
6
6
|
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
7
7
|
const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
|
|
8
8
|
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
9
|
-
const weightedAverage_1 = require("../../agGrid/weightedAverage");
|
|
10
9
|
class CellSummaryApiImpl extends ApiBase_1.ApiBase {
|
|
11
10
|
openCellSummaryPopupSettingsPanel() {
|
|
12
11
|
this.showModulePopup(ModuleConstants.CellSummaryModuleId);
|
|
@@ -17,12 +16,6 @@ class CellSummaryApiImpl extends ApiBase_1.ApiBase {
|
|
|
17
16
|
getCellSummaryOperationDefinitions() {
|
|
18
17
|
var _a;
|
|
19
18
|
let cellSummaryOperations = (_a = this.getCellSummaryOptions().cellSummaryOperations) !== null && _a !== void 0 ? _a : [];
|
|
20
|
-
if (this.isWeightedAverageCellSummaryAvailable()) {
|
|
21
|
-
cellSummaryOperations = [
|
|
22
|
-
...cellSummaryOperations,
|
|
23
|
-
this.getWeightedAverageCellSummaryOperation(),
|
|
24
|
-
];
|
|
25
|
-
}
|
|
26
19
|
return cellSummaryOperations;
|
|
27
20
|
}
|
|
28
21
|
setCurrentCellSummaryOperation(operation) {
|
|
@@ -54,6 +47,8 @@ class CellSummaryApiImpl extends ApiBase_1.ApiBase {
|
|
|
54
47
|
return cellSummary.Std_Deviation;
|
|
55
48
|
case Enums_1.SummaryOperation.Only:
|
|
56
49
|
return cellSummary.Only;
|
|
50
|
+
case Enums_1.SummaryOperation.Weighted_Average:
|
|
51
|
+
return cellSummary.Weighted_Average;
|
|
57
52
|
default:
|
|
58
53
|
return cellSummary[operation];
|
|
59
54
|
}
|
|
@@ -65,21 +60,5 @@ class CellSummaryApiImpl extends ApiBase_1.ApiBase {
|
|
|
65
60
|
: cellSummaryOperation.operationName;
|
|
66
61
|
return this.getCellSummaryOperationValue(summaryOperation);
|
|
67
62
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Weighted average is availabe only if the current layout has at leat a Weighted Average aggregation defined.
|
|
70
|
-
*/
|
|
71
|
-
isWeightedAverageCellSummaryAvailable() {
|
|
72
|
-
const currentLayout = this.getAdaptableApi().layoutApi.getCurrentLayout();
|
|
73
|
-
if (currentLayout.AggregationColumns == undefined) {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
return Object.values(currentLayout.AggregationColumns).some((aggCol) => typeof aggCol === 'object' && aggCol.type === 'weightedAverage');
|
|
77
|
-
}
|
|
78
|
-
getWeightedAverageCellSummaryOperation() {
|
|
79
|
-
return {
|
|
80
|
-
operationName: 'Weighted Avg',
|
|
81
|
-
operationFunction: weightedAverage_1.cellSummaryWeightedAverage,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
63
|
}
|
|
85
64
|
exports.CellSummaryApiImpl = CellSummaryApiImpl;
|
|
@@ -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
|
}
|
|
@@ -529,7 +529,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
529
529
|
(0, logDeprecation_1.logDeprecation)(this.adaptable.logger, 'GridApi', 'getVisibleRowCount', 'getRowCount');
|
|
530
530
|
return this.getRowCount();
|
|
531
531
|
}
|
|
532
|
-
showTransposedView(transposeConfig) {
|
|
532
|
+
showTransposedView(transposeConfig = {}) {
|
|
533
533
|
var _a, _b, _c, _d;
|
|
534
534
|
const transposedColumnId = (_a = transposeConfig.transposedColumnId) !== null && _a !== void 0 ? _a : this.getAdaptableApi().optionsApi.getPrimaryKey();
|
|
535
535
|
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;
|
|
@@ -106,9 +106,6 @@ class AdaptableInternalApi extends ApiBase_1.ApiBase {
|
|
|
106
106
|
getEntitlementService() {
|
|
107
107
|
return this.adaptable.EntitlementService;
|
|
108
108
|
}
|
|
109
|
-
getSummaryService() {
|
|
110
|
-
return this.adaptable.SummaryService;
|
|
111
|
-
}
|
|
112
109
|
getQueryLanguageService() {
|
|
113
110
|
return this.adaptable.QueryLanguageService;
|
|
114
111
|
}
|
|
@@ -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",
|
|
@@ -78,6 +78,7 @@ var SummaryOperation;
|
|
|
78
78
|
SummaryOperation["Count"] = "Count";
|
|
79
79
|
SummaryOperation["Std_Deviation"] = "Std Deviation";
|
|
80
80
|
SummaryOperation["Only"] = "Only";
|
|
81
|
+
SummaryOperation["Weighted_Average"] = "Weighted Avg";
|
|
81
82
|
})(SummaryOperation = exports.SummaryOperation || (exports.SummaryOperation = {}));
|
|
82
83
|
var FilterOnDataChangeOptions;
|
|
83
84
|
(function (FilterOnDataChangeOptions) {
|
|
@@ -5,12 +5,21 @@ 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
|
+
/**
|
|
9
|
+
* List of Shipped Adaptable Menu Items
|
|
10
|
+
*/
|
|
11
|
+
export declare const ADAPTABLE_MENU_ITEMS: readonly ["alert-clear", "bulk-update-apply", "calculated-column-edit", "cell-summary-show", "column-info", "comment-add", "comment-remove", "custom-sort-add", "custom-sort-edit", "dashboard", "dashboard-collapse", "dashboard-configure", "dashboard-dock", "dashboard-expand", "dashboard-float", "dashboard-hide", "dashboard-show", "data-import", "export", "export-clipboard", "export-csv", "export-excel", "export-json", "export-table", "export-custom-destination", "fdc3", "fdc3-broadcast", "fdc3-raise-intent", "filter", "filter-bar-visbility", "filter-clear", "filter-suspend", "filter-cell-value", "flashing-cell-add", "flashing-cell-clear", "flashing-cell-delete", "flashing-row-clear", "format-column", "format-column-add", "format-column-edit", "free-text-column-edit", "grid-info", "layout-aggregated-view", "layout-auto-size", "layout-clear-selection", "layout-column-caption-change", "layout-column-hide", "layout-column-select", "layout-column-select-preserve", "layout-column-select-reset", "layout-edit", "layout-grid", "layout-select", "layout-select-all", "note-add", "note-remove", "plus-minus-add", "smart-edit-apply", "settings-panel-open", "styled-column-badge", "styled-column", "styled-column-gradient", "styled-column-percent-bar", "styled-column-sparkline", "system-status-show", "internal"];
|
|
12
|
+
export type AdaptableMenuItemName = typeof ADAPTABLE_MENU_ITEMS[number];
|
|
8
13
|
/**
|
|
9
14
|
* Menu item used by Adaptable in both Column and Context Menus
|
|
10
15
|
*/
|
|
11
16
|
export interface AdaptableMenuItem {
|
|
12
17
|
/**
|
|
13
|
-
*
|
|
18
|
+
* Unique name for the Menu Item
|
|
19
|
+
*/
|
|
20
|
+
name: AdaptableMenuItemName;
|
|
21
|
+
/**
|
|
22
|
+
* Text that appears in the menu
|
|
14
23
|
*/
|
|
15
24
|
label: string;
|
|
16
25
|
/**
|
|
@@ -1,2 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ADAPTABLE_MENU_ITEMS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* List of Shipped Adaptable Menu Items
|
|
6
|
+
*/
|
|
7
|
+
exports.ADAPTABLE_MENU_ITEMS = [
|
|
8
|
+
'alert-clear',
|
|
9
|
+
'bulk-update-apply',
|
|
10
|
+
'calculated-column-edit',
|
|
11
|
+
'cell-summary-show',
|
|
12
|
+
'column-info',
|
|
13
|
+
'comment-add',
|
|
14
|
+
'comment-remove',
|
|
15
|
+
'custom-sort-add',
|
|
16
|
+
'custom-sort-edit',
|
|
17
|
+
'dashboard',
|
|
18
|
+
'dashboard-collapse',
|
|
19
|
+
'dashboard-configure',
|
|
20
|
+
'dashboard-dock',
|
|
21
|
+
'dashboard-expand',
|
|
22
|
+
'dashboard-float',
|
|
23
|
+
'dashboard-hide',
|
|
24
|
+
'dashboard-show',
|
|
25
|
+
'data-import',
|
|
26
|
+
'export',
|
|
27
|
+
'export-clipboard',
|
|
28
|
+
'export-csv',
|
|
29
|
+
'export-excel',
|
|
30
|
+
'export-json',
|
|
31
|
+
'export-table',
|
|
32
|
+
'export-custom-destination',
|
|
33
|
+
'fdc3',
|
|
34
|
+
'fdc3-broadcast',
|
|
35
|
+
'fdc3-raise-intent',
|
|
36
|
+
'filter',
|
|
37
|
+
'filter-bar-visbility',
|
|
38
|
+
'filter-clear',
|
|
39
|
+
'filter-suspend',
|
|
40
|
+
'filter-cell-value',
|
|
41
|
+
'flashing-cell-add',
|
|
42
|
+
'flashing-cell-clear',
|
|
43
|
+
'flashing-cell-delete',
|
|
44
|
+
'flashing-row-clear',
|
|
45
|
+
'format-column',
|
|
46
|
+
'format-column-add',
|
|
47
|
+
'format-column-edit',
|
|
48
|
+
'free-text-column-edit',
|
|
49
|
+
'grid-info',
|
|
50
|
+
'layout-aggregated-view',
|
|
51
|
+
'layout-auto-size',
|
|
52
|
+
'layout-clear-selection',
|
|
53
|
+
'layout-column-caption-change',
|
|
54
|
+
'layout-column-hide',
|
|
55
|
+
'layout-column-select',
|
|
56
|
+
'layout-column-select-preserve',
|
|
57
|
+
'layout-column-select-reset',
|
|
58
|
+
'layout-edit',
|
|
59
|
+
'layout-grid',
|
|
60
|
+
'layout-select',
|
|
61
|
+
'layout-select-all',
|
|
62
|
+
'note-add',
|
|
63
|
+
'note-remove',
|
|
64
|
+
'plus-minus-add',
|
|
65
|
+
'smart-edit-apply',
|
|
66
|
+
'settings-panel-open',
|
|
67
|
+
'styled-column-badge',
|
|
68
|
+
'styled-column',
|
|
69
|
+
'styled-column-gradient',
|
|
70
|
+
'styled-column-percent-bar',
|
|
71
|
+
'styled-column-sparkline',
|
|
72
|
+
'system-status-show',
|
|
73
|
+
'internal' // used by AdapTable in Settings Panel
|
|
74
|
+
];
|
|
@@ -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,4 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ROW_SUMMARY_ROW_ID = void 0;
|
|
3
|
+
exports.summarySupportedExpressions = exports.WEIGHTED_AVERAGE_AGGREATED_FUNCTION = exports.ROW_SUMMARY_ROW_ID = void 0;
|
|
4
4
|
exports.ROW_SUMMARY_ROW_ID = '__ROW_SUMMARY_ROW_ID';
|
|
5
|
+
exports.WEIGHTED_AVERAGE_AGGREATED_FUNCTION = 'WEIGHTED_AVERAGE';
|
|
6
|
+
exports.summarySupportedExpressions = [
|
|
7
|
+
'SUM',
|
|
8
|
+
'AVG',
|
|
9
|
+
'MIN',
|
|
10
|
+
'MAX',
|
|
11
|
+
'COUNT',
|
|
12
|
+
'MEDIAN',
|
|
13
|
+
'MODE',
|
|
14
|
+
'DISTINCT',
|
|
15
|
+
'ONLY',
|
|
16
|
+
'STD_DEVIATION',
|
|
17
|
+
'OLDEST',
|
|
18
|
+
'YOUNGEST',
|
|
19
|
+
exports.WEIGHTED_AVERAGE_AGGREATED_FUNCTION,
|
|
20
|
+
];
|
|
@@ -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, AdaptableMenuItemName, ContextMenuContext } 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: AdaptableMenuItemName;
|
|
44
45
|
Label: string;
|
|
45
46
|
ComponentName: string;
|
|
46
47
|
Icon: AdaptableSystemIconName;
|
|
47
48
|
PopupParams?: ModuleParams;
|
|
48
49
|
}): MenuItemShowPopup;
|
|
49
|
-
createColumnMenuItemClickFunction(Label: string, Icon: AdaptableSystemIconName, ClickFunction: () => void): MenuItemDoClickFunction;
|
|
50
|
-
createColumnMenuItemReduxAction(Label: string, Icon: AdaptableSystemIconName, Action: Action): MenuItemDoReduxAction;
|
|
51
|
-
createColumnMenuItemShowPopup(Label: string, ComponentName: string, Icon: AdaptableSystemIconName, PopupParams?: ModuleParams): MenuItemShowPopup;
|
|
50
|
+
createColumnMenuItemClickFunction(Name: AdaptableMenuItemName, Label: string, Icon: AdaptableSystemIconName, ClickFunction: () => void): MenuItemDoClickFunction;
|
|
51
|
+
createColumnMenuItemReduxAction(Name: AdaptableMenuItemName, Label: string, Icon: AdaptableSystemIconName, Action: Action): MenuItemDoReduxAction;
|
|
52
|
+
createColumnMenuItemShowPopup(Name: AdaptableMenuItemName, Label: string, ComponentName: string, Icon: AdaptableSystemIconName, PopupParams?: ModuleParams): MenuItemShowPopup;
|
|
52
53
|
getTeamSharingAction(): TeamSharingImportInfo<AdaptableObject> | undefined;
|
|
53
54
|
getModuleNamedQueryReferences(): string[];
|
|
54
55
|
getModuleCalculatedColumnReferences(): CalculatedColumn[];
|
|
@@ -82,6 +82,7 @@ class AdaptableModuleBase {
|
|
|
82
82
|
maxWidth: this.getPopupMaxWidth(),
|
|
83
83
|
};
|
|
84
84
|
return this.createMainMenuItemShowPopup({
|
|
85
|
+
Name: 'internal',
|
|
85
86
|
Label: this.moduleInfo.FriendlyName,
|
|
86
87
|
ComponentName: this.moduleInfo.Popup,
|
|
87
88
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -102,20 +103,20 @@ class AdaptableModuleBase {
|
|
|
102
103
|
return undefined;
|
|
103
104
|
}
|
|
104
105
|
// creates the menu items in the main dropdown
|
|
105
|
-
createMainMenuItemShowPopup({ Label, ComponentName, Icon, PopupParams, }) {
|
|
106
|
-
return new MenuItem_1.MenuItemShowPopup(Label, this.moduleInfo.ModuleName, ComponentName, Icon, true, PopupParams);
|
|
106
|
+
createMainMenuItemShowPopup({ Name, Label, ComponentName, Icon, PopupParams, }) {
|
|
107
|
+
return new MenuItem_1.MenuItemShowPopup(Name, Label, this.moduleInfo.ModuleName, ComponentName, Icon, true, PopupParams);
|
|
107
108
|
}
|
|
108
109
|
// creates a menu item for the column menu to perform a function
|
|
109
|
-
createColumnMenuItemClickFunction(Label, Icon, ClickFunction) {
|
|
110
|
-
return new MenuItem_1.MenuItemDoClickFunction(Label, this.moduleInfo.ModuleName, ClickFunction, Icon, true);
|
|
110
|
+
createColumnMenuItemClickFunction(Name, Label, Icon, ClickFunction) {
|
|
111
|
+
return new MenuItem_1.MenuItemDoClickFunction(Name, Label, this.moduleInfo.ModuleName, ClickFunction, Icon, true);
|
|
111
112
|
}
|
|
112
113
|
// creates a menu item for the column menu to enact a Redux action
|
|
113
|
-
createColumnMenuItemReduxAction(Label, Icon, Action) {
|
|
114
|
-
return new MenuItem_1.MenuItemDoReduxAction(Label, this.moduleInfo.ModuleName, Action, Icon, true);
|
|
114
|
+
createColumnMenuItemReduxAction(Name, Label, Icon, Action) {
|
|
115
|
+
return new MenuItem_1.MenuItemDoReduxAction(Name, Label, this.moduleInfo.ModuleName, Action, Icon, true);
|
|
115
116
|
}
|
|
116
117
|
// popups called by the column menu - invisible if module is hidden or readonly
|
|
117
|
-
createColumnMenuItemShowPopup(Label, ComponentName, Icon, PopupParams) {
|
|
118
|
-
return new MenuItem_1.MenuItemShowPopup(Label, this.moduleInfo.ModuleName, ComponentName, Icon, true, PopupParams);
|
|
118
|
+
createColumnMenuItemShowPopup(Name, Label, ComponentName, Icon, PopupParams) {
|
|
119
|
+
return new MenuItem_1.MenuItemShowPopup(Name, Label, this.moduleInfo.ModuleName, ComponentName, Icon, true, PopupParams);
|
|
119
120
|
}
|
|
120
121
|
getTeamSharingAction() {
|
|
121
122
|
return undefined;
|
|
@@ -87,7 +87,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
87
87
|
relevantAlert = this.api.alertApi.internalApi.getAdaptableAlertWithHighlightRow(menuContext.rowNode);
|
|
88
88
|
}
|
|
89
89
|
if (relevantAlert) {
|
|
90
|
-
items.push(this.createColumnMenuItemReduxAction('Clear Alert', this.moduleInfo.Glyph, SystemRedux.SystemAlertDelete(relevantAlert)));
|
|
90
|
+
items.push(this.createColumnMenuItemReduxAction('alert-clear', 'Clear Alert', this.moduleInfo.Glyph, SystemRedux.SystemAlertDelete(relevantAlert)));
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -26,7 +26,7 @@ class BulkUpdateModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
26
26
|
let popUpParams = {
|
|
27
27
|
source: 'ContextMenu',
|
|
28
28
|
};
|
|
29
|
-
menuItemShowPopup = this.createMainMenuItemShowPopup({
|
|
29
|
+
menuItemShowPopup = this.createMainMenuItemShowPopup({ Name: 'bulk-update-apply',
|
|
30
30
|
Label: 'Apply Bulk Update',
|
|
31
31
|
ComponentName: this.moduleInfo.Popup,
|
|
32
32
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -61,7 +61,7 @@ class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
61
61
|
source: 'ColumnMenu',
|
|
62
62
|
};
|
|
63
63
|
return [
|
|
64
|
-
this.createColumnMenuItemShowPopup('Edit Calculated Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
64
|
+
this.createColumnMenuItemShowPopup('calculated-column-edit', 'Edit Calculated Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
65
65
|
];
|
|
66
66
|
}
|
|
67
67
|
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;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CellSummaryModule = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
|
|
6
5
|
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
7
6
|
const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
|
|
8
7
|
const Helper_1 = require("../Utilities/Helpers/Helper");
|
|
8
|
+
const AggregatedScalarLiveValue_1 = require("../Utilities/Services/AggregatedScalarLiveValue");
|
|
9
9
|
const CellSummaryStatusPanel_1 = require("../View/CellSummary/CellSummaryStatusPanel");
|
|
10
|
+
const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
|
|
10
11
|
class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
11
12
|
constructor(api) {
|
|
12
13
|
super(ModuleConstants.CellSummaryModuleId, ModuleConstants.CellSummaryFriendlyName, 'cells', 'CellSummaryPopup', 'See summary information on a group of cells using multiple summary operations', api);
|
|
@@ -40,6 +41,7 @@ class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
40
41
|
}
|
|
41
42
|
createCellSummaryMenuItem(popUpParams) {
|
|
42
43
|
return this.createMainMenuItemShowPopup({
|
|
44
|
+
Name: 'cell-summary-show',
|
|
43
45
|
Label: 'See Cell Summary',
|
|
44
46
|
ComponentName: this.moduleInfo.Popup,
|
|
45
47
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -92,17 +94,17 @@ class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
92
94
|
Only: '',
|
|
93
95
|
};
|
|
94
96
|
}
|
|
97
|
+
const columnId = selectedCellInfo.columns[0].columnId;
|
|
98
|
+
const rowNodes = selectedCellInfo.gridCells.map((gc) => gc.rowNode);
|
|
95
99
|
const handleExpression = (functionName) => {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
getRowNodes: () => rowNodes,
|
|
105
|
-
}, ModuleConstants.CellSummaryModuleId);
|
|
100
|
+
const aggScalarValue = new AggregatedScalarLiveValue_1.AggregatedScalarLiveValue({
|
|
101
|
+
aggregatedScalarExpression: `${functionName}([${columnId}])`,
|
|
102
|
+
}, ModuleConstants.CellSummaryModuleId, this.api, () => rowNodes);
|
|
103
|
+
let value = aggScalarValue.getGlobalAggregatedValue();
|
|
104
|
+
if (typeof value === 'number' && !isNaN(value)) {
|
|
105
|
+
value = Helper_1.Helper.roundNumber(value, 2);
|
|
106
|
+
}
|
|
107
|
+
return value;
|
|
106
108
|
};
|
|
107
109
|
const sumValue = hasNumericColumns ? handleExpression('SUM') : null;
|
|
108
110
|
const avgValue = hasNumericColumns ? Helper_1.Helper.roundNumber(handleExpression('AVG'), 2) : null;
|
|
@@ -127,8 +129,11 @@ class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
127
129
|
Only: distinctValue == 1 ? JSON.stringify(allValues[0]) : '',
|
|
128
130
|
};
|
|
129
131
|
numericValues = [...newNumericValues];
|
|
132
|
+
const weightedAverage = this.getWeightedAverageCellSummary(columnId, rowNodes);
|
|
133
|
+
if (weightedAverage !== null) {
|
|
134
|
+
selectedCellSummary.Weighted_Average = weightedAverage;
|
|
135
|
+
}
|
|
130
136
|
const operationDefinitions = this.api.cellSummaryApi.getCellSummaryOperationDefinitions();
|
|
131
|
-
const api = this.api;
|
|
132
137
|
operationDefinitions === null || operationDefinitions === void 0 ? void 0 : operationDefinitions.forEach((operation) => {
|
|
133
138
|
if (operation.operationFunction) {
|
|
134
139
|
const cellSummaryOperationContext = {
|
|
@@ -148,6 +153,26 @@ class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
148
153
|
this.cachedCellSummary.set(selectedCellInfo, selectedCellSummary);
|
|
149
154
|
return selectedCellSummary;
|
|
150
155
|
}
|
|
156
|
+
getWeightedAverageCellSummary(columnId, rowNodes) {
|
|
157
|
+
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
158
|
+
if (currentLayout.AggregationColumns == undefined) {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
const weightedAverageConfig = Object.entries(currentLayout.AggregationColumns).find(([colId, aggCol]) => typeof aggCol === 'object' && aggCol.type === 'weightedAverage' && colId === columnId);
|
|
162
|
+
if (!weightedAverageConfig) {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
const { weightedColumnId } = weightedAverageConfig[1];
|
|
166
|
+
const expression = `AVG([${columnId}], WEIGHT([${weightedColumnId}]))`;
|
|
167
|
+
const aggScalarValue = new AggregatedScalarLiveValue_1.AggregatedScalarLiveValue({
|
|
168
|
+
aggregatedScalarExpression: expression,
|
|
169
|
+
}, ModuleConstants.CellSummaryModuleId, this.api, () => rowNodes);
|
|
170
|
+
let value = aggScalarValue.getGlobalAggregatedValue();
|
|
171
|
+
if (typeof value === 'number' && !isNaN(value)) {
|
|
172
|
+
value = Helper_1.Helper.roundNumber(value, 2);
|
|
173
|
+
}
|
|
174
|
+
return value;
|
|
175
|
+
}
|
|
151
176
|
getViewProperties() {
|
|
152
177
|
return {
|
|
153
178
|
getStatusBarPanelProps() {
|
|
@@ -61,13 +61,13 @@ class ColumnFilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
61
61
|
this.api.columnFilterApi.internalApi.createEqualityColumnFilterForCell(menuContext.selectedCellInfo.gridCells[0]);
|
|
62
62
|
};
|
|
63
63
|
return [
|
|
64
|
-
this.createColumnMenuItemClickFunction(isMultiple ? 'Filter on Cell Values' : 'Filter on Cell Value', this.moduleInfo.Glyph, clickFunction),
|
|
64
|
+
this.createColumnMenuItemClickFunction('filter-cell-value', isMultiple ? 'Filter on Cell Values' : 'Filter on Cell Value', this.moduleInfo.Glyph, clickFunction),
|
|
65
65
|
];
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
68
|
let filterSubMenuItems = [];
|
|
69
|
-
filterSubMenuItems.push(this.createColumnMenuItemReduxAction('Clear Filter', 'close', LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)));
|
|
70
|
-
filterSubMenuItems.push(this.createColumnMenuItemClickFunction(existingColumnFilter.IsSuspended ? 'Unsuspend Filter' : 'Suspend Filter', existingColumnFilter.IsSuspended ? 'resume' : 'pause', existingColumnFilter.IsSuspended
|
|
69
|
+
filterSubMenuItems.push(this.createColumnMenuItemReduxAction('filter-clear', 'Clear Filter', 'close', LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)));
|
|
70
|
+
filterSubMenuItems.push(this.createColumnMenuItemClickFunction('filter-suspend', existingColumnFilter.IsSuspended ? 'Unsuspend Filter' : 'Suspend Filter', existingColumnFilter.IsSuspended ? 'resume' : 'pause', existingColumnFilter.IsSuspended
|
|
71
71
|
? () => {
|
|
72
72
|
this.api.columnFilterApi.unSuspendColumnFilter(existingColumnFilter);
|
|
73
73
|
}
|
|
@@ -75,7 +75,7 @@ class ColumnFilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
75
75
|
this.api.columnFilterApi.suspendColumnFilter(existingColumnFilter);
|
|
76
76
|
}));
|
|
77
77
|
return [
|
|
78
|
-
{
|
|
78
|
+
{ name: 'filter',
|
|
79
79
|
label: this.moduleInfo.FriendlyName,
|
|
80
80
|
isVisible: true,
|
|
81
81
|
module: this.moduleInfo.ModuleName,
|
|
@@ -98,21 +98,22 @@ class ColumnFilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
98
98
|
const isFilterVisible = this.api.columnFilterApi.isQuickFilterVisible();
|
|
99
99
|
if (this.isModuleEditable() &&
|
|
100
100
|
this.api.optionsApi.getColumnFilterOptions().useAdaptableColumnFiltering) {
|
|
101
|
-
filterSubMenuItems.push(this.createColumnMenuItemReduxAction(isFilterVisible ? 'Hide Filter Bar' : 'Show Filter Bar', isFilterVisible ? 'unchecked' : 'check', isFilterVisible
|
|
101
|
+
filterSubMenuItems.push(this.createColumnMenuItemReduxAction('filter-bar-visbility', isFilterVisible ? 'Hide Filter Bar' : 'Show Filter Bar', isFilterVisible ? 'unchecked' : 'check', isFilterVisible
|
|
102
102
|
? SystemRedux.SystemQuickFilterBarHide()
|
|
103
103
|
: SystemRedux.SystemQuickFilterBarShow()));
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
const existingColumnFilter = this.getExistingColumnFilter(column);
|
|
107
107
|
if (existingColumnFilter) {
|
|
108
|
-
filterSubMenuItems.push(this.createColumnMenuItemReduxAction('Clear Filter', 'close', LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)));
|
|
109
|
-
filterSubMenuItems.push(this.createColumnMenuItemReduxAction(existingColumnFilter.IsSuspended ? 'Unsuspend Filter' : 'Suspend Filter', existingColumnFilter.IsSuspended ? 'resume' : 'pause', existingColumnFilter.IsSuspended
|
|
108
|
+
filterSubMenuItems.push(this.createColumnMenuItemReduxAction('filter-clear', 'Clear Filter', 'close', LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)));
|
|
109
|
+
filterSubMenuItems.push(this.createColumnMenuItemReduxAction('filter-suspend', existingColumnFilter.IsSuspended ? 'Unsuspend Filter' : 'Suspend Filter', existingColumnFilter.IsSuspended ? 'resume' : 'pause', existingColumnFilter.IsSuspended
|
|
110
110
|
? LayoutRedux.LayoutColumnFilterUnSuspend(existingColumnFilter)
|
|
111
111
|
: LayoutRedux.LayoutColumnFilterSuspend(existingColumnFilter)));
|
|
112
112
|
}
|
|
113
113
|
if (ArrayExtensions_1.default.IsNotNullOrEmpty(filterSubMenuItems)) {
|
|
114
114
|
return [
|
|
115
115
|
{
|
|
116
|
+
name: 'filter',
|
|
116
117
|
label: this.moduleInfo.FriendlyName,
|
|
117
118
|
isVisible: true,
|
|
118
119
|
module: this.moduleInfo.ModuleName,
|
|
@@ -19,6 +19,7 @@ class ColumnInfoModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
19
19
|
};
|
|
20
20
|
return [
|
|
21
21
|
this.createMainMenuItemShowPopup({
|
|
22
|
+
Name: 'column-info',
|
|
22
23
|
Label: 'Column Info',
|
|
23
24
|
ComponentName: this.moduleInfo.Popup,
|
|
24
25
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -35,6 +36,7 @@ class ColumnInfoModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
35
36
|
};
|
|
36
37
|
return [
|
|
37
38
|
this.createMainMenuItemShowPopup({
|
|
39
|
+
Name: 'column-info',
|
|
38
40
|
Label: 'Column Info',
|
|
39
41
|
ComponentName: this.moduleInfo.Popup,
|
|
40
42
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -62,12 +62,12 @@ class CommentModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
62
62
|
return items;
|
|
63
63
|
}
|
|
64
64
|
if (comments) {
|
|
65
|
-
items.push(this.createColumnMenuItemClickFunction('Remove
|
|
65
|
+
items.push(this.createColumnMenuItemClickFunction('comment-remove', 'Remove Comment', this.moduleInfo.Glyph, () => {
|
|
66
66
|
this.api.commentApi.deleteCommentThread(cellAddress);
|
|
67
67
|
}));
|
|
68
68
|
}
|
|
69
69
|
else {
|
|
70
|
-
items.push(this.createColumnMenuItemClickFunction('Add Comment', this.moduleInfo.Glyph, () => {
|
|
70
|
+
items.push(this.createColumnMenuItemClickFunction('comment-add', 'Add Comment', this.moduleInfo.Glyph, () => {
|
|
71
71
|
// add an empty one
|
|
72
72
|
this.api.commentApi.addCommentThread(Object.assign(Object.assign({}, cellAddress), { Comments: [] }));
|
|
73
73
|
requestAnimationFrame(() => {
|
|
@@ -38,8 +38,9 @@ class CustomSortModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
38
38
|
action: customSort ? 'Edit' : 'New',
|
|
39
39
|
source: 'ColumnMenu',
|
|
40
40
|
};
|
|
41
|
+
let name = customSort ? 'custom-sort-edit' : 'custom-sort-add';
|
|
41
42
|
return [
|
|
42
|
-
this.createColumnMenuItemShowPopup(label + 'Custom Sort', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
43
|
+
this.createColumnMenuItemShowPopup(name, label + 'Custom Sort', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
43
44
|
];
|
|
44
45
|
}
|
|
45
46
|
}
|