Package com.github.k0shk0sh.compose.easyforms

Types

CardValidationType
Link copied to clipboard
object CardValidationType : EasyFormsValidationType
Cards validation with regex that support most common cards.
EasyForms
Link copied to clipboard
class EasyForms
A class that manage all your forms states.
EasyFormsCheckboxState
Link copied to clipboard
data class EasyFormsCheckboxState(defaultValue: Boolean, isRequired: Boolean) : EasyFormsState<State<Boolean>, Boolean>
EasyFormsErrorState
Link copied to clipboard
enum EasyFormsErrorState : Enum<EasyFormsErrorState>
Represent the three different states a field could have.
EasyFormsRadioButtonState
Link copied to clipboard
data class EasyFormsRadioButtonState(defaultValue: Boolean, isRequired: Boolean) : EasyFormsState<State<Boolean>, Nothing>
EasyFormsRangeSliderState
Link copied to clipboard
EasyFormsResult
Link copied to clipboard
sealed class EasyFormsResult
A class that represent must of the Compose form fields result states.
EasyFormsSliderState
Link copied to clipboard
data class EasyFormsSliderState(defaultValue: Float, isRequired: Boolean) : EasyFormsState<State<Float>, Float>
EasyFormsState
Link copied to clipboard
abstract class EasyFormsState<ST, CT>
EasyFormsSwitchState
Link copied to clipboard
data class EasyFormsSwitchState(defaultValue: Boolean, isRequired: Boolean) : EasyFormsState<State<Boolean>, Boolean>
EasyFormsTextFieldState
Link copied to clipboard
data class EasyFormsTextFieldState(defaultValue: String, easyFormsValidationType: EasyFormsValidationType) : EasyFormsState<State<TextFieldValue>, TextFieldValue>
EasyFormsTriCheckboxState
Link copied to clipboard
data class EasyFormsTriCheckboxState(defaultValue: ToggleableState, isRequired: Boolean) : EasyFormsState<State<ToggleableState>, Nothing>
EasyFormsValidationType
Link copied to clipboard
abstract class EasyFormsValidationType(minLength: Int, maxLength: Int, regex: String?)
EmailValidationType
Link copied to clipboard
object EmailValidationType : EasyFormsValidationType
NameValidationType
Link copied to clipboard
object NameValidationType : EasyFormsValidationType
Name validation
  • Name must contain at least one char.

  • Name must contain at most 20 chars.

PasswordValidationType
Link copied to clipboard
object PasswordValidationType : EasyFormsValidationType
Password validation using below criteria:
  • Password must contain at least one digit 0-9.

  • Password must contain at least one lowercase Latin character a-z.

  • Password must contain at least one uppercase Latin character A-Z.

  • Password must contain at least one special character like ! @ # & ( ).

  • Password must contain a length of at least 8 characters and a maximum of 20 characters.

PhoneNumberValidationType
Link copied to clipboard
object PhoneNumberValidationType : EasyFormsValidationType
Phone validation using below criteria:
  • Number must contain at least 7 digits.

  • Number must contain at most 19 digits.

  • Number can start with +.

  • Number can contains whitespaces in between.

  • Number can contains () as second part of the number.

  • Number can contains - as a separator.

UrlValidationType
Link copied to clipboard
object UrlValidationType : EasyFormsValidationType

Functions

BuildEasyForms
Link copied to clipboard
fun BuildEasyForms(key: Any = EASY_FORMS_KEY, saveableStateRegistry: SaveableStateRegistry? = null, content: @Composable() (easyForms: EasyForms) -> Unit)
Please be aware that BuildEasyForms should be called as parent of your forms UI tree and not as a top parent of your whole tree.