diff --git a/docs/framework/angular/reference/classes/tanstackfield.md b/docs/framework/angular/reference/classes/tanstackfield.md deleted file mode 100644 index c15d5b235..000000000 --- a/docs/framework/angular/reference/classes/tanstackfield.md +++ /dev/null @@ -1,321 +0,0 @@ ---- -id: TanStackField -title: TanStackField ---- - - - -# Class: TanStackField\ - -Defined in: [tanstack-field.directive.ts:31](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L31) - -## Type Parameters - -• **TParentData** - -• **TName** *extends* `DeepKeys`\<`TParentData`\> - -• **TData** *extends* `DeepValue`\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TSubmitMeta** - -## Implements - -- `OnInit` -- `OnChanges` -- `OnDestroy` -- `FieldOptions`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`\> - -## Constructors - -### new TanStackField() - -```ts -new TanStackField(): TanStackField -``` - -#### Returns - -[`TanStackField`](tanstackfield.md)\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TSubmitMeta`\> - -## Properties - -### api - -```ts -api: FieldApi; -``` - -Defined in: [tanstack-field.directive.ts:129](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L129) - -*** - -### asyncAlways? - -```ts -optional asyncAlways: boolean; -``` - -Defined in: [tanstack-field.directive.ts:78](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L78) - -If `true`, always run async validation, even if there are errors emitted during synchronous validation. - -#### Implementation of - -```ts -FieldOptions.asyncAlways -``` - -*** - -### asyncDebounceMs? - -```ts -optional asyncDebounceMs: number; -``` - -Defined in: [tanstack-field.directive.ts:77](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L77) - -The default time to debounce async validation if there is not a more specific debounce time passed. - -#### Implementation of - -```ts -FieldOptions.asyncDebounceMs -``` - -*** - -### defaultMeta? - -```ts -optional defaultMeta: Partial>; -``` - -Defined in: [tanstack-field.directive.ts:106](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L106) - -An optional object with default metadata for the field. - -#### Implementation of - -```ts -FieldOptions.defaultMeta -``` - -*** - -### defaultValue? - -```ts -optional defaultValue: NoInfer; -``` - -Defined in: [tanstack-field.directive.ts:76](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L76) - -An optional default value for the field. - -#### Implementation of - -```ts -FieldOptions.defaultValue -``` - -*** - -### disableErrorFlat? - -```ts -optional disableErrorFlat: boolean; -``` - -Defined in: [tanstack-field.directive.ts:127](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L127) - -Disable the `flat(1)` operation on `field.errors`. This is useful if you want to keep the error structure as is. Not suggested for most use-cases. - -#### Implementation of - -```ts -FieldOptions.disableErrorFlat -``` - -*** - -### listeners? - -```ts -optional listeners: NoInfer>; -``` - -Defined in: [tanstack-field.directive.ts:105](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L105) - -A list of listeners which attach to the corresponding events - -#### Implementation of - -```ts -FieldOptions.listeners -``` - -*** - -### name - -```ts -name: TName; -``` - -Defined in: [tanstack-field.directive.ts:75](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L75) - -The field name. The type will be `DeepKeys` to ensure your name is a deep key of the parent dataset. - -#### Implementation of - -```ts -FieldOptions.name -``` - -*** - -### tanstackField - -```ts -tanstackField: FormApi; -``` - -Defined in: [tanstack-field.directive.ts:79](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L79) - -*** - -### unmount()? - -```ts -optional unmount: () => void; -``` - -Defined in: [tanstack-field.directive.ts:185](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L185) - -#### Returns - -`void` - -*** - -### validators? - -```ts -optional validators: NoInfer>; -``` - -Defined in: [tanstack-field.directive.ts:91](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L91) - -A list of validators to pass to the field - -#### Implementation of - -```ts -FieldOptions.validators -``` - -## Methods - -### ngOnChanges() - -```ts -ngOnChanges(): void -``` - -Defined in: [tanstack-field.directive.ts:197](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L197) - -A callback method that is invoked immediately after the -default change detector has checked data-bound properties -if at least one has changed, and before the view and content -children are checked. - -#### Returns - -`void` - -#### Implementation of - -```ts -OnChanges.ngOnChanges -``` - -*** - -### ngOnDestroy() - -```ts -ngOnDestroy(): void -``` - -Defined in: [tanstack-field.directive.ts:193](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L193) - -A callback method that performs custom clean-up, invoked immediately -before a directive, pipe, or service instance is destroyed. - -#### Returns - -`void` - -#### Implementation of - -```ts -OnDestroy.ngOnDestroy -``` - -*** - -### ngOnInit() - -```ts -ngOnInit(): void -``` - -Defined in: [tanstack-field.directive.ts:187](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L187) - -A callback method that is invoked immediately after the -default change detector has checked the directive's -data-bound properties for the first time, -and before any of the view or content children have been checked. -It is invoked only once when the directive is instantiated. - -#### Returns - -`void` - -#### Implementation of - -```ts -OnInit.ngOnInit -``` diff --git a/docs/framework/angular/reference/functions/injectform.md b/docs/framework/angular/reference/functions/injectform.md deleted file mode 100644 index 08bdeed3c..000000000 --- a/docs/framework/angular/reference/functions/injectform.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -id: injectForm -title: injectForm ---- - - - -# Function: injectForm() - -```ts -function injectForm(opts?): FormApi -``` - -Defined in: [inject-form.ts:9](https://github.com/TanStack/form/blob/main/packages/angular-form/src/inject-form.ts#L9) - -## Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TSubmitMeta** - -## Parameters - -### opts? - -`FormOptions`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> - -## Returns - -`FormApi`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> diff --git a/docs/framework/angular/reference/functions/injectstore.md b/docs/framework/angular/reference/functions/injectstore.md deleted file mode 100644 index fad9e10ed..000000000 --- a/docs/framework/angular/reference/functions/injectstore.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -id: injectStore -title: injectStore ---- - - - -# Function: injectStore() - -```ts -function injectStore(form, selector?): Signal -``` - -Defined in: [inject-store.ts:9](https://github.com/TanStack/form/blob/main/packages/angular-form/src/inject-store.ts#L9) - -## Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TSubmitMeta** - -• **TSelected** = `NoInfer`\<`FormState`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`\>\> - -## Parameters - -### form - -`FormApi`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> - -### selector? - -(`state`) => `TSelected` - -## Returns - -`Signal`\<`TSelected`\> diff --git a/docs/framework/angular/reference/index.md b/docs/framework/angular/reference/index.md deleted file mode 100644 index 3110ff697..000000000 --- a/docs/framework/angular/reference/index.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -id: "@tanstack/angular-form" -title: "@tanstack/angular-form" ---- - - - -# @tanstack/angular-form - -## Classes - -- [TanStackField](classes/tanstackfield.md) - -## Functions - -- [injectForm](functions/injectform.md) -- [injectStore](functions/injectstore.md) diff --git a/docs/framework/lit/reference/classes/tanstackformcontroller.md b/docs/framework/lit/reference/classes/tanstackformcontroller.md deleted file mode 100644 index dcc822099..000000000 --- a/docs/framework/lit/reference/classes/tanstackformcontroller.md +++ /dev/null @@ -1,187 +0,0 @@ ---- -id: TanStackFormController -title: TanStackFormController ---- - - - -# Class: TanStackFormController\ - -Defined in: [tanstack-form-controller.ts:190](https://github.com/TanStack/form/blob/main/packages/lit-form/src/tanstack-form-controller.ts#L190) - -## Type Parameters - -• **TParentData** - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TSubmitMeta** - -## Implements - -- `ReactiveController` - -## Constructors - -### new TanStackFormController() - -```ts -new TanStackFormController(host, config?): TanStackFormController -``` - -Defined in: [tanstack-form-controller.ts:219](https://github.com/TanStack/form/blob/main/packages/lit-form/src/tanstack-form-controller.ts#L219) - -#### Parameters - -##### host - -`ReactiveControllerHost` - -##### config? - -`FormOptions`\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TSubmitMeta`\> - -#### Returns - -[`TanStackFormController`](tanstackformcontroller.md)\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TSubmitMeta`\> - -## Properties - -### api - -```ts -api: FormApi; -``` - -Defined in: [tanstack-form-controller.ts:206](https://github.com/TanStack/form/blob/main/packages/lit-form/src/tanstack-form-controller.ts#L206) - -## Methods - -### field() - -```ts -field(fieldConfig, render): object -``` - -Defined in: [tanstack-form-controller.ts:260](https://github.com/TanStack/form/blob/main/packages/lit-form/src/tanstack-form-controller.ts#L260) - -#### Type Parameters - -• **TName** *extends* `string` \| `number` - -• **TData** - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -#### Parameters - -##### fieldConfig - -`FieldOptions`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`\> - -##### render - -`renderCallback`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TSubmitMeta`\> - -#### Returns - -`object` - -##### values - -```ts -values: object; -``` - -###### values.form - -```ts -form: FormApi; -``` - -###### values.options - -```ts -options: FieldOptions; -``` - -###### values.render - -```ts -render: renderCallback; -``` - -*** - -### hostConnected() - -```ts -hostConnected(): void -``` - -Defined in: [tanstack-form-controller.ts:250](https://github.com/TanStack/form/blob/main/packages/lit-form/src/tanstack-form-controller.ts#L250) - -Called when the host is connected to the component tree. For custom -element hosts, this corresponds to the `connectedCallback()` lifecycle, -which is only called when the component is connected to the document. - -#### Returns - -`void` - -#### Implementation of - -```ts -ReactiveController.hostConnected -``` - -*** - -### hostDisconnected() - -```ts -hostDisconnected(): void -``` - -Defined in: [tanstack-form-controller.ts:256](https://github.com/TanStack/form/blob/main/packages/lit-form/src/tanstack-form-controller.ts#L256) - -Called when the host is disconnected from the component tree. For custom -element hosts, this corresponds to the `disconnectedCallback()` lifecycle, -which is called the host or an ancestor component is disconnected from the -document. - -#### Returns - -`void` - -#### Implementation of - -```ts -ReactiveController.hostDisconnected -``` diff --git a/docs/framework/lit/reference/index.md b/docs/framework/lit/reference/index.md deleted file mode 100644 index 7bb43cc14..000000000 --- a/docs/framework/lit/reference/index.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -id: "@tanstack/lit-form" -title: "@tanstack/lit-form" ---- - - - -# @tanstack/lit-form - -## Classes - -- [TanStackFormController](classes/tanstackformcontroller.md) diff --git a/docs/framework/react/reference/functions/createformhook.md b/docs/framework/react/reference/functions/createformhook.md deleted file mode 100644 index db9eb4b27..000000000 --- a/docs/framework/react/reference/functions/createformhook.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -id: createFormHook -title: createFormHook ---- - - - -# Function: createFormHook() - -```ts -function createFormHook(__namedParameters): object -``` - -Defined in: [packages/react-form/src/createFormHook.tsx:186](https://github.com/TanStack/form/blob/main/packages/react-form/src/createFormHook.tsx#L186) - -## Type Parameters - -• **TComponents** *extends* `Record`\<`string`, `ComponentType`\<`any`\>\> - -• **TFormComponents** *extends* `Record`\<`string`, `ComponentType`\<`any`\>\> - -## Parameters - -### \_\_namedParameters - -`CreateFormHookProps`\<`TComponents`, `TFormComponents`\> - -## Returns - -`object` - -### useAppForm() - -```ts -useAppForm: (props) => AppFieldExtendedReactFormApi; -``` - -#### Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TSubmitMeta** - -#### Parameters - -##### props - -`FormOptions`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> - -#### Returns - -`AppFieldExtendedReactFormApi`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`, `TComponents`, `TFormComponents`\> - -### withForm() - -```ts -withForm: (__namedParameters) => (props) => Element; -``` - -#### Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TSubmitMeta** - -• **TRenderProps** *extends* `Record`\<`string`, `unknown`\> = \{\} - -#### Parameters - -##### \_\_namedParameters - -`WithFormProps`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`, `TComponents`, `TFormComponents`, `TRenderProps`\> - -#### Returns - -`Function` - -##### Parameters - -###### props - -`PropsWithChildren`\<`NoInfer`\<`TRenderProps`\> & `object`\> - -##### Returns - -`Element` diff --git a/docs/framework/react/reference/functions/createformhookcontexts.md b/docs/framework/react/reference/functions/createformhookcontexts.md deleted file mode 100644 index d169d39e2..000000000 --- a/docs/framework/react/reference/functions/createformhookcontexts.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -id: createFormHookContexts -title: createFormHookContexts ---- - - - -# Function: createFormHookContexts() - -```ts -function createFormHookContexts(): object -``` - -Defined in: [packages/react-form/src/createFormHook.tsx:16](https://github.com/TanStack/form/blob/main/packages/react-form/src/createFormHook.tsx#L16) - -## Returns - -`object` - -### fieldContext - -```ts -fieldContext: Context; -``` - -### formContext - -```ts -formContext: Context; -``` - -### useFieldContext() - -```ts -useFieldContext: () => FieldApi; -``` - -#### Type Parameters - -• **TData** - -#### Returns - -`FieldApi`\<`any`, `string`, `TData`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`\> - -### useFormContext() - -```ts -useFormContext: () => ReactFormExtendedApi, any, any, any, any, any, any, any, any, any>; -``` - -#### Returns - -[`ReactFormExtendedApi`](../type-aliases/reactformextendedapi.md)\<`Record`\<`string`, `never`\>, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`\> diff --git a/docs/framework/react/reference/functions/field.md b/docs/framework/react/reference/functions/field.md deleted file mode 100644 index 1f9a8accb..000000000 --- a/docs/framework/react/reference/functions/field.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -id: Field -title: Field ---- - - - -# Function: Field() - -```ts -function Field(__namedParameters): ReactNode -``` - -Defined in: [packages/react-form/src/useField.tsx:369](https://github.com/TanStack/form/blob/main/packages/react-form/src/useField.tsx#L369) - -A function component that takes field options and a render function as children and returns a React component. - -The `Field` component uses the `useField` hook internally to manage the field instance. - -## Type Parameters - -• **TParentData** - -• **TName** *extends* `string` \| `number` - -• **TData** - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TPatentSubmitMeta** - -## Parameters - -### \_\_namedParameters - -`FieldComponentProps`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TPatentSubmitMeta`\> - -## Returns - -`ReactNode` diff --git a/docs/framework/react/reference/functions/usefield.md b/docs/framework/react/reference/functions/usefield.md deleted file mode 100644 index 3129ca3e7..000000000 --- a/docs/framework/react/reference/functions/usefield.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -id: useField -title: useField ---- - - - -# Function: useField() - -```ts -function useField(opts): FieldApi & ReactFieldApi -``` - -Defined in: [packages/react-form/src/useField.tsx:130](https://github.com/TanStack/form/blob/main/packages/react-form/src/useField.tsx#L130) - -A hook for managing a field in a form. - -## Type Parameters - -• **TParentData** - -• **TName** *extends* `string` \| `number` - -• **TData** - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TPatentSubmitMeta** - -## Parameters - -### opts - -`UseFieldOptions`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TPatentSubmitMeta`\> - -An object with field options. - -## Returns - -`FieldApi`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TPatentSubmitMeta`\> & `ReactFieldApi`\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TPatentSubmitMeta`\> - -The `FieldApi` instance for the specified field. diff --git a/docs/framework/react/reference/functions/useform.md b/docs/framework/react/reference/functions/useform.md deleted file mode 100644 index cc3de3c7a..000000000 --- a/docs/framework/react/reference/functions/useform.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: useForm -title: useForm ---- - - - -# Function: useForm() - -```ts -function useForm(opts?): ReactFormExtendedApi -``` - -Defined in: [packages/react-form/src/useForm.tsx:142](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L142) - -A custom React Hook that returns an extended instance of the `FormApi` class. - -This API encapsulates all the necessary functionalities related to the form. It allows you to manage form state, handle submissions, and interact with form fields - -## Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TSubmitMeta** - -## Parameters - -### opts? - -`FormOptions`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> - -## Returns - -[`ReactFormExtendedApi`](../type-aliases/reactformextendedapi.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> diff --git a/docs/framework/react/reference/functions/usestore.md b/docs/framework/react/reference/functions/usestore.md deleted file mode 100644 index 2b982db00..000000000 --- a/docs/framework/react/reference/functions/usestore.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -id: useStore -title: useStore ---- - - - -# Function: useStore() - -## Call Signature - -```ts -function useStore(store, selector?): TSelected -``` - -Defined in: node\_modules/.pnpm/@tanstack+react-store@0.7.0\_react-dom@19.0.0\_react@19.0.0\_\_react@19.0.0/node\_modules/@tanstack/react-store/dist/esm/index.d.ts:7 - -### Type Parameters - -• **TState** - -• **TSelected** = `NoInfer`\<`TState`\> - -### Parameters - -#### store - -`Store`\<`TState`, `any`\> - -#### selector? - -(`state`) => `TSelected` - -### Returns - -`TSelected` - -## Call Signature - -```ts -function useStore(store, selector?): TSelected -``` - -Defined in: node\_modules/.pnpm/@tanstack+react-store@0.7.0\_react-dom@19.0.0\_react@19.0.0\_\_react@19.0.0/node\_modules/@tanstack/react-store/dist/esm/index.d.ts:8 - -### Type Parameters - -• **TState** - -• **TSelected** = `NoInfer`\<`TState`\> - -### Parameters - -#### store - -`Derived`\<`TState`, `any`\> - -#### selector? - -(`state`) => `TSelected` - -### Returns - -`TSelected` diff --git a/docs/framework/react/reference/functions/usetransform.md b/docs/framework/react/reference/functions/usetransform.md deleted file mode 100644 index f91816ca4..000000000 --- a/docs/framework/react/reference/functions/usetransform.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: useTransform -title: useTransform ---- - - - -# Function: useTransform() - -```ts -function useTransform(fn, deps): FormTransform -``` - -Defined in: [packages/react-form/src/useTransform.ts:8](https://github.com/TanStack/form/blob/main/packages/react-form/src/useTransform.ts#L8) - -## Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TSubmitMeta** - -## Parameters - -### fn - -(`formBase`) => `FormApi`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> - -### deps - -`unknown`[] - -## Returns - -`FormTransform`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> diff --git a/docs/framework/react/reference/index.md b/docs/framework/react/reference/index.md deleted file mode 100644 index 509a0026a..000000000 --- a/docs/framework/react/reference/index.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -id: "@tanstack/react-form" -title: "@tanstack/react-form" ---- - - - -# @tanstack/react-form - -## Interfaces - -- [ReactFormApi](interfaces/reactformapi.md) - -## Type Aliases - -- [FieldComponent](type-aliases/fieldcomponent.md) -- [ReactFormExtendedApi](type-aliases/reactformextendedapi.md) -- [UseField](type-aliases/usefield.md) - -## Functions - -- [createFormHook](functions/createformhook.md) -- [createFormHookContexts](functions/createformhookcontexts.md) -- [Field](functions/field.md) -- [useField](functions/usefield.md) -- [useForm](functions/useform.md) -- [useStore](functions/usestore.md) -- [useTransform](functions/usetransform.md) diff --git a/docs/framework/react/reference/interfaces/reactformapi.md b/docs/framework/react/reference/interfaces/reactformapi.md deleted file mode 100644 index 96896a2f2..000000000 --- a/docs/framework/react/reference/interfaces/reactformapi.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -id: ReactFormApi -title: ReactFormApi ---- - - - -# Interface: ReactFormApi\ - -Defined in: [packages/react-form/src/useForm.tsx:21](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L21) - -Fields that are added onto the `FormAPI` from `@tanstack/form-core` and returned from `useForm` - -## Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TSubmitMeta** - -## Properties - -### Field - -```ts -Field: FieldComponent; -``` - -Defined in: [packages/react-form/src/useForm.tsx:36](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L36) - -A React component to render form fields. With this, you can render and manage individual form fields. - -*** - -### Subscribe() - -```ts -Subscribe: (props) => ReactNode; -``` - -Defined in: [packages/react-form/src/useForm.tsx:51](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L51) - -A `Subscribe` function that allows you to listen and react to changes in the form's state. It's especially useful when you need to execute side effects or render specific components in response to state updates. - -#### Type Parameters - -• **TSelected** = `FormState`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`\> - -#### Parameters - -##### props - -###### children - -`ReactNode` \| (`state`) => `ReactNode` - -###### selector? - -(`state`) => `TSelected` - -#### Returns - -`ReactNode` diff --git a/docs/framework/react/reference/type-aliases/fieldcomponent.md b/docs/framework/react/reference/type-aliases/fieldcomponent.md deleted file mode 100644 index 940f32542..000000000 --- a/docs/framework/react/reference/type-aliases/fieldcomponent.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -id: FieldComponent -title: FieldComponent ---- - - - -# Type Alias: FieldComponent()\ - -```ts -type FieldComponent = ({ - children, - ...fieldOptions -}) => ReactNode; -``` - -Defined in: [packages/react-form/src/useField.tsx:307](https://github.com/TanStack/form/blob/main/packages/react-form/src/useField.tsx#L307) - -A type alias representing a field component for a specific form data type. - -## Type Parameters - -• **TParentData** - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TPatentSubmitMeta** - -• **ExtendedApi** = \{\} - -## Type Parameters - -• **TName** *extends* `DeepKeys`\<`TParentData`\> - -• **TData** *extends* `DeepValue`\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -## Parameters - -### \{ - children, - ...fieldOptions -\} - -`Omit`\<`FieldComponentProps`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TPatentSubmitMeta`, `ExtendedApi`\>, `"form"`\> - -## Returns - -`ReactNode` diff --git a/docs/framework/react/reference/type-aliases/reactformextendedapi.md b/docs/framework/react/reference/type-aliases/reactformextendedapi.md deleted file mode 100644 index 64961b7c8..000000000 --- a/docs/framework/react/reference/type-aliases/reactformextendedapi.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -id: ReactFormExtendedApi -title: ReactFormExtendedApi ---- - - - -# Type Alias: ReactFormExtendedApi\ - -```ts -type ReactFormExtendedApi = FormApi & ReactFormApi; -``` - -Defined in: [packages/react-form/src/useForm.tsx:88](https://github.com/TanStack/form/blob/main/packages/react-form/src/useForm.tsx#L88) - -An extended version of the `FormApi` class that includes React-specific functionalities from `ReactFormApi` - -## Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TSubmitMeta** diff --git a/docs/framework/react/reference/type-aliases/usefield.md b/docs/framework/react/reference/type-aliases/usefield.md deleted file mode 100644 index 3d3226bab..000000000 --- a/docs/framework/react/reference/type-aliases/usefield.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -id: UseField -title: UseField ---- - - - -# Type Alias: UseField()\ - -```ts -type UseField = (opts) => FieldApi; -``` - -Defined in: [packages/react-form/src/useField.tsx:50](https://github.com/TanStack/form/blob/main/packages/react-form/src/useField.tsx#L50) - -A type representing a hook for using a field in a form with the given form data type. - -A function that takes an optional object with a `name` property and field options, and returns a `FieldApi` instance for the specified field. - -## Type Parameters - -• **TParentData** - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TPatentSubmitMeta** - -## Type Parameters - -• **TName** *extends* `DeepKeys`\<`TParentData`\> - -• **TData** *extends* `DeepValue`\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -## Parameters - -### opts - -`Omit`\<`UseFieldOptions`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TPatentSubmitMeta`\>, `"form"`\> - -## Returns - -`FieldApi`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TPatentSubmitMeta`\> diff --git a/docs/framework/solid/reference/functions/createfield.md b/docs/framework/solid/reference/functions/createfield.md deleted file mode 100644 index f70062a3d..000000000 --- a/docs/framework/solid/reference/functions/createfield.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -id: createField -title: createField ---- - - - -# Function: createField() - -```ts -function createField(opts): () => FieldApi & SolidFieldApi -``` - -Defined in: [packages/solid-form/src/createField.tsx:237](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L237) - -## Type Parameters - -• **TParentData** - -• **TName** *extends* `string` \| `number` - -• **TData** - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TParentSubmitMeta** - -## Parameters - -### opts - -() => `CreateFieldOptions`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\> - -## Returns - -`Function` - -### Returns - -`FieldApi`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\> & `SolidFieldApi`\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\> diff --git a/docs/framework/solid/reference/functions/createform.md b/docs/framework/solid/reference/functions/createform.md deleted file mode 100644 index 0be913e98..000000000 --- a/docs/framework/solid/reference/functions/createform.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -id: createForm -title: createForm ---- - - - -# Function: createForm() - -```ts -function createForm(opts?): FormApi & SolidFormApi -``` - -Defined in: [packages/solid-form/src/createForm.tsx:115](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L115) - -## Type Parameters - -• **TParentData** - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TSubmitMeta** - -## Parameters - -### opts? - -() => `FormOptions`\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TSubmitMeta`\> - -## Returns - -`FormApi`\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TSubmitMeta`\> & [`SolidFormApi`](../interfaces/solidformapi.md)\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TSubmitMeta`\> diff --git a/docs/framework/solid/reference/functions/field.md b/docs/framework/solid/reference/functions/field.md deleted file mode 100644 index b44ddf3c5..000000000 --- a/docs/framework/solid/reference/functions/field.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -id: Field -title: Field ---- - - - -# Function: Field() - -```ts -function Field(props): Element -``` - -Defined in: [packages/solid-form/src/createField.tsx:481](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L481) - -## Type Parameters - -• **TParentData** - -• **TName** *extends* `string` \| `number` - -• **TData** - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TParentSubmitMeta** - -## Parameters - -### props - -`object` & `FieldApiOptions`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\> & `object` - -## Returns - -`Element` diff --git a/docs/framework/solid/reference/functions/usestore.md b/docs/framework/solid/reference/functions/usestore.md deleted file mode 100644 index a2456113e..000000000 --- a/docs/framework/solid/reference/functions/usestore.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -id: useStore -title: useStore ---- - - - -# Function: useStore() - -## Call Signature - -```ts -function useStore(store, selector?): Accessor -``` - -Defined in: node\_modules/.pnpm/@tanstack+solid-store@0.7.0\_solid-js@1.9.4/node\_modules/@tanstack/solid-store/dist/esm/index.d.ts:8 - -### Type Parameters - -• **TState** - -• **TSelected** = `NoInfer`\<`TState`\> - -### Parameters - -#### store - -`Store`\<`TState`, `any`\> - -#### selector? - -(`state`) => `TSelected` - -### Returns - -`Accessor`\<`TSelected`\> - -## Call Signature - -```ts -function useStore(store, selector?): Accessor -``` - -Defined in: node\_modules/.pnpm/@tanstack+solid-store@0.7.0\_solid-js@1.9.4/node\_modules/@tanstack/solid-store/dist/esm/index.d.ts:9 - -### Type Parameters - -• **TState** - -• **TSelected** = `NoInfer`\<`TState`\> - -### Parameters - -#### store - -`Derived`\<`TState`, `any`\> - -#### selector? - -(`state`) => `TSelected` - -### Returns - -`Accessor`\<`TSelected`\> diff --git a/docs/framework/solid/reference/index.md b/docs/framework/solid/reference/index.md deleted file mode 100644 index 29000ff25..000000000 --- a/docs/framework/solid/reference/index.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -id: "@tanstack/solid-form" -title: "@tanstack/solid-form" ---- - - - -# @tanstack/solid-form - -## Interfaces - -- [SolidFormApi](interfaces/solidformapi.md) - -## Type Aliases - -- [CreateField](type-aliases/createfield.md) -- [FieldComponent](type-aliases/fieldcomponent.md) - -## Functions - -- [createField](functions/createfield.md) -- [createForm](functions/createform.md) -- [Field](functions/field.md) -- [useStore](functions/usestore.md) diff --git a/docs/framework/solid/reference/interfaces/solidformapi.md b/docs/framework/solid/reference/interfaces/solidformapi.md deleted file mode 100644 index f8a9c5951..000000000 --- a/docs/framework/solid/reference/interfaces/solidformapi.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -id: SolidFormApi -title: SolidFormApi ---- - - - -# Interface: SolidFormApi\ - -Defined in: [packages/solid-form/src/createForm.tsx:14](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L14) - -## Type Parameters - -• **TParentData** - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TSubmitMeta** - -## Properties - -### createField - -```ts -createField: CreateField; -``` - -Defined in: [packages/solid-form/src/createForm.tsx:38](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L38) - -*** - -### Field - -```ts -Field: FieldComponent; -``` - -Defined in: [packages/solid-form/src/createForm.tsx:26](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L26) - -*** - -### Subscribe() - -```ts -Subscribe: (props) => Element; -``` - -Defined in: [packages/solid-form/src/createForm.tsx:81](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L81) - -#### Type Parameters - -• **TSelected** = `NoInfer`\<`FormState`\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`\>\> - -#### Parameters - -##### props - -###### children - -`Element` \| (`state`) => `Element` - -###### selector? - -(`state`) => `TSelected` - -#### Returns - -`Element` - -*** - -### useStore() - -```ts -useStore: (selector?) => () => TSelected; -``` - -Defined in: [packages/solid-form/src/createForm.tsx:50](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createForm.tsx#L50) - -#### Type Parameters - -• **TSelected** = `NoInfer`\<`FormState`\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`\>\> - -#### Parameters - -##### selector? - -(`state`) => `TSelected` - -#### Returns - -`Function` - -##### Returns - -`TSelected` diff --git a/docs/framework/solid/reference/type-aliases/createfield.md b/docs/framework/solid/reference/type-aliases/createfield.md deleted file mode 100644 index bacbe6a84..000000000 --- a/docs/framework/solid/reference/type-aliases/createfield.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -id: CreateField -title: CreateField ---- - - - -# Type Alias: CreateField()\ - -```ts -type CreateField = (opts) => () => FieldApi & SolidFieldApi; -``` - -Defined in: [packages/solid-form/src/createField.tsx:49](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L49) - -## Type Parameters - -• **TParentData** - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TParentSubmitMeta** - -## Type Parameters - -• **TName** *extends* `DeepKeys`\<`TParentData`\> - -• **TData** *extends* `DeepValue`\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TSubmitMeta** - -## Parameters - -### opts - -() => `object` & `Omit`\<`CreateFieldOptions`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TSubmitMeta`\>, `"form"`\> - -## Returns - -`Function` - -### Returns - -`FieldApi`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\> & `SolidFieldApi`\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\> diff --git a/docs/framework/solid/reference/type-aliases/fieldcomponent.md b/docs/framework/solid/reference/type-aliases/fieldcomponent.md deleted file mode 100644 index cc68c60fa..000000000 --- a/docs/framework/solid/reference/type-aliases/fieldcomponent.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -id: FieldComponent -title: FieldComponent ---- - - - -# Type Alias: FieldComponent()\ - -```ts -type FieldComponent = ({ - children, - ...fieldOptions -}) => JSXElement; -``` - -Defined in: [packages/solid-form/src/createField.tsx:426](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L426) - -## Type Parameters - -• **TParentData** - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TParentSubmitMeta** - -## Type Parameters - -• **TName** *extends* `DeepKeys`\<`TParentData`\> - -• **TData** *extends* `DeepValue`\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -## Parameters - -### \{ - children, - ...fieldOptions -\} - -`Omit`\<`FieldComponentProps`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\>, `"form"`\> - -## Returns - -`JSXElement` diff --git a/docs/framework/vue/reference/functions/usefield.md b/docs/framework/vue/reference/functions/usefield.md deleted file mode 100644 index 7ac8f59fc..000000000 --- a/docs/framework/vue/reference/functions/usefield.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -id: useField -title: useField ---- - - - -# Function: useField() - -```ts -function useField(opts): object -``` - -Defined in: [packages/vue-form/src/useField.tsx:303](https://github.com/TanStack/form/blob/main/packages/vue-form/src/useField.tsx#L303) - -## Type Parameters - -• **TParentData** - -• **TName** *extends* `string` \| `number` - -• **TData** - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TParentSubmitMeta** - -## Parameters - -### opts - -`UseFieldOptions`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\> - -## Returns - -`object` - -### api - -```ts -readonly api: FieldApi & VueFieldApi = fieldApi; -``` - -### state - -```ts -readonly state: Readonly, FieldState>> = fieldState; -``` diff --git a/docs/framework/vue/reference/functions/useform.md b/docs/framework/vue/reference/functions/useform.md deleted file mode 100644 index 3feb93bbf..000000000 --- a/docs/framework/vue/reference/functions/useform.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -id: useForm -title: useForm ---- - - - -# Function: useForm() - -```ts -function useForm(opts?): FormApi & VueFormApi -``` - -Defined in: [packages/vue-form/src/useForm.tsx:195](https://github.com/TanStack/form/blob/main/packages/vue-form/src/useForm.tsx#L195) - -## Type Parameters - -• **TParentData** - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TSubmitMeta** - -## Parameters - -### opts? - -`FormOptions`\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TSubmitMeta`\> - -## Returns - -`FormApi`\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TSubmitMeta`\> & [`VueFormApi`](../interfaces/vueformapi.md)\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TSubmitMeta`\> diff --git a/docs/framework/vue/reference/functions/usestore.md b/docs/framework/vue/reference/functions/usestore.md deleted file mode 100644 index ff39b8e48..000000000 --- a/docs/framework/vue/reference/functions/usestore.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -id: useStore -title: useStore ---- - - - -# Function: useStore() - -## Call Signature - -```ts -function useStore(store, selector?): Readonly> -``` - -Defined in: node\_modules/.pnpm/@tanstack+vue-store@0.7.0\_vue@3.5.13\_typescript@5.8.2\_/node\_modules/@tanstack/vue-store/dist/esm/index.d.ts:8 - -### Type Parameters - -• **TState** - -• **TSelected** = `NoInfer`\<`TState`\> - -### Parameters - -#### store - -`Store`\<`TState`, `any`\> - -#### selector? - -(`state`) => `TSelected` - -### Returns - -`Readonly`\<`Ref`\<`TSelected`, `TSelected`\>\> - -## Call Signature - -```ts -function useStore(store, selector?): Readonly> -``` - -Defined in: node\_modules/.pnpm/@tanstack+vue-store@0.7.0\_vue@3.5.13\_typescript@5.8.2\_/node\_modules/@tanstack/vue-store/dist/esm/index.d.ts:9 - -### Type Parameters - -• **TState** - -• **TSelected** = `NoInfer`\<`TState`\> - -### Parameters - -#### store - -`Derived`\<`TState`, `any`\> - -#### selector? - -(`state`) => `TSelected` - -### Returns - -`Readonly`\<`Ref`\<`TSelected`, `TSelected`\>\> diff --git a/docs/framework/vue/reference/index.md b/docs/framework/vue/reference/index.md deleted file mode 100644 index 0ff69a5aa..000000000 --- a/docs/framework/vue/reference/index.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -id: "@tanstack/vue-form" -title: "@tanstack/vue-form" ---- - - - -# @tanstack/vue-form - -## Interfaces - -- [VueFieldApi](interfaces/vuefieldapi.md) -- [VueFormApi](interfaces/vueformapi.md) - -## Type Aliases - -- [FieldComponent](type-aliases/fieldcomponent.md) -- [FieldComponentProps](type-aliases/fieldcomponentprops.md) -- [UseField](type-aliases/usefield.md) - -## Variables - -- [Field](variables/field.md) - -## Functions - -- [useField](functions/usefield.md) -- [useForm](functions/useform.md) -- [useStore](functions/usestore.md) diff --git a/docs/framework/vue/reference/interfaces/vuefieldapi.md b/docs/framework/vue/reference/interfaces/vuefieldapi.md deleted file mode 100644 index 7ac8a49fd..000000000 --- a/docs/framework/vue/reference/interfaces/vuefieldapi.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -id: VueFieldApi -title: VueFieldApi ---- - - - -# Interface: VueFieldApi\ - -Defined in: [packages/vue-form/src/useField.tsx:164](https://github.com/TanStack/form/blob/main/packages/vue-form/src/useField.tsx#L164) - -## Type Parameters - -• **TParentData** - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TParentSubmitMeta** - -## Properties - -### Field - -```ts -Field: FieldComponent; -``` - -Defined in: [packages/vue-form/src/useField.tsx:176](https://github.com/TanStack/form/blob/main/packages/vue-form/src/useField.tsx#L176) diff --git a/docs/framework/vue/reference/interfaces/vueformapi.md b/docs/framework/vue/reference/interfaces/vueformapi.md deleted file mode 100644 index 7055de265..000000000 --- a/docs/framework/vue/reference/interfaces/vueformapi.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -id: VueFormApi -title: VueFormApi ---- - - - -# Interface: VueFormApi\ - -Defined in: [packages/vue-form/src/useForm.tsx:115](https://github.com/TanStack/form/blob/main/packages/vue-form/src/useForm.tsx#L115) - -## Type Parameters - -• **TParentData** - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TSubmitMeta** - -## Properties - -### Field - -```ts -Field: FieldComponent; -``` - -Defined in: [packages/vue-form/src/useForm.tsx:127](https://github.com/TanStack/form/blob/main/packages/vue-form/src/useForm.tsx#L127) - -*** - -### Subscribe - -```ts -Subscribe: SubscribeComponent; -``` - -Defined in: [packages/vue-form/src/useForm.tsx:182](https://github.com/TanStack/form/blob/main/packages/vue-form/src/useForm.tsx#L182) - -*** - -### useField - -```ts -useField: UseField; -``` - -Defined in: [packages/vue-form/src/useForm.tsx:139](https://github.com/TanStack/form/blob/main/packages/vue-form/src/useForm.tsx#L139) - -*** - -### useStore() - -```ts -useStore: (selector?) => Readonly>; -``` - -Defined in: [packages/vue-form/src/useForm.tsx:151](https://github.com/TanStack/form/blob/main/packages/vue-form/src/useForm.tsx#L151) - -#### Type Parameters - -• **TSelected** = `FormState`\<`TParentData`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`\> - -#### Parameters - -##### selector? - -(`state`) => `TSelected` - -#### Returns - -`Readonly`\<`Ref`\<`TSelected`, `TSelected`\>\> diff --git a/docs/framework/vue/reference/type-aliases/fieldcomponent.md b/docs/framework/vue/reference/type-aliases/fieldcomponent.md deleted file mode 100644 index 9ec7ede80..000000000 --- a/docs/framework/vue/reference/type-aliases/fieldcomponent.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -id: FieldComponent -title: FieldComponent ---- - - - -# Type Alias: FieldComponent()\ - -```ts -type FieldComponent = (props) => CreateComponentPublicInstanceWithMixins, "form">, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, PublicProps, {}, false, {}, SlotsType<{ - default: { - field: FieldApi; - state: FieldApi["state"]; - }; -}>>; -``` - -Defined in: [packages/vue-form/src/useField.tsx:24](https://github.com/TanStack/form/blob/main/packages/vue-form/src/useField.tsx#L24) - -## Type Parameters - -• **TParentData** - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TParentSubmitMeta** - -## Parameters - -### props - -`Omit`\<[`FieldComponentProps`](fieldcomponentprops.md)\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\>, `"form"`\> & `EmitsToProps`\<`EmitsOptions`\> & `PublicProps` - -## Returns - -`CreateComponentPublicInstanceWithMixins`\<`Omit`\<[`FieldComponentProps`](fieldcomponentprops.md)\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\>, `"form"`\>, \{\}, \{\}, \{\}, \{\}, `ComponentOptionsMixin`, `ComponentOptionsMixin`, `EmitsOptions`, `PublicProps`, \{\}, `false`, \{\}, `SlotsType`\<\{ - `default`: \{ - `field`: `FieldApi`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\>; - `state`: `FieldApi`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\>\[`"state"`\]; - \}; - \}\>\> diff --git a/docs/framework/vue/reference/type-aliases/fieldcomponentprops.md b/docs/framework/vue/reference/type-aliases/fieldcomponentprops.md deleted file mode 100644 index 60eac66d1..000000000 --- a/docs/framework/vue/reference/type-aliases/fieldcomponentprops.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -id: FieldComponentProps -title: FieldComponentProps ---- - - - -# Type Alias: FieldComponentProps\ - -```ts -type FieldComponentProps = UseFieldOptions; -``` - -Defined in: [packages/vue-form/src/useField.tsx:400](https://github.com/TanStack/form/blob/main/packages/vue-form/src/useField.tsx#L400) - -## Type Parameters - -• **TParentData** - -• **TName** *extends* `DeepKeys`\<`TParentData`\> - -• **TData** *extends* `DeepValue`\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TParentSubmitMeta** diff --git a/docs/framework/vue/reference/type-aliases/usefield.md b/docs/framework/vue/reference/type-aliases/usefield.md deleted file mode 100644 index 980cd7b48..000000000 --- a/docs/framework/vue/reference/type-aliases/usefield.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -id: UseField -title: UseField ---- - - - -# Type Alias: UseField()\ - -```ts -type UseField = (opts) => object; -``` - -Defined in: [packages/vue-form/src/useField.tsx:190](https://github.com/TanStack/form/blob/main/packages/vue-form/src/useField.tsx#L190) - -## Type Parameters - -• **TParentData** - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TParentSubmitMeta** - -## Type Parameters - -• **TName** *extends* `DeepKeys`\<`TParentData`\> - -• **TData** *extends* `DeepValue`\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -## Parameters - -### opts - -`Omit`\<`UseFieldOptions`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\>, `"form"`\> - -## Returns - -`object` - -### api - -```ts -api: FieldApi & VueFieldApi; -``` - -### state - -```ts -state: Readonly["state"]>>; -``` diff --git a/docs/framework/vue/reference/variables/field.md b/docs/framework/vue/reference/variables/field.md deleted file mode 100644 index f2fca429d..000000000 --- a/docs/framework/vue/reference/variables/field.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -id: Field -title: Field ---- - - - -# Variable: Field() - -```ts -const Field: (props) => CreateComponentPublicInstanceWithMixins & object & {} | {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, PublicProps, {}, false, {}, {}>; -``` - -Defined in: [packages/vue-form/src/useField.tsx:448](https://github.com/TanStack/form/blob/main/packages/vue-form/src/useField.tsx#L448) - -## Parameters - -### props - -FieldApiOptions\ & \{ ...; \} & (\{ ...; \} \| \{ ...; \}) & `VNodeProps` & `AllowedComponentProps` & `ComponentCustomProps` - -## Returns - -`CreateComponentPublicInstanceWithMixins`\<`FieldApiOptions`\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\> & `object` & \{\} \| \{\}, \{\}, \{\}, \{\}, \{\}, `ComponentOptionsMixin`, `ComponentOptionsMixin`, `EmitsOptions`, `PublicProps`, \{\}, `false`, \{\}, \{\}\> diff --git a/docs/reference/classes/fieldapi.md b/docs/reference/classes/fieldapi.md deleted file mode 100644 index be77a75c5..000000000 --- a/docs/reference/classes/fieldapi.md +++ /dev/null @@ -1,568 +0,0 @@ ---- -id: FieldApi -title: FieldApi ---- - - - -# Class: FieldApi\ - -Defined in: [packages/form-core/src/FieldApi.ts:859](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L859) - -A class representing the API for managing a form field. - -Normally, you will not need to create a new `FieldApi` instance directly. -Instead, you will use a framework hook/function like `useField` or `createField` -to create a new instance for you that uses your framework's reactivity model. -However, if you need to create a new instance manually, you can do so by calling -the `new FieldApi` constructor. - -## Type Parameters - -• **TParentData** - -• **TName** *extends* [`DeepKeys`](../type-aliases/deepkeys.md)\<`TParentData`\> - -• **TData** *extends* [`DeepValue`](../type-aliases/deepvalue.md)\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TParentSubmitMeta** - -## Constructors - -### new FieldApi() - -```ts -new FieldApi(opts): FieldApi -``` - -Defined in: [packages/form-core/src/FieldApi.ts:973](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L973) - -Initializes a new `FieldApi` instance. - -#### Parameters - -##### opts - -[`FieldApiOptions`](../interfaces/fieldapioptions.md)\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\> - -#### Returns - -[`FieldApi`](fieldapi.md)\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\> - -## Properties - -### form - -```ts -form: FormApi; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:889](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L889) - -A reference to the form API instance. - -*** - -### name - -```ts -name: unknown extends TParentData ? string : TParentData extends readonly any[] & IsTuple ? PrefixTupleAccessor, AllowedIndexes, never>, []> : TParentData extends any[] ? PrefixArrayAccessor, [any]> : TParentData extends Date ? never : TParentData extends object ? PrefixObjectAccessor, []> : TParentData extends string | number | bigint | boolean ? "" : never; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:913](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L913) - -The field name. - -*** - -### options - -```ts -options: FieldApiOptions; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:917](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L917) - -The field options. - -*** - -### store - -```ts -store: Derived>; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:941](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L941) - -The field state store. - -*** - -### timeoutIds - -```ts -timeoutIds: Record; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:968](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L968) - -## Accessors - -### state - -#### Get Signature - -```ts -get state(): FieldState -``` - -Defined in: [packages/form-core/src/FieldApi.ts:965](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L965) - -The current field state. - -##### Returns - -[`FieldState`](../type-aliases/fieldstate.md)\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`\> - -## Methods - -### getInfo() - -```ts -getInfo(): FieldInfo -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1221](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1221) - -Gets the field information object. - -#### Returns - -[`FieldInfo`](../type-aliases/fieldinfo.md)\<`TParentData`\> - -*** - -### getMeta() - -```ts -getMeta(): FieldMeta -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1189](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1189) - -#### Returns - -[`FieldMeta`](../type-aliases/fieldmeta.md)\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`\> - -*** - -### ~~getValue()~~ - -```ts -getValue(): TData -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1171](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1171) - -Gets the current field value. - -#### Returns - -`TData` - -#### Deprecated - -Use `field.state.value` instead. - -*** - -### handleBlur() - -```ts -handleBlur(): void -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1593](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1593) - -Handles the blur event. - -#### Returns - -`void` - -*** - -### handleChange() - -```ts -handleChange(updater): void -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1586](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1586) - -Handles the change event. - -#### Parameters - -##### updater - -[`Updater`](../type-aliases/updater.md)\<`TData`\> - -#### Returns - -`void` - -*** - -### insertValue() - -```ts -insertValue( - index, - value, -opts?): Promise -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1234](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1234) - -Inserts a value at the specified index, shifting the subsequent values to the right. - -#### Parameters - -##### index - -`number` - -##### value - -`TData` *extends* `any`[] ? `TData`\<`TData`\>\[`number`\] : `never` - -##### opts? - -`UpdateMetaOptions` - -#### Returns - -`Promise`\<`void`\> - -*** - -### mount() - -```ts -mount(): () => void -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1077](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1077) - -Mounts the field instance to the form. - -#### Returns - -`Function` - -##### Returns - -`void` - -*** - -### moveValue() - -```ts -moveValue( - aIndex, - bIndex, - opts?): void -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1264](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1264) - -Moves the value at the first specified index to the second specified index. - -#### Parameters - -##### aIndex - -`number` - -##### bIndex - -`number` - -##### opts? - -`UpdateMetaOptions` - -#### Returns - -`void` - -*** - -### pushValue() - -```ts -pushValue(value, opts?): void -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1226](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1226) - -Pushes a new value to the field. - -#### Parameters - -##### value - -`TData` *extends* `any`[] ? `TData`\<`TData`\>\[`number`\] : `never` - -##### opts? - -`UpdateMetaOptions` - -#### Returns - -`void` - -*** - -### removeValue() - -```ts -removeValue(index, opts?): Promise -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1252](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1252) - -Removes a value at the specified index. - -#### Parameters - -##### index - -`number` - -##### opts? - -`UpdateMetaOptions` - -#### Returns - -`Promise`\<`void`\> - -*** - -### replaceValue() - -```ts -replaceValue( - index, - value, -opts?): Promise -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1243](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1243) - -Replaces a value at the specified index. - -#### Parameters - -##### index - -`number` - -##### value - -`TData` *extends* `any`[] ? `TData`\<`TData`\>\[`number`\] : `never` - -##### opts? - -`UpdateMetaOptions` - -#### Returns - -`Promise`\<`void`\> - -*** - -### setErrorMap() - -```ts -setErrorMap(errorMap): void -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1613](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1613) - -Updates the field's errorMap - -#### Parameters - -##### errorMap - -`ValidationErrorMap` - -#### Returns - -`void` - -*** - -### setMeta() - -```ts -setMeta(updater): void -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1194](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1194) - -Sets the field metadata. - -#### Parameters - -##### updater - -[`Updater`](../type-aliases/updater.md)\<[`FieldMeta`](../type-aliases/fieldmeta.md)\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`\>\> - -#### Returns - -`void` - -*** - -### setValue() - -```ts -setValue(updater, options?): void -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1178](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1178) - -Sets the field value and run the `change` validator. - -#### Parameters - -##### updater - -[`Updater`](../type-aliases/updater.md)\<`TData`\> - -##### options? - -`UpdateMetaOptions` - -#### Returns - -`void` - -*** - -### swapValues() - -```ts -swapValues( - aIndex, - bIndex, - opts?): void -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1258](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1258) - -Swaps the values at the specified indices. - -#### Parameters - -##### aIndex - -`number` - -##### bIndex - -`number` - -##### opts? - -`UpdateMetaOptions` - -#### Returns - -`void` - -*** - -### update() - -```ts -update(opts): void -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1119](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1119) - -Updates the field instance with new options. - -#### Parameters - -##### opts - -[`FieldApiOptions`](../interfaces/fieldapioptions.md)\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TParentSubmitMeta`\> - -#### Returns - -`void` - -*** - -### validate() - -```ts -validate(cause, opts?): unknown[] | Promise -``` - -Defined in: [packages/form-core/src/FieldApi.ts:1553](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1553) - -Validates the field value. - -#### Parameters - -##### cause - -`ValidationCause` - -##### opts? - -###### skipFormValidation? - -`boolean` - -#### Returns - -`unknown`[] \| `Promise`\<`unknown`[]\> diff --git a/docs/reference/classes/formapi.md b/docs/reference/classes/formapi.md deleted file mode 100644 index b276d961b..000000000 --- a/docs/reference/classes/formapi.md +++ /dev/null @@ -1,836 +0,0 @@ ---- -id: FormApi -title: FormApi ---- - - - -# Class: FormApi\ - -Defined in: [packages/form-core/src/FormApi.ts:659](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L659) - -A class representing the Form API. It handles the logic and interactions with the form state. - -Normally, you will not need to create a new `FormApi` instance directly. Instead, you will use a framework -hook/function like `useForm` or `createForm` to create a new instance for you that uses your framework's reactivity model. -However, if you need to create a new instance manually, you can do so by calling the `new FormApi` constructor. - -## Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TSubmitMeta** = `never` - -## Constructors - -### new FormApi() - -```ts -new FormApi(opts?): FormApi -``` - -Defined in: [packages/form-core/src/FormApi.ts:746](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L746) - -Constructs a new `FormApi` instance with the given form options. - -#### Parameters - -##### opts? - -[`FormOptions`](../interfaces/formoptions.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> - -#### Returns - -[`FormApi`](formapi.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> - -## Properties - -### baseStore - -```ts -baseStore: Store>; -``` - -Defined in: [packages/form-core/src/FormApi.ts:686](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L686) - -*** - -### fieldInfo - -```ts -fieldInfo: Record ? PrefixTupleAccessor, AllowedIndexes, never>, []> : TFormData extends any[] ? PrefixArrayAccessor, [any]> : TFormData extends Date ? never : TFormData extends object ? PrefixObjectAccessor, []> : TFormData extends string | number | bigint | boolean ? "" : never, FieldInfo>; -``` - -Defined in: [packages/form-core/src/FormApi.ts:716](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L716) - -A record of field information for each field in the form. - -*** - -### fieldMetaDerived - -```ts -fieldMetaDerived: Derived ? PrefixTupleAccessor, AllowedIndexes, never>, []> : TFormData extends any[] ? PrefixArrayAccessor, [any]> : TFormData extends Date ? never : TFormData extends object ? PrefixObjectAccessor, []> : TFormData extends string | number | bigint | boolean ? "" : never, AnyFieldMeta>>; -``` - -Defined in: [packages/form-core/src/FormApi.ts:699](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L699) - -*** - -### options - -```ts -options: FormOptions = {}; -``` - -Defined in: [packages/form-core/src/FormApi.ts:674](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L674) - -The options for the form. - -*** - -### store - -```ts -store: Derived>; -``` - -Defined in: [packages/form-core/src/FormApi.ts:700](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L700) - -## Accessors - -### state - -#### Get Signature - -```ts -get state(): FormState -``` - -Defined in: [packages/form-core/src/FormApi.ts:718](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L718) - -##### Returns - -[`FormState`](../type-aliases/formstate.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`\> - -## Methods - -### deleteField() - -```ts -deleteField(field): void -``` - -Defined in: [packages/form-core/src/FormApi.ts:1772](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1772) - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -#### Returns - -`void` - -*** - -### getAllErrors() - -```ts -getAllErrors(): object -``` - -Defined in: [packages/form-core/src/FormApi.ts:1988](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1988) - -Returns form and field level errors - -#### Returns - -`object` - -##### fields - -```ts -fields: Record, { - errorMap: ValidationErrorMap; - errors: unknown[]; -}>; -``` - -##### form - -```ts -form: object; -``` - -###### form.errorMap - -```ts -errorMap: FormValidationErrorMap, UnwrapFormValidateOrFn, UnwrapFormAsyncValidateOrFn, UnwrapFormValidateOrFn, UnwrapFormAsyncValidateOrFn, UnwrapFormValidateOrFn, UnwrapFormAsyncValidateOrFn, UnwrapFormAsyncValidateOrFn>; -``` - -###### form.errors - -```ts -errors: ( - | UnwrapFormValidateOrFn - | UnwrapFormValidateOrFn - | UnwrapFormAsyncValidateOrFn - | UnwrapFormValidateOrFn - | UnwrapFormAsyncValidateOrFn - | UnwrapFormValidateOrFn - | UnwrapFormAsyncValidateOrFn - | UnwrapFormAsyncValidateOrFn)[]; -``` - -*** - -### getFieldInfo() - -```ts -getFieldInfo(field): FieldInfo -``` - -Defined in: [packages/form-core/src/FormApi.ts:1681](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1681) - -Gets the field info of the specified field. - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -#### Returns - -[`FieldInfo`](../type-aliases/fieldinfo.md)\<`TFormData`\> - -*** - -### getFieldMeta() - -```ts -getFieldMeta(field): undefined | AnyFieldMeta -``` - -Defined in: [packages/form-core/src/FormApi.ts:1672](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1672) - -Gets the metadata of the specified field. - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -#### Returns - -`undefined` \| [`AnyFieldMeta`](../type-aliases/anyfieldmeta.md) - -*** - -### getFieldValue() - -```ts -getFieldValue(field): DeepValue -``` - -Defined in: [packages/form-core/src/FormApi.ts:1665](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1665) - -Gets the value of the specified field. - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -#### Returns - -[`DeepValue`](../type-aliases/deepvalue.md)\<`TFormData`, `TField`\> - -*** - -### handleSubmit() - -#### Call Signature - -```ts -handleSubmit(): Promise -``` - -Defined in: [packages/form-core/src/FormApi.ts:1581](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1581) - -Handles the form submission, performs validation, and calls the appropriate onSubmit or onInvalidSubmit callbacks. - -##### Returns - -`Promise`\<`void`\> - -#### Call Signature - -```ts -handleSubmit(submitMeta): Promise -``` - -Defined in: [packages/form-core/src/FormApi.ts:1582](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1582) - -Handles the form submission, performs validation, and calls the appropriate onSubmit or onInvalidSubmit callbacks. - -##### Parameters - -###### submitMeta - -`TSubmitMeta` - -##### Returns - -`Promise`\<`void`\> - -*** - -### insertFieldValue() - -```ts -insertFieldValue( - field, - index, - value, -opts?): Promise -``` - -Defined in: [packages/form-core/src/FormApi.ts:1811](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1811) - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -##### index - -`number` - -##### value - -[`DeepValue`](../type-aliases/deepvalue.md)\<`TFormData`, `TField`, \[\]\> *extends* `any`[] ? `any`[] & [`DeepValue`](../type-aliases/deepvalue.md)\<`TFormData`, `TField`, \[\]\>\[`number`\] : `never` - -##### opts? - -`UpdateMetaOptions` - -#### Returns - -`Promise`\<`void`\> - -*** - -### mount() - -```ts -mount(): () => void -``` - -Defined in: [packages/form-core/src/FormApi.ts:1049](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1049) - -#### Returns - -`Function` - -##### Returns - -`void` - -*** - -### moveFieldValues() - -```ts -moveFieldValues( - field, - index1, - index2, - opts?): void -``` - -Defined in: [packages/form-core/src/FormApi.ts:1935](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1935) - -Moves the value at the first specified index to the second specified index within an array field. - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -##### index1 - -`number` - -##### index2 - -`number` - -##### opts? - -`UpdateMetaOptions` - -#### Returns - -`void` - -*** - -### pushFieldValue() - -```ts -pushFieldValue( - field, - value, - opts?): void -``` - -Defined in: [packages/form-core/src/FormApi.ts:1796](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1796) - -Pushes a value into an array field. - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -##### value - -[`DeepValue`](../type-aliases/deepvalue.md)\<`TFormData`, `TField`, \[\]\> *extends* `any`[] ? `any`[] & [`DeepValue`](../type-aliases/deepvalue.md)\<`TFormData`, `TField`, \[\]\>\[`number`\] : `never` - -##### opts? - -`UpdateMetaOptions` - -#### Returns - -`void` - -*** - -### removeFieldValue() - -```ts -removeFieldValue( - field, - index, -opts?): Promise -``` - -Defined in: [packages/form-core/src/FormApi.ts:1869](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1869) - -Removes a value from an array field at the specified index. - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -##### index - -`number` - -##### opts? - -`UpdateMetaOptions` - -#### Returns - -`Promise`\<`void`\> - -*** - -### replaceFieldValue() - -```ts -replaceFieldValue( - field, - index, - value, -opts?): Promise -``` - -Defined in: [packages/form-core/src/FormApi.ts:1843](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1843) - -Replaces a value into an array field at the specified index. - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -##### index - -`number` - -##### value - -[`DeepValue`](../type-aliases/deepvalue.md)\<`TFormData`, `TField`, \[\]\> *extends* `any`[] ? `any`[] & [`DeepValue`](../type-aliases/deepvalue.md)\<`TFormData`, `TField`, \[\]\>\[`number`\] : `never` - -##### opts? - -`UpdateMetaOptions` - -#### Returns - -`Promise`\<`void`\> - -*** - -### reset() - -```ts -reset(values?, opts?): void -``` - -Defined in: [packages/form-core/src/FormApi.ts:1134](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1134) - -Resets the form state to the default values. -If values are provided, the form will be reset to those values instead and the default values will be updated. - -#### Parameters - -##### values? - -`TFormData` - -Optional values to reset the form to. - -##### opts? - -Optional options to control the reset behavior. - -###### keepDefaultValues? - -`boolean` - -#### Returns - -`void` - -*** - -### resetFieldMeta() - -```ts -resetFieldMeta(fieldMeta): Record -``` - -Defined in: [packages/form-core/src/FormApi.ts:1718](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1718) - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### fieldMeta - -`Record`\<`TField`, [`AnyFieldMeta`](../type-aliases/anyfieldmeta.md)\> - -#### Returns - -`Record`\<`TField`, [`AnyFieldMeta`](../type-aliases/anyfieldmeta.md)\> - -*** - -### setErrorMap() - -```ts -setErrorMap(errorMap): void -``` - -Defined in: [packages/form-core/src/FormApi.ts:1962](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1962) - -Updates the form's errorMap - -#### Parameters - -##### errorMap - -`ValidationErrorMap`\<`TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`\> - -#### Returns - -`void` - -*** - -### setFieldMeta() - -```ts -setFieldMeta(field, updater): void -``` - -Defined in: [packages/form-core/src/FormApi.ts:1700](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1700) - -Updates the metadata of the specified field. - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -##### updater - -[`Updater`](../type-aliases/updater.md)\<[`AnyFieldMeta`](../type-aliases/anyfieldmeta.md)\> - -#### Returns - -`void` - -*** - -### setFieldValue() - -```ts -setFieldValue( - field, - updater, - opts?): void -``` - -Defined in: [packages/form-core/src/FormApi.ts:1742](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1742) - -Sets the value of the specified field and optionally updates the touched state. - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -##### updater - -[`Updater`](../type-aliases/updater.md)\<[`DeepValue`](../type-aliases/deepvalue.md)\<`TFormData`, `TField`, \[\]\>\> - -##### opts? - -`UpdateMetaOptions` - -#### Returns - -`void` - -*** - -### swapFieldValues() - -```ts -swapFieldValues( - field, - index1, - index2, - opts?): void -``` - -Defined in: [packages/form-core/src/FormApi.ts:1906](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1906) - -Swaps the values at the specified indices within an array field. - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -##### index1 - -`number` - -##### index2 - -`number` - -##### opts? - -`UpdateMetaOptions` - -#### Returns - -`void` - -*** - -### update() - -```ts -update(options?): void -``` - -Defined in: [packages/form-core/src/FormApi.ts:1066](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1066) - -Updates the form options and form state. - -#### Parameters - -##### options? - -[`FormOptions`](../interfaces/formoptions.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> - -#### Returns - -`void` - -*** - -### validateAllFields() - -```ts -validateAllFields(cause): Promise -``` - -Defined in: [packages/form-core/src/FormApi.ts:1160](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1160) - -Validates all fields using the correct handlers for a given validation cause. - -#### Parameters - -##### cause - -`ValidationCause` - -#### Returns - -`Promise`\<`unknown`[]\> - -*** - -### validateArrayFieldsStartingFrom() - -```ts -validateArrayFieldsStartingFrom( - field, - index, -cause): Promise -``` - -Defined in: [packages/form-core/src/FormApi.ts:1190](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1190) - -Validates the children of a specified array in the form starting from a given index until the end using the correct handlers for a given validation type. - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -##### index - -`number` - -##### cause - -`ValidationCause` - -#### Returns - -`Promise`\<`unknown`[]\> - -*** - -### validateField() - -```ts -validateField(field, cause): unknown[] | Promise -``` - -Defined in: [packages/form-core/src/FormApi.ts:1229](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1229) - -Validates a specified field in the form using the correct handlers for a given validation type. - -#### Type Parameters - -• **TField** *extends* `string` \| `number` - -#### Parameters - -##### field - -`TField` - -##### cause - -`ValidationCause` - -#### Returns - -`unknown`[] \| `Promise`\<`unknown`[]\> diff --git a/docs/reference/functions/formoptions.md b/docs/reference/functions/formoptions.md deleted file mode 100644 index c0ac104b1..000000000 --- a/docs/reference/functions/formoptions.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -id: formOptions -title: formOptions ---- - - - -# Function: formOptions() - -```ts -function formOptions(defaultOpts?): - | undefined -| FormOptions -``` - -Defined in: [packages/form-core/src/formOptions.ts:7](https://github.com/TanStack/form/blob/main/packages/form-core/src/formOptions.ts#L7) - -## Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TSubmitMeta** - -## Parameters - -### defaultOpts? - -[`FormOptions`](../interfaces/formoptions.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> - -## Returns - - \| `undefined` - \| [`FormOptions`](../interfaces/formoptions.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> diff --git a/docs/reference/functions/isglobalformvalidationerror.md b/docs/reference/functions/isglobalformvalidationerror.md deleted file mode 100644 index d60ec331d..000000000 --- a/docs/reference/functions/isglobalformvalidationerror.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -id: isGlobalFormValidationError -title: isGlobalFormValidationError ---- - - - -# Function: isGlobalFormValidationError() - -```ts -function isGlobalFormValidationError(error): error is GlobalFormValidationError -``` - -Defined in: [packages/form-core/src/utils.ts:328](https://github.com/TanStack/form/blob/main/packages/form-core/src/utils.ts#L328) - -## Parameters - -### error - -`unknown` - -## Returns - -`error is GlobalFormValidationError` diff --git a/docs/reference/functions/isstandardschemavalidator.md b/docs/reference/functions/isstandardschemavalidator.md deleted file mode 100644 index 6f3b6552c..000000000 --- a/docs/reference/functions/isstandardschemavalidator.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -id: isStandardSchemaValidator -title: isStandardSchemaValidator ---- - - - -# Function: isStandardSchemaValidator() - -```ts -function isStandardSchemaValidator(validator): validator is StandardSchemaV1 -``` - -Defined in: [packages/form-core/src/standardSchemaValidator.ts:75](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L75) - -## Parameters - -### validator - -`unknown` - -## Returns - -`validator is StandardSchemaV1` diff --git a/docs/reference/functions/mergeform.md b/docs/reference/functions/mergeform.md deleted file mode 100644 index 24238089b..000000000 --- a/docs/reference/functions/mergeform.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: mergeForm -title: mergeForm ---- - - - -# Function: mergeForm() - -```ts -function mergeForm(baseForm, state): FormApi, any, any, any, any, any, any, any, any, any> -``` - -Defined in: [packages/form-core/src/mergeForm.ts:73](https://github.com/TanStack/form/blob/main/packages/form-core/src/mergeForm.ts#L73) - -## Type Parameters - -• **TFormData** - -## Parameters - -### baseForm - -[`FormApi`](../classes/formapi.md)\<`NoInfer`\<`TFormData`\>, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`\> - -### state - -`Partial`\<[`FormState`](../type-aliases/formstate.md)\<`TFormData`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`\>\> - -## Returns - -[`FormApi`](../classes/formapi.md)\<`NoInfer`\<`TFormData`\>, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`\> diff --git a/docs/reference/functions/shallow.md b/docs/reference/functions/shallow.md deleted file mode 100644 index 04634ad73..000000000 --- a/docs/reference/functions/shallow.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: shallow -title: shallow ---- - - - -# Function: shallow() - -```ts -function shallow(objA, objB): boolean -``` - -Defined in: [packages/form-core/src/utils.ts:334](https://github.com/TanStack/form/blob/main/packages/form-core/src/utils.ts#L334) - -## Type Parameters - -• **T** - -## Parameters - -### objA - -`T` - -### objB - -`T` - -## Returns - -`boolean` diff --git a/docs/reference/index.md b/docs/reference/index.md deleted file mode 100644 index a87090a70..000000000 --- a/docs/reference/index.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -id: "@tanstack/form-core" -title: "@tanstack/form-core" ---- - - - -# @tanstack/form-core - -## Classes - -- [FieldApi](classes/fieldapi.md) -- [FormApi](classes/formapi.md) - -## Interfaces - -- [FieldApiOptions](interfaces/fieldapioptions.md) -- [FieldListeners](interfaces/fieldlisteners.md) -- [FieldOptions](interfaces/fieldoptions.md) -- [FieldValidators](interfaces/fieldvalidators.md) -- [FormOptions](interfaces/formoptions.md) -- [FormValidators](interfaces/formvalidators.md) -- [StandardSchemaV1Issue](interfaces/standardschemav1issue.md) - -## Type Aliases - -- [AnyFieldApi](type-aliases/anyfieldapi.md) -- [AnyFieldMeta](type-aliases/anyfieldmeta.md) -- [AnyFieldMetaBase](type-aliases/anyfieldmetabase.md) -- [AnyFieldMetaDerived](type-aliases/anyfieldmetaderived.md) -- [AnyFormApi](type-aliases/anyformapi.md) -- [AnyFormState](type-aliases/anyformstate.md) -- [BaseFormState](type-aliases/baseformstate.md) -- [DeepKeys](type-aliases/deepkeys.md) -- [DeepValue](type-aliases/deepvalue.md) -- [DerivedFormState](type-aliases/derivedformstate.md) -- [FieldInfo](type-aliases/fieldinfo.md) -- [FieldMeta](type-aliases/fieldmeta.md) -- [FieldMetaBase](type-aliases/fieldmetabase.md) -- [FieldMetaDerived](type-aliases/fieldmetaderived.md) -- [FieldState](type-aliases/fieldstate.md) -- [FormState](type-aliases/formstate.md) -- [FormValidateFn](type-aliases/formvalidatefn.md) -- [FormValidationError](type-aliases/formvalidationerror.md) -- [FormValidator](type-aliases/formvalidator.md) -- [StandardSchemaV1](type-aliases/standardschemav1.md) -- [TStandardSchemaValidatorValue](type-aliases/tstandardschemavalidatorvalue.md) -- [UnwrapFieldAsyncValidateOrFn](type-aliases/unwrapfieldasyncvalidateorfn.md) -- [UnwrapFieldValidateOrFn](type-aliases/unwrapfieldvalidateorfn.md) -- [UnwrapFormAsyncValidateOrFn](type-aliases/unwrapformasyncvalidateorfn.md) -- [UnwrapFormValidateOrFn](type-aliases/unwrapformvalidateorfn.md) -- [Updater](type-aliases/updater.md) -- [UpdaterFn](type-aliases/updaterfn.md) -- [ValidationError](type-aliases/validationerror.md) -- [ValidationMeta](type-aliases/validationmeta.md) -- [ValidationSource](type-aliases/validationsource.md) - -## Variables - -- [standardSchemaValidators](variables/standardschemavalidators.md) - -## Functions - -- [formOptions](functions/formoptions.md) -- [isGlobalFormValidationError](functions/isglobalformvalidationerror.md) -- [isStandardSchemaValidator](functions/isstandardschemavalidator.md) -- [mergeForm](functions/mergeform.md) -- [shallow](functions/shallow.md) diff --git a/docs/reference/interfaces/fieldapioptions.md b/docs/reference/interfaces/fieldapioptions.md deleted file mode 100644 index 16109d166..000000000 --- a/docs/reference/interfaces/fieldapioptions.md +++ /dev/null @@ -1,194 +0,0 @@ ---- -id: FieldApiOptions -title: FieldApiOptions ---- - - - -# Interface: FieldApiOptions\ - -Defined in: [packages/form-core/src/FieldApi.ts:447](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L447) - -An object type representing the required options for the FieldApi class. - -## Extends - -- [`FieldOptions`](fieldoptions.md)\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`\> - -## Type Parameters - -• **TParentData** - -• **TName** *extends* [`DeepKeys`](../type-aliases/deepkeys.md)\<`TParentData`\> - -• **TData** *extends* [`DeepValue`](../type-aliases/deepvalue.md)\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TParentSubmitMeta** - -## Properties - -### asyncAlways? - -```ts -optional asyncAlways: boolean; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:394](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L394) - -If `true`, always run async validation, even if there are errors emitted during synchronous validation. - -#### Inherited from - -[`FieldOptions`](fieldoptions.md).[`asyncAlways`](FieldOptions.md#asyncalways) - -*** - -### asyncDebounceMs? - -```ts -optional asyncDebounceMs: number; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:390](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L390) - -The default time to debounce async validation if there is not a more specific debounce time passed. - -#### Inherited from - -[`FieldOptions`](fieldoptions.md).[`asyncDebounceMs`](FieldOptions.md#asyncdebouncems) - -*** - -### defaultMeta? - -```ts -optional defaultMeta: Partial>; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:413](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L413) - -An optional object with default metadata for the field. - -#### Inherited from - -[`FieldOptions`](fieldoptions.md).[`defaultMeta`](FieldOptions.md#defaultmeta) - -*** - -### defaultValue? - -```ts -optional defaultValue: NoInfer; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:386](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L386) - -An optional default value for the field. - -#### Inherited from - -[`FieldOptions`](fieldoptions.md).[`defaultValue`](FieldOptions.md#defaultvalue) - -*** - -### disableErrorFlat? - -```ts -optional disableErrorFlat: boolean; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:441](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L441) - -Disable the `flat(1)` operation on `field.errors`. This is useful if you want to keep the error structure as is. Not suggested for most use-cases. - -#### Inherited from - -[`FieldOptions`](fieldoptions.md).[`disableErrorFlat`](FieldOptions.md#disableerrorflat) - -*** - -### form - -```ts -form: FormApi; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:485](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L485) - -*** - -### listeners? - -```ts -optional listeners: FieldListeners; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:437](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L437) - -A list of listeners which attach to the corresponding events - -#### Inherited from - -[`FieldOptions`](fieldoptions.md).[`listeners`](FieldOptions.md#listeners) - -*** - -### name - -```ts -name: TName; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:382](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L382) - -The field name. The type will be `DeepKeys` to ensure your name is a deep key of the parent dataset. - -#### Inherited from - -[`FieldOptions`](fieldoptions.md).[`name`](FieldOptions.md#name) - -*** - -### validators? - -```ts -optional validators: FieldValidators; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:398](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L398) - -A list of validators to pass to the field - -#### Inherited from - -[`FieldOptions`](fieldoptions.md).[`validators`](FieldOptions.md#validators) diff --git a/docs/reference/interfaces/fieldlisteners.md b/docs/reference/interfaces/fieldlisteners.md deleted file mode 100644 index e0cfca1e0..000000000 --- a/docs/reference/interfaces/fieldlisteners.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -id: FieldListeners -title: FieldListeners ---- - - - -# Interface: FieldListeners\ - -Defined in: [packages/form-core/src/FieldApi.ts:347](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L347) - -## Type Parameters - -• **TParentData** - -• **TName** *extends* [`DeepKeys`](../type-aliases/deepkeys.md)\<`TParentData`\> - -• **TData** *extends* [`DeepValue`](../type-aliases/deepvalue.md)\<`TParentData`, `TName`\> = [`DeepValue`](../type-aliases/deepvalue.md)\<`TParentData`, `TName`\> - -## Properties - -### onBlur? - -```ts -optional onBlur: FieldListenerFn; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:353](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L353) - -*** - -### onChange? - -```ts -optional onChange: FieldListenerFn; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:352](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L352) - -*** - -### onMount? - -```ts -optional onMount: FieldListenerFn; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:354](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L354) - -*** - -### onSubmit? - -```ts -optional onSubmit: FieldListenerFn; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:355](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L355) diff --git a/docs/reference/interfaces/fieldoptions.md b/docs/reference/interfaces/fieldoptions.md deleted file mode 100644 index 8f3dee93a..000000000 --- a/docs/reference/interfaces/fieldoptions.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -id: FieldOptions -title: FieldOptions ---- - - - -# Interface: FieldOptions\ - -Defined in: [packages/form-core/src/FieldApi.ts:361](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L361) - -An object type representing the options for a field in a form. - -## Extended by - -- [`FieldApiOptions`](fieldapioptions.md) - -## Type Parameters - -• **TParentData** - -• **TName** *extends* [`DeepKeys`](../type-aliases/deepkeys.md)\<`TParentData`\> - -• **TData** *extends* [`DeepValue`](../type-aliases/deepvalue.md)\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -## Properties - -### asyncAlways? - -```ts -optional asyncAlways: boolean; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:394](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L394) - -If `true`, always run async validation, even if there are errors emitted during synchronous validation. - -*** - -### asyncDebounceMs? - -```ts -optional asyncDebounceMs: number; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:390](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L390) - -The default time to debounce async validation if there is not a more specific debounce time passed. - -*** - -### defaultMeta? - -```ts -optional defaultMeta: Partial>; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:413](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L413) - -An optional object with default metadata for the field. - -*** - -### defaultValue? - -```ts -optional defaultValue: NoInfer; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:386](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L386) - -An optional default value for the field. - -*** - -### disableErrorFlat? - -```ts -optional disableErrorFlat: boolean; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:441](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L441) - -Disable the `flat(1)` operation on `field.errors`. This is useful if you want to keep the error structure as is. Not suggested for most use-cases. - -*** - -### listeners? - -```ts -optional listeners: FieldListeners; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:437](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L437) - -A list of listeners which attach to the corresponding events - -*** - -### name - -```ts -name: TName; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:382](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L382) - -The field name. The type will be `DeepKeys` to ensure your name is a deep key of the parent dataset. - -*** - -### validators? - -```ts -optional validators: FieldValidators; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:398](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L398) - -A list of validators to pass to the field diff --git a/docs/reference/interfaces/fieldvalidators.md b/docs/reference/interfaces/fieldvalidators.md deleted file mode 100644 index 8d5f44c66..000000000 --- a/docs/reference/interfaces/fieldvalidators.md +++ /dev/null @@ -1,204 +0,0 @@ ---- -id: FieldValidators -title: FieldValidators ---- - - - -# Interface: FieldValidators\ - -Defined in: [packages/form-core/src/FieldApi.ts:266](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L266) - -## Type Parameters - -• **TParentData** - -• **TName** *extends* [`DeepKeys`](../type-aliases/deepkeys.md)\<`TParentData`\> - -• **TData** *extends* [`DeepValue`](../type-aliases/deepvalue.md)\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -## Properties - -### onBlur? - -```ts -optional onBlur: TOnBlur; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:315](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L315) - -An optional function, that runs on the blur event of input. - -#### Example - -```ts -z.string().min(1) -``` - -*** - -### onBlurAsync? - -```ts -optional onBlurAsync: TOnBlurAsync; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:321](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L321) - -An optional property similar to `onBlur` but async validation. - -#### Example - -```ts -z.string().refine(async (val) => val.length > 3, { message: 'Testing 123' }) -``` - -*** - -### onBlurAsyncDebounceMs? - -```ts -optional onBlurAsyncDebounceMs: number; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:328](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L328) - -An optional number to represent how long the `onBlurAsync` should wait before running - -If set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds - -*** - -### onBlurListenTo? - -```ts -optional onBlurListenTo: unknown extends TParentData ? string : TParentData extends readonly any[] & IsTuple ? PrefixTupleAccessor, AllowedIndexes, never>, []> : TParentData extends any[] ? PrefixArrayAccessor, [any]> : TParentData extends Date ? never : TParentData extends object ? PrefixObjectAccessor, []> : TParentData extends string | number | bigint | boolean ? "" : never[]; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:332](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L332) - -An optional list of field names that should trigger this field's `onBlur` and `onBlurAsync` events when its value changes - -*** - -### onChange? - -```ts -optional onChange: TOnChange; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:293](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L293) - -An optional function, that runs on the change event of input. - -#### Example - -```ts -z.string().min(1) -``` - -*** - -### onChangeAsync? - -```ts -optional onChangeAsync: TOnChangeAsync; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:299](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L299) - -An optional property similar to `onChange` but async validation - -#### Example - -```ts -z.string().refine(async (val) => val.length > 3, { message: 'Testing 123' }) -``` - -*** - -### onChangeAsyncDebounceMs? - -```ts -optional onChangeAsyncDebounceMs: number; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:305](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L305) - -An optional number to represent how long the `onChangeAsync` should wait before running - -If set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds - -*** - -### onChangeListenTo? - -```ts -optional onChangeListenTo: unknown extends TParentData ? string : TParentData extends readonly any[] & IsTuple ? PrefixTupleAccessor, AllowedIndexes, never>, []> : TParentData extends any[] ? PrefixArrayAccessor, [any]> : TParentData extends Date ? never : TParentData extends object ? PrefixObjectAccessor, []> : TParentData extends string | number | bigint | boolean ? "" : never[]; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:309](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L309) - -An optional list of field names that should trigger this field's `onChange` and `onChangeAsync` events when its value changes - -*** - -### onMount? - -```ts -optional onMount: TOnMount; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:287](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L287) - -An optional function, that runs on the mount event of input. - -*** - -### onSubmit? - -```ts -optional onSubmit: TOnSubmit; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:338](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L338) - -An optional function, that runs on the submit event of form. - -#### Example - -```ts -z.string().min(1) -``` - -*** - -### onSubmitAsync? - -```ts -optional onSubmitAsync: TOnSubmitAsync; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:344](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L344) - -An optional property similar to `onSubmit` but async validation. - -#### Example - -```ts -z.string().refine(async (val) => val.length > 3, { message: 'Testing 123' }) -``` diff --git a/docs/reference/interfaces/formoptions.md b/docs/reference/interfaces/formoptions.md deleted file mode 100644 index df25c934e..000000000 --- a/docs/reference/interfaces/formoptions.md +++ /dev/null @@ -1,176 +0,0 @@ ---- -id: FormOptions -title: FormOptions ---- - - - -# Interface: FormOptions\ - -Defined in: [packages/form-core/src/FormApi.ts:237](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L237) - -An object representing the options for a form. - -## Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TSubmitMeta** = `never` - -## Properties - -### asyncAlways? - -```ts -optional asyncAlways: boolean; -``` - -Defined in: [packages/form-core/src/FormApi.ts:272](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L272) - -If true, always run async validation, even when sync validation has produced an error. Defaults to undefined. - -*** - -### asyncDebounceMs? - -```ts -optional asyncDebounceMs: number; -``` - -Defined in: [packages/form-core/src/FormApi.ts:276](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L276) - -Optional time in milliseconds if you want to introduce a delay before firing off an async action. - -*** - -### defaultState? - -```ts -optional defaultState: Partial>; -``` - -Defined in: [packages/form-core/src/FormApi.ts:256](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L256) - -The default state for the form. - -*** - -### defaultValues? - -```ts -optional defaultValues: TFormData; -``` - -Defined in: [packages/form-core/src/FormApi.ts:252](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L252) - -Set initial values for your form. - -*** - -### onSubmit()? - -```ts -optional onSubmit: (props) => any; -``` - -Defined in: [packages/form-core/src/FormApi.ts:299](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L299) - -A function to be called when the form is submitted, what should happen once the user submits a valid form returns `any` or a promise `Promise` - -#### Parameters - -##### props - -###### formApi - -[`FormApi`](../classes/formapi.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> - -###### meta - -`TSubmitMeta` - -###### value - -`TFormData` - -#### Returns - -`any` - -*** - -### onSubmitInvalid()? - -```ts -optional onSubmitInvalid: (props) => void; -``` - -Defined in: [packages/form-core/src/FormApi.ts:318](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L318) - -Specify an action for scenarios where the user tries to submit an invalid form. - -#### Parameters - -##### props - -###### formApi - -[`FormApi`](../classes/formapi.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\> - -###### value - -`TFormData` - -#### Returns - -`void` - -*** - -### onSubmitMeta? - -```ts -optional onSubmitMeta: TSubmitMeta; -``` - -Defined in: [packages/form-core/src/FormApi.ts:294](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L294) - -onSubmitMeta, the data passed from the handleSubmit handler, to the onSubmit function props - -*** - -### transform? - -```ts -optional transform: FormTransform; -``` - -Defined in: [packages/form-core/src/FormApi.ts:333](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L333) - -*** - -### validators? - -```ts -optional validators: FormValidators; -``` - -Defined in: [packages/form-core/src/FormApi.ts:280](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L280) - -A list of validators to pass to the form diff --git a/docs/reference/interfaces/formvalidators.md b/docs/reference/interfaces/formvalidators.md deleted file mode 100644 index 8b128b41b..000000000 --- a/docs/reference/interfaces/formvalidators.md +++ /dev/null @@ -1,132 +0,0 @@ ---- -id: FormValidators -title: FormValidators ---- - - - -# Interface: FormValidators\ - -Defined in: [packages/form-core/src/FormApi.ts:149](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L149) - -## Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -## Properties - -### onBlur? - -```ts -optional onBlur: TOnBlur; -``` - -Defined in: [packages/form-core/src/FormApi.ts:178](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L178) - -Optional function that validates the form data when a field loses focus, returns a `FormValidationError` - -*** - -### onBlurAsync? - -```ts -optional onBlurAsync: TOnBlurAsync; -``` - -Defined in: [packages/form-core/src/FormApi.ts:182](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L182) - -Optional onBlur asynchronous validation method for when a field loses focus returns a ` FormValidationError` or a promise of `Promise` - -*** - -### onBlurAsyncDebounceMs? - -```ts -optional onBlurAsyncDebounceMs: number; -``` - -Defined in: [packages/form-core/src/FormApi.ts:186](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L186) - -The default time in milliseconds that if set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds. - -*** - -### onChange? - -```ts -optional onChange: TOnChange; -``` - -Defined in: [packages/form-core/src/FormApi.ts:166](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L166) - -Optional function that checks the validity of your data whenever a value changes - -*** - -### onChangeAsync? - -```ts -optional onChangeAsync: TOnChangeAsync; -``` - -Defined in: [packages/form-core/src/FormApi.ts:170](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L170) - -Optional onChange asynchronous counterpart to onChange. Useful for more complex validation logic that might involve server requests. - -*** - -### onChangeAsyncDebounceMs? - -```ts -optional onChangeAsyncDebounceMs: number; -``` - -Defined in: [packages/form-core/src/FormApi.ts:174](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L174) - -The default time in milliseconds that if set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds. - -*** - -### onMount? - -```ts -optional onMount: TOnMount; -``` - -Defined in: [packages/form-core/src/FormApi.ts:162](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L162) - -Optional function that fires as soon as the component mounts. - -*** - -### onSubmit? - -```ts -optional onSubmit: TOnSubmit; -``` - -Defined in: [packages/form-core/src/FormApi.ts:187](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L187) - -*** - -### onSubmitAsync? - -```ts -optional onSubmitAsync: TOnSubmitAsync; -``` - -Defined in: [packages/form-core/src/FormApi.ts:188](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L188) diff --git a/docs/reference/interfaces/standardschemav1issue.md b/docs/reference/interfaces/standardschemav1issue.md deleted file mode 100644 index 119ef8cb3..000000000 --- a/docs/reference/interfaces/standardschemav1issue.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: StandardSchemaV1Issue -title: StandardSchemaV1Issue ---- - - - -# Interface: StandardSchemaV1Issue - -Defined in: [packages/form-core/src/standardSchemaValidator.ts:144](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L144) - -The issue interface of the failure output. - -## Properties - -### message - -```ts -readonly message: string; -``` - -Defined in: [packages/form-core/src/standardSchemaValidator.ts:148](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L148) - -The error message of the issue. - -*** - -### path? - -```ts -readonly optional path: readonly (PropertyKey | StandardSchemaV1PathSegment)[]; -``` - -Defined in: [packages/form-core/src/standardSchemaValidator.ts:152](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L152) - -The path of the issue, if any. diff --git a/docs/reference/type-aliases/anyfieldapi.md b/docs/reference/type-aliases/anyfieldapi.md deleted file mode 100644 index 9db1bfefa..000000000 --- a/docs/reference/type-aliases/anyfieldapi.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: AnyFieldApi -title: AnyFieldApi ---- - - - -# Type Alias: AnyFieldApi - -```ts -type AnyFieldApi = FieldApi; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:828](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L828) - -A type representing the Field API with all generics set to `any` for convenience. diff --git a/docs/reference/type-aliases/anyfieldmeta.md b/docs/reference/type-aliases/anyfieldmeta.md deleted file mode 100644 index abbfd3049..000000000 --- a/docs/reference/type-aliases/anyfieldmeta.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -id: AnyFieldMeta -title: AnyFieldMeta ---- - - - -# Type Alias: AnyFieldMeta - -```ts -type AnyFieldMeta = FieldMeta; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:747](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L747) diff --git a/docs/reference/type-aliases/anyfieldmetabase.md b/docs/reference/type-aliases/anyfieldmetabase.md deleted file mode 100644 index 34a5f25ad..000000000 --- a/docs/reference/type-aliases/anyfieldmetabase.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -id: AnyFieldMetaBase -title: AnyFieldMetaBase ---- - - - -# Type Alias: AnyFieldMetaBase - -```ts -type AnyFieldMetaBase = FieldMetaBase; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:569](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L569) diff --git a/docs/reference/type-aliases/anyfieldmetaderived.md b/docs/reference/type-aliases/anyfieldmetaderived.md deleted file mode 100644 index 71df55bfb..000000000 --- a/docs/reference/type-aliases/anyfieldmetaderived.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -id: AnyFieldMetaDerived -title: AnyFieldMetaDerived ---- - - - -# Type Alias: AnyFieldMetaDerived - -```ts -type AnyFieldMetaDerived = FieldMetaDerived; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:661](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L661) diff --git a/docs/reference/type-aliases/anyformapi.md b/docs/reference/type-aliases/anyformapi.md deleted file mode 100644 index fd215a60c..000000000 --- a/docs/reference/type-aliases/anyformapi.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: AnyFormApi -title: AnyFormApi ---- - - - -# Type Alias: AnyFormApi - -```ts -type AnyFormApi = FormApi; -``` - -Defined in: [packages/form-core/src/FormApi.ts:639](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L639) - -A type representing the Form API with all generics set to `any` for convenience. diff --git a/docs/reference/type-aliases/anyformstate.md b/docs/reference/type-aliases/anyformstate.md deleted file mode 100644 index 50698c96f..000000000 --- a/docs/reference/type-aliases/anyformstate.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -id: AnyFormState -title: AnyFormState ---- - - - -# Type Alias: AnyFormState - -```ts -type AnyFormState = FormState; -``` - -Defined in: [packages/form-core/src/FormApi.ts:568](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L568) diff --git a/docs/reference/type-aliases/baseformstate.md b/docs/reference/type-aliases/baseformstate.md deleted file mode 100644 index be32e3405..000000000 --- a/docs/reference/type-aliases/baseformstate.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -id: BaseFormState -title: BaseFormState ---- - - - -# Type Alias: BaseFormState\ - -```ts -type BaseFormState = object; -``` - -Defined in: [packages/form-core/src/FormApi.ts:394](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L394) - -An object representing the current state of the form. - -## Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -## Type declaration - -### \_force\_re\_eval? - -```ts -optional _force_re_eval: boolean; -``` - -@private, used to force a re-evaluation of the form state when options change - -### errorMap - -```ts -errorMap: FormValidationErrorMap, UnwrapFormValidateOrFn, UnwrapFormAsyncValidateOrFn, UnwrapFormValidateOrFn, UnwrapFormAsyncValidateOrFn, UnwrapFormValidateOrFn, UnwrapFormAsyncValidateOrFn, UnwrapFormAsyncValidateOrFn>; -``` - -The error map for the form itself. - -### fieldMetaBase - -```ts -fieldMetaBase: Record, AnyFieldMetaBase>; -``` - -A record of field metadata for each field in the form, not including the derived properties, like `errors` and such - -### isSubmitSuccessful - -```ts -isSubmitSuccessful: boolean; -``` - -A boolean indicating if the last submission was successful. - -### isSubmitted - -```ts -isSubmitted: boolean; -``` - -A boolean indicating if the form has been submitted. - -### isSubmitting - -```ts -isSubmitting: boolean; -``` - -A boolean indicating if the form is currently in the process of being submitted after `handleSubmit` is called. - -Goes back to `false` when submission completes for one of the following reasons: -- the validation step returned errors. -- the `onSubmit` function has completed. - -Note: if you're running async operations in your `onSubmit` function make sure to await them to ensure `isSubmitting` is set to `false` only when the async operation completes. - -This is useful for displaying loading indicators or disabling form inputs during submission. - -### isValidating - -```ts -isValidating: boolean; -``` - -A boolean indicating if the form or any of its fields are currently validating. - -### submissionAttempts - -```ts -submissionAttempts: number; -``` - -A counter for tracking the number of submission attempts. - -### validationMetaMap - -```ts -validationMetaMap: Record; -``` - -An internal mechanism used for keeping track of validation logic in a form. - -### values - -```ts -values: TFormData; -``` - -The current values of the form fields. diff --git a/docs/reference/type-aliases/deepkeys.md b/docs/reference/type-aliases/deepkeys.md deleted file mode 100644 index 64559e493..000000000 --- a/docs/reference/type-aliases/deepkeys.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -id: DeepKeys -title: DeepKeys ---- - - - -# Type Alias: DeepKeys\ - -```ts -type DeepKeys = TDepth["length"] extends 5 ? never : unknown extends T ? PrefixFromDepth : T extends readonly any[] & IsTuple ? PrefixTupleAccessor, TDepth> : T extends any[] ? PrefixArrayAccessor : T extends Date ? never : T extends object ? PrefixObjectAccessor : T extends string | number | boolean | bigint ? "" : never; -``` - -Defined in: [packages/form-core/src/util-types.ts:70](https://github.com/TanStack/form/blob/main/packages/form-core/src/util-types.ts#L70) - -The keys of an object or array, deeply nested. - -## Type Parameters - -• **T** - -• **TDepth** *extends* `any`[] = \[\] diff --git a/docs/reference/type-aliases/deepvalue.md b/docs/reference/type-aliases/deepvalue.md deleted file mode 100644 index 22f9dd033..000000000 --- a/docs/reference/type-aliases/deepvalue.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -id: DeepValue -title: DeepValue ---- - - - -# Type Alias: DeepValue\ - -```ts -type DeepValue = unknown extends TValue ? TValue : TDepth["length"] extends 10 ? unknown : TValue extends ReadonlyArray ? TAccessor extends `[${infer TBrackets}].${infer TAfter}` ? DeepValue, TAfter, [...TDepth, any]> : TAccessor extends `[${infer TBrackets}]` ? DeepValue : TAccessor extends keyof TValue ? TValue[TAccessor] : TValue[TAccessor & number] : TAccessor extends `${infer TBefore}[${infer TEverythingElse}` ? DeepValue, `[${TEverythingElse}`, [...TDepth, any]> : TAccessor extends `[${infer TBrackets}]` ? DeepValue : TAccessor extends `${infer TBefore}.${infer TAfter}` ? DeepValue, TAfter, [...TDepth, any]> : TAccessor extends string ? - | Get - | ApplyNull<...> | ApplyUndefined<...> : never; -``` - -Defined in: [packages/form-core/src/util-types.ts:104](https://github.com/TanStack/form/blob/main/packages/form-core/src/util-types.ts#L104) - -Infer the type of a deeply nested property within an object or an array. - -## Type Parameters - -• **TValue** - -• **TAccessor** - -• **TDepth** *extends* `ReadonlyArray`\<`any`\> = \[\] diff --git a/docs/reference/type-aliases/derivedformstate.md b/docs/reference/type-aliases/derivedformstate.md deleted file mode 100644 index cf30bf075..000000000 --- a/docs/reference/type-aliases/derivedformstate.md +++ /dev/null @@ -1,140 +0,0 @@ ---- -id: DerivedFormState -title: DerivedFormState ---- - - - -# Type Alias: DerivedFormState\ - -```ts -type DerivedFormState = object; -``` - -Defined in: [packages/form-core/src/FormApi.ts:465](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L465) - -## Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -## Type declaration - -### canSubmit - -```ts -canSubmit: boolean; -``` - -A boolean indicating if the form can be submitted based on its current state. - -### errors - -```ts -errors: ( - | UnwrapFormValidateOrFn - | UnwrapFormValidateOrFn - | UnwrapFormAsyncValidateOrFn - | UnwrapFormValidateOrFn - | UnwrapFormAsyncValidateOrFn - | UnwrapFormValidateOrFn - | UnwrapFormAsyncValidateOrFn - | UnwrapFormAsyncValidateOrFn)[]; -``` - -The error array for the form itself. - -### fieldMeta - -```ts -fieldMeta: Record, AnyFieldMeta>; -``` - -A record of field metadata for each field in the form. - -### isBlurred - -```ts -isBlurred: boolean; -``` - -A boolean indicating if any of the form fields have been blurred. - -### isDirty - -```ts -isDirty: boolean; -``` - -A boolean indicating if any of the form's fields' values have been modified by the user. `True` if the user have modified at least one of the fields. Opposite of `isPristine`. - -### isFieldsValid - -```ts -isFieldsValid: boolean; -``` - -A boolean indicating if all the form fields are valid. - -### isFieldsValidating - -```ts -isFieldsValidating: boolean; -``` - -A boolean indicating if any of the form fields are currently validating. - -### isFormValid - -```ts -isFormValid: boolean; -``` - -A boolean indicating if the form is valid. - -### isFormValidating - -```ts -isFormValidating: boolean; -``` - -A boolean indicating if the form is currently validating. - -### isPristine - -```ts -isPristine: boolean; -``` - -A boolean indicating if none of the form's fields' values have been modified by the user. `True` if the user have not modified any of the fields. Opposite of `isDirty`. - -### isTouched - -```ts -isTouched: boolean; -``` - -A boolean indicating if any of the form fields have been touched. - -### isValid - -```ts -isValid: boolean; -``` - -A boolean indicating if the form and all its fields are valid. diff --git a/docs/reference/type-aliases/fieldinfo.md b/docs/reference/type-aliases/fieldinfo.md deleted file mode 100644 index fe7df7439..000000000 --- a/docs/reference/type-aliases/fieldinfo.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: FieldInfo -title: FieldInfo ---- - - - -# Type Alias: FieldInfo\ - -```ts -type FieldInfo = object; -``` - -Defined in: [packages/form-core/src/FormApi.ts:360](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L360) - -An object representing the field information for a specific field within the form. - -## Type Parameters - -• **TFormData** - -## Type declaration - -### instance - -```ts -instance: - | FieldApi - | null; -``` - -An instance of the FieldAPI. - -### validationMetaMap - -```ts -validationMetaMap: Record; -``` - -A record of field validation internal handling. diff --git a/docs/reference/type-aliases/fieldmeta.md b/docs/reference/type-aliases/fieldmeta.md deleted file mode 100644 index 14f0df130..000000000 --- a/docs/reference/type-aliases/fieldmeta.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -id: FieldMeta -title: FieldMeta ---- - - - -# Type Alias: FieldMeta\ - -```ts -type FieldMeta = FieldMetaBase & FieldMetaDerived; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:684](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L684) - -An object type representing the metadata of a field in a form. - -## Type Parameters - -• **TParentData** - -• **TName** *extends* [`DeepKeys`](deepkeys.md)\<`TParentData`\> - -• **TData** *extends* [`DeepValue`](deepvalue.md)\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> diff --git a/docs/reference/type-aliases/fieldmetabase.md b/docs/reference/type-aliases/fieldmetabase.md deleted file mode 100644 index 236e3709a..000000000 --- a/docs/reference/type-aliases/fieldmetabase.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -id: FieldMetaBase -title: FieldMetaBase ---- - - - -# Type Alias: FieldMetaBase\ - -```ts -type FieldMetaBase = object; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:499](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L499) - -## Type Parameters - -• **TParentData** - -• **TName** *extends* [`DeepKeys`](deepkeys.md)\<`TParentData`\> - -• **TData** *extends* [`DeepValue`](deepvalue.md)\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -## Type declaration - -### errorMap - -```ts -errorMap: ValidationErrorMap, UnwrapFieldValidateOrFn, UnwrapFieldAsyncValidateOrFn, UnwrapFieldValidateOrFn, UnwrapFieldAsyncValidateOrFn, UnwrapFieldValidateOrFn, UnwrapFieldAsyncValidateOrFn>; -``` - -A map of errors related to the field value. - -### isBlurred - -```ts -isBlurred: boolean; -``` - -A flag indicating whether the field has been blurred. - -### isDirty - -```ts -isDirty: boolean; -``` - -A flag that is `true` if the field's value has been modified by the user. Opposite of `isPristine`. - -### isTouched - -```ts -isTouched: boolean; -``` - -A flag indicating whether the field has been touched. - -### isValidating - -```ts -isValidating: boolean; -``` - -A flag indicating whether the field is currently being validated. diff --git a/docs/reference/type-aliases/fieldmetaderived.md b/docs/reference/type-aliases/fieldmetaderived.md deleted file mode 100644 index 1f7bb3888..000000000 --- a/docs/reference/type-aliases/fieldmetaderived.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: FieldMetaDerived -title: FieldMetaDerived ---- - - - -# Type Alias: FieldMetaDerived\ - -```ts -type FieldMetaDerived = object; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:589](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L589) - -## Type Parameters - -• **TParentData** - -• **TName** *extends* [`DeepKeys`](deepkeys.md)\<`TParentData`\> - -• **TData** *extends* [`DeepValue`](deepvalue.md)\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -## Type declaration - -### errors - -```ts -errors: ( - | UnwrapOneLevelOfArray> - | UnwrapOneLevelOfArray> - | UnwrapOneLevelOfArray> - | UnwrapOneLevelOfArray> - | UnwrapOneLevelOfArray> - | UnwrapOneLevelOfArray> - | UnwrapOneLevelOfArray>)[]; -``` - -An array of errors related to the field value. - -### isPristine - -```ts -isPristine: boolean; -``` - -A flag that is `true` if the field's value has not been modified by the user. Opposite of `isDirty`. diff --git a/docs/reference/type-aliases/fieldstate.md b/docs/reference/type-aliases/fieldstate.md deleted file mode 100644 index c1043845e..000000000 --- a/docs/reference/type-aliases/fieldstate.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -id: FieldState -title: FieldState ---- - - - -# Type Alias: FieldState\ - -```ts -type FieldState = object; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:770](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L770) - -An object type representing the state of a field. - -## Type Parameters - -• **TParentData** - -• **TName** *extends* [`DeepKeys`](deepkeys.md)\<`TParentData`\> - -• **TData** *extends* [`DeepValue`](deepvalue.md)\<`TParentData`, `TName`\> - -• **TOnMount** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChange** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlur** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmit** *extends* `undefined` \| `FieldValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`TParentData`, `TName`, `TData`\> - -• **TFormOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TParentData`\> - -• **TFormOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\> - -## Type declaration - -### meta - -```ts -meta: FieldMeta; -``` - -The current metadata of the field. - -### value - -```ts -value: TData; -``` - -The current value of the field. diff --git a/docs/reference/type-aliases/formstate.md b/docs/reference/type-aliases/formstate.md deleted file mode 100644 index ff23c8776..000000000 --- a/docs/reference/type-aliases/formstate.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -id: FormState -title: FormState ---- - - - -# Type Alias: FormState\ - -```ts -type FormState = BaseFormState & DerivedFormState; -``` - -Defined in: [packages/form-core/src/FormApi.ts:535](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L535) - -## Type Parameters - -• **TFormData** - -• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\> - -• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> - -• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\> diff --git a/docs/reference/type-aliases/formvalidatefn.md b/docs/reference/type-aliases/formvalidatefn.md deleted file mode 100644 index 1e4620e27..000000000 --- a/docs/reference/type-aliases/formvalidatefn.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -id: FormValidateFn -title: FormValidateFn ---- - - - -# Type Alias: FormValidateFn()\ - -```ts -type FormValidateFn = (props) => unknown; -``` - -Defined in: [packages/form-core/src/FormApi.ts:64](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L64) - -## Type Parameters - -• **TFormData** - -## Parameters - -### props - -#### formApi - -[`FormApi`](../classes/formapi.md)\<`TFormData`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`, `any`\> - -#### value - -`TFormData` - -## Returns - -`unknown` diff --git a/docs/reference/type-aliases/formvalidationerror.md b/docs/reference/type-aliases/formvalidationerror.md deleted file mode 100644 index e8178d450..000000000 --- a/docs/reference/type-aliases/formvalidationerror.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -id: FormValidationError -title: FormValidationError ---- - - - -# Type Alias: FormValidationError\ - -```ts -type FormValidationError = - | ValidationError -| GlobalFormValidationError; -``` - -Defined in: [packages/form-core/src/types.ts:58](https://github.com/TanStack/form/blob/main/packages/form-core/src/types.ts#L58) - -## Type Parameters - -• **TFormData** diff --git a/docs/reference/type-aliases/formvalidator.md b/docs/reference/type-aliases/formvalidator.md deleted file mode 100644 index 49db33665..000000000 --- a/docs/reference/type-aliases/formvalidator.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -id: FormValidator -title: FormValidator ---- - - - -# Type Alias: FormValidator\ - -```ts -type FormValidator = object; -``` - -Defined in: [packages/form-core/src/FormApi.ts:119](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L119) - -## Type Parameters - -• **TFormData** - -• **TType** - -• **TFn** = `unknown` - -## Type declaration - -### validate() - -#### Parameters - -##### options - -###### value - -`TType` - -##### fn - -`TFn` - -#### Returns - -`unknown` - -### validateAsync() - -#### Parameters - -##### options - -###### value - -`TType` - -##### fn - -`TFn` - -#### Returns - -`Promise`\<`unknown`\> diff --git a/docs/reference/type-aliases/standardschemav1.md b/docs/reference/type-aliases/standardschemav1.md deleted file mode 100644 index 17cb0125f..000000000 --- a/docs/reference/type-aliases/standardschemav1.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: StandardSchemaV1 -title: StandardSchemaV1 ---- - - - -# Type Alias: StandardSchemaV1\ - -```ts -type StandardSchemaV1 = object; -``` - -Defined in: [packages/form-core/src/standardSchemaValidator.ts:83](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L83) - -The Standard Schema interface. - -## Type Parameters - -• **Input** = `unknown` - -• **Output** = `Input` - -## Type declaration - -### ~standard - -```ts -readonly ~standard: StandardSchemaV1Props; -``` - -The Standard Schema properties. diff --git a/docs/reference/type-aliases/tstandardschemavalidatorvalue.md b/docs/reference/type-aliases/tstandardschemavalidatorvalue.md deleted file mode 100644 index 313ee227f..000000000 --- a/docs/reference/type-aliases/tstandardschemavalidatorvalue.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: TStandardSchemaValidatorValue -title: TStandardSchemaValidatorValue ---- - - - -# Type Alias: TStandardSchemaValidatorValue\ - -```ts -type TStandardSchemaValidatorValue = object; -``` - -Defined in: [packages/form-core/src/standardSchemaValidator.ts:3](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L3) - -## Type Parameters - -• **TData** - -## Type declaration - -### validationSource - -```ts -validationSource: ValidationSource; -``` - -### value - -```ts -value: TData; -``` diff --git a/docs/reference/type-aliases/unwrapfieldasyncvalidateorfn.md b/docs/reference/type-aliases/unwrapfieldasyncvalidateorfn.md deleted file mode 100644 index f2ed90556..000000000 --- a/docs/reference/type-aliases/unwrapfieldasyncvalidateorfn.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -id: UnwrapFieldAsyncValidateOrFn -title: UnwrapFieldAsyncValidateOrFn ---- - - - -# Type Alias: UnwrapFieldAsyncValidateOrFn\ - -```ts -type UnwrapFieldAsyncValidateOrFn = - | [TFormValidateOrFn] extends [StandardSchemaV1] ? TName extends keyof TStandardOut ? StandardSchemaV1Issue[] : undefined : undefined - | UnwrapFormAsyncValidateOrFnForInner extends infer TFormValidateVal ? TFormValidateVal extends object ? [DeepValue] extends [never] ? undefined : StandardSchemaV1Issue[] : TFormValidateVal extends object ? TName extends keyof TFormValidateVal["fields"] ? TFormValidateVal["fields"][TName] : undefined : undefined : never - | [TValidateOrFn] extends [FieldValidateAsyncFn] ? Awaited> : [TValidateOrFn] extends [StandardSchemaV1] ? StandardSchemaV1Issue[] : undefined; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:203](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L203) - -## Type Parameters - -• **TParentData** - -• **TName** *extends* [`DeepKeys`](deepkeys.md)\<`TParentData`\> - -• **TValidateOrFn** *extends* `undefined` \| `FieldAsyncValidateOrFn`\<`any`, `any`, `any`\> - -• **TFormValidateOrFn** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`any`\> diff --git a/docs/reference/type-aliases/unwrapfieldvalidateorfn.md b/docs/reference/type-aliases/unwrapfieldvalidateorfn.md deleted file mode 100644 index c58816352..000000000 --- a/docs/reference/type-aliases/unwrapfieldvalidateorfn.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -id: UnwrapFieldValidateOrFn -title: UnwrapFieldValidateOrFn ---- - - - -# Type Alias: UnwrapFieldValidateOrFn\ - -```ts -type UnwrapFieldValidateOrFn = - | [TFormValidateOrFn] extends [StandardSchemaV1] ? TName extends keyof TStandardOut ? StandardSchemaV1Issue[] : undefined : undefined - | UnwrapFormValidateOrFnForInner extends infer TFormValidateVal ? TFormValidateVal extends object ? [DeepValue] extends [never] ? undefined : StandardSchemaV1Issue[] : TFormValidateVal extends object ? TName extends keyof TFormValidateVal["fields"] ? TFormValidateVal["fields"][TName] : undefined : undefined : never - | [TValidateOrFn] extends [FieldValidateFn] ? ReturnType : [TValidateOrFn] extends [StandardSchemaV1] ? StandardSchemaV1Issue[] : undefined; -``` - -Defined in: [packages/form-core/src/FieldApi.ts:120](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L120) - -## Type Parameters - -• **TParentData** - -• **TName** *extends* [`DeepKeys`](deepkeys.md)\<`TParentData`\> - -• **TValidateOrFn** *extends* `undefined` \| `FieldValidateOrFn`\<`any`, `any`, `any`\> - -• **TFormValidateOrFn** *extends* `undefined` \| `FormValidateOrFn`\<`any`\> diff --git a/docs/reference/type-aliases/unwrapformasyncvalidateorfn.md b/docs/reference/type-aliases/unwrapformasyncvalidateorfn.md deleted file mode 100644 index 2f97738fa..000000000 --- a/docs/reference/type-aliases/unwrapformasyncvalidateorfn.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -id: UnwrapFormAsyncValidateOrFn -title: UnwrapFormAsyncValidateOrFn ---- - - - -# Type Alias: UnwrapFormAsyncValidateOrFn\ - -```ts -type UnwrapFormAsyncValidateOrFn = [TValidateOrFn] extends [FormValidateAsyncFn] ? Awaited> : [TValidateOrFn] extends [StandardSchemaV1] ? Record : undefined; -``` - -Defined in: [packages/form-core/src/FormApi.ts:141](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L141) - -## Type Parameters - -• **TValidateOrFn** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`any`\> diff --git a/docs/reference/type-aliases/unwrapformvalidateorfn.md b/docs/reference/type-aliases/unwrapformvalidateorfn.md deleted file mode 100644 index 7ec18923c..000000000 --- a/docs/reference/type-aliases/unwrapformvalidateorfn.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -id: UnwrapFormValidateOrFn -title: UnwrapFormValidateOrFn ---- - - - -# Type Alias: UnwrapFormValidateOrFn\ - -```ts -type UnwrapFormValidateOrFn = [TValidateOrFn] extends [FormValidateFn] ? ReturnType : [TValidateOrFn] extends [StandardSchemaV1] ? Record : undefined; -``` - -Defined in: [packages/form-core/src/FormApi.ts:89](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L89) - -## Type Parameters - -• **TValidateOrFn** *extends* `undefined` \| `FormValidateOrFn`\<`any`\> diff --git a/docs/reference/type-aliases/updater.md b/docs/reference/type-aliases/updater.md deleted file mode 100644 index bbbefe1b3..000000000 --- a/docs/reference/type-aliases/updater.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -id: Updater -title: Updater ---- - - - -# Type Alias: Updater\ - -```ts -type Updater = TOutput | UpdaterFn; -``` - -Defined in: [packages/form-core/src/utils.ts:7](https://github.com/TanStack/form/blob/main/packages/form-core/src/utils.ts#L7) - -## Type Parameters - -• **TInput** - -• **TOutput** = `TInput` diff --git a/docs/reference/type-aliases/updaterfn.md b/docs/reference/type-aliases/updaterfn.md deleted file mode 100644 index c0f917772..000000000 --- a/docs/reference/type-aliases/updaterfn.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -id: UpdaterFn -title: UpdaterFn ---- - - - -# Type Alias: UpdaterFn()\ - -```ts -type UpdaterFn = (input) => TOutput; -``` - -Defined in: [packages/form-core/src/utils.ts:5](https://github.com/TanStack/form/blob/main/packages/form-core/src/utils.ts#L5) - -## Type Parameters - -• **TInput** - -• **TOutput** = `TInput` - -## Parameters - -### input - -`TInput` - -## Returns - -`TOutput` diff --git a/docs/reference/type-aliases/validationerror.md b/docs/reference/type-aliases/validationerror.md deleted file mode 100644 index 87984446d..000000000 --- a/docs/reference/type-aliases/validationerror.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -id: ValidationError -title: ValidationError ---- - - - -# Type Alias: ValidationError - -```ts -type ValidationError = unknown; -``` - -Defined in: [packages/form-core/src/types.ts:3](https://github.com/TanStack/form/blob/main/packages/form-core/src/types.ts#L3) diff --git a/docs/reference/type-aliases/validationmeta.md b/docs/reference/type-aliases/validationmeta.md deleted file mode 100644 index 41633bdab..000000000 --- a/docs/reference/type-aliases/validationmeta.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -id: ValidationMeta -title: ValidationMeta ---- - - - -# Type Alias: ValidationMeta - -```ts -type ValidationMeta = object; -``` - -Defined in: [packages/form-core/src/FormApi.ts:350](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L350) - -An object representing the validation metadata for a field. Not intended for public usage. - -## Type declaration - -### lastAbortController - -```ts -lastAbortController: AbortController; -``` - -An abort controller stored in memory to cancel previous async validation attempts. diff --git a/docs/reference/type-aliases/validationsource.md b/docs/reference/type-aliases/validationsource.md deleted file mode 100644 index 0edfb695b..000000000 --- a/docs/reference/type-aliases/validationsource.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -id: ValidationSource -title: ValidationSource ---- - - - -# Type Alias: ValidationSource - -```ts -type ValidationSource = "form" | "field"; -``` - -Defined in: [packages/form-core/src/types.ts:5](https://github.com/TanStack/form/blob/main/packages/form-core/src/types.ts#L5) diff --git a/docs/reference/variables/standardschemavalidators.md b/docs/reference/variables/standardschemavalidators.md deleted file mode 100644 index 4ee3c9688..000000000 --- a/docs/reference/variables/standardschemavalidators.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -id: standardSchemaValidators -title: standardSchemaValidators ---- - - - -# Variable: standardSchemaValidators - -```ts -const standardSchemaValidators: object; -``` - -Defined in: [packages/form-core/src/standardSchemaValidator.ts:48](https://github.com/TanStack/form/blob/main/packages/form-core/src/standardSchemaValidator.ts#L48) - -## Type declaration - -### validate() - -#### Parameters - -##### \_\_namedParameters - -[`TStandardSchemaValidatorValue`](../type-aliases/tstandardschemavalidatorvalue.md)\<`unknown`\> - -##### schema - -[`StandardSchemaV1`](../type-aliases/standardschemav1.md) - -#### Returns - - \| `undefined` - \| readonly [`StandardSchemaV1Issue`](../interfaces/standardschemav1issue.md)[] - \| \{ - `fields`: \{\}; - `form`: \{\}; - \} - -### validateAsync() - -#### Parameters - -##### \_\_namedParameters - -[`TStandardSchemaValidatorValue`](../type-aliases/tstandardschemavalidatorvalue.md)\<`unknown`\> - -##### schema - -[`StandardSchemaV1`](../type-aliases/standardschemav1.md) - -#### Returns - -`Promise`\< - \| `undefined` - \| readonly [`StandardSchemaV1Issue`](../interfaces/standardschemav1issue.md)[] - \| \{ - `fields`: \{\}; - `form`: \{\}; - \}\> diff --git a/packages/form-core/src/FieldApi.ts b/packages/form-core/src/FieldApi.ts index 91468d56f..0209529ee 100644 --- a/packages/form-core/src/FieldApi.ts +++ b/packages/form-core/src/FieldApi.ts @@ -14,6 +14,7 @@ import type { FieldInfo, FormApi, FormAsyncValidateOrFn, + FormState, FormValidateAsyncFn, FormValidateFn, FormValidateOrFn, @@ -92,6 +93,7 @@ export type FieldValidateFn< any, any, any, + any, any > }) => unknown @@ -176,6 +178,7 @@ export type FieldValidateAsyncFn< any, any, any, + any, any > signal: AbortSignal @@ -259,10 +262,39 @@ export type FieldListenerFn< any, any, any, + any, any > }) => void +/** + * @private + */ +export type FieldMetaFn< + TParentData, + TFormOnMount extends undefined | FormValidateOrFn, + TFormOnChange extends undefined | FormValidateOrFn, + TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn, + TFormOnBlur extends undefined | FormValidateOrFn, + TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn, + TFormOnSubmit extends undefined | FormValidateOrFn, + TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn, + TFormOnServer extends undefined | FormAsyncValidateOrFn, + TFieldMetaExtension extends object, +> = ( + props: FormState< + TParentData, + TFormOnMount, + TFormOnChange, + TFormOnChangeAsync, + TFormOnBlur, + TFormOnBlurAsync, + TFormOnSubmit, + TFormOnSubmitAsync, + TFormOnServer + >, +) => TFieldMetaExtension + export interface FieldValidators< TParentData, TName extends DeepKeys, @@ -375,6 +407,15 @@ export interface FieldOptions< TOnSubmitAsync extends | undefined | FieldAsyncValidateOrFn, + TFormOnMount extends undefined | FormValidateOrFn, + TFormOnChange extends undefined | FormValidateOrFn, + TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn, + TFormOnBlur extends undefined | FormValidateOrFn, + TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn, + TFormOnSubmit extends undefined | FormValidateOrFn, + TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn, + TFormOnServer extends undefined | FormAsyncValidateOrFn, + TFieldMetaExtension extends object, > { /** * The field name. The type will be `DeepKeys` to ensure your name is a deep key of the parent dataset. @@ -428,13 +469,30 @@ export interface FieldOptions< any, any, any, - any + any, + TFieldMetaExtension > > /** * A list of listeners which attach to the corresponding events */ listeners?: FieldListeners + + /** + * A list of listeners which attach to the corresponding events + */ + meta?: FieldMetaFn< + TParentData, + TFormOnMount, + TFormOnChange, + TFormOnChangeAsync, + TFormOnBlur, + TFormOnBlurAsync, + TFormOnSubmit, + TFormOnSubmitAsync, + TFormOnServer, + TFieldMetaExtension + > /** * Disable the `flat(1)` operation on `field.errors`. This is useful if you want to keep the error structure as is. Not suggested for most use-cases. */ @@ -470,6 +528,7 @@ export interface FieldApiOptions< TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn, TFormOnServer extends undefined | FormAsyncValidateOrFn, TParentSubmitMeta, + TFieldMetaExtension extends object, > extends FieldOptions< TParentData, TName, @@ -480,7 +539,16 @@ export interface FieldApiOptions< TOnBlur, TOnBlurAsync, TOnSubmit, - TOnSubmitAsync + TOnSubmitAsync, + TFormOnMount, + TFormOnChange, + TFormOnChangeAsync, + TFormOnBlur, + TFormOnBlurAsync, + TFormOnSubmit, + TFormOnSubmitAsync, + TFormOnServer, + TFieldMetaExtension > { form: FormApi< TParentData, @@ -520,6 +588,7 @@ export type FieldMetaBase< TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn, TFormOnSubmit extends undefined | FormValidateOrFn, TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn, + TFieldMetaExtension extends object = {}, > = { /** * A flag indicating whether the field has been touched. @@ -564,7 +633,7 @@ export type FieldMetaBase< * A flag indicating whether the field is currently being validated. */ isValidating: boolean -} +} & TFieldMetaExtension export type AnyFieldMetaBase = FieldMetaBase< any, @@ -583,6 +652,7 @@ export type AnyFieldMetaBase = FieldMetaBase< any, any, any, + any, any > @@ -610,6 +680,7 @@ export type FieldMetaDerived< TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn, TFormOnSubmit extends undefined | FormValidateOrFn, TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn, + TFieldMetaExtension extends object = {}, > = { /** * An array of errors related to the field value. @@ -656,7 +727,7 @@ export type FieldMetaDerived< * A flag that is `true` if the field's value has not been modified by the user. Opposite of `isDirty`. */ isPristine: boolean -} +} & TFieldMetaExtension export type AnyFieldMetaDerived = FieldMetaDerived< any, @@ -675,6 +746,7 @@ export type AnyFieldMetaDerived = FieldMetaDerived< any, any, any, + any, any > @@ -705,6 +777,7 @@ export type FieldMeta< TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn, TFormOnSubmit extends undefined | FormValidateOrFn, TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn, + TFieldMetaExtension extends object = {}, > = FieldMetaBase< TParentData, TName, @@ -722,7 +795,8 @@ export type FieldMeta< TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, - TFormOnSubmitAsync + TFormOnSubmitAsync, + TFieldMetaExtension > & FieldMetaDerived< TParentData, @@ -741,7 +815,8 @@ export type FieldMeta< TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, - TFormOnSubmitAsync + TFormOnSubmitAsync, + TFieldMetaExtension > export type AnyFieldMeta = FieldMeta< @@ -761,6 +836,7 @@ export type AnyFieldMeta = FieldMeta< any, any, any, + any, any > @@ -791,6 +867,7 @@ export type FieldState< TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn, TFormOnSubmit extends undefined | FormValidateOrFn, TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn, + TFieldMetaExtension extends object, > = { /** * The current value of the field. @@ -816,7 +893,8 @@ export type FieldState< TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, - TFormOnSubmitAsync + TFormOnSubmitAsync, + TFieldMetaExtension > } @@ -844,6 +922,7 @@ export type AnyFieldApi = FieldApi< any, any, any, + any, any > @@ -882,6 +961,7 @@ export class FieldApi< TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn, TFormOnServer extends undefined | FormAsyncValidateOrFn, TParentSubmitMeta, + TFieldMetaExtension extends object, > { /** * A reference to the form API instance. @@ -905,7 +985,8 @@ export class FieldApi< TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, - TParentSubmitMeta + TParentSubmitMeta, + TFieldMetaExtension >['form'] /** * The field name. @@ -933,7 +1014,8 @@ export class FieldApi< TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, - TParentSubmitMeta + TParentSubmitMeta, + TFieldMetaExtension > = {} as any /** * The field state store. @@ -956,7 +1038,8 @@ export class FieldApi< TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, - TFormOnSubmitAsync + TFormOnSubmitAsync, + TFieldMetaExtension > > /** @@ -990,7 +1073,8 @@ export class FieldApi< TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, - TParentSubmitMeta + TParentSubmitMeta, + TFieldMetaExtension >, ) { this.form = opts.form as never @@ -1037,7 +1121,8 @@ export class FieldApi< TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, - TFormOnSubmitAsync + TFormOnSubmitAsync, + TFieldMetaExtension > }, }) @@ -1110,6 +1195,11 @@ export class FieldApi< fieldApi: this, }) + this.setMeta((prev) => ({ + ...prev, + ...this.options.meta?.(this.form.state), + })) + return cleanup } @@ -1136,7 +1226,8 @@ export class FieldApi< TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, - TParentSubmitMeta + TParentSubmitMeta, + TFieldMetaExtension >, ) => { // Default Value @@ -1183,6 +1274,11 @@ export class FieldApi< fieldApi: this, }) + this.setMeta((prev) => ({ + ...prev, + ...this.options.meta?.(this.form.state), + })) + this.validate('change') } @@ -1210,7 +1306,8 @@ export class FieldApi< TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, - TFormOnSubmitAsync + TFormOnSubmitAsync, + TFieldMetaExtension > >, ) => this.form.setFieldMeta(this.name, updater) diff --git a/packages/form-core/src/FormApi.ts b/packages/form-core/src/FormApi.ts index a68e77d83..950da2e0b 100644 --- a/packages/form-core/src/FormApi.ts +++ b/packages/form-core/src/FormApi.ts @@ -380,6 +380,7 @@ export type FieldInfo = { any, any, any, + any, any > | null /** diff --git a/packages/form-core/tests/FieldApi.spec.ts b/packages/form-core/tests/FieldApi.spec.ts index 7365852e2..4b15bd734 100644 --- a/packages/form-core/tests/FieldApi.spec.ts +++ b/packages/form-core/tests/FieldApi.spec.ts @@ -1850,4 +1850,27 @@ describe('field api', () => { expect(field.getMeta().errors).toStrictEqual([]) expect(form.state.canSubmit).toBe(true) }) + + it('should have user defined meta and react to value change', () => { + const form = new FormApi({ + defaultValues: { + name: 'Stegosaurus', + }, + }) + form.mount() + + const nameField = new FieldApi({ + form, + name: 'name', + meta: ({ values }) => ({ + dinosaur: values.name === 'Stegosaurus' ? 'dino' : 'notDino', + }), + }) + + nameField.mount() + expect(nameField.getMeta().dinosaur).toEqual('dino') + + nameField.handleChange('Cat') + expect(nameField.getMeta().dinosaur).toEqual('notDino') + }) })