c

forms

JSFormController

case class JSFormController[T <: Object](nameBase: String) extends FormControllerBase with Product with Serializable

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JSFormController
  2. Serializable
  3. Product
  4. Equals
  5. FormControllerBase
  6. HasErrors
  7. HasTouches
  8. HasValues
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new JSFormController(nameBase: String)

Type Members

  1. sealed trait Action extends AnyRef

    Actions that are sent by child form elements.

    Actions that are sent by child form elements.

    Definition Classes
    FormControllerBase
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. trait Props extends Object with PropsBase
    Definition Classes
    FormControllerBase
    Annotations
    @JSType()
  9. trait PropsBase extends Object
    Definition Classes
    FormControllerBase
    Annotations
    @JSType()
  10. trait PropsInit extends Object with PropsBase
    Definition Classes
    FormControllerBase
    Annotations
    @JSType()
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. type ResetCallback = ((_values)#Value, FormActions) => Future[Unit]
    Definition Classes
    FormControllerBase
  18. type SubmitCallback = ((_values)#Value, FormActions) => Future[Unit]
    Definition Classes
    FormControllerBase
  19. 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
  20. type Validators = Dictionary[Validator]

    Validators indexed by attribute name.

    Validators indexed by attribute name.

    Definition Classes
    FormControllerBase

Value Members

  1. val EmptyValidators: Dictionary[Validator]
    Definition Classes
    FormControllerBase
  2. val FormContext: ReactContext[Context]
    Definition Classes
    FormControllerBase
  3. val Name: String
    Definition Classes
    JSFormControllerFormControllerBase
  4. val _errors: MapErrors.type
    Definition Classes
    JSFormControllerHasErrors
  5. val _touches: MapTouches.type
    Definition Classes
    JSFormControllerHasTouches
  6. val _values: JSObjectValues[T]
    Definition Classes
    JSFormControllerHasValues
  7. def apply(props: PropsInit)(children: (FormProps) => ReactNode): ReactNode
    Definition Classes
    FormControllerBase
  8. def handleReset(currentValue: (_values)#Value, dispatch: Dispatch[Action], initialValue: MutableRef[(_values)#Value], factions: FormActions, reset: UndefOr[ResetCallback]): react.vdom.FormEventHandler[Form]
    Definition Classes
    FormControllerBase
  9. def handleSubmit(dispatch: Dispatch[Action]): react.vdom.FormEventHandler[Form]
    Definition Classes
    FormControllerBase
  10. def makeFormActions(currentValue: (_values)#Value, dispatch: Dispatch[Action], initialValue: MutableRef[(_values)#Value], validate: UndefOr[FormValidator]): FormActions
    Definition Classes
    FormControllerBase
  11. def makeFormHandlers(currentValue: (_values)#Value, dispatch: Dispatch[Action], initialValue: MutableRef[(_values)#Value], factions: FormActions, reset: UndefOr[ResetCallback]): FormHandlers
    Definition Classes
    FormControllerBase
  12. val nameBase: String
  13. def productElementNames: Iterator[String]
    Definition Classes
    Product
  14. val render: (Props) => ReactNode
    Definition Classes
    FormControllerBase
  15. def resetForm(dispatch: Dispatch[Action], initialValue: MutableRef[(_values)#Value], nextValues: Option[(_values)#Value]): Unit
    Definition Classes
    FormControllerBase
  16. def runFieldLevelValidations(validators: Dictionary[Validator], values: (_values)#Value): Future[MapErrors.Errors]

    Dummy for now.

    Dummy for now. Always return EmptyErrors.

    Definition Classes
    FormControllerBase
  17. 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
  18. def setError(dispatch: Dispatch[Action], field: String, message: String): Unit
    Definition Classes
    FormControllerBase