lucamug/style-framework/1.0.0

NOTE: the latest version is 1.1.0

Framework.FormField

Demo

Fields

Input fields

List (Attribute msg)
-> { field : field
, fieldValue : String
, helperText : Maybe (Element msg)
, inputType :
List (Attribute msg)
-> { label : Label msg
, onChange : String -> msg
, placeholder : Maybe (Placeholder msg)
, text : String
}
-> Element msg
, inputTypeAttrs : List (Attribute msg)
, label : Element msg
, maybeFieldFocused : Maybe field
, maybeMsgOnEnter : Maybe (field -> msg)
, msgOnChange : field -> String -> msg
, msgOnFocus : field -> msg
, msgOnLoseFocus : field -> msg
}
-> Element msg
List (Attribute msg)
-> { field : field
, fieldValue : String
, helperText : Maybe (Element msg)
, inputType :
List (Attribute msg)
-> { label : Label msg
, onChange : String -> msg
, placeholder : Maybe (Placeholder msg)
, text : String
, show : Bool
}
-> Element msg
, inputTypeAttrs : List (Attribute msg)
, label : Element msg
, maybeFieldFocused : Maybe field
, maybeMsgOnEnter : Maybe (field -> msg)
, msgOnChange : field -> String -> msg
, msgOnFocus : field -> msg
, msgOnLoseFocus : field -> msg
, show : Bool
, maybeShowHidePassword :
Maybe
{ maybeHideIcon : Maybe (Element msg)
, maybeShowIcon : Maybe (Element msg)
, msgOnViewToggle : field -> msg
}
}
-> Element msg

Introspection

Used internally to generate the Style Guide

{ name : String
, description : String
, signature : String
, variations : List ( String, List ( Element msg1, String ) )
}
example5 : Model -> ( Element Msg, String )
example6 : Model -> ( Element Msg, String )
example7 : Model -> ( Element Msg, String )
example8 : Model -> ( Element Msg, String )
example9 : Model -> ( Element Msg, String )
type Field
= FieldEmail
| FieldText
| FieldUsername
| FieldNewPassword
| FieldCurrentPassword
type alias Model =
{ valueText : String
, valueEmail : String
, valueUsername : String
, valueNewPassword : String
, valueNewPasswordShow : Bool
, valueCurrentPassword : String
, valueCurrentPasswordShow : Bool
, focusedField : Maybe Field
, enteredField : Maybe Field
}
type Msg
= OnChange Field String
| OnFocus Field
| OnLoseFocus Field
| OnEnter Field
| OnViewToggle Field
initModel : Model
update : Msg -> Model -> ( Model, Cmd Msg )