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 PropTypes from 'prop-types';
|
7 | import elementType from 'prop-types-extra/lib/elementType';
|
8 | import Media from './Media';
|
9 | import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
|
10 | var propTypes = {
|
11 | |
12 |
|
13 |
|
14 | align: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
15 | componentClass: elementType
|
16 | };
|
17 | var defaultProps = {
|
18 | componentClass: 'div'
|
19 | };
|
20 |
|
21 | var MediaBody =
|
22 |
|
23 | function (_React$Component) {
|
24 | _inheritsLoose(MediaBody, _React$Component);
|
25 |
|
26 | function MediaBody() {
|
27 | return _React$Component.apply(this, arguments) || this;
|
28 | }
|
29 |
|
30 | var _proto = MediaBody.prototype;
|
31 |
|
32 | _proto.render = function render() {
|
33 | var _this$props = this.props,
|
34 | Component = _this$props.componentClass,
|
35 | align = _this$props.align,
|
36 | className = _this$props.className,
|
37 | props = _objectWithoutPropertiesLoose(_this$props, ["componentClass", "align", "className"]);
|
38 |
|
39 | var _splitBsProps = splitBsProps(props),
|
40 | bsProps = _splitBsProps[0],
|
41 | elementProps = _splitBsProps[1];
|
42 |
|
43 | var classes = getClassSet(bsProps);
|
44 |
|
45 | if (align) {
|
46 |
|
47 | classes[prefix(Media.defaultProps, align)] = true;
|
48 | }
|
49 |
|
50 | return React.createElement(Component, _extends({}, elementProps, {
|
51 | className: classNames(className, classes)
|
52 | }));
|
53 | };
|
54 |
|
55 | return MediaBody;
|
56 | }(React.Component);
|
57 |
|
58 | MediaBody.propTypes = propTypes;
|
59 | MediaBody.defaultProps = defaultProps;
|
60 | export default bsClass('media-body', MediaBody); |
\ | No newline at end of file |