@nutui/nutui-react-taro 2.0.0-alpha.4 → 2.0.0-alpha.6

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 (333) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/esm/ActionSheet.js +15 -16
  3. package/dist/esm/Address.js +19 -22
  4. package/dist/esm/Animate.js +7 -8
  5. package/dist/esm/AnimatingNumbers.js +8 -9
  6. package/dist/esm/Audio.js +17 -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 -8
  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 -19
  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 -9
  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 +21 -24
  28. package/dist/esm/Dialog.js +13 -16
  29. package/dist/esm/Divider.js +7 -8
  30. package/dist/esm/Drag.js +7 -8
  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 +19 -20
  41. package/dist/esm/Indicator.js +6 -7
  42. package/dist/esm/Infiniteloading.js +12 -15
  43. package/dist/esm/Input.js +11 -14
  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 -14
  48. package/dist/esm/NavBar.js +7 -8
  49. package/dist/esm/NoticeBar.js +11 -12
  50. package/dist/esm/Notify.js +9 -10
  51. package/dist/esm/NumberKeyboard.js +16 -19
  52. package/dist/esm/Overlay.js +8 -9
  53. package/dist/esm/Pagination.js +9 -12
  54. package/dist/esm/Picker.js +20 -23
  55. package/dist/esm/Popover.js +10 -11
  56. package/dist/esm/Popup.js +12 -13
  57. package/dist/esm/Price.js +7 -8
  58. package/dist/esm/Progress.js +7 -8
  59. package/dist/esm/PullToRefresh.js +11 -14
  60. package/dist/esm/Radio.js +9 -10
  61. package/dist/esm/RadioGroup.js +9 -10
  62. package/dist/esm/Range.js +13 -16
  63. package/dist/esm/Rate.js +9 -10
  64. package/dist/esm/Row.js +8 -9
  65. package/dist/esm/SearchBar.js +11 -14
  66. package/dist/esm/ShortPassword.js +16 -19
  67. package/dist/esm/SideNavBar.js +14 -15
  68. package/dist/esm/SideNavBarItem.js +5 -6
  69. package/dist/esm/Signature.js +13 -16
  70. package/dist/esm/Skeleton.js +14 -13
  71. package/dist/esm/Step.js +10 -11
  72. package/dist/esm/Steps.js +9 -10
  73. package/dist/esm/Sticky.js +11 -12
  74. package/dist/esm/SubSideNavBar.js +6 -7
  75. package/dist/esm/Swipe.js +11 -12
  76. package/dist/esm/Swiper.js +10 -11
  77. package/dist/esm/SwiperItem.js +9 -10
  78. package/dist/esm/Switch.js +7 -8
  79. package/dist/esm/TabPane.js +6 -7
  80. package/dist/esm/Tabbar/style/index.js +1 -1
  81. package/dist/esm/Tabbar.js +10 -11
  82. package/dist/esm/TabbarItem.js +8 -9
  83. package/dist/esm/Table.js +9 -14
  84. package/dist/esm/Tabs.js +11 -12
  85. package/dist/esm/Tag.js +8 -9
  86. package/dist/esm/TextArea.js +11 -11
  87. package/dist/esm/TimeDetail.js +8 -11
  88. package/dist/esm/TimePannel.js +8 -11
  89. package/dist/esm/TimeSelect.js +18 -21
  90. package/dist/esm/Toast.js +9 -10
  91. package/dist/esm/TrendArrow.js +8 -9
  92. package/dist/esm/Uploader.js +14 -17
  93. package/dist/esm/UserContext-735db09f.js +5 -0
  94. package/dist/esm/UserContext-ab42ba7f.js +5 -0
  95. package/dist/esm/UserContext-fde5badc.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-1c534feb.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-ec96ef80.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-a46fdf25.js +51 -0
  115. package/dist/esm/cascader.taro-a8d2148e.js +463 -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-d0fccf11.js +5 -0
  125. package/dist/esm/countdown.taro-22200811.js +210 -0
  126. package/dist/esm/datepicker.taro-3f718964.js +260 -0
  127. package/dist/esm/dialog.taro-290eb9a6.js +128 -0
  128. package/dist/esm/divider.taro-0cb5f894.js +31 -0
  129. package/dist/esm/drag.taro-48e1ff38.js +111 -0
  130. package/dist/esm/elevator.taro-bc162e4f.js +201 -0
  131. package/dist/esm/ellipsis.taro-f9688dd7.js +242 -0
  132. package/dist/esm/empty.taro-ca792f57.js +59 -0
  133. package/dist/esm/fixednav.taro-28e5f776.js +61 -0
  134. package/dist/esm/form.taro-b06754e8.js +182 -0
  135. package/dist/esm/formitem.taro-b326809d.js +108 -0
  136. package/dist/esm/get-scroll-parent-8da04f2e.js +24 -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-8832dc01.js +163 -0
  141. package/dist/esm/index-e3184f19.js +9 -0
  142. package/dist/esm/indicator.taro-f2bd212f.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-877dc947.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-b3bfd4fe.js +408 -0
  151. package/dist/esm/notify.taro-6b6eb6bf.js +82 -0
  152. package/dist/esm/numberkeyboard.taro-0a0e866a.js +183 -0
  153. package/dist/esm/nutui-react.es.js +211 -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-a5603921.js +468 -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-c4f45310.js +80 -0
  161. package/dist/esm/progress.taro-ff63be75.js +49 -0
  162. package/dist/esm/pulltorefresh.taro-c611fd92.js +179 -0
  163. package/dist/esm/radio.taro-3a54f4c8.js +152 -0
  164. package/dist/esm/range.taro-52cda918.js +325 -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-3bc01c0c.js +66 -0
  174. package/dist/esm/steps.taro-77e301ab.js +30 -0
  175. package/dist/esm/sticky.taro-3c03eb0a.js +134 -0
  176. package/dist/esm/subsidenavbar.taro-abe07673.js +64 -0
  177. package/dist/esm/supports-passive-aaaf0eff.js +17 -0
  178. package/dist/esm/swipe.taro-de80fcd8.js +180 -0
  179. package/dist/esm/swiper.taro-74cf9306.js +430 -0
  180. package/dist/esm/swiperitem-80df464a.js +29 -0
  181. package/dist/esm/switch.taro-f0da73a3.js +44 -0
  182. package/dist/esm/tabbar.taro-18eee41f.js +55 -0
  183. package/dist/esm/tabbaritem.taro-89646ca1.js +47 -0
  184. package/dist/esm/table.taro-15a55c5d.js +100 -0
  185. package/dist/esm/tabpane.taro-f8d92ece.js +21 -0
  186. package/dist/esm/tabs.taro-56e46dd3.js +137 -0
  187. package/dist/esm/tag.taro-1b4134a5.js +92 -0
  188. package/dist/esm/textarea.taro-c110565e.js +102 -0
  189. package/dist/esm/timedetail.taro-8d2acbbf.js +41 -0
  190. package/dist/esm/timepannel.taro-ee4c5dfa.js +22 -0
  191. package/dist/esm/timeselect.taro-069deedd.js +133 -0
  192. package/dist/esm/toast.taro-92c10e1d.js +114 -0
  193. package/dist/esm/trendarrow.taro-0cf43935.js +72 -0
  194. package/dist/esm/typings-11d83a22.js +7 -0
  195. package/dist/esm/uploader.taro-92977813.js +519 -0
  196. package/dist/esm/use-client-rect-f317804e.js +10 -0
  197. package/dist/esm/use-props-value-7ac1b1b5.js +16 -0
  198. package/dist/esm/use-touch-ff43512c.js +69 -0
  199. package/dist/esm/video-5d106e33.js +73 -0
  200. package/dist/esm/virtuallist.taro-99f03769.js +195 -0
  201. package/dist/esm/watermark.taro-cef29c03.js +109 -0
  202. package/dist/locales/base.js +1 -1
  203. package/dist/locales/en-US.js +1 -1
  204. package/dist/locales/id-ID.js +1 -1
  205. package/dist/locales/zh-CN.js +1 -1
  206. package/dist/locales/zh-TW.js +1 -1
  207. package/dist/locales/zh-UG.js +1 -1
  208. package/dist/nutui.react.mjs +924 -776
  209. package/dist/nutui.react.umd.js +923 -775
  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/empty/empty.scss +0 -9
  214. package/dist/packages/picker/picker.scss +66 -137
  215. package/dist/packages/tabbar/tabbar.scss +1 -0
  216. package/dist/packages/table/table.scss +0 -56
  217. package/dist/packages/textarea/textarea.scss +5 -12
  218. package/dist/style.css +1 -1
  219. package/dist/style.mjs +1 -1
  220. package/dist/styles/themes/default.scss +0 -1
  221. package/dist/styles/variables-jmapp.scss +1 -4
  222. package/dist/styles/variables.scss +2 -6
  223. package/dist/types/index.d.ts +80 -91
  224. package/package.json +1 -1
  225. package/dist/esm/AvatarContext-c96afdcc.js +0 -5
  226. package/dist/esm/Icon.js +0 -64
  227. package/dist/esm/UserContext-0aac9a82.js +0 -5
  228. package/dist/esm/UserContext-e402e1a6.js +0 -5
  229. package/dist/esm/UserContext-e8176108.js +0 -5
  230. package/dist/esm/actionsheet.taro-12cf5a3e.js +0 -53
  231. package/dist/esm/address.taro-67e32c33.js +0 -461
  232. package/dist/esm/animate.taro-485331bb.js +0 -41
  233. package/dist/esm/animatingnumbers.taro-f6eaffef.js +0 -104
  234. package/dist/esm/audio.taro-51eafc9d.js +0 -162
  235. package/dist/esm/avatar.taro-a840f345.js +0 -105
  236. package/dist/esm/avatargroup-0eadb514.js +0 -34
  237. package/dist/esm/backtop.taro-8ec80d02.js +0 -52
  238. package/dist/esm/badge.taro-e2169fbe.js +0 -45
  239. package/dist/esm/barrage.taro-aa08da6c.js +0 -94
  240. package/dist/esm/bem-350c1702.js +0 -5
  241. package/dist/esm/button.taro-b50bc217.js +0 -65
  242. package/dist/esm/calendar.taro-b3ebdc35.js +0 -65
  243. package/dist/esm/calendaritem.taro-ab1ec154.js +0 -791
  244. package/dist/esm/can-use-dom-3eeb5af4.js +0 -6
  245. package/dist/esm/card.taro-0e849e94.js +0 -33
  246. package/dist/esm/cascader.taro-467910b2.js +0 -447
  247. package/dist/esm/cell.taro-ea725a95.js +0 -43
  248. package/dist/esm/cellgroup.taro-660faffc.js +0 -24
  249. package/dist/esm/checkbox.taro-ae460d3a.js +0 -168
  250. package/dist/esm/circleprogress.taro-d4943109.js +0 -103
  251. package/dist/esm/col.taro-4477c9f7.js +0 -43
  252. package/dist/esm/collapse.taro-89bcadf2.js +0 -79
  253. package/dist/esm/collapseitem-0e228cec.js +0 -68
  254. package/dist/esm/configprovider-9960f0fb.js +0 -19
  255. package/dist/esm/configprovider.taro-43a3c646.js +0 -45
  256. package/dist/esm/countdown.taro-c14b5c1f.js +0 -225
  257. package/dist/esm/datepicker.taro-7d522ff8.js +0 -275
  258. package/dist/esm/dialog.taro-f9ca73a2.js +0 -107
  259. package/dist/esm/divider.taro-3993d7d5.js +0 -33
  260. package/dist/esm/drag.taro-347dfb84.js +0 -111
  261. package/dist/esm/elevator.taro-360a831f.js +0 -185
  262. package/dist/esm/ellipsis.taro-79044d54.js +0 -241
  263. package/dist/esm/empty.taro-f8585835.js +0 -62
  264. package/dist/esm/fixednav.taro-cca9a6df.js +0 -54
  265. package/dist/esm/form.taro-7413d868.js +0 -179
  266. package/dist/esm/formitem.taro-b550d29c.js +0 -89
  267. package/dist/esm/get-scroll-parent-b4a07e65.js +0 -25
  268. package/dist/esm/grid.taro-10eb7716.js +0 -49
  269. package/dist/esm/griditem.taro-fb15eeec.js +0 -80
  270. package/dist/esm/image.taro-b897a058.js +0 -64
  271. package/dist/esm/imagepreview.taro-d511342c.js +0 -167
  272. package/dist/esm/index-5bcb0ff8.js +0 -7
  273. package/dist/esm/indicator.taro-bfb21d45.js +0 -30
  274. package/dist/esm/infiniteloading.taro-cce53c60.js +0 -141
  275. package/dist/esm/input.taro-1aca4a45.js +0 -167
  276. package/dist/esm/inputnumber.taro-1f893d42.js +0 -199
  277. package/dist/esm/layout.taro-e4bf83cb.js +0 -11
  278. package/dist/esm/menu.taro-e5c68cb8.js +0 -111
  279. package/dist/esm/menuitem.taro-37c18382.js +0 -129
  280. package/dist/esm/navbar.taro-92bab9c4.js +0 -57
  281. package/dist/esm/noticebar.taro-cbe93c9e.js +0 -427
  282. package/dist/esm/notify.taro-f1079218.js +0 -75
  283. package/dist/esm/numberkeyboard.taro-10ab54d6.js +0 -159
  284. package/dist/esm/offsetContext-c2a746fa.js +0 -5
  285. package/dist/esm/overlay.taro-067b7202.js +0 -73
  286. package/dist/esm/pagination.taro-df441058.js +0 -91
  287. package/dist/esm/picker.taro-9f1bb6a4.js +0 -423
  288. package/dist/esm/popover.taro-84a55ff9.js +0 -153
  289. package/dist/esm/popup.taro-89cc342a.js +0 -139
  290. package/dist/esm/price.taro-959d82f2.js +0 -83
  291. package/dist/esm/progress.taro-1a7ac8a4.js +0 -40
  292. package/dist/esm/pulltorefresh.taro-37dadbc5.js +0 -181
  293. package/dist/esm/radio.taro-36438449.js +0 -177
  294. package/dist/esm/range.taro-432d20d7.js +0 -332
  295. package/dist/esm/rate.taro-895bb41c.js +0 -77
  296. package/dist/esm/row.taro-e929ec5c.js +0 -48
  297. package/dist/esm/searchbar.taro-4aa300df.js +0 -152
  298. package/dist/esm/shortpassword.taro-99645f99.js +0 -119
  299. package/dist/esm/sidenavbar.taro-f8ffb7dc.js +0 -33
  300. package/dist/esm/sidenavbaritem.taro-6cb0821e.js +0 -12
  301. package/dist/esm/signature.taro-e5ede25a.js +0 -143
  302. package/dist/esm/skeleton.taro-fabd423a.js +0 -62
  303. package/dist/esm/step.taro-7ea33a76.js +0 -58
  304. package/dist/esm/steps.taro-86753d36.js +0 -30
  305. package/dist/esm/sticky.taro-a142a5f2.js +0 -136
  306. package/dist/esm/subsidenavbar.taro-85c03291.js +0 -63
  307. package/dist/esm/supports-passive-c85ef996.js +0 -18
  308. package/dist/esm/swipe.taro-b18a73ff.js +0 -177
  309. package/dist/esm/swiper.taro-c0e9a56b.js +0 -451
  310. package/dist/esm/swiperitem-abab7606.js +0 -29
  311. package/dist/esm/switch.taro-e82809f6.js +0 -38
  312. package/dist/esm/tabbar.taro-48413fb8.js +0 -51
  313. package/dist/esm/tabbaritem.taro-5afa3562.js +0 -37
  314. package/dist/esm/table.taro-eca757f3.js +0 -95
  315. package/dist/esm/tabpane.taro-406cc0d3.js +0 -21
  316. package/dist/esm/tabs.taro-d47ccfc5.js +0 -120
  317. package/dist/esm/tag.taro-846ee805.js +0 -92
  318. package/dist/esm/textarea.taro-e256e741.js +0 -94
  319. package/dist/esm/timedetail.taro-cae362b9.js +0 -44
  320. package/dist/esm/timepannel.taro-d6f4cf80.js +0 -22
  321. package/dist/esm/timeselect.taro-804199f9.js +0 -133
  322. package/dist/esm/toast.taro-c509a870.js +0 -108
  323. package/dist/esm/trendarrow.taro-dd83ec94.js +0 -70
  324. package/dist/esm/typings-d8491423.js +0 -6
  325. package/dist/esm/uploader.taro-716f9a50.js +0 -494
  326. package/dist/esm/use-client-rect-1f8ed1fe.js +0 -18
  327. package/dist/esm/use-props-value-ae7ee726.js +0 -15
  328. package/dist/esm/use-touch-db24bb5c.js +0 -69
  329. package/dist/esm/video-1c6405b4.js +0 -67
  330. package/dist/esm/virtuallist.taro-0bd611cb.js +0 -214
  331. package/dist/esm/watermark.taro-8966896a.js +0 -114
  332. package/dist/esm/zh-CN-b4f493ba.js +0 -131
  333. package/dist/packages/icon/icon.scss +0 -0
@@ -0,0 +1,430 @@
1
+ import React, { useRef, useState, useMemo, useEffect } from "react";
2
+ import classNames from "classnames";
3
+ import { nextTick, useReady, createSelectorQuery } from "@tarojs/taro";
4
+ import { D as DataContext } from "./UserContext-735db09f.js";
5
+ import { c as cn } from "./bem-cdccae08.js";
6
+ const defaultProps = {
7
+ width: typeof window === "object" ? window.innerWidth : 375,
8
+ height: 0,
9
+ duration: 500,
10
+ initPage: 0,
11
+ autoPlay: 0,
12
+ direction: "horizontal",
13
+ paginationColor: "#fff",
14
+ paginationBgColor: "#ddd",
15
+ paginationVisible: false,
16
+ loop: true,
17
+ touchable: true,
18
+ isPreventDefault: true,
19
+ isStopPropagation: true,
20
+ isCenter: false,
21
+ className: ""
22
+ };
23
+ const DISTANCE = 5;
24
+ const Swiper = React.forwardRef((props, ref) => {
25
+ const propSwiper = { ...defaultProps, ...props };
26
+ const { children, direction, className, pageContent, onChange, initPage, paginationColor, paginationVisible, touchable, isPreventDefault, isStopPropagation, autoPlay, isCenter, ...rest } = propSwiper;
27
+ const container = useRef(null);
28
+ const innerRef = useRef(null);
29
+ const _swiper = useRef({
30
+ moving: false,
31
+ autoplayTimer: null,
32
+ width: 0,
33
+ height: 0,
34
+ offset: 0,
35
+ size: 0
36
+ });
37
+ const [refRandomId] = useState(Math.random().toString(36).slice(-8));
38
+ const isVertical = direction === "vertical";
39
+ const [rect, setRect] = useState(null);
40
+ let [active, setActive] = useState(0);
41
+ const [width, setWidth] = useState(0);
42
+ const [height, setHeight] = useState(0);
43
+ const [offset, setOffset] = useState(0);
44
+ const [childOffset, setChildOffset] = useState([]);
45
+ const [ready, setReady] = useState(false);
46
+ let size = isVertical ? height : width;
47
+ const [touch, setTouch] = useState({
48
+ startX: 0,
49
+ startY: 0,
50
+ deltaX: 0,
51
+ deltaY: 0,
52
+ offsetX: 0,
53
+ offsetY: 0,
54
+ stateDirection: "",
55
+ delta: 0,
56
+ touchTime: 0
57
+ });
58
+ const { childs, childCount } = useMemo(() => {
59
+ let childCount2 = 0;
60
+ const childs2 = React.Children.map(props.children, (child) => {
61
+ if (!React.isValidElement(child))
62
+ return null;
63
+ childCount2++;
64
+ return child;
65
+ });
66
+ return {
67
+ childs: childs2,
68
+ childCount: childCount2
69
+ };
70
+ }, [props.children]);
71
+ let trackSize = childCount * Number(size);
72
+ const parent = {
73
+ propSwiper,
74
+ size
75
+ };
76
+ const minOffset = (() => {
77
+ if (rect) {
78
+ const base = isVertical ? rect == null ? void 0 : rect.height : rect == null ? void 0 : rect.width;
79
+ return base - Number(size) * childCount;
80
+ }
81
+ return 0;
82
+ })();
83
+ const stopAutoPlay = () => {
84
+ clearTimeout(_swiper.current.autoplayTimer);
85
+ _swiper.current.autoplayTimer = null;
86
+ };
87
+ const autoplay = () => {
88
+ if (propSwiper.autoPlay <= 0 || childCount <= 1)
89
+ return;
90
+ stopAutoPlay();
91
+ _swiper.current.autoplayTimer = setTimeout(() => {
92
+ next();
93
+ autoplay();
94
+ }, Number(propSwiper.autoPlay));
95
+ };
96
+ const resettPosition = () => {
97
+ _swiper.current.moving = true;
98
+ if (active <= -1) {
99
+ move({ pace: childCount });
100
+ }
101
+ if (active >= childCount) {
102
+ move({ pace: -childCount });
103
+ }
104
+ };
105
+ const prev = () => {
106
+ resettPosition();
107
+ touchReset();
108
+ requestFrame(() => {
109
+ requestFrame(() => {
110
+ _swiper.current.moving = false;
111
+ move({
112
+ pace: -1,
113
+ isEmit: true
114
+ });
115
+ });
116
+ });
117
+ };
118
+ const next = () => {
119
+ resettPosition();
120
+ touchReset();
121
+ requestFrame(() => {
122
+ requestFrame(() => {
123
+ _swiper.current.moving = false;
124
+ move({
125
+ pace: 1,
126
+ isEmit: true
127
+ });
128
+ });
129
+ });
130
+ };
131
+ const to = (index) => {
132
+ resettPosition();
133
+ touchReset();
134
+ requestFrame(() => {
135
+ requestFrame(() => {
136
+ _swiper.current.moving = false;
137
+ let targetIndex;
138
+ if (props.loop && childCount === index) {
139
+ targetIndex = active === 0 ? 0 : index;
140
+ } else {
141
+ targetIndex = index % childCount;
142
+ }
143
+ move({
144
+ pace: targetIndex - active,
145
+ isEmit: true
146
+ });
147
+ });
148
+ });
149
+ };
150
+ const resize = () => {
151
+ init(active);
152
+ };
153
+ const move = ({ pace = 0, offset: offset2 = 0, isEmit = false, movingStatus = false }) => {
154
+ if (childCount <= 1)
155
+ return;
156
+ const targetActive = getActive(pace);
157
+ const targetOffset = getOffset(targetActive, offset2);
158
+ if (props.loop) {
159
+ if (Array.isArray(children) && children[0] && targetOffset !== minOffset) {
160
+ const rightBound = targetOffset < minOffset;
161
+ childOffset[0] = rightBound ? trackSize : 0;
162
+ }
163
+ if (Array.isArray(children) && children[childCount - 1] && targetOffset !== 0) {
164
+ const leftBound = targetOffset > 0;
165
+ childOffset[childCount - 1] = leftBound ? -trackSize : 0;
166
+ }
167
+ setChildOffset(childOffset);
168
+ }
169
+ if (isEmit && active !== targetActive) {
170
+ props.onChange && props.onChange((targetActive + childCount) % childCount);
171
+ }
172
+ active = targetActive;
173
+ setActive(targetActive);
174
+ setOffset(targetOffset);
175
+ getStyle(targetOffset);
176
+ };
177
+ const getActive = (pace) => {
178
+ if (pace) {
179
+ const _active = active + pace;
180
+ if (props.loop) {
181
+ return range(_active, -1, childCount);
182
+ }
183
+ return range(_active, 0, childCount - 1);
184
+ }
185
+ return active;
186
+ };
187
+ const getOffset = (active2, offset2 = 0) => {
188
+ let currentPosition = active2 * Number(size);
189
+ if (!props.loop) {
190
+ currentPosition = Math.min(currentPosition, -minOffset);
191
+ }
192
+ let targetOffset = offset2 - currentPosition;
193
+ if (!props.loop) {
194
+ targetOffset = range(targetOffset, minOffset, 0);
195
+ }
196
+ return targetOffset;
197
+ };
198
+ const requestFrame = (fn) => {
199
+ window.requestAnimationFrame.call(window, fn);
200
+ };
201
+ const range = (num, min, max) => {
202
+ return Math.min(Math.max(num, min), max);
203
+ };
204
+ const getDirection = (x, y) => {
205
+ if (x > y && x > DISTANCE)
206
+ return "horizontal";
207
+ if (y > x && y > DISTANCE)
208
+ return "vertical";
209
+ return "";
210
+ };
211
+ const touchReset = () => {
212
+ touch.startX = 0;
213
+ touch.startY = 0;
214
+ touch.deltaX = 0;
215
+ touch.deltaY = 0;
216
+ touch.offsetX = 0;
217
+ touch.offsetY = 0;
218
+ touch.delta = 0;
219
+ touch.stateDirection = "";
220
+ touch.touchTime = 0;
221
+ };
222
+ const touchStart = (e) => {
223
+ touchReset();
224
+ touch.startX = e.touches[0].clientX;
225
+ touch.startY = e.touches[0].clientY;
226
+ };
227
+ const touchMove = (e) => {
228
+ touch.deltaX = e.touches[0].clientX - touch.startX;
229
+ touch.deltaY = e.touches[0].clientY - touch.startY;
230
+ touch.offsetX = Math.abs(touch.deltaX);
231
+ touch.offsetY = Math.abs(touch.deltaY);
232
+ touch.delta = isVertical ? touch.deltaY : touch.deltaX;
233
+ if (!touch.stateDirection) {
234
+ touch.stateDirection = getDirection(touch.offsetX, touch.offsetY);
235
+ }
236
+ };
237
+ const b = cn("swiper");
238
+ const classes = classNames(b(""));
239
+ const contentClass = classNames({
240
+ [`${b("inner")}`]: true,
241
+ [`${b("vertical")}`]: isVertical
242
+ });
243
+ const getStyle = (moveOffset = offset) => {
244
+ const target = innerRef.current;
245
+ let _offset = 0;
246
+ if (!isCenter) {
247
+ _offset = moveOffset;
248
+ } else {
249
+ const _size = isVertical ? height : width;
250
+ const val = isVertical ? (rect == null ? void 0 : rect.height) - _size : (rect == null ? void 0 : rect.width) - _size;
251
+ _offset = moveOffset + (active === childCount - 1 && !props.loop ? -val / 2 : val / 2);
252
+ }
253
+ target.style.transitionDuration = `${_swiper.current.moving ? 0 : props.duration}ms`;
254
+ target.style[isVertical ? "height" : "width"] = `${Number(size) * childCount}px`;
255
+ target.style[isVertical ? "width" : "height"] = `${isVertical ? width : height}px`;
256
+ target.style.transform = `translate3D${!isVertical ? `(${_offset}px,0,0)` : `(0,${_offset}px,0)`}`;
257
+ };
258
+ const onTouchStart = (e) => {
259
+ if (props.isPreventDefault)
260
+ e.preventDefault();
261
+ if (props.isStopPropagation)
262
+ e.stopPropagation();
263
+ if (!props.touchable)
264
+ return;
265
+ touchStart(e);
266
+ touch.touchTime = Date.now();
267
+ stopAutoPlay();
268
+ resettPosition();
269
+ };
270
+ const onTouchMove = (e) => {
271
+ if (props.touchable && _swiper.current.moving) {
272
+ touchMove(e);
273
+ if (touch.stateDirection === props.direction) {
274
+ move({
275
+ offset: touch.delta
276
+ });
277
+ }
278
+ }
279
+ };
280
+ const onTouchEnd = (e) => {
281
+ if (!props.touchable || !_swiper.current.moving)
282
+ return;
283
+ const speed = touch.delta / (Date.now() - touch.touchTime);
284
+ const isShouldMove = Math.abs(speed) > 0.3 || Math.abs(touch.delta) > +(size / 2).toFixed(2);
285
+ let pace = 0;
286
+ _swiper.current.moving = false;
287
+ if (isShouldMove && touch.stateDirection === props.direction) {
288
+ const offset2 = isVertical ? touch.offsetY : touch.offsetX;
289
+ if (props.loop) {
290
+ if (offset2 > 0) {
291
+ pace = touch.delta > 0 ? -1 : 1;
292
+ } else {
293
+ pace = 0;
294
+ }
295
+ } else {
296
+ pace = -Math[touch.delta > 0 ? "ceil" : "floor"](touch.delta / size);
297
+ }
298
+ move({
299
+ pace,
300
+ isEmit: true
301
+ });
302
+ } else if (touch.delta) {
303
+ move({ pace: 0 });
304
+ } else {
305
+ getStyle();
306
+ }
307
+ autoplay();
308
+ };
309
+ useEffect(() => {
310
+ _swiper.current.activePagination = (active + childCount) % childCount;
311
+ }, [active]);
312
+ const queryRect = (element) => {
313
+ return new Promise((resolve) => {
314
+ const query = createSelectorQuery();
315
+ query.select(`#${element.id}`) && query.select(`#${element.id}`).boundingClientRect();
316
+ query.exec((res) => {
317
+ resolve(res[0]);
318
+ });
319
+ });
320
+ };
321
+ const init = async (active2 = +propSwiper.initPage) => {
322
+ const rect2 = await queryRect(container.current);
323
+ const _active = Math.max(Math.min(childCount - 1, active2), 0);
324
+ const _width = propSwiper.width ? +propSwiper.width : rect2 == null ? void 0 : rect2.width;
325
+ const _height = propSwiper.height ? +propSwiper.height : rect2 == null ? void 0 : rect2.height;
326
+ size = isVertical ? _height : _width;
327
+ trackSize = childCount * Number(size);
328
+ const targetOffset = getOffset(_active);
329
+ _swiper.current.moving = true;
330
+ if (ready) {
331
+ _swiper.current.moving = false;
332
+ }
333
+ setRect(rect2);
334
+ setActive(_active);
335
+ setWidth(_width);
336
+ setHeight(_height);
337
+ setOffset(targetOffset);
338
+ setReady(true);
339
+ };
340
+ useEffect(() => {
341
+ if (ready) {
342
+ getStyle();
343
+ }
344
+ }, [isVertical, width, height, offset, ready]);
345
+ useEffect(() => {
346
+ if (ready) {
347
+ stopAutoPlay();
348
+ autoplay();
349
+ }
350
+ return () => {
351
+ setReady(false);
352
+ };
353
+ }, [ready]);
354
+ useEffect(() => {
355
+ stopAutoPlay();
356
+ autoplay();
357
+ }, [children]);
358
+ useEffect(() => {
359
+ nextTick(() => {
360
+ init();
361
+ });
362
+ }, [propSwiper.initPage]);
363
+ useEffect(() => {
364
+ return () => {
365
+ stopAutoPlay();
366
+ };
367
+ }, []);
368
+ useReady(() => {
369
+ nextTick(() => {
370
+ init();
371
+ });
372
+ });
373
+ const itemStyle = (index) => {
374
+ const style = {};
375
+ const _direction = propSwiper.direction || direction;
376
+ const _size = size;
377
+ if (_size) {
378
+ style[_direction === "horizontal" ? "width" : "height"] = `${_size}px`;
379
+ }
380
+ const offset2 = childOffset[index];
381
+ if (offset2) {
382
+ style.transform = `translate3D${_direction === "horizontal" ? `(${offset2}px,0,0)` : `(0,${offset2}px,0)`}`;
383
+ }
384
+ return style;
385
+ };
386
+ React.useImperativeHandle(ref, () => ({
387
+ to,
388
+ next,
389
+ prev,
390
+ resize
391
+ }));
392
+ return React.createElement(
393
+ DataContext.Provider,
394
+ { value: parent },
395
+ React.createElement(
396
+ "div",
397
+ {
398
+ className: `${classes} ${className}`,
399
+ ref: container,
400
+ ...rest,
401
+ id: `container-${refRandomId}`,
402
+ onTouchStart,
403
+ onTouchMove,
404
+ onTouchEnd,
405
+ // @ts-ignore
406
+ catchMove: isVertical
407
+ },
408
+ React.createElement("div", { className: contentClass, ref: innerRef }, React.Children.map(childs, (child, index) => {
409
+ return React.createElement("div", { className: b("item-wrapper"), style: itemStyle(index), key: index }, child);
410
+ })),
411
+ propSwiper.paginationVisible && !("pageContent" in propSwiper) ? React.createElement("div", { className: classNames({
412
+ [`${b("pagination")}`]: true,
413
+ [`${b("pagination-vertical")}`]: isVertical
414
+ }) }, React.Children.map(childs, (item, index) => {
415
+ return React.createElement("i", { style: (active + childCount) % childCount === index ? {
416
+ backgroundColor: propSwiper.paginationColor
417
+ } : {
418
+ backgroundColor: propSwiper.paginationBgColor
419
+ }, className: classNames({
420
+ active: (active + childCount) % childCount === index
421
+ }), key: index });
422
+ })) : React.createElement("div", null, pageContent)
423
+ )
424
+ );
425
+ });
426
+ Swiper.defaultProps = defaultProps;
427
+ Swiper.displayName = "NutSwiper";
428
+ export {
429
+ Swiper as S
430
+ };
@@ -0,0 +1,29 @@
1
+ import React, { useContext } from "react";
2
+ import classNames from "classnames";
3
+ import { D as DataContext } from "./UserContext-735db09f.js";
4
+ import { c as cn } from "./bem-cdccae08.js";
5
+ const defaultProps = {
6
+ direction: "horizontal"
7
+ };
8
+ const SwiperItem = React.forwardRef((props, ref) => {
9
+ const _props = { ...defaultProps, ...props };
10
+ const { className, style, children, direction, size } = _props;
11
+ const parent = useContext(DataContext);
12
+ const b = cn("swiper-item");
13
+ const classes = classNames(b(""), className);
14
+ const getStyle = () => {
15
+ const style2 = {};
16
+ const _direction = (parent == null ? void 0 : parent.propSwiper.direction) || direction;
17
+ const _size = (parent == null ? void 0 : parent.size) || size;
18
+ if (_size) {
19
+ style2[_direction === "horizontal" ? "width" : "height"] = `${_size}px`;
20
+ }
21
+ return style2;
22
+ };
23
+ return React.createElement("div", { className: classes, style: { ...style, ...getStyle() } }, children);
24
+ });
25
+ SwiperItem.defaultProps = defaultProps;
26
+ SwiperItem.displayName = "NutSwiperItem";
27
+ export {
28
+ SwiperItem as S
29
+ };
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ import { C as ComponentDefaults } from "./typings-11d83a22.js";
3
+ import { u as usePropsValue } from "./use-props-value-7ac1b1b5.js";
4
+ const defaultProps = {
5
+ ...ComponentDefaults,
6
+ disabled: false,
7
+ activeText: "",
8
+ inactiveText: ""
9
+ };
10
+ const Switch = (props) => {
11
+ const { checked, defaultChecked, disabled, activeText, inactiveText, className, style, onChange } = {
12
+ ...defaultProps,
13
+ ...props
14
+ };
15
+ const classPrefix = "nut-switch";
16
+ const [value, setValue] = usePropsValue({
17
+ value: checked,
18
+ defaultValue: defaultChecked
19
+ });
20
+ const classes = () => {
21
+ return `${classPrefix} ${value ? "switch-open" : "switch-close"} ${disabled ? `${classPrefix}-disabled` : ""} ${`${classPrefix}-base`} ${className}`;
22
+ };
23
+ const onClick = (event) => {
24
+ if (disabled)
25
+ return;
26
+ onChange && onChange(!value, event);
27
+ setValue(!value);
28
+ };
29
+ return React.createElement(
30
+ "div",
31
+ { className: classes(), onClick: (e) => onClick(e), style },
32
+ React.createElement(
33
+ "div",
34
+ { className: "switch-button" },
35
+ !value && React.createElement("div", { className: "close-line" }),
36
+ activeText && React.createElement(React.Fragment, null, value ? React.createElement("div", { className: `${classPrefix}__label open` }, activeText) : React.createElement("div", { className: `${classPrefix}__label close` }, inactiveText))
37
+ )
38
+ );
39
+ };
40
+ Switch.defaultProps = defaultProps;
41
+ Switch.displayName = "NutSwitch";
42
+ export {
43
+ Switch as S
44
+ };
@@ -0,0 +1,55 @@
1
+ import React from "react";
2
+ import classNames from "classnames";
3
+ import { C as ComponentDefaults } from "./typings-11d83a22.js";
4
+ import { u as usePropsValue } from "./use-props-value-7ac1b1b5.js";
5
+ import { T as TabbarItem } from "./tabbaritem.taro-89646ca1.js";
6
+ const defaultProps = {
7
+ ...ComponentDefaults,
8
+ defaultValue: 0,
9
+ fixed: false,
10
+ inactiveColor: "",
11
+ activeColor: "",
12
+ safeArea: false,
13
+ onSwitch: (value) => {
14
+ }
15
+ };
16
+ const Tabbar = (props) => {
17
+ const { children, defaultValue, value, fixed, activeColor, inactiveColor, safeArea, className, style, onSwitch } = {
18
+ ...defaultProps,
19
+ ...props
20
+ };
21
+ const classPrefix = "nut-tabbar";
22
+ const [selectIndex, setSelectIndex] = usePropsValue({
23
+ value,
24
+ defaultValue,
25
+ finalValue: 0,
26
+ onChange: onSwitch
27
+ });
28
+ return React.createElement(
29
+ "div",
30
+ { className: classNames(classPrefix, className, {
31
+ [`${classPrefix}__fixed`]: fixed
32
+ }), style },
33
+ React.createElement("div", { className: `${classPrefix}__wrap` }, React.Children.map(children, (child, idx) => {
34
+ if (!React.isValidElement(child)) {
35
+ return null;
36
+ }
37
+ const childProps = {
38
+ ...child.props,
39
+ active: idx === selectIndex,
40
+ index: idx,
41
+ inactiveColor,
42
+ activeColor,
43
+ handleClick: setSelectIndex
44
+ };
45
+ return React.cloneElement(child, childProps);
46
+ })),
47
+ (fixed || safeArea) && React.createElement("div", { className: `${classPrefix}__safe-area` })
48
+ );
49
+ };
50
+ Tabbar.defaultProps = defaultProps;
51
+ Tabbar.displayName = "NutTabbar";
52
+ Tabbar.Item = TabbarItem;
53
+ export {
54
+ Tabbar as T
55
+ };
@@ -0,0 +1,47 @@
1
+ import React from "react";
2
+ import classNames from "classnames";
3
+ import { C as ComponentDefaults } from "./typings-11d83a22.js";
4
+ import { B as Badge } from "./badge.taro-872605bf.js";
5
+ const defaultProps = {
6
+ ...ComponentDefaults,
7
+ title: "",
8
+ icon: null,
9
+ active: false,
10
+ index: 0,
11
+ handleClick: (idx) => {
12
+ }
13
+ };
14
+ const TabbarItem = (props) => {
15
+ const { className, style, title, icon, active, activeColor, inactiveColor, index, handleClick, ...rest } = {
16
+ ...defaultProps,
17
+ ...props
18
+ };
19
+ const classPrefix = "nut-tabbar-item";
20
+ const tabbarItemClass = classNames(className, classPrefix, {
21
+ [`${classPrefix}-active`]: active
22
+ });
23
+ const boxPrefix = `${classPrefix}__icon-box`;
24
+ const titleClass = classNames(boxPrefix, `${boxPrefix}-nav`, {
25
+ [`${boxPrefix}-large`]: !icon
26
+ });
27
+ return React.createElement("div", { className: tabbarItemClass, style: {
28
+ color: active ? activeColor : inactiveColor,
29
+ ...style
30
+ }, onClick: () => handleClick(index) }, icon ? React.createElement(
31
+ React.Fragment,
32
+ null,
33
+ React.createElement(
34
+ Badge,
35
+ { ...rest },
36
+ React.createElement("div", { className: boxPrefix }, icon)
37
+ ),
38
+ React.createElement("div", { className: titleClass }, title)
39
+ ) : React.createElement(
40
+ Badge,
41
+ { ...rest },
42
+ React.createElement("div", { className: titleClass }, title)
43
+ ));
44
+ };
45
+ export {
46
+ TabbarItem as T
47
+ };
@@ -0,0 +1,100 @@
1
+ import React, { useState, useEffect } from "react";
2
+ import classNames from "classnames";
3
+ import { DownArrow } from "@nutui/icons-react-taro";
4
+ import { u as useConfig } from "./configprovider.taro-25758d9f.js";
5
+ import { C as ComponentDefaults } from "./typings-11d83a22.js";
6
+ const defaultProps = {
7
+ ...ComponentDefaults,
8
+ columns: [],
9
+ data: [],
10
+ bordered: true,
11
+ striped: false,
12
+ noData: "",
13
+ sorterIcon: null,
14
+ showHeader: true
15
+ };
16
+ const Table = (props) => {
17
+ const { locale } = useConfig();
18
+ defaultProps.noData = locale.noData;
19
+ const { children, className, style, columns, data, bordered, summary, striped, noData, sorterIcon, showHeader, onSort, ...rest } = {
20
+ ...defaultProps,
21
+ ...props
22
+ };
23
+ const [curData, setCurData] = useState(data);
24
+ useEffect(() => {
25
+ if (data && String(data) !== String(curData)) {
26
+ setCurData(data);
27
+ }
28
+ }, [data]);
29
+ const classPrefix = "nut-table";
30
+ const headerClassPrefix = `${classPrefix}__main__head__tr`;
31
+ const bodyClassPrefix = `${classPrefix}__main__body__tr`;
32
+ const cls = classNames(classPrefix, className);
33
+ const handleSorterClick = (item) => {
34
+ if (item.sorter) {
35
+ onSort && onSort(item, curData);
36
+ if (typeof item.sorter === "function") {
37
+ setCurData(curData.sort(item.sorter));
38
+ } else {
39
+ setCurData(item.sorter === "default" ? curData.sort() : curData);
40
+ }
41
+ }
42
+ };
43
+ const cellClasses = (item) => {
44
+ return {
45
+ [`${headerClassPrefix}--border`]: props.bordered,
46
+ [`${headerClassPrefix}--align${item.align ? item.align : ""}`]: true
47
+ };
48
+ };
49
+ const getColumnItem = (value) => {
50
+ return columns.filter((item) => item.key === value)[0];
51
+ };
52
+ const renderHeadCells = () => {
53
+ return columns.map((item, index) => {
54
+ return React.createElement(
55
+ "span",
56
+ { className: classNames(`${headerClassPrefix}__th`, cellClasses(item)), key: item.key, onClick: () => handleSorterClick(item) },
57
+ item.title,
58
+ " ",
59
+ item.sorter && (sorterIcon || React.createElement(DownArrow, { size: "12px" }))
60
+ );
61
+ });
62
+ };
63
+ const sortDataItem = () => {
64
+ return columns.map((columns2) => {
65
+ return [columns2.key, columns2.render];
66
+ });
67
+ };
68
+ const renderBodyTds = (item) => {
69
+ return sortDataItem().map(([value, render], index) => {
70
+ return React.createElement("span", { className: classNames(`${bodyClassPrefix}__td`, cellClasses(getColumnItem(value))), key: value }, typeof item[value] === "function" || typeof render === "function" ? React.createElement("div", null, render ? render(item) : item[value](item)) : item[value]);
71
+ });
72
+ };
73
+ const renderBoyTrs = () => {
74
+ return curData.map((item, index) => {
75
+ return React.createElement("div", { className: bodyClassPrefix, key: index }, renderBodyTds(item));
76
+ });
77
+ };
78
+ return React.createElement(
79
+ "div",
80
+ { className: cls, style, ...rest },
81
+ React.createElement(
82
+ "div",
83
+ { className: classNames(`${classPrefix}__main`, {
84
+ [`${classPrefix}__main--striped`]: striped
85
+ }) },
86
+ showHeader && React.createElement(
87
+ "div",
88
+ { className: `${classPrefix}__main__head` },
89
+ React.createElement("div", { className: headerClassPrefix }, renderHeadCells())
90
+ ),
91
+ React.createElement("div", { className: `${classPrefix}__main__body` }, renderBoyTrs())
92
+ ),
93
+ (summary || curData.length === 0) && React.createElement("div", { className: `${classPrefix}__summary` }, summary || noData)
94
+ );
95
+ };
96
+ Table.defaultProps = defaultProps;
97
+ Table.displayName = "NutTable";
98
+ export {
99
+ Table as T
100
+ };