@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
13 lines (12 loc) • 534 B
TypeScript
export default function useDraggable({ onMove, onDrop, getBoundingRect, handleSelector, edgeOffset, }: {
onMove?: (event: MouseEvent) => void;
onDrop?: (dx: number, dy: number) => void;
getBoundingRect?: () => DOMRect;
handleSelector?: string;
/** Minimum distance to keep from the constrain region edges while dragging. */
edgeOffset?: number;
}): {
handleRef: (newNode: HTMLElement) => void;
targetRef: import("react").RefObject<HTMLElement>;
applyTransform: (dx: number, dy: number) => void;
};