Gathering detailed insights and metrics for rc-mobx-form
Gathering detailed insights and metrics for rc-mobx-form
Gathering detailed insights and metrics for rc-mobx-form
Gathering detailed insights and metrics for rc-mobx-form
npm install rc-mobx-form
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
8 Stars
38 Commits
1 Forks
2 Watching
2 Branches
1 Contributors
Updated on 02 Feb 2019
JavaScript (81.08%)
CSS (18.92%)
HTML (0.01%)
Cumulative downloads
Total Downloads
Last day
0%
3
Compared to previous day
Last week
-68.4%
6
Compared to previous week
Last month
300%
44
Compared to previous month
Last year
-28.4%
247
Compared to previous year
5
1
Inspiration from rc-form
Depend on react, mobx and async-validator.
npm i -S rc-mobx-form
1import { createForm, FormItem, setInternalFormItem } from 'rc-mobx-form' 2 3// if you use ant-design 4import { Form } from 'antd' 5setInternalFormItem(Form.Item) 6 7// if not, you can implement FormItem instead of default FormItem (see implementation of /src/FormItem.js) 8import FormItem from 'your-implement-form-item'
1import { observer } from 'mobx-react' 2 3// below is almost same with rc-form, @observer is necessary 4@observer 5class MyForm extend Component { 6 handleSubmit = (e) => { 7 e.preventDefault(); 8 this.props.form.validateFields(fields => console.log('error', fields)) 9 .then((values) => console.log('success', values)) 10 } 11 12 render() { 13 const { getFieldProps } = this.props.form 14 return ( 15 <Form onSubmit={this.handleSubmit}> 16 <FormItem hasFeedback> 17 <Input 18 {...getFieldProps('nest.input', { 19 rules: { required: true, message: 'Please input something!' }, 20 validateTrigger: 'onBlur', 21 })} 22 placeholder="Input here" 23 /> 24 </FormItem> 25 <Button type="primary" htmlType="submit">Submit</Button> 26 </Form> 27 ) 28 } 29} 30 31const WrappedForm = createForm()(MyForm) 32 33render(<WrappedForm />, targetEl)
you can also pass a store to WrappedForm
1import { observable } from 'mobx' 2 3class DemoForm { 4 @observable nest = { input: '' } 5 6 get __options() { 7 // you can set options at here 8 return { 9 'nest.input': { 10 rules: { required: true, message: 'Please input something!' }, 11 validateTrigger: 'onBlur', 12 appendProps: { 13 placeholder: 'Input here', 14 }, 15 } 16 } 17 } 18} 19 20// if you set the __options, the above MyForm's render() look like 21render() { 22 const { getFieldProps } = this.props.form 23 return ( 24 <Form onSubmit={this.handleSubmit}> 25 <FormItem hasFeedback> 26 <Input {...getFieldProps('nest.input')} /> 27 </FormItem> 28 <Button type="primary" htmlType="submit">Submit</Button> 29 </Form> 30 ) 31} 32 33// and you need to pass store to WrappedForm 34render(<WrappedForm store={new DemoForm()} />, targetEl)
see ant-design's doc but something different:
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
108 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More