@antv/s2
Version:
effective spreadsheet render core lib
77 lines (76 loc) • 3.84 kB
TypeScript
import type { DisplayObject, PointLike } from '@antv/g';
import { BaseCell } from '../cell/base-cell';
import { InteractionStateName } from '../common/constant/interaction';
import { GuiIcon } from '../common/icons';
import type { GuiIconCfg } from '../common/icons/gui-icon';
import type { CellMeta, Condition, ConditionMappingResult, FormatResult, HeaderActionIconOptions, HeaderActionNameOptions, InternalFullyHeaderActionIcon, TextTheme } from '../common/interface';
import type { BaseHeaderConfig } from '../facet/header';
import type { Node } from '../facet/layout/node';
export declare abstract class HeaderCell<T extends BaseHeaderConfig = BaseHeaderConfig> extends BaseCell<Node> {
protected headerConfig: T;
protected actionIconConfig: InternalFullyHeaderActionIcon | undefined;
protected treeIcon: GuiIcon | undefined;
protected treeLeafNodeAlignDot: DisplayObject | undefined;
protected actionIcons: GuiIcon[];
protected hasDefaultHiddenIcon: boolean;
protected conditionIconMappingResult: HeaderActionNameOptions | undefined;
/** left icon 绘制起始坐标 */
protected leftIconPosition: PointLike;
/** right icon 绘制起始坐标 */
protected rightIconPosition: PointLike;
/** 是否已添加移动端触摸事件监听器(防止重复添加) */
protected hasMobileTouchListeners: boolean;
/** 移动端触摸事件处理器引用(用于销毁时移除) */
private mobileTouchHandlers;
protected abstract isBolderText(): boolean;
getHeaderConfig(): T;
isShallowRender(): boolean;
protected shouldInit(): boolean;
protected handleRestOptions(...[headerConfig]: [T, unknown]): void;
protected initCell(): void;
generateIconConfig(): void;
protected getFormattedFieldValue(): FormatResult;
protected shouldShowDefaultHeaderActionIcon(): boolean | undefined;
protected showSortIcon(): boolean | "" | import("@antv/s2").Query | undefined;
protected getActionIconStyle(options: Partial<HeaderActionIconOptions>): Partial<GuiIconCfg>;
protected hasDefaultHideActionIcon(): boolean;
protected addActionIcon(options: HeaderActionIconOptions): void;
protected drawActionAndConditionIcons({ updatePositionOnly, }?: {
updatePositionOnly?: boolean;
}): void;
protected isSortCell(): boolean;
protected handleByStateName(cells: CellMeta[], stateName: `${InteractionStateName}`): void;
protected handleSearchResult(cells: CellMeta[]): void;
protected handleHover(cells: CellMeta[]): void;
protected handleSelect(cells: CellMeta[], nodes?: Node[]): void;
protected getTextStyle(): TextTheme;
getBackgroundColor(): {
backgroundColor: string;
backgroundColorOpacity: number;
} & {
backgroundColor: string;
backgroundColorOpacity: number;
intelligentReverseTextColor: boolean;
};
toggleActionIcon(id: string): void;
protected getIconPosition(): PointLike;
protected getInteractedCells(): CellMeta[];
update(): void;
updateByState(stateName: `${InteractionStateName}`): void;
hideInteractionShape(): void;
isMeasureField(): boolean;
mappingValue<Result>(condition: Condition<Result>): ConditionMappingResult<Result>;
findFieldCondition<T extends Condition>(conditions?: T[]): T | undefined;
getTreeIcon(): GuiIcon | undefined;
getActionIcons(): GuiIcon[];
getMetaField(): string;
/**
* 添加移动端触摸事件监听器
* 用于区分点击和滚动操作,避免滚动时误触发展开/收起
* @param onTap 点击回调(当触摸移动距离小于阈值时触发)
*/
protected addMobileTouchListener(onTap: () => void): void;
destroy(): void;
reInitCell(node: Node, headerConfig: T): void;
setHeaderConfig(headerConfig: T): void;
}