IFormProvide
interface
Form & Input
Provide/inject contract exposed by OrigamForm to its descendant fields — lets fields register/unregister themselves and report validation state back to the parent form.
TypeScript
Definition
The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.
API
Properties
Every property declared by this interface, with its type, optionality and default.
- registerrequired(item: { id: number | string vm: ComponentInternalInstance validate: () => Promise<Array<string>> reset: () => Promise<void> resetValidation: () => Promise<void> }) => void
- Called by a field on mount to register itself with the parent form.
- unregisterrequired(id: number | string) => void
- Called by a field on unmount to deregister itself.
- updaterequired(id: number | string, isValid: boolean | undefined, errorMessages: Array<string>) => void
- Called by a field after validation to report its current valid state and error messages.
- itemsRef<Array<IFormField>>
- Reactive list of all registered fields.
- isDisabledrequiredComputedRef<boolean>
- Whether the form is disabled.
- isReadonlyrequiredComputedRef<boolean>
- Whether the form is readonly.
- isValidatingRef<boolean>
- True while form validation is running.
- isValidrequiredRef<boolean | null | undefined>
- Overall form validity.
- validateOnrequiredRef<TValidateOn | undefined>
- When validation should be triggered.
Ecosystem
Used by
Components and composables that extend or consume this interface.
Usage
Examples
Ready-to-paste code snippets using this interface.
Injecting IFormProvide inside a custom field