1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4 |
|
5 | var _typeof = require("@babel/runtime/helpers/typeof");
|
6 |
|
7 | Object.defineProperty(exports, "__esModule", {
|
8 | value: true
|
9 | });
|
10 | exports["default"] = void 0;
|
11 |
|
12 | var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
13 |
|
14 | var React = _interopRequireWildcard(require("react"));
|
15 |
|
16 | var _classnames = _interopRequireDefault(require("classnames"));
|
17 |
|
18 | function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19 |
|
20 | function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21 |
|
22 | var Paragraph = function Paragraph(props) {
|
23 | var getWidth = function getWidth(index) {
|
24 | var width = props.width,
|
25 | _props$rows = props.rows,
|
26 | rows = _props$rows === void 0 ? 2 : _props$rows;
|
27 |
|
28 | if (Array.isArray(width)) {
|
29 | return width[index];
|
30 | }
|
31 |
|
32 |
|
33 | if (rows - 1 === index) {
|
34 | return width;
|
35 | }
|
36 |
|
37 | return undefined;
|
38 | };
|
39 |
|
40 | var prefixCls = props.prefixCls,
|
41 | className = props.className,
|
42 | style = props.style,
|
43 | rows = props.rows;
|
44 | var rowList = (0, _toConsumableArray2["default"])(Array(rows)).map(function (_, index) {
|
45 | return (
|
46 |
|
47 |
|
48 | React.createElement("li", {
|
49 | key: index,
|
50 | style: {
|
51 | width: getWidth(index)
|
52 | }
|
53 | })
|
54 | );
|
55 | });
|
56 | return React.createElement("ul", {
|
57 | className: (0, _classnames["default"])(prefixCls, className),
|
58 | style: style
|
59 | }, rowList);
|
60 | };
|
61 |
|
62 | var _default = Paragraph;
|
63 | exports["default"] = _default; |
\ | No newline at end of file |