@adaptabletools/adaptable 18.1.1 → 18.1.2
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/ExpressionOptions.d.ts +1 -1
- package/src/Utilities/Services/QueryLanguageService.js +10 -8
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +72 -53
- package/src/types.d.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
|
@@ -129,7 +129,56 @@ 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 AggregatedExpressionFunction {
|
|
133
|
+
/**
|
|
134
|
+
* Expression description
|
|
135
|
+
*/
|
|
136
|
+
description?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Example Signatures for the function
|
|
139
|
+
*/
|
|
140
|
+
signatures?: string[];
|
|
141
|
+
/**
|
|
142
|
+
* Examples how the function can be used
|
|
143
|
+
*/
|
|
144
|
+
examples?: string[];
|
|
145
|
+
/**
|
|
146
|
+
* Mandaatory Initial Value for the aggregation
|
|
147
|
+
*/
|
|
148
|
+
initialValue: any;
|
|
149
|
+
/**
|
|
150
|
+
* Mandatory Reducer function which is called for each value(row) in the Column Data
|
|
151
|
+
*/
|
|
152
|
+
reducer: (context: AggregatedExpressionReducerContext) => any;
|
|
153
|
+
/**
|
|
154
|
+
* Called AFTER the reducer() has processed all values / rows
|
|
155
|
+
* Can be used to change result of reducer based on the values array (e.g. average = aggregated value / count)
|
|
156
|
+
*/
|
|
157
|
+
processAggregatedValue?: (context: AggregatedExpressionProcessAggregatedValueContext) => any;
|
|
158
|
+
/**
|
|
159
|
+
* Called for each row AFTER the reducer() and processAggregatedValue() functions
|
|
160
|
+
* Can be used when each row has a different aggregated value (e.g. percentage = row value / aggregated value).
|
|
161
|
+
* Returns return value for each individual row
|
|
162
|
+
*/
|
|
163
|
+
prepareRowValue?: (context: AggregatedExpressionPrepareRowValueContext) => number | string | Date | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* Optional filter which is applied to each row before the reducer is called. If the filter returns false, the row is NOT included in the aggregation.
|
|
166
|
+
*/
|
|
167
|
+
filterRow?: (context: AggregatedExpressionFilteRowContext) => boolean;
|
|
168
|
+
}
|
|
132
169
|
export interface AggregatedExpressionReducerContext extends BaseContext {
|
|
170
|
+
/**
|
|
171
|
+
* 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.
|
|
172
|
+
*/
|
|
173
|
+
accumulator: any;
|
|
174
|
+
/**
|
|
175
|
+
* Current value being processed in the Column Data
|
|
176
|
+
*/
|
|
177
|
+
currentValue: any;
|
|
178
|
+
/**
|
|
179
|
+
* Index of the current value in the Column Data
|
|
180
|
+
*/
|
|
181
|
+
index: number;
|
|
133
182
|
/**
|
|
134
183
|
* Current row node
|
|
135
184
|
*/
|
|
@@ -149,11 +198,18 @@ export interface AggregatedExpressionReducerContext extends BaseContext {
|
|
|
149
198
|
/**
|
|
150
199
|
* Helper function to get the value of a column
|
|
151
200
|
* @param colId column id
|
|
152
|
-
* @returns
|
|
153
201
|
*/
|
|
154
202
|
getValueForColId: (colId: string) => any;
|
|
155
203
|
}
|
|
156
|
-
export interface
|
|
204
|
+
export interface AggregatedExpressionProcessAggregatedValueContext extends BaseContext {
|
|
205
|
+
/**
|
|
206
|
+
* Result of the reducer
|
|
207
|
+
*/
|
|
208
|
+
aggregatedValue: any;
|
|
209
|
+
/**
|
|
210
|
+
* Array of row nodes; if aggregation is grouped, this will be the array of row nodes for the group
|
|
211
|
+
*/
|
|
212
|
+
rowNodes: IRowNode[];
|
|
157
213
|
/**
|
|
158
214
|
* Arguments passed to the function. Aggregation column and group by column are not included as they are passed as separate arguments.
|
|
159
215
|
*/
|
|
@@ -168,6 +224,14 @@ export interface AggregatedExpressionProcessReducerValueContext extends BaseCont
|
|
|
168
224
|
groupByColumnIds?: string[];
|
|
169
225
|
}
|
|
170
226
|
export interface AggregatedExpressionPrepareRowValueContext extends BaseContext {
|
|
227
|
+
/**
|
|
228
|
+
* Current Row Node
|
|
229
|
+
*/
|
|
230
|
+
rowNode: IRowNode;
|
|
231
|
+
/**
|
|
232
|
+
* Result of the reducer
|
|
233
|
+
*/
|
|
234
|
+
aggregatedValue: any;
|
|
171
235
|
/**
|
|
172
236
|
* 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.
|
|
173
237
|
*/
|
|
@@ -186,14 +250,18 @@ export interface AggregatedExpressionPrepareRowValueContext extends BaseContext
|
|
|
186
250
|
*/
|
|
187
251
|
getValueForColId: (colId: string) => any;
|
|
188
252
|
}
|
|
189
|
-
export interface
|
|
253
|
+
export interface AggregatedExpressionFilteRowContext extends BaseContext {
|
|
254
|
+
/**
|
|
255
|
+
* Current row node
|
|
256
|
+
*/
|
|
257
|
+
rowNode: IRowNode;
|
|
190
258
|
/**
|
|
191
259
|
* 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
260
|
*/
|
|
193
261
|
args: any[];
|
|
194
262
|
/**
|
|
195
263
|
* Column Id of the column being aggregated
|
|
196
|
-
*
|
|
264
|
+
* Usually the first Col argument, e.g. [colId]
|
|
197
265
|
*/
|
|
198
266
|
aggColumnId: string;
|
|
199
267
|
/**
|
|
@@ -203,55 +271,6 @@ export interface AggregatedExpressionRowFilterContext extends BaseContext {
|
|
|
203
271
|
/**
|
|
204
272
|
* Utility function to get the value of a column
|
|
205
273
|
* @param colId column id
|
|
206
|
-
* @returns
|
|
207
274
|
*/
|
|
208
275
|
getValueForColId: (colId: string) => any;
|
|
209
276
|
}
|
|
210
|
-
export interface AggregatedExpressionFunction {
|
|
211
|
-
/**
|
|
212
|
-
* Expression description.
|
|
213
|
-
*/
|
|
214
|
-
description?: string;
|
|
215
|
-
/**
|
|
216
|
-
* Examples how this function ca be used.
|
|
217
|
-
*/
|
|
218
|
-
signatures?: string[];
|
|
219
|
-
/**
|
|
220
|
-
* How the function can be used.
|
|
221
|
-
*/
|
|
222
|
-
examples?: string[];
|
|
223
|
-
/**
|
|
224
|
-
* Initial Value for the aggregation
|
|
225
|
-
*/
|
|
226
|
-
initialValue: any;
|
|
227
|
-
/**
|
|
228
|
-
* Reducer function which is called for each value(row) in the Column Data.
|
|
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.
|
|
230
|
-
* @param currentValue - the current value being processed in the Column Data
|
|
231
|
-
* @param index - index of the current value in the Column Data
|
|
232
|
-
* @param context - context object with the current row node, adaptableApi, aggColumnId and other possible custom arguments
|
|
233
|
-
*/
|
|
234
|
-
reducer: (accumulator: any, currentValue: any, index: number, context: AggregatedExpressionReducerContext) => any;
|
|
235
|
-
/**
|
|
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).
|
|
238
|
-
* @param aggregatedValue - result of the reducer
|
|
239
|
-
* @param rowNodes - array of row nodes. If aggregation was grouped, this will be the array of row nodes for the group.
|
|
240
|
-
* @param context - context object with the args
|
|
241
|
-
*/
|
|
242
|
-
processAggregatedValue?: (aggregatedValue: any, rowNodes: IRowNode[], context: AggregatedExpressionProcessReducerValueContext) => any;
|
|
243
|
-
/**
|
|
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).
|
|
246
|
-
* @param rowNode - current row node
|
|
247
|
-
* @param context - context object with the args, aggColumnId, getValueForColId
|
|
248
|
-
* @returns return value for each individual row
|
|
249
|
-
*/
|
|
250
|
-
prepareRowValue?: (rowNode: IRowNode, aggregatedValue: any, context: AggregatedExpressionPrepareRowValueContext) => number | string | Date;
|
|
251
|
-
/**
|
|
252
|
-
* If specified, this function filters the rows that are included in the aggregation.
|
|
253
|
-
* @param rowNode - current row node
|
|
254
|
-
* @param context - context object with the aggColumnId, getValueForColId
|
|
255
|
-
*/
|
|
256
|
-
rowFilter?: (rowNode: IRowNode, context: AggregatedExpressionRowFilterContext) => boolean;
|
|
257
|
-
}
|
package/src/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ExpressionFunction, ExpressionFunctionDocBlock, ExpressionFunctionHandler, ExpressionContext, ExpressionFunctionMap, ExpressionCategory, ExpressionFunctionInputType, AggregatedExpressionFunction, AggregatedExpressionReducerContext, AST, AST_Function, AST_Expression, Token, } from './../src/parser/src/types';
|
|
1
|
+
export type { ExpressionFunction, ExpressionFunctionDocBlock, ExpressionFunctionHandler, ExpressionContext, ExpressionFunctionMap, ExpressionCategory, ExpressionFunctionInputType, AggregatedExpressionFunction, AggregatedExpressionReducerContext, AggregatedExpressionProcessAggregatedValueContext, AggregatedExpressionPrepareRowValueContext, AggregatedExpressionFilteRowContext, 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';
|