@arco-design/mobile-react 2.30.2 → 2.30.3

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 (58) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/form/type.d.ts +2 -2
  5. package/cjs/image-preview/index.d.ts +6 -0
  6. package/cjs/image-preview/index.js +48 -14
  7. package/cjs/image-preview/style/css/index.css +2 -1
  8. package/cjs/image-preview/style/index.less +2 -1
  9. package/cjs/popover/style/css/index.css +9 -2
  10. package/cjs/popover/style/css/menu.css +4 -0
  11. package/cjs/popover/style/index.less +1 -2
  12. package/cjs/popover/style/menu.less +1 -1
  13. package/cjs/slider/hooks/useSliderEvents.js +14 -8
  14. package/cjs/slider/hooks/useSliderStyle.js +13 -7
  15. package/cjs/slider/index.js +4 -2
  16. package/cjs/slider/marks.js +4 -2
  17. package/cjs/slider/style/css/index.css +28 -0
  18. package/cjs/slider/style/index.less +13 -4
  19. package/dist/index.js +97 -52
  20. package/dist/index.min.js +4 -4
  21. package/dist/style.css +36 -3
  22. package/dist/style.min.css +1 -1
  23. package/esm/form/type.d.ts +2 -2
  24. package/esm/image-preview/index.d.ts +6 -0
  25. package/esm/image-preview/index.js +48 -14
  26. package/esm/image-preview/style/css/index.css +2 -1
  27. package/esm/image-preview/style/index.less +2 -1
  28. package/esm/popover/style/css/index.css +9 -2
  29. package/esm/popover/style/css/menu.css +4 -0
  30. package/esm/popover/style/index.less +1 -2
  31. package/esm/popover/style/menu.less +1 -1
  32. package/esm/slider/hooks/useSliderEvents.js +13 -8
  33. package/esm/slider/hooks/useSliderStyle.js +12 -7
  34. package/esm/slider/index.js +4 -2
  35. package/esm/slider/marks.js +4 -2
  36. package/esm/slider/style/css/index.css +28 -0
  37. package/esm/slider/style/index.less +13 -4
  38. package/package.json +3 -3
  39. package/tokens/app/arcodesign/default/css-variables.less +1 -1
  40. package/tokens/app/arcodesign/default/index.d.ts +1 -1
  41. package/tokens/app/arcodesign/default/index.js +1 -1
  42. package/tokens/app/arcodesign/default/index.json +7 -7
  43. package/tokens/app/arcodesign/default/index.less +1 -1
  44. package/umd/form/type.d.ts +2 -2
  45. package/umd/image-preview/index.d.ts +6 -0
  46. package/umd/image-preview/index.js +48 -14
  47. package/umd/image-preview/style/css/index.css +2 -1
  48. package/umd/image-preview/style/index.less +2 -1
  49. package/umd/popover/style/css/index.css +9 -2
  50. package/umd/popover/style/css/menu.css +4 -0
  51. package/umd/popover/style/index.less +1 -2
  52. package/umd/popover/style/menu.less +1 -1
  53. package/umd/slider/hooks/useSliderEvents.js +16 -12
  54. package/umd/slider/hooks/useSliderStyle.js +15 -11
  55. package/umd/slider/index.js +4 -2
  56. package/umd/slider/marks.js +4 -2
  57. package/umd/slider/style/css/index.css +28 -0
  58. package/umd/slider/style/index.less +13 -4
@@ -145,7 +145,7 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
145
145
  transformersRef.current = []; // 移除过渡图片
146
146
  // @en Remove transition image
147
147
 
148
- removeChild(document.querySelector('.image-preview-fake-trans-image'));
148
+ removeChild(transImageRef.current);
149
149
  setTransImageInfo(null);
150
150
  setPlaceholders({});
151
151
  var mounted = isInitialMount.current;
@@ -188,7 +188,9 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
188
188
 
189
189
  function removeChild(child) {
190
190
  try {
191
- child && document.body.removeChild(child);
191
+ var _domRef$current, _domRef$current$query, _domRef$current$query2;
192
+
193
+ child && ((_domRef$current = domRef.current) == null ? void 0 : (_domRef$current$query = _domRef$current.querySelectorAll('.carousel-item')) == null ? void 0 : (_domRef$current$query2 = _domRef$current$query[innerIndexRef.current]) == null ? void 0 : _domRef$current$query2.removeChild(child));
192
194
  } catch (e) {}
193
195
  } // 监听滑动到上下边缘后还在往外滑动的操作,则关闭弹窗
194
196
  // @en Monitor the operation of sliding out after sliding to the upper and lower edges, then close the popup
@@ -607,7 +609,41 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
607
609
  }
608
610
  }
609
611
 
610
- var handleClick = useSingleAndDoubleClick(handleImageClick, handleImageDoubleClick);
612
+ var handleClick = useSingleAndDoubleClick(handleImageClick, handleImageDoubleClick); // 当使用 getThumbBounds 时,关闭图片预览有缩小效果
613
+ // @en When using getThumbBounds, closing the image preview has a shrinking effect
614
+
615
+ function animateBeforeClose() {
616
+ var _imagesRef$current$in2;
617
+
618
+ var index = innerIndexRef.current;
619
+ var imageDom = (_imagesRef$current$in2 = imagesRef.current[index]) == null ? void 0 : _imagesRef$current$in2.image;
620
+ var thumbBounds = getThumbBounds == null ? void 0 : getThumbBounds(index);
621
+
622
+ if (!imageDom || !thumbBounds || !thumbBounds.width || !thumbBounds.height) {
623
+ return;
624
+ } // 小图超过一半在视野外时,不展示缩小效果
625
+ // @en When more than half of the thumbnail is outside the field of view, the zoom effect will not be displayed
626
+
627
+
628
+ if (thumbBounds.top < -1 * thumbBounds.height / 2 || thumbBounds.top > windowHeight - thumbBounds.height / 2 || thumbBounds.left < -1 * thumbBounds.width / 2 || thumbBounds.left > windowWidth - thumbBounds.width / 2) {
629
+ return;
630
+ }
631
+
632
+ var imageDomRect = imageDom.getBoundingClientRect();
633
+
634
+ if (!imageDomRect.width || !imageDomRect.height) {
635
+ return;
636
+ }
637
+
638
+ imageDom.classList.add('closing-animation');
639
+ setImageBounds(imageDom, imageDomRect, imageDomRect);
640
+ imageDom.style.objectPosition = images[index].thumbPosition || 'top center';
641
+ nextTick(function () {
642
+ imageDom.style.transitionDuration = displayDuration + "ms";
643
+ imageDom.style.webkitTransitionDuration = displayDuration + "ms";
644
+ setImageBounds(imageDom, thumbBounds, imageDomRect);
645
+ });
646
+ }
611
647
 
612
648
  function goClose(e) {
613
649
  if (closingRef.current) {
@@ -615,6 +651,7 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
615
651
  }
616
652
 
617
653
  closingRef.current = true;
654
+ animateBeforeClose();
618
655
  close(e);
619
656
  }
620
657
  /**
@@ -637,7 +674,7 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
637
674
 
638
675
 
639
676
  function setDisplayAnimation(index) {
640
- var _imagesStatusRef$curr4;
677
+ var _imagesStatusRef$curr4, _domRef$current2, _domRef$current2$quer, _domRef$current2$quer2;
641
678
 
642
679
  var firstLoaded = (_imagesStatusRef$curr4 = imagesStatusRef.current[index]) == null ? void 0 : _imagesStatusRef$curr4.firstLoaded;
643
680
  var fallbackSrc = replaceFallbackWhenLoaded && firstLoaded ? images[index].src : images[index].fallbackSrc; // 用户设置了getThumbBounds和images的fallbackSrc属性才有放大过渡效果
@@ -668,7 +705,7 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
668
705
  transImage.style.opacity = '0';
669
706
  transImage.style.transitionDuration = displayDuration + "ms";
670
707
  transImage.style.webkitTransitionDuration = displayDuration + "ms";
671
- document.body.appendChild(transImage); // 拿到放大之后的位置rect,没拿到就取消小图放大效果
708
+ (_domRef$current2 = domRef.current) == null ? void 0 : (_domRef$current2$quer = _domRef$current2.querySelectorAll('.carousel-item')) == null ? void 0 : (_domRef$current2$quer2 = _domRef$current2$quer[index]) == null ? void 0 : _domRef$current2$quer2.prepend(transImage); // 拿到放大之后的位置rect,没拿到就取消小图放大效果
672
709
  // @en Get the zoomed-in position rect, and cancel the zoom-in effect if not getting it
673
710
 
674
711
  getNewImageBounds(index, fallbackSrc, transImage, function (rect) {
@@ -690,9 +727,10 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
690
727
  return _extends({}, holders, (_extends3 = {}, _extends3[index] = true, _extends3));
691
728
  });
692
729
  }, Math.max(0, displayDuration - 80));
730
+ var transitionEndDelay = images[index].transitionEndDelay || 30;
693
731
  setTimeout(function () {
694
732
  resetAnimation(index);
695
- }, displayDuration + 30);
733
+ }, displayDuration + transitionEndDelay);
696
734
  });
697
735
  });
698
736
  }
@@ -851,18 +889,14 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
851
889
  }) : null;
852
890
  }
853
891
 
854
- function renderLoadingArea(index) {
855
- // loadingArea提出来,放到过渡图上层
856
- // @en The loadingArea is extracted and placed on the upper layer of the transition image
857
- return index === openIndex ? /*#__PURE__*/React.createElement(Portal, {
858
- getContainer: getContainer
859
- }, /*#__PURE__*/React.createElement("div", {
892
+ function renderLoadingArea() {
893
+ return /*#__PURE__*/React.createElement("div", {
860
894
  className: "image-preview-loading-area"
861
895
  }, loadingArea || /*#__PURE__*/React.createElement(Loading, {
862
896
  type: "circle",
863
897
  className: "loading-icon",
864
898
  radius: 7
865
- }))) : loadingArea;
899
+ }));
866
900
  }
867
901
 
868
902
  return /*#__PURE__*/React.createElement(ContextLayout, null, function (_ref3) {
@@ -910,7 +944,7 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
910
944
  imagesRef.current[index] = r;
911
945
  },
912
946
  showLoading: showLoading,
913
- loadingArea: renderLoadingArea(index),
947
+ loadingArea: renderLoadingArea(),
914
948
  errorArea: errorArea,
915
949
  showError: showError,
916
950
  retryTime: retryTime,
@@ -575,6 +575,7 @@
575
575
  height: 100%;
576
576
  opacity: 0;
577
577
  }
578
+ .arco-image-preview .image-container img.closing-animation,
578
579
  .image-preview-fake-trans-image {
579
580
  position: fixed;
580
581
  left: 0;
@@ -584,7 +585,7 @@
584
585
  transition: all cubic-bezier(0.34, 0.69, 0.1, 1) ;
585
586
  will-change: transform;
586
587
  pointer-events: none;
587
- z-index: 1001;
588
+ height: auto !important;
588
589
  }
589
590
  .image-preview-loading-area {
590
591
  position: fixed;
@@ -77,6 +77,7 @@
77
77
  opacity: 0;
78
78
  }
79
79
 
80
+ .@{prefix}-image-preview .image-container img.closing-animation,
80
81
  .image-preview-fake-trans-image {
81
82
  position: fixed;
82
83
  left: 0;
@@ -85,7 +86,7 @@
85
86
  .use-var(transition, image-preview-thumb-transition);
86
87
  will-change: transform;
87
88
  pointer-events: none;
88
- z-index: @full-screen-z-index + 1;
89
+ height: auto !important;
89
90
  }
90
91
 
91
92
  .image-preview-loading-area {
@@ -549,6 +549,10 @@
549
549
  font-size: 0.4rem;
550
550
  line-height: 1;
551
551
  }
552
+ [dir="rtl"] .arco-popover-menu-icon {
553
+ margin-right: initial;
554
+ margin-left: 0.16rem;
555
+ }
552
556
  .arco-popover-menu-icon > * {
553
557
  float: left;
554
558
  }
@@ -634,7 +638,6 @@
634
638
  width: -webkit-max-content;
635
639
  width: max-content;
636
640
  z-index: 1010;
637
- right: 0;
638
641
  background-color: transparent;
639
642
  visibility: hidden;
640
643
  will-change: transform;
@@ -716,11 +719,15 @@
716
719
  padding: 0 0.2rem 0 0.22rem ;
717
720
  }
718
721
  .arco-popover-inner .text-suffix {
719
- padding: 0 0.24rem 0 0 ;
722
+ padding-right: 0.24rem ;
720
723
  -webkit-box-flex: 0;
721
724
  -webkit-flex: 0 0 auto;
722
725
  flex: 0 0 auto;
723
726
  }
727
+ [dir="rtl"] .arco-popover-inner .text-suffix {
728
+ padding-right: initial;
729
+ padding-left: 0.24rem ;
730
+ }
724
731
  .arco-popover-inner .popover-arrow {
725
732
  position: absolute;
726
733
  -webkit-transform: rotate(45deg);
@@ -549,6 +549,10 @@
549
549
  font-size: 0.4rem;
550
550
  line-height: 1;
551
551
  }
552
+ [dir="rtl"] .arco-popover-menu-icon {
553
+ margin-right: initial;
554
+ margin-left: 0.16rem;
555
+ }
552
556
  .arco-popover-menu-icon > * {
553
557
  float: left;
554
558
  }
@@ -29,7 +29,6 @@
29
29
  position: absolute;
30
30
  width: max-content;
31
31
  z-index: @full-screen-z-index + 10;
32
- right: 0;
33
32
  background-color: transparent;
34
33
  visibility: hidden;
35
34
  will-change: transform;
@@ -104,7 +103,7 @@
104
103
  }
105
104
 
106
105
  .text-suffix {
107
- .use-var(padding, popover-text-suffix-padding);
106
+ .use-var-with-rtl(padding-right, popover-text-suffix-edge);
108
107
  flex: 0 0 auto;
109
108
  }
110
109
 
@@ -32,7 +32,7 @@
32
32
  }
33
33
  }
34
34
  &-icon {
35
- .rem(margin-right, 8);
35
+ .rem-with-rtl(margin-right, 8);
36
36
  .rem(font-size, 20);
37
37
  line-height: 1;
38
38
  & > * {
@@ -1,5 +1,6 @@
1
1
  import { useCallback, useContext, useState, useEffect, useMemo, useRef } from 'react';
2
2
  import { SliderContext } from '.';
3
+ import { GlobalContext } from '../../context-provider';
3
4
  var IsTouchingStatus;
4
5
 
5
6
  (function (IsTouchingStatus) {
@@ -15,13 +16,16 @@ export var useSliderEvents = function useSliderEvents(_ref) {
15
16
  setValueGroup = _ref.setValueGroup,
16
17
  setCommonIsTouching = _ref.setCommonIsTouching;
17
18
 
18
- var _useContext = useContext(SliderContext),
19
- disabled = _useContext.disabled,
20
- step = _useContext.step,
21
- min = _useContext.min,
22
- max = _useContext.max,
23
- type = _useContext.type,
24
- draggableTrackOnly = _useContext.draggableTrackOnly;
19
+ var _useContext = useContext(GlobalContext),
20
+ useRtl = _useContext.useRtl;
21
+
22
+ var _useContext2 = useContext(SliderContext),
23
+ disabled = _useContext2.disabled,
24
+ step = _useContext2.step,
25
+ min = _useContext2.min,
26
+ max = _useContext2.max,
27
+ type = _useContext2.type,
28
+ draggableTrackOnly = _useContext2.draggableTrackOnly;
25
29
 
26
30
  var _useState = useState(IsTouchingStatus.Idle),
27
31
  isTouching = _useState[0],
@@ -47,7 +51,8 @@ export var useSliderEvents = function useSliderEvents(_ref) {
47
51
  length = _linePositionRef$curr.length,
48
52
  start = _linePositionRef$curr.start;
49
53
  if (length === 0) return 0;
50
- var newWidth = isHorizontal ? touchPosition - start : length - touchPosition + start;
54
+ var rtlRatio = useRtl ? -1 : 1;
55
+ var newWidth = isHorizontal ? (touchPosition - start) * rtlRatio : length - touchPosition + start;
51
56
 
52
57
  if (newWidth < 0) {
53
58
  newWidth = 0;
@@ -1,16 +1,20 @@
1
1
  import { useContext, useMemo } from 'react';
2
2
  import { SliderContext } from '.';
3
+ import { GlobalContext } from '../../context-provider';
3
4
  export var useSliderStyle = function useSliderStyle(_ref) {
4
5
  var getLinePosition = _ref.getLinePosition,
5
6
  commonIsTouching = _ref.commonIsTouching,
6
7
  valueGroup = _ref.valueGroup;
7
8
 
8
- var _useContext = useContext(SliderContext),
9
- size = _useContext.size,
10
- useAnimation = _useContext.useAnimation,
11
- min = _useContext.min,
12
- max = _useContext.max,
13
- type = _useContext.type;
9
+ var _useContext = useContext(GlobalContext),
10
+ useRtl = _useContext.useRtl;
11
+
12
+ var _useContext2 = useContext(SliderContext),
13
+ size = _useContext2.size,
14
+ useAnimation = _useContext2.useAnimation,
15
+ min = _useContext2.min,
16
+ max = _useContext2.max,
17
+ type = _useContext2.type;
14
18
 
15
19
  var isHorizontal = /^horizontal/g.test(type);
16
20
  var heightStyle = useMemo(function () {
@@ -44,7 +48,8 @@ export var useSliderStyle = function useSliderStyle(_ref) {
44
48
  length = (larger - min) / (max - min) * length - start;
45
49
  }
46
50
 
47
- return _ref3 = {}, _ref3[isHorizontal ? 'left' : 'bottom'] = start + "px", _ref3[isHorizontal ? 'width' : 'height'] = Math.abs(length) + "px", _ref3;
51
+ var leftStyle = useRtl ? 'right' : 'left';
52
+ return _ref3 = {}, _ref3[isHorizontal ? leftStyle : 'bottom'] = start + "px", _ref3[isHorizontal ? 'width' : 'height'] = Math.abs(length) + "px", _ref3;
48
53
  }, [valueGroup, getLinePosition, min, max, isHorizontal]);
49
54
  return {
50
55
  heightStyle: heightStyle,
@@ -8,7 +8,8 @@ import Marks from './marks';
8
8
  var Slider = /*#__PURE__*/forwardRef(function (_, ref) {
9
9
  var _useContext = useContext(GlobalContext),
10
10
  _useContext$prefixCls = _useContext.prefixCls,
11
- prefixCls = _useContext$prefixCls === void 0 ? '' : _useContext$prefixCls;
11
+ prefixCls = _useContext$prefixCls === void 0 ? '' : _useContext$prefixCls,
12
+ useRtl = _useContext.useRtl;
12
13
 
13
14
  var _useContext2 = useContext(SliderContext),
14
15
  className = _useContext2.className,
@@ -59,9 +60,10 @@ var Slider = /*#__PURE__*/forwardRef(function (_, ref) {
59
60
  top = _ref.top,
60
61
  height = _ref.height;
61
62
 
63
+ var leftValue = useRtl ? left + width : left;
62
64
  return {
63
65
  length: isHorizontal ? width : height,
64
- start: isHorizontal ? left : top
66
+ start: isHorizontal ? leftValue : top
65
67
  };
66
68
  }, [isHorizontal, firstRender]);
67
69
 
@@ -13,7 +13,8 @@ function Marks(_ref) {
13
13
 
14
14
  var _useContext = useContext(GlobalContext),
15
15
  _useContext$prefixCls = _useContext.prefixCls,
16
- prefixCls = _useContext$prefixCls === void 0 ? '' : _useContext$prefixCls;
16
+ prefixCls = _useContext$prefixCls === void 0 ? '' : _useContext$prefixCls,
17
+ useRtl = _useContext.useRtl;
17
18
 
18
19
  var _useContext2 = useContext(SliderContext),
19
20
  type = _useContext2.type,
@@ -25,7 +26,8 @@ function Marks(_ref) {
25
26
  var genMarkStyle = useCallback(function (value) {
26
27
  var _ref2;
27
28
 
28
- return _ref2 = {}, _ref2[isHorizontal ? 'left' : 'bottom'] = (value - min) / (max - min) * 100 + "%", _ref2;
29
+ var leftStyle = useRtl ? 'right' : 'left';
30
+ return _ref2 = {}, _ref2[isHorizontal ? leftStyle : 'bottom'] = (value - min) / (max - min) * 100 + "%", _ref2;
29
31
  }, [isHorizontal, min, max]);
30
32
  return /*#__PURE__*/React.createElement("div", {
31
33
  className: prefixCls + "-slider-marks"
@@ -541,6 +541,10 @@
541
541
  .is-horizontal .arco-slider-label {
542
542
  margin-right: 0.24rem ;
543
543
  }
544
+ [dir="rtl"] .is-horizontal .arco-slider-label {
545
+ margin-right: initial;
546
+ margin-left: 0.24rem ;
547
+ }
544
548
  .is-vertical .arco-slider-label {
545
549
  -webkit-box-orient: vertical;
546
550
  -webkit-box-direction: normal;
@@ -552,6 +556,10 @@
552
556
  margin-right: 0;
553
557
  margin-left: 0.24rem ;
554
558
  }
559
+ [dir="rtl"] .is-horizontal .arco-slider-wrapper + .arco-slider-label {
560
+ margin-left: initial;
561
+ margin-right: 0.24rem ;
562
+ }
555
563
  .is-vertical .arco-slider-wrapper + .arco-slider-label {
556
564
  margin-bottom: 0;
557
565
  margin-top: 0.24rem ;
@@ -636,11 +644,27 @@
636
644
  -webkit-transform: translateX(50%);
637
645
  transform: translateX(50%);
638
646
  }
647
+ [dir="rtl"] .is-horizontal .arco-slider-thumb-wrapper.is-end {
648
+ right: initial;
649
+ left: 0;
650
+ }
651
+ [dir="rtl"] .is-horizontal .arco-slider-thumb-wrapper.is-end {
652
+ -webkit-transform: translateX(-50%);
653
+ transform: translateX(-50%);
654
+ }
639
655
  .is-horizontal .arco-slider-thumb-wrapper.is-start {
640
656
  left: 0;
641
657
  -webkit-transform: translateX(-50%);
642
658
  transform: translateX(-50%);
643
659
  }
660
+ [dir="rtl"] .is-horizontal .arco-slider-thumb-wrapper.is-start {
661
+ left: initial;
662
+ right: 0;
663
+ }
664
+ [dir="rtl"] .is-horizontal .arco-slider-thumb-wrapper.is-start {
665
+ -webkit-transform: translateX(50%);
666
+ transform: translateX(50%);
667
+ }
644
668
  .arco-slider-popover-wrapper .arco-slider-thumb {
645
669
  position: relative;
646
670
  }
@@ -739,6 +763,10 @@
739
763
  -webkit-transform: translateX(-50%);
740
764
  transform: translateX(-50%);
741
765
  }
766
+ [dir="rtl"] .arco-slider-marks-item {
767
+ -webkit-transform: translateX(50%);
768
+ transform: translateX(50%);
769
+ }
742
770
  .arco-slider-marks-item.is-activated {
743
771
  background: #165DFF ;
744
772
  }
@@ -31,7 +31,7 @@
31
31
  .use-var(color, slider-text-color);
32
32
 
33
33
  .is-horizontal & {
34
- .use-var(margin-right, slider-label-gutter);
34
+ .use-var-with-rtl(margin-right, slider-label-gutter);
35
35
  }
36
36
 
37
37
  .is-vertical & {
@@ -44,7 +44,7 @@
44
44
 
45
45
  .is-horizontal & {
46
46
  margin-right: 0;
47
- .use-var(margin-left, slider-label-gutter);
47
+ .use-var-with-rtl(margin-left, slider-label-gutter);
48
48
  }
49
49
 
50
50
  .is-vertical & {
@@ -124,13 +124,19 @@
124
124
  bottom: 0;
125
125
 
126
126
  &.is-end {
127
- right: 0;
127
+ .set-prop-with-rtl(right, 0);
128
128
  transform: translateX(50%);
129
+ [dir="rtl"] & {
130
+ transform: translateX(-50%);
131
+ }
129
132
  }
130
133
 
131
134
  &.is-start {
132
- left: 0;
135
+ .set-prop-with-rtl(left, 0);
133
136
  transform: translateX(-50%);
137
+ [dir="rtl"] & {
138
+ transform: translateX(50%);
139
+ }
134
140
  }
135
141
  }
136
142
  }
@@ -236,6 +242,9 @@
236
242
  .use-var(border-radius, slider-mark-border-radius);
237
243
  .use-var(background, slider-line-color);
238
244
  transform: translateX(-50%);
245
+ [dir="rtl"] & {
246
+ transform: translateX(50%);
247
+ }
239
248
 
240
249
  &.is-activated {
241
250
  .use-var(background, slider-line-activated-color);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arco-design/mobile-react",
3
- "version": "2.30.2",
3
+ "version": "2.30.3",
4
4
  "description": "",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -15,7 +15,7 @@
15
15
  "author": "taoyiyue@bytedance.com",
16
16
  "license": "ISC",
17
17
  "dependencies": {
18
- "@arco-design/mobile-utils": "2.17.2",
18
+ "@arco-design/mobile-utils": "2.17.3",
19
19
  "@arco-design/transformable": "^1.0.0",
20
20
  "lodash.throttle": "^4.1.1",
21
21
  "resize-observer-polyfill": "^1.5.1"
@@ -49,5 +49,5 @@
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "gitHead": "41b5f19cac228f71b84b7a5df4dcdbd6262e2c46"
52
+ "gitHead": "3d93718fb907f11e31056284bbf7c03aee981fe4"
53
53
  }
@@ -466,7 +466,7 @@
466
466
  --popover-icon-divider-height: ~`pxtorem(12)`;
467
467
  --popover-icon-size: ~`pxtorem(16)`;
468
468
  --popover-icon-padding: ~`pxtorem(0)` ~`pxtorem(10)` ~`pxtorem(0)` ~`pxtorem(11)`;
469
- --popover-text-suffix-padding: ~`pxtorem(0)` ~`pxtorem(12)` ~`pxtorem(0)` ~`pxtorem(0)`;
469
+ --popover-text-suffix-edge: ~`pxtorem(12)`;
470
470
  --popover-mask-background: var(--mask-background);
471
471
  --load-more-font-size: ~`pxtorem(14)`;
472
472
  --dark-load-more-text-color: var(--dark-sub-info-font-color);
@@ -465,7 +465,7 @@ export interface ArcodesignToken extends Record<string, string> {
465
465
  'popover-icon-divider-height': string;
466
466
  'popover-icon-size': string;
467
467
  'popover-icon-padding': string;
468
- 'popover-text-suffix-padding': string;
468
+ 'popover-text-suffix-edge': string;
469
469
  'popover-mask-background': string;
470
470
  'load-more-font-size': string;
471
471
  'dark-load-more-text-color': string;
@@ -477,7 +477,7 @@ var tokens = {
477
477
  "popover-icon-divider-height": "0.24rem",
478
478
  "popover-icon-size": "0.32rem",
479
479
  "popover-icon-padding": "0 0.2rem 0 0.22rem",
480
- "popover-text-suffix-padding": "0 0.24rem 0 0",
480
+ "popover-text-suffix-edge": "0.24rem",
481
481
  "popover-mask-background": "var(--mask-background)",
482
482
  "load-more-font-size": "0.28rem",
483
483
  "dark-load-more-text-color": "var(--dark-sub-info-font-color)",
@@ -7921,15 +7921,15 @@
7921
7921
  "en": "Popover shadow color"
7922
7922
  }
7923
7923
  },
7924
- "popoverTextSuffixPadding": {
7925
- "cssKey": "popover-text-suffix-padding",
7926
- "desc": "textSuffix 元素 padding",
7924
+ "popoverTextSuffixEdge": {
7925
+ "cssKey": "popover-text-suffix-edge",
7926
+ "desc": "textSuffix 元素和气泡边缘的距离",
7927
7927
  "override": "",
7928
- "value": "~`pxtorem(0)` ~`pxtorem(12)` ~`pxtorem(0)` ~`pxtorem(0)`",
7929
- "jsValue": "@getRem@0 @getRem@12 @getRem@0 @getRem@0",
7930
- "staticValue": "0 0.24rem 0 0",
7928
+ "value": "~`pxtorem(12)`",
7929
+ "jsValue": "@getRem@12",
7930
+ "staticValue": "0.24rem",
7931
7931
  "localeDesc": {
7932
- "ch": "textSuffix 元素 padding",
7932
+ "ch": "textSuffix 元素和气泡边缘的距离",
7933
7933
  "en": "Popover textSuffix element padding"
7934
7934
  }
7935
7935
  },
@@ -465,7 +465,7 @@
465
465
  @popover-icon-divider-height: ~`pxtorem(12)`;
466
466
  @popover-icon-size: ~`pxtorem(16)`;
467
467
  @popover-icon-padding: ~`pxtorem(0)` ~`pxtorem(10)` ~`pxtorem(0)` ~`pxtorem(11)`;
468
- @popover-text-suffix-padding: ~`pxtorem(0)` ~`pxtorem(12)` ~`pxtorem(0)` ~`pxtorem(0)`;
468
+ @popover-text-suffix-edge: ~`pxtorem(12)`;
469
469
  @popover-mask-background: @mask-background;
470
470
  @load-more-font-size: ~`pxtorem(14)`;
471
471
  @dark-load-more-text-color: @dark-sub-info-font-color;
@@ -99,7 +99,7 @@ export interface IFormDataMethods {
99
99
  * 注册表单项
100
100
  * @en Register field
101
101
  */
102
- registerField: (name: string, self: ReactNode) => () => void;
102
+ registerField: (name: string, self: any) => () => void;
103
103
  }
104
104
  export declare enum ValidateStatus {
105
105
  Init = "init",
@@ -130,7 +130,7 @@ export interface InternalHooks {
130
130
  * 注册表单项
131
131
  * @en Register field
132
132
  */
133
- registerField: (name: string, self: ReactNode) => () => void;
133
+ registerField: (name: string, self: any) => () => void;
134
134
  setInitialValues: (values: FieldItem) => void;
135
135
  setCallbacks: (callbacks: Callbacks) => void;
136
136
  }
@@ -18,6 +18,12 @@ export interface PreviewImageProps {
18
18
  * @en Transition image url
19
19
  */
20
20
  fallbackSrc?: string;
21
+ /**
22
+ * 过渡图到原图放大动效完成后,移除过渡图的延迟时间(ms),一般当原图过大时有调整需求
23
+ * @en After the transition image to the original image enlargement effect is completed, the delay time (ms) before the transition image is removed
24
+ * @default 30
25
+ */
26
+ transitionEndDelay?: number;
21
27
  /**
22
28
  * 缩略图填充方式(backgroundPosition),默认top center
23
29
  * @en Thumbnail fill mode (backgroundPosition), default value is top center