@nutui/nutui-react 2.3.12-beta.0 → 2.4.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/esm/ActionSheet.js +30 -76
  3. package/dist/esm/Address.js +80 -171
  4. package/dist/esm/Animate.js +21 -49
  5. package/dist/esm/AnimatingNumbers/style/style.css +1 -1
  6. package/dist/esm/AnimatingNumbers.js +47 -120
  7. package/dist/esm/Audio.js +88 -159
  8. package/dist/esm/Avatar.js +44 -91
  9. package/dist/esm/AvatarCropper.js +149 -268
  10. package/dist/esm/AvatarGroup.js +13 -44
  11. package/dist/esm/BackTop.js +34 -75
  12. package/dist/esm/Badge/style/style.css +1 -1
  13. package/dist/esm/Barrage.js +49 -83
  14. package/dist/esm/Calendar.js +27 -119
  15. package/dist/esm/CalendarCard.js +180 -291
  16. package/dist/esm/CalendarItem.js +253 -314
  17. package/dist/esm/Card.js +38 -72
  18. package/dist/esm/Cell.js +27 -62
  19. package/dist/esm/CellGroup.js +16 -45
  20. package/dist/esm/Checkbox/style/style.css +1 -1
  21. package/dist/esm/CheckboxGroup/style/style.css +1 -1
  22. package/dist/esm/CheckboxGroup.js +52 -85
  23. package/dist/esm/CircleProgress.js +42 -93
  24. package/dist/esm/Col.js +17 -48
  25. package/dist/esm/Collapse/style/style.css +1 -1
  26. package/dist/esm/Collapse.js +18 -49
  27. package/dist/esm/CollapseItem/style/style.css +1 -1
  28. package/dist/esm/ConfigProvider.js +3 -2
  29. package/dist/esm/CountDown.js +63 -102
  30. package/dist/esm/DatePicker.js +88 -128
  31. package/dist/esm/Dialog/style/style.css +1 -1
  32. package/dist/esm/Dialog.js +124 -197
  33. package/dist/esm/Divider.js +16 -36
  34. package/dist/esm/Drag.js +32 -76
  35. package/dist/esm/Elevator.js +93 -133
  36. package/dist/esm/Ellipsis.js +71 -92
  37. package/dist/esm/Empty.js +31 -70
  38. package/dist/esm/FixedNav.js +32 -81
  39. package/dist/esm/Form.js +28 -61
  40. package/dist/esm/Grid.js +27 -51
  41. package/dist/esm/Image.js +47 -102
  42. package/dist/esm/ImagePreview.js +82 -135
  43. package/dist/esm/InfiniteLoading.js +77 -159
  44. package/dist/esm/Input.js +57 -125
  45. package/dist/esm/InputNumber/style/style.css +1 -1
  46. package/dist/esm/InputNumber.js +67 -97
  47. package/dist/esm/Layout.js +4 -28
  48. package/dist/esm/Loading.js +13 -40
  49. package/dist/esm/Menu.js +51 -105
  50. package/dist/esm/NavBar.js +46 -85
  51. package/dist/esm/NoticeBar/style/style.css +1 -1
  52. package/dist/esm/NoticeBar.js +158 -227
  53. package/dist/esm/Notify.js +87 -178
  54. package/dist/esm/NumberKeyboard.js +84 -150
  55. package/dist/esm/Pagination.js +58 -97
  56. package/dist/esm/Picker.js +215 -276
  57. package/dist/esm/Popover/style/style.css +1 -1
  58. package/dist/esm/Popover.js +112 -159
  59. package/dist/esm/Price.js +23 -60
  60. package/dist/esm/Progress.js +47 -77
  61. package/dist/esm/PullToRefresh.js +94 -201
  62. package/dist/esm/RadioGroup.js +23 -53
  63. package/dist/esm/Range.js +113 -177
  64. package/dist/esm/Rate.js +48 -95
  65. package/dist/esm/Row.js +19 -43
  66. package/dist/esm/SearchBar.js +52 -119
  67. package/dist/esm/ShortPassword.js +58 -106
  68. package/dist/esm/SideNavBar.js +34 -59
  69. package/dist/esm/SideNavBarItem.js +7 -36
  70. package/dist/esm/Signature.js +49 -84
  71. package/dist/esm/Skeleton.js +31 -68
  72. package/dist/esm/Space.js +7 -34
  73. package/dist/esm/Step.js +35 -64
  74. package/dist/esm/Steps.js +16 -40
  75. package/dist/esm/Sticky.js +64 -108
  76. package/dist/esm/SubSideNavBar.js +42 -71
  77. package/dist/esm/Swipe/style/style.css +1 -1
  78. package/dist/esm/Swipe.js +79 -143
  79. package/dist/esm/Swiper.js +137 -184
  80. package/dist/esm/SwiperItem.js +13 -38
  81. package/dist/esm/Switch.js +20 -53
  82. package/dist/esm/TabPane.js +6 -30
  83. package/dist/esm/Tabbar/style/style.css +1 -1
  84. package/dist/esm/Tabbar.js +29 -59
  85. package/dist/esm/TabbarItem/style/style.css +1 -1
  86. package/dist/esm/Table.js +99 -147
  87. package/dist/esm/Tag.js +30 -74
  88. package/dist/esm/TextArea.js +37 -82
  89. package/dist/esm/TimeDetail.js +20 -58
  90. package/dist/esm/TimeSelect.js +57 -95
  91. package/dist/esm/Toast.js +110 -197
  92. package/dist/esm/Tour/style/style.css +1 -1
  93. package/dist/esm/Tour.js +88 -132
  94. package/dist/esm/TrendArrow.js +32 -74
  95. package/dist/esm/Uploader.js +226 -346
  96. package/dist/esm/UserContext.js +1 -1
  97. package/dist/esm/Video.js +34 -67
  98. package/dist/esm/VirtualList.js +127 -160
  99. package/dist/esm/WaterMark.js +24 -68
  100. package/dist/esm/badge2.js +26 -53
  101. package/dist/esm/button2.js +30 -63
  102. package/dist/esm/can-use-dom.js +1 -1
  103. package/dist/esm/cascader2.js +307 -536
  104. package/dist/esm/checkbox2.js +70 -96
  105. package/dist/esm/collapseitem2.js +48 -86
  106. package/dist/esm/configprovider2.js +43 -1003
  107. package/dist/esm/context.js +1 -1
  108. package/dist/esm/context2.js +1 -1
  109. package/dist/esm/context3.js +1 -1
  110. package/dist/esm/context4.js +1 -1
  111. package/dist/esm/context5.js +8 -8
  112. package/dist/esm/date.js +88 -66
  113. package/dist/esm/formitem2.js +236 -1510
  114. package/dist/esm/get-scroll-parent.js +8 -10
  115. package/dist/esm/griditem2.js +34 -52
  116. package/dist/esm/index.js +5 -12
  117. package/dist/esm/indicator2.js +13 -42
  118. package/dist/esm/menuitem2.js +81 -124
  119. package/dist/esm/overlay2.js +39 -78
  120. package/dist/esm/pad-zero.js +3 -4
  121. package/dist/esm/popup2.js +79 -124
  122. package/dist/esm/px-check.js +2 -2
  123. package/dist/esm/radio2.js +48 -79
  124. package/dist/esm/raf.js +5 -3
  125. package/dist/esm/render.js +17 -54
  126. package/dist/esm/safearea2.js +3 -5
  127. package/dist/esm/supports-passive.js +3 -3
  128. package/dist/esm/tabbaritem2.js +42 -58
  129. package/dist/esm/tabs2.js +82 -120
  130. package/dist/esm/tslib.es6.js +47 -0
  131. package/dist/esm/types/src/packages/button/demos/h5/demo1.d.ts +3 -0
  132. package/dist/esm/types/src/packages/button/demos/h5/demo2.d.ts +3 -0
  133. package/dist/esm/types/src/packages/button/demos/h5/demo3.d.ts +3 -0
  134. package/dist/esm/types/src/packages/button/demos/h5/demo4.d.ts +3 -0
  135. package/dist/esm/types/src/packages/button/demos/h5/demo5.d.ts +3 -0
  136. package/dist/esm/types/src/packages/button/demos/h5/demo6.d.ts +3 -0
  137. package/dist/esm/types/src/packages/button/demos/h5/demo7.d.ts +3 -0
  138. package/dist/esm/types/src/packages/button/demos/h5/demo8.d.ts +3 -0
  139. package/dist/esm/types/src/packages/button/demos/h5/demo9.d.ts +3 -0
  140. package/dist/esm/types/src/packages/button/demos/taro/demo1.d.ts +3 -0
  141. package/dist/esm/types/src/packages/button/demos/taro/demo10.d.ts +3 -0
  142. package/dist/esm/types/src/packages/button/demos/taro/demo2.d.ts +3 -0
  143. package/dist/esm/types/src/packages/button/demos/taro/demo3.d.ts +3 -0
  144. package/dist/esm/types/src/packages/button/demos/taro/demo4.d.ts +3 -0
  145. package/dist/esm/types/src/packages/button/demos/taro/demo5.d.ts +3 -0
  146. package/dist/esm/types/src/packages/button/demos/taro/demo6.d.ts +3 -0
  147. package/dist/esm/types/src/packages/button/demos/taro/demo7.d.ts +3 -0
  148. package/dist/esm/types/src/packages/button/demos/taro/demo8.d.ts +3 -0
  149. package/dist/esm/types/src/packages/button/demos/taro/demo9.d.ts +3 -0
  150. package/dist/esm/types/src/packages/cell/demo.d.ts +0 -1
  151. package/dist/esm/types/src/packages/cell/demo.taro.d.ts +0 -1
  152. package/dist/esm/types/src/packages/cell/demos/h5/demo1.d.ts +3 -0
  153. package/dist/esm/types/src/packages/cell/demos/h5/demo2.d.ts +3 -0
  154. package/dist/esm/types/src/packages/cell/demos/h5/demo3.d.ts +3 -0
  155. package/dist/esm/types/src/packages/cell/demos/h5/demo4.d.ts +3 -0
  156. package/dist/esm/types/src/packages/cell/demos/h5/demo5.d.ts +3 -0
  157. package/dist/esm/types/src/packages/cell/demos/h5/demo6.d.ts +3 -0
  158. package/dist/esm/types/src/packages/cell/demos/h5/demo7.d.ts +3 -0
  159. package/dist/esm/types/src/packages/cell/demos/taro/demo1.d.ts +3 -0
  160. package/dist/esm/types/src/packages/cell/demos/taro/demo2.d.ts +3 -0
  161. package/dist/esm/types/src/packages/cell/demos/taro/demo3.d.ts +3 -0
  162. package/dist/esm/types/src/packages/cell/demos/taro/demo4.d.ts +3 -0
  163. package/dist/esm/types/src/packages/cell/demos/taro/demo5.d.ts +3 -0
  164. package/dist/esm/types/src/packages/cell/demos/taro/demo6.d.ts +3 -0
  165. package/dist/esm/types/src/packages/cell/demos/taro/demo7.d.ts +3 -0
  166. package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.d.ts +1 -0
  167. package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.taro.d.ts +1 -0
  168. package/dist/esm/types/src/packages/checkboxgroup/context.d.ts +1 -0
  169. package/dist/esm/types/src/packages/configprovider/configprovider.d.ts +1 -0
  170. package/dist/esm/types/src/packages/configprovider/configprovider.taro.d.ts +1 -0
  171. package/dist/esm/types/src/packages/configprovider/index.d.ts +2 -2
  172. package/dist/esm/types/src/packages/configprovider/index.taro.d.ts +2 -2
  173. package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
  174. package/dist/esm/types/src/packages/dialog/config.d.ts +3 -3
  175. package/dist/esm/types/src/packages/dialog/index.d.ts +1 -1
  176. package/dist/esm/types/src/packages/inputnumber/inputnumber.taro.d.ts +2 -0
  177. package/dist/esm/types/src/packages/noticebar/index.d.ts +1 -0
  178. package/dist/esm/types/src/packages/noticebar/noticebar.d.ts +2 -0
  179. package/dist/esm/types/src/packages/noticebar/noticebar.taro.d.ts +2 -0
  180. package/dist/esm/types/src/packages/noticebar/types.d.ts +1 -0
  181. package/dist/esm/types/src/packages/popover/index.d.ts +2 -1
  182. package/dist/esm/types/src/packages/popover/index.taro.d.ts +2 -1
  183. package/dist/esm/types/src/packages/popover/popover.d.ts +2 -12
  184. package/dist/esm/types/src/packages/popover/popover.taro.d.ts +2 -12
  185. package/dist/esm/types/src/packages/popover/types.d.ts +14 -0
  186. package/dist/esm/types/src/packages/table/useTableSticky.d.ts +1 -1
  187. package/dist/esm/types/src/packages/toast/toast.taro.d.ts +7 -3
  188. package/dist/esm/types/src/packages/tour/tour.d.ts +1 -1
  189. package/dist/esm/types/src/packages/tour/tour.taro.d.ts +1 -1
  190. package/dist/esm/typings.js +1 -1
  191. package/dist/esm/use-click-away.js +9 -13
  192. package/dist/esm/use-client-rect.js +4 -4
  193. package/dist/esm/use-props-value.js +10 -15
  194. package/dist/esm/use-refs.js +5 -7
  195. package/dist/esm/use-touch.js +16 -20
  196. package/dist/locales/base.js +1 -1
  197. package/dist/locales/en-US.js +1 -1
  198. package/dist/locales/id-ID.js +1 -1
  199. package/dist/locales/tr-TR.js +1 -1
  200. package/dist/locales/zh-CN.js +1 -1
  201. package/dist/locales/zh-TW.js +1 -1
  202. package/dist/locales/zh-UG.js +1 -1
  203. package/dist/nutui.react.es.js +297 -310
  204. package/dist/nutui.react.umd.js +294 -307
  205. package/dist/packages/animatingnumbers/countup.scss +1 -0
  206. package/dist/packages/badge/badge.scss +2 -0
  207. package/dist/packages/checkbox/checkbox.scss +19 -0
  208. package/dist/packages/checkboxgroup/checkboxgroup.scss +25 -0
  209. package/dist/packages/collapseitem/collapseitem.scss +1 -6
  210. package/dist/packages/dialog/dialog.scss +8 -1
  211. package/dist/packages/noticebar/noticebar.scss +19 -1
  212. package/dist/packages/popover/popover.scss +21 -0
  213. package/dist/packages/swipe/swipe.scss +2 -0
  214. package/dist/style.css +1 -1
  215. package/dist/style.mjs +1 -1
  216. package/dist/styles/variables-jmapp.scss +17 -0
  217. package/dist/styles/variables.scss +19 -12
  218. package/dist/types/index.d.ts +98 -98
  219. package/dist/types/packages/actionsheet/actionsheet.d.ts +1 -1
  220. package/dist/types/packages/actionsheet/actionsheet.taro.d.ts +1 -1
  221. package/dist/types/packages/address/address.d.ts +1 -1
  222. package/dist/types/packages/address/address.taro.d.ts +1 -1
  223. package/dist/types/packages/address/customRender.d.ts +1 -1
  224. package/dist/types/packages/address/customRender.taro.d.ts +1 -1
  225. package/dist/types/packages/avatar/avatar.d.ts +1 -1
  226. package/dist/types/packages/avatar/avatar.taro.d.ts +1 -1
  227. package/dist/types/packages/badge/badge.d.ts +1 -1
  228. package/dist/types/packages/button/demos/h5/demo1.d.ts +3 -0
  229. package/dist/types/packages/button/demos/h5/demo2.d.ts +3 -0
  230. package/dist/types/packages/button/demos/h5/demo3.d.ts +3 -0
  231. package/dist/types/packages/button/demos/h5/demo4.d.ts +3 -0
  232. package/dist/types/packages/button/demos/h5/demo5.d.ts +3 -0
  233. package/dist/types/packages/button/demos/h5/demo6.d.ts +3 -0
  234. package/dist/types/packages/button/demos/h5/demo7.d.ts +3 -0
  235. package/dist/types/packages/button/demos/h5/demo8.d.ts +3 -0
  236. package/dist/types/packages/button/demos/h5/demo9.d.ts +3 -0
  237. package/dist/types/packages/button/demos/taro/demo1.d.ts +3 -0
  238. package/dist/types/packages/button/demos/taro/demo10.d.ts +3 -0
  239. package/dist/types/packages/button/demos/taro/demo2.d.ts +3 -0
  240. package/dist/types/packages/button/demos/taro/demo3.d.ts +3 -0
  241. package/dist/types/packages/button/demos/taro/demo4.d.ts +3 -0
  242. package/dist/types/packages/button/demos/taro/demo5.d.ts +3 -0
  243. package/dist/types/packages/button/demos/taro/demo6.d.ts +3 -0
  244. package/dist/types/packages/button/demos/taro/demo7.d.ts +3 -0
  245. package/dist/types/packages/button/demos/taro/demo8.d.ts +3 -0
  246. package/dist/types/packages/button/demos/taro/demo9.d.ts +3 -0
  247. package/dist/types/packages/calendaritem/calendaritem.d.ts +1 -1
  248. package/dist/types/packages/calendaritem/calendaritem.taro.d.ts +1 -1
  249. package/dist/types/packages/cascader/cascader.d.ts +1 -1
  250. package/dist/types/packages/cascader/cascader.taro.d.ts +1 -1
  251. package/dist/types/packages/cell/cell.d.ts +1 -1
  252. package/dist/types/packages/cell/cell.taro.d.ts +1 -1
  253. package/dist/types/packages/cell/demos/h5/demo1.d.ts +3 -0
  254. package/dist/types/packages/cell/demos/h5/demo2.d.ts +3 -0
  255. package/dist/types/packages/cell/demos/h5/demo3.d.ts +3 -0
  256. package/dist/types/packages/cell/demos/h5/demo4.d.ts +3 -0
  257. package/dist/types/packages/cell/demos/h5/demo5.d.ts +3 -0
  258. package/dist/types/packages/cell/demos/h5/demo6.d.ts +3 -0
  259. package/dist/types/packages/cell/demos/h5/demo7.d.ts +3 -0
  260. package/dist/types/packages/cell/demos/taro/demo1.d.ts +3 -0
  261. package/dist/types/packages/cell/demos/taro/demo2.d.ts +3 -0
  262. package/dist/types/packages/cell/demos/taro/demo3.d.ts +3 -0
  263. package/dist/types/packages/cell/demos/taro/demo4.d.ts +3 -0
  264. package/dist/types/packages/cell/demos/taro/demo5.d.ts +3 -0
  265. package/dist/types/packages/cell/demos/taro/demo6.d.ts +3 -0
  266. package/dist/types/packages/cell/demos/taro/demo7.d.ts +3 -0
  267. package/dist/types/packages/checkbox/checkbox.d.ts +2 -2
  268. package/dist/types/packages/checkbox/checkbox.taro.d.ts +2 -2
  269. package/dist/types/packages/checkboxgroup/checkboxgroup.d.ts +3 -2
  270. package/dist/types/packages/checkboxgroup/checkboxgroup.taro.d.ts +3 -2
  271. package/dist/types/packages/checkboxgroup/context.d.ts +1 -0
  272. package/dist/types/packages/configprovider/configprovider.d.ts +1 -0
  273. package/dist/types/packages/configprovider/configprovider.taro.d.ts +1 -0
  274. package/dist/types/packages/configprovider/index.d.ts +2 -2
  275. package/dist/types/packages/configprovider/index.taro.d.ts +2 -2
  276. package/dist/types/packages/configprovider/types.d.ts +1 -1
  277. package/dist/types/packages/datepicker/datepicker.d.ts +1 -1
  278. package/dist/types/packages/datepicker/datepicker.taro.d.ts +1 -1
  279. package/dist/types/packages/dialog/config.d.ts +3 -3
  280. package/dist/types/packages/dialog/dialogwrap.d.ts +1 -1
  281. package/dist/types/packages/dialog/index.d.ts +1 -1
  282. package/dist/types/packages/empty/empty.d.ts +16 -4
  283. package/dist/types/packages/fixednav/fixednav.d.ts +1 -1
  284. package/dist/types/packages/fixednav/fixednav.taro.d.ts +1 -1
  285. package/dist/types/packages/form/form.d.ts +1 -1
  286. package/dist/types/packages/form/form.taro.d.ts +1 -1
  287. package/dist/types/packages/form/index.d.ts +1 -1
  288. package/dist/types/packages/form/index.taro.d.ts +1 -1
  289. package/dist/types/packages/inputnumber/inputnumber.taro.d.ts +2 -0
  290. package/dist/types/packages/menu/menu.d.ts +1 -1
  291. package/dist/types/packages/menu/menu.taro.d.ts +1 -1
  292. package/dist/types/packages/noticebar/index.d.ts +1 -0
  293. package/dist/types/packages/noticebar/noticebar.d.ts +6 -0
  294. package/dist/types/packages/noticebar/noticebar.taro.d.ts +2 -0
  295. package/dist/types/packages/noticebar/types.d.ts +1 -0
  296. package/dist/types/packages/numberkeyboard/numberkeyboard.d.ts +1 -1
  297. package/dist/types/packages/numberkeyboard/numberkeyboard.taro.d.ts +1 -1
  298. package/dist/types/packages/nutui.react.d.ts +98 -98
  299. package/dist/types/packages/nutui.react.taro.d.ts +98 -98
  300. package/dist/types/packages/nutui.taro.react.build.d.ts +98 -98
  301. package/dist/types/packages/picker/picker.d.ts +1 -1
  302. package/dist/types/packages/picker/picker.taro.d.ts +1 -1
  303. package/dist/types/packages/popover/index.d.ts +2 -1
  304. package/dist/types/packages/popover/index.taro.d.ts +2 -1
  305. package/dist/types/packages/popover/popover.d.ts +3 -13
  306. package/dist/types/packages/popover/popover.taro.d.ts +3 -13
  307. package/dist/types/packages/popover/types.d.ts +14 -0
  308. package/dist/types/packages/popup/popup.d.ts +1 -1
  309. package/dist/types/packages/popup/popup.taro.d.ts +1 -1
  310. package/dist/types/packages/radio/radio.d.ts +2 -2
  311. package/dist/types/packages/radio/radio.taro.d.ts +2 -2
  312. package/dist/types/packages/rate/rate.d.ts +1 -1
  313. package/dist/types/packages/shortpassword/shortpassword.d.ts +1 -1
  314. package/dist/types/packages/shortpassword/shortpassword.taro.d.ts +1 -1
  315. package/dist/types/packages/swiper/index.d.ts +1 -1
  316. package/dist/types/packages/swiper/index.taro.d.ts +1 -1
  317. package/dist/types/packages/table/useTableSticky.d.ts +1 -1
  318. package/dist/types/packages/tabs/tabs.d.ts +1 -1
  319. package/dist/types/packages/tabs/tabs.taro.d.ts +1 -1
  320. package/dist/types/packages/timedetail/timedetail.d.ts +1 -1
  321. package/dist/types/packages/timedetail/timedetail.taro.d.ts +1 -1
  322. package/dist/types/packages/toast/toast.d.ts +2 -2
  323. package/dist/types/packages/toast/toast.taro.d.ts +7 -3
  324. package/dist/types/packages/tour/tour.d.ts +1 -1
  325. package/dist/types/packages/tour/tour.taro.d.ts +1 -1
  326. package/package.json +5 -1
@@ -1,19 +1,12 @@
1
1
  (function(global2, factory) {
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-dom")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-dom"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory((global2.nutui = global2.nutui || {}, global2.nutui.react = {}), global2.React, global2.ReactDOM));
3
3
  })(this, function(exports2, React, ReactDOM) {
4
- "use strict";var __defProp = Object.defineProperty;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __publicField = (obj, key, value) => {
7
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8
- return value;
9
- };
10
- /*!
11
- * @nutui/nutui-react v2.3.12-beta.0 Thu Feb 29 2024 14:38:01 GMT+0800 (China Standard Time)
4
+ "use strict";/*!
5
+ * @nutui/nutui-react v2.4.0-beta.0 Fri Mar 08 2024 14:11:47 GMT+0800 (China Standard Time)
12
6
  * (c) 2023 @jdf2e.
13
7
  * Released under the MIT License.
14
8
  */
15
9
 
16
- var _a;
17
10
  function _interopNamespaceDefault(e2) {
18
11
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
19
12
  if (e2) {
@@ -1714,8 +1707,8 @@ Check the top-level render call using <` + t2 + ">.");
1714
1707
  var reIsNative = RegExp(
1715
1708
  "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1716
1709
  );
1717
- var Buffer2 = moduleExports ? root2.Buffer : void 0, Symbol2 = root2.Symbol, Uint8Array2 = root2.Uint8Array, propertyIsEnumerable = objectProto2.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
1718
- var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object);
1710
+ var Buffer = moduleExports ? root2.Buffer : void 0, Symbol2 = root2.Symbol, Uint8Array = root2.Uint8Array, propertyIsEnumerable = objectProto2.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
1711
+ var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object);
1719
1712
  var DataView = getNative(root2, "DataView"), Map2 = getNative(root2, "Map"), Promise2 = getNative(root2, "Promise"), Set2 = getNative(root2, "Set"), WeakMap2 = getNative(root2, "WeakMap"), nativeCreate = getNative(Object, "create");
1720
1713
  var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
1721
1714
  var symbolProto2 = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto2 ? symbolProto2.valueOf : void 0;
@@ -2047,7 +2040,7 @@ Check the top-level render call using <` + t2 + ">.");
2047
2040
  object2 = object2.buffer;
2048
2041
  other = other.buffer;
2049
2042
  case arrayBufferTag:
2050
- if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object2), new Uint8Array2(other))) {
2043
+ if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array(object2), new Uint8Array(other))) {
2051
2044
  return false;
2052
2045
  }
2053
2046
  return true;
@@ -2404,11 +2397,23 @@ Check the top-level render call using <` + t2 + ">.");
2404
2397
  errorCanvasTips: "当前环境不支持Canvas"
2405
2398
  }
2406
2399
  };
2400
+ const inBrowser = typeof window !== "undefined";
2401
+ function requestAniFrame() {
2402
+ if (typeof window !== "undefined") {
2403
+ const _window = window;
2404
+ return _window.requestAnimationFrame || _window.webkitRequestAnimationFrame || function(callback) {
2405
+ _window.setTimeout(callback, 1e3 / 60);
2406
+ };
2407
+ }
2408
+ return (callback) => {
2409
+ setTimeout(callback, 1e3 / 60);
2410
+ };
2411
+ }
2412
+ const requestAniFrame$1 = requestAniFrame();
2407
2413
  const classPrefix$p = "nut-configprovider";
2408
2414
  const defaultConfigRef = {
2409
2415
  current: {
2410
- locale: zhCN,
2411
- direction: "ltr"
2416
+ locale: zhCN
2412
2417
  }
2413
2418
  };
2414
2419
  const getDefaultConfig = () => {
@@ -2425,16 +2430,24 @@ Check the top-level render call using <` + t2 + ">.");
2425
2430
  });
2426
2431
  return cssVars;
2427
2432
  }
2433
+ const useRtl = () => {
2434
+ const { direction } = useConfig();
2435
+ if (direction) {
2436
+ return direction === "rtl";
2437
+ }
2438
+ return inBrowser && document.dir === "rtl";
2439
+ };
2428
2440
  const ConfigProvider = (props) => {
2429
2441
  const { style, className, children, direction, ...config2 } = props;
2430
2442
  const mergedConfig = useMemo(
2431
2443
  () => {
2432
2444
  return {
2433
2445
  ...getDefaultConfig(),
2434
- ...config2
2446
+ ...config2,
2447
+ direction
2435
2448
  };
2436
2449
  },
2437
- [config2],
2450
+ [config2, direction],
2438
2451
  (prev, next) => prev.some((prevTheme, index) => {
2439
2452
  const nextTheme = next[index];
2440
2453
  return !isequal(prevTheme, nextTheme);
@@ -5127,18 +5140,6 @@ Check the top-level render call using <` + t2 + ">.");
5127
5140
  }
5128
5141
  );
5129
5142
  };
5130
- function requestAniFrame() {
5131
- if (typeof window !== "undefined") {
5132
- const _window = window;
5133
- return _window.requestAnimationFrame || _window.webkitRequestAnimationFrame || function(callback) {
5134
- _window.setTimeout(callback, 1e3 / 60);
5135
- };
5136
- }
5137
- return (callback) => {
5138
- setTimeout(callback, 1e3 / 60);
5139
- };
5140
- }
5141
- const requestAniFrame$1 = requestAniFrame();
5142
5143
  const defaultProps$1i = {
5143
5144
  ...ComponentDefaults,
5144
5145
  target: "",
@@ -5213,13 +5214,13 @@ Check the top-level render call using <` + t2 + ">.");
5213
5214
  window.cancelAnimationFrame = window.webkitCancelAnimationFrame;
5214
5215
  };
5215
5216
  function addEventListener() {
5216
- var _a2, _b;
5217
- (_a2 = scrollEl.current) == null ? void 0 : _a2.addEventListener("scroll", scrollListener, false);
5217
+ var _a, _b;
5218
+ (_a = scrollEl.current) == null ? void 0 : _a.addEventListener("scroll", scrollListener, false);
5218
5219
  (_b = scrollEl.current) == null ? void 0 : _b.addEventListener("resize", scrollListener, false);
5219
5220
  }
5220
5221
  function removeEventListener() {
5221
- var _a2, _b;
5222
- (_a2 = scrollEl.current) == null ? void 0 : _a2.removeEventListener("scroll", scrollListener, false);
5222
+ var _a, _b;
5223
+ (_a = scrollEl.current) == null ? void 0 : _a.removeEventListener("scroll", scrollListener, false);
5223
5224
  (_b = scrollEl.current) == null ? void 0 : _b.removeEventListener("resize", scrollListener, false);
5224
5225
  }
5225
5226
  const goTop = (e2) => {
@@ -11084,8 +11085,8 @@ Please add \`${key}Action\` when creating your handler.`);
11084
11085
  onClick && onClick({ title, value, isShow });
11085
11086
  };
11086
11087
  React.useEffect(() => {
11087
- var _a2, _b;
11088
- const childNodes = (_a2 = listRef.current) == null ? void 0 : _a2.children;
11088
+ var _a, _b;
11089
+ const childNodes = (_a = listRef.current) == null ? void 0 : _a.children;
11089
11090
  (_b = listRef.current) == null ? void 0 : _b.setAttribute("level", "1");
11090
11091
  childNodes && setListLevel(childNodes);
11091
11092
  }, [setListLevel]);
@@ -11133,7 +11134,8 @@ Please add \`${key}Action\` when creating your handler.`);
11133
11134
  color: ""
11134
11135
  };
11135
11136
  const Badge = (props) => {
11136
- var _a2;
11137
+ var _a;
11138
+ const rtl = useRtl();
11137
11139
  const { className, style, value, max, children, dot, top, right, color } = {
11138
11140
  ...defaultProps$1b,
11139
11141
  ...props
@@ -11165,13 +11167,14 @@ Please add \`${key}Action\` when creating your handler.`);
11165
11167
  `${classPrefix2}-content`,
11166
11168
  { [`${classPrefix2}-sup`]: isNumber() || isString() || dot },
11167
11169
  {
11168
- [`${classPrefix2}-one`]: typeof content() === "string" && ((_a2 = `${content()}`) == null ? void 0 : _a2.length) === 1
11170
+ [`${classPrefix2}-one`]: typeof content() === "string" && ((_a = `${content()}`) == null ? void 0 : _a.length) === 1
11169
11171
  }
11170
11172
  );
11171
11173
  const getStyle = () => {
11172
11174
  const style2 = {};
11173
11175
  style2.top = `${Number(top) || parseFloat(String(top)) || 0}px`;
11174
- style2.right = `${Number(right) || parseFloat(String(right)) || 0}px`;
11176
+ const dir = rtl ? "left" : "right";
11177
+ style2[dir] = `${Number(right) || parseFloat(String(right)) || 0}px`;
11175
11178
  style2.background = color;
11176
11179
  return style2;
11177
11180
  };
@@ -11602,22 +11605,19 @@ Please add \`${key}Action\` when creating your handler.`);
11602
11605
  };
11603
11606
  class Tree {
11604
11607
  constructor(nodes, config2) {
11605
- __publicField(this, "nodes");
11606
- __publicField(this, "config");
11607
- // eslint-disable-next-line class-methods-use-this
11608
- __publicField(this, "isLeaf", (node, lazy) => {
11608
+ this.isLeaf = (node, lazy) => {
11609
11609
  const { leaf, children } = node;
11610
11610
  const hasChildren = Array.isArray(children) && Boolean(children.length);
11611
11611
  return leaf || !hasChildren && !lazy;
11612
- });
11613
- __publicField(this, "hasChildren", (node, lazy) => {
11612
+ };
11613
+ this.hasChildren = (node, lazy) => {
11614
11614
  const isLeaf = this.isLeaf(node, lazy);
11615
11615
  if (isLeaf) {
11616
11616
  return false;
11617
11617
  }
11618
11618
  const { children } = node;
11619
11619
  return Array.isArray(children) && Boolean(children.length);
11620
- });
11620
+ };
11621
11621
  this.config = {
11622
11622
  value: "value",
11623
11623
  text: "text",
@@ -11811,10 +11811,10 @@ Please add \`${key}Action\` when creating your handler.`);
11811
11811
  needToSync = [parent.value];
11812
11812
  state.initLoading = true;
11813
11813
  const last = await currentValue.slice(1).reduce(async (p, value2) => {
11814
- var _a2;
11814
+ var _a;
11815
11815
  const parent2 = await p;
11816
11816
  await invokeLazyLoad(parent2);
11817
- const node = (_a2 = parent2 == null ? void 0 : parent2.children) == null ? void 0 : _a2.find(
11817
+ const node = (_a = parent2 == null ? void 0 : parent2.children) == null ? void 0 : _a.find(
11818
11818
  (item) => item.value === value2
11819
11819
  );
11820
11820
  if (node) {
@@ -11850,8 +11850,8 @@ Please add \`${key}Action\` when creating your handler.`);
11850
11850
  let lazyLoadPromise = state.lazyLoadMap.get(node);
11851
11851
  if (!lazyLoadPromise) {
11852
11852
  lazyLoadPromise = new Promise((resolve) => {
11853
- var _a2, _b;
11854
- (_b = (_a2 = state.configs).onLoad) == null ? void 0 : _b.call(_a2, node, resolve);
11853
+ var _a, _b;
11854
+ (_b = (_a = state.configs).onLoad) == null ? void 0 : _b.call(_a, node, resolve);
11855
11855
  });
11856
11856
  state.lazyLoadMap.set(node, lazyLoadPromise);
11857
11857
  }
@@ -11921,9 +11921,9 @@ Please add \`${key}Action\` when creating your handler.`);
11921
11921
  setOptionsData(state.panes);
11922
11922
  };
11923
11923
  const renderItem = (pane, node, index) => {
11924
- var _a2;
11924
+ var _a;
11925
11925
  const classPrefix22 = "nut-cascader-item";
11926
- const checked = ((_a2 = pane.selectedNode) == null ? void 0 : _a2.value) === node.value;
11926
+ const checked = ((_a = pane.selectedNode) == null ? void 0 : _a.value) === node.value;
11927
11927
  const classes = classNames(
11928
11928
  {
11929
11929
  active: checked,
@@ -11969,7 +11969,7 @@ Please add \`${key}Action\` when creating your handler.`);
11969
11969
  value: tabvalue,
11970
11970
  title: () => {
11971
11971
  return optionsData.map((pane, index) => {
11972
- var _a2, _b;
11972
+ var _a, _b;
11973
11973
  return /* @__PURE__ */ React.createElement(
11974
11974
  "div",
11975
11975
  {
@@ -11980,15 +11980,15 @@ Please add \`${key}Action\` when creating your handler.`);
11980
11980
  className: `nut-tabs-titles-item ${tabvalue === pane.paneKey ? "nut-tabs-titles-item-active" : ""}`,
11981
11981
  key: pane.paneKey
11982
11982
  },
11983
- /* @__PURE__ */ React.createElement("span", { className: "nut-tabs-titles-item-text" }, !state.initLoading && state.panes.length && ((_a2 = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _a2.text), !state.initLoading && state.panes.length && !((_b = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _b.text) && "请选择", !(!state.initLoading && state.panes.length) && "Loading..."),
11983
+ /* @__PURE__ */ React.createElement("span", { className: "nut-tabs-titles-item-text" }, !state.initLoading && state.panes.length && ((_a = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _a.text), !state.initLoading && state.panes.length && !((_b = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _b.text) && "请选择", !(!state.initLoading && state.panes.length) && "Loading..."),
11984
11984
  /* @__PURE__ */ React.createElement("span", { className: "nut-tabs-titles-item-line" })
11985
11985
  );
11986
11986
  });
11987
11987
  }
11988
11988
  },
11989
11989
  !state.initLoading && state.panes.length ? optionsData.map((pane) => {
11990
- var _a2;
11991
- return /* @__PURE__ */ React.createElement(Tabs.TabPane, { key: pane.paneKey, value: pane.paneKey }, /* @__PURE__ */ React.createElement("div", { className: classesPane }, (_a2 = pane.nodes) == null ? void 0 : _a2.map(
11990
+ var _a;
11991
+ return /* @__PURE__ */ React.createElement(Tabs.TabPane, { key: pane.paneKey, value: pane.paneKey }, /* @__PURE__ */ React.createElement("div", { className: classesPane }, (_a = pane.nodes) == null ? void 0 : _a.map(
11992
11992
  (node, index) => renderItem(pane, node, index)
11993
11993
  )));
11994
11994
  }) : /* @__PURE__ */ React.createElement(Tabs.TabPane, null, /* @__PURE__ */ React.createElement("div", { className: classesPane }))
@@ -13182,8 +13182,8 @@ Please add \`${key}Action\` when creating your handler.`);
13182
13182
  onDayClick && onDayClick(param);
13183
13183
  };
13184
13184
  const scrollToDate = (date2) => {
13185
- var _a2;
13186
- (_a2 = calendarRef.current) == null ? void 0 : _a2.scrollToDate(date2);
13185
+ var _a;
13186
+ (_a = calendarRef.current) == null ? void 0 : _a.scrollToDate(date2);
13187
13187
  };
13188
13188
  const yearMonthChange = (param) => {
13189
13189
  onPageChange && onPageChange(param);
@@ -13683,6 +13683,7 @@ Please add \`${key}Action\` when creating your handler.`);
13683
13683
  const defaultProps$$ = {
13684
13684
  max: void 0,
13685
13685
  min: void 0,
13686
+ list: false,
13686
13687
  labelPosition: "right",
13687
13688
  direction: "vertical",
13688
13689
  onChange: (value) => {
@@ -13698,6 +13699,7 @@ Please add \`${key}Action\` when creating your handler.`);
13698
13699
  children,
13699
13700
  className,
13700
13701
  disabled,
13702
+ list,
13701
13703
  onChange,
13702
13704
  value,
13703
13705
  defaultValue,
@@ -13761,6 +13763,7 @@ Please add \`${key}Action\` when creating your handler.`);
13761
13763
  labelPosition: labelPosition || "right",
13762
13764
  disabled,
13763
13765
  max,
13766
+ list,
13764
13767
  onLimit,
13765
13768
  value: _value,
13766
13769
  check: (value2) => {
@@ -13787,7 +13790,8 @@ Please add \`${key}Action\` when creating your handler.`);
13787
13790
  className: classNames(
13788
13791
  classPrefix$i,
13789
13792
  {
13790
- [`nut-checkboxgroup-${props.direction}`]: props.direction
13793
+ [`nut-checkboxgroup-${props.direction}`]: props.direction,
13794
+ [`nut-checkboxgroup-list`]: list
13791
13795
  },
13792
13796
  className
13793
13797
  ),
@@ -13930,7 +13934,13 @@ Please add \`${key}Action\` when creating your handler.`);
13930
13934
  innerChecked && activeIcon ? /* @__PURE__ */ React.createElement("div", { className: classNames(`${classPrefix$h}-button-icon`) }, activeIcon) : null
13931
13935
  );
13932
13936
  };
13937
+ const renderListItem = () => {
13938
+ return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$h}-list-item` }, renderLabel(), renderIcon());
13939
+ };
13933
13940
  const renderCheckboxItem = () => {
13941
+ if (ctx2 == null ? void 0 : ctx2.list) {
13942
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, renderListItem());
13943
+ }
13934
13944
  if (shape === "button") {
13935
13945
  return renderButton();
13936
13946
  }
@@ -14121,14 +14131,14 @@ Please add \`${key}Action\` when creating your handler.`);
14121
14131
  moving: moving.current
14122
14132
  }));
14123
14133
  React.useEffect(() => {
14124
- var _a2, _b, _c;
14134
+ var _a, _b, _c;
14125
14135
  const options22 = passiveSupported ? { passive: false } : false;
14126
- (_a2 = PickerPanelRef.current) == null ? void 0 : _a2.addEventListener("touchstart", touchStart, options22);
14136
+ (_a = PickerPanelRef.current) == null ? void 0 : _a.addEventListener("touchstart", touchStart, options22);
14127
14137
  (_b = PickerPanelRef.current) == null ? void 0 : _b.addEventListener("touchmove", touchMove, options22);
14128
14138
  (_c = PickerPanelRef.current) == null ? void 0 : _c.addEventListener("touchend", touchEnd, options22);
14129
14139
  return () => {
14130
- var _a3, _b2, _c2;
14131
- (_a3 = PickerPanelRef.current) == null ? void 0 : _a3.removeEventListener("touchstart", touchStart);
14140
+ var _a2, _b2, _c2;
14141
+ (_a2 = PickerPanelRef.current) == null ? void 0 : _a2.removeEventListener("touchstart", touchStart);
14132
14142
  (_b2 = PickerPanelRef.current) == null ? void 0 : _b2.removeEventListener("touchmove", touchMove);
14133
14143
  (_c2 = PickerPanelRef.current) == null ? void 0 : _c2.removeEventListener("touchend", touchEnd);
14134
14144
  };
@@ -14232,8 +14242,8 @@ Please add \`${key}Action\` when creating your handler.`);
14232
14242
  defaultValue: [...defaultValue],
14233
14243
  finalValue: [...defaultValue],
14234
14244
  onChange: (val) => {
14235
- var _a2;
14236
- (_a2 = props.onConfirm) == null ? void 0 : _a2.call(props, setSelectedOptions(), val);
14245
+ var _a;
14246
+ (_a = props.onConfirm) == null ? void 0 : _a.call(props, setSelectedOptions(), val);
14237
14247
  }
14238
14248
  });
14239
14249
  const [innerVisible, setInnerVisible] = usePropsValue({
@@ -14241,8 +14251,8 @@ Please add \`${key}Action\` when creating your handler.`);
14241
14251
  defaultValue: false,
14242
14252
  finalValue: false,
14243
14253
  onChange: (val) => {
14244
- var _a2;
14245
- (_a2 = props.onClose) == null ? void 0 : _a2.call(props, setSelectedOptions(), innerValue);
14254
+ var _a;
14255
+ (_a = props.onClose) == null ? void 0 : _a.call(props, setSelectedOptions(), innerValue);
14246
14256
  }
14247
14257
  });
14248
14258
  const [innerValue, setInnerValue] = React.useState(selectedValue);
@@ -14344,14 +14354,14 @@ Please add \`${key}Action\` when creating your handler.`);
14344
14354
  return options22;
14345
14355
  };
14346
14356
  const chooseItem = (columnOptions, columnIndex2) => {
14347
- var _a2, _b;
14357
+ var _a, _b;
14348
14358
  const values = [];
14349
14359
  const start2 = columnIndex2;
14350
14360
  if (columnOptions && Object.keys(columnOptions).length) {
14351
14361
  if (values[columnIndex2] !== columnOptions.value) {
14352
14362
  if (columnsType() === "cascade") {
14353
14363
  values[columnIndex2] = columnOptions.value || "";
14354
- while ((_a2 = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _a2[0]) {
14364
+ while ((_a = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _a[0]) {
14355
14365
  values[columnIndex2 + 1] = columnOptions.children[0].value;
14356
14366
  columnIndex2++;
14357
14367
  columnOptions = columnOptions.children[0];
@@ -14427,9 +14437,9 @@ Please add \`${key}Action\` when creating your handler.`);
14427
14437
  visible: innerVisible,
14428
14438
  position: "bottom",
14429
14439
  onOverlayClick: () => {
14430
- var _a2;
14440
+ var _a;
14431
14441
  if (closeOnOverlayClick) {
14432
- (_a2 = props.onCancel) == null ? void 0 : _a2.call(props);
14442
+ (_a = props.onCancel) == null ? void 0 : _a.call(props);
14433
14443
  setInnerVisible(false);
14434
14444
  }
14435
14445
  },
@@ -14620,7 +14630,7 @@ Please add \`${key}Action\` when creating your handler.`);
14620
14630
  }
14621
14631
  };
14622
14632
  const handlePickerChange = (selectedOptions, selectedValue, index) => {
14623
- var _a2;
14633
+ var _a;
14624
14634
  const rangeType = type2.toLocaleLowerCase();
14625
14635
  if (["date", "datetime", "datehour", "month-day", "year-month"].includes(
14626
14636
  rangeType
@@ -14659,7 +14669,7 @@ Please add \`${key}Action\` when creating your handler.`);
14659
14669
  } else if (rangeType === "datehour") {
14660
14670
  date2 = new Date(year, month, day, Number(formatDate[3]));
14661
14671
  }
14662
- const isEqual2 = ((_a2 = new Date(selectedDate)) == null ? void 0 : _a2.getTime()) === (date2 == null ? void 0 : date2.getTime());
14672
+ const isEqual2 = ((_a = new Date(selectedDate)) == null ? void 0 : _a.getTime()) === (date2 == null ? void 0 : date2.getTime());
14663
14673
  date2 && isDate(date2) && !isEqual2 && setSelectedDate(formatValue(date2));
14664
14674
  }
14665
14675
  props.onChange && props.onChange(selectedOptions, selectedValue, index);
@@ -14676,7 +14686,7 @@ Please add \`${key}Action\` when creating your handler.`);
14676
14686
  return { text: padMin + fatter, value: padMin };
14677
14687
  };
14678
14688
  const generateColumn = (min, max, val, type22, columnIndex) => {
14679
- var _a2;
14689
+ var _a;
14680
14690
  let cmin = min;
14681
14691
  const arr = [];
14682
14692
  let index = 0;
@@ -14687,11 +14697,11 @@ Please add \`${key}Action\` when creating your handler.`);
14687
14697
  } else {
14688
14698
  cmin++;
14689
14699
  }
14690
- if (cmin <= val) {
14700
+ if (cmin <= Number(val)) {
14691
14701
  index++;
14692
14702
  }
14693
14703
  }
14694
- pickerValue[columnIndex] = (_a2 = arr[index]) == null ? void 0 : _a2.value;
14704
+ pickerValue[columnIndex] = (_a = arr[index]) == null ? void 0 : _a.value;
14695
14705
  setPickerValue([...pickerValue]);
14696
14706
  if (props.filter && props.filter(type22, arr)) {
14697
14707
  return props.filter(type22, arr);
@@ -15812,21 +15822,13 @@ Please add \`${key}Action\` when creating your handler.`);
15812
15822
  const SECRET = "NUT_FORM_INTERNAL";
15813
15823
  class FormStore {
15814
15824
  constructor() {
15815
- // 初始化数据
15816
- __publicField(this, "initialValues", {});
15817
- __publicField(this, "updateList", []);
15818
- // 存放表单中所有的数据 eg. {password: "ddd",username: "123"}
15819
- __publicField(this, "store", {});
15820
- // 所有的组件实例
15821
- __publicField(this, "fieldEntities", []);
15822
- // 校验成功或失败的回调,onFinish、onFinishFailed
15823
- __publicField(this, "callbacks", {});
15824
- __publicField(this, "errors", {});
15825
- /**
15826
- * 注册组件实例
15827
- * @param field
15828
- */
15829
- __publicField(this, "registerField", (field) => {
15825
+ this.initialValues = {};
15826
+ this.updateList = [];
15827
+ this.store = {};
15828
+ this.fieldEntities = [];
15829
+ this.callbacks = {};
15830
+ this.errors = {};
15831
+ this.registerField = (field) => {
15830
15832
  this.fieldEntities.push(field);
15831
15833
  return () => {
15832
15834
  this.fieldEntities = this.fieldEntities.filter((item) => item !== field);
@@ -15834,19 +15836,12 @@ Please add \`${key}Action\` when creating your handler.`);
15834
15836
  delete this.store[field.props.name];
15835
15837
  }
15836
15838
  };
15837
- });
15838
- /**
15839
- * 获取 formItem 的值
15840
- * @param name
15841
- */
15842
- __publicField(this, "getFieldValue", (name) => {
15843
- var _a2;
15844
- return (_a2 = this.store) == null ? void 0 : _a2[name];
15845
- });
15846
- /**
15847
- * 获取全部字段
15848
- */
15849
- __publicField(this, "getFieldsValue", (nameList) => {
15839
+ };
15840
+ this.getFieldValue = (name) => {
15841
+ var _a;
15842
+ return (_a = this.store) == null ? void 0 : _a[name];
15843
+ };
15844
+ this.getFieldsValue = (nameList) => {
15850
15845
  if (typeof nameList === "boolean") {
15851
15846
  return JSON.parse(JSON.stringify(this.store));
15852
15847
  }
@@ -15855,23 +15850,14 @@ Please add \`${key}Action\` when creating your handler.`);
15855
15850
  fieldsValue[field] = this.getFieldValue(field);
15856
15851
  });
15857
15852
  return fieldsValue;
15858
- });
15859
- /**
15860
- * 设置 form 的初始值,之后在 reset 的时候使用
15861
- * @param values
15862
- * @param init
15863
- */
15864
- __publicField(this, "setInitialValues", (values, init) => {
15853
+ };
15854
+ this.setInitialValues = (values, init) => {
15865
15855
  if (init) {
15866
15856
  this.initialValues = values;
15867
15857
  this.store = values;
15868
15858
  }
15869
- });
15870
- /**
15871
- * 存储组件数据
15872
- * @param newStore { [name]: newValue }
15873
- */
15874
- __publicField(this, "setFieldsValue", (newStore) => {
15859
+ };
15860
+ this.setFieldsValue = (newStore) => {
15875
15861
  this.store = {
15876
15862
  ...this.store,
15877
15863
  ...newStore
@@ -15893,15 +15879,15 @@ Please add \`${key}Action\` when creating your handler.`);
15893
15879
  item.entity.onStoreChange("update");
15894
15880
  }
15895
15881
  });
15896
- });
15897
- __publicField(this, "setCallback", (callback) => {
15882
+ };
15883
+ this.setCallback = (callback) => {
15898
15884
  this.callbacks = {
15899
15885
  ...this.callbacks,
15900
15886
  ...callback
15901
15887
  };
15902
- });
15903
- __publicField(this, "validateFields", async (nameList) => {
15904
- var _a2;
15888
+ };
15889
+ this.validateFields = async (nameList) => {
15890
+ var _a;
15905
15891
  let filterEntitys = [];
15906
15892
  const errs = [];
15907
15893
  this.errors.length = 0;
@@ -15927,7 +15913,7 @@ Please add \`${key}Action\` when creating your handler.`);
15927
15913
  }
15928
15914
  const validator = new Schema(descriptor);
15929
15915
  try {
15930
- await validator.validate({ [name]: (_a2 = this.store) == null ? void 0 : _a2[name] });
15916
+ await validator.validate({ [name]: (_a = this.store) == null ? void 0 : _a[name] });
15931
15917
  } catch ({ errors }) {
15932
15918
  if (errors) {
15933
15919
  errs.push(...errors);
@@ -15941,25 +15927,24 @@ Please add \`${key}Action\` when creating your handler.`);
15941
15927
  entity.onStoreChange("validate");
15942
15928
  }
15943
15929
  return errs;
15944
- });
15945
- __publicField(this, "submit", async () => {
15946
- var _a2, _b, _c, _d;
15930
+ };
15931
+ this.submit = async () => {
15932
+ var _a, _b, _c, _d;
15947
15933
  const errors = await this.validateFields();
15948
15934
  if (errors.length === 0) {
15949
- (_b = (_a2 = this.callbacks).onFinish) == null ? void 0 : _b.call(_a2, this.store);
15935
+ (_b = (_a = this.callbacks).onFinish) == null ? void 0 : _b.call(_a, this.store);
15950
15936
  } else if (errors.length > 0) {
15951
15937
  (_d = (_c = this.callbacks).onFinishFailed) == null ? void 0 : _d.call(_c, this.store, errors);
15952
15938
  }
15953
- });
15954
- __publicField(this, "resetFields", () => {
15939
+ };
15940
+ this.resetFields = () => {
15955
15941
  this.errors.length = 0;
15956
15942
  this.store = this.initialValues;
15957
15943
  this.fieldEntities.forEach((entity) => {
15958
15944
  entity.onStoreChange("reset");
15959
15945
  });
15960
- });
15961
- // 监听事件
15962
- __publicField(this, "registerUpdate", (field, shouldUpdate) => {
15946
+ };
15947
+ this.registerUpdate = (field, shouldUpdate) => {
15963
15948
  this.updateList.push({
15964
15949
  entity: field,
15965
15950
  condition: shouldUpdate
@@ -15967,11 +15952,11 @@ Please add \`${key}Action\` when creating your handler.`);
15967
15952
  return () => {
15968
15953
  this.updateList = this.updateList.filter((i) => i.entity !== field);
15969
15954
  };
15970
- });
15971
- __publicField(this, "dispatch", ({ name }) => {
15955
+ };
15956
+ this.dispatch = ({ name }) => {
15972
15957
  this.validateFields([name]);
15973
- });
15974
- __publicField(this, "getInternal", (key) => {
15958
+ };
15959
+ this.getInternal = (key) => {
15975
15960
  if (key === SECRET) {
15976
15961
  return {
15977
15962
  registerField: this.registerField,
@@ -15983,8 +15968,8 @@ Please add \`${key}Action\` when creating your handler.`);
15983
15968
  registerUpdate: this.registerUpdate
15984
15969
  };
15985
15970
  }
15986
- });
15987
- __publicField(this, "getForm", () => {
15971
+ };
15972
+ this.getForm = () => {
15988
15973
  return {
15989
15974
  getFieldValue: this.getFieldValue,
15990
15975
  getFieldsValue: this.getFieldsValue,
@@ -15995,7 +15980,7 @@ Please add \`${key}Action\` when creating your handler.`);
15995
15980
  errors: this.errors,
15996
15981
  getInternal: this.getInternal
15997
15982
  };
15998
- });
15983
+ };
15999
15984
  this.callbacks = {
16000
15985
  onFinish: () => {
16001
15986
  },
@@ -16115,19 +16100,15 @@ Please add \`${key}Action\` when creating your handler.`);
16115
16100
  shouldUpdate: false,
16116
16101
  noStyle: false
16117
16102
  };
16118
- class FormItem extends React.Component {
16103
+ const _FormItem = class _FormItem extends React.Component {
16119
16104
  constructor(props) {
16120
16105
  super(props);
16121
- __publicField(this, "cancelRegister");
16122
- __publicField(this, "componentRef");
16123
- __publicField(this, "eventOff");
16124
- // children添加value属性和onChange事件
16125
- __publicField(this, "getControlled", (children) => {
16126
- var _a2;
16106
+ this.getControlled = (children) => {
16107
+ var _a;
16127
16108
  const { setFieldsValue, getFieldValue } = this.context;
16128
16109
  const { dispatch } = this.context.getInternal(SECRET);
16129
16110
  const { name = "" } = this.props;
16130
- if ((_a2 = children == null ? void 0 : children.props) == null ? void 0 : _a2.defaultValue) {
16111
+ if ((_a = children == null ? void 0 : children.props) == null ? void 0 : _a.defaultValue) {
16131
16112
  console.warn("通过 initialValue 设置初始值");
16132
16113
  }
16133
16114
  const fieldValue = getFieldValue(name);
@@ -16149,7 +16130,7 @@ Please add \`${key}Action\` when creating your handler.`);
16149
16130
  const { validateTrigger } = this.props;
16150
16131
  let validateTriggers = [this.props.trigger || "onChange"];
16151
16132
  if (validateTrigger) {
16152
- validateTriggers = typeof validateTrigger === "string" ? [...validateTriggers, validateTrigger] : [...validateTriggers, ...validateTrigger];
16133
+ validateTriggers = typeof validateTrigger === "string" ? [validateTrigger] : [...validateTrigger];
16153
16134
  validateTriggers.forEach((trigger) => {
16154
16135
  const originTrigger = controlled[trigger];
16155
16136
  controlled[trigger] = (...args) => {
@@ -16179,21 +16160,21 @@ Please add \`${key}Action\` when creating your handler.`);
16179
16160
  };
16180
16161
  }
16181
16162
  return controlled;
16182
- });
16183
- __publicField(this, "refresh", () => {
16163
+ };
16164
+ this.refresh = () => {
16184
16165
  this.setState(({ resetCount }) => ({
16185
16166
  resetCount: resetCount + 1
16186
16167
  }));
16187
- });
16188
- __publicField(this, "onStoreChange", (type2) => {
16168
+ };
16169
+ this.onStoreChange = (type2) => {
16189
16170
  if (type2 === "reset") {
16190
16171
  this.context.errors[this.props.name] = [];
16191
16172
  this.refresh();
16192
16173
  } else {
16193
16174
  this.forceUpdate();
16194
16175
  }
16195
- });
16196
- __publicField(this, "renderLayout", (childNode) => {
16176
+ };
16177
+ this.renderLayout = (childNode) => {
16197
16178
  const {
16198
16179
  label,
16199
16180
  name,
@@ -16228,7 +16209,7 @@ Please add \`${key}Action\` when creating your handler.`);
16228
16209
  item[0].message
16229
16210
  ))
16230
16211
  );
16231
- });
16212
+ };
16232
16213
  this.componentRef = React.createRef();
16233
16214
  this.state = {
16234
16215
  resetCount: 1
@@ -16261,9 +16242,10 @@ Please add \`${key}Action\` when creating your handler.`);
16261
16242
  }
16262
16243
  return /* @__PURE__ */ React.createElement(React.Fragment, { key: this.state.resetCount }, this.props.noStyle ? returnChildNode : this.renderLayout(returnChildNode));
16263
16244
  }
16264
- }
16265
- __publicField(FormItem, "defaultProps", defaultProps$W);
16266
- __publicField(FormItem, "contextType", Context);
16245
+ };
16246
+ _FormItem.defaultProps = defaultProps$W;
16247
+ _FormItem.contextType = Context;
16248
+ let FormItem = _FormItem;
16267
16249
  const InnerForm = Form;
16268
16250
  InnerForm.Item = FormItem;
16269
16251
  InnerForm.useForm = useForm;
@@ -16352,12 +16334,12 @@ Please add \`${key}Action\` when creating your handler.`);
16352
16334
  setValue("");
16353
16335
  },
16354
16336
  focus: () => {
16355
- var _a2;
16356
- (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
16337
+ var _a;
16338
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
16357
16339
  },
16358
16340
  blur: () => {
16359
- var _a2;
16360
- (_a2 = inputRef.current) == null ? void 0 : _a2.blur();
16341
+ var _a;
16342
+ (_a = inputRef.current) == null ? void 0 : _a.blur();
16361
16343
  },
16362
16344
  get nativeElement() {
16363
16345
  return inputRef.current;
@@ -16447,14 +16429,14 @@ Please add \`${key}Action\` when creating your handler.`);
16447
16429
  handleInput(e2.currentTarget.value);
16448
16430
  },
16449
16431
  onCompositionStart: (e2) => {
16450
- var _a2;
16432
+ var _a;
16451
16433
  composingRef.current = true;
16452
- (_a2 = props.onCompositionStart) == null ? void 0 : _a2.call(props, e2);
16434
+ (_a = props.onCompositionStart) == null ? void 0 : _a.call(props, e2);
16453
16435
  },
16454
16436
  onCompositionEnd: (e2) => {
16455
- var _a2;
16437
+ var _a;
16456
16438
  composingRef.current = false;
16457
- (_a2 = props.onCompositionEnd) == null ? void 0 : _a2.call(props, e2);
16439
+ (_a = props.onCompositionEnd) == null ? void 0 : _a.call(props, e2);
16458
16440
  }
16459
16441
  }
16460
16442
  ),
@@ -16521,14 +16503,15 @@ Please add \`${key}Action\` when creating your handler.`);
16521
16503
  const [focused, setFocused] = React.useState(false);
16522
16504
  const inputRef = React.useRef(null);
16523
16505
  React.useEffect(() => {
16524
- var _a2, _b;
16506
+ var _a, _b;
16525
16507
  if (focused) {
16526
- (_b = (_a2 = inputRef.current) == null ? void 0 : _a2.select) == null ? void 0 : _b.call(_a2);
16508
+ (_b = (_a = inputRef.current) == null ? void 0 : _a.select) == null ? void 0 : _b.call(_a);
16527
16509
  }
16528
16510
  }, [focused]);
16529
16511
  const [shadowValue, setShadowValue] = usePropsValue({
16530
16512
  value: typeof value === "string" ? parseFloat(value) : value,
16531
16513
  defaultValue: typeof defaultValue === "string" ? parseFloat(defaultValue) : defaultValue,
16514
+ finalValue: 0,
16532
16515
  onChange: (value2) => {
16533
16516
  }
16534
16517
  });
@@ -16582,7 +16565,7 @@ Please add \`${key}Action\` when creating your handler.`);
16582
16565
  );
16583
16566
  const nextValue = bound2(shouldOverBoundary, Number(min), Number(max));
16584
16567
  setShadowValue(nextValue);
16585
- if (negative ? shouldOverBoundary < min : shouldOverBoundary > max) {
16568
+ if (negative ? shouldOverBoundary < Number(min) : shouldOverBoundary > Number(max)) {
16586
16569
  onOverlimit == null ? void 0 : onOverlimit(e2);
16587
16570
  } else {
16588
16571
  onChange == null ? void 0 : onChange(nextValue, e2);
@@ -17468,6 +17451,7 @@ Please add \`${key}Action\` when creating your handler.`);
17468
17451
  marks: {}
17469
17452
  };
17470
17453
  const Range = (props) => {
17454
+ const rtl = useRtl();
17471
17455
  const {
17472
17456
  className,
17473
17457
  range: range2,
@@ -17580,15 +17564,17 @@ Please add \`${key}Action\` when creating your handler.`);
17580
17564
  transition: dragStatus ? "none" : void 0
17581
17565
  };
17582
17566
  }
17567
+ const dir = rtl ? "right" : "left";
17583
17568
  return {
17584
17569
  width: calcMainAxis(),
17585
- left: calcOffset(),
17570
+ [dir]: calcOffset(),
17586
17571
  transition: dragStatus ? "none" : void 0
17587
17572
  };
17588
17573
  };
17589
17574
  const marksStyle = (mark) => {
17575
+ const dir = rtl ? "right" : "left";
17590
17576
  let style = {
17591
- left: `${(mark - min) / scope() * 100}%`
17577
+ [dir]: `${(mark - min) / scope() * 100}%`
17592
17578
  };
17593
17579
  if (vertical) {
17594
17580
  style = {
@@ -17680,6 +17666,7 @@ Please add \`${key}Action\` when creating your handler.`);
17680
17666
  let delta = touch.deltaX.current;
17681
17667
  let total = rect.width;
17682
17668
  let diff = delta / total * scope();
17669
+ diff = rtl ? -diff : diff;
17683
17670
  if (vertical) {
17684
17671
  delta = touch.deltaY.current;
17685
17672
  total = rect.height;
@@ -17837,8 +17824,8 @@ Please add \`${key}Action\` when creating your handler.`);
17837
17824
  setScore(value2);
17838
17825
  };
17839
17826
  const getScoreByPosition = (x) => {
17840
- var _a2;
17841
- if ((_a2 = rateRects.current) == null ? void 0 : _a2.length) {
17827
+ var _a;
17828
+ if ((_a = rateRects.current) == null ? void 0 : _a.length) {
17842
17829
  for (let index = rateRects.current.length - 1; index >= 0; index--) {
17843
17830
  const item = rateRects.current[index];
17844
17831
  if (item && x > item.left) {
@@ -18518,22 +18505,14 @@ Please add \`${key}Action\` when creating your handler.`);
18518
18505
  TextArea.displayName = "NutTextArea";
18519
18506
  class UploadOptions {
18520
18507
  constructor() {
18521
- __publicField(this, "url", "");
18522
- __publicField(this, "name", "file");
18523
- __publicField(this, "fileType", "image");
18524
- __publicField(this, "formData");
18525
- __publicField(this, "sourceFile");
18526
- __publicField(this, "method", "post");
18527
- __publicField(this, "xhrState", 200);
18528
- __publicField(this, "timeout", 30 * 1e3);
18529
- __publicField(this, "headers", {});
18530
- __publicField(this, "withCredentials", false);
18531
- __publicField(this, "onStart");
18532
- __publicField(this, "taroFilePath");
18533
- __publicField(this, "onProgress");
18534
- __publicField(this, "onSuccess");
18535
- __publicField(this, "onFailure");
18536
- __publicField(this, "beforeXhrUpload");
18508
+ this.url = "";
18509
+ this.name = "file";
18510
+ this.fileType = "image";
18511
+ this.method = "post";
18512
+ this.xhrState = 200;
18513
+ this.timeout = 30 * 1e3;
18514
+ this.headers = {};
18515
+ this.withCredentials = false;
18537
18516
  }
18538
18517
  }
18539
18518
  const UPLOADING = "uploading";
@@ -18541,11 +18520,10 @@ Please add \`${key}Action\` when creating your handler.`);
18541
18520
  const ERROR = "error";
18542
18521
  class Upload {
18543
18522
  constructor(options2) {
18544
- __publicField(this, "options");
18545
18523
  this.options = options2;
18546
18524
  }
18547
18525
  upload() {
18548
- var _a2;
18526
+ var _a;
18549
18527
  const { options: options2 } = this;
18550
18528
  const xhr = new XMLHttpRequest();
18551
18529
  xhr.timeout = options2.timeout;
@@ -18553,16 +18531,16 @@ Please add \`${key}Action\` when creating your handler.`);
18553
18531
  xhr.upload.addEventListener(
18554
18532
  "progress",
18555
18533
  (e2) => {
18556
- var _a3;
18557
- (_a3 = options2.onProgress) == null ? void 0 : _a3.call(options2, e2, options2);
18534
+ var _a2;
18535
+ (_a2 = options2.onProgress) == null ? void 0 : _a2.call(options2, e2, options2);
18558
18536
  },
18559
18537
  false
18560
18538
  );
18561
18539
  xhr.onreadystatechange = () => {
18562
- var _a3, _b;
18540
+ var _a2, _b;
18563
18541
  if (xhr.readyState === 4) {
18564
18542
  if (xhr.status === options2.xhrState) {
18565
- (_a3 = options2.onSuccess) == null ? void 0 : _a3.call(options2, xhr.responseText, options2);
18543
+ (_a2 = options2.onSuccess) == null ? void 0 : _a2.call(options2, xhr.responseText, options2);
18566
18544
  } else {
18567
18545
  (_b = options2.onFailure) == null ? void 0 : _b.call(options2, xhr.responseText, options2);
18568
18546
  }
@@ -18573,7 +18551,7 @@ Please add \`${key}Action\` when creating your handler.`);
18573
18551
  for (const [key, value] of Object.entries(options2.headers)) {
18574
18552
  xhr.setRequestHeader(key, value);
18575
18553
  }
18576
- (_a2 = options2.onStart) == null ? void 0 : _a2.call(options2, options2);
18554
+ (_a = options2.onStart) == null ? void 0 : _a.call(options2, options2);
18577
18555
  if (options2.beforeXhrUpload) {
18578
18556
  options2.beforeXhrUpload(xhr, options2);
18579
18557
  } else {
@@ -18618,6 +18596,7 @@ Please add \`${key}Action\` when creating your handler.`);
18618
18596
  delay: 0
18619
18597
  };
18620
18598
  const Progress = (props) => {
18599
+ const rtl = useRtl();
18621
18600
  const {
18622
18601
  className,
18623
18602
  style,
@@ -18711,7 +18690,7 @@ Please add \`${key}Action\` when creating your handler.`);
18711
18690
  "div",
18712
18691
  {
18713
18692
  className: `${classPrefix2}-text`,
18714
- style: { left: `${displayPercent}%` }
18693
+ style: rtl ? { right: `${displayPercent}%` } : { left: `${displayPercent}%` }
18715
18694
  },
18716
18695
  children || /* @__PURE__ */ React.createElement(
18717
18696
  "div",
@@ -18745,7 +18724,7 @@ Please add \`${key}Action\` when creating your handler.`);
18745
18724
  return item.loadingIcon || /* @__PURE__ */ React.createElement(t$2, { className: "nut-icon-loading", color: "#fff" });
18746
18725
  };
18747
18726
  return /* @__PURE__ */ React.createElement(React.Fragment, null, fileList.length !== 0 && fileList.map((item, index) => {
18748
- var _a2;
18727
+ var _a;
18749
18728
  return /* @__PURE__ */ React.createElement(
18750
18729
  "div",
18751
18730
  {
@@ -18760,7 +18739,7 @@ Please add \`${key}Action\` when creating your handler.`);
18760
18739
  onClick: () => onDeleteItem(item, index)
18761
18740
  }
18762
18741
  ),
18763
- previewType === "picture" && !children && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-img" }, item.status === "ready" ? /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-progress" }, /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-progress-msg" }, item.message)) : item.status !== "success" && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-progress" }, renderIcon(item), /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-progress-msg" }, item.message)), ((_a2 = item.type) == null ? void 0 : _a2.includes("image")) ? /* @__PURE__ */ React.createElement(React.Fragment, null, item.url && /* @__PURE__ */ React.createElement(
18742
+ previewType === "picture" && !children && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-img" }, item.status === "ready" ? /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-progress" }, /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-progress-msg" }, item.message)) : item.status !== "success" && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-progress" }, renderIcon(item), /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-progress-msg" }, item.message)), ((_a = item.type) == null ? void 0 : _a.includes("image")) ? /* @__PURE__ */ React.createElement(React.Fragment, null, item.url && /* @__PURE__ */ React.createElement(
18764
18743
  "img",
18765
18744
  {
18766
18745
  className: "nut-uploader-preview-img-c",
@@ -18814,18 +18793,11 @@ Please add \`${key}Action\` when creating your handler.`);
18814
18793
  };
18815
18794
  class FileItem {
18816
18795
  constructor() {
18817
- __publicField(this, "status", "ready");
18818
- __publicField(this, "message", "准备中..");
18819
- __publicField(this, "uid", (/* @__PURE__ */ new Date()).getTime().toString());
18820
- __publicField(this, "name");
18821
- __publicField(this, "url");
18822
- __publicField(this, "type");
18823
- __publicField(this, "path");
18824
- __publicField(this, "percentage", 0);
18825
- __publicField(this, "formData", {});
18826
- __publicField(this, "responseText");
18827
- __publicField(this, "loadingIcon");
18828
- __publicField(this, "failIcon");
18796
+ this.status = "ready";
18797
+ this.message = "准备中..";
18798
+ this.uid = (/* @__PURE__ */ new Date()).getTime().toString();
18799
+ this.percentage = 0;
18800
+ this.formData = {};
18829
18801
  }
18830
18802
  }
18831
18803
  const defaultProps$G = {
@@ -18933,11 +18905,11 @@ Please add \`${key}Action\` when creating your handler.`);
18933
18905
  el.value = "";
18934
18906
  };
18935
18907
  const executeUpload = (fileItem, index) => {
18936
- var _a2, _b;
18908
+ var _a, _b;
18937
18909
  const uploadOption = new UploadOptions();
18938
18910
  uploadOption.url = url;
18939
18911
  for (const [key, value2] of Object.entries(data)) {
18940
- (_a2 = fileItem.formData) == null ? void 0 : _a2.append(key, value2);
18912
+ (_a = fileItem.formData) == null ? void 0 : _a.append(key, value2);
18941
18913
  }
18942
18914
  uploadOption.formData = fileItem.formData;
18943
18915
  uploadOption.timeout = timeout * 1;
@@ -19024,7 +18996,7 @@ Please add \`${key}Action\` when creating your handler.`);
19024
18996
  };
19025
18997
  const readFile = (files) => {
19026
18998
  files.forEach((file, index) => {
19027
- var _a2;
18999
+ var _a;
19028
19000
  const formData = new FormData();
19029
19001
  formData.append(name, file);
19030
19002
  const fileItem = new FileItem();
@@ -19035,7 +19007,7 @@ Please add \`${key}Action\` when creating your handler.`);
19035
19007
  fileItem.uid = file.lastModified + fileItem.uid;
19036
19008
  fileItem.message = autoUpload ? locale.uploader.readyUpload : locale.uploader.waitingUpload;
19037
19009
  executeUpload(fileItem, index);
19038
- if (preview && ((_a2 = file.type) == null ? void 0 : _a2.includes("image"))) {
19010
+ if (preview && ((_a = file.type) == null ? void 0 : _a.includes("image"))) {
19039
19011
  const reader = new FileReader();
19040
19012
  reader.onload = (event) => {
19041
19013
  fileItem.url = event.target.result;
@@ -19108,7 +19080,7 @@ Please add \`${key}Action\` when creating your handler.`);
19108
19080
  const handleItemClick = (file, index) => {
19109
19081
  onFileItemClick == null ? void 0 : onFileItemClick(file, index);
19110
19082
  };
19111
- return /* @__PURE__ */ React.createElement("div", { className: classes, ...restProps }, (children || previewType === "list") && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-slot" }, children || /* @__PURE__ */ React.createElement(Button, { size: "small", type: "primary" }, "上传文件"), maxCount > fileList.length && /* @__PURE__ */ React.createElement(
19083
+ return /* @__PURE__ */ React.createElement("div", { className: classes, ...restProps }, (children || previewType === "list") && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-slot" }, children || /* @__PURE__ */ React.createElement(Button, { size: "small", type: "primary" }, "上传文件"), Number(maxCount) > fileList.length && /* @__PURE__ */ React.createElement(
19112
19084
  "input",
19113
19085
  {
19114
19086
  className: "nut-uploader-input",
@@ -19133,7 +19105,7 @@ Please add \`${key}Action\` when creating your handler.`);
19133
19105
  children
19134
19106
  }
19135
19107
  }
19136
- ), maxCount > fileList.length && previewType === "picture" && !children && /* @__PURE__ */ React.createElement(
19108
+ ), Number(maxCount) > fileList.length && previewType === "picture" && !children && /* @__PURE__ */ React.createElement(
19137
19109
  "div",
19138
19110
  {
19139
19111
  className: classNames("nut-uploader-upload", previewType, {
@@ -19273,8 +19245,8 @@ Please add \`${key}Action\` when creating your handler.`);
19273
19245
  }
19274
19246
  async function concurrentUnmount(container) {
19275
19247
  return Promise.resolve().then(() => {
19276
- var _a2;
19277
- (_a2 = container[MARK]) == null ? void 0 : _a2.unmount();
19248
+ var _a;
19249
+ (_a = container[MARK]) == null ? void 0 : _a.unmount();
19278
19250
  delete container[MARK];
19279
19251
  });
19280
19252
  }
@@ -19318,7 +19290,7 @@ Please add \`${key}Action\` when creating your handler.`);
19318
19290
  const ret = _onConfirm == null ? void 0 : _onConfirm();
19319
19291
  if (ret && ret.then) {
19320
19292
  renderFunction(dialogConfig);
19321
- ret.then(
19293
+ return ret.then(
19322
19294
  () => {
19323
19295
  onCancel(true);
19324
19296
  },
@@ -19519,6 +19491,7 @@ Please add \`${key}Action\` when creating your handler.`);
19519
19491
  ...restProps
19520
19492
  } = props;
19521
19493
  const classPrefix2 = "nut-dialog";
19494
+ const [loading, setLoading] = React.useState(false);
19522
19495
  const renderFooter = () => {
19523
19496
  if (footer === null)
19524
19497
  return "";
@@ -19531,10 +19504,16 @@ Please add \`${key}Action\` when creating your handler.`);
19531
19504
  onClose == null ? void 0 : onClose();
19532
19505
  onCancel == null ? void 0 : onCancel();
19533
19506
  };
19534
- const handleOk = (e2) => {
19507
+ const handleOk = async (e2) => {
19535
19508
  e2.stopPropagation();
19536
- onClose == null ? void 0 : onClose();
19537
- onConfirm == null ? void 0 : onConfirm(e2);
19509
+ setLoading(true);
19510
+ try {
19511
+ await (onConfirm == null ? void 0 : onConfirm(e2));
19512
+ setLoading(false);
19513
+ onClose == null ? void 0 : onClose();
19514
+ } catch {
19515
+ setLoading(false);
19516
+ }
19538
19517
  };
19539
19518
  return footer || /* @__PURE__ */ React.createElement(React.Fragment, null, !hideCancelButton && /* @__PURE__ */ React.createElement(
19540
19519
  Button,
@@ -19552,7 +19531,8 @@ Please add \`${key}Action\` when creating your handler.`);
19552
19531
  disabled: disableConfirmButton
19553
19532
  }),
19554
19533
  disabled: disableConfirmButton,
19555
- onClick: (e2) => handleOk(e2)
19534
+ onClick: (e2) => handleOk(e2),
19535
+ loading
19556
19536
  },
19557
19537
  confirmText || locale.confirm
19558
19538
  ));
@@ -19796,16 +19776,16 @@ Please add \`${key}Action\` when creating your handler.`);
19796
19776
  const distance = React.useRef(0);
19797
19777
  const classes = classNames(classPrefix$d, className);
19798
19778
  React.useEffect(() => {
19799
- var _a2;
19779
+ var _a;
19800
19780
  if (target && document.getElementById(target)) {
19801
19781
  scrollEl.current = document.getElementById(target);
19802
19782
  } else {
19803
19783
  scrollEl.current = window;
19804
19784
  }
19805
- (_a2 = scrollEl.current) == null ? void 0 : _a2.addEventListener("scroll", handleScroll, capture);
19785
+ (_a = scrollEl.current) == null ? void 0 : _a.addEventListener("scroll", handleScroll, capture);
19806
19786
  return () => {
19807
- var _a3;
19808
- (_a3 = scrollEl.current) == null ? void 0 : _a3.removeEventListener("scroll", handleScroll, capture);
19787
+ var _a2;
19788
+ (_a2 = scrollEl.current) == null ? void 0 : _a2.removeEventListener("scroll", handleScroll, capture);
19809
19789
  };
19810
19790
  }, [hasMore, isInfiniting, onLoadMore]);
19811
19791
  React.useEffect(() => {
@@ -19957,6 +19937,7 @@ Please add \`${key}Action\` when creating your handler.`);
19957
19937
  Loading.displayName = "NutLoading";
19958
19938
  const defaultProps$z = {
19959
19939
  ...ComponentDefaults,
19940
+ align: "left",
19960
19941
  direction: "horizontal",
19961
19942
  list: [],
19962
19943
  duration: 1e3,
@@ -19971,10 +19952,12 @@ Please add \`${key}Action\` when creating your handler.`);
19971
19952
  speed: 50
19972
19953
  };
19973
19954
  const NoticeBar = (props) => {
19955
+ const rtl = useRtl();
19974
19956
  const {
19975
19957
  children,
19976
19958
  className,
19977
19959
  style,
19960
+ align,
19978
19961
  direction,
19979
19962
  list,
19980
19963
  duration,
@@ -20079,7 +20062,7 @@ Please add \`${key}Action\` when creating your handler.`);
20079
20062
  }
20080
20063
  const wrapW = getRect(wrapRef.current).width;
20081
20064
  const offsetW = getRect(contentRef.current).width;
20082
- const canScroll = scrollable == null ? offsetW > wrapW : scrollable;
20065
+ const canScroll = align === "left" && scrollable == null ? offsetW > wrapW : scrollable;
20083
20066
  SetIsCanScroll(canScroll);
20084
20067
  if (canScroll) {
20085
20068
  SetWrapWidth(wrapW);
@@ -20129,7 +20112,7 @@ Please add \`${key}Action\` when creating your handler.`);
20129
20112
  onClose && onClose(event);
20130
20113
  };
20131
20114
  const isEllipsis = () => {
20132
- if (isCanScroll == null) {
20115
+ if (isCanScroll == null && align === "left") {
20133
20116
  return wrap;
20134
20117
  }
20135
20118
  return !isCanScroll && !wrap;
@@ -20137,7 +20120,7 @@ Please add \`${key}Action\` when creating your handler.`);
20137
20120
  const contentStyle = {
20138
20121
  animationDelay: `${firstRound ? delay : 0}s`,
20139
20122
  animationDuration: `${animationDuration}s`,
20140
- transform: `translateX(${firstRound ? 0 : `${wrapWidth}px`})`
20123
+ transform: `translateX(${firstRound ? 0 : `${rtl ? -wrapWidth : wrapWidth}px`})`
20141
20124
  };
20142
20125
  const barStyle = {
20143
20126
  height: isVertical ? `${height}px` : ""
@@ -20279,15 +20262,17 @@ Please add \`${key}Action\` when creating your handler.`);
20279
20262
  }
20280
20263
  };
20281
20264
  const noticebarClass = classNames({
20282
- "nut-noticebar-box": true,
20283
- [`nut-noticebar-box-wrapable`]: wrap
20265
+ [`${classPrefix2}-box`]: true,
20266
+ [`${classPrefix2}-box-wrapable`]: wrap,
20267
+ [`${classPrefix2}-box-${align}`]: true
20284
20268
  });
20269
+ const cls = classNames(classPrefix2, className);
20285
20270
  React.useEffect(() => {
20286
20271
  return () => {
20287
20272
  stopAutoPlay();
20288
20273
  };
20289
20274
  }, []);
20290
- return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2} ${className || ""}`, style }, showNoticeBar && direction === "horizontal" ? /* @__PURE__ */ React.createElement("div", { className: noticebarClass, style: barStyle, onClick: handleClick2 }, leftIcon ? /* @__PURE__ */ React.createElement("div", { className: "nut-noticebar-box-left-icon" }, leftIcon) : null, /* @__PURE__ */ React.createElement("div", { ref: wrapRef, className: "nut-noticebar-box-wrap" }, /* @__PURE__ */ React.createElement(
20275
+ return /* @__PURE__ */ React.createElement("div", { className: cls, style }, showNoticeBar && direction === "horizontal" ? /* @__PURE__ */ React.createElement("div", { className: noticebarClass, style: barStyle, onClick: handleClick2 }, leftIcon ? /* @__PURE__ */ React.createElement("div", { className: "nut-noticebar-box-left-icon" }, leftIcon) : null, /* @__PURE__ */ React.createElement("div", { ref: wrapRef, className: "nut-noticebar-box-wrap" }, /* @__PURE__ */ React.createElement(
20291
20276
  "div",
20292
20277
  {
20293
20278
  ref: contentRef,
@@ -20357,10 +20342,9 @@ Please add \`${key}Action\` when creating your handler.`);
20357
20342
  NoticeBar.defaultProps = defaultProps$z;
20358
20343
  NoticeBar.displayName = "NutNoticeBar";
20359
20344
  const classPrefix$c = "nut-notify";
20360
- let Notification$1 = (_a = class extends React__namespace.PureComponent {
20345
+ let Notification$1 = class Notification extends React__namespace.PureComponent {
20361
20346
  constructor(props) {
20362
20347
  super(props);
20363
- __publicField(this, "closeTimer");
20364
20348
  this.close = this.close.bind(this);
20365
20349
  this.startCloseTimer = this.startCloseTimer.bind(this);
20366
20350
  this.clearCloseTimer = this.clearCloseTimer.bind(this);
@@ -20433,7 +20417,7 @@ Please add \`${key}Action\` when creating your handler.`);
20433
20417
  )
20434
20418
  ));
20435
20419
  }
20436
- }, __publicField(_a, "newInstance"), _a);
20420
+ };
20437
20421
  Notification$1.newInstance = (properties, callback) => {
20438
20422
  const element = document.createElement("div");
20439
20423
  const id = properties.id ? properties.id : `${(/* @__PURE__ */ new Date()).getTime()}`;
@@ -20522,6 +20506,7 @@ Please add \`${key}Action\` when creating your handler.`);
20522
20506
  const defaultProps$y = {
20523
20507
  ...ComponentDefaults,
20524
20508
  list: [],
20509
+ theme: "light",
20525
20510
  location: "bottom",
20526
20511
  visible: false,
20527
20512
  offset: [0, 12],
@@ -20543,6 +20528,7 @@ Please add \`${key}Action\` when creating your handler.`);
20543
20528
  const {
20544
20529
  children,
20545
20530
  list,
20531
+ theme,
20546
20532
  location,
20547
20533
  visible,
20548
20534
  offset,
@@ -20599,8 +20585,8 @@ Please add \`${key}Action\` when creating your handler.`);
20599
20585
  }
20600
20586
  useClickAway(
20601
20587
  () => {
20602
- var _a2;
20603
- (_a2 = props.onClick) == null ? void 0 : _a2.call(props);
20588
+ var _a;
20589
+ (_a = props.onClick) == null ? void 0 : _a.call(props);
20604
20590
  onClose == null ? void 0 : onClose();
20605
20591
  },
20606
20592
  targetSet,
@@ -20626,7 +20612,8 @@ Please add \`${key}Action\` when creating your handler.`);
20626
20612
  };
20627
20613
  const classes = classNames(
20628
20614
  {
20629
- [`${classPrefix$b}`]: true
20615
+ [`${classPrefix$b}`]: true,
20616
+ [`${classPrefix$b}-${theme}`]: theme === "dark"
20630
20617
  },
20631
20618
  className
20632
20619
  );
@@ -20636,11 +20623,11 @@ Please add \`${key}Action\` when creating your handler.`);
20636
20623
  return `${prefixCls2} ${prefixCls2}-${direction} ${prefixCls2}-${location}`;
20637
20624
  };
20638
20625
  const getRootPosition = () => {
20639
- var _a2, _b;
20626
+ var _a, _b;
20640
20627
  const styles = {};
20641
20628
  if (!rootPosition)
20642
20629
  return {};
20643
- const contentWidth = (_a2 = popoverContentRef.current) == null ? void 0 : _a2.clientWidth;
20630
+ const contentWidth = (_a = popoverContentRef.current) == null ? void 0 : _a.clientWidth;
20644
20631
  const contentHeight = (_b = popoverContentRef.current) == null ? void 0 : _b.clientHeight;
20645
20632
  const { width, height, left, top, right } = rootPosition;
20646
20633
  const direction = location.split("-")[0];
@@ -20713,12 +20700,12 @@ Please add \`${key}Action\` when creating your handler.`);
20713
20700
  return styles;
20714
20701
  };
20715
20702
  const handleSelect = (item, index) => {
20716
- var _a2;
20703
+ var _a;
20717
20704
  if (!item.disabled) {
20718
20705
  onSelect == null ? void 0 : onSelect(item, index);
20719
20706
  }
20720
20707
  if (closeOnActionClick) {
20721
- (_a2 = props.onClick) == null ? void 0 : _a2.call(props);
20708
+ (_a = props.onClick) == null ? void 0 : _a.call(props);
20722
20709
  onClose == null ? void 0 : onClose();
20723
20710
  }
20724
20711
  };
@@ -20728,8 +20715,8 @@ Please add \`${key}Action\` when creating your handler.`);
20728
20715
  className: "nut-popover-wrapper",
20729
20716
  ref: popoverRef,
20730
20717
  onClick: () => {
20731
- var _a2;
20732
- (_a2 = props.onClick) == null ? void 0 : _a2.call(props);
20718
+ var _a;
20719
+ (_a = props.onClick) == null ? void 0 : _a.call(props);
20733
20720
  if (!visible) {
20734
20721
  onOpen == null ? void 0 : onOpen();
20735
20722
  } else {
@@ -20779,8 +20766,8 @@ Please add \`${key}Action\` when creating your handler.`);
20779
20766
  {
20780
20767
  className: "nut-popover-menu-item-action-icon",
20781
20768
  onClick: (e2) => {
20782
- var _a2, _b;
20783
- return (_b = (_a2 = item.action) == null ? void 0 : _a2.onClick) == null ? void 0 : _b.call(_a2, e2);
20769
+ var _a, _b;
20770
+ return (_b = (_a = item.action) == null ? void 0 : _a.onClick) == null ? void 0 : _b.call(_a, e2);
20784
20771
  }
20785
20772
  },
20786
20773
  item.action.icon
@@ -20857,8 +20844,8 @@ Please add \`${key}Action\` when creating your handler.`);
20857
20844
  const elementRef = React.useRef(null);
20858
20845
  const pullingRef = React.useRef(false);
20859
20846
  React.useEffect(() => {
20860
- var _a2;
20861
- (_a2 = elementRef.current) == null ? void 0 : _a2.addEventListener("touchmove", () => {
20847
+ var _a;
20848
+ (_a = elementRef.current) == null ? void 0 : _a.addEventListener("touchmove", () => {
20862
20849
  });
20863
20850
  }, []);
20864
20851
  async function doRefresh() {
@@ -20948,16 +20935,16 @@ Please add \`${key}Action\` when creating your handler.`);
20948
20935
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("i", { className: `${classPrefix2}-head-content-icons` }, (status2 === "pulling" || status2 === "complete") && /* @__PURE__ */ React.createElement(t$2, null), (status2 === "canRelease" || status2 === "refreshing") && /* @__PURE__ */ React.createElement(t$1, null)));
20949
20936
  };
20950
20937
  const renderStatusIcon = () => {
20951
- var _a2;
20938
+ var _a;
20952
20939
  if (props.renderIcon) {
20953
- return (_a2 = props.renderIcon) == null ? void 0 : _a2.call(props, status);
20940
+ return (_a = props.renderIcon) == null ? void 0 : _a.call(props, status);
20954
20941
  }
20955
20942
  return renderIcons(status);
20956
20943
  };
20957
20944
  const renderStatusText = () => {
20958
- var _a2;
20945
+ var _a;
20959
20946
  if (props.renderText) {
20960
- return (_a2 = props.renderText) == null ? void 0 : _a2.call(props, status);
20947
+ return (_a = props.renderText) == null ? void 0 : _a.call(props, status);
20961
20948
  }
20962
20949
  if (status === "pulling")
20963
20950
  return props.pullingText;
@@ -21027,7 +21014,7 @@ Please add \`${key}Action\` when creating your handler.`);
21027
21014
  };
21028
21015
  const classPrefix$9 = `nut-avatar`;
21029
21016
  const Avatar = (props) => {
21030
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
21017
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
21031
21018
  const {
21032
21019
  children,
21033
21020
  size,
@@ -21054,7 +21041,7 @@ Please add \`${key}Action\` when creating your handler.`);
21054
21041
  const parent = React.useContext(AvatarContext);
21055
21042
  const sizeValue = ["large", "normal", "small"];
21056
21043
  const classes = classNames({
21057
- [`nut-avatar-${((_a2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _a2.size) || size || "normal"}`]: true,
21044
+ [`nut-avatar-${((_a = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _a.size) || size || "normal"}`]: true,
21058
21045
  [`nut-avatar-${((_b = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _b.shape) || shape}`]: true
21059
21046
  });
21060
21047
  const cls = classNames(classPrefix$9, classes, className);
@@ -21072,20 +21059,20 @@ Please add \`${key}Action\` when creating your handler.`);
21072
21059
  color: `${(_g = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _g.maxColor}`
21073
21060
  };
21074
21061
  React.useEffect(() => {
21075
- var _a3;
21076
- const avatarChildren = (_a3 = parent == null ? void 0 : parent.avatarGroupRef) == null ? void 0 : _a3.current.children;
21062
+ var _a2;
21063
+ const avatarChildren = (_a2 = parent == null ? void 0 : parent.avatarGroupRef) == null ? void 0 : _a2.current.children;
21077
21064
  if (avatarChildren) {
21078
21065
  avatarLength(avatarChildren);
21079
21066
  }
21080
21067
  }, []);
21081
21068
  const avatarLength = (children2) => {
21082
- var _a3, _b2, _c2;
21069
+ var _a2, _b2, _c2;
21083
21070
  for (let i = 0; i < children2.length; i++) {
21084
21071
  if (children2[i] && children2[i].classList && children2[i].classList[0] === "nut-avatar") {
21085
21072
  children2[i].setAttribute("data-index", i + 1);
21086
21073
  }
21087
21074
  }
21088
- const index = Number((_b2 = (_a3 = avatarRef == null ? void 0 : avatarRef.current) == null ? void 0 : _a3.dataset) == null ? void 0 : _b2.index);
21075
+ const index = Number((_b2 = (_a2 = avatarRef == null ? void 0 : avatarRef.current) == null ? void 0 : _a2.dataset) == null ? void 0 : _b2.index);
21089
21076
  const maxCount = (_c2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _c2.max;
21090
21077
  setMaxSum(children2.length);
21091
21078
  setAvatarIndex(index);
@@ -21224,20 +21211,20 @@ Please add \`${key}Action\` when creating your handler.`);
21224
21211
  const leftWidth = actionWidth.left;
21225
21212
  const rightWidth = actionWidth.right;
21226
21213
  const onTouchStart = (event) => {
21227
- var _a2;
21214
+ var _a;
21228
21215
  if (!props.disabled) {
21229
21216
  startOffset.current = state.offset;
21230
21217
  touch.start(event);
21231
- (_a2 = props.onTouchStart) == null ? void 0 : _a2.call(props, event);
21218
+ (_a = props.onTouchStart) == null ? void 0 : _a.call(props, event);
21232
21219
  }
21233
21220
  };
21234
21221
  const onTouchMove = (event) => {
21235
- var _a2;
21222
+ var _a;
21236
21223
  if (props.disabled) {
21237
21224
  return;
21238
21225
  }
21239
21226
  touch.move(event);
21240
- (_a2 = props.onTouchMove) == null ? void 0 : _a2.call(props, event);
21227
+ (_a = props.onTouchMove) == null ? void 0 : _a.call(props, event);
21241
21228
  if (touch.isHorizontal()) {
21242
21229
  lockClick.current = true;
21243
21230
  const newState = { ...state, dragging: true };
@@ -21254,14 +21241,14 @@ Please add \`${key}Action\` when creating your handler.`);
21254
21241
  }
21255
21242
  };
21256
21243
  const onTouchEnd = (event) => {
21257
- var _a2;
21244
+ var _a;
21258
21245
  if (state.dragging) {
21259
21246
  setState((v) => ({ ...v, dragging: false }));
21260
21247
  toggle(state.offset > 0 ? "left" : "right");
21261
21248
  setTimeout(() => {
21262
21249
  lockClick.current = false;
21263
21250
  }, 0);
21264
- (_a2 = props.onTouchEnd) == null ? void 0 : _a2.call(props, event);
21251
+ (_a = props.onTouchEnd) == null ? void 0 : _a.call(props, event);
21265
21252
  }
21266
21253
  };
21267
21254
  const toggle = (side) => {
@@ -21276,18 +21263,18 @@ Please add \`${key}Action\` when creating your handler.`);
21276
21263
  }
21277
21264
  };
21278
21265
  const open = (side) => {
21279
- var _a2;
21266
+ var _a;
21280
21267
  opened.current = true;
21281
21268
  const offset = side === "left" ? leftWidth : -rightWidth;
21282
21269
  const name = props.name;
21283
- (_a2 = props.onOpen) == null ? void 0 : _a2.call(props, { name, position: side });
21270
+ (_a = props.onOpen) == null ? void 0 : _a.call(props, { name, position: side });
21284
21271
  setState((v) => ({ ...v, offset: Number(offset) || 0 }));
21285
21272
  };
21286
21273
  const close = (position) => {
21287
- var _a2;
21274
+ var _a;
21288
21275
  if (opened.current) {
21289
21276
  opened.current = false;
21290
- (_a2 = props.onClose) == null ? void 0 : _a2.call(props, {
21277
+ (_a = props.onClose) == null ? void 0 : _a.call(props, {
21291
21278
  name: props.name,
21292
21279
  position: position || "left"
21293
21280
  });
@@ -21381,7 +21368,6 @@ Please add \`${key}Action\` when creating your handler.`);
21381
21368
  class Notification extends React__namespace.PureComponent {
21382
21369
  constructor(props) {
21383
21370
  super(props);
21384
- __publicField(this, "closeTimer");
21385
21371
  this.close = this.close.bind(this);
21386
21372
  this.startCloseTimer = this.startCloseTimer.bind(this);
21387
21373
  this.clearCloseTimer = this.clearCloseTimer.bind(this);
@@ -21495,7 +21481,6 @@ Please add \`${key}Action\` when creating your handler.`);
21495
21481
  ));
21496
21482
  }
21497
21483
  }
21498
- __publicField(Notification, "newInstance");
21499
21484
  Notification.newInstance = (properties, callback) => {
21500
21485
  const element = document.createElement("div");
21501
21486
  const id = properties.id ? properties.id : `${(/* @__PURE__ */ new Date()).getTime()}`;
@@ -21707,7 +21692,7 @@ Please add \`${key}Action\` when creating your handler.`);
21707
21692
  CountUp.defaultProps = defaultProps$r;
21708
21693
  CountUp.displayName = "NutCountUp";
21709
21694
  const defaultProps$q = {};
21710
- class AnimatingNumbers extends React.Component {
21695
+ const _AnimatingNumbers = class _AnimatingNumbers extends React.Component {
21711
21696
  constructor(props) {
21712
21697
  super(props);
21713
21698
  this.state = {};
@@ -21715,10 +21700,11 @@ Please add \`${key}Action\` when creating your handler.`);
21715
21700
  render() {
21716
21701
  return /* @__PURE__ */ React.createElement("div", { className: "nut-animatingnumbers" });
21717
21702
  }
21718
- }
21719
- __publicField(AnimatingNumbers, "defaultProps", defaultProps$q);
21720
- __publicField(AnimatingNumbers, "displayName", "NutAnimatingNumbers");
21721
- __publicField(AnimatingNumbers, "CountUp", CountUp);
21703
+ };
21704
+ _AnimatingNumbers.defaultProps = defaultProps$q;
21705
+ _AnimatingNumbers.displayName = "NutAnimatingNumbers";
21706
+ _AnimatingNumbers.CountUp = CountUp;
21707
+ let AnimatingNumbers = _AnimatingNumbers;
21722
21708
  AnimatingNumbers.CountUp = CountUp;
21723
21709
  const defaultProps$p = {
21724
21710
  ...ComponentDefaults,
@@ -21981,7 +21967,7 @@ Please add \`${key}Action\` when creating your handler.`);
21981
21967
  };
21982
21968
  const classPrefix$6 = `nut-circleprogress`;
21983
21969
  const CircleProgress = (props) => {
21984
- var _a2;
21970
+ var _a;
21985
21971
  const {
21986
21972
  children,
21987
21973
  percent,
@@ -22040,7 +22026,7 @@ Please add \`${key}Action\` when creating your handler.`);
22040
22026
  });
22041
22027
  return stopArr;
22042
22028
  };
22043
- return /* @__PURE__ */ React.createElement("div", { className: classes, style: styles, ...restProps }, /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 100 100" }, /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("linearGradient", { id: refRandomId, x1: "100%", y1: "0%", x2: "0%", y2: "0%" }, (_a2 = stop2()) == null ? void 0 : _a2.map((item, index) => {
22029
+ return /* @__PURE__ */ React.createElement("div", { className: classes, style: styles, ...restProps }, /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 100 100" }, /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("linearGradient", { id: refRandomId, x1: "100%", y1: "0%", x2: "0%", y2: "0%" }, (_a = stop2()) == null ? void 0 : _a.map((item, index) => {
22044
22030
  return /* @__PURE__ */ React.createElement("stop", { key: index, offset: item.key, stopColor: item.value });
22045
22031
  }))), /* @__PURE__ */ React.createElement(
22046
22032
  "path",
@@ -22126,8 +22112,8 @@ Please add \`${key}Action\` when creating your handler.`);
22126
22112
  }
22127
22113
  };
22128
22114
  const getOffsetHeight = () => {
22129
- var _a2;
22130
- const height = (_a2 = contentRef.current) == null ? void 0 : _a2.offsetHeight;
22115
+ var _a;
22116
+ const height = (_a = contentRef.current) == null ? void 0 : _a.offsetHeight;
22131
22117
  return height ? `${height}px` : "";
22132
22118
  };
22133
22119
  const toggle = () => {
@@ -22309,7 +22295,7 @@ Please add \`${key}Action\` when creating your handler.`);
22309
22295
  if (!timeStr)
22310
22296
  return Date.now();
22311
22297
  let t2 = timeStr;
22312
- t2 = t2 > 0 ? +t2 : t2.toString().replace(/-/g, "/");
22298
+ t2 = Number(t2) > 0 ? +t2 : t2.toString().replace(/-/g, "/");
22313
22299
  return new Date(t2).getTime();
22314
22300
  };
22315
22301
  const initTime = () => {
@@ -22508,7 +22494,7 @@ Please add \`${key}Action\` when creating your handler.`);
22508
22494
  };
22509
22495
  const classPrefix$5 = `nut-ellipsis`;
22510
22496
  const Ellipsis = (props) => {
22511
- var _a2, _b;
22497
+ var _a, _b;
22512
22498
  const {
22513
22499
  children,
22514
22500
  content,
@@ -22648,7 +22634,7 @@ Please add \`${key}Action\` when creating your handler.`);
22648
22634
  const handleClick2 = () => {
22649
22635
  onClick && onClick();
22650
22636
  };
22651
- return /* @__PURE__ */ React.createElement("div", { className: classes, onClick: handleClick2, ref: root2, ...rest }, /* @__PURE__ */ React.createElement("div", null, !exceeded ? content : null, exceeded && !expanded ? /* @__PURE__ */ React.createElement(React.Fragment, null, (_a2 = ellipsis.current) == null ? void 0 : _a2.leading, expandText ? /* @__PURE__ */ React.createElement(
22637
+ return /* @__PURE__ */ React.createElement("div", { className: classes, onClick: handleClick2, ref: root2, ...rest }, /* @__PURE__ */ React.createElement("div", null, !exceeded ? content : null, exceeded && !expanded ? /* @__PURE__ */ React.createElement(React.Fragment, null, (_a = ellipsis.current) == null ? void 0 : _a.leading, expandText ? /* @__PURE__ */ React.createElement(
22652
22638
  "span",
22653
22639
  {
22654
22640
  className: "nut-ellipsis-text",
@@ -22865,7 +22851,7 @@ Please add \`${key}Action\` when creating your handler.`);
22865
22851
  swiperRef.current.autoplayTimer = null;
22866
22852
  };
22867
22853
  const startPlay = () => {
22868
- if (mergedProps.autoPlay <= 0 || swiperItemCount <= 1)
22854
+ if (Number(mergedProps.autoPlay) <= 0 || swiperItemCount <= 1)
22869
22855
  return;
22870
22856
  stopAutoPlay();
22871
22857
  swiperRef.current.autoplayTimer = setTimeout(() => {
@@ -22936,7 +22922,7 @@ Please add \`${key}Action\` when creating your handler.`);
22936
22922
  isEmit = false,
22937
22923
  movingStatus = false
22938
22924
  }) => {
22939
- var _a2;
22925
+ var _a;
22940
22926
  if (swiperItemCount <= 1)
22941
22927
  return;
22942
22928
  const targetActive = getActive(pace);
@@ -22953,7 +22939,7 @@ Please add \`${key}Action\` when creating your handler.`);
22953
22939
  setChildOffset(childOffset);
22954
22940
  }
22955
22941
  if (isEmit && active !== targetActive) {
22956
- (_a2 = props.onChange) == null ? void 0 : _a2.call(props, (targetActive + swiperItemCount) % swiperItemCount);
22942
+ (_a = props.onChange) == null ? void 0 : _a.call(props, (targetActive + swiperItemCount) % swiperItemCount);
22957
22943
  }
22958
22944
  active = targetActive;
22959
22945
  setActive(targetActive);
@@ -23114,13 +23100,13 @@ Please add \`${key}Action\` when creating your handler.`);
23114
23100
  { name: "touchend", e: onTouchEnd }
23115
23101
  ];
23116
23102
  events.forEach((item) => {
23117
- var _a2;
23118
- (_a2 = container.current) == null ? void 0 : _a2.addEventListener(item.name, item.e, false);
23103
+ var _a;
23104
+ (_a = container.current) == null ? void 0 : _a.addEventListener(item.name, item.e, false);
23119
23105
  });
23120
23106
  return () => {
23121
23107
  events.forEach((item) => {
23122
- var _a2;
23123
- (_a2 = container.current) == null ? void 0 : _a2.removeEventListener(item.name, item.e, false);
23108
+ var _a;
23109
+ (_a = container.current) == null ? void 0 : _a.removeEventListener(item.name, item.e, false);
23124
23110
  });
23125
23111
  };
23126
23112
  });
@@ -23236,8 +23222,8 @@ Please add \`${key}Action\` when creating your handler.`);
23236
23222
  defaultValue,
23237
23223
  finalValue: defaultValue,
23238
23224
  onChange: (val) => {
23239
- var _a2;
23240
- (_a2 = props.onChange) == null ? void 0 : _a2.call(props, val);
23225
+ var _a;
23226
+ (_a = props.onChange) == null ? void 0 : _a.call(props, val);
23241
23227
  }
23242
23228
  });
23243
23229
  const [showPop, setShowPop] = React.useState(visible);
@@ -23348,9 +23334,9 @@ Please add \`${key}Action\` when creating your handler.`);
23348
23334
  );
23349
23335
  };
23350
23336
  const slideChangeEnd = (page) => {
23351
- var _a2;
23337
+ var _a;
23352
23338
  setActive(page + 1);
23353
- (_a2 = props.onChange) == null ? void 0 : _a2.call(props, page + 1);
23339
+ (_a = props.onChange) == null ? void 0 : _a.call(props, page + 1);
23354
23340
  };
23355
23341
  const onCloseInner = () => {
23356
23342
  setShowPop(false);
@@ -23649,8 +23635,8 @@ Please add \`${key}Action\` when creating your handler.`);
23649
23635
  return index === +parent.propSteps.value ? "process" : "wait";
23650
23636
  };
23651
23637
  const handleClickStep = () => {
23652
- var _a2, _b;
23653
- ((_a2 = parent.propSteps) == null ? void 0 : _a2.onStepClick) && ((_b = parent.propSteps) == null ? void 0 : _b.onStepClick(value));
23638
+ var _a, _b;
23639
+ ((_a = parent.propSteps) == null ? void 0 : _a.onStepClick) && ((_b = parent.propSteps) == null ? void 0 : _b.onStepClick(value));
23654
23640
  };
23655
23641
  const classPrefix2 = `nut-step`;
23656
23642
  const classes = classNames(
@@ -23706,7 +23692,7 @@ Please add \`${key}Action\` when creating your handler.`);
23706
23692
  };
23707
23693
  Steps.defaultProps = defaultProps$b;
23708
23694
  Steps.displayName = "NutSteps";
23709
- function useTableSticky(columns) {
23695
+ function useTableSticky(columns, rtl = false) {
23710
23696
  const [isSticky, setIsSticky] = React.useState(false);
23711
23697
  const [stickyColumnStyleMap, setStickyColumnStyleMap] = React.useState({});
23712
23698
  const [stickyColumnClassMap, setStickyColumnClassMap] = React.useState({});
@@ -23721,9 +23707,9 @@ Please add \`${key}Action\` when creating your handler.`);
23721
23707
  let _stickyLeftWidth = 0;
23722
23708
  let _stickyRightWidth = 0;
23723
23709
  leftColumns.forEach((curr, index) => {
23724
- leftColumns[index - 1] || {};
23710
+ const dir = rtl ? "right" : "left";
23725
23711
  _columnStyleMap[curr.key] = {
23726
- left: _stickyLeftWidth || 0,
23712
+ [dir]: _stickyLeftWidth || 0,
23727
23713
  width: curr.width || "auto"
23728
23714
  };
23729
23715
  _columnClassMap[curr.key] = {
@@ -23739,9 +23725,9 @@ Please add \`${key}Action\` when creating your handler.`);
23739
23725
  });
23740
23726
  for (let i = rightColumns.length - 1; i >= 0; i--) {
23741
23727
  const curr = rightColumns[i];
23742
- rightColumns[i + 1] || {};
23728
+ const dir = rtl ? "left" : "right";
23743
23729
  _columnStyleMap[curr.key] = {
23744
- right: _stickyRightWidth || 0,
23730
+ [dir]: _stickyRightWidth || 0,
23745
23731
  width: curr.width || "auto"
23746
23732
  };
23747
23733
  _columnClassMap[curr.key] = {
@@ -23788,6 +23774,7 @@ Please add \`${key}Action\` when creating your handler.`);
23788
23774
  };
23789
23775
  const Table = (props) => {
23790
23776
  const { locale } = useConfig();
23777
+ const rtl = useRtl();
23791
23778
  defaultProps$a.noData = locale.noData;
23792
23779
  const {
23793
23780
  children,
@@ -23818,7 +23805,7 @@ Please add \`${key}Action\` when creating your handler.`);
23818
23805
  stickyRightWidth,
23819
23806
  getStickyClass,
23820
23807
  getStickyStyle
23821
- } = useTableSticky(columns);
23808
+ } = useTableSticky(columns, rtl);
23822
23809
  React.useEffect(() => {
23823
23810
  setValue(data);
23824
23811
  }, [data]);
@@ -24367,8 +24354,8 @@ Please add \`${key}Action\` when creating your handler.`);
24367
24354
  setListTotalSize(totalSize);
24368
24355
  }, [list, itemHeight, horizontal]);
24369
24356
  const getElement = React.useCallback(() => {
24370
- var _a2;
24371
- return ((_a2 = scrollRef.current) == null ? void 0 : _a2.parentElement) || document.body;
24357
+ var _a;
24358
+ return ((_a = scrollRef.current) == null ? void 0 : _a.parentElement) || document.body;
24372
24359
  }, []);
24373
24360
  React.useEffect(() => {
24374
24361
  if (containerHeight)
@@ -24545,8 +24532,8 @@ Please add \`${key}Action\` when creating your handler.`);
24545
24532
  barrageCWidth.current = barrageBody.current.offsetWidth;
24546
24533
  }
24547
24534
  setTimeout(() => {
24548
- var _a2;
24549
- (_a2 = barrageBody.current) == null ? void 0 : _a2.style.setProperty(
24535
+ var _a;
24536
+ (_a = barrageBody.current) == null ? void 0 : _a.style.setProperty(
24550
24537
  "--move-distance",
24551
24538
  `-${barrageCWidth.current}px`
24552
24539
  );
@@ -24795,8 +24782,8 @@ Please add \`${key}Action\` when creating your handler.`);
24795
24782
  ];
24796
24783
  }
24797
24784
  newActiveTime = newActiveTime.filter((item) => {
24798
- var _a2;
24799
- return ((_a2 = item[optionKey.childrenKey]) == null ? void 0 : _a2.length) > 0;
24785
+ var _a;
24786
+ return ((_a = item[optionKey.childrenKey]) == null ? void 0 : _a.length) > 0;
24800
24787
  });
24801
24788
  setActiveTime(newActiveTime);
24802
24789
  onTimeChange && onTimeChange(selectTime, newActiveTime);