@cuvp1225/antd 0.2.74 → 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
@@ -0,0 +1,48 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Statistic as AntStatistic } 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 StatisticDesigner(_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 statisticRef = 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-statistic');
|
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: statisticRef },
|
36
|
+
React.createElement(AntStatistic, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest))));
|
37
|
+
}
|
38
|
+
export const Statistic = defineComponent(AntStatistic, {
|
39
|
+
name: 'Statistic',
|
40
|
+
designerConfig: {
|
41
|
+
render({ designerProps, originalProps }) {
|
42
|
+
console.log("Statistic: designerProps:", designerProps, "originalProps:", originalProps);
|
43
|
+
return React.createElement(StatisticDesigner, 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 { Switch as AntSwitch } 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 SwitchDesigner(_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 switchRef = useRef(null);
|
9
|
+
useEffect(() => {
|
10
|
+
Promise.resolve().then(() => {
|
11
|
+
const popoverNode = document.querySelector('.ant-switch');
|
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: switchRef },
|
21
|
+
React.createElement(AntSwitch, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
22
|
+
}
|
23
|
+
export const Switch = defineComponent(AntSwitch, {
|
24
|
+
name: 'Switch',
|
25
|
+
designerConfig: {
|
26
|
+
render({ designerProps, originalProps }) {
|
27
|
+
// console.log("Switch: designerProps:", designerProps, "originalProps:", originalProps);
|
28
|
+
return React.createElement(SwitchDesigner, Object.assign({}, designerProps, originalProps));
|
29
|
+
}
|
30
|
+
}
|
31
|
+
});
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { TableProps } from 'antd';
|
2
|
+
import React from 'react';
|
3
|
+
export declare const Table: React.ForwardRefExoticComponent<Omit<TableProps<object> & {
|
4
|
+
children?: React.ReactNode;
|
5
|
+
} & {
|
6
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
7
|
+
} & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Table as AntTable } 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 TableDesigner(_a) {
|
7
|
+
var { children, columns, dataSource } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", "columns", "dataSource", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
|
+
const tableRef = useRef(null);
|
9
|
+
useEffect(() => {
|
10
|
+
Promise.resolve().then(() => {
|
11
|
+
const popoverNode = document.querySelector('.ant-table');
|
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: tableRef },
|
21
|
+
React.createElement(AntTable, Object.assign({ columns: columns, dataSource: dataSource, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
22
|
+
}
|
23
|
+
export const Table = defineComponent(AntTable, {
|
24
|
+
name: 'Table',
|
25
|
+
designerConfig: {
|
26
|
+
render({ designerProps, originalProps }) {
|
27
|
+
// console.log("Table: designerProps:", designerProps, "originalProps:", originalProps);
|
28
|
+
return React.createElement(TableDesigner, Object.assign({}, designerProps, originalProps));
|
29
|
+
}
|
30
|
+
}
|
31
|
+
});
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Tag as AntTag } 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 TagDesigner(_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 tagRef = useRef(null);
|
9
|
+
useEffect(() => {
|
10
|
+
Promise.resolve().then(() => {
|
11
|
+
const popoverNode = document.querySelector('.ant-tag');
|
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: tagRef },
|
21
|
+
React.createElement(AntTag, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
22
|
+
}
|
23
|
+
export const Tag = defineComponent(AntTag, {
|
24
|
+
name: 'Tag',
|
25
|
+
designerConfig: {
|
26
|
+
render({ designerProps, originalProps }) {
|
27
|
+
// console.log("Tag: designerProps:", designerProps, "originalProps:", originalProps);
|
28
|
+
return React.createElement(TagDesigner, Object.assign({}, designerProps, originalProps));
|
29
|
+
}
|
30
|
+
}
|
31
|
+
});
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { TimePickerProps } from 'antd';
|
2
|
+
import React from 'react';
|
3
|
+
export declare const TimePicker: React.ForwardRefExoticComponent<Omit<TimePickerProps & React.RefAttributes<any> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { TimePicker as AntTimePicker } 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 TimePickerDesigner(_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 timePickerRef = useRef(null);
|
9
|
+
useEffect(() => {
|
10
|
+
Promise.resolve().then(() => {
|
11
|
+
const popoverNode = document.querySelector('.ant-timePicker');
|
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(AntTimePicker, Object.assign({ className: 'ant-timePicker', "data-dnd": dataDnd, "data-id": dataId, style: style }, rest)));
|
21
|
+
}
|
22
|
+
export const TimePicker = defineComponent(AntTimePicker, {
|
23
|
+
name: 'TimePicker',
|
24
|
+
designerConfig: {
|
25
|
+
render({ designerProps, originalProps }) {
|
26
|
+
// console.log("TimePicker: designerProps:", designerProps, "originalProps:", originalProps);
|
27
|
+
return React.createElement(TimePickerDesigner, Object.assign({}, designerProps, originalProps));
|
28
|
+
}
|
29
|
+
}
|
30
|
+
});
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import React from 'react';
|
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>>;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Tooltip as AntTooltip } from 'antd';
|
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('.ant-tooltip');
|
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: tooltipRef },
|
25
|
+
React.createElement(AntTooltip, Object.assign({ title: title, onOpenChange: handleVisibleChange }, rest), children)));
|
26
|
+
}
|
27
|
+
export const Tooltip = defineComponent(AntTooltip, {
|
28
|
+
name: 'Tooltip',
|
29
|
+
designerConfig: {
|
30
|
+
render({ designerProps, originalProps }) {
|
31
|
+
console.log("Tooltip: designerProps:", designerProps, "originalProps:", originalProps);
|
32
|
+
return React.createElement(TooltipDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
|
33
|
+
},
|
34
|
+
},
|
35
|
+
// designerConfig: {
|
36
|
+
// },
|
37
|
+
});
|
@@ -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
|
+
});
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { TreeSelectProps } from 'antd';
|
2
|
+
import React from 'react';
|
3
|
+
export declare const TreeSelect: React.ForwardRefExoticComponent<Omit<TreeSelectProps<unknown, import("rc-tree-select/lib/TreeSelect").DefaultOptionType | import("rc-tree-select/lib/TreeSelect").BaseOptionType> & {
|
4
|
+
children?: React.ReactNode;
|
5
|
+
} & {
|
6
|
+
ref?: React.Ref<import("antd").RefSelectProps> | undefined;
|
7
|
+
} & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { TreeSelect as AntTreeSelect } 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 TreeSelectDesigner(_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 treeselectRef = useRef(null);
|
9
|
+
useEffect(() => {
|
10
|
+
Promise.resolve().then(() => {
|
11
|
+
const popoverNode = document.querySelector('.ant-tree-select');
|
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: treeselectRef },
|
21
|
+
React.createElement(AntTreeSelect, Object.assign({ className: 'ant-tree-select', "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
22
|
+
}
|
23
|
+
export const TreeSelect = defineComponent(AntTreeSelect, {
|
24
|
+
name: 'TreeSelect',
|
25
|
+
designerConfig: {
|
26
|
+
render({ designerProps, originalProps }) {
|
27
|
+
// console.log("TreeSelect: designerProps:", designerProps, "originalProps:", originalProps);
|
28
|
+
return React.createElement(TreeSelectDesigner, Object.assign({}, designerProps, originalProps));
|
29
|
+
}
|
30
|
+
}
|
31
|
+
});
|
@@ -15,7 +15,8 @@ export const Typography = defineComponent(AntTypography, {
|
|
15
15
|
name: 'Typography',
|
16
16
|
designerConfig: {
|
17
17
|
defaultProps: {
|
18
|
-
children: React.createElement(
|
18
|
+
children: React.createElement("div", null,
|
19
|
+
React.createElement(Placeholder, { placeholder: "\u6DFB\u52A0\u6807\u9898\u6216\u6BB5\u843D\u5230\u8FD9\u91CC" })),
|
19
20
|
},
|
20
21
|
},
|
21
22
|
});
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Upload as AntUpload } 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 UploadDesigner(_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 uploadRef = useRef(null);
|
9
|
+
useEffect(() => {
|
10
|
+
Promise.resolve().then(() => {
|
11
|
+
const popoverNode = document.querySelector('.ant-upload');
|
12
|
+
console.log('uploadNode', popoverNode);
|
13
|
+
if (popoverNode) {
|
14
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
15
|
+
popoverNode.setAttribute('data-id', dataId);
|
16
|
+
}
|
17
|
+
});
|
18
|
+
}, [dataDnd, dataId]);
|
19
|
+
// 监听弹层显示事件
|
20
|
+
// const handleVisibleChange = (visible: boolean) => {
|
21
|
+
// console.log('handleVisibleChange', visible);
|
22
|
+
// if (visible) {
|
23
|
+
// // 使用微任务确保弹层已渲染
|
24
|
+
// Promise.resolve().then(() => {
|
25
|
+
// const popoverNode = document.querySelector('.ant-popover-placement-top');
|
26
|
+
// console.log('popoverNode' ,popoverNode)
|
27
|
+
// if (popoverNode) {
|
28
|
+
// popoverNode.setAttribute('data-dnd', dataDnd);
|
29
|
+
// popoverNode.setAttribute('data-id', dataId);
|
30
|
+
// }
|
31
|
+
// });
|
32
|
+
// }
|
33
|
+
// };
|
34
|
+
return (React.createElement("div", { ref: uploadRef },
|
35
|
+
React.createElement(AntUpload, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest), children)));
|
36
|
+
}
|
37
|
+
export const Upload = defineComponent(AntUpload, {
|
38
|
+
name: 'Upload',
|
39
|
+
designerConfig: {
|
40
|
+
render({ designerProps, originalProps }) {
|
41
|
+
console.log("Upload: designerProps:", designerProps, "originalProps:", originalProps);
|
42
|
+
return React.createElement(UploadDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
|
43
|
+
},
|
44
|
+
},
|
45
|
+
// designerConfig: {
|
46
|
+
// },
|
47
|
+
});
|
@@ -172,13 +172,14 @@ export const AutoComplete = {
|
|
172
172
|
{
|
173
173
|
name: 'style',
|
174
174
|
title: '样式对象',
|
175
|
-
setter: 'expressionSetter',
|
176
|
-
setterProps: {
|
177
|
-
|
178
|
-
},
|
175
|
+
// setter: 'expressionSetter',
|
176
|
+
// setterProps: {
|
177
|
+
// expressionType: 'cssObject',
|
178
|
+
// },
|
179
|
+
setter: 'cssSetter',
|
179
180
|
group: 'style',
|
180
181
|
initValue: '{{{width: "200px"}}}',
|
181
|
-
autoCompleteOptions: ['{}'],
|
182
|
+
// autoCompleteOptions: ['{}'],
|
182
183
|
},
|
183
184
|
{
|
184
185
|
name: 'className',
|
@@ -16,6 +16,7 @@ export const Breadcrumb = {
|
|
16
16
|
name: 'separator',
|
17
17
|
title: '分隔符自定义',
|
18
18
|
setter: 'expressionSetter',
|
19
|
+
initValue: '>',
|
19
20
|
},
|
20
21
|
{
|
21
22
|
name: 'itemRender',
|
@@ -23,8 +24,31 @@ export const Breadcrumb = {
|
|
23
24
|
tip: '自定义链接函数,和 react-router 配置使用',
|
24
25
|
setter: 'expressionSetter',
|
25
26
|
},
|
26
|
-
{
|
27
|
-
|
27
|
+
{
|
28
|
+
name: 'params',
|
29
|
+
title: '路由的参数',
|
30
|
+
tip: '输入格式为: { id: 1 }',
|
31
|
+
setter: 'expressionSetter'
|
32
|
+
},
|
33
|
+
{
|
34
|
+
name: 'routes',
|
35
|
+
title: 'router 的路由栈信息',
|
36
|
+
setter: 'expressionSetter',
|
37
|
+
initValue: null,
|
38
|
+
autoCompleteOptions: [
|
39
|
+
`[
|
40
|
+
{ path: "/home", breadcrumbName: "Home" },
|
41
|
+
{
|
42
|
+
path: "/user",
|
43
|
+
breadcrumbName: "User",
|
44
|
+
children: [
|
45
|
+
{ path: "/user1", breadcrumbName: "User1" },
|
46
|
+
{ path: "/user2", breadcrumbName: "User2" },
|
47
|
+
],
|
48
|
+
},
|
49
|
+
]`
|
50
|
+
]
|
51
|
+
},
|
28
52
|
],
|
29
53
|
};
|
30
54
|
export const BreadcrumbItem = {
|
@@ -37,9 +61,14 @@ export const BreadcrumbItem = {
|
|
37
61
|
props: [
|
38
62
|
...StylePrototypes,
|
39
63
|
{ name: 'children', title: '文案', setter: 'textSetter', initValue: '节点名称' },
|
40
|
-
{ name: 'href', title: '链接的目的地', setter: 'textSetter' },
|
41
64
|
{
|
42
|
-
name: '
|
65
|
+
name: 'href',
|
66
|
+
title: '链接的目的地',
|
67
|
+
setter: 'textSetter',
|
68
|
+
initValue: null,
|
69
|
+
},
|
70
|
+
{
|
71
|
+
name: 'menu',
|
43
72
|
title: '下拉菜单的内容',
|
44
73
|
setter: 'expressionSetter',
|
45
74
|
group: 'advanced',
|
@@ -42,6 +42,7 @@ export const PageHeader = {
|
|
42
42
|
name: 'subTitle',
|
43
43
|
title: '二级标题文字',
|
44
44
|
setter: 'expressionSetter',
|
45
|
+
initValue: '二级标题',
|
45
46
|
},
|
46
47
|
{
|
47
48
|
name: 'tags',
|
@@ -49,7 +50,7 @@ export const PageHeader = {
|
|
49
50
|
tip: '位于title旁',
|
50
51
|
setter: 'expressionSetter',
|
51
52
|
},
|
52
|
-
{ name: 'title', title: '自定义标题文字', setter: 'expressionSetter' },
|
53
|
+
{ name: 'title', title: '自定义标题文字', setter: 'expressionSetter', initValue: '标题' },
|
53
54
|
{
|
54
55
|
name: 'onBack',
|
55
56
|
title: '返回按钮的点击事件',
|
@@ -31,16 +31,17 @@ export const Radio = {
|
|
31
31
|
initValue: '单项1',
|
32
32
|
setter: 'textSetter',
|
33
33
|
},
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
34
|
+
// `optionType` is only support in Radio.Group
|
35
|
+
// {
|
36
|
+
// name: 'optionType',
|
37
|
+
// title: '选项类型',
|
38
|
+
// setter: 'choiceSetter',
|
39
|
+
// initValue: 'default',
|
40
|
+
// options: [
|
41
|
+
// { label: '默认', value: 'default' },
|
42
|
+
// { label: '按钮类型', value: 'button' },
|
43
|
+
// ],
|
44
|
+
// },
|
44
45
|
{
|
45
46
|
name: 'defaultChecked',
|
46
47
|
title: '初始选中',
|
@@ -15,13 +15,14 @@ export const Steps = {
|
|
15
15
|
{
|
16
16
|
name: 'style',
|
17
17
|
title: '样式对象',
|
18
|
-
setter: 'expressionSetter',
|
19
|
-
setterProps: {
|
20
|
-
|
21
|
-
},
|
18
|
+
// setter: 'expressionSetter',
|
19
|
+
// setterProps: {
|
20
|
+
// expressionType: 'cssObject',
|
21
|
+
// },
|
22
|
+
setter: 'cssSetter',
|
22
23
|
group: 'style',
|
23
24
|
initValue: '{{{width: "100%"}}}',
|
24
|
-
autoCompleteOptions: ['{}'],
|
25
|
+
// autoCompleteOptions: ['{}'],
|
25
26
|
},
|
26
27
|
{
|
27
28
|
name: 'className',
|
@@ -10,17 +10,17 @@ export const TreeSelect = {
|
|
10
10
|
childrenName: 'TreeNode',
|
11
11
|
relatedImports: ['TreeNode'],
|
12
12
|
props: [
|
13
|
-
// ...StylePrototypes,
|
14
13
|
{
|
15
14
|
name: 'style',
|
16
15
|
title: '样式对象',
|
17
|
-
setter: 'expressionSetter',
|
18
|
-
setterProps: {
|
19
|
-
|
20
|
-
},
|
16
|
+
// setter: 'expressionSetter',
|
17
|
+
// setterProps: {
|
18
|
+
// expressionType: 'cssObject',
|
19
|
+
// },
|
20
|
+
setter: 'cssSetter',
|
21
21
|
group: 'style',
|
22
22
|
initValue: '{{{width: "100%"}}}',
|
23
|
-
autoCompleteOptions: ['{}'],
|
23
|
+
// autoCompleteOptions: ['{}'],
|
24
24
|
},
|
25
25
|
{
|
26
26
|
name: 'className',
|
@@ -28,6 +28,7 @@ export const TreeSelect = {
|
|
28
28
|
setter: 'classNameSetter',
|
29
29
|
group: 'style',
|
30
30
|
},
|
31
|
+
// ...StylePrototypes,
|
31
32
|
...InstancePrototypes,
|
32
33
|
{
|
33
34
|
name: 'treeData',
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@cuvp1225/antd",
|
3
|
-
"version": "0.2.
|
3
|
+
"version": "0.2.75",
|
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": "9234ba34350f140a142935cd08790b7b62f52612"
|
58
58
|
}
|