antd-solid 0.0.10 → 0.0.12
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 +23 -6
- package/dist/index.esm.js +555 -152
- package/dist/index.umd.js +1 -1
- package/es/{Button.d.ts → Button/index.d.ts} +3 -2
- package/es/{Button.js → Button/index.js} +11 -9
- package/es/Button/index.scss.js +6 -0
- package/es/{Compact.js → Compact/index.js} +4 -4
- package/es/Drawer/index.d.ts +44 -0
- package/es/Drawer/index.js +162 -0
- package/es/Drawer/index.scss.js +6 -0
- package/es/Empty/index.d.ts +6 -2
- package/es/Empty/index.js +7 -2
- package/es/Input.js +3 -3
- package/es/InputNumber.js +1 -1
- package/es/Modal.js +23 -8
- package/es/Popconfirm.js +1 -1
- package/es/Progress/index.d.ts +24 -0
- package/es/Progress/index.js +81 -0
- package/es/Radio.js +25 -21
- package/es/Result.js +1 -1
- package/es/Select.js +2 -2
- package/es/Spin.d.ts +1 -0
- package/es/Spin.js +12 -6
- package/es/Switch.js +1 -1
- package/es/Tabs.js +2 -2
- package/es/Timeline.js +1 -1
- package/es/Tree.js +2 -2
- package/es/Upload.d.ts +56 -10
- package/es/Upload.js +93 -3
- package/es/hooks/createControllableValue.d.ts +1 -1
- package/es/hooks/createTransition.d.ts +8 -0
- package/es/hooks/createTransition.js +39 -0
- package/es/index.d.ts +5 -2
- package/es/index.js +5 -4
- package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +26 -0
- package/es/utils/solid.d.ts +4 -1
- package/es/utils/solid.js +9 -1
- package/package.json +3 -1
- package/src/Button/index.scss +9 -0
- package/src/{Button.tsx → Button/index.tsx} +23 -11
- package/src/Compact/index.tsx +20 -0
- package/src/Drawer/index.scss +53 -0
- package/src/Drawer/index.tsx +211 -0
- package/src/Empty/index.tsx +11 -6
- package/src/{form → Form}/FormItem.tsx +9 -7
- package/src/Input.tsx +2 -2
- package/src/InputNumber.tsx +34 -20
- package/src/Modal.tsx +37 -12
- package/src/Progress/index.tsx +81 -0
- package/src/Radio.tsx +26 -16
- package/src/Result.tsx +1 -1
- package/src/Select.tsx +14 -4
- package/src/Spin.tsx +16 -5
- package/src/Switch.tsx +1 -1
- package/src/Tabs.tsx +2 -2
- package/src/Timeline.tsx +1 -1
- package/src/Tree.tsx +4 -3
- package/src/Upload.tsx +138 -5
- package/src/hooks/createControllableValue.ts +3 -3
- package/src/hooks/createTransition.ts +52 -0
- package/src/index.ts +5 -2
- package/src/utils/solid.ts +9 -1
- package/es/Progress.d.ts +0 -7
- package/es/Progress.js +0 -6
- package/src/Compact.tsx +0 -15
- package/src/Progress.tsx +0 -4
- /package/es/{Compact.d.ts → Compact/index.d.ts} +0 -0
- /package/es/{form → Form}/Form.d.ts +0 -0
- /package/es/{form → Form}/Form.js +0 -0
- /package/es/{form → Form}/FormItem.d.ts +0 -0
- /package/es/{form → Form}/FormItem.js +0 -0
- /package/es/{form → Form}/context.d.ts +0 -0
- /package/es/{form → Form}/context.js +0 -0
- /package/es/{form → Form}/index.d.ts +0 -0
- /package/es/{form → Form}/index.js +0 -0
- /package/src/{form → Form}/Form.tsx +0 -0
- /package/src/{form → Form}/context.ts +0 -0
- /package/src/{form → Form}/index.ts +0 -0
package/dist/index.esm.js
CHANGED
|
@@ -1,28 +1,69 @@
|
|
|
1
|
-
import { delegateEvents, use,
|
|
2
|
-
import { mergeProps, createSignal, createMemo, Show, createEffect, on, splitProps,
|
|
1
|
+
import { insert, template, delegateEvents, use, createComponent, effect, className, style, mergeProps as mergeProps$1, Dynamic, render, memo, Portal, setAttribute, spread } from 'solid-js/web';
|
|
2
|
+
import { mergeProps, createSignal, createMemo, untrack, Show, createEffect, on, splitProps, For, onMount, onCleanup, children, createSelector, createContext, useContext, Index, Switch as Switch$1, Match } from 'solid-js';
|
|
3
3
|
import cs from 'classnames';
|
|
4
4
|
import { omit, isNil, clamp, compact, isEmpty, max, get, set, mapValues } from 'lodash-es';
|
|
5
5
|
import React, { useRef, useEffect } from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import { Transition } from 'solid-transition-group';
|
|
7
|
+
import { ConfigProvider, DatePicker as DatePicker$1, ColorPicker as ColorPicker$1, Skeleton as Skeleton$1, Image as Image$2 } from 'antd';
|
|
7
8
|
export { message } from 'antd';
|
|
8
9
|
import { createRoot } from 'react-dom/client';
|
|
9
10
|
import { nanoid } from 'nanoid';
|
|
10
|
-
import { Transition } from 'solid-transition-group';
|
|
11
11
|
|
|
12
|
-
const _tmpl$$
|
|
13
|
-
|
|
12
|
+
const _tmpl$$t = /*#__PURE__*/template(`<div class="ant-compact ant-flex child[:first-child]>:ant-rounded-l-6px child[:last-child]>:ant-rounded-r-6px">`);
|
|
13
|
+
function Compact(props) {
|
|
14
|
+
return (() => {
|
|
15
|
+
const _el$ = _tmpl$$t();
|
|
16
|
+
insert(_el$, () => props.children);
|
|
17
|
+
return _el$;
|
|
18
|
+
})();
|
|
19
|
+
}
|
|
20
|
+
Compact.compactItemClass = 'p[.ant-compact]:ant-ml--1px p[.ant-compact]:first:ant-ml-0';
|
|
21
|
+
Compact.compactItemRounded0Class = 'p[.ant-compact]:ant-rounded-0';
|
|
22
|
+
Compact.compactItemRoundedLeftClass = 'p[.ant-compact>:first-child]:ant-rounded-l-6px';
|
|
23
|
+
Compact.compactItemRoundedRightClass = 'p[.ant-compact>:last-child]:ant-rounded-r-6px';
|
|
24
|
+
Compact.compactItemZIndexClass = 'p[.ant-compact]:hover:ant-z-10 p[.ant-compact]:focus:ant-z-10 p[.ant-compact]:focus-within:ant-z-10';
|
|
25
|
+
|
|
26
|
+
function styleInject(css, ref) {
|
|
27
|
+
if (ref === void 0) ref = {};
|
|
28
|
+
var insertAt = ref.insertAt;
|
|
29
|
+
if (!css || typeof document === 'undefined') {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
33
|
+
var style = document.createElement('style');
|
|
34
|
+
style.type = 'text/css';
|
|
35
|
+
if (insertAt === 'top') {
|
|
36
|
+
if (head.firstChild) {
|
|
37
|
+
head.insertBefore(style, head.firstChild);
|
|
38
|
+
} else {
|
|
39
|
+
head.appendChild(style);
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
head.appendChild(style);
|
|
43
|
+
}
|
|
44
|
+
if (style.styleSheet) {
|
|
45
|
+
style.styleSheet.cssText = css;
|
|
46
|
+
} else {
|
|
47
|
+
style.appendChild(document.createTextNode(css));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var css_248z$1 = ".ant-compact .ant-btn-primary:not(:first-child) {\n border-left: 1px solid white;\n}\n.ant-compact .ant-btn-primary:not(:last-child) {\n border-right: 1px solid white;\n}";
|
|
52
|
+
styleInject(css_248z$1);
|
|
53
|
+
|
|
54
|
+
const _tmpl$$s = /*#__PURE__*/template(`<span class="i-ant-design:loading ant-[vertical-align:-0.125em] keyframes-spin ant-[animation:spin_1s_linear_infinite] ant-mr-8px">`),
|
|
55
|
+
_tmpl$2$f = /*#__PURE__*/template(`<button><span>`);
|
|
14
56
|
const sizeClassMap = {
|
|
15
57
|
large: 'ant-px-15px ant-py-6px ant-h-40px ant-rounded-8px',
|
|
16
58
|
middle: 'ant-px-15px ant-py-4px ant-h-32px ant-rounded-6px',
|
|
17
|
-
small: 'ant-px-7px ant-h-24px ant-rounded-4px'
|
|
18
|
-
plain: 'ant-p-0'
|
|
59
|
+
small: 'ant-px-7px ant-h-24px ant-rounded-4px'
|
|
19
60
|
};
|
|
20
61
|
const typeClassMap = {
|
|
21
|
-
default: danger => cs('ant-bg-white', danger ? 'ant-[border:1px_solid_var(--ant-color-error)] ant-text-[var(--ant-color-error)] hover:ant-[border-color:var(--light-error-color)] hover:ant-text-[var(--light-error-color)] active:ant-[border-color:var(--dark-error-color)] active:ant-text-[var(--dark-error-color)]' : 'ant-[border:1px_solid_var(--ant-color-border)] ant-text-[var(--dark-color)] hover:ant-[border-color:var(--
|
|
22
|
-
primary: danger => cs('ant-
|
|
23
|
-
dashed: danger => cs(' ant-bg-white', danger ? 'ant-[border:1px_dashed_var(--ant-color-error)] ant-text-[var(--ant-color-error)] hover:ant-[border-color:var(--light-error-color)] hover:ant-text-[var(--light-error-color)] active:ant-[border-color:var(--dark-error-color)] active:ant-text-[var(--dark-error-color)]' : 'ant-[border:1px_dashed_var(--ant-color-border)] ant-text-[var(--dark-color)] hover:ant-[border-color:var(--
|
|
62
|
+
default: danger => cs('ant-bg-white', danger ? 'ant-[border:1px_solid_var(--ant-color-error)] ant-text-[var(--ant-color-error)] hover:ant-[border-color:var(--light-error-color)] hover:ant-text-[var(--light-error-color)] active:ant-[border-color:var(--dark-error-color)] active:ant-text-[var(--dark-error-color)]' : 'ant-[border:1px_solid_var(--ant-color-border)] ant-text-[var(--dark-color)] hover:ant-[border-color:var(--ant-color-primary-hover)] hover:ant-text-[var(--ant-color-primary-hover)] active:ant-[border-color:var(--ant-color-primary-active)] active:ant-text-[var(--ant-color-primary-active)]'),
|
|
63
|
+
primary: danger => cs('ant-text-white', danger ? 'ant-[border:1px_solid_var(--ant-color-error)] ant-bg-[var(--ant-color-error)] hover:ant-[border-color:var(--light-error-color)] hover:ant-bg-[var(--light-error-color)] active:ant-[border-color:var(--dark-error-color)] active:ant-bg-[var(--dark-error-color)]' : 'ant-[border:1px_solid_var(--ant-color-primary)] ant-bg-[var(--ant-color-primary)] hover:ant-[border-color:var(--ant-color-primary-hover)] hover:ant-bg-[var(--ant-color-primary-hover)] active:ant-[border-color:var(--ant-color-primary-active)] active:ant-bg-[var(--ant-color-primary-active)]'),
|
|
64
|
+
dashed: danger => cs(' ant-bg-white', danger ? 'ant-[border:1px_dashed_var(--ant-color-error)] ant-text-[var(--ant-color-error)] hover:ant-[border-color:var(--light-error-color)] hover:ant-text-[var(--light-error-color)] active:ant-[border-color:var(--dark-error-color)] active:ant-text-[var(--dark-error-color)]' : 'ant-[border:1px_dashed_var(--ant-color-border)] ant-text-[var(--dark-color)] hover:ant-[border-color:var(--ant-color-primary-hover)] hover:ant-text-[var(--ant-color-primary-hover)] active:ant-[border-color:var(--ant-color-primary-active)] active:ant-text-[var(--ant-color-primary-active)]'),
|
|
24
65
|
text: danger => cs('ant-border-none ant-bg-transparent', danger ? 'ant-text-[var(--ant-color-error)] hover:ant-bg-[var(--error-bg-color)] active:ant-bg-[var(--error-bg-color)]' : 'ant-text-[var(--dark-color)] hover:ant-bg-[rgba(0,0,0,0.06)] active:ant-bg-[rgba(0,0,0,.15)]'),
|
|
25
|
-
link: danger => cs('ant-border-none ant-bg-transparent', danger ? 'ant-text-[var(--ant-color-error)] hover:ant-text-[var(--light-error-color)] active:ant-text-[var(--dark-error-color)]' : 'ant-text-[var(--
|
|
66
|
+
link: danger => cs('ant-border-none ant-bg-transparent', danger ? 'ant-text-[var(--ant-color-error)] hover:ant-text-[var(--light-error-color)] active:ant-text-[var(--dark-error-color)]' : 'ant-text-[var(--ant-color-primary)] hover:ant-text-[var(--ant-color-primary-hover)] active:ant-text-[var(--ant-color-primary-active)]')
|
|
26
67
|
};
|
|
27
68
|
const Button = props => {
|
|
28
69
|
const mergedProps = mergeProps({
|
|
@@ -32,7 +73,7 @@ const Button = props => {
|
|
|
32
73
|
const [innerLoading, setLoading] = createSignal(false);
|
|
33
74
|
const loading = createMemo(() => props.loading ?? innerLoading());
|
|
34
75
|
return (() => {
|
|
35
|
-
const _el$ = _tmpl$2$
|
|
76
|
+
const _el$ = _tmpl$2$f(),
|
|
36
77
|
_el$3 = _el$.firstChild;
|
|
37
78
|
_el$.$$click = e => {
|
|
38
79
|
const res = mergedProps.onClick?.(e);
|
|
@@ -42,7 +83,7 @@ const Button = props => {
|
|
|
42
83
|
}
|
|
43
84
|
if (mergedProps.type === 'default' || mergedProps.type === 'primary' || mergedProps.type === 'dashed') {
|
|
44
85
|
const div = document.createElement('div');
|
|
45
|
-
div.className = cs(props.danger ? 'ant-[--color:var(--light-error-color)]' : 'ant-[--color:var(--
|
|
86
|
+
div.className = cs(props.danger ? 'ant-[--color:var(--light-error-color)]' : 'ant-[--color:var(--ant-color-primary-hover)]', 'ant-absolute ant-inset-0 ant-rounded-inherit ant-[background:radial-gradient(var(--color),rgba(0,0,0,0))] ant-z--1 ant-keyframes-button-border[inset:0px][inset:-6px] ant-[animation:button-border_ease-out_0.3s]');
|
|
46
87
|
const onAnimationEnd = () => {
|
|
47
88
|
div.remove();
|
|
48
89
|
div.removeEventListener('animationend', onAnimationEnd);
|
|
@@ -53,17 +94,18 @@ const Button = props => {
|
|
|
53
94
|
};
|
|
54
95
|
const _ref$ = mergedProps.ref;
|
|
55
96
|
typeof _ref$ === "function" ? use(_ref$, _el$) : mergedProps.ref = _el$;
|
|
97
|
+
_el$.addEventListener("click", untrack(() => props['on:click']));
|
|
56
98
|
insert(_el$, createComponent(Show, {
|
|
57
99
|
get when() {
|
|
58
100
|
return loading();
|
|
59
101
|
},
|
|
60
102
|
get children() {
|
|
61
|
-
return _tmpl$$
|
|
103
|
+
return _tmpl$$s();
|
|
62
104
|
}
|
|
63
105
|
}), _el$3);
|
|
64
106
|
insert(_el$3, () => mergedProps.children);
|
|
65
107
|
effect(_p$ => {
|
|
66
|
-
const _v$ = cs('ant-relative ant-cursor-pointer', mergedProps.class, sizeClassMap[mergedProps.size], typeClassMap[mergedProps.type](props.danger ?? false), loading() && 'ant-opacity-65', 'ant-[--color:--
|
|
108
|
+
const _v$ = cs(`ant-btn ant-btn-${mergedProps.type}`, 'ant-relative ant-cursor-pointer', 'focus-visible:ant-[outline:4px_solid_var(--ant-color-primary-border)] focus-visible:ant-[outline-offset:1px]', mergedProps.class, sizeClassMap[mergedProps.size], typeClassMap[mergedProps.type](props.danger ?? false), loading() && 'ant-opacity-65', 'ant-[--color:--ant-color-primary-hover]', Compact.compactItemRounded0Class, Compact.compactItemZIndexClass, Compact.compactItemClass),
|
|
67
109
|
_v$2 = mergedProps.style;
|
|
68
110
|
_v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
|
|
69
111
|
_p$._v$2 = style(_el$, _v$2, _p$._v$2);
|
|
@@ -123,26 +165,12 @@ function createControllableValue(props, options = {}) {
|
|
|
123
165
|
return [value, setValue];
|
|
124
166
|
}
|
|
125
167
|
|
|
126
|
-
const _tmpl$$
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
insert(_el$, () => props.children);
|
|
131
|
-
return _el$;
|
|
132
|
-
})();
|
|
133
|
-
}
|
|
134
|
-
Compact.compactItemClass = 'p[.ant-compact]:ant-ml--1px';
|
|
135
|
-
Compact.compactItemRounded0Class = 'p[.ant-compact>*]:ant-rounded-0';
|
|
136
|
-
Compact.compactItemRoundedLeftClass = 'p[.ant-compact>:first-child]:ant-rounded-l-6px';
|
|
137
|
-
Compact.compactItemRoundedRightClass = 'p[.ant-compact>:last-child]:ant-rounded-r-6px';
|
|
138
|
-
Compact.compactItemZIndexClass = 'p[.ant-compact>*]:focus:ant-z-10 p[.ant-compact>*]:focus-within:ant-z-10';
|
|
139
|
-
|
|
140
|
-
const _tmpl$$o = /*#__PURE__*/template(`<div>`),
|
|
141
|
-
_tmpl$2$c = /*#__PURE__*/template(`<div class="ant-mr-4px">`),
|
|
142
|
-
_tmpl$3$9 = /*#__PURE__*/template(`<div class="ant-ml-4px">`),
|
|
143
|
-
_tmpl$4$5 = /*#__PURE__*/template(`<div class="ant-[display:var(--input-after-display)] ant-absolute ant-top-0 ant-bottom-0 ant-right-0 ant-h-[calc(100%-2px)] ant-translate-y-1px -ant-translate-x-1px">`);
|
|
168
|
+
const _tmpl$$r = /*#__PURE__*/template(`<div>`),
|
|
169
|
+
_tmpl$2$e = /*#__PURE__*/template(`<div class="ant-mr-4px">`),
|
|
170
|
+
_tmpl$3$a = /*#__PURE__*/template(`<div class="ant-ml-4px">`),
|
|
171
|
+
_tmpl$4$6 = /*#__PURE__*/template(`<div class="ant-[display:var(--input-after-display)] ant-absolute ant-top-0 ant-bottom-0 ant-right-0 ant-h-[calc(100%-2px)] ant-translate-y-1px -ant-translate-x-1px">`);
|
|
144
172
|
const statusClassDict = {
|
|
145
|
-
default: disabled => cs('ant-[border:1px_solid_var(--ant-color-border)]', !disabled && 'hover:ant-border-[var(--
|
|
173
|
+
default: disabled => cs('ant-[border:1px_solid_var(--ant-color-border)]', !disabled && 'hover:ant-border-[var(--ant-color-primary)] focus-within:ant-border-[var(--ant-color-primary)] focus-within:ant-[box-shadow:0_0_0_2px_rgba(5,145,255,0.1)]'),
|
|
146
174
|
error: disabled => cs('ant-[border:1px_solid_var(--ant-color-error)]', !disabled && 'hover:ant-border-[var(--light-error-color)] focus-within:ant-[box-shadow:0_0_0_2px_rgba(255,38,5,.06)]'),
|
|
147
175
|
warning: disabled => cs('ant-[border:1px_solid_var(--warning-color)]', !disabled && 'hover:ant-border-[var(--color-warning-border-hover)] focus-within:ant-[box-shadow:0_0_0_2px_rgba(255,215,5,.1)]')
|
|
148
176
|
};
|
|
@@ -186,13 +214,13 @@ function CommonInput(props) {
|
|
|
186
214
|
}
|
|
187
215
|
}));
|
|
188
216
|
return (() => {
|
|
189
|
-
const _el$ = _tmpl$$
|
|
217
|
+
const _el$ = _tmpl$$r();
|
|
190
218
|
insert(_el$, createComponent(Show, {
|
|
191
219
|
get when() {
|
|
192
220
|
return props.addonBefore;
|
|
193
221
|
},
|
|
194
222
|
get children() {
|
|
195
|
-
const _el$2 = _tmpl$$
|
|
223
|
+
const _el$2 = _tmpl$$r();
|
|
196
224
|
insert(_el$2, () => props.addonBefore);
|
|
197
225
|
effect(() => className(_el$2, cs('ant-shrink-0 ant-flex ant-justify-center ant-items-center ant-px-11px ant-bg-[rgba(0,0,0,.02)] ant-[border:1px_solid_var(--ant-color-border)] ant-border-r-0 ant-rounded-l-6px ant-text-14px', Compact.compactItemRounded0Class, Compact.compactItemRoundedLeftClass)));
|
|
198
226
|
return _el$2;
|
|
@@ -204,13 +232,13 @@ function CommonInput(props) {
|
|
|
204
232
|
},
|
|
205
233
|
fallback: inputJSX,
|
|
206
234
|
get children() {
|
|
207
|
-
const _el$3 = _tmpl$$
|
|
235
|
+
const _el$3 = _tmpl$$r();
|
|
208
236
|
insert(_el$3, createComponent(Show, {
|
|
209
237
|
get when() {
|
|
210
238
|
return props.prefix;
|
|
211
239
|
},
|
|
212
240
|
get children() {
|
|
213
|
-
const _el$4 = _tmpl$2$
|
|
241
|
+
const _el$4 = _tmpl$2$e();
|
|
214
242
|
insert(_el$4, () => props.prefix);
|
|
215
243
|
return _el$4;
|
|
216
244
|
}
|
|
@@ -221,7 +249,7 @@ function CommonInput(props) {
|
|
|
221
249
|
return props.suffix;
|
|
222
250
|
},
|
|
223
251
|
get children() {
|
|
224
|
-
const _el$5 = _tmpl$3$
|
|
252
|
+
const _el$5 = _tmpl$3$a();
|
|
225
253
|
insert(_el$5, () => props.suffix);
|
|
226
254
|
return _el$5;
|
|
227
255
|
}
|
|
@@ -231,12 +259,12 @@ function CommonInput(props) {
|
|
|
231
259
|
return props.actions;
|
|
232
260
|
},
|
|
233
261
|
get children() {
|
|
234
|
-
const _el$6 = _tmpl$4$
|
|
262
|
+
const _el$6 = _tmpl$4$6();
|
|
235
263
|
insert(_el$6, () => props.actions);
|
|
236
264
|
return _el$6;
|
|
237
265
|
}
|
|
238
266
|
}), null);
|
|
239
|
-
effect(() => className(_el$3, cs('ant-flex ant-items-center ant-w-full ant-relative ant-[--input-after-display:none] hover:ant-[--input-after-display:block] p:hover-child[input]:ant-border-[var(--
|
|
267
|
+
effect(() => className(_el$3, cs('ant-flex ant-items-center ant-w-full ant-relative ant-[--input-after-display:none] hover:ant-[--input-after-display:block] p:hover-child[input]:ant-border-[var(--ant-color-primary)]', inputWrapClass())));
|
|
240
268
|
return _el$3;
|
|
241
269
|
}
|
|
242
270
|
}), null);
|
|
@@ -245,7 +273,7 @@ function CommonInput(props) {
|
|
|
245
273
|
return props.addonAfter;
|
|
246
274
|
},
|
|
247
275
|
get children() {
|
|
248
|
-
const _el$7 = _tmpl$$
|
|
276
|
+
const _el$7 = _tmpl$$r();
|
|
249
277
|
insert(_el$7, () => props.addonAfter);
|
|
250
278
|
effect(() => className(_el$7, cs('ant-shrink-0 ant-flex ant-justify-center ant-items-center ant-px-11px ant-bg-[rgba(0,0,0,.02)] ant-[border:1px_solid_var(--ant-color-border)] ant-border-l-0 ant-rounded-r-6px ant-text-14px', Compact.compactItemRounded0Class, Compact.compactItemRoundedRightClass)));
|
|
251
279
|
return _el$7;
|
|
@@ -318,8 +346,15 @@ function dispatchEventHandlerUnion(handler, e) {
|
|
|
318
346
|
function unwrapStringOrJSXElement(value) {
|
|
319
347
|
return typeof value === 'function' ? value() : value;
|
|
320
348
|
}
|
|
349
|
+
function setRef(props, value) {
|
|
350
|
+
untrack(() => {
|
|
351
|
+
if (typeof props.ref === 'function') {
|
|
352
|
+
props.ref?.(value);
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
}
|
|
321
356
|
|
|
322
|
-
const _tmpl$$
|
|
357
|
+
const _tmpl$$q = /*#__PURE__*/template(`<div class="ant-flex ant-flex-col ant-h-full ant-w-24px ant-[border-left:1px_solid_var(--ant-color-border)]"><div class="ant-text-12px ant-flex ant-justify-center ant-items-center ant-h-1/2 ant-cursor-pointer ant-opacity-70 hover:ant-h-100% hover:ant-text-[var(--ant-color-primary)] ant-transition-color ant-transition-height ant-transition-duration-500"><div class="i-ant-design:up-outlined"></div></div><div class="ant-[border-top:1px_solid_var(--ant-color-border)] ant-text-12px ant-flex ant-justify-center ant-items-center ant-h-1/2 ant-cursor-pointer ant-opacity-70 hover:ant-h-100% hover:ant-text-[var(--ant-color-primary)] ant-transition-color ant-transition-height ant-transition-duration-500"><div class="i-ant-design:down-outlined">`);
|
|
323
358
|
const isEmptyValue = value => isNil(value) || value === '';
|
|
324
359
|
const InputNumber = _props => {
|
|
325
360
|
const props = mergeProps({
|
|
@@ -362,7 +397,7 @@ const InputNumber = _props => {
|
|
|
362
397
|
return createComponent(CommonInput, mergeProps$1(inputProps, {
|
|
363
398
|
get actions() {
|
|
364
399
|
return (() => {
|
|
365
|
-
const _el$ = _tmpl$$
|
|
400
|
+
const _el$ = _tmpl$$q(),
|
|
366
401
|
_el$2 = _el$.firstChild,
|
|
367
402
|
_el$3 = _el$2.nextSibling;
|
|
368
403
|
_el$2.$$click = up;
|
|
@@ -404,23 +439,23 @@ const InputNumber = _props => {
|
|
|
404
439
|
};
|
|
405
440
|
delegateEvents(["click"]);
|
|
406
441
|
|
|
407
|
-
const _tmpl$$
|
|
408
|
-
_tmpl$2$
|
|
409
|
-
_tmpl$3$
|
|
442
|
+
const _tmpl$$p = /*#__PURE__*/template(`<div class="ant-flex ant-flex-col ant-gap-[16px]">`),
|
|
443
|
+
_tmpl$2$d = /*#__PURE__*/template(`<div class="ant-flex ant-relative"><div class="ant-w-[10px] ant-h-[10px] ant-border-solid ant-border-width-[3px] ant-border-[var(--ant-color-primary)] ant-bg-white ant-rounded-[50%] ant-mt-[8px]"></div><div class="ant-ml-[8px]">`),
|
|
444
|
+
_tmpl$3$9 = /*#__PURE__*/template(`<div class="ant-absolute ant-top-[8px] ant-bottom-[-24px] ant-left-[4px] ant-w-[2px] ant-bg-[rgba(5,5,5,.06)]">`);
|
|
410
445
|
const Timeline = props => {
|
|
411
446
|
return (() => {
|
|
412
|
-
const _el$ = _tmpl$$
|
|
447
|
+
const _el$ = _tmpl$$p();
|
|
413
448
|
insert(_el$, createComponent(For, {
|
|
414
449
|
get each() {
|
|
415
450
|
return props.items;
|
|
416
451
|
},
|
|
417
452
|
children: (item, i) => (() => {
|
|
418
|
-
const _el$2 = _tmpl$2$
|
|
453
|
+
const _el$2 = _tmpl$2$d(),
|
|
419
454
|
_el$3 = _el$2.firstChild,
|
|
420
455
|
_el$4 = _el$3.nextSibling;
|
|
421
456
|
insert(_el$2, (() => {
|
|
422
457
|
const _c$ = memo(() => i() !== props.items.length - 1);
|
|
423
|
-
return () => _c$() && _tmpl$3$
|
|
458
|
+
return () => _c$() && _tmpl$3$9();
|
|
424
459
|
})(), _el$3);
|
|
425
460
|
insert(_el$4, () => item.children?.());
|
|
426
461
|
return _el$2;
|
|
@@ -430,10 +465,10 @@ const Timeline = props => {
|
|
|
430
465
|
})();
|
|
431
466
|
};
|
|
432
467
|
|
|
433
|
-
const _tmpl$$
|
|
434
|
-
_tmpl$2$
|
|
435
|
-
_tmpl$3$
|
|
436
|
-
_tmpl$4$
|
|
468
|
+
const _tmpl$$o = /*#__PURE__*/template(`<span class="i-ant-design:close-outlined">`),
|
|
469
|
+
_tmpl$2$c = /*#__PURE__*/template(`<div class="ant-flex ant-gap-8px ant-justify-end">`),
|
|
470
|
+
_tmpl$3$8 = /*#__PURE__*/template(`<div class="ant-mt-12px">`),
|
|
471
|
+
_tmpl$4$5 = /*#__PURE__*/template(`<div><div class="ant-text-[rgba(0,0,0,.88)] ant-text-16px ant-font-600 ant-mb-8px"></div><div class="ant-grow">`),
|
|
437
472
|
_tmpl$5$1 = /*#__PURE__*/template(`<div>`),
|
|
438
473
|
_tmpl$6$1 = /*#__PURE__*/template(`<span class="i-ant-design:exclamation-circle ant-text-22px ant-mr-12px ant-text-[var(--warning-color)]">`),
|
|
439
474
|
_tmpl$7 = /*#__PURE__*/template(`<div class="ant-ml-34px">`);
|
|
@@ -443,10 +478,23 @@ function Modal(_props) {
|
|
|
443
478
|
}, _props);
|
|
444
479
|
const [open, setOpen] = createSignal(props.defaultOpen ?? false);
|
|
445
480
|
const [hide, setHide] = createSignal(false);
|
|
481
|
+
let cleanup;
|
|
446
482
|
const instance = {
|
|
447
483
|
open() {
|
|
448
484
|
setOpen(true);
|
|
449
485
|
setHide(false);
|
|
486
|
+
const originOverflow = document.body.style.overflow;
|
|
487
|
+
document.body.style.overflow = 'hidden';
|
|
488
|
+
const onKeyup = e => {
|
|
489
|
+
if (e.key === 'Escape') {
|
|
490
|
+
instance.close();
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
document.addEventListener('keyup', onKeyup);
|
|
494
|
+
cleanup = () => {
|
|
495
|
+
document.body.style.overflow = originOverflow;
|
|
496
|
+
document.removeEventListener('keyup', onKeyup);
|
|
497
|
+
};
|
|
450
498
|
},
|
|
451
499
|
close() {
|
|
452
500
|
untrack(() => {
|
|
@@ -455,6 +503,8 @@ function Modal(_props) {
|
|
|
455
503
|
} else {
|
|
456
504
|
setHide(true);
|
|
457
505
|
}
|
|
506
|
+
cleanup();
|
|
507
|
+
props.afterClose?.();
|
|
458
508
|
});
|
|
459
509
|
}
|
|
460
510
|
};
|
|
@@ -463,10 +513,6 @@ function Modal(_props) {
|
|
|
463
513
|
props.ref?.(instance);
|
|
464
514
|
}
|
|
465
515
|
});
|
|
466
|
-
const close = () => {
|
|
467
|
-
instance.close();
|
|
468
|
-
props.afterClose?.();
|
|
469
|
-
};
|
|
470
516
|
const [confirmLoading, setConfirmLoading] = createSignal(false);
|
|
471
517
|
return createComponent(Show, {
|
|
472
518
|
get when() {
|
|
@@ -478,7 +524,7 @@ function Modal(_props) {
|
|
|
478
524
|
const _el$ = _tmpl$5$1();
|
|
479
525
|
_el$.$$click = () => {
|
|
480
526
|
if (props.maskClosable ?? true) {
|
|
481
|
-
close();
|
|
527
|
+
instance.close();
|
|
482
528
|
}
|
|
483
529
|
};
|
|
484
530
|
insert(_el$, createComponent(Show, {
|
|
@@ -489,7 +535,7 @@ function Modal(_props) {
|
|
|
489
535
|
return props.modalRender();
|
|
490
536
|
},
|
|
491
537
|
get children() {
|
|
492
|
-
const _el$2 = _tmpl$4$
|
|
538
|
+
const _el$2 = _tmpl$4$5(),
|
|
493
539
|
_el$4 = _el$2.firstChild,
|
|
494
540
|
_el$5 = _el$4.nextSibling;
|
|
495
541
|
_el$2.$$click = e => {
|
|
@@ -505,9 +551,11 @@ function Modal(_props) {
|
|
|
505
551
|
get ["class"]() {
|
|
506
552
|
return cs('ant-rm-size-btn !ant-w-22px !ant-h-22px !ant-flex !ant-justify-center !ant-items-center ant-text-center ant-text-18px !ant-absolute !ant-top-16px !ant-right-16px ant-z-1000 ant-text-[rgba(0,0,0,.45)] hover:!ant-text-[rgba(0,0,0,.88)]');
|
|
507
553
|
},
|
|
508
|
-
onClick:
|
|
554
|
+
onClick: () => {
|
|
555
|
+
instance.close();
|
|
556
|
+
},
|
|
509
557
|
get children() {
|
|
510
|
-
return _tmpl$$
|
|
558
|
+
return _tmpl$$o();
|
|
511
559
|
}
|
|
512
560
|
});
|
|
513
561
|
}
|
|
@@ -519,7 +567,7 @@ function Modal(_props) {
|
|
|
519
567
|
return props.footer !== false;
|
|
520
568
|
},
|
|
521
569
|
get children() {
|
|
522
|
-
const _el$6 = _tmpl$3$
|
|
570
|
+
const _el$6 = _tmpl$3$8();
|
|
523
571
|
insert(_el$6, createComponent(Show, {
|
|
524
572
|
get when() {
|
|
525
573
|
return typeof props.footer !== 'function';
|
|
@@ -528,9 +576,11 @@ function Modal(_props) {
|
|
|
528
576
|
return memo(() => typeof props.footer === 'function')() && props.footer(instance);
|
|
529
577
|
},
|
|
530
578
|
get children() {
|
|
531
|
-
const _el$7 = _tmpl$2$
|
|
579
|
+
const _el$7 = _tmpl$2$c();
|
|
532
580
|
insert(_el$7, createComponent(Button, {
|
|
533
|
-
onClick:
|
|
581
|
+
onClick: () => {
|
|
582
|
+
instance.close();
|
|
583
|
+
},
|
|
534
584
|
children: "\u53D6\u6D88"
|
|
535
585
|
}), null);
|
|
536
586
|
insert(_el$7, createComponent(Button, {
|
|
@@ -619,10 +669,201 @@ Modal.warning = props => {
|
|
|
619
669
|
};
|
|
620
670
|
delegateEvents(["click"]);
|
|
621
671
|
|
|
622
|
-
|
|
672
|
+
var css_248z = ".ant-drawer-content-right {\n top: 0;\n bottom: 0;\n right: 0;\n}\n\n.ant-drawer-content-left {\n top: 0;\n bottom: 0;\n left: 0;\n}\n\n.ant-drawer-content-top {\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ant-drawer-content-bottom {\n bottom: 0;\n left: 0;\n right: 0;\n}\n\n.ant-drawer-fade-enter-active,\n.ant-drawer-fade-exit-active {\n transition: opacity 0.3s;\n}\n.ant-drawer-fade-enter-active .ant-drawer-content,\n.ant-drawer-fade-exit-active .ant-drawer-content {\n transition: transform 0.3s;\n}\n\n.ant-drawer-fade-enter,\n.ant-drawer-fade-exit-to {\n opacity: 0;\n}\n.ant-drawer-fade-enter .ant-drawer-content-right,\n.ant-drawer-fade-exit-to .ant-drawer-content-right {\n transform: translateX(100%);\n}\n.ant-drawer-fade-enter .ant-drawer-content-left,\n.ant-drawer-fade-exit-to .ant-drawer-content-left {\n transform: translateX(-100%);\n}\n.ant-drawer-fade-enter .ant-drawer-content-top,\n.ant-drawer-fade-exit-to .ant-drawer-content-top {\n transform: translateY(-100%);\n}\n.ant-drawer-fade-enter .ant-drawer-content-bottom,\n.ant-drawer-fade-exit-to .ant-drawer-content-bottom {\n transform: translateY(100%);\n}";
|
|
673
|
+
styleInject(css_248z);
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* dom 节点显示或隐藏时的动画
|
|
677
|
+
* @param target
|
|
678
|
+
* @param when
|
|
679
|
+
* @param className 动画类名
|
|
680
|
+
*/
|
|
681
|
+
function createTransition(target, when, className) {
|
|
682
|
+
createEffect(on(when, input => {
|
|
683
|
+
const targetValue = target();
|
|
684
|
+
if (!targetValue) return;
|
|
685
|
+
if (input) {
|
|
686
|
+
targetValue.style.display = '';
|
|
687
|
+
targetValue.classList.add(`${className}-enter-active`, `${className}-enter`, `${className}-enter-to`);
|
|
688
|
+
requestAnimationFrame(() => {
|
|
689
|
+
targetValue.classList.remove(`${className}-enter`);
|
|
690
|
+
});
|
|
691
|
+
const onTransitionEnd = () => {
|
|
692
|
+
targetValue.classList.remove(`${className}-enter-active`, `${className}-enter-to`);
|
|
693
|
+
targetValue.removeEventListener('transitionend', onTransitionEnd);
|
|
694
|
+
};
|
|
695
|
+
targetValue.addEventListener('transitionend', onTransitionEnd);
|
|
696
|
+
} else {
|
|
697
|
+
targetValue.classList.add(`${className}-exit-active`, `${className}-exit`, `${className}-exit-to`);
|
|
698
|
+
requestAnimationFrame(() => {
|
|
699
|
+
targetValue.classList.remove(`${className}-exit`);
|
|
700
|
+
});
|
|
701
|
+
const onTransitionEnd = () => {
|
|
702
|
+
targetValue.style.display = 'none';
|
|
703
|
+
targetValue.classList.remove(`${className}-exit-active`, `${className}-exit-to`);
|
|
704
|
+
targetValue.removeEventListener('transitionend', onTransitionEnd);
|
|
705
|
+
};
|
|
706
|
+
targetValue.addEventListener('transitionend', onTransitionEnd);
|
|
707
|
+
}
|
|
708
|
+
}));
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
const _tmpl$$n = /*#__PURE__*/template(`<span class="i-ant-design:close-outlined">`),
|
|
712
|
+
_tmpl$2$b = /*#__PURE__*/template(`<div><div><div class="ant-px-[var(--ant-padding-lg)] ant-py-[var(--ant-padding)] ant-flex ant-justify-between ant-items-center ant-[border-bottom:var(--ant-line-width)_solid_var(--ant-color-split)]"><div class="ant-flex ant-items-center"><span class="ant-text-[var(--ant-color-text)] ant-text-size-[var(--ant-font-size-lg)] ant-[font-weight:var(--ant-font-weight-strong)] ant-leading-[var(--ant-line-height-lg)]"></span></div><div></div></div><div class="ant-p-[var(--ant-padding-lg)] ant-overflow-auto">`);
|
|
713
|
+
const Drawer = _props => {
|
|
714
|
+
const props = mergeProps({
|
|
715
|
+
width: '378px',
|
|
716
|
+
height: '378px',
|
|
717
|
+
maskClosable: true,
|
|
718
|
+
placement: 'right',
|
|
719
|
+
getContainer: document.body
|
|
720
|
+
}, _props);
|
|
721
|
+
/**
|
|
722
|
+
* 控制是否打开/销毁
|
|
723
|
+
*/
|
|
724
|
+
const [open, setOpen] = createSignal(false);
|
|
725
|
+
/**
|
|
726
|
+
* 控制显隐
|
|
727
|
+
*/
|
|
728
|
+
const [hide, setHide] = createSignal(false);
|
|
729
|
+
let cleanup;
|
|
730
|
+
const container = createMemo(() => {
|
|
731
|
+
if (typeof props.getContainer === 'function') {
|
|
732
|
+
return props.getContainer();
|
|
733
|
+
}
|
|
734
|
+
if (props.getContainer instanceof HTMLElement) {
|
|
735
|
+
return props.getContainer;
|
|
736
|
+
}
|
|
737
|
+
return undefined;
|
|
738
|
+
});
|
|
739
|
+
const isBody = createMemo(() => container() === document.body);
|
|
740
|
+
const instance = {
|
|
741
|
+
open() {
|
|
742
|
+
setOpen(true);
|
|
743
|
+
setHide(false);
|
|
744
|
+
untrack(() => {
|
|
745
|
+
if (!isBody()) return;
|
|
746
|
+
const originOverflow = document.body.style.overflow;
|
|
747
|
+
document.body.style.overflow = 'hidden';
|
|
748
|
+
const onKeyup = e => {
|
|
749
|
+
if (e.key === 'Escape') {
|
|
750
|
+
instance.close();
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
document.addEventListener('keyup', onKeyup);
|
|
754
|
+
cleanup = () => {
|
|
755
|
+
document.body.style.overflow = originOverflow;
|
|
756
|
+
document.removeEventListener('keyup', onKeyup);
|
|
757
|
+
};
|
|
758
|
+
});
|
|
759
|
+
},
|
|
760
|
+
close() {
|
|
761
|
+
untrack(() => {
|
|
762
|
+
if (props.destroyOnClose) {
|
|
763
|
+
setOpen(false);
|
|
764
|
+
} else {
|
|
765
|
+
setHide(true);
|
|
766
|
+
}
|
|
767
|
+
cleanup?.();
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
setRef(props, instance);
|
|
772
|
+
let drawer;
|
|
773
|
+
createTransition(() => drawer, () => !hide(), 'ant-drawer-fade');
|
|
774
|
+
const direction = createMemo(() => ['top', 'bottom'].includes(props.placement) ? 'vertical' : 'horizontal');
|
|
775
|
+
const children = createComponent(Transition, {
|
|
776
|
+
name: "ant-drawer-fade",
|
|
777
|
+
get children() {
|
|
778
|
+
return createComponent(Show, {
|
|
779
|
+
get when() {
|
|
780
|
+
return open();
|
|
781
|
+
},
|
|
782
|
+
get children() {
|
|
783
|
+
const _el$ = _tmpl$2$b(),
|
|
784
|
+
_el$2 = _el$.firstChild,
|
|
785
|
+
_el$3 = _el$2.firstChild,
|
|
786
|
+
_el$4 = _el$3.firstChild,
|
|
787
|
+
_el$6 = _el$4.firstChild,
|
|
788
|
+
_el$7 = _el$4.nextSibling,
|
|
789
|
+
_el$8 = _el$3.nextSibling;
|
|
790
|
+
_el$.$$click = () => {
|
|
791
|
+
if (props.maskClosable) {
|
|
792
|
+
instance.close();
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
const _ref$ = drawer;
|
|
796
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : drawer = _el$;
|
|
797
|
+
_el$2.$$click = e => {
|
|
798
|
+
e.stopPropagation();
|
|
799
|
+
};
|
|
800
|
+
insert(_el$4, createComponent(Show, {
|
|
801
|
+
get when() {
|
|
802
|
+
return props.closeIcon !== false;
|
|
803
|
+
},
|
|
804
|
+
get children() {
|
|
805
|
+
return createComponent(Button, {
|
|
806
|
+
type: "text",
|
|
807
|
+
"class": "ant-mr-[var(--ant-margin-sm)] ant-text-size-[var(--ant-font-size-lg)] ant-h-[var(--ant-font-size-lg)] ant-leading-[var(--ant-font-size-lg)] hover:!ant-bg-transparent !ant-text-[var(--ant-color-icon)] hover:!ant-text-[var(--ant-color-icon-hover)] !ant-p-0",
|
|
808
|
+
onClick: () => {
|
|
809
|
+
instance?.close();
|
|
810
|
+
},
|
|
811
|
+
get children() {
|
|
812
|
+
return _tmpl$$n();
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
}), _el$6);
|
|
817
|
+
insert(_el$6, () => props.title);
|
|
818
|
+
insert(_el$7, () => props.extra);
|
|
819
|
+
insert(_el$8, () => props.children);
|
|
820
|
+
effect(_p$ => {
|
|
821
|
+
const _v$ = cs('ant-inset-0 ant-bg-[rgba(0,0,0,.45)] ant-z-1000', isBody() ? 'ant-fixed' : 'ant-absolute'),
|
|
822
|
+
_v$2 = cs('ant-drawer-content', {
|
|
823
|
+
left: 'ant-drawer-content-left',
|
|
824
|
+
right: 'ant-drawer-content-right',
|
|
825
|
+
top: 'ant-drawer-content-top',
|
|
826
|
+
bottom: 'ant-drawer-content-bottom'
|
|
827
|
+
}[props.placement], 'ant-absolute ant-bg-white ant-grid ant-[grid-template-rows:auto_1fr]'),
|
|
828
|
+
_v$3 = direction() === 'horizontal' ? props.width : undefined,
|
|
829
|
+
_v$4 = direction() === 'vertical' ? props.height : undefined;
|
|
830
|
+
_v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
|
|
831
|
+
_v$2 !== _p$._v$2 && className(_el$2, _p$._v$2 = _v$2);
|
|
832
|
+
_v$3 !== _p$._v$3 && ((_p$._v$3 = _v$3) != null ? _el$2.style.setProperty("width", _v$3) : _el$2.style.removeProperty("width"));
|
|
833
|
+
_v$4 !== _p$._v$4 && ((_p$._v$4 = _v$4) != null ? _el$2.style.setProperty("height", _v$4) : _el$2.style.removeProperty("height"));
|
|
834
|
+
return _p$;
|
|
835
|
+
}, {
|
|
836
|
+
_v$: undefined,
|
|
837
|
+
_v$2: undefined,
|
|
838
|
+
_v$3: undefined,
|
|
839
|
+
_v$4: undefined
|
|
840
|
+
});
|
|
841
|
+
return _el$;
|
|
842
|
+
}
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
return createComponent(Show, {
|
|
847
|
+
get when() {
|
|
848
|
+
return props.getContainer !== false;
|
|
849
|
+
},
|
|
850
|
+
fallback: children,
|
|
851
|
+
get children() {
|
|
852
|
+
return createComponent(Portal, {
|
|
853
|
+
get mount() {
|
|
854
|
+
return container();
|
|
855
|
+
},
|
|
856
|
+
children: children
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
});
|
|
860
|
+
};
|
|
861
|
+
delegateEvents(["click"]);
|
|
862
|
+
|
|
863
|
+
const _tmpl$$m = /*#__PURE__*/template(`<div role="ReactToSolid">`);
|
|
623
864
|
function ReactToSolid(props) {
|
|
624
865
|
let root;
|
|
625
|
-
const rootEle = createMemo(() => props.container ?? _tmpl$$
|
|
866
|
+
const rootEle = createMemo(() => props.container ?? _tmpl$$m());
|
|
626
867
|
onMount(() => {
|
|
627
868
|
root = createRoot(rootEle());
|
|
628
869
|
onCleanup(() => {
|
|
@@ -894,22 +1135,6 @@ function replaceClassName(C) {
|
|
|
894
1135
|
return createComponent(C, mergeProps$1(props));
|
|
895
1136
|
};
|
|
896
1137
|
}
|
|
897
|
-
/**
|
|
898
|
-
* 将组件 props 中的 children 替换为 JSXElement
|
|
899
|
-
* @param C
|
|
900
|
-
* @returns
|
|
901
|
-
*/
|
|
902
|
-
function replaceChildren(C) {
|
|
903
|
-
return function (_props) {
|
|
904
|
-
const props = createMemo(() => {
|
|
905
|
-
return {
|
|
906
|
-
..._props,
|
|
907
|
-
children: solidToReact(_props.children)
|
|
908
|
-
};
|
|
909
|
-
});
|
|
910
|
-
return createComponent(C, mergeProps$1(props));
|
|
911
|
-
};
|
|
912
|
-
}
|
|
913
1138
|
function reactToSolidComponent(component, container) {
|
|
914
1139
|
return function (props) {
|
|
915
1140
|
return createComponent(ReactToSolid, {
|
|
@@ -963,7 +1188,7 @@ function useClickAway(onClickAway, target) {
|
|
|
963
1188
|
});
|
|
964
1189
|
}
|
|
965
1190
|
|
|
966
|
-
const _tmpl$$
|
|
1191
|
+
const _tmpl$$l = /*#__PURE__*/template(`<div>`);
|
|
967
1192
|
const Content = props => {
|
|
968
1193
|
return createComponent(Show, {
|
|
969
1194
|
get when() {
|
|
@@ -1201,7 +1426,7 @@ const Tooltip = _props => {
|
|
|
1201
1426
|
get children() {
|
|
1202
1427
|
return createComponent(Portal, {
|
|
1203
1428
|
get children() {
|
|
1204
|
-
const _el$ = _tmpl$$
|
|
1429
|
+
const _el$ = _tmpl$$l();
|
|
1205
1430
|
_el$.$$click = e => {
|
|
1206
1431
|
e.stopPropagation();
|
|
1207
1432
|
};
|
|
@@ -1218,7 +1443,7 @@ const Tooltip = _props => {
|
|
|
1218
1443
|
return props.arrow;
|
|
1219
1444
|
},
|
|
1220
1445
|
get children() {
|
|
1221
|
-
const _el$2 = _tmpl$$
|
|
1446
|
+
const _el$2 = _tmpl$$l();
|
|
1222
1447
|
effect(_p$ => {
|
|
1223
1448
|
const _v$ = cs('ant-w-8px ant-h-8px ant-absolute ant-border-solid ant-border-4px ant-border-transparent'),
|
|
1224
1449
|
_v$2 = {
|
|
@@ -1256,10 +1481,10 @@ const Tooltip = _props => {
|
|
|
1256
1481
|
};
|
|
1257
1482
|
delegateEvents(["click"]);
|
|
1258
1483
|
|
|
1259
|
-
const _tmpl$$
|
|
1260
|
-
_tmpl$2$
|
|
1261
|
-
_tmpl$3$
|
|
1262
|
-
_tmpl$4$
|
|
1484
|
+
const _tmpl$$k = /*#__PURE__*/template(`<div>`),
|
|
1485
|
+
_tmpl$2$a = /*#__PURE__*/template(`<span class="i-ant-design:close-circle-filled ant-cursor-pointer ant-text-[var(--ant-clear-color)] hover:ant-text-[var(--ant-clear-color-hover)]">`),
|
|
1486
|
+
_tmpl$3$7 = /*#__PURE__*/template(`<div tabindex="0"><div class="ant-relative ant-h-full"><div class="ant-absolute ant-top-0 ant-bottom-0 ant-right-0">`),
|
|
1487
|
+
_tmpl$4$4 = /*#__PURE__*/template(`<div class="ant-bg-white ant-w-200px">`),
|
|
1263
1488
|
_tmpl$5 = /*#__PURE__*/template(`<input class="ant-h-full ant-w-full ant-float-left ant-[outline:none]" readonly>`),
|
|
1264
1489
|
_tmpl$6 = /*#__PURE__*/template(`<span class="i-ant-design:down-outlined ant-text-[var(--ant-allow-color)]">`);
|
|
1265
1490
|
const Select = props => {
|
|
@@ -1285,19 +1510,19 @@ const Select = props => {
|
|
|
1285
1510
|
padding: 0
|
|
1286
1511
|
},
|
|
1287
1512
|
content: close => (() => {
|
|
1288
|
-
const _el$6 = _tmpl$4$
|
|
1513
|
+
const _el$6 = _tmpl$4$4();
|
|
1289
1514
|
insert(_el$6, createComponent(For, {
|
|
1290
1515
|
get each() {
|
|
1291
1516
|
return props.options;
|
|
1292
1517
|
},
|
|
1293
1518
|
children: item => (() => {
|
|
1294
|
-
const _el$7 = _tmpl$$
|
|
1519
|
+
const _el$7 = _tmpl$$k();
|
|
1295
1520
|
_el$7.$$click = () => {
|
|
1296
1521
|
setValue(item.value);
|
|
1297
1522
|
close();
|
|
1298
1523
|
};
|
|
1299
1524
|
insert(_el$7, () => item.label);
|
|
1300
|
-
effect(() => className(_el$7, cs('ant-box-content ant-px-12px ant-py-5px ant-h-22px ant-leading-22px hover:ant-bg-[var(--hover-bg-color)]', selectedValue(item.value) ? '!ant-bg-[var(--
|
|
1525
|
+
effect(() => className(_el$7, cs('ant-box-content ant-px-12px ant-py-5px ant-h-22px ant-leading-22px hover:ant-bg-[var(--hover-bg-color)]', selectedValue(item.value) ? '!ant-bg-[var(--ant-select-option-selected-bg)]' : '')));
|
|
1301
1526
|
return _el$7;
|
|
1302
1527
|
})()
|
|
1303
1528
|
}));
|
|
@@ -1305,7 +1530,7 @@ const Select = props => {
|
|
|
1305
1530
|
return _el$6;
|
|
1306
1531
|
})(),
|
|
1307
1532
|
get children() {
|
|
1308
|
-
const _el$ = _tmpl$3$
|
|
1533
|
+
const _el$ = _tmpl$3$7(),
|
|
1309
1534
|
_el$2 = _el$.firstChild,
|
|
1310
1535
|
_el$4 = _el$2.firstChild;
|
|
1311
1536
|
_el$.addEventListener("mouseleave", () => setHover(false));
|
|
@@ -1332,7 +1557,7 @@ const Select = props => {
|
|
|
1332
1557
|
})();
|
|
1333
1558
|
},
|
|
1334
1559
|
get children() {
|
|
1335
|
-
const _el$3 = _tmpl$$
|
|
1560
|
+
const _el$3 = _tmpl$$k();
|
|
1336
1561
|
insert(_el$3, () => selectedOption().label ?? value());
|
|
1337
1562
|
return _el$3;
|
|
1338
1563
|
}
|
|
@@ -1345,7 +1570,7 @@ const Select = props => {
|
|
|
1345
1570
|
return _tmpl$6();
|
|
1346
1571
|
},
|
|
1347
1572
|
get children() {
|
|
1348
|
-
const _el$5 = _tmpl$2$
|
|
1573
|
+
const _el$5 = _tmpl$2$a();
|
|
1349
1574
|
_el$5.$$click = e => {
|
|
1350
1575
|
e.stopPropagation();
|
|
1351
1576
|
setValue(undefined);
|
|
@@ -1353,17 +1578,17 @@ const Select = props => {
|
|
|
1353
1578
|
return _el$5;
|
|
1354
1579
|
}
|
|
1355
1580
|
}));
|
|
1356
|
-
effect(() => className(_el$, cs('ant-h-32px ant-leading-32px ant-rounded-6px ant-[border:1px_solid_var(--ant-color-border)] ant-px-11px focus:ant-[border-color:var(--
|
|
1581
|
+
effect(() => className(_el$, cs('ant-h-32px ant-leading-32px ant-rounded-6px ant-[border:1px_solid_var(--ant-color-border)] ant-px-11px focus:ant-[border-color:var(--ant-color-primary)]', props.class)));
|
|
1357
1582
|
return _el$;
|
|
1358
1583
|
}
|
|
1359
1584
|
});
|
|
1360
1585
|
};
|
|
1361
1586
|
delegateEvents(["click"]);
|
|
1362
1587
|
|
|
1363
|
-
const _tmpl$$
|
|
1364
|
-
_tmpl$2$
|
|
1365
|
-
_tmpl$3$
|
|
1366
|
-
_tmpl$4$
|
|
1588
|
+
const _tmpl$$j = /*#__PURE__*/template(`<span class="i-ant-design:minus-square-outlined">`),
|
|
1589
|
+
_tmpl$2$9 = /*#__PURE__*/template(`<div><div class="flex-shrink-0" role="indent"></div><div class="ant-flex-shrink-0 ant-w-24px ant-h-24px ant-flex ant-items-center ant-justify-center"><span class="i-ant-design:holder-outlined"></span></div><div></div><div>`),
|
|
1590
|
+
_tmpl$3$6 = /*#__PURE__*/template(`<span class="ant-inline-block ant-w-24px">`),
|
|
1591
|
+
_tmpl$4$3 = /*#__PURE__*/template(`<span class="i-ant-design:plus-square-outlined">`);
|
|
1367
1592
|
const TreeContext = createContext({});
|
|
1368
1593
|
/**
|
|
1369
1594
|
* 单层级 tree
|
|
@@ -1393,7 +1618,7 @@ function SingleLevelTree(props) {
|
|
|
1393
1618
|
children: (item, i) => {
|
|
1394
1619
|
const indexes = [...(props.parentIndexes ?? []), i];
|
|
1395
1620
|
return [(() => {
|
|
1396
|
-
const _el$ = _tmpl$2$
|
|
1621
|
+
const _el$ = _tmpl$2$9(),
|
|
1397
1622
|
_el$2 = _el$.firstChild,
|
|
1398
1623
|
_el$3 = _el$2.nextSibling,
|
|
1399
1624
|
_el$4 = _el$3.nextSibling,
|
|
@@ -1427,21 +1652,21 @@ function SingleLevelTree(props) {
|
|
|
1427
1652
|
setDraggableIndexes(indexes);
|
|
1428
1653
|
});
|
|
1429
1654
|
setAttribute(_el$, "draggable", draggable);
|
|
1430
|
-
insert(_el$2, () => Array(props.indent).fill(0).map(() => _tmpl$3$
|
|
1655
|
+
insert(_el$2, () => Array(props.indent).fill(0).map(() => _tmpl$3$6()));
|
|
1431
1656
|
insert(_el$4, createComponent(Show, {
|
|
1432
1657
|
get when() {
|
|
1433
1658
|
return expanded();
|
|
1434
1659
|
},
|
|
1435
1660
|
get fallback() {
|
|
1436
1661
|
return (() => {
|
|
1437
|
-
const _el$8 = _tmpl$4$
|
|
1662
|
+
const _el$8 = _tmpl$4$3();
|
|
1438
1663
|
_el$8.$$click = setExpanded;
|
|
1439
1664
|
_el$8.$$clickData = true;
|
|
1440
1665
|
return _el$8;
|
|
1441
1666
|
})();
|
|
1442
1667
|
},
|
|
1443
1668
|
get children() {
|
|
1444
|
-
const _el$5 = _tmpl$$
|
|
1669
|
+
const _el$5 = _tmpl$$j();
|
|
1445
1670
|
_el$5.$$click = setExpanded;
|
|
1446
1671
|
_el$5.$$clickData = false;
|
|
1447
1672
|
return _el$5;
|
|
@@ -1455,9 +1680,9 @@ function SingleLevelTree(props) {
|
|
|
1455
1680
|
indexes
|
|
1456
1681
|
}));
|
|
1457
1682
|
effect(_p$ => {
|
|
1458
|
-
const _v$ = cs('ant-flex ant-items-center ant-h-28px ant-pb-4px', isDraggable(item()) && 'ant-[border:1px_solid_var(--
|
|
1683
|
+
const _v$ = cs('ant-flex ant-items-center ant-h-28px ant-pb-4px', isDraggable(item()) && 'ant-[border:1px_solid_var(--ant-color-primary)] ant-bg-white', draggableNode() && 'child[]:ant-pointer-events-none'),
|
|
1459
1684
|
_v$2 = cs('ant-flex-shrink-0 ant-w-24px ant-h-24px ant-flex ant-items-center ant-justify-center ant-cursor-pointer', isEmpty(props.children(item())) && 'opacity-0'),
|
|
1460
|
-
_v$3 = cs('ant-h-full ant-leading-24px hover:ant-bg-[var(--hover-bg-color)] ant-rounded-1 ant-px-1 ant-cursor-pointer ant-relative', props.blockNode && 'w-full', selectedNodes()?.includes(item()) && '!ant-bg-[var(--
|
|
1685
|
+
_v$3 = cs('ant-h-full ant-leading-24px hover:ant-bg-[var(--hover-bg-color)] ant-rounded-1 ant-px-1 ant-cursor-pointer ant-relative', props.blockNode && 'w-full', selectedNodes()?.includes(item()) && '!ant-bg-[var(--ant-tree-node-selected-bg)]', isTarget(item()) && "before:ant-content-[''] before:ant-inline-block before:ant-w-8px before:ant-h-8px before:ant-absolute before:ant-bottom-0 before:ant-left-0 before:-ant-translate-x-full before:ant-translate-y-1/2 before:ant-rounded-1/2 before:ant-[border:2px_solid_var(--ant-color-primary)] after:ant-content-[''] after:ant-inline-block after:ant-h-2px after:ant-absolute after:ant-left-0 after:ant-right-0 after:ant-bottom--1px after:ant-bg-[var(--ant-color-primary)]");
|
|
1461
1686
|
_v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
|
|
1462
1687
|
_v$2 !== _p$._v$2 && className(_el$4, _p$._v$2 = _v$2);
|
|
1463
1688
|
_v$3 !== _p$._v$3 && className(_el$6, _p$._v$3 = _v$3);
|
|
@@ -1552,21 +1777,21 @@ function Tree(props) {
|
|
|
1552
1777
|
}
|
|
1553
1778
|
delegateEvents(["click"]);
|
|
1554
1779
|
|
|
1555
|
-
const _tmpl$$
|
|
1556
|
-
_tmpl$2$
|
|
1780
|
+
const _tmpl$$i = /*#__PURE__*/template(`<div class="ant-mb-8px ant-flex ant-items-center"><span class="ant-text-[rgba(0,0,0,0.88)] ant-font-600">`),
|
|
1781
|
+
_tmpl$2$8 = /*#__PURE__*/template(`<div><div class="ant-text-[rgba(0,0,0,0.88)]">`);
|
|
1557
1782
|
const Popover = props => {
|
|
1558
1783
|
return createComponent(Tooltip, mergeProps$1({
|
|
1559
1784
|
mode: "light"
|
|
1560
1785
|
}, props, {
|
|
1561
1786
|
content: close => (() => {
|
|
1562
|
-
const _el$ = _tmpl$2$
|
|
1787
|
+
const _el$ = _tmpl$2$8(),
|
|
1563
1788
|
_el$4 = _el$.firstChild;
|
|
1564
1789
|
insert(_el$, createComponent(Show, {
|
|
1565
1790
|
get when() {
|
|
1566
1791
|
return props.title;
|
|
1567
1792
|
},
|
|
1568
1793
|
get children() {
|
|
1569
|
-
const _el$2 = _tmpl$$
|
|
1794
|
+
const _el$2 = _tmpl$$i(),
|
|
1570
1795
|
_el$3 = _el$2.firstChild;
|
|
1571
1796
|
insert(_el$3, () => props.title);
|
|
1572
1797
|
return _el$2;
|
|
@@ -1585,16 +1810,16 @@ const Popover = props => {
|
|
|
1585
1810
|
|
|
1586
1811
|
var ColorPicker = reactToSolidComponent(ColorPicker$1);
|
|
1587
1812
|
|
|
1588
|
-
const _tmpl$$
|
|
1813
|
+
const _tmpl$$h = /*#__PURE__*/template(`<div class="ant-text-center ant-px-32px ant-py-48px"><div class="ant-mb-24px"><span></span></div><div class="ant-my-8px ant-text-[rgba(0,0,0,.88)] ant-text-24px"></div><div class="ant-text-[rgba(0,0,0,.45)] ant-text-14px"></div><div class="ant-mt-24px"></div><div class="ant-mt-24px">`);
|
|
1589
1814
|
const statusIconMap = {
|
|
1590
1815
|
success: 'ant-text-#52c41a i-ant-design:check-circle-filled',
|
|
1591
|
-
info: 'ant-text-[var(--
|
|
1816
|
+
info: 'ant-text-[var(--ant-color-primary)] i-ant-design:exclamation-circle-filled',
|
|
1592
1817
|
warning: 'ant-text-#faad14 i-ant-design:warning-filled',
|
|
1593
1818
|
error: 'ant-text-#ff4d4f i-ant-design:close-circle-filled'
|
|
1594
1819
|
};
|
|
1595
1820
|
const Result = props => {
|
|
1596
1821
|
return (() => {
|
|
1597
|
-
const _el$ = _tmpl$$
|
|
1822
|
+
const _el$ = _tmpl$$h(),
|
|
1598
1823
|
_el$2 = _el$.firstChild,
|
|
1599
1824
|
_el$3 = _el$2.firstChild,
|
|
1600
1825
|
_el$4 = _el$2.nextSibling,
|
|
@@ -1610,9 +1835,83 @@ const Result = props => {
|
|
|
1610
1835
|
})();
|
|
1611
1836
|
};
|
|
1612
1837
|
|
|
1613
|
-
|
|
1838
|
+
const _tmpl$$g = /*#__PURE__*/template(`<span class="i-ant-design:check-circle-filled ant-text-[var(--ant-color-success)]">`),
|
|
1839
|
+
_tmpl$2$7 = /*#__PURE__*/template(`<span class="i-ant-design:close-circle-filled ant-text-[var(--ant-color-error)]">`),
|
|
1840
|
+
_tmpl$3$5 = /*#__PURE__*/template(`<span class="ant-shrink-0 ant-min-w-40px ant-ml-8px ant-text-center">`),
|
|
1841
|
+
_tmpl$4$2 = /*#__PURE__*/template(`<div class="ant-flex ant-items-center"><div>`);
|
|
1842
|
+
const Progress = _props => {
|
|
1843
|
+
const props = mergeProps({
|
|
1844
|
+
percent: 0,
|
|
1845
|
+
height: 8,
|
|
1846
|
+
showInfo: true
|
|
1847
|
+
}, _props);
|
|
1848
|
+
const status = createMemo(() => {
|
|
1849
|
+
if (props.status) return props.status;
|
|
1850
|
+
return props.percent >= 100 ? 'success' : 'normal';
|
|
1851
|
+
});
|
|
1852
|
+
return (() => {
|
|
1853
|
+
const _el$ = _tmpl$4$2(),
|
|
1854
|
+
_el$2 = _el$.firstChild;
|
|
1855
|
+
_el$.style.setProperty("--ant-progress-remaining-color", "rgba(0, 0, 0, 0.06)");
|
|
1856
|
+
insert(_el$, createComponent(Show, {
|
|
1857
|
+
get when() {
|
|
1858
|
+
return props.showInfo;
|
|
1859
|
+
},
|
|
1860
|
+
get children() {
|
|
1861
|
+
const _el$3 = _tmpl$3$5();
|
|
1862
|
+
insert(_el$3, createComponent(Switch$1, {
|
|
1863
|
+
get fallback() {
|
|
1864
|
+
return `${props.percent}%`;
|
|
1865
|
+
},
|
|
1866
|
+
get children() {
|
|
1867
|
+
return [createComponent(Match, {
|
|
1868
|
+
get when() {
|
|
1869
|
+
return status() === 'success';
|
|
1870
|
+
},
|
|
1871
|
+
get children() {
|
|
1872
|
+
return _tmpl$$g();
|
|
1873
|
+
}
|
|
1874
|
+
}), createComponent(Match, {
|
|
1875
|
+
get when() {
|
|
1876
|
+
return status() === 'error';
|
|
1877
|
+
},
|
|
1878
|
+
get children() {
|
|
1879
|
+
return _tmpl$2$7();
|
|
1880
|
+
}
|
|
1881
|
+
})];
|
|
1882
|
+
}
|
|
1883
|
+
}));
|
|
1884
|
+
return _el$3;
|
|
1885
|
+
}
|
|
1886
|
+
}), null);
|
|
1887
|
+
effect(_p$ => {
|
|
1888
|
+
const _v$ = cs('ant-w-full ant-bg-[var(--ant-progress-remaining-color)]', 'before:ant-content-empty before:ant-block before:ant-bg-[var(--color)] before:ant-w-[var(--percent)] before:ant-h-full before:ant-rounded-inherit'),
|
|
1889
|
+
_v$2 = `${props.height}px`,
|
|
1890
|
+
_v$3 = `${props.height / 2}px`,
|
|
1891
|
+
_v$4 = `${props.percent}%`,
|
|
1892
|
+
_v$5 = {
|
|
1893
|
+
normal: 'var(--ant-color-primary)',
|
|
1894
|
+
success: 'var(--ant-color-success)',
|
|
1895
|
+
error: 'var(--ant-color-error)'
|
|
1896
|
+
}[status()];
|
|
1897
|
+
_v$ !== _p$._v$ && className(_el$2, _p$._v$ = _v$);
|
|
1898
|
+
_v$2 !== _p$._v$2 && ((_p$._v$2 = _v$2) != null ? _el$2.style.setProperty("height", _v$2) : _el$2.style.removeProperty("height"));
|
|
1899
|
+
_v$3 !== _p$._v$3 && ((_p$._v$3 = _v$3) != null ? _el$2.style.setProperty("border-radius", _v$3) : _el$2.style.removeProperty("border-radius"));
|
|
1900
|
+
_v$4 !== _p$._v$4 && ((_p$._v$4 = _v$4) != null ? _el$2.style.setProperty("--percent", _v$4) : _el$2.style.removeProperty("--percent"));
|
|
1901
|
+
_v$5 !== _p$._v$5 && ((_p$._v$5 = _v$5) != null ? _el$2.style.setProperty("--color", _v$5) : _el$2.style.removeProperty("--color"));
|
|
1902
|
+
return _p$;
|
|
1903
|
+
}, {
|
|
1904
|
+
_v$: undefined,
|
|
1905
|
+
_v$2: undefined,
|
|
1906
|
+
_v$3: undefined,
|
|
1907
|
+
_v$4: undefined,
|
|
1908
|
+
_v$5: undefined
|
|
1909
|
+
});
|
|
1910
|
+
return _el$;
|
|
1911
|
+
})();
|
|
1912
|
+
};
|
|
1614
1913
|
|
|
1615
|
-
const _tmpl$$
|
|
1914
|
+
const _tmpl$$f = /*#__PURE__*/template(`<div>`),
|
|
1616
1915
|
_tmpl$2$6 = /*#__PURE__*/template(`<div><div>`);
|
|
1617
1916
|
const unWarpValue = value => typeof value === 'object' ? value.value : value;
|
|
1618
1917
|
const Segmented = props => {
|
|
@@ -1625,7 +1924,7 @@ const Segmented = props => {
|
|
|
1625
1924
|
return typeof v === 'object' ? v.disabled : false;
|
|
1626
1925
|
};
|
|
1627
1926
|
return (() => {
|
|
1628
|
-
const _el$ = _tmpl$$
|
|
1927
|
+
const _el$ = _tmpl$$f();
|
|
1629
1928
|
insert(_el$, createComponent(For, {
|
|
1630
1929
|
get each() {
|
|
1631
1930
|
return props.options;
|
|
@@ -1677,7 +1976,7 @@ const Segmented = props => {
|
|
|
1677
1976
|
};
|
|
1678
1977
|
delegateEvents(["click"]);
|
|
1679
1978
|
|
|
1680
|
-
const _tmpl$$
|
|
1979
|
+
const _tmpl$$e = /*#__PURE__*/template(`<div><div role="selected-bar" class="ant-absolute ant-bottom-0 ant-bg-[var(--ant-color-primary)] ant-h-2px ant-transition-left">`),
|
|
1681
1980
|
_tmpl$2$5 = /*#__PURE__*/template(`<div><div>`),
|
|
1682
1981
|
_tmpl$3$4 = /*#__PURE__*/template(`<div>`);
|
|
1683
1982
|
const Tabs = _props => {
|
|
@@ -1721,7 +2020,7 @@ const Tabs = _props => {
|
|
|
1721
2020
|
return props.type === 'line';
|
|
1722
2021
|
},
|
|
1723
2022
|
get children() {
|
|
1724
|
-
const _el$2 = _tmpl$$
|
|
2023
|
+
const _el$2 = _tmpl$$e(),
|
|
1725
2024
|
_el$3 = _el$2.firstChild;
|
|
1726
2025
|
const _ref$ = nav;
|
|
1727
2026
|
typeof _ref$ === "function" ? use(_ref$, _el$2) : nav = _el$2;
|
|
@@ -1736,7 +2035,7 @@ const Tabs = _props => {
|
|
|
1736
2035
|
updateSelectedBarStyle();
|
|
1737
2036
|
};
|
|
1738
2037
|
insert(_el$5, () => unwrapStringOrJSXElement(item.label));
|
|
1739
|
-
effect(() => className(_el$5, cs('ant-py-12px ant-cursor-pointer', props.navItemClass, isSelectedItem(item.key) && 'ant-text-[var(--
|
|
2038
|
+
effect(() => className(_el$5, cs('ant-py-12px ant-cursor-pointer', props.navItemClass, isSelectedItem(item.key) && 'ant-text-[var(--ant-color-primary)] selected')));
|
|
1740
2039
|
return _el$5;
|
|
1741
2040
|
})()
|
|
1742
2041
|
}), _el$3);
|
|
@@ -1787,7 +2086,7 @@ const Tabs = _props => {
|
|
|
1787
2086
|
};
|
|
1788
2087
|
delegateEvents(["click"]);
|
|
1789
2088
|
|
|
1790
|
-
const _tmpl$$
|
|
2089
|
+
const _tmpl$$d = /*#__PURE__*/template(`<div><div class="ant-mb-8px ant-flex ant-items-center"><span class="i-ant-design:exclamation-circle-fill ant-text-#faad14"></span><span class="ant-ml-8px ant-text-[rgba(0,0,0,0.88)] ant-font-600"></span></div><div class="ant-ml-22px ant-mb-8px ant-text-[rgba(0,0,0,0.88)]"></div><div class="ant-text-right">`);
|
|
1791
2090
|
const Popconfirm = props => {
|
|
1792
2091
|
const mergedProps = mergeProps({
|
|
1793
2092
|
okText: '确定',
|
|
@@ -1804,7 +2103,7 @@ const Popconfirm = props => {
|
|
|
1804
2103
|
onOpenChange: setOpen,
|
|
1805
2104
|
get content() {
|
|
1806
2105
|
return (() => {
|
|
1807
|
-
const _el$ = _tmpl$$
|
|
2106
|
+
const _el$ = _tmpl$$d(),
|
|
1808
2107
|
_el$2 = _el$.firstChild,
|
|
1809
2108
|
_el$3 = _el$2.firstChild,
|
|
1810
2109
|
_el$4 = _el$3.nextSibling,
|
|
@@ -1845,9 +2144,98 @@ const Popconfirm = props => {
|
|
|
1845
2144
|
}));
|
|
1846
2145
|
};
|
|
1847
2146
|
|
|
1848
|
-
const
|
|
2147
|
+
const _tmpl$$c = /*#__PURE__*/template(`<span><input class="hidden" type="file">`);
|
|
2148
|
+
function request(file, customRequest) {
|
|
2149
|
+
const id = `upload-${nanoid()}`;
|
|
2150
|
+
// eslint-disable-next-line solid/reactivity
|
|
2151
|
+
const uploadFileSignal = createSignal({
|
|
2152
|
+
id,
|
|
2153
|
+
file,
|
|
2154
|
+
name: file.name,
|
|
2155
|
+
type: file.type,
|
|
2156
|
+
size: file.size,
|
|
2157
|
+
status: 'pending',
|
|
2158
|
+
percent: 0
|
|
2159
|
+
});
|
|
2160
|
+
const [, setUploadFile] = uploadFileSignal;
|
|
2161
|
+
customRequest?.({
|
|
2162
|
+
file,
|
|
2163
|
+
onProgress(event) {
|
|
2164
|
+
setUploadFile(value => ({
|
|
2165
|
+
...value,
|
|
2166
|
+
status: 'uploading',
|
|
2167
|
+
percent: event.percent ?? 0
|
|
2168
|
+
}));
|
|
2169
|
+
},
|
|
2170
|
+
onSuccess(response) {
|
|
2171
|
+
setUploadFile(value => ({
|
|
2172
|
+
...value,
|
|
2173
|
+
status: 'finished',
|
|
2174
|
+
response
|
|
2175
|
+
}));
|
|
2176
|
+
},
|
|
2177
|
+
onError() {
|
|
2178
|
+
setUploadFile(value => ({
|
|
2179
|
+
...value,
|
|
2180
|
+
status: 'error'
|
|
2181
|
+
}));
|
|
2182
|
+
}
|
|
2183
|
+
});
|
|
2184
|
+
return uploadFileSignal;
|
|
2185
|
+
}
|
|
2186
|
+
const Upload = _props => {
|
|
2187
|
+
let input;
|
|
2188
|
+
const props = mergeProps({
|
|
2189
|
+
customRequest: ({
|
|
2190
|
+
file,
|
|
2191
|
+
onSuccess,
|
|
2192
|
+
onError
|
|
2193
|
+
}) => {
|
|
2194
|
+
if (!_props.action) return;
|
|
2195
|
+
const formData = new FormData();
|
|
2196
|
+
formData.append('file', file);
|
|
2197
|
+
fetch(_props.action, {
|
|
2198
|
+
method: _props.method ?? 'post',
|
|
2199
|
+
body: formData
|
|
2200
|
+
}).then(onSuccess).catch(onError);
|
|
2201
|
+
}
|
|
2202
|
+
}, _props);
|
|
2203
|
+
return (() => {
|
|
2204
|
+
const _el$ = _tmpl$$c(),
|
|
2205
|
+
_el$2 = _el$.firstChild;
|
|
2206
|
+
_el$.$$click = () => input?.click();
|
|
2207
|
+
insert(_el$, () => props.children, _el$2);
|
|
2208
|
+
_el$2.$$input = e => {
|
|
2209
|
+
const fileList = [];
|
|
2210
|
+
for (const file of e.target.files ?? []) {
|
|
2211
|
+
const uploadFileSignal = request(file, props.customRequest);
|
|
2212
|
+
fileList.push(uploadFileSignal);
|
|
2213
|
+
}
|
|
2214
|
+
props.onAdd?.(fileList);
|
|
2215
|
+
e.target.value = '';
|
|
2216
|
+
};
|
|
2217
|
+
const _ref$ = input;
|
|
2218
|
+
typeof _ref$ === "function" ? use(_ref$, _el$2) : input = _el$2;
|
|
2219
|
+
effect(_p$ => {
|
|
2220
|
+
const _v$ = props.class,
|
|
2221
|
+
_v$2 = props.accept,
|
|
2222
|
+
_v$3 = props.multiple;
|
|
2223
|
+
_v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
|
|
2224
|
+
_v$2 !== _p$._v$2 && setAttribute(_el$2, "accept", _p$._v$2 = _v$2);
|
|
2225
|
+
_v$3 !== _p$._v$3 && (_el$2.multiple = _p$._v$3 = _v$3);
|
|
2226
|
+
return _p$;
|
|
2227
|
+
}, {
|
|
2228
|
+
_v$: undefined,
|
|
2229
|
+
_v$2: undefined,
|
|
2230
|
+
_v$3: undefined
|
|
2231
|
+
});
|
|
2232
|
+
return _el$;
|
|
2233
|
+
})();
|
|
2234
|
+
};
|
|
2235
|
+
Upload.request = request;
|
|
2236
|
+
delegateEvents(["click", "input"]);
|
|
1849
2237
|
|
|
1850
|
-
const _tmpl$$b = /*#__PURE__*/template(`<label class="ant-inline-flex ant-gap-4px"><input type="radio">`),
|
|
2238
|
+
const _tmpl$$b = /*#__PURE__*/template(`<label class="ant-inline-flex ant-gap-4px ant-cursor-pointer ant-inline-flex ant-items-center"><span><input class="ant-m-0 ant-hidden" type="radio">`),
|
|
1851
2239
|
_tmpl$2$4 = /*#__PURE__*/template(`<label><input class="ant-w-0 ant-h-0" type="radio">`),
|
|
1852
2240
|
_tmpl$3$3 = /*#__PURE__*/template(`<div>`);
|
|
1853
2241
|
const Radio = props => {
|
|
@@ -1855,18 +2243,20 @@ const Radio = props => {
|
|
|
1855
2243
|
defaultValue: false,
|
|
1856
2244
|
defaultValuePropName: 'defaultChecked',
|
|
1857
2245
|
valuePropName: 'checked',
|
|
1858
|
-
trigger:
|
|
2246
|
+
trigger: null
|
|
1859
2247
|
});
|
|
1860
2248
|
return (() => {
|
|
1861
2249
|
const _el$ = _tmpl$$b(),
|
|
1862
|
-
_el$2 = _el$.firstChild
|
|
1863
|
-
|
|
2250
|
+
_el$2 = _el$.firstChild,
|
|
2251
|
+
_el$3 = _el$2.firstChild;
|
|
2252
|
+
_el$3.$$input = e => {
|
|
1864
2253
|
setChecked(e.target.checked);
|
|
1865
2254
|
untrack(() => props.onChange?.(e));
|
|
1866
2255
|
};
|
|
1867
2256
|
insert(_el$, () => props.children, null);
|
|
1868
|
-
effect(() => _el$2
|
|
1869
|
-
effect(() => _el$
|
|
2257
|
+
effect(() => className(_el$2, cs('ant-w-16px ant-h-16px ant-rounded-50% ant-[border:1px_solid_var(--ant-color-border)]', checked() && 'ant-[border:5px_solid_var(--ant-color-primary)]')));
|
|
2258
|
+
effect(() => _el$3.checked = checked());
|
|
2259
|
+
effect(() => _el$3.value = props.value ?? '');
|
|
1870
2260
|
return _el$;
|
|
1871
2261
|
})();
|
|
1872
2262
|
};
|
|
@@ -1875,20 +2265,20 @@ Radio.Button = props => {
|
|
|
1875
2265
|
defaultValue: false,
|
|
1876
2266
|
defaultValuePropName: 'defaultChecked',
|
|
1877
2267
|
valuePropName: 'checked',
|
|
1878
|
-
trigger:
|
|
2268
|
+
trigger: null
|
|
1879
2269
|
});
|
|
1880
2270
|
return (() => {
|
|
1881
|
-
const _el$
|
|
1882
|
-
_el$
|
|
1883
|
-
_el$
|
|
2271
|
+
const _el$4 = _tmpl$2$4(),
|
|
2272
|
+
_el$5 = _el$4.firstChild;
|
|
2273
|
+
_el$5.$$input = e => {
|
|
1884
2274
|
setChecked(e.target.checked);
|
|
1885
2275
|
untrack(() => props.onChange?.(e));
|
|
1886
2276
|
};
|
|
1887
|
-
insert(_el$
|
|
1888
|
-
effect(() => className(_el$
|
|
1889
|
-
effect(() => _el$
|
|
1890
|
-
effect(() => _el$
|
|
1891
|
-
return _el$
|
|
2277
|
+
insert(_el$4, () => props.children, null);
|
|
2278
|
+
effect(() => className(_el$4, cs('ant-px-15px ant-[border:1px_solid_rgb(217,217,217)] first:ant-rounded-l-6px last:ant-rounded-r-6px ant-h-32px ant-inline-flex ant-items-center hover:ant-text-[var(--ant-color-primary)] not[:last-child]:ant-border-r-transparent ant-cursor-pointer ant-flex-grow ant-justify-center', checked() && 'ant-text-[var(--ant-color-primary)] ant-[border:1px_solid_var(--ant-color-primary)] !ant-border-r-[var(--ant-color-primary)]')));
|
|
2279
|
+
effect(() => _el$5.checked = checked());
|
|
2280
|
+
effect(() => _el$5.value = props.value ?? '');
|
|
2281
|
+
return _el$4;
|
|
1892
2282
|
})();
|
|
1893
2283
|
};
|
|
1894
2284
|
Radio.Group = _props => {
|
|
@@ -1896,12 +2286,12 @@ Radio.Group = _props => {
|
|
|
1896
2286
|
optionType: 'default'
|
|
1897
2287
|
}, _props);
|
|
1898
2288
|
const [value, setValue] = createControllableValue(props, {
|
|
1899
|
-
trigger:
|
|
2289
|
+
trigger: null
|
|
1900
2290
|
});
|
|
1901
2291
|
const isChecked = createSelector(value);
|
|
1902
2292
|
return (() => {
|
|
1903
|
-
const _el$
|
|
1904
|
-
insert(_el$
|
|
2293
|
+
const _el$6 = _tmpl$3$3();
|
|
2294
|
+
insert(_el$6, createComponent(For, {
|
|
1905
2295
|
get each() {
|
|
1906
2296
|
return props.options;
|
|
1907
2297
|
},
|
|
@@ -1917,15 +2307,17 @@ Radio.Group = _props => {
|
|
|
1917
2307
|
},
|
|
1918
2308
|
onChange: e => {
|
|
1919
2309
|
setValue(option.value);
|
|
1920
|
-
untrack(() =>
|
|
2310
|
+
untrack(() => {
|
|
2311
|
+
props.onChange?.(e);
|
|
2312
|
+
});
|
|
1921
2313
|
},
|
|
1922
2314
|
get children() {
|
|
1923
2315
|
return option.label;
|
|
1924
2316
|
}
|
|
1925
2317
|
})
|
|
1926
2318
|
}));
|
|
1927
|
-
effect(() => className(_el$
|
|
1928
|
-
return _el$
|
|
2319
|
+
effect(() => className(_el$6, cs(props.block ? 'ant-flex' : 'ant-inline-flex', props.optionType === 'default' ? 'ant-gap-8px' : '')));
|
|
2320
|
+
return _el$6;
|
|
1929
2321
|
})();
|
|
1930
2322
|
};
|
|
1931
2323
|
delegateEvents(["input"]);
|
|
@@ -2143,7 +2535,7 @@ const Switch = props => {
|
|
|
2143
2535
|
_el$2 = _el$.firstChild;
|
|
2144
2536
|
_el$.$$click = () => setChecked(c => !c);
|
|
2145
2537
|
effect(_p$ => {
|
|
2146
|
-
const _v$ = cs('ant-w-44px ant-h-22px ant-rounded-100px ant-relative', checked() ? 'ant-bg-[var(--
|
|
2538
|
+
const _v$ = cs('ant-w-44px ant-h-22px ant-rounded-100px ant-relative', checked() ? 'ant-bg-[var(--ant-color-primary)]' : 'ant-bg-[rgba(0,0,0,0.45)]'),
|
|
2147
2539
|
_v$2 = cs('ant-w-18px ant-h-18px ant-rounded-50% ant-bg-white ant-absolute ant-top-1/2 -ant-translate-y-1/2 ant-transition-left', checked() ? 'ant-left-[calc(100%-20px)]' : 'ant-left-2px');
|
|
2148
2540
|
_v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
|
|
2149
2541
|
_v$2 !== _p$._v$2 && className(_el$2, _p$._v$2 = _v$2);
|
|
@@ -2162,9 +2554,12 @@ const Image$1 = replaceClassName(reactToSolidComponent(Skeleton$1.Image));
|
|
|
2162
2554
|
const Skeleton = _Skeleton;
|
|
2163
2555
|
Skeleton.Image = Image$1;
|
|
2164
2556
|
|
|
2165
|
-
const _tmpl$$7 = /*#__PURE__*/template(`<div class="ant-
|
|
2166
|
-
_tmpl$2$2 = /*#__PURE__*/template(`<div
|
|
2167
|
-
const Spin =
|
|
2557
|
+
const _tmpl$$7 = /*#__PURE__*/template(`<div class="ant-flex ant-items-center ant-justify-center ant-bg-[rgba(255,255,255,.5)]"><span class="i-ant-design:loading keyframes-spin ant-[animation:spin_1s_linear_infinite] ant-text-[var(--ant-color-primary)]">`),
|
|
2558
|
+
_tmpl$2$2 = /*#__PURE__*/template(`<div>`);
|
|
2559
|
+
const Spin = _props => {
|
|
2560
|
+
const props = mergeProps({
|
|
2561
|
+
size: 20
|
|
2562
|
+
}, _props);
|
|
2168
2563
|
return (() => {
|
|
2169
2564
|
const _el$ = _tmpl$2$2();
|
|
2170
2565
|
insert(_el$, () => props.children, null);
|
|
@@ -2173,7 +2568,10 @@ const Spin = props => {
|
|
|
2173
2568
|
return props.spinning;
|
|
2174
2569
|
},
|
|
2175
2570
|
get children() {
|
|
2176
|
-
|
|
2571
|
+
const _el$2 = _tmpl$$7(),
|
|
2572
|
+
_el$3 = _el$2.firstChild;
|
|
2573
|
+
effect(() => `${props.size}px` != null ? _el$3.style.setProperty("font-size", `${props.size}px`) : _el$3.style.removeProperty("font-size"));
|
|
2574
|
+
return _el$2;
|
|
2177
2575
|
}
|
|
2178
2576
|
}), null);
|
|
2179
2577
|
return _el$;
|
|
@@ -2211,10 +2609,15 @@ const _tmpl$$3 = /*#__PURE__*/template(`<svg width="184" height="100" viewBox="0
|
|
|
2211
2609
|
const EmptySvg = () => _tmpl$$3();
|
|
2212
2610
|
|
|
2213
2611
|
const _tmpl$$2 = /*#__PURE__*/template(`<div><div class="ant-mb-[var(--ant-margin-xs)] ant-flex ant-justify-center"></div><div class="ant-text-[var(--ant-color-text)] ant-text-center">暂无数据`);
|
|
2214
|
-
const Empty =
|
|
2612
|
+
const Empty = props => {
|
|
2215
2613
|
return (() => {
|
|
2216
2614
|
const _el$ = _tmpl$$2(),
|
|
2217
2615
|
_el$2 = _el$.firstChild;
|
|
2616
|
+
spread(_el$, mergeProps$1(props, {
|
|
2617
|
+
get style() {
|
|
2618
|
+
return props.style;
|
|
2619
|
+
}
|
|
2620
|
+
}), false, true);
|
|
2218
2621
|
insert(_el$2, createComponent(EmptySvg, {}));
|
|
2219
2622
|
return _el$;
|
|
2220
2623
|
})();
|
|
@@ -2353,4 +2756,4 @@ const Collapse = props => {
|
|
|
2353
2756
|
};
|
|
2354
2757
|
delegateEvents(["click"]);
|
|
2355
2758
|
|
|
2356
|
-
export { Button, Collapse, ColorPicker, Compact, DatePicker, Empty, Form, Image, Input, InputNumber, Modal, Popconfirm, Popover, Progress, Radio, Result, Segmented, Select, Skeleton, Spin, Switch, Table, Tabs, Timeline, Tooltip, Tree, Upload, createControllableValue };
|
|
2759
|
+
export { Button, Collapse, ColorPicker, Compact, DatePicker, Drawer, Empty, Form, Image, Input, InputNumber, Modal, Popconfirm, Popover, Progress, Radio, Result, Segmented, Select, Skeleton, Spin, Switch, Table, Tabs, Timeline, Tooltip, Tree, Upload, createControllableValue };
|