@ccs-ui/rc-pro 2.3.6-beta-19 → 2.3.6-beta-20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ellipsis/index.js +24 -19
- package/es/ellipsis/index.less +7 -0
- package/es/table/index.less +6 -0
- package/package.json +1 -1
package/es/ellipsis/index.js
CHANGED
|
@@ -6,7 +6,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { CopyOutlined } from '@ant-design/icons';
|
|
8
8
|
import CcsUtils from '@ccs-ui/utils';
|
|
9
|
-
import {
|
|
9
|
+
import { Popover, theme } from 'antd';
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import CcsDialog from "../dialog";
|
|
12
12
|
import "./index.less";
|
|
@@ -14,8 +14,8 @@ import useMeasure from "./useMeasure";
|
|
|
14
14
|
import { useResizeEffect } from "./useResizeEffect";
|
|
15
15
|
import { withStopPropagation } from "./withStopPropagation";
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
19
|
var classPrefix = "ccs-ellipsis";
|
|
20
20
|
var defaultProps = {
|
|
21
21
|
direction: 'end',
|
|
@@ -36,6 +36,8 @@ var defaultProps = {
|
|
|
36
36
|
*/
|
|
37
37
|
var CcsEllipsis = function CcsEllipsis(p) {
|
|
38
38
|
var props = CcsUtils.mergeProps(defaultProps, p);
|
|
39
|
+
var _theme$useToken = theme.useToken(),
|
|
40
|
+
token = _theme$useToken.token;
|
|
39
41
|
var direction = props.direction,
|
|
40
42
|
rows = props.rows,
|
|
41
43
|
expandText = props.expandText,
|
|
@@ -44,7 +46,7 @@ var CcsEllipsis = function CcsEllipsis(p) {
|
|
|
44
46
|
onContentClick = props.onContentClick,
|
|
45
47
|
defaultExpanded = props.defaultExpanded,
|
|
46
48
|
showTooltip = props.showTooltip;
|
|
47
|
-
var
|
|
49
|
+
var _content = props.content === null ? '' : props.content.toString();
|
|
48
50
|
|
|
49
51
|
// ============================ Refs ============================
|
|
50
52
|
var rootRef = React.useRef(null);
|
|
@@ -68,7 +70,7 @@ var CcsEllipsis = function CcsEllipsis(p) {
|
|
|
68
70
|
})) : null;
|
|
69
71
|
|
|
70
72
|
// ========================== Ellipsis ==========================
|
|
71
|
-
var _useMeasure = useMeasure(
|
|
73
|
+
var _useMeasure = useMeasure(_content, rows, direction, expanded, expandNode, collapseNode),
|
|
72
74
|
_useMeasure2 = _slicedToArray(_useMeasure, 3),
|
|
73
75
|
measureNodes = _useMeasure2[0],
|
|
74
76
|
status = _useMeasure2[1],
|
|
@@ -90,29 +92,32 @@ var CcsEllipsis = function CcsEllipsis(p) {
|
|
|
90
92
|
return renderNode;
|
|
91
93
|
}
|
|
92
94
|
if (showTooltip) {
|
|
93
|
-
return /*#__PURE__*/_jsx(
|
|
95
|
+
return /*#__PURE__*/_jsx(Popover, {
|
|
94
96
|
zIndex: 9999,
|
|
95
|
-
|
|
97
|
+
rootClassName: "ccs-ellipsis-tooltips",
|
|
98
|
+
content: function content() {
|
|
96
99
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
97
|
-
children: [
|
|
100
|
+
children: [_content, /*#__PURE__*/_jsxs("a", {
|
|
98
101
|
style: {
|
|
99
|
-
|
|
102
|
+
color: token.colorPrimary,
|
|
103
|
+
display: 'block'
|
|
104
|
+
},
|
|
105
|
+
onClick: function onClick() {
|
|
106
|
+
var _CcsDialog$message;
|
|
107
|
+
CcsUtils.copy(_content);
|
|
108
|
+
(_CcsDialog$message = CcsDialog.message) === null || _CcsDialog$message === void 0 || _CcsDialog$message.info('复制成功');
|
|
100
109
|
},
|
|
101
|
-
children: /*#__PURE__*/_jsx(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
type: "link",
|
|
105
|
-
onClick: function onClick() {
|
|
106
|
-
var _CcsDialog$message;
|
|
107
|
-
CcsUtils.copy(content);
|
|
108
|
-
(_CcsDialog$message = CcsDialog.message) === null || _CcsDialog$message === void 0 || _CcsDialog$message.info('复制成功');
|
|
110
|
+
children: [/*#__PURE__*/_jsx(CopyOutlined, {
|
|
111
|
+
style: {
|
|
112
|
+
marginRight: 5
|
|
109
113
|
}
|
|
110
|
-
})
|
|
114
|
+
}), "\u590D\u5236"]
|
|
111
115
|
})]
|
|
112
116
|
});
|
|
113
117
|
},
|
|
114
|
-
placement: "bottomLeft"
|
|
115
|
-
destroyTooltipOnHide
|
|
118
|
+
placement: "bottomLeft"
|
|
119
|
+
// destroyTooltipOnHide
|
|
120
|
+
,
|
|
116
121
|
overlayInnerStyle: {
|
|
117
122
|
whiteSpace: 'normal'
|
|
118
123
|
},
|
package/es/ellipsis/index.less
CHANGED
package/es/table/index.less
CHANGED