@cuvp1225/antd 0.1.19-beta.2 → 0.1.19-beta.20

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 (73) hide show
  1. package/dist/designer.js +130 -9
  2. package/dist/index.js +130 -9
  3. package/lib/cjs/components/anchor.d.ts +15 -2
  4. package/lib/cjs/components/anchor.js +24 -43
  5. package/lib/cjs/components/backTop.d.ts +6 -0
  6. package/lib/cjs/components/backTop.js +17 -0
  7. package/lib/cjs/components/breadcrumb.d.ts +16 -2
  8. package/lib/cjs/components/breadcrumb.js +23 -7
  9. package/lib/cjs/components/carousel.d.ts +4 -1
  10. package/lib/cjs/components/carousel.js +56 -27
  11. package/lib/cjs/components/checkbox.d.ts +3 -2
  12. package/lib/cjs/components/checkbox.js +47 -26
  13. package/lib/cjs/components/collapse.d.ts +15 -2
  14. package/lib/cjs/components/collapse.js +68 -29
  15. package/lib/cjs/components/comment.js +1 -3
  16. package/lib/cjs/components/descriptions.d.ts +1 -5
  17. package/lib/cjs/components/descriptions.js +15 -58
  18. package/lib/cjs/components/dropdown.d.ts +6 -2
  19. package/lib/cjs/components/dropdown.js +23 -8
  20. package/lib/cjs/components/index.d.ts +11 -1
  21. package/lib/cjs/components/index.js +24 -11
  22. package/lib/cjs/components/menu.d.ts +6 -2
  23. package/lib/cjs/components/menu.js +14 -8
  24. package/lib/cjs/components/popconfirm.d.ts +4 -1
  25. package/lib/cjs/components/popconfirm.js +72 -36
  26. package/lib/cjs/components/popover.d.ts +4 -1
  27. package/lib/cjs/components/popover.js +13 -36
  28. package/lib/cjs/components/radio.js +2 -56
  29. package/lib/cjs/components/result2.d.ts +4 -2
  30. package/lib/cjs/components/result2.js +19 -4
  31. package/lib/cjs/components/tooltip.d.ts +5 -1
  32. package/lib/cjs/components/tooltip.js +13 -36
  33. package/lib/cjs/components/upload.d.ts +4 -1
  34. package/lib/cjs/components/upload.js +13 -45
  35. package/lib/cjs/helpers/slottype.d.ts +10 -0
  36. package/lib/cjs/helpers/slottype.js +13 -0
  37. package/lib/cjs/prototypes/collapse.js +27 -13
  38. package/lib/esm/components/anchor.d.ts +15 -2
  39. package/lib/esm/components/anchor.js +21 -42
  40. package/lib/esm/components/backTop.d.ts +6 -0
  41. package/lib/esm/components/backTop.js +13 -0
  42. package/lib/esm/components/breadcrumb.d.ts +16 -2
  43. package/lib/esm/components/breadcrumb.js +21 -7
  44. package/lib/esm/components/carousel.d.ts +4 -1
  45. package/lib/esm/components/carousel.js +55 -27
  46. package/lib/esm/components/checkbox.d.ts +3 -2
  47. package/lib/esm/components/checkbox.js +46 -26
  48. package/lib/esm/components/collapse.d.ts +15 -2
  49. package/lib/esm/components/collapse.js +65 -28
  50. package/lib/esm/components/comment.js +1 -3
  51. package/lib/esm/components/descriptions.d.ts +1 -5
  52. package/lib/esm/components/descriptions.js +14 -56
  53. package/lib/esm/components/dropdown.d.ts +6 -2
  54. package/lib/esm/components/dropdown.js +21 -7
  55. package/lib/esm/components/index.d.ts +11 -1
  56. package/lib/esm/components/index.js +13 -10
  57. package/lib/esm/components/menu.d.ts +6 -2
  58. package/lib/esm/components/menu.js +12 -7
  59. package/lib/esm/components/popconfirm.d.ts +4 -1
  60. package/lib/esm/components/popconfirm.js +71 -36
  61. package/lib/esm/components/popover.d.ts +4 -1
  62. package/lib/esm/components/popover.js +12 -36
  63. package/lib/esm/components/radio.js +2 -56
  64. package/lib/esm/components/result2.d.ts +4 -2
  65. package/lib/esm/components/result2.js +19 -4
  66. package/lib/esm/components/tooltip.d.ts +5 -1
  67. package/lib/esm/components/tooltip.js +12 -36
  68. package/lib/esm/components/upload.d.ts +4 -1
  69. package/lib/esm/components/upload.js +12 -45
  70. package/lib/esm/helpers/slottype.d.ts +10 -0
  71. package/lib/esm/helpers/slottype.js +10 -0
  72. package/lib/esm/prototypes/collapse.js +28 -14
  73. package/package.json +2 -2
@@ -3,7 +3,6 @@ import { Comment as AntComment } 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
- import { Placeholder } from './placeholder';
7
6
  function CommentDesigner(_a) {
8
7
  var { children, content } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", "content", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
9
8
  const commentRef = useRef(null);
@@ -26,8 +25,7 @@ export const Comment = defineComponent(AntComment, {
26
25
  designerConfig: {
27
26
  render({ designerProps, originalProps }) {
28
27
  // console.log("Comment: designerProps:", designerProps, "originalProps:", originalProps);
29
- return React.createElement(CommentDesigner, Object.assign({ content: React.createElement("div", null,
30
- React.createElement(Placeholder, { placeholder: "\u653E\u7F6E\u66FF\u6362" })) }, designerProps, originalProps));
28
+ return React.createElement(CommentDesigner, Object.assign({ content: React.createElement("div", null) }, designerProps, originalProps));
31
29
  }
32
30
  }
33
31
  });
@@ -1,10 +1,6 @@
1
1
  import { DescriptionsProps } from 'antd';
2
2
  import React from 'react';
3
- export declare const Descriptions: ({ items, [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, ...rest }: DescriptionsProps & {
4
- [key: string]: any;
5
- children?: React.ReactNode;
6
- }) => React.JSX.Element;
7
- export declare const DescriptionsItem: ({ ...rest }: DescriptionsProps & {
3
+ export declare const Descriptions: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, style, ...rest }: DescriptionsProps & {
8
4
  [key: string]: any;
9
5
  children?: React.ReactNode;
10
6
  }) => React.JSX.Element;
@@ -1,61 +1,19 @@
1
- // import { Descriptions as AntDescriptions, DescriptionsProps } from 'antd';
2
- // import { defineComponent } from '@music163/tango-boot';
3
- // import React, { useEffect} from 'react';
4
- // import { SLOT } from '@music163/tango-helpers';
5
1
  import { __rest } from "tslib";
6
- // function DescriptionsDesigner({
7
- // items,
8
- // [SLOT.dnd]: dataDnd,
9
- // [SLOT.id]: dataId,
10
- // style,
11
- // ...rest
12
- // }: DescriptionsProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }) {
13
- // useEffect(() => {
14
- // Promise.resolve().then(() => {
15
- // const popoverNode = document.querySelector(`.${dataId}`);
16
- // console.log('spinNode', popoverNode);
17
- // if (popoverNode) {
18
- // popoverNode.setAttribute('data-dnd', dataDnd);
19
- // popoverNode.setAttribute('data-id', dataId);
20
- // popoverNode.setAttribute('draggable', 'true');
21
- // }
22
- // });
23
- // }, [dataDnd, dataId]);
24
- // return (
25
- // <AntDescriptions
26
- // className={dataId}
27
- // data-dnd={dataDnd}
28
- // data-id={dataId}
29
- // style={style}
30
- // {...rest}
31
- // >
32
- // {items.map((item: { label:string; value: string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal; }) => (
33
- // <AntDescriptions.Item label={item.label} key={item.label}>
34
- // {item.value}
35
- // </AntDescriptions.Item>
36
- // ))}
37
- // </AntDescriptions>
38
- // );
39
- // }
40
- // export const Descriptions = defineComponent(AntDescriptions, {
41
- // name: 'Descriptions',
42
- // designerConfig: {
43
- // render({ designerProps, originalProps }) {
44
- // console.log("Descriptions: designerProps:", designerProps, "originalProps:", originalProps);
45
- // return <DescriptionsDesigner {...designerProps} {...originalProps} />;
46
- // },
47
- // },
48
- // });
49
2
  import { Descriptions as AntDescriptions } from 'antd';
50
3
  import React from 'react';
51
- import { SLOT } from '@music163/tango-helpers';
4
+ import { SLOT } from '../helpers/slottype';
52
5
  export const Descriptions = (_a) => {
53
- var { items } = _a, _b = SLOT.id, dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], rest = __rest(_a, ["items", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
54
- console.log("新的descriptions组件01", dataId, dataDnd, rest);
55
- return (React.createElement("div", { "data-dnd": dataDnd, "data-id": dataId, draggable: true },
56
- React.createElement(AntDescriptions, Object.assign({}, rest), items)));
57
- };
58
- export const DescriptionsItem = (_a) => {
59
- var rest = __rest(_a, []);
60
- return React.createElement(AntDescriptions.Item, Object.assign({}, rest), " ");
6
+ var
7
+ //items,
8
+ _b = SLOT.id,
9
+ //items,
10
+ dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], { style } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
11
+ //console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
12
+ return (React.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
13
+ React.createElement(AntDescriptions, Object.assign({}, rest), rest.children)));
61
14
  };
15
+ // export const DescriptionsItem = ({
16
+ // ...rest
17
+ // }: DescriptionsProps & { [key: string]: any; children?: React.ReactNode }) => {
18
+ // return <AntDescriptions.Item {...rest}> </AntDescriptions.Item>
19
+ // }
@@ -1,2 +1,6 @@
1
- export declare const Dropdown: import("react").ForwardRefExoticComponent<import("antd").DropdownProps & import("@music163/tango-boot").TangoComponentProps & import("react").RefAttributes<unknown>>;
2
- export declare const DropdownButton: import("react").ForwardRefExoticComponent<import("antd").DropdownProps & import("@music163/tango-boot").TangoComponentProps & import("react").RefAttributes<unknown>>;
1
+ import { DropdownProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Dropdown: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, style, ...rest }: DropdownProps & {
4
+ [key: string]: any;
5
+ children?: React.ReactNode;
6
+ }) => React.JSX.Element;
@@ -1,8 +1,22 @@
1
- import { defineComponent } from '@music163/tango-boot';
1
+ // import { defineComponent } from '@music163/tango-boot';
2
+ // import { Dropdown as AntDropdown } from 'antd';
3
+ import { __rest } from "tslib";
4
+ // export const Dropdown = defineComponent(AntDropdown, {
5
+ // name: 'Dropdown'
6
+ // });
7
+ // export const DropdownButton = defineComponent(AntDropdown, {
8
+ // name: 'DropdownButton',
9
+ // });
2
10
  import { Dropdown as AntDropdown } from 'antd';
3
- export const Dropdown = defineComponent(AntDropdown, {
4
- name: 'Dropdown'
5
- });
6
- export const DropdownButton = defineComponent(AntDropdown, {
7
- name: 'DropdownButton',
8
- });
11
+ import React from 'react';
12
+ import { SLOT } from '../helpers/slottype';
13
+ export const Dropdown = (_a) => {
14
+ var
15
+ //items,
16
+ _b = SLOT.id,
17
+ //items,
18
+ dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], { style } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
19
+ //console.log("新的Tooltip组件0507001", dataId, dataDnd, rest);
20
+ return (React.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
21
+ React.createElement(AntDropdown, Object.assign({}, rest), rest.children)));
22
+ };
@@ -10,17 +10,25 @@ export * from './placeholder';
10
10
  export * from './section';
11
11
  export { Select } from './select';
12
12
  export { Space } from './space';
13
+ export { Popconfirm } from './popconfirm';
14
+ export { Popover } from './popover';
15
+ export { Tooltip } from './tooltip';
16
+ export { Result } from './result2';
13
17
  export { Drawer } from "./drawer";
14
18
  export { DatePicker } from "./date-picker";
15
19
  export { Radio, RadioGroup } from "./radio";
16
20
  export { Checkbox, CheckboxGroup } from "./checkbox";
17
21
  export { Cascader } from "./cascader";
22
+ export { Breadcrumb } from './breadcrumb';
23
+ export { Menu } from './menu';
18
24
  export { Collapse } from './collapse';
19
- export { Dropdown, DropdownButton } from './dropdown';
25
+ export { Dropdown } from './dropdown';
20
26
  export { Upload } from "./upload";
21
27
  export { Skeleton } from "./skeleton";
22
28
  export { Spin } from './spin';
29
+ export { Anchor } from './anchor';
23
30
  export { Calendar } from './calendar';
31
+ export { Carousel } from './carousel';
24
32
  export { Divider } from './divider';
25
33
  export { Badge } from './badge';
26
34
  export { Pagination } from './pagination';
@@ -40,6 +48,8 @@ export { AutoComplete } from './auto-complete';
40
48
  export { Mentions } from './mentions';
41
49
  export { TreeSelect } from './tree-select';
42
50
  export { Image } from './image';
51
+ export { Descriptions } from './descriptions';
43
52
  export { Tree } from './tree';
44
53
  export { Alert } from "./alert";
45
54
  export { Progress } from './progress';
55
+ export { BackTop } from './backTop';
@@ -17,12 +17,12 @@ export { Select } from './select';
17
17
  export { Space } from './space';
18
18
  //export { Typography, Title, Paragraph,Text } from './typography';
19
19
  //export { Columns, Column } from './columns';
20
- //export { Popconfirm } from './popconfirm';
21
- //export {Popover} from './popover';
22
- //export {Tooltip} from './tooltip';
20
+ export { Popconfirm } from './popconfirm';
21
+ export { Popover } from './popover';
22
+ export { Tooltip } from './tooltip';
23
23
  //export {Result} from './result';
24
24
  //export {Result} from './result1';
25
- //export {Result} from './result2';
25
+ export { Result } from './result2';
26
26
  //export {Result} from './result3';
27
27
  export { Drawer } from "./drawer";
28
28
  export { DatePicker } from "./date-picker";
@@ -33,21 +33,22 @@ export { Cascader } from "./cascader";
33
33
  //export { Row,Col } from './grid'
34
34
  //export { RowCombination,ColCombination } from './gridCombination'
35
35
  //export { Form,Fieldset,FormItem,FormFooter } from './form'
36
- //export { Breadcrumb,BreadcrumbItem } from './breadcrumb'
37
- //export { MenuItem,Menu } from './menu'
36
+ export { Breadcrumb } from './breadcrumb';
37
+ export { Menu } from './menu';
38
38
  //export { Timeline,TimelineItem } from './timeline'
39
39
  // export { Timeline,TimelineItem } from './timeline1'
40
40
  // export { BasicTimeline } from './timeline2'
41
41
  //export { Each } from './each'
42
42
  export { Collapse } from './collapse';
43
43
  //export { List, ListItem } from './list'
44
- export { Dropdown, DropdownButton } from './dropdown';
44
+ //export { Dropdown, DropdownButton } from './dropdown'
45
+ export { Dropdown } from './dropdown';
45
46
  export { Upload } from "./upload";
46
47
  export { Skeleton } from "./skeleton";
47
48
  export { Spin } from './spin';
48
- //export { Anchor } from './anchor';
49
+ export { Anchor } from './anchor';
49
50
  export { Calendar } from './calendar';
50
- //export { Carousel } from './carousel';
51
+ export { Carousel } from './carousel';
51
52
  export { Divider } from './divider';
52
53
  export { Badge } from './badge';
53
54
  export { Pagination } from './pagination';
@@ -70,10 +71,12 @@ export { Mentions } from './mentions';
70
71
  export { TreeSelect } from './tree-select';
71
72
  export { Image } from './image';
72
73
  //export { Tabs } from './tabs'
73
- // export { Descriptions } from './descriptions'
74
+ export { Descriptions } from './descriptions';
74
75
  export { Tree } from './tree';
75
76
  export { Alert } from "./alert";
76
77
  export { Progress } from './progress';
78
+ export { BackTop } from './backTop';
79
+ //export { AntdIcon } from './icon'
77
80
  //export {Affix} from './affix';
78
81
  //import * as echarts from 'echarts';
79
82
  //export {LineChart} from './LineChart';
@@ -1,2 +1,6 @@
1
- export declare const Menu: import("react").ForwardRefExoticComponent<import("antd").MenuProps & import("@music163/tango-boot").TangoComponentProps & import("react").RefAttributes<unknown>>;
2
- export declare const MenuItem: import("react").ForwardRefExoticComponent<import("antd").MenuItemProps & import("@music163/tango-boot").TangoComponentProps & import("react").RefAttributes<unknown>>;
1
+ import { MenuProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Menu: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, style, ...rest }: MenuProps & {
4
+ [key: string]: any;
5
+ children?: React.ReactNode;
6
+ }) => React.JSX.Element;
@@ -1,8 +1,13 @@
1
- import { defineComponent } from '@music163/tango-boot';
1
+ import { __rest } from "tslib";
2
2
  import { Menu as AntMenu } from 'antd';
3
- export const Menu = defineComponent(AntMenu, {
4
- name: 'Menu'
5
- });
6
- export const MenuItem = defineComponent(AntMenu.Item, {
7
- name: 'MenuItem',
8
- });
3
+ import React from 'react';
4
+ import { SLOT } from '../helpers/slottype';
5
+ export const Menu = (_a) => {
6
+ var
7
+ //items,
8
+ _b = SLOT.id,
9
+ //items,
10
+ dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], { style } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
11
+ return (React.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
12
+ React.createElement(AntMenu, Object.assign({}, rest), rest.children)));
13
+ };
@@ -1,3 +1,6 @@
1
1
  import { PopconfirmProps } from 'antd';
2
2
  import React from 'react';
3
- export declare const Popconfirm: React.ForwardRefExoticComponent<Omit<PopconfirmProps & React.RefAttributes<unknown> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
3
+ export declare const Popconfirm: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, style, ...rest }: PopconfirmProps & {
4
+ [key: string]: any;
5
+ children?: React.ReactNode;
6
+ }) => React.JSX.Element;
@@ -1,38 +1,73 @@
1
+ // import { Popconfirm as AntPopconfirm, PopconfirmProps } from 'antd';
2
+ // //import { CloseOutlined } from '@ant-design/icons';
3
+ // import CloseOutlined from '@ant-design/icons/CloseOutlined';
4
+ // import { defineComponent } from '@music163/tango-boot';
5
+ // import { Button } from './button';
6
+ // import React, { useEffect, useRef } from 'react';
7
+ // import { ShadowContainer } from './shadow-container';
8
+ // import { SLOT } from '@music163/tango-helpers';
9
+ // function PopconfirmDesigner({
10
+ // children,
11
+ // title,
12
+ // [SLOT.dnd]:dataDnd,
13
+ // [SLOT.id]:dataId,
14
+ // style,
15
+ // ...rest
16
+ // }: PopconfirmProps& { [key: string]: any, // 添加索引签名
17
+ // dnd?: string, children?: React.ReactNode }) {
18
+ // const popconfirmRef = useRef<HTMLDivElement>(null);
1
19
  import { __rest } from "tslib";
20
+ // // 监听弹层显示事件
21
+ // const handleVisibleChange = (visible: boolean) => {
22
+ // console.log('handleVisibleChange', visible);
23
+ // if (visible) {
24
+ // // 使用微任务确保弹层已渲染
25
+ // Promise.resolve().then(() => {
26
+ // const popoverNode = document.querySelector(`#${dataId}`);
27
+ // console.log('popoverNode' ,popoverNode)
28
+ // if (popoverNode) {
29
+ // popoverNode.setAttribute('data-dnd', dataDnd);
30
+ // popoverNode.setAttribute('data-id', dataId);
31
+ // popoverNode.setAttribute('draggable', 'true');
32
+ // }
33
+ // });
34
+ // }
35
+ // };
36
+ // return (
37
+ // <div ref={popconfirmRef}>
38
+ // <AntPopconfirm
39
+ // id={dataId}
40
+ // className={dataId}
41
+ // title={title}
42
+ // onOpenChange={handleVisibleChange}
43
+ // {...rest}
44
+ // >
45
+ // {children}
46
+ // </AntPopconfirm>
47
+ // </div>
48
+ // );
49
+ // }
50
+ // export const Popconfirm = defineComponent(AntPopconfirm, {
51
+ // name: 'Popconfirm',
52
+ // designerConfig: {
53
+ // render({ designerProps, originalProps }) {
54
+ // console.log("Popconfirm: designerProps:",designerProps,"originalProps:",originalProps)
55
+ // return <PopconfirmDesigner title="Are you sure?" {...designerProps} {...originalProps} />;
56
+ // },
57
+ // },
58
+ // // designerConfig: {
59
+ // // },
60
+ // });
2
61
  import { Popconfirm as AntPopconfirm } from 'antd';
3
- import { defineComponent } from '@music163/tango-boot';
4
- import React, { useRef } from 'react';
5
- import { SLOT } from '@music163/tango-helpers';
6
- function PopconfirmDesigner(_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 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');
21
- }
22
- });
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)));
27
- }
28
- export const Popconfirm = defineComponent(AntPopconfirm, {
29
- name: 'Popconfirm',
30
- designerConfig: {
31
- render({ designerProps, originalProps }) {
32
- console.log("Popconfirm: designerProps:", designerProps, "originalProps:", originalProps);
33
- return React.createElement(PopconfirmDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
34
- },
35
- },
36
- // designerConfig: {
37
- // },
38
- });
62
+ import React from 'react';
63
+ import { SLOT } from '../helpers/slottype';
64
+ export const Popconfirm = (_a) => {
65
+ var
66
+ //items,
67
+ _b = SLOT.id,
68
+ //items,
69
+ dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], { style } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
70
+ //console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
71
+ return (React.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
72
+ React.createElement(AntPopconfirm, Object.assign({ title: '确认吗' }, rest), rest.children)));
73
+ };
@@ -1,3 +1,6 @@
1
1
  import { PopoverProps } from 'antd';
2
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>>;
3
+ export declare const Popover: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, style, ...rest }: PopoverProps & {
4
+ [key: string]: any;
5
+ children?: React.ReactNode;
6
+ }) => React.JSX.Element;
@@ -1,38 +1,14 @@
1
1
  import { __rest } from "tslib";
2
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
- });
3
+ import React from 'react';
4
+ import { SLOT } from '../helpers/slottype';
5
+ export const Popover = (_a) => {
6
+ var
7
+ //items,
8
+ _b = SLOT.id,
9
+ //items,
10
+ dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], { style } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
11
+ //console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
12
+ return (React.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
13
+ React.createElement(AntPopover, Object.assign({ title: '标题' }, rest), rest.children)));
14
+ };
@@ -3,65 +3,11 @@ import { defineComponent } from '@music163/tango-boot';
3
3
  import { SLOT } from '@music163/tango-helpers';
4
4
  import { Radio as AntRadio } from 'antd';
5
5
  import React from 'react';
6
- // function RadioDesigner({
7
- // children,
8
- // style,
9
- // [SLOT.dnd]: dataDnd,
10
- // [SLOT.id]: dataId,
11
- // ...rest
12
- // }: RadioProps & {
13
- // [key: string]: any, // 添加索引签名
14
- // dnd?: string, children?: React.ReactNode
15
- // }) {
16
- // // const radioRef = useRef<HTMLDivElement>(null);
17
- // useEffect(() => {
18
- // Promise.resolve().then(() => {
19
- // const popoverNode = document.querySelector(`.${dataId}`);
20
- // console.log('popoverNode', popoverNode);
21
- // if (popoverNode) {
22
- // popoverNode.setAttribute('data-dnd', dataDnd);
23
- // popoverNode.setAttribute('data-id', dataId);
24
- // popoverNode.setAttribute('draggable', 'true');
25
- // }
26
- // });
27
- // }, [dataDnd, dataId]);
28
- // // const { optionType } = rest;
29
- // // if (optionType === 'button') {
30
- // // return (
31
- // // <div ref={radioRef} className='.ant-radio'>
32
- // // <AntRadio.Button {...rest} style={style} >{rest.label}</AntRadio.Button>
33
- // // </div>
34
- // // );
35
- // // }
36
- // return (
37
- // <AntRadio
38
- // {...rest}
39
- // style={style}
40
- // className={dataId}
41
- // data-dnd={dataDnd}
42
- // data-id={dataId}
43
- // >
44
- // {children}
45
- // </AntRadio>
46
- // );
47
- // }
48
- // export const Radio = defineComponent(AntRadio, {
49
- // name: 'Radio',
50
- // designerConfig: {
51
- // render({ designerProps, originalProps, }) {
52
- // console.log("designerProps:", designerProps, "originalProps:", originalProps)
53
- // return <RadioDesigner {...designerProps} {...originalProps} />;
54
- // },
55
- // },
56
- // });
57
- // export const Radio = defineComponent(AntRadio, {
58
- // name: 'Radio',
59
- // });
60
6
  export const Radio = (_a) => {
61
- var _b = SLOT.id, dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
62
- console.log("新的单选组件", dataId, dataDnd, rest);
7
+ //console.log("新的单选组件",dataId,dataDnd,rest);
63
8
  //const newProps = {...rest, ...{draggable:true}}
64
9
  //console.log("新的表格组件01",newProps);
10
+ var _b = SLOT.id, dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
65
11
  return (React.createElement("div", { "data-dnd": dataDnd, "data-id": dataId, draggable: true },
66
12
  React.createElement(AntRadio, Object.assign({}, rest))));
67
13
  };
@@ -1,4 +1,6 @@
1
+ import { ResultProps } from 'antd';
1
2
  import React from 'react';
2
- export declare const Result: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, ...rest }: {
3
- [x: string]: any;
3
+ export declare const Result: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, style, ...rest }: ResultProps & {
4
+ [key: string]: any;
5
+ children?: React.ReactNode;
4
6
  }) => React.JSX.Element;
@@ -1,9 +1,24 @@
1
1
  import { __rest } from "tslib";
2
2
  import { Result as AntResult } from 'antd';
3
3
  import React from 'react';
4
- import { SLOT } from '@music163/tango-helpers';
4
+ import { SLOT } from '../helpers/slottype';
5
+ // export const Result =({
6
+ // [SLOT.id]:dataId,
7
+ // [SLOT.dnd]:dataDnd,
8
+ // ...rest
9
+ // })=>{
10
+ // console.log("新的结果组件02",dataId,dataDnd,rest);
11
+ // return (
12
+ // <AntResult data-dnd={dataDnd} data-id={dataId} {...rest} > </AntResult>
13
+ // )
14
+ // }
5
15
  export const Result = (_a) => {
6
- var _b = SLOT.id, dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
7
- console.log("新的结果组件02", dataId, dataDnd, rest);
8
- return (React.createElement(AntResult, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest), " "));
16
+ var
17
+ //items,
18
+ _b = SLOT.id,
19
+ //items,
20
+ dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], { style } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
21
+ //console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
22
+ return (React.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
23
+ React.createElement(AntResult, Object.assign({}, rest), rest.children)));
9
24
  };
@@ -1,2 +1,6 @@
1
+ import { TooltipProps } from 'antd';
1
2
  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>>;
3
+ export declare const Tooltip: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, style, ...rest }: TooltipProps & {
4
+ [key: string]: any;
5
+ children?: React.ReactNode;
6
+ }) => React.JSX.Element;
@@ -1,38 +1,14 @@
1
1
  import { __rest } from "tslib";
2
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(`#${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: tooltipRef },
26
- React.createElement(AntTooltip, Object.assign({ title: title, id: dataId, onOpenChange: handleVisibleChange }, rest), children)));
27
- }
28
- export const Tooltip = defineComponent(AntTooltip, {
29
- name: 'Tooltip',
30
- designerConfig: {
31
- render({ designerProps, originalProps }) {
32
- console.log("Tooltip: designerProps:", designerProps, "originalProps:", originalProps);
33
- return React.createElement(TooltipDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
34
- },
35
- },
36
- // designerConfig: {
37
- // },
38
- });
3
+ import React from 'react';
4
+ import { SLOT } from '../helpers/slottype';
5
+ export const Tooltip = (_a) => {
6
+ var
7
+ //items,
8
+ _b = SLOT.id,
9
+ //items,
10
+ dataId = _a[_b], _c = SLOT.dnd, dataDnd = _a[_c], { style } = _a, rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
11
+ //console.log("新的Tooltip组件0507001", dataId, dataDnd, rest);
12
+ return (React.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
13
+ React.createElement(AntTooltip, Object.assign({ title: '文字提示' }, rest), rest.children)));
14
+ };