@adaptabletools/adaptable 12.1.8-canary.0 → 12.2.0-canary.1
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/base.css +116 -22
- package/bundle.cjs.js +108 -108
- package/index.css +132 -23
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +44 -10
- package/src/AdaptableOptions/FinancePluginOptions.d.ts +5 -11
- package/src/AdaptableOptions/GeneralOptions.d.ts +19 -1
- package/src/AdaptableOptions/StateOptions.d.ts +1 -1
- package/src/Api/Implementation/AlertApiImpl.js +1 -2
- package/src/Api/Implementation/CellSummaryApiImpl.d.ts +5 -0
- package/src/Api/Implementation/CellSummaryApiImpl.js +23 -1
- package/src/Api/Implementation/InternalApiImpl.d.ts +3 -1
- package/src/Api/Implementation/InternalApiImpl.js +34 -0
- package/src/Api/Implementation/LayoutApiImpl.js +2 -2
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +1 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.js +5 -0
- package/src/Api/InternalApi.d.ts +6 -1
- package/src/Api/QueryLanguageApi.d.ts +5 -0
- package/src/Strategy/BulkUpdateModule.d.ts +1 -1
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/QueryModule.js +1 -1
- package/src/Strategy/Utilities/Export/getExportRowsViewItems.js +0 -13
- package/src/Strategy/Utilities/getExpressionViewItems.d.ts +3 -4
- package/src/Strategy/Utilities/getExpressionViewItems.js +3 -3
- package/src/Strategy/Utilities/getRuleViewItems.js +1 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -0
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +2 -0
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +14 -0
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +2 -0
- package/src/Utilities/Services/QueryLanguageService.d.ts +2 -1
- package/src/Utilities/Services/QueryLanguageService.js +45 -19
- package/src/Utilities/Services/ReportService.js +1 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.d.ts +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.js +10 -10
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.d.ts +3 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.js +9 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +13 -15
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.d.ts +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts +7 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +280 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/index.d.ts +1 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/index.js +5 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.d.ts +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +4 -4
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +2 -8
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.d.ts +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +3 -3
- package/src/View/AdaptableWizardView/Wizard.js +2 -2
- package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +0 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +1 -8
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +6 -5
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
- package/src/View/Components/AdaptableObjectCollection/index.d.ts +3 -4
- package/src/View/Components/AdaptableObjectCollection/index.js +7 -8
- package/src/View/Components/AdaptableObjectRow/index.js +1 -4
- package/src/View/Components/EntityRulesEditor/index.js +3 -3
- package/src/View/Components/FilterForm/QuickFilterForm.js +9 -1
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.d.ts +1 -0
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +2 -1
- package/src/View/Components/ValueSelector/index.js +8 -19
- package/src/View/CustomSort/CustomSortSummary.js +1 -1
- package/src/View/Dashboard/DashboardPopup.js +11 -10
- package/src/View/Export/ExportViewPanel.js +2 -2
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +4 -3
- package/src/View/Filter/FilterViewPanel.js +3 -2
- package/src/View/GridInfo/AdaptableObjectsSummary.js +5 -3
- package/src/View/GridInfo/AdaptableOptionsComponent.js +1 -1
- package/src/View/GridInfo/GridInfoPopup.js +6 -7
- package/src/View/Query/Wizard/NamedQueryExpressionWizardSection.js +3 -4
- package/src/View/StateManagement/StateManagementPopup.js +18 -19
- package/src/agGrid/Adaptable.d.ts +2 -0
- package/src/agGrid/Adaptable.js +78 -30
- package/src/agGrid/weightedAverage.d.ts +2 -0
- package/src/agGrid/weightedAverage.js +52 -1
- package/src/bundle-dependencies/bundles/react-toastify/index.js +1 -1
- package/src/components/DragAndDropContext/ModuleManager.js +3 -4
- package/src/components/DragAndDropContext/TabList.js +9 -30
- package/src/components/DragAndDropContext/UnusedPanel.js +1 -7
- package/src/components/DropdownButton/index.js +2 -2
- package/src/components/EmptyContent/index.js +2 -2
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -0
- package/src/components/ExpressionEditor/index.js +24 -14
- package/src/metamodel/adaptable.metamodel.d.ts +34 -10
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +14 -10
- package/src/types.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/src/Api/InternalApi.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { AdaptableOptions } from '../AdaptableOptions/AdaptableOptions';
|
|
|
17
17
|
import { Layout } from '../PredefinedConfig/LayoutState';
|
|
18
18
|
import { AdaptableAlert, AdaptableCellChangedAlert, AdaptableRowChangedAlert } from '../PredefinedConfig/Common/AdaptableAlert';
|
|
19
19
|
import { IDataService } from '../Utilities/Services/Interface/IDataService';
|
|
20
|
-
import { AdaptableIcon, AdaptableMessageType, AlertDefinition, BaseContext, CellDataChangedInfo, EditLookUpPermittedValues, LayoutAssociatedObject, SharedEntity, SystemStatusMessageInfo } from '../types';
|
|
20
|
+
import { AdaptableIcon, AdaptableMessageType, AdaptableQuery, AlertDefinition, BaseContext, CellDataChangedInfo, EditLookUpPermittedValues, LayoutAssociatedObject, SharedEntity, SystemStatusMessageInfo } from '../types';
|
|
21
21
|
import { IEntitlementService } from '../Utilities/Services/Interface/IEntitlementService';
|
|
22
22
|
import { AdaptableFlashingCell } from '../PredefinedConfig/Common/AdaptableFlashingCell';
|
|
23
23
|
import { IQueryLanguageService } from '../Utilities/Services/Interface/IQueryLanguageService';
|
|
@@ -104,7 +104,11 @@ export interface InternalApi {
|
|
|
104
104
|
getRowEditService(): IRowEditService;
|
|
105
105
|
getModules(): IModuleCollection;
|
|
106
106
|
getModuleFriendlyName(adaptableModule: AdaptableModule): string;
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated use `evaluateExpressionInAdaptableQL()` instead
|
|
109
|
+
*/
|
|
107
110
|
runModuleInAdaptableQL(adaptableQLModule: AdaptableQLModule): boolean;
|
|
111
|
+
evaluateExpressionInAdaptableQL(adaptableQLModule: AdaptableQLModule, expression?: string): boolean;
|
|
108
112
|
forAllRowNodesDo(func: (rowNode: RowNode) => void): void;
|
|
109
113
|
forAllVisibleRowNodesDo(func: (rowNode: RowNode) => void): void;
|
|
110
114
|
buildStandaloneColumnHeader(column: AdaptableColumn): AdaptableMenuItem[];
|
|
@@ -139,4 +143,5 @@ export interface InternalApi {
|
|
|
139
143
|
getLabelForTag(adaptableObjectTag: AdaptableObjectTag): string;
|
|
140
144
|
getValueForTag(adaptableObjectTag: AdaptableObjectTag): string | number;
|
|
141
145
|
getEditLookUpValuesForColumn(editLookUpItem: EditLookUpPermittedValues, column: AdaptableColumn, gridCell?: GridCell): any[] | undefined;
|
|
146
|
+
getAdaptableQueryExpressionText(query: Partial<AdaptableQuery>): string;
|
|
142
147
|
}
|
|
@@ -56,4 +56,9 @@ export interface QueryLanguageApi {
|
|
|
56
56
|
* @param query - the AdaptableQuery
|
|
57
57
|
*/
|
|
58
58
|
getAdaptableQueryExpression(query: Partial<AdaptableQuery>): string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Returns the Expression string of the given AdaptableQuery with the column friendly names (instead of their technical IDs)
|
|
61
|
+
* @param query - the AdaptableQuery
|
|
62
|
+
*/
|
|
63
|
+
getAdaptableQueryExpressionWithColumnFriendlyNames(query: Partial<AdaptableQuery>): string | undefined;
|
|
59
64
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
2
|
-
import {
|
|
2
|
+
import { BulkUpdateValidationResult, IBulkUpdateModule } from './Interface/IBulkUpdateModule';
|
|
3
3
|
import { PreviewInfo } from '../Utilities/Interface/Preview';
|
|
4
4
|
import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
|
|
5
5
|
import { AccessLevel, AdaptableApi } from '../types';
|
|
@@ -81,7 +81,7 @@ class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
81
81
|
label: 'Column Name',
|
|
82
82
|
values: [calculateColumn.FriendlyName],
|
|
83
83
|
},
|
|
84
|
-
getExpressionViewItems_1.getExpressionViewItems(calculateColumn.Query),
|
|
84
|
+
getExpressionViewItems_1.getExpressionViewItems(calculateColumn.Query, this.api),
|
|
85
85
|
].filter(Boolean);
|
|
86
86
|
if (ArrayExtensions_1.default.IsNotNullOrEmpty(settingsTags)) {
|
|
87
87
|
items.push({
|
|
@@ -38,7 +38,7 @@ class QueryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
name: 'Expression',
|
|
41
|
-
values: [query
|
|
41
|
+
values: [this.api.internalApi.getAdaptableQueryExpressionText(query)],
|
|
42
42
|
},
|
|
43
43
|
getObjectTagsViewItems_1.getObjectTagsViewItems(query, this.api),
|
|
44
44
|
],
|
|
@@ -2,19 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getExportRowsViewItems = void 0;
|
|
4
4
|
const getExportRowsViewItems = (report, api) => {
|
|
5
|
-
var _a;
|
|
6
|
-
const values = [];
|
|
7
|
-
switch (report.ReportRowScope) {
|
|
8
|
-
case 'AllRows':
|
|
9
|
-
values.push('All Rows');
|
|
10
|
-
break;
|
|
11
|
-
case 'VisibleRows':
|
|
12
|
-
values.push('Visible Rows');
|
|
13
|
-
break;
|
|
14
|
-
case 'ExpressionRows':
|
|
15
|
-
values.push((_a = report.Query) === null || _a === void 0 ? void 0 : _a.BooleanExpression);
|
|
16
|
-
break;
|
|
17
|
-
}
|
|
18
5
|
return {
|
|
19
6
|
name: 'Rows',
|
|
20
7
|
values: [
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AdaptableCalculatedColumnQuery } from '../../PredefinedConfig/CalculatedColumnState';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
2
|
+
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
3
|
+
import { AdaptableObjectItemView } from '../Interface/IModule';
|
|
4
|
+
export declare const getExpressionViewItems: (query: AdaptableCalculatedColumnQuery, api: AdaptableApi) => AdaptableObjectItemView;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getExpressionViewItems = void 0;
|
|
4
|
-
const getExpressionViewItems = (query) => {
|
|
5
|
-
|
|
4
|
+
const getExpressionViewItems = (query, api) => {
|
|
5
|
+
const expressionText = api.internalApi.getAdaptableQueryExpressionText(query);
|
|
6
6
|
return {
|
|
7
7
|
name: 'Expression',
|
|
8
|
-
values: [
|
|
8
|
+
values: [expressionText],
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
exports.getExpressionViewItems = getExpressionViewItems;
|
|
@@ -62,6 +62,7 @@ exports.DefaultAdaptableOptions = {
|
|
|
62
62
|
caseSensitiveTextComparisons: false,
|
|
63
63
|
externallyEvaluatedModules: [],
|
|
64
64
|
customPredicateDefs: [],
|
|
65
|
+
displayColumnFriendlyNamesForExpressions: true,
|
|
65
66
|
expressionOptions: {
|
|
66
67
|
defaultBooleanFunctions: booleanExpressionFunctions_1.booleanExpressionFunctions,
|
|
67
68
|
defaultScalarFunctions: scalarExpressionFunctions_1.scalarExpressionFunctions,
|
|
@@ -150,6 +151,7 @@ exports.DefaultAdaptableOptions = {
|
|
|
150
151
|
cellSummaryOperations: undefined,
|
|
151
152
|
customSortComparers: undefined,
|
|
152
153
|
englishVariant: 'GB',
|
|
154
|
+
unbalancedGroupsKey: undefined,
|
|
153
155
|
},
|
|
154
156
|
layoutOptions: {
|
|
155
157
|
includeExpandedRowGroups: false,
|
|
@@ -29,7 +29,7 @@ exports.aggregatedExpressionFunctions = [
|
|
|
29
29
|
exports.aggregatedScalarExpressionFunctions = {
|
|
30
30
|
CUMUL: {
|
|
31
31
|
handler(args, context) {
|
|
32
|
-
const aggregationParameter = expressionFunctionUtils_1.extractParameter('CUMUL', 'aggregationScalar', ['SUM', '
|
|
32
|
+
const aggregationParameter = expressionFunctionUtils_1.extractParameter('CUMUL', 'aggregationScalar', ['SUM', 'PERCENTAGE', 'AVG', 'MIN', 'MAX'], args);
|
|
33
33
|
const overColumnParameter = expressionFunctionUtils_1.extractParameter('CUMUL', 'operand', ['OVER'], args);
|
|
34
34
|
const cumulationExpressionEvaluation = mapAggregationToCumulation(aggregationParameter, overColumnParameter, context);
|
|
35
35
|
const result = {
|
|
@@ -43,6 +43,7 @@ const handleWhereFunction = (args, context) => {
|
|
|
43
43
|
node: rowNode,
|
|
44
44
|
adaptableApi: context.adaptableApi,
|
|
45
45
|
functions: context.whereClauseFunctions,
|
|
46
|
+
evaluateCustomQueryVariable: context.adaptableApi.internalApi.getQueryLanguageService().evaluateCustomQueryVariable,
|
|
46
47
|
});
|
|
47
48
|
};
|
|
48
49
|
// observableExpressionResult
|
|
@@ -51,6 +52,7 @@ const handleWhereFunction = (args, context) => {
|
|
|
51
52
|
adaptableApi: context.adaptableApi,
|
|
52
53
|
functions: context.functions,
|
|
53
54
|
filterFn,
|
|
55
|
+
evaluateCustomQueryVariable: context.adaptableApi.internalApi.getQueryLanguageService().evaluateCustomQueryVariable,
|
|
54
56
|
});
|
|
55
57
|
};
|
|
56
58
|
exports.handleWhereFunction = handleWhereFunction;
|
|
@@ -2,5 +2,5 @@ import { ExpressionFunction } from '../../parser/src/types';
|
|
|
2
2
|
/**
|
|
3
3
|
* List of all the Scalar Functions available in AdaptableQL
|
|
4
4
|
*/
|
|
5
|
-
export declare type ScalarFunctionName = 'ADD' | 'SUB' | 'MUL' | 'DIV' | 'MOD' | 'POW' | 'MIN' | 'MAX' | 'AVG' | 'DATE' | 'NOW' | 'TODAY' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | 'ADD_DAYS' | 'ADD_WEEKS' | 'ADD_MONTHS' | 'ADD_YEARS' | 'DIFF_DAYS' | 'DIFF_WEEKS' | 'DIFF_MONTHS' | 'DIFF_YEARS' | 'SUB_STRING' | 'REPLACE' | 'COALESCE' | 'LEN' | 'UPPER' | 'LOWER' | 'CONCAT' | 'IF' | 'COL';
|
|
5
|
+
export declare type ScalarFunctionName = 'ADD' | 'SUB' | 'MUL' | 'DIV' | 'MOD' | 'POW' | 'MIN' | 'MAX' | 'AVG' | 'DATE' | 'NOW' | 'TODAY' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | 'ADD_DAYS' | 'ADD_WEEKS' | 'ADD_MONTHS' | 'ADD_YEARS' | 'DIFF_DAYS' | 'DIFF_WEEKS' | 'DIFF_MONTHS' | 'DIFF_YEARS' | 'SUB_STRING' | 'REPLACE' | 'COALESCE' | 'LEN' | 'UPPER' | 'LOWER' | 'CONCAT' | 'IF' | 'COL' | 'VAR';
|
|
6
6
|
export declare const scalarExpressionFunctions: Record<ScalarFunctionName, ExpressionFunction>;
|
|
@@ -18,6 +18,7 @@ const differenceInMonths_1 = tslib_1.__importDefault(require("date-fns/differenc
|
|
|
18
18
|
const differenceInYears_1 = tslib_1.__importDefault(require("date-fns/differenceInYears"));
|
|
19
19
|
const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
|
|
20
20
|
const dateUtils_1 = require("./dateUtils");
|
|
21
|
+
const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/StringExtensions"));
|
|
21
22
|
const sanitizeArguments = (values, allowNaN) => {
|
|
22
23
|
return values.filter((value) => value != undefined && value != null && value !== '' && (allowNaN || !isNaN(value)));
|
|
23
24
|
};
|
|
@@ -341,4 +342,17 @@ exports.scalarExpressionFunctions = {
|
|
|
341
342
|
signatures: ['CONCAT(value1, value2, value3)'],
|
|
342
343
|
examples: ['CONCAT([col1], [col2], [col3]'],
|
|
343
344
|
},
|
|
345
|
+
VAR: {
|
|
346
|
+
handler(args, context) {
|
|
347
|
+
const [functionName, ...optionalArgs] = args;
|
|
348
|
+
if (StringExtensions_1.default.IsNullOrEmpty(functionName)) {
|
|
349
|
+
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('VAR', 'should have a name');
|
|
350
|
+
}
|
|
351
|
+
return context.evaluateCustomQueryVariable(functionName, optionalArgs);
|
|
352
|
+
},
|
|
353
|
+
isPredicate: true,
|
|
354
|
+
description: 'Returns the variable evaluation',
|
|
355
|
+
signatures: ['VAR(varName)', 'VAR(varName, arg1, arg2)'],
|
|
356
|
+
examples: ['VAR(CURRENT_USER)', 'VAR(IS_VALID_VALUE, IS_BLANK([col1]), [col2] < [col3])'],
|
|
357
|
+
},
|
|
344
358
|
};
|
|
@@ -35,4 +35,6 @@ export interface IQueryLanguageService extends IAdaptableService {
|
|
|
35
35
|
getColumnsFromExpression(input: string): string[];
|
|
36
36
|
getNamedQueryNamesFromExpression(input: string): string[];
|
|
37
37
|
isCumulativeAggregate(input: string): boolean;
|
|
38
|
+
evaluateCustomQueryVariable(functionName: string, args?: any[]): any;
|
|
39
|
+
getExpressionWithColumnFriendlyNames(expression: string): string;
|
|
38
40
|
}
|
|
@@ -42,8 +42,9 @@ export declare class QueryLanguageService implements IQueryLanguageService {
|
|
|
42
42
|
getColumnsFromExpression(input?: string): string[];
|
|
43
43
|
getNamedQueryNamesFromExpression(input?: string): string[];
|
|
44
44
|
isCumulativeAggregate(input: string): boolean;
|
|
45
|
+
getExpressionWithColumnFriendlyNames(expression?: string): string;
|
|
45
46
|
getModuleExpressionFunctions(module: AdaptableModule): ModuleExpressionFunctions;
|
|
46
|
-
|
|
47
|
+
evaluateCustomQueryVariable(functionName: string, args?: any[]): any;
|
|
47
48
|
private getBooleanAndScalarFunctions;
|
|
48
49
|
private getExpressionCacheKey;
|
|
49
50
|
private getNodesFromExpression;
|
|
@@ -22,6 +22,7 @@ class QueryLanguageService {
|
|
|
22
22
|
node: rowNode,
|
|
23
23
|
adaptableApi: this.adaptableApi,
|
|
24
24
|
functions: booleanAndScalarFunctions,
|
|
25
|
+
evaluateCustomQueryVariable: this.evaluateCustomQueryVariable,
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
28
|
evaluateScalarExpression(expression, module, rowNode) {
|
|
@@ -34,6 +35,7 @@ class QueryLanguageService {
|
|
|
34
35
|
node: null,
|
|
35
36
|
adaptableApi: this.adaptableApi,
|
|
36
37
|
functions: aggregatedScalarFunctions,
|
|
38
|
+
evaluateCustomQueryVariable: this.evaluateCustomQueryVariable,
|
|
37
39
|
});
|
|
38
40
|
}
|
|
39
41
|
evaluateObservableExpression(reactiveExpression, module) {
|
|
@@ -44,6 +46,7 @@ class QueryLanguageService {
|
|
|
44
46
|
adaptableApi: this.adaptableApi,
|
|
45
47
|
functions: moduleExpressionFunctions.observableFunctions,
|
|
46
48
|
whereClauseFunctions: booleanAndScalarFunctions,
|
|
49
|
+
evaluateCustomQueryVariable: this.evaluateCustomQueryVariable,
|
|
47
50
|
});
|
|
48
51
|
return reactiveExpression$;
|
|
49
52
|
}
|
|
@@ -55,6 +58,7 @@ class QueryLanguageService {
|
|
|
55
58
|
adaptableApi: this.adaptableApi,
|
|
56
59
|
functions: moduleExpressionFunctions.aggregatedBooleanFunctions,
|
|
57
60
|
whereClauseFunctions: booleanAndScalarFunctions,
|
|
61
|
+
evaluateCustomQueryVariable: this.evaluateCustomQueryVariable,
|
|
58
62
|
});
|
|
59
63
|
return aggregationEvaluation;
|
|
60
64
|
}
|
|
@@ -253,6 +257,15 @@ class QueryLanguageService {
|
|
|
253
257
|
var _a;
|
|
254
258
|
return !!((_a = this.getNodesFromExpression(input, 'CUMUL')) === null || _a === void 0 ? void 0 : _a.length);
|
|
255
259
|
}
|
|
260
|
+
getExpressionWithColumnFriendlyNames(expression = '') {
|
|
261
|
+
let result = expression;
|
|
262
|
+
const columnIds = this.getColumnsFromExpression(expression);
|
|
263
|
+
columnIds.forEach((columnId) => {
|
|
264
|
+
const columnFriendlyName = this.adaptableApi.columnApi.getFriendlyNameFromColumnId(columnId);
|
|
265
|
+
result = result.split(columnId).join(columnFriendlyName);
|
|
266
|
+
});
|
|
267
|
+
return result;
|
|
268
|
+
}
|
|
256
269
|
// Returns the ExpressionFunctions available for the given Module as specified in the `QueryLanguageOptions.moduleExpressionFunctions`
|
|
257
270
|
// if there are no specific functions defined, it falls back to the default values
|
|
258
271
|
getModuleExpressionFunctions(module) {
|
|
@@ -293,8 +306,16 @@ class QueryLanguageService {
|
|
|
293
306
|
this.cacheModuleSpecificExpressionFunctions.set(module, moduleSpecificFunctions);
|
|
294
307
|
return moduleSpecificFunctions;
|
|
295
308
|
}
|
|
296
|
-
|
|
297
|
-
|
|
309
|
+
evaluateCustomQueryVariable(functionName, args) {
|
|
310
|
+
var _a, _b, _c;
|
|
311
|
+
const context = {
|
|
312
|
+
adaptableApi: this.adaptableApi,
|
|
313
|
+
args,
|
|
314
|
+
};
|
|
315
|
+
const customQueryVariableDefinition = (_c = (_b = (_a = this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions) === null || _a === void 0 ? void 0 : _a.expressionOptions) === null || _b === void 0 ? void 0 : _b.customQueryVariable) === null || _c === void 0 ? void 0 : _c[functionName];
|
|
316
|
+
return typeof customQueryVariableDefinition === 'function'
|
|
317
|
+
? customQueryVariableDefinition(context)
|
|
318
|
+
: customQueryVariableDefinition;
|
|
298
319
|
}
|
|
299
320
|
getBooleanAndScalarFunctions(moduleExpressionFunctions) {
|
|
300
321
|
return Object.assign(Object.assign({}, moduleExpressionFunctions.booleanFunctions), moduleExpressionFunctions.scalarFunctions);
|
|
@@ -303,23 +324,28 @@ class QueryLanguageService {
|
|
|
303
324
|
return `${module}::${expression}`;
|
|
304
325
|
}
|
|
305
326
|
getNodesFromExpression(input, nodeType) {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
327
|
+
try {
|
|
328
|
+
const resultSet = new Set();
|
|
329
|
+
// @ts-ignore
|
|
330
|
+
const walk = (node) => {
|
|
331
|
+
if (typeof node !== 'object') {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
if (Array.isArray(node)) {
|
|
335
|
+
return node.map(walk);
|
|
336
|
+
}
|
|
337
|
+
node.args.map(walk);
|
|
338
|
+
if (node.type === nodeType) {
|
|
339
|
+
resultSet.add(String(node.args[0]));
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
const { ast } = parser.parse(input.trim());
|
|
343
|
+
walk(ast);
|
|
344
|
+
return Array.from(resultSet.values());
|
|
345
|
+
}
|
|
346
|
+
catch (e) {
|
|
347
|
+
return [];
|
|
348
|
+
}
|
|
323
349
|
}
|
|
324
350
|
}
|
|
325
351
|
exports.QueryLanguageService = QueryLanguageService;
|
|
@@ -124,7 +124,6 @@ class ReportService {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
GetReportExpressionDescription(report, cols) {
|
|
127
|
-
var _a;
|
|
128
127
|
if (this.adaptableApi.exportApi.isCustomReport(report)) {
|
|
129
128
|
return '[Custom Data]';
|
|
130
129
|
}
|
|
@@ -154,7 +153,7 @@ class ReportService {
|
|
|
154
153
|
case 'SelectedRows':
|
|
155
154
|
return '[Selected Rows]';
|
|
156
155
|
case 'ExpressionRows':
|
|
157
|
-
return (
|
|
156
|
+
return this.adaptableApi.internalApi.getAdaptableQueryExpressionText(report.Query);
|
|
158
157
|
}
|
|
159
158
|
}
|
|
160
159
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { AdaptableOptions } from '../../../types';
|
|
3
3
|
interface AdaptableOptionsFormOptions {
|
|
4
4
|
adaptableOptions: AdaptableOptions;
|
|
5
|
-
|
|
5
|
+
onChangeadAptableOptions: (adaptableOptions: AdaptableOptions) => void;
|
|
6
6
|
}
|
|
7
7
|
declare const AdaptableOptionsForm: (props: AdaptableOptionsFormOptions) => JSX.Element;
|
|
8
8
|
export default AdaptableOptionsForm;
|
|
@@ -21,7 +21,7 @@ const AdaptableOptionsForm = (props) => {
|
|
|
21
21
|
React.createElement(FormLayout_1.FormRow, { label: "Adaptable ID" },
|
|
22
22
|
React.createElement(Input_1.default, { value: (_b = (_a = props === null || props === void 0 ? void 0 : props.adaptableOptions) === null || _a === void 0 ? void 0 : _a.adaptableId) !== null && _b !== void 0 ? _b : null, onChange: (event) => {
|
|
23
23
|
var _a;
|
|
24
|
-
props.
|
|
24
|
+
props.onChangeadAptableOptions(Object.assign(Object.assign({}, abOptions), { adaptableId: (_a = event.target.value) !== null && _a !== void 0 ? _a : '' }));
|
|
25
25
|
}, style: { minWidth: '20rem' } }))),
|
|
26
26
|
React.createElement(HelpBlock_1.default, null, "General Options"),
|
|
27
27
|
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'children' }, { name: 'label', style: { textAlign: 'start' } }] },
|
|
@@ -30,7 +30,7 @@ const AdaptableOptionsForm = (props) => {
|
|
|
30
30
|
abOptions = Object.assign({}, abOptions);
|
|
31
31
|
abOptions.generalOptions = Object.assign({}, abOptions.generalOptions);
|
|
32
32
|
abOptions.generalOptions.showMissingPrimaryKeyAlert = showMissingPrimaryKeyWarning;
|
|
33
|
-
props.
|
|
33
|
+
props.onChangeadAptableOptions(abOptions);
|
|
34
34
|
} }))),
|
|
35
35
|
React.createElement(HelpBlock_1.default, null, "Layout Options"),
|
|
36
36
|
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'children' }, { name: 'label', style: { textAlign: 'start' } }] },
|
|
@@ -39,7 +39,7 @@ const AdaptableOptionsForm = (props) => {
|
|
|
39
39
|
abOptions = Object.assign({}, abOptions);
|
|
40
40
|
abOptions.layoutOptions = Object.assign({}, abOptions.layoutOptions);
|
|
41
41
|
abOptions.layoutOptions.autoSaveLayouts = autoSaveLayouts;
|
|
42
|
-
props.
|
|
42
|
+
props.onChangeadAptableOptions(abOptions);
|
|
43
43
|
} }))),
|
|
44
44
|
React.createElement(HelpBlock_1.default, null, "Search Options"),
|
|
45
45
|
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'children' }, { name: 'label', style: { textAlign: 'start' } }] },
|
|
@@ -49,42 +49,42 @@ const AdaptableOptionsForm = (props) => {
|
|
|
49
49
|
abOptions.adaptableQLOptions = Object.assign({}, abOptions.adaptableQLOptions);
|
|
50
50
|
abOptions.adaptableQLOptions.caseSensitiveTextComparisons =
|
|
51
51
|
caseSensitiveTextComparisons;
|
|
52
|
-
props.
|
|
52
|
+
props.onChangeadAptableOptions(abOptions);
|
|
53
53
|
} })),
|
|
54
54
|
React.createElement(FormLayout_1.FormRow, { label: "Use AG Grid Filter Form Style" },
|
|
55
55
|
React.createElement(CheckBox_1.CheckBox, { checked: filterOptions.useAgGridFilterFormStyle, onChange: (useAgGridFilterFormStyle) => {
|
|
56
56
|
abOptions = Object.assign({}, abOptions);
|
|
57
57
|
abOptions.filterOptions = Object.assign({}, abOptions.filterOptions);
|
|
58
58
|
abOptions.filterOptions.useAgGridFilterFormStyle = useAgGridFilterFormStyle;
|
|
59
|
-
props.
|
|
59
|
+
props.onChangeadAptableOptions(abOptions);
|
|
60
60
|
} })),
|
|
61
61
|
React.createElement(FormLayout_1.FormRow, { label: "Use Adaptable Quick Filter" },
|
|
62
62
|
React.createElement(CheckBox_1.CheckBox, { checked: filterOptions.useAdaptableQuickFilter == true, onChange: (useAdaptableQuickFilter) => {
|
|
63
63
|
abOptions = Object.assign({}, abOptions);
|
|
64
64
|
abOptions.filterOptions = Object.assign({}, abOptions.filterOptions);
|
|
65
65
|
abOptions.filterOptions.useAdaptableQuickFilter = useAdaptableQuickFilter;
|
|
66
|
-
props.
|
|
66
|
+
props.onChangeadAptableOptions(abOptions);
|
|
67
67
|
} })),
|
|
68
68
|
React.createElement(FormLayout_1.FormRow, { label: "Use Adaptable Filter Form" },
|
|
69
69
|
React.createElement(CheckBox_1.CheckBox, { checked: filterOptions.useAdaptableFilterForm == true, onChange: (useAdaptableFilterForm) => {
|
|
70
70
|
abOptions = Object.assign({}, abOptions);
|
|
71
71
|
abOptions.filterOptions = Object.assign({}, abOptions.filterOptions);
|
|
72
72
|
abOptions.filterOptions.useAdaptableFilterForm = useAdaptableFilterForm;
|
|
73
|
-
props.
|
|
73
|
+
props.onChangeadAptableOptions(abOptions);
|
|
74
74
|
} })),
|
|
75
75
|
React.createElement(FormLayout_1.FormRow, { label: "Indicate Filtered Columns" },
|
|
76
76
|
React.createElement(CheckBox_1.CheckBox, { checked: filterOptions.indicateFilteredColumns, onChange: (indicateFilteredColumns) => {
|
|
77
77
|
abOptions = Object.assign({}, abOptions);
|
|
78
78
|
abOptions.filterOptions = Object.assign({}, abOptions.filterOptions);
|
|
79
79
|
abOptions.filterOptions.indicateFilteredColumns = indicateFilteredColumns;
|
|
80
|
-
props.
|
|
80
|
+
props.onChangeadAptableOptions(abOptions);
|
|
81
81
|
} })),
|
|
82
82
|
React.createElement(FormLayout_1.FormRow, { label: "Auto Apply Filter" },
|
|
83
83
|
React.createElement(CheckBox_1.CheckBox, { checked: filterOptions.autoApplyFilter, onChange: (autoApplyFilter) => {
|
|
84
84
|
abOptions = Object.assign({}, abOptions);
|
|
85
85
|
abOptions.filterOptions = Object.assign({}, abOptions.filterOptions);
|
|
86
86
|
abOptions.filterOptions.autoApplyFilter = autoApplyFilter;
|
|
87
|
-
props.
|
|
87
|
+
props.onChangeadAptableOptions(abOptions);
|
|
88
88
|
} }))),
|
|
89
89
|
React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", margin: 2 },
|
|
90
90
|
React.createElement(rebass_1.Text, { style: { flex: 3 }, marginRight: 2 }, "Max Column Value Items To Display"),
|
|
@@ -95,7 +95,7 @@ const AdaptableOptionsForm = (props) => {
|
|
|
95
95
|
abOptions = Object.assign({}, abOptions);
|
|
96
96
|
abOptions.filterOptions = Object.assign({}, abOptions.filterOptions);
|
|
97
97
|
abOptions.filterOptions.maxFilterValuesToDisplay = maxColumnValueItemsDisplayed;
|
|
98
|
-
props.
|
|
98
|
+
props.onChangeadAptableOptions(abOptions);
|
|
99
99
|
}, value: filterOptions.maxFilterValuesToDisplay, marginRight: 3 })))));
|
|
100
100
|
};
|
|
101
101
|
exports.default = AdaptableOptionsForm;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NocodeWizardFormBox = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const join_1 = tslib_1.__importDefault(require("../../../../components/utils/join"));
|
|
8
|
+
const NocodeWizardFormBox = (props) => (React.createElement(rebass_1.Box, Object.assign({}, props, { padding: 2, mb: 2, className: join_1.default('ab-NocodeWizardFormBox', props.className) })));
|
|
9
|
+
exports.NocodeWizardFormBox = NocodeWizardFormBox;
|
|
@@ -11,7 +11,9 @@ const GridOptionsForm_1 = tslib_1.__importDefault(require("./GridOptionsForm"));
|
|
|
11
11
|
const AdaptableOptionsForm_1 = tslib_1.__importDefault(require("./AdaptableOptionsForm"));
|
|
12
12
|
const EntitlementsForm_1 = tslib_1.__importDefault(require("./EntitlementsForm"));
|
|
13
13
|
const UiOptionsForm_1 = require("./UIOptions/UiOptionsForm");
|
|
14
|
+
const FinanceForm_1 = require("./FinanceForm");
|
|
14
15
|
const ConfigurationWizard = (props) => {
|
|
16
|
+
var _a, _b;
|
|
15
17
|
const [isPrimaryKeySelected, setIsValid] = React.useState(true);
|
|
16
18
|
const [adaptableOptions, setAdaptableOptions] = react_1.useState(() => {
|
|
17
19
|
var _a;
|
|
@@ -58,6 +60,7 @@ const ConfigurationWizard = (props) => {
|
|
|
58
60
|
return newSelectedColumns;
|
|
59
61
|
});
|
|
60
62
|
}, []);
|
|
63
|
+
const financePlugin = (_b = (_a = adaptableOptions.plugins) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, (plugin) => plugin.pluginId === 'finance');
|
|
61
64
|
let sections = [
|
|
62
65
|
{
|
|
63
66
|
title: 'Columns',
|
|
@@ -68,38 +71,33 @@ const ConfigurationWizard = (props) => {
|
|
|
68
71
|
}
|
|
69
72
|
return true;
|
|
70
73
|
},
|
|
71
|
-
render: () => (React.createElement(ConfigurationWizardColumnsStep_1.ConfigurationWizardColumnsStep, { adaptableOptions: adaptableOptions, setPrimaryKeyIsNotSelected: handlePrimaryKeyColumnIsNotSelected, onChange:
|
|
72
|
-
setAdaptableOptions(newAdaptableOptions);
|
|
73
|
-
}, selectedColumns: selectedColumns, onSelectionChange: handleColumnSelectionChange, onColumnChange: handleColumnsChange, columnsHandle: columnsHandle })),
|
|
74
|
+
render: () => (React.createElement(ConfigurationWizardColumnsStep_1.ConfigurationWizardColumnsStep, { adaptableOptions: adaptableOptions, setPrimaryKeyIsNotSelected: handlePrimaryKeyColumnIsNotSelected, onChange: setAdaptableOptions, selectedColumns: selectedColumns, onSelectionChange: handleColumnSelectionChange, onColumnChange: handleColumnsChange, columnsHandle: columnsHandle })),
|
|
74
75
|
},
|
|
75
76
|
{
|
|
76
77
|
title: 'Adaptable Options',
|
|
77
78
|
details: 'Configure Adaptable Options',
|
|
78
79
|
isValid: () => (adaptableOptions.adaptableId ? true : 'Adaptable ID is required'),
|
|
79
|
-
render: () => (React.createElement(AdaptableOptionsForm_1.default, { adaptableOptions: adaptableOptions,
|
|
80
|
-
setAdaptableOptions(abOptions);
|
|
81
|
-
} })),
|
|
80
|
+
render: () => (React.createElement(AdaptableOptionsForm_1.default, { adaptableOptions: adaptableOptions, onChangeadAptableOptions: setAdaptableOptions })),
|
|
82
81
|
},
|
|
83
82
|
{
|
|
84
83
|
title: 'Grid Options',
|
|
85
84
|
details: 'Configure AG Grid Options',
|
|
86
|
-
render: () => (React.createElement(GridOptionsForm_1.default, { adaptableOptions: adaptableOptions,
|
|
87
|
-
setAdaptableOptions(abOptions);
|
|
88
|
-
} })),
|
|
85
|
+
render: () => (React.createElement(GridOptionsForm_1.default, { adaptableOptions: adaptableOptions, onChangeadAptableOptions: setAdaptableOptions })),
|
|
89
86
|
},
|
|
90
87
|
{
|
|
91
88
|
title: 'UI Elements',
|
|
92
89
|
details: 'Configure UI Elements',
|
|
93
|
-
render: () => (React.createElement(UiOptionsForm_1.UIElementsForm, { adaptableOptions: adaptableOptions,
|
|
94
|
-
setAdaptableOptions(abOptions);
|
|
95
|
-
} })),
|
|
90
|
+
render: () => (React.createElement(UiOptionsForm_1.UIElementsForm, { adaptableOptions: adaptableOptions, onChangeadAptableOptions: setAdaptableOptions })),
|
|
96
91
|
},
|
|
97
92
|
{
|
|
98
93
|
title: 'Entitlements',
|
|
99
94
|
details: 'Configure Entitlements',
|
|
100
|
-
render: () => (React.createElement(EntitlementsForm_1.default, { adaptableOptions: adaptableOptions,
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
render: () => (React.createElement(EntitlementsForm_1.default, { adaptableOptions: adaptableOptions, onChangeadAptableOptions: setAdaptableOptions })),
|
|
96
|
+
},
|
|
97
|
+
financePlugin && {
|
|
98
|
+
title: 'Finance',
|
|
99
|
+
details: 'Finance Options',
|
|
100
|
+
render: () => (React.createElement(FinanceForm_1.FinanceForm, { adaptableOptions: adaptableOptions, onChangeadAptableOptions: setAdaptableOptions })),
|
|
103
101
|
},
|
|
104
102
|
];
|
|
105
103
|
if (props.startSections) {
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { AdaptableOptions } from '../../../types';
|
|
3
3
|
interface EntitlementsFormOptions {
|
|
4
4
|
adaptableOptions: AdaptableOptions;
|
|
5
|
-
|
|
5
|
+
onChangeadAptableOptions: (adaptableOptions: AdaptableOptions) => void;
|
|
6
6
|
}
|
|
7
7
|
declare const EntitlementsForm: React.FunctionComponent<EntitlementsFormOptions>;
|
|
8
8
|
export default EntitlementsForm;
|
|
@@ -71,7 +71,7 @@ const EntitlementsListForm = (props) => {
|
|
|
71
71
|
{ adaptableModule: module, accessLevel: accessLevel },
|
|
72
72
|
];
|
|
73
73
|
}
|
|
74
|
-
props.
|
|
74
|
+
props.onChangeadAptableOptions(Object.assign(Object.assign({}, abOptions), { entitlementOptions: Object.assign(Object.assign({}, abOptions.entitlementOptions), { moduleEntitlements: newEntitlements }) }));
|
|
75
75
|
}, [abOptions === null || abOptions === void 0 ? void 0 : abOptions.entitlementOptions]);
|
|
76
76
|
const items = ALL_ENTITLEMENTS_MODULES.map((module) => {
|
|
77
77
|
const cItems = colItems.map((item) => (Object.assign({}, item)));
|
|
@@ -140,7 +140,7 @@ const DefaultEntitlementForm = (props) => {
|
|
|
140
140
|
return React.createElement(HelpBlock_1.default, { mb: 2 }, "Default Entitlement is controlled by a custom function");
|
|
141
141
|
}
|
|
142
142
|
const handleDefaultEntitlementChange = React.useCallback((accessLevel) => {
|
|
143
|
-
props.
|
|
143
|
+
props.onChangeadAptableOptions(Object.assign(Object.assign({}, abOptions), { entitlementOptions: Object.assign(Object.assign({}, abOptions.entitlementOptions), { defaultAccessLevel: accessLevel }) }));
|
|
144
144
|
}, [(_b = abOptions === null || abOptions === void 0 ? void 0 : abOptions.entitlementOptions) === null || _b === void 0 ? void 0 : _b.defaultAccessLevel]);
|
|
145
145
|
return (React.createElement(FormLayout_1.default, { mb: 2 },
|
|
146
146
|
React.createElement(FormLayout_1.FormRow, { label: "Default Entitlement:" },
|
package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AdaptableOptions } from '../../../../types';
|
|
3
|
+
export interface FinanceFormProps {
|
|
4
|
+
adaptableOptions: AdaptableOptions;
|
|
5
|
+
onChangeadAptableOptions: (adaptableOptions: AdaptableOptions) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const FinanceForm: React.FunctionComponent<FinanceFormProps>;
|