Skip to content

Releases: logaretm/vee-validate

v4.11.8

05 Oct 22:38
Compare
Choose a tag to compare

🐛 Bug Fixes

  • (perf) Avoid triggering extra model value events #4461 (d1b5b85)

👕 TypeScript

v4.11.7

23 Sep 21:41
Compare
Choose a tag to compare

💣 Breaking Changes

  • Removed default export from the @vee-validate/rules package which caused issues for ESM importing #4470

This only affects you if you are importing all the rules.

Migration:

- import AllRules from '@vee-validate/rules';
+ import * as AllRules from '@vee-validate/rules';

👕 Types

🆕 New Features

  • Added Joi schema support thanks to @lallenfrancisl (#4463), it was sneaked in a previous release tag but it is being announced here to acknowledge that addition.
  • Valibot and Yup schemas now merge their default values with the initial form values, allowing you to use each lib's schema defaults more freely (c372718)

v4.11.6

09 Sep 22:25
Compare
Choose a tag to compare

👕 TypeScript

This release is aimed at resolving #4421

  • useForm#defineComponentBinds is now more strict and provides accurate typings for both modelValue and update:modeValue properties. Previously they were not exposed.

Try the following example.

const { defineComponentBinds } = useForm({
  validationSchema: toTypedSchema(yup.object({
    date: yup.date().required(),
    number: yup.number().required(),
    string: yup.string().required(),
    valueModel: yup.string().required(),
  })),
});

const date = defineComponentBinds('date');
const number = defineComponentBinds('number');
const string = defineComponentBinds('string');
const valueModel = defineComponentBinds('valueModel');

v4.11.5

09 Sep 22:23
Compare
Choose a tag to compare

🐛 Bug Fixes

The latest release introduced a bug with detecting external changes to models when the default updateOnValueUpdate is set to true. This release fixes that #4404 (804ec6f)

v4.11.4

09 Sep 12:31
Compare
Choose a tag to compare

🐛 Bug fixes

  • Silent validation should not mark a field as validated ( b53400e)
  • Clone the schema object before validating typed schemas to avoid outputting proxies #4459 (8f680bf)
  • Respect validateOnModelUpdate configuration #4451 #4467 (5231f43)

🆕 New features

  • feat: added reset options to force values changing to the given values without merging the old ones #4440 (4d8ed7e)

v4.11.3

23 Aug 00:31
Compare
Choose a tag to compare

This release updates valibot support to v0.13.0 and replaces the usage of deprecated API methods. #4414 (#4415)

v4.11.2

20 Aug 15:24
Compare
Choose a tag to compare

🆕 New features

You can now query fields meta state using isFieldTouched, isFieldDirty, and isFieldValid helpers on useForm.

const { isFieldDirty } = useForm();

isFieldDirty('myField') // true or false

// or compose it to be reactive:
const isFieldDirty  = computed(() => isFieldDirty('myField'));

🐛 Bug Fixes

  • Do not warn if a form or a field was resolved closes #4399 (2ff045c)

👕 Types

v4.11.1

01 Aug 23:15
Compare
Choose a tag to compare

🐛 Bug fixes

  • handleChange should now infer value as a number from Input type range (5e23dcb)

v4.11.0

30 Jul 23:59
Compare
Choose a tag to compare

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

30 Jul 14:27
Compare
Choose a tag to compare

👕 Types

  • Fixed a type issue where setErrors did not accept an array of strings #4396 (c02337f)