@visactor/vtable
Version:
canvas table width high performance
176 lines (175 loc) • 6.16 kB
TypeScript
import type { ColorsDef, LineDashsDef, LineWidthsDef, LineWidthsPropertyDefine } from '.';
import type { ButtonStyle, CheckboxStyle, ITextStyleOption, RadioStyle, SwitchStyle } from './column/style';
import type { ColorPropertyDefine, ColorsPropertyDefine } from './style-define';
import type { ICellAxisOption } from './component/axis';
import type { PopTipAttributes } from './../vrender';
export type PartialTableThemeDefine = Partial<ITableThemeDefine>;
export type ThemeStyle = ITextStyleOption & {
hover?: Omit<InteractionStyle, 'cellBorderColor' | 'cellBorderLineWidth'>;
select?: {
inlineRowBgColor?: ColorPropertyDefine;
inlineColumnBgColor?: ColorPropertyDefine;
cellBgColor?: ColorPropertyDefine;
};
frameStyle?: FrameStyle;
};
export type InteractionStyle = {
cellBorderColor?: ColorsPropertyDefine;
cellBorderLineWidth?: LineWidthsPropertyDefine;
cellBgColor?: ColorPropertyDefine;
inlineRowBgColor?: ColorPropertyDefine;
inlineColumnBgColor?: ColorPropertyDefine;
};
export type FrameStyle = {
borderColor?: ColorsDef;
borderLineWidth?: LineWidthsDef;
borderLineDash?: LineDashsDef;
innerBorder?: boolean;
};
export type TableFrameStyle = FrameStyle & {
shadowBlur?: number;
shadowOffsetX?: number;
shadowOffsetY?: number;
shadowColor?: string;
cornerRadius?: number | [number, number, number, number];
};
export type menuStyle = {
color?: string;
highlightColor?: string;
fontSize?: number;
fontFamily?: string;
highlightFontSize?: number;
highlightFontFamily?: string;
hoverBgColor?: string;
};
export type ScrollStyle = {
scrollRailColor?: string;
scrollSliderColor?: string;
scrollSliderCornerRadius?: number;
width?: number;
visible?: 'always' | 'scrolling' | 'none' | 'focus';
horizontalVisible?: 'always' | 'scrolling' | 'none' | 'focus';
verticalVisible?: 'always' | 'scrolling' | 'none' | 'focus';
hoverOn?: boolean;
barToSide?: boolean;
horizontalPadding?: number | [number, number, number, number];
verticalPadding?: number | [number, number, number, number];
ignoreFrozenCols?: boolean;
};
export type TooltipStyle = {
fontFamily?: string;
fontSize?: number;
color?: string;
padding?: number[];
bgColor?: string;
maxWidth?: number;
maxHeight?: number;
};
export interface ITableThemeDefine {
underlayBackgroundColor?: string;
defaultStyle?: ThemeStyle;
cornerHeaderStyle?: ThemeStyle;
cornerRightTopCellStyle?: ThemeStyle;
cornerLeftBottomCellStyle?: ThemeStyle;
cornerRightBottomCellStyle?: ThemeStyle;
rightFrozenStyle?: ThemeStyle;
bottomFrozenStyle?: ThemeStyle;
headerStyle?: ThemeStyle;
rowHeaderStyle?: ThemeStyle;
bodyStyle?: ThemeStyle;
groupTitleStyle?: ThemeStyle;
frameStyle?: TableFrameStyle;
columnResize?: {
visibleOnHover?: boolean;
lineColor?: ColorPropertyDefine;
bgColor?: ColorPropertyDefine;
lineWidth?: number;
width?: number;
resizeHotSpotSize?: number;
labelVisible?: boolean;
labelColor?: string;
labelFontSize?: number;
labelFontFamily?: string;
labelBackgroundFill?: string;
labelBackgroundCornerRadius?: number;
};
dragHeaderSplitLine?: {
lineColor: ColorPropertyDefine;
lineWidth: number;
shadowBlockColor?: string;
};
frozenColumnLine?: {
shadow?: {
width: number;
startColor: string;
endColor: string;
visible?: 'always' | 'scrolling';
};
border?: {
lineColor: ColorPropertyDefine;
bgColor?: ColorPropertyDefine;
lineWidth: number;
width?: number;
};
};
scrollStyle?: ScrollStyle;
tooltipStyle?: TooltipStyle;
selectionStyle?: {
cellBorderColor?: string;
cellBorderLineWidth?: number;
cellBgColor?: string;
inlineRowBgColor?: string;
inlineColumnBgColor?: string;
selectionFillMode?: 'overlay' | 'replace';
dynamicUpdateSelectionSize?: boolean;
};
axisStyle?: {
defaultAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'>;
leftAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {
cellPaddingLeft?: number;
};
rightAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {
cellPaddingRight?: number;
};
topAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {
cellPaddingTop?: number;
};
bottomAxisStyle?: Omit<ICellAxisOption, 'type' | 'domain' | 'range' | 'orient' | '__ticksForVTable'> & {
cellPaddingBottom?: number;
};
};
checkboxStyle?: CheckboxStyle;
radioStyle?: RadioStyle;
switchStyle?: SwitchStyle;
buttonStyle?: ButtonStyle;
textPopTipStyle?: PopTipAttributes;
cellInnerBorder?: boolean;
cellBorderClipDirection?: 'top-left' | 'bottom-right';
_contentOffset?: number;
functionalIconsStyle?: {
sort_color?: string;
sort_color_opacity?: string;
sort_color_2?: string;
sort_color_opacity_2?: string;
sort_size?: number;
sort_size_2?: number;
frozen_color?: string;
frozen_color_opacity?: string;
frozen_color_2?: string;
frozen_color_opacity_2?: string;
frozen_size?: number;
frozen_size_2?: number;
collapse_color?: string;
collapse_color_opacity?: string;
collapse_size?: number;
collapse_size_2?: number;
expand_color?: string;
expand_color_opacity?: string;
expand_size?: number;
expand_size_2?: number;
dragReorder_color?: string;
dragReorder_color_opacity?: string;
dragReorder_size?: number;
};
}
export type RequiredTableThemeDefine = Required<ITableThemeDefine>;