@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.
@@ -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, Tooltip } from 'antd';
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 content = props.content === null ? '' : props.content.toString();
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(content, rows, direction, expanded, expandNode, collapseNode),
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(Tooltip, {
95
+ return /*#__PURE__*/_jsx(Popover, {
94
96
  zIndex: 9999,
95
- title: function title() {
97
+ rootClassName: "ccs-ellipsis-tooltips",
98
+ content: function content() {
96
99
  return /*#__PURE__*/_jsxs(_Fragment, {
97
- children: [content, /*#__PURE__*/_jsx("div", {
100
+ children: [_content, /*#__PURE__*/_jsxs("a", {
98
101
  style: {
99
- textAlign: 'right'
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(Button, {
102
- icon: /*#__PURE__*/_jsx(CopyOutlined, {}),
103
- size: "small",
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: true,
118
+ placement: "bottomLeft"
119
+ // destroyTooltipOnHide
120
+ ,
116
121
  overlayInnerStyle: {
117
122
  whiteSpace: 'normal'
118
123
  },
@@ -3,3 +3,10 @@
3
3
  line-height: 1.5;
4
4
  word-break: break-word;
5
5
  }
6
+
7
+ .ccs-ellipsis-tooltips {
8
+ .ant-popover-inner {
9
+ max-height: 50%;
10
+ overflow: auto;
11
+ }
12
+ }
@@ -150,3 +150,9 @@
150
150
  }
151
151
  }
152
152
  }
153
+
154
+ .ccs-table-ellipsis {
155
+ overflow: hidden;
156
+ text-overflow: ellipsis;
157
+ white-space: nowrap;
158
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "2.3.6-beta-19",
3
+ "version": "2.3.6-beta-20",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": {