NumInput Component Reference

Table of Contents


Introduction

Syntax

tml`<NumInput .../>`

The NumInput component creates renders a numeric input. It is a separate component used by the Numeric Input state variable so that it can be reused by other components.

The numeric limits and format is set by the fmt attribute. See NumFmt Reference.

The NumInput component has several methods that can be used to allow parent components to dynamically manipulate the state of the rendered elements. See [Instance methods](#instance methods).

Numeric Input types

The input may be rendered in several forms depending on the inputType attribute. The inputType attribute may take on the following values:

Plus-Minus layout

The rendered component also depends on the plusMinus, verticaland title attributes. If the plusMinus attribute is present and truthy, the input, as specified by the inputType attribute, is surrounded by a '-' button and a '+' button. These buttons will decrement or increment the input according to the rndMult property of the NumFmt specified in the fmt attribute. If the vertical attribute is present and truthy, the buttons appear above and below the input. Lastly, the title attribute specifies a title to appear above the plusMinus input.

Attributes


Instance methods

These methods are intended to be used by parent components to dynamically change the properties of the rendered components without re-rendering.

Inherited methods


getValue()

Syntax

getValue()

Returns the current value of the rendered element.

Return value

A Number.


setDisabled()

Syntax

setDisabled(b)

Sets the rendered element's disabled property to b.

Parameters


setFmt()

Syntax

setFmt(fmt)

Sets the rendered element's min, max, and step from the fmt instance.

Parameters


setValue()

Syntax

setValue(value)

Sets the rendered element's value.

Parameters


Children

The NumInput component ignores all children.


DOM element properties

The NumInput is rendered in several different ways: