Class Input

A class that represents an input field widget.

@ extends Widget implements ValueWidget

Hierarchy (view full)

Implements

Constructors

  • Create a new input field widget and initialize it.

    Parameters

    • Optional label: string = ''

      The label text.

    • Optional val: string = ''

      The initial value.

    • Optional callback: Function = null

      The function to call when the input is changed.

    Returns Input

Properties

inputRef: HTMLInputElement
labelRef: HTMLDivElement
listeners: {
    [key: string]: Function[];
}

Type declaration

  • [key: string]: Function[]
ref: HTMLDivElement
value: any
view: View

Methods

  • Bind an input field to an object property.

    Parameters

    • obj: any

      The object to bind the property to.

    • prop: string

      The property to bind.

    Returns this

  • Add an input event listener to the input field.

    Parameters

    • f: Function

      The function to call when the input is changed.

    Returns this

  • Set the label of the input field.

    Parameters

    • label: string

      The new label text.

    Returns this