Releases: logaretm/vee-validate
v4.11.0
This release contains a couple of new features
🆕 Composition API setters
Added composition functions to set field and form values, meta, and errors from their child components. The functions are:
useSetFieldValue: sets a field's value.useSetFieldTouched: sets a field's touched state.useSetFieldError: sets a field's error message.useSetFormValues: sets form values.useSetFormTouched: sets multiple or all fields touched state.useSetFormErrors: sets form error messages.
🆕 Initial support for Valibot
Valibot is an impressive new schema validation library, mainly it offers Zod-like features at a much less bundle size due to its non-chainable API while still being easy to use and fully typed.
Because of this, vee-validate now supports it as a schema provider using the @vee-validate/valibot package that exposes the same API function toTypedSchema that you can use to get TypeScript support into your forms input and output values.
Quick example:
import { useForm } from 'vee-validate';
import { toTypedSchema } from '@vee-validate/valibot';
import { email, string, minLength, object } from 'valibot';
const { errors, values } = useForm({
validationSchema: toTypedSchema(
object({
email: string([minLength(1, 'Email is required'), email()]),
password: string([minLength(6, 'password too short')]),
}),
),
});Refer to the docs for live examples and more information on typed schemas.
v4.10.9
v4.10.8
v4.10.7
v4.10.6
✨ Behavior Changes
This is because it was causing modal forms to have errors on mounted which confused users. This does not effectively change anything other than you will no longer need to reset the form whenever the modal is shown or when the fields are mounted. If you relied on this behavior then it could be a breaking change for you and you can get it back by enabling validateOnMount or calling validate whenever.
This does not affect initial errors or validateOnMount option.
🐛 Bug Fixes
- resetForm should cast typed schema values closes #4347 (e9b215a)
- validate form values on setValues by default closes #4359 (4e11ff9)
- normalize error paths to use brackets for indices closes #4211 (e354a13)
⚙️ Misc
v4.10.5
v4.10.4
v4.10.3
🐛 Bug Fixes
- SSR: Avoid referencing window with
setTimeoutfor validation batching #4339 (#4340) thanks to @userquin 🙌 - Respect model modifiers when emitting the value with
useFieldv-model integration #4333 (c3698f0)
✨ Enhancements
Made object dirty meta checks less strict by treating undefined and missing keys as the same value #4338 (32537e1)
This may cause some differences with the value of dirty meta for forms and object value fields but it shouldn't affect most cases.