primait/pyxis-components/9.0.0

NOTE: the latest version is 9.0.3

Prima.Pyxis.Form.FilterableSelect

Configuration

type alias FilterableSelect model =

Represent the opaque FilterableSelect configuration.

type State

The State of the FilterableSelect

type Msg
= FilterableSelectMsg Msg

Represents the Msg of the FilterableSelect.

AutocompleteChoice

Represent the FilterableSelectChoice configuration.

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.

Updates the FilterableSelect's State.

updateChoices : List FilterableSelectChoice -> State -> State

Update the FilterableSelectChoice inside Autocomplete's state

filterableSelectChoice : String -> String -> FilterableSelectChoice

Create the FilterableSelectChoice configuration.

Rendering

render : model -> State -> FilterableSelect 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.

Show the available options for the filterable select.

Hide the available options for the filterable select.

isOpen : State -> Bool

Returns whether the menu is open or not.

Toggle the menu openness.

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.

Changes the threshold value

withIsSubmitted : (model -> Bool) -> FilterableSelect model -> FilterableSelect model

Adds an isSubmitted predicate to the Autocomplete.

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.