1
- import { Popover , Tooltip , Typography } from 'antd' ;
1
+ import { Popover , Typography } from 'antd' ;
2
2
import classNames from 'classnames' ;
3
3
import React , { memo , useMemo } from 'react' ;
4
4
import createIconFont from '../../utils/createIconFont' ;
@@ -18,7 +18,7 @@ export default memo((props: any) => {
18
18
hideDesc,
19
19
NodeWidget,
20
20
iconFontUrl,
21
- iconSvg
21
+ iconSvg,
22
22
} = props ;
23
23
const IconBox = useMemo ( ( ) => createIconFont ( iconFontUrl ) , [ iconFontUrl ] ) ;
24
24
return (
@@ -28,14 +28,16 @@ export default memo((props: any) => {
28
28
} ) }
29
29
onClick = { onClick }
30
30
>
31
- < div className = ' node-title' >
31
+ < div className = " node-title" >
32
32
< Popover
33
- title = { < MenuTooltip { ...props } /> }
34
- placement = 'bottomLeft'
35
- trigger = 'click'
36
- getPopupContainer = { ( ) => document . getElementById ( 'xflow-container' ) as HTMLElement }
33
+ content = { < MenuTooltip { ...props } /> }
34
+ placement = "bottomLeft"
35
+ trigger = "hover"
36
+ getPopupContainer = { ( ) =>
37
+ document . getElementById ( 'xflow-container' ) as HTMLElement
38
+ }
37
39
>
38
- < Tooltip
40
+ { /* <Tooltip
39
41
title='点击图标查看节点信息'
40
42
arrow={false}
41
43
placement='topLeft'
@@ -45,11 +47,11 @@ export default memo((props: any) => {
45
47
fontSize: '12px',
46
48
}}
47
49
getPopupContainer={() => document.getElementById('xflow-container') as HTMLElement}
48
- >
49
- < span className = ' icon-box' style = { { background : icon ?. bgColor } } >
50
- { iconSvg ? iconSvg : < IconBox { ...icon } /> }
51
- </ span >
52
- </ Tooltip >
50
+ > */ }
51
+ < span className = " icon-box" style = { { background : icon ?. bgColor } } >
52
+ { iconSvg ? iconSvg : < IconBox { ...icon } /> }
53
+ </ span >
54
+ { /* </Tooltip> */ }
53
55
</ Popover >
54
56
< Text
55
57
style = { { width : 188 , marginLeft : '8px' } }
@@ -62,16 +64,17 @@ export default memo((props: any) => {
62
64
color : '#354052' ,
63
65
fontSize : '12px' ,
64
66
} ,
65
- getPopupContainer :( ) => document . getElementById ( 'xflow-container' ) as HTMLElement
67
+ getPopupContainer : ( ) =>
68
+ document . getElementById ( 'xflow-container' ) as HTMLElement ,
66
69
} ,
67
70
} }
68
71
>
69
72
{ title }
70
73
</ Text >
71
74
</ div >
72
75
73
- < div className = ' node-body' > { children } </ div >
74
- { NodeWidget && < div className = ' node-widget' > { NodeWidget } </ div > }
76
+ < div className = " node-body" > { children } </ div >
77
+ { NodeWidget && < div className = " node-widget" > { NodeWidget } </ div > }
75
78
{ ! hideDesc && ! ! desc && (
76
79
< Paragraph
77
80
ellipsis = { {
@@ -84,10 +87,11 @@ export default memo((props: any) => {
84
87
color : '#354052' ,
85
88
fontSize : '12px' ,
86
89
} ,
87
- getPopupContainer : ( ) => document . getElementById ( 'xflow-container' ) as HTMLElement
90
+ getPopupContainer : ( ) =>
91
+ document . getElementById ( 'xflow-container' ) as HTMLElement ,
88
92
} ,
89
93
} }
90
- className = ' node-desc'
94
+ className = " node-desc"
91
95
>
92
96
{ desc }
93
97
</ Paragraph >
0 commit comments