@tanstack/form-core
Advanced tools
@@ -65,3 +65,3 @@ import { Derived } from '@tanstack/store'; | ||
| */ | ||
| validateField: <TField extends DeepKeys<TFieldGroupData>>(field: TField, cause: ValidationCause) => unknown[] | Promise<unknown[]>; | ||
| validateField: <TField extends DeepKeys<TFieldGroupData>>(field: TField, cause: ValidationCause) => any[] | Promise<any[]>; | ||
| /** | ||
@@ -68,0 +68,0 @@ * Handles the form submission, performs validation, and calls the appropriate onSubmit or onSubmitInvalid callbacks. |
+10
-2
@@ -188,3 +188,11 @@ "use strict"; | ||
| const fieldInstance = this.fieldInfo[field]?.instance; | ||
| if (!fieldInstance) return []; | ||
| if (!fieldInstance) { | ||
| const { hasErrored } = this.validateSync(cause); | ||
| if (hasErrored && !this.options.asyncAlways) { | ||
| return this.getFieldMeta(field)?.errors ?? []; | ||
| } | ||
| return this.validateAsync(cause).then(() => { | ||
| return this.getFieldMeta(field)?.errors ?? []; | ||
| }); | ||
| } | ||
| if (!fieldInstance.state.meta.isTouched) { | ||
@@ -889,3 +897,3 @@ fieldInstance.setMeta((prev) => ({ ...prev, isTouched: true })); | ||
| const fieldInstance = this.getFieldInfo(fieldName)?.instance; | ||
| if (fieldInstance && !fieldInstance.options.disableErrorFlat) { | ||
| if (!fieldInstance || !fieldInstance.options.disableErrorFlat) { | ||
| fieldErrors = fieldErrors.flat(1); | ||
@@ -892,0 +900,0 @@ } |
@@ -396,3 +396,3 @@ import { Derived, Store } from '@tanstack/store'; | ||
| */ | ||
| validateField: <TField extends DeepKeys<TFormData>>(field: TField, cause: ValidationCause) => unknown[] | Promise<unknown[]>; | ||
| validateField: <TField extends DeepKeys<TFormData>>(field: TField, cause: ValidationCause) => any[] | Promise<any[]>; | ||
| /** | ||
@@ -399,0 +399,0 @@ * TODO: This code is copied from FieldApi, we should refactor to share |
@@ -65,3 +65,3 @@ import { Derived } from '@tanstack/store'; | ||
| */ | ||
| validateField: <TField extends DeepKeys<TFieldGroupData>>(field: TField, cause: ValidationCause) => unknown[] | Promise<unknown[]>; | ||
| validateField: <TField extends DeepKeys<TFieldGroupData>>(field: TField, cause: ValidationCause) => any[] | Promise<any[]>; | ||
| /** | ||
@@ -68,0 +68,0 @@ * Handles the form submission, performs validation, and calls the appropriate onSubmit or onSubmitInvalid callbacks. |
@@ -396,3 +396,3 @@ import { Derived, Store } from '@tanstack/store'; | ||
| */ | ||
| validateField: <TField extends DeepKeys<TFormData>>(field: TField, cause: ValidationCause) => unknown[] | Promise<unknown[]>; | ||
| validateField: <TField extends DeepKeys<TFormData>>(field: TField, cause: ValidationCause) => any[] | Promise<any[]>; | ||
| /** | ||
@@ -399,0 +399,0 @@ * TODO: This code is copied from FieldApi, we should refactor to share |
+10
-2
@@ -186,3 +186,11 @@ import { batch, Store, Derived } from "@tanstack/store"; | ||
| const fieldInstance = this.fieldInfo[field]?.instance; | ||
| if (!fieldInstance) return []; | ||
| if (!fieldInstance) { | ||
| const { hasErrored } = this.validateSync(cause); | ||
| if (hasErrored && !this.options.asyncAlways) { | ||
| return this.getFieldMeta(field)?.errors ?? []; | ||
| } | ||
| return this.validateAsync(cause).then(() => { | ||
| return this.getFieldMeta(field)?.errors ?? []; | ||
| }); | ||
| } | ||
| if (!fieldInstance.state.meta.isTouched) { | ||
@@ -887,3 +895,3 @@ fieldInstance.setMeta((prev) => ({ ...prev, isTouched: true })); | ||
| const fieldInstance = this.getFieldInfo(fieldName)?.instance; | ||
| if (fieldInstance && !fieldInstance.options.disableErrorFlat) { | ||
| if (!fieldInstance || !fieldInstance.options.disableErrorFlat) { | ||
| fieldErrors = fieldErrors.flat(1); | ||
@@ -890,0 +898,0 @@ } |
+1
-1
| { | ||
| "name": "@tanstack/form-core", | ||
| "version": "1.27.7", | ||
| "version": "1.28.0", | ||
| "description": "Powerful, type-safe, framework agnostic forms.", | ||
@@ -5,0 +5,0 @@ "author": "tannerlinsley", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1087130
0.18%13638
0.18%