@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
package/package.json
CHANGED
|
@@ -175,6 +175,13 @@ export interface IAdaptable {
|
|
|
175
175
|
refreshCells(rowNode: IRowNode, columns: (string | any)[], forceUpdate: boolean, suppressFlash?: boolean): void;
|
|
176
176
|
refreshAllCells(forceUpdate?: boolean): void;
|
|
177
177
|
refreshColumns(columns: (string | Column)[], forceUpdate: boolean, suppressFlash?: boolean): void;
|
|
178
|
+
/**
|
|
179
|
+
* Runs `fn` with a post-edit batch open: re-filtering, column-wide refreshes and the selection
|
|
180
|
+
* check for the changes it reports run once, when `fn` returns
|
|
181
|
+
*/
|
|
182
|
+
runPostEditBatch<T>(fn: () => T): T;
|
|
183
|
+
/** Whether the row is rendered; a pinned row always is */
|
|
184
|
+
isRowNodeRendered(rowNode: IRowNode): boolean;
|
|
178
185
|
refreshGridHeader(): void;
|
|
179
186
|
refreshSelectedCellsState(): SelectedCellInfo | undefined;
|
|
180
187
|
refreshSelectedRowsState(): SelectedRowInfo | undefined;
|
|
@@ -246,6 +246,18 @@ export interface AdaptableApi {
|
|
|
246
246
|
* User Interface: custom icons, editable and read-only cell styles, object tags, the progress indicator, custom windows, and showing or hiding the AdapTable UI.
|
|
247
247
|
*/
|
|
248
248
|
userInterfaceApi: UserInterfaceApi;
|
|
249
|
+
/**
|
|
250
|
+
* Whether AdapTable has finished initialising and is ready to use.
|
|
251
|
+
*
|
|
252
|
+
* Returns `true` once AG Grid has been created, Adaptable State has been applied to it (columns, theme, filters, sorts, Quick Search and the current Layout) and the AdapTable UI has been rendered. It is already `true` when plugins run `onAdaptableReady` and when the `AdaptableReady` event fires.
|
|
253
|
+
*
|
|
254
|
+
* Returns `false` while AdapTable is still initialising, and after it has been destroyed (see `isDestroyed`).
|
|
255
|
+
*
|
|
256
|
+
* To run code as soon as AdapTable is ready, subscribe to the `AdaptableReady` event instead of polling this method; a listener added after the event has fired is still called.
|
|
257
|
+
*
|
|
258
|
+
* @returns `true` if AdapTable is fully initialised and has not been destroyed, otherwise `false`
|
|
259
|
+
*/
|
|
260
|
+
isReady: () => boolean;
|
|
249
261
|
/**
|
|
250
262
|
* Cleanup method - call only for vanilla JavaScript components, as framework components handle cleanup on destroy/unmount. By default, it unmounts the Adaptable component and destroys the AG Grid instance.
|
|
251
263
|
* @param config - optional configuration object
|
package/src/Api/GridApi.d.ts
CHANGED
|
@@ -92,14 +92,19 @@ export interface GridApi {
|
|
|
92
92
|
loadGridData(data: any): void;
|
|
93
93
|
/**
|
|
94
94
|
* Updates AdapTable (and AG Grid) with rows that have changed
|
|
95
|
-
*
|
|
95
|
+
*
|
|
96
|
+
* Each row is compared with the row it replaces, whether rendered or not, and every changed cell
|
|
97
|
+
* fires a Cell Changed Event. Filters are re-applied once per call, not once per row.
|
|
98
|
+
* @param dataRows rows which have been updated - send whole row, as a new object; changes made in place to a row's current data cannot be detected
|
|
96
99
|
* @param config batch option and callback function to run post update
|
|
97
100
|
* @returns The row nodes that were updated
|
|
98
101
|
*/
|
|
99
102
|
updateGridData(dataRows: any[], config?: DataUpdateConfig): Promise<IRowNode[]>;
|
|
100
103
|
/**
|
|
101
104
|
* Adds or Updates AdapTable (and AG Grid) with new and changed rows
|
|
102
|
-
*
|
|
105
|
+
*
|
|
106
|
+
* Rows whose Primary Key value is in the grid are updated, and reported as in `updateGridData`.
|
|
107
|
+
* @param dataRows rows to add or update; an updated row must be a new object, not the row's current data changed in place
|
|
103
108
|
* @param config batch option and callback function to run post change
|
|
104
109
|
* @returns The row nodes that were added and the row nodes that were updated
|
|
105
110
|
*/
|
|
@@ -123,7 +128,9 @@ export interface GridApi {
|
|
|
123
128
|
deleteGridData(dataRows: any[], config?: DataUpdateConfig): Promise<IRowNode[]>;
|
|
124
129
|
/**
|
|
125
130
|
* Adds, Updates or Deletes rows in AdapTable (and AG Grid) in single transaction
|
|
126
|
-
*
|
|
131
|
+
*
|
|
132
|
+
* Updated rows are reported as in `updateGridData`.
|
|
133
|
+
* @param dataRowConfig - Rows to add, update or remove; an updated row must be a new object, not the row's current data changed in place
|
|
127
134
|
* @param dataUpdateConfig - batch option and callback function to run post transaction
|
|
128
135
|
* @returns The row nodes that were added, updated and removed
|
|
129
136
|
*/
|
|
@@ -140,6 +147,9 @@ export interface GridApi {
|
|
|
140
147
|
setCellValue(cellUpdateRequest: CellUpdateRequest): void;
|
|
141
148
|
/**
|
|
142
149
|
* Updates multiple cells
|
|
150
|
+
*
|
|
151
|
+
* Filters are re-applied once per call, not once per cell, and the Alerts the edits fire are
|
|
152
|
+
* consolidated (see `AlertOptions.consolidateBatchAlerts`).
|
|
143
153
|
* @param cellUpdateRequests Cells to write, each with a column, row and new value
|
|
144
154
|
*/
|
|
145
155
|
setCellValues(cellUpdateRequests: CellUpdateRequest[]): void;
|
|
@@ -98,6 +98,7 @@ export declare class AdaptableApiImpl implements AdaptableApi {
|
|
|
98
98
|
* This is only meant to be called by the Adaptable instance.
|
|
99
99
|
*/
|
|
100
100
|
_internalDestroySelf(): void;
|
|
101
|
+
isReady(): boolean;
|
|
101
102
|
destroy(config?: DestroyConfig): void;
|
|
102
103
|
isDestroyed(): boolean;
|
|
103
104
|
logConsoleMessage(message: string, ...optionalParams: any[]): void;
|
|
@@ -33,16 +33,11 @@ export class FlashingCellApiImpl extends ApiBase {
|
|
|
33
33
|
}
|
|
34
34
|
showFlashingCell(flashingCellToShow) {
|
|
35
35
|
this.addUidToAdaptableObject(flashingCellToShow);
|
|
36
|
-
this.getAdaptableApi()
|
|
37
|
-
|
|
38
|
-
.addGridCellFlash(flashingCellToShow);
|
|
36
|
+
const flashingCellService = this.getAdaptableApi().internalApi.getFlashingCellService();
|
|
37
|
+
flashingCellService.addGridCellFlash(flashingCellToShow);
|
|
39
38
|
const { FlashDuration: FlashDuration } = flashingCellToShow.flashingCellDefinition;
|
|
40
39
|
if (FlashDuration && FlashDuration !== 'always') {
|
|
41
|
-
|
|
42
|
-
this.getAdaptableApi()
|
|
43
|
-
.internalApi.getFlashingCellService()
|
|
44
|
-
.clearGridCellFlash(flashingCellToShow);
|
|
45
|
-
}, FlashDuration);
|
|
40
|
+
flashingCellService.scheduleGridCellFlashClear(flashingCellToShow, FlashDuration);
|
|
46
41
|
}
|
|
47
42
|
this.getEventApi().internalApi.fireFlashingCellDisplayedEvent(flashingCellToShow);
|
|
48
43
|
}
|
|
@@ -164,7 +164,7 @@ export class GridApiImpl extends ApiBase {
|
|
|
164
164
|
const dataService = this.getAdaptableInternalApi().getDataService();
|
|
165
165
|
dataService.startDataChangeBatch();
|
|
166
166
|
try {
|
|
167
|
-
cellUpdateRequests?.forEach((cellUpdateRequest) => this.setCellValue(cellUpdateRequest));
|
|
167
|
+
this._adaptable.runPostEditBatch(() => cellUpdateRequests?.forEach((cellUpdateRequest) => this.setCellValue(cellUpdateRequest)));
|
|
168
168
|
}
|
|
169
169
|
finally {
|
|
170
170
|
dataService.endDataChangeBatch();
|
|
@@ -12,6 +12,7 @@ import { RowDataChangedInfo } from '../../types';
|
|
|
12
12
|
export type AlertRuleClass = 'cellChange' | 'aggregated' | 'live';
|
|
13
13
|
export declare class AlertInternalApi extends ApiBase {
|
|
14
14
|
private aggregationAlertBindings;
|
|
15
|
+
private alertDefinitionListsCache;
|
|
15
16
|
destroy(): void;
|
|
16
17
|
private releaseAggregationAlertHandles;
|
|
17
18
|
private pruneAggregationAlertBindings;
|
|
@@ -39,6 +40,12 @@ export declare class AlertInternalApi extends ApiBase {
|
|
|
39
40
|
* @param name name of the Form
|
|
40
41
|
*/
|
|
41
42
|
getAdaptableFormByName(name: string): AdaptableForm<AlertFormContext> | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* The lists of Alert Definitions by how their Rule is run, built once and reused until the
|
|
45
|
+
* definitions, the Layout (extensions or current Layout) or the expression functions change.
|
|
46
|
+
* Callers must not change the arrays.
|
|
47
|
+
*/
|
|
48
|
+
private getAlertDefinitionLists;
|
|
42
49
|
/**
|
|
43
50
|
* Definitions with a Rule of their own — Scheduled and (current-shape) Row
|
|
44
51
|
* Change Alerts excluded.
|
|
@@ -12,8 +12,10 @@ import { errorOnce } from '../../agGrid/AdaptableLogger';
|
|
|
12
12
|
const isRowDataChangedInfo = (value) => typeof value.rowTrigger === 'string';
|
|
13
13
|
export class AlertInternalApi extends ApiBase {
|
|
14
14
|
aggregationAlertBindings = new Map();
|
|
15
|
+
alertDefinitionListsCache;
|
|
15
16
|
destroy() {
|
|
16
17
|
this.releaseAggregationAlertHandles();
|
|
18
|
+
this.alertDefinitionListsCache = undefined;
|
|
17
19
|
super.destroy();
|
|
18
20
|
}
|
|
19
21
|
releaseAggregationAlertHandles() {
|
|
@@ -52,10 +54,36 @@ export class AlertInternalApi extends ApiBase {
|
|
|
52
54
|
const alertForms = this.getAlertOptions().alertForms || [];
|
|
53
55
|
return alertForms.find((f) => f.name === name)?.form;
|
|
54
56
|
}
|
|
57
|
+
getAlertDefinitionLists() {
|
|
58
|
+
const state = this.getAdaptableState();
|
|
59
|
+
const alertDefinitions = state.Alert?.AlertDefinitions;
|
|
60
|
+
const layoutExtensions = state.Layout?.LayoutExtensions;
|
|
61
|
+
const layoutName = this.getLayoutApi().getCurrentLayoutName();
|
|
62
|
+
const functionsGeneration = this.getAdaptableInternalApi()
|
|
63
|
+
.getQueryLanguageService()
|
|
64
|
+
.getFunctionsGeneration();
|
|
65
|
+
const cached = this.alertDefinitionListsCache;
|
|
66
|
+
if (cached &&
|
|
67
|
+
cached.alertDefinitions === alertDefinitions &&
|
|
68
|
+
cached.layoutExtensions === layoutExtensions &&
|
|
69
|
+
cached.layoutName === layoutName &&
|
|
70
|
+
cached.functionsGeneration === functionsGeneration) {
|
|
71
|
+
return cached;
|
|
72
|
+
}
|
|
73
|
+
const lists = {
|
|
74
|
+
alertDefinitions,
|
|
75
|
+
layoutExtensions,
|
|
76
|
+
layoutName,
|
|
77
|
+
functionsGeneration,
|
|
78
|
+
rule: this.getAlertApi()
|
|
79
|
+
.getAlertDefinitions()
|
|
80
|
+
.filter((alertDef) => isRuleBasedAlertDefinition(alertDef) && !isRowChangeAlertDefinition(alertDef)),
|
|
81
|
+
};
|
|
82
|
+
this.alertDefinitionListsCache = lists;
|
|
83
|
+
return lists;
|
|
84
|
+
}
|
|
55
85
|
getRuleAlertDefinitions() {
|
|
56
|
-
return this.
|
|
57
|
-
.getAlertDefinitions()
|
|
58
|
-
.filter((alertDef) => isRuleBasedAlertDefinition(alertDef) && !isRowChangeAlertDefinition(alertDef));
|
|
86
|
+
return this.getAlertDefinitionLists().rule;
|
|
59
87
|
}
|
|
60
88
|
classifyRule(alertDefinition) {
|
|
61
89
|
const rule = this.resolveAlertRule(alertDefinition);
|
|
@@ -68,19 +96,23 @@ export class AlertInternalApi extends ApiBase {
|
|
|
68
96
|
return dependencies && (dependencies.observable || dependencies.time) ? 'live' : 'cellChange';
|
|
69
97
|
}
|
|
70
98
|
getDataChangeAlertDefinitions() {
|
|
71
|
-
|
|
99
|
+
const lists = this.getAlertDefinitionLists();
|
|
100
|
+
return (lists.dataChange ??= lists.rule.filter((alertDef) => {
|
|
72
101
|
const ruleClass = this.classifyRule(alertDef);
|
|
73
102
|
return ruleClass === 'cellChange' || ruleClass === 'aggregated';
|
|
74
|
-
});
|
|
103
|
+
}));
|
|
75
104
|
}
|
|
76
105
|
getActiveDataChangeAlertDefinitions() {
|
|
77
|
-
|
|
106
|
+
const lists = this.getAlertDefinitionLists();
|
|
107
|
+
return (lists.activeDataChange ??= this.getDataChangeAlertDefinitions().filter((alertDef) => !alertDef.IsSuspended));
|
|
78
108
|
}
|
|
79
109
|
getLiveAlertDefinitions() {
|
|
80
|
-
|
|
110
|
+
const lists = this.getAlertDefinitionLists();
|
|
111
|
+
return (lists.live ??= lists.rule.filter((alertDef) => this.classifyRule(alertDef) === 'live'));
|
|
81
112
|
}
|
|
82
113
|
getActiveLiveAlertDefinitions() {
|
|
83
|
-
|
|
114
|
+
const lists = this.getAlertDefinitionLists();
|
|
115
|
+
return (lists.activeLive ??= this.getLiveAlertDefinitions().filter((alertDef) => !alertDef.IsSuspended));
|
|
84
116
|
}
|
|
85
117
|
setUpLiveAlerts() {
|
|
86
118
|
this.getAdaptableInternalApi().getAlertLiveBindingService().syncFromState();
|
|
@@ -148,7 +180,8 @@ export class AlertInternalApi extends ApiBase {
|
|
|
148
180
|
});
|
|
149
181
|
}
|
|
150
182
|
getAlertDefinitionsWithPreventEdit() {
|
|
151
|
-
|
|
183
|
+
const lists = this.getAlertDefinitionLists();
|
|
184
|
+
return (lists.preventEdit ??= this.getActiveDataChangeAlertDefinitions().filter((a) => a.AlertProperties != null && a.AlertProperties.PreventEdit === true));
|
|
152
185
|
}
|
|
153
186
|
getAlertDefinitionsWithAllowEdit() {
|
|
154
187
|
return this.getActiveDataChangeAlertDefinitions().filter((a) => a.AlertProperties == null || a.AlertProperties.PreventEdit !== true);
|
|
@@ -108,7 +108,7 @@ export class FlashingCellModule extends AdaptableModuleBase {
|
|
|
108
108
|
return triggeredFlashingCells;
|
|
109
109
|
}
|
|
110
110
|
showFlashingCellsForDefinitions(cellDataChangedInfo, flashingCellDefinitions = []) {
|
|
111
|
-
|
|
111
|
+
let allColumnIds;
|
|
112
112
|
const columnDataType = cellDataChangedInfo.column.dataType;
|
|
113
113
|
const numeric = columnDataType === 'number';
|
|
114
114
|
const isComparableType = numeric || columnDataType === 'date';
|
|
@@ -130,6 +130,7 @@ export class FlashingCellModule extends AdaptableModuleBase {
|
|
|
130
130
|
let flashTarget = this.api.flashingCellApi.getFlashingCellFlashTarget(flashingCellDefinition);
|
|
131
131
|
const flashColumnIds = { [cellDataChangedInfo.column.columnId]: true };
|
|
132
132
|
if (flashTarget === 'row' || flashTarget?.includes?.('row')) {
|
|
133
|
+
allColumnIds ??= this.api.columnApi.getUIAvailableColumns().map((c) => c.columnId);
|
|
133
134
|
allColumnIds.forEach((colId) => {
|
|
134
135
|
flashColumnIds[colId] = true;
|
|
135
136
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AdaptableColumn } from '../../AdaptableState/Common/AdaptableColumn';
|
|
2
|
+
/**
|
|
3
|
+
* Whether a cell value is unchanged: loose equality (`==`), with `NaN` equal to `NaN` and two
|
|
4
|
+
* `Date` values equal when they hold the same time.
|
|
5
|
+
*/
|
|
6
|
+
export declare function areCellValuesEqual(oldValue: any, newValue: any): boolean;
|
|
7
|
+
/** A column that reads row data, with the field it reads */
|
|
8
|
+
export interface DataBackedColumn {
|
|
9
|
+
column: AdaptableColumn;
|
|
10
|
+
/** the column's `field`, or its column id when it has none */
|
|
11
|
+
field: string;
|
|
12
|
+
/** the field is a dotted path (`quote.spread`) */
|
|
13
|
+
isNested: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The columns whose values come from the row data. Calculated, Free Text, Action, FDC3 and the
|
|
17
|
+
* columns AG Grid generates (row group, selection, pivot result, pivot total) are left out.
|
|
18
|
+
* With `suppressFieldDotNotation` (the AG Grid option) a dotted field is a plain property name.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getDataBackedColumns(columns: AdaptableColumn[], suppressFieldDotNotation?: boolean): DataBackedColumn[];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FDC3_COLUMN_TYPE } from '../../AdaptableState/Common/AdaptableColumn';
|
|
2
|
+
export function areCellValuesEqual(oldValue, newValue) {
|
|
3
|
+
if (oldValue == newValue) {
|
|
4
|
+
return true;
|
|
5
|
+
}
|
|
6
|
+
if (typeof oldValue === 'number' && typeof newValue === 'number') {
|
|
7
|
+
return Number.isNaN(oldValue) && Number.isNaN(newValue);
|
|
8
|
+
}
|
|
9
|
+
if (oldValue instanceof Date && newValue instanceof Date) {
|
|
10
|
+
return Object.is(oldValue.getTime(), newValue.getTime());
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
export function getDataBackedColumns(columns, suppressFieldDotNotation = false) {
|
|
15
|
+
const dataBackedColumns = [];
|
|
16
|
+
for (const column of columns) {
|
|
17
|
+
if (column.isCalculatedColumn ||
|
|
18
|
+
column.isFreeTextColumn ||
|
|
19
|
+
column.isActionColumn ||
|
|
20
|
+
column.isGeneratedRowGroupColumn ||
|
|
21
|
+
column.isGeneratedSelectionColumn ||
|
|
22
|
+
column.isGeneratedPivotResultColumn ||
|
|
23
|
+
column.isPivotTotalColumn ||
|
|
24
|
+
column.columnTypes?.includes(FDC3_COLUMN_TYPE)) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const field = column.field ?? column.columnId;
|
|
28
|
+
dataBackedColumns.push({
|
|
29
|
+
column,
|
|
30
|
+
field,
|
|
31
|
+
isNested: !suppressFieldDotNotation && field.includes('.'),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return dataBackedColumns;
|
|
35
|
+
}
|
|
@@ -19,7 +19,12 @@ export declare const normalizeTableLayout: (tableLayout: TableLayout, options?:
|
|
|
19
19
|
export declare const normalizePivotLayout: (pivotLayout: PivotLayout) => PivotLayout;
|
|
20
20
|
/** Clears module-scoped dedupe state when a new Adaptable instance starts (e.g. Playwright retries). */
|
|
21
21
|
export declare const resetLayoutHelperErrorOnceMessages: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Extracts active `ExceptionGroupKeys` for a Table or Pivot Layout (resolving `GroupKeys` against
|
|
24
|
+
* `PivotGroupedColumns` vs `RowGroupedColumns`; see #ssrm_row_group_expansion).
|
|
25
|
+
*/
|
|
22
26
|
export declare const getLayoutRowGroupValuesExceptionGroupKeys: (layout: TableLayout | PivotLayout) => any[][];
|
|
27
|
+
export declare const shouldUpdateRowGroupsExpandedState: (prevLayout: Layout | undefined | null, nextLayout: Layout) => boolean;
|
|
23
28
|
export declare const toRowGroupValuesForLayoutState: (rowGroupValuesModel: TableLayoutModel["RowGroupValues"]) => TableLayout["RowGroupValues"];
|
|
24
29
|
export declare const toRowGroupValuesForLayoutModel: (rowGroupValuesState: TableLayout["RowGroupValues"]) => TableLayoutModel["RowGroupValues"];
|
|
25
30
|
export declare const checkForDuplicateColumns: (layout: TableLayout) => void;
|
|
@@ -96,16 +96,46 @@ export const getLayoutRowGroupValuesExceptionGroupKeys = (layout) => {
|
|
|
96
96
|
return [];
|
|
97
97
|
}
|
|
98
98
|
if (Array.isArray(layout.RowGroupValues?.GroupKeys)) {
|
|
99
|
-
const
|
|
99
|
+
const groupedColumns = isPivotLayout(layout)
|
|
100
|
+
? layout.PivotGroupedColumns
|
|
101
|
+
: layout.RowGroupedColumns;
|
|
102
|
+
const currentGroupedColumns = (groupedColumns || []).join(',');
|
|
100
103
|
const matchingGroupKeys = layout.RowGroupValues.GroupKeys.find(({ RowGroupedColumns }) => {
|
|
101
|
-
return RowGroupedColumns.join(',') === currentGroupedColumns;
|
|
104
|
+
return (RowGroupedColumns || []).join(',') === currentGroupedColumns;
|
|
102
105
|
});
|
|
103
106
|
if (matchingGroupKeys) {
|
|
104
|
-
return matchingGroupKeys.ExceptionGroupKeys;
|
|
107
|
+
return matchingGroupKeys.ExceptionGroupKeys || [];
|
|
105
108
|
}
|
|
109
|
+
return [];
|
|
106
110
|
}
|
|
107
111
|
return layout.RowGroupValues.ExceptionGroupKeys || [];
|
|
108
112
|
};
|
|
113
|
+
export const shouldUpdateRowGroupsExpandedState = (prevLayout, nextLayout) => {
|
|
114
|
+
if (!prevLayout) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
if (prevLayout.Name !== nextLayout.Name) {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
const prevIsPivot = isPivotLayout(prevLayout);
|
|
121
|
+
const nextIsPivot = isPivotLayout(nextLayout);
|
|
122
|
+
if (prevIsPivot !== nextIsPivot) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
const prevGroupedColumns = (prevIsPivot ? prevLayout.PivotGroupedColumns : prevLayout.RowGroupedColumns) ?? [];
|
|
126
|
+
const nextGroupedColumns = (nextIsPivot ? nextLayout.PivotGroupedColumns : nextLayout.RowGroupedColumns) ?? [];
|
|
127
|
+
if (!isEqual(prevGroupedColumns, nextGroupedColumns)) {
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
const prevBehavior = prevLayout.RowGroupValues?.RowGroupDefaultBehavior ??
|
|
131
|
+
(prevIsPivot || prevGroupedColumns.length > 0 ? 'always-collapsed' : undefined);
|
|
132
|
+
const nextBehavior = nextLayout.RowGroupValues?.RowGroupDefaultBehavior ??
|
|
133
|
+
(nextIsPivot || nextGroupedColumns.length > 0 ? 'always-collapsed' : undefined);
|
|
134
|
+
if (prevBehavior !== nextBehavior) {
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
return !isEqual(getLayoutRowGroupValuesExceptionGroupKeys(prevLayout), getLayoutRowGroupValuesExceptionGroupKeys(nextLayout));
|
|
138
|
+
};
|
|
109
139
|
export const toRowGroupValuesForLayoutState = (rowGroupValuesModel) => {
|
|
110
140
|
if (!rowGroupValuesModel) {
|
|
111
141
|
return undefined;
|
|
@@ -14,7 +14,14 @@ export declare class CalculatedColumnExpressionService implements ICalculatedCol
|
|
|
14
14
|
* ties a column Uuid to its node handle + grid-refresh subscription.
|
|
15
15
|
*/
|
|
16
16
|
private aggregatedColumnBindings;
|
|
17
|
+
private dependencyCache;
|
|
17
18
|
constructor(adaptableApi: AdaptableApi);
|
|
19
|
+
private getDependencyCache;
|
|
20
|
+
/**
|
|
21
|
+
* The scalar Calculated Columns whose value depends on the column, directly or through other
|
|
22
|
+
* Calculated Columns. Callers must not change the array.
|
|
23
|
+
*/
|
|
24
|
+
getDependentScalarCalculatedColumns(columnId: string): CalculatedColumn[];
|
|
18
25
|
private getComputedValueStore;
|
|
19
26
|
buildSyntheticCellDataChangedInfosForCalcColumns(cellDataChangedInfo: CellDataChangedInfo): CellDataChangedInfo[];
|
|
20
27
|
destroy(): void;
|
|
@@ -24,11 +31,28 @@ export declare class CalculatedColumnExpressionService implements ICalculatedCol
|
|
|
24
31
|
inferCalculatedColumnTypes(calculatedColumn: Pick<CalculatedColumn, 'Type' | 'Expression'>): InferredCalculatedColumnTypes;
|
|
25
32
|
getLiveRefreshTarget(calculatedColumn: CalculatedColumn): LiveRefreshTarget | undefined;
|
|
26
33
|
getObservableCalculatedColumnsAffectedByColumn(columnId: string): ObservableCalculatedColumnRefresh[];
|
|
34
|
+
private findObservableCalculatedColumnsAffectedByColumn;
|
|
27
35
|
getAggregatedCalculatedColumnsAffectedByColumn(columnId: string): string[];
|
|
36
|
+
private findAggregatedCalculatedColumnsAffectedByColumn;
|
|
28
37
|
isCalculatedColumnQueryValid(calculatedColumn: Pick<CalculatedColumn, 'Type' | 'Expression'>, calculatedColumnId?: string): boolean;
|
|
29
38
|
evaluateCalculatedColumnQuery(calculatedColumn: CalculatedColumn, rowNode: IRowNode): any;
|
|
30
39
|
bindAggregatedCalculatedColumn(calculatedColumn: CalculatedColumn): void;
|
|
31
40
|
unbindAggregatedCalculatedColumn(calculatedColumn: CalculatedColumn): void;
|
|
32
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* The row as it was before the changes: a shallow copy of `currentData` with each changed field
|
|
44
|
+
* put back to its old value. For a dotted field only the objects along its path are copied, so
|
|
45
|
+
* `currentData` is never written to. With `suppressFieldDotNotation` (the AG Grid option) a dotted
|
|
46
|
+
* field is a plain property name.
|
|
47
|
+
*/
|
|
48
|
+
export declare function buildPreviousRowData(currentData: Record<string, any>, changes: {
|
|
49
|
+
field: string;
|
|
50
|
+
oldValue: any;
|
|
51
|
+
}[], suppressFieldDotNotation?: boolean): Record<string, any>;
|
|
33
52
|
export declare function buildSyntheticCellDataChangedInfosForCalcColumns(adaptableApi: AdaptableApi, info: CellDataChangedInfo): CellDataChangedInfo[];
|
|
34
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Adds a `calculatedColumnChange` for every scalar Calculated Column the changes alter, one per
|
|
55
|
+
* row and column. `oldData` is the row object before the changes, when they all belong to one
|
|
56
|
+
* replaced row.
|
|
57
|
+
*/
|
|
58
|
+
export declare function expandCellDataChangedInfosWithCalculatedColumns(adaptableApi: AdaptableApi, cellDataChangedInfos: CellDataChangedInfo[], oldData?: Record<string, any>): CellDataChangedInfo[];
|