@ccs-ui/rc-pro 2.3.6-beta-18 → 2.3.6-beta-19
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 +9 -11
- 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 { Button,
|
|
9
|
+
import { Button, Tooltip } from 'antd';
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import CcsDialog from "../dialog";
|
|
12
12
|
import "./index.less";
|
|
@@ -14,6 +14,7 @@ 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";
|
|
17
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
19
|
var classPrefix = "ccs-ellipsis";
|
|
19
20
|
var defaultProps = {
|
|
@@ -43,7 +44,7 @@ var CcsEllipsis = function CcsEllipsis(p) {
|
|
|
43
44
|
onContentClick = props.onContentClick,
|
|
44
45
|
defaultExpanded = props.defaultExpanded,
|
|
45
46
|
showTooltip = props.showTooltip;
|
|
46
|
-
var
|
|
47
|
+
var content = props.content === null ? '' : props.content.toString();
|
|
47
48
|
|
|
48
49
|
// ============================ Refs ============================
|
|
49
50
|
var rootRef = React.useRef(null);
|
|
@@ -67,7 +68,7 @@ var CcsEllipsis = function CcsEllipsis(p) {
|
|
|
67
68
|
})) : null;
|
|
68
69
|
|
|
69
70
|
// ========================== Ellipsis ==========================
|
|
70
|
-
var _useMeasure = useMeasure(
|
|
71
|
+
var _useMeasure = useMeasure(content, rows, direction, expanded, expandNode, collapseNode),
|
|
71
72
|
_useMeasure2 = _slicedToArray(_useMeasure, 3),
|
|
72
73
|
measureNodes = _useMeasure2[0],
|
|
73
74
|
status = _useMeasure2[1],
|
|
@@ -89,14 +90,11 @@ var CcsEllipsis = function CcsEllipsis(p) {
|
|
|
89
90
|
return renderNode;
|
|
90
91
|
}
|
|
91
92
|
if (showTooltip) {
|
|
92
|
-
return /*#__PURE__*/_jsx(
|
|
93
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
93
94
|
zIndex: 9999,
|
|
94
|
-
|
|
95
|
-
return /*#__PURE__*/_jsxs(
|
|
96
|
-
|
|
97
|
-
maxWidth: 300
|
|
98
|
-
},
|
|
99
|
-
children: [_content, /*#__PURE__*/_jsx("div", {
|
|
95
|
+
title: function title() {
|
|
96
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
97
|
+
children: [content, /*#__PURE__*/_jsx("div", {
|
|
100
98
|
style: {
|
|
101
99
|
textAlign: 'right'
|
|
102
100
|
},
|
|
@@ -106,7 +104,7 @@ var CcsEllipsis = function CcsEllipsis(p) {
|
|
|
106
104
|
type: "link",
|
|
107
105
|
onClick: function onClick() {
|
|
108
106
|
var _CcsDialog$message;
|
|
109
|
-
CcsUtils.copy(
|
|
107
|
+
CcsUtils.copy(content);
|
|
110
108
|
(_CcsDialog$message = CcsDialog.message) === null || _CcsDialog$message === void 0 || _CcsDialog$message.info('复制成功');
|
|
111
109
|
}
|
|
112
110
|
})
|