antd-solid 0.0.20 → 0.0.22
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 +2508 -1078
- package/dist/index.umd.js +1 -1
- package/es/Button/index.js +25 -7
- package/es/Checkbox/Group.js +2 -2
- package/es/Checkbox/index.js +26 -13
- package/es/CodeInput/index.js +3 -0
- package/es/Collapse/Item.js +50 -8
- package/es/Collapse/index.js +5 -3
- package/es/ColorPicker/ColorPickerInput.js +224 -210
- package/es/ColorPicker/ColorPickerSelect.js +61 -4
- package/es/ColorPicker/ColorPickerSlider.js +100 -67
- package/es/ColorPicker/index.js +62 -16
- package/es/ContextMenu/index.js +5 -1
- package/es/Cursor/index.js +15 -3
- package/es/Divider/index.js +12 -3
- package/es/Drawer/index.js +83 -42
- package/es/Element/index.js +2 -6
- package/es/Empty/PRESENTED_IMAGE_SIMPLE.js +12 -4
- package/es/Empty/assets/EmptySvg.js +3 -3
- package/es/Empty/assets/SimpleEmptySvg.js +3 -3
- package/es/Empty/index.js +12 -4
- package/es/Form/FormItem.js +76 -47
- package/es/Fragment/index.js +3 -1
- package/es/Image/index.js +31 -11
- package/es/Input/TextArea.js +31 -5
- package/es/Input/index.js +103 -46
- package/es/InputNumber/index.js +11 -4
- package/es/Menu/InternalMenu.js +93 -37
- package/es/Message/Message.js +11 -7
- package/es/Modal/index.js +107 -55
- package/es/Modal/useModal.js +14 -5
- package/es/Modal/warning.js +14 -5
- package/es/Popconfirm/index.js +36 -24
- package/es/Popover/index.js +20 -11
- package/es/Progress/Circle.js +63 -14
- package/es/Progress/index.js +38 -14
- package/es/Radio/Button.js +20 -4
- package/es/Radio/index.js +35 -5
- package/es/RangeInput/index.js +76 -22
- package/es/Result/index.js +27 -6
- package/es/Segmented/index.js +33 -13
- package/es/Select/index.js +35 -6
- package/es/SelectInput/index.js +112 -48
- package/es/Slider/index.js +84 -11
- package/es/Space/index.js +2 -2
- package/es/Spin/index.js +26 -14
- package/es/Switch/index.js +6 -4
- package/es/Table/index.js +40 -18
- package/es/Tabs/index.js +195 -91
- package/es/Timeline/index.js +14 -4
- package/es/Tooltip/index.js +48 -20
- package/es/Transformer/index.js +123 -59
- package/es/Tree/SingleLevelTree.js +191 -30
- package/es/TreeFor/index.js +3 -3
- package/es/TreeSelect/index.js +6 -4
- package/es/Upload/index.js +38 -4
- package/es/assets/svg/ColorPickUp.js +19 -6
- package/es/assets/svg/Crosshair.js +45 -6
- package/es/assets/svg/Resize.js +19 -6
- package/es/assets/svg/Rotate.js +14 -13
- package/es/assets/svg/RotateArrow.js +15 -20
- package/es/hooks/useClickAway.js +4 -6
- package/package.json +2 -2
- package/es/utils/DOMRect.d.ts +0 -22
- package/es/utils/DOMRect.js +0 -41
package/es/Progress/Circle.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { createComponent,
|
|
1
|
+
import { createComponent, effect, setAttribute, insert, template } 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$ = /*#__PURE__*/template(`<svg viewBox="0 0 100 100"role=presentation><circle cx=50 cy=50 stroke-linecap=round></circle><circle cx=50 cy=50 stroke-linecap=round opacity=1>`),
|
|
8
|
+
_tmpl$2 = /*#__PURE__*/template(`<span class="i-ant-design:check-outlined text-[var(--ant-color-success)] text-1.1667em">`),
|
|
9
|
+
_tmpl$3 = /*#__PURE__*/template(`<span class="i-ant-design:close-outlined text-[var(--ant-color-error)] text-1.1667em">`),
|
|
10
|
+
_tmpl$4 = /*#__PURE__*/template(`<span class="shrink-0 text-center text-1em absolute top-1/2 left-1/2 -translate-1/2">`);
|
|
11
11
|
const Circle = _props => {
|
|
12
12
|
let ref;
|
|
13
13
|
const props = mergeProps({
|
|
@@ -24,6 +24,10 @@ 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
|
+
},
|
|
27
31
|
"class": "flex items-center relative",
|
|
28
32
|
get style() {
|
|
29
33
|
return {
|
|
@@ -33,16 +37,60 @@ const Circle = _props => {
|
|
|
33
37
|
};
|
|
34
38
|
},
|
|
35
39
|
get children() {
|
|
36
|
-
return [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
return [(() => {
|
|
41
|
+
var _el$ = _tmpl$(),
|
|
42
|
+
_el$2 = _el$.firstChild,
|
|
43
|
+
_el$3 = _el$2.nextSibling;
|
|
44
|
+
_el$2.style.setProperty("stroke", "var(--ant-progress-remaining-color)");
|
|
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, {
|
|
41
88
|
get when() {
|
|
42
89
|
return props.showInfo;
|
|
43
90
|
},
|
|
44
91
|
get children() {
|
|
45
|
-
|
|
92
|
+
var _el$4 = _tmpl$4();
|
|
93
|
+
insert(_el$4, createComponent(Switch, {
|
|
46
94
|
get fallback() {
|
|
47
95
|
return `${props.percent}%`;
|
|
48
96
|
},
|
|
@@ -52,18 +100,19 @@ const Circle = _props => {
|
|
|
52
100
|
return status() === 'success';
|
|
53
101
|
},
|
|
54
102
|
get children() {
|
|
55
|
-
return
|
|
103
|
+
return _tmpl$2();
|
|
56
104
|
}
|
|
57
105
|
}), createComponent(Match, {
|
|
58
106
|
get when() {
|
|
59
107
|
return status() === 'error';
|
|
60
108
|
},
|
|
61
109
|
get children() {
|
|
62
|
-
return
|
|
110
|
+
return _tmpl$3();
|
|
63
111
|
}
|
|
64
112
|
})];
|
|
65
113
|
}
|
|
66
|
-
}))
|
|
114
|
+
}));
|
|
115
|
+
return _el$4;
|
|
67
116
|
}
|
|
68
117
|
})];
|
|
69
118
|
}
|
package/es/Progress/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { createComponent,
|
|
1
|
+
import { createComponent, effect, className, insert, template } 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$ = /*#__PURE__*/template(`<div>`),
|
|
8
|
+
_tmpl$2 = /*#__PURE__*/template(`<span class="i-ant-design:check-circle-filled text-[var(--ant-color-success)]">`),
|
|
9
|
+
_tmpl$3 = /*#__PURE__*/template(`<span class="i-ant-design:close-circle-filled text-[var(--ant-color-error)]">`),
|
|
10
|
+
_tmpl$4 = /*#__PURE__*/template(`<span class="shrink-0 ml-8px text-center">`);
|
|
11
11
|
const Progress = _props => {
|
|
12
12
|
const props = mergeProps({
|
|
13
13
|
percent: 0,
|
|
@@ -21,16 +21,39 @@ const Progress = _props => {
|
|
|
21
21
|
return createComponent(Element, {
|
|
22
22
|
"class": "flex items-center",
|
|
23
23
|
get children() {
|
|
24
|
-
return [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
return [(() => {
|
|
25
|
+
var _el$ = _tmpl$();
|
|
26
|
+
effect(_p$ => {
|
|
27
|
+
var _v$ = 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'),
|
|
28
|
+
_v$2 = `${props.height}px`,
|
|
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, {
|
|
29
51
|
get when() {
|
|
30
52
|
return props.showInfo;
|
|
31
53
|
},
|
|
32
54
|
get children() {
|
|
33
|
-
|
|
55
|
+
var _el$2 = _tmpl$4();
|
|
56
|
+
insert(_el$2, createComponent(Switch, {
|
|
34
57
|
get fallback() {
|
|
35
58
|
return `${props.percent}%`;
|
|
36
59
|
},
|
|
@@ -40,18 +63,19 @@ const Progress = _props => {
|
|
|
40
63
|
return status() === 'success';
|
|
41
64
|
},
|
|
42
65
|
get children() {
|
|
43
|
-
return
|
|
66
|
+
return _tmpl$2();
|
|
44
67
|
}
|
|
45
68
|
}), createComponent(Match, {
|
|
46
69
|
get when() {
|
|
47
70
|
return status() === 'error';
|
|
48
71
|
},
|
|
49
72
|
get children() {
|
|
50
|
-
return
|
|
73
|
+
return _tmpl$3();
|
|
51
74
|
}
|
|
52
75
|
})];
|
|
53
76
|
}
|
|
54
|
-
}))
|
|
77
|
+
}));
|
|
78
|
+
return _el$2;
|
|
55
79
|
}
|
|
56
80
|
})];
|
|
57
81
|
}
|
package/es/Radio/Button.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { createComponent,
|
|
1
|
+
import { delegateEvents, createComponent, use, effect, insert, template } 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$ = /*#__PURE__*/template(`<input class=hidden type=radio>`),
|
|
8
|
+
_tmpl$2 = /*#__PURE__*/template(`<span>`);
|
|
9
9
|
const Button = props => {
|
|
10
10
|
let input;
|
|
11
11
|
const [checked, setChecked] = createControllableValue(props, {
|
|
@@ -48,9 +48,25 @@ const Button = props => {
|
|
|
48
48
|
};
|
|
49
49
|
},
|
|
50
50
|
get children() {
|
|
51
|
-
return [
|
|
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
|
+
})()];
|
|
52
67
|
}
|
|
53
68
|
});
|
|
54
69
|
};
|
|
70
|
+
delegateEvents(["input"]);
|
|
55
71
|
|
|
56
72
|
export { Button as default };
|
package/es/Radio/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { createComponent,
|
|
1
|
+
import { delegateEvents, createComponent, effect, className, insert, template } 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';
|
|
7
8
|
import Element from '../Element/index.js';
|
|
8
9
|
|
|
9
|
-
var _tmpl$ =
|
|
10
|
-
_tmpl$2 =
|
|
10
|
+
var _tmpl$ = /*#__PURE__*/template(`<span><input class="m-0 hidden"type=radio><span>`),
|
|
11
|
+
_tmpl$2 = /*#__PURE__*/template(`<span class=px-8px>`);
|
|
11
12
|
const Radio = props => {
|
|
12
13
|
const [checked, setChecked] = createControllableValue(props, {
|
|
13
14
|
defaultValue: false,
|
|
@@ -21,12 +22,40 @@ const Radio = props => {
|
|
|
21
22
|
return cs('inline-flex cursor-pointer inline-flex items-center', props.disabled && 'text-[var(--ant-color-text-disabled)] cursor-not-allowed');
|
|
22
23
|
},
|
|
23
24
|
get children() {
|
|
24
|
-
return [
|
|
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, {
|
|
25
52
|
get when() {
|
|
26
53
|
return props.children;
|
|
27
54
|
},
|
|
28
55
|
get children() {
|
|
29
|
-
|
|
56
|
+
var _el$4 = _tmpl$2();
|
|
57
|
+
insert(_el$4, () => props.children);
|
|
58
|
+
return _el$4;
|
|
30
59
|
}
|
|
31
60
|
})];
|
|
32
61
|
}
|
|
@@ -34,5 +63,6 @@ const Radio = props => {
|
|
|
34
63
|
};
|
|
35
64
|
Radio.Button = Button;
|
|
36
65
|
Radio.Group = Group;
|
|
66
|
+
delegateEvents(["click", "input"]);
|
|
37
67
|
|
|
38
68
|
export { Radio as default };
|
package/es/RangeInput/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent,
|
|
1
|
+
import { delegateEvents, createComponent, use, insert, effect, setAttribute, className, style, template } 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$ = /*#__PURE__*/template(`<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)]">`),
|
|
12
|
+
_tmpl$2 = /*#__PURE__*/template(`<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"></div><div class="absolute top-0 bottom-0 right-11px flex items-center">`),
|
|
13
|
+
_tmpl$3 = /*#__PURE__*/template(`<div class="w-200px max-h-400px overflow-auto">`),
|
|
14
|
+
_tmpl$4 = /*#__PURE__*/template(`<input class="h-30px [outline:none] bg-inherit placeholder-text-[var(--ant-color-text-placeholder)]"readonly>`),
|
|
15
|
+
_tmpl$5 = /*#__PURE__*/template(`<span class="i-ant-design:down-outlined text-[var(--ant-color-text-quaternary)]">`);
|
|
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,50 +105,104 @@ function RangeInput(props) {
|
|
|
105
105
|
contentStyle: {
|
|
106
106
|
padding: 0
|
|
107
107
|
},
|
|
108
|
-
content: () =>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
content: () => (() => {
|
|
109
|
+
var _el$8 = _tmpl$3();
|
|
110
|
+
var _ref$4 = tooltipContent;
|
|
111
|
+
typeof _ref$4 === "function" ? use(_ref$4, _el$8) : tooltipContent = _el$8;
|
|
112
|
+
insert(_el$8, () => props.content({
|
|
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
|
+
})(),
|
|
113
120
|
get children() {
|
|
114
|
-
|
|
121
|
+
var _el$ = _tmpl$2(),
|
|
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, {
|
|
115
139
|
get when() {
|
|
116
140
|
return !isNil(tempValue()[0]);
|
|
117
141
|
},
|
|
118
142
|
get fallback() {
|
|
119
|
-
return
|
|
143
|
+
return (() => {
|
|
144
|
+
var _el$9 = _tmpl$4();
|
|
145
|
+
effect(() => setAttribute(_el$9, "placeholder", props.placeholder?.[0]));
|
|
146
|
+
return _el$9;
|
|
147
|
+
})();
|
|
120
148
|
},
|
|
121
149
|
get children() {
|
|
122
150
|
return optionLabelRender(tempValue()[0]);
|
|
123
151
|
}
|
|
124
|
-
}))
|
|
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, {
|
|
125
156
|
get when() {
|
|
126
157
|
return !isNil(tempValue()[1]);
|
|
127
158
|
},
|
|
128
159
|
get fallback() {
|
|
129
|
-
return
|
|
160
|
+
return (() => {
|
|
161
|
+
var _el$10 = _tmpl$4();
|
|
162
|
+
effect(() => setAttribute(_el$10, "placeholder", props.placeholder?.[1]));
|
|
163
|
+
return _el$10;
|
|
164
|
+
})();
|
|
130
165
|
},
|
|
131
166
|
get children() {
|
|
132
167
|
return optionLabelRender(tempValue()[1]);
|
|
133
168
|
}
|
|
134
|
-
}))
|
|
135
|
-
|
|
136
|
-
...activeBarStyle()
|
|
137
|
-
}), escape(createComponent(Show, {
|
|
169
|
+
}));
|
|
170
|
+
insert(_el$6, createComponent(Show, {
|
|
138
171
|
get when() {
|
|
139
172
|
return showClearBtn();
|
|
140
173
|
},
|
|
141
174
|
get fallback() {
|
|
142
|
-
return
|
|
175
|
+
return _tmpl$5();
|
|
143
176
|
},
|
|
144
177
|
get children() {
|
|
145
|
-
|
|
178
|
+
var _el$7 = _tmpl$();
|
|
179
|
+
_el$7.$$click = e => {
|
|
180
|
+
e.stopPropagation();
|
|
181
|
+
setValue([]);
|
|
182
|
+
setOpen(false);
|
|
183
|
+
};
|
|
184
|
+
return _el$7;
|
|
146
185
|
}
|
|
147
|
-
}))
|
|
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$;
|
|
148
201
|
}
|
|
149
202
|
});
|
|
150
203
|
}
|
|
151
204
|
});
|
|
152
205
|
}
|
|
206
|
+
delegateEvents(["click"]);
|
|
153
207
|
|
|
154
208
|
export { RangeInput as default };
|
package/es/Result/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { createComponent,
|
|
1
|
+
import { createComponent, effect, className, insert, template } 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$ = /*#__PURE__*/template(`<div class=mb-24px><span>`),
|
|
7
|
+
_tmpl$2 = /*#__PURE__*/template(`<div class="my-8px text-[--ant-color-text-heading] text-24px">`),
|
|
8
|
+
_tmpl$3 = /*#__PURE__*/template(`<div class="text-[--ant-color-text-description] text-14px">`),
|
|
9
|
+
_tmpl$4 = /*#__PURE__*/template(`<div class=mt-24px>`);
|
|
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,7 +20,28 @@ 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 [
|
|
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
|
+
})()];
|
|
24
45
|
}
|
|
25
46
|
});
|
|
26
47
|
};
|
package/es/Segmented/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent,
|
|
1
|
+
import { delegateEvents, createComponent, insert, effect, className, template } 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$ = /*#__PURE__*/template(`<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,20 +34,40 @@ 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
|
-
|
|
37
|
+
children: item => (() => {
|
|
38
|
+
var _el$ = _tmpl$(),
|
|
39
|
+
_el$2 = _el$.firstChild;
|
|
40
|
+
_el$2.$$click = e => {
|
|
41
|
+
setValue(unWarpValue(item));
|
|
42
|
+
typeof item === 'object' && item.onClick?.(e);
|
|
43
|
+
};
|
|
44
|
+
insert(_el$2, createComponent(Show, {
|
|
45
|
+
when: typeof item !== 'object',
|
|
46
|
+
get fallback() {
|
|
47
|
+
return typeof item === 'object' && unwrapStringOrJSXElement(item.label);
|
|
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
|
+
})()
|
|
48
67
|
});
|
|
49
68
|
}
|
|
50
69
|
});
|
|
51
70
|
};
|
|
71
|
+
delegateEvents(["click"]);
|
|
52
72
|
|
|
53
73
|
export { Segmented as default };
|