The arguments for the NumericInput constructor.

interface NumericInputArgs {
    allowNull?: boolean;
    binding?: BindingBase;
    blurOnEnter?: boolean;
    blurOnEscape?: boolean;
    class?: string | string[];
    dom?: string | HTMLElement;
    enabled?: boolean;
    error?: boolean;
    height?: number;
    hidden?: boolean;
    hideSlider?: boolean;
    id?: string;
    ignoreParent?: boolean;
    input?: HTMLInputElement;
    isRoot?: boolean;
    keyChange?: boolean;
    link?: {
        observer: Observer | Observer[];
        path: string | string[];
    };
    max?: number;
    min?: number;
    onChange?: ((value: any) => void);
    onClick?: (() => void);
    onRemove?: (() => void);
    parent?: Element;
    placeholder?: string;
    precision?: number;
    readOnly?: boolean;
    renderChanges?: boolean;
    step?: number;
    stepPrecision?: number;
    style?: string;
    tabIndex?: number;
    value?: any;
    values?: any[];
    width?: number;
}

Hierarchy (view full)

Properties

allowNull?: boolean

Sets whether the value can be null. If not then it will be 0 instead of null.

binding?: BindingBase

A binding to use with this Element.

blurOnEnter?: boolean

Sets whether pressing Enter will blur (unfocus) the field. Defaults to true.

blurOnEscape?: boolean

Sets whether pressing Escape will blur (unfocus) the field. Defaults to true.

class?: string | string[]

The class attribute of this Element's HTMLElement.

dom?: string | HTMLElement

The HTMLElement to create this Element with. If not provided this Element will create one.

enabled?: boolean

Sets whether it is possible to interact with this Element and its children.

error?: boolean

Sets whether the Element is in an error state.

height?: number

Sets the initial height of the Element.

hidden?: boolean

Sets whether this Element is hidden. Defaults to false.

hideSlider?: boolean

Hide the input mouse drag slider.

id?: string

The id attribute of this Element's HTMLElement.

ignoreParent?: boolean

If true, this Element will ignore its parent's enabled value when determining whether this element is enabled. Defaults to false.

The input element to associate this InputElement with. If not supplied one will be created instead.

isRoot?: boolean

Sets whether this Element is at the root of the hierarchy.

keyChange?: boolean

Sets whether any key up event will cause a change event to be fired.

link?: {
    observer: Observer | Observer[];
    path: string | string[];
}

Links the observer attribute at the path location in the given observer to this Element.

max?: number

Sets the maximum value this field can take.

min?: number

Sets the minimum value this field can take.

onChange?: ((value: any) => void)

If provided and the Element is changeable, this function will be called each time the element value is changed.

onClick?: (() => void)

If provided and the Element is clickable, this function will be called each time the element is clicked.

onRemove?: (() => void)

If provided and the Element is removable, this function will be called each time the element is removed.

parent?: Element

Sets the parent Element.

placeholder?: string

Sets the placeholder label that appears on the right of the input.

precision?: number

Sets the decimal precision of this field. Defaults to 2.

readOnly?: boolean

Whether this Element is read only or not. Defaults to false.

renderChanges?: boolean

If true each input will flash on changes.

step?: number

Sets the amount that the value will be increased or decreased when using the arrow keys and the slider input.

stepPrecision?: number

Sets the amount that the value will be increased or decreased when holding shift using the arrow keys and the slider input. Defaults to NumericInput#step * 0.1.

style?: string

Sets an initial value for Element.dom.style.

tabIndex?: number

Sets the tabIndex of the Element.

value?: any

Sets the value of the Element.

values?: any[]

Sets multiple values to the Element. It is up to the Element to determine how to display them.

width?: number

Sets the initial width of the Element.