Config

class Config<T>(    var value: T,     var type: InputType,     val onChange: (T) -> Unit,     val toStr: (T) -> String,     val fromStr: (String) -> T)

Constructors

Link copied to clipboard
fun <T> Config(    value: T,     type: InputType,     onChange: (T) -> Unit,     toStr: (T) -> String,     fromStr: (String) -> T)

Functions

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

Adds a validation rule

Link copied to clipboard
fun appear(appearance: SemanticTag.() -> SemanticTag): InputFieldComponent.Config<T>

Sets the appearance of the input field

Link copied to clipboard
fun label(rendered: LABEL.() -> Unit)

Sets the label as a render function

fun label(label: String)

Sets the label

Link copied to clipboard
fun placeholder(placeholder: String)

Sets the Placeholder

Link copied to clipboard
fun rightIcon(block: DIV.(field: InputFieldComponent<T>) -> Unit)

Sets the callback for rendering an icon on the right side of the input field

Link copied to clipboard
fun step(step: Double)
fun step(step: Int)

Sets the step size for numeric fields

Properties

Link copied to clipboard
val appearance: SemanticTag.() -> SemanticTag

The appearance of the input field

Link copied to clipboard
val asProps: InputFieldComponent.Props<T>
Link copied to clipboard
val fromStr: (String) -> T
Link copied to clipboard
val label: LABEL.() -> Unit?

The label renderer of the field

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

The placeholder of the field

Link copied to clipboard
val rightIcon: DIV.(field: InputFieldComponent<T>) -> Unit?

Callback for rendering an icon on the right side of the input field

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

The validation rules

Link copied to clipboard
val step: Number?

The step size in case of a numeric field

Link copied to clipboard
val toStr: (T) -> String
Link copied to clipboard
var type: InputType
Link copied to clipboard
var value: T