@arco-design/mobile-react 2.30.7 → 2.30.9

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 (41) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/render.d.ts +6 -1
  5. package/cjs/_helpers/render.js +24 -2
  6. package/cjs/ellipsis/components/js-ellipsis.js +5 -2
  7. package/cjs/image/style/index.less +2 -4
  8. package/cjs/image-preview/methods.js +2 -7
  9. package/cjs/masking/methods.js +12 -6
  10. package/cjs/skeleton/type.d.ts +1 -0
  11. package/cjs/swipe-load/index.js +24 -19
  12. package/cjs/swipe-load/style/css/index.css +4 -0
  13. package/cjs/swipe-load/style/index.less +1 -1
  14. package/cjs/tabs/index.js +2 -1
  15. package/dist/index.js +310 -223
  16. package/dist/index.min.js +5 -5
  17. package/dist/style.css +4 -0
  18. package/dist/style.min.css +1 -1
  19. package/esm/_helpers/render.d.ts +6 -1
  20. package/esm/_helpers/render.js +21 -1
  21. package/esm/ellipsis/components/js-ellipsis.js +4 -2
  22. package/esm/image/style/index.less +2 -4
  23. package/esm/image-preview/methods.js +2 -7
  24. package/esm/masking/methods.js +13 -7
  25. package/esm/skeleton/type.d.ts +1 -0
  26. package/esm/swipe-load/index.js +24 -19
  27. package/esm/swipe-load/style/css/index.css +4 -0
  28. package/esm/swipe-load/style/index.less +1 -1
  29. package/esm/tabs/index.js +2 -1
  30. package/package.json +3 -3
  31. package/umd/_helpers/render.d.ts +6 -1
  32. package/umd/_helpers/render.js +23 -2
  33. package/umd/ellipsis/components/js-ellipsis.js +7 -6
  34. package/umd/image/style/index.less +2 -4
  35. package/umd/image-preview/methods.js +2 -7
  36. package/umd/masking/methods.js +12 -6
  37. package/umd/skeleton/type.d.ts +1 -0
  38. package/umd/swipe-load/index.js +24 -19
  39. package/umd/swipe-load/style/css/index.css +4 -0
  40. package/umd/swipe-load/style/index.less +1 -1
  41. package/umd/tabs/index.js +2 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,32 @@
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.30.9](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.30.8...@arco-design/mobile-react@2.30.9) (2024-02-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * export type from `Skeleton` ([#233](https://github.com/arco-design/arco-design-mobile/issues/233)) ([7514ed9](https://github.com/arco-design/arco-design-mobile/commit/7514ed9baceccaf8f46c90b046bfe06594a66a59))
12
+ * warning for repeatedly calling createRoot in react18 of masking related components ([#231](https://github.com/arco-design/arco-design-mobile/issues/231)) ([6879ad7](https://github.com/arco-design/arco-design-mobile/commit/6879ad7f6225128b87bbf82aad34ba5836d4ac18))
13
+
14
+
15
+
16
+
17
+
18
+ ## [2.30.8](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.30.7...@arco-design/mobile-react@2.30.8) (2024-01-31)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * `SwipeLoad` supports RTL ([#225](https://github.com/arco-design/arco-design-mobile/issues/225)) ([e39d09e](https://github.com/arco-design/arco-design-mobile/commit/e39d09e69c72c6e3ca65addabd1d90d96ac91eb1))
24
+ * `Ellipsis` optimize line height caculation ([#227](https://github.com/arco-design/arco-design-mobile/issues/227)) ([c791a8e](https://github.com/arco-design/arco-design-mobile/commit/c791a8e36309ce4887297fe711348f427e12954d))
25
+ * `Ellipsis` use ellipsisValueRef to reduce reflow ([#226](https://github.com/arco-design/arco-design-mobile/issues/226)) ([cbb761f](https://github.com/arco-design/arco-design-mobile/commit/cbb761fd05788e3cf191c94fd5870474e990cfa1))
26
+ * `Tabs` trigger "onChange" before distance is set to 0 ([#223](https://github.com/arco-design/arco-design-mobile/issues/223)) ([0f91c5b](https://github.com/arco-design/arco-design-mobile/commit/0f91c5b8e77d1b4688b47d3fd68e231ad964b214))
27
+
28
+
29
+
30
+
31
+
6
32
  ## [2.30.7](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.30.6...@arco-design/mobile-react@2.30.7) (2023-12-27)
7
33
 
8
34
 
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.30.6/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.30.6/dist/index.min.js"></script>
62
+ <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.30.8/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.30.8/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.30.6/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.30.6/dist/index.min.js"></script>
62
+ <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.30.8/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.30.8/dist/index.min.js"></script>
64
64
  ```
65
65
 
66
66
  ## 引入全部
@@ -1,12 +1,17 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { RootType } from './react-dom';
3
3
  import { GlobalContextParams } from '../context-provider';
4
+ export declare const renderRootCache: Record<string, RootType | undefined>;
4
5
  export declare class ReactDOMRender {
5
6
  root: RootType | undefined;
6
7
  app: FunctionComponent;
7
8
  container: Element | DocumentFragment;
8
9
  context: GlobalContextParams | undefined;
9
- constructor(app: FunctionComponent, container: Element | DocumentFragment, context?: GlobalContextParams);
10
+ rootCacheId: string | undefined;
11
+ constructor(app: FunctionComponent, container: Element | DocumentFragment, context?: GlobalContextParams, rootCacheId?: string, // root id in cache
12
+ root?: RootType);
10
13
  render: (props: any) => void;
14
+ setRootCache: () => void;
15
+ clearRootCache: () => void;
11
16
  unmount: () => void;
12
17
  }
@@ -3,7 +3,7 @@
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
5
  exports.__esModule = true;
6
- exports.ReactDOMRender = void 0;
6
+ exports.renderRootCache = exports.ReactDOMRender = void 0;
7
7
 
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
 
@@ -11,13 +11,19 @@ var _react = _interopRequireDefault(require("react"));
11
11
 
12
12
  var _reactDom = require("./react-dom");
13
13
 
14
- var ReactDOMRender = function ReactDOMRender(app, container, context) {
14
+ var renderRootCache = {};
15
+ exports.renderRootCache = renderRootCache;
16
+
17
+ var ReactDOMRender = function ReactDOMRender(app, container, context, rootCacheId, // root id in cache
18
+ root // use root in cache
19
+ ) {
15
20
  var _this = this;
16
21
 
17
22
  this.root = void 0;
18
23
  this.app = void 0;
19
24
  this.container = void 0;
20
25
  this.context = void 0;
26
+ this.rootCacheId = void 0;
21
27
 
22
28
  this.render = function (props) {
23
29
  var CustomApp = _this.app;
@@ -32,16 +38,32 @@ var ReactDOMRender = function ReactDOMRender(app, container, context) {
32
38
  }
33
39
  };
34
40
 
41
+ this.setRootCache = function () {
42
+ if (_this.rootCacheId) {
43
+ renderRootCache[_this.rootCacheId] = _this.root;
44
+ }
45
+ };
46
+
47
+ this.clearRootCache = function () {
48
+ if (_this.rootCacheId) {
49
+ delete renderRootCache[_this.rootCacheId];
50
+ }
51
+ };
52
+
35
53
  this.unmount = function () {
36
54
  var _this$root;
37
55
 
38
56
  (_this$root = _this.root) == null ? void 0 : _this$root._unmount();
39
57
  _this.root = undefined;
58
+
59
+ _this.clearRootCache();
40
60
  };
41
61
 
42
62
  this.app = app;
43
63
  this.container = container;
44
64
  this.context = context;
65
+ this.rootCacheId = rootCacheId;
66
+ this.root = root;
45
67
  };
46
68
 
47
69
  exports.ReactDOMRender = ReactDOMRender;
@@ -11,6 +11,8 @@ var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-po
11
11
 
12
12
  var _dom = require("../utils/dom");
13
13
 
14
+ var _helpers = require("../../_helpers");
15
+
14
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
17
 
16
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -34,10 +36,11 @@ var JsEllipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
34
36
  var domRef = (0, _react.useRef)(null);
35
37
  var textRef = (0, _react.useRef)(null);
36
38
  var ellipsisRef = (0, _react.useRef)(null);
39
+ var ellipsisValueRef = (0, _helpers.useLatestRef)(ellipsis);
37
40
  var lineHeightRef = (0, _react.useRef)(0);
38
41
  var setCurLineHeight = (0, _react.useCallback)(function () {
39
42
  if (domRef.current) {
40
- lineHeightRef.current = (0, _dom.getLineHeight)(domRef.current);
43
+ lineHeightRef.current = Math.round((0, _dom.getLineHeight)(domRef.current));
41
44
  }
42
45
  }, []);
43
46
  (0, _react.useEffect)(function () {
@@ -163,7 +166,7 @@ var JsEllipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
163
166
  textRef.current.innerText = text;
164
167
  }
165
168
 
166
- if (!ellipsis) {
169
+ if (!ellipsisValueRef.current) {
167
170
  return;
168
171
  }
169
172
 
@@ -1,11 +1,11 @@
1
- @import "../../../style/mixin.less";
1
+ @import '../../../style/mixin.less';
2
2
 
3
3
  .@{prefix}-image {
4
4
  display: inline-block;
5
5
  position: relative;
6
6
 
7
7
  &.preview {
8
- transition: all .3s ease-in-out;
8
+ transition: all 0.3s ease-in-out;
9
9
 
10
10
  .image-container,
11
11
  .image-loading-container .image-loading,
@@ -109,7 +109,6 @@
109
109
  }
110
110
 
111
111
  .image-error-container {
112
-
113
112
  .image-retry-load {
114
113
  position: absolute;
115
114
  top: 0;
@@ -127,7 +126,6 @@
127
126
  }
128
127
 
129
128
  .image-loading-container {
130
-
131
129
  .image-loading {
132
130
  position: absolute;
133
131
  top: 0;
@@ -13,9 +13,7 @@ var _render = require("../_helpers/render");
13
13
 
14
14
  function open(Component) {
15
15
  return function (config, context) {
16
- var baseProps = (0, _extends2.default)({
17
- unmountOnExit: true
18
- }, config || {}, {
16
+ var baseProps = (0, _extends2.default)({}, config || {}, {
19
17
  close: function close() {}
20
18
  }); // 不同的key用不同的容器挂载
21
19
  // @en Different keys are mounted in different containers
@@ -51,10 +49,7 @@ function open(Component) {
51
49
 
52
50
  dynamicProps.onClose = function () {
53
51
  baseProps.onClose && baseProps.onClose();
54
-
55
- if (baseProps.unmountOnExit) {
56
- (0, _mobileUtils.removeElement)(div);
57
- }
52
+ (0, _mobileUtils.removeElement)(div);
58
53
  };
59
54
 
60
55
  dynamicProps.openIndex = -1;
@@ -28,14 +28,14 @@ function getOpenMethod(Component, containerId, normalize) {
28
28
  }); // 不同的key用不同的容器挂载
29
29
 
30
30
  var id = "_" + (containerId || 'ARCO_MASKING') + "_DIV_" + (config.key || '') + "_";
31
-
32
- var _appendElementById = (0, _mobileUtils.appendElementById)(id, baseProps.getContainer),
33
- div = _appendElementById.child;
34
-
31
+ var existedDiv = baseProps.unmountOnExit ? null : document.getElementById(id);
32
+ var div = existedDiv || (0, _mobileUtils.appendElementById)(id, baseProps.getContainer).child;
35
33
  var leaving = false;
36
34
 
37
- var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
38
- render = _ReactDOMRender.render;
35
+ var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context, id, existedDiv ? _render.renderRootCache[id] : undefined),
36
+ render = _ReactDOMRender.render,
37
+ unmount = _ReactDOMRender.unmount,
38
+ setRootCache = _ReactDOMRender.setRootCache;
39
39
 
40
40
  var dynamicProps = (0, _extends2.default)({}, baseProps, {
41
41
  getContainer: function getContainer() {
@@ -60,11 +60,17 @@ function getOpenMethod(Component, containerId, normalize) {
60
60
  baseProps.onClose && baseProps.onClose(scene);
61
61
 
62
62
  if (baseProps.unmountOnExit) {
63
+ unmount();
63
64
  (0, _mobileUtils.removeElement)(div);
64
65
  }
65
66
  };
66
67
 
67
68
  render(dynamicProps);
69
+
70
+ if (!baseProps.unmountOnExit) {
71
+ setRootCache();
72
+ }
73
+
68
74
  (0, _mobileUtils.nextTick)(function () {
69
75
  if (leaving) return;
70
76
  dynamicProps.visible = true;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { BaseProps, SimpleBaseProps } from '../_helpers';
3
+ export type { BaseProps, SimpleBaseProps };
3
4
  export interface SkeletonProps extends SimpleBaseProps {
4
5
  /**
5
6
  * 是否显示标题占位图
@@ -78,7 +78,8 @@ var SwipeLoad = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
78
78
 
79
79
  var _useContext = (0, _react.useContext)(_contextProvider.GlobalContext),
80
80
  _useContext$locale = _useContext.locale,
81
- locale = _useContext$locale === void 0 ? _mobileUtils.defaultLocale : _useContext$locale;
81
+ locale = _useContext$locale === void 0 ? _mobileUtils.defaultLocale : _useContext$locale,
82
+ useRtl = _useContext.useRtl;
82
83
 
83
84
  var _useState = (0, _react.useState)(disabled),
84
85
  disableState = _useState[0],
@@ -160,16 +161,20 @@ var SwipeLoad = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
160
161
  // 判断元素是否属于滚动元素 先置为1 之后变成0表示非滚动容器
161
162
  // @en Determine whether the element belongs to a scrolling element. Set it to 1 and then change to 0 to indicate a non-scrolling container
162
163
  if (!scrollContainer.scrollLeft) {
163
- scrollContainer.scrollLeft = 1;
164
+ scrollContainer.scrollLeft = useRtl ? -1 : 1;
164
165
  }
165
166
 
166
167
  endX = e.touches[0].clientX || 0;
167
168
  var diff = endX - startX;
168
169
  offsetRef.current = diff;
169
- var labelDiff = (0, _mobileUtils.fingerDisToLabelDis)(Math.abs(diff), damping); // 滑动到最左侧,处理回弹效果
170
+ var labelDiff = (0, _mobileUtils.fingerDisToLabelDis)(Math.abs(diff), damping); // 判断是否是滚动到列表开始方向,ltr模式下是向左滚动,rtl模式下是向右滚动
171
+
172
+ var isScrollToLeft = useRtl ? diff < 0 : diff > 0; // 判断是否是滚动到列表结束方向,ltr模式下是向右滚动,rtl模式下是向左滚动
173
+
174
+ var isScrollToRight = useRtl ? diff > 0 : diff < 0; // 滑动到最左侧,处理回弹效果
170
175
  // @en Swipe to the far left to handle the rebound effect
171
176
 
172
- if (diff > 0 && scrollContainer.scrollLeft <= 1 && bounceWhenBumpBoundary) {
177
+ if (isScrollToLeft && Math.abs(scrollContainer.scrollLeft) <= 1 && bounceWhenBumpBoundary) {
173
178
  e.stopPropagation();
174
179
  e.cancelBubble && e.preventDefault();
175
180
  bouncingRef.current = true;
@@ -187,14 +192,14 @@ var SwipeLoad = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
187
192
  // @en Swipe left to the end and the 'more' label is loaded. Judging by scrollLeft, the scroll container reaches the edge and the non-scroll container does not judge
188
193
 
189
194
 
190
- if (diff < 0 && (scrollContainer.scrollLeft + scrollContainer.clientWidth >= scrollContainer.scrollWidth - 1 || !scrollContainer.scrollLeft) && !ifToRightRef.current) {
195
+ if (isScrollToRight && (Math.abs(scrollContainer.scrollLeft) + scrollContainer.clientWidth >= scrollContainer.scrollWidth - 1 || !scrollContainer.scrollLeft) && !ifToRightRef.current) {
191
196
  showLoadMoreRef.current = true;
192
197
  loadingCurrent.style.display = 'flex';
193
198
  } // 继续滑动露出标签
194
199
  // @en Continue swiping to reveal labels
195
200
 
196
201
 
197
- if (showLoadMoreRef.current && diff < 0) {
202
+ if (showLoadMoreRef.current && isScrollToRight) {
198
203
  // 此时禁止list原生滚动
199
204
  // @en Disable list native scrolling at this time
200
205
  e.stopPropagation();
@@ -214,22 +219,22 @@ var SwipeLoad = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
214
219
 
215
220
  (0, _helpers.setStyleWithVendor)(loadingCurrent, {
216
221
  transition: 'none',
217
- transform: "translateX(-" + labelRightMargin + "px) translateZ(0)"
222
+ transform: useRtl ? "translateX(" + labelRightMargin + "px) translateZ(0)" : "translateX(-" + labelRightMargin + "px) translateZ(0)"
218
223
  });
219
224
  (0, _helpers.setStyleWithVendor)(scrollContainer, {
220
225
  transition: 'none',
221
- transform: "translateX(-" + listRightMargin + "px) translateZ(0)"
226
+ transform: useRtl ? "translateX(" + listRightMargin + "px) translateZ(0)" : "translateX(-" + listRightMargin + "px) translateZ(0)"
222
227
  });
223
228
  }
224
229
 
225
- if (diff > 0 && scrollContainer.scrollLeft + scrollContainer.clientWidth <= scrollContainer.scrollWidth - 1) {
230
+ if (isScrollToLeft && Math.abs(scrollContainer.scrollLeft) + scrollContainer.clientWidth <= scrollContainer.scrollWidth - 1) {
226
231
  showLoadMoreRef.current = false;
227
232
  loadingCurrent.style.display = 'none';
228
233
  } // 针对ios惯性滚动处理
229
234
  // @en Handling inertial scrolling for ios
230
235
 
231
236
 
232
- if (diff < 0 && scrollContainer.scrollLeft + scrollContainer.clientWidth <= scrollContainer.scrollWidth - 1) {
237
+ if (isScrollToRight && Math.abs(scrollContainer.scrollLeft) + scrollContainer.clientWidth <= scrollContainer.scrollWidth - 1) {
233
238
  ifToRightRef.current = false;
234
239
  } else {
235
240
  ifToRightRef.current = true;
@@ -274,7 +279,7 @@ var SwipeLoad = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
274
279
  // @em Swipe left, labels are all displayed
275
280
 
276
281
 
277
- if (labelDiff >= minConfirmOffset && (scrollContainer.scrollLeft + scrollContainer.clientWidth >= scrollContainer.scrollWidth - 1 || !scrollContainer.scrollLeft) && showLoadMoreRef.current) {
282
+ if (labelDiff >= minConfirmOffset && (Math.abs(scrollContainer.scrollLeft) + scrollContainer.clientWidth >= scrollContainer.scrollWidth - 1 || !scrollContainer.scrollLeft) && showLoadMoreRef.current) {
278
283
  onConfirm(); // 安卓机型返回动画优化
279
284
  // @en Return animation optimization on Android
280
285
 
@@ -302,6 +307,8 @@ var SwipeLoad = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
302
307
  };
303
308
  });
304
309
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
310
+ var _ref2, _ref3;
311
+
305
312
  var prefixCls = _ref.prefixCls;
306
313
  return /*#__PURE__*/_react.default.createElement("div", {
307
314
  className: prefixCls + "-swipe-load " + className,
@@ -312,19 +319,17 @@ var SwipeLoad = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
312
319
  }, children), renderLabel ? /*#__PURE__*/_react.default.createElement("div", {
313
320
  className: (0, _mobileUtils.cls)(prefixCls + "-custom-loading-area"),
314
321
  ref: loadingRef,
315
- style: {
316
- position: 'absolute',
317
- right: initPos + "px"
318
- }
322
+ style: (_ref2 = {
323
+ position: 'absolute'
324
+ }, _ref2[useRtl ? 'left' : 'right'] = initPos + "px", _ref2)
319
325
  }, renderLabel.length ? renderLabel(labelOffsetState) : renderLabel()) : /*#__PURE__*/_react.default.createElement("div", {
320
326
  className: (0, _mobileUtils.cls)(prefixCls + "-loading-area"),
321
327
  ref: loadingRef,
322
- style: {
328
+ style: (_ref3 = {
323
329
  width: circleSize + "px",
324
330
  height: circleSize + "px",
325
- position: 'absolute',
326
- right: "-" + circleSize + "px"
327
- }
331
+ position: 'absolute'
332
+ }, _ref3[useRtl ? 'left' : 'right'] = "-" + circleSize + "px", _ref3)
328
333
  }, /*#__PURE__*/_react.default.createElement("div", {
329
334
  className: (0, _mobileUtils.cls)(prefixCls + "-loading-label"),
330
335
  ref: loadingLabelRef
@@ -519,6 +519,10 @@
519
519
  color: #1d2129 ;
520
520
  font-size: 0.24rem ;
521
521
  }
522
+ [dir="rtl"] .arco-swipe-load .arco-loading-area .arco-loading-label {
523
+ margin-left: initial;
524
+ margin-right: 0.4rem ;
525
+ }
522
526
  /***************************************************
523
527
  * *
524
528
  * Arco Theme Style *
@@ -20,7 +20,7 @@
20
20
  .use-var(border-radius, swipe-load-label-border-radius);
21
21
 
22
22
  .@{prefix}-loading-label {
23
- .use-var(margin-left, swipe-load-label-text-margin-left);
23
+ .use-var-with-rtl(margin-left, swipe-load-label-text-margin-left);
24
24
  .use-var(width, swipe-load-label-text-width);
25
25
  .use-var(color, swipe-load-label-text-color);
26
26
  .use-var(font-size, swipe-load-label-text-font-size);
package/cjs/tabs/index.js CHANGED
@@ -466,11 +466,12 @@ var Tabs = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
466
466
  changeFromRef.current = changeFrom || '';
467
467
  setCellTrans(true);
468
468
  setInnerIndex(newIndex);
469
- setDistance(0);
470
469
 
471
470
  if (newIndex !== activeIndexRef.current) {
472
471
  onChange && onChange(tabs[newIndex], newIndex, changeFrom);
473
472
  }
473
+
474
+ setDistance(0);
474
475
  }
475
476
 
476
477
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {