Type alias AbstractFormField<T, V>

AbstractFormField<T, V>: {
    description?: Description;
    initialValue?: V;
    label?: string;
    name: string;
    onChange?: ((value, name) => void);
    required?: boolean;
    type: T;
}

Type Parameters

  • T extends string
  • V

Type declaration

  • Optional description?: Description

    An optional verbose description which will only be shown when the field is expanded.

  • Optional initialValue?: V
  • Optional label?: string

    A quick description of the field. If omitted, the name will be used as label.

  • name: string

    The name uniquely identifies the input field and is used to store the value in the output structure, i.e. if field.name === 'myFieldName', then the value chosen by the user is available in the output stucture in output['myFieldName']. Note that the section structure is irrelevant for the output structure, just the name uniquely identifies the field.

  • Optional onChange?: ((value, name) => void)
      • (value, name): void
      • Parameters

        • value: V
        • name: string

        Returns void

  • Optional required?: boolean

    If this is set to true, the form cannot be submitted if this fields value is empty or undefined.

  • type: T

    The type uniquely identifies which kind of form field is used, e.g. 'string', 'integer'. This tells the library which form field manager should be used to handle this form field.