tntd 1.4.22 → 1.4.24

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
  }
@@ -22,11 +22,18 @@ export default props => {
22
22
  if(lang === 'en' || popConfirmHandle){
23
23
  newChildren?.forEach((v,i)=>{
24
24
  const { type, props } = v;
25
- if(type?.name === 'Popconfirm'){
25
+ if(type?.name === 'Popconfirm' || (props.hasOwnProperty('onConfirm') && typeof props?.onConfirm === 'function')){
26
+ let placement ={};
27
+ if(lang === 'en' || (num && !isNaN(num) && (i+1) > num && !(lessOneMoreFit && newChildren.length - num === 1))){
28
+ placement = {
29
+ placement:'left'
30
+ };
31
+ }
26
32
  newChildren[i]= React.cloneElement(v, {
27
33
  overlayStyle: { width: 180 },
28
34
  ...(v?.props || {}),
29
35
  onClick:(e) => e.stopPropagation(),
36
+ ...placement,
30
37
  trigger:'hover',
31
38
  getPopupContainer:(trigger) => trigger.parentNode,
32
39
  });