ReadonlycontextReadonlyenableTargets will be enabled if the target's rule matches the scoped form data, otherwise will be disabled.
ReadonlyhasTrue if there is at least one enable target, used to ensure rules do not run if not needed.
StaticblessingsStaticoutletsStatictargetsStaticvaluesStaticshouldFinds & parses the rules for the provided target by the rules attribute,
which is determined via the identifier (e.g. data-w-rules).
Check the rules cache first, then parse the rules for caching if not found.
When parsing the rule, assume an Object.entries format or convert an
object to this format. Then ensure each value is an array of strings
for consistent comparison to FormData values.
Resolve the conditional targets based on the form data and the target(s) rule attributes and the controlled element's form data.
Staticafter
Adds the ability for a controlled form element to conditionally enable targeted elements based on the data from the controlled form along with a set of rules to match against that data.
Example: - Enable a button if a specific value is chosen