@cuvp1225/antd 0.3.57 → 0.3.59
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 +52 -19
- package/dist/index.js +52 -19
- package/lib/cjs/components/anchor.js +1 -1
- package/lib/cjs/components/avatar.js +1 -1
- package/lib/cjs/components/calendar.js +2 -2
- package/lib/cjs/components/card.js +1 -1
- package/lib/cjs/components/carousel.js +2 -2
- package/lib/cjs/components/checkbox.js +10 -1
- package/lib/cjs/components/date-picker.js +6 -3
- package/lib/cjs/components/divider.js +1 -1
- package/lib/cjs/components/empty.js +1 -1
- package/lib/cjs/components/index.d.ts +3 -0
- package/lib/cjs/components/index.js +7 -1
- package/lib/cjs/components/pageheader.js +11 -0
- package/lib/cjs/components/pagination.js +1 -1
- package/lib/cjs/components/popover.js +1 -1
- package/lib/cjs/components/radio.js +10 -1
- package/lib/cjs/components/rate.d.ts +3 -0
- package/lib/cjs/components/rate.js +51 -0
- package/lib/cjs/components/result.js +1 -1
- package/lib/cjs/components/skeleton.js +11 -0
- package/lib/cjs/components/slider.d.ts +2 -0
- package/lib/cjs/components/slider.js +51 -0
- package/lib/cjs/components/spin.js +1 -1
- package/lib/cjs/components/table.js +1 -1
- package/lib/cjs/components/tag.js +1 -1
- package/lib/cjs/components/time-picker.js +1 -2
- package/lib/cjs/components/transfer.d.ts +3 -0
- package/lib/cjs/components/transfer.js +51 -0
- package/lib/esm/components/anchor.js +1 -1
- package/lib/esm/components/avatar.js +1 -1
- package/lib/esm/components/calendar.js +2 -2
- package/lib/esm/components/card.js +1 -1
- package/lib/esm/components/carousel.js +2 -2
- package/lib/esm/components/checkbox.js +10 -1
- package/lib/esm/components/date-picker.js +6 -3
- package/lib/esm/components/divider.js +1 -1
- package/lib/esm/components/empty.js +1 -1
- package/lib/esm/components/index.d.ts +3 -0
- package/lib/esm/components/index.js +3 -0
- package/lib/esm/components/pageheader.js +12 -1
- package/lib/esm/components/pagination.js +1 -1
- package/lib/esm/components/popover.js +1 -1
- package/lib/esm/components/radio.js +10 -1
- package/lib/esm/components/rate.d.ts +3 -0
- package/lib/esm/components/rate.js +48 -0
- package/lib/esm/components/result.js +1 -1
- package/lib/esm/components/skeleton.js +12 -1
- package/lib/esm/components/slider.d.ts +2 -0
- package/lib/esm/components/slider.js +48 -0
- package/lib/esm/components/spin.js +1 -1
- package/lib/esm/components/table.js +1 -1
- package/lib/esm/components/tag.js +1 -1
- package/lib/esm/components/time-picker.js +1 -2
- package/lib/esm/components/transfer.d.ts +3 -0
- package/lib/esm/components/transfer.js +48 -0
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { PageHeader as AntPageHeader } from 'antd';
|
|
3
3
|
import { defineComponent } from '@music163/tango-boot';
|
|
4
|
-
import React, { useRef } from 'react';
|
|
4
|
+
import React, { useEffect, useRef } from 'react';
|
|
5
5
|
import { SLOT } from '@music163/tango-helpers';
|
|
6
6
|
function PageHeaderDesigner(_a) {
|
|
7
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"]);
|
|
@@ -21,6 +21,17 @@ function PageHeaderDesigner(_a) {
|
|
|
21
21
|
// });
|
|
22
22
|
// }
|
|
23
23
|
// };
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
Promise.resolve().then(() => {
|
|
26
|
+
const popoverNode = document.querySelector('.ant-page-header');
|
|
27
|
+
console.log('spinNode', popoverNode);
|
|
28
|
+
if (popoverNode) {
|
|
29
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
|
30
|
+
popoverNode.setAttribute('data-id', dataId);
|
|
31
|
+
popoverNode.setAttribute('draggable', 'true');
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}, [dataDnd, dataId]);
|
|
24
35
|
return (React.createElement("div", { ref: pageHeaderRef },
|
|
25
36
|
React.createElement(AntPageHeader, Object.assign({ title: title, "data-dnd": dataDnd, "data-id": dataId }, rest), children)));
|
|
26
37
|
}
|
|
@@ -17,7 +17,7 @@ function PaginationDesigner(_a) {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
}, [dataDnd, dataId]);
|
|
20
|
-
return (React.createElement("div", { ref: paginationRef
|
|
20
|
+
return (React.createElement("div", { ref: paginationRef },
|
|
21
21
|
React.createElement(AntPagination, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
|
22
22
|
}
|
|
23
23
|
export const Pagination = defineComponent(AntPagination, {
|
|
@@ -12,7 +12,7 @@ function PopoverDesigner(_a) {
|
|
|
12
12
|
if (visible) {
|
|
13
13
|
// 使用微任务确保弹层已渲染
|
|
14
14
|
Promise.resolve().then(() => {
|
|
15
|
-
const popoverNode = document.querySelector('.ant-popover
|
|
15
|
+
const popoverNode = document.querySelector('.ant-popover');
|
|
16
16
|
console.log('popoverNode', popoverNode);
|
|
17
17
|
if (popoverNode) {
|
|
18
18
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { defineComponent } from '@music163/tango-boot';
|
|
3
3
|
import { Radio as AntRadio } from 'antd';
|
|
4
|
-
import React from 'react';
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
5
|
function RadioDesigner(_a) {
|
|
6
6
|
var { style } = _a, rest = __rest(_a, ["style"]);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
Promise.resolve().then(() => {
|
|
9
|
+
const popoverNode = document.querySelector('.ant-radio');
|
|
10
|
+
// console.log('spinNode', popoverNode);
|
|
11
|
+
if (popoverNode) {
|
|
12
|
+
popoverNode.setAttribute('draggable', 'true');
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}, []);
|
|
7
16
|
const { optionType } = rest;
|
|
8
17
|
if (optionType === 'button') {
|
|
9
18
|
return React.createElement(AntRadio.Button, Object.assign({}, rest, { style: style }), rest.label);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { Rate as AntRate } from 'antd';
|
|
3
|
+
import { defineComponent } from '@music163/tango-boot';
|
|
4
|
+
import React, { useEffect, useRef } from 'react';
|
|
5
|
+
import { SLOT } from '@music163/tango-helpers';
|
|
6
|
+
function RateDesigner(_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 rateRef = useRef(null);
|
|
9
|
+
// 监听弹层显示事件
|
|
10
|
+
// const handleVisibleChange = (visible: boolean) => {
|
|
11
|
+
// console.log('handleVisibleChange', visible);
|
|
12
|
+
// if (visible) {
|
|
13
|
+
// // 使用微任务确保弹层已渲染
|
|
14
|
+
// Promise.resolve().then(() => {
|
|
15
|
+
// const popoverNode = document.querySelector('.ant-popover-placement-top');
|
|
16
|
+
// console.log('popoverNode' ,popoverNode)
|
|
17
|
+
// if (popoverNode) {
|
|
18
|
+
// popoverNode.setAttribute('data-dnd', dataDnd);
|
|
19
|
+
// popoverNode.setAttribute('data-id', dataId);
|
|
20
|
+
// }
|
|
21
|
+
// });
|
|
22
|
+
// }
|
|
23
|
+
// };
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
Promise.resolve().then(() => {
|
|
26
|
+
const popoverNode = document.querySelector('.ant-rate');
|
|
27
|
+
console.log('rate', popoverNode);
|
|
28
|
+
if (popoverNode) {
|
|
29
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
|
30
|
+
popoverNode.setAttribute('data-id', dataId);
|
|
31
|
+
popoverNode.setAttribute('draggable', 'true');
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}, [dataDnd, dataId]);
|
|
35
|
+
return (React.createElement("div", { ref: rateRef },
|
|
36
|
+
React.createElement(AntRate, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest))));
|
|
37
|
+
}
|
|
38
|
+
export const Rate = defineComponent(AntRate, {
|
|
39
|
+
name: 'Rate',
|
|
40
|
+
designerConfig: {
|
|
41
|
+
render({ designerProps, originalProps }) {
|
|
42
|
+
console.log("Rate: designerProps:", designerProps, "originalProps:", originalProps);
|
|
43
|
+
return React.createElement(RateDesigner, Object.assign({ title: "\u4E00\u7EA7\u6807\u9898" }, designerProps, originalProps));
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
// designerConfig: {
|
|
47
|
+
// },
|
|
48
|
+
});
|
|
@@ -32,7 +32,7 @@ function ResultDesigner(_a) {
|
|
|
32
32
|
// });
|
|
33
33
|
// }
|
|
34
34
|
// };
|
|
35
|
-
return (React.createElement("div", { ref: resultRef
|
|
35
|
+
return (React.createElement("div", { ref: resultRef },
|
|
36
36
|
React.createElement(AntResult, Object.assign({ title: title, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
|
37
37
|
}
|
|
38
38
|
export const Result = defineComponent(AntResult, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { Skeleton as AntSkeleton } from 'antd';
|
|
3
3
|
import { defineComponent } from '@music163/tango-boot';
|
|
4
|
-
import React, { useRef } from 'react';
|
|
4
|
+
import React, { useEffect, useRef } from 'react';
|
|
5
5
|
import { SLOT } from '@music163/tango-helpers';
|
|
6
6
|
function SkeletonDesigner(_a) {
|
|
7
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"]);
|
|
@@ -21,6 +21,17 @@ function SkeletonDesigner(_a) {
|
|
|
21
21
|
// });
|
|
22
22
|
// }
|
|
23
23
|
// };
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
Promise.resolve().then(() => {
|
|
26
|
+
const popoverNode = document.querySelector('.ant-skeleton');
|
|
27
|
+
console.log('ant-skeleton', popoverNode);
|
|
28
|
+
if (popoverNode) {
|
|
29
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
|
30
|
+
popoverNode.setAttribute('data-id', dataId);
|
|
31
|
+
popoverNode.setAttribute('draggable', 'true');
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}, [dataDnd, dataId]);
|
|
24
35
|
return (React.createElement("div", { ref: skeletonRef },
|
|
25
36
|
React.createElement(AntSkeleton, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest), children)));
|
|
26
37
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const Slider: React.ForwardRefExoticComponent<(Omit<import("antd").SliderSingleProps & React.RefAttributes<unknown> & import("@music163/tango-boot").TangoComponentProps, "ref"> | Omit<import("antd/lib/slider").SliderRangeProps & React.RefAttributes<unknown> & import("@music163/tango-boot").TangoComponentProps, "ref">) & React.RefAttributes<unknown>>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { Slider as AntSlider } from 'antd';
|
|
3
|
+
import { defineComponent } from '@music163/tango-boot';
|
|
4
|
+
import React, { useEffect, useRef } from 'react';
|
|
5
|
+
import { SLOT } from '@music163/tango-helpers';
|
|
6
|
+
function SliderDesigner(_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 rateRef = useRef(null);
|
|
9
|
+
// 监听弹层显示事件
|
|
10
|
+
// const handleVisibleChange = (visible: boolean) => {
|
|
11
|
+
// console.log('handleVisibleChange', visible);
|
|
12
|
+
// if (visible) {
|
|
13
|
+
// // 使用微任务确保弹层已渲染
|
|
14
|
+
// Promise.resolve().then(() => {
|
|
15
|
+
// const popoverNode = document.querySelector('.ant-popover-placement-top');
|
|
16
|
+
// console.log('popoverNode' ,popoverNode)
|
|
17
|
+
// if (popoverNode) {
|
|
18
|
+
// popoverNode.setAttribute('data-dnd', dataDnd);
|
|
19
|
+
// popoverNode.setAttribute('data-id', dataId);
|
|
20
|
+
// }
|
|
21
|
+
// });
|
|
22
|
+
// }
|
|
23
|
+
// };
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
Promise.resolve().then(() => {
|
|
26
|
+
const popoverNode = document.querySelector('.ant-slider');
|
|
27
|
+
console.log('rate', popoverNode);
|
|
28
|
+
if (popoverNode) {
|
|
29
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
|
30
|
+
popoverNode.setAttribute('data-id', dataId);
|
|
31
|
+
popoverNode.setAttribute('draggable', 'true');
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}, [dataDnd, dataId]);
|
|
35
|
+
return (React.createElement("div", { ref: rateRef },
|
|
36
|
+
React.createElement(AntSlider, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest))));
|
|
37
|
+
}
|
|
38
|
+
export const Slider = defineComponent(AntSlider, {
|
|
39
|
+
name: 'Slider',
|
|
40
|
+
designerConfig: {
|
|
41
|
+
render({ designerProps, originalProps }) {
|
|
42
|
+
console.log("Slider: designerProps:", designerProps, "originalProps:", originalProps);
|
|
43
|
+
return React.createElement(SliderDesigner, Object.assign({ title: "\u4E00\u7EA7\u6807\u9898" }, designerProps, originalProps));
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
// designerConfig: {
|
|
47
|
+
// },
|
|
48
|
+
});
|
|
@@ -17,7 +17,7 @@ function SpinDesigner(_a) {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
}, [dataDnd, dataId]);
|
|
20
|
-
return (React.createElement("div", { ref: spinRef
|
|
20
|
+
return (React.createElement("div", { ref: spinRef },
|
|
21
21
|
React.createElement(AntSpin, Object.assign({ spinning: spinning, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
|
22
22
|
}
|
|
23
23
|
export const Spin = defineComponent(AntSpin, {
|
|
@@ -17,7 +17,7 @@ function TableDesigner(_a) {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
}, [dataDnd, dataId]);
|
|
20
|
-
return (React.createElement("div", { ref: tableRef
|
|
20
|
+
return (React.createElement("div", { ref: tableRef },
|
|
21
21
|
React.createElement(AntTable, Object.assign({ columns: columns, dataSource: dataSource, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
|
22
22
|
}
|
|
23
23
|
export const Table = defineComponent(AntTable, {
|
|
@@ -17,7 +17,7 @@ function TagDesigner(_a) {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
}, [dataDnd, dataId]);
|
|
20
|
-
return (React.createElement("div", { ref: tagRef
|
|
20
|
+
return (React.createElement("div", { ref: tagRef },
|
|
21
21
|
React.createElement(AntTag, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
|
22
22
|
}
|
|
23
23
|
export const Tag = defineComponent(AntTag, {
|
|
@@ -17,8 +17,7 @@ function TimePickerDesigner(_a) {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
}, [dataDnd, dataId]);
|
|
20
|
-
return (React.createElement(
|
|
21
|
-
React.createElement(AntTimePicker, Object.assign({ className: 'antd-timePicker', "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
|
20
|
+
return (React.createElement(AntTimePicker, Object.assign({ className: 'ant-timePicker', "data-dnd": dataDnd, "data-id": dataId, style: style }, rest)));
|
|
22
21
|
}
|
|
23
22
|
export const TimePicker = defineComponent(AntTimePicker, {
|
|
24
23
|
name: 'TimePicker',
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { Transfer as AntTransfer } from 'antd';
|
|
3
|
+
import { defineComponent } from '@music163/tango-boot';
|
|
4
|
+
import React, { useEffect, useRef } from 'react';
|
|
5
|
+
import { SLOT } from '@music163/tango-helpers';
|
|
6
|
+
function TransferDesigner(_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 transferRef = useRef(null);
|
|
9
|
+
// 监听弹层显示事件
|
|
10
|
+
// const handleVisibleChange = (visible: boolean) => {
|
|
11
|
+
// console.log('handleVisibleChange', visible);
|
|
12
|
+
// if (visible) {
|
|
13
|
+
// // 使用微任务确保弹层已渲染
|
|
14
|
+
// Promise.resolve().then(() => {
|
|
15
|
+
// const popoverNode = document.querySelector('.ant-popover-placement-top');
|
|
16
|
+
// console.log('popoverNode' ,popoverNode)
|
|
17
|
+
// if (popoverNode) {
|
|
18
|
+
// popoverNode.setAttribute('data-dnd', dataDnd);
|
|
19
|
+
// popoverNode.setAttribute('data-id', dataId);
|
|
20
|
+
// }
|
|
21
|
+
// });
|
|
22
|
+
// }
|
|
23
|
+
// };
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
Promise.resolve().then(() => {
|
|
26
|
+
const popoverNode = document.querySelector('.ant-transfer');
|
|
27
|
+
console.log('rate', popoverNode);
|
|
28
|
+
if (popoverNode) {
|
|
29
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
|
30
|
+
popoverNode.setAttribute('data-id', dataId);
|
|
31
|
+
popoverNode.setAttribute('draggable', 'true');
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}, [dataDnd, dataId]);
|
|
35
|
+
return (React.createElement("div", { ref: transferRef },
|
|
36
|
+
React.createElement(AntTransfer, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest))));
|
|
37
|
+
}
|
|
38
|
+
export const Transfer = defineComponent(AntTransfer, {
|
|
39
|
+
name: 'Transfer',
|
|
40
|
+
designerConfig: {
|
|
41
|
+
render({ designerProps, originalProps }) {
|
|
42
|
+
console.log("Transfer: designerProps:", designerProps, "originalProps:", originalProps);
|
|
43
|
+
return React.createElement(TransferDesigner, Object.assign({ title: "\u4E00\u7EA7\u6807\u9898" }, designerProps, originalProps));
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
// designerConfig: {
|
|
47
|
+
// },
|
|
48
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuvp1225/antd",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.59",
|
|
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": "497a56d200ec75281cf77d717306bc096b503743"
|
|
58
58
|
}
|