forked from muicss/mui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathradio.jsx
More file actions
62 lines (51 loc) · 1.14 KB
/
radio.jsx
File metadata and controls
62 lines (51 loc) · 1.14 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* MUI React radio module
* @module react/radio
*/
'use strict';
import React from 'react';
const PropTypes = React.PropTypes;
/**
* Radio constructor
* @class
*/
class Radio extends React.Component {
static propTypes = {
label: PropTypes.string
};
static defaultProps = {
className: '',
label: null
};
render() {
const { children, className, label, autoFocus, checked, defaultChecked,
defaultValue, disabled, form, name, required, value, onChange,
...reactProps } = this.props;
return (
<div
{ ...reactProps }
className={'mui-radio ' + className}
>
<label>
<input
ref="inputEl"
type="radio"
autoFocus={autoFocus}
checked={checked}
defaultChecked={defaultChecked}
defaultValue={defaultValue}
disabled={disabled}
form={form}
name={name}
required={required}
value={value}
onChange={onChange}
/>
{label}
</label>
</div>
);
}
}
/** Define module API */
export default Radio;