Orasund/elm-ui-widgets/1.0.0

NOTE: the latest version is 3.4.0

Widget.FilterSelect

type alias Model =
{ raw : String
, selected : Maybe String
, options : Set String
}

The Model containing the raw value, the selected value and all the possible options.

type Msg
= ChangedRaw String
| Selected (Maybe String)

The Msg is exposed by design. You can unselect by sending Selected Nothing.

init : Set String -> Model

The initial state contains the set of possible options.

update : Msg -> Model -> Model

Updates the Model

List (Attribute msg)
-> Model
-> { msgMapper : Msg -> msg
, placeholder : Maybe (Placeholder msg)
, label : String
}
-> Element msg

A wrapper around Input.text.

viewOptions : Model -> List String

Returns a List of all options that matches the filter.