@adaptabletools/adaptable 23.0.7 → 23.0.8-canary.0
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/AdaptableOptions/DataChangeHistoryOptions.d.ts +1 -1
- package/src/AdaptableState/LayoutState.d.ts +6 -3
- package/src/Api/Internal/LayoutInternalApi.d.ts +0 -4
- package/src/Api/Internal/LayoutInternalApi.js +0 -21
- package/src/View/DataChangeHistory/DataChangeHistoryTable.js +8 -2
- package/src/View/DataChangeHistory/dataChangeHistoryHelpers.d.ts +23 -1
- package/src/View/DataChangeHistory/dataChangeHistoryHelpers.js +31 -2
- package/src/agGrid/AdaptableAgGrid.js +2 -9
- package/src/env.js +2 -2
- package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@ export interface DataChangeHistoryOptions<TData = any> {
|
|
|
29
29
|
*/
|
|
30
30
|
showLastDataChangeOnly?: boolean;
|
|
31
31
|
/**
|
|
32
|
-
* How many data changes are held in State at any one time; when
|
|
32
|
+
* How many data changes are held in State at any one time; when limit is reached, oldest change(s) are deleted from memory
|
|
33
33
|
*
|
|
34
34
|
* @defaultValue undefined (all data changes are logged)
|
|
35
35
|
* @noCodeItem
|
|
@@ -41,13 +41,13 @@ export interface LayoutState extends BaseState {
|
|
|
41
41
|
*/
|
|
42
42
|
Layouts: LayoutArray;
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Base object for both Table and Pivot Layouts
|
|
46
|
-
*/
|
|
47
44
|
/**
|
|
48
45
|
* How row groups are displayed in a Layout (maps to AG Grid `groupDisplayType`).
|
|
49
46
|
*/
|
|
50
47
|
export type RowGroupDisplayType = 'single' | 'multi' | 'groupRows';
|
|
48
|
+
/**
|
|
49
|
+
* Base object for both Table and Pivot Layouts
|
|
50
|
+
*/
|
|
51
51
|
export interface LayoutBase extends AdaptableObject {
|
|
52
52
|
/**
|
|
53
53
|
* Name of the Layout as it appears in the Layout toolbar and tool panel
|
|
@@ -105,6 +105,9 @@ export interface LayoutBase extends AdaptableObject {
|
|
|
105
105
|
* Position of the Grand Total Row in the Layout
|
|
106
106
|
*/
|
|
107
107
|
GrandTotalRow?: 'top' | 'bottom' | 'pinnedTop' | 'pinnedBottom' | boolean;
|
|
108
|
+
/**
|
|
109
|
+
* How Row Groups are displayed: 'single' - one hierarchical group Column; 'multi' - a separate group Column per Row Grouped Column; 'groupRows' - full-width group rows (no group column); defaults to 'single'
|
|
110
|
+
*/
|
|
108
111
|
RowGroupDisplayType?: RowGroupDisplayType;
|
|
109
112
|
}
|
|
110
113
|
/**
|
|
@@ -36,8 +36,4 @@ export declare class LayoutInternalApi extends ApiBase {
|
|
|
36
36
|
cloneLayout(layoutToClone: Layout): Omit<Layout, 'Name'>;
|
|
37
37
|
getCurrentLayout_perfOptimized(): Layout | null;
|
|
38
38
|
getCurrentLayoutRowGroupDisplayType(): LayoutBase['RowGroupDisplayType'];
|
|
39
|
-
areAllGroupedColumnsFilterable(): {
|
|
40
|
-
filter: boolean;
|
|
41
|
-
floatingFilter: boolean;
|
|
42
|
-
};
|
|
43
39
|
}
|
|
@@ -187,25 +187,4 @@ export class LayoutInternalApi extends ApiBase {
|
|
|
187
187
|
getCurrentLayoutRowGroupDisplayType() {
|
|
188
188
|
return this.getLayoutApi().getCurrentLayout()?.RowGroupDisplayType ?? 'single';
|
|
189
189
|
}
|
|
190
|
-
areAllGroupedColumnsFilterable() {
|
|
191
|
-
const groupedAgColumns = this.getAgGridApi().getRowGroupColumns();
|
|
192
|
-
let allHaveFilter = true;
|
|
193
|
-
let allHaveFloatingFilter = true;
|
|
194
|
-
for (const column of groupedAgColumns) {
|
|
195
|
-
if (!allHaveFilter && !allHaveFloatingFilter) {
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
198
|
-
const colDef = column.getColDef();
|
|
199
|
-
if (allHaveFilter && !colDef.filter) {
|
|
200
|
-
allHaveFilter = false;
|
|
201
|
-
}
|
|
202
|
-
if (allHaveFloatingFilter && !colDef.floatingFilter) {
|
|
203
|
-
allHaveFloatingFilter = false;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
return {
|
|
207
|
-
filter: allHaveFilter,
|
|
208
|
-
floatingFilter: allHaveFloatingFilter,
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
190
|
}
|
|
@@ -46,11 +46,17 @@ export const DataChangeHistoryTable = (props) => {
|
|
|
46
46
|
},
|
|
47
47
|
oldValue: {
|
|
48
48
|
header: 'Previous',
|
|
49
|
-
valueGetter: (params) =>
|
|
49
|
+
valueGetter: (params) => {
|
|
50
|
+
const info = getChangeHistoryRowChangeInfo(params.data);
|
|
51
|
+
return formatChangeHistoryCellValue(info?.oldValue, info?.column, info?.rowNode, adaptable.api);
|
|
52
|
+
},
|
|
50
53
|
},
|
|
51
54
|
newValue: {
|
|
52
55
|
header: 'New',
|
|
53
|
-
valueGetter: (params) =>
|
|
56
|
+
valueGetter: (params) => {
|
|
57
|
+
const info = getChangeHistoryRowChangeInfo(params.data);
|
|
58
|
+
return formatChangeHistoryCellValue(info?.newValue, info?.column, info?.rowNode, adaptable.api);
|
|
59
|
+
},
|
|
54
60
|
},
|
|
55
61
|
changedAt: {
|
|
56
62
|
header: 'Changed',
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { IRowNode } from 'ag-grid-enterprise';
|
|
1
2
|
import { CellDataChangedInfo } from '../../AdaptableState/Common/CellDataChangedInfo';
|
|
2
3
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
4
|
+
import { AdaptableColumn } from '../../AdaptableState/Common/AdaptableColumn';
|
|
5
|
+
import { AdaptableApi } from '../../types';
|
|
3
6
|
export interface DataChangeHistoryData {
|
|
4
7
|
primaryKey: string;
|
|
5
8
|
changeKey: string;
|
|
@@ -12,4 +15,23 @@ export declare const getChangeTriggerLabel: (changeInfo: CellDataChangedInfo) =>
|
|
|
12
15
|
export declare const isValidChangeHistoryLogEntry: (changeInfo: CellDataChangedInfo | undefined) => changeInfo is CellDataChangedInfo;
|
|
13
16
|
export declare const mapChangeHistoryRowData: (changeHistoryLog: Record<string, CellDataChangedInfo>, mainAdaptableInstance: IAdaptable) => DataChangeHistoryData[];
|
|
14
17
|
export declare const getChangeHistoryRowChangeInfo: (rowData: Partial<DataChangeHistoryData> | undefined) => CellDataChangedInfo | undefined;
|
|
15
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Format an old/new value for display in the Data Change History Monitor.
|
|
20
|
+
*
|
|
21
|
+
* If the changed column has a `DisplayFormat` configured (via Format Column),
|
|
22
|
+
* the value is run through the matching formatter so the History Log shows the
|
|
23
|
+
* same rendered text the user sees in the grid (e.g. a timestamp appears as
|
|
24
|
+
* `18:40:34` rather than the underlying `1751469622156`).
|
|
25
|
+
*
|
|
26
|
+
* If no `DisplayFormat` is scoped to the column, we fall back to `String(value)`
|
|
27
|
+
* — which preserves the previous behaviour for columns whose raw value already
|
|
28
|
+
* *is* the display value (e.g. plain numeric or string columns).
|
|
29
|
+
*
|
|
30
|
+
* Note: the `rowNode` passed here is the node captured when the change was
|
|
31
|
+
* recorded. Its data may have moved on since; that only matters for
|
|
32
|
+
* `CustomDisplayFormatters` that read other cells on the row — in which case
|
|
33
|
+
* the formatted value reflects the current state of that row, not the state at
|
|
34
|
+
* the time of the change. Any thrown error inside a formatter is swallowed and
|
|
35
|
+
* the raw value is shown, so the History Monitor never crashes on stale data.
|
|
36
|
+
*/
|
|
37
|
+
export declare const formatChangeHistoryCellValue: (value: unknown, column: AdaptableColumn | undefined, rowNode: IRowNode | null | undefined, api: AdaptableApi) => string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { resolveDisplayFormat } from '../../AdaptableState/Common/AdaptableFormatPresets';
|
|
1
2
|
const headerMap = new Map();
|
|
2
3
|
export const getColumnHeaderLabel = (columnId, mainAdaptableInstance) => {
|
|
3
4
|
if (!headerMap.has(columnId)) {
|
|
@@ -29,9 +30,37 @@ export const getChangeHistoryRowChangeInfo = (rowData) => {
|
|
|
29
30
|
}
|
|
30
31
|
return rowData.changeInfo;
|
|
31
32
|
};
|
|
32
|
-
export const formatChangeHistoryCellValue = (value) => {
|
|
33
|
+
export const formatChangeHistoryCellValue = (value, column, rowNode, api) => {
|
|
33
34
|
if (value === null || value === undefined) {
|
|
34
35
|
return '';
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
+
if (!column) {
|
|
38
|
+
return String(value);
|
|
39
|
+
}
|
|
40
|
+
const formatColumns = api.formatColumnApi.internalApi.getFormatColumnsWithDisplayFormatForColumn(column, { target: 'cell' });
|
|
41
|
+
const formatColumn = formatColumns[0];
|
|
42
|
+
if (!formatColumn) {
|
|
43
|
+
return String(value);
|
|
44
|
+
}
|
|
45
|
+
const resolvedFormat = resolveDisplayFormat(formatColumn.DisplayFormat);
|
|
46
|
+
if (!resolvedFormat) {
|
|
47
|
+
return String(value);
|
|
48
|
+
}
|
|
49
|
+
const { Formatter, Options } = resolvedFormat;
|
|
50
|
+
const nodeForFormatter = (rowNode ?? null);
|
|
51
|
+
try {
|
|
52
|
+
switch (Formatter) {
|
|
53
|
+
case 'DateFormatter':
|
|
54
|
+
return api.formatColumnApi.internalApi.getDateFormattedValue(value, nodeForFormatter, column, Options);
|
|
55
|
+
case 'NumberFormatter':
|
|
56
|
+
return String(api.formatColumnApi.internalApi.getNumberFormattedValue(value, nodeForFormatter, column, Options));
|
|
57
|
+
case 'StringFormatter':
|
|
58
|
+
return api.formatColumnApi.internalApi.getStringFormattedValue(value, nodeForFormatter, column, Options);
|
|
59
|
+
default:
|
|
60
|
+
return String(value);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return String(value);
|
|
65
|
+
}
|
|
37
66
|
};
|
|
@@ -433,6 +433,7 @@ export class AdaptableAgGrid {
|
|
|
433
433
|
this.logger.consoleError('Failed to initialize AG Grid.');
|
|
434
434
|
return Promise.reject('Failed to initialize AG Grid.');
|
|
435
435
|
}
|
|
436
|
+
this.agGridAdapter.setAgGridApi(agGridApi);
|
|
436
437
|
this.layoutManager = new LayoutManager({
|
|
437
438
|
gridApi: agGridApi,
|
|
438
439
|
debugId: this.adaptableOptions.adaptableId,
|
|
@@ -455,7 +456,6 @@ export class AdaptableAgGrid {
|
|
|
455
456
|
this.unmountLoadingScreen?.();
|
|
456
457
|
perfInitAgGrid.end();
|
|
457
458
|
initAgGridMarker.end();
|
|
458
|
-
this.agGridAdapter.setAgGridApi(agGridApi);
|
|
459
459
|
this.agGridAdapter.monkeyPatchingGridOptionsUpdates();
|
|
460
460
|
this.agGridAdapter.monkeyPatchingAggColumnFilters();
|
|
461
461
|
this.agGridAdapter.monkeyPatchingAggFuncLabels();
|
|
@@ -823,8 +823,7 @@ export class AdaptableAgGrid {
|
|
|
823
823
|
handler: autoGroupFilterHandlerGenerator,
|
|
824
824
|
};
|
|
825
825
|
}
|
|
826
|
-
|
|
827
|
-
if (groupedColumnFilterConfig.filter) {
|
|
826
|
+
if (rowGroupDisplayType === 'multi') {
|
|
828
827
|
return 'agGroupColumnFilter';
|
|
829
828
|
}
|
|
830
829
|
return original_autoGroupColumnDef?.filter;
|
|
@@ -843,12 +842,6 @@ export class AdaptableAgGrid {
|
|
|
843
842
|
if (rowGroupDisplayType === 'single') {
|
|
844
843
|
return true;
|
|
845
844
|
}
|
|
846
|
-
if (rowGroupDisplayType === 'multi') {
|
|
847
|
-
const groupedColumnFilterConfig = this.api.layoutApi.internalApi.areAllGroupedColumnsFilterable();
|
|
848
|
-
if (groupedColumnFilterConfig.floatingFilter) {
|
|
849
|
-
return true;
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
845
|
return original_autoGroupColumnDef?.floatingFilter;
|
|
853
846
|
},
|
|
854
847
|
enumerable: true,
|
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: "23.0.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1783187213468 || Date.now(),
|
|
4
|
+
VERSION: "23.0.8-canary.0" || '--current-version--',
|
|
5
5
|
};
|