FormBuildContext

Functions

Link copied to clipboard
operator fun <A> invoke(a: Form.Field<A>, onInvalid: () -> Unit, onReady: (A) -> Unit): Form.Companion.FormDefinition

Defines a Form with a single Field.

operator fun <A, B> invoke(a: Form.Field<A>, b: Form.Field<B>, onInvalid: () -> Unit, onReady: (A, B) -> Unit): Form.Companion.FormDefinition

Defines a Form with a 2 Fields.

operator fun invoke(first: Form.Field<*>, second: Form.Field<*>, vararg rest: Form.Field<*>, onInvalid: () -> Unit, onReady: (List<*>) -> Unit): Form.Companion.FormDefinition

Defines a Form with at least 2 Fields. The values provided to onReady, though untyped, are in the definition order within invoke. This allows the consumer to cast them to the expected types.

operator fun <A, B, C> invoke(a: Form.Field<A>, b: Form.Field<B>, c: Form.Field<C>, onInvalid: () -> Unit, onReady: (A, B, C) -> Unit): Form.Companion.FormDefinition

Defines a Form with a 3 Fields.

operator fun <A, B, C, D> invoke(a: Form.Field<A>, b: Form.Field<B>, c: Form.Field<C>, d: Form.Field<D>, onInvalid: () -> Unit = { }, onReady: (A, B, C, D) -> Unit = { _,_,_,_ -> }): Form.Companion.FormDefinition

Defines a Form with a 4 Fields.

operator fun <A, B, C, D, E> invoke(a: Form.Field<A>, b: Form.Field<B>, c: Form.Field<C>, d: Form.Field<D>, e: Form.Field<E>, onInvalid: () -> Unit, onReady: (A, B, C, D, E) -> Unit): Form.Companion.FormDefinition

Defines a Form with a 5 Fields.

Link copied to clipboard
infix fun <T> T.to(visualizer: FieldVisualizer<T>): Form.Field<T>

DSL for binding an arbitrary value to a FieldVisualizer to create a Field with an initial state of Valid(this) within a Form.

infix fun <T> Form.FieldState<T>.to(visualizer: FieldVisualizer<T>): Form.Field<T>

DSL for binding a FieldState to a FieldVisualizer to create a Field with an initial state equal to the given FieldState within a Form.

Link copied to clipboard
operator fun <T> FieldVisualizer<T>.unaryPlus(): Form.Field<T>

DSL for adding a Field with an initial value of Invalid to a Form. The FieldVisualizer can put the created field into a Valid state; so there is no guarantee that the created field is actually invalid.