UNPKG

@adaptabletools/adaptable

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

76 lines (75 loc) 2.9 kB
import { AdaptableAgGrid } from './AdaptableAgGrid'; import { Report, ReportFormatType } from '../AdaptableState/ExportState'; import { CsvExportParams, ExcelExportParams, ExcelStyle } from 'ag-grid-enterprise'; import { ExportDestinationType, ExportResultData } from '../AdaptableOptions/ExportOptions'; import { Layout } from '../AdaptableState/LayoutState'; export interface ExportConfig { report: Report; format: ReportFormatType; destination: ExportDestinationType; showProgressIndicator: boolean; } interface ExportProcessContext extends ExportConfig { exportedColumnIds: string[]; isExcelReport: boolean; isVisualExcelReport: boolean; isExportingVisibleColumnToJSON: boolean; getCurrent: () => { layout: Layout; groupColumnIds: string[]; pivotColumnIds: string[]; }; isCellPartOfSelection: (rowId: string, columnId: string) => boolean; } export interface ExportProcessData { exportContext: ExportProcessContext; exportParams: ExcelExportParams | CsvExportParams; } export declare class AgGridExportAdapter { private _adaptableInstance; /** * !!! * do NOT mutate this array reference, this is passed only initially to AG Grid and we can only change it's internal state */ DANGER_excelStyles: ExcelStyle[]; originalExcelStyles: ExcelStyle[]; private excelStylesCache; private cellClassKey2excelStyleIdMap; private excelStylesWithFormattedDate; constructor(_adaptableInstance: AdaptableAgGrid); private get agGridApi(); private get adaptableApi(); private get exportOptions(); private get logger(); static getExcelClassNameForCell(colId: string, primaryKeyValue: any, userDefinedCellClass?: string | string[]): string; destroy(): void; exportData(config: ExportConfig): Promise<null | ExportResultData>; /** * Creates export context and parameters for a given export configuration */ buildExportProcessData(config: ExportConfig): ExportProcessData; private buildExportParams; private buildBaseExportParams; private computeProcessRowGroupCallback; private computeProcessCellCallback; private getReportColsAndRows; private isTreeDataGrid; private buildExportProcessContext; private processCellForExcelExport; private processRowGroupForExcelExport; private patchExcelStyles; private resetExcelStyles; private buildExcelStyles; private registerExcelStyle; private registerExcelStyleWithFormattedDate; private isDateCellExportedAsFormattedValue; private convertCSSToExcelStyle; private getExcelDataType; getExcelStyleIdForCellClassKey(cellClassKey: string): string; private getExcelStyleWithFormattedDate; private mapCsvToJson; private getCsvSeparator; private computeSkipColumnHeaders; private computeGetCustomContentBelowRow; } export {};