@arco-design/mobile-react 2.25.3 → 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 (816) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/hooks.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/type.d.ts +3 -3
  102. package/cjs/ellipsis/utils/dom.js +8 -0
  103. package/cjs/ellipsis/utils/is.js +5 -1
  104. package/cjs/form/form-item-context.js +5 -0
  105. package/cjs/form/form-item.js +124 -42
  106. package/cjs/form/index.js +35 -17
  107. package/cjs/form/style/css/index.js +1 -0
  108. package/cjs/form/style/index.js +1 -0
  109. package/cjs/form/type.js +3 -0
  110. package/cjs/form/useForm.js +76 -18
  111. package/cjs/form/utils.js +10 -3
  112. package/cjs/grid/index.js +41 -21
  113. package/cjs/grid/style/css/index.js +1 -0
  114. package/cjs/grid/style/index.js +1 -0
  115. package/cjs/icon/IconAdd/index.js +12 -5
  116. package/cjs/icon/IconArrowBack/index.js +12 -5
  117. package/cjs/icon/IconArrowDown/index.js +12 -5
  118. package/cjs/icon/IconArrowIn/index.js +12 -5
  119. package/cjs/icon/IconArrowUp/index.js +12 -5
  120. package/cjs/icon/IconCheck/index.js +12 -5
  121. package/cjs/icon/IconCheckBold/index.js +12 -5
  122. package/cjs/icon/IconCircleChecked/index.js +12 -5
  123. package/cjs/icon/IconCircleDisabled/index.js +12 -5
  124. package/cjs/icon/IconCircleUnchecked/index.js +12 -5
  125. package/cjs/icon/IconClear/index.js +12 -5
  126. package/cjs/icon/IconClose/index.js +12 -5
  127. package/cjs/icon/IconCloseBold/index.js +12 -5
  128. package/cjs/icon/IconDelete/index.js +12 -5
  129. package/cjs/icon/IconEdit/index.js +12 -5
  130. package/cjs/icon/IconErrorCircle/index.js +12 -5
  131. package/cjs/icon/IconEyeInvisible/index.js +12 -5
  132. package/cjs/icon/IconEyeVisible/index.js +12 -5
  133. package/cjs/icon/IconEyelashInvisible/index.js +12 -5
  134. package/cjs/icon/IconGift/index.js +12 -5
  135. package/cjs/icon/IconHeart/index.js +12 -5
  136. package/cjs/icon/IconHome/index.js +12 -5
  137. package/cjs/icon/IconLikeCircle/index.js +12 -5
  138. package/cjs/icon/IconMinus/index.js +12 -5
  139. package/cjs/icon/IconMore/index.js +12 -5
  140. package/cjs/icon/IconNotice/index.js +12 -5
  141. package/cjs/icon/IconNoticeOff/index.js +12 -5
  142. package/cjs/icon/IconPicture/index.js +12 -5
  143. package/cjs/icon/IconPlay/index.js +12 -5
  144. package/cjs/icon/IconQuestionCircle/index.js +12 -5
  145. package/cjs/icon/IconRefresh/index.js +12 -5
  146. package/cjs/icon/IconSad/index.js +12 -5
  147. package/cjs/icon/IconScan/index.js +12 -5
  148. package/cjs/icon/IconSearch/index.js +12 -5
  149. package/cjs/icon/IconSetting/index.js +12 -5
  150. package/cjs/icon/IconShop/index.js +12 -5
  151. package/cjs/icon/IconShopping/index.js +12 -5
  152. package/cjs/icon/IconSmileFill/index.js +12 -5
  153. package/cjs/icon/IconSound/index.js +12 -5
  154. package/cjs/icon/IconSquareChecked/index.js +12 -5
  155. package/cjs/icon/IconSquareDisabled/index.js +12 -5
  156. package/cjs/icon/IconSquareUnchecked/index.js +12 -5
  157. package/cjs/icon/IconStar/index.js +12 -5
  158. package/cjs/icon/IconStarFill/index.js +12 -5
  159. package/cjs/icon/IconStarHalf/index.js +12 -5
  160. package/cjs/icon/IconSubway/index.js +12 -5
  161. package/cjs/icon/IconSuccessCircle/index.js +12 -5
  162. package/cjs/icon/IconTriDown/index.js +12 -5
  163. package/cjs/icon/IconTriUp/index.js +12 -5
  164. package/cjs/icon/IconUpload/index.js +12 -5
  165. package/cjs/icon/IconUser/index.js +12 -5
  166. package/cjs/icon/IconUserFill/index.js +12 -5
  167. package/cjs/icon/IconWarnCircle/index.js +12 -5
  168. package/cjs/icon/IconWarnCircleFill/index.js +12 -5
  169. package/cjs/icon/index.js +111 -0
  170. package/cjs/image/index.js +92 -56
  171. package/cjs/image/style/css/index.css +1 -0
  172. package/cjs/image/style/css/index.js +2 -0
  173. package/cjs/image/style/index.js +2 -0
  174. package/cjs/image/style/index.less +1 -0
  175. package/cjs/image-picker/add-icon.js +3 -0
  176. package/cjs/image-picker/index.js +96 -52
  177. package/cjs/image-picker/style/css/index.js +2 -0
  178. package/cjs/image-picker/style/index.js +2 -0
  179. package/cjs/image-preview/index.d.ts +2 -2
  180. package/cjs/image-preview/index.js +239 -119
  181. package/cjs/image-preview/methods.js +18 -5
  182. package/cjs/image-preview/style/css/index.js +4 -0
  183. package/cjs/image-preview/style/index.js +4 -0
  184. package/cjs/index.d.ts +10 -9
  185. package/cjs/index.js +132 -19
  186. package/cjs/input/demo/style/css/mobile.css +5 -1
  187. package/cjs/input/demo/style/mobile.less +2 -2
  188. package/cjs/input/hooks.js +104 -42
  189. package/cjs/input/index.js +40 -26
  190. package/cjs/input/props.d.ts +6 -0
  191. package/cjs/input/style/css/index.css +9 -0
  192. package/cjs/input/style/css/index.js +1 -0
  193. package/cjs/input/style/index.js +1 -0
  194. package/cjs/input/style/index.less +2 -2
  195. package/cjs/load-more/index.js +56 -29
  196. package/cjs/load-more/style/css/index.js +1 -0
  197. package/cjs/load-more/style/index.js +1 -0
  198. package/cjs/loading/index.js +48 -19
  199. package/cjs/loading/style/css/index.js +1 -0
  200. package/cjs/loading/style/index.js +1 -0
  201. package/cjs/masking/index.d.ts +2 -2
  202. package/cjs/masking/index.js +79 -46
  203. package/cjs/masking/methods.js +19 -4
  204. package/cjs/masking/style/css/index.js +2 -0
  205. package/cjs/masking/style/index.js +2 -0
  206. package/cjs/nav-bar/back-icon.js +5 -1
  207. package/cjs/nav-bar/index.js +61 -37
  208. package/cjs/nav-bar/style/css/index.js +1 -0
  209. package/cjs/nav-bar/style/index.js +1 -0
  210. package/cjs/notice-bar/index.js +61 -33
  211. package/cjs/notice-bar/style/css/index.css +33 -0
  212. package/cjs/notice-bar/style/css/index.js +1 -0
  213. package/cjs/notice-bar/style/index.js +1 -0
  214. package/cjs/notice-bar/style/index.less +16 -3
  215. package/cjs/notify/index.d.ts +8 -8
  216. package/cjs/notify/index.js +49 -20
  217. package/cjs/notify/methods.js +17 -2
  218. package/cjs/notify/style/css/index.js +1 -0
  219. package/cjs/notify/style/index.js +1 -0
  220. package/cjs/pagination/arrow.js +3 -0
  221. package/cjs/pagination/index.js +58 -27
  222. package/cjs/pagination/style/css/index.js +1 -0
  223. package/cjs/pagination/style/index.js +1 -0
  224. package/cjs/picker/index.js +81 -40
  225. package/cjs/picker/style/css/index.js +3 -0
  226. package/cjs/picker/style/index.js +3 -0
  227. package/cjs/picker-view/components/cascader.js +31 -14
  228. package/cjs/picker-view/components/multi-picker.js +20 -6
  229. package/cjs/picker-view/components/picker-cell.js +97 -45
  230. package/cjs/picker-view/index.js +71 -25
  231. package/cjs/picker-view/style/css/index.js +1 -0
  232. package/cjs/picker-view/style/index.js +1 -0
  233. package/cjs/popover/hooks/index.js +4 -0
  234. package/cjs/popover/hooks/useEvent.js +49 -25
  235. package/cjs/popover/hooks/usePosition.js +151 -94
  236. package/cjs/popover/index.js +8 -1
  237. package/cjs/popover/menu.js +51 -32
  238. package/cjs/popover/popover-inner.js +47 -30
  239. package/cjs/popover/popover.js +101 -69
  240. package/cjs/popover/style/css/index.js +2 -0
  241. package/cjs/popover/style/index.js +2 -0
  242. package/cjs/popup/index.d.ts +2 -2
  243. package/cjs/popup/index.js +39 -22
  244. package/cjs/popup/methods.js +2 -0
  245. package/cjs/popup/style/css/index.js +2 -0
  246. package/cjs/popup/style/index.js +2 -0
  247. package/cjs/popup-swiper/index.d.ts +2 -2
  248. package/cjs/popup-swiper/index.js +80 -38
  249. package/cjs/popup-swiper/methods.js +2 -0
  250. package/cjs/popup-swiper/style/css/index.js +2 -0
  251. package/cjs/popup-swiper/style/index.js +2 -0
  252. package/cjs/portal/index.js +8 -3
  253. package/cjs/portal/style/css/index.js +1 -0
  254. package/cjs/portal/style/index.js +1 -0
  255. package/cjs/progress/index.js +44 -27
  256. package/cjs/progress/style/css/index.js +1 -0
  257. package/cjs/progress/style/index.js +1 -0
  258. package/cjs/pull-refresh/android-pull-refresh.js +100 -58
  259. package/cjs/pull-refresh/hooks.js +32 -11
  260. package/cjs/pull-refresh/index.js +14 -3
  261. package/cjs/pull-refresh/ios-pull-refresh.js +80 -53
  262. package/cjs/pull-refresh/model.js +1 -0
  263. package/cjs/pull-refresh/style/css/index.js +2 -0
  264. package/cjs/pull-refresh/style/index.js +2 -0
  265. package/cjs/radio/group.js +34 -20
  266. package/cjs/radio/index.js +8 -1
  267. package/cjs/radio/radio.js +10 -0
  268. package/cjs/radio/style/css/index.js +1 -0
  269. package/cjs/radio/style/index.js +1 -0
  270. package/cjs/rate/index.js +50 -24
  271. package/cjs/rate/style/css/index.js +1 -0
  272. package/cjs/rate/style/index.js +1 -0
  273. package/cjs/search-bar/association.js +32 -14
  274. package/cjs/search-bar/cancel-button.js +16 -8
  275. package/cjs/search-bar/highlight.js +25 -14
  276. package/cjs/search-bar/index.js +97 -77
  277. package/cjs/search-bar/style/css/index.css +1 -0
  278. package/cjs/search-bar/style/css/index.js +1 -0
  279. package/cjs/search-bar/style/index.js +1 -0
  280. package/cjs/search-bar/style/index.less +1 -0
  281. package/cjs/show-monitor/index.js +93 -34
  282. package/cjs/show-monitor/style/css/index.js +1 -0
  283. package/cjs/show-monitor/style/index.js +1 -0
  284. package/cjs/slider/hooks/index.js +13 -0
  285. package/cjs/slider/hooks/useSliderEvents.js +55 -26
  286. package/cjs/slider/hooks/useSliderIcon.js +20 -6
  287. package/cjs/slider/hooks/useSliderInit.js +52 -32
  288. package/cjs/slider/hooks/useSliderStyle.js +24 -12
  289. package/cjs/slider/index.js +72 -46
  290. package/cjs/slider/marks.js +26 -12
  291. package/cjs/slider/popover.js +13 -4
  292. package/cjs/slider/style/css/index.js +2 -0
  293. package/cjs/slider/style/index.js +2 -0
  294. package/cjs/slider/thumb.js +23 -8
  295. package/cjs/stepper/hooks/useButtonClick.js +28 -19
  296. package/cjs/stepper/hooks/useInputEvent.js +18 -9
  297. package/cjs/stepper/hooks/useValue.js +14 -9
  298. package/cjs/stepper/index.js +96 -82
  299. package/cjs/stepper/style/css/index.js +1 -0
  300. package/cjs/stepper/style/index.js +1 -0
  301. package/cjs/steps/index.js +40 -22
  302. package/cjs/steps/step.js +27 -10
  303. package/cjs/steps/style/css/index.js +1 -0
  304. package/cjs/steps/style/index.js +1 -0
  305. package/cjs/sticky/index.js +65 -36
  306. package/cjs/sticky/style/css/index.js +1 -0
  307. package/cjs/sticky/style/index.js +1 -0
  308. package/cjs/style.d.ts +9 -8
  309. package/cjs/style.js +64 -8
  310. package/cjs/swipe-action/index.js +92 -40
  311. package/cjs/swipe-action/item.js +17 -9
  312. package/cjs/swipe-action/style/css/index.js +1 -0
  313. package/cjs/swipe-action/style/index.js +1 -0
  314. package/cjs/swipe-load/index.js +83 -55
  315. package/cjs/swipe-load/style/css/index.js +1 -0
  316. package/cjs/swipe-load/style/index.js +1 -0
  317. package/cjs/switch/index.js +47 -27
  318. package/cjs/switch/style/css/index.js +1 -0
  319. package/cjs/switch/style/index.js +1 -0
  320. package/cjs/tab-bar/index.js +7 -0
  321. package/cjs/tab-bar/item.js +24 -6
  322. package/cjs/tab-bar/style/css/index.js +1 -0
  323. package/cjs/tab-bar/style/index.js +1 -0
  324. package/cjs/tab-bar/tab-bar.js +31 -15
  325. package/cjs/tabs/index.js +195 -129
  326. package/cjs/tabs/style/css/index.js +1 -0
  327. package/cjs/tabs/style/index.js +1 -0
  328. package/cjs/tabs/tab-cell-underline.js +111 -38
  329. package/cjs/tabs/tab-cell.js +124 -70
  330. package/cjs/tabs/tab-pane.js +94 -49
  331. package/cjs/tabs/type.d.ts +18 -2
  332. package/cjs/tag/index.js +8 -1
  333. package/cjs/tag/list.js +26 -11
  334. package/cjs/tag/style/css/index.js +1 -0
  335. package/cjs/tag/style/index.js +1 -0
  336. package/cjs/tag/tag.js +32 -20
  337. package/cjs/textarea/index.js +56 -35
  338. package/cjs/textarea/style/css/index.js +2 -0
  339. package/cjs/textarea/style/index.js +2 -0
  340. package/cjs/toast/index.d.ts +12 -12
  341. package/cjs/toast/index.js +61 -26
  342. package/cjs/toast/methods.js +16 -2
  343. package/cjs/toast/style/css/index.js +3 -0
  344. package/cjs/toast/style/index.js +3 -0
  345. package/cjs/transition/index.js +18 -10
  346. package/cjs/transition/style/css/index.js +1 -0
  347. package/cjs/transition/style/index.js +1 -0
  348. package/dist/index.js +21588 -19198
  349. package/dist/index.min.js +4 -4
  350. package/dist/style.css +3766 -3629
  351. package/dist/style.min.css +1 -1
  352. package/esm/_helpers/hooks.js +103 -42
  353. package/esm/_helpers/index.js +3 -2
  354. package/esm/_helpers/react-dom.js +10 -0
  355. package/esm/_helpers/render.js +7 -0
  356. package/esm/action-sheet/index.d.ts +2 -2
  357. package/esm/action-sheet/index.js +16 -10
  358. package/esm/avatar/group.js +16 -12
  359. package/esm/avatar/index.js +62 -51
  360. package/esm/badge/index.js +22 -18
  361. package/esm/button/hooks.js +18 -15
  362. package/esm/button/index.js +57 -46
  363. package/esm/carousel/index.d.ts +6 -0
  364. package/esm/carousel/index.js +336 -186
  365. package/esm/carousel/style/css/index.css +50 -15
  366. package/esm/carousel/style/index.less +19 -14
  367. package/esm/cell/cell.js +14 -14
  368. package/esm/cell/demo/style/css/mobile.css +8 -0
  369. package/esm/cell/demo/style/mobile.less +2 -2
  370. package/esm/cell/group.js +11 -9
  371. package/esm/cell/index.js +1 -1
  372. package/esm/cell/style/css/index.css +16 -0
  373. package/esm/cell/style/index.less +6 -4
  374. package/esm/checkbox/checkbox.js +42 -31
  375. package/esm/checkbox/group.js +28 -24
  376. package/esm/checkbox/hooks/useMergeProps.js +9 -7
  377. package/esm/checkbox/index.js +2 -2
  378. package/esm/checkbox/type.js +1 -0
  379. package/esm/circle-progress/index.js +49 -37
  380. package/esm/collapse/collapse.js +46 -27
  381. package/esm/collapse/group.js +34 -20
  382. package/esm/collapse/index.js +1 -1
  383. package/esm/collapse/utils.js +1 -0
  384. package/esm/context-provider/index.d.ts +6 -0
  385. package/esm/context-provider/index.js +20 -11
  386. package/esm/count-down/hooks.js +37 -24
  387. package/esm/count-down/index.js +29 -30
  388. package/esm/count-down/singleton.js +5 -2
  389. package/esm/count-down/util.js +42 -33
  390. package/esm/date-picker/helper.js +9 -7
  391. package/esm/date-picker/index.js +93 -42
  392. package/esm/dialog/index.d.ts +2 -2
  393. package/esm/dialog/index.js +39 -28
  394. package/esm/dialog/methods.js +11 -9
  395. package/esm/divider/demo/style/css/mobile.css +7 -0
  396. package/esm/divider/demo/style/mobile.less +12 -0
  397. package/esm/divider/index.d.ts +49 -0
  398. package/esm/divider/index.js +49 -0
  399. package/esm/divider/style/css/index.css +69 -0
  400. package/esm/divider/style/css/index.d.ts +2 -0
  401. package/esm/divider/style/css/index.js +2 -0
  402. package/esm/divider/style/index.d.ts +2 -0
  403. package/esm/divider/style/index.js +2 -0
  404. package/esm/divider/style/index.less +66 -0
  405. package/esm/dropdown/dropdown.js +102 -74
  406. package/esm/dropdown/index.js +1 -1
  407. package/esm/dropdown/options.js +20 -12
  408. package/esm/dropdown-menu/dropdown-menu.js +74 -49
  409. package/esm/dropdown-menu/helper.js +16 -6
  410. package/esm/dropdown-menu/index.js +1 -1
  411. package/esm/ellipsis/components/js-ellipsis.js +63 -33
  412. package/esm/ellipsis/components/native-ellipsis.js +11 -9
  413. package/esm/ellipsis/index.js +21 -20
  414. package/esm/ellipsis/type.d.ts +3 -3
  415. package/esm/ellipsis/utils/dom.js +7 -0
  416. package/esm/ellipsis/utils/is.js +1 -1
  417. package/esm/form/form-item.js +110 -42
  418. package/esm/form/index.js +20 -17
  419. package/esm/form/type.js +3 -0
  420. package/esm/form/useForm.js +71 -17
  421. package/esm/form/utils.js +6 -3
  422. package/esm/grid/index.js +34 -21
  423. package/esm/icon/IconAdd/index.js +6 -5
  424. package/esm/icon/IconArrowBack/index.js +6 -5
  425. package/esm/icon/IconArrowDown/index.js +6 -5
  426. package/esm/icon/IconArrowIn/index.js +6 -5
  427. package/esm/icon/IconArrowUp/index.js +6 -5
  428. package/esm/icon/IconCheck/index.js +6 -5
  429. package/esm/icon/IconCheckBold/index.js +6 -5
  430. package/esm/icon/IconCircleChecked/index.js +6 -5
  431. package/esm/icon/IconCircleDisabled/index.js +6 -5
  432. package/esm/icon/IconCircleUnchecked/index.js +6 -5
  433. package/esm/icon/IconClear/index.js +6 -5
  434. package/esm/icon/IconClose/index.js +6 -5
  435. package/esm/icon/IconCloseBold/index.js +6 -5
  436. package/esm/icon/IconDelete/index.js +6 -5
  437. package/esm/icon/IconEdit/index.js +6 -5
  438. package/esm/icon/IconErrorCircle/index.js +6 -5
  439. package/esm/icon/IconEyeInvisible/index.js +6 -5
  440. package/esm/icon/IconEyeVisible/index.js +6 -5
  441. package/esm/icon/IconEyelashInvisible/index.js +6 -5
  442. package/esm/icon/IconGift/index.js +6 -5
  443. package/esm/icon/IconHeart/index.js +6 -5
  444. package/esm/icon/IconHome/index.js +6 -5
  445. package/esm/icon/IconLikeCircle/index.js +6 -5
  446. package/esm/icon/IconMinus/index.js +6 -5
  447. package/esm/icon/IconMore/index.js +6 -5
  448. package/esm/icon/IconNotice/index.js +6 -5
  449. package/esm/icon/IconNoticeOff/index.js +6 -5
  450. package/esm/icon/IconPicture/index.js +6 -5
  451. package/esm/icon/IconPlay/index.js +6 -5
  452. package/esm/icon/IconQuestionCircle/index.js +6 -5
  453. package/esm/icon/IconRefresh/index.js +6 -5
  454. package/esm/icon/IconSad/index.js +6 -5
  455. package/esm/icon/IconScan/index.js +6 -5
  456. package/esm/icon/IconSearch/index.js +6 -5
  457. package/esm/icon/IconSetting/index.js +6 -5
  458. package/esm/icon/IconShop/index.js +6 -5
  459. package/esm/icon/IconShopping/index.js +6 -5
  460. package/esm/icon/IconSmileFill/index.js +6 -5
  461. package/esm/icon/IconSound/index.js +6 -5
  462. package/esm/icon/IconSquareChecked/index.js +6 -5
  463. package/esm/icon/IconSquareDisabled/index.js +6 -5
  464. package/esm/icon/IconSquareUnchecked/index.js +6 -5
  465. package/esm/icon/IconStar/index.js +6 -5
  466. package/esm/icon/IconStarFill/index.js +6 -5
  467. package/esm/icon/IconStarHalf/index.js +6 -5
  468. package/esm/icon/IconSubway/index.js +6 -5
  469. package/esm/icon/IconSuccessCircle/index.js +6 -5
  470. package/esm/icon/IconTriDown/index.js +6 -5
  471. package/esm/icon/IconTriUp/index.js +6 -5
  472. package/esm/icon/IconUpload/index.js +6 -5
  473. package/esm/icon/IconUser/index.js +6 -5
  474. package/esm/icon/IconUserFill/index.js +6 -5
  475. package/esm/icon/IconWarnCircle/index.js +6 -5
  476. package/esm/icon/IconWarnCircleFill/index.js +6 -5
  477. package/esm/image/index.js +84 -57
  478. package/esm/image/style/css/index.css +1 -0
  479. package/esm/image/style/index.less +1 -0
  480. package/esm/image-picker/index.js +80 -52
  481. package/esm/image-preview/index.d.ts +2 -2
  482. package/esm/image-preview/index.js +217 -119
  483. package/esm/image-preview/methods.js +14 -4
  484. package/esm/index.d.ts +10 -9
  485. package/esm/index.js +10 -9
  486. package/esm/input/demo/style/css/mobile.css +5 -1
  487. package/esm/input/demo/style/mobile.less +2 -2
  488. package/esm/input/hooks.js +96 -42
  489. package/esm/input/index.js +30 -26
  490. package/esm/input/props.d.ts +6 -0
  491. package/esm/input/style/css/index.css +9 -0
  492. package/esm/input/style/index.less +2 -2
  493. package/esm/load-more/index.js +48 -29
  494. package/esm/loading/index.js +40 -19
  495. package/esm/masking/index.d.ts +2 -2
  496. package/esm/masking/index.js +64 -46
  497. package/esm/masking/methods.js +15 -4
  498. package/esm/nav-bar/back-icon.js +3 -1
  499. package/esm/nav-bar/index.js +52 -37
  500. package/esm/notice-bar/index.js +56 -35
  501. package/esm/notice-bar/style/css/index.css +33 -0
  502. package/esm/notice-bar/style/index.less +16 -3
  503. package/esm/notify/index.d.ts +8 -8
  504. package/esm/notify/index.js +33 -20
  505. package/esm/notify/methods.js +13 -2
  506. package/esm/pagination/index.js +50 -27
  507. package/esm/picker/index.js +66 -40
  508. package/esm/picker-view/components/cascader.js +23 -14
  509. package/esm/picker-view/components/multi-picker.js +16 -6
  510. package/esm/picker-view/components/picker-cell.js +89 -45
  511. package/esm/picker-view/index.js +54 -25
  512. package/esm/popover/hooks/useEvent.js +41 -26
  513. package/esm/popover/hooks/usePosition.js +144 -94
  514. package/esm/popover/index.js +2 -2
  515. package/esm/popover/menu.js +41 -32
  516. package/esm/popover/popover-inner.js +38 -30
  517. package/esm/popover/popover.js +90 -69
  518. package/esm/popup/index.d.ts +2 -2
  519. package/esm/popup/index.js +25 -22
  520. package/esm/popup-swiper/index.d.ts +2 -2
  521. package/esm/popup-swiper/index.js +64 -38
  522. package/esm/portal/index.js +5 -3
  523. package/esm/progress/index.js +36 -27
  524. package/esm/pull-refresh/android-pull-refresh.js +90 -58
  525. package/esm/pull-refresh/hooks.js +23 -11
  526. package/esm/pull-refresh/index.js +5 -3
  527. package/esm/pull-refresh/ios-pull-refresh.js +68 -53
  528. package/esm/pull-refresh/model.js +1 -0
  529. package/esm/radio/group.js +24 -20
  530. package/esm/radio/index.js +2 -2
  531. package/esm/rate/index.js +39 -24
  532. package/esm/search-bar/association.js +27 -14
  533. package/esm/search-bar/cancel-button.js +11 -8
  534. package/esm/search-bar/highlight.js +20 -14
  535. package/esm/search-bar/index.js +86 -77
  536. package/esm/search-bar/style/css/index.css +1 -0
  537. package/esm/search-bar/style/index.less +1 -0
  538. package/esm/show-monitor/index.js +85 -34
  539. package/esm/slider/hooks/useSliderEvents.js +51 -26
  540. package/esm/slider/hooks/useSliderIcon.js +13 -6
  541. package/esm/slider/hooks/useSliderInit.js +46 -32
  542. package/esm/slider/hooks/useSliderStyle.js +20 -12
  543. package/esm/slider/index.js +62 -46
  544. package/esm/slider/marks.js +18 -12
  545. package/esm/slider/popover.js +6 -4
  546. package/esm/slider/thumb.js +15 -8
  547. package/esm/stepper/hooks/useButtonClick.js +27 -19
  548. package/esm/stepper/hooks/useInputEvent.js +16 -9
  549. package/esm/stepper/hooks/useValue.js +12 -9
  550. package/esm/stepper/index.js +82 -82
  551. package/esm/steps/index.js +27 -22
  552. package/esm/steps/step.js +19 -10
  553. package/esm/sticky/index.js +56 -36
  554. package/esm/style.d.ts +9 -8
  555. package/esm/style.js +9 -8
  556. package/esm/swipe-action/index.js +80 -40
  557. package/esm/swipe-action/item.js +12 -9
  558. package/esm/swipe-load/index.js +75 -56
  559. package/esm/switch/index.js +39 -27
  560. package/esm/tab-bar/index.js +1 -0
  561. package/esm/tab-bar/item.js +13 -6
  562. package/esm/tab-bar/tab-bar.js +21 -15
  563. package/esm/tabs/index.js +183 -130
  564. package/esm/tabs/tab-cell-underline.js +103 -38
  565. package/esm/tabs/tab-cell.js +114 -70
  566. package/esm/tabs/tab-pane.js +85 -49
  567. package/esm/tabs/type.d.ts +18 -2
  568. package/esm/tag/index.js +2 -2
  569. package/esm/tag/list.js +16 -11
  570. package/esm/tag/tag.js +22 -20
  571. package/esm/textarea/index.js +46 -35
  572. package/esm/toast/index.d.ts +12 -12
  573. package/esm/toast/index.js +42 -26
  574. package/esm/toast/methods.js +12 -2
  575. package/esm/transition/index.js +12 -10
  576. package/package.json +3 -3
  577. package/tokens/app/arcodesign/default/css-variables.less +22 -0
  578. package/tokens/app/arcodesign/default/index.d.ts +22 -0
  579. package/tokens/app/arcodesign/default/index.js +25 -1
  580. package/tokens/app/arcodesign/default/index.json +262 -0
  581. package/tokens/app/arcodesign/default/index.less +22 -0
  582. package/tokens/mixin/index.less +19 -1
  583. package/umd/_helpers/hooks.js +121 -43
  584. package/umd/_helpers/index.js +6 -2
  585. package/umd/_helpers/react-dom.js +11 -0
  586. package/umd/_helpers/render.js +9 -0
  587. package/umd/action-sheet/index.d.ts +2 -2
  588. package/umd/action-sheet/index.js +22 -10
  589. package/umd/action-sheet/methods.js +1 -0
  590. package/umd/avatar/group.js +20 -12
  591. package/umd/avatar/index.js +68 -51
  592. package/umd/badge/index.js +25 -18
  593. package/umd/button/hooks.js +19 -15
  594. package/umd/button/index.js +60 -46
  595. package/umd/carousel/index.d.ts +6 -0
  596. package/umd/carousel/index.js +337 -184
  597. package/umd/carousel/style/css/index.css +50 -15
  598. package/umd/carousel/style/index.less +19 -14
  599. package/umd/cell/arrow.js +2 -0
  600. package/umd/cell/cell.js +18 -14
  601. package/umd/cell/demo/style/css/mobile.css +8 -0
  602. package/umd/cell/demo/style/mobile.less +2 -2
  603. package/umd/cell/group.js +17 -9
  604. package/umd/cell/index.js +2 -1
  605. package/umd/cell/style/css/index.css +16 -0
  606. package/umd/cell/style/index.less +6 -4
  607. package/umd/checkbox/checkbox.js +45 -31
  608. package/umd/checkbox/group.js +34 -24
  609. package/umd/checkbox/hooks/useMergeProps.js +12 -7
  610. package/umd/checkbox/index.js +3 -1
  611. package/umd/checkbox/type.js +2 -0
  612. package/umd/circle-progress/index.js +52 -37
  613. package/umd/collapse/collapse.js +50 -27
  614. package/umd/collapse/group.js +38 -20
  615. package/umd/collapse/index.js +3 -0
  616. package/umd/collapse/utils.js +5 -0
  617. package/umd/context-provider/index.d.ts +6 -0
  618. package/umd/context-provider/index.js +25 -11
  619. package/umd/count-down/hooks.js +39 -24
  620. package/umd/count-down/index.js +31 -29
  621. package/umd/count-down/singleton.js +10 -2
  622. package/umd/count-down/util.js +47 -33
  623. package/umd/date-picker/helper.js +13 -7
  624. package/umd/date-picker/index.js +97 -42
  625. package/umd/dialog/index.d.ts +2 -2
  626. package/umd/dialog/index.js +44 -28
  627. package/umd/dialog/methods.js +18 -9
  628. package/umd/divider/demo/style/css/mobile.css +7 -0
  629. package/umd/divider/demo/style/mobile.less +12 -0
  630. package/umd/divider/index.d.ts +49 -0
  631. package/umd/divider/index.js +71 -0
  632. package/umd/divider/style/css/index.css +69 -0
  633. package/umd/divider/style/css/index.d.ts +2 -0
  634. package/umd/divider/style/css/index.js +15 -0
  635. package/umd/divider/style/index.d.ts +2 -0
  636. package/umd/divider/style/index.js +15 -0
  637. package/umd/divider/style/index.less +66 -0
  638. package/umd/dropdown/dropdown.js +106 -74
  639. package/umd/dropdown/index.js +3 -1
  640. package/umd/dropdown/options.js +24 -12
  641. package/umd/dropdown-menu/dropdown-menu.js +78 -49
  642. package/umd/dropdown-menu/helper.js +25 -6
  643. package/umd/dropdown-menu/index.js +2 -0
  644. package/umd/ellipsis/components/js-ellipsis.js +69 -33
  645. package/umd/ellipsis/components/native-ellipsis.js +13 -9
  646. package/umd/ellipsis/index.js +24 -19
  647. package/umd/ellipsis/type.d.ts +3 -3
  648. package/umd/ellipsis/utils/dom.js +8 -0
  649. package/umd/ellipsis/utils/is.js +5 -1
  650. package/umd/form/form-item-context.js +3 -0
  651. package/umd/form/form-item.js +114 -42
  652. package/umd/form/index.js +25 -17
  653. package/umd/form/type.js +3 -0
  654. package/umd/form/useForm.js +72 -18
  655. package/umd/form/utils.js +10 -3
  656. package/umd/grid/index.js +37 -21
  657. package/umd/icon/IconAdd/index.js +7 -5
  658. package/umd/icon/IconArrowBack/index.js +7 -5
  659. package/umd/icon/IconArrowDown/index.js +7 -5
  660. package/umd/icon/IconArrowIn/index.js +7 -5
  661. package/umd/icon/IconArrowUp/index.js +7 -5
  662. package/umd/icon/IconCheck/index.js +7 -5
  663. package/umd/icon/IconCheckBold/index.js +7 -5
  664. package/umd/icon/IconCircleChecked/index.js +7 -5
  665. package/umd/icon/IconCircleDisabled/index.js +7 -5
  666. package/umd/icon/IconCircleUnchecked/index.js +7 -5
  667. package/umd/icon/IconClear/index.js +7 -5
  668. package/umd/icon/IconClose/index.js +7 -5
  669. package/umd/icon/IconCloseBold/index.js +7 -5
  670. package/umd/icon/IconDelete/index.js +7 -5
  671. package/umd/icon/IconEdit/index.js +7 -5
  672. package/umd/icon/IconErrorCircle/index.js +7 -5
  673. package/umd/icon/IconEyeInvisible/index.js +7 -5
  674. package/umd/icon/IconEyeVisible/index.js +7 -5
  675. package/umd/icon/IconEyelashInvisible/index.js +7 -5
  676. package/umd/icon/IconGift/index.js +7 -5
  677. package/umd/icon/IconHeart/index.js +7 -5
  678. package/umd/icon/IconHome/index.js +7 -5
  679. package/umd/icon/IconLikeCircle/index.js +7 -5
  680. package/umd/icon/IconMinus/index.js +7 -5
  681. package/umd/icon/IconMore/index.js +7 -5
  682. package/umd/icon/IconNotice/index.js +7 -5
  683. package/umd/icon/IconNoticeOff/index.js +7 -5
  684. package/umd/icon/IconPicture/index.js +7 -5
  685. package/umd/icon/IconPlay/index.js +7 -5
  686. package/umd/icon/IconQuestionCircle/index.js +7 -5
  687. package/umd/icon/IconRefresh/index.js +7 -5
  688. package/umd/icon/IconSad/index.js +7 -5
  689. package/umd/icon/IconScan/index.js +7 -5
  690. package/umd/icon/IconSearch/index.js +7 -5
  691. package/umd/icon/IconSetting/index.js +7 -5
  692. package/umd/icon/IconShop/index.js +7 -5
  693. package/umd/icon/IconShopping/index.js +7 -5
  694. package/umd/icon/IconSmileFill/index.js +7 -5
  695. package/umd/icon/IconSound/index.js +7 -5
  696. package/umd/icon/IconSquareChecked/index.js +7 -5
  697. package/umd/icon/IconSquareDisabled/index.js +7 -5
  698. package/umd/icon/IconSquareUnchecked/index.js +7 -5
  699. package/umd/icon/IconStar/index.js +7 -5
  700. package/umd/icon/IconStarFill/index.js +7 -5
  701. package/umd/icon/IconStarHalf/index.js +7 -5
  702. package/umd/icon/IconSubway/index.js +7 -5
  703. package/umd/icon/IconSuccessCircle/index.js +7 -5
  704. package/umd/icon/IconTriDown/index.js +7 -5
  705. package/umd/icon/IconTriUp/index.js +7 -5
  706. package/umd/icon/IconUpload/index.js +7 -5
  707. package/umd/icon/IconUser/index.js +7 -5
  708. package/umd/icon/IconUserFill/index.js +7 -5
  709. package/umd/icon/IconWarnCircle/index.js +7 -5
  710. package/umd/icon/IconWarnCircleFill/index.js +7 -5
  711. package/umd/icon/index.js +1 -0
  712. package/umd/image/index.js +86 -56
  713. package/umd/image/style/css/index.css +1 -0
  714. package/umd/image/style/index.less +1 -0
  715. package/umd/image-picker/add-icon.js +2 -0
  716. package/umd/image-picker/index.js +85 -52
  717. package/umd/image-preview/index.d.ts +2 -2
  718. package/umd/image-preview/index.js +224 -119
  719. package/umd/image-preview/methods.js +15 -5
  720. package/umd/index.d.ts +10 -9
  721. package/umd/index.js +26 -23
  722. package/umd/input/demo/style/css/mobile.css +5 -1
  723. package/umd/input/demo/style/mobile.less +2 -2
  724. package/umd/input/hooks.js +100 -42
  725. package/umd/input/index.js +35 -26
  726. package/umd/input/props.d.ts +6 -0
  727. package/umd/input/style/css/index.css +9 -0
  728. package/umd/input/style/index.less +2 -2
  729. package/umd/load-more/index.js +51 -29
  730. package/umd/loading/index.js +43 -19
  731. package/umd/masking/index.d.ts +2 -2
  732. package/umd/masking/index.js +71 -46
  733. package/umd/masking/methods.js +16 -4
  734. package/umd/nav-bar/back-icon.js +4 -1
  735. package/umd/nav-bar/index.js +55 -37
  736. package/umd/notice-bar/index.js +57 -33
  737. package/umd/notice-bar/style/css/index.css +33 -0
  738. package/umd/notice-bar/style/index.less +16 -3
  739. package/umd/notify/index.d.ts +8 -8
  740. package/umd/notify/index.js +40 -20
  741. package/umd/notify/methods.js +14 -2
  742. package/umd/pagination/arrow.js +2 -0
  743. package/umd/pagination/index.js +53 -27
  744. package/umd/picker/index.js +70 -40
  745. package/umd/picker-view/components/cascader.js +27 -14
  746. package/umd/picker-view/components/multi-picker.js +19 -6
  747. package/umd/picker-view/components/picker-cell.js +93 -45
  748. package/umd/picker-view/index.js +58 -25
  749. package/umd/popover/hooks/useEvent.js +44 -25
  750. package/umd/popover/hooks/usePosition.js +145 -94
  751. package/umd/popover/index.js +3 -1
  752. package/umd/popover/menu.js +45 -32
  753. package/umd/popover/popover-inner.js +42 -30
  754. package/umd/popover/popover.js +94 -69
  755. package/umd/popup/index.d.ts +2 -2
  756. package/umd/popup/index.js +31 -22
  757. package/umd/popup/methods.js +1 -0
  758. package/umd/popup-swiper/index.d.ts +2 -2
  759. package/umd/popup-swiper/index.js +71 -38
  760. package/umd/popup-swiper/methods.js +1 -0
  761. package/umd/portal/index.js +6 -3
  762. package/umd/progress/index.js +39 -27
  763. package/umd/pull-refresh/android-pull-refresh.js +93 -58
  764. package/umd/pull-refresh/hooks.js +29 -11
  765. package/umd/pull-refresh/index.js +7 -3
  766. package/umd/pull-refresh/ios-pull-refresh.js +72 -53
  767. package/umd/pull-refresh/model.js +1 -0
  768. package/umd/radio/group.js +30 -20
  769. package/umd/radio/index.js +3 -1
  770. package/umd/radio/radio.js +5 -0
  771. package/umd/rate/index.js +44 -24
  772. package/umd/search-bar/association.js +29 -14
  773. package/umd/search-bar/cancel-button.js +14 -8
  774. package/umd/search-bar/highlight.js +21 -14
  775. package/umd/search-bar/index.js +87 -77
  776. package/umd/search-bar/style/css/index.css +1 -0
  777. package/umd/search-bar/style/index.less +1 -0
  778. package/umd/show-monitor/index.js +89 -34
  779. package/umd/slider/hooks/index.js +4 -0
  780. package/umd/slider/hooks/useSliderEvents.js +52 -26
  781. package/umd/slider/hooks/useSliderIcon.js +17 -6
  782. package/umd/slider/hooks/useSliderInit.js +50 -32
  783. package/umd/slider/hooks/useSliderStyle.js +22 -12
  784. package/umd/slider/index.js +65 -46
  785. package/umd/slider/marks.js +21 -12
  786. package/umd/slider/popover.js +10 -4
  787. package/umd/slider/thumb.js +18 -8
  788. package/umd/stepper/hooks/useButtonClick.js +27 -19
  789. package/umd/stepper/hooks/useInputEvent.js +17 -9
  790. package/umd/stepper/hooks/useValue.js +13 -9
  791. package/umd/stepper/index.js +87 -82
  792. package/umd/steps/index.js +32 -22
  793. package/umd/steps/step.js +22 -10
  794. package/umd/sticky/index.js +59 -36
  795. package/umd/style.d.ts +9 -8
  796. package/umd/style.js +4 -4
  797. package/umd/swipe-action/index.js +84 -40
  798. package/umd/swipe-action/item.js +14 -9
  799. package/umd/swipe-load/index.js +77 -55
  800. package/umd/switch/index.js +43 -27
  801. package/umd/tab-bar/index.js +2 -0
  802. package/umd/tab-bar/item.js +19 -6
  803. package/umd/tab-bar/tab-bar.js +26 -15
  804. package/umd/tabs/index.js +186 -129
  805. package/umd/tabs/tab-cell-underline.js +107 -38
  806. package/umd/tabs/tab-cell.js +119 -70
  807. package/umd/tabs/tab-pane.js +89 -49
  808. package/umd/tabs/type.d.ts +18 -2
  809. package/umd/tag/index.js +3 -1
  810. package/umd/tag/list.js +20 -11
  811. package/umd/tag/tag.js +26 -20
  812. package/umd/textarea/index.js +51 -35
  813. package/umd/toast/index.d.ts +12 -12
  814. package/umd/toast/index.js +49 -26
  815. package/umd/toast/methods.js +13 -2
  816. package/umd/transition/index.js +12 -10
@@ -3,27 +3,32 @@ import { Promise } from 'es6-promise';
3
3
  import { PullRefreshStatus } from './model';
4
4
  export var useCommonState = function useCommonState(_ref) {
5
5
  var onRefresh = _ref.onRefresh,
6
- loosingMinHeight = _ref.loosingMinHeight;
6
+ loosingMinHeight = _ref.loosingMinHeight;
7
+
7
8
  var _useState = useState(PullRefreshStatus.Static),
8
- status = _useState[0],
9
- setStatus = _useState[1];
9
+ status = _useState[0],
10
+ setStatus = _useState[1];
11
+
10
12
  var loadingRef = useRef(false);
11
13
  var labelRef = useRef(null);
12
14
  var domRef = useRef(null);
15
+
13
16
  var _useState2 = useState(false),
14
- touching = _useState2[0],
15
- setTouching = _useState2[1];
17
+ touching = _useState2[0],
18
+ setTouching = _useState2[1];
19
+
16
20
  var tipsHeight = useMemo(function () {
17
21
  var _labelRef$current$get, _labelRef$current;
22
+
18
23
  return (_labelRef$current$get = (_labelRef$current = labelRef.current) == null ? void 0 : _labelRef$current.getBoundingClientRect().height) != null ? _labelRef$current$get : 40;
19
24
  }, [status]);
20
25
  var loosingHeight = useMemo(function () {
21
26
  return loosingMinHeight || tipsHeight;
22
27
  }, [tipsHeight, loosingMinHeight]);
23
28
  var handleRefresh = useCallback(function () {
24
- loadingRef.current = true;
25
- // 避免动画过快,最短加载时间
29
+ loadingRef.current = true; // 避免动画过快,最短加载时间
26
30
  // @en Minimum load time, avoid animation too fast
31
+
27
32
  return Promise.all([onRefresh == null ? void 0 : onRefresh(), new Promise(function (resolve) {
28
33
  // 最少加载一秒
29
34
  // @en Load at least one second
@@ -47,35 +52,41 @@ export var useCommonState = function useCommonState(_ref) {
47
52
  };
48
53
  export var useAddScrollEvents = function useAddScrollEvents(_ref2) {
49
54
  var domRef = _ref2.domRef,
50
- handleTouchStart = _ref2.handleTouchStart,
51
- handleTouchMove = _ref2.handleTouchMove,
52
- handleTouchEnd = _ref2.handleTouchEnd;
55
+ handleTouchStart = _ref2.handleTouchStart,
56
+ handleTouchMove = _ref2.handleTouchMove,
57
+ handleTouchEnd = _ref2.handleTouchEnd;
53
58
  useEffect(function () {
54
59
  var _domRef$current;
60
+
55
61
  (_domRef$current = domRef.current) == null ? void 0 : _domRef$current.addEventListener('touchstart', handleTouchStart, {
56
62
  passive: false
57
63
  });
58
64
  return function () {
59
65
  var _domRef$current2;
66
+
60
67
  (_domRef$current2 = domRef.current) == null ? void 0 : _domRef$current2.removeEventListener('touchstart', handleTouchStart);
61
68
  };
62
69
  }, [handleTouchMove]);
63
70
  useEffect(function () {
64
71
  var _domRef$current3;
72
+
65
73
  (_domRef$current3 = domRef.current) == null ? void 0 : _domRef$current3.addEventListener('touchmove', handleTouchMove, {
66
74
  passive: false
67
75
  });
68
76
  return function () {
69
77
  var _domRef$current4;
78
+
70
79
  (_domRef$current4 = domRef.current) == null ? void 0 : _domRef$current4.removeEventListener('touchmove', handleTouchMove);
71
80
  };
72
81
  }, [handleTouchMove]);
73
82
  useEffect(function () {
74
83
  var _domRef$current5, _domRef$current6;
84
+
75
85
  (_domRef$current5 = domRef.current) == null ? void 0 : _domRef$current5.addEventListener('touchend', handleTouchEnd);
76
86
  (_domRef$current6 = domRef.current) == null ? void 0 : _domRef$current6.addEventListener('touchcancel', handleTouchEnd);
77
87
  return function () {
78
88
  var _domRef$current7, _domRef$current8;
89
+
79
90
  (_domRef$current7 = domRef.current) == null ? void 0 : _domRef$current7.removeEventListener('touchend', handleTouchEnd);
80
91
  (_domRef$current8 = domRef.current) == null ? void 0 : _domRef$current8.removeEventListener('touchcancel', handleTouchEnd);
81
92
  };
@@ -83,9 +94,10 @@ export var useAddScrollEvents = function useAddScrollEvents(_ref2) {
83
94
  };
84
95
  export var useCheckAsStart = function useCheckAsStart(_ref3) {
85
96
  var allowPullWhenNotTop = _ref3.allowPullWhenNotTop,
86
- domRef = _ref3.domRef;
97
+ domRef = _ref3.domRef;
87
98
  var ifShouldHandle = useCallback(function () {
88
99
  var _domRef$current$getBo, _domRef$current9, _domRef$current9$getB;
100
+
89
101
  var domRefHeight = (_domRef$current$getBo = (_domRef$current9 = domRef.current) == null ? void 0 : (_domRef$current9$getB = _domRef$current9.getBoundingClientRect()) == null ? void 0 : _domRef$current9$getB.height) != null ? _domRef$current$getBo : 0;
90
102
  return domRef.current && !(!allowPullWhenNotTop && (domRef.current.scrollTop < 0 || domRef.current.scrollTop > domRef.current.scrollHeight - domRefHeight));
91
103
  }, [allowPullWhenNotTop]);
@@ -5,6 +5,7 @@ import React, { forwardRef } from 'react';
5
5
  import { PullRefresh as IOSPullRefresh } from './ios-pull-refresh';
6
6
  import { PullRefresh as AndroidPullRefresh } from './android-pull-refresh';
7
7
  import { useSystem } from '../_helpers';
8
+
8
9
  /**
9
10
  * 下拉刷新数据组件。
10
11
  * @en PullRefresh component that pulls down to refresh data.
@@ -15,9 +16,10 @@ import { useSystem } from '../_helpers';
15
16
  */
16
17
  var PullRefresh = /*#__PURE__*/forwardRef(function (props, ref) {
17
18
  var type = props.type,
18
- useIosOptimize = props.useIosOptimize,
19
- children = props.children,
20
- rest = _objectWithoutPropertiesLoose(props, _excluded);
19
+ useIosOptimize = props.useIosOptimize,
20
+ children = props.children,
21
+ rest = _objectWithoutPropertiesLoose(props, _excluded);
22
+
21
23
  var system = useSystem();
22
24
  var Container = type === 'ios' || useIosOptimize && (type || system) === 'ios' ? IOSPullRefresh : AndroidPullRefresh;
23
25
  return /*#__PURE__*/React.createElement(Container, _extends({}, rest, {
@@ -8,69 +8,77 @@ import { useCommonState, useAddScrollEvents, useCheckAsStart } from './hooks';
8
8
  import { useListenResize } from '../_helpers';
9
9
  export var PullRefresh = /*#__PURE__*/forwardRef(function (props, ref) {
10
10
  var _pullTextConfig;
11
+
11
12
  var _useContext = useContext(GlobalContext),
12
- prefixCls = _useContext.prefixCls,
13
- _useContext$locale = _useContext.locale,
14
- locale = _useContext$locale === void 0 ? defaultLocale : _useContext$locale;
13
+ prefixCls = _useContext.prefixCls,
14
+ _useContext$locale = _useContext.locale,
15
+ locale = _useContext$locale === void 0 ? defaultLocale : _useContext$locale;
16
+
15
17
  var animationRef = useRef(0);
16
18
  var className = props.className,
17
- style = props.style,
18
- children = props.children,
19
- _props$loadingText = props.loadingText,
20
- loadingText = _props$loadingText === void 0 ? /*#__PURE__*/React.createElement("div", {
21
- className: cls(prefixCls + "-pull-refresh-label-text")
22
- }, /*#__PURE__*/React.createElement(Loading, {
23
- type: "circle",
24
- radius: 4
25
- }), /*#__PURE__*/React.createElement("span", null, locale.PullRefresh.loadingText)) : _props$loadingText,
26
- _props$pullingText = props.pullingText,
27
- pullingText = _props$pullingText === void 0 ? /*#__PURE__*/React.createElement("div", {
28
- className: cls(prefixCls + "-pull-refresh-label-text")
29
- }, /*#__PURE__*/React.createElement("span", null, locale.PullRefresh.pullingText)) : _props$pullingText,
30
- _props$finishText = props.finishText,
31
- finishText = _props$finishText === void 0 ? /*#__PURE__*/React.createElement("div", {
32
- className: cls(prefixCls + "-pull-refresh-label-text")
33
- }, /*#__PURE__*/React.createElement("span", null, locale.PullRefresh.finishText)) : _props$finishText,
34
- initialText = props.initialText,
35
- _props$finishDelay = props.finishDelay,
36
- finishDelay = _props$finishDelay === void 0 ? 300 : _props$finishDelay,
37
- _props$disabled = props.disabled,
38
- disabled = _props$disabled === void 0 ? false : _props$disabled,
39
- loosingMinHeight = props.loosingMinHeight,
40
- _props$useHideAsNeste = props.useHideAsNestedScroll,
41
- useHideAsNestedScroll = _props$useHideAsNeste === void 0 ? true : _props$useHideAsNeste,
42
- _props$allowPullWhenN = props.allowPullWhenNotTop,
43
- allowPullWhenNotTop = _props$allowPullWhenN === void 0 ? false : _props$allowPullWhenN,
44
- onRefresh = props.onRefresh;
19
+ style = props.style,
20
+ children = props.children,
21
+ _props$loadingText = props.loadingText,
22
+ loadingText = _props$loadingText === void 0 ? /*#__PURE__*/React.createElement("div", {
23
+ className: cls(prefixCls + "-pull-refresh-label-text")
24
+ }, /*#__PURE__*/React.createElement(Loading, {
25
+ type: "circle",
26
+ radius: 4
27
+ }), /*#__PURE__*/React.createElement("span", null, locale.PullRefresh.loadingText)) : _props$loadingText,
28
+ _props$pullingText = props.pullingText,
29
+ pullingText = _props$pullingText === void 0 ? /*#__PURE__*/React.createElement("div", {
30
+ className: cls(prefixCls + "-pull-refresh-label-text")
31
+ }, /*#__PURE__*/React.createElement("span", null, locale.PullRefresh.pullingText)) : _props$pullingText,
32
+ _props$finishText = props.finishText,
33
+ finishText = _props$finishText === void 0 ? /*#__PURE__*/React.createElement("div", {
34
+ className: cls(prefixCls + "-pull-refresh-label-text")
35
+ }, /*#__PURE__*/React.createElement("span", null, locale.PullRefresh.finishText)) : _props$finishText,
36
+ initialText = props.initialText,
37
+ _props$finishDelay = props.finishDelay,
38
+ finishDelay = _props$finishDelay === void 0 ? 300 : _props$finishDelay,
39
+ _props$disabled = props.disabled,
40
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
41
+ loosingMinHeight = props.loosingMinHeight,
42
+ _props$useHideAsNeste = props.useHideAsNestedScroll,
43
+ useHideAsNestedScroll = _props$useHideAsNeste === void 0 ? true : _props$useHideAsNeste,
44
+ _props$allowPullWhenN = props.allowPullWhenNotTop,
45
+ allowPullWhenNotTop = _props$allowPullWhenN === void 0 ? false : _props$allowPullWhenN,
46
+ onRefresh = props.onRefresh;
45
47
  var lastScrollTop = useRef(0);
46
48
  var statusRef = useRef(PullRefreshStatus.Static);
49
+
47
50
  var _useState = useState({}),
48
- labelStyle = _useState[0],
49
- setLabelStyle = _useState[1];
51
+ labelStyle = _useState[0],
52
+ setLabelStyle = _useState[1];
53
+
50
54
  var _useState2 = useState(0),
51
- contentHeight = _useState2[0],
52
- setContentHeight = _useState2[1];
55
+ contentHeight = _useState2[0],
56
+ setContentHeight = _useState2[1];
57
+
53
58
  var _useCommonState = useCommonState({
54
- loosingMinHeight: loosingMinHeight,
55
- onRefresh: onRefresh
56
- }),
57
- loadingRef = _useCommonState.loadingRef,
58
- status = _useCommonState.status,
59
- setStatus = _useCommonState.setStatus,
60
- labelRef = _useCommonState.labelRef,
61
- domRef = _useCommonState.domRef,
62
- touching = _useCommonState.touching,
63
- setTouching = _useCommonState.setTouching,
64
- loosingHeight = _useCommonState.loosingHeight,
65
- tipsHeight = _useCommonState.tipsHeight,
66
- handleRefresh = _useCommonState.handleRefresh;
59
+ loosingMinHeight: loosingMinHeight,
60
+ onRefresh: onRefresh
61
+ }),
62
+ loadingRef = _useCommonState.loadingRef,
63
+ status = _useCommonState.status,
64
+ setStatus = _useCommonState.setStatus,
65
+ labelRef = _useCommonState.labelRef,
66
+ domRef = _useCommonState.domRef,
67
+ touching = _useCommonState.touching,
68
+ setTouching = _useCommonState.setTouching,
69
+ loosingHeight = _useCommonState.loosingHeight,
70
+ tipsHeight = _useCommonState.tipsHeight,
71
+ handleRefresh = _useCommonState.handleRefresh;
72
+
67
73
  var _useCheckAsStart = useCheckAsStart({
68
- domRef: domRef,
69
- allowPullWhenNotTop: allowPullWhenNotTop
70
- }),
71
- ifShouldHandle = _useCheckAsStart.ifShouldHandle;
74
+ domRef: domRef,
75
+ allowPullWhenNotTop: allowPullWhenNotTop
76
+ }),
77
+ ifShouldHandle = _useCheckAsStart.ifShouldHandle;
78
+
72
79
  var currentLabelStyle = useMemo(function () {
73
80
  var _domRef$current$scrol, _domRef$current;
81
+
74
82
  return useHideAsNestedScroll && !touching && status === PullRefreshStatus.Pulling && ((_domRef$current$scrol = domRef == null ? void 0 : (_domRef$current = domRef.current) == null ? void 0 : _domRef$current.scrollTop) != null ? _domRef$current$scrol : 0) > 0 || disabled ? _extends({}, labelStyle, {
75
83
  opacity: 0
76
84
  }) : labelStyle;
@@ -80,6 +88,7 @@ export var PullRefresh = /*#__PURE__*/forwardRef(function (props, ref) {
80
88
  if (callback === void 0) {
81
89
  callback = function callback() {};
82
90
  }
91
+
83
92
  if (animationRef.current === animationKey) {
84
93
  setLabelStyle({
85
94
  position: 'relative',
@@ -88,6 +97,7 @@ export var PullRefresh = /*#__PURE__*/forwardRef(function (props, ref) {
88
97
  transition: 'height .45s'
89
98
  });
90
99
  }
100
+
91
101
  setTimeout(function () {
92
102
  if (animationRef.current === animationKey) {
93
103
  if (domRef.current) domRef.current.style.overflow = 'auto';
@@ -107,10 +117,12 @@ export var PullRefresh = /*#__PURE__*/forwardRef(function (props, ref) {
107
117
  var handleTouchStart = useCallback(function () {
108
118
  if (disabled || loadingRef.current || !domRef.current || !ifShouldHandle()) return;
109
119
  setTouching(true);
120
+
110
121
  if (domRef.current && domRef.current.scrollTop === 0) {
111
122
  domRef.current.scrollTop = 1;
112
123
  }
113
124
  }, [disabled, ifShouldHandle]);
125
+
114
126
  var refresh = function refresh() {
115
127
  return new Promise(function (resolve) {
116
128
  if (domRef.current) {
@@ -137,6 +149,7 @@ export var PullRefresh = /*#__PURE__*/forwardRef(function (props, ref) {
137
149
  }
138
150
  });
139
151
  };
152
+
140
153
  var handleTouchEnd = useCallback(function () {
141
154
  if (disabled || loadingRef.current || !domRef.current) return;
142
155
  setTouching(false);
@@ -146,6 +159,7 @@ export var PullRefresh = /*#__PURE__*/forwardRef(function (props, ref) {
146
159
  if (disabled || loadingRef.current || !domRef.current) return;
147
160
  setTimeout(function () {
148
161
  var _domRef$current$scrol2, _domRef$current2, _domRef$current$scrol3, _domRef$current3;
162
+
149
163
  var isLoosing = -((_domRef$current$scrol2 = (_domRef$current2 = domRef.current) == null ? void 0 : _domRef$current2.scrollTop) != null ? _domRef$current$scrol2 : 0) > loosingHeight;
150
164
  if (isLoosing) lastScrollTop.current = (_domRef$current$scrol3 = (_domRef$current3 = domRef.current) == null ? void 0 : _domRef$current3.scrollTop) != null ? _domRef$current$scrol3 : 0;
151
165
  statusRef.current = isLoosing ? PullRefreshStatus.Loosing : PullRefreshStatus.Pulling;
@@ -154,7 +168,8 @@ export var PullRefresh = /*#__PURE__*/forwardRef(function (props, ref) {
154
168
  var updateIOSHeight = useCallback(function () {
155
169
  if (domRef.current) {
156
170
  var _domRef$current$getBo = domRef.current.getBoundingClientRect(),
157
- height = _domRef$current$getBo.height;
171
+ height = _domRef$current$getBo.height;
172
+
158
173
  setContentHeight(height);
159
174
  }
160
175
  }, []);
@@ -1,4 +1,5 @@
1
1
  export var PullRefreshStatus;
2
+
2
3
  (function (PullRefreshStatus) {
3
4
  PullRefreshStatus[PullRefreshStatus["Static"] = 0] = "Static";
4
5
  PullRefreshStatus[PullRefreshStatus["Pulling"] = 1] = "Pulling";
@@ -13,26 +13,28 @@ export var RadioGroupContext = /*#__PURE__*/React.createContext({
13
13
  export function componentGenerator(Comp) {
14
14
  return /*#__PURE__*/forwardRef(function (props, ref) {
15
15
  var _props$style = props.style,
16
- style = _props$style === void 0 ? {} : _props$style,
17
- _props$className = props.className,
18
- className = _props$className === void 0 ? '' : _props$className,
19
- defaultValue = props.defaultValue,
20
- _props$disabled = props.disabled,
21
- disabled = _props$disabled === void 0 ? false : _props$disabled,
22
- _props$shape = props.shape,
23
- shape = _props$shape === void 0 ? 'circle' : _props$shape,
24
- options = props.options,
25
- icons = props.icons,
26
- _props$onChange = props.onChange,
27
- onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
28
- value = props.value,
29
- _props$children = props.children,
30
- children = _props$children === void 0 ? null : _props$children,
31
- _props$layout = props.layout,
32
- layout = _props$layout === void 0 ? 'inline' : _props$layout;
16
+ style = _props$style === void 0 ? {} : _props$style,
17
+ _props$className = props.className,
18
+ className = _props$className === void 0 ? '' : _props$className,
19
+ defaultValue = props.defaultValue,
20
+ _props$disabled = props.disabled,
21
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
22
+ _props$shape = props.shape,
23
+ shape = _props$shape === void 0 ? 'circle' : _props$shape,
24
+ options = props.options,
25
+ icons = props.icons,
26
+ _props$onChange = props.onChange,
27
+ onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
28
+ value = props.value,
29
+ _props$children = props.children,
30
+ children = _props$children === void 0 ? null : _props$children,
31
+ _props$layout = props.layout,
32
+ layout = _props$layout === void 0 ? 'inline' : _props$layout;
33
+
33
34
  var _useState = useState(value || defaultValue),
34
- groupValue = _useState[0],
35
- setGroupValue = _useState[1];
35
+ groupValue = _useState[0],
36
+ setGroupValue = _useState[1];
37
+
36
38
  var domRef = useRef(null);
37
39
  useImperativeHandle(ref, function () {
38
40
  return {
@@ -42,18 +44,20 @@ export function componentGenerator(Comp) {
42
44
  useEffect(function () {
43
45
  value !== void 0 && setGroupValue(value);
44
46
  }, [value]);
45
-
46
47
  /**
47
48
  * 切换Radio状态回调
48
49
  * @en Callback when toggling radio state
49
50
  */
51
+
50
52
  var handleChange = function handleChange(checked, newValue) {
51
53
  if (!checked) return;
52
54
  onChange(newValue);
55
+
53
56
  if (value === void 0) {
54
57
  setGroupValue(newValue);
55
58
  }
56
59
  };
60
+
57
61
  return /*#__PURE__*/React.createElement(ContextLayout, null, function (_ref) {
58
62
  var prefixCls = _ref.prefixCls;
59
63
  return /*#__PURE__*/React.createElement("div", {
@@ -2,14 +2,13 @@ import { componentWrapper } from '@arco-design/mobile-utils';
2
2
  import { componentGenerator } from './group';
3
3
  import { Radio } from './radio';
4
4
  export * from './type';
5
-
6
5
  /**
7
6
  * 单选项组
8
7
  * @en Radio group
9
8
  * @displayName RadioGroup
10
9
  */
11
- var Group = componentWrapper(componentGenerator(Radio), 'RadioGroup');
12
10
 
11
+ var Group = componentWrapper(componentGenerator(Radio), 'RadioGroup');
13
12
  /**
14
13
  * 单选框,可用状态下点击切换选择,支持禁用,支持单选项组。
15
14
  * @en Radio button, click to switch selection when available, supports disabled state and radio option group.
@@ -19,6 +18,7 @@ var Group = componentWrapper(componentGenerator(Radio), 'RadioGroup');
19
18
  * @type_en Data Entry
20
19
  * @displayName Radio
21
20
  */
21
+
22
22
  export default componentWrapper(Radio, 'Radio', {
23
23
  Group: Group
24
24
  });
package/esm/rate/index.js CHANGED
@@ -6,28 +6,30 @@ import IconStarHalf from '../icon/IconStarHalf';
6
6
  import { useUpdateEffect } from '../_helpers';
7
7
  var Rate = /*#__PURE__*/forwardRef(function (props, ref) {
8
8
  var className = props.className,
9
- style = props.style,
10
- _props$defaultValue = props.defaultValue,
11
- defaultValue = _props$defaultValue === void 0 ? 0 : _props$defaultValue,
12
- value = props.value,
13
- _props$count = props.count,
14
- count = _props$count === void 0 ? 5 : _props$count,
15
- _props$step = props.step,
16
- step = _props$step === void 0 ? 1 : _props$step,
17
- color = props.color,
18
- normalColor = props.normalColor,
19
- disabledColor = props.disabledColor,
20
- _props$allowHalf = props.allowHalf,
21
- allowHalf = _props$allowHalf === void 0 ? false : _props$allowHalf,
22
- _props$disabled = props.disabled,
23
- disabled = _props$disabled === void 0 ? false : _props$disabled,
24
- size = props.size,
25
- offset = props.offset,
26
- icons = props.icons,
27
- onChange = props.onChange;
9
+ style = props.style,
10
+ _props$defaultValue = props.defaultValue,
11
+ defaultValue = _props$defaultValue === void 0 ? 0 : _props$defaultValue,
12
+ value = props.value,
13
+ _props$count = props.count,
14
+ count = _props$count === void 0 ? 5 : _props$count,
15
+ _props$step = props.step,
16
+ step = _props$step === void 0 ? 1 : _props$step,
17
+ color = props.color,
18
+ normalColor = props.normalColor,
19
+ disabledColor = props.disabledColor,
20
+ _props$allowHalf = props.allowHalf,
21
+ allowHalf = _props$allowHalf === void 0 ? false : _props$allowHalf,
22
+ _props$disabled = props.disabled,
23
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
24
+ size = props.size,
25
+ offset = props.offset,
26
+ icons = props.icons,
27
+ onChange = props.onChange;
28
+
28
29
  var _useState = useState(defaultValue),
29
- innerValue = _useState[0],
30
- setInnerValue = _useState[1];
30
+ innerValue = _useState[0],
31
+ setInnerValue = _useState[1];
32
+
31
33
  var starIndex = useMemo(function () {
32
34
  var actualValue = value !== void 0 ? value : innerValue;
33
35
  return actualValue / step || 0;
@@ -44,34 +46,43 @@ var Rate = /*#__PURE__*/forwardRef(function (props, ref) {
44
46
  dom: domRef.current
45
47
  };
46
48
  });
49
+
47
50
  function handleStarIndexChange(newIndex) {
48
51
  if (disabled) {
49
52
  return;
50
53
  }
54
+
51
55
  var newValue = newIndex * step;
52
56
  setInnerValue(newValue);
53
57
  onChange && onChange(newValue);
54
58
  }
59
+
55
60
  function renderIconByAttr(defaultNode, index, attr) {
56
61
  if (!attr) {
57
62
  return defaultNode;
58
63
  }
64
+
59
65
  if (typeof attr === 'function') {
60
66
  // 对外的index从0开始
61
67
  // @en External index starts from 0
62
68
  return attr(index - 1);
63
69
  }
70
+
64
71
  return attr;
65
72
  }
73
+
66
74
  function getIconStatus(index) {
67
75
  if (starIndex >= index) {
68
76
  return 'active';
69
77
  }
78
+
70
79
  if (starIndex >= index - 0.5 && allowHalf) {
71
80
  return 'half-active';
72
81
  }
82
+
73
83
  return 'normal';
74
84
  }
85
+
75
86
  function renderRateIcon(prefix, status, index) {
76
87
  if (status === 'active') {
77
88
  return renderIconByAttr( /*#__PURE__*/React.createElement(IconStarFill, {
@@ -84,10 +95,12 @@ var Rate = /*#__PURE__*/forwardRef(function (props, ref) {
84
95
  }
85
96
  }), index, icons == null ? void 0 : icons.active);
86
97
  }
98
+
87
99
  if (status === 'half-active') {
88
100
  var _ref = icons || {},
89
- active = _ref.active,
90
- halfActive = _ref.halfActive;
101
+ active = _ref.active,
102
+ halfActive = _ref.halfActive;
103
+
91
104
  var customIcon = halfActive || active;
92
105
  return renderIconByAttr( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconStarFill, {
93
106
  className: cls(prefix + "-icon normal", {
@@ -107,6 +120,7 @@ var Rate = /*#__PURE__*/forwardRef(function (props, ref) {
107
120
  }
108
121
  })), index, customIcon);
109
122
  }
123
+
110
124
  return renderIconByAttr( /*#__PURE__*/React.createElement(IconStarFill, {
111
125
  className: cls(prefix + "-icon normal", {
112
126
  disabled: disabled
@@ -117,6 +131,7 @@ var Rate = /*#__PURE__*/forwardRef(function (props, ref) {
117
131
  }
118
132
  }), index, icons == null ? void 0 : icons.normal);
119
133
  }
134
+
120
135
  return /*#__PURE__*/React.createElement(ContextLayout, null, function (_ref2) {
121
136
  var prefixCls = _ref2.prefixCls;
122
137
  return /*#__PURE__*/React.createElement("div", {
@@ -155,7 +170,6 @@ var Rate = /*#__PURE__*/forwardRef(function (props, ref) {
155
170
  }));
156
171
  });
157
172
  });
158
-
159
173
  /**
160
174
  * 评分组件,支持受控模式
161
175
  * @en Rate component, supports controlled mode
@@ -165,4 +179,5 @@ var Rate = /*#__PURE__*/forwardRef(function (props, ref) {
165
179
  * @name_en Rate
166
180
  * @displayName Rate
167
181
  */
182
+
168
183
  export default componentWrapper(Rate, 'Rate');
@@ -3,50 +3,59 @@ import React from 'react';
3
3
  import { highlightWithContainMode, highlightWithPrefixMode } from './highlight';
4
4
  export function SearchBarAssociation(props) {
5
5
  var _cls;
6
+
6
7
  var prefixCls = props.prefixCls,
7
- _props$associationIte = props.associationItems,
8
- associationItems = _props$associationIte === void 0 ? [] : _props$associationIte,
9
- highlightClassName = props.highlightClassName,
10
- _props$highlightMode = props.highlightMode,
11
- highlightMode = _props$highlightMode === void 0 ? 'none' : _props$highlightMode,
12
- highlightStyle = props.highlightStyle,
13
- onAssociationClick = props.onAssociationClick,
14
- onAssociationItemClick = props.onAssociationItemClick,
15
- renderAssociation = props.renderAssociation,
16
- renderAssociationItem = props.renderAssociationItem,
17
- keyword = props.keyword,
18
- visible = props.visible;
8
+ _props$associationIte = props.associationItems,
9
+ associationItems = _props$associationIte === void 0 ? [] : _props$associationIte,
10
+ highlightClassName = props.highlightClassName,
11
+ _props$highlightMode = props.highlightMode,
12
+ highlightMode = _props$highlightMode === void 0 ? 'none' : _props$highlightMode,
13
+ highlightStyle = props.highlightStyle,
14
+ onAssociationClick = props.onAssociationClick,
15
+ onAssociationItemClick = props.onAssociationItemClick,
16
+ renderAssociation = props.renderAssociation,
17
+ renderAssociationItem = props.renderAssociationItem,
18
+ keyword = props.keyword,
19
+ visible = props.visible;
19
20
  var searchBarAssociationPrefixCls = prefixCls + "-association";
20
21
  var defaultHighlightClassName = searchBarAssociationPrefixCls + "-item-highlight";
22
+
21
23
  var renderHighlightNode = function renderHighlightNode(content) {
22
24
  if (!content || !keyword || highlightMode === 'none') {
23
25
  return content;
24
26
  }
27
+
25
28
  var config = {
26
29
  keyword: keyword,
27
30
  content: content,
28
31
  highlightClassName: highlightClassName || defaultHighlightClassName,
29
32
  highlightStyle: highlightStyle
30
33
  };
34
+
31
35
  if (highlightMode === 'contain') {
32
36
  return highlightWithContainMode(config);
33
37
  }
38
+
34
39
  if (highlightMode === 'prefix') {
35
40
  return highlightWithPrefixMode(config);
36
41
  }
42
+
37
43
  return typeof highlightMode === 'function' ? highlightMode(content, keyword, defaultHighlightClassName) : content;
38
44
  };
45
+
39
46
  var renderItem = function renderItem(item, index) {
40
47
  var itemContent = item.content;
41
- var node = itemContent;
42
- // itemContent为string类型,并且开启高亮模式才去走渲染高亮内容的逻辑
48
+ var node = itemContent; // itemContent为string类型,并且开启高亮模式才去走渲染高亮内容的逻辑
43
49
  // @en When `itemContent` is a string, and the highlight mode is turned on, the logic of rendering the highlighted content is performed
50
+
44
51
  if (typeof itemContent === 'string' && highlightMode !== 'none') {
45
52
  node = renderHighlightNode(itemContent);
46
53
  }
54
+
47
55
  if (renderAssociationItem) {
48
56
  node = renderAssociationItem(item, index, node);
49
57
  }
58
+
50
59
  return /*#__PURE__*/React.createElement("div", {
51
60
  key: index,
52
61
  className: searchBarAssociationPrefixCls + "-item",
@@ -55,13 +64,17 @@ export function SearchBarAssociation(props) {
55
64
  }
56
65
  }, node);
57
66
  };
67
+
58
68
  var renderContent = function renderContent() {
59
69
  var associationContent = associationItems.map(renderItem);
70
+
60
71
  if (renderAssociation) {
61
72
  return renderAssociation(associationContent);
62
73
  }
74
+
63
75
  return associationContent;
64
76
  };
77
+
65
78
  return /*#__PURE__*/React.createElement("div", {
66
79
  className: cls(searchBarAssociationPrefixCls, (_cls = {}, _cls[searchBarAssociationPrefixCls + "-visible"] = visible, _cls)),
67
80
  onClick: onAssociationClick