primait/pyxis-components/7.1.0

NOTE: the latest version is 9.0.3

Prima.Pyxis.Form.FilterableSelect

Configuration

type alias FilterableSelect model =

Represent the opaque FilterableSelect configuration.

type alias State =
{ autocompleteState : State
, choices : List FilterableSelectChoice
}

The State of the FilterableSelect

type Msg
= FilterableSelectMsg Msg

Represents the Msg of the FilterableSelect.

Configuration Methods

filterableSelect : FilterableSelect model

Creates an select with a filter input.

init : List FilterableSelectChoice -> State

Initializes the FilterableSelect's State.

initWithDefault : String -> String -> List FilterableSelectChoice -> State

Initializes the Autocomplete's State with a default selected value.

update : Msg -> State -> State

Updates the FilterableSelect's State.

filterableSelectChoice : String -> String -> FilterableSelectChoice

Create the FilterableSelectChoice configuration.

Rendering

render : model -> State -> Autocomplete model -> List (Html Msg)

Renders the FilterableSelect.

Methods

selectedValue : State -> Maybe String

Returns the current FilterableSelectChoice.value selected by the user.

filterValue : State -> Maybe String

Returns the current filter inserted by the user.

Needed to wire keyboard events to the FilterableSelect.

open : State -> State

Show the available options for the filterable select.

close : State -> State

Hide the available options for the filterable select.

isOpen : State -> Bool

Returns whether the menu is open or not.

toggle : State -> State

Toggle the menu openness.

reset : State -> State

Reset selected value.

Options

withAttribute : Attribute Msg -> Autocomplete model -> FilterableSelect model

Adds a generic Html.Attribute to the FilterableSelect.

withClass : String -> FilterableSelect model -> FilterableSelect model

Adds a class to the FilterableSelect.

withDefaultValue : Maybe String -> FilterableSelect model -> FilterableSelect model

Adds a default value to the Input. Useful to teach the component about it's pristine/touched state.

withDisabled : Bool -> FilterableSelect model -> FilterableSelect model

Adds a disabled Html.Attribute to the FilterableSelect.

withId : String -> FilterableSelect model -> FilterableSelect model

Adds an id Html.Attribute to the FilterableSelect.

withName : String -> FilterableSelect model -> FilterableSelect model

Adds a name Html.Attribute to the FilterableSelect.

withMediumSize : FilterableSelect model -> FilterableSelect model

Adds a size of Medium to the FilterableSelect.

withSmallSize : FilterableSelect model -> FilterableSelect model

Adds a size of Small to the FilterableSelect.

withLargeSize : FilterableSelect model -> FilterableSelect model

Adds a size of Large to the FilterableSelect.

withPlaceholder : String -> FilterableSelect model -> FilterableSelect model

Adds a placeholder Html.Attribute to the FilterableSelect.

withOverridingClass : String -> FilterableSelect model -> FilterableSelect model

Adds a class to the FilterableSelect which overrides all the previous.

withThreshold : Int -> State -> State

Changes the threshold value

Event Options

withOnBlur : Msg -> FilterableSelect model -> FilterableSelect model

Attaches the onBlur event to the FilterableSelect.

withOnFocus : Msg -> FilterableSelect model -> FilterableSelect model

Attaches the onFocus event to the FilterableSelect.

Validation

(model -> Maybe Type)
-> FilterableSelect model
-> FilterableSelect model

Adds a Validation rule to the FilterableSelect.