@cuvp1225/antd 0.2.75 → 0.2.77
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 +100 -45
- package/dist/index.js +94 -39
- package/lib/cjs/components/affix.d.ts +1 -0
- package/lib/cjs/components/affix.js +18 -0
- package/lib/cjs/components/alert.d.ts +3 -0
- package/lib/cjs/components/alert.js +32 -0
- package/lib/cjs/components/anchor.js +16 -3
- package/lib/cjs/components/auto-complete.js +2 -2
- package/lib/cjs/components/avatar.js +2 -2
- package/lib/cjs/components/badge.js +6 -3
- package/lib/cjs/components/calendar.js +2 -2
- package/lib/cjs/components/card.js +2 -2
- package/lib/cjs/components/carousel.js +2 -4
- package/lib/cjs/components/checkbox.js +7 -4
- package/lib/cjs/components/collapse.d.ts +4 -2
- package/lib/cjs/components/collapse.js +25 -1
- package/lib/cjs/components/comment.js +2 -2
- package/lib/cjs/components/date-picker.js +2 -2
- package/lib/cjs/components/descriptions.d.ts +3 -0
- package/lib/cjs/components/descriptions.js +32 -0
- package/lib/cjs/components/divider.js +2 -2
- package/lib/cjs/components/drawer.js +1 -2
- package/lib/cjs/components/empty.js +2 -2
- package/lib/cjs/components/image.js +4 -3
- package/lib/cjs/components/index.d.ts +5 -0
- package/lib/cjs/components/index.js +12 -1
- package/lib/cjs/components/input-number.js +27 -24
- package/lib/cjs/components/mentions.js +2 -2
- package/lib/cjs/components/pageheader.js +2 -2
- package/lib/cjs/components/pagination.js +2 -2
- package/lib/cjs/components/placeholder.js +10 -10
- package/lib/cjs/components/popconfirm.js +3 -2
- package/lib/cjs/components/popover.js +3 -2
- package/lib/cjs/components/progress.d.ts +3 -0
- package/lib/cjs/components/progress.js +38 -0
- package/lib/cjs/components/radio.js +7 -4
- package/lib/cjs/components/rate.js +2 -2
- package/lib/cjs/components/result.js +2 -2
- package/lib/cjs/components/skeleton.js +2 -2
- package/lib/cjs/components/slider.js +2 -2
- package/lib/cjs/components/spin.js +5 -2
- package/lib/cjs/components/statistic.js +10 -4
- package/lib/cjs/components/switch.js +1 -1
- package/lib/cjs/components/table.js +5 -2
- package/lib/cjs/components/tabs.d.ts +3 -0
- package/lib/cjs/components/tabs.js +32 -0
- package/lib/cjs/components/tag.js +2 -2
- package/lib/cjs/components/time-picker.js +2 -2
- package/lib/cjs/components/timeline.d.ts +4 -2
- package/lib/cjs/components/timeline.js +41 -2
- package/lib/cjs/components/tooltip.js +3 -2
- package/lib/cjs/components/transfer.js +2 -2
- package/lib/cjs/components/tree-select.js +2 -2
- package/lib/cjs/components/tree.d.ts +7 -0
- package/lib/cjs/components/tree.js +32 -0
- package/lib/cjs/components/upload.js +2 -2
- package/lib/cjs/prototypes/anchor.js +1 -0
- package/lib/cjs/prototypes/descriptions.js +12 -0
- package/lib/cjs/prototypes/modal.js +1 -0
- package/lib/cjs/prototypes/slider.js +1 -1
- package/lib/cjs/prototypes/tabs.js +2 -1
- package/lib/esm/components/affix.d.ts +1 -0
- package/lib/esm/components/affix.js +16 -0
- package/lib/esm/components/alert.d.ts +3 -0
- package/lib/esm/components/alert.js +29 -0
- package/lib/esm/components/anchor.js +16 -3
- package/lib/esm/components/auto-complete.js +2 -2
- package/lib/esm/components/avatar.js +2 -2
- package/lib/esm/components/badge.js +6 -3
- package/lib/esm/components/calendar.js +2 -2
- package/lib/esm/components/card.js +2 -2
- package/lib/esm/components/carousel.js +3 -5
- package/lib/esm/components/checkbox.js +7 -4
- package/lib/esm/components/collapse.d.ts +4 -2
- package/lib/esm/components/collapse.js +25 -1
- package/lib/esm/components/comment.js +2 -2
- package/lib/esm/components/date-picker.js +2 -2
- package/lib/esm/components/descriptions.d.ts +3 -0
- package/lib/esm/components/descriptions.js +29 -0
- package/lib/esm/components/divider.js +2 -2
- package/lib/esm/components/drawer.js +1 -2
- package/lib/esm/components/empty.js +2 -2
- package/lib/esm/components/image.js +4 -3
- package/lib/esm/components/index.d.ts +5 -0
- package/lib/esm/components/index.js +6 -0
- package/lib/esm/components/input-number.js +27 -24
- package/lib/esm/components/mentions.js +2 -2
- package/lib/esm/components/pageheader.js +2 -2
- package/lib/esm/components/pagination.js +2 -2
- package/lib/esm/components/placeholder.js +10 -10
- package/lib/esm/components/popconfirm.js +3 -2
- package/lib/esm/components/popover.js +3 -2
- package/lib/esm/components/progress.d.ts +3 -0
- package/lib/esm/components/progress.js +35 -0
- package/lib/esm/components/radio.js +7 -4
- package/lib/esm/components/rate.js +2 -2
- package/lib/esm/components/result.js +2 -2
- package/lib/esm/components/skeleton.js +2 -2
- package/lib/esm/components/slider.js +2 -2
- package/lib/esm/components/spin.js +5 -2
- package/lib/esm/components/statistic.js +11 -5
- package/lib/esm/components/switch.js +1 -1
- package/lib/esm/components/table.js +5 -2
- package/lib/esm/components/tabs.d.ts +3 -0
- package/lib/esm/components/tabs.js +29 -0
- package/lib/esm/components/tag.js +2 -2
- package/lib/esm/components/time-picker.js +2 -2
- package/lib/esm/components/timeline.d.ts +4 -2
- package/lib/esm/components/timeline.js +40 -2
- package/lib/esm/components/tooltip.js +3 -2
- package/lib/esm/components/transfer.js +2 -2
- package/lib/esm/components/tree-select.js +2 -2
- package/lib/esm/components/tree.d.ts +7 -0
- package/lib/esm/components/tree.js +29 -0
- package/lib/esm/components/upload.js +2 -2
- package/lib/esm/prototypes/anchor.js +1 -0
- package/lib/esm/prototypes/descriptions.js +12 -0
- package/lib/esm/prototypes/modal.js +1 -0
- package/lib/esm/prototypes/slider.js +1 -1
- package/lib/esm/prototypes/tabs.js +2 -1
- package/package.json +2 -2
@@ -26,7 +26,7 @@ exports.Tabs = {
|
|
26
26
|
label: '选项卡1',
|
27
27
|
forceRender: false,
|
28
28
|
disabled: false,
|
29
|
-
|
29
|
+
children: `{{<Placeholder text="放置替换" style={{ margin: "15px"}} />}}`,
|
30
30
|
},
|
31
31
|
{
|
32
32
|
key: '2',
|
@@ -34,6 +34,7 @@ exports.Tabs = {
|
|
34
34
|
forceRender: false,
|
35
35
|
disabled: false,
|
36
36
|
// children: '选项卡2',
|
37
|
+
children: `{{<Placeholder text="放置替换" style={{ margin: "15px"}} />}}`,
|
37
38
|
},
|
38
39
|
]
|
39
40
|
},
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Affix as AntAffix } from 'antd';
|
3
|
+
import React from 'react';
|
4
|
+
import { Placeholder } from './placeholder';
|
5
|
+
function AffixDesigner(_a) {
|
6
|
+
var { children, style } = _a, rest = __rest(_a, ["children", "style"]);
|
7
|
+
return (React.createElement(AntAffix, Object.assign({}, rest, { style: style }), children || React.createElement(Placeholder, null)));
|
8
|
+
}
|
9
|
+
// export const Affix = defineComponent(AntAffix, {
|
10
|
+
// name: 'Affix',
|
11
|
+
// designerConfig: {
|
12
|
+
// render({ designerProps, originalProps, }) {
|
13
|
+
// return <AffixDesigner {...designerProps} {...originalProps} />;
|
14
|
+
// },
|
15
|
+
// },
|
16
|
+
// });
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Alert as AntAlert } from 'antd';
|
3
|
+
import { defineComponent } from '@music163/tango-boot';
|
4
|
+
import React, { useEffect } from 'react';
|
5
|
+
import { SLOT } from '@music163/tango-helpers';
|
6
|
+
function AlertDesigner(_a) {
|
7
|
+
var { children } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
|
+
useEffect(() => {
|
9
|
+
Promise.resolve().then(() => {
|
10
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
11
|
+
// console.log('spinNode', popoverNode);
|
12
|
+
if (popoverNode) {
|
13
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
14
|
+
popoverNode.setAttribute('data-id', dataId);
|
15
|
+
popoverNode.setAttribute('draggable', 'true');
|
16
|
+
}
|
17
|
+
});
|
18
|
+
}, [dataDnd, dataId]);
|
19
|
+
return (React.createElement(AntAlert, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest)));
|
20
|
+
}
|
21
|
+
export const Alert = defineComponent(AntAlert, {
|
22
|
+
name: 'Alert',
|
23
|
+
designerConfig: {
|
24
|
+
render({ designerProps, originalProps }) {
|
25
|
+
// console.log("Alert: designerProps:", designerProps, "originalProps:", originalProps);
|
26
|
+
return React.createElement(AlertDesigner, Object.assign({}, designerProps, originalProps));
|
27
|
+
}
|
28
|
+
}
|
29
|
+
});
|
@@ -3,12 +3,13 @@ import { Anchor as AntAnchor } from 'antd';
|
|
3
3
|
import { defineComponent } from '@music163/tango-boot';
|
4
4
|
import React, { useEffect, useRef } from 'react';
|
5
5
|
import { SLOT } from '@music163/tango-helpers';
|
6
|
+
const { Link } = AntAnchor;
|
6
7
|
function AnchorDesigner(_a) {
|
7
|
-
var {
|
8
|
+
var { items } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["items", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
9
|
const anchorRef = useRef(null);
|
9
10
|
useEffect(() => {
|
10
11
|
Promise.resolve().then(() => {
|
11
|
-
const popoverNode = document.querySelector(
|
12
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
12
13
|
console.log('spinNode', popoverNode);
|
13
14
|
if (popoverNode) {
|
14
15
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -17,8 +18,20 @@ function AnchorDesigner(_a) {
|
|
17
18
|
}
|
18
19
|
});
|
19
20
|
}, [dataDnd, dataId]);
|
21
|
+
//递归遍历生成子节点
|
22
|
+
const renderLinks = (items) => {
|
23
|
+
return items.map((item) => {
|
24
|
+
const { key, href, title, children } = item;
|
25
|
+
// 如果有子节点,则递归渲染
|
26
|
+
if (children) {
|
27
|
+
return (React.createElement(Link, { key: key, href: href, title: title }, renderLinks(children)));
|
28
|
+
}
|
29
|
+
// 没有子节点的情况
|
30
|
+
return React.createElement(Link, { key: key, href: href, title: title });
|
31
|
+
});
|
32
|
+
};
|
20
33
|
return (React.createElement("div", { ref: anchorRef, draggable: 'true' },
|
21
|
-
React.createElement(AntAnchor, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest),
|
34
|
+
React.createElement(AntAnchor, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), renderLinks(items))));
|
22
35
|
}
|
23
36
|
export const Anchor = defineComponent(AntAnchor, {
|
24
37
|
name: 'Anchor',
|
@@ -8,7 +8,7 @@ function AutoCompleteDesigner(_a) {
|
|
8
8
|
const autocompleteRef = useRef(null);
|
9
9
|
useEffect(() => {
|
10
10
|
Promise.resolve().then(() => {
|
11
|
-
const popoverNode = document.querySelector(
|
11
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
12
12
|
// console.log('spinNode', popoverNode);
|
13
13
|
if (popoverNode) {
|
14
14
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -18,7 +18,7 @@ function AutoCompleteDesigner(_a) {
|
|
18
18
|
});
|
19
19
|
}, [dataDnd, dataId]);
|
20
20
|
return (React.createElement("div", { ref: autocompleteRef },
|
21
|
-
React.createElement(AntAutoComplete, Object.assign({ className:
|
21
|
+
React.createElement(AntAutoComplete, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
22
22
|
}
|
23
23
|
export const AutoComplete = defineComponent(AntAutoComplete, {
|
24
24
|
name: 'AutoComplete',
|
@@ -8,7 +8,7 @@ function AvatarDesigner(_a) {
|
|
8
8
|
const avatarRef = useRef(null);
|
9
9
|
useEffect(() => {
|
10
10
|
Promise.resolve().then(() => {
|
11
|
-
const popoverNode = document.querySelector(
|
11
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
12
12
|
// console.log('spinNode', popoverNode);
|
13
13
|
if (popoverNode) {
|
14
14
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -18,7 +18,7 @@ function AvatarDesigner(_a) {
|
|
18
18
|
});
|
19
19
|
}, [dataDnd, dataId]);
|
20
20
|
return (React.createElement("div", { ref: avatarRef },
|
21
|
-
React.createElement(AntAvatar, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
21
|
+
React.createElement(AntAvatar, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
22
22
|
}
|
23
23
|
export const Avatar = defineComponent(AntAvatar, {
|
24
24
|
name: 'Avatar',
|
@@ -8,7 +8,7 @@ function BadgeDesigner(_a) {
|
|
8
8
|
const badgeRef = useRef(null);
|
9
9
|
useEffect(() => {
|
10
10
|
Promise.resolve().then(() => {
|
11
|
-
const popoverNode = document.querySelector(
|
11
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
12
12
|
// console.log('spinNode', popoverNode);
|
13
13
|
if (popoverNode) {
|
14
14
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -17,8 +17,11 @@ function BadgeDesigner(_a) {
|
|
17
17
|
}
|
18
18
|
});
|
19
19
|
}, [dataDnd, dataId]);
|
20
|
-
return (React.createElement("div", { ref: badgeRef
|
21
|
-
React.createElement(AntBadge, Object.assign({
|
20
|
+
return (React.createElement("div", { ref: badgeRef },
|
21
|
+
React.createElement(AntBadge, Object.assign({ className: dataId,
|
22
|
+
// data-dnd={dataDnd}
|
23
|
+
// data-id={dataId}
|
24
|
+
style: style }, rest), children)));
|
22
25
|
}
|
23
26
|
export const Badge = defineComponent(AntBadge, {
|
24
27
|
name: 'Badge',
|
@@ -8,7 +8,7 @@ function CalendarDesigner(_a) {
|
|
8
8
|
const calendarRef = useRef(null);
|
9
9
|
useEffect(() => {
|
10
10
|
Promise.resolve().then(() => {
|
11
|
-
const popoverNode = document.querySelector(
|
11
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
12
12
|
console.log('spinNode', popoverNode);
|
13
13
|
if (popoverNode) {
|
14
14
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -18,7 +18,7 @@ function CalendarDesigner(_a) {
|
|
18
18
|
});
|
19
19
|
}, [dataDnd, dataId]);
|
20
20
|
return (React.createElement("div", { ref: calendarRef },
|
21
|
-
React.createElement(AntCalendar, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
21
|
+
React.createElement(AntCalendar, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
22
22
|
}
|
23
23
|
export const Calendar = defineComponent(AntCalendar, {
|
24
24
|
name: 'Calendar',
|
@@ -8,7 +8,7 @@ function CardDesigner(_a) {
|
|
8
8
|
const cardRef = useRef(null);
|
9
9
|
useEffect(() => {
|
10
10
|
Promise.resolve().then(() => {
|
11
|
-
const popoverNode = document.querySelector(
|
11
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
12
12
|
// console.log('spinNode', popoverNode);
|
13
13
|
if (popoverNode) {
|
14
14
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -18,7 +18,7 @@ function CardDesigner(_a) {
|
|
18
18
|
});
|
19
19
|
}, [dataDnd, dataId]);
|
20
20
|
return (React.createElement("div", { ref: cardRef },
|
21
|
-
React.createElement(AntCard, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
21
|
+
React.createElement(AntCard, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
22
22
|
}
|
23
23
|
export const Card = defineComponent(AntCard, {
|
24
24
|
name: 'Card',
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { Carousel as AntCarousel } from 'antd';
|
3
3
|
import { defineComponent } from '@music163/tango-boot';
|
4
|
-
import React, { useEffect
|
4
|
+
import React, { useEffect } from 'react';
|
5
5
|
import { SLOT } from '@music163/tango-helpers';
|
6
6
|
function CarouselDesigner(_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"]);
|
8
|
-
const carouselRef = useRef(null);
|
9
8
|
useEffect(() => {
|
10
9
|
Promise.resolve().then(() => {
|
11
|
-
const popoverNode = document.querySelector(
|
10
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
12
11
|
console.log('spinNode', popoverNode);
|
13
12
|
if (popoverNode) {
|
14
13
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -17,8 +16,7 @@ function CarouselDesigner(_a) {
|
|
17
16
|
}
|
18
17
|
});
|
19
18
|
}, [dataDnd, dataId]);
|
20
|
-
return (React.createElement("
|
21
|
-
React.createElement(AntCarousel, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
19
|
+
return (React.createElement(AntCarousel, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children));
|
22
20
|
}
|
23
21
|
export const Carousel = defineComponent(AntCarousel, {
|
24
22
|
name: 'Carousel',
|
@@ -1,21 +1,24 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { defineComponent } from '@music163/tango-boot';
|
3
|
+
import { SLOT } from '@music163/tango-helpers';
|
3
4
|
import { Checkbox as AntCheckbox } from 'antd';
|
4
5
|
import React, { useRef, useEffect } from 'react';
|
5
6
|
function CheckboxDesigner(_a) {
|
6
|
-
var { style } = _a, rest = __rest(_a, ["style"]);
|
7
|
+
var { style } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], rest = __rest(_a, ["style", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
|
7
8
|
const checkBoxRef = useRef(null);
|
8
9
|
useEffect(() => {
|
9
10
|
Promise.resolve().then(() => {
|
10
|
-
const popoverNode = document.querySelector(
|
11
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
11
12
|
// console.log('spinNode', popoverNode);
|
12
13
|
if (popoverNode) {
|
14
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
15
|
+
popoverNode.setAttribute('data-id', dataId);
|
13
16
|
popoverNode.setAttribute('draggable', 'true');
|
14
17
|
}
|
15
18
|
});
|
16
|
-
}, []);
|
19
|
+
}, [dataDnd, dataId]);
|
17
20
|
return (React.createElement("div", { ref: checkBoxRef },
|
18
|
-
React.createElement(AntCheckbox, Object.assign({}, rest, { style: style }), rest.label)));
|
21
|
+
React.createElement(AntCheckbox, Object.assign({}, rest, { style: style, className: dataId, "data-dnd": dataDnd, "data-id": dataId }), rest.label)));
|
19
22
|
}
|
20
23
|
export const Checkbox = defineComponent(AntCheckbox, {
|
21
24
|
name: 'Checkbox',
|
@@ -1,2 +1,4 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import { CollapseProps } from 'antd';
|
2
|
+
import React from 'react';
|
3
|
+
export declare const Collapse: React.ForwardRefExoticComponent<CollapseProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
|
4
|
+
export declare const CollapsePanel: React.ForwardRefExoticComponent<import("antd").CollapsePanelProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
|
@@ -1,7 +1,31 @@
|
|
1
|
+
import { __rest } from "tslib";
|
1
2
|
import { defineComponent } from '@music163/tango-boot';
|
2
3
|
import { Collapse as AntCollapse } from 'antd';
|
4
|
+
import React, { useEffect } from 'react';
|
5
|
+
import { SLOT } from '@music163/tango-helpers';
|
6
|
+
function CollapseDesigner(_a) {
|
7
|
+
var { children } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
|
+
useEffect(() => {
|
9
|
+
Promise.resolve().then(() => {
|
10
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
11
|
+
console.log('spinNode', popoverNode);
|
12
|
+
if (popoverNode) {
|
13
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
14
|
+
popoverNode.setAttribute('data-id', dataId);
|
15
|
+
popoverNode.setAttribute('draggable', 'true');
|
16
|
+
}
|
17
|
+
});
|
18
|
+
}, [dataDnd, dataId]);
|
19
|
+
return (React.createElement(AntCollapse, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children));
|
20
|
+
}
|
3
21
|
export const Collapse = defineComponent(AntCollapse, {
|
4
|
-
name: 'Collapse'
|
22
|
+
name: 'Collapse',
|
23
|
+
designerConfig: {
|
24
|
+
render({ designerProps, originalProps }) {
|
25
|
+
console.log("Collapse: designerProps:", designerProps, "originalProps:", originalProps);
|
26
|
+
return React.createElement(CollapseDesigner, Object.assign({}, designerProps, originalProps));
|
27
|
+
},
|
28
|
+
},
|
5
29
|
});
|
6
30
|
export const CollapsePanel = defineComponent(AntCollapse.Panel, {
|
7
31
|
name: 'CollapsePanel',
|
@@ -9,7 +9,7 @@ function CommentDesigner(_a) {
|
|
9
9
|
const commentRef = useRef(null);
|
10
10
|
useEffect(() => {
|
11
11
|
Promise.resolve().then(() => {
|
12
|
-
const popoverNode = document.querySelector(
|
12
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
13
13
|
// console.log('spinNode', popoverNode);
|
14
14
|
if (popoverNode) {
|
15
15
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -19,7 +19,7 @@ function CommentDesigner(_a) {
|
|
19
19
|
});
|
20
20
|
}, [dataDnd, dataId]);
|
21
21
|
return (React.createElement("div", { ref: commentRef },
|
22
|
-
React.createElement(AntComment, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, content: content, style: style }, rest), children)));
|
22
|
+
React.createElement(AntComment, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, content: content, style: style }, rest), children)));
|
23
23
|
}
|
24
24
|
export const Comment = defineComponent(AntComment, {
|
25
25
|
name: 'Comment',
|
@@ -71,7 +71,7 @@ function DataPickerDesigner(_a) {
|
|
71
71
|
const dateRef = useRef(null);
|
72
72
|
useEffect(() => {
|
73
73
|
Promise.resolve().then(() => {
|
74
|
-
const popoverNode = document.querySelector(
|
74
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
75
75
|
console.log('spinNode', popoverNode);
|
76
76
|
if (popoverNode) {
|
77
77
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -83,7 +83,7 @@ function DataPickerDesigner(_a) {
|
|
83
83
|
return (
|
84
84
|
// <div ref={dateRef}>
|
85
85
|
React.createElement(ConfigProvider, { locale: locale },
|
86
|
-
React.createElement(AntDataPicker, Object.assign({ className:
|
86
|
+
React.createElement(AntDataPicker, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style, locale: local }, rest)))
|
87
87
|
// </div>
|
88
88
|
);
|
89
89
|
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { Descriptions as AntDescriptions } from 'antd';
|
3
|
+
import { defineComponent } from '@music163/tango-boot';
|
4
|
+
import React, { useEffect } from 'react';
|
5
|
+
import { SLOT } from '@music163/tango-helpers';
|
6
|
+
function DescriptionsDesigner(_a) {
|
7
|
+
var { items } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["items", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
|
8
|
+
useEffect(() => {
|
9
|
+
Promise.resolve().then(() => {
|
10
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
11
|
+
console.log('spinNode', popoverNode);
|
12
|
+
if (popoverNode) {
|
13
|
+
popoverNode.setAttribute('data-dnd', dataDnd);
|
14
|
+
popoverNode.setAttribute('data-id', dataId);
|
15
|
+
popoverNode.setAttribute('draggable', 'true');
|
16
|
+
}
|
17
|
+
});
|
18
|
+
}, [dataDnd, dataId]);
|
19
|
+
return (React.createElement(AntDescriptions, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), items.map((item) => (React.createElement(AntDescriptions.Item, { label: item.label, key: item.label }, item.value)))));
|
20
|
+
}
|
21
|
+
export const Descriptions = defineComponent(AntDescriptions, {
|
22
|
+
name: 'Descriptions',
|
23
|
+
designerConfig: {
|
24
|
+
render({ designerProps, originalProps }) {
|
25
|
+
console.log("Descriptions: designerProps:", designerProps, "originalProps:", originalProps);
|
26
|
+
return React.createElement(DescriptionsDesigner, Object.assign({}, designerProps, originalProps));
|
27
|
+
},
|
28
|
+
},
|
29
|
+
});
|
@@ -8,7 +8,7 @@ function DividerDesigner(_a) {
|
|
8
8
|
const dividerRef = useRef(null);
|
9
9
|
useEffect(() => {
|
10
10
|
Promise.resolve().then(() => {
|
11
|
-
const popoverNode = document.querySelector(
|
11
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
12
12
|
// console.log('spinNode', popoverNode);
|
13
13
|
if (popoverNode) {
|
14
14
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -18,7 +18,7 @@ function DividerDesigner(_a) {
|
|
18
18
|
});
|
19
19
|
}, [dataDnd, dataId]);
|
20
20
|
return (React.createElement("div", { ref: dividerRef },
|
21
|
-
React.createElement(AntDivider, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
21
|
+
React.createElement(AntDivider, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
22
22
|
}
|
23
23
|
export const Divider = defineComponent(AntDivider, {
|
24
24
|
name: 'Divider',
|
@@ -5,8 +5,7 @@ import React from 'react';
|
|
5
5
|
import { Placeholder } from './placeholder';
|
6
6
|
function DrawerDesigner(_a) {
|
7
7
|
var { children, style } = _a, rest = __rest(_a, ["children", "style"]);
|
8
|
-
return (React.createElement(AntDrawer, Object.assign({}, rest, { style: style }),
|
9
|
-
React.createElement(Placeholder, null)));
|
8
|
+
return (React.createElement(AntDrawer, Object.assign({}, rest, { style: style }), children || React.createElement(Placeholder, null)));
|
10
9
|
}
|
11
10
|
export const Drawer = defineComponent(AntDrawer, {
|
12
11
|
name: 'Drawer',
|
@@ -8,7 +8,7 @@ function EmptyDesigner(_a) {
|
|
8
8
|
const emptyRef = useRef(null);
|
9
9
|
useEffect(() => {
|
10
10
|
Promise.resolve().then(() => {
|
11
|
-
const popoverNode = document.querySelector(
|
11
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
12
12
|
// console.log('spinNode', popoverNode);
|
13
13
|
if (popoverNode) {
|
14
14
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -18,7 +18,7 @@ function EmptyDesigner(_a) {
|
|
18
18
|
});
|
19
19
|
}, [dataDnd, dataId]);
|
20
20
|
return (React.createElement("div", { ref: emptyRef },
|
21
|
-
React.createElement(AntEmpty, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
21
|
+
React.createElement(AntEmpty, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
|
22
22
|
}
|
23
23
|
export const Empty = defineComponent(AntEmpty, {
|
24
24
|
name: 'Empty',
|
@@ -6,10 +6,11 @@ import { SLOT } from '@music163/tango-helpers';
|
|
6
6
|
function ImageDesigner(_a) {
|
7
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
8
|
const imageRef = useRef(null);
|
9
|
+
console.log("wxy-image-rest: ", Object.assign({}, rest));
|
9
10
|
useEffect(() => {
|
10
11
|
Promise.resolve().then(() => {
|
11
|
-
const popoverNode = document.querySelector(
|
12
|
-
|
12
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
13
|
+
console.log('spinNode', popoverNode);
|
13
14
|
if (popoverNode) {
|
14
15
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
15
16
|
popoverNode.setAttribute('data-id', dataId);
|
@@ -18,7 +19,7 @@ function ImageDesigner(_a) {
|
|
18
19
|
});
|
19
20
|
}, [dataDnd, dataId]);
|
20
21
|
return (React.createElement("div", { ref: imageRef },
|
21
|
-
React.createElement(AntImage, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
22
|
+
React.createElement(AntImage, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
22
23
|
}
|
23
24
|
export const Image = defineComponent(AntImage, {
|
24
25
|
name: 'Image',
|
@@ -56,3 +56,8 @@ export { AutoComplete } from './auto-complete';
|
|
56
56
|
export { Mentions } from './mentions';
|
57
57
|
export { TreeSelect } from './tree-select';
|
58
58
|
export { Image } from './image';
|
59
|
+
export { Tabs } from './tabs';
|
60
|
+
export { Descriptions } from './descriptions';
|
61
|
+
export { Tree } from './tree';
|
62
|
+
export { Alert } from "./alert";
|
63
|
+
export { Progress } from './progress';
|
@@ -61,3 +61,9 @@ export { AutoComplete } from './auto-complete';
|
|
61
61
|
export { Mentions } from './mentions';
|
62
62
|
export { TreeSelect } from './tree-select';
|
63
63
|
export { Image } from './image';
|
64
|
+
export { Tabs } from './tabs';
|
65
|
+
export { Descriptions } from './descriptions';
|
66
|
+
export { Tree } from './tree';
|
67
|
+
export { Alert } from "./alert";
|
68
|
+
export { Progress } from './progress';
|
69
|
+
//export {Affix} from './affix';
|
@@ -5,33 +5,36 @@ import React from 'react';
|
|
5
5
|
function InputNumberDesigner(_a) {
|
6
6
|
var { style, value } = _a, rest = __rest(_a, ["style", "value"]);
|
7
7
|
console.log("AntInputNumber:", value, rest);
|
8
|
-
|
8
|
+
if (value === undefined || value === null) {
|
9
|
+
return (React.createElement(AntInputNumber, Object.assign({}, rest, { style: style })));
|
10
|
+
}
|
11
|
+
else {
|
12
|
+
return (React.createElement(AntInputNumber, Object.assign({}, rest, { style: style, value: value })));
|
13
|
+
}
|
9
14
|
}
|
10
15
|
export const InputNumber = defineComponent(AntInputNumber, {
|
11
16
|
name: 'InputNumber',
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
// },
|
16
|
-
// },
|
17
|
-
registerState: {
|
18
|
-
getInitStates({ setPageState }, props) {
|
19
|
-
var _a;
|
20
|
-
return {
|
21
|
-
value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : props.value,
|
22
|
-
setValue(value) {
|
23
|
-
setPageState({ value });
|
24
|
-
},
|
25
|
-
};
|
26
|
-
},
|
27
|
-
getTriggerProps({ setPageState, getPageState }) {
|
28
|
-
var _a;
|
29
|
-
return {
|
30
|
-
value: (_a = getPageState()) === null || _a === void 0 ? void 0 : _a.value,
|
31
|
-
onChange(value) {
|
32
|
-
setPageState({ value });
|
33
|
-
},
|
34
|
-
};
|
17
|
+
designerConfig: {
|
18
|
+
render({ designerProps, originalProps, }) {
|
19
|
+
return React.createElement(InputNumberDesigner, Object.assign({}, designerProps, originalProps));
|
35
20
|
},
|
36
21
|
},
|
22
|
+
// registerState: {
|
23
|
+
// getInitStates({ setPageState }, props) {
|
24
|
+
// return {
|
25
|
+
// value: props.defaultValue ?? props.value,
|
26
|
+
// setValue(value: number) {
|
27
|
+
// setPageState({ value });
|
28
|
+
// },
|
29
|
+
// };
|
30
|
+
// },
|
31
|
+
// getTriggerProps({ setPageState, getPageState }): InputNumberProps {
|
32
|
+
// return {
|
33
|
+
// value: getPageState()?.value,
|
34
|
+
// onChange(value) {
|
35
|
+
// setPageState({ value });
|
36
|
+
// },
|
37
|
+
// };
|
38
|
+
// },
|
39
|
+
// },
|
37
40
|
});
|
@@ -8,7 +8,7 @@ function MentionsDesigner(_a) {
|
|
8
8
|
const mentionsRef = useRef(null);
|
9
9
|
useEffect(() => {
|
10
10
|
Promise.resolve().then(() => {
|
11
|
-
const popoverNode = document.querySelector(
|
11
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
12
12
|
// console.log('spinNode', popoverNode);
|
13
13
|
if (popoverNode) {
|
14
14
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -18,7 +18,7 @@ function MentionsDesigner(_a) {
|
|
18
18
|
});
|
19
19
|
}, [dataDnd, dataId]);
|
20
20
|
return (React.createElement("div", { ref: mentionsRef },
|
21
|
-
React.createElement(AntMentions, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
21
|
+
React.createElement(AntMentions, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
22
22
|
}
|
23
23
|
export const Mentions = defineComponent(AntMentions, {
|
24
24
|
name: 'Mentions',
|
@@ -23,7 +23,7 @@ function PageHeaderDesigner(_a) {
|
|
23
23
|
// };
|
24
24
|
useEffect(() => {
|
25
25
|
Promise.resolve().then(() => {
|
26
|
-
const popoverNode = document.querySelector(
|
26
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
27
27
|
console.log('pageHeader', popoverNode);
|
28
28
|
if (popoverNode) {
|
29
29
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -33,7 +33,7 @@ function PageHeaderDesigner(_a) {
|
|
33
33
|
});
|
34
34
|
}, [dataDnd, dataId]);
|
35
35
|
return (React.createElement("div", { ref: pageHeaderRef },
|
36
|
-
React.createElement(AntPageHeader, Object.assign({ title: title, "data-dnd": dataDnd, "data-id": dataId }, rest), children)));
|
36
|
+
React.createElement(AntPageHeader, Object.assign({ title: title, "data-dnd": dataDnd, "data-id": dataId, className: dataId }, rest), children)));
|
37
37
|
}
|
38
38
|
export const PageHeader = defineComponent(AntPageHeader, {
|
39
39
|
name: 'PageHeader',
|
@@ -8,7 +8,7 @@ function PaginationDesigner(_a) {
|
|
8
8
|
const paginationRef = useRef(null);
|
9
9
|
useEffect(() => {
|
10
10
|
Promise.resolve().then(() => {
|
11
|
-
const popoverNode = document.querySelector(
|
11
|
+
const popoverNode = document.querySelector(`.${dataId}`);
|
12
12
|
// console.log('spinNode', popoverNode);
|
13
13
|
if (popoverNode) {
|
14
14
|
popoverNode.setAttribute('data-dnd', dataDnd);
|
@@ -18,7 +18,7 @@ function PaginationDesigner(_a) {
|
|
18
18
|
});
|
19
19
|
}, [dataDnd, dataId]);
|
20
20
|
return (React.createElement("div", { ref: paginationRef },
|
21
|
-
React.createElement(AntPagination, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
21
|
+
React.createElement(AntPagination, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
|
22
22
|
}
|
23
23
|
export const Pagination = defineComponent(AntPagination, {
|
24
24
|
name: 'Pagination',
|
@@ -31,15 +31,15 @@ function PlaceholderView(_a) {
|
|
31
31
|
//placeholder = '点击或拖拽组件/区块到这里',
|
32
32
|
placeholder = '点击或拖拽组件/区块到这里' } = _a, rest = __rest(_a, ["size", "placeholder"]);
|
33
33
|
const height = sizeMap[size];
|
34
|
-
console.log('zcq-PlaceholderView01', rest);
|
35
|
-
//去除rest里的dnd-id属性,解决row等容器组件能否直接选中问题
|
36
|
-
const newRest = Object.keys(rest)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}, {});
|
42
|
-
console.log('zcq-PlaceholderView02', newRest);
|
43
|
-
return (React.createElement(Box, Object.assign({ className: "tango-placeholder", height: height, css: placeholderStyle },
|
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 as keyof typeof rest] = rest[key as keyof typeof rest];
|
40
|
+
// return acc;
|
41
|
+
// }, {} as { [key: string]: any });
|
42
|
+
// console.log('zcq-PlaceholderView02', newRest);
|
43
|
+
return (React.createElement(Box, Object.assign({ className: "tango-placeholder", height: height, css: placeholderStyle }, rest), placeholder));
|
44
44
|
}
|
45
45
|
export const Placeholder = defineComponent(PlaceholderView);
|