@adaptabletools/adaptable 18.1.0-canary.1 → 18.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +6 -0
- package/src/AdaptableOptions/ExportOptions.d.ts +9 -0
- package/src/AdaptableOptions/ExpressionOptions.d.ts +2 -2
- package/src/Api/Internal/AlertInternalApi.js +2 -2
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -0
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +0 -1
- package/src/Utilities/Services/QueryLanguageService.js +31 -15
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +12 -3
- package/src/agGrid/AdaptableAgGrid.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +1 -19
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +1 -19
- package/src/agGrid/editors/AdaptablePercentageEditor/InternalAdaptablePercentageEditor.d.ts +2 -2
- package/src/agGrid/editors/AdaptablePercentageEditor/index.d.ts +2 -20
- package/src/agGrid/editors/AdaptablePercentageEditor/index.js +1 -19
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +1 -1
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +3 -3
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +18 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +50 -24
- package/src/types.d.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IRowNode } from '@ag-grid-community/core';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseContext } from '../../../types';
|
|
3
3
|
export type AST = AST_Expression[];
|
|
4
4
|
export type PredicateType = 'VALUE_REF' | 'INFIX' | 'UNARY' | 'FUNCTION' | 'CONDITIONAL';
|
|
5
5
|
/**
|
|
@@ -129,24 +129,23 @@ args: any[],
|
|
|
129
129
|
*/
|
|
130
130
|
context: ExpressionContext) => any;
|
|
131
131
|
export declare const isAST_Function: (node: AST_Expression) => node is AST_Function;
|
|
132
|
-
export interface
|
|
132
|
+
export interface AggregatedExpressionReducerContext extends BaseContext {
|
|
133
133
|
/**
|
|
134
134
|
* Current row node
|
|
135
135
|
*/
|
|
136
136
|
rowNode: IRowNode;
|
|
137
137
|
/**
|
|
138
|
-
*
|
|
139
|
-
*/
|
|
140
|
-
adaptableApi: AdaptableApi;
|
|
141
|
-
/**
|
|
142
|
-
* Arguments passed to the function
|
|
143
|
-
* Column arguments are transformed to their values, e.g. [colId] -> args = [value-of-colId]
|
|
138
|
+
* Arguments passed to the function. Column arguments are transformed to their values, e.g. [colId] -> args = [value-of-colId]. Aggregation column and group by column are not included as they are passed as separate arguments.
|
|
144
139
|
*/
|
|
145
140
|
args: any[];
|
|
146
141
|
/**
|
|
147
142
|
* Column Id of the column being aggregated
|
|
148
143
|
*/
|
|
149
144
|
aggColumnId: string;
|
|
145
|
+
/**
|
|
146
|
+
* Column Id(s) of the column(s) being grouped by
|
|
147
|
+
*/
|
|
148
|
+
groupByColumnIds?: string[];
|
|
150
149
|
/**
|
|
151
150
|
* Helper function to get the value of a column
|
|
152
151
|
* @param colId column id
|
|
@@ -154,26 +153,53 @@ export interface AggregatedScalarExpressionReducerContext extends BaseContext {
|
|
|
154
153
|
*/
|
|
155
154
|
getValueForColId: (colId: string) => any;
|
|
156
155
|
}
|
|
157
|
-
export interface
|
|
156
|
+
export interface AggregatedExpressionProcessReducerValueContext extends BaseContext {
|
|
158
157
|
/**
|
|
159
|
-
* Arguments passed to the function
|
|
158
|
+
* Arguments passed to the function. Aggregation column and group by column are not included as they are passed as separate arguments.
|
|
160
159
|
*/
|
|
161
160
|
args: any[];
|
|
161
|
+
/**
|
|
162
|
+
* Column Id of the column being aggregated
|
|
163
|
+
*/
|
|
164
|
+
aggColumnId: string;
|
|
165
|
+
/**
|
|
166
|
+
* Column Id(s) of the column(s) being grouped by
|
|
167
|
+
*/
|
|
168
|
+
groupByColumnIds?: string[];
|
|
162
169
|
}
|
|
163
|
-
export interface
|
|
170
|
+
export interface AggregatedExpressionPrepareRowValueContext extends BaseContext {
|
|
164
171
|
/**
|
|
165
|
-
* Arguments passed to the function
|
|
172
|
+
* Arguments passed to the function. Column arguments are transformed to their values, e.g. [colId] -> args = [value-of-colId]. Aggregation column and group by column are not included as they are passed as separate arguments.
|
|
166
173
|
*/
|
|
167
174
|
args: any[];
|
|
175
|
+
/**
|
|
176
|
+
* Column Id of the column being aggregated
|
|
177
|
+
*/
|
|
168
178
|
aggColumnId: string;
|
|
179
|
+
/**
|
|
180
|
+
* Column Id(s) of the column(s) being grouped by
|
|
181
|
+
*/
|
|
182
|
+
groupByColumnIds?: string[];
|
|
183
|
+
/**
|
|
184
|
+
* Helper function to get the value of a column
|
|
185
|
+
* @param colId column id
|
|
186
|
+
*/
|
|
169
187
|
getValueForColId: (colId: string) => any;
|
|
170
188
|
}
|
|
171
|
-
export interface
|
|
189
|
+
export interface AggregatedExpressionRowFilterContext extends BaseContext {
|
|
190
|
+
/**
|
|
191
|
+
* Arguments passed to the function. Column arguments are transformed to their values, e.g. [colId] -> args = [value-of-colId]. Aggregation column and group by column are not included as they are passed as separate arguments.
|
|
192
|
+
*/
|
|
193
|
+
args: any[];
|
|
172
194
|
/**
|
|
173
195
|
* Column Id of the column being aggregated
|
|
174
196
|
* Usualy the first Col argument, e.g. [colId]
|
|
175
197
|
*/
|
|
176
198
|
aggColumnId: string;
|
|
199
|
+
/**
|
|
200
|
+
* Column Id(s) of the column(s) being grouped by
|
|
201
|
+
*/
|
|
202
|
+
groupByColumnIds?: string[];
|
|
177
203
|
/**
|
|
178
204
|
* Utility function to get the value of a column
|
|
179
205
|
* @param colId column id
|
|
@@ -181,7 +207,7 @@ export interface AggregatedScalarExpressionRowFilterContext extends BaseContext
|
|
|
181
207
|
*/
|
|
182
208
|
getValueForColId: (colId: string) => any;
|
|
183
209
|
}
|
|
184
|
-
export interface
|
|
210
|
+
export interface AggregatedExpressionFunction {
|
|
185
211
|
/**
|
|
186
212
|
* Expression description.
|
|
187
213
|
*/
|
|
@@ -199,33 +225,33 @@ export interface AggregatedScalarExpressionFunction {
|
|
|
199
225
|
*/
|
|
200
226
|
initialValue: any;
|
|
201
227
|
/**
|
|
202
|
-
* Reducer function which is called for each value in the Column Data.
|
|
228
|
+
* Reducer function which is called for each value(row) in the Column Data.
|
|
203
229
|
* @param accumulator - the value returned by the previous call to the reducer function, or the initialValue if this is the first call. You return the new accumulator value from this function.
|
|
204
230
|
* @param currentValue - the current value being processed in the Column Data
|
|
205
231
|
* @param index - index of the current value in the Column Data
|
|
206
232
|
* @param context - context object with the current row node, adaptableApi, aggColumnId and other possible custom arguments
|
|
207
233
|
*/
|
|
208
|
-
reducer: (accumulator: any, currentValue: any, index: number, context:
|
|
234
|
+
reducer: (accumulator: any, currentValue: any, index: number, context: AggregatedExpressionReducerContext) => any;
|
|
209
235
|
/**
|
|
210
|
-
* If specified, this function is called after the reducer has processed all values.
|
|
211
|
-
* Can be used to change the result of the reducer based on the values array (e.g. average).
|
|
236
|
+
* If specified, this function is called after the reducer has processed all values (rows).
|
|
237
|
+
* Can be used to change the result of the reducer based on the values array (e.g. average = aggregated value / count).
|
|
212
238
|
* @param aggregatedValue - result of the reducer
|
|
213
|
-
* @param
|
|
239
|
+
* @param rowNodes - array of row nodes. If aggregation was grouped, this will be the array of row nodes for the group.
|
|
214
240
|
* @param context - context object with the args
|
|
215
241
|
*/
|
|
216
|
-
|
|
242
|
+
processAggregatedValue?: (aggregatedValue: any, rowNodes: IRowNode[], context: AggregatedExpressionProcessReducerValueContext) => any;
|
|
217
243
|
/**
|
|
218
|
-
* If specified, this function is be called for each row.
|
|
219
|
-
* This can be used when each row has a different value (e.g. percentage).
|
|
244
|
+
* If specified, this function is be called for each row AFTER the reducer() and processReducedValue() functions.
|
|
245
|
+
* This can be used when each row has a different aggregated value (e.g. percentage = row value / aggregated value).
|
|
220
246
|
* @param rowNode - current row node
|
|
221
247
|
* @param context - context object with the args, aggColumnId, getValueForColId
|
|
222
248
|
* @returns return value for each individual row
|
|
223
249
|
*/
|
|
224
|
-
prepareRowValue?: (rowNode: IRowNode, aggregatedValue: any, context:
|
|
250
|
+
prepareRowValue?: (rowNode: IRowNode, aggregatedValue: any, context: AggregatedExpressionPrepareRowValueContext) => number | string | Date;
|
|
225
251
|
/**
|
|
226
252
|
* If specified, this function filters the rows that are included in the aggregation.
|
|
227
253
|
* @param rowNode - current row node
|
|
228
254
|
* @param context - context object with the aggColumnId, getValueForColId
|
|
229
255
|
*/
|
|
230
|
-
rowFilter?: (rowNode: IRowNode, context:
|
|
256
|
+
rowFilter?: (rowNode: IRowNode, context: AggregatedExpressionRowFilterContext) => boolean;
|
|
231
257
|
}
|
package/src/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ExpressionFunction, ExpressionFunctionDocBlock, ExpressionFunctionHandler, ExpressionContext, ExpressionFunctionMap, ExpressionCategory, ExpressionFunctionInputType,
|
|
1
|
+
export type { ExpressionFunction, ExpressionFunctionDocBlock, ExpressionFunctionHandler, ExpressionContext, ExpressionFunctionMap, ExpressionCategory, ExpressionFunctionInputType, AggregatedExpressionFunction, AggregatedExpressionReducerContext, AST, AST_Function, AST_Expression, Token, } from './../src/parser/src/types';
|
|
2
2
|
export type { AgGridConfig } from './AdaptableInterfaces/IAdaptable';
|
|
3
3
|
export type { AdaptableConfig } from './View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableConfig';
|
|
4
4
|
export type { AdaptableNoCodeWizardOptions, IAdaptableNoCodeWizard, } from './AdaptableInterfaces/AdaptableNoCodeWizard';
|