Available <Switch> in <Form/> component.
parent
afda33d321
commit
e787c74527
|
@ -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.|
|
||||
|
|
|
@ -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} />
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue