Constructors

Link copied to clipboard
constructor(ctx: Ctx<P>)

Types

Link copied to clipboard
Link copied to clipboard
data class Props<X>(val value: X, val onChange: (X) -> Unit, val options: UiCheckBoxComponent.Options<X>, val on: X, val off: X) : GenericFormField.Props<X, UiCheckBoxComponent.Options<X>>

Functions

Link copied to clipboard
Link copied to clipboard
fun <T, C> Component<C>.dataLoader(load: suspend () -> Flow<T>): DataLoader<T>
Link copied to clipboard
fun focus(cssSelector: String)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
operator fun <T> Stream<T>.invoke(handler: (T) -> Unit): () -> Unit

Subscribes to a Stream.

Link copied to clipboard
inline fun <M : Message<*>> Component<*>.onMessage(noinline handler: (M) -> Unit)

Listens for a Message of the given type M.

Link copied to clipboard
fun <C> Component<C>.pagedSearchFilter(router: Router, onChange: (PagedSearchFilter) -> Unit? = null): ReadWriteProperty<Component<C>, PagedSearchFilter>
Link copied to clipboard
open override fun VDom.render()

Every component needs to implement this method

Link copied to clipboard
fun <P> FormField<P>.renderErrors(flow: FlowContent)
Link copied to clipboard
fun FlowContent.renderLabel(onClick: (evt: MouseEvent) -> Unit? = null)
fun FlowContent.renderLabel(focusCssSelector: String? = null)
Link copied to clipboard
open override fun reset()

Resets the form field.

Link copied to clipboard
fun <M : Message<*>> Component<*>.sendMessage(message: M)

Send the given message.

Link copied to clipboard
fun setValue(value: T)
Link copied to clipboard
open override fun shouldRedraw(nextProps: P): Boolean

Returns 'true' when the component should redraw.

Link copied to clipboard
fun <T> stream(initial: T, config: Stream<T>.() -> Stream<T>? = null, handler: (T) -> Unit = {}): ComponentStreamProperty<T>

Creates a property that is backed by a StreamSource

Link copied to clipboard
fun <T> subscribingTo(stream: Stream<T>, onNext: (T) -> Unit? = null): ReadOnlyProperty<Any?, T>

Creates a property that is subscribed to a stream.

Link copied to clipboard
open override fun touch()

Marks the form field as touched.

Link copied to clipboard

Triggers a redraw

Link copied to clipboard
open override fun untouch()

Marks the form field as not touched.

Link copied to clipboard
fun <C> Component<C>.urlParam(router: Router, name: String, default: Int, onChange: (Int) -> Unit? = null): ReadWriteProperty<Component<C>, Int>
fun <C> Component<C>.urlParam(router: Router, name: String, default: String, onChange: (String) -> Unit? = null): ReadWriteProperty<Component<C>, String>
Link copied to clipboard
fun <C, T> Component<C>.urlParams(router: Router, fromParams: (Map<String, String>) -> T, toParams: (T) -> Map<String, Any?>, onChange: (T) -> Unit? = null): ReadWriteProperty<Component<C>, T>
Link copied to clipboard
open override fun validate(): Boolean

Validates all rules and returns true if all rules are fulfilled.

Link copied to clipboard
fun <T> value(initial: T, onChange: (T) -> Unit? = null): ComponentStateProperty<T>

Creates a read write property for the components state.

Properties

Link copied to clipboard
val attributes: MutableTypedAttributes

The attributes of the component

Link copied to clipboard

An automatically generated unique dom key for the component instance.

Link copied to clipboard
val ctx: Ctx<P>
Link copied to clipboard

The effective value

Link copied to clipboard

The Dom node to which the component is rendered

Link copied to clipboard
open override var errors: List<String>

A list of validation errors.

Link copied to clipboard
open val hasErrors: Boolean

Returns true when the field has errors

Link copied to clipboard

The life-cycle LifeCycle that the component exposes

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val parent: Component<*>?

Accessor for the parent component

Link copied to clipboard
val props: P

Public getter for the Props

Link copied to clipboard
open override var touched: Boolean

Track if the input value was modified.