dev.cheleb.scalamigen

Members list

Type members

Classlikes

trait ConditionalFor[C, A]

Attributes

Supertypes
class Object
trait Matchable
class Any
trait Defaultable[A]

Typeclass for default values.

Typeclass for default values.

This typeclass is used to provide default values for a given type. It is used to provide default values for form fields when creating a new object, for example.

It is necessary to provide a default value for every type used in the application and wrapped in a option.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Defaultable

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
class FieldName(val value: String) extends StaticAnnotation

Annotation for field names

Annotation for field names

Use this annotation to specify field names for case class fields.

Attributes

Supertypes
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
trait Form[A]

A form for a type A.

A form for a type A.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type
Form[A]
object Form extends AutoDerivation[Form]

Attributes

Companion
trait
Supertypes
trait AutoDerivation[Form]
trait Derivation[Form]
trait SealedTraitDerivation
trait CommonDerivation[Form]
class Object
trait Matchable
class Any
Show all
Self type
Form.type
case object HiddenEvent extends ValidationEvent

The event emitted when the field is hidden (when Option is set to None).

The event emitted when the field is hidden (when Option is set to None).

It will then ignore any validation status.

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
final case class InvalideEvent(errorMessage: String) extends ValidationEvent

The event emitted when the validation is unsuccessful.

The event emitted when the validation is unsuccessful.

Value parameters

errorMessage

The error message.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait IronTypeValidator[T, C]

Type validator for IronType.

Type validator for IronType.

Iron is a library for compile-time or runtime type validation.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

This is raw laminar implementation of the widget factory.

This is raw laminar implementation of the widget factory.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object NameUtils

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
NameUtils.type
case class NoPanel(asTable: Boolean, fieldCss: String, labelCss: String, panelCss: String) extends StaticAnnotation

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all
case class Panel(name: String, asTable: Boolean, fieldCss: String, labelCss: String, panelCss: String) extends StaticAnnotation

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all
case object ShownEvent extends ValidationEvent

The event emitted when the field is shown (when Option is set to Some).

The event emitted when the field is shown (when Option is set to Some).

It will then redem any validation status.

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
ShownEvent.type
case object ValidEvent extends ValidationEvent

The event emitted when the validation is successful.

The event emitted when the validation is successful.

It will clear any error message for a field.

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
ValidEvent.type

A sealed trait representing the possible events that can be emitted by a validation.

A sealed trait representing the possible events that can be emitted by a validation.

Events are emitted by the validation of a field. They are used to update the state.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object HiddenEvent
object ShownEvent
object ValidEvent

Validation status.

Validation status.

It is used to determine the status of a field.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait Validator[A]

A trait representing a validator for a type A.

A trait representing a validator for a type A.

A validator is a function that takes a string and returns either an error message or a value of type A.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Validator

Validators for common types. They are the base validation used by Iron derivations.

Validators for common types. They are the base validation used by Iron derivations.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Validator.type

This is a trait that defines the interface for the widget factory.

This is a trait that defines the interface for the widget factory.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Value members

Concrete methods

def numericForm[A](f: String => Option[A], zero: A): Form[A]

Form for a numeric type.

Form for a numeric type.

Attributes

def secretForm[A <: String](to: String => A): Form[A]

A form for a secret type.

A form for a secret type.

The secret type is a string that should not be displayed in clear text.

In general it is used for passwords, api keys, etc...

Hence this sensitive data should be declared as an opaque type.

Value parameters

to

The function to convert the string to the secret type.

Attributes

def selectForm[A](elements: Array[A], labelMapper: A => String): Form[A]

Render form as html select.

Render form as html select.

Value parameters

elements

The elements to render.

labelMapper

The function to map the element to a label. Default is toString.

Attributes

def selectMappedForm[A, B](elements: Seq[A], mapper: A => B, labelMapper: A => String): Form[B]

Render form as html select.

Render form as html select.

Value parameters

elements

The elements to render.

labelMapper

The function to map the element to a label. Default is toString.

mapper

The function to map the element to a value.

Attributes

def stringForm[A](to: String => A): Form[A]

A form for a type A, no validation. Convenient to use for Opaque types. If you need validation, use a Form with a ValidationEvent.

A form for a type A, no validation. Convenient to use for Opaque types. If you need validation, use a Form with a ValidationEvent.

Attributes

def stringFormWithValidation[A](using validator: Validator[A]): Form[A]

A form for a type A, with validation.

A form for a type A, with validation.

Value parameters

validator

The validator for the type A.

Attributes

Extensions

Extensions

extension (errorBus: EventBus[(String, ValidationEvent)])
def errors(f: (String, String) => L.HtmlElement): Signal[ReactiveHtmlElement[HTMLDivElement]]

Render the errors.

Render the errors.

Attributes

def watch: Signal[Map[String, ValidationStatus]]

Watch the error bus and return a signal of the errors.

Watch the error bus and return a signal of the errors.

Attributes

extension (path: List[Symbol])
def key: String

Get the key of the path.

Get the key of the path.

This key is used to identify the field in the error bus.

Attributes

extension [A](va: Var[A])
def asForm(using wf: WidgetFactory)(using Form[A]): ReactiveHtmlElement[HTMLElement]

Render a form for the variable.

Render a form for the variable.

Value parameters

wf

The widget factory.

Attributes

def asForm(errorBus: EventBus[(String, ValidationEvent)])(using wf: WidgetFactory)(using Form[A]): ReactiveHtmlElement[HTMLElement]

Render a form for the variable.

Render a form for the variable.

Value parameters

errorBus

The error bus.

wf

The widget factory.

Attributes

def errorBus: EventBus[(String, ValidationEvent)]

Buid an error bus for the variable that will be used to display errors.

Buid an error bus for the variable that will be used to display errors.

Attributes