UNPKG

e-virt-table

Version:

A powerful data table based on canvas. You can use it as data grid、Microsoft Excel or Google sheets. It supports virtual scroll、cell edit etc.

34 lines (33 loc) 1.09 kB
import Context from './Context'; export type ScrollbarType = 'horizontal' | 'vertical'; export default class Scroller { private ctx; private verticalScrollbar; private horizontalScrollbar; private mousedownHeader; private adjustPositionX; private adjustPositionY; private timerX; private timerY; constructor(ctx: Context); onWheel(e: WheelEvent): void; onTouchmove(e: TouchEvent): void; onTouchstart(e: TouchEvent): void; onMouseDown(e: MouseEvent): void; onMouseMove(e: MouseEvent): void; onMouseUp(): void; draw(): void; setScroll(x: number, y: number): void; setScrollX(scrollX: number): void; setScrollY(scrollY: number): void; scrollToColkey(key: string): void; scrollToColIndex(colIndex: number): void; scrollToRowIndex(rowIndex: number): void; scrollToIndex(rowIndex: number, colIndex: number): void; scrollToRowKey(rowKey: string): void; /** * 调整滚动条位置,让到达边界时自动滚动 */ private startAdjustPosition; private stopAdjustPosition; }