Represent the opaque Autocomplete
configuration.
The State
of the Autocomplete
Represents the Msg of the Autocomplete
.
{ value : String
, label : String
}
Represent the AutocompleteChoice
configuration.
autocomplete : Autocomplete model
Creates an autocomplete.
init : State
Initializes the Autocomplete
's State
.
initWithDefault : String -> String -> State
Initializes the Autocomplete
's State
with a default selected value.
update : Msg -> State -> ( State, Platform.Cmd.Cmd Msg, Maybe String )
Updates the Autocomplete
's State
.
autocompleteChoice : String -> String -> AutocompleteChoice
Create the AutocompleteChoice configuration.
updateChoices : List AutocompleteChoice -> State -> State
Update the AutocompleteChoice
render : model -> State -> Autocomplete model -> List (Html Msg)
Renders the Autocomplete
.
selectedValue : State -> Maybe String
Returns the current AutocompleteChoice.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 Autocomplete
.
open : State -> State
Show the available options for the autocomplete.
close : State -> State
Hide the available options for the autocomplete.
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.
withAttribute : Html.Attribute Msg -> Autocomplete model -> Autocomplete model
Adds a generic Html.Attribute to the Autocomplete
.
withClass : String -> Autocomplete model -> Autocomplete model
Adds a class
to the Autocomplete
.
withDebouncer : Basics.Float -> State -> State
Set the seconds for the debounce.
withDefaultValue : Maybe String -> Autocomplete model -> Autocomplete model
Adds a default value to the Input
.
Useful to teach the component about it's pristine/touched
state.
withDisabled : Basics.Bool -> Autocomplete model -> Autocomplete model
Adds a disabled
Html.Attribute to the Autocomplete
.
withId : String -> Autocomplete model -> Autocomplete model
Adds an id
Html.Attribute to the Autocomplete
.
withLargeSize : Autocomplete model -> Autocomplete model
Adds a size
of Large
to the Autocomplete
.
withMediumSize : Autocomplete model -> Autocomplete model
Adds a size
of Medium
to the Autocomplete
.
withName : String -> Autocomplete model -> Autocomplete model
Adds a name
Html.Attribute to the Autocomplete
.
withOverridingClass : String -> Autocomplete model -> Autocomplete model
Adds a class
to the Autocomplete
which overrides all the previous.
withPlaceholder : String -> Autocomplete model -> Autocomplete model
Adds a placeholder
Html.Attribute to the Autocomplete
.
withSmallSize : Autocomplete model -> Autocomplete model
Adds a size
of Small
to the Autocomplete
.
withThreshold : Basics.Int -> State -> State
Set the threshold for the filter application.
withIsSubmitted : (model -> Basics.Bool) -> Autocomplete model -> Autocomplete model
Adds an isSubmitted
predicate to the Autocomplete
.
withOnBlur : Msg -> Autocomplete model -> Autocomplete model
Attaches the onBlur
event to the Autocomplete
.
withOnFocus : Msg -> Autocomplete model -> Autocomplete model
Attaches the onFocus
event to the Autocomplete
.
withValidation : (model -> Maybe Prima.Pyxis.Form.Validation.Type) -> Autocomplete model -> Autocomplete model
Adds a Validation
rule to the Autocomplete
.