1 | import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
2 | import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
3 | import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
4 | import classNames from 'classnames';
|
5 | import React from 'react';
|
6 | import elementType from 'prop-types-extra/lib/elementType';
|
7 | import MediaBody from './MediaBody';
|
8 | import MediaHeading from './MediaHeading';
|
9 | import MediaLeft from './MediaLeft';
|
10 | import MediaList from './MediaList';
|
11 | import MediaListItem from './MediaListItem';
|
12 | import MediaRight from './MediaRight';
|
13 | import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
14 | var propTypes = {
|
15 | componentClass: elementType
|
16 | };
|
17 | var defaultProps = {
|
18 | componentClass: 'div'
|
19 | };
|
20 |
|
21 | var Media =
|
22 |
|
23 | function (_React$Component) {
|
24 | _inheritsLoose(Media, _React$Component);
|
25 |
|
26 | function Media() {
|
27 | return _React$Component.apply(this, arguments) || this;
|
28 | }
|
29 |
|
30 | var _proto = Media.prototype;
|
31 |
|
32 | _proto.render = function render() {
|
33 | var _this$props = this.props,
|
34 | Component = _this$props.componentClass,
|
35 | className = _this$props.className,
|
36 | props = _objectWithoutPropertiesLoose(_this$props, ["componentClass", "className"]);
|
37 |
|
38 | var _splitBsProps = splitBsProps(props),
|
39 | bsProps = _splitBsProps[0],
|
40 | elementProps = _splitBsProps[1];
|
41 |
|
42 | var classes = getClassSet(bsProps);
|
43 | return React.createElement(Component, _extends({}, elementProps, {
|
44 | className: classNames(className, classes)
|
45 | }));
|
46 | };
|
47 |
|
48 | return Media;
|
49 | }(React.Component);
|
50 |
|
51 | Media.propTypes = propTypes;
|
52 | Media.defaultProps = defaultProps;
|
53 | Media.Heading = MediaHeading;
|
54 | Media.Body = MediaBody;
|
55 | Media.Left = MediaLeft;
|
56 | Media.Right = MediaRight;
|
57 | Media.List = MediaList;
|
58 | Media.ListItem = MediaListItem;
|
59 | export default bsClass('media', Media); |
\ | No newline at end of file |