@adaptabletools/adaptable 13.0.0-canary.2 → 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 +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- 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/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/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/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/agGrid/Adaptable.d.ts +5 -0
- package/src/agGrid/Adaptable.js +103 -45
- 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/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/types.d.ts +2 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/index.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "13.0.0-canary.
|
|
3
|
+
"version": "13.0.0-canary.3",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
package/publishTimestamp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: 1663245222592;
|
|
2
2
|
export default _default;
|
package/publishTimestamp.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExpressionFunction } from '../parser/src/types';
|
|
2
2
|
import { AdaptablePredicateDef } from '../PredefinedConfig/Common/AdaptablePredicate';
|
|
3
3
|
import { AdaptableModule, AdaptableQLModule, AdaptableQLModules } from '../PredefinedConfig/Common/Types';
|
|
4
4
|
import { BaseContext } from '../PredefinedConfig/Common/BaseContext';
|
|
5
5
|
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
6
|
+
import { BooleanFunctionName } from '../Utilities/ExpressionFunctions/booleanExpressionFunctions';
|
|
7
|
+
import { ScalarFunctionName } from '../Utilities/ExpressionFunctions/scalarExpressionFunctions';
|
|
8
|
+
import { ObservableFunctionName } from '../Utilities/ExpressionFunctions/observableExpressionFunctions';
|
|
9
|
+
import { AggregatedBooleanFunctionName } from '../Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions';
|
|
10
|
+
import { AggregatedScalarFunctionName } from '../Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions';
|
|
6
11
|
/**
|
|
7
12
|
* Options for managing AdaptableQL - the Adaptable Query Language which evaluates Predicates and Expressions
|
|
8
13
|
*/
|
|
@@ -52,44 +57,42 @@ export interface ExpressionOptions {
|
|
|
52
57
|
* @defaultValue null (sets all)
|
|
53
58
|
* @gridInfoItem
|
|
54
59
|
*/
|
|
55
|
-
defaultBooleanFunctions?:
|
|
60
|
+
defaultBooleanFunctions?: ExpressionFunctionDefinitions<BooleanFunctionName> | ((context: DefaultExpressionFunctionsContext<BooleanFunctionName>) => ExpressionFunctionDefinitions<BooleanFunctionName>);
|
|
56
61
|
/**
|
|
57
62
|
* Scalar Expression Functions available in AdaptableQL
|
|
58
63
|
*
|
|
59
64
|
* @defaultValue null (sets all)
|
|
60
65
|
* @gridInfoItem
|
|
61
66
|
*/
|
|
62
|
-
defaultScalarFunctions?:
|
|
67
|
+
defaultScalarFunctions?: ExpressionFunctionDefinitions<ScalarFunctionName> | ((context: DefaultExpressionFunctionsContext<ScalarFunctionName>) => ExpressionFunctionDefinitions<ScalarFunctionName>);
|
|
63
68
|
/**
|
|
64
69
|
* Observable Expression Functions available in AdaptableQL
|
|
65
70
|
*
|
|
66
71
|
* @defaultValue null (sets all)
|
|
67
72
|
* @gridInfoItem
|
|
68
73
|
*/
|
|
69
|
-
defaultObservableFunctions?:
|
|
74
|
+
defaultObservableFunctions?: ExpressionFunctionDefinitions<ObservableFunctionName> | ((context: DefaultExpressionFunctionsContext<ObservableFunctionName>) => ExpressionFunctionDefinitions<ObservableFunctionName>);
|
|
70
75
|
/**
|
|
71
76
|
* Aggregated Boolean Expression Functions available in AdaptableQL
|
|
72
77
|
*
|
|
73
78
|
* @defaultValue null (sets all)
|
|
74
79
|
* @gridInfoItem
|
|
75
80
|
*/
|
|
76
|
-
defaultAggregatedBooleanFunctions?:
|
|
81
|
+
defaultAggregatedBooleanFunctions?: ExpressionFunctionDefinitions<AggregatedBooleanFunctionName> | ((context: DefaultExpressionFunctionsContext<AggregatedBooleanFunctionName>) => ExpressionFunctionDefinitions<AggregatedBooleanFunctionName>);
|
|
77
82
|
/**
|
|
78
83
|
* Aggregated Scalar Expression Functions available in AdaptableQL
|
|
79
84
|
*
|
|
80
85
|
* @defaultValue null (sets all)
|
|
81
86
|
* @gridInfoItem
|
|
82
87
|
*/
|
|
83
|
-
defaultAggregatedScalarFunctions?:
|
|
88
|
+
defaultAggregatedScalarFunctions?: ExpressionFunctionDefinitions<AggregatedScalarFunctionName> | ((context: DefaultExpressionFunctionsContext<AggregatedScalarFunctionName>) => ExpressionFunctionDefinitions<AggregatedScalarFunctionName>);
|
|
84
89
|
/**
|
|
85
90
|
* Module specific ExpressionFunctions; if not defined, it falls back to the defined default values
|
|
86
91
|
*
|
|
87
92
|
* @defaultValue undefined (defaults to default values)
|
|
88
93
|
* @gridInfoItem
|
|
89
94
|
*/
|
|
90
|
-
moduleExpressionFunctions?:
|
|
91
|
-
[module in AdaptableModule]?: ModuleExpressionFunctions;
|
|
92
|
-
};
|
|
95
|
+
moduleExpressionFunctions?: ModuleExpressionFunctionsMap | ((context: ModuleExpressionFunctionsContext) => ModuleExpressionFunctions | undefined);
|
|
93
96
|
/**
|
|
94
97
|
* Columns that can be included in AdaptableQL Expressions; leave unset to include **ALL**, provide empty array to set **NONE**
|
|
95
98
|
*
|
|
@@ -116,15 +119,40 @@ export interface ExpressionOptions {
|
|
|
116
119
|
*/
|
|
117
120
|
customQueryVariables?: Record<string, string | number | boolean | Date | ((context: CustomQueryVariableContext) => string | number | boolean | Date)>;
|
|
118
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* ExpressionFunctions which may be either referenced by name (for internal Adaptable functions) or provided with custom implementation
|
|
124
|
+
*/
|
|
125
|
+
export declare type ExpressionFunctionDefinitions<T> = (T | Record<string, ExpressionFunction>)[];
|
|
119
126
|
/**
|
|
120
127
|
* Module specific Expression Functions
|
|
121
128
|
*/
|
|
129
|
+
export declare type ModuleExpressionFunctionsMap = Partial<Record<AdaptableModule, ModuleExpressionFunctions>>;
|
|
130
|
+
/**
|
|
131
|
+
* Type specific Expression Functions
|
|
132
|
+
*/
|
|
122
133
|
export interface ModuleExpressionFunctions {
|
|
123
|
-
booleanFunctions?:
|
|
124
|
-
scalarFunctions?:
|
|
125
|
-
observableFunctions?:
|
|
126
|
-
aggregatedBooleanFunctions?:
|
|
127
|
-
aggregatedScalarFunctions?:
|
|
134
|
+
booleanFunctions?: ExpressionFunctionDefinitions<BooleanFunctionName>;
|
|
135
|
+
scalarFunctions?: ExpressionFunctionDefinitions<ScalarFunctionName>;
|
|
136
|
+
observableFunctions?: ExpressionFunctionDefinitions<ObservableFunctionName>;
|
|
137
|
+
aggregatedBooleanFunctions?: ExpressionFunctionDefinitions<AggregatedBooleanFunctionName>;
|
|
138
|
+
aggregatedScalarFunctions?: ExpressionFunctionDefinitions<AggregatedScalarFunctionName>;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Context provided to ExpressionOptions.defaultExpressionFunctions property callback
|
|
142
|
+
*/
|
|
143
|
+
export interface DefaultExpressionFunctionsContext<T> extends BaseContext {
|
|
144
|
+
availableExpressionFunctionNames: T[];
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Context provided to ExpressionOptions.moduleExpressionFunctions property callback
|
|
148
|
+
*/
|
|
149
|
+
export interface ModuleExpressionFunctionsContext extends BaseContext {
|
|
150
|
+
module: AdaptableModule;
|
|
151
|
+
defaultBooleanFunctionNames: BooleanFunctionName[];
|
|
152
|
+
defaultScalarFunctionNames: ScalarFunctionName[];
|
|
153
|
+
defaultObservableFunctionNames: ObservableFunctionName[];
|
|
154
|
+
defaultAggregatedBooleanFunctionNames: AggregatedBooleanFunctionName[];
|
|
155
|
+
defaultAggregatedScalarFunctionNames: AggregatedScalarFunctionName[];
|
|
128
156
|
}
|
|
129
157
|
/**
|
|
130
158
|
* Context passed when evaluating `ExpressionOptions.customQueryVariables`
|
|
@@ -7,100 +7,120 @@ import { AdaptablePredicateDef } from '../PredefinedConfig/Common/AdaptablePredi
|
|
|
7
7
|
export interface ConditionalStyleApi {
|
|
8
8
|
/**
|
|
9
9
|
* Retrieves Conditional Style section from Adaptable State
|
|
10
|
+
* @deprecated use `FormatColumn` instead
|
|
10
11
|
*/
|
|
11
12
|
getConditionalStyleState(): ConditionalStyleState;
|
|
12
13
|
/**
|
|
13
14
|
* Gets all Conditional Styles in Adaptable State
|
|
15
|
+
* @deprecated use `FormatColumn` instead
|
|
14
16
|
*/
|
|
15
17
|
getAllConditionalStyle(config?: {
|
|
16
18
|
includeLayoutNotAssociatedObjects?: boolean;
|
|
17
19
|
}): ConditionalStyle[];
|
|
18
20
|
/**
|
|
19
21
|
* Get conditional style by id
|
|
22
|
+
*
|
|
23
|
+
* @deprecated use `FormatColumn` instead
|
|
20
24
|
* @param id conditional style id
|
|
21
25
|
* @returns conditional style
|
|
22
26
|
*/
|
|
23
27
|
getConditionalStyleById(id: ConditionalStyle['Uuid']): ConditionalStyle;
|
|
24
28
|
/**
|
|
25
29
|
* Gets all Conditional Styles that are active (not-suspended) in Adaptable State
|
|
30
|
+
* @deprecated use `FormatColumn` instead
|
|
26
31
|
* @returns conditional styles
|
|
27
32
|
*/
|
|
28
33
|
getAllActiveConditionalStyle(): ConditionalStyle[];
|
|
29
34
|
/**
|
|
30
35
|
* Gets all Conditional Styles that are suspended in Adaptable State
|
|
36
|
+
* @deprecated use `FormatColumn` instead
|
|
31
37
|
* @returns conditional styles
|
|
32
38
|
*/
|
|
33
39
|
getAllSuspendedConditionalStyle(): ConditionalStyle[];
|
|
34
40
|
/**
|
|
35
41
|
* Opens Settings Panel with Conditional Style section selected and visible
|
|
42
|
+
* @deprecated use `FormatColumn` instead
|
|
36
43
|
*/
|
|
37
44
|
showConditionalStylePopup(): void;
|
|
38
45
|
/**
|
|
39
46
|
* Retrieves all Conditional Styles that style whole row
|
|
47
|
+
* @deprecated use `FormatColumn` instead
|
|
40
48
|
* @returns conditional styles
|
|
41
49
|
*/
|
|
42
50
|
getRowConditionalStyles(): ConditionalStyle[] | undefined;
|
|
43
51
|
/**
|
|
44
52
|
* Retrieves all Conditional Styles which have an Expression
|
|
53
|
+
* @deprecated use `FormatColumn` instead
|
|
45
54
|
* @returns conditional styles
|
|
46
55
|
*/
|
|
47
56
|
getConditionalStylesWithExpression(): ConditionalStyle[] | undefined;
|
|
48
57
|
/**
|
|
49
58
|
* Gets all Conditional Styles that style a given Column
|
|
59
|
+
* @deprecated use `FormatColumn` instead
|
|
50
60
|
* @param column Column to check
|
|
51
61
|
* @returns conditional styles
|
|
52
62
|
*/
|
|
53
63
|
getConditionalStylesForColumn(column: AdaptableColumn): ConditionalStyle[] | undefined;
|
|
54
64
|
/**
|
|
55
65
|
* Returns all Predicates usable in Conditional Styles
|
|
66
|
+
* @deprecated use `FormatColumn` instead
|
|
56
67
|
*/
|
|
57
68
|
getConditionalStylePredicateDefs(): AdaptablePredicateDef[];
|
|
58
69
|
/**
|
|
59
70
|
* Returns all Predicates appropriate for the given Scope
|
|
71
|
+
* @deprecated use `FormatColumn` instead
|
|
60
72
|
* @param scope Scope to check
|
|
61
73
|
*/
|
|
62
74
|
getCondStylePredicateDefsForScope(scope: AdaptableScope): AdaptablePredicateDef[];
|
|
63
75
|
/**
|
|
64
76
|
* Retrieves all Conditional Styles ordered by Column then Row
|
|
77
|
+
* @deprecated use `FormatColumn` instead
|
|
65
78
|
* @returns conditional style
|
|
66
79
|
*/
|
|
67
80
|
getOrderedConditionalStyles(): ConditionalStyle[] | undefined;
|
|
68
81
|
/**
|
|
69
82
|
* Replaces Conditional Style in State with given one
|
|
83
|
+
* @deprecated use `FormatColumn` instead
|
|
70
84
|
* @param conditionalStyle Conditional Style to edit
|
|
71
85
|
* @returns conditional style
|
|
72
86
|
*/
|
|
73
87
|
editConditionalStyle(conditionalStyle: ConditionalStyle): ConditionalStyle;
|
|
74
88
|
/**
|
|
75
89
|
* Replaces Conditional Styles in State with given ones
|
|
90
|
+
* @deprecated use `FormatColumn` instead
|
|
76
91
|
* @param conditionalStyles Conditional Styles to edit
|
|
77
92
|
* @returns conditional styles
|
|
78
93
|
*/
|
|
79
94
|
editConditionalStyles(conditionalStyles: ConditionalStyle[]): ConditionalStyle[];
|
|
80
95
|
/**
|
|
81
96
|
* Deletes a Conditional Style
|
|
97
|
+
* @deprecated use `FormatColumn` instead
|
|
82
98
|
* @param conditionalStyle Conditional Style to delete
|
|
83
99
|
*/
|
|
84
100
|
deleteConditionalStyle(conditionalStyle: ConditionalStyle): void;
|
|
85
101
|
/**
|
|
86
102
|
* Deletes Conditional Styles
|
|
103
|
+
* @deprecated use `FormatColumn` instead
|
|
87
104
|
* @param conditionalStyles Conditional Styles to delete
|
|
88
105
|
*/
|
|
89
106
|
deleteConditionalStyles(conditionalStyles: ConditionalStyle[]): void;
|
|
90
107
|
/**
|
|
91
108
|
* Adds new Conditional Style to State
|
|
109
|
+
* @deprecated use `FormatColumn` instead
|
|
92
110
|
* @param conditionalStyle Conditional Style to add
|
|
93
111
|
* @returns conditional style
|
|
94
112
|
*/
|
|
95
113
|
addConditionalStyle(conditionalStyle: ConditionalStyle): ConditionalStyle;
|
|
96
114
|
/**
|
|
97
115
|
* Suspends conditional style, a readonly object cannot be suspended
|
|
116
|
+
* @deprecated use `FormatColumn` instead
|
|
98
117
|
* @param conditionalStyle Conditional Style to suspend
|
|
99
118
|
* @returns conditional style
|
|
100
119
|
*/
|
|
101
120
|
suspendConditionalStyle(conditionalStyle: ConditionalStyle): ConditionalStyle;
|
|
102
121
|
/**
|
|
103
122
|
* Un-suspends or activates a suspended conditional style
|
|
123
|
+
* @deprecated use `FormatColumn` instead
|
|
104
124
|
* @param conditionalStyle Conditional Style to suspend
|
|
105
125
|
* @returns conditional style
|
|
106
126
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormatColumnState, FormatColumn, ColumnStyle, ColumnComparison, CellColorRange } from '../PredefinedConfig/FormatColumnState';
|
|
2
|
-
import { AdaptableColumn, AdaptableFormat } from '../types';
|
|
2
|
+
import { AdaptableColumn, AdaptableFormat, AdaptablePredicateDef, AdaptableScope } from '../types';
|
|
3
3
|
import { RowNode } from '@ag-grid-community/core';
|
|
4
4
|
/**
|
|
5
5
|
* Provides run-time access to the Format Column Module and associated state
|
|
@@ -134,12 +134,22 @@ export interface FormatColumnApi {
|
|
|
134
134
|
* @returns format column
|
|
135
135
|
*/
|
|
136
136
|
getFormatColumnWithStyleForColumn(column: AdaptableColumn): FormatColumn | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* Retrieves all format columns with style for a column
|
|
139
|
+
* @param column The Column for which to retrieve the Format Column
|
|
140
|
+
*/
|
|
141
|
+
getColumnFormatColumnsWithStyle(column: AdaptableColumn): FormatColumn[];
|
|
142
|
+
/**
|
|
143
|
+
* Retrieves all Format Columns with style for the whole row
|
|
144
|
+
* @returns format columns
|
|
145
|
+
*/
|
|
146
|
+
getRowFormatColumnsWithStyle(): FormatColumn[];
|
|
137
147
|
/**
|
|
138
148
|
* Gets Format Column if any for given Column which includes Style element with ClassName
|
|
139
149
|
* @param column The Column for which to retrieve the Format Column
|
|
140
|
-
* @returns format
|
|
150
|
+
* @returns format columns
|
|
141
151
|
*/
|
|
142
|
-
getFormatColumnWithStyleClassNameForColumn(column: AdaptableColumn): FormatColumn
|
|
152
|
+
getFormatColumnWithStyleClassNameForColumn(column: AdaptableColumn): FormatColumn[];
|
|
143
153
|
/**
|
|
144
154
|
* Will get the most appropriate one i.e. first named Column, then DataType, then All
|
|
145
155
|
* @param column
|
|
@@ -206,4 +216,33 @@ export interface FormatColumnApi {
|
|
|
206
216
|
* @param formatColumn Format Column
|
|
207
217
|
*/
|
|
208
218
|
hasCustomDisplayFormatter(formatColumn: FormatColumn): boolean;
|
|
219
|
+
/**
|
|
220
|
+
* Returns all Predicates usable in Format Columns
|
|
221
|
+
*/
|
|
222
|
+
getFormatColumnPredicateDefs(): AdaptablePredicateDef[];
|
|
223
|
+
/**
|
|
224
|
+
* Returns all Predicates appropriate for the given Scope
|
|
225
|
+
* @param scope Scope to check
|
|
226
|
+
*/
|
|
227
|
+
getFormatColumnDefsForScope(scope: AdaptableScope): AdaptablePredicateDef[];
|
|
228
|
+
/**
|
|
229
|
+
* Checks if format column is active for a given row
|
|
230
|
+
*
|
|
231
|
+
* @param formatColumn
|
|
232
|
+
* @param params
|
|
233
|
+
*/
|
|
234
|
+
isFormatColumnActiveForRow(formatColumn: FormatColumn, params: {
|
|
235
|
+
node: RowNode;
|
|
236
|
+
}): boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Checks if format column is active for a given cell
|
|
239
|
+
*
|
|
240
|
+
* @param formatColumn
|
|
241
|
+
* @param column
|
|
242
|
+
* @param params
|
|
243
|
+
*/
|
|
244
|
+
isFormatColumnActiveForColumn(formatColumn: FormatColumn, column: AdaptableColumn, params: {
|
|
245
|
+
node: RowNode;
|
|
246
|
+
value: any;
|
|
247
|
+
}): boolean;
|
|
209
248
|
}
|
|
@@ -5,6 +5,7 @@ import { FormatColumnState, FormatColumn, ColumnStyle, CellColorRange, ColumnCom
|
|
|
5
5
|
import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
|
|
6
6
|
import { RowNode } from '@ag-grid-community/core';
|
|
7
7
|
import { AdaptableFormat } from '../../types';
|
|
8
|
+
import { AdaptablePredicateDef, AdaptableScope } from '../../../types';
|
|
8
9
|
export declare class FormatColumnApiImpl extends ApiBase implements FormatColumnApi {
|
|
9
10
|
getFormatColumnState(): FormatColumnState;
|
|
10
11
|
getAllFormatColumn(config?: LayoutAssociatedObjectLoadConfig): FormatColumn[];
|
|
@@ -27,12 +28,15 @@ export declare class FormatColumnApiImpl extends ApiBase implements FormatColumn
|
|
|
27
28
|
unSuspendFormatColumn(formatColumn: FormatColumn): FormatColumn;
|
|
28
29
|
applyFormatColumnDisplayFormats(): void;
|
|
29
30
|
getActiveFormatColumnForColumn(column: AdaptableColumn): FormatColumn | undefined;
|
|
31
|
+
getColumnFormatColumnsWithStyle(column: AdaptableColumn): FormatColumn[];
|
|
32
|
+
getRowFormatColumnsWithStyle(): FormatColumn[];
|
|
30
33
|
getFormatColumnForColumn(column: AdaptableColumn): FormatColumn | undefined;
|
|
31
34
|
getFormatColumnForColumnId(columnId: string): FormatColumn | undefined;
|
|
32
35
|
getFormatColumnWithStyleForColumn(column: AdaptableColumn): FormatColumn | undefined;
|
|
33
|
-
getFormatColumnWithStyleClassNameForColumn(column: AdaptableColumn): FormatColumn
|
|
36
|
+
getFormatColumnWithStyleClassNameForColumn(column: AdaptableColumn): FormatColumn[];
|
|
34
37
|
getFormatColumnWithDisplayFormatForColumn(column: AdaptableColumn): FormatColumn | undefined;
|
|
35
38
|
getFormatColumnWithSingleColumnScope(columnId: string): FormatColumn | undefined;
|
|
39
|
+
private getFormatColumnInColumnScope;
|
|
36
40
|
private getAppropriateFormatColumn;
|
|
37
41
|
hasStyleFormatColumns(): boolean;
|
|
38
42
|
showFormatColumnPopup(): void;
|
|
@@ -51,4 +55,16 @@ export declare class FormatColumnApiImpl extends ApiBase implements FormatColumn
|
|
|
51
55
|
getStringFormattedValue(value: any, node: RowNode, abColumn: AdaptableColumn, options: AdaptableFormat['Options']): string;
|
|
52
56
|
getDateFormattedValue(value: any, node: RowNode, abColumn: AdaptableColumn, options: AdaptableFormat['Options']): string;
|
|
53
57
|
hasCustomDisplayFormatter(formatColumn: FormatColumn): boolean;
|
|
58
|
+
getFormatColumnPredicateDefs(): AdaptablePredicateDef[];
|
|
59
|
+
getFormatColumnDefsForScope(scope: AdaptableScope): AdaptablePredicateDef[];
|
|
60
|
+
isFormatColumnActiveForRow(formatColumn: FormatColumn, params: {
|
|
61
|
+
node: RowNode;
|
|
62
|
+
}): boolean;
|
|
63
|
+
isFormatColumnActiveForColumn(formatColumn: FormatColumn, column: AdaptableColumn, params: {
|
|
64
|
+
node: RowNode;
|
|
65
|
+
value: any;
|
|
66
|
+
}): boolean;
|
|
67
|
+
private evaluatePredicate;
|
|
68
|
+
private shouldRunStyle;
|
|
69
|
+
private evaluateExpression;
|
|
54
70
|
}
|
|
@@ -110,6 +110,18 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
110
110
|
const formatColumns = this.getAllActiveFormatColumn();
|
|
111
111
|
return this.getAppropriateFormatColumn(formatColumns, column);
|
|
112
112
|
}
|
|
113
|
+
getColumnFormatColumnsWithStyle(column) {
|
|
114
|
+
const formatColumns = this.getAllFormatColumnWithStyle();
|
|
115
|
+
return this.getFormatColumnInColumnScope(formatColumns, column).filter((scopedFormatColumn) => {
|
|
116
|
+
return (!this.adaptable.api.scopeApi.scopeIsAll(scopedFormatColumn.Scope) &&
|
|
117
|
+
this.adaptable.api.scopeApi.isColumnInScope(column, scopedFormatColumn.Scope));
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
getRowFormatColumnsWithStyle() {
|
|
121
|
+
return this.getAllFormatColumnWithStyle().filter((formatColumn) => {
|
|
122
|
+
return this.adaptable.api.scopeApi.scopeIsAll(formatColumn.Scope);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
113
125
|
getFormatColumnForColumn(column) {
|
|
114
126
|
const formatColumns = this.getAllFormatColumn();
|
|
115
127
|
return this.getAppropriateFormatColumn(formatColumns, column);
|
|
@@ -126,8 +138,7 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
126
138
|
return this.getAppropriateFormatColumn(formatColumns, column);
|
|
127
139
|
}
|
|
128
140
|
getFormatColumnWithStyleClassNameForColumn(column) {
|
|
129
|
-
|
|
130
|
-
return this.getAppropriateFormatColumn(formatColumns, column);
|
|
141
|
+
return this.getColumnFormatColumnsWithStyle(column).filter((fc) => StringExtensions_1.default.IsNotNullOrEmpty(fc.Style.ClassName));
|
|
131
142
|
}
|
|
132
143
|
getFormatColumnWithDisplayFormatForColumn(column) {
|
|
133
144
|
const formatColumns = this.getAllFormatColumnWithDisplayFormat().concat(this.getAllFormatColumnWithCellAlignment());
|
|
@@ -150,20 +161,14 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
150
161
|
});
|
|
151
162
|
return returnFormatColumn;
|
|
152
163
|
}
|
|
153
|
-
|
|
154
|
-
|
|
164
|
+
getFormatColumnInColumnScope(formatColumns, column) {
|
|
165
|
+
return this.getFormatColumnsWithColumnScope(formatColumns)
|
|
155
166
|
.concat(this.getFormatColumnsWithDataTypeScope(formatColumns))
|
|
156
167
|
.concat(this.getFormatColumnsWithAllScope(formatColumns));
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (this.adaptable.api.scopeApi.isColumnInScope(column, fc.Scope)) {
|
|
162
|
-
returnFormatColumn = fc;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
return returnFormatColumn;
|
|
168
|
+
}
|
|
169
|
+
getAppropriateFormatColumn(formatColumns, column) {
|
|
170
|
+
return this.getFormatColumnInColumnScope(formatColumns, column).find((scopedFormatColumn) => !this.adaptable.api.scopeApi.scopeIsAll(scopedFormatColumn.Scope) &&
|
|
171
|
+
this.adaptable.api.scopeApi.isColumnInScope(column, scopedFormatColumn.Scope));
|
|
167
172
|
}
|
|
168
173
|
hasStyleFormatColumns() {
|
|
169
174
|
return ArrayExtensions_1.default.IsNotNullOrEmpty(this.getAllFormatColumnWithStyle());
|
|
@@ -355,5 +360,80 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
355
360
|
}
|
|
356
361
|
return true;
|
|
357
362
|
}
|
|
363
|
+
getFormatColumnPredicateDefs() {
|
|
364
|
+
return this.adaptable.api.predicateApi.getPredicateDefsByModuleScope('formatColumn');
|
|
365
|
+
}
|
|
366
|
+
getFormatColumnDefsForScope(scope) {
|
|
367
|
+
return this.getFormatColumnPredicateDefs().filter((predicateDef) => this.adaptable.api.scopeApi.isScopeInScope(scope, predicateDef.columnScope));
|
|
368
|
+
}
|
|
369
|
+
isFormatColumnActiveForRow(formatColumn, params) {
|
|
370
|
+
// suspedned is important to be first
|
|
371
|
+
if (formatColumn.IsSuspended) {
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
if (!formatColumn.Rule) {
|
|
375
|
+
return true;
|
|
376
|
+
}
|
|
377
|
+
if (this.shouldRunStyle(formatColumn, params.node) &&
|
|
378
|
+
formatColumn.Rule.BooleanExpression &&
|
|
379
|
+
this.evaluateExpression(formatColumn, params.node)) {
|
|
380
|
+
return true;
|
|
381
|
+
}
|
|
382
|
+
// nothing has passed then return false
|
|
383
|
+
return false;
|
|
384
|
+
}
|
|
385
|
+
isFormatColumnActiveForColumn(formatColumn, column, params) {
|
|
386
|
+
// suspedned is important to be first
|
|
387
|
+
if (formatColumn.IsSuspended) {
|
|
388
|
+
return false;
|
|
389
|
+
}
|
|
390
|
+
if (!formatColumn.Rule) {
|
|
391
|
+
return true;
|
|
392
|
+
}
|
|
393
|
+
if (this.shouldRunStyle(formatColumn, params.node)) {
|
|
394
|
+
// first run the predicate
|
|
395
|
+
if (formatColumn.Rule.Predicate && formatColumn.Rule.Predicate.PredicateId) {
|
|
396
|
+
if (this.evaluatePredicate({
|
|
397
|
+
formatColumn,
|
|
398
|
+
column,
|
|
399
|
+
value: params.value,
|
|
400
|
+
node: params.node,
|
|
401
|
+
})) {
|
|
402
|
+
return true;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
else if (formatColumn.Rule.BooleanExpression) {
|
|
406
|
+
if (this.evaluateExpression(formatColumn, params.node)) {
|
|
407
|
+
return true;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
// nothing has passed then return false
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
evaluatePredicate({ formatColumn, column, value, node, }) {
|
|
415
|
+
const params = {
|
|
416
|
+
value: value,
|
|
417
|
+
oldValue: null,
|
|
418
|
+
displayValue: value,
|
|
419
|
+
node: node,
|
|
420
|
+
column: column,
|
|
421
|
+
};
|
|
422
|
+
const result = this.adaptable.api.predicateApi.handlePredicate(formatColumn.Rule.Predicate, params, false);
|
|
423
|
+
return result;
|
|
424
|
+
}
|
|
425
|
+
shouldRunStyle(formatColumn, node) {
|
|
426
|
+
if (!formatColumn.IncludeGroupedRows && this.adaptable.api.gridApi.isGroupRowNode(node)) {
|
|
427
|
+
return false;
|
|
428
|
+
}
|
|
429
|
+
return true;
|
|
430
|
+
}
|
|
431
|
+
evaluateExpression(formatColumn, node) {
|
|
432
|
+
const isValidExpression = this.adaptable.api.queryLanguageApi.isValidBooleanExpression(formatColumn.Rule.BooleanExpression, ModuleConstants.FormatColumnModuleId, `Invalid format column rule '${formatColumn.Rule.BooleanExpression}'`);
|
|
433
|
+
return (isValidExpression &&
|
|
434
|
+
this.adaptable.api.internalApi
|
|
435
|
+
.getQueryLanguageService()
|
|
436
|
+
.evaluateBooleanExpression(formatColumn.Rule.BooleanExpression, ModuleConstants.FormatColumnModuleId, node));
|
|
437
|
+
}
|
|
358
438
|
}
|
|
359
439
|
exports.FormatColumnApiImpl = FormatColumnApiImpl;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ApiBase } from './ApiBase';
|
|
2
2
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
3
3
|
import { QueryLanguageApi } from '../QueryLanguageApi';
|
|
4
|
-
import { ExpressionFunctionMap } from '../../types';
|
|
5
4
|
import { AdaptableQuery } from '../../PredefinedConfig/Common/AdaptableQuery';
|
|
6
5
|
export declare class QueryLanguageApiImpl extends ApiBase implements QueryLanguageApi {
|
|
7
6
|
isValidBooleanExpression(query: string, module: AdaptableModule, validationErrorMessage?: string): boolean;
|
|
@@ -11,7 +10,6 @@ export declare class QueryLanguageApiImpl extends ApiBase implements QueryLangua
|
|
|
11
10
|
getASTForExpression(query: string): any;
|
|
12
11
|
getColumnsFromExpression(expression: string): string[];
|
|
13
12
|
getQueryableColumnIds(): string[] | undefined;
|
|
14
|
-
getModuleExpressionFunctionMap(): ExpressionFunctionMap;
|
|
15
13
|
getAdaptableQueryExpression(query: Partial<AdaptableQuery>): string | undefined;
|
|
16
14
|
getAdaptableQueryExpressionWithColumnFriendlyNames(query: Partial<AdaptableQuery>): string | undefined;
|
|
17
15
|
}
|
|
@@ -83,9 +83,6 @@ class QueryLanguageApiImpl extends ApiBase_1.ApiBase {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
getModuleExpressionFunctionMap() {
|
|
87
|
-
return this.getExpressionOptions().moduleExpressionFunctions;
|
|
88
|
-
}
|
|
89
86
|
getAdaptableQueryExpression(query) {
|
|
90
87
|
var _a, _b, _c, _d;
|
|
91
88
|
return ((_d = (_c = (_b = (_a = query.BooleanExpression) !== null && _a !== void 0 ? _a : query.ScalarExpression) !== null && _b !== void 0 ? _b : query.ObservableExpression) !== null && _c !== void 0 ? _c : query.AggregatedBooleanExpression) !== null && _d !== void 0 ? _d : query.AggregatedScalarExpression);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AdaptableModule } from '../PredefinedConfig/Common/Types';
|
|
2
|
-
import { ExpressionFunctionMap } from '../types';
|
|
3
2
|
import { AdaptableQuery } from '../PredefinedConfig/Common/AdaptableQuery';
|
|
4
3
|
/**
|
|
5
4
|
* Functions related to AdapTableQL (the Adaptable Query Language)
|
|
@@ -42,10 +41,6 @@ export interface QueryLanguageApi {
|
|
|
42
41
|
* Returns all columns that can be used in an Expression
|
|
43
42
|
*/
|
|
44
43
|
getQueryableColumnIds(): string[];
|
|
45
|
-
/**
|
|
46
|
-
* Returns the current Module Expression Map
|
|
47
|
-
*/
|
|
48
|
-
getModuleExpressionFunctionMap(): ExpressionFunctionMap;
|
|
49
44
|
/**
|
|
50
45
|
* Runs the AST that AdapTableQL creates for an Expression - useful when evaluating remotely
|
|
51
46
|
* @param expression expression to be run
|
|
@@ -103,7 +103,7 @@ export interface PredicateDefHandlerParams {
|
|
|
103
103
|
export interface PredicateDefToStringParams {
|
|
104
104
|
inputs: any[];
|
|
105
105
|
}
|
|
106
|
-
export declare type ModuleScope = 'filter' | 'alert' | 'conditionalstyle' | 'flashingcell';
|
|
106
|
+
export declare type ModuleScope = 'filter' | 'alert' | 'conditionalstyle' | 'flashingcell' | 'formatColumn';
|
|
107
107
|
/**
|
|
108
108
|
* Array of Predicate Defs which are shipped by AdapTable
|
|
109
109
|
*/
|