@adaptabletools/adaptable 20.0.13 → 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/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/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +33 -31
- package/src/agGrid/AgGridAdapter.js +5 -1
- package/src/agGrid/AgGridExportAdapter.js +11 -5
- package/src/env.js +2 -2
- 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",
|
|
@@ -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
|
};
|
|
@@ -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 }) => {
|
|
@@ -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))) {
|
|
@@ -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
|
};
|