@arco-design/mobile-react 2.32.0 → 2.33.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.
@@ -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)'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arco-design/mobile-react",
3
- "version": "2.32.0",
3
+ "version": "2.33.0",
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.19.0",
18
+ "@arco-design/mobile-utils": "2.20.0",
19
19
  "@arco-design/transformable": "^1.0.0",
20
20
  "@babel/runtime": "^7",
21
21
  "lodash.throttle": "^4.1.1",
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "72f78e976347aa9f57858d414aba6063e7de62f6"
50
+ "gitHead": "7b0a8e3446dd2429a7a14a4a4d86688aa726887f"
51
51
  }
@@ -59,6 +59,8 @@
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 @@
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
@@ -248,6 +248,12 @@
248
248
 
249
249
  if (posAdjustingRef.current) {
250
250
  return;
251
+ } // touchMove触发时,阻止handleTouchStart多次执行(如点击事件)
252
+ // @en When touchMove is triggered, prevent handleTouchStart from executing multiple times (such as click events)
253
+
254
+
255
+ if (touchStartedRef.current && touchMovedRef.current) {
256
+ return;
251
257
  }
252
258
 
253
259
  touchStartedRef.current = true;
@@ -704,12 +710,23 @@
704
710
  return;
705
711
  }
706
712
 
707
- if (!touchStartedRef.current || !touchMovedRef.current || posAdjustingRef.current || touchStoppedRef.current) {
713
+ if (!touchStartedRef.current) {
708
714
  return;
709
715
  }
710
716
 
711
717
  touchStartedRef.current = false;
718
+
719
+ if (!touchMovedRef.current) {
720
+ setPlayIntervalRef.current();
721
+ return;
722
+ }
723
+
712
724
  touchMovedRef.current = false;
725
+
726
+ if (posAdjustingRef.current || touchStoppedRef.current) {
727
+ return;
728
+ }
729
+
713
730
  var touchEndTime = new Date().getTime();
714
731
  var dis = Math.abs(distance);
715
732
  var speed = dis / (touchEndTime - touchStartTimeRef.current) * 1000;
@@ -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
  }>;
@@ -54,6 +54,8 @@
54
54
  _props$status = props.status,
55
55
  status = _props$status === void 0 ? 'process' : _props$status,
56
56
  items = props.items,
57
+ _props$reverseOrder = props.reverseOrder,
58
+ reverseOrder = _props$reverseOrder === void 0 ? false : _props$reverseOrder,
57
59
  onClick = props.onClick,
58
60
  onChange = props.onChange;
59
61
  var defaultAlign = direction === 'vertical' ? 'start' : 'center';
@@ -94,6 +96,7 @@
94
96
  index: index,
95
97
  status: activeIndex === index ? status : void 0,
96
98
  align: align,
99
+ reverseOrder: reverseOrder,
97
100
  changeIndex: changeIndex
98
101
  },
99
102
  key: index
@@ -102,7 +105,9 @@
102
105
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
103
106
  var prefixCls = _ref.prefixCls;
104
107
  return /*#__PURE__*/_react.default.createElement("div", {
105
- className: prefixCls + "-steps all-border-box " + className + " " + direction + " " + system,
108
+ className: (0, _mobileUtils.cls)(prefixCls + "-steps all-border-box " + className + " " + direction + " " + system, {
109
+ 'reverse-order': reverseOrder
110
+ }),
106
111
  style: style,
107
112
  ref: domRef
108
113
  }, 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)'