@antv/s2
Version:
effective spreadsheet render core lib
73 lines (72 loc) • 3.08 kB
TypeScript
import type { PointLike } from '@antv/g';
import { BaseCell } from '../cell/base-cell';
import { ContentPositionParams } from '../common';
import { CellType, InteractionStateName } from '../common/constant/interaction';
import type { CellMeta, Condition, ConditionMappingResult, FormatResult, TextTheme, ValueRange, ViewMeta, ViewMetaIndexType } from '../common/interface';
import { CellBorderPosition } from '../common/interface';
/**
* DataCell for panelGroup area
* ----------------------------
* | | |
* |interval text| icon |
* | | |
* ----------------------------
* There are four conditions({@see BaseCell.conditions}) to determine how to render
* 1、background color
* 2、icon align in right with size {@link ICON_SIZE}
* 3、left rect area is interval(in left) and text(in right)
*/
export declare class DataCell extends BaseCell<ViewMeta> {
/**
* 用于 merge cell 中用于绘制 border 的位置信息
* @see packages/s2-core/src/facet/base-facet.ts L1319
*/
position: [rowIndex: number, colIndex: number];
iconPosition: PointLike;
get cellType(): CellType;
isShallowRender(): boolean;
isMultiData(): boolean;
protected getBorderPositions(): CellBorderPosition[];
getValueRange(): ValueRange;
protected handleByStateName(cells: CellMeta[], stateName: `${InteractionStateName}`): void;
protected handleSearchResult(cells: CellMeta[]): void;
protected handleSelect(cells: CellMeta[]): void;
protected isDisableHover(cellMeta: CellMeta): boolean;
protected handleHover(cells: CellMeta[]): void;
update(): void;
setMeta(viewMeta: Partial<ViewMeta>): void;
drawTextShape(): void;
protected initCell(): void;
protected afterDrawText(): void;
protected generateIconConfig(): void;
protected getTextStyle(): TextTheme;
protected drawConditionIntervalShape(): void;
protected shouldHideRowSubtotalData(): boolean | undefined;
protected getFormattedFieldValue(): FormatResult;
getMaxTextWidth(): number;
getContentPosition({ contentWidth, }?: ContentPositionParams): PointLike;
protected getTextPosition(): PointLike;
protected getIconPosition(): PointLike;
getBackgroundColor(): {
backgroundColor: string;
backgroundColorOpacity: number;
intelligentReverseTextColor: boolean;
};
protected changeRowColSelectState(indexType: ViewMetaIndexType): void;
drawBorders(): void;
/**
* Find current field related condition
* @param conditions
*/
findFieldCondition<T extends Condition>(conditions?: T[]): T | undefined;
/**
* Mapping value to get condition related attrs
* @param condition
*/
mappingValue<Result>(condition: Condition<Result>): ConditionMappingResult<Result>;
updateByState(stateName: `${InteractionStateName}`): void;
clearUnselectedState(): void;
private toggleConditionIntervalShapeOpacity;
protected getResizedTextMaxLines(): number | undefined;
getMetaField(): string;
}