@adaptabletools/adaptable 18.1.0 → 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/ColumnFilterOptions.d.ts +6 -0
- package/src/AdaptableOptions/ExportOptions.d.ts +9 -0
- package/src/AdaptableOptions/ExpressionOptions.d.ts +3 -3
- 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 +35 -17
- 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 +100 -55
- 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,103 +129,148 @@ 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 AggregatedExpressionFunction {
|
|
133
133
|
/**
|
|
134
|
-
*
|
|
134
|
+
* Expression description
|
|
135
135
|
*/
|
|
136
|
-
|
|
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;
|
|
137
164
|
/**
|
|
138
|
-
*
|
|
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.
|
|
139
166
|
*/
|
|
140
|
-
|
|
167
|
+
filterRow?: (context: AggregatedExpressionFilteRowContext) => boolean;
|
|
168
|
+
}
|
|
169
|
+
export interface AggregatedExpressionReducerContext extends BaseContext {
|
|
141
170
|
/**
|
|
142
|
-
*
|
|
143
|
-
|
|
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;
|
|
182
|
+
/**
|
|
183
|
+
* Current row node
|
|
184
|
+
*/
|
|
185
|
+
rowNode: IRowNode;
|
|
186
|
+
/**
|
|
187
|
+
* 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
188
|
*/
|
|
145
189
|
args: any[];
|
|
146
190
|
/**
|
|
147
191
|
* Column Id of the column being aggregated
|
|
148
192
|
*/
|
|
149
193
|
aggColumnId: string;
|
|
194
|
+
/**
|
|
195
|
+
* Column Id(s) of the column(s) being grouped by
|
|
196
|
+
*/
|
|
197
|
+
groupByColumnIds?: string[];
|
|
150
198
|
/**
|
|
151
199
|
* Helper function to get the value of a column
|
|
152
200
|
* @param colId column id
|
|
153
|
-
* @returns
|
|
154
201
|
*/
|
|
155
202
|
getValueForColId: (colId: string) => any;
|
|
156
203
|
}
|
|
157
|
-
export interface
|
|
204
|
+
export interface AggregatedExpressionProcessAggregatedValueContext extends BaseContext {
|
|
158
205
|
/**
|
|
159
|
-
*
|
|
206
|
+
* Result of the reducer
|
|
160
207
|
*/
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
export interface AggregatedScalarExpressionPrepareRowValueContext extends BaseContext {
|
|
208
|
+
aggregatedValue: any;
|
|
164
209
|
/**
|
|
165
|
-
*
|
|
210
|
+
* Array of row nodes; if aggregation is grouped, this will be the array of row nodes for the group
|
|
211
|
+
*/
|
|
212
|
+
rowNodes: IRowNode[];
|
|
213
|
+
/**
|
|
214
|
+
* Arguments passed to the function. Aggregation column and group by column are not included as they are passed as separate arguments.
|
|
166
215
|
*/
|
|
167
216
|
args: any[];
|
|
168
|
-
aggColumnId: string;
|
|
169
|
-
getValueForColId: (colId: string) => any;
|
|
170
|
-
}
|
|
171
|
-
export interface AggregatedScalarExpressionRowFilterContext extends BaseContext {
|
|
172
217
|
/**
|
|
173
218
|
* Column Id of the column being aggregated
|
|
174
|
-
* Usualy the first Col argument, e.g. [colId]
|
|
175
219
|
*/
|
|
176
220
|
aggColumnId: string;
|
|
177
221
|
/**
|
|
178
|
-
*
|
|
179
|
-
* @param colId column id
|
|
180
|
-
* @returns
|
|
222
|
+
* Column Id(s) of the column(s) being grouped by
|
|
181
223
|
*/
|
|
182
|
-
|
|
224
|
+
groupByColumnIds?: string[];
|
|
183
225
|
}
|
|
184
|
-
export interface
|
|
226
|
+
export interface AggregatedExpressionPrepareRowValueContext extends BaseContext {
|
|
185
227
|
/**
|
|
186
|
-
*
|
|
228
|
+
* Current Row Node
|
|
187
229
|
*/
|
|
188
|
-
|
|
230
|
+
rowNode: IRowNode;
|
|
189
231
|
/**
|
|
190
|
-
*
|
|
232
|
+
* Result of the reducer
|
|
191
233
|
*/
|
|
192
|
-
|
|
234
|
+
aggregatedValue: any;
|
|
193
235
|
/**
|
|
194
|
-
*
|
|
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.
|
|
195
237
|
*/
|
|
196
|
-
|
|
238
|
+
args: any[];
|
|
197
239
|
/**
|
|
198
|
-
*
|
|
240
|
+
* Column Id of the column being aggregated
|
|
199
241
|
*/
|
|
200
|
-
|
|
242
|
+
aggColumnId: string;
|
|
201
243
|
/**
|
|
202
|
-
*
|
|
203
|
-
* @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
|
-
* @param currentValue - the current value being processed in the Column Data
|
|
205
|
-
* @param index - index of the current value in the Column Data
|
|
206
|
-
* @param context - context object with the current row node, adaptableApi, aggColumnId and other possible custom arguments
|
|
244
|
+
* Column Id(s) of the column(s) being grouped by
|
|
207
245
|
*/
|
|
208
|
-
|
|
246
|
+
groupByColumnIds?: string[];
|
|
209
247
|
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
* @param aggregatedValue - result of the reducer
|
|
213
|
-
* @param dataArray - array of values. If aggregation was grouped, this will be the array of values for the group.
|
|
214
|
-
* @param context - context object with the args
|
|
248
|
+
* Helper function to get the value of a column
|
|
249
|
+
* @param colId column id
|
|
215
250
|
*/
|
|
216
|
-
|
|
251
|
+
getValueForColId: (colId: string) => any;
|
|
252
|
+
}
|
|
253
|
+
export interface AggregatedExpressionFilteRowContext extends BaseContext {
|
|
254
|
+
/**
|
|
255
|
+
* Current row node
|
|
256
|
+
*/
|
|
257
|
+
rowNode: IRowNode;
|
|
258
|
+
/**
|
|
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.
|
|
260
|
+
*/
|
|
261
|
+
args: any[];
|
|
262
|
+
/**
|
|
263
|
+
* Column Id of the column being aggregated
|
|
264
|
+
* Usually the first Col argument, e.g. [colId]
|
|
265
|
+
*/
|
|
266
|
+
aggColumnId: string;
|
|
217
267
|
/**
|
|
218
|
-
*
|
|
219
|
-
* This can be used when each row has a different value (e.g. percentage).
|
|
220
|
-
* @param rowNode - current row node
|
|
221
|
-
* @param context - context object with the args, aggColumnId, getValueForColId
|
|
222
|
-
* @returns return value for each individual row
|
|
268
|
+
* Column Id(s) of the column(s) being grouped by
|
|
223
269
|
*/
|
|
224
|
-
|
|
270
|
+
groupByColumnIds?: string[];
|
|
225
271
|
/**
|
|
226
|
-
*
|
|
227
|
-
* @param
|
|
228
|
-
* @param context - context object with the aggColumnId, getValueForColId
|
|
272
|
+
* Utility function to get the value of a column
|
|
273
|
+
* @param colId column id
|
|
229
274
|
*/
|
|
230
|
-
|
|
275
|
+
getValueForColId: (colId: string) => any;
|
|
231
276
|
}
|
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, 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';
|