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 from 'react';
|
10 | import PropTypes from 'prop-types';
|
11 | import classNames from 'classnames';
|
12 | import ConfigProvider from '../config-provider';
|
13 | import { log } from '../util';
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | var Paragraph = (_temp = _class = function (_React$Component) {
|
19 | _inherits(Paragraph, _React$Component);
|
20 |
|
21 | function Paragraph(props) {
|
22 | _classCallCheck(this, Paragraph);
|
23 |
|
24 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
25 |
|
26 | log.warning('[Paragraph] is deprecated, please use Typography.Paragraph instead!');
|
27 | return _this;
|
28 | }
|
29 |
|
30 | Paragraph.prototype.render = function render() {
|
31 | var _props = this.props,
|
32 | prefix = _props.prefix,
|
33 | className = _props.className,
|
34 | type = _props.type,
|
35 | size = _props.size,
|
36 | rtl = _props.rtl,
|
37 | others = _objectWithoutProperties(_props, ['prefix', 'className', 'type', 'size', 'rtl']);
|
38 |
|
39 | var cls = classNames(prefix + 'paragraph', type === 'short' ? prefix + 'paragraph-short' : prefix + 'paragraph-long', size === 'small' ? prefix + 'paragraph-small' : prefix + 'paragraph-medium', className);
|
40 | if (rtl) {
|
41 | others.dir = 'rtl';
|
42 | }
|
43 |
|
44 | return React.createElement(
|
45 | 'div',
|
46 | _extends({}, others, { className: cls }),
|
47 | this.props.children
|
48 | );
|
49 | };
|
50 |
|
51 | return Paragraph;
|
52 | }(React.Component), _class.propTypes = {
|
53 | prefix: PropTypes.string,
|
54 | |
55 |
|
56 |
|
57 | className: PropTypes.string,
|
58 | |
59 |
|
60 |
|
61 |
|
62 | type: PropTypes.oneOf(['long', 'short']),
|
63 | |
64 |
|
65 |
|
66 |
|
67 | size: PropTypes.oneOf(['medium', 'small']),
|
68 | rtl: PropTypes.bool
|
69 | }, _class.defaultProps = {
|
70 | prefix: 'next-',
|
71 | type: 'long',
|
72 | size: 'medium'
|
73 | }, _temp);
|
74 | Paragraph.displayName = 'Paragraph';
|
75 |
|
76 |
|
77 | export default ConfigProvider.config(Paragraph); |
\ | No newline at end of file |