@nutui/nutui-react-taro 2.3.8 → 2.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/CHANGELOG.md +37 -4
  2. package/dist/esm/ActionSheet/style/style.css +1 -1
  3. package/dist/esm/ActionSheet.js +2 -2
  4. package/dist/esm/Address/style/style.css +1 -1
  5. package/dist/esm/Address.js +5 -5
  6. package/dist/esm/Animate/style/style.css +1 -1
  7. package/dist/esm/Audio/style/style.css +1 -1
  8. package/dist/esm/Audio.js +2 -2
  9. package/dist/esm/Avatar/style/style.css +1 -1
  10. package/dist/esm/AvatarCropper/style/style.css +1 -1
  11. package/dist/esm/AvatarGroup/style/style.css +1 -1
  12. package/dist/esm/Badge/style/style.css +1 -1
  13. package/dist/esm/Barrage/style/style.css +1 -1
  14. package/dist/esm/Barrage.js +4 -2
  15. package/dist/esm/Button/style/style.css +1 -1
  16. package/dist/esm/Calendar/style/style.css +1 -1
  17. package/dist/esm/Calendar.js +4 -4
  18. package/dist/esm/CalendarCard/style/style.css +1 -1
  19. package/dist/esm/CalendarCard.js +2 -2
  20. package/dist/esm/CalendarItem.js +2 -2
  21. package/dist/esm/Card/style/style.css +1 -1
  22. package/dist/esm/Cascader/style/style.css +1 -1
  23. package/dist/esm/Cascader.js +3 -3
  24. package/dist/esm/Cell/style/style.css +1 -1
  25. package/dist/esm/CellGroup/style/style.css +1 -1
  26. package/dist/esm/Checkbox/style/style.css +1 -1
  27. package/dist/esm/CheckboxGroup/style/style.css +1 -1
  28. package/dist/esm/CircleProgress/style/style.css +1 -1
  29. package/dist/esm/Col/style/style.css +1 -1
  30. package/dist/esm/Collapse/style/style.css +1 -1
  31. package/dist/esm/CollapseItem/style/style.css +1 -1
  32. package/dist/esm/ConfigProvider.js +2 -2
  33. package/dist/esm/CountDown.js +2 -2
  34. package/dist/esm/DatePicker/style/style.css +1 -1
  35. package/dist/esm/DatePicker.js +4 -4
  36. package/dist/esm/Dialog/style/style.css +1 -1
  37. package/dist/esm/Dialog.js +2 -2
  38. package/dist/esm/Divider/style/style.css +1 -1
  39. package/dist/esm/Elevator/style/style.css +1 -1
  40. package/dist/esm/Empty/style/style.css +1 -1
  41. package/dist/esm/Empty.js +2 -2
  42. package/dist/esm/FixedNav/style/style.css +1 -1
  43. package/dist/esm/FixedNav.js +2 -2
  44. package/dist/esm/Form/style/style.css +1 -1
  45. package/dist/esm/Form.js +1 -1
  46. package/dist/esm/FormItem/style/style.css +1 -1
  47. package/dist/esm/FormItem.js +1 -1
  48. package/dist/esm/Grid/style/style.css +1 -1
  49. package/dist/esm/Grid.js +3 -3
  50. package/dist/esm/GridItem/style/style.css +1 -1
  51. package/dist/esm/GridItem.js +2 -2
  52. package/dist/esm/Image/style/style.css +1 -1
  53. package/dist/esm/ImagePreview/style/style.css +1 -1
  54. package/dist/esm/ImagePreview.js +2 -2
  55. package/dist/esm/Indicator/style/style.css +1 -1
  56. package/dist/esm/InfiniteLoading/style/style.css +1 -1
  57. package/dist/esm/InfiniteLoading.js +2 -2
  58. package/dist/esm/Input.js +2 -2
  59. package/dist/esm/Menu/style/style.css +1 -1
  60. package/dist/esm/MenuItem/style/style.css +1 -1
  61. package/dist/esm/NavBar/style/style.css +1 -1
  62. package/dist/esm/NoticeBar/style/style.css +1 -1
  63. package/dist/esm/Notify/style/style.css +1 -1
  64. package/dist/esm/NumberKeyboard/style/style.css +1 -1
  65. package/dist/esm/NumberKeyboard.js +3 -3
  66. package/dist/esm/Overlay/style/style.css +1 -1
  67. package/dist/esm/Pagination/style/style.css +1 -1
  68. package/dist/esm/Pagination.js +2 -2
  69. package/dist/esm/Picker/style/style.css +1 -1
  70. package/dist/esm/Picker.js +3 -3
  71. package/dist/esm/Popover/style/style.css +1 -1
  72. package/dist/esm/Popover.js +2 -2
  73. package/dist/esm/Popup/style/style.css +1 -1
  74. package/dist/esm/Popup.js +1 -1
  75. package/dist/esm/Price/style/style.css +1 -1
  76. package/dist/esm/Progress/style/style.css +1 -1
  77. package/dist/esm/PullToRefresh/style/style.css +1 -1
  78. package/dist/esm/PullToRefresh.js +2 -2
  79. package/dist/esm/Radio/style/style.css +1 -1
  80. package/dist/esm/Range/style/style.css +1 -1
  81. package/dist/esm/Rate/style/style.css +1 -1
  82. package/dist/esm/SearchBar/style/style.css +1 -1
  83. package/dist/esm/SearchBar.js +2 -2
  84. package/dist/esm/ShortPassword/style/style.css +1 -1
  85. package/dist/esm/ShortPassword.js +3 -3
  86. package/dist/esm/SideNavBar/style/style.css +1 -1
  87. package/dist/esm/SideNavBar.js +2 -2
  88. package/dist/esm/Skeleton/style/style.css +1 -1
  89. package/dist/esm/Space/style/style.css +1 -1
  90. package/dist/esm/Step/style/style.css +1 -1
  91. package/dist/esm/Steps/style/style.css +1 -1
  92. package/dist/esm/Sticky.js +1 -1
  93. package/dist/esm/Swipe/style/style.css +1 -1
  94. package/dist/esm/Swiper/style/style.css +1 -1
  95. package/dist/esm/Switch/style/style.css +1 -1
  96. package/dist/esm/Tabbar/style/style.css +1 -1
  97. package/dist/esm/TabbarItem/style/style.css +1 -1
  98. package/dist/esm/Table/style/style.css +1 -1
  99. package/dist/esm/Table.js +2 -2
  100. package/dist/esm/Tabs/style/style.css +1 -1
  101. package/dist/esm/Tabs.js +1 -1
  102. package/dist/esm/Tag/style/style.css +1 -1
  103. package/dist/esm/TextArea/style/style.css +1 -1
  104. package/dist/esm/TextArea.js +2 -2
  105. package/dist/esm/TimeDetail/style/style.css +1 -1
  106. package/dist/esm/TimeSelect/style/style.css +1 -1
  107. package/dist/esm/TimeSelect.js +3 -3
  108. package/dist/esm/Toast/style/style.css +1 -1
  109. package/dist/esm/Tour/style/style.css +1 -1
  110. package/dist/esm/Tour.js +3 -3
  111. package/dist/esm/TrendArrow/style/style.css +1 -1
  112. package/dist/esm/Uploader/style/style.css +1 -1
  113. package/dist/esm/Uploader.js +2 -2
  114. package/dist/esm/VirtualList/style/style.css +1 -1
  115. package/dist/esm/WaterMark.js +2 -2
  116. package/dist/esm/{actionsheet.taro-gfhQciJ4.js → actionsheet.taro-6NiOrNyd.js} +1 -1
  117. package/dist/esm/{address.taro-LCSSqsR-.js → address.taro-zQuxQEce.js} +3 -3
  118. package/dist/esm/{audio.taro-UpVxFvGk.js → audio.taro-dJgj5qIu.js} +1 -1
  119. package/dist/esm/barrage.taro-6nbq7wtt.js +118 -0
  120. package/dist/esm/{calendar.taro-Kf91Qo5t.js → calendar.taro-iNNHje7V.js} +3 -3
  121. package/dist/esm/{calendarcard.taro-tY-cyh-F.js → calendarcard.taro-9s7naGmU.js} +1 -1
  122. package/dist/esm/{calendaritem.taro-G5BaVw8e.js → calendaritem.taro-o6Z8OOGY.js} +1 -1
  123. package/dist/esm/{cascader.taro-x_X9F_pH.js → cascader.taro-M2nZWxiB.js} +2 -2
  124. package/dist/esm/{configprovider.taro-_wngOo0k.js → configprovider.taro-q5J2gQbi.js} +6 -4
  125. package/dist/esm/{countdown.taro-rJngrZUZ.js → countdown.taro-XZlfWBrA.js} +1 -1
  126. package/dist/esm/{datepicker.taro-S111IvJO.js → datepicker.taro-DrXkqJkN.js} +2 -2
  127. package/dist/esm/{dialog.taro-z588FBZJ.js → dialog.taro-dmQGDu3o.js} +1 -1
  128. package/dist/esm/{empty.taro-98NzV-31.js → empty.taro-gwvOr1xf.js} +1 -1
  129. package/dist/esm/{fixednav.taro-7OfzwFBE.js → fixednav.taro-QVBXysDj.js} +1 -1
  130. package/dist/esm/{formitem.taro-atY4A0pS.js → formitem.taro-PPkTQGfW.js} +39 -10
  131. package/dist/esm/{grid.taro-Hc4q01A_.js → grid.taro-3X-_AhXw.js} +1 -1
  132. package/dist/esm/{griditem.taro-RdNA-Wqv.js → griditem.taro-TJDJVeQy.js} +1 -1
  133. package/dist/esm/{imagepreview.taro-qDST6Lh4.js → imagepreview.taro--fVrJUOE.js} +1 -1
  134. package/dist/esm/{infiniteloading.taro-sl41Ddeh.js → infiniteloading.taro-BO0_y46K.js} +2 -1
  135. package/dist/esm/{input.taro-8gs046AH.js → input.taro-YoPsV-op.js} +20 -17
  136. package/dist/esm/{numberkeyboard.taro-CyW0s9bI.js → numberkeyboard.taro-bF6VCXry.js} +2 -2
  137. package/dist/esm/nutui-react.es.js +37 -37
  138. package/dist/esm/{pagination.taro-RYmB2As4.js → pagination.taro-C4_Ey5KC.js} +1 -1
  139. package/dist/esm/{picker.taro-RAYmFSC0.js → picker.taro-csU3SZPF.js} +2 -2
  140. package/dist/esm/{popover.taro-MUrnn7xY.js → popover.taro-qldQwLPC.js} +1 -1
  141. package/dist/esm/{popup.taro-2FdJu1kg.js → popup.taro-ObEUml4r.js} +1 -1
  142. package/dist/esm/{pulltorefresh.taro-VbzsD_HC.js → pulltorefresh.taro-2jER8Mat.js} +1 -1
  143. package/dist/esm/{searchbar.taro-Hmwspp92.js → searchbar.taro-hVzdT6nI.js} +1 -1
  144. package/dist/esm/{shortpassword.taro-uFeVULsY.js → shortpassword.taro-ECs_E1Xn.js} +20 -7
  145. package/dist/esm/{sidenavbar.taro-J5SEKQIh.js → sidenavbar.taro-8qoGZg5n.js} +1 -1
  146. package/dist/esm/{sticky.taro-MmKUU2Wv.js → sticky.taro-p-evMNR-.js} +1 -1
  147. package/dist/esm/{table.taro-d172EUh9.js → table.taro-0zRh2hq6.js} +1 -1
  148. package/dist/esm/{tabs.taro-w8ra49Qb.js → tabs.taro-Yj7vgtSg.js} +1 -1
  149. package/dist/esm/{textarea.taro-VYqlTewy.js → textarea.taro-9zQLTCwU.js} +2 -2
  150. package/dist/esm/{timeselect.taro-7FWR9oaJ.js → timeselect.taro-j8LgSCe5.js} +2 -2
  151. package/dist/esm/{tour.taro-HLsDVf9g.js → tour.taro-CGEjzzN_.js} +1 -1
  152. package/dist/esm/types/src/packages/configprovider/configprovider.d.ts +2 -0
  153. package/dist/esm/types/src/packages/configprovider/configprovider.taro.d.ts +2 -0
  154. package/dist/esm/types/src/packages/configprovider/index.d.ts +1 -1
  155. package/dist/esm/types/src/packages/configprovider/index.taro.d.ts +1 -1
  156. package/dist/esm/types/src/packages/formitem/formitem.d.ts +6 -2
  157. package/dist/esm/types/src/packages/formitem/formitem.taro.d.ts +6 -2
  158. package/dist/esm/types/src/packages/popover/popover.taro.d.ts +7 -0
  159. package/dist/esm/types/src/packages/shortpassword/shortpassword.d.ts +3 -2
  160. package/dist/esm/types/src/packages/shortpassword/shortpassword.taro.d.ts +3 -2
  161. package/dist/esm/types/src/packages/shortpassword/types.d.ts +4 -0
  162. package/dist/esm/{uploader.taro-a-U18v5C.js → uploader.taro-bRF02TR9.js} +1 -1
  163. package/dist/esm/{watermark.taro-WDFdgWlJ.js → watermark.taro-nvSmcwu-.js} +1 -1
  164. package/dist/locales/base.js +1 -1
  165. package/dist/locales/en-US.js +1 -1
  166. package/dist/locales/id-ID.js +1 -1
  167. package/dist/locales/tr-TR.js +1 -1
  168. package/dist/locales/zh-CN.js +1 -1
  169. package/dist/locales/zh-TW.js +1 -1
  170. package/dist/locales/zh-UG.js +1 -1
  171. package/dist/nutui.react.es.js +172 -103
  172. package/dist/nutui.react.umd.js +172 -103
  173. package/dist/packages/address/address.scss +12 -0
  174. package/dist/packages/animate/animate.scss +49 -0
  175. package/dist/packages/audio/audio.scss +14 -0
  176. package/dist/packages/avatar/avatar.scss +25 -0
  177. package/dist/packages/avatarcropper/avatarcropper.scss +52 -0
  178. package/dist/packages/avatargroup/avatargroup.scss +11 -0
  179. package/dist/packages/badge/badge.scss +8 -0
  180. package/dist/packages/barrage/barrage.scss +18 -1
  181. package/dist/packages/button/button.scss +18 -0
  182. package/dist/packages/calendar/calendar.scss +24 -0
  183. package/dist/packages/calendarcard/calendarcard.scss +41 -0
  184. package/dist/packages/card/card.scss +21 -0
  185. package/dist/packages/cascader/cascader.scss +8 -0
  186. package/dist/packages/cellgroup/cellgroup.scss +14 -0
  187. package/dist/packages/checkbox/checkbox.scss +38 -0
  188. package/dist/packages/checkboxgroup/checkboxgroup.scss +24 -8
  189. package/dist/packages/circleprogress/circleprogress.scss +8 -0
  190. package/dist/packages/col/col.scss +25 -0
  191. package/dist/packages/collapseitem/collapseitem.scss +15 -0
  192. package/dist/packages/dialog/dialog.scss +29 -0
  193. package/dist/packages/divider/divider.scss +22 -0
  194. package/dist/packages/elevator/elevator.scss +20 -0
  195. package/dist/packages/ellipsis/ellipsis.scss +1 -0
  196. package/dist/packages/empty/empty.scss +11 -0
  197. package/dist/packages/fixednav/fixednav.scss +75 -0
  198. package/dist/packages/form/form.scss +31 -0
  199. package/dist/packages/formitem/formitem.scss +15 -0
  200. package/dist/packages/grid/grid.scss +8 -0
  201. package/dist/packages/griditem/griditem.scss +37 -0
  202. package/dist/packages/image/image.scss +13 -0
  203. package/dist/packages/imagepreview/imagepreview.scss +26 -0
  204. package/dist/packages/indicator/indicator.scss +15 -0
  205. package/dist/packages/infiniteloading/infiniteloading.scss +13 -0
  206. package/dist/packages/loading/loading.scss +6 -0
  207. package/dist/packages/menu/menu.scss +9 -0
  208. package/dist/packages/menuitem/menuitem.scss +12 -0
  209. package/dist/packages/navbar/navbar.scss +61 -0
  210. package/dist/packages/noticebar/noticebar.scss +22 -0
  211. package/dist/packages/notify/notify.scss +10 -0
  212. package/dist/packages/numberkeyboard/numberkeyboard.scss +27 -0
  213. package/dist/packages/overlay/overlay.scss +6 -0
  214. package/dist/packages/pagination/pagination.scss +24 -0
  215. package/dist/packages/popover/popover.scss +105 -0
  216. package/dist/packages/popup/popup.scss +77 -0
  217. package/dist/packages/price/price.scss +19 -0
  218. package/dist/packages/progress/progress.scss +7 -0
  219. package/dist/packages/pulltorefresh/pulltorefresh.scss +10 -0
  220. package/dist/packages/radio/radio.scss +21 -0
  221. package/dist/packages/range/range.scss +65 -0
  222. package/dist/packages/rate/rate.scss +30 -0
  223. package/dist/packages/safearea/safearea.scss +2 -0
  224. package/dist/packages/searchbar/searchbar.scss +65 -0
  225. package/dist/packages/shortpassword/shortpassword.scss +25 -0
  226. package/dist/packages/sidenavbar/sidenavbar.scss +15 -0
  227. package/dist/packages/skeleton/skeleton.scss +22 -1
  228. package/dist/packages/space/space.scss +30 -0
  229. package/dist/packages/step/step.scss +45 -0
  230. package/dist/packages/swipe/swipe.scss +15 -0
  231. package/dist/packages/swiper/swiper.scss +14 -0
  232. package/dist/packages/switch/switch.scss +13 -0
  233. package/dist/packages/tabbar/tabbar.scss +13 -0
  234. package/dist/packages/tabbaritem/tabbaritem.scss +2 -0
  235. package/dist/packages/table/table.scss +57 -0
  236. package/dist/packages/tabs/tabs.scss +85 -14
  237. package/dist/packages/tag/tag.scss +8 -0
  238. package/dist/packages/textarea/textarea.scss +17 -0
  239. package/dist/packages/timedetail/timedetail.scss +5 -0
  240. package/dist/packages/timeselect/timeselect.scss +5 -0
  241. package/dist/packages/toast/toast.scss +15 -0
  242. package/dist/packages/tour/tour.scss +23 -0
  243. package/dist/packages/trendarrow/trendarrow.scss +13 -0
  244. package/dist/packages/uploader/uploader.scss +36 -0
  245. package/dist/packages/video/video.scss +3 -0
  246. package/dist/packages/virtuallist/virtuallist.scss +11 -0
  247. package/dist/style.css +1 -1
  248. package/dist/style.mjs +1 -1
  249. package/dist/types/packages/backtop/backtop.taro.d.ts +1 -1
  250. package/dist/types/packages/configprovider/configprovider.d.ts +2 -0
  251. package/dist/types/packages/configprovider/configprovider.taro.d.ts +2 -0
  252. package/dist/types/packages/configprovider/index.d.ts +1 -1
  253. package/dist/types/packages/configprovider/index.taro.d.ts +1 -1
  254. package/dist/types/packages/formitem/formitem.d.ts +6 -2
  255. package/dist/types/packages/formitem/formitem.taro.d.ts +14 -2
  256. package/dist/types/packages/popover/popover.taro.d.ts +7 -0
  257. package/dist/types/packages/shortpassword/shortpassword.d.ts +3 -2
  258. package/dist/types/packages/shortpassword/shortpassword.taro.d.ts +3 -2
  259. package/dist/types/packages/shortpassword/types.d.ts +4 -0
  260. package/package.json +1 -1
  261. package/dist/esm/barrage.taro-HsivAhbE.js +0 -91
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  /*!
8
- * @nutui/nutui-react-taro v2.3.8 Fri Jan 26 2024 15:12:04 GMT+0800 (China Standard Time)
8
+ * @nutui/nutui-react-taro v2.3.10 Tue Feb 06 2024 16:10:56 GMT+0800 (China Standard Time)
9
9
  * (c) 2023 @jdf2e.
10
10
  * Released under the MIT License.
11
11
  */
@@ -1440,7 +1440,8 @@ const zhCN = {
1440
1440
  const classPrefix$p = "nut-configprovider";
1441
1441
  const defaultConfigRef$1 = {
1442
1442
  current: {
1443
- locale: zhCN
1443
+ locale: zhCN,
1444
+ direction: "ltr"
1444
1445
  }
1445
1446
  };
1446
1447
  const getDefaultConfig$1 = () => {
@@ -1458,7 +1459,7 @@ function convertThemeVarsToCSSVars(themeVars) {
1458
1459
  return cssVars;
1459
1460
  }
1460
1461
  const ConfigProvider = (props) => {
1461
- const { style, className, children, ...config2 } = props;
1462
+ const { style, className, children, direction, ...config2 } = props;
1462
1463
  const mergedConfig = useMemo(
1463
1464
  () => {
1464
1465
  return {
@@ -1478,10 +1479,11 @@ const ConfigProvider = (props) => {
1478
1479
  return /* @__PURE__ */ React__default.createElement(ConfigContext$1.Provider, { value: mergedConfig }, /* @__PURE__ */ React__default.createElement(
1479
1480
  "div",
1480
1481
  {
1481
- className: classNames(classPrefix$p, className),
1482
+ className: classNames(classPrefix$p, className, `nut-${direction}`),
1482
1483
  style: {
1483
1484
  ...cssVarStyle,
1484
- ...style
1485
+ ...style,
1486
+ direction
1485
1487
  }
1486
1488
  },
1487
1489
  children
@@ -4032,7 +4034,7 @@ const Sticky = (props) => {
4032
4034
  }
4033
4035
  }, []);
4034
4036
  usePageScroll((res) => {
4035
- if (getEnv() === "WEAPP") {
4037
+ if (getEnv() !== "WEB") {
4036
4038
  handleScroll(res.scrollTop);
4037
4039
  }
4038
4040
  });
@@ -4705,7 +4707,8 @@ const Popup = (props) => {
4705
4707
  CSSTransition$1,
4706
4708
  {
4707
4709
  classNames: transitionName,
4708
- unmountOnExit: true,
4710
+ mountOnEnter: true,
4711
+ unmountOnExit: destroyOnClose,
4709
4712
  timeout: duration,
4710
4713
  in: innerVisible,
4711
4714
  onEntered: onHandleOpened,
@@ -5339,7 +5342,7 @@ const Tabs = (props) => {
5339
5342
  onClick: (e2) => {
5340
5343
  tabChange(item);
5341
5344
  },
5342
- className: classNames(`${classPrefix$k}-titles-item taro`, {
5345
+ className: classNames(`${classPrefix$k}-titles-item`, {
5343
5346
  [`nut-tabs-titles-item-active`]: !item.disabled && String(item.value) === String(value),
5344
5347
  [`nut-tabs-titles-item-disabled`]: item.disabled,
5345
5348
  [`nut-tabs-titles-item-${align}`]: align
@@ -9749,6 +9752,7 @@ class FormStore {
9749
9752
  constructor() {
9750
9753
  // 初始化数据
9751
9754
  __publicField(this, "initialValues", {});
9755
+ __publicField(this, "updateList", []);
9752
9756
  // 存放表单中所有的数据 eg. {password: "ddd",username: "123"}
9753
9757
  __publicField(this, "store", {});
9754
9758
  // 所有的组件实例
@@ -9818,6 +9822,15 @@ class FormStore {
9818
9822
  }
9819
9823
  });
9820
9824
  });
9825
+ this.updateList.forEach((item) => {
9826
+ let shouldUpdate = item.condition;
9827
+ if (typeof item.condition === "function") {
9828
+ shouldUpdate = item.condition();
9829
+ }
9830
+ if (shouldUpdate) {
9831
+ item.entity.onStoreChange("update");
9832
+ }
9833
+ });
9821
9834
  });
9822
9835
  __publicField(this, "setCallback", (callback) => {
9823
9836
  this.callbacks = {
@@ -9886,6 +9899,16 @@ class FormStore {
9886
9899
  entity.onStoreChange("reset");
9887
9900
  });
9888
9901
  });
9902
+ // 监听事件
9903
+ __publicField(this, "registerUpdate", (field, shouldUpdate) => {
9904
+ this.updateList.push({
9905
+ entity: field,
9906
+ condition: shouldUpdate
9907
+ });
9908
+ return () => {
9909
+ this.updateList = this.updateList.filter((i2) => i2.entity !== field);
9910
+ };
9911
+ });
9889
9912
  __publicField(this, "dispatch", ({ name }) => {
9890
9913
  this.validateFields([name]);
9891
9914
  });
@@ -9897,7 +9920,8 @@ class FormStore {
9897
9920
  setInitialValues: this.setInitialValues,
9898
9921
  dispatch: this.dispatch,
9899
9922
  store: this.store,
9900
- fieldEntities: this.fieldEntities
9923
+ fieldEntities: this.fieldEntities,
9924
+ registerUpdate: this.registerUpdate
9901
9925
  };
9902
9926
  }
9903
9927
  });
@@ -10028,13 +10052,16 @@ const defaultProps$Y = {
10028
10052
  label: "",
10029
10053
  rules: [{ required: false, message: "" }],
10030
10054
  errorMessageAlign: "left",
10031
- validateTrigger: "onChange"
10055
+ validateTrigger: "onChange",
10056
+ shouldUpdate: false,
10057
+ noStyle: false
10032
10058
  };
10033
10059
  class FormItem extends React__default.Component {
10034
10060
  constructor(props) {
10035
10061
  super(props);
10036
10062
  __publicField(this, "cancelRegister");
10037
10063
  __publicField(this, "componentRef");
10064
+ __publicField(this, "eventOff");
10038
10065
  // children添加value属性和onChange事件
10039
10066
  __publicField(this, "getControlled", (children) => {
10040
10067
  var _a;
@@ -10108,7 +10135,6 @@ class FormItem extends React__default.Component {
10108
10135
  }
10109
10136
  });
10110
10137
  __publicField(this, "renderLayout", (childNode) => {
10111
- var _a;
10112
10138
  const {
10113
10139
  label,
10114
10140
  name,
@@ -10134,16 +10160,13 @@ class FormItem extends React__default.Component {
10134
10160
  onClick: (e2) => this.props.onClick && this.props.onClick(e2, this.componentRef)
10135
10161
  },
10136
10162
  label ? /* @__PURE__ */ React__default.createElement("div", { className: "nut-cell-title nut-form-item-label" }, renderLabel) : null,
10137
- /* @__PURE__ */ React__default.createElement("div", { className: "nut-cell-value nut-form-item-body" }, /* @__PURE__ */ React__default.createElement("div", { className: "nut-form-item-body-slots" }, childNode), /* @__PURE__ */ React__default.createElement(
10163
+ /* @__PURE__ */ React__default.createElement("div", { className: "nut-cell-value nut-form-item-body" }, /* @__PURE__ */ React__default.createElement("div", { className: "nut-form-item-body-slots" }, childNode), item && item.length > 0 && /* @__PURE__ */ React__default.createElement(
10138
10164
  "div",
10139
10165
  {
10140
10166
  className: "nut-form-item-body-tips",
10141
- style: {
10142
- textAlign: errorMessageAlign,
10143
- display: (item == null ? void 0 : item.length) ? "initial" : "none"
10144
- }
10167
+ style: { textAlign: errorMessageAlign }
10145
10168
  },
10146
- (_a = item == null ? void 0 : item[0]) == null ? void 0 : _a.message
10169
+ item[0].message
10147
10170
  ))
10148
10171
  );
10149
10172
  });
@@ -10153,22 +10176,31 @@ class FormItem extends React__default.Component {
10153
10176
  };
10154
10177
  }
10155
10178
  componentDidMount() {
10156
- const { registerField } = this.context.getInternal(SECRET);
10179
+ const { registerField, registerUpdate } = this.context.getInternal(SECRET);
10157
10180
  this.cancelRegister = registerField(this);
10181
+ this.eventOff = registerUpdate(this, this.props.shouldUpdate);
10158
10182
  }
10159
10183
  componentWillUnmount() {
10160
10184
  if (this.cancelRegister) {
10161
10185
  this.cancelRegister();
10162
10186
  }
10187
+ if (this.eventOff) {
10188
+ this.eventOff();
10189
+ }
10163
10190
  }
10164
10191
  render() {
10165
10192
  const { children } = this.props;
10166
10193
  const child = Array.isArray(children) ? children[0] : children;
10167
- const returnChildNode = React__default.cloneElement(
10168
- child,
10169
- this.getControlled(child)
10170
- );
10171
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, { key: this.state.resetCount }, this.renderLayout(returnChildNode));
10194
+ let returnChildNode;
10195
+ if (!this.props.shouldUpdate) {
10196
+ returnChildNode = React__default.cloneElement(
10197
+ child,
10198
+ this.getControlled(child)
10199
+ );
10200
+ } else {
10201
+ returnChildNode = child(this.context);
10202
+ }
10203
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, { key: this.state.resetCount }, this.props.noStyle ? returnChildNode : this.renderLayout(returnChildNode));
10172
10204
  }
10173
10205
  }
10174
10206
  __publicField(FormItem, "defaultProps", defaultProps$Y);
@@ -10300,19 +10332,28 @@ const Input = forwardRef(
10300
10332
  forceUpdate();
10301
10333
  };
10302
10334
  const handleFocus = (event) => {
10303
- const val = event.target.value;
10304
- onFocus && onFocus(val);
10335
+ if (Taro.getEnv() === "WEB") {
10336
+ const val = event.target.value;
10337
+ onFocus && onFocus(val);
10338
+ } else {
10339
+ onFocus == null ? void 0 : onFocus(value);
10340
+ }
10305
10341
  setActive(true);
10306
10342
  };
10307
10343
  const handleInput = (value2) => {
10308
10344
  updateValue(value2, "onChange");
10309
10345
  };
10310
10346
  const handleBlur = (event) => {
10311
- const val = event.target.value;
10312
- updateValue(val, "onBlur");
10313
- setTimeout(() => {
10347
+ if (Taro.getEnv() === "WEB") {
10348
+ const val = event.target.value;
10349
+ updateValue(val, "onBlur");
10350
+ setTimeout(() => {
10351
+ setActive(false);
10352
+ }, 50);
10353
+ } else {
10354
+ updateValue(value, "onBlur");
10314
10355
  setActive(false);
10315
- }, 50);
10356
+ }
10316
10357
  };
10317
10358
  const inputType = (type22) => {
10318
10359
  if (getEnv() === ENV_TYPE.WEB) {
@@ -10352,12 +10393,8 @@ const Input = forwardRef(
10352
10393
  value,
10353
10394
  focus: autoFocus,
10354
10395
  confirmType,
10355
- onBlur: (e2) => {
10356
- handleBlur(e2);
10357
- },
10358
- onFocus: (e2) => {
10359
- handleFocus(e2);
10360
- },
10396
+ onBlur: handleBlur,
10397
+ onFocus: handleFocus,
10361
10398
  onInput: (e2) => {
10362
10399
  handleInput(e2.currentTarget.value);
10363
10400
  }
@@ -10373,10 +10410,8 @@ const Input = forwardRef(
10373
10410
  onClick: (e2) => {
10374
10411
  e2.stopPropagation();
10375
10412
  if (!disabled) {
10376
- setTimeout(() => {
10377
- setValue("");
10378
- onClear && onClear("");
10379
- }, 50);
10413
+ setValue("");
10414
+ onClear == null ? void 0 : onClear("");
10380
10415
  }
10381
10416
  }
10382
10417
  },
@@ -12017,13 +12052,13 @@ const defaultProps$N = {
12017
12052
  // 1~6
12018
12053
  autoFocus: false
12019
12054
  };
12020
- const ShortPassword = (props) => {
12055
+ const InternalShortPassword = (props, ref) => {
12021
12056
  const { locale } = useConfig$1();
12022
12057
  const {
12023
12058
  title,
12024
12059
  description,
12025
12060
  tips,
12026
- visible,
12061
+ visible: deleteVisible,
12027
12062
  value,
12028
12063
  error,
12029
12064
  hideFooter,
@@ -12054,6 +12089,20 @@ const ShortPassword = (props) => {
12054
12089
  const format2 = (val) => {
12055
12090
  return val.slice(0, comLen);
12056
12091
  };
12092
+ const [visible, setVisible] = usePropsValue({
12093
+ value: props.visible,
12094
+ defaultValue: false,
12095
+ finalValue: false
12096
+ });
12097
+ const actions = {
12098
+ open: () => {
12099
+ setVisible(true);
12100
+ },
12101
+ close: () => {
12102
+ setVisible(false);
12103
+ }
12104
+ };
12105
+ useImperativeHandle(ref, () => actions);
12057
12106
  const [inputValue, setInputValue] = usePropsValue({ value, onChange });
12058
12107
  useEffect(() => {
12059
12108
  if (visible && autoFocus) {
@@ -12089,8 +12138,7 @@ const ShortPassword = (props) => {
12089
12138
  }))), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-message` }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-message-error` }, error), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-message-forget`, onClick: onTips }, tips || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(z, { size: 11, style: { marginRight: "3px" } }), locale.shortpassword.tips))), !hideFooter && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-footer` }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-footer-cancel`, onClick: onCancel }, locale.cancel), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-footer-sure`, onClick: sure }, locale.confirm)))
12090
12139
  );
12091
12140
  };
12092
- ShortPassword.defaultProps = defaultProps$N;
12093
- ShortPassword.displayName = "NutShortPassword";
12141
+ const ShortPassword = React__default.forwardRef(InternalShortPassword);
12094
12142
  const defaultProps$M = {
12095
12143
  ...ComponentDefaults,
12096
12144
  canvasId: "spcanvas",
@@ -12342,7 +12390,7 @@ const TextArea = (props) => {
12342
12390
  const classPrefix2 = "nut-textarea";
12343
12391
  const compositionRef = useRef(false);
12344
12392
  const format2 = (value2) => {
12345
- if (maxLength !== void 0 && value2.length > maxLength) {
12393
+ if (maxLength !== -1 && value2.length > maxLength) {
12346
12394
  return value2.substring(0, maxLength);
12347
12395
  }
12348
12396
  return value2;
@@ -13738,6 +13786,7 @@ const InfiniteLoading = (props) => {
13738
13786
  if (distance.current < refreshMaxH.current) {
13739
13787
  distance.current = 0;
13740
13788
  setTopDisScoll(0);
13789
+ isTouching.current = false;
13741
13790
  } else {
13742
13791
  await (onRefresh == null ? void 0 : onRefresh());
13743
13792
  refreshDone();
@@ -17616,7 +17665,8 @@ const getTaroRectById = (id) => {
17616
17665
  };
17617
17666
  const defaultConfigRef = {
17618
17667
  current: {
17619
- locale: zhCN
17668
+ locale: zhCN,
17669
+ direction: "ltr"
17620
17670
  }
17621
17671
  };
17622
17672
  const getDefaultConfig = () => {
@@ -18072,79 +18122,98 @@ const InternalBarrage = (props, ref) => {
18072
18122
  ...defaultProps$6,
18073
18123
  ...props
18074
18124
  };
18075
- const [styleList, setStyleList] = useState([]);
18076
- const [baItemList, setBaItemList] = useState(list);
18077
- const barrageListSet = useRef(list);
18078
18125
  const barrageBody = useRef(null);
18079
18126
  const barrageContainer = useRef(null);
18080
- const timeId = useRef((/* @__PURE__ */ new Date()).getTime());
18127
+ const barrageCWidth = useRef(0);
18081
18128
  const timer = useRef(0);
18082
- const classes = classNames(
18083
- classPrefix$1,
18084
- {
18085
- [`${classPrefix$1}-body${timeId.current}`]: true
18086
- },
18087
- className
18088
- );
18129
+ const index = useRef(0);
18130
+ const times = useRef([]);
18131
+ const historyIndex = useRef(-1);
18132
+ const classes = classNames(classPrefix$1, className);
18089
18133
  useImperativeHandle(ref, () => ({
18090
18134
  add: (word) => {
18091
- barrageListSet.current = [...barrageListSet.current, word];
18092
- run();
18135
+ const _index = index.current % list.length;
18136
+ if (!loop && index.current === list.length) {
18137
+ list.splice(list.length, 0, word);
18138
+ } else {
18139
+ list.splice(_index, 0, word);
18140
+ }
18093
18141
  }
18094
18142
  }));
18143
+ const getNodeWidth = async (node, type4 = "width") => {
18144
+ if (node) {
18145
+ const refe = await getRectByTaro(node);
18146
+ return Math.ceil(type4 === "height" ? refe.height : refe.width);
18147
+ }
18148
+ return 0;
18149
+ };
18095
18150
  useEffect(() => {
18096
- barrageListSet.current = [...list];
18097
- run();
18151
+ const init = async () => {
18152
+ if (barrageBody.current) {
18153
+ barrageCWidth.current = await getNodeWidth(barrageBody.current);
18154
+ }
18155
+ };
18156
+ init();
18157
+ setTimeout(() => {
18158
+ var _a;
18159
+ (_a = barrageBody.current) == null ? void 0 : _a.style.setProperty(
18160
+ "--move-distance",
18161
+ `-${barrageCWidth.current}px`
18162
+ );
18163
+ index.current = 0;
18164
+ run();
18165
+ }, 300);
18098
18166
  return () => {
18099
18167
  clearInterval(timer.current);
18100
18168
  };
18101
18169
  }, [list]);
18102
18170
  const run = () => {
18103
- setBaItemList(barrageListSet.current);
18104
- barrageListSet.current.forEach((item, index) => {
18105
- getNode(index);
18106
- });
18107
- };
18108
- const getNode = (index) => {
18109
- const query = createSelectorQuery();
18110
- setTimeout(() => {
18111
- let width = 100;
18112
- query.select(`.${classPrefix$1}-body${timeId.current}`).boundingClientRect((rec) => {
18113
- width = rec.width || 300;
18114
- });
18115
- query.select(`.${classPrefix$1}-item${index}`).boundingClientRect((recs) => {
18116
- const height = recs.height;
18117
- const nodeTop = `${index % rows * (height + gapY) + 20}px`;
18118
- styleInfo(index, nodeTop, width);
18119
- }).exec();
18120
- }, 500);
18171
+ clearInterval(timer.current);
18172
+ let intervalCache = interval;
18173
+ const _index = (loop ? index.current % list.length : index.current) % rows;
18174
+ const result = times.current[_index] - rows * interval;
18175
+ if (result > 0) {
18176
+ intervalCache += result;
18177
+ }
18178
+ timer.current = window.setTimeout(() => {
18179
+ play();
18180
+ }, intervalCache);
18121
18181
  };
18122
- const styleInfo = (index, nodeTop, width) => {
18123
- const timeIndex = index - rows > 0 ? index - rows : 0;
18124
- const list2 = styleList;
18125
- const time = list2[timeIndex] ? Number(list2[timeIndex]["--time"]) : 0;
18126
- const obj = {
18127
- top: nodeTop,
18128
- "--time": `${interval * index + time}`,
18129
- animationDuration: `${duration}ms`,
18130
- animationIterationCount: `${loop ? "infinite" : 1}`,
18131
- animationDelay: `${interval * index + time}ms`,
18132
- "--move-distance": `-${width}px`
18133
- };
18134
- list2.push(obj);
18135
- setStyleList([...list2]);
18182
+ const play = async () => {
18183
+ if (!loop && index.current >= list.length) {
18184
+ return;
18185
+ }
18186
+ const _index = loop ? index.current % list.length : index.current;
18187
+ const el = document.createElement(`View`);
18188
+ let currentIndex = _index % rows;
18189
+ if (currentIndex <= historyIndex.current || historyIndex.current === 3 && currentIndex !== 0 || Math.abs(currentIndex - historyIndex.current) !== 1) {
18190
+ currentIndex = historyIndex.current + 1 >= rows ? 0 : historyIndex.current + 1;
18191
+ }
18192
+ historyIndex.current = currentIndex;
18193
+ el.innerHTML = list[_index];
18194
+ el.classList.add("barrage-item");
18195
+ barrageContainer.current.appendChild(el);
18196
+ try {
18197
+ const width = await getNodeWidth(el);
18198
+ const height = await getNodeWidth(el, "height");
18199
+ el.classList.add("move");
18200
+ const elScrollDuration = width / barrageCWidth.current * duration;
18201
+ times.current[currentIndex] = Math.ceil(elScrollDuration);
18202
+ el.style.animationDuration = `${(duration + elScrollDuration).toFixed(
18203
+ 2
18204
+ )}ms`;
18205
+ el.style.top = `${currentIndex * (height + gapY) + 20}px`;
18206
+ el.style.width = `${width}px`;
18207
+ } catch (error) {
18208
+ console.log("异常自动流转到下一个");
18209
+ }
18210
+ el.addEventListener("animationend", () => {
18211
+ barrageContainer.current.removeChild(el);
18212
+ });
18213
+ index.current++;
18214
+ run();
18136
18215
  };
18137
- return /* @__PURE__ */ React__default.createElement("div", { className: classes, ref: barrageBody, ...restProps }, /* @__PURE__ */ React__default.createElement("div", { ref: barrageContainer, className: "bContainer" }, baItemList.map((item, index) => {
18138
- return /* @__PURE__ */ React__default.createElement(
18139
- "div",
18140
- {
18141
- className: `barrage-item ${classPrefix$1}-item${index} move`,
18142
- style: styleList[index],
18143
- key: index
18144
- },
18145
- item.length > 8 ? `${item.substr(0, 8)}...` : item
18146
- );
18147
- })));
18216
+ return /* @__PURE__ */ React__default.createElement(View, { className: classes, ref: barrageBody, ...restProps }, /* @__PURE__ */ React__default.createElement(View, { ref: barrageContainer, className: "bContainer" }));
18148
18217
  };
18149
18218
  const Barrage = React__default.forwardRef(
18150
18219
  InternalBarrage