@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
@@ -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
@@ -51,6 +51,7 @@ var SwipeAction = /*#__PURE__*/forwardRef(function (props, ref) {
51
51
 
52
52
  var dampRateRef = useLatestRef(dampRate);
53
53
  var forbidClick = useRef(false);
54
+ var scrollingRef = useRef(null);
54
55
 
55
56
  var _useRefState = useRefState(false),
56
57
  moving = _useRefState[0],
@@ -67,6 +68,7 @@ var SwipeAction = /*#__PURE__*/forwardRef(function (props, ref) {
67
68
 
68
69
  var startRef = useRef(0);
69
70
  var startX = useRef(0);
71
+ var startY = useRef(0);
70
72
  var slideX = useRef(0);
71
73
  var isLayer = openStyleType === 'layer';
72
74
  var transitionStyle = useMemo(function () {
@@ -77,6 +79,7 @@ var SwipeAction = /*#__PURE__*/forwardRef(function (props, ref) {
77
79
 
78
80
  function resetMoveData() {
79
81
  startX.current = 0;
82
+ startY.current = 0;
80
83
  slideX.current = 0;
81
84
  }
82
85
 
@@ -88,19 +91,34 @@ var SwipeAction = /*#__PURE__*/forwardRef(function (props, ref) {
88
91
  function touchstart(e) {
89
92
  startRef.current = offsetRef.current;
90
93
  resetMoveData();
94
+ scrollingRef.current = null;
91
95
  startX.current = e.touches[0].pageX;
96
+ startY.current = e.touches[0].pageY;
92
97
  }
93
98
 
94
99
  function touchmove(e) {
95
- e.preventDefault();
96
- slideX.current = e.touches[0].pageX - startX.current;
100
+ var x = e.changedTouches[0].pageX - startX.current;
101
+ var y = e.changedTouches[0].pageY - startY.current;
102
+
103
+ if (scrollingRef.current === null) {
104
+ scrollingRef.current = Math.abs(x) < Math.abs(y);
105
+ }
106
+
107
+ if (scrollingRef.current) {
108
+ setMoving(false);
109
+ setOffset(0);
110
+ return;
111
+ }
112
+
113
+ e.cancelable && e.preventDefault();
114
+ slideX.current = x;
97
115
  forbidClick.current = true;
98
116
  setMoving(true);
99
117
  setOffset(getMenuCurrentWidth(slideX.current + startRef.current, -rightMenuWidthRef.current, leftMenuWidthRef.current));
100
118
  }
101
119
 
102
120
  function touchend() {
103
- if (movingRef.current) {
121
+ if (movingRef.current && !scrollingRef.current) {
104
122
  var currentMenu = offsetRef.current > 0 ? 'left' : 'right';
105
123
  changeMenu(currentMenu);
106
124
  setMoving(false);
package/esm/tabs/index.js CHANGED
@@ -4,7 +4,7 @@ import { cls, nextTick } from '@arco-design/mobile-utils';
4
4
  import { ContextLayout } from '../context-provider';
5
5
  import TabCell from './tab-cell';
6
6
  import TabPane from './tab-pane';
7
- import { useRefState, useListenResize, useUpdateEffect, useSwiperInnerScroll } from '../_helpers';
7
+ import { useRefState, useListenResize, useUpdateEffect, useSwiperInnerScroll, useSystem } from '../_helpers';
8
8
  export * from './type';
9
9
  /**
10
10
  * 用于让用户在不同的视图中进行切换。为优化移动端渲染性能,如有替换DOM、发请求更新数据等操作,请在`onAfterChange`而非`onChange`回调中进行。
@@ -117,7 +117,9 @@ var Tabs = /*#__PURE__*/forwardRef(function (props, ref) {
117
117
  _props$translateZ = props.translateZ,
118
118
  translateZ = _props$translateZ === void 0 ? true : _props$translateZ,
119
119
  fullScreen = props.fullScreen,
120
- autoHeight = props.autoHeight;
120
+ autoHeight = props.autoHeight,
121
+ _props$tabBarStopProp = props.tabBarStopPropagation,
122
+ tabBarStopPropagation = _props$tabBarStopProp === void 0 ? true : _props$tabBarStopProp;
121
123
  var domRef = useRef(null);
122
124
  var cellRef = useRef(null);
123
125
  var paneRef = useRef(null);
@@ -165,6 +167,7 @@ var Tabs = /*#__PURE__*/forwardRef(function (props, ref) {
165
167
  var touchStoppedRef = useRef(false);
166
168
  var changeFromRef = useRef('');
167
169
  var touchMoveBarScrollRef = useRef(false);
170
+ var system = useSystem();
168
171
  var allPanes = getAllPanes();
169
172
  var tabDirection = ['top', 'bottom'].indexOf(tabBarPosition) !== -1 ? 'vertical' : 'horizontal';
170
173
  var canSwipe = mode === 'swipe' && !disabled && swipeable && tabDirection === 'vertical' && tabs.length > 1;
@@ -279,10 +282,10 @@ var Tabs = /*#__PURE__*/forwardRef(function (props, ref) {
279
282
 
280
283
  var evt = e.changedTouches[0];
281
284
  var touchMoveX = evt.clientX || 0;
282
- var touchMoveY = evt.clientY || 0; // bugfix: 兼容safari在右滑返回上一页时clientX为负值的情况
285
+ var touchMoveY = evt.clientY || 0; // bugfix: 兼容safari在右滑返回上一页时clientX为负值的情况,安卓有折叠屏,触点会有超出屏幕(clientX < 0)的情况,因此这里限定ios系统
283
286
  // @en bugfix: bugfix: Compatible with the case in safari where clientX is negative when swiping right back to the previous page
284
287
 
285
- var posDisX = touchMoveX < 0 ? 0 : touchMoveX - touchStartXRef.current;
288
+ var posDisX = system === 'ios' && touchMoveX < 0 ? 0 : touchMoveX - touchStartXRef.current;
286
289
  var posDisY = touchMoveY - touchStartYRef.current;
287
290
  var absDisX = Math.abs(posDisX);
288
291
  var absDisY = Math.abs(posDisY);
@@ -472,7 +475,8 @@ var Tabs = /*#__PURE__*/forwardRef(function (props, ref) {
472
475
  renderTabBarItem: renderTabBarItem,
473
476
  renderTabBarInner: renderTabBarInner,
474
477
  tabBarStyle: tabBarStyle,
475
- tabBarClass: tabBarClass
478
+ tabBarClass: tabBarClass,
479
+ tabBarStopPropagation: tabBarStopPropagation
476
480
  }, commonProps);
477
481
 
478
482
  var CellComp = /*#__PURE__*/React.createElement(TabCell, 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
  }
@@ -48,7 +48,8 @@ var TabCell = /*#__PURE__*/forwardRef(function (props, ref) {
48
48
  renderTabBarInner = props.renderTabBarInner,
49
49
  tabBarStyle = props.tabBarStyle,
50
50
  tabBarClass = props.tabBarClass,
51
- translateZ = props.translateZ;
51
+ translateZ = props.translateZ,
52
+ tabBarStopPropagation = props.tabBarStopPropagation;
52
53
  var prefix = prefixCls + "-tab-cell";
53
54
  var domRef = useRef(null);
54
55
  var underlineRef = useRef(null);
@@ -140,13 +141,13 @@ var TabCell = /*#__PURE__*/forwardRef(function (props, ref) {
140
141
  return e.stopPropagation();
141
142
  };
142
143
 
143
- if (isVertical && hasOverflow && domRef.current) {
144
+ if (isVertical && hasOverflow && domRef.current && tabBarStopPropagation) {
144
145
  domRef.current.addEventListener('touchstart', stopFunc);
145
146
  domRef.current.addEventListener('touchmove', stopFunc);
146
147
  }
147
148
 
148
149
  return function () {
149
- if (isVertical && hasOverflow && domRef.current) {
150
+ if (isVertical && hasOverflow && domRef.current && tabBarStopPropagation) {
150
151
  domRef.current.removeEventListener('touchstart', stopFunc);
151
152
  domRef.current.removeEventListener('touchmove', stopFunc);
152
153
  }
@@ -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
  /**
@@ -1,7 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import ReactDOM from 'react-dom';
4
2
  import { nextTick } from '@arco-design/mobile-utils';
3
+ import { ReactDOMRender } from '../_helpers/render';
5
4
  export function toast(Component, type) {
6
5
  return function (originConfig) {
7
6
  var config = typeof originConfig === 'string' ? {
@@ -17,16 +16,16 @@ export function toast(Component, type) {
17
16
  var div = document.createElement('div');
18
17
  document.body.appendChild(div);
19
18
 
20
- function render(props) {
21
- ReactDOM.render( /*#__PURE__*/React.createElement(Component, props), div);
22
- }
19
+ var _ReactDOMRender = new ReactDOMRender(Component, div),
20
+ render = _ReactDOMRender.render,
21
+ unmount = _ReactDOMRender.unmount;
23
22
 
24
- function destory() {
23
+ function destroy() {
25
24
  var onClose = config.onClose;
26
25
  onClose && onClose();
27
- var unmountResult = ReactDOM.unmountComponentAtNode(div);
26
+ unmount();
28
27
 
29
- if (unmountResult && div.parentNode) {
28
+ if (div.parentNode) {
30
29
  div.parentNode.removeChild(div);
31
30
  }
32
31
  }
@@ -36,7 +35,7 @@ export function toast(Component, type) {
36
35
  getContainer: function getContainer() {
37
36
  return div;
38
37
  },
39
- onClose: destory,
38
+ onClose: destroy,
40
39
  visible: false
41
40
  });
42
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arco-design/mobile-react",
3
- "version": "2.21.3",
3
+ "version": "2.22.2",
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.12.3",
18
+ "@arco-design/mobile-utils": "^2.12.6",
19
19
  "@arco-design/transformable": "^1.0.0",
20
20
  "es6-promise": "^4.2.8",
21
21
  "lodash.throttle": "^4.1.1",
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "12927a2cee1ac841f4e96754c72e6cd95633e68a"
39
+ "gitHead": "52a29775d16e5e7d2b7645086644cf03aac6d71f"
40
40
  }
@@ -517,9 +517,13 @@
517
517
  --notify-font-size: ~`pxtorem(14)`;
518
518
  --notify-min-height: ~`pxtorem(36)`;
519
519
  --steps-padding: ~`pxtorem(16)` 0;
520
- --steps-tail-horizontal-padding: 0 ~`pxtorem(18)`;
521
- --steps-tail-vertical-padding: ~`pxtorem(14)` 0;
522
- --steps-tail-vertical-top: ~`pxtorem(9)`;
520
+ --steps-tail-border-radius: 2PX;
521
+ --steps-tail-horizontal-gutter: 18PX;
522
+ --steps-tail-vertical-gutter: 14PX;
523
+ --steps-tail-horizontal-padding: 0 var(--steps-tail-horizontal-gutter);
524
+ --steps-tail-vertical-padding: var(--steps-tail-vertical-gutter) 0;
525
+ --steps-tail-horizontal-left: 9PX;
526
+ --steps-tail-vertical-top: 9PX;
523
527
  --steps-tail-standard-size: 1PX;
524
528
  --steps-tail-standard-background: var(--line-color);
525
529
  --steps-tail-finish-background: var(--primary-color);
@@ -516,8 +516,12 @@ export interface ArcodesignToken extends Record<string, string> {
516
516
  'notify-font-size': string;
517
517
  'notify-min-height': string;
518
518
  'steps-padding': string;
519
+ 'steps-tail-border-radius': string;
520
+ 'steps-tail-horizontal-gutter': string;
521
+ 'steps-tail-vertical-gutter': string;
519
522
  'steps-tail-horizontal-padding': string;
520
523
  'steps-tail-vertical-padding': string;
524
+ 'steps-tail-horizontal-left': string;
521
525
  'steps-tail-vertical-top': string;
522
526
  'steps-tail-standard-size': string;
523
527
  'steps-tail-standard-background': string;
@@ -528,9 +528,13 @@ var tokens = {
528
528
  "notify-font-size": "0.28rem",
529
529
  "notify-min-height": "0.72rem",
530
530
  "steps-padding": "0.32rem 0",
531
- "steps-tail-horizontal-padding": "0 0.36rem",
532
- "steps-tail-vertical-padding": "0.28rem 0",
533
- "steps-tail-vertical-top": "0.18rem",
531
+ "steps-tail-border-radius": "2PX",
532
+ "steps-tail-horizontal-gutter": "18PX",
533
+ "steps-tail-vertical-gutter": "14PX",
534
+ "steps-tail-horizontal-padding": "0 18PX",
535
+ "steps-tail-vertical-padding": "14PX 0",
536
+ "steps-tail-horizontal-left": "9PX",
537
+ "steps-tail-vertical-top": "9PX",
534
538
  "steps-tail-standard-size": "1PX",
535
539
  "steps-tail-standard-background": "#e5e6eb",
536
540
  "steps-tail-finish-background": "#165dff",
@@ -6527,6 +6527,18 @@
6527
6527
  "en": "Custom icon color of Steps in processing state"
6528
6528
  }
6529
6529
  },
6530
+ "stepsTailBorderRadius": {
6531
+ "cssKey": "steps-tail-border-radius",
6532
+ "desc": "steps 分割线圆角值",
6533
+ "override": "",
6534
+ "value": "2PX",
6535
+ "jsValue": "2PX",
6536
+ "staticValue": "2PX",
6537
+ "localeDesc": {
6538
+ "ch": "steps 分割线圆角值",
6539
+ "en": "Border radius of steps dividing"
6540
+ }
6541
+ },
6530
6542
  "stepsTailFinishBackground": {
6531
6543
  "cssKey": "steps-tail-finish-background",
6532
6544
  "desc": "steps 步骤分割线完成态颜色",
@@ -6539,13 +6551,37 @@
6539
6551
  "en": "Steps dividing line color in finish state"
6540
6552
  }
6541
6553
  },
6554
+ "stepsTailHorizontalGutter": {
6555
+ "cssKey": "steps-tail-horizontal-gutter",
6556
+ "desc": "steps 水平分割线与图标中心点的距离",
6557
+ "override": "",
6558
+ "value": "18PX",
6559
+ "jsValue": "18PX",
6560
+ "staticValue": "18PX",
6561
+ "localeDesc": {
6562
+ "ch": "steps 水平分割线与图标中心点的距离",
6563
+ "en": "The distance between the horizontal dividing line and the center point of the icon"
6564
+ }
6565
+ },
6566
+ "stepsTailHorizontalLeft": {
6567
+ "cssKey": "steps-tail-horizontal-left",
6568
+ "desc": "steps 水平分割线的向右偏移距离,一般是 stepsIconHeight 值的一半",
6569
+ "override": "",
6570
+ "value": "9PX",
6571
+ "jsValue": "9PX",
6572
+ "staticValue": "9PX",
6573
+ "localeDesc": {
6574
+ "ch": "steps 水平分割线的向右偏移距离,一般是 stepsIconHeight 值的一半",
6575
+ "en": "The offset distance to the right of the horizontal dividing line of steps, generally half the value of stepsIconHeight"
6576
+ }
6577
+ },
6542
6578
  "stepsTailHorizontalPadding": {
6543
6579
  "cssKey": "steps-tail-horizontal-padding",
6544
6580
  "desc": "steps 水平分割线左右间距",
6545
6581
  "override": "",
6546
- "value": "0 ~`pxtorem(18)`",
6547
- "jsValue": "0 @getRem@18",
6548
- "staticValue": "0 0.36rem",
6582
+ "value": "0 @steps-tail-horizontal-gutter",
6583
+ "jsValue": "0 @global@stepsTailHorizontalGutter",
6584
+ "staticValue": "0 18PX",
6549
6585
  "localeDesc": {
6550
6586
  "ch": "steps 水平分割线左右间距",
6551
6587
  "en": "Left and right spacing of the horizontal dividing line of Steps"
@@ -6575,13 +6611,25 @@
6575
6611
  "en": "Steps dividing line thickness"
6576
6612
  }
6577
6613
  },
6614
+ "stepsTailVerticalGutter": {
6615
+ "cssKey": "steps-tail-vertical-gutter",
6616
+ "desc": "steps 垂直分割线与图标中心点的距离",
6617
+ "override": "",
6618
+ "value": "14PX",
6619
+ "jsValue": "14PX",
6620
+ "staticValue": "14PX",
6621
+ "localeDesc": {
6622
+ "ch": "steps 垂直分割线与图标中心点的距离",
6623
+ "en": "The distance between the vertical dividing line and the center point of the icon"
6624
+ }
6625
+ },
6578
6626
  "stepsTailVerticalPadding": {
6579
6627
  "cssKey": "steps-tail-vertical-padding",
6580
6628
  "desc": "steps 垂直分割线上下间距",
6581
6629
  "override": "",
6582
- "value": "~`pxtorem(14)` 0",
6583
- "jsValue": "@getRem@14 0",
6584
- "staticValue": "0.28rem 0",
6630
+ "value": "@steps-tail-vertical-gutter 0",
6631
+ "jsValue": "@global@stepsTailVerticalGutter 0",
6632
+ "staticValue": "14PX 0",
6585
6633
  "localeDesc": {
6586
6634
  "ch": "steps 垂直分割线上下间距",
6587
6635
  "en": "Left and right spacing of the vertical dividing line of Steps"
@@ -6591,12 +6639,12 @@
6591
6639
  "cssKey": "steps-tail-vertical-top",
6592
6640
  "desc": "steps 垂直分割线的向下偏移距离,一般是 stepsIconHeight 值的一半",
6593
6641
  "override": "",
6594
- "value": "~`pxtorem(9)`",
6595
- "jsValue": "@getRem@9",
6596
- "staticValue": "0.18rem",
6642
+ "value": "9PX",
6643
+ "jsValue": "9PX",
6644
+ "staticValue": "9PX",
6597
6645
  "localeDesc": {
6598
6646
  "ch": "steps 垂直分割线的向下偏移距离,一般是 stepsIconHeight 值的一半",
6599
- "en": "Left and right spacing of the vertical dividing line of Steps"
6647
+ "en": "The offset distance to the bottom of the vertical dividing line of steps, generally half the value of stepsIconHeight"
6600
6648
  }
6601
6649
  },
6602
6650
  "stepsTitleFontSize": {