Optional
props: StaticProps & MutablePropsProtected
_callbacksCallbacks instance
Protected
_destroyableStores actions that need to be executed when the module is destroyed
Protected
_isTracks whether the module has been destroyed
Protected
_isIndicates whether the start
event has been triggered.
Protected
_listenersStores active event listeners for runtime interactions.
Protected
_pointersMap of active pointers.
Protected
_propsCurrent properties
Retrieves the module's callbacks instance.
Returns the container element handling events.
Checks if the module has been destroyed.
Indicates whether the start
event has been triggered.
Returns the maximum number of pointers that can be tracked.
Returns the minimum number of pointers required to trigger events.
The name of the module, derived from the class name
Returns the map of active pointers.
Optional prefix for classnames used by the module
Current properties. Do not mutate these directly, use updateProps
instead.
Protected
_addAdds a class name on an element, and keeps track of it for removal when the module is destroyed.
The target DOM element.
The class name to toggle.
Protected
_cleanupCleans up event listeners, pointers, and injected styles.
Protected
_cnHelper function to generate classnames with the module's prefix.
The class names to generate.
A string of class names with the module's prefix applied.
Protected
_decodeReturns pointer coordinates relative to the container.
Protected
_destroyDestroys the component and removes all event listeners.
Returns the default mutable properties.
Returns the default static properties.
Protected
_handleHandles event cancellations (pointercancel
, blur
).
Triggers the end
callback and cleans up all pointers.
Protected
_handleHandles pointer down events (pointerdown
).
Adds a new pointer if conditions are met and triggers the pointerdown
callback.
Protected
_handleHandles pointer movement (pointermove
).
Updates pointer positions and triggers the pointermove
callback.
Protected
_handleHandles pointer release (pointerup
).
Removes the pointer and triggers the pointerup
callback.
If no active pointers remain, fires the end
callback.
Protected
_handleMethod that is called when the module's properties mutate. In most cases, used to handle callbacks.
Protected
_resetPrevents text selection during pointer interactions.
Protected
_setAttaches base event listeners to the container.
Protected
_setAttaches runtime event listeners for active pointer interactions.
Destroys the module, cleaning up resources, callbacks, and event listeners.
Adds a custom callback to the module.
The event type to listen for (e.g., 'props', 'destroy').
The function to execute when the event is triggered.
Additional settings for the callback.
Adds a callback on the module's destruction.
The function to execute during destruction.
Manages pointer events, including tracking multiple pointers, and emitting callbacks for pointer interactions.
For proper functionality, ensure the container has an appropriate touch-action property.
Documentation