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/Button/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent, mergeProps as mergeProps$1,
|
|
1
|
+
import { createComponent, mergeProps as mergeProps$1, insert, effect, className, style, template } from 'solid-js/web';
|
|
2
2
|
import { mergeProps, splitProps, createSignal, createMemo, children, Show } from 'solid-js';
|
|
3
3
|
import cs from 'classnames';
|
|
4
4
|
import './index.scss.js';
|
|
@@ -7,9 +7,9 @@ import Element from '../Element/index.js';
|
|
|
7
7
|
import useComponentSize from '../hooks/useComponentSize.js';
|
|
8
8
|
import { unwrapStringOrJSXElement } from '../utils/solid.js';
|
|
9
9
|
|
|
10
|
-
var _tmpl$ =
|
|
11
|
-
_tmpl$2 =
|
|
12
|
-
_tmpl$3 =
|
|
10
|
+
var _tmpl$ = /*#__PURE__*/template(`<span class="i-ant-design:loading [vertical-align:-0.125em] keyframes-spin [animation:spin_1s_linear_infinite]">`),
|
|
11
|
+
_tmpl$2 = /*#__PURE__*/template(`<span>`),
|
|
12
|
+
_tmpl$3 = /*#__PURE__*/template(`<span class="inline-block leading-inherit">`);
|
|
13
13
|
const sizeClassMap = {
|
|
14
14
|
large: 'px-15px py-7px h-40px leading-24px',
|
|
15
15
|
middle: 'px-15px py-4px h-32px leading-22px',
|
|
@@ -41,6 +41,10 @@ const Button = _props => {
|
|
|
41
41
|
return createComponent(Element, mergeProps$1({
|
|
42
42
|
tag: "button"
|
|
43
43
|
}, buttonElementProps, {
|
|
44
|
+
ref(r$) {
|
|
45
|
+
var _ref$ = props.ref;
|
|
46
|
+
typeof _ref$ === "function" ? _ref$(r$) : props.ref = r$;
|
|
47
|
+
},
|
|
44
48
|
get ["class"]() {
|
|
45
49
|
return cs(`ant-btn ant-btn-${props.type}`, 'inline-flex justify-center items-center gap-8px', 'relative cursor-pointer [font-size:var(--ant-font-size)] rounded-[--ant-button-border-radius]', 'focus-visible:[outline:4px_solid_var(--ant-color-primary-border)] focus-visible:[outline-offset:1px]', props.block && 'block w-full', props.class, sizeClassMap[size()], props.disabled && 'cursor-not-allowed', typeClassMap[props.type](props.danger, props.disabled), loading() && 'opacity-65');
|
|
46
50
|
},
|
|
@@ -78,19 +82,33 @@ const Button = _props => {
|
|
|
78
82
|
return resolvedIcon();
|
|
79
83
|
},
|
|
80
84
|
get children() {
|
|
81
|
-
|
|
85
|
+
var _el$3 = _tmpl$3();
|
|
86
|
+
insert(_el$3, resolvedIcon);
|
|
87
|
+
return _el$3;
|
|
82
88
|
}
|
|
83
89
|
});
|
|
84
90
|
},
|
|
85
91
|
get children() {
|
|
86
|
-
return
|
|
92
|
+
return _tmpl$();
|
|
87
93
|
}
|
|
88
94
|
}), createComponent(Show, {
|
|
89
95
|
get when() {
|
|
90
96
|
return resolvedChildren();
|
|
91
97
|
},
|
|
92
98
|
get children() {
|
|
93
|
-
|
|
99
|
+
var _el$2 = _tmpl$2();
|
|
100
|
+
insert(_el$2, resolvedChildren);
|
|
101
|
+
effect(_p$ => {
|
|
102
|
+
var _v$ = cs('inline-block leading-inherit', props.contentClass),
|
|
103
|
+
_v$2 = props.contentStyle;
|
|
104
|
+
_v$ !== _p$.e && className(_el$2, _p$.e = _v$);
|
|
105
|
+
_p$.t = style(_el$2, _v$2, _p$.t);
|
|
106
|
+
return _p$;
|
|
107
|
+
}, {
|
|
108
|
+
e: undefined,
|
|
109
|
+
t: undefined
|
|
110
|
+
});
|
|
111
|
+
return _el$2;
|
|
94
112
|
}
|
|
95
113
|
})];
|
|
96
114
|
}
|
package/es/Checkbox/Group.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent } from 'solid-js/web';
|
|
1
|
+
import { createComponent, memo } from 'solid-js/web';
|
|
2
2
|
import { For } from 'solid-js';
|
|
3
3
|
import cs from 'classnames';
|
|
4
4
|
import createControllableValue from '../hooks/createControllableValue.js';
|
|
@@ -38,7 +38,7 @@ const Group = props => {
|
|
|
38
38
|
return props.disabled;
|
|
39
39
|
},
|
|
40
40
|
get children() {
|
|
41
|
-
return [typeof option === 'object' ? unwrapStringOrJSXElement(option.label) : option, ' '];
|
|
41
|
+
return [memo(() => typeof option === 'object' ? unwrapStringOrJSXElement(option.label) : option), ' '];
|
|
42
42
|
}
|
|
43
43
|
})
|
|
44
44
|
});
|
package/es/Checkbox/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { createComponent,
|
|
1
|
+
import { 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 Group from './Group.js';
|
|
6
6
|
import Element from '../Element/index.js';
|
|
7
7
|
|
|
8
|
-
var _tmpl$ =
|
|
9
|
-
_tmpl$2 =
|
|
8
|
+
var _tmpl$ = /*#__PURE__*/template(`<span><input class="m-0 hidden"type=checkbox>`),
|
|
9
|
+
_tmpl$2 = /*#__PURE__*/template(`<span>`);
|
|
10
10
|
const Checkbox = props => {
|
|
11
11
|
const [checked, setChecked] = createControllableValue(props, {
|
|
12
12
|
defaultValue: false,
|
|
@@ -23,20 +23,33 @@ const Checkbox = props => {
|
|
|
23
23
|
return props.style;
|
|
24
24
|
},
|
|
25
25
|
get children() {
|
|
26
|
-
return [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
return [(() => {
|
|
27
|
+
var _el$ = _tmpl$(),
|
|
28
|
+
_el$2 = _el$.firstChild;
|
|
29
|
+
_el$2.addEventListener("change", e => {
|
|
30
|
+
if (props.disabled) return;
|
|
31
|
+
e.target.checked = setChecked(v => !v);
|
|
32
|
+
props.onChange?.(e);
|
|
33
|
+
});
|
|
34
|
+
effect(() => className(_el$, cs('w-16px h-16px rounded-[var(--ant-border-radius-sm)] relative', (() => {
|
|
35
|
+
if (checked()) {
|
|
36
|
+
return ['after:content-empty after:block after:absolute after:top-[calc(50%-1px)] after:left-1/2 after:-translate-1/2 after:-rotate-45 after:w-10px after:h-6px', 'after:border-solid after:border-2px after:border-t-0px after:border-r-0px', props.disabled ? 'bg-[var(--ant-color-bg-container-disabled)] [border:1px_solid_var(--ant-color-border)] after:border-[var(--ant-color-text-disabled)]' : 'bg-[var(--ant-color-primary)] after:border-white'];
|
|
37
|
+
}
|
|
38
|
+
if (props.indeterminate) {
|
|
39
|
+
return ['[border:1px_solid_var(--ant-color-border)]', 'after:content-empty after:block after:absolute after:top-1/2 after:left-1/2 after:-translate-1/2 after:w-8px after:h-8px', props.disabled ? 'after:bg-[var(--ant-color-text-disabled)]' : 'after:bg-[var(--ant-color-primary)]'];
|
|
40
|
+
}
|
|
41
|
+
return ['[border:1px_solid_var(--ant-color-border)]', props.disabled ? 'bg-[var(--ant-color-bg-container-disabled)]' : 'bg-[--ant-color-bg-container]'];
|
|
42
|
+
})())));
|
|
43
|
+
return _el$;
|
|
44
|
+
})(), createComponent(Show, {
|
|
35
45
|
get when() {
|
|
36
46
|
return props.children;
|
|
37
47
|
},
|
|
38
48
|
get children() {
|
|
39
|
-
|
|
49
|
+
var _el$3 = _tmpl$2();
|
|
50
|
+
insert(_el$3, () => props.children);
|
|
51
|
+
effect(() => className(_el$3, cs('px-8px', props.disabled && 'text-[var(--ant-color-text-disabled)]')));
|
|
52
|
+
return _el$3;
|
|
40
53
|
}
|
|
41
54
|
})];
|
|
42
55
|
}
|
package/es/CodeInput/index.js
CHANGED
package/es/Collapse/Item.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent, Dynamic,
|
|
1
|
+
import { delegateEvents, createComponent, Dynamic, insert, effect, className, style, template, memo } from 'solid-js/web';
|
|
2
2
|
import { mergeProps, useContext, Show } from 'solid-js';
|
|
3
3
|
import cs from 'classnames';
|
|
4
4
|
import { Transition } from 'solid-transition-group';
|
|
@@ -9,9 +9,9 @@ import CollapseContext from './context.js';
|
|
|
9
9
|
import useComponentSize from '../hooks/useComponentSize.js';
|
|
10
10
|
import { getElementClass, getElementCssVariables } from './utils.js';
|
|
11
11
|
|
|
12
|
-
var _tmpl$ =
|
|
13
|
-
_tmpl$2 =
|
|
14
|
-
_tmpl$3 =
|
|
12
|
+
var _tmpl$ = /*#__PURE__*/template(`<span>`),
|
|
13
|
+
_tmpl$2 = /*#__PURE__*/template(`<div><span class="inline-flex items-center gap-[--ant-margin-sm]"></span><span class="inline-flex items-center gap-[--ant-margin-sm]">`),
|
|
14
|
+
_tmpl$3 = /*#__PURE__*/template(`<div class=overflow-hidden><div>`);
|
|
15
15
|
const CollapseItem = _props => {
|
|
16
16
|
const props = mergeProps({
|
|
17
17
|
type: 'line',
|
|
@@ -33,9 +33,13 @@ const CollapseItem = _props => {
|
|
|
33
33
|
return !props.disabledChildren && props.expandIcon !== false && props.expandIconPosition === position;
|
|
34
34
|
},
|
|
35
35
|
get children() {
|
|
36
|
-
return typeof props.expandIcon === 'function' ? props.expandIcon({
|
|
36
|
+
return memo(() => typeof props.expandIcon === 'function')() ? props.expandIcon({
|
|
37
37
|
isActive: () => !!open()
|
|
38
|
-
}) :
|
|
38
|
+
}) : (() => {
|
|
39
|
+
var _el$ = _tmpl$();
|
|
40
|
+
effect(() => className(_el$, cs('i-ant-design:right-outlined', 'duration-.3s', open() && 'rotate-[90deg]')));
|
|
41
|
+
return _el$;
|
|
42
|
+
})();
|
|
39
43
|
}
|
|
40
44
|
});
|
|
41
45
|
};
|
|
@@ -51,7 +55,31 @@ const CollapseItem = _props => {
|
|
|
51
55
|
};
|
|
52
56
|
},
|
|
53
57
|
get children() {
|
|
54
|
-
return [
|
|
58
|
+
return [(() => {
|
|
59
|
+
var _el$2 = _tmpl$2(),
|
|
60
|
+
_el$3 = _el$2.firstChild,
|
|
61
|
+
_el$4 = _el$3.nextSibling;
|
|
62
|
+
_el$2.$$click = () => {
|
|
63
|
+
if (props.disabledChildren) return;
|
|
64
|
+
setOpen(!open());
|
|
65
|
+
};
|
|
66
|
+
insert(_el$3, () => getExpandIcon('left'), null);
|
|
67
|
+
insert(_el$3, () => unwrapStringOrJSXElement(props.label), null);
|
|
68
|
+
insert(_el$3, () => getExpandIcon('right'), null);
|
|
69
|
+
insert(_el$4, () => unwrapStringOrJSXElement(props.extra), null);
|
|
70
|
+
insert(_el$4, () => getExpandIcon('end'), null);
|
|
71
|
+
effect(_p$ => {
|
|
72
|
+
var _v$ = cs('text-[--ant-color-text-heading] flex justify-between items-center cursor-pointer', props.type === 'card' && 'bg-[var(--ant-collapse-header-bg)] p-[--ant-collapse-header-padding]'),
|
|
73
|
+
_v$2 = props.headerStyle;
|
|
74
|
+
_v$ !== _p$.e && className(_el$2, _p$.e = _v$);
|
|
75
|
+
_p$.t = style(_el$2, _v$2, _p$.t);
|
|
76
|
+
return _p$;
|
|
77
|
+
}, {
|
|
78
|
+
e: undefined,
|
|
79
|
+
t: undefined
|
|
80
|
+
});
|
|
81
|
+
return _el$2;
|
|
82
|
+
})(), createComponent(Transition, {
|
|
55
83
|
onEnter: (el, done) => {
|
|
56
84
|
el.animate([{
|
|
57
85
|
height: '0px'
|
|
@@ -76,7 +104,20 @@ const CollapseItem = _props => {
|
|
|
76
104
|
return open();
|
|
77
105
|
},
|
|
78
106
|
get children() {
|
|
79
|
-
|
|
107
|
+
var _el$5 = _tmpl$3(),
|
|
108
|
+
_el$6 = _el$5.firstChild;
|
|
109
|
+
insert(_el$6, () => props.children);
|
|
110
|
+
effect(_p$ => {
|
|
111
|
+
var _v$3 = cs('p-[--ant-collapse-content-padding]', props.type === 'card' && '[border-top:1px_solid_var(--ant-color-border)]'),
|
|
112
|
+
_v$4 = props.bodyStyle;
|
|
113
|
+
_v$3 !== _p$.e && className(_el$6, _p$.e = _v$3);
|
|
114
|
+
_p$.t = style(_el$6, _v$4, _p$.t);
|
|
115
|
+
return _p$;
|
|
116
|
+
}, {
|
|
117
|
+
e: undefined,
|
|
118
|
+
t: undefined
|
|
119
|
+
});
|
|
120
|
+
return _el$5;
|
|
80
121
|
}
|
|
81
122
|
});
|
|
82
123
|
}
|
|
@@ -84,5 +125,6 @@ const CollapseItem = _props => {
|
|
|
84
125
|
}
|
|
85
126
|
});
|
|
86
127
|
};
|
|
128
|
+
delegateEvents(["click"]);
|
|
87
129
|
|
|
88
130
|
export { CollapseItem as default };
|
package/es/Collapse/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent,
|
|
1
|
+
import { createComponent, effect, className, mergeProps as mergeProps$1, template } from 'solid-js/web';
|
|
2
2
|
import { mergeProps, Show, For } from 'solid-js';
|
|
3
3
|
import cs from 'classnames';
|
|
4
4
|
import { isEmpty } from 'lodash-es';
|
|
@@ -10,7 +10,7 @@ import CollapseItem from './Item.js';
|
|
|
10
10
|
import CollapseContext from './context.js';
|
|
11
11
|
import { getElementClass, getElementCssVariables } from './utils.js';
|
|
12
12
|
|
|
13
|
-
var _tmpl$ =
|
|
13
|
+
var _tmpl$ = /*#__PURE__*/template(`<div>`);
|
|
14
14
|
const Collapse = _props => {
|
|
15
15
|
const props = mergeProps({
|
|
16
16
|
divider: true,
|
|
@@ -55,7 +55,9 @@ const Collapse = _props => {
|
|
|
55
55
|
return index() !== 0 && props.divider;
|
|
56
56
|
},
|
|
57
57
|
get children() {
|
|
58
|
-
|
|
58
|
+
var _el$ = _tmpl$();
|
|
59
|
+
effect(() => className(_el$, cs('h-1px bg-[var(--ant-color-split)]', props.type === 'line' && 'm-[--ant-collapse-divider-margin]')));
|
|
60
|
+
return _el$;
|
|
59
61
|
}
|
|
60
62
|
}), createComponent(CollapseItem, mergeProps$1(item, {
|
|
61
63
|
get open() {
|