Available <Switch> in <Form/> component.

old
Javi Jimenez Villar 2015-07-10 13:45:51 +07:00
parent afda33d321
commit e787c74527
2 changed files with 5 additions and 2 deletions

View File

@ -15,7 +15,7 @@ var fields : [
| Name | Type | Default | Description|
|:- |:-: | :- |:-|
| **attributes** | array | | Array of fields you want hold, fields can be instances of <Input/>, <Autocomplete>, <Dropdown> or <Button/>|
| **attributes** | array | | Array of fields you want hold, fields can be instances of <Autocomplete>, <Button/>, <Dropdown>, <Input/> or <Switch/> |
| **className** | String | | Set the class-styles of the Component.|
| **onChange** | Function | | Dispatch callback when values of the component changes.|
| **onError** | Function | | Dispatch callback when a required field is null or has incorrect type.|

View File

@ -3,6 +3,7 @@ Autocomplete = require "../autocomplete"
Dropdown = require "../dropdown"
Button = require "../button"
Input = require "../input"
Switch = require "../switch"
module.exports = React.createClass
@ -62,7 +63,9 @@ module.exports = React.createClass
else if attribute.type is "autocomplete"
<Autocomplete {...attribute} onChange={@onChange}/>
else if attribute.type is "dropdown"
<Dropdown {...attribute} />
<Dropdown {...attribute} onChange={@onChange}/>
else if attribute.type is "switch"
<Switch {...attribute} onChange={@onChange}/>
else
<Input {...attribute} />
}