@adaptabletools/adaptable 20.1.7 → 20.2.0-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/base.css +27 -0
- package/base.css.map +1 -1
- package/index.css +22 -0
- package/index.css.map +1 -1
- package/package.json +2 -2
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +2 -1
- package/src/AdaptableOptions/ExportOptions.d.ts +91 -8
- package/src/AdaptableOptions/QuickSearchOptions.d.ts +1 -6
- package/src/AdaptableState/FormatColumnState.d.ts +8 -0
- package/src/AdaptableState/LayoutState.d.ts +15 -2
- package/src/AdaptableState/QuickSearchState.d.ts +8 -0
- package/src/Api/ColumnApi.d.ts +5 -0
- package/src/Api/ExportApi.d.ts +23 -7
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ColumnApiImpl.js +15 -30
- package/src/Api/Implementation/ExportApiImpl.d.ts +11 -4
- package/src/Api/Implementation/ExportApiImpl.js +51 -9
- package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -0
- package/src/Api/Implementation/LayoutApiImpl.js +9 -0
- package/src/Api/Implementation/LayoutHelpers.js +44 -0
- package/src/Api/Implementation/QuickSearchApiImpl.d.ts +4 -0
- package/src/Api/Implementation/QuickSearchApiImpl.js +12 -0
- package/src/Api/Internal/AlertInternalApi.js +1 -1
- package/src/Api/Internal/ExportInternalApi.d.ts +3 -8
- package/src/Api/Internal/ExportInternalApi.js +1 -74
- package/src/Api/Internal/ExpressionInternalApi.d.ts +1 -1
- package/src/Api/Internal/ExpressionInternalApi.js +1 -32
- package/src/Api/Internal/FormatColumnInternalApi.d.ts +2 -1
- package/src/Api/Internal/FormatColumnInternalApi.js +62 -0
- package/src/Api/LayoutApi.d.ts +6 -2
- package/src/Api/QuickSearchApi.d.ts +16 -0
- package/src/Redux/Store/AdaptableStore.js +3 -2
- package/src/Utilities/Constants/GeneralConstants.js +2 -1
- package/src/View/Components/Forms/AdaptableFormControlTextClear.d.ts +1 -0
- package/src/View/Components/Forms/AdaptableFormControlTextClear.js +1 -0
- package/src/View/Dashboard/Dashboard.js +2 -4
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +2 -2
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +2 -2
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +6 -1
- package/src/View/Layout/Wizard/sections/RowGroupingSection.d.ts +4 -0
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +22 -19
- package/src/View/QuickSearch/QuickSearchInput.js +6 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +2 -3
- package/src/agGrid/AdaptableAgGrid.d.ts +2 -0
- package/src/agGrid/AdaptableAgGrid.js +123 -44
- package/src/agGrid/AgGridAdapter.d.ts +4 -1
- package/src/agGrid/AgGridAdapter.js +90 -13
- package/src/agGrid/AgGridColumnAdapter.d.ts +4 -0
- package/src/agGrid/AgGridColumnAdapter.js +144 -37
- package/src/agGrid/AgGridExportAdapter.d.ts +6 -1
- package/src/agGrid/AgGridExportAdapter.js +110 -17
- package/src/agGrid/FloatingFilterWrapper.js +30 -4
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +16 -2
- package/src/layout-manager/src/index.d.ts +1 -1
- package/src/layout-manager/src/index.js +135 -20
- package/src/layout-manager/src/normalizeLayoutModel.d.ts +2 -4
- package/src/layout-manager/src/normalizeLayoutModel.js +12 -16
- package/src/layout-manager/src/simplifyLayoutModel.js +15 -3
- package/src/metamodel/adaptable.metamodel.d.ts +71 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Utilities/buildSortedColumnStateForLayout.d.ts +0 -7
- package/src/Utilities/buildSortedColumnStateForLayout.js +0 -131
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { debounce, DeepMap } from '@infinite-table/infinite-react';
|
|
2
2
|
import { isPivotLayoutModel } from './isPivotLayoutModel';
|
|
3
3
|
import { LMEmitter } from './LMEmitter';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { AUTO_GROUP_COLUMN_ID__MULTI_PREFIX, AUTO_GROUP_COLUMN_ID__SINGLE, normalizeLayoutModel, normalizePivotLayoutModel, normalizeTableLayoutModel, } from './normalizeLayoutModel';
|
|
5
|
+
import { getChanges, isLayoutEqual } from './isLayoutEqual';
|
|
6
6
|
import { simplifyLayoutModel, simplifyPivotLayoutModel, simplifyTableLayoutModel, } from './simplifyLayoutModel';
|
|
7
7
|
import { sortColumnIdsByOrder } from './sortColumnIdsByOrder';
|
|
8
8
|
import { destructurePivotColumnId } from './destructurePivotColumnId';
|
|
@@ -305,6 +305,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
305
305
|
ColumnWidths,
|
|
306
306
|
ColumnVisibility: layout.ColumnVisibility,
|
|
307
307
|
RowGroupValues: layout.RowGroupValues,
|
|
308
|
+
ColumnGroupValues: layout.ColumnGroupValues,
|
|
308
309
|
PivotGroupedColumns: layout.RowGroupedColumns,
|
|
309
310
|
PivotAggregationColumns: layout.TableAggregationColumns,
|
|
310
311
|
GrandTotalRow: layout.GrandTotalRow,
|
|
@@ -337,6 +338,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
337
338
|
let ColumnSorts = [];
|
|
338
339
|
let RowGroupedColumns = [];
|
|
339
340
|
let RowGroupValues = undefined;
|
|
341
|
+
let ColumnGroupValues = undefined;
|
|
340
342
|
let TableAggregationColumns = [];
|
|
341
343
|
let ColumnPinning = {};
|
|
342
344
|
const gridState = this.gridApi.getState();
|
|
@@ -354,14 +356,14 @@ export class LayoutManager extends LMEmitter {
|
|
|
354
356
|
// we try to infer it from the default width (when display type is single)
|
|
355
357
|
// or from the respective group column (when display type is multi)
|
|
356
358
|
if (initialWidth === undefined) {
|
|
357
|
-
if (colId ===
|
|
359
|
+
if (colId === AUTO_GROUP_COLUMN_ID__SINGLE) {
|
|
358
360
|
const groupByColId = this.gridApi.getRowGroupColumns()[0]?.getColId();
|
|
359
361
|
initialWidth =
|
|
360
362
|
this.initialColumnWidths[colId] || this.initialColumnWidths[groupByColId];
|
|
361
363
|
}
|
|
362
|
-
else if (colId.startsWith(
|
|
364
|
+
else if (colId.startsWith(AUTO_GROUP_COLUMN_ID__MULTI_PREFIX)) {
|
|
363
365
|
initialWidth =
|
|
364
|
-
this.initialColumnWidths[colId.replace(
|
|
366
|
+
this.initialColumnWidths[colId.replace(AUTO_GROUP_COLUMN_ID__MULTI_PREFIX, '')];
|
|
365
367
|
}
|
|
366
368
|
}
|
|
367
369
|
// and only add the col width to the layout ColumnWidths
|
|
@@ -386,6 +388,16 @@ export class LayoutManager extends LMEmitter {
|
|
|
386
388
|
}
|
|
387
389
|
return acc;
|
|
388
390
|
}, {});
|
|
391
|
+
if (gridState.pivot?.pivotMode && gridState.sort?.sortModel) {
|
|
392
|
+
// for pivot mode, we can't simply take the current sort from the ColumnState
|
|
393
|
+
// but we have to go via the sortModel from the grid state
|
|
394
|
+
ColumnSorts = gridState.sort.sortModel.map((sort) => {
|
|
395
|
+
return {
|
|
396
|
+
ColumnId: sort.colId,
|
|
397
|
+
SortOrder: sort.sort === 'asc' ? 'Asc' : 'Desc',
|
|
398
|
+
};
|
|
399
|
+
});
|
|
400
|
+
}
|
|
389
401
|
if (gridState.aggregation) {
|
|
390
402
|
TableAggregationColumns = gridState.aggregation.aggregationModel.map((agg) => {
|
|
391
403
|
const prevAggForColumn = prevAggColumnsMap?.[agg.colId];
|
|
@@ -409,11 +421,11 @@ export class LayoutManager extends LMEmitter {
|
|
|
409
421
|
if (this.currentLayout.RowGroupedColumns?.length) {
|
|
410
422
|
const groupDisplayType = this.gridApi.getGridOption('groupDisplayType');
|
|
411
423
|
if (groupDisplayType === 'singleColumn') {
|
|
412
|
-
colsInLayout.add(
|
|
424
|
+
colsInLayout.add(AUTO_GROUP_COLUMN_ID__SINGLE);
|
|
413
425
|
}
|
|
414
426
|
else {
|
|
415
427
|
this.currentLayout.RowGroupedColumns.forEach((colId) => {
|
|
416
|
-
colsInLayout.add(`${
|
|
428
|
+
colsInLayout.add(`${AUTO_GROUP_COLUMN_ID__MULTI_PREFIX}${colId}`);
|
|
417
429
|
});
|
|
418
430
|
}
|
|
419
431
|
}
|
|
@@ -428,7 +440,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
428
440
|
// in the current layout - in which case in the prev state of the current layout
|
|
429
441
|
// we had the group column
|
|
430
442
|
// but now we will need to include the current column
|
|
431
|
-
if (colsInLayout.has(`${
|
|
443
|
+
if (colsInLayout.has(`${AUTO_GROUP_COLUMN_ID__MULTI_PREFIX}${colId}`)) {
|
|
432
444
|
// ColumnVisibility[colId] = false;
|
|
433
445
|
return true;
|
|
434
446
|
}
|
|
@@ -507,6 +519,50 @@ export class LayoutManager extends LMEmitter {
|
|
|
507
519
|
RowGroupValues = this.currentLayout.RowGroupValues;
|
|
508
520
|
}
|
|
509
521
|
}
|
|
522
|
+
if (this.currentLayout?.ColumnGroupValues) {
|
|
523
|
+
const currentColumnGroupValues = this.currentLayout.ColumnGroupValues;
|
|
524
|
+
if (currentColumnGroupValues.ColumnGroupDisplay === 'always-expanded') {
|
|
525
|
+
ColumnGroupValues = {
|
|
526
|
+
ColumnGroupDisplay: 'always-expanded',
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
else if (currentColumnGroupValues.ColumnGroupDisplay === 'always-collapsed') {
|
|
530
|
+
ColumnGroupValues = {
|
|
531
|
+
ColumnGroupDisplay: 'always-collapsed',
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
else if (currentColumnGroupValues.ColumnGroupDisplay === 'expanded' ||
|
|
535
|
+
currentColumnGroupValues.ColumnGroupDisplay === 'collapsed') {
|
|
536
|
+
const isPivot = this.isCurrentLayoutPivot();
|
|
537
|
+
const currentColumnGroupState = this.gridApi
|
|
538
|
+
.getColumnGroupState()
|
|
539
|
+
// if we're in a pivot layout, only include groups that are pivot groups
|
|
540
|
+
// as there are other fake groups in the grid as well
|
|
541
|
+
.filter((state) => (isPivot ? state.groupId.startsWith('pivotGroup_') : true));
|
|
542
|
+
if (currentColumnGroupValues.ColumnGroupDisplay === 'expanded') {
|
|
543
|
+
const collapsedGroupIds = currentColumnGroupState
|
|
544
|
+
.filter((state) => {
|
|
545
|
+
return state.open === false;
|
|
546
|
+
})
|
|
547
|
+
.map((state) => state.groupId);
|
|
548
|
+
ColumnGroupValues = {
|
|
549
|
+
ColumnGroupDisplay: 'expanded',
|
|
550
|
+
Values: collapsedGroupIds,
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
else if (currentColumnGroupValues.ColumnGroupDisplay === 'collapsed') {
|
|
554
|
+
const expandedGroupIds = currentColumnGroupState
|
|
555
|
+
.filter((state) => {
|
|
556
|
+
return state.open === true;
|
|
557
|
+
})
|
|
558
|
+
.map((state) => state.groupId);
|
|
559
|
+
ColumnGroupValues = {
|
|
560
|
+
ColumnGroupDisplay: 'collapsed',
|
|
561
|
+
Values: expandedGroupIds,
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
510
566
|
const layout = simplifyTableLayoutModel({
|
|
511
567
|
Ignore_Name: this.currentLayout?.Ignore_Name || 'Default',
|
|
512
568
|
Ignore_GridFilter: this.currentLayout?.Ignore_GridFilter,
|
|
@@ -527,6 +583,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
527
583
|
TableAggregationColumns,
|
|
528
584
|
ColumnPinning: ColumnPinning,
|
|
529
585
|
RowGroupValues,
|
|
586
|
+
ColumnGroupValues,
|
|
530
587
|
GrandTotalRow: this.gridApi.getGridOption('grandTotalRow'),
|
|
531
588
|
SuppressAggFuncInHeader: this.gridApi.getGridOption('suppressAggFuncInHeader'),
|
|
532
589
|
});
|
|
@@ -778,11 +835,22 @@ export class LayoutManager extends LMEmitter {
|
|
|
778
835
|
this.gridApi.setGridOption('suppressAggFuncInHeader', !!layout.SuppressAggFuncInHeader);
|
|
779
836
|
}
|
|
780
837
|
if (layout.GrandTotalRow) {
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
838
|
+
let grandTotalRow = null;
|
|
839
|
+
if (layout.GrandTotalRow === true) {
|
|
840
|
+
grandTotalRow = 'top';
|
|
841
|
+
}
|
|
842
|
+
else if (typeof layout.GrandTotalRow === 'string') {
|
|
843
|
+
switch (layout.GrandTotalRow) {
|
|
844
|
+
case 'top':
|
|
845
|
+
case 'bottom':
|
|
846
|
+
case 'pinnedTop':
|
|
847
|
+
case 'pinnedBottom':
|
|
848
|
+
grandTotalRow = layout.GrandTotalRow;
|
|
849
|
+
break;
|
|
850
|
+
default:
|
|
851
|
+
grandTotalRow = null;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
786
854
|
this.gridApi.setGridOption('grandTotalRow', grandTotalRow);
|
|
787
855
|
}
|
|
788
856
|
else {
|
|
@@ -831,6 +899,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
831
899
|
if (hasGroupedColumns && layout.RowGroupValues && !options?.skipApplyRowGroupsExpandedState) {
|
|
832
900
|
this.applyRowGroupValues(layout.RowGroupValues);
|
|
833
901
|
}
|
|
902
|
+
this.applyColumnGroupCollapseExpandState(layout);
|
|
834
903
|
});
|
|
835
904
|
}
|
|
836
905
|
getRowGroupNodePathsAs(options) {
|
|
@@ -1027,6 +1096,9 @@ export class LayoutManager extends LMEmitter {
|
|
|
1027
1096
|
}, {});
|
|
1028
1097
|
columnState.state.forEach((colState) => {
|
|
1029
1098
|
const colSortIndex = sortsToIndexes[colState.colId];
|
|
1099
|
+
// we delete them just to know if there are any left
|
|
1100
|
+
// after the forEach is done
|
|
1101
|
+
delete sortsToIndexes[colState.colId];
|
|
1030
1102
|
const colSort = sorts[colSortIndex];
|
|
1031
1103
|
if (colSort != undefined) {
|
|
1032
1104
|
colState.sort = colSort.SortOrder === 'Asc' ? 'asc' : 'desc';
|
|
@@ -1037,6 +1109,21 @@ export class LayoutManager extends LMEmitter {
|
|
|
1037
1109
|
colState.sortIndex = null;
|
|
1038
1110
|
}
|
|
1039
1111
|
});
|
|
1112
|
+
if (Object.keys(sortsToIndexes).length) {
|
|
1113
|
+
// if there are some sorts left which were not applied to the columnState
|
|
1114
|
+
// probably those are for pivot result columns, so we need to apply them as well
|
|
1115
|
+
Object.keys(sortsToIndexes).forEach((colId) => {
|
|
1116
|
+
const colSortIndex = sortsToIndexes[colId];
|
|
1117
|
+
const colSort = sorts[colSortIndex];
|
|
1118
|
+
if (colSort != undefined) {
|
|
1119
|
+
columnState.state.push({
|
|
1120
|
+
colId,
|
|
1121
|
+
sort: colSort.SortOrder === 'Asc' ? 'asc' : 'desc',
|
|
1122
|
+
sortIndex: colSortIndex,
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1040
1127
|
}
|
|
1041
1128
|
getDefaultColumnWidthForCol(colId, colDef) {
|
|
1042
1129
|
colDef = colDef ?? this.gridApi.getColumnDef(colId);
|
|
@@ -1137,7 +1224,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
1137
1224
|
this.gridApi.setColumnWidths(colWidthForPivotResultColumns);
|
|
1138
1225
|
}
|
|
1139
1226
|
}
|
|
1140
|
-
this.
|
|
1227
|
+
this.applyColumnGroupCollapseExpandState(layout);
|
|
1141
1228
|
const hasGroupedColumns = layout.PivotGroupedColumns && layout.PivotGroupedColumns.length;
|
|
1142
1229
|
// but also let's not forget to apply the row group values
|
|
1143
1230
|
if (hasGroupedColumns && layout.RowGroupValues && !options?.skipApplyRowGroupsExpandedState) {
|
|
@@ -1178,26 +1265,54 @@ export class LayoutManager extends LMEmitter {
|
|
|
1178
1265
|
this.gridApi.setGridOption('pivotColumnGroupTotals', null);
|
|
1179
1266
|
}
|
|
1180
1267
|
}
|
|
1181
|
-
|
|
1182
|
-
const
|
|
1268
|
+
applyColumnGroupCollapseExpandState(layout) {
|
|
1269
|
+
const IsPivotLayout = isPivotLayoutModel(layout);
|
|
1183
1270
|
const allDisplayedColumnGroups = this.gridApi.getAllDisplayedColumnGroups();
|
|
1271
|
+
let PivotExpandLevel = layout.PivotExpandLevel;
|
|
1272
|
+
const ColumnGroupValues = layout.ColumnGroupValues;
|
|
1273
|
+
if (IsPivotLayout && !ColumnGroupValues && PivotExpandLevel === undefined) {
|
|
1274
|
+
PivotExpandLevel = -1;
|
|
1275
|
+
}
|
|
1184
1276
|
const colGroupDefs = allDisplayedColumnGroups
|
|
1185
1277
|
.map((colGroup) => colGroup.getDefinition())
|
|
1186
1278
|
// we need to filter because there are some fake groups as well, no idea what for
|
|
1187
1279
|
.filter(Boolean);
|
|
1188
1280
|
const colGroupState = [];
|
|
1189
|
-
const
|
|
1281
|
+
const columnGroupExceptions = ColumnGroupValues?.ColumnGroupDisplay === 'collapsed' ||
|
|
1282
|
+
ColumnGroupValues?.ColumnGroupDisplay === 'expanded'
|
|
1283
|
+
? new Set(ColumnGroupValues.Values)
|
|
1284
|
+
: new Set();
|
|
1285
|
+
const processColGroupDefs = (colGroupDefs, currentLevel) => {
|
|
1190
1286
|
colGroupDefs.forEach((colGroupDef) => {
|
|
1191
1287
|
if ('children' in colGroupDef && colGroupDef.children) {
|
|
1288
|
+
let open;
|
|
1289
|
+
if (IsPivotLayout && !ColumnGroupValues) {
|
|
1290
|
+
open =
|
|
1291
|
+
PivotExpandLevel === -1 ? true : colGroupDef.pivotKeys?.length <= PivotExpandLevel;
|
|
1292
|
+
}
|
|
1293
|
+
if (ColumnGroupValues) {
|
|
1294
|
+
if (ColumnGroupValues.ColumnGroupDisplay === 'always-expanded') {
|
|
1295
|
+
open = true;
|
|
1296
|
+
}
|
|
1297
|
+
else if (ColumnGroupValues.ColumnGroupDisplay === 'always-collapsed') {
|
|
1298
|
+
open = false;
|
|
1299
|
+
}
|
|
1300
|
+
else if (ColumnGroupValues.ColumnGroupDisplay === 'expanded') {
|
|
1301
|
+
open = !columnGroupExceptions.has(colGroupDef.groupId);
|
|
1302
|
+
}
|
|
1303
|
+
else if (ColumnGroupValues.ColumnGroupDisplay === 'collapsed') {
|
|
1304
|
+
open = columnGroupExceptions.has(colGroupDef.groupId);
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1192
1307
|
colGroupState.push({
|
|
1193
1308
|
groupId: colGroupDef.groupId,
|
|
1194
|
-
open
|
|
1309
|
+
open,
|
|
1195
1310
|
});
|
|
1196
|
-
processColGroupDefs(colGroupDef.children);
|
|
1311
|
+
processColGroupDefs(colGroupDef.children, currentLevel + 1);
|
|
1197
1312
|
}
|
|
1198
1313
|
});
|
|
1199
1314
|
};
|
|
1200
|
-
processColGroupDefs(colGroupDefs);
|
|
1315
|
+
processColGroupDefs(colGroupDefs, 1);
|
|
1201
1316
|
if (colGroupState.length > 0) {
|
|
1202
1317
|
this.gridApi.setColumnGroupState(colGroupState);
|
|
1203
1318
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { PivotLayoutModel, TableLayoutModel } from './LayoutManagerModel';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const DEFAULT_COL_WIDTH = 200;
|
|
5
|
-
export declare function isGroupColumn(colId: string): boolean;
|
|
2
|
+
export declare const AUTO_GROUP_COLUMN_ID__SINGLE = "ag-Grid-AutoColumn";
|
|
3
|
+
export declare const AUTO_GROUP_COLUMN_ID__MULTI_PREFIX = "ag-Grid-AutoColumn-";
|
|
6
4
|
export declare function normalizeTableLayoutModel(layout: TableLayoutModel, options?: {
|
|
7
5
|
isTree: boolean;
|
|
8
6
|
}): TableLayoutModel;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { isPivotLayoutModel } from './isPivotLayoutModel';
|
|
2
|
-
export const
|
|
3
|
-
export const
|
|
4
|
-
export const DEFAULT_COL_WIDTH = 200;
|
|
5
|
-
export function isGroupColumn(colId) {
|
|
6
|
-
return colId.startsWith(GROUP_COLUMN_ID__MULTI_PREFIX) || colId === GROUP_COLUMN_ID__SINGLE;
|
|
7
|
-
}
|
|
2
|
+
export const AUTO_GROUP_COLUMN_ID__SINGLE = 'ag-Grid-AutoColumn';
|
|
3
|
+
export const AUTO_GROUP_COLUMN_ID__MULTI_PREFIX = 'ag-Grid-AutoColumn-';
|
|
8
4
|
export function normalizeTableLayoutModel(layout, options) {
|
|
9
5
|
layout = structuredClone(layout);
|
|
10
6
|
if (!layout.ColumnVisibility) {
|
|
@@ -45,11 +41,11 @@ export function normalizeTableLayoutModel(layout, options) {
|
|
|
45
41
|
let displayType = layout.RowGroupDisplayType;
|
|
46
42
|
if (!displayType) {
|
|
47
43
|
layout.TableColumns.some((columnId) => {
|
|
48
|
-
if (columnId ===
|
|
44
|
+
if (columnId === AUTO_GROUP_COLUMN_ID__SINGLE) {
|
|
49
45
|
displayType = 'single';
|
|
50
46
|
return true;
|
|
51
47
|
}
|
|
52
|
-
else if (columnId.startsWith(
|
|
48
|
+
else if (columnId.startsWith(AUTO_GROUP_COLUMN_ID__MULTI_PREFIX)) {
|
|
53
49
|
displayType = 'multi';
|
|
54
50
|
return true;
|
|
55
51
|
}
|
|
@@ -58,14 +54,14 @@ export function normalizeTableLayoutModel(layout, options) {
|
|
|
58
54
|
layout.RowGroupDisplayType = displayType;
|
|
59
55
|
}
|
|
60
56
|
if (displayType === 'single') {
|
|
61
|
-
if (!ColumnOrderSet.has(
|
|
62
|
-
layout.TableColumns = [
|
|
57
|
+
if (!ColumnOrderSet.has(AUTO_GROUP_COLUMN_ID__SINGLE)) {
|
|
58
|
+
layout.TableColumns = [AUTO_GROUP_COLUMN_ID__SINGLE, ...layout.TableColumns];
|
|
63
59
|
}
|
|
64
60
|
}
|
|
65
61
|
else {
|
|
66
62
|
const GroupedCols = new Set(layout.RowGroupedColumns);
|
|
67
63
|
[...layout.RowGroupedColumns].reverse().forEach((colId) => {
|
|
68
|
-
const groupColId = `${
|
|
64
|
+
const groupColId = `${AUTO_GROUP_COLUMN_ID__MULTI_PREFIX}${colId}`;
|
|
69
65
|
if (!ColumnOrderSet.has(groupColId) && !ColumnOrderSet.has(colId)) {
|
|
70
66
|
// add the col to the beginning of the layout.OrderedColumns
|
|
71
67
|
layout.TableColumns.unshift(colId);
|
|
@@ -76,7 +72,7 @@ export function normalizeTableLayoutModel(layout, options) {
|
|
|
76
72
|
const MappedColumnOrder = layout.TableColumns.flatMap((colId) => {
|
|
77
73
|
if (GroupedCols.has(colId)) {
|
|
78
74
|
// if the column is grouped by
|
|
79
|
-
const groupColId = `${
|
|
75
|
+
const groupColId = `${AUTO_GROUP_COLUMN_ID__MULTI_PREFIX}${colId}`;
|
|
80
76
|
// but there's no column for this group in the layout
|
|
81
77
|
if (!ColumnOrderSet.has(groupColId)) {
|
|
82
78
|
// then we assume that the current column is basically the group column
|
|
@@ -87,8 +83,8 @@ export function normalizeTableLayoutModel(layout, options) {
|
|
|
87
83
|
}
|
|
88
84
|
}
|
|
89
85
|
// if this is a group column
|
|
90
|
-
if (colId.startsWith(
|
|
91
|
-
const simpleColId = colId.replace(
|
|
86
|
+
if (colId.startsWith(AUTO_GROUP_COLUMN_ID__MULTI_PREFIX)) {
|
|
87
|
+
const simpleColId = colId.replace(AUTO_GROUP_COLUMN_ID__MULTI_PREFIX, '');
|
|
92
88
|
// but the corresponding simple column is not in the layout
|
|
93
89
|
// then let's include it, with visibility set to false
|
|
94
90
|
if (!ColumnOrderSet.has(simpleColId)) {
|
|
@@ -106,8 +102,8 @@ export function normalizeTableLayoutModel(layout, options) {
|
|
|
106
102
|
};
|
|
107
103
|
}
|
|
108
104
|
}
|
|
109
|
-
if (options?.isTree && !layout.TableColumns.includes(
|
|
110
|
-
layout.TableColumns.unshift(
|
|
105
|
+
if (options?.isTree && !layout.TableColumns.includes(AUTO_GROUP_COLUMN_ID__SINGLE)) {
|
|
106
|
+
layout.TableColumns.unshift(AUTO_GROUP_COLUMN_ID__SINGLE);
|
|
111
107
|
}
|
|
112
108
|
return layout;
|
|
113
109
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isPivotLayoutModel } from './isPivotLayoutModel';
|
|
2
|
-
import {
|
|
2
|
+
import { AUTO_GROUP_COLUMN_ID__MULTI_PREFIX, AUTO_GROUP_COLUMN_ID__SINGLE, } from './normalizeLayoutModel';
|
|
3
3
|
export function simplifyTableLayoutModel(layout) {
|
|
4
4
|
layout = structuredClone(layout);
|
|
5
5
|
if (layout.ColumnVisibility && !Object.keys(layout.ColumnVisibility).length) {
|
|
@@ -32,6 +32,12 @@ export function simplifyTableLayoutModel(layout) {
|
|
|
32
32
|
if (!layout.RowGroupValues && Object.prototype.hasOwnProperty.call(layout, 'RowGroupValues')) {
|
|
33
33
|
delete layout.RowGroupValues;
|
|
34
34
|
}
|
|
35
|
+
// if it's a property, but is undefined
|
|
36
|
+
// make sure we delete it
|
|
37
|
+
if (!layout.ColumnGroupValues &&
|
|
38
|
+
Object.prototype.hasOwnProperty.call(layout, 'ColumnGroupValues')) {
|
|
39
|
+
delete layout.ColumnGroupValues;
|
|
40
|
+
}
|
|
35
41
|
if (layout.TableAggregationColumns && !layout.TableAggregationColumns.length) {
|
|
36
42
|
delete layout.TableAggregationColumns;
|
|
37
43
|
}
|
|
@@ -45,11 +51,11 @@ export function simplifyTableLayoutModel(layout) {
|
|
|
45
51
|
layout.RowGroupedColumns.length) {
|
|
46
52
|
let displayType = 'single';
|
|
47
53
|
layout.TableColumns.some((columnId) => {
|
|
48
|
-
if (columnId ===
|
|
54
|
+
if (columnId === AUTO_GROUP_COLUMN_ID__SINGLE) {
|
|
49
55
|
displayType = 'single';
|
|
50
56
|
return true;
|
|
51
57
|
}
|
|
52
|
-
else if (columnId.startsWith(
|
|
58
|
+
else if (columnId.startsWith(AUTO_GROUP_COLUMN_ID__MULTI_PREFIX)) {
|
|
53
59
|
displayType = 'multi';
|
|
54
60
|
return true;
|
|
55
61
|
}
|
|
@@ -84,6 +90,12 @@ export function simplifyPivotLayoutModel(layout) {
|
|
|
84
90
|
if (layout.PivotGrandTotal === undefined) {
|
|
85
91
|
delete layout.PivotGrandTotal;
|
|
86
92
|
}
|
|
93
|
+
// if it's a property, but is undefined
|
|
94
|
+
// make sure we delete it
|
|
95
|
+
if (!layout.ColumnGroupValues &&
|
|
96
|
+
Object.prototype.hasOwnProperty.call(layout, 'ColumnGroupValues')) {
|
|
97
|
+
delete layout.ColumnGroupValues;
|
|
98
|
+
}
|
|
87
99
|
return layout;
|
|
88
100
|
}
|
|
89
101
|
export function simplifyLayoutModel(layout) {
|
|
@@ -2357,6 +2357,11 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
2357
2357
|
ref: string;
|
|
2358
2358
|
})[];
|
|
2359
2359
|
};
|
|
2360
|
+
CustomExportParams: {
|
|
2361
|
+
name: string;
|
|
2362
|
+
kind: string;
|
|
2363
|
+
desc: string;
|
|
2364
|
+
};
|
|
2360
2365
|
CustomGroupColumnMenuItem: {
|
|
2361
2366
|
name: string;
|
|
2362
2367
|
kind: string;
|
|
@@ -3029,6 +3034,26 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
3029
3034
|
ref: string;
|
|
3030
3035
|
})[];
|
|
3031
3036
|
};
|
|
3037
|
+
ExportDataFormatContext: {
|
|
3038
|
+
name: string;
|
|
3039
|
+
kind: string;
|
|
3040
|
+
desc: string;
|
|
3041
|
+
props: {
|
|
3042
|
+
name: string;
|
|
3043
|
+
kind: string;
|
|
3044
|
+
desc: string;
|
|
3045
|
+
}[];
|
|
3046
|
+
};
|
|
3047
|
+
ExportDateFormatContext: {
|
|
3048
|
+
name: string;
|
|
3049
|
+
kind: string;
|
|
3050
|
+
desc: string;
|
|
3051
|
+
props: {
|
|
3052
|
+
name: string;
|
|
3053
|
+
kind: string;
|
|
3054
|
+
desc: string;
|
|
3055
|
+
}[];
|
|
3056
|
+
};
|
|
3032
3057
|
ExportDestinationType: {
|
|
3033
3058
|
name: string;
|
|
3034
3059
|
kind: string;
|
|
@@ -5409,6 +5434,24 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
5409
5434
|
kind: string;
|
|
5410
5435
|
desc: string;
|
|
5411
5436
|
};
|
|
5437
|
+
SystemExportDestinationsContext: {
|
|
5438
|
+
name: string;
|
|
5439
|
+
kind: string;
|
|
5440
|
+
desc: string;
|
|
5441
|
+
props: ({
|
|
5442
|
+
name: string;
|
|
5443
|
+
kind: string;
|
|
5444
|
+
desc: string;
|
|
5445
|
+
isOpt?: undefined;
|
|
5446
|
+
ref?: undefined;
|
|
5447
|
+
} | {
|
|
5448
|
+
name: string;
|
|
5449
|
+
kind: string;
|
|
5450
|
+
desc: string;
|
|
5451
|
+
isOpt: boolean;
|
|
5452
|
+
ref: string;
|
|
5453
|
+
})[];
|
|
5454
|
+
};
|
|
5412
5455
|
SystemFilterPredicateId: {
|
|
5413
5456
|
name: string;
|
|
5414
5457
|
kind: string;
|
|
@@ -5460,6 +5503,24 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
5460
5503
|
kind: string;
|
|
5461
5504
|
desc: string;
|
|
5462
5505
|
};
|
|
5506
|
+
SystemReportFormatsContext: {
|
|
5507
|
+
name: string;
|
|
5508
|
+
kind: string;
|
|
5509
|
+
desc: string;
|
|
5510
|
+
props: ({
|
|
5511
|
+
name: string;
|
|
5512
|
+
kind: string;
|
|
5513
|
+
desc: string;
|
|
5514
|
+
isOpt?: undefined;
|
|
5515
|
+
ref?: undefined;
|
|
5516
|
+
} | {
|
|
5517
|
+
name: string;
|
|
5518
|
+
kind: string;
|
|
5519
|
+
desc: string;
|
|
5520
|
+
isOpt: boolean;
|
|
5521
|
+
ref: string;
|
|
5522
|
+
})[];
|
|
5523
|
+
};
|
|
5463
5524
|
SystemReportName: {
|
|
5464
5525
|
name: string;
|
|
5465
5526
|
kind: string;
|
|
@@ -5470,6 +5531,16 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
5470
5531
|
kind: string;
|
|
5471
5532
|
desc: string;
|
|
5472
5533
|
};
|
|
5534
|
+
SystemReportNamesContext: {
|
|
5535
|
+
name: string;
|
|
5536
|
+
kind: string;
|
|
5537
|
+
desc: string;
|
|
5538
|
+
props: {
|
|
5539
|
+
name: string;
|
|
5540
|
+
kind: string;
|
|
5541
|
+
desc: string;
|
|
5542
|
+
}[];
|
|
5543
|
+
};
|
|
5473
5544
|
SystemStatusMessageInfo: {
|
|
5474
5545
|
name: string;
|
|
5475
5546
|
kind: string;
|