Skip to content

Releases: logaretm/vee-validate

v4.13.1

06 Jun 15:55
Compare
Choose a tag to compare

🆕

Updated @vee-validate/valibot to support valibot v0.31.0 #4756 (#4770) thanks to @fabian-hiller

v4.13.0

03 Jun 07:54
Compare
Choose a tag to compare

🆕 Features

  • Inject form values to yup schema contexts when using field-level rules #4753 (27fe5c8)
  • Expose setValue on Field instance and slot props #4755 (ae3772a)
  • Added ResetFormOpts arg to useResetForm #4707 (fd008c1)
  • Apply Yup/Zod transformations on field-level rules #4713 (#4754) thanks to @mehcode
  • Allow custom interpolation options for i18n #4726 (#4727) thanks to @zleight1

🐛 Bug Fixes

  • The force option not behaving correctly when passing empty objects or empty values, now it respects whatever you pass in as the new values and initial values #4680 #4729 (454bc45)
  • Offer an all export that contains all rules for @vee-validate/rules #4766 (fdb2d47)

v4.12.7

06 May 01:41
Compare
Choose a tag to compare

🐛 Bug Fixes

  • Handle TypedSchema.describe API crashing with future releases, now it just reports false for meta.required (1376794)
  • Handle meta.required for single field schema react to changes #4738 (1376794)
  • Ensure meta.required reacts to reactive form schema changes #4738 (c4415f8)

🌍 i18n

v4.12.6

10 Mar 23:15
Compare
Choose a tag to compare

🐛 Bug Fixes

  • Apply error messages again to prevent hoisted paths from being overridden 07d01fd

👕 TypeScript

  • Expose Field component interface #4657
  • Updated valibot dependency #4658

v4.12.5

29 Jan 20:38
Compare
Choose a tag to compare

🐛 Bug Fixes

  • Make sure removePathState removes the correct path state #4643 (#4649) thanks to @bgoscinski
  • Remove event arg from define field handlers for component compat #4637 (#4647)

v4.12.4

27 Dec 22:44
Compare
Choose a tag to compare

🐛 Bug Fixes

  • Check if both source and target objects are POJOs before attempting to merge them (2a09a58)

v4.12.3

16 Dec 15:17
Compare
Choose a tag to compare

🐛 Bug Fixes

  • use spec object instead of checking tests for determining the required status of a field on yup schemas #4598 (#4599)

🆕 Improvements

  • Remove deep data mutation warning #4597 (72e4379)
  • Allow path meta querying for nested fields #4575 (a18c19f)
  • Expose some state on form instance (e2171f8)

v4.12.2

29 Nov 00:25
Compare
Choose a tag to compare

🐛 Bug Fixes

  • Apply schema casts when submitting #4565 (b2203c8)
  • defineField should respect global validateOnModelUpdate config #4567 (ec8a4d7)

v4.12.1

28 Nov 04:07
Compare
Choose a tag to compare

🐛 Bug Fixes

  • resetForm not resetting unspecified fields to their original values if a partial is provided #4564 (36f6b9e)
  • resetField not setting the original value of the field causing the dirty flag to not update #4564 (36f6b9e)

DX

  • unref initial values when initializing the form #4563 (c1c6f39)

v4.12.0

26 Nov 16:23
Compare
Choose a tag to compare

💣 Breaking Changes

Deprecated reactive initial values #4402 (bbecc97)

Initial values can no longer be reactive since they did not serve any purpose for being so. The recommended API for setting async initial values is by explicitly calling resetForm.

🆕 defineField API #4497

This is a new function available on useForm and is meant to replace useFieldModel, defineInputBinds and defineComponentBinds by building upon and improving those APIs.

<script setup>
import { useForm } from 'vee-validate';

const { defineField, errors } = useForm({
  validationSchema: schema,
  validateOnMount: true,
});

const [email, emalProps] = defineField('email', { validateOnModelUpdate: true });
const [password, pwProps] = defineField('password', { validateOnModelUpdate: true });
</script>

<template>
  <input v-model="email" v-bind="emailProps" />
  <span>{{ errors.email }}</span>

  <input  v-model="password" v-bind="pwProps" />
  <span>{{ errors.password }}</span>
</div>
</template>

The docs have been updated to reflect using this new API instead of the deprecated ones. The old ones will continue to work till they get removed in next minor releases.

🆕 meta.required

Added support for meta.required state for Typed Schemas only.

That means if you are using toTypedSchema helper with either Yup, Zod, Valibot, or Global rules then it should be automatically done for you. This is a new experimental feature and may not work well with conditional schemas or dynamic ones.

For more info check the live demo link here.

🆕 DX improvements

  • feat: add label support to defineField #4530 (f9a9584)
  • feat(DX): allow getters for field arrays paths (95b701f)

🐛 Bug Fixes