You can drag start the Moveable through the external MouseEventor TouchEvent. (Angular: ngDragStart)
external MouseEventor TouchEvent
Optionaltarget: EventTarget | nullOptionalcallback: () => anyReturns the element of the control box.
Target element to be dragged in moveable
Get a manager that manages the moveable's state and props.
The Rect Info
moveable is the top level that manages targets
Single: MoveableManager instance
Group: MoveableGroup instance
IndividualGroup: MoveableIndividaulGroup instance
Returns leaf target MoveableManagers.
You can get the vertex information, position and offset size information of the target based on the container.
The Rect Info
Get targets set in moveable through target or targets of props.
Hit test an element or rect on a moveable target. (100% = 100)
element or rect to test
Get hit test rate (rate > 0 is hitted)
Check if the moveable state is being dragged.
OptionalableName: string
If you want to check if able is dragging, specify ableName.
Whether the coordinates are inside Moveable
x coordinate
y coordinate
True if the coordinate is in moveable or false
Check if the target is an element included in the moveable.
the target
Request able through a method rather than an event. At the moment of execution, requestStart is executed, and then request and requestEnd can be executed through Requester.
ableName
Optionalparams: RequestParam
request to be able params.
OptionalisInstant: boolean
If isInstant is true, request and requestEnd are executed immediately.
Able Requester. If there is no request in able, nothing will work.
import Moveable from "@moveable-next/vanilla";
const moveable = new Moveable(document.body);
// Instantly Request (requestStart - request - requestEnd)
moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true);
// Start move
const requester = moveable.request("draggable");
requester.request({ deltaX: 10, deltaY: 10 });
requester.request({ deltaX: 10, deltaY: 10 });
requester.request({ deltaX: 10, deltaY: 10 });
requester.requestEnd();
Optionalcallback: () => anyIf the location or size of the target is changed, call the .updateRect() method.
Use the useResizeObserver and useMutationObserver props to update automatically.
If the width, height, left, and top of all elements change, update the shape of the moveable.
Optionaltype: "" | "Start" | "End"OptionalisTarget: booleanOptionalisSetState: boolean
Remove the Moveable object and the events.