uncover-co/elm-widgets/2.24.0

NOTE: the latest version is 2.28.0

W.InputInt

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

Value

init : Maybe Int -> Value
toInt : Value -> Maybe Int
toString : Value -> String
type Value

Styles

placeholder : String -> Attribute msg
mask : (String -> String) -> Attribute msg
prefix : List (Html msg) -> Attribute msg
suffix : List (Html msg) -> Attribute msg

States

disabled : Bool -> Attribute msg
readOnly : Bool -> Attribute msg

Validation Attributes

required : Bool -> Attribute msg
min : Int -> Attribute msg
max : Int -> Attribute msg
step : Int -> Attribute msg
validation : (Maybe Int -> String -> Maybe String) -> Attribute msg

View With Validation

List (Attribute msg)
-> { value : Value
, onInput : Result (List Error) (Maybe Int) -> Value -> msg
}
-> Html msg
errorToString : Error -> String
type Error
= TooLow Int String
| TooHigh Int String
| StepMismatch Int String
| ValueMissing String
| Custom String

Actions

onEnter : msg -> Attribute msg
onFocus : msg -> Attribute msg
onBlur : msg -> Attribute msg

Html

htmlAttrs : List (Attribute msg) -> Attribute msg
type Attribute msg