Options
All
  • Public
  • Public/Protected
  • All
Menu

External module @corpuscule/form

This module provides tools to handle web forms. Works as a connector to a 🏁 Final Form.

Index

Type aliases

FieldMetaProps

FieldMetaProps<TFieldValue>: Omit<FieldOptions<TFieldValue>, "name" | "value">

Type parameters

  • TFieldValue

FieldOptions

FieldOptions<TFieldValue>: Omit<FieldState<TFieldValue>, "blur" | "change" | "focus" | "length">

See the FieldState documentation. This interface contains every option from it except for:

  • blur,
  • change,
  • focus,
  • length,
  • name,
  • value,

This interface is not necessary to be implemented because it covers only the one case when all your properties are string and you do not plan to use specific property names.

Type parameters

  • TFieldValue

Variables

Const isFormAdvanced

isFormAdvanced: isProvider

Works as a isProvider for the @form.

Functions

createFormToken

  • createFormToken(): Token

field

fieldAdvanced

  • A decorator that makes a class declaration a 🏁 FinalForm field with a form instance as a context value. The @consumer is used internally.

    Parameters

    • token: Token

      a token issued by a createFormToken function that connects all decorators in a single working system.

    • Optional options: FieldDecoratorOptions

      an object that contains options to tune the field behavior.

    Returns ClassDecorator

form

formAdvanced

  • A decorator that makes a class declaration a 🏁 FinalForm provider with a form instance as a context value. The @provider decorator is used internally.

    Parameters

    • token: Token

      a token issued by a createFormToken function that connects all decorators in a single working system.

    • Optional options: FormDecoratorOptions

      an object that contains options to tune the form behavior.

    Returns ClassDecorator

gear

  • gear(responsibilityKey?: keyof FormGears | keyof FieldGears<unknown>): PropertyDecorator
  • A default version of the @gearAdvanced with the token already provided.

    Parameters

    • Optional responsibilityKey: keyof FormGears | keyof FieldGears<unknown>

    Returns PropertyDecorator

gearAdvanced

  • gearAdvanced(token: Token, responsibilityKey?: keyof FormGears | keyof FieldGears<unknown>): PropertyDecorator
  • A decorator that converts a class property to a part of the 🏁 Final Form interface. Both @form and @field decorators require several specific @gear properties to exist.

    If you do not plan to use the specific properties names, you can implement the FormGears interface for the form or FieldGears for the field.

    Parameters

    • token: Token

      a token issued by a createFormToken function that connects all decorators in a single working system.

    • Optional responsibilityKey: keyof FormGears | keyof FieldGears<unknown>

      a specific name of a gear that describes the responsibility of the property this decorator is applied to. If it is omitted, the name (or the description if it is a symbol) of the property will be used.

    Returns PropertyDecorator

isForm

  • isForm(klass: unknown): boolean

option

  • option(responsibilityKey?: keyof FormOptions | keyof FieldOptions<unknown>): PropertyDecorator

optionAdvanced

  • optionAdvanced(token: Token, responsibilityKey?: keyof FormOptions | keyof FieldOptions<unknown>): PropertyDecorator
  • A decorator that converts a class property to a 🏁 Final Form option. Both @form and @field have their options. Some options are required; others can be omitted.

    If you do not plan to use the specific properties names, you can implement the FormGears interface for the form or FieldGears for the field.

    Parameters

    • token: Token

      a token issued by a createFormToken function that connects all decorators in a single working system.

    • Optional responsibilityKey: keyof FormOptions | keyof FieldOptions<unknown>

      a specific name of an option that describes the responsibility of the property this decorator is applied to. If it is omitted, the name (or the description if it is a symbol) of the property will be used.

    Returns PropertyDecorator

Generated using TypeDoc