Package-level declarations

Properties

Link copied to clipboard
val JsonPrimitive.anyValue: Any

Get any value from JsonPrimitive type which convert a string to Double, Int, Float, Boolean or String.

Functions

Link copied to clipboard

Evaluate the rule to check if we should disable the field.

Link copied to clipboard

Evaluate the rule to check if we should show the field.

Link copied to clipboard
fun Property.getMaxCounter(value: String?, control: Control): Pair<Int, Int>?

Return a Pair of Int (current value length to max length), if the property is a TextInputProperty, control options showMaxCounter is true and has a max length specified.

Link copied to clipboard

Check if StringProperty is a dropdown based on the oneOf field.

Link copied to clipboard

Check if StringProperty is an email based on the format.

Link copied to clipboard
fun Property.isEnabled(control: Control, data: Map<String, Any?>): Boolean

Check if the property is enabled from the control rule if it exists. The data property is necessary because rules are based on a condition in relation to another field.

Link copied to clipboard

Check if StringProperty is a password based on the format.

Link copied to clipboard

Check if StringProperty is a phone based on the format.

Link copied to clipboard

Check if StringProperty is a radio based on the format and enum or oneOf fields.

Link copied to clipboard

Check if BooleanProperty is a toggle based on the format.

Link copied to clipboard
fun Property.label(required: Boolean, control: Control): String?

Get the label of a field from the Property or the Control with '*' if it is required. If there is no title in the Property or label in the Control, it'll return null as label.

Link copied to clipboard

Get key of the Control at the end of the path in the scope.

Link copied to clipboard
fun Any?.toJsonPrimitive(): JsonPrimitive?

Convert a generic value to a JsonPrimitive with a String, Number or Boolean. If you try to convert a value with another type, a NotImplementedError exception will be thrown.

Link copied to clipboard
inline fun <T> JsonPrimitive.value(): T

Get value from JsonPrimitive type which convert a string to Double, Int, Float, Boolean or String.