Class InputGroup

Represents any arbitrary structural grouping of inputs.

This is the base for validator state (which can validate multiple inputs) and forms (whose action can depend on several inputs).

Type parameters

Type parameter Description
TInputs: InputGroupContent

constructor

  • Instantiates an input group

    Parameters

    • inputs: MaybeConstant<function>

      The structure of inputs. This maybe a single input, an object of inputs or input groups, an array of inputs or input groups, or a nested structure thereof, or a function returning such a structure.

    • Optional options: InputGroupOptions

      Customizes input group behavior.

    Returns InputGroup

devOptions

devOptions: StateDevOptions

Development-time settings

options

options: InputGroupOptions

Customizes input group behavior.

flattedInputs

  • get flattedInputs(): Input<any>[]
  • Returns a flattened array of inputs. The order of inputs is not guaranteed.

    Use structure to get the input structure as specified in the constructor including the subgroups, or inputs without the subgroups.

    see

    structure

    see

    inputs

    Returns Input<any>[]

flattenedStructure

  • Returns an array of the input group's structural items. Unlike [[flattenedInputs]], the subgroups are not broken down into inputs here.

    Returns (Input<any> | InputGroup<any>)[]

inputValue

  • get inputValue(): InferInputGroupValue<TInputs>
  • Same as with value but each value is the current input value, not the confirmed input value.

    see

    value

    Returns InferInputGroupValue<TInputs>

inputs

  • get inputs(): InferInputGroupShape<TInputs>
  • Reflects the structure of inputs as provided in the constructor. If a function was passed in the constructor, it is evaluated here. Subgroups in the structures are collapsed into their structures.

    Use structure if you need the subgroups preserved. Use [[flattenedInputs]] if you don't care about the structure and just want the inputs in an array.

    see

    structure

    see

    [[flattenedInputs]]

    Returns InferInputGroupShape<TInputs>

name

  • get name(): null | string
  • Returns the UI state's debug name.

    Returns null | string

normalizedInputValue

  • get normalizedInputValue(): InferInputGroupValue<TInputs>
  • Same as with value but each value is the current input value, normalized by each input's normalizer.

    see

    value

    Returns InferInputGroupValue<TInputs>

structure

  • get structure(): TInputs
  • Returns the structure of the input group. If the input structure contains subgroups, the subgroups are preserved here.

    Use inputs to get the input structure without subgroups.

    Use [[flattenedInputs]] to get an array of inputs whose order does not matter.

    see

    flattedInputs

    see

    inputs

    Returns TInputs

value

  • get value(): InferInputGroupValue<TInputs>
  • Returns a structure of confirmed input value that corresponds to the input structure passed to the constructor. For instance, if the constructor was instantiated with { a : someInput, b: someOuterInput }, the value here will also have the keys a and b whose value are the respective input values.

    see

    inputValue

    Returns InferInputGroupValue<TInputs>

confirm

  • confirm(args: object): void
  • Batch-confirm the inputs using the value that is provided in the group. Note that unlike individually confirming an input, this does not permit an option to advance the focus to the "next" input.

    Parameters

    • args: object

    Returns void

reset

  • reset(args?: undefined | object): void
  • Batch-reset the inputs using the value that is provided in the group. This is the same as calling reset on the individual input instances.

    Parameters

    • Optional args: undefined | object

    Returns void

Generated using TypeDoc