@cuvp1225/antd 0.2.73 → 0.2.75
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 +334 -15
- package/dist/index.js +327 -8
- package/lib/cjs/components/anchor.d.ts +3 -0
- package/lib/cjs/components/anchor.js +34 -0
- package/lib/cjs/components/auto-complete.d.ts +7 -0
- package/lib/cjs/components/auto-complete.js +34 -0
- package/lib/cjs/components/avatar.d.ts +3 -0
- package/lib/cjs/components/avatar.js +34 -0
- package/lib/cjs/components/badge.d.ts +3 -0
- package/lib/cjs/components/badge.js +34 -0
- package/lib/cjs/components/calendar.d.ts +3 -0
- package/lib/cjs/components/calendar.js +34 -0
- package/lib/cjs/components/card.d.ts +3 -0
- package/lib/cjs/components/card.js +34 -0
- package/lib/cjs/components/carousel.d.ts +3 -0
- package/lib/cjs/components/carousel.js +34 -0
- package/lib/cjs/components/checkbox.js +13 -2
- package/lib/cjs/components/comment.d.ts +3 -0
- package/lib/cjs/components/comment.js +36 -0
- package/lib/cjs/components/date-picker.d.ts +1 -1
- package/lib/cjs/components/date-picker.js +23 -5
- package/lib/cjs/components/divider.d.ts +3 -0
- package/lib/cjs/components/divider.js +34 -0
- package/lib/cjs/components/empty.d.ts +3 -0
- package/lib/cjs/components/empty.js +34 -0
- package/lib/cjs/components/image.d.ts +3 -0
- package/lib/cjs/components/image.js +34 -0
- package/lib/cjs/components/index.d.ts +29 -0
- package/lib/cjs/components/index.js +60 -1
- package/lib/cjs/components/mentions.d.ts +3 -0
- package/lib/cjs/components/mentions.js +34 -0
- package/lib/cjs/components/pageheader.d.ts +3 -0
- package/lib/cjs/components/pageheader.js +51 -0
- package/lib/cjs/components/pagination.d.ts +3 -0
- package/lib/cjs/components/pagination.js +34 -0
- package/lib/cjs/components/placeholder.js +10 -1
- package/lib/cjs/components/popconfirm.js +16 -26
- package/lib/cjs/components/popover.d.ts +3 -0
- package/lib/cjs/components/popover.js +40 -0
- package/lib/cjs/components/radio.js +22 -8
- package/lib/cjs/components/rate.d.ts +3 -0
- package/lib/cjs/components/rate.js +51 -0
- package/lib/cjs/components/result.d.ts +3 -0
- package/lib/cjs/components/result.js +51 -0
- package/lib/cjs/components/row.js +12 -5
- package/lib/cjs/components/skeleton.d.ts +3 -0
- package/lib/cjs/components/skeleton.js +51 -0
- package/lib/cjs/components/slider.d.ts +2 -0
- package/lib/cjs/components/slider.js +51 -0
- package/lib/cjs/components/spin.d.ts +3 -0
- package/lib/cjs/components/spin.js +34 -0
- package/lib/cjs/components/statistic.d.ts +3 -0
- package/lib/cjs/components/statistic.js +51 -0
- package/lib/cjs/components/switch.d.ts +3 -0
- package/lib/cjs/components/switch.js +34 -0
- package/lib/cjs/components/table.d.ts +7 -0
- package/lib/cjs/components/table.js +34 -0
- package/lib/cjs/components/tag.d.ts +3 -0
- package/lib/cjs/components/tag.js +34 -0
- package/lib/cjs/components/time-picker.d.ts +3 -0
- package/lib/cjs/components/time-picker.js +33 -0
- package/lib/cjs/components/tooltip.d.ts +2 -0
- package/lib/cjs/components/tooltip.js +40 -0
- package/lib/cjs/components/transfer.d.ts +3 -0
- package/lib/cjs/components/transfer.js +51 -0
- package/lib/cjs/components/tree-select.d.ts +7 -0
- package/lib/cjs/components/tree-select.js +34 -0
- package/lib/cjs/components/typography.js +2 -1
- package/lib/cjs/components/upload.d.ts +3 -0
- package/lib/cjs/components/upload.js +50 -0
- package/lib/cjs/prototypes/auto-complete.js +6 -5
- package/lib/cjs/prototypes/breadcrumb.js +33 -4
- package/lib/cjs/prototypes/divider.js +1 -1
- package/lib/cjs/prototypes/page-header.js +2 -1
- package/lib/cjs/prototypes/radio.js +11 -10
- package/lib/cjs/prototypes/steps.js +6 -5
- package/lib/cjs/prototypes/tree-select.js +7 -6
- package/lib/esm/components/anchor.d.ts +3 -0
- package/lib/esm/components/anchor.js +31 -0
- package/lib/esm/components/auto-complete.d.ts +7 -0
- package/lib/esm/components/auto-complete.js +31 -0
- package/lib/esm/components/avatar.d.ts +3 -0
- package/lib/esm/components/avatar.js +31 -0
- package/lib/esm/components/badge.d.ts +3 -0
- package/lib/esm/components/badge.js +31 -0
- package/lib/esm/components/calendar.d.ts +3 -0
- package/lib/esm/components/calendar.js +31 -0
- package/lib/esm/components/card.d.ts +3 -0
- package/lib/esm/components/card.js +31 -0
- package/lib/esm/components/carousel.d.ts +3 -0
- package/lib/esm/components/carousel.js +31 -0
- package/lib/esm/components/checkbox.js +13 -2
- package/lib/esm/components/comment.d.ts +3 -0
- package/lib/esm/components/comment.js +33 -0
- package/lib/esm/components/date-picker.d.ts +1 -1
- package/lib/esm/components/date-picker.js +23 -5
- package/lib/esm/components/divider.d.ts +3 -0
- package/lib/esm/components/divider.js +31 -0
- package/lib/esm/components/empty.d.ts +3 -0
- package/lib/esm/components/empty.js +31 -0
- package/lib/esm/components/image.d.ts +3 -0
- package/lib/esm/components/image.js +31 -0
- package/lib/esm/components/index.d.ts +29 -0
- package/lib/esm/components/index.js +29 -0
- package/lib/esm/components/mentions.d.ts +3 -0
- package/lib/esm/components/mentions.js +31 -0
- package/lib/esm/components/pageheader.d.ts +3 -0
- package/lib/esm/components/pageheader.js +48 -0
- package/lib/esm/components/pagination.d.ts +3 -0
- package/lib/esm/components/pagination.js +31 -0
- package/lib/esm/components/placeholder.js +10 -1
- package/lib/esm/components/popconfirm.js +17 -27
- package/lib/esm/components/popover.d.ts +3 -0
- package/lib/esm/components/popover.js +37 -0
- package/lib/esm/components/radio.js +22 -8
- package/lib/esm/components/rate.d.ts +3 -0
- package/lib/esm/components/rate.js +48 -0
- package/lib/esm/components/result.d.ts +3 -0
- package/lib/esm/components/result.js +48 -0
- package/lib/esm/components/row.js +12 -5
- package/lib/esm/components/skeleton.d.ts +3 -0
- package/lib/esm/components/skeleton.js +48 -0
- package/lib/esm/components/slider.d.ts +2 -0
- package/lib/esm/components/slider.js +48 -0
- package/lib/esm/components/spin.d.ts +3 -0
- package/lib/esm/components/spin.js +31 -0
- package/lib/esm/components/statistic.d.ts +3 -0
- package/lib/esm/components/statistic.js +48 -0
- package/lib/esm/components/switch.d.ts +3 -0
- package/lib/esm/components/switch.js +31 -0
- package/lib/esm/components/table.d.ts +7 -0
- package/lib/esm/components/table.js +31 -0
- package/lib/esm/components/tag.d.ts +3 -0
- package/lib/esm/components/tag.js +31 -0
- package/lib/esm/components/time-picker.d.ts +3 -0
- package/lib/esm/components/time-picker.js +30 -0
- package/lib/esm/components/tooltip.d.ts +2 -0
- package/lib/esm/components/tooltip.js +37 -0
- package/lib/esm/components/transfer.d.ts +3 -0
- package/lib/esm/components/transfer.js +48 -0
- package/lib/esm/components/tree-select.d.ts +7 -0
- package/lib/esm/components/tree-select.js +31 -0
- package/lib/esm/components/typography.js +2 -1
- package/lib/esm/components/upload.d.ts +3 -0
- package/lib/esm/components/upload.js +47 -0
- package/lib/esm/prototypes/auto-complete.js +6 -5
- package/lib/esm/prototypes/breadcrumb.js +33 -4
- package/lib/esm/prototypes/divider.js +1 -1
- package/lib/esm/prototypes/page-header.js +2 -1
- package/lib/esm/prototypes/radio.js +11 -10
- package/lib/esm/prototypes/steps.js +6 -5
- package/lib/esm/prototypes/tree-select.js +7 -6
- package/package.json +2 -2
@@ -16,6 +16,9 @@ export { Typography, Title, Paragraph, Text } from './typography';
|
|
16
16
|
export { Columns, Column } from './columns';
|
17
17
|
export { Row1 } from './row';
|
18
18
|
export { Popconfirm } from './popconfirm';
|
19
|
+
export { Popover } from './popover';
|
20
|
+
export { Tooltip } from './tooltip';
|
21
|
+
export { Result } from './result';
|
19
22
|
export { Drawer } from "./drawer";
|
20
23
|
export { DatePicker } from "./date-picker";
|
21
24
|
export { Radio, RadioGroup } from "./radio";
|
@@ -32,3 +35,29 @@ export { Timeline, TimelineItem } from './timeline';
|
|
32
35
|
export { Collapse, CollapsePanel } from './collapse';
|
33
36
|
export { List, ListItem } from './list';
|
34
37
|
export { Dropdown, DropdownButton } from './dropdown';
|
38
|
+
export { Upload } from "./upload";
|
39
|
+
export { Skeleton } from "./skeleton";
|
40
|
+
export { Spin } from './spin';
|
41
|
+
export { Anchor } from './anchor';
|
42
|
+
export { Calendar } from './calendar';
|
43
|
+
export { Carousel } from './carousel';
|
44
|
+
export { Divider } from './divider';
|
45
|
+
export { Badge } from './badge';
|
46
|
+
export { Pagination } from './pagination';
|
47
|
+
export { Table } from './table';
|
48
|
+
export { Card } from './card';
|
49
|
+
export { Tag } from './tag';
|
50
|
+
export { Avatar } from './avatar';
|
51
|
+
export { Empty } from './empty';
|
52
|
+
export { Slider } from './slider';
|
53
|
+
export { Rate } from './rate';
|
54
|
+
export { Comment } from './comment';
|
55
|
+
export { TimePicker } from './time-picker';
|
56
|
+
export { Transfer } from './transfer';
|
57
|
+
export { Statistic } from './statistic';
|
58
|
+
export { PageHeader } from './pageheader';
|
59
|
+
export { Switch } from './switch';
|
60
|
+
export { AutoComplete } from './auto-complete';
|
61
|
+
export { Mentions } from './mentions';
|
62
|
+
export { TreeSelect } from './tree-select';
|
63
|
+
export { Image } from './image';
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { MentionProps } from 'antd';
|
2
|
+
import React from 'react';
|
3
|
+
export declare const Mentions: React.ForwardRefExoticComponent<Omit<MentionProps & React.RefAttributes<import("antd/lib/mentions").MentionsRef> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Mentions as AntMentions } 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 MentionsDesigner(_a) {
|
7
|
+
var _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
|
+
const mentionsRef = useRef(null);
|
9
|
+
useEffect(() => {
|
10
|
+
Promise.resolve().then(() => {
|
11
|
+
const popoverNode = document.querySelector('.ant-mentions');
|
12
|
+
// console.log('spinNode', popoverNode);
|
13
|
+
if (popoverNode) {
|
14
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
15
|
+
popoverNode.setAttribute('data-id', dataId);
|
16
|
+
popoverNode.setAttribute('draggable', 'true');
|
17
|
+
}
|
18
|
+
});
|
19
|
+
}, [dataDnd, dataId]);
|
20
|
+
return (React.createElement("div", { ref: mentionsRef },
|
21
|
+
React.createElement(AntMentions, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
22
|
+
}
|
23
|
+
export const Mentions = defineComponent(AntMentions, {
|
24
|
+
name: 'Mentions',
|
25
|
+
designerConfig: {
|
26
|
+
render({ designerProps, originalProps }) {
|
27
|
+
// console.log("Mentions: designerProps:", designerProps, "originalProps:", originalProps);
|
28
|
+
return React.createElement(MentionsDesigner, Object.assign({}, designerProps, originalProps));
|
29
|
+
}
|
30
|
+
}
|
31
|
+
});
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { PageHeader as AntPageHeader } 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 PageHeaderDesigner(_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 pageHeaderRef = 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-page-header');
|
27
|
+
console.log('pageHeader', 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: pageHeaderRef },
|
36
|
+
React.createElement(AntPageHeader, Object.assign({ title: title, "data-dnd": dataDnd, "data-id": dataId }, rest), children)));
|
37
|
+
}
|
38
|
+
export const PageHeader = defineComponent(AntPageHeader, {
|
39
|
+
name: 'PageHeader',
|
40
|
+
designerConfig: {
|
41
|
+
render({ designerProps, originalProps }) {
|
42
|
+
console.log("PageHeader: designerProps:", designerProps, "originalProps:", originalProps);
|
43
|
+
return React.createElement(PageHeaderDesigner, Object.assign({ title: "\u4E00\u7EA7\u6807\u9898" }, designerProps, originalProps));
|
44
|
+
},
|
45
|
+
},
|
46
|
+
// designerConfig: {
|
47
|
+
// },
|
48
|
+
});
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Pagination as AntPagination } 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 PaginationDesigner(_a) {
|
7
|
+
var _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
|
+
const paginationRef = useRef(null);
|
9
|
+
useEffect(() => {
|
10
|
+
Promise.resolve().then(() => {
|
11
|
+
const popoverNode = document.querySelector('.ant-pagination');
|
12
|
+
// console.log('spinNode', popoverNode);
|
13
|
+
if (popoverNode) {
|
14
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
15
|
+
popoverNode.setAttribute('data-id', dataId);
|
16
|
+
popoverNode.setAttribute('draggable', 'true');
|
17
|
+
}
|
18
|
+
});
|
19
|
+
}, [dataDnd, dataId]);
|
20
|
+
return (React.createElement("div", { ref: paginationRef },
|
21
|
+
React.createElement(AntPagination, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
22
|
+
}
|
23
|
+
export const Pagination = defineComponent(AntPagination, {
|
24
|
+
name: 'Pagination',
|
25
|
+
designerConfig: {
|
26
|
+
render({ designerProps, originalProps }) {
|
27
|
+
// console.log("Pagination: designerProps:", designerProps, "originalProps:", originalProps);
|
28
|
+
return React.createElement(PaginationDesigner, Object.assign({}, designerProps, originalProps));
|
29
|
+
}
|
30
|
+
}
|
31
|
+
});
|
@@ -31,6 +31,15 @@ function PlaceholderView(_a) {
|
|
31
31
|
//placeholder = '点击或拖拽组件/区块到这里',
|
32
32
|
placeholder = '点击或拖拽组件/区块到这里' } = _a, rest = __rest(_a, ["size", "placeholder"]);
|
33
33
|
const height = sizeMap[size];
|
34
|
-
|
34
|
+
console.log('zcq-PlaceholderView01', rest);
|
35
|
+
//去除rest里的dnd-id属性,解决row等容器组件能否直接选中问题
|
36
|
+
const newRest = Object.keys(rest)
|
37
|
+
.filter(key => key !== "data-dnd")
|
38
|
+
.reduce((acc, key) => {
|
39
|
+
acc[key] = rest[key];
|
40
|
+
return acc;
|
41
|
+
}, {});
|
42
|
+
console.log('zcq-PlaceholderView02', newRest);
|
43
|
+
return (React.createElement(Box, Object.assign({ className: "tango-placeholder", height: height, css: placeholderStyle }, newRest), placeholder));
|
35
44
|
}
|
36
45
|
export const Placeholder = defineComponent(PlaceholderView);
|
@@ -1,38 +1,28 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { Popconfirm as AntPopconfirm } 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
6
|
function PopconfirmDesigner(_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"]);
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
console.log('找到了 Popconfirm 的弹出层容器', node);
|
21
|
-
node.setAttribute('data-dnd', dataDnd);
|
22
|
-
observer.current.disconnect(); // 一旦找到并修改,就停止观察
|
23
|
-
}
|
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('.ant-popconfirm');
|
16
|
+
console.log('popoverNode', popoverNode);
|
17
|
+
if (popoverNode) {
|
18
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
19
|
+
popoverNode.setAttribute('data-id', dataId);
|
24
20
|
}
|
25
21
|
});
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
|
30
|
-
observer.current.observe(container, { childList: true, subtree: true });
|
31
|
-
return () => {
|
32
|
-
observer.current.disconnect(); // 组件卸载时停止观察
|
33
|
-
};
|
34
|
-
}, []);
|
35
|
-
return (React.createElement(AntPopconfirm, Object.assign({ title: title }, rest, { style: style }), children));
|
22
|
+
}
|
23
|
+
};
|
24
|
+
return (React.createElement("div", { ref: popconfirmRef },
|
25
|
+
React.createElement(AntPopconfirm, Object.assign({ title: title, onOpenChange: handleVisibleChange }, rest), children)));
|
36
26
|
}
|
37
27
|
export const Popconfirm = defineComponent(AntPopconfirm, {
|
38
28
|
name: 'Popconfirm',
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Popover as AntPopover } from 'antd';
|
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('.ant-popover');
|
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
|
+
return (React.createElement("div", { ref: popoverRef },
|
25
|
+
React.createElement(AntPopover, Object.assign({ title: title, onOpenChange: handleVisibleChange }, rest), children)));
|
26
|
+
}
|
27
|
+
export const Popover = defineComponent(AntPopover, {
|
28
|
+
name: 'Popover',
|
29
|
+
designerConfig: {
|
30
|
+
render({ designerProps, originalProps }) {
|
31
|
+
console.log("Popover: designerProps:", designerProps, "originalProps:", originalProps);
|
32
|
+
return React.createElement(PopoverDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
|
33
|
+
},
|
34
|
+
},
|
35
|
+
// designerConfig: {
|
36
|
+
// },
|
37
|
+
});
|
@@ -1,21 +1,35 @@
|
|
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
|
-
var { style } = _a, rest = __rest(_a, ["style"]);
|
7
|
-
const
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
var { children, style } = _a, rest = __rest(_a, ["children", "style"]);
|
7
|
+
// const radioRef = useRef<HTMLDivElement>(null);
|
8
|
+
useEffect(() => {
|
9
|
+
Promise.resolve().then(() => {
|
10
|
+
const popoverNode = document.querySelector('.ant-radio');
|
11
|
+
console.log('popoverNode', popoverNode);
|
12
|
+
if (popoverNode) {
|
13
|
+
popoverNode.setAttribute('draggable', 'true');
|
14
|
+
}
|
15
|
+
});
|
16
|
+
}, []);
|
17
|
+
// const { optionType } = rest;
|
18
|
+
// if (optionType === 'button') {
|
19
|
+
// return (
|
20
|
+
// <div ref={radioRef} className='.ant-radio'>
|
21
|
+
// <AntRadio.Button {...rest} style={style} >{rest.label}</AntRadio.Button>
|
22
|
+
// </div>
|
23
|
+
// );
|
24
|
+
// }
|
25
|
+
return (React.createElement(AntRadio, Object.assign({}, rest, { style: style }), children));
|
12
26
|
}
|
13
27
|
export const Radio = defineComponent(AntRadio, {
|
14
28
|
name: 'Radio',
|
15
29
|
designerConfig: {
|
16
30
|
render({ designerProps, originalProps, }) {
|
17
31
|
console.log("designerProps:", designerProps, "originalProps:", originalProps);
|
18
|
-
return React.createElement(RadioDesigner, Object.assign({
|
32
|
+
return React.createElement(RadioDesigner, Object.assign({}, designerProps, originalProps));
|
19
33
|
},
|
20
34
|
},
|
21
35
|
});
|
@@ -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
|
+
});
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Result as AntResult } 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 ResultDesigner(_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 resultRef = useRef(null);
|
9
|
+
useEffect(() => {
|
10
|
+
Promise.resolve().then(() => {
|
11
|
+
const popoverNode = document.querySelector('.ant-result');
|
12
|
+
console.log('popoverNode', popoverNode);
|
13
|
+
if (popoverNode) {
|
14
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
15
|
+
popoverNode.setAttribute('data-id', dataId);
|
16
|
+
popoverNode.setAttribute('draggable', 'true');
|
17
|
+
}
|
18
|
+
});
|
19
|
+
}, [dataDnd, dataId]);
|
20
|
+
// 监听弹层显示事件
|
21
|
+
// const handleVisibleChange = (visible: boolean) => {
|
22
|
+
// console.log('handleVisibleChange', visible);
|
23
|
+
// if (visible) {
|
24
|
+
// // 使用微任务确保弹层已渲染
|
25
|
+
// Promise.resolve().then(() => {
|
26
|
+
// const popoverNode = document.querySelector('.ant-popover-placement-top');
|
27
|
+
// console.log('popoverNode' ,popoverNode)
|
28
|
+
// if (popoverNode) {
|
29
|
+
// popoverNode.setAttribute('data-dnd', dataDnd);
|
30
|
+
// popoverNode.setAttribute('data-id', dataId);
|
31
|
+
// }
|
32
|
+
// });
|
33
|
+
// }
|
34
|
+
// };
|
35
|
+
return (React.createElement("div", { ref: resultRef },
|
36
|
+
React.createElement(AntResult, Object.assign({ title: title, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
37
|
+
}
|
38
|
+
export const Result = defineComponent(AntResult, {
|
39
|
+
name: 'Result',
|
40
|
+
designerConfig: {
|
41
|
+
render({ designerProps, originalProps }) {
|
42
|
+
console.log("Result: designerProps:", designerProps, "originalProps:", originalProps);
|
43
|
+
return React.createElement(ResultDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
|
44
|
+
},
|
45
|
+
},
|
46
|
+
// designerConfig: {
|
47
|
+
// },
|
48
|
+
});
|
@@ -2,7 +2,6 @@ import { __rest } from "tslib";
|
|
2
2
|
import React from 'react';
|
3
3
|
import { coral } from 'coral-system';
|
4
4
|
import { defineComponent } from '@music163/tango-boot';
|
5
|
-
import { Placeholder } from './placeholder';
|
6
5
|
//import { ShadowContainer } from './shadow-container';
|
7
6
|
// const BaseRowWrapper = coral(
|
8
7
|
// 'div',
|
@@ -25,11 +24,19 @@ const rowStyle = {
|
|
25
24
|
// children?: React.ReactNode;
|
26
25
|
// }
|
27
26
|
function RowDesigner(_a) {
|
27
|
+
// useEffect(() => {
|
28
|
+
// Promise.resolve().then(() => {
|
29
|
+
// const popoverNode = document.querySelector('.ant-raw');
|
30
|
+
// // console.log('spinNode', popoverNode);
|
31
|
+
// if (popoverNode) {
|
32
|
+
// popoverNode.setAttribute('draggable', 'true');
|
28
33
|
var { gutter, align, justify, prefixCls, wrap, style, children } = _a, rest = __rest(_a, ["gutter", "align", "justify", "prefixCls", "wrap", "style", "children"]);
|
29
|
-
//
|
30
|
-
|
31
|
-
|
32
|
-
|
34
|
+
// }
|
35
|
+
// });
|
36
|
+
// }, []);
|
37
|
+
console.log("zcq栅格行的入参", gutter, align, justify, prefixCls, wrap, style, children);
|
38
|
+
return (React.createElement("div", { style: Object.assign(Object.assign({}, rowStyle), style) },
|
39
|
+
React.createElement("div", null, children || React.createElement("div", null, "\u62D6\u5165\u7EC4\u4EF6"))));
|
33
40
|
}
|
34
41
|
const Div = coral('div', undefined, {
|
35
42
|
prefix: '--music',
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Skeleton as AntSkeleton } 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 SkeletonDesigner(_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
|
+
const skeletonRef = 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-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]);
|
35
|
+
return (React.createElement("div", { ref: skeletonRef },
|
36
|
+
React.createElement(AntSkeleton, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest), children)));
|
37
|
+
}
|
38
|
+
export const Skeleton = defineComponent(AntSkeleton, {
|
39
|
+
name: 'Skeleton',
|
40
|
+
designerConfig: {
|
41
|
+
render({ designerProps, originalProps }) {
|
42
|
+
console.log("Skeleton: designerProps:", designerProps, "originalProps:", originalProps);
|
43
|
+
return React.createElement(SkeletonDesigner, Object.assign({}, designerProps, originalProps));
|
44
|
+
},
|
45
|
+
},
|
46
|
+
// designerConfig: {
|
47
|
+
// },
|
48
|
+
});
|
@@ -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
|
+
});
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Spin as AntSpin } 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 SpinDesigner(_a) {
|
7
|
+
var { children, spinning } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", "spinning", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
|
+
const spinRef = useRef(null);
|
9
|
+
useEffect(() => {
|
10
|
+
Promise.resolve().then(() => {
|
11
|
+
const popoverNode = document.querySelector('.ant-spin');
|
12
|
+
// console.log('spinNode', popoverNode);
|
13
|
+
if (popoverNode) {
|
14
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
15
|
+
popoverNode.setAttribute('data-id', dataId);
|
16
|
+
popoverNode.setAttribute('draggable', 'true');
|
17
|
+
}
|
18
|
+
});
|
19
|
+
}, [dataDnd, dataId]);
|
20
|
+
return (React.createElement("div", { ref: spinRef },
|
21
|
+
React.createElement(AntSpin, Object.assign({ spinning: spinning, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
22
|
+
}
|
23
|
+
export const Spin = defineComponent(AntSpin, {
|
24
|
+
name: 'Spin',
|
25
|
+
designerConfig: {
|
26
|
+
render({ designerProps, originalProps }) {
|
27
|
+
// console.log("Spin: designerProps:", designerProps, "originalProps:", originalProps);
|
28
|
+
return React.createElement(SpinDesigner, Object.assign({ spinning: true }, designerProps, originalProps));
|
29
|
+
},
|
30
|
+
},
|
31
|
+
});
|