@cuvp1225/antd 0.2.75 → 0.2.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/designer.js +100 -45
  2. package/dist/index.js +94 -39
  3. package/lib/cjs/components/affix.d.ts +1 -0
  4. package/lib/cjs/components/affix.js +18 -0
  5. package/lib/cjs/components/alert.d.ts +3 -0
  6. package/lib/cjs/components/alert.js +32 -0
  7. package/lib/cjs/components/anchor.js +16 -3
  8. package/lib/cjs/components/auto-complete.js +2 -2
  9. package/lib/cjs/components/avatar.js +2 -2
  10. package/lib/cjs/components/badge.js +6 -3
  11. package/lib/cjs/components/calendar.js +2 -2
  12. package/lib/cjs/components/card.js +2 -2
  13. package/lib/cjs/components/carousel.js +2 -4
  14. package/lib/cjs/components/checkbox.js +7 -4
  15. package/lib/cjs/components/collapse.d.ts +4 -2
  16. package/lib/cjs/components/collapse.js +25 -1
  17. package/lib/cjs/components/comment.js +2 -2
  18. package/lib/cjs/components/date-picker.js +2 -2
  19. package/lib/cjs/components/descriptions.d.ts +3 -0
  20. package/lib/cjs/components/descriptions.js +32 -0
  21. package/lib/cjs/components/divider.js +2 -2
  22. package/lib/cjs/components/drawer.js +1 -2
  23. package/lib/cjs/components/empty.js +2 -2
  24. package/lib/cjs/components/image.js +4 -3
  25. package/lib/cjs/components/index.d.ts +5 -0
  26. package/lib/cjs/components/index.js +12 -1
  27. package/lib/cjs/components/input-number.js +27 -24
  28. package/lib/cjs/components/mentions.js +2 -2
  29. package/lib/cjs/components/pageheader.js +2 -2
  30. package/lib/cjs/components/pagination.js +2 -2
  31. package/lib/cjs/components/placeholder.js +10 -10
  32. package/lib/cjs/components/popconfirm.js +3 -2
  33. package/lib/cjs/components/popover.js +3 -2
  34. package/lib/cjs/components/progress.d.ts +3 -0
  35. package/lib/cjs/components/progress.js +38 -0
  36. package/lib/cjs/components/radio.js +7 -4
  37. package/lib/cjs/components/rate.js +2 -2
  38. package/lib/cjs/components/result.js +2 -2
  39. package/lib/cjs/components/skeleton.js +2 -2
  40. package/lib/cjs/components/slider.js +2 -2
  41. package/lib/cjs/components/spin.js +5 -2
  42. package/lib/cjs/components/statistic.js +10 -4
  43. package/lib/cjs/components/switch.js +1 -1
  44. package/lib/cjs/components/table.js +5 -2
  45. package/lib/cjs/components/tabs.d.ts +3 -0
  46. package/lib/cjs/components/tabs.js +32 -0
  47. package/lib/cjs/components/tag.js +2 -2
  48. package/lib/cjs/components/time-picker.js +2 -2
  49. package/lib/cjs/components/timeline.d.ts +4 -2
  50. package/lib/cjs/components/timeline.js +41 -2
  51. package/lib/cjs/components/tooltip.js +3 -2
  52. package/lib/cjs/components/transfer.js +2 -2
  53. package/lib/cjs/components/tree-select.js +2 -2
  54. package/lib/cjs/components/tree.d.ts +7 -0
  55. package/lib/cjs/components/tree.js +32 -0
  56. package/lib/cjs/components/upload.js +2 -2
  57. package/lib/cjs/prototypes/anchor.js +1 -0
  58. package/lib/cjs/prototypes/descriptions.js +12 -0
  59. package/lib/cjs/prototypes/modal.js +1 -0
  60. package/lib/cjs/prototypes/slider.js +1 -1
  61. package/lib/cjs/prototypes/tabs.js +2 -1
  62. package/lib/esm/components/affix.d.ts +1 -0
  63. package/lib/esm/components/affix.js +16 -0
  64. package/lib/esm/components/alert.d.ts +3 -0
  65. package/lib/esm/components/alert.js +29 -0
  66. package/lib/esm/components/anchor.js +16 -3
  67. package/lib/esm/components/auto-complete.js +2 -2
  68. package/lib/esm/components/avatar.js +2 -2
  69. package/lib/esm/components/badge.js +6 -3
  70. package/lib/esm/components/calendar.js +2 -2
  71. package/lib/esm/components/card.js +2 -2
  72. package/lib/esm/components/carousel.js +3 -5
  73. package/lib/esm/components/checkbox.js +7 -4
  74. package/lib/esm/components/collapse.d.ts +4 -2
  75. package/lib/esm/components/collapse.js +25 -1
  76. package/lib/esm/components/comment.js +2 -2
  77. package/lib/esm/components/date-picker.js +2 -2
  78. package/lib/esm/components/descriptions.d.ts +3 -0
  79. package/lib/esm/components/descriptions.js +29 -0
  80. package/lib/esm/components/divider.js +2 -2
  81. package/lib/esm/components/drawer.js +1 -2
  82. package/lib/esm/components/empty.js +2 -2
  83. package/lib/esm/components/image.js +4 -3
  84. package/lib/esm/components/index.d.ts +5 -0
  85. package/lib/esm/components/index.js +6 -0
  86. package/lib/esm/components/input-number.js +27 -24
  87. package/lib/esm/components/mentions.js +2 -2
  88. package/lib/esm/components/pageheader.js +2 -2
  89. package/lib/esm/components/pagination.js +2 -2
  90. package/lib/esm/components/placeholder.js +10 -10
  91. package/lib/esm/components/popconfirm.js +3 -2
  92. package/lib/esm/components/popover.js +3 -2
  93. package/lib/esm/components/progress.d.ts +3 -0
  94. package/lib/esm/components/progress.js +35 -0
  95. package/lib/esm/components/radio.js +7 -4
  96. package/lib/esm/components/rate.js +2 -2
  97. package/lib/esm/components/result.js +2 -2
  98. package/lib/esm/components/skeleton.js +2 -2
  99. package/lib/esm/components/slider.js +2 -2
  100. package/lib/esm/components/spin.js +5 -2
  101. package/lib/esm/components/statistic.js +11 -5
  102. package/lib/esm/components/switch.js +1 -1
  103. package/lib/esm/components/table.js +5 -2
  104. package/lib/esm/components/tabs.d.ts +3 -0
  105. package/lib/esm/components/tabs.js +29 -0
  106. package/lib/esm/components/tag.js +2 -2
  107. package/lib/esm/components/time-picker.js +2 -2
  108. package/lib/esm/components/timeline.d.ts +4 -2
  109. package/lib/esm/components/timeline.js +40 -2
  110. package/lib/esm/components/tooltip.js +3 -2
  111. package/lib/esm/components/transfer.js +2 -2
  112. package/lib/esm/components/tree-select.js +2 -2
  113. package/lib/esm/components/tree.d.ts +7 -0
  114. package/lib/esm/components/tree.js +29 -0
  115. package/lib/esm/components/upload.js +2 -2
  116. package/lib/esm/prototypes/anchor.js +1 -0
  117. package/lib/esm/prototypes/descriptions.js +12 -0
  118. package/lib/esm/prototypes/modal.js +1 -0
  119. package/lib/esm/prototypes/slider.js +1 -1
  120. package/lib/esm/prototypes/tabs.js +2 -1
  121. package/package.json +2 -2
@@ -12,17 +12,18 @@ function PopconfirmDesigner(_a) {
12
12
  if (visible) {
13
13
  // 使用微任务确保弹层已渲染
14
14
  Promise.resolve().then(() => {
15
- const popoverNode = document.querySelector('.ant-popconfirm');
15
+ const popoverNode = document.querySelector(`#${dataId}`);
16
16
  console.log('popoverNode', popoverNode);
17
17
  if (popoverNode) {
18
18
  popoverNode.setAttribute('data-dnd', dataDnd);
19
19
  popoverNode.setAttribute('data-id', dataId);
20
+ popoverNode.setAttribute('draggable', 'true');
20
21
  }
21
22
  });
22
23
  }
23
24
  };
24
25
  return (React.createElement("div", { ref: popconfirmRef },
25
- React.createElement(AntPopconfirm, Object.assign({ title: title, onOpenChange: handleVisibleChange }, rest), children)));
26
+ React.createElement(AntPopconfirm, Object.assign({ id: dataId, className: dataId, title: title, onOpenChange: handleVisibleChange }, rest), children)));
26
27
  }
27
28
  export const Popconfirm = defineComponent(AntPopconfirm, {
28
29
  name: 'Popconfirm',
@@ -12,17 +12,18 @@ function PopoverDesigner(_a) {
12
12
  if (visible) {
13
13
  // 使用微任务确保弹层已渲染
14
14
  Promise.resolve().then(() => {
15
- const popoverNode = document.querySelector('.ant-popover');
15
+ const popoverNode = document.querySelector(`#${dataId}`);
16
16
  console.log('popoverNode', popoverNode);
17
17
  if (popoverNode) {
18
18
  popoverNode.setAttribute('data-dnd', dataDnd);
19
19
  popoverNode.setAttribute('data-id', dataId);
20
+ popoverNode.setAttribute('draggable', 'true');
20
21
  }
21
22
  });
22
23
  }
23
24
  };
24
25
  return (React.createElement("div", { ref: popoverRef },
25
- React.createElement(AntPopover, Object.assign({ title: title, onOpenChange: handleVisibleChange }, rest), children)));
26
+ React.createElement(AntPopover, Object.assign({ id: dataId, title: title, onOpenChange: handleVisibleChange }, rest), children)));
26
27
  }
27
28
  export const Popover = defineComponent(AntPopover, {
28
29
  name: 'Popover',
@@ -0,0 +1,3 @@
1
+ import { ProgressProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Progress: React.ForwardRefExoticComponent<ProgressProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
@@ -0,0 +1,35 @@
1
+ import { __rest } from "tslib";
2
+ import { Progress as AntProgress } from 'antd';
3
+ import { defineComponent } from '@music163/tango-boot';
4
+ import React, { useEffect } from 'react';
5
+ import { SLOT } from '@music163/tango-helpers';
6
+ function ProgressDesigner(_a
7
+ // ProgressProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }
8
+ ) {
9
+ var { children } = _a
10
+ // ProgressProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }
11
+ , _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a
12
+ // ProgressProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }
13
+ , rest = __rest(_a, ["children", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
14
+ useEffect(() => {
15
+ Promise.resolve().then(() => {
16
+ const popoverNode = document.querySelector(`#${dataId}`);
17
+ // console.log('spinNode', popoverNode);
18
+ if (popoverNode) {
19
+ popoverNode.setAttribute('data-dnd', dataDnd);
20
+ popoverNode.setAttribute('data-id', dataId);
21
+ popoverNode.setAttribute('draggable', 'true');
22
+ }
23
+ });
24
+ }, [dataDnd, dataId]);
25
+ return (React.createElement(AntProgress, Object.assign({ id: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children));
26
+ }
27
+ export const Progress = defineComponent(AntProgress, {
28
+ name: 'Progress',
29
+ designerConfig: {
30
+ render({ designerProps, originalProps }) {
31
+ // console.log("Progress: designerProps:", designerProps, "originalProps:", originalProps);
32
+ return React.createElement(ProgressDesigner, Object.assign({}, designerProps, originalProps));
33
+ }
34
+ }
35
+ });
@@ -1,19 +1,22 @@
1
1
  import { __rest } from "tslib";
2
2
  import { defineComponent } from '@music163/tango-boot';
3
+ import { SLOT } from '@music163/tango-helpers';
3
4
  import { Radio as AntRadio } from 'antd';
4
5
  import React, { useEffect } from 'react';
5
6
  function RadioDesigner(_a) {
6
- var { children, style } = _a, rest = __rest(_a, ["children", "style"]);
7
+ var { children, style } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], rest = __rest(_a, ["children", "style", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + ""]);
7
8
  // const radioRef = useRef<HTMLDivElement>(null);
8
9
  useEffect(() => {
9
10
  Promise.resolve().then(() => {
10
- const popoverNode = document.querySelector('.ant-radio');
11
+ const popoverNode = document.querySelector(`.${dataId}`);
11
12
  console.log('popoverNode', popoverNode);
12
13
  if (popoverNode) {
14
+ popoverNode.setAttribute('data-dnd', dataDnd);
15
+ popoverNode.setAttribute('data-id', dataId);
13
16
  popoverNode.setAttribute('draggable', 'true');
14
17
  }
15
18
  });
16
- }, []);
19
+ }, [dataDnd, dataId]);
17
20
  // const { optionType } = rest;
18
21
  // if (optionType === 'button') {
19
22
  // return (
@@ -22,7 +25,7 @@ function RadioDesigner(_a) {
22
25
  // </div>
23
26
  // );
24
27
  // }
25
- return (React.createElement(AntRadio, Object.assign({}, rest, { style: style }), children));
28
+ return (React.createElement(AntRadio, Object.assign({}, rest, { style: style, className: dataId, "data-dnd": dataDnd, "data-id": dataId }), children));
26
29
  }
27
30
  export const Radio = defineComponent(AntRadio, {
28
31
  name: 'Radio',
@@ -23,7 +23,7 @@ function RateDesigner(_a) {
23
23
  // };
24
24
  useEffect(() => {
25
25
  Promise.resolve().then(() => {
26
- const popoverNode = document.querySelector('.ant-rate');
26
+ const popoverNode = document.querySelector(`.${dataId}`);
27
27
  console.log('rate', popoverNode);
28
28
  if (popoverNode) {
29
29
  popoverNode.setAttribute('data-dnd', dataDnd);
@@ -33,7 +33,7 @@ function RateDesigner(_a) {
33
33
  });
34
34
  }, [dataDnd, dataId]);
35
35
  return (React.createElement("div", { ref: rateRef },
36
- React.createElement(AntRate, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest))));
36
+ React.createElement(AntRate, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId }, rest))));
37
37
  }
38
38
  export const Rate = defineComponent(AntRate, {
39
39
  name: 'Rate',
@@ -8,7 +8,7 @@ function ResultDesigner(_a) {
8
8
  const resultRef = useRef(null);
9
9
  useEffect(() => {
10
10
  Promise.resolve().then(() => {
11
- const popoverNode = document.querySelector('.ant-result');
11
+ const popoverNode = document.querySelector(`.${dataId}`);
12
12
  console.log('popoverNode', popoverNode);
13
13
  if (popoverNode) {
14
14
  popoverNode.setAttribute('data-dnd', dataDnd);
@@ -33,7 +33,7 @@ function ResultDesigner(_a) {
33
33
  // }
34
34
  // };
35
35
  return (React.createElement("div", { ref: resultRef },
36
- React.createElement(AntResult, Object.assign({ title: title, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
36
+ React.createElement(AntResult, Object.assign({ className: dataId, title: title, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
37
37
  }
38
38
  export const Result = defineComponent(AntResult, {
39
39
  name: 'Result',
@@ -23,7 +23,7 @@ function SkeletonDesigner(_a) {
23
23
  // };
24
24
  useEffect(() => {
25
25
  Promise.resolve().then(() => {
26
- const popoverNode = document.querySelector('.ant-skeleton');
26
+ const popoverNode = document.querySelector(`.${dataId}`);
27
27
  console.log('ant-skeleton', popoverNode);
28
28
  if (popoverNode) {
29
29
  popoverNode.setAttribute('data-dnd', dataDnd);
@@ -33,7 +33,7 @@ function SkeletonDesigner(_a) {
33
33
  });
34
34
  }, [dataDnd, dataId]);
35
35
  return (React.createElement("div", { ref: skeletonRef },
36
- React.createElement(AntSkeleton, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest), children)));
36
+ React.createElement(AntSkeleton, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId }, rest), children)));
37
37
  }
38
38
  export const Skeleton = defineComponent(AntSkeleton, {
39
39
  name: 'Skeleton',
@@ -23,7 +23,7 @@ function SliderDesigner(_a) {
23
23
  // };
24
24
  useEffect(() => {
25
25
  Promise.resolve().then(() => {
26
- const popoverNode = document.querySelector('.ant-slider');
26
+ const popoverNode = document.querySelector(`.${dataId}`);
27
27
  console.log('rate', popoverNode);
28
28
  if (popoverNode) {
29
29
  popoverNode.setAttribute('data-dnd', dataDnd);
@@ -33,7 +33,7 @@ function SliderDesigner(_a) {
33
33
  });
34
34
  }, [dataDnd, dataId]);
35
35
  return (React.createElement("div", { ref: rateRef },
36
- React.createElement(AntSlider, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest))));
36
+ React.createElement(AntSlider, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
37
37
  }
38
38
  export const Slider = defineComponent(AntSlider, {
39
39
  name: 'Slider',
@@ -8,7 +8,7 @@ function SpinDesigner(_a) {
8
8
  const spinRef = useRef(null);
9
9
  useEffect(() => {
10
10
  Promise.resolve().then(() => {
11
- const popoverNode = document.querySelector('.ant-spin');
11
+ const popoverNode = document.querySelector(`.${dataId}`);
12
12
  // console.log('spinNode', popoverNode);
13
13
  if (popoverNode) {
14
14
  popoverNode.setAttribute('data-dnd', dataDnd);
@@ -18,7 +18,10 @@ function SpinDesigner(_a) {
18
18
  });
19
19
  }, [dataDnd, dataId]);
20
20
  return (React.createElement("div", { ref: spinRef },
21
- React.createElement(AntSpin, Object.assign({ spinning: spinning, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
21
+ React.createElement(AntSpin, Object.assign({ className: dataId, spinning: spinning,
22
+ // data-dnd={dataDnd}
23
+ // data-id={dataId}
24
+ style: style }, rest), children)));
22
25
  }
23
26
  export const Spin = defineComponent(AntSpin, {
24
27
  name: 'Spin',
@@ -1,11 +1,11 @@
1
1
  import { __rest } from "tslib";
2
2
  import { Statistic as AntStatistic } from 'antd';
3
3
  import { defineComponent } from '@music163/tango-boot';
4
- import React, { useEffect, useRef } from 'react';
4
+ import React, { useEffect } from 'react';
5
5
  import { SLOT } from '@music163/tango-helpers';
6
6
  function StatisticDesigner(_a) {
7
7
  var { children, title } = _a, _b = SLOT.dnd, dataDnd = _a[_b], _c = SLOT.id, dataId = _a[_c], { style } = _a, rest = __rest(_a, ["children", "title", typeof _b === "symbol" ? _b : _b + "", typeof _c === "symbol" ? _c : _c + "", "style"]);
8
- const statisticRef = useRef(null);
8
+ // const statisticRef = useRef<HTMLDivElement>(null);
9
9
  // 监听弹层显示事件
10
10
  // const handleVisibleChange = (visible: boolean) => {
11
11
  // console.log('handleVisibleChange', visible);
@@ -23,7 +23,7 @@ function StatisticDesigner(_a) {
23
23
  // };
24
24
  useEffect(() => {
25
25
  Promise.resolve().then(() => {
26
- const popoverNode = document.querySelector('.ant-statistic');
26
+ const popoverNode = document.querySelector(`.${dataId}`);
27
27
  console.log('rate', popoverNode);
28
28
  if (popoverNode) {
29
29
  popoverNode.setAttribute('data-dnd', dataDnd);
@@ -32,8 +32,14 @@ function StatisticDesigner(_a) {
32
32
  }
33
33
  });
34
34
  }, [dataDnd, dataId]);
35
- return (React.createElement("div", { ref: statisticRef },
36
- React.createElement(AntStatistic, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest))));
35
+ return (
36
+ // <div ref={statisticRef}>
37
+ React.createElement(AntStatistic, Object.assign({ className: dataId,
38
+ // data-dnd={dataDnd}
39
+ // data-id={dataId}
40
+ style: style }, rest))
41
+ // </div>
42
+ );
37
43
  }
38
44
  export const Statistic = defineComponent(AntStatistic, {
39
45
  name: 'Statistic',
@@ -8,7 +8,7 @@ function SwitchDesigner(_a) {
8
8
  const switchRef = useRef(null);
9
9
  useEffect(() => {
10
10
  Promise.resolve().then(() => {
11
- const popoverNode = document.querySelector('.ant-switch');
11
+ const popoverNode = document.querySelector(`.${dataId}`);
12
12
  // console.log('spinNode', popoverNode);
13
13
  if (popoverNode) {
14
14
  popoverNode.setAttribute('data-dnd', dataDnd);
@@ -8,7 +8,7 @@ function TableDesigner(_a) {
8
8
  const tableRef = useRef(null);
9
9
  useEffect(() => {
10
10
  Promise.resolve().then(() => {
11
- const popoverNode = document.querySelector('.ant-table');
11
+ const popoverNode = document.querySelector(`.${dataId}`);
12
12
  // console.log('spinNode', popoverNode);
13
13
  if (popoverNode) {
14
14
  popoverNode.setAttribute('data-dnd', dataDnd);
@@ -18,7 +18,10 @@ function TableDesigner(_a) {
18
18
  });
19
19
  }, [dataDnd, dataId]);
20
20
  return (React.createElement("div", { ref: tableRef },
21
- React.createElement(AntTable, Object.assign({ columns: columns, dataSource: dataSource, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
21
+ React.createElement(AntTable, Object.assign({ className: dataId, columns: columns, dataSource: dataSource,
22
+ // data-dnd={dataDnd}
23
+ // data-id={dataId}
24
+ style: style }, rest), children)));
22
25
  }
23
26
  export const Table = defineComponent(AntTable, {
24
27
  name: 'Table',
@@ -0,0 +1,3 @@
1
+ import { TabsProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Tabs: React.ForwardRefExoticComponent<TabsProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
@@ -0,0 +1,29 @@
1
+ import { __rest } from "tslib";
2
+ import { Tabs as AntTabs } from 'antd';
3
+ import { defineComponent } from '@music163/tango-boot';
4
+ import React, { useEffect } from 'react';
5
+ import { SLOT } from '@music163/tango-helpers';
6
+ function TabsDesigner(_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(AntTabs, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children));
20
+ }
21
+ export const Tabs = defineComponent(AntTabs, {
22
+ name: 'Tabs',
23
+ designerConfig: {
24
+ render({ designerProps, originalProps }) {
25
+ console.log("Tabs: designerProps:", designerProps, "originalProps:", originalProps);
26
+ return React.createElement(TabsDesigner, Object.assign({}, designerProps, originalProps));
27
+ },
28
+ },
29
+ });
@@ -8,7 +8,7 @@ function TagDesigner(_a) {
8
8
  const tagRef = useRef(null);
9
9
  useEffect(() => {
10
10
  Promise.resolve().then(() => {
11
- const popoverNode = document.querySelector('.ant-tag');
11
+ const popoverNode = document.querySelector(`.${dataId}`);
12
12
  // console.log('spinNode', popoverNode);
13
13
  if (popoverNode) {
14
14
  popoverNode.setAttribute('data-dnd', dataDnd);
@@ -18,7 +18,7 @@ function TagDesigner(_a) {
18
18
  });
19
19
  }, [dataDnd, dataId]);
20
20
  return (React.createElement("div", { ref: tagRef },
21
- React.createElement(AntTag, Object.assign({ "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
21
+ React.createElement(AntTag, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children)));
22
22
  }
23
23
  export const Tag = defineComponent(AntTag, {
24
24
  name: 'Tag',
@@ -8,7 +8,7 @@ function TimePickerDesigner(_a) {
8
8
  const timePickerRef = useRef(null);
9
9
  useEffect(() => {
10
10
  Promise.resolve().then(() => {
11
- const popoverNode = document.querySelector('.ant-timePicker');
11
+ const popoverNode = document.querySelector(`.${dataId}`);
12
12
  // console.log('spinNode', popoverNode);
13
13
  if (popoverNode) {
14
14
  popoverNode.setAttribute('data-dnd', dataDnd);
@@ -17,7 +17,7 @@ function TimePickerDesigner(_a) {
17
17
  }
18
18
  });
19
19
  }, [dataDnd, dataId]);
20
- return (React.createElement(AntTimePicker, Object.assign({ className: 'ant-timePicker', "data-dnd": dataDnd, "data-id": dataId, style: style }, rest)));
20
+ return (React.createElement(AntTimePicker, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest)));
21
21
  }
22
22
  export const TimePicker = defineComponent(AntTimePicker, {
23
23
  name: 'TimePicker',
@@ -1,2 +1,4 @@
1
- export declare const Timeline: import("react").ForwardRefExoticComponent<import("antd").TimelineProps & import("@music163/tango-boot").TangoComponentProps & import("react").RefAttributes<unknown>>;
2
- export declare const TimelineItem: import("react").ForwardRefExoticComponent<import("antd").TimelineItemProps & import("@music163/tango-boot").TangoComponentProps & import("react").RefAttributes<unknown>>;
1
+ import { TimelineProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Timeline: React.ForwardRefExoticComponent<TimelineProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
4
+ export declare const TimelineItem: React.ForwardRefExoticComponent<import("antd").TimelineItemProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
@@ -1,7 +1,45 @@
1
1
  import { defineComponent } from '@music163/tango-boot';
2
2
  import { Timeline as AntTimeline } from 'antd';
3
- export const Timeline = defineComponent(AntTimeline, {
4
- name: 'Timeline'
3
+ import React from 'react';
4
+ // function TimelineDesigner({
5
+ // children,
6
+ // [SLOT.dnd]: dataDnd,
7
+ // [SLOT.id]: dataId,
8
+ // style,
9
+ // ...rest
10
+ // }: TimelineProps & { [key: string]: any; dnd?: string; children?: React.ReactNode }) {
11
+ // useEffect(() => {
12
+ // Promise.resolve().then(() => {
13
+ // const popoverNode = document.querySelector(`.${dataId}`);
14
+ // console.log('spinNode', popoverNode);
15
+ // if (popoverNode) {
16
+ // popoverNode.setAttribute('data-dnd', dataDnd);
17
+ // popoverNode.setAttribute('data-id', dataId);
18
+ // popoverNode.setAttribute('draggable', 'true');
19
+ // }
20
+ // });
21
+ // }, [dataDnd, dataId]);
22
+ // return (
23
+ // <AntTimeline
24
+ // className={dataId}
25
+ // // data-dnd={dataDnd}
26
+ // // data-id={dataId}
27
+ // style={style}
28
+ // {...rest}
29
+ // >
30
+ // {children}
31
+ // </AntTimeline>
32
+ // );
33
+ // }
34
+ const MemoizedTimeline = React.memo(AntTimeline);
35
+ export const Timeline = defineComponent(MemoizedTimeline, {
36
+ name: 'Timeline',
37
+ // designerConfig: {
38
+ // render({ designerProps, originalProps }) {
39
+ // console.log("Timeline: designerProps:", designerProps, "originalProps:", originalProps);
40
+ // return <TimelineDesigner {...designerProps} {...originalProps} />;
41
+ // },
42
+ // },
5
43
  });
6
44
  export const TimelineItem = defineComponent(AntTimeline.Item, {
7
45
  name: 'TimelineItem',
@@ -12,17 +12,18 @@ function TooltipDesigner(_a) {
12
12
  if (visible) {
13
13
  // 使用微任务确保弹层已渲染
14
14
  Promise.resolve().then(() => {
15
- const popoverNode = document.querySelector('.ant-tooltip');
15
+ const popoverNode = document.querySelector(`#${dataId}`);
16
16
  console.log('popoverNode', popoverNode);
17
17
  if (popoverNode) {
18
18
  popoverNode.setAttribute('data-dnd', dataDnd);
19
19
  popoverNode.setAttribute('data-id', dataId);
20
+ popoverNode.setAttribute('draggable', 'true');
20
21
  }
21
22
  });
22
23
  }
23
24
  };
24
25
  return (React.createElement("div", { ref: tooltipRef },
25
- React.createElement(AntTooltip, Object.assign({ title: title, onOpenChange: handleVisibleChange }, rest), children)));
26
+ React.createElement(AntTooltip, Object.assign({ title: title, id: dataId, onOpenChange: handleVisibleChange }, rest), children)));
26
27
  }
27
28
  export const Tooltip = defineComponent(AntTooltip, {
28
29
  name: 'Tooltip',
@@ -23,7 +23,7 @@ function TransferDesigner(_a) {
23
23
  // };
24
24
  useEffect(() => {
25
25
  Promise.resolve().then(() => {
26
- const popoverNode = document.querySelector('.ant-transfer');
26
+ const popoverNode = document.querySelector(`.${dataId}`);
27
27
  console.log('rate', popoverNode);
28
28
  if (popoverNode) {
29
29
  popoverNode.setAttribute('data-dnd', dataDnd);
@@ -33,7 +33,7 @@ function TransferDesigner(_a) {
33
33
  });
34
34
  }, [dataDnd, dataId]);
35
35
  return (React.createElement("div", { ref: transferRef },
36
- React.createElement(AntTransfer, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest))));
36
+ React.createElement(AntTransfer, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId }, rest))));
37
37
  }
38
38
  export const Transfer = defineComponent(AntTransfer, {
39
39
  name: 'Transfer',
@@ -8,7 +8,7 @@ function TreeSelectDesigner(_a) {
8
8
  const treeselectRef = useRef(null);
9
9
  useEffect(() => {
10
10
  Promise.resolve().then(() => {
11
- const popoverNode = document.querySelector('.ant-tree-select');
11
+ const popoverNode = document.querySelector(`.${dataId}`);
12
12
  // console.log('spinNode', popoverNode);
13
13
  if (popoverNode) {
14
14
  popoverNode.setAttribute('data-dnd', dataDnd);
@@ -18,7 +18,7 @@ function TreeSelectDesigner(_a) {
18
18
  });
19
19
  }, [dataDnd, dataId]);
20
20
  return (React.createElement("div", { ref: treeselectRef },
21
- React.createElement(AntTreeSelect, Object.assign({ className: 'ant-tree-select', "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
21
+ React.createElement(AntTreeSelect, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest))));
22
22
  }
23
23
  export const TreeSelect = defineComponent(AntTreeSelect, {
24
24
  name: 'TreeSelect',
@@ -0,0 +1,7 @@
1
+ import { TreeProps } from 'antd';
2
+ import React from 'react';
3
+ export declare const Tree: React.ForwardRefExoticComponent<Omit<TreeProps<import("rc-tree").BasicDataNode | import("antd").TreeDataNode> & {
4
+ children?: React.ReactNode | undefined;
5
+ } & {
6
+ ref?: React.Ref<import("rc-tree").default>;
7
+ } & import("@music163/tango-boot").TangoComponentProps, "ref"> & React.RefAttributes<unknown>>;
@@ -0,0 +1,29 @@
1
+ import { __rest } from "tslib";
2
+ import { Tree as AntTree } from 'antd';
3
+ import { defineComponent } from '@music163/tango-boot';
4
+ import React, { useEffect } from 'react';
5
+ import { SLOT } from '@music163/tango-helpers';
6
+ function TreeDesigner(_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(AntTree, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId, style: style }, rest), children));
20
+ }
21
+ export const Tree = defineComponent(AntTree, {
22
+ name: 'Tree',
23
+ designerConfig: {
24
+ render({ designerProps, originalProps }) {
25
+ // console.log("Tree: designerProps:", designerProps, "originalProps:", originalProps);
26
+ return React.createElement(TreeDesigner, Object.assign({}, designerProps, originalProps));
27
+ }
28
+ }
29
+ });
@@ -8,7 +8,7 @@ function UploadDesigner(_a) {
8
8
  const uploadRef = useRef(null);
9
9
  useEffect(() => {
10
10
  Promise.resolve().then(() => {
11
- const popoverNode = document.querySelector('.ant-upload');
11
+ const popoverNode = document.querySelector(`.${dataId}`);
12
12
  console.log('uploadNode', popoverNode);
13
13
  if (popoverNode) {
14
14
  popoverNode.setAttribute('data-dnd', dataDnd);
@@ -32,7 +32,7 @@ function UploadDesigner(_a) {
32
32
  // }
33
33
  // };
34
34
  return (React.createElement("div", { ref: uploadRef },
35
- React.createElement(AntUpload, Object.assign({ "data-dnd": dataDnd, "data-id": dataId }, rest), children)));
35
+ React.createElement(AntUpload, Object.assign({ className: dataId, "data-dnd": dataDnd, "data-id": dataId }, rest), children)));
36
36
  }
37
37
  export const Upload = defineComponent(AntUpload, {
38
38
  name: 'Upload',
@@ -8,6 +8,7 @@ export const Anchor = {
8
8
  props: [
9
9
  ...StylePrototypes,
10
10
  { name: 'affix', title: '固定模式', setter: 'boolSetter', initValue: true },
11
+ { name: 'items', title: '锚点列表', setter: 'arraySetter', initValue: [{ title: '锚点1', href: '#1' }] },
11
12
  {
12
13
  name: 'bounds',
13
14
  title: '锚点区域边界',
@@ -18,6 +18,18 @@ export const Descriptions = {
18
18
  setter: 'textSetter',
19
19
  initValue: '标题',
20
20
  },
21
+ {
22
+ name: 'items',
23
+ title: '数据源',
24
+ tip: '支持异步数据载入',
25
+ setter: 'optionSetter',
26
+ initValue: [
27
+ { label: 'UserName', value: 'user1' },
28
+ { label: 'Telephone', value: '123456' },
29
+ { label: 'Live', value: 'Live' },
30
+ ],
31
+ group: 'basic',
32
+ },
21
33
  {
22
34
  name: 'bordered',
23
35
  title: '是否展示边框',
@@ -74,6 +74,7 @@ export const Modal = {
74
74
  tip: '不建议使用,给弹窗绑定id即可控制弹窗开关',
75
75
  setter: 'boolSetter',
76
76
  group: 'basic',
77
+ initValue: true,
77
78
  },
78
79
  ...StylePrototypes,
79
80
  {
@@ -101,7 +101,7 @@ export const Slider = {
101
101
  name: 'vertical',
102
102
  title: '垂直',
103
103
  setter: 'boolSetter',
104
- tip: '值为 true 时,Slider 为垂直方向',
104
+ tip: '值为 true 时,Slider 为垂直方向。选则垂直方向时,请配合样式的高度使用',
105
105
  },
106
106
  {
107
107
  name: 'onAfterChange',
@@ -23,7 +23,7 @@ export const Tabs = {
23
23
  label: '选项卡1',
24
24
  forceRender: false,
25
25
  disabled: false,
26
- // children: '选项卡1',
26
+ children: `{{<Placeholder text="放置替换" style={{ margin: "15px"}} />}}`,
27
27
  },
28
28
  {
29
29
  key: '2',
@@ -31,6 +31,7 @@ export const Tabs = {
31
31
  forceRender: false,
32
32
  disabled: false,
33
33
  // children: '选项卡2',
34
+ children: `{{<Placeholder text="放置替换" style={{ margin: "15px"}} />}}`,
34
35
  },
35
36
  ]
36
37
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuvp1225/antd",
3
- "version": "0.2.75",
3
+ "version": "0.2.77",
4
4
  "description": "antd components for tango app",
5
5
  "author": "wwsun <ww.sww@outlook.com>",
6
6
  "homepage": "https://github.com/netease/tango-components#readme",
@@ -54,5 +54,5 @@
54
54
  "classnames": "^2.3.2",
55
55
  "coral-system": "^1.0.6"
56
56
  },
57
- "gitHead": "9234ba34350f140a142935cd08790b7b62f52612"
57
+ "gitHead": "458c071a56af932dee9421f318be965f509aa62d"
58
58
  }