@adaptabletools/adaptable-cjs 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-cjs",
3
- "version": "18.1.1",
3
+ "version": "18.1.2",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -62,7 +62,7 @@ export interface ExpressionOptions<TData = any> {
62
62
  */
63
63
  systemAggregatedScalarFunctions?: AggregatedScalarFunctionName[] | ((context: GlobalExpressionFunctionsContext<AggregatedScalarFunctionName>) => AggregatedScalarFunctionName[]);
64
64
  /**
65
- * Bespoke Aggregated Scalar functions - to complement those provided by AdapTable
65
+ * Bespoke Aggregated functions - to complement those provided by AdapTable
66
66
  */
67
67
  customAggregatedFunctions?: Record<string, AggregatedExpressionFunction> | ((context: GlobalExpressionFunctionsContext<string>) => Record<string, AggregatedExpressionFunction>);
68
68
  /**
@@ -380,7 +380,7 @@ class QueryLanguageService {
380
380
  field: aggColumnId,
381
381
  initialValue: customExpressionDefinition.initialValue,
382
382
  reducer: (acc, value, rowNode, dataIndex) => {
383
- const context = Object.assign({ rowNode, args: contextArgs.map((arg) => {
383
+ const context = Object.assign({ accumulator: acc, currentValue: value, index: dataIndex, rowNode, args: contextArgs.map((arg) => {
384
384
  // if col, replace with value
385
385
  if (typeof arg === 'object' && arg.name === 'COL') {
386
386
  return getValueForColId(arg.value, rowNode);
@@ -388,12 +388,13 @@ class QueryLanguageService {
388
388
  return arg;
389
389
  }), aggColumnId,
390
390
  groupByColumnIds, getValueForColId: (colId) => getValueForColId(colId, rowNode) }, (0, ObjectFactory_1.createBaseContext)(this.adaptableApi));
391
- return customExpressionDefinition.reducer(acc, value, dataIndex, context);
391
+ return customExpressionDefinition.reducer(context);
392
392
  },
393
393
  done: (accValue, dataArray) => {
394
394
  if (customExpressionDefinition.processAggregatedValue) {
395
- return customExpressionDefinition.processAggregatedValue(accValue, dataArray, Object.assign(Object.assign({}, (0, ObjectFactory_1.createBaseContext)(this.adaptableApi)), { args: contextArgs, aggColumnId,
396
- groupByColumnIds }));
395
+ const context = Object.assign(Object.assign({}, (0, ObjectFactory_1.createBaseContext)(this.adaptableApi)), { aggregatedValue: accValue, rowNodes: dataArray, args: contextArgs, aggColumnId,
396
+ groupByColumnIds });
397
+ return customExpressionDefinition.processAggregatedValue(context);
397
398
  }
398
399
  return accValue;
399
400
  },
@@ -402,21 +403,22 @@ class QueryLanguageService {
402
403
  },
403
404
  rowValueGetter: (rowNode, aggregationValue) => {
404
405
  if (customExpressionDefinition.prepareRowValue) {
405
- return customExpressionDefinition.prepareRowValue(rowNode, aggregationValue, Object.assign(Object.assign({}, (0, ObjectFactory_1.createBaseContext)(this.adaptableApi)), { args: contextArgs.map((arg) => {
406
+ const context = Object.assign(Object.assign({ rowNode: rowNode, aggregatedValue: aggregationValue }, (0, ObjectFactory_1.createBaseContext)(this.adaptableApi)), { args: contextArgs.map((arg) => {
406
407
  // if col, replace with value
407
408
  if (typeof arg === 'object' && arg.name === 'COL') {
408
409
  return getValueForColId(arg.value, rowNode);
409
410
  }
410
411
  return arg;
411
412
  }), aggColumnId,
412
- groupByColumnIds, getValueForColId: (colId) => getValueForColId(colId, rowNode) }));
413
+ groupByColumnIds, getValueForColId: (colId) => getValueForColId(colId, rowNode) });
414
+ return customExpressionDefinition.prepareRowValue(context);
413
415
  }
414
416
  return aggregationValue;
415
417
  },
416
418
  rowFilterFn: (rowNode) => {
417
419
  var _a, _b;
418
- if (customExpressionDefinition.rowFilter) {
419
- return customExpressionDefinition.rowFilter(rowNode, Object.assign(Object.assign({}, (0, ObjectFactory_1.createBaseContext)(this.adaptableApi)), { args: contextArgs.map((arg) => {
420
+ if (customExpressionDefinition.filterRow) {
421
+ return customExpressionDefinition.filterRow(Object.assign(Object.assign({ rowNode }, (0, ObjectFactory_1.createBaseContext)(this.adaptableApi)), { args: contextArgs.map((arg) => {
420
422
  // if col, replace with value
421
423
  if (typeof arg === 'object' && arg.name === 'COL') {
422
424
  return getValueForColId(arg.value, rowNode);
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
5
- PUBLISH_TIMESTAMP: 1718271552926 || Date.now(),
6
- VERSION: "18.1.1" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1718367380027 || Date.now(),
6
+ VERSION: "18.1.2" || '--current-version--',
7
7
  };