1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.hexToRgb = hexToRgb;
|
7 | exports.expandBorderStyles = expandBorderStyles;
|
8 | exports.ellipsisText = void 0;
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | function hexToRgb() {
|
17 | var hex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
18 | var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '1';
|
19 | var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
20 | hex = hex.replace(shorthandRegex, function (m, r, g, b) {
|
21 | return r + r + g + g + b + b;
|
22 | });
|
23 | var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
24 | return result ? "rgba(".concat(parseInt(result[1], 16), ", ").concat(parseInt(result[2], 16), ", ").concat(parseInt(result[3], 16), ", ").concat(alpha, ")") : null;
|
25 | }
|
26 |
|
27 | var ellipsisText = {
|
28 | overflow: 'hidden',
|
29 | textOverflow: 'ellipsis',
|
30 | whiteSpace: 'nowrap',
|
31 | wordWrap: 'normal'
|
32 | };
|
33 | exports.ellipsisText = ellipsisText;
|
34 |
|
35 | function expandBorderStyles(borderStyles) {
|
36 | return {
|
37 | borderTopWidth: borderStyles.borderWidth,
|
38 | borderTopStyle: borderStyles.borderStyle,
|
39 | borderTopColor: borderStyles.borderColor,
|
40 | borderBottomWidth: borderStyles.borderWidth,
|
41 | borderBottomStyle: borderStyles.borderStyle,
|
42 | borderBottomColor: borderStyles.borderColor,
|
43 | borderLeftWidth: borderStyles.borderWidth,
|
44 | borderLeftStyle: borderStyles.borderStyle,
|
45 | borderLeftColor: borderStyles.borderColor,
|
46 | borderRightWidth: borderStyles.borderWidth,
|
47 | borderRightStyle: borderStyles.borderStyle,
|
48 | borderRightColor: borderStyles.borderColor
|
49 | };
|
50 | } |
\ | No newline at end of file |