Number input
(TEA) Initial model constant
Value:
{ value = ""
, hasFocus = False
}(TEA) View function
Example:
Input.Number.input
{ id = "NumberInput"
, maxLength = Just 4
, maxValue = Nothing
, minValue = Nothing
}
[ class "numberInput"
...
]
model.numberModelOptions of the input component.
* id is the id of the HTML element.
* maxLength is the maximum number of character allowed in this input. Set to Nothing for no limit.
* maxValue is the maximum number value allowed in this input. Set to Nothing for no limit.
* minValue is the minimum number value allowed in this input. Set to Nothing for no limit.
Default value for Options.
Params:
* id (type: String) : The id of the number input element.
Value:
{ id = id
, maxLength = Nothing
, maxValue = Nothing
, minValue = Nothing
}(TEA) Update function
Example:
type Msg = UpdateNumber Input.Number.Msg
update msg model =
case msg of
UpdateNumber numberMsg ->
{ model | numberModel = Input.Number.update numberMsg model.numberModel }(TEA) Opaque Msg types
(TEA) Model record Fields: *
value: current value of the input element. *hasFocus: flag whether the input element has focus or not.