UNPKG

ag-grid-enterprise

Version:

Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue

83 lines (82 loc) 3.11 kB
import type { AgColumn, Column, ColumnGroup, ExcelRow, ExcelStyle, ExcelWorksheetConfigParams, GridSerializingParams, HeaderRowAccumulator, IFormulaService, INotesService, RowAccumulator, RowNode } from 'ag-grid-community'; import { BaseGridSerializingSession } from 'ag-grid-community'; import type { Workbook } from './excelXlsxFactory'; export interface StyleLinkerInterface { rowType: 'HEADER_GROUPING' | 'HEADER' | 'BODY'; rowIndex: number; value: string; column?: Column; columnGroup?: ColumnGroup; node?: RowNode; } export interface ExcelGridSerializingParams extends ExcelWorksheetConfigParams, GridSerializingParams { formulaSvc?: IFormulaService; baseExcelStyles: ExcelStyle[]; styleLinker: (params: StyleLinkerInterface) => string[]; frozenRowCount?: number; frozenColumnCount?: number; workbook: Workbook; headerRowCount?: number; notesSvc?: INotesService; pivotModeActive?: boolean; } export declare class ExcelSerializingSession extends BaseGridSerializingSession<ExcelRow[]> { readonly useGridHeaderLayout: boolean; private readonly config; private readonly stylesByIds; private readonly formulaSvc?; private readonly notesSvc?; private mixedStyles; private mixedStyleCounter; private readonly excelStyles; private readonly workbook; private readonly rows; private readonly verticallySpannedHeaderStyles; private cols; private columnsToExport; private frozenRowCount; private emittedHeaderRowCount; private spanningHeaderStyleRegistered; private skipFrozenRows; private frozenColumnCount; private skipFrozenColumns; constructor(config: ExcelGridSerializingParams); addCustomContent(customContent: ExcelRow[]): void; isSpanColumnHeader(): boolean; onNewHeaderGroupingRow(): HeaderRowAccumulator; onNewHeaderRow(): HeaderRowAccumulator; private createHeaderRow; onNewBodyRow(node?: RowNode): RowAccumulator; prepare(columnsToExport: AgColumn[]): void; private registerSpanningHeaderStyle; parse(): string; private createWorksheet; private addRowOutlineIfNecessary; /** * Depth counting only ancestor group rows that are exported (parents hidden by * `groupHideParentOfSingleChild` are skipped, matching the serializer's row skipping). * `uiLevel` cannot be used here: it is only maintained for currently displayed rows, * so it is stale for rows inside collapsed groups. */ private getExportedLevel; private isAnyParentCollapsed; private convertColumnToExcel; private onNewBodyColumn; private onNewRow; private addWorksheetToWorkbook; private mapSharedStrings; private getDataTypeForValue; private getTypeFromStyle; private addImage; private createCell; private createMergedCell; private resolveBodyCellNote; private getCellNoteExportParams; private getCellValue; private addXlfnPrefix; private getStyleId; private addNewMixedStyle; private isFormula; private isNumerical; private getStyleById; }