Skip to content

Latest commit

 

History

History
321 lines (194 loc) · 8.87 KB

tanstackfield.md

File metadata and controls

321 lines (194 loc) · 8.87 KB
id title
TanStackField
TanStackField

Class: TanStackField<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TSubmitMeta>

Defined in: tanstack-field.directive.ts:31

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()

new TanStackField<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TSubmitMeta>(): TanStackField<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TSubmitMeta>

Returns

TanStackField<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TSubmitMeta>

Properties

api

api: FieldApi<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TSubmitMeta>;

Defined in: tanstack-field.directive.ts:129


asyncAlways?

optional asyncAlways: boolean;

Defined in: tanstack-field.directive.ts:78

If true, always run async validation, even if there are errors emitted during synchronous validation.

Implementation of

FieldOptions.asyncAlways

asyncDebounceMs?

optional asyncDebounceMs: number;

Defined in: tanstack-field.directive.ts:77

The default time to debounce async validation if there is not a more specific debounce time passed.

Implementation of

FieldOptions.asyncDebounceMs

defaultMeta?

optional defaultMeta: Partial<FieldMeta<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync>>;

Defined in: tanstack-field.directive.ts:106

An optional object with default metadata for the field.

Implementation of

FieldOptions.defaultMeta

defaultValue?

optional defaultValue: NoInfer<TData>;

Defined in: tanstack-field.directive.ts:76

An optional default value for the field.

Implementation of

FieldOptions.defaultValue

disableErrorFlat?

optional disableErrorFlat: boolean;

Defined in: tanstack-field.directive.ts:127

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

FieldOptions.disableErrorFlat

listeners?

optional listeners: NoInfer<FieldListeners<TParentData, TName, TData>>;

Defined in: tanstack-field.directive.ts:105

A list of listeners which attach to the corresponding events

Implementation of

FieldOptions.listeners

name

name: TName;

Defined in: tanstack-field.directive.ts:75

The field name. The type will be DeepKeys<TParentData> to ensure your name is a deep key of the parent dataset.

Implementation of

FieldOptions.name

tanstackField

tanstackField: FormApi<TParentData, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TSubmitMeta>;

Defined in: tanstack-field.directive.ts:79


unmount()?

optional unmount: () => void;

Defined in: tanstack-field.directive.ts:185

Returns

void


validators?

optional validators: NoInfer<FieldValidators<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync>>;

Defined in: tanstack-field.directive.ts:91

A list of validators to pass to the field

Implementation of

FieldOptions.validators

Methods

ngOnChanges()

ngOnChanges(): void

Defined in: tanstack-field.directive.ts:197

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

OnChanges.ngOnChanges

ngOnDestroy()

ngOnDestroy(): void

Defined in: tanstack-field.directive.ts:193

A callback method that performs custom clean-up, invoked immediately before a directive, pipe, or service instance is destroyed.

Returns

void

Implementation of

OnDestroy.ngOnDestroy

ngOnInit()

ngOnInit(): void

Defined in: tanstack-field.directive.ts:187

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

OnInit.ngOnInit