@arco-design/mobile-react 2.32.0 → 2.34.0

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 (60) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/hooks.js +2 -0
  5. package/cjs/avatar/index.js +3 -1
  6. package/cjs/avatar/type.d.ts +6 -0
  7. package/cjs/carousel/index.js +18 -1
  8. package/cjs/divider/style/css/index.css +6 -4
  9. package/cjs/divider/style/index.less +3 -1
  10. package/cjs/notice-bar/index.js +11 -8
  11. package/cjs/popover/popover-inner.js +9 -2
  12. package/cjs/steps/index.d.ts +1 -1
  13. package/cjs/steps/index.js +6 -1
  14. package/cjs/steps/style/css/index.css +42 -4
  15. package/cjs/steps/style/index.less +58 -6
  16. package/cjs/steps/type.d.ts +5 -0
  17. package/dist/index.js +77 -41
  18. package/dist/index.min.js +2 -2
  19. package/dist/style.css +32 -7
  20. package/dist/style.min.css +1 -1
  21. package/esm/_helpers/hooks.js +2 -0
  22. package/esm/avatar/index.js +3 -1
  23. package/esm/avatar/type.d.ts +6 -0
  24. package/esm/carousel/index.js +18 -1
  25. package/esm/divider/style/css/index.css +6 -4
  26. package/esm/divider/style/index.less +3 -1
  27. package/esm/notice-bar/index.js +12 -9
  28. package/esm/popover/popover-inner.js +9 -2
  29. package/esm/steps/index.d.ts +1 -1
  30. package/esm/steps/index.js +7 -2
  31. package/esm/steps/style/css/index.css +42 -4
  32. package/esm/steps/style/index.less +58 -6
  33. package/esm/steps/type.d.ts +5 -0
  34. package/esnext/_helpers/hooks.js +6 -2
  35. package/esnext/avatar/index.js +2 -2
  36. package/esnext/avatar/type.d.ts +6 -0
  37. package/esnext/carousel/index.js +13 -4
  38. package/esnext/divider/style/css/index.css +6 -4
  39. package/esnext/divider/style/index.less +3 -1
  40. package/esnext/notice-bar/index.js +6 -6
  41. package/esnext/popover/popover-inner.js +7 -2
  42. package/esnext/steps/index.d.ts +1 -1
  43. package/esnext/steps/index.js +6 -3
  44. package/esnext/steps/style/css/index.css +42 -4
  45. package/esnext/steps/style/index.less +58 -6
  46. package/esnext/steps/type.d.ts +5 -0
  47. package/package.json +3 -3
  48. package/umd/_helpers/hooks.js +2 -0
  49. package/umd/avatar/index.js +3 -1
  50. package/umd/avatar/type.d.ts +6 -0
  51. package/umd/carousel/index.js +18 -1
  52. package/umd/divider/style/css/index.css +6 -4
  53. package/umd/divider/style/index.less +3 -1
  54. package/umd/notice-bar/index.js +11 -8
  55. package/umd/popover/popover-inner.js +9 -2
  56. package/umd/steps/index.d.ts +1 -1
  57. package/umd/steps/index.js +6 -1
  58. package/umd/steps/style/css/index.css +42 -4
  59. package/umd/steps/style/index.less +58 -6
  60. package/umd/steps/type.d.ts +5 -0
@@ -42,6 +42,12 @@ export interface AvatarProps<T extends ImageProps = ImageProps> extends BaseProp
42
42
  * @default {}
43
43
  */
44
44
  avatarStyle?: React.CSSProperties;
45
+ /**
46
+ * 头像元素的自定义类名
47
+ * @en Custom classname for avatar element
48
+ * @default ""
49
+ */
50
+ avatarClass?: string;
45
51
  /**
46
52
  * 是否自动根据头像尺寸调整字体大小
47
53
  * @en Whether to automatically adjust the font size according to the avatar size
@@ -228,6 +228,12 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
228
228
 
229
229
  if (posAdjustingRef.current) {
230
230
  return;
231
+ } // touchMove触发时,阻止handleTouchStart多次执行(如点击事件)
232
+ // @en When touchMove is triggered, prevent handleTouchStart from executing multiple times (such as click events)
233
+
234
+
235
+ if (touchStartedRef.current && touchMovedRef.current) {
236
+ return;
231
237
  }
232
238
 
233
239
  touchStartedRef.current = true;
@@ -684,12 +690,23 @@ var Carousel = /*#__PURE__*/forwardRef(function (props, ref) {
684
690
  return;
685
691
  }
686
692
 
687
- if (!touchStartedRef.current || !touchMovedRef.current || posAdjustingRef.current || touchStoppedRef.current) {
693
+ if (!touchStartedRef.current) {
688
694
  return;
689
695
  }
690
696
 
691
697
  touchStartedRef.current = false;
698
+
699
+ if (!touchMovedRef.current) {
700
+ setPlayIntervalRef.current();
701
+ return;
702
+ }
703
+
692
704
  touchMovedRef.current = false;
705
+
706
+ if (posAdjustingRef.current || touchStoppedRef.current) {
707
+ return;
708
+ }
709
+
693
710
  var touchEndTime = new Date().getTime();
694
711
  var dis = Math.abs(distance);
695
712
  var speed = dis / (touchEndTime - touchStartTimeRef.current) * 1000;
@@ -542,10 +542,12 @@
542
542
  .arco-divider::before {
543
543
  content: '';
544
544
  }
545
- .arco-divider--hairline::before,
546
- .arco-divider--hairline::after {
547
- -webkit-transform: scaleY(0.5);
548
- transform: scaleY(0.5);
545
+ @media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
546
+ .arco-divider--hairline::before,
547
+ .arco-divider--hairline::after {
548
+ -webkit-transform: scaleY(0.5);
549
+ transform: scaleY(0.5);
550
+ }
549
551
  }
550
552
  @media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
551
553
  .arco-divider--hairline::before,
@@ -27,7 +27,9 @@
27
27
  &--hairline {
28
28
  &::before,
29
29
  &::after {
30
- transform: scaleY(0.5);
30
+ @media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
31
+ transform: scaleY(0.5);
32
+ }
31
33
 
32
34
  @media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
33
35
  transform: scaleY(0.33333333);
@@ -1,4 +1,4 @@
1
- import { cls, removeElement, fadeColor, nextTick } from '@arco-design/mobile-utils';
1
+ import { cls, fadeColor, nextTick } from '@arco-design/mobile-utils';
2
2
  import React, { useRef, forwardRef, useImperativeHandle, useState, useEffect, useMemo, useContext } from 'react';
3
3
  import { ContextLayout, GlobalContext } from '../context-provider';
4
4
  import IconClose from '../icon/IconClose';
@@ -43,9 +43,13 @@ var NoticeBar = /*#__PURE__*/forwardRef(function (props, ref) {
43
43
  var contentRef = useRef(null);
44
44
  var timerRef = useRef(null);
45
45
 
46
- var _useState = useState(false),
47
- needMarquee = _useState[0],
48
- setNeedMarquee = _useState[1];
46
+ var _useState = useState(true),
47
+ visible = _useState[0],
48
+ setVisible = _useState[1];
49
+
50
+ var _useState2 = useState(false),
51
+ needMarquee = _useState2[0],
52
+ setNeedMarquee = _useState2[1];
49
53
 
50
54
  var extraClass = useMemo(function () {
51
55
  var classList = []; // 字幕可滚动时,或不可滚动且不可以换行时,添加不换行效果
@@ -86,9 +90,8 @@ var NoticeBar = /*#__PURE__*/forwardRef(function (props, ref) {
86
90
  }, [useRtl]);
87
91
 
88
92
  function close() {
89
- if (domRef.current) {
90
- removeElement(domRef.current);
91
- }
93
+ setVisible(false);
94
+ clear();
92
95
  }
93
96
 
94
97
  function handleClose(e) {
@@ -153,7 +156,7 @@ var NoticeBar = /*#__PURE__*/forwardRef(function (props, ref) {
153
156
  }
154
157
 
155
158
  function renderNoticeBar(prefix) {
156
- return /*#__PURE__*/React.createElement("div", {
159
+ return visible ? /*#__PURE__*/React.createElement("div", {
157
160
  className: cls(prefix, className, extraClass),
158
161
  style: style,
159
162
  ref: domRef,
@@ -179,7 +182,7 @@ var NoticeBar = /*#__PURE__*/forwardRef(function (props, ref) {
179
182
  }, rightContent) : null, closeable ? /*#__PURE__*/React.createElement("div", {
180
183
  className: prefix + "-close",
181
184
  onClick: handleClose
182
- }, closeIcon) : null);
185
+ }, closeIcon) : null) : null;
183
186
  }
184
187
 
185
188
  return /*#__PURE__*/React.createElement(ContextLayout, null, function (_ref) {
@@ -47,7 +47,15 @@ export var PopoverInner = /*#__PURE__*/forwardRef(function (props, ref) {
47
47
  if (left || width || top || height || bottom) {
48
48
  if (!show) {
49
49
  setTimeout(function () {
50
- setShow(true);
50
+ setShow(function () {
51
+ var _domRef$current;
52
+
53
+ // bugfix:
54
+ // 外层CSSTransition使用dom API而非通过react className属性修改class
55
+ // 如果内部通过react className属性动态修改class会覆盖CSSTransition的设置,导致CSSTransition enter相关的class无法应用到组件
56
+ (_domRef$current = domRef.current) == null ? void 0 : _domRef$current.classList.add('show');
57
+ return true;
58
+ });
51
59
  }, 0);
52
60
  }
53
61
  }
@@ -99,7 +107,6 @@ export var PopoverInner = /*#__PURE__*/forwardRef(function (props, ref) {
99
107
  return /*#__PURE__*/React.createElement("div", {
100
108
  ref: domRef,
101
109
  className: cls(prefixCls + "-popover-inner", 'popover-inner', 'all-border-box', mode + "-mode", className, {
102
- show: show,
103
110
  'with-shadow': needShadow,
104
111
  'with-suffix': showCloseIcon || textSuffix,
105
112
  'custom-content': typeof content !== 'string'
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { StepsProps, StepsRef } from './type';
3
3
  export * from './type';
4
- export declare const StepsContext: React.Context<Pick<StepsProps, "direction" | "status" | "align" | "iconType" | "current"> & {
4
+ export declare const StepsContext: React.Context<Pick<StepsProps, "direction" | "status" | "align" | "iconType" | "current" | "reverseOrder"> & {
5
5
  index?: number | undefined;
6
6
  changeIndex: (newIndex: number) => void;
7
7
  }>;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useRef, forwardRef, useImperativeHandle, Children, createContext, useCallback, useState, useEffect } from 'react';
3
- import { componentWrapper } from '@arco-design/mobile-utils';
3
+ import { cls, componentWrapper } from '@arco-design/mobile-utils';
4
4
  import { ContextLayout } from '../context-provider';
5
5
  import Step from './step';
6
6
  import { useSystem, useRefState } from '../_helpers';
@@ -24,6 +24,8 @@ var Steps = /*#__PURE__*/forwardRef(function (props, ref) {
24
24
  _props$status = props.status,
25
25
  status = _props$status === void 0 ? 'process' : _props$status,
26
26
  items = props.items,
27
+ _props$reverseOrder = props.reverseOrder,
28
+ reverseOrder = _props$reverseOrder === void 0 ? false : _props$reverseOrder,
27
29
  onClick = props.onClick,
28
30
  onChange = props.onChange;
29
31
  var defaultAlign = direction === 'vertical' ? 'start' : 'center';
@@ -64,6 +66,7 @@ var Steps = /*#__PURE__*/forwardRef(function (props, ref) {
64
66
  index: index,
65
67
  status: activeIndex === index ? status : void 0,
66
68
  align: align,
69
+ reverseOrder: reverseOrder,
67
70
  changeIndex: changeIndex
68
71
  },
69
72
  key: index
@@ -72,7 +75,9 @@ var Steps = /*#__PURE__*/forwardRef(function (props, ref) {
72
75
  return /*#__PURE__*/React.createElement(ContextLayout, null, function (_ref) {
73
76
  var prefixCls = _ref.prefixCls;
74
77
  return /*#__PURE__*/React.createElement("div", {
75
- className: prefixCls + "-steps all-border-box " + className + " " + direction + " " + system,
78
+ className: cls(prefixCls + "-steps all-border-box " + className + " " + direction + " " + system, {
79
+ 'reverse-order': reverseOrder
80
+ }),
76
81
  style: style,
77
82
  ref: domRef
78
83
  }, items ? items.map(function (item, index) {
@@ -516,6 +516,12 @@
516
516
  display: flex;
517
517
  padding: 0.32rem 0 ;
518
518
  }
519
+ .arco-steps.reverse-order {
520
+ -webkit-box-orient: horizontal;
521
+ -webkit-box-direction: reverse;
522
+ -webkit-flex-direction: row-reverse;
523
+ flex-direction: row-reverse;
524
+ }
519
525
  .arco-steps-item {
520
526
  position: relative;
521
527
  display: -webkit-box;
@@ -548,6 +554,14 @@
548
554
  .arco-steps-item:last-child .arco-steps-item-tail::after {
549
555
  visibility: hidden;
550
556
  }
557
+ .reverse-order .arco-steps-item:first-child .arco-steps-item-tail::after,
558
+ .reverse-order .arco-steps-item:last-child .arco-steps-item-tail::before {
559
+ visibility: hidden;
560
+ }
561
+ .reverse-order .arco-steps-item:first-child .arco-steps-item-tail::before,
562
+ .reverse-order .arco-steps-item:last-child .arco-steps-item-tail::after {
563
+ visibility: visible;
564
+ }
551
565
  .arco-steps-item-tail {
552
566
  position: absolute;
553
567
  display: -webkit-box;
@@ -577,13 +591,13 @@
577
591
  right: 9PX ;
578
592
  }
579
593
  .horizontal .arco-steps-item-tail-align-start::after {
580
- content: "";
594
+ content: '';
581
595
  width: 100%;
582
596
  border-radius: 2PX ;
583
597
  }
584
598
  .horizontal .arco-steps-item-tail-align-center::before,
585
599
  .horizontal .arco-steps-item-tail-align-center::after {
586
- content: "";
600
+ content: '';
587
601
  width: 50%;
588
602
  }
589
603
  .horizontal .arco-steps-item-tail-align-center::before {
@@ -637,13 +651,13 @@
637
651
  padding: 14PX 0 ;
638
652
  }
639
653
  .vertical .arco-steps-item-tail-align-start::after {
640
- content: "";
654
+ content: '';
641
655
  height: 100%;
642
656
  border-radius: 2PX ;
643
657
  }
644
658
  .vertical .arco-steps-item-tail-align-center::before,
645
659
  .vertical .arco-steps-item-tail-align-center::after {
646
- content: "";
660
+ content: '';
647
661
  height: 50%;
648
662
  }
649
663
  .vertical .arco-steps-item-tail-align-center::before {
@@ -667,6 +681,15 @@
667
681
  .arco-steps-item-tail-align-center.arco-steps-item-tail-status-error::before {
668
682
  background: #165DFF ;
669
683
  }
684
+ .reverse-order .arco-steps-item-tail-status-finish::before,
685
+ .reverse-order .arco-steps-item-tail-status-process::after,
686
+ .reverse-order .arco-steps-item-tail-align-center.arco-steps-item-tail-status-error::after {
687
+ background: #165DFF ;
688
+ }
689
+ .reverse-order .arco-steps-item-tail-status-process::before,
690
+ .reverse-order .arco-steps-item-tail-align-center.arco-steps-item-tail-status-error::before {
691
+ background: #e5e6eb ;
692
+ }
670
693
  .arco-steps-item-custom-icon,
671
694
  .arco-steps-item-icon {
672
695
  display: -webkit-inline-box;
@@ -796,6 +819,12 @@
796
819
  padding-bottom: 0 ;
797
820
  padding-left: 0.4rem ;
798
821
  }
822
+ .arco-steps.vertical.reverse-order {
823
+ -webkit-box-orient: vertical;
824
+ -webkit-box-direction: reverse;
825
+ -webkit-flex-direction: column-reverse;
826
+ flex-direction: column-reverse;
827
+ }
799
828
  [dir="rtl"] .arco-steps.vertical {
800
829
  padding-left: initial;
801
830
  padding-right: 0.4rem ;
@@ -823,6 +852,15 @@
823
852
  .arco-theme-dark .arco-steps-item-tail-align-center.arco-steps-item-tail-status-error::before {
824
853
  background: #3C7EFF ;
825
854
  }
855
+ .arco-theme-dark .reverse-order .arco-steps-item-tail-status-finish::before,
856
+ .arco-theme-dark .reverse-order .arco-steps-item-tail-status-process::after,
857
+ .arco-theme-dark .reverse-order .arco-steps-item-tail-align-center.arco-steps-item-tail-status-error::after {
858
+ background: #3C7EFF ;
859
+ }
860
+ .arco-theme-dark .reverse-order .arco-steps-item-tail-status-process::before,
861
+ .arco-theme-dark .reverse-order .arco-steps-item-tail-align-center.arco-steps-item-tail-status-error::before {
862
+ background: #484849 ;
863
+ }
826
864
  .arco-theme-dark .number.finish .arco-steps-item-icon {
827
865
  background: #000D4D ;
828
866
  }
@@ -1,9 +1,13 @@
1
- @import "../../../style/mixin.less";
1
+ @import '../../../style/mixin.less';
2
2
 
3
3
  .@{prefix}-steps {
4
4
  display: flex;
5
5
  .use-var(padding, steps-padding);
6
6
 
7
+ &.reverse-order {
8
+ flex-direction: row-reverse;
9
+ }
10
+
7
11
  &-item {
8
12
  position: relative;
9
13
  display: flex;
@@ -30,6 +34,20 @@
30
34
  visibility: hidden;
31
35
  }
32
36
 
37
+ &:first-child &-tail::after,
38
+ &:last-child &-tail::before {
39
+ .reverse-order & {
40
+ visibility: hidden;
41
+ }
42
+ }
43
+
44
+ &:first-child &-tail::before,
45
+ &:last-child &-tail::after {
46
+ .reverse-order & {
47
+ visibility: visible;
48
+ }
49
+ }
50
+
33
51
  &-tail {
34
52
  position: absolute;
35
53
  display: flex;
@@ -50,7 +68,7 @@
50
68
  .use-var(padding, steps-tail-horizontal-padding);
51
69
 
52
70
  &::after {
53
- content: "";
71
+ content: '';
54
72
  width: 100%;
55
73
  .use-var(border-radius, steps-tail-border-radius);
56
74
  }
@@ -59,7 +77,7 @@
59
77
  &-align-center {
60
78
  &::before,
61
79
  &::after {
62
- content: "";
80
+ content: '';
63
81
  width: 50%;
64
82
  }
65
83
  &::before {
@@ -90,7 +108,7 @@
90
108
  .use-var(padding, steps-tail-vertical-padding);
91
109
 
92
110
  &::after {
93
- content: "";
111
+ content: '';
94
112
  height: 100%;
95
113
  .use-var(border-radius, steps-tail-border-radius);
96
114
  }
@@ -99,7 +117,7 @@
99
117
  &-align-center {
100
118
  &::before,
101
119
  &::after {
102
- content: "";
120
+ content: '';
103
121
  height: 50%;
104
122
  }
105
123
  &::before {
@@ -127,6 +145,20 @@
127
145
  &-align-center&-status-error::before {
128
146
  .use-var(background, steps-tail-finish-background);
129
147
  }
148
+
149
+ &-status-finish::before,
150
+ &-status-process::after,
151
+ &-align-center&-status-error::after {
152
+ .reverse-order & {
153
+ .use-var(background, steps-tail-finish-background);
154
+ }
155
+ }
156
+ &-status-process::before,
157
+ &-align-center&-status-error::before {
158
+ .reverse-order & {
159
+ .use-var(background, steps-tail-standard-background);
160
+ }
161
+ }
130
162
  }
131
163
 
132
164
  &-custom-icon,
@@ -206,7 +238,6 @@
206
238
  }
207
239
 
208
240
  &-content {
209
-
210
241
  .horizontal & {
211
242
  .use-var(margin-top, steps-horizontal-content-margin-top);
212
243
  &-align-center {
@@ -262,6 +293,10 @@
262
293
  }
263
294
 
264
295
  &.vertical {
296
+ &.reverse-order {
297
+ flex-direction: column-reverse;
298
+ }
299
+
265
300
  flex-direction: column;
266
301
  .use-var(padding-bottom, steps-vertical-padding-bottom);
267
302
  .use-var-with-rtl(padding-left, steps-vertical-padding-left);
@@ -307,6 +342,23 @@
307
342
  .use-var(background, dark-steps-tail-finish-background);
308
343
  }
309
344
  }
345
+ &-status-finish::before,
346
+ &-status-process::after,
347
+ &-align-center&-status-error::after {
348
+ .reverse-order & {
349
+ @{arco-dark-mode-selector} & {
350
+ .use-var(background, dark-steps-tail-finish-background);
351
+ }
352
+ }
353
+ }
354
+ &-status-process::before,
355
+ &-align-center&-status-error::before {
356
+ .reverse-order & {
357
+ @{arco-dark-mode-selector} & {
358
+ .use-var(background, dark-steps-tail-standard-background);
359
+ }
360
+ }
361
+ }
310
362
  }
311
363
  &-icon {
312
364
  .number.finish & {
@@ -32,6 +32,11 @@ export interface StepsProps {
32
32
  * @en Custom classname
33
33
  */
34
34
  className?: string;
35
+ /**
36
+ * 顺序反转,设置为true后,顺序将从右到左,从下到上
37
+ * @en reverse the order from right to left and from bottom to top
38
+ */
39
+ reverseOrder?: boolean;
35
40
  /**
36
41
  * 自定义样式,如果想用 css 控制 icon 颜色,可使用公共 mixin '.set-steps-color(@color)'
37
42
  * @en Custom stylesheet. If want to use CSS to control icon color, use public mixin '.set-steps-color(@color)'
@@ -60,8 +60,12 @@ export function useMountedState(initialState) {
60
60
  }
61
61
  setState(value);
62
62
  }, []);
63
- useEffect(() => () => {
64
- leavingRef.current = true;
63
+ useEffect(() => {
64
+ // see: https://github.com/arco-design/arco-design-mobile/pull/292
65
+ leavingRef.current = false;
66
+ return () => {
67
+ leavingRef.current = true;
68
+ };
65
69
  }, []);
66
70
  const result = [state, setValidState];
67
71
  return result;
@@ -9,7 +9,7 @@ export function componentGenerator(Comp) {
9
9
  return forwardRef((props, ref) => {
10
10
  const { prefixCls } = useContext(GlobalContext);
11
11
  const { shape: groupShape, size: groupSize, isGroup } = useContext(AvatarGroupContext);
12
- const { shape = props.shape || (isGroup ? groupShape : 'circle'), size = props.size || (isGroup ? groupSize : 'small'), src, decoration = null, textAvatar = '', avatarStyle = {}, autoFixFontSize = true, autoFixFontOffset = 2, avatarName = '', avatarDesc = '', children = null, renderInfo = null, className = '', style = {}, imageProps = {}, defaultOverLap, onClickDecoration, onClick, } = props;
12
+ const { shape = props.shape || (isGroup ? groupShape : 'circle'), size = props.size || (isGroup ? groupSize : 'small'), src, decoration = null, textAvatar = '', avatarStyle = {}, avatarClass = '', autoFixFontSize = true, autoFixFontOffset = 2, avatarName = '', avatarDesc = '', children = null, renderInfo = null, className = '', style = {}, imageProps = {}, defaultOverLap, onClickDecoration, onClick, } = props;
13
13
  const domRef = useRef(null);
14
14
  const avatarRef = useRef(null);
15
15
  const avatarTextRef = useRef(null);
@@ -51,7 +51,7 @@ export function componentGenerator(Comp) {
51
51
  return (React.createElement("div", { ref: domRef, style: style, className: cls(`${prefixCls}-avatar-wrapper`, className, size, shape, `${prefixCls}-avatar-wrapper-shape-${shape}`, {
52
52
  [`${prefixCls}-avatar-wrapper-with-info ${prefixCls}-avatar-wrapper-with-info-size-${size} with-info`]: Boolean(avatarName),
53
53
  }), onClick: onClick },
54
- React.createElement("div", { className: cls(`${prefixCls}-avatar`, `${prefixCls}-avatar-size-${size}`, size, `${prefixCls}-avatar-shape-${shape}`, shape, {
54
+ React.createElement("div", { className: cls(`${prefixCls}-avatar`, avatarClass, `${prefixCls}-avatar-size-${size}`, size, `${prefixCls}-avatar-shape-${shape}`, shape, {
55
55
  [`${prefixCls}-text-avatar ${prefixCls}-avatar-mode-text`]: isTextAvatar,
56
56
  [`${prefixCls}-image-avatar ${prefixCls}-avatar-mode-image`]: isImageAvatar,
57
57
  [`${prefixCls}-avatar-default-overlap default-overlap`]: useDefaultAvatar,
@@ -42,6 +42,12 @@ export interface AvatarProps<T extends ImageProps = ImageProps> extends BaseProp
42
42
  * @default {}
43
43
  */
44
44
  avatarStyle?: React.CSSProperties;
45
+ /**
46
+ * 头像元素的自定义类名
47
+ * @en Custom classname for avatar element
48
+ * @default ""
49
+ */
50
+ avatarClass?: string;
45
51
  /**
46
52
  * 是否自动根据头像尺寸调整字体大小
47
53
  * @en Whether to automatically adjust the font size according to the avatar size
@@ -94,6 +94,11 @@ const Carousel = forwardRef((props, ref) => {
94
94
  if (posAdjustingRef.current) {
95
95
  return;
96
96
  }
97
+ // touchMove触发时,阻止handleTouchStart多次执行(如点击事件)
98
+ // @en When touchMove is triggered, prevent handleTouchStart from executing multiple times (such as click events)
99
+ if (touchStartedRef.current && touchMovedRef.current) {
100
+ return;
101
+ }
97
102
  touchStartedRef.current = true;
98
103
  touchMovedRef.current = false;
99
104
  clear();
@@ -507,14 +512,18 @@ const Carousel = forwardRef((props, ref) => {
507
512
  jumpTo(index, false);
508
513
  return;
509
514
  }
510
- if (!touchStartedRef.current ||
511
- !touchMovedRef.current ||
512
- posAdjustingRef.current ||
513
- touchStoppedRef.current) {
515
+ if (!touchStartedRef.current) {
514
516
  return;
515
517
  }
516
518
  touchStartedRef.current = false;
519
+ if (!touchMovedRef.current) {
520
+ setPlayIntervalRef.current();
521
+ return;
522
+ }
517
523
  touchMovedRef.current = false;
524
+ if (posAdjustingRef.current || touchStoppedRef.current) {
525
+ return;
526
+ }
518
527
  const touchEndTime = new Date().getTime();
519
528
  const dis = Math.abs(distance);
520
529
  const speed = (dis / (touchEndTime - touchStartTimeRef.current)) * 1000;
@@ -542,10 +542,12 @@
542
542
  .arco-divider::before {
543
543
  content: '';
544
544
  }
545
- .arco-divider--hairline::before,
546
- .arco-divider--hairline::after {
547
- -webkit-transform: scaleY(0.5);
548
- transform: scaleY(0.5);
545
+ @media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
546
+ .arco-divider--hairline::before,
547
+ .arco-divider--hairline::after {
548
+ -webkit-transform: scaleY(0.5);
549
+ transform: scaleY(0.5);
550
+ }
549
551
  }
550
552
  @media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
551
553
  .arco-divider--hairline::before,
@@ -27,7 +27,9 @@
27
27
  &--hairline {
28
28
  &::before,
29
29
  &::after {
30
- transform: scaleY(0.5);
30
+ @media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
31
+ transform: scaleY(0.5);
32
+ }
31
33
 
32
34
  @media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
33
35
  transform: scaleY(0.33333333);
@@ -1,4 +1,4 @@
1
- import { cls, removeElement, fadeColor, nextTick } from '@arco-design/mobile-utils';
1
+ import { cls, fadeColor, nextTick } from '@arco-design/mobile-utils';
2
2
  import React, { useRef, forwardRef, useImperativeHandle, useState, useEffect, useMemo, useContext, } from 'react';
3
3
  import { ContextLayout, GlobalContext } from '../context-provider';
4
4
  import IconClose from '../icon/IconClose';
@@ -17,6 +17,7 @@ const NoticeBar = forwardRef((props, ref) => {
17
17
  const wrapRef = useRef(null);
18
18
  const contentRef = useRef(null);
19
19
  const timerRef = useRef(null);
20
+ const [visible, setVisible] = useState(true);
20
21
  const [needMarquee, setNeedMarquee] = useState(false);
21
22
  const extraClass = useMemo(() => {
22
23
  const classList = [];
@@ -53,9 +54,8 @@ const NoticeBar = forwardRef((props, ref) => {
53
54
  updateData();
54
55
  }, [useRtl]);
55
56
  function close() {
56
- if (domRef.current) {
57
- removeElement(domRef.current);
58
- }
57
+ setVisible(false);
58
+ clear();
59
59
  }
60
60
  function handleClose(e) {
61
61
  e.stopPropagation();
@@ -112,14 +112,14 @@ const NoticeBar = forwardRef((props, ref) => {
112
112
  }
113
113
  }
114
114
  function renderNoticeBar(prefix) {
115
- return (React.createElement("div", { className: cls(prefix, className, extraClass), style: style, ref: domRef, onClick: onClick },
115
+ return visible ? (React.createElement("div", { className: cls(prefix, className, extraClass), style: style, ref: domRef, onClick: onClick },
116
116
  leftContent ? React.createElement("div", { className: `${prefix}-left-part` }, leftContent) : null,
117
117
  React.createElement("div", { className: `${prefix}-content`, ref: wrapRef },
118
118
  needMarquee ? (React.createElement("i", { className: `${prefix}-gradient left`, style: gradientStyle })) : null,
119
119
  React.createElement("div", { className: cls(`${prefix}-content-inner`, { animate: needMarquee }), ref: contentRef }, children),
120
120
  needMarquee ? (React.createElement("i", { className: `${prefix}-gradient right`, style: gradientStyle })) : null),
121
121
  rightContent ? React.createElement("div", { className: `${prefix}-right-part` }, rightContent) : null,
122
- closeable ? (React.createElement("div", { className: `${prefix}-close`, onClick: handleClose }, closeIcon)) : null));
122
+ closeable ? (React.createElement("div", { className: `${prefix}-close`, onClick: handleClose }, closeIcon)) : null)) : null;
123
123
  }
124
124
  return (React.createElement(ContextLayout, null, ({ prefixCls }) => renderNoticeBar(`${prefixCls}-notice-bar`)));
125
125
  });
@@ -18,7 +18,13 @@ export const PopoverInner = forwardRef((props, ref) => {
18
18
  if (left || width || top || height || bottom) {
19
19
  if (!show) {
20
20
  setTimeout(() => {
21
- setShow(true);
21
+ setShow(() => {
22
+ // bugfix:
23
+ // 外层CSSTransition使用dom API而非通过react className属性修改class
24
+ // 如果内部通过react className属性动态修改class会覆盖CSSTransition的设置,导致CSSTransition enter相关的class无法应用到组件
25
+ domRef.current?.classList.add('show');
26
+ return true;
27
+ });
22
28
  }, 0);
23
29
  }
24
30
  }
@@ -60,7 +66,6 @@ export const PopoverInner = forwardRef((props, ref) => {
60
66
  };
61
67
  };
62
68
  return (React.createElement("div", { ref: domRef, className: cls(`${prefixCls}-popover-inner`, 'popover-inner', 'all-border-box', `${mode}-mode`, className, {
63
- show,
64
69
  'with-shadow': needShadow,
65
70
  'with-suffix': showCloseIcon || textSuffix,
66
71
  'custom-content': typeof content !== 'string',
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { StepsProps, StepsRef } from './type';
3
3
  export * from './type';
4
- export declare const StepsContext: React.Context<Pick<StepsProps, "direction" | "status" | "align" | "iconType" | "current"> & {
4
+ export declare const StepsContext: React.Context<Pick<StepsProps, "direction" | "status" | "align" | "iconType" | "current" | "reverseOrder"> & {
5
5
  index?: number | undefined;
6
6
  changeIndex: (newIndex: number) => void;
7
7
  }>;