@ccs-ui/rc-pro 2.3.6-beta-20 → 2.3.6-beta-22
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
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 { theme, Tooltip } from 'antd';
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import CcsDialog from "../dialog";
|
|
12
12
|
import "./index.less";
|
|
@@ -46,7 +46,7 @@ var CcsEllipsis = function CcsEllipsis(p) {
|
|
|
46
46
|
onContentClick = props.onContentClick,
|
|
47
47
|
defaultExpanded = props.defaultExpanded,
|
|
48
48
|
showTooltip = props.showTooltip;
|
|
49
|
-
var
|
|
49
|
+
var content = props.content === null ? '' : props.content.toString();
|
|
50
50
|
|
|
51
51
|
// ============================ Refs ============================
|
|
52
52
|
var rootRef = React.useRef(null);
|
|
@@ -70,7 +70,7 @@ var CcsEllipsis = function CcsEllipsis(p) {
|
|
|
70
70
|
})) : null;
|
|
71
71
|
|
|
72
72
|
// ========================== Ellipsis ==========================
|
|
73
|
-
var _useMeasure = useMeasure(
|
|
73
|
+
var _useMeasure = useMeasure(content, rows, direction, expanded, expandNode, collapseNode),
|
|
74
74
|
_useMeasure2 = _slicedToArray(_useMeasure, 3),
|
|
75
75
|
measureNodes = _useMeasure2[0],
|
|
76
76
|
status = _useMeasure2[1],
|
|
@@ -92,19 +92,18 @@ var CcsEllipsis = function CcsEllipsis(p) {
|
|
|
92
92
|
return renderNode;
|
|
93
93
|
}
|
|
94
94
|
if (showTooltip) {
|
|
95
|
-
return /*#__PURE__*/_jsx(
|
|
95
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
96
96
|
zIndex: 9999,
|
|
97
|
-
|
|
98
|
-
content: function content() {
|
|
97
|
+
title: function title() {
|
|
99
98
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
100
|
-
children: [
|
|
99
|
+
children: [content, /*#__PURE__*/_jsxs("a", {
|
|
101
100
|
style: {
|
|
102
101
|
color: token.colorPrimary,
|
|
103
102
|
display: 'block'
|
|
104
103
|
},
|
|
105
104
|
onClick: function onClick() {
|
|
106
105
|
var _CcsDialog$message;
|
|
107
|
-
CcsUtils.copy(
|
|
106
|
+
CcsUtils.copy(content);
|
|
108
107
|
(_CcsDialog$message = CcsDialog.message) === null || _CcsDialog$message === void 0 || _CcsDialog$message.info('复制成功');
|
|
109
108
|
},
|
|
110
109
|
children: [/*#__PURE__*/_jsx(CopyOutlined, {
|
|
@@ -115,9 +114,8 @@ var CcsEllipsis = function CcsEllipsis(p) {
|
|
|
115
114
|
})]
|
|
116
115
|
});
|
|
117
116
|
},
|
|
118
|
-
placement: "bottomLeft"
|
|
119
|
-
|
|
120
|
-
,
|
|
117
|
+
placement: "bottomLeft",
|
|
118
|
+
destroyTooltipOnHide: true,
|
|
121
119
|
overlayInnerStyle: {
|
|
122
120
|
whiteSpace: 'normal'
|
|
123
121
|
},
|
package/es/ellipsis/index.less
CHANGED
|
@@ -117,6 +117,11 @@ export default function CcsSelectCustomize(_ref) {
|
|
|
117
117
|
width: contentWidth,
|
|
118
118
|
onCancel: onClose,
|
|
119
119
|
footer: null,
|
|
120
|
+
styles: {
|
|
121
|
+
body: {
|
|
122
|
+
padding: 0
|
|
123
|
+
}
|
|
124
|
+
},
|
|
120
125
|
children: [children && /*#__PURE__*/React.cloneElement(children, {
|
|
121
126
|
value: value,
|
|
122
127
|
onClose: onClose,
|