Interface ValueWidget

Widget with value

interface ValueWidget {
    listeners: {
        [key: string]: Function[];
    };
    ref: HTMLElement;
    value: any;
    view: View;
    _init(): void;
    addClass(...classes: string[]): this;
    bind(obj: object, prop: string): void;
    destroy(): void;
    getRef(): HTMLElement;
    getValue(): any;
    off(event: string, callback: Function): void;
    on(event: string, callback: Function): void;
    onClick(f: Function): this;
    removeClass(...classes: string[]): this;
    setContent(value: string): this;
    setText(value: string): this;
    setValue(value: any): ValueWidget;
    trigger(event: string, ...args: any[]): void;
}

Hierarchy (view full)

Implemented by

Properties

listeners: {
    [key: string]: Function[];
}
ref: HTMLElement
value: any
view: View

Methods

  • Parameters

    • event: string
    • callback: Function

    Returns void

  • Add a click event listener to the widget.

    Parameters

    • f: Function

      The function to call when the widget is clicked.

    Returns this

  • Set the content of the widget.

    Parameters

    • value: string

      The value to set the content to.

    Returns this

  • Set the text of the widget.

    Parameters

    • value: string

      The value to set the text to.

    Returns this