Comparing version 0.1.4 to 2.0.0
@@ -48,2 +48,3 @@ 'use strict'; | ||
var propTypes = { | ||
/*eslint-disable */ | ||
value: _propTypes2.default.any, | ||
@@ -117,2 +118,5 @@ defaultValue: _propTypes2.default.any, | ||
} | ||
/* istanbul ignore next */ | ||
}, { | ||
@@ -119,0 +123,0 @@ key: 'handleComposition', |
@@ -19,3 +19,3 @@ 'use strict'; | ||
var _elementType = require('./utils/elementType'); | ||
var _elementType = require('rsuite-utils/lib/propTypes/elementType'); | ||
@@ -22,0 +22,0 @@ var _elementType2 = _interopRequireDefault(_elementType); |
@@ -44,2 +44,3 @@ 'use strict'; | ||
inline: _propTypes2.default.bool, | ||
/*eslint-disable */ | ||
values: _propTypes2.default.object, | ||
@@ -180,4 +181,4 @@ defaultValues: _propTypes2.default.object, | ||
key: 'cleanErrors', | ||
value: function cleanErrors() { | ||
this.setState({}); | ||
value: function cleanErrors(callback) { | ||
this.setState({ errors: {} }, callback); | ||
} | ||
@@ -188,4 +189,5 @@ }, { | ||
var errors = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var callback = arguments[1]; | ||
this.setState({ errors: errors }); | ||
this.setState({ errors: errors }, callback); | ||
} | ||
@@ -192,0 +194,0 @@ |
{ | ||
"name": "form-lib", | ||
"version": "0.1.4", | ||
"version": "2.0.0", | ||
"description": "Form component for React", | ||
@@ -66,3 +66,3 @@ "main": "lib/index.js", | ||
"eslint-plugin-jsx-a11y": "^6.0.2", | ||
"eslint-plugin-react": "^7.1.0", | ||
"eslint-plugin-react": "^7.4.0", | ||
"expect": "^1.20.2", | ||
@@ -90,9 +90,11 @@ "extract-text-webpack-plugin": "^2.1.0", | ||
"react": "^0.14.9", | ||
"react-code-view": "^1.0.12", | ||
"react-dom": "^0.14.9", | ||
"react-hot-loader": "^3.0.0-beta.6", | ||
"react-markdown-reader": "^1.0.1", | ||
"rsuite": "1.1.3", | ||
"rsuite-affix": "^1.0.3", | ||
"rsuite-docs": "^0.2.2", | ||
"rsuite-schema": ">=0.0.4", | ||
"rsuite-selectpicker": "^1.0.0-beta.2", | ||
"rsuite-theme": "^0.3.35", | ||
"rsuite-selectpicker": "^1.0.1", | ||
"rsuite-theme": "^2.0.16", | ||
"sinon": "^1.17.4", | ||
@@ -99,0 +101,0 @@ "sinon-chai": "^2.8.0", |
@@ -7,2 +7,8 @@ # form-lib | ||
版本与状态 | ||
[![npm][npm-badge]][npm] [![Travis][build-badge]][build] | ||
`form-lib` 中主要提供了两个组件: `<Form>` 和 `<Field>`, `<Field>` 必须包含在 `<Form>` 内,例如: | ||
@@ -16,2 +22,3 @@ | ||
``` | ||
`<Form>` 提供了 `values` 和 `defaultValues` 为整个表单设置值,对应的分别是受控和非受控表单。 | ||
@@ -24,9 +31,25 @@ 同时提供了 `onChange` (数据发生改变时候触发) 和 `onCheck` (数据校验时候触发) 事件。 | ||
详细的使用,查看示例代码,和 [API文档](https://rsuitejs.com/form-lib/)。 | ||
------ | ||
安装 | ||
## 快速开始 | ||
### 安装 | ||
``` | ||
npm install form-lib --save | ||
npm i form-lib --save | ||
``` | ||
安装 `rsuite-schema` | ||
``` | ||
npm i rsuite-schema --save | ||
``` | ||
[npm-badge]: https://img.shields.io/npm/v/form-lib/version2.x.svg?style=flat-square | ||
[npm]: https://www.npmjs.com/package/form-lib | ||
[build-badge]: https://img.shields.io/badge/build-passing-green.svg?style=flat-square | ||
[build]: https://travis-ci.org/rsuite/form-lib | ||
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
53
30886
57
9
537