@adaptabletools/adaptable 13.0.0-canary.7 → 13.0.0-canary.9
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/agGrid.d.ts +10 -10
- package/agGrid.js +10 -10
- package/bundle.cjs.js +154 -154
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +4 -3
- package/src/AdaptableOptions/AdaptableOptions.d.ts +0 -2
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +87 -30
- package/src/AdaptableOptions/FinsemblePluginOptions.d.ts +32 -0
- package/src/AdaptableOptions/FinsemblePluginOptions.js +2 -0
- package/src/AdaptableOptions/GeneralOptions.d.ts +1 -2
- package/src/Api/ConditionalStyleApi.d.ts +20 -62
- package/src/Api/ConfigApi.d.ts +1 -2
- package/src/Api/FinsembleApi.d.ts +10 -0
- package/src/Api/FinsembleApi.js +2 -0
- package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -0
- package/src/Api/Implementation/PluginsApiImpl.js +6 -0
- package/src/Api/PluginsApi.d.ts +5 -0
- package/src/PredefinedConfig/ConditionalStyleState.d.ts +10 -19
- package/src/PredefinedConfig/FormatColumnState.d.ts +0 -6
- package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
- package/src/Strategy/DataChangeHistoryModule.js +12 -0
- package/src/Strategy/FormatColumnModule.js +1 -1
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.d.ts +1 -1
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +3 -4
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +5 -10
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +3 -4
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +3 -4
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +3 -4
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -4
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +3 -4
- package/src/Utilities/ObjectFactory.js +0 -1
- package/src/Utilities/Services/QueryLanguageService.d.ts +1 -3
- package/src/Utilities/Services/QueryLanguageService.js +48 -52
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +0 -22
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +0 -1
- package/src/agGrid/Adaptable.d.ts +2 -2
- package/src/agGrid/Adaptable.js +1 -14
- package/src/metamodel/adaptable.metamodel.d.ts +65 -47
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +3 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -5,13 +5,8 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const GeneralConstants = tslib_1.__importStar(require("../Constants/GeneralConstants"));
|
|
6
6
|
const GeneralConstants_1 = require("../Constants/GeneralConstants");
|
|
7
7
|
const UIHelper_1 = tslib_1.__importStar(require("../../View/UIHelper"));
|
|
8
|
-
const booleanExpressionFunctions_1 = require("../ExpressionFunctions/booleanExpressionFunctions");
|
|
9
|
-
const scalarExpressionFunctions_1 = require("../ExpressionFunctions/scalarExpressionFunctions");
|
|
10
|
-
const observableExpressionFunctions_1 = require("../ExpressionFunctions/observableExpressionFunctions");
|
|
11
|
-
const aggregatedBooleanExpressionFunctions_1 = require("../ExpressionFunctions/aggregatedBooleanExpressionFunctions");
|
|
12
8
|
const AdaptablePredicate_1 = require("../../PredefinedConfig/Common/AdaptablePredicate");
|
|
13
9
|
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
14
|
-
const aggregatedScalarExpressionFunctions_1 = require("../ExpressionFunctions/aggregatedScalarExpressionFunctions");
|
|
15
10
|
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
16
11
|
// change type to DeepRequired<AdaptableOptions> to check which properties have no default values defined
|
|
17
12
|
exports.DefaultAdaptableOptions = {
|
|
@@ -64,11 +59,11 @@ exports.DefaultAdaptableOptions = {
|
|
|
64
59
|
customPredicateDefs: [],
|
|
65
60
|
displayColumnFriendlyNamesForExpressions: true,
|
|
66
61
|
expressionOptions: {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
systemBooleanFunctions: undefined,
|
|
63
|
+
systemScalarFunctions: undefined,
|
|
64
|
+
systemObservableFunctions: undefined,
|
|
65
|
+
systemAggregatedBooleanFunctions: undefined,
|
|
66
|
+
systemAggregatedScalarFunctions: undefined,
|
|
72
67
|
moduleExpressionFunctions: undefined,
|
|
73
68
|
queryableColumns: undefined,
|
|
74
69
|
performExpressionValidation: true,
|
|
@@ -16,5 +16,5 @@ export interface ScalarAggregationOperand extends BaseParameter<'aggregationScal
|
|
|
16
16
|
value: AggregatedScalarExpressionEvaluation;
|
|
17
17
|
}
|
|
18
18
|
export declare const aggregatedBooleanExpressionFunctions: Record<AggregatedBooleanFunctionName, ExpressionFunction>;
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const aggregatedBooleanExpressionFunctionNames: AggregatedBooleanFunctionName[];
|
|
20
20
|
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.aggregatedBooleanExpressionFunctionNames = exports.aggregatedBooleanExpressionFunctions = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const parseInt_1 = tslib_1.__importDefault(require("lodash/parseInt"));
|
|
6
6
|
const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
|
|
7
7
|
const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
|
|
8
8
|
const aggregatedScalarExpressionFunctions_1 = require("./aggregatedScalarExpressionFunctions");
|
|
9
|
+
const TypeExtensions_1 = require("../Extensions/TypeExtensions");
|
|
9
10
|
const SUPPORTED_AGGREGATION_FNS = ['SUM', 'MIN', 'MAX', 'AVG'];
|
|
10
11
|
const aggregationScalarOperandMap = {
|
|
11
12
|
SUM: ['string', 'number'],
|
|
@@ -174,6 +175,4 @@ const extractScalarOperand = (consumingFunctionName, value, allowedTypes) => {
|
|
|
174
175
|
// numeric value
|
|
175
176
|
return (0, parseInt_1.default)(numericString) * numberUnitRatios[largeNumberUnit.toLowerCase()];
|
|
176
177
|
};
|
|
177
|
-
exports.
|
|
178
|
-
[functionName]: expressionImplementation,
|
|
179
|
-
}));
|
|
178
|
+
exports.aggregatedBooleanExpressionFunctionNames = (0, TypeExtensions_1.getTypedKeys)(exports.aggregatedBooleanExpressionFunctions);
|
|
@@ -42,5 +42,5 @@ export interface CumulatedAggregationValue {
|
|
|
42
42
|
export declare const cumulativeAggregatedExpressionFunctions: AggregatedScalarFunctionName[];
|
|
43
43
|
export declare const aggregatedExpressionFunctions: AggregatedScalarFunctionName[];
|
|
44
44
|
export declare const aggregatedScalarExpressionFunctions: Record<AggregatedScalarFunctionName, ExpressionFunction>;
|
|
45
|
-
export declare const
|
|
45
|
+
export declare const aggregatedScalarExpressionFunctionNames: AggregatedScalarFunctionName[];
|
|
46
46
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.aggregatedScalarExpressionFunctionNames = exports.aggregatedScalarExpressionFunctions = exports.aggregatedExpressionFunctions = exports.cumulativeAggregatedExpressionFunctions = void 0;
|
|
4
4
|
const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
|
|
5
5
|
const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
|
|
6
|
+
const TypeExtensions_1 = require("../Extensions/TypeExtensions");
|
|
6
7
|
exports.cumulativeAggregatedExpressionFunctions = [
|
|
7
8
|
'CUMUL',
|
|
8
9
|
'OVER',
|
|
@@ -649,9 +650,7 @@ const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, c
|
|
|
649
650
|
};
|
|
650
651
|
return cumulationExpressionEvaluation;
|
|
651
652
|
};
|
|
652
|
-
exports.
|
|
653
|
-
[functionName]: expressionImplementation,
|
|
654
|
-
}));
|
|
653
|
+
exports.aggregatedScalarExpressionFunctionNames = (0, TypeExtensions_1.getTypedKeys)(exports.aggregatedScalarExpressionFunctions);
|
|
655
654
|
// !! mutates expressionEvaluation
|
|
656
655
|
const addGroupByParams = (groupByColumnNames, expressionEvaluation) => {
|
|
657
656
|
if (groupByColumnNames === null || groupByColumnNames === void 0 ? void 0 : groupByColumnNames.length) {
|
|
@@ -4,4 +4,4 @@ import { ExpressionFunction } from '../../parser/src/types';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare type BooleanFunctionName = 'EQ' | 'NEQ' | 'GT' | 'LT' | 'GTE' | 'LTE' | 'AND' | 'OR' | 'NOT' | 'BETWEEN' | 'IN' | 'IS_BLANK' | 'CONTAINS' | 'STARTS_WITH' | 'ENDS_WITH' | 'ANY_CONTAINS' | 'QUERY';
|
|
6
6
|
export declare const booleanExpressionFunctions: Record<BooleanFunctionName, ExpressionFunction>;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const booleanExpressionFunctionsNames: BooleanFunctionName[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.booleanExpressionFunctionsNames = exports.booleanExpressionFunctions = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const isAfter_1 = tslib_1.__importDefault(require("date-fns/isAfter"));
|
|
6
6
|
const isBefore_1 = tslib_1.__importDefault(require("date-fns/isBefore"));
|
|
@@ -9,6 +9,7 @@ const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/String
|
|
|
9
9
|
const src_1 = require("../../parser/src");
|
|
10
10
|
const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
|
|
11
11
|
const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
|
|
12
|
+
const TypeExtensions_1 = require("../Extensions/TypeExtensions");
|
|
12
13
|
exports.booleanExpressionFunctions = {
|
|
13
14
|
OR: {
|
|
14
15
|
handler(args) {
|
|
@@ -293,6 +294,4 @@ exports.booleanExpressionFunctions = {
|
|
|
293
294
|
examples: ['QUERY("anyNamedQuery")'],
|
|
294
295
|
},
|
|
295
296
|
};
|
|
296
|
-
exports.
|
|
297
|
-
[functionName]: expressionImplementation,
|
|
298
|
-
}));
|
|
297
|
+
exports.booleanExpressionFunctionsNames = (0, TypeExtensions_1.getTypedKeys)(exports.booleanExpressionFunctions);
|
|
@@ -6,5 +6,5 @@ export declare type ObservableFunctionName = 'WHERE' | 'COL' | 'TIMEFRAME' | Obs
|
|
|
6
6
|
declare type ObservableFunction = 'ROW_CHANGE' | 'GRID_CHANGE';
|
|
7
7
|
declare type ChangeFunction = 'MAX' | 'MIN' | 'NONE' | 'COUNT';
|
|
8
8
|
export declare const observableExpressionFunctions: Record<ObservableFunctionName, ExpressionFunction>;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const observableExpressionFunctionNames: ObservableFunctionName[];
|
|
10
10
|
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.observableExpressionFunctionNames = exports.observableExpressionFunctions = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const rxjs_1 = require("rxjs");
|
|
6
6
|
const operators_1 = require("rxjs/operators");
|
|
7
7
|
const parseInt_1 = tslib_1.__importDefault(require("lodash/parseInt"));
|
|
8
8
|
const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
|
|
9
9
|
const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
|
|
10
|
+
const TypeExtensions_1 = require("../Extensions/TypeExtensions");
|
|
10
11
|
// numeric value(digits) followed by a single 's', 'm' or 'h' letter (case insensitive)
|
|
11
12
|
const TIMEFRAME_REGEX = /^(\d+)(s|m|h)$/i;
|
|
12
13
|
const SYSTEM_MAX_TIMEFRAME_SIZE = 86400000; // 24h
|
|
@@ -212,9 +213,7 @@ exports.observableExpressionFunctions = {
|
|
|
212
213
|
examples: ["TIMEFRAME('20s')", "TIMEFRAME('5m')", "TIMEFRAME('1h')"],
|
|
213
214
|
},
|
|
214
215
|
};
|
|
215
|
-
exports.
|
|
216
|
-
[functionName]: expressionImplementation,
|
|
217
|
-
}));
|
|
216
|
+
exports.observableExpressionFunctionNames = (0, TypeExtensions_1.getTypedKeys)(exports.observableExpressionFunctions);
|
|
218
217
|
// return TRUE if the last(tail) element has the greatest value
|
|
219
218
|
const isLastElementMaxValue = (values) => {
|
|
220
219
|
const [tailValue] = values.slice(-1);
|
|
@@ -4,4 +4,4 @@ import { ExpressionFunction } from '../../parser/src/types';
|
|
|
4
4
|
*/
|
|
5
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>;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const scalarExpressionFunctionNames: ScalarFunctionName[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.scalarExpressionFunctionNames = exports.scalarExpressionFunctions = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
|
|
6
6
|
const parseISO_1 = tslib_1.__importDefault(require("date-fns/parseISO"));
|
|
@@ -19,6 +19,7 @@ const differenceInYears_1 = tslib_1.__importDefault(require("date-fns/difference
|
|
|
19
19
|
const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
|
|
20
20
|
const dateUtils_1 = require("./dateUtils");
|
|
21
21
|
const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/StringExtensions"));
|
|
22
|
+
const TypeExtensions_1 = require("../Extensions/TypeExtensions");
|
|
22
23
|
const sanitizeArguments = (values, allowNaN) => {
|
|
23
24
|
return values.filter((value) => value != undefined && value != null && value !== '' && (allowNaN || !isNaN(value)));
|
|
24
25
|
};
|
|
@@ -356,6 +357,4 @@ exports.scalarExpressionFunctions = {
|
|
|
356
357
|
examples: ['VAR(CURRENT_USER)', 'VAR(IS_VALID_VALUE, IS_BLANK([col1]), [col2] < [col3])'],
|
|
357
358
|
},
|
|
358
359
|
};
|
|
359
|
-
exports.
|
|
360
|
-
[functionName]: expressionImplementation,
|
|
361
|
-
}));
|
|
360
|
+
exports.scalarExpressionFunctionNames = (0, TypeExtensions_1.getTypedKeys)(exports.scalarExpressionFunctions);
|
|
@@ -43,9 +43,7 @@ export declare class QueryLanguageService implements IQueryLanguageService {
|
|
|
43
43
|
isCumulativeAggregate(input: string): boolean;
|
|
44
44
|
getExpressionWithColumnFriendlyNames(expression?: string): string;
|
|
45
45
|
getModuleExpressionFunctionsMap(module: AdaptableModule): ModuleExpressionFunctionsMap;
|
|
46
|
-
private
|
|
47
|
-
private extractDefaultExpressionFunctions;
|
|
48
|
-
private mapFunctionsDefinitionToMap;
|
|
46
|
+
private extractMappedExpressionFunctions;
|
|
49
47
|
evaluateCustomQueryVariable(functionName: string, args?: any[]): any;
|
|
50
48
|
private getBooleanAndScalarFunctions;
|
|
51
49
|
private getExpressionCacheKey;
|
|
@@ -275,7 +275,7 @@ class QueryLanguageService {
|
|
|
275
275
|
// Returns the ExpressionFunctions available for the given Module as specified in the `QueryLanguageOptions.moduleExpressionFunctions`
|
|
276
276
|
// if there are no specific functions defined, it falls back to the default values
|
|
277
277
|
getModuleExpressionFunctionsMap(module) {
|
|
278
|
-
var _a, _b, _c
|
|
278
|
+
var _a, _b, _c;
|
|
279
279
|
const expressionOptions = this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions;
|
|
280
280
|
if (module) {
|
|
281
281
|
let cachedResult = this.cacheModuleSpecificExpressionFunctions.get(module);
|
|
@@ -283,19 +283,19 @@ class QueryLanguageService {
|
|
|
283
283
|
return cachedResult;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
const
|
|
287
|
-
const
|
|
288
|
-
const
|
|
289
|
-
const
|
|
290
|
-
const
|
|
286
|
+
const generalBooleanExpressionFunctions = this.extractMappedExpressionFunctions(booleanExpressionFunctions_1.booleanExpressionFunctions, expressionOptions.systemBooleanFunctions, expressionOptions.customBooleanFunctions);
|
|
287
|
+
const generalScalarExpressionFunctions = this.extractMappedExpressionFunctions(scalarExpressionFunctions_1.scalarExpressionFunctions, expressionOptions.systemScalarFunctions, expressionOptions.customScalarFunctions);
|
|
288
|
+
const generalObservableExpressionFunctions = this.extractMappedExpressionFunctions(observableExpressionFunctions_1.observableExpressionFunctions, expressionOptions.systemObservableFunctions);
|
|
289
|
+
const generalAggregatedBooleanExpressionFunctions = this.extractMappedExpressionFunctions(aggregatedBooleanExpressionFunctions_1.aggregatedBooleanExpressionFunctions, expressionOptions.systemAggregatedBooleanFunctions);
|
|
290
|
+
const generalAggregatedScalarExpressionFunctions = this.extractMappedExpressionFunctions(aggregatedScalarExpressionFunctions_1.aggregatedScalarExpressionFunctions, expressionOptions.systemAggregatedScalarFunctions);
|
|
291
291
|
if (!module) {
|
|
292
292
|
(0, LoggingHelper_1.LogAdaptableInfo)(`QueryLanguageService.getModuleExpressionFunctions() was called with an undefined 'module' param, this should never happen`);
|
|
293
293
|
return {
|
|
294
|
-
booleanFunctions:
|
|
295
|
-
scalarFunctions:
|
|
296
|
-
observableFunctions:
|
|
297
|
-
aggregatedBooleanFunctions:
|
|
298
|
-
aggregatedScalarFunctions:
|
|
294
|
+
booleanFunctions: generalBooleanExpressionFunctions,
|
|
295
|
+
scalarFunctions: generalScalarExpressionFunctions,
|
|
296
|
+
observableFunctions: generalObservableExpressionFunctions,
|
|
297
|
+
aggregatedBooleanFunctions: generalAggregatedBooleanExpressionFunctions,
|
|
298
|
+
aggregatedScalarFunctions: generalAggregatedScalarExpressionFunctions,
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
301
|
let moduleExpressionFunctions;
|
|
@@ -303,11 +303,11 @@ class QueryLanguageService {
|
|
|
303
303
|
const context = {
|
|
304
304
|
adaptableApi: this.adaptableApi,
|
|
305
305
|
module,
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
306
|
+
availableBooleanFunctionNames: (0, TypeExtensions_1.getTypedKeys)(generalBooleanExpressionFunctions),
|
|
307
|
+
availableScalarFunctionNames: (0, TypeExtensions_1.getTypedKeys)(generalScalarExpressionFunctions),
|
|
308
|
+
availableObservableFunctionNames: (0, TypeExtensions_1.getTypedKeys)(generalObservableExpressionFunctions),
|
|
309
|
+
availableAggregatedBooleanFunctionNames: (0, TypeExtensions_1.getTypedKeys)(generalAggregatedBooleanExpressionFunctions),
|
|
310
|
+
availableAggregatedScalarFunctionNames: (0, TypeExtensions_1.getTypedKeys)(generalAggregatedScalarExpressionFunctions),
|
|
311
311
|
};
|
|
312
312
|
moduleExpressionFunctions = (_a = expressionOptions.moduleExpressionFunctions(context)) !== null && _a !== void 0 ? _a : {};
|
|
313
313
|
}
|
|
@@ -315,49 +315,45 @@ class QueryLanguageService {
|
|
|
315
315
|
moduleExpressionFunctions = (_c = (_b = expressionOptions.moduleExpressionFunctions) === null || _b === void 0 ? void 0 : _b[module]) !== null && _c !== void 0 ? _c : {};
|
|
316
316
|
}
|
|
317
317
|
const moduleExpressionFunctionsMap = {
|
|
318
|
-
booleanFunctions: this.
|
|
319
|
-
scalarFunctions: this.
|
|
320
|
-
observableFunctions: this.
|
|
321
|
-
aggregatedBooleanFunctions: this.
|
|
322
|
-
aggregatedScalarFunctions: this.
|
|
318
|
+
booleanFunctions: this.extractMappedExpressionFunctions(generalBooleanExpressionFunctions, moduleExpressionFunctions.systemBooleanFunctions, moduleExpressionFunctions.customBooleanFunctions),
|
|
319
|
+
scalarFunctions: this.extractMappedExpressionFunctions(generalScalarExpressionFunctions, moduleExpressionFunctions.systemScalarFunctions, moduleExpressionFunctions.customScalarFunctions),
|
|
320
|
+
observableFunctions: this.extractMappedExpressionFunctions(generalObservableExpressionFunctions, moduleExpressionFunctions.systemObservableFunctions),
|
|
321
|
+
aggregatedBooleanFunctions: this.extractMappedExpressionFunctions(generalAggregatedBooleanExpressionFunctions, moduleExpressionFunctions.systemAggregatedBooleanFunctions),
|
|
322
|
+
aggregatedScalarFunctions: this.extractMappedExpressionFunctions(generalAggregatedScalarExpressionFunctions, moduleExpressionFunctions.systemAggregatedScalarFunctions),
|
|
323
323
|
};
|
|
324
324
|
this.cacheModuleSpecificExpressionFunctions.set(module, moduleExpressionFunctionsMap);
|
|
325
325
|
return moduleExpressionFunctionsMap;
|
|
326
326
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
return definition;
|
|
331
|
-
}
|
|
332
|
-
else {
|
|
333
|
-
return (0, TypeExtensions_1.getTypedKeys)(definition);
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
extractDefaultExpressionFunctions(defaultOptions, availableExpressionFunctions) {
|
|
338
|
-
if (typeof defaultOptions === 'function') {
|
|
339
|
-
const context = {
|
|
327
|
+
extractMappedExpressionFunctions(availableExpressionFunctions, systemFunctions, customFunctions) {
|
|
328
|
+
const systemFunctionNames = typeof systemFunctions === 'function'
|
|
329
|
+
? systemFunctions({
|
|
340
330
|
adaptableApi: this.adaptableApi,
|
|
341
331
|
availableExpressionFunctionNames: (0, TypeExtensions_1.getTypedKeys)(availableExpressionFunctions),
|
|
342
|
-
}
|
|
343
|
-
|
|
332
|
+
})
|
|
333
|
+
: systemFunctions;
|
|
334
|
+
let generalExpressionFunctions = {};
|
|
335
|
+
// add system functions
|
|
336
|
+
if (Array.isArray(systemFunctionNames)) {
|
|
337
|
+
// add only system functions specified by user
|
|
338
|
+
systemFunctionNames.forEach((systemFunctionName) => {
|
|
339
|
+
generalExpressionFunctions[systemFunctionName] =
|
|
340
|
+
availableExpressionFunctions[systemFunctionName];
|
|
341
|
+
});
|
|
344
342
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
});
|
|
360
|
-
return resultMap;
|
|
343
|
+
else {
|
|
344
|
+
// add ALL system functions
|
|
345
|
+
generalExpressionFunctions = Object.assign({}, availableExpressionFunctions);
|
|
346
|
+
}
|
|
347
|
+
const customFunctionDefinitions = typeof customFunctions === 'function'
|
|
348
|
+
? customFunctions({
|
|
349
|
+
adaptableApi: this.adaptableApi,
|
|
350
|
+
availableExpressionFunctionNames: (0, TypeExtensions_1.getTypedKeys)(generalExpressionFunctions),
|
|
351
|
+
})
|
|
352
|
+
: customFunctions;
|
|
353
|
+
if (customFunctionDefinitions) {
|
|
354
|
+
generalExpressionFunctions = Object.assign(Object.assign({}, generalExpressionFunctions), customFunctionDefinitions);
|
|
355
|
+
}
|
|
356
|
+
return generalExpressionFunctions;
|
|
361
357
|
}
|
|
362
358
|
evaluateCustomQueryVariable(functionName, args) {
|
|
363
359
|
var _a, _b, _c;
|
|
@@ -6,13 +6,9 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
7
|
const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
|
|
8
8
|
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
9
|
-
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
10
9
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
11
10
|
const Tabs_1 = require("../../../components/Tabs");
|
|
12
11
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
13
|
-
const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/StringExtensions"));
|
|
14
|
-
const react_1 = require("react");
|
|
15
|
-
const LoggingHelper_1 = require("../../../Utilities/Helpers/LoggingHelper");
|
|
16
12
|
const Tag_1 = require("../../../components/Tag");
|
|
17
13
|
let alignmentOptions = [
|
|
18
14
|
{ value: 'Left', label: 'Left' },
|
|
@@ -25,9 +21,6 @@ const renderFormatColumnSettingsSummary = (data) => {
|
|
|
25
21
|
React.createElement(rebass_1.Text, null,
|
|
26
22
|
"Cell alignment ",
|
|
27
23
|
React.createElement(Tag_1.Tag, null, (_a = data.CellAlignment) !== null && _a !== void 0 ? _a : 'default')),
|
|
28
|
-
data.HeaderName ? (React.createElement(rebass_1.Text, { mt: 3 },
|
|
29
|
-
"Header name ",
|
|
30
|
-
React.createElement(Tag_1.Tag, null, data.HeaderName))) : null,
|
|
31
24
|
React.createElement(rebass_1.Text, { mt: 3 },
|
|
32
25
|
"Include grouped rows ",
|
|
33
26
|
React.createElement(Tag_1.Tag, null, data.IncludeGroupedRows ? 'yes' : 'no'))));
|
|
@@ -41,18 +34,6 @@ const FormatColumnSettingsWizardSection = (props) => {
|
|
|
41
34
|
const onIncludeGroupedRowsChanged = (IncludeGroupedRows) => {
|
|
42
35
|
props.onChange(Object.assign(Object.assign({}, data), { IncludeGroupedRows }));
|
|
43
36
|
};
|
|
44
|
-
const onHeaderNameChanged = (event) => {
|
|
45
|
-
let e = event.target;
|
|
46
|
-
props.onChange(Object.assign(Object.assign({}, data), { HeaderName: e.value }));
|
|
47
|
-
};
|
|
48
|
-
const [hasHeaderName, setHasHeaderName] = (0, react_1.useState)(false);
|
|
49
|
-
(0, react_1.useEffect)(() => {
|
|
50
|
-
const hasCustomHeaderName = StringExtensions_1.default.IsNotNullOrEmpty(data.HeaderName);
|
|
51
|
-
setHasHeaderName(hasCustomHeaderName);
|
|
52
|
-
if (hasCustomHeaderName) {
|
|
53
|
-
(0, LoggingHelper_1.ConsoleLogWarning)(`DEPRECATED: The 'FormatColumn.HeaderName' property is deprecated; use a Layout custom Column Header instead!`);
|
|
54
|
-
}
|
|
55
|
-
}, []);
|
|
56
37
|
return (React.createElement(Tabs_1.Tabs, null,
|
|
57
38
|
React.createElement(Tabs_1.Tabs.Tab, null, "Format"),
|
|
58
39
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -70,9 +51,6 @@ const FormatColumnSettingsWizardSection = (props) => {
|
|
|
70
51
|
label: item.label,
|
|
71
52
|
onClick: () => onCellAlignmentSelectChanged(item.value),
|
|
72
53
|
})), columns: ['label'] }, data.CellAlignment ? data.CellAlignment : 'Select Option')),
|
|
73
|
-
hasHeaderName && api.scopeApi.isSingleColumnScope(data.Scope) && (React.createElement(FormLayout_1.FormRow, { label: "Header Name" },
|
|
74
|
-
React.createElement(Input_1.default, { value: data.HeaderName, onChange: (e) => onHeaderNameChanged(e), style: { minWidth: '15rem' } }),
|
|
75
|
-
' ')),
|
|
76
54
|
React.createElement(FormLayout_1.FormRow, { label: "Include Grouped Rows:" },
|
|
77
55
|
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
|
|
78
56
|
React.createElement(CheckBox_1.CheckBox, { checked: data.IncludeGroupedRows, onChange: onIncludeGroupedRowsChanged, mr: 2 }))))))));
|
|
@@ -22,7 +22,6 @@ const isFormatColumnStyleValid = (data, api) => {
|
|
|
22
22
|
data.Style &&
|
|
23
23
|
UIHelper_1.default.IsEmptyStyle(data.Style) &&
|
|
24
24
|
data.DisplayFormat === undefined &&
|
|
25
|
-
data.HeaderName === undefined &&
|
|
26
25
|
data.CellAlignment === undefined &&
|
|
27
26
|
!api.scopeApi.isSingleBooleanColumnScope(data.Scope)) {
|
|
28
27
|
return 'No format applied';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartModel, ChartRef, ColDef, ColGroupDef, Column, ExcelStyle, GridOptions, Module, RowNode } from '@ag-grid-community/core';
|
|
1
|
+
import { ChartModel, ChartRef, ColDef, ColGroupDef, Column, ExcelStyle, GridOptions, Module, ModuleNames, RowNode } from '@ag-grid-community/core';
|
|
2
2
|
import { AdaptableNoCodeWizardOptions, IAdaptableNoCodeWizard } from '../AdaptableInterfaces/AdaptableNoCodeWizard';
|
|
3
3
|
import { IAdaptable } from '../AdaptableInterfaces/IAdaptable';
|
|
4
4
|
import { AdaptableOptions } from '../AdaptableOptions/AdaptableOptions';
|
|
@@ -293,7 +293,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
293
293
|
setupColumnComparator({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
294
294
|
private applyCurrentTheme;
|
|
295
295
|
private applyFinalRendering;
|
|
296
|
-
|
|
296
|
+
isAgGridModulePresent(moduleName: ModuleNames): boolean;
|
|
297
297
|
private getAgGridRegisteredModules;
|
|
298
298
|
private onRowDataChanged;
|
|
299
299
|
private onCellDataChanged;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -466,19 +466,13 @@ class Adaptable {
|
|
|
466
466
|
AdaptableHelper_1.default.checkValidPrimaryKey(this);
|
|
467
467
|
}, (e) => {
|
|
468
468
|
(0, LoggingHelper_1.ConsoleLogError)('Failed to Init Modules : ', e);
|
|
469
|
-
// for now we
|
|
469
|
+
// for now we initialize the grid even if initialising Modules has failed (perhaps revisit this?)
|
|
470
470
|
this.initInternalGridLogic();
|
|
471
471
|
this.api.internalApi.hideLoadingScreen(); // doesnt really help but at least clears the screen
|
|
472
472
|
}).then(async () => {
|
|
473
473
|
this.api.internalApi.hideLoadingScreen();
|
|
474
474
|
this.isInitialised = true;
|
|
475
475
|
this._adaptableReady = true;
|
|
476
|
-
// setTimeout(() => {
|
|
477
|
-
// this.api.eventApi.emit('AdaptableReady', {
|
|
478
|
-
// adaptableApi: this.api,
|
|
479
|
-
// gridOptions: this.adaptableOptions.gridOptions,
|
|
480
|
-
// });
|
|
481
|
-
// }, 0);
|
|
482
476
|
});
|
|
483
477
|
if (this.abContainerElement == null) {
|
|
484
478
|
this.abContainerElement = this.getAdaptableContainerElement();
|
|
@@ -3406,13 +3400,6 @@ class Adaptable {
|
|
|
3406
3400
|
if (layoutCustomHeader) {
|
|
3407
3401
|
resultHeaderName = layoutCustomHeader;
|
|
3408
3402
|
}
|
|
3409
|
-
// check if the deprecated formatColumn header is used
|
|
3410
|
-
const formatColumn = this.api.formatColumnApi.getFormatColumnForColumnId(abColumn.columnId);
|
|
3411
|
-
if (!layoutCustomHeader && (formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.HeaderName) && !formatColumn.IsSuspended) {
|
|
3412
|
-
// fallback to the formatColumn property if no Layout custom header is provided
|
|
3413
|
-
resultHeaderName = formatColumn.HeaderName;
|
|
3414
|
-
(0, LoggingHelper_1.ConsoleLogWarning)(`DEPRECATED: 'FormatColumn.HeaderName' is deprecated: use 'Layout.ColumnHeadersMap' instead`);
|
|
3415
|
-
}
|
|
3416
3403
|
// required here for the initial layout rendering
|
|
3417
3404
|
abColumn.friendlyName = resultHeaderName;
|
|
3418
3405
|
return resultHeaderName;
|