uncover-co / elm-widgets-alpha / W.InputText

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

Types

email : Attribute msg

password : Attribute msg

search : Attribute msg

telephone : Attribute msg

url : Attribute msg

numeric : Attribute msg

decimal : Attribute msg

Styles

placeholder : String -> Attribute msg

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

prefix : List (Html msg) -> Attribute msg

suffix : List (Html msg) -> Attribute msg

States

disabled : Basics.Bool -> Attribute msg

readOnly : Basics.Bool -> Attribute msg

Actions

onEnter : msg -> Attribute msg

onFocus : msg -> Attribute msg

onBlur : msg -> Attribute msg

Validation Attributes

required : Basics.Bool -> Attribute msg

minLength : Basics.Int -> Attribute msg

maxLength : Basics.Int -> Attribute msg

exactLength : Basics.Int -> Attribute msg

pattern : String -> Attribute msg

validation : (String -> Maybe String) -> Attribute msg

View With Validation

viewWithValidation : List (Attribute msg) -> { value : String, onInput : Result (List Error) String -> String -> msg } -> Html msg

errorToString : Error -> String


type Error
    = PatternMismatch String
    | TypeMismatch String
    | TooLong Basics.Int String
    | TooShort Basics.Int String
    | ValueMissing String
    | Custom String

Html

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

noAttr : Attribute msg


type Attribute msg