@arco-design/mobile-react 2.19.1 → 2.21.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 (424) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.en-US.md +6 -6
  3. package/README.md +6 -6
  4. package/cjs/_helpers/type.d.ts +1 -1
  5. package/cjs/avatar/group.js +1 -1
  6. package/cjs/avatar/index.d.ts +1 -1
  7. package/cjs/avatar/index.js +11 -14
  8. package/cjs/avatar/style/css/index.css +96 -126
  9. package/cjs/avatar/style/index.less +54 -72
  10. package/cjs/badge/index.d.ts +1 -1
  11. package/cjs/badge/index.js +7 -9
  12. package/cjs/badge/style/css/index.css +5 -5
  13. package/cjs/badge/style/index.less +5 -5
  14. package/cjs/button/hooks.d.ts +1 -2
  15. package/cjs/button/hooks.js +5 -3
  16. package/cjs/button/index.d.ts +6 -0
  17. package/cjs/button/index.js +38 -33
  18. package/cjs/button/style/css/index.css +75 -310
  19. package/cjs/button/style/index.less +32 -38
  20. package/cjs/carousel/index.d.ts +1 -1
  21. package/cjs/carousel/index.js +1 -1
  22. package/cjs/cell/index.d.ts +1 -1
  23. package/cjs/cell/index.js +1 -1
  24. package/cjs/checkbox/index.d.ts +1 -1
  25. package/cjs/checkbox/index.js +1 -1
  26. package/cjs/collapse/index.d.ts +1 -1
  27. package/cjs/collapse/index.js +1 -1
  28. package/cjs/count-down/demo/style/mobile.less +1 -1
  29. package/cjs/count-down/index.d.ts +1 -1
  30. package/cjs/count-down/index.js +1 -1
  31. package/cjs/date-picker/index.d.ts +1 -1
  32. package/cjs/date-picker/index.js +1 -1
  33. package/cjs/dropdown/dropdown.d.ts +3 -0
  34. package/cjs/dropdown/dropdown.js +322 -0
  35. package/cjs/dropdown/index.d.ts +3 -4
  36. package/cjs/dropdown/index.js +3 -303
  37. package/cjs/dropdown/options.js +2 -1
  38. package/cjs/dropdown/style/css/index.css +3 -0
  39. package/cjs/dropdown/style/index.less +2 -0
  40. package/cjs/dropdown/type.d.ts +20 -9
  41. package/cjs/dropdown-menu/dropdown-menu.d.ts +4 -0
  42. package/cjs/dropdown-menu/dropdown-menu.js +273 -0
  43. package/cjs/dropdown-menu/helper.d.ts +1 -1
  44. package/cjs/dropdown-menu/index.d.ts +2 -3
  45. package/cjs/dropdown-menu/index.js +2 -245
  46. package/cjs/dropdown-menu/type.d.ts +21 -20
  47. package/cjs/ellipsis/index.d.ts +1 -1
  48. package/cjs/ellipsis/index.js +1 -1
  49. package/cjs/grid/index.js +13 -12
  50. package/cjs/image/index.d.ts +1 -2
  51. package/cjs/image/index.js +14 -9
  52. package/cjs/image/style/css/index.css +2 -1
  53. package/cjs/image/style/index.less +2 -1
  54. package/cjs/image-picker/add-icon.d.ts +2 -0
  55. package/cjs/image-picker/add-icon.js +22 -0
  56. package/cjs/image-picker/demo/style/css/mobile.css +40 -0
  57. package/cjs/image-picker/demo/style/mobile.less +42 -0
  58. package/cjs/image-picker/index.d.ts +13 -0
  59. package/cjs/image-picker/index.js +331 -0
  60. package/cjs/image-picker/style/css/index.css +147 -0
  61. package/cjs/image-picker/style/css/index.d.ts +2 -0
  62. package/cjs/image-picker/style/css/index.js +5 -0
  63. package/cjs/image-picker/style/index.d.ts +2 -0
  64. package/cjs/image-picker/style/index.js +5 -0
  65. package/cjs/image-picker/style/index.less +116 -0
  66. package/cjs/image-picker/type.d.ts +174 -0
  67. package/cjs/image-picker/type.js +3 -0
  68. package/cjs/image-preview/index.d.ts +3 -3
  69. package/cjs/image-preview/index.js +1 -1
  70. package/cjs/index.d.ts +3 -0
  71. package/cjs/index.js +13 -1
  72. package/cjs/input/hooks.js +49 -8
  73. package/cjs/input/index.d.ts +1 -1
  74. package/cjs/input/index.js +1 -1
  75. package/cjs/input/props.d.ts +8 -2
  76. package/cjs/nav-bar/index.js +7 -2
  77. package/cjs/notice-bar/index.d.ts +1 -1
  78. package/cjs/notice-bar/index.js +1 -1
  79. package/cjs/picker/index.d.ts +1 -1
  80. package/cjs/picker/index.js +1 -1
  81. package/cjs/picker-view/index.d.ts +1 -1
  82. package/cjs/picker-view/index.js +1 -1
  83. package/cjs/popover/index.d.ts +1 -1
  84. package/cjs/popover/index.js +1 -1
  85. package/cjs/popup-swiper/index.js +3 -2
  86. package/cjs/radio/index.d.ts +1 -1
  87. package/cjs/radio/index.js +1 -1
  88. package/cjs/rate/index.d.ts +1 -1
  89. package/cjs/rate/index.js +1 -1
  90. package/cjs/search-bar/association.d.ts +3 -0
  91. package/cjs/search-bar/association.js +92 -0
  92. package/cjs/search-bar/cancel-button.d.ts +10 -0
  93. package/cjs/search-bar/cancel-button.js +41 -0
  94. package/cjs/search-bar/demo/style/css/mobile.css +5 -0
  95. package/cjs/search-bar/demo/style/mobile.less +9 -0
  96. package/cjs/search-bar/highlight.d.ts +12 -0
  97. package/cjs/search-bar/highlight.js +77 -0
  98. package/cjs/search-bar/index.d.ts +13 -0
  99. package/cjs/search-bar/index.js +239 -0
  100. package/cjs/search-bar/style/css/index.css +148 -0
  101. package/cjs/search-bar/style/css/index.d.ts +2 -0
  102. package/cjs/search-bar/style/css/index.js +5 -0
  103. package/cjs/search-bar/style/index.d.ts +2 -0
  104. package/cjs/search-bar/style/index.js +5 -0
  105. package/cjs/search-bar/style/index.less +111 -0
  106. package/cjs/search-bar/type.d.ts +163 -0
  107. package/cjs/search-bar/type.js +3 -0
  108. package/cjs/show-monitor/index.js +31 -3
  109. package/cjs/slider/index.d.ts +1 -1
  110. package/cjs/slider/index.js +1 -1
  111. package/cjs/steps/demo/style/css/mobile.css +1 -1
  112. package/cjs/steps/demo/style/mobile.less +1 -1
  113. package/cjs/steps/index.d.ts +1 -1
  114. package/cjs/steps/index.js +1 -1
  115. package/cjs/steps/style/css/index.css +5 -15
  116. package/cjs/steps/style/index.less +6 -10
  117. package/cjs/sticky/index.d.ts +1 -1
  118. package/cjs/style.d.ts +3 -0
  119. package/cjs/style.js +6 -0
  120. package/cjs/swipe-action/demo/style/css/mobile.css +5 -0
  121. package/cjs/swipe-action/demo/style/mobile.less +9 -0
  122. package/cjs/swipe-action/index.d.ts +12 -0
  123. package/cjs/swipe-action/index.js +339 -0
  124. package/cjs/swipe-action/item.d.ts +11 -0
  125. package/cjs/swipe-action/item.js +52 -0
  126. package/cjs/swipe-action/style/css/index.css +88 -0
  127. package/cjs/swipe-action/style/css/index.d.ts +2 -0
  128. package/cjs/swipe-action/style/css/index.js +5 -0
  129. package/cjs/swipe-action/style/index.d.ts +2 -0
  130. package/cjs/swipe-action/style/index.js +5 -0
  131. package/cjs/swipe-action/style/index.less +89 -0
  132. package/cjs/swipe-action/type.d.ts +123 -0
  133. package/cjs/swipe-action/type.js +3 -0
  134. package/cjs/switch/index.d.ts +1 -1
  135. package/cjs/switch/index.js +1 -1
  136. package/cjs/tabs/tab-pane.js +5 -1
  137. package/cjs/tag/index.d.ts +1 -1
  138. package/cjs/tag/index.js +1 -1
  139. package/cjs/textarea/index.d.ts +1 -1
  140. package/cjs/textarea/index.js +1 -1
  141. package/dist/index.js +8040 -6845
  142. package/dist/index.min.js +6 -7
  143. package/dist/style.css +497 -447
  144. package/dist/style.min.css +1 -1
  145. package/esm/_helpers/type.d.ts +1 -1
  146. package/esm/avatar/group.js +1 -1
  147. package/esm/avatar/index.d.ts +1 -1
  148. package/esm/avatar/index.js +11 -14
  149. package/esm/avatar/style/css/index.css +96 -126
  150. package/esm/avatar/style/index.less +54 -72
  151. package/esm/badge/index.d.ts +1 -1
  152. package/esm/badge/index.js +7 -9
  153. package/esm/badge/style/css/index.css +5 -5
  154. package/esm/badge/style/index.less +5 -5
  155. package/esm/button/hooks.d.ts +1 -2
  156. package/esm/button/hooks.js +5 -3
  157. package/esm/button/index.d.ts +6 -0
  158. package/esm/button/index.js +40 -35
  159. package/esm/button/style/css/index.css +75 -310
  160. package/esm/button/style/index.less +32 -38
  161. package/esm/carousel/index.d.ts +1 -1
  162. package/esm/carousel/index.js +1 -1
  163. package/esm/cell/index.d.ts +1 -1
  164. package/esm/cell/index.js +1 -1
  165. package/esm/checkbox/index.d.ts +1 -1
  166. package/esm/checkbox/index.js +1 -1
  167. package/esm/collapse/index.d.ts +1 -1
  168. package/esm/collapse/index.js +1 -1
  169. package/esm/count-down/demo/style/mobile.less +1 -1
  170. package/esm/count-down/index.d.ts +1 -1
  171. package/esm/count-down/index.js +1 -1
  172. package/esm/date-picker/index.d.ts +1 -1
  173. package/esm/date-picker/index.js +1 -1
  174. package/esm/dropdown/dropdown.d.ts +3 -0
  175. package/esm/dropdown/dropdown.js +304 -0
  176. package/esm/dropdown/index.d.ts +3 -4
  177. package/esm/dropdown/index.js +3 -293
  178. package/esm/dropdown/options.js +2 -1
  179. package/esm/dropdown/style/css/index.css +3 -0
  180. package/esm/dropdown/style/index.less +2 -0
  181. package/esm/dropdown/type.d.ts +20 -9
  182. package/esm/dropdown-menu/dropdown-menu.d.ts +4 -0
  183. package/esm/dropdown-menu/dropdown-menu.js +256 -0
  184. package/esm/dropdown-menu/helper.d.ts +1 -1
  185. package/esm/dropdown-menu/index.d.ts +2 -3
  186. package/esm/dropdown-menu/index.js +2 -237
  187. package/esm/dropdown-menu/type.d.ts +21 -20
  188. package/esm/ellipsis/index.d.ts +1 -1
  189. package/esm/ellipsis/index.js +1 -1
  190. package/esm/grid/index.js +13 -12
  191. package/esm/image/index.d.ts +1 -2
  192. package/esm/image/index.js +15 -10
  193. package/esm/image/style/css/index.css +2 -1
  194. package/esm/image/style/index.less +2 -1
  195. package/esm/image-picker/add-icon.d.ts +2 -0
  196. package/esm/image-picker/add-icon.js +14 -0
  197. package/esm/image-picker/demo/style/css/mobile.css +40 -0
  198. package/esm/image-picker/demo/style/mobile.less +42 -0
  199. package/esm/image-picker/index.d.ts +13 -0
  200. package/esm/image-picker/index.js +302 -0
  201. package/esm/image-picker/style/css/index.css +147 -0
  202. package/esm/image-picker/style/css/index.d.ts +2 -0
  203. package/esm/image-picker/style/css/index.js +2 -0
  204. package/esm/image-picker/style/index.d.ts +2 -0
  205. package/esm/image-picker/style/index.js +2 -0
  206. package/esm/image-picker/style/index.less +116 -0
  207. package/esm/image-picker/type.d.ts +174 -0
  208. package/esm/image-picker/type.js +1 -0
  209. package/esm/image-preview/index.d.ts +3 -3
  210. package/esm/image-preview/index.js +1 -1
  211. package/esm/index.d.ts +3 -0
  212. package/esm/index.js +3 -0
  213. package/esm/input/hooks.js +49 -8
  214. package/esm/input/index.d.ts +1 -1
  215. package/esm/input/index.js +1 -1
  216. package/esm/input/props.d.ts +8 -2
  217. package/esm/nav-bar/index.js +6 -2
  218. package/esm/notice-bar/index.d.ts +1 -1
  219. package/esm/notice-bar/index.js +1 -1
  220. package/esm/picker/index.d.ts +1 -1
  221. package/esm/picker/index.js +1 -1
  222. package/esm/picker-view/index.d.ts +1 -1
  223. package/esm/picker-view/index.js +1 -1
  224. package/esm/popover/index.d.ts +1 -1
  225. package/esm/popover/index.js +1 -1
  226. package/esm/popup-swiper/index.js +3 -2
  227. package/esm/radio/index.d.ts +1 -1
  228. package/esm/radio/index.js +1 -1
  229. package/esm/rate/index.d.ts +1 -1
  230. package/esm/rate/index.js +1 -1
  231. package/esm/search-bar/association.d.ts +3 -0
  232. package/esm/search-bar/association.js +82 -0
  233. package/esm/search-bar/cancel-button.d.ts +10 -0
  234. package/esm/search-bar/cancel-button.js +30 -0
  235. package/esm/search-bar/demo/style/css/mobile.css +5 -0
  236. package/esm/search-bar/demo/style/mobile.less +9 -0
  237. package/esm/search-bar/highlight.d.ts +12 -0
  238. package/esm/search-bar/highlight.js +66 -0
  239. package/esm/search-bar/index.d.ts +13 -0
  240. package/esm/search-bar/index.js +213 -0
  241. package/esm/search-bar/style/css/index.css +148 -0
  242. package/esm/search-bar/style/css/index.d.ts +2 -0
  243. package/esm/search-bar/style/css/index.js +2 -0
  244. package/esm/search-bar/style/index.d.ts +2 -0
  245. package/esm/search-bar/style/index.js +2 -0
  246. package/esm/search-bar/style/index.less +111 -0
  247. package/esm/search-bar/type.d.ts +163 -0
  248. package/esm/search-bar/type.js +1 -0
  249. package/esm/show-monitor/index.js +31 -3
  250. package/esm/slider/index.d.ts +1 -1
  251. package/esm/slider/index.js +1 -1
  252. package/esm/steps/demo/style/css/mobile.css +1 -1
  253. package/esm/steps/demo/style/mobile.less +1 -1
  254. package/esm/steps/index.d.ts +1 -1
  255. package/esm/steps/index.js +1 -1
  256. package/esm/steps/style/css/index.css +5 -15
  257. package/esm/steps/style/index.less +6 -10
  258. package/esm/sticky/index.d.ts +1 -1
  259. package/esm/style.d.ts +3 -0
  260. package/esm/style.js +3 -0
  261. package/esm/swipe-action/demo/style/css/mobile.css +5 -0
  262. package/esm/swipe-action/demo/style/mobile.less +9 -0
  263. package/esm/swipe-action/index.d.ts +12 -0
  264. package/esm/swipe-action/index.js +321 -0
  265. package/esm/swipe-action/item.d.ts +11 -0
  266. package/esm/swipe-action/item.js +42 -0
  267. package/esm/swipe-action/style/css/index.css +88 -0
  268. package/esm/swipe-action/style/css/index.d.ts +2 -0
  269. package/esm/swipe-action/style/css/index.js +2 -0
  270. package/esm/swipe-action/style/index.d.ts +2 -0
  271. package/esm/swipe-action/style/index.js +2 -0
  272. package/esm/swipe-action/style/index.less +89 -0
  273. package/esm/swipe-action/type.d.ts +123 -0
  274. package/esm/swipe-action/type.js +1 -0
  275. package/esm/switch/index.d.ts +1 -1
  276. package/esm/switch/index.js +1 -1
  277. package/esm/tabs/tab-pane.js +5 -1
  278. package/esm/tag/index.d.ts +1 -1
  279. package/esm/tag/index.js +1 -1
  280. package/esm/textarea/index.d.ts +1 -1
  281. package/esm/textarea/index.js +1 -1
  282. package/package.json +3 -3
  283. package/tokens/app/arcodesign/default/css-variables.less +53 -3
  284. package/tokens/app/arcodesign/default/index.d.ts +53 -3
  285. package/tokens/app/arcodesign/default/index.js +54 -4
  286. package/tokens/app/arcodesign/default/index.json +629 -39
  287. package/tokens/app/arcodesign/default/index.less +53 -3
  288. package/umd/_helpers/type.d.ts +1 -1
  289. package/umd/avatar/group.js +1 -1
  290. package/umd/avatar/index.d.ts +1 -1
  291. package/umd/avatar/index.js +11 -14
  292. package/umd/avatar/style/css/index.css +96 -126
  293. package/umd/avatar/style/index.less +54 -72
  294. package/umd/badge/index.d.ts +1 -1
  295. package/umd/badge/index.js +7 -9
  296. package/umd/badge/style/css/index.css +5 -5
  297. package/umd/badge/style/index.less +5 -5
  298. package/umd/button/hooks.d.ts +1 -2
  299. package/umd/button/hooks.js +5 -3
  300. package/umd/button/index.d.ts +6 -0
  301. package/umd/button/index.js +38 -33
  302. package/umd/button/style/css/index.css +75 -310
  303. package/umd/button/style/index.less +32 -38
  304. package/umd/carousel/index.d.ts +1 -1
  305. package/umd/carousel/index.js +1 -1
  306. package/umd/cell/index.d.ts +1 -1
  307. package/umd/cell/index.js +1 -1
  308. package/umd/checkbox/index.d.ts +1 -1
  309. package/umd/checkbox/index.js +1 -1
  310. package/umd/collapse/index.d.ts +1 -1
  311. package/umd/collapse/index.js +1 -1
  312. package/umd/count-down/demo/style/mobile.less +1 -1
  313. package/umd/count-down/index.d.ts +1 -1
  314. package/umd/count-down/index.js +1 -1
  315. package/umd/date-picker/index.d.ts +1 -1
  316. package/umd/date-picker/index.js +1 -1
  317. package/umd/dropdown/dropdown.d.ts +3 -0
  318. package/umd/dropdown/dropdown.js +325 -0
  319. package/umd/dropdown/index.d.ts +3 -4
  320. package/umd/dropdown/index.js +5 -298
  321. package/umd/dropdown/options.js +2 -1
  322. package/umd/dropdown/style/css/index.css +3 -0
  323. package/umd/dropdown/style/index.less +2 -0
  324. package/umd/dropdown/type.d.ts +20 -9
  325. package/umd/dropdown-menu/dropdown-menu.d.ts +4 -0
  326. package/umd/dropdown-menu/dropdown-menu.js +278 -0
  327. package/umd/dropdown-menu/helper.d.ts +1 -1
  328. package/umd/dropdown-menu/index.d.ts +2 -3
  329. package/umd/dropdown-menu/index.js +5 -241
  330. package/umd/dropdown-menu/type.d.ts +21 -20
  331. package/umd/ellipsis/index.d.ts +1 -1
  332. package/umd/ellipsis/index.js +1 -1
  333. package/umd/grid/index.js +13 -12
  334. package/umd/image/index.d.ts +1 -2
  335. package/umd/image/index.js +14 -9
  336. package/umd/image/style/css/index.css +2 -1
  337. package/umd/image/style/index.less +2 -1
  338. package/umd/image-picker/add-icon.d.ts +2 -0
  339. package/umd/image-picker/add-icon.js +35 -0
  340. package/umd/image-picker/demo/style/css/mobile.css +40 -0
  341. package/umd/image-picker/demo/style/mobile.less +42 -0
  342. package/umd/image-picker/index.d.ts +13 -0
  343. package/umd/image-picker/index.js +329 -0
  344. package/umd/image-picker/style/css/index.css +147 -0
  345. package/umd/image-picker/style/css/index.d.ts +2 -0
  346. package/umd/image-picker/style/css/index.js +15 -0
  347. package/umd/image-picker/style/index.d.ts +2 -0
  348. package/umd/image-picker/style/index.js +15 -0
  349. package/umd/image-picker/style/index.less +116 -0
  350. package/umd/image-picker/type.d.ts +174 -0
  351. package/umd/image-picker/type.js +17 -0
  352. package/umd/image-preview/index.d.ts +3 -3
  353. package/umd/image-preview/index.js +1 -1
  354. package/umd/index.d.ts +3 -0
  355. package/umd/index.js +11 -5
  356. package/umd/input/hooks.js +48 -7
  357. package/umd/input/index.d.ts +1 -1
  358. package/umd/input/index.js +1 -1
  359. package/umd/input/props.d.ts +8 -2
  360. package/umd/nav-bar/index.js +9 -6
  361. package/umd/notice-bar/index.d.ts +1 -1
  362. package/umd/notice-bar/index.js +1 -1
  363. package/umd/picker/index.d.ts +1 -1
  364. package/umd/picker/index.js +1 -1
  365. package/umd/picker-view/index.d.ts +1 -1
  366. package/umd/picker-view/index.js +1 -1
  367. package/umd/popover/index.d.ts +1 -1
  368. package/umd/popover/index.js +1 -1
  369. package/umd/popup-swiper/index.js +3 -2
  370. package/umd/radio/index.d.ts +1 -1
  371. package/umd/radio/index.js +1 -1
  372. package/umd/rate/index.d.ts +1 -1
  373. package/umd/rate/index.js +1 -1
  374. package/umd/search-bar/association.d.ts +3 -0
  375. package/umd/search-bar/association.js +101 -0
  376. package/umd/search-bar/cancel-button.d.ts +10 -0
  377. package/umd/search-bar/cancel-button.js +52 -0
  378. package/umd/search-bar/demo/style/css/mobile.css +5 -0
  379. package/umd/search-bar/demo/style/mobile.less +9 -0
  380. package/umd/search-bar/highlight.d.ts +12 -0
  381. package/umd/search-bar/highlight.js +87 -0
  382. package/umd/search-bar/index.d.ts +13 -0
  383. package/umd/search-bar/index.js +235 -0
  384. package/umd/search-bar/style/css/index.css +148 -0
  385. package/umd/search-bar/style/css/index.d.ts +2 -0
  386. package/umd/search-bar/style/css/index.js +15 -0
  387. package/umd/search-bar/style/index.d.ts +2 -0
  388. package/umd/search-bar/style/index.js +15 -0
  389. package/umd/search-bar/style/index.less +111 -0
  390. package/umd/search-bar/type.d.ts +163 -0
  391. package/umd/search-bar/type.js +17 -0
  392. package/umd/show-monitor/index.js +31 -3
  393. package/umd/slider/index.d.ts +1 -1
  394. package/umd/slider/index.js +1 -1
  395. package/umd/steps/demo/style/css/mobile.css +1 -1
  396. package/umd/steps/demo/style/mobile.less +1 -1
  397. package/umd/steps/index.d.ts +1 -1
  398. package/umd/steps/index.js +1 -1
  399. package/umd/steps/style/css/index.css +5 -15
  400. package/umd/steps/style/index.less +6 -10
  401. package/umd/sticky/index.d.ts +1 -1
  402. package/umd/style.d.ts +3 -0
  403. package/umd/style.js +4 -4
  404. package/umd/swipe-action/demo/style/css/mobile.css +5 -0
  405. package/umd/swipe-action/demo/style/mobile.less +9 -0
  406. package/umd/swipe-action/index.d.ts +12 -0
  407. package/umd/swipe-action/index.js +342 -0
  408. package/umd/swipe-action/item.d.ts +11 -0
  409. package/umd/swipe-action/item.js +62 -0
  410. package/umd/swipe-action/style/css/index.css +88 -0
  411. package/umd/swipe-action/style/css/index.d.ts +2 -0
  412. package/umd/swipe-action/style/css/index.js +15 -0
  413. package/umd/swipe-action/style/index.d.ts +2 -0
  414. package/umd/swipe-action/style/index.js +15 -0
  415. package/umd/swipe-action/style/index.less +89 -0
  416. package/umd/swipe-action/type.d.ts +123 -0
  417. package/umd/swipe-action/type.js +17 -0
  418. package/umd/switch/index.d.ts +1 -1
  419. package/umd/switch/index.js +1 -1
  420. package/umd/tabs/tab-pane.js +5 -1
  421. package/umd/tag/index.d.ts +1 -1
  422. package/umd/tag/index.js +1 -1
  423. package/umd/textarea/index.d.ts +1 -1
  424. package/umd/textarea/index.js +1 -1
@@ -123,6 +123,34 @@ var ShowMonitor = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
123
123
  offset: offset,
124
124
  threshold: threshold
125
125
  }, true);
126
+ },
127
+
128
+ /**
129
+ * 重置元素初始可见态为false,并重新对元素可见度发起检测,优先级低于disabled(通常用在对ShowMonitor内部元素变化时发起的重新监听)
130
+ * @en Reset the initial visible state of the element to false, and re-detect the visibility of the element, the priority is lower than 'disabled'(Usually used to re-listen when elements inside ShowMonitor change)
131
+ */
132
+ flushVisibleStatus: function flushVisibleStatus() {
133
+ isVisible.current = false;
134
+
135
+ if (isSupportNativeApi && io.current && domRef.current) {
136
+ disabled ? io.current.unobserve(domRef.current) : io.current.observe(domRef.current);
137
+ } else if (listener.current) {
138
+ var _key = wrapperKey.current;
139
+
140
+ if (once && onOnceEmittedListeners != null && onOnceEmittedListeners[_key]) {
141
+ onOnceEmittedListeners[_key] = onOnceEmittedListeners[_key].filter(function (emitListener) {
142
+ return emitListener !== listener.current;
143
+ });
144
+ }
145
+
146
+ if (!disabled && !listeners[_key].find(function (_listener) {
147
+ return _listener === listener.current;
148
+ })) {
149
+ listeners[_key].push(listener.current);
150
+ }
151
+
152
+ !disabled && _checkVisible(listener.current);
153
+ }
126
154
  }
127
155
  };
128
156
  });
@@ -390,8 +418,8 @@ var ShowMonitor = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
390
418
  }
391
419
  }
392
420
 
393
- var _key = wrapperKey.current;
394
- var curListeners = listeners[_key];
421
+ var _key2 = wrapperKey.current;
422
+ var curListeners = listeners[_key2];
395
423
 
396
424
  if (curListeners) {
397
425
  // 不在监听队列中,移除
@@ -401,7 +429,7 @@ var ShowMonitor = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
401
429
  // @en When the listening queue is empty, unbind scroll and resize events
402
430
 
403
431
  if (curListeners.length === 0) {
404
- delete listeners[_key];
432
+ delete listeners[_key2];
405
433
 
406
434
  if (scrollPort.current) {
407
435
  scrollPort.current.removeEventListener('scroll', throttlingVisibleChange);
@@ -143,7 +143,7 @@ export interface SliderRef {
143
143
  * @en Slide input component, displays the current value and optional range.
144
144
  * @name 滑动输入条
145
145
  * @name_en Slider
146
- * @type 数据输入
146
+ * @type 数据录入
147
147
  * @type_en Data Entry
148
148
  */
149
149
  declare const SliderWrapper: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<SliderRef>>;
@@ -173,7 +173,7 @@ var Slider = /*#__PURE__*/(0, _react.forwardRef)(function (_, ref) {
173
173
  * @en Slide input component, displays the current value and optional range.
174
174
  * @name 滑动输入条
175
175
  * @name_en Slider
176
- * @type 数据输入
176
+ * @type 数据录入
177
177
  * @type_en Data Entry
178
178
  */
179
179
 
@@ -61,5 +61,5 @@
61
61
  background: #165DFF;
62
62
  }
63
63
  #demo-steps #demo-order-8 .demo-svg .arco-steps-item-custom-icon {
64
- font-size: 12PX;
64
+ font-size: 11PX;
65
65
  }
@@ -30,7 +30,7 @@
30
30
  }
31
31
  .set-steps-color(#165DFF);
32
32
  .@{prefix}-steps-item-custom-icon {
33
- font-size: 12PX;
33
+ font-size: 11PX;
34
34
  }
35
35
  }
36
36
  }
@@ -13,7 +13,7 @@ declare const _default: React.ForwardRefExoticComponent<StepsProps & React.RefAt
13
13
  * @en Display the progress of a task, or guide users to complete a complex task.
14
14
  * @name 步骤条
15
15
  * @name_en Steps
16
- * @type 数据展示
16
+ * @type 信息展示
17
17
  * @type_en Data Display
18
18
  */
19
19
  export default _default;
@@ -114,7 +114,7 @@ var Steps = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
114
114
  * @en Display the progress of a task, or guide users to complete a complex task.
115
115
  * @name 步骤条
116
116
  * @name_en Steps
117
- * @type 数据展示
117
+ * @type 信息展示
118
118
  * @type_en Data Display
119
119
  */
120
120
 
@@ -59,7 +59,7 @@
59
59
  .vertical .arco-steps-item-tail {
60
60
  height: 100%;
61
61
  width: 18PX ;
62
- top: 0.18rem;
62
+ top: 0.18rem ;
63
63
  padding: 0.28rem 0 ;
64
64
  }
65
65
  .vertical .arco-steps-item-tail:after {
@@ -73,19 +73,7 @@
73
73
  .finish .arco-steps-item-tail:after {
74
74
  background: #165dff ;
75
75
  }
76
- .arco-steps-item-custom-icon {
77
- display: -webkit-box;
78
- display: -webkit-flex;
79
- display: flex;
80
- -webkit-box-align: center;
81
- -webkit-align-items: center;
82
- align-items: center;
83
- -webkit-box-pack: center;
84
- -webkit-justify-content: center;
85
- justify-content: center;
86
- width: 20PX ;
87
- height: 20PX ;
88
- }
76
+ .arco-steps-item-custom-icon,
89
77
  .arco-steps-item-icon {
90
78
  display: -webkit-inline-box;
91
79
  display: -webkit-inline-flex;
@@ -96,10 +84,12 @@
96
84
  -webkit-box-pack: center;
97
85
  -webkit-justify-content: center;
98
86
  justify-content: center;
99
- border-radius: 50%;
100
87
  width: 18PX ;
101
88
  height: 18PX ;
102
89
  }
90
+ .arco-steps-item-icon {
91
+ border-radius: 50%;
92
+ }
103
93
  .number.finish .arco-steps-item-icon {
104
94
  background: #E8F3FF ;
105
95
  }
@@ -47,7 +47,7 @@
47
47
  .vertical & {
48
48
  height: 100%;
49
49
  .use-var(width, steps-icon-width);
50
- .rem(top, 9);
50
+ .use-var(top, steps-tail-vertical-top);
51
51
  .use-var(padding, steps-tail-vertical-padding);
52
52
 
53
53
  &:after {
@@ -65,21 +65,17 @@
65
65
  }
66
66
  }
67
67
 
68
- &-custom-icon {
69
- display: flex;
70
- align-items: center;
71
- justify-content: center;
72
- .use-var(width, steps-custom-icon-width);
73
- .use-var(height, steps-custom-icon-height);
74
- }
75
-
68
+ &-custom-icon,
76
69
  &-icon {
77
70
  display: inline-flex;
78
71
  align-items: center;
79
72
  justify-content: center;
80
- border-radius: 50%;
81
73
  .use-var(width, steps-icon-width);
82
74
  .use-var(height, steps-icon-height);
75
+ }
76
+
77
+ &-icon {
78
+ border-radius: 50%;
83
79
 
84
80
  .number.finish & {
85
81
  .use-var(background, steps-finish-icon-num-background);
@@ -118,7 +118,7 @@ export interface StickyProps {
118
118
  */
119
119
  getContainer?: () => HTMLElement | string;
120
120
  /**
121
- * 指定滚动容器,如果指定该值则relative属性始终认定为false;如果返回string则使用querySelector选取容器
121
+ * 指定滚动容器;如果返回string则使用querySelector选取容器
122
122
  * @en Specifies the scrolling container. If this value is specified, the relative property is always regarded as false; if a string is input, use querySelector to select the container
123
123
  * @default () => window
124
124
  */
package/cjs/style.d.ts CHANGED
@@ -22,6 +22,7 @@ import './ellipsis/style';
22
22
  import './grid/style';
23
23
  import './image/style';
24
24
  import './show-monitor/style';
25
+ import './image-picker/style';
25
26
  import './image-preview/style';
26
27
  import './input/style';
27
28
  import './load-more/style';
@@ -41,8 +42,10 @@ import './pull-refresh/style';
41
42
  import './radio/style';
42
43
  import './rate/style';
43
44
  import './slider/style';
45
+ import './search-bar/style';
44
46
  import './steps/style';
45
47
  import './sticky/style';
48
+ import './swipe-action/style';
46
49
  import './swipe-load/style';
47
50
  import './tab-bar/style';
48
51
  import './tag/style';
package/cjs/style.js CHANGED
@@ -48,6 +48,8 @@ require("./image/style");
48
48
 
49
49
  require("./show-monitor/style");
50
50
 
51
+ require("./image-picker/style");
52
+
51
53
  require("./image-preview/style");
52
54
 
53
55
  require("./input/style");
@@ -86,10 +88,14 @@ require("./rate/style");
86
88
 
87
89
  require("./slider/style");
88
90
 
91
+ require("./search-bar/style");
92
+
89
93
  require("./steps/style");
90
94
 
91
95
  require("./sticky/style");
92
96
 
97
+ require("./swipe-action/style");
98
+
93
99
  require("./swipe-load/style");
94
100
 
95
101
  require("./tab-bar/style");
@@ -0,0 +1,5 @@
1
+ #demo-swipe-action .arcodesign-mobile-demo-content {
2
+ padding: 0;
3
+ background: transparent;
4
+ overflow: hidden;
5
+ }
@@ -0,0 +1,9 @@
1
+ @import '../../../../style/mixin.less';
2
+
3
+ #demo-swipe-action {
4
+ .arcodesign-mobile-demo-content {
5
+ padding: 0;
6
+ background: transparent;
7
+ overflow: hidden;
8
+ }
9
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { SwipeActionProps, SwipeActionRef } from './type';
3
+ /**
4
+ * 滑动操作组件,左右滑动拉出菜单栏
5
+ * @en SwipeAction component, slide left and right to pull out the menu bar
6
+ * @type 反馈
7
+ * @type_en FeedBack
8
+ * @name 滑动操作
9
+ * @name_en SwipeAction
10
+ */
11
+ declare const SwipeAction: React.ForwardRefExoticComponent<SwipeActionProps & React.RefAttributes<SwipeActionRef>>;
12
+ export default SwipeAction;
@@ -0,0 +1,339 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ exports.__esModule = true;
6
+ exports.default = void 0;
7
+
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _utils = require("@arco-design/mobile-utils/utils");
13
+
14
+ var _mobileUtils = require("@arco-design/mobile-utils");
15
+
16
+ var _contextProvider = require("../context-provider");
17
+
18
+ var _item = _interopRequireDefault(require("./item"));
19
+
20
+ var _helpers = require("../_helpers");
21
+
22
+ 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); }
23
+
24
+ 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; }
25
+
26
+ /**
27
+ * 滑动操作组件,左右滑动拉出菜单栏
28
+ * @en SwipeAction component, slide left and right to pull out the menu bar
29
+ * @type 反馈
30
+ * @type_en FeedBack
31
+ * @name 滑动操作
32
+ * @name_en SwipeAction
33
+ */
34
+ var SwipeAction = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
35
+ var _props$className = props.className,
36
+ className = _props$className === void 0 ? '' : _props$className,
37
+ style = props.style,
38
+ children = props.children,
39
+ leftActions = props.leftActions,
40
+ rightActions = props.rightActions,
41
+ _props$disabled = props.disabled,
42
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
43
+ _props$threshold = props.threshold,
44
+ threshold = _props$threshold === void 0 ? 0.15 : _props$threshold,
45
+ closeOnTouchOutside = props.closeOnTouchOutside,
46
+ _props$transitionDura = props.transitionDuration,
47
+ transitionDuration = _props$transitionDura === void 0 ? 300 : _props$transitionDura,
48
+ _props$dampRate = props.dampRate,
49
+ dampRate = _props$dampRate === void 0 ? 15 : _props$dampRate,
50
+ _props$openStyleType = props.openStyleType,
51
+ openStyleType = _props$openStyleType === void 0 ? 'layer' : _props$openStyleType,
52
+ onClose = props.onClose,
53
+ onOpen = props.onOpen;
54
+ var domRef = (0, _react.useRef)(null);
55
+ var leftRef = (0, _react.useRef)(null);
56
+ var rightRef = (0, _react.useRef)(null);
57
+ var isOpen = (0, _react.useRef)(false);
58
+ var leftMenuWidthRef = (0, _react.useRef)(0);
59
+
60
+ var _useState = (0, _react.useState)([]),
61
+ leftMenuWidthArr = _useState[0],
62
+ setLeftMenuWidthArr = _useState[1];
63
+
64
+ var rightMenuWidthRef = (0, _react.useRef)(0);
65
+
66
+ var _useState2 = (0, _react.useState)([]),
67
+ rightMenuWidthArr = _useState2[0],
68
+ setRightMenuWidthArr = _useState2[1];
69
+
70
+ var dampRateRef = (0, _helpers.useLatestRef)(dampRate);
71
+ var forbidClick = (0, _react.useRef)(false);
72
+
73
+ var _useRefState = (0, _helpers.useRefState)(false),
74
+ moving = _useRefState[0],
75
+ movingRef = _useRefState[1],
76
+ setMoving = _useRefState[2];
77
+
78
+ var _useRefState2 = (0, _helpers.useRefState)(0),
79
+ offset = _useRefState2[0],
80
+ offsetRef = _useRefState2[1],
81
+ setOffset = _useRefState2[2];
82
+
83
+ var _useContext = (0, _react.useContext)(_contextProvider.GlobalContext),
84
+ prefixCls = _useContext.prefixCls;
85
+
86
+ var startRef = (0, _react.useRef)(0);
87
+ var startX = (0, _react.useRef)(0);
88
+ var slideX = (0, _react.useRef)(0);
89
+ var isLayer = openStyleType === 'layer';
90
+ var transitionStyle = (0, _react.useMemo)(function () {
91
+ return (0, _helpers.getStyleWithVendor)({
92
+ transitionDuration: moving ? '0ms' : transitionDuration + "ms"
93
+ });
94
+ }, [moving, transitionDuration]);
95
+
96
+ function resetMoveData() {
97
+ startX.current = 0;
98
+ slideX.current = 0;
99
+ }
100
+
101
+ function getMenuCurrentWidth(a, min, max) {
102
+ var buffer = Math.abs(a) / dampRateRef.current;
103
+ return Math.min(Math.max(a, min - buffer), max + buffer);
104
+ }
105
+
106
+ function touchstart(e) {
107
+ startRef.current = offsetRef.current;
108
+ resetMoveData();
109
+ startX.current = e.touches[0].pageX;
110
+ }
111
+
112
+ function touchmove(e) {
113
+ e.preventDefault();
114
+ slideX.current = e.touches[0].pageX - startX.current;
115
+ forbidClick.current = true;
116
+ setMoving(true);
117
+ setOffset(getMenuCurrentWidth(slideX.current + startRef.current, -rightMenuWidthRef.current, leftMenuWidthRef.current));
118
+ }
119
+
120
+ function touchend() {
121
+ if (movingRef.current) {
122
+ var currentMenu = offsetRef.current > 0 ? 'left' : 'right';
123
+ changeMenu(currentMenu);
124
+ setMoving(false);
125
+ (0, _utils.nextTick)(function () {
126
+ forbidClick.current = false;
127
+ });
128
+ }
129
+ }
130
+
131
+ function changeMenu(dir) {
132
+ var cookedThreshold = isOpen.current ? 1 - threshold : threshold;
133
+ var width = dir === 'left' ? leftMenuWidthRef.current : rightMenuWidthRef.current;
134
+
135
+ if (width && Math.abs(offsetRef.current) > width * cookedThreshold) {
136
+ open(dir);
137
+ } else {
138
+ close(dir);
139
+ }
140
+ }
141
+
142
+ function getWidthByRef(widthRef) {
143
+ if (!widthRef.current) {
144
+ return {
145
+ totalWidth: 0,
146
+ widthArr: []
147
+ };
148
+ }
149
+
150
+ var totalWidth = 0;
151
+ var widthArr = [];
152
+ var allEle = widthRef.current.getElementsByClassName(prefixCls + "-swipe-action-menu-action-info-container");
153
+ Array.prototype.forEach.call(allEle, function (ele) {
154
+ var _ele$getBoundingClien;
155
+
156
+ var w = (_ele$getBoundingClien = ele.getBoundingClientRect().width) != null ? _ele$getBoundingClien : 0;
157
+ totalWidth += w;
158
+ widthArr.push(w);
159
+ });
160
+ return {
161
+ totalWidth: totalWidth,
162
+ widthArr: widthArr
163
+ };
164
+ }
165
+
166
+ (0, _react.useEffect)(function () {
167
+ var container = domRef.current;
168
+
169
+ if (!disabled && container) {
170
+ container.addEventListener('touchstart', touchstart);
171
+ container.addEventListener('touchmove', touchmove);
172
+ container.addEventListener('touchend', touchend);
173
+ }
174
+
175
+ return function () {
176
+ if (!disabled && container) {
177
+ container.removeEventListener('touchstart', touchstart);
178
+ container.removeEventListener('touchmove', touchmove);
179
+ container.removeEventListener('touchend', touchend);
180
+ }
181
+ };
182
+ }, [disabled]); // 获取左右菜单的宽度
183
+ // @en Get the width of the left and right menu
184
+
185
+ (0, _react.useEffect)(function () {
186
+ var _getWidthByRef = getWidthByRef(leftRef),
187
+ leftTotalWidth = _getWidthByRef.totalWidth,
188
+ leftWidthArr = _getWidthByRef.widthArr;
189
+
190
+ leftMenuWidthRef.current = leftTotalWidth;
191
+ setLeftMenuWidthArr(leftWidthArr);
192
+
193
+ var _getWidthByRef2 = getWidthByRef(rightRef),
194
+ rightTotalWidth = _getWidthByRef2.totalWidth,
195
+ rightWidthArr = _getWidthByRef2.widthArr;
196
+
197
+ rightMenuWidthRef.current = rightTotalWidth;
198
+ setRightMenuWidthArr(rightWidthArr);
199
+ }, [leftActions, rightActions]); // 点击外部区域事件
200
+ // @en Event when clicking outside of the element
201
+
202
+ (0, _react.useEffect)(function () {
203
+ var handle = function handle(e) {
204
+ var _domRef$current;
205
+
206
+ if (!((_domRef$current = domRef.current) != null && _domRef$current.contains(e.target)) && isOpen.current) {
207
+ close();
208
+ }
209
+ };
210
+
211
+ closeOnTouchOutside && document.addEventListener('touchstart', handle);
212
+ return function () {
213
+ closeOnTouchOutside && document.removeEventListener('touchstart', handle);
214
+ };
215
+ }, [closeOnTouchOutside]);
216
+ (0, _react.useImperativeHandle)(ref, function () {
217
+ return {
218
+ dom: domRef.current,
219
+ close: close,
220
+ open: open
221
+ };
222
+ });
223
+
224
+ function close(dir) {
225
+ setOffset(0);
226
+
227
+ if (isOpen.current) {
228
+ isOpen.current = false;
229
+
230
+ if (!dir && offsetRef.current !== 0) {
231
+ var noDir = offsetRef.current > 0 ? 'left' : 'right';
232
+ handleClose(noDir);
233
+ return;
234
+ }
235
+
236
+ handleClose(dir);
237
+ }
238
+ }
239
+
240
+ function open(dir) {
241
+ if (dir === void 0) {
242
+ dir = 'right';
243
+ }
244
+
245
+ if (!isOpen.current) {
246
+ isOpen.current = true;
247
+ handleOpen(dir);
248
+ }
249
+
250
+ setOffset(dir === 'left' ? leftMenuWidthRef.current : -rightMenuWidthRef.current);
251
+ }
252
+
253
+ function handleOpen(dir) {
254
+ setTimeout(function () {
255
+ onOpen == null ? void 0 : onOpen(dir);
256
+ }, transitionDuration);
257
+ }
258
+
259
+ function handleClose(dir) {
260
+ setTimeout(function () {
261
+ onClose == null ? void 0 : onClose(dir);
262
+ }, transitionDuration);
263
+ }
264
+
265
+ function actionClick(e) {
266
+ var _leftRef$current, _rightRef$current;
267
+
268
+ if (isOpen.current && !forbidClick.current && !((_leftRef$current = leftRef.current) != null && _leftRef$current.contains(e.target)) && !((_rightRef$current = rightRef.current) != null && _rightRef$current.contains(e.target))) {
269
+ close();
270
+ }
271
+ }
272
+
273
+ function getActionRightByIndex(index) {
274
+ var preWidth = leftMenuWidthArr.slice(index + 1).reduce(function (acc, cur) {
275
+ return acc + cur;
276
+ }, 0);
277
+ return (preWidth / leftMenuWidthRef.current || 0) * 100 + "%";
278
+ }
279
+
280
+ function getActionLeftByIndex(index) {
281
+ var preWidth = rightMenuWidthArr.slice(0, index).reduce(function (acc, cur) {
282
+ return acc + cur;
283
+ }, 0);
284
+ return (preWidth / rightMenuWidthRef.current || 0) * 100 + "%";
285
+ }
286
+
287
+ return /*#__PURE__*/_react.default.createElement("div", {
288
+ className: (0, _mobileUtils.cls)(prefixCls + "-swipe-action", className, offset === 0 ? 'action-close' : 'action-open'),
289
+ style: (0, _helpers.getStyleWithVendor)((0, _extends2.default)({}, style || {}, transitionStyle, {
290
+ transform: "translateX(" + offset + "px)"
291
+ })),
292
+ ref: domRef,
293
+ onClick: actionClick
294
+ }, /*#__PURE__*/_react.default.createElement("div", {
295
+ className: (0, _mobileUtils.cls)(prefixCls + "-swipe-action-menu-left", prefixCls + "-swipe-action-menu", offset > 0 ? 'action-open' : 'action-close'),
296
+ ref: leftRef,
297
+ style: isLayer && offset >= 0 ? (0, _extends2.default)({
298
+ width: offset
299
+ }, transitionStyle) : {}
300
+ }, leftActions == null ? void 0 : leftActions.map(function (action, index) {
301
+ return /*#__PURE__*/_react.default.createElement(_item.default, {
302
+ action: (0, _extends2.default)({}, action || {}, {
303
+ style: (0, _extends2.default)({}, isLayer ? {
304
+ right: getActionRightByIndex(index)
305
+ } : {}, action.style || {}),
306
+ className: (0, _mobileUtils.cls)(action.className, "open-style-" + openStyleType)
307
+ }),
308
+ prefixCls: prefixCls + "-swipe-action-menu-action",
309
+ index: leftActions.length - index,
310
+ type: "left",
311
+ close: close,
312
+ key: index
313
+ });
314
+ })), /*#__PURE__*/_react.default.createElement("div", {
315
+ className: prefixCls + "-swipe-action-content"
316
+ }, children), /*#__PURE__*/_react.default.createElement("div", {
317
+ className: (0, _mobileUtils.cls)(prefixCls + "-swipe-action-menu-right", prefixCls + "-swipe-action-menu", offset < 0 ? 'action-open' : 'action-close'),
318
+ ref: rightRef,
319
+ style: isLayer && offset <= 0 ? (0, _extends2.default)({
320
+ width: -1 * offset
321
+ }, transitionStyle) : {}
322
+ }, rightActions == null ? void 0 : rightActions.map(function (action, index) {
323
+ return /*#__PURE__*/_react.default.createElement(_item.default, {
324
+ action: (0, _extends2.default)({}, action || {}, {
325
+ style: (0, _extends2.default)({}, isLayer ? {
326
+ left: getActionLeftByIndex(index)
327
+ } : {}, action.style || {}),
328
+ className: (0, _mobileUtils.cls)(action.className, "open-style-" + openStyleType)
329
+ }),
330
+ prefixCls: prefixCls + "-swipe-action-menu-action",
331
+ index: index + 1,
332
+ type: "right",
333
+ close: close,
334
+ key: index
335
+ });
336
+ })));
337
+ });
338
+ var _default = SwipeAction;
339
+ exports.default = _default;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { Action } from './type';
3
+ interface IProps {
4
+ action: Action;
5
+ prefixCls: string;
6
+ index: number;
7
+ type: 'left' | 'right';
8
+ close: () => void;
9
+ }
10
+ export default function renderAction({ action, prefixCls, index, type, close }: IProps): JSX.Element;
11
+ export {};
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ exports.__esModule = true;
6
+ exports.default = renderAction;
7
+
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _mobileUtils = require("@arco-design/mobile-utils");
13
+
14
+ function renderAction(_ref) {
15
+ var action = _ref.action,
16
+ prefixCls = _ref.prefixCls,
17
+ index = _ref.index,
18
+ type = _ref.type,
19
+ close = _ref.close;
20
+ var text = action.text,
21
+ actionStyle = action.style,
22
+ className = action.className,
23
+ onClick = action.onClick,
24
+ icon = action.icon,
25
+ children = action.children;
26
+
27
+ function click() {
28
+ var result = (onClick == null ? void 0 : onClick()) || null;
29
+
30
+ if (!result || typeof result === 'boolean') {
31
+ !result && close();
32
+ } else if (result && result.then) {
33
+ result.then(function (res) {
34
+ return !res && close();
35
+ });
36
+ }
37
+ }
38
+
39
+ return /*#__PURE__*/_react.default.createElement("div", {
40
+ className: (0, _mobileUtils.cls)(prefixCls + "-" + type + " " + prefixCls + "-info-container", className),
41
+ style: (0, _extends2.default)({
42
+ zIndex: index
43
+ }, actionStyle),
44
+ onClick: click
45
+ }, children || /*#__PURE__*/_react.default.createElement("div", {
46
+ className: prefixCls + "-info"
47
+ }, icon ? /*#__PURE__*/_react.default.createElement("div", {
48
+ className: prefixCls + "-info-icon"
49
+ }, icon) : null, text ? /*#__PURE__*/_react.default.createElement("div", {
50
+ className: prefixCls + "-info-text"
51
+ }, text) : null));
52
+ }