@adaptabletools/adaptable 13.0.0-canary.1 → 13.0.0-canary.3
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 +23 -1
- package/agGrid.js +23 -1
- package/base.css +1 -0
- package/bundle.cjs.js +158 -158
- package/index.css +1 -0
- package/package.json +3 -3
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -0
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +42 -14
- package/src/Api/ConditionalStyleApi.d.ts +20 -0
- package/src/Api/FormatColumnApi.d.ts +42 -3
- package/src/Api/Implementation/DashboardApiImpl.js +2 -3
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +17 -1
- package/src/Api/Implementation/FormatColumnApiImpl.js +94 -14
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +0 -2
- package/src/Api/Implementation/QueryLanguageApiImpl.js +0 -3
- package/src/Api/QueryLanguageApi.d.ts +0 -5
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +37 -37
- package/src/PredefinedConfig/FormatColumnState.d.ts +19 -0
- package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -0
- package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +14 -0
- package/src/Redux/ActionsReducers/FormatColumnRedux.js +43 -1
- package/src/Redux/Store/AdaptableStore.js +2 -0
- package/src/Strategy/FormatColumnModule.d.ts +2 -9
- package/src/Strategy/FormatColumnModule.js +5 -1
- package/src/Strategy/Interface/IModule.d.ts +10 -10
- package/src/Strategy/Utilities/Alert/getAlertBehaviourViewItems.d.ts +2 -2
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +5 -5
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +3 -2
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +4 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +4 -1
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +4 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +4 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +4 -1
- package/src/Utilities/Extensions/TypeExtensions.d.ts +1 -0
- package/src/Utilities/Extensions/TypeExtensions.js +5 -0
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +14 -4
- package/src/Utilities/Services/LicenseService.js +1 -1
- package/src/Utilities/Services/QueryLanguageService.d.ts +5 -3
- package/src/Utilities/Services/QueryLanguageService.js +92 -39
- package/src/Utilities/license/LicenseDetails.d.ts +1 -1
- package/src/Utilities/license/decode.d.ts +1 -0
- package/src/Utilities/license/decode.js +1 -1
- package/src/View/AdaptablePopover/index.d.ts +2 -2
- package/src/View/AdaptableView.d.ts +3 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.d.ts +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts +1 -1
- package/src/View/AdaptableWizardView/index.d.ts +1 -1
- package/src/View/ColorPicker.d.ts +1 -5
- package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
- package/src/View/Components/Buttons/ButtonEdit.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.d.ts +2 -2
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/Navigation.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/TopBar.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopupPrompt.d.ts +1 -1
- package/src/View/FormatColumn/MoveFormatColumn.d.ts +7 -0
- package/src/View/FormatColumn/MoveFormatColumn.js +27 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +9 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +66 -0
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +20 -2
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +2 -1
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +14 -0
- package/src/View/FormatColumn/Wizard/constants.d.ts +1 -0
- package/src/View/FormatColumn/Wizard/constants.js +4 -0
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/SettingsSection.d.ts +2 -2
- package/src/View/License/LicenseWatermark.d.ts +1 -1
- package/src/View/StateManagement/components/ClearButton.d.ts +1 -1
- package/src/View/StateManagement/components/LoadButton.d.ts +1 -1
- package/src/View/StatusBar/StatusBarPanel.d.ts +4 -4
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +3 -3
- package/src/View/Wizard/OnePageAdaptableWizard.js +2 -2
- package/src/View/Wizard/OnePageWizards.d.ts +3 -3
- package/src/View/Wizard/OnePageWizards.js +2 -2
- package/src/agGrid/Adaptable.d.ts +11 -0
- package/src/agGrid/Adaptable.js +134 -66
- package/src/agGrid/FilterWrapper.js +4 -5
- package/src/agGrid/FloatingFilterWrapper.js +3 -4
- package/src/agGrid/createAgStatusPanelComponent.d.ts +1 -0
- package/src/agGrid/createAgStatusPanelComponent.js +3 -3
- package/src/components/CheckBox/index.d.ts +1 -1
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/Dialog/index.d.ts +4 -2
- package/src/components/Dialog/index.js +2 -2
- package/src/components/DropdownButton/index.d.ts +21 -4
- package/src/components/DropdownButton/index.js +5 -6
- package/src/components/ExpressionEditor/BaseEditorInput.d.ts +1 -1
- package/src/components/ExpressionEditor/EditorInput.js +1 -1
- package/src/components/ExpressionEditor/EditorInputWithWhereClause.js +1 -1
- package/src/components/Input/index.d.ts +1 -1
- package/src/components/List/ListGroupItem/index.d.ts +4 -2
- package/src/components/Loader/Loader.d.ts +2 -2
- package/src/components/Logo/index.d.ts +1 -1
- package/src/components/Modal/index.d.ts +1 -1
- package/src/components/PopupWithFooter.d.ts +2 -2
- package/src/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
- package/src/components/SelectList.d.ts +1 -1
- package/src/components/SimpleButton/index.d.ts +4 -5
- package/src/components/SimpleButton/index.js +3 -2
- package/src/components/StylePreview.d.ts +1 -1
- package/src/components/Tag/Tag.d.ts +1 -1
- package/src/components/Textarea/index.d.ts +6 -4
- package/src/components/ToggleButton/index.d.ts +1 -1
- package/src/components/WindowModal/WindowModal.d.ts +1 -1
- package/src/components/icons/index.d.ts +3 -2
- package/src/components/icons/layout.d.ts +2 -1
- package/src/components/utils/useContainerScrollObserver/index.d.ts +1 -1
- package/src/metamodel/adaptable.metamodel.d.ts +47 -29
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +6 -3
- package/src/renderReactRoot.d.ts +3 -0
- package/src/renderReactRoot.js +54 -0
- package/src/types.d.ts +2 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -4,7 +4,7 @@ import { AggregatedScalarExpressionEvaluation } from './aggregatedScalarExpressi
|
|
|
4
4
|
/**
|
|
5
5
|
* List of all the Aggregation Functions available in AdaptableQL
|
|
6
6
|
*/
|
|
7
|
-
export declare type
|
|
7
|
+
export declare type AggregatedBooleanFunctionName = 'WHERE' | 'COL' | 'GROUP_BY' | AggregationFunction | ComparisonFunction;
|
|
8
8
|
declare type AggregationFunction = 'SUM' | 'MIN' | 'MAX' | 'AVG';
|
|
9
9
|
declare type ComparisonFunction = 'EQ' | 'NEQ' | 'LT' | 'GT' | 'LTE' | 'GTE';
|
|
10
10
|
export interface BooleanAggregationParameter extends BaseParameter<'aggregationBoolean', AggregationFunction> {
|
|
@@ -15,5 +15,6 @@ export interface BooleanAggregationParameter extends BaseParameter<'aggregationB
|
|
|
15
15
|
export interface ScalarAggregationOperand extends BaseParameter<'aggregationScalar', AggregationFunction> {
|
|
16
16
|
value: AggregatedScalarExpressionEvaluation;
|
|
17
17
|
}
|
|
18
|
-
export declare const aggregatedBooleanExpressionFunctions: Record<
|
|
18
|
+
export declare const aggregatedBooleanExpressionFunctions: Record<AggregatedBooleanFunctionName, ExpressionFunction>;
|
|
19
|
+
export declare const aggregatedBooleanExpressionFunctionsList: Record<AggregatedBooleanFunctionName, ExpressionFunction>[];
|
|
19
20
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.aggregatedBooleanExpressionFunctions = void 0;
|
|
3
|
+
exports.aggregatedBooleanExpressionFunctionsList = 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");
|
|
@@ -174,3 +174,6 @@ const extractScalarOperand = (consumingFunctionName, value, allowedTypes) => {
|
|
|
174
174
|
// numeric value
|
|
175
175
|
return (0, parseInt_1.default)(numericString) * numberUnitRatios[largeNumberUnit.toLowerCase()];
|
|
176
176
|
};
|
|
177
|
+
exports.aggregatedBooleanExpressionFunctionsList = Object.entries(exports.aggregatedBooleanExpressionFunctions).map(([functionName, expressionImplementation]) => ({
|
|
178
|
+
[functionName]: expressionImplementation,
|
|
179
|
+
}));
|
|
@@ -42,4 +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 aggregatedScalarExpressionFunctionsList: Record<AggregatedScalarFunctionName, ExpressionFunction>[];
|
|
45
46
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.aggregatedScalarExpressionFunctions = exports.aggregatedExpressionFunctions = exports.cumulativeAggregatedExpressionFunctions = void 0;
|
|
3
|
+
exports.aggregatedScalarExpressionFunctionsList = 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
6
|
exports.cumulativeAggregatedExpressionFunctions = [
|
|
@@ -649,6 +649,9 @@ const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, c
|
|
|
649
649
|
};
|
|
650
650
|
return cumulationExpressionEvaluation;
|
|
651
651
|
};
|
|
652
|
+
exports.aggregatedScalarExpressionFunctionsList = Object.entries(exports.aggregatedScalarExpressionFunctions).map(([functionName, expressionImplementation]) => ({
|
|
653
|
+
[functionName]: expressionImplementation,
|
|
654
|
+
}));
|
|
652
655
|
// !! mutates expressionEvaluation
|
|
653
656
|
const addGroupByParams = (groupByColumnNames, expressionEvaluation) => {
|
|
654
657
|
if (groupByColumnNames === null || groupByColumnNames === void 0 ? void 0 : groupByColumnNames.length) {
|
|
@@ -4,3 +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 booleanExpressionFunctionsList: Record<BooleanFunctionName, ExpressionFunction>[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.booleanExpressionFunctions = void 0;
|
|
3
|
+
exports.booleanExpressionFunctionsList = 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"));
|
|
@@ -293,3 +293,6 @@ exports.booleanExpressionFunctions = {
|
|
|
293
293
|
examples: ['QUERY("anyNamedQuery")'],
|
|
294
294
|
},
|
|
295
295
|
};
|
|
296
|
+
exports.booleanExpressionFunctionsList = Object.entries(exports.booleanExpressionFunctions).map(([functionName, expressionImplementation]) => ({
|
|
297
|
+
[functionName]: expressionImplementation,
|
|
298
|
+
}));
|
|
@@ -6,4 +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 observableExpressionFunctionsList: Record<ObservableFunctionName, ExpressionFunction>[];
|
|
9
10
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.observableExpressionFunctions = void 0;
|
|
3
|
+
exports.observableExpressionFunctionsList = 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");
|
|
@@ -212,6 +212,9 @@ exports.observableExpressionFunctions = {
|
|
|
212
212
|
examples: ["TIMEFRAME('20s')", "TIMEFRAME('5m')", "TIMEFRAME('1h')"],
|
|
213
213
|
},
|
|
214
214
|
};
|
|
215
|
+
exports.observableExpressionFunctionsList = Object.entries(exports.observableExpressionFunctions).map(([functionName, expressionImplementation]) => ({
|
|
216
|
+
[functionName]: expressionImplementation,
|
|
217
|
+
}));
|
|
215
218
|
// return TRUE if the last(tail) element has the greatest value
|
|
216
219
|
const isLastElementMaxValue = (values) => {
|
|
217
220
|
const [tailValue] = values.slice(-1);
|
|
@@ -4,3 +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 scalarExpressionFunctionsList: Record<ScalarFunctionName, ExpressionFunction>[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.scalarExpressionFunctions = void 0;
|
|
3
|
+
exports.scalarExpressionFunctionsList = 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"));
|
|
@@ -356,3 +356,6 @@ exports.scalarExpressionFunctions = {
|
|
|
356
356
|
examples: ['VAR(CURRENT_USER)', 'VAR(IS_VALID_VALUE, IS_BLANK([col1]), [col2] < [col3])'],
|
|
357
357
|
},
|
|
358
358
|
};
|
|
359
|
+
exports.scalarExpressionFunctionsList = Object.entries(exports.scalarExpressionFunctions).map(([functionName, expressionImplementation]) => ({
|
|
360
|
+
[functionName]: expressionImplementation,
|
|
361
|
+
}));
|
|
@@ -73,4 +73,5 @@ export declare type _DeepRequiredObject<T> = {
|
|
|
73
73
|
[P in keyof T]-?: DeepRequired<NonUndefined<T[P]>>;
|
|
74
74
|
};
|
|
75
75
|
export declare type NonUndefined<A> = A extends undefined ? never : A;
|
|
76
|
+
export declare const getTypedKeys: <T extends string>(input: Record<T, any>) => T[];
|
|
76
77
|
export {};
|
|
@@ -3,9 +3,12 @@ import { IAdaptableService } from './IAdaptableService';
|
|
|
3
3
|
import { RowNode } from '@ag-grid-community/core';
|
|
4
4
|
import { CellDataChangedInfo } from '../../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
5
5
|
import { AdaptableModule } from '../../../PredefinedConfig/Common/Types';
|
|
6
|
-
import { ScalarAggregationParameter } from '../../ExpressionFunctions/aggregatedScalarExpressionFunctions';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { AggregatedScalarFunctionName, ScalarAggregationParameter } from '../../ExpressionFunctions/aggregatedScalarExpressionFunctions';
|
|
7
|
+
import { AggregatedBooleanFunctionName, BooleanAggregationParameter } from '../../ExpressionFunctions/aggregatedBooleanExpressionFunctions';
|
|
8
|
+
import { BooleanFunctionName } from '../../ExpressionFunctions/booleanExpressionFunctions';
|
|
9
|
+
import { ScalarFunctionName } from '../../ExpressionFunctions/scalarExpressionFunctions';
|
|
10
|
+
import { ObservableFunctionName } from '../../ExpressionFunctions/observableExpressionFunctions';
|
|
11
|
+
import { ExpressionFunctionMap } from '../../../parser/src/types';
|
|
9
12
|
export interface IQueryLanguageService extends IAdaptableService {
|
|
10
13
|
evaluateBooleanExpression(expression: string, module: AdaptableModule, rowNode: RowNode): boolean;
|
|
11
14
|
evaluateScalarExpression(expression: string, module: AdaptableModule, rowNode: RowNode): any;
|
|
@@ -31,10 +34,17 @@ export interface IQueryLanguageService extends IAdaptableService {
|
|
|
31
34
|
errorMessage: string;
|
|
32
35
|
};
|
|
33
36
|
computeAggregatedBooleanValue(expression: string, module: AdaptableModule): boolean;
|
|
34
|
-
|
|
37
|
+
getModuleExpressionFunctionsMap(module: AdaptableModule): ModuleExpressionFunctionsMap;
|
|
35
38
|
getColumnsFromExpression(input: string): string[];
|
|
36
39
|
getNamedQueryNamesFromExpression(input: string): string[];
|
|
37
40
|
isCumulativeAggregate(input: string): boolean;
|
|
38
41
|
evaluateCustomQueryVariable(functionName: string, args?: any[]): any;
|
|
39
42
|
getExpressionWithColumnFriendlyNames(expression: string): string;
|
|
40
43
|
}
|
|
44
|
+
export interface ModuleExpressionFunctionsMap {
|
|
45
|
+
booleanFunctions?: ExpressionFunctionMap<BooleanFunctionName>;
|
|
46
|
+
scalarFunctions?: ExpressionFunctionMap<ScalarFunctionName>;
|
|
47
|
+
observableFunctions?: ExpressionFunctionMap<ObservableFunctionName>;
|
|
48
|
+
aggregatedBooleanFunctions?: ExpressionFunctionMap<AggregatedBooleanFunctionName>;
|
|
49
|
+
aggregatedScalarFunctions?: ExpressionFunctionMap<AggregatedScalarFunctionName>;
|
|
50
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseService=exports.LicenseValidityType=void 0;const e=require("tslib"),a=require("../../Redux/ActionsReducers/SystemRedux"),t=require("../../Redux/ActionsReducers/PopupRedux"),s=e.__importDefault(require("../ObjectFactory")),o=require("../Helpers/LoggingHelper"),i=e.__importDefault(require("lodash/clamp")),n=require("../Constants/DocumentationLinkConstants"),r=require("../license/decode"),c="sales@adaptabletools.com",l=10,d=864e5;var p;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(p=exports.LicenseValidityType||(exports.LicenseValidityType={}));const E=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseService=exports.LicenseValidityType=void 0;const e=require("tslib"),a=require("../../Redux/ActionsReducers/SystemRedux"),t=require("../../Redux/ActionsReducers/PopupRedux"),s=e.__importDefault(require("../ObjectFactory")),o=require("../Helpers/LoggingHelper"),i=e.__importDefault(require("lodash/clamp")),n=require("../Constants/DocumentationLinkConstants"),r=require("../license/decode"),c="sales@adaptabletools.com",l=10,d=864e5;var p;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(p=exports.LicenseValidityType||(exports.LicenseValidityType={}));const E=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,_=/(https):\/\/\S+(\.csb\.app)/g,I=/(https):\/\/\S+(\.adaptabletools\.com)/g,O="undefined"!=typeof window?window.location.origin:"",N=()=>{const[e,a,t]=Array.from(E.exec(O)||[]);return"https"===a&&"sandpack.codesandbox.io"===t},h=()=>{const[e,a,t]=Array.from(_.exec(O)||[]);return"https"===a&&".csb.app"===t},u=()=>{const[e,a,t]=Array.from(I.exec(O)||[]);return"https"===a&&".adaptabletools.com"===t};class A{constructor(e,a,t){this.adaptable=e,this.adaptable=e;let s=null;if(a)try{s=(0,r.decode)(a)}catch(e){s=e}N()||h()||u()||this.handleLicenseValidation(s,this.getValidityType(s,t))}getValidityType(e,a){if(!e)return p.NO_LICENSE;if(e instanceof Error)return p.INVALID_LICENSE;const t=new Date(a.publishedAt),s=new Date(e.end),o=s<new Date,i=e.trial;let n=null;return n=o?s>t?i?p.NON_PRODUCTION_EXPIRED_IN_SCOPE:p.COMMERCIAL_EXPIRED_IN_SCOPE:i?p.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:p.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:i?p.NON_PRODUCTION_VALID:p.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){var t;const s=new Date;s.setHours(0,0,0,0);let l=0;e instanceof Error||!(null==e?void 0:e.end)||(l=Math.floor(((null===(t=null==e?void 0:e.end)||void 0===t?void 0:t.getTime())-s.getTime())/864e5),l=(0,i.default)(l,0,1/0));let d="",p="";!e||e instanceof Error||!e.appName||e.appName==r.GENERIC_APP_NAME||(d=e.appName,p=" for application [APP_NAME]");const E=(e,a=n.LicenseDocsLink,t=c,s=l,o=d)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[APP_NAME]",o).replace("[DAYS]",`${s}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":(0,o.ConsoleLogByMessageType)(E("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":(0,o.ConsoleLogByMessageType)(E("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":(0,o.ConsoleLogByMessageType)(E("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":(0,o.ConsoleLogByMessageType)(E("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":if(l<=10)(0,o.ConsoleLogByMessageType)(E(`This AdapTable license${p} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`),"Info");else try{"development"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV||(0,o.ConsoleLogByMessageType)(E(`Thank you for using a valid AdapTable license${p}. Your license will expire in [DAYS] days.`),"Info")}catch(e){}break;case"COMMERCIAL_EXPIRED_IN_SCOPE":(0,o.ConsoleLogByMessageType)(E(`This AdapTable license${p} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":(0,o.ConsoleLogByMessageType)(E(`This AdapTable license${p} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction((0,t.PopupShowAlert)({alertType:"generic",header:"License Error",message:e,alertDefinition:s.default.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction((0,a.SystemLicenseShowWatermark)(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction((0,a.SystemLicenseDisablePersistence)())}destroy(){}}exports.LicenseService=A;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { IQueryLanguageService } from './Interface/IQueryLanguageService';
|
|
1
|
+
import { IQueryLanguageService, ModuleExpressionFunctionsMap } from './Interface/IQueryLanguageService';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
4
4
|
import { RowNode } from '@ag-grid-community/core';
|
|
5
5
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
6
|
-
import { ModuleExpressionFunctions } from '../../AdaptableOptions/AdaptableQLOptions';
|
|
7
6
|
import { ScalarAggregationParameter } from '../ExpressionFunctions/aggregatedScalarExpressionFunctions';
|
|
8
7
|
import { AdaptableApi } from '../../../types';
|
|
9
8
|
import { BooleanAggregationParameter } from '../ExpressionFunctions/aggregatedBooleanExpressionFunctions';
|
|
@@ -43,7 +42,10 @@ export declare class QueryLanguageService implements IQueryLanguageService {
|
|
|
43
42
|
getNamedQueryNamesFromExpression(input?: string): string[];
|
|
44
43
|
isCumulativeAggregate(input: string): boolean;
|
|
45
44
|
getExpressionWithColumnFriendlyNames(expression?: string): string;
|
|
46
|
-
|
|
45
|
+
getModuleExpressionFunctionsMap(module: AdaptableModule): ModuleExpressionFunctionsMap;
|
|
46
|
+
private getFunctionNames;
|
|
47
|
+
private extractDefaultExpressionFunctions;
|
|
48
|
+
private mapFunctionsDefinitionToMap;
|
|
47
49
|
evaluateCustomQueryVariable(functionName: string, args?: any[]): any;
|
|
48
50
|
private getBooleanAndScalarFunctions;
|
|
49
51
|
private getExpressionCacheKey;
|
|
@@ -5,7 +5,13 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const parser = tslib_1.__importStar(require("../../parser/src"));
|
|
6
6
|
const rxjs_1 = require("rxjs");
|
|
7
7
|
const LoggingHelper_1 = require("../Helpers/LoggingHelper");
|
|
8
|
+
const aggregatedScalarExpressionFunctions_1 = require("../ExpressionFunctions/aggregatedScalarExpressionFunctions");
|
|
9
|
+
const aggregatedBooleanExpressionFunctions_1 = require("../ExpressionFunctions/aggregatedBooleanExpressionFunctions");
|
|
8
10
|
const AggregatedScalarLiveValue_1 = require("./AggregatedScalarLiveValue");
|
|
11
|
+
const booleanExpressionFunctions_1 = require("../ExpressionFunctions/booleanExpressionFunctions");
|
|
12
|
+
const scalarExpressionFunctions_1 = require("../ExpressionFunctions/scalarExpressionFunctions");
|
|
13
|
+
const observableExpressionFunctions_1 = require("../ExpressionFunctions/observableExpressionFunctions");
|
|
14
|
+
const TypeExtensions_1 = require("../Extensions/TypeExtensions");
|
|
9
15
|
class QueryLanguageService {
|
|
10
16
|
constructor(adaptableApi) {
|
|
11
17
|
this.adaptableApi = adaptableApi;
|
|
@@ -16,7 +22,7 @@ class QueryLanguageService {
|
|
|
16
22
|
this.cacheModuleSpecificExpressionFunctions = new Map();
|
|
17
23
|
}
|
|
18
24
|
evaluateBooleanExpression(expression, module, rowNode) {
|
|
19
|
-
const moduleExpressionFunctions = this.
|
|
25
|
+
const moduleExpressionFunctions = this.getModuleExpressionFunctionsMap(module);
|
|
20
26
|
const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
|
|
21
27
|
return parser.evaluate(expression, {
|
|
22
28
|
node: rowNode,
|
|
@@ -30,7 +36,7 @@ class QueryLanguageService {
|
|
|
30
36
|
return this.evaluateBooleanExpression(expression, module, rowNode);
|
|
31
37
|
}
|
|
32
38
|
evaluateAggregatedScalarExpression(expression, module) {
|
|
33
|
-
const aggregatedScalarFunctions = this.
|
|
39
|
+
const aggregatedScalarFunctions = this.getModuleExpressionFunctionsMap(module).aggregatedScalarFunctions;
|
|
34
40
|
return parser.evaluate(expression, {
|
|
35
41
|
node: null,
|
|
36
42
|
adaptableApi: this.adaptableApi,
|
|
@@ -39,7 +45,7 @@ class QueryLanguageService {
|
|
|
39
45
|
});
|
|
40
46
|
}
|
|
41
47
|
evaluateObservableExpression(reactiveExpression, module) {
|
|
42
|
-
const moduleExpressionFunctions = this.
|
|
48
|
+
const moduleExpressionFunctions = this.getModuleExpressionFunctionsMap(module);
|
|
43
49
|
const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
|
|
44
50
|
const reactiveExpression$ = parser.evaluate(reactiveExpression, {
|
|
45
51
|
node: reactiveExpression,
|
|
@@ -51,12 +57,12 @@ class QueryLanguageService {
|
|
|
51
57
|
return reactiveExpression$;
|
|
52
58
|
}
|
|
53
59
|
evaluateAggregatedBooleanExpression(aggregationExpression, module) {
|
|
54
|
-
const
|
|
55
|
-
const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(
|
|
60
|
+
const moduleExpressionFunctionsMap = this.getModuleExpressionFunctionsMap(module);
|
|
61
|
+
const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctionsMap);
|
|
56
62
|
const aggregationEvaluation = parser.evaluate(aggregationExpression, {
|
|
57
63
|
node: aggregationExpression,
|
|
58
64
|
adaptableApi: this.adaptableApi,
|
|
59
|
-
functions:
|
|
65
|
+
functions: moduleExpressionFunctionsMap.aggregatedBooleanFunctions,
|
|
60
66
|
whereClauseFunctions: booleanAndScalarFunctions,
|
|
61
67
|
evaluateCustomQueryVariable: this.evaluateCustomQueryVariable,
|
|
62
68
|
});
|
|
@@ -89,7 +95,7 @@ class QueryLanguageService {
|
|
|
89
95
|
}
|
|
90
96
|
const { ast } = parser.parse(expression.trim());
|
|
91
97
|
const rootFn = ast[ast.length - 1];
|
|
92
|
-
const moduleExpressionFunctions = this.
|
|
98
|
+
const moduleExpressionFunctions = this.getModuleExpressionFunctionsMap(module);
|
|
93
99
|
const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
|
|
94
100
|
if (rootFn.type === undefined || booleanAndScalarFunctions[rootFn.type] === undefined) {
|
|
95
101
|
const result = {
|
|
@@ -268,43 +274,90 @@ class QueryLanguageService {
|
|
|
268
274
|
}
|
|
269
275
|
// Returns the ExpressionFunctions available for the given Module as specified in the `QueryLanguageOptions.moduleExpressionFunctions`
|
|
270
276
|
// if there are no specific functions defined, it falls back to the default values
|
|
271
|
-
|
|
272
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
277
|
+
getModuleExpressionFunctionsMap(module) {
|
|
278
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
279
|
+
const expressionOptions = this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions;
|
|
280
|
+
if (module) {
|
|
281
|
+
let cachedResult = this.cacheModuleSpecificExpressionFunctions.get(module);
|
|
282
|
+
if (cachedResult) {
|
|
283
|
+
return cachedResult;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
const defaultBooleanExpressionFunctions = this.extractDefaultExpressionFunctions(expressionOptions.defaultBooleanFunctions, booleanExpressionFunctions_1.booleanExpressionFunctions);
|
|
287
|
+
const defaultScalarExpressionFunctions = this.extractDefaultExpressionFunctions(expressionOptions.defaultScalarFunctions, scalarExpressionFunctions_1.scalarExpressionFunctions);
|
|
288
|
+
const defaultObservableExpressionFunctions = this.extractDefaultExpressionFunctions(expressionOptions.defaultObservableFunctions, observableExpressionFunctions_1.observableExpressionFunctions);
|
|
289
|
+
const defaultAggregatedBooleanFunctions = this.extractDefaultExpressionFunctions(expressionOptions.defaultAggregatedBooleanFunctions, aggregatedBooleanExpressionFunctions_1.aggregatedBooleanExpressionFunctions);
|
|
290
|
+
const defaultAggregatedScalarFunctions = this.extractDefaultExpressionFunctions(expressionOptions.defaultAggregatedScalarFunctions, aggregatedScalarExpressionFunctions_1.aggregatedScalarExpressionFunctions);
|
|
273
291
|
if (!module) {
|
|
274
292
|
(0, LoggingHelper_1.LogAdaptableInfo)(`QueryLanguageService.getModuleExpressionFunctions() was called with an undefined 'module' param, this should never happen`);
|
|
275
293
|
return {
|
|
276
|
-
booleanFunctions: this.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
294
|
+
booleanFunctions: this.mapFunctionsDefinitionToMap(defaultBooleanExpressionFunctions, booleanExpressionFunctions_1.booleanExpressionFunctions),
|
|
295
|
+
scalarFunctions: this.mapFunctionsDefinitionToMap(defaultScalarExpressionFunctions, scalarExpressionFunctions_1.scalarExpressionFunctions),
|
|
296
|
+
observableFunctions: this.mapFunctionsDefinitionToMap(defaultObservableExpressionFunctions, observableExpressionFunctions_1.observableExpressionFunctions),
|
|
297
|
+
aggregatedBooleanFunctions: this.mapFunctionsDefinitionToMap(defaultAggregatedBooleanFunctions, aggregatedBooleanExpressionFunctions_1.aggregatedBooleanExpressionFunctions),
|
|
298
|
+
aggregatedScalarFunctions: this.mapFunctionsDefinitionToMap(defaultAggregatedScalarFunctions, aggregatedScalarExpressionFunctions_1.aggregatedScalarExpressionFunctions),
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
let moduleExpressionFunctions;
|
|
302
|
+
if (typeof expressionOptions.moduleExpressionFunctions === 'function') {
|
|
303
|
+
const context = {
|
|
304
|
+
adaptableApi: this.adaptableApi,
|
|
305
|
+
module,
|
|
306
|
+
defaultBooleanFunctionNames: this.getFunctionNames(defaultBooleanExpressionFunctions),
|
|
307
|
+
defaultScalarFunctionNames: this.getFunctionNames(defaultScalarExpressionFunctions),
|
|
308
|
+
defaultObservableFunctionNames: this.getFunctionNames(defaultObservableExpressionFunctions),
|
|
309
|
+
defaultAggregatedBooleanFunctionNames: this.getFunctionNames(defaultAggregatedBooleanFunctions),
|
|
310
|
+
defaultAggregatedScalarFunctionNames: this.getFunctionNames(defaultAggregatedScalarFunctions),
|
|
286
311
|
};
|
|
312
|
+
moduleExpressionFunctions = (_a = expressionOptions.moduleExpressionFunctions(context)) !== null && _a !== void 0 ? _a : {};
|
|
287
313
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
return cachedResult;
|
|
314
|
+
else {
|
|
315
|
+
moduleExpressionFunctions = (_c = (_b = expressionOptions.moduleExpressionFunctions) === null || _b === void 0 ? void 0 : _b[module]) !== null && _c !== void 0 ? _c : {};
|
|
291
316
|
}
|
|
292
|
-
const
|
|
293
|
-
.
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
.defaultScalarFunctions,
|
|
299
|
-
observableFunctions: (_e = moduleSpecificOptions.observableFunctions) !== null && _e !== void 0 ? _e : this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
300
|
-
.defaultObservableFunctions,
|
|
301
|
-
aggregatedBooleanFunctions: (_f = moduleSpecificOptions.aggregatedBooleanFunctions) !== null && _f !== void 0 ? _f : this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
302
|
-
.defaultAggregatedBooleanFunctions,
|
|
303
|
-
aggregatedScalarFunctions: (_g = moduleSpecificOptions.aggregatedScalarFunctions) !== null && _g !== void 0 ? _g : this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
304
|
-
.defaultAggregatedScalarFunctions,
|
|
317
|
+
const moduleExpressionFunctionsMap = {
|
|
318
|
+
booleanFunctions: this.mapFunctionsDefinitionToMap((_d = moduleExpressionFunctions.booleanFunctions) !== null && _d !== void 0 ? _d : defaultBooleanExpressionFunctions, booleanExpressionFunctions_1.booleanExpressionFunctions),
|
|
319
|
+
scalarFunctions: this.mapFunctionsDefinitionToMap((_e = moduleExpressionFunctions.scalarFunctions) !== null && _e !== void 0 ? _e : defaultScalarExpressionFunctions, scalarExpressionFunctions_1.scalarExpressionFunctions),
|
|
320
|
+
observableFunctions: this.mapFunctionsDefinitionToMap((_f = moduleExpressionFunctions.observableFunctions) !== null && _f !== void 0 ? _f : defaultObservableExpressionFunctions, observableExpressionFunctions_1.observableExpressionFunctions),
|
|
321
|
+
aggregatedBooleanFunctions: this.mapFunctionsDefinitionToMap((_g = moduleExpressionFunctions.aggregatedBooleanFunctions) !== null && _g !== void 0 ? _g : defaultAggregatedBooleanFunctions, aggregatedBooleanExpressionFunctions_1.aggregatedBooleanExpressionFunctions),
|
|
322
|
+
aggregatedScalarFunctions: this.mapFunctionsDefinitionToMap((_h = moduleExpressionFunctions.aggregatedScalarFunctions) !== null && _h !== void 0 ? _h : defaultAggregatedScalarFunctions, aggregatedScalarExpressionFunctions_1.aggregatedScalarExpressionFunctions),
|
|
305
323
|
};
|
|
306
|
-
this.cacheModuleSpecificExpressionFunctions.set(module,
|
|
307
|
-
return
|
|
324
|
+
this.cacheModuleSpecificExpressionFunctions.set(module, moduleExpressionFunctionsMap);
|
|
325
|
+
return moduleExpressionFunctionsMap;
|
|
326
|
+
}
|
|
327
|
+
getFunctionNames(definitions) {
|
|
328
|
+
return definitions.flatMap((definition) => {
|
|
329
|
+
if (typeof definition === 'string') {
|
|
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 = {
|
|
340
|
+
adaptableApi: this.adaptableApi,
|
|
341
|
+
availableExpressionFunctionNames: (0, TypeExtensions_1.getTypedKeys)(availableExpressionFunctions),
|
|
342
|
+
};
|
|
343
|
+
return defaultOptions(context);
|
|
344
|
+
}
|
|
345
|
+
return defaultOptions;
|
|
346
|
+
}
|
|
347
|
+
mapFunctionsDefinitionToMap(functionsDefinition, internalExpressionFunctions) {
|
|
348
|
+
let resultMap = {};
|
|
349
|
+
functionsDefinition.forEach((definition) => {
|
|
350
|
+
if (typeof definition === 'string') {
|
|
351
|
+
const internalFunction = internalExpressionFunctions[definition];
|
|
352
|
+
if (internalFunction) {
|
|
353
|
+
resultMap[definition] = internalFunction;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
resultMap = Object.assign(Object.assign({}, resultMap), definition);
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
return resultMap;
|
|
308
361
|
}
|
|
309
362
|
evaluateCustomQueryVariable(functionName, args) {
|
|
310
363
|
var _a, _b, _c;
|
|
@@ -317,8 +370,8 @@ class QueryLanguageService {
|
|
|
317
370
|
? customQueryVariableDefinition(context)
|
|
318
371
|
: customQueryVariableDefinition;
|
|
319
372
|
}
|
|
320
|
-
getBooleanAndScalarFunctions(
|
|
321
|
-
return Object.assign(Object.assign({},
|
|
373
|
+
getBooleanAndScalarFunctions(moduleExpressionFunctionsMap) {
|
|
374
|
+
return Object.assign(Object.assign({}, moduleExpressionFunctionsMap.booleanFunctions), moduleExpressionFunctionsMap.scalarFunctions);
|
|
322
375
|
}
|
|
323
376
|
getExpressionCacheKey(expression, module) {
|
|
324
377
|
return `${module}::${expression}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.decode=exports.fieldsToLicenseDetails=void 0;const e=require("./hashing"),t=()=>new Error("Invalid License")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.decode=exports.fieldsToLicenseDetails=exports.GENERIC_APP_NAME=void 0;const e=require("./hashing"),t=()=>new Error("Invalid License");exports.GENERIC_APP_NAME="GenericAdaptableApp";const r=e=>{var r;const s=e.reduce(((e,t)=>(e.set(t.name,t.value),e)),new Map),o={start:new Date(s.get("StartDate")),end:new Date(s.get("EndDate")),owner:s.get("Owner"),appName:s.get("AppName")||exports.GENERIC_APP_NAME,timestamp:s.get("TS")?Number(s.get("TS")):0,trial:"true"===s.get("Trial"),ref:null!==(r=s.get("Ref"))&&void 0!==r?r:""};if(!(o.start&&o.end&&o.owner&&"boolean"==typeof o.trial&&o.ref))throw t();return o};exports.fieldsToLicenseDetails=r;const s=r=>{let s="",o=r.split("|").map((e=>{let[t,r]=e.split("=");return"C"===t&&(s=r),{name:t,value:r}}));if(!s)throw t();const a=s.split(",").reverse(),n=a.pop();a.forEach(((r,s)=>{const a=o[s];if((0,e.compute_string)(a.value)!==r)throw t()}));const i=[...o];i.pop();const p=i.map((e=>`${e.name}=${e.value}`)).join("|");if((0,e.compute_string)(p)!==n)throw t();return o=o.map((e=>Object.assign(Object.assign({},e),{value:decodeURI(e.value)}))),(0,exports.fieldsToLicenseDetails)(o)};exports.decode=s;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AdaptableMessageType } from '../../PredefinedConfig/Common/AdaptableMessageType';
|
|
3
|
-
export interface AdaptablePopoverProps extends React.ClassAttributes<AdaptablePopover
|
|
3
|
+
export interface AdaptablePopoverProps extends React.ClassAttributes<React.PropsWithChildren<AdaptablePopover>> {
|
|
4
4
|
headerText?: string;
|
|
5
5
|
showEvent?: string;
|
|
6
6
|
hideEvent?: string;
|
|
@@ -15,6 +15,6 @@ export interface AdaptablePopoverProps extends React.ClassAttributes<AdaptablePo
|
|
|
15
15
|
popoverMaxWidth?: number;
|
|
16
16
|
popupPadding?: number;
|
|
17
17
|
}
|
|
18
|
-
export declare class AdaptablePopover extends React.Component<AdaptablePopoverProps
|
|
18
|
+
export declare class AdaptablePopover extends React.Component<React.PropsWithChildren<AdaptablePopoverProps>, {}> {
|
|
19
19
|
render(): JSX.Element;
|
|
20
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { IAdaptable } from '../AdaptableInterfaces/IAdaptable';
|
|
3
|
-
export declare const AdaptableApp:
|
|
3
|
+
export declare const AdaptableApp: React.FunctionComponent<{
|
|
4
4
|
Adaptable: IAdaptable;
|
|
5
|
-
}
|
|
5
|
+
}>;
|
package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export interface FinanceFormProps {
|
|
|
4
4
|
adaptableOptions: AdaptableOptions;
|
|
5
5
|
onChangeadAptableOptions: (adaptableOptions: AdaptableOptions) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare const FinanceForm: React.FunctionComponent<FinanceFormProps
|
|
7
|
+
export declare const FinanceForm: React.FunctionComponent<React.PropsWithChildren<FinanceFormProps>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AdaptableWizardViewProps } from './Wizard';
|
|
3
|
-
declare const AdaptableWizardView: React.FunctionComponent<AdaptableWizardViewProps
|
|
3
|
+
declare const AdaptableWizardView: React.FunctionComponent<React.PropsWithChildren<AdaptableWizardViewProps>>;
|
|
4
4
|
export default AdaptableWizardView;
|
|
@@ -7,8 +7,4 @@ export declare type ColorPickerProps = Omit<HTMLProps<HTMLInputElement>, 'onChan
|
|
|
7
7
|
onChange: (color: string) => void;
|
|
8
8
|
value: string;
|
|
9
9
|
} & Omit<BoxProps, 'onChange'>;
|
|
10
|
-
export declare const ColorPicker: React.ForwardRefExoticComponent<Pick<
|
|
11
|
-
api: AdaptableApi;
|
|
12
|
-
onChange: (color: string) => void;
|
|
13
|
-
value: string;
|
|
14
|
-
} & Omit<BoxProps, "onChange">, "max" | "required" | "type" | "data" | "default" | "high" | "low" | "key" | "id" | "media" | "height" | "width" | "start" | "open" | "name" | "alignSelf" | "backgroundColor" | "color" | "content" | "flex" | "fontSize" | "margin" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "opacity" | "order" | "padding" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "value" | "hidden" | "cite" | "dir" | "form" | "label" | "p" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "acceptCharset" | "action" | "method" | "noValidate" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "async" | "disabled" | "multiple" | "size" | "manifest" | "m" | "wrap" | "accept" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "min" | "minLength" | "muted" | "optimum" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "api" | "mt" | "mb" | "ml" | "mr" | "my" | "marginY" | "mx" | "marginX" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "bg" | "css"> & React.RefAttributes<unknown>>;
|
|
10
|
+
export declare const ColorPicker: React.ForwardRefExoticComponent<Pick<ColorPickerProps, "max" | "required" | "type" | "data" | "default" | "high" | "low" | "key" | "id" | "media" | "height" | "width" | "start" | "open" | "name" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "color" | "content" | "display" | "flex" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "margin" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflow" | "overflowX" | "overflowY" | "padding" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "textAlign" | "translate" | "verticalAlign" | "value" | "hidden" | "cite" | "dir" | "form" | "label" | "p" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "acceptCharset" | "action" | "method" | "noValidate" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "async" | "disabled" | "multiple" | "size" | "manifest" | "m" | "wrap" | "accept" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "min" | "minLength" | "muted" | "optimum" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "api" | "bg" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "css" | "variant" | "tx" | "sx"> & React.RefAttributes<unknown>>;
|