UNPKG

@visactor/vtable

Version:

canvas table width high performance

19 lines (18 loc) 1.11 kB
import { TABLE_EVENT_TYPE } from "../core/TABLE_EVENT_TYPE"; export function bindSparklineHoverEvent(table) { if (table.eventManager.bindSparklineHoverEvent) return; let hasSparkLine = !1; if (table.isPivotTable()) { hasSparkLine = table.internalProps.layoutMap.indicatorsDefine.some((indicator => "string" != typeof indicator && "sparkline" === indicator.cellType)); } else { hasSparkLine = table.internalProps.layoutMap.columnObjects.some((column => "sparkline" === column.cellType || "function" == typeof column.cellType)); } hasSparkLine && (table.eventManager.bindSparklineHoverEvent = !0, table.on(TABLE_EVENT_TYPE.MOUSEMOVE_CELL, (e => { const {col: col, row: row, x: x, y: y} = e; "sparkline" !== table.getBodyColumnType(col, row) && table.stateManager.updateSparklineHoverPose(-1, -1, 0, 0), table.stateManager.updateSparklineHoverPose(col, row, x, y); })), table.on(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, (e => { table.stateManager.updateSparklineHoverPose(-1, -1, 0, 0); }))); } //# sourceMappingURL=sparkline-event.js.map