Class FormComposablesKt

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any> Form<T> form(KClass<T> className, T initialData, Function1<FormScope<T>, Unit> content) form ComposableThis composable setup the form declarative by taking it's class reference as a parameter.
      final static <T extends Any, V extends Any> FormField<V> field(FormScope<T> $self, KProperty1<T, V> fieldClass, Function1<FormFieldScope<V>, Unit> content) Field ComposableThis composable automatically registers the field in it's parent scope and accepts KProperty1 reference as a parameter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • form

        @Composable() final static <T extends Any> Form<T> form(KClass<T> className, T initialData, Function1<FormScope<T>, Unit> content)

        form Composable

        This composable setup the form declarative by taking it's class reference as a parameter. It accepts a composable content with FormScope as it's context. By using this FormScope context, you can register fields or call the field compose to setup field UIs

        This composable returns a Form object which you can reference later to register more fields

        Parameters:
        className - kotlin class reference of the form
        content - composable content
      • field

        @Composable() final static <T extends Any, V extends Any> FormField<V> field(FormScope<T> $self, KProperty1<T, V> fieldClass, Function1<FormFieldScope<V>, Unit> content)

        Field Composable

        This composable automatically registers the field in it's parent scope and accepts KProperty1 reference as a parameter. It also accepts a composable content with a FormFieldScope as it's context. You can use this context to set the field value, observe it's state and validation results

        Parameters:
        fieldClass - class reference of the form data
        content - composable content