Interface FormScope
-
-
Method Summary
Modifier and Type Method Description abstract <V extends Any> FormField<V>registerField(KProperty1<T, V> fieldClass)Registers the field and returns a singleton FormField instance abstract FormResult<T>formValidate()Validate the form and collect the form data abstract UnitformSetValues(T payload)Set all fields to the given form data abstract TformGetValues()Get the current form values without validating them abstract UnitformClear()Reset all fields to their default state abstract <V extends Any> VformGetFieldValue(KProperty1<T, V> fieldClass)Get the value of a field abstract State<FormResult<T>>getFormState()abstract BooleangetFormIsValid()True if the form is successfully validated abstract BooleangetFormIsError()True if the form contains validation errors -
-
Method Detail
-
registerField
abstract <V extends Any> FormField<V> registerField(KProperty1<T, V> fieldClass)
Registers the field and returns a singleton FormField instance
- Parameters:
fieldClass- kotlin property reference of the field
-
formValidate
abstract FormResult<T> formValidate()
Validate the form and collect the form data
- Returns:
FormResult object containing the validation status and data
-
formSetValues
abstract Unit formSetValues(T payload)
Set all fields to the given form data
-
formGetValues
abstract T formGetValues()
Get the current form values without validating them
-
formGetFieldValue
abstract <V extends Any> V formGetFieldValue(KProperty1<T, V> fieldClass)
Get the value of a field
-
getFormState
@Composable() abstract State<FormResult<T>> getFormState()
-
getFormIsValid
@Composable() abstract Boolean getFormIsValid()
True if the form is successfully validated
-
getFormIsError
@Composable() abstract Boolean getFormIsError()
True if the form contains validation errors
-
-
-
-