Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
class DataLoaderBuilder(val db: OctaviusClient) : MappingContainer
Link copied to clipboard
class ErrorManager(val isKnownField: (String) -> Boolean)
Link copied to clipboard
internal data class ExistenceFlag(val controlName: String, val checkColumn: String)
Link copied to clipboard
internal data class FieldMapping(val controlName: String, val dbColumn: String)
Link copied to clipboard

The contract through which controls run form actions.

Link copied to clipboard
abstract class FormDataManager : KoinComponent

Abstract class managing the data flow of a form.

Link copied to clipboard
class FormHandler(formSchemaBuilder: FormSchemaBuilder, val formDataManager: FormDataManager, val formValidator: FormValidator = FormValidator(), val payload: Map<String, Any?> = emptyMap(), val handlerScope: CoroutineScope = CoroutineScope(SupervisorJob() + OctaviusDispatchers.Virtual)) : FormActionTrigger

Handles the form's lifecycle - the main coordinator of the form system.

Link copied to clipboard

Stage of loading the form's initial data.

Link copied to clipboard

Reading form results (getCurrent, getCurrentAs and their initial-value counterparts) failed: the path does not point at a control, leads through a control that is not a section, or the value is not of the requested type.

Link copied to clipboard
class FormSchema(val definedControls: Map<String, Control<*>>, val contentOrder: List<String>, val actionBarOrder: List<String>)

Form schema - the structure and layout of the controls.

Link copied to clipboard
abstract class FormSchemaBuilder

Abstract factory for form schemas.

Link copied to clipboard
class FormState

Reactive state of all form controls.

Link copied to clipboard
open class FormValidator : KoinComponent

Validates the form on three levels:

Link copied to clipboard
class InitDataException(val path: String, reason: String) : RuntimeException

Data from initData does not fit the form schema: a value lies under a path that points at no control, or the control does not accept it (wrong type, value outside the options).

Link copied to clipboard
abstract class MappingContainer
Link copied to clipboard
internal data class OneToOneMapping(val existenceFlag: ExistenceFlag?, val table: String, val on: String, val relations: List<RelationMapping>) : RelationMapping
Link copied to clipboard

Resolves paths in the form hierarchy. Handles absolute paths, relative ones (.) and going up (..), using the ControlContext tree.

Link copied to clipboard
internal class QueryScope(val isTopLevel: Boolean)
Link copied to clipboard
internal data class RelatedDataMapping(val controlName: String, val builder: RelatedDataMappingBuilder) : RelationMapping
Link copied to clipboard
internal sealed class RelationMapping
Link copied to clipboard
internal data class SimpleMapping(val mapping: FieldMapping) : RelationMapping

Functions

Link copied to clipboard
private fun alias(controlName: String): String
Link copied to clipboard
@Composable
fun FormView(formHandler: FormHandler)

Form UI - renders the controls provided by FormHandler.

Link copied to clipboard
@Composable
private fun GlobalErrorsCard(errors: List<String>)

Shows the global errors