OptionalonEnd?: (context: { cancelled: boolean; result?: any; wasApplied: boolean }) => voidCalled when the drag action ends either because it was completed or cancelled.
OptionalonEvent?: (e: PointerEvent | KeyboardEvent | undefined, cancel: () => void) => voidCalled before searching for a matching action. Useful for re-initializing state.
Is passed a cancel function if you want to cancel the current drag action.
OptionalonRecalculate?: () => voidCalled while dragging during dragChange events. You can use this to update the dragging edges.
OptionalonRequestChange?: (type: keyof TActions | undefined) => voidCalled when the action requested changes.
OptionaldefaultOnMoveChange: <T extends "start" | "move" | "end">(Default onMoveChange handler for when no action can handle the request. See IAction.onMoveChange.
The default prevents movement when the edge is a window edge and when the edge is touching a collapsed frame.
Calls moveEnd with updateEdges: false. This can technically be called from "end", it should still work.
Saves result to resolve moveStart promise, updates edges if you passed updateEdges then aborts the handler (only onMoveEnded will fire after) . Not available during "end" event. It's designed for resolving from other external evente (e.g. key events).
OptionalactiveCalls moveEnd with updateEdges: false. This can technically be called from "end", it should still work.
Saves result to resolve moveStart promise, updates edges if you passed updateEdges then aborts the handler (only onMoveEnded will fire after) . Not available during "end" event. It's designed for resolving from other external evente (e.g. key events).
OptionalonEnd?: (context: { cancelled: boolean; result?: any; wasApplied: boolean }) => voidCalled when the drag action ends either because it was completed or cancelled.
OptionalonEvent?: (e: PointerEvent | KeyboardEvent | undefined, cancel: () => void) => voidCalled before searching for a matching action. Useful for re-initializing state.
Is passed a cancel function if you want to cancel the current drag action.
OptionalonRecalculate?: () => voidCalled while dragging during dragChange events. You can use this to update the dragging edges.
OptionalonRequestChange?: (type: keyof TActions | undefined) => voidCalled when the action requested changes.
All action shapes merged into a single array. If using vue you can set this to a reactive array for reactivity.
All hint/error text from all actions, updated on every onMoveChange. If using vue you can set this to a reactive object for reactivity.
Called after visual edges are recalculated. Action handlers can annotate edges with error info.
Called when drag will be applied. If moveEnd was called with apply false, it will not be called.
Return {updateEdges: false} to not apply the regular drag end changes (i.e. return false to reset to the position before dragging). Optionally return a result value to resolve the promise with.
Do not use for resetting handler state, use onMoveEnded for that.
Called when the drag coordinates change (during any event). Should return updateEdges true to allow the edges to be updated/moved, or false to prevent it. See also MoveChangeHandler for the built in action handler.
Can be used to save some context/info to later apply safely during onMoveApply.
The call order is:
For doing cleanup
StaticdebugOptionalkey: string | booleanObject key to filter the state by, e.g. state.win.frames. If false is ignored. The idea is you pass this.debug and users can set this.debug to a string to filter.
Handles the lifecycle of a drag actions IAction and provides additional hooks.
The first action instance that can handle the request is passed control of the event handlers until the request changes.