{({ prefixCls }) => (
diff --git a/packages/arcodesign/components/steps/style/index.less b/packages/arcodesign/components/steps/style/index.less
index 94c14fae..be38e9cc 100644
--- a/packages/arcodesign/components/steps/style/index.less
+++ b/packages/arcodesign/components/steps/style/index.less
@@ -1,9 +1,13 @@
-@import "../../../style/mixin.less";
+@import '../../../style/mixin.less';
.@{prefix}-steps {
display: flex;
.use-var(padding, steps-padding);
+ &.reverse-order {
+ flex-direction: row-reverse;
+ }
+
&-item {
position: relative;
display: flex;
@@ -30,6 +34,20 @@
visibility: hidden;
}
+ &:first-child &-tail::after,
+ &:last-child &-tail::before {
+ .reverse-order & {
+ visibility: hidden;
+ }
+ }
+
+ &:first-child &-tail::before,
+ &:last-child &-tail::after {
+ .reverse-order & {
+ visibility: visible;
+ }
+ }
+
&-tail {
position: absolute;
display: flex;
@@ -50,7 +68,7 @@
.use-var(padding, steps-tail-horizontal-padding);
&::after {
- content: "";
+ content: '';
width: 100%;
.use-var(border-radius, steps-tail-border-radius);
}
@@ -59,7 +77,7 @@
&-align-center {
&::before,
&::after {
- content: "";
+ content: '';
width: 50%;
}
&::before {
@@ -90,7 +108,7 @@
.use-var(padding, steps-tail-vertical-padding);
&::after {
- content: "";
+ content: '';
height: 100%;
.use-var(border-radius, steps-tail-border-radius);
}
@@ -99,7 +117,7 @@
&-align-center {
&::before,
&::after {
- content: "";
+ content: '';
height: 50%;
}
&::before {
@@ -127,6 +145,20 @@
&-align-center&-status-error::before {
.use-var(background, steps-tail-finish-background);
}
+
+ &-status-finish::before,
+ &-status-process::after,
+ &-align-center&-status-error::after {
+ .reverse-order & {
+ .use-var(background, steps-tail-finish-background);
+ }
+ }
+ &-status-process::before,
+ &-align-center&-status-error::before {
+ .reverse-order & {
+ .use-var(background, steps-tail-standard-background);
+ }
+ }
}
&-custom-icon,
@@ -206,7 +238,6 @@
}
&-content {
-
.horizontal & {
.use-var(margin-top, steps-horizontal-content-margin-top);
&-align-center {
@@ -262,6 +293,10 @@
}
&.vertical {
+ &.reverse-order {
+ flex-direction: column-reverse;
+ }
+
flex-direction: column;
.use-var(padding-bottom, steps-vertical-padding-bottom);
.use-var-with-rtl(padding-left, steps-vertical-padding-left);
diff --git a/packages/arcodesign/components/steps/type.ts b/packages/arcodesign/components/steps/type.ts
index 838b8070..aed1b09f 100644
--- a/packages/arcodesign/components/steps/type.ts
+++ b/packages/arcodesign/components/steps/type.ts
@@ -32,6 +32,11 @@ export interface StepsProps {
* @en Custom classname
*/
className?: string;
+ /**
+ * 顺序反转,设置为true后,顺序将从右到左,从下到上
+ * @en reverse the order from right to left and from bottom to top
+ */
+ reverseOrder?: boolean;
/**
* 自定义样式,如果想用 css 控制 icon 颜色,可使用公共 mixin '.set-steps-color(@color)'
* @en Custom stylesheet. If want to use CSS to control icon color, use public mixin '.set-steps-color(@color)'
diff --git a/packages/common-widgets/style/mixin.less b/packages/common-widgets/style/mixin.less
index 3ac60ffc..b4838ea6 100644
--- a/packages/common-widgets/style/mixin.less
+++ b/packages/common-widgets/style/mixin.less
@@ -530,7 +530,7 @@
* }
* ```
*/
-.set-steps-color(@color, @finish-color: fade(@color, 10%)) {
+.set-steps-color(@color, @finish-color: fade(@color, 10%), @reverse: false) {
.process-bg-color-with-config,
.process-custom-icon-bg-color-with-config {
background: @color;
@@ -553,8 +553,20 @@
}
.finish-tail-color-with-config::before,
.finish-tail-color-with-config::after,
- .process-tail-color-with-config::before,
.error-tail-color-with-config::before {
background: @color;
}
+
+ & when (@reverse = true) {
+ .process-tail-color-with-config::after {
+ background: @color;
+ }
+ }
+
+ & when (@reverse = false) {
+ .process-tail-color-with-config::before {
+ background: @color;
+ }
+ }
+
}