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.

38 lines (37 loc) • 1.35 kB
import Context from './Context'; import type { CellType } from './types'; export type ScrollbarType = 'horizontal' | 'vertical'; export declare function getHorizontalWheelDelta(e: Pick<WheelEvent, 'deltaX' | 'deltaY' | 'shiftKey'>): number; 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; onMouseOut(e: MouseEvent): 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; scrollToFooterRowIndex(rowIndex: number): void; scrollToIndex(rowIndex: number, colIndex: number, cellType?: CellType): void; scrollToRowKey(rowKey: string): void; /** * 调整滚动条位置,让到达边界时自动滚动 */ private startAdjustPosition; private stopAdjustPosition; }