@arco-design/mobile-react 2.25.4 → 2.27.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 (947) hide show
  1. package/CHANGELOG.md +39 -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 +126 -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 +13 -6
  135. package/cjs/icon/IconHome/index.js +12 -5
  136. package/cjs/icon/IconKeyboard/index.d.ts +7 -0
  137. package/cjs/icon/IconKeyboard/index.js +48 -0
  138. package/cjs/icon/IconKeyboardDelete/index.d.ts +7 -0
  139. package/cjs/icon/IconKeyboardDelete/index.js +44 -0
  140. package/cjs/icon/IconLikeCircle/index.js +12 -5
  141. package/cjs/icon/IconMinus/index.js +13 -6
  142. package/cjs/icon/IconMore/index.js +13 -6
  143. package/cjs/icon/IconNotice/index.js +13 -6
  144. package/cjs/icon/IconNoticeOff/index.js +13 -6
  145. package/cjs/icon/IconPicture/index.js +12 -5
  146. package/cjs/icon/IconPlay/index.js +13 -6
  147. package/cjs/icon/IconQuestionCircle/index.js +12 -5
  148. package/cjs/icon/IconRefresh/index.js +12 -5
  149. package/cjs/icon/IconSad/index.js +12 -5
  150. package/cjs/icon/IconScan/index.js +12 -5
  151. package/cjs/icon/IconSearch/index.js +12 -5
  152. package/cjs/icon/IconSetting/index.js +14 -7
  153. package/cjs/icon/IconShop/index.js +12 -5
  154. package/cjs/icon/IconShopping/index.js +12 -5
  155. package/cjs/icon/IconSmileFill/index.js +12 -5
  156. package/cjs/icon/IconSound/index.js +13 -6
  157. package/cjs/icon/IconSquareChecked/index.js +12 -5
  158. package/cjs/icon/IconSquareDisabled/index.js +12 -5
  159. package/cjs/icon/IconSquareUnchecked/index.js +12 -5
  160. package/cjs/icon/IconStar/index.js +13 -6
  161. package/cjs/icon/IconStarFill/index.js +13 -6
  162. package/cjs/icon/IconStarHalf/index.js +12 -5
  163. package/cjs/icon/IconSubway/index.js +12 -5
  164. package/cjs/icon/IconSuccessCircle/index.js +12 -5
  165. package/cjs/icon/IconTriDown/index.js +13 -6
  166. package/cjs/icon/IconTriUp/index.js +13 -6
  167. package/cjs/icon/IconUpload/index.js +13 -6
  168. package/cjs/icon/IconUser/index.js +12 -5
  169. package/cjs/icon/IconUserFill/index.js +12 -5
  170. package/cjs/icon/IconWarnCircle/index.js +13 -6
  171. package/cjs/icon/IconWarnCircleFill/index.js +13 -6
  172. package/cjs/icon/index.d.ts +2 -0
  173. package/cjs/icon/index.js +123 -2
  174. package/cjs/image/index.js +92 -56
  175. package/cjs/image/style/css/index.css +1 -0
  176. package/cjs/image/style/css/index.js +2 -0
  177. package/cjs/image/style/index.js +2 -0
  178. package/cjs/image/style/index.less +1 -0
  179. package/cjs/image-picker/add-icon.js +3 -0
  180. package/cjs/image-picker/index.js +96 -52
  181. package/cjs/image-picker/style/css/index.d.ts +1 -0
  182. package/cjs/image-picker/style/css/index.js +4 -0
  183. package/cjs/image-picker/style/index.d.ts +1 -0
  184. package/cjs/image-picker/style/index.js +4 -0
  185. package/cjs/image-preview/index.d.ts +2 -2
  186. package/cjs/image-preview/index.js +239 -119
  187. package/cjs/image-preview/methods.js +18 -5
  188. package/cjs/image-preview/style/css/index.js +4 -0
  189. package/cjs/image-preview/style/index.js +4 -0
  190. package/cjs/index-bar/context.d.ts +3 -0
  191. package/cjs/index-bar/context.js +15 -0
  192. package/cjs/index-bar/demo/style/css/mobile.css +23 -0
  193. package/cjs/index-bar/demo/style/mobile.less +26 -0
  194. package/cjs/index-bar/group.d.ts +3 -0
  195. package/cjs/index-bar/group.js +101 -0
  196. package/cjs/index-bar/index.d.ts +15 -0
  197. package/cjs/index-bar/index.js +276 -0
  198. package/cjs/index-bar/side-bar.d.ts +3 -0
  199. package/cjs/index-bar/side-bar.js +102 -0
  200. package/cjs/index-bar/style/css/index.css +164 -0
  201. package/cjs/index-bar/style/css/index.d.ts +3 -0
  202. package/cjs/index-bar/style/css/index.js +7 -0
  203. package/cjs/index-bar/style/index.d.ts +3 -0
  204. package/cjs/index-bar/style/index.js +7 -0
  205. package/cjs/index-bar/style/index.less +122 -0
  206. package/cjs/index-bar/type.d.ts +195 -0
  207. package/cjs/index-bar/type.js +3 -0
  208. package/cjs/index-bar/utils.d.ts +6 -0
  209. package/cjs/index-bar/utils.js +68 -0
  210. package/cjs/index.d.ts +12 -9
  211. package/cjs/index.js +140 -19
  212. package/cjs/input/demo/style/css/mobile.css +5 -1
  213. package/cjs/input/demo/style/mobile.less +2 -2
  214. package/cjs/input/hooks.js +104 -42
  215. package/cjs/input/index.js +40 -26
  216. package/cjs/input/props.d.ts +6 -0
  217. package/cjs/input/style/css/index.css +9 -0
  218. package/cjs/input/style/css/index.js +1 -0
  219. package/cjs/input/style/index.js +1 -0
  220. package/cjs/input/style/index.less +2 -2
  221. package/cjs/keyboard/demo/style/css/mobile.css +4 -0
  222. package/cjs/keyboard/demo/style/mobile.less +8 -0
  223. package/cjs/keyboard/index.d.ts +13 -0
  224. package/cjs/keyboard/index.js +270 -0
  225. package/cjs/keyboard/style/css/index.css +93 -0
  226. package/cjs/keyboard/style/css/index.d.ts +3 -0
  227. package/cjs/keyboard/style/css/index.js +7 -0
  228. package/cjs/keyboard/style/index.d.ts +3 -0
  229. package/cjs/keyboard/style/index.js +7 -0
  230. package/cjs/keyboard/style/index.less +80 -0
  231. package/cjs/keyboard/type.d.ts +102 -0
  232. package/cjs/keyboard/type.js +3 -0
  233. package/cjs/load-more/index.js +56 -29
  234. package/cjs/load-more/style/css/index.js +1 -0
  235. package/cjs/load-more/style/index.js +1 -0
  236. package/cjs/loading/index.js +48 -19
  237. package/cjs/loading/style/css/index.js +1 -0
  238. package/cjs/loading/style/index.js +1 -0
  239. package/cjs/masking/index.d.ts +2 -2
  240. package/cjs/masking/index.js +79 -46
  241. package/cjs/masking/methods.js +19 -4
  242. package/cjs/masking/style/css/index.js +2 -0
  243. package/cjs/masking/style/index.js +2 -0
  244. package/cjs/nav-bar/back-icon.js +5 -1
  245. package/cjs/nav-bar/index.js +61 -37
  246. package/cjs/nav-bar/style/css/index.js +1 -0
  247. package/cjs/nav-bar/style/index.js +1 -0
  248. package/cjs/notice-bar/index.js +61 -33
  249. package/cjs/notice-bar/style/css/index.css +33 -0
  250. package/cjs/notice-bar/style/css/index.js +1 -0
  251. package/cjs/notice-bar/style/index.js +1 -0
  252. package/cjs/notice-bar/style/index.less +16 -3
  253. package/cjs/notify/index.d.ts +8 -8
  254. package/cjs/notify/index.js +49 -20
  255. package/cjs/notify/methods.js +17 -2
  256. package/cjs/notify/style/css/index.js +1 -0
  257. package/cjs/notify/style/index.js +1 -0
  258. package/cjs/pagination/arrow.js +3 -0
  259. package/cjs/pagination/index.js +58 -27
  260. package/cjs/pagination/style/css/index.js +1 -0
  261. package/cjs/pagination/style/index.js +1 -0
  262. package/cjs/picker/index.js +75 -70
  263. package/cjs/picker/style/css/index.js +3 -0
  264. package/cjs/picker/style/index.js +3 -0
  265. package/cjs/picker/type.d.ts +1 -1
  266. package/cjs/picker-view/components/cascader.d.ts +2 -3
  267. package/cjs/picker-view/components/cascader.js +38 -19
  268. package/cjs/picker-view/components/multi-picker.d.ts +2 -3
  269. package/cjs/picker-view/components/multi-picker.js +45 -35
  270. package/cjs/picker-view/components/picker-cell.d.ts +1 -1
  271. package/cjs/picker-view/components/picker-cell.js +102 -52
  272. package/cjs/picker-view/index.d.ts +1 -1
  273. package/cjs/picker-view/index.js +78 -43
  274. package/cjs/picker-view/style/css/index.js +1 -0
  275. package/cjs/picker-view/style/index.js +1 -0
  276. package/cjs/picker-view/type.d.ts +2 -2
  277. package/cjs/popover/hooks/index.js +4 -0
  278. package/cjs/popover/hooks/useEvent.js +49 -25
  279. package/cjs/popover/hooks/usePosition.js +151 -94
  280. package/cjs/popover/index.js +8 -1
  281. package/cjs/popover/menu.js +51 -32
  282. package/cjs/popover/popover-inner.js +47 -30
  283. package/cjs/popover/popover.js +101 -69
  284. package/cjs/popover/style/css/index.js +2 -0
  285. package/cjs/popover/style/index.js +2 -0
  286. package/cjs/popup/index.d.ts +2 -2
  287. package/cjs/popup/index.js +39 -22
  288. package/cjs/popup/methods.js +2 -0
  289. package/cjs/popup/style/css/index.js +2 -0
  290. package/cjs/popup/style/index.js +2 -0
  291. package/cjs/popup-swiper/index.d.ts +2 -2
  292. package/cjs/popup-swiper/index.js +80 -38
  293. package/cjs/popup-swiper/methods.js +2 -0
  294. package/cjs/popup-swiper/style/css/index.js +2 -0
  295. package/cjs/popup-swiper/style/index.js +2 -0
  296. package/cjs/portal/index.js +8 -3
  297. package/cjs/portal/style/css/index.js +1 -0
  298. package/cjs/portal/style/index.js +1 -0
  299. package/cjs/progress/index.js +44 -27
  300. package/cjs/progress/style/css/index.js +1 -0
  301. package/cjs/progress/style/index.js +1 -0
  302. package/cjs/pull-refresh/android-pull-refresh.js +100 -58
  303. package/cjs/pull-refresh/hooks.js +32 -11
  304. package/cjs/pull-refresh/index.js +14 -3
  305. package/cjs/pull-refresh/ios-pull-refresh.js +80 -53
  306. package/cjs/pull-refresh/model.js +1 -0
  307. package/cjs/pull-refresh/style/css/index.js +2 -0
  308. package/cjs/pull-refresh/style/index.js +2 -0
  309. package/cjs/radio/group.js +34 -20
  310. package/cjs/radio/index.js +8 -1
  311. package/cjs/radio/radio.js +10 -0
  312. package/cjs/radio/style/css/index.js +1 -0
  313. package/cjs/radio/style/index.js +1 -0
  314. package/cjs/rate/index.js +50 -24
  315. package/cjs/rate/style/css/index.js +1 -0
  316. package/cjs/rate/style/index.js +1 -0
  317. package/cjs/search-bar/association.js +32 -14
  318. package/cjs/search-bar/cancel-button.js +16 -8
  319. package/cjs/search-bar/highlight.js +25 -14
  320. package/cjs/search-bar/index.js +97 -77
  321. package/cjs/search-bar/style/css/index.js +1 -0
  322. package/cjs/search-bar/style/index.js +1 -0
  323. package/cjs/show-monitor/index.js +93 -34
  324. package/cjs/show-monitor/style/css/index.js +1 -0
  325. package/cjs/show-monitor/style/index.js +1 -0
  326. package/cjs/slider/hooks/index.js +13 -0
  327. package/cjs/slider/hooks/useSliderEvents.js +73 -44
  328. package/cjs/slider/hooks/useSliderIcon.js +20 -6
  329. package/cjs/slider/hooks/useSliderInit.js +52 -32
  330. package/cjs/slider/hooks/useSliderStyle.js +24 -12
  331. package/cjs/slider/index.js +72 -46
  332. package/cjs/slider/marks.js +26 -12
  333. package/cjs/slider/popover.js +13 -4
  334. package/cjs/slider/style/css/index.js +2 -0
  335. package/cjs/slider/style/index.js +2 -0
  336. package/cjs/slider/thumb.js +23 -8
  337. package/cjs/stepper/hooks/useButtonClick.js +28 -19
  338. package/cjs/stepper/hooks/useInputEvent.js +18 -9
  339. package/cjs/stepper/hooks/useValue.js +14 -9
  340. package/cjs/stepper/index.js +96 -82
  341. package/cjs/stepper/style/css/index.js +1 -0
  342. package/cjs/stepper/style/index.js +1 -0
  343. package/cjs/steps/index.js +40 -22
  344. package/cjs/steps/step.js +27 -10
  345. package/cjs/steps/style/css/index.js +1 -0
  346. package/cjs/steps/style/index.js +1 -0
  347. package/cjs/sticky/index.js +67 -38
  348. package/cjs/sticky/style/css/index.js +1 -0
  349. package/cjs/sticky/style/index.js +1 -0
  350. package/cjs/style.d.ts +11 -8
  351. package/cjs/style.js +68 -8
  352. package/cjs/swipe-action/index.js +92 -40
  353. package/cjs/swipe-action/item.js +17 -9
  354. package/cjs/swipe-action/style/css/index.js +1 -0
  355. package/cjs/swipe-action/style/index.js +1 -0
  356. package/cjs/swipe-load/index.js +83 -55
  357. package/cjs/swipe-load/style/css/index.js +1 -0
  358. package/cjs/swipe-load/style/index.js +1 -0
  359. package/cjs/switch/index.js +47 -27
  360. package/cjs/switch/style/css/index.js +1 -0
  361. package/cjs/switch/style/index.js +1 -0
  362. package/cjs/tab-bar/index.js +7 -0
  363. package/cjs/tab-bar/item.js +24 -6
  364. package/cjs/tab-bar/style/css/index.js +1 -0
  365. package/cjs/tab-bar/style/index.js +1 -0
  366. package/cjs/tab-bar/tab-bar.js +31 -15
  367. package/cjs/tabs/index.js +195 -129
  368. package/cjs/tabs/style/css/index.js +1 -0
  369. package/cjs/tabs/style/index.js +1 -0
  370. package/cjs/tabs/tab-cell-underline.js +111 -38
  371. package/cjs/tabs/tab-cell.js +124 -70
  372. package/cjs/tabs/tab-pane.js +94 -49
  373. package/cjs/tabs/type.d.ts +18 -2
  374. package/cjs/tag/index.js +8 -1
  375. package/cjs/tag/list.js +26 -11
  376. package/cjs/tag/style/css/index.js +1 -0
  377. package/cjs/tag/style/index.js +1 -0
  378. package/cjs/tag/tag.js +32 -20
  379. package/cjs/textarea/index.js +56 -35
  380. package/cjs/textarea/style/css/index.js +2 -0
  381. package/cjs/textarea/style/index.js +2 -0
  382. package/cjs/toast/index.d.ts +12 -12
  383. package/cjs/toast/index.js +61 -26
  384. package/cjs/toast/methods.js +16 -2
  385. package/cjs/toast/style/css/index.js +3 -0
  386. package/cjs/toast/style/index.js +3 -0
  387. package/cjs/transition/index.js +18 -10
  388. package/cjs/transition/style/css/index.js +1 -0
  389. package/cjs/transition/style/index.js +1 -0
  390. package/dist/index.js +19803 -16103
  391. package/dist/index.min.js +4 -4
  392. package/dist/style.css +4028 -3678
  393. package/dist/style.min.css +1 -1
  394. package/esm/_helpers/hooks.js +103 -42
  395. package/esm/_helpers/index.js +3 -2
  396. package/esm/_helpers/react-dom.js +10 -0
  397. package/esm/_helpers/render.js +7 -0
  398. package/esm/action-sheet/index.d.ts +2 -2
  399. package/esm/action-sheet/index.js +16 -10
  400. package/esm/avatar/group.js +16 -12
  401. package/esm/avatar/index.js +62 -51
  402. package/esm/badge/index.js +22 -18
  403. package/esm/button/hooks.js +18 -15
  404. package/esm/button/index.js +57 -46
  405. package/esm/carousel/index.d.ts +6 -0
  406. package/esm/carousel/index.js +336 -186
  407. package/esm/carousel/style/css/index.css +50 -15
  408. package/esm/carousel/style/index.less +19 -14
  409. package/esm/cell/cell.js +14 -14
  410. package/esm/cell/demo/style/css/mobile.css +8 -0
  411. package/esm/cell/demo/style/mobile.less +2 -2
  412. package/esm/cell/group.js +11 -9
  413. package/esm/cell/index.js +1 -1
  414. package/esm/cell/style/css/index.css +16 -0
  415. package/esm/cell/style/index.less +6 -4
  416. package/esm/checkbox/checkbox.js +42 -31
  417. package/esm/checkbox/group.js +28 -24
  418. package/esm/checkbox/hooks/useMergeProps.js +9 -7
  419. package/esm/checkbox/index.js +2 -2
  420. package/esm/checkbox/type.js +1 -0
  421. package/esm/circle-progress/index.js +49 -37
  422. package/esm/collapse/collapse.js +46 -27
  423. package/esm/collapse/group.js +34 -20
  424. package/esm/collapse/index.js +1 -1
  425. package/esm/collapse/utils.js +1 -0
  426. package/esm/context-provider/index.d.ts +6 -0
  427. package/esm/context-provider/index.js +20 -11
  428. package/esm/count-down/hooks.js +37 -24
  429. package/esm/count-down/index.js +29 -30
  430. package/esm/count-down/singleton.js +5 -2
  431. package/esm/count-down/util.js +42 -33
  432. package/esm/date-picker/helper.js +9 -7
  433. package/esm/date-picker/index.js +93 -42
  434. package/esm/dialog/index.d.ts +2 -2
  435. package/esm/dialog/index.js +39 -28
  436. package/esm/dialog/methods.js +11 -9
  437. package/esm/divider/demo/style/css/mobile.css +7 -0
  438. package/esm/divider/demo/style/mobile.less +12 -0
  439. package/esm/divider/index.d.ts +49 -0
  440. package/esm/divider/index.js +49 -0
  441. package/esm/divider/style/css/index.css +69 -0
  442. package/esm/divider/style/css/index.d.ts +2 -0
  443. package/esm/divider/style/css/index.js +2 -0
  444. package/esm/divider/style/index.d.ts +2 -0
  445. package/esm/divider/style/index.js +2 -0
  446. package/esm/divider/style/index.less +66 -0
  447. package/esm/dropdown/dropdown.js +102 -74
  448. package/esm/dropdown/index.js +1 -1
  449. package/esm/dropdown/options.js +20 -12
  450. package/esm/dropdown-menu/dropdown-menu.js +74 -49
  451. package/esm/dropdown-menu/helper.js +16 -6
  452. package/esm/dropdown-menu/index.js +1 -1
  453. package/esm/ellipsis/components/js-ellipsis.js +63 -33
  454. package/esm/ellipsis/components/native-ellipsis.js +11 -9
  455. package/esm/ellipsis/index.js +21 -20
  456. package/esm/ellipsis/utils/dom.js +7 -0
  457. package/esm/ellipsis/utils/is.js +1 -1
  458. package/esm/form/form-item.js +112 -42
  459. package/esm/form/index.js +20 -17
  460. package/esm/form/type.js +3 -0
  461. package/esm/form/useForm.js +71 -17
  462. package/esm/form/utils.js +6 -3
  463. package/esm/grid/index.js +34 -21
  464. package/esm/icon/IconAdd/index.js +6 -5
  465. package/esm/icon/IconArrowBack/index.js +6 -5
  466. package/esm/icon/IconArrowDown/index.js +6 -5
  467. package/esm/icon/IconArrowIn/index.js +6 -5
  468. package/esm/icon/IconArrowUp/index.js +6 -5
  469. package/esm/icon/IconCheck/index.js +6 -5
  470. package/esm/icon/IconCheckBold/index.js +6 -5
  471. package/esm/icon/IconCircleChecked/index.js +6 -5
  472. package/esm/icon/IconCircleDisabled/index.js +6 -5
  473. package/esm/icon/IconCircleUnchecked/index.js +6 -5
  474. package/esm/icon/IconClear/index.js +6 -5
  475. package/esm/icon/IconClose/index.js +6 -5
  476. package/esm/icon/IconCloseBold/index.js +6 -5
  477. package/esm/icon/IconDelete/index.js +6 -5
  478. package/esm/icon/IconEdit/index.js +6 -5
  479. package/esm/icon/IconErrorCircle/index.js +6 -5
  480. package/esm/icon/IconEyeInvisible/index.js +6 -5
  481. package/esm/icon/IconEyeVisible/index.js +6 -5
  482. package/esm/icon/IconEyelashInvisible/index.js +6 -5
  483. package/esm/icon/IconGift/index.js +6 -5
  484. package/esm/icon/IconHeart/index.js +7 -6
  485. package/esm/icon/IconHome/index.js +6 -5
  486. package/esm/icon/IconKeyboard/index.d.ts +7 -0
  487. package/esm/icon/IconKeyboard/index.js +37 -0
  488. package/esm/icon/IconKeyboardDelete/index.d.ts +7 -0
  489. package/esm/icon/IconKeyboardDelete/index.js +33 -0
  490. package/esm/icon/IconLikeCircle/index.js +6 -5
  491. package/esm/icon/IconMinus/index.js +7 -6
  492. package/esm/icon/IconMore/index.js +7 -6
  493. package/esm/icon/IconNotice/index.js +7 -6
  494. package/esm/icon/IconNoticeOff/index.js +7 -6
  495. package/esm/icon/IconPicture/index.js +6 -5
  496. package/esm/icon/IconPlay/index.js +7 -6
  497. package/esm/icon/IconQuestionCircle/index.js +6 -5
  498. package/esm/icon/IconRefresh/index.js +6 -5
  499. package/esm/icon/IconSad/index.js +6 -5
  500. package/esm/icon/IconScan/index.js +6 -5
  501. package/esm/icon/IconSearch/index.js +6 -5
  502. package/esm/icon/IconSetting/index.js +8 -7
  503. package/esm/icon/IconShop/index.js +6 -5
  504. package/esm/icon/IconShopping/index.js +6 -5
  505. package/esm/icon/IconSmileFill/index.js +6 -5
  506. package/esm/icon/IconSound/index.js +7 -6
  507. package/esm/icon/IconSquareChecked/index.js +6 -5
  508. package/esm/icon/IconSquareDisabled/index.js +6 -5
  509. package/esm/icon/IconSquareUnchecked/index.js +6 -5
  510. package/esm/icon/IconStar/index.js +7 -6
  511. package/esm/icon/IconStarFill/index.js +7 -6
  512. package/esm/icon/IconStarHalf/index.js +6 -5
  513. package/esm/icon/IconSubway/index.js +6 -5
  514. package/esm/icon/IconSuccessCircle/index.js +6 -5
  515. package/esm/icon/IconTriDown/index.js +7 -6
  516. package/esm/icon/IconTriUp/index.js +7 -6
  517. package/esm/icon/IconUpload/index.js +7 -6
  518. package/esm/icon/IconUser/index.js +6 -5
  519. package/esm/icon/IconUserFill/index.js +6 -5
  520. package/esm/icon/IconWarnCircle/index.js +7 -6
  521. package/esm/icon/IconWarnCircleFill/index.js +7 -6
  522. package/esm/icon/index.d.ts +2 -0
  523. package/esm/icon/index.js +2 -0
  524. package/esm/image/index.js +84 -57
  525. package/esm/image/style/css/index.css +1 -0
  526. package/esm/image/style/index.less +1 -0
  527. package/esm/image-picker/index.js +80 -52
  528. package/esm/image-picker/style/css/index.d.ts +1 -0
  529. package/esm/image-picker/style/css/index.js +1 -0
  530. package/esm/image-picker/style/index.d.ts +1 -0
  531. package/esm/image-picker/style/index.js +1 -0
  532. package/esm/image-preview/index.d.ts +2 -2
  533. package/esm/image-preview/index.js +217 -119
  534. package/esm/image-preview/methods.js +14 -4
  535. package/esm/index-bar/context.d.ts +3 -0
  536. package/esm/index-bar/context.js +8 -0
  537. package/esm/index-bar/demo/style/css/mobile.css +23 -0
  538. package/esm/index-bar/demo/style/mobile.less +26 -0
  539. package/esm/index-bar/group.d.ts +3 -0
  540. package/esm/index-bar/group.js +83 -0
  541. package/esm/index-bar/index.d.ts +15 -0
  542. package/esm/index-bar/index.js +254 -0
  543. package/esm/index-bar/side-bar.d.ts +3 -0
  544. package/esm/index-bar/side-bar.js +90 -0
  545. package/esm/index-bar/style/css/index.css +164 -0
  546. package/esm/index-bar/style/css/index.d.ts +3 -0
  547. package/esm/index-bar/style/css/index.js +3 -0
  548. package/esm/index-bar/style/index.d.ts +3 -0
  549. package/esm/index-bar/style/index.js +3 -0
  550. package/esm/index-bar/style/index.less +122 -0
  551. package/esm/index-bar/type.d.ts +195 -0
  552. package/esm/index-bar/type.js +1 -0
  553. package/esm/index-bar/utils.d.ts +6 -0
  554. package/esm/index-bar/utils.js +53 -0
  555. package/esm/index.d.ts +12 -9
  556. package/esm/index.js +12 -9
  557. package/esm/input/demo/style/css/mobile.css +5 -1
  558. package/esm/input/demo/style/mobile.less +2 -2
  559. package/esm/input/hooks.js +96 -42
  560. package/esm/input/index.js +30 -26
  561. package/esm/input/props.d.ts +6 -0
  562. package/esm/input/style/css/index.css +9 -0
  563. package/esm/input/style/index.less +2 -2
  564. package/esm/keyboard/demo/style/css/mobile.css +4 -0
  565. package/esm/keyboard/demo/style/mobile.less +8 -0
  566. package/esm/keyboard/index.d.ts +13 -0
  567. package/esm/keyboard/index.js +243 -0
  568. package/esm/keyboard/style/css/index.css +93 -0
  569. package/esm/keyboard/style/css/index.d.ts +3 -0
  570. package/esm/keyboard/style/css/index.js +3 -0
  571. package/esm/keyboard/style/index.d.ts +3 -0
  572. package/esm/keyboard/style/index.js +3 -0
  573. package/esm/keyboard/style/index.less +80 -0
  574. package/esm/keyboard/type.d.ts +102 -0
  575. package/esm/keyboard/type.js +1 -0
  576. package/esm/load-more/index.js +48 -29
  577. package/esm/loading/index.js +40 -19
  578. package/esm/masking/index.d.ts +2 -2
  579. package/esm/masking/index.js +64 -46
  580. package/esm/masking/methods.js +15 -4
  581. package/esm/nav-bar/back-icon.js +3 -1
  582. package/esm/nav-bar/index.js +52 -37
  583. package/esm/notice-bar/index.js +56 -35
  584. package/esm/notice-bar/style/css/index.css +33 -0
  585. package/esm/notice-bar/style/index.less +16 -3
  586. package/esm/notify/index.d.ts +8 -8
  587. package/esm/notify/index.js +33 -20
  588. package/esm/notify/methods.js +13 -2
  589. package/esm/pagination/index.js +50 -27
  590. package/esm/picker/index.js +59 -70
  591. package/esm/picker/type.d.ts +1 -1
  592. package/esm/picker-view/components/cascader.d.ts +2 -3
  593. package/esm/picker-view/components/cascader.js +30 -19
  594. package/esm/picker-view/components/multi-picker.d.ts +2 -3
  595. package/esm/picker-view/components/multi-picker.js +42 -35
  596. package/esm/picker-view/components/picker-cell.d.ts +1 -1
  597. package/esm/picker-view/components/picker-cell.js +94 -52
  598. package/esm/picker-view/index.d.ts +1 -1
  599. package/esm/picker-view/index.js +62 -44
  600. package/esm/picker-view/type.d.ts +2 -2
  601. package/esm/popover/hooks/useEvent.js +41 -26
  602. package/esm/popover/hooks/usePosition.js +144 -94
  603. package/esm/popover/index.js +2 -2
  604. package/esm/popover/menu.js +41 -32
  605. package/esm/popover/popover-inner.js +38 -30
  606. package/esm/popover/popover.js +90 -69
  607. package/esm/popup/index.d.ts +2 -2
  608. package/esm/popup/index.js +25 -22
  609. package/esm/popup-swiper/index.d.ts +2 -2
  610. package/esm/popup-swiper/index.js +64 -38
  611. package/esm/portal/index.js +5 -3
  612. package/esm/progress/index.js +36 -27
  613. package/esm/pull-refresh/android-pull-refresh.js +90 -58
  614. package/esm/pull-refresh/hooks.js +23 -11
  615. package/esm/pull-refresh/index.js +5 -3
  616. package/esm/pull-refresh/ios-pull-refresh.js +68 -53
  617. package/esm/pull-refresh/model.js +1 -0
  618. package/esm/radio/group.js +24 -20
  619. package/esm/radio/index.js +2 -2
  620. package/esm/rate/index.js +39 -24
  621. package/esm/search-bar/association.js +27 -14
  622. package/esm/search-bar/cancel-button.js +11 -8
  623. package/esm/search-bar/highlight.js +20 -14
  624. package/esm/search-bar/index.js +86 -77
  625. package/esm/show-monitor/index.js +85 -34
  626. package/esm/slider/hooks/useSliderEvents.js +69 -44
  627. package/esm/slider/hooks/useSliderIcon.js +13 -6
  628. package/esm/slider/hooks/useSliderInit.js +46 -32
  629. package/esm/slider/hooks/useSliderStyle.js +20 -12
  630. package/esm/slider/index.js +62 -46
  631. package/esm/slider/marks.js +18 -12
  632. package/esm/slider/popover.js +6 -4
  633. package/esm/slider/thumb.js +15 -8
  634. package/esm/stepper/hooks/useButtonClick.js +27 -19
  635. package/esm/stepper/hooks/useInputEvent.js +16 -9
  636. package/esm/stepper/hooks/useValue.js +12 -9
  637. package/esm/stepper/index.js +82 -82
  638. package/esm/steps/index.js +27 -22
  639. package/esm/steps/step.js +19 -10
  640. package/esm/sticky/index.js +58 -38
  641. package/esm/style.d.ts +11 -8
  642. package/esm/style.js +11 -8
  643. package/esm/swipe-action/index.js +80 -40
  644. package/esm/swipe-action/item.js +12 -9
  645. package/esm/swipe-load/index.js +75 -56
  646. package/esm/switch/index.js +39 -27
  647. package/esm/tab-bar/index.js +1 -0
  648. package/esm/tab-bar/item.js +13 -6
  649. package/esm/tab-bar/tab-bar.js +21 -15
  650. package/esm/tabs/index.js +183 -130
  651. package/esm/tabs/tab-cell-underline.js +103 -38
  652. package/esm/tabs/tab-cell.js +114 -70
  653. package/esm/tabs/tab-pane.js +85 -49
  654. package/esm/tabs/type.d.ts +18 -2
  655. package/esm/tag/index.js +2 -2
  656. package/esm/tag/list.js +16 -11
  657. package/esm/tag/tag.js +22 -20
  658. package/esm/textarea/index.js +46 -35
  659. package/esm/toast/index.d.ts +12 -12
  660. package/esm/toast/index.js +42 -26
  661. package/esm/toast/methods.js +12 -2
  662. package/esm/transition/index.js +12 -10
  663. package/package.json +3 -3
  664. package/tokens/app/arcodesign/default/css-variables.less +51 -0
  665. package/tokens/app/arcodesign/default/index.d.ts +51 -0
  666. package/tokens/app/arcodesign/default/index.js +54 -1
  667. package/tokens/app/arcodesign/default/index.json +610 -0
  668. package/tokens/app/arcodesign/default/index.less +51 -0
  669. package/tokens/mixin/index.less +19 -1
  670. package/umd/_helpers/hooks.js +121 -43
  671. package/umd/_helpers/index.js +6 -2
  672. package/umd/_helpers/react-dom.js +11 -0
  673. package/umd/_helpers/render.js +9 -0
  674. package/umd/action-sheet/index.d.ts +2 -2
  675. package/umd/action-sheet/index.js +22 -10
  676. package/umd/action-sheet/methods.js +1 -0
  677. package/umd/avatar/group.js +20 -12
  678. package/umd/avatar/index.js +68 -51
  679. package/umd/badge/index.js +25 -18
  680. package/umd/button/hooks.js +19 -15
  681. package/umd/button/index.js +60 -46
  682. package/umd/carousel/index.d.ts +6 -0
  683. package/umd/carousel/index.js +337 -184
  684. package/umd/carousel/style/css/index.css +50 -15
  685. package/umd/carousel/style/index.less +19 -14
  686. package/umd/cell/arrow.js +2 -0
  687. package/umd/cell/cell.js +18 -14
  688. package/umd/cell/demo/style/css/mobile.css +8 -0
  689. package/umd/cell/demo/style/mobile.less +2 -2
  690. package/umd/cell/group.js +17 -9
  691. package/umd/cell/index.js +2 -1
  692. package/umd/cell/style/css/index.css +16 -0
  693. package/umd/cell/style/index.less +6 -4
  694. package/umd/checkbox/checkbox.js +45 -31
  695. package/umd/checkbox/group.js +34 -24
  696. package/umd/checkbox/hooks/useMergeProps.js +12 -7
  697. package/umd/checkbox/index.js +3 -1
  698. package/umd/checkbox/type.js +2 -0
  699. package/umd/circle-progress/index.js +52 -37
  700. package/umd/collapse/collapse.js +50 -27
  701. package/umd/collapse/group.js +38 -20
  702. package/umd/collapse/index.js +3 -0
  703. package/umd/collapse/utils.js +5 -0
  704. package/umd/context-provider/index.d.ts +6 -0
  705. package/umd/context-provider/index.js +25 -11
  706. package/umd/count-down/hooks.js +39 -24
  707. package/umd/count-down/index.js +31 -29
  708. package/umd/count-down/singleton.js +10 -2
  709. package/umd/count-down/util.js +47 -33
  710. package/umd/date-picker/helper.js +13 -7
  711. package/umd/date-picker/index.js +97 -42
  712. package/umd/dialog/index.d.ts +2 -2
  713. package/umd/dialog/index.js +44 -28
  714. package/umd/dialog/methods.js +18 -9
  715. package/umd/divider/demo/style/css/mobile.css +7 -0
  716. package/umd/divider/demo/style/mobile.less +12 -0
  717. package/umd/divider/index.d.ts +49 -0
  718. package/umd/divider/index.js +71 -0
  719. package/umd/divider/style/css/index.css +69 -0
  720. package/umd/divider/style/css/index.d.ts +2 -0
  721. package/umd/divider/style/css/index.js +15 -0
  722. package/umd/divider/style/index.d.ts +2 -0
  723. package/umd/divider/style/index.js +15 -0
  724. package/umd/divider/style/index.less +66 -0
  725. package/umd/dropdown/dropdown.js +106 -74
  726. package/umd/dropdown/index.js +3 -1
  727. package/umd/dropdown/options.js +24 -12
  728. package/umd/dropdown-menu/dropdown-menu.js +78 -49
  729. package/umd/dropdown-menu/helper.js +25 -6
  730. package/umd/dropdown-menu/index.js +2 -0
  731. package/umd/ellipsis/components/js-ellipsis.js +69 -33
  732. package/umd/ellipsis/components/native-ellipsis.js +13 -9
  733. package/umd/ellipsis/index.js +24 -19
  734. package/umd/ellipsis/utils/dom.js +8 -0
  735. package/umd/ellipsis/utils/is.js +5 -1
  736. package/umd/form/form-item-context.js +3 -0
  737. package/umd/form/form-item.js +116 -42
  738. package/umd/form/index.js +25 -17
  739. package/umd/form/type.js +3 -0
  740. package/umd/form/useForm.js +72 -18
  741. package/umd/form/utils.js +10 -3
  742. package/umd/grid/index.js +37 -21
  743. package/umd/icon/IconAdd/index.js +7 -5
  744. package/umd/icon/IconArrowBack/index.js +7 -5
  745. package/umd/icon/IconArrowDown/index.js +7 -5
  746. package/umd/icon/IconArrowIn/index.js +7 -5
  747. package/umd/icon/IconArrowUp/index.js +7 -5
  748. package/umd/icon/IconCheck/index.js +7 -5
  749. package/umd/icon/IconCheckBold/index.js +7 -5
  750. package/umd/icon/IconCircleChecked/index.js +7 -5
  751. package/umd/icon/IconCircleDisabled/index.js +7 -5
  752. package/umd/icon/IconCircleUnchecked/index.js +7 -5
  753. package/umd/icon/IconClear/index.js +7 -5
  754. package/umd/icon/IconClose/index.js +7 -5
  755. package/umd/icon/IconCloseBold/index.js +7 -5
  756. package/umd/icon/IconDelete/index.js +7 -5
  757. package/umd/icon/IconEdit/index.js +7 -5
  758. package/umd/icon/IconErrorCircle/index.js +7 -5
  759. package/umd/icon/IconEyeInvisible/index.js +7 -5
  760. package/umd/icon/IconEyeVisible/index.js +7 -5
  761. package/umd/icon/IconEyelashInvisible/index.js +7 -5
  762. package/umd/icon/IconGift/index.js +7 -5
  763. package/umd/icon/IconHeart/index.js +8 -6
  764. package/umd/icon/IconHome/index.js +7 -5
  765. package/umd/icon/IconKeyboard/index.d.ts +7 -0
  766. package/umd/icon/IconKeyboard/index.js +56 -0
  767. package/umd/icon/IconKeyboardDelete/index.d.ts +7 -0
  768. package/umd/icon/IconKeyboardDelete/index.js +52 -0
  769. package/umd/icon/IconLikeCircle/index.js +7 -5
  770. package/umd/icon/IconMinus/index.js +8 -6
  771. package/umd/icon/IconMore/index.js +8 -6
  772. package/umd/icon/IconNotice/index.js +8 -6
  773. package/umd/icon/IconNoticeOff/index.js +8 -6
  774. package/umd/icon/IconPicture/index.js +7 -5
  775. package/umd/icon/IconPlay/index.js +8 -6
  776. package/umd/icon/IconQuestionCircle/index.js +7 -5
  777. package/umd/icon/IconRefresh/index.js +7 -5
  778. package/umd/icon/IconSad/index.js +7 -5
  779. package/umd/icon/IconScan/index.js +7 -5
  780. package/umd/icon/IconSearch/index.js +7 -5
  781. package/umd/icon/IconSetting/index.js +9 -7
  782. package/umd/icon/IconShop/index.js +7 -5
  783. package/umd/icon/IconShopping/index.js +7 -5
  784. package/umd/icon/IconSmileFill/index.js +7 -5
  785. package/umd/icon/IconSound/index.js +8 -6
  786. package/umd/icon/IconSquareChecked/index.js +7 -5
  787. package/umd/icon/IconSquareDisabled/index.js +7 -5
  788. package/umd/icon/IconSquareUnchecked/index.js +7 -5
  789. package/umd/icon/IconStar/index.js +8 -6
  790. package/umd/icon/IconStarFill/index.js +8 -6
  791. package/umd/icon/IconStarHalf/index.js +7 -5
  792. package/umd/icon/IconSubway/index.js +7 -5
  793. package/umd/icon/IconSuccessCircle/index.js +7 -5
  794. package/umd/icon/IconTriDown/index.js +8 -6
  795. package/umd/icon/IconTriUp/index.js +8 -6
  796. package/umd/icon/IconUpload/index.js +8 -6
  797. package/umd/icon/IconUser/index.js +7 -5
  798. package/umd/icon/IconUserFill/index.js +7 -5
  799. package/umd/icon/IconWarnCircle/index.js +8 -6
  800. package/umd/icon/IconWarnCircleFill/index.js +8 -6
  801. package/umd/icon/index.d.ts +2 -0
  802. package/umd/icon/index.js +13 -6
  803. package/umd/image/index.js +86 -56
  804. package/umd/image/style/css/index.css +1 -0
  805. package/umd/image/style/index.less +1 -0
  806. package/umd/image-picker/add-icon.js +2 -0
  807. package/umd/image-picker/index.js +85 -52
  808. package/umd/image-picker/style/css/index.d.ts +1 -0
  809. package/umd/image-picker/style/css/index.js +4 -4
  810. package/umd/image-picker/style/index.d.ts +1 -0
  811. package/umd/image-picker/style/index.js +4 -4
  812. package/umd/image-preview/index.d.ts +2 -2
  813. package/umd/image-preview/index.js +224 -119
  814. package/umd/image-preview/methods.js +15 -5
  815. package/umd/index-bar/context.d.ts +3 -0
  816. package/umd/index-bar/context.js +26 -0
  817. package/umd/index-bar/demo/style/css/mobile.css +23 -0
  818. package/umd/index-bar/demo/style/mobile.less +26 -0
  819. package/umd/index-bar/group.d.ts +3 -0
  820. package/umd/index-bar/group.js +107 -0
  821. package/umd/index-bar/index.d.ts +15 -0
  822. package/umd/index-bar/index.js +274 -0
  823. package/umd/index-bar/side-bar.d.ts +3 -0
  824. package/umd/index-bar/side-bar.js +113 -0
  825. package/umd/index-bar/style/css/index.css +164 -0
  826. package/umd/index-bar/style/css/index.d.ts +3 -0
  827. package/umd/index-bar/style/css/index.js +15 -0
  828. package/umd/index-bar/style/index.d.ts +3 -0
  829. package/umd/index-bar/style/index.js +15 -0
  830. package/umd/index-bar/style/index.less +122 -0
  831. package/umd/index-bar/type.d.ts +195 -0
  832. package/umd/index-bar/type.js +17 -0
  833. package/umd/index-bar/utils.d.ts +6 -0
  834. package/umd/index-bar/utils.js +78 -0
  835. package/umd/index.d.ts +12 -9
  836. package/umd/index.js +30 -23
  837. package/umd/input/demo/style/css/mobile.css +5 -1
  838. package/umd/input/demo/style/mobile.less +2 -2
  839. package/umd/input/hooks.js +100 -42
  840. package/umd/input/index.js +35 -26
  841. package/umd/input/props.d.ts +6 -0
  842. package/umd/input/style/css/index.css +9 -0
  843. package/umd/input/style/index.less +2 -2
  844. package/umd/keyboard/demo/style/css/mobile.css +4 -0
  845. package/umd/keyboard/demo/style/mobile.less +8 -0
  846. package/umd/keyboard/index.d.ts +13 -0
  847. package/umd/keyboard/index.js +271 -0
  848. package/umd/keyboard/style/css/index.css +93 -0
  849. package/umd/keyboard/style/css/index.d.ts +3 -0
  850. package/umd/keyboard/style/css/index.js +15 -0
  851. package/umd/keyboard/style/index.d.ts +3 -0
  852. package/umd/keyboard/style/index.js +15 -0
  853. package/umd/keyboard/style/index.less +80 -0
  854. package/umd/keyboard/type.d.ts +102 -0
  855. package/umd/keyboard/type.js +17 -0
  856. package/umd/load-more/index.js +51 -29
  857. package/umd/loading/index.js +43 -19
  858. package/umd/masking/index.d.ts +2 -2
  859. package/umd/masking/index.js +71 -46
  860. package/umd/masking/methods.js +16 -4
  861. package/umd/nav-bar/back-icon.js +4 -1
  862. package/umd/nav-bar/index.js +55 -37
  863. package/umd/notice-bar/index.js +57 -33
  864. package/umd/notice-bar/style/css/index.css +33 -0
  865. package/umd/notice-bar/style/index.less +16 -3
  866. package/umd/notify/index.d.ts +8 -8
  867. package/umd/notify/index.js +40 -20
  868. package/umd/notify/methods.js +14 -2
  869. package/umd/pagination/arrow.js +2 -0
  870. package/umd/pagination/index.js +53 -27
  871. package/umd/picker/index.js +64 -70
  872. package/umd/picker/type.d.ts +1 -1
  873. package/umd/picker-view/components/cascader.d.ts +2 -3
  874. package/umd/picker-view/components/cascader.js +34 -19
  875. package/umd/picker-view/components/multi-picker.d.ts +2 -3
  876. package/umd/picker-view/components/multi-picker.js +44 -35
  877. package/umd/picker-view/components/picker-cell.d.ts +1 -1
  878. package/umd/picker-view/components/picker-cell.js +98 -52
  879. package/umd/picker-view/index.d.ts +1 -1
  880. package/umd/picker-view/index.js +65 -43
  881. package/umd/picker-view/type.d.ts +2 -2
  882. package/umd/popover/hooks/useEvent.js +44 -25
  883. package/umd/popover/hooks/usePosition.js +145 -94
  884. package/umd/popover/index.js +3 -1
  885. package/umd/popover/menu.js +45 -32
  886. package/umd/popover/popover-inner.js +42 -30
  887. package/umd/popover/popover.js +94 -69
  888. package/umd/popup/index.d.ts +2 -2
  889. package/umd/popup/index.js +31 -22
  890. package/umd/popup/methods.js +1 -0
  891. package/umd/popup-swiper/index.d.ts +2 -2
  892. package/umd/popup-swiper/index.js +71 -38
  893. package/umd/popup-swiper/methods.js +1 -0
  894. package/umd/portal/index.js +6 -3
  895. package/umd/progress/index.js +39 -27
  896. package/umd/pull-refresh/android-pull-refresh.js +93 -58
  897. package/umd/pull-refresh/hooks.js +29 -11
  898. package/umd/pull-refresh/index.js +7 -3
  899. package/umd/pull-refresh/ios-pull-refresh.js +72 -53
  900. package/umd/pull-refresh/model.js +1 -0
  901. package/umd/radio/group.js +30 -20
  902. package/umd/radio/index.js +3 -1
  903. package/umd/radio/radio.js +5 -0
  904. package/umd/rate/index.js +44 -24
  905. package/umd/search-bar/association.js +29 -14
  906. package/umd/search-bar/cancel-button.js +14 -8
  907. package/umd/search-bar/highlight.js +21 -14
  908. package/umd/search-bar/index.js +87 -77
  909. package/umd/show-monitor/index.js +89 -34
  910. package/umd/slider/hooks/index.js +4 -0
  911. package/umd/slider/hooks/useSliderEvents.js +70 -44
  912. package/umd/slider/hooks/useSliderIcon.js +17 -6
  913. package/umd/slider/hooks/useSliderInit.js +50 -32
  914. package/umd/slider/hooks/useSliderStyle.js +22 -12
  915. package/umd/slider/index.js +65 -46
  916. package/umd/slider/marks.js +21 -12
  917. package/umd/slider/popover.js +10 -4
  918. package/umd/slider/thumb.js +18 -8
  919. package/umd/stepper/hooks/useButtonClick.js +27 -19
  920. package/umd/stepper/hooks/useInputEvent.js +17 -9
  921. package/umd/stepper/hooks/useValue.js +13 -9
  922. package/umd/stepper/index.js +87 -82
  923. package/umd/steps/index.js +32 -22
  924. package/umd/steps/step.js +22 -10
  925. package/umd/sticky/index.js +61 -38
  926. package/umd/style.d.ts +11 -8
  927. package/umd/style.js +4 -4
  928. package/umd/swipe-action/index.js +84 -40
  929. package/umd/swipe-action/item.js +14 -9
  930. package/umd/swipe-load/index.js +77 -55
  931. package/umd/switch/index.js +43 -27
  932. package/umd/tab-bar/index.js +2 -0
  933. package/umd/tab-bar/item.js +19 -6
  934. package/umd/tab-bar/tab-bar.js +26 -15
  935. package/umd/tabs/index.js +186 -129
  936. package/umd/tabs/tab-cell-underline.js +107 -38
  937. package/umd/tabs/tab-cell.js +119 -70
  938. package/umd/tabs/tab-pane.js +89 -49
  939. package/umd/tabs/type.d.ts +18 -2
  940. package/umd/tag/index.js +3 -1
  941. package/umd/tag/list.js +20 -11
  942. package/umd/tag/tag.js +26 -20
  943. package/umd/textarea/index.js +51 -35
  944. package/umd/toast/index.d.ts +12 -12
  945. package/umd/toast/index.js +49 -26
  946. package/umd/toast/methods.js +13 -2
  947. package/umd/transition/index.js +12 -10
@@ -51,7 +51,7 @@ export interface PickerProps extends Omit<PopupProps, 'visible' | 'close' | 'chi
51
51
  * 每列数据选择变化后的回调函数
52
52
  * @en The callback after each column data selection changes
53
53
  */
54
- onPickerChange?: (value: ValueType[], index: number) => void;
54
+ onPickerChange?: (value: ValueType[], index: number, data: PickerData[]) => void;
55
55
  /**
56
56
  * 每列样式
57
57
  * @en Stylesheet per column
@@ -9,11 +9,10 @@ export interface CascaderProps {
9
9
  disabled: boolean;
10
10
  itemHeight: number;
11
11
  wrapperHeight: number;
12
- selectedValue: ValueType[];
12
+ selectedValue?: ValueType[];
13
13
  rows?: number;
14
14
  hideEmptyCols?: boolean;
15
- onValueChange?: (value: ValueType[], index: number) => void;
16
- onPickerChange?: (value: ValueType[], index: number) => void;
15
+ onValueChange?: (value: ValueType[], index: number, data: PickerData[]) => void;
17
16
  touchToStop?: boolean | number;
18
17
  }
19
18
  export interface CascaderRef {
@@ -14,29 +14,32 @@
14
14
  "use strict";
15
15
 
16
16
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
17
+
17
18
  _exports.__esModule = true;
18
19
  _exports.default = void 0;
19
20
  _react = _interopRequireWildcard(_react);
20
21
  _multiPicker = _interopRequireDefault(_multiPicker);
21
22
  _pickerCell = _interopRequireDefault(_pickerCell);
23
+
22
24
  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); }
25
+
23
26
  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; }
27
+
24
28
  var Cascader = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
25
29
  var prefixCls = props.prefixCls,
26
- itemStyle = props.itemStyle,
27
- cols = props.cols,
28
- data = props.data,
29
- disabled = props.disabled,
30
- clickable = props.clickable,
31
- itemHeight = props.itemHeight,
32
- wrapperHeight = props.wrapperHeight,
33
- rows = props.rows,
34
- hideEmptyCols = props.hideEmptyCols,
35
- onPickerChange = props.onPickerChange,
36
- onValueChange = props.onValueChange,
37
- _props$selectedValue = props.selectedValue,
38
- selectedValue = _props$selectedValue === void 0 ? [] : _props$selectedValue,
39
- touchToStop = props.touchToStop;
30
+ itemStyle = props.itemStyle,
31
+ cols = props.cols,
32
+ data = props.data,
33
+ disabled = props.disabled,
34
+ clickable = props.clickable,
35
+ itemHeight = props.itemHeight,
36
+ wrapperHeight = props.wrapperHeight,
37
+ rows = props.rows,
38
+ hideEmptyCols = props.hideEmptyCols,
39
+ onValueChange = props.onValueChange,
40
+ _props$selectedValue = props.selectedValue,
41
+ selectedValue = _props$selectedValue === void 0 ? [] : _props$selectedValue,
42
+ touchToStop = props.touchToStop;
40
43
  var pickerCellsRef = (0, _react.useRef)([]);
41
44
  (0, _react.useImperativeHandle)(ref, function () {
42
45
  return {
@@ -44,45 +47,58 @@
44
47
  scrollToCurrentIndex: scrollToCurrentIndex
45
48
  };
46
49
  });
50
+
47
51
  function getCellMovingStatus() {
48
52
  return pickerCellsRef.current.map(function (cell) {
49
53
  return cell.movingStatus;
50
54
  });
51
55
  }
56
+
52
57
  function scrollToCurrentIndex() {
53
58
  pickerCellsRef.current.forEach(function (cell) {
54
59
  return cell.scrollToCurrentIndex();
55
60
  });
56
61
  }
57
- function _onValueChange(value, index) {
62
+
63
+ function _onValueChange(value, index, newData) {
58
64
  var children = (0, _mobileUtils.arrayTreeFilter)(data, function (item, level) {
59
65
  return level <= index && item.value === value[level];
60
66
  });
61
67
  var child = children[index];
62
68
  var i;
69
+
63
70
  for (i = index + 1; i < cols && child && child.children; i++) {
64
71
  child = child.children[0];
65
72
  value[i] = child.value;
73
+ newData[i] = child;
66
74
  }
75
+
67
76
  value.length = i;
68
- onValueChange == null ? void 0 : onValueChange(value, index);
77
+ newData.length = i;
78
+ onValueChange == null ? void 0 : onValueChange(value, index, newData);
69
79
  }
80
+
70
81
  function _formatData() {
71
82
  var childrenTree = (0, _mobileUtils.arrayTreeFilter)(data, function (item, level) {
72
- return item.value === selectedValue[level];
83
+ return item.value === (selectedValue == null ? void 0 : selectedValue[level]);
84
+ }, {
85
+ fallbackChildIndex: 0
73
86
  }).map(function (item) {
74
87
  return item.children;
75
88
  });
76
89
  var needPad = cols - childrenTree.length;
90
+
77
91
  if (needPad > 0) {
78
92
  for (var i = 0; i < needPad; i++) {
79
93
  childrenTree.push([]);
80
94
  }
81
95
  }
96
+
82
97
  childrenTree.length = cols - 1;
83
98
  childrenTree.unshift(data);
84
99
  return childrenTree;
85
100
  }
101
+
86
102
  var formatData = (0, _react.useMemo)(function () {
87
103
  return _formatData();
88
104
  }, [data, selectedValue]);
@@ -91,8 +107,7 @@
91
107
  data: formatData,
92
108
  selectedValue: selectedValue,
93
109
  itemHeight: itemHeight,
94
- onValueChange: _onValueChange,
95
- onPickerChange: onPickerChange
110
+ onValueChange: _onValueChange
96
111
  }, formatData.map(function (item, index) {
97
112
  return /*#__PURE__*/_react.default.createElement(_pickerCell.default, {
98
113
  key: index + "_picker_cell_cascader",
@@ -3,10 +3,9 @@ import { PickerData, ValueType } from '../type';
3
3
  export interface MultiPickerProps {
4
4
  prefixCls: string;
5
5
  data: PickerData[][];
6
- selectedValue: ValueType[];
6
+ selectedValue?: ValueType[];
7
7
  children: any;
8
8
  itemHeight: number;
9
- onValueChange: (value: ValueType[], index: number) => void;
10
- onPickerChange?: (value: ValueType[], index: number) => void;
9
+ onValueChange: (value: ValueType[], index: number, data: PickerData[]) => void;
11
10
  }
12
11
  export default function MultiPicker(props: MultiPickerProps): JSX.Element;
@@ -14,61 +14,70 @@
14
14
  "use strict";
15
15
 
16
16
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
17
+
17
18
  _exports.__esModule = true;
18
19
  _exports.default = MultiPicker;
19
20
  _react = _interopRequireDefault(_react);
21
+
20
22
  function MultiPicker(props) {
21
23
  var prefixCls = props.prefixCls,
22
- onValueChange = props.onValueChange,
23
- onPickerChange = props.onPickerChange,
24
- children = props.children,
25
- itemHeight = props.itemHeight,
26
- selectedValue = props.selectedValue,
27
- data = props.data;
28
- function getValue() {
29
- if (selectedValue && selectedValue.length) {
30
- return selectedValue;
31
- }
32
- if (data) {
33
- return data.map(function (item) {
34
- return item && item[0] && item[0].value;
35
- });
36
- }
37
- if (!children) {
38
- return [];
39
- }
40
- return _react.default.Children.map(children, function (child) {
41
- var childrenArray = _react.default.Children.toArray(child.children || child.props.children);
42
- return childrenArray && childrenArray[0] && childrenArray[0].props.value;
24
+ onValueChange = props.onValueChange,
25
+ children = props.children,
26
+ itemHeight = props.itemHeight,
27
+ selectedValue = props.selectedValue,
28
+ data = props.data;
29
+
30
+ function getCurrentData() {
31
+ return (data || []).map(function (item, itemIndex) {
32
+ var curSelected = selectedValue == null ? void 0 : selectedValue[itemIndex];
33
+ var cur = curSelected ? (item || []).find(function (i) {
34
+ return i.value === curSelected;
35
+ }) : undefined;
36
+ return cur || (item == null ? void 0 : item[0]);
43
37
  });
44
38
  }
45
- function onChange(index, value, callback) {
46
- var newValue = getValue().concat();
39
+
40
+ function onChange(_ref) {
41
+ var index = _ref.index,
42
+ value = _ref.value,
43
+ changedData = _ref.changedData,
44
+ callback = _ref.callback;
45
+ var newData = getCurrentData().concat();
46
+ newData[index] = changedData;
47
+ var newValue = newData.map(function (d) {
48
+ return d == null ? void 0 : d.value;
49
+ });
47
50
  newValue[index] = value;
51
+
48
52
  if (callback) {
49
- callback(newValue, index);
53
+ callback(newValue, index, newData);
50
54
  }
51
55
  }
52
- function _onValueChange(value, index) {
53
- onChange(index, value, onValueChange);
54
- }
55
- function _onScrollChange(value, index) {
56
- onChange(index, value, onPickerChange);
56
+
57
+ function _onValueChange(value, index, changedData) {
58
+ onChange({
59
+ index: index,
60
+ value: value,
61
+ callback: onValueChange,
62
+ changedData: changedData
63
+ });
57
64
  }
65
+
58
66
  function renderChild() {
59
- var value = getValue();
67
+ var curData = getCurrentData();
68
+ var value = curData.map(function (d) {
69
+ return d == null ? void 0 : d.value;
70
+ });
60
71
  return _react.default.Children.map(children, function (col, index) {
61
72
  return /*#__PURE__*/_react.default.cloneElement(col, {
62
- onScrollChange: function onScrollChange(val) {
63
- return _onScrollChange(val, index);
64
- },
65
- onValueChange: function onValueChange(val) {
66
- return _onValueChange(val, index);
73
+ onValueChange: function onValueChange(val, changedData) {
74
+ return _onValueChange(val, index, changedData);
67
75
  },
68
76
  selectedValue: value[index]
69
77
  });
70
78
  });
71
79
  }
80
+
72
81
  return /*#__PURE__*/_react.default.createElement("div", {
73
82
  className: prefixCls + "-multi",
74
83
  style: {
@@ -8,7 +8,7 @@ export interface PickerCellProps {
8
8
  itemHeight: number;
9
9
  wrapperHeight: number;
10
10
  selectedValue?: ValueType;
11
- onValueChange?: (value: ValueType) => void;
11
+ onValueChange?: (value: ValueType, data: PickerData) => void;
12
12
  disabled: boolean;
13
13
  hideEmptyCols?: boolean;
14
14
  /**
@@ -14,45 +14,55 @@
14
14
  "use strict";
15
15
 
16
16
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
17
+
17
18
  _exports.__esModule = true;
18
19
  _exports.default = void 0;
19
20
  _extends2 = _interopRequireDefault(_extends2);
20
21
  _react = _interopRequireWildcard(_react);
22
+
21
23
  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); }
24
+
22
25
  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; }
26
+
23
27
  var PickerCell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
24
28
  var prefixCls = props.prefixCls,
25
- style = props.style,
26
- data = props.data,
27
- clickable = props.clickable,
28
- itemHeight = props.itemHeight,
29
- wrapperHeight = props.wrapperHeight,
30
- selectedValue = props.selectedValue,
31
- onValueChange = props.onValueChange,
32
- disabled = props.disabled,
33
- hideEmptyCols = props.hideEmptyCols,
34
- _props$rows = props.rows,
35
- rows = _props$rows === void 0 ? 5 : _props$rows,
36
- _props$touchToStop = props.touchToStop,
37
- touchToStop = _props$touchToStop === void 0 ? false : _props$touchToStop;
29
+ style = props.style,
30
+ data = props.data,
31
+ clickable = props.clickable,
32
+ itemHeight = props.itemHeight,
33
+ wrapperHeight = props.wrapperHeight,
34
+ selectedValue = props.selectedValue,
35
+ onValueChange = props.onValueChange,
36
+ disabled = props.disabled,
37
+ hideEmptyCols = props.hideEmptyCols,
38
+ _props$rows = props.rows,
39
+ rows = _props$rows === void 0 ? 5 : _props$rows,
40
+ _props$touchToStop = props.touchToStop,
41
+ touchToStop = _props$touchToStop === void 0 ? false : _props$touchToStop;
42
+
38
43
  var _useMountedState = (0, _helpers.useMountedState)(''),
39
- transitionDuration = _useMountedState[0],
40
- setTransitionDuration = _useMountedState[1];
44
+ transitionDuration = _useMountedState[0],
45
+ setTransitionDuration = _useMountedState[1];
46
+
41
47
  var _useState = (0, _react.useState)(''),
42
- bezier = _useState[0],
43
- setBezier = _useState[1];
48
+ bezier = _useState[0],
49
+ setBezier = _useState[1];
50
+
44
51
  var _useMountedState2 = (0, _helpers.useMountedState)(0),
45
- currentIndex = _useMountedState2[0],
46
- setCurrentIndex = _useMountedState2[1];
52
+ currentIndex = _useMountedState2[0],
53
+ setCurrentIndex = _useMountedState2[1];
54
+
47
55
  var _useMountedState3 = (0, _helpers.useMountedState)(selectedValue),
48
- currentValue = _useMountedState3[0],
49
- setCurrentValue = _useMountedState3[1];
50
- // 是否开始touch
56
+ currentValue = _useMountedState3[0],
57
+ setCurrentValue = _useMountedState3[1]; // 是否开始touch
51
58
  // @en whether to start touch
59
+
60
+
52
61
  var _useRefState = (0, _helpers.useRefState)(0),
53
- transformY = _useRefState[0],
54
- transformYRef = _useRefState[1],
55
- setTransformY = _useRefState[2];
62
+ transformY = _useRefState[0],
63
+ transformYRef = _useRefState[1],
64
+ setTransformY = _useRefState[2];
65
+
56
66
  var lastTransformYRef = (0, _react.useRef)(0);
57
67
  var touchStartTimeRef = (0, _react.useRef)(0);
58
68
  var latestCallbackTimer = (0, _react.useRef)(0);
@@ -77,66 +87,78 @@
77
87
  paddingTop: (rowCount - 1) / 2 * itemHeight + "px"
78
88
  }));
79
89
  }, [transitionDuration, transformY, bezier, itemHeight, rowCount]);
90
+
80
91
  function _scrollingComplete(nowItemIndex) {
81
92
  // index有改变时再抛出
82
93
  // @en Throws again when index changes
83
94
  if (currentIndex !== nowItemIndex) {
84
- setCurrentIndex(nowItemIndex);
85
- var newValue = data[nowItemIndex] && data[nowItemIndex].value;
95
+ setCurrentIndex(Math.max(nowItemIndex, 0));
96
+ var newData = data[nowItemIndex];
97
+ var newValue = newData == null ? void 0 : newData.value;
98
+
86
99
  if (newValue !== currentValue) {
87
- // if (!('selectedValue' in props)) {
88
- // setCurrentValue(newValue);
89
- // }
90
100
  setCurrentValue(newValue);
101
+
91
102
  if (onValueChange) {
92
- onValueChange(newValue);
103
+ onValueChange(newValue, newData);
93
104
  }
94
105
  }
95
106
  }
96
107
  }
108
+
97
109
  function _scrollTo(transY, transDuration, callback) {
98
110
  if (transDuration === void 0) {
99
111
  transDuration = 0;
100
112
  }
113
+
101
114
  if (callback === void 0) {
102
115
  callback = function callback() {};
103
116
  }
117
+
104
118
  setTransitionDuration(transDuration ? transDuration + "ms" : '');
105
- setTransformY(transY);
106
- // 处理连续滑动的情况:
119
+ setTransformY(transY); // 处理连续滑动的情况:
107
120
  // @en handle the case of continuous sliding:
108
121
  // 如果上一次callback还未执行,先cancel掉上一次回调,只执行最近的一次回调
109
122
  // @en If the last callback has not been executed, cancel the last callback first, and only execute the latest callback
123
+
110
124
  if (latestCallbackTimer.current) {
111
125
  clearTimeout(latestCallbackTimer.current);
112
126
  }
127
+
113
128
  latestCallbackTimer.current = window.setTimeout(function () {
114
129
  movingStatusRef.current = 'normal';
115
130
  setTransitionDuration('');
116
131
  callback();
117
132
  }, transDuration);
118
133
  }
134
+
119
135
  function _scrollToIndex(itemIndex, transDuration, callback) {
120
136
  if (transDuration === void 0) {
121
137
  transDuration = 0;
122
138
  }
139
+
123
140
  if (callback === void 0) {
124
141
  callback = function callback() {};
125
142
  }
143
+
126
144
  _scrollTo(-1 * itemIndex * itemHeight, transDuration, callback);
127
145
  }
146
+
128
147
  function _scrollToIndexWithChange(itemIndex, transDuration) {
129
148
  if (transDuration === void 0) {
130
149
  transDuration = 0;
131
150
  }
151
+
132
152
  _scrollToIndex(itemIndex, transDuration, function () {
133
153
  _scrollingComplete(itemIndex);
134
154
  });
135
155
  }
156
+
136
157
  var _handleColumnTouchStart = (0, _react.useCallback)(function (e) {
137
158
  if (disabled) {
138
159
  return;
139
160
  }
161
+
140
162
  isTouchMoveRef.current = false;
141
163
  movingStatusRef.current = 'moving';
142
164
  var x = e.touches[0].screenX;
@@ -148,38 +170,44 @@
148
170
  touchStartYRef.current = y;
149
171
  lastTransformYRef.current = transformYRef.current;
150
172
  }, [disabled]);
173
+
151
174
  var _handleColumnTouchMove = (0, _react.useCallback)(function (e) {
152
175
  if (disabled || !touchingRef.current) {
153
176
  return;
154
177
  }
178
+
155
179
  isTouchMoveRef.current = true;
156
180
  var lastTransformY = lastTransformYRef.current;
157
181
  var touchMoveX = e.touches[0].screenX;
158
182
  var touchMoveY = e.touches[0].screenY;
159
183
  var distanceX = touchMoveX - touchStartXRef.current;
160
184
  var distance = touchMoveY - touchStartYRef.current;
185
+
161
186
  if (touchingXRef.current === null) {
162
187
  touchingXRef.current = Math.abs(distanceX) > Math.abs(distance);
163
188
  }
189
+
164
190
  if (touchingXRef.current) {
165
191
  return;
166
192
  }
193
+
167
194
  e.cancelable && e.preventDefault();
168
195
  var newPos = lastTransformY + distance;
169
- var maxPos = -1 * (data.length - 1) * itemHeight;
170
- // 当滚动到上边界或下边界时增加阻尼效果
196
+ var maxPos = -1 * (data.length - 1) * itemHeight; // 当滚动到上边界或下边界时增加阻尼效果
171
197
  // @en Add damping effect when scrolling to the upper or lower border
198
+
172
199
  setTransformY(lastTransformY >= 0 && distance > 0 || lastTransformY <= maxPos && distance < 0 ? lastTransformY + distance / 4 : newPos);
173
200
  }, [data.length, disabled, itemHeight]);
201
+
174
202
  function _handleScrollEnd() {
175
203
  var maxIndex = data.length - 1;
176
- var nowIndex = Math.max(0, Math.min(maxIndex, Math.round(-1 * transformY / itemHeight)));
177
- // 滚动(包括加动量的滚动)完成之后定位到最近的一个index上
204
+ var nowIndex = Math.max(0, Math.min(maxIndex, Math.round(-1 * transformY / itemHeight))); // 滚动(包括加动量的滚动)完成之后定位到最近的一个index上
178
205
  // @en After scrolling (including scrolling with momentum) is completed, it is positioned on the nearest index
206
+
179
207
  _scrollToIndexWithChange(nowIndex, 200);
180
- }
208
+ } // Reference: https://juejin.im/post/6844904185121488910
209
+
181
210
 
182
- // Reference: https://juejin.im/post/6844904185121488910
183
211
  function momentum(current, start, duration, minY, maxY) {
184
212
  var durationMap = {
185
213
  noBounce: 2000,
@@ -191,23 +219,24 @@
191
219
  weekBounce: 'cubic-bezier(.25, .46, .45, .94)',
192
220
  strongBounce: 'cubic-bezier(.25, .46, .45, .94)'
193
221
  };
194
- var type = 'noBounce';
195
- // 惯性滑动加速度
222
+ var type = 'noBounce'; // 惯性滑动加速度
196
223
  // @en inertial sliding acceleration
197
- var deceleration = 0.003;
198
- // 回弹阻力
224
+
225
+ var deceleration = 0.003; // 回弹阻力
199
226
  // @en rebound resistance
200
- var bounceRate = 5;
201
- // 强弱回弹的分割值
227
+
228
+ var bounceRate = 5; // 强弱回弹的分割值
202
229
  // @en Split value of strong and weak rebound
203
- var bounceThreshold = 300;
204
- // 回弹的最大限度
230
+
231
+ var bounceThreshold = 300; // 回弹的最大限度
205
232
  // @en maximum rebound
233
+
206
234
  var maxOverflowY = wrapperHeight / 6;
207
235
  var overflowY;
208
236
  var distance = current - start;
209
237
  var speed = 2 * Math.abs(distance) / duration;
210
238
  var destination = current + speed / deceleration * (distance < 0 ? -1 : 1);
239
+
211
240
  if (destination < minY) {
212
241
  overflowY = minY - destination;
213
242
  type = overflowY > bounceThreshold ? 'strongBounce' : 'weekBounce';
@@ -217,31 +246,37 @@
217
246
  type = overflowY > bounceThreshold ? 'strongBounce' : 'weekBounce';
218
247
  destination = Math.min(maxY + maxOverflowY, maxY + overflowY / bounceRate);
219
248
  }
249
+
220
250
  return {
221
251
  destination: destination,
222
252
  duration: durationMap[type],
223
253
  bezier: bezierMap[type]
224
254
  };
225
255
  }
256
+
226
257
  function _handleColumnTouchEnd() {
227
258
  _clearTimer();
259
+
228
260
  movingStatusRef.current = 'normal';
229
261
  var lastTransformY = lastTransformYRef.current;
262
+
230
263
  if (!isTouchMoveRef.current || transformY === lastTransformY) {
231
264
  return;
232
265
  }
266
+
233
267
  touchingRef.current = false;
234
268
  var endTime = Date.now();
235
269
  var scrollerHeight = (data.length + rowCount - 1) * itemHeight;
236
270
  var duration = endTime - touchStartTimeRef.current;
237
- var absDistY = Math.abs(transformY - lastTransformY);
238
- // 计算动量,保证滚动顺畅,条件:手势时间小于300ms && 移动距离绝对值大于30时
271
+ var absDistY = Math.abs(transformY - lastTransformY); // 计算动量,保证滚动顺畅,条件:手势时间小于300ms && 移动距离绝对值大于30时
239
272
  // @en Calculate the momentum to ensure smooth scrolling, condition: the gesture time is less than 300ms && the absolute value of the moving distance is greater than 30
273
+
240
274
  if (duration < 300 && absDistY > 30) {
241
275
  var momentumY = momentum(transformY, lastTransformY, duration, wrapperHeight - scrollerHeight, 0);
242
276
  var newItemIndex = Math.max(0, Math.min(data.length - 1, Math.round(-1 * momentumY.destination / itemHeight)));
243
277
  setBezier(momentumY.bezier);
244
278
  movingStatusRef.current = 'scrolling';
279
+
245
280
  _scrollToIndex(newItemIndex, momentumY.duration, function () {
246
281
  _scrollingComplete(newItemIndex);
247
282
  });
@@ -249,27 +284,32 @@
249
284
  _handleScrollEnd();
250
285
  }
251
286
  }
287
+
252
288
  function scrollToCurrentIndex() {
253
289
  if (!wrapRef.current) {
254
290
  return;
255
291
  }
292
+
256
293
  var curStyle = window.getComputedStyle(wrapRef.current);
257
294
  var transformMatrix = curStyle.transform || curStyle.webkitTransform || '';
258
295
  var transY = Number(transformMatrix.replace(/matrix\((.*?)\)/, '$1').split(/,\s*/).slice(-1)[0]) || 0;
259
296
  var maxIndex = data.length - 1;
260
- var nowIndex = Math.max(0, Math.min(maxIndex, Math.round(-1 * transY / itemHeight)));
261
- // 滚动(包括加动量的滚动)完成之后定位到最近的一个index上
297
+ var nowIndex = Math.max(0, Math.min(maxIndex, Math.round(-1 * transY / itemHeight))); // 滚动(包括加动量的滚动)完成之后定位到最近的一个index上
262
298
  // @en After scrolling (including scrolling with momentum) is completed, it is positioned on the nearest index
299
+
263
300
  _scrollToIndexWithChange(nowIndex, 0);
264
301
  }
302
+
265
303
  function _clearTimer() {
266
304
  timeRef.current && clearTimeout(timeRef.current);
267
305
  timeRef.current = null;
268
306
  }
307
+
269
308
  function _handleItemTouchStart() {
270
309
  if (touchToStop === false) {
271
310
  return;
272
311
  }
312
+
273
313
  isTouchStopped.current = false;
274
314
  timeRef.current = window.setTimeout(function () {
275
315
  if (!isTouchMoveRef.current) {
@@ -278,17 +318,21 @@
278
318
  }
279
319
  }, touchToStop === true ? 100 : touchToStop);
280
320
  }
321
+
281
322
  function _handleItemClick(itemIndex) {
282
323
  if (!clickable || disabled || touchToStop !== false && isTouchStopped.current) {
283
324
  return;
284
325
  }
326
+
285
327
  _scrollToIndexWithChange(itemIndex, 200);
286
328
  }
329
+
287
330
  (0, _react.useEffect)(function () {
288
331
  if (wrapRef.current) {
289
332
  wrapRef.current.addEventListener('touchstart', _handleColumnTouchStart);
290
333
  wrapRef.current.addEventListener('touchmove', _handleColumnTouchMove);
291
334
  }
335
+
292
336
  return function () {
293
337
  if (wrapRef.current) {
294
338
  wrapRef.current.removeEventListener('touchstart', _handleColumnTouchStart);
@@ -301,7 +345,8 @@
301
345
  var curIndex = data.findIndex(function (item) {
302
346
  return item.value === selectedValue;
303
347
  });
304
- setCurrentIndex(curIndex);
348
+ setCurrentIndex(Math.max(curIndex, 0));
349
+
305
350
  if (curIndex >= 0) {
306
351
  _scrollToIndexWithChange(curIndex);
307
352
  }
@@ -325,6 +370,7 @@
325
370
  "aria-disabled": disabled
326
371
  }, data.map(function (item, index) {
327
372
  var _cls;
373
+
328
374
  var dis = Math.abs(index - currentIndex);
329
375
  return /*#__PURE__*/_react.default.createElement("div", {
330
376
  "aria-label": index === currentIndex ? "" + item.value : '',
@@ -25,7 +25,7 @@ export interface PickerViewRef {
25
25
  * 获取第 n 列的值
26
26
  * @en Get the value of the nth column
27
27
  */
28
- getColumnValue: (index: number) => ValueType;
28
+ getColumnValue: (index: number) => ValueType | undefined;
29
29
  /**
30
30
  * 手动更新元素布局
31
31
  * @en Manually update the element layout