@arco-design/mobile-react 2.36.2 → 2.38.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 (455) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/hooks.d.ts +1 -1
  5. package/cjs/_helpers/hooks.js +1 -1
  6. package/cjs/_helpers/react-dom.d.ts +5 -5
  7. package/cjs/_helpers/react-dom.js +49 -32
  8. package/cjs/_helpers/render.js +6 -3
  9. package/cjs/action-sheet/index.d.ts +3 -2
  10. package/cjs/action-sheet/index.js +2 -2
  11. package/cjs/action-sheet/style/css/index.css +18 -0
  12. package/cjs/avatar/style/css/index.css +18 -0
  13. package/cjs/badge/index.d.ts +2 -1
  14. package/cjs/badge/index.js +1 -1
  15. package/cjs/badge/style/css/index.css +26 -4
  16. package/cjs/badge/style/index.less +4 -2
  17. package/cjs/button/style/css/index.css +18 -0
  18. package/cjs/carousel/style/css/index.css +18 -0
  19. package/cjs/cell/style/css/index.css +18 -0
  20. package/cjs/checkbox/checkbox.d.ts +1 -1
  21. package/cjs/checkbox/group.d.ts +1 -1
  22. package/cjs/checkbox/hooks/useMergeProps.d.ts +1 -1
  23. package/cjs/checkbox/index.d.ts +2 -2
  24. package/cjs/checkbox/style/css/index.css +18 -0
  25. package/cjs/circle-progress/style/css/index.css +18 -0
  26. package/cjs/collapse/style/css/index.css +18 -0
  27. package/cjs/context-provider/index.d.ts +8 -2
  28. package/cjs/count-down/hooks.js +2 -2
  29. package/cjs/count-down/style/css/index.css +18 -0
  30. package/cjs/date-picker/style/css/index.css +18 -0
  31. package/cjs/dialog/index.d.ts +12 -6
  32. package/cjs/dialog/index.js +4 -1
  33. package/cjs/dialog/methods.d.ts +6 -2
  34. package/cjs/dialog/style/css/index.css +26 -4
  35. package/cjs/dialog/style/index.less +4 -2
  36. package/cjs/divider/style/css/index.css +18 -0
  37. package/cjs/dropdown/style/css/index.css +18 -0
  38. package/cjs/dropdown-menu/helper.d.ts +2 -2
  39. package/cjs/dropdown-menu/style/css/index.css +18 -0
  40. package/cjs/ellipsis/components/native-ellipsis.d.ts +2 -3
  41. package/cjs/ellipsis/components/native-ellipsis.js +1 -2
  42. package/cjs/ellipsis/style/css/index.css +18 -0
  43. package/cjs/form/style/css/index.css +18 -0
  44. package/cjs/form/type.d.ts +5 -5
  45. package/cjs/grid/style/css/index.css +18 -0
  46. package/cjs/image/style/css/index.css +18 -0
  47. package/cjs/image-picker/style/css/index.css +18 -0
  48. package/cjs/image-preview/index.d.ts +2 -2
  49. package/cjs/image-preview/style/css/index.css +18 -0
  50. package/cjs/index-bar/group.js +3 -1
  51. package/cjs/index-bar/index.d.ts +2 -2
  52. package/cjs/index-bar/style/css/index.css +18 -0
  53. package/cjs/index-bar/utils.d.ts +1 -1
  54. package/cjs/input/style/css/index.css +18 -0
  55. package/cjs/keyboard/style/css/index.css +18 -0
  56. package/cjs/load-more/style/css/index.css +18 -0
  57. package/cjs/loading/style/css/index.css +18 -0
  58. package/cjs/masking/index.d.ts +11 -5
  59. package/cjs/masking/index.js +2 -0
  60. package/cjs/masking/style/css/index.css +18 -0
  61. package/cjs/nav-bar/style/css/index.css +18 -0
  62. package/cjs/notice-bar/style/css/index.css +18 -0
  63. package/cjs/notify/index.d.ts +8 -8
  64. package/cjs/notify/index.js +2 -2
  65. package/cjs/notify/style/css/index.css +18 -0
  66. package/cjs/pagination/style/css/index.css +18 -0
  67. package/cjs/picker/style/css/index.css +18 -0
  68. package/cjs/picker-view/components/cascader.js +3 -1
  69. package/cjs/picker-view/components/picker-cell.js +1 -1
  70. package/cjs/picker-view/index.js +3 -1
  71. package/cjs/picker-view/style/css/index.css +18 -0
  72. package/cjs/popover/style/css/index.css +18 -0
  73. package/cjs/popover/style/css/menu.css +18 -0
  74. package/cjs/popup/index.d.ts +3 -3
  75. package/cjs/popup/index.js +1 -0
  76. package/cjs/popup/style/css/index.css +35 -0
  77. package/cjs/popup/style/index.less +36 -3
  78. package/cjs/popup-swiper/index.d.ts +2 -2
  79. package/cjs/popup-swiper/index.js +20 -3
  80. package/cjs/popup-swiper/style/css/index.css +18 -0
  81. package/cjs/progress/style/css/index.css +18 -0
  82. package/cjs/pull-refresh/hooks.d.ts +2 -2
  83. package/cjs/pull-refresh/style/css/index.css +18 -0
  84. package/cjs/radio/group.d.ts +1 -1
  85. package/cjs/radio/index.d.ts +2 -2
  86. package/cjs/radio/radio.d.ts +1 -1
  87. package/cjs/radio/style/css/index.css +18 -0
  88. package/cjs/rate/style/css/index.css +18 -0
  89. package/cjs/search-bar/style/css/index.css +18 -0
  90. package/cjs/skeleton/elements.js +9 -3
  91. package/cjs/skeleton/style/css/index.css +18 -0
  92. package/cjs/slider/hooks/index.d.ts +1 -1
  93. package/cjs/slider/hooks/useSliderEvents.d.ts +1 -1
  94. package/cjs/slider/style/css/index.css +18 -0
  95. package/cjs/stepper/hooks/useValue.d.ts +2 -1
  96. package/cjs/stepper/style/css/index.css +18 -0
  97. package/cjs/steps/index.d.ts +1 -1
  98. package/cjs/steps/style/css/index.css +18 -0
  99. package/cjs/sticky/style/css/index.css +18 -0
  100. package/cjs/swipe-action/style/css/index.css +18 -0
  101. package/cjs/swipe-load/style/css/index.css +18 -0
  102. package/cjs/switch/style/css/index.css +18 -0
  103. package/cjs/tab-bar/style/css/index.css +18 -0
  104. package/cjs/tabs/index.js +7 -3
  105. package/cjs/tabs/style/css/index.css +18 -0
  106. package/cjs/tabs/tab-cell.js +9 -1
  107. package/cjs/tabs/type.d.ts +7 -2
  108. package/cjs/tag/style/css/index.css +18 -0
  109. package/cjs/textarea/style/css/index.css +18 -0
  110. package/cjs/toast/index.d.ts +12 -12
  111. package/cjs/toast/index.js +1 -1
  112. package/cjs/toast/style/css/index.css +18 -0
  113. package/cjs/transition/index.d.ts +9 -3
  114. package/cjs/transition/index.js +36 -6
  115. package/cjs/transition/style/css/index.css +22 -4
  116. package/cjs/transition/style/index.less +2 -2
  117. package/cjs/uploader/style/css/index.css +18 -0
  118. package/dist/index.js +185 -97
  119. package/dist/index.min.js +4 -4
  120. package/dist/style.css +1049 -6
  121. package/dist/style.min.css +1 -1
  122. package/esm/_helpers/hooks.d.ts +1 -1
  123. package/esm/_helpers/hooks.js +1 -1
  124. package/esm/_helpers/react-dom.d.ts +5 -5
  125. package/esm/_helpers/react-dom.js +49 -30
  126. package/esm/_helpers/render.js +6 -3
  127. package/esm/action-sheet/index.d.ts +3 -2
  128. package/esm/action-sheet/index.js +2 -2
  129. package/esm/action-sheet/style/css/index.css +18 -0
  130. package/esm/avatar/style/css/index.css +18 -0
  131. package/esm/badge/index.d.ts +2 -1
  132. package/esm/badge/index.js +1 -1
  133. package/esm/badge/style/css/index.css +26 -4
  134. package/esm/badge/style/index.less +4 -2
  135. package/esm/button/style/css/index.css +18 -0
  136. package/esm/carousel/style/css/index.css +18 -0
  137. package/esm/cell/style/css/index.css +18 -0
  138. package/esm/checkbox/checkbox.d.ts +1 -1
  139. package/esm/checkbox/group.d.ts +1 -1
  140. package/esm/checkbox/hooks/useMergeProps.d.ts +1 -1
  141. package/esm/checkbox/index.d.ts +2 -2
  142. package/esm/checkbox/style/css/index.css +18 -0
  143. package/esm/circle-progress/style/css/index.css +18 -0
  144. package/esm/collapse/style/css/index.css +18 -0
  145. package/esm/context-provider/index.d.ts +8 -2
  146. package/esm/count-down/hooks.js +2 -2
  147. package/esm/count-down/style/css/index.css +18 -0
  148. package/esm/date-picker/style/css/index.css +18 -0
  149. package/esm/dialog/index.d.ts +12 -6
  150. package/esm/dialog/index.js +4 -1
  151. package/esm/dialog/methods.d.ts +6 -2
  152. package/esm/dialog/style/css/index.css +26 -4
  153. package/esm/dialog/style/index.less +4 -2
  154. package/esm/divider/style/css/index.css +18 -0
  155. package/esm/dropdown/style/css/index.css +18 -0
  156. package/esm/dropdown-menu/helper.d.ts +2 -2
  157. package/esm/dropdown-menu/style/css/index.css +18 -0
  158. package/esm/ellipsis/components/native-ellipsis.d.ts +2 -3
  159. package/esm/ellipsis/components/native-ellipsis.js +1 -1
  160. package/esm/ellipsis/style/css/index.css +18 -0
  161. package/esm/form/style/css/index.css +18 -0
  162. package/esm/form/type.d.ts +5 -5
  163. package/esm/grid/style/css/index.css +18 -0
  164. package/esm/image/style/css/index.css +18 -0
  165. package/esm/image-picker/style/css/index.css +18 -0
  166. package/esm/image-preview/index.d.ts +2 -2
  167. package/esm/image-preview/style/css/index.css +18 -0
  168. package/esm/index-bar/group.js +3 -1
  169. package/esm/index-bar/index.d.ts +2 -2
  170. package/esm/index-bar/style/css/index.css +18 -0
  171. package/esm/index-bar/utils.d.ts +1 -1
  172. package/esm/input/style/css/index.css +18 -0
  173. package/esm/keyboard/style/css/index.css +18 -0
  174. package/esm/load-more/style/css/index.css +18 -0
  175. package/esm/loading/style/css/index.css +18 -0
  176. package/esm/masking/index.d.ts +11 -5
  177. package/esm/masking/index.js +2 -0
  178. package/esm/masking/style/css/index.css +18 -0
  179. package/esm/nav-bar/style/css/index.css +18 -0
  180. package/esm/notice-bar/style/css/index.css +18 -0
  181. package/esm/notify/index.d.ts +8 -8
  182. package/esm/notify/index.js +2 -2
  183. package/esm/notify/style/css/index.css +18 -0
  184. package/esm/pagination/style/css/index.css +18 -0
  185. package/esm/picker/style/css/index.css +18 -0
  186. package/esm/picker-view/components/cascader.js +3 -1
  187. package/esm/picker-view/components/picker-cell.js +1 -1
  188. package/esm/picker-view/index.js +3 -1
  189. package/esm/picker-view/style/css/index.css +18 -0
  190. package/esm/popover/style/css/index.css +18 -0
  191. package/esm/popover/style/css/menu.css +18 -0
  192. package/esm/popup/index.d.ts +3 -3
  193. package/esm/popup/index.js +1 -0
  194. package/esm/popup/style/css/index.css +35 -0
  195. package/esm/popup/style/index.less +36 -3
  196. package/esm/popup-swiper/index.d.ts +2 -2
  197. package/esm/popup-swiper/index.js +20 -3
  198. package/esm/popup-swiper/style/css/index.css +18 -0
  199. package/esm/progress/style/css/index.css +18 -0
  200. package/esm/pull-refresh/hooks.d.ts +2 -2
  201. package/esm/pull-refresh/style/css/index.css +18 -0
  202. package/esm/radio/group.d.ts +1 -1
  203. package/esm/radio/index.d.ts +2 -2
  204. package/esm/radio/radio.d.ts +1 -1
  205. package/esm/radio/style/css/index.css +18 -0
  206. package/esm/rate/style/css/index.css +18 -0
  207. package/esm/search-bar/style/css/index.css +18 -0
  208. package/esm/skeleton/elements.js +9 -3
  209. package/esm/skeleton/style/css/index.css +18 -0
  210. package/esm/slider/hooks/index.d.ts +1 -1
  211. package/esm/slider/hooks/useSliderEvents.d.ts +1 -1
  212. package/esm/slider/style/css/index.css +18 -0
  213. package/esm/stepper/hooks/useValue.d.ts +2 -1
  214. package/esm/stepper/style/css/index.css +18 -0
  215. package/esm/steps/index.d.ts +1 -1
  216. package/esm/steps/style/css/index.css +18 -0
  217. package/esm/sticky/style/css/index.css +18 -0
  218. package/esm/swipe-action/style/css/index.css +18 -0
  219. package/esm/swipe-load/style/css/index.css +18 -0
  220. package/esm/switch/style/css/index.css +18 -0
  221. package/esm/tab-bar/style/css/index.css +18 -0
  222. package/esm/tabs/index.js +7 -3
  223. package/esm/tabs/style/css/index.css +18 -0
  224. package/esm/tabs/tab-cell.js +9 -1
  225. package/esm/tabs/type.d.ts +7 -2
  226. package/esm/tag/style/css/index.css +18 -0
  227. package/esm/textarea/style/css/index.css +18 -0
  228. package/esm/toast/index.d.ts +12 -12
  229. package/esm/toast/index.js +1 -1
  230. package/esm/toast/style/css/index.css +18 -0
  231. package/esm/transition/index.d.ts +9 -3
  232. package/esm/transition/index.js +32 -7
  233. package/esm/transition/style/css/index.css +22 -4
  234. package/esm/transition/style/index.less +2 -2
  235. package/esm/uploader/style/css/index.css +18 -0
  236. package/esnext/_helpers/hooks.js +1 -1
  237. package/esnext/_helpers/react-dom.d.ts +5 -5
  238. package/esnext/_helpers/react-dom.js +47 -28
  239. package/esnext/_helpers/render.js +3 -2
  240. package/esnext/action-sheet/index.d.ts +3 -2
  241. package/esnext/action-sheet/index.js +1 -1
  242. package/esnext/action-sheet/style/css/index.css +18 -0
  243. package/esnext/avatar/style/css/index.css +18 -0
  244. package/esnext/badge/index.d.ts +2 -1
  245. package/esnext/badge/index.js +1 -1
  246. package/esnext/badge/style/css/index.css +26 -4
  247. package/esnext/badge/style/index.less +4 -2
  248. package/esnext/button/style/css/index.css +18 -0
  249. package/esnext/carousel/style/css/index.css +18 -0
  250. package/esnext/cell/style/css/index.css +18 -0
  251. package/esnext/checkbox/style/css/index.css +18 -0
  252. package/esnext/circle-progress/style/css/index.css +18 -0
  253. package/esnext/collapse/style/css/index.css +18 -0
  254. package/esnext/context-provider/index.d.ts +8 -2
  255. package/esnext/context-provider/index.js +1 -1
  256. package/esnext/count-down/hooks.js +2 -2
  257. package/esnext/count-down/style/css/index.css +18 -0
  258. package/esnext/date-picker/style/css/index.css +18 -0
  259. package/esnext/dialog/index.d.ts +12 -6
  260. package/esnext/dialog/index.js +1 -1
  261. package/esnext/dialog/methods.d.ts +6 -2
  262. package/esnext/dialog/style/css/index.css +26 -4
  263. package/esnext/dialog/style/index.less +4 -2
  264. package/esnext/divider/style/css/index.css +18 -0
  265. package/esnext/dropdown/style/css/index.css +18 -0
  266. package/esnext/dropdown-menu/helper.d.ts +1 -1
  267. package/esnext/dropdown-menu/style/css/index.css +18 -0
  268. package/esnext/ellipsis/components/native-ellipsis.d.ts +2 -3
  269. package/esnext/ellipsis/components/native-ellipsis.js +1 -1
  270. package/esnext/ellipsis/style/css/index.css +18 -0
  271. package/esnext/form/style/css/index.css +18 -0
  272. package/esnext/form/type.d.ts +5 -5
  273. package/esnext/grid/style/css/index.css +18 -0
  274. package/esnext/image/style/css/index.css +18 -0
  275. package/esnext/image-picker/style/css/index.css +18 -0
  276. package/esnext/image-preview/index.d.ts +2 -2
  277. package/esnext/image-preview/style/css/index.css +18 -0
  278. package/esnext/index-bar/group.js +5 -1
  279. package/esnext/index-bar/index.d.ts +2 -2
  280. package/esnext/index-bar/style/css/index.css +18 -0
  281. package/esnext/input/style/css/index.css +18 -0
  282. package/esnext/keyboard/style/css/index.css +18 -0
  283. package/esnext/load-more/style/css/index.css +18 -0
  284. package/esnext/loading/style/css/index.css +18 -0
  285. package/esnext/masking/index.d.ts +11 -5
  286. package/esnext/masking/index.js +3 -3
  287. package/esnext/masking/style/css/index.css +18 -0
  288. package/esnext/nav-bar/style/css/index.css +18 -0
  289. package/esnext/notice-bar/style/css/index.css +18 -0
  290. package/esnext/notify/index.d.ts +8 -8
  291. package/esnext/notify/index.js +2 -2
  292. package/esnext/notify/style/css/index.css +18 -0
  293. package/esnext/pagination/style/css/index.css +18 -0
  294. package/esnext/picker/style/css/index.css +18 -0
  295. package/esnext/picker-view/components/cascader.js +5 -1
  296. package/esnext/picker-view/components/picker-cell.js +1 -1
  297. package/esnext/picker-view/index.js +5 -1
  298. package/esnext/picker-view/style/css/index.css +18 -0
  299. package/esnext/popover/style/css/index.css +18 -0
  300. package/esnext/popover/style/css/menu.css +18 -0
  301. package/esnext/popup/index.d.ts +3 -3
  302. package/esnext/popup/index.js +1 -1
  303. package/esnext/popup/style/css/index.css +35 -0
  304. package/esnext/popup/style/index.less +36 -3
  305. package/esnext/popup-swiper/index.d.ts +2 -2
  306. package/esnext/popup-swiper/index.js +7 -2
  307. package/esnext/popup-swiper/style/css/index.css +18 -0
  308. package/esnext/progress/style/css/index.css +18 -0
  309. package/esnext/pull-refresh/hooks.d.ts +2 -2
  310. package/esnext/pull-refresh/style/css/index.css +18 -0
  311. package/esnext/radio/style/css/index.css +18 -0
  312. package/esnext/rate/style/css/index.css +18 -0
  313. package/esnext/search-bar/style/css/index.css +18 -0
  314. package/esnext/skeleton/elements.js +15 -3
  315. package/esnext/skeleton/style/css/index.css +18 -0
  316. package/esnext/slider/hooks/useSliderEvents.d.ts +1 -1
  317. package/esnext/slider/style/css/index.css +18 -0
  318. package/esnext/stepper/style/css/index.css +18 -0
  319. package/esnext/steps/style/css/index.css +18 -0
  320. package/esnext/sticky/style/css/index.css +18 -0
  321. package/esnext/swipe-action/style/css/index.css +18 -0
  322. package/esnext/swipe-load/style/css/index.css +18 -0
  323. package/esnext/switch/style/css/index.css +18 -0
  324. package/esnext/tab-bar/style/css/index.css +18 -0
  325. package/esnext/tabs/index.js +3 -2
  326. package/esnext/tabs/style/css/index.css +18 -0
  327. package/esnext/tabs/tab-cell.js +8 -1
  328. package/esnext/tabs/type.d.ts +7 -2
  329. package/esnext/tag/style/css/index.css +18 -0
  330. package/esnext/textarea/style/css/index.css +18 -0
  331. package/esnext/toast/index.d.ts +12 -12
  332. package/esnext/toast/index.js +1 -1
  333. package/esnext/toast/style/css/index.css +18 -0
  334. package/esnext/transition/index.d.ts +9 -3
  335. package/esnext/transition/index.js +28 -3
  336. package/esnext/transition/style/css/index.css +22 -4
  337. package/esnext/transition/style/index.less +2 -2
  338. package/esnext/uploader/style/css/index.css +18 -0
  339. package/package.json +3 -3
  340. package/style/css/public.css +18 -0
  341. package/tokens/mixin/index.less +31 -2
  342. package/umd/_helpers/hooks.d.ts +1 -1
  343. package/umd/_helpers/hooks.js +1 -1
  344. package/umd/_helpers/react-dom.d.ts +5 -5
  345. package/umd/_helpers/react-dom.js +53 -35
  346. package/umd/_helpers/render.js +6 -3
  347. package/umd/action-sheet/index.d.ts +3 -2
  348. package/umd/action-sheet/index.js +2 -2
  349. package/umd/action-sheet/style/css/index.css +18 -0
  350. package/umd/avatar/style/css/index.css +18 -0
  351. package/umd/badge/index.d.ts +2 -1
  352. package/umd/badge/index.js +1 -1
  353. package/umd/badge/style/css/index.css +26 -4
  354. package/umd/badge/style/index.less +4 -2
  355. package/umd/button/style/css/index.css +18 -0
  356. package/umd/carousel/style/css/index.css +18 -0
  357. package/umd/cell/style/css/index.css +18 -0
  358. package/umd/checkbox/checkbox.d.ts +1 -1
  359. package/umd/checkbox/group.d.ts +1 -1
  360. package/umd/checkbox/hooks/useMergeProps.d.ts +1 -1
  361. package/umd/checkbox/index.d.ts +2 -2
  362. package/umd/checkbox/style/css/index.css +18 -0
  363. package/umd/circle-progress/style/css/index.css +18 -0
  364. package/umd/collapse/style/css/index.css +18 -0
  365. package/umd/context-provider/index.d.ts +8 -2
  366. package/umd/count-down/hooks.js +2 -2
  367. package/umd/count-down/style/css/index.css +18 -0
  368. package/umd/date-picker/style/css/index.css +18 -0
  369. package/umd/dialog/index.d.ts +12 -6
  370. package/umd/dialog/index.js +4 -1
  371. package/umd/dialog/methods.d.ts +6 -2
  372. package/umd/dialog/style/css/index.css +26 -4
  373. package/umd/dialog/style/index.less +4 -2
  374. package/umd/divider/style/css/index.css +18 -0
  375. package/umd/dropdown/style/css/index.css +18 -0
  376. package/umd/dropdown-menu/helper.d.ts +2 -2
  377. package/umd/dropdown-menu/style/css/index.css +18 -0
  378. package/umd/ellipsis/components/native-ellipsis.d.ts +2 -3
  379. package/umd/ellipsis/components/native-ellipsis.js +1 -2
  380. package/umd/ellipsis/style/css/index.css +18 -0
  381. package/umd/form/style/css/index.css +18 -0
  382. package/umd/form/type.d.ts +5 -5
  383. package/umd/grid/style/css/index.css +18 -0
  384. package/umd/image/style/css/index.css +18 -0
  385. package/umd/image-picker/style/css/index.css +18 -0
  386. package/umd/image-preview/index.d.ts +2 -2
  387. package/umd/image-preview/style/css/index.css +18 -0
  388. package/umd/index-bar/group.js +3 -1
  389. package/umd/index-bar/index.d.ts +2 -2
  390. package/umd/index-bar/style/css/index.css +18 -0
  391. package/umd/index-bar/utils.d.ts +1 -1
  392. package/umd/input/style/css/index.css +18 -0
  393. package/umd/keyboard/style/css/index.css +18 -0
  394. package/umd/load-more/style/css/index.css +18 -0
  395. package/umd/loading/style/css/index.css +18 -0
  396. package/umd/masking/index.d.ts +11 -5
  397. package/umd/masking/index.js +2 -0
  398. package/umd/masking/style/css/index.css +18 -0
  399. package/umd/nav-bar/style/css/index.css +18 -0
  400. package/umd/notice-bar/style/css/index.css +18 -0
  401. package/umd/notify/index.d.ts +8 -8
  402. package/umd/notify/index.js +2 -2
  403. package/umd/notify/style/css/index.css +18 -0
  404. package/umd/pagination/style/css/index.css +18 -0
  405. package/umd/picker/style/css/index.css +18 -0
  406. package/umd/picker-view/components/cascader.js +3 -1
  407. package/umd/picker-view/components/picker-cell.js +1 -1
  408. package/umd/picker-view/index.js +3 -1
  409. package/umd/picker-view/style/css/index.css +18 -0
  410. package/umd/popover/style/css/index.css +18 -0
  411. package/umd/popover/style/css/menu.css +18 -0
  412. package/umd/popup/index.d.ts +3 -3
  413. package/umd/popup/index.js +1 -0
  414. package/umd/popup/style/css/index.css +35 -0
  415. package/umd/popup/style/index.less +36 -3
  416. package/umd/popup-swiper/index.d.ts +2 -2
  417. package/umd/popup-swiper/index.js +20 -3
  418. package/umd/popup-swiper/style/css/index.css +18 -0
  419. package/umd/progress/style/css/index.css +18 -0
  420. package/umd/pull-refresh/hooks.d.ts +2 -2
  421. package/umd/pull-refresh/style/css/index.css +18 -0
  422. package/umd/radio/group.d.ts +1 -1
  423. package/umd/radio/index.d.ts +2 -2
  424. package/umd/radio/radio.d.ts +1 -1
  425. package/umd/radio/style/css/index.css +18 -0
  426. package/umd/rate/style/css/index.css +18 -0
  427. package/umd/search-bar/style/css/index.css +18 -0
  428. package/umd/skeleton/elements.js +9 -3
  429. package/umd/skeleton/style/css/index.css +18 -0
  430. package/umd/slider/hooks/index.d.ts +1 -1
  431. package/umd/slider/hooks/useSliderEvents.d.ts +1 -1
  432. package/umd/slider/style/css/index.css +18 -0
  433. package/umd/stepper/hooks/useValue.d.ts +2 -1
  434. package/umd/stepper/style/css/index.css +18 -0
  435. package/umd/steps/index.d.ts +1 -1
  436. package/umd/steps/style/css/index.css +18 -0
  437. package/umd/sticky/style/css/index.css +18 -0
  438. package/umd/swipe-action/style/css/index.css +18 -0
  439. package/umd/swipe-load/style/css/index.css +18 -0
  440. package/umd/switch/style/css/index.css +18 -0
  441. package/umd/tab-bar/style/css/index.css +18 -0
  442. package/umd/tabs/index.js +7 -3
  443. package/umd/tabs/style/css/index.css +18 -0
  444. package/umd/tabs/tab-cell.js +9 -1
  445. package/umd/tabs/type.d.ts +7 -2
  446. package/umd/tag/style/css/index.css +18 -0
  447. package/umd/textarea/style/css/index.css +18 -0
  448. package/umd/toast/index.d.ts +12 -12
  449. package/umd/toast/index.js +1 -1
  450. package/umd/toast/style/css/index.css +18 -0
  451. package/umd/transition/index.d.ts +9 -3
  452. package/umd/transition/index.js +36 -6
  453. package/umd/transition/style/css/index.css +22 -4
  454. package/umd/transition/style/index.less +2 -2
  455. package/umd/uploader/style/css/index.css +18 -0
@@ -68,7 +68,8 @@ var TabCell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
68
68
  tabBarStyle = props.tabBarStyle,
69
69
  tabBarClass = props.tabBarClass,
70
70
  translateZ = props.translateZ,
71
- tabBarStopPropagation = props.tabBarStopPropagation;
71
+ tabBarStopPropagation = props.tabBarStopPropagation,
72
+ onUnderlineFirstShow = props.onUnderlineFirstShow;
72
73
  var prefix = prefixCls + "-tab-cell";
73
74
 
74
75
  var _useContext = (0, _react.useContext)(_contextProvider.GlobalContext),
@@ -147,6 +148,13 @@ var TabCell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
147
148
  (0, _react.useEffect)(function () {
148
149
  updateScrollPosition();
149
150
  }, [activeIndex, wrapSize]);
151
+ (0, _react.useEffect)(function () {
152
+ // underline 首次展示时,通知父组件启用 cellTrans
153
+ // @en When underline is first shown, notify parent component to enable cellTrans
154
+ if (showLine && onUnderlineFirstShow) {
155
+ onUnderlineFirstShow();
156
+ }
157
+ }, [showLine]);
150
158
  (0, _helpers.useUpdateEffect)(function () {
151
159
  var _underlineRef$current2;
152
160
 
@@ -1,4 +1,4 @@
1
- import { CSSProperties, ReactNode, ReactNodeArray } from 'react';
1
+ import { CSSProperties, ReactNode } from 'react';
2
2
  export declare type TabData = string | {
3
3
  title: ReactNode;
4
4
  [x: string]: any;
@@ -533,6 +533,11 @@ export interface TabCellProps extends Pick<TabsProps, 'tabs' | 'type' | 'onTabCl
533
533
  * @en Does the touch event of the current TabBar require stopPropagation
534
534
  */
535
535
  tabBarStopPropagation: boolean;
536
+ /**
537
+ * underline 首次展示时的回调
538
+ * @en Callback when underline is first shown
539
+ */
540
+ onUnderlineFirstShow?: () => void;
536
541
  }
537
542
  export interface TabCellRef {
538
543
  /**
@@ -573,7 +578,7 @@ export interface TabCellRef {
573
578
  }
574
579
  export interface TabPaneProps extends Pick<TabsProps, 'duration' | 'transitionDuration' | 'lazyloadCount' | 'hideContentStyle' | 'renderHideContent' | 'mode' | 'tabPaneClass' | 'tabPaneStyle' | 'tabPaneExtra' | 'getScrollContainer' | 'scrollThrottle' | 'scrollOffset' | 'goLastWhenScrollBottom' | 'scrollVertical' | 'translateZ' | 'fullScreen' | 'autoHeight' | 'onScroll' | 'swipeEnergySaving'> {
575
580
  prefixCls?: string;
576
- panes: ReactNodeArray;
581
+ panes: ReactNode[];
577
582
  activeIndex: number;
578
583
  activeIndexRef: React.MutableRefObject<number>;
579
584
  tabDirection: 'horizontal' | 'vertical';
@@ -75,6 +75,24 @@
75
75
  * }
76
76
  * ```
77
77
  */
78
+ /**
79
+ * 为属性设置 transition 变量
80
+ * @desc {en} set the transition variable for the attribute
81
+ * @param @transitionVariable transition 变量名
82
+ * @param @transitionVariable {en} transition variable name
83
+ * @param @backupVariable 备份变量名
84
+ * @param @backupVariable {en} backup variable name
85
+ * @param @property css属性名
86
+ * @param @property {en} css property
87
+ * @example
88
+ * ```
89
+ * @import '@arco-design/mobile-react/style/mixin.less';
90
+ *
91
+ * .demo {
92
+ * .use-transition-var(builtin-transition-fade-enter-duration, transition-fade-duration);
93
+ * }
94
+ * ```
95
+ */
78
96
  /**
79
97
  * 在常规模式和 rtl 模式下为属性设置 arco 提供的 token 变量
80
98
  * @desc {en} set the token variable provided by Arco for the attribute in regular mode and RTL mode
@@ -75,6 +75,24 @@
75
75
  * }
76
76
  * ```
77
77
  */
78
+ /**
79
+ * 为属性设置 transition 变量
80
+ * @desc {en} set the transition variable for the attribute
81
+ * @param @transitionVariable transition 变量名
82
+ * @param @transitionVariable {en} transition variable name
83
+ * @param @backupVariable 备份变量名
84
+ * @param @backupVariable {en} backup variable name
85
+ * @param @property css属性名
86
+ * @param @property {en} css property
87
+ * @example
88
+ * ```
89
+ * @import '@arco-design/mobile-react/style/mixin.less';
90
+ *
91
+ * .demo {
92
+ * .use-transition-var(builtin-transition-fade-enter-duration, transition-fade-duration);
93
+ * }
94
+ * ```
95
+ */
78
96
  /**
79
97
  * 在常规模式和 rtl 模式下为属性设置 arco 提供的 token 变量
80
98
  * @desc {en} set the token variable provided by Arco for the attribute in regular mode and RTL mode
@@ -185,8 +185,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
185
185
  * @param {string | ToastProps} config Configuration
186
186
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
187
187
  */
188
- toast: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
189
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
188
+ toast: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
189
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
190
190
  close: () => void;
191
191
  hide: () => void;
192
192
  };
@@ -196,8 +196,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
196
196
  * @param {string | ToastProps} config Configuration
197
197
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
198
198
  */
199
- info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
200
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
199
+ info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
200
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
201
201
  close: () => void;
202
202
  hide: () => void;
203
203
  };
@@ -207,8 +207,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
207
207
  * @param {string | ToastProps} config Configuration
208
208
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
209
209
  */
210
- success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
211
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
210
+ success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
211
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
212
212
  close: () => void;
213
213
  hide: () => void;
214
214
  };
@@ -218,8 +218,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
218
218
  * @param {string | ToastProps} config Configuration
219
219
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
220
220
  */
221
- error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
222
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
221
+ error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
222
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
223
223
  close: () => void;
224
224
  hide: () => void;
225
225
  };
@@ -229,8 +229,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
229
229
  * @param {string | ToastProps} config Configuration
230
230
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
231
231
  */
232
- loading: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
233
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
232
+ loading: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
233
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
234
234
  close: () => void;
235
235
  hide: () => void;
236
236
  };
@@ -240,8 +240,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
240
240
  * @param {string | ToastProps} config Configuration
241
241
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
242
242
  */
243
- warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
244
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
243
+ warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
244
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
245
245
  close: () => void;
246
246
  hide: () => void;
247
247
  };
@@ -69,7 +69,7 @@ var Toast = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
69
69
  direction = _props$direction === void 0 ? 'center' : _props$direction,
70
70
  typeIconMap = props.typeIconMap,
71
71
  initialBodyOverflow = props.initialBodyOverflow;
72
- var closeTimerRef = (0, _react.useRef)();
72
+ var closeTimerRef = (0, _react.useRef)(undefined);
73
73
  var domRef = (0, _react.useRef)(null);
74
74
  var wrapDomRef = (0, _react.useRef)(null);
75
75
  var isInitialMount = (0, _react.useRef)(false);
@@ -75,6 +75,24 @@
75
75
  * }
76
76
  * ```
77
77
  */
78
+ /**
79
+ * 为属性设置 transition 变量
80
+ * @desc {en} set the transition variable for the attribute
81
+ * @param @transitionVariable transition 变量名
82
+ * @param @transitionVariable {en} transition variable name
83
+ * @param @backupVariable 备份变量名
84
+ * @param @backupVariable {en} backup variable name
85
+ * @param @property css属性名
86
+ * @param @property {en} css property
87
+ * @example
88
+ * ```
89
+ * @import '@arco-design/mobile-react/style/mixin.less';
90
+ *
91
+ * .demo {
92
+ * .use-transition-var(builtin-transition-fade-enter-duration, transition-fade-duration);
93
+ * }
94
+ * ```
95
+ */
78
96
  /**
79
97
  * 在常规模式和 rtl 模式下为属性设置 arco 提供的 token 变量
80
98
  * @desc {en} set the token variable provided by Arco for the attribute in regular mode and RTL mode
@@ -1,11 +1,11 @@
1
- import React from 'react';
2
- import { CSSTransitionProps } from 'react-transition-group/CSSTransition';
1
+ import type { ReactNode } from 'react';
2
+ import type { CSSTransitionProps } from 'react-transition-group/CSSTransition';
3
3
  export declare type TransitionProps = Omit<CSSTransitionProps, 'timeout'> & {
4
4
  /**
5
5
  * 待执行动画内容
6
6
  * @en Animation content to be executed
7
7
  */
8
- children?: React.ReactNode;
8
+ children?: ReactNode;
9
9
  /**
10
10
  * 待执行动画css类名
11
11
  * @en Css classname of the animation to be executed
@@ -37,6 +37,12 @@ export declare type TransitionProps = Omit<CSSTransitionProps, 'timeout'> & {
37
37
  * @default true
38
38
  */
39
39
  unmountOnExit?: boolean;
40
+ /**
41
+ * 动画时长变量标识
42
+ * @en Animation duration variable identifier
43
+ * @default type 属性值
44
+ */
45
+ transitionVarType?: string;
40
46
  };
41
47
  /**
42
48
  * react-transition-group/CSSTransition 的简单封装。
@@ -9,14 +9,19 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
 
10
10
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
11
 
12
- var _react = _interopRequireDefault(require("react"));
12
+ var _react = _interopRequireWildcard(require("react"));
13
13
 
14
14
  var _CSSTransition = _interopRequireDefault(require("react-transition-group/CSSTransition"));
15
15
 
16
16
  var _contextProvider = require("../context-provider");
17
17
 
18
- var _excluded = ["children", "type", "in", "timeout", "mountOnEnter", "unmountOnExit"];
18
+ var _excluded = ["children", "type", "in", "timeout", "mountOnEnter", "unmountOnExit", "transitionVarType"];
19
19
 
20
+ 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); }
21
+
22
+ 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; }
23
+
24
+ var DEFAULT_TIMEOUT = 300;
20
25
  /**
21
26
  * react-transition-group/CSSTransition 的简单封装。
22
27
  * @en Simple wrapper for react-transition-group/CSSTransition.
@@ -25,26 +30,51 @@ var _excluded = ["children", "type", "in", "timeout", "mountOnEnter", "unmountOn
25
30
  * @name 动画过渡
26
31
  * @name_en Transition
27
32
  */
33
+
28
34
  function Transition(props) {
29
35
  var _props$children = props.children,
30
36
  children = _props$children === void 0 ? /*#__PURE__*/_react.default.createElement("div", null) : _props$children,
31
37
  type = props.type,
32
38
  transIn = props.in,
33
39
  _props$timeout = props.timeout,
34
- timeout = _props$timeout === void 0 ? 300 : _props$timeout,
40
+ timeout = _props$timeout === void 0 ? DEFAULT_TIMEOUT : _props$timeout,
35
41
  _props$mountOnEnter = props.mountOnEnter,
36
42
  mountOnEnter = _props$mountOnEnter === void 0 ? true : _props$mountOnEnter,
37
43
  _props$unmountOnExit = props.unmountOnExit,
38
44
  unmountOnExit = _props$unmountOnExit === void 0 ? true : _props$unmountOnExit,
45
+ transitionVarType = props.transitionVarType,
39
46
  restProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
40
- return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
41
- var prefixCls = _ref.prefixCls;
47
+ var varPrefix = "builtin-transition-" + (transitionVarType || type); // 计算动画时长,支持对象形式的 timeout
48
+
49
+ var getDuration = function getDuration(phase) {
50
+ if (typeof timeout === 'number') {
51
+ return timeout;
52
+ }
53
+
54
+ return timeout[phase] || DEFAULT_TIMEOUT;
55
+ }; // 生成 CSS 变量样式
56
+
57
+
58
+ var cssVariables = (0, _react.useMemo)(function () {
59
+ var _ref;
60
+
61
+ var enterDuration = getDuration('enter');
62
+ var exitDuration = getDuration('exit');
63
+ var appearDuration = getDuration('appear');
64
+ return _ref = {}, _ref["--" + varPrefix + "-enter-duration"] = enterDuration + "ms", _ref["--" + varPrefix + "-exit-duration"] = exitDuration + "ms", _ref["--" + varPrefix + "-appear-duration"] = appearDuration + "ms", _ref;
65
+ }, [timeout, varPrefix]);
66
+ return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref2) {
67
+ var _props;
68
+
69
+ var prefixCls = _ref2.prefixCls;
42
70
  return /*#__PURE__*/_react.default.createElement(_CSSTransition.default, (0, _extends2.default)({
43
71
  in: transIn,
44
72
  timeout: timeout,
45
73
  classNames: prefixCls + "-" + type,
46
74
  mountOnEnter: mountOnEnter,
47
75
  unmountOnExit: unmountOnExit
48
- }, restProps), children);
76
+ }, restProps), /*#__PURE__*/(0, _react.cloneElement)(children, {
77
+ style: (0, _extends2.default)({}, cssVariables, children == null ? void 0 : (_props = children.props) == null ? void 0 : _props.style)
78
+ }));
49
79
  });
50
80
  }
@@ -75,6 +75,24 @@
75
75
  * }
76
76
  * ```
77
77
  */
78
+ /**
79
+ * 为属性设置 transition 变量
80
+ * @desc {en} set the transition variable for the attribute
81
+ * @param @transitionVariable transition 变量名
82
+ * @param @transitionVariable {en} transition variable name
83
+ * @param @backupVariable 备份变量名
84
+ * @param @backupVariable {en} backup variable name
85
+ * @param @property css属性名
86
+ * @param @property {en} css property
87
+ * @example
88
+ * ```
89
+ * @import '@arco-design/mobile-react/style/mixin.less';
90
+ *
91
+ * .demo {
92
+ * .use-transition-var(builtin-transition-fade-enter-duration, transition-fade-duration);
93
+ * }
94
+ * ```
95
+ */
78
96
  /**
79
97
  * 在常规模式和 rtl 模式下为属性设置 arco 提供的 token 变量
80
98
  * @desc {en} set the token variable provided by Arco for the attribute in regular mode and RTL mode
@@ -517,8 +535,8 @@
517
535
  opacity: 1;
518
536
  -webkit-transition-property: opacity;
519
537
  transition-property: opacity;
520
- -webkit-transition-duration: 300ms ;
521
- transition-duration: 300ms ;
538
+ -webkit-transition-duration: var(--builtin-transition-fade-enter-duration, 300ms );
539
+ transition-duration: var(--builtin-transition-fade-enter-duration, 300ms );
522
540
  }
523
541
  .arco-fade-exit {
524
542
  opacity: 1;
@@ -527,8 +545,8 @@
527
545
  opacity: 0;
528
546
  -webkit-transition-property: opacity;
529
547
  transition-property: opacity;
530
- -webkit-transition-duration: 300ms ;
531
- transition-duration: 300ms ;
548
+ -webkit-transition-duration: var(--builtin-transition-fade-exit-duration, 300ms );
549
+ transition-duration: var(--builtin-transition-fade-exit-duration, 300ms );
532
550
  }
533
551
  .arco-fade-exit-done {
534
552
  display: none;
@@ -9,7 +9,7 @@
9
9
  &-enter-active {
10
10
  opacity: 1;
11
11
  transition-property: opacity;
12
- .use-var(transition-duration, transition-fade-duration);
12
+ .use-transition-var(builtin-transition-fade-enter-duration, transition-fade-duration);
13
13
  }
14
14
 
15
15
  &-exit {
@@ -19,7 +19,7 @@
19
19
  &-exit-active {
20
20
  opacity: 0;
21
21
  transition-property: opacity;
22
- .use-var(transition-duration, transition-fade-duration);
22
+ .use-transition-var(builtin-transition-fade-exit-duration, transition-fade-duration);
23
23
  }
24
24
 
25
25
  &-exit-done {
@@ -75,6 +75,24 @@
75
75
  * }
76
76
  * ```
77
77
  */
78
+ /**
79
+ * 为属性设置 transition 变量
80
+ * @desc {en} set the transition variable for the attribute
81
+ * @param @transitionVariable transition 变量名
82
+ * @param @transitionVariable {en} transition variable name
83
+ * @param @backupVariable 备份变量名
84
+ * @param @backupVariable {en} backup variable name
85
+ * @param @property css属性名
86
+ * @param @property {en} css property
87
+ * @example
88
+ * ```
89
+ * @import '@arco-design/mobile-react/style/mixin.less';
90
+ *
91
+ * .demo {
92
+ * .use-transition-var(builtin-transition-fade-enter-duration, transition-fade-duration);
93
+ * }
94
+ * ```
95
+ */
78
96
  /**
79
97
  * 在常规模式和 rtl 模式下为属性设置 arco 提供的 token 变量
80
98
  * @desc {en} set the token variable provided by Arco for the attribute in regular mode and RTL mode