antd-solid 0.0.17 → 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.
- package/css/index.css +1 -1
- package/dist/index.esm.js +64 -18
- package/dist/index.umd.js +1 -1
- package/es/Button/index.js +7 -25
- package/es/Checkbox/Group.js +2 -2
- package/es/Checkbox/index.js +13 -26
- package/es/CodeInput/index.js +0 -3
- package/es/Collapse/Item.js +8 -50
- package/es/Collapse/index.js +3 -5
- package/es/ColorPicker/ColorPickerInput.js +210 -224
- package/es/ColorPicker/ColorPickerSelect.js +4 -61
- package/es/ColorPicker/ColorPickerSlider.js +67 -100
- package/es/ColorPicker/index.js +16 -62
- package/es/ContextMenu/index.js +1 -5
- package/es/Cursor/index.js +3 -15
- package/es/Divider/index.js +3 -12
- package/es/Drawer/index.js +42 -83
- package/es/Element/index.js +6 -2
- package/es/Empty/PRESENTED_IMAGE_SIMPLE.js +4 -12
- package/es/Empty/assets/EmptySvg.js +3 -3
- package/es/Empty/assets/SimpleEmptySvg.js +3 -3
- package/es/Empty/index.js +4 -12
- package/es/Form/FormItem.js +47 -76
- package/es/Fragment/index.js +1 -3
- package/es/Image/index.js +11 -31
- package/es/Input/TextArea.js +5 -31
- package/es/Input/index.js +46 -103
- package/es/InputNumber/index.js +4 -11
- package/es/Menu/InternalMenu.js +37 -93
- package/es/Message/Message.js +7 -11
- package/es/Modal/index.js +55 -107
- package/es/Modal/useModal.js +5 -14
- package/es/Modal/warning.js +5 -14
- package/es/Popconfirm/index.js +24 -36
- package/es/Popover/index.js +11 -20
- package/es/Progress/Circle.js +14 -63
- package/es/Progress/index.js +14 -38
- package/es/Radio/Button.js +4 -20
- package/es/Radio/index.js +5 -35
- package/es/RangeInput/index.js +22 -76
- package/es/Result/index.js +6 -27
- package/es/Segmented/index.js +13 -33
- package/es/Select/index.js +6 -35
- package/es/SelectInput/index.js +48 -112
- package/es/Slider/index.js +11 -84
- package/es/Space/index.js +2 -2
- package/es/Spin/index.js +14 -26
- package/es/Switch/index.js +4 -6
- package/es/Table/index.js +18 -40
- package/es/Tabs/index.js +91 -195
- package/es/Timeline/index.js +4 -14
- package/es/Tooltip/index.js +20 -48
- package/es/Transformer/index.js +59 -123
- package/es/Tree/SingleLevelTree.js +30 -191
- package/es/TreeFor/index.js +3 -3
- package/es/TreeSelect/index.js +4 -6
- package/es/Upload/index.js +4 -38
- package/es/assets/svg/ColorPickUp.js +6 -19
- package/es/assets/svg/Crosshair.js +6 -45
- package/es/assets/svg/Resize.js +6 -19
- package/es/assets/svg/Rotate.js +13 -14
- package/es/assets/svg/RotateArrow.js +20 -15
- package/es/hooks/useClickAway.js +6 -4
- package/es/utils/DOMRect.d.ts +22 -0
- package/es/utils/DOMRect.js +41 -0
- package/package.json +14 -15
- package/src/index.ts +102 -0
package/es/Progress/Circle.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { createComponent,
|
|
1
|
+
import { createComponent, ssr, ssrHydrationKey, ssrAttribute, escape } from 'solid-js/web';
|
|
2
2
|
import { mergeProps, createMemo, Show, Switch, Match } from 'solid-js';
|
|
3
3
|
import 'lodash-es';
|
|
4
4
|
import useSize from '../hooks/useSize.js';
|
|
5
5
|
import Element from '../Element/index.js';
|
|
6
6
|
|
|
7
|
-
var _tmpl$ =
|
|
8
|
-
_tmpl$2 =
|
|
9
|
-
_tmpl$3 =
|
|
10
|
-
_tmpl$4 =
|
|
7
|
+
var _tmpl$ = ["<svg", " viewBox=\"0 0 100 100\" role=\"presentation\"><circle", " cx=\"50\" cy=\"50\" stroke-linecap=\"round\"", " style=\"", "\"></circle><circle", " cx=\"50\" cy=\"50\" stroke-linecap=\"round\"", " opacity=\"1\" style=\"", "\"></circle></svg>"],
|
|
8
|
+
_tmpl$2 = ["<span", " class=\"i-ant-design:check-outlined text-[var(--ant-color-success)] text-1.1667em\"></span>"],
|
|
9
|
+
_tmpl$3 = ["<span", " class=\"i-ant-design:close-outlined text-[var(--ant-color-error)] text-1.1667em\"></span>"],
|
|
10
|
+
_tmpl$4 = ["<span", " class=\"shrink-0 text-center text-1em absolute top-1/2 left-1/2 -translate-1/2\">", "</span>"];
|
|
11
11
|
const Circle = _props => {
|
|
12
12
|
let ref;
|
|
13
13
|
const props = mergeProps({
|
|
@@ -24,10 +24,6 @@ const Circle = _props => {
|
|
|
24
24
|
const perimeter = createMemo(() => radius() * 2 * Math.PI);
|
|
25
25
|
const size = useSize(() => ref);
|
|
26
26
|
return createComponent(Element, {
|
|
27
|
-
ref(r$) {
|
|
28
|
-
var _ref$ = ref;
|
|
29
|
-
typeof _ref$ === "function" ? _ref$(r$) : ref = r$;
|
|
30
|
-
},
|
|
31
27
|
"class": "flex items-center relative",
|
|
32
28
|
get style() {
|
|
33
29
|
return {
|
|
@@ -37,60 +33,16 @@ const Circle = _props => {
|
|
|
37
33
|
};
|
|
38
34
|
},
|
|
39
35
|
get children() {
|
|
40
|
-
return [(()
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
_el$2.style.setProperty("stroke-dashoffset", "0");
|
|
46
|
-
_el$2.style.setProperty("transform", "rotate(-90deg)");
|
|
47
|
-
_el$2.style.setProperty("transform-origin", "50px 50px");
|
|
48
|
-
_el$2.style.setProperty("transition", "stroke-dashoffset 0.3s ease 0s, stroke-dasharray 0.3s ease 0s, stroke 0.3s ease 0s, stroke-width 0.06s ease 0.3s, opacity 0.3s ease 0s");
|
|
49
|
-
_el$2.style.setProperty("fill-opacity", "0");
|
|
50
|
-
_el$3.style.setProperty("transform", "rotate(-90deg)");
|
|
51
|
-
_el$3.style.setProperty("transform-origin", "50px 50px");
|
|
52
|
-
_el$3.style.setProperty("transition", "stroke-dashoffset 0.3s ease 0s, stroke-dasharray 0.3s ease 0s, stroke 0.3s ease 0s, stroke-width 0.06s ease 0.3s, opacity ease 0s");
|
|
53
|
-
_el$3.style.setProperty("fill-opacity", "0");
|
|
54
|
-
effect(_p$ => {
|
|
55
|
-
var _v$ = radius(),
|
|
56
|
-
_v$2 = props.strokeWidth,
|
|
57
|
-
_v$3 = `${perimeter()}px, ${perimeter()}px`,
|
|
58
|
-
_v$4 = radius(),
|
|
59
|
-
_v$5 = props.strokeWidth,
|
|
60
|
-
_v$6 = {
|
|
61
|
-
normal: 'var(--ant-color-primary)',
|
|
62
|
-
success: 'var(--ant-color-success)',
|
|
63
|
-
error: 'var(--ant-color-error)'
|
|
64
|
-
}[status()],
|
|
65
|
-
_v$7 = `${perimeter()}px, ${perimeter()}px`,
|
|
66
|
-
_v$8 = `${perimeter() * (100 - props.percent) / 100}px`;
|
|
67
|
-
_v$ !== _p$.e && setAttribute(_el$2, "r", _p$.e = _v$);
|
|
68
|
-
_v$2 !== _p$.t && setAttribute(_el$2, "stroke-width", _p$.t = _v$2);
|
|
69
|
-
_v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$2.style.setProperty("stroke-dasharray", _v$3) : _el$2.style.removeProperty("stroke-dasharray"));
|
|
70
|
-
_v$4 !== _p$.o && setAttribute(_el$3, "r", _p$.o = _v$4);
|
|
71
|
-
_v$5 !== _p$.i && setAttribute(_el$3, "stroke-width", _p$.i = _v$5);
|
|
72
|
-
_v$6 !== _p$.n && ((_p$.n = _v$6) != null ? _el$3.style.setProperty("stroke", _v$6) : _el$3.style.removeProperty("stroke"));
|
|
73
|
-
_v$7 !== _p$.s && ((_p$.s = _v$7) != null ? _el$3.style.setProperty("stroke-dasharray", _v$7) : _el$3.style.removeProperty("stroke-dasharray"));
|
|
74
|
-
_v$8 !== _p$.h && ((_p$.h = _v$8) != null ? _el$3.style.setProperty("stroke-dashoffset", _v$8) : _el$3.style.removeProperty("stroke-dashoffset"));
|
|
75
|
-
return _p$;
|
|
76
|
-
}, {
|
|
77
|
-
e: undefined,
|
|
78
|
-
t: undefined,
|
|
79
|
-
a: undefined,
|
|
80
|
-
o: undefined,
|
|
81
|
-
i: undefined,
|
|
82
|
-
n: undefined,
|
|
83
|
-
s: undefined,
|
|
84
|
-
h: undefined
|
|
85
|
-
});
|
|
86
|
-
return _el$;
|
|
87
|
-
})(), createComponent(Show, {
|
|
36
|
+
return [ssr(_tmpl$, ssrHydrationKey(), ssrAttribute("r", escape(radius(), true), false), ssrAttribute("stroke-width", escape(props.strokeWidth, true), false), "stroke:" + "var(--ant-progress-remaining-color)" + (";stroke-dasharray:" + `${escape(perimeter(), true)}px, ${escape(perimeter(), true)}px`) + (";stroke-dashoffset:" + "0") + (";transform:" + "rotate(-90deg)") + (";transform-origin:" + "50px 50px") + (";transition:" + "stroke-dashoffset 0.3s ease 0s, stroke-dasharray 0.3s ease 0s, stroke 0.3s ease 0s, stroke-width 0.06s ease 0.3s, opacity 0.3s ease 0s") + (";fill-opacity:" + "0"), ssrAttribute("r", escape(radius(), true), false), ssrAttribute("stroke-width", escape(props.strokeWidth, true), false), "stroke:" + escape({
|
|
37
|
+
normal: 'var(--ant-color-primary)',
|
|
38
|
+
success: 'var(--ant-color-success)',
|
|
39
|
+
error: 'var(--ant-color-error)'
|
|
40
|
+
}[status()], true) + (";stroke-dasharray:" + `${escape(perimeter(), true)}px, ${escape(perimeter(), true)}px`) + (";stroke-dashoffset:" + `${escape(perimeter(), true) * (100 - escape(props.percent, true)) / 100}px`) + (";transform:" + "rotate(-90deg)") + (";transform-origin:" + "50px 50px") + (";transition:" + "stroke-dashoffset 0.3s ease 0s, stroke-dasharray 0.3s ease 0s, stroke 0.3s ease 0s, stroke-width 0.06s ease 0.3s, opacity ease 0s") + (";fill-opacity:" + "0")), createComponent(Show, {
|
|
88
41
|
get when() {
|
|
89
42
|
return props.showInfo;
|
|
90
43
|
},
|
|
91
44
|
get children() {
|
|
92
|
-
|
|
93
|
-
insert(_el$4, createComponent(Switch, {
|
|
45
|
+
return ssr(_tmpl$4, ssrHydrationKey(), escape(createComponent(Switch, {
|
|
94
46
|
get fallback() {
|
|
95
47
|
return `${props.percent}%`;
|
|
96
48
|
},
|
|
@@ -100,19 +52,18 @@ const Circle = _props => {
|
|
|
100
52
|
return status() === 'success';
|
|
101
53
|
},
|
|
102
54
|
get children() {
|
|
103
|
-
return _tmpl$2();
|
|
55
|
+
return ssr(_tmpl$2, ssrHydrationKey());
|
|
104
56
|
}
|
|
105
57
|
}), createComponent(Match, {
|
|
106
58
|
get when() {
|
|
107
59
|
return status() === 'error';
|
|
108
60
|
},
|
|
109
61
|
get children() {
|
|
110
|
-
return _tmpl$3();
|
|
62
|
+
return ssr(_tmpl$3, ssrHydrationKey());
|
|
111
63
|
}
|
|
112
64
|
})];
|
|
113
65
|
}
|
|
114
|
-
}));
|
|
115
|
-
return _el$4;
|
|
66
|
+
})));
|
|
116
67
|
}
|
|
117
68
|
})];
|
|
118
69
|
}
|
package/es/Progress/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { createComponent,
|
|
1
|
+
import { createComponent, ssr, ssrHydrationKey, ssrAttribute, escape } from 'solid-js/web';
|
|
2
2
|
import { mergeProps, createMemo, Show, Switch, Match } from 'solid-js';
|
|
3
3
|
import cs from 'classnames';
|
|
4
4
|
import Circle from './Circle.js';
|
|
5
5
|
import Element from '../Element/index.js';
|
|
6
6
|
|
|
7
|
-
var _tmpl$ =
|
|
8
|
-
_tmpl$2 =
|
|
9
|
-
_tmpl$3 =
|
|
10
|
-
_tmpl$4 =
|
|
7
|
+
var _tmpl$ = ["<div", " style=\"", "\"></div>"],
|
|
8
|
+
_tmpl$2 = ["<span", " class=\"i-ant-design:check-circle-filled text-[var(--ant-color-success)]\"></span>"],
|
|
9
|
+
_tmpl$3 = ["<span", " class=\"i-ant-design:close-circle-filled text-[var(--ant-color-error)]\"></span>"],
|
|
10
|
+
_tmpl$4 = ["<span", " class=\"shrink-0 ml-8px text-center\">", "</span>"];
|
|
11
11
|
const Progress = _props => {
|
|
12
12
|
const props = mergeProps({
|
|
13
13
|
percent: 0,
|
|
@@ -21,39 +21,16 @@ const Progress = _props => {
|
|
|
21
21
|
return createComponent(Element, {
|
|
22
22
|
"class": "flex items-center",
|
|
23
23
|
get children() {
|
|
24
|
-
return [(()
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
_v$3 = `${props.height / 2}px`,
|
|
30
|
-
_v$4 = `${props.percent}%`,
|
|
31
|
-
_v$5 = {
|
|
32
|
-
normal: 'var(--ant-color-primary)',
|
|
33
|
-
success: 'var(--ant-color-success)',
|
|
34
|
-
error: 'var(--ant-color-error)'
|
|
35
|
-
}[status()];
|
|
36
|
-
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
37
|
-
_v$2 !== _p$.t && ((_p$.t = _v$2) != null ? _el$.style.setProperty("height", _v$2) : _el$.style.removeProperty("height"));
|
|
38
|
-
_v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$.style.setProperty("border-radius", _v$3) : _el$.style.removeProperty("border-radius"));
|
|
39
|
-
_v$4 !== _p$.o && ((_p$.o = _v$4) != null ? _el$.style.setProperty("--percent", _v$4) : _el$.style.removeProperty("--percent"));
|
|
40
|
-
_v$5 !== _p$.i && ((_p$.i = _v$5) != null ? _el$.style.setProperty("--color", _v$5) : _el$.style.removeProperty("--color"));
|
|
41
|
-
return _p$;
|
|
42
|
-
}, {
|
|
43
|
-
e: undefined,
|
|
44
|
-
t: undefined,
|
|
45
|
-
a: undefined,
|
|
46
|
-
o: undefined,
|
|
47
|
-
i: undefined
|
|
48
|
-
});
|
|
49
|
-
return _el$;
|
|
50
|
-
})(), createComponent(Show, {
|
|
24
|
+
return [ssr(_tmpl$, ssrHydrationKey() + ssrAttribute("class", escape(cs('w-full bg-[var(--ant-progress-remaining-color)]', 'before:content-empty before:block before:bg-[var(--color)] before:w-[var(--percent)] before:h-full before:rounded-inherit'), true), false), "height:" + `${escape(props.height, true)}px` + (";border-radius:" + `${escape(props.height, true) / 2}px`) + (";--percent:" + `${escape(props.percent, true)}%`) + (";--color:" + escape({
|
|
25
|
+
normal: 'var(--ant-color-primary)',
|
|
26
|
+
success: 'var(--ant-color-success)',
|
|
27
|
+
error: 'var(--ant-color-error)'
|
|
28
|
+
}[status()], true))), createComponent(Show, {
|
|
51
29
|
get when() {
|
|
52
30
|
return props.showInfo;
|
|
53
31
|
},
|
|
54
32
|
get children() {
|
|
55
|
-
|
|
56
|
-
insert(_el$2, createComponent(Switch, {
|
|
33
|
+
return ssr(_tmpl$4, ssrHydrationKey(), escape(createComponent(Switch, {
|
|
57
34
|
get fallback() {
|
|
58
35
|
return `${props.percent}%`;
|
|
59
36
|
},
|
|
@@ -63,19 +40,18 @@ const Progress = _props => {
|
|
|
63
40
|
return status() === 'success';
|
|
64
41
|
},
|
|
65
42
|
get children() {
|
|
66
|
-
return _tmpl$2();
|
|
43
|
+
return ssr(_tmpl$2, ssrHydrationKey());
|
|
67
44
|
}
|
|
68
45
|
}), createComponent(Match, {
|
|
69
46
|
get when() {
|
|
70
47
|
return status() === 'error';
|
|
71
48
|
},
|
|
72
49
|
get children() {
|
|
73
|
-
return _tmpl$3();
|
|
50
|
+
return ssr(_tmpl$3, ssrHydrationKey());
|
|
74
51
|
}
|
|
75
52
|
})];
|
|
76
53
|
}
|
|
77
|
-
}));
|
|
78
|
-
return _el$2;
|
|
54
|
+
})));
|
|
79
55
|
}
|
|
80
56
|
})];
|
|
81
57
|
}
|
package/es/Radio/Button.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createComponent, ssr, ssrHydrationKey, ssrAttribute, escape } from 'solid-js/web';
|
|
2
2
|
import cs from 'classnames';
|
|
3
3
|
import createControllableValue from '../hooks/createControllableValue.js';
|
|
4
4
|
import { wave } from '../utils/animation.js';
|
|
5
5
|
import Element from '../Element/index.js';
|
|
6
6
|
|
|
7
|
-
var _tmpl$ =
|
|
8
|
-
_tmpl$2 =
|
|
7
|
+
var _tmpl$ = ["<input", " class=\"hidden\"", " type=\"radio\"", ">"],
|
|
8
|
+
_tmpl$2 = ["<span", ">", "</span>"];
|
|
9
9
|
const Button = props => {
|
|
10
10
|
let input;
|
|
11
11
|
const [checked, setChecked] = createControllableValue(props, {
|
|
@@ -48,25 +48,9 @@ const Button = props => {
|
|
|
48
48
|
};
|
|
49
49
|
},
|
|
50
50
|
get children() {
|
|
51
|
-
return [(()
|
|
52
|
-
var _el$ = _tmpl$();
|
|
53
|
-
_el$.$$input = e => {
|
|
54
|
-
setChecked(e.target.checked);
|
|
55
|
-
props.onChange?.(e);
|
|
56
|
-
};
|
|
57
|
-
var _ref$ = input;
|
|
58
|
-
typeof _ref$ === "function" ? use(_ref$, _el$) : input = _el$;
|
|
59
|
-
effect(() => _el$.disabled = props.disabled);
|
|
60
|
-
effect(() => _el$.checked = checked());
|
|
61
|
-
return _el$;
|
|
62
|
-
})(), (() => {
|
|
63
|
-
var _el$2 = _tmpl$2();
|
|
64
|
-
insert(_el$2, () => props.children);
|
|
65
|
-
return _el$2;
|
|
66
|
-
})()];
|
|
51
|
+
return [ssr(_tmpl$, ssrHydrationKey(), ssrAttribute("checked", checked(), true), ssrAttribute("disabled", props.disabled, true)), ssr(_tmpl$2, ssrHydrationKey(), escape(props.children))];
|
|
67
52
|
}
|
|
68
53
|
});
|
|
69
54
|
};
|
|
70
|
-
delegateEvents(["input"]);
|
|
71
55
|
|
|
72
56
|
export { Button as default };
|
package/es/Radio/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createComponent, ssr, ssrHydrationKey, ssrAttribute, escape } from 'solid-js/web';
|
|
2
2
|
import { Show } from 'solid-js';
|
|
3
3
|
import cs from 'classnames';
|
|
4
4
|
import createControllableValue from '../hooks/createControllableValue.js';
|
|
5
5
|
import Button from './Button.js';
|
|
6
6
|
import Group from './Group.js';
|
|
7
|
-
import { wave } from '../utils/animation.js';
|
|
8
7
|
import Element from '../Element/index.js';
|
|
9
8
|
|
|
10
|
-
var _tmpl$ =
|
|
11
|
-
_tmpl$2 =
|
|
9
|
+
var _tmpl$ = ["<span", "><input class=\"m-0 hidden\"", " type=\"radio\"", "><span", "></span></span>"],
|
|
10
|
+
_tmpl$2 = ["<span", " class=\"px-8px\">", "</span>"];
|
|
12
11
|
const Radio = props => {
|
|
13
12
|
const [checked, setChecked] = createControllableValue(props, {
|
|
14
13
|
defaultValue: false,
|
|
@@ -22,40 +21,12 @@ const Radio = props => {
|
|
|
22
21
|
return cs('inline-flex cursor-pointer inline-flex items-center', props.disabled && 'text-[var(--ant-color-text-disabled)] cursor-not-allowed');
|
|
23
22
|
},
|
|
24
23
|
get children() {
|
|
25
|
-
return [(()
|
|
26
|
-
var _el$ = _tmpl$(),
|
|
27
|
-
_el$2 = _el$.firstChild,
|
|
28
|
-
_el$3 = _el$2.nextSibling;
|
|
29
|
-
_el$.$$click = e => {
|
|
30
|
-
wave(e.currentTarget, 'var(--ant-color-primary)');
|
|
31
|
-
};
|
|
32
|
-
_el$2.$$input = e => {
|
|
33
|
-
setChecked(e.target.checked);
|
|
34
|
-
props.onChange?.(e);
|
|
35
|
-
};
|
|
36
|
-
effect(_p$ => {
|
|
37
|
-
var _v$ = cs('relative w-16px h-16px rounded-50%'),
|
|
38
|
-
_v$2 = props.disabled,
|
|
39
|
-
_v$3 = cs('absolute inset-0 rounded-inherit [border:1px_solid_var(--ant-color-border)] bg-[var(--ant-color-bg-container)]', checked() && (props.disabled ? 'flex justify-center items-center before:content-empty before:block before:w-8px before:h-8px before:bg-[var(--ant-radio-dot-color-disabled)] before:rounded-50%' : '[border:5px_solid_var(--ant-color-primary)]'), props.disabled && 'bg-[var(--ant-color-bg-container-disabled)]');
|
|
40
|
-
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
41
|
-
_v$2 !== _p$.t && (_el$2.disabled = _p$.t = _v$2);
|
|
42
|
-
_v$3 !== _p$.a && className(_el$3, _p$.a = _v$3);
|
|
43
|
-
return _p$;
|
|
44
|
-
}, {
|
|
45
|
-
e: undefined,
|
|
46
|
-
t: undefined,
|
|
47
|
-
a: undefined
|
|
48
|
-
});
|
|
49
|
-
effect(() => _el$2.checked = checked());
|
|
50
|
-
return _el$;
|
|
51
|
-
})(), createComponent(Show, {
|
|
24
|
+
return [ssr(_tmpl$, ssrHydrationKey() + ssrAttribute("class", escape(cs('relative w-16px h-16px rounded-50%'), true), false), ssrAttribute("checked", checked(), true), ssrAttribute("disabled", props.disabled, true), ssrAttribute("class", escape(cs('absolute inset-0 rounded-inherit [border:1px_solid_var(--ant-color-border)] bg-[var(--ant-color-bg-container)]', checked() && (props.disabled ? 'flex justify-center items-center before:content-empty before:block before:w-8px before:h-8px before:bg-[var(--ant-radio-dot-color-disabled)] before:rounded-50%' : '[border:5px_solid_var(--ant-color-primary)]'), props.disabled && 'bg-[var(--ant-color-bg-container-disabled)]'), true), false)), createComponent(Show, {
|
|
52
25
|
get when() {
|
|
53
26
|
return props.children;
|
|
54
27
|
},
|
|
55
28
|
get children() {
|
|
56
|
-
|
|
57
|
-
insert(_el$4, () => props.children);
|
|
58
|
-
return _el$4;
|
|
29
|
+
return ssr(_tmpl$2, ssrHydrationKey(), escape(props.children));
|
|
59
30
|
}
|
|
60
31
|
})];
|
|
61
32
|
}
|
|
@@ -63,6 +34,5 @@ const Radio = props => {
|
|
|
63
34
|
};
|
|
64
35
|
Radio.Button = Button;
|
|
65
36
|
Radio.Group = Group;
|
|
66
|
-
delegateEvents(["click", "input"]);
|
|
67
37
|
|
|
68
38
|
export { Radio as default };
|
package/es/RangeInput/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createComponent, ssr, ssrHydrationKey, escape, ssrAttribute, ssrStyle } from 'solid-js/web';
|
|
2
2
|
import { useContext, createSignal, createEffect, on, createMemo, Show } from 'solid-js';
|
|
3
3
|
import cs from 'classnames';
|
|
4
4
|
import { compact, isNil } from 'lodash-es';
|
|
@@ -8,11 +8,11 @@ import useClickAway from '../hooks/useClickAway.js';
|
|
|
8
8
|
import Element from '../Element/index.js';
|
|
9
9
|
import CompactContext from '../Compact/context.js';
|
|
10
10
|
|
|
11
|
-
var _tmpl$ =
|
|
12
|
-
_tmpl$2 =
|
|
13
|
-
_tmpl$3 =
|
|
14
|
-
_tmpl$4 =
|
|
15
|
-
_tmpl$5 =
|
|
11
|
+
var _tmpl$ = ["<span", " class=\"i-ant-design:close-circle-filled cursor-pointer text-[var(--ant-color-text-quaternary)] hover:text-[var(--ant-color-text-tertiary)] active:text-[var(--ant-color-text)]\"></span>"],
|
|
12
|
+
_tmpl$2 = ["<div", " tabindex=\"0\"><div class=\"truncate\">", "</div><span class=\"i-ant-design:swap-right-outlined w-32px\"></span><div class=\"truncate\">", "</div><div aria-label=\"active-bar\" class=\"h-1px bg-[var(--ant-color-primary)] absolute bottom-0 transition-left\" style=\"", "\"></div><div class=\"absolute top-0 bottom-0 right-11px flex items-center\">", "</div></div>"],
|
|
13
|
+
_tmpl$3 = ["<div", " class=\"w-200px max-h-400px overflow-auto\" style=\"", "\">", "</div>"],
|
|
14
|
+
_tmpl$4 = ["<input", " class=\"h-30px [outline:none] bg-inherit placeholder-text-[var(--ant-color-text-placeholder)]\"", " readonly>"],
|
|
15
|
+
_tmpl$5 = ["<span", " class=\"i-ant-design:down-outlined text-[var(--ant-color-text-quaternary)]\"></span>"];
|
|
16
16
|
const statusClassDict = {
|
|
17
17
|
default: (disabled, focus) => cs('[border:1px_solid_var(--ant-color-border)]', !disabled && 'hover:border-[var(--ant-color-primary)] focus-within:border-[var(--ant-color-primary)] focus-within:[box-shadow:0_0_0_2px_var(--ant-control-outline)]', focus && 'border-[var(--ant-color-primary)] [box-shadow:0_0_0_2px_var(--ant-control-outline)]'),
|
|
18
18
|
error: (disabled, focus) => cs('[border:1px_solid_var(--ant-color-error)]', !disabled && 'hover:border-[var(--ant-color-error-border-hover)] focus-within:[box-shadow:0_0_0_2px_rgba(255,38,5,.06)]', focus && '[box-shadow:0_0_0_2px_rgba(255,38,5,.06)]'),
|
|
@@ -105,104 +105,50 @@ function RangeInput(props) {
|
|
|
105
105
|
contentStyle: {
|
|
106
106
|
padding: 0
|
|
107
107
|
},
|
|
108
|
-
content: () => (()
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
currentFocusType,
|
|
114
|
-
tempValue,
|
|
115
|
-
setSingleValue
|
|
116
|
-
}));
|
|
117
|
-
effect(() => `${width()}px` != null ? _el$8.style.setProperty("width", `${width()}px`) : _el$8.style.removeProperty("width"));
|
|
118
|
-
return _el$8;
|
|
119
|
-
})(),
|
|
108
|
+
content: () => ssr(_tmpl$3, ssrHydrationKey(), "width:" + `${escape(width(), true)}px`, escape(props.content({
|
|
109
|
+
currentFocusType,
|
|
110
|
+
tempValue,
|
|
111
|
+
setSingleValue
|
|
112
|
+
}))),
|
|
120
113
|
get children() {
|
|
121
|
-
|
|
122
|
-
_el$2 = _el$.firstChild,
|
|
123
|
-
_el$3 = _el$2.nextSibling,
|
|
124
|
-
_el$4 = _el$3.nextSibling,
|
|
125
|
-
_el$5 = _el$4.nextSibling,
|
|
126
|
-
_el$6 = _el$5.nextSibling;
|
|
127
|
-
_el$.addEventListener("mouseleave", () => setHover(false));
|
|
128
|
-
_el$.addEventListener("mouseenter", () => setHover(true));
|
|
129
|
-
_el$.$$click = e => {
|
|
130
|
-
setOpen(true);
|
|
131
|
-
setWidth(e.currentTarget.offsetWidth);
|
|
132
|
-
setCurrentFocusType(e.target !== endDom ? 'start' : 'end');
|
|
133
|
-
};
|
|
134
|
-
var _ref$ = container;
|
|
135
|
-
typeof _ref$ === "function" ? use(_ref$, _el$) : container = _el$;
|
|
136
|
-
var _ref$2 = startDom;
|
|
137
|
-
typeof _ref$2 === "function" ? use(_ref$2, _el$2) : startDom = _el$2;
|
|
138
|
-
insert(_el$2, createComponent(Show, {
|
|
114
|
+
return ssr(_tmpl$2, ssrHydrationKey() + ssrAttribute("class", escape(cs('relative min-h-32px pr-25px rounded-inherit grid [grid-template-columns:1fr_auto_1fr] items-center', tempValue().length && props.multiple ? 'pl-4px' : 'pl-11px', props.multiple && 'py-1px', props.disabled && '[pointer-events:none] bg-[var(--ant-color-bg-container-disabled)] color-[var(--ant-color-text-disabled)]', statusClassDict[props.status ?? 'default'](!!props.disabled, open())), true), false), escape(createComponent(Show, {
|
|
139
115
|
get when() {
|
|
140
116
|
return !isNil(tempValue()[0]);
|
|
141
117
|
},
|
|
142
118
|
get fallback() {
|
|
143
|
-
return (()
|
|
144
|
-
var _el$9 = _tmpl$4();
|
|
145
|
-
effect(() => setAttribute(_el$9, "placeholder", props.placeholder?.[0]));
|
|
146
|
-
return _el$9;
|
|
147
|
-
})();
|
|
119
|
+
return ssr(_tmpl$4, ssrHydrationKey(), ssrAttribute("placeholder", escape(props.placeholder?.[0], true), false));
|
|
148
120
|
},
|
|
149
121
|
get children() {
|
|
150
122
|
return optionLabelRender(tempValue()[0]);
|
|
151
123
|
}
|
|
152
|
-
}))
|
|
153
|
-
var _ref$3 = endDom;
|
|
154
|
-
typeof _ref$3 === "function" ? use(_ref$3, _el$4) : endDom = _el$4;
|
|
155
|
-
insert(_el$4, createComponent(Show, {
|
|
124
|
+
})), escape(createComponent(Show, {
|
|
156
125
|
get when() {
|
|
157
126
|
return !isNil(tempValue()[1]);
|
|
158
127
|
},
|
|
159
128
|
get fallback() {
|
|
160
|
-
return (()
|
|
161
|
-
var _el$10 = _tmpl$4();
|
|
162
|
-
effect(() => setAttribute(_el$10, "placeholder", props.placeholder?.[1]));
|
|
163
|
-
return _el$10;
|
|
164
|
-
})();
|
|
129
|
+
return ssr(_tmpl$4, ssrHydrationKey(), ssrAttribute("placeholder", escape(props.placeholder?.[1], true), false));
|
|
165
130
|
},
|
|
166
131
|
get children() {
|
|
167
132
|
return optionLabelRender(tempValue()[1]);
|
|
168
133
|
}
|
|
169
|
-
}))
|
|
170
|
-
|
|
134
|
+
})), ssrStyle({
|
|
135
|
+
display: open() ? 'block' : 'none',
|
|
136
|
+
...activeBarStyle()
|
|
137
|
+
}), escape(createComponent(Show, {
|
|
171
138
|
get when() {
|
|
172
139
|
return showClearBtn();
|
|
173
140
|
},
|
|
174
141
|
get fallback() {
|
|
175
|
-
return _tmpl$5();
|
|
142
|
+
return ssr(_tmpl$5, ssrHydrationKey());
|
|
176
143
|
},
|
|
177
144
|
get children() {
|
|
178
|
-
|
|
179
|
-
_el$7.$$click = e => {
|
|
180
|
-
e.stopPropagation();
|
|
181
|
-
setValue([]);
|
|
182
|
-
setOpen(false);
|
|
183
|
-
};
|
|
184
|
-
return _el$7;
|
|
145
|
+
return ssr(_tmpl$, ssrHydrationKey());
|
|
185
146
|
}
|
|
186
|
-
}));
|
|
187
|
-
effect(_p$ => {
|
|
188
|
-
var _v$ = cs('relative min-h-32px pr-25px rounded-inherit grid [grid-template-columns:1fr_auto_1fr] items-center', tempValue().length && props.multiple ? 'pl-4px' : 'pl-11px', props.multiple && 'py-1px', props.disabled && '[pointer-events:none] bg-[var(--ant-color-bg-container-disabled)] color-[var(--ant-color-text-disabled)]', statusClassDict[props.status ?? 'default'](!!props.disabled, open())),
|
|
189
|
-
_v$2 = {
|
|
190
|
-
display: open() ? 'block' : 'none',
|
|
191
|
-
...activeBarStyle()
|
|
192
|
-
};
|
|
193
|
-
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
194
|
-
_p$.t = style(_el$5, _v$2, _p$.t);
|
|
195
|
-
return _p$;
|
|
196
|
-
}, {
|
|
197
|
-
e: undefined,
|
|
198
|
-
t: undefined
|
|
199
|
-
});
|
|
200
|
-
return _el$;
|
|
147
|
+
})));
|
|
201
148
|
}
|
|
202
149
|
});
|
|
203
150
|
}
|
|
204
151
|
});
|
|
205
152
|
}
|
|
206
|
-
delegateEvents(["click"]);
|
|
207
153
|
|
|
208
154
|
export { RangeInput as default };
|
package/es/Result/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { createComponent,
|
|
1
|
+
import { createComponent, ssr, ssrHydrationKey, ssrAttribute, escape } from 'solid-js/web';
|
|
2
2
|
import { mergeProps } from 'solid-js';
|
|
3
3
|
import cs from 'classnames';
|
|
4
4
|
import Element from '../Element/index.js';
|
|
5
5
|
|
|
6
|
-
var _tmpl$ =
|
|
7
|
-
_tmpl$2 =
|
|
8
|
-
_tmpl$3 =
|
|
9
|
-
_tmpl$4 =
|
|
6
|
+
var _tmpl$ = ["<div", " class=\"mb-24px\"><span", "></span></div>"],
|
|
7
|
+
_tmpl$2 = ["<div", " class=\"my-8px text-[--ant-color-text-heading] text-24px\">", "</div>"],
|
|
8
|
+
_tmpl$3 = ["<div", " class=\"text-[--ant-color-text-description] text-14px\">", "</div>"],
|
|
9
|
+
_tmpl$4 = ["<div", " class=\"mt-24px\">", "</div>"];
|
|
10
10
|
const statusIconMap = {
|
|
11
11
|
success: '!text-[--ant-color-success] i-ant-design:check-circle-filled',
|
|
12
12
|
info: '!text-[--ant-color-primary] i-ant-design:exclamation-circle-filled',
|
|
@@ -20,28 +20,7 @@ const Result = _props => {
|
|
|
20
20
|
return createComponent(Element, {
|
|
21
21
|
"class": "text-center px-32px py-48px [font-size:var(--ant-font-size)] text-[--ant-color-text] leading-[--ant-line-height]",
|
|
22
22
|
get children() {
|
|
23
|
-
return [(()
|
|
24
|
-
var _el$ = _tmpl$(),
|
|
25
|
-
_el$2 = _el$.firstChild;
|
|
26
|
-
effect(() => className(_el$2, cs(statusIconMap[props.status], 'text-72px')));
|
|
27
|
-
return _el$;
|
|
28
|
-
})(), (() => {
|
|
29
|
-
var _el$3 = _tmpl$2();
|
|
30
|
-
insert(_el$3, () => props.title);
|
|
31
|
-
return _el$3;
|
|
32
|
-
})(), (() => {
|
|
33
|
-
var _el$4 = _tmpl$3();
|
|
34
|
-
insert(_el$4, () => props.subTitle);
|
|
35
|
-
return _el$4;
|
|
36
|
-
})(), (() => {
|
|
37
|
-
var _el$5 = _tmpl$4();
|
|
38
|
-
insert(_el$5, () => props.extra);
|
|
39
|
-
return _el$5;
|
|
40
|
-
})(), (() => {
|
|
41
|
-
var _el$6 = _tmpl$4();
|
|
42
|
-
insert(_el$6, () => props.children);
|
|
43
|
-
return _el$6;
|
|
44
|
-
})()];
|
|
23
|
+
return [ssr(_tmpl$, ssrHydrationKey(), ssrAttribute("class", escape(cs(statusIconMap[props.status], 'text-72px'), true), false)), ssr(_tmpl$2, ssrHydrationKey(), escape(props.title)), ssr(_tmpl$3, ssrHydrationKey(), escape(props.subTitle)), ssr(_tmpl$4, ssrHydrationKey(), escape(props.extra)), ssr(_tmpl$4, ssrHydrationKey(), escape(props.children))];
|
|
45
24
|
}
|
|
46
25
|
});
|
|
47
26
|
};
|
package/es/Segmented/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createComponent, ssr, ssrHydrationKey, ssrAttribute, escape } from 'solid-js/web';
|
|
2
2
|
import { createSelector, For, Show } from 'solid-js';
|
|
3
3
|
import cs from 'classnames';
|
|
4
4
|
import createControllableValue from '../hooks/createControllableValue.js';
|
|
@@ -6,7 +6,7 @@ import { unwrapStringOrJSXElement } from '../utils/solid.js';
|
|
|
6
6
|
import Element from '../Element/index.js';
|
|
7
7
|
import useComponentSize from '../hooks/useComponentSize.js';
|
|
8
8
|
|
|
9
|
-
var _tmpl$ =
|
|
9
|
+
var _tmpl$ = ["<div", "><div", ">", "</div></div>"];
|
|
10
10
|
const unWarpValue = value => typeof value === 'object' ? value.value : value;
|
|
11
11
|
const Segmented = props => {
|
|
12
12
|
const [value, setValue] = createControllableValue(props, {
|
|
@@ -34,40 +34,20 @@ const Segmented = props => {
|
|
|
34
34
|
get each() {
|
|
35
35
|
return props.options;
|
|
36
36
|
},
|
|
37
|
-
children: item => (()
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
children: item
|
|
50
|
-
}));
|
|
51
|
-
effect(_p$ => {
|
|
52
|
-
var _v$ = cs(props.block && 'basis-0 grow-1', isDisabledValue(item) && 'cursor-not-allowed'),
|
|
53
|
-
_v$2 = cs('rounded-[var(--ant-border-radius-sm)] px-[var(--ant-padding-sm)] cursor-pointer [white-space:nowrap]', isSelected(unWarpValue(item)) && 'bg-[var(--ant-segmented-item-selected-bg)]', isDisabledValue(item) ? '[pointer-events:none] text-[var(--ant-color-text-disabled)]' : isSelected(unWarpValue(item)) ? 'shadow-[var(--ant-box-shadow-tertiary)] text-[var(--ant-segmented-item-selected-color)]' : 'text-[var(--ant-segmented-item-color)] hover:text-[var(--ant-segmented-item-hover-color)] hover:bg-[var(--ant-segmented-item-hover-bg)] active:bg-[var(--ant-segmented-item-active-bg)]', props.block && 'flex justify-center', {
|
|
54
|
-
small: 'leading-20px',
|
|
55
|
-
middle: 'leading-28px',
|
|
56
|
-
large: 'leading-36px'
|
|
57
|
-
}[size()]);
|
|
58
|
-
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
59
|
-
_v$2 !== _p$.t && className(_el$2, _p$.t = _v$2);
|
|
60
|
-
return _p$;
|
|
61
|
-
}, {
|
|
62
|
-
e: undefined,
|
|
63
|
-
t: undefined
|
|
64
|
-
});
|
|
65
|
-
return _el$;
|
|
66
|
-
})()
|
|
37
|
+
children: item => ssr(_tmpl$, ssrHydrationKey() + ssrAttribute("class", escape(cs(props.block && 'basis-0 grow-1', isDisabledValue(item) && 'cursor-not-allowed'), true), false), ssrAttribute("class", escape(cs('rounded-[var(--ant-border-radius-sm)] px-[var(--ant-padding-sm)] cursor-pointer [white-space:nowrap]', isSelected(unWarpValue(item)) && 'bg-[var(--ant-segmented-item-selected-bg)]', isDisabledValue(item) ? '[pointer-events:none] text-[var(--ant-color-text-disabled)]' : isSelected(unWarpValue(item)) ? 'shadow-[var(--ant-box-shadow-tertiary)] text-[var(--ant-segmented-item-selected-color)]' : 'text-[var(--ant-segmented-item-color)] hover:text-[var(--ant-segmented-item-hover-color)] hover:bg-[var(--ant-segmented-item-hover-bg)] active:bg-[var(--ant-segmented-item-active-bg)]', props.block && 'flex justify-center', {
|
|
38
|
+
small: 'leading-20px',
|
|
39
|
+
middle: 'leading-28px',
|
|
40
|
+
large: 'leading-36px'
|
|
41
|
+
}[size()]), true), false), escape(createComponent(Show, {
|
|
42
|
+
when: typeof item !== 'object',
|
|
43
|
+
get fallback() {
|
|
44
|
+
return typeof item === 'object' && unwrapStringOrJSXElement(item.label);
|
|
45
|
+
},
|
|
46
|
+
children: item
|
|
47
|
+
})))
|
|
67
48
|
});
|
|
68
49
|
}
|
|
69
50
|
});
|
|
70
51
|
};
|
|
71
|
-
delegateEvents(["click"]);
|
|
72
52
|
|
|
73
53
|
export { Segmented as default };
|