turbodombuilder - v0.9.5
    Preparing search index...

    Class TurboNumericalInput<ViewType, DataType, ModelType, EmitterType>

    Class for creating a rich turbo element (an element that is possibly accompanied by icons (or other elements) on its left and/or right). TurboRichElement

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Static configuration object.

    labelElement: HTMLLabelElement
    content: HTMLElement
    locked: boolean = false
    selectTextOnFocus: boolean = false
    inputRegexCheck: string | RegExp
    blurRegexCheck: string | RegExp
    dynamicVerticalResize: boolean = false
    defaultId: string = ...
    multiplier: number = 1
    decimalPlaces: number
    min: number
    max: number
    childrenOrder: readonly [
        "leftCustomElements",
        "leftIcon",
        "prefixEntry",
        "element",
        "suffixEntry",
        "rightIcon",
        "rightCustomElements",
    ] = ...
    elementTag: "input"

    The tag of the text element in the button

    selected: boolean

    Whether the element is selected or not.

    initialized: boolean
    view: ViewType

    The view (if any) of the element. Only when initializing MVC.

    model: ModelType

    The model (if any) of the element. Only when initializing MVC.

    data: DataType

    The main data block (if any) attached to the element, taken from its model (if any). Only when initializing MVC.

    dataId: string

    The ID of the main data block (if any) of the element, taken from its model (if any). Only when initializing MVC.

    dataIndex: number

    The numerical index of the main data block (if any) of the element, taken from its model (if any). Only when initializing MVC.

    dataSize: number

    The size (number) of the main data block (if any) of the element, taken from its model (if any). Only when initializing MVC.

    unsetDefaultClasses: boolean
    mvc: Mvc<
        TurboNumericalInput<ViewType, DataType, ModelType, EmitterType>,
        ViewType,
        DataType,
        ModelType,
        EmitterType,
    > = ...

    The MVC handler of the element. If initialized, turns the element into an MVC structure.

    onAttach: Delegate<() => void> = ...

    Delegate fired when the element is attached to DOM.

    onDetach: Delegate<() => void> = ...

    Delegate fired when the element is detached from the DOM.

    onAdopt: Delegate<() => void> = ...

    Delegate fired when the element is adopted by a new parent in the DOM.

    Accessors

    • set label(value: string): void

      Parameters

      • value: string

      Returns void

    • get element(): ValidElement<InputTag>

      Returns ValidElement<InputTag>

      The text element. Can be set to a new element by a simple assignment. Setting the value to a new string will update the text's innerText with the given string.

    • set element(value: ValidElement<InputTag> | TurboProperties<InputTag>): void

      Returns void

      The text element. Can be set to a new element by a simple assignment. Setting the value to a new string will update the text's innerText with the given string.

    • get stringValue(): string

      Returns string

    • set stringValue(value: string): void

      Parameters

      • value: string

      Returns void

    • get value(): number

      Returns number

    • set value(value: string | number): void

      Parameters

      • value: string | number

      Returns void

    • set leftCustomElements(value: Element | Element[]): void

      Parameters

      Returns void

      The custom element(s) on the left. Can be set to new element(s) by a simple assignment.

    • get leftIcon(): TurboIcon

      Returns TurboIcon

    • set leftIcon(
          value:
              | string
              | TurboIcon<
                  TurboView<
                      any,
                      any,
                      TurboEmitter<
                          TurboModel<any, any, any, "array" | "map", MvcDataBlock<any, any>>,
                      >,
                  >,
                  object,
                  TurboModel<any, any, any, "array" | "map", MvcDataBlock<any, any>>,
                  TurboEmitter<
                      TurboModel<any, any, any, "array" | "map", MvcDataBlock<any, any>>,
                  >,
              >,
      ): void

      Parameters

      • value:
            | string
            | TurboIcon<
                TurboView<
                    any,
                    any,
                    TurboEmitter<
                        TurboModel<any, any, any, "array" | "map", MvcDataBlock<any, any>>,
                    >,
                >,
                object,
                TurboModel<any, any, any, "array" | "map", MvcDataBlock<any, any>>,
                TurboEmitter<
                    TurboModel<any, any, any, "array" | "map", MvcDataBlock<any, any>>,
                >,
            >

      Returns void

      The left icon element. Can be set with a new icon by a simple assignment (the name/path of the icon, or a Turbo/HTML element).

    • get prefixEntry(): HTMLElement

      Returns HTMLElement

    • set prefixEntry(value: string | HTMLElement): void

      Parameters

      Returns void

      The left icon element. Can be set with a new icon by a simple assignment (the name/path of the icon, or a Turbo/HTML element).

    • get text(): string

      Returns string

      The text element. Can be set to a new element by a simple assignment. Setting the value to a new string will update the text's innerText with the given string.

    • set text(value: string): void

      Parameters

      • value: string

      Returns void

    • get suffixEntry(): HTMLElement

      Returns HTMLElement

    • set suffixEntry(value: string | HTMLElement): void

      Parameters

      Returns void

      The left icon element. Can be set with a new icon by a simple assignment (the name/path of the icon, or a Turbo/HTML element).

    • get rightIcon(): TurboIcon

      Returns TurboIcon

    • set rightIcon(
          value:
              | string
              | TurboIcon<
                  TurboView<
                      any,
                      any,
                      TurboEmitter<
                          TurboModel<any, any, any, "array" | "map", MvcDataBlock<any, any>>,
                      >,
                  >,
                  object,
                  TurboModel<any, any, any, "array" | "map", MvcDataBlock<any, any>>,
                  TurboEmitter<
                      TurboModel<any, any, any, "array" | "map", MvcDataBlock<any, any>>,
                  >,
              >,
      ): void

      Parameters

      • value:
            | string
            | TurboIcon<
                TurboView<
                    any,
                    any,
                    TurboEmitter<
                        TurboModel<any, any, any, "array" | "map", MvcDataBlock<any, any>>,
                    >,
                >,
                object,
                TurboModel<any, any, any, "array" | "map", MvcDataBlock<any, any>>,
                TurboEmitter<
                    TurboModel<any, any, any, "array" | "map", MvcDataBlock<any, any>>,
                >,
            >

      Returns void

      The right icon element. Can be set with a new icon by a simple assignment (the name/path of the icon, or a Turbo/HTML element).

    • set rightCustomElements(value: Element | Element[]): void

      Parameters

      Returns void

      The custom element(s) on the right. Can be set to new element(s) by a simple assignment.

    Methods

    • Protected

      setupUIElements

      Returns void

      Setup method intended to initialize all direct sub-elements attached to this element, and store them in fields.

    • Protected

      setupUILayout

      Returns void

      Setup method to create the layout structure of the element by adding all created sub-elements to this element's child tree.

    • Protected

      setupUIListeners

      Returns void

      Setup method to initialize and define all input/DOM event listeners of the element.

    • Protected

      getPropertiesValue

      Type Parameters

      • Type

      Parameters

      • propertiesValue: Type

        The actual value; could be null.

      • OptionalconfigFieldName: string

        The field name of the associated value in the static config. Will be returned if the actual value is null.

      • OptionaldefaultValue: Type

        The default fallback value. Will be returned if both the actual and config values are null.

      Returns Type

      Returns the value with some fallback mechanisms on the static config field and a default value.

    • Returns void

    • initialize

      Returns void

      Initializes the element.

    • Parameters

      Returns void

      Update the class's static configurations. Will only overwrite the set properties.

    • Protected

      setupChangedCallbacks

      Returns void

      Setup method intended to initialize change listeners and callbacks.