Config

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

Constructors

Link copied to clipboard
constructor(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: (t1: T, t2: T) -> Boolean)

Sets the comparator

Link copied to clipboard

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

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
Link copied to clipboard
fun placeholder(placeholder: HTMLTag.() -> Unit)
fun placeholder(placeholder: String)

Sets the placeholder

Link copied to clipboard

Sets the filter by which the options are filtered

Properties

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard
var compareBy: (t1: T, t2: T) -> Boolean

Defines the method how to check if two elements are equal

Link copied to clipboard
var css: CssBuilder?

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

When true the field is rendered inverted

Link copied to clipboard
var label: LABEL.() -> Unit?

The label renderer of the field

Link copied to clipboard
val onChange: (T) -> Unit
Link copied to clipboard

The options of the select field

Link copied to clipboard
var placeholder: HTMLTag.() -> Unit?

Renderer for a placeholder option

Link copied to clipboard

The validation rules

Link copied to clipboard

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

Link copied to clipboard
var value: T