@cuvp1225/antd 0.2.74 → 0.2.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/dist/designer.js +399 -25
  2. package/dist/index.js +386 -12
  3. package/lib/cjs/components/affix.d.ts +1 -0
  4. package/lib/cjs/components/affix.js +18 -0
  5. package/lib/cjs/components/alert.d.ts +3 -0
  6. package/lib/cjs/components/alert.js +32 -0
  7. package/lib/cjs/components/anchor.d.ts +3 -0
  8. package/lib/cjs/components/anchor.js +47 -0
  9. package/lib/cjs/components/auto-complete.d.ts +7 -0
  10. package/lib/cjs/components/auto-complete.js +34 -0
  11. package/lib/cjs/components/avatar.d.ts +3 -0
  12. package/lib/cjs/components/avatar.js +34 -0
  13. package/lib/cjs/components/badge.d.ts +3 -0
  14. package/lib/cjs/components/badge.js +37 -0
  15. package/lib/cjs/components/calendar.d.ts +3 -0
  16. package/lib/cjs/components/calendar.js +34 -0
  17. package/lib/cjs/components/card.d.ts +3 -0
  18. package/lib/cjs/components/card.js +34 -0
  19. package/lib/cjs/components/carousel.d.ts +3 -0
  20. package/lib/cjs/components/carousel.js +32 -0
  21. package/lib/cjs/components/checkbox.js +17 -3
  22. package/lib/cjs/components/collapse.d.ts +4 -2
  23. package/lib/cjs/components/collapse.js +25 -1
  24. package/lib/cjs/components/comment.d.ts +3 -0
  25. package/lib/cjs/components/comment.js +36 -0
  26. package/lib/cjs/components/date-picker.d.ts +1 -1
  27. package/lib/cjs/components/date-picker.js +23 -5
  28. package/lib/cjs/components/descriptions.d.ts +3 -0
  29. package/lib/cjs/components/descriptions.js +32 -0
  30. package/lib/cjs/components/divider.d.ts +3 -0
  31. package/lib/cjs/components/divider.js +34 -0
  32. package/lib/cjs/components/drawer.js +1 -2
  33. package/lib/cjs/components/empty.d.ts +3 -0
  34. package/lib/cjs/components/empty.js +34 -0
  35. package/lib/cjs/components/image.d.ts +3 -0
  36. package/lib/cjs/components/image.js +35 -0
  37. package/lib/cjs/components/index.d.ts +34 -0
  38. package/lib/cjs/components/index.js +71 -1
  39. package/lib/cjs/components/input-number.js +27 -24
  40. package/lib/cjs/components/mentions.d.ts +3 -0
  41. package/lib/cjs/components/mentions.js +34 -0
  42. package/lib/cjs/components/pageheader.d.ts +3 -0
  43. package/lib/cjs/components/pageheader.js +51 -0
  44. package/lib/cjs/components/pagination.d.ts +3 -0
  45. package/lib/cjs/components/pagination.js +34 -0
  46. package/lib/cjs/components/placeholder.js +9 -0
  47. package/lib/cjs/components/popconfirm.js +17 -26
  48. package/lib/cjs/components/popover.d.ts +3 -0
  49. package/lib/cjs/components/popover.js +41 -0
  50. package/lib/cjs/components/progress.d.ts +3 -0
  51. package/lib/cjs/components/progress.js +38 -0
  52. package/lib/cjs/components/radio.js +25 -8
  53. package/lib/cjs/components/rate.d.ts +3 -0
  54. package/lib/cjs/components/rate.js +51 -0
  55. package/lib/cjs/components/result.d.ts +3 -0
  56. package/lib/cjs/components/result.js +51 -0
  57. package/lib/cjs/components/row.js +12 -5
  58. package/lib/cjs/components/skeleton.d.ts +3 -0
  59. package/lib/cjs/components/skeleton.js +51 -0
  60. package/lib/cjs/components/slider.d.ts +2 -0
  61. package/lib/cjs/components/slider.js +51 -0
  62. package/lib/cjs/components/spin.d.ts +3 -0
  63. package/lib/cjs/components/spin.js +37 -0
  64. package/lib/cjs/components/statistic.d.ts +3 -0
  65. package/lib/cjs/components/statistic.js +57 -0
  66. package/lib/cjs/components/switch.d.ts +3 -0
  67. package/lib/cjs/components/switch.js +34 -0
  68. package/lib/cjs/components/table.d.ts +7 -0
  69. package/lib/cjs/components/table.js +37 -0
  70. package/lib/cjs/components/tabs.d.ts +3 -0
  71. package/lib/cjs/components/tabs.js +32 -0
  72. package/lib/cjs/components/tag.d.ts +3 -0
  73. package/lib/cjs/components/tag.js +34 -0
  74. package/lib/cjs/components/time-picker.d.ts +3 -0
  75. package/lib/cjs/components/time-picker.js +33 -0
  76. package/lib/cjs/components/timeline.d.ts +4 -2
  77. package/lib/cjs/components/timeline.js +37 -1
  78. package/lib/cjs/components/tooltip.d.ts +2 -0
  79. package/lib/cjs/components/tooltip.js +41 -0
  80. package/lib/cjs/components/transfer.d.ts +3 -0
  81. package/lib/cjs/components/transfer.js +51 -0
  82. package/lib/cjs/components/tree-select.d.ts +7 -0
  83. package/lib/cjs/components/tree-select.js +34 -0
  84. package/lib/cjs/components/tree.d.ts +7 -0
  85. package/lib/cjs/components/tree.js +32 -0
  86. package/lib/cjs/components/typography.js +2 -1
  87. package/lib/cjs/components/upload.d.ts +3 -0
  88. package/lib/cjs/components/upload.js +50 -0
  89. package/lib/cjs/prototypes/anchor.js +1 -0
  90. package/lib/cjs/prototypes/auto-complete.js +6 -5
  91. package/lib/cjs/prototypes/breadcrumb.js +33 -4
  92. package/lib/cjs/prototypes/descriptions.js +12 -0
  93. package/lib/cjs/prototypes/divider.js +1 -1
  94. package/lib/cjs/prototypes/modal.js +1 -0
  95. package/lib/cjs/prototypes/page-header.js +2 -1
  96. package/lib/cjs/prototypes/radio.js +11 -10
  97. package/lib/cjs/prototypes/slider.js +1 -1
  98. package/lib/cjs/prototypes/steps.js +6 -5
  99. package/lib/cjs/prototypes/tabs.js +2 -1
  100. package/lib/cjs/prototypes/tree-select.js +7 -6
  101. package/lib/esm/components/affix.d.ts +1 -0
  102. package/lib/esm/components/affix.js +16 -0
  103. package/lib/esm/components/alert.d.ts +3 -0
  104. package/lib/esm/components/alert.js +29 -0
  105. package/lib/esm/components/anchor.d.ts +3 -0
  106. package/lib/esm/components/anchor.js +44 -0
  107. package/lib/esm/components/auto-complete.d.ts +7 -0
  108. package/lib/esm/components/auto-complete.js +31 -0
  109. package/lib/esm/components/avatar.d.ts +3 -0
  110. package/lib/esm/components/avatar.js +31 -0
  111. package/lib/esm/components/badge.d.ts +3 -0
  112. package/lib/esm/components/badge.js +34 -0
  113. package/lib/esm/components/calendar.d.ts +3 -0
  114. package/lib/esm/components/calendar.js +31 -0
  115. package/lib/esm/components/card.d.ts +3 -0
  116. package/lib/esm/components/card.js +31 -0
  117. package/lib/esm/components/carousel.d.ts +3 -0
  118. package/lib/esm/components/carousel.js +29 -0
  119. package/lib/esm/components/checkbox.js +17 -3
  120. package/lib/esm/components/collapse.d.ts +4 -2
  121. package/lib/esm/components/collapse.js +25 -1
  122. package/lib/esm/components/comment.d.ts +3 -0
  123. package/lib/esm/components/comment.js +33 -0
  124. package/lib/esm/components/date-picker.d.ts +1 -1
  125. package/lib/esm/components/date-picker.js +23 -5
  126. package/lib/esm/components/descriptions.d.ts +3 -0
  127. package/lib/esm/components/descriptions.js +29 -0
  128. package/lib/esm/components/divider.d.ts +3 -0
  129. package/lib/esm/components/divider.js +31 -0
  130. package/lib/esm/components/drawer.js +1 -2
  131. package/lib/esm/components/empty.d.ts +3 -0
  132. package/lib/esm/components/empty.js +31 -0
  133. package/lib/esm/components/image.d.ts +3 -0
  134. package/lib/esm/components/image.js +32 -0
  135. package/lib/esm/components/index.d.ts +34 -0
  136. package/lib/esm/components/index.js +35 -0
  137. package/lib/esm/components/input-number.js +27 -24
  138. package/lib/esm/components/mentions.d.ts +3 -0
  139. package/lib/esm/components/mentions.js +31 -0
  140. package/lib/esm/components/pageheader.d.ts +3 -0
  141. package/lib/esm/components/pageheader.js +48 -0
  142. package/lib/esm/components/pagination.d.ts +3 -0
  143. package/lib/esm/components/pagination.js +31 -0
  144. package/lib/esm/components/placeholder.js +9 -0
  145. package/lib/esm/components/popconfirm.js +18 -27
  146. package/lib/esm/components/popover.d.ts +3 -0
  147. package/lib/esm/components/popover.js +38 -0
  148. package/lib/esm/components/progress.d.ts +3 -0
  149. package/lib/esm/components/progress.js +35 -0
  150. package/lib/esm/components/radio.js +25 -8
  151. package/lib/esm/components/rate.d.ts +3 -0
  152. package/lib/esm/components/rate.js +48 -0
  153. package/lib/esm/components/result.d.ts +3 -0
  154. package/lib/esm/components/result.js +48 -0
  155. package/lib/esm/components/row.js +12 -5
  156. package/lib/esm/components/skeleton.d.ts +3 -0
  157. package/lib/esm/components/skeleton.js +48 -0
  158. package/lib/esm/components/slider.d.ts +2 -0
  159. package/lib/esm/components/slider.js +48 -0
  160. package/lib/esm/components/spin.d.ts +3 -0
  161. package/lib/esm/components/spin.js +34 -0
  162. package/lib/esm/components/statistic.d.ts +3 -0
  163. package/lib/esm/components/statistic.js +54 -0
  164. package/lib/esm/components/switch.d.ts +3 -0
  165. package/lib/esm/components/switch.js +31 -0
  166. package/lib/esm/components/table.d.ts +7 -0
  167. package/lib/esm/components/table.js +34 -0
  168. package/lib/esm/components/tabs.d.ts +3 -0
  169. package/lib/esm/components/tabs.js +29 -0
  170. package/lib/esm/components/tag.d.ts +3 -0
  171. package/lib/esm/components/tag.js +31 -0
  172. package/lib/esm/components/time-picker.d.ts +3 -0
  173. package/lib/esm/components/time-picker.js +30 -0
  174. package/lib/esm/components/timeline.d.ts +4 -2
  175. package/lib/esm/components/timeline.js +37 -1
  176. package/lib/esm/components/tooltip.d.ts +2 -0
  177. package/lib/esm/components/tooltip.js +38 -0
  178. package/lib/esm/components/transfer.d.ts +3 -0
  179. package/lib/esm/components/transfer.js +48 -0
  180. package/lib/esm/components/tree-select.d.ts +7 -0
  181. package/lib/esm/components/tree-select.js +31 -0
  182. package/lib/esm/components/tree.d.ts +7 -0
  183. package/lib/esm/components/tree.js +29 -0
  184. package/lib/esm/components/typography.js +2 -1
  185. package/lib/esm/components/upload.d.ts +3 -0
  186. package/lib/esm/components/upload.js +47 -0
  187. package/lib/esm/prototypes/anchor.js +1 -0
  188. package/lib/esm/prototypes/auto-complete.js +6 -5
  189. package/lib/esm/prototypes/breadcrumb.js +33 -4
  190. package/lib/esm/prototypes/descriptions.js +12 -0
  191. package/lib/esm/prototypes/divider.js +1 -1
  192. package/lib/esm/prototypes/modal.js +1 -0
  193. package/lib/esm/prototypes/page-header.js +2 -1
  194. package/lib/esm/prototypes/radio.js +11 -10
  195. package/lib/esm/prototypes/slider.js +1 -1
  196. package/lib/esm/prototypes/steps.js +6 -5
  197. package/lib/esm/prototypes/tabs.js +2 -1
  198. package/lib/esm/prototypes/tree-select.js +7 -6
  199. 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,35 @@ 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';
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
- return (React.createElement(AntInputNumber, Object.assign({}, rest, { style: style })));
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
- // designerConfig: {
13
- // render({ designerProps, originalProps, }) {
14
- // return <InputNumberDesigner {...designerProps} {...originalProps} />;
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
  });
@@ -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(`.${dataId}`);
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({ className: dataId, "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,3 @@
1
+ import { PageHeaderProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const PageHeader: React.ForwardRefExoticComponent<PageHeaderProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
@@ -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(`.${dataId}`);
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, className: 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,3 @@
1
+ import { PaginationProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
@@ -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(`.${dataId}`);
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({ className: dataId, "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
+ //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);
34
43
  return (React.createElement(Box, Object.assign({ className: "tango-placeholder", height: height, css: placeholderStyle }, rest), placeholder));
35
44
  }
36
45
  export const Placeholder = defineComponent(PlaceholderView);
@@ -1,38 +1,29 @@
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, { useEffect, useRef } from '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
- useEffect(() => {
9
- console.log('PopconfirmDesigner', dataDnd, dataId, rest);
10
- }, []);
11
- // 添加弹出层容器的自定义属性
12
- const observer = useRef(new MutationObserver((mutations) => {
13
- function isElement(node) {
14
- return node.nodeType === Node.ELEMENT_NODE;
15
- }
16
- mutations.forEach((mutation) => {
17
- Array.from(mutation.addedNodes).forEach((node) => {
18
- if (isElement(node)) {
19
- if (node.nodeType === 1 && node.classList.contains('ant-popover')) {
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(`#${dataId}`);
16
+ console.log('popoverNode', popoverNode);
17
+ if (popoverNode) {
18
+ popoverNode.setAttribute('data-dnd', dataDnd);
19
+ popoverNode.setAttribute('data-id', dataId);
20
+ popoverNode.setAttribute('draggable', 'true');
24
21
  }
25
22
  });
26
- });
27
- }));
28
- useEffect(() => {
29
- const container = document.body; // 或者更具体的容器,如果你知道 Popconfirm 将会在哪里渲染
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));
23
+ }
24
+ };
25
+ return (React.createElement("div", { ref: popconfirmRef },
26
+ React.createElement(AntPopconfirm, Object.assign({ id: dataId, className: dataId, title: title, onOpenChange: handleVisibleChange }, rest), children)));
36
27
  }
37
28
  export const Popconfirm = defineComponent(AntPopconfirm, {
38
29
  name: 'Popconfirm',
@@ -0,0 +1,3 @@
1
+ import { PopoverProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Popover: React.ForwardRefExoticComponent<Omit<PopoverProps & React.RefAttributes<unknown> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
@@ -0,0 +1,38 @@
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(`#${dataId}`);
16
+ console.log('popoverNode', popoverNode);
17
+ if (popoverNode) {
18
+ popoverNode.setAttribute('data-dnd', dataDnd);
19
+ popoverNode.setAttribute('data-id', dataId);
20
+ popoverNode.setAttribute('draggable', 'true');
21
+ }
22
+ });
23
+ }
24
+ };
25
+ return (React.createElement("div", { ref: popoverRef },
26
+ React.createElement(AntPopover, Object.assign({ id: dataId, title: title, onOpenChange: handleVisibleChange }, rest), children)));
27
+ }
28
+ export const Popover = defineComponent(AntPopover, {
29
+ name: 'Popover',
30
+ designerConfig: {
31
+ render({ designerProps, originalProps }) {
32
+ console.log("Popover: designerProps:", designerProps, "originalProps:", originalProps);
33
+ return React.createElement(PopoverDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
34
+ },
35
+ },
36
+ // designerConfig: {
37
+ // },
38
+ });
@@ -0,0 +1,3 @@
1
+ import { ProgressProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Progress: React.ForwardRefExoticComponent<ProgressProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
@@ -0,0 +1,35 @@
1
+ import { __rest } from "tslib";
2
+ import { Progress as AntProgress } from 'antd';
3
+ import { defineComponent } from '@music163/tango-boot';
4
+ import React, { useEffect } from 'react';
5
+ import { SLOT } from '@music163/tango-helpers';
6
+ function ProgressDesigner(_a
7
+ // ProgressProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }
8
+ ) {
9
+ var { children } = _a
10
+ // ProgressProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }
11
+ , _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a
12
+ // ProgressProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }
13
+ , rest = __rest(_a, ["children", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
14
+ useEffect(() => {
15
+ Promise.resolve().then(() => {
16
+ const popoverNode = document.querySelector(`#${dataId}`);
17
+ // console.log('spinNode', popoverNode);
18
+ if (popoverNode) {
19
+ popoverNode.setAttribute('data-dnd', dataDnd);
20
+ popoverNode.setAttribute('data-id', dataId);
21
+ popoverNode.setAttribute('draggable', 'true');
22
+ }
23
+ });
24
+ }, [dataDnd, dataId]);
25
+ return (React.createElement(AntProgress, Object.assign({ id: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children));
26
+ }
27
+ export const Progress = defineComponent(AntProgress, {
28
+ name: 'Progress',
29
+ designerConfig: {
30
+ render({ designerProps, originalProps }) {
31
+ // console.log("Progress: designerProps:", designerProps, "originalProps:", originalProps);
32
+ return React.createElement(ProgressDesigner, Object.assign({}, designerProps, originalProps));
33
+ }
34
+ }
35
+ });
@@ -1,21 +1,38 @@
1
1
  import { __rest } from "tslib";
2
2
  import { defineComponent } from '@music163/tango-boot';
3
+ import { SLOT } from '@music163/tango-helpers';
3
4
  import { Radio as AntRadio } from 'antd';
4
- import React from 'react';
5
+ import React, { useEffect } from 'react';
5
6
  function RadioDesigner(_a) {
6
- var { style } = _a, rest = __rest(_a, ["style"]);
7
- const { optionType } = rest;
8
- if (optionType === 'button') {
9
- return React.createElement(AntRadio.Button, Object.assign({}, rest, { style: style }), rest.label);
10
- }
11
- return (React.createElement(AntRadio, Object.assign({}, rest, { style: style }), rest.label));
7
+ var { children, style } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], rest = __rest(_a, ["children", "style", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
8
+ // const radioRef = useRef<HTMLDivElement>(null);
9
+ useEffect(() => {
10
+ Promise.resolve().then(() => {
11
+ const popoverNode = document.querySelector(`.${dataId}`);
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
+ // const { optionType } = rest;
21
+ // if (optionType === 'button') {
22
+ // return (
23
+ // <div ref={radioRef} className='.ant-radio'>
24
+ // <AntRadio.Button {...rest} style={style} >{rest.label}</AntRadio.Button>
25
+ // </div>
26
+ // );
27
+ // }
28
+ return (React.createElement(AntRadio, Object.assign({}, rest, { style: style, className: dataId, "data-dnd": dataDnd, "data-id": dataId }), children));
12
29
  }
13
30
  export const Radio = defineComponent(AntRadio, {
14
31
  name: 'Radio',
15
32
  designerConfig: {
16
33
  render({ designerProps, originalProps, }) {
17
34
  console.log("designerProps:", designerProps, "originalProps:", originalProps);
18
- return React.createElement(RadioDesigner, Object.assign({ label: '单项1', optionType: '' }, designerProps, originalProps));
35
+ return React.createElement(RadioDesigner, Object.assign({}, designerProps, originalProps));
19
36
  },
20
37
  },
21
38
  });
@@ -0,0 +1,3 @@
1
+ import { RateProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Rate: React.ForwardRefExoticComponent<Omit<RateProps & React.RefAttributes<unknown> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
@@ -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(`.${dataId}`);
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({ className: dataId, "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,3 @@
1
+ import { ResultProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Result: React.ForwardRefExoticComponent<ResultProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
@@ -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(`.${dataId}`);
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({ className: dataId, 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
- //console.log("zcq栅格行的入参",dataDnd,dataId);
30
- const mergedStyle = React.useMemo(() => (Object.assign(Object.assign({}, rowStyle), style)), [style]);
31
- return (React.createElement("div", Object.assign({ style: Object.assign({}, mergedStyle) }, rest),
32
- React.createElement("div", null, children || React.createElement(Placeholder, null))));
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,3 @@
1
+ import { SkeletonProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
@@ -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(`.${dataId}`);
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({ className: dataId, "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
+ });