UNPKG

@vue-dnd-kit/core

Version:

Core functionality for Vue DnD Kit - a lightweight Vue 3 library for building performant and accessible drag and drop interfaces

45 lines (44 loc) 1.54 kB
import { ICoordinates, TDnDNodeRef } from '../../external/types'; /** * Resolves template ref to HTMLElement (handles both element and component refs) */ export declare const getNode: (node: TDnDNodeRef) => HTMLElement | null; /** * Checks if point (x, y) is inside rect */ export declare const containsPoint: (rect: DOMRect, x: number, y: number) => boolean; /** * True if child is a descendant of parent (parent.contains(child) and parent !== child) */ export declare const isDescendant: (parent: HTMLElement, child: HTMLElement) => boolean; /** * Checks if two DOMRects intersect */ export declare const checkIntersection: (rect1: DOMRect, rect2: DOMRect) => boolean; /** * Returns true if event target is outside the container */ export declare const isNotDirectClick: (event: Event, container: HTMLElement | null) => boolean; /** * Returns scroll direction based on cursor proximity to container edges */ export declare const getAutoScrollDirection: (coords: ICoordinates, container: HTMLElement, threshold?: number) => { x: number; y: number; }; /** * Returns true if running in browser environment */ export declare const isClient: () => boolean; /** * Disables user interactions during drag (user-select, context menu, etc.) */ export declare const disableInteractions: () => void; /** * Restores user interactions after drag ends */ export declare const enableInteractions: () => void; /** * Prevents default browser behavior for the event */ export declare const preventEvent: (event: Event) => void;