@hw-component/table 1.9.78 → 1.9.79

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.
@@ -3,6 +3,7 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import copy from 'copy-to-clipboard';
4
4
  import { Typography, message } from 'antd';
5
5
  import { useClassName } from '../hooks/index.js';
6
+ import { useMemo } from 'react';
6
7
 
7
8
  var Paragraph = Typography.Paragraph;
8
9
  var CopyComponent = (function (_ref) {
@@ -11,8 +12,16 @@ var CopyComponent = (function (_ref) {
11
12
  successMsg = _ref.successMsg,
12
13
  ellipsis = _ref.ellipsis;
13
14
  var className = useClassName("hw-table-render-copy");
15
+ var propsEllipsis = useMemo(function () {
16
+ if (ellipsis === true) {
17
+ return {
18
+ tooltip: text
19
+ };
20
+ }
21
+ return ellipsis;
22
+ }, [ellipsis, text]);
14
23
  return jsx(Paragraph, {
15
- ellipsis: ellipsis,
24
+ ellipsis: propsEllipsis,
16
25
  className: className,
17
26
  style: {
18
27
  margin: 0,
@@ -6,6 +6,7 @@ var jsxRuntime = require('react/jsx-runtime');
6
6
  var copy = require('copy-to-clipboard');
7
7
  var antd = require('antd');
8
8
  var index = require('../hooks/index.js');
9
+ var React = require('react');
9
10
 
10
11
  var Paragraph = antd.Typography.Paragraph;
11
12
  var CopyComponent = (function (_ref) {
@@ -14,8 +15,16 @@ var CopyComponent = (function (_ref) {
14
15
  successMsg = _ref.successMsg,
15
16
  ellipsis = _ref.ellipsis;
16
17
  var className = index.useClassName("hw-table-render-copy");
18
+ var propsEllipsis = React.useMemo(function () {
19
+ if (ellipsis === true) {
20
+ return {
21
+ tooltip: text
22
+ };
23
+ }
24
+ return ellipsis;
25
+ }, [ellipsis, text]);
17
26
  return jsxRuntime.jsx(Paragraph, {
18
- ellipsis: ellipsis,
27
+ ellipsis: propsEllipsis,
19
28
  className: className,
20
29
  style: {
21
30
  margin: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/table",
3
- "version": "1.9.78",
3
+ "version": "1.9.79",
4
4
  "description": "基于antd二次开发table组件",
5
5
  "keywords": [
6
6
  "table"
@@ -20,7 +20,7 @@ export default ({ headerTitle, contentStyle, rNode }: IProps) => {
20
20
  }
21
21
  return (
22
22
  <Row justify={"space-between"} align={"middle"} style={contentStyle}>
23
- <div className={headerBox}>
23
+ <div className={headerBox} >
24
24
  <div className={headerBoxContent}>
25
25
  {headerTitle &&
26
26
  React.cloneElement(
@@ -2,6 +2,7 @@ import copy from "copy-to-clipboard";
2
2
  import { message, Typography } from "antd";
3
3
  import type { EllipsisConfig } from "antd/lib/typography/Base";
4
4
  import { useClassName } from "../hooks";
5
+ import {useMemo} from "react";
5
6
  const { Paragraph } = Typography;
6
7
  interface IProps {
7
8
  text: string;
@@ -11,9 +12,17 @@ interface IProps {
11
12
  }
12
13
  export default ({ cpText, text, successMsg, ellipsis }: IProps) => {
13
14
  const className = useClassName("hw-table-render-copy");
15
+ const propsEllipsis=useMemo(()=>{
16
+ if (ellipsis===true){
17
+ return {
18
+ tooltip:text
19
+ }
20
+ }
21
+ return ellipsis;
22
+ },[ellipsis,text]);
14
23
  return (
15
24
  <Paragraph
16
- ellipsis={ellipsis}
25
+ ellipsis={propsEllipsis}
17
26
  className={className}
18
27
  style={{ margin: 0, width: "100%", padding: 0 }}
19
28
  onClick={() => {