antd-solid 0.0.9 → 0.0.11
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 +15 -2
- package/dist/index.esm.js +408 -102
- package/dist/index.umd.js +1 -1
- package/es/Button.js +2 -2
- package/es/Drawer/index.d.ts +44 -0
- package/es/Drawer/index.js +163 -0
- package/es/Drawer/index.scss.js +6 -0
- package/es/Modal.d.ts +5 -4
- package/es/Modal.js +28 -14
- package/es/Progress/index.d.ts +25 -0
- package/es/Progress/index.js +71 -0
- package/es/Radio.js +25 -21
- 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 +3 -2
- 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 +4 -2
- package/src/Button.tsx +8 -5
- package/src/Drawer/index.scss +53 -0
- package/src/Drawer/index.tsx +212 -0
- package/src/{form → Form}/FormItem.tsx +9 -7
- package/src/Modal.tsx +46 -22
- package/src/Progress/index.tsx +73 -0
- package/src/Radio.tsx +24 -14
- 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/Progress.tsx +0 -4
- /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
|
@@ -3,14 +3,14 @@ import { mergeProps, createSignal, createMemo, Show, createEffect, on, splitProp
|
|
|
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, Upload as Upload$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
|
-
_tmpl$2$
|
|
12
|
+
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">`),
|
|
13
|
+
_tmpl$2$f = /*#__PURE__*/template(`<button><span>`);
|
|
14
14
|
const sizeClassMap = {
|
|
15
15
|
large: 'ant-px-15px ant-py-6px ant-h-40px ant-rounded-8px',
|
|
16
16
|
middle: 'ant-px-15px ant-py-4px ant-h-32px ant-rounded-6px',
|
|
@@ -19,7 +19,7 @@ const sizeClassMap = {
|
|
|
19
19
|
};
|
|
20
20
|
const typeClassMap = {
|
|
21
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(--light-primary-color)] hover:ant-text-[var(--light-primary-color)] active:ant-[border-color:var(--dark-primary-color)] active:ant-text-[var(--dark-primary-color)]'),
|
|
22
|
-
primary: danger => cs('ant-
|
|
22
|
+
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(--primary-color)] ant-bg-[var(--primary-color)] hover:ant-[border-color:var(--light-primary-color)] hover:ant-bg-[var(--light-primary-color)] active:ant-[border-color:var(--dark-primary-color)] active:ant-bg-[var(--dark-primary-color)]'),
|
|
23
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(--light-primary-color)] hover:ant-text-[var(--light-primary-color)] active:ant-[border-color:var(--dark-primary-color)] active:ant-text-[var(--dark-primary-color)]'),
|
|
24
24
|
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
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(--primary-color)] hover:ant-text-[var(--light-primary-color)] active:ant-text-[var(--dark-primary-color)]')
|
|
@@ -32,7 +32,7 @@ const Button = props => {
|
|
|
32
32
|
const [innerLoading, setLoading] = createSignal(false);
|
|
33
33
|
const loading = createMemo(() => props.loading ?? innerLoading());
|
|
34
34
|
return (() => {
|
|
35
|
-
const _el$ = _tmpl$2$
|
|
35
|
+
const _el$ = _tmpl$2$f(),
|
|
36
36
|
_el$3 = _el$.firstChild;
|
|
37
37
|
_el$.$$click = e => {
|
|
38
38
|
const res = mergedProps.onClick?.(e);
|
|
@@ -58,12 +58,12 @@ const Button = props => {
|
|
|
58
58
|
return loading();
|
|
59
59
|
},
|
|
60
60
|
get children() {
|
|
61
|
-
return _tmpl$$
|
|
61
|
+
return _tmpl$$s();
|
|
62
62
|
}
|
|
63
63
|
}), _el$3);
|
|
64
64
|
insert(_el$3, () => mergedProps.children);
|
|
65
65
|
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:--light-primary-color]'),
|
|
66
|
+
const _v$ = cs('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:--light-primary-color]'),
|
|
67
67
|
_v$2 = mergedProps.style;
|
|
68
68
|
_v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
|
|
69
69
|
_p$._v$2 = style(_el$, _v$2, _p$._v$2);
|
|
@@ -123,10 +123,10 @@ function createControllableValue(props, options = {}) {
|
|
|
123
123
|
return [value, setValue];
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
const _tmpl$$
|
|
126
|
+
const _tmpl$$r = /*#__PURE__*/template(`<div class="ant-compact ant-flex">`);
|
|
127
127
|
function Compact(props) {
|
|
128
128
|
return (() => {
|
|
129
|
-
const _el$ = _tmpl$$
|
|
129
|
+
const _el$ = _tmpl$$r();
|
|
130
130
|
insert(_el$, () => props.children);
|
|
131
131
|
return _el$;
|
|
132
132
|
})();
|
|
@@ -137,10 +137,10 @@ Compact.compactItemRoundedLeftClass = 'p[.ant-compact>:first-child]:ant-rounded-
|
|
|
137
137
|
Compact.compactItemRoundedRightClass = 'p[.ant-compact>:last-child]:ant-rounded-r-6px';
|
|
138
138
|
Compact.compactItemZIndexClass = 'p[.ant-compact>*]:focus:ant-z-10 p[.ant-compact>*]:focus-within:ant-z-10';
|
|
139
139
|
|
|
140
|
-
const _tmpl$$
|
|
141
|
-
_tmpl$2$
|
|
142
|
-
_tmpl$3$
|
|
143
|
-
_tmpl$4$
|
|
140
|
+
const _tmpl$$q = /*#__PURE__*/template(`<div>`),
|
|
141
|
+
_tmpl$2$e = /*#__PURE__*/template(`<div class="ant-mr-4px">`),
|
|
142
|
+
_tmpl$3$a = /*#__PURE__*/template(`<div class="ant-ml-4px">`),
|
|
143
|
+
_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
144
|
const statusClassDict = {
|
|
145
145
|
default: disabled => cs('ant-[border:1px_solid_var(--ant-color-border)]', !disabled && 'hover:ant-border-[var(--primary-color)] focus-within:ant-border-[var(--primary-color)] focus-within:ant-[box-shadow:0_0_0_2px_rgba(5,145,255,0.1)]'),
|
|
146
146
|
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)]'),
|
|
@@ -186,13 +186,13 @@ function CommonInput(props) {
|
|
|
186
186
|
}
|
|
187
187
|
}));
|
|
188
188
|
return (() => {
|
|
189
|
-
const _el$ = _tmpl$$
|
|
189
|
+
const _el$ = _tmpl$$q();
|
|
190
190
|
insert(_el$, createComponent(Show, {
|
|
191
191
|
get when() {
|
|
192
192
|
return props.addonBefore;
|
|
193
193
|
},
|
|
194
194
|
get children() {
|
|
195
|
-
const _el$2 = _tmpl$$
|
|
195
|
+
const _el$2 = _tmpl$$q();
|
|
196
196
|
insert(_el$2, () => props.addonBefore);
|
|
197
197
|
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
198
|
return _el$2;
|
|
@@ -204,13 +204,13 @@ function CommonInput(props) {
|
|
|
204
204
|
},
|
|
205
205
|
fallback: inputJSX,
|
|
206
206
|
get children() {
|
|
207
|
-
const _el$3 = _tmpl$$
|
|
207
|
+
const _el$3 = _tmpl$$q();
|
|
208
208
|
insert(_el$3, createComponent(Show, {
|
|
209
209
|
get when() {
|
|
210
210
|
return props.prefix;
|
|
211
211
|
},
|
|
212
212
|
get children() {
|
|
213
|
-
const _el$4 = _tmpl$2$
|
|
213
|
+
const _el$4 = _tmpl$2$e();
|
|
214
214
|
insert(_el$4, () => props.prefix);
|
|
215
215
|
return _el$4;
|
|
216
216
|
}
|
|
@@ -221,7 +221,7 @@ function CommonInput(props) {
|
|
|
221
221
|
return props.suffix;
|
|
222
222
|
},
|
|
223
223
|
get children() {
|
|
224
|
-
const _el$5 = _tmpl$3$
|
|
224
|
+
const _el$5 = _tmpl$3$a();
|
|
225
225
|
insert(_el$5, () => props.suffix);
|
|
226
226
|
return _el$5;
|
|
227
227
|
}
|
|
@@ -231,7 +231,7 @@ function CommonInput(props) {
|
|
|
231
231
|
return props.actions;
|
|
232
232
|
},
|
|
233
233
|
get children() {
|
|
234
|
-
const _el$6 = _tmpl$4$
|
|
234
|
+
const _el$6 = _tmpl$4$6();
|
|
235
235
|
insert(_el$6, () => props.actions);
|
|
236
236
|
return _el$6;
|
|
237
237
|
}
|
|
@@ -245,7 +245,7 @@ function CommonInput(props) {
|
|
|
245
245
|
return props.addonAfter;
|
|
246
246
|
},
|
|
247
247
|
get children() {
|
|
248
|
-
const _el$7 = _tmpl$$
|
|
248
|
+
const _el$7 = _tmpl$$q();
|
|
249
249
|
insert(_el$7, () => props.addonAfter);
|
|
250
250
|
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
251
|
return _el$7;
|
|
@@ -318,8 +318,15 @@ function dispatchEventHandlerUnion(handler, e) {
|
|
|
318
318
|
function unwrapStringOrJSXElement(value) {
|
|
319
319
|
return typeof value === 'function' ? value() : value;
|
|
320
320
|
}
|
|
321
|
+
function setRef(props, value) {
|
|
322
|
+
untrack(() => {
|
|
323
|
+
if (typeof props.ref === 'function') {
|
|
324
|
+
props.ref?.(value);
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
}
|
|
321
328
|
|
|
322
|
-
const _tmpl$$
|
|
329
|
+
const _tmpl$$p = /*#__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(--primary-color)] 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(--primary-color)] ant-transition-color ant-transition-height ant-transition-duration-500"><div class="i-ant-design:down-outlined">`);
|
|
323
330
|
const isEmptyValue = value => isNil(value) || value === '';
|
|
324
331
|
const InputNumber = _props => {
|
|
325
332
|
const props = mergeProps({
|
|
@@ -362,7 +369,7 @@ const InputNumber = _props => {
|
|
|
362
369
|
return createComponent(CommonInput, mergeProps$1(inputProps, {
|
|
363
370
|
get actions() {
|
|
364
371
|
return (() => {
|
|
365
|
-
const _el$ = _tmpl$$
|
|
372
|
+
const _el$ = _tmpl$$p(),
|
|
366
373
|
_el$2 = _el$.firstChild,
|
|
367
374
|
_el$3 = _el$2.nextSibling;
|
|
368
375
|
_el$2.$$click = up;
|
|
@@ -404,23 +411,23 @@ const InputNumber = _props => {
|
|
|
404
411
|
};
|
|
405
412
|
delegateEvents(["click"]);
|
|
406
413
|
|
|
407
|
-
const _tmpl$$
|
|
408
|
-
_tmpl$2$
|
|
409
|
-
_tmpl$3$
|
|
414
|
+
const _tmpl$$o = /*#__PURE__*/template(`<div class="ant-flex ant-flex-col ant-gap-[16px]">`),
|
|
415
|
+
_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(--primary-color)] ant-bg-white ant-rounded-[50%] ant-mt-[8px]"></div><div class="ant-ml-[8px]">`),
|
|
416
|
+
_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
417
|
const Timeline = props => {
|
|
411
418
|
return (() => {
|
|
412
|
-
const _el$ = _tmpl$$
|
|
419
|
+
const _el$ = _tmpl$$o();
|
|
413
420
|
insert(_el$, createComponent(For, {
|
|
414
421
|
get each() {
|
|
415
422
|
return props.items;
|
|
416
423
|
},
|
|
417
424
|
children: (item, i) => (() => {
|
|
418
|
-
const _el$2 = _tmpl$2$
|
|
425
|
+
const _el$2 = _tmpl$2$d(),
|
|
419
426
|
_el$3 = _el$2.firstChild,
|
|
420
427
|
_el$4 = _el$3.nextSibling;
|
|
421
428
|
insert(_el$2, (() => {
|
|
422
429
|
const _c$ = memo(() => i() !== props.items.length - 1);
|
|
423
|
-
return () => _c$() && _tmpl$3$
|
|
430
|
+
return () => _c$() && _tmpl$3$9();
|
|
424
431
|
})(), _el$3);
|
|
425
432
|
insert(_el$4, () => item.children?.());
|
|
426
433
|
return _el$2;
|
|
@@ -430,10 +437,10 @@ const Timeline = props => {
|
|
|
430
437
|
})();
|
|
431
438
|
};
|
|
432
439
|
|
|
433
|
-
const _tmpl$$
|
|
434
|
-
_tmpl$2$
|
|
435
|
-
_tmpl$3$
|
|
436
|
-
_tmpl$4$
|
|
440
|
+
const _tmpl$$n = /*#__PURE__*/template(`<span class="i-ant-design:close-outlined">`),
|
|
441
|
+
_tmpl$2$c = /*#__PURE__*/template(`<div class="ant-flex ant-gap-8px ant-justify-end">`),
|
|
442
|
+
_tmpl$3$8 = /*#__PURE__*/template(`<div class="ant-mt-12px">`),
|
|
443
|
+
_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
444
|
_tmpl$5$1 = /*#__PURE__*/template(`<div>`),
|
|
438
445
|
_tmpl$6$1 = /*#__PURE__*/template(`<span class="i-ant-design:exclamation-circle ant-text-22px ant-mr-12px ant-text-[var(--warning-color)]">`),
|
|
439
446
|
_tmpl$7 = /*#__PURE__*/template(`<div class="ant-ml-34px">`);
|
|
@@ -443,19 +450,33 @@ function Modal(_props) {
|
|
|
443
450
|
}, _props);
|
|
444
451
|
const [open, setOpen] = createSignal(props.defaultOpen ?? false);
|
|
445
452
|
const [hide, setHide] = createSignal(false);
|
|
453
|
+
let cleanup;
|
|
446
454
|
const instance = {
|
|
447
455
|
open() {
|
|
448
456
|
setOpen(true);
|
|
449
457
|
setHide(false);
|
|
458
|
+
const originOverflow = document.body.style.overflow;
|
|
459
|
+
document.body.style.overflow = 'hidden';
|
|
460
|
+
const onKeyup = e => {
|
|
461
|
+
if (e.key === 'Escape') {
|
|
462
|
+
instance.close();
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
document.addEventListener('keyup', onKeyup);
|
|
466
|
+
cleanup = () => {
|
|
467
|
+
document.body.style.overflow = originOverflow;
|
|
468
|
+
document.removeEventListener('keyup', onKeyup);
|
|
469
|
+
};
|
|
450
470
|
},
|
|
451
471
|
close() {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
472
|
+
setHide(true);
|
|
473
|
+
cleanup();
|
|
474
|
+
props.afterClose?.();
|
|
475
|
+
},
|
|
476
|
+
destroy() {
|
|
477
|
+
setOpen(false);
|
|
478
|
+
cleanup();
|
|
479
|
+
props.afterClose?.();
|
|
459
480
|
}
|
|
460
481
|
};
|
|
461
482
|
untrack(() => {
|
|
@@ -463,10 +484,6 @@ function Modal(_props) {
|
|
|
463
484
|
props.ref?.(instance);
|
|
464
485
|
}
|
|
465
486
|
});
|
|
466
|
-
const close = () => {
|
|
467
|
-
instance.close();
|
|
468
|
-
props.afterClose?.();
|
|
469
|
-
};
|
|
470
487
|
const [confirmLoading, setConfirmLoading] = createSignal(false);
|
|
471
488
|
return createComponent(Show, {
|
|
472
489
|
get when() {
|
|
@@ -478,7 +495,7 @@ function Modal(_props) {
|
|
|
478
495
|
const _el$ = _tmpl$5$1();
|
|
479
496
|
_el$.$$click = () => {
|
|
480
497
|
if (props.maskClosable ?? true) {
|
|
481
|
-
close();
|
|
498
|
+
instance.close();
|
|
482
499
|
}
|
|
483
500
|
};
|
|
484
501
|
insert(_el$, createComponent(Show, {
|
|
@@ -489,7 +506,7 @@ function Modal(_props) {
|
|
|
489
506
|
return props.modalRender();
|
|
490
507
|
},
|
|
491
508
|
get children() {
|
|
492
|
-
const _el$2 = _tmpl$4$
|
|
509
|
+
const _el$2 = _tmpl$4$5(),
|
|
493
510
|
_el$4 = _el$2.firstChild,
|
|
494
511
|
_el$5 = _el$4.nextSibling;
|
|
495
512
|
_el$2.$$click = e => {
|
|
@@ -505,9 +522,11 @@ function Modal(_props) {
|
|
|
505
522
|
get ["class"]() {
|
|
506
523
|
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
524
|
},
|
|
508
|
-
onClick:
|
|
525
|
+
onClick: () => {
|
|
526
|
+
instance.close();
|
|
527
|
+
},
|
|
509
528
|
get children() {
|
|
510
|
-
return _tmpl$$
|
|
529
|
+
return _tmpl$$n();
|
|
511
530
|
}
|
|
512
531
|
});
|
|
513
532
|
}
|
|
@@ -519,7 +538,7 @@ function Modal(_props) {
|
|
|
519
538
|
return props.footer !== false;
|
|
520
539
|
},
|
|
521
540
|
get children() {
|
|
522
|
-
const _el$6 = _tmpl$3$
|
|
541
|
+
const _el$6 = _tmpl$3$8();
|
|
523
542
|
insert(_el$6, createComponent(Show, {
|
|
524
543
|
get when() {
|
|
525
544
|
return typeof props.footer !== 'function';
|
|
@@ -528,9 +547,11 @@ function Modal(_props) {
|
|
|
528
547
|
return memo(() => typeof props.footer === 'function')() && props.footer(instance);
|
|
529
548
|
},
|
|
530
549
|
get children() {
|
|
531
|
-
const _el$7 = _tmpl$2$
|
|
550
|
+
const _el$7 = _tmpl$2$c();
|
|
532
551
|
insert(_el$7, createComponent(Button, {
|
|
533
|
-
onClick:
|
|
552
|
+
onClick: () => {
|
|
553
|
+
instance.close();
|
|
554
|
+
},
|
|
534
555
|
children: "\u53D6\u6D88"
|
|
535
556
|
}), null);
|
|
536
557
|
insert(_el$7, createComponent(Button, {
|
|
@@ -619,10 +640,227 @@ Modal.warning = props => {
|
|
|
619
640
|
};
|
|
620
641
|
delegateEvents(["click"]);
|
|
621
642
|
|
|
622
|
-
|
|
643
|
+
function styleInject(css, ref) {
|
|
644
|
+
if (ref === void 0) ref = {};
|
|
645
|
+
var insertAt = ref.insertAt;
|
|
646
|
+
if (!css || typeof document === 'undefined') {
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
650
|
+
var style = document.createElement('style');
|
|
651
|
+
style.type = 'text/css';
|
|
652
|
+
if (insertAt === 'top') {
|
|
653
|
+
if (head.firstChild) {
|
|
654
|
+
head.insertBefore(style, head.firstChild);
|
|
655
|
+
} else {
|
|
656
|
+
head.appendChild(style);
|
|
657
|
+
}
|
|
658
|
+
} else {
|
|
659
|
+
head.appendChild(style);
|
|
660
|
+
}
|
|
661
|
+
if (style.styleSheet) {
|
|
662
|
+
style.styleSheet.cssText = css;
|
|
663
|
+
} else {
|
|
664
|
+
style.appendChild(document.createTextNode(css));
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
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}";
|
|
669
|
+
styleInject(css_248z);
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* dom 节点显示或隐藏时的动画
|
|
673
|
+
* @param target
|
|
674
|
+
* @param when
|
|
675
|
+
* @param className 动画类名
|
|
676
|
+
*/
|
|
677
|
+
function createTransition(target, when, className) {
|
|
678
|
+
createEffect(on(when, input => {
|
|
679
|
+
const targetValue = target();
|
|
680
|
+
if (!targetValue) return;
|
|
681
|
+
if (input) {
|
|
682
|
+
targetValue.style.display = '';
|
|
683
|
+
targetValue.classList.add(`${className}-enter-active`, `${className}-enter`, `${className}-enter-to`);
|
|
684
|
+
requestAnimationFrame(() => {
|
|
685
|
+
targetValue.classList.remove(`${className}-enter`);
|
|
686
|
+
});
|
|
687
|
+
const onTransitionEnd = () => {
|
|
688
|
+
targetValue.classList.remove(`${className}-enter-active`, `${className}-enter-to`);
|
|
689
|
+
targetValue.removeEventListener('transitionend', onTransitionEnd);
|
|
690
|
+
};
|
|
691
|
+
targetValue.addEventListener('transitionend', onTransitionEnd);
|
|
692
|
+
} else {
|
|
693
|
+
targetValue.classList.add(`${className}-exit-active`, `${className}-exit`, `${className}-exit-to`);
|
|
694
|
+
requestAnimationFrame(() => {
|
|
695
|
+
targetValue.classList.remove(`${className}-exit`);
|
|
696
|
+
});
|
|
697
|
+
const onTransitionEnd = () => {
|
|
698
|
+
targetValue.style.display = 'none';
|
|
699
|
+
targetValue.classList.remove(`${className}-exit-active`, `${className}-exit-to`);
|
|
700
|
+
targetValue.removeEventListener('transitionend', onTransitionEnd);
|
|
701
|
+
};
|
|
702
|
+
targetValue.addEventListener('transitionend', onTransitionEnd);
|
|
703
|
+
}
|
|
704
|
+
}));
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
const _tmpl$$m = /*#__PURE__*/template(`<span class="i-ant-design:close-outlined">`),
|
|
708
|
+
_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">`);
|
|
709
|
+
const Drawer = _props => {
|
|
710
|
+
const props = mergeProps({
|
|
711
|
+
width: '378px',
|
|
712
|
+
height: '378px',
|
|
713
|
+
maskClosable: true,
|
|
714
|
+
placement: 'right',
|
|
715
|
+
getContainer: document.body
|
|
716
|
+
}, _props);
|
|
717
|
+
/**
|
|
718
|
+
* 控制是否打开/销毁
|
|
719
|
+
*/
|
|
720
|
+
const [open, setOpen] = createSignal(false);
|
|
721
|
+
/**
|
|
722
|
+
* 控制显隐
|
|
723
|
+
*/
|
|
724
|
+
const [hide, setHide] = createSignal(false);
|
|
725
|
+
let cleanup;
|
|
726
|
+
const container = createMemo(() => {
|
|
727
|
+
if (typeof props.getContainer === 'function') {
|
|
728
|
+
return props.getContainer();
|
|
729
|
+
}
|
|
730
|
+
if (props.getContainer instanceof HTMLElement) {
|
|
731
|
+
return props.getContainer;
|
|
732
|
+
}
|
|
733
|
+
return undefined;
|
|
734
|
+
});
|
|
735
|
+
const isBody = createMemo(() => container() === document.body);
|
|
736
|
+
const instance = {
|
|
737
|
+
open() {
|
|
738
|
+
setOpen(true);
|
|
739
|
+
setHide(false);
|
|
740
|
+
untrack(() => {
|
|
741
|
+
if (!isBody()) return;
|
|
742
|
+
const originOverflow = document.body.style.overflow;
|
|
743
|
+
document.body.style.overflow = 'hidden';
|
|
744
|
+
const onKeyup = e => {
|
|
745
|
+
if (e.key === 'Escape') {
|
|
746
|
+
instance.close();
|
|
747
|
+
}
|
|
748
|
+
};
|
|
749
|
+
document.addEventListener('keyup', onKeyup);
|
|
750
|
+
cleanup = () => {
|
|
751
|
+
document.body.style.overflow = originOverflow;
|
|
752
|
+
document.removeEventListener('keyup', onKeyup);
|
|
753
|
+
};
|
|
754
|
+
});
|
|
755
|
+
},
|
|
756
|
+
close() {
|
|
757
|
+
untrack(() => {
|
|
758
|
+
if (props.destroyOnClose) {
|
|
759
|
+
setOpen(false);
|
|
760
|
+
} else {
|
|
761
|
+
setHide(true);
|
|
762
|
+
}
|
|
763
|
+
cleanup?.();
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
};
|
|
767
|
+
setRef(props, instance);
|
|
768
|
+
let drawer;
|
|
769
|
+
createTransition(() => drawer, () => !hide(), 'ant-drawer-fade');
|
|
770
|
+
const direction = createMemo(() => ['top', 'bottom'].includes(props.placement) ? 'vertical' : 'horizontal');
|
|
771
|
+
const children = createComponent(Transition, {
|
|
772
|
+
name: "ant-drawer-fade",
|
|
773
|
+
get children() {
|
|
774
|
+
return createComponent(Show, {
|
|
775
|
+
get when() {
|
|
776
|
+
return open();
|
|
777
|
+
},
|
|
778
|
+
get children() {
|
|
779
|
+
const _el$ = _tmpl$2$b(),
|
|
780
|
+
_el$2 = _el$.firstChild,
|
|
781
|
+
_el$3 = _el$2.firstChild,
|
|
782
|
+
_el$4 = _el$3.firstChild,
|
|
783
|
+
_el$6 = _el$4.firstChild,
|
|
784
|
+
_el$7 = _el$4.nextSibling,
|
|
785
|
+
_el$8 = _el$3.nextSibling;
|
|
786
|
+
_el$.$$click = () => {
|
|
787
|
+
if (props.maskClosable) {
|
|
788
|
+
instance.close();
|
|
789
|
+
}
|
|
790
|
+
};
|
|
791
|
+
const _ref$ = drawer;
|
|
792
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : drawer = _el$;
|
|
793
|
+
_el$2.$$click = e => {
|
|
794
|
+
e.stopPropagation();
|
|
795
|
+
};
|
|
796
|
+
insert(_el$4, createComponent(Show, {
|
|
797
|
+
get when() {
|
|
798
|
+
return props.closeIcon !== false;
|
|
799
|
+
},
|
|
800
|
+
get children() {
|
|
801
|
+
return createComponent(Button, {
|
|
802
|
+
type: "text",
|
|
803
|
+
size: "plain",
|
|
804
|
+
"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)]",
|
|
805
|
+
onClick: () => {
|
|
806
|
+
instance?.close();
|
|
807
|
+
},
|
|
808
|
+
get children() {
|
|
809
|
+
return _tmpl$$m();
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
}), _el$6);
|
|
814
|
+
insert(_el$6, () => props.title);
|
|
815
|
+
insert(_el$7, () => props.extra);
|
|
816
|
+
insert(_el$8, () => props.children);
|
|
817
|
+
effect(_p$ => {
|
|
818
|
+
const _v$ = cs('ant-inset-0 ant-bg-[rgba(0,0,0,.45)] ant-z-1000', isBody() ? 'ant-fixed' : 'ant-absolute'),
|
|
819
|
+
_v$2 = cs('ant-drawer-content', {
|
|
820
|
+
left: 'ant-drawer-content-left',
|
|
821
|
+
right: 'ant-drawer-content-right',
|
|
822
|
+
top: 'ant-drawer-content-top',
|
|
823
|
+
bottom: 'ant-drawer-content-bottom'
|
|
824
|
+
}[props.placement], 'ant-absolute ant-bg-white ant-grid ant-[grid-template-rows:auto_1fr]'),
|
|
825
|
+
_v$3 = direction() === 'horizontal' ? props.width : undefined,
|
|
826
|
+
_v$4 = direction() === 'vertical' ? props.height : undefined;
|
|
827
|
+
_v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
|
|
828
|
+
_v$2 !== _p$._v$2 && className(_el$2, _p$._v$2 = _v$2);
|
|
829
|
+
_v$3 !== _p$._v$3 && ((_p$._v$3 = _v$3) != null ? _el$2.style.setProperty("width", _v$3) : _el$2.style.removeProperty("width"));
|
|
830
|
+
_v$4 !== _p$._v$4 && ((_p$._v$4 = _v$4) != null ? _el$2.style.setProperty("height", _v$4) : _el$2.style.removeProperty("height"));
|
|
831
|
+
return _p$;
|
|
832
|
+
}, {
|
|
833
|
+
_v$: undefined,
|
|
834
|
+
_v$2: undefined,
|
|
835
|
+
_v$3: undefined,
|
|
836
|
+
_v$4: undefined
|
|
837
|
+
});
|
|
838
|
+
return _el$;
|
|
839
|
+
}
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
});
|
|
843
|
+
return createComponent(Show, {
|
|
844
|
+
get when() {
|
|
845
|
+
return props.getContainer !== false;
|
|
846
|
+
},
|
|
847
|
+
fallback: children,
|
|
848
|
+
get children() {
|
|
849
|
+
return createComponent(Portal, {
|
|
850
|
+
get mount() {
|
|
851
|
+
return container();
|
|
852
|
+
},
|
|
853
|
+
children: children
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
});
|
|
857
|
+
};
|
|
858
|
+
delegateEvents(["click"]);
|
|
859
|
+
|
|
860
|
+
const _tmpl$$l = /*#__PURE__*/template(`<div role="ReactToSolid">`);
|
|
623
861
|
function ReactToSolid(props) {
|
|
624
862
|
let root;
|
|
625
|
-
const rootEle = createMemo(() => props.container ?? _tmpl$$
|
|
863
|
+
const rootEle = createMemo(() => props.container ?? _tmpl$$l());
|
|
626
864
|
onMount(() => {
|
|
627
865
|
root = createRoot(rootEle());
|
|
628
866
|
onCleanup(() => {
|
|
@@ -963,7 +1201,7 @@ function useClickAway(onClickAway, target) {
|
|
|
963
1201
|
});
|
|
964
1202
|
}
|
|
965
1203
|
|
|
966
|
-
const _tmpl$$
|
|
1204
|
+
const _tmpl$$k = /*#__PURE__*/template(`<div>`);
|
|
967
1205
|
const Content = props => {
|
|
968
1206
|
return createComponent(Show, {
|
|
969
1207
|
get when() {
|
|
@@ -1201,7 +1439,7 @@ const Tooltip = _props => {
|
|
|
1201
1439
|
get children() {
|
|
1202
1440
|
return createComponent(Portal, {
|
|
1203
1441
|
get children() {
|
|
1204
|
-
const _el$ = _tmpl$$
|
|
1442
|
+
const _el$ = _tmpl$$k();
|
|
1205
1443
|
_el$.$$click = e => {
|
|
1206
1444
|
e.stopPropagation();
|
|
1207
1445
|
};
|
|
@@ -1218,7 +1456,7 @@ const Tooltip = _props => {
|
|
|
1218
1456
|
return props.arrow;
|
|
1219
1457
|
},
|
|
1220
1458
|
get children() {
|
|
1221
|
-
const _el$2 = _tmpl$$
|
|
1459
|
+
const _el$2 = _tmpl$$k();
|
|
1222
1460
|
effect(_p$ => {
|
|
1223
1461
|
const _v$ = cs('ant-w-8px ant-h-8px ant-absolute ant-border-solid ant-border-4px ant-border-transparent'),
|
|
1224
1462
|
_v$2 = {
|
|
@@ -1256,10 +1494,10 @@ const Tooltip = _props => {
|
|
|
1256
1494
|
};
|
|
1257
1495
|
delegateEvents(["click"]);
|
|
1258
1496
|
|
|
1259
|
-
const _tmpl$$
|
|
1260
|
-
_tmpl$2$
|
|
1261
|
-
_tmpl$3$
|
|
1262
|
-
_tmpl$4$
|
|
1497
|
+
const _tmpl$$j = /*#__PURE__*/template(`<div>`),
|
|
1498
|
+
_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)]">`),
|
|
1499
|
+
_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">`),
|
|
1500
|
+
_tmpl$4$4 = /*#__PURE__*/template(`<div class="ant-bg-white ant-w-200px">`),
|
|
1263
1501
|
_tmpl$5 = /*#__PURE__*/template(`<input class="ant-h-full ant-w-full ant-float-left ant-[outline:none]" readonly>`),
|
|
1264
1502
|
_tmpl$6 = /*#__PURE__*/template(`<span class="i-ant-design:down-outlined ant-text-[var(--ant-allow-color)]">`);
|
|
1265
1503
|
const Select = props => {
|
|
@@ -1285,13 +1523,13 @@ const Select = props => {
|
|
|
1285
1523
|
padding: 0
|
|
1286
1524
|
},
|
|
1287
1525
|
content: close => (() => {
|
|
1288
|
-
const _el$6 = _tmpl$4$
|
|
1526
|
+
const _el$6 = _tmpl$4$4();
|
|
1289
1527
|
insert(_el$6, createComponent(For, {
|
|
1290
1528
|
get each() {
|
|
1291
1529
|
return props.options;
|
|
1292
1530
|
},
|
|
1293
1531
|
children: item => (() => {
|
|
1294
|
-
const _el$7 = _tmpl$$
|
|
1532
|
+
const _el$7 = _tmpl$$j();
|
|
1295
1533
|
_el$7.$$click = () => {
|
|
1296
1534
|
setValue(item.value);
|
|
1297
1535
|
close();
|
|
@@ -1305,7 +1543,7 @@ const Select = props => {
|
|
|
1305
1543
|
return _el$6;
|
|
1306
1544
|
})(),
|
|
1307
1545
|
get children() {
|
|
1308
|
-
const _el$ = _tmpl$3$
|
|
1546
|
+
const _el$ = _tmpl$3$7(),
|
|
1309
1547
|
_el$2 = _el$.firstChild,
|
|
1310
1548
|
_el$4 = _el$2.firstChild;
|
|
1311
1549
|
_el$.addEventListener("mouseleave", () => setHover(false));
|
|
@@ -1332,7 +1570,7 @@ const Select = props => {
|
|
|
1332
1570
|
})();
|
|
1333
1571
|
},
|
|
1334
1572
|
get children() {
|
|
1335
|
-
const _el$3 = _tmpl$$
|
|
1573
|
+
const _el$3 = _tmpl$$j();
|
|
1336
1574
|
insert(_el$3, () => selectedOption().label ?? value());
|
|
1337
1575
|
return _el$3;
|
|
1338
1576
|
}
|
|
@@ -1345,7 +1583,7 @@ const Select = props => {
|
|
|
1345
1583
|
return _tmpl$6();
|
|
1346
1584
|
},
|
|
1347
1585
|
get children() {
|
|
1348
|
-
const _el$5 = _tmpl$2$
|
|
1586
|
+
const _el$5 = _tmpl$2$a();
|
|
1349
1587
|
_el$5.$$click = e => {
|
|
1350
1588
|
e.stopPropagation();
|
|
1351
1589
|
setValue(undefined);
|
|
@@ -1360,10 +1598,10 @@ const Select = props => {
|
|
|
1360
1598
|
};
|
|
1361
1599
|
delegateEvents(["click"]);
|
|
1362
1600
|
|
|
1363
|
-
const _tmpl$$
|
|
1364
|
-
_tmpl$2$
|
|
1365
|
-
_tmpl$3$
|
|
1366
|
-
_tmpl$4$
|
|
1601
|
+
const _tmpl$$i = /*#__PURE__*/template(`<span class="i-ant-design:minus-square-outlined">`),
|
|
1602
|
+
_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>`),
|
|
1603
|
+
_tmpl$3$6 = /*#__PURE__*/template(`<span class="ant-inline-block ant-w-24px">`),
|
|
1604
|
+
_tmpl$4$3 = /*#__PURE__*/template(`<span class="i-ant-design:plus-square-outlined">`);
|
|
1367
1605
|
const TreeContext = createContext({});
|
|
1368
1606
|
/**
|
|
1369
1607
|
* 单层级 tree
|
|
@@ -1393,7 +1631,7 @@ function SingleLevelTree(props) {
|
|
|
1393
1631
|
children: (item, i) => {
|
|
1394
1632
|
const indexes = [...(props.parentIndexes ?? []), i];
|
|
1395
1633
|
return [(() => {
|
|
1396
|
-
const _el$ = _tmpl$2$
|
|
1634
|
+
const _el$ = _tmpl$2$9(),
|
|
1397
1635
|
_el$2 = _el$.firstChild,
|
|
1398
1636
|
_el$3 = _el$2.nextSibling,
|
|
1399
1637
|
_el$4 = _el$3.nextSibling,
|
|
@@ -1427,21 +1665,21 @@ function SingleLevelTree(props) {
|
|
|
1427
1665
|
setDraggableIndexes(indexes);
|
|
1428
1666
|
});
|
|
1429
1667
|
setAttribute(_el$, "draggable", draggable);
|
|
1430
|
-
insert(_el$2, () => Array(props.indent).fill(0).map(() => _tmpl$3$
|
|
1668
|
+
insert(_el$2, () => Array(props.indent).fill(0).map(() => _tmpl$3$6()));
|
|
1431
1669
|
insert(_el$4, createComponent(Show, {
|
|
1432
1670
|
get when() {
|
|
1433
1671
|
return expanded();
|
|
1434
1672
|
},
|
|
1435
1673
|
get fallback() {
|
|
1436
1674
|
return (() => {
|
|
1437
|
-
const _el$8 = _tmpl$4$
|
|
1675
|
+
const _el$8 = _tmpl$4$3();
|
|
1438
1676
|
_el$8.$$click = setExpanded;
|
|
1439
1677
|
_el$8.$$clickData = true;
|
|
1440
1678
|
return _el$8;
|
|
1441
1679
|
})();
|
|
1442
1680
|
},
|
|
1443
1681
|
get children() {
|
|
1444
|
-
const _el$5 = _tmpl$$
|
|
1682
|
+
const _el$5 = _tmpl$$i();
|
|
1445
1683
|
_el$5.$$click = setExpanded;
|
|
1446
1684
|
_el$5.$$clickData = false;
|
|
1447
1685
|
return _el$5;
|
|
@@ -1552,21 +1790,21 @@ function Tree(props) {
|
|
|
1552
1790
|
}
|
|
1553
1791
|
delegateEvents(["click"]);
|
|
1554
1792
|
|
|
1555
|
-
const _tmpl$$
|
|
1556
|
-
_tmpl$2$
|
|
1793
|
+
const _tmpl$$h = /*#__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">`),
|
|
1794
|
+
_tmpl$2$8 = /*#__PURE__*/template(`<div><div class="ant-text-[rgba(0,0,0,0.88)]">`);
|
|
1557
1795
|
const Popover = props => {
|
|
1558
1796
|
return createComponent(Tooltip, mergeProps$1({
|
|
1559
1797
|
mode: "light"
|
|
1560
1798
|
}, props, {
|
|
1561
1799
|
content: close => (() => {
|
|
1562
|
-
const _el$ = _tmpl$2$
|
|
1800
|
+
const _el$ = _tmpl$2$8(),
|
|
1563
1801
|
_el$4 = _el$.firstChild;
|
|
1564
1802
|
insert(_el$, createComponent(Show, {
|
|
1565
1803
|
get when() {
|
|
1566
1804
|
return props.title;
|
|
1567
1805
|
},
|
|
1568
1806
|
get children() {
|
|
1569
|
-
const _el$2 = _tmpl$$
|
|
1807
|
+
const _el$2 = _tmpl$$h(),
|
|
1570
1808
|
_el$3 = _el$2.firstChild;
|
|
1571
1809
|
insert(_el$3, () => props.title);
|
|
1572
1810
|
return _el$2;
|
|
@@ -1585,7 +1823,7 @@ const Popover = props => {
|
|
|
1585
1823
|
|
|
1586
1824
|
var ColorPicker = reactToSolidComponent(ColorPicker$1);
|
|
1587
1825
|
|
|
1588
|
-
const _tmpl$$
|
|
1826
|
+
const _tmpl$$g = /*#__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
1827
|
const statusIconMap = {
|
|
1590
1828
|
success: 'ant-text-#52c41a i-ant-design:check-circle-filled',
|
|
1591
1829
|
info: 'ant-text-[var(--primary-color)] i-ant-design:exclamation-circle-filled',
|
|
@@ -1594,7 +1832,7 @@ const statusIconMap = {
|
|
|
1594
1832
|
};
|
|
1595
1833
|
const Result = props => {
|
|
1596
1834
|
return (() => {
|
|
1597
|
-
const _el$ = _tmpl$$
|
|
1835
|
+
const _el$ = _tmpl$$g(),
|
|
1598
1836
|
_el$2 = _el$.firstChild,
|
|
1599
1837
|
_el$3 = _el$2.firstChild,
|
|
1600
1838
|
_el$4 = _el$2.nextSibling,
|
|
@@ -1610,7 +1848,71 @@ const Result = props => {
|
|
|
1610
1848
|
})();
|
|
1611
1849
|
};
|
|
1612
1850
|
|
|
1613
|
-
|
|
1851
|
+
const _tmpl$$f = /*#__PURE__*/template(`<span class="i-ant-design:check-circle-filled ant-text-[var(--primary-color)]">`),
|
|
1852
|
+
_tmpl$2$7 = /*#__PURE__*/template(`<span class="i-ant-design:close-circle-filled ant-text-[var(--ant-color-error)]">`),
|
|
1853
|
+
_tmpl$3$5 = /*#__PURE__*/template(`<span class="ant-shrink-0 ant-min-w-40px ant-ml-8px ant-text-center">`),
|
|
1854
|
+
_tmpl$4$2 = /*#__PURE__*/template(`<div class="ant-flex ant-items-center"><div>`);
|
|
1855
|
+
const Progress = _props => {
|
|
1856
|
+
const props = mergeProps({
|
|
1857
|
+
percent: 0,
|
|
1858
|
+
status: 'default',
|
|
1859
|
+
height: 8,
|
|
1860
|
+
showInfo: true
|
|
1861
|
+
}, _props);
|
|
1862
|
+
return (() => {
|
|
1863
|
+
const _el$ = _tmpl$4$2(),
|
|
1864
|
+
_el$2 = _el$.firstChild;
|
|
1865
|
+
_el$.style.setProperty("--ant-progress-remaining-color", "rgba(0, 0, 0, 0.06)");
|
|
1866
|
+
insert(_el$, createComponent(Show, {
|
|
1867
|
+
get when() {
|
|
1868
|
+
return props.showInfo;
|
|
1869
|
+
},
|
|
1870
|
+
get children() {
|
|
1871
|
+
const _el$3 = _tmpl$3$5();
|
|
1872
|
+
insert(_el$3, createComponent(Switch$1, {
|
|
1873
|
+
get fallback() {
|
|
1874
|
+
return `${props.percent}%`;
|
|
1875
|
+
},
|
|
1876
|
+
get children() {
|
|
1877
|
+
return [createComponent(Match, {
|
|
1878
|
+
get when() {
|
|
1879
|
+
return props.status === 'success' || props.percent >= 100;
|
|
1880
|
+
},
|
|
1881
|
+
get children() {
|
|
1882
|
+
return _tmpl$$f();
|
|
1883
|
+
}
|
|
1884
|
+
}), createComponent(Match, {
|
|
1885
|
+
get when() {
|
|
1886
|
+
return props.status === 'error';
|
|
1887
|
+
},
|
|
1888
|
+
get children() {
|
|
1889
|
+
return _tmpl$2$7();
|
|
1890
|
+
}
|
|
1891
|
+
})];
|
|
1892
|
+
}
|
|
1893
|
+
}));
|
|
1894
|
+
return _el$3;
|
|
1895
|
+
}
|
|
1896
|
+
}), null);
|
|
1897
|
+
effect(_p$ => {
|
|
1898
|
+
const _v$ = cs('ant-w-full ant-bg-[var(--ant-progress-remaining-color)]', 'before:ant-content-empty before:ant-block before:ant-bg-[var(--primary-color)] before:ant-w-[var(--percent)] before:ant-h-full before:ant-rounded-inherit'),
|
|
1899
|
+
_v$2 = `${props.height}px`,
|
|
1900
|
+
_v$3 = `${props.height / 2}px`,
|
|
1901
|
+
_v$4 = `${props.percent}%`;
|
|
1902
|
+
_v$ !== _p$._v$ && className(_el$2, _p$._v$ = _v$);
|
|
1903
|
+
_v$2 !== _p$._v$2 && ((_p$._v$2 = _v$2) != null ? _el$2.style.setProperty("height", _v$2) : _el$2.style.removeProperty("height"));
|
|
1904
|
+
_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"));
|
|
1905
|
+
_v$4 !== _p$._v$4 && ((_p$._v$4 = _v$4) != null ? _el$2.style.setProperty("--percent", _v$4) : _el$2.style.removeProperty("--percent"));
|
|
1906
|
+
return _p$;
|
|
1907
|
+
}, {
|
|
1908
|
+
_v$: undefined,
|
|
1909
|
+
_v$2: undefined,
|
|
1910
|
+
_v$3: undefined,
|
|
1911
|
+
_v$4: undefined
|
|
1912
|
+
});
|
|
1913
|
+
return _el$;
|
|
1914
|
+
})();
|
|
1915
|
+
};
|
|
1614
1916
|
|
|
1615
1917
|
const _tmpl$$e = /*#__PURE__*/template(`<div>`),
|
|
1616
1918
|
_tmpl$2$6 = /*#__PURE__*/template(`<div><div>`);
|
|
@@ -1847,7 +2149,7 @@ const Popconfirm = props => {
|
|
|
1847
2149
|
|
|
1848
2150
|
const Upload = replaceChildren(replaceClassName(reactToSolidComponent(Upload$1)));
|
|
1849
2151
|
|
|
1850
|
-
const _tmpl$$b = /*#__PURE__*/template(`<label class="ant-inline-flex ant-gap-4px"><input type="radio">`),
|
|
2152
|
+
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
2153
|
_tmpl$2$4 = /*#__PURE__*/template(`<label><input class="ant-w-0 ant-h-0" type="radio">`),
|
|
1852
2154
|
_tmpl$3$3 = /*#__PURE__*/template(`<div>`);
|
|
1853
2155
|
const Radio = props => {
|
|
@@ -1855,18 +2157,20 @@ const Radio = props => {
|
|
|
1855
2157
|
defaultValue: false,
|
|
1856
2158
|
defaultValuePropName: 'defaultChecked',
|
|
1857
2159
|
valuePropName: 'checked',
|
|
1858
|
-
trigger:
|
|
2160
|
+
trigger: null
|
|
1859
2161
|
});
|
|
1860
2162
|
return (() => {
|
|
1861
2163
|
const _el$ = _tmpl$$b(),
|
|
1862
|
-
_el$2 = _el$.firstChild
|
|
1863
|
-
|
|
2164
|
+
_el$2 = _el$.firstChild,
|
|
2165
|
+
_el$3 = _el$2.firstChild;
|
|
2166
|
+
_el$3.$$input = e => {
|
|
1864
2167
|
setChecked(e.target.checked);
|
|
1865
2168
|
untrack(() => props.onChange?.(e));
|
|
1866
2169
|
};
|
|
1867
2170
|
insert(_el$, () => props.children, null);
|
|
1868
|
-
effect(() => _el$2
|
|
1869
|
-
effect(() => _el$
|
|
2171
|
+
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(--primary-color)]')));
|
|
2172
|
+
effect(() => _el$3.checked = checked());
|
|
2173
|
+
effect(() => _el$3.value = props.value ?? '');
|
|
1870
2174
|
return _el$;
|
|
1871
2175
|
})();
|
|
1872
2176
|
};
|
|
@@ -1875,20 +2179,20 @@ Radio.Button = props => {
|
|
|
1875
2179
|
defaultValue: false,
|
|
1876
2180
|
defaultValuePropName: 'defaultChecked',
|
|
1877
2181
|
valuePropName: 'checked',
|
|
1878
|
-
trigger:
|
|
2182
|
+
trigger: null
|
|
1879
2183
|
});
|
|
1880
2184
|
return (() => {
|
|
1881
|
-
const _el$
|
|
1882
|
-
_el$
|
|
1883
|
-
_el$
|
|
2185
|
+
const _el$4 = _tmpl$2$4(),
|
|
2186
|
+
_el$5 = _el$4.firstChild;
|
|
2187
|
+
_el$5.$$input = e => {
|
|
1884
2188
|
setChecked(e.target.checked);
|
|
1885
2189
|
untrack(() => props.onChange?.(e));
|
|
1886
2190
|
};
|
|
1887
|
-
insert(_el$
|
|
1888
|
-
effect(() => className(_el$
|
|
1889
|
-
effect(() => _el$
|
|
1890
|
-
effect(() => _el$
|
|
1891
|
-
return _el$
|
|
2191
|
+
insert(_el$4, () => props.children, null);
|
|
2192
|
+
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(--primary-color)] not[:last-child]:ant-border-r-transparent ant-cursor-pointer ant-flex-grow ant-justify-center', checked() && 'ant-text-[var(--primary-color)] ant-[border:1px_solid_var(--primary-color)] !ant-border-r-[var(--primary-color)]')));
|
|
2193
|
+
effect(() => _el$5.checked = checked());
|
|
2194
|
+
effect(() => _el$5.value = props.value ?? '');
|
|
2195
|
+
return _el$4;
|
|
1892
2196
|
})();
|
|
1893
2197
|
};
|
|
1894
2198
|
Radio.Group = _props => {
|
|
@@ -1896,12 +2200,12 @@ Radio.Group = _props => {
|
|
|
1896
2200
|
optionType: 'default'
|
|
1897
2201
|
}, _props);
|
|
1898
2202
|
const [value, setValue] = createControllableValue(props, {
|
|
1899
|
-
trigger:
|
|
2203
|
+
trigger: null
|
|
1900
2204
|
});
|
|
1901
2205
|
const isChecked = createSelector(value);
|
|
1902
2206
|
return (() => {
|
|
1903
|
-
const _el$
|
|
1904
|
-
insert(_el$
|
|
2207
|
+
const _el$6 = _tmpl$3$3();
|
|
2208
|
+
insert(_el$6, createComponent(For, {
|
|
1905
2209
|
get each() {
|
|
1906
2210
|
return props.options;
|
|
1907
2211
|
},
|
|
@@ -1917,15 +2221,17 @@ Radio.Group = _props => {
|
|
|
1917
2221
|
},
|
|
1918
2222
|
onChange: e => {
|
|
1919
2223
|
setValue(option.value);
|
|
1920
|
-
untrack(() =>
|
|
2224
|
+
untrack(() => {
|
|
2225
|
+
props.onChange?.(e);
|
|
2226
|
+
});
|
|
1921
2227
|
},
|
|
1922
2228
|
get children() {
|
|
1923
2229
|
return option.label;
|
|
1924
2230
|
}
|
|
1925
2231
|
})
|
|
1926
2232
|
}));
|
|
1927
|
-
effect(() => className(_el$
|
|
1928
|
-
return _el$
|
|
2233
|
+
effect(() => className(_el$6, cs(props.block ? 'ant-flex' : 'ant-inline-flex', props.optionType === 'default' ? 'ant-gap-8px' : '')));
|
|
2234
|
+
return _el$6;
|
|
1929
2235
|
})();
|
|
1930
2236
|
};
|
|
1931
2237
|
delegateEvents(["input"]);
|
|
@@ -2353,4 +2659,4 @@ const Collapse = props => {
|
|
|
2353
2659
|
};
|
|
2354
2660
|
delegateEvents(["click"]);
|
|
2355
2661
|
|
|
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 };
|
|
2662
|
+
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 };
|