yoghurt-x86 / easy-forms / Form.SimpleFields

This modules defines the implementaiton of a number of different fields.

This particular form package is compatible with [elm/html]

Fields:

textField : TextFieldConfig -> String -> TextField form ctx

Regular textfield!


type TextType
    = Text
    | TextArea
    | Password
    | Email
    | Search

What type of input for textfields

checkBox : Basics.Bool -> CheckField form ctx

Checkbox field Simple checkbox to get a boolean

rangeField : RangeFieldConfig -> Basics.Float -> RangeField form ctx

Range slider

dateField : Maybe Date -> DateField form ctx

Browser Datefield

colorField : Color -> ColorField form ctx

Color field

fileField : FileFieldConfig -> Maybe File -> FileField form ctx

File field

selectField : List a -> SelectFieldConfig a -> a -> SelectField form ctx ctx a

Dropdown selection field This field will always have a value selected.

selectMaybeField : List a -> SelectFieldConfig a -> Maybe a -> SelectField form ctx ctx (Maybe a)

Dropdown selection field This resolves into a maybe type, so it's possible to select "Nothing"

selectContextualField : (ctx -> List a) -> SelectFieldConfig a -> a -> SelectField form ctx (List a) a

Dropdown selection field This field uses a context to get a list of possible selection item from outside the form.

Input types:


type alias TextFieldConfig =
{ textType : TextType }

Parameters for textField


type alias CheckFieldConfig =
{}

Parameters for checkbox field


type alias RangeFieldConfig =
{ min : Basics.Float
, max : Basics.Float
, step : Basics.Float 
}

Parameters for rangefield


type alias DateFieldConfig =
{}

Parameters for datefield


type alias ColorFieldConfig =
{}

Parameters for Colorfield


type alias FileFieldConfig =
{ accept : List String }

Parameters for file field


type alias SelectFieldConfig a =
{ display : a -> String
, key : a -> String 
}

Parameters for selectFields