@adaptabletools/adaptable-cjs 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 +4 -0
- package/src/agGrid/AgGridExportAdapter.js +11 -5
- package/src/env.js +2 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
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",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"uuid": "9.0.1"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"ag-grid-enterprise": ">=33.
|
|
67
|
+
"ag-grid-enterprise": ">=33.2.0"
|
|
68
68
|
},
|
|
69
69
|
"publishTimestamp": 0
|
|
70
70
|
}
|
|
@@ -163,8 +163,8 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
|
|
|
163
163
|
destination,
|
|
164
164
|
showProgressIndicator: true,
|
|
165
165
|
});
|
|
166
|
-
if (
|
|
167
|
-
|
|
166
|
+
if (!exportedReport) {
|
|
167
|
+
// for destination 'Download' and format 'Excel', 'VisualExcel' or 'Csv', AG Grid handles the download as well
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
170
|
this.internalApi.sendReportToDestination(exportedReport, report, format, destination);
|
|
@@ -45,7 +45,7 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
|
|
|
45
45
|
if ((0, LayoutHelpers_1.isPivotLayout)(layout)) {
|
|
46
46
|
return [];
|
|
47
47
|
}
|
|
48
|
-
return layout.TableColumns.filter((colId) => layout.ColumnVisibility?.[colId] !== false);
|
|
48
|
+
return layout.TableColumns.filter((colId) => !layout.ColumnVisibility || layout.ColumnVisibility?.[colId] !== false);
|
|
49
49
|
}
|
|
50
50
|
getCurrentRowGroupsColumnIds() {
|
|
51
51
|
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;
|
|
@@ -391,6 +391,42 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
|
|
|
391
391
|
.filter(Boolean),
|
|
392
392
|
};
|
|
393
393
|
}
|
|
394
|
+
exportAllDataInPivotMode(exportProcessData) {
|
|
395
|
+
const { exportContext, exportParams } = exportProcessData;
|
|
396
|
+
const exportedColumns = this.getColumnApi()
|
|
397
|
+
.getExportableColumns()
|
|
398
|
+
.filter((column) => !column.isGeneratedPivotResultColumn);
|
|
399
|
+
const exportedRowData = this.getGridApi().getGridData();
|
|
400
|
+
const reportData = {
|
|
401
|
+
columns: exportedColumns,
|
|
402
|
+
rows: exportedRowData,
|
|
403
|
+
};
|
|
404
|
+
const exportFormat = exportContext.format;
|
|
405
|
+
if (exportFormat === 'JSON') {
|
|
406
|
+
return {
|
|
407
|
+
data: reportData,
|
|
408
|
+
type: 'json',
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
if (exportFormat === 'CSV') {
|
|
412
|
+
const csvExportConverter = this.buildCsvConverter(exportContext.report.Name, exportFormat, exportContext.destination);
|
|
413
|
+
const csvData = csvExportConverter(reportData);
|
|
414
|
+
return {
|
|
415
|
+
data: csvData,
|
|
416
|
+
type: 'csv',
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
// theoretically 'VisualExcel' is not a valid export format for this function and should be suppressed from UI
|
|
420
|
+
// but just in case, we handle it here and return a "raw", unstyled Excel file
|
|
421
|
+
if (exportFormat === 'Excel' || exportFormat === 'VisualExcel') {
|
|
422
|
+
const excelExportConverter = this.buildExcelConverter(exportContext.report.Name, exportFormat, exportContext.destination);
|
|
423
|
+
const excelData = excelExportConverter(reportData);
|
|
424
|
+
return {
|
|
425
|
+
data: excelData,
|
|
426
|
+
type: 'excel',
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
}
|
|
394
430
|
buildExcelConverter(reportName, reportFormat, exportDestination) {
|
|
395
431
|
return (reportData) => {
|
|
396
432
|
return this.executeGridExport(reportData, reportName, reportFormat, exportDestination, (gridApi, exportParams) => gridApi.getDataAsExcel({ ...exportParams }));
|
|
@@ -417,6 +453,7 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
|
|
|
417
453
|
rowData: reportData.rows,
|
|
418
454
|
theme: this.getAgGridApi().getGridOption('theme'),
|
|
419
455
|
dataTypeDefinitions: this.getAgGridApi().getGridOption('dataTypeDefinitions'),
|
|
456
|
+
columnTypes: this.getAgGridApi().getGridOption('columnTypes'),
|
|
420
457
|
};
|
|
421
458
|
const gridParams = {
|
|
422
459
|
modules: this.getAdaptableApi()
|
|
@@ -20,8 +20,6 @@ const ReportFormatSelector = (props) => {
|
|
|
20
20
|
});
|
|
21
21
|
const elementType = props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
22
22
|
return (react_1.default.createElement(rebass_1.Flex, { "data-name": "report-format-selector", flex: 1, minWidth: 140 },
|
|
23
|
-
react_1.default.createElement(Select_1.Select, {
|
|
24
|
-
// style={{ width: '100%' }}
|
|
25
|
-
size: size, placeholder: GeneralConstants_1.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 })));
|
|
23
|
+
react_1.default.createElement(Select_1.Select, { style: { width: '100%' }, size: size, placeholder: GeneralConstants_1.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 })));
|
|
26
24
|
};
|
|
27
25
|
exports.ReportFormatSelector = ReportFormatSelector;
|
|
@@ -19,7 +19,7 @@ const ReportNameSelector = (props) => {
|
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
21
|
const elementType = props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
22
|
-
return (react_1.default.createElement(rebass_1.Flex, { flex: 1, minWidth:
|
|
22
|
+
return (react_1.default.createElement(rebass_1.Flex, { "data-name": "report-name-selector", flex: 1, minWidth: 160 },
|
|
23
23
|
react_1.default.createElement(Select_1.Select, { style: { width: '100%' }, size: size, "data-name": "report-name-selector", placeholder: GeneralConstants_1.SELECT_REPORT_STRING, disabled: !allReportNames.length, className: `ab-${elementType}__Export__report-select`, options: reportItems, onChange: (report) => onReportNameSelected(report), value: reportName, isClearable: true })));
|
|
24
24
|
};
|
|
25
25
|
exports.ReportNameSelector = ReportNameSelector;
|
|
@@ -237,54 +237,56 @@ const SparklineAxisOptions = ({ options, onChange, }) => {
|
|
|
237
237
|
};
|
|
238
238
|
const SparklineTooltipOptions = ({ options, onChange, }) => {
|
|
239
239
|
const sparklineOptions = options;
|
|
240
|
-
const
|
|
241
|
-
|
|
240
|
+
const isTooltipEnabled = sparklineOptions.tooltip?.enabled ?? false;
|
|
241
|
+
const handleChange = (property, value) => {
|
|
242
|
+
onChange({
|
|
243
|
+
...options,
|
|
244
|
+
tooltip: {
|
|
245
|
+
...options.tooltip,
|
|
246
|
+
[property]: value,
|
|
247
|
+
},
|
|
248
|
+
});
|
|
242
249
|
};
|
|
243
|
-
const
|
|
244
|
-
const positionTypes = [
|
|
250
|
+
const anchorToOptions = [
|
|
245
251
|
{ value: 'pointer', label: 'Pointer' },
|
|
246
252
|
{ value: 'node', label: 'Node' },
|
|
253
|
+
{ value: 'chart', label: 'Chart' },
|
|
254
|
+
];
|
|
255
|
+
const placementOptions = [
|
|
247
256
|
{ value: 'top', label: 'Top' },
|
|
248
257
|
{ value: 'right', label: 'Right' },
|
|
249
258
|
{ value: 'bottom', label: 'Bottom' },
|
|
250
259
|
{ value: 'left', label: 'Left' },
|
|
251
|
-
{ value: 'top-left', label: 'Top Left' },
|
|
252
260
|
{ value: 'top-right', label: 'Top Right' },
|
|
253
261
|
{ value: 'bottom-right', label: 'Bottom Right' },
|
|
254
262
|
{ value: 'bottom-left', label: 'Bottom Left' },
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
{ value: 'exact', label: 'Exact' },
|
|
258
|
-
{ value: 'nearest', label: 'Nearest' },
|
|
263
|
+
{ value: 'top-left', label: 'Top Left' },
|
|
264
|
+
{ value: 'center', label: 'Center' },
|
|
259
265
|
];
|
|
260
266
|
return (React.createElement(FormLayout_1.default, null,
|
|
261
|
-
React.createElement(FormLayout_1.FormRow, { label: "
|
|
262
|
-
React.createElement(CheckBox_1.CheckBox, { checked:
|
|
263
|
-
React.createElement(FormLayout_1.FormRow, { label: "
|
|
264
|
-
React.createElement(CheckBox_1.CheckBox, { disabled: !isTooltipEnabled, checked: sparklineOptions.tooltip?.showArrow, onChange: (showArrow) => handleChange('tooltip', { ...sparklineOptions.tooltip, showArrow }) })),
|
|
265
|
-
React.createElement(FormLayout_1.FormRow, { label: "Interaction Enabled" },
|
|
266
|
-
React.createElement(CheckBox_1.CheckBox, { disabled: !isTooltipEnabled, checked: sparklineOptions.tooltip?.interaction?.enabled, onChange: (enabled) => handleChange('tooltip', {
|
|
267
|
-
...sparklineOptions.tooltip,
|
|
268
|
-
interaction: { enabled },
|
|
269
|
-
}) })),
|
|
270
|
-
React.createElement(FormLayout_1.FormRow, { label: "Range" },
|
|
267
|
+
React.createElement(FormLayout_1.FormRow, { label: "Show Tooltip" },
|
|
268
|
+
React.createElement(CheckBox_1.CheckBox, { checked: isTooltipEnabled, onChange: (enabled) => handleChange('enabled', enabled) })),
|
|
269
|
+
React.createElement(FormLayout_1.FormRow, { label: "Anchor To" },
|
|
271
270
|
React.createElement(rebass_1.Box, { maxWidth: 160 },
|
|
272
|
-
React.createElement(Select_1.Select, { disabled: !isTooltipEnabled, value: sparklineOptions.tooltip?.
|
|
273
|
-
|
|
271
|
+
React.createElement(Select_1.Select, { disabled: !isTooltipEnabled, value: sparklineOptions.tooltip?.position?.anchorTo, onChange: (value) => handleChange('position', {
|
|
272
|
+
...sparklineOptions.tooltip?.position,
|
|
273
|
+
anchorTo: value,
|
|
274
|
+
}), options: anchorToOptions }))),
|
|
275
|
+
React.createElement(FormLayout_1.FormRow, { label: "Placement" },
|
|
274
276
|
React.createElement(rebass_1.Box, { maxWidth: 160 },
|
|
275
|
-
React.createElement(Select_1.Select, { disabled: !isTooltipEnabled, value: sparklineOptions.tooltip?.position?.
|
|
276
|
-
...sparklineOptions.tooltip,
|
|
277
|
-
|
|
278
|
-
}), options:
|
|
277
|
+
React.createElement(Select_1.Select, { disabled: !isTooltipEnabled, value: sparklineOptions.tooltip?.position?.placement, onChange: (value) => handleChange('position', {
|
|
278
|
+
...sparklineOptions.tooltip?.position,
|
|
279
|
+
placement: value,
|
|
280
|
+
}), options: placementOptions }))),
|
|
279
281
|
React.createElement(FormLayout_1.FormRow, { label: "Position Offset X" },
|
|
280
|
-
React.createElement(AdaptableInput_1.default, { disabled: !isTooltipEnabled, title: "The horizontal offset in pixels for the position of the tooltip.", type: "number", value: sparklineOptions.tooltip?.position?.xOffset ?? '', onChange: (e) => handleChange('
|
|
281
|
-
...sparklineOptions.tooltip,
|
|
282
|
-
|
|
282
|
+
React.createElement(AdaptableInput_1.default, { 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', {
|
|
283
|
+
...sparklineOptions.tooltip?.position,
|
|
284
|
+
xOffset: Number(e.target.value),
|
|
283
285
|
}) })),
|
|
284
286
|
React.createElement(FormLayout_1.FormRow, { label: "Position Offset Y" },
|
|
285
|
-
React.createElement(AdaptableInput_1.default, { disabled: !isTooltipEnabled, title: "The vertical offset in pixels for the position of the tooltip.", type: "number", value: sparklineOptions.tooltip?.position?.yOffset ?? '', onChange: (e) => handleChange('
|
|
286
|
-
...sparklineOptions.tooltip,
|
|
287
|
-
|
|
287
|
+
React.createElement(AdaptableInput_1.default, { 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', {
|
|
288
|
+
...sparklineOptions.tooltip?.position,
|
|
289
|
+
yOffset: Number(e.target.value),
|
|
288
290
|
}) }))));
|
|
289
291
|
};
|
|
290
292
|
const SparklineMarkerOptions = ({ options, onChange }) => {
|
|
@@ -457,6 +457,10 @@ class AgGridAdapter {
|
|
|
457
457
|
this.logger.warn(`Column is undefined, returning 'text' for Type`);
|
|
458
458
|
return 'text';
|
|
459
459
|
}
|
|
460
|
+
if (agColumn.getId() === GeneralConstants_1.AG_GRID_GROUPED_COLUMN ||
|
|
461
|
+
agColumn.getId() === GeneralConstants_1.AG_GRID_SELECTION_COLUMN) {
|
|
462
|
+
return 'unknown';
|
|
463
|
+
}
|
|
460
464
|
const colDefType = [].concat(agColumn.getColDef()?.type || []).filter(Boolean);
|
|
461
465
|
const skippedSpecialCols = ['actionColumn', 'fdc3Column'];
|
|
462
466
|
if (skippedSpecialCols.some((specialColType) => colDefType.includes(specialColType))) {
|
|
@@ -54,6 +54,7 @@ class AgGridExportAdapter {
|
|
|
54
54
|
}
|
|
55
55
|
async exportData(config) {
|
|
56
56
|
const { report, format, showProgressIndicator } = config;
|
|
57
|
+
let excelStylesWerePatched = false;
|
|
57
58
|
try {
|
|
58
59
|
if (showProgressIndicator) {
|
|
59
60
|
this.adaptableApi.userInterfaceApi.showProgressIndicator({
|
|
@@ -64,11 +65,19 @@ class AgGridExportAdapter {
|
|
|
64
65
|
await (0, waitForTimeout_1.waitForTimeout)(16);
|
|
65
66
|
}
|
|
66
67
|
this.adaptableApi.exportApi.internalApi.setExportInProgress(config.report.Name, config.format, config.destination);
|
|
67
|
-
const
|
|
68
|
+
const exportProcessData = this.buildExportProcessData(config);
|
|
69
|
+
const { exportContext, exportParams } = exportProcessData;
|
|
70
|
+
if (this.adaptableApi.layoutApi.isCurrentLayoutPivot() &&
|
|
71
|
+
config.report.ReportRowScope === 'AllRows') {
|
|
72
|
+
// if in pivot mode but the user wants to export all rows (aka the table row data), we cannot use AG Grids row model
|
|
73
|
+
// we have to use an intermediary transient AG Grid instance
|
|
74
|
+
return this.adaptableApi.exportApi.internalApi.exportAllDataInPivotMode(exportProcessData);
|
|
75
|
+
}
|
|
68
76
|
if (exportContext.isVisualExcelReport) {
|
|
69
77
|
// FIXME AFL patch styles only for exported columns!
|
|
70
78
|
// or even better, only cells
|
|
71
79
|
this.patchExcelStyles();
|
|
80
|
+
excelStylesWerePatched = true;
|
|
72
81
|
}
|
|
73
82
|
// 1. easiest case, we download the file using AG Grid
|
|
74
83
|
// these methods will automatically handle the file download
|
|
@@ -110,7 +119,7 @@ class AgGridExportAdapter {
|
|
|
110
119
|
* Cleanup export process
|
|
111
120
|
*/
|
|
112
121
|
this.adaptableApi.exportApi.internalApi.setExportComplete();
|
|
113
|
-
if (
|
|
122
|
+
if (excelStylesWerePatched) {
|
|
114
123
|
this.resetExcelStyles();
|
|
115
124
|
}
|
|
116
125
|
if (showProgressIndicator) {
|
|
@@ -123,9 +132,6 @@ class AgGridExportAdapter {
|
|
|
123
132
|
*/
|
|
124
133
|
buildExportProcessData(config) {
|
|
125
134
|
const exportContext = this.buildExportProcessContext(config);
|
|
126
|
-
if (exportContext.isVisualExcelReport) {
|
|
127
|
-
this.patchExcelStyles();
|
|
128
|
-
}
|
|
129
135
|
const exportParams = this.buildExportParams(exportContext);
|
|
130
136
|
exportContext.exportedColumnIds = exportParams.columnKeys;
|
|
131
137
|
return {
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
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" || '',
|
|
5
|
-
PUBLISH_TIMESTAMP:
|
|
6
|
-
VERSION: "20.0
|
|
5
|
+
PUBLISH_TIMESTAMP: 1746214117044 || Date.now(),
|
|
6
|
+
VERSION: "20.1.0" || '--current-version--',
|
|
7
7
|
};
|