UNPKG

@univerjs-pro/sheets-pivot

Version:

Pivot table integration for Univer Sheets.

91 lines (90 loc) 4.56 kB
import type { ILabelViewHeaderMapItem, IPivotTableSnapshot, IPivotViewInfo, LabelViewItem, PivotTable, PivotView, PivotViewItem } from '@univerjs-pro/engine-pivot'; import type { IAccessor, IMutationInfo, Injector, IRange, Nullable } from '@univerjs/core'; import type { ISetRangeValuesMutationParams } from '@univerjs/sheets'; import type { IGetPivotDataLocalMutationParams, IPivotCellPositionInfo, IPivotPanelDataInfo, IPivotRangesInfo, IPivotRenderCache, IPivotTableCellData, IPivotTableConfig } from './const/type'; import { PivotDateGroupFieldDateTypeEnum, PivotSubtotalTypeEnum, PivotTableFiledAreaEnum } from '@univerjs-pro/engine-pivot'; import { ObjectMatrix } from '@univerjs/core'; import { SheetsPivotDataSourceModel } from './models/sheets-pivot-data-source-model'; export declare const generateDefaultEmptyCache: (textOptions: { filter: string; row: string; column: string; values: string; }, startCell: { row: number; col: number; }) => { matrixCache: ObjectMatrix<IPivotTableCellData>; rangesCache: IPivotRangesInfo; }; /** * - Get the auto display name of the value field. * @description - which may use prefix text like excel * - the prefix text is create by subtotal type * @param {string} baseName the name without prefix text * @param {PivotSubtotalTypeEnum} subtotalType the type of subtotal to be displayed for this value field. * @returns {string} the auto display name of the value field. */ export declare function getAutoDisplayName(this: SheetsPivotDataSourceModel, baseName: string, subtotalType: PivotSubtotalTypeEnum): string; export declare function getPivotCellInfo(row: number, col: number, cellInfo: Nullable<IPivotTableCellData>, pivotTable: PivotTable, pivotItemRenderCache: IPivotRenderCache): { filterId: Nullable<string>; info: Nullable<IPivotViewInfo>; data: Nullable<IPivotTableCellData>; headerInfo: Nullable<ILabelViewHeaderMapItem>; } | undefined; export declare function getPivotTableInfo(pivotTable: PivotTable, pivotTableId: string, config: IPivotTableConfig): IPivotPanelDataInfo; export declare function flattenObject(inject: Injector, obj: { [key: string]: any; }, parentKey?: string, result?: { [key: string]: any; }): { [key: string]: any; }; export declare const unionPivotViewRange: (rangeInfo: IPivotRangesInfo | undefined) => IRange[]; export declare function getPivotDrillDownData(injector: Injector, params: IGetPivotDataLocalMutationParams): { indexes: number[]; range: IRange; sourceUnitId: string; sourceSubUnitId: string; formatMap: Record<string, string>; } | undefined; export declare function canUsePivot(ls?: string, pbk?: string): boolean; export declare function getPivotInfoByLicense(defaultPivotCount: number, ls?: string, pbk?: string): { count: number; timeValid: boolean; }; export declare function generateSetRangeValueMutations(injector: Injector, unitId: string, subUnitId: string, ranges: IRange[]): { setRangeValueUndoMutation: { id: string; params: ISetRangeValuesMutationParams; }; setRangeValueRedoMutation: { id: string; params: ISetRangeValuesMutationParams; }; shouldClear: boolean; }; export declare function getEmptyPivotRanges(cellInfo: IPivotCellPositionInfo): { startRow: number; endRow: number; startColumn: number; endColumn: number; }[]; export declare function getPivotRowColCount(view: PivotView, startCell: { row: number; col: number; }, isEmpty: boolean): { rowCount: number; colCount: number; }; export declare function getInsertRowColMutations(accessor: IAccessor, view: PivotView, cellInfo: IPivotCellPositionInfo, isEmpty: boolean): { undos: IMutationInfo<object>[]; redos: IMutationInfo<object>[]; }; export declare function getHeaderViewMaxText(labelView: LabelViewItem, textInfo: Record<string, string>, isCol: boolean, formatMap: Record<string, string>): string; export declare function getValueViewMaxText(rowView: PivotViewItem): string; export declare function getCornerMaxText(corner: PivotViewItem): string; export declare function setConfigToPivotTable(pivotTable: PivotTable, config: IPivotTableSnapshot): void; export declare function resetPivotTable(pivotTable: PivotTable, area?: PivotTableFiledAreaEnum | undefined): void; export declare function findCommonDateType(maxExcelDate: number, minExcelDate: number): PivotDateGroupFieldDateTypeEnum; export declare function getDateGroupName(injector: Injector, dateType: PivotDateGroupFieldDateTypeEnum): string;