@nutui/nutui 4.3.14 → 4.3.15-beta.2

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 (316) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +2 -2
  3. package/dist/nutui.es.js +2 -14
  4. package/dist/nutui.umd.js +19829 -1
  5. package/dist/packages/{Interceptor-CBzqGJrl.js → Interceptor-aNUpilAP.js} +1 -1
  6. package/dist/packages/actionsheet/ActionSheet.js +17 -11
  7. package/dist/packages/address/Address.js +139 -121
  8. package/dist/packages/addresslist/AddressList.js +22 -11
  9. package/dist/packages/animate/Animate.js +1 -1
  10. package/dist/packages/avatar/Avatar.js +1 -1
  11. package/dist/packages/avatarcropper/AvatarCropper.js +329 -126
  12. package/dist/packages/avatargroup/AvatarGroup.js +17 -10
  13. package/dist/packages/backtop/Backtop.js +42 -88
  14. package/dist/packages/badge/Badge.js +4 -2
  15. package/dist/packages/barrage/Barrage.js +76 -130
  16. package/dist/packages/button/Button.js +15 -8
  17. package/dist/packages/calendar/Calendar.js +173 -152
  18. package/dist/packages/calendarcard/CalendarCard.js +33 -61
  19. package/dist/packages/card/Card.js +12 -4
  20. package/dist/packages/cascader/Cascader.js +49 -37
  21. package/dist/packages/category/Category.js +13 -12
  22. package/dist/packages/categorypane/CategoryPane.js +13 -8
  23. package/dist/packages/cell/Cell.js +10 -16
  24. package/dist/packages/cellgroup/CellGroup.js +4 -2
  25. package/dist/packages/checkbox/Checkbox.js +1 -1
  26. package/dist/packages/circleprogress/CircleProgress.js +53 -69
  27. package/dist/packages/col/Col.js +1 -1
  28. package/dist/packages/collapse/Collapse.js +1 -1
  29. package/dist/packages/collapseitem/CollapseItem.js +74 -39
  30. package/dist/packages/comment/Comment.js +46 -24
  31. package/dist/packages/configprovider/ConfigProvider.js +1 -1
  32. package/dist/packages/countdown/Countdown.js +2 -2
  33. package/dist/packages/countup/Countup.js +53 -66
  34. package/dist/packages/datepicker/DatePicker.js +12 -7
  35. package/dist/packages/dialog/Dialog.js +27 -96
  36. package/dist/packages/dialog/index.mjs +1 -2
  37. package/dist/packages/divider/Divider.js +1 -1
  38. package/dist/packages/drag/Drag.js +95 -58
  39. package/dist/packages/ecard/Ecard.js +19 -16
  40. package/dist/packages/elevator/Elevator.js +86 -73
  41. package/dist/packages/ellipsis/Ellipsis.js +223 -121
  42. package/dist/packages/empty/Empty.js +5 -3
  43. package/dist/packages/fixednav/FixedNav.js +12 -7
  44. package/dist/packages/form/Form.js +2 -2
  45. package/dist/packages/formitem/FormItem.js +3 -1
  46. package/dist/packages/grid/Grid.js +1 -1
  47. package/dist/packages/griditem/GridItem.js +5 -15
  48. package/dist/packages/imagepreview/ImagePreview.js +192 -400
  49. package/dist/packages/imagepreview/index.mjs +1 -2
  50. package/dist/packages/{index-BOB4ytqZ.js → index-IxPZmHlb.js} +2 -2
  51. package/dist/packages/index-m0Wcof-q.js +69 -0
  52. package/dist/packages/{index-wLaOjIn1.js → index.taro-CNxLoYer.js} +6 -7
  53. package/dist/packages/index.taro.vue_vue_type_script_setup_true_lang-JJ7hr71Y.js +17 -0
  54. package/dist/packages/indicator/Indicator.js +2 -2
  55. package/dist/packages/input/Input.js +87 -70
  56. package/dist/packages/inputnumber/InputNumber.js +22 -14
  57. package/dist/packages/invoice/Invoice.js +3 -2
  58. package/dist/packages/list/List.js +114 -56
  59. package/dist/packages/menu/Menu.js +45 -40
  60. package/dist/packages/menuitem/MenuItem.js +53 -47
  61. package/dist/packages/navbar/Navbar.js +31 -17
  62. package/dist/packages/noticebar/Noticebar.js +68 -43
  63. package/dist/packages/notify/Notify.js +10 -157
  64. package/dist/packages/notify/index.mjs +1 -2
  65. package/dist/packages/numberkeyboard/NumberKeyboard.js +103 -109
  66. package/dist/packages/overlay/Overlay.js +6 -34
  67. package/dist/packages/pagination/Pagination.js +8 -5
  68. package/dist/packages/picker/Picker.js +113 -26
  69. package/dist/packages/popover/Popover.js +158 -88
  70. package/dist/packages/popup/Popup.js +1 -1
  71. package/dist/packages/price/Price.js +16 -3
  72. package/dist/packages/progress/Progress.js +7 -4
  73. package/dist/packages/radio/Radio.js +11 -12
  74. package/dist/packages/radiogroup/RadioGroup.js +2 -2
  75. package/dist/packages/{raf-c01wDYCo.js → raf-CzJhCkQo.js} +0 -9
  76. package/dist/packages/range/Range.js +139 -71
  77. package/dist/packages/rate/Rate.js +15 -49
  78. package/dist/packages/row/Row.js +1 -1
  79. package/dist/packages/searchbar/Searchbar.js +35 -27
  80. package/dist/packages/shortpassword/ShortPassword.js +51 -43
  81. package/dist/packages/sidenavbar/SideNavbar.js +3 -14
  82. package/dist/packages/sidenavbaritem/SideNavbarItem.js +2 -2
  83. package/dist/packages/signature/Signature.js +148 -106
  84. package/dist/packages/skeleton/Skeleton.js +6 -3
  85. package/dist/packages/sku/Sku.js +66 -42
  86. package/dist/packages/space/Space.js +2 -2
  87. package/dist/packages/step/Step.js +5 -2
  88. package/dist/packages/steps/Steps.js +1 -1
  89. package/dist/packages/sticky/Sticky.js +32 -71
  90. package/dist/packages/subsidenavbar/SubSideNavbar.js +13 -5
  91. package/dist/packages/swipe/Swipe.js +37 -14
  92. package/dist/packages/swipegroup/SwipeGroup.js +2 -2
  93. package/dist/packages/swiper/Swiper.js +73 -24
  94. package/dist/packages/switch/Switch.js +6 -4
  95. package/dist/packages/tabbar/Tabbar.js +23 -24
  96. package/dist/packages/tabbaritem/TabbarItem.js +8 -3
  97. package/dist/packages/table/Table.js +10 -6
  98. package/dist/packages/tabs/Tabs.js +146 -150
  99. package/dist/packages/tag/Tag.js +5 -5
  100. package/dist/packages/textarea/Textarea.js +144 -69
  101. package/dist/packages/timedetail/TimeDetail.js +2 -2
  102. package/dist/packages/timepannel/TimePannel.js +2 -2
  103. package/dist/packages/timeselect/TimeSelect.js +9 -11
  104. package/dist/packages/toast/Toast.js +50 -186
  105. package/dist/packages/toast/index.mjs +1 -2
  106. package/dist/packages/tour/Tour.js +145 -99
  107. package/dist/packages/trendarrow/TrendArrow.js +7 -4
  108. package/dist/packages/uploader/Uploader.js +263 -106
  109. package/dist/packages/{util-D1pvnUYu.js → util-2G3mRQeF.js} +5 -17
  110. package/dist/packages/watermark/Watermark.js +95 -35
  111. package/dist/smartips/web-types.json +380 -770
  112. package/dist/style.css +1 -1
  113. package/dist/styles/base-jda.css +1 -0
  114. package/dist/styles/themes/default.scss +0 -1
  115. package/dist/styles/themes/jda.scss +106 -0
  116. package/dist/styles/themes/jdb.scss +0 -1
  117. package/dist/styles/themes/jddkh.scss +0 -1
  118. package/dist/styles/themes/jdt.scss +0 -1
  119. package/dist/styles/variables-jda.scss +945 -0
  120. package/dist/types/__VUE/actionsheet/{index.vue.d.ts → index.taro.vue.d.ts} +5 -112
  121. package/dist/types/__VUE/address/{index.vue.d.ts → index.taro.vue.d.ts} +139 -412
  122. package/dist/types/__VUE/addresslist/components/{GeneralShell.vue.d.ts → GeneralShell.taro.vue.d.ts} +45 -134
  123. package/dist/types/__VUE/addresslist/components/ItemContents.taro.vue.d.ts +27 -0
  124. package/dist/types/__VUE/addresslist/{index.vue.d.ts → index.taro.vue.d.ts} +85 -155
  125. package/dist/types/__VUE/animate/{index.d.ts → index.taro.d.ts} +2 -2
  126. package/dist/types/__VUE/avatarcropper/{index.vue.d.ts → index.taro.vue.d.ts} +90 -147
  127. package/dist/types/__VUE/backtop/{backtop.vue.d.ts → backtop.taro.vue.d.ts} +8 -19
  128. package/dist/types/__VUE/backtop/{index.d.ts → index.taro.d.ts} +2 -2
  129. package/dist/types/__VUE/badge/{index.d.ts → index.taro.d.ts} +2 -2
  130. package/dist/types/__VUE/barrage/{index.vue.d.ts → index.taro.vue.d.ts} +10 -5
  131. package/dist/types/__VUE/button/{button.vue.d.ts → button.taro.vue.d.ts} +7 -1
  132. package/dist/types/__VUE/button/{index.d.ts → index.taro.d.ts} +2 -2
  133. package/dist/types/__VUE/calendar/{index.vue.d.ts → index.taro.vue.d.ts} +59 -94
  134. package/dist/types/__VUE/calendarcard/{index.d.ts → index.taro.d.ts} +2 -2
  135. package/dist/types/__VUE/calendaritem/{index.vue.d.ts → index.taro.vue.d.ts} +22 -4
  136. package/dist/types/__VUE/card/{index.vue.d.ts → index.taro.vue.d.ts} +13 -13
  137. package/dist/types/__VUE/cascader/{cascader-item.vue.d.ts → cascader-item.taro.vue.d.ts} +47 -229
  138. package/dist/types/__VUE/cascader/{index.vue.d.ts → index.taro.vue.d.ts} +50 -287
  139. package/dist/types/__VUE/category/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
  140. package/dist/types/__VUE/cell/{cell.vue.d.ts → cell.taro.vue.d.ts} +0 -15
  141. package/dist/types/__VUE/cell/{index.d.ts → index.taro.d.ts} +2 -2
  142. package/dist/types/__VUE/cellgroup/{index.d.ts → index.taro.d.ts} +2 -2
  143. package/dist/types/__VUE/circleprogress/{circle-progress.vue.d.ts → circle-progress.taro.vue.d.ts} +0 -4
  144. package/dist/types/__VUE/circleprogress/{index.d.ts → index.taro.d.ts} +2 -2
  145. package/dist/types/__VUE/col/{index.d.ts → index.taro.d.ts} +2 -2
  146. package/dist/types/__VUE/collapse/{index.d.ts → index.taro.d.ts} +2 -2
  147. package/dist/types/__VUE/collapseitem/collapse-item.taro.vue.d.ts +94 -0
  148. package/dist/types/__VUE/collapseitem/{index.d.ts → index.taro.d.ts} +2 -2
  149. package/dist/types/__VUE/comment/components/CmtBottom.taro.vue.d.ts +47 -0
  150. package/dist/types/__VUE/comment/components/CmtHeader.taro.vue.d.ts +122 -0
  151. package/dist/types/__VUE/comment/components/{CmtImages.vue.d.ts → CmtImages.taro.vue.d.ts} +2 -55
  152. package/dist/types/__VUE/comment/index.taro.vue.d.ts +333 -0
  153. package/dist/types/__VUE/countdown/{index.d.ts → index.taro.d.ts} +2 -2
  154. package/dist/types/__VUE/countup/{index.vue.d.ts → index.taro.vue.d.ts} +5 -7
  155. package/dist/types/__VUE/datepicker/{index.vue.d.ts → index.taro.vue.d.ts} +31 -2
  156. package/dist/types/__VUE/dialog/{index.vue.d.ts → index.taro.vue.d.ts} +52 -85
  157. package/dist/types/__VUE/divider/{index.d.ts → index.taro.d.ts} +2 -2
  158. package/dist/types/__VUE/drag/{index.vue.d.ts → index.taro.vue.d.ts} +2 -0
  159. package/dist/types/__VUE/elevator/{index.vue.d.ts → index.taro.vue.d.ts} +40 -5
  160. package/dist/types/__VUE/ellipsis/{index.vue.d.ts → index.taro.vue.d.ts} +11 -6
  161. package/dist/types/__VUE/empty/{index.d.ts → index.taro.d.ts} +2 -2
  162. package/dist/types/__VUE/fixednav/{index.vue.d.ts → index.taro.vue.d.ts} +2 -55
  163. package/dist/types/__VUE/form/{index.d.ts → index.taro.d.ts} +2 -2
  164. package/dist/types/__VUE/formitem/{index.d.ts → index.taro.d.ts} +2 -2
  165. package/dist/types/__VUE/grid/{index.d.ts → index.taro.d.ts} +2 -2
  166. package/dist/types/__VUE/griditem/{grid-item.vue.d.ts → grid-item.taro.vue.d.ts} +3 -21
  167. package/dist/types/__VUE/griditem/{index.d.ts → index.taro.d.ts} +2 -2
  168. package/dist/types/__VUE/imagepreview/index.taro.vue.d.ts +732 -0
  169. package/dist/types/__VUE/indicator/{index.d.ts → index.taro.d.ts} +2 -2
  170. package/dist/types/__VUE/input/{index.d.ts → index.taro.d.ts} +2 -2
  171. package/dist/types/__VUE/input/{input.vue.d.ts → input.taro.vue.d.ts} +14 -6
  172. package/dist/types/__VUE/inputnumber/{index.d.ts → index.taro.d.ts} +2 -2
  173. package/dist/types/__VUE/invoice/{index.d.ts → index.taro.d.ts} +2 -2
  174. package/dist/types/__VUE/layout/{index.d.ts → index.taro.d.ts} +1 -1
  175. package/dist/types/__VUE/list/{index.vue.d.ts → index.taro.vue.d.ts} +32 -4
  176. package/dist/types/__VUE/menu/index.taro.vue.d.ts +104 -0
  177. package/dist/types/__VUE/menuitem/{index.vue.d.ts → index.taro.vue.d.ts} +22 -114
  178. package/dist/types/__VUE/navbar/{index.d.ts → index.taro.d.ts} +2 -2
  179. package/dist/types/__VUE/noticebar/{index.vue.d.ts → index.taro.vue.d.ts} +9 -116
  180. package/dist/types/__VUE/notify/{index.vue.d.ts → index.taro.vue.d.ts} +2 -66
  181. package/dist/types/__VUE/numberkeyboard/{index.vue.d.ts → index.taro.vue.d.ts} +14 -60
  182. package/dist/types/__VUE/overlay/{index.d.ts → index.taro.d.ts} +2 -2
  183. package/dist/types/__VUE/picker/{index.vue.d.ts → index.taro.vue.d.ts} +31 -2
  184. package/dist/types/__VUE/popover/{index.vue.d.ts → index.taro.vue.d.ts} +4 -56
  185. package/dist/types/__VUE/popup/{index.vue.d.ts → index.taro.vue.d.ts} +3 -56
  186. package/dist/types/__VUE/price/{index.d.ts → index.taro.d.ts} +2 -2
  187. package/dist/types/__VUE/progress/{index.d.ts → index.taro.d.ts} +2 -2
  188. package/dist/types/__VUE/radio/{index.d.ts → index.taro.d.ts} +2 -2
  189. package/dist/types/__VUE/radiogroup/{index.d.ts → index.taro.d.ts} +2 -2
  190. package/dist/types/__VUE/range/{index.vue.d.ts → index.taro.vue.d.ts} +3 -2
  191. package/dist/types/__VUE/rate/{index.d.ts → index.taro.d.ts} +2 -2
  192. package/dist/types/__VUE/rate/rate.taro.vue.d.ts +95 -0
  193. package/dist/types/__VUE/row/{index.d.ts → index.taro.d.ts} +2 -2
  194. package/dist/types/__VUE/scroll-view/index.taro.vue.d.ts +9 -0
  195. package/dist/types/__VUE/searchbar/{index.vue.d.ts → index.taro.vue.d.ts} +23 -121
  196. package/dist/types/__VUE/shortpassword/{index.vue.d.ts → index.taro.vue.d.ts} +5 -112
  197. package/dist/types/__VUE/sidenavbar/{index.vue.d.ts → index.taro.vue.d.ts} +0 -9
  198. package/dist/types/__VUE/signature/{index.vue.d.ts → index.taro.vue.d.ts} +53 -31
  199. package/dist/types/__VUE/skeleton/{index.d.ts → index.taro.d.ts} +2 -2
  200. package/dist/types/__VUE/sku/components/{SkuHeader.vue.d.ts → SkuHeader.taro.vue.d.ts} +6 -6
  201. package/dist/types/__VUE/sku/{index.vue.d.ts → index.taro.vue.d.ts} +25 -62
  202. package/dist/types/__VUE/step/{index.d.ts → index.taro.d.ts} +2 -2
  203. package/dist/types/__VUE/steps/{index.d.ts → index.taro.d.ts} +2 -2
  204. package/dist/types/__VUE/sticky/{index.vue.d.ts → index.taro.vue.d.ts} +7 -26
  205. package/dist/types/__VUE/subsidenavbar/index.taro.vue.d.ts +45 -0
  206. package/dist/types/__VUE/swipe/{index.d.ts → index.taro.d.ts} +2 -2
  207. package/dist/types/__VUE/swipegroup/{index.d.ts → index.taro.d.ts} +2 -2
  208. package/dist/types/__VUE/swiper/{index.vue.d.ts → index.taro.vue.d.ts} +6 -5
  209. package/dist/types/__VUE/switch/{index.d.ts → index.taro.d.ts} +2 -2
  210. package/dist/types/__VUE/tabbar/{index.d.ts → index.taro.d.ts} +2 -2
  211. package/dist/types/__VUE/tabbaritem/{index.d.ts → index.taro.d.ts} +2 -2
  212. package/dist/types/__VUE/table/{index.vue.d.ts → index.taro.vue.d.ts} +2 -55
  213. package/dist/types/__VUE/tabs/{index.vue.d.ts → index.taro.vue.d.ts} +27 -118
  214. package/dist/types/__VUE/tag/{index.d.ts → index.taro.d.ts} +2 -2
  215. package/dist/types/__VUE/textarea/{index.d.ts → index.taro.d.ts} +2 -2
  216. package/dist/types/__VUE/textarea/{textarea.vue.d.ts → textarea.taro.vue.d.ts} +1 -1
  217. package/dist/types/__VUE/timeselect/{index.vue.d.ts → index.taro.vue.d.ts} +3 -66
  218. package/dist/types/__VUE/toast/{index.vue.d.ts → index.taro.vue.d.ts} +16 -12
  219. package/dist/types/__VUE/tour/{index.vue.d.ts → index.taro.vue.d.ts} +13 -121
  220. package/dist/types/__VUE/trendarrow/{index.d.ts → index.taro.d.ts} +2 -2
  221. package/dist/types/__VUE/uploader/{index.vue.d.ts → index.taro.vue.d.ts} +268 -286
  222. package/dist/types/__VUE/watermark/{index.d.ts → index.taro.d.ts} +2 -2
  223. package/dist/types/index.d.ts +145 -155
  224. package/package.json +1 -1
  225. package/dist/nutui.js +0 -15854
  226. package/dist/packages/audio/Audio.js +0 -271
  227. package/dist/packages/audio/index.mjs +0 -2
  228. package/dist/packages/audiooperate/AudioOperate.js +0 -125
  229. package/dist/packages/audiooperate/index.mjs +0 -2
  230. package/dist/packages/image/Image.js +0 -167
  231. package/dist/packages/image/index.mjs +0 -2
  232. package/dist/packages/index-B1qsj2XR.js +0 -33
  233. package/dist/packages/index-BvmDLUYP.js +0 -31
  234. package/dist/packages/index-aiGQ-EiA.js +0 -8
  235. package/dist/packages/infiniteloading/InfiniteLoading.js +0 -184
  236. package/dist/packages/infiniteloading/index.mjs +0 -2
  237. package/dist/packages/mountComponent-CLi4Nz91.js +0 -39
  238. package/dist/packages/pullrefresh/PullRefresh.js +0 -240
  239. package/dist/packages/pullrefresh/index.mjs +0 -2
  240. package/dist/packages/types-BMA1Y94E.js +0 -4
  241. package/dist/packages/video/Video.js +0 -449
  242. package/dist/packages/video/index.mjs +0 -2
  243. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +0 -134
  244. package/dist/types/__VUE/audio/index.vue.d.ts +0 -323
  245. package/dist/types/__VUE/audio/types.d.ts +0 -3
  246. package/dist/types/__VUE/audiooperate/index.vue.d.ts +0 -229
  247. package/dist/types/__VUE/collapseitem/collapse-item.vue.d.ts +0 -201
  248. package/dist/types/__VUE/comment/components/CmtBottom.vue.d.ts +0 -208
  249. package/dist/types/__VUE/comment/components/CmtHeader.vue.d.ts +0 -248
  250. package/dist/types/__VUE/comment/index.vue.d.ts +0 -728
  251. package/dist/types/__VUE/dialog/index.d.ts +0 -44
  252. package/dist/types/__VUE/image/image.vue.d.ts +0 -111
  253. package/dist/types/__VUE/image/index.d.ts +0 -6
  254. package/dist/types/__VUE/image/types.d.ts +0 -2
  255. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +0 -267
  256. package/dist/types/__VUE/imagepreview/index.d.ts +0 -36
  257. package/dist/types/__VUE/imagepreview/index.vue.d.ts +0 -1088
  258. package/dist/types/__VUE/infiniteloading/index.vue.d.ts +0 -140
  259. package/dist/types/__VUE/menu/index.vue.d.ts +0 -210
  260. package/dist/types/__VUE/notify/index.d.ts +0 -22
  261. package/dist/types/__VUE/pullrefresh/index.vue.d.ts +0 -200
  262. package/dist/types/__VUE/rate/rate.vue.d.ts +0 -208
  263. package/dist/types/__VUE/subsidenavbar/index.vue.d.ts +0 -152
  264. package/dist/types/__VUE/toast/index.d.ts +0 -12
  265. package/dist/types/__VUE/video/index.vue.d.ts +0 -149
  266. package/dist/packages/{index-Do4_KY74.js → index.taro-Do4_KY74.js} +0 -0
  267. package/dist/types/__VUE/animate/{animate.vue.d.ts → animate.taro.vue.d.ts} +0 -0
  268. package/dist/types/__VUE/avatar/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  269. package/dist/types/__VUE/avatargroup/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  270. package/dist/types/__VUE/badge/{badge.vue.d.ts → badge.taro.vue.d.ts} +0 -0
  271. package/dist/types/__VUE/calendarcard/{calendar-card.vue.d.ts → calendar-card.taro.vue.d.ts} +0 -0
  272. package/dist/types/__VUE/calendarcard/{icon.d.ts → icon.taro.d.ts} +0 -0
  273. package/dist/types/__VUE/categorypane/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  274. package/dist/types/__VUE/cellgroup/{cell-group.vue.d.ts → cell-group.taro.vue.d.ts} +0 -0
  275. package/dist/types/__VUE/checkbox/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  276. package/dist/types/__VUE/checkboxgroup/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  277. package/dist/types/__VUE/col/{col.vue.d.ts → col.taro.vue.d.ts} +0 -0
  278. package/dist/types/__VUE/collapse/{collapse.vue.d.ts → collapse.taro.vue.d.ts} +0 -0
  279. package/dist/types/__VUE/configprovider/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  280. package/dist/types/__VUE/countdown/{countdown.vue.d.ts → countdown.taro.vue.d.ts} +0 -0
  281. package/dist/types/__VUE/divider/{divider.vue.d.ts → divider.taro.vue.d.ts} +0 -0
  282. package/dist/types/__VUE/ecard/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  283. package/dist/types/__VUE/empty/{empty.vue.d.ts → empty.taro.vue.d.ts} +0 -0
  284. package/dist/types/__VUE/form/{form.vue.d.ts → form.taro.vue.d.ts} +0 -0
  285. package/dist/types/__VUE/formitem/{form-item.vue.d.ts → form-item.taro.vue.d.ts} +0 -0
  286. package/dist/types/__VUE/grid/{grid.vue.d.ts → grid.taro.vue.d.ts} +0 -0
  287. package/dist/types/__VUE/indicator/{indicator.vue.d.ts → indicator.taro.vue.d.ts} +0 -0
  288. package/dist/types/__VUE/inputnumber/{input-number.vue.d.ts → input-number.taro.vue.d.ts} +0 -0
  289. package/dist/types/__VUE/invoice/{invoice.vue.d.ts → invoice.taro.vue.d.ts} +0 -0
  290. package/dist/types/__VUE/layout/{layout.vue.d.ts → layout.taro.vue.d.ts} +0 -0
  291. package/dist/types/__VUE/navbar/{navbar.vue.d.ts → navbar.taro.vue.d.ts} +0 -0
  292. package/dist/types/__VUE/overlay/{overlay.vue.d.ts → overlay.taro.vue.d.ts} +0 -0
  293. package/dist/types/__VUE/pagination/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  294. package/dist/types/__VUE/price/{price.vue.d.ts → price.taro.vue.d.ts} +0 -0
  295. package/dist/types/__VUE/progress/{progress.vue.d.ts → progress.taro.vue.d.ts} +0 -0
  296. package/dist/types/__VUE/radio/{radio.vue.d.ts → radio.taro.vue.d.ts} +0 -0
  297. package/dist/types/__VUE/radiogroup/{radio-group.vue.d.ts → radio-group.taro.vue.d.ts} +0 -0
  298. package/dist/types/__VUE/row/{row.vue.d.ts → row.taro.vue.d.ts} +0 -0
  299. package/dist/types/__VUE/sidenavbaritem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  300. package/dist/types/__VUE/skeleton/{skeleton.vue.d.ts → skeleton.taro.vue.d.ts} +2 -2
  301. package/dist/types/__VUE/sku/components/{SkuStepper.vue.d.ts → SkuStepper.taro.vue.d.ts} +0 -0
  302. package/dist/types/__VUE/space/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  303. package/dist/types/__VUE/step/{step.vue.d.ts → step.taro.vue.d.ts} +0 -0
  304. package/dist/types/__VUE/steps/{steps.vue.d.ts → steps.taro.vue.d.ts} +0 -0
  305. package/dist/types/__VUE/swipe/{swipe.vue.d.ts → swipe.taro.vue.d.ts} +0 -0
  306. package/dist/types/__VUE/swipegroup/{swipe-group.vue.d.ts → swipe-group.taro.vue.d.ts} +0 -0
  307. package/dist/types/__VUE/swiperitem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  308. package/dist/types/__VUE/switch/{switch.vue.d.ts → switch.taro.vue.d.ts} +0 -0
  309. package/dist/types/__VUE/tabbar/{tabbar.vue.d.ts → tabbar.taro.vue.d.ts} +0 -0
  310. package/dist/types/__VUE/tabbaritem/{tabbar-item.vue.d.ts → tabbar-item.taro.vue.d.ts} +0 -0
  311. package/dist/types/__VUE/tabpane/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  312. package/dist/types/__VUE/tag/{tag.vue.d.ts → tag.taro.vue.d.ts} +0 -0
  313. package/dist/types/__VUE/timedetail/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  314. package/dist/types/__VUE/timepannel/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  315. package/dist/types/__VUE/trendarrow/{trend-arrow.vue.d.ts → trend-arrow.taro.vue.d.ts} +1 -1
  316. package/dist/types/__VUE/watermark/{watermark.vue.d.ts → watermark.taro.vue.d.ts} +2 -2
@@ -17,20 +17,22 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, toRef, ref, computed, onMounted, nextTick, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, unref, toDisplayString, createCommentVNode } from "vue";
21
- import { u as useLocale } from "../index-BOB4ytqZ.js";
20
+ import { defineComponent, toRef, ref, computed, watch, nextTick, onMounted, openBlock, createElementBlock, normalizeClass, createElementVNode, mergeProps, unref, createTextVNode, toDisplayString, createCommentVNode, normalizeStyle } from "vue";
21
+ import Taro from "@tarojs/taro";
22
+ import { u as useLocale } from "../index-IxPZmHlb.js";
22
23
  import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
23
24
  import { w as withInstall } from "../with-install-Ch3FF0uS.js";
24
- const _hoisted_1 = ["rows", "disabled", "readonly", "value", "maxlength", "placeholder", "autofocus"];
25
+ const _hoisted_1 = ["rows", "disabled", "value", "maxlength", "placeholder", "auto-focus"];
25
26
  const _hoisted_2 = {
26
27
  key: 0,
27
28
  class: "nut-textarea__limit"
28
29
  };
29
30
  const cN = "NutTextarea";
30
31
  const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
31
- name: cN
32
+ name: cN,
33
+ inheritAttrs: false
32
34
  }), {
33
- __name: "textarea",
35
+ __name: "textarea.taro",
34
36
  props: {
35
37
  modelValue: { default: "" },
36
38
  textAlign: {},
@@ -50,6 +52,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
50
52
  const disabled = useFormDisabled(toRef(props, "disabled"));
51
53
  const translate = useLocale(cN);
52
54
  const textareaRef = ref(null);
55
+ const textareaHeight = ref(20);
56
+ const heightSet = ref("auto");
57
+ const composing = ref(false);
58
+ const env = Taro.getEnv();
53
59
  const classes = computed(() => {
54
60
  const prefixCls = "nut-textarea";
55
61
  return {
@@ -58,50 +64,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
58
64
  };
59
65
  });
60
66
  const styles = computed(() => {
61
- return {
62
- textAlign: props.textAlign
63
- };
64
- });
65
- const setHeight = (height) => {
66
- const textarea = textareaRef.value;
67
- if (textarea && textarea.style) {
68
- textarea.style.height = typeof height === "number" ? `${height}px` : height;
69
- }
70
- };
71
- const getContentHeight = () => {
72
- setHeight("auto");
73
- if (textareaRef.value) {
74
- let height = textareaRef.value.scrollHeight;
75
- if (typeof props.autosize === "object") {
76
- const { maxHeight, minHeight } = props.autosize;
77
- if (maxHeight !== void 0) {
78
- height = Math.min(height, maxHeight);
79
- }
80
- if (minHeight !== void 0) {
81
- height = Math.max(height, minHeight);
82
- }
83
- }
84
- if (height) {
85
- setHeight(height);
86
- }
87
- }
88
- };
89
- onMounted(() => {
90
- if (props.modelValue) {
91
- emitChange(String(props.modelValue));
67
+ const styleObj = {};
68
+ if (props.textAlign) {
69
+ styleObj["textAlign"] = props.textAlign;
92
70
  }
93
71
  if (props.autosize) {
94
- nextTick(getContentHeight);
72
+ styleObj["height"] = heightSet.value;
95
73
  }
74
+ return styleObj;
75
+ });
76
+ const copyTextStyle = ref({
77
+ wordBreak: "break-all",
78
+ width: "0"
96
79
  });
97
- watch(
98
- () => props.modelValue,
99
- () => {
100
- if (props.autosize) {
101
- nextTick(getContentHeight);
102
- }
103
- }
104
- );
105
80
  const emitChange = (value, event) => {
106
81
  if (props.maxLength && value.length > Number(props.maxLength)) {
107
82
  value = value.substring(0, Number(props.maxLength));
@@ -110,15 +85,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
110
85
  emit("change", value, event);
111
86
  };
112
87
  const change = (event) => {
113
- const input = event.target;
114
- if (!input.composing) {
115
- let value = input.value;
116
- if (props.maxLength && value.length > Number(props.maxLength)) {
117
- value = value.slice(0, Number(props.maxLength));
88
+ if (env === Taro.ENV_TYPE.WEB) {
89
+ if (!composing.value) {
90
+ _onInput(event);
118
91
  }
119
- emitChange(input.value, event);
92
+ } else {
93
+ _onInput(event);
120
94
  }
121
95
  };
96
+ const _onInput = (event) => {
97
+ const input = event.target;
98
+ let value = input.value;
99
+ if (props.maxLength && value.length > Number(props.maxLength)) {
100
+ value = value.slice(0, Number(props.maxLength));
101
+ }
102
+ emitChange(value, event);
103
+ };
122
104
  const focus = (event) => {
123
105
  if (disabled.value || props.readonly) return;
124
106
  emit("focus", event);
@@ -128,43 +110,136 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
128
110
  const input = event.target;
129
111
  const value = input.value;
130
112
  emitChange(value, event);
131
- emit("blur", { value, event });
113
+ emit("blur", event);
114
+ };
115
+ const getContentHeight = () => {
116
+ heightSet.value = "auto";
117
+ let height = textareaHeight.value;
118
+ if (typeof props.autosize === "object") {
119
+ const { maxHeight, minHeight } = props.autosize;
120
+ if (maxHeight !== void 0) {
121
+ height = Math.min(height, maxHeight);
122
+ }
123
+ if (minHeight !== void 0) {
124
+ height = Math.max(height, minHeight);
125
+ }
126
+ }
127
+ if (height) {
128
+ heightSet.value = height + "px";
129
+ }
132
130
  };
133
- const startComposing = ({ target }) => {
134
- const input = target;
135
- input.composing = true;
131
+ watch(
132
+ () => props.modelValue,
133
+ () => {
134
+ if (props.autosize) {
135
+ setTimeout(() => {
136
+ copyHeight();
137
+ }, 100);
138
+ }
139
+ }
140
+ );
141
+ const copyHeight = () => {
142
+ const query = Taro.createSelectorQuery();
143
+ query.select(".nut-textarea__cpoyText").boundingClientRect();
144
+ query.exec((res) => {
145
+ if (res[0]) {
146
+ if (props.modelValue == "") {
147
+ textareaHeight.value = 20;
148
+ } else {
149
+ textareaHeight.value = res[0]["height"] || 20;
150
+ }
151
+ nextTick(getContentHeight);
152
+ }
153
+ });
154
+ };
155
+ const getRefHeight = () => {
156
+ const query = Taro.createSelectorQuery();
157
+ query.selectAll(".nut-textarea__textarea").boundingClientRect();
158
+ let uid = textareaRef.value ? textareaRef.value.uid : "0";
159
+ query.exec((res) => {
160
+ if (res[0] && textareaRef.value) {
161
+ let _item = Array.from(res[0]).filter((item) => item.id == uid);
162
+ if (_item[0]) {
163
+ if (env !== Taro.ENV_TYPE.WEAPP) {
164
+ textareaHeight.value = _item[0]["height"] || 20;
165
+ }
166
+ copyTextStyle.value.width = _item[0]["width"] + "px";
167
+ }
168
+ nextTick(getContentHeight);
169
+ }
170
+ });
171
+ };
172
+ const getRefWidth = () => {
173
+ const query = Taro.createSelectorQuery();
174
+ query.select(".nut-textarea__textarea").boundingClientRect();
175
+ query.exec((res) => {
176
+ if (res[0] && textareaRef.value) {
177
+ copyTextStyle.value.width = res[0]["width"] + "px";
178
+ }
179
+ });
180
+ };
181
+ onMounted(() => {
182
+ if (props.autosize) {
183
+ Taro.nextTick(() => {
184
+ setTimeout(() => {
185
+ if (env === "ALIPAY" || env === "WEB") {
186
+ getRefWidth();
187
+ copyHeight();
188
+ } else {
189
+ getRefHeight();
190
+ }
191
+ }, 300);
192
+ });
193
+ }
194
+ });
195
+ const startComposing = () => {
196
+ if (env === Taro.ENV_TYPE.WEB) {
197
+ composing.value = true;
198
+ }
136
199
  };
137
200
  const endComposing = ({ target }) => {
138
- const input = target;
139
- if (input.composing) {
140
- input.composing = false;
141
- input.dispatchEvent(new Event("input"));
201
+ var _a;
202
+ if (env === Taro.ENV_TYPE.WEB) {
203
+ if (composing.value) {
204
+ composing.value = false;
205
+ if (target) {
206
+ (_a = target.dispatchEvent) == null ? void 0 : _a.call(target, new Event("input"));
207
+ }
208
+ }
142
209
  }
143
210
  };
144
211
  return (_ctx, _cache) => {
145
212
  return openBlock(), createElementBlock("view", {
146
213
  class: normalizeClass(classes.value)
147
214
  }, [
148
- createElementVNode("textarea", {
215
+ createElementVNode("textarea", mergeProps({
149
216
  ref_key: "textareaRef",
150
- ref: textareaRef,
151
- class: "nut-textarea__textarea",
152
- style: normalizeStyle(styles.value),
217
+ ref: textareaRef
218
+ }, _ctx.$attrs, {
219
+ class: ["nut-textarea__textarea", unref(env) == "ALIPAY" && "nut-textarea__ali"],
220
+ style: styles.value,
153
221
  rows: _ctx.rows,
154
- disabled: unref(disabled),
155
- readonly: _ctx.readonly,
222
+ disabled: unref(disabled) || _ctx.readonly ? unref(disabled) || _ctx.readonly : void 0,
156
223
  value: _ctx.modelValue,
157
- maxlength: _ctx.maxLength,
224
+ "show-count": false,
225
+ maxlength: _ctx.maxLength ? _ctx.maxLength : -1,
158
226
  placeholder: _ctx.placeholder || unref(translate)("placeholder"),
159
- autofocus: _ctx.autofocus,
227
+ "auto-focus": _ctx.autofocus ? true : void 0,
160
228
  onInput: change,
161
229
  onBlur: blur,
162
230
  onFocus: focus,
163
231
  onChange: endComposing,
164
232
  onCompositionend: endComposing,
165
233
  onCompositionstart: startComposing
166
- }, null, 44, _hoisted_1),
167
- _ctx.limitShow ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0) + "/" + toDisplayString(_ctx.maxLength), 1)) : createCommentVNode("", true)
234
+ }), null, 16, _hoisted_1),
235
+ _cache[0] || (_cache[0] = createTextVNode()),
236
+ _ctx.limitShow ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0) + "/" + toDisplayString(_ctx.maxLength), 1)) : createCommentVNode("", true),
237
+ _cache[1] || (_cache[1] = createTextVNode()),
238
+ _ctx.autosize ? (openBlock(), createElementBlock("view", {
239
+ key: 1,
240
+ class: "nut-textarea__cpoyText",
241
+ style: normalizeStyle(copyTextStyle.value)
242
+ }, toDisplayString(_ctx.modelValue), 5)) : createCommentVNode("", true)
168
243
  ], 2);
169
244
  };
170
245
  }
@@ -78,7 +78,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
78
78
  ])
79
79
  ]);
80
80
  }
81
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
81
+ const index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
82
82
  export {
83
- index as default
83
+ index_taro as default
84
84
  };
@@ -61,7 +61,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
61
61
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handlePannel(_ctx.pannelKey))
62
62
  }, toDisplayString(_ctx.name), 3);
63
63
  }
64
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
64
+ const index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
65
65
  export {
66
- index as default
66
+ index_taro as default
67
67
  };
@@ -1,7 +1,7 @@
1
- import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, createElementBlock, toDisplayString, renderSlot } from "vue";
1
+ import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, createElementBlock, toDisplayString, renderSlot, createTextVNode } from "vue";
2
2
  import { c as createComponent } from "../component-DQf3CENX.js";
3
- import { N as NutPopup } from "../index-wLaOjIn1.js";
4
- import { u as useLocale } from "../index-BOB4ytqZ.js";
3
+ import { N as NutPopup } from "../index.taro-CNxLoYer.js";
4
+ import { u as useLocale } from "../index-IxPZmHlb.js";
5
5
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
6
6
  const { create } = createComponent("time-select");
7
7
  const cN = "NutTimeSelect";
@@ -35,10 +35,6 @@ const _sfc_main = create({
35
35
  lockScroll: {
36
36
  type: [Boolean],
37
37
  default: true
38
- },
39
- teleportDisable: {
40
- type: Boolean,
41
- default: false
42
38
  }
43
39
  },
44
40
  emits: ["update:visible", "select"],
@@ -78,10 +74,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
78
74
  position: "bottom",
79
75
  closeable: "",
80
76
  round: "",
81
- "teleport-disable": _ctx.teleportDisable,
82
77
  visible: _ctx.visible,
83
78
  style: normalizeStyle(_ctx.popStyle),
84
79
  "lock-scroll": _ctx.lockScroll,
80
+ "catch-move": _ctx.lockScroll,
85
81
  onClickOverlay: _ctx.close,
86
82
  onClickCloseIcon: _ctx.close
87
83
  }, {
@@ -92,10 +88,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
92
88
  !_ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(_ctx.title || _ctx.translate("pickupTime")), 1)) : renderSlot(_ctx.$slots, "title", { key: 1 })
93
89
  ])
94
90
  ]),
91
+ _cache[1] || (_cache[1] = createTextVNode()),
95
92
  createElementVNode("view", _hoisted_5, [
96
93
  createElementVNode("view", _hoisted_6, [
97
94
  renderSlot(_ctx.$slots, "pannel")
98
95
  ]),
96
+ _cache[0] || (_cache[0] = createTextVNode()),
99
97
  createElementVNode("view", _hoisted_7, [
100
98
  renderSlot(_ctx.$slots, "detail")
101
99
  ])
@@ -103,9 +101,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
103
101
  ])
104
102
  ]),
105
103
  _: 3
106
- }, 8, ["teleport-disable", "visible", "style", "lock-scroll", "onClickOverlay", "onClickCloseIcon"]);
104
+ }, 8, ["visible", "style", "lock-scroll", "catch-move", "onClickOverlay", "onClickCloseIcon"]);
107
105
  }
108
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
106
+ const index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
109
107
  export {
110
- index as default
108
+ index_taro as default
111
109
  };
@@ -1,28 +1,8 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { reactive, onMounted, watch, computed, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, createElementBlock, resolveDynamicComponent, createCommentVNode, toDisplayString, vShow, createVNode, render } from "vue";
1
+ import { watch, computed, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, resolveDynamicComponent, createCommentVNode, createTextVNode, toDisplayString, vShow } from "vue";
21
2
  import { c as createComponent } from "../component-DQf3CENX.js";
22
3
  import { r as renderIcon } from "../renderIcon-CfE94nuJ.js";
4
+ import { Success, Failure, Tips, Loading } from "@nutui/icons-vue-taro";
23
5
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
24
- import { C as CreateComponent } from "../mountComponent-CLi4Nz91.js";
25
- import { Success, Failure, Tips, Loading } from "@nutui/icons-vue";
26
6
  const { create } = createComponent("toast");
27
7
  const _sfc_main = create({
28
8
  components: {},
@@ -52,7 +32,8 @@ const _sfc_main = create({
52
32
  },
53
33
  icon: {
54
34
  type: Object,
55
- default: null
35
+ default: () => {
36
+ }
56
37
  },
57
38
  textAlignCenter: {
58
39
  type: Boolean,
@@ -83,17 +64,15 @@ const _sfc_main = create({
83
64
  closeOnClickOverlay: {
84
65
  type: Boolean,
85
66
  default: false
67
+ },
68
+ visible: {
69
+ type: Boolean,
70
+ default: false
86
71
  }
87
72
  },
88
- emits: ["close"],
73
+ emits: ["update:visible", "closed"],
89
74
  setup(props, { emit }) {
90
75
  let timer;
91
- const state = reactive({
92
- mounted: false
93
- });
94
- onMounted(() => {
95
- state.mounted = true;
96
- });
97
76
  const clearTimer = () => {
98
77
  if (timer) {
99
78
  clearTimeout(timer);
@@ -101,12 +80,13 @@ const _sfc_main = create({
101
80
  }
102
81
  };
103
82
  const hide = () => {
104
- state.mounted = false;
83
+ emit("update:visible", false);
84
+ emit("closed");
105
85
  };
106
86
  const show = () => {
107
87
  clearTimer();
108
88
  if (props.duration) {
109
- timer = window.setTimeout(() => {
89
+ timer = setTimeout(() => {
110
90
  hide();
111
91
  }, props.duration);
112
92
  }
@@ -114,14 +94,10 @@ const _sfc_main = create({
114
94
  const clickCover = () => {
115
95
  if (props.closeOnClickOverlay) {
116
96
  hide();
117
- emit("close");
118
97
  }
119
98
  };
120
- if (props.duration) {
121
- show();
122
- }
123
99
  watch(
124
- () => props.duration,
100
+ () => props.visible,
125
101
  (val) => {
126
102
  if (val) {
127
103
  show();
@@ -132,7 +108,19 @@ const _sfc_main = create({
132
108
  if (props.type !== "text") {
133
109
  return true;
134
110
  } else {
135
- return props.icon !== null;
111
+ return !!props.icon;
112
+ }
113
+ });
114
+ const iconName = computed(() => {
115
+ if (props.icon) {
116
+ return props.icon;
117
+ } else {
118
+ return {
119
+ success: Success,
120
+ fail: Failure,
121
+ warn: Tips,
122
+ loading: Loading
123
+ }[props.type];
136
124
  }
137
125
  });
138
126
  const toastBodyClass = computed(() => {
@@ -146,32 +134,31 @@ const _sfc_main = create({
146
134
  "nut-toast-" + props.size
147
135
  ];
148
136
  });
149
- const toastIconWrapperClass = computed(() => {
150
- return ["nut-toast-icon-wrapper", { "nut-toast-icon-no-animation": !props.loadingRotate }];
151
- });
152
137
  const onAfterLeave = () => {
153
- var _a;
154
- clearTimer();
155
- (_a = props.unmount) == null ? void 0 : _a.call(props, props.id);
156
- props.onClose && props.onClose();
138
+ if (props.visible) {
139
+ clearTimer();
140
+ hide();
141
+ }
157
142
  };
158
143
  return {
159
- state,
160
- hide,
161
144
  clickCover,
162
145
  hasIcon,
146
+ iconName,
163
147
  toastBodyClass,
164
- toastIconWrapperClass,
165
148
  onAfterLeave,
166
149
  renderIcon
167
150
  };
168
151
  }
169
152
  });
170
153
  const _hoisted_1 = {
154
+ key: 0,
155
+ class: "nut-toast-icon-wrapper"
156
+ };
157
+ const _hoisted_2 = {
171
158
  key: 1,
172
159
  class: "nut-toast-title"
173
160
  };
174
- const _hoisted_2 = ["innerHTML"];
161
+ const _hoisted_3 = ["innerHTML"];
175
162
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
176
163
  return openBlock(), createBlock(Transition, {
177
164
  name: "toast-fade",
@@ -186,156 +173,33 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
186
173
  }),
187
174
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clickCover && _ctx.clickCover(...args))
188
175
  }, [
189
- createElementVNode("view", {
176
+ _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock("view", {
177
+ key: 1,
190
178
  class: "nut-toast-inner",
191
179
  style: normalizeStyle({
192
180
  "text-align": _ctx.textAlignCenter ? "center" : "left",
193
181
  "background-color": _ctx.bgColor
194
182
  })
195
183
  }, [
196
- _ctx.hasIcon ? (openBlock(), createElementBlock("view", {
197
- key: 0,
198
- class: normalizeClass(_ctx.toastIconWrapperClass)
199
- }, [
200
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderIcon(_ctx.icon)), { color: "#ffffff" }))
201
- ], 2)) : createCommentVNode("", true),
202
- _ctx.title ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
184
+ _ctx.hasIcon ? (openBlock(), createElementBlock("view", _hoisted_1, [
185
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderIcon(_ctx.iconName)), { color: "#ffffff" }))
186
+ ])) : createCommentVNode("", true),
187
+ _cache[1] || (_cache[1] = createTextVNode()),
188
+ _ctx.title ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
189
+ _cache[2] || (_cache[2] = createTextVNode()),
203
190
  createElementVNode("view", {
204
191
  class: "nut-toast-text",
205
192
  innerHTML: _ctx.msg
206
- }, null, 8, _hoisted_2)
207
- ], 4)
193
+ }, null, 8, _hoisted_3)
194
+ ], 4))
208
195
  ], 6), [
209
- [vShow, _ctx.state.mounted]
196
+ [vShow, _ctx.visible]
210
197
  ])
211
198
  ]),
212
- _: 1
199
+ _: 3
213
200
  }, 8, ["onAfterLeave"]);
214
201
  }
215
- const Toast = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
216
- const defaultOptions = {
217
- msg: "",
218
- id: "",
219
- duration: 2e3,
220
- // 显示时间(毫秒)
221
- center: true,
222
- // 未实现
223
- type: "text",
224
- title: "",
225
- customClass: "",
226
- bottom: "30px",
227
- size: "base",
228
- iconSize: "20",
229
- icon: null,
230
- textAlignCenter: true,
231
- // 未实现
232
- loadingRotate: true,
233
- // 未实现
234
- bgColor: "",
235
- onClose: null,
236
- // 未实现
237
- unmount: null,
238
- cover: false,
239
- // 透明遮罩层 // 未实现
240
- coverColor: "",
241
- // 未实现
242
- closeOnClickOverlay: false
243
- // 未实现
244
- };
245
- let idsMap = [];
246
- let optsMap = [];
247
- const clearToast = (id) => {
248
- if (id) {
249
- const container = document.getElementById(id);
250
- optsMap = optsMap.filter((item) => item.id !== id);
251
- idsMap = idsMap.filter((item) => item !== id);
252
- if (container) {
253
- document.body.removeChild(container);
254
- }
255
- } else {
256
- idsMap.forEach((item) => {
257
- const container = document.getElementById(item);
258
- if (container) {
259
- document.body.removeChild(container);
260
- }
261
- });
262
- optsMap = [];
263
- idsMap = [];
264
- }
265
- };
266
- const updateToast = (opts) => {
267
- const container = document.getElementById(opts.id);
268
- if (container) {
269
- const currentOpt = optsMap.find((item) => item.id === opts.id);
270
- if (currentOpt) {
271
- opts = __spreadValues(__spreadValues(__spreadValues({}, defaultOptions), currentOpt), opts);
272
- } else {
273
- opts = __spreadValues(__spreadValues({}, defaultOptions), opts);
274
- }
275
- const instance = createVNode(Toast, opts);
276
- render(instance, container);
277
- return showToast;
278
- }
279
- };
280
- const mountToast = (opts) => {
281
- opts.unmount = clearToast;
282
- let _id;
283
- if (opts.id) {
284
- _id = opts.id;
285
- if (idsMap.find((item) => item === opts.id)) {
286
- return updateToast(opts);
287
- }
288
- } else {
289
- _id = (/* @__PURE__ */ new Date()).getTime() + "";
290
- }
291
- opts = __spreadValues(__spreadValues({}, defaultOptions), opts);
292
- opts.id = _id;
293
- idsMap.push(opts.id);
294
- optsMap.push(opts);
295
- CreateComponent(opts, {
296
- wrapper: Toast
297
- });
298
- return showToast;
299
- };
300
- const errorMsg = (msg) => {
301
- if (!msg) {
302
- console.warn("[NutUI Toast]: msg不能为空");
303
- return;
304
- }
305
- };
306
- const showToast = {
307
- text(msg, opts = {}) {
308
- errorMsg(msg);
309
- return mountToast(__spreadProps(__spreadValues({}, opts), { type: "text", msg }));
310
- },
311
- success(msg, opts = {}) {
312
- errorMsg(msg);
313
- return mountToast(__spreadProps(__spreadValues({ icon: Success }, opts), { msg, type: "success" }));
314
- },
315
- fail(msg, opts = {}) {
316
- errorMsg(msg);
317
- return mountToast(__spreadProps(__spreadValues({ icon: Failure }, opts), { msg, type: "fail" }));
318
- },
319
- warn(msg, opts = {}) {
320
- errorMsg(msg);
321
- return mountToast(__spreadProps(__spreadValues({ icon: Tips }, opts), { msg, type: "warn" }));
322
- },
323
- loading(msg, opts = {}) {
324
- return mountToast(__spreadProps(__spreadValues({
325
- icon: Loading
326
- }, opts), {
327
- msg,
328
- type: "loading"
329
- }));
330
- },
331
- hide(id) {
332
- clearToast(id);
333
- },
334
- install(app) {
335
- app.use(Toast);
336
- }
337
- };
202
+ const index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
338
203
  export {
339
- Toast as default,
340
- showToast
204
+ index_taro as default
341
205
  };