@cuvp1225/antd 0.3.74 → 0.3.76
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 +37 -4
- package/dist/index.js +37 -4
- package/lib/cjs/components/alert.js +12 -6
- package/lib/cjs/components/index.d.ts +3 -0
- package/lib/cjs/components/index.js +7 -1
- package/lib/cjs/components/popconfirm.js +2 -2
- package/lib/cjs/components/popover.js +2 -2
- package/lib/cjs/components/progress.js +15 -6
- package/lib/cjs/components/tooltip.js +2 -2
- package/lib/cjs/components/tree.js +39 -18
- package/lib/esm/components/alert.js +12 -6
- package/lib/esm/components/index.d.ts +3 -0
- package/lib/esm/components/index.js +3 -0
- package/lib/esm/components/popconfirm.js +2 -2
- package/lib/esm/components/popover.js +2 -2
- package/lib/esm/components/progress.js +15 -6
- package/lib/esm/components/tooltip.js +2 -2
- package/lib/esm/components/tree.js +40 -19
- package/package.json +2 -2
@@ -6,27 +6,48 @@ const antd_1 = require("antd");
|
|
6
6
|
const tango_boot_1 = require("@music163/tango-boot");
|
7
7
|
const react_1 = tslib_1.__importStar(require("react"));
|
8
8
|
const tango_helpers_1 = require("@music163/tango-helpers");
|
9
|
-
function TreeDesigner(_a
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
9
|
+
function TreeDesigner(_a
|
10
|
+
// TreeProps & {
|
11
|
+
// [key: string]: any, // 添加索引签名
|
12
|
+
// dnd?: string, children?: React.ReactNode}
|
13
|
+
) {
|
14
|
+
var { children, title } = _a
|
15
|
+
// TreeProps & {
|
16
|
+
// [key: string]: any, // 添加索引签名
|
17
|
+
// dnd?: string, children?: React.ReactNode}
|
18
|
+
, _b = tango_helpers_1.SLOT.dnd, dataDnd = _a[_b], _c = tango_helpers_1.SLOT.id, dataId = _a[_c], { style } = _a
|
19
|
+
// TreeProps & {
|
20
|
+
// [key: string]: any, // 添加索引签名
|
21
|
+
// dnd?: string, children?: React.ReactNode}
|
22
|
+
, rest = tslib_1.__rest(_a, ["children", "title", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
23
|
+
const treeRef = (0, react_1.useRef)(null);
|
24
|
+
// 监听弹层显示事件
|
25
|
+
const handleVisibleChange = (visible) => {
|
26
|
+
console.log('handleVisibleChange', visible);
|
27
|
+
if (visible) {
|
28
|
+
// 使用微任务确保弹层已渲染
|
29
|
+
Promise.resolve().then(() => {
|
30
|
+
const treeNode = document.querySelector(`#${dataId}`);
|
31
|
+
console.log('treeNode', treeNode);
|
32
|
+
if (treeNode) {
|
33
|
+
// treeNode.setAttribute('data-dnd', dataDnd);
|
34
|
+
// treeNode.setAttribute('data-id', dataId);
|
35
|
+
treeNode.setAttribute('draggable', 'true');
|
36
|
+
}
|
37
|
+
});
|
38
|
+
}
|
39
|
+
};
|
40
|
+
return (react_1.default.createElement("div", { ref: treeRef },
|
41
|
+
react_1.default.createElement(antd_1.Tree, Object.assign({ id: dataId, title: title, onOpenChange: handleVisibleChange }, rest), children)));
|
23
42
|
}
|
24
43
|
exports.Tree = (0, tango_boot_1.defineComponent)(antd_1.Tree, {
|
25
44
|
name: 'Tree',
|
26
45
|
designerConfig: {
|
27
46
|
render({ designerProps, originalProps }) {
|
28
|
-
|
29
|
-
return react_1.default.createElement(TreeDesigner, Object.assign({}, designerProps, originalProps));
|
30
|
-
}
|
31
|
-
}
|
47
|
+
console.log("Tree: designerProps:", designerProps, "originalProps:", originalProps);
|
48
|
+
return react_1.default.createElement(TreeDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
|
49
|
+
},
|
50
|
+
},
|
51
|
+
// designerConfig: {
|
52
|
+
// },
|
32
53
|
});
|
@@ -3,20 +3,26 @@ import { Alert as AntAlert } from 'antd';
|
|
3
3
|
import { defineComponent } from '@music163/tango-boot';
|
4
4
|
import React, { useEffect } from 'react';
|
5
5
|
import { SLOT } from '@music163/tango-helpers';
|
6
|
-
function AlertDesigner(_a
|
7
|
-
|
6
|
+
function AlertDesigner(_a
|
7
|
+
// AlertProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }
|
8
|
+
) {
|
9
|
+
var { children } = _a
|
10
|
+
// AlertProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }
|
11
|
+
, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a
|
12
|
+
// AlertProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }
|
13
|
+
, rest = __rest(_a, ["children", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
14
|
useEffect(() => {
|
9
15
|
Promise.resolve().then(() => {
|
10
|
-
const popoverNode = document.querySelector(
|
16
|
+
const popoverNode = document.querySelector(`#${dataId}`);
|
11
17
|
// console.log('spinNode', popoverNode);
|
12
18
|
if (popoverNode) {
|
13
|
-
popoverNode.setAttribute('data-dnd', dataDnd);
|
14
|
-
popoverNode.setAttribute('data-id', dataId);
|
19
|
+
// popoverNode.setAttribute('data-dnd', dataDnd);
|
20
|
+
// popoverNode.setAttribute('data-id', dataId);
|
15
21
|
popoverNode.setAttribute('draggable', 'true');
|
16
22
|
}
|
17
23
|
});
|
18
24
|
}, [dataDnd, dataId]);
|
19
|
-
return (React.createElement(AntAlert, Object.assign({
|
25
|
+
return (React.createElement(AntAlert, Object.assign({ id: dataId, style: style }, rest)));
|
20
26
|
}
|
21
27
|
export const Alert = defineComponent(AntAlert, {
|
22
28
|
name: 'Alert',
|
@@ -58,3 +58,6 @@ export { TreeSelect } from './tree-select';
|
|
58
58
|
export { Image } from './image';
|
59
59
|
export { Tabs } from './tabs';
|
60
60
|
export { Descriptions } from './descriptions';
|
61
|
+
export { Tree } from './tree';
|
62
|
+
export { Alert } from "./alert";
|
63
|
+
export { Progress } from './progress';
|
@@ -63,3 +63,6 @@ export { TreeSelect } from './tree-select';
|
|
63
63
|
export { Image } from './image';
|
64
64
|
export { Tabs } from './tabs';
|
65
65
|
export { Descriptions } from './descriptions';
|
66
|
+
export { Tree } from './tree';
|
67
|
+
export { Alert } from "./alert";
|
68
|
+
export { Progress } from './progress';
|
@@ -12,7 +12,7 @@ function PopconfirmDesigner(_a) {
|
|
12
12
|
if (visible) {
|
13
13
|
// 使用微任务确保弹层已渲染
|
14
14
|
Promise.resolve().then(() => {
|
15
|
-
const popoverNode = document.querySelector(
|
15
|
+
const popoverNode = document.querySelector(`#${dataId}`);
|
16
16
|
console.log('popoverNode', popoverNode);
|
17
17
|
if (popoverNode) {
|
18
18
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -23,7 +23,7 @@ function PopconfirmDesigner(_a) {
|
|
23
23
|
}
|
24
24
|
};
|
25
25
|
return (React.createElement("div", { ref: popconfirmRef },
|
26
|
-
React.createElement(AntPopconfirm, Object.assign({ className: dataId, title: title, onOpenChange: handleVisibleChange }, rest), children)));
|
26
|
+
React.createElement(AntPopconfirm, Object.assign({ id: dataId, className: dataId, title: title, onOpenChange: handleVisibleChange }, rest), children)));
|
27
27
|
}
|
28
28
|
export const Popconfirm = defineComponent(AntPopconfirm, {
|
29
29
|
name: 'Popconfirm',
|
@@ -12,7 +12,7 @@ function PopoverDesigner(_a) {
|
|
12
12
|
if (visible) {
|
13
13
|
// 使用微任务确保弹层已渲染
|
14
14
|
Promise.resolve().then(() => {
|
15
|
-
const popoverNode = document.querySelector(
|
15
|
+
const popoverNode = document.querySelector(`#${dataId}`);
|
16
16
|
console.log('popoverNode', popoverNode);
|
17
17
|
if (popoverNode) {
|
18
18
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -23,7 +23,7 @@ function PopoverDesigner(_a) {
|
|
23
23
|
}
|
24
24
|
};
|
25
25
|
return (React.createElement("div", { ref: popoverRef },
|
26
|
-
React.createElement(AntPopover, Object.assign({
|
26
|
+
React.createElement(AntPopover, Object.assign({ id: dataId, title: title, onOpenChange: handleVisibleChange }, rest), children)));
|
27
27
|
}
|
28
28
|
export const Popover = defineComponent(AntPopover, {
|
29
29
|
name: 'Popover',
|
@@ -3,20 +3,29 @@ import { Progress as AntProgress } from 'antd';
|
|
3
3
|
import { defineComponent } from '@music163/tango-boot';
|
4
4
|
import React, { useEffect } from 'react';
|
5
5
|
import { SLOT } from '@music163/tango-helpers';
|
6
|
-
function ProgressDesigner(_a
|
7
|
-
|
6
|
+
function ProgressDesigner(_a
|
7
|
+
// ProgressProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }
|
8
|
+
) {
|
9
|
+
var { children } = _a
|
10
|
+
// ProgressProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }
|
11
|
+
, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a
|
12
|
+
// ProgressProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }
|
13
|
+
, rest = __rest(_a, ["children", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
14
|
useEffect(() => {
|
9
15
|
Promise.resolve().then(() => {
|
10
|
-
const popoverNode = document.querySelector(
|
16
|
+
const popoverNode = document.querySelector(`#${dataId}`);
|
11
17
|
// console.log('spinNode', popoverNode);
|
12
18
|
if (popoverNode) {
|
13
|
-
popoverNode.setAttribute('data-dnd', dataDnd);
|
14
|
-
popoverNode.setAttribute('data-id', dataId);
|
19
|
+
// popoverNode.setAttribute('data-dnd', dataDnd);
|
20
|
+
// popoverNode.setAttribute('data-id', dataId);
|
15
21
|
popoverNode.setAttribute('draggable', 'true');
|
16
22
|
}
|
17
23
|
});
|
18
24
|
}, [dataDnd, dataId]);
|
19
|
-
return (React.createElement(AntProgress, Object.assign({
|
25
|
+
return (React.createElement(AntProgress, Object.assign({ id: dataId,
|
26
|
+
// data-dnd={dataDnd}
|
27
|
+
// data-id={dataId}
|
28
|
+
style: style }, rest), children));
|
20
29
|
}
|
21
30
|
export const Progress = defineComponent(AntProgress, {
|
22
31
|
name: 'Progress',
|
@@ -12,7 +12,7 @@ function TooltipDesigner(_a) {
|
|
12
12
|
if (visible) {
|
13
13
|
// 使用微任务确保弹层已渲染
|
14
14
|
Promise.resolve().then(() => {
|
15
|
-
const popoverNode = document.querySelector(
|
15
|
+
const popoverNode = document.querySelector(`#${dataId}`);
|
16
16
|
console.log('popoverNode', popoverNode);
|
17
17
|
if (popoverNode) {
|
18
18
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -23,7 +23,7 @@ function TooltipDesigner(_a) {
|
|
23
23
|
}
|
24
24
|
};
|
25
25
|
return (React.createElement("div", { ref: tooltipRef },
|
26
|
-
React.createElement(AntTooltip, Object.assign({ title: title,
|
26
|
+
React.createElement(AntTooltip, Object.assign({ title: title, id: dataId, onOpenChange: handleVisibleChange }, rest), children)));
|
27
27
|
}
|
28
28
|
export const Tooltip = defineComponent(AntTooltip, {
|
29
29
|
name: 'Tooltip',
|
@@ -1,29 +1,50 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { Tree as AntTree } from 'antd';
|
3
3
|
import { defineComponent } from '@music163/tango-boot';
|
4
|
-
import React, {
|
4
|
+
import React, { useRef } from 'react';
|
5
5
|
import { SLOT } from '@music163/tango-helpers';
|
6
|
-
function TreeDesigner(_a
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
6
|
+
function TreeDesigner(_a
|
7
|
+
// TreeProps & {
|
8
|
+
// [key: string]: any, // 添加索引签名
|
9
|
+
// dnd?: string, children?: React.ReactNode}
|
10
|
+
) {
|
11
|
+
var { children, title } = _a
|
12
|
+
// TreeProps & {
|
13
|
+
// [key: string]: any, // 添加索引签名
|
14
|
+
// dnd?: string, children?: React.ReactNode}
|
15
|
+
, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a
|
16
|
+
// TreeProps & {
|
17
|
+
// [key: string]: any, // 添加索引签名
|
18
|
+
// dnd?: string, children?: React.ReactNode}
|
19
|
+
, rest = __rest(_a, ["children", "title", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
20
|
+
const treeRef = useRef(null);
|
21
|
+
// 监听弹层显示事件
|
22
|
+
const handleVisibleChange = (visible) => {
|
23
|
+
console.log('handleVisibleChange', visible);
|
24
|
+
if (visible) {
|
25
|
+
// 使用微任务确保弹层已渲染
|
26
|
+
Promise.resolve().then(() => {
|
27
|
+
const treeNode = document.querySelector(`#${dataId}`);
|
28
|
+
console.log('treeNode', treeNode);
|
29
|
+
if (treeNode) {
|
30
|
+
// treeNode.setAttribute('data-dnd', dataDnd);
|
31
|
+
// treeNode.setAttribute('data-id', dataId);
|
32
|
+
treeNode.setAttribute('draggable', 'true');
|
33
|
+
}
|
34
|
+
});
|
35
|
+
}
|
36
|
+
};
|
37
|
+
return (React.createElement("div", { ref: treeRef },
|
38
|
+
React.createElement(AntTree, Object.assign({ id: dataId, title: title, onOpenChange: handleVisibleChange }, rest), children)));
|
20
39
|
}
|
21
40
|
export const Tree = defineComponent(AntTree, {
|
22
41
|
name: 'Tree',
|
23
42
|
designerConfig: {
|
24
43
|
render({ designerProps, originalProps }) {
|
25
|
-
|
26
|
-
return React.createElement(TreeDesigner, Object.assign({}, designerProps, originalProps));
|
27
|
-
}
|
28
|
-
}
|
44
|
+
console.log("Tree: designerProps:", designerProps, "originalProps:", originalProps);
|
45
|
+
return React.createElement(TreeDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
|
46
|
+
},
|
47
|
+
},
|
48
|
+
// designerConfig: {
|
49
|
+
// },
|
29
50
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@cuvp1225/antd",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.76",
|
4
4
|
"description": "antd components for tango app",
|
5
5
|
"author": "wwsun <ww.sww@outlook.com>",
|
6
6
|
"homepage": "https://github.com/netease/tango-components#readme",
|
@@ -54,5 +54,5 @@
|
|
54
54
|
"classnames": "^2.3.2",
|
55
55
|
"coral-system": "^1.0.6"
|
56
56
|
},
|
57
|
-
"gitHead": "
|
57
|
+
"gitHead": "faca46e9d1c744c5f6117f3e73472c9b9d193f88"
|
58
58
|
}
|