Package-level declarations
Contains a simple select component as well as full-featured components with support for remote data sources.
Types
Link copied to clipboard
open class TomSelect(options: List<StringPair>? = null, value: String? = null, emptyOption: Boolean = false, multiple: Boolean = false, maxOptions: Int? = null, tsOptions: TomSelectOptions? = null, tsCallbacks: TomSelectCallbacks? = null, tsRenders: TomSelectRenders? = null, label: String? = null, rich: Boolean = false, init: TomSelect.() -> Unit? = null) : SimplePanel, StringFormControl, MutableState<String?>
The form field component for Tom Select control.
Link copied to clipboard
data class TomSelectCallbacks(val load: (query: String, callback: (Array<Any?>) -> Unit) -> Unit? = null, val shouldLoad: (query: String) -> Boolean? = null, val score: (search: String) -> (Any?) -> Int? = null, val onInitialize: () -> Unit? = null, val onFocus: () -> Unit? = null, val onBlur: () -> Unit? = null, val onChange: (value: Any?) -> Unit? = null, val onItemAdd: (value: Any?, item: Any?) -> Unit? = null, val onItemRemove: (value: Any?) -> Unit? = null, val onClear: () -> Unit? = null, val onDelete: (value: Any?, event: Any?) -> Unit? = null, val onOptionAdd: (value: Any?, data: Any?) -> Unit? = null, val onOptionRemove: (value: Any?) -> Unit? = null, val onDropdownOpen: (dropdown: Any?) -> Unit? = null, val onDropdownClose: (dropdown: Any?) -> Unit? = null, val onType: (str: String) -> Unit? = null, val onLoad: (options: Any?, optgroup: Any?) -> Unit? = null)
Link copied to clipboard
open class TomSelectInput(options: List<StringPair>? = null, value: String? = null, emptyOption: Boolean = false, multiple: Boolean = false, maxOptions: Int? = null, tsOptions: TomSelectOptions? = null, tsCallbacks: TomSelectCallbacks? = null, tsRenders: TomSelectRenders? = null, className: String? = null, init: TomSelectInput.() -> Unit? = null) : SimplePanel, GenericFormComponent<String?> , FormInput, MutableState<String?>
The basic component for a select control based on Tom Select.
Link copied to clipboard
data class TomSelectOptions(val create: Boolean? = null, val createFun: (input: String, callback: (StringPair) -> Unit) -> Unit? = null, val createOnBlur: Boolean? = null, val createFilter: String? = null, val highlight: Boolean? = null, val persist: Boolean? = null, val openOnFocus: Boolean? = null, val maxItems: Int? = null, val hideSelected: Boolean? = null, val closeAfterSelect: Boolean? = null, val loadThrottle: Int? = 300, val loadingClass: String? = null, val hidePlaceholder: Boolean? = null, val preload: Boolean? = null, val preloadOnFocus: Boolean? = null, val addPrecedence: Boolean? = null, val selectOnTab: Boolean? = null, val duplicates: Boolean? = null, val controlInput: dynamic = null, val hideControlInput: Boolean? = null, val caretPosition: Boolean? = null, val checkboxOptions: Boolean? = null, val clearButtonTitle: String? = null, val dropdownHeaderTitle: String? = null, val dropdownInput: Boolean? = null, val inputAutogrow: Boolean? = null, val noActiveItems: Boolean? = null, val noBackspaceDelete: Boolean? = null, val removeButtonTitle: String? = null, val restoreOnBackspace: Boolean? = null, val options: List<dynamic>? = null, val dataAttr: String? = null, val valueField: String? = null, val labelField: String? = null, val disabledField: String? = null, val sortField: String? = null, val searchField: List<String>? = null, val searchConjunction: String? = null)
Link copied to clipboard
data class TomSelectRenders(val option: (data: Any?, escape: (String) -> String) -> String? = null, val item: (data: Any?, escape: (String) -> String) -> String? = null, val optionCreate: (data: Any?, escape: (String) -> String) -> String? = null, val noResults: (data: Any?, escape: (String) -> String) -> String? = null, val notLoading: (data: Any?, escape: (String) -> String) -> String? = null, val optGroup: (data: Any?) -> String? = null, val optGroupHeader: (data: Any?, escape: (String) -> String) -> String? = null, val loading: (data: Any?, escape: (String) -> String) -> String? = null, val dropdown: () -> String? = null)
Functions
Link copied to clipboard
Link copied to clipboard
fun Container.tomSelect(options: List<StringPair>? = null, value: String? = null, emptyOption: Boolean = false, multiple: Boolean = false, maxOptions: Int? = null, tsOptions: TomSelectOptions? = null, tsCallbacks: TomSelectCallbacks? = null, tsRenders: TomSelectRenders? = null, label: String? = null, rich: Boolean = false, init: TomSelect.() -> Unit? = null): TomSelect
DSL builder extension function.
Link copied to clipboard
fun Container.tomSelectInput(options: List<StringPair>? = null, value: String? = null, emptyOption: Boolean = false, multiple: Boolean = false, maxOptions: Int? = null, tsOptions: TomSelectOptions? = null, tsCallbacks: TomSelectCallbacks? = null, tsRenders: TomSelectRenders? = null, className: String? = null, init: TomSelectInput.() -> Unit? = null): TomSelectInput
DSL builder extension function.