@adaptabletools/adaptable-cjs 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 -31
- package/src/Api/Implementation/ExportApiImpl.d.ts +11 -4
- package/src/Api/Implementation/ExportApiImpl.js +50 -8
- 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 +24 -20
- 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 +89 -12
- 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 +133 -18
- package/src/layout-manager/src/normalizeLayoutModel.d.ts +2 -4
- package/src/layout-manager/src/normalizeLayoutModel.js +13 -18
- package/src/layout-manager/src/simplifyLayoutModel.js +14 -2
- 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.cjs.tsbuildinfo +1 -1
- package/src/Utilities/buildSortedColumnStateForLayout.d.ts +0 -7
- package/src/Utilities/buildSortedColumnStateForLayout.js +0 -135
|
@@ -308,6 +308,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
308
308
|
ColumnWidths,
|
|
309
309
|
ColumnVisibility: layout.ColumnVisibility,
|
|
310
310
|
RowGroupValues: layout.RowGroupValues,
|
|
311
|
+
ColumnGroupValues: layout.ColumnGroupValues,
|
|
311
312
|
PivotGroupedColumns: layout.RowGroupedColumns,
|
|
312
313
|
PivotAggregationColumns: layout.TableAggregationColumns,
|
|
313
314
|
GrandTotalRow: layout.GrandTotalRow,
|
|
@@ -340,6 +341,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
340
341
|
let ColumnSorts = [];
|
|
341
342
|
let RowGroupedColumns = [];
|
|
342
343
|
let RowGroupValues = undefined;
|
|
344
|
+
let ColumnGroupValues = undefined;
|
|
343
345
|
let TableAggregationColumns = [];
|
|
344
346
|
let ColumnPinning = {};
|
|
345
347
|
const gridState = this.gridApi.getState();
|
|
@@ -357,14 +359,14 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
357
359
|
// we try to infer it from the default width (when display type is single)
|
|
358
360
|
// or from the respective group column (when display type is multi)
|
|
359
361
|
if (initialWidth === undefined) {
|
|
360
|
-
if (colId === normalizeLayoutModel_1.
|
|
362
|
+
if (colId === normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__SINGLE) {
|
|
361
363
|
const groupByColId = this.gridApi.getRowGroupColumns()[0]?.getColId();
|
|
362
364
|
initialWidth =
|
|
363
365
|
this.initialColumnWidths[colId] || this.initialColumnWidths[groupByColId];
|
|
364
366
|
}
|
|
365
|
-
else if (colId.startsWith(normalizeLayoutModel_1.
|
|
367
|
+
else if (colId.startsWith(normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX)) {
|
|
366
368
|
initialWidth =
|
|
367
|
-
this.initialColumnWidths[colId.replace(normalizeLayoutModel_1.
|
|
369
|
+
this.initialColumnWidths[colId.replace(normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX, '')];
|
|
368
370
|
}
|
|
369
371
|
}
|
|
370
372
|
// and only add the col width to the layout ColumnWidths
|
|
@@ -389,6 +391,16 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
389
391
|
}
|
|
390
392
|
return acc;
|
|
391
393
|
}, {});
|
|
394
|
+
if (gridState.pivot?.pivotMode && gridState.sort?.sortModel) {
|
|
395
|
+
// for pivot mode, we can't simply take the current sort from the ColumnState
|
|
396
|
+
// but we have to go via the sortModel from the grid state
|
|
397
|
+
ColumnSorts = gridState.sort.sortModel.map((sort) => {
|
|
398
|
+
return {
|
|
399
|
+
ColumnId: sort.colId,
|
|
400
|
+
SortOrder: sort.sort === 'asc' ? 'Asc' : 'Desc',
|
|
401
|
+
};
|
|
402
|
+
});
|
|
403
|
+
}
|
|
392
404
|
if (gridState.aggregation) {
|
|
393
405
|
TableAggregationColumns = gridState.aggregation.aggregationModel.map((agg) => {
|
|
394
406
|
const prevAggForColumn = prevAggColumnsMap?.[agg.colId];
|
|
@@ -412,11 +424,11 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
412
424
|
if (this.currentLayout.RowGroupedColumns?.length) {
|
|
413
425
|
const groupDisplayType = this.gridApi.getGridOption('groupDisplayType');
|
|
414
426
|
if (groupDisplayType === 'singleColumn') {
|
|
415
|
-
colsInLayout.add(normalizeLayoutModel_1.
|
|
427
|
+
colsInLayout.add(normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__SINGLE);
|
|
416
428
|
}
|
|
417
429
|
else {
|
|
418
430
|
this.currentLayout.RowGroupedColumns.forEach((colId) => {
|
|
419
|
-
colsInLayout.add(`${normalizeLayoutModel_1.
|
|
431
|
+
colsInLayout.add(`${normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX}${colId}`);
|
|
420
432
|
});
|
|
421
433
|
}
|
|
422
434
|
}
|
|
@@ -431,7 +443,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
431
443
|
// in the current layout - in which case in the prev state of the current layout
|
|
432
444
|
// we had the group column
|
|
433
445
|
// but now we will need to include the current column
|
|
434
|
-
if (colsInLayout.has(`${normalizeLayoutModel_1.
|
|
446
|
+
if (colsInLayout.has(`${normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX}${colId}`)) {
|
|
435
447
|
// ColumnVisibility[colId] = false;
|
|
436
448
|
return true;
|
|
437
449
|
}
|
|
@@ -510,6 +522,50 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
510
522
|
RowGroupValues = this.currentLayout.RowGroupValues;
|
|
511
523
|
}
|
|
512
524
|
}
|
|
525
|
+
if (this.currentLayout?.ColumnGroupValues) {
|
|
526
|
+
const currentColumnGroupValues = this.currentLayout.ColumnGroupValues;
|
|
527
|
+
if (currentColumnGroupValues.ColumnGroupDisplay === 'always-expanded') {
|
|
528
|
+
ColumnGroupValues = {
|
|
529
|
+
ColumnGroupDisplay: 'always-expanded',
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
else if (currentColumnGroupValues.ColumnGroupDisplay === 'always-collapsed') {
|
|
533
|
+
ColumnGroupValues = {
|
|
534
|
+
ColumnGroupDisplay: 'always-collapsed',
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
else if (currentColumnGroupValues.ColumnGroupDisplay === 'expanded' ||
|
|
538
|
+
currentColumnGroupValues.ColumnGroupDisplay === 'collapsed') {
|
|
539
|
+
const isPivot = this.isCurrentLayoutPivot();
|
|
540
|
+
const currentColumnGroupState = this.gridApi
|
|
541
|
+
.getColumnGroupState()
|
|
542
|
+
// if we're in a pivot layout, only include groups that are pivot groups
|
|
543
|
+
// as there are other fake groups in the grid as well
|
|
544
|
+
.filter((state) => (isPivot ? state.groupId.startsWith('pivotGroup_') : true));
|
|
545
|
+
if (currentColumnGroupValues.ColumnGroupDisplay === 'expanded') {
|
|
546
|
+
const collapsedGroupIds = currentColumnGroupState
|
|
547
|
+
.filter((state) => {
|
|
548
|
+
return state.open === false;
|
|
549
|
+
})
|
|
550
|
+
.map((state) => state.groupId);
|
|
551
|
+
ColumnGroupValues = {
|
|
552
|
+
ColumnGroupDisplay: 'expanded',
|
|
553
|
+
Values: collapsedGroupIds,
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
else if (currentColumnGroupValues.ColumnGroupDisplay === 'collapsed') {
|
|
557
|
+
const expandedGroupIds = currentColumnGroupState
|
|
558
|
+
.filter((state) => {
|
|
559
|
+
return state.open === true;
|
|
560
|
+
})
|
|
561
|
+
.map((state) => state.groupId);
|
|
562
|
+
ColumnGroupValues = {
|
|
563
|
+
ColumnGroupDisplay: 'collapsed',
|
|
564
|
+
Values: expandedGroupIds,
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
513
569
|
const layout = (0, simplifyLayoutModel_1.simplifyTableLayoutModel)({
|
|
514
570
|
Ignore_Name: this.currentLayout?.Ignore_Name || 'Default',
|
|
515
571
|
Ignore_GridFilter: this.currentLayout?.Ignore_GridFilter,
|
|
@@ -530,6 +586,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
530
586
|
TableAggregationColumns,
|
|
531
587
|
ColumnPinning: ColumnPinning,
|
|
532
588
|
RowGroupValues,
|
|
589
|
+
ColumnGroupValues,
|
|
533
590
|
GrandTotalRow: this.gridApi.getGridOption('grandTotalRow'),
|
|
534
591
|
SuppressAggFuncInHeader: this.gridApi.getGridOption('suppressAggFuncInHeader'),
|
|
535
592
|
});
|
|
@@ -781,11 +838,22 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
781
838
|
this.gridApi.setGridOption('suppressAggFuncInHeader', !!layout.SuppressAggFuncInHeader);
|
|
782
839
|
}
|
|
783
840
|
if (layout.GrandTotalRow) {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
841
|
+
let grandTotalRow = null;
|
|
842
|
+
if (layout.GrandTotalRow === true) {
|
|
843
|
+
grandTotalRow = 'top';
|
|
844
|
+
}
|
|
845
|
+
else if (typeof layout.GrandTotalRow === 'string') {
|
|
846
|
+
switch (layout.GrandTotalRow) {
|
|
847
|
+
case 'top':
|
|
848
|
+
case 'bottom':
|
|
849
|
+
case 'pinnedTop':
|
|
850
|
+
case 'pinnedBottom':
|
|
851
|
+
grandTotalRow = layout.GrandTotalRow;
|
|
852
|
+
break;
|
|
853
|
+
default:
|
|
854
|
+
grandTotalRow = null;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
789
857
|
this.gridApi.setGridOption('grandTotalRow', grandTotalRow);
|
|
790
858
|
}
|
|
791
859
|
else {
|
|
@@ -834,6 +902,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
834
902
|
if (hasGroupedColumns && layout.RowGroupValues && !options?.skipApplyRowGroupsExpandedState) {
|
|
835
903
|
this.applyRowGroupValues(layout.RowGroupValues);
|
|
836
904
|
}
|
|
905
|
+
this.applyColumnGroupCollapseExpandState(layout);
|
|
837
906
|
});
|
|
838
907
|
}
|
|
839
908
|
getRowGroupNodePathsAs(options) {
|
|
@@ -1030,6 +1099,9 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
1030
1099
|
}, {});
|
|
1031
1100
|
columnState.state.forEach((colState) => {
|
|
1032
1101
|
const colSortIndex = sortsToIndexes[colState.colId];
|
|
1102
|
+
// we delete them just to know if there are any left
|
|
1103
|
+
// after the forEach is done
|
|
1104
|
+
delete sortsToIndexes[colState.colId];
|
|
1033
1105
|
const colSort = sorts[colSortIndex];
|
|
1034
1106
|
if (colSort != undefined) {
|
|
1035
1107
|
colState.sort = colSort.SortOrder === 'Asc' ? 'asc' : 'desc';
|
|
@@ -1040,6 +1112,21 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
1040
1112
|
colState.sortIndex = null;
|
|
1041
1113
|
}
|
|
1042
1114
|
});
|
|
1115
|
+
if (Object.keys(sortsToIndexes).length) {
|
|
1116
|
+
// if there are some sorts left which were not applied to the columnState
|
|
1117
|
+
// probably those are for pivot result columns, so we need to apply them as well
|
|
1118
|
+
Object.keys(sortsToIndexes).forEach((colId) => {
|
|
1119
|
+
const colSortIndex = sortsToIndexes[colId];
|
|
1120
|
+
const colSort = sorts[colSortIndex];
|
|
1121
|
+
if (colSort != undefined) {
|
|
1122
|
+
columnState.state.push({
|
|
1123
|
+
colId,
|
|
1124
|
+
sort: colSort.SortOrder === 'Asc' ? 'asc' : 'desc',
|
|
1125
|
+
sortIndex: colSortIndex,
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1043
1130
|
}
|
|
1044
1131
|
getDefaultColumnWidthForCol(colId, colDef) {
|
|
1045
1132
|
colDef = colDef ?? this.gridApi.getColumnDef(colId);
|
|
@@ -1140,7 +1227,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
1140
1227
|
this.gridApi.setColumnWidths(colWidthForPivotResultColumns);
|
|
1141
1228
|
}
|
|
1142
1229
|
}
|
|
1143
|
-
this.
|
|
1230
|
+
this.applyColumnGroupCollapseExpandState(layout);
|
|
1144
1231
|
const hasGroupedColumns = layout.PivotGroupedColumns && layout.PivotGroupedColumns.length;
|
|
1145
1232
|
// but also let's not forget to apply the row group values
|
|
1146
1233
|
if (hasGroupedColumns && layout.RowGroupValues && !options?.skipApplyRowGroupsExpandedState) {
|
|
@@ -1181,26 +1268,54 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
1181
1268
|
this.gridApi.setGridOption('pivotColumnGroupTotals', null);
|
|
1182
1269
|
}
|
|
1183
1270
|
}
|
|
1184
|
-
|
|
1185
|
-
const
|
|
1271
|
+
applyColumnGroupCollapseExpandState(layout) {
|
|
1272
|
+
const IsPivotLayout = (0, isPivotLayoutModel_1.isPivotLayoutModel)(layout);
|
|
1186
1273
|
const allDisplayedColumnGroups = this.gridApi.getAllDisplayedColumnGroups();
|
|
1274
|
+
let PivotExpandLevel = layout.PivotExpandLevel;
|
|
1275
|
+
const ColumnGroupValues = layout.ColumnGroupValues;
|
|
1276
|
+
if (IsPivotLayout && !ColumnGroupValues && PivotExpandLevel === undefined) {
|
|
1277
|
+
PivotExpandLevel = -1;
|
|
1278
|
+
}
|
|
1187
1279
|
const colGroupDefs = allDisplayedColumnGroups
|
|
1188
1280
|
.map((colGroup) => colGroup.getDefinition())
|
|
1189
1281
|
// we need to filter because there are some fake groups as well, no idea what for
|
|
1190
1282
|
.filter(Boolean);
|
|
1191
1283
|
const colGroupState = [];
|
|
1192
|
-
const
|
|
1284
|
+
const columnGroupExceptions = ColumnGroupValues?.ColumnGroupDisplay === 'collapsed' ||
|
|
1285
|
+
ColumnGroupValues?.ColumnGroupDisplay === 'expanded'
|
|
1286
|
+
? new Set(ColumnGroupValues.Values)
|
|
1287
|
+
: new Set();
|
|
1288
|
+
const processColGroupDefs = (colGroupDefs, currentLevel) => {
|
|
1193
1289
|
colGroupDefs.forEach((colGroupDef) => {
|
|
1194
1290
|
if ('children' in colGroupDef && colGroupDef.children) {
|
|
1291
|
+
let open;
|
|
1292
|
+
if (IsPivotLayout && !ColumnGroupValues) {
|
|
1293
|
+
open =
|
|
1294
|
+
PivotExpandLevel === -1 ? true : colGroupDef.pivotKeys?.length <= PivotExpandLevel;
|
|
1295
|
+
}
|
|
1296
|
+
if (ColumnGroupValues) {
|
|
1297
|
+
if (ColumnGroupValues.ColumnGroupDisplay === 'always-expanded') {
|
|
1298
|
+
open = true;
|
|
1299
|
+
}
|
|
1300
|
+
else if (ColumnGroupValues.ColumnGroupDisplay === 'always-collapsed') {
|
|
1301
|
+
open = false;
|
|
1302
|
+
}
|
|
1303
|
+
else if (ColumnGroupValues.ColumnGroupDisplay === 'expanded') {
|
|
1304
|
+
open = !columnGroupExceptions.has(colGroupDef.groupId);
|
|
1305
|
+
}
|
|
1306
|
+
else if (ColumnGroupValues.ColumnGroupDisplay === 'collapsed') {
|
|
1307
|
+
open = columnGroupExceptions.has(colGroupDef.groupId);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1195
1310
|
colGroupState.push({
|
|
1196
1311
|
groupId: colGroupDef.groupId,
|
|
1197
|
-
open
|
|
1312
|
+
open,
|
|
1198
1313
|
});
|
|
1199
|
-
processColGroupDefs(colGroupDef.children);
|
|
1314
|
+
processColGroupDefs(colGroupDef.children, currentLevel + 1);
|
|
1200
1315
|
}
|
|
1201
1316
|
});
|
|
1202
1317
|
};
|
|
1203
|
-
processColGroupDefs(colGroupDefs);
|
|
1318
|
+
processColGroupDefs(colGroupDefs, 1);
|
|
1204
1319
|
if (colGroupState.length > 0) {
|
|
1205
1320
|
this.gridApi.setColumnGroupState(colGroupState);
|
|
1206
1321
|
}
|
|
@@ -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,14 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeLayoutModel = exports.normalizePivotLayoutModel = exports.normalizeTableLayoutModel = exports.
|
|
3
|
+
exports.normalizeLayoutModel = exports.normalizePivotLayoutModel = exports.normalizeTableLayoutModel = exports.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX = exports.AUTO_GROUP_COLUMN_ID__SINGLE = void 0;
|
|
4
4
|
const isPivotLayoutModel_1 = require("./isPivotLayoutModel");
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.DEFAULT_COL_WIDTH = 200;
|
|
8
|
-
function isGroupColumn(colId) {
|
|
9
|
-
return colId.startsWith(exports.GROUP_COLUMN_ID__MULTI_PREFIX) || colId === exports.GROUP_COLUMN_ID__SINGLE;
|
|
10
|
-
}
|
|
11
|
-
exports.isGroupColumn = isGroupColumn;
|
|
5
|
+
exports.AUTO_GROUP_COLUMN_ID__SINGLE = 'ag-Grid-AutoColumn';
|
|
6
|
+
exports.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX = 'ag-Grid-AutoColumn-';
|
|
12
7
|
function normalizeTableLayoutModel(layout, options) {
|
|
13
8
|
layout = structuredClone(layout);
|
|
14
9
|
if (!layout.ColumnVisibility) {
|
|
@@ -49,11 +44,11 @@ function normalizeTableLayoutModel(layout, options) {
|
|
|
49
44
|
let displayType = layout.RowGroupDisplayType;
|
|
50
45
|
if (!displayType) {
|
|
51
46
|
layout.TableColumns.some((columnId) => {
|
|
52
|
-
if (columnId === exports.
|
|
47
|
+
if (columnId === exports.AUTO_GROUP_COLUMN_ID__SINGLE) {
|
|
53
48
|
displayType = 'single';
|
|
54
49
|
return true;
|
|
55
50
|
}
|
|
56
|
-
else if (columnId.startsWith(exports.
|
|
51
|
+
else if (columnId.startsWith(exports.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX)) {
|
|
57
52
|
displayType = 'multi';
|
|
58
53
|
return true;
|
|
59
54
|
}
|
|
@@ -62,14 +57,14 @@ function normalizeTableLayoutModel(layout, options) {
|
|
|
62
57
|
layout.RowGroupDisplayType = displayType;
|
|
63
58
|
}
|
|
64
59
|
if (displayType === 'single') {
|
|
65
|
-
if (!ColumnOrderSet.has(exports.
|
|
66
|
-
layout.TableColumns = [exports.
|
|
60
|
+
if (!ColumnOrderSet.has(exports.AUTO_GROUP_COLUMN_ID__SINGLE)) {
|
|
61
|
+
layout.TableColumns = [exports.AUTO_GROUP_COLUMN_ID__SINGLE, ...layout.TableColumns];
|
|
67
62
|
}
|
|
68
63
|
}
|
|
69
64
|
else {
|
|
70
65
|
const GroupedCols = new Set(layout.RowGroupedColumns);
|
|
71
66
|
[...layout.RowGroupedColumns].reverse().forEach((colId) => {
|
|
72
|
-
const groupColId = `${exports.
|
|
67
|
+
const groupColId = `${exports.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX}${colId}`;
|
|
73
68
|
if (!ColumnOrderSet.has(groupColId) && !ColumnOrderSet.has(colId)) {
|
|
74
69
|
// add the col to the beginning of the layout.OrderedColumns
|
|
75
70
|
layout.TableColumns.unshift(colId);
|
|
@@ -80,7 +75,7 @@ function normalizeTableLayoutModel(layout, options) {
|
|
|
80
75
|
const MappedColumnOrder = layout.TableColumns.flatMap((colId) => {
|
|
81
76
|
if (GroupedCols.has(colId)) {
|
|
82
77
|
// if the column is grouped by
|
|
83
|
-
const groupColId = `${exports.
|
|
78
|
+
const groupColId = `${exports.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX}${colId}`;
|
|
84
79
|
// but there's no column for this group in the layout
|
|
85
80
|
if (!ColumnOrderSet.has(groupColId)) {
|
|
86
81
|
// then we assume that the current column is basically the group column
|
|
@@ -91,8 +86,8 @@ function normalizeTableLayoutModel(layout, options) {
|
|
|
91
86
|
}
|
|
92
87
|
}
|
|
93
88
|
// if this is a group column
|
|
94
|
-
if (colId.startsWith(exports.
|
|
95
|
-
const simpleColId = colId.replace(exports.
|
|
89
|
+
if (colId.startsWith(exports.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX)) {
|
|
90
|
+
const simpleColId = colId.replace(exports.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX, '');
|
|
96
91
|
// but the corresponding simple column is not in the layout
|
|
97
92
|
// then let's include it, with visibility set to false
|
|
98
93
|
if (!ColumnOrderSet.has(simpleColId)) {
|
|
@@ -110,8 +105,8 @@ function normalizeTableLayoutModel(layout, options) {
|
|
|
110
105
|
};
|
|
111
106
|
}
|
|
112
107
|
}
|
|
113
|
-
if (options?.isTree && !layout.TableColumns.includes(exports.
|
|
114
|
-
layout.TableColumns.unshift(exports.
|
|
108
|
+
if (options?.isTree && !layout.TableColumns.includes(exports.AUTO_GROUP_COLUMN_ID__SINGLE)) {
|
|
109
|
+
layout.TableColumns.unshift(exports.AUTO_GROUP_COLUMN_ID__SINGLE);
|
|
115
110
|
}
|
|
116
111
|
return layout;
|
|
117
112
|
}
|
|
@@ -35,6 +35,12 @@ function simplifyTableLayoutModel(layout) {
|
|
|
35
35
|
if (!layout.RowGroupValues && Object.prototype.hasOwnProperty.call(layout, 'RowGroupValues')) {
|
|
36
36
|
delete layout.RowGroupValues;
|
|
37
37
|
}
|
|
38
|
+
// if it's a property, but is undefined
|
|
39
|
+
// make sure we delete it
|
|
40
|
+
if (!layout.ColumnGroupValues &&
|
|
41
|
+
Object.prototype.hasOwnProperty.call(layout, 'ColumnGroupValues')) {
|
|
42
|
+
delete layout.ColumnGroupValues;
|
|
43
|
+
}
|
|
38
44
|
if (layout.TableAggregationColumns && !layout.TableAggregationColumns.length) {
|
|
39
45
|
delete layout.TableAggregationColumns;
|
|
40
46
|
}
|
|
@@ -48,11 +54,11 @@ function simplifyTableLayoutModel(layout) {
|
|
|
48
54
|
layout.RowGroupedColumns.length) {
|
|
49
55
|
let displayType = 'single';
|
|
50
56
|
layout.TableColumns.some((columnId) => {
|
|
51
|
-
if (columnId === normalizeLayoutModel_1.
|
|
57
|
+
if (columnId === normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__SINGLE) {
|
|
52
58
|
displayType = 'single';
|
|
53
59
|
return true;
|
|
54
60
|
}
|
|
55
|
-
else if (columnId.startsWith(normalizeLayoutModel_1.
|
|
61
|
+
else if (columnId.startsWith(normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX)) {
|
|
56
62
|
displayType = 'multi';
|
|
57
63
|
return true;
|
|
58
64
|
}
|
|
@@ -88,6 +94,12 @@ function simplifyPivotLayoutModel(layout) {
|
|
|
88
94
|
if (layout.PivotGrandTotal === undefined) {
|
|
89
95
|
delete layout.PivotGrandTotal;
|
|
90
96
|
}
|
|
97
|
+
// if it's a property, but is undefined
|
|
98
|
+
// make sure we delete it
|
|
99
|
+
if (!layout.ColumnGroupValues &&
|
|
100
|
+
Object.prototype.hasOwnProperty.call(layout, 'ColumnGroupValues')) {
|
|
101
|
+
delete layout.ColumnGroupValues;
|
|
102
|
+
}
|
|
91
103
|
return layout;
|
|
92
104
|
}
|
|
93
105
|
exports.simplifyPivotLayoutModel = simplifyPivotLayoutModel;
|
|
@@ -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;
|