Class FormUnit<TValue, TControls, TSharer>Abstract

Abstract unit of input form.

Represents a form or its field control and contains its value.

Type Parameters

  • TValue

    Input value type.

  • TControls extends FormUnit.Controls<TValue> = FormUnit.Controls<TValue>

    A type of input controls this unit represents.

  • TSharer extends object = any

    Unit sharer component type.

Hierarchy

  • Shareable<TControls | undefined, TSharer>

Constructors

  • Constructs form unit.

    Type Parameters

    Parameters

    • controls: TControls | Provider<undefined | TControls, TSharer>

      Either input controls, or their provider.

    Returns FormUnit<TValue, TControls, TSharer>

Accessors

  • get body(): TBody
  • Shareable body.

    Accessing is throws an exception until bound to sharer.

    Returns TBody

  • get control(): undefined | InControl<TValue>
  • Input control of the field, if present.

    Returns undefined | InControl<TValue>

  • get read(): AfterEvent<[TBody]>
  • An AfterEvent keeper of shareable body.

    An [AfterEvent__symbol] method always returns this value.

    Returns AfterEvent<[TBody]>

  • get sharer(): ComponentContext<TSharer>
  • Sharer component context.

    Accessing it throws an exception until bound to sharer.

    Returns ComponentContext<TSharer>

Methods

  • Returns AfterEvent<[undefined | TControls]>

  • Parameters

    • sharer: ComponentContext<TSharer>

    Returns void

  • Converts shareable body or its provider to provider that always returns an AfterEvent keeper of shareable body.

    Returns

    Shareable body provider.

    Type Parameters

    • TBody = unknown

      Shareable body type.

    • TSharer extends object = any

      Sharer component type.

    Parameters

    • body: TBody | Provider<TBody, TSharer>

      Either shareable body, or its provider.

    Returns ((this: void, sharer: ComponentContext<TSharer>) => AfterEvent<[TBody]>)

      • (this: void, sharer: ComponentContext<TSharer>): AfterEvent<[TBody]>
      • Converts shareable body or its provider to provider that always returns an AfterEvent keeper of shareable body.

        Returns

        Shareable body provider.

        Parameters

        • this: void
        • sharer: ComponentContext<TSharer>

        Returns AfterEvent<[TBody]>

Generated using TypeDoc