@adaptabletools/adaptable 18.0.11 → 18.0.13

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",
3
- "version": "18.0.11",
3
+ "version": "18.0.13",
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",
@@ -292,7 +292,7 @@ export interface ColumnApi {
292
292
  setColumnDefinitions(columnDefinitions: (ColDef | ColGroupDef)[]): void;
293
293
  }
294
294
  /**
295
- * Column Configuration
295
+ * Configuration of an AG Grid Column, used for runtime updating of ColDefs
296
296
  */
297
297
  export interface ColumnConfig {
298
298
  /** Column Id */
@@ -1791,10 +1791,7 @@ export class AdaptableAgGrid {
1791
1791
  if (!this.hasAutogeneratedPrimaryKey) {
1792
1792
  // support both AG Grid pre & post v31.3.x
1793
1793
  // TODO remove this with the next major Adaptable version
1794
- result =
1795
- typeof agGridApi.getCellValue === 'function'
1796
- ? agGridApi.getCellValue({ colKey: this.adaptableOptions.primaryKey, rowNode })
1797
- : agGridApi.getValue(this.adaptableOptions.primaryKey, rowNode);
1794
+ result = this.agGridAdapter._agGridApi_getValue(this.adaptableOptions.primaryKey, rowNode, agGridApi);
1798
1795
  }
1799
1796
  if (result == undefined && rowNode.data) {
1800
1797
  result = rowNode.data[this.adaptableOptions.primaryKey];
@@ -1805,7 +1802,7 @@ export class AdaptableAgGrid {
1805
1802
  if (rowNode == null) {
1806
1803
  return undefined;
1807
1804
  }
1808
- return this.agGridAdapter.getAgGridApi().getValue(columnId, rowNode);
1805
+ return this.agGridAdapter._agGridApi_getValue(columnId, rowNode);
1809
1806
  }
1810
1807
  getDisplayValueFromRowNode(rowNode, columnId) {
1811
1808
  if (rowNode == null) {
@@ -3945,12 +3942,19 @@ export class AdaptableAgGrid {
3945
3942
  const gridOptionsService = agGridApi.gos;
3946
3943
  const self = this;
3947
3944
  gridOptionsService.updateGridOptions = function ({ options, force, source = 'api', }) {
3945
+ // `columnDefs`
3948
3946
  const passedColumnDefs = options.columnDefs;
3949
3947
  if (passedColumnDefs) {
3950
3948
  const colDefsWithSpecialColumns = self.getColumnDefinitionsInclSpecialColumns(passedColumnDefs);
3951
3949
  options['columnDefs'] = colDefsWithSpecialColumns;
3952
3950
  self.logger.info(`Added SpecialColumns on GridOptions.columnDefs update (source=${source})`);
3953
3951
  }
3952
+ // `context`
3953
+ const passedContext = options.context;
3954
+ if (passedContext) {
3955
+ passedContext['__adaptable'] = self;
3956
+ passedContext['adaptableApi'] = self.api;
3957
+ }
3954
3958
  // we mutated the options array, so it's OK to use the 'arguments' object
3955
3959
  GridOptionsService_updateGridOptions.apply(this, arguments);
3956
3960
  };
@@ -61,4 +61,6 @@ export declare class AgGridAdapter {
61
61
  */
62
62
  assignColumnIdsToColDefs(colDefs?: (ColDef | ColGroupDef)[]): void;
63
63
  getDefaultColumnDefinition(): GridOptions['defaultColDef'];
64
+ _agGridApi_getValue(colKey: string | Column, rowNode: IRowNode, gridApi?: GridApi): any;
64
65
  }
66
+ export declare const _agGridApi_getValue: (colKey: string | Column, rowNode: IRowNode, gridApi: GridApi) => any;
@@ -342,7 +342,7 @@ export class AgGridAdapter {
342
342
  }
343
343
  row = childNodes[0];
344
344
  }
345
- const value = this.getAgGridApi().getValue(column, row);
345
+ const value = this._agGridApi_getValue(column, row);
346
346
  if (value instanceof Date) {
347
347
  dataType = 'Date';
348
348
  }
@@ -586,4 +586,13 @@ export class AgGridAdapter {
586
586
  // for early init phase, gridApi might not be ready yet
587
587
  return (_b = (_a = this.getAgGridApi(true)) === null || _a === void 0 ? void 0 : _a.getGridOption('defaultColDef')) !== null && _b !== void 0 ? _b : {};
588
588
  }
589
+ _agGridApi_getValue(colKey, rowNode, gridApi) {
590
+ return _agGridApi_getValue(colKey, rowNode, gridApi || this.getAgGridApi());
591
+ }
589
592
  }
593
+ // FIXME remove this once we support only AG Grid >=30.3.x
594
+ export const _agGridApi_getValue = (colKey, rowNode, gridApi) => {
595
+ return typeof gridApi.getCellValue === 'function'
596
+ ? gridApi.getCellValue({ colKey, rowNode })
597
+ : gridApi.getValue(colKey, rowNode);
598
+ };
@@ -1,4 +1,5 @@
1
1
  import toNumber from 'lodash/toNumber';
2
+ import { _agGridApi_getValue } from './AgGridAdapter';
2
3
  export const getNumericValue = (input) => {
3
4
  if (typeof input === 'number') {
4
5
  return input;
@@ -13,9 +14,9 @@ export const weightedAverage = (params, columnId, weightColumnId) => {
13
14
  // TODO AFL: improve performance by using the intermediary aggregated values (for nested groups)
14
15
  groupRowNode.allLeafChildren.forEach((rowNode) => {
15
16
  // when editing values might be converted to strings
16
- const rawColumnValue = gridApi.getValue(columnId, rowNode);
17
+ const rawColumnValue = _agGridApi_getValue(columnId, rowNode, gridApi);
17
18
  const columnValue = getNumericValue(rawColumnValue);
18
- const rawWeightedColumnValue = gridApi.getValue(weightColumnId, rowNode);
19
+ const rawWeightedColumnValue = _agGridApi_getValue(weightColumnId, rowNode, gridApi);
19
20
  const weightedColumnValue = getNumericValue(rawWeightedColumnValue);
20
21
  if (weightedColumnValue !== null) {
21
22
  weightedColumnValueSum += weightedColumnValue;
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  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" || '',
3
- PUBLISH_TIMESTAMP: 1716176906473 || Date.now(),
4
- VERSION: "18.0.11" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1716828231909 || Date.now(),
4
+ VERSION: "18.0.13" || '--current-version--',
5
5
  };
package/src/types.d.ts CHANGED
@@ -65,7 +65,7 @@ export type { CalendarApi } from './Api/CalendarApi';
65
65
  export type { CalculatedColumnApi } from './Api/CalculatedColumnApi';
66
66
  export type { CellSummaryApi } from './Api/CellSummaryApi';
67
67
  export type { ChartingApi } from './Api/ChartingApi';
68
- export type { ColumnApi } from './Api/ColumnApi';
68
+ export type { ColumnApi, ColumnConfig } from './Api/ColumnApi';
69
69
  export type { ColumnFilterApi } from './Api/ColumnFilterApi';
70
70
  export type { CommentApi } from './Api/CommentApi';
71
71
  export type { ConfigApi } from './Api/ConfigApi';