case class JSFormController[T <: Object](nameBase: String) extends FormControllerBase with Product with Serializable
- Alphabetic
- By Inheritance
- JSFormController
- Serializable
- Product
- Equals
- FormControllerBase
- HasErrors
- HasTouches
- HasValues
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new JSFormController(nameBase: String)
Type Members
- sealed trait Action extends AnyRef
Actions that are sent by child form elements.
Actions that are sent by child form elements.
- Definition Classes
- FormControllerBase
- case class Context(props: FormProps, initialValue: Value, validate: UndefOr[FormValidator]) extends Product with Serializable
The context is slightly duplicative in that initialValues and validate are already in FormProps.
The context is slightly duplicative in that initialValues and validate are already in FormProps.
- Definition Classes
- FormControllerBase
- case class FieldErrors(errors: Errors, merge: Boolean) extends Action with Product with Serializable
Set field errors.
Set field errors. Either replacing all of the existing or merging this into the existing field errors.
- Definition Classes
- FormControllerBase
- case class FieldValue(field: String, value: Value, validate: Boolean) extends Action with Product with Serializable
Send the attibute that changed and an updated Value object.
Send the attibute that changed and an updated Value object.
- Definition Classes
- FormControllerBase
- case class FormActions(setFieldValue: (String, Value, Boolean) => Unit = (_, _, _) => (), setError: (String, String) => Unit = (_, _) => (), setErrors: (Errors, Boolean) => Unit = (_, _) => (), setTouched: (String, Boolean) => Unit = (_, _) => (), submit: () => Unit = () => (), reset: (Option[Value]) => Unit = _ => (), validateField: (String) => Future[Errors] = _ => Future.successful(EmptyErrors), validateForm: (Value) => Future[Errors] = _ => Future.successful(EmptyErrors)) extends Product with Serializable
API to change this this component's state, church encoding of Actions.
API to change this this component's state, church encoding of Actions. Most of these send state changing messages to the reducer. This API is should be easier to use then sending raw Action messages.
- Definition Classes
- FormControllerBase
- case class FormHandlers(handleChange: (String, Value) => Unit = (_, _) => (), handleBlur: (String) => Unit = _ => (), handleSubmit: react.vdom.FormEventHandler[Form] = _ => (), handleReset: react.vdom.FormEventHandler[Form] = _ => ()) extends Product with Serializable
Handlers for controls.
Handlers for controls. These are close to what's needed for most html controls.
- Definition Classes
- FormControllerBase
- case class FormProps(isValid: Boolean, dirty: Boolean, values: Value, errors: Errors, touched: Touches, isValidating: Boolean, isSubmitting: Boolean, submitCount: Int, didMount: Boolean, handlers: FormHandlers, actions: FormActions, initialValue: Value) extends Product with Serializable
Props passed to the child component.
Props passed to the child component.
- Definition Classes
- FormControllerBase
- trait Props extends Object with PropsBase
- Definition Classes
- FormControllerBase
- Annotations
- @JSType()
- trait PropsBase extends Object
- Definition Classes
- FormControllerBase
- Annotations
- @JSType()
- trait PropsInit extends Object with PropsBase
- Definition Classes
- FormControllerBase
- Annotations
- @JSType()
- case class Reset(values: Value) extends Action with Product with Serializable
Reset using the values provided including initialValues.
Reset using the values provided including initialValues.
- Definition Classes
- FormControllerBase
- case class State(value: Value, postAction: Option[Action] = None, submitting: Boolean = false, validating: Boolean = false, resetting: Boolean = false, errors: Errors = EmptyErrors, touched: Touches = EmptyTouches) extends Product with Serializable
- Definition Classes
- FormControllerBase
- case class Submitting(f: Boolean) extends Action with Product with Serializable
Submit the form.
Submit the form.
- f
Whether submission should start or if it has ended.
- Definition Classes
- FormControllerBase
- case class Touched(field: String, validate: Boolean) extends Action with Product with Serializable
Touch a field potentially forcing validation.
Touch a field potentially forcing validation.
- Definition Classes
- FormControllerBase
- case class Validating(f: Boolean, errors: Option[Errors]) extends Action with Product with Serializable
Indicate whether we are validating, performed asynchronously.
Indicate whether we are validating, performed asynchronously. This action does not perform validation itself, it just provides the status or the result of validation if f = false.
- f
validating status "is or is not validating"
- errors
validation errors from the validation ffort, if any
- Definition Classes
- FormControllerBase
- type FormValidator = ((_values)#Value, Seq[String]) => Future[MapErrors.Errors]
Validate values, only checking Seq[String] fields, or all fields (form level validation) if Nil.
Validate values, only checking Seq[String] fields, or all fields (form level validation) if Nil. Return errors.
- Definition Classes
- FormControllerBase
- type ResetCallback = ((_values)#Value, FormActions) => Future[Unit]
- Definition Classes
- FormControllerBase
- type SubmitCallback = ((_values)#Value, FormActions) => Future[Unit]
- Definition Classes
- FormControllerBase
- type Validator = (Option[Any]) => Future[String]
Validate a single value, return user message.
Validate a single value, return user message. Used for field level validations.
- Definition Classes
- FormControllerBase
- type Validators = Dictionary[Validator]
Validators indexed by attribute name.
Validators indexed by attribute name.
- Definition Classes
- FormControllerBase
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val EmptyValidators: Dictionary[Validator]
- Definition Classes
- FormControllerBase
- val FormContext: ReactContext[Context]
- Definition Classes
- FormControllerBase
- val Name: String
- Definition Classes
- JSFormController → FormControllerBase
- val _errors: MapErrors.type
- Definition Classes
- JSFormController → HasErrors
- val _touches: MapTouches.type
- Definition Classes
- JSFormController → HasTouches
- val _values: JSObjectValues[T]
- Definition Classes
- JSFormController → HasValues
- def apply(props: PropsInit)(children: (FormProps) => ReactNode): ReactNode
- Definition Classes
- FormControllerBase
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def handleReset(currentValue: (_values)#Value, dispatch: Dispatch[Action], initialValue: MutableRef[(_values)#Value], factions: FormActions, reset: UndefOr[ResetCallback]): react.vdom.FormEventHandler[Form]
- Definition Classes
- FormControllerBase
- def handleSubmit(dispatch: Dispatch[Action]): react.vdom.FormEventHandler[Form]
- Definition Classes
- FormControllerBase
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def makeFormActions(currentValue: (_values)#Value, dispatch: Dispatch[Action], initialValue: MutableRef[(_values)#Value], validate: UndefOr[FormValidator]): FormActions
- Definition Classes
- FormControllerBase
- def makeFormHandlers(currentValue: (_values)#Value, dispatch: Dispatch[Action], initialValue: MutableRef[(_values)#Value], factions: FormActions, reset: UndefOr[ResetCallback]): FormHandlers
- Definition Classes
- FormControllerBase
- val nameBase: String
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val render: (Props) => ReactNode
- Definition Classes
- FormControllerBase
- def resetForm(dispatch: Dispatch[Action], initialValue: MutableRef[(_values)#Value], nextValues: Option[(_values)#Value]): Unit
- Definition Classes
- FormControllerBase
- def runFieldLevelValidations(validators: Dictionary[Validator], values: (_values)#Value): Future[MapErrors.Errors]
Dummy for now.
Dummy for now. Always return EmptyErrors.
- Definition Classes
- FormControllerBase
- def runValidations(values: (_values)#Value, fieldLevelValidators: Dictionary[Validator], handler: UndefOr[FormValidator]): Future[MapErrors.Errors]
Run validation handlers.
Run validation handlers. Merge resulting errors. Maybe the return value should be Future[Option[Errors]]. If the validators fail, return the exception in the Future's error channel.
TODO: Keep all errors by using an applicative non-empty list.
- Definition Classes
- FormControllerBase
- def setError(dispatch: Dispatch[Action], field: String, message: String): Unit
- Definition Classes
- FormControllerBase
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])