@adaptabletools/adaptable 22.0.9 → 22.0.11
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/DataChangeHistoryApi.d.ts +7 -2
- package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +2 -1
- package/src/Api/Implementation/DataChangeHistoryApiImpl.js +7 -0
- package/src/agGrid/AdaptableAgGrid.js +1 -0
- package/src/agGrid/AgGridAdapter.d.ts +2 -0
- package/src/agGrid/AgGridAdapter.js +31 -2
- package/src/agGrid/AgGridColumnAdapter.js +2 -1
- package/src/env.js +2 -2
- package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.11",
|
|
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",
|
|
@@ -37,11 +37,16 @@ export interface DataChangeHistoryApi {
|
|
|
37
37
|
*/
|
|
38
38
|
addDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo): void;
|
|
39
39
|
/**
|
|
40
|
-
* Reverts
|
|
40
|
+
* Reverts provided data change to its previous value and returns GridCell that was undone
|
|
41
41
|
*
|
|
42
42
|
* @param dataChangeInfo the change to be undone
|
|
43
43
|
*/
|
|
44
|
-
undoDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo):
|
|
44
|
+
undoDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo): GridCell | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Reverts all data changes to previous values and returns GridCells that were undone
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
undoAllDataChangeHistoryEntries(): GridCell[];
|
|
45
50
|
/**
|
|
46
51
|
* Clears a Row in Data Change Grid
|
|
47
52
|
*
|
|
@@ -10,7 +10,8 @@ export declare class DataChangeHistoryApiImpl extends ApiBase implements DataCha
|
|
|
10
10
|
getDataChangeHistoryLog(): CellDataChangedInfo[];
|
|
11
11
|
getDataChangeForGridCell(gridCell: GridCell): CellDataChangedInfo | undefined;
|
|
12
12
|
addDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo): void;
|
|
13
|
-
undoDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo):
|
|
13
|
+
undoDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo): GridCell | undefined;
|
|
14
|
+
undoAllDataChangeHistoryEntries(): GridCell[];
|
|
14
15
|
clearDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo): void;
|
|
15
16
|
openDataChangeHistorySettingsPanel(): void;
|
|
16
17
|
private getDataChangeHistoryKey;
|
|
@@ -44,6 +44,13 @@ export class DataChangeHistoryApiImpl extends ApiBase {
|
|
|
44
44
|
undoDataChangeHistoryEntry(dataChangeInfo) {
|
|
45
45
|
const uniqueKey = this.getDataChangeHistoryKey(dataChangeInfo);
|
|
46
46
|
this.dispatchAction(DataChangeHistoryUndo(dataChangeInfo, uniqueKey));
|
|
47
|
+
return this.getGridApi().getGridCellFromRowNode(dataChangeInfo.rowNode, dataChangeInfo.column.columnId);
|
|
48
|
+
}
|
|
49
|
+
undoAllDataChangeHistoryEntries() {
|
|
50
|
+
const allChanges = this.getDataChangeHistoryLog();
|
|
51
|
+
return allChanges
|
|
52
|
+
.map((dataChange) => this.undoDataChangeHistoryEntry(dataChange))
|
|
53
|
+
.filter((gridCell) => gridCell != null);
|
|
47
54
|
}
|
|
48
55
|
clearDataChangeHistoryEntry(dataChangeInfo) {
|
|
49
56
|
const uniqueKey = this.getDataChangeHistoryKey(dataChangeInfo);
|
|
@@ -503,6 +503,7 @@ export class AdaptableAgGrid {
|
|
|
503
503
|
this.agGridAdapter.setAgGridApi(agGridApi);
|
|
504
504
|
this.agGridAdapter.monkeyPatchingGridOptionsUpdates();
|
|
505
505
|
this.agGridAdapter.monkeyPatchingAggColumnFilters();
|
|
506
|
+
this.agGridAdapter.monkeyPatchingAggFuncLabels();
|
|
506
507
|
this.lifecycleState = 'agGridReady';
|
|
507
508
|
this.api.entitlementApi.internalApi.setModulesAgGridDepsInfos();
|
|
508
509
|
this.ModuleService.logMissingAgGridDepsInfos();
|
|
@@ -11,6 +11,7 @@ export declare class AgGridAdapter {
|
|
|
11
11
|
private DANGER_updateGridOptionsMonkeyPatcher;
|
|
12
12
|
private DANGER_doFiltersPassMonkeyPatcher;
|
|
13
13
|
private DANGER_isAggFilterPresentMonkeyPatcher;
|
|
14
|
+
private DANGER_getDefaultFuncLabelMonkeyPatcher;
|
|
14
15
|
private activePivotColumnFilters_MEMO;
|
|
15
16
|
initialGridOptions: GridOptions;
|
|
16
17
|
private _agGridId;
|
|
@@ -28,6 +29,7 @@ export declare class AgGridAdapter {
|
|
|
28
29
|
getAgGridApi(skipLogging?: boolean): GridApi | undefined;
|
|
29
30
|
monkeyPatchingGridOptionsUpdates(): void;
|
|
30
31
|
monkeyPatchingAggColumnFilters(): void;
|
|
32
|
+
monkeyPatchingAggFuncLabels(): void;
|
|
31
33
|
private DANGER_getPrivateAgGridBeans;
|
|
32
34
|
DANGER_getLiveGridOptions(): GridOptions<any>;
|
|
33
35
|
getAgGridRootElement(): HTMLElement;
|
|
@@ -21,6 +21,8 @@ export class AgGridAdapter {
|
|
|
21
21
|
// see #aggColumnFilters_monkey_patch
|
|
22
22
|
DANGER_doFiltersPassMonkeyPatcher;
|
|
23
23
|
DANGER_isAggFilterPresentMonkeyPatcher;
|
|
24
|
+
// see #aggFuncLabels_monkey_patch
|
|
25
|
+
DANGER_getDefaultFuncLabelMonkeyPatcher;
|
|
24
26
|
activePivotColumnFilters_MEMO = new WeakMap();
|
|
25
27
|
initialGridOptions;
|
|
26
28
|
_agGridId;
|
|
@@ -51,6 +53,7 @@ export class AgGridAdapter {
|
|
|
51
53
|
this.DANGER_updateGridOptionsMonkeyPatcher = null;
|
|
52
54
|
this.DANGER_doFiltersPassMonkeyPatcher = null;
|
|
53
55
|
this.DANGER_isAggFilterPresentMonkeyPatcher = null;
|
|
56
|
+
this.DANGER_getDefaultFuncLabelMonkeyPatcher = null;
|
|
54
57
|
this.activePivotColumnFilters_MEMO = null;
|
|
55
58
|
this._adaptableInstance = null;
|
|
56
59
|
}
|
|
@@ -208,6 +211,27 @@ export class AgGridAdapter {
|
|
|
208
211
|
};
|
|
209
212
|
agGridColumnFilterService.isAggFilterPresent = this.DANGER_isAggFilterPresentMonkeyPatcher;
|
|
210
213
|
}
|
|
214
|
+
// #aggFuncLabels_monkey_patch
|
|
215
|
+
monkeyPatchingAggFuncLabels() {
|
|
216
|
+
const agGridAggFuncService = this.DANGER_getPrivateAgGridBeans()?.aggFuncSvc;
|
|
217
|
+
if (!agGridAggFuncService) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const original_getDefaultFuncLabel = agGridAggFuncService.getDefaultFuncLabel;
|
|
221
|
+
if (typeof original_getDefaultFuncLabel !== 'function') {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
this.DANGER_getDefaultFuncLabelMonkeyPatcher = function (fctName) {
|
|
225
|
+
if (fctName === 'only') {
|
|
226
|
+
return 'Only';
|
|
227
|
+
}
|
|
228
|
+
if (fctName === 'weightedAvg') {
|
|
229
|
+
return 'Weighted Average';
|
|
230
|
+
}
|
|
231
|
+
return original_getDefaultFuncLabel.call(this, fctName);
|
|
232
|
+
};
|
|
233
|
+
agGridAggFuncService.getDefaultFuncLabel = this.DANGER_getDefaultFuncLabelMonkeyPatcher;
|
|
234
|
+
}
|
|
211
235
|
DANGER_getPrivateAgGridBeans() {
|
|
212
236
|
const beans = DANGER_AG_GRID_BEANS_MAP[this._agGridId];
|
|
213
237
|
if (!beans) {
|
|
@@ -655,9 +679,14 @@ export class AgGridAdapter {
|
|
|
655
679
|
return false;
|
|
656
680
|
}
|
|
657
681
|
getColumnAggregationFunctions(colDef) {
|
|
658
|
-
|
|
682
|
+
const defaultAggFuncs = ['sum', 'min', 'max', 'count', 'avg', 'first', 'last'];
|
|
683
|
+
const hasAllowedAggFuncs = Array.isArray(colDef.allowedAggFuncs);
|
|
684
|
+
let result = hasAllowedAggFuncs ? [...colDef.allowedAggFuncs] : [...defaultAggFuncs];
|
|
659
685
|
const gridOptionsAggFuncs = this.adaptableApi.agGridApi.getGridOption('aggFuncs') || {};
|
|
660
|
-
|
|
686
|
+
const gridOptionsAggFuncNames = Object.keys(gridOptionsAggFuncs);
|
|
687
|
+
if (!hasAllowedAggFuncs) {
|
|
688
|
+
result.push(...gridOptionsAggFuncNames);
|
|
689
|
+
}
|
|
661
690
|
result = result.filter((func) => !isWeightedAverageAggFuncName(func));
|
|
662
691
|
return [...new Set(result)];
|
|
663
692
|
}
|
|
@@ -17,7 +17,7 @@ import { AdaptableFilterHandler } from './AdaptableFilterHandler';
|
|
|
17
17
|
import { AgGridFilterAdapterFactory } from './AgGridFilterAdapter';
|
|
18
18
|
import { AgGridFloatingFilterAdapterFactory } from './AgGridFloatingFilterAdapter';
|
|
19
19
|
import { errorOnce } from './AdaptableLogger';
|
|
20
|
-
import { isWeightedAverageAggFuncName } from '../AdaptableState/Common/AggregationColumns';
|
|
20
|
+
import { isWeightedAverageAggFuncName, } from '../AdaptableState/Common/AggregationColumns';
|
|
21
21
|
export function getEditorForColumnDataType(columnDataType, variant) {
|
|
22
22
|
if (columnDataType === 'number') {
|
|
23
23
|
return variant === 'react' ? AdaptableReactNumberEditor : AdaptableNumberEditor;
|
|
@@ -571,6 +571,7 @@ export class AgGridColumnAdapter {
|
|
|
571
571
|
return undefined;
|
|
572
572
|
}
|
|
573
573
|
return abColumn.availableAggregationFunctions.filter((func) => !isWeightedAverageAggFuncName(func));
|
|
574
|
+
// .filter((func) => func !== ONLY_AGG_FN_NAME);
|
|
574
575
|
});
|
|
575
576
|
}
|
|
576
577
|
setupColumnType(columnSetupInfo) {
|
package/src/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
NEXT_PUBLIC_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:
|
|
4
|
-
VERSION: "22.0.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1775828182886 || Date.now(),
|
|
4
|
+
VERSION: "22.0.11" || '--current-version--',
|
|
5
5
|
};
|