@adaptabletools/adaptable-cjs 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 +4 -0
- package/src/agGrid/AgGridAdapter.js +4 -0
- 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.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
|
}
|
|
@@ -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";
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Defines which Columns in a Layout display Aggregated values when Row-Grouped
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getAggFuncName = exports.isWeightedAverageAggregation = exports.isWeightedAverageAggFuncName = exports.WEIGHTED_AVERAGE_AGG_FN_NAME = void 0;
|
|
7
4
|
exports.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
|
*/
|
|
@@ -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;
|
|
@@ -183,7 +183,7 @@ const PivotColumnRow = (props) => {
|
|
|
183
183
|
' ',
|
|
184
184
|
React.createElement(DropdownButton_1.default, { columns: ['label'], items: numericColumnsOptions, ml: 2 }, weightName))),
|
|
185
185
|
aggValue && (React.createElement(rebass_1.Flex, { backgroundColor: "primary", ml: 3, alignItems: "center" },
|
|
186
|
-
React.createElement(rebass_1.Text, null, "Total
|
|
186
|
+
React.createElement(rebass_1.Text, null, "Total"),
|
|
187
187
|
' ',
|
|
188
188
|
React.createElement(DropdownButton_1.default, { columns: ['label'], items: totalOptions, ml: 2 }, currentTotal)))),
|
|
189
189
|
hasPivotSpecificTotals && (React.createElement(rebass_1.Flex, { ml: 2, pl: 2, flexWrap: "wrap", flex: "1 1 auto", alignItems: "center", style: {
|
|
@@ -339,7 +339,7 @@ const PivotAggregationsSection = (props) => {
|
|
|
339
339
|
GrandTotalRow: value,
|
|
340
340
|
});
|
|
341
341
|
}, isClearable: true })),
|
|
342
|
-
React.createElement(FormLayout_1.FormRow, { label: 'Grand Total
|
|
342
|
+
React.createElement(FormLayout_1.FormRow, { label: 'Pivot Grand Total' },
|
|
343
343
|
React.createElement(Select_1.Select, { style: { width: 120 }, options: ['before', 'after'].map((position) => {
|
|
344
344
|
return {
|
|
345
345
|
label: StringExtensions_1.default.CapitaliseFirstLetter(position),
|
|
@@ -351,7 +351,7 @@ const PivotAggregationsSection = (props) => {
|
|
|
351
351
|
PivotGrandTotal: value,
|
|
352
352
|
});
|
|
353
353
|
}, isClearable: true })),
|
|
354
|
-
React.createElement(FormLayout_1.FormRow, { label: 'Pivot
|
|
354
|
+
React.createElement(FormLayout_1.FormRow, { label: 'Pivot Column Total' }, isPivotColumnTotalEnabled === true ? (React.createElement(Select_1.Select, { style: { width: 120 }, options: ['before', 'after'].map((position) => {
|
|
355
355
|
return {
|
|
356
356
|
label: StringExtensions_1.default.CapitaliseFirstLetter(position),
|
|
357
357
|
value: position,
|
|
@@ -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 }) => {
|
|
@@ -1080,6 +1080,10 @@ You need to define at least one Layout!`);
|
|
|
1080
1080
|
[AdaptableColumn_1.FREE_TEXT_COLUMN_TYPE]: {},
|
|
1081
1081
|
[AdaptableColumn_1.ACTION_COLUMN_TYPE]: {},
|
|
1082
1082
|
[AdaptableColumn_1.FDC3_COLUMN_TYPE]: {},
|
|
1083
|
+
[AdaptableColumn_1.PIVOT_ANY_TOTAL_COLUMN_TYPE]: {},
|
|
1084
|
+
[AdaptableColumn_1.PIVOT_GRAND_TOTAL_COLUMN_TYPE]: {},
|
|
1085
|
+
[AdaptableColumn_1.PIVOT_COLUMN_TOTAL_COLUMN_TYPE]: {},
|
|
1086
|
+
[AdaptableColumn_1.PIVOT_AGGREGATION_TOTAL_COLUMN_TYPE]: {},
|
|
1083
1087
|
};
|
|
1084
1088
|
const patchedColumnTypes = Object.assign({}, providedColumnTypes, adaptableSpecialColumnTypes);
|
|
1085
1089
|
const customColumnTypes = this.api.columnApi.getColumnTypes() ?? [];
|
|
@@ -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))) {
|
|
@@ -207,14 +207,32 @@ class AgGridColumnAdapter {
|
|
|
207
207
|
const quickSearchStyle = this.getQuickSearchCellStyle();
|
|
208
208
|
const hasQuickSearchStyle = quickSearchStyle != undefined;
|
|
209
209
|
const cellStyle = (params) => {
|
|
210
|
-
const
|
|
210
|
+
const columnId = params.column.getColId();
|
|
211
|
+
const gridCell = this.adaptableApi.gridApi.getGridCellFromRowNode(params.node, columnId);
|
|
211
212
|
if (!gridCell || !gridCell.column) {
|
|
212
213
|
return {};
|
|
213
214
|
}
|
|
214
215
|
const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(gridCell, params);
|
|
215
|
-
|
|
216
|
+
let baseStyles = {};
|
|
217
|
+
// this is required because otherwise, when AG Grid filters, it refershed the pivotResultColDef and the base styles get lost
|
|
218
|
+
// if pivot result col: inherit styles from base column
|
|
219
|
+
if (this.adaptableApi.columnApi.isPivotResultColumn(columnId)) {
|
|
220
|
+
const baseColumn = params.column.getColDef()?.pivotValueColumn;
|
|
221
|
+
if (baseColumn) {
|
|
222
|
+
const baseColDefCellStyle = baseColumn?.getColDef()?.cellStyle;
|
|
223
|
+
const baseColParams = { ...params, column: baseColumn };
|
|
224
|
+
baseStyles =
|
|
225
|
+
typeof baseColDefCellStyle === 'function'
|
|
226
|
+
? baseColDefCellStyle(baseColParams)
|
|
227
|
+
: baseColDefCellStyle;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
// inherit styles from user provided colDef property
|
|
232
|
+
baseStyles = typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle;
|
|
233
|
+
}
|
|
216
234
|
const result = {
|
|
217
|
-
...
|
|
235
|
+
...baseStyles,
|
|
218
236
|
...this.getReadOnlyCellStyle(gridCell, params),
|
|
219
237
|
...this.getEditableCellStyle(gridCell, params),
|
|
220
238
|
...this.getEditedCellStyle(gridCell, params),
|
|
@@ -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
|
};
|
|
@@ -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
|
};
|