UNPKG

react-moveable

Version:

A React Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable.

18 lines (13 loc) 492 B
import { MoveableManagerInterface } from "../types"; export function getGestoData(moveable: MoveableManagerInterface, ableName: string) { const targetGesto = moveable.targetGesto; const controlGesto = moveable.controlGesto; let data!: Record<string, any>; if (targetGesto?.isFlag()) { data = targetGesto.getEventData()[ableName]; } if (!data && controlGesto?.isFlag()) { data = controlGesto.getEventData()[ableName]; } return data || {}; }