uncover-co / elm-widgets / W.InputFloat

view : List (Attribute msg) -> { value : Value, onInput : Value -> msg } -> Html msg

Value

init : Maybe Basics.Float -> Value

toFloat : Value -> Maybe Basics.Float

toString : Value -> String


type Value

Styles

small : Attribute msg

placeholder : String -> Attribute msg

mask : (String -> String) -> Attribute msg

prefix : List (Html msg) -> Attribute msg

suffix : List (Html msg) -> Attribute msg

States

autofocus : Attribute msg

disabled : Basics.Bool -> Attribute msg

readOnly : Basics.Bool -> Attribute msg

Validation Attributes

required : Basics.Bool -> Attribute msg

min : Basics.Float -> Attribute msg

max : Basics.Float -> Attribute msg

step : Basics.Float -> Attribute msg

validation : (Maybe Basics.Float -> String -> Maybe String) -> Attribute msg

View With Validation

viewWithValidation : List (Attribute msg) -> { value : Value, onInput : Result (List Error) (Maybe Basics.Float) -> Value -> msg } -> Html msg

errorToString : Error -> String


type Error
    = TooLow Basics.Float String
    | TooHigh Basics.Float String
    | TooLong Basics.Int String
    | TooShort Basics.Int String
    | StepMismatch Basics.Float String
    | ValueMissing String
    | Custom String

Actions

onEnter : msg -> Attribute msg

onFocus : msg -> Attribute msg

onBlur : msg -> Attribute msg

Html

htmlAttrs : List (Html.Attribute msg) -> Attribute msg

noAttr : Attribute msg


type Attribute msg