1 | "use strict";
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports["default"] = ellipsis;
|
5 | function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | function ellipsis(width, lines) {
|
32 | if (lines === void 0) {
|
33 | lines = 1;
|
34 | }
|
35 | var styles = {
|
36 | display: 'inline-block',
|
37 | maxWidth: width || '100%',
|
38 | overflow: 'hidden',
|
39 | textOverflow: 'ellipsis',
|
40 | whiteSpace: 'nowrap',
|
41 | wordWrap: 'normal'
|
42 | };
|
43 | return lines > 1 ? _extends({}, styles, {
|
44 | WebkitBoxOrient: 'vertical',
|
45 | WebkitLineClamp: lines,
|
46 | display: '-webkit-box',
|
47 | whiteSpace: 'normal'
|
48 | }) : styles;
|
49 | }
|
50 | module.exports = exports.default; |
\ | No newline at end of file |