tntd 1.4.21 → 1.4.23

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.
@@ -54,6 +54,26 @@ const Demo = props => {
54
54
  <a>查看</a>
55
55
  <a>编辑</a>
56
56
  <a>测试</a>
57
+ {
58
+ false &&
59
+ <a>导入</a>
60
+ }
61
+ <a>导出</a>
62
+ <Popconfirm
63
+ title="Are you sure delete this task?"
64
+ onConfirm={void 0}
65
+ onCancel={void 0}
66
+ okText="Yes"
67
+ cancelText="No"
68
+ onClick={e => e.stopPropagation()}
69
+ getPopupContainer={trigger => trigger.parentNode}
70
+ trigger="hover"
71
+ overlayStyle={{
72
+ width: 300
73
+ }}
74
+ >
75
+ <a>Delete</a>
76
+ </Popconfirm>
57
77
  </Handle>
58
78
  )
59
79
  }
@@ -1,4 +1,4 @@
1
- import { Fragment } from 'react';
1
+ import React, { Fragment } from 'react';
2
2
  import { Dropdown, Menu, Divider } from 'antd';
3
3
  import { getText, getLanguage } from '../locale';
4
4
  import Icon from '../Icon';
@@ -7,7 +7,7 @@ import './index.less';
7
7
  const clsPrefix = 'tnt-more-menus';
8
8
 
9
9
  export default props => {
10
- const { children = [], type, num = 3, divider = true, lessOneMoreFit, ...rest } = props || {};
10
+ const { children = [], type, num = 3, divider = true, lessOneMoreFit, popConfirmHandle, ...rest } = props || {};
11
11
  let { lang } = props||{};
12
12
  if(!lang){
13
13
  lang = getLanguage();
@@ -19,6 +19,22 @@ export default props => {
19
19
  newChildren.push(children);
20
20
  }
21
21
 
22
+ if(lang === 'en' || popConfirmHandle){
23
+ newChildren?.forEach((v,i)=>{
24
+ const { type, props } = v;
25
+ if(type?.name === 'Popconfirm' || (props.hasOwnProperty('onConfirm') && typeof props?.onConfirm === 'function')){
26
+ newChildren[i]= React.cloneElement(v, {
27
+ overlayStyle: { width: 180 },
28
+ ...(v?.props || {}),
29
+ onClick:(e) => e.stopPropagation(),
30
+ trigger:'hover',
31
+ getPopupContainer:(trigger) => trigger.parentNode,
32
+ });
33
+ }
34
+ });
35
+ }
36
+
37
+
22
38
  let [preChildPart, lastChildPart] = [newChildren, null];
23
39
 
24
40
  // 只有1个时不适配