@adaptabletools/adaptable 20.0.12 → 20.1.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 +2 -2
- package/src/AdaptableState/Common/AggregationColumns.d.ts +3 -2
- package/src/AdaptableState/Common/AggregationColumns.js +0 -3
- package/src/AdaptableState/LayoutState.d.ts +6 -2
- package/src/Api/Implementation/ExportApiImpl.js +2 -2
- package/src/Api/Implementation/LayoutApiImpl.js +1 -1
- package/src/Api/Internal/ExportInternalApi.d.ts +2 -0
- package/src/Api/Internal/ExportInternalApi.js +37 -0
- package/src/View/Export/ReportFormatSelector.js +1 -3
- package/src/View/Export/ReportNameSelector.js +1 -1
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +3 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +33 -31
- package/src/agGrid/AdaptableAgGrid.js +5 -1
- package/src/agGrid/AgGridAdapter.js +5 -1
- package/src/agGrid/AgGridColumnAdapter.js +21 -3
- package/src/agGrid/AgGridExportAdapter.js +11 -5
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +4 -4
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "20.0
|
|
3
|
+
"version": "20.1.0",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"uuid": "9.0.1"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"ag-grid-enterprise": ">=33.
|
|
66
|
+
"ag-grid-enterprise": ">=33.2.0"
|
|
67
67
|
},
|
|
68
68
|
"publishTimestamp": 0,
|
|
69
69
|
"type": "module",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Defines which Columns in a Layout display Aggregated values when Row-Grouped
|
|
3
3
|
*/
|
|
4
|
+
import { PivotTotalPosition } from '../LayoutState';
|
|
4
5
|
export type AggregationColumnValue = string | true | WeightedAverageAggregation;
|
|
5
6
|
/**
|
|
6
7
|
* Defines an Aggregated Column in a Table Layout
|
|
@@ -24,9 +25,9 @@ export type PivotAggregationColumns = {
|
|
|
24
25
|
/**
|
|
25
26
|
* Whether to show the total for this column; it can be also customized for specific Pivot Columns
|
|
26
27
|
*/
|
|
27
|
-
Total?:
|
|
28
|
+
Total?: PivotTotalPosition | {
|
|
28
29
|
PivotColumnId: string;
|
|
29
|
-
ShowTotal?:
|
|
30
|
+
ShowTotal?: PivotTotalPosition;
|
|
30
31
|
}[];
|
|
31
32
|
}[];
|
|
32
33
|
export declare const WEIGHTED_AVERAGE_AGG_FN_NAME = "weightedAvg";
|
|
@@ -155,12 +155,16 @@ export interface PivotLayout extends LayoutBase {
|
|
|
155
155
|
/**
|
|
156
156
|
* Display automatically calculated Totals of all Pivot Columns, in the position specified
|
|
157
157
|
*/
|
|
158
|
-
PivotGrandTotal?:
|
|
158
|
+
PivotGrandTotal?: PivotTotalPosition;
|
|
159
159
|
/**
|
|
160
160
|
* Display automatically calculated Totals within EACH Pivot Column Group, in the position specified
|
|
161
161
|
*/
|
|
162
|
-
PivotColumnTotal?:
|
|
162
|
+
PivotColumnTotal?: PivotTotalPosition;
|
|
163
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Defines the position of Pivot Total position - 'before' or 'after' the Value Column(s)
|
|
166
|
+
*/
|
|
167
|
+
export type PivotTotalPosition = 'before' | 'after' | boolean;
|
|
164
168
|
/**
|
|
165
169
|
* Manages how (and which) Row Group values are stored
|
|
166
170
|
*/
|
|
@@ -159,8 +159,8 @@ export class ExportApiImpl extends ApiBase {
|
|
|
159
159
|
destination,
|
|
160
160
|
showProgressIndicator: true,
|
|
161
161
|
});
|
|
162
|
-
if (
|
|
163
|
-
|
|
162
|
+
if (!exportedReport) {
|
|
163
|
+
// for destination 'Download' and format 'Excel', 'VisualExcel' or 'Csv', AG Grid handles the download as well
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
this.internalApi.sendReportToDestination(exportedReport, report, format, destination);
|
|
@@ -41,7 +41,7 @@ export class LayoutApiImpl extends ApiBase {
|
|
|
41
41
|
if (isPivotLayout(layout)) {
|
|
42
42
|
return [];
|
|
43
43
|
}
|
|
44
|
-
return layout.TableColumns.filter((colId) => layout.ColumnVisibility?.[colId] !== false);
|
|
44
|
+
return layout.TableColumns.filter((colId) => !layout.ColumnVisibility || layout.ColumnVisibility?.[colId] !== false);
|
|
45
45
|
}
|
|
46
46
|
getCurrentRowGroupsColumnIds() {
|
|
47
47
|
const layout = this.getCurrentLayout();
|
|
@@ -4,6 +4,7 @@ import { Report, ReportData, ReportFormatType, ReportNameType, SystemReportName
|
|
|
4
4
|
import { CsvCell, ExcelCell, ExcelDataType, IRowNode } from 'ag-grid-enterprise';
|
|
5
5
|
import { AdaptableColumn, AdaptableColumnDataType } from '../../AdaptableState/Common/AdaptableColumn';
|
|
6
6
|
import { BaseExportContext, DataFormatType, ExportDestinationType, ExportResultData, ProcessExportContext } from '../../AdaptableOptions/ExportOptions';
|
|
7
|
+
import { ExportProcessData } from '../../agGrid/AgGridExportAdapter';
|
|
7
8
|
export declare class ExportInternalApi extends ApiBase {
|
|
8
9
|
/**
|
|
9
10
|
* Value Items for Report Name Selection
|
|
@@ -35,6 +36,7 @@ export declare class ExportInternalApi extends ApiBase {
|
|
|
35
36
|
createCellExcel(cellContent: any, cellType: ExcelDataType): ExcelCell;
|
|
36
37
|
createCellHeader(cellContent: any): ExcelCell;
|
|
37
38
|
buildProcessExportContext(report: Report, format: ReportFormatType, destination: ExportDestinationType): ProcessExportContext;
|
|
39
|
+
exportAllDataInPivotMode(exportProcessData: ExportProcessData): ExportResultData | null;
|
|
38
40
|
private buildExcelConverter;
|
|
39
41
|
private buildCsvConverter;
|
|
40
42
|
private executeGridExport;
|
|
@@ -387,6 +387,42 @@ export class ExportInternalApi extends ApiBase {
|
|
|
387
387
|
.filter(Boolean),
|
|
388
388
|
};
|
|
389
389
|
}
|
|
390
|
+
exportAllDataInPivotMode(exportProcessData) {
|
|
391
|
+
const { exportContext, exportParams } = exportProcessData;
|
|
392
|
+
const exportedColumns = this.getColumnApi()
|
|
393
|
+
.getExportableColumns()
|
|
394
|
+
.filter((column) => !column.isGeneratedPivotResultColumn);
|
|
395
|
+
const exportedRowData = this.getGridApi().getGridData();
|
|
396
|
+
const reportData = {
|
|
397
|
+
columns: exportedColumns,
|
|
398
|
+
rows: exportedRowData,
|
|
399
|
+
};
|
|
400
|
+
const exportFormat = exportContext.format;
|
|
401
|
+
if (exportFormat === 'JSON') {
|
|
402
|
+
return {
|
|
403
|
+
data: reportData,
|
|
404
|
+
type: 'json',
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
if (exportFormat === 'CSV') {
|
|
408
|
+
const csvExportConverter = this.buildCsvConverter(exportContext.report.Name, exportFormat, exportContext.destination);
|
|
409
|
+
const csvData = csvExportConverter(reportData);
|
|
410
|
+
return {
|
|
411
|
+
data: csvData,
|
|
412
|
+
type: 'csv',
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
// theoretically 'VisualExcel' is not a valid export format for this function and should be suppressed from UI
|
|
416
|
+
// but just in case, we handle it here and return a "raw", unstyled Excel file
|
|
417
|
+
if (exportFormat === 'Excel' || exportFormat === 'VisualExcel') {
|
|
418
|
+
const excelExportConverter = this.buildExcelConverter(exportContext.report.Name, exportFormat, exportContext.destination);
|
|
419
|
+
const excelData = excelExportConverter(reportData);
|
|
420
|
+
return {
|
|
421
|
+
data: excelData,
|
|
422
|
+
type: 'excel',
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
}
|
|
390
426
|
buildExcelConverter(reportName, reportFormat, exportDestination) {
|
|
391
427
|
return (reportData) => {
|
|
392
428
|
return this.executeGridExport(reportData, reportName, reportFormat, exportDestination, (gridApi, exportParams) => gridApi.getDataAsExcel({ ...exportParams }));
|
|
@@ -413,6 +449,7 @@ export class ExportInternalApi extends ApiBase {
|
|
|
413
449
|
rowData: reportData.rows,
|
|
414
450
|
theme: this.getAgGridApi().getGridOption('theme'),
|
|
415
451
|
dataTypeDefinitions: this.getAgGridApi().getGridOption('dataTypeDefinitions'),
|
|
452
|
+
columnTypes: this.getAgGridApi().getGridOption('columnTypes'),
|
|
416
453
|
};
|
|
417
454
|
const gridParams = {
|
|
418
455
|
modules: this.getAdaptableApi()
|
|
@@ -16,7 +16,5 @@ export const ReportFormatSelector = (props) => {
|
|
|
16
16
|
});
|
|
17
17
|
const elementType = props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
18
18
|
return (React.createElement(Flex, { "data-name": "report-format-selector", flex: 1, minWidth: 140 },
|
|
19
|
-
React.createElement(Select, {
|
|
20
|
-
// style={{ width: '100%' }}
|
|
21
|
-
size: size, placeholder: SELECT_REPORT_FORMAT_STRING, disabled: !allFormats.length || reportName == undefined, className: `ab-${elementType}__Export__format-select`, options: formatItems, onChange: (format) => onReportFormatSelected(format), value: reportFormat, isClearable: true })));
|
|
19
|
+
React.createElement(Select, { style: { width: '100%' }, size: size, placeholder: SELECT_REPORT_FORMAT_STRING, disabled: !allFormats.length || reportName == undefined, className: `ab-${elementType}__Export__format-select`, options: formatItems, onChange: (format) => onReportFormatSelected(format), value: reportFormat, isClearable: true })));
|
|
22
20
|
};
|
|
@@ -15,6 +15,6 @@ export const ReportNameSelector = (props) => {
|
|
|
15
15
|
};
|
|
16
16
|
});
|
|
17
17
|
const elementType = props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
18
|
-
return (React.createElement(Flex, { flex: 1, minWidth:
|
|
18
|
+
return (React.createElement(Flex, { "data-name": "report-name-selector", flex: 1, minWidth: 160 },
|
|
19
19
|
React.createElement(Select, { style: { width: '100%' }, size: size, "data-name": "report-name-selector", placeholder: SELECT_REPORT_STRING, disabled: !allReportNames.length, className: `ab-${elementType}__Export__report-select`, options: reportItems, onChange: (report) => onReportNameSelected(report), value: reportName, isClearable: true })));
|
|
20
20
|
};
|
|
@@ -179,7 +179,7 @@ const PivotColumnRow = (props) => {
|
|
|
179
179
|
' ',
|
|
180
180
|
React.createElement(DropdownButton, { columns: ['label'], items: numericColumnsOptions, ml: 2 }, weightName))),
|
|
181
181
|
aggValue && (React.createElement(Flex, { backgroundColor: "primary", ml: 3, alignItems: "center" },
|
|
182
|
-
React.createElement(Text, null, "Total
|
|
182
|
+
React.createElement(Text, null, "Total"),
|
|
183
183
|
' ',
|
|
184
184
|
React.createElement(DropdownButton, { columns: ['label'], items: totalOptions, ml: 2 }, currentTotal)))),
|
|
185
185
|
hasPivotSpecificTotals && (React.createElement(Flex, { ml: 2, pl: 2, flexWrap: "wrap", flex: "1 1 auto", alignItems: "center", style: {
|
|
@@ -333,7 +333,7 @@ export const PivotAggregationsSection = (props) => {
|
|
|
333
333
|
GrandTotalRow: value,
|
|
334
334
|
});
|
|
335
335
|
}, isClearable: true })),
|
|
336
|
-
React.createElement(FormRow, { label: 'Grand Total
|
|
336
|
+
React.createElement(FormRow, { label: 'Pivot Grand Total' },
|
|
337
337
|
React.createElement(Select, { style: { width: 120 }, options: ['before', 'after'].map((position) => {
|
|
338
338
|
return {
|
|
339
339
|
label: StringExtensions.CapitaliseFirstLetter(position),
|
|
@@ -345,7 +345,7 @@ export const PivotAggregationsSection = (props) => {
|
|
|
345
345
|
PivotGrandTotal: value,
|
|
346
346
|
});
|
|
347
347
|
}, isClearable: true })),
|
|
348
|
-
React.createElement(FormRow, { label: 'Pivot
|
|
348
|
+
React.createElement(FormRow, { label: 'Pivot Column Total' }, isPivotColumnTotalEnabled === true ? (React.createElement(Select, { style: { width: 120 }, options: ['before', 'after'].map((position) => {
|
|
349
349
|
return {
|
|
350
350
|
label: StringExtensions.CapitaliseFirstLetter(position),
|
|
351
351
|
value: position,
|
|
@@ -232,54 +232,56 @@ const SparklineAxisOptions = ({ options, onChange, }) => {
|
|
|
232
232
|
};
|
|
233
233
|
const SparklineTooltipOptions = ({ options, onChange, }) => {
|
|
234
234
|
const sparklineOptions = options;
|
|
235
|
-
const
|
|
236
|
-
|
|
235
|
+
const isTooltipEnabled = sparklineOptions.tooltip?.enabled ?? false;
|
|
236
|
+
const handleChange = (property, value) => {
|
|
237
|
+
onChange({
|
|
238
|
+
...options,
|
|
239
|
+
tooltip: {
|
|
240
|
+
...options.tooltip,
|
|
241
|
+
[property]: value,
|
|
242
|
+
},
|
|
243
|
+
});
|
|
237
244
|
};
|
|
238
|
-
const
|
|
239
|
-
const positionTypes = [
|
|
245
|
+
const anchorToOptions = [
|
|
240
246
|
{ value: 'pointer', label: 'Pointer' },
|
|
241
247
|
{ value: 'node', label: 'Node' },
|
|
248
|
+
{ value: 'chart', label: 'Chart' },
|
|
249
|
+
];
|
|
250
|
+
const placementOptions = [
|
|
242
251
|
{ value: 'top', label: 'Top' },
|
|
243
252
|
{ value: 'right', label: 'Right' },
|
|
244
253
|
{ value: 'bottom', label: 'Bottom' },
|
|
245
254
|
{ value: 'left', label: 'Left' },
|
|
246
|
-
{ value: 'top-left', label: 'Top Left' },
|
|
247
255
|
{ value: 'top-right', label: 'Top Right' },
|
|
248
256
|
{ value: 'bottom-right', label: 'Bottom Right' },
|
|
249
257
|
{ value: 'bottom-left', label: 'Bottom Left' },
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
{ value: 'exact', label: 'Exact' },
|
|
253
|
-
{ value: 'nearest', label: 'Nearest' },
|
|
258
|
+
{ value: 'top-left', label: 'Top Left' },
|
|
259
|
+
{ value: 'center', label: 'Center' },
|
|
254
260
|
];
|
|
255
261
|
return (React.createElement(FormLayout, null,
|
|
256
|
-
React.createElement(FormRow, { label: "
|
|
257
|
-
React.createElement(CheckBox, { checked:
|
|
258
|
-
React.createElement(FormRow, { label: "
|
|
259
|
-
React.createElement(CheckBox, { disabled: !isTooltipEnabled, checked: sparklineOptions.tooltip?.showArrow, onChange: (showArrow) => handleChange('tooltip', { ...sparklineOptions.tooltip, showArrow }) })),
|
|
260
|
-
React.createElement(FormRow, { label: "Interaction Enabled" },
|
|
261
|
-
React.createElement(CheckBox, { disabled: !isTooltipEnabled, checked: sparklineOptions.tooltip?.interaction?.enabled, onChange: (enabled) => handleChange('tooltip', {
|
|
262
|
-
...sparklineOptions.tooltip,
|
|
263
|
-
interaction: { enabled },
|
|
264
|
-
}) })),
|
|
265
|
-
React.createElement(FormRow, { label: "Range" },
|
|
262
|
+
React.createElement(FormRow, { label: "Show Tooltip" },
|
|
263
|
+
React.createElement(CheckBox, { checked: isTooltipEnabled, onChange: (enabled) => handleChange('enabled', enabled) })),
|
|
264
|
+
React.createElement(FormRow, { label: "Anchor To" },
|
|
266
265
|
React.createElement(Box, { maxWidth: 160 },
|
|
267
|
-
React.createElement(Select, { disabled: !isTooltipEnabled, value: sparklineOptions.tooltip?.
|
|
268
|
-
|
|
266
|
+
React.createElement(Select, { disabled: !isTooltipEnabled, value: sparklineOptions.tooltip?.position?.anchorTo, onChange: (value) => handleChange('position', {
|
|
267
|
+
...sparklineOptions.tooltip?.position,
|
|
268
|
+
anchorTo: value,
|
|
269
|
+
}), options: anchorToOptions }))),
|
|
270
|
+
React.createElement(FormRow, { label: "Placement" },
|
|
269
271
|
React.createElement(Box, { maxWidth: 160 },
|
|
270
|
-
React.createElement(Select, { disabled: !isTooltipEnabled, value: sparklineOptions.tooltip?.position?.
|
|
271
|
-
...sparklineOptions.tooltip,
|
|
272
|
-
|
|
273
|
-
}), options:
|
|
272
|
+
React.createElement(Select, { disabled: !isTooltipEnabled, value: sparklineOptions.tooltip?.position?.placement, onChange: (value) => handleChange('position', {
|
|
273
|
+
...sparklineOptions.tooltip?.position,
|
|
274
|
+
placement: value,
|
|
275
|
+
}), options: placementOptions }))),
|
|
274
276
|
React.createElement(FormRow, { label: "Position Offset X" },
|
|
275
|
-
React.createElement(AdaptableInput, { disabled: !isTooltipEnabled, title: "The horizontal offset in pixels for the position of the tooltip.", type: "number", value: sparklineOptions.tooltip?.position?.xOffset ?? '', onChange: (e) => handleChange('
|
|
276
|
-
...sparklineOptions.tooltip,
|
|
277
|
-
|
|
277
|
+
React.createElement(AdaptableInput, { disabled: !isTooltipEnabled, title: "The horizontal offset in pixels for the position of the tooltip.", type: "number", value: sparklineOptions.tooltip?.position?.xOffset ?? '', onChange: (e) => handleChange('position', {
|
|
278
|
+
...sparklineOptions.tooltip?.position,
|
|
279
|
+
xOffset: Number(e.target.value),
|
|
278
280
|
}) })),
|
|
279
281
|
React.createElement(FormRow, { label: "Position Offset Y" },
|
|
280
|
-
React.createElement(AdaptableInput, { disabled: !isTooltipEnabled, title: "The vertical offset in pixels for the position of the tooltip.", type: "number", value: sparklineOptions.tooltip?.position?.yOffset ?? '', onChange: (e) => handleChange('
|
|
281
|
-
...sparklineOptions.tooltip,
|
|
282
|
-
|
|
282
|
+
React.createElement(AdaptableInput, { disabled: !isTooltipEnabled, title: "The vertical offset in pixels for the position of the tooltip.", type: "number", value: sparklineOptions.tooltip?.position?.yOffset ?? '', onChange: (e) => handleChange('position', {
|
|
283
|
+
...sparklineOptions.tooltip?.position,
|
|
284
|
+
yOffset: Number(e.target.value),
|
|
283
285
|
}) }))));
|
|
284
286
|
};
|
|
285
287
|
const SparklineMarkerOptions = ({ options, onChange }) => {
|
|
@@ -93,7 +93,7 @@ import { AgGridExportAdapter } from './AgGridExportAdapter';
|
|
|
93
93
|
import { checkForDuplicateColumns, isPivotLayout, layoutModelToLayoutState, layoutStateToLayoutModel, normalizeLayout, } from '../Api/Implementation/LayoutHelpers';
|
|
94
94
|
import { LayoutManager } from '../layout-manager/src';
|
|
95
95
|
import { isPivotLayoutModel } from '../layout-manager/src/isPivotLayoutModel';
|
|
96
|
-
import { ACTION_COLUMN_TYPE, CALCULATED_COLUMN_TYPE, FDC3_COLUMN_TYPE, FREE_TEXT_COLUMN_TYPE, } from '../AdaptableState/Common/AdaptableColumn';
|
|
96
|
+
import { ACTION_COLUMN_TYPE, CALCULATED_COLUMN_TYPE, FDC3_COLUMN_TYPE, FREE_TEXT_COLUMN_TYPE, PIVOT_AGGREGATION_TOTAL_COLUMN_TYPE, PIVOT_ANY_TOTAL_COLUMN_TYPE, PIVOT_COLUMN_TOTAL_COLUMN_TYPE, PIVOT_GRAND_TOTAL_COLUMN_TYPE, } from '../AdaptableState/Common/AdaptableColumn';
|
|
97
97
|
import { agGridDataTypeDefinitions } from './agGridDataTypeDefinitions';
|
|
98
98
|
import { AgGridThemeAdapter } from './AgGridThemeAdapter';
|
|
99
99
|
import { mapOldTypeToDataType } from '../migration/VersionUpgrade20';
|
|
@@ -1076,6 +1076,10 @@ You need to define at least one Layout!`);
|
|
|
1076
1076
|
[FREE_TEXT_COLUMN_TYPE]: {},
|
|
1077
1077
|
[ACTION_COLUMN_TYPE]: {},
|
|
1078
1078
|
[FDC3_COLUMN_TYPE]: {},
|
|
1079
|
+
[PIVOT_ANY_TOTAL_COLUMN_TYPE]: {},
|
|
1080
|
+
[PIVOT_GRAND_TOTAL_COLUMN_TYPE]: {},
|
|
1081
|
+
[PIVOT_COLUMN_TOTAL_COLUMN_TYPE]: {},
|
|
1082
|
+
[PIVOT_AGGREGATION_TOTAL_COLUMN_TYPE]: {},
|
|
1079
1083
|
};
|
|
1080
1084
|
const patchedColumnTypes = Object.assign({}, providedColumnTypes, adaptableSpecialColumnTypes);
|
|
1081
1085
|
const customColumnTypes = this.api.columnApi.getColumnTypes() ?? [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ColumnApiModule, } from 'ag-grid-enterprise';
|
|
2
2
|
import { ACTION_COLUMN_TYPE, CALCULATED_COLUMN_TYPE, FDC3_COLUMN_TYPE, FREE_TEXT_COLUMN_TYPE, } from '../AdaptableState/Common/AdaptableColumn';
|
|
3
|
-
import { ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME } from '../Utilities/Constants/GeneralConstants';
|
|
3
|
+
import { ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME, AG_GRID_GROUPED_COLUMN, AG_GRID_SELECTION_COLUMN, } from '../Utilities/Constants/GeneralConstants';
|
|
4
4
|
import { createUuid } from '../AdaptableState/Uuid';
|
|
5
5
|
import ArrayExtensions from '../Utilities/Extensions/ArrayExtensions';
|
|
6
6
|
import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
|
|
@@ -453,6 +453,10 @@ export class AgGridAdapter {
|
|
|
453
453
|
this.logger.warn(`Column is undefined, returning 'text' for Type`);
|
|
454
454
|
return 'text';
|
|
455
455
|
}
|
|
456
|
+
if (agColumn.getId() === AG_GRID_GROUPED_COLUMN ||
|
|
457
|
+
agColumn.getId() === AG_GRID_SELECTION_COLUMN) {
|
|
458
|
+
return 'unknown';
|
|
459
|
+
}
|
|
456
460
|
const colDefType = [].concat(agColumn.getColDef()?.type || []).filter(Boolean);
|
|
457
461
|
const skippedSpecialCols = ['actionColumn', 'fdc3Column'];
|
|
458
462
|
if (skippedSpecialCols.some((specialColType) => colDefType.includes(specialColType))) {
|
|
@@ -202,14 +202,32 @@ export class AgGridColumnAdapter {
|
|
|
202
202
|
const quickSearchStyle = this.getQuickSearchCellStyle();
|
|
203
203
|
const hasQuickSearchStyle = quickSearchStyle != undefined;
|
|
204
204
|
const cellStyle = (params) => {
|
|
205
|
-
const
|
|
205
|
+
const columnId = params.column.getColId();
|
|
206
|
+
const gridCell = this.adaptableApi.gridApi.getGridCellFromRowNode(params.node, columnId);
|
|
206
207
|
if (!gridCell || !gridCell.column) {
|
|
207
208
|
return {};
|
|
208
209
|
}
|
|
209
210
|
const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(gridCell, params);
|
|
210
|
-
|
|
211
|
+
let baseStyles = {};
|
|
212
|
+
// this is required because otherwise, when AG Grid filters, it refershed the pivotResultColDef and the base styles get lost
|
|
213
|
+
// if pivot result col: inherit styles from base column
|
|
214
|
+
if (this.adaptableApi.columnApi.isPivotResultColumn(columnId)) {
|
|
215
|
+
const baseColumn = params.column.getColDef()?.pivotValueColumn;
|
|
216
|
+
if (baseColumn) {
|
|
217
|
+
const baseColDefCellStyle = baseColumn?.getColDef()?.cellStyle;
|
|
218
|
+
const baseColParams = { ...params, column: baseColumn };
|
|
219
|
+
baseStyles =
|
|
220
|
+
typeof baseColDefCellStyle === 'function'
|
|
221
|
+
? baseColDefCellStyle(baseColParams)
|
|
222
|
+
: baseColDefCellStyle;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
// inherit styles from user provided colDef property
|
|
227
|
+
baseStyles = typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle;
|
|
228
|
+
}
|
|
211
229
|
const result = {
|
|
212
|
-
...
|
|
230
|
+
...baseStyles,
|
|
213
231
|
...this.getReadOnlyCellStyle(gridCell, params),
|
|
214
232
|
...this.getEditableCellStyle(gridCell, params),
|
|
215
233
|
...this.getEditedCellStyle(gridCell, params),
|
|
@@ -50,6 +50,7 @@ export class AgGridExportAdapter {
|
|
|
50
50
|
}
|
|
51
51
|
async exportData(config) {
|
|
52
52
|
const { report, format, showProgressIndicator } = config;
|
|
53
|
+
let excelStylesWerePatched = false;
|
|
53
54
|
try {
|
|
54
55
|
if (showProgressIndicator) {
|
|
55
56
|
this.adaptableApi.userInterfaceApi.showProgressIndicator({
|
|
@@ -60,11 +61,19 @@ export class AgGridExportAdapter {
|
|
|
60
61
|
await waitForTimeout(16);
|
|
61
62
|
}
|
|
62
63
|
this.adaptableApi.exportApi.internalApi.setExportInProgress(config.report.Name, config.format, config.destination);
|
|
63
|
-
const
|
|
64
|
+
const exportProcessData = this.buildExportProcessData(config);
|
|
65
|
+
const { exportContext, exportParams } = exportProcessData;
|
|
66
|
+
if (this.adaptableApi.layoutApi.isCurrentLayoutPivot() &&
|
|
67
|
+
config.report.ReportRowScope === 'AllRows') {
|
|
68
|
+
// if in pivot mode but the user wants to export all rows (aka the table row data), we cannot use AG Grids row model
|
|
69
|
+
// we have to use an intermediary transient AG Grid instance
|
|
70
|
+
return this.adaptableApi.exportApi.internalApi.exportAllDataInPivotMode(exportProcessData);
|
|
71
|
+
}
|
|
64
72
|
if (exportContext.isVisualExcelReport) {
|
|
65
73
|
// FIXME AFL patch styles only for exported columns!
|
|
66
74
|
// or even better, only cells
|
|
67
75
|
this.patchExcelStyles();
|
|
76
|
+
excelStylesWerePatched = true;
|
|
68
77
|
}
|
|
69
78
|
// 1. easiest case, we download the file using AG Grid
|
|
70
79
|
// these methods will automatically handle the file download
|
|
@@ -106,7 +115,7 @@ export class AgGridExportAdapter {
|
|
|
106
115
|
* Cleanup export process
|
|
107
116
|
*/
|
|
108
117
|
this.adaptableApi.exportApi.internalApi.setExportComplete();
|
|
109
|
-
if (
|
|
118
|
+
if (excelStylesWerePatched) {
|
|
110
119
|
this.resetExcelStyles();
|
|
111
120
|
}
|
|
112
121
|
if (showProgressIndicator) {
|
|
@@ -119,9 +128,6 @@ export class AgGridExportAdapter {
|
|
|
119
128
|
*/
|
|
120
129
|
buildExportProcessData(config) {
|
|
121
130
|
const exportContext = this.buildExportProcessContext(config);
|
|
122
|
-
if (exportContext.isVisualExcelReport) {
|
|
123
|
-
this.patchExcelStyles();
|
|
124
|
-
}
|
|
125
131
|
const exportParams = this.buildExportParams(exportContext);
|
|
126
132
|
exportContext.exportedColumnIds = exportParams.columnKeys;
|
|
127
133
|
return {
|
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: "20.0
|
|
3
|
+
PUBLISH_TIMESTAMP: 1746214089071 || Date.now(),
|
|
4
|
+
VERSION: "20.1.0" || '--current-version--',
|
|
5
5
|
};
|
|
@@ -4382,18 +4382,18 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
4382
4382
|
kind: string;
|
|
4383
4383
|
desc: string;
|
|
4384
4384
|
isOpt: boolean;
|
|
4385
|
-
ref
|
|
4385
|
+
ref: string;
|
|
4386
4386
|
} | {
|
|
4387
4387
|
name: string;
|
|
4388
4388
|
kind: string;
|
|
4389
4389
|
desc: string;
|
|
4390
|
-
isOpt
|
|
4391
|
-
ref
|
|
4390
|
+
isOpt?: undefined;
|
|
4391
|
+
ref?: undefined;
|
|
4392
4392
|
} | {
|
|
4393
4393
|
name: string;
|
|
4394
4394
|
kind: string;
|
|
4395
4395
|
desc: string;
|
|
4396
|
-
isOpt
|
|
4396
|
+
isOpt: boolean;
|
|
4397
4397
|
ref?: undefined;
|
|
4398
4398
|
})[];
|
|
4399
4399
|
};
|