@arco-design/mobile-react 2.27.4 → 2.28.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.
Files changed (176) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/hooks.d.ts +1 -0
  5. package/cjs/_helpers/hooks.js +44 -28
  6. package/cjs/action-sheet/index.d.ts +2 -2
  7. package/cjs/badge/index.js +2 -1
  8. package/cjs/badge/style/css/index.css +12 -0
  9. package/cjs/badge/style/index.less +3 -3
  10. package/cjs/button/style/css/index.css +4 -0
  11. package/cjs/button/style/index.less +1 -1
  12. package/cjs/cell/style/css/index.css +7 -0
  13. package/cjs/cell/style/index.less +4 -1
  14. package/cjs/checkbox/style/css/index.css +13 -0
  15. package/cjs/checkbox/style/index.less +3 -3
  16. package/cjs/collapse/collapse.js +12 -6
  17. package/cjs/dialog/index.d.ts +2 -2
  18. package/cjs/form/style/css/index.css +16 -0
  19. package/cjs/form/style/index.less +4 -4
  20. package/cjs/image-preview/index.d.ts +2 -2
  21. package/cjs/image-preview/index.js +4 -2
  22. package/cjs/image-preview/style/css/index.css +3 -0
  23. package/cjs/image-preview/style/index.less +4 -0
  24. package/cjs/index.d.ts +12 -12
  25. package/cjs/index.js +46 -46
  26. package/cjs/load-more/index.d.ts +5 -0
  27. package/cjs/load-more/index.js +2 -1
  28. package/cjs/masking/index.d.ts +2 -2
  29. package/cjs/masking/index.js +4 -2
  30. package/cjs/notify/index.d.ts +8 -8
  31. package/cjs/popover/popover.js +10 -2
  32. package/cjs/popup/index.d.ts +2 -2
  33. package/cjs/popup-swiper/index.d.ts +2 -2
  34. package/cjs/radio/style/css/index.css +8 -0
  35. package/cjs/radio/style/index.less +2 -2
  36. package/cjs/rate/index.js +5 -3
  37. package/cjs/rate/style/css/index.css +4 -0
  38. package/cjs/rate/style/index.less +4 -0
  39. package/cjs/slider/hooks/index.d.ts +1 -1
  40. package/cjs/slider/popover.js +6 -2
  41. package/cjs/stepper/hooks/useButtonClick.js +8 -9
  42. package/cjs/sticky/index.d.ts +5 -0
  43. package/cjs/sticky/index.js +20 -7
  44. package/cjs/style.d.ts +13 -13
  45. package/cjs/style.js +24 -24
  46. package/cjs/switch/index.js +7 -2
  47. package/cjs/switch/style/css/index.css +44 -0
  48. package/cjs/switch/style/index.less +19 -7
  49. package/cjs/tabs/demo/style/css/mobile.css +11 -0
  50. package/cjs/tabs/demo/style/mobile.less +5 -1
  51. package/cjs/tabs/index.js +14 -5
  52. package/cjs/tabs/style/css/index.css +32 -7
  53. package/cjs/tabs/style/index.less +9 -14
  54. package/cjs/tabs/tab-cell-underline.js +14 -5
  55. package/cjs/tabs/tab-cell.js +15 -7
  56. package/cjs/tabs/tab-pane.js +4 -3
  57. package/cjs/tabs/type.d.ts +1 -0
  58. package/cjs/toast/index.d.ts +12 -12
  59. package/cjs/toast/index.js +5 -2
  60. package/dist/index.js +13914 -13836
  61. package/dist/index.min.js +4 -4
  62. package/dist/style.css +3366 -3236
  63. package/dist/style.min.css +1 -1
  64. package/esm/_helpers/hooks.d.ts +1 -0
  65. package/esm/_helpers/hooks.js +43 -29
  66. package/esm/action-sheet/index.d.ts +2 -2
  67. package/esm/badge/index.js +2 -1
  68. package/esm/badge/style/css/index.css +12 -0
  69. package/esm/badge/style/index.less +3 -3
  70. package/esm/button/style/css/index.css +4 -0
  71. package/esm/button/style/index.less +1 -1
  72. package/esm/cell/style/css/index.css +7 -0
  73. package/esm/cell/style/index.less +4 -1
  74. package/esm/checkbox/style/css/index.css +13 -0
  75. package/esm/checkbox/style/index.less +3 -3
  76. package/esm/collapse/collapse.js +14 -8
  77. package/esm/dialog/index.d.ts +2 -2
  78. package/esm/form/style/css/index.css +16 -0
  79. package/esm/form/style/index.less +4 -4
  80. package/esm/image-preview/index.d.ts +2 -2
  81. package/esm/image-preview/index.js +4 -2
  82. package/esm/image-preview/style/css/index.css +3 -0
  83. package/esm/image-preview/style/index.less +4 -0
  84. package/esm/index.d.ts +12 -12
  85. package/esm/index.js +12 -12
  86. package/esm/load-more/index.d.ts +5 -0
  87. package/esm/load-more/index.js +2 -1
  88. package/esm/masking/index.d.ts +2 -2
  89. package/esm/masking/index.js +4 -2
  90. package/esm/notify/index.d.ts +8 -8
  91. package/esm/popover/popover.js +10 -2
  92. package/esm/popup/index.d.ts +2 -2
  93. package/esm/popup-swiper/index.d.ts +2 -2
  94. package/esm/radio/style/css/index.css +8 -0
  95. package/esm/radio/style/index.less +2 -2
  96. package/esm/rate/index.js +5 -3
  97. package/esm/rate/style/css/index.css +4 -0
  98. package/esm/rate/style/index.less +4 -0
  99. package/esm/slider/hooks/index.d.ts +1 -1
  100. package/esm/slider/popover.js +7 -3
  101. package/esm/stepper/hooks/useButtonClick.js +8 -9
  102. package/esm/sticky/index.d.ts +5 -0
  103. package/esm/sticky/index.js +20 -7
  104. package/esm/style.d.ts +13 -13
  105. package/esm/style.js +13 -13
  106. package/esm/switch/index.js +9 -4
  107. package/esm/switch/style/css/index.css +44 -0
  108. package/esm/switch/style/index.less +19 -7
  109. package/esm/tabs/demo/style/css/mobile.css +11 -0
  110. package/esm/tabs/demo/style/mobile.less +5 -1
  111. package/esm/tabs/index.js +16 -7
  112. package/esm/tabs/style/css/index.css +32 -7
  113. package/esm/tabs/style/index.less +9 -14
  114. package/esm/tabs/tab-cell-underline.js +14 -6
  115. package/esm/tabs/tab-cell.js +15 -8
  116. package/esm/tabs/tab-pane.js +4 -3
  117. package/esm/tabs/type.d.ts +1 -0
  118. package/esm/toast/index.d.ts +12 -12
  119. package/esm/toast/index.js +5 -2
  120. package/package.json +3 -3
  121. package/umd/_helpers/hooks.d.ts +1 -0
  122. package/umd/_helpers/hooks.js +44 -28
  123. package/umd/action-sheet/index.d.ts +2 -2
  124. package/umd/badge/index.js +2 -1
  125. package/umd/badge/style/css/index.css +12 -0
  126. package/umd/badge/style/index.less +3 -3
  127. package/umd/button/style/css/index.css +4 -0
  128. package/umd/button/style/index.less +1 -1
  129. package/umd/cell/style/css/index.css +7 -0
  130. package/umd/cell/style/index.less +4 -1
  131. package/umd/checkbox/style/css/index.css +13 -0
  132. package/umd/checkbox/style/index.less +3 -3
  133. package/umd/collapse/collapse.js +12 -6
  134. package/umd/dialog/index.d.ts +2 -2
  135. package/umd/form/style/css/index.css +16 -0
  136. package/umd/form/style/index.less +4 -4
  137. package/umd/image-preview/index.d.ts +2 -2
  138. package/umd/image-preview/index.js +4 -2
  139. package/umd/image-preview/style/css/index.css +3 -0
  140. package/umd/image-preview/style/index.less +4 -0
  141. package/umd/index.d.ts +12 -12
  142. package/umd/index.js +28 -28
  143. package/umd/load-more/index.d.ts +5 -0
  144. package/umd/load-more/index.js +2 -1
  145. package/umd/masking/index.d.ts +2 -2
  146. package/umd/masking/index.js +4 -2
  147. package/umd/notify/index.d.ts +8 -8
  148. package/umd/popover/popover.js +10 -2
  149. package/umd/popup/index.d.ts +2 -2
  150. package/umd/popup-swiper/index.d.ts +2 -2
  151. package/umd/radio/style/css/index.css +8 -0
  152. package/umd/radio/style/index.less +2 -2
  153. package/umd/rate/index.js +5 -3
  154. package/umd/rate/style/css/index.css +4 -0
  155. package/umd/rate/style/index.less +4 -0
  156. package/umd/slider/hooks/index.d.ts +1 -1
  157. package/umd/slider/popover.js +6 -2
  158. package/umd/stepper/hooks/useButtonClick.js +8 -9
  159. package/umd/sticky/index.d.ts +5 -0
  160. package/umd/sticky/index.js +20 -7
  161. package/umd/style.d.ts +13 -13
  162. package/umd/style.js +2 -2
  163. package/umd/switch/index.js +7 -2
  164. package/umd/switch/style/css/index.css +44 -0
  165. package/umd/switch/style/index.less +19 -7
  166. package/umd/tabs/demo/style/css/mobile.css +11 -0
  167. package/umd/tabs/demo/style/mobile.less +5 -1
  168. package/umd/tabs/index.js +14 -5
  169. package/umd/tabs/style/css/index.css +32 -7
  170. package/umd/tabs/style/index.less +9 -14
  171. package/umd/tabs/tab-cell-underline.js +16 -9
  172. package/umd/tabs/tab-cell.js +17 -11
  173. package/umd/tabs/tab-pane.js +4 -3
  174. package/umd/tabs/type.d.ts +1 -0
  175. package/umd/toast/index.d.ts +12 -12
  176. package/umd/toast/index.js +5 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,39 @@
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.28.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.27.5...@arco-design/mobile-react@2.28.0) (2023-07-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * `Collapse` update with the latest opened ([#140](https://github.com/arco-design/arco-design-mobile/issues/140)) ([b963787](https://github.com/arco-design/arco-design-mobile/commit/b96378761557f4d90f09f789f662e9d3588c3cbd))
12
+ * `ImagePreview` fix scroll through ([ea3f9bc](https://github.com/arco-design/arco-design-mobile/commit/ea3f9bc5d0980f70c81e2de99084e0a11187b3c1))
13
+ * `Sticky` support the method "updatePlaceholderLayout" ([842b4fe](https://github.com/arco-design/arco-design-mobile/commit/842b4fe6084b3ae282bd54850e381fbe34bd826f))
14
+
15
+
16
+ ### Features
17
+
18
+ * RTL support for `Badge`, `Button`, `Cell`, `Checkbox`, `Form`, `Radio`, `Rate`, `Switch` and `Tabs` ([#135](https://github.com/arco-design/arco-design-mobile/issues/135)) ([97de976](https://github.com/arco-design/arco-design-mobile/commit/97de976ba514ec0f48103bd4f0c535ebceb8981a))
19
+
20
+
21
+
22
+
23
+
24
+ ## [2.27.5](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.27.4...@arco-design/mobile-react@2.27.5) (2023-07-04)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * `ImagePreview` fix long picture display problem ([#137](https://github.com/arco-design/arco-design-mobile/issues/137)) ([3df1f71](https://github.com/arco-design/arco-design-mobile/commit/3df1f71a8b1f63ed5e1986284f2746438de59d70))
30
+ * `LoadMore` fix the inaccurate scrollheight when using multiple loadmore ([#130](https://github.com/arco-design/arco-design-mobile/issues/130)) ([da76f12](https://github.com/arco-design/arco-design-mobile/commit/da76f125734579a1921a3ace0964d5ff845cd545))
31
+ * `Stepper` disable status ([#134](https://github.com/arco-design/arco-design-mobile/issues/134)) ([71dabe7](https://github.com/arco-design/arco-design-mobile/commit/71dabe71f3508ac8cb9a800d8ac1be01df509f28))
32
+ * error caught when using "getComputedStyle" ([#129](https://github.com/arco-design/arco-design-mobile/issues/129)) ([daa8f67](https://github.com/arco-design/arco-design-mobile/commit/daa8f67961d9d2751a14c0c3f7759b54fe0579cb))
33
+ * transition in StrictMode ([#131](https://github.com/arco-design/arco-design-mobile/issues/131)) ([084448b](https://github.com/arco-design/arco-design-mobile/commit/084448b0e4b43ea7d8632e232c1665ce00449c3d))
34
+
35
+
36
+
37
+
38
+
6
39
  ## [2.27.4](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.27.3...@arco-design/mobile-react@2.27.4) (2023-05-19)
7
40
 
8
41
 
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.27.3/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.27.3/dist/index.min.js"></script>
62
+ <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.27.5/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.27.5/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.27.3/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.27.3/dist/index.min.js"></script>
62
+ <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.27.5/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.27.5/dist/index.min.js"></script>
64
64
  ```
65
65
 
66
66
  ## 引入全部
@@ -15,6 +15,7 @@ export declare function useListenResize(resizeHandler: () => void, deps?: any[],
15
15
  * @param initialState {en} Initial State
16
16
  */
17
17
  export declare function useMountedState<S>(initialState: S | (() => S)): [S, React.Dispatch<React.SetStateAction<S>>];
18
+ export declare function useSameRefState<T>(initialValue: T): [T, React.MutableRefObject<T>, (data: T) => void];
18
19
  export declare function useRefState<T>(initialValue: T | (() => T)): [T, React.MutableRefObject<T>, React.Dispatch<React.SetStateAction<T>>];
19
20
  export declare function useRefMountedState<T>(initialValue: T | (() => T)): [T, React.MutableRefObject<T>, React.Dispatch<React.SetStateAction<T>>];
20
21
  export declare function useUpdateEffect(effect: () => void | (() => void), dependencies?: any[]): void;
@@ -12,6 +12,7 @@ exports.usePreventBodyScroll = usePreventBodyScroll;
12
12
  exports.useProgress = void 0;
13
13
  exports.useRefMountedState = useRefMountedState;
14
14
  exports.useRefState = useRefState;
15
+ exports.useSameRefState = useSameRefState;
15
16
  exports.useSingleAndDoubleClick = useSingleAndDoubleClick;
16
17
  exports.useSwiperInnerScroll = useSwiperInnerScroll;
17
18
  exports.useSystem = useSystem;
@@ -83,11 +84,26 @@ function useMountedState(initialState) {
83
84
  return result;
84
85
  }
85
86
 
86
- function useRefState(initialValue) {
87
+ function useSameRefState(initialValue) {
87
88
  var _useState2 = (0, _react.useState)(initialValue),
88
89
  state = _useState2[0],
89
90
  setState = _useState2[1];
90
91
 
92
+ var stateRef = (0, _react.useRef)(state);
93
+
94
+ var setStateProxy = function setStateProxy(data) {
95
+ stateRef.current = data;
96
+ setState(data);
97
+ };
98
+
99
+ return [state, stateRef, setStateProxy];
100
+ }
101
+
102
+ function useRefState(initialValue) {
103
+ var _useState3 = (0, _react.useState)(initialValue),
104
+ state = _useState3[0],
105
+ setState = _useState3[1];
106
+
91
107
  var stateRef = (0, _react.useRef)(state);
92
108
  (0, _react.useEffect)(function () {
93
109
  stateRef.current = state;
@@ -123,8 +139,8 @@ function useUpdateEffect(effect, dependencies) {
123
139
  }
124
140
 
125
141
  function useForceUpdate() {
126
- var _useState3 = (0, _react.useState)(0),
127
- setTick = _useState3[1];
142
+ var _useState4 = (0, _react.useState)(0),
143
+ setTick = _useState4[1];
128
144
 
129
145
  var update = (0, _react.useCallback)(function () {
130
146
  setTick(function (tick) {
@@ -146,11 +162,11 @@ function useSystem() {
146
162
  var _useContext = (0, _react.useContext)(_contextProvider.GlobalContext),
147
163
  currentSystem = _useContext.system;
148
164
 
149
- var _useState4 = (0, _react.useState)(function () {
165
+ var _useState5 = (0, _react.useState)(function () {
150
166
  return currentSystem || (0, _mobileUtils.getSystem)();
151
167
  }),
152
- system = _useState4[0],
153
- setSystem = _useState4[1];
168
+ system = _useState5[0],
169
+ setSystem = _useState5[1];
154
170
 
155
171
  (0, _react.useEffect)(function () {
156
172
  setSystem(currentSystem || (0, _mobileUtils.getSystem)());
@@ -159,13 +175,13 @@ function useSystem() {
159
175
  }
160
176
 
161
177
  function useWindowSize(listenResize) {
162
- var _useState5 = (0, _react.useState)(0),
163
- windowWidth = _useState5[0],
164
- setWindowWidth = _useState5[1];
165
-
166
178
  var _useState6 = (0, _react.useState)(0),
167
- windowHeight = _useState6[0],
168
- setWindowHeight = _useState6[1];
179
+ windowWidth = _useState6[0],
180
+ setWindowWidth = _useState6[1];
181
+
182
+ var _useState7 = (0, _react.useState)(0),
183
+ windowHeight = _useState7[0],
184
+ setWindowHeight = _useState7[1];
169
185
 
170
186
  function setSize() {
171
187
  setWindowWidth(window.innerWidth);
@@ -209,7 +225,7 @@ function usePopupScroll(visible, popupDom, getScrollContainer, orientationDirect
209
225
  if (ele) {
210
226
  var actualEle = Array.isArray(ele) ? ele : [ele];
211
227
  scrollRef.current = actualEle.reduce(function (acc, nowEle) {
212
- return [].concat(acc, nowEle && window.getComputedStyle(nowEle).overflow !== 'hidden' ? [{
228
+ return [].concat(acc, nowEle && (0, _mobileUtils.safeGetComputedStyle)(nowEle).overflow !== 'hidden' ? [{
213
229
  ele: nowEle,
214
230
  maxScrollX: orientationDirection === 'left' || orientationDirection === 'right' ? nowEle.scrollHeight - nowEle.clientHeight : nowEle.scrollWidth - nowEle.clientWidth,
215
231
  maxScrollY: orientationDirection === 'left' || orientationDirection === 'right' ? nowEle.scrollWidth - nowEle.clientWidth : nowEle.scrollHeight - nowEle.clientHeight
@@ -472,17 +488,17 @@ function usePreventBodyScroll(visible, preventBodyScroll, initialBodyOverflow) {
472
488
  }
473
489
 
474
490
  var useProgress = function useProgress(mountedTransition, percentage, duration, mountedBezier, step) {
475
- var _useState7 = (0, _react.useState)(0),
476
- currentPercentage = _useState7[0],
477
- setCurrentPercentage = _useState7[1];
491
+ var _useState8 = (0, _react.useState)(0),
492
+ currentPercentage = _useState8[0],
493
+ setCurrentPercentage = _useState8[1];
478
494
 
479
- var _useState8 = (0, _react.useState)(false),
480
- transitionControl = _useState8[0],
481
- setTransitionControl = _useState8[1];
495
+ var _useState9 = (0, _react.useState)(false),
496
+ transitionControl = _useState9[0],
497
+ setTransitionControl = _useState9[1];
482
498
 
483
- var _useState9 = (0, _react.useState)(0),
484
- count = _useState9[0],
485
- setCount = _useState9[1];
499
+ var _useState10 = (0, _react.useState)(0),
500
+ count = _useState10[0],
501
+ setCount = _useState10[1];
486
502
 
487
503
  var latestPercentage = (0, _react.useRef)(percentage);
488
504
  (0, _react.useEffect)(function () {
@@ -514,9 +530,9 @@ function useSingleAndDoubleClick(onClick, onDoubleClick, delay) {
514
530
  delay = 200;
515
531
  }
516
532
 
517
- var _useState10 = (0, _react.useState)(0),
518
- clickTimes = _useState10[0],
519
- setClickTimes = _useState10[1];
533
+ var _useState11 = (0, _react.useState)(0),
534
+ clickTimes = _useState11[0],
535
+ setClickTimes = _useState11[1];
520
536
 
521
537
  var eventRef = (0, _react.useRef)();
522
538
  (0, _react.useEffect)(function () {
@@ -540,9 +556,9 @@ function useSingleAndDoubleClick(onClick, onDoubleClick, delay) {
540
556
  var arcoSvgKeyCount = 0;
541
557
 
542
558
  function useGenSvgKey(userSetSvgKey) {
543
- var _useState11 = (0, _react.useState)(''),
544
- innerSvgKey = _useState11[0],
545
- setInnerSvgKey = _useState11[1];
559
+ var _useState12 = (0, _react.useState)(''),
560
+ innerSvgKey = _useState12[0],
561
+ setInnerSvgKey = _useState12[1];
546
562
 
547
563
  var svgKey = userSetSvgKey || innerSvgKey;
548
564
  (0, _react.useEffect)(function () {
@@ -86,11 +86,11 @@ declare const _default: React.ForwardRefExoticComponent<ActionSheetProps & React
86
86
  * @param {ActionSheetProps} config setting
87
87
  * @returns {{ close: () => void; update: (newConfig: ActionSheetProps) => void; }}
88
88
  */
89
- open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "needBottomOffset" | "translateZ" | "items" | "cancelText" | "subTitle"> & {
89
+ open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "context" | "translateZ" | "className" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "items" | "cancelText" | "subTitle"> & {
90
90
  key?: string | undefined;
91
91
  }, context?: import("../context-provider").GlobalContextParams | undefined) => {
92
92
  close: () => void;
93
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "needBottomOffset" | "translateZ" | "items" | "cancelText" | "subTitle"> & {
93
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "context" | "translateZ" | "className" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "items" | "cancelText" | "subTitle"> & {
94
94
  key?: string | undefined;
95
95
  }) => void;
96
96
  };
@@ -65,7 +65,8 @@ var Badge = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
65
65
  return /*#__PURE__*/_react.default.createElement(_transition.default, {
66
66
  in: visible,
67
67
  timeout: timeout,
68
- type: "scale"
68
+ type: "scale",
69
+ nodeRef: domRef
69
70
  }, /*#__PURE__*/_react.default.createElement("div", {
70
71
  className: (0, _mobileUtils.cls)(prefixCls + "-badge", className, (_cls = {}, _cls[prefixCls + "-badge-dot dot"] = dot, _cls[prefixCls + "-badge-bordered bordered"] = bordered, _cls[prefixCls + "-badge-absolute absolute"] = absolute, _cls)),
71
72
  style: style,
@@ -89,7 +89,19 @@
89
89
  margin-left: -8PX ;
90
90
  margin-top: -8PX ;
91
91
  }
92
+ [dir="rtl"] .arco-badge-absolute {
93
+ left: initial;
94
+ right: 100%;
95
+ }
96
+ [dir="rtl"] .arco-badge-absolute {
97
+ margin-left: initial;
98
+ margin-right: -8PX ;
99
+ }
92
100
  .arco-badge-absolute.arco-badge-dot {
93
101
  margin-left: -4PX ;
94
102
  margin-top: -4PX ;
95
103
  }
104
+ [dir="rtl"] .arco-badge-absolute.arco-badge-dot {
105
+ margin-left: initial;
106
+ margin-right: -4PX ;
107
+ }
@@ -60,13 +60,13 @@
60
60
  &-absolute {
61
61
  position: absolute;
62
62
  top: 0;
63
- left: 100%;
64
- .use-var(margin-left, badge-text-deviation);
63
+ .set-prop-with-rtl(left, 100%);
64
+ .use-var-with-rtl(margin-left, badge-text-deviation);
65
65
  .use-var(margin-top, badge-text-deviation);
66
66
  }
67
67
 
68
68
  &-absolute&-dot {
69
- .use-var(margin-left, badge-dot-deviation);
69
+ .use-var-with-rtl(margin-left, badge-dot-deviation);
70
70
  .use-var(margin-top, badge-dot-deviation);
71
71
  }
72
72
  }
@@ -210,6 +210,10 @@
210
210
  .arco-button-text-has-icon {
211
211
  margin-left: 0.08rem ;
212
212
  }
213
+ [dir="rtl"] .arco-button-text-has-icon {
214
+ margin-left: initial;
215
+ margin-right: 0.08rem ;
216
+ }
213
217
  .arco-button-loading-icon {
214
218
  display: inline-block;
215
219
  vertical-align: middle;
@@ -84,7 +84,7 @@
84
84
  vertical-align: middle;
85
85
  }
86
86
  &-text-has-icon {
87
- .use-var(margin-left, button-icon-text-gutter);
87
+ .use-var-with-rtl(margin-left, button-icon-text-gutter);
88
88
  }
89
89
 
90
90
  &-loading-icon {
@@ -164,6 +164,9 @@
164
164
  -webkit-box-orient: vertical;
165
165
  white-space: normal;
166
166
  }
167
+ [dir="rtl"] .arco-cell .cell-content .cell-text {
168
+ text-align: left;
169
+ }
167
170
  .arco-cell .cell-label-icon {
168
171
  margin-right: 0.24rem ;
169
172
  font-size: 0;
@@ -181,6 +184,10 @@
181
184
  margin-left: 0.16rem ;
182
185
  font-size: 0;
183
186
  }
187
+ [dir="rtl"] .arco-cell .cell-arrow-icon {
188
+ -webkit-transform: scale(-1);
189
+ transform: scale(-1);
190
+ }
184
191
  [dir="rtl"] .arco-cell .cell-arrow-icon {
185
192
  margin-left: initial;
186
193
  margin-right: 0.16rem ;
@@ -54,7 +54,7 @@
54
54
 
55
55
  .cell-text {
56
56
  width: 100%;
57
- text-align: right;
57
+ .set-value-with-rtl(text-align, right);
58
58
  .use-var(font-size, cell-content-font-size);
59
59
  .text-overflow(2);
60
60
  }
@@ -71,6 +71,9 @@
71
71
  }
72
72
 
73
73
  .cell-arrow-icon {
74
+ [dir="rtl"] & {
75
+ transform: scale(-1);
76
+ }
74
77
  .use-var-with-rtl(margin-left, cell-arrow-gutter);
75
78
  font-size: 0;
76
79
  .@{prefix}-icon {
@@ -32,6 +32,10 @@
32
32
  .arco-checkbox .checkbox-icon + .checkbox-text {
33
33
  margin-left: 0.16rem ;
34
34
  }
35
+ [dir="rtl"] .arco-checkbox .checkbox-icon + .checkbox-text {
36
+ margin-left: initial;
37
+ margin-right: 0.16rem ;
38
+ }
35
39
  .arco-checkbox.disabled .checkbox-text {
36
40
  opacity: 0.5 ;
37
41
  }
@@ -47,7 +51,16 @@
47
51
  .arco-checkbox-group .arco-checkbox:not(:last-child) {
48
52
  margin-right: 0.48rem ;
49
53
  }
54
+ [dir="rtl"] .arco-checkbox-group .arco-checkbox:not(:last-child) {
55
+ margin-right: initial;
56
+ margin-left: 0.48rem ;
57
+ }
50
58
  .arco-checkbox-group .arco-checkbox:not(:last-child).block,
51
59
  .arco-checkbox-group .arco-checkbox:not(:last-child).justify {
52
60
  margin-right: 0;
53
61
  }
62
+ [dir="rtl"] .arco-checkbox-group .arco-checkbox:not(:last-child).block,
63
+ [dir="rtl"] .arco-checkbox-group .arco-checkbox:not(:last-child).justify {
64
+ margin-right: initial;
65
+ margin-left: 0;
66
+ }
@@ -29,7 +29,7 @@
29
29
  }
30
30
 
31
31
  .checkbox-icon + .checkbox-text {
32
- .use-var(margin-left, checkbox-icon-margin-right);
32
+ .use-var-with-rtl(margin-left, checkbox-icon-margin-right);
33
33
  }
34
34
 
35
35
  &.disabled .checkbox-text {
@@ -48,11 +48,11 @@
48
48
 
49
49
  .@{prefix}-checkbox-group {
50
50
  .@{prefix}-checkbox:not(:last-child) {
51
- .use-var(margin-right, checkbox-group-gutter);
51
+ .use-var-with-rtl(margin-right, checkbox-group-gutter);
52
52
 
53
53
  &.block,
54
54
  &.justify {
55
- margin-right: 0;
55
+ .set-prop-with-rtl(margin-right, 0);
56
56
  }
57
57
  }
58
58
  }
@@ -63,7 +63,13 @@ var Collapse = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
63
63
 
64
64
  var CollapseContext = _utils.allContexts[groupKey] || {};
65
65
  var groupContext = (0, _react.useContext)(CollapseContext) || {};
66
- var opened = (0, _react.useMemo)(function () {
66
+
67
+ var _useSameRefState = (0, _helpers.useSameRefState)(false),
68
+ opened = _useSameRefState[0],
69
+ openedRef = _useSameRefState[1],
70
+ setOpened = _useSameRefState[2];
71
+
72
+ (0, _react.useEffect)(function () {
67
73
  var show = false; // 优先级: group > children
68
74
  // @en Priority: group > children
69
75
 
@@ -77,7 +83,7 @@ var Collapse = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
77
83
  show = itemActive;
78
84
  }
79
85
 
80
- return show;
86
+ setOpened(show);
81
87
  }, [value, active, itemActive, groupContext.isGroup, groupContext.value]);
82
88
 
83
89
  var getContentHeight = function getContentHeight() {
@@ -95,8 +101,8 @@ var Collapse = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
95
101
  contentWrapRef.current.style.height = newHeight;
96
102
  var transTimeout = (0, _mobileUtils.convertCssDuration)(contentWrapRef.current, 'transitionDuration');
97
103
  setTimeout(function () {
98
- return contentWrapRef.current && (contentWrapRef.current.style.height = opened ? 'auto' : '0px');
99
- }, opened ? transTimeout : 20);
104
+ return contentWrapRef.current && (contentWrapRef.current.style.height = openedRef.current ? 'auto' : '0px');
105
+ }, openedRef.current ? transTimeout : 20);
100
106
  };
101
107
 
102
108
  var toggleOpened = function toggleOpened() {
@@ -119,10 +125,10 @@ var Collapse = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
119
125
  }
120
126
 
121
127
  var height = getContentHeight();
122
- contentWrapRef.current.style.height = opened ? contentHeightRef.current + "px" : '0px';
128
+ contentWrapRef.current.style.height = openedRef.current ? contentHeightRef.current + "px" : '0px';
123
129
  (0, _mobileUtils.nextTick)(function () {
124
130
  contentHeightRef.current = height;
125
- resetHeight(opened ? height + "px" : '0px');
131
+ resetHeight(openedRef.current ? height + "px" : '0px');
126
132
  });
127
133
  };
128
134
 
@@ -193,11 +193,11 @@ declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefA
193
193
  * @param {DialogProps} config Configuration
194
194
  * @returns {{ close: () => void; update: (newConfig: DialogProps) => void; }}
195
195
  */
196
- open: (config: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
196
+ open: (config: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "context" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
197
197
  key?: string | undefined;
198
198
  }, context?: import("../context-provider").GlobalContextParams | undefined) => {
199
199
  close: () => void;
200
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
200
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "context" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
201
201
  key?: string | undefined;
202
202
  }) => void;
203
203
  };
@@ -27,6 +27,10 @@
27
27
  padding-right: 0.32rem ;
28
28
  width: 1.92rem ;
29
29
  }
30
+ [dir="rtl"] .arco-form-label-item {
31
+ padding-right: initial;
32
+ padding-left: 0.32rem ;
33
+ }
30
34
  .arco-form-label-item-required-asterisk {
31
35
  position: absolute;
32
36
  left: -0.6em;
@@ -35,6 +39,10 @@
35
39
  line-height: 1.08rem ;
36
40
  color: #f53f3f ;
37
41
  }
42
+ [dir="rtl"] .arco-form-label-item-required-asterisk {
43
+ left: initial;
44
+ right: -0.6em;
45
+ }
38
46
  .disabled .arco-form-label-item {
39
47
  color: #c9cdd4 ;
40
48
  }
@@ -68,6 +76,10 @@
68
76
  .arco-form-item-message svg {
69
77
  margin-right: 0.08rem;
70
78
  }
79
+ [dir="rtl"] .arco-form-item-message svg {
80
+ margin-right: initial;
81
+ margin-left: 0.08rem;
82
+ }
71
83
  .arco-form-item-error-message {
72
84
  color: #f53f3f ;
73
85
  }
@@ -80,6 +92,10 @@
80
92
  .arco-form-item.arco-form-item-vertical .arco-input-wrap {
81
93
  padding-left: 0;
82
94
  }
95
+ [dir="rtl"] .arco-form-item.arco-form-item-vertical .arco-input-wrap {
96
+ padding-left: initial;
97
+ padding-right: 0;
98
+ }
83
99
  .arco-form-item.arco-form-item-vertical .arco-form-label-item {
84
100
  width: auto;
85
101
  margin-top: 16px;
@@ -20,12 +20,12 @@
20
20
  .use-var(font-size, form-item-label-item-font-size);
21
21
  .use-var(line-height, form-item-label-item-line-height);
22
22
  .use-var(color, form-item-label-item-color);
23
- .use-var(padding-right, form-item-label-item-gutter);
23
+ .use-var-with-rtl(padding-right, form-item-label-item-gutter);
24
24
  .use-var(width, form-item-label-item-width);
25
25
 
26
26
  &-required-asterisk {
27
27
  position: absolute;
28
- left: -0.6em;
28
+ .set-prop-with-rtl(left, -0.6em);
29
29
  top: 0;
30
30
 
31
31
  .use-var(font-size, form-item-label-item-font-size);
@@ -60,7 +60,7 @@
60
60
  }
61
61
 
62
62
  svg {
63
- .rem(margin-right, 4);
63
+ .rem-with-rtl(margin-right, 4);
64
64
  }
65
65
  margin-bottom: 16px;
66
66
  }
@@ -75,7 +75,7 @@
75
75
  &-item.@{prefix}-form-item-vertical {
76
76
  display: block;
77
77
  .arco-input-wrap {
78
- padding-left: 0;
78
+ .set-prop-with-rtl(padding-left, 0);
79
79
  }
80
80
  .@{prefix}-form-label-item {
81
81
  width: auto;
@@ -269,9 +269,9 @@ declare const _default: React.ForwardRefExoticComponent<ImagePreviewProps & Reac
269
269
  * @param {ImagePreviewProps} config configuration
270
270
  * @returns {{ close: () => void; update: (newConfig: ImagePreviewProps) => void; }}
271
271
  */
272
- open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "getContainer" | "onClose" | "onTouchMove" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "onChange" | "onTouchEnd" | "onTouchStart" | "animateDurationSlide" | "loop" | "swipeable" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "lazyloadCount" | "onAfterChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
272
+ open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "loadingArea" | "onClose" | "fit" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
273
273
  close: () => void;
274
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "getContainer" | "onClose" | "onTouchMove" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "onChange" | "onTouchEnd" | "onTouchStart" | "animateDurationSlide" | "loop" | "swipeable" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "lazyloadCount" | "onAfterChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
274
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "loadingArea" | "onClose" | "fit" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
275
275
  };
276
276
  };
277
277
  /**
@@ -800,7 +800,8 @@ var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
800
800
  return /*#__PURE__*/_react.default.createElement(_carousel.default, (0, _extends5.default)({
801
801
  autoPlay: false,
802
802
  loop: loop,
803
- lazyloadCount: lazyloadCount
803
+ lazyloadCount: lazyloadCount,
804
+ stopPropagation: false
804
805
  }, carouselProps), (allImages || []).map(function (image, index) {
805
806
  var innerNode = /*#__PURE__*/_react.default.createElement("div", {
806
807
  key: index,
@@ -910,7 +911,8 @@ var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
910
911
  timeout: displayDuration,
911
912
  type: "fade",
912
913
  mountOnEnter: true,
913
- unmountOnExit: true
914
+ unmountOnExit: true,
915
+ nodeRef: domRef
914
916
  }, /*#__PURE__*/_react.default.createElement("div", {
915
917
  className: (0, _mobileUtils.cls)(prefixCls + "-image-preview", 'all-border-box', {
916
918
  noselect: noselect
@@ -46,6 +46,9 @@
46
46
  height: 100%;
47
47
  will-change: transform;
48
48
  }
49
+ .arco-image-preview .preview-image .image-container {
50
+ overflow: visible;
51
+ }
49
52
  .arco-image-preview .preview-image.preview-hidden {
50
53
  pointer-events: none;
51
54
  }
@@ -41,6 +41,10 @@
41
41
  height: 100%;
42
42
  will-change: transform;
43
43
 
44
+ .image-container {
45
+ overflow: visible;
46
+ }
47
+
44
48
  &.preview-hidden {
45
49
  pointer-events: none;
46
50