@adaptabletools/adaptable-cjs 20.0.0-canary.6 → 20.0.0-canary.8
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 +1 -1
- package/src/AdaptableOptions/ExportOptions.d.ts +8 -3
- package/src/Api/ExportApi.d.ts +1 -6
- package/src/Api/Implementation/ExportApiImpl.d.ts +1 -2
- package/src/Api/Implementation/ExportApiImpl.js +14 -8
- package/src/Api/Internal/ActionColumnInternalApi.js +16 -19
- package/src/Api/Internal/AdaptableInternalApi.js +1 -1
- package/src/Api/Internal/ExportInternalApi.d.ts +10 -6
- package/src/Api/Internal/ExportInternalApi.js +104 -135
- package/src/PredefinedConfig/ExportState.d.ts +7 -14
- package/src/Redux/Store/AdaptableStore.js +1 -1
- package/src/agGrid/AgGridExportAdapter.d.ts +24 -1
- package/src/agGrid/AgGridExportAdapter.js +24 -25
- package/src/agGrid/cellRenderers/BadgeRenderer.js +2 -1
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -33,6 +33,9 @@ class AgGridExportAdapter {
|
|
|
33
33
|
get exportOptions() {
|
|
34
34
|
return this._adaptableInstance.api.optionsApi.getExportOptions();
|
|
35
35
|
}
|
|
36
|
+
get logger() {
|
|
37
|
+
return this._adaptableInstance.logger;
|
|
38
|
+
}
|
|
36
39
|
static getExcelClassNameForCell(colId, primaryKeyValue, userDefinedCellClass) {
|
|
37
40
|
let excelClassName = `--excel-cell-${colId}-${primaryKeyValue}`;
|
|
38
41
|
if (excelClassName.indexOf(' ') > 0) {
|
|
@@ -61,14 +64,12 @@ class AgGridExportAdapter {
|
|
|
61
64
|
await (0, waitForTimeout_1.waitForTimeout)(16);
|
|
62
65
|
}
|
|
63
66
|
this.adaptableApi.exportApi.internalApi.setExportInProgress(config.report.Name, config.format, config.destination);
|
|
64
|
-
const exportContext = this.
|
|
67
|
+
const { exportContext, exportParams } = this.buildExportProcessData(config);
|
|
65
68
|
if (exportContext.isVisualExcelReport) {
|
|
66
69
|
// FIXME AFL patch styles only for exported columns!
|
|
67
70
|
// or even better, only cells
|
|
68
71
|
this.patchExcelStyles();
|
|
69
72
|
}
|
|
70
|
-
const exportParams = this.buildExportParams(exportContext);
|
|
71
|
-
exportContext.exportedColumnIds = exportParams.columnKeys;
|
|
72
73
|
// 1. easiest case, we download the file using AG Grid
|
|
73
74
|
// these methods will automatically handle the file download
|
|
74
75
|
if (exportContext.destination === 'Download' && exportContext.isExcelReport) {
|
|
@@ -102,8 +103,7 @@ class AgGridExportAdapter {
|
|
|
102
103
|
};
|
|
103
104
|
}
|
|
104
105
|
catch (error) {
|
|
105
|
-
|
|
106
|
-
console.error(error);
|
|
106
|
+
this.logger.consoleError(`Error exporting ${report.Name} in ${format} format to ${config.destination}`, error);
|
|
107
107
|
}
|
|
108
108
|
finally {
|
|
109
109
|
/**
|
|
@@ -118,6 +118,21 @@ class AgGridExportAdapter {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Creates export context and parameters for a given export configuration
|
|
123
|
+
*/
|
|
124
|
+
buildExportProcessData(config) {
|
|
125
|
+
const exportContext = this.buildExportProcessContext(config);
|
|
126
|
+
if (exportContext.isVisualExcelReport) {
|
|
127
|
+
this.patchExcelStyles();
|
|
128
|
+
}
|
|
129
|
+
const exportParams = this.buildExportParams(exportContext);
|
|
130
|
+
exportContext.exportedColumnIds = exportParams.columnKeys;
|
|
131
|
+
return {
|
|
132
|
+
exportContext,
|
|
133
|
+
exportParams,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
121
136
|
buildExportParams(exportContext) {
|
|
122
137
|
const baseExportParams = this.buildBaseExportParams(exportContext);
|
|
123
138
|
if (exportContext.format === 'Excel' || exportContext.format === 'VisualExcel') {
|
|
@@ -656,9 +671,9 @@ class AgGridExportAdapter {
|
|
|
656
671
|
.map((columnId) => this.adaptableApi.columnApi.getColumnWithColumnId(columnId))
|
|
657
672
|
.map((column) => ({
|
|
658
673
|
columnId: column.columnId,
|
|
674
|
+
field: column.field ?? column.columnId,
|
|
659
675
|
friendlyName: column.friendlyName,
|
|
660
676
|
dataType: column.dataType,
|
|
661
|
-
field: column.field ?? column.columnId,
|
|
662
677
|
}));
|
|
663
678
|
const reportData = {
|
|
664
679
|
columns,
|
|
@@ -730,27 +745,11 @@ class AgGridExportAdapter {
|
|
|
730
745
|
masterRowNode: node,
|
|
731
746
|
masterRowData: node?.data,
|
|
732
747
|
isExpanded: node.expanded,
|
|
733
|
-
createCellCsv: (cellContent) =>
|
|
734
|
-
|
|
735
|
-
data: {
|
|
736
|
-
value: cellContent != undefined ? String(cellContent) : null,
|
|
737
|
-
},
|
|
738
|
-
};
|
|
739
|
-
},
|
|
740
|
-
createCellExcel: (cellContent, cellType) => {
|
|
741
|
-
return {
|
|
742
|
-
data: {
|
|
743
|
-
value: cellContent != undefined ? String(cellContent) : null,
|
|
744
|
-
type: cellType,
|
|
745
|
-
},
|
|
746
|
-
};
|
|
747
|
-
},
|
|
748
|
+
createCellCsv: (cellContent) => this.adaptableApi.exportApi.internalApi.createCellCsv(cellContent),
|
|
749
|
+
createCellExcel: (cellContent, cellType) => this.adaptableApi.exportApi.internalApi.createCellExcel(cellContent, cellType),
|
|
748
750
|
createCellHeader: (cellContent) => {
|
|
749
751
|
return {
|
|
750
|
-
|
|
751
|
-
value: cellContent != undefined ? String(cellContent) : null,
|
|
752
|
-
type: 'String',
|
|
753
|
-
},
|
|
752
|
+
...this.adaptableApi.exportApi.internalApi.createCellHeader(cellContent),
|
|
754
753
|
// see #masterDetailHeader
|
|
755
754
|
styleId: '_masterDetailHeader',
|
|
756
755
|
};
|
|
@@ -39,7 +39,8 @@ const getBadgeRendererForColumn = (badgeStyle, abColumn, api) => {
|
|
|
39
39
|
this.eGui.innerHTML = formattedValue;
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
const arrayTypes = ['numberArray', 'textArray'];
|
|
43
|
+
if (arrayTypes.includes(abColumn.dataType)) {
|
|
43
44
|
this.renderArrayValues(params, adaptableApi);
|
|
44
45
|
}
|
|
45
46
|
else {
|
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.0-canary.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1741620204967 || Date.now(),
|
|
6
|
+
VERSION: "20.0.0-canary.8" || '--current-version--',
|
|
7
7
|
};
|