abadi199/elm-input-extra/3.0.0

NOTE: this package is not compatible with Elm 0.19.1

Input.Number

Number input

View

input : Options msg -> List (Attribute msg) -> Maybe Int -> Html msg

(TEA) View function

Example:

Input.Number.input
    { id = "NumberInput"
    , maxLength = Just 4
    , maxValue = Nothing
    , minValue = Nothing
    }
    [ class "numberInput"
    ...
    ]
    model.numberModel
type alias Options msg =
{ maxLength : Maybe Int
, maxValue : Maybe Int
, minValue : Maybe Int
, onInput : Maybe Int -> msg
, hasFocus : Maybe (Bool -> msg)
}

Options 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.

defaultOptions : (Maybe Int -> msg) -> Options msg

Default value for Options. Params: * id (type: String) : The id of the number input element.

Value:

{ id = id
, maxLength = Nothing
, maxValue = Nothing
, minValue = Nothing
}