A select component for multi selection with remote data.
Opaque type representing cases to be passed to SmartSelect.update
Instantiates and returns a smart select.
The smart select view for selecting multiple options at a time with remote data. It expects the following arguments (in order):
Events external to the smart select to which it is subscribed.
Update the provided smart select and receive the updated select instance and a cmd to run.
The type facilitating the configuration of the smart select.
internalMsg field takes a function that expects a SmartSelect.Msg and returns an externally defined msg.optionType is a string that indicates what kind of data is being selected, i.e. "Product" or "Client"optionLabelFn expects an instance of the data being selected from and returns a string naming/labeling the instance, i.e. if it is a "Product" being selected, the label may be "Garden Hose"optionDescriptionFn expects an instance of the data being selected from and returns a string describing the instance, i.e. if the label is "Garden Hose", the description may be "30 ft"optionsContainerMaxHeight field specifies the height of the container of the selectable options. This field helps facilitate scroll functionality.searchFn field expects an instance of RemoteSearchAttrs, seen below. This type helps facilitate the remote request for data.debounceDuration indicates how long if at all to wait between the last keypress and executing a search. This is particularly useful if the search being executed is pinging an external source.spinnerColor indicates the color that the loading spinner should be.characterThreshold indicates how many if any characters should be typed before a search is executed.closeOnSelect indicates whether or not the SmartSelect should close itself after a selection has been made.type alias RemoteSearchAttrs a =
{ headers : List Header
, url : String -> String
, optionDecoder : Decoder a
}Get the currently selected entities if any.
It is possible that the select is instantiated on your model before data representing a previous selection is loaded. Use this function to update the picked selection in the select when the appropriate data is received. Use this method sparingly, if at all. The selected state should ideally only change due to user input.
The opaque type representing a particular smart select instance.