Package io.kvision.form

Convenient forms implementation, with support for many different input components and easy to define validation.

Types

BoolFormControl
Link copied to clipboard
js
interface BoolFormControl : GenericNonNullableFormControl<Boolean>
Base interface of a form control with a boolean value.
DateFormControl
Link copied to clipboard
js
interface DateFormControl : GenericFormControl<<ERROR CLASS>>
Base interface of a form control with a date value.
FieldLabel
Link copied to clipboard
js
open class FieldLabel(forId: String, content: String?, rich: Boolean, classes: Set<String>, init: FieldLabel.() -> Unit?) : Tag
Helper class for HTML label element.
Form
Link copied to clipboard
js
class Form<K : Any>(panel: FormPanel<K>?, serializer: <ERROR CLASS><K>?, customSerializers: Map<KClass<*>, <ERROR CLASS><out <ERROR CLASS>>>?)
The form definition class.
FormControl
Link copied to clipboard
js
interface FormControl : Component
Base interface of a form control.
FormEnctype
Link copied to clipboard
js
enum FormEnctype : Enum<FormEnctype>
Form encoding types.
FormHorizontalRatio
Link copied to clipboard
js
enum FormHorizontalRatio : Enum<FormHorizontalRatio>
Proportions for horizontal form layout.
FormInput
Link copied to clipboard
js
interface FormInput : Component
FormMethod
Link copied to clipboard
js
enum FormMethod : Enum<FormMethod> , DomAttribute
Form methods.
FormPanel
Link copied to clipboard
js
open class FormPanel<K : Any>(method: FormMethod?, action: String?, enctype: FormEnctype?, type: FormType?, condensed: Boolean, horizRatio: FormHorizontalRatio, classes: Set<String>, serializer: <ERROR CLASS><K>?, customSerializers: Map<KClass<*>, <ERROR CLASS><out <ERROR CLASS>>>?) : SimplePanel
Bootstrap form component.
FormTarget
Link copied to clipboard
js
enum FormTarget : Enum<FormTarget> , DomAttribute
Form targets.
FormType
Link copied to clipboard
js
enum FormType : Enum<FormType>
Bootstrap form layout options.
GenericFormComponent
Link copied to clipboard
js
interface GenericFormComponent<T> : Component
Base interface of a form component with a generic value.
GenericFormControl
Link copied to clipboard
js
interface GenericFormControl<T> : FormControl, GenericFormComponent<T?>
Base interface of a form control with a generic value.
GenericNonNullableFormControl
Link copied to clipboard
js
interface GenericNonNullableFormControl<T> : FormControl, GenericFormComponent<T>
Base interface of a form control with a generic, non-nullable value.
HelpText
Link copied to clipboard
js
open class HelpText(content: String?, rich: Boolean) : Tag
Helper class for Bootstrap help text element.
InputSize
Link copied to clipboard
js
enum InputSize : Enum<InputSize> , CssClass
Input controls sizes.
InvalidFeedback
Link copied to clipboard
js
open class InvalidFeedback(content: String?, rich: Boolean) : Tag
Helper class for Bootstrap invalid feedback element.
KFilesFormControl
Link copied to clipboard
js
interface KFilesFormControl : GenericFormControl<List<<ERROR CLASS>>>
Base interface of a form control with a list of files value.
NumberFormControl
Link copied to clipboard
js
interface NumberFormControl : GenericFormControl<Number>
Base interface of a form control with a numeric value.
StringFormControl
Link copied to clipboard
js
interface StringFormControl : GenericFormControl<String>
Base interface of a form control with a text value.
ValidationStatus
Link copied to clipboard
js
enum ValidationStatus : Enum<ValidationStatus> , CssClass
Input controls validation status.

Functions

asJson
Link copied to clipboard
js
fun Map<String, Any?>.asJson(): <ERROR CLASS>
Extension function to convert Map to JSON.
asMap
Link copied to clipboard
js
fun <ERROR CLASS>.asMap(): Map<String, Any?>
Extension function to convert JSON to Map.
fieldLabel
Link copied to clipboard
js
fun Container.fieldLabel(forId: String, content: String? = null, rich: Boolean = false, classes: Set<String>? = null, className: String? = null, init: FieldLabel.() -> Unit? = null): FieldLabel
DSL builder extension function.
fun <S> Container.fieldLabel(state: ObservableState<S>, forId: String, content: String? = null, rich: Boolean = false, classes: Set<String>? = null, className: String? = null, init: FieldLabel.(S) -> Unit): FieldLabel
DSL builder extension function for observable state.
form
Link copied to clipboard
js
fun Container.form(method: FormMethod? = null, action: String? = null, enctype: FormEnctype? = null, type: FormType? = null, condensed: Boolean = false, horizRatio: FormHorizontalRatio = FormHorizontalRatio.RATIO_2, classes: Set<String>? = null, className: String? = null, init: FormPanel<Any>.() -> Unit? = null): FormPanel<Any>
DSL builder extension function.
fun <S> Container.form(state: ObservableState<S>, method: FormMethod? = null, action: String? = null, enctype: FormEnctype? = null, type: FormType? = null, condensed: Boolean = false, horizRatio: FormHorizontalRatio = FormHorizontalRatio.RATIO_2, classes: Set<String>? = null, className: String? = null, init: FormPanel<Any>.(S) -> Unit): FormPanel<Any>
DSL builder extension function for observable state.
formPanel
Link copied to clipboard
js
inline fun <K : Any> Container.formPanel(method: FormMethod? = null, action: String? = null, enctype: FormEnctype? = null, type: FormType? = null, condensed: Boolean = false, horizRatio: FormHorizontalRatio = FormHorizontalRatio.RATIO_2, classes: Set<String>? = null, className: String? = null, customSerializers: Map<KClass<*>, <ERROR CLASS><out <ERROR CLASS>>>? = null, noinline init: FormPanel<K>.() -> Unit? = null): FormPanel<K>
DSL builder extension function.
inline fun <K : Any, S> Container.formPanel(state: ObservableState<S>, method: FormMethod? = null, action: String? = null, enctype: FormEnctype? = null, type: FormType? = null, condensed: Boolean = false, horizRatio: FormHorizontalRatio = FormHorizontalRatio.RATIO_2, classes: Set<String>? = null, className: String? = null, customSerializers: Map<KClass<*>, <ERROR CLASS><out <ERROR CLASS>>>? = null, noinline init: FormPanel<K>.(S) -> Unit): FormPanel<K>
DSL builder extension function for observable state.