Readonly
allowIf true, unicode values in the cleaned values will be allowed. Otherwise unicode values will try to be transliterated.
Readonly
contextReadonly
trimIf true, value will be trimmed in all clean methods before being processed by that method.
Static
blessingsStatic
outletsStatic
targetsStatic
valuesStatic
shouldAllow for a comparison value to be provided so that a dispatched event can be prevented. This provides a way for other events to interact with this controller to block further updates if a value is not in sync. By default it will compare to the slugify method, this can be overridden by providing either a Stimulus param value on the element or the event's detail.
Compares the provided strings, ensuring the values are the same.
Returns the element's value as is, without any modifications. Useful for identity fields or when no cleaning is required but the event is needed or comparison is required to always pass.
Prepares the value before being processed by an action method.
Basic slugify of a string, updates the controlled element's value or can be used to simply return the transformed value. If a custom event with detail.value is provided, that value will be used instead of the field's value.
Advanced slugify of a string, updates the controlled element's value or can be used to simply return the transformed value.
The urlify (Django port) function performs extra processing on the string & is more suitable for creating a slug from the title, rather than sanitizing manually. If the urlify util returns an empty string it will fall back to the slugify method.
If a custom event with detail.value is provided, that value will be used instead of the field's value.
Static
after
Adds ability to clean values of an input element with methods such as slugify or urlify.
Example: - Using the slugify method
Example: - Using the urlify method (registered as w-slug)