@arco-design/mobile-react 2.21.3 → 2.22.2

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 (119) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/index.d.ts +1 -0
  5. package/cjs/_helpers/index.js +9 -0
  6. package/cjs/_helpers/react-dom.d.ts +13 -0
  7. package/cjs/_helpers/react-dom.js +65 -0
  8. package/cjs/_helpers/render.d.ts +10 -0
  9. package/cjs/_helpers/render.js +40 -0
  10. package/cjs/action-sheet/index.d.ts +1 -1
  11. package/cjs/action-sheet/style/css/index.css +2 -2
  12. package/cjs/action-sheet/style/index.less +1 -1
  13. package/cjs/dialog/style/css/index.css +2 -2
  14. package/cjs/dialog/style/index.less +1 -1
  15. package/cjs/image-picker/index.js +0 -1
  16. package/cjs/image-preview/index.d.ts +2 -10
  17. package/cjs/image-preview/methods.js +4 -11
  18. package/cjs/masking/index.d.ts +10 -0
  19. package/cjs/masking/methods.js +4 -11
  20. package/cjs/notify/methods.js +6 -9
  21. package/cjs/popover/hooks/useEvent.js +6 -6
  22. package/cjs/pull-refresh/android-pull-refresh.js +2 -0
  23. package/cjs/pull-refresh/ios-pull-refresh.js +3 -2
  24. package/cjs/pull-refresh/model.d.ts +6 -2
  25. package/cjs/steps/demo/style/css/mobile.css +8 -2
  26. package/cjs/steps/index.d.ts +1 -1
  27. package/cjs/steps/index.js +5 -1
  28. package/cjs/steps/step.js +5 -3
  29. package/cjs/steps/style/css/index.css +78 -23
  30. package/cjs/steps/style/index.less +92 -24
  31. package/cjs/steps/type.d.ts +12 -0
  32. package/cjs/swipe-action/index.js +21 -3
  33. package/cjs/tabs/index.js +8 -4
  34. package/cjs/tabs/style/css/index.css +8 -8
  35. package/cjs/tabs/style/index.less +4 -4
  36. package/cjs/tabs/tab-cell.js +4 -3
  37. package/cjs/tabs/type.d.ts +11 -0
  38. package/cjs/toast/methods.js +9 -12
  39. package/dist/index.js +186 -81
  40. package/dist/index.min.js +4 -4
  41. package/dist/style.css +87 -35
  42. package/dist/style.min.css +1 -1
  43. package/esm/_helpers/index.d.ts +1 -0
  44. package/esm/_helpers/index.js +1 -0
  45. package/esm/_helpers/react-dom.d.ts +13 -0
  46. package/esm/_helpers/react-dom.js +57 -0
  47. package/esm/_helpers/render.d.ts +10 -0
  48. package/esm/_helpers/render.js +29 -0
  49. package/esm/action-sheet/index.d.ts +1 -1
  50. package/esm/action-sheet/style/css/index.css +2 -2
  51. package/esm/action-sheet/style/index.less +1 -1
  52. package/esm/dialog/style/css/index.css +2 -2
  53. package/esm/dialog/style/index.less +1 -1
  54. package/esm/image-picker/index.js +0 -1
  55. package/esm/image-preview/index.d.ts +2 -10
  56. package/esm/image-preview/methods.js +3 -9
  57. package/esm/masking/index.d.ts +10 -0
  58. package/esm/masking/methods.js +3 -9
  59. package/esm/notify/methods.js +6 -7
  60. package/esm/popover/hooks/useEvent.js +6 -6
  61. package/esm/pull-refresh/android-pull-refresh.js +2 -0
  62. package/esm/pull-refresh/ios-pull-refresh.js +3 -2
  63. package/esm/pull-refresh/model.d.ts +6 -2
  64. package/esm/steps/demo/style/css/mobile.css +8 -2
  65. package/esm/steps/index.d.ts +1 -1
  66. package/esm/steps/index.js +5 -1
  67. package/esm/steps/step.js +5 -3
  68. package/esm/steps/style/css/index.css +78 -23
  69. package/esm/steps/style/index.less +92 -24
  70. package/esm/steps/type.d.ts +12 -0
  71. package/esm/swipe-action/index.js +21 -3
  72. package/esm/tabs/index.js +9 -5
  73. package/esm/tabs/style/css/index.css +8 -8
  74. package/esm/tabs/style/index.less +4 -4
  75. package/esm/tabs/tab-cell.js +4 -3
  76. package/esm/tabs/type.d.ts +11 -0
  77. package/esm/toast/methods.js +8 -9
  78. package/package.json +3 -3
  79. package/tokens/app/arcodesign/default/css-variables.less +7 -3
  80. package/tokens/app/arcodesign/default/index.d.ts +4 -0
  81. package/tokens/app/arcodesign/default/index.js +7 -3
  82. package/tokens/app/arcodesign/default/index.json +58 -10
  83. package/tokens/app/arcodesign/default/index.less +7 -3
  84. package/tokens/mixin/index.less +1 -1
  85. package/umd/_helpers/index.d.ts +1 -0
  86. package/umd/_helpers/index.js +10 -4
  87. package/umd/_helpers/react-dom.d.ts +13 -0
  88. package/umd/_helpers/react-dom.js +78 -0
  89. package/umd/_helpers/render.d.ts +10 -0
  90. package/umd/_helpers/render.js +51 -0
  91. package/umd/action-sheet/index.d.ts +1 -1
  92. package/umd/action-sheet/style/css/index.css +2 -2
  93. package/umd/action-sheet/style/index.less +1 -1
  94. package/umd/dialog/style/css/index.css +2 -2
  95. package/umd/dialog/style/index.less +1 -1
  96. package/umd/image-picker/index.js +0 -1
  97. package/umd/image-preview/index.d.ts +2 -10
  98. package/umd/image-preview/methods.js +6 -13
  99. package/umd/masking/index.d.ts +10 -0
  100. package/umd/masking/methods.js +6 -13
  101. package/umd/notify/methods.js +9 -12
  102. package/umd/popover/hooks/useEvent.js +6 -6
  103. package/umd/pull-refresh/android-pull-refresh.js +2 -0
  104. package/umd/pull-refresh/ios-pull-refresh.js +3 -2
  105. package/umd/pull-refresh/model.d.ts +6 -2
  106. package/umd/steps/demo/style/css/mobile.css +8 -2
  107. package/umd/steps/index.d.ts +1 -1
  108. package/umd/steps/index.js +5 -1
  109. package/umd/steps/step.js +5 -3
  110. package/umd/steps/style/css/index.css +78 -23
  111. package/umd/steps/style/index.less +92 -24
  112. package/umd/steps/type.d.ts +12 -0
  113. package/umd/swipe-action/index.js +21 -3
  114. package/umd/tabs/index.js +8 -4
  115. package/umd/tabs/style/css/index.css +8 -8
  116. package/umd/tabs/style/index.less +4 -4
  117. package/umd/tabs/tab-cell.js +4 -3
  118. package/umd/tabs/type.d.ts +11 -0
  119. package/umd/toast/methods.js +11 -14
package/cjs/steps/step.js CHANGED
@@ -29,9 +29,11 @@ var Step = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
29
29
  _useContext$index = _useContext.index,
30
30
  index = _useContext$index === void 0 ? 0 : _useContext$index,
31
31
  contextStatus = _useContext.status,
32
+ contextAlign = _useContext.align,
32
33
  changeIndex = _useContext.changeIndex;
33
34
 
34
35
  var status = props.status || contextStatus;
36
+ var align = props.align || contextAlign;
35
37
  var domRef = (0, _react.useRef)(null);
36
38
  (0, _react.useImperativeHandle)(ref, function () {
37
39
  return {
@@ -70,12 +72,12 @@ var Step = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
70
72
  var prefixCls = _ref.prefixCls;
71
73
  return /*#__PURE__*/_react.default.createElement("div", {
72
74
  ref: domRef,
73
- className: (0, _mobileUtils.cls)(prefixCls + "-steps-item", currentStatus, direction, iconType),
75
+ className: (0, _mobileUtils.cls)(prefixCls + "-steps-item", prefixCls + "-steps-item-align-" + align, currentStatus, direction, iconType),
74
76
  onClick: function onClick() {
75
77
  return changeIndex(index);
76
78
  }
77
79
  }, /*#__PURE__*/_react.default.createElement("div", {
78
- className: (0, _mobileUtils.cls)(prefixCls + "-steps-item-tail", currentStatus + "-tail-color-with-config")
80
+ className: (0, _mobileUtils.cls)(prefixCls + "-steps-item-tail", prefixCls + "-steps-item-tail-status-" + currentStatus, prefixCls + "-steps-item-tail-align-" + align, currentStatus + "-tail-color-with-config")
79
81
  }), icon ? /*#__PURE__*/_react.default.createElement("div", {
80
82
  className: (0, _mobileUtils.cls)(prefixCls + "-steps-item-custom-icon", currentStatus + "-custom-icon-bg-color-with-config")
81
83
  }, icon) : /*#__PURE__*/_react.default.createElement("div", {
@@ -83,7 +85,7 @@ var Step = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
83
85
  }, iconType === 'number' ? renderNumIcon(prefixCls) : /*#__PURE__*/_react.default.createElement("span", {
84
86
  className: (0, _mobileUtils.cls)(prefixCls + "-steps-item-icon-dot")
85
87
  })), title || description ? /*#__PURE__*/_react.default.createElement("div", {
86
- className: (0, _mobileUtils.cls)(prefixCls + "-steps-item-content")
88
+ className: (0, _mobileUtils.cls)(prefixCls + "-steps-item-content", prefixCls + "-steps-item-content-align-" + align)
87
89
  }, title ? /*#__PURE__*/_react.default.createElement("div", {
88
90
  className: (0, _mobileUtils.cls)(prefixCls + "-steps-item-title", currentStatus + "-title-color-with-config")
89
91
  }, title) : null, description ? /*#__PURE__*/_react.default.createElement("div", {
@@ -18,17 +18,23 @@
18
18
  -webkit-box-direction: normal;
19
19
  -webkit-flex-direction: column;
20
20
  flex-direction: column;
21
+ }
22
+ .arco-steps-item-align-center {
21
23
  -webkit-box-align: center;
22
24
  -webkit-align-items: center;
23
25
  align-items: center;
24
26
  }
25
- .arco-steps-item.vertical {
27
+ .arco-steps-item-align-start {
26
28
  -webkit-box-align: start;
27
29
  -webkit-align-items: flex-start;
28
30
  align-items: flex-start;
29
31
  }
30
- .arco-steps-item:last-child .arco-steps-item-tail:after {
31
- display: none;
32
+ .arco-steps-item-align-center.vertical {
33
+ padding-bottom: 0.5rem ;
34
+ }
35
+ .arco-steps-item:first-child .arco-steps-item-tail::before,
36
+ .arco-steps-item:last-child .arco-steps-item-tail::after {
37
+ visibility: hidden;
32
38
  }
33
39
  .arco-steps-item-tail {
34
40
  position: absolute;
@@ -44,33 +50,81 @@
44
50
  }
45
51
  .horizontal .arco-steps-item-tail {
46
52
  width: 100%;
47
- left: 50%;
48
53
  height: 18PX ;
49
- padding: 0 0.36rem ;
50
54
  }
51
- .horizontal .arco-steps-item-tail:after {
55
+ .horizontal .arco-steps-item-tail::before,
56
+ .horizontal .arco-steps-item-tail::after {
57
+ height: 1PX ;
58
+ }
59
+ .horizontal .arco-steps-item-tail-align-start {
60
+ left: 9PX ;
61
+ padding: 0 18PX ;
62
+ }
63
+ .horizontal .arco-steps-item-tail-align-start::after {
52
64
  content: "";
53
- display: inline-block;
54
65
  width: 100%;
55
- height: 1PX ;
56
- background: #e5e6eb ;
57
- border-radius: 0.04rem;
66
+ border-radius: 2PX ;
67
+ }
68
+ .horizontal .arco-steps-item-tail-align-center::before,
69
+ .horizontal .arco-steps-item-tail-align-center::after {
70
+ content: "";
71
+ width: 50%;
72
+ }
73
+ .horizontal .arco-steps-item-tail-align-center::before {
74
+ margin-right: 18PX ;
75
+ border-top-right-radius: 2PX ;
76
+ border-bottom-right-radius: 2PX ;
77
+ }
78
+ .horizontal .arco-steps-item-tail-align-center::after {
79
+ margin-left: 18PX ;
80
+ border-top-left-radius: 2PX ;
81
+ border-bottom-left-radius: 2PX ;
58
82
  }
59
83
  .vertical .arco-steps-item-tail {
60
84
  height: 100%;
61
85
  width: 18PX ;
62
- top: 0.18rem ;
63
- padding: 0.28rem 0 ;
86
+ -webkit-box-orient: vertical;
87
+ -webkit-box-direction: normal;
88
+ -webkit-flex-direction: column;
89
+ flex-direction: column;
64
90
  }
65
- .vertical .arco-steps-item-tail:after {
91
+ .vertical .arco-steps-item-tail::before,
92
+ .vertical .arco-steps-item-tail::after {
93
+ width: 1PX ;
94
+ }
95
+ .vertical .arco-steps-item-tail-align-start {
96
+ top: 9PX ;
97
+ padding: 14PX 0 ;
98
+ }
99
+ .vertical .arco-steps-item-tail-align-start::after {
66
100
  content: "";
67
- display: inline-block;
68
101
  height: 100%;
69
- width: 1PX ;
102
+ border-radius: 2PX ;
103
+ }
104
+ .vertical .arco-steps-item-tail-align-center::before,
105
+ .vertical .arco-steps-item-tail-align-center::after {
106
+ content: "";
107
+ height: 50%;
108
+ }
109
+ .vertical .arco-steps-item-tail-align-center::before {
110
+ margin-bottom: 14PX ;
111
+ border-bottom-left-radius: 2PX ;
112
+ border-bottom-right-radius: 2PX ;
113
+ }
114
+ .vertical .arco-steps-item-tail-align-center::after {
115
+ margin-top: 14PX ;
116
+ border-top-left-radius: 2PX ;
117
+ border-top-right-radius: 2PX ;
118
+ }
119
+ .arco-steps-item-tail::after,
120
+ .arco-steps-item-tail::before {
121
+ display: inline-block;
70
122
  background: #e5e6eb ;
71
- border-radius: 0.04rem;
72
123
  }
73
- .finish .arco-steps-item-tail:after {
124
+ .arco-steps-item-tail-status-finish::before,
125
+ .arco-steps-item-tail-status-finish::after,
126
+ .arco-steps-item-tail-align-center.arco-steps-item-tail-status-process::before,
127
+ .arco-steps-item-tail-align-center.arco-steps-item-tail-status-error::before {
74
128
  background: #165dff ;
75
129
  }
76
130
  .arco-steps-item-custom-icon,
@@ -122,8 +176,8 @@
122
176
  .arco-steps-item-icon-num.android,
123
177
  .arco-steps-item-icon-num.system-android {
124
178
  font-weight: 400;
125
- -webkit-text-stroke: 0.3PX #86909c;
126
- text-stroke: 0.3PX #86909c;
179
+ -webkit-text-stroke: 0.3PX currentColor;
180
+ text-stroke: 0.3PX currentColor;
127
181
  }
128
182
  .process .arco-steps-item-icon-num {
129
183
  color: #FFFFFF ;
@@ -147,18 +201,19 @@
147
201
  border: none;
148
202
  background: #165dff ;
149
203
  }
150
- .arco-steps-item-content {
151
- text-align: center;
152
- }
153
204
  .horizontal .arco-steps-item-content {
154
205
  margin-top: 0.1rem ;
155
206
  }
207
+ .horizontal .arco-steps-item-content-align-center {
208
+ text-align: center;
209
+ }
156
210
  .vertical .arco-steps-item-content {
157
211
  margin-left: 0.26rem ;
158
- text-align: left;
159
212
  -webkit-box-flex: 1;
160
213
  -webkit-flex: 1;
161
214
  flex: 1;
215
+ }
216
+ .vertical .arco-steps-item-content-align-start {
162
217
  padding-bottom: 0.5rem ;
163
218
  }
164
219
  .arco-steps-item-title {
@@ -11,15 +11,23 @@
11
11
 
12
12
  &.horizontal {
13
13
  flex-direction: column;
14
+ }
15
+
16
+ &-align-center {
14
17
  align-items: center;
15
18
  }
16
19
 
17
- &.vertical {
20
+ &-align-start {
18
21
  align-items: flex-start;
19
22
  }
20
23
 
21
- &:last-child &-tail:after {
22
- display: none;
24
+ &-align-center.vertical {
25
+ .use-var(padding-bottom, steps-vertical-content-padding-bottom);
26
+ }
27
+
28
+ &:first-child &-tail::before,
29
+ &:last-child &-tail::after {
30
+ visibility: hidden;
23
31
  }
24
32
 
25
33
  &-tail {
@@ -30,37 +38,93 @@
30
38
 
31
39
  .horizontal & {
32
40
  width: 100%;
33
- left: 50%;
34
41
  .use-var(height, steps-icon-height);
35
- .use-var(padding, steps-tail-horizontal-padding);
36
42
 
37
- &:after {
38
- content: "";
39
- display: inline-block;
40
- width: 100%;
43
+ &::before,
44
+ &::after {
41
45
  .use-var(height, steps-tail-standard-size);
42
- .use-var(background, steps-tail-standard-background);
43
- .rem(border-radius, 2);
46
+ }
47
+
48
+ &-align-start {
49
+ .use-var(left, steps-tail-horizontal-left);
50
+ .use-var(padding, steps-tail-horizontal-padding);
51
+
52
+ &::after {
53
+ content: "";
54
+ width: 100%;
55
+ .use-var(border-radius, steps-tail-border-radius);
56
+ }
57
+ }
58
+
59
+ &-align-center {
60
+ &::before,
61
+ &::after {
62
+ content: "";
63
+ width: 50%;
64
+ }
65
+ &::before {
66
+ .use-var(margin-right, steps-tail-horizontal-gutter);
67
+ .use-var(border-top-right-radius, steps-tail-border-radius);
68
+ .use-var(border-bottom-right-radius, steps-tail-border-radius);
69
+ }
70
+ &::after {
71
+ .use-var(margin-left, steps-tail-horizontal-gutter);
72
+ .use-var(border-top-left-radius, steps-tail-border-radius);
73
+ .use-var(border-bottom-left-radius, steps-tail-border-radius);
74
+ }
44
75
  }
45
76
  }
46
77
 
47
78
  .vertical & {
48
79
  height: 100%;
49
80
  .use-var(width, steps-icon-width);
50
- .use-var(top, steps-tail-vertical-top);
51
- .use-var(padding, steps-tail-vertical-padding);
81
+ flex-direction: column;
52
82
 
53
- &:after {
54
- content: "";
55
- display: inline-block;
56
- height: 100%;
83
+ &::before,
84
+ &::after {
57
85
  .use-var(width, steps-tail-standard-size);
58
- .use-var(background, steps-tail-standard-background);
59
- .rem(border-radius, 2);
60
86
  }
87
+
88
+ &-align-start {
89
+ .use-var(top, steps-tail-vertical-top);
90
+ .use-var(padding, steps-tail-vertical-padding);
91
+
92
+ &::after {
93
+ content: "";
94
+ height: 100%;
95
+ .use-var(border-radius, steps-tail-border-radius);
96
+ }
97
+ }
98
+
99
+ &-align-center {
100
+ &::before,
101
+ &::after {
102
+ content: "";
103
+ height: 50%;
104
+ }
105
+ &::before {
106
+ .use-var(margin-bottom, steps-tail-vertical-gutter);
107
+ .use-var(border-bottom-left-radius, steps-tail-border-radius);
108
+ .use-var(border-bottom-right-radius, steps-tail-border-radius);
109
+ }
110
+ &::after {
111
+ .use-var(margin-top, steps-tail-vertical-gutter);
112
+ .use-var(border-top-left-radius, steps-tail-border-radius);
113
+ .use-var(border-top-right-radius, steps-tail-border-radius);
114
+ }
115
+ }
116
+ }
117
+
118
+ &::after,
119
+ &::before {
120
+ display: inline-block;
121
+ .use-var(background, steps-tail-standard-background);
61
122
  }
62
123
 
63
- .finish &:after {
124
+ &-status-finish::before,
125
+ &-status-finish::after,
126
+ &-align-center&-status-process::before,
127
+ &-align-center&-status-error::before {
64
128
  .use-var(background, steps-tail-finish-background);
65
129
  }
66
130
  }
@@ -110,7 +174,7 @@
110
174
  .use-var(font-size, steps-icon-num-font-size);
111
175
  .use-var(line-height, steps-icon-num-line-height);
112
176
  .use-var(color, steps-icon-num-color);
113
- .text-medium-var(steps-icon-num-color);
177
+ .text-medium();
114
178
 
115
179
  .process & {
116
180
  .use-var(color, steps-process-icon-num-color);
@@ -142,17 +206,21 @@
142
206
  }
143
207
 
144
208
  &-content {
145
- text-align: center;
146
209
 
147
210
  .horizontal & {
148
211
  .use-var(margin-top, steps-horizontal-content-margin-top);
212
+ &-align-center {
213
+ text-align: center;
214
+ }
149
215
  }
150
216
 
151
217
  .vertical & {
152
218
  .use-var(margin-left, steps-vertical-content-margin-left);
153
- text-align: left;
154
219
  flex: 1;
155
- .use-var(padding-bottom, steps-vertical-content-padding-bottom);
220
+
221
+ &-align-start {
222
+ .use-var(padding-bottom, steps-vertical-content-padding-bottom);
223
+ }
156
224
  }
157
225
  }
158
226
 
@@ -20,6 +20,11 @@ export interface StepProps {
20
20
  * @en Specify the step status. When this item is not input, the status will be automatically specified according to the current property of steps
21
21
  */
22
22
  status?: 'finish' | 'error' | 'wait' | 'process';
23
+ /**
24
+ * 指定对齐方式,不配置该项时,会跟随 Steps 的 align 属性值
25
+ * @en Specify the step alignment. When this item is not input, it will be automatically specified according to the align property of steps
26
+ */
27
+ align?: 'center' | 'start';
23
28
  }
24
29
  export interface StepsProps {
25
30
  /**
@@ -38,6 +43,13 @@ export interface StepsProps {
38
43
  * @default horizontal
39
44
  */
40
45
  direction?: 'vertical' | 'horizontal';
46
+ /**
47
+ * 步骤条对齐方式
48
+ * @en Step alignment
49
+ * @default direction="horizontal" 时默认为 "center",direction="vertical" 时默认为 "start"
50
+ * @default_en "center" when direction="horizontal" and "start" when direction="vertical"
51
+ */
52
+ align?: 'center' | 'start';
41
53
  /**
42
54
  * 指定当前步骤,从 0 开始记数。在子 Step 元素中,可以通过 status 属性覆盖状态,传入则受控
43
55
  * @en Specify the current step, counting from 0. In the step children elements, the status can be overwritten through the status, and it is controlled if it is input
@@ -67,6 +67,7 @@ var SwipeAction = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
67
67
 
68
68
  var dampRateRef = (0, _helpers.useLatestRef)(dampRate);
69
69
  var forbidClick = (0, _react.useRef)(false);
70
+ var scrollingRef = (0, _react.useRef)(null);
70
71
 
71
72
  var _useRefState = (0, _helpers.useRefState)(false),
72
73
  moving = _useRefState[0],
@@ -83,6 +84,7 @@ var SwipeAction = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
83
84
 
84
85
  var startRef = (0, _react.useRef)(0);
85
86
  var startX = (0, _react.useRef)(0);
87
+ var startY = (0, _react.useRef)(0);
86
88
  var slideX = (0, _react.useRef)(0);
87
89
  var isLayer = openStyleType === 'layer';
88
90
  var transitionStyle = (0, _react.useMemo)(function () {
@@ -93,6 +95,7 @@ var SwipeAction = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
93
95
 
94
96
  function resetMoveData() {
95
97
  startX.current = 0;
98
+ startY.current = 0;
96
99
  slideX.current = 0;
97
100
  }
98
101
 
@@ -104,19 +107,34 @@ var SwipeAction = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
104
107
  function touchstart(e) {
105
108
  startRef.current = offsetRef.current;
106
109
  resetMoveData();
110
+ scrollingRef.current = null;
107
111
  startX.current = e.touches[0].pageX;
112
+ startY.current = e.touches[0].pageY;
108
113
  }
109
114
 
110
115
  function touchmove(e) {
111
- e.preventDefault();
112
- slideX.current = e.touches[0].pageX - startX.current;
116
+ var x = e.changedTouches[0].pageX - startX.current;
117
+ var y = e.changedTouches[0].pageY - startY.current;
118
+
119
+ if (scrollingRef.current === null) {
120
+ scrollingRef.current = Math.abs(x) < Math.abs(y);
121
+ }
122
+
123
+ if (scrollingRef.current) {
124
+ setMoving(false);
125
+ setOffset(0);
126
+ return;
127
+ }
128
+
129
+ e.cancelable && e.preventDefault();
130
+ slideX.current = x;
113
131
  forbidClick.current = true;
114
132
  setMoving(true);
115
133
  setOffset(getMenuCurrentWidth(slideX.current + startRef.current, -rightMenuWidthRef.current, leftMenuWidthRef.current));
116
134
  }
117
135
 
118
136
  function touchend() {
119
- if (movingRef.current) {
137
+ if (movingRef.current && !scrollingRef.current) {
120
138
  var currentMenu = offsetRef.current > 0 ? 'left' : 'right';
121
139
  changeMenu(currentMenu);
122
140
  setMoving(false);
package/cjs/tabs/index.js CHANGED
@@ -143,7 +143,9 @@ var Tabs = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
143
143
  _props$translateZ = props.translateZ,
144
144
  translateZ = _props$translateZ === void 0 ? true : _props$translateZ,
145
145
  fullScreen = props.fullScreen,
146
- autoHeight = props.autoHeight;
146
+ autoHeight = props.autoHeight,
147
+ _props$tabBarStopProp = props.tabBarStopPropagation,
148
+ tabBarStopPropagation = _props$tabBarStopProp === void 0 ? true : _props$tabBarStopProp;
147
149
  var domRef = (0, _react.useRef)(null);
148
150
  var cellRef = (0, _react.useRef)(null);
149
151
  var paneRef = (0, _react.useRef)(null);
@@ -191,6 +193,7 @@ var Tabs = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
191
193
  var touchStoppedRef = (0, _react.useRef)(false);
192
194
  var changeFromRef = (0, _react.useRef)('');
193
195
  var touchMoveBarScrollRef = (0, _react.useRef)(false);
196
+ var system = (0, _helpers.useSystem)();
194
197
  var allPanes = getAllPanes();
195
198
  var tabDirection = ['top', 'bottom'].indexOf(tabBarPosition) !== -1 ? 'vertical' : 'horizontal';
196
199
  var canSwipe = mode === 'swipe' && !disabled && swipeable && tabDirection === 'vertical' && tabs.length > 1;
@@ -305,10 +308,10 @@ var Tabs = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
305
308
 
306
309
  var evt = e.changedTouches[0];
307
310
  var touchMoveX = evt.clientX || 0;
308
- var touchMoveY = evt.clientY || 0; // bugfix: 兼容safari在右滑返回上一页时clientX为负值的情况
311
+ var touchMoveY = evt.clientY || 0; // bugfix: 兼容safari在右滑返回上一页时clientX为负值的情况,安卓有折叠屏,触点会有超出屏幕(clientX < 0)的情况,因此这里限定ios系统
309
312
  // @en bugfix: bugfix: Compatible with the case in safari where clientX is negative when swiping right back to the previous page
310
313
 
311
- var posDisX = touchMoveX < 0 ? 0 : touchMoveX - touchStartXRef.current;
314
+ var posDisX = system === 'ios' && touchMoveX < 0 ? 0 : touchMoveX - touchStartXRef.current;
312
315
  var posDisY = touchMoveY - touchStartYRef.current;
313
316
  var absDisX = Math.abs(posDisX);
314
317
  var absDisY = Math.abs(posDisY);
@@ -497,7 +500,8 @@ var Tabs = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
497
500
  renderTabBarItem: renderTabBarItem,
498
501
  renderTabBarInner: renderTabBarInner,
499
502
  tabBarStyle: tabBarStyle,
500
- tabBarClass: tabBarClass
503
+ tabBarClass: tabBarClass,
504
+ tabBarStopPropagation: tabBarStopPropagation
501
505
  }, commonProps);
502
506
 
503
507
  var CellComp = /*#__PURE__*/_react.default.createElement(_tabCell.default, cellProps);
@@ -386,8 +386,8 @@
386
386
  .arco-tab-cell.vertical:not(.custom).line.active.system-android,
387
387
  .arco-tab-cell.vertical:not(.custom).line-divide.active.system-android {
388
388
  font-weight: 400;
389
- -webkit-text-stroke: 0.3PX #165dff;
390
- text-stroke: 0.3PX #165dff;
389
+ -webkit-text-stroke: 0.3PX currentColor;
390
+ text-stroke: 0.3PX currentColor;
391
391
  }
392
392
  .arco-tab-cell.vertical:not(.custom).card {
393
393
  color: #165dff ;
@@ -401,8 +401,8 @@
401
401
  .arco-tab-cell.vertical:not(.custom).card.active.android,
402
402
  .arco-tab-cell.vertical:not(.custom).card.active.system-android {
403
403
  font-weight: 400;
404
- -webkit-text-stroke: 0.3PX #ffffff;
405
- text-stroke: 0.3PX #ffffff;
404
+ -webkit-text-stroke: 0.3PX currentColor;
405
+ text-stroke: 0.3PX currentColor;
406
406
  }
407
407
  .arco-tab-cell.vertical:not(.custom).card:not(:last-child) {
408
408
  border-right: 1PX solid #165dff ;
@@ -444,8 +444,8 @@
444
444
  .arco-tab-cell.vertical:not(.custom).tag.active.system-android,
445
445
  .arco-tab-cell.vertical:not(.custom).tag-divide.active.system-android {
446
446
  font-weight: 400;
447
- -webkit-text-stroke: 0.3PX #ffffff;
448
- text-stroke: 0.3PX #ffffff;
447
+ -webkit-text-stroke: 0.3PX currentColor;
448
+ text-stroke: 0.3PX currentColor;
449
449
  }
450
450
  .arco-tab-cell.horizontal {
451
451
  height: 1.08rem ;
@@ -458,8 +458,8 @@
458
458
  .arco-tab-cell.horizontal.active.android,
459
459
  .arco-tab-cell.horizontal.active.system-android {
460
460
  font-weight: 400;
461
- -webkit-text-stroke: 0.3PX #165dff;
462
- text-stroke: 0.3PX #165dff;
461
+ -webkit-text-stroke: 0.3PX currentColor;
462
+ text-stroke: 0.3PX currentColor;
463
463
  }
464
464
  .arco-tab-pane-container.mode-swipe {
465
465
  display: -webkit-box;
@@ -322,7 +322,7 @@
322
322
  &.line-divide {
323
323
 
324
324
  &.active {
325
- .text-medium-var(tabs-tab-bar-line-active-color);
325
+ .text-medium();
326
326
  .use-var(color, tabs-tab-bar-line-active-color);
327
327
  }
328
328
  }
@@ -333,7 +333,7 @@
333
333
  &.active {
334
334
  .use-var(background, tabs-tab-bar-card-color);
335
335
  .use-var(color, tabs-tab-bar-card-text-color);
336
- .text-medium-var(tabs-tab-bar-card-text-color);
336
+ .text-medium();
337
337
  }
338
338
 
339
339
  &:not(:last-child) {
@@ -374,7 +374,7 @@
374
374
  &.active {
375
375
  .use-var(background, tabs-tab-bar-tag-active-background);
376
376
  .use-var(color, tabs-tab-bar-tag-active-text-color);
377
- .text-medium-var(tabs-tab-bar-tag-active-text-color);
377
+ .text-medium();
378
378
  }
379
379
  }
380
380
  }
@@ -384,7 +384,7 @@
384
384
  .use-var(height, tabs-tab-bar-horizontal-height);
385
385
 
386
386
  &.active {
387
- .text-medium-var(tabs-tab-bar-line-active-color);
387
+ .text-medium();
388
388
  .use-var(color, tabs-tab-bar-line-active-color);
389
389
  }
390
390
  }
@@ -64,7 +64,8 @@ var TabCell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
64
64
  renderTabBarInner = props.renderTabBarInner,
65
65
  tabBarStyle = props.tabBarStyle,
66
66
  tabBarClass = props.tabBarClass,
67
- translateZ = props.translateZ;
67
+ translateZ = props.translateZ,
68
+ tabBarStopPropagation = props.tabBarStopPropagation;
68
69
  var prefix = prefixCls + "-tab-cell";
69
70
  var domRef = (0, _react.useRef)(null);
70
71
  var underlineRef = (0, _react.useRef)(null);
@@ -156,13 +157,13 @@ var TabCell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
156
157
  return e.stopPropagation();
157
158
  };
158
159
 
159
- if (isVertical && hasOverflow && domRef.current) {
160
+ if (isVertical && hasOverflow && domRef.current && tabBarStopPropagation) {
160
161
  domRef.current.addEventListener('touchstart', stopFunc);
161
162
  domRef.current.addEventListener('touchmove', stopFunc);
162
163
  }
163
164
 
164
165
  return function () {
165
- if (isVertical && hasOverflow && domRef.current) {
166
+ if (isVertical && hasOverflow && domRef.current && tabBarStopPropagation) {
166
167
  domRef.current.removeEventListener('touchstart', stopFunc);
167
168
  domRef.current.removeEventListener('touchmove', stopFunc);
168
169
  }
@@ -421,6 +421,12 @@ export interface TabsProps {
421
421
  * @en Tabbar underline inner style, applied to tab-cell-underline-inner
422
422
  */
423
423
  underlineInnerStyle?: React.CSSProperties;
424
+ /**
425
+ * 当前 TabBar 的触摸事件是否需要 stopPropagation
426
+ * @en Does the touch event of the current TabBar require stopPropagation
427
+ * @default true
428
+ */
429
+ tabBarStopPropagation?: boolean;
424
430
  }
425
431
  export interface TabsRef {
426
432
  /**
@@ -510,6 +516,11 @@ export interface TabCellProps extends Pick<TabsProps, 'tabs' | 'type' | 'onTabCl
510
516
  * @en The distance the underline has been swiped
511
517
  */
512
518
  jumpingDis: number;
519
+ /**
520
+ * 当前 TabBar 的触摸事件是否需要 stopPropagation
521
+ * @en Does the touch event of the current TabBar require stopPropagation
522
+ */
523
+ tabBarStopPropagation: boolean;
513
524
  }
514
525
  export interface TabCellRef {
515
526
  /**
@@ -7,12 +7,10 @@ exports.toast = toast;
7
7
 
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
 
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _reactDom = _interopRequireDefault(require("react-dom"));
13
-
14
10
  var _mobileUtils = require("@arco-design/mobile-utils");
15
11
 
12
+ var _render = require("../_helpers/render");
13
+
16
14
  function toast(Component, type) {
17
15
  return function (originConfig) {
18
16
  var config = typeof originConfig === 'string' ? {
@@ -28,17 +26,16 @@ function toast(Component, type) {
28
26
  var div = document.createElement('div');
29
27
  document.body.appendChild(div);
30
28
 
31
- function render(props) {
32
- _reactDom.default.render( /*#__PURE__*/_react.default.createElement(Component, props), div);
33
- }
29
+ var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
30
+ render = _ReactDOMRender.render,
31
+ unmount = _ReactDOMRender.unmount;
34
32
 
35
- function destory() {
33
+ function destroy() {
36
34
  var onClose = config.onClose;
37
35
  onClose && onClose();
36
+ unmount();
38
37
 
39
- var unmountResult = _reactDom.default.unmountComponentAtNode(div);
40
-
41
- if (unmountResult && div.parentNode) {
38
+ if (div.parentNode) {
42
39
  div.parentNode.removeChild(div);
43
40
  }
44
41
  }
@@ -48,7 +45,7 @@ function toast(Component, type) {
48
45
  getContainer: function getContainer() {
49
46
  return div;
50
47
  },
51
- onClose: destory,
48
+ onClose: destroy,
52
49
  visible: false
53
50
  });
54
51
  var leaving = false;