@nutui/nutui-react-taro 2.0.0-alpha.5 → 2.0.0-alpha.7

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 (323) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/esm/ActionSheet.js +15 -16
  3. package/dist/esm/Address.js +19 -20
  4. package/dist/esm/Animate.js +7 -8
  5. package/dist/esm/AnimatingNumbers.js +8 -9
  6. package/dist/esm/Audio.js +17 -19
  7. package/dist/esm/Avatar.js +11 -13
  8. package/dist/esm/AvatarGroup.js +8 -9
  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 -20
  14. package/dist/esm/CalendarItem.js +11 -13
  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 -8
  26. package/dist/esm/CountDown.js +8 -10
  27. package/dist/esm/DatePicker.js +21 -23
  28. package/dist/esm/Dialog.js +13 -15
  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 -10
  33. package/dist/esm/Empty.js +7 -9
  34. package/dist/esm/FixedNav.js +11 -13
  35. package/dist/esm/Form.js +10 -11
  36. package/dist/esm/FormItem.js +8 -9
  37. package/dist/esm/Grid.js +8 -10
  38. package/dist/esm/GridItem.js +7 -9
  39. package/dist/esm/Image.js +7 -9
  40. package/dist/esm/ImagePreview.js +19 -20
  41. package/dist/esm/Indicator.js +6 -7
  42. package/dist/esm/Infiniteloading.js +12 -14
  43. package/dist/esm/Input.js +11 -13
  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 -18
  52. package/dist/esm/Overlay.js +8 -9
  53. package/dist/esm/Pagination.js +9 -11
  54. package/dist/esm/Picker.js +20 -22
  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 -13
  60. package/dist/esm/Radio.js +9 -10
  61. package/dist/esm/RadioGroup.js +9 -10
  62. package/dist/esm/Range.js +13 -15
  63. package/dist/esm/Rate.js +9 -10
  64. package/dist/esm/Row.js +8 -9
  65. package/dist/esm/SearchBar.js +11 -13
  66. package/dist/esm/ShortPassword.js +16 -18
  67. package/dist/esm/SideNavBar.js +14 -15
  68. package/dist/esm/SideNavBarItem.js +5 -6
  69. package/dist/esm/Signature.js +13 -15
  70. package/dist/esm/Skeleton.js +14 -16
  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.js +10 -11
  81. package/dist/esm/TabbarItem.js +8 -9
  82. package/dist/esm/Table.js +9 -13
  83. package/dist/esm/Tabs.js +11 -12
  84. package/dist/esm/Tag.js +8 -9
  85. package/dist/esm/TextArea.js +11 -10
  86. package/dist/esm/TimeDetail.js +8 -10
  87. package/dist/esm/TimePannel.js +8 -10
  88. package/dist/esm/TimeSelect.js +18 -20
  89. package/dist/esm/Toast.js +9 -10
  90. package/dist/esm/TrendArrow.js +8 -9
  91. package/dist/esm/Uploader.js +14 -16
  92. package/dist/esm/UserContext-735db09f.js +5 -0
  93. package/dist/esm/UserContext-ab42ba7f.js +5 -0
  94. package/dist/esm/UserContext-fde5badc.js +5 -0
  95. package/dist/esm/Video.js +8 -9
  96. package/dist/esm/VirtualList.js +8 -10
  97. package/dist/esm/WaterMark.js +10 -12
  98. package/dist/esm/actionsheet.taro-d2217152.js +61 -0
  99. package/dist/esm/address.taro-1c534feb.js +470 -0
  100. package/dist/esm/animate.taro-c8b29242.js +44 -0
  101. package/dist/esm/animatingnumbers.taro-c2a52dbd.js +103 -0
  102. package/dist/esm/audio.taro-ec96ef80.js +185 -0
  103. package/dist/esm/avatar.taro-01536aff.js +100 -0
  104. package/dist/esm/avatargroup-ad5ffb46.js +34 -0
  105. package/dist/esm/backtop.taro-7de36464.js +48 -0
  106. package/dist/esm/badge.taro-872605bf.js +48 -0
  107. package/dist/esm/barrage.taro-c8cb9864.js +91 -0
  108. package/dist/esm/bem-cdccae08.js +5 -0
  109. package/dist/esm/button.taro-01eae688.js +72 -0
  110. package/dist/esm/calendar.taro-10a6cb11.js +70 -0
  111. package/dist/esm/calendaritem.taro-3e5f114e.js +732 -0
  112. package/dist/esm/can-use-dom-0e539bd3.js +4 -0
  113. package/dist/esm/card.taro-a46fdf25.js +51 -0
  114. package/dist/esm/cascader.taro-0a2694ed.js +463 -0
  115. package/dist/esm/cell.taro-4e31d1fa.js +48 -0
  116. package/dist/esm/cellgroup.taro-a790d91b.js +28 -0
  117. package/dist/esm/checkbox.taro-016074da.js +177 -0
  118. package/dist/esm/circleprogress.taro-7149e09d.js +104 -0
  119. package/dist/esm/col.taro-d6a46a7d.js +41 -0
  120. package/dist/esm/collapse.taro-3d997680.js +70 -0
  121. package/dist/esm/collapseitem-f4571575.js +76 -0
  122. package/dist/esm/configprovider.taro-25758d9f.js +462 -0
  123. package/dist/esm/context-d0fccf11.js +5 -0
  124. package/dist/esm/countdown.taro-22200811.js +210 -0
  125. package/dist/esm/datepicker.taro-3f718964.js +260 -0
  126. package/dist/esm/dialog.taro-290eb9a6.js +128 -0
  127. package/dist/esm/divider.taro-0cb5f894.js +31 -0
  128. package/dist/esm/drag.taro-48e1ff38.js +111 -0
  129. package/dist/esm/elevator.taro-bc162e4f.js +201 -0
  130. package/dist/esm/ellipsis.taro-f9688dd7.js +242 -0
  131. package/dist/esm/empty.taro-ca792f57.js +59 -0
  132. package/dist/esm/fixednav.taro-28e5f776.js +61 -0
  133. package/dist/esm/form.taro-b06754e8.js +182 -0
  134. package/dist/esm/formitem.taro-b326809d.js +108 -0
  135. package/dist/esm/get-scroll-parent-8da04f2e.js +24 -0
  136. package/dist/esm/grid.taro-fbbd8618.js +52 -0
  137. package/dist/esm/griditem.taro-b0c37077.js +85 -0
  138. package/dist/esm/image.taro-767aa000.js +65 -0
  139. package/dist/esm/imagepreview.taro-8832dc01.js +163 -0
  140. package/dist/esm/index-e3184f19.js +9 -0
  141. package/dist/esm/indicator.taro-f2bd212f.js +30 -0
  142. package/dist/esm/infiniteloading.taro-f8f23ac6.js +143 -0
  143. package/dist/esm/input.taro-27d686c9.js +164 -0
  144. package/dist/esm/inputnumber.taro-877dc947.js +197 -0
  145. package/dist/esm/layout.taro-9659a928.js +11 -0
  146. package/dist/esm/menu.taro-cd0fef41.js +122 -0
  147. package/dist/esm/menuitem.taro-6076bffa.js +142 -0
  148. package/dist/esm/navbar.taro-5e1a0835.js +61 -0
  149. package/dist/esm/noticebar.taro-b3bfd4fe.js +408 -0
  150. package/dist/esm/notify.taro-6b6eb6bf.js +82 -0
  151. package/dist/esm/numberkeyboard.taro-0a0e866a.js +183 -0
  152. package/dist/esm/nutui-react.es.js +211 -116
  153. package/dist/esm/offsetContext-f32a9246.js +5 -0
  154. package/dist/esm/overlay.taro-75012bd3.js +77 -0
  155. package/dist/esm/pagination.taro-63607c3b.js +94 -0
  156. package/dist/esm/picker.taro-a5603921.js +468 -0
  157. package/dist/esm/popover.taro-ad483372.js +162 -0
  158. package/dist/esm/popup.taro-e756f3fc.js +150 -0
  159. package/dist/esm/price.taro-c4f45310.js +80 -0
  160. package/dist/esm/progress.taro-ff63be75.js +49 -0
  161. package/dist/esm/pulltorefresh.taro-c611fd92.js +179 -0
  162. package/dist/esm/radio.taro-3a54f4c8.js +152 -0
  163. package/dist/esm/range.taro-52cda918.js +325 -0
  164. package/dist/esm/rate.taro-78c66969.js +77 -0
  165. package/dist/esm/row.taro-8b7febd4.js +48 -0
  166. package/dist/esm/searchbar.taro-37ade36e.js +159 -0
  167. package/dist/esm/shortpassword.taro-f7292032.js +146 -0
  168. package/dist/esm/sidenavbar.taro-9f210df4.js +51 -0
  169. package/dist/esm/sidenavbaritem.taro-32a45ce6.js +12 -0
  170. package/dist/esm/signature.taro-c57469aa.js +146 -0
  171. package/dist/esm/skeleton.taro-9ff9baf4.js +71 -0
  172. package/dist/esm/step.taro-3bc01c0c.js +66 -0
  173. package/dist/esm/steps.taro-77e301ab.js +30 -0
  174. package/dist/esm/sticky.taro-3c03eb0a.js +134 -0
  175. package/dist/esm/subsidenavbar.taro-abe07673.js +64 -0
  176. package/dist/esm/supports-passive-aaaf0eff.js +17 -0
  177. package/dist/esm/swipe.taro-de80fcd8.js +180 -0
  178. package/dist/esm/swiper.taro-74cf9306.js +430 -0
  179. package/dist/esm/swiperitem-80df464a.js +29 -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-b75f20ff.js +139 -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-92977813.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 +507 -447
  208. package/dist/nutui.react.umd.js +506 -446
  209. package/dist/packages/cascader/cascader.scss +0 -26
  210. package/dist/packages/picker/picker.scss +66 -137
  211. package/dist/packages/table/table.scss +0 -56
  212. package/dist/packages/textarea/textarea.scss +5 -12
  213. package/dist/style.css +1 -1
  214. package/dist/style.mjs +1 -1
  215. package/dist/styles/variables-jmapp.scss +1 -4
  216. package/dist/styles/variables.scss +2 -6
  217. package/dist/types/index.d.ts +42 -46
  218. package/package.json +1 -1
  219. package/dist/esm/UserContext-0aac9a82.js +0 -5
  220. package/dist/esm/UserContext-e402e1a6.js +0 -5
  221. package/dist/esm/UserContext-e8176108.js +0 -5
  222. package/dist/esm/actionsheet.taro-12cf5a3e.js +0 -53
  223. package/dist/esm/address.taro-cab0ea22.js +0 -475
  224. package/dist/esm/animate.taro-485331bb.js +0 -41
  225. package/dist/esm/animatingnumbers.taro-f6eaffef.js +0 -104
  226. package/dist/esm/audio.taro-ff280f5e.js +0 -162
  227. package/dist/esm/avatar.taro-6e8f1f5c.js +0 -107
  228. package/dist/esm/avatargroup-f4375806.js +0 -31
  229. package/dist/esm/backtop.taro-8ec80d02.js +0 -52
  230. package/dist/esm/badge.taro-e2169fbe.js +0 -45
  231. package/dist/esm/barrage.taro-aa08da6c.js +0 -94
  232. package/dist/esm/bem-350c1702.js +0 -5
  233. package/dist/esm/button.taro-b50bc217.js +0 -65
  234. package/dist/esm/calendar.taro-2fc9b899.js +0 -65
  235. package/dist/esm/calendaritem.taro-2d4a8c34.js +0 -791
  236. package/dist/esm/can-use-dom-3eeb5af4.js +0 -6
  237. package/dist/esm/card.taro-0e849e94.js +0 -33
  238. package/dist/esm/cascader.taro-467910b2.js +0 -447
  239. package/dist/esm/cell.taro-ea725a95.js +0 -43
  240. package/dist/esm/cellgroup.taro-e05ea802.js +0 -25
  241. package/dist/esm/checkbox.taro-9d02f86c.js +0 -175
  242. package/dist/esm/circleprogress.taro-d4943109.js +0 -103
  243. package/dist/esm/col.taro-4477c9f7.js +0 -43
  244. package/dist/esm/collapse.taro-89bcadf2.js +0 -79
  245. package/dist/esm/collapseitem-0e228cec.js +0 -68
  246. package/dist/esm/configprovider.taro-ce34d482.js +0 -174
  247. package/dist/esm/context-c96afdcc.js +0 -5
  248. package/dist/esm/countdown.taro-3118ba23.js +0 -225
  249. package/dist/esm/datepicker.taro-2e3e955b.js +0 -275
  250. package/dist/esm/dialog.taro-eab19eab.js +0 -107
  251. package/dist/esm/divider.taro-3993d7d5.js +0 -33
  252. package/dist/esm/drag.taro-347dfb84.js +0 -111
  253. package/dist/esm/elevator.taro-1a4e3356.js +0 -193
  254. package/dist/esm/ellipsis.taro-e1ac99a1.js +0 -244
  255. package/dist/esm/empty.taro-26363c66.js +0 -56
  256. package/dist/esm/fixednav.taro-ddb21e87.js +0 -54
  257. package/dist/esm/form.taro-423b0f0a.js +0 -179
  258. package/dist/esm/formitem.taro-b550d29c.js +0 -89
  259. package/dist/esm/get-scroll-parent-b4a07e65.js +0 -25
  260. package/dist/esm/grid.taro-883a9c35.js +0 -49
  261. package/dist/esm/griditem.taro-16c7055b.js +0 -80
  262. package/dist/esm/image.taro-3025e659.js +0 -64
  263. package/dist/esm/imagepreview.taro-d511342c.js +0 -167
  264. package/dist/esm/index-5bcb0ff8.js +0 -7
  265. package/dist/esm/indicator.taro-bfb21d45.js +0 -30
  266. package/dist/esm/infiniteloading.taro-721bca1f.js +0 -141
  267. package/dist/esm/input.taro-06c1e4d5.js +0 -167
  268. package/dist/esm/inputnumber.taro-1f893d42.js +0 -199
  269. package/dist/esm/layout.taro-e4bf83cb.js +0 -11
  270. package/dist/esm/menu.taro-e5c68cb8.js +0 -111
  271. package/dist/esm/menuitem.taro-37c18382.js +0 -129
  272. package/dist/esm/navbar.taro-92bab9c4.js +0 -57
  273. package/dist/esm/noticebar.taro-cbe93c9e.js +0 -427
  274. package/dist/esm/notify.taro-f1079218.js +0 -75
  275. package/dist/esm/numberkeyboard.taro-d9b1721b.js +0 -159
  276. package/dist/esm/offsetContext-c2a746fa.js +0 -5
  277. package/dist/esm/overlay.taro-067b7202.js +0 -73
  278. package/dist/esm/pagination.taro-94f9be5e.js +0 -91
  279. package/dist/esm/picker.taro-e16b4312.js +0 -423
  280. package/dist/esm/popover.taro-84a55ff9.js +0 -153
  281. package/dist/esm/popup.taro-89cc342a.js +0 -139
  282. package/dist/esm/price.taro-959d82f2.js +0 -83
  283. package/dist/esm/progress.taro-1a7ac8a4.js +0 -40
  284. package/dist/esm/pulltorefresh.taro-016d0079.js +0 -181
  285. package/dist/esm/radio.taro-36438449.js +0 -177
  286. package/dist/esm/range.taro-8953e8c3.js +0 -332
  287. package/dist/esm/rate.taro-895bb41c.js +0 -77
  288. package/dist/esm/row.taro-e929ec5c.js +0 -48
  289. package/dist/esm/searchbar.taro-4467040f.js +0 -152
  290. package/dist/esm/shortpassword.taro-433b86a4.js +0 -119
  291. package/dist/esm/sidenavbar.taro-f8ffb7dc.js +0 -33
  292. package/dist/esm/sidenavbaritem.taro-6cb0821e.js +0 -12
  293. package/dist/esm/signature.taro-a4d9b5c9.js +0 -143
  294. package/dist/esm/skeleton.taro-8ec11af9.js +0 -62
  295. package/dist/esm/step.taro-7ea33a76.js +0 -58
  296. package/dist/esm/steps.taro-86753d36.js +0 -30
  297. package/dist/esm/sticky.taro-a142a5f2.js +0 -136
  298. package/dist/esm/subsidenavbar.taro-85c03291.js +0 -63
  299. package/dist/esm/supports-passive-c85ef996.js +0 -18
  300. package/dist/esm/swipe.taro-0b8cc872.js +0 -175
  301. package/dist/esm/swiper.taro-c0e9a56b.js +0 -451
  302. package/dist/esm/swiperitem-abab7606.js +0 -29
  303. package/dist/esm/switch.taro-e82809f6.js +0 -38
  304. package/dist/esm/tabbar.taro-48413fb8.js +0 -51
  305. package/dist/esm/tabbaritem.taro-5afa3562.js +0 -37
  306. package/dist/esm/table.taro-327b4248.js +0 -95
  307. package/dist/esm/tabpane.taro-406cc0d3.js +0 -21
  308. package/dist/esm/tabs.taro-d47ccfc5.js +0 -120
  309. package/dist/esm/tag.taro-846ee805.js +0 -92
  310. package/dist/esm/textarea.taro-add72cf3.js +0 -94
  311. package/dist/esm/timedetail.taro-82a2900b.js +0 -44
  312. package/dist/esm/timepannel.taro-0573bb65.js +0 -22
  313. package/dist/esm/timeselect.taro-29124a34.js +0 -133
  314. package/dist/esm/toast.taro-c509a870.js +0 -108
  315. package/dist/esm/trendarrow.taro-dd83ec94.js +0 -70
  316. package/dist/esm/typings-d8491423.js +0 -6
  317. package/dist/esm/uploader.taro-c70d00de.js +0 -494
  318. package/dist/esm/use-client-rect-1f8ed1fe.js +0 -18
  319. package/dist/esm/use-props-value-ae7ee726.js +0 -15
  320. package/dist/esm/use-touch-db24bb5c.js +0 -69
  321. package/dist/esm/video-1c6405b4.js +0 -67
  322. package/dist/esm/virtuallist.taro-ba8e1f21.js +0 -214
  323. package/dist/esm/watermark.taro-168cdac5.js +0 -114
@@ -5,13 +5,13 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  /*!
8
- * @nutui/nutui-react-taro v2.0.0-alpha.5 Wed May 10 2023 15:25:20 GMT+0800 (China Standard Time)
8
+ * @nutui/nutui-react-taro v2.0.0-alpha.7 Fri May 12 2023 15:36:41 GMT+0800 (China Standard Time)
9
9
  * (c) 2023 @jdf2e.
10
10
  * Released under the MIT License.
11
11
  */
12
12
  import * as React from "react";
13
13
  import React__default, { useCallback, createContext, useMemo, useContext, useState, useEffect, useRef, isValidElement, useImperativeHandle, forwardRef, useLayoutEffect, Component, memo } from "react";
14
- import { View, ScrollView, Input as Input$1, Image as Image$2 } from "@tarojs/components";
14
+ import { View, ScrollView, PickerView, PickerViewColumn, Input as Input$1, Textarea, Image as Image$2 } from "@tarojs/components";
15
15
  import Taro, { getEnv, usePageScroll, getSystemInfoSync, pageScrollTo, nextTick, createSelectorQuery, ENV_TYPE, canvasToTempFilePath, uploadFile, chooseMedia, chooseImage, useReady, createInnerAudioContext, getSystemInfo, createOffscreenCanvas } from "@tarojs/taro";
16
16
  import ReactDOM, { createPortal, unstable_batchedUpdates } from "react-dom";
17
17
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -2747,7 +2747,7 @@ const ComponentDefaults = {
2747
2747
  style: {}
2748
2748
  };
2749
2749
  const prefixCls = "nut-button";
2750
- const defaultProps$1t = {
2750
+ const defaultProps$1u = {
2751
2751
  ...ComponentDefaults,
2752
2752
  color: "",
2753
2753
  type: "default",
@@ -2779,7 +2779,7 @@ const Button = React__default.forwardRef(
2779
2779
  style,
2780
2780
  ...rest
2781
2781
  } = {
2782
- ...defaultProps$1t,
2782
+ ...defaultProps$1u,
2783
2783
  ...props
2784
2784
  };
2785
2785
  const getStyle = useCallback(() => {
@@ -2838,7 +2838,7 @@ const Button = React__default.forwardRef(
2838
2838
  }
2839
2839
  );
2840
2840
  Button.displayName = "NutButton";
2841
- const defaultProps$1s = {
2841
+ const defaultProps$1t = {
2842
2842
  ...ComponentDefaults,
2843
2843
  title: null,
2844
2844
  description: null,
@@ -2862,7 +2862,7 @@ const Cell = (props) => {
2862
2862
  style,
2863
2863
  ...rest
2864
2864
  } = {
2865
- ...defaultProps$1s,
2865
+ ...defaultProps$1t,
2866
2866
  ...props
2867
2867
  };
2868
2868
  const handleClick = (event) => {
@@ -2901,9 +2901,9 @@ const Cell = (props) => {
2901
2901
  }
2902
2902
  );
2903
2903
  };
2904
- Cell.defaultProps = defaultProps$1s;
2904
+ Cell.defaultProps = defaultProps$1t;
2905
2905
  Cell.displayName = "NutCell";
2906
- const defaultProps$1r = {
2906
+ const defaultProps$1s = {
2907
2907
  ...ComponentDefaults,
2908
2908
  title: "",
2909
2909
  description: "",
@@ -2912,7 +2912,7 @@ const defaultProps$1r = {
2912
2912
  const classPrefix$e = "nut-cell-group";
2913
2913
  const CellGroup = (props) => {
2914
2914
  const { children, className, style, title, description, divider, ...rest } = {
2915
- ...defaultProps$1r,
2915
+ ...defaultProps$1s,
2916
2916
  ...props
2917
2917
  };
2918
2918
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$e, className), ...rest, children: [
@@ -2927,7 +2927,7 @@ const CellGroup = (props) => {
2927
2927
  )
2928
2928
  ] });
2929
2929
  };
2930
- CellGroup.defaultProps = defaultProps$1r;
2930
+ CellGroup.defaultProps = defaultProps$1s;
2931
2931
  CellGroup.displayName = "NutCellGroup";
2932
2932
  var INFINITY = 1 / 0;
2933
2933
  var symbolTag = "[object Symbol]";
@@ -3342,7 +3342,7 @@ const zhCN = {
3342
3342
  errorCanvasTips: "当前环境不支持Canvas"
3343
3343
  }
3344
3344
  };
3345
- const defaultProps$1q = {
3345
+ const defaultProps$1r = {
3346
3346
  locale: zhCN
3347
3347
  };
3348
3348
  const defaultConfigRef$1 = {
@@ -3365,7 +3365,7 @@ function convertThemeVarsToCSSVars(themeVars) {
3365
3365
  return cssVars;
3366
3366
  }
3367
3367
  const ConfigProvider = (props) => {
3368
- const { children, ...config2 } = { ...defaultProps$1q, ...props };
3368
+ const { children, ...config2 } = { ...defaultProps$1r, ...props };
3369
3369
  const parentConfig = useConfig$1();
3370
3370
  const theme = config2.theme || {};
3371
3371
  const style = useMemo(
@@ -3383,9 +3383,9 @@ const ConfigProvider = (props) => {
3383
3383
  }
3384
3384
  );
3385
3385
  };
3386
- ConfigProvider.defaultProps = defaultProps$1q;
3386
+ ConfigProvider.defaultProps = defaultProps$1r;
3387
3387
  ConfigProvider.displayName = "NutConfigProvider";
3388
- const defaultProps$1p = {
3388
+ const defaultProps$1q = {
3389
3389
  fit: "fill",
3390
3390
  position: "center",
3391
3391
  alt: "",
@@ -3416,7 +3416,7 @@ const Image$1 = (props) => {
3416
3416
  onClick,
3417
3417
  onLoad,
3418
3418
  onError
3419
- } = { ...defaultProps$1p, ...props };
3419
+ } = { ...defaultProps$1q, ...props };
3420
3420
  const [loading, setLoading] = useState(true);
3421
3421
  const [isError, setIsError] = useState(false);
3422
3422
  useEffect(() => {
@@ -3477,7 +3477,7 @@ const Image$1 = (props) => {
3477
3477
  }
3478
3478
  );
3479
3479
  };
3480
- Image$1.defaultProps = defaultProps$1p;
3480
+ Image$1.defaultProps = defaultProps$1q;
3481
3481
  Image$1.displayName = "NutImage";
3482
3482
  const defaultOverlayProps = {
3483
3483
  ...ComponentDefaults,
@@ -3572,7 +3572,7 @@ const Overlay = (props) => {
3572
3572
  Overlay.defaultProps = defaultOverlayProps;
3573
3573
  Overlay.displayName = "NutOverlay";
3574
3574
  const DataContext$2 = createContext({});
3575
- const defaultProps$1o = {
3575
+ const defaultProps$1p = {
3576
3576
  ...ComponentDefaults,
3577
3577
  span: "24",
3578
3578
  offset: "0",
@@ -3580,7 +3580,7 @@ const defaultProps$1o = {
3580
3580
  };
3581
3581
  const Col = (props) => {
3582
3582
  const { className, style, span, offset, children, onClick } = {
3583
- ...defaultProps$1o,
3583
+ ...defaultProps$1p,
3584
3584
  ...props
3585
3585
  };
3586
3586
  const [colName, setColName] = useState("");
@@ -3612,9 +3612,9 @@ const Col = (props) => {
3612
3612
  }
3613
3613
  );
3614
3614
  };
3615
- Col.defaultProps = defaultProps$1o;
3615
+ Col.defaultProps = defaultProps$1p;
3616
3616
  Col.displayName = "NutCol";
3617
- const defaultProps$1n = {
3617
+ const defaultProps$1o = {
3618
3618
  ...ComponentDefaults,
3619
3619
  contentPosition: "center",
3620
3620
  direction: "horizontal"
@@ -3622,7 +3622,7 @@ const defaultProps$1n = {
3622
3622
  const classPrefix$d = `nut-divider`;
3623
3623
  const Divider = (props) => {
3624
3624
  const { children, contentPosition, style, className, direction, ...rest } = {
3625
- ...defaultProps$1n,
3625
+ ...defaultProps$1o,
3626
3626
  ...props
3627
3627
  };
3628
3628
  const classes = direction === "horizontal" ? classNames({
@@ -3637,7 +3637,7 @@ const Divider = (props) => {
3637
3637
  });
3638
3638
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classes} ${className || ""}`, style, ...rest, children });
3639
3639
  };
3640
- Divider.defaultProps = defaultProps$1n;
3640
+ Divider.defaultProps = defaultProps$1o;
3641
3641
  Divider.displayName = "NutDivider";
3642
3642
  const gridContext = {
3643
3643
  onClick: (item, index) => {
@@ -3647,7 +3647,7 @@ const GridContext = React__default.createContext(gridContext);
3647
3647
  const pxCheck = (value) => {
3648
3648
  return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
3649
3649
  };
3650
- const defaultProps$1m = {
3650
+ const defaultProps$1n = {
3651
3651
  text: "",
3652
3652
  columns: 4,
3653
3653
  gap: 0,
@@ -3673,7 +3673,7 @@ const GridItem = (props) => {
3673
3673
  onClick,
3674
3674
  ...rest
3675
3675
  } = {
3676
- ...defaultProps$1m,
3676
+ ...defaultProps$1n,
3677
3677
  ...props
3678
3678
  };
3679
3679
  const classPrefix2 = "nut-grid-item";
@@ -3734,9 +3734,9 @@ const GridItem = (props) => {
3734
3734
  }
3735
3735
  );
3736
3736
  };
3737
- GridItem.defaultProps = defaultProps$1m;
3737
+ GridItem.defaultProps = defaultProps$1n;
3738
3738
  GridItem.displayName = "NutGridItem";
3739
- const defaultProps$1l = {
3739
+ const defaultProps$1m = {
3740
3740
  columns: 4,
3741
3741
  gap: 0,
3742
3742
  center: true,
@@ -3757,7 +3757,7 @@ const Grid = (props) => {
3757
3757
  className,
3758
3758
  onClick,
3759
3759
  ...rest
3760
- } = { ...defaultProps$1l, ...props };
3760
+ } = { ...defaultProps$1m, ...props };
3761
3761
  const childrenDom = React__default.Children.toArray(children);
3762
3762
  const classPrefix2 = "nut-grid";
3763
3763
  const rootClass = () => {
@@ -3787,18 +3787,18 @@ const Grid = (props) => {
3787
3787
  });
3788
3788
  }) }) });
3789
3789
  };
3790
- Grid.defaultProps = defaultProps$1l;
3790
+ Grid.defaultProps = defaultProps$1m;
3791
3791
  Grid.displayName = "NutGrid";
3792
3792
  Grid.Item = GridItem;
3793
- const defaultProps$1k = {};
3793
+ const defaultProps$1l = {};
3794
3794
  const Layout = (props) => {
3795
- ({ ...defaultProps$1k, ...props });
3795
+ ({ ...defaultProps$1l, ...props });
3796
3796
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-layout", children: "Layout" });
3797
3797
  };
3798
- Layout.defaultProps = defaultProps$1k;
3798
+ Layout.defaultProps = defaultProps$1l;
3799
3799
  Layout.displayName = "NutLayout";
3800
3800
  const classPrefix$c = "nut-row";
3801
- const defaultProps$1j = {
3801
+ const defaultProps$1k = {
3802
3802
  ...ComponentDefaults,
3803
3803
  type: "",
3804
3804
  justify: "start",
@@ -3818,7 +3818,7 @@ const Row = (props) => {
3818
3818
  gutter,
3819
3819
  onClick
3820
3820
  } = {
3821
- ...defaultProps$1j,
3821
+ ...defaultProps$1k,
3822
3822
  ...props
3823
3823
  };
3824
3824
  const getClass = (prefix2, type2) => {
@@ -3850,7 +3850,7 @@ const Row = (props) => {
3850
3850
  children
3851
3851
  ) });
3852
3852
  };
3853
- Row.defaultProps = defaultProps$1j;
3853
+ Row.defaultProps = defaultProps$1k;
3854
3854
  Row.displayName = "NutRow";
3855
3855
  function useWatch(dep, callback, config2 = { immediate: false }) {
3856
3856
  const { immediate } = config2;
@@ -3903,7 +3903,7 @@ function getScrollParent(el, root2 = defaultRoot) {
3903
3903
  }
3904
3904
  return root2;
3905
3905
  }
3906
- const defaultProps$1i = {
3906
+ const defaultProps$1j = {
3907
3907
  ...ComponentDefaults,
3908
3908
  position: "top",
3909
3909
  zIndex: 2e3
@@ -3920,7 +3920,7 @@ const Sticky = (props) => {
3920
3920
  className,
3921
3921
  onChange,
3922
3922
  ...rest
3923
- } = { ...defaultProps$1i, ...props };
3923
+ } = { ...defaultProps$1j, ...props };
3924
3924
  const stickyRef = useRef(null);
3925
3925
  const rootRef = useRef(null);
3926
3926
  const [rootRect, setRootRect] = useState({});
@@ -4026,9 +4026,9 @@ const Sticky = (props) => {
4026
4026
  }
4027
4027
  );
4028
4028
  };
4029
- Sticky.defaultProps = defaultProps$1i;
4029
+ Sticky.defaultProps = defaultProps$1j;
4030
4030
  Sticky.displayName = "NutSticky";
4031
- const defaultProps$1h = {
4031
+ const defaultProps$1i = {
4032
4032
  ...ComponentDefaults,
4033
4033
  threshold: 200,
4034
4034
  zIndex: 10,
@@ -4036,7 +4036,7 @@ const defaultProps$1h = {
4036
4036
  };
4037
4037
  const BackTop = (props) => {
4038
4038
  const { children, threshold, zIndex, className, duration, style, onClick } = {
4039
- ...defaultProps$1h,
4039
+ ...defaultProps$1i,
4040
4040
  ...props
4041
4041
  };
4042
4042
  const classPrefix2 = "nut-backtop";
@@ -4074,10 +4074,10 @@ const BackTop = (props) => {
4074
4074
  }
4075
4075
  );
4076
4076
  };
4077
- BackTop.defaultProps = defaultProps$1h;
4077
+ BackTop.defaultProps = defaultProps$1i;
4078
4078
  BackTop.displayName = "NutBackTop";
4079
4079
  const elevatorContext = createContext({});
4080
- const defaultProps$1g = {
4080
+ const defaultProps$1h = {
4081
4081
  ...ComponentDefaults,
4082
4082
  height: "200px",
4083
4083
  floorKey: "title",
@@ -4102,7 +4102,7 @@ const Elevator = (props) => {
4102
4102
  children,
4103
4103
  ...rest
4104
4104
  } = {
4105
- ...defaultProps$1g,
4105
+ ...defaultProps$1h,
4106
4106
  ...props
4107
4107
  };
4108
4108
  const classPrefix2 = "nut-elevator";
@@ -4321,10 +4321,10 @@ const Elevator = (props) => {
4321
4321
  sticky && scrollY > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__list__fixed`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `${classPrefix2}__list__fixed__title`, children: list[currentIndex][floorKey] }) }) : null
4322
4322
  ] });
4323
4323
  };
4324
- Elevator.defaultProps = defaultProps$1g;
4324
+ Elevator.defaultProps = defaultProps$1h;
4325
4325
  Elevator.displayName = "NutElevator";
4326
4326
  Elevator.Context = elevatorContext;
4327
- const defaultProps$1f = {
4327
+ const defaultProps$1g = {
4328
4328
  ...ComponentDefaults,
4329
4329
  activeText: "",
4330
4330
  inactiveText: "",
@@ -4352,7 +4352,7 @@ const FixedNav = (props) => {
4352
4352
  content,
4353
4353
  ...rest
4354
4354
  } = {
4355
- ...defaultProps$1f,
4355
+ ...defaultProps$1g,
4356
4356
  ...props
4357
4357
  };
4358
4358
  const classPrefix2 = "nut-fixednav";
@@ -4411,9 +4411,9 @@ const FixedNav = (props) => {
4411
4411
  }
4412
4412
  );
4413
4413
  };
4414
- FixedNav.defaultProps = defaultProps$1f;
4414
+ FixedNav.defaultProps = defaultProps$1g;
4415
4415
  FixedNav.displayName = "NutFixedNav";
4416
- const defaultProps$1e = {
4416
+ const defaultProps$1f = {
4417
4417
  ...ComponentDefaults,
4418
4418
  left: "",
4419
4419
  right: "",
@@ -4436,7 +4436,7 @@ const NavBar = (props) => {
4436
4436
  zIndex,
4437
4437
  onClickBack
4438
4438
  } = {
4439
- ...defaultProps$1e,
4439
+ ...defaultProps$1f,
4440
4440
  ...props
4441
4441
  };
4442
4442
  const classPrefix2 = "nut-navbar";
@@ -4480,7 +4480,7 @@ const NavBar = (props) => {
4480
4480
  const cls = classNames(classPrefix2, classes, className);
4481
4481
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: fixed && placeholder ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}--placeholder`, children: renderWrapper() }) : renderWrapper() });
4482
4482
  };
4483
- NavBar.defaultProps = defaultProps$1e;
4483
+ NavBar.defaultProps = defaultProps$1f;
4484
4484
  NavBar.displayName = "NutNavBar";
4485
4485
  function _extends$3() {
4486
4486
  _extends$3 = Object.assign ? Object.assign.bind() : function(target) {
@@ -6223,7 +6223,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$3({},
6223
6223
  onExited: propTypesExports.func
6224
6224
  }) : {};
6225
6225
  const CSSTransition$1 = CSSTransition;
6226
- const defaultProps$1d = {
6226
+ const defaultProps$1e = {
6227
6227
  ...ComponentDefaults,
6228
6228
  position: "center",
6229
6229
  transition: "",
@@ -6410,10 +6410,10 @@ const Popup = (props) => {
6410
6410
  }, [position, transition]);
6411
6411
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: renderToContainer(portal, renderNode()) });
6412
6412
  };
6413
- Popup.defaultProps = defaultProps$1d;
6413
+ Popup.defaultProps = defaultProps$1e;
6414
6414
  Popup.displayName = "NutPopup";
6415
6415
  const OffsetContext = createContext(20);
6416
- const defaultProps$1c = {
6416
+ const defaultProps$1d = {
6417
6417
  showhead: false,
6418
6418
  position: "left",
6419
6419
  width: "80%"
@@ -6430,7 +6430,7 @@ const SideNavBar = (props) => {
6430
6430
  onClose,
6431
6431
  ...rest
6432
6432
  } = {
6433
- ...defaultProps$1c,
6433
+ ...defaultProps$1d,
6434
6434
  ...props
6435
6435
  };
6436
6436
  const offset = props.offset ? Number(props.offset) : 20;
@@ -6481,7 +6481,7 @@ const SideNavBar = (props) => {
6481
6481
  }
6482
6482
  );
6483
6483
  };
6484
- SideNavBar.defaultProps = defaultProps$1c;
6484
+ SideNavBar.defaultProps = defaultProps$1d;
6485
6485
  SideNavBar.displayName = "NutSideNavBar";
6486
6486
  const SideNavBarItem = (props) => {
6487
6487
  const { title, key, children, onClick, ...rest } = props;
@@ -6499,12 +6499,12 @@ const SideNavBarItem = (props) => {
6499
6499
  }
6500
6500
  );
6501
6501
  };
6502
- const defaultProps$1b = {
6502
+ const defaultProps$1c = {
6503
6503
  open: true
6504
6504
  };
6505
6505
  const SubSideNavBar = (props) => {
6506
6506
  const { title, key, children, onClick, open, ...rest } = {
6507
- ...defaultProps$1b,
6507
+ ...defaultProps$1c,
6508
6508
  ...props
6509
6509
  };
6510
6510
  const [subShow, setSubShow] = useState(open);
@@ -6578,7 +6578,7 @@ function usePropsValue({
6578
6578
  }
6579
6579
  return [uncontrolled, handleUncontrolledChange];
6580
6580
  }
6581
- const defaultProps$1a = {
6581
+ const defaultProps$1b = {
6582
6582
  ...ComponentDefaults,
6583
6583
  value: "",
6584
6584
  dot: false,
@@ -6589,7 +6589,7 @@ const defaultProps$1a = {
6589
6589
  };
6590
6590
  const Badge = (props) => {
6591
6591
  const { className, style, value, max, children, dot, top, right, color } = {
6592
- ...defaultProps$1a,
6592
+ ...defaultProps$1b,
6593
6593
  ...props
6594
6594
  };
6595
6595
  const classPrefix2 = "nut-badge";
@@ -6620,9 +6620,9 @@ const Badge = (props) => {
6620
6620
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: contentClasses, style: getStyle(), children: content() })
6621
6621
  ] });
6622
6622
  };
6623
- Badge.defaultProps = defaultProps$1a;
6623
+ Badge.defaultProps = defaultProps$1b;
6624
6624
  Badge.displayName = "NutBadge";
6625
- const defaultProps$19 = {
6625
+ const defaultProps$1a = {
6626
6626
  ...ComponentDefaults,
6627
6627
  title: "",
6628
6628
  icon: null,
@@ -6644,7 +6644,7 @@ const TabbarItem = (props) => {
6644
6644
  handleClick,
6645
6645
  ...rest
6646
6646
  } = {
6647
- ...defaultProps$19,
6647
+ ...defaultProps$1a,
6648
6648
  ...props
6649
6649
  };
6650
6650
  const classPrefix2 = "nut-tabbar-item";
@@ -6671,7 +6671,7 @@ const TabbarItem = (props) => {
6671
6671
  }
6672
6672
  );
6673
6673
  };
6674
- const defaultProps$18 = {
6674
+ const defaultProps$19 = {
6675
6675
  ...ComponentDefaults,
6676
6676
  defaultValue: 0,
6677
6677
  fixed: false,
@@ -6694,7 +6694,7 @@ const Tabbar = (props) => {
6694
6694
  style,
6695
6695
  onSwitch
6696
6696
  } = {
6697
- ...defaultProps$18,
6697
+ ...defaultProps$19,
6698
6698
  ...props
6699
6699
  };
6700
6700
  const classPrefix2 = "nut-tabbar";
@@ -6731,17 +6731,17 @@ const Tabbar = (props) => {
6731
6731
  }
6732
6732
  );
6733
6733
  };
6734
- Tabbar.defaultProps = defaultProps$18;
6734
+ Tabbar.defaultProps = defaultProps$19;
6735
6735
  Tabbar.displayName = "NutTabbar";
6736
6736
  Tabbar.Item = TabbarItem;
6737
- const defaultProps$17 = {
6737
+ const defaultProps$18 = {
6738
6738
  title: "",
6739
6739
  value: "",
6740
6740
  disabled: false
6741
6741
  };
6742
6742
  const TabPane = (props) => {
6743
6743
  const { children, autoHeightClassName, className, disabled } = {
6744
- ...defaultProps$17,
6744
+ ...defaultProps$18,
6745
6745
  ...props
6746
6746
  };
6747
6747
  const classPrefix2 = "nut-tabpane";
@@ -6755,7 +6755,7 @@ const TabPane = (props) => {
6755
6755
  );
6756
6756
  return children ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes, children: !disabled && children }) : null;
6757
6757
  };
6758
- const defaultProps$16 = {
6758
+ const defaultProps$17 = {
6759
6759
  ...ComponentDefaults,
6760
6760
  tabStyle: {},
6761
6761
  activeColor: "",
@@ -6781,7 +6781,7 @@ const Tabs = (props) => {
6781
6781
  autoHeight,
6782
6782
  ...rest
6783
6783
  } = {
6784
- ...defaultProps$16,
6784
+ ...defaultProps$17,
6785
6785
  ...props
6786
6786
  };
6787
6787
  const [value, setValue] = usePropsValue({
@@ -6810,6 +6810,18 @@ const Tabs = (props) => {
6810
6810
  return titles2;
6811
6811
  };
6812
6812
  const titles = useRef(getTitles());
6813
+ useEffect(() => {
6814
+ titles.current = getTitles();
6815
+ let current = "";
6816
+ titles.current.forEach((title2) => {
6817
+ if (title2.value === value) {
6818
+ current = value;
6819
+ }
6820
+ });
6821
+ if (current !== "") {
6822
+ setValue(current);
6823
+ }
6824
+ }, [children]);
6813
6825
  const classes = classNames(
6814
6826
  classPrefix$a,
6815
6827
  `${classPrefix$a}--${direction}`,
@@ -6922,7 +6934,7 @@ const Tabs = (props) => {
6922
6934
  }) }) })
6923
6935
  ] });
6924
6936
  };
6925
- Tabs.defaultProps = defaultProps$16;
6937
+ Tabs.defaultProps = defaultProps$17;
6926
6938
  Tabs.displayName = "NutTabs";
6927
6939
  Tabs.TabPane = TabPane;
6928
6940
  var classnameExports = {};
@@ -7057,7 +7069,7 @@ const ConfigContext = createContext(null);
7057
7069
  const useConfig = () => {
7058
7070
  return useContext(ConfigContext) ?? getDefaultConfig();
7059
7071
  };
7060
- const defaultProps$15 = {
7072
+ const defaultProps$16 = {
7061
7073
  type: "custom",
7062
7074
  existAddress: [],
7063
7075
  defaultIcon: null,
@@ -7079,7 +7091,7 @@ const ExistRender = (props) => {
7079
7091
  onClose,
7080
7092
  onSwitchModule,
7081
7093
  ...rest
7082
- } = { ...defaultProps$15, ...props };
7094
+ } = { ...defaultProps$16, ...props };
7083
7095
  const b2 = cn("address");
7084
7096
  const selectedExist = (item) => {
7085
7097
  const copyExistAdd = existAddress;
@@ -7121,7 +7133,7 @@ const ExistRender = (props) => {
7121
7133
  isShowCustomAddress && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b2("choose-other"), onClick: onSwitch, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b2("choose-other-btn"), children: customAndExistTitle || locale.address.chooseAnotherAddress }) })
7122
7134
  ] });
7123
7135
  };
7124
- const defaultProps$14 = {
7136
+ const defaultProps$15 = {
7125
7137
  modelValue: [],
7126
7138
  type: "custom",
7127
7139
  province: [],
@@ -7146,7 +7158,7 @@ const CustomRender = (props) => {
7146
7158
  onClose,
7147
7159
  ...rest
7148
7160
  } = {
7149
- ...defaultProps$14,
7161
+ ...defaultProps$15,
7150
7162
  ...props
7151
7163
  };
7152
7164
  const b2 = cn("address");
@@ -7310,28 +7322,28 @@ const CustomRender = (props) => {
7310
7322
  nextAreaList(item);
7311
7323
  };
7312
7324
  useEffect(() => {
7313
- const { province: province2 } = { ...defaultProps$14, ...props };
7325
+ const { province: province2 } = { ...defaultProps$15, ...props };
7314
7326
  setRegionList({
7315
7327
  ...regionList,
7316
7328
  province: isCustom2() ? transformData(province2) : province2
7317
7329
  });
7318
7330
  }, [province]);
7319
7331
  useEffect(() => {
7320
- const { city: city2 } = { ...defaultProps$14, ...props };
7332
+ const { city: city2 } = { ...defaultProps$15, ...props };
7321
7333
  setRegionList({
7322
7334
  ...regionList,
7323
7335
  city: isCustom2() ? transformData(city2) : city2
7324
7336
  });
7325
7337
  }, [city]);
7326
7338
  useEffect(() => {
7327
- const { country: country2 } = { ...defaultProps$14, ...props };
7339
+ const { country: country2 } = { ...defaultProps$15, ...props };
7328
7340
  setRegionList({
7329
7341
  ...regionList,
7330
7342
  country: isCustom2() ? transformData(country2) : country2
7331
7343
  });
7332
7344
  }, [country]);
7333
7345
  useEffect(() => {
7334
- const { town: town2 } = { ...defaultProps$14, ...props };
7346
+ const { town: town2 } = { ...defaultProps$15, ...props };
7335
7347
  setRegionList({
7336
7348
  ...regionList,
7337
7349
  town: isCustom2() ? transformData(town2) : town2
@@ -7404,7 +7416,7 @@ const CustomRender = (props) => {
7404
7416
  ) })
7405
7417
  ] });
7406
7418
  };
7407
- const defaultProps$13 = {
7419
+ const defaultProps$14 = {
7408
7420
  ...ComponentDefaults,
7409
7421
  modelValue: false,
7410
7422
  modelSelect: [],
@@ -7455,7 +7467,7 @@ const Address = (props) => {
7455
7467
  className,
7456
7468
  ...rest
7457
7469
  } = {
7458
- ...defaultProps$13,
7470
+ ...defaultProps$14,
7459
7471
  ...props
7460
7472
  };
7461
7473
  const b2 = cn("address");
@@ -7613,7 +7625,7 @@ const Address = (props) => {
7613
7625
  }
7614
7626
  ) });
7615
7627
  };
7616
- Address.defaultProps = defaultProps$13;
7628
+ Address.defaultProps = defaultProps$14;
7617
7629
  Address.displayName = "NutAddress";
7618
7630
  const Utils = {
7619
7631
  /**
@@ -7746,7 +7758,7 @@ function requestAniFrame() {
7746
7758
  }
7747
7759
  }
7748
7760
  const requestAniFrame$1 = requestAniFrame();
7749
- const defaultProps$12 = {
7761
+ const defaultProps$13 = {
7750
7762
  type: "one",
7751
7763
  isAutoBackFill: false,
7752
7764
  poppable: true,
@@ -7798,7 +7810,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
7798
7810
  onUpdate,
7799
7811
  onSelected,
7800
7812
  onYearMonthChange
7801
- } = { ...defaultProps$12, ...props };
7813
+ } = { ...defaultProps$13, ...props };
7802
7814
  const weeks = locale.calendaritem.weekdays;
7803
7815
  const [yearMonthTitle, setYearMonthTitle] = useState("");
7804
7816
  const [monthsData, setMonthsData] = useState([]);
@@ -8403,9 +8415,9 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
8403
8415
  poppable && !isAutoBackFill ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-calendar-footer", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "calendar-confirm-btn", onClick: confirm, children: confirmText || locale.confirm }) }) : ""
8404
8416
  ] }) });
8405
8417
  });
8406
- CalendarItem.defaultProps = defaultProps$12;
8418
+ CalendarItem.defaultProps = defaultProps$13;
8407
8419
  CalendarItem.displayName = "NutCalendarItem";
8408
- const defaultProps$11 = {
8420
+ const defaultProps$12 = {
8409
8421
  type: "one",
8410
8422
  isAutoBackFill: false,
8411
8423
  poppable: true,
@@ -8461,7 +8473,7 @@ const Calendar = React__default.forwardRef((props, ref) => {
8461
8473
  onChoose,
8462
8474
  onSelected,
8463
8475
  onYearMonthChange
8464
- } = { ...defaultProps$11, ...props };
8476
+ } = { ...defaultProps$12, ...props };
8465
8477
  const calendarRef = useRef(null);
8466
8478
  const close = () => {
8467
8479
  onClose && onClose();
@@ -8531,9 +8543,9 @@ const Calendar = React__default.forwardRef((props, ref) => {
8531
8543
  }
8532
8544
  ) : renderItem() });
8533
8545
  });
8534
- Calendar.defaultProps = defaultProps$11;
8546
+ Calendar.defaultProps = defaultProps$12;
8535
8547
  Calendar.displayName = "NutCalendar";
8536
- const defaultProps$10 = {
8548
+ const defaultProps$11 = {
8537
8549
  data: {
8538
8550
  text: "",
8539
8551
  value: "",
@@ -8544,32 +8556,37 @@ const defaultProps$10 = {
8544
8556
  },
8545
8557
  activeColor: "",
8546
8558
  checked: false,
8547
- checkedIcon: "checklist",
8559
+ activeIcon: "checklist",
8548
8560
  chooseItem: () => {
8549
8561
  }
8550
8562
  };
8551
8563
  const InternalCascaderItem = (props, ref) => {
8552
- const { data, checked, checkedIcon, chooseItem, activeColor } = {
8553
- ...defaultProps$10,
8564
+ const { data, checked, activeIcon, chooseItem, activeColor } = {
8565
+ ...defaultProps$11,
8554
8566
  ...props
8555
8567
  };
8556
- const b2 = cn("cascader-item");
8568
+ const classPrefix2 = "nut-cascader-item";
8557
8569
  const classes = classNames(
8558
8570
  {
8559
8571
  active: checked,
8560
8572
  disabled: data.disabled
8561
8573
  },
8562
- b2("")
8574
+ classPrefix2
8563
8575
  );
8564
8576
  const classesTitle = classNames({
8565
- [`${b2("")}__title`]: true
8577
+ [`${classPrefix2}__title`]: true
8566
8578
  });
8567
8579
  const renderIcon = () => {
8568
8580
  if (checked) {
8569
- if (isValidElement(checkedIcon)) {
8570
- return checkedIcon;
8581
+ if (isValidElement(activeIcon)) {
8582
+ return activeIcon;
8571
8583
  }
8572
- return /* @__PURE__ */ jsxRuntimeExports.jsx(a$q, { className: `${checked ? b2("icon-check") : ""}` });
8584
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
8585
+ a$q,
8586
+ {
8587
+ className: `${checked ? `${classPrefix2}__icon-check` : ""}`
8588
+ }
8589
+ );
8573
8590
  }
8574
8591
  return null;
8575
8592
  };
@@ -8589,7 +8606,7 @@ const InternalCascaderItem = (props, ref) => {
8589
8606
  );
8590
8607
  };
8591
8608
  const CascaderItem = React__default.forwardRef(InternalCascaderItem);
8592
- CascaderItem.defaultProps = defaultProps$10;
8609
+ CascaderItem.defaultProps = defaultProps$11;
8593
8610
  CascaderItem.displayName = "NutCascaderItem";
8594
8611
  const formatTree = (tree, parent, config2) => tree.map((node) => {
8595
8612
  const {
@@ -8727,26 +8744,22 @@ class Tree {
8727
8744
  }
8728
8745
  }
8729
8746
  const Tree$1 = Tree;
8730
- const defaultProps$$ = {
8731
- className: "",
8732
- style: {},
8747
+ const defaultProps$10 = {
8748
+ ...ComponentDefaults,
8733
8749
  activeColor: "",
8734
- checkedIcon: "checklist",
8735
- tabsColor: "",
8736
- poppable: true,
8750
+ activeIcon: "checklist",
8751
+ popup: true,
8737
8752
  visible: false,
8738
8753
  options: [],
8739
8754
  value: [],
8740
8755
  title: "",
8741
- textKey: "text",
8742
- valueKey: "value",
8743
- childrenKey: "children",
8744
- convertConfig: {},
8756
+ optionKey: { textKey: "text", valueKey: "value", childrenKey: "children" },
8757
+ format: {},
8745
8758
  closeable: false,
8746
8759
  closeIconPosition: "top-right",
8747
8760
  closeIcon: "close",
8748
8761
  lazy: false,
8749
- lazyLoad: () => {
8762
+ onLoad: () => {
8750
8763
  },
8751
8764
  onClose: () => {
8752
8765
  },
@@ -8760,28 +8773,25 @@ const InternalCascader = (props, ref) => {
8760
8773
  const {
8761
8774
  className,
8762
8775
  style,
8763
- tabsColor,
8764
- poppable,
8776
+ popup,
8765
8777
  visible,
8766
8778
  options,
8767
8779
  value,
8768
8780
  title,
8769
- textKey,
8770
- valueKey,
8771
- childrenKey,
8772
- convertConfig: convertConfig2,
8781
+ optionKey: optionKey2,
8782
+ format: format2,
8773
8783
  closeable,
8774
8784
  closeIconPosition,
8775
8785
  closeIcon,
8776
8786
  lazy,
8777
- lazyLoad,
8787
+ onLoad,
8778
8788
  onClose,
8779
8789
  onChange,
8780
8790
  onPathChange
8781
- } = { ...defaultProps$$, ...props };
8791
+ } = { ...defaultProps$10, ...props };
8782
8792
  const [tabvalue, setTabvalue] = useState("c1");
8783
8793
  const [optionsData, setOptionsData] = useState([]);
8784
- const isLazy = () => state.configs.lazy && Boolean(state.configs.lazyLoad);
8794
+ const isLazy = () => state.configs.lazy && Boolean(state.configs.onLoad);
8785
8795
  const [state] = useState({
8786
8796
  optionsData: [],
8787
8797
  panes: [
@@ -8799,44 +8809,38 @@ const InternalCascader = (props, ref) => {
8799
8809
  currentProcessNode: [],
8800
8810
  configs: {
8801
8811
  lazy,
8802
- lazyLoad,
8803
- valueKey,
8804
- textKey,
8805
- childrenKey,
8806
- convertConfig: convertConfig2
8812
+ onLoad,
8813
+ optionKey: optionKey2,
8814
+ format: format2
8807
8815
  },
8808
8816
  lazyLoadMap: /* @__PURE__ */ new Map()
8809
8817
  });
8810
- const b2 = cn("cascader");
8811
- const classes = classNames(b2(""));
8818
+ const classPrefix2 = classNames(`nut-cascader`);
8812
8819
  const classesPane = classNames({
8813
- [`${b2("")}-pane`]: true
8820
+ [`${classPrefix2}-pane`]: true
8814
8821
  });
8815
8822
  useEffect(() => {
8816
8823
  initData();
8817
- }, []);
8824
+ }, [options]);
8818
8825
  useEffect(() => {
8819
8826
  if (value !== state.innerValue) {
8820
8827
  state.innerValue = value;
8821
8828
  }
8822
8829
  }, [value]);
8823
- useEffect(() => {
8824
- initData();
8825
- }, [options]);
8826
8830
  const initData = async () => {
8827
8831
  state.lazyLoadMap.clear();
8828
- if (convertConfig2 && Object.keys(convertConfig2).length > 0) {
8832
+ if (format2 && Object.keys(format2).length > 0) {
8829
8833
  state.optionsData = convertListToOptions(
8830
8834
  options,
8831
- convertConfig2
8835
+ format2
8832
8836
  );
8833
8837
  } else {
8834
8838
  state.optionsData = options;
8835
8839
  }
8836
8840
  state.tree = new Tree$1(state.optionsData, {
8837
- value: state.configs.valueKey,
8838
- text: state.configs.textKey,
8839
- children: state.configs.childrenKey
8841
+ value: state.configs.optionKey.valueKey,
8842
+ text: state.configs.optionKey.textKey,
8843
+ children: state.configs.optionKey.childrenKey
8840
8844
  });
8841
8845
  if (isLazy() && !state.tree.nodes.length) {
8842
8846
  await invokeLazyLoad({
@@ -8902,7 +8906,7 @@ const InternalCascader = (props, ref) => {
8902
8906
  if (!node) {
8903
8907
  return;
8904
8908
  }
8905
- if (!state.configs.lazyLoad) {
8909
+ if (!state.configs.onLoad) {
8906
8910
  node.leaf = true;
8907
8911
  return;
8908
8912
  }
@@ -8915,7 +8919,7 @@ const InternalCascader = (props, ref) => {
8915
8919
  if (!lazyLoadPromise) {
8916
8920
  lazyLoadPromise = new Promise((resolve) => {
8917
8921
  var _a, _b;
8918
- (_b = (_a = state.configs).lazyLoad) == null ? void 0 : _b.call(_a, node, resolve);
8922
+ (_b = (_a = state.configs).onLoad) == null ? void 0 : _b.call(_a, node, resolve);
8919
8923
  });
8920
8924
  state.lazyLoadMap.set(node, lazyLoadPromise);
8921
8925
  }
@@ -8962,8 +8966,8 @@ const InternalCascader = (props, ref) => {
8962
8966
  selectedNode: null,
8963
8967
  paneKey: `c${state.tabsCursor + 1}`
8964
8968
  });
8965
- setTabvalue(`c${state.tabsCursor + 1}`);
8966
8969
  setOptionsData(state.panes);
8970
+ setTabvalue(`c${state.tabsCursor + 1}`);
8967
8971
  if (!type) {
8968
8972
  const pathNodes = state.panes.map((item) => item.selectedNode);
8969
8973
  const optionParams = pathNodes.map((item) => item == null ? void 0 : item.value);
@@ -8983,8 +8987,8 @@ const InternalCascader = (props, ref) => {
8983
8987
  setOptionsData(state.panes);
8984
8988
  };
8985
8989
  const renderItem = () => {
8986
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classes} ${className}`, style, children: [
8987
- poppable && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b2("title"), children: title }),
8990
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2} ${className}`, style, children: [
8991
+ popup && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-cascader__title", children: title }),
8988
8992
  /* @__PURE__ */ jsxRuntimeExports.jsx(
8989
8993
  Tabs,
8990
8994
  {
@@ -8999,27 +9003,21 @@ const InternalCascader = (props, ref) => {
8999
9003
  setTabvalue(pane.paneKey);
9000
9004
  state.tabsCursor = index;
9001
9005
  },
9002
- className: `nut-tabs__titles-item ${tabvalue === pane.paneKey ? "active" : ""}`,
9006
+ className: `nut-tabs__titles-item ${tabvalue === pane.paneKey ? "nut-tabs__titles-item--active" : ""}`,
9003
9007
  children: [
9004
9008
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "nut-tabs__titles-item__text", children: [
9005
9009
  !state.initLoading && state.panes.length && ((_a = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _a.text),
9006
9010
  !state.initLoading && state.panes.length && !((_b = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _b.text) && "请选择",
9007
9011
  !(!state.initLoading && state.panes.length) && "Loading..."
9008
9012
  ] }),
9009
- /* @__PURE__ */ jsxRuntimeExports.jsx(
9010
- "span",
9011
- {
9012
- className: "nut-tabs__titles-item__line",
9013
- style: { background: tabsColor }
9014
- }
9015
- )
9013
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "nut-tabs__titles-item__line" })
9016
9014
  ]
9017
9015
  },
9018
9016
  pane.paneKey
9019
9017
  );
9020
9018
  });
9021
9019
  },
9022
- children: !state.initLoading && state.panes.length ? optionsData.map((pane) => /* @__PURE__ */ jsxRuntimeExports.jsx(TabPane, { value: pane.paneKey, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane, children: pane.nodes && pane.nodes.map((node, index) => {
9020
+ children: !state.initLoading && state.panes.length ? optionsData.map((pane) => /* @__PURE__ */ jsxRuntimeExports.jsx(Tabs.TabPane, { value: pane.paneKey, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane, children: pane.nodes && pane.nodes.map((node, index) => {
9023
9021
  var _a;
9024
9022
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
9025
9023
  CascaderItem,
@@ -9031,18 +9029,18 @@ const InternalCascader = (props, ref) => {
9031
9029
  },
9032
9030
  index
9033
9031
  );
9034
- }) }) }, pane.paneKey)) : /* @__PURE__ */ jsxRuntimeExports.jsx(TabPane, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane }) })
9032
+ }) }) }, pane.paneKey)) : /* @__PURE__ */ jsxRuntimeExports.jsx(Tabs.TabPane, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane }) })
9035
9033
  }
9036
9034
  )
9037
9035
  ] });
9038
9036
  };
9039
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: poppable ? /* @__PURE__ */ jsxRuntimeExports.jsx(
9037
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: popup ? /* @__PURE__ */ jsxRuntimeExports.jsx(
9040
9038
  Popup,
9041
9039
  {
9042
- className: "cascadar-popup",
9043
9040
  visible,
9044
9041
  position: "bottom",
9045
9042
  round: true,
9043
+ closeIcon,
9046
9044
  closeable,
9047
9045
  closeIconPosition,
9048
9046
  onClickOverlay: closePopup,
@@ -9052,11 +9050,11 @@ const InternalCascader = (props, ref) => {
9052
9050
  ) : renderItem() });
9053
9051
  };
9054
9052
  const Cascader = React__default.forwardRef(InternalCascader);
9055
- Cascader.defaultProps = defaultProps$$;
9053
+ Cascader.defaultProps = defaultProps$10;
9056
9054
  Cascader.displayName = "NutCascader";
9057
9055
  const CheckboxGroupContext = createContext(null);
9058
9056
  const Context = CheckboxGroupContext;
9059
- const defaultProps$_ = {
9057
+ const defaultProps$$ = {
9060
9058
  max: void 0,
9061
9059
  labelPosition: "right",
9062
9060
  direction: "vertical",
@@ -9067,7 +9065,7 @@ const defaultProps$_ = {
9067
9065
  const classPrefix$9 = "nut-checkboxgroup";
9068
9066
  const CheckboxGroup = React__default.forwardRef(
9069
9067
  (props, ref) => {
9070
- const { children } = { ...defaultProps$_, ...props };
9068
+ const { children } = { ...defaultProps$$, ...props };
9071
9069
  const {
9072
9070
  className,
9073
9071
  disabled,
@@ -9157,9 +9155,9 @@ const CheckboxGroup = React__default.forwardRef(
9157
9155
  );
9158
9156
  }
9159
9157
  );
9160
- CheckboxGroup.defaultProps = defaultProps$_;
9158
+ CheckboxGroup.defaultProps = defaultProps$$;
9161
9159
  CheckboxGroup.displayName = "NutCheckboxGroup";
9162
- const defaultProps$Z = {
9160
+ const defaultProps$_ = {
9163
9161
  ...ComponentDefaults,
9164
9162
  disabled: false,
9165
9163
  labelPosition: "right",
@@ -9172,7 +9170,7 @@ const defaultProps$Z = {
9172
9170
  const classPrefix$8 = "nut-checkbox";
9173
9171
  const Checkbox = (props) => {
9174
9172
  const { children } = {
9175
- ...defaultProps$Z,
9173
+ ...defaultProps$_,
9176
9174
  ...props
9177
9175
  };
9178
9176
  const {
@@ -9277,7 +9275,7 @@ const Checkbox = (props) => {
9277
9275
  }
9278
9276
  );
9279
9277
  };
9280
- Checkbox.defaultProps = defaultProps$Z;
9278
+ Checkbox.defaultProps = defaultProps$_;
9281
9279
  Checkbox.displayName = "NutCheckBox";
9282
9280
  Checkbox.Group = CheckboxGroup;
9283
9281
  const MIN_DISTANCE = 10;
@@ -9358,13 +9356,13 @@ if (canUseDom) {
9358
9356
  console.log(e);
9359
9357
  }
9360
9358
  }
9361
- const InternalPickerSlot = (props, ref) => {
9359
+ const InternalPickerPanel = (props, ref) => {
9362
9360
  const {
9363
9361
  keyIndex = 0,
9364
9362
  defaultValue,
9365
- listData = [],
9363
+ options = [],
9366
9364
  threeDimensional = true,
9367
- swipeDuration = 1e3,
9365
+ duration = 1e3,
9368
9366
  itemShow = false,
9369
9367
  chooseItem
9370
9368
  } = props;
@@ -9379,9 +9377,9 @@ const InternalPickerSlot = (props, ref) => {
9379
9377
  const rotation = 20;
9380
9378
  const moving = useRef(false);
9381
9379
  let timer;
9382
- const listbox = useRef(null);
9380
+ const listRef = useRef(null);
9383
9381
  const rollerRef = useRef(null);
9384
- const pickerSlotRef = useRef(null);
9382
+ const PickerPanelRef = useRef(null);
9385
9383
  const [startTime, setStartTime] = useState(0);
9386
9384
  const [startY, setStartY] = useState(0);
9387
9385
  const transformY = useRef(0);
@@ -9407,8 +9405,8 @@ const InternalPickerSlot = (props, ref) => {
9407
9405
  if (updateMove > 0) {
9408
9406
  updateMove = 0;
9409
9407
  }
9410
- if (updateMove < -(listData.length - 1) * lineSpacing.current) {
9411
- updateMove = -(listData.length - 1) * lineSpacing.current;
9408
+ if (updateMove < -(options.length - 1) * lineSpacing.current) {
9409
+ updateMove = -(options.length - 1) * lineSpacing.current;
9412
9410
  }
9413
9411
  const endMove = Math.round(updateMove / lineSpacing.current) * lineSpacing.current;
9414
9412
  const deg = `${(Math.abs(Math.round(endMove / lineSpacing.current)) + 1) * rotation}deg`;
@@ -9417,7 +9415,7 @@ const InternalPickerSlot = (props, ref) => {
9417
9415
  } else {
9418
9416
  let deg = 0;
9419
9417
  const currentDeg = (-updateMove / lineSpacing.current + 1) * rotation;
9420
- const maxDeg = (listData.length + 1) * rotation;
9418
+ const maxDeg = (options.length + 1) * rotation;
9421
9419
  const minDeg = 0;
9422
9420
  deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
9423
9421
  if (minDeg < deg && deg < maxDeg) {
@@ -9427,7 +9425,7 @@ const InternalPickerSlot = (props, ref) => {
9427
9425
  }
9428
9426
  };
9429
9427
  const setChooseValue = (move) => {
9430
- chooseItem && chooseItem(listData == null ? void 0 : listData[Math.round(-move / lineSpacing.current)], keyIndex);
9428
+ chooseItem && chooseItem(options == null ? void 0 : options[Math.round(-move / lineSpacing.current)], keyIndex);
9431
9429
  };
9432
9430
  const touchStart = (event) => {
9433
9431
  touch.start(event);
@@ -9451,7 +9449,7 @@ const InternalPickerSlot = (props, ref) => {
9451
9449
  const moveTime = Date.now() - startTime;
9452
9450
  if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
9453
9451
  const distance = momentum(move, moveTime);
9454
- setMove(distance, "end", +swipeDuration);
9452
+ setMove(distance, "end", +duration);
9455
9453
  } else {
9456
9454
  setMove(move, "end");
9457
9455
  }
@@ -9459,9 +9457,9 @@ const InternalPickerSlot = (props, ref) => {
9459
9457
  touch.reset();
9460
9458
  }, 0);
9461
9459
  };
9462
- const momentum = (distance, duration) => {
9460
+ const momentum = (distance, duration2) => {
9463
9461
  let nDistance = distance;
9464
- const speed = Math.abs(nDistance / duration);
9462
+ const speed = Math.abs(nDistance / duration2);
9465
9463
  nDistance = speed / 3e-3 * (nDistance < 0 ? -1 : 1);
9466
9464
  return nDistance;
9467
9465
  };
@@ -9469,7 +9467,7 @@ const InternalPickerSlot = (props, ref) => {
9469
9467
  const value = val || defaultValue;
9470
9468
  let index = -1;
9471
9469
  if (value) {
9472
- listData.some((item, idx) => {
9470
+ options.some((item, idx) => {
9473
9471
  if (item.value === value) {
9474
9472
  index = idx;
9475
9473
  return true;
@@ -9477,7 +9475,7 @@ const InternalPickerSlot = (props, ref) => {
9477
9475
  return false;
9478
9476
  });
9479
9477
  } else {
9480
- listData.forEach((item, i) => {
9478
+ options.forEach((item, i) => {
9481
9479
  if (item.value === defaultValue) {
9482
9480
  index = i;
9483
9481
  }
@@ -9502,7 +9500,7 @@ const InternalPickerSlot = (props, ref) => {
9502
9500
  }
9503
9501
  };
9504
9502
  const getReference = async () => {
9505
- const refe = await getRectByTaro(listbox == null ? void 0 : listbox.current);
9503
+ const refe = await getRectByTaro(listRef == null ? void 0 : listRef.current);
9506
9504
  lineSpacing.current = refe.height ? refe.height : 36;
9507
9505
  modifyStatus(true);
9508
9506
  };
@@ -9525,7 +9523,7 @@ const InternalPickerSlot = (props, ref) => {
9525
9523
  return () => {
9526
9524
  clearTimeout(timer);
9527
9525
  };
9528
- }, [listData]);
9526
+ }, [options]);
9529
9527
  useEffect(() => {
9530
9528
  if (itemShow) {
9531
9529
  setTimeout(() => {
@@ -9541,7 +9539,7 @@ const InternalPickerSlot = (props, ref) => {
9541
9539
  "div",
9542
9540
  {
9543
9541
  className: "nut-picker-list",
9544
- ref: pickerSlotRef,
9542
+ ref: PickerPanelRef,
9545
9543
  onTouchStart: touchStart,
9546
9544
  onTouchMove: touchMove,
9547
9545
  onTouchEnd: touchEnd,
@@ -9554,7 +9552,7 @@ const InternalPickerSlot = (props, ref) => {
9554
9552
  style: threeDimensional ? touchRollerStyle() : touchTileStyle(),
9555
9553
  onTransitionEnd: stopMomentum,
9556
9554
  children: [
9557
- threeDimensional && listData.map((item, index) => {
9555
+ threeDimensional && options.map((item, index) => {
9558
9556
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
9559
9557
  "div",
9560
9558
  {
@@ -9569,7 +9567,7 @@ const InternalPickerSlot = (props, ref) => {
9569
9567
  item.value ? item.value : index
9570
9568
  );
9571
9569
  }),
9572
- !threeDimensional && listData.map((item, index) => {
9570
+ !threeDimensional && options.map((item, index) => {
9573
9571
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
9574
9572
  "div",
9575
9573
  {
@@ -9587,13 +9585,13 @@ const InternalPickerSlot = (props, ref) => {
9587
9585
  }
9588
9586
  ),
9589
9587
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-picker-mask" }),
9590
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-picker-indicator", ref: listbox })
9588
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-picker-indicator", ref: listRef })
9591
9589
  ]
9592
9590
  }
9593
9591
  );
9594
9592
  };
9595
- const PickerSlot = React__default.forwardRef(InternalPickerSlot);
9596
- const PickerSlot$1 = PickerSlot;
9593
+ const PickerPanel = React__default.forwardRef(InternalPickerPanel);
9594
+ const PickerPanel$1 = PickerPanel;
9597
9595
  function useRefs() {
9598
9596
  const refs = React__default.useRef([]);
9599
9597
  const setRefs = React__default.useCallback(
@@ -9608,181 +9606,247 @@ function useRefs() {
9608
9606
  }, []);
9609
9607
  return [refs.current, setRefs, reset];
9610
9608
  }
9609
+ const defaultProps$Z = {
9610
+ ...ComponentDefaults,
9611
+ visible: false,
9612
+ title: "",
9613
+ options: [],
9614
+ value: [],
9615
+ defaultValue: [],
9616
+ threeDimensional: true,
9617
+ duration: 1e3
9618
+ };
9611
9619
  const InternalPicker = (props, ref) => {
9612
9620
  const { locale } = useConfig$1();
9613
9621
  const {
9614
9622
  visible,
9615
9623
  title,
9616
- listData = [],
9617
- defaultValueData,
9618
- onConfirm,
9619
- onClose,
9620
- onCloseUpdate,
9621
- onChange,
9624
+ options = [],
9625
+ defaultValue = [],
9622
9626
  className,
9623
9627
  style,
9624
9628
  threeDimensional,
9625
- swipeDuration,
9629
+ duration,
9630
+ onConfirm,
9631
+ onClose,
9632
+ afterClose,
9633
+ onChange,
9626
9634
  ...rest
9627
- } = props;
9628
- const [chooseValueData, setchooseValueData] = useState([]);
9629
- const [columnIndex, setcolumnIndex] = useState(0);
9635
+ } = { ...defaultProps$Z, ...props };
9636
+ const classPrefix2 = "nut-picker";
9637
+ const classes = classNames(classPrefix2, className);
9638
+ const [selectedValue, setSelectedValue] = usePropsValue({
9639
+ value: props.value,
9640
+ defaultValue: [...defaultValue],
9641
+ finalValue: [...defaultValue],
9642
+ onChange: (val) => {
9643
+ var _a;
9644
+ (_a = props.onConfirm) == null ? void 0 : _a.call(props, setSelectedOptions(), val);
9645
+ }
9646
+ });
9647
+ const [currentValue2, setCurrentValue] = useState([]);
9648
+ const [columnIndex, setColumnIndex] = useState(0);
9630
9649
  const pickerRef = useRef(null);
9631
9650
  const [refs, setRefs] = useRefs();
9632
9651
  const [columnsList, setColumnsList] = useState([]);
9633
- const b2 = cn("picker");
9634
9652
  const isConfirmEvent = useRef(false);
9635
- useEffect(() => {
9636
- if (defaultValueData && defaultValueData.length !== 0 && defaultValueData.toString() !== chooseValueData.toString()) {
9637
- const data = [...defaultValueData];
9638
- setchooseValueData(data);
9639
- setColumnsList(normalListData());
9653
+ const formatCascade = (columns, values) => {
9654
+ const formatted = [];
9655
+ let columnOptions = {
9656
+ text: "",
9657
+ value: "",
9658
+ children: columns
9659
+ };
9660
+ let columnIndex2 = 0;
9661
+ while (columnOptions && columnOptions.children) {
9662
+ const options2 = columnOptions.children;
9663
+ const value = values[columnIndex2];
9664
+ let index = options2.findIndex(
9665
+ (columnItem) => columnItem.value === value
9666
+ );
9667
+ if (index === -1)
9668
+ index = 0;
9669
+ columnOptions = columnOptions.children[index];
9670
+ columnIndex2++;
9671
+ formatted.push(options2);
9640
9672
  }
9641
- }, [defaultValueData]);
9642
- useEffect(() => {
9643
- onChange && onChange(columnIndex, chooseValueData, selectedOptions());
9644
- if (isConfirmEvent.current) {
9645
- isConfirmEvent.current = false;
9646
- onConfirm && onConfirm(chooseValueData, selectedOptions());
9673
+ return formatted;
9674
+ };
9675
+ const columnsType = () => {
9676
+ const firstColumn = options[0];
9677
+ if (firstColumn) {
9678
+ if (Array.isArray(firstColumn)) {
9679
+ return "multiple";
9680
+ }
9681
+ if ("children" in firstColumn) {
9682
+ return "cascade";
9683
+ }
9647
9684
  }
9648
- }, [chooseValueData]);
9649
- useEffect(() => {
9650
- init();
9651
- }, [listData]);
9652
- const closeActionSheet = () => {
9653
- onClose && onClose(chooseValueData, selectedOptions());
9654
- onCloseUpdate && onCloseUpdate(chooseValueData, selectedOptions(), pickerRef);
9685
+ return "single";
9655
9686
  };
9656
- const confirm = () => {
9657
- let movings = false;
9658
- refs.forEach((_ref) => {
9659
- if (_ref.moving)
9660
- movings = true;
9661
- _ref.stopMomentum();
9687
+ const normalListData = () => {
9688
+ const type = columnsType();
9689
+ switch (type) {
9690
+ case "multiple":
9691
+ return options;
9692
+ case "cascade":
9693
+ return formatCascade(options, selectedValue);
9694
+ default:
9695
+ return [options];
9696
+ }
9697
+ };
9698
+ const init = () => {
9699
+ const normalData = normalListData();
9700
+ setColumnsList(normalData);
9701
+ const data = [];
9702
+ normalData.length > 0 && normalData.map((item) => {
9703
+ item[0] && data.push(item[0].value);
9704
+ return item;
9662
9705
  });
9663
- if (movings) {
9664
- isConfirmEvent.current = true;
9665
- } else {
9666
- onConfirm && onConfirm(chooseValueData, selectedOptions());
9706
+ if (!defaultValue.length && selectedValue.length === 0) {
9707
+ setSelectedValue([...data]);
9667
9708
  }
9668
- onClose && onClose(chooseValueData, selectedOptions());
9669
- setTimeout(() => {
9670
- isConfirmEvent.current = false;
9671
- }, 0);
9672
9709
  };
9673
- const selectedOptions = () => {
9674
- const optins = [];
9675
- columnsList.map((column, index) => {
9676
- let currOptions = [];
9677
- currOptions = column.filter(
9678
- (item) => item.value === chooseValueData[index]
9710
+ useEffect(() => {
9711
+ if (!visible) {
9712
+ return;
9713
+ }
9714
+ init();
9715
+ }, [options, visible]);
9716
+ const setSelectedOptions = () => {
9717
+ const options2 = [];
9718
+ let currOptions = [];
9719
+ columnsList.forEach((columnOptions, index) => {
9720
+ currOptions = columnOptions.filter(
9721
+ (item) => item.value === selectedValue[index]
9679
9722
  );
9680
9723
  if (currOptions[0]) {
9681
- optins.push(currOptions[0]);
9724
+ options2.push(currOptions[0]);
9682
9725
  } else {
9683
- column[0] && optins.push(column[0]);
9726
+ columnOptions[0] && options2.push(columnOptions[0]);
9684
9727
  }
9685
- return column;
9686
9728
  });
9687
- return optins;
9729
+ return options2;
9730
+ };
9731
+ const defaultValuesConvert = () => {
9732
+ const defaultIndexs = [];
9733
+ if (selectedValue.length > 0) {
9734
+ selectedValue.forEach((value, index) => {
9735
+ var _a;
9736
+ for (let i = 0; i < ((_a = columnsList == null ? void 0 : columnsList[index]) == null ? void 0 : _a.length); i++) {
9737
+ if (columnsList[index][i].value === value) {
9738
+ defaultIndexs.push(i);
9739
+ break;
9740
+ }
9741
+ }
9742
+ });
9743
+ } else if (columnsList && columnsList.length > 0) {
9744
+ columnsList.forEach((item) => {
9745
+ defaultIndexs.push(0);
9746
+ item.length > 0 && selectedValue.push(item[0].value);
9747
+ });
9748
+ }
9749
+ return defaultIndexs;
9688
9750
  };
9689
- const chooseItem = (option, columnIndex2) => {
9690
- if (option && Object.keys(option).length) {
9691
- if (chooseValueData[columnIndex2] !== option.value) {
9751
+ useEffect(() => {
9752
+ if (!visible) {
9753
+ return;
9754
+ }
9755
+ Taro.getEnv() !== "WEB" && setCurrentValue(defaultValuesConvert());
9756
+ onChange && onChange(setSelectedOptions(), selectedValue, columnIndex);
9757
+ if (isConfirmEvent.current) {
9758
+ isConfirmEvent.current = false;
9759
+ onConfirm && onConfirm(setSelectedOptions(), selectedValue);
9760
+ }
9761
+ }, [selectedValue, columnsList, visible]);
9762
+ const chooseItem = (columnOptions, columnIndex2) => {
9763
+ var _a, _b;
9764
+ if (columnOptions && Object.keys(columnOptions).length) {
9765
+ if (selectedValue[columnIndex2] !== columnOptions.value) {
9692
9766
  if (columnsType() === "cascade") {
9693
- chooseValueData[columnIndex2] = option.value ? option.value : "";
9694
- setchooseValueData([...chooseValueData]);
9695
- let index = columnIndex2;
9696
- let cursor = option;
9697
- while (cursor && cursor.children && cursor.children[0]) {
9698
- chooseValueData[index + 1] = cursor.children[0].value;
9699
- setchooseValueData([...chooseValueData]);
9700
- index++;
9701
- const cc = cursor.children[0];
9702
- cursor = cc;
9767
+ selectedValue[columnIndex2] = columnOptions.value || "";
9768
+ setSelectedValue([...selectedValue]);
9769
+ while ((_a = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _a[0]) {
9770
+ selectedValue[columnIndex2 + 1] = columnOptions.children[0].value;
9771
+ setSelectedValue([...selectedValue]);
9772
+ columnIndex2++;
9773
+ columnOptions = columnOptions.children[0];
9703
9774
  }
9704
- if (cursor && cursor.children) {
9705
- chooseValueData[index + 1] = "";
9706
- setchooseValueData([...chooseValueData]);
9775
+ if ((_b = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _b.length) {
9776
+ selectedValue[columnIndex2 + 1] = "";
9777
+ setSelectedValue([...selectedValue]);
9707
9778
  }
9708
9779
  setColumnsList(normalListData());
9709
9780
  } else {
9710
- setchooseValueData((data) => {
9781
+ setSelectedValue((data) => {
9711
9782
  const cdata = [...data];
9712
9783
  cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(
9713
- option,
9784
+ columnOptions,
9714
9785
  "value"
9715
- ) ? option.value : "";
9786
+ ) ? columnOptions.value : "";
9716
9787
  return cdata;
9717
9788
  });
9718
9789
  }
9719
- setcolumnIndex(columnIndex2);
9790
+ setColumnIndex(columnIndex2);
9720
9791
  }
9721
9792
  }
9722
9793
  };
9723
- const normalListData = () => {
9724
- const type = columnsType();
9725
- switch (type) {
9726
- case "multiple":
9727
- return listData;
9728
- case "cascade":
9729
- return formatCascade(listData, chooseValueData);
9730
- default:
9731
- return [listData];
9794
+ const confirm = () => {
9795
+ let movings = false;
9796
+ refs.forEach((ref2) => {
9797
+ if (ref2.moving)
9798
+ movings = true;
9799
+ ref2.stopMomentum();
9800
+ });
9801
+ if (movings) {
9802
+ isConfirmEvent.current = true;
9803
+ } else {
9804
+ onConfirm && onConfirm(setSelectedOptions(), selectedValue);
9805
+ closePicker();
9732
9806
  }
9807
+ setTimeout(() => {
9808
+ isConfirmEvent.current = false;
9809
+ }, 0);
9733
9810
  };
9734
- const columnsType = () => {
9735
- const firstColumn = listData[0];
9736
- if (firstColumn) {
9737
- if (Array.isArray(firstColumn)) {
9738
- return "multiple";
9739
- }
9740
- if ("children" in firstColumn) {
9741
- return "cascade";
9742
- }
9743
- }
9744
- return "single";
9811
+ const closePicker = () => {
9812
+ onClose && onClose(setSelectedOptions(), selectedValue);
9813
+ afterClose && afterClose(setSelectedOptions(), selectedValue, pickerRef);
9745
9814
  };
9746
- const formatCascade = (columns, defaultValues) => {
9747
- const formatted = [];
9748
- let cursor = {
9749
- text: "",
9750
- value: "",
9751
- children: columns
9752
- };
9753
- let columnIndex2 = 0;
9754
- while (cursor && cursor.children) {
9755
- const options = cursor.children;
9756
- const value = defaultValues[columnIndex2];
9757
- let index = options.findIndex(
9758
- (columnItem) => columnItem.value === value
9759
- );
9760
- if (index === -1)
9761
- index = 0;
9762
- cursor = cursor.children[index];
9763
- columnIndex2++;
9764
- formatted.push(options);
9765
- }
9766
- return formatted;
9815
+ const renderTitleBar = () => {
9816
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__control`, children: [
9817
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
9818
+ "span",
9819
+ {
9820
+ className: `${classPrefix2}__cancel-btn`,
9821
+ onClick: () => closePicker(),
9822
+ children: locale.cancel
9823
+ }
9824
+ ),
9825
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__title`, children: title || "" }),
9826
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `${classPrefix2}__confirm-btn`, onClick: confirm, children: locale.confirm })
9827
+ ] });
9767
9828
  };
9768
- const init = () => {
9769
- const data = [];
9770
- const normalData = normalListData();
9771
- setColumnsList(normalData);
9772
- normalData.length > 0 && normalData.map((item) => {
9773
- item[0] && data.push(item[0].value);
9774
- return item;
9775
- });
9776
- if (!defaultValueData && chooseValueData.length === 0) {
9777
- setchooseValueData([...data]);
9778
- }
9829
+ const [pickingStatus, setPickingStatus] = useState(false);
9830
+ const pickerStart = () => {
9831
+ setPickingStatus(true);
9779
9832
  };
9780
- const renderToolbar = () => {
9781
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: b2("control"), children: [
9782
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: b2("cancel-btn"), onClick: () => closeActionSheet(), children: locale.cancel }),
9783
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b2("title"), children: title || "" }),
9784
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: b2("confirm-btn"), onClick: confirm, children: locale.confirm })
9785
- ] });
9833
+ const pickerEnd = () => {
9834
+ setPickingStatus(false);
9835
+ };
9836
+ const pickerChange = (data) => {
9837
+ const prevDefaultValue = currentValue2;
9838
+ let changeIndex = 0;
9839
+ const list = data.detail.value;
9840
+ for (let i = 0, len = list.length; i < len; i++) {
9841
+ if (prevDefaultValue[i] !== list[i]) {
9842
+ changeIndex = i;
9843
+ break;
9844
+ }
9845
+ }
9846
+ chooseItem(
9847
+ columnsList[changeIndex][data.detail.value[changeIndex]],
9848
+ changeIndex
9849
+ );
9786
9850
  };
9787
9851
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
9788
9852
  Popup,
@@ -9790,36 +9854,50 @@ const InternalPicker = (props, ref) => {
9790
9854
  visible,
9791
9855
  position: "bottom",
9792
9856
  onClose: () => {
9793
- closeActionSheet();
9857
+ closePicker();
9794
9858
  },
9795
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
9796
- View,
9797
- {
9798
- className: `${b2()} ${className || ""}`,
9799
- style,
9800
- ...rest,
9801
- catchMove: true,
9802
- children: [
9803
- renderToolbar(),
9804
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b2("panel"), ref: pickerRef, children: columnsList == null ? void 0 : columnsList.map((item, index) => {
9805
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
9806
- PickerSlot$1,
9807
- {
9808
- ref: setRefs(index),
9809
- defaultValue: chooseValueData == null ? void 0 : chooseValueData[index],
9810
- listData: item,
9811
- threeDimensional,
9812
- chooseItem: (value, index2) => chooseItem(value, index2),
9813
- swipeDuration,
9814
- keyIndex: index,
9815
- itemShow: visible
9816
- },
9817
- index
9818
- );
9819
- }) })
9820
- ]
9821
- }
9822
- )
9859
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(View, { className: classes, style, ...rest, catchMove: true, children: [
9860
+ renderTitleBar(),
9861
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__panel`, ref: pickerRef, children: Taro.getEnv() === "WEB" ? columnsList == null ? void 0 : columnsList.map((item, index) => {
9862
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
9863
+ PickerPanel$1,
9864
+ {
9865
+ ref: setRefs(index),
9866
+ defaultValue: selectedValue == null ? void 0 : selectedValue[index],
9867
+ options: item,
9868
+ threeDimensional,
9869
+ chooseItem: (value, index2) => chooseItem(value, index2),
9870
+ duration,
9871
+ keyIndex: index,
9872
+ itemShow: visible
9873
+ },
9874
+ index
9875
+ );
9876
+ }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
9877
+ PickerView,
9878
+ {
9879
+ ref: pickerRef,
9880
+ value: currentValue2,
9881
+ immediateChange: true,
9882
+ onPickStart: pickerStart,
9883
+ onChange: pickerChange,
9884
+ onPickEnd: pickerEnd,
9885
+ className: "nut-picker-view-panel",
9886
+ children: columnsList == null ? void 0 : columnsList.map((columnOptions, index) => {
9887
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PickerViewColumn, { children: columnOptions.map((item, index2) => {
9888
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
9889
+ View,
9890
+ {
9891
+ className: "nut-picker-roller-item-title",
9892
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: item.text || item })
9893
+ },
9894
+ item.value || index2
9895
+ );
9896
+ }) }, `col${index}`);
9897
+ })
9898
+ }
9899
+ ) })
9900
+ ] })
9823
9901
  }
9824
9902
  );
9825
9903
  };
@@ -9864,7 +9942,7 @@ const DatePicker = (props) => {
9864
9942
  const [show, setShow] = useState(false);
9865
9943
  const [currentDate, setCurrentDate] = useState(modelValue);
9866
9944
  const [defaultValue, setDefaultValue] = useState([]);
9867
- const [listData, setListData] = useState([]);
9945
+ const [options, setListData] = useState([]);
9868
9946
  const pickerRef = useRef(null);
9869
9947
  const isDate = (val) => {
9870
9948
  return Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
@@ -9982,7 +10060,7 @@ const DatePicker = (props) => {
9982
10060
  }
9983
10061
  return result;
9984
10062
  };
9985
- const updateChooseValueCustmer = (index, selectedValue, cacheValueData) => {
10063
+ const updateChooseValueCustmer = (cacheValueData, selectedValue, index) => {
9986
10064
  if (["date", "datetime", "datehour", "month-day", "year-month"].includes(
9987
10065
  type.toLocaleLowerCase()
9988
10066
  )) {
@@ -10021,7 +10099,7 @@ const DatePicker = (props) => {
10021
10099
  const isEqual2 = (currentDate == null ? void 0 : currentDate.getTime()) === (date == null ? void 0 : date.getTime());
10022
10100
  date && isDate(date) && !isEqual2 && setCurrentDate(formatValue(date));
10023
10101
  }
10024
- props.onChange && props.onChange(index, selectedValue, cacheValueData);
10102
+ props.onChange && props.onChange(cacheValueData, selectedValue, index);
10025
10103
  };
10026
10104
  const padZero = (num, targetLength = 2) => {
10027
10105
  let str = `${num}`;
@@ -10118,16 +10196,16 @@ const DatePicker = (props) => {
10118
10196
  style,
10119
10197
  catchMove: true,
10120
10198
  ...rest,
10121
- children: listData.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
10199
+ children: options.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
10122
10200
  Picker$1,
10123
10201
  {
10124
10202
  title,
10125
10203
  visible: show,
10126
- listData,
10204
+ options,
10127
10205
  onClose: onCloseDatePicker,
10128
- defaultValueData: defaultValue,
10129
- onConfirm: (values, options) => onConfirmDatePicker && onConfirmDatePicker(values, options),
10130
- onChange: (index, value, list) => updateChooseValueCustmer(index, value, list),
10206
+ defaultValue,
10207
+ onConfirm: (options2, values) => onConfirmDatePicker && onConfirmDatePicker(options2, values),
10208
+ onChange: (list, value, index) => updateChooseValueCustmer(list, value, index),
10131
10209
  threeDimensional,
10132
10210
  ref: pickerRef
10133
10211
  }
@@ -12931,124 +13009,111 @@ const Switch = (props) => {
12931
13009
  Switch.defaultProps = defaultProps$I;
12932
13010
  Switch.displayName = "NutSwitch";
12933
13011
  const defaultProps$H = {
13012
+ ...ComponentDefaults,
12934
13013
  defaultValue: "",
12935
- textAlign: "left",
12936
- limitshow: false,
12937
- maxlength: "",
12938
- rows: "",
13014
+ showCount: false,
13015
+ maxLength: 140,
12939
13016
  placeholder: "",
12940
- readonly: false,
13017
+ readOnly: false,
12941
13018
  disabled: false,
12942
- autosize: false
13019
+ autoSize: false
12943
13020
  };
12944
13021
  const TextArea = (props) => {
12945
13022
  const { locale } = useConfig$1();
12946
13023
  const {
12947
13024
  className,
13025
+ value,
12948
13026
  defaultValue,
12949
- textAlign,
12950
- limitshow,
12951
- maxlength,
13027
+ showCount,
13028
+ maxLength,
12952
13029
  rows,
12953
13030
  placeholder,
12954
- readonly,
13031
+ readOnly,
12955
13032
  disabled,
12956
- autosize,
13033
+ autoSize,
12957
13034
  style,
12958
13035
  onChange,
12959
13036
  onBlur,
12960
- onFocus
13037
+ onFocus,
13038
+ ...rest
12961
13039
  } = { ...defaultProps$H, ...props };
12962
- const textareaBem = cn("textarea");
12963
- const [inputValue, SetInputValue] = useState("");
12964
- const compositingRef = useRef(false);
12965
- const [, updateState] = React__default.useState({});
12966
- const forceUpdate = React__default.useCallback(() => updateState({}), []);
12967
- useEffect(() => {
12968
- let initValue = defaultValue;
12969
- if (initValue && maxlength && [...initValue].length > Number(maxlength)) {
12970
- initValue = initValue.substring(0, Number(maxlength));
13040
+ const classPrefix2 = "nut-textarea";
13041
+ const compositionRef = useRef(false);
13042
+ const format = (value2) => {
13043
+ if (maxLength !== void 0 && value2.length > maxLength) {
13044
+ return value2.substring(0, maxLength);
12971
13045
  }
12972
- SetInputValue(initValue);
12973
- }, [defaultValue]);
12974
- const textChange = (event) => {
12975
- if (disabled)
12976
- return;
12977
- if (readonly)
12978
- return;
12979
- const text = event.detail ? event.detail : event.target;
12980
- if (maxlength && [...text.value].length > Number(maxlength) && !compositingRef.current) {
12981
- text.value = text.value.substring(0, Number(maxlength));
12982
- }
12983
- if (text.value === inputValue) {
12984
- forceUpdate();
13046
+ return value2;
13047
+ };
13048
+ const [inputValue, setInputValue] = usePropsValue({
13049
+ value,
13050
+ defaultValue,
13051
+ finalValue: format(defaultValue),
13052
+ onChange
13053
+ });
13054
+ const handleChange = (event) => {
13055
+ var _a;
13056
+ const text = (_a = event == null ? void 0 : event.detail) == null ? void 0 : _a.value;
13057
+ if (text) {
13058
+ const value2 = compositionRef.current ? text : format(text);
13059
+ setInputValue(value2);
12985
13060
  } else {
12986
- SetInputValue(text.value);
13061
+ setInputValue("");
12987
13062
  }
12988
- onChange && onChange(text.value, event);
12989
13063
  };
12990
- const textFocus = (event) => {
13064
+ const handleFocus = (event) => {
12991
13065
  if (disabled)
12992
13066
  return;
12993
- if (readonly)
13067
+ if (readOnly)
12994
13068
  return;
12995
13069
  onFocus && onFocus(event);
12996
13070
  };
12997
- const textBlur = (event) => {
13071
+ const handleBlur = (event) => {
12998
13072
  if (disabled)
12999
13073
  return;
13000
- if (readonly)
13074
+ if (readOnly)
13001
13075
  return;
13002
- const text = event.detail ? event.detail : event.target;
13003
- onChange && onChange(text.value, event);
13004
13076
  onBlur && onBlur(event);
13005
13077
  };
13006
- const startComposing = () => {
13007
- compositingRef.current = true;
13008
- };
13009
- const endComposing = () => {
13010
- compositingRef.current = false;
13011
- };
13012
13078
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
13013
13079
  "div",
13014
13080
  {
13015
- className: `${textareaBem()} ${disabled ? textareaBem("disabled") : ""} ${className || ""}`,
13081
+ className: classNames(classPrefix2, className, {
13082
+ [`${classPrefix2}__disabled`]: disabled
13083
+ }),
13016
13084
  children: [
13017
13085
  /* @__PURE__ */ jsxRuntimeExports.jsx(
13018
- "textarea",
13086
+ Textarea,
13019
13087
  {
13020
- className: textareaBem("textarea"),
13021
- style: {
13022
- textAlign,
13023
- resize: `${autosize ? "vertical" : "none"}`,
13024
- ...style
13088
+ nativeProps: {
13089
+ style,
13090
+ readOnly,
13091
+ rows,
13092
+ onCompositionStart: () => {
13093
+ compositionRef.current = true;
13094
+ },
13095
+ onCompositionEnd: () => {
13096
+ compositionRef.current = false;
13097
+ }
13025
13098
  },
13026
- readOnly: disabled || readonly,
13099
+ className: `${classPrefix2}__textarea`,
13100
+ style: Taro.getEnv() === "WEB" ? void 0 : style,
13101
+ disabled: Taro.getEnv() === "WEB" ? disabled : disabled || readOnly,
13027
13102
  value: inputValue,
13028
- onInput: (e) => {
13029
- textChange(e);
13030
- },
13031
- onChange: (e) => {
13032
- textChange(e);
13033
- },
13034
- onBlur: (e) => {
13035
- textBlur(e);
13036
- },
13037
- onFocus: (e) => {
13038
- textFocus(e);
13039
- },
13040
- onCompositionEnd: (e) => endComposing(),
13041
- onCompositionStart: (e) => startComposing(),
13042
- rows,
13043
- maxLength: maxlength < 0 ? 0 : maxlength,
13044
- placeholder: placeholder || locale.placeholder
13103
+ onInput: (e) => handleChange(e),
13104
+ onBlur: (e) => handleBlur(e),
13105
+ onFocus: (e) => handleFocus(e),
13106
+ autoHeight: autoSize,
13107
+ maxlength: maxLength,
13108
+ placeholder: placeholder || locale.placeholder,
13109
+ ...rest
13045
13110
  }
13046
13111
  ),
13047
- limitshow ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: textareaBem("limit"), children: [
13048
- [...inputValue].length,
13112
+ showCount && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__limit`, children: [
13113
+ inputValue.length,
13049
13114
  "/",
13050
- maxlength < 0 ? 0 : maxlength
13051
- ] }) : null
13115
+ maxLength < 0 ? 0 : maxLength
13116
+ ] })
13052
13117
  ]
13053
13118
  }
13054
13119
  );
@@ -22623,13 +22688,11 @@ Steps.defaultProps = defaultProps$a;
22623
22688
  Steps.displayName = "NutSteps";
22624
22689
  const defaultProps$9 = {
22625
22690
  ...ComponentDefaults,
22626
- className: "",
22627
- style: {},
22628
22691
  columns: [],
22629
22692
  data: [],
22630
22693
  bordered: true,
22631
22694
  striped: false,
22632
- noData: "无数据",
22695
+ noData: "",
22633
22696
  sorterIcon: null,
22634
22697
  showHeader: true
22635
22698
  };
@@ -22647,8 +22710,8 @@ const Table = (props) => {
22647
22710
  striped,
22648
22711
  noData,
22649
22712
  sorterIcon,
22650
- onSorter,
22651
22713
  showHeader,
22714
+ onSort,
22652
22715
  ...rest
22653
22716
  } = {
22654
22717
  ...defaultProps$9,
@@ -22660,12 +22723,13 @@ const Table = (props) => {
22660
22723
  setCurData(data);
22661
22724
  }
22662
22725
  }, [data]);
22663
- const b2 = cn("table");
22664
- const classes = classNames({});
22665
- const cls = classNames(b2(), classes, className);
22726
+ const classPrefix2 = "nut-table";
22727
+ const headerClassPrefix = `${classPrefix2}__main__head__tr`;
22728
+ const bodyClassPrefix = `${classPrefix2}__main__body__tr`;
22729
+ const cls = classNames(classPrefix2, className);
22666
22730
  const handleSorterClick = (item) => {
22667
22731
  if (item.sorter) {
22668
- onSorter && onSorter(item, curData);
22732
+ onSort && onSort(item, curData);
22669
22733
  if (typeof item.sorter === "function") {
22670
22734
  setCurData(curData.sort(item.sorter));
22671
22735
  } else {
@@ -22675,8 +22739,8 @@ const Table = (props) => {
22675
22739
  };
22676
22740
  const cellClasses = (item) => {
22677
22741
  return {
22678
- "nut-table__main__head__tr--border": props.bordered,
22679
- [`nut-table__main__head__tr--align${item.align ? item.align : ""}`]: true
22742
+ [`${headerClassPrefix}--border`]: props.bordered,
22743
+ [`${headerClassPrefix}--align${item.align ? item.align : ""}`]: true
22680
22744
  };
22681
22745
  };
22682
22746
  const getColumnItem = (value) => {
@@ -22687,10 +22751,7 @@ const Table = (props) => {
22687
22751
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
22688
22752
  "span",
22689
22753
  {
22690
- className: classNames(
22691
- "nut-table__main__head__tr__th",
22692
- cellClasses(item)
22693
- ),
22754
+ className: classNames(`${headerClassPrefix}__th`, cellClasses(item)),
22694
22755
  onClick: () => handleSorterClick(item),
22695
22756
  children: [
22696
22757
  item.title,
@@ -22713,7 +22774,7 @@ const Table = (props) => {
22713
22774
  "span",
22714
22775
  {
22715
22776
  className: classNames(
22716
- "nut-table__main__body__tr__td",
22777
+ `${bodyClassPrefix}__td`,
22717
22778
  cellClasses(getColumnItem(value))
22718
22779
  ),
22719
22780
  children: typeof item[value] === "function" || typeof render === "function" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: render ? render(item) : item[value](item) }) : item[value]
@@ -22724,24 +22785,23 @@ const Table = (props) => {
22724
22785
  };
22725
22786
  const renderBoyTrs = () => {
22726
22787
  return curData.map((item, index) => {
22727
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__main__body__tr", children: renderBodyTds(item) }, index);
22788
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: bodyClassPrefix, children: renderBodyTds(item) }, index);
22728
22789
  });
22729
22790
  };
22730
22791
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cls, style, ...rest, children: [
22731
22792
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
22732
22793
  "div",
22733
22794
  {
22734
- className: classNames("nut-table__main", {
22735
- "nut-table__main--striped": striped
22795
+ className: classNames(`${classPrefix2}__main`, {
22796
+ [`${classPrefix2}__main--striped`]: striped
22736
22797
  }),
22737
22798
  children: [
22738
- showHeader && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__main__head", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__main__head__tr", children: renderHeadCells() }) }),
22739
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__main__body", children: renderBoyTrs() })
22799
+ showHeader && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__main__head`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: headerClassPrefix, children: renderHeadCells() }) }),
22800
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__main__body`, children: renderBoyTrs() })
22740
22801
  ]
22741
22802
  }
22742
22803
  ),
22743
- summary && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__summary", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "nut-table__summary__text", children: summary }) }),
22744
- curData.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__nodata", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__nodata", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__nodata__text", children: noData }) }) })
22804
+ (summary || curData.length === 0) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__summary`, children: summary || noData })
22745
22805
  ] });
22746
22806
  };
22747
22807
  Table.defaultProps = defaultProps$9;