@adaptabletools/adaptable 24.0.3 → 24.0.5
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/AdaptableInterfaces/IAdaptable.d.ts +7 -0
- package/src/Api/AdaptableApi.d.ts +12 -0
- package/src/Api/GridApi.d.ts +13 -3
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -0
- package/src/Api/Implementation/AdaptableApiImpl.js +3 -0
- package/src/Api/Implementation/FlashingCellApiImpl.js +3 -8
- package/src/Api/Implementation/GridApiImpl.js +1 -1
- package/src/Api/Internal/AlertInternalApi.d.ts +7 -0
- package/src/Api/Internal/AlertInternalApi.js +42 -9
- package/src/Strategy/FlashingCellModule.js +2 -1
- package/src/Utilities/Helpers/CellValueHelper.d.ts +20 -0
- package/src/Utilities/Helpers/CellValueHelper.js +35 -0
- package/src/Utilities/Helpers/Layouts/LayoutHelper.d.ts +5 -0
- package/src/Utilities/Helpers/Layouts/LayoutHelper.js +33 -3
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +25 -1
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +160 -42
- package/src/Utilities/Services/DataService.js +10 -6
- package/src/Utilities/Services/FlashingCellService.d.ts +12 -0
- package/src/Utilities/Services/FlashingCellService.js +40 -3
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +5 -0
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +5 -0
- package/src/Utilities/Services/QueryLanguageService.d.ts +6 -0
- package/src/Utilities/Services/QueryLanguageService.js +29 -1
- package/src/agGrid/AdaptableAgGrid.d.ts +81 -14
- package/src/agGrid/AdaptableAgGrid.js +523 -163
- package/src/agGrid/AgGridAdapter.d.ts +10 -1
- package/src/agGrid/AgGridAdapter.js +16 -0
- package/src/agGrid/AgGridOptionsService.js +5 -0
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.d.ts +51 -10
- package/src/layout-manager/src/index.js +334 -91
- package/src/layout-manager/src/isLayoutEqual.js +4 -0
- package/src/layout-manager/src/rowGroupExpansionMatcher.d.ts +116 -0
- package/src/layout-manager/src/rowGroupExpansionMatcher.js +240 -0
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/vendor/components/Resizable/index.d.ts.map +1 -1
- package/vendor/components/Resizable/index.js +22 -10
- package/vendor/components/Resizable/index.js.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgEvent, ColDef, ColGroupDef, Column, GridApi, GridOptions, IRowNode, ManagedGridOptionKey, ManagedGridOptions, Module } from 'ag-grid-enterprise';
|
|
1
|
+
import { AgEvent, CellValueChangedEvent, ColDef, ColGroupDef, Column, GridApi, GridOptions, IRowNode, ManagedGridOptionKey, ManagedGridOptions, Module } from 'ag-grid-enterprise';
|
|
2
2
|
import type { AgChartInstance, AgSparklineOptions } from 'ag-charts-types';
|
|
3
3
|
import { AdaptableAgGrid } from './AdaptableAgGrid';
|
|
4
4
|
import { AdaptableColumn, AdaptableColumnGroup } from '../AdaptableState/Common/AdaptableColumn';
|
|
@@ -29,6 +29,10 @@ import { SelectedRowInfo } from '../AdaptableState/Selection/SelectedRowInfo';
|
|
|
29
29
|
*
|
|
30
30
|
* Row-node local events only fire on rendered rows. Off-screen updates are
|
|
31
31
|
* covered by grid `cellValueChanged` plus the `updateRows` old-data diff.
|
|
32
|
+
*
|
|
33
|
+
* The grid's own `cellValueChanged` goes through the same prototype, so it is passed on too
|
|
34
|
+
* (see AgGridAdapter.handleCellValueChangedDispatch): listeners added with `GridApi.addEventListener`
|
|
35
|
+
* receive it only in a later task.
|
|
32
36
|
*/
|
|
33
37
|
export type RowNodeEventType = 'dataChanged' | 'cellChanged';
|
|
34
38
|
export interface RowNodeEvent extends AgEvent<RowNodeEventType> {
|
|
@@ -61,6 +65,11 @@ export declare class AgGridAdapter {
|
|
|
61
65
|
* Called (for the grid managed by this adapter) whenever AG Grid dispatches a RowNode `cellChanged` / `dataChanged` event
|
|
62
66
|
*/
|
|
63
67
|
handleRowNodeEvent(event: RowNodeEvent): void;
|
|
68
|
+
/**
|
|
69
|
+
* see #local_event_service_monkey_patch
|
|
70
|
+
* Called synchronously whenever the grid managed by this adapter dispatches `cellValueChanged`
|
|
71
|
+
*/
|
|
72
|
+
handleCellValueChangedDispatch(event: CellValueChangedEvent): void;
|
|
64
73
|
setAgGridApi(gridApi: GridApi): void;
|
|
65
74
|
getAgGridApi(skipLogging?: boolean): GridApi | undefined;
|
|
66
75
|
monkeyPatchingGridOptionsUpdates(): void;
|
|
@@ -14,6 +14,10 @@ import { ONLY_AGG_FN_NAME, WEIGHTED_AVERAGE_AGG_FN_NAME, } from '../AdaptableSta
|
|
|
14
14
|
const DANGER_AG_GRID_BEANS_MAP = {};
|
|
15
15
|
const DANGER_AG_GRID_ADAPTERS_MAP = {};
|
|
16
16
|
const getColumnApiModule = () => ColumnApiModule;
|
|
17
|
+
const getAdapterForRowNode = (rowNode) => {
|
|
18
|
+
const gridId = rowNode?.beans?.context?.getId();
|
|
19
|
+
return gridId ? DANGER_AG_GRID_ADAPTERS_MAP[gridId] : undefined;
|
|
20
|
+
};
|
|
17
21
|
const PATCHED_LOCAL_EVENT_SERVICE_PROTOTYPES = new WeakSet();
|
|
18
22
|
const patchLocalEventServiceDispatchEvent = (beans) => {
|
|
19
23
|
const localEventServiceInstance = beans?.eventSvc?.globalSvc;
|
|
@@ -52,6 +56,15 @@ const patchLocalEventServiceDispatchEvent = (beans) => {
|
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
}
|
|
59
|
+
else if (event.type === 'cellValueChanged') {
|
|
60
|
+
const cellValueChangedEvent = event;
|
|
61
|
+
try {
|
|
62
|
+
getAdapterForRowNode(cellValueChangedEvent.node)?.handleCellValueChangedDispatch(cellValueChangedEvent);
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
AdaptableLogger.consoleErrorBase('Adaptable cellValueChanged handler threw; AG Grid will still receive the event', error);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
55
68
|
LocalEventService_dispatchEvent.apply(this, arguments);
|
|
56
69
|
};
|
|
57
70
|
};
|
|
@@ -137,6 +150,9 @@ export class AgGridAdapter {
|
|
|
137
150
|
handleRowNodeEvent(event) {
|
|
138
151
|
this._adaptableInstance?.onAgGridRowNodeEvent(event);
|
|
139
152
|
}
|
|
153
|
+
handleCellValueChangedDispatch(event) {
|
|
154
|
+
this._adaptableInstance?.onAgGridCellValueChangedDispatch(event);
|
|
155
|
+
}
|
|
140
156
|
setAgGridApi(gridApi) {
|
|
141
157
|
this.DANGER_USE_GETTER_gridApi = gridApi;
|
|
142
158
|
}
|
|
@@ -55,6 +55,11 @@ export class AgGridOptionsService {
|
|
|
55
55
|
revertGridOptionsPropertiesToUserValue(gridOptions, propertyNames) {
|
|
56
56
|
for (const propertyName of propertyNames) {
|
|
57
57
|
const userKey = `user.${propertyName}`;
|
|
58
|
+
const adaptableKey = `adaptable.${propertyName}`;
|
|
59
|
+
if (!this.gridOptionsPropertyCache.has(userKey) &&
|
|
60
|
+
!this.gridOptionsPropertyCache.has(adaptableKey)) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
58
63
|
const userValue = this.gridOptionsPropertyCache.get(userKey);
|
|
59
64
|
gridOptions[propertyName] = userValue;
|
|
60
65
|
}
|
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: "24.0.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1796394572880 || Date.now(),
|
|
4
|
+
VERSION: "24.0.5" || '--current-version--',
|
|
5
5
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { CheckboxSelectionCallbackParams, ColDef, ColumnState, GridApi, GridOptions, GridState } from 'ag-grid-enterprise';
|
|
1
|
+
import { AgEventType, CheckboxSelectionCallbackParams, ColDef, ColumnState, GridApi, GridOptions, GridState } from 'ag-grid-enterprise';
|
|
2
2
|
import { PivotLayoutModel, TableLayoutModel } from './LayoutManagerModel';
|
|
3
3
|
import { LMEmitter } from './LMEmitter';
|
|
4
|
+
import { RowGroupExpansionMatcherRef } from './rowGroupExpansionMatcher';
|
|
4
5
|
import { LayoutRowSelection } from '../../AdaptableState/LayoutState';
|
|
5
6
|
export declare const PIVOT_ANY_TOTAL_COL_TYPE = "pivotAnyTotal";
|
|
6
7
|
export declare const PIVOT_GRAND_TOTAL_COL_TYPE = "pivotGrandTotal";
|
|
@@ -16,9 +17,36 @@ export type LayoutManagerOptions = {
|
|
|
16
17
|
* When this returns a function, it replaces layout/gridOptions checkbox config.
|
|
17
18
|
*/
|
|
18
19
|
getRowSelectionCheckboxesOverride?: () => ((params: CheckboxSelectionCallbackParams) => boolean) | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Shared ref holding the compiled row-group expansion matcher so AdapTable's
|
|
22
|
+
* `isServerSideGroupOpenByDefault` callback stays in sync with `LayoutManager`
|
|
23
|
+
* (including before `LayoutManager` is constructed during AG Grid init; see #ssrm_row_group_expansion).
|
|
24
|
+
*/
|
|
25
|
+
rowGroupExpansionMatcherRef?: RowGroupExpansionMatcherRef;
|
|
26
|
+
};
|
|
27
|
+
type SsrmExpansionBatch = {
|
|
28
|
+
kind: 'toggles';
|
|
29
|
+
toggles: {
|
|
30
|
+
path: any[];
|
|
31
|
+
expanded: boolean;
|
|
32
|
+
}[];
|
|
33
|
+
} | {
|
|
34
|
+
kind: 'bulk';
|
|
35
|
+
source: string | undefined;
|
|
36
|
+
postBulkToggles: {
|
|
37
|
+
path: any[];
|
|
38
|
+
expanded: boolean;
|
|
39
|
+
}[];
|
|
40
|
+
};
|
|
41
|
+
type GridLayoutTriggerEvent = {
|
|
42
|
+
type: AgEventType;
|
|
43
|
+
event?: any;
|
|
44
|
+
ssrmExpansionBatch?: SsrmExpansionBatch;
|
|
19
45
|
};
|
|
20
|
-
type
|
|
46
|
+
type SetLayoutOptions = {
|
|
21
47
|
skipApplyRowGroupsExpandedState?: boolean;
|
|
48
|
+
force?: boolean;
|
|
49
|
+
skipTriggerChange?: boolean;
|
|
22
50
|
};
|
|
23
51
|
export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
|
|
24
52
|
private gridApi;
|
|
@@ -35,10 +63,19 @@ export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
|
|
|
35
63
|
private layoutManagerDebugId;
|
|
36
64
|
private initialRowSelection;
|
|
37
65
|
private getRowSelectionCheckboxesOverride?;
|
|
66
|
+
private rowGroupExpansionMatcherRef;
|
|
67
|
+
private rowModelType;
|
|
68
|
+
private pendingSsrmExpansionBatch;
|
|
69
|
+
private ssrmExpansionFlushScheduled;
|
|
70
|
+
private gridLayoutChangedLogger;
|
|
38
71
|
constructor(options: LayoutManagerOptions);
|
|
39
72
|
destroy(): void;
|
|
40
73
|
private setupEvents;
|
|
41
74
|
private setupSetColumnDefs;
|
|
75
|
+
private scheduleSsrmExpansionFlush;
|
|
76
|
+
private applyExpansionTogglesToPaths;
|
|
77
|
+
private patchCurrentLayoutGroupKeysForPreviousGrouping;
|
|
78
|
+
private flushPendingSsrmExpansionBatch;
|
|
42
79
|
private globalAgGridEventListener;
|
|
43
80
|
private columnDefsChanged;
|
|
44
81
|
private indexColumns;
|
|
@@ -47,11 +84,14 @@ export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
|
|
|
47
84
|
onChange(fn: (layout: TableLayoutModel | PivotLayoutModel) => void): () => void;
|
|
48
85
|
onColumnDefsChanged(fn: (colDefs: GridOptions['columnDefs']) => void): () => void;
|
|
49
86
|
setOptions(options: LayoutManagerOptions): void;
|
|
50
|
-
getLayoutModelFromGrid(): TableLayoutModel | PivotLayoutModel;
|
|
51
|
-
getPivotLayoutModelFromGrid(): PivotLayoutModel;
|
|
52
|
-
getTableLayoutModelFromGrid(): TableLayoutModel;
|
|
87
|
+
getLayoutModelFromGrid(triggerEvent?: GridLayoutTriggerEvent): TableLayoutModel | PivotLayoutModel;
|
|
88
|
+
getPivotLayoutModelFromGrid(triggerEvent?: GridLayoutTriggerEvent): PivotLayoutModel;
|
|
89
|
+
getTableLayoutModelFromGrid(triggerEvent?: GridLayoutTriggerEvent): TableLayoutModel;
|
|
53
90
|
private isTreeMode;
|
|
54
|
-
|
|
91
|
+
private getRowModelType;
|
|
92
|
+
private isServerSideRowModel;
|
|
93
|
+
private isClientSideRowModel;
|
|
94
|
+
getUndecidedLayoutModelFromGrid(columnState: ColumnState[], triggerEvent?: GridLayoutTriggerEvent): TableLayoutModel | PivotLayoutModel;
|
|
55
95
|
static getColumnDefsChangesForLayout(layout: TableLayoutModel | PivotLayoutModel, colDefs: GridOptions['columnDefs']): GridOptions['columnDefs'] | null;
|
|
56
96
|
static getAGGridInitialStateForLayout(layout: TableLayoutModel | PivotLayoutModel, colDefs: GridOptions['columnDefs'], options: {
|
|
57
97
|
isTree: boolean;
|
|
@@ -67,10 +107,7 @@ export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
|
|
|
67
107
|
silentSetCurrentLayout(layout: TableLayoutModel | PivotLayoutModel, options?: {
|
|
68
108
|
normalize?: boolean;
|
|
69
109
|
}): void;
|
|
70
|
-
setLayout(layout: TableLayoutModel | PivotLayoutModel, options?:
|
|
71
|
-
force?: boolean;
|
|
72
|
-
skipTriggerChange?: boolean;
|
|
73
|
-
}): boolean;
|
|
110
|
+
setLayout(layout: TableLayoutModel | PivotLayoutModel, options?: SetLayoutOptions): boolean;
|
|
74
111
|
isCurrentLayoutPivot(): boolean;
|
|
75
112
|
private suspendAgGridListener;
|
|
76
113
|
private resumeAgGridListener;
|
|
@@ -90,7 +127,11 @@ export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
|
|
|
90
127
|
*/
|
|
91
128
|
private getRowSelectionCheckboxColumnIds;
|
|
92
129
|
private applyTableLayout;
|
|
130
|
+
private getNextRowGroupExceptionPaths;
|
|
131
|
+
private getAllLoadedRowGroupNodePaths;
|
|
93
132
|
private getRowGroupNodePathsAs;
|
|
133
|
+
private syncServerSideRowGroupExpansionMatcher;
|
|
134
|
+
private applyLayoutRowGroupExpansion;
|
|
94
135
|
applyRowGroupValues(RowGroupValues: TableLayoutModel['RowGroupValues'], rowGroupedColumns: string[]): void;
|
|
95
136
|
private computeColumnStateForPivotLayout;
|
|
96
137
|
private computePivotAggregations;
|