Goten Form
Goten Form is a react component that facilitates the validation of the Goten components.
Index
Install
npm install -s goten-react-form
Usage
var GotenForm = GotenForm; // ES5import GotenForm from 'goten-react-form'; // ES6<GotenForm=/><Component1><GotenComponent/></Component1><GotenComponent/><Component2/></GotenForm>
Example of use
With buttonComponent
import React Component from 'react'import GotenTextField from 'goten-react-text-field'import GotenForm from 'goten-react-from'{return<GotenForm===><div ='title'>TITLE</div><table><tbody><tr><th ='item'><GotenTextField========/></th><th ='item'><GotenTextField====/></th></tr></tbody></table></GotenForm>}
Without buttonComponent
import React Component from 'react'import GotenTextField from 'goten-react-text-field'import GotenForm from 'goten-react-from'thisrefForm = React{return<GotenForm===><div ='title'>TITLE</div><table><tbody><tr><th ='item'><GotenTextField========/></th><th ='item'><GotenTextField====/></th></tr></tbody></table><input='submit'='Validate Form'=/></GotenForm>}
Props
Prop Name | Type | Default | Required | Description |
---|---|---|---|---|
onSuccess | Function | True | This function is executed when all Goten components are validated correctly. | |
onError | Function | False | This function is executed when all Goten components are validated correctly. | |
buttonComponent | Component | False | Component that will be clicked. |
Methods
- validate()
Validate all Goten components inside the GotenForm.
Contributions
To contribute to this package, we propose the following workflow:
- Add an issue with related tags to describe the contribution (is it a bug?, a feature request?).
- Branch your solution from develop, with the name as
#<issue_number>_<descriptive_name>
. - Send a pull request and wait for approval/corrections.