{"name":"rc-form-validation","version":"0.3.0","description":"form-validation ui component for react","keywords":["react","react-component","react-form-validation","form-validation"],"homepage":"http://github.com/react-component/form-validation","author":{"name":"yiminghe@gmail.com"},"repository":{"type":"git","url":"git@github.com:react-component/form-validation.git"},"bugs":{"url":"http://github.com/react-component/form-validation/issues"},"licenses":"MIT","spm":{"dependencies":{"react":"~0.12.2"},"devDependencies":{"gregorian-calendar-format":"^2.1.1","rc-calendar":"^1.5.3"}},"config":{"port":8010},"scripts":{"less":"rc-tools run less","history":"rc-tools run history","start":"node --harmony node_modules/.bin/rc-server","publish":"rc-tools run tag && spm publish && spm doc publish","lint":"rc-tools run lint","test":"","saucelabs":"rc-tools run saucelabs","browser-test":"rc-tools run browser-test","browser-test-cover":"rc-tools run browser-test-cover"},"devDependencies":{"expect.js":"~0.3.1","gregorian-calendar-format":"^2.1.1","precommit-hook":"^1.0.7","rc-calendar":"^1.5.3","rc-server":"^1.5.4","rc-tools":"^1.1.3","react":"~0.12.1"},"precommit":["lint","less"],"browserify-shim":{"react":"global:React","jquery":"global:jQuery"},"browserify":{"transform":[["browserify-jsx"],["browserify-shim"]]},"dependencies":{"browserify-jsx":"^0.1.0","browserify-shim":"^3.8.0"},"gitHead":"63cfe492e0d28eada1adf88c6188602be2354c09","_id":"rc-form-validation@0.3.0","_shasum":"01d8cb91f0358388ad0e1ea8f498feaeb098da19","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"yiminghe","email":"yiminghe@gmail.com"},"maintainers":[{"name":"yiminghe","email":"yiminghe@gmail.com"}],"dist":{"shasum":"01d8cb91f0358388ad0e1ea8f498feaeb098da19","tarball":"http://registry-npm.ywwl.com/rc-form-validation/download/rc-form-validation-0.3.0.tgz","integrity":"sha512-DC8M4B+GBCD/lw119HLxFCpoAtZfnnRJtBC+2+XL5eZXN6kRiaIIKuq7/DZdhyuRXPCcTQX4jaOILz/Ipel/Dg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCc/8rE43ZMtGmCWs1utGxZNzg+DFf9MxFCxyGW3iNQ2AIgYfBwx3Wx5ovo/c1ZmqvoGYZSzQetr4qnfJgCMh9nnB8="}],"size":13846,"noattachment":false,"key":"/rc-form-validation/-/rc-form-validation-0.3.0.tgz"},"directories":{},"readme":"# rc-form-validation\n---\n\nFormValidation For React.\n\n[![NPM version][npm-image]][npm-url]\n[![SPM version](http://spmjs.io/badge/rc-form-validation)](http://spmjs.io/package/rc-form-validation)\n[![build status][travis-image]][travis-url]\n[![Coverage Status](https://coveralls.io/repos/react-component/form-validation/badge.svg)](https://coveralls.io/r/react-component/form-validation)\n[![gemnasium deps][gemnasium-image]][gemnasium-url]\n[![node version][node-image]][node-url]\n[![npm download][download-image]][download-url]\n[![Sauce Test Status](https://saucelabs.com/buildstatus/rc-form-validation)](https://saucelabs.com/u/rc-form-validation)\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/rc-form-validation.svg)](https://saucelabs.com/u/rc-form-validation)\n\n[npm-image]: http://img.shields.io/npm/v/rc-form-validation.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/rc-form-validation\n[travis-image]: https://img.shields.io/travis/react-component/form-validation.svg?style=flat-square\n[travis-url]: https://travis-ci.org/react-component/form-validation\n[gemnasium-image]: http://img.shields.io/gemnasium/react-component/form-validation.svg?style=flat-square\n[gemnasium-url]: https://gemnasium.com/react-component/form-validation\n[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square\n[node-url]: http://nodejs.org/download/\n[download-image]: https://img.shields.io/npm/dm/rc-form-validation.svg?style=flat-square\n[download-url]: https://npmjs.org/package/rc-form-validation\n\n## Feature\n\n* support ie8,ie8+,chrome,firefox,safari\n\n## install\n\n[![rc-form-validation](https://nodei.co/npm/rc-form-validation.png)](https://npmjs.org/package/rc-form-validation)\n\n## Usage\n\n```js\nvar Validation = require('../');\nvar Validator = Validation.Validator;\nReact.render(<Validation ref='validation' onValidate={this.onValidate}>\n        <Validator ref='validator' rules={[{type: 'string', min: 5, max: 10}, {validator: validateInput}]}>\n          <input name=\"name\" value={state.formData.name.value} ref=\"input\" onChange={this.onInputChange}/>\n        </Validator>\n        <Validator rules={[{type: 'string', required:true, whitespace:true}]}>\n          <input name=\"pass\" value={state.formData.pass.value}/>\n        </Validator>\n      {state.formData.name.errors && state.formData.name.errors.length ? <div ref='error'>{state.formData.name.errors.join(',')}</div> : null}\n        {state.formData.pass.errors && state.formData.pass.errors.length ? <div ref='error2'>{state.formData.pass.errors.join(',')}</div> : null}\n      </Validation>,container);\n```\n\n## API\n\n### Validation\n\n#### props\n\n<table class=\"table table-bordered table-striped\">\n    <thead>\n    <tr>\n        <th style=\"width: 100px;\">name</th>\n        <th style=\"width: 50px;\">type</th>\n        <th style=\"width: 50px;\">default</th>\n        <th>description</th>\n    </tr>\n    </thead>\n    <tbody>\n        <tr>\n          <td>onValidate</td>\n          <td>Function</td>\n          <td></td>\n          <td>called when validator inside it starts to validate</td>\n        </tr>\n    </tbody>\n</table>\n\n#### methods\n\n- validate(callback:function): validate all fields, call callback with isValid as parameter\n- reset: reset validation to initial state, used for form reset\n- forceValidate(fields:String[],callback:Function): validate specified fields, call callback with isValid as parameter. fields is component's name which is wrapped by Validator\n\n\n### Validator\n\nValidator 's children must be one component which support trigger handler and value/name prop such as <input />\n\n#### props\n\n<table class=\"table table-bordered table-striped\">\n    <thead>\n    <tr>\n        <th style=\"width: 100px;\">name</th>\n        <th style=\"width: 50px;\">type</th>\n        <th style=\"width: 50px;\">default</th>\n        <th>description</th>\n    </tr>\n    </thead>\n    <tbody>\n        <tr>\n          <td>rules</td>\n          <td>Object|Array</td>\n          <td></td>\n          <td>see https://github.com/yiminghe/async-validator .\n          for example: {type:'string',min:4},[{type:'string',whitespace:true,required:true},{validator:validateFn}] </td>\n        </tr>\n        <tr>\n          <td>trigger</td>\n          <td>String</td>\n          <td>onChange</td>\n          <td>when to validate</td>\n        </tr>\n    </tbody>\n</table>\n\n### mixins\n\nValidation.FieldMixin\n\nprovide the following methods:\n\n#### setField\n\nsync individual field which does not need validation\n\n#### handleValidate\n\nused as value for onValidate props of Validation\n\n## Development\n\n```\nnpm install\nnpm start\n```\n\n## Example\n\nhttp://localhost:8010/examples/\n\nonline example: http://react-component.github.io/form-validation/examples/\n\n## Test Case\n\nhttp://localhost:8010/tests/runner.html?coverage\n\n## Coverage\n\nhttp://localhost:8010/node_modules/rc-server/node_modules/node-jscover/lib/front-end/jscoverage.html?w=http://localhost:8010/tests/runner.html?coverage\n\n## License\n\nrc-form-validation is released under the MIT license.\n","publish_time":1423485399374,"_cnpm_publish_time":1423485399374,"dist-tags":{"latest":"2.5.0"}}