@rockshin/tao-ui 0.0.56 → 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.
Files changed (37) hide show
  1. package/component-manifest.json +1 -1
  2. package/dist/components/app/app-notices.js +10 -3
  3. package/dist/components/avatar/avatar.js +1 -1
  4. package/dist/components/badge/badge.js +2 -2
  5. package/dist/components/breadcrumb/breadcrumb.js +5 -1
  6. package/dist/components/calendar/calendar.js +4 -1
  7. package/dist/components/carousel/carousel.js +8 -2
  8. package/dist/components/collapse/collapse-panels.js +68 -67
  9. package/dist/components/date-picker/date-localization.js +12 -14
  10. package/dist/components/divider/divider.js +1 -1
  11. package/dist/components/float-button/float-button.js +7 -5
  12. package/dist/components/form/use-form.d.ts +1 -1
  13. package/dist/components/form/use-form.js +20 -0
  14. package/dist/components/image/image.js +135 -143
  15. package/dist/components/input/otp.js +6 -0
  16. package/dist/components/input/search.js +7 -5
  17. package/dist/components/list/list.js +106 -105
  18. package/dist/components/masonry/masonry.js +1 -1
  19. package/dist/components/modal/modal.js +112 -35
  20. package/dist/components/pagination/pagination.d.ts +2 -0
  21. package/dist/components/pagination/pagination.js +4 -0
  22. package/dist/components/rate/rate.js +83 -72
  23. package/dist/components/scroll-area/scroll-area.css +1 -1
  24. package/dist/components/scroll-area/scroll-area.js +294 -222
  25. package/dist/components/select/select-tags.js +2 -1
  26. package/dist/components/select/use-select-selection.d.ts +1 -1
  27. package/dist/components/select/use-select-selection.js +60 -53
  28. package/dist/components/statistic/statistic.js +84 -78
  29. package/dist/components/steps/steps.css +8 -0
  30. package/dist/components/steps/steps.d.ts +5 -1
  31. package/dist/components/steps/steps.js +126 -116
  32. package/dist/components/table/table.js +4 -1
  33. package/dist/components/upload/upload.js +2 -2
  34. package/dist/number-input/cursor.js +20 -8
  35. package/dist/number-input/format.js +12 -4
  36. package/dist/number-input/use-number-input.js +4 -1
  37. 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(71);
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
- let t4;
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
- let t6;
609
- if ($[18] !== config.open || $[19] !== disabled || $[20] !== showPlaceholder) {
610
- t5 = ()=>{
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
- t6 = [
607
+ t5 = [
614
608
  disabled,
615
- config.open,
616
- showPlaceholder
609
+ config.open
617
610
  ];
618
- $[18] = config.open;
619
- $[19] = disabled;
620
- $[20] = showPlaceholder;
621
- $[21] = t5;
622
- $[22] = t6;
611
+ $[16] = config.open;
612
+ $[17] = disabled;
613
+ $[18] = t4;
614
+ $[19] = t5;
623
615
  } else {
624
- t5 = $[21];
625
- t6 = $[22];
616
+ t4 = $[18];
617
+ t5 = $[19];
626
618
  }
627
- useEffect(t5, t6);
619
+ useEffect(t4, t5);
628
620
  if (showPlaceholder) {
629
- let t7;
630
- if ($[23] !== progress) {
631
- t7 = true === progress ? {} : progress || void 0;
632
- $[23] = progress;
633
- $[24] = t7;
634
- } else t7 = $[24];
635
- const t8 = isProgressConfig ? void 0 : placeholder;
636
- let t9;
637
- if ($[25] !== props || $[26] !== t7 || $[27] !== t8) {
638
- t9 = /*#__PURE__*/ jsx(ImageProgress, {
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: t7,
641
- placeholder: t8
632
+ progress: t6,
633
+ placeholder: t7
642
634
  });
643
- $[25] = props;
644
- $[26] = t7;
645
- $[27] = t8;
646
- $[28] = t9;
647
- } else t9 = $[28];
648
- return t9;
635
+ $[22] = props;
636
+ $[23] = t6;
637
+ $[24] = t7;
638
+ $[25] = t8;
639
+ } else t8 = $[25];
640
+ return t8;
649
641
  }
650
- const t7 = classes?.cover;
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] !== raw.maskClassName || $[30] !== t7) {
653
- t8 = cx(t7, raw.maskClassName);
654
- $[29] = raw.maskClassName;
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
- let t9;
659
- if ($[32] !== classes || $[33] !== t8) {
660
- t9 = {
661
- ...classes,
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
- ...t10
666
+ ...t9
675
667
  };
668
+ $[32] = t9;
669
+ $[33] = tokenStyle;
670
+ $[34] = wrapperStyle;
676
671
  $[35] = t10;
677
- $[36] = tokenStyle;
678
- $[37] = wrapperStyle;
679
- $[38] = t11;
680
- } else t11 = $[38];
681
- const t12 = css?.popup;
682
- const t13 = css?.popup?.root;
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
- ...t13
679
+ ...t12
688
680
  };
689
- $[39] = t13;
690
- $[40] = tokenStyle;
691
- $[41] = t14;
692
- } else t14 = $[41];
693
- let t15;
694
- if ($[42] !== hiddenMask) {
695
- t15 = hiddenMask ? {
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
- $[42] = hiddenMask;
699
- $[43] = t15;
700
- } else t15 = $[43];
701
- let t16;
702
- if ($[44] !== blurMask) {
703
- t16 = blurMask ? {
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
- $[44] = blurMask;
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
- } else t16 = $[45];
709
- const t17 = css?.popup?.mask;
712
+ $[46] = t17;
713
+ } else t17 = $[46];
710
714
  let t18;
711
- if ($[46] !== t15 || $[47] !== t16 || $[48] !== t17) {
715
+ if ($[47] !== t11 || $[48] !== t13 || $[49] !== t17) {
712
716
  t18 = {
713
- ...t15,
714
- ...t16,
715
- ...t17
717
+ ...t11,
718
+ root: t13,
719
+ mask: t17
716
720
  };
717
- $[46] = t15;
718
- $[47] = t16;
719
- $[48] = t17;
720
- $[49] = t18;
721
- } else t18 = $[49];
721
+ $[47] = t11;
722
+ $[48] = t13;
723
+ $[49] = t17;
724
+ $[50] = t18;
725
+ } else t18 = $[50];
722
726
  let t19;
723
- if ($[50] !== t12 || $[51] !== t14 || $[52] !== t18) {
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: t11,
739
- popup: t19
730
+ root: t10,
731
+ popup: t18
740
732
  };
741
- $[54] = css;
742
- $[55] = t11;
743
- $[56] = t19;
744
- $[57] = t20;
745
- } else t20 = $[57];
746
- const t21 = isProgressConfig ? void 0 : placeholder;
747
- let t22;
748
- if ($[58] !== config || $[59] !== disabled || $[60] !== internalOpen || $[61] !== maskCover || $[62] !== raw) {
749
- t22 = disabled ? false : {
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
- $[58] = config;
763
- $[59] = disabled;
764
- $[60] = internalOpen;
765
- $[61] = maskCover;
766
- $[62] = raw;
767
- $[63] = t22;
768
- } else t22 = $[63];
769
- let t23;
770
- if ($[64] !== prefixCls || $[65] !== rest || $[66] !== t20 || $[67] !== t21 || $[68] !== t22 || $[69] !== t9) {
771
- t23 = /*#__PURE__*/ jsx("span", {
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: t9,
779
- styles: t20,
780
- placeholder: t21,
781
- preview: t22
770
+ classNames: t8,
771
+ styles: t19,
772
+ placeholder: t20,
773
+ preview: t21
782
774
  })
783
775
  });
784
- $[64] = prefixCls;
785
- $[65] = rest;
786
- $[66] = t20;
787
- $[67] = t21;
788
- $[68] = t22;
789
- $[69] = t9;
790
- $[70] = t23;
791
- } else t23 = $[70];
792
- return t23;
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
- if (!disabled && !isLoading && !event.defaultPrevented) onSearch?.(inputRef.current.value, event, {
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: disabled || isLoading,
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: enterButton ? 'primary' : 'secondary',
63
- children: true !== enterButton && enterButton ? enterButton : searchIcon ?? /*#__PURE__*/ jsx(SearchIcon, {})
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": "",