antd-solid 0.0.16 → 0.0.18

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 (68) hide show
  1. package/css/index.css +1 -1
  2. package/dist/index.esm.js +64 -18
  3. package/dist/index.umd.js +1 -1
  4. package/es/Button/index.js +7 -25
  5. package/es/Checkbox/Group.js +2 -2
  6. package/es/Checkbox/index.js +13 -26
  7. package/es/CodeInput/index.js +0 -3
  8. package/es/Collapse/Item.js +8 -50
  9. package/es/Collapse/index.js +3 -5
  10. package/es/ColorPicker/ColorPickerInput.js +210 -224
  11. package/es/ColorPicker/ColorPickerSelect.js +4 -61
  12. package/es/ColorPicker/ColorPickerSlider.js +67 -100
  13. package/es/ColorPicker/index.js +16 -62
  14. package/es/Command/createCommand.d.ts +1 -1
  15. package/es/ContextMenu/index.js +1 -5
  16. package/es/Cursor/index.js +3 -15
  17. package/es/Divider/index.js +3 -12
  18. package/es/Drawer/index.js +42 -83
  19. package/es/Element/index.js +6 -2
  20. package/es/Empty/PRESENTED_IMAGE_SIMPLE.js +4 -12
  21. package/es/Empty/assets/EmptySvg.js +3 -3
  22. package/es/Empty/assets/SimpleEmptySvg.js +3 -3
  23. package/es/Empty/index.js +4 -12
  24. package/es/Form/FormItem.js +47 -76
  25. package/es/Fragment/index.js +1 -3
  26. package/es/Image/index.js +11 -31
  27. package/es/Input/TextArea.js +5 -31
  28. package/es/Input/index.js +46 -103
  29. package/es/InputNumber/index.js +4 -11
  30. package/es/Menu/InternalMenu.js +37 -93
  31. package/es/Message/Message.js +7 -11
  32. package/es/Modal/index.js +55 -107
  33. package/es/Modal/useModal.js +5 -14
  34. package/es/Modal/warning.js +5 -14
  35. package/es/Popconfirm/index.js +24 -36
  36. package/es/Popover/index.js +11 -20
  37. package/es/Progress/Circle.js +14 -63
  38. package/es/Progress/index.js +14 -38
  39. package/es/Radio/Button.js +4 -20
  40. package/es/Radio/index.js +5 -35
  41. package/es/RangeInput/index.js +22 -76
  42. package/es/Result/index.js +6 -27
  43. package/es/Segmented/index.js +13 -33
  44. package/es/Select/index.js +6 -35
  45. package/es/SelectInput/index.js +48 -112
  46. package/es/Slider/index.js +11 -84
  47. package/es/Space/index.js +2 -2
  48. package/es/Spin/index.js +14 -26
  49. package/es/Switch/index.js +4 -6
  50. package/es/Table/index.js +18 -40
  51. package/es/Tabs/index.js +91 -195
  52. package/es/Timeline/index.js +4 -14
  53. package/es/Tooltip/index.js +20 -48
  54. package/es/Transformer/index.js +59 -123
  55. package/es/Tree/SingleLevelTree.js +30 -191
  56. package/es/TreeFor/index.js +3 -3
  57. package/es/TreeSelect/index.js +4 -6
  58. package/es/Upload/index.js +4 -38
  59. package/es/assets/svg/ColorPickUp.js +6 -19
  60. package/es/assets/svg/Crosshair.js +6 -45
  61. package/es/assets/svg/Resize.js +6 -19
  62. package/es/assets/svg/Rotate.js +13 -14
  63. package/es/assets/svg/RotateArrow.js +20 -15
  64. package/es/hooks/useClickAway.js +6 -4
  65. package/es/utils/DOMRect.d.ts +22 -0
  66. package/es/utils/DOMRect.js +41 -0
  67. package/package.json +14 -15
  68. package/src/index.ts +102 -0
@@ -1,8 +1,8 @@
1
- import { delegateEvents, insert, use, effect, className, setAttribute, template } from 'solid-js/web';
1
+ import { ssr, ssrHydrationKey, ssrAttribute, escape } from 'solid-js/web';
2
2
  import { nanoid } from 'nanoid';
3
- import { mergeProps, createSignal } from 'solid-js';
3
+ import { mergeProps } from 'solid-js';
4
4
 
5
- var _tmpl$ = /*#__PURE__*/template(`<span><input class=hidden type=file>`);
5
+ var _tmpl$ = ["<span", "><!--$-->", "<!--/--><input class=\"hidden\" type=\"file\"", "", "></span>"];
6
6
  /**
7
7
  * 根据一个 File 对象创建一个 UploadFile 对象
8
8
  * @param file
@@ -55,7 +55,6 @@ async function request(uploadFileSignal, customRequest) {
55
55
  });
56
56
  }
57
57
  const Upload = _props => {
58
- let input;
59
58
  const props = mergeProps({
60
59
  customRequest: ({
61
60
  file,
@@ -71,42 +70,9 @@ const Upload = _props => {
71
70
  }).then(onSuccess).catch(onError);
72
71
  }
73
72
  }, _props);
74
- return (() => {
75
- var _el$ = _tmpl$(),
76
- _el$2 = _el$.firstChild;
77
- _el$.$$click = () => input?.click();
78
- insert(_el$, () => props.children, _el$2);
79
- _el$2.$$input = e => {
80
- const fileList = [];
81
- for (const file of Array.from(e.target.files ?? [])) {
82
- // eslint-disable-next-line solid/reactivity
83
- const uploadFileSignal = createSignal(createUploadFile(file));
84
- request(uploadFileSignal, props.customRequest);
85
- fileList.push(uploadFileSignal);
86
- }
87
- props.onAdd?.(fileList);
88
- e.target.value = '';
89
- };
90
- var _ref$ = input;
91
- typeof _ref$ === "function" ? use(_ref$, _el$2) : input = _el$2;
92
- effect(_p$ => {
93
- var _v$ = props.class,
94
- _v$2 = props.accept,
95
- _v$3 = props.multiple;
96
- _v$ !== _p$.e && className(_el$, _p$.e = _v$);
97
- _v$2 !== _p$.t && setAttribute(_el$2, "accept", _p$.t = _v$2);
98
- _v$3 !== _p$.a && (_el$2.multiple = _p$.a = _v$3);
99
- return _p$;
100
- }, {
101
- e: undefined,
102
- t: undefined,
103
- a: undefined
104
- });
105
- return _el$;
106
- })();
73
+ return ssr(_tmpl$, ssrHydrationKey() + ssrAttribute("class", escape(props.class, true), false), escape(props.children), ssrAttribute("accept", escape(props.accept, true), false), ssrAttribute("multiple", props.multiple, true));
107
74
  };
108
75
  Upload.request = request;
109
76
  Upload.createUploadFile = createUploadFile;
110
- delegateEvents(["click", "input"]);
111
77
 
112
78
  export { Upload as default };
@@ -1,25 +1,12 @@
1
- import { effect, setAttribute, style, template } from 'solid-js/web';
1
+ import { ssr, ssrHydrationKey, ssrAttribute, escape, ssrStyle } from 'solid-js/web';
2
2
  import { commonStyle } from './common.js';
3
3
 
4
- var _tmpl$ = /*#__PURE__*/template(`<svg viewBox="0 0 1024 1024"xmlns=http://www.w3.org/2000/svg><path d="M856.2176 347.904l-90.624 90.624 53.504 53.504a52.3264 52.3264 0 1 1-73.984 73.984l-71.5776-71.6288-444.928 444.9792a25.6 25.6 0 0 1-13.4656 7.0656l-133.1712 24.576a25.6 25.6 0 0 1-29.7984-29.7984l24.576-133.1712a25.6 25.6 0 0 1 7.0656-13.4656l444.928-444.9792-71.68-71.6288a52.3264 52.3264 0 0 1 73.984-73.984l53.504 53.504 90.624-90.624a128 128 0 0 1 181.0432 181.0432z m-291.328 37.888l-439.296 439.3472-16.384 88.7808 88.832-16.384 439.296-439.296-72.448-72.448z">`);
4
+ var _tmpl$ = ["<svg", " viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\"", " style=\"", "\"><path d=\"M856.2176 347.904l-90.624 90.624 53.504 53.504a52.3264 52.3264 0 1 1-73.984 73.984l-71.5776-71.6288-444.928 444.9792a25.6 25.6 0 0 1-13.4656 7.0656l-133.1712 24.576a25.6 25.6 0 0 1-29.7984-29.7984l24.576-133.1712a25.6 25.6 0 0 1 7.0656-13.4656l444.928-444.9792-71.68-71.6288a52.3264 52.3264 0 0 1 73.984-73.984l53.504 53.504 90.624-90.624a128 128 0 0 1 181.0432 181.0432z m-291.328 37.888l-439.296 439.3472-16.384 88.7808 88.832-16.384 439.296-439.296-72.448-72.448z\"></path></svg>"];
5
5
  const ColorPickUpSvg = props => {
6
- return (() => {
7
- var _el$ = _tmpl$();
8
- effect(_p$ => {
9
- var _v$ = props.class,
10
- _v$2 = {
11
- ...commonStyle,
12
- ...props.style
13
- };
14
- _v$ !== _p$.e && setAttribute(_el$, "class", _p$.e = _v$);
15
- _p$.t = style(_el$, _v$2, _p$.t);
16
- return _p$;
17
- }, {
18
- e: undefined,
19
- t: undefined
20
- });
21
- return _el$;
22
- })();
6
+ return ssr(_tmpl$, ssrHydrationKey(), ssrAttribute("class", escape(props.class, true), false), ssrStyle({
7
+ ...commonStyle,
8
+ ...props.style
9
+ }));
23
10
  };
24
11
 
25
12
  export { ColorPickUpSvg as default };
@@ -1,51 +1,12 @@
1
- import { use, effect, setAttribute, style, template } from 'solid-js/web';
1
+ import { ssr, ssrHydrationKey, ssrAttribute, escape, ssrStyle } from 'solid-js/web';
2
2
  import { commonStyle } from './common.js';
3
3
 
4
- var _tmpl$ = /*#__PURE__*/template(`<svg viewBox="0 0 26 26"version=1.1 xmlns=http://www.w3.org/2000/svg><line x1=50% x2=50% y2=100% stroke-width=3></line><line x1=50% x2=50% y2=100% stroke-width=1></line><line x1=100% y1=50% y2=50% stroke-width=3></line><line x1=100% y1=50% y2=50% stroke-width=1></line><circle cx=50% cy=50% r=32.7% fill=none stroke-width=3></circle><circle cx=50% cy=50% r=32.7% fill=none stroke-width=1>`);
4
+ var _tmpl$ = ["<svg", " viewBox=\"0 0 26 26\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"", " style=\"", "\"><line x1=\"50%\" x2=\"50%\" y2=\"100%\" stroke-width=\"3\"", "></line><line x1=\"50%\" x2=\"50%\" y2=\"100%\" stroke-width=\"1\"", "></line><line x1=\"100%\" y1=\"50%\" y2=\"50%\" stroke-width=\"3\"", "></line><line x1=\"100%\" y1=\"50%\" y2=\"50%\" stroke-width=\"1\"", "></line><circle cx=\"50%\" cy=\"50%\" r=\"32.7%\" fill=\"none\" stroke-width=\"3\"", "></circle><circle cx=\"50%\" cy=\"50%\" r=\"32.7%\" fill=\"none\" stroke-width=\"1\"", "></circle></svg>"];
5
5
  const CrosshairSvg = props => {
6
- return (() => {
7
- var _el$ = _tmpl$(),
8
- _el$2 = _el$.firstChild,
9
- _el$3 = _el$2.nextSibling,
10
- _el$4 = _el$3.nextSibling,
11
- _el$5 = _el$4.nextSibling,
12
- _el$6 = _el$5.nextSibling,
13
- _el$7 = _el$6.nextSibling;
14
- var _ref$ = props.ref;
15
- typeof _ref$ === "function" ? use(_ref$, _el$) : props.ref = _el$;
16
- effect(_p$ => {
17
- var _v$ = props.class,
18
- _v$2 = {
19
- ...commonStyle,
20
- ...props.style
21
- },
22
- _v$3 = props.outerColor,
23
- _v$4 = props.innerColor,
24
- _v$5 = props.outerColor,
25
- _v$6 = props.innerColor,
26
- _v$7 = props.outerColor,
27
- _v$8 = props.innerColor;
28
- _v$ !== _p$.e && setAttribute(_el$, "class", _p$.e = _v$);
29
- _p$.t = style(_el$, _v$2, _p$.t);
30
- _v$3 !== _p$.a && setAttribute(_el$2, "stroke", _p$.a = _v$3);
31
- _v$4 !== _p$.o && setAttribute(_el$3, "stroke", _p$.o = _v$4);
32
- _v$5 !== _p$.i && setAttribute(_el$4, "stroke", _p$.i = _v$5);
33
- _v$6 !== _p$.n && setAttribute(_el$5, "stroke", _p$.n = _v$6);
34
- _v$7 !== _p$.s && setAttribute(_el$6, "stroke", _p$.s = _v$7);
35
- _v$8 !== _p$.h && setAttribute(_el$7, "stroke", _p$.h = _v$8);
36
- return _p$;
37
- }, {
38
- e: undefined,
39
- t: undefined,
40
- a: undefined,
41
- o: undefined,
42
- i: undefined,
43
- n: undefined,
44
- s: undefined,
45
- h: undefined
46
- });
47
- return _el$;
48
- })();
6
+ return ssr(_tmpl$, ssrHydrationKey(), ssrAttribute("class", escape(props.class, true), false), ssrStyle({
7
+ ...commonStyle,
8
+ ...props.style
9
+ }), ssrAttribute("stroke", escape(props.outerColor, true), false), ssrAttribute("stroke", escape(props.innerColor, true), false), ssrAttribute("stroke", escape(props.outerColor, true), false), ssrAttribute("stroke", escape(props.innerColor, true), false), ssrAttribute("stroke", escape(props.outerColor, true), false), ssrAttribute("stroke", escape(props.innerColor, true), false));
49
10
  };
50
11
 
51
12
  export { CrosshairSvg as default };
@@ -1,25 +1,12 @@
1
- import { effect, setAttribute, style, template } from 'solid-js/web';
1
+ import { ssr, ssrHydrationKey, ssrAttribute, escape, ssrStyle } from 'solid-js/web';
2
2
  import { commonStyle } from './common.js';
3
3
 
4
- var _tmpl$ = /*#__PURE__*/template(`<svg viewBox="0 0 1024 1024"xmlns=http://www.w3.org/2000/svg><path fill=black stroke=white stroke-width=50 d="M531.2 179.2l130.133333 140.8c4.266667 4.266667 6.4 10.666667 6.4 14.933333-2.133333 4.266667-6.4 6.4-14.933333 6.4h-85.333333v341.333334h85.333333c8.533333 0 12.8 2.133333 14.933333 6.4 2.133333 4.266667 0 8.533333-6.4 14.933333l-130.133333 140.8c-4.266667 6.4-12.8 8.533333-19.2 8.533333s-14.933333-2.133333-19.2-8.533333l-130.133333-140.8c-4.266667-4.266667-6.4-10.666667-6.4-14.933333 2.133333-4.266667 6.4-6.4 14.933333-6.4h85.333333v-341.333334h-85.333333c-8.533333 0-12.8-2.133333-14.933333-6.4-2.133333-4.266667 0-8.533333 6.4-14.933333l130.133333-140.8c4.266667-6.4 12.8-8.533333 19.2-8.533333s14.933333 2.133333 19.2 8.533333z">`);
4
+ var _tmpl$ = ["<svg", " viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\"", " style=\"", "\"><path fill=\"black\" stroke=\"white\" stroke-width=\"50\" d=\"M531.2 179.2l130.133333 140.8c4.266667 4.266667 6.4 10.666667 6.4 14.933333-2.133333 4.266667-6.4 6.4-14.933333 6.4h-85.333333v341.333334h85.333333c8.533333 0 12.8 2.133333 14.933333 6.4 2.133333 4.266667 0 8.533333-6.4 14.933333l-130.133333 140.8c-4.266667 6.4-12.8 8.533333-19.2 8.533333s-14.933333-2.133333-19.2-8.533333l-130.133333-140.8c-4.266667-4.266667-6.4-10.666667-6.4-14.933333 2.133333-4.266667 6.4-6.4 14.933333-6.4h85.333333v-341.333334h-85.333333c-8.533333 0-12.8-2.133333-14.933333-6.4-2.133333-4.266667 0-8.533333 6.4-14.933333l130.133333-140.8c4.266667-6.4 12.8-8.533333 19.2-8.533333s14.933333 2.133333 19.2 8.533333z\"></path></svg>"];
5
5
  const Resize = props => {
6
- return (() => {
7
- var _el$ = _tmpl$();
8
- effect(_p$ => {
9
- var _v$ = props.class,
10
- _v$2 = {
11
- ...commonStyle,
12
- ...props.style
13
- };
14
- _v$ !== _p$.e && setAttribute(_el$, "class", _p$.e = _v$);
15
- _p$.t = style(_el$, _v$2, _p$.t);
16
- return _p$;
17
- }, {
18
- e: undefined,
19
- t: undefined
20
- });
21
- return _el$;
22
- })();
6
+ return ssr(_tmpl$, ssrHydrationKey(), ssrAttribute("class", escape(props.class, true), false), ssrStyle({
7
+ ...commonStyle,
8
+ ...props.style
9
+ }));
23
10
  };
24
11
 
25
12
  export { Resize as default };
@@ -1,20 +1,19 @@
1
- import { spread, mergeProps, template } from 'solid-js/web';
1
+ import { ssrElement, mergeProps, ssr } from 'solid-js/web';
2
2
  import { commonStyle } from './common.js';
3
3
 
4
- var _tmpl$ = /*#__PURE__*/template(`<svg viewBox="0 0 27 27"xmlns=http://www.w3.org/2000/svg><g><path data-follow-fill=currentColor fill-rule=evenodd clip-rule=evenodd d="M13.55 27c7.269 0 13.161-5.893 13.161-13.162C26.711 6.569 20.82.677 13.55.677 6.281.677.389 6.569.389 13.838c0 7.269 5.892 13.161 13.161 13.161Zm8.062-10.286 2.062-2.872c.409-.556.22-1.08-.45-1.08h-1.17c-.508-4.132-4.116-7.479-8.502-7.479-2.324 0-4.443.99-5.932 2.52-.467.426-.467 1.015-.131 1.367.343.376.9.442 1.415 0a6.48 6.48 0 0 1 4.648-1.964c3.371 0 6.071 2.455 6.562 5.556h-1.276c-.655 0-.851.524-.45 1.08l2.07 2.872c.32.45.826.45 1.154 0Zm-8.061 5.678c2.34 0 4.459-.99 5.948-2.52.459-.434.459-1.023.131-1.375-.352-.376-.9-.433-1.424.008a6.457 6.457 0 0 1-4.655 1.964 6.61 6.61 0 0 1-6.555-5.556h1.26c.663 0 .851-.523.45-1.072l-2.062-2.88c-.327-.45-.834-.45-1.153 0l-2.07 2.872c-.401.557-.221 1.08.45 1.08h1.186c.507 4.133 4.116 7.48 8.494 7.48Z"fill=currentColor>`);
4
+ var _tmpl$ = "<g><path data-follow-fill=\"currentColor\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13.55 27c7.269 0 13.161-5.893 13.161-13.162C26.711 6.569 20.82.677 13.55.677 6.281.677.389 6.569.389 13.838c0 7.269 5.892 13.161 13.161 13.161Zm8.062-10.286 2.062-2.872c.409-.556.22-1.08-.45-1.08h-1.17c-.508-4.132-4.116-7.479-8.502-7.479-2.324 0-4.443.99-5.932 2.52-.467.426-.467 1.015-.131 1.367.343.376.9.442 1.415 0a6.48 6.48 0 0 1 4.648-1.964c3.371 0 6.071 2.455 6.562 5.556h-1.276c-.655 0-.851.524-.45 1.08l2.07 2.872c.32.45.826.45 1.154 0Zm-8.061 5.678c2.34 0 4.459-.99 5.948-2.52.459-.434.459-1.023.131-1.375-.352-.376-.9-.433-1.424.008a6.457 6.457 0 0 1-4.655 1.964 6.61 6.61 0 0 1-6.555-5.556h1.26c.663 0 .851-.523.45-1.072l-2.062-2.88c-.327-.45-.834-.45-1.153 0l-2.07 2.872c-.401.557-.221 1.08.45 1.08h1.186c.507 4.133 4.116 7.48 8.494 7.48Z\" fill=\"currentColor\"></path></g>";
5
5
  const Rotate = props => {
6
- return (() => {
7
- var _el$ = _tmpl$();
8
- spread(_el$, mergeProps(props, {
9
- get style() {
10
- return {
11
- ...commonStyle,
12
- ...props.style
13
- };
14
- }
15
- }), true, true);
16
- return _el$;
17
- })();
6
+ return ssrElement("svg", mergeProps({
7
+ viewBox: "0 0 27 27",
8
+ xmlns: "http://www.w3.org/2000/svg"
9
+ }, props, {
10
+ get style() {
11
+ return {
12
+ ...commonStyle,
13
+ ...props.style
14
+ };
15
+ }
16
+ }), () => ssr(_tmpl$), true);
18
17
  };
19
18
 
20
19
  export { Rotate as default };
@@ -1,21 +1,26 @@
1
- import { spread, mergeProps, template } from 'solid-js/web';
1
+ import { ssrElement, mergeProps, ssr, escape } from 'solid-js/web';
2
2
  import { commonStyle } from './common.js';
3
3
 
4
- var _tmpl$ = /*#__PURE__*/template(`<svg viewBox="0 0 1000 1000"xmlns=http://www.w3.org/2000/svg><path fill=black stroke-width=50 stroke=white d="M 100,700 l 210,-150 v 105 Q 700,700 655,310 h -105 L 700,100 l 150,210 h -105 Q 745,745 310,745 v 105 L 100,700">`);
4
+ var _tmpl$ = ["<path fill=\"black\" stroke-width=\"50\" stroke=\"white\" d=\"", "\"></path>"];
5
5
  const RotateArrowSvg = props => {
6
- return (() => {
7
- var _el$ = _tmpl$();
8
- _el$.firstChild;
9
- spread(_el$, mergeProps(props, {
10
- get style() {
11
- return {
12
- ...commonStyle,
13
- ...props.style
14
- };
15
- }
16
- }), true, true);
17
- return _el$;
18
- })();
6
+ const startX = 100;
7
+ const startY = 700;
8
+ const arrowWidth = 300;
9
+ const halfArrowWidth = arrowWidth / 2;
10
+ const arrowLength = arrowWidth * 0.7;
11
+ const curveWidth = arrowWidth * 0.3;
12
+ const halfCurveWidth = curveWidth / 2;
13
+ return ssrElement("svg", mergeProps({
14
+ viewBox: "0 0 1000 1000",
15
+ xmlns: "http://www.w3.org/2000/svg"
16
+ }, props, {
17
+ get style() {
18
+ return {
19
+ ...commonStyle,
20
+ ...props.style
21
+ };
22
+ }
23
+ }), () => ssr(_tmpl$, `M ${escape(startX, true)},${escape(startY, true)} l ${escape(arrowLength, true)},${-halfArrowWidth} v ${escape(halfArrowWidth, true) - escape(halfCurveWidth, true)} Q ${escape(startY, true)},${escape(startY, true)} ${escape(startY, true) - escape(halfCurveWidth, true)},${escape(startX, true) + escape(arrowLength, true)} h ${escape(halfCurveWidth, true) - escape(halfArrowWidth, true)} L ${escape(startY, true)},${escape(startX, true)} l ${escape(halfArrowWidth, true)},${escape(arrowLength, true)} h ${escape(halfCurveWidth, true) - escape(halfArrowWidth, true)} Q ${escape(startY, true) + escape(halfCurveWidth, true)},${escape(startY, true) + escape(halfCurveWidth, true)} ${escape(startX, true) + escape(arrowLength, true)},${escape(startY, true) + escape(halfCurveWidth, true)} v ${escape(halfArrowWidth, true) - escape(halfCurveWidth, true)} L ${escape(startX, true)},${escape(startY, true)}`), true);
19
24
  };
20
25
 
21
26
  export { RotateArrowSvg as default };
@@ -1,4 +1,4 @@
1
- import { onCleanup } from 'solid-js';
1
+ import { onMount, onCleanup } from 'solid-js';
2
2
  import { compact } from 'lodash-es';
3
3
  import { toArray } from '../utils/array.js';
4
4
 
@@ -9,9 +9,11 @@ function useClickAway(onClickAway, target) {
9
9
  onClickAway(event);
10
10
  }
11
11
  };
12
- window.addEventListener('click', onClick);
13
- onCleanup(() => {
14
- window.removeEventListener('click', onClick);
12
+ onMount(() => {
13
+ window.addEventListener('click', onClick);
14
+ onCleanup(() => {
15
+ window.removeEventListener('click', onClick);
16
+ });
15
17
  });
16
18
  }
17
19
 
@@ -0,0 +1,22 @@
1
+ export declare class DOMRect {
2
+ x: number;
3
+ y: number;
4
+ width: number;
5
+ height: number;
6
+ constructor(x?: number, y?: number, width?: number, height?: number);
7
+ static fromRect(otherRect: DOMRect): DOMRect;
8
+ get top(): number;
9
+ get left(): number;
10
+ get right(): number;
11
+ get bottom(): number;
12
+ toJSON(): {
13
+ x: number;
14
+ y: number;
15
+ width: number;
16
+ height: number;
17
+ top: number;
18
+ left: number;
19
+ right: number;
20
+ bottom: number;
21
+ };
22
+ }
@@ -0,0 +1,41 @@
1
+ class DOMRect {
2
+ x;
3
+ y;
4
+ width;
5
+ height;
6
+ constructor(x = 0, y = 0, width = 0, height = 0) {
7
+ this.x = x;
8
+ this.y = y;
9
+ this.width = width;
10
+ this.height = height;
11
+ }
12
+ static fromRect(otherRect) {
13
+ return new DOMRect(otherRect.x, otherRect.y, otherRect.width, otherRect.height);
14
+ }
15
+ get top() {
16
+ return this.y;
17
+ }
18
+ get left() {
19
+ return this.x;
20
+ }
21
+ get right() {
22
+ return this.x + this.width;
23
+ }
24
+ get bottom() {
25
+ return this.y + this.height;
26
+ }
27
+ toJSON() {
28
+ return {
29
+ x: this.x,
30
+ y: this.y,
31
+ width: this.width,
32
+ height: this.height,
33
+ top: this.top,
34
+ left: this.left,
35
+ right: this.right,
36
+ bottom: this.bottom
37
+ };
38
+ }
39
+ }
40
+
41
+ export { DOMRect };
package/package.json CHANGED
@@ -1,20 +1,11 @@
1
1
  {
2
2
  "name": "antd-solid",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "",
5
- "main": "dist/index.esm.js",
5
+ "main": "src/index.ts",
6
6
  "module": "es/index.js",
7
- "types": "es/index.d.ts",
7
+ "types": "src/index.ts",
8
8
  "type": "module",
9
- "scripts": {
10
- "docs:dev": "vitepress dev docs",
11
- "docs:build": "node scripts/annotationNonProductionCode && vitepress build docs && node scripts/cancelAnnotationNonProductionCode",
12
- "docs:preview": "vitepress preview docs",
13
- "build": "rm -rf dist && rm -rf es && rm -rf css && NODE_ENV=production && npx rollup -c && npm run build:unocss",
14
- "build:unocss": "npx unocss './src/**' -o css/index.css -m",
15
- "test": "vitest",
16
- "prepare": "husky install"
17
- },
18
9
  "devDependencies": {
19
10
  "@iconify-json/ant-design": "^1.1.5",
20
11
  "@rollup/plugin-babel": "^6.0.3",
@@ -32,7 +23,7 @@
32
23
  "@unocss/reset": "^0.57.1",
33
24
  "@unocss/transformer-variant-group": "^0.51.6",
34
25
  "@unocss/vite": "^0.51.6",
35
- "babel-preset-solid": "^1.7.3",
26
+ "babel-preset-solid": "^1.9.6",
36
27
  "eslint": "^8.56.0",
37
28
  "eslint-config-prettier": "^8.8.0",
38
29
  "eslint-config-standard-with-typescript": "^43.0.0",
@@ -81,5 +72,13 @@
81
72
  "dist",
82
73
  "es",
83
74
  "css"
84
- ]
85
- }
75
+ ],
76
+ "scripts": {
77
+ "docs:dev": "vitepress dev docs",
78
+ "docs:build": "node scripts/annotationNonProductionCode && vitepress build docs && node scripts/cancelAnnotationNonProductionCode",
79
+ "docs:preview": "vitepress preview docs",
80
+ "build": "rm -rf dist && rm -rf es && rm -rf css && NODE_ENV=production && npx rollup -c && npm run build:unocss",
81
+ "build:unocss": "npx unocss './src/**' -o css/index.css -m",
82
+ "test": "vitest"
83
+ }
84
+ }
package/src/index.ts ADDED
@@ -0,0 +1,102 @@
1
+ export { default as Button } from './Button'
2
+ export { default as Input } from './Input'
3
+ export type { InputProps, TextAreaProps } from './Input'
4
+ export { default as InputNumber } from './InputNumber'
5
+ export type { InputNumberProps } from './InputNumber'
6
+ export { default as Timeline } from './Timeline'
7
+ export { default as Modal } from './Modal'
8
+ export type { ModalProps } from './Modal'
9
+ export { default as Drawer } from './Drawer'
10
+ export type { DrawerProps } from './Drawer'
11
+ // export { default as DatePicker } from './DatePicker'
12
+ export type { RangeInputProps } from './RangeInput'
13
+ export { default as RangeInput } from './RangeInput'
14
+ export type { SelectInputProps } from './SelectInput'
15
+ export { default as SelectInput } from './SelectInput'
16
+ export { default as Select } from './Select'
17
+ export type { SelectProps, SelectOption } from './Select'
18
+ export { default as Tree } from './Tree'
19
+ export type { TreeProps } from './Tree'
20
+ export { default as Popover } from './Popover'
21
+ export type { PopoverProps } from './Popover'
22
+ export { default as Tooltip } from './Tooltip'
23
+ export type { TooltipProps } from './Tooltip'
24
+ export { default as ColorPicker } from './ColorPicker'
25
+ export type { ColorPickerProps } from './ColorPicker'
26
+ export { default as Result } from './Result'
27
+ export { default as Progress } from './Progress'
28
+ export type { ProgressProps } from './Progress'
29
+ export { default as Tabs } from './Tabs'
30
+ export type { TabsProps, TabItem } from './Tabs'
31
+ export { default as Popconfirm } from './Popconfirm'
32
+ export type { PopconfirmProps } from './Popconfirm'
33
+ export { default as Upload } from './Upload'
34
+ export type { UploadProps, UploadFile } from './Upload'
35
+ export { default as Radio } from './Radio'
36
+ export type { RadioProps } from './Radio'
37
+ export type { RadioGroupProps } from './Radio/Group'
38
+ export { default as Form } from './Form'
39
+ export type { FormInstance, FormProps, FormItemProps, FormItemComponentProps } from './Form'
40
+ export { default as Switch } from './Switch'
41
+ export type { SwitchProps } from './Switch'
42
+ export { default as Spin } from './Spin'
43
+ export { default as Image } from './Image'
44
+ export type { ImageProps } from './Image'
45
+ export { default as Table } from './Table'
46
+ export type { TableProps, TableColumn } from './Table'
47
+ export { default as Compact } from './Compact'
48
+ export { default as CompactContextIsolator } from './Compact/CompactContextIsolator'
49
+ export type { CollapseProps, CollapseItem } from './Collapse'
50
+ export { default as Collapse } from './Collapse'
51
+ export { default as Empty } from './Empty'
52
+ export type { SegmentedProps } from './Segmented'
53
+ export { default as Segmented } from './Segmented'
54
+ export type { AlertProps } from './Alert'
55
+ export { default as Alert } from './Alert'
56
+ export { default as Checkbox } from './Checkbox'
57
+ export type { CheckboxProps } from './Checkbox'
58
+ export { default as TreeSelect } from './TreeSelect'
59
+ export type { TreeSelectProps, TreeSelectNode } from './TreeSelect'
60
+ export { default as Divider } from './Divider'
61
+ export type { DividerProps } from './Divider'
62
+ export { default as Slider } from './Slider'
63
+ export type { SliderProps } from './Slider'
64
+ export { default as Transformer } from './Transformer'
65
+ export type { TransformerProps, TransformValue, TransformerInstance } from './Transformer'
66
+ export { default as Menu } from './Menu'
67
+ export type { MenuProps, MenuItem, MenuItemType, MenuDividerType } from './Menu'
68
+ export { default as Dropdown } from './Dropdown'
69
+ export type { DropdownProps } from './Dropdown'
70
+ export { default as Element } from './Element'
71
+ export type { ElementProps } from './Element'
72
+ export { default as Cursor } from './Cursor'
73
+ export type { CursorProps } from './Cursor'
74
+ export { default as Space } from './Space'
75
+ export { default as CodeInput } from './CodeInput'
76
+ export type { CodeInputProps } from './CodeInput'
77
+ export { default as message } from './Message'
78
+ export type { MessageApi } from './Message'
79
+ export { default as Command } from './Command'
80
+ export { default as ContextMenu } from './ContextMenu'
81
+
82
+ export { default as ConfigProvider } from './ConfigProvider'
83
+ export { default as Fragment } from './Fragment'
84
+ export { default as DelayShow } from './DelayShow'
85
+ export { default as TreeFor } from './TreeFor'
86
+
87
+ export { default as createControllableValue } from './hooks/createControllableValue'
88
+ export { default as useClickAway } from './hooks/useClickAway'
89
+ export { default as useSize } from './hooks/useSize'
90
+ export { default as useScroll } from './hooks/useScroll'
91
+ export { default as useHover } from './hooks/useHover'
92
+ export { default as useFocus } from './hooks/useFocus'
93
+ export { default as useVirtualList } from './hooks/useVirtualList'
94
+ export { default as useCounter } from './hooks/useCounter'
95
+ export { default as useMouse } from './hooks/useMouse'
96
+
97
+ export { setupGlobalDrag } from './utils/setupGlobalDrag'
98
+
99
+ export type { ComponentSize } from './types'
100
+
101
+ export { default as enUS } from './locale/en_US'
102
+ export { default as zhCN } from './locale/zh_CN'