Readonly
activeClasses to append when the mode is active & remove when inactive.
Readonly
contextReadonly
delayDelay, in milliseconds, to use when debouncing the mode updates.
Readonly
inactiveClasses to append when the mode is inactive & remove when active.
Tracks the current mode for this zone.
Readonly
switchKey to use when switching the active state via the switch
method.
Static
blessingsStatic
classesStatic
outletsStatic
targetsStatic
valuesStatic
shouldOptional
previous: ZoneModeIntentionally does nothing.
Useful for attaching data-action to leverage the built in
Stimulus options without needing any extra functionality.
e.g. preventDefault (:prevent
) and stopPropagation (:stop
).
Switches the active state of the zone, based ont he provided key from the event detail or params. If there is no key provided, it will use the fallback key of 'active'.
If the key's value is truthy, it will set the mode to active, otherwise it will set it to inactive.
If the key is not found in the event detail or params, it will do nothing.
Optional
event: CustomEvent<{ mode?: ZoneMode }> & { params?: { mode: ZoneMode } }Static
after
Enables the controlled element to respond to specific user interactions by adding or removing CSS classes dynamically.
Example: - Shows a hover effect when files are dragged over the element.
Example: - Switches the active state of the element based on a key value from the switch event.