x-ui-design 0.2.0 → 0.2.2
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/dist/esm/types/components/Button/Button.client.d.ts +1 -1
- package/dist/esm/types/components/DatePicker/DatePicker.d.ts +2 -2
- package/dist/esm/types/components/DatePicker/RangePicker/RangePicker.d.ts +1 -1
- package/dist/esm/types/components/Empty/Empty.d.ts +1 -1
- package/dist/esm/types/components/Form/Item/Item.d.ts +1 -1
- package/dist/esm/types/components/Icons/Icons.d.ts +13 -13
- package/dist/esm/types/components/Radio/Button/Button.d.ts +1 -1
- package/dist/esm/types/components/Radio/Group/Group.d.ts +1 -1
- package/dist/esm/types/components/Radio/Radio.d.ts +2 -2
- package/dist/esm/types/components/Upload/Upload.d.ts +1 -1
- package/dist/index.d.ts +25 -24
- package/dist/index.esm.js +1045 -888
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1044 -887
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/tsconfig.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useState, useContext, useMemo, useEffect, Children, isValidElement, Fragment, createElement, createContext, forwardRef, useImperativeHandle, cloneElement, useCallback } from 'react';
|
|
2
3
|
import { createPortal } from 'react-dom';
|
|
3
4
|
|
|
4
5
|
function styleInject(css, ref) {
|
|
@@ -29,16 +30,6 @@ function styleInject(css, ref) {
|
|
|
29
30
|
var css_248z$l = ":root{--xui-color-hover:#f5f5f5;--xui-color-disabled:#e6e6e6;--xui-primary-color:#1677ff;--xui-primary-color-light:#40a9ff;--xui-text-color:rgba(0,0,0,.88);--xui-text-color-light:rgba(0,0,0,.5);--xui-error-color:#ff4d4f;--xui-error-color-light:#ff6668;--xui-success-color:#52c41a;--xui-background-color:#fff;--xui-font-size-xs:12px;--xui-font-size-sm:14px;--xui-font-size-md:14px;--xui-font-size-lg:16px;--xui-border-radius-sm:4px;--xui-border-radius-md:4px;--xui-border-radius-lg:6px;--xui-border-color:#d9d9d9;--xui-select-primary-color:var(--xui-primary-color);--xui-select-background-color:var(--xui-background-color)}html{font-family:sans-serif}.globalEllipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";
|
|
30
31
|
styleInject(css_248z$l);
|
|
31
32
|
|
|
32
|
-
function _extends() {
|
|
33
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
34
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
35
|
-
var t = arguments[e];
|
|
36
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
37
|
-
}
|
|
38
|
-
return n;
|
|
39
|
-
}, _extends.apply(null, arguments);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
33
|
const useForm = (initialValues = {}, onFieldsChange, onValuesChange) => {
|
|
43
34
|
const touchedFieldsRef = useRef(new Set());
|
|
44
35
|
const rulesRef = useRef({});
|
|
@@ -371,48 +362,52 @@ const FormItem = ({
|
|
|
371
362
|
}, [errorRef.current]);
|
|
372
363
|
const isRequired = useMemo(() => rules.some(rule => rule.required), [rules]);
|
|
373
364
|
const errorMessage = getFieldError(valuePropName || name)?.[0];
|
|
374
|
-
return
|
|
365
|
+
return jsxs("div", {
|
|
375
366
|
style: style,
|
|
376
367
|
className: clsx([`${prefixCls}`, {
|
|
377
368
|
[layout]: layout,
|
|
378
369
|
[className]: className,
|
|
379
370
|
noStyle: props.noStyle
|
|
380
|
-
}])
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
name
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
371
|
+
}]),
|
|
372
|
+
children: [!props.noStyle && (label || name) && jsxs("label", {
|
|
373
|
+
className: `${prefixCls}-label`,
|
|
374
|
+
htmlFor: name,
|
|
375
|
+
children: [label || name, ":", isRequired && jsx("span", {
|
|
376
|
+
className: `${prefixCls}-required`,
|
|
377
|
+
children: "*"
|
|
378
|
+
})]
|
|
379
|
+
}), Children.map(childrenList, (child, key) => {
|
|
380
|
+
if (/*#__PURE__*/isValidElement(child) && child.type !== Fragment) {
|
|
381
|
+
const {
|
|
382
|
+
value,
|
|
383
|
+
...childProps
|
|
384
|
+
} = child.props;
|
|
385
|
+
const fieldValue = getFieldValue(valuePropName || name) ?? initialValue;
|
|
386
|
+
return /*#__PURE__*/createElement(FormItemChildComponent, {
|
|
387
|
+
...childProps,
|
|
388
|
+
name: name,
|
|
389
|
+
child: child,
|
|
390
|
+
value: value,
|
|
391
|
+
fieldValue: fieldValue,
|
|
392
|
+
noStyle: props.noStyle,
|
|
393
|
+
normalize: props.normalize,
|
|
394
|
+
key: `${key}_${isReseting}`,
|
|
395
|
+
error: Boolean(errorMessage),
|
|
396
|
+
setFieldValue: setFieldValue,
|
|
397
|
+
valuePropName: valuePropName,
|
|
398
|
+
feedbackIcons: feedbackIcons,
|
|
399
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
400
|
+
// @ts-expect-error
|
|
401
|
+
size: childProps.size || props.size
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
return child;
|
|
405
|
+
}), !props.noStyle && errorMessage && jsx("span", {
|
|
406
|
+
ref: errorRef,
|
|
407
|
+
className: `${prefixCls}-error`,
|
|
408
|
+
children: errorMessage
|
|
409
|
+
})]
|
|
410
|
+
});
|
|
416
411
|
};
|
|
417
412
|
const FormItemChildComponent = ({
|
|
418
413
|
child,
|
|
@@ -449,15 +444,16 @@ const FormItemChildComponent = ({
|
|
|
449
444
|
setFieldValue(valuePropName || name, rawValue);
|
|
450
445
|
onChange?.(e, option);
|
|
451
446
|
};
|
|
452
|
-
return /*#__PURE__*/
|
|
447
|
+
return /*#__PURE__*/createElement(child.type, {
|
|
448
|
+
...props,
|
|
453
449
|
name: name,
|
|
454
|
-
onChange: handleChange
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
450
|
+
onChange: handleChange,
|
|
451
|
+
...(error ? {
|
|
452
|
+
error
|
|
453
|
+
} : {}),
|
|
458
454
|
key: `${name}_${wasNormalize}`,
|
|
459
455
|
value: fieldValue ?? props.value
|
|
460
|
-
})
|
|
456
|
+
});
|
|
461
457
|
};
|
|
462
458
|
FormItem.displayName = 'FormItem';
|
|
463
459
|
|
|
@@ -500,118 +496,128 @@ const Form = ({
|
|
|
500
496
|
formInstance.onValuesChange = onValuesChange;
|
|
501
497
|
}
|
|
502
498
|
}, [formInstance, onFieldsChange, onValuesChange]);
|
|
503
|
-
return
|
|
504
|
-
value: formInstance
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
499
|
+
return jsx(FormContext.Provider, {
|
|
500
|
+
value: formInstance,
|
|
501
|
+
children: jsx("form", {
|
|
502
|
+
style: style,
|
|
503
|
+
ref: formRef,
|
|
504
|
+
onSubmit: handleSubmit,
|
|
505
|
+
className: `${prefixCls} ${className}`,
|
|
506
|
+
children: Children.map(childrenList, child => {
|
|
507
|
+
if (/*#__PURE__*/isValidElement(child) && child.type !== Fragment) {
|
|
508
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
509
|
+
// @ts-expect-error
|
|
510
|
+
const {
|
|
511
|
+
...childProps
|
|
512
|
+
} = child.props;
|
|
513
|
+
return jsx(child.type, {
|
|
514
|
+
...childProps,
|
|
515
|
+
child: child,
|
|
516
|
+
size: childProps.size || rest.size,
|
|
517
|
+
layout: childProps.layout || layout
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
return child;
|
|
521
|
+
})
|
|
522
|
+
})
|
|
523
|
+
});
|
|
525
524
|
};
|
|
526
525
|
Form.Item = FormItem;
|
|
527
526
|
|
|
528
527
|
var css_248z$j = ".xUi-rangepicker-range-container{font-size:14px;position:relative;user-select:none}.xUi-rangepicker-range-input-wrapper{background-color:#fff;border-radius:6px;display:flex;transition:all .3s;width:100%}.xUi-rangepicker-range-input-wrapper:hover{border-color:#4096ff}.xUi-rangepicker-range-input{align-items:center;border-right:1px solid var(--xui-border-color);cursor:pointer;display:flex;flex:1;padding:4px 11px}.xUi-rangepicker-range-input:last-child{border-right:none}.xUi-rangepicker-range-input input{background:transparent;border:none;color:#000;cursor:pointer;font-size:14px;outline:none;width:100%}.xUi-rangepicker-range-input input::placeholder{color:#bfbfbf}.xUi-rangepicker-range-clear,.xUi-rangepicker-range-icon{align-items:center;display:flex;margin-left:8px;transition:color .3s}.xUi-rangepicker-range-icon{color:rgba(0,0,0,.25)}.xUi-rangepicker-range-clear{color:rgba(0,0,0,.45);cursor:pointer}.xUi-rangepicker-range-clear:hover{color:#000}.xUi-rangepicker-range-dropdown-wrapper{background:#fff;border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,.15);display:none;left:0;margin-top:4px;min-width:560px;opacity:1;padding:8px;position:absolute;top:100%;transform:translateY(4px);transition:opacity .2s ease,transform .2s ease;z-index:1050}.xUi-rangepicker-range-dropdown-wrapper.show{display:flex}.xUi-rangepicker-dropdown-range,.xUi-rangepicker-range-dropdown{background-color:#fff;border:1px solid var(--xui-border-color);border-radius:6px;display:flex;margin-top:2px;overflow:hidden}.xUi-rangepicker-calendar{background:#fff;border-radius:6px;margin:12px}.xUi-rangepicker-calendar.month,.xUi-rangepicker-calendar.year{width:280px}.xUi-rangepicker-calendar-header{align-items:center;display:flex;font-weight:500;justify-content:space-between}.xUi-rangepicker-month,.xUi-rangepicker-year{background:none;border:none;border-radius:4px;color:var(--xui-text-color);cursor:pointer;height:30px;line-height:30px;margin:7px;min-width:30px;text-align:center;transition:all .2s}.xUi-rangepicker-day:disabled,.xUi-rangepicker-month:disabled,.xUi-rangepicker-select:disabled,.xUi-rangepicker-year:disabled{background-color:var(--xui-color-disabled);cursor:not-allowed;opacity:.5}.xUi-rangepicker-day:not(:disabled):hover,.xUi-rangepicker-month:not(:disabled):hover,.xUi-rangepicker-year:not(:disabled):hover{background:var(--xui-primary-color-light);color:#fff}.xUi-rangepicker-calendar-header button,.xUi-rangepicker-dropdown-selects button,.xUi-rangepicker-nav-buttons button{background:transparent;border:none;color:#595959;cursor:pointer;font-size:14px;font-weight:600;line-height:1;padding:0 6px;transition:color .2s ease}.xUi-rangepicker-nav-buttons button{font-size:20px;font-weight:400}.xUi-rangepicker-calendar-header button:hover,.xUi-rangepicker-dropdown-selects button:hover,.xUi-rangepicker-nav-buttons button:hover{color:var(--xui-primary-color)}.xUi-rangepicker-input{align-items:center;background-color:transparent;border:1px solid var(--xui-border-color);border-radius:6px;color:var(--xui-text-color);cursor:pointer;display:flex;gap:8px;justify-content:space-between;padding:3px 7px;transition:all .3s}.xUi-rangepicker-input.noBordered{border:none!important}.xUi-rangepicker-input input{border:none;color:var(--xui-text-color);font-size:var(--xui-font-size-sm);outline:none;padding:0}.xUi-rangepicker-input:placeholder-shown{text-overflow:ellipsis}.xUi-rangepicker-input:hover{border-color:var(--xui-primary-color)}.xUi-rangepicker-weekday-row{background-color:#fff;box-shadow:0 1px 0 rgba(0,0,0,.1);display:grid;gap:4px;grid-template-columns:repeat(7,1fr);position:sticky;top:0;z-index:1}.xUi-rangepicker-weekday{align-items:center;color:var(--xui-text-color);display:flex;font-size:12px;font-weight:500;font-weight:600;height:30px;justify-content:center;text-align:center}.xUi-rangepicker-days-grid,.xUi-rangepicker-grid{display:grid;gap:2px;grid-template-columns:repeat(3,1fr)}.xUi-rangepicker-days-grid.day{grid-template-columns:repeat(7,0fr)}.xUi-rangepicker-day{background-color:transparent;border:none;border-radius:4px;cursor:pointer;height:30px;line-height:30px;text-align:center;transition:background-color .3s,color .3s;width:30px}.xUi-rangepicker-day:hover{background-color:var(--xui-primary-color);border-radius:4px;color:#fff}.xUi-rangepicker-day.xUi-rangepicker-other-month:hover{background-color:var(--xui-color-disabled)!important;color:var(--xui-text-color)}.xUi-rangepicker-range-end:not(.xUi-rangepicker-other-month),.xUi-rangepicker-range-start:not(.xUi-rangepicker-other-month),.xUi-rangepicker-selected:not(.xUi-rangepicker-other-month){background-color:var(--xui-primary-color);color:#fff;font-weight:600}.xUi-rangepicker-in-range:not(.xUi-rangepicker-other-month){background-color:#f0f5ff}.xUi-rangepicker-hover-end{background-color:var(--xui-primary-color)!important}.xUi-rangepicker-disabled,.xUi-rangepicker-other-month{color:#ccc}.xUi-rangepicker-disabled{cursor:not-allowed}.xUi-rangepicker-footer{display:flex;grid-column:span 7;justify-content:center;padding-top:6px}.xUi-rangepicker-select{background:none;border:none;color:var(--xui-primary-color);cursor:pointer}.xUi-rangepicker-input.sm{font-size:var(--xui-font-size-sm);padding:4px 8px}.xUi-rangepicker-input.md{font-size:var(--xui-font-size-md);padding:8px 12px}.xUi-rangepicker-input.lg{font-size:var(--xui-font-size-lg);padding:10px 16px}.xUi-rangepicker-dropdown-wrapper{opacity:0;pointer-events:none;position:absolute;transform:scale(.95);transition:opacity .2s ease,transform .2s ease;z-index:1000}.xUi-rangepicker-dropdown-wrapper.bottomLeft{left:0;margin-top:4px;top:100%}.xUi-rangepicker-dropdown-wrapper.bottomRight{margin-top:4px;right:0;top:100%}.xUi-rangepicker-dropdown-wrapper.topLeft{bottom:100%;left:0;margin-bottom:4px}.xUi-rangepicker-dropdown-wrapper.topRight{bottom:100%;margin-bottom:4px;right:0}.xUi-rangepicker-dropdown-wrapper.show{opacity:1;pointer-events:auto;transform:scale(1)}.xUi-rangepicker-large .xUi-rangepicker-selected-date{font-size:16px}.xUi-rangepicker-large .xUi-rangepicker-input{padding:11px}.xUi-rangepicker-middle .xUi-rangepicker-input{padding:6px 11px}.xUi-rangepicker-dropdown-trigger{background-color:#fff;border:1px solid var(--xui-border-color);border-radius:2px;cursor:pointer;line-height:32px;padding:0 8px}.xUi-rangepicker-dropdown-menu{background:#fff;border:1px solid var(--xui-border-color);box-shadow:0 2px 8px rgba(0,0,0,.15);max-height:200px;overflow-y:auto;position:absolute;z-index:1000}.xUi-rangepicker-dropdown-item{cursor:pointer;padding:4px 12px}.xUi-rangepicker-dropdown-item:hover{background:#f5f5f5}.xUi-rangepicker-dropdown-item.active{background-color:#e6f7ff;font-weight:700}.xUi-rangepicker-header{align-items:center;border-bottom:1px solid var(--xui-border-color);display:flex;gap:8px;justify-content:space-between;margin-bottom:8px;padding-bottom:12px;width:100%}";
|
|
529
528
|
styleInject(css_248z$j);
|
|
530
529
|
|
|
531
|
-
const ClearIcon = () =>
|
|
530
|
+
const ClearIcon = () => jsx("svg", {
|
|
532
531
|
width: "10",
|
|
533
532
|
height: "10",
|
|
534
533
|
viewBox: "0 0 14 14",
|
|
535
534
|
fill: "none",
|
|
536
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
})
|
|
535
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
536
|
+
children: jsx("path", {
|
|
537
|
+
d: "M1 1L13 13M13 1L1 13",
|
|
538
|
+
stroke: "currentColor",
|
|
539
|
+
strokeWidth: "2",
|
|
540
|
+
strokeLinecap: "round"
|
|
541
|
+
})
|
|
542
|
+
});
|
|
543
543
|
const ArrowIcon = ({
|
|
544
544
|
isOpen
|
|
545
|
-
}) =>
|
|
545
|
+
}) => jsx("svg", {
|
|
546
546
|
width: "18",
|
|
547
547
|
height: "18",
|
|
548
548
|
viewBox: "0 0 24 24",
|
|
549
549
|
fill: "none",
|
|
550
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
})
|
|
559
|
-
|
|
550
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
551
|
+
children: jsx("path", {
|
|
552
|
+
d: "M7 10L12 15L17 10",
|
|
553
|
+
stroke: "currentColor",
|
|
554
|
+
strokeWidth: "2",
|
|
555
|
+
strokeLinecap: "round",
|
|
556
|
+
strokeLinejoin: "round",
|
|
557
|
+
transform: isOpen ? 'rotate(180, 12, 12)' : ''
|
|
558
|
+
})
|
|
559
|
+
});
|
|
560
|
+
const LoadingIcon = () => jsx("svg", {
|
|
560
561
|
viewBox: "0 0 1024 1024",
|
|
561
562
|
focusable: "false",
|
|
562
563
|
"data-icon": "loading",
|
|
563
564
|
width: "12",
|
|
564
565
|
height: "12",
|
|
565
566
|
fill: "currentColor",
|
|
566
|
-
"aria-hidden": "true"
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
})
|
|
570
|
-
|
|
567
|
+
"aria-hidden": "true",
|
|
568
|
+
children: jsx("path", {
|
|
569
|
+
d: "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"
|
|
570
|
+
})
|
|
571
|
+
});
|
|
572
|
+
const CheckIcon = () => jsx("svg", {
|
|
571
573
|
viewBox: "64 64 896 896",
|
|
572
574
|
focusable: "false",
|
|
573
575
|
"data-icon": "check",
|
|
574
576
|
width: "12",
|
|
575
577
|
height: "12",
|
|
576
578
|
fill: "currentColor",
|
|
577
|
-
"aria-hidden": "true"
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
})
|
|
581
|
-
|
|
579
|
+
"aria-hidden": "true",
|
|
580
|
+
children: jsx("path", {
|
|
581
|
+
d: "M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"
|
|
582
|
+
})
|
|
583
|
+
});
|
|
584
|
+
const SearchIcon = () => jsx("svg", {
|
|
582
585
|
viewBox: "64 64 896 896",
|
|
583
586
|
focusable: "false",
|
|
584
587
|
"data-icon": "search",
|
|
585
588
|
width: "1em",
|
|
586
589
|
height: "1em",
|
|
587
590
|
fill: "currentColor",
|
|
588
|
-
"aria-hidden": "true"
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
})
|
|
592
|
-
|
|
591
|
+
"aria-hidden": "true",
|
|
592
|
+
children: jsx("path", {
|
|
593
|
+
d: "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"
|
|
594
|
+
})
|
|
595
|
+
});
|
|
596
|
+
const CalendarIcon = () => jsx("svg", {
|
|
593
597
|
viewBox: "64 64 896 896",
|
|
594
598
|
focusable: "false",
|
|
595
599
|
"data-icon": "calendar",
|
|
596
600
|
width: "1em",
|
|
597
601
|
height: "1em",
|
|
598
602
|
fill: "currentColor",
|
|
599
|
-
"aria-hidden": "true"
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
})
|
|
603
|
-
|
|
603
|
+
"aria-hidden": "true",
|
|
604
|
+
children: jsx("path", {
|
|
605
|
+
d: "M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"
|
|
606
|
+
})
|
|
607
|
+
});
|
|
608
|
+
const SuccessIcon = () => jsx("svg", {
|
|
604
609
|
viewBox: "64 64 896 896",
|
|
605
610
|
focusable: "false",
|
|
606
611
|
"data-icon": "check-circle",
|
|
607
612
|
width: "1em",
|
|
608
613
|
height: "1em",
|
|
609
614
|
fill: "currentColor",
|
|
610
|
-
"aria-hidden": "true"
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
})
|
|
614
|
-
|
|
615
|
+
"aria-hidden": "true",
|
|
616
|
+
children: jsx("path", {
|
|
617
|
+
d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"
|
|
618
|
+
})
|
|
619
|
+
});
|
|
620
|
+
const ErrorIcon = () => jsx("svg", {
|
|
615
621
|
className: "error-svg-icon",
|
|
616
622
|
viewBox: "64 64 896 896",
|
|
617
623
|
focusable: "false",
|
|
@@ -619,67 +625,73 @@ const ErrorIcon = () => /*#__PURE__*/React.createElement("svg", {
|
|
|
619
625
|
width: "1em",
|
|
620
626
|
height: "1em",
|
|
621
627
|
fill: "currentColor",
|
|
622
|
-
"aria-hidden": "true"
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
})
|
|
626
|
-
|
|
628
|
+
"aria-hidden": "true",
|
|
629
|
+
children: jsx("path", {
|
|
630
|
+
d: "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"
|
|
631
|
+
})
|
|
632
|
+
});
|
|
633
|
+
const DateDistanceIcon = () => jsx("svg", {
|
|
627
634
|
viewBox: "0 0 1024 1024",
|
|
628
635
|
focusable: "false",
|
|
629
636
|
"data-icon": "swap-right",
|
|
630
637
|
width: "1em",
|
|
631
638
|
height: "1em",
|
|
632
639
|
fill: "currentColor",
|
|
633
|
-
"aria-hidden": "true"
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
})
|
|
637
|
-
|
|
640
|
+
"aria-hidden": "true",
|
|
641
|
+
children: jsx("path", {
|
|
642
|
+
d: "M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z"
|
|
643
|
+
})
|
|
644
|
+
});
|
|
645
|
+
const TimeIcon = () => jsxs("svg", {
|
|
638
646
|
viewBox: "64 64 896 896",
|
|
639
647
|
focusable: "false",
|
|
640
648
|
"data-icon": "clock-circle",
|
|
641
649
|
width: "1em",
|
|
642
650
|
height: "1em",
|
|
643
651
|
fill: "currentColor",
|
|
644
|
-
"aria-hidden": "true"
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
}),
|
|
648
|
-
|
|
649
|
-
})
|
|
650
|
-
|
|
652
|
+
"aria-hidden": "true",
|
|
653
|
+
children: [jsx("path", {
|
|
654
|
+
d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
|
|
655
|
+
}), jsx("path", {
|
|
656
|
+
d: "M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"
|
|
657
|
+
})]
|
|
658
|
+
});
|
|
659
|
+
const StampleIcon = () => jsx("svg", {
|
|
651
660
|
viewBox: "64 64 896 896",
|
|
652
661
|
focusable: "false",
|
|
653
662
|
"data-icon": "paper-clip",
|
|
654
663
|
width: "1em",
|
|
655
664
|
height: "1em",
|
|
656
665
|
fill: "currentColor",
|
|
657
|
-
"aria-hidden": "true"
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
})
|
|
661
|
-
|
|
666
|
+
"aria-hidden": "true",
|
|
667
|
+
children: jsx("path", {
|
|
668
|
+
d: "M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"
|
|
669
|
+
})
|
|
670
|
+
});
|
|
671
|
+
const TrashIcon = () => jsx("svg", {
|
|
662
672
|
viewBox: "64 64 896 896",
|
|
663
673
|
focusable: "false",
|
|
664
674
|
"data-icon": "delete",
|
|
665
675
|
width: "1em",
|
|
666
676
|
height: "1em",
|
|
667
677
|
fill: "currentColor",
|
|
668
|
-
"aria-hidden": "true"
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
})
|
|
672
|
-
|
|
678
|
+
"aria-hidden": "true",
|
|
679
|
+
children: jsx("path", {
|
|
680
|
+
d: "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
|
|
681
|
+
})
|
|
682
|
+
});
|
|
683
|
+
const SpinerIcon = () => jsx("svg", {
|
|
673
684
|
viewBox: "0 0 1024 1024",
|
|
674
685
|
focusable: "false",
|
|
675
686
|
"data-icon": "loading",
|
|
676
687
|
width: "1em",
|
|
677
688
|
height: "1em",
|
|
678
689
|
fill: "currentColor",
|
|
679
|
-
"aria-hidden": "true"
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
})
|
|
690
|
+
"aria-hidden": "true",
|
|
691
|
+
children: jsx("path", {
|
|
692
|
+
d: "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"
|
|
693
|
+
})
|
|
694
|
+
});
|
|
683
695
|
|
|
684
696
|
const RangePicker = ({
|
|
685
697
|
prefixCls = prefixClsRangePicker,
|
|
@@ -763,31 +775,41 @@ const RangePicker = ({
|
|
|
763
775
|
const renderMonthYearSelector = (monthOffset = 0, all) => {
|
|
764
776
|
const baseYear = currentYear;
|
|
765
777
|
const baseMonth = currentMonth + monthOffset;
|
|
766
|
-
return
|
|
767
|
-
className: `${prefixCls}-header
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
778
|
+
return jsxs("div", {
|
|
779
|
+
className: `${prefixCls}-header`,
|
|
780
|
+
children: [all || !monthOffset ? jsxs("div", {
|
|
781
|
+
className: `${prefixCls}-nav-buttons`,
|
|
782
|
+
children: [jsx("button", {
|
|
783
|
+
onClick: () => setCurrentYear(y => y - 1),
|
|
784
|
+
children: "\u00AB"
|
|
785
|
+
}), jsx("button", {
|
|
786
|
+
onClick: () => setCurrentMonth(m => m === 0 ? (setCurrentYear(y => y - 1), MONTH_LENGTH) : m - 1),
|
|
787
|
+
children: "\u2039"
|
|
788
|
+
})]
|
|
789
|
+
}) : jsx("span", {}), jsxs("div", {
|
|
790
|
+
className: `${prefixCls}-dropdown-selects`,
|
|
791
|
+
children: [jsx("button", {
|
|
792
|
+
type: "button",
|
|
793
|
+
className: `${prefixCls}-select`,
|
|
794
|
+
onClick: () => setViewMode('year'),
|
|
795
|
+
children: baseYear
|
|
796
|
+
}), jsx("button", {
|
|
797
|
+
type: "button",
|
|
798
|
+
className: `${prefixCls}-select`,
|
|
799
|
+
onClick: () => setViewMode('month'),
|
|
800
|
+
children: localeMonths[baseMonth]
|
|
801
|
+
})]
|
|
802
|
+
}), all || monthOffset ? jsxs("div", {
|
|
803
|
+
className: `${prefixCls}-nav-buttons`,
|
|
804
|
+
children: [jsx("button", {
|
|
805
|
+
onClick: () => setCurrentMonth(m => m === MONTH_LENGTH ? (setCurrentYear(y => y + 1), 0) : m + 1),
|
|
806
|
+
children: "\u203A"
|
|
807
|
+
}), jsx("button", {
|
|
808
|
+
onClick: () => setCurrentYear(y => y + 1),
|
|
809
|
+
children: "\u00BB"
|
|
810
|
+
})]
|
|
811
|
+
}) : jsx("span", {})]
|
|
812
|
+
});
|
|
791
813
|
};
|
|
792
814
|
const renderCalendar = (monthOffset = 0, all) => {
|
|
793
815
|
const baseDate = new Date(currentYear, currentMonth + monthOffset, 1);
|
|
@@ -811,105 +833,118 @@ const RangePicker = ({
|
|
|
811
833
|
length: remaining
|
|
812
834
|
}, (_, i) => new Date(year, month + 1, i + 1));
|
|
813
835
|
const days = [...prevMonthDays, ...currentMonthDays, ...nextMonthDays];
|
|
814
|
-
return
|
|
815
|
-
className: `${prefixCls}-calendar ${viewMode}
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
836
|
+
return jsxs("div", {
|
|
837
|
+
className: `${prefixCls}-calendar ${viewMode}`,
|
|
838
|
+
children: [jsx("div", {
|
|
839
|
+
className: `${prefixCls}-calendar-header`,
|
|
840
|
+
children: renderMonthYearSelector(monthOffset, all)
|
|
841
|
+
}), viewMode === 'day' && jsxs("div", {
|
|
842
|
+
className: `${prefixCls}-days-grid day`,
|
|
843
|
+
children: [localeWeekdays.map((day, i) => jsx("div", {
|
|
844
|
+
className: `${prefixCls}-weekday`,
|
|
845
|
+
children: day
|
|
846
|
+
}, i)), days.map((day, i) => {
|
|
847
|
+
const isSelected = day && selectedDates.some(d => d?.toDateString() === day.toDateString());
|
|
848
|
+
const inRange = day && isInRange(day);
|
|
849
|
+
const isSameMonth = day?.getMonth() === month;
|
|
850
|
+
return jsx("button", {
|
|
851
|
+
disabled: disabledDate?.(day, {
|
|
852
|
+
from: undefined,
|
|
853
|
+
to: undefined
|
|
854
|
+
}),
|
|
855
|
+
onClick: () => day && handleSelect(day),
|
|
856
|
+
onMouseEnter: () => day && setHoveredDate(day),
|
|
857
|
+
className: clsx([`${prefixCls}-day`, {
|
|
858
|
+
[`${prefixCls}-selected`]: isSelected,
|
|
859
|
+
[`${prefixCls}-in-range`]: inRange,
|
|
860
|
+
[`${prefixCls}-hover-end`]: hoveredDate && selectedDates[0] && !selectedDates[1] && hoveredDate > selectedDates[0] && hoveredDate.toDateString() === day?.toDateString(),
|
|
861
|
+
[`${prefixCls}-other-month`]: !isSameMonth
|
|
862
|
+
}]),
|
|
863
|
+
children: day?.getDate()
|
|
864
|
+
}, i);
|
|
865
|
+
})]
|
|
866
|
+
}), viewMode === 'month' && jsx("div", {
|
|
867
|
+
className: `${prefixCls}-grid`,
|
|
868
|
+
children: localeMonths.map((m, i) => jsx("button", {
|
|
869
|
+
className: `${prefixCls}-month`,
|
|
870
|
+
onClick: () => {
|
|
871
|
+
setCurrentMonth(i);
|
|
872
|
+
setViewMode('day');
|
|
873
|
+
},
|
|
874
|
+
disabled: isMonthDisabled(i),
|
|
875
|
+
children: m
|
|
876
|
+
}, i))
|
|
877
|
+
}), viewMode === 'year' && jsx("div", {
|
|
878
|
+
className: `${prefixCls}-grid`,
|
|
879
|
+
children: Array.from({
|
|
880
|
+
length: 12
|
|
881
|
+
}, (_, i) => {
|
|
882
|
+
const year = currentYear - NUMBER_SIX + i;
|
|
883
|
+
return jsx("button", {
|
|
884
|
+
className: `${prefixCls}-year`,
|
|
885
|
+
disabled: isYearDisabled(year),
|
|
886
|
+
onClick: () => {
|
|
887
|
+
setCurrentYear(year);
|
|
888
|
+
setViewMode('month');
|
|
889
|
+
},
|
|
890
|
+
children: year
|
|
891
|
+
}, year);
|
|
892
|
+
})
|
|
893
|
+
})]
|
|
894
|
+
});
|
|
868
895
|
};
|
|
869
896
|
const handleClear = () => {
|
|
870
897
|
setSelectedDates([null, null]);
|
|
871
898
|
onChange?.(null, ['', '']);
|
|
872
899
|
};
|
|
873
|
-
return
|
|
900
|
+
return jsxs("div", {
|
|
874
901
|
ref: containerRef,
|
|
875
902
|
style: style,
|
|
876
903
|
className: clsx([`${prefixCls}-range-container`, {
|
|
877
904
|
[`${prefixCls}-${size}`]: size,
|
|
878
905
|
[className]: className
|
|
879
|
-
}])
|
|
880
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
881
|
-
className: `${prefixCls}-range-input-wrapper`
|
|
882
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
883
|
-
type: "button",
|
|
884
|
-
className: clsx([`${prefixCls}-input`, {
|
|
885
|
-
noBordered: !bordered,
|
|
886
|
-
[`${prefixCls}-error`]: error,
|
|
887
|
-
[`${prefixCls}-disabled`]: disabled
|
|
888
906
|
}]),
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
907
|
+
children: [jsx("div", {
|
|
908
|
+
className: `${prefixCls}-range-input-wrapper`,
|
|
909
|
+
children: jsxs("button", {
|
|
910
|
+
type: "button",
|
|
911
|
+
className: clsx([`${prefixCls}-input`, {
|
|
912
|
+
noBordered: !bordered,
|
|
913
|
+
[`${prefixCls}-error`]: error,
|
|
914
|
+
[`${prefixCls}-disabled`]: disabled
|
|
915
|
+
}]),
|
|
916
|
+
disabled: disabled,
|
|
917
|
+
onClick: () => setIsOpen(!isOpen),
|
|
918
|
+
children: [prefix, jsx("input", {
|
|
919
|
+
readOnly: inputReadOnly,
|
|
920
|
+
className: `${prefixCls}-selected-date`,
|
|
921
|
+
placeholder: placeholder[0],
|
|
922
|
+
value: selectedDates[0] ? formatDate(selectedDates[0]) : ''
|
|
923
|
+
}), jsx("span", {
|
|
924
|
+
className: `${prefixCls}-range-separator`,
|
|
925
|
+
children: separator || jsx(DateDistanceIcon, {})
|
|
926
|
+
}), jsx("input", {
|
|
927
|
+
readOnly: inputReadOnly,
|
|
928
|
+
className: `${prefixCls}-selected-date`,
|
|
929
|
+
placeholder: placeholder[1],
|
|
930
|
+
value: selectedDates[1] ? formatDate(selectedDates[1]) : ''
|
|
931
|
+
}), jsx("span", {
|
|
932
|
+
className: `${prefixCls}-icon`,
|
|
933
|
+
children: allowClear && (selectedDates[0] || selectedDates[1]) ? jsx("span", {
|
|
934
|
+
className: `${prefixCls}-clear`,
|
|
935
|
+
onClick: handleClear,
|
|
936
|
+
children: jsx(ClearIcon, {})
|
|
937
|
+
}) : jsx(CalendarIcon, {})
|
|
938
|
+
})]
|
|
939
|
+
})
|
|
940
|
+
}), isOpen && jsx("div", {
|
|
941
|
+
className: `${prefixCls}-dropdown-wrapper show`,
|
|
942
|
+
children: jsxs("div", {
|
|
943
|
+
className: `${prefixCls}-dropdown-range`,
|
|
944
|
+
children: [renderCalendar(0, viewMode !== 'day'), viewMode === 'day' && renderCalendar(1, viewMode !== 'day')]
|
|
945
|
+
})
|
|
946
|
+
})]
|
|
947
|
+
});
|
|
913
948
|
};
|
|
914
949
|
|
|
915
950
|
var css_248z$i = ".xUi-datepicker-container{font-family:Arial,sans-serif;height:max-content;position:relative}.xUi-datepicker-input{align-items:center;background-color:transparent;border:1px solid var(--xui-border-color);border-radius:6px;color:var(--xui-text-color);cursor:pointer;display:flex;gap:8px;justify-content:space-between;padding:3px 7px;transition:all .3s}.xUi-datepicker-input.noBordered{border:none!important}.xUi-datepicker-input input{border:none;color:var(--xui-text-color);font-size:var(--xui-font-size-sm);outline:none;padding:0}.xUi-datepicker-input:placeholder-shown{text-overflow:ellipsis}.xUi-datepicker-input:hover{border-color:var(--xui-primary-color)}.xUi-datepicker-icon{color:var(--xui-text-color);cursor:pointer;height:16px;opacity:.6;transition:.3s ease;width:16px}.xUi-datepicker-icon:hover{color:var(--xui-primary-color);opacity:1}.xUi-datepicker-selected-date{border:none;color:var(--xui-text-color);font-size:var(--xui-font-size-md);letter-spacing:.8px;outline:none}.xUi-datepicker-disabled{background-color:var(--xui-color-disabled);border-color:var(--xui-border-color)!important;cursor:not-allowed;opacity:.5}.xUi-datepicker-disabled .xUi-datepicker-selected-date{cursor:not-allowed;opacity:.6}.xUi-datepicker-disabled .xUi-datepicker-icon{cursor:not-allowed}.xUi-datepicker-icon{align-items:center;color:#8c8c8c;display:flex;font-size:16px;gap:6px}.xUi-datepicker-error{border-color:var(--xui-error-color)}.xUi-datepicker-error .error-svg-icon,.xUi-datepicker-error .xUi-datepicker-icon,.xUi-datepicker-icon .error-svg-icon{color:var(--xui-error-color)}.xUi-datepicker-input.sm{font-size:var(--xui-font-size-sm);padding:4px 8px}.xUi-datepicker-input.md{font-size:var(--xui-font-size-md);padding:8px 12px}.xUi-datepicker-input.lg{font-size:var(--xui-font-size-lg);padding:10px 16px}.xUi-datepicker-dropdown-wrapper{opacity:0;pointer-events:none;position:absolute;transform:scale(.95);transition:opacity .2s ease,transform .2s ease;z-index:1000}.xUi-datepicker-dropdown-wrapper.bottomLeft{left:0;margin-top:4px;top:100%}.xUi-datepicker-dropdown-wrapper.bottomRight{margin-top:4px;right:0;top:100%}.xUi-datepicker-dropdown-wrapper.topLeft{bottom:100%;left:0;margin-bottom:4px}.xUi-datepicker-dropdown-wrapper.topRight{bottom:100%;margin-bottom:4px;right:0}.xUi-datepicker-dropdown-wrapper.show{opacity:1;pointer-events:auto;transform:scale(1)}.xUi-datepicker-dropdown{background:var(--xui-background-color);border:1px solid var(--xui-border-color);border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.15);min-width:250px;padding:12px}.xUi-datepicker-header{align-items:center;border-bottom:1px solid var(--xui-border-color);display:flex;gap:8px;justify-content:space-between;margin-bottom:8px;padding-bottom:12px}.xUi-datepicker-day-footer{align-items:center;border-top:1px solid var(--xui-border-color);display:flex;justify-content:center;margin-top:8px;padding-top:12px;width:100%}.xUi-datepicker-nav-buttons{display:flex;gap:4px}.xUi-datepicker-nav-buttons button{background:none;border:none;border-radius:4px;color:var(--xui-text-color);cursor:pointer;font-size:20px;opacity:.7;padding:2px 6px;transition:all .3s}.xUi-datepicker-nav-buttons button:not(:disabled):hover{color:var(--xui-primary-color)}.xUi-datepicker-dropdown-selects{align-items:center;display:flex;gap:6px}.xUi-datepicker-dropdown-selects button,.xUi-datepicker-select{background:var(--xui-background-color);border:none;border-radius:4px;color:var(--xui-text-color);cursor:pointer;font-weight:600;padding:4px 8px;transition:all .3s}.xUi-datepicker-dropdown-selects button:hover,.xUi-datepicker-select:not(:disabled):hover{color:var(--xui-primary-color)}.xUi-datepicker-grid{display:grid;gap:2px;grid-template-columns:repeat(3,1fr);text-align:center}.xUi-datepicker-grid.day{grid-template-columns:repeat(7,1fr)}.xUi-datepicker-day-header{color:var(--xui-text-color);font-size:14px;margin:4px 0;user-select:none}.xUi-datepicker-day,.xUi-datepicker-month,.xUi-datepicker-year{background:none;border:none;border-radius:4px;color:var(--xui-text-color);cursor:pointer;height:30px;line-height:30px;min-width:30px;text-align:center;transition:all .2s}.xUi-datepicker-month,.xUi-datepicker-year{margin:7px}.xUi-datepicker-day:disabled,.xUi-datepicker-month:disabled,.xUi-datepicker-select:disabled,.xUi-datepicker-year:disabled{background-color:var(--xui-color-disabled);cursor:not-allowed;opacity:.5}.xUi-datepicker-day:not(:disabled):hover,.xUi-datepicker-month:not(:disabled):hover,.xUi-datepicker-year:not(:disabled):hover{background:var(--xui-primary-color-light);color:#fff}.xUi-datepicker-selected{background:var(--xui-primary-color)!important;color:#fff!important;font-weight:700}.xUi-datepicker-other-month{color:var(--xui-text-color);opacity:.4}.xUi-datepicker-other-month:not(:disabled):hover{background-color:var(--xui-color-hover);color:var(--xui-text-color);user-select:none}.xUi-datepicker-footer{margin-top:12px;text-align:right}.xUi-datepicker-footer-today-btn{background:none;border:1px solid var(--xui-border-color);border-radius:4px;color:var(--xui-primary-color);cursor:pointer;font-size:13px;padding:4px 8px;transition:all .3s}.xUi-datepicker-footer-today-btn:not(:disabled):hover{background-color:var(--xui-primary-color-light);color:#fff}.xUi-datepicker-large .xUi-datepicker-selected-date{font-size:16px}.xUi-datepicker-large .xUi-datepicker-input{padding:11px}.xUi-datepicker-middle .xUi-datepicker-input{padding:6px 11px}";
|
|
@@ -1084,137 +1119,159 @@ const DatePickerComponent = ({
|
|
|
1084
1119
|
month: nextMonth,
|
|
1085
1120
|
year: nextMonthYear
|
|
1086
1121
|
}))];
|
|
1087
|
-
return
|
|
1122
|
+
return jsxs("div", {
|
|
1088
1123
|
ref: containerRef,
|
|
1089
1124
|
className: clsx([`${prefixCls}-container`, {
|
|
1090
1125
|
noStyle,
|
|
1091
1126
|
[`${prefixCls}-${size}`]: size
|
|
1092
|
-
}])
|
|
1093
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1094
|
-
className: `${prefixCls}-input-wrapper`
|
|
1095
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
1096
|
-
type: "button",
|
|
1097
|
-
className: clsx([`${prefixCls}-input`, {
|
|
1098
|
-
noBordered: !bordered,
|
|
1099
|
-
[`${prefixCls}-error`]: error,
|
|
1100
|
-
[`${prefixCls}-${size}`]: size,
|
|
1101
|
-
[`${prefixCls}-disabled`]: disabled
|
|
1102
1127
|
}]),
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
1141
|
-
type: "button",
|
|
1142
|
-
className: `${prefixCls}-select`,
|
|
1143
|
-
onClick: () => setViewMode('year')
|
|
1144
|
-
}, currentYear), /*#__PURE__*/React.createElement("button", {
|
|
1145
|
-
type: "button",
|
|
1146
|
-
className: `${prefixCls}-select`,
|
|
1147
|
-
onClick: () => setViewMode('month')
|
|
1148
|
-
}, localeMonths[currentMonth])), /*#__PURE__*/React.createElement("div", {
|
|
1149
|
-
className: `${prefixCls}-nav-buttons`
|
|
1150
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
1151
|
-
onClick: () => setCurrentMonth(m => m === MONTH_LENGTH ? (setCurrentYear(y => y + 1), 0) : m + 1)
|
|
1152
|
-
}, "\u203A"), /*#__PURE__*/React.createElement("button", {
|
|
1153
|
-
onClick: () => setCurrentYear(y => y + 1)
|
|
1154
|
-
}, "\xBB"))), viewMode === 'day' && /*#__PURE__*/React.createElement("div", {
|
|
1155
|
-
className: `${prefixCls}-grid day`
|
|
1156
|
-
}, localeWeekdays.map(day => /*#__PURE__*/React.createElement("div", {
|
|
1157
|
-
key: day,
|
|
1158
|
-
className: `${prefixCls}-day-header`
|
|
1159
|
-
}, day)), days.map(({
|
|
1160
|
-
day,
|
|
1161
|
-
current,
|
|
1162
|
-
month,
|
|
1163
|
-
year
|
|
1164
|
-
}, idx) => {
|
|
1165
|
-
const isSelected = selectedDate && selectedDate.getDate() === day && selectedDate.getMonth() === month && selectedDate.getFullYear() === year;
|
|
1166
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
1167
|
-
key: `${year}-${month}-${day}-${idx}`,
|
|
1168
|
-
className: clsx([`${prefixCls}-day`, {
|
|
1169
|
-
[`${prefixCls}-selected`]: isSelected,
|
|
1170
|
-
[`${prefixCls}-other-month`]: !current
|
|
1128
|
+
children: [jsx("div", {
|
|
1129
|
+
className: `${prefixCls}-input-wrapper`,
|
|
1130
|
+
children: jsxs("button", {
|
|
1131
|
+
type: "button",
|
|
1132
|
+
className: clsx([`${prefixCls}-input`, {
|
|
1133
|
+
noBordered: !bordered,
|
|
1134
|
+
[`${prefixCls}-error`]: error,
|
|
1135
|
+
[`${prefixCls}-${size}`]: size,
|
|
1136
|
+
[`${prefixCls}-disabled`]: disabled
|
|
1137
|
+
}]),
|
|
1138
|
+
disabled: disabled,
|
|
1139
|
+
onClick: () => setIsOpen(!isOpen),
|
|
1140
|
+
children: [prefix || null, jsx("input", {
|
|
1141
|
+
size: INPUT_SIZE$1,
|
|
1142
|
+
disabled: disabled,
|
|
1143
|
+
readOnly: inputReadOnly,
|
|
1144
|
+
className: `${prefixCls}-selected-date globalEllipsis`,
|
|
1145
|
+
placeholder: placeholder,
|
|
1146
|
+
style: {
|
|
1147
|
+
opacity: isOpen ? '0.6' : 1
|
|
1148
|
+
},
|
|
1149
|
+
defaultValue: selectedDatePlaceholder
|
|
1150
|
+
}), jsxs("span", {
|
|
1151
|
+
className: `${prefixCls}-icon`,
|
|
1152
|
+
children: [allowClear && selectedDate ? jsx("span", {
|
|
1153
|
+
className: `${prefixCls}-clear`,
|
|
1154
|
+
onClick: clearSelection,
|
|
1155
|
+
children: typeof allowClear === 'object' && allowClear.clearIcon ? allowClear.clearIcon : jsx(ClearIcon, {})
|
|
1156
|
+
}) : suffixIcon || jsx(CalendarIcon, {}), error && feedbackIcons ? jsx(ErrorIcon, {}) : null]
|
|
1157
|
+
})]
|
|
1158
|
+
})
|
|
1159
|
+
}), jsx("div", {
|
|
1160
|
+
style: popupContainerRef.current ? {
|
|
1161
|
+
position: 'absolute'
|
|
1162
|
+
} : {},
|
|
1163
|
+
className: clsx([placement, `${prefixCls}-dropdown-wrapper`, {
|
|
1164
|
+
show: isOpen
|
|
1171
1165
|
}]),
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1166
|
+
children: isOpen && jsxs("div", {
|
|
1167
|
+
className: `${prefixCls}-dropdown`,
|
|
1168
|
+
style: placementPossition,
|
|
1169
|
+
children: [jsxs("div", {
|
|
1170
|
+
className: `${prefixCls}-header`,
|
|
1171
|
+
children: [jsxs("div", {
|
|
1172
|
+
className: `${prefixCls}-nav-buttons`,
|
|
1173
|
+
children: [jsx("button", {
|
|
1174
|
+
onClick: () => setCurrentYear(y => y - 1),
|
|
1175
|
+
children: "\u00AB"
|
|
1176
|
+
}), jsx("button", {
|
|
1177
|
+
onClick: () => setCurrentMonth(m => m === 0 ? (setCurrentYear(y => y - 1), MONTH_LENGTH) : m - 1),
|
|
1178
|
+
children: "\u2039"
|
|
1179
|
+
})]
|
|
1180
|
+
}), jsxs("div", {
|
|
1181
|
+
className: `${prefixCls}-dropdown-selects`,
|
|
1182
|
+
children: [jsx("button", {
|
|
1183
|
+
type: "button",
|
|
1184
|
+
className: `${prefixCls}-select`,
|
|
1185
|
+
onClick: () => setViewMode('year'),
|
|
1186
|
+
children: currentYear
|
|
1187
|
+
}), jsx("button", {
|
|
1188
|
+
type: "button",
|
|
1189
|
+
className: `${prefixCls}-select`,
|
|
1190
|
+
onClick: () => setViewMode('month'),
|
|
1191
|
+
children: localeMonths[currentMonth]
|
|
1192
|
+
})]
|
|
1193
|
+
}), jsxs("div", {
|
|
1194
|
+
className: `${prefixCls}-nav-buttons`,
|
|
1195
|
+
children: [jsx("button", {
|
|
1196
|
+
onClick: () => setCurrentMonth(m => m === MONTH_LENGTH ? (setCurrentYear(y => y + 1), 0) : m + 1),
|
|
1197
|
+
children: "\u203A"
|
|
1198
|
+
}), jsx("button", {
|
|
1199
|
+
onClick: () => setCurrentYear(y => y + 1),
|
|
1200
|
+
children: "\u00BB"
|
|
1201
|
+
})]
|
|
1202
|
+
})]
|
|
1203
|
+
}), viewMode === 'day' && jsxs("div", {
|
|
1204
|
+
className: `${prefixCls}-grid day`,
|
|
1205
|
+
children: [localeWeekdays.map(day => jsx("div", {
|
|
1206
|
+
className: `${prefixCls}-day-header`,
|
|
1207
|
+
children: day
|
|
1208
|
+
}, day)), days.map(({
|
|
1209
|
+
day,
|
|
1210
|
+
current,
|
|
1211
|
+
month,
|
|
1212
|
+
year
|
|
1213
|
+
}, idx) => {
|
|
1214
|
+
const isSelected = selectedDate && selectedDate.getDate() === day && selectedDate.getMonth() === month && selectedDate.getFullYear() === year;
|
|
1215
|
+
return jsx("button", {
|
|
1216
|
+
className: clsx([`${prefixCls}-day`, {
|
|
1217
|
+
[`${prefixCls}-selected`]: isSelected,
|
|
1218
|
+
[`${prefixCls}-other-month`]: !current
|
|
1219
|
+
}]),
|
|
1220
|
+
onClick: () => handleSelect(day, month, year),
|
|
1221
|
+
disabled: disabledDate?.(new Date(year, month, day), {
|
|
1222
|
+
from: undefined,
|
|
1223
|
+
to: undefined
|
|
1224
|
+
}),
|
|
1225
|
+
children: day
|
|
1226
|
+
}, `${year}-${month}-${day}-${idx}`);
|
|
1227
|
+
})]
|
|
1228
|
+
}), viewMode === 'month' && jsx("div", {
|
|
1229
|
+
className: `${prefixCls}-grid`,
|
|
1230
|
+
children: localeMonths.map((m, i) => jsx("button", {
|
|
1231
|
+
className: `${prefixCls}-month`,
|
|
1232
|
+
onClick: () => {
|
|
1233
|
+
setCurrentMonth(i);
|
|
1234
|
+
setViewMode('day');
|
|
1235
|
+
},
|
|
1236
|
+
disabled: isMonthDisabled(i),
|
|
1237
|
+
children: m
|
|
1238
|
+
}, i))
|
|
1239
|
+
}), viewMode === 'year' && jsx("div", {
|
|
1240
|
+
className: `${prefixCls}-grid`,
|
|
1241
|
+
children: Array.from({
|
|
1242
|
+
length: 12
|
|
1243
|
+
}, (_, i) => {
|
|
1244
|
+
const year = currentYear - NUMBER_SIX + i;
|
|
1245
|
+
return jsx("button", {
|
|
1246
|
+
className: `${prefixCls}-year`,
|
|
1247
|
+
disabled: isYearDisabled(year),
|
|
1248
|
+
onClick: () => {
|
|
1249
|
+
setCurrentYear(year);
|
|
1250
|
+
setViewMode('month');
|
|
1251
|
+
},
|
|
1252
|
+
children: year
|
|
1253
|
+
}, year);
|
|
1254
|
+
})
|
|
1255
|
+
}), showToday && jsx("div", {
|
|
1256
|
+
className: `${prefixCls}-day-footer`,
|
|
1257
|
+
style: {
|
|
1258
|
+
gridColumn: 'span 7'
|
|
1259
|
+
},
|
|
1260
|
+
children: jsx("button", {
|
|
1261
|
+
className: `${prefixCls}-select`,
|
|
1262
|
+
disabled: disabledDate?.(new Date(DateNow.getDate(), DateNow.getMonth(), DateNow.getFullYear()), {
|
|
1263
|
+
from: undefined,
|
|
1264
|
+
to: undefined
|
|
1265
|
+
}),
|
|
1266
|
+
onClick: () => {
|
|
1267
|
+
handleSelect(DateNow.getDate(), DateNow.getMonth(), DateNow.getFullYear());
|
|
1268
|
+
},
|
|
1269
|
+
children: locale?.today || 'Today'
|
|
1270
|
+
})
|
|
1271
|
+
})]
|
|
1176
1272
|
})
|
|
1177
|
-
}
|
|
1178
|
-
})
|
|
1179
|
-
className: `${prefixCls}-grid`
|
|
1180
|
-
}, localeMonths.map((m, i) => /*#__PURE__*/React.createElement("button", {
|
|
1181
|
-
key: i,
|
|
1182
|
-
className: `${prefixCls}-month`,
|
|
1183
|
-
onClick: () => {
|
|
1184
|
-
setCurrentMonth(i);
|
|
1185
|
-
setViewMode('day');
|
|
1186
|
-
},
|
|
1187
|
-
disabled: isMonthDisabled(i)
|
|
1188
|
-
}, m))), viewMode === 'year' && /*#__PURE__*/React.createElement("div", {
|
|
1189
|
-
className: `${prefixCls}-grid`
|
|
1190
|
-
}, Array.from({
|
|
1191
|
-
length: 12
|
|
1192
|
-
}, (_, i) => {
|
|
1193
|
-
const year = currentYear - NUMBER_SIX + i;
|
|
1194
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
1195
|
-
key: year,
|
|
1196
|
-
className: `${prefixCls}-year`,
|
|
1197
|
-
disabled: isYearDisabled(year),
|
|
1198
|
-
onClick: () => {
|
|
1199
|
-
setCurrentYear(year);
|
|
1200
|
-
setViewMode('month');
|
|
1201
|
-
}
|
|
1202
|
-
}, year);
|
|
1203
|
-
})), showToday && /*#__PURE__*/React.createElement("div", {
|
|
1204
|
-
className: `${prefixCls}-day-footer`,
|
|
1205
|
-
style: {
|
|
1206
|
-
gridColumn: 'span 7'
|
|
1207
|
-
}
|
|
1208
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
1209
|
-
className: `${prefixCls}-select`,
|
|
1210
|
-
disabled: disabledDate?.(new Date(DateNow.getDate(), DateNow.getMonth(), DateNow.getFullYear()), {
|
|
1211
|
-
from: undefined,
|
|
1212
|
-
to: undefined
|
|
1213
|
-
}),
|
|
1214
|
-
onClick: () => {
|
|
1215
|
-
handleSelect(DateNow.getDate(), DateNow.getMonth(), DateNow.getFullYear());
|
|
1216
|
-
}
|
|
1217
|
-
}, locale?.today || 'Today')))));
|
|
1273
|
+
})]
|
|
1274
|
+
});
|
|
1218
1275
|
};
|
|
1219
1276
|
const DatePicker = Object.assign(DatePickerComponent, {
|
|
1220
1277
|
RangePicker
|
|
@@ -1242,8 +1299,8 @@ const TimePicker = ({
|
|
|
1242
1299
|
onBlur,
|
|
1243
1300
|
onSelect,
|
|
1244
1301
|
showNow = true,
|
|
1245
|
-
clearIcon =
|
|
1246
|
-
suffixIcon =
|
|
1302
|
+
clearIcon = jsx(ClearIcon, {}),
|
|
1303
|
+
suffixIcon = jsx(TimeIcon, {}),
|
|
1247
1304
|
placeholder = 'Select time'
|
|
1248
1305
|
}) => {
|
|
1249
1306
|
const [open, setOpen] = useState(false);
|
|
@@ -1426,109 +1483,124 @@ const TimePicker = ({
|
|
|
1426
1483
|
} = getTimeParts(tempValue);
|
|
1427
1484
|
const currentHour = selectedHour ?? 0;
|
|
1428
1485
|
const currentMinute = selectedMinute ?? 0;
|
|
1429
|
-
return
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1486
|
+
return jsxs("div", {
|
|
1487
|
+
children: [jsxs("div", {
|
|
1488
|
+
className: `${prefixCls}-panel`,
|
|
1489
|
+
children: [jsx("div", {
|
|
1490
|
+
ref: hourRef,
|
|
1491
|
+
className: `${prefixCls}-column`,
|
|
1492
|
+
children: hours.map((h, index) => h === false ? jsx("div", {
|
|
1493
|
+
className: `${prefixCls}-cell`,
|
|
1494
|
+
style: {
|
|
1495
|
+
opacity: 0,
|
|
1496
|
+
userSelect: 'none',
|
|
1497
|
+
cursor: 'inherit'
|
|
1498
|
+
},
|
|
1499
|
+
children: "0"
|
|
1500
|
+
}, `${h}_${index}`) : jsx("div", {
|
|
1501
|
+
className: clsx([`${prefixCls}-cell`, {
|
|
1502
|
+
[`${prefixCls}-cell-disabled`]: getDisabled('hour').includes(h),
|
|
1503
|
+
[`${prefixCls}-cell-selected`]: selectedHour === h
|
|
1504
|
+
}]),
|
|
1505
|
+
onClick: () => !getDisabled('hour').includes(h) && onSelectHour(h),
|
|
1506
|
+
children: pad(h)
|
|
1507
|
+
}, h))
|
|
1508
|
+
}), jsx("div", {
|
|
1509
|
+
ref: minuteRef,
|
|
1510
|
+
className: `${prefixCls}-column`,
|
|
1511
|
+
children: minutesSeconds.map((m, index) => m === false ? jsx("div", {
|
|
1512
|
+
className: `${prefixCls}-cell`,
|
|
1513
|
+
style: {
|
|
1514
|
+
opacity: 0,
|
|
1515
|
+
userSelect: 'none',
|
|
1516
|
+
cursor: 'inherit'
|
|
1517
|
+
},
|
|
1518
|
+
children: "0"
|
|
1519
|
+
}, `${m}_${index}`) : jsx("div", {
|
|
1520
|
+
className: clsx([`${prefixCls}-cell`, {
|
|
1521
|
+
[`${prefixCls}-cell-disabled`]: getDisabled('minute', currentHour).includes(m),
|
|
1522
|
+
[`${prefixCls}-cell-selected`]: selectedMinute === m
|
|
1523
|
+
}]),
|
|
1524
|
+
onClick: () => !getDisabled('minute', currentHour).includes(m) && onSelectMinute(m),
|
|
1525
|
+
children: pad(m)
|
|
1526
|
+
}, m))
|
|
1527
|
+
}), jsx("div", {
|
|
1528
|
+
ref: secondRef,
|
|
1529
|
+
className: `${prefixCls}-column`,
|
|
1530
|
+
children: minutesSeconds.map((s, index) => s === false ? jsx("div", {
|
|
1531
|
+
className: `${prefixCls}-cell`,
|
|
1532
|
+
style: {
|
|
1533
|
+
opacity: 0,
|
|
1534
|
+
userSelect: 'none',
|
|
1535
|
+
cursor: 'inherit'
|
|
1536
|
+
},
|
|
1537
|
+
children: "0"
|
|
1538
|
+
}, `${s}_${index}`) : jsx("div", {
|
|
1539
|
+
className: clsx([`${prefixCls}-cell`, {
|
|
1540
|
+
[`${prefixCls}-cell-disabled`]: getDisabled('second', currentHour, currentMinute).includes(s),
|
|
1541
|
+
[`${prefixCls}-cell-selected`]: selectedSecond === s
|
|
1542
|
+
}]),
|
|
1543
|
+
onClick: () => !getDisabled('second', currentHour, currentMinute).includes(s) && onSelectSecond(s),
|
|
1544
|
+
children: pad(s)
|
|
1545
|
+
}, s))
|
|
1546
|
+
})]
|
|
1547
|
+
}), jsxs("div", {
|
|
1548
|
+
className: `${prefixCls}-actions`,
|
|
1549
|
+
children: [showNow ? jsx("div", {
|
|
1550
|
+
className: `${prefixCls}-now-btn`,
|
|
1551
|
+
onClick: handleShowNow,
|
|
1552
|
+
children: "Now"
|
|
1553
|
+
}) : jsx("span", {}), jsx("button", {
|
|
1554
|
+
className: `${prefixCls}-ok-btn`,
|
|
1555
|
+
disabled: selectedHour === null || selectedMinute === null || selectedSecond === null,
|
|
1556
|
+
onClick: handleOkButton,
|
|
1557
|
+
children: "OK"
|
|
1558
|
+
})]
|
|
1559
|
+
})]
|
|
1560
|
+
});
|
|
1495
1561
|
};
|
|
1496
|
-
return
|
|
1562
|
+
return jsxs("div", {
|
|
1497
1563
|
className: clsx([`${prefixCls}-wrapper`, className]),
|
|
1498
|
-
style: style
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1564
|
+
style: style,
|
|
1565
|
+
children: [jsxs("div", {
|
|
1566
|
+
className: `${prefixCls}-input-wrapper`,
|
|
1567
|
+
onClick: () => setOpen(true),
|
|
1568
|
+
children: [jsx("input", {
|
|
1569
|
+
ref: inputRef,
|
|
1570
|
+
size: INPUT_SIZE,
|
|
1571
|
+
placeholder: placeholder,
|
|
1572
|
+
className: `${prefixCls}-input`,
|
|
1573
|
+
readOnly: inputReadOnly,
|
|
1574
|
+
onChange: handleOnChange,
|
|
1575
|
+
...(open ? {} : {
|
|
1576
|
+
value: formatDate(innerValue)
|
|
1577
|
+
}),
|
|
1578
|
+
onBlur: e => {
|
|
1579
|
+
onBlur?.(e, {
|
|
1580
|
+
source: 'input'
|
|
1581
|
+
});
|
|
1582
|
+
}
|
|
1583
|
+
}), jsx("div", {
|
|
1584
|
+
className: `${prefixCls}-icons`,
|
|
1585
|
+
children: clearIcon && innerValue ? jsx("span", {
|
|
1586
|
+
className: `${prefixCls}-clear`,
|
|
1587
|
+
onClick: handleClear,
|
|
1588
|
+
children: clearIcon
|
|
1589
|
+
}) : suffixIcon && jsx("span", {
|
|
1590
|
+
className: `${prefixCls}-suffix`,
|
|
1591
|
+
onClick: e => {
|
|
1592
|
+
e.stopPropagation();
|
|
1593
|
+
setOpen(true);
|
|
1594
|
+
},
|
|
1595
|
+
children: suffixIcon
|
|
1596
|
+
})
|
|
1597
|
+
})]
|
|
1598
|
+
}), open && jsx("div", {
|
|
1599
|
+
ref: popupRef,
|
|
1600
|
+
className: `${prefixCls}-popup`,
|
|
1601
|
+
children: renderOptions()
|
|
1602
|
+
})]
|
|
1603
|
+
});
|
|
1532
1604
|
};
|
|
1533
1605
|
|
|
1534
1606
|
var css_248z$g = ".xUi-input-container{align-items:center;background-color:transparent;border:1px solid var(--xui-border-color);border-radius:var(--xui-border-radius-sm);display:flex;overflow:hidden}.xUi-input-container:not(.xUi-input-error):has(.xUi-input):hover,.xUi-input-container:not(.xUi-input-error):has(.xUi-input:focus){border:1px solid var(--xui-primary-color)}.xUi-input-container.xUi-input-error{border-color:var(--xui-error-color)}.xUi-input-container.xUi-input-error .error-svg-icon,.xUi-input-suffix .error-svg-icon{color:var(--xui-error-color)}.xUi-input-wrapper{align-items:center;display:flex;flex-grow:1;margin:-1px;position:relative;transition:border .3s}.xUi-input,.xUi-input-wrapper{background-color:transparent;height:-webkit-fill-available}.xUi-input{border:none;color:var(--xui-text-color);flex:1;outline:none;padding:0 7px;width:100%}.xUi-input:placeholder-shown{text-overflow:ellipsis}.xUi-input::placeholder{color:var(--xui-text-color);opacity:.6}.xUi-input-prefix,.xUi-input-suffix{background-color:transparent;gap:4px}.xUi-input-addon,.xUi-input-prefix,.xUi-input-suffix{align-items:center;color:var(--xui-text-color);display:flex;height:-webkit-fill-available;padding:0 7px}.xUi-input-addon.xUi-input-after{border-left:1px solid var(--xui-border-color)}.xUi-input-addon.xUi-input-before{border-right:1px solid var(--xui-border-color)}.xUi-input-large .xUi-input-addon{padding:0 10px}.xUi-input-clear{align-items:center;cursor:pointer;display:flex;margin:0 3px;position:relative;width:16px}.xUi-input-clear svg{color:var(--xui-text-color)}.xUi-input-disabled{background-color:var(--xui-color-disabled);cursor:not-allowed}.xUi-input-small{height:22px}.xUi-input-large .xUi-input-clear,.xUi-input-small .xUi-input,.xUi-input-small .xUi-input::placeholder{font-size:var(--xui-font-size-md)}.xUi-input-middle{border-radius:var(--xui-border-radius-md);height:30px}.xUi-input-large .xUi-input-clear,.xUi-input-middle .xUi-input,.xUi-input-middle .xUi-input::placeholder{font-size:var(--xui-font-size-md)}.xUi-input-large{border-radius:var(--xui-border-radius-lg);height:40px}.xUi-input-large .xUi-input,.xUi-input-large .xUi-input-clear,.xUi-input-large .xUi-input::placeholder{font-size:var(--xui-font-size-lg)}";
|
|
@@ -1591,26 +1663,29 @@ const Textarea = /*#__PURE__*/forwardRef(({
|
|
|
1591
1663
|
});
|
|
1592
1664
|
}
|
|
1593
1665
|
};
|
|
1594
|
-
return
|
|
1595
|
-
className: `${prefixCls}-wrapper ${rootClassName || ''}
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
[`${prefixCls}
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1666
|
+
return jsxs("div", {
|
|
1667
|
+
className: `${prefixCls}-wrapper ${rootClassName || ''}`,
|
|
1668
|
+
children: [jsx("textarea", {
|
|
1669
|
+
...props,
|
|
1670
|
+
ref: ref || textareaRef,
|
|
1671
|
+
value: inputValue,
|
|
1672
|
+
onChange: handleChange,
|
|
1673
|
+
onKeyDown: handleKeyDown,
|
|
1674
|
+
style: {
|
|
1675
|
+
...styles?.textarea,
|
|
1676
|
+
...style
|
|
1677
|
+
},
|
|
1678
|
+
className: clsx([`${prefixCls} ${prefixCls}-${size} ${prefixCls}-${variant} ${className}`, {
|
|
1679
|
+
[`${prefixCls}-bordered`]: bordered,
|
|
1680
|
+
[`${prefixCls}-success`]: status === 'success',
|
|
1681
|
+
[`${prefixCls}-error`]: status === 'error' || error
|
|
1682
|
+
}])
|
|
1683
|
+
}), allowClear && inputValue && jsx("button", {
|
|
1684
|
+
className: `${prefixCls}-clear`,
|
|
1685
|
+
onClick: handleClear,
|
|
1686
|
+
children: "\u2715"
|
|
1687
|
+
})]
|
|
1688
|
+
});
|
|
1614
1689
|
});
|
|
1615
1690
|
Textarea.displayName = 'Textarea';
|
|
1616
1691
|
|
|
@@ -1662,40 +1737,49 @@ const InputComponent = /*#__PURE__*/forwardRef(({
|
|
|
1662
1737
|
onPressEnter(e);
|
|
1663
1738
|
}
|
|
1664
1739
|
};
|
|
1665
|
-
return
|
|
1740
|
+
return jsxs("div", {
|
|
1666
1741
|
className: clsx([`${prefixCls}-container`, {
|
|
1667
1742
|
[`${prefixCls}-error`]: error,
|
|
1668
1743
|
[`${prefixCls}-disabled`]: disabled,
|
|
1669
1744
|
[`${prefixCls}-${size}`]: size,
|
|
1670
1745
|
noStyle: noStyle
|
|
1671
1746
|
}, className]),
|
|
1672
|
-
style: props.style
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1747
|
+
style: props.style,
|
|
1748
|
+
children: [addonBefore && jsx("span", {
|
|
1749
|
+
className: `${prefixCls}-addon ${prefixCls}-before`,
|
|
1750
|
+
children: addonBefore
|
|
1751
|
+
}), jsxs("div", {
|
|
1752
|
+
className: `${prefixCls}-wrapper`,
|
|
1753
|
+
children: [prefix && jsx("span", {
|
|
1754
|
+
className: `${prefixCls}-prefix`,
|
|
1755
|
+
children: prefix
|
|
1756
|
+
}), jsx("input", {
|
|
1757
|
+
...props,
|
|
1758
|
+
ref: inputRef,
|
|
1759
|
+
...(props.type === 'password' && iconRender ? {
|
|
1760
|
+
type: iconRenderVisible ? 'text' : 'password'
|
|
1761
|
+
} : {}),
|
|
1762
|
+
disabled: disabled,
|
|
1763
|
+
value: internalValue,
|
|
1764
|
+
onChange: handleChange,
|
|
1765
|
+
onKeyDown: handleOnKeyDown,
|
|
1766
|
+
className: clsx([prefixCls, className])
|
|
1767
|
+
}), jsx("span", {
|
|
1768
|
+
className: `${prefixCls}-clear`,
|
|
1769
|
+
onClick: handleClear,
|
|
1770
|
+
children: allowClear && internalValue ? jsx(ErrorIcon, {}) : null
|
|
1771
|
+
}), (suffix || iconRender) && jsxs("span", {
|
|
1772
|
+
className: `${prefixCls}-suffix`,
|
|
1773
|
+
...(iconRender !== undefined ? {
|
|
1774
|
+
onClick: () => setIconRenderVisible(icon => !icon)
|
|
1775
|
+
} : {}),
|
|
1776
|
+
children: [suffix || iconRender?.(iconRenderVisible), error && feedbackIcons ? jsx(ErrorIcon, {}) : null]
|
|
1777
|
+
})]
|
|
1778
|
+
}), addonAfter ? jsx("span", {
|
|
1779
|
+
className: `${prefixCls}-addon ${prefixCls}-after`,
|
|
1780
|
+
children: addonAfter
|
|
1781
|
+
}) : null]
|
|
1782
|
+
});
|
|
1699
1783
|
});
|
|
1700
1784
|
InputComponent.displayName = 'Input';
|
|
1701
1785
|
const Input = InputComponent;
|
|
@@ -1713,7 +1797,8 @@ const RadioButton = ({
|
|
|
1713
1797
|
size = 'large',
|
|
1714
1798
|
...props
|
|
1715
1799
|
}) => {
|
|
1716
|
-
return
|
|
1800
|
+
return jsx(Radio, {
|
|
1801
|
+
...props,
|
|
1717
1802
|
checked: checked,
|
|
1718
1803
|
disabled: disabled,
|
|
1719
1804
|
className: clsx([`${prefixCls}-button`, {
|
|
@@ -1721,10 +1806,12 @@ const RadioButton = ({
|
|
|
1721
1806
|
[className]: className,
|
|
1722
1807
|
[`${prefixCls}-button-${size}`]: size,
|
|
1723
1808
|
[`${prefixCls}-button-checked`]: checked
|
|
1724
|
-
}])
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1809
|
+
}]),
|
|
1810
|
+
children: jsx("span", {
|
|
1811
|
+
className: `${prefixCls}-button-content`,
|
|
1812
|
+
children: children ?? props.value
|
|
1813
|
+
})
|
|
1814
|
+
});
|
|
1728
1815
|
};
|
|
1729
1816
|
|
|
1730
1817
|
var css_248z$d = ".xUi-radio-group.xUi-radio-group-small{height:24px}.xUi-radio-group.xUi-radio-group-small .xUi-radio-button:first-child{border-radius:var(--xui-border-radius-sm) 0 0 var(--xui-border-radius-sm)}.xUi-radio-group.xUi-radio-group-small .xUi-radio-button:last-child{border-radius:0 var(--xui-border-radius-sm) var(--xui-border-radius-sm) 0}.xUi-radio-group.xUi-radio-group-middle{height:32px}.xUi-radio-group.xUi-radio-group-middle .xUi-radio-button:first-child{border-radius:var(--xui-border-radius-md) 0 0 var(--xui-border-radius-md)}.xUi-radio-group.xUi-radio-group-middle .xUi-radio-button:last-child{border-radius:0 var(--xui-border-radius-md) var(--xui-border-radius-md) 0}.xUi-radio-group.xUi-radio-group-large{height:40px}.xUi-radio-group.xUi-radio-group-large .xUi-radio-button:first-child{border-radius:var(--xui-border-radius-lg) 0 0 var(--xui-border-radius-lg)}.xUi-radio-group.xUi-radio-group-large .xUi-radio-button:last-child{border-radius:0 var(--xui-border-radius-lg) var(--xui-border-radius-lg) 0}.xUi-radio-group .xUi-radio-button:not(:first-child){border-radius:0}.xUi-radio-group.block{display:inline-flex;width:100%}.xUi-radio-group.block .xUi-radio-button{width:100%}.xUi-radio-group:not(.xUi-radio-group-solid) .xUi-radio-button-checked{background-color:var(--xui-background-color);color:var(--xui-primary-color)}";
|
|
@@ -1752,12 +1839,13 @@ const RadioGroup = ({
|
|
|
1752
1839
|
return options.map((option, key) => {
|
|
1753
1840
|
const optionValue = typeof option === 'object' ? option.value : option;
|
|
1754
1841
|
const optionLabel = typeof option === 'object' ? option.label : option;
|
|
1755
|
-
return
|
|
1842
|
+
return jsx(Radio, {
|
|
1756
1843
|
value: optionValue,
|
|
1757
|
-
key: `${key}_${optionValue}`,
|
|
1758
1844
|
checked: selectedValue === optionValue,
|
|
1759
|
-
disabled: disabled || typeof option === 'object' && option.disabled
|
|
1760
|
-
|
|
1845
|
+
disabled: disabled || typeof option === 'object' && option.disabled,
|
|
1846
|
+
...props,
|
|
1847
|
+
children: optionLabel
|
|
1848
|
+
}, `${key}_${optionValue}`);
|
|
1761
1849
|
});
|
|
1762
1850
|
}
|
|
1763
1851
|
return Children.map(children, child => {
|
|
@@ -1779,7 +1867,7 @@ const RadioGroup = ({
|
|
|
1779
1867
|
return child;
|
|
1780
1868
|
});
|
|
1781
1869
|
};
|
|
1782
|
-
return
|
|
1870
|
+
return jsx("div", {
|
|
1783
1871
|
id: id,
|
|
1784
1872
|
style: style,
|
|
1785
1873
|
className: clsx([`${prefixCls}-group`, {
|
|
@@ -1787,8 +1875,9 @@ const RadioGroup = ({
|
|
|
1787
1875
|
className,
|
|
1788
1876
|
[`${prefixCls}-group-${size}`]: size,
|
|
1789
1877
|
[`${prefixCls}-group-solid`]: buttonStyle === 'solid'
|
|
1790
|
-
}])
|
|
1791
|
-
|
|
1878
|
+
}]),
|
|
1879
|
+
children: renderChildren()
|
|
1880
|
+
});
|
|
1792
1881
|
};
|
|
1793
1882
|
|
|
1794
1883
|
var css_248z$c = ".xUi-radio-label{align-items:center;cursor:pointer;display:inline-flex;font-size:var(--xui-font-size-md);line-height:1;margin:16px 0;position:relative}.xUi-radio-label input{display:none}.xUi-radio{border:1px solid var(--xui-border-color);border-radius:50%;height:16px;position:relative;transition:all .3s;width:16px}.xUi-radio-error:not(.xUi-radio-disabled){border:1px solid var(--xui-error-color)}.xUi-radio-label input:checked+.xUi-radio-error:not(.xUi-radio-disabled){background:var(--xui-error-color)}.xUi-radio-group{display:flex}.xUi-radio-label .xUi-radio-enabled:not(.xUi-radio-error):hover{border:1px solid var(--xui-primary-color-light)!important}.xUi-radio-disabled{background-color:var(--xui-color-disabled)}.xUi-radio-title{color:var(--xui-text-color);padding-inline-end:8px;padding-inline-start:8px}.xUi-radio-label input:checked+.xUi-radio{background:var(--xui-primary-color)}.xUi-radio-label input:checked+.xUi-radio:after{background-color:#fff;border-radius:50%;content:\"\";height:6px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:6px}.xUi-radio-label.disabled{cursor:not-allowed;opacity:.5}";
|
|
@@ -1823,7 +1912,7 @@ const RadioComponent = /*#__PURE__*/forwardRef(({
|
|
|
1823
1912
|
onChange?.(parseValue(value));
|
|
1824
1913
|
}
|
|
1825
1914
|
}, [defaultChecked, checked]);
|
|
1826
|
-
return
|
|
1915
|
+
return jsxs("label", {
|
|
1827
1916
|
ref: ref,
|
|
1828
1917
|
title: title,
|
|
1829
1918
|
onMouseEnter: onMouseEnter,
|
|
@@ -1832,20 +1921,22 @@ const RadioComponent = /*#__PURE__*/forwardRef(({
|
|
|
1832
1921
|
disabled,
|
|
1833
1922
|
noStyle: noStyle,
|
|
1834
1923
|
[className]: className
|
|
1835
|
-
}])
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1924
|
+
}]),
|
|
1925
|
+
children: [jsx("input", {
|
|
1926
|
+
name: name,
|
|
1927
|
+
type: "radio",
|
|
1928
|
+
onClick: onClick,
|
|
1929
|
+
disabled: disabled,
|
|
1930
|
+
onChange: handleChange,
|
|
1931
|
+
onBlur: e => onBlur?.(e),
|
|
1932
|
+
onFocus: e => onFocus?.(e)
|
|
1933
|
+
}), jsx("span", {
|
|
1934
|
+
className: clsx([`${prefixCls} ${prefixCls}-${disabled ? 'disabled' : 'enabled'}`])
|
|
1935
|
+
}), jsx("span", {
|
|
1936
|
+
className: `${prefixCls}-title`,
|
|
1937
|
+
children: children ?? title ?? value
|
|
1938
|
+
})]
|
|
1939
|
+
});
|
|
1849
1940
|
});
|
|
1850
1941
|
RadioComponent.displayName = 'Radio';
|
|
1851
1942
|
const Radio = Object.assign(RadioComponent, {
|
|
@@ -1874,16 +1965,18 @@ const Option = ({
|
|
|
1874
1965
|
}
|
|
1875
1966
|
onClick?.(e);
|
|
1876
1967
|
};
|
|
1877
|
-
return
|
|
1968
|
+
return jsx("div", {
|
|
1878
1969
|
className: clsx([`${prefixCls}-option ${className} `, {
|
|
1879
1970
|
selected: selected,
|
|
1880
1971
|
disabled: disabled
|
|
1881
1972
|
}]),
|
|
1882
1973
|
style: style,
|
|
1883
|
-
onClick: handleClick
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1974
|
+
onClick: handleClick,
|
|
1975
|
+
...(title ? {
|
|
1976
|
+
title
|
|
1977
|
+
} : {}),
|
|
1978
|
+
children: render ? render(value) : children || value
|
|
1979
|
+
});
|
|
1887
1980
|
};
|
|
1888
1981
|
|
|
1889
1982
|
var css_248z$a = ".xUi-select .xUi-select-tag-container{display:flex;flex:auto;flex-wrap:wrap;gap:4px;line-height:12px;position:relative}.xUi-select.large .xUi-select-tag-container,.xUi-select.middle .xUi-select-tag-container{line-height:22px}.xUi-select .xUi-select-tag{align-items:center;align-self:center;background:rgba(0,0,0,.06);border:1px solid transparent;border-radius:var(--xui-border-radius-sm);box-sizing:border-box;cursor:default;display:flex;flex:none;height:100%;max-width:100%;overflow:hidden;padding:2px;text-overflow:ellipsis;transition:font-size .3s,line-height .3s,height .3s;white-space:nowrap}.xUi-select.middle .xUi-select-tag{padding:4px 8px}.xUi-select.large .xUi-select-tag{font-size:var(--xui-font-size-lg);padding:8px}.xUi-select .xUi-select-tag span{font-size:var(--xui-font-size-sm);margin:0 2px}.xUi-select .xUi-select-tag .xUi-select-tag-close-icon{color:rgba(0,0,0,.5);cursor:pointer;font-size:var(--xui-font-size-xs)}.xUi-select .xUi-select-tag .xUi-select-tag-close-icon:hover{color:var(--xui-text-color)}.xUi-select .xUi-select-tag:has([class=xUi-select-tag-input]){background:transparent;border:none;color:var(--xui-text-color);font-size:var(--xui-font-size-md);outline:none;padding:0}.xUi-select .xUi-select-tag:has([class=xUi-select-tag-input]) input{background-color:transparent;border:none;font-size:var(--xui-font-size-md);height:-webkit-fill-available;padding:0}.xUi-select .xUi-select-tag-input:focus{border:none;box-shadow:none;outline:none}";
|
|
@@ -1905,16 +1998,22 @@ const Tag = ({
|
|
|
1905
1998
|
e.target.value = value;
|
|
1906
1999
|
onClose(e);
|
|
1907
2000
|
};
|
|
1908
|
-
return
|
|
2001
|
+
return jsxs("div", {
|
|
1909
2002
|
style: {
|
|
1910
2003
|
...style,
|
|
1911
2004
|
backgroundColor: color
|
|
1912
2005
|
},
|
|
1913
|
-
className: `${prefixCls}-tag
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
2006
|
+
className: `${prefixCls}-tag`,
|
|
2007
|
+
children: [jsx("span", {
|
|
2008
|
+
children: label !== undefined ? label : value
|
|
2009
|
+
}), closable && jsx("span", {
|
|
2010
|
+
className: `${prefixCls}-tag-close-icon`,
|
|
2011
|
+
onClick: handleOnClick,
|
|
2012
|
+
children: icon || jsx(Fragment$1, {
|
|
2013
|
+
children: "\u2715"
|
|
2014
|
+
})
|
|
2015
|
+
})]
|
|
2016
|
+
});
|
|
1918
2017
|
};
|
|
1919
2018
|
|
|
1920
2019
|
var css_248z$9 = ".xUi-empty{align-items:center;display:grid;gap:4px;justify-content:center;padding:14px}.xUi-empty-description{color:var(--xui-text-color);font-size:var(--xui-font-size-md);text-align:center}";
|
|
@@ -1927,35 +2026,43 @@ const EmptyContent = ({
|
|
|
1927
2026
|
title = 'No Data',
|
|
1928
2027
|
description = 'No data',
|
|
1929
2028
|
prefixCls = prefixClsEmpty
|
|
1930
|
-
}) =>
|
|
2029
|
+
}) => jsxs("div", {
|
|
1931
2030
|
style: style,
|
|
1932
|
-
className: `${prefixCls} ${prefixCls}-normal ${prefixCls}-small ${className}
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
},
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
}
|
|
2031
|
+
className: `${prefixCls} ${prefixCls}-normal ${prefixCls}-small ${className}`,
|
|
2032
|
+
children: [jsx("div", {
|
|
2033
|
+
className: `${prefixCls}-image`,
|
|
2034
|
+
children: icon || jsxs("svg", {
|
|
2035
|
+
width: "64",
|
|
2036
|
+
height: "41",
|
|
2037
|
+
viewBox: "0 0 64 41",
|
|
2038
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2039
|
+
children: [jsx("title", {
|
|
2040
|
+
children: title
|
|
2041
|
+
}), jsxs("g", {
|
|
2042
|
+
transform: "translate(0 1)",
|
|
2043
|
+
fill: "none",
|
|
2044
|
+
children: [jsx("ellipse", {
|
|
2045
|
+
fill: "#f5f5f5",
|
|
2046
|
+
cx: "32",
|
|
2047
|
+
cy: "33",
|
|
2048
|
+
rx: "32",
|
|
2049
|
+
ry: "7"
|
|
2050
|
+
}), jsxs("g", {
|
|
2051
|
+
stroke: "#d9d9d9",
|
|
2052
|
+
children: [jsx("path", {
|
|
2053
|
+
d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
|
|
2054
|
+
}), jsx("path", {
|
|
2055
|
+
d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
|
|
2056
|
+
fill: "#fafafa"
|
|
2057
|
+
})]
|
|
2058
|
+
})]
|
|
2059
|
+
})]
|
|
2060
|
+
})
|
|
2061
|
+
}), jsx("div", {
|
|
2062
|
+
className: `${prefixCls}-description`,
|
|
2063
|
+
children: description
|
|
2064
|
+
})]
|
|
2065
|
+
});
|
|
1959
2066
|
|
|
1960
2067
|
var css_248z$8 = "@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.xUi-select{background-color:transparent;border:1px solid var(--xui-border-color);border-radius:var(--xui-border-radius-sm);box-sizing:border-box;color:var(--xui-text-color);display:inline-flex;flex-direction:row-reverse;margin-bottom:15px;min-height:24px;padding:2px 8px;position:relative;width:100%}.xUi-select-disabled{background:rgba(0,0,0,.04)}.xUi-select-arrow{align-items:center;color:var(--xui-text-color-light);display:flex;gap:6px;margin:0 4px}.xUi-select-arrow svg{align-items:center;display:flex;justify-content:center}.xUi-select-loading{animation:spin 1s linear infinite;color:var(--xui-text-color-light);display:inline-block;margin:0 8px}.xUi-select .xUi-select-trigger{align-items:center;background:transparent;border-radius:var(--xui-border-radius-sm);cursor:pointer;display:flex;justify-content:end;width:100%}.xUi-select .xUi-select-clear-btn{background:none;border:none;color:#999;cursor:pointer;font-size:var(--xui-font-size-lg);line-height:1;margin:0 8px;padding:0}.xUi-select .xUi-select-clear-btn:hover{color:var(--xui-primary-color)}.xUi-select-dropdown{background-color:var(--xui-select-background-color);border-radius:var(--xui-border-radius-sm);box-shadow:0 4px 12px rgba(0,0,0,.15);left:0;margin-top:5px;max-height:200px;min-width:max-content;overflow-y:auto;position:absolute;right:unset;top:100%;width:inherit;z-index:10}.xUi-select-dropdown.bottomRight,.xUi-select-dropdown.topRight{left:unset;right:0}.xUi-select .xUi-select-loading-spinner{color:#999;padding:10px;text-align:center}.xUi-select:focus-within{border-color:var(--xui-primary-color-light);box-shadow:none}.xUi-select:hover:not(.xUi-select-disabled){border-color:var(--xui-primary-color)}.xUi-select-disabled,.xUi-select-disabled .xUi-select-input,.xUi-select-disabled .xUi-select-trigger{cursor:not-allowed!important;opacity:.6!important}.xUi-select-selected-icon{color:var(--xui-primary-color-light)}.xUi-select-error{border-color:var(--xui-error-color)}.xUi-select-arrow .error-svg-icon,.xUi-select-error .error-svg-icon{color:var(--xui-error-color)}.xUi-select .xUi-select-input{align-items:center;background:transparent;border:none;color:var(--xui-text-color);cursor:pointer;display:inline-flex;font-size:var(--xui-font-size-md);height:-webkit-fill-available;outline:none;padding:0;user-select:none;width:100%}.xUi-select .xUi-select-input:focus{border:none;box-shadow:none;outline:none}.xUi-select.middle{border-radius:var(--xui-border-radius-md);min-height:30px}.xUi-select.middle,.xUi-select.middle input{font-size:var(--xui-font-size-md)}.xUi-select.middle .xUi-select-trigger{border-radius:var(--xui-border-radius-md)}.xUi-select.large{font-size:var(--xui-font-size-lg);min-height:40px}.xUi-select.large,.xUi-select.large .xUi-select-trigger{border-radius:var(--xui-border-radius-lg)}.xUi-select input{font-size:var(--xui-font-size-lg)}";
|
|
1961
2068
|
styleInject(css_248z$8);
|
|
@@ -2164,9 +2271,11 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
2164
2271
|
if (!showArrow) {
|
|
2165
2272
|
return null;
|
|
2166
2273
|
}
|
|
2167
|
-
return showSearch && isOpen ?
|
|
2168
|
-
|
|
2169
|
-
|
|
2274
|
+
return showSearch && isOpen ? jsx(SearchIcon, {}) : jsx("span", {
|
|
2275
|
+
children: suffixIcon || showArrow && jsx(ArrowIcon, {
|
|
2276
|
+
isOpen: isOpen
|
|
2277
|
+
})
|
|
2278
|
+
});
|
|
2170
2279
|
}, [showArrow, showSearch, isOpen, suffixIcon]);
|
|
2171
2280
|
const popupContainer = useMemo(() => {
|
|
2172
2281
|
return selectRef.current ? getPopupContainer?.(selectRef.current) : selectRef.current;
|
|
@@ -2208,9 +2317,8 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
2208
2317
|
...props
|
|
2209
2318
|
}) => {
|
|
2210
2319
|
const isSelected = hasMode ? selected.includes(props.value) : props.value === selected;
|
|
2211
|
-
return
|
|
2212
|
-
|
|
2213
|
-
}, props, {
|
|
2320
|
+
return jsxs(Option, {
|
|
2321
|
+
...props,
|
|
2214
2322
|
selected: isSelected,
|
|
2215
2323
|
className: clsx([className, {
|
|
2216
2324
|
[`${prefixCls}-focused`]: hasMode ? isSelected : props.value === selected,
|
|
@@ -2226,14 +2334,16 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
2226
2334
|
...props
|
|
2227
2335
|
});
|
|
2228
2336
|
},
|
|
2229
|
-
"data-value": props.value
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2337
|
+
"data-value": props.value,
|
|
2338
|
+
children: [children || props.value, hasMode && isSelected && jsx("span", {
|
|
2339
|
+
className: `${prefixCls}-selected-icon`,
|
|
2340
|
+
children: menuItemSelectedIcon === true ? jsx(CheckIcon, {}) : menuItemSelectedIcon
|
|
2341
|
+
})]
|
|
2342
|
+
}, `${props.value}`);
|
|
2233
2343
|
});
|
|
2234
2344
|
return dropdownRender ? dropdownRender(options) : options;
|
|
2235
2345
|
})();
|
|
2236
|
-
const dropdownContent = !loading && isOpen &&
|
|
2346
|
+
const dropdownContent = !loading && isOpen && jsxs("div", {
|
|
2237
2347
|
className: clsx([`${prefixCls}-dropdown`, {
|
|
2238
2348
|
[placement]: placement,
|
|
2239
2349
|
[dropdownClassName]: dropdownClassName
|
|
@@ -2244,28 +2354,31 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
2244
2354
|
...(['topLeft', 'topRight'].includes(placement) ? {
|
|
2245
2355
|
top: -((selectRef.current?.querySelector(`.${prefixCls}-dropdown`)?.clientHeight || listHeight) + PADDING_PLACEMENT) + (selectRef.current?.clientHeight || 0)
|
|
2246
2356
|
} : {})
|
|
2247
|
-
}
|
|
2248
|
-
}, filterable && /*#__PURE__*/React.createElement("input", {
|
|
2249
|
-
type: "text",
|
|
2250
|
-
className: `${prefixCls}-search`,
|
|
2251
|
-
value: searchQuery,
|
|
2252
|
-
onChange: handleSearch,
|
|
2253
|
-
placeholder: "Search..."
|
|
2254
|
-
}), !loading && /*#__PURE__*/React.createElement("div", {
|
|
2255
|
-
className: `${prefixCls}-options globalEllipsis`,
|
|
2256
|
-
style: {
|
|
2257
|
-
maxHeight: listHeight,
|
|
2258
|
-
overflowY: 'auto'
|
|
2259
|
-
}
|
|
2260
|
-
}, asTag && !!searchQuery && /*#__PURE__*/React.createElement(Option, {
|
|
2261
|
-
value: searchQuery,
|
|
2262
|
-
className: `${prefixCls}-focused`,
|
|
2263
|
-
onClick: e => {
|
|
2264
|
-
handleSelect(e, searchQuery);
|
|
2265
2357
|
},
|
|
2266
|
-
"
|
|
2267
|
-
|
|
2268
|
-
|
|
2358
|
+
children: [filterable && jsx("input", {
|
|
2359
|
+
type: "text",
|
|
2360
|
+
className: `${prefixCls}-search`,
|
|
2361
|
+
value: searchQuery,
|
|
2362
|
+
onChange: handleSearch,
|
|
2363
|
+
placeholder: "Search..."
|
|
2364
|
+
}), !loading && jsxs("div", {
|
|
2365
|
+
className: `${prefixCls}-options globalEllipsis`,
|
|
2366
|
+
style: {
|
|
2367
|
+
maxHeight: listHeight,
|
|
2368
|
+
overflowY: 'auto'
|
|
2369
|
+
},
|
|
2370
|
+
children: [asTag && !!searchQuery && jsx(Option, {
|
|
2371
|
+
value: searchQuery,
|
|
2372
|
+
className: `${prefixCls}-focused`,
|
|
2373
|
+
onClick: e => {
|
|
2374
|
+
handleSelect(e, searchQuery);
|
|
2375
|
+
},
|
|
2376
|
+
"data-value": searchQuery,
|
|
2377
|
+
children: searchQuery
|
|
2378
|
+
}), filteredOptions.length ? dataRender : !asTag ? notFoundContent || jsx(EmptyContent, {}) : null]
|
|
2379
|
+
})]
|
|
2380
|
+
});
|
|
2381
|
+
return jsxs("div", {
|
|
2269
2382
|
id: id,
|
|
2270
2383
|
ref: selectRef,
|
|
2271
2384
|
style: style,
|
|
@@ -2276,77 +2389,88 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
2276
2389
|
[`${prefixCls}-error`]: error,
|
|
2277
2390
|
[`${prefixCls}-multi`]: hasMode,
|
|
2278
2391
|
[`${prefixCls}-disabled`]: disabled
|
|
2279
|
-
}])
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2392
|
+
}]),
|
|
2393
|
+
children: [jsxs("div", {
|
|
2394
|
+
onClick: handleTriggerClick,
|
|
2395
|
+
onMouseEnter: handleMouseEnter,
|
|
2396
|
+
onMouseLeave: handleMouseLeave,
|
|
2397
|
+
className: `${prefixCls}-trigger`,
|
|
2398
|
+
children: [showSearch ? jsxs("div", {
|
|
2399
|
+
style: {
|
|
2400
|
+
...style,
|
|
2401
|
+
...(isOpen ? {
|
|
2402
|
+
maxWidth: `${searchInputWidth}px`
|
|
2403
|
+
} : {}),
|
|
2404
|
+
minWidth: `${searchInputWidth}px`
|
|
2405
|
+
},
|
|
2406
|
+
className: `${prefixCls}-tag-container`,
|
|
2407
|
+
children: [hasMode && selected.map((tag, index) => tagRender ? jsx("div", {
|
|
2408
|
+
children: tagRender?.({
|
|
2409
|
+
label: extractedOptions.find(e => e.value === tag)?.children || tag,
|
|
2410
|
+
value: tag,
|
|
2411
|
+
onClose: handleRemoveTag,
|
|
2412
|
+
closable: true
|
|
2413
|
+
})
|
|
2414
|
+
}, `${index}_${tag}`) : jsx(Tag, {
|
|
2415
|
+
closable: true,
|
|
2416
|
+
value: tag,
|
|
2417
|
+
label: tag === '' ? placeholder : extractedOptions.find(e => e.value === tag)?.children || tag,
|
|
2418
|
+
onClose: handleRemoveTag
|
|
2419
|
+
}, `${index}_${tag}`)), isOpen ? jsx("div", {
|
|
2420
|
+
className: `${prefixCls}-tag`,
|
|
2421
|
+
children: jsx("div", {
|
|
2422
|
+
onClick: e => {
|
|
2423
|
+
if (disabled) {
|
|
2424
|
+
e.preventDefault();
|
|
2425
|
+
e.stopPropagation();
|
|
2426
|
+
return;
|
|
2427
|
+
}
|
|
2428
|
+
},
|
|
2429
|
+
onKeyDown: handleOnKeyDown,
|
|
2430
|
+
style: {
|
|
2431
|
+
width: 'auto',
|
|
2432
|
+
display: 'ruby',
|
|
2433
|
+
textAlign: 'center'
|
|
2434
|
+
},
|
|
2435
|
+
contentEditable: "plaintext-only",
|
|
2436
|
+
id: `${prefixCls}-search-tag-input`,
|
|
2437
|
+
className: `${prefixCls}-tag-input`
|
|
2438
|
+
})
|
|
2439
|
+
}) : !hasMode ? jsx("div", {
|
|
2440
|
+
className: `${prefixCls}-input`,
|
|
2441
|
+
style: {
|
|
2442
|
+
opacity: isOpen || selected === '' ? '0.6' : '1'
|
|
2443
|
+
},
|
|
2444
|
+
children: selected === '' ? placeholder : extractedOptions.find(e => e.value === selected)?.children || selected
|
|
2445
|
+
}) : null]
|
|
2446
|
+
}) : !hasMode ? jsx("div", {
|
|
2447
|
+
className: `${prefixCls}-input`,
|
|
2448
|
+
onClick: () => !disabled && setIsOpen(!isOpen || open),
|
|
2449
|
+
style: {
|
|
2450
|
+
opacity: isOpen || selected === '' ? '0.6' : '1'
|
|
2451
|
+
},
|
|
2452
|
+
children: selected === '' ? placeholder : (() => {
|
|
2453
|
+
const option = extractedOptions.find(e => e.value === selected);
|
|
2454
|
+
return option?.children || option?.value || null;
|
|
2455
|
+
})()
|
|
2456
|
+
}) : null, isHover && !loading ? allowClear && selected ? jsx("button", {
|
|
2457
|
+
className: `${prefixCls}-clear-btn`,
|
|
2458
|
+
onClick: handleClear,
|
|
2459
|
+
children: removeIcon || jsx(ClearIcon, {})
|
|
2460
|
+
}) : jsxs("span", {
|
|
2461
|
+
className: `${prefixCls}-arrow`,
|
|
2462
|
+
children: [ArrowContainer, error && feedbackIcons ? jsx(ErrorIcon, {}) : null]
|
|
2463
|
+
}) : jsxs(Fragment$1, {
|
|
2464
|
+
children: [!loading && jsxs("span", {
|
|
2465
|
+
className: `${prefixCls}-arrow`,
|
|
2466
|
+
children: [ArrowContainer, error && feedbackIcons ? jsx(ErrorIcon, {}) : null]
|
|
2467
|
+
}), loading && jsx("span", {
|
|
2468
|
+
className: `${prefixCls}-loading`,
|
|
2469
|
+
children: jsx(LoadingIcon, {})
|
|
2470
|
+
})]
|
|
2471
|
+
})]
|
|
2472
|
+
}), popupContainer ? /*#__PURE__*/createPortal(dropdownContent, popupContainer) : dropdownContent]
|
|
2473
|
+
});
|
|
2350
2474
|
});
|
|
2351
2475
|
SelectComponent.displayName = 'Select';
|
|
2352
2476
|
const Select = Object.assign(SelectComponent, {
|
|
@@ -2369,15 +2493,16 @@ const SkeletonButton = ({
|
|
|
2369
2493
|
size = 'default',
|
|
2370
2494
|
applyElementStyle = true
|
|
2371
2495
|
}) => {
|
|
2372
|
-
return
|
|
2496
|
+
return jsx("div", {
|
|
2373
2497
|
className: clsx([`${prefixCls}`, {
|
|
2374
2498
|
[`${prefixCls}-element`]: applyElementStyle,
|
|
2375
2499
|
[`${prefixCls}-active`]: active
|
|
2376
|
-
}, className])
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2500
|
+
}, className]),
|
|
2501
|
+
children: jsx("span", {
|
|
2502
|
+
className: clsx([`${prefixCls}-button `, BUTTON_SKELETON_SIZE[size], className]),
|
|
2503
|
+
style: style
|
|
2504
|
+
})
|
|
2505
|
+
});
|
|
2381
2506
|
};
|
|
2382
2507
|
|
|
2383
2508
|
var css_248z$6 = "@keyframes xUi-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.xUi-skeleton-avatar{animation:xUi-skeleton-loading 1.4s ease infinite;background:linear-gradient(90deg,hsla(0,0%,75%,.2) 25%,hsla(0,0%,51%,.24) 37%,hsla(0,0%,75%,.2) 63%);background-size:400% 100%;display:block;height:40px;line-height:40px;width:40px}.xUi-skeleton-avatar-circle{border-radius:50%}.xUi-skeleton-avatar-square{border-radius:4px}";
|
|
@@ -2407,23 +2532,25 @@ const SkeletonAvatar = ({
|
|
|
2407
2532
|
applyElementStyle = true,
|
|
2408
2533
|
...props
|
|
2409
2534
|
}) => {
|
|
2410
|
-
return
|
|
2535
|
+
return jsx("div", {
|
|
2411
2536
|
className: clsx([`${prefixCls}`, {
|
|
2412
2537
|
[`${prefixCls}-element`]: applyElementStyle,
|
|
2413
2538
|
[`${prefixCls}-active`]: active
|
|
2414
2539
|
}, className]),
|
|
2415
|
-
style: wrapperStyle
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2540
|
+
style: wrapperStyle,
|
|
2541
|
+
...props,
|
|
2542
|
+
children: jsx("span", {
|
|
2543
|
+
className: clsx([`${prefixCls}-avatar ${prefixCls}-avatar-${shape}`]),
|
|
2544
|
+
style: {
|
|
2545
|
+
...(size ? {
|
|
2546
|
+
width: size,
|
|
2547
|
+
height: size,
|
|
2548
|
+
lineHeight: size
|
|
2549
|
+
} : {}),
|
|
2550
|
+
...(style || {})
|
|
2551
|
+
}
|
|
2552
|
+
})
|
|
2553
|
+
});
|
|
2427
2554
|
};
|
|
2428
2555
|
|
|
2429
2556
|
var css_248z$5 = ".xUi-skeleton-image{align-items:center;background:hsla(0,0%,75%,.2);display:flex;height:96px;justify-content:center;line-height:96px;vertical-align:top;width:96px}.xUi-skeleton-image .xUi-skeleton-icon{font-size:inherit!important}.xUi-skeleton-image svg{height:100%;line-height:48px;max-width:192px;width:48px}";
|
|
@@ -2435,31 +2562,34 @@ const SkeletonImage = ({
|
|
|
2435
2562
|
className,
|
|
2436
2563
|
style = {}
|
|
2437
2564
|
}) => {
|
|
2438
|
-
return
|
|
2565
|
+
return jsx("div", {
|
|
2439
2566
|
className: `${prefixCls}-image ${className || ''}`,
|
|
2440
|
-
style: style
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2567
|
+
style: style,
|
|
2568
|
+
children: jsx("span", {
|
|
2569
|
+
className: `${prefixCls}-icon`,
|
|
2570
|
+
style: {
|
|
2571
|
+
fontSize: `${style?.width || CUSTOm_ICON_SIZE}px`,
|
|
2572
|
+
color: '#bfbfbf',
|
|
2573
|
+
position: 'relative',
|
|
2574
|
+
width: '100%',
|
|
2575
|
+
height: '100%',
|
|
2576
|
+
...(style?.backgroundColor ? {
|
|
2577
|
+
backgroundColor: style?.backgroundColor
|
|
2578
|
+
} : {})
|
|
2579
|
+
},
|
|
2580
|
+
children: jsx("svg", {
|
|
2581
|
+
viewBox: "0 0 1098 1024",
|
|
2582
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2583
|
+
width: "1em",
|
|
2584
|
+
height: "1em",
|
|
2585
|
+
fill: "currentColor",
|
|
2586
|
+
children: jsx("path", {
|
|
2587
|
+
d: "M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",
|
|
2588
|
+
className: `${prefixCls}-image-path`
|
|
2589
|
+
})
|
|
2590
|
+
})
|
|
2591
|
+
})
|
|
2592
|
+
});
|
|
2463
2593
|
};
|
|
2464
2594
|
|
|
2465
2595
|
var css_248z$4 = "@keyframes xUi-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.xUi-skeleton-element{display:inline-block!important;width:auto!important}.xUi-skeleton-input{background:hsla(0,0%,75%,.2);display:inline-block;height:32px;line-height:32px;min-width:160px;vertical-align:top;width:160px}.xUi-skeleton-input-sm{height:24px;line-height:24px;min-width:120px;width:120px}.xUi-skeleton-input-lg{height:40px;line-height:40px;min-width:200px;width:200px}.xUi-skeleton-active .xUi-skeleton-input{animation:xUi-skeleton-loading 1.4s ease infinite;background:linear-gradient(90deg,hsla(0,0%,75%,.2) 25%,hsla(0,0%,51%,.24) 37%,hsla(0,0%,75%,.2) 63%);background-size:400% 100%}.xUi-skeleton-block,.xUi-skeleton-block .xUi-skeleton-input{width:100%}";
|
|
@@ -2478,15 +2608,16 @@ const SkeletonInput = ({
|
|
|
2478
2608
|
className,
|
|
2479
2609
|
size = 'default'
|
|
2480
2610
|
}) => {
|
|
2481
|
-
return
|
|
2611
|
+
return jsx("div", {
|
|
2482
2612
|
className: clsx([`${prefixCls}-element`, {
|
|
2483
2613
|
[`${prefixCls}-active`]: active,
|
|
2484
2614
|
[`${prefixCls}-block`]: block
|
|
2485
|
-
}, className])
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2615
|
+
}, className]),
|
|
2616
|
+
children: jsx("span", {
|
|
2617
|
+
className: `${prefixCls}-input ${INPUT_SKELETON_SIZE[size]} ${className || ''}`,
|
|
2618
|
+
style: style
|
|
2619
|
+
})
|
|
2620
|
+
});
|
|
2490
2621
|
};
|
|
2491
2622
|
|
|
2492
2623
|
var css_248z$3 = "@keyframes xUi-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.xUi-skeleton{display:table;width:100%}.xUi-skeleton__withAvatar{display:flex;gap:12px}.xUi-skeleton-content{width:100%}.xUi-skeleton-content,.xUi-skeleton__header{display:table-cell;vertical-align:top}.xUi-skeleton-title{background:hsla(0,0%,75%,.2);border-radius:4px;height:16px;margin-top:16px;width:38%}.xUi-skeleton-title-avatar{margin-top:12px;width:100%}.xUi-skeleton-title+.xUi-skeleton-paragraph{margin-top:24px}.xUi-skeleton-paragraph{padding:0}.xUi-skeleton-paragraph li{background:hsla(0,0%,75%,.2);border-radius:4px;height:16px;list-style:none;width:100%}.xUi-skeleton-paragraph li+li{margin-top:16px}.xUi-skeleton-paragraph li:last-child:not(:first-child){width:61%}.xUi-skeleton-active .xUi-skeleton-paragraph>li,.xUi-skeleton-active .xUi-skeleton-title{animation:xUi-skeleton-loading 1.4s ease infinite;background:linear-gradient(90deg,hsla(0,0%,75%,.2) 25%,hsla(0,0%,51%,.24) 37%,hsla(0,0%,75%,.2) 63%);background-size:400% 100%}.xUi-skeleton-round .xUi-skeleton-content,.xUi-skeleton-round .xUi-skeleton-paragraph>li,.xUi-skeleton-round .xUi-skeleton-title{border-radius:100px}";
|
|
@@ -2514,30 +2645,34 @@ const Skeleton = ({
|
|
|
2514
2645
|
} : {};
|
|
2515
2646
|
const PARAGRAPH_ROWS = avatar ? PARAGRAPH_AVATAR_ROWS : PARAGRAPH_DEFAULT_ROWS;
|
|
2516
2647
|
const HAS_PHARAGRAPH = typeof paragraph === 'boolean' || !paragraph ? PARAGRAPH_ROWS : paragraph?.rows ?? PARAGRAPH_ROWS;
|
|
2517
|
-
return
|
|
2648
|
+
return jsxs("div", {
|
|
2518
2649
|
className: clsx([prefixCls, {
|
|
2519
2650
|
[`${prefixCls}__withAvatar`]: avatar,
|
|
2520
2651
|
[`${prefixCls}-active`]: active,
|
|
2521
2652
|
[`${prefixCls}-round`]: round
|
|
2522
2653
|
}, className]),
|
|
2523
|
-
style: style
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2654
|
+
style: style,
|
|
2655
|
+
children: [avatar && teamLogo && jsx("div", {
|
|
2656
|
+
className: `${prefixCls}__header`,
|
|
2657
|
+
children: jsx(SkeletonAvatar, {
|
|
2658
|
+
...GET_AVATAR_SKELETON_PROPS(avatar)
|
|
2659
|
+
})
|
|
2660
|
+
}), jsxs("div", {
|
|
2661
|
+
className: `${prefixCls}-content`,
|
|
2662
|
+
children: [jsx("h3", {
|
|
2663
|
+
className: clsx([`${prefixCls}-title ${GET_TITLE_SKELETON_PROPS.className}`, {
|
|
2664
|
+
[`${prefixCls}-title-avatar`]: avatar
|
|
2665
|
+
}]),
|
|
2666
|
+
style: GET_TITLE_SKELETON_PROPS.style
|
|
2667
|
+
}), paragraph !== false && jsx("ul", {
|
|
2668
|
+
className: `${prefixCls}-paragraph`,
|
|
2669
|
+
style: {
|
|
2670
|
+
...(typeof paragraph !== 'boolean' && paragraph ? paragraph.style : {})
|
|
2671
|
+
},
|
|
2672
|
+
children: createArray(HAS_PHARAGRAPH).map(key => jsx("li", {}, key))
|
|
2673
|
+
})]
|
|
2674
|
+
})]
|
|
2675
|
+
});
|
|
2541
2676
|
};
|
|
2542
2677
|
Skeleton.Image = SkeletonImage;
|
|
2543
2678
|
Skeleton.Input = SkeletonInput;
|
|
@@ -2578,27 +2713,35 @@ const ButtonBase = ({
|
|
|
2578
2713
|
[`${prefixCls}-disabled`]: disabled
|
|
2579
2714
|
}, className);
|
|
2580
2715
|
const mergedDisabled = disabled || isLoading;
|
|
2581
|
-
const content =
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2716
|
+
const content = jsxs(Fragment$1, {
|
|
2717
|
+
children: [iconNode && iconPosition === 'start' && jsx("span", {
|
|
2718
|
+
className: clsx(`${prefixCls}-icon`, customClassNames.icon),
|
|
2719
|
+
style: styles.icon,
|
|
2720
|
+
children: iconNode
|
|
2721
|
+
}), jsx("span", {
|
|
2722
|
+
className: `${prefixCls}-content`,
|
|
2723
|
+
children: children
|
|
2724
|
+
}), iconNode && iconPosition === 'end' && jsx("span", {
|
|
2725
|
+
className: clsx(`${prefixCls}-icon`, customClassNames.icon),
|
|
2726
|
+
style: styles.icon,
|
|
2727
|
+
children: iconNode
|
|
2728
|
+
})]
|
|
2729
|
+
});
|
|
2590
2730
|
if (href) {
|
|
2591
|
-
return
|
|
2731
|
+
return jsx("a", {
|
|
2592
2732
|
className: classes,
|
|
2593
2733
|
href: mergedDisabled ? undefined : href,
|
|
2594
|
-
"aria-disabled": mergedDisabled
|
|
2595
|
-
|
|
2734
|
+
"aria-disabled": mergedDisabled,
|
|
2735
|
+
children: content
|
|
2736
|
+
});
|
|
2596
2737
|
}
|
|
2597
|
-
return
|
|
2738
|
+
return jsx("button", {
|
|
2598
2739
|
type: htmlType,
|
|
2599
2740
|
className: classes,
|
|
2600
|
-
disabled: mergedDisabled
|
|
2601
|
-
|
|
2741
|
+
disabled: mergedDisabled,
|
|
2742
|
+
...restProps,
|
|
2743
|
+
children: content
|
|
2744
|
+
});
|
|
2602
2745
|
};
|
|
2603
2746
|
|
|
2604
2747
|
const MyButton = props => {
|
|
@@ -2619,14 +2762,15 @@ const MyButton = props => {
|
|
|
2619
2762
|
}
|
|
2620
2763
|
}, [loading]);
|
|
2621
2764
|
const iconNode = useMemo(() => {
|
|
2622
|
-
return innerLoading ? typeof loading === 'object' && loading.icon ||
|
|
2765
|
+
return innerLoading ? typeof loading === 'object' && loading.icon || jsx("span", {
|
|
2623
2766
|
className: `${prefixCls}-spinner`
|
|
2624
2767
|
}) : icon;
|
|
2625
2768
|
}, [icon, innerLoading, loading, prefixCls]);
|
|
2626
|
-
return
|
|
2769
|
+
return jsx(ButtonBase, {
|
|
2770
|
+
...props,
|
|
2627
2771
|
isLoading: innerLoading,
|
|
2628
2772
|
iconNode: iconNode
|
|
2629
|
-
})
|
|
2773
|
+
});
|
|
2630
2774
|
};
|
|
2631
2775
|
|
|
2632
2776
|
var css_248z$1 = ".xUi-upload-wrapper{font-family:Arial,sans-serif;width:100%}.xUi-upload{align-items:center;border-radius:6px;color:#666;cursor:pointer;display:flex;justify-content:flex-start;text-align:center;transition:all .3s}.xUi-upload:hover{border-color:var(--xui-primary-color,var(--xui-primary-color));color:var(--xui-primary-color,var(--xui-primary-color))}.xUi-upload-disabled{cursor:not-allowed;opacity:.6}.xUi-upload-disabled .xUi-upload-picture button{cursor:not-allowed}.xUi-upload-input{display:none}.xUi-upload-list{list-style:none;margin:0;padding:0}.xUi-upload-list-picture .xUi-upload-item{border:1px dashed var(--xui-border-color);line-height:unset;margin-top:8px;padding:8px}.xUi-upload-list-picture .xUi-upload-item-done{border:1px solid var(--xui-border-color)}.xUi-upload-list-picture .xUi-upload-item-error{border:1px solid var(--xui-error-color)}.xUi-upload-list-picture .xUi-upload-item-error .xUi-upload-item-title{color:var(--xui-error-color)}.xUi-upload-item{align-items:center;border-radius:8px;color:#333;display:flex;font-size:14px;gap:8px;line-height:35px;margin:0;transition:background .3s}.xUi-upload-item.uploading{color:var(--xui-primary-color)}.xUi-upload-item.done{color:var(--xui-success-color)}.xUi-upload-item.error{color:var(--xui-error-color)}.xUi-upload-remove{color:rgba(0,0,0,.45)}.xUi-upload-item-title{align-items:center;color:var(--xui-text-color);display:flex;justify-content:space-between}.xUi-upload-item-title svg{color:var(--xui-error-color)}.xUi-upload-list-picture-card{display:flex;flex-wrap:wrap;gap:8px}.xUi-upload-list-picture-card .xUi-upload-item{align-items:center;border-radius:4px;display:flex;flex-direction:column;height:104px;justify-content:center;position:relative;width:104px}.xUi-upload-list-picture-card .xUi-upload-item img{max-height:100%;max-width:100%;object-fit:cover}.xUi-upload-list-picture-card .xUi-upload-remove{border-radius:50%;color:#fff;font-size:12px;line-height:1;padding:2px 6px;position:absolute;right:4px;top:4px}.xUi-upload-item-thumbnail{border-radius:4px;height:40px;object-fit:cover;width:40px}.xUi-upload-item-progress-line{border:1px solid var(--xui-border-color);height:0;width:calc(100% - 8px)}.xUi-upload-item-progress-line-percent{border:1px solid red;height:0;position:relative;top:-2px}";
|
|
@@ -2772,71 +2916,80 @@ const Upload = ({
|
|
|
2772
2916
|
uploadRef.current.click();
|
|
2773
2917
|
}
|
|
2774
2918
|
};
|
|
2775
|
-
return
|
|
2919
|
+
return jsxs("div", {
|
|
2776
2920
|
className: clsx([`${prefixCls}-wrapper`, className, rootClassName, {
|
|
2777
2921
|
noStyle: noStyle,
|
|
2778
2922
|
[`${prefixCls}-disabled`]: disabled
|
|
2779
2923
|
}]),
|
|
2780
|
-
style: style
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2924
|
+
style: style,
|
|
2925
|
+
children: [jsxs("span", {
|
|
2926
|
+
className: clsx([`${prefixCls}`, `${prefixCls}-${listType}`]),
|
|
2927
|
+
onClick: handleClick,
|
|
2928
|
+
children: [children, jsx("input", {
|
|
2929
|
+
type: "file",
|
|
2930
|
+
ref: uploadRef,
|
|
2931
|
+
accept: accept,
|
|
2932
|
+
multiple: multiple,
|
|
2933
|
+
onChange: handleFileChange,
|
|
2934
|
+
className: `${prefixCls}-input`,
|
|
2935
|
+
disabled: disabled,
|
|
2936
|
+
...(directory ? {
|
|
2937
|
+
directory: true,
|
|
2938
|
+
webkitdirectory: true
|
|
2939
|
+
} : {})
|
|
2940
|
+
})]
|
|
2941
|
+
}), showUploadList && fileList.length > 0 && jsx("ul", {
|
|
2942
|
+
className: `${prefixCls}-list ${prefixCls}-list-${listType}`,
|
|
2943
|
+
children: fileList.map(file => jsxs("li", {
|
|
2944
|
+
className: `${prefixCls}-item ${prefixCls}-item-${file.status}`,
|
|
2945
|
+
children: [jsx("span", {
|
|
2946
|
+
className: `${prefixCls}-remove`,
|
|
2947
|
+
onClick: () => handleRemove(file.uid),
|
|
2948
|
+
children: listType === 'picture' && (file.originFileObj || file.url) ?
|
|
2949
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
2950
|
+
jsx("img", {
|
|
2951
|
+
width: IMAGE_SIZE,
|
|
2952
|
+
height: IMAGE_SIZE,
|
|
2953
|
+
alt: file.name,
|
|
2954
|
+
src: file.url || URL.createObjectURL(file.originFileObj),
|
|
2955
|
+
className: `${prefixCls}-item-thumbnail`
|
|
2956
|
+
}) : jsx(StampleIcon, {})
|
|
2957
|
+
}), jsxs("div", {
|
|
2958
|
+
style: {
|
|
2959
|
+
width: '100%'
|
|
2960
|
+
},
|
|
2961
|
+
children: [jsx("div", {
|
|
2962
|
+
className: `${prefixCls}-item-title`,
|
|
2963
|
+
style: {
|
|
2964
|
+
...(file.status === 'uploading' ? {
|
|
2965
|
+
marginBottom: 12
|
|
2966
|
+
} : {})
|
|
2967
|
+
},
|
|
2968
|
+
children: jsx("span", {
|
|
2969
|
+
className: `${prefixCls}-item-remove-icon`,
|
|
2970
|
+
onClick: () => handleRemove(file.uid),
|
|
2971
|
+
style: {
|
|
2972
|
+
cursor: 'pointer',
|
|
2973
|
+
marginLeft: 'auto'
|
|
2974
|
+
},
|
|
2975
|
+
role: "button",
|
|
2976
|
+
"aria-label": "Remove file",
|
|
2977
|
+
children: jsx(TrashIcon, {})
|
|
2978
|
+
})
|
|
2979
|
+
}), file.status === 'uploading' && jsxs(Fragment$1, {
|
|
2980
|
+
children: [jsx("div", {
|
|
2981
|
+
className: `${prefixCls}-item-progress-line`
|
|
2982
|
+
}), jsx("div", {
|
|
2983
|
+
className: `${prefixCls}-item-progress-line-percent`,
|
|
2984
|
+
style: {
|
|
2985
|
+
width: `${file.percent}%`
|
|
2986
|
+
}
|
|
2987
|
+
})]
|
|
2988
|
+
})]
|
|
2989
|
+
})]
|
|
2990
|
+
}, file.uid))
|
|
2991
|
+
})]
|
|
2992
|
+
});
|
|
2840
2993
|
};
|
|
2841
2994
|
|
|
2842
2995
|
var css_248z = ".xUi-checkbox-wrapper{align-items:center;color:var(--xui-main-color);cursor:pointer;display:inline-flex;font-size:var(--xui-font-size-md);margin:16px 0}.xUi-checkbox{background-color:transparent;border:1px solid var(--xui-border-color);border-radius:var(--xui-border-radius-sm);display:inline-block;height:14px;position:relative;transition:all .3s;width:14px}.xUi-checkbox.xUi-checkbox-checked{background-color:#f0f5ff;border-color:var(--xui-primary-color)}.xUi-checkbox input{cursor:pointer;inset:0;opacity:0;position:absolute}.xUi-checkbox-inner{border-left:0;border-top:0;border:2px solid var(--xui-background-color);height:6px;left:50%;position:absolute;top:50%;transform:rotate(45deg) scale(0);transition:transform .2s ease-in-out;width:10px}.xUi-checkbox-check{background-color:var(--xui-primary-color);border-color:var(--xui-primary-color);display:block;height:100%;position:relative;transition:.1s ease;width:100%}.xUi-checkbox-check:after{border:solid #fff;border-width:0 2px 2px 0;content:\"\";height:8px;left:3px;position:absolute;top:1px;transform:rotate(45deg);width:5px}.xUi-checkbox-disabled,.xUi-checkbox-disabled .xUi-checkbox-check{background-color:var(--xui-color-disabled);border-color:var(--xui-border-color)!important;cursor:not-allowed;opacity:.5}.xUi-checkbox-label{font-size:14px;margin-left:8px;user-select:none}.xUi-checkbox:focus:not(.disabled),.xUi-checkbox:hover:not(.disabled){border-color:var(--xui-primary-color);cursor:pointer}.xUi-checkbox.disabled{cursor:not-allowed;opacity:.5}";
|
|
@@ -2882,39 +3035,43 @@ const Checkbox = /*#__PURE__*/forwardRef(({
|
|
|
2882
3035
|
setInternalChecked(checked);
|
|
2883
3036
|
}
|
|
2884
3037
|
}, [checked]);
|
|
2885
|
-
return
|
|
2886
|
-
className: `${prefixCls}-wrapper
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
3038
|
+
return jsxs("div", {
|
|
3039
|
+
className: `${prefixCls}-wrapper`,
|
|
3040
|
+
children: [jsxs("div", {
|
|
3041
|
+
ref: ref,
|
|
3042
|
+
style: style,
|
|
3043
|
+
onClick: handleClick,
|
|
3044
|
+
className: clsx([prefixCls, className, {
|
|
3045
|
+
noStyle: noStyle,
|
|
3046
|
+
[`${prefixCls}-disabled`]: disabled,
|
|
3047
|
+
[`${prefixCls}-checked`]: internalChecked
|
|
3048
|
+
}]),
|
|
3049
|
+
children: [jsx("input", {
|
|
3050
|
+
id: id,
|
|
3051
|
+
type: type,
|
|
3052
|
+
name: name,
|
|
3053
|
+
disabled: disabled,
|
|
3054
|
+
tabIndex: tabIndex,
|
|
3055
|
+
required: required,
|
|
3056
|
+
autoFocus: autoFocus,
|
|
3057
|
+
onKeyDown: onKeyDown,
|
|
3058
|
+
onKeyPress: onKeyPress,
|
|
3059
|
+
onMouseEnter: onMouseEnter,
|
|
3060
|
+
onMouseLeave: onMouseLeave
|
|
3061
|
+
}), jsx("span", {
|
|
3062
|
+
className: `${prefixCls}-box`,
|
|
3063
|
+
children: jsx("span", {
|
|
3064
|
+
className: `${prefixCls}-check`,
|
|
3065
|
+
style: {
|
|
3066
|
+
opacity: Number(internalChecked)
|
|
3067
|
+
}
|
|
3068
|
+
})
|
|
3069
|
+
})]
|
|
3070
|
+
}), children && jsx("span", {
|
|
3071
|
+
className: `${prefixCls}-label`,
|
|
3072
|
+
children: children
|
|
3073
|
+
})]
|
|
3074
|
+
});
|
|
2918
3075
|
});
|
|
2919
3076
|
Checkbox.displayName = 'Checkbox';
|
|
2920
3077
|
|