@nutui/nutui 3.2.6-beta.1 → 3.2.6-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 (240) hide show
  1. package/README.md +18 -4
  2. package/dist/nutui.es.js +4461 -4135
  3. package/dist/nutui.umd.js +4559 -4133
  4. package/dist/packages/_es/ActionSheet.js +19 -18
  5. package/dist/packages/_es/Address.js +85 -94
  6. package/dist/packages/_es/AddressList.js +12 -25
  7. package/dist/packages/_es/Animate.js +3 -3
  8. package/dist/packages/_es/Audio.js +2 -9
  9. package/dist/packages/_es/AudioOperate.js +1 -5
  10. package/dist/packages/_es/Avatar.js +10 -10
  11. package/dist/packages/_es/AvatarGroup.js +5 -5
  12. package/dist/packages/_es/BackTop.js +108 -55
  13. package/dist/packages/_es/Badge.js +12 -10
  14. package/dist/packages/_es/Barrage.js +103 -79
  15. package/dist/packages/_es/Button.js +3 -5
  16. package/dist/packages/_es/Calendar.js +23 -36
  17. package/dist/packages/_es/CalendarItem.js +3 -4
  18. package/dist/packages/_es/Card.js +5 -15
  19. package/dist/packages/_es/Cascader.js +11 -12
  20. package/dist/packages/_es/Category.js +12 -13
  21. package/dist/packages/_es/CategoryPane.js +13 -17
  22. package/dist/packages/_es/Cell.js +12 -9
  23. package/dist/packages/_es/CellGroup.js +2 -4
  24. package/dist/packages/_es/Checkbox.js +1 -1
  25. package/dist/packages/_es/CheckboxGroup.js +2 -2
  26. package/dist/packages/_es/CircleProgress.js +82 -98
  27. package/dist/packages/_es/Col.js +1 -1
  28. package/dist/packages/_es/Collapse.js +34 -65
  29. package/dist/packages/_es/CollapseItem.js +60 -93
  30. package/dist/packages/_es/Comment.js +19 -43
  31. package/dist/packages/_es/ConfigProvider.js +1 -1
  32. package/dist/packages/_es/CountDown.js +3 -3
  33. package/dist/packages/_es/CountUp.js +52 -47
  34. package/dist/packages/_es/DatePicker.js +54 -37
  35. package/dist/packages/_es/Dialog.js +88 -9
  36. package/dist/packages/_es/Divider.js +3 -3
  37. package/dist/packages/_es/Drag.js +49 -75
  38. package/dist/packages/_es/Ecard.js +18 -20
  39. package/dist/packages/_es/Elevator.js +76 -101
  40. package/dist/packages/_es/Ellipsis.js +100 -140
  41. package/dist/packages/_es/Empty.js +4 -6
  42. package/dist/packages/_es/FixedNav.js +6 -11
  43. package/dist/packages/_es/Form.js +4 -4
  44. package/dist/packages/_es/FormItem.js +1 -3
  45. package/dist/packages/_es/Grid.js +1 -1
  46. package/dist/packages/_es/GridItem.js +27 -10
  47. package/dist/packages/_es/Icon.js +1 -1
  48. package/dist/packages/_es/Image.js +114 -13
  49. package/dist/packages/_es/ImagePreview.js +411 -149
  50. package/dist/packages/_es/Indicator.js +3 -3
  51. package/dist/packages/_es/InfiniteLoading.js +115 -103
  52. package/dist/packages/_es/Input.js +32 -56
  53. package/dist/packages/_es/InputNumber.js +16 -25
  54. package/dist/packages/_es/Invoice.js +5 -6
  55. package/dist/packages/_es/Layout.js +1 -1
  56. package/dist/packages/_es/List.js +34 -47
  57. package/dist/packages/_es/Menu.js +35 -35
  58. package/dist/packages/_es/MenuItem.js +29 -56
  59. package/dist/packages/_es/Navbar.js +39 -49
  60. package/dist/packages/_es/NoticeBar.js +45 -54
  61. package/dist/packages/_es/Notify.js +162 -44
  62. package/dist/packages/_es/NumberKeyboard.js +20 -15
  63. package/dist/packages/_es/OldPicker.js +116 -130
  64. package/dist/packages/_es/OverLay.js +28 -5
  65. package/dist/packages/_es/Pagination.js +5 -8
  66. package/dist/packages/_es/Picker.js +74 -198
  67. package/dist/packages/_es/Popover.js +881 -201
  68. package/dist/packages/_es/Popup.js +84 -28
  69. package/dist/packages/_es/Price.js +6 -22
  70. package/dist/packages/_es/Progress.js +11 -18
  71. package/dist/packages/_es/PullRefresh.js +2 -4
  72. package/dist/packages/_es/Radio.js +3 -3
  73. package/dist/packages/_es/RadioGroup.js +1 -1
  74. package/dist/packages/_es/Range.js +34 -48
  75. package/dist/packages/_es/Rate.js +14 -15
  76. package/dist/packages/_es/Row.js +1 -1
  77. package/dist/packages/_es/SearchBar.js +36 -39
  78. package/dist/packages/_es/ShortPassword.js +66 -97
  79. package/dist/packages/_es/SideNavBar.js +18 -7
  80. package/dist/packages/_es/SideNavBarItem.js +1 -1
  81. package/dist/packages/_es/Signature.js +80 -113
  82. package/dist/packages/_es/Skeleton.js +11 -12
  83. package/dist/packages/_es/Sku.js +38 -63
  84. package/dist/packages/_es/Step.js +2 -7
  85. package/dist/packages/_es/Steps.js +1 -1
  86. package/dist/packages/_es/Sticky.js +23 -33
  87. package/dist/packages/_es/SubSideNavBar.js +2 -4
  88. package/dist/packages/_es/Swipe.js +26 -41
  89. package/dist/packages/_es/Swiper.js +21 -38
  90. package/dist/packages/_es/SwiperItem.js +2 -2
  91. package/dist/packages/_es/Switch.js +8 -8
  92. package/dist/packages/_es/TabPane.js +1 -1
  93. package/dist/packages/_es/Tabbar.js +13 -15
  94. package/dist/packages/_es/TabbarItem.js +30 -24
  95. package/dist/packages/_es/Table.js +17 -22
  96. package/dist/packages/_es/Tabs.js +16 -49
  97. package/dist/packages/_es/Tag.js +5 -6
  98. package/dist/packages/_es/TextArea.js +49 -114
  99. package/dist/packages/_es/TimeDetail.js +3 -4
  100. package/dist/packages/_es/TimePannel.js +3 -3
  101. package/dist/packages/_es/TimeSelect.js +10 -12
  102. package/dist/packages/_es/Toast.js +164 -53
  103. package/dist/packages/_es/TrendArrow.js +4 -6
  104. package/dist/packages/_es/Uploader.js +140 -141
  105. package/dist/packages/_es/Video.js +18 -39
  106. package/dist/packages/_es/WaterMark.js +14 -22
  107. package/dist/packages/_es/common.js +1 -1
  108. package/dist/packages/_es/component.js +1 -1
  109. package/dist/packages/_es/index.js +6 -44
  110. package/dist/packages/_es/index2.js +31 -8
  111. package/dist/packages/_es/index3.js +7 -64
  112. package/dist/packages/_es/index4.js +62 -424
  113. package/dist/packages/_es/{index.taro.js → index5.js} +154 -167
  114. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  115. package/dist/packages/_es/pxCheck.js +1 -1
  116. package/dist/packages/_es/raf.js +1 -1
  117. package/dist/packages/_es/style.css +3 -21
  118. package/dist/packages/checkbox/index.scss +1 -0
  119. package/dist/packages/locale/lang/baseLang.js +1 -1
  120. package/dist/packages/locale/lang/en-US.js +1 -1
  121. package/dist/packages/locale/lang/id-ID.js +1 -1
  122. package/dist/packages/locale/lang/index.js +1 -1
  123. package/dist/packages/locale/lang/zh-CN.js +1 -1
  124. package/dist/packages/locale/lang/zh-TW.js +1 -1
  125. package/dist/packages/menuitem/index.scss +12 -3
  126. package/dist/smartips/attributes.json +5 -1
  127. package/dist/smartips/tags.json +1 -0
  128. package/dist/smartips/web-types.json +11 -2
  129. package/dist/style.css +1 -1
  130. package/dist/styles/themes/default.scss +48 -48
  131. package/dist/styles/themes/jdb.scss +48 -48
  132. package/dist/styles/themes/jddkh.scss +48 -48
  133. package/dist/styles/themes/jdt.scss +48 -48
  134. package/dist/types/__VUE/actionsheet/{index.taro.vue.d.ts → index.vue.d.ts} +9 -9
  135. package/dist/types/__VUE/address/{index.taro.vue.d.ts → index.vue.d.ts} +33 -73
  136. package/dist/types/__VUE/addresslist/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  137. package/dist/types/__VUE/animate/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  138. package/dist/types/__VUE/avatar/{index.taro.vue.d.ts → index.vue.d.ts} +6 -6
  139. package/dist/types/__VUE/avatargroup/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  140. package/dist/types/__VUE/backtop/{index.taro.vue.d.ts → index.vue.d.ts} +37 -15
  141. package/dist/types/__VUE/badge/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  142. package/dist/types/__VUE/barrage/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
  143. package/dist/types/__VUE/button/index.vue.d.ts +1 -1
  144. package/dist/types/__VUE/calendar/{index.taro.vue.d.ts → index.vue.d.ts} +1 -13
  145. package/dist/types/__VUE/calendaritem/{index.taro.vue.d.ts → index.vue.d.ts} +17 -17
  146. package/dist/types/__VUE/card/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  147. package/dist/types/__VUE/cascader/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
  148. package/dist/types/__VUE/category/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  149. package/dist/types/__VUE/categorypane/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  150. package/dist/types/__VUE/cell/{index.taro.vue.d.ts → index.vue.d.ts} +5 -12
  151. package/dist/types/__VUE/checkbox/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  152. package/dist/types/__VUE/circleprogress/{index.taro.vue.d.ts → index.vue.d.ts} +15 -14
  153. package/dist/types/__VUE/collapse/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
  154. package/dist/types/__VUE/collapseitem/{index.taro.vue.d.ts → index.vue.d.ts} +10 -2
  155. package/dist/types/__VUE/comment/{index.taro.vue.d.ts → index.vue.d.ts} +2 -1
  156. package/dist/types/__VUE/configprovider/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  157. package/dist/types/__VUE/countdown/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  158. package/dist/types/__VUE/countup/{index.taro.vue.d.ts → index.vue.d.ts} +7 -5
  159. package/dist/types/__VUE/datepicker/{index.taro.vue.d.ts → index.vue.d.ts} +5 -5
  160. package/dist/types/__VUE/dialog/index.d.ts +48 -0
  161. package/dist/types/__VUE/dialog/{index.taro.vue.d.ts → index.vue.d.ts} +12 -9
  162. package/dist/types/__VUE/divider/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
  163. package/dist/types/__VUE/drag/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
  164. package/dist/types/__VUE/ecard/{index.taro.vue.d.ts → index.vue.d.ts} +3 -3
  165. package/dist/types/__VUE/elevator/{index.taro.vue.d.ts → index.vue.d.ts} +2 -11
  166. package/dist/types/__VUE/ellipsis/{index.taro.vue.d.ts → index.vue.d.ts} +0 -4
  167. package/dist/types/__VUE/empty/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  168. package/dist/types/__VUE/fixednav/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
  169. package/dist/types/__VUE/form/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  170. package/dist/types/__VUE/grid/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
  171. package/dist/types/__VUE/griditem/{index.taro.vue.d.ts → index.vue.d.ts} +27 -2
  172. package/dist/types/__VUE/image/index.vue.d.ts +117 -0
  173. package/dist/types/__VUE/image/type.d.ts +6 -0
  174. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +109 -0
  175. package/dist/types/__VUE/imagepreview/index.d.ts +25 -0
  176. package/dist/types/__VUE/imagepreview/{index.taro.vue.d.ts → index.vue.d.ts} +44 -33
  177. package/dist/types/__VUE/indicator/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  178. package/dist/types/__VUE/infiniteloading/{index.taro.vue.d.ts → index.vue.d.ts} +12 -19
  179. package/dist/types/__VUE/input/{index.taro.vue.d.ts → index.vue.d.ts} +16 -34
  180. package/dist/types/__VUE/inputnumber/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
  181. package/dist/types/__VUE/invoice/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  182. package/dist/types/__VUE/layout/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  183. package/dist/types/__VUE/list/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
  184. package/dist/types/__VUE/menu/{index.taro.vue.d.ts → index.vue.d.ts} +0 -1
  185. package/dist/types/__VUE/menuitem/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  186. package/dist/types/__VUE/navbar/{index.taro.vue.d.ts → index.vue.d.ts} +3 -2
  187. package/dist/types/__VUE/noticebar/{index.taro.vue.d.ts → index.vue.d.ts} +4 -4
  188. package/dist/types/__VUE/notify/index.d.ts +26 -0
  189. package/dist/types/__VUE/notify/{index.taro.vue.d.ts → index.vue.d.ts} +18 -5
  190. package/dist/types/__VUE/numberkeyboard/{index.taro.vue.d.ts → index.vue.d.ts} +29 -5
  191. package/dist/types/__VUE/oldpicker/{ColumnTaro.vue.d.ts → Column.vue.d.ts} +17 -28
  192. package/dist/types/__VUE/oldpicker/{index.taro.vue.d.ts → index.vue.d.ts} +44 -64
  193. package/dist/types/__VUE/pagination/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  194. package/dist/types/__VUE/picker/{ColumnTaro.vue.d.ts → Column.vue.d.ts} +4 -16
  195. package/dist/types/__VUE/picker/{index.taro.vue.d.ts → index.vue.d.ts} +28 -53
  196. package/dist/types/__VUE/popover/{index.taro.vue.d.ts → index.vue.d.ts} +13 -15
  197. package/dist/types/__VUE/popup/index.vue.d.ts +1 -1
  198. package/dist/types/__VUE/price/{index.taro.vue.d.ts → index.vue.d.ts} +0 -1
  199. package/dist/types/__VUE/progress/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
  200. package/dist/types/__VUE/radio/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  201. package/dist/types/__VUE/range/{index.taro.vue.d.ts → index.vue.d.ts} +7 -8
  202. package/dist/types/__VUE/rate/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  203. package/dist/types/__VUE/searchbar/{index.taro.vue.d.ts → index.vue.d.ts} +19 -19
  204. package/dist/types/__VUE/shortpassword/{index.taro.vue.d.ts → index.vue.d.ts} +21 -6
  205. package/dist/types/__VUE/sidenavbar/{index.taro.vue.d.ts → index.vue.d.ts} +5 -0
  206. package/dist/types/__VUE/signature/{index.taro.vue.d.ts → index.vue.d.ts} +5 -8
  207. package/dist/types/__VUE/skeleton/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  208. package/dist/types/__VUE/sku/index.vue.d.ts +310 -0
  209. package/dist/types/__VUE/step/index.vue.d.ts +1 -1
  210. package/dist/types/__VUE/steps/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  211. package/dist/types/__VUE/sticky/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  212. package/dist/types/__VUE/swipe/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
  213. package/dist/types/__VUE/swiper/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
  214. package/dist/types/__VUE/swiperitem/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  215. package/dist/types/__VUE/switch/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  216. package/dist/types/__VUE/tabbar/{index.taro.vue.d.ts → index.vue.d.ts} +2 -1
  217. package/dist/types/__VUE/tabbaritem/{index.taro.vue.d.ts → index.vue.d.ts} +9 -9
  218. package/dist/types/__VUE/table/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  219. package/dist/types/__VUE/tabs/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  220. package/dist/types/__VUE/tag/{index.taro.vue.d.ts → index.vue.d.ts} +4 -4
  221. package/dist/types/__VUE/tag/type.d.ts +5 -0
  222. package/dist/types/__VUE/textarea/{index.taro.vue.d.ts → index.vue.d.ts} +3 -5
  223. package/dist/types/__VUE/timedetail/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  224. package/dist/types/__VUE/timepannel/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  225. package/dist/types/__VUE/timeselect/{index.taro.vue.d.ts → index.vue.d.ts} +8 -7
  226. package/dist/types/__VUE/toast/index.d.ts +16 -0
  227. package/dist/types/__VUE/toast/{index.taro.vue.d.ts → index.vue.d.ts} +22 -44
  228. package/dist/types/__VUE/trendarrow/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  229. package/dist/types/__VUE/uploader/{index.taro.vue.d.ts → index.vue.d.ts} +13 -22
  230. package/dist/types/__VUE/watermark/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
  231. package/dist/types/index.d.ts +1 -1
  232. package/dist/types/nutui.d.ts +89 -89
  233. package/package.json +3 -2
  234. package/dist/packages/_es/use-lock-scroll.js +0 -23
  235. package/dist/types/__VUE/button/index.taro.vue.d.ts +0 -116
  236. package/dist/types/__VUE/icon/index.taro.vue.d.ts +0 -74
  237. package/dist/types/__VUE/image/index.taro.vue.d.ts +0 -33
  238. package/dist/types/__VUE/overlay/index.taro.vue.d.ts +0 -85
  239. package/dist/types/__VUE/popup/index.taro.vue.d.ts +0 -1728
  240. package/dist/types/__VUE/sku/index.taro.vue.d.ts +0 -182
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.6-beta.2 Fri Nov 04 2022 17:24:29 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -49,5 +49,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
49
49
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handlePannel(_ctx.pannelKey))
50
50
  }, toDisplayString(_ctx.name), 3);
51
51
  }
52
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
53
- export { index_taro as default };
52
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
53
+ export { index as default };
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.6-beta.2 Fri Nov 04 2022 17:24:29 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, toDisplayString, renderSlot, createTextVNode } from "vue";
6
+ import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, toDisplayString, renderSlot } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
8
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
@@ -32,12 +32,12 @@ const _sfc_main = create({
32
32
  return [];
33
33
  }
34
34
  },
35
- muti: {
35
+ lockScroll: {
36
36
  type: [Boolean],
37
37
  default: false
38
38
  },
39
- lockScroll: {
40
- type: [Boolean],
39
+ isWrapTeleport: {
40
+ type: Boolean,
41
41
  default: false
42
42
  }
43
43
  },
@@ -57,17 +57,16 @@ const _sfc_main = create({
57
57
  });
58
58
  const currentKey = computed(() => props.currentKey);
59
59
  const currentTime = computed(() => props.currentTime);
60
- const muti = computed(() => props.muti);
61
60
  const close = () => {
62
61
  context.emit("update:visible", false);
63
62
  context.emit("select", currentTime.value);
64
63
  };
65
64
  provide("currentKey", currentKey);
66
65
  provide("currentTime", currentTime);
67
- provide("muti", muti);
68
66
  return {
69
67
  classes,
70
68
  popStyle,
69
+ props,
71
70
  close,
72
71
  translate
73
72
  };
@@ -85,6 +84,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
85
84
  position: "bottom",
86
85
  closeable: "",
87
86
  round: "",
87
+ isWrapTeleport: _ctx.isWrapTeleport,
88
88
  visible: _ctx.visible,
89
89
  style: normalizeStyle(_ctx.popStyle),
90
90
  "lock-scroll": _ctx.lockScroll,
@@ -100,12 +100,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
100
100
  !_ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(_ctx.title || _ctx.translate("pickupTime")), 1)) : renderSlot(_ctx.$slots, "title", { key: 1 })
101
101
  ])
102
102
  ]),
103
- createTextVNode(),
104
103
  createElementVNode("view", _hoisted_4, [
105
104
  createElementVNode("view", _hoisted_5, [
106
105
  renderSlot(_ctx.$slots, "pannel")
107
106
  ]),
108
- createTextVNode(),
109
107
  createElementVNode("view", _hoisted_6, [
110
108
  renderSlot(_ctx.$slots, "detail")
111
109
  ])
@@ -113,7 +111,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
113
111
  ], 2)
114
112
  ]),
115
113
  _: 3
116
- }, 8, ["visible", "style", "lock-scroll", "onClickOverlay", "onClickCloseIcon"]);
114
+ }, 8, ["isWrapTeleport", "visible", "style", "lock-scroll", "onClickOverlay", "onClickCloseIcon"]);
117
115
  }
118
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
119
- export { index_taro as default };
116
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
117
+ export { index as default };
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.6-beta.2 Fri Nov 04 2022 17:24:29 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { watch, computed, resolveComponent, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, createVNode, mergeProps, createCommentVNode, createTextVNode, toDisplayString, vShow } from "vue";
6
+ import { reactive, onMounted, watch, computed, resolveComponent, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, createElementBlock, createVNode, mergeProps, createCommentVNode, toDisplayString, vShow, render } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
8
  import _sfc_main$1 from "./Icon.js";
9
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
@@ -25,10 +25,7 @@ const _sfc_main = create({
25
25
  type: Boolean,
26
26
  default: true
27
27
  },
28
- type: {
29
- type: String,
30
- default: "text"
31
- },
28
+ type: String,
32
29
  customClass: String,
33
30
  bottom: {
34
31
  type: String,
@@ -38,6 +35,10 @@ const _sfc_main = create({
38
35
  type: [String, Number],
39
36
  default: "base"
40
37
  },
38
+ iconSize: {
39
+ type: String,
40
+ default: "20"
41
+ },
41
42
  icon: String,
42
43
  textAlignCenter: {
43
44
  type: Boolean,
@@ -68,15 +69,17 @@ const _sfc_main = create({
68
69
  closeOnClickOverlay: {
69
70
  type: Boolean,
70
71
  default: false
71
- },
72
- visible: {
73
- type: Boolean,
74
- default: false
75
72
  }
76
73
  },
77
- emits: ["update:visible", "closed"],
74
+ emits: ["close"],
78
75
  setup(props, { emit }) {
79
76
  let timer;
77
+ const state = reactive({
78
+ mounted: false
79
+ });
80
+ onMounted(() => {
81
+ state.mounted = true;
82
+ });
80
83
  const clearTimer = () => {
81
84
  if (timer) {
82
85
  clearTimeout(timer);
@@ -84,8 +87,7 @@ const _sfc_main = create({
84
87
  }
85
88
  };
86
89
  const hide = () => {
87
- emit("update:visible", false);
88
- emit("closed");
90
+ state.mounted = false;
89
91
  };
90
92
  const show = () => {
91
93
  clearTimer();
@@ -98,10 +100,14 @@ const _sfc_main = create({
98
100
  const clickCover = () => {
99
101
  if (props.closeOnClickOverlay) {
100
102
  hide();
103
+ emit("close");
101
104
  }
102
105
  };
106
+ if (props.duration) {
107
+ show();
108
+ }
103
109
  watch(
104
- () => props.visible,
110
+ () => props.duration,
105
111
  (val) => {
106
112
  if (val) {
107
113
  show();
@@ -115,18 +121,6 @@ const _sfc_main = create({
115
121
  return !!props.icon;
116
122
  }
117
123
  });
118
- const iconName = computed(() => {
119
- if (props.icon) {
120
- return props.icon;
121
- } else {
122
- return {
123
- success: "success",
124
- fail: "failure",
125
- warn: "tips",
126
- loading: "loading"
127
- }[props.type];
128
- }
129
- });
130
124
  const toastBodyClass = computed(() => {
131
125
  return [
132
126
  "nut-toast",
@@ -138,30 +132,30 @@ const _sfc_main = create({
138
132
  "nut-toast-" + props.size
139
133
  ];
140
134
  });
135
+ const toastIconWrapperClass = computed(() => {
136
+ return ["nut-toast-icon-wrapper", { "nut-toast-icon-no-animation": !props.loadingRotate }];
137
+ });
141
138
  const onAfterLeave = () => {
142
- if (props.visible) {
143
- clearTimer();
144
- hide();
145
- }
139
+ clearTimer();
140
+ props.unmount(props.id);
141
+ props.onClose && props.onClose();
146
142
  };
147
143
  return {
144
+ state,
145
+ hide,
148
146
  clickCover,
149
147
  hasIcon,
150
- iconName,
151
148
  toastBodyClass,
149
+ toastIconWrapperClass,
152
150
  onAfterLeave
153
151
  };
154
152
  }
155
153
  });
156
154
  const _hoisted_1 = {
157
- key: 0,
158
- class: "nut-toast-icon-wrapper"
159
- };
160
- const _hoisted_2 = {
161
155
  key: 1,
162
156
  class: "nut-toast-title"
163
157
  };
164
- const _hoisted_3 = ["innerHTML"];
158
+ const _hoisted_2 = ["innerHTML"];
165
159
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
166
160
  const _component_nut_icon = resolveComponent("nut-icon");
167
161
  return openBlock(), createBlock(Transition, {
@@ -177,34 +171,151 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
177
171
  }),
178
172
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clickCover && _ctx.clickCover(...args))
179
173
  }, [
180
- _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock("view", {
181
- key: 1,
174
+ createElementVNode("view", {
182
175
  class: "nut-toast-inner",
183
176
  style: normalizeStyle({
184
177
  "text-align": _ctx.textAlignCenter ? "center" : "left",
185
178
  "background-color": _ctx.bgColor
186
179
  })
187
180
  }, [
188
- _ctx.hasIcon ? (openBlock(), createElementBlock("view", _hoisted_1, [
189
- createVNode(_component_nut_icon, mergeProps({
190
- size: "20",
191
- color: "#ffffff"
192
- }, _ctx.$attrs, { name: _ctx.iconName }), null, 16, ["name"])
193
- ])) : createCommentVNode("", true),
194
- createTextVNode(),
195
- _ctx.title ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
196
- createTextVNode(),
181
+ _ctx.hasIcon ? (openBlock(), createElementBlock("view", {
182
+ key: 0,
183
+ class: normalizeClass(_ctx.toastIconWrapperClass)
184
+ }, [
185
+ createVNode(_component_nut_icon, mergeProps({ size: _ctx.iconSize }, _ctx.$attrs, {
186
+ color: "#ffffff",
187
+ name: _ctx.icon
188
+ }), null, 16, ["size", "name"])
189
+ ], 2)) : createCommentVNode("", true),
190
+ _ctx.title ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
197
191
  createElementVNode("view", {
198
192
  class: "nut-toast-text",
199
193
  innerHTML: _ctx.msg
200
- }, null, 8, _hoisted_3)
201
- ], 4))
194
+ }, null, 8, _hoisted_2)
195
+ ], 4)
202
196
  ], 6), [
203
- [vShow, _ctx.visible]
197
+ [vShow, _ctx.state.mounted]
204
198
  ])
205
199
  ]),
206
- _: 3
200
+ _: 1
207
201
  }, 8, ["onAfterLeave"]);
208
202
  }
209
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
210
- export { index_taro as default };
203
+ var Toast = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
204
+ const defaultOptions = {
205
+ msg: "",
206
+ id: "",
207
+ duration: 2e3,
208
+ center: true,
209
+ type: "text",
210
+ title: "",
211
+ customClass: "",
212
+ bottom: "30px",
213
+ size: "base",
214
+ iconSize: "20",
215
+ icon: null,
216
+ textAlignCenter: true,
217
+ loadingRotate: true,
218
+ bgColor: "",
219
+ onClose: null,
220
+ unmount: null,
221
+ cover: false,
222
+ coverColor: "",
223
+ closeOnClickOverlay: false
224
+ };
225
+ let idsMap = [];
226
+ let optsMap = [];
227
+ const clearToast = (id) => {
228
+ if (id) {
229
+ const container = document.getElementById(id);
230
+ optsMap = optsMap.filter((item) => item.id !== id);
231
+ idsMap = idsMap.filter((item) => item !== id);
232
+ if (container) {
233
+ document.body.removeChild(container);
234
+ }
235
+ } else {
236
+ idsMap.forEach((item) => {
237
+ const container = document.getElementById(item);
238
+ if (container) {
239
+ document.body.removeChild(container);
240
+ }
241
+ });
242
+ optsMap = [];
243
+ idsMap = [];
244
+ }
245
+ };
246
+ const updateToast = (opts) => {
247
+ const container = document.getElementById(opts.id);
248
+ if (container) {
249
+ const currentOpt = optsMap.find((item) => item.id === opts.id);
250
+ if (currentOpt) {
251
+ opts = { ...defaultOptions, ...currentOpt, ...opts };
252
+ } else {
253
+ opts = { ...defaultOptions, ...opts };
254
+ }
255
+ const instance = createVNode(Toast, opts);
256
+ render(instance, container);
257
+ return ToastFunction;
258
+ }
259
+ };
260
+ const mountToast = (opts) => {
261
+ opts.unmount = clearToast;
262
+ let _id;
263
+ if (opts.id) {
264
+ _id = opts.id;
265
+ if (idsMap.find((item) => item === opts.id)) {
266
+ return updateToast(opts);
267
+ }
268
+ } else {
269
+ _id = new Date().getTime() + "";
270
+ }
271
+ opts = { ...defaultOptions, ...opts };
272
+ opts.id = _id;
273
+ idsMap.push(opts.id);
274
+ optsMap.push(opts);
275
+ const container = document.createElement("div");
276
+ container.id = opts.id;
277
+ const instance = createVNode(Toast, opts);
278
+ render(instance, container);
279
+ document.body.appendChild(container);
280
+ return ToastFunction;
281
+ };
282
+ const errorMsg = (msg) => {
283
+ if (!msg) {
284
+ console.warn("[NutUI Toast]: msg\u4E0D\u80FD\u4E3A\u7A7A");
285
+ return;
286
+ }
287
+ };
288
+ const ToastFunction = {
289
+ text(msg, opts = {}) {
290
+ errorMsg(msg);
291
+ return mountToast({ ...opts, type: "text", msg });
292
+ },
293
+ success(msg, opts = {}) {
294
+ errorMsg(msg);
295
+ return mountToast({ icon: "success", ...opts, msg, type: "success" });
296
+ },
297
+ fail(msg, opts = {}) {
298
+ errorMsg(msg);
299
+ return mountToast({ icon: "failure", ...opts, msg, type: "fail" });
300
+ },
301
+ warn(msg, opts = {}) {
302
+ errorMsg(msg);
303
+ return mountToast({ icon: "tips", ...opts, msg, type: "warn" });
304
+ },
305
+ loading(msg, opts = {}) {
306
+ return mountToast({
307
+ icon: "loading",
308
+ ...opts,
309
+ msg,
310
+ type: "loading"
311
+ });
312
+ },
313
+ hide(id) {
314
+ clearToast(id);
315
+ },
316
+ install(app) {
317
+ app.use(Toast);
318
+ app.config.globalProperties.$toast = ToastFunction;
319
+ }
320
+ };
321
+ export { Toast, ToastFunction, ToastFunction as default };
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.6-beta.2 Fri Nov 04 2022 17:24:29 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, createTextVNode, renderSlot, createBlock } from "vue";
6
+ import { reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createBlock } from "vue";
7
7
  import { m as myFixed, c as createComponent } from "./component.js";
8
8
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
@@ -112,7 +112,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
112
112
  class: "nut-trendarrow-icon-before nut-trendarrow-rate",
113
113
  style: normalizeStyle(_ctx.calcStyle)
114
114
  }, toDisplayString(_ctx.calcRate), 5)) : createCommentVNode("", true),
115
- createTextVNode(),
116
115
  renderSlot(_ctx.$slots, "default", {}, () => [
117
116
  Number(_ctx.rate) !== 0 ? (openBlock(), createBlock(_component_nut_icon, {
118
117
  key: 0,
@@ -121,7 +120,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
121
120
  color: _ctx.calcIconProps.color
122
121
  }, null, 8, ["size", "name", "color"])) : createCommentVNode("", true)
123
122
  ]),
124
- createTextVNode(),
125
123
  _ctx.arrowLeft ? (openBlock(), createElementBlock("span", {
126
124
  key: 1,
127
125
  class: "nut-trendarrow-icon-after nut-trendarrow-rate",
@@ -129,5 +127,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
129
127
  }, toDisplayString(_ctx.calcRate), 5)) : createCommentVNode("", true)
130
128
  ], 2);
131
129
  }
132
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
133
- export { index_taro as default };
130
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
131
+ export { index as default };