@arco-design/mobile-react 2.25.4 → 2.26.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 (807) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/hooks.js +124 -43
  5. package/cjs/_helpers/index.js +13 -2
  6. package/cjs/_helpers/react-dom.js +12 -0
  7. package/cjs/_helpers/render.js +12 -0
  8. package/cjs/action-sheet/index.d.ts +2 -2
  9. package/cjs/action-sheet/index.js +30 -10
  10. package/cjs/action-sheet/methods.js +2 -0
  11. package/cjs/action-sheet/style/css/index.js +2 -0
  12. package/cjs/action-sheet/style/index.js +2 -0
  13. package/cjs/avatar/group.js +24 -12
  14. package/cjs/avatar/index.js +77 -51
  15. package/cjs/avatar/style/css/index.js +2 -0
  16. package/cjs/avatar/style/index.js +2 -0
  17. package/cjs/badge/index.js +29 -18
  18. package/cjs/badge/style/css/index.js +1 -0
  19. package/cjs/badge/style/index.js +1 -0
  20. package/cjs/button/hooks.js +20 -15
  21. package/cjs/button/index.js +67 -46
  22. package/cjs/button/style/css/index.js +2 -0
  23. package/cjs/button/style/index.js +2 -0
  24. package/cjs/carousel/index.d.ts +6 -0
  25. package/cjs/carousel/index.js +342 -184
  26. package/cjs/carousel/style/css/index.css +50 -15
  27. package/cjs/carousel/style/css/index.js +1 -0
  28. package/cjs/carousel/style/index.js +1 -0
  29. package/cjs/carousel/style/index.less +19 -14
  30. package/cjs/cell/arrow.js +3 -0
  31. package/cjs/cell/cell.js +23 -14
  32. package/cjs/cell/demo/style/css/mobile.css +8 -0
  33. package/cjs/cell/demo/style/mobile.less +2 -2
  34. package/cjs/cell/group.js +21 -9
  35. package/cjs/cell/index.js +7 -1
  36. package/cjs/cell/style/css/index.css +16 -0
  37. package/cjs/cell/style/css/index.js +1 -0
  38. package/cjs/cell/style/index.js +1 -0
  39. package/cjs/cell/style/index.less +6 -4
  40. package/cjs/checkbox/checkbox.js +57 -31
  41. package/cjs/checkbox/group.js +38 -24
  42. package/cjs/checkbox/hooks/index.js +2 -0
  43. package/cjs/checkbox/hooks/useMergeProps.js +14 -7
  44. package/cjs/checkbox/index.js +8 -1
  45. package/cjs/checkbox/style/css/index.js +1 -0
  46. package/cjs/checkbox/style/index.js +1 -0
  47. package/cjs/checkbox/type.js +2 -0
  48. package/cjs/circle-progress/index.js +57 -37
  49. package/cjs/circle-progress/style/css/index.js +1 -0
  50. package/cjs/circle-progress/style/index.js +1 -0
  51. package/cjs/collapse/collapse.js +56 -27
  52. package/cjs/collapse/group.js +44 -20
  53. package/cjs/collapse/index.js +9 -0
  54. package/cjs/collapse/style/css/index.js +1 -0
  55. package/cjs/collapse/style/index.js +1 -0
  56. package/cjs/collapse/utils.js +7 -0
  57. package/cjs/context-provider/index.d.ts +6 -0
  58. package/cjs/context-provider/index.js +30 -11
  59. package/cjs/context-provider/style/css/index.js +1 -0
  60. package/cjs/context-provider/style/index.js +1 -0
  61. package/cjs/count-down/hooks.js +43 -24
  62. package/cjs/count-down/index.js +37 -29
  63. package/cjs/count-down/singleton.js +12 -2
  64. package/cjs/count-down/style/css/index.js +1 -0
  65. package/cjs/count-down/style/index.js +1 -0
  66. package/cjs/count-down/util.js +47 -33
  67. package/cjs/date-picker/helper.js +14 -7
  68. package/cjs/date-picker/index.js +106 -42
  69. package/cjs/date-picker/style/css/index.js +2 -0
  70. package/cjs/date-picker/style/index.js +2 -0
  71. package/cjs/dialog/index.d.ts +2 -2
  72. package/cjs/dialog/index.js +54 -28
  73. package/cjs/dialog/methods.js +22 -9
  74. package/cjs/dialog/style/css/index.js +2 -0
  75. package/cjs/dialog/style/index.js +2 -0
  76. package/cjs/divider/demo/style/css/mobile.css +7 -0
  77. package/cjs/divider/demo/style/mobile.less +12 -0
  78. package/cjs/divider/index.d.ts +49 -0
  79. package/cjs/divider/index.js +65 -0
  80. package/cjs/divider/style/css/index.css +69 -0
  81. package/cjs/divider/style/css/index.d.ts +2 -0
  82. package/cjs/divider/style/css/index.js +5 -0
  83. package/cjs/divider/style/index.d.ts +2 -0
  84. package/cjs/divider/style/index.js +5 -0
  85. package/cjs/divider/style/index.less +66 -0
  86. package/cjs/dropdown/dropdown.js +113 -74
  87. package/cjs/dropdown/index.js +8 -1
  88. package/cjs/dropdown/options.js +28 -12
  89. package/cjs/dropdown/style/css/index.js +1 -0
  90. package/cjs/dropdown/style/index.js +1 -0
  91. package/cjs/dropdown-menu/dropdown-menu.js +84 -49
  92. package/cjs/dropdown-menu/helper.js +27 -6
  93. package/cjs/dropdown-menu/index.js +6 -0
  94. package/cjs/dropdown-menu/style/css/index.js +2 -0
  95. package/cjs/dropdown-menu/style/index.js +2 -0
  96. package/cjs/ellipsis/components/js-ellipsis.js +72 -33
  97. package/cjs/ellipsis/components/native-ellipsis.js +15 -9
  98. package/cjs/ellipsis/index.js +32 -19
  99. package/cjs/ellipsis/style/css/index.js +1 -0
  100. package/cjs/ellipsis/style/index.js +1 -0
  101. package/cjs/ellipsis/utils/dom.js +8 -0
  102. package/cjs/ellipsis/utils/is.js +5 -1
  103. package/cjs/form/form-item-context.js +5 -0
  104. package/cjs/form/form-item.js +124 -42
  105. package/cjs/form/index.js +35 -17
  106. package/cjs/form/style/css/index.js +1 -0
  107. package/cjs/form/style/index.js +1 -0
  108. package/cjs/form/type.js +3 -0
  109. package/cjs/form/useForm.js +76 -18
  110. package/cjs/form/utils.js +10 -3
  111. package/cjs/grid/index.js +41 -21
  112. package/cjs/grid/style/css/index.js +1 -0
  113. package/cjs/grid/style/index.js +1 -0
  114. package/cjs/icon/IconAdd/index.js +12 -5
  115. package/cjs/icon/IconArrowBack/index.js +12 -5
  116. package/cjs/icon/IconArrowDown/index.js +12 -5
  117. package/cjs/icon/IconArrowIn/index.js +12 -5
  118. package/cjs/icon/IconArrowUp/index.js +12 -5
  119. package/cjs/icon/IconCheck/index.js +12 -5
  120. package/cjs/icon/IconCheckBold/index.js +12 -5
  121. package/cjs/icon/IconCircleChecked/index.js +12 -5
  122. package/cjs/icon/IconCircleDisabled/index.js +12 -5
  123. package/cjs/icon/IconCircleUnchecked/index.js +12 -5
  124. package/cjs/icon/IconClear/index.js +12 -5
  125. package/cjs/icon/IconClose/index.js +12 -5
  126. package/cjs/icon/IconCloseBold/index.js +12 -5
  127. package/cjs/icon/IconDelete/index.js +12 -5
  128. package/cjs/icon/IconEdit/index.js +12 -5
  129. package/cjs/icon/IconErrorCircle/index.js +12 -5
  130. package/cjs/icon/IconEyeInvisible/index.js +12 -5
  131. package/cjs/icon/IconEyeVisible/index.js +12 -5
  132. package/cjs/icon/IconEyelashInvisible/index.js +12 -5
  133. package/cjs/icon/IconGift/index.js +12 -5
  134. package/cjs/icon/IconHeart/index.js +12 -5
  135. package/cjs/icon/IconHome/index.js +12 -5
  136. package/cjs/icon/IconLikeCircle/index.js +12 -5
  137. package/cjs/icon/IconMinus/index.js +12 -5
  138. package/cjs/icon/IconMore/index.js +12 -5
  139. package/cjs/icon/IconNotice/index.js +12 -5
  140. package/cjs/icon/IconNoticeOff/index.js +12 -5
  141. package/cjs/icon/IconPicture/index.js +12 -5
  142. package/cjs/icon/IconPlay/index.js +12 -5
  143. package/cjs/icon/IconQuestionCircle/index.js +12 -5
  144. package/cjs/icon/IconRefresh/index.js +12 -5
  145. package/cjs/icon/IconSad/index.js +12 -5
  146. package/cjs/icon/IconScan/index.js +12 -5
  147. package/cjs/icon/IconSearch/index.js +12 -5
  148. package/cjs/icon/IconSetting/index.js +12 -5
  149. package/cjs/icon/IconShop/index.js +12 -5
  150. package/cjs/icon/IconShopping/index.js +12 -5
  151. package/cjs/icon/IconSmileFill/index.js +12 -5
  152. package/cjs/icon/IconSound/index.js +12 -5
  153. package/cjs/icon/IconSquareChecked/index.js +12 -5
  154. package/cjs/icon/IconSquareDisabled/index.js +12 -5
  155. package/cjs/icon/IconSquareUnchecked/index.js +12 -5
  156. package/cjs/icon/IconStar/index.js +12 -5
  157. package/cjs/icon/IconStarFill/index.js +12 -5
  158. package/cjs/icon/IconStarHalf/index.js +12 -5
  159. package/cjs/icon/IconSubway/index.js +12 -5
  160. package/cjs/icon/IconSuccessCircle/index.js +12 -5
  161. package/cjs/icon/IconTriDown/index.js +12 -5
  162. package/cjs/icon/IconTriUp/index.js +12 -5
  163. package/cjs/icon/IconUpload/index.js +12 -5
  164. package/cjs/icon/IconUser/index.js +12 -5
  165. package/cjs/icon/IconUserFill/index.js +12 -5
  166. package/cjs/icon/IconWarnCircle/index.js +12 -5
  167. package/cjs/icon/IconWarnCircleFill/index.js +12 -5
  168. package/cjs/icon/index.js +111 -0
  169. package/cjs/image/index.js +92 -56
  170. package/cjs/image/style/css/index.css +1 -0
  171. package/cjs/image/style/css/index.js +2 -0
  172. package/cjs/image/style/index.js +2 -0
  173. package/cjs/image/style/index.less +1 -0
  174. package/cjs/image-picker/add-icon.js +3 -0
  175. package/cjs/image-picker/index.js +96 -52
  176. package/cjs/image-picker/style/css/index.js +2 -0
  177. package/cjs/image-picker/style/index.js +2 -0
  178. package/cjs/image-preview/index.d.ts +2 -2
  179. package/cjs/image-preview/index.js +239 -119
  180. package/cjs/image-preview/methods.js +18 -5
  181. package/cjs/image-preview/style/css/index.js +4 -0
  182. package/cjs/image-preview/style/index.js +4 -0
  183. package/cjs/index.d.ts +10 -9
  184. package/cjs/index.js +132 -19
  185. package/cjs/input/demo/style/css/mobile.css +5 -1
  186. package/cjs/input/demo/style/mobile.less +2 -2
  187. package/cjs/input/hooks.js +104 -42
  188. package/cjs/input/index.js +40 -26
  189. package/cjs/input/props.d.ts +6 -0
  190. package/cjs/input/style/css/index.css +9 -0
  191. package/cjs/input/style/css/index.js +1 -0
  192. package/cjs/input/style/index.js +1 -0
  193. package/cjs/input/style/index.less +2 -2
  194. package/cjs/load-more/index.js +56 -29
  195. package/cjs/load-more/style/css/index.js +1 -0
  196. package/cjs/load-more/style/index.js +1 -0
  197. package/cjs/loading/index.js +48 -19
  198. package/cjs/loading/style/css/index.js +1 -0
  199. package/cjs/loading/style/index.js +1 -0
  200. package/cjs/masking/index.d.ts +2 -2
  201. package/cjs/masking/index.js +79 -46
  202. package/cjs/masking/methods.js +19 -4
  203. package/cjs/masking/style/css/index.js +2 -0
  204. package/cjs/masking/style/index.js +2 -0
  205. package/cjs/nav-bar/back-icon.js +5 -1
  206. package/cjs/nav-bar/index.js +61 -37
  207. package/cjs/nav-bar/style/css/index.js +1 -0
  208. package/cjs/nav-bar/style/index.js +1 -0
  209. package/cjs/notice-bar/index.js +61 -33
  210. package/cjs/notice-bar/style/css/index.css +33 -0
  211. package/cjs/notice-bar/style/css/index.js +1 -0
  212. package/cjs/notice-bar/style/index.js +1 -0
  213. package/cjs/notice-bar/style/index.less +16 -3
  214. package/cjs/notify/index.d.ts +8 -8
  215. package/cjs/notify/index.js +49 -20
  216. package/cjs/notify/methods.js +17 -2
  217. package/cjs/notify/style/css/index.js +1 -0
  218. package/cjs/notify/style/index.js +1 -0
  219. package/cjs/pagination/arrow.js +3 -0
  220. package/cjs/pagination/index.js +58 -27
  221. package/cjs/pagination/style/css/index.js +1 -0
  222. package/cjs/pagination/style/index.js +1 -0
  223. package/cjs/picker/index.js +81 -40
  224. package/cjs/picker/style/css/index.js +3 -0
  225. package/cjs/picker/style/index.js +3 -0
  226. package/cjs/picker-view/components/cascader.js +31 -14
  227. package/cjs/picker-view/components/multi-picker.js +20 -6
  228. package/cjs/picker-view/components/picker-cell.js +97 -45
  229. package/cjs/picker-view/index.js +71 -25
  230. package/cjs/picker-view/style/css/index.js +1 -0
  231. package/cjs/picker-view/style/index.js +1 -0
  232. package/cjs/popover/hooks/index.js +4 -0
  233. package/cjs/popover/hooks/useEvent.js +49 -25
  234. package/cjs/popover/hooks/usePosition.js +151 -94
  235. package/cjs/popover/index.js +8 -1
  236. package/cjs/popover/menu.js +51 -32
  237. package/cjs/popover/popover-inner.js +47 -30
  238. package/cjs/popover/popover.js +101 -69
  239. package/cjs/popover/style/css/index.js +2 -0
  240. package/cjs/popover/style/index.js +2 -0
  241. package/cjs/popup/index.d.ts +2 -2
  242. package/cjs/popup/index.js +39 -22
  243. package/cjs/popup/methods.js +2 -0
  244. package/cjs/popup/style/css/index.js +2 -0
  245. package/cjs/popup/style/index.js +2 -0
  246. package/cjs/popup-swiper/index.d.ts +2 -2
  247. package/cjs/popup-swiper/index.js +80 -38
  248. package/cjs/popup-swiper/methods.js +2 -0
  249. package/cjs/popup-swiper/style/css/index.js +2 -0
  250. package/cjs/popup-swiper/style/index.js +2 -0
  251. package/cjs/portal/index.js +8 -3
  252. package/cjs/portal/style/css/index.js +1 -0
  253. package/cjs/portal/style/index.js +1 -0
  254. package/cjs/progress/index.js +44 -27
  255. package/cjs/progress/style/css/index.js +1 -0
  256. package/cjs/progress/style/index.js +1 -0
  257. package/cjs/pull-refresh/android-pull-refresh.js +100 -58
  258. package/cjs/pull-refresh/hooks.js +32 -11
  259. package/cjs/pull-refresh/index.js +14 -3
  260. package/cjs/pull-refresh/ios-pull-refresh.js +80 -53
  261. package/cjs/pull-refresh/model.js +1 -0
  262. package/cjs/pull-refresh/style/css/index.js +2 -0
  263. package/cjs/pull-refresh/style/index.js +2 -0
  264. package/cjs/radio/group.js +34 -20
  265. package/cjs/radio/index.js +8 -1
  266. package/cjs/radio/radio.js +10 -0
  267. package/cjs/radio/style/css/index.js +1 -0
  268. package/cjs/radio/style/index.js +1 -0
  269. package/cjs/rate/index.js +50 -24
  270. package/cjs/rate/style/css/index.js +1 -0
  271. package/cjs/rate/style/index.js +1 -0
  272. package/cjs/search-bar/association.js +32 -14
  273. package/cjs/search-bar/cancel-button.js +16 -8
  274. package/cjs/search-bar/highlight.js +25 -14
  275. package/cjs/search-bar/index.js +97 -77
  276. package/cjs/search-bar/style/css/index.js +1 -0
  277. package/cjs/search-bar/style/index.js +1 -0
  278. package/cjs/show-monitor/index.js +93 -34
  279. package/cjs/show-monitor/style/css/index.js +1 -0
  280. package/cjs/show-monitor/style/index.js +1 -0
  281. package/cjs/slider/hooks/index.js +13 -0
  282. package/cjs/slider/hooks/useSliderEvents.js +55 -26
  283. package/cjs/slider/hooks/useSliderIcon.js +20 -6
  284. package/cjs/slider/hooks/useSliderInit.js +52 -32
  285. package/cjs/slider/hooks/useSliderStyle.js +24 -12
  286. package/cjs/slider/index.js +72 -46
  287. package/cjs/slider/marks.js +26 -12
  288. package/cjs/slider/popover.js +13 -4
  289. package/cjs/slider/style/css/index.js +2 -0
  290. package/cjs/slider/style/index.js +2 -0
  291. package/cjs/slider/thumb.js +23 -8
  292. package/cjs/stepper/hooks/useButtonClick.js +28 -19
  293. package/cjs/stepper/hooks/useInputEvent.js +18 -9
  294. package/cjs/stepper/hooks/useValue.js +14 -9
  295. package/cjs/stepper/index.js +96 -82
  296. package/cjs/stepper/style/css/index.js +1 -0
  297. package/cjs/stepper/style/index.js +1 -0
  298. package/cjs/steps/index.js +40 -22
  299. package/cjs/steps/step.js +27 -10
  300. package/cjs/steps/style/css/index.js +1 -0
  301. package/cjs/steps/style/index.js +1 -0
  302. package/cjs/sticky/index.js +65 -36
  303. package/cjs/sticky/style/css/index.js +1 -0
  304. package/cjs/sticky/style/index.js +1 -0
  305. package/cjs/style.d.ts +9 -8
  306. package/cjs/style.js +64 -8
  307. package/cjs/swipe-action/index.js +92 -40
  308. package/cjs/swipe-action/item.js +17 -9
  309. package/cjs/swipe-action/style/css/index.js +1 -0
  310. package/cjs/swipe-action/style/index.js +1 -0
  311. package/cjs/swipe-load/index.js +83 -55
  312. package/cjs/swipe-load/style/css/index.js +1 -0
  313. package/cjs/swipe-load/style/index.js +1 -0
  314. package/cjs/switch/index.js +47 -27
  315. package/cjs/switch/style/css/index.js +1 -0
  316. package/cjs/switch/style/index.js +1 -0
  317. package/cjs/tab-bar/index.js +7 -0
  318. package/cjs/tab-bar/item.js +24 -6
  319. package/cjs/tab-bar/style/css/index.js +1 -0
  320. package/cjs/tab-bar/style/index.js +1 -0
  321. package/cjs/tab-bar/tab-bar.js +31 -15
  322. package/cjs/tabs/index.js +195 -129
  323. package/cjs/tabs/style/css/index.js +1 -0
  324. package/cjs/tabs/style/index.js +1 -0
  325. package/cjs/tabs/tab-cell-underline.js +111 -38
  326. package/cjs/tabs/tab-cell.js +124 -70
  327. package/cjs/tabs/tab-pane.js +94 -49
  328. package/cjs/tabs/type.d.ts +18 -2
  329. package/cjs/tag/index.js +8 -1
  330. package/cjs/tag/list.js +26 -11
  331. package/cjs/tag/style/css/index.js +1 -0
  332. package/cjs/tag/style/index.js +1 -0
  333. package/cjs/tag/tag.js +32 -20
  334. package/cjs/textarea/index.js +56 -35
  335. package/cjs/textarea/style/css/index.js +2 -0
  336. package/cjs/textarea/style/index.js +2 -0
  337. package/cjs/toast/index.d.ts +12 -12
  338. package/cjs/toast/index.js +61 -26
  339. package/cjs/toast/methods.js +16 -2
  340. package/cjs/toast/style/css/index.js +3 -0
  341. package/cjs/toast/style/index.js +3 -0
  342. package/cjs/transition/index.js +18 -10
  343. package/cjs/transition/style/css/index.js +1 -0
  344. package/cjs/transition/style/index.js +1 -0
  345. package/dist/index.js +21588 -19198
  346. package/dist/index.min.js +4 -4
  347. package/dist/style.css +3637 -3501
  348. package/dist/style.min.css +1 -1
  349. package/esm/_helpers/hooks.js +103 -42
  350. package/esm/_helpers/index.js +3 -2
  351. package/esm/_helpers/react-dom.js +10 -0
  352. package/esm/_helpers/render.js +7 -0
  353. package/esm/action-sheet/index.d.ts +2 -2
  354. package/esm/action-sheet/index.js +16 -10
  355. package/esm/avatar/group.js +16 -12
  356. package/esm/avatar/index.js +62 -51
  357. package/esm/badge/index.js +22 -18
  358. package/esm/button/hooks.js +18 -15
  359. package/esm/button/index.js +57 -46
  360. package/esm/carousel/index.d.ts +6 -0
  361. package/esm/carousel/index.js +336 -186
  362. package/esm/carousel/style/css/index.css +50 -15
  363. package/esm/carousel/style/index.less +19 -14
  364. package/esm/cell/cell.js +14 -14
  365. package/esm/cell/demo/style/css/mobile.css +8 -0
  366. package/esm/cell/demo/style/mobile.less +2 -2
  367. package/esm/cell/group.js +11 -9
  368. package/esm/cell/index.js +1 -1
  369. package/esm/cell/style/css/index.css +16 -0
  370. package/esm/cell/style/index.less +6 -4
  371. package/esm/checkbox/checkbox.js +42 -31
  372. package/esm/checkbox/group.js +28 -24
  373. package/esm/checkbox/hooks/useMergeProps.js +9 -7
  374. package/esm/checkbox/index.js +2 -2
  375. package/esm/checkbox/type.js +1 -0
  376. package/esm/circle-progress/index.js +49 -37
  377. package/esm/collapse/collapse.js +46 -27
  378. package/esm/collapse/group.js +34 -20
  379. package/esm/collapse/index.js +1 -1
  380. package/esm/collapse/utils.js +1 -0
  381. package/esm/context-provider/index.d.ts +6 -0
  382. package/esm/context-provider/index.js +20 -11
  383. package/esm/count-down/hooks.js +37 -24
  384. package/esm/count-down/index.js +29 -30
  385. package/esm/count-down/singleton.js +5 -2
  386. package/esm/count-down/util.js +42 -33
  387. package/esm/date-picker/helper.js +9 -7
  388. package/esm/date-picker/index.js +93 -42
  389. package/esm/dialog/index.d.ts +2 -2
  390. package/esm/dialog/index.js +39 -28
  391. package/esm/dialog/methods.js +11 -9
  392. package/esm/divider/demo/style/css/mobile.css +7 -0
  393. package/esm/divider/demo/style/mobile.less +12 -0
  394. package/esm/divider/index.d.ts +49 -0
  395. package/esm/divider/index.js +49 -0
  396. package/esm/divider/style/css/index.css +69 -0
  397. package/esm/divider/style/css/index.d.ts +2 -0
  398. package/esm/divider/style/css/index.js +2 -0
  399. package/esm/divider/style/index.d.ts +2 -0
  400. package/esm/divider/style/index.js +2 -0
  401. package/esm/divider/style/index.less +66 -0
  402. package/esm/dropdown/dropdown.js +102 -74
  403. package/esm/dropdown/index.js +1 -1
  404. package/esm/dropdown/options.js +20 -12
  405. package/esm/dropdown-menu/dropdown-menu.js +74 -49
  406. package/esm/dropdown-menu/helper.js +16 -6
  407. package/esm/dropdown-menu/index.js +1 -1
  408. package/esm/ellipsis/components/js-ellipsis.js +63 -33
  409. package/esm/ellipsis/components/native-ellipsis.js +11 -9
  410. package/esm/ellipsis/index.js +21 -20
  411. package/esm/ellipsis/utils/dom.js +7 -0
  412. package/esm/ellipsis/utils/is.js +1 -1
  413. package/esm/form/form-item.js +110 -42
  414. package/esm/form/index.js +20 -17
  415. package/esm/form/type.js +3 -0
  416. package/esm/form/useForm.js +71 -17
  417. package/esm/form/utils.js +6 -3
  418. package/esm/grid/index.js +34 -21
  419. package/esm/icon/IconAdd/index.js +6 -5
  420. package/esm/icon/IconArrowBack/index.js +6 -5
  421. package/esm/icon/IconArrowDown/index.js +6 -5
  422. package/esm/icon/IconArrowIn/index.js +6 -5
  423. package/esm/icon/IconArrowUp/index.js +6 -5
  424. package/esm/icon/IconCheck/index.js +6 -5
  425. package/esm/icon/IconCheckBold/index.js +6 -5
  426. package/esm/icon/IconCircleChecked/index.js +6 -5
  427. package/esm/icon/IconCircleDisabled/index.js +6 -5
  428. package/esm/icon/IconCircleUnchecked/index.js +6 -5
  429. package/esm/icon/IconClear/index.js +6 -5
  430. package/esm/icon/IconClose/index.js +6 -5
  431. package/esm/icon/IconCloseBold/index.js +6 -5
  432. package/esm/icon/IconDelete/index.js +6 -5
  433. package/esm/icon/IconEdit/index.js +6 -5
  434. package/esm/icon/IconErrorCircle/index.js +6 -5
  435. package/esm/icon/IconEyeInvisible/index.js +6 -5
  436. package/esm/icon/IconEyeVisible/index.js +6 -5
  437. package/esm/icon/IconEyelashInvisible/index.js +6 -5
  438. package/esm/icon/IconGift/index.js +6 -5
  439. package/esm/icon/IconHeart/index.js +6 -5
  440. package/esm/icon/IconHome/index.js +6 -5
  441. package/esm/icon/IconLikeCircle/index.js +6 -5
  442. package/esm/icon/IconMinus/index.js +6 -5
  443. package/esm/icon/IconMore/index.js +6 -5
  444. package/esm/icon/IconNotice/index.js +6 -5
  445. package/esm/icon/IconNoticeOff/index.js +6 -5
  446. package/esm/icon/IconPicture/index.js +6 -5
  447. package/esm/icon/IconPlay/index.js +6 -5
  448. package/esm/icon/IconQuestionCircle/index.js +6 -5
  449. package/esm/icon/IconRefresh/index.js +6 -5
  450. package/esm/icon/IconSad/index.js +6 -5
  451. package/esm/icon/IconScan/index.js +6 -5
  452. package/esm/icon/IconSearch/index.js +6 -5
  453. package/esm/icon/IconSetting/index.js +6 -5
  454. package/esm/icon/IconShop/index.js +6 -5
  455. package/esm/icon/IconShopping/index.js +6 -5
  456. package/esm/icon/IconSmileFill/index.js +6 -5
  457. package/esm/icon/IconSound/index.js +6 -5
  458. package/esm/icon/IconSquareChecked/index.js +6 -5
  459. package/esm/icon/IconSquareDisabled/index.js +6 -5
  460. package/esm/icon/IconSquareUnchecked/index.js +6 -5
  461. package/esm/icon/IconStar/index.js +6 -5
  462. package/esm/icon/IconStarFill/index.js +6 -5
  463. package/esm/icon/IconStarHalf/index.js +6 -5
  464. package/esm/icon/IconSubway/index.js +6 -5
  465. package/esm/icon/IconSuccessCircle/index.js +6 -5
  466. package/esm/icon/IconTriDown/index.js +6 -5
  467. package/esm/icon/IconTriUp/index.js +6 -5
  468. package/esm/icon/IconUpload/index.js +6 -5
  469. package/esm/icon/IconUser/index.js +6 -5
  470. package/esm/icon/IconUserFill/index.js +6 -5
  471. package/esm/icon/IconWarnCircle/index.js +6 -5
  472. package/esm/icon/IconWarnCircleFill/index.js +6 -5
  473. package/esm/image/index.js +84 -57
  474. package/esm/image/style/css/index.css +1 -0
  475. package/esm/image/style/index.less +1 -0
  476. package/esm/image-picker/index.js +80 -52
  477. package/esm/image-preview/index.d.ts +2 -2
  478. package/esm/image-preview/index.js +217 -119
  479. package/esm/image-preview/methods.js +14 -4
  480. package/esm/index.d.ts +10 -9
  481. package/esm/index.js +10 -9
  482. package/esm/input/demo/style/css/mobile.css +5 -1
  483. package/esm/input/demo/style/mobile.less +2 -2
  484. package/esm/input/hooks.js +96 -42
  485. package/esm/input/index.js +30 -26
  486. package/esm/input/props.d.ts +6 -0
  487. package/esm/input/style/css/index.css +9 -0
  488. package/esm/input/style/index.less +2 -2
  489. package/esm/load-more/index.js +48 -29
  490. package/esm/loading/index.js +40 -19
  491. package/esm/masking/index.d.ts +2 -2
  492. package/esm/masking/index.js +64 -46
  493. package/esm/masking/methods.js +15 -4
  494. package/esm/nav-bar/back-icon.js +3 -1
  495. package/esm/nav-bar/index.js +52 -37
  496. package/esm/notice-bar/index.js +56 -35
  497. package/esm/notice-bar/style/css/index.css +33 -0
  498. package/esm/notice-bar/style/index.less +16 -3
  499. package/esm/notify/index.d.ts +8 -8
  500. package/esm/notify/index.js +33 -20
  501. package/esm/notify/methods.js +13 -2
  502. package/esm/pagination/index.js +50 -27
  503. package/esm/picker/index.js +66 -40
  504. package/esm/picker-view/components/cascader.js +23 -14
  505. package/esm/picker-view/components/multi-picker.js +16 -6
  506. package/esm/picker-view/components/picker-cell.js +89 -45
  507. package/esm/picker-view/index.js +54 -25
  508. package/esm/popover/hooks/useEvent.js +41 -26
  509. package/esm/popover/hooks/usePosition.js +144 -94
  510. package/esm/popover/index.js +2 -2
  511. package/esm/popover/menu.js +41 -32
  512. package/esm/popover/popover-inner.js +38 -30
  513. package/esm/popover/popover.js +90 -69
  514. package/esm/popup/index.d.ts +2 -2
  515. package/esm/popup/index.js +25 -22
  516. package/esm/popup-swiper/index.d.ts +2 -2
  517. package/esm/popup-swiper/index.js +64 -38
  518. package/esm/portal/index.js +5 -3
  519. package/esm/progress/index.js +36 -27
  520. package/esm/pull-refresh/android-pull-refresh.js +90 -58
  521. package/esm/pull-refresh/hooks.js +23 -11
  522. package/esm/pull-refresh/index.js +5 -3
  523. package/esm/pull-refresh/ios-pull-refresh.js +68 -53
  524. package/esm/pull-refresh/model.js +1 -0
  525. package/esm/radio/group.js +24 -20
  526. package/esm/radio/index.js +2 -2
  527. package/esm/rate/index.js +39 -24
  528. package/esm/search-bar/association.js +27 -14
  529. package/esm/search-bar/cancel-button.js +11 -8
  530. package/esm/search-bar/highlight.js +20 -14
  531. package/esm/search-bar/index.js +86 -77
  532. package/esm/show-monitor/index.js +85 -34
  533. package/esm/slider/hooks/useSliderEvents.js +51 -26
  534. package/esm/slider/hooks/useSliderIcon.js +13 -6
  535. package/esm/slider/hooks/useSliderInit.js +46 -32
  536. package/esm/slider/hooks/useSliderStyle.js +20 -12
  537. package/esm/slider/index.js +62 -46
  538. package/esm/slider/marks.js +18 -12
  539. package/esm/slider/popover.js +6 -4
  540. package/esm/slider/thumb.js +15 -8
  541. package/esm/stepper/hooks/useButtonClick.js +27 -19
  542. package/esm/stepper/hooks/useInputEvent.js +16 -9
  543. package/esm/stepper/hooks/useValue.js +12 -9
  544. package/esm/stepper/index.js +82 -82
  545. package/esm/steps/index.js +27 -22
  546. package/esm/steps/step.js +19 -10
  547. package/esm/sticky/index.js +56 -36
  548. package/esm/style.d.ts +9 -8
  549. package/esm/style.js +9 -8
  550. package/esm/swipe-action/index.js +80 -40
  551. package/esm/swipe-action/item.js +12 -9
  552. package/esm/swipe-load/index.js +75 -56
  553. package/esm/switch/index.js +39 -27
  554. package/esm/tab-bar/index.js +1 -0
  555. package/esm/tab-bar/item.js +13 -6
  556. package/esm/tab-bar/tab-bar.js +21 -15
  557. package/esm/tabs/index.js +183 -130
  558. package/esm/tabs/tab-cell-underline.js +103 -38
  559. package/esm/tabs/tab-cell.js +114 -70
  560. package/esm/tabs/tab-pane.js +85 -49
  561. package/esm/tabs/type.d.ts +18 -2
  562. package/esm/tag/index.js +2 -2
  563. package/esm/tag/list.js +16 -11
  564. package/esm/tag/tag.js +22 -20
  565. package/esm/textarea/index.js +46 -35
  566. package/esm/toast/index.d.ts +12 -12
  567. package/esm/toast/index.js +42 -26
  568. package/esm/toast/methods.js +12 -2
  569. package/esm/transition/index.js +12 -10
  570. package/package.json +3 -3
  571. package/tokens/app/arcodesign/default/css-variables.less +8 -0
  572. package/tokens/app/arcodesign/default/index.d.ts +8 -0
  573. package/tokens/app/arcodesign/default/index.js +11 -1
  574. package/tokens/app/arcodesign/default/index.json +94 -0
  575. package/tokens/app/arcodesign/default/index.less +8 -0
  576. package/tokens/mixin/index.less +19 -1
  577. package/umd/_helpers/hooks.js +121 -43
  578. package/umd/_helpers/index.js +6 -2
  579. package/umd/_helpers/react-dom.js +11 -0
  580. package/umd/_helpers/render.js +9 -0
  581. package/umd/action-sheet/index.d.ts +2 -2
  582. package/umd/action-sheet/index.js +22 -10
  583. package/umd/action-sheet/methods.js +1 -0
  584. package/umd/avatar/group.js +20 -12
  585. package/umd/avatar/index.js +68 -51
  586. package/umd/badge/index.js +25 -18
  587. package/umd/button/hooks.js +19 -15
  588. package/umd/button/index.js +60 -46
  589. package/umd/carousel/index.d.ts +6 -0
  590. package/umd/carousel/index.js +337 -184
  591. package/umd/carousel/style/css/index.css +50 -15
  592. package/umd/carousel/style/index.less +19 -14
  593. package/umd/cell/arrow.js +2 -0
  594. package/umd/cell/cell.js +18 -14
  595. package/umd/cell/demo/style/css/mobile.css +8 -0
  596. package/umd/cell/demo/style/mobile.less +2 -2
  597. package/umd/cell/group.js +17 -9
  598. package/umd/cell/index.js +2 -1
  599. package/umd/cell/style/css/index.css +16 -0
  600. package/umd/cell/style/index.less +6 -4
  601. package/umd/checkbox/checkbox.js +45 -31
  602. package/umd/checkbox/group.js +34 -24
  603. package/umd/checkbox/hooks/useMergeProps.js +12 -7
  604. package/umd/checkbox/index.js +3 -1
  605. package/umd/checkbox/type.js +2 -0
  606. package/umd/circle-progress/index.js +52 -37
  607. package/umd/collapse/collapse.js +50 -27
  608. package/umd/collapse/group.js +38 -20
  609. package/umd/collapse/index.js +3 -0
  610. package/umd/collapse/utils.js +5 -0
  611. package/umd/context-provider/index.d.ts +6 -0
  612. package/umd/context-provider/index.js +25 -11
  613. package/umd/count-down/hooks.js +39 -24
  614. package/umd/count-down/index.js +31 -29
  615. package/umd/count-down/singleton.js +10 -2
  616. package/umd/count-down/util.js +47 -33
  617. package/umd/date-picker/helper.js +13 -7
  618. package/umd/date-picker/index.js +97 -42
  619. package/umd/dialog/index.d.ts +2 -2
  620. package/umd/dialog/index.js +44 -28
  621. package/umd/dialog/methods.js +18 -9
  622. package/umd/divider/demo/style/css/mobile.css +7 -0
  623. package/umd/divider/demo/style/mobile.less +12 -0
  624. package/umd/divider/index.d.ts +49 -0
  625. package/umd/divider/index.js +71 -0
  626. package/umd/divider/style/css/index.css +69 -0
  627. package/umd/divider/style/css/index.d.ts +2 -0
  628. package/umd/divider/style/css/index.js +15 -0
  629. package/umd/divider/style/index.d.ts +2 -0
  630. package/umd/divider/style/index.js +15 -0
  631. package/umd/divider/style/index.less +66 -0
  632. package/umd/dropdown/dropdown.js +106 -74
  633. package/umd/dropdown/index.js +3 -1
  634. package/umd/dropdown/options.js +24 -12
  635. package/umd/dropdown-menu/dropdown-menu.js +78 -49
  636. package/umd/dropdown-menu/helper.js +25 -6
  637. package/umd/dropdown-menu/index.js +2 -0
  638. package/umd/ellipsis/components/js-ellipsis.js +69 -33
  639. package/umd/ellipsis/components/native-ellipsis.js +13 -9
  640. package/umd/ellipsis/index.js +24 -19
  641. package/umd/ellipsis/utils/dom.js +8 -0
  642. package/umd/ellipsis/utils/is.js +5 -1
  643. package/umd/form/form-item-context.js +3 -0
  644. package/umd/form/form-item.js +114 -42
  645. package/umd/form/index.js +25 -17
  646. package/umd/form/type.js +3 -0
  647. package/umd/form/useForm.js +72 -18
  648. package/umd/form/utils.js +10 -3
  649. package/umd/grid/index.js +37 -21
  650. package/umd/icon/IconAdd/index.js +7 -5
  651. package/umd/icon/IconArrowBack/index.js +7 -5
  652. package/umd/icon/IconArrowDown/index.js +7 -5
  653. package/umd/icon/IconArrowIn/index.js +7 -5
  654. package/umd/icon/IconArrowUp/index.js +7 -5
  655. package/umd/icon/IconCheck/index.js +7 -5
  656. package/umd/icon/IconCheckBold/index.js +7 -5
  657. package/umd/icon/IconCircleChecked/index.js +7 -5
  658. package/umd/icon/IconCircleDisabled/index.js +7 -5
  659. package/umd/icon/IconCircleUnchecked/index.js +7 -5
  660. package/umd/icon/IconClear/index.js +7 -5
  661. package/umd/icon/IconClose/index.js +7 -5
  662. package/umd/icon/IconCloseBold/index.js +7 -5
  663. package/umd/icon/IconDelete/index.js +7 -5
  664. package/umd/icon/IconEdit/index.js +7 -5
  665. package/umd/icon/IconErrorCircle/index.js +7 -5
  666. package/umd/icon/IconEyeInvisible/index.js +7 -5
  667. package/umd/icon/IconEyeVisible/index.js +7 -5
  668. package/umd/icon/IconEyelashInvisible/index.js +7 -5
  669. package/umd/icon/IconGift/index.js +7 -5
  670. package/umd/icon/IconHeart/index.js +7 -5
  671. package/umd/icon/IconHome/index.js +7 -5
  672. package/umd/icon/IconLikeCircle/index.js +7 -5
  673. package/umd/icon/IconMinus/index.js +7 -5
  674. package/umd/icon/IconMore/index.js +7 -5
  675. package/umd/icon/IconNotice/index.js +7 -5
  676. package/umd/icon/IconNoticeOff/index.js +7 -5
  677. package/umd/icon/IconPicture/index.js +7 -5
  678. package/umd/icon/IconPlay/index.js +7 -5
  679. package/umd/icon/IconQuestionCircle/index.js +7 -5
  680. package/umd/icon/IconRefresh/index.js +7 -5
  681. package/umd/icon/IconSad/index.js +7 -5
  682. package/umd/icon/IconScan/index.js +7 -5
  683. package/umd/icon/IconSearch/index.js +7 -5
  684. package/umd/icon/IconSetting/index.js +7 -5
  685. package/umd/icon/IconShop/index.js +7 -5
  686. package/umd/icon/IconShopping/index.js +7 -5
  687. package/umd/icon/IconSmileFill/index.js +7 -5
  688. package/umd/icon/IconSound/index.js +7 -5
  689. package/umd/icon/IconSquareChecked/index.js +7 -5
  690. package/umd/icon/IconSquareDisabled/index.js +7 -5
  691. package/umd/icon/IconSquareUnchecked/index.js +7 -5
  692. package/umd/icon/IconStar/index.js +7 -5
  693. package/umd/icon/IconStarFill/index.js +7 -5
  694. package/umd/icon/IconStarHalf/index.js +7 -5
  695. package/umd/icon/IconSubway/index.js +7 -5
  696. package/umd/icon/IconSuccessCircle/index.js +7 -5
  697. package/umd/icon/IconTriDown/index.js +7 -5
  698. package/umd/icon/IconTriUp/index.js +7 -5
  699. package/umd/icon/IconUpload/index.js +7 -5
  700. package/umd/icon/IconUser/index.js +7 -5
  701. package/umd/icon/IconUserFill/index.js +7 -5
  702. package/umd/icon/IconWarnCircle/index.js +7 -5
  703. package/umd/icon/IconWarnCircleFill/index.js +7 -5
  704. package/umd/icon/index.js +1 -0
  705. package/umd/image/index.js +86 -56
  706. package/umd/image/style/css/index.css +1 -0
  707. package/umd/image/style/index.less +1 -0
  708. package/umd/image-picker/add-icon.js +2 -0
  709. package/umd/image-picker/index.js +85 -52
  710. package/umd/image-preview/index.d.ts +2 -2
  711. package/umd/image-preview/index.js +224 -119
  712. package/umd/image-preview/methods.js +15 -5
  713. package/umd/index.d.ts +10 -9
  714. package/umd/index.js +26 -23
  715. package/umd/input/demo/style/css/mobile.css +5 -1
  716. package/umd/input/demo/style/mobile.less +2 -2
  717. package/umd/input/hooks.js +100 -42
  718. package/umd/input/index.js +35 -26
  719. package/umd/input/props.d.ts +6 -0
  720. package/umd/input/style/css/index.css +9 -0
  721. package/umd/input/style/index.less +2 -2
  722. package/umd/load-more/index.js +51 -29
  723. package/umd/loading/index.js +43 -19
  724. package/umd/masking/index.d.ts +2 -2
  725. package/umd/masking/index.js +71 -46
  726. package/umd/masking/methods.js +16 -4
  727. package/umd/nav-bar/back-icon.js +4 -1
  728. package/umd/nav-bar/index.js +55 -37
  729. package/umd/notice-bar/index.js +57 -33
  730. package/umd/notice-bar/style/css/index.css +33 -0
  731. package/umd/notice-bar/style/index.less +16 -3
  732. package/umd/notify/index.d.ts +8 -8
  733. package/umd/notify/index.js +40 -20
  734. package/umd/notify/methods.js +14 -2
  735. package/umd/pagination/arrow.js +2 -0
  736. package/umd/pagination/index.js +53 -27
  737. package/umd/picker/index.js +70 -40
  738. package/umd/picker-view/components/cascader.js +27 -14
  739. package/umd/picker-view/components/multi-picker.js +19 -6
  740. package/umd/picker-view/components/picker-cell.js +93 -45
  741. package/umd/picker-view/index.js +58 -25
  742. package/umd/popover/hooks/useEvent.js +44 -25
  743. package/umd/popover/hooks/usePosition.js +145 -94
  744. package/umd/popover/index.js +3 -1
  745. package/umd/popover/menu.js +45 -32
  746. package/umd/popover/popover-inner.js +42 -30
  747. package/umd/popover/popover.js +94 -69
  748. package/umd/popup/index.d.ts +2 -2
  749. package/umd/popup/index.js +31 -22
  750. package/umd/popup/methods.js +1 -0
  751. package/umd/popup-swiper/index.d.ts +2 -2
  752. package/umd/popup-swiper/index.js +71 -38
  753. package/umd/popup-swiper/methods.js +1 -0
  754. package/umd/portal/index.js +6 -3
  755. package/umd/progress/index.js +39 -27
  756. package/umd/pull-refresh/android-pull-refresh.js +93 -58
  757. package/umd/pull-refresh/hooks.js +29 -11
  758. package/umd/pull-refresh/index.js +7 -3
  759. package/umd/pull-refresh/ios-pull-refresh.js +72 -53
  760. package/umd/pull-refresh/model.js +1 -0
  761. package/umd/radio/group.js +30 -20
  762. package/umd/radio/index.js +3 -1
  763. package/umd/radio/radio.js +5 -0
  764. package/umd/rate/index.js +44 -24
  765. package/umd/search-bar/association.js +29 -14
  766. package/umd/search-bar/cancel-button.js +14 -8
  767. package/umd/search-bar/highlight.js +21 -14
  768. package/umd/search-bar/index.js +87 -77
  769. package/umd/show-monitor/index.js +89 -34
  770. package/umd/slider/hooks/index.js +4 -0
  771. package/umd/slider/hooks/useSliderEvents.js +52 -26
  772. package/umd/slider/hooks/useSliderIcon.js +17 -6
  773. package/umd/slider/hooks/useSliderInit.js +50 -32
  774. package/umd/slider/hooks/useSliderStyle.js +22 -12
  775. package/umd/slider/index.js +65 -46
  776. package/umd/slider/marks.js +21 -12
  777. package/umd/slider/popover.js +10 -4
  778. package/umd/slider/thumb.js +18 -8
  779. package/umd/stepper/hooks/useButtonClick.js +27 -19
  780. package/umd/stepper/hooks/useInputEvent.js +17 -9
  781. package/umd/stepper/hooks/useValue.js +13 -9
  782. package/umd/stepper/index.js +87 -82
  783. package/umd/steps/index.js +32 -22
  784. package/umd/steps/step.js +22 -10
  785. package/umd/sticky/index.js +59 -36
  786. package/umd/style.d.ts +9 -8
  787. package/umd/style.js +4 -4
  788. package/umd/swipe-action/index.js +84 -40
  789. package/umd/swipe-action/item.js +14 -9
  790. package/umd/swipe-load/index.js +77 -55
  791. package/umd/switch/index.js +43 -27
  792. package/umd/tab-bar/index.js +2 -0
  793. package/umd/tab-bar/item.js +19 -6
  794. package/umd/tab-bar/tab-bar.js +26 -15
  795. package/umd/tabs/index.js +186 -129
  796. package/umd/tabs/tab-cell-underline.js +107 -38
  797. package/umd/tabs/tab-cell.js +119 -70
  798. package/umd/tabs/tab-pane.js +89 -49
  799. package/umd/tabs/type.d.ts +18 -2
  800. package/umd/tag/index.js +3 -1
  801. package/umd/tag/list.js +20 -11
  802. package/umd/tag/tag.js +26 -20
  803. package/umd/textarea/index.js +51 -35
  804. package/umd/toast/index.d.ts +12 -12
  805. package/umd/toast/index.js +49 -26
  806. package/umd/toast/methods.js +13 -2
  807. package/umd/transition/index.js +12 -10
@@ -1,57 +1,69 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  exports.__esModule = true;
5
6
  exports.default = void 0;
7
+
6
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+
7
10
  var _react = _interopRequireWildcard(require("react"));
11
+
8
12
  var _mobileUtils = require("@arco-design/mobile-utils");
13
+
9
14
  var _contextProvider = require("../context-provider");
15
+
10
16
  var _hooks = require("../input/hooks");
17
+
11
18
  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); }
19
+
12
20
  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; }
21
+
13
22
  var Textarea = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
14
23
  var id = props.id,
15
- name = props.name,
16
- rows = props.rows,
17
- placeholder = props.placeholder,
18
- readOnly = props.readOnly,
19
- onKeyUp = props.onKeyUp,
20
- onKeyPress = props.onKeyPress,
21
- disabled = props.disabled,
22
- autosize = props.autosize,
23
- cloneNodeWhenAutosize = props.cloneNodeWhenAutosize,
24
- _props$showStatistics = props.showStatistics,
25
- showStatistics = _props$showStatistics === void 0 ? true : _props$showStatistics,
26
- statisticsMaxlength = props.statisticsMaxlength,
27
- statisticsLengthCaculator = props.statisticsLengthCaculator,
28
- onErrStatusChange = props.onErrStatusChange,
29
- onErrValueChange = props.onErrValueChange,
30
- renderStatistics = props.renderStatistics,
31
- maxLength = props.maxLength,
32
- textareaClass = props.textareaClass,
33
- textareaStyle = props.textareaStyle,
34
- _props$nativeProps = props.nativeProps,
35
- nativeProps = _props$nativeProps === void 0 ? {} : _props$nativeProps;
24
+ name = props.name,
25
+ rows = props.rows,
26
+ placeholder = props.placeholder,
27
+ readOnly = props.readOnly,
28
+ onKeyUp = props.onKeyUp,
29
+ onKeyPress = props.onKeyPress,
30
+ disabled = props.disabled,
31
+ autosize = props.autosize,
32
+ cloneNodeWhenAutosize = props.cloneNodeWhenAutosize,
33
+ _props$showStatistics = props.showStatistics,
34
+ showStatistics = _props$showStatistics === void 0 ? true : _props$showStatistics,
35
+ statisticsMaxlength = props.statisticsMaxlength,
36
+ statisticsLengthCaculator = props.statisticsLengthCaculator,
37
+ onErrStatusChange = props.onErrStatusChange,
38
+ onErrValueChange = props.onErrValueChange,
39
+ renderStatistics = props.renderStatistics,
40
+ maxLength = props.maxLength,
41
+ textareaClass = props.textareaClass,
42
+ textareaStyle = props.textareaStyle,
43
+ _props$nativeProps = props.nativeProps,
44
+ nativeProps = _props$nativeProps === void 0 ? {} : _props$nativeProps;
36
45
  var textareaRef = (0, _react.useRef)(null);
37
46
  var cloneNodeRef = (0, _react.useRef)(null);
47
+
38
48
  var _useInputLogic = (0, _hooks.useInputLogic)(props, textareaRef),
39
- inputValue = _useInputLogic.inputValue,
40
- handleClick = _useInputLogic.handleClick,
41
- handleChange = _useInputLogic.handleChange,
42
- handleInput = _useInputLogic.handleInput,
43
- handleKeyDown = _useInputLogic.handleKeyDown,
44
- handleFocus = _useInputLogic.handleFocus,
45
- handleBlur = _useInputLogic.handleBlur,
46
- renderWrapper = _useInputLogic.renderWrapper,
47
- wrapRef = _useInputLogic.wrapRef;
49
+ inputValue = _useInputLogic.inputValue,
50
+ handleClick = _useInputLogic.handleClick,
51
+ handleChange = _useInputLogic.handleChange,
52
+ handleInput = _useInputLogic.handleInput,
53
+ handleKeyDown = _useInputLogic.handleKeyDown,
54
+ handleFocus = _useInputLogic.handleFocus,
55
+ handleBlur = _useInputLogic.handleBlur,
56
+ renderWrapper = _useInputLogic.renderWrapper,
57
+ wrapRef = _useInputLogic.wrapRef;
58
+
48
59
  var maxValueLength = statisticsMaxlength || maxLength;
49
60
  var currentValueLength = (0, _react.useMemo)(function () {
50
61
  if (statisticsLengthCaculator) {
51
62
  return statisticsLengthCaculator(inputValue);
52
- }
53
- // 默认为过滤换行后的字符长度
63
+ } // 默认为过滤换行后的字符长度
54
64
  // @en The default is the character length after filtering newlines
65
+
66
+
55
67
  var validValue = (inputValue || '').replace(/\n/g, '');
56
68
  return validValue ? String(validValue).length : 0;
57
69
  }, [inputValue, statisticsLengthCaculator]);
@@ -77,21 +89,26 @@ var Textarea = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
77
89
  (0, _react.useEffect)(function () {
78
90
  onErrValueChange && onErrValueChange(exceed, currentValueLength, maxValueLength);
79
91
  }, [maxValueLength, currentValueLength]);
92
+
80
93
  function resizeTextarea() {
81
94
  if (!autosize || !textareaRef.current) {
82
95
  return;
83
96
  }
97
+
84
98
  var currentRef = textareaRef.current;
99
+
85
100
  if (cloneNodeWhenAutosize) {
86
101
  var cloneNode = textareaRef.current.cloneNode(true);
102
+
87
103
  if (cloneNodeRef.current) {
88
104
  document.body.replaceChild(cloneNode, cloneNodeRef.current);
89
105
  } else {
90
106
  document.body.appendChild(cloneNode);
91
107
  }
92
- var computedStyle = window.getComputedStyle(textareaRef.current);
93
- // 影响布局的css属性复制
108
+
109
+ var computedStyle = window.getComputedStyle(textareaRef.current); // 影响布局的css属性复制
94
110
  // @en Copy css properties which affect layout
111
+
95
112
  ['width', 'fontSize', 'lineHeight', 'letterSpacing', 'wordSpacing'].forEach(function (styleKey) {
96
113
  cloneNode.style[styleKey] = computedStyle[styleKey];
97
114
  });
@@ -99,10 +116,12 @@ var Textarea = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
99
116
  cloneNodeRef.current = cloneNode;
100
117
  currentRef = cloneNode;
101
118
  }
119
+
102
120
  currentRef.style.height = 'auto';
103
121
  var maxHeight = Math.max(currentRef.clientHeight, currentRef.scrollHeight);
104
122
  textareaRef.current.style.height = maxHeight + "px";
105
123
  }
124
+
106
125
  function renderTextarea(_ref) {
107
126
  var prefixCls = _ref.prefixCls;
108
127
  var prefix = prefixCls + "-input";
@@ -132,9 +151,9 @@ var Textarea = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
132
151
  })
133
152
  }, renderStatistics ? renderStatistics(currentValueLength, maxValueLength) : currentValueLength + "/" + maxValueLength) : null));
134
153
  }
154
+
135
155
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, renderTextarea);
136
156
  });
137
-
138
157
  /**
139
158
  * 多行文本输入框组件,支持自适应内容高度。
140
159
  * @en A multi-line textarea, supports adaptive content height.
@@ -144,5 +163,7 @@ var Textarea = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
144
163
  * @name_en Textarea
145
164
  * @displayName Textarea
146
165
  */
166
+
147
167
  var _default = (0, _mobileUtils.componentWrapper)(Textarea, 'Textarea');
168
+
148
169
  exports.default = _default;
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  require("../../../../style/css/public.css");
4
+
4
5
  require("../../../input/style/css");
6
+
5
7
  require("./index.css");
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  require("../../../style/public.less");
4
+
4
5
  require("../../input/style");
6
+
5
7
  require("./index.less");
@@ -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" | "getContainer" | "className" | "duration" | "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" | "getContainer" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
188
+ toast: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "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" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "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" | "getContainer" | "className" | "duration" | "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" | "getContainer" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
199
+ info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "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" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "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" | "getContainer" | "className" | "duration" | "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" | "getContainer" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
210
+ success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "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" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "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" | "getContainer" | "className" | "duration" | "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" | "getContainer" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
221
+ error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "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" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "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" | "getContainer" | "className" | "duration" | "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" | "getContainer" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
232
+ loading: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "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" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "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" | "getContainer" | "className" | "duration" | "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" | "getContainer" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
243
+ warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "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" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
245
245
  close: () => void;
246
246
  hide: () => void;
247
247
  };
@@ -1,58 +1,74 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  exports.__esModule = true;
5
6
  var _exportNames = {
6
7
  methodsGenerator: true
7
8
  };
8
9
  exports.default = void 0;
9
10
  exports.methodsGenerator = methodsGenerator;
11
+
10
12
  var _react = _interopRequireWildcard(require("react"));
13
+
11
14
  var _mobileUtils = require("@arco-design/mobile-utils");
15
+
12
16
  var _contextProvider = require("../context-provider");
17
+
13
18
  var _transition = _interopRequireDefault(require("../transition"));
19
+
14
20
  var _IconErrorCircle = _interopRequireDefault(require("../icon/IconErrorCircle"));
21
+
15
22
  var _IconWarnCircle = _interopRequireDefault(require("../icon/IconWarnCircle"));
23
+
16
24
  var _IconSuccessCircle = _interopRequireDefault(require("../icon/IconSuccessCircle"));
25
+
17
26
  var _portal = _interopRequireDefault(require("../portal"));
27
+
18
28
  var _methods = require("./methods");
29
+
19
30
  Object.keys(_methods).forEach(function (key) {
20
31
  if (key === "default" || key === "__esModule") return;
21
32
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
22
33
  if (key in exports && exports[key] === _methods[key]) return;
23
34
  exports[key] = _methods[key];
24
35
  });
36
+
25
37
  var _loading = _interopRequireDefault(require("../loading"));
38
+
26
39
  var _helpers = require("../_helpers");
40
+
27
41
  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); }
42
+
28
43
  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; }
44
+
29
45
  var Toast = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
30
46
  var className = props.className,
31
- getContainer = props.getContainer,
32
- _props$visible = props.visible,
33
- visible = _props$visible === void 0 ? false : _props$visible,
34
- onClose = props.onClose,
35
- close = props.close,
36
- _props$type = props.type,
37
- type = _props$type === void 0 ? 'info' : _props$type,
38
- icon = props.icon,
39
- _props$layout = props.layout,
40
- layout = _props$layout === void 0 ? 'vertical' : _props$layout,
41
- _props$duration = props.duration,
42
- duration = _props$duration === void 0 ? 3000 : _props$duration,
43
- _props$transitionDura = props.transitionDuration,
44
- transitionDuration = _props$transitionDura === void 0 ? 300 : _props$transitionDura,
45
- content = props.content,
46
- _props$loading = props.loading,
47
- loading = _props$loading === void 0 ? false : _props$loading,
48
- loadingIcon = props.loadingIcon,
49
- _props$disableBodyTou = props.disableBodyTouch,
50
- disableBodyTouch = _props$disableBodyTou === void 0 ? false : _props$disableBodyTou,
51
- loadingInner = props.loadingInner,
52
- _props$direction = props.direction,
53
- direction = _props$direction === void 0 ? 'center' : _props$direction,
54
- typeIconMap = props.typeIconMap,
55
- initialBodyOverflow = props.initialBodyOverflow;
47
+ getContainer = props.getContainer,
48
+ _props$visible = props.visible,
49
+ visible = _props$visible === void 0 ? false : _props$visible,
50
+ onClose = props.onClose,
51
+ close = props.close,
52
+ _props$type = props.type,
53
+ type = _props$type === void 0 ? 'info' : _props$type,
54
+ icon = props.icon,
55
+ _props$layout = props.layout,
56
+ layout = _props$layout === void 0 ? 'vertical' : _props$layout,
57
+ _props$duration = props.duration,
58
+ duration = _props$duration === void 0 ? 3000 : _props$duration,
59
+ _props$transitionDura = props.transitionDuration,
60
+ transitionDuration = _props$transitionDura === void 0 ? 300 : _props$transitionDura,
61
+ content = props.content,
62
+ _props$loading = props.loading,
63
+ loading = _props$loading === void 0 ? false : _props$loading,
64
+ loadingIcon = props.loadingIcon,
65
+ _props$disableBodyTou = props.disableBodyTouch,
66
+ disableBodyTouch = _props$disableBodyTou === void 0 ? false : _props$disableBodyTou,
67
+ loadingInner = props.loadingInner,
68
+ _props$direction = props.direction,
69
+ direction = _props$direction === void 0 ? 'center' : _props$direction,
70
+ typeIconMap = props.typeIconMap,
71
+ initialBodyOverflow = props.initialBodyOverflow;
56
72
  var closeTimerRef = (0, _react.useRef)();
57
73
  var domRef = (0, _react.useRef)(null);
58
74
  var isInitialMount = (0, _react.useRef)(false);
@@ -63,11 +79,13 @@ var Toast = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
63
79
  };
64
80
  });
65
81
  (0, _helpers.usePreventBodyScroll)(visible, disableBodyTouch, initialBodyOverflow);
82
+
66
83
  function handleClose() {
67
84
  if (close) {
68
85
  close();
69
86
  }
70
87
  }
88
+
71
89
  function startCloseTimer() {
72
90
  if (duration) {
73
91
  clearTimeout(closeTimerRef.current);
@@ -76,11 +94,13 @@ var Toast = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
76
94
  }, duration);
77
95
  }
78
96
  }
97
+
79
98
  function handleClickMask(e) {
80
99
  if (disableBodyTouch) {
81
100
  e.preventDefault();
82
101
  }
83
102
  }
103
+
84
104
  function getTypeIcons() {
85
105
  var map = typeIconMap || {};
86
106
  var defaultMap = {
@@ -90,25 +110,31 @@ var Toast = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
90
110
  };
91
111
  return map[type] || defaultMap[type] || null;
92
112
  }
113
+
93
114
  (0, _react.useEffect)(function () {
94
115
  var mounted = isInitialMount.current;
116
+
95
117
  if (visible) {
96
118
  startCloseTimer();
97
119
  } else {
98
120
  clearTimeout(closeTimerRef.current);
121
+
99
122
  if (mounted) {
100
123
  setTimeout(function () {
101
124
  onClose && onClose();
102
125
  }, transitionDuration);
103
126
  }
104
127
  }
128
+
105
129
  isInitialMount.current = true;
106
130
  }, [visible]);
107
131
  (0, _react.useEffect)(function () {
108
132
  startCloseTimer();
109
133
  }, [duration]);
134
+
110
135
  function renderComponent(prefixClass) {
111
136
  var _cls;
137
+
112
138
  return /*#__PURE__*/_react.default.createElement("div", {
113
139
  className: (0, _mobileUtils.cls)(prefixClass + "-wrapper", "from-" + direction, {
114
140
  'no-event': !disableBodyTouch
@@ -129,6 +155,7 @@ var Toast = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
129
155
  className: prefixClass + "-content"
130
156
  }, content) : null));
131
157
  }
158
+
132
159
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
133
160
  var prefixCls = _ref.prefixCls;
134
161
  return /*#__PURE__*/_react.default.createElement(_portal.default, {
@@ -143,6 +170,7 @@ var Toast = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
143
170
  }, renderComponent(prefixCls + "-toast"))));
144
171
  });
145
172
  });
173
+
146
174
  function methodsGenerator(Comp) {
147
175
  return {
148
176
  /**
@@ -152,6 +180,7 @@ function methodsGenerator(Comp) {
152
180
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
153
181
  */
154
182
  toast: (0, _methods.toast)(Comp),
183
+
155
184
  /**
156
185
  * 展示常规提示框,同 Toast.toast
157
186
  * @desc {en} Show regular toast, the same as Toast.toast
@@ -159,6 +188,7 @@ function methodsGenerator(Comp) {
159
188
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
160
189
  */
161
190
  info: (0, _methods.toast)(Comp, 'info'),
191
+
162
192
  /**
163
193
  * 展示成功提示框(含成功icon)
164
194
  * @desc {en} Show success prompt toast (including success icon)
@@ -166,6 +196,7 @@ function methodsGenerator(Comp) {
166
196
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
167
197
  */
168
198
  success: (0, _methods.toast)(Comp, 'success'),
199
+
169
200
  /**
170
201
  * 展示错误提示框(含错误icon)
171
202
  * @desc {en} Display error prompt toast (including error icon)
@@ -173,6 +204,7 @@ function methodsGenerator(Comp) {
173
204
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
174
205
  */
175
206
  error: (0, _methods.toast)(Comp, 'error'),
207
+
176
208
  /**
177
209
  * 展示加载中提示框(含加载中icon)
178
210
  * @desc {en} Display loading prompt toast (including loading icon)
@@ -180,6 +212,7 @@ function methodsGenerator(Comp) {
180
212
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
181
213
  */
182
214
  loading: (0, _methods.toast)(Comp, 'loading'),
215
+
183
216
  /**
184
217
  * 展示警告提示框(含警告icon)
185
218
  * @desc {en} Display warning prompt toast (including warning icon)
@@ -189,8 +222,8 @@ function methodsGenerator(Comp) {
189
222
  warn: (0, _methods.toast)(Comp, 'warn')
190
223
  };
191
224
  }
192
- var ToastWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Toast);
193
225
 
226
+ var ToastWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Toast);
194
227
  /**
195
228
  * 轻提示组件,支持各个场景下调用方法。
196
229
  * @en The toast component, supports calling methods in various scenarios.
@@ -199,5 +232,7 @@ var ToastWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Toast);
199
232
  * @name 轻提示
200
233
  * @name_en Toast
201
234
  */
235
+
202
236
  var _default = (0, _mobileUtils.componentWrapper)(Toast, methodsGenerator(ToastWithGlobalContext));
237
+
203
238
  exports.default = _default;
@@ -1,34 +1,45 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  exports.__esModule = true;
5
6
  exports.toast = toast;
7
+
6
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+
7
10
  var _mobileUtils = require("@arco-design/mobile-utils");
11
+
8
12
  var _render = require("../_helpers/render");
13
+
9
14
  function toast(Component, type) {
10
15
  return function (originConfig, context) {
11
16
  var config = typeof originConfig === 'string' ? {
12
17
  content: originConfig,
13
18
  type: 'info'
14
19
  } : originConfig;
20
+
15
21
  if (type !== void 0) {
16
22
  config.type = type;
17
23
  config.loading = type === 'loading';
18
24
  }
25
+
19
26
  var div = document.createElement('div');
20
27
  document.body.appendChild(div);
28
+
21
29
  var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
22
- render = _ReactDOMRender.render,
23
- unmount = _ReactDOMRender.unmount;
30
+ render = _ReactDOMRender.render,
31
+ unmount = _ReactDOMRender.unmount;
32
+
24
33
  function destroy() {
25
34
  var onClose = config.onClose;
26
35
  onClose && onClose();
27
36
  unmount();
37
+
28
38
  if (div.parentNode) {
29
39
  div.parentNode.removeChild(div);
30
40
  }
31
41
  }
42
+
32
43
  var dynamicProps = (0, _extends2.default)({}, config, {
33
44
  close: close,
34
45
  getContainer: function getContainer() {
@@ -38,15 +49,18 @@ function toast(Component, type) {
38
49
  visible: false
39
50
  });
40
51
  var leaving = false;
52
+
41
53
  function update(newConfig) {
42
54
  dynamicProps = (0, _extends2.default)({}, dynamicProps, newConfig);
43
55
  render(dynamicProps);
44
56
  }
57
+
45
58
  function close() {
46
59
  leaving = true;
47
60
  dynamicProps.visible = false;
48
61
  render(dynamicProps);
49
62
  }
63
+
50
64
  render(dynamicProps);
51
65
  (0, _mobileUtils.nextTick)(function () {
52
66
  // 在即将打开时发现已经调用了close则取消打开操作
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  require("../../../../style/css/public.css");
4
+
4
5
  require("../../../transition/style/css");
6
+
5
7
  require("../../../loading/style/css");
8
+
6
9
  require("./index.css");
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  require("../../../style/public.less");
4
+
4
5
  require("../../transition/style");
6
+
5
7
  require("../../loading/style");
8
+
6
9
  require("./index.less");
@@ -1,14 +1,22 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  exports.__esModule = true;
5
6
  exports.default = Transition;
7
+
6
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+
7
10
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
+
8
12
  var _react = _interopRequireDefault(require("react"));
13
+
9
14
  var _CSSTransition = _interopRequireDefault(require("react-transition-group/CSSTransition"));
15
+
10
16
  var _contextProvider = require("../context-provider");
17
+
11
18
  var _excluded = ["children", "type", "in", "timeout", "mountOnEnter", "unmountOnExit"];
19
+
12
20
  /**
13
21
  * react-transition-group/CSSTransition 的简单封装。
14
22
  * @en Simple wrapper for react-transition-group/CSSTransition.
@@ -19,16 +27,16 @@ var _excluded = ["children", "type", "in", "timeout", "mountOnEnter", "unmountOn
19
27
  */
20
28
  function Transition(props) {
21
29
  var _props$children = props.children,
22
- children = _props$children === void 0 ? /*#__PURE__*/_react.default.createElement("div", null) : _props$children,
23
- type = props.type,
24
- transIn = props.in,
25
- _props$timeout = props.timeout,
26
- timeout = _props$timeout === void 0 ? 300 : _props$timeout,
27
- _props$mountOnEnter = props.mountOnEnter,
28
- mountOnEnter = _props$mountOnEnter === void 0 ? true : _props$mountOnEnter,
29
- _props$unmountOnExit = props.unmountOnExit,
30
- unmountOnExit = _props$unmountOnExit === void 0 ? true : _props$unmountOnExit,
31
- restProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
30
+ children = _props$children === void 0 ? /*#__PURE__*/_react.default.createElement("div", null) : _props$children,
31
+ type = props.type,
32
+ transIn = props.in,
33
+ _props$timeout = props.timeout,
34
+ timeout = _props$timeout === void 0 ? 300 : _props$timeout,
35
+ _props$mountOnEnter = props.mountOnEnter,
36
+ mountOnEnter = _props$mountOnEnter === void 0 ? true : _props$mountOnEnter,
37
+ _props$unmountOnExit = props.unmountOnExit,
38
+ unmountOnExit = _props$unmountOnExit === void 0 ? true : _props$unmountOnExit,
39
+ restProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
32
40
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
33
41
  var prefixCls = _ref.prefixCls;
34
42
  return /*#__PURE__*/_react.default.createElement(_CSSTransition.default, (0, _extends2.default)({
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  require("../../../../style/css/public.css");
4
+
4
5
  require("./index.css");
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  require("../../../style/public.less");
4
+
4
5
  require("./index.less");