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

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 (35) hide show
  1. package/dist/designer.js +39 -6
  2. package/dist/index.js +39 -6
  3. package/lib/cjs/components/checkbox.d.ts +3 -2
  4. package/lib/cjs/components/checkbox.js +47 -26
  5. package/lib/cjs/components/comment.js +1 -3
  6. package/lib/cjs/components/descriptions.d.ts +1 -5
  7. package/lib/cjs/components/descriptions.js +15 -11
  8. package/lib/cjs/components/index.d.ts +2 -0
  9. package/lib/cjs/components/index.js +5 -3
  10. package/lib/cjs/components/radio.d.ts +3 -2
  11. package/lib/cjs/components/radio.js +15 -3
  12. package/lib/cjs/components/result2.d.ts +4 -2
  13. package/lib/cjs/components/result2.js +19 -4
  14. package/lib/cjs/components/upload.d.ts +4 -1
  15. package/lib/cjs/components/upload.js +76 -45
  16. package/lib/cjs/helpers/slottype.d.ts +10 -0
  17. package/lib/cjs/helpers/slottype.js +13 -0
  18. package/lib/cjs/prototypes/collapse.js +27 -13
  19. package/lib/esm/components/checkbox.d.ts +3 -2
  20. package/lib/esm/components/checkbox.js +46 -26
  21. package/lib/esm/components/comment.js +1 -3
  22. package/lib/esm/components/descriptions.d.ts +1 -5
  23. package/lib/esm/components/descriptions.js +14 -9
  24. package/lib/esm/components/index.d.ts +2 -0
  25. package/lib/esm/components/index.js +2 -2
  26. package/lib/esm/components/radio.d.ts +3 -2
  27. package/lib/esm/components/radio.js +14 -3
  28. package/lib/esm/components/result2.d.ts +4 -2
  29. package/lib/esm/components/result2.js +19 -4
  30. package/lib/esm/components/upload.d.ts +4 -1
  31. package/lib/esm/components/upload.js +75 -45
  32. package/lib/esm/helpers/slottype.d.ts +10 -0
  33. package/lib/esm/helpers/slottype.js +10 -0
  34. package/lib/esm/prototypes/collapse.js +28 -14
  35. package/package.json +2 -2
@@ -5,32 +5,53 @@ const tslib_1 = require("tslib");
5
5
  const tango_boot_1 = require("@music163/tango-boot");
6
6
  const tango_helpers_1 = require("@music163/tango-helpers");
7
7
  const antd_1 = require("antd");
8
- const react_1 = tslib_1.__importStar(require("react"));
9
- function CheckboxDesigner(_a) {
10
- var { style } = _a, _b = tango_helpers_1.SLOT.dnd, dataDnd = _a[_b], _c = tango_helpers_1.SLOT.id, dataId = _a[_c], rest = tslib_1.__rest(_a, ["style", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
11
- const checkBoxRef = (0, react_1.useRef)(null);
12
- (0, react_1.useEffect)(() => {
13
- Promise.resolve().then(() => {
14
- const popoverNode = document.querySelector(`.${dataId}`);
15
- // console.log('spinNode', popoverNode);
16
- if (popoverNode) {
17
- popoverNode.setAttribute('data-dnd', dataDnd);
18
- popoverNode.setAttribute('data-id', dataId);
19
- popoverNode.setAttribute('draggable', 'true');
20
- }
21
- });
22
- }, [dataDnd, dataId]);
23
- return (react_1.default.createElement("div", { ref: checkBoxRef },
24
- react_1.default.createElement(antd_1.Checkbox, Object.assign({}, rest, { style: style, className: dataId, "data-dnd": dataDnd, "data-id": dataId }), rest.label)));
25
- }
26
- exports.Checkbox = (0, tango_boot_1.defineComponent)(antd_1.Checkbox, {
27
- name: 'Checkbox',
28
- designerConfig: {
29
- render({ designerProps, originalProps, }) {
30
- return react_1.default.createElement(CheckboxDesigner, Object.assign({ label: '多选项1' }, designerProps, originalProps));
31
- },
32
- },
33
- });
8
+ const react_1 = tslib_1.__importDefault(require("react"));
9
+ // function CheckboxDesigner({
10
+ // style,
11
+ // [SLOT.dnd]: dataDnd,
12
+ // [SLOT.id]: dataId,
13
+ // ...rest
14
+ // }: CheckboxProps & { [key: string]: any; dnd?: string; label: string }) {
15
+ // const checkBoxRef = useRef<HTMLDivElement>(null);
16
+ // useEffect(() => {
17
+ // Promise.resolve().then(() => {
18
+ // const popoverNode = document.querySelector(`.${dataId}`);
19
+ // // console.log('spinNode', popoverNode);
20
+ // if (popoverNode) {
21
+ // popoverNode.setAttribute('data-dnd', dataDnd);
22
+ // popoverNode.setAttribute('data-id', dataId);
23
+ // popoverNode.setAttribute('draggable', 'true');
24
+ // }
25
+ // });
26
+ // }, [dataDnd, dataId]);
27
+ // return (
28
+ // <div ref={checkBoxRef}>
29
+ // <AntCheckbox {...rest}
30
+ // style={style}
31
+ // className={dataId}
32
+ // data-dnd={dataDnd}
33
+ // data-id={dataId}
34
+ // >{rest.label}</AntCheckbox>
35
+ // </div>
36
+ // );
37
+ // }
38
+ // export const Checkbox = defineComponent(AntCheckbox, {
39
+ // name: 'Checkbox',
40
+ // designerConfig: {
41
+ // render({ designerProps, originalProps, }) {
42
+ // return <CheckboxDesigner label={'多选项1'} {...designerProps} {...originalProps} />;
43
+ // },
44
+ // },
45
+ // });
46
+ const Checkbox = (_a) => {
47
+ var _b = tango_helpers_1.SLOT.id, dataId = _a[_b], _c = tango_helpers_1.SLOT.dnd, dataDnd = _a[_c], rest = tslib_1.__rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
48
+ console.log("新的多选组件", dataId, dataDnd, rest);
49
+ //const newProps = {...rest, ...{draggable:true}}
50
+ //console.log("新的表格组件01",newProps);
51
+ return (react_1.default.createElement("div", { "data-dnd": dataDnd, "data-id": dataId, draggable: true },
52
+ react_1.default.createElement(antd_1.Checkbox, Object.assign({}, rest))));
53
+ };
54
+ exports.Checkbox = Checkbox;
34
55
  exports.CheckboxGroup = (0, tango_boot_1.defineComponent)(antd_1.Checkbox.Group, {
35
56
  name: 'CheckboxGroup',
36
57
  });
@@ -6,7 +6,6 @@ const antd_1 = require("antd");
6
6
  const tango_boot_1 = require("@music163/tango-boot");
7
7
  const react_1 = tslib_1.__importStar(require("react"));
8
8
  const tango_helpers_1 = require("@music163/tango-helpers");
9
- const placeholder_1 = require("./placeholder");
10
9
  function CommentDesigner(_a) {
11
10
  var { children, content } = _a, _b = tango_helpers_1.SLOT.dnd, dataDnd = _a[_b], _c = tango_helpers_1.SLOT.id, dataId = _a[_c], { style } = _a, rest = tslib_1.__rest(_a, ["children", "content", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
12
11
  const commentRef = (0, react_1.useRef)(null);
@@ -29,8 +28,7 @@ exports.Comment = (0, tango_boot_1.defineComponent)(antd_1.Comment, {
29
28
  designerConfig: {
30
29
  render({ designerProps, originalProps }) {
31
30
  // console.log("Comment: designerProps:", designerProps, "originalProps:", originalProps);
32
- return react_1.default.createElement(CommentDesigner, Object.assign({ content: react_1.default.createElement("div", null,
33
- react_1.default.createElement(placeholder_1.Placeholder, { placeholder: "\u653E\u7F6E\u66FF\u6362" })) }, designerProps, originalProps));
31
+ return react_1.default.createElement(CommentDesigner, Object.assign({ content: react_1.default.createElement("div", null) }, designerProps, originalProps));
34
32
  }
35
33
  }
36
34
  });
@@ -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;
@@ -4,7 +4,7 @@
4
4
  // import React, { useEffect} from 'react';
5
5
  // import { SLOT } from '@music163/tango-helpers';
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.DescriptionsItem = exports.Descriptions = void 0;
7
+ exports.Descriptions = void 0;
8
8
  const tslib_1 = require("tslib");
9
9
  // function DescriptionsDesigner({
10
10
  // items,
@@ -51,16 +51,20 @@ const tslib_1 = require("tslib");
51
51
  // });
52
52
  const antd_1 = require("antd");
53
53
  const react_1 = tslib_1.__importDefault(require("react"));
54
- const tango_helpers_1 = require("@music163/tango-helpers");
54
+ const slottype_1 = require("../helpers/slottype");
55
55
  const Descriptions = (_a) => {
56
- var { items } = _a, _b = tango_helpers_1.SLOT.id, dataId = _a[_b], _c = tango_helpers_1.SLOT.dnd, dataDnd = _a[_c], rest = tslib_1.__rest(_a, ["items", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
57
- console.log("新的descriptions组件01", dataId, dataDnd, rest);
58
- return (react_1.default.createElement("div", { "data-dnd": dataDnd, "data-id": dataId, draggable: true },
59
- react_1.default.createElement(antd_1.Descriptions, Object.assign({}, rest), items)));
56
+ var
57
+ //items,
58
+ _b = slottype_1.SLOT.id,
59
+ //items,
60
+ dataId = _a[_b], _c = slottype_1.SLOT.dnd, dataDnd = _a[_c], { style } = _a, rest = tslib_1.__rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
61
+ //console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
62
+ return (react_1.default.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
63
+ react_1.default.createElement(antd_1.Descriptions, Object.assign({}, rest), rest.children)));
60
64
  };
61
65
  exports.Descriptions = Descriptions;
62
- const DescriptionsItem = (_a) => {
63
- var rest = tslib_1.__rest(_a, []);
64
- return react_1.default.createElement(antd_1.Descriptions.Item, Object.assign({}, rest), " ");
65
- };
66
- exports.DescriptionsItem = DescriptionsItem;
66
+ // export const DescriptionsItem = ({
67
+ // ...rest
68
+ // }: DescriptionsProps & { [key: string]: any; children?: React.ReactNode }) => {
69
+ // return <AntDescriptions.Item {...rest}> </AntDescriptions.Item>
70
+ // }
@@ -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';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Progress = exports.Alert = exports.Tree = exports.Image = exports.TreeSelect = exports.Mentions = exports.AutoComplete = exports.Switch = exports.PageHeader = exports.Statistic = exports.Transfer = exports.TimePicker = exports.Comment = exports.Rate = exports.Slider = exports.Empty = exports.Avatar = exports.Card = exports.Table = exports.Pagination = exports.Badge = exports.Divider = exports.Calendar = exports.Spin = exports.Skeleton = exports.Upload = exports.DropdownButton = exports.Dropdown = exports.Collapse = exports.Cascader = exports.CheckboxGroup = exports.Checkbox = exports.RadioGroup = exports.Radio = exports.DatePicker = exports.Drawer = exports.Space = exports.Select = exports.Password = exports.TextArea = exports.Input = exports.InputNumber = exports.ButtonGroup = exports.Button = exports.Box = exports.When = exports.Each = void 0;
3
+ exports.Progress = exports.Alert = exports.Tree = exports.Descriptions = exports.Image = exports.TreeSelect = exports.Mentions = exports.AutoComplete = exports.Switch = exports.PageHeader = exports.Statistic = exports.Transfer = exports.TimePicker = exports.Comment = exports.Rate = exports.Slider = exports.Empty = exports.Avatar = exports.Card = exports.Table = exports.Pagination = exports.Badge = exports.Divider = exports.Calendar = exports.Spin = exports.Skeleton = exports.Upload = exports.DropdownButton = exports.Dropdown = exports.Collapse = exports.Cascader = exports.CheckboxGroup = exports.Checkbox = exports.RadioGroup = exports.Radio = exports.DatePicker = exports.Drawer = exports.Result = exports.Space = exports.Select = exports.Password = exports.TextArea = exports.Input = exports.InputNumber = exports.ButtonGroup = exports.Button = exports.Box = exports.When = exports.Each = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  tslib_1.__exportStar(require("antd"), exports);
6
6
  //以下组件都从antd中导出,解决下述组件卡顿问题
@@ -37,7 +37,8 @@ Object.defineProperty(exports, "Space", { enumerable: true, get: function () { r
37
37
  //export {Tooltip} from './tooltip';
38
38
  //export {Result} from './result';
39
39
  //export {Result} from './result1';
40
- //export {Result} from './result2';
40
+ var result2_1 = require("./result2");
41
+ Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return result2_1.Result; } });
41
42
  //export {Result} from './result3';
42
43
  var drawer_1 = require("./drawer");
43
44
  Object.defineProperty(exports, "Drawer", { enumerable: true, get: function () { return drawer_1.Drawer; } });
@@ -118,7 +119,8 @@ Object.defineProperty(exports, "TreeSelect", { enumerable: true, get: function (
118
119
  var image_1 = require("./image");
119
120
  Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return image_1.Image; } });
120
121
  //export { Tabs } from './tabs'
121
- // export { Descriptions } from './descriptions'
122
+ var descriptions_1 = require("./descriptions");
123
+ Object.defineProperty(exports, "Descriptions", { enumerable: true, get: function () { return descriptions_1.Descriptions; } });
122
124
  var tree_1 = require("./tree");
123
125
  Object.defineProperty(exports, "Tree", { enumerable: true, get: function () { return tree_1.Tree; } });
124
126
  var alert_1 = require("./alert");
@@ -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,8 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RadioGroup = exports.Radio = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const tango_boot_1 = require("@music163/tango-boot");
6
+ const tango_helpers_1 = require("@music163/tango-helpers");
5
7
  const antd_1 = require("antd");
8
+ const react_1 = tslib_1.__importDefault(require("react"));
6
9
  // function RadioDesigner({
7
10
  // children,
8
11
  // style,
@@ -54,9 +57,18 @@ const antd_1 = require("antd");
54
57
  // },
55
58
  // },
56
59
  // });
57
- exports.Radio = (0, tango_boot_1.defineComponent)(antd_1.Radio, {
58
- name: 'Radio',
59
- });
60
+ // export const Radio = defineComponent(AntRadio, {
61
+ // name: 'Radio',
62
+ // });
63
+ const Radio = (_a) => {
64
+ var _b = tango_helpers_1.SLOT.id, dataId = _a[_b], _c = tango_helpers_1.SLOT.dnd, dataDnd = _a[_c], rest = tslib_1.__rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
65
+ console.log("新的单选组件", dataId, dataDnd, rest);
66
+ //const newProps = {...rest, ...{draggable:true}}
67
+ //console.log("新的表格组件01",newProps);
68
+ return (react_1.default.createElement("div", { "data-dnd": dataDnd, "data-id": dataId, draggable: true },
69
+ react_1.default.createElement(antd_1.Radio, Object.assign({}, rest))));
70
+ };
71
+ exports.Radio = Radio;
60
72
  exports.RadioGroup = (0, tango_boot_1.defineComponent)(antd_1.Radio.Group, {
61
73
  name: 'RadioGroup',
62
74
  });
@@ -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;
@@ -4,10 +4,25 @@ exports.Result = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const antd_1 = require("antd");
6
6
  const react_1 = tslib_1.__importDefault(require("react"));
7
- const tango_helpers_1 = require("@music163/tango-helpers");
7
+ const slottype_1 = require("../helpers/slottype");
8
+ // export const Result =({
9
+ // [SLOT.id]:dataId,
10
+ // [SLOT.dnd]:dataDnd,
11
+ // ...rest
12
+ // })=>{
13
+ // console.log("新的结果组件02",dataId,dataDnd,rest);
14
+ // return (
15
+ // <AntResult data-dnd={dataDnd} data-id={dataId} {...rest} > </AntResult>
16
+ // )
17
+ // }
8
18
  const Result = (_a) => {
9
- var _b = tango_helpers_1.SLOT.id, dataId = _a[_b], _c = tango_helpers_1.SLOT.dnd, dataDnd = _a[_c], rest = tslib_1.__rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
10
- console.log("新的结果组件02", dataId, dataDnd, rest);
11
- return (react_1.default.createElement(antd_1.Result, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest), " "));
19
+ var
20
+ //items,
21
+ _b = slottype_1.SLOT.id,
22
+ //items,
23
+ dataId = _a[_b], _c = slottype_1.SLOT.dnd, dataDnd = _a[_c], { style } = _a, rest = tslib_1.__rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
24
+ //console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
25
+ return (react_1.default.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
26
+ react_1.default.createElement(antd_1.Result, Object.assign({}, rest), rest.children)));
12
27
  };
13
28
  exports.Result = Result;
@@ -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,50 +1,81 @@
1
1
  "use strict";
2
+ // import { Upload as AntUpload, UploadProps } 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({
7
+ // children,
8
+ // title,
9
+ // [SLOT.dnd]:dataDnd,
10
+ // [SLOT.id]:dataId,
11
+ // style,
12
+ // ...rest
13
+ // }: UploadProps& { [key: string]: any, // 添加索引签名
14
+ // dnd?: string, children?: React.ReactNode }) {
15
+ // const uploadRef = useRef<HTMLDivElement>(null);
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  exports.Upload = void 0;
4
18
  const tslib_1 = require("tslib");
19
+ // useEffect(() => {
20
+ // Promise.resolve().then(() => {
21
+ // const popoverNode = document.querySelector(`.${dataId}`);
22
+ // console.log('uploadNode' ,popoverNode)
23
+ // if (popoverNode) {
24
+ // popoverNode.setAttribute('data-dnd', dataDnd);
25
+ // popoverNode.setAttribute('data-id', dataId);
26
+ // }
27
+ // });
28
+ // },[dataDnd,dataId])
29
+ // // 监听弹层显示事件
30
+ // // const handleVisibleChange = (visible: boolean) => {
31
+ // // console.log('handleVisibleChange', visible);
32
+ // // if (visible) {
33
+ // // // 使用微任务确保弹层已渲染
34
+ // // Promise.resolve().then(() => {
35
+ // // const popoverNode = document.querySelector('.ant-popover-placement-top');
36
+ // // console.log('popoverNode' ,popoverNode)
37
+ // // if (popoverNode) {
38
+ // // popoverNode.setAttribute('data-dnd', dataDnd);
39
+ // // popoverNode.setAttribute('data-id', dataId);
40
+ // // }
41
+ // // });
42
+ // // }
43
+ // // };
44
+ // return (
45
+ // <div ref={uploadRef}>
46
+ // <AntUpload
47
+ // className={dataId}
48
+ // data-dnd={dataDnd}
49
+ // data-id={dataId}
50
+ // {...rest}
51
+ // >
52
+ // {children}
53
+ // </AntUpload>
54
+ // </div>
55
+ // );
56
+ // }
57
+ // export const Upload = defineComponent(AntUpload, {
58
+ // name: 'Upload',
59
+ // designerConfig: {
60
+ // render({ designerProps, originalProps }) {
61
+ // console.log("Upload: designerProps:",designerProps,"originalProps:",originalProps)
62
+ // return <UploadDesigner title="Are you sure?" {...designerProps} {...originalProps} />;
63
+ // },
64
+ // },
65
+ // // designerConfig: {
66
+ // // },
67
+ // });
5
68
  const antd_1 = require("antd");
6
- const tango_boot_1 = require("@music163/tango-boot");
7
- const react_1 = tslib_1.__importStar(require("react"));
8
- const tango_helpers_1 = require("@music163/tango-helpers");
9
- function UploadDesigner(_a) {
10
- var { children, title } = _a, _b = tango_helpers_1.SLOT.dnd, dataDnd = _a[_b], _c = tango_helpers_1.SLOT.id, dataId = _a[_c], { style } = _a, rest = tslib_1.__rest(_a, ["children", "title", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
11
- const uploadRef = (0, react_1.useRef)(null);
12
- (0, react_1.useEffect)(() => {
13
- Promise.resolve().then(() => {
14
- const popoverNode = document.querySelector(`.${dataId}`);
15
- console.log('uploadNode', popoverNode);
16
- if (popoverNode) {
17
- popoverNode.setAttribute('data-dnd', dataDnd);
18
- popoverNode.setAttribute('data-id', dataId);
19
- }
20
- });
21
- }, [dataDnd, dataId]);
22
- // 监听弹层显示事件
23
- // const handleVisibleChange = (visible: boolean) => {
24
- // console.log('handleVisibleChange', visible);
25
- // if (visible) {
26
- // // 使用微任务确保弹层已渲染
27
- // Promise.resolve().then(() => {
28
- // const popoverNode = document.querySelector('.ant-popover-placement-top');
29
- // console.log('popoverNode' ,popoverNode)
30
- // if (popoverNode) {
31
- // popoverNode.setAttribute('data-dnd', dataDnd);
32
- // popoverNode.setAttribute('data-id', dataId);
33
- // }
34
- // });
35
- // }
36
- // };
37
- return (react_1.default.createElement("div", { ref: uploadRef },
38
- react_1.default.createElement(antd_1.Upload, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId }, rest), children)));
39
- }
40
- exports.Upload = (0, tango_boot_1.defineComponent)(antd_1.Upload, {
41
- name: 'Upload',
42
- designerConfig: {
43
- render({ designerProps, originalProps }) {
44
- console.log("Upload: designerProps:", designerProps, "originalProps:", originalProps);
45
- return react_1.default.createElement(UploadDesigner, Object.assign({ title: "Are you sure?" }, designerProps, originalProps));
46
- },
47
- },
48
- // designerConfig: {
49
- // },
50
- });
69
+ const react_1 = tslib_1.__importDefault(require("react"));
70
+ const slottype_1 = require("../helpers/slottype");
71
+ const Upload = (_a) => {
72
+ var
73
+ //items,
74
+ _b = slottype_1.SLOT.id,
75
+ //items,
76
+ dataId = _a[_b], _c = slottype_1.SLOT.dnd, dataDnd = _a[_c], { style } = _a, rest = tslib_1.__rest(_a, [typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
77
+ //console.log("新的descriptions组件0507001", dataId, dataDnd, rest);
78
+ return (react_1.default.createElement("div", { "data-dnd": dataDnd, "data-id": rest.tid, draggable: true, style: style },
79
+ react_1.default.createElement(antd_1.Upload, Object.assign({}, rest), rest.children)));
80
+ };
81
+ exports.Upload = Upload;
@@ -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,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SLOT = void 0;
4
+ exports.SLOT = {
5
+ /**
6
+ * DND 追踪标记,通常值为 {{pagePath}}:{{componentName}}
7
+ */
8
+ dnd: 'data-dnd',
9
+ /**
10
+ * ID 追踪标记
11
+ */
12
+ id: 'data-id',
13
+ };
@@ -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
  });