@adaptabletools/adaptable-cjs 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 +1 -1
- package/src/Api/ColumnApi.d.ts +1 -1
- package/src/agGrid/AdaptableAgGrid.js +9 -5
- package/src/agGrid/AgGridAdapter.d.ts +2 -0
- package/src/agGrid/AgGridAdapter.js +12 -2
- package/src/agGrid/weightedAverage.js +3 -2
- package/src/env.js +2 -2
- package/src/types.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
3
|
-
"version": "18.0.
|
|
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",
|
package/src/Api/ColumnApi.d.ts
CHANGED
|
@@ -292,7 +292,7 @@ export interface ColumnApi {
|
|
|
292
292
|
setColumnDefinitions(columnDefinitions: (ColDef | ColGroupDef)[]): void;
|
|
293
293
|
}
|
|
294
294
|
/**
|
|
295
|
-
* Column
|
|
295
|
+
* Configuration of an AG Grid Column, used for runtime updating of ColDefs
|
|
296
296
|
*/
|
|
297
297
|
export interface ColumnConfig {
|
|
298
298
|
/** Column Id */
|
|
@@ -1795,10 +1795,7 @@ class AdaptableAgGrid {
|
|
|
1795
1795
|
if (!this.hasAutogeneratedPrimaryKey) {
|
|
1796
1796
|
// support both AG Grid pre & post v31.3.x
|
|
1797
1797
|
// TODO remove this with the next major Adaptable version
|
|
1798
|
-
result =
|
|
1799
|
-
typeof agGridApi.getCellValue === 'function'
|
|
1800
|
-
? agGridApi.getCellValue({ colKey: this.adaptableOptions.primaryKey, rowNode })
|
|
1801
|
-
: agGridApi.getValue(this.adaptableOptions.primaryKey, rowNode);
|
|
1798
|
+
result = this.agGridAdapter._agGridApi_getValue(this.adaptableOptions.primaryKey, rowNode, agGridApi);
|
|
1802
1799
|
}
|
|
1803
1800
|
if (result == undefined && rowNode.data) {
|
|
1804
1801
|
result = rowNode.data[this.adaptableOptions.primaryKey];
|
|
@@ -1809,7 +1806,7 @@ class AdaptableAgGrid {
|
|
|
1809
1806
|
if (rowNode == null) {
|
|
1810
1807
|
return undefined;
|
|
1811
1808
|
}
|
|
1812
|
-
return this.agGridAdapter.
|
|
1809
|
+
return this.agGridAdapter._agGridApi_getValue(columnId, rowNode);
|
|
1813
1810
|
}
|
|
1814
1811
|
getDisplayValueFromRowNode(rowNode, columnId) {
|
|
1815
1812
|
if (rowNode == null) {
|
|
@@ -3949,12 +3946,19 @@ class AdaptableAgGrid {
|
|
|
3949
3946
|
const gridOptionsService = agGridApi.gos;
|
|
3950
3947
|
const self = this;
|
|
3951
3948
|
gridOptionsService.updateGridOptions = function ({ options, force, source = 'api', }) {
|
|
3949
|
+
// `columnDefs`
|
|
3952
3950
|
const passedColumnDefs = options.columnDefs;
|
|
3953
3951
|
if (passedColumnDefs) {
|
|
3954
3952
|
const colDefsWithSpecialColumns = self.getColumnDefinitionsInclSpecialColumns(passedColumnDefs);
|
|
3955
3953
|
options['columnDefs'] = colDefsWithSpecialColumns;
|
|
3956
3954
|
self.logger.info(`Added SpecialColumns on GridOptions.columnDefs update (source=${source})`);
|
|
3957
3955
|
}
|
|
3956
|
+
// `context`
|
|
3957
|
+
const passedContext = options.context;
|
|
3958
|
+
if (passedContext) {
|
|
3959
|
+
passedContext['__adaptable'] = self;
|
|
3960
|
+
passedContext['adaptableApi'] = self.api;
|
|
3961
|
+
}
|
|
3958
3962
|
// we mutated the options array, so it's OK to use the 'arguments' object
|
|
3959
3963
|
GridOptionsService_updateGridOptions.apply(this, arguments);
|
|
3960
3964
|
};
|
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgGridAdapter = void 0;
|
|
3
|
+
exports._agGridApi_getValue = exports.AgGridAdapter = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const core_1 = require("ag-grid-community");
|
|
6
6
|
const GeneralConstants_1 = require("../Utilities/Constants/GeneralConstants");
|
|
@@ -346,7 +346,7 @@ class AgGridAdapter {
|
|
|
346
346
|
}
|
|
347
347
|
row = childNodes[0];
|
|
348
348
|
}
|
|
349
|
-
const value = this.
|
|
349
|
+
const value = this._agGridApi_getValue(column, row);
|
|
350
350
|
if (value instanceof Date) {
|
|
351
351
|
dataType = 'Date';
|
|
352
352
|
}
|
|
@@ -590,5 +590,15 @@ class AgGridAdapter {
|
|
|
590
590
|
// for early init phase, gridApi might not be ready yet
|
|
591
591
|
return (_b = (_a = this.getAgGridApi(true)) === null || _a === void 0 ? void 0 : _a.getGridOption('defaultColDef')) !== null && _b !== void 0 ? _b : {};
|
|
592
592
|
}
|
|
593
|
+
_agGridApi_getValue(colKey, rowNode, gridApi) {
|
|
594
|
+
return (0, exports._agGridApi_getValue)(colKey, rowNode, gridApi || this.getAgGridApi());
|
|
595
|
+
}
|
|
593
596
|
}
|
|
594
597
|
exports.AgGridAdapter = AgGridAdapter;
|
|
598
|
+
// FIXME remove this once we support only AG Grid >=30.3.x
|
|
599
|
+
const _agGridApi_getValue = (colKey, rowNode, gridApi) => {
|
|
600
|
+
return typeof gridApi.getCellValue === 'function'
|
|
601
|
+
? gridApi.getCellValue({ colKey, rowNode })
|
|
602
|
+
: gridApi.getValue(colKey, rowNode);
|
|
603
|
+
};
|
|
604
|
+
exports._agGridApi_getValue = _agGridApi_getValue;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.weightedAverage = exports.getNumericValue = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const toNumber_1 = tslib_1.__importDefault(require("lodash/toNumber"));
|
|
6
|
+
const AgGridAdapter_1 = require("./AgGridAdapter");
|
|
6
7
|
const getNumericValue = (input) => {
|
|
7
8
|
if (typeof input === 'number') {
|
|
8
9
|
return input;
|
|
@@ -18,9 +19,9 @@ const weightedAverage = (params, columnId, weightColumnId) => {
|
|
|
18
19
|
// TODO AFL: improve performance by using the intermediary aggregated values (for nested groups)
|
|
19
20
|
groupRowNode.allLeafChildren.forEach((rowNode) => {
|
|
20
21
|
// when editing values might be converted to strings
|
|
21
|
-
const rawColumnValue =
|
|
22
|
+
const rawColumnValue = (0, AgGridAdapter_1._agGridApi_getValue)(columnId, rowNode, gridApi);
|
|
22
23
|
const columnValue = (0, exports.getNumericValue)(rawColumnValue);
|
|
23
|
-
const rawWeightedColumnValue =
|
|
24
|
+
const rawWeightedColumnValue = (0, AgGridAdapter_1._agGridApi_getValue)(weightColumnId, rowNode, gridApi);
|
|
24
25
|
const weightedColumnValue = (0, exports.getNumericValue)(rawWeightedColumnValue);
|
|
25
26
|
if (weightedColumnValue !== null) {
|
|
26
27
|
weightedColumnValueSum += weightedColumnValue;
|
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:
|
|
6
|
-
VERSION: "18.0.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1716828261274 || Date.now(),
|
|
6
|
+
VERSION: "18.0.13" || '--current-version--',
|
|
7
7
|
};
|
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';
|