@cuvp1225/antd 0.1.19-beta.14 → 0.1.19-beta.3
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.
- package/dist/designer.js +7 -62
- package/dist/index.js +7 -62
- package/lib/cjs/components/anchor.d.ts +1 -4
- package/lib/cjs/components/anchor.js +43 -13
- package/lib/cjs/components/carousel.d.ts +1 -4
- package/lib/cjs/components/carousel.js +27 -55
- package/lib/cjs/components/collapse.d.ts +2 -15
- package/lib/cjs/components/collapse.js +29 -68
- package/lib/cjs/components/comment.js +3 -1
- package/lib/cjs/components/descriptions.d.ts +5 -1
- package/lib/cjs/components/descriptions.js +58 -15
- package/lib/cjs/components/index.d.ts +0 -4
- package/lib/cjs/components/index.js +4 -11
- package/lib/cjs/components/popconfirm.d.ts +1 -4
- package/lib/cjs/components/popconfirm.js +36 -72
- package/lib/cjs/components/popover.d.ts +1 -4
- package/lib/cjs/components/popover.js +36 -13
- package/lib/cjs/components/radio.js +56 -2
- package/lib/cjs/components/result2.d.ts +2 -4
- package/lib/cjs/components/result2.js +4 -19
- package/lib/cjs/components/tooltip.d.ts +1 -5
- package/lib/cjs/components/tooltip.js +36 -13
- package/lib/cjs/components/upload.d.ts +1 -4
- package/lib/cjs/components/upload.js +45 -13
- package/lib/cjs/prototypes/collapse.js +13 -27
- package/lib/esm/components/anchor.d.ts +1 -4
- package/lib/esm/components/anchor.js +42 -11
- package/lib/esm/components/carousel.d.ts +1 -4
- package/lib/esm/components/carousel.js +27 -54
- package/lib/esm/components/collapse.d.ts +2 -15
- package/lib/esm/components/collapse.js +28 -65
- package/lib/esm/components/comment.js +3 -1
- package/lib/esm/components/descriptions.d.ts +5 -1
- package/lib/esm/components/descriptions.js +56 -14
- package/lib/esm/components/index.d.ts +0 -4
- package/lib/esm/components/index.js +3 -5
- package/lib/esm/components/popconfirm.d.ts +1 -4
- package/lib/esm/components/popconfirm.js +36 -71
- package/lib/esm/components/popover.d.ts +1 -4
- package/lib/esm/components/popover.js +36 -12
- package/lib/esm/components/radio.js +56 -2
- package/lib/esm/components/result2.d.ts +2 -4
- package/lib/esm/components/result2.js +4 -19
- package/lib/esm/components/tooltip.d.ts +1 -5
- package/lib/esm/components/tooltip.js +36 -12
- package/lib/esm/components/upload.d.ts +1 -4
- package/lib/esm/components/upload.js +45 -12
- package/lib/esm/prototypes/collapse.js +14 -28
- package/package.json +2 -2
- package/lib/cjs/components/backTop.d.ts +0 -6
- package/lib/cjs/components/backTop.js +0 -17
- package/lib/cjs/helpers/slottype.d.ts +0 -10
- package/lib/cjs/helpers/slottype.js +0 -13
- package/lib/esm/components/backTop.d.ts +0 -6
- package/lib/esm/components/backTop.js +0 -13
- package/lib/esm/helpers/slottype.d.ts +0 -10
- package/lib/esm/helpers/slottype.js +0 -10
@@ -1,69 +1,32 @@
|
|
1
|
-
// import { defineComponent } from '@music163/tango-boot';
|
2
|
-
// import { Collapse as AntCollapse, CollapseProps} from 'antd';
|
3
|
-
// import React, { useEffect} from 'react';
|
4
|
-
// import { SLOT } from '@music163/tango-helpers';
|
5
1
|
import { __rest } from "tslib";
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
// );
|
35
|
-
// }
|
36
|
-
// export const Collapse = defineComponent(AntCollapse, {
|
37
|
-
// name: 'Collapse',
|
38
|
-
// designerConfig: {
|
39
|
-
// render({ designerProps, originalProps }) {
|
40
|
-
// console.log("Collapse: designerProps:", designerProps, "originalProps:", originalProps);
|
41
|
-
// return <CollapseDesigner {...designerProps} {...originalProps} />;
|
42
|
-
// },
|
43
|
-
// },
|
44
|
-
// });
|
2
|
+
import { defineComponent } from '@music163/tango-boot';
|
3
|
+
import { Collapse as AntCollapse } from 'antd';
|
4
|
+
import React, { useEffect } from 'react';
|
5
|
+
import { SLOT } from '@music163/tango-helpers';
|
6
|
+
function CollapseDesigner(_a) {
|
7
|
+
var { children } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
|
+
useEffect(() => {
|
9
|
+
Promise.resolve().then(() => {
|
10
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
11
|
+
console.log('spinNode', popoverNode);
|
12
|
+
if (popoverNode) {
|
13
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
14
|
+
popoverNode.setAttribute('data-id', dataId);
|
15
|
+
popoverNode.setAttribute('draggable', 'true');
|
16
|
+
}
|
17
|
+
});
|
18
|
+
}, [dataDnd, dataId]);
|
19
|
+
return (React.createElement(AntCollapse, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children));
|
20
|
+
}
|
21
|
+
export const Collapse = defineComponent(AntCollapse, {
|
22
|
+
name: 'Collapse',
|
23
|
+
designerConfig: {
|
24
|
+
render({ designerProps, originalProps }) {
|
25
|
+
console.log("Collapse: designerProps:", designerProps, "originalProps:", originalProps);
|
26
|
+
return React.createElement(CollapseDesigner, Object.assign({}, designerProps, originalProps));
|
27
|
+
},
|
28
|
+
},
|
29
|
+
});
|
45
30
|
// export const CollapsePanel = defineComponent(AntCollapse.Panel, {
|
46
31
|
// name: 'CollapsePanel',
|
47
32
|
// });
|
48
|
-
import { Collapse as AntCollapse } from 'antd';
|
49
|
-
import React from 'react';
|
50
|
-
import { SLOT } from '../helpers/slottype';
|
51
|
-
export const Collapse = (_a) => {
|
52
|
-
var
|
53
|
-
//items,
|
54
|
-
_b = SLOT.id,
|
55
|
-
//items,
|
56
|
-
dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], { style } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
57
|
-
//console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
|
58
|
-
return (React.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
|
59
|
-
React.createElement(AntCollapse, Object.assign({}, rest), rest.children)));
|
60
|
-
};
|
61
|
-
export const CollapsePanel = (props) => {
|
62
|
-
//console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
|
63
|
-
return (
|
64
|
-
// <div data-dnd={dataDnd} data-id={rest.tid} draggable={true} style={style} >
|
65
|
-
React.createElement(AntCollapse.Panel, Object.assign({}, props))
|
66
|
-
// </div>
|
67
|
-
);
|
68
|
-
};
|
69
|
-
Collapse.Panel = CollapsePanel;
|
@@ -3,6 +3,7 @@ import { Comment as AntComment } from 'antd';
|
|
3
3
|
import { defineComponent } from '@music163/tango-boot';
|
4
4
|
import React, { useEffect, useRef } from 'react';
|
5
5
|
import { SLOT } from '@music163/tango-helpers';
|
6
|
+
import { Placeholder } from './placeholder';
|
6
7
|
function CommentDesigner(_a) {
|
7
8
|
var { children, content } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", "content", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
9
|
const commentRef = useRef(null);
|
@@ -25,7 +26,8 @@ export const Comment = defineComponent(AntComment, {
|
|
25
26
|
designerConfig: {
|
26
27
|
render({ designerProps, originalProps }) {
|
27
28
|
// console.log("Comment: designerProps:", designerProps, "originalProps:", originalProps);
|
28
|
-
return React.createElement(CommentDesigner, Object.assign({ content: React.createElement("div", null
|
29
|
+
return React.createElement(CommentDesigner, Object.assign({ content: React.createElement("div", null,
|
30
|
+
React.createElement(Placeholder, { placeholder: "\u653E\u7F6E\u66FF\u6362" })) }, designerProps, originalProps));
|
29
31
|
}
|
30
32
|
}
|
31
33
|
});
|
@@ -1,6 +1,10 @@
|
|
1
1
|
import { DescriptionsProps } from 'antd';
|
2
2
|
import React from 'react';
|
3
|
-
export declare const Descriptions: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd,
|
3
|
+
export declare const Descriptions: ({ items, [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, ...rest }: DescriptionsProps & {
|
4
|
+
[key: string]: any;
|
5
|
+
children?: React.ReactNode;
|
6
|
+
}) => React.JSX.Element;
|
7
|
+
export declare const DescriptionsItem: ({ ...rest }: DescriptionsProps & {
|
4
8
|
[key: string]: any;
|
5
9
|
children?: React.ReactNode;
|
6
10
|
}) => React.JSX.Element;
|
@@ -1,19 +1,61 @@
|
|
1
|
+
// import { Descriptions as AntDescriptions, DescriptionsProps } from 'antd';
|
2
|
+
// import { defineComponent } from '@music163/tango-boot';
|
3
|
+
// import React, { useEffect} from 'react';
|
4
|
+
// import { SLOT } from '@music163/tango-helpers';
|
1
5
|
import { __rest } from "tslib";
|
6
|
+
// function DescriptionsDesigner({
|
7
|
+
// items,
|
8
|
+
// [SLOT.dnd]: dataDnd,
|
9
|
+
// [SLOT.id]: dataId,
|
10
|
+
// style,
|
11
|
+
// ...rest
|
12
|
+
// }: DescriptionsProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }) {
|
13
|
+
// useEffect(() => {
|
14
|
+
// Promise.resolve().then(() => {
|
15
|
+
// const popoverNode = document.querySelector(`.${dataId}`);
|
16
|
+
// console.log('spinNode', popoverNode);
|
17
|
+
// if (popoverNode) {
|
18
|
+
// popoverNode.setAttribute('data-dnd', dataDnd);
|
19
|
+
// popoverNode.setAttribute('data-id', dataId);
|
20
|
+
// popoverNode.setAttribute('draggable', 'true');
|
21
|
+
// }
|
22
|
+
// });
|
23
|
+
// }, [dataDnd, dataId]);
|
24
|
+
// return (
|
25
|
+
// <AntDescriptions
|
26
|
+
// className={dataId}
|
27
|
+
// data-dnd={dataDnd}
|
28
|
+
// data-id={dataId}
|
29
|
+
// style={style}
|
30
|
+
// {...rest}
|
31
|
+
// >
|
32
|
+
// {items.map((item: { label:string; value: string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal; }) => (
|
33
|
+
// <AntDescriptions.Item label={item.label} key={item.label}>
|
34
|
+
// {item.value}
|
35
|
+
// </AntDescriptions.Item>
|
36
|
+
// ))}
|
37
|
+
// </AntDescriptions>
|
38
|
+
// );
|
39
|
+
// }
|
40
|
+
// export const Descriptions = defineComponent(AntDescriptions, {
|
41
|
+
// name: 'Descriptions',
|
42
|
+
// designerConfig: {
|
43
|
+
// render({ designerProps, originalProps }) {
|
44
|
+
// console.log("Descriptions: designerProps:", designerProps, "originalProps:", originalProps);
|
45
|
+
// return <DescriptionsDesigner {...designerProps} {...originalProps} />;
|
46
|
+
// },
|
47
|
+
// },
|
48
|
+
// });
|
2
49
|
import { Descriptions as AntDescriptions } from 'antd';
|
3
50
|
import React from 'react';
|
4
|
-
import { SLOT } from '
|
51
|
+
import { SLOT } from '@music163/tango-helpers';
|
5
52
|
export const Descriptions = (_a) => {
|
6
|
-
var
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
53
|
+
var { items } = _a, _b = SLOT.id, dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], rest = __rest(_a, ["items", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
|
54
|
+
console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
|
55
|
+
return (React.createElement("div", { "data-dnd": dataDnd, "data-id": dataId, draggable: true },
|
56
|
+
React.createElement(AntDescriptions, Object.assign({}, rest), items)));
|
57
|
+
};
|
58
|
+
export const DescriptionsItem = (_a) => {
|
59
|
+
var rest = __rest(_a, []);
|
60
|
+
return React.createElement(AntDescriptions.Item, Object.assign({}, rest), " ");
|
14
61
|
};
|
15
|
-
// export const DescriptionsItem = ({
|
16
|
-
// ...rest
|
17
|
-
// }: DescriptionsProps & { [key: string]: any; children?: React.ReactNode }) => {
|
18
|
-
// return <AntDescriptions.Item {...rest}> </AntDescriptions.Item>
|
19
|
-
// }
|
@@ -10,9 +10,6 @@ export * from './placeholder';
|
|
10
10
|
export * from './section';
|
11
11
|
export { Select } from './select';
|
12
12
|
export { Space } from './space';
|
13
|
-
export { Popconfirm } from './popconfirm';
|
14
|
-
export { Popover } from './popover';
|
15
|
-
export { Result } from './result2';
|
16
13
|
export { Drawer } from "./drawer";
|
17
14
|
export { DatePicker } from "./date-picker";
|
18
15
|
export { Radio, RadioGroup } from "./radio";
|
@@ -47,4 +44,3 @@ export { Descriptions } from './descriptions';
|
|
47
44
|
export { Tree } from './tree';
|
48
45
|
export { Alert } from "./alert";
|
49
46
|
export { Progress } from './progress';
|
50
|
-
export { BackTop } from './backTop';
|
@@ -17,12 +17,12 @@ export { Select } from './select';
|
|
17
17
|
export { Space } from './space';
|
18
18
|
//export { Typography, Title, Paragraph,Text } from './typography';
|
19
19
|
//export { Columns, Column } from './columns';
|
20
|
-
export { Popconfirm } from './popconfirm';
|
21
|
-
export {
|
20
|
+
//export { Popconfirm } from './popconfirm';
|
21
|
+
//export {Popover} from './popover';
|
22
22
|
//export {Tooltip} from './tooltip';
|
23
23
|
//export {Result} from './result';
|
24
24
|
//export {Result} from './result1';
|
25
|
-
export {
|
25
|
+
//export {Result} from './result2';
|
26
26
|
//export {Result} from './result3';
|
27
27
|
export { Drawer } from "./drawer";
|
28
28
|
export { DatePicker } from "./date-picker";
|
@@ -74,8 +74,6 @@ export { Descriptions } from './descriptions';
|
|
74
74
|
export { Tree } from './tree';
|
75
75
|
export { Alert } from "./alert";
|
76
76
|
export { Progress } from './progress';
|
77
|
-
export { BackTop } from './backTop';
|
78
|
-
//export { AntdIcon } from './icon'
|
79
77
|
//export {Affix} from './affix';
|
80
78
|
//import * as echarts from 'echarts';
|
81
79
|
//export {LineChart} from './LineChart';
|
@@ -1,6 +1,3 @@
|
|
1
1
|
import { PopconfirmProps } from 'antd';
|
2
2
|
import React from 'react';
|
3
|
-
export declare const Popconfirm:
|
4
|
-
[key: string]: any;
|
5
|
-
children?: React.ReactNode;
|
6
|
-
}) => React.JSX.Element;
|
3
|
+
export declare const Popconfirm: React.ForwardRefExoticComponent<Omit<PopconfirmProps & React.RefAttributes<unknown> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
@@ -1,73 +1,38 @@
|
|
1
|
-
// import { Popconfirm as AntPopconfirm, PopconfirmProps } from 'antd';
|
2
|
-
// //import { CloseOutlined } from '@ant-design/icons';
|
3
|
-
// import CloseOutlined from '@ant-design/icons/CloseOutlined';
|
4
|
-
// import { defineComponent } from '@music163/tango-boot';
|
5
|
-
// import { Button } from './button';
|
6
|
-
// import React, { useEffect, useRef } from 'react';
|
7
|
-
// import { ShadowContainer } from './shadow-container';
|
8
|
-
// import { SLOT } from '@music163/tango-helpers';
|
9
|
-
// function PopconfirmDesigner({
|
10
|
-
// children,
|
11
|
-
// title,
|
12
|
-
// [SLOT.dnd]:dataDnd,
|
13
|
-
// [SLOT.id]:dataId,
|
14
|
-
// style,
|
15
|
-
// ...rest
|
16
|
-
// }: PopconfirmProps& { [key: string]: any, // 添加索引签名
|
17
|
-
// dnd?: string, children?: React.ReactNode }) {
|
18
|
-
// const popconfirmRef = useRef<HTMLDivElement>(null);
|
19
1
|
import { __rest } from "tslib";
|
20
|
-
// // 监听弹层显示事件
|
21
|
-
// const handleVisibleChange = (visible: boolean) => {
|
22
|
-
// console.log('handleVisibleChange', visible);
|
23
|
-
// if (visible) {
|
24
|
-
// // 使用微任务确保弹层已渲染
|
25
|
-
// Promise.resolve().then(() => {
|
26
|
-
// const popoverNode = document.querySelector(`#${dataId}`);
|
27
|
-
// console.log('popoverNode' ,popoverNode)
|
28
|
-
// if (popoverNode) {
|
29
|
-
// popoverNode.setAttribute('data-dnd', dataDnd);
|
30
|
-
// popoverNode.setAttribute('data-id', dataId);
|
31
|
-
// popoverNode.setAttribute('draggable', 'true');
|
32
|
-
// }
|
33
|
-
// });
|
34
|
-
// }
|
35
|
-
// };
|
36
|
-
// return (
|
37
|
-
// <div ref={popconfirmRef}>
|
38
|
-
// <AntPopconfirm
|
39
|
-
// id={dataId}
|
40
|
-
// className={dataId}
|
41
|
-
// title={title}
|
42
|
-
// onOpenChange={handleVisibleChange}
|
43
|
-
// {...rest}
|
44
|
-
// >
|
45
|
-
// {children}
|
46
|
-
// </AntPopconfirm>
|
47
|
-
// </div>
|
48
|
-
// );
|
49
|
-
// }
|
50
|
-
// export const Popconfirm = defineComponent(AntPopconfirm, {
|
51
|
-
// name: 'Popconfirm',
|
52
|
-
// designerConfig: {
|
53
|
-
// render({ designerProps, originalProps }) {
|
54
|
-
// console.log("Popconfirm: designerProps:",designerProps,"originalProps:",originalProps)
|
55
|
-
// return <PopconfirmDesigner title="Are you sure?" {...designerProps} {...originalProps} />;
|
56
|
-
// },
|
57
|
-
// },
|
58
|
-
// // designerConfig: {
|
59
|
-
// // },
|
60
|
-
// });
|
61
2
|
import { Popconfirm as AntPopconfirm } from 'antd';
|
62
|
-
import
|
63
|
-
import {
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
//
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
3
|
+
import { defineComponent } from '@music163/tango-boot';
|
4
|
+
import React, { useRef } from 'react';
|
5
|
+
import { SLOT } from '@music163/tango-helpers';
|
6
|
+
function PopconfirmDesigner(_a) {
|
7
|
+
var { children, title } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", "title", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
|
+
const popconfirmRef = useRef(null);
|
9
|
+
// 监听弹层显示事件
|
10
|
+
const handleVisibleChange = (visible) => {
|
11
|
+
console.log('handleVisibleChange', visible);
|
12
|
+
if (visible) {
|
13
|
+
// 使用微任务确保弹层已渲染
|
14
|
+
Promise.resolve().then(() => {
|
15
|
+
const popoverNode = document.querySelector(`#${dataId}`);
|
16
|
+
console.log('popoverNode', popoverNode);
|
17
|
+
if (popoverNode) {
|
18
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
19
|
+
popoverNode.setAttribute('data-id', dataId);
|
20
|
+
popoverNode.setAttribute('draggable', 'true');
|
21
|
+
}
|
22
|
+
});
|
23
|
+
}
|
24
|
+
};
|
25
|
+
return (React.createElement("div", { ref: popconfirmRef },
|
26
|
+
React.createElement(AntPopconfirm, Object.assign({ id: dataId, className: dataId, title: title, onOpenChange: handleVisibleChange }, rest), children)));
|
27
|
+
}
|
28
|
+
export const Popconfirm = defineComponent(AntPopconfirm, {
|
29
|
+
name: 'Popconfirm',
|
30
|
+
designerConfig: {
|
31
|
+
render({ designerProps, originalProps }) {
|
32
|
+
console.log("Popconfirm: designerProps:", designerProps, "originalProps:", originalProps);
|
33
|
+
return React.createElement(PopconfirmDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
|
34
|
+
},
|
35
|
+
},
|
36
|
+
// designerConfig: {
|
37
|
+
// },
|
38
|
+
});
|
@@ -1,6 +1,3 @@
|
|
1
1
|
import { PopoverProps } from 'antd';
|
2
2
|
import React from 'react';
|
3
|
-
export declare const Popover:
|
4
|
-
[key: string]: any;
|
5
|
-
children?: React.ReactNode;
|
6
|
-
}) => React.JSX.Element;
|
3
|
+
export declare const Popover: React.ForwardRefExoticComponent<Omit<PopoverProps & React.RefAttributes<unknown> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
@@ -1,14 +1,38 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { Popover as AntPopover } from 'antd';
|
3
|
-
import
|
4
|
-
import {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
//
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
3
|
+
import { defineComponent } from '@music163/tango-boot';
|
4
|
+
import React, { useRef } from 'react';
|
5
|
+
import { SLOT } from '@music163/tango-helpers';
|
6
|
+
function PopoverDesigner(_a) {
|
7
|
+
var { children, title } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", "title", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
|
+
const popoverRef = useRef(null);
|
9
|
+
// 监听弹层显示事件
|
10
|
+
const handleVisibleChange = (visible) => {
|
11
|
+
console.log('handleVisibleChange', visible);
|
12
|
+
if (visible) {
|
13
|
+
// 使用微任务确保弹层已渲染
|
14
|
+
Promise.resolve().then(() => {
|
15
|
+
const popoverNode = document.querySelector(`#${dataId}`);
|
16
|
+
console.log('popoverNode', popoverNode);
|
17
|
+
if (popoverNode) {
|
18
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
19
|
+
popoverNode.setAttribute('data-id', dataId);
|
20
|
+
popoverNode.setAttribute('draggable', 'true');
|
21
|
+
}
|
22
|
+
});
|
23
|
+
}
|
24
|
+
};
|
25
|
+
return (React.createElement("div", { ref: popoverRef },
|
26
|
+
React.createElement(AntPopover, Object.assign({ id: dataId, title: title, onOpenChange: handleVisibleChange }, rest), children)));
|
27
|
+
}
|
28
|
+
export const Popover = defineComponent(AntPopover, {
|
29
|
+
name: 'Popover',
|
30
|
+
designerConfig: {
|
31
|
+
render({ designerProps, originalProps }) {
|
32
|
+
console.log("Popover: designerProps:", designerProps, "originalProps:", originalProps);
|
33
|
+
return React.createElement(PopoverDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
|
34
|
+
},
|
35
|
+
},
|
36
|
+
// designerConfig: {
|
37
|
+
// },
|
38
|
+
});
|
@@ -3,11 +3,65 @@ import { defineComponent } from '@music163/tango-boot';
|
|
3
3
|
import { SLOT } from '@music163/tango-helpers';
|
4
4
|
import { Radio as AntRadio } from 'antd';
|
5
5
|
import React from 'react';
|
6
|
+
// function RadioDesigner({
|
7
|
+
// children,
|
8
|
+
// style,
|
9
|
+
// [SLOT.dnd]: dataDnd,
|
10
|
+
// [SLOT.id]: dataId,
|
11
|
+
// ...rest
|
12
|
+
// }: RadioProps & {
|
13
|
+
// [key: string]: any, // 添加索引签名
|
14
|
+
// dnd?: string, children?: React.ReactNode
|
15
|
+
// }) {
|
16
|
+
// // const radioRef = useRef<HTMLDivElement>(null);
|
17
|
+
// useEffect(() => {
|
18
|
+
// Promise.resolve().then(() => {
|
19
|
+
// const popoverNode = document.querySelector(`.${dataId}`);
|
20
|
+
// console.log('popoverNode', popoverNode);
|
21
|
+
// if (popoverNode) {
|
22
|
+
// popoverNode.setAttribute('data-dnd', dataDnd);
|
23
|
+
// popoverNode.setAttribute('data-id', dataId);
|
24
|
+
// popoverNode.setAttribute('draggable', 'true');
|
25
|
+
// }
|
26
|
+
// });
|
27
|
+
// }, [dataDnd, dataId]);
|
28
|
+
// // const { optionType } = rest;
|
29
|
+
// // if (optionType === 'button') {
|
30
|
+
// // return (
|
31
|
+
// // <div ref={radioRef} className='.ant-radio'>
|
32
|
+
// // <AntRadio.Button {...rest} style={style} >{rest.label}</AntRadio.Button>
|
33
|
+
// // </div>
|
34
|
+
// // );
|
35
|
+
// // }
|
36
|
+
// return (
|
37
|
+
// <AntRadio
|
38
|
+
// {...rest}
|
39
|
+
// style={style}
|
40
|
+
// className={dataId}
|
41
|
+
// data-dnd={dataDnd}
|
42
|
+
// data-id={dataId}
|
43
|
+
// >
|
44
|
+
// {children}
|
45
|
+
// </AntRadio>
|
46
|
+
// );
|
47
|
+
// }
|
48
|
+
// export const Radio = defineComponent(AntRadio, {
|
49
|
+
// name: 'Radio',
|
50
|
+
// designerConfig: {
|
51
|
+
// render({ designerProps, originalProps, }) {
|
52
|
+
// console.log("designerProps:", designerProps, "originalProps:", originalProps)
|
53
|
+
// return <RadioDesigner {...designerProps} {...originalProps} />;
|
54
|
+
// },
|
55
|
+
// },
|
56
|
+
// });
|
57
|
+
// export const Radio = defineComponent(AntRadio, {
|
58
|
+
// name: 'Radio',
|
59
|
+
// });
|
6
60
|
export const Radio = (_a) => {
|
7
|
-
|
61
|
+
var _b = SLOT.id, dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
|
62
|
+
console.log("新的单选组件", dataId, dataDnd, rest);
|
8
63
|
//const newProps = {...rest, ...{draggable:true}}
|
9
64
|
//console.log("新的表格组件01",newProps);
|
10
|
-
var _b = SLOT.id, dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
|
11
65
|
return (React.createElement("div", { "data-dnd": dataDnd, "data-id": dataId, draggable: true },
|
12
66
|
React.createElement(AntRadio, Object.assign({}, rest))));
|
13
67
|
};
|
@@ -1,6 +1,4 @@
|
|
1
|
-
import { ResultProps } from 'antd';
|
2
1
|
import React from 'react';
|
3
|
-
export declare const Result: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd,
|
4
|
-
[
|
5
|
-
children?: React.ReactNode;
|
2
|
+
export declare const Result: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, ...rest }: {
|
3
|
+
[x: string]: any;
|
6
4
|
}) => React.JSX.Element;
|
@@ -1,24 +1,9 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { Result as AntResult } from 'antd';
|
3
3
|
import React from 'react';
|
4
|
-
import { SLOT } from '
|
5
|
-
// export const Result =({
|
6
|
-
// [SLOT.id]:dataId,
|
7
|
-
// [SLOT.dnd]:dataDnd,
|
8
|
-
// ...rest
|
9
|
-
// })=>{
|
10
|
-
// console.log("新的结果组件02",dataId,dataDnd,rest);
|
11
|
-
// return (
|
12
|
-
// <AntResult data-dnd={dataDnd} data-id={dataId} {...rest} > </AntResult>
|
13
|
-
// )
|
14
|
-
// }
|
4
|
+
import { SLOT } from '@music163/tango-helpers';
|
15
5
|
export const Result = (_a) => {
|
16
|
-
var
|
17
|
-
|
18
|
-
|
19
|
-
//items,
|
20
|
-
dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], { style } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
21
|
-
//console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
|
22
|
-
return (React.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
|
23
|
-
React.createElement(AntResult, Object.assign({}, rest), rest.children)));
|
6
|
+
var _b = SLOT.id, dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
|
7
|
+
console.log("新的结果组件02", dataId, dataDnd, rest);
|
8
|
+
return (React.createElement(AntResult, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest), " "));
|
24
9
|
};
|
@@ -1,6 +1,2 @@
|
|
1
|
-
import { TooltipProps } from 'antd';
|
2
1
|
import React from 'react';
|
3
|
-
export declare const Tooltip: (
|
4
|
-
[key: string]: any;
|
5
|
-
children?: React.ReactNode;
|
6
|
-
}) => React.JSX.Element;
|
2
|
+
export declare const Tooltip: React.ForwardRefExoticComponent<(Omit<import("antd/lib/tooltip").TooltipPropsWithTitle & React.RefAttributes<unknown> & import("@music163/tango-boot").TangoComponentProps, "ref"> | Omit<import("antd/lib/tooltip").TooltipPropsWithOverlay & React.RefAttributes<unknown> & import("@music163/tango-boot").TangoComponentProps, "ref">) & React.RefAttributes<unknown>>;
|
@@ -1,14 +1,38 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { Tooltip as AntTooltip } from 'antd';
|
3
|
-
import
|
4
|
-
import {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
//
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
3
|
+
import { defineComponent } from '@music163/tango-boot';
|
4
|
+
import React, { useRef } from 'react';
|
5
|
+
import { SLOT } from '@music163/tango-helpers';
|
6
|
+
function TooltipDesigner(_a) {
|
7
|
+
var { children, title } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", "title", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
|
+
const tooltipRef = useRef(null);
|
9
|
+
// 监听弹层显示事件
|
10
|
+
const handleVisibleChange = (visible) => {
|
11
|
+
console.log('handleVisibleChange', visible);
|
12
|
+
if (visible) {
|
13
|
+
// 使用微任务确保弹层已渲染
|
14
|
+
Promise.resolve().then(() => {
|
15
|
+
const popoverNode = document.querySelector(`#${dataId}`);
|
16
|
+
console.log('popoverNode', popoverNode);
|
17
|
+
if (popoverNode) {
|
18
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
19
|
+
popoverNode.setAttribute('data-id', dataId);
|
20
|
+
popoverNode.setAttribute('draggable', 'true');
|
21
|
+
}
|
22
|
+
});
|
23
|
+
}
|
24
|
+
};
|
25
|
+
return (React.createElement("div", { ref: tooltipRef },
|
26
|
+
React.createElement(AntTooltip, Object.assign({ title: title, id: dataId, onOpenChange: handleVisibleChange }, rest), children)));
|
27
|
+
}
|
28
|
+
export const Tooltip = defineComponent(AntTooltip, {
|
29
|
+
name: 'Tooltip',
|
30
|
+
designerConfig: {
|
31
|
+
render({ designerProps, originalProps }) {
|
32
|
+
console.log("Tooltip: designerProps:", designerProps, "originalProps:", originalProps);
|
33
|
+
return React.createElement(TooltipDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
|
34
|
+
},
|
35
|
+
},
|
36
|
+
// designerConfig: {
|
37
|
+
// },
|
38
|
+
});
|
@@ -1,6 +1,3 @@
|
|
1
1
|
import { UploadProps } from 'antd';
|
2
2
|
import React from 'react';
|
3
|
-
export declare const Upload:
|
4
|
-
[key: string]: any;
|
5
|
-
children?: React.ReactNode;
|
6
|
-
}) => React.JSX.Element;
|
3
|
+
export declare const Upload: React.ForwardRefExoticComponent<Omit<UploadProps<any> & React.RefAttributes<unknown> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|