1 | import _extends from 'babel-runtime/helpers/extends';
|
2 | import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
3 | import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
4 | import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
5 | import _inherits from 'babel-runtime/helpers/inherits';
|
6 |
|
7 | var _class, _temp;
|
8 |
|
9 | import React, { Component } from 'react';
|
10 | import PropTypes from 'prop-types';
|
11 | import CheckableItem from './checkable-item';
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | var CheckboxItem = (_temp = _class = function (_Component) {
|
19 | _inherits(CheckboxItem, _Component);
|
20 |
|
21 | function CheckboxItem() {
|
22 | _classCallCheck(this, CheckboxItem);
|
23 |
|
24 | return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
25 | }
|
26 |
|
27 | CheckboxItem.prototype.render = function render() {
|
28 | var _props = this.props,
|
29 | checkboxDisabled = _props.checkboxDisabled,
|
30 | others = _objectWithoutProperties(_props, ['checkboxDisabled']);
|
31 |
|
32 | return React.createElement(CheckableItem, _extends({
|
33 | role: 'menuitemcheckbox',
|
34 | checkType: 'checkbox',
|
35 | checkDisabled: checkboxDisabled
|
36 | }, others));
|
37 | };
|
38 |
|
39 | return CheckboxItem;
|
40 | }(Component), _class.menuChildType = 'item', _class.propTypes = {
|
41 | |
42 |
|
43 |
|
44 | checked: PropTypes.bool,
|
45 | |
46 |
|
47 |
|
48 | indeterminate: PropTypes.bool,
|
49 | |
50 |
|
51 |
|
52 | disabled: PropTypes.bool,
|
53 | |
54 |
|
55 |
|
56 |
|
57 |
|
58 | onChange: PropTypes.func,
|
59 | |
60 |
|
61 |
|
62 | helper: PropTypes.node,
|
63 | |
64 |
|
65 |
|
66 | children: PropTypes.node,
|
67 | checkboxDisabled: PropTypes.bool
|
68 | }, _class.defaultProps = {
|
69 | checked: false,
|
70 | indeterminate: false,
|
71 | disabled: false,
|
72 | onChange: function onChange() {},
|
73 | checkboxDisabled: false
|
74 | }, _temp);
|
75 | CheckboxItem.displayName = 'CheckboxItem';
|
76 | export { CheckboxItem as default }; |
\ | No newline at end of file |