npm.io
1.7.0 • Published 5 years ago

ms-form

Licence
ISC
Version
1.7.0
Deps
6
Size
16 kB
Vulns
0
Weekly
0

MS-Form

formConnect options


const options = {
  // form name
  form,

  // validate function
  validate,

  // initial values: {...} or (state, props) => ({...})
  initialValues
}

Form gets props

const props = {
  // save form to state
  formChanged: this.formChanged,
  // reset form
  formReset: this.formReset,
  // form values
  formValues,
  // form validation
  formValidation,
  // form isValid flag
  formIsValid,

  // send async validation result through this function
  formAsyncValidationResult: this.asyncValidationResult,

  // function to get changed form, after events
  formGet: this.formGet, // composit, takes input parameters of onChange and onSelected
  formGetOnChange: this.formGetOnChange,
  formGetOnSelected: this.formGetOnSelected,

  // field props generator
  formField: this.formField
}

checkout demo

Keywords