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 classNames from 'classnames';
|
12 | import { polyfill } from 'react-lifecycles-compat';
|
13 | import ConfigProvider from '../config-provider';
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | var ListItem = (_temp = _class = function (_Component) {
|
19 | _inherits(ListItem, _Component);
|
20 |
|
21 | function ListItem() {
|
22 | _classCallCheck(this, ListItem);
|
23 |
|
24 | return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
25 | }
|
26 |
|
27 | ListItem.prototype.render = function render() {
|
28 | var _props = this.props,
|
29 | prefix = _props.prefix,
|
30 | title = _props.title,
|
31 | description = _props.description,
|
32 | media = _props.media,
|
33 | extra = _props.extra,
|
34 | className = _props.className,
|
35 | children = _props.children,
|
36 | others = _objectWithoutProperties(_props, ['prefix', 'title', 'description', 'media', 'extra', 'className', 'children']);
|
37 |
|
38 | var classes = classNames(prefix + 'list-item', className);
|
39 |
|
40 | return React.createElement(
|
41 | 'li',
|
42 | _extends({}, others, { className: classes }),
|
43 | media ? React.createElement(
|
44 | 'div',
|
45 | { className: prefix + 'list-item-media' },
|
46 | media
|
47 | ) : null,
|
48 | React.createElement(
|
49 | 'div',
|
50 | { className: prefix + 'list-item-content' },
|
51 | title ? React.createElement(
|
52 | 'div',
|
53 | { className: prefix + 'list-item-title' },
|
54 | title
|
55 | ) : null,
|
56 | description ? React.createElement(
|
57 | 'div',
|
58 | { className: prefix + 'list-item-description' },
|
59 | description
|
60 | ) : null,
|
61 | children
|
62 | ),
|
63 | extra ? React.createElement(
|
64 | 'div',
|
65 | { className: prefix + 'list-item-extra' },
|
66 | extra
|
67 | ) : null
|
68 | );
|
69 | };
|
70 |
|
71 | return ListItem;
|
72 | }(Component), _class.propTypes = {
|
73 | prefix: PropTypes.string,
|
74 | |
75 |
|
76 |
|
77 | title: PropTypes.node,
|
78 | |
79 |
|
80 |
|
81 | description: PropTypes.node,
|
82 | |
83 |
|
84 |
|
85 | media: PropTypes.node,
|
86 | |
87 |
|
88 |
|
89 | extra: PropTypes.node,
|
90 | className: PropTypes.any
|
91 | }, _class.defaultProps = {
|
92 | prefix: 'next-'
|
93 | }, _temp);
|
94 | ListItem.displayName = 'ListItem';
|
95 |
|
96 |
|
97 | export default ConfigProvider.config(polyfill(ListItem)); |
\ | No newline at end of file |