forked from yuristrelets/react-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListCheckbox.js
More file actions
46 lines (41 loc) · 1.19 KB
/
ListCheckbox.js
File metadata and controls
46 lines (41 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import React from 'react';
import ClassNames from 'classnames';
import Checkbox from '../checkbox';
import ListItemContent from './ListItemContent';
import style from './style';
const ListCheckbox = (props) => {
const className = ClassNames([style.item, style.checkboxItem], {
[style.withLegend]: props.legend,
[style.disabled]: props.disabled
}, props.className);
return (
<li className={className}>
<Checkbox
checked={props.checked}
className={style.checkbox}
disabled={props.disabled}
label={<ListItemContent caption={props.caption} legend={props.legend} />}
name={props.name}
onBlur={props.onBlur}
onChange={props.onChange}
onFocus={props.onFocus}
/>
</li>
);
};
ListCheckbox.propTypes = {
caption: React.PropTypes.string.isRequired,
checked: React.PropTypes.bool,
className: React.PropTypes.string,
disabled: React.PropTypes.bool,
legend: React.PropTypes.string,
name: React.PropTypes.string,
onBlur: React.PropTypes.func,
onChange: React.PropTypes.func,
onFocus: React.PropTypes.func
};
ListCheckbox.defaultProps = {
checked: false,
disabled: false
};
export default ListCheckbox;