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 | import classNames from 'classnames';
|
7 | import React from 'react';
|
8 | import PropTypes from 'prop-types';
|
9 |
|
10 | import { bsClass, prefix, splitBsProps } from './utils/bootstrapUtils';
|
11 |
|
12 | var propTypes = {
|
13 | |
14 |
|
15 |
|
16 | responsive: PropTypes.bool,
|
17 |
|
18 | |
19 |
|
20 |
|
21 | rounded: PropTypes.bool,
|
22 |
|
23 | |
24 |
|
25 |
|
26 | circle: PropTypes.bool,
|
27 |
|
28 | |
29 |
|
30 |
|
31 | thumbnail: PropTypes.bool
|
32 | };
|
33 |
|
34 | var defaultProps = {
|
35 | responsive: false,
|
36 | rounded: false,
|
37 | circle: false,
|
38 | thumbnail: false
|
39 | };
|
40 |
|
41 | var Image = function (_React$Component) {
|
42 | _inherits(Image, _React$Component);
|
43 |
|
44 | function Image() {
|
45 | _classCallCheck(this, Image);
|
46 |
|
47 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
48 | }
|
49 |
|
50 | Image.prototype.render = function render() {
|
51 | var _classes;
|
52 |
|
53 | var _props = this.props,
|
54 | responsive = _props.responsive,
|
55 | rounded = _props.rounded,
|
56 | circle = _props.circle,
|
57 | thumbnail = _props.thumbnail,
|
58 | className = _props.className,
|
59 | props = _objectWithoutProperties(_props, ['responsive', 'rounded', 'circle', 'thumbnail', 'className']);
|
60 |
|
61 | var _splitBsProps = splitBsProps(props),
|
62 | bsProps = _splitBsProps[0],
|
63 | elementProps = _splitBsProps[1];
|
64 |
|
65 | var classes = (_classes = {}, _classes[prefix(bsProps, 'responsive')] = responsive, _classes[prefix(bsProps, 'rounded')] = rounded, _classes[prefix(bsProps, 'circle')] = circle, _classes[prefix(bsProps, 'thumbnail')] = thumbnail, _classes);
|
66 |
|
67 | return React.createElement('img', _extends({}, elementProps, {
|
68 | className: classNames(className, classes)
|
69 | }));
|
70 | };
|
71 |
|
72 | return Image;
|
73 | }(React.Component);
|
74 |
|
75 | Image.propTypes = propTypes;
|
76 | Image.defaultProps = defaultProps;
|
77 |
|
78 | export default bsClass('img', Image); |
\ | No newline at end of file |