@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
package/CHANGELOG.md CHANGED
@@ -3,6 +3,42 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.34.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.33.0...@arco-design/mobile-react@2.34.0) (2024-11-21)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * `Popover` custom show transition animation ([#297](https://github.com/arco-design/arco-design-mobile/issues/297)) ([c3ceaf2](https://github.com/arco-design/arco-design-mobile/commit/c3ceaf2a7571626c298132b2c486d7128a748007))
12
+ * fix `useMountedState` in `hooks.ts` not correct init leavingRef in StrictMode. ([#292](https://github.com/arco-design/arco-design-mobile/issues/292)) ([af2bf5d](https://github.com/arco-design/arco-design-mobile/commit/af2bf5d5428eec252cac565ef708b2af6e0106a2))
13
+
14
+
15
+ ### Features
16
+
17
+ * add a FAQ in the `Dialog`. ([#302](https://github.com/arco-design/arco-design-mobile/issues/302)) ([55f6940](https://github.com/arco-design/arco-design-mobile/commit/55f69406a3411faf5e67b2ef05a552121a9d3c04))
18
+ * optimize `Divider` hairline style ([99b1604](https://github.com/arco-design/arco-design-mobile/commit/99b16041aa8e4b71a82ffb5744f180ee9273ef3b))
19
+ * optimize `NoticeBar` close ([#294](https://github.com/arco-design/arco-design-mobile/issues/294)) ([a717540](https://github.com/arco-design/arco-design-mobile/commit/a7175403158c43c209b58c27cd994643f822aeeb))
20
+
21
+
22
+
23
+
24
+
25
+ # [2.33.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.32.0...@arco-design/mobile-react@2.33.0) (2024-10-24)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * fix carousel scrolling bug when trigger click ([8b62ee3](https://github.com/arco-design/arco-design-mobile/commit/8b62ee3dfe489fc1890f099cc26c527d94f4ddbd))
31
+
32
+
33
+ ### Features
34
+
35
+ * `Steps` support reverse order ([#287](https://github.com/arco-design/arco-design-mobile/issues/287)) ([8ed5614](https://github.com/arco-design/arco-design-mobile/commit/8ed5614d385d20bfb5fa1ada83d7f56e9f1c5150))
36
+ * add custom class support to `Avatar` component ([#285](https://github.com/arco-design/arco-design-mobile/issues/285)) ([8a37b7c](https://github.com/arco-design/arco-design-mobile/commit/8a37b7cbd05bacb457a3c2692a66a6a02cd7646f))
37
+
38
+
39
+
40
+
41
+
6
42
  # [2.32.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.31.6...@arco-design/mobile-react@2.32.0) (2024-08-16)
7
43
 
8
44
 
package/README.en-US.md CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="_b
59
59
  React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">Click here</a>**
60
60
 
61
61
  ```
62
- <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.31.6/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.31.6/dist/index.min.js"></script>
62
+ <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.33.0/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.33.0/dist/index.min.js"></script>
64
64
  ```
65
65
 
66
66
  ## Full import
package/README.md CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="
59
59
  React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">戳这里获取</a>**
60
60
 
61
61
  ```
62
- <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.31.6/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.31.6/dist/index.min.js"></script>
62
+ <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.33.0/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.33.0/dist/index.min.js"></script>
64
64
  ```
65
65
 
66
66
  ## 引入全部
@@ -101,6 +101,8 @@ function useMountedState(initialState) {
101
101
  setState(value);
102
102
  }, []);
103
103
  (0, _react.useEffect)(function () {
104
+ // see: https://github.com/arco-design/arco-design-mobile/pull/292
105
+ leavingRef.current = false;
104
106
  return function () {
105
107
  leavingRef.current = true;
106
108
  };
@@ -59,6 +59,8 @@ function componentGenerator(Comp) {
59
59
  textAvatar = _props$textAvatar === void 0 ? '' : _props$textAvatar,
60
60
  _props$avatarStyle = props.avatarStyle,
61
61
  avatarStyle = _props$avatarStyle === void 0 ? {} : _props$avatarStyle,
62
+ _props$avatarClass = props.avatarClass,
63
+ avatarClass = _props$avatarClass === void 0 ? '' : _props$avatarClass,
62
64
  _props$autoFixFontSiz = props.autoFixFontSize,
63
65
  autoFixFontSize = _props$autoFixFontSiz === void 0 ? true : _props$autoFixFontSiz,
64
66
  _props$autoFixFontOff = props.autoFixFontOffset,
@@ -140,7 +142,7 @@ function componentGenerator(Comp) {
140
142
  className: (0, _mobileUtils.cls)(prefixCls + "-avatar-wrapper", className, size, shape, prefixCls + "-avatar-wrapper-shape-" + shape, (_cls = {}, _cls[prefixCls + "-avatar-wrapper-with-info " + prefixCls + "-avatar-wrapper-with-info-size-" + size + " with-info"] = Boolean(avatarName), _cls)),
141
143
  onClick: onClick
142
144
  }, /*#__PURE__*/_react.default.createElement("div", {
143
- className: (0, _mobileUtils.cls)(prefixCls + "-avatar", prefixCls + "-avatar-size-" + size, size, prefixCls + "-avatar-shape-" + shape, shape, (_cls2 = {}, _cls2[prefixCls + "-text-avatar " + prefixCls + "-avatar-mode-text"] = isTextAvatar, _cls2[prefixCls + "-image-avatar " + prefixCls + "-avatar-mode-image"] = isImageAvatar, _cls2[prefixCls + "-avatar-default-overlap default-overlap"] = useDefaultAvatar, _cls2)),
145
+ className: (0, _mobileUtils.cls)(prefixCls + "-avatar", avatarClass, prefixCls + "-avatar-size-" + size, size, prefixCls + "-avatar-shape-" + shape, shape, (_cls2 = {}, _cls2[prefixCls + "-text-avatar " + prefixCls + "-avatar-mode-text"] = isTextAvatar, _cls2[prefixCls + "-image-avatar " + prefixCls + "-avatar-mode-image"] = isImageAvatar, _cls2[prefixCls + "-avatar-default-overlap default-overlap"] = useDefaultAvatar, _cls2)),
144
146
  style: avatarStyle,
145
147
  ref: avatarRef
146
148
  }, children, useDefaultAvatar && (defaultOverLap === void 0 ? /*#__PURE__*/_react.default.createElement(_IconUserFill.default, {
@@ -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
@@ -243,6 +243,12 @@ var Carousel = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
243
243
 
244
244
  if (posAdjustingRef.current) {
245
245
  return;
246
+ } // touchMove触发时,阻止handleTouchStart多次执行(如点击事件)
247
+ // @en When touchMove is triggered, prevent handleTouchStart from executing multiple times (such as click events)
248
+
249
+
250
+ if (touchStartedRef.current && touchMovedRef.current) {
251
+ return;
246
252
  }
247
253
 
248
254
  touchStartedRef.current = true;
@@ -699,12 +705,23 @@ var Carousel = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
699
705
  return;
700
706
  }
701
707
 
702
- if (!touchStartedRef.current || !touchMovedRef.current || posAdjustingRef.current || touchStoppedRef.current) {
708
+ if (!touchStartedRef.current) {
703
709
  return;
704
710
  }
705
711
 
706
712
  touchStartedRef.current = false;
713
+
714
+ if (!touchMovedRef.current) {
715
+ setPlayIntervalRef.current();
716
+ return;
717
+ }
718
+
707
719
  touchMovedRef.current = false;
720
+
721
+ if (posAdjustingRef.current || touchStoppedRef.current) {
722
+ return;
723
+ }
724
+
708
725
  var touchEndTime = new Date().getTime();
709
726
  var dis = Math.abs(distance);
710
727
  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);
@@ -57,9 +57,13 @@ var NoticeBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
57
57
  var contentRef = (0, _react.useRef)(null);
58
58
  var timerRef = (0, _react.useRef)(null);
59
59
 
60
- var _useState = (0, _react.useState)(false),
61
- needMarquee = _useState[0],
62
- setNeedMarquee = _useState[1];
60
+ var _useState = (0, _react.useState)(true),
61
+ visible = _useState[0],
62
+ setVisible = _useState[1];
63
+
64
+ var _useState2 = (0, _react.useState)(false),
65
+ needMarquee = _useState2[0],
66
+ setNeedMarquee = _useState2[1];
63
67
 
64
68
  var extraClass = (0, _react.useMemo)(function () {
65
69
  var classList = []; // 字幕可滚动时,或不可滚动且不可以换行时,添加不换行效果
@@ -100,9 +104,8 @@ var NoticeBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
100
104
  }, [useRtl]);
101
105
 
102
106
  function close() {
103
- if (domRef.current) {
104
- (0, _mobileUtils.removeElement)(domRef.current);
105
- }
107
+ setVisible(false);
108
+ clear();
106
109
  }
107
110
 
108
111
  function handleClose(e) {
@@ -167,7 +170,7 @@ var NoticeBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
167
170
  }
168
171
 
169
172
  function renderNoticeBar(prefix) {
170
- return /*#__PURE__*/_react.default.createElement("div", {
173
+ return visible ? /*#__PURE__*/_react.default.createElement("div", {
171
174
  className: (0, _mobileUtils.cls)(prefix, className, extraClass),
172
175
  style: style,
173
176
  ref: domRef,
@@ -193,7 +196,7 @@ var NoticeBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
193
196
  }, rightContent) : null, closeable ? /*#__PURE__*/_react.default.createElement("div", {
194
197
  className: prefix + "-close",
195
198
  onClick: handleClose
196
- }, closeIcon) : null);
199
+ }, closeIcon) : null) : null;
197
200
  }
198
201
 
199
202
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
@@ -63,7 +63,15 @@ var PopoverInner = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
63
63
  if (left || width || top || height || bottom) {
64
64
  if (!show) {
65
65
  setTimeout(function () {
66
- setShow(true);
66
+ setShow(function () {
67
+ var _domRef$current;
68
+
69
+ // bugfix:
70
+ // 外层CSSTransition使用dom API而非通过react className属性修改class
71
+ // 如果内部通过react className属性动态修改class会覆盖CSSTransition的设置,导致CSSTransition enter相关的class无法应用到组件
72
+ (_domRef$current = domRef.current) == null ? void 0 : _domRef$current.classList.add('show');
73
+ return true;
74
+ });
67
75
  }, 0);
68
76
  }
69
77
  }
@@ -115,7 +123,6 @@ var PopoverInner = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
115
123
  return /*#__PURE__*/_react.default.createElement("div", {
116
124
  ref: domRef,
117
125
  className: (0, _mobileUtils.cls)(prefixCls + "-popover-inner", 'popover-inner', 'all-border-box', mode + "-mode", className, {
118
- show: show,
119
126
  'with-shadow': needShadow,
120
127
  'with-suffix': showCloseIcon || textSuffix,
121
128
  '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
  }>;
@@ -53,6 +53,8 @@ var Steps = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
53
53
  _props$status = props.status,
54
54
  status = _props$status === void 0 ? 'process' : _props$status,
55
55
  items = props.items,
56
+ _props$reverseOrder = props.reverseOrder,
57
+ reverseOrder = _props$reverseOrder === void 0 ? false : _props$reverseOrder,
56
58
  onClick = props.onClick,
57
59
  onChange = props.onChange;
58
60
  var defaultAlign = direction === 'vertical' ? 'start' : 'center';
@@ -93,6 +95,7 @@ var Steps = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
93
95
  index: index,
94
96
  status: activeIndex === index ? status : void 0,
95
97
  align: align,
98
+ reverseOrder: reverseOrder,
96
99
  changeIndex: changeIndex
97
100
  },
98
101
  key: index
@@ -101,7 +104,9 @@ var Steps = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
101
104
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
102
105
  var prefixCls = _ref.prefixCls;
103
106
  return /*#__PURE__*/_react.default.createElement("div", {
104
- className: prefixCls + "-steps all-border-box " + className + " " + direction + " " + system,
107
+ className: (0, _mobileUtils.cls)(prefixCls + "-steps all-border-box " + className + " " + direction + " " + system, {
108
+ 'reverse-order': reverseOrder
109
+ }),
105
110
  style: style,
106
111
  ref: domRef
107
112
  }, 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)'