@nutui/nutui-react-taro 2.0.0-alpha.1 → 2.0.0-alpha.10

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 (357) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/dist/esm/ActionSheet.js +15 -16
  3. package/dist/esm/Address.js +19 -22
  4. package/dist/esm/Animate.js +7 -9
  5. package/dist/esm/AnimatingNumbers.js +8 -9
  6. package/dist/esm/Audio.js +18 -20
  7. package/dist/esm/Avatar.js +11 -12
  8. package/dist/esm/AvatarGroup.js +8 -13
  9. package/dist/esm/BackTop.js +9 -10
  10. package/dist/esm/Badge.js +7 -10
  11. package/dist/esm/Barrage.js +9 -10
  12. package/dist/esm/Button.js +8 -9
  13. package/dist/esm/Calendar.js +18 -21
  14. package/dist/esm/CalendarItem.js +11 -14
  15. package/dist/esm/Card.js +12 -13
  16. package/dist/esm/Cascader.js +16 -18
  17. package/dist/esm/Cell.js +7 -8
  18. package/dist/esm/CellGroup.js +7 -8
  19. package/dist/esm/Checkbox.js +9 -10
  20. package/dist/esm/CheckboxGroup.js +9 -10
  21. package/dist/esm/CircleProgress.js +8 -10
  22. package/dist/esm/Col.js +8 -9
  23. package/dist/esm/Collapse.js +8 -9
  24. package/dist/esm/CollapseItem.js +7 -8
  25. package/dist/esm/ConfigProvider.js +9 -9
  26. package/dist/esm/CountDown.js +8 -11
  27. package/dist/esm/DatePicker.js +20 -24
  28. package/dist/esm/Dialog.js +13 -15
  29. package/dist/esm/Divider.js +7 -7
  30. package/dist/esm/Drag.js +7 -9
  31. package/dist/esm/Elevator.js +9 -10
  32. package/dist/esm/Ellipsis.js +9 -11
  33. package/dist/esm/Empty.js +7 -11
  34. package/dist/esm/FixedNav.js +11 -14
  35. package/dist/esm/Form.js +10 -11
  36. package/dist/esm/FormItem.js +8 -9
  37. package/dist/esm/Grid.js +8 -11
  38. package/dist/esm/GridItem.js +7 -10
  39. package/dist/esm/Image.js +7 -10
  40. package/dist/esm/ImagePreview.js +18 -20
  41. package/dist/esm/Indicator.js +6 -7
  42. package/dist/esm/Infiniteloading.js +12 -15
  43. package/dist/esm/Input.js +11 -11
  44. package/dist/esm/InputNumber.js +9 -10
  45. package/dist/esm/Layout.js +5 -6
  46. package/dist/esm/Menu.js +8 -9
  47. package/dist/esm/MenuItem.js +13 -15
  48. package/dist/esm/NavBar.js +7 -11
  49. package/dist/esm/NoticeBar.js +9 -12
  50. package/dist/esm/Notify.js +8 -10
  51. package/dist/esm/NumberKeyboard.js +14 -19
  52. package/dist/esm/Overlay.js +8 -9
  53. package/dist/esm/Pagination.js +9 -12
  54. package/dist/esm/Picker.js +19 -23
  55. package/dist/esm/Popover.js +10 -11
  56. package/dist/esm/Popup.js +12 -13
  57. package/dist/esm/Price.js +6 -8
  58. package/dist/esm/Progress.js +7 -11
  59. package/dist/esm/PullToRefresh.js +9 -14
  60. package/dist/esm/Radio.js +9 -10
  61. package/dist/esm/RadioGroup.js +9 -10
  62. package/dist/esm/Range/style/index.js +1 -1
  63. package/dist/esm/Range.js +11 -16
  64. package/dist/esm/Rate.js +9 -10
  65. package/dist/esm/Row.js +8 -9
  66. package/dist/esm/SearchBar.js +11 -14
  67. package/dist/esm/ShortPassword.js +16 -19
  68. package/dist/esm/SideNavBar.js +14 -15
  69. package/dist/esm/SideNavBarItem.js +5 -6
  70. package/dist/esm/Signature.js +13 -16
  71. package/dist/esm/Skeleton.js +14 -13
  72. package/dist/esm/Step.js +8 -11
  73. package/dist/esm/Steps/style/index.js +1 -1
  74. package/dist/esm/Steps.js +8 -10
  75. package/dist/esm/Sticky.js +10 -12
  76. package/dist/esm/SubSideNavBar.js +6 -7
  77. package/dist/esm/Swipe.js +11 -12
  78. package/dist/esm/Swiper.js +8 -11
  79. package/dist/esm/SwiperItem.js +5 -10
  80. package/dist/esm/Switch.js +7 -8
  81. package/dist/esm/TabPane.js +6 -9
  82. package/dist/esm/Tabbar/style/index.js +1 -1
  83. package/dist/esm/Tabbar.js +10 -8
  84. package/dist/esm/TabbarItem.js +8 -10
  85. package/dist/esm/Table.js +9 -14
  86. package/dist/esm/Tabs.js +11 -12
  87. package/dist/esm/Tag.js +8 -9
  88. package/dist/esm/TextArea.js +11 -11
  89. package/dist/esm/TimeDetail.js +8 -11
  90. package/dist/esm/TimePannel.js +8 -11
  91. package/dist/esm/TimeSelect.js +18 -21
  92. package/dist/esm/Toast.js +9 -10
  93. package/dist/esm/TrendArrow.js +8 -9
  94. package/dist/esm/Uploader.js +14 -19
  95. package/dist/esm/UserContext-ab42ba7f.js +5 -0
  96. package/dist/esm/Video.js +8 -9
  97. package/dist/esm/VirtualList.js +8 -11
  98. package/dist/esm/WaterMark.js +10 -13
  99. package/dist/esm/actionsheet.taro-d2217152.js +61 -0
  100. package/dist/esm/address.taro-1a8ab3f1.js +470 -0
  101. package/dist/esm/animate.taro-c8b29242.js +44 -0
  102. package/dist/esm/animatingnumbers.taro-c2a52dbd.js +103 -0
  103. package/dist/esm/audio.taro-bbd39f93.js +185 -0
  104. package/dist/esm/avatar.taro-01536aff.js +100 -0
  105. package/dist/esm/avatargroup-ad5ffb46.js +34 -0
  106. package/dist/esm/backtop.taro-7de36464.js +48 -0
  107. package/dist/esm/badge.taro-872605bf.js +48 -0
  108. package/dist/esm/barrage.taro-c8cb9864.js +91 -0
  109. package/dist/esm/bem-cdccae08.js +5 -0
  110. package/dist/esm/button.taro-01eae688.js +72 -0
  111. package/dist/esm/calendar.taro-10a6cb11.js +70 -0
  112. package/dist/esm/calendaritem.taro-3e5f114e.js +732 -0
  113. package/dist/esm/can-use-dom-0e539bd3.js +4 -0
  114. package/dist/esm/card.taro-2080f4d2.js +51 -0
  115. package/dist/esm/cascader.taro-fb7a0230.js +471 -0
  116. package/dist/esm/cell.taro-4e31d1fa.js +48 -0
  117. package/dist/esm/cellgroup.taro-a790d91b.js +28 -0
  118. package/dist/esm/checkbox.taro-016074da.js +177 -0
  119. package/dist/esm/circleprogress.taro-7149e09d.js +104 -0
  120. package/dist/esm/col.taro-d6a46a7d.js +41 -0
  121. package/dist/esm/collapse.taro-3d997680.js +70 -0
  122. package/dist/esm/collapseitem-f4571575.js +76 -0
  123. package/dist/esm/configprovider.taro-25758d9f.js +462 -0
  124. package/dist/esm/context-ab42ba7f.js +5 -0
  125. package/dist/esm/context-d0fccf11.js +5 -0
  126. package/dist/esm/countdown.taro-22200811.js +210 -0
  127. package/dist/esm/datepicker.taro-65dbeceb.js +260 -0
  128. package/dist/esm/dialog.taro-290eb9a6.js +128 -0
  129. package/dist/esm/divider.taro-0cb5f894.js +31 -0
  130. package/dist/esm/drag.taro-48e1ff38.js +111 -0
  131. package/dist/esm/elevator.taro-df8fde9d.js +206 -0
  132. package/dist/esm/ellipsis.taro-f9688dd7.js +242 -0
  133. package/dist/esm/empty.taro-ca792f57.js +59 -0
  134. package/dist/esm/fixednav.taro-28e5f776.js +61 -0
  135. package/dist/esm/form.taro-b06754e8.js +182 -0
  136. package/dist/esm/formitem.taro-b326809d.js +108 -0
  137. package/dist/esm/grid.taro-fbbd8618.js +52 -0
  138. package/dist/esm/griditem.taro-b0c37077.js +85 -0
  139. package/dist/esm/image.taro-767aa000.js +65 -0
  140. package/dist/esm/imagepreview.taro-daa5a84f.js +180 -0
  141. package/dist/esm/index-e3184f19.js +9 -0
  142. package/dist/esm/indicator.taro-edbc71df.js +30 -0
  143. package/dist/esm/infiniteloading.taro-f8f23ac6.js +143 -0
  144. package/dist/esm/input.taro-27d686c9.js +164 -0
  145. package/dist/esm/inputnumber.taro-6657d2c1.js +197 -0
  146. package/dist/esm/layout.taro-9659a928.js +11 -0
  147. package/dist/esm/menu.taro-cd0fef41.js +122 -0
  148. package/dist/esm/menuitem.taro-6076bffa.js +142 -0
  149. package/dist/esm/navbar.taro-5e1a0835.js +61 -0
  150. package/dist/esm/noticebar.taro-2f02b2ad.js +369 -0
  151. package/dist/esm/notify.taro-5768403d.js +75 -0
  152. package/dist/esm/numberkeyboard.taro-ad8afaf9.js +136 -0
  153. package/dist/esm/nutui-react.es.js +206 -118
  154. package/dist/esm/offsetContext-f32a9246.js +5 -0
  155. package/dist/esm/overlay.taro-75012bd3.js +77 -0
  156. package/dist/esm/pagination.taro-63607c3b.js +94 -0
  157. package/dist/esm/picker.taro-0570ec32.js +481 -0
  158. package/dist/esm/popover.taro-ad483372.js +162 -0
  159. package/dist/esm/popup.taro-e756f3fc.js +150 -0
  160. package/dist/esm/price.taro-479f1b82.js +80 -0
  161. package/dist/esm/progress.taro-437b9f6a.js +66 -0
  162. package/dist/esm/pulltorefresh.taro-6afe4805.js +138 -0
  163. package/dist/esm/radio.taro-5d6ca4ad.js +153 -0
  164. package/dist/esm/range.taro-615e193a.js +259 -0
  165. package/dist/esm/rate.taro-78c66969.js +77 -0
  166. package/dist/esm/row.taro-8b7febd4.js +48 -0
  167. package/dist/esm/searchbar.taro-37ade36e.js +159 -0
  168. package/dist/esm/shortpassword.taro-f7292032.js +146 -0
  169. package/dist/esm/sidenavbar.taro-9f210df4.js +51 -0
  170. package/dist/esm/sidenavbaritem.taro-32a45ce6.js +12 -0
  171. package/dist/esm/signature.taro-c57469aa.js +146 -0
  172. package/dist/esm/skeleton.taro-9ff9baf4.js +71 -0
  173. package/dist/esm/step.taro-2f55e4f2.js +63 -0
  174. package/dist/esm/steps.taro-196c1f59.js +31 -0
  175. package/dist/esm/sticky.taro-f8ae8d5e.js +154 -0
  176. package/dist/esm/subsidenavbar.taro-abe07673.js +64 -0
  177. package/dist/esm/swipe.taro-de80fcd8.js +180 -0
  178. package/dist/esm/swiper.taro-4aeb8526.js +86 -0
  179. package/dist/esm/swiperitem.taro-ef7342e8.js +14 -0
  180. package/dist/esm/switch.taro-f0da73a3.js +44 -0
  181. package/dist/esm/tabbar.taro-18eee41f.js +55 -0
  182. package/dist/esm/tabbaritem.taro-89646ca1.js +47 -0
  183. package/dist/esm/table.taro-15a55c5d.js +100 -0
  184. package/dist/esm/tabpane.taro-f8d92ece.js +21 -0
  185. package/dist/esm/tabs.taro-66164782.js +146 -0
  186. package/dist/esm/tag.taro-1b4134a5.js +92 -0
  187. package/dist/esm/textarea.taro-c110565e.js +102 -0
  188. package/dist/esm/timedetail.taro-8d2acbbf.js +41 -0
  189. package/dist/esm/timepannel.taro-ee4c5dfa.js +22 -0
  190. package/dist/esm/timeselect.taro-069deedd.js +133 -0
  191. package/dist/esm/toast.taro-92c10e1d.js +114 -0
  192. package/dist/esm/trendarrow.taro-0cf43935.js +72 -0
  193. package/dist/esm/typings-11d83a22.js +7 -0
  194. package/dist/esm/uploader.taro-7e38fc37.js +519 -0
  195. package/dist/esm/use-client-rect-f317804e.js +10 -0
  196. package/dist/esm/use-props-value-7ac1b1b5.js +16 -0
  197. package/dist/esm/use-touch-ff43512c.js +69 -0
  198. package/dist/esm/video-5d106e33.js +73 -0
  199. package/dist/esm/virtuallist.taro-99f03769.js +195 -0
  200. package/dist/esm/watermark.taro-cef29c03.js +109 -0
  201. package/dist/locales/base.js +1 -1
  202. package/dist/locales/en-US.js +1 -1
  203. package/dist/locales/id-ID.js +1 -1
  204. package/dist/locales/zh-CN.js +1 -1
  205. package/dist/locales/zh-TW.js +1 -1
  206. package/dist/locales/zh-UG.js +1 -1
  207. package/dist/nutui.react.mjs +16971 -22628
  208. package/dist/nutui.react.umd.js +17158 -22831
  209. package/dist/packages/badge/badge.scss +8 -18
  210. package/dist/packages/cascader/cascader.scss +0 -26
  211. package/dist/packages/cellgroup/cellgroup.scss +20 -16
  212. package/dist/packages/checkbox/checkbox.scss +8 -11
  213. package/dist/packages/circleprogress/circleprogress.scss +0 -9
  214. package/dist/packages/dialog/dialog.scss +36 -65
  215. package/dist/packages/elevator/elevator.scss +2 -28
  216. package/dist/packages/empty/empty.scss +0 -9
  217. package/dist/packages/imagepreview/imagepreview.scss +52 -16
  218. package/dist/packages/input/input.scss +13 -180
  219. package/dist/packages/menu/menu.scss +44 -55
  220. package/dist/packages/menuitem/menuitem.scss +16 -26
  221. package/dist/packages/navbar/navbar.scss +16 -115
  222. package/dist/packages/noticebar/noticebar.scss +18 -19
  223. package/dist/packages/notify/notify.scss +1 -1
  224. package/dist/packages/numberkeyboard/numberkeyboard.scss +29 -77
  225. package/dist/packages/overlay/overlay.scss +11 -4
  226. package/dist/packages/picker/picker.scss +66 -137
  227. package/dist/packages/price/price.scss +8 -0
  228. package/dist/packages/progress/progress.scss +19 -58
  229. package/dist/packages/pulltorefresh/pulltorefresh.scss +0 -8
  230. package/dist/packages/radio/radio.scss +13 -32
  231. package/dist/packages/radiogroup/radiogroup.scss +17 -51
  232. package/dist/packages/range/range.scss +24 -49
  233. package/dist/packages/step/step.scss +9 -62
  234. package/dist/packages/steps/steps.scss +2 -0
  235. package/dist/packages/swiper/swiper.scss +3 -18
  236. package/dist/packages/switch/switch.scss +13 -31
  237. package/dist/packages/tabbar/tabbar.scss +16 -22
  238. package/dist/packages/tabbaritem/tabbaritem.scss +9 -70
  239. package/dist/packages/table/table.scss +0 -56
  240. package/dist/packages/tabs/tabs.scss +196 -225
  241. package/dist/packages/textarea/textarea.scss +5 -12
  242. package/dist/style.css +1 -1
  243. package/dist/style.mjs +1 -1
  244. package/dist/styles/themes/default.scss +17 -18
  245. package/dist/styles/variables-jmapp.scss +120 -240
  246. package/dist/styles/variables.scss +139 -252
  247. package/dist/types/index.d.ts +556 -704
  248. package/package.json +2 -2
  249. package/dist/esm/AvatarContext-c96afdcc.js +0 -5
  250. package/dist/esm/Icon.js +0 -64
  251. package/dist/esm/UserContext-0aac9a82.js +0 -5
  252. package/dist/esm/UserContext-e402e1a6.js +0 -5
  253. package/dist/esm/UserContext-e8176108.js +0 -5
  254. package/dist/esm/actionsheet.taro-10cc53ee.js +0 -53
  255. package/dist/esm/address.taro-632ca799.js +0 -461
  256. package/dist/esm/animate.taro-fb7986d6.js +0 -40
  257. package/dist/esm/animatingnumbers.taro-03e5d61d.js +0 -104
  258. package/dist/esm/audio.taro-f672a68c.js +0 -162
  259. package/dist/esm/avatar.taro-de157a1f.js +0 -105
  260. package/dist/esm/avatargroup-b476ac68.js +0 -34
  261. package/dist/esm/backtop.taro-ba271b8f.js +0 -52
  262. package/dist/esm/badge.taro-ae154f41.js +0 -50
  263. package/dist/esm/barrage.taro-80df08d3.js +0 -94
  264. package/dist/esm/bem-350c1702.js +0 -5
  265. package/dist/esm/button.taro-a1c9512f.js +0 -65
  266. package/dist/esm/calendar.taro-099cb4a2.js +0 -65
  267. package/dist/esm/calendaritem.taro-ae167e59.js +0 -787
  268. package/dist/esm/can-use-dom-3eeb5af4.js +0 -6
  269. package/dist/esm/card.taro-5e9b34c8.js +0 -33
  270. package/dist/esm/cascader.taro-62e764a7.js +0 -447
  271. package/dist/esm/cell.taro-26870740.js +0 -43
  272. package/dist/esm/cellgroup.taro-6e901b54.js +0 -24
  273. package/dist/esm/checkbox.taro-785c528b.js +0 -168
  274. package/dist/esm/circleprogress.taro-79854448.js +0 -109
  275. package/dist/esm/col.taro-a99a9171.js +0 -43
  276. package/dist/esm/collapse.taro-35a8a0d6.js +0 -79
  277. package/dist/esm/collapseitem-690eb91c.js +0 -68
  278. package/dist/esm/configprovider-9960f0fb.js +0 -19
  279. package/dist/esm/configprovider.taro-c8c54556.js +0 -45
  280. package/dist/esm/countdown.taro-0e6bf7a2.js +0 -225
  281. package/dist/esm/datepicker.taro-0f2bcf42.js +0 -275
  282. package/dist/esm/dialog.taro-00ac41fd.js +0 -118
  283. package/dist/esm/divider.taro-6c1657ce.js +0 -31
  284. package/dist/esm/drag.taro-79bb8744.js +0 -110
  285. package/dist/esm/elevator.taro-81a11ecc.js +0 -178
  286. package/dist/esm/ellipsis.taro-b6cda065.js +0 -241
  287. package/dist/esm/empty.taro-fde835ca.js +0 -62
  288. package/dist/esm/fixednav.taro-39fbd47a.js +0 -54
  289. package/dist/esm/form.taro-0d83f1e8.js +0 -179
  290. package/dist/esm/formitem.taro-0de07d1e.js +0 -89
  291. package/dist/esm/get-scroll-parent-b4a07e65.js +0 -25
  292. package/dist/esm/grid.taro-3797169c.js +0 -49
  293. package/dist/esm/griditem.taro-04f59ae1.js +0 -80
  294. package/dist/esm/image.taro-edb572bb.js +0 -64
  295. package/dist/esm/imagepreview.taro-b88fcf41.js +0 -167
  296. package/dist/esm/index-5bcb0ff8.js +0 -7
  297. package/dist/esm/indicator.taro-c10334e8.js +0 -30
  298. package/dist/esm/infiniteloading.taro-73c9b8ca.js +0 -141
  299. package/dist/esm/input.taro-10ed5500.js +0 -237
  300. package/dist/esm/inputnumber.taro-108c4784.js +0 -199
  301. package/dist/esm/layout.taro-9046d093.js +0 -11
  302. package/dist/esm/menu.taro-54951911.js +0 -98
  303. package/dist/esm/menuitem.taro-86a6bb6c.js +0 -128
  304. package/dist/esm/navbar.taro-69f47d51.js +0 -77
  305. package/dist/esm/noticebar.taro-49e7441f.js +0 -427
  306. package/dist/esm/notify.taro-e17c6f82.js +0 -75
  307. package/dist/esm/numberkeyboard.taro-ed9b2149.js +0 -159
  308. package/dist/esm/offsetContext-c2a746fa.js +0 -5
  309. package/dist/esm/overlay.taro-ad0d4775.js +0 -75
  310. package/dist/esm/pagination.taro-60b22b27.js +0 -91
  311. package/dist/esm/picker.taro-5028afcb.js +0 -423
  312. package/dist/esm/popover.taro-2a57eae4.js +0 -153
  313. package/dist/esm/popup.taro-020bf791.js +0 -139
  314. package/dist/esm/price.taro-776ed16e.js +0 -83
  315. package/dist/esm/progress.taro-24392ef3.js +0 -88
  316. package/dist/esm/pulltorefresh.taro-d5fcfcb0.js +0 -181
  317. package/dist/esm/radio.taro-51e10152.js +0 -177
  318. package/dist/esm/range.taro-7a2b6ca1.js +0 -332
  319. package/dist/esm/rate.taro-57341aa9.js +0 -77
  320. package/dist/esm/row.taro-75039d53.js +0 -48
  321. package/dist/esm/searchbar.taro-eef468bb.js +0 -152
  322. package/dist/esm/shortpassword.taro-681a33a1.js +0 -119
  323. package/dist/esm/sidenavbar.taro-d5c5b331.js +0 -33
  324. package/dist/esm/sidenavbaritem.taro-bb80dbf4.js +0 -12
  325. package/dist/esm/signature.taro-f01b2b05.js +0 -143
  326. package/dist/esm/skeleton.taro-64e858a2.js +0 -62
  327. package/dist/esm/step.taro-2ec1f283.js +0 -58
  328. package/dist/esm/steps.taro-c82d2252.js +0 -30
  329. package/dist/esm/sticky.taro-b5bde7b1.js +0 -136
  330. package/dist/esm/subsidenavbar.taro-3cce8442.js +0 -63
  331. package/dist/esm/supports-passive-c85ef996.js +0 -18
  332. package/dist/esm/swipe.taro-350c9a94.js +0 -177
  333. package/dist/esm/swiper.taro-7a94e211.js +0 -451
  334. package/dist/esm/swiperitem-c9e3d0d5.js +0 -29
  335. package/dist/esm/switch.taro-34ca8228.js +0 -50
  336. package/dist/esm/tabbar.taro-9acfc2fa.js +0 -59
  337. package/dist/esm/tabbaritem.taro-42ba353f.js +0 -55
  338. package/dist/esm/table.taro-3946697c.js +0 -95
  339. package/dist/esm/tabpane.taro-4ca340ef.js +0 -23
  340. package/dist/esm/tabs.taro-be8cacb5.js +0 -140
  341. package/dist/esm/tag.taro-0c2567de.js +0 -92
  342. package/dist/esm/textarea.taro-a0f79515.js +0 -94
  343. package/dist/esm/timedetail.taro-fce4e614.js +0 -44
  344. package/dist/esm/timepannel.taro-fd3d008d.js +0 -22
  345. package/dist/esm/timeselect.taro-a4b86771.js +0 -133
  346. package/dist/esm/toast.taro-e4f44812.js +0 -108
  347. package/dist/esm/trendarrow.taro-7cf90def.js +0 -70
  348. package/dist/esm/typings-d8491423.js +0 -6
  349. package/dist/esm/uploader.taro-2151eec6.js +0 -494
  350. package/dist/esm/use-client-rect-1f8ed1fe.js +0 -18
  351. package/dist/esm/use-props-value-ae7ee726.js +0 -15
  352. package/dist/esm/use-touch-db24bb5c.js +0 -69
  353. package/dist/esm/video-7ed508cc.js +0 -67
  354. package/dist/esm/virtuallist.taro-35b9bd9a.js +0 -214
  355. package/dist/esm/watermark.taro-c780d360.js +0 -114
  356. package/dist/esm/zh-CN-b4f493ba.js +0 -131
  357. package/dist/packages/icon/icon.scss +0 -0
@@ -1,104 +0,0 @@
1
- import React__default, { useRef, useState, useEffect, Component } from 'react';
2
- import { createSelectorQuery } from '@tarojs/taro';
3
- import { c as cn } from './bem-350c1702.js';
4
-
5
- const defaultProps$1 = {
6
- maxLen: 0,
7
- endNumber: '',
8
- delaySpeed: 300,
9
- easeSpeed: 1,
10
- thousands: false,
11
- className: '',
12
- };
13
- const CountUp = (props) => {
14
- const { maxLen, endNumber, delaySpeed, easeSpeed, className, thousands, ...reset } = {
15
- ...defaultProps$1,
16
- ...props,
17
- };
18
- const b = cn('countup');
19
- const countupRef = useRef(null);
20
- const timerRef = useRef(0);
21
- const numbers = Array.from({ length: 10 }, (v, i) => i);
22
- const getShowNumber = () => {
23
- const splitArr = endNumber.split('.');
24
- const intNumber = maxLen && splitArr[0].length < maxLen
25
- ? (Array(maxLen).join('0') + splitArr[0]).slice(-maxLen)
26
- : splitArr[0];
27
- const currNumber = `${thousands ? intNumber.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') : intNumber}${splitArr[1] ? '.' : ''}${splitArr[1] || ''}`;
28
- return currNumber.split('');
29
- };
30
- const [numerArr, setNumerArr] = useState([]);
31
- const [transformArr, setTransformArr] = useState([]);
32
- const isLoaded = useRef(false);
33
- const setNumberTransform = () => {
34
- if (countupRef.current && numerArr.length) {
35
- createSelectorQuery()
36
- .selectAll('.nut-countup__listitem')
37
- .node((numberItems) => {
38
- const transformArrCache = [];
39
- Object.keys(numberItems).forEach((key) => {
40
- const elem = numberItems[Number(key)];
41
- const idx = Number(numerArr[Number(key)]);
42
- if (elem) {
43
- // 计算规则:父元素和实际列表高度的百分比,分割成20等份
44
- const transform = idx || idx === 0
45
- ? `translate(0, -${(idx === 0 ? 10 : idx) * 5}%)`
46
- : '';
47
- transformArrCache.push(transform);
48
- }
49
- });
50
- setTransformArr([...transformArrCache]);
51
- })
52
- .exec();
53
- }
54
- };
55
- const numberEaseStyle = (idx) => {
56
- return {
57
- transition: `transform ${easeSpeed}s ease-in-out`,
58
- transform: transformArr[idx] ? transformArr[idx] : null,
59
- };
60
- };
61
- useEffect(() => {
62
- setNumberTransform();
63
- }, [numerArr]);
64
- useEffect(() => {
65
- if (!isLoaded.current) {
66
- isLoaded.current = true;
67
- timerRef.current = window.setTimeout(() => {
68
- setNumerArr(getShowNumber());
69
- }, delaySpeed);
70
- }
71
- else {
72
- setNumerArr(getShowNumber());
73
- }
74
- return () => {
75
- window.clearTimeout(timerRef.current);
76
- };
77
- }, [endNumber]);
78
- return (React__default.createElement("div", { className: `${b()} ${className}`, ref: countupRef },
79
- React__default.createElement("ul", { className: b('list') }, numerArr.map((item, idx) => {
80
- return (React__default.createElement("li", { className: `${b('listitem', {
81
- number: !Number.isNaN(Number(item)),
82
- })}`, key: idx }, !Number.isNaN(Number(item)) ? (React__default.createElement("span", { className: b('number'), style: numberEaseStyle(idx) }, [...numbers, ...numbers].map((number, subidx) => {
83
- return React__default.createElement("span", { key: subidx }, number);
84
- }))) : (React__default.createElement("span", { className: b('separator') }, item))));
85
- }))));
86
- };
87
- CountUp.defaultProps = defaultProps$1;
88
- CountUp.displayName = 'NutCountUp';
89
-
90
- const defaultProps = {};
91
- class AnimatingNumbers extends Component {
92
- static defaultProps = defaultProps;
93
- static displayName = 'NutAnimatingNumbers';
94
- static CountUp = CountUp;
95
- constructor(props) {
96
- super(props);
97
- this.state = {};
98
- }
99
- render() {
100
- return React__default.createElement("div", { className: "nut-animatingnumbers" });
101
- }
102
- }
103
-
104
- export { AnimatingNumbers as A };
@@ -1,162 +0,0 @@
1
- import React__default, { useState, useRef } from 'react';
2
- import { createInnerAudioContext } from '@tarojs/taro';
3
- import { Service } from '@nutui/icons-react-taro';
4
- import { R as Range } from './range.taro-7a2b6ca1.js';
5
- import { B as Button } from './button.taro-a1c9512f.js';
6
- import { c as cn } from './bem-350c1702.js';
7
- import { u as useConfig } from './configprovider.taro-c8c54556.js';
8
- import { C as ComponentDefaults } from './typings-d8491423.js';
9
-
10
- const b = cn('audio');
11
- const warn = console.warn;
12
- const defaultProps = {
13
- ...ComponentDefaults,
14
- className: '',
15
- url: '',
16
- style: {},
17
- autoplay: false,
18
- loop: false,
19
- type: 'progress',
20
- onFastBack: (ctx) => { },
21
- onForward: (ctx) => { },
22
- onPause: (ctx) => { },
23
- onPlay: (ctx) => { },
24
- onPlayEnd: (ctx) => { },
25
- onCanPlay: (ctx) => { },
26
- };
27
- const Audio = (props) => {
28
- const { locale } = useConfig();
29
- const { className, url, style, autoplay, loop, type, onFastBack, onForward, onPause, onPlay, onPlayEnd, onCanPlay, children, iconClassPrefix, iconFontClassName, ...rest } = {
30
- ...defaultProps,
31
- ...props,
32
- };
33
- const [playing, setPlaying] = useState(false);
34
- const [totalSeconds, setTotalSeconds] = useState(0);
35
- const [percent, setPercent] = useState(0);
36
- const [isCanPlay, setIsCanPlay] = useState(false);
37
- const [currentDuration, setCurrentDuration] = useState('00:00:00');
38
- const statusRef = useRef({
39
- currentTime: 0,
40
- currentDuration: '00:00:00',
41
- percent: 0,
42
- });
43
- const audioRef = useRef(createInnerAudioContext());
44
- const audioCtx = audioRef.current;
45
- audioCtx.src = url;
46
- audioCtx.autoplay = autoplay || false;
47
- audioCtx.loop = loop || false;
48
- audioCtx.onPause(() => {
49
- props.onPause && props.onPause(audioCtx);
50
- });
51
- audioCtx.onEnded(() => {
52
- if (props.loop) {
53
- warn(locale.audio.tips || 'onPlayEnd事件在loop=false时才会触发');
54
- }
55
- else {
56
- props.onPlayEnd && props.onPlayEnd(audioCtx);
57
- }
58
- });
59
- audioCtx.onPlay(() => {
60
- const { duration } = audioCtx;
61
- setTotalSeconds(Math.floor(duration));
62
- props.onPlay && props.onPlay(audioCtx);
63
- });
64
- audioCtx.onCanplay(() => {
65
- const intervalID = setInterval(function () {
66
- if (audioCtx.duration !== 0) {
67
- setTotalSeconds(audioCtx.duration);
68
- clearInterval(intervalID);
69
- }
70
- }, 500);
71
- setIsCanPlay(true);
72
- props.onCanPlay && props.onCanPlay(audioCtx);
73
- });
74
- audioCtx.onTimeUpdate(() => {
75
- const time = parseInt(`${audioCtx.currentTime}`);
76
- const formated = formatSeconds(`${time}`);
77
- statusRef.current.currentDuration = formated;
78
- setPercent((time / totalSeconds) * 100);
79
- setCurrentDuration(formatSeconds(audioCtx.currentTime.toString()));
80
- });
81
- audioCtx.onError((res) => {
82
- console.log('code', res.errCode);
83
- console.log('message', res.errMsg);
84
- });
85
- function formatSeconds(value) {
86
- if (!value) {
87
- return '00:00:00';
88
- }
89
- const time = parseInt(value);
90
- const hours = Math.floor(time / 3600);
91
- const minutes = Math.floor((time - hours * 3600) / 60);
92
- const secondss = time - hours * 3600 - minutes * 60;
93
- let result = '';
94
- result += `${`0${hours.toString()}`.slice(-2)}:`;
95
- result += `${`0${minutes.toString()}`.slice(-2)}:`;
96
- result += `0${secondss.toString()}`.slice(-2);
97
- return result;
98
- }
99
- const handleBack = () => {
100
- const currentTime = Math.floor(audioCtx.currentTime);
101
- statusRef.current.currentTime = Math.max(currentTime - 1, 0);
102
- setCurrentDuration(formatSeconds(statusRef.current.currentTime.toString()));
103
- audioCtx.seek(statusRef.current.currentTime);
104
- props.onFastBack && props.onFastBack(audioCtx);
105
- };
106
- const handleForward = () => {
107
- const currentTime = Math.floor(audioCtx.currentTime);
108
- statusRef.current.currentTime = Math.min(currentTime + 1, audioCtx.duration);
109
- setCurrentDuration(formatSeconds(statusRef.current.currentTime.toString()));
110
- audioCtx.seek(statusRef.current.currentTime);
111
- props.onForward && props.onForward(audioCtx);
112
- };
113
- const handleStatusChange = () => {
114
- setPlaying(!playing);
115
- if (!playing) {
116
- audioCtx.play();
117
- }
118
- else {
119
- audioCtx.pause();
120
- }
121
- };
122
- const renderIcon = () => {
123
- return (React__default.createElement(React__default.Fragment, null,
124
- React__default.createElement("div", { className: b('icon') },
125
- React__default.createElement("div", { className: `${b('icon-box')} ${playing ? b('icon-play') : b('icon-stop')}`, onClick: handleStatusChange },
126
- React__default.createElement(Service, { className: playing ? 'nut-icon-loading' : '' })))));
127
- };
128
- const renderProgerss = () => {
129
- return (React__default.createElement(React__default.Fragment, null,
130
- React__default.createElement("div", { className: b('progress') },
131
- React__default.createElement("div", { className: "time" }, currentDuration),
132
- React__default.createElement("div", { className: b('progress-bar-wrapper') },
133
- React__default.createElement(Range, { modelValue: percent, hiddenTag: true, hiddenRange: true, "inactive-color": "#cccccc", "active-color": "#fa2c19" })),
134
- React__default.createElement("div", { className: "time" }, formatSeconds(`${totalSeconds}`) || '00:00:00')),
135
- React__default.createElement("div", { className: isCanPlay ? 'custom-button-group' : 'custom-button-group-disable' },
136
- React__default.createElement(Button, { type: "primary", size: "small", className: "back", onClick: handleBack }, locale.audio.back || '快退'),
137
- React__default.createElement(Button, { type: "primary", size: "small", className: "start", onClick: handleStatusChange }, playing
138
- ? `${locale.audio.pause || '暂停'}`
139
- : `${locale.audio.start || '开始'}`),
140
- React__default.createElement(Button, { type: "primary", size: "small", onClick: handleForward }, locale.audio.forward || '快进'))));
141
- };
142
- const renderNone = () => {
143
- return (React__default.createElement("div", { className: b('none-container'), onClick: handleStatusChange }, children));
144
- };
145
- const renderAudio = () => {
146
- switch (type) {
147
- case 'icon':
148
- return renderIcon();
149
- case 'progress':
150
- return renderProgerss();
151
- case 'none':
152
- return renderNone();
153
- default:
154
- return null;
155
- }
156
- };
157
- return (React__default.createElement("div", { className: `${b()} ${className}`, style: style, ...rest }, renderAudio()));
158
- };
159
- Audio.defaultProps = defaultProps;
160
- Audio.displayName = 'NutAudio';
161
-
162
- export { Audio as A };
@@ -1,105 +0,0 @@
1
- import React__default, { useState, useRef, useContext, useEffect } from 'react';
2
- import classNames from 'classnames';
3
- import { Image } from '@tarojs/components';
4
- import { A as AvatarContext } from './AvatarContext-c96afdcc.js';
5
- import { c as cn } from './bem-350c1702.js';
6
- import { C as ComponentDefaults } from './typings-d8491423.js';
7
-
8
- const defaultProps = {
9
- ...ComponentDefaults,
10
- size: '',
11
- icon: '',
12
- bgColor: '#eee',
13
- color: '#666',
14
- prefixCls: 'nut-avatar',
15
- url: '',
16
- };
17
- const Avatar = (props) => {
18
- const { children, prefixCls, size, shape, bgColor, color, url, icon, className, style, activeAvatar, onActiveAvatar, onError, ...rest } = {
19
- ...defaultProps,
20
- ...props,
21
- };
22
- const [maxSum, setMaxSum] = useState(0); // avatarGroup里的avatar的个数
23
- const [showMax, setShowMax] = useState(false); // 是否显示的最大头像个数
24
- const [avatarIndex, setAvatarIndex] = useState(1); // avatar的索引
25
- const avatarRef = useRef(null);
26
- const parent = useContext(AvatarContext);
27
- const b = cn('avatar');
28
- const classes = classNames({
29
- [`nut-avatar-${size || parent?.propAvatarGroup?.size || 'normal'}`]: true,
30
- [`nut-avatar-${shape || parent?.propAvatarGroup?.shape || 'round'}`]: true,
31
- });
32
- const cls = classNames(b(''), classes, className);
33
- const sizeValue = ['large', 'normal', 'small'];
34
- const styles = {
35
- width: sizeValue.indexOf(size) > -1 ? '' : `${size}px`,
36
- height: sizeValue.indexOf(size) > -1 ? '' : `${size}px`,
37
- backgroundColor: `${bgColor}`,
38
- color: `${color}`,
39
- marginLeft: avatarIndex !== 1 && parent?.propAvatarGroup?.span
40
- ? `${parent?.propAvatarGroup?.span}px`
41
- : '',
42
- zIndex: parent?.propAvatarGroup?.zIndex === 'right'
43
- ? `${Math.abs(maxSum - avatarIndex)}`
44
- : '',
45
- ...style,
46
- };
47
- const maxStyles = {
48
- backgroundColor: `${parent?.propAvatarGroup?.maxBgColor}`,
49
- color: `${parent?.propAvatarGroup?.maxColor}`,
50
- };
51
- useEffect(() => {
52
- const avatarChildren = parent?.avatarGroupRef?.current.children;
53
- if (avatarChildren) {
54
- avatarLength(avatarChildren);
55
- }
56
- }, []);
57
- const avatarLength = (children) => {
58
- for (let i = 0; i < children.length; i++) {
59
- if (children[i] &&
60
- children[i].classList &&
61
- (children[i].classList[0] === 'nut-avatar' ||
62
- children[i].classList.values().next().value === 'nut-avatar')) {
63
- children[i].setAttribute('data-index', i + 1);
64
- }
65
- }
66
- const index = avatarRef?.current?.dataset?.index;
67
- const maxCount = parent?.propAvatarGroup?.maxCount;
68
- setMaxSum(children.length);
69
- setAvatarIndex(index);
70
- if (index === children.length &&
71
- index !== maxCount &&
72
- children.length > maxCount) {
73
- setShowMax(true);
74
- }
75
- };
76
- const errorEvent = (e) => {
77
- if (props.onError) {
78
- props.onError(e);
79
- }
80
- };
81
- const clickAvatar = (e) => {
82
- activeAvatar && activeAvatar(e);
83
- onActiveAvatar && onActiveAvatar(e);
84
- };
85
- return (React__default.createElement(React__default.Fragment, null, (showMax ||
86
- !parent?.propAvatarGroup?.maxCount ||
87
- avatarIndex <= parent?.propAvatarGroup?.maxCount) && (React__default.createElement("div", { className: cls, ...rest, style: !showMax ? styles : maxStyles, onClick: clickAvatar, ref: avatarRef },
88
- (!parent?.propAvatarGroup?.maxCount ||
89
- avatarIndex <= parent?.propAvatarGroup?.maxCount) && (React__default.createElement(React__default.Fragment, null,
90
- url && (React__default.createElement(Image, { className: "avatar-img", src: url, onError: errorEvent })),
91
- React__default.isValidElement(icon)
92
- ? React__default.cloneElement(icon, {
93
- ...icon.props,
94
- className: `${icon.props.className || ''} icon`,
95
- })
96
- : null,
97
- children && React__default.createElement("span", { className: "text" }, children))),
98
- showMax && (React__default.createElement("div", { className: "text" }, parent?.propAvatarGroup?.maxContent
99
- ? parent?.propAvatarGroup?.maxContent
100
- : `+ ${avatarIndex - parent?.propAvatarGroup?.maxCount}`))))));
101
- };
102
- Avatar.defaultProps = defaultProps;
103
- Avatar.displayName = 'NutAvatar';
104
-
105
- export { Avatar as A };
@@ -1,34 +0,0 @@
1
- import React__default, { useRef } from 'react';
2
- import classNames from 'classnames';
3
- import { A as AvatarContext } from './AvatarContext-c96afdcc.js';
4
- import { c as cn } from './bem-350c1702.js';
5
- import { u as useConfig } from './configprovider-9960f0fb.js';
6
-
7
- const defaultProps = {
8
- maxContent: '',
9
- maxCount: '',
10
- maxBgColor: '#eee',
11
- maxColor: '#666',
12
- size: '',
13
- shape: '',
14
- span: '-8',
15
- zIndex: 'left',
16
- };
17
- const AvatarGroup = (props) => {
18
- useConfig();
19
- const propAvatarGroup = { ...defaultProps, ...props };
20
- const { className, style, children } = propAvatarGroup;
21
- const avatarGroupRef = useRef(null);
22
- const b = cn('avatar-group');
23
- const cls = classNames(b(''), className);
24
- const parentAvatar = {
25
- propAvatarGroup,
26
- avatarGroupRef,
27
- };
28
- return (React__default.createElement(AvatarContext.Provider, { value: parentAvatar },
29
- React__default.createElement("div", { className: cls, style: style, ref: avatarGroupRef }, children)));
30
- };
31
- AvatarGroup.defaultProps = defaultProps;
32
- AvatarGroup.displayName = 'NutAvatarGroup';
33
-
34
- export { AvatarGroup as A };
@@ -1,52 +0,0 @@
1
- import React__default, { useState } from 'react';
2
- import { usePageScroll, pageScrollTo } from '@tarojs/taro';
3
- import { Top } from '@nutui/icons-react-taro';
4
- import classNames from 'classnames';
5
- import { C as ComponentDefaults } from './typings-d8491423.js';
6
-
7
- const defaultProps = {
8
- ...ComponentDefaults,
9
- threshold: 200,
10
- zIndex: 10,
11
- duration: 1000,
12
- };
13
- const BackTop = (props) => {
14
- const { children, threshold, zIndex, className, duration, style, onClick } = {
15
- ...defaultProps,
16
- ...props,
17
- };
18
- const classPrefix = 'nut-backtop';
19
- const [backTop, SetBackTop] = useState(false);
20
- // 监听用户滑动页面事件
21
- usePageScroll((res) => {
22
- const { scrollTop } = res;
23
- scrollTop >= threshold ? SetBackTop(true) : SetBackTop(false);
24
- });
25
- // 返回顶部点击事件
26
- const goTop = (e) => {
27
- onClick && onClick(e);
28
- pageScrollTo({
29
- scrollTop: 0,
30
- duration: duration > 0 ? duration : 0,
31
- });
32
- };
33
- const styles = style
34
- ? {
35
- zIndex,
36
- ...style,
37
- }
38
- : {
39
- right: '10px',
40
- bottom: '20px',
41
- zIndex,
42
- };
43
- return (React__default.createElement("div", { className: classNames(classPrefix, className, {
44
- show: backTop,
45
- }), style: styles, onClick: (e) => {
46
- goTop(e);
47
- } }, children || React__default.createElement(Top, { width: 19, height: 19, className: "nut-backtop-main" })));
48
- };
49
- BackTop.defaultProps = defaultProps;
50
- BackTop.displayName = 'NutBackTop';
51
-
52
- export { BackTop as B };
@@ -1,50 +0,0 @@
1
- import React__default from 'react';
2
- import classNames from 'classnames';
3
- import { c as cn } from './bem-350c1702.js';
4
- import { C as ComponentDefaults } from './typings-d8491423.js';
5
-
6
- const b = cn('badge');
7
- const defaultProps = {
8
- ...ComponentDefaults,
9
- className: '',
10
- value: '',
11
- dot: false,
12
- max: 10000,
13
- top: '0',
14
- right: '0',
15
- zIndex: '0',
16
- color: '',
17
- icon: null,
18
- };
19
- const Badge = (props) => {
20
- const { className, style, children, dot, top, right, zIndex, color, icon } = {
21
- ...defaultProps,
22
- ...props,
23
- };
24
- function content() {
25
- if (dot)
26
- return undefined;
27
- const { value } = props;
28
- const { max } = props;
29
- if (typeof value === 'number' && typeof max === 'number') {
30
- return max < value ? `${max}+` : value;
31
- }
32
- return value;
33
- }
34
- const getStyle = () => {
35
- const style = {};
36
- style.top = `${Number(top) || parseFloat(top) || 0}px`;
37
- style.right = `${Number(right) || parseFloat(right) || 0}px`;
38
- style.zIndex = zIndex;
39
- style.background = color;
40
- return style;
41
- };
42
- return (React__default.createElement("div", { className: classNames(b(), className), style: style },
43
- icon && React__default.createElement("div", { className: "slot-icon" }, icon),
44
- React__default.createElement("div", null, children),
45
- React__default.createElement("div", { className: classNames({ 'is-dot': dot }, b('content'), 'sup'), style: getStyle() }, content())));
46
- };
47
- Badge.defaultProps = defaultProps;
48
- Badge.displayName = 'NutBadge';
49
-
50
- export { Badge as B };
@@ -1,94 +0,0 @@
1
- import React__default, { useState, useRef, useImperativeHandle, useEffect } from 'react';
2
- import { createSelectorQuery } from '@tarojs/taro';
3
- import classNames from 'classnames';
4
- import { c as cn } from './bem-350c1702.js';
5
-
6
- const defaultProps = {
7
- barrageList: [],
8
- frequency: 500,
9
- loop: true,
10
- speeds: 3000,
11
- rows: 3,
12
- top: 10,
13
- };
14
- const InternalBarrage = (props, ref) => {
15
- const { className, frequency, loop, barrageList, speeds, rows, top, ...restProps } = {
16
- ...defaultProps,
17
- ...props,
18
- };
19
- const [styleList, setStyleList] = useState([]);
20
- const [baItemList, setBaItemList] = useState(barrageList);
21
- const barrageListSet = useRef(barrageList);
22
- const barrageBody = useRef(null);
23
- const barrageContainer = useRef(null);
24
- const timeId = useRef(new Date().getTime());
25
- const timer = useRef(0);
26
- useRef(0);
27
- const b = cn('barrage');
28
- const classes = classNames(className, b(''), {
29
- [`nut-barrage__body${timeId.current}`]: true,
30
- });
31
- useImperativeHandle(ref, () => ({
32
- add: (word) => {
33
- barrageListSet.current = [...barrageListSet.current, word];
34
- run();
35
- },
36
- }));
37
- useEffect(() => {
38
- barrageListSet.current = [...barrageList];
39
- run();
40
- return () => {
41
- clearInterval(timer.current);
42
- };
43
- }, [barrageList]);
44
- const run = () => {
45
- setBaItemList(barrageListSet.current);
46
- barrageListSet.current.forEach((item, index) => {
47
- getNode(index);
48
- });
49
- };
50
- const getNode = (index) => {
51
- const query = createSelectorQuery();
52
- setTimeout(() => {
53
- let width = 100;
54
- query
55
- .select('.nut-barrage__body' + timeId.current)
56
- .boundingClientRect((rec) => {
57
- width = rec.width || 300;
58
- });
59
- query
60
- .select('.nut-barrage__item' + index)
61
- .boundingClientRect((recs) => {
62
- let height = recs.height;
63
- let nodeTop = (index % rows) * (height + top) + 20 + 'px';
64
- styleInfo(index, nodeTop, width);
65
- })
66
- .exec();
67
- }, 500);
68
- };
69
- const styleInfo = (index, nodeTop, width) => {
70
- let timeIndex = index - rows > 0 ? index - rows : 0;
71
- let list = styleList;
72
- let time = list[timeIndex] ? Number(list[timeIndex]['--time']) : 0;
73
- // // distance.value = '-' + (speeds / 1000) * 200 + '%';
74
- let obj = {
75
- top: nodeTop,
76
- '--time': `${frequency * index + time}`,
77
- animationDuration: `${speeds}ms`,
78
- animationIterationCount: `${loop ? 'infinite' : 1}`,
79
- animationDelay: `${frequency * index + time}ms`,
80
- '--move-distance': `-${width}px`,
81
- };
82
- list.push(obj);
83
- setStyleList([...list]);
84
- };
85
- return (React__default.createElement("div", { className: classes, ref: barrageBody, ...restProps },
86
- React__default.createElement("div", { ref: barrageContainer, className: "bContainer" }, baItemList.map((item, index) => {
87
- return (React__default.createElement("div", { className: `barrage-item nut-barrage__item${index} move`, style: styleList[index] }, item.length > 8 ? item.substr(0, 8) + '...' : item));
88
- }))));
89
- };
90
- const Barrage = React__default.forwardRef(InternalBarrage);
91
- Barrage.defaultProps = defaultProps;
92
- Barrage.displayName = 'NutBarrage';
93
-
94
- export { Barrage as B };
@@ -1,5 +0,0 @@
1
- import { withNaming } from '@bem-react/classname';
2
-
3
- const cn = withNaming({ n: 'nut-', e: '__', m: '--', v: '-' });
4
-
5
- export { cn as c };
@@ -1,65 +0,0 @@
1
- import React__default, { useCallback } from 'react';
2
- import classNames from 'classnames';
3
- import { Loading } from '@nutui/icons-react-taro';
4
- import { C as ComponentDefaults } from './typings-d8491423.js';
5
-
6
- const prefixCls = 'nut-button';
7
- const defaultProps = {
8
- ...ComponentDefaults,
9
- color: '',
10
- type: 'default',
11
- size: 'normal',
12
- shape: 'round',
13
- fill: 'solid',
14
- loading: false,
15
- disabled: false,
16
- block: false,
17
- icon: null,
18
- onClick: (e) => { },
19
- };
20
- const Button = React__default.forwardRef((props, ref) => {
21
- const { color, shape, fill, loading, disabled, type, size, block, icon, children, onClick, className, style, ...rest } = {
22
- ...defaultProps,
23
- ...props,
24
- };
25
- const getStyle = useCallback(() => {
26
- const style = {};
27
- if (props.color) {
28
- if (fill && fill === 'outline') {
29
- style.color = color;
30
- style.background = '#fff';
31
- if (!color?.includes('gradient')) {
32
- style.borderColor = color;
33
- }
34
- }
35
- else {
36
- style.color = '#fff';
37
- style.background = color;
38
- }
39
- }
40
- return style;
41
- }, [color]);
42
- const handleClick = (e) => {
43
- if (!loading && !disabled && onClick) {
44
- onClick(e);
45
- }
46
- };
47
- return (
48
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
49
- // @ts-ignore
50
- // eslint-disable-next-line react/button-has-type
51
- React__default.createElement("button", { ...rest, ref: ref, className: classNames(prefixCls, className, props.type ? `${prefixCls}--${type}` : null, props.fill ? `${prefixCls}--${fill}` : null, {
52
- [`${prefixCls}--${size}`]: size,
53
- [`${prefixCls}--${shape}`]: shape,
54
- [`${prefixCls}--block`]: block,
55
- [`${prefixCls}--disabled`]: disabled,
56
- [`${prefixCls}--loading`]: loading,
57
- }), style: { ...getStyle(), ...style }, onClick: (e) => handleClick(e) },
58
- React__default.createElement("div", { className: "nut-button__warp" },
59
- loading && React__default.createElement(Loading, { className: "nut-icon-loading" }),
60
- !loading && icon ? icon : null,
61
- children && (React__default.createElement("div", { className: icon || loading ? 'nut-button-text' : '' }, children)))));
62
- });
63
- Button.displayName = 'NutButton';
64
-
65
- export { Button as B };