@arco-design/mobile-react 2.38.4 → 2.39.1

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 (754) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/hooks.js +59 -141
  5. package/cjs/_helpers/index.js +2 -18
  6. package/cjs/_helpers/react-dom.js +0 -14
  7. package/cjs/_helpers/render.js +5 -21
  8. package/cjs/action-sheet/index.js +10 -30
  9. package/cjs/action-sheet/methods.js +0 -2
  10. package/cjs/action-sheet/style/css/index.js +0 -2
  11. package/cjs/action-sheet/style/index.js +0 -2
  12. package/cjs/avatar/group.js +12 -24
  13. package/cjs/avatar/index.js +53 -79
  14. package/cjs/avatar/style/css/index.js +0 -2
  15. package/cjs/avatar/style/index.js +0 -2
  16. package/cjs/badge/index.js +18 -29
  17. package/cjs/badge/style/css/index.js +0 -1
  18. package/cjs/badge/style/index.js +0 -1
  19. package/cjs/button/hooks.js +15 -20
  20. package/cjs/button/index.js +46 -67
  21. package/cjs/button/style/css/index.js +0 -2
  22. package/cjs/button/style/index.js +0 -2
  23. package/cjs/carousel/index.js +153 -288
  24. package/cjs/carousel/style/css/index.js +0 -1
  25. package/cjs/carousel/style/index.js +0 -1
  26. package/cjs/cell/arrow.js +0 -3
  27. package/cjs/cell/cell.js +18 -34
  28. package/cjs/cell/group.js +9 -21
  29. package/cjs/cell/index.js +1 -7
  30. package/cjs/cell/style/css/index.js +0 -1
  31. package/cjs/cell/style/index.js +0 -1
  32. package/cjs/checkbox/checkbox.js +31 -57
  33. package/cjs/checkbox/group.js +24 -38
  34. package/cjs/checkbox/hooks/index.js +0 -2
  35. package/cjs/checkbox/hooks/useMergeProps.js +7 -14
  36. package/cjs/checkbox/index.js +1 -8
  37. package/cjs/checkbox/style/css/index.js +0 -1
  38. package/cjs/checkbox/style/index.js +0 -1
  39. package/cjs/checkbox/type.js +0 -2
  40. package/cjs/circle-progress/index.js +37 -57
  41. package/cjs/circle-progress/style/css/index.js +0 -1
  42. package/cjs/circle-progress/style/index.js +0 -1
  43. package/cjs/collapse/collapse.js +30 -61
  44. package/cjs/collapse/group.js +20 -44
  45. package/cjs/collapse/index.js +0 -9
  46. package/cjs/collapse/style/css/index.js +0 -1
  47. package/cjs/collapse/style/index.js +0 -1
  48. package/cjs/collapse/utils.js +0 -7
  49. package/cjs/context-provider/index.js +18 -43
  50. package/cjs/context-provider/style/css/index.js +0 -1
  51. package/cjs/context-provider/style/index.js +0 -1
  52. package/cjs/count-down/hooks.js +24 -43
  53. package/cjs/count-down/index.js +29 -37
  54. package/cjs/count-down/singleton.js +2 -12
  55. package/cjs/count-down/style/css/index.js +0 -1
  56. package/cjs/count-down/style/index.js +0 -1
  57. package/cjs/count-down/util.js +33 -47
  58. package/cjs/date-picker/helper.js +7 -14
  59. package/cjs/date-picker/index.js +66 -167
  60. package/cjs/date-picker/style/css/index.js +0 -2
  61. package/cjs/date-picker/style/index.js +0 -2
  62. package/cjs/dialog/index.js +31 -57
  63. package/cjs/dialog/methods.js +9 -22
  64. package/cjs/dialog/style/css/index.js +0 -2
  65. package/cjs/dialog/style/index.js +0 -2
  66. package/cjs/divider/index.js +8 -20
  67. package/cjs/divider/style/css/index.js +0 -1
  68. package/cjs/divider/style/index.js +0 -1
  69. package/cjs/dropdown/dropdown.js +74 -113
  70. package/cjs/dropdown/index.js +1 -8
  71. package/cjs/dropdown/options.js +12 -28
  72. package/cjs/dropdown/style/css/index.js +0 -1
  73. package/cjs/dropdown/style/index.js +0 -1
  74. package/cjs/dropdown-menu/dropdown-menu.js +49 -84
  75. package/cjs/dropdown-menu/helper.js +4 -24
  76. package/cjs/dropdown-menu/index.js +0 -6
  77. package/cjs/dropdown-menu/style/css/index.js +0 -2
  78. package/cjs/dropdown-menu/style/index.js +0 -2
  79. package/cjs/ellipsis/components/js-ellipsis.js +32 -70
  80. package/cjs/ellipsis/components/native-ellipsis.js +9 -14
  81. package/cjs/ellipsis/index.js +19 -32
  82. package/cjs/ellipsis/style/css/index.js +0 -1
  83. package/cjs/ellipsis/style/index.js +0 -1
  84. package/cjs/ellipsis/utils/dom.js +0 -8
  85. package/cjs/ellipsis/utils/is.js +1 -5
  86. package/cjs/form/form-item-context.js +0 -5
  87. package/cjs/form/form-item.js +74 -163
  88. package/cjs/form/index.js +18 -38
  89. package/cjs/form/linked-container.js +5 -24
  90. package/cjs/form/style/css/index.js +0 -1
  91. package/cjs/form/style/index.js +0 -1
  92. package/cjs/form/type.d.ts +11 -1
  93. package/cjs/form/type.js +0 -5
  94. package/cjs/form/useForm.js +10 -79
  95. package/cjs/form/utils.js +4 -22
  96. package/cjs/grid/index.js +22 -45
  97. package/cjs/grid/style/css/index.js +0 -1
  98. package/cjs/grid/style/index.js +0 -1
  99. package/cjs/icon/IconAdd/index.js +5 -12
  100. package/cjs/icon/IconArrowBack/index.js +5 -12
  101. package/cjs/icon/IconArrowDown/index.js +5 -12
  102. package/cjs/icon/IconArrowIn/index.js +5 -12
  103. package/cjs/icon/IconArrowUp/index.js +5 -12
  104. package/cjs/icon/IconCheck/index.js +5 -12
  105. package/cjs/icon/IconCheckBold/index.js +5 -12
  106. package/cjs/icon/IconCircleChecked/index.js +5 -12
  107. package/cjs/icon/IconCircleDisabled/index.js +5 -12
  108. package/cjs/icon/IconCircleUnchecked/index.js +5 -12
  109. package/cjs/icon/IconClear/index.js +5 -12
  110. package/cjs/icon/IconClose/index.js +5 -12
  111. package/cjs/icon/IconCloseBold/index.js +5 -12
  112. package/cjs/icon/IconDelete/index.js +5 -12
  113. package/cjs/icon/IconDownload/index.js +5 -12
  114. package/cjs/icon/IconEdit/index.js +5 -12
  115. package/cjs/icon/IconErrorCircle/index.js +5 -12
  116. package/cjs/icon/IconEyeInvisible/index.js +5 -12
  117. package/cjs/icon/IconEyeVisible/index.js +5 -12
  118. package/cjs/icon/IconEyelashInvisible/index.js +5 -12
  119. package/cjs/icon/IconFile/index.js +5 -12
  120. package/cjs/icon/IconGift/index.js +5 -12
  121. package/cjs/icon/IconHeart/index.js +5 -12
  122. package/cjs/icon/IconHome/index.js +5 -12
  123. package/cjs/icon/IconKeyboard/index.js +5 -12
  124. package/cjs/icon/IconKeyboardDelete/index.js +5 -12
  125. package/cjs/icon/IconLikeCircle/index.js +5 -12
  126. package/cjs/icon/IconMinus/index.js +5 -12
  127. package/cjs/icon/IconMore/index.js +5 -12
  128. package/cjs/icon/IconNotice/index.js +5 -12
  129. package/cjs/icon/IconNoticeOff/index.js +5 -12
  130. package/cjs/icon/IconPicture/index.js +5 -12
  131. package/cjs/icon/IconPlay/index.js +5 -12
  132. package/cjs/icon/IconQuestionCircle/index.js +5 -12
  133. package/cjs/icon/IconRefresh/index.js +5 -12
  134. package/cjs/icon/IconSad/index.js +5 -12
  135. package/cjs/icon/IconScan/index.js +5 -12
  136. package/cjs/icon/IconSearch/index.js +5 -12
  137. package/cjs/icon/IconSetting/index.js +5 -12
  138. package/cjs/icon/IconShop/index.js +5 -12
  139. package/cjs/icon/IconShopping/index.js +5 -12
  140. package/cjs/icon/IconSmileFill/index.js +5 -12
  141. package/cjs/icon/IconSound/index.js +5 -12
  142. package/cjs/icon/IconSquareChecked/index.js +5 -12
  143. package/cjs/icon/IconSquareDisabled/index.js +5 -12
  144. package/cjs/icon/IconSquareUnchecked/index.js +5 -12
  145. package/cjs/icon/IconStar/index.js +5 -12
  146. package/cjs/icon/IconStarFill/index.js +5 -12
  147. package/cjs/icon/IconStarHalf/index.js +5 -12
  148. package/cjs/icon/IconSubway/index.js +5 -12
  149. package/cjs/icon/IconSuccessCircle/index.js +5 -12
  150. package/cjs/icon/IconTriDown/index.js +5 -12
  151. package/cjs/icon/IconTriUp/index.js +5 -12
  152. package/cjs/icon/IconUpload/index.js +5 -12
  153. package/cjs/icon/IconUser/index.js +5 -12
  154. package/cjs/icon/IconUserFill/index.js +5 -12
  155. package/cjs/icon/IconWarnCircle/index.js +5 -12
  156. package/cjs/icon/IconWarnCircleFill/index.js +5 -12
  157. package/cjs/icon/index.js +0 -119
  158. package/cjs/image/index.js +53 -94
  159. package/cjs/image/style/css/index.js +0 -2
  160. package/cjs/image/style/index.js +0 -2
  161. package/cjs/image-picker/add-icon.js +0 -3
  162. package/cjs/image-picker/index.js +32 -59
  163. package/cjs/image-picker/style/css/index.js +0 -3
  164. package/cjs/image-picker/style/index.js +0 -3
  165. package/cjs/image-preview/index.js +129 -254
  166. package/cjs/image-preview/methods.js +5 -18
  167. package/cjs/image-preview/style/css/index.js +0 -4
  168. package/cjs/image-preview/style/index.js +0 -4
  169. package/cjs/index-bar/context.js +0 -2
  170. package/cjs/index-bar/group.js +16 -35
  171. package/cjs/index-bar/index.js +55 -87
  172. package/cjs/index-bar/side-bar.js +15 -34
  173. package/cjs/index-bar/style/css/index.js +0 -2
  174. package/cjs/index-bar/style/index.js +0 -2
  175. package/cjs/index-bar/utils.js +3 -17
  176. package/cjs/index.js +0 -119
  177. package/cjs/input/hooks.js +45 -84
  178. package/cjs/input/index.js +26 -40
  179. package/cjs/input/style/css/index.js +0 -1
  180. package/cjs/input/style/index.js +0 -1
  181. package/cjs/keyboard/index.js +37 -73
  182. package/cjs/keyboard/style/css/index.js +0 -2
  183. package/cjs/keyboard/style/index.js +0 -2
  184. package/cjs/load-more/index.js +33 -65
  185. package/cjs/load-more/style/css/index.js +0 -1
  186. package/cjs/load-more/style/index.js +0 -1
  187. package/cjs/loading/index.js +19 -48
  188. package/cjs/loading/style/css/index.js +0 -1
  189. package/cjs/loading/style/index.js +0 -1
  190. package/cjs/masking/index.js +47 -80
  191. package/cjs/masking/methods.js +5 -21
  192. package/cjs/masking/style/css/index.js +0 -2
  193. package/cjs/masking/style/index.js +0 -2
  194. package/cjs/nav-bar/back-icon.js +2 -8
  195. package/cjs/nav-bar/index.js +37 -61
  196. package/cjs/nav-bar/style/css/index.js +0 -1
  197. package/cjs/nav-bar/style/index.js +0 -1
  198. package/cjs/notice-bar/index.js +34 -60
  199. package/cjs/notice-bar/style/css/index.js +0 -1
  200. package/cjs/notice-bar/style/index.js +0 -1
  201. package/cjs/notify/index.js +20 -49
  202. package/cjs/notify/methods.js +2 -17
  203. package/cjs/notify/style/css/index.js +0 -1
  204. package/cjs/notify/style/index.js +0 -1
  205. package/cjs/pagination/arrow.js +0 -3
  206. package/cjs/pagination/index.js +27 -58
  207. package/cjs/pagination/style/css/index.js +0 -1
  208. package/cjs/pagination/style/index.js +0 -1
  209. package/cjs/picker/index.js +48 -84
  210. package/cjs/picker/style/css/index.js +0 -3
  211. package/cjs/picker/style/index.js +0 -3
  212. package/cjs/picker-view/components/cascader.js +13 -32
  213. package/cjs/picker-view/components/multi-picker.js +8 -17
  214. package/cjs/picker-view/components/picker-cell.js +45 -101
  215. package/cjs/picker-view/index.js +30 -76
  216. package/cjs/picker-view/style/css/index.js +0 -1
  217. package/cjs/picker-view/style/index.js +0 -1
  218. package/cjs/popover/hooks/index.js +0 -4
  219. package/cjs/popover/hooks/useEvent.js +25 -49
  220. package/cjs/popover/hooks/usePosition.js +100 -159
  221. package/cjs/popover/index.js +1 -8
  222. package/cjs/popover/menu.js +32 -52
  223. package/cjs/popover/popover-inner.js +30 -48
  224. package/cjs/popover/popover.js +69 -101
  225. package/cjs/popover/style/css/index.js +0 -2
  226. package/cjs/popover/style/index.js +0 -2
  227. package/cjs/popup/index.js +22 -39
  228. package/cjs/popup/methods.js +0 -2
  229. package/cjs/popup/style/css/index.js +0 -2
  230. package/cjs/popup/style/index.js +0 -2
  231. package/cjs/popup-swiper/index.js +50 -92
  232. package/cjs/popup-swiper/methods.js +0 -2
  233. package/cjs/popup-swiper/style/css/index.js +0 -2
  234. package/cjs/popup-swiper/style/index.js +0 -2
  235. package/cjs/portal/index.js +3 -8
  236. package/cjs/portal/style/css/index.js +0 -1
  237. package/cjs/portal/style/index.js +0 -1
  238. package/cjs/progress/index.js +27 -44
  239. package/cjs/progress/style/css/index.js +0 -1
  240. package/cjs/progress/style/index.js +0 -1
  241. package/cjs/pull-refresh/android-pull-refresh.js +56 -95
  242. package/cjs/pull-refresh/hooks.js +11 -32
  243. package/cjs/pull-refresh/index.js +3 -14
  244. package/cjs/pull-refresh/ios-pull-refresh.js +53 -81
  245. package/cjs/pull-refresh/model.js +0 -1
  246. package/cjs/pull-refresh/style/css/index.js +0 -2
  247. package/cjs/pull-refresh/style/index.js +0 -2
  248. package/cjs/radio/group.js +20 -34
  249. package/cjs/radio/index.js +1 -8
  250. package/cjs/radio/radio.js +0 -10
  251. package/cjs/radio/style/css/index.js +0 -1
  252. package/cjs/radio/style/index.js +0 -1
  253. package/cjs/rate/index.js +28 -54
  254. package/cjs/rate/style/css/index.js +0 -1
  255. package/cjs/rate/style/index.js +0 -1
  256. package/cjs/search-bar/association.js +14 -32
  257. package/cjs/search-bar/cancel-button.js +8 -16
  258. package/cjs/search-bar/highlight.js +14 -25
  259. package/cjs/search-bar/index.js +77 -97
  260. package/cjs/search-bar/style/css/index.js +0 -1
  261. package/cjs/search-bar/style/index.js +0 -1
  262. package/cjs/show-monitor/index.js +40 -108
  263. package/cjs/show-monitor/style/css/index.js +0 -1
  264. package/cjs/show-monitor/style/index.js +0 -1
  265. package/cjs/skeleton/elements.js +47 -84
  266. package/cjs/skeleton/index.js +18 -36
  267. package/cjs/skeleton/skeleton-context.js +0 -4
  268. package/cjs/skeleton/style/css/index.js +0 -2
  269. package/cjs/skeleton/style/index.js +0 -2
  270. package/cjs/slider/hooks/index.js +0 -13
  271. package/cjs/slider/hooks/useSliderEvents.js +27 -59
  272. package/cjs/slider/hooks/useSliderIcon.js +6 -20
  273. package/cjs/slider/hooks/useSliderInit.js +32 -52
  274. package/cjs/slider/hooks/useSliderStyle.js +13 -27
  275. package/cjs/slider/index.js +47 -73
  276. package/cjs/slider/marks.js +13 -27
  277. package/cjs/slider/popover.js +4 -13
  278. package/cjs/slider/style/css/index.js +0 -2
  279. package/cjs/slider/style/index.js +0 -2
  280. package/cjs/slider/thumb.js +11 -22
  281. package/cjs/stepper/hooks/useButtonClick.js +15 -25
  282. package/cjs/stepper/hooks/useInputEvent.js +10 -19
  283. package/cjs/stepper/hooks/useValue.js +9 -15
  284. package/cjs/stepper/index.js +84 -98
  285. package/cjs/stepper/style/css/index.js +0 -1
  286. package/cjs/stepper/style/index.js +0 -1
  287. package/cjs/steps/index.js +25 -43
  288. package/cjs/steps/step.js +10 -27
  289. package/cjs/steps/style/css/index.js +0 -1
  290. package/cjs/steps/style/index.js +0 -1
  291. package/cjs/sticky/index.js +40 -74
  292. package/cjs/sticky/style/css/index.js +0 -1
  293. package/cjs/sticky/style/index.js +0 -1
  294. package/cjs/style.js +0 -59
  295. package/cjs/swipe-action/index.js +40 -92
  296. package/cjs/swipe-action/item.js +9 -17
  297. package/cjs/swipe-action/style/css/index.js +0 -1
  298. package/cjs/swipe-action/style/index.js +0 -1
  299. package/cjs/swipe-load/index.js +78 -113
  300. package/cjs/swipe-load/style/css/index.js +0 -1
  301. package/cjs/swipe-load/style/index.js +0 -1
  302. package/cjs/switch/index.js +28 -49
  303. package/cjs/switch/style/css/index.js +0 -1
  304. package/cjs/switch/style/index.js +0 -1
  305. package/cjs/tab-bar/index.js +0 -7
  306. package/cjs/tab-bar/item.js +6 -24
  307. package/cjs/tab-bar/style/css/index.js +0 -1
  308. package/cjs/tab-bar/style/index.js +0 -1
  309. package/cjs/tab-bar/tab-bar.js +16 -32
  310. package/cjs/tabs/index.js +136 -206
  311. package/cjs/tabs/style/css/index.js +0 -1
  312. package/cjs/tabs/style/index.js +0 -1
  313. package/cjs/tabs/tab-cell-underline.js +28 -76
  314. package/cjs/tabs/tab-cell.js +73 -128
  315. package/cjs/tabs/tab-pane.js +53 -103
  316. package/cjs/tag/index.js +1 -8
  317. package/cjs/tag/list.js +11 -26
  318. package/cjs/tag/style/css/index.js +0 -1
  319. package/cjs/tag/style/index.js +0 -1
  320. package/cjs/tag/tag.js +20 -32
  321. package/cjs/textarea/index.js +35 -56
  322. package/cjs/textarea/style/css/index.js +0 -2
  323. package/cjs/textarea/style/index.js +0 -2
  324. package/cjs/toast/index.js +26 -61
  325. package/cjs/toast/methods.js +2 -16
  326. package/cjs/toast/style/css/index.js +0 -3
  327. package/cjs/toast/style/index.js +0 -3
  328. package/cjs/transition/index.js +17 -29
  329. package/cjs/transition/style/css/index.js +0 -1
  330. package/cjs/transition/style/index.js +0 -1
  331. package/cjs/uploader/index.d.ts +1 -1
  332. package/cjs/uploader/index.js +28 -49
  333. package/cjs/uploader/style/css/index.js +0 -3
  334. package/cjs/uploader/style/index.js +0 -3
  335. package/cjs/uploader/upload/index.js +0 -4
  336. package/cjs/uploader/upload/upload.js +9 -45
  337. package/dist/index.js +3838 -6455
  338. package/dist/index.min.js +2 -2
  339. package/esm/_helpers/hooks.js +59 -123
  340. package/esm/_helpers/index.js +4 -6
  341. package/esm/_helpers/react-dom.js +0 -11
  342. package/esm/_helpers/render.js +5 -15
  343. package/esm/action-sheet/index.js +10 -16
  344. package/esm/avatar/group.js +12 -16
  345. package/esm/avatar/index.js +53 -64
  346. package/esm/badge/index.js +18 -22
  347. package/esm/button/hooks.js +15 -18
  348. package/esm/button/index.js +46 -57
  349. package/esm/carousel/index.js +153 -280
  350. package/esm/cell/cell.js +18 -25
  351. package/esm/cell/group.js +9 -11
  352. package/esm/cell/index.js +1 -1
  353. package/esm/checkbox/checkbox.js +31 -42
  354. package/esm/checkbox/group.js +24 -28
  355. package/esm/checkbox/hooks/useMergeProps.js +7 -9
  356. package/esm/checkbox/index.js +2 -2
  357. package/esm/checkbox/type.js +0 -1
  358. package/esm/circle-progress/index.js +37 -49
  359. package/esm/collapse/collapse.js +30 -51
  360. package/esm/collapse/group.js +20 -34
  361. package/esm/collapse/index.js +1 -1
  362. package/esm/collapse/utils.js +0 -1
  363. package/esm/context-provider/index.js +18 -33
  364. package/esm/count-down/hooks.js +24 -37
  365. package/esm/count-down/index.js +30 -29
  366. package/esm/count-down/singleton.js +2 -5
  367. package/esm/count-down/util.js +33 -42
  368. package/esm/date-picker/helper.js +7 -9
  369. package/esm/date-picker/index.js +66 -155
  370. package/esm/dialog/index.js +31 -42
  371. package/esm/dialog/methods.js +9 -11
  372. package/esm/divider/index.js +8 -12
  373. package/esm/dropdown/dropdown.js +74 -102
  374. package/esm/dropdown/index.js +1 -1
  375. package/esm/dropdown/options.js +12 -20
  376. package/esm/dropdown-menu/dropdown-menu.js +49 -74
  377. package/esm/dropdown-menu/helper.js +4 -14
  378. package/esm/dropdown-menu/index.js +1 -1
  379. package/esm/ellipsis/components/js-ellipsis.js +32 -60
  380. package/esm/ellipsis/components/native-ellipsis.js +9 -11
  381. package/esm/ellipsis/index.js +20 -21
  382. package/esm/ellipsis/utils/dom.js +0 -7
  383. package/esm/ellipsis/utils/is.js +1 -1
  384. package/esm/form/form-item.js +74 -147
  385. package/esm/form/index.js +18 -23
  386. package/esm/form/linked-container.js +5 -14
  387. package/esm/form/type.d.ts +11 -1
  388. package/esm/form/type.js +0 -5
  389. package/esm/form/useForm.js +10 -74
  390. package/esm/form/utils.js +4 -11
  391. package/esm/grid/index.js +22 -38
  392. package/esm/icon/IconAdd/index.js +5 -6
  393. package/esm/icon/IconArrowBack/index.js +5 -6
  394. package/esm/icon/IconArrowDown/index.js +5 -6
  395. package/esm/icon/IconArrowIn/index.js +5 -6
  396. package/esm/icon/IconArrowUp/index.js +5 -6
  397. package/esm/icon/IconCheck/index.js +5 -6
  398. package/esm/icon/IconCheckBold/index.js +5 -6
  399. package/esm/icon/IconCircleChecked/index.js +5 -6
  400. package/esm/icon/IconCircleDisabled/index.js +5 -6
  401. package/esm/icon/IconCircleUnchecked/index.js +5 -6
  402. package/esm/icon/IconClear/index.js +5 -6
  403. package/esm/icon/IconClose/index.js +5 -6
  404. package/esm/icon/IconCloseBold/index.js +5 -6
  405. package/esm/icon/IconDelete/index.js +5 -6
  406. package/esm/icon/IconDownload/index.js +5 -6
  407. package/esm/icon/IconEdit/index.js +5 -6
  408. package/esm/icon/IconErrorCircle/index.js +5 -6
  409. package/esm/icon/IconEyeInvisible/index.js +5 -6
  410. package/esm/icon/IconEyeVisible/index.js +5 -6
  411. package/esm/icon/IconEyelashInvisible/index.js +5 -6
  412. package/esm/icon/IconFile/index.js +5 -6
  413. package/esm/icon/IconGift/index.js +5 -6
  414. package/esm/icon/IconHeart/index.js +5 -6
  415. package/esm/icon/IconHome/index.js +5 -6
  416. package/esm/icon/IconKeyboard/index.js +5 -6
  417. package/esm/icon/IconKeyboardDelete/index.js +5 -6
  418. package/esm/icon/IconLikeCircle/index.js +5 -6
  419. package/esm/icon/IconMinus/index.js +5 -6
  420. package/esm/icon/IconMore/index.js +5 -6
  421. package/esm/icon/IconNotice/index.js +5 -6
  422. package/esm/icon/IconNoticeOff/index.js +5 -6
  423. package/esm/icon/IconPicture/index.js +5 -6
  424. package/esm/icon/IconPlay/index.js +5 -6
  425. package/esm/icon/IconQuestionCircle/index.js +5 -6
  426. package/esm/icon/IconRefresh/index.js +5 -6
  427. package/esm/icon/IconSad/index.js +5 -6
  428. package/esm/icon/IconScan/index.js +5 -6
  429. package/esm/icon/IconSearch/index.js +5 -6
  430. package/esm/icon/IconSetting/index.js +5 -6
  431. package/esm/icon/IconShop/index.js +5 -6
  432. package/esm/icon/IconShopping/index.js +5 -6
  433. package/esm/icon/IconSmileFill/index.js +5 -6
  434. package/esm/icon/IconSound/index.js +5 -6
  435. package/esm/icon/IconSquareChecked/index.js +5 -6
  436. package/esm/icon/IconSquareDisabled/index.js +5 -6
  437. package/esm/icon/IconSquareUnchecked/index.js +5 -6
  438. package/esm/icon/IconStar/index.js +5 -6
  439. package/esm/icon/IconStarFill/index.js +5 -6
  440. package/esm/icon/IconStarHalf/index.js +5 -6
  441. package/esm/icon/IconSubway/index.js +5 -6
  442. package/esm/icon/IconSuccessCircle/index.js +5 -6
  443. package/esm/icon/IconTriDown/index.js +5 -6
  444. package/esm/icon/IconTriUp/index.js +5 -6
  445. package/esm/icon/IconUpload/index.js +5 -6
  446. package/esm/icon/IconUser/index.js +5 -6
  447. package/esm/icon/IconUserFill/index.js +5 -6
  448. package/esm/icon/IconWarnCircle/index.js +5 -6
  449. package/esm/icon/IconWarnCircleFill/index.js +5 -6
  450. package/esm/image/index.js +53 -85
  451. package/esm/image-picker/index.js +32 -42
  452. package/esm/image-preview/index.js +129 -232
  453. package/esm/image-preview/methods.js +5 -14
  454. package/esm/index-bar/group.js +16 -25
  455. package/esm/index-bar/index.js +55 -74
  456. package/esm/index-bar/side-bar.js +15 -28
  457. package/esm/index-bar/utils.js +3 -10
  458. package/esm/input/hooks.js +45 -75
  459. package/esm/input/index.js +26 -30
  460. package/esm/keyboard/index.js +40 -63
  461. package/esm/load-more/index.js +33 -57
  462. package/esm/loading/index.js +19 -40
  463. package/esm/masking/index.js +47 -65
  464. package/esm/masking/methods.js +5 -16
  465. package/esm/nav-bar/back-icon.js +2 -4
  466. package/esm/nav-bar/index.js +37 -52
  467. package/esm/notice-bar/index.js +34 -53
  468. package/esm/notify/index.js +20 -33
  469. package/esm/notify/methods.js +2 -13
  470. package/esm/pagination/index.js +27 -50
  471. package/esm/picker/index.js +48 -69
  472. package/esm/picker-view/components/cascader.js +13 -24
  473. package/esm/picker-view/components/multi-picker.js +8 -14
  474. package/esm/picker-view/components/picker-cell.js +45 -93
  475. package/esm/picker-view/index.js +30 -60
  476. package/esm/popover/hooks/useEvent.js +26 -41
  477. package/esm/popover/hooks/usePosition.js +100 -152
  478. package/esm/popover/index.js +2 -2
  479. package/esm/popover/menu.js +32 -41
  480. package/esm/popover/popover-inner.js +30 -39
  481. package/esm/popover/popover.js +69 -90
  482. package/esm/popup/index.js +22 -25
  483. package/esm/popup-swiper/index.js +50 -76
  484. package/esm/portal/index.js +3 -5
  485. package/esm/progress/index.js +27 -36
  486. package/esm/pull-refresh/android-pull-refresh.js +56 -83
  487. package/esm/pull-refresh/hooks.js +11 -23
  488. package/esm/pull-refresh/index.js +3 -5
  489. package/esm/pull-refresh/ios-pull-refresh.js +53 -68
  490. package/esm/pull-refresh/model.js +0 -1
  491. package/esm/radio/group.js +20 -24
  492. package/esm/radio/index.js +2 -2
  493. package/esm/rate/index.js +28 -43
  494. package/esm/search-bar/association.js +14 -27
  495. package/esm/search-bar/cancel-button.js +8 -11
  496. package/esm/search-bar/highlight.js +14 -20
  497. package/esm/search-bar/index.js +77 -86
  498. package/esm/show-monitor/index.js +40 -100
  499. package/esm/skeleton/elements.js +47 -75
  500. package/esm/skeleton/index.js +18 -24
  501. package/esm/slider/hooks/useSliderEvents.js +27 -54
  502. package/esm/slider/hooks/useSliderIcon.js +6 -13
  503. package/esm/slider/hooks/useSliderInit.js +32 -46
  504. package/esm/slider/hooks/useSliderStyle.js +13 -22
  505. package/esm/slider/index.js +47 -63
  506. package/esm/slider/marks.js +13 -19
  507. package/esm/slider/popover.js +4 -6
  508. package/esm/slider/thumb.js +11 -16
  509. package/esm/stepper/hooks/useButtonClick.js +15 -24
  510. package/esm/stepper/hooks/useInputEvent.js +10 -17
  511. package/esm/stepper/hooks/useValue.js +9 -12
  512. package/esm/stepper/index.js +84 -84
  513. package/esm/steps/index.js +25 -30
  514. package/esm/steps/step.js +10 -19
  515. package/esm/sticky/index.js +40 -65
  516. package/esm/swipe-action/index.js +40 -80
  517. package/esm/swipe-action/item.js +9 -12
  518. package/esm/swipe-load/index.js +79 -104
  519. package/esm/switch/index.js +28 -41
  520. package/esm/tab-bar/index.js +0 -1
  521. package/esm/tab-bar/item.js +6 -13
  522. package/esm/tab-bar/tab-bar.js +16 -22
  523. package/esm/tabs/index.js +137 -194
  524. package/esm/tabs/tab-cell-underline.js +28 -67
  525. package/esm/tabs/tab-cell.js +73 -118
  526. package/esm/tabs/tab-pane.js +53 -95
  527. package/esm/tag/index.js +2 -2
  528. package/esm/tag/list.js +11 -16
  529. package/esm/tag/tag.js +20 -22
  530. package/esm/textarea/index.js +35 -46
  531. package/esm/toast/index.js +26 -42
  532. package/esm/toast/methods.js +2 -12
  533. package/esm/transition/index.js +17 -20
  534. package/esm/uploader/index.d.ts +1 -1
  535. package/esm/uploader/index.js +28 -34
  536. package/esm/uploader/upload/upload.js +9 -38
  537. package/esnext/form/form-item.js +12 -7
  538. package/esnext/form/type.d.ts +11 -1
  539. package/esnext/uploader/index.d.ts +1 -1
  540. package/esnext/uploader/index.js +1 -1
  541. package/esnext/uploader/upload/upload.js +1 -1
  542. package/package.json +5 -3
  543. package/tokens/app/arcodesign/default/index.js +0 -2
  544. package/umd/_helpers/hooks.js +59 -138
  545. package/umd/_helpers/index.js +2 -9
  546. package/umd/_helpers/react-dom.js +0 -13
  547. package/umd/_helpers/render.js +5 -17
  548. package/umd/action-sheet/index.js +10 -22
  549. package/umd/action-sheet/methods.js +0 -1
  550. package/umd/avatar/group.js +12 -20
  551. package/umd/avatar/index.js +53 -70
  552. package/umd/badge/index.js +18 -25
  553. package/umd/button/hooks.js +15 -19
  554. package/umd/button/index.js +46 -60
  555. package/umd/carousel/index.js +153 -283
  556. package/umd/cell/arrow.js +0 -2
  557. package/umd/cell/cell.js +18 -29
  558. package/umd/cell/group.js +9 -17
  559. package/umd/cell/index.js +1 -2
  560. package/umd/checkbox/checkbox.js +31 -45
  561. package/umd/checkbox/group.js +24 -34
  562. package/umd/checkbox/hooks/useMergeProps.js +7 -12
  563. package/umd/checkbox/index.js +1 -3
  564. package/umd/checkbox/type.js +0 -2
  565. package/umd/circle-progress/index.js +37 -52
  566. package/umd/collapse/collapse.js +30 -55
  567. package/umd/collapse/group.js +20 -38
  568. package/umd/collapse/index.js +0 -3
  569. package/umd/collapse/utils.js +0 -5
  570. package/umd/context-provider/index.js +18 -38
  571. package/umd/count-down/hooks.js +24 -39
  572. package/umd/count-down/index.js +29 -31
  573. package/umd/count-down/singleton.js +2 -10
  574. package/umd/count-down/util.js +33 -47
  575. package/umd/date-picker/helper.js +7 -13
  576. package/umd/date-picker/index.js +66 -158
  577. package/umd/dialog/index.js +31 -47
  578. package/umd/dialog/methods.js +9 -18
  579. package/umd/divider/index.js +8 -15
  580. package/umd/dropdown/dropdown.js +74 -106
  581. package/umd/dropdown/index.js +1 -3
  582. package/umd/dropdown/options.js +12 -24
  583. package/umd/dropdown-menu/dropdown-menu.js +49 -78
  584. package/umd/dropdown-menu/helper.js +4 -22
  585. package/umd/dropdown-menu/index.js +0 -2
  586. package/umd/ellipsis/components/js-ellipsis.js +32 -66
  587. package/umd/ellipsis/components/native-ellipsis.js +9 -12
  588. package/umd/ellipsis/index.js +19 -24
  589. package/umd/ellipsis/utils/dom.js +0 -8
  590. package/umd/ellipsis/utils/is.js +1 -5
  591. package/umd/form/form-item-context.js +0 -3
  592. package/umd/form/form-item.js +74 -151
  593. package/umd/form/index.js +18 -28
  594. package/umd/form/linked-container.js +5 -19
  595. package/umd/form/type.d.ts +11 -1
  596. package/umd/form/type.js +0 -5
  597. package/umd/form/useForm.js +10 -74
  598. package/umd/form/utils.js +4 -19
  599. package/umd/grid/index.js +22 -41
  600. package/umd/icon/IconAdd/index.js +5 -7
  601. package/umd/icon/IconArrowBack/index.js +5 -7
  602. package/umd/icon/IconArrowDown/index.js +5 -7
  603. package/umd/icon/IconArrowIn/index.js +5 -7
  604. package/umd/icon/IconArrowUp/index.js +5 -7
  605. package/umd/icon/IconCheck/index.js +5 -7
  606. package/umd/icon/IconCheckBold/index.js +5 -7
  607. package/umd/icon/IconCircleChecked/index.js +5 -7
  608. package/umd/icon/IconCircleDisabled/index.js +5 -7
  609. package/umd/icon/IconCircleUnchecked/index.js +5 -7
  610. package/umd/icon/IconClear/index.js +5 -7
  611. package/umd/icon/IconClose/index.js +5 -7
  612. package/umd/icon/IconCloseBold/index.js +5 -7
  613. package/umd/icon/IconDelete/index.js +5 -7
  614. package/umd/icon/IconDownload/index.js +5 -7
  615. package/umd/icon/IconEdit/index.js +5 -7
  616. package/umd/icon/IconErrorCircle/index.js +5 -7
  617. package/umd/icon/IconEyeInvisible/index.js +5 -7
  618. package/umd/icon/IconEyeVisible/index.js +5 -7
  619. package/umd/icon/IconEyelashInvisible/index.js +5 -7
  620. package/umd/icon/IconFile/index.js +5 -7
  621. package/umd/icon/IconGift/index.js +5 -7
  622. package/umd/icon/IconHeart/index.js +5 -7
  623. package/umd/icon/IconHome/index.js +5 -7
  624. package/umd/icon/IconKeyboard/index.js +5 -7
  625. package/umd/icon/IconKeyboardDelete/index.js +5 -7
  626. package/umd/icon/IconLikeCircle/index.js +5 -7
  627. package/umd/icon/IconMinus/index.js +5 -7
  628. package/umd/icon/IconMore/index.js +5 -7
  629. package/umd/icon/IconNotice/index.js +5 -7
  630. package/umd/icon/IconNoticeOff/index.js +5 -7
  631. package/umd/icon/IconPicture/index.js +5 -7
  632. package/umd/icon/IconPlay/index.js +5 -7
  633. package/umd/icon/IconQuestionCircle/index.js +5 -7
  634. package/umd/icon/IconRefresh/index.js +5 -7
  635. package/umd/icon/IconSad/index.js +5 -7
  636. package/umd/icon/IconScan/index.js +5 -7
  637. package/umd/icon/IconSearch/index.js +5 -7
  638. package/umd/icon/IconSetting/index.js +5 -7
  639. package/umd/icon/IconShop/index.js +5 -7
  640. package/umd/icon/IconShopping/index.js +5 -7
  641. package/umd/icon/IconSmileFill/index.js +5 -7
  642. package/umd/icon/IconSound/index.js +5 -7
  643. package/umd/icon/IconSquareChecked/index.js +5 -7
  644. package/umd/icon/IconSquareDisabled/index.js +5 -7
  645. package/umd/icon/IconSquareUnchecked/index.js +5 -7
  646. package/umd/icon/IconStar/index.js +5 -7
  647. package/umd/icon/IconStarFill/index.js +5 -7
  648. package/umd/icon/IconStarHalf/index.js +5 -7
  649. package/umd/icon/IconSubway/index.js +5 -7
  650. package/umd/icon/IconSuccessCircle/index.js +5 -7
  651. package/umd/icon/IconTriDown/index.js +5 -7
  652. package/umd/icon/IconTriUp/index.js +5 -7
  653. package/umd/icon/IconUpload/index.js +5 -7
  654. package/umd/icon/IconUser/index.js +5 -7
  655. package/umd/icon/IconUserFill/index.js +5 -7
  656. package/umd/icon/IconWarnCircle/index.js +5 -7
  657. package/umd/icon/IconWarnCircleFill/index.js +5 -7
  658. package/umd/icon/index.js +0 -1
  659. package/umd/image/index.js +53 -88
  660. package/umd/image-picker/add-icon.js +0 -2
  661. package/umd/image-picker/index.js +32 -47
  662. package/umd/image-preview/index.js +129 -239
  663. package/umd/image-preview/methods.js +5 -15
  664. package/umd/index-bar/group.js +16 -30
  665. package/umd/index-bar/index.js +55 -79
  666. package/umd/index-bar/side-bar.js +15 -32
  667. package/umd/index-bar/utils.js +3 -16
  668. package/umd/index.js +0 -1
  669. package/umd/input/hooks.js +45 -79
  670. package/umd/input/index.js +26 -35
  671. package/umd/keyboard/index.js +37 -64
  672. package/umd/load-more/index.js +33 -60
  673. package/umd/loading/index.js +19 -43
  674. package/umd/masking/index.js +47 -72
  675. package/umd/masking/methods.js +5 -18
  676. package/umd/nav-bar/back-icon.js +2 -5
  677. package/umd/nav-bar/index.js +37 -55
  678. package/umd/notice-bar/index.js +34 -56
  679. package/umd/notify/index.js +20 -40
  680. package/umd/notify/methods.js +2 -14
  681. package/umd/pagination/arrow.js +0 -2
  682. package/umd/pagination/index.js +27 -53
  683. package/umd/picker/index.js +48 -73
  684. package/umd/picker-view/components/cascader.js +13 -28
  685. package/umd/picker-view/components/multi-picker.js +8 -16
  686. package/umd/picker-view/components/picker-cell.js +45 -97
  687. package/umd/picker-view/index.js +30 -63
  688. package/umd/popover/hooks/useEvent.js +25 -44
  689. package/umd/popover/hooks/usePosition.js +100 -153
  690. package/umd/popover/index.js +1 -3
  691. package/umd/popover/menu.js +32 -45
  692. package/umd/popover/popover-inner.js +30 -43
  693. package/umd/popover/popover.js +69 -94
  694. package/umd/popup/index.js +22 -31
  695. package/umd/popup/methods.js +0 -1
  696. package/umd/popup-swiper/index.js +50 -83
  697. package/umd/popup-swiper/methods.js +0 -1
  698. package/umd/portal/index.js +3 -6
  699. package/umd/progress/index.js +27 -39
  700. package/umd/pull-refresh/android-pull-refresh.js +56 -86
  701. package/umd/pull-refresh/hooks.js +11 -29
  702. package/umd/pull-refresh/index.js +3 -7
  703. package/umd/pull-refresh/ios-pull-refresh.js +53 -72
  704. package/umd/pull-refresh/model.js +0 -1
  705. package/umd/radio/group.js +20 -30
  706. package/umd/radio/index.js +1 -3
  707. package/umd/radio/radio.js +0 -5
  708. package/umd/rate/index.js +28 -48
  709. package/umd/search-bar/association.js +14 -29
  710. package/umd/search-bar/cancel-button.js +8 -14
  711. package/umd/search-bar/highlight.js +14 -21
  712. package/umd/search-bar/index.js +77 -87
  713. package/umd/show-monitor/index.js +40 -104
  714. package/umd/skeleton/elements.js +47 -78
  715. package/umd/skeleton/index.js +18 -28
  716. package/umd/skeleton/skeleton-context.js +0 -3
  717. package/umd/slider/hooks/index.js +0 -4
  718. package/umd/slider/hooks/useSliderEvents.js +27 -55
  719. package/umd/slider/hooks/useSliderIcon.js +6 -17
  720. package/umd/slider/hooks/useSliderInit.js +32 -50
  721. package/umd/slider/hooks/useSliderStyle.js +13 -24
  722. package/umd/slider/index.js +47 -66
  723. package/umd/slider/marks.js +13 -22
  724. package/umd/slider/popover.js +4 -10
  725. package/umd/slider/thumb.js +11 -18
  726. package/umd/stepper/hooks/useButtonClick.js +15 -24
  727. package/umd/stepper/hooks/useInputEvent.js +10 -18
  728. package/umd/stepper/hooks/useValue.js +9 -13
  729. package/umd/stepper/index.js +84 -89
  730. package/umd/steps/index.js +25 -35
  731. package/umd/steps/step.js +10 -22
  732. package/umd/sticky/index.js +40 -68
  733. package/umd/style.js +1 -1
  734. package/umd/swipe-action/index.js +40 -84
  735. package/umd/swipe-action/item.js +9 -14
  736. package/umd/swipe-load/index.js +78 -106
  737. package/umd/switch/index.js +28 -45
  738. package/umd/tab-bar/index.js +0 -2
  739. package/umd/tab-bar/item.js +6 -19
  740. package/umd/tab-bar/tab-bar.js +16 -27
  741. package/umd/tabs/index.js +136 -197
  742. package/umd/tabs/tab-cell-underline.js +28 -71
  743. package/umd/tabs/tab-cell.js +73 -122
  744. package/umd/tabs/tab-pane.js +53 -98
  745. package/umd/tag/index.js +1 -3
  746. package/umd/tag/list.js +11 -20
  747. package/umd/tag/tag.js +20 -26
  748. package/umd/textarea/index.js +35 -51
  749. package/umd/toast/index.js +26 -49
  750. package/umd/toast/methods.js +2 -13
  751. package/umd/transition/index.js +16 -22
  752. package/umd/uploader/index.d.ts +1 -1
  753. package/umd/uploader/index.js +28 -39
  754. package/umd/uploader/upload/upload.js +9 -43
@@ -14,7 +14,6 @@
14
14
  "use strict";
15
15
 
16
16
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
17
-
18
17
  _exports.__esModule = true;
19
18
  var _exportNames = {
20
19
  methodsGenerator: true
@@ -37,63 +36,59 @@
37
36
  });
38
37
  _loading = _interopRequireDefault(_loading);
39
38
  var _excluded = ["style", "className", "images", "loop", "openIndex", "fit", "noselect", "displayDuration", "spaceBetween", "showLoading", "loadingArea", "errorArea", "showError", "retryTime", "staticLabel", "replaceFallbackWhenLoaded", "scrollBezier", "lazyloadCount", "swipeToClose", "extra", "getMinScale", "getMaxScale", "getDoubleClickScale", "getContainer", "getThumbBounds", "renderIndicator", "onChange", "onAfterChange", "onImageClick", "onImageDoubleClick", "onImageLongTap", "close", "onClose", "onTouchStart", "onTouchMove", "onTouchEnd", "indicatorPos"];
40
-
41
39
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
42
-
43
40
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
44
-
45
41
  var MAX_ZOOM = 5;
46
42
  var MIN_ZOOM = 0.7;
47
43
  var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
48
44
  var _imagesStatus$openInd, _imagesStatus$openInd2;
49
-
50
45
  var style = props.style,
51
- className = props.className,
52
- images = props.images,
53
- _props$loop = props.loop,
54
- loop = _props$loop === void 0 ? false : _props$loop,
55
- openIndex = props.openIndex,
56
- fit = props.fit,
57
- _props$noselect = props.noselect,
58
- noselect = _props$noselect === void 0 ? true : _props$noselect,
59
- _props$displayDuratio = props.displayDuration,
60
- displayDuration = _props$displayDuratio === void 0 ? 350 : _props$displayDuratio,
61
- _props$spaceBetween = props.spaceBetween,
62
- spaceBetween = _props$spaceBetween === void 0 ? 0 : _props$spaceBetween,
63
- _props$showLoading = props.showLoading,
64
- showLoading = _props$showLoading === void 0 ? true : _props$showLoading,
65
- loadingArea = props.loadingArea,
66
- errorArea = props.errorArea,
67
- _props$showError = props.showError,
68
- showError = _props$showError === void 0 ? true : _props$showError,
69
- retryTime = props.retryTime,
70
- staticLabel = props.staticLabel,
71
- replaceFallbackWhenLoaded = props.replaceFallbackWhenLoaded,
72
- scrollBezier = props.scrollBezier,
73
- _props$lazyloadCount = props.lazyloadCount,
74
- lazyloadCount = _props$lazyloadCount === void 0 ? 1 : _props$lazyloadCount,
75
- _props$swipeToClose = props.swipeToClose,
76
- swipeToClose = _props$swipeToClose === void 0 ? true : _props$swipeToClose,
77
- extra = props.extra,
78
- getMinScale = props.getMinScale,
79
- getMaxScale = props.getMaxScale,
80
- getDoubleClickScale = props.getDoubleClickScale,
81
- getContainer = props.getContainer,
82
- getThumbBounds = props.getThumbBounds,
83
- renderIndicator = props.renderIndicator,
84
- _onChange = props.onChange,
85
- _onAfterChange = props.onAfterChange,
86
- onImageClick = props.onImageClick,
87
- onImageDoubleClick = props.onImageDoubleClick,
88
- onImageLongTap = props.onImageLongTap,
89
- close = props.close,
90
- onClose = props.onClose,
91
- onTouchStart = props.onTouchStart,
92
- onTouchMove = props.onTouchMove,
93
- onTouchEnd = props.onTouchEnd,
94
- _props$indicatorPos = props.indicatorPos,
95
- indicatorPos = _props$indicatorPos === void 0 ? 'start' : _props$indicatorPos,
96
- otherProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
46
+ className = props.className,
47
+ images = props.images,
48
+ _props$loop = props.loop,
49
+ loop = _props$loop === void 0 ? false : _props$loop,
50
+ openIndex = props.openIndex,
51
+ fit = props.fit,
52
+ _props$noselect = props.noselect,
53
+ noselect = _props$noselect === void 0 ? true : _props$noselect,
54
+ _props$displayDuratio = props.displayDuration,
55
+ displayDuration = _props$displayDuratio === void 0 ? 350 : _props$displayDuratio,
56
+ _props$spaceBetween = props.spaceBetween,
57
+ spaceBetween = _props$spaceBetween === void 0 ? 0 : _props$spaceBetween,
58
+ _props$showLoading = props.showLoading,
59
+ showLoading = _props$showLoading === void 0 ? true : _props$showLoading,
60
+ loadingArea = props.loadingArea,
61
+ errorArea = props.errorArea,
62
+ _props$showError = props.showError,
63
+ showError = _props$showError === void 0 ? true : _props$showError,
64
+ retryTime = props.retryTime,
65
+ staticLabel = props.staticLabel,
66
+ replaceFallbackWhenLoaded = props.replaceFallbackWhenLoaded,
67
+ scrollBezier = props.scrollBezier,
68
+ _props$lazyloadCount = props.lazyloadCount,
69
+ lazyloadCount = _props$lazyloadCount === void 0 ? 1 : _props$lazyloadCount,
70
+ _props$swipeToClose = props.swipeToClose,
71
+ swipeToClose = _props$swipeToClose === void 0 ? true : _props$swipeToClose,
72
+ extra = props.extra,
73
+ getMinScale = props.getMinScale,
74
+ getMaxScale = props.getMaxScale,
75
+ getDoubleClickScale = props.getDoubleClickScale,
76
+ getContainer = props.getContainer,
77
+ getThumbBounds = props.getThumbBounds,
78
+ renderIndicator = props.renderIndicator,
79
+ _onChange = props.onChange,
80
+ _onAfterChange = props.onAfterChange,
81
+ onImageClick = props.onImageClick,
82
+ onImageDoubleClick = props.onImageDoubleClick,
83
+ onImageLongTap = props.onImageLongTap,
84
+ close = props.close,
85
+ onClose = props.onClose,
86
+ onTouchStart = props.onTouchStart,
87
+ onTouchMove = props.onTouchMove,
88
+ onTouchEnd = props.onTouchEnd,
89
+ _props$indicatorPos = props.indicatorPos,
90
+ indicatorPos = _props$indicatorPos === void 0 ? 'start' : _props$indicatorPos,
91
+ otherProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
97
92
  var system = (0, _helpers.useSystem)();
98
93
  var domRef = (0, _react.useRef)(null);
99
94
  var imagesRef = (0, _react.useRef)([]);
@@ -112,28 +107,22 @@
112
107
  var lastScaleRef = (0, _react.useRef)(0);
113
108
  var closingRef = (0, _react.useRef)(false);
114
109
  var isInitialMount = (0, _react.useRef)(false);
115
-
116
110
  var _useState = (0, _react.useState)({}),
117
- showPlaceholders = _useState[0],
118
- setPlaceholders = _useState[1];
119
-
111
+ showPlaceholders = _useState[0],
112
+ setPlaceholders = _useState[1];
120
113
  var _useRefState = (0, _helpers.useRefState)([]),
121
- imagesStatus = _useRefState[0],
122
- imagesStatusRef = _useRefState[1],
123
- setImagesStatus = _useRefState[2];
124
-
114
+ imagesStatus = _useRefState[0],
115
+ imagesStatusRef = _useRefState[1],
116
+ setImagesStatus = _useRefState[2];
125
117
  var _useState2 = (0, _react.useState)(null),
126
- transImageInfo = _useState2[0],
127
- setTransImageInfo = _useState2[1];
128
-
118
+ transImageInfo = _useState2[0],
119
+ setTransImageInfo = _useState2[1];
129
120
  var openLoaded = (_imagesStatus$openInd = imagesStatus[openIndex]) == null ? void 0 : _imagesStatus$openInd.loaded;
130
121
  var openAnimated = (_imagesStatus$openInd2 = imagesStatus[openIndex]) == null ? void 0 : _imagesStatus$openInd2.animated;
131
122
  var visible = openIndex >= 0 && openIndex < images.length;
132
-
133
123
  var _useWindowSize = (0, _helpers.useWindowSize)(true),
134
- windowWidth = _useWindowSize.windowWidth,
135
- windowHeight = _useWindowSize.windowHeight;
136
-
124
+ windowWidth = _useWindowSize.windowWidth,
125
+ windowHeight = _useWindowSize.windowHeight;
137
126
  (0, _react.useImperativeHandle)(ref, function () {
138
127
  return {
139
128
  dom: domRef.current,
@@ -150,7 +139,6 @@
150
139
  carouselRef.current && carouselRef.current.changeIndex(openIndex, true);
151
140
  setImagesStatus(images.map(function (_, index) {
152
141
  var _imagesStatusRef$curr;
153
-
154
142
  return {
155
143
  firstLoaded: ((_imagesStatusRef$curr = imagesStatusRef.current[index]) == null ? void 0 : _imagesStatusRef$curr.firstLoaded) || false,
156
144
  animated: index !== openIndex
@@ -161,18 +149,18 @@
161
149
  // 移除长按事件监听
162
150
  // @en Remove long press event listener
163
151
  longTimerRef.current && clearTimeout(longTimerRef.current);
164
- longTapCheckingRef.current = false; // 图片状态重置
152
+ longTapCheckingRef.current = false;
153
+ // 图片状态重置
165
154
  // @en Reset image state
166
-
167
155
  setImagesStatus(imagesStatusRef.current.map(function (status) {
168
156
  return (0, _extends5.default)({}, status, {
169
157
  animated: false,
170
158
  loaded: false
171
159
  });
172
160
  }));
173
- transformersRef.current = []; // 移除过渡图片
161
+ transformersRef.current = [];
162
+ // 移除过渡图片
174
163
  // @en Remove transition image
175
-
176
164
  removeChild(transImageRef.current);
177
165
  setTransImageInfo(null);
178
166
  setPlaceholders({});
@@ -181,7 +169,6 @@
181
169
  mounted && onClose && onClose();
182
170
  }, displayDuration);
183
171
  }
184
-
185
172
  isInitialMount.current = true;
186
173
  }, [visible]);
187
174
  (0, _react.useEffect)(function () {
@@ -213,38 +200,32 @@
213
200
  transformer && transformer.setMaxScale(getImageMaxScale(index));
214
201
  });
215
202
  }, [getMaxScale]);
216
-
217
203
  function removeChild(child) {
218
204
  try {
219
205
  var _domRef$current, _domRef$current$query, _domRef$current$query2;
220
-
221
206
  child && ((_domRef$current = domRef.current) == null ? void 0 : (_domRef$current$query = _domRef$current.querySelectorAll('.carousel-item')) == null ? void 0 : (_domRef$current$query2 = _domRef$current$query[innerIndexRef.current]) == null ? void 0 : _domRef$current$query2.removeChild(child));
222
207
  } catch (e) {}
223
- } // 监听滑动到上下边缘后还在往外滑动的操作,则关闭弹窗
224
- // @en Monitor the operation of sliding out after sliding to the upper and lower edges, then close the popup
225
-
208
+ }
226
209
 
210
+ // 监听滑动到上下边缘后还在往外滑动的操作,则关闭弹窗
211
+ // @en Monitor the operation of sliding out after sliding to the upper and lower edges, then close the popup
227
212
  function handlePreventCallback(_, dir) {
228
213
  if (!isTransforming() && dir === 'y') {
229
214
  touchingSideDisRef.current += 1;
230
215
  }
231
216
  }
217
+
232
218
  /**
233
219
  * 缩放插件初始化
234
220
  * @en Zoom plugin initialization
235
221
  */
236
-
237
-
238
222
  function initTransformer(index) {
239
223
  var _imagesRef$current$in;
240
-
241
224
  var imageDom = (_imagesRef$current$in = imagesRef.current[index]) == null ? void 0 : _imagesRef$current$in.dom;
242
225
  var wrapDom = imageDom == null ? void 0 : imageDom.parentElement;
243
-
244
226
  if (!imageDom || !wrapDom) {
245
227
  return;
246
228
  }
247
-
248
229
  if (transformersRef.current[index]) {
249
230
  transformersRef.current[index].setDom(wrapDom);
250
231
  } else {
@@ -264,16 +245,15 @@
264
245
  },
265
246
  onTransform: function onTransform() {
266
247
  var _transformersRef$curr, _imagesStatusRef$curr2, _imagesStatusRef$curr3;
267
-
268
248
  // 图片放大再缩小,解决ios图片放大后模糊的问题
269
249
  // @en The image is zoomed in and then zoomed out to solve the problem of blurring after zooming in on ios images
270
250
  var img = imageDomsRef.current[index];
271
251
  var trans = ((_transformersRef$curr = transformersRef.current[index]) == null ? void 0 : _transformersRef$curr.getTransform == null ? void 0 : _transformersRef$curr.getTransform()) || {};
272
252
  var width = (_imagesStatusRef$curr2 = imagesStatusRef.current[index]) == null ? void 0 : _imagesStatusRef$curr2.originWidth;
273
253
  var height = (_imagesStatusRef$curr3 = imagesStatusRef.current[index]) == null ? void 0 : _imagesStatusRef$curr3.originHeight;
274
- var scale = trans.scale || 1; // 判断下只有图片缩放发生改变时重写图片样式
254
+ var scale = trans.scale || 1;
255
+ // 判断下只有图片缩放发生改变时重写图片样式
275
256
  // @en It is judged that only the image style is rewritten when the zoom of the image changes.
276
-
277
257
  if (img && width && height && lastScaleRef.current !== scale) {
278
258
  lastScaleRef.current = scale;
279
259
  var atCenter = !imageHasOverflow(img) ? ' translateY(-50%)' : '';
@@ -292,23 +272,18 @@
292
272
  onZoomEnd: function onZoomEnd(_1, _2, pinchStartCenter) {
293
273
  setPlaceholders(function (holders) {
294
274
  var _extends2;
295
-
296
275
  return (0, _extends5.default)({}, holders, (_extends2 = {}, _extends2[index] = false, _extends2));
297
276
  });
298
277
  var image = imageDomsRef.current[index];
299
278
  var transformer = transformersRef.current[index];
300
-
301
279
  if (!image || !transformer || transformer.getTransform().scale < 1) {
302
280
  return;
303
281
  }
304
-
305
282
  var imageRect = image.getBoundingClientRect();
306
-
307
283
  if (imageRect.width > windowWidth && imageRect.height > windowHeight) {
308
284
  if (pinchStartCenter && pinchStartCenter.length) {
309
285
  transformer.setCenter.apply(transformer, pinchStartCenter);
310
286
  }
311
-
312
287
  transformer.setFixedX(false);
313
288
  transformer.setFixedY(false);
314
289
  } else if (imageRect.height <= windowHeight) {
@@ -327,165 +302,134 @@
327
302
  maxScale: getImageMaxScale(index)
328
303
  });
329
304
  }
330
-
331
305
  setOriginBoundary(index);
332
306
  }
333
-
334
307
  function imageHasOverflow(img) {
335
308
  return Boolean(img && !img.classList.contains('preview-fit-contain-y'));
336
309
  }
337
-
338
310
  function setOriginBoundary(index) {
339
311
  var imageEle = imagesRef.current[index];
340
- var imageDom = imageEle == null ? void 0 : imageEle.dom; // 边界范围变为图片范围和容器范围的并集
312
+ var imageDom = imageEle == null ? void 0 : imageEle.dom;
313
+ // 边界范围变为图片范围和容器范围的并集
341
314
  // @en The bounding range becomes the union of the image range and the container range
342
-
343
315
  if (imageDom != null && imageDom.parentElement && imageEle != null && imageEle.image) {
344
- var _rect = imageEle.image.getBoundingClientRect();
345
-
316
+ var rect = imageEle.image.getBoundingClientRect();
346
317
  var eleRect = imageDom.parentElement.getBoundingClientRect();
347
-
348
318
  if (transformersRef.current[index]) {
349
319
  transformersRef.current[index].setBoundary({
350
- left: Math.min(_rect.left, eleRect.left),
351
- right: Math.max(_rect.right, eleRect.right),
352
- top: Math.min(_rect.top, eleRect.top),
353
- bottom: Math.max(_rect.bottom, eleRect.bottom)
320
+ left: Math.min(rect.left, eleRect.left),
321
+ right: Math.max(rect.right, eleRect.right),
322
+ top: Math.min(rect.top, eleRect.top),
323
+ bottom: Math.max(rect.bottom, eleRect.bottom)
354
324
  }, true);
355
325
  }
356
326
  }
357
327
  }
328
+
358
329
  /**
359
330
  * 获取最小缩放倍数
360
331
  * @en Get the minimum zoom factor
361
332
  */
362
-
363
-
364
333
  function getImageMinScale(index) {
365
334
  var currentIndex = index === void 0 ? innerIndexRef.current : index;
366
335
  var imageDom = imageDomsRef.current[currentIndex];
367
-
368
336
  if (!imageDom) {
369
337
  return 1;
370
338
  }
371
-
372
339
  if (getMinScale) {
373
340
  return getMinScale(imageDom, currentIndex);
374
341
  }
375
-
376
342
  return MIN_ZOOM;
377
343
  }
344
+
378
345
  /**
379
346
  * 获取最大缩放倍数
380
347
  * @en Get the maximum zoom factor
381
348
  */
382
-
383
-
384
349
  function getImageMaxScale(index) {
385
350
  var currentIndex = index === void 0 ? innerIndexRef.current : index;
386
351
  var imageDom = imageDomsRef.current[currentIndex];
387
-
388
352
  if (!imageDom) {
389
353
  return 1;
390
354
  }
391
-
392
355
  if (getMaxScale) {
393
356
  return getMaxScale(imageDom, currentIndex);
394
357
  }
395
-
396
358
  var imageWidth = imageDom.naturalWidth;
397
359
  var imageHeight = imageDom.naturalHeight;
398
360
  var maxScale = 1;
399
-
400
361
  if (imageWidth > imageHeight) {
401
362
  maxScale = imageWidth / windowWidth * MAX_ZOOM;
402
363
  } else {
403
364
  maxScale = Math.max(MAX_ZOOM, imageWidth / windowWidth);
404
365
  }
405
-
406
366
  return maxScale;
407
367
  }
368
+
408
369
  /**
409
370
  * 计算双击时图片缩放倍数
410
371
  * @en Calculate the zoom factor of the image when double-clicking
411
372
  */
412
-
413
-
414
373
  function getImageDoubleClickScale(currentScale) {
415
374
  var index = innerIndexRef.current;
416
375
  var imageDom = imageDomsRef.current[index];
417
-
418
376
  if (!imageDom) {
419
377
  return 1;
420
378
  }
421
-
422
379
  var maxScale = getImageMaxScale(index);
423
-
424
380
  if (getDoubleClickScale) {
425
381
  return getDoubleClickScale(currentScale, maxScale, imageDom, index);
426
382
  }
427
-
428
383
  var imageWidth = imageDom.naturalWidth;
429
384
  var imageHeight = imageDom.naturalHeight;
430
385
  var fitScale = imageWidth > imageHeight ? imageWidth / windowWidth * windowHeight / imageHeight : 1;
431
386
  var dblScale = 2;
432
-
433
387
  if (fitScale >= 2) {
434
388
  dblScale = Math.min(maxScale, fitScale);
435
389
  }
436
-
437
390
  var current = Number(currentScale.toFixed(3));
438
391
  var dbl = Number(dblScale.toFixed(3));
439
392
  return current >= 1 && current < dbl ? dbl : 1;
440
393
  }
394
+
441
395
  /**
442
396
  * 还原缩放至原始位置
443
397
  * @en Revert zoom to original position
444
398
  */
445
-
446
-
447
399
  function restoreTransformer(index) {
448
400
  var transformer = transformersRef.current[index];
449
-
450
401
  if (transformer) {
451
402
  transformer.restore();
452
403
  }
453
404
  }
405
+
454
406
  /**
455
407
  * 是否正处于缩放状态
456
408
  * @en Whether it is zooming
457
409
  */
458
-
459
-
460
410
  function isTransforming(index) {
461
411
  var _transformersRef$curr2;
462
-
463
412
  var currentIndex = index === void 0 ? innerIndexRef.current : index;
464
413
  return (_transformersRef$curr2 = transformersRef.current[currentIndex]) == null ? void 0 : _transformersRef$curr2.busy == null ? void 0 : _transformersRef$curr2.busy();
465
414
  }
415
+
466
416
  /**
467
417
  * 是否已经放大过
468
418
  * @en Whether is has been zoomed in
469
419
  */
470
-
471
-
472
420
  function isTransformed() {
473
421
  var _transformersRef$curr3;
474
-
475
422
  return (_transformersRef$curr3 = transformersRef.current[innerIndexRef.current]) == null ? void 0 : _transformersRef$curr3.dirty == null ? void 0 : _transformersRef$curr3.dirty();
476
423
  }
477
-
478
424
  function isTapStop() {
479
425
  var _transformersRef$curr4;
480
-
481
426
  return (_transformersRef$curr4 = transformersRef.current[innerIndexRef.current]) == null ? void 0 : _transformersRef$curr4.isTapStop == null ? void 0 : _transformersRef$curr4.isTapStop();
482
427
  }
428
+
483
429
  /**
484
430
  * 计算距离左右侧的距离,如果为0说明到边缘了,可以进行正常轮播操作
485
431
  * @en Calculate the distance from the left and right sides. If it is 0, it means that the edge is reached, and the normal rotation operation can be performed.
486
432
  */
487
-
488
-
489
433
  function transformTouchSide() {
490
434
  var transformer = transformersRef.current[innerIndexRef.current];
491
435
  var toLeft = transformer == null ? void 0 : transformer.toLeft == null ? void 0 : transformer.toLeft();
@@ -496,23 +440,20 @@
496
440
  right: !toRight
497
441
  };
498
442
  }
499
-
500
443
  function handleImageWrapTouchStart(e) {
501
444
  if (onTouchStart && onTouchStart(e, innerIndexRef.current)) {
502
445
  return true;
503
446
  }
504
-
505
447
  var touches = e.touches;
506
448
  touchStartXRef.current = e.touches && e.touches[0] ? e.touches[0].clientX : 0;
507
449
  movedRef.current = false;
508
- dblClickingRef.current = false; // 单点长按才触发长按
450
+ dblClickingRef.current = false;
451
+ // 单点长按才触发长按
509
452
  // @en A single long press triggers a long press
510
-
511
453
  if (touches.length === 1) {
512
454
  if (!closingRef.current) {
513
455
  longTapCheckingRef.current = true;
514
456
  }
515
-
516
457
  longTimerRef.current = window.setTimeout(function () {
517
458
  if (longTapCheckingRef.current) {
518
459
  longTapCheckingRef.current = false;
@@ -523,101 +464,86 @@
523
464
  } else {
524
465
  longTapCheckingRef.current = false;
525
466
  }
526
-
527
467
  if (isTapStop()) {
528
468
  movedRef.current = true;
529
- } // 缩放状态下,未到边缘时不触发轮播手势
469
+ }
470
+ // 缩放状态下,未到边缘时不触发轮播手势
530
471
  // @en In the zoomed state, the carousel gesture is not triggered when the edge is not reached
531
-
532
-
533
472
  if (isTransforming()) {
534
473
  startTouchingSideRef.current = transformTouchSide().side;
535
474
  return !startTouchingSideRef.current;
536
475
  }
537
476
  }
538
-
539
477
  function handleImageWrapTouchMove(e) {
540
478
  movedRef.current = true;
541
479
  longTapCheckingRef.current = false;
542
480
  longTimerRef.current && clearTimeout(longTimerRef.current);
543
-
544
481
  if (onTouchMove && onTouchMove(e, innerIndexRef.current)) {
545
482
  return true;
546
483
  }
547
-
548
484
  var evt = e.changedTouches[0];
549
485
  var touchMoveX = evt.clientX || 0;
550
- var posDisX = touchMoveX - touchStartXRef.current; // 缩放状态下,到边缘时如果还在往外滑动,则触发轮播手势
486
+ var posDisX = touchMoveX - touchStartXRef.current;
487
+ // 缩放状态下,到边缘时如果还在往外滑动,则触发轮播手势
551
488
  // @en In the zoomed state, if it is still swiped out when reaching the edge, the carousel gesture is triggered
552
-
553
489
  if (isTransforming()) {
554
490
  var sideInfo = transformTouchSide();
555
491
  return !startTouchingSideRef.current || !(sideInfo.left && posDisX > 0 || sideInfo.right && posDisX < 0);
556
492
  }
557
493
  }
558
-
559
494
  function handleImageWrapTouchEnd(e) {
560
495
  if (onTouchEnd && onTouchEnd(e, innerIndexRef.current)) {
561
496
  return true;
562
- } // 滑动到上下边缘后还在往外滑动,则关闭弹窗
497
+ }
498
+ // 滑动到上下边缘后还在往外滑动,则关闭弹窗
563
499
  // @en After sliding to the upper and lower edges and still sliding outwards, close the popup box
564
500
  // needClose为触发touchmove的次数,6和3是相对值,表示判断在往外滑动的敏感度,当未放大时对向外滑动手势更敏感
565
501
  // @en needClose is the number of times the touchmove is triggered, 6 and 3 are relative values, indicating the sensitivity of judging the outward sliding, and it is more sensitive to the outward sliding gesture when it is not zoomed in
566
-
567
-
568
502
  var needClose = swipeToClose && touchingSideDisRef.current >= (isTransformed() ? 6 : 3);
569
503
  touchingSideDisRef.current = 0;
570
504
  longTapCheckingRef.current = false;
571
505
  longTimerRef.current && clearTimeout(longTimerRef.current);
572
-
573
506
  if (needClose) {
574
507
  goClose(e);
575
508
  return true;
576
- } // 缩放状态下,未到边缘时不触发轮播手势
509
+ }
510
+ // 缩放状态下,未到边缘时不触发轮播手势
577
511
  // @en In the zoomed state, the carousel gesture is not triggered when the edge is not reached
578
-
579
-
580
512
  if (isTransforming() && !transformTouchSide().side) {
581
513
  return true;
582
514
  }
583
515
  }
584
-
585
516
  function handleImageClick(e) {
586
517
  if (movedRef.current) {
587
518
  return;
588
- } // 如果正在触发doubleClick就不触发click
519
+ }
520
+ // 如果正在触发doubleClick就不触发click
589
521
  // @en If doubleClick is being triggered, click will not be triggered
590
-
591
-
592
522
  if (!dblClickingRef.current) {
593
523
  if (!onImageClick || !onImageClick(innerIndexRef.current, e)) {
594
524
  goClose(e);
595
525
  }
596
526
  }
597
527
  }
598
-
599
528
  function handleImageDoubleClick(e) {
600
529
  if (dblClickingRef.current) {
601
530
  // 防止重复触发dblclick
602
531
  return;
603
532
  }
604
-
605
533
  dblClickingRef.current = true;
606
534
  var index = innerIndexRef.current;
607
- onImageDoubleClick && onImageDoubleClick(index, e); // 双击时根据配置放大或缩小
535
+ onImageDoubleClick && onImageDoubleClick(index, e);
536
+ // 双击时根据配置放大或缩小
608
537
  // @en Zoom in or out according to configuration when double-clicking
609
-
610
538
  var transformer = transformersRef.current[index];
611
-
612
539
  if (transformer) {
613
540
  var trans = transformer.getTransform();
614
541
  var rate = trans.scale || 1;
615
542
  var dblScale = getImageDoubleClickScale(rate);
616
-
617
543
  if (dblScale === 1) {
618
- var img = imageDomsRef.current[index]; // 长图双击还原缩放特殊处理,因为transform和scroll不能完全同步,所以先zoomTo到原点再restore
544
+ var img = imageDomsRef.current[index];
545
+ // 长图双击还原缩放特殊处理,因为transform和scroll不能完全同步,所以先zoomTo到原点再restore
619
546
  // @en Double-click the long image to restore zoom special processing, because transform and scroll cannot be completely synchronized, so first zoomTo to the origin and then restore
620
-
621
547
  if (imageHasOverflow(img)) {
622
548
  transformer.zoomToScreenCenter(1, [windowWidth / 2, windowHeight / 2], {
623
549
  duration: 200,
@@ -637,37 +563,30 @@
637
563
  }
638
564
  }
639
565
  }
566
+ var handleClick = (0, _helpers.useSingleAndDoubleClick)(handleImageClick, handleImageDoubleClick);
640
567
 
641
- var handleClick = (0, _helpers.useSingleAndDoubleClick)(handleImageClick, handleImageDoubleClick); // 当使用 getThumbBounds 时,关闭图片预览有缩小效果
568
+ // 当使用 getThumbBounds 时,关闭图片预览有缩小效果
642
569
  // @en When using getThumbBounds, closing the image preview has a shrinking effect
643
-
644
570
  function animateBeforeClose() {
645
571
  var _imagesRef$current$in2;
646
-
647
572
  if (isTransformed()) {
648
573
  return;
649
574
  }
650
-
651
575
  var index = innerIndexRef.current;
652
576
  var imageDom = (_imagesRef$current$in2 = imagesRef.current[index]) == null ? void 0 : _imagesRef$current$in2.image;
653
577
  var thumbBounds = getThumbBounds == null ? void 0 : getThumbBounds(index);
654
-
655
578
  if (!imageDom || !thumbBounds || !thumbBounds.width || !thumbBounds.height) {
656
579
  return;
657
- } // 小图超过一半在视野外时,不展示缩小效果
580
+ }
581
+ // 小图超过一半在视野外时,不展示缩小效果
658
582
  // @en When more than half of the thumbnail is outside the field of view, the zoom effect will not be displayed
659
-
660
-
661
583
  if (thumbBounds.top < -1 * thumbBounds.height / 2 || thumbBounds.top > windowHeight - thumbBounds.height / 2 || thumbBounds.left < -1 * thumbBounds.width / 2 || thumbBounds.left > windowWidth - thumbBounds.width / 2) {
662
584
  return;
663
585
  }
664
-
665
586
  var imageDomRect = imageDom.getBoundingClientRect();
666
-
667
587
  if (!imageDomRect.width || !imageDomRect.height) {
668
588
  return;
669
589
  }
670
-
671
590
  imageDom.classList.add('closing-animation');
672
591
  setImageBounds(imageDom, imageDomRect, imageDomRect);
673
592
  imageDom.style.objectPosition = images[index].thumbPosition || 'top center';
@@ -677,22 +596,19 @@
677
596
  setImageBounds(imageDom, thumbBounds, imageDomRect);
678
597
  });
679
598
  }
680
-
681
599
  function goClose(e) {
682
600
  if (closingRef.current) {
683
601
  return;
684
602
  }
685
-
686
603
  closingRef.current = true;
687
604
  animateBeforeClose();
688
605
  close(e);
689
606
  }
607
+
690
608
  /**
691
609
  * 更改指定图片状态
692
610
  * @en Change specified image status
693
611
  */
694
-
695
-
696
612
  function setImagesStatusByIndex(index, data) {
697
613
  setImagesStatus(function (current) {
698
614
  var newStatus = current.slice();
@@ -700,35 +616,30 @@
700
616
  return newStatus;
701
617
  });
702
618
  }
619
+
703
620
  /**
704
621
  * 缩略图放大过渡动画设置
705
622
  * @en Set thumbnail zoom transition animation
706
623
  */
707
-
708
-
709
624
  function setDisplayAnimation(index) {
710
625
  var _imagesStatusRef$curr4, _domRef$current2, _domRef$current2$quer, _domRef$current2$quer2;
711
-
712
626
  var firstLoaded = (_imagesStatusRef$curr4 = imagesStatusRef.current[index]) == null ? void 0 : _imagesStatusRef$curr4.firstLoaded;
713
- var fallbackSrc = replaceFallbackWhenLoaded && firstLoaded ? images[index].src : images[index].fallbackSrc; // 用户设置了getThumbBounds和images的fallbackSrc属性才有放大过渡效果
627
+ var fallbackSrc = replaceFallbackWhenLoaded && firstLoaded ? images[index].src : images[index].fallbackSrc;
628
+ // 用户设置了getThumbBounds和images的fallbackSrc属性才有放大过渡效果
714
629
  // @en Set the fallbackSrc attribute of getThumbBounds and images to have a zoom-in transition effect
715
-
716
630
  if (!getThumbBounds || !images[index] || !fallbackSrc) {
717
631
  resetAnimation(index);
718
632
  return;
719
- } // 获取缩略图的rect,如果没获取到就取消放大过渡效果
633
+ }
634
+ // 获取缩略图的rect,如果没获取到就取消放大过渡效果
720
635
  // @en Get the rect of the thumbnail, if it is gotten, cancel the zoom transition effect
721
-
722
-
723
636
  var thumbBounds = getThumbBounds(index);
724
-
725
637
  if (!thumbBounds || !thumbBounds.width || !thumbBounds.height) {
726
638
  resetAnimation(index);
727
639
  return;
728
- } // 伪造一个fixed的图做小图放大效果
640
+ }
641
+ // 伪造一个fixed的图做小图放大效果
729
642
  // @en Forge a fixed image to make a small image enlargement effect
730
-
731
-
732
643
  var transImage = new Image();
733
644
  transImageRef.current = transImage;
734
645
  transImage.classList.add('image-preview-fake-trans-image');
@@ -738,25 +649,23 @@
738
649
  transImage.style.opacity = '0';
739
650
  transImage.style.transitionDuration = displayDuration + "ms";
740
651
  transImage.style.webkitTransitionDuration = displayDuration + "ms";
741
- (_domRef$current2 = domRef.current) == null ? void 0 : (_domRef$current2$quer = _domRef$current2.querySelectorAll('.carousel-item')) == null ? void 0 : (_domRef$current2$quer2 = _domRef$current2$quer[index]) == null ? void 0 : _domRef$current2$quer2.prepend(transImage); // 拿到放大之后的位置rect,没拿到就取消小图放大效果
652
+ (_domRef$current2 = domRef.current) == null ? void 0 : (_domRef$current2$quer = _domRef$current2.querySelectorAll('.carousel-item')) == null ? void 0 : (_domRef$current2$quer2 = _domRef$current2$quer[index]) == null ? void 0 : _domRef$current2$quer2.prepend(transImage);
653
+ // 拿到放大之后的位置rect,没拿到就取消小图放大效果
742
654
  // @en Get the zoomed-in position rect, and cancel the zoom-in effect if not getting it
743
-
744
655
  getNewImageBounds(index, fallbackSrc, transImage, function (rect) {
745
656
  if (!rect || !rect.width || !rect.height) {
746
657
  removeChild(transImage);
747
658
  resetAnimation(index);
748
659
  return;
749
- } // 通过小图rect变换到大图rect加transition做放大效果
660
+ }
661
+ // 通过小图rect变换到大图rect加transition做放大效果
750
662
  // @en Transform the small image rect to the large image rect and add transition to make a magnification effect
751
-
752
-
753
663
  (0, _mobileUtils.nextTick)(function () {
754
664
  transImage.style.opacity = '1';
755
665
  setImageBounds(transImage, rect, thumbBounds);
756
666
  setTimeout(function () {
757
667
  setPlaceholders(function (holders) {
758
668
  var _extends3;
759
-
760
669
  return (0, _extends5.default)({}, holders, (_extends3 = {}, _extends3[index] = true, _extends3));
761
670
  });
762
671
  }, Math.max(0, displayDuration - 80));
@@ -767,24 +676,22 @@
767
676
  });
768
677
  });
769
678
  }
679
+
770
680
  /**
771
681
  * 取消小图放大过渡效果
772
682
  * @en Cancel the thumbnail zoom transition effect
773
683
  */
774
-
775
-
776
684
  function resetAnimation(index) {
777
685
  setImagesStatusByIndex(index, {
778
686
  animated: true
779
687
  });
780
688
  setTransImageInfo(null);
781
689
  }
690
+
782
691
  /**
783
692
  * 根据rect设置图片的位置
784
693
  * @en Set the position of the image according to the rect
785
694
  */
786
-
787
-
788
695
  function setImageBounds(image, rect, thumbRect) {
789
696
  // 这里为保持原有比例,只设置宽度变化,高度会随宽度等比变化
790
697
  image.style.width = thumbRect.width + "px";
@@ -794,18 +701,16 @@
794
701
  image.style.transformOrigin = 'left top';
795
702
  image.style.webkitTransformOrigin = 'left top';
796
703
  }
704
+
797
705
  /**
798
706
  * 计算放大之后的位置rect
799
707
  * @en Calculate the position rect after zooming in
800
708
  */
801
-
802
-
803
709
  function getNewImageBounds(index, transSrc, transImage, callback) {
804
710
  if (!transSrc) {
805
711
  callback(null);
806
712
  return;
807
713
  }
808
-
809
714
  setTransImageInfo({
810
715
  src: transSrc,
811
716
  fit: images[index].fit,
@@ -821,12 +726,11 @@
821
726
  }
822
727
  });
823
728
  }
729
+
824
730
  /**
825
731
  * @en 渲染轮播+图片展示
826
732
  * Rendering carousel + displaying image
827
733
  */
828
-
829
-
830
734
  function renderContent(carouselProps, allImages, getImageProps) {
831
735
  return /*#__PURE__*/_react.default.createElement(_carousel.default, (0, _extends5.default)({
832
736
  autoPlay: false,
@@ -847,29 +751,25 @@
847
751
  boxHeight: windowHeight,
848
752
  bottomOverlap: null
849
753
  }, getImageProps(image, index))));
850
-
851
754
  return /*#__PURE__*/_react.default.createElement("div", {
852
755
  className: "preview-image-wrap-container",
853
756
  key: "outer-" + index
854
757
  }, innerNode, image.extraNode);
855
758
  }));
856
759
  }
857
-
858
760
  function getImageClass(index) {
859
761
  var _ref = imagesStatus[index] || {},
860
- loaded = _ref.loaded,
861
- animated = _ref.animated;
862
-
762
+ loaded = _ref.loaded,
763
+ animated = _ref.animated;
863
764
  return (0, _mobileUtils.cls)('preview-image', {
864
765
  'preview-hidden': index === openIndex && (!loaded || !animated)
865
766
  });
866
767
  }
768
+
867
769
  /**
868
770
  * 每张图片的样式
869
771
  * @en style of each image
870
772
  */
871
-
872
-
873
773
  function getImageStyle() {
874
774
  // 因为缩放的容器必须是没有transform和transition的纯净元素
875
775
  // @en Because the scaled container must be a pure element without transform and transition
@@ -878,33 +778,31 @@
878
778
  return {
879
779
  overflow: 'visible'
880
780
  };
881
- } // 渲染轮播指引器
882
-
781
+ }
883
782
 
783
+ // 渲染轮播指引器
884
784
  function renderPreviewIndicator(currentIndex, total, lastIndex) {
885
785
  if (renderIndicator) {
886
786
  return renderIndicator(currentIndex, total, lastIndex);
887
787
  }
888
-
889
788
  return openLoaded ? /*#__PURE__*/_react.default.createElement(_portal.default, {
890
789
  getContainer: getContainer
891
790
  }, /*#__PURE__*/_react.default.createElement("div", {
892
791
  className: "image-preview-indicator"
893
792
  }, currentIndex + 1, "/", total)) : null;
894
- } // ios在重设style时图片会消失一下造成闪动,因此在底下垫一张图
793
+ }
794
+
795
+ // ios在重设style时图片会消失一下造成闪动,因此在底下垫一张图
895
796
  // @en In iOS when resetting the style, the image will disappear and cause flickering, so put a image at the bottom
896
797
  // 优先过渡图,其次用原图
897
798
  // @en Prioritize the transition image, followed by the original image
898
-
899
-
900
799
  function renderImagePlaceholder(src, index, fitCss) {
901
800
  var _ref2 = imagesStatus[index] || {},
902
- originWidth = _ref2.originWidth,
903
- originHeight = _ref2.originHeight,
904
- originLeft = _ref2.originLeft,
905
- originTop = _ref2.originTop,
906
- hasOverflow = _ref2.hasOverflow;
907
-
801
+ originWidth = _ref2.originWidth,
802
+ originHeight = _ref2.originHeight,
803
+ originLeft = _ref2.originLeft,
804
+ originTop = _ref2.originTop,
805
+ hasOverflow = _ref2.hasOverflow;
908
806
  var trans = hasOverflow ? {} : (0, _helpers.getStyleWithVendor)({
909
807
  transform: 'translateY(-50%)'
910
808
  });
@@ -922,7 +820,6 @@
922
820
  }, fitObj, trans)
923
821
  }) : null;
924
822
  }
925
-
926
823
  function renderLoadingArea() {
927
824
  return /*#__PURE__*/_react.default.createElement("div", {
928
825
  className: "image-preview-loading-area"
@@ -932,7 +829,6 @@
932
829
  radius: 7
933
830
  }));
934
831
  }
935
-
936
832
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref3) {
937
833
  var prefixCls = _ref3.prefixCls;
938
834
  return /*#__PURE__*/_react.default.createElement(_portal.default, {
@@ -998,20 +894,17 @@
998
894
  originLeft: imageEle.offsetLeft,
999
895
  hasOverflow: imageHasOverflow(imageEle)
1000
896
  });
1001
-
1002
897
  if (index === openIndex) {
1003
898
  initTransformer(index);
1004
899
  } else {
1005
900
  setPlaceholders(function (holders) {
1006
901
  var _extends4;
1007
-
1008
902
  return (0, _extends5.default)({}, holders, (_extends4 = {}, _extends4[index] = true, _extends4));
1009
903
  });
1010
904
  }
1011
905
  },
1012
906
  onError: function onError() {
1013
907
  imageDomsRef.current[index] = null;
1014
-
1015
908
  if (index === openIndex) {
1016
909
  var transImage = transImageInfo == null ? void 0 : transImageInfo.movingImage;
1017
910
  removeChild(transImage);
@@ -1044,7 +937,6 @@
1044
937
  }) : null);
1045
938
  });
1046
939
  });
1047
-
1048
940
  function methodsGenerator(Comp) {
1049
941
  return {
1050
942
  /**
@@ -1056,8 +948,8 @@
1056
948
  open: (0, _methods.open)(Comp)
1057
949
  };
1058
950
  }
1059
-
1060
951
  var ImagePreviewWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(ImagePreview);
952
+
1061
953
  /**
1062
954
  * 图片预览组件,支持循环轮播、双指/双击缩放、缩略图放大效果。
1063
955
  * @en The image preview, supports circular rotation, two-finger/double-tap zoom, and thumbnail zoom effects.
@@ -1066,8 +958,6 @@
1066
958
  * @name 图片预览
1067
959
  * @name_en ImagePreview
1068
960
  */
1069
-
1070
961
  var _default = (0, _mobileUtils.componentWrapper)(ImagePreview, methodsGenerator(ImagePreviewWithGlobalContext));
1071
-
1072
962
  _exports.default = _default;
1073
963
  });