@cuvp1225/antd 0.1.19-beta.1 → 0.1.19-beta.11

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 (39) hide show
  1. package/dist/designer.js +40 -7
  2. package/dist/index.js +40 -7
  3. package/lib/cjs/components/checkbox.d.ts +3 -2
  4. package/lib/cjs/components/checkbox.js +47 -26
  5. package/lib/cjs/components/collapse.d.ts +4 -1
  6. package/lib/cjs/components/collapse.js +57 -28
  7. package/lib/cjs/components/comment.js +1 -3
  8. package/lib/cjs/components/descriptions.d.ts +1 -5
  9. package/lib/cjs/components/descriptions.js +15 -11
  10. package/lib/cjs/components/index.d.ts +2 -0
  11. package/lib/cjs/components/index.js +5 -3
  12. package/lib/cjs/components/radio.d.ts +3 -2
  13. package/lib/cjs/components/radio.js +15 -3
  14. package/lib/cjs/components/result2.d.ts +4 -2
  15. package/lib/cjs/components/result2.js +19 -4
  16. package/lib/cjs/components/upload.d.ts +4 -1
  17. package/lib/cjs/components/upload.js +76 -45
  18. package/lib/cjs/helpers/slottype.d.ts +10 -0
  19. package/lib/cjs/helpers/slottype.js +13 -0
  20. package/lib/cjs/prototypes/collapse.js +27 -13
  21. package/lib/esm/components/checkbox.d.ts +3 -2
  22. package/lib/esm/components/checkbox.js +46 -26
  23. package/lib/esm/components/collapse.d.ts +4 -1
  24. package/lib/esm/components/collapse.js +56 -28
  25. package/lib/esm/components/comment.js +1 -3
  26. package/lib/esm/components/descriptions.d.ts +1 -5
  27. package/lib/esm/components/descriptions.js +14 -9
  28. package/lib/esm/components/index.d.ts +2 -0
  29. package/lib/esm/components/index.js +2 -2
  30. package/lib/esm/components/radio.d.ts +3 -2
  31. package/lib/esm/components/radio.js +14 -3
  32. package/lib/esm/components/result2.d.ts +4 -2
  33. package/lib/esm/components/result2.js +19 -4
  34. package/lib/esm/components/upload.d.ts +4 -1
  35. package/lib/esm/components/upload.js +75 -45
  36. package/lib/esm/helpers/slottype.d.ts +10 -0
  37. package/lib/esm/helpers/slottype.js +10 -0
  38. package/lib/esm/prototypes/collapse.js +28 -14
  39. package/package.json +2 -2
@@ -14,8 +14,10 @@ exports.Collapse = {
14
14
  type: 'element',
15
15
  hasChildrenItem: true,
16
16
  hasChildren: true,
17
- childrenName: 'Collapse.Panel',
18
- initChildren: `<Collapse.Panel header="panel1" key="1"><Placeholder text="放置替换" /></Collapse.Panel><Collapse.Panel header="panel2" key="2"><Placeholder text="放置替换" /></Collapse.Panel><Collapse.Panel header="panel3" key="3"><Placeholder text="放置替换" /></Collapse.Panel>`,
17
+ // childrenName: 'Collapse.Panel',
18
+ // initChildren: `<Collapse.Panel header="panel1" key="1"><Placeholder text="放置替换" /></Collapse.Panel><Collapse.Panel header="panel2" key="2"><Placeholder text="放置替换" /></Collapse.Panel><Collapse.Panel header="panel3" key="3"><Placeholder text="放置替换" /></Collapse.Panel>`,
19
+ childrenName: 'Panel',
20
+ initChildren: `<Panel header="panel1" key="1"><Placeholder text="放置替换" /></Panel><Panel header="panel2" key="2"><Placeholder text="放置替换" /></Panel>`,
19
21
  relatedImports: ['Placeholder'],
20
22
  props: [
21
23
  ...common_1.StylePrototypes,
@@ -28,32 +30,44 @@ exports.Collapse = {
28
30
  {
29
31
  label: '面板头内容',
30
32
  name: 'header',
33
+ defaultValue: 'panel'
31
34
  },
32
35
  {
33
- label: '对应 activeKey',
36
+ label: 'activeKey',
34
37
  name: 'key',
38
+ required: true,
39
+ },
40
+ {
41
+ label: '面板内容',
42
+ name: 'children',
43
+ defaultValue: '<Placeholder text="放置替换" />',
44
+ // required: true,
45
+ },
46
+ {
47
+ label: '指定可折叠触发区域',
48
+ name: 'collapsible',
49
+ component: react_1.default.createElement(antd_1.Select, { options: [
50
+ { value: 'header', label: '面板头', },
51
+ { value: 'icon', label: '箭头', },
52
+ { value: 'disabled', label: '不可折叠', },
53
+ ] })
35
54
  },
36
- // {
37
- // label: '是否可折叠',
38
- // name: 'collapsible',
39
- // component: <Switch />
40
- // },
41
55
  {
42
56
  label: '自定义渲染',
43
57
  name: 'extra',
44
- component: react_1.default.createElement(antd_1.Switch, null)
58
+ component: react_1.default.createElement(antd_1.Switch, { defaultChecked: false })
45
59
  },
46
60
  {
47
61
  label: '隐藏时保留',
48
62
  name: 'forceRender',
49
- component: react_1.default.createElement(antd_1.Switch, null),
50
- defaultValue: false,
63
+ component: react_1.default.createElement(antd_1.Switch, { defaultChecked: false }),
64
+ // defaultValue: false,
51
65
  },
52
66
  {
53
67
  label: '是否展示当前面板上的箭头',
54
68
  name: 'showArrow',
55
- component: react_1.default.createElement(antd_1.Switch, null),
56
- defaultValue: true,
69
+ component: react_1.default.createElement(antd_1.Switch, { defaultChecked: true }),
70
+ // defaultValue: true,
57
71
  },
58
72
  ]
59
73
  }
@@ -1,6 +1,7 @@
1
- import { CheckboxProps } from 'antd';
2
1
  import React from 'react';
3
- export declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxProps & React.RefAttributes<HTMLInputElement> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
2
+ export declare const Checkbox: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, ...rest }: {
3
+ [x: string]: any;
4
+ }) => React.JSX.Element;
4
5
  export declare const CheckboxGroup: React.ForwardRefExoticComponent<Omit<Omit<import("antd/lib/checkbox").CheckboxGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
5
6
  ref?: React.Ref<HTMLDivElement>;
6
7
  } & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
@@ -2,32 +2,52 @@ import { __rest } from "tslib";
2
2
  import { defineComponent } from '@music163/tango-boot';
3
3
  import { SLOT } from '@music163/tango-helpers';
4
4
  import { Checkbox as AntCheckbox } from 'antd';
5
- import React, { useRef, useEffect } from 'react';
6
- function CheckboxDesigner(_a) {
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 + ""]);
8
- const checkBoxRef = 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: checkBoxRef },
21
- React.createElement(AntCheckbox, Object.assign({}, rest, { style: style, className: dataId, "data-dnd": dataDnd, "data-id": dataId }), rest.label)));
22
- }
23
- export const Checkbox = defineComponent(AntCheckbox, {
24
- name: 'Checkbox',
25
- designerConfig: {
26
- render({ designerProps, originalProps, }) {
27
- return React.createElement(CheckboxDesigner, Object.assign({ label: '多选项1' }, designerProps, originalProps));
28
- },
29
- },
30
- });
5
+ import React from 'react';
6
+ // function CheckboxDesigner({
7
+ // style,
8
+ // [SLOT.dnd]: dataDnd,
9
+ // [SLOT.id]: dataId,
10
+ // ...rest
11
+ // }: CheckboxProps & { [key: string]: any; dnd?: string; label: string }) {
12
+ // const checkBoxRef = useRef<HTMLDivElement>(null);
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
+ // <div ref={checkBoxRef}>
26
+ // <AntCheckbox {...rest}
27
+ // style={style}
28
+ // className={dataId}
29
+ // data-dnd={dataDnd}
30
+ // data-id={dataId}
31
+ // >{rest.label}</AntCheckbox>
32
+ // </div>
33
+ // );
34
+ // }
35
+ // export const Checkbox = defineComponent(AntCheckbox, {
36
+ // name: 'Checkbox',
37
+ // designerConfig: {
38
+ // render({ designerProps, originalProps, }) {
39
+ // return <CheckboxDesigner label={'多选项1'} {...designerProps} {...originalProps} />;
40
+ // },
41
+ // },
42
+ // });
43
+ export const Checkbox = (_a) => {
44
+ 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 + ""]);
45
+ console.log("新的多选组件", dataId, dataDnd, rest);
46
+ //const newProps = {...rest, ...{draggable:true}}
47
+ //console.log("新的表格组件01",newProps);
48
+ return (React.createElement("div", { "data-dnd": dataDnd, "data-id": dataId, draggable: true },
49
+ React.createElement(AntCheckbox, Object.assign({}, rest))));
50
+ };
31
51
  export const CheckboxGroup = defineComponent(AntCheckbox.Group, {
32
52
  name: 'CheckboxGroup',
33
53
  });
@@ -1,3 +1,6 @@
1
1
  import { CollapseProps } from 'antd';
2
2
  import React from 'react';
3
- export declare const Collapse: React.ForwardRefExoticComponent<CollapseProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
3
+ export declare const Collapse: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, style, ...rest }: CollapseProps & {
4
+ [key: string]: any;
5
+ children?: React.ReactNode;
6
+ }) => React.JSX.Element;
@@ -1,32 +1,60 @@
1
+ // import { defineComponent } from '@music163/tango-boot';
2
+ // import { Collapse as AntCollapse, CollapseProps} from 'antd';
3
+ // import React, { useEffect} from 'react';
4
+ // import { SLOT } from '@music163/tango-helpers';
1
5
  import { __rest } from "tslib";
2
- import { defineComponent } from '@music163/tango-boot';
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
- }
21
- export const Collapse = defineComponent(AntCollapse, {
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
- },
29
- });
6
+ // function CollapseDesigner({
7
+ // children,
8
+ // [SLOT.dnd]: dataDnd,
9
+ // [SLOT.id]: dataId,
10
+ // style,
11
+ // ...rest
12
+ // }: CollapseProps & { [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
+ // <AntCollapse
26
+ // className={dataId}
27
+ // data-dnd={dataDnd}
28
+ // data-id={dataId}
29
+ // style={style}
30
+ // {...rest}
31
+ // >
32
+ // {children}
33
+ // </AntCollapse>
34
+ // );
35
+ // }
36
+ // export const Collapse = defineComponent(AntCollapse, {
37
+ // name: 'Collapse',
38
+ // designerConfig: {
39
+ // render({ designerProps, originalProps }) {
40
+ // console.log("Collapse: designerProps:", designerProps, "originalProps:", originalProps);
41
+ // return <CollapseDesigner {...designerProps} {...originalProps} />;
42
+ // },
43
+ // },
44
+ // });
30
45
  // export const CollapsePanel = defineComponent(AntCollapse.Panel, {
31
46
  // name: 'CollapsePanel',
32
47
  // });
48
+ import { Collapse as AntCollapse } from 'antd';
49
+ import React from 'react';
50
+ import { SLOT } from '../helpers/slottype';
51
+ export const Collapse = (_a) => {
52
+ var
53
+ //items,
54
+ _b = SLOT.id,
55
+ //items,
56
+ 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"]);
57
+ //console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
58
+ return (React.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
59
+ React.createElement(AntCollapse, Object.assign({}, rest), rest.children)));
60
+ };
@@ -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;
@@ -48,14 +48,19 @@ import { __rest } from "tslib";
48
48
  // });
49
49
  import { Descriptions as AntDescriptions } from 'antd';
50
50
  import React from 'react';
51
- import { SLOT } from '@music163/tango-helpers';
51
+ import { SLOT } from '../helpers/slottype';
52
52
  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), " ");
53
+ var
54
+ //items,
55
+ _b = SLOT.id,
56
+ //items,
57
+ 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"]);
58
+ //console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
59
+ return (React.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
60
+ React.createElement(AntDescriptions, Object.assign({}, rest), rest.children)));
61
61
  };
62
+ // export const DescriptionsItem = ({
63
+ // ...rest
64
+ // }: DescriptionsProps & { [key: string]: any; children?: React.ReactNode }) => {
65
+ // return <AntDescriptions.Item {...rest}> </AntDescriptions.Item>
66
+ // }
@@ -10,6 +10,7 @@ export * from './placeholder';
10
10
  export * from './section';
11
11
  export { Select } from './select';
12
12
  export { Space } from './space';
13
+ export { Result } from './result2';
13
14
  export { Drawer } from "./drawer";
14
15
  export { DatePicker } from "./date-picker";
15
16
  export { Radio, RadioGroup } from "./radio";
@@ -40,6 +41,7 @@ export { AutoComplete } from './auto-complete';
40
41
  export { Mentions } from './mentions';
41
42
  export { TreeSelect } from './tree-select';
42
43
  export { Image } from './image';
44
+ export { Descriptions } from './descriptions';
43
45
  export { Tree } from './tree';
44
46
  export { Alert } from "./alert";
45
47
  export { Progress } from './progress';
@@ -22,7 +22,7 @@ export { Space } from './space';
22
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";
@@ -70,7 +70,7 @@ export { Mentions } from './mentions';
70
70
  export { TreeSelect } from './tree-select';
71
71
  export { Image } from './image';
72
72
  //export { Tabs } from './tabs'
73
- // export { Descriptions } from './descriptions'
73
+ export { Descriptions } from './descriptions';
74
74
  export { Tree } from './tree';
75
75
  export { Alert } from "./alert";
76
76
  export { Progress } from './progress';
@@ -1,6 +1,7 @@
1
- import { RadioProps } from 'antd';
2
1
  import React from 'react';
3
- export declare const Radio: React.ForwardRefExoticComponent<Omit<RadioProps & React.RefAttributes<HTMLElement> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
2
+ export declare const Radio: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, ...rest }: {
3
+ [x: string]: any;
4
+ }) => React.JSX.Element;
4
5
  export declare const RadioGroup: React.ForwardRefExoticComponent<Omit<Omit<import("antd").RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
5
6
  ref?: React.Ref<HTMLDivElement>;
6
7
  } & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
@@ -1,5 +1,8 @@
1
+ import { __rest } from "tslib";
1
2
  import { defineComponent } from '@music163/tango-boot';
3
+ import { SLOT } from '@music163/tango-helpers';
2
4
  import { Radio as AntRadio } from 'antd';
5
+ import React from 'react';
3
6
  // function RadioDesigner({
4
7
  // children,
5
8
  // style,
@@ -51,9 +54,17 @@ import { Radio as AntRadio } from 'antd';
51
54
  // },
52
55
  // },
53
56
  // });
54
- export const Radio = defineComponent(AntRadio, {
55
- name: 'Radio',
56
- });
57
+ // export const Radio = defineComponent(AntRadio, {
58
+ // name: 'Radio',
59
+ // });
60
+ 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);
63
+ //const newProps = {...rest, ...{draggable:true}}
64
+ //console.log("新的表格组件01",newProps);
65
+ return (React.createElement("div", { "data-dnd": dataDnd, "data-id": dataId, draggable: true },
66
+ React.createElement(AntRadio, Object.assign({}, rest))));
67
+ };
57
68
  export const RadioGroup = defineComponent(AntRadio.Group, {
58
69
  name: 'RadioGroup',
59
70
  });
@@ -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,3 +1,6 @@
1
1
  import { UploadProps } from 'antd';
2
2
  import React from 'react';
3
- export declare const Upload: React.ForwardRefExoticComponent<Omit<UploadProps<any> & React.RefAttributes<unknown> & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
3
+ export declare const Upload: ({ [SLOT.id]: dataId, [SLOT.dnd]: dataDnd, style, ...rest }: UploadProps & {
4
+ [key: string]: any;
5
+ children?: React.ReactNode;
6
+ }) => React.JSX.Element;
@@ -1,47 +1,77 @@
1
+ // import { Upload as AntUpload, UploadProps } from 'antd';
2
+ // import { defineComponent } from '@music163/tango-boot';
3
+ // import React, { useEffect, useRef } from 'react';
4
+ // import { SLOT } from '@music163/tango-helpers';
5
+ // function UploadDesigner({
6
+ // children,
7
+ // title,
8
+ // [SLOT.dnd]:dataDnd,
9
+ // [SLOT.id]:dataId,
10
+ // style,
11
+ // ...rest
12
+ // }: UploadProps& { [key: string]: any, // 添加索引签名
13
+ // dnd?: string, children?: React.ReactNode }) {
14
+ // const uploadRef = useRef<HTMLDivElement>(null);
1
15
  import { __rest } from "tslib";
16
+ // useEffect(() => {
17
+ // Promise.resolve().then(() => {
18
+ // const popoverNode = document.querySelector(`.${dataId}`);
19
+ // console.log('uploadNode' ,popoverNode)
20
+ // if (popoverNode) {
21
+ // popoverNode.setAttribute('data-dnd', dataDnd);
22
+ // popoverNode.setAttribute('data-id', dataId);
23
+ // }
24
+ // });
25
+ // },[dataDnd,dataId])
26
+ // // 监听弹层显示事件
27
+ // // const handleVisibleChange = (visible: boolean) => {
28
+ // // console.log('handleVisibleChange', visible);
29
+ // // if (visible) {
30
+ // // // 使用微任务确保弹层已渲染
31
+ // // Promise.resolve().then(() => {
32
+ // // const popoverNode = document.querySelector('.ant-popover-placement-top');
33
+ // // console.log('popoverNode' ,popoverNode)
34
+ // // if (popoverNode) {
35
+ // // popoverNode.setAttribute('data-dnd', dataDnd);
36
+ // // popoverNode.setAttribute('data-id', dataId);
37
+ // // }
38
+ // // });
39
+ // // }
40
+ // // };
41
+ // return (
42
+ // <div ref={uploadRef}>
43
+ // <AntUpload
44
+ // className={dataId}
45
+ // data-dnd={dataDnd}
46
+ // data-id={dataId}
47
+ // {...rest}
48
+ // >
49
+ // {children}
50
+ // </AntUpload>
51
+ // </div>
52
+ // );
53
+ // }
54
+ // export const Upload = defineComponent(AntUpload, {
55
+ // name: 'Upload',
56
+ // designerConfig: {
57
+ // render({ designerProps, originalProps }) {
58
+ // console.log("Upload: designerProps:",designerProps,"originalProps:",originalProps)
59
+ // return <UploadDesigner title="Are you sure?" {...designerProps} {...originalProps} />;
60
+ // },
61
+ // },
62
+ // // designerConfig: {
63
+ // // },
64
+ // });
2
65
  import { Upload as AntUpload } from 'antd';
3
- import { defineComponent } from '@music163/tango-boot';
4
- import React, { useEffect, useRef } from 'react';
5
- import { SLOT } from '@music163/tango-helpers';
6
- function UploadDesigner(_a) {
7
- var { children, title } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", "title", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
8
- const uploadRef = useRef(null);
9
- useEffect(() => {
10
- Promise.resolve().then(() => {
11
- const popoverNode = document.querySelector(`.${dataId}`);
12
- console.log('uploadNode', popoverNode);
13
- if (popoverNode) {
14
- popoverNode.setAttribute('data-dnd', dataDnd);
15
- popoverNode.setAttribute('data-id', dataId);
16
- }
17
- });
18
- }, [dataDnd, dataId]);
19
- // 监听弹层显示事件
20
- // const handleVisibleChange = (visible: boolean) => {
21
- // console.log('handleVisibleChange', visible);
22
- // if (visible) {
23
- // // 使用微任务确保弹层已渲染
24
- // Promise.resolve().then(() => {
25
- // const popoverNode = document.querySelector('.ant-popover-placement-top');
26
- // console.log('popoverNode' ,popoverNode)
27
- // if (popoverNode) {
28
- // popoverNode.setAttribute('data-dnd', dataDnd);
29
- // popoverNode.setAttribute('data-id', dataId);
30
- // }
31
- // });
32
- // }
33
- // };
34
- return (React.createElement("div", { ref: uploadRef },
35
- React.createElement(AntUpload, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId }, rest), children)));
36
- }
37
- export const Upload = defineComponent(AntUpload, {
38
- name: 'Upload',
39
- designerConfig: {
40
- render({ designerProps, originalProps }) {
41
- console.log("Upload: designerProps:", designerProps, "originalProps:", originalProps);
42
- return React.createElement(UploadDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
43
- },
44
- },
45
- // designerConfig: {
46
- // },
47
- });
66
+ import React from 'react';
67
+ import { SLOT } from '../helpers/slottype';
68
+ export const Upload = (_a) => {
69
+ var
70
+ //items,
71
+ _b = SLOT.id,
72
+ //items,
73
+ 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"]);
74
+ //console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
75
+ return (React.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
76
+ React.createElement(AntUpload, Object.assign({}, rest), rest.children)));
77
+ };
@@ -0,0 +1,10 @@
1
+ export declare const SLOT: {
2
+ /**
3
+ * DND 追踪标记,通常值为 {{pagePath}}:{{componentName}}
4
+ */
5
+ dnd: string;
6
+ /**
7
+ * ID 追踪标记
8
+ */
9
+ id: string;
10
+ };
@@ -0,0 +1,10 @@
1
+ export const SLOT = {
2
+ /**
3
+ * DND 追踪标记,通常值为 {{pagePath}}:{{componentName}}
4
+ */
5
+ dnd: 'data-dnd',
6
+ /**
7
+ * ID 追踪标记
8
+ */
9
+ id: 'data-id',
10
+ };