Package-level declarations

Types

Link copied to clipboard
interface Field<V>

A field is a single input in a form. It has a name, a value, and a set of errors.

Link copied to clipboard
typealias FieldError = String

Represents a single error message in the field.

Link copied to clipboard

Represents multiple error messages in the field.

Link copied to clipboard
typealias FieldName = String

This field name is used to uniquely identify a field within a form.

Link copied to clipboard
data class FieldPolicy(val validationTrigger: FieldValidationTrigger = FieldValidationTrigger, val validationDelay: FieldValidationDelay = FieldValidationDelay())

Represents the settings for field-related policies, such as validation behavior.

Link copied to clipboard

Enumerates the timings when field validation is performed.

Link copied to clipboard
data class FieldValidationDelay(val onMount: Duration = Duration.ZERO, val onChange: Duration = 250.milliseconds, val onBlur: Duration = Duration.ZERO)

Represents the settings for delayed execution of field validation.

Link copied to clipboard

Represents the timings that trigger field validation.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class FormPolicy(val field: FieldPolicy = FieldPolicy(), val submission: SubmissionPolicy = SubmissionPolicy())

Represents the settings for the overall form policy.

Link copied to clipboard
fun interface FormRule<T>

Represents a rule that can be applied to a form field.

Link copied to clipboard
typealias FormRules<T> = Map<FieldName, FormRule<T>>
Link copied to clipboard
Link copied to clipboard
class FormValidationException(val errors: FormErrors, cause: Throwable? = null) : RuntimeException

Exception used for handling validation errors during the submission process.

Link copied to clipboard
interface Submission

A submission represents the submission control of a form.

Link copied to clipboard
data class SubmissionPolicy(val preValidation: Boolean = true, val preValidationDelay: SubmissionPreValidationDelay = SubmissionPreValidationDelay())

Represents the settings for submission-related policies, such as pre-validation behavior.

Link copied to clipboard
data class SubmissionPreValidationDelay(val onMount: Duration = 200.milliseconds, val onChange: Duration = 200.milliseconds)

Represents the settings for delayed execution of pre-validation.

Link copied to clipboard
fun interface ValidationRule<V>

Represents a validation rule for a form field.

Link copied to clipboard

Builder for creating a set of validation rules.

Link copied to clipboard

A set of validation rules.

Properties

Link copied to clipboard

Syntax sugar representing that there are no errors in the field.

Functions

Link copied to clipboard
fun fieldError(vararg messages: String): FieldErrors

Creates error messages for a field.

Link copied to clipboard

Creates a set of validation rules.