Package-level declarations

Types

Link copied to clipboard
open class ActionField(tag: String? = null, val title: StrRes, val onClick: () -> Unit) : Field<Unit>

A button whose behavior stays in Kotlin. Renderers call perform; the callback runs only while the field is visible and enabled.

Link copied to clipboard
interface CustomField

Marks a consumer-defined io.github.robinpcrd.kotose.form.Field that renderers must hand to the application's custom renderer. The typed value, validation and conditions stay on the field itself. Renderers dispatch on kind; the native adapter also exposes the live field so a custom SwiftUI view can cast it to the consumer's own class.

Link copied to clipboard
open class DateTimeField(tag: String? = null, val placeholder: StrRes? = null, val formatter: (LocalDateTime) -> String = ::defaultDateTimeFormatter, val showPicker: () -> Unit? = null, val iosPickerMode: IosDatePickerMode = IosDatePickerMode.Compact) : Field<LocalDateTime>

Calendar date and wall-clock time shared by renderers. The value has no time zone.

Link copied to clipboard
open class DisplayParagraphField(tag: String? = null, lines: List<StrRes> = emptyList()) : Field<ImmutableList<StrRes>>

Read-only lines of text shared by renderers.

Link copied to clipboard
open class DisplayTextField(tag: String? = null, val text: StrRes? = null, val isTitle: Boolean = false) : Field<StrRes>

Read-only text shared by renderers. The value is the displayed text and can change at runtime; isTitle asks the renderer for heading emphasis.

Link copied to clipboard
data class DropdownOption<T>(val value: T, val label: StrRes, val id: String = Uuid.random().toString())

Supply an explicit id when recreating options. IDs identify values, never labels or positions.

Link copied to clipboard

The date picker of both iOS renderers. Android always shows its Material dialog.

Link copied to clipboard
Link copied to clipboard
open class LocalDateField(tag: String? = null, val placeholder: StrRes? = null, val formatter: (LocalDate) -> String = ::defaultLocalDateFormatter, val showPicker: () -> Unit? = null, val iosPickerMode: IosDatePickerMode = IosDatePickerMode.Compact) : Field<LocalDate>

Calendar date shared by renderers. The value has no time zone; renderers convert platform dates to calendar components without shifting the day. showPicker and iosPickerMode configure how the active renderer presents its picker.

Link copied to clipboard
open class SecureTextField(tag: String? = null, val label: StrRes? = null, val placeholder: StrRes? = label) : FocusableField<String>

Password text shared by renderers. Masking and reveal state belong to the active UI.

Link copied to clipboard
open class SelectionOptionField<ValueType>(tag: String? = null, val selectableValue: ValueType, defaultLabelForValue: StrRes? = null) : Field<ValueType> , ISelectableField<ValueType>

One typed option, with its own conditions and validation, in a selection group.

Link copied to clipboard

How a single selection shows its options. Each renderer maps a value to its own platform control; an iosPresentation set next to presentation replaces it on iOS.

Link copied to clipboard
open class SingleChoiceField<T>(tag: String? = null, possibleValues: List<DropdownOption<T>>, val placeholder: StrRes? = null, val isClearable: Boolean = false, val presentation: SelectionPresentation = SelectionPresentation.Menu, val iosPresentation: SelectionPresentation? = null) : Field<T>

Renderer-neutral dropdown state. Kotlin owns the typed value; renderers select an option ID. presentation applies on every platform unless iosPresentation replaces it on iOS.

Link copied to clipboard
open class TextField(tag: String? = null, val label: StrRes? = null, val placeholder: StrRes? = label, val lineLimits: TextLineLimits = TextLineLimits.SingleLine) : FocusableField<String>

Text value and validation shared by every renderer.

Link copied to clipboard
sealed interface TextLineLimits

How many lines a text input shows. Every renderer applies the same rules.

Link copied to clipboard
open class ToggleField(tag: String? = null, defaultLabel: StrRes) : Field<Boolean>

Boolean value and label shared by every renderer.

Functions

Link copied to clipboard
fun LocalDateField.applyPickedDate(date: LocalDate)
Link copied to clipboard
fun DateTimeField.applyPickedDateTime(date: LocalDate, hour: Int, minute: Int)
Link copied to clipboard
fun defaultDateTimeFormatter(dateTime: LocalDateTime): String
Link copied to clipboard
fun defaultLocalDateFormatter(date: LocalDate): String