@rockshin/tao-ui 0.0.57 → 0.0.58
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/components/app/app-notices.js +10 -3
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/badge/badge.js +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +5 -1
- package/dist/components/calendar/calendar.js +4 -1
- package/dist/components/carousel/carousel.js +8 -2
- package/dist/components/collapse/collapse-panels.js +68 -67
- package/dist/components/date-picker/date-localization.js +12 -14
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/float-button/float-button.js +7 -5
- package/dist/components/image/image.js +135 -143
- package/dist/components/input/otp.js +6 -0
- package/dist/components/input/search.js +7 -5
- package/dist/components/list/list.js +106 -105
- package/dist/components/masonry/masonry.js +1 -1
- package/dist/components/pagination/pagination.d.ts +2 -0
- package/dist/components/pagination/pagination.js +4 -0
- package/dist/components/rate/rate.js +83 -72
- package/dist/components/scroll-area/scroll-area.css +1 -1
- package/dist/components/scroll-area/scroll-area.js +294 -222
- package/dist/components/select/use-select-selection.d.ts +1 -1
- package/dist/components/select/use-select-selection.js +60 -53
- package/dist/components/statistic/statistic.js +84 -78
- package/dist/components/steps/steps.js +1 -1
- package/dist/components/table/table.js +4 -1
- package/dist/components/upload/upload.js +2 -2
- package/dist/number-input/cursor.js +20 -8
- package/dist/number-input/format.js +12 -4
- package/dist/number-input/use-number-input.js +4 -1
- package/package.json +1 -1
|
@@ -537,7 +537,7 @@ function ImageProgress(t0) {
|
|
|
537
537
|
return t21;
|
|
538
538
|
}
|
|
539
539
|
function ImageBase(props) {
|
|
540
|
-
const $ = c(
|
|
540
|
+
const $ = c(68);
|
|
541
541
|
const { tokenStyle } = useTaoInternalConfig();
|
|
542
542
|
const [internalOpen, setInternalOpen] = useState(false);
|
|
543
543
|
let classNames;
|
|
@@ -587,7 +587,6 @@ function ImageBase(props) {
|
|
|
587
587
|
$[13] = t2;
|
|
588
588
|
} else t2 = $[13];
|
|
589
589
|
const css = t2;
|
|
590
|
-
const { disabled, config, hiddenMask, blurMask, maskCover } = usePreviewOptions(preview, internalOpen);
|
|
591
590
|
let t3;
|
|
592
591
|
if ($[14] !== preview) {
|
|
593
592
|
t3 = "object" == typeof preview ? preview : {};
|
|
@@ -595,158 +594,151 @@ function ImageBase(props) {
|
|
|
595
594
|
$[15] = t3;
|
|
596
595
|
} else t3 = $[15];
|
|
597
596
|
const raw = t3;
|
|
598
|
-
|
|
599
|
-
if ($[16] !== placeholder) {
|
|
600
|
-
t4 = null !== placeholder && "object" == typeof placeholder && !/*#__PURE__*/ isValidElement(placeholder) && "progress" in placeholder;
|
|
601
|
-
$[16] = placeholder;
|
|
602
|
-
$[17] = t4;
|
|
603
|
-
} else t4 = $[17];
|
|
604
|
-
const isProgressConfig = t4;
|
|
597
|
+
const isProgressConfig = null !== placeholder && "object" == typeof placeholder && !/*#__PURE__*/ isValidElement(placeholder) && "progress" in placeholder;
|
|
605
598
|
const progress = isProgressConfig ? placeholder.progress : void 0;
|
|
606
599
|
const showPlaceholder = !!progress || !props.src && (!!placeholder || 0 === placeholder) && !isProgressConfig;
|
|
600
|
+
const { disabled, config, hiddenMask, blurMask, maskCover } = usePreviewOptions(showPlaceholder ? false : preview, internalOpen);
|
|
601
|
+
let t4;
|
|
607
602
|
let t5;
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
if (disabled || void 0 !== config.open || showPlaceholder) setInternalOpen(false);
|
|
603
|
+
if ($[16] !== config.open || $[17] !== disabled) {
|
|
604
|
+
t4 = ()=>{
|
|
605
|
+
if (disabled || void 0 !== config.open) setInternalOpen(false);
|
|
612
606
|
};
|
|
613
|
-
|
|
607
|
+
t5 = [
|
|
614
608
|
disabled,
|
|
615
|
-
config.open
|
|
616
|
-
showPlaceholder
|
|
609
|
+
config.open
|
|
617
610
|
];
|
|
618
|
-
$[
|
|
619
|
-
$[
|
|
620
|
-
$[
|
|
621
|
-
$[
|
|
622
|
-
$[22] = t6;
|
|
611
|
+
$[16] = config.open;
|
|
612
|
+
$[17] = disabled;
|
|
613
|
+
$[18] = t4;
|
|
614
|
+
$[19] = t5;
|
|
623
615
|
} else {
|
|
624
|
-
|
|
625
|
-
|
|
616
|
+
t4 = $[18];
|
|
617
|
+
t5 = $[19];
|
|
626
618
|
}
|
|
627
|
-
useEffect(
|
|
619
|
+
useEffect(t4, t5);
|
|
628
620
|
if (showPlaceholder) {
|
|
629
|
-
let
|
|
630
|
-
if ($[
|
|
631
|
-
|
|
632
|
-
$[
|
|
633
|
-
$[
|
|
634
|
-
} else
|
|
635
|
-
const
|
|
636
|
-
let
|
|
637
|
-
if ($[
|
|
638
|
-
|
|
621
|
+
let t6;
|
|
622
|
+
if ($[20] !== progress) {
|
|
623
|
+
t6 = true === progress ? {} : progress || void 0;
|
|
624
|
+
$[20] = progress;
|
|
625
|
+
$[21] = t6;
|
|
626
|
+
} else t6 = $[21];
|
|
627
|
+
const t7 = isProgressConfig ? void 0 : placeholder;
|
|
628
|
+
let t8;
|
|
629
|
+
if ($[22] !== props || $[23] !== t6 || $[24] !== t7) {
|
|
630
|
+
t8 = /*#__PURE__*/ jsx(ImageProgress, {
|
|
639
631
|
props: props,
|
|
640
|
-
progress:
|
|
641
|
-
placeholder:
|
|
632
|
+
progress: t6,
|
|
633
|
+
placeholder: t7
|
|
642
634
|
});
|
|
643
|
-
$[
|
|
644
|
-
$[
|
|
645
|
-
$[
|
|
646
|
-
$[
|
|
647
|
-
} else
|
|
648
|
-
return
|
|
635
|
+
$[22] = props;
|
|
636
|
+
$[23] = t6;
|
|
637
|
+
$[24] = t7;
|
|
638
|
+
$[25] = t8;
|
|
639
|
+
} else t8 = $[25];
|
|
640
|
+
return t8;
|
|
649
641
|
}
|
|
650
|
-
const
|
|
642
|
+
const t6 = classes?.cover;
|
|
643
|
+
let t7;
|
|
644
|
+
if ($[26] !== raw.maskClassName || $[27] !== t6) {
|
|
645
|
+
t7 = cx(t6, raw.maskClassName);
|
|
646
|
+
$[26] = raw.maskClassName;
|
|
647
|
+
$[27] = t6;
|
|
648
|
+
$[28] = t7;
|
|
649
|
+
} else t7 = $[28];
|
|
651
650
|
let t8;
|
|
652
|
-
if ($[29] !==
|
|
653
|
-
t8 =
|
|
654
|
-
|
|
651
|
+
if ($[29] !== classes || $[30] !== t7) {
|
|
652
|
+
t8 = {
|
|
653
|
+
...classes,
|
|
654
|
+
cover: t7
|
|
655
|
+
};
|
|
656
|
+
$[29] = classes;
|
|
655
657
|
$[30] = t7;
|
|
656
658
|
$[31] = t8;
|
|
657
659
|
} else t8 = $[31];
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
cover: t8
|
|
663
|
-
};
|
|
664
|
-
$[32] = classes;
|
|
665
|
-
$[33] = t8;
|
|
666
|
-
$[34] = t9;
|
|
667
|
-
} else t9 = $[34];
|
|
668
|
-
const t10 = css?.root;
|
|
669
|
-
let t11;
|
|
670
|
-
if ($[35] !== t10 || $[36] !== tokenStyle || $[37] !== wrapperStyle) {
|
|
671
|
-
t11 = {
|
|
660
|
+
const t9 = css?.root;
|
|
661
|
+
let t10;
|
|
662
|
+
if ($[32] !== t9 || $[33] !== tokenStyle || $[34] !== wrapperStyle) {
|
|
663
|
+
t10 = {
|
|
672
664
|
...tokenStyle,
|
|
673
665
|
...wrapperStyle,
|
|
674
|
-
...
|
|
666
|
+
...t9
|
|
675
667
|
};
|
|
668
|
+
$[32] = t9;
|
|
669
|
+
$[33] = tokenStyle;
|
|
670
|
+
$[34] = wrapperStyle;
|
|
676
671
|
$[35] = t10;
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
let t14;
|
|
684
|
-
if ($[39] !== t13 || $[40] !== tokenStyle) {
|
|
685
|
-
t14 = {
|
|
672
|
+
} else t10 = $[35];
|
|
673
|
+
const t11 = css?.popup;
|
|
674
|
+
const t12 = css?.popup?.root;
|
|
675
|
+
let t13;
|
|
676
|
+
if ($[36] !== t12 || $[37] !== tokenStyle) {
|
|
677
|
+
t13 = {
|
|
686
678
|
...tokenStyle,
|
|
687
|
-
...
|
|
679
|
+
...t12
|
|
688
680
|
};
|
|
689
|
-
$[
|
|
690
|
-
$[
|
|
691
|
-
$[
|
|
692
|
-
} else
|
|
693
|
-
let
|
|
694
|
-
if ($[
|
|
695
|
-
|
|
681
|
+
$[36] = t12;
|
|
682
|
+
$[37] = tokenStyle;
|
|
683
|
+
$[38] = t13;
|
|
684
|
+
} else t13 = $[38];
|
|
685
|
+
let t14;
|
|
686
|
+
if ($[39] !== hiddenMask) {
|
|
687
|
+
t14 = hiddenMask ? {
|
|
696
688
|
background: "transparent"
|
|
697
689
|
} : {};
|
|
698
|
-
$[
|
|
699
|
-
$[
|
|
700
|
-
} else
|
|
701
|
-
let
|
|
702
|
-
if ($[
|
|
703
|
-
|
|
690
|
+
$[39] = hiddenMask;
|
|
691
|
+
$[40] = t14;
|
|
692
|
+
} else t14 = $[40];
|
|
693
|
+
let t15;
|
|
694
|
+
if ($[41] !== blurMask) {
|
|
695
|
+
t15 = blurMask ? {
|
|
704
696
|
backdropFilter: "blur(4px)"
|
|
705
697
|
} : {};
|
|
706
|
-
$[
|
|
698
|
+
$[41] = blurMask;
|
|
699
|
+
$[42] = t15;
|
|
700
|
+
} else t15 = $[42];
|
|
701
|
+
const t16 = css?.popup?.mask;
|
|
702
|
+
let t17;
|
|
703
|
+
if ($[43] !== t14 || $[44] !== t15 || $[45] !== t16) {
|
|
704
|
+
t17 = {
|
|
705
|
+
...t14,
|
|
706
|
+
...t15,
|
|
707
|
+
...t16
|
|
708
|
+
};
|
|
709
|
+
$[43] = t14;
|
|
710
|
+
$[44] = t15;
|
|
707
711
|
$[45] = t16;
|
|
708
|
-
|
|
709
|
-
|
|
712
|
+
$[46] = t17;
|
|
713
|
+
} else t17 = $[46];
|
|
710
714
|
let t18;
|
|
711
|
-
if ($[
|
|
715
|
+
if ($[47] !== t11 || $[48] !== t13 || $[49] !== t17) {
|
|
712
716
|
t18 = {
|
|
713
|
-
...
|
|
714
|
-
|
|
715
|
-
|
|
717
|
+
...t11,
|
|
718
|
+
root: t13,
|
|
719
|
+
mask: t17
|
|
716
720
|
};
|
|
717
|
-
$[
|
|
718
|
-
$[
|
|
719
|
-
$[
|
|
720
|
-
$[
|
|
721
|
-
} else t18 = $[
|
|
721
|
+
$[47] = t11;
|
|
722
|
+
$[48] = t13;
|
|
723
|
+
$[49] = t17;
|
|
724
|
+
$[50] = t18;
|
|
725
|
+
} else t18 = $[50];
|
|
722
726
|
let t19;
|
|
723
|
-
if ($[
|
|
727
|
+
if ($[51] !== css || $[52] !== t10 || $[53] !== t18) {
|
|
724
728
|
t19 = {
|
|
725
|
-
...t12,
|
|
726
|
-
root: t14,
|
|
727
|
-
mask: t18
|
|
728
|
-
};
|
|
729
|
-
$[50] = t12;
|
|
730
|
-
$[51] = t14;
|
|
731
|
-
$[52] = t18;
|
|
732
|
-
$[53] = t19;
|
|
733
|
-
} else t19 = $[53];
|
|
734
|
-
let t20;
|
|
735
|
-
if ($[54] !== css || $[55] !== t11 || $[56] !== t19) {
|
|
736
|
-
t20 = {
|
|
737
729
|
...css,
|
|
738
|
-
root:
|
|
739
|
-
popup:
|
|
730
|
+
root: t10,
|
|
731
|
+
popup: t18
|
|
740
732
|
};
|
|
741
|
-
$[
|
|
742
|
-
$[
|
|
743
|
-
$[
|
|
744
|
-
$[
|
|
745
|
-
} else
|
|
746
|
-
const
|
|
747
|
-
let
|
|
748
|
-
if ($[
|
|
749
|
-
|
|
733
|
+
$[51] = css;
|
|
734
|
+
$[52] = t10;
|
|
735
|
+
$[53] = t18;
|
|
736
|
+
$[54] = t19;
|
|
737
|
+
} else t19 = $[54];
|
|
738
|
+
const t20 = isProgressConfig ? void 0 : placeholder;
|
|
739
|
+
let t21;
|
|
740
|
+
if ($[55] !== config || $[56] !== disabled || $[57] !== internalOpen || $[58] !== maskCover || $[59] !== raw) {
|
|
741
|
+
t21 = disabled ? false : {
|
|
750
742
|
...config,
|
|
751
743
|
open: config.open ?? internalOpen,
|
|
752
744
|
cover: raw.cover ?? maskCover ?? /*#__PURE__*/ jsx("span", {
|
|
@@ -759,37 +751,37 @@ function ImageBase(props) {
|
|
|
759
751
|
else raw.onVisibleChange?.(open, !open);
|
|
760
752
|
}
|
|
761
753
|
};
|
|
762
|
-
$[
|
|
763
|
-
$[
|
|
764
|
-
$[
|
|
765
|
-
$[
|
|
766
|
-
$[
|
|
767
|
-
$[
|
|
768
|
-
} else
|
|
769
|
-
let
|
|
770
|
-
if ($[
|
|
771
|
-
|
|
754
|
+
$[55] = config;
|
|
755
|
+
$[56] = disabled;
|
|
756
|
+
$[57] = internalOpen;
|
|
757
|
+
$[58] = maskCover;
|
|
758
|
+
$[59] = raw;
|
|
759
|
+
$[60] = t21;
|
|
760
|
+
} else t21 = $[60];
|
|
761
|
+
let t22;
|
|
762
|
+
if ($[61] !== prefixCls || $[62] !== rest || $[63] !== t19 || $[64] !== t20 || $[65] !== t21 || $[66] !== t8) {
|
|
763
|
+
t22 = /*#__PURE__*/ jsx("span", {
|
|
772
764
|
"data-tao-image-inline": "",
|
|
773
765
|
children: /*#__PURE__*/ jsx(RcImageComponent, {
|
|
774
766
|
...rest,
|
|
775
767
|
"data-tao-image": "",
|
|
776
768
|
prefixCls: prefixCls,
|
|
777
769
|
previewPrefixCls: "tao-image-preview",
|
|
778
|
-
classNames:
|
|
779
|
-
styles:
|
|
780
|
-
placeholder:
|
|
781
|
-
preview:
|
|
770
|
+
classNames: t8,
|
|
771
|
+
styles: t19,
|
|
772
|
+
placeholder: t20,
|
|
773
|
+
preview: t21
|
|
782
774
|
})
|
|
783
775
|
});
|
|
784
|
-
$[
|
|
785
|
-
$[
|
|
786
|
-
$[
|
|
787
|
-
$[
|
|
788
|
-
$[
|
|
789
|
-
$[
|
|
790
|
-
$[
|
|
791
|
-
} else
|
|
792
|
-
return
|
|
776
|
+
$[61] = prefixCls;
|
|
777
|
+
$[62] = rest;
|
|
778
|
+
$[63] = t19;
|
|
779
|
+
$[64] = t20;
|
|
780
|
+
$[65] = t21;
|
|
781
|
+
$[66] = t8;
|
|
782
|
+
$[67] = t22;
|
|
783
|
+
} else t22 = $[67];
|
|
784
|
+
return t22;
|
|
793
785
|
}
|
|
794
786
|
function ImagePreviewGroup(props) {
|
|
795
787
|
const $ = c(53);
|
|
@@ -275,6 +275,12 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
275
275
|
input: styles?.input
|
|
276
276
|
},
|
|
277
277
|
onFocus: _temp2,
|
|
278
|
+
onBlur: ()=>{
|
|
279
|
+
if (composing.current === index_1) {
|
|
280
|
+
composing.current = null;
|
|
281
|
+
setDraft(null);
|
|
282
|
+
}
|
|
283
|
+
},
|
|
278
284
|
onChange: (event_0)=>{
|
|
279
285
|
if (composing.current === index_1) setDraft({
|
|
280
286
|
index: index_1,
|
|
@@ -19,14 +19,16 @@ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
19
19
|
}) : customStyles;
|
|
20
20
|
const customButton = /*#__PURE__*/ isValidElement(enterButton) && ('button' === enterButton.type || enterButton.type === Button);
|
|
21
21
|
const isLoading = loading || customButton && enterButton.type === Button && enterButton.props.loading;
|
|
22
|
+
const submitDisabled = disabled || isLoading || customButton && enterButton.props.disabled;
|
|
22
23
|
const search = (event)=>{
|
|
23
|
-
|
|
24
|
+
const input = inputRef.current;
|
|
25
|
+
if (input && !submitDisabled && !event.defaultPrevented) onSearch?.(input.value, event, {
|
|
24
26
|
source: 'input'
|
|
25
27
|
});
|
|
26
28
|
};
|
|
27
29
|
const buttonProps = {
|
|
28
30
|
type: 'button',
|
|
29
|
-
disabled:
|
|
31
|
+
disabled: submitDisabled,
|
|
30
32
|
'aria-busy': isLoading || void 0,
|
|
31
33
|
'aria-label': ctx.locale.search ?? 'Search',
|
|
32
34
|
className: classNames?.button,
|
|
@@ -34,6 +36,7 @@ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
34
36
|
onMouseDown: (event_0)=>event_0.preventDefault(),
|
|
35
37
|
onClick: search
|
|
36
38
|
};
|
|
39
|
+
const hasButtonContent = 0 === enterButton || Boolean(enterButton);
|
|
37
40
|
const button = customButton ? /*#__PURE__*/ cloneElement(enterButton, {
|
|
38
41
|
...buttonProps,
|
|
39
42
|
className: cx(enterButton.props.className, classNames?.button),
|
|
@@ -42,7 +45,6 @@ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
42
45
|
...styles?.button
|
|
43
46
|
},
|
|
44
47
|
'aria-label': enterButton.props['aria-label'] ?? buttonProps['aria-label'],
|
|
45
|
-
disabled: buttonProps.disabled || enterButton.props.disabled,
|
|
46
48
|
...enterButton.type === Button ? {
|
|
47
49
|
loading: isLoading,
|
|
48
50
|
size: props.size ?? enterButton.props.size
|
|
@@ -59,8 +61,8 @@ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
59
61
|
...buttonProps,
|
|
60
62
|
loading: isLoading,
|
|
61
63
|
size: props.size,
|
|
62
|
-
variant:
|
|
63
|
-
children: true !== enterButton &&
|
|
64
|
+
variant: hasButtonContent ? 'primary' : 'secondary',
|
|
65
|
+
children: true !== enterButton && hasButtonContent ? enterButton : searchIcon ?? /*#__PURE__*/ jsx(SearchIcon, {})
|
|
64
66
|
});
|
|
65
67
|
return /*#__PURE__*/ jsxs("div", {
|
|
66
68
|
"data-tao-input-search": "",
|