primait / pyxis-components / Prima.Pyxis.Form.FilterableSelect

Configuration


type alias FilterableSelect model =
Prima.Pyxis.Form.Autocomplete.Autocomplete model

Represent the opaque FilterableSelect configuration.


type State

The State of the FilterableSelect


type Msg
    = FilterableSelectMsg Prima.Pyxis.Form.Autocomplete.Msg

Represents the Msg of the FilterableSelect.


type alias FilterableSelectChoice =
Prima.Pyxis.Form.Autocomplete.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.

update : Msg -> State -> State

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.

subscription : State -> Platform.Sub.Sub Msg

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 -> Basics.Bool

Returns whether the menu is open or not.

toggle : State -> State

Toggle the menu openness.

reset : State -> State

Reset selected value.

Options

withAttribute : Html.Attribute Prima.Pyxis.Form.Autocomplete.Msg -> Prima.Pyxis.Form.Autocomplete.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 : Basics.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 : Basics.Int -> State -> State

Changes the threshold value

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

Adds an isSubmitted predicate to the Autocomplete.

Event Options

withOnBlur : Prima.Pyxis.Form.Autocomplete.Msg -> FilterableSelect model -> FilterableSelect model

Attaches the onBlur event to the FilterableSelect.

withOnFocus : Prima.Pyxis.Form.Autocomplete.Msg -> FilterableSelect model -> FilterableSelect model

Attaches the onFocus event to the FilterableSelect.

Validation

withValidation : (model -> Maybe Prima.Pyxis.Form.Validation.Type) -> FilterableSelect model -> FilterableSelect model

Adds a Validation rule to the FilterableSelect.