Interface GridCanvasHelperAPI
interface GridCanvasHelperAPI { theme: RequiredThemeDefine; buildCheckBoxInline(check: boolean,
context: CellContext,
option: { animElapsedTime?: number; borderColor?: ColorPropertyDefine; checkBgColor?: ColorPropertyDefine; textAlign?: CanvasTextAlign; textBaseline?: CanvasTextBaseline; uncheckBgColor?: ColorPropertyDefine; }): InlineAPI; button(caption: string,
context: CellContext,
option: { bgColor?: ColorPropertyDefine; color?: ColorPropertyDefine; font?: FontPropertyDefine; icons?: SimpleColumnIconOption[]; offset?: number; padding?: string | number | (string | number)[]; shadow?: { blur?: number; color?: string; offset?: { x?: number; y?: number; }; offsetX?: number; offsetY?: number; }; textAlign?: CanvasTextAlign; textBaseline?: CanvasTextBaseline; textOverflow?: string; }): void; checkbox(check: boolean,
context: CellContext,
option: { animElapsedTime?: number; borderColor?: ColorPropertyDefine; checkBgColor?: ColorPropertyDefine; offset?: number; textAlign?: CanvasTextAlign; textBaseline?: CanvasTextBaseline; uncheckBgColor?: ColorPropertyDefine; }): void; drawBorderWithClip(context: CellContext,
draw: ((ctx: CanvasRenderingContext2D) => void)): void; drawWithClip(context: CellContext,
draw: ((ctx: CanvasRenderingContext2D) => void)): void; fillRectWithState(rect: RectProps,
context: CellContext,
option: { fillColor?: ColorPropertyDefine; }): void; getColor(color: ColorPropertyDefine,
col: number,
row: number,
ctx: CanvasRenderingContext2D): string | CanvasGradient | CanvasPattern; getColor(color: ColorsPropertyDefine,
col: number,
row: number,
ctx: CanvasRenderingContext2D): ColorsDef; getStyleProperty<T>(style: T | ((args: StylePropertyFunctionArg) => T),
col: number,
row: number,
ctx: CanvasRenderingContext2D): T; multilineText(lines: string[],
context: CellContext,
option: { autoWrapText?: boolean; color?: ColorPropertyDefine; font?: FontPropertyDefine; icons?: SimpleColumnIconOption[]; lineClamp?: LineClamp; lineHeight?: string | number; offset?: number; padding?: string | number | (string | number)[]; textAlign?: CanvasTextAlign; textBaseline?: CanvasTextBaseline; textOverflow?: string; }): void; radioButton(check: boolean,
context: CellContext,
option: { animElapsedTime?: number; checkBgColor?: ColorPropertyDefine; checkBorderColor?: ColorPropertyDefine; checkColor?: ColorPropertyDefine; offset?: number; textAlign?: CanvasTextAlign; textBaseline?: CanvasTextBaseline; uncheckBgColor?: ColorPropertyDefine; uncheckBorderColor?: ColorPropertyDefine; }): void; testFontLoad(font: undefined | string,
value: string,
context: CellContext): boolean; text(text: string | (string | InlineAPI)[],
context: CellContext,
option: { color?: ColorPropertyDefine; font?: FontPropertyDefine; icons?: SimpleColumnIconOption[]; offset?: number; padding?: string | number | (string | number)[]; textAlign?: CanvasTextAlign; textBaseline?: CanvasTextBaseline; textOverflow?: string; }): void; toBoxPixelArray(value: string | number | (string | number)[],
context: CellContext,
font: undefined | string): [number, number, number, number]; } Properties
Methods
buildCheckBoxInline
- buildCheckBoxInline(check, context, option): InlineAPI
Parameters
- check: boolean
- context: CellContext
- option: {
animElapsedTime?: number;
borderColor?: ColorPropertyDefine;
checkBgColor?: ColorPropertyDefine;
textAlign?: CanvasTextAlign;
textBaseline?: CanvasTextBaseline;
uncheckBgColor?: ColorPropertyDefine;
}Optional
animElapsedTime?: number
Optional
textAlign?: CanvasTextAlign
Optional
textBaseline?: CanvasTextBaseline
button
- button(caption, context, option): void
Parameters
- caption: string
- context: CellContext
- option: {
bgColor?: ColorPropertyDefine;
color?: ColorPropertyDefine;
font?: FontPropertyDefine;
icons?: SimpleColumnIconOption[];
offset?: number;
padding?: string | number | (string | number)[];
shadow?: {
blur?: number;
color?: string;
offset?: {
x?: number;
y?: number;
};
offsetX?: number;
offsetY?: number;
};
textAlign?: CanvasTextAlign;
textBaseline?: CanvasTextBaseline;
textOverflow?: string;
}Optional
icons?: SimpleColumnIconOption[]
Optional
offset?: number
Optional
padding?: string | number | (string | number)[]
Optional
shadow?: {
blur?: number;
color?: string;
offset?: {
x?: number;
y?: number;
};
offsetX?: number;
offsetY?: number;
}
Optional
blur?: number
Optional
color?: string
Optional
offset?: {
x?: number;
y?: number;
}
Optional
x?: number
Optional
y?: number
Optional
offsetX?: number
Optional
offsetY?: number
Optional
textAlign?: CanvasTextAlign
Optional
textBaseline?: CanvasTextBaseline
Optional
textOverflow?: string
Returns void
checkbox
- checkbox(check, context, option): void
Parameters
- check: boolean
- context: CellContext
- option: {
animElapsedTime?: number;
borderColor?: ColorPropertyDefine;
checkBgColor?: ColorPropertyDefine;
offset?: number;
textAlign?: CanvasTextAlign;
textBaseline?: CanvasTextBaseline;
uncheckBgColor?: ColorPropertyDefine;
}Optional
animElapsedTime?: number
Optional
offset?: number
Optional
textAlign?: CanvasTextAlign
Optional
textBaseline?: CanvasTextBaseline
Returns void
drawBorderWithClip
- drawBorderWithClip(context, draw): void
Parameters
- context: CellContext
- draw: ((ctx: CanvasRenderingContext2D) => void)
- (ctx): void
Parameters
- ctx: CanvasRenderingContext2D
Returns void
Returns void
drawWithClip
- drawWithClip(context, draw): void
Parameters
- context: CellContext
- draw: ((ctx: CanvasRenderingContext2D) => void)
- (ctx): void
Parameters
- ctx: CanvasRenderingContext2D
Returns void
Returns void
fillRectWithState
- fillRectWithState(rect, context, option): void
Returns void
getColor
- getColor(color, col, row, ctx): string | CanvasGradient | CanvasPattern
Returns string | CanvasGradient | CanvasPattern
- getColor(color, col, row, ctx): ColorsDef
Returns ColorsDef
getStyleProperty
- getStyleProperty<T>(style, col, row, ctx): T
Returns T
multilineText
- multilineText(lines, context, option): void
Parameters
- lines: string[]
- context: CellContext
- option: {
autoWrapText?: boolean;
color?: ColorPropertyDefine;
font?: FontPropertyDefine;
icons?: SimpleColumnIconOption[];
lineClamp?: LineClamp;
lineHeight?: string | number;
offset?: number;
padding?: string | number | (string | number)[];
textAlign?: CanvasTextAlign;
textBaseline?: CanvasTextBaseline;
textOverflow?: string;
}Optional
autoWrapText?: boolean
Optional
icons?: SimpleColumnIconOption[]
Optional
lineClamp?: LineClamp
Optional
lineHeight?: string | number
Optional
offset?: number
Optional
padding?: string | number | (string | number)[]
Optional
textAlign?: CanvasTextAlign
Optional
textBaseline?: CanvasTextBaseline
Optional
textOverflow?: string
Returns void
radioButton
- radioButton(check, context, option): void
Returns void
testFontLoad
- testFontLoad(font, value, context): boolean
Parameters
- font: undefined | string
- value: string
- context: CellContext
Returns boolean
text
- text(text, context, option): void
Parameters
- text: string | (string | InlineAPI)[]
- context: CellContext
- option: {
color?: ColorPropertyDefine;
font?: FontPropertyDefine;
icons?: SimpleColumnIconOption[];
offset?: number;
padding?: string | number | (string | number)[];
textAlign?: CanvasTextAlign;
textBaseline?: CanvasTextBaseline;
textOverflow?: string;
}Optional
icons?: SimpleColumnIconOption[]
Optional
offset?: number
Optional
padding?: string | number | (string | number)[]
Optional
textAlign?: CanvasTextAlign
Optional
textBaseline?: CanvasTextBaseline
Optional
textOverflow?: string
Returns void
toBoxPixelArray
- toBoxPixelArray(value, context, font): [number, number, number, number]
Parameters
- value: string | number | (string | number)[]
- context: CellContext
- font: undefined | string
Returns [number, number, number, number]