Config

class Config<T>(var value: T, val onChange: (T) -> Unit)

Constructors

Link copied to clipboard
fun <T> Config(value: T, onChange: (T) -> Unit)

Functions

Link copied to clipboard
fun accepts(rule: Rule<T>, vararg rules: Rule<T>)

Adds a validation rule

Link copied to clipboard
fun autoSuggest(suggest: AutoSuggestFn<T>)

Sets the callback that provides auto-suggest options

Link copied to clipboard
fun compareBy(compare: (T, T) -> Boolean)

Sets the comparator

Link copied to clipboard
fun compareByClass()

Compares two items by their class

Link copied to clipboard
fun css(block: CssBuilder.() -> Unit)

Sets the css the select field

Link copied to clipboard
fun inverted(inverted: Boolean = true)

Sets the style to be inverted or not.

Link copied to clipboard
fun label(rendered: LABEL.() -> Unit): SelectFieldComponent.Config<T>

Sets the label as a render function

fun label(labelStr: String): SelectFieldComponent.Config<T>

Sets the label

Link copied to clipboard
fun option(realValue: T, display: FlowContent.() -> Unit)
fun option(realValue: T, formValue: String)
fun option(    realValue: T,     formValue: String,     display: FlowContent.() -> Unit)
fun option(    realValue: T,     formValue: String,     display: String)

Adds an option

Link copied to clipboard
fun placeholder(placeholder: HTMLTag.() -> Unit)
fun placeholder(placeholder: String)

Sets the placeholder

Link copied to clipboard
fun searchableBy(filter: OptionFilterFn<T>)

Sets the filter by which the options are filtered

Properties

Link copied to clipboard
val asProps: SelectFieldComponent.Props<T>
Link copied to clipboard
val autoSuggest: AutoSuggestFn<T>? = null

When set, the field will be rendered as a searchable auto-suggest field

Link copied to clipboard
val compareBy: (T, T) -> Boolean

Defines the method how to check if two elements are equal

Link copied to clipboard
val css: CssBuilder? = null

The css set for the select field

Link copied to clipboard
val fromStr: (str: String) -> T

Converts a string back to the real value of an option

Link copied to clipboard
val inverted: Boolean = false

When true the field is rendered inverted

Link copied to clipboard
val label: LABEL.() -> Unit? = null

The label renderer of the field

Link copied to clipboard
val onChange: (T) -> Unit
Link copied to clipboard
val options: MutableList<SelectFieldComponent.Option<T>>

The options of the select field

Link copied to clipboard
val placeholder: HTMLTag.() -> Unit? = null

Renderer for a placeholder option

Link copied to clipboard
val rules: MutableList<Rule<T>>

The validation rules

Link copied to clipboard
val searchableBy: OptionFilterFn<T>? = null

When set, the field will be rendered as a searchable field

Link copied to clipboard
var value: T

Extensions

Link copied to clipboard
fun SelectFieldComponent.Config<String>.option(realValue: String)