@adaptabletools/adaptable 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 +71 -1
- package/src/PredefinedConfig/Common/RowSummary.d.ts +3 -1
- package/src/PredefinedConfig/Common/RowSummary.js +16 -0
- 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 +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 +23 -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/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.d.ts +6 -0
- 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
|
@@ -27,28 +27,29 @@ export class DashboardModule extends AdaptableModuleBase {
|
|
|
27
27
|
if (this.isModuleAvailable()) {
|
|
28
28
|
let menuItems = [];
|
|
29
29
|
if (this.isModuleEditable()) {
|
|
30
|
-
menuItems.push(this.createColumnMenuItemClickFunction('Configure', 'settings', () => this.api.dashboardApi.openDashboardSettingsPanel()));
|
|
30
|
+
menuItems.push(this.createColumnMenuItemClickFunction('dashboard-configure', 'Configure', 'settings', () => this.api.dashboardApi.openDashboardSettingsPanel()));
|
|
31
31
|
}
|
|
32
32
|
if (this.api.dashboardApi.getDashboardState().IsCollapsed) {
|
|
33
|
-
menuItems.push(this.createColumnMenuItemReduxAction('Expand', 'expand', DashboardRedux.DashboardSetIsCollapsed(false)));
|
|
33
|
+
menuItems.push(this.createColumnMenuItemReduxAction('dashboard-expand', 'Expand', 'expand', DashboardRedux.DashboardSetIsCollapsed(false)));
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
menuItems.push(this.createColumnMenuItemReduxAction('Collapse', 'collapse', DashboardRedux.DashboardSetIsCollapsed(true)));
|
|
36
|
+
menuItems.push(this.createColumnMenuItemReduxAction('dashboard-collapse', 'Collapse', 'collapse', DashboardRedux.DashboardSetIsCollapsed(true)));
|
|
37
37
|
}
|
|
38
38
|
if (this.api.dashboardApi.getDashboardState().IsFloating) {
|
|
39
|
-
menuItems.push(this.createColumnMenuItemReduxAction('Dock', 'dock', DashboardRedux.DashboardSetIsFloating(false)));
|
|
39
|
+
menuItems.push(this.createColumnMenuItemReduxAction('dashboard-dock', 'Dock', 'dock', DashboardRedux.DashboardSetIsFloating(false)));
|
|
40
40
|
}
|
|
41
41
|
else if (this.api.optionsApi.getDashboardOptions().canFloat) {
|
|
42
|
-
menuItems.push(this.createColumnMenuItemReduxAction('Float', 'dock', DashboardRedux.DashboardSetIsFloating(true)));
|
|
42
|
+
menuItems.push(this.createColumnMenuItemReduxAction('dashboard-float', 'Float', 'dock', DashboardRedux.DashboardSetIsFloating(true)));
|
|
43
43
|
}
|
|
44
44
|
if (this.api.dashboardApi.getDashboardState().IsHidden) {
|
|
45
|
-
menuItems.push(this.createColumnMenuItemReduxAction('Show', 'visibility-on-bold', DashboardRedux.DashboardSetIsHidden(false)));
|
|
45
|
+
menuItems.push(this.createColumnMenuItemReduxAction('dashboard-show', 'Show', 'visibility-on-bold', DashboardRedux.DashboardSetIsHidden(false)));
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
|
-
menuItems.push(this.createColumnMenuItemReduxAction('Hide', 'visibility-off-bold', DashboardRedux.DashboardSetIsHidden(true)));
|
|
48
|
+
menuItems.push(this.createColumnMenuItemReduxAction('dashboard-hide', 'Hide', 'visibility-off-bold', DashboardRedux.DashboardSetIsHidden(true)));
|
|
49
49
|
}
|
|
50
50
|
return [
|
|
51
51
|
{
|
|
52
|
+
name: 'dashboard',
|
|
52
53
|
label: this.moduleInfo.FriendlyName,
|
|
53
54
|
isVisible: true,
|
|
54
55
|
module: this.moduleInfo.ModuleName,
|
|
@@ -26,6 +26,6 @@ export class DataImportModule extends AdaptableModuleBase {
|
|
|
26
26
|
source: source,
|
|
27
27
|
maxWidth: this.getPopupMaxWidth(),
|
|
28
28
|
};
|
|
29
|
-
return this.createColumnMenuItemShowPopup('Import Data', this.moduleInfo.Popup, this.moduleInfo.Glyph, moduleParams);
|
|
29
|
+
return this.createColumnMenuItemShowPopup('data-import', 'Import Data', this.moduleInfo.Popup, this.moduleInfo.Glyph, moduleParams);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -15,6 +15,7 @@ export declare class ExportModule extends AdaptableModuleBase implements IExport
|
|
|
15
15
|
addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
16
16
|
private buildReportMenuItems;
|
|
17
17
|
private buildExportMenuItem;
|
|
18
|
+
private getMenuName;
|
|
18
19
|
export(report: Report, exportDestination: ExportDestination | string): Promise<void>;
|
|
19
20
|
private preProcessExport;
|
|
20
21
|
private isCustomDestination;
|
|
@@ -86,15 +86,16 @@ export class ExportModule extends AdaptableModuleBase {
|
|
|
86
86
|
buildReportMenuItems(report) {
|
|
87
87
|
const menuItems = [];
|
|
88
88
|
for (const destination of this.api.exportApi.getAvailableExportDestinations()) {
|
|
89
|
-
menuItems.push(this.createColumnMenuItemClickFunction(destination, this.moduleInfo.Glyph, () => this.export(report, destination)));
|
|
89
|
+
menuItems.push(this.createColumnMenuItemClickFunction(this.getMenuName(destination), destination, this.moduleInfo.Glyph, () => this.export(report, destination)));
|
|
90
90
|
}
|
|
91
91
|
for (const customDestination of this.api.exportApi.getCustomDestinations()) {
|
|
92
|
-
menuItems.push(this.createColumnMenuItemClickFunction(customDestination.name, this.moduleInfo.Glyph, () => this.export(report, customDestination.name)));
|
|
92
|
+
menuItems.push(this.createColumnMenuItemClickFunction('export-custom-destination', customDestination.name, this.moduleInfo.Glyph, () => this.export(report, customDestination.name)));
|
|
93
93
|
}
|
|
94
94
|
return menuItems;
|
|
95
95
|
}
|
|
96
96
|
buildExportMenuItem(label, subItems) {
|
|
97
97
|
return {
|
|
98
|
+
name: 'export',
|
|
98
99
|
label: label,
|
|
99
100
|
module: this.moduleInfo.ModuleName,
|
|
100
101
|
isVisible: true,
|
|
@@ -102,6 +103,20 @@ export class ExportModule extends AdaptableModuleBase {
|
|
|
102
103
|
subItems: subItems,
|
|
103
104
|
};
|
|
104
105
|
}
|
|
106
|
+
getMenuName(exportDestination) {
|
|
107
|
+
switch (exportDestination) {
|
|
108
|
+
case ExportDestination.CSV:
|
|
109
|
+
return 'export-csv';
|
|
110
|
+
case ExportDestination.Clipboard:
|
|
111
|
+
return 'export-clipboard';
|
|
112
|
+
case ExportDestination.Excel:
|
|
113
|
+
return 'export-excel';
|
|
114
|
+
case ExportDestination.JSON:
|
|
115
|
+
return 'export-json';
|
|
116
|
+
case ExportDestination.Table:
|
|
117
|
+
return 'export-table';
|
|
118
|
+
}
|
|
119
|
+
}
|
|
105
120
|
async export(report, exportDestination) {
|
|
106
121
|
var _a;
|
|
107
122
|
const cleanupExportProcess = () => {
|
|
@@ -27,6 +27,7 @@ export class Fdc3Module extends AdaptableModuleBase {
|
|
|
27
27
|
contextMenuItems.sort((a, b) => a.label.localeCompare(b.label));
|
|
28
28
|
if (contextMenuItems.length > 1) {
|
|
29
29
|
const groupMenuItem = {
|
|
30
|
+
name: 'fdc3',
|
|
30
31
|
module: this.moduleInfo.ModuleName,
|
|
31
32
|
label: 'FDC3',
|
|
32
33
|
icon: {
|
|
@@ -44,6 +45,7 @@ export class Fdc3Module extends AdaptableModuleBase {
|
|
|
44
45
|
var _a, _b, _c;
|
|
45
46
|
const { intentType, contextType } = intentConfig;
|
|
46
47
|
const menuItem = {
|
|
48
|
+
name: 'fdc3-raise-intent',
|
|
47
49
|
label: `Raise ${intentType}`,
|
|
48
50
|
onClick: () => {
|
|
49
51
|
this.getFdc3Api().raiseIntentFromRow(rowNode, intentType, contextType);
|
|
@@ -63,6 +65,7 @@ export class Fdc3Module extends AdaptableModuleBase {
|
|
|
63
65
|
var _a, _b, _c;
|
|
64
66
|
const { contextType } = contextConfig;
|
|
65
67
|
const menuItem = {
|
|
68
|
+
name: 'fdc3-broadcast',
|
|
66
69
|
label: `Broadcast ${this.getFdc3Api().getContextLabel(contextType)}`,
|
|
67
70
|
onClick: () => {
|
|
68
71
|
this.getFdc3Api().broadcastFromRow(rowNode, contextType);
|
|
@@ -69,11 +69,11 @@ export class FlashingCellModule extends AdaptableModuleBase {
|
|
|
69
69
|
});
|
|
70
70
|
if (flashingCellForCurrentColumn) {
|
|
71
71
|
return [
|
|
72
|
-
this.createColumnMenuItemReduxAction('
|
|
72
|
+
this.createColumnMenuItemReduxAction('flashing-cell-delete', 'Delete Flashing Cell', this.moduleInfo.Glyph, FlashingCellRedux.FlashingCellDefinitionDelete(flashingCellForCurrentColumn)),
|
|
73
73
|
];
|
|
74
74
|
}
|
|
75
75
|
return [
|
|
76
|
-
this.createColumnMenuItemReduxAction('Add Flashing Cell', this.moduleInfo.Glyph, FlashingCellRedux.FlashingCellDefinitionAdd({
|
|
76
|
+
this.createColumnMenuItemReduxAction('flashing-cell-add', 'Add Flashing Cell', this.moduleInfo.Glyph, FlashingCellRedux.FlashingCellDefinitionAdd({
|
|
77
77
|
Scope: {
|
|
78
78
|
ColumnIds: [column.columnId],
|
|
79
79
|
},
|
|
@@ -95,11 +95,11 @@ export class FlashingCellModule extends AdaptableModuleBase {
|
|
|
95
95
|
if (flashingCellForRow.flashTarget === 'row' ||
|
|
96
96
|
(Array.isArray(flashingCellForRow === null || flashingCellForRow === void 0 ? void 0 : flashingCellForRow.flashTarget) &&
|
|
97
97
|
flashingCellForRow.flashTarget.includes('row'))) {
|
|
98
|
-
items.push(this.createColumnMenuItemReduxAction('Clear Flashing Row', this.moduleInfo.Glyph, SystemRedux.SystemFlashingCellDelete(flashingCellForRow)));
|
|
98
|
+
items.push(this.createColumnMenuItemReduxAction('flashing-row-clear', 'Clear Flashing Row', this.moduleInfo.Glyph, SystemRedux.SystemFlashingCellDelete(flashingCellForRow)));
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
else if (flashingCellForCell && flashingCellForCell.flashTarget === 'cell') {
|
|
102
|
-
items.push(this.createColumnMenuItemReduxAction('Clear Flashing Cell', this.moduleInfo.Glyph, SystemRedux.SystemFlashingCellDelete(flashingCellForCell)));
|
|
102
|
+
items.push(this.createColumnMenuItemReduxAction('flashing-cell-clear', 'Clear Flashing Cell', this.moduleInfo.Glyph, SystemRedux.SystemFlashingCellDelete(flashingCellForCell)));
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -45,12 +45,12 @@ export class FormatColumnModule extends AdaptableModuleBase {
|
|
|
45
45
|
action: 'New',
|
|
46
46
|
source: 'ColumnMenu',
|
|
47
47
|
};
|
|
48
|
-
const createFormatColumnMenuItem = this.createColumnMenuItemShowPopup('Create', this.moduleInfo.Popup, 'plus', createPopupParam);
|
|
48
|
+
const createFormatColumnMenuItem = this.createColumnMenuItemShowPopup('format-column-add', 'Create', this.moduleInfo.Popup, 'plus', createPopupParam);
|
|
49
49
|
const formatColumnsForColumn = this.api.formatColumnApi.getFormatColumnsForColumnId(column.columnId);
|
|
50
50
|
// .filter((fc) => this.api.scopeApi.isSingleColumnScope(fc.Scope));
|
|
51
51
|
// if no formats then just show Create
|
|
52
52
|
if (ArrayExtensions.IsNullOrEmpty(formatColumnsForColumn)) {
|
|
53
|
-
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup('Create Format Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, createPopupParam));
|
|
53
|
+
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup('format-column-add', 'Create Format Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, createPopupParam));
|
|
54
54
|
// if 1 format then show a Create and an Edit
|
|
55
55
|
}
|
|
56
56
|
else if (formatColumnsForColumn.length == 1) {
|
|
@@ -60,8 +60,9 @@ export class FormatColumnModule extends AdaptableModuleBase {
|
|
|
60
60
|
value: formatColumnsForColumn[0],
|
|
61
61
|
source: 'ColumnMenu',
|
|
62
62
|
};
|
|
63
|
-
const editFormatColumnMenuItem = this.createColumnMenuItemShowPopup('Edit', this.moduleInfo.Popup, 'edit', editPopupParam);
|
|
63
|
+
const editFormatColumnMenuItem = this.createColumnMenuItemShowPopup('format-column-edit', 'Edit', this.moduleInfo.Popup, 'edit', editPopupParam);
|
|
64
64
|
returnColumnMenuItems.push({
|
|
65
|
+
name: 'format-column',
|
|
65
66
|
label: 'Format Column',
|
|
66
67
|
module: this.moduleInfo.ModuleName,
|
|
67
68
|
isVisible: true,
|
|
@@ -76,8 +77,9 @@ export class FormatColumnModule extends AdaptableModuleBase {
|
|
|
76
77
|
const moduleInfo = this.api.internalApi
|
|
77
78
|
.getModuleService()
|
|
78
79
|
.getModuleInfoByModule('FormatColumn');
|
|
79
|
-
const editFormatColumnMenuItem = this.createColumnMenuItemReduxAction('Show Current', this.moduleInfo.Glyph, PopupRedux.PopupShowScreen('FormatColumn', moduleInfo.Popup));
|
|
80
|
+
const editFormatColumnMenuItem = this.createColumnMenuItemReduxAction('format-column-edit', 'Show Current', this.moduleInfo.Glyph, PopupRedux.PopupShowScreen('FormatColumn', moduleInfo.Popup));
|
|
80
81
|
returnColumnMenuItems.push({
|
|
82
|
+
name: 'format-column',
|
|
81
83
|
label: 'Format Column',
|
|
82
84
|
module: this.moduleInfo.ModuleName,
|
|
83
85
|
isVisible: true,
|
|
@@ -28,7 +28,7 @@ export class FreeTextColumnModule extends AdaptableModuleBase {
|
|
|
28
28
|
source: 'ColumnMenu',
|
|
29
29
|
};
|
|
30
30
|
return [
|
|
31
|
-
this.createColumnMenuItemShowPopup('Edit Free Text Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
31
|
+
this.createColumnMenuItemShowPopup('free-text-column-edit', 'Edit Free Text Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
32
32
|
];
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -11,6 +11,7 @@ export class GridInfoModule extends AdaptableModuleBase {
|
|
|
11
11
|
if (this.isModuleAvailable()) {
|
|
12
12
|
return [
|
|
13
13
|
this.createMainMenuItemShowPopup({
|
|
14
|
+
Name: 'grid-info',
|
|
14
15
|
Label: 'Grid Info',
|
|
15
16
|
ComponentName: this.moduleInfo.Popup,
|
|
16
17
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -22,6 +23,7 @@ export class GridInfoModule extends AdaptableModuleBase {
|
|
|
22
23
|
if (this.isModuleAvailable()) {
|
|
23
24
|
return [
|
|
24
25
|
this.createMainMenuItemShowPopup({
|
|
26
|
+
Name: 'grid-info',
|
|
25
27
|
Label: 'Grid Info',
|
|
26
28
|
ComponentName: this.moduleInfo.Popup,
|
|
27
29
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -15,8 +15,9 @@ import { SHOW_PIVOT_COLUMN_DETAILS } from '../View/Components/Popups/WindowPopup
|
|
|
15
15
|
import flattenDeep from 'lodash/flattenDeep';
|
|
16
16
|
import StringExtensions from '../Utilities/Extensions/StringExtensions';
|
|
17
17
|
import { getGridFilterViewItems } from '../View/Layout/Wizard/getGridFilterPreview';
|
|
18
|
+
import { AggregatedScalarLiveValue } from '../Utilities/Services/AggregatedScalarLiveValue';
|
|
18
19
|
import { SystemRowSummartSet } from '../Redux/ActionsReducers/SystemRedux';
|
|
19
|
-
import { ROW_SUMMARY_ROW_ID } from '../PredefinedConfig/Common/RowSummary';
|
|
20
|
+
import { ROW_SUMMARY_ROW_ID, WEIGHTED_AVERAGE_AGGREATED_FUNCTION, } from '../PredefinedConfig/Common/RowSummary';
|
|
20
21
|
import Helper from '../Utilities/Helpers/Helper';
|
|
21
22
|
export class LayoutModule extends AdaptableModuleBase {
|
|
22
23
|
constructor(api) {
|
|
@@ -144,7 +145,7 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
144
145
|
if (this.isModuleEditable()) {
|
|
145
146
|
const isReadOnlyLayout = this.api.layoutApi.isCurrentLayoutReadOnly();
|
|
146
147
|
if (!isReadOnlyLayout) {
|
|
147
|
-
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup('Edit Layout', this.moduleInfo.Popup, this.moduleInfo.Glyph, {
|
|
148
|
+
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup('layout-edit', 'Edit Layout', this.moduleInfo.Popup, this.moduleInfo.Glyph, {
|
|
148
149
|
action: 'Edit',
|
|
149
150
|
source: 'ColumnMenu',
|
|
150
151
|
value: this.api.layoutApi.getCurrentLayout(),
|
|
@@ -152,10 +153,10 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
152
153
|
}
|
|
153
154
|
if (column) {
|
|
154
155
|
if (!isReadOnlyLayout) {
|
|
155
|
-
returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('Change Caption', 'edit', () => this.api.layoutApi.showChangeColumnCaption(column)));
|
|
156
|
+
returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('layout-column-caption-change', 'Change Caption', 'edit', () => this.api.layoutApi.showChangeColumnCaption(column)));
|
|
156
157
|
}
|
|
157
158
|
if (column.hideable) {
|
|
158
|
-
returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('Hide Column', 'visibility-off-bold', () => {
|
|
159
|
+
returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('layout-column-hide', 'Hide Column', 'visibility-off-bold', () => {
|
|
159
160
|
this.api.columnApi.hideColumn(column.columnId);
|
|
160
161
|
}));
|
|
161
162
|
}
|
|
@@ -164,23 +165,24 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
164
165
|
if (column) {
|
|
165
166
|
const hasExistingSelection = (_b = (_a = this.api.gridApi.getSelectedCellInfo()) === null || _a === void 0 ? void 0 : _a.gridCells) === null || _b === void 0 ? void 0 : _b.length;
|
|
166
167
|
if (hasExistingSelection) {
|
|
167
|
-
selectMenuItems.push(this.createColumnMenuItemClickFunction('Column (Preserve Selection)', 'column-add', () => {
|
|
168
|
+
selectMenuItems.push(this.createColumnMenuItemClickFunction('layout-column-select-preserve', 'Column (Preserve Selection)', 'column-add', () => {
|
|
168
169
|
this.api.columnApi.addColumnToSelection(column.columnId);
|
|
169
170
|
}));
|
|
170
|
-
selectMenuItems.push(this.createColumnMenuItemClickFunction('Column (Reset Selection)', 'columns', () => {
|
|
171
|
+
selectMenuItems.push(this.createColumnMenuItemClickFunction('layout-column-select-reset', 'Column (Reset Selection)', 'columns', () => {
|
|
171
172
|
this.api.columnApi.selectColumn(column.columnId);
|
|
172
173
|
}));
|
|
173
174
|
}
|
|
174
175
|
else {
|
|
175
|
-
selectMenuItems.push(this.createColumnMenuItemClickFunction('Column', 'columns', () => {
|
|
176
|
+
selectMenuItems.push(this.createColumnMenuItemClickFunction('layout-column-select', 'Column', 'columns', () => {
|
|
176
177
|
this.api.columnApi.selectColumn(column.columnId);
|
|
177
178
|
}));
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
|
-
selectMenuItems.push(this.createColumnMenuItemClickFunction('Whole Grid', this.moduleInfo.Glyph, () => {
|
|
181
|
+
selectMenuItems.push(this.createColumnMenuItemClickFunction('layout-select-all', 'Whole Grid', this.moduleInfo.Glyph, () => {
|
|
181
182
|
this.api.gridApi.selectAll();
|
|
182
183
|
}));
|
|
183
184
|
returnColumnMenuItems.push({
|
|
185
|
+
name: 'layout-select',
|
|
184
186
|
label: 'Select',
|
|
185
187
|
isVisible: true,
|
|
186
188
|
module: this.moduleInfo.ModuleName,
|
|
@@ -195,7 +197,7 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
195
197
|
addContextMenuItems(menuContext) {
|
|
196
198
|
let returnColumnMenuItems = [];
|
|
197
199
|
if (this.isModuleEditable() && !this.api.layoutApi.isCurrentLayoutReadOnly()) {
|
|
198
|
-
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup('Edit Layout', this.moduleInfo.Popup, this.moduleInfo.Glyph, {
|
|
200
|
+
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup('layout-edit', 'Edit Layout', this.moduleInfo.Popup, this.moduleInfo.Glyph, {
|
|
199
201
|
action: 'Edit',
|
|
200
202
|
source: 'ColumnMenu',
|
|
201
203
|
}));
|
|
@@ -207,18 +209,19 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
207
209
|
let clickFunction = () => {
|
|
208
210
|
this.api.gridApi.deselectAll();
|
|
209
211
|
};
|
|
210
|
-
returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('Clear Selected Cells', 'undo', clickFunction));
|
|
212
|
+
returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('layout-clear-selection', 'Clear Selected Cells', 'undo', clickFunction));
|
|
211
213
|
if (this.isModuleAvailable()) {
|
|
212
214
|
let gridMenuItems = [];
|
|
213
215
|
let autoSizeFunction = () => {
|
|
214
216
|
this.api.columnApi.autosizeAllColumns();
|
|
215
217
|
};
|
|
216
|
-
gridMenuItems.push(this.createColumnMenuItemClickFunction('Auto Size', 'arrow-expand', autoSizeFunction));
|
|
218
|
+
gridMenuItems.push(this.createColumnMenuItemClickFunction('layout-auto-size', 'Auto Size', 'arrow-expand', autoSizeFunction));
|
|
217
219
|
let clickFunction = () => {
|
|
218
220
|
this.api.gridApi.selectAll();
|
|
219
221
|
};
|
|
220
|
-
gridMenuItems.push(this.createColumnMenuItemClickFunction('Select', 'tab-unselected', clickFunction));
|
|
222
|
+
gridMenuItems.push(this.createColumnMenuItemClickFunction('layout-select-all', 'Select', 'tab-unselected', clickFunction));
|
|
221
223
|
returnColumnMenuItems.push({
|
|
224
|
+
name: 'layout-grid',
|
|
222
225
|
label: 'Grid',
|
|
223
226
|
module: this.moduleInfo.ModuleName,
|
|
224
227
|
isVisible: true,
|
|
@@ -290,6 +293,7 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
290
293
|
pivotColumnId,
|
|
291
294
|
};
|
|
292
295
|
return {
|
|
296
|
+
name: 'layout-aggregated-view',
|
|
293
297
|
module: this.moduleInfo.ModuleName,
|
|
294
298
|
isVisible: true,
|
|
295
299
|
label: 'Expand Aggregated Value',
|
|
@@ -464,6 +468,7 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
464
468
|
*/
|
|
465
469
|
evaluateRowSummary(reason) {
|
|
466
470
|
var _a;
|
|
471
|
+
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
467
472
|
const rowSummaries = (_a = this.api.layoutApi.getCurrentLayout().RowSummaries) !== null && _a !== void 0 ? _a : [];
|
|
468
473
|
const rowSummariesResults = rowSummaries.map(({ ColumnsMap, Position }) => {
|
|
469
474
|
return {
|
|
@@ -482,17 +487,21 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
482
487
|
}
|
|
483
488
|
if (!expressionLiveValue) {
|
|
484
489
|
try {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
.
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
490
|
+
let aggregatedScalarExpression = `${expression}([${columnId}])`;
|
|
491
|
+
if (aggregatedScalarExpression.includes(WEIGHTED_AVERAGE_AGGREATED_FUNCTION) &&
|
|
492
|
+
currentLayout.AggregationColumns[columnId] &&
|
|
493
|
+
typeof currentLayout.AggregationColumns[columnId] === 'object') {
|
|
494
|
+
const weight = currentLayout.AggregationColumns[columnId]
|
|
495
|
+
.weightedColumnId;
|
|
496
|
+
if (weight) {
|
|
497
|
+
aggregatedScalarExpression = `AVG([${columnId}], WEIGHT([${weight}]))`;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
expressionLiveValue = new AggregatedScalarLiveValue({
|
|
501
|
+
aggregatedScalarExpression,
|
|
502
|
+
}, ModuleConstants.LayoutModuleId, this.api, () => {
|
|
503
|
+
return this.api.gridApi.getVisibleRowNodes();
|
|
504
|
+
});
|
|
496
505
|
}
|
|
497
506
|
catch (e) {
|
|
498
507
|
this.api.logError('Error evaluating row summary', e);
|
|
@@ -41,12 +41,12 @@ export class NoteModule extends AdaptableModuleBase {
|
|
|
41
41
|
ColumnId: menuContext.adaptableColumn.columnId,
|
|
42
42
|
})) !== null && _a !== void 0 ? _a : [];
|
|
43
43
|
if (note) {
|
|
44
|
-
items.push(this.createColumnMenuItemClickFunction('Remove Note', this.moduleInfo.Glyph, () => {
|
|
44
|
+
items.push(this.createColumnMenuItemClickFunction('note-remove', 'Remove Note', this.moduleInfo.Glyph, () => {
|
|
45
45
|
this.api.noteApi.deleteNote(note);
|
|
46
46
|
}));
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
|
-
items.push(this.createColumnMenuItemClickFunction('Add Note', this.moduleInfo.Glyph, () => {
|
|
49
|
+
items.push(this.createColumnMenuItemClickFunction('note-add', 'Add Note', this.moduleInfo.Glyph, () => {
|
|
50
50
|
// add an empty one
|
|
51
51
|
this.api.noteApi.addNote('', menuContext.primaryKeyValue, menuContext.adaptableColumn.columnId);
|
|
52
52
|
this.api.internalApi.getCellPopupService().showPopup({
|
|
@@ -60,7 +60,7 @@ export class PlusMinusModule extends AdaptableModuleBase {
|
|
|
60
60
|
source: 'ColumnMenu',
|
|
61
61
|
};
|
|
62
62
|
return [
|
|
63
|
-
this.createColumnMenuItemShowPopup('Create Plus/Minus Rule', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
63
|
+
this.createColumnMenuItemShowPopup('plus-minus-add', 'Create Plus/Minus Rule', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
64
64
|
];
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -9,17 +9,17 @@ export class SettingsPanelModule extends AdaptableModuleBase {
|
|
|
9
9
|
addColumnMenuItems(column) {
|
|
10
10
|
return [
|
|
11
11
|
// To do : get the icon and name from settings in case they have changed?
|
|
12
|
-
this.createColumnMenuItemReduxAction('Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen()),
|
|
12
|
+
this.createColumnMenuItemReduxAction('settings-panel-open', 'Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen()),
|
|
13
13
|
];
|
|
14
14
|
}
|
|
15
15
|
addContextMenuItems(menuContext) {
|
|
16
16
|
return [
|
|
17
|
-
this.createColumnMenuItemReduxAction('Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen()),
|
|
17
|
+
this.createColumnMenuItemReduxAction('settings-panel-open', 'Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen()),
|
|
18
18
|
];
|
|
19
19
|
}
|
|
20
20
|
addModuleMenuItem(source) {
|
|
21
21
|
if (this.isModuleAvailable()) {
|
|
22
|
-
return this.createColumnMenuItemReduxAction('Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen());
|
|
22
|
+
return this.createColumnMenuItemReduxAction('settings-panel-open', 'Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen());
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -27,7 +27,7 @@ export class SmartEditModule extends AdaptableModuleBase {
|
|
|
27
27
|
let popUpParams = {
|
|
28
28
|
source: 'ContextMenu',
|
|
29
29
|
};
|
|
30
|
-
menuItemShowPopup = this.createMainMenuItemShowPopup({
|
|
30
|
+
menuItemShowPopup = this.createMainMenuItemShowPopup({ Name: 'smart-edit-apply',
|
|
31
31
|
Label: 'Apply Smart Edit',
|
|
32
32
|
ComponentName: this.moduleInfo.Popup,
|
|
33
33
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -53,7 +53,7 @@ export class StyledColumnModule extends AdaptableModuleBase {
|
|
|
53
53
|
defaultCurrentSectionName: 'Settings',
|
|
54
54
|
},
|
|
55
55
|
};
|
|
56
|
-
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup(label + 'Sparkline Column', this.moduleInfo.Popup, this.getGlyphForStyledColumn(styledColumn), popupParam));
|
|
56
|
+
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup('styled-column-sparkline', label + 'Sparkline Column', this.moduleInfo.Popup, this.getGlyphForStyledColumn(styledColumn), popupParam));
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
// Next do non sparkline
|
|
@@ -78,7 +78,8 @@ export class StyledColumnModule extends AdaptableModuleBase {
|
|
|
78
78
|
};
|
|
79
79
|
const icon = this.getGlyphForStyledColumn(styledColumn);
|
|
80
80
|
const label = `Edit ${this.getTypeLabel(styledColumn)} Style`;
|
|
81
|
-
|
|
81
|
+
const name = this.getTypeName(styledColumn);
|
|
82
|
+
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup(name, label, this.moduleInfo.Popup, icon, popupParam));
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
else {
|
|
@@ -90,7 +91,7 @@ export class StyledColumnModule extends AdaptableModuleBase {
|
|
|
90
91
|
config: {},
|
|
91
92
|
};
|
|
92
93
|
const badgeLabel = column.dataType === 'Number' ? 'Badge' : 'Create Badge Style';
|
|
93
|
-
const newBadgeButton = this.createColumnMenuItemShowPopup(badgeLabel, this.moduleInfo.Popup, 'badge', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { BadgeStyle: {
|
|
94
|
+
const newBadgeButton = this.createColumnMenuItemShowPopup('styled-column-badge', badgeLabel, this.moduleInfo.Popup, 'badge', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { BadgeStyle: {
|
|
94
95
|
Badges: [ObjectFactory.CreateDefaultStyledColumnBadge()],
|
|
95
96
|
} }), config: {
|
|
96
97
|
defaultCurrentSectionName: 'Badges',
|
|
@@ -102,17 +103,18 @@ export class StyledColumnModule extends AdaptableModuleBase {
|
|
|
102
103
|
const emptyRanges = this.api.scopeApi.createCellColorRangesForScope({
|
|
103
104
|
ColumnIds: [column.columnId],
|
|
104
105
|
});
|
|
105
|
-
const newGrandientButton = this.createColumnMenuItemShowPopup('Gradient', this.moduleInfo.Popup, 'gradient', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { GradientStyle: {
|
|
106
|
+
const newGrandientButton = this.createColumnMenuItemShowPopup('styled-column-gradient', 'Gradient', this.moduleInfo.Popup, 'gradient', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { GradientStyle: {
|
|
106
107
|
CellRanges: emptyRanges,
|
|
107
108
|
} }), config: {
|
|
108
109
|
defaultCurrentSectionName: 'Style',
|
|
109
110
|
} }));
|
|
110
|
-
const newPrecentBarButton = this.createColumnMenuItemShowPopup('Percent Bar', this.moduleInfo.Popup, 'percent', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { PercentBarStyle: {
|
|
111
|
+
const newPrecentBarButton = this.createColumnMenuItemShowPopup('styled-column-percent-bar', 'Percent Bar', this.moduleInfo.Popup, 'percent', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { PercentBarStyle: {
|
|
111
112
|
CellRanges: emptyRanges,
|
|
112
113
|
} }), config: {
|
|
113
114
|
defaultCurrentSectionName: 'Style',
|
|
114
115
|
} }));
|
|
115
116
|
returnColumnMenuItems.push({
|
|
117
|
+
name: 'styled-column',
|
|
116
118
|
label: 'Create Styled Column',
|
|
117
119
|
module: this.moduleInfo.ModuleName,
|
|
118
120
|
isVisible: true,
|
|
@@ -230,4 +232,20 @@ export class StyledColumnModule extends AdaptableModuleBase {
|
|
|
230
232
|
}
|
|
231
233
|
return type;
|
|
232
234
|
}
|
|
235
|
+
getTypeName(styledColumn) {
|
|
236
|
+
let type = null;
|
|
237
|
+
if (styledColumn.GradientStyle) {
|
|
238
|
+
type = 'styled-column-gradient';
|
|
239
|
+
}
|
|
240
|
+
else if (styledColumn.PercentBarStyle) {
|
|
241
|
+
type = 'styled-column-percent-bar';
|
|
242
|
+
}
|
|
243
|
+
else if (styledColumn.SparkLineStyle) {
|
|
244
|
+
type = 'styled-column-sparkline';
|
|
245
|
+
}
|
|
246
|
+
else if (styledColumn.BadgeStyle) {
|
|
247
|
+
type = 'styled-column-badge';
|
|
248
|
+
}
|
|
249
|
+
return type;
|
|
250
|
+
}
|
|
233
251
|
}
|
|
@@ -8,7 +8,7 @@ export class SystemStatusModule extends AdaptableModuleBase {
|
|
|
8
8
|
addColumnMenuItems(column) {
|
|
9
9
|
if (this.isModuleAvailable()) {
|
|
10
10
|
return [
|
|
11
|
-
this.createColumnMenuItemShowPopup('Show System Status', this.moduleInfo.Popup, this.moduleInfo.Glyph),
|
|
11
|
+
this.createColumnMenuItemShowPopup('system-status-show', 'Show System Status', this.moduleInfo.Popup, this.moduleInfo.Glyph),
|
|
12
12
|
];
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -18,7 +18,7 @@ export class SystemStatusModule extends AdaptableModuleBase {
|
|
|
18
18
|
source: 'ContextMenu',
|
|
19
19
|
};
|
|
20
20
|
return [
|
|
21
|
-
this.createMainMenuItemShowPopup({
|
|
21
|
+
this.createMainMenuItemShowPopup({ Name: 'system-status-show',
|
|
22
22
|
Label: 'Show System Status',
|
|
23
23
|
ComponentName: this.moduleInfo.Popup,
|
|
24
24
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { IRowNode } from '@ag-grid-community/core';
|
|
1
2
|
import { ExpressionFunction } from '../../parser/src/types';
|
|
2
3
|
import { BaseParameter } from './expressionFunctionUtils';
|
|
3
|
-
import { IRowNode } from '@ag-grid-community/core';
|
|
4
4
|
import { AggregateParams } from './scalarAggregationHelper';
|
|
5
5
|
/**
|
|
6
6
|
* List of all the AggregatedScalar Functions available in AdaptableQL
|
|
7
7
|
*/
|
|
8
8
|
export type AggregatedScalarFunctionName = ScalarAggregationFunction | OperandFunction;
|
|
9
|
-
export type ScalarAggregationFunction = 'SUM' | 'PERCENTAGE' | 'QUANT' | 'QUARTILE' | 'PERCENTILE' | 'AVG' | 'MIN' | 'MAX' | 'COUNT' | 'CUMUL' | 'MEDIAN' | 'MODE' | 'DISTINCT' | 'ONLY' | 'STD_DEVIATION';
|
|
9
|
+
export type ScalarAggregationFunction = 'SUM' | 'PERCENTAGE' | 'QUANT' | 'QUARTILE' | 'PERCENTILE' | 'AVG' | 'MIN' | 'MAX' | 'COUNT' | 'CUMUL' | 'MEDIAN' | 'MODE' | 'DISTINCT' | 'ONLY' | 'STD_DEVIATION' | 'OLDEST' | 'YOUNGEST';
|
|
10
10
|
type OperandFunction = 'COL' | 'OVER' | 'GROUP_BY' | 'WEIGHT';
|
|
11
11
|
export interface ScalarAggregationParameter extends BaseParameter<'aggregationScalar', ScalarAggregationFunction> {
|
|
12
12
|
value: AggregatedScalarExpressionEvaluation;
|