Skip to content

Commit

Permalink
final pre-release changes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonav1992 committed Aug 30, 2024
1 parent 7b9aabb commit 5858af1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/Field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export type FieldProps<
, TShowErrors extends boolean = false
, TLabel extends string | undefined = undefined
, TFieldValue extends DeepValue<TFormValues, TFieldName> = DeepValue<TFormValues, TFieldName>
, TValidator extends SingleFieldValidator<TFormValues, TFieldName> = SingleFieldValidator<TFormValues, TFieldName>
, TShouldValidate extends boolean = true
> = ( TComponentProps extends undefined
? Omit<ComponentProps<'input'>, DuplicateProps>
Expand Down Expand Up @@ -152,7 +151,7 @@ export type FieldProps<
* validator={ zodAdapter( z.string().min(5), { isField: true } ) }
* ```
*/
validator?: TShouldValidate extends false ? never : TValidator;
validator?: TShouldValidate extends false ? never : SingleFieldValidator<TFormValues, TFieldName>;
/**
* Whether to run validation after field value is updated or the field is blurred.
* Setting this prop to `false` will cancel any validation set for the field.
Expand Down Expand Up @@ -220,7 +219,6 @@ export const Field = <
, TShowErrors
, TLabel
, TFieldValue
, TValidator
, TShouldValidate
> ) => {

Expand Down
2 changes: 1 addition & 1 deletion src/createFormStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type CreateFormStoreParams<TFormValues extends FormValues> = {
*/
manualValidationHandler?: ValidationHandler<NoInfer<TFormValues>>;
/**
* A custom input for a validation schema from a third-party library
* A custom input for a validation schema from a third-party library.
* Must be wrapped in a provided or a custom-built adapter
*/
validationSchema?: ValidationHandler<NoInfer<TFormValues>>;
Expand Down
4 changes: 1 addition & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export type ValidationHandler<TFormValues extends FormValues> =

export type SingleFieldValidator<
TFormValues extends FormValues
, TFieldName extends DeepKeys<TFormValues> = DeepKeys<TFormValues>
, TFieldName extends DeepKeys<TFormValues>
> = ( value: DeepValue<TFormValues, TFieldName> ) => Promise<string | Nullish> | string | Nullish;

/**
Expand Down Expand Up @@ -403,7 +403,6 @@ export type FieldComponent<TFormValues extends FormValues>
, TLabel extends string | undefined = undefined
, TFieldValue extends DeepValue<TFormValues, TFieldName> = DeepValue<TFormValues, TFieldName>
, TShouldValidate extends boolean = boolean
, TValidator extends SingleFieldValidator<TFormValues, TFieldName> = SingleFieldValidator<TFormValues, TFieldName>
>(
props: FieldProps<
TFormValues
Expand All @@ -412,7 +411,6 @@ export type FieldComponent<TFormValues extends FormValues>
, TShowErrors
, TLabel
, TFieldValue
, TValidator
, TShouldValidate
>
) => ReactNode;
Expand Down

0 comments on commit 5858af1

Please sign in to comment.