The first-party validation package/plugin for FormKit. Read the validation documentation for usage instructions.
The actual validation plugin function. Everything must be bootstrapped here.
baseRules
— Base validation rules to include in the plugin. By default, FormKit makes all rules in the formkit/rules package available via the defaultConfig.Extracts all validation messages from the given node and all its descendants. This is not reactive and must be re-called each time the messages change.
node
— The FormKit node to extract validation rules from — as well as its descendants.The interface for the localized validation message registry.
FormKit validation rules are structured as on object of key/function pairs where the key of the object is the validation rule name.
Defines what fully parsed validation rules look like.
Defines what validation rules look like when they are parsed, but have not necessarily had validation rules substituted in yet.
Signature for a generic validation rule. It accepts an input — often a string — but should be able to accept any input type, and returns a boolean indicating whether or not it passed validation.