@nutui/nutui 4.0.0 → 4.0.1-2.beta-1

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 (285) hide show
  1. package/CHANGELOG.md +226 -0
  2. package/README.md +34 -65
  3. package/dist/nutui.es.js +10 -17
  4. package/dist/nutui.js +16202 -0
  5. package/dist/nutui.umd.js +1 -7
  6. package/dist/packages/_es/ActionSheet.js +79 -94
  7. package/dist/packages/_es/Address.js +260 -345
  8. package/dist/packages/_es/AddressList.js +269 -354
  9. package/dist/packages/_es/Animate.js +46 -38
  10. package/dist/packages/_es/Audio.js +128 -180
  11. package/dist/packages/_es/AudioOperate.js +60 -52
  12. package/dist/packages/_es/Avatar.js +67 -75
  13. package/dist/packages/_es/AvatarGroup.js +23 -31
  14. package/dist/packages/_es/Backtop.js +59 -99
  15. package/dist/packages/_es/Badge.js +39 -46
  16. package/dist/packages/_es/Barrage.js +68 -145
  17. package/dist/packages/_es/Button.js +47 -66
  18. package/dist/packages/_es/Calendar.js +135 -152
  19. package/dist/packages/_es/CalendarItem.js +6 -6
  20. package/dist/packages/_es/Card.js +42 -56
  21. package/dist/packages/_es/Cascader.js +323 -433
  22. package/dist/packages/_es/Category.js +29 -39
  23. package/dist/packages/_es/CategoryPane.js +57 -83
  24. package/dist/packages/_es/Cell.js +56 -71
  25. package/dist/packages/_es/CellGroup.js +19 -27
  26. package/dist/packages/_es/Checkbox.js +109 -138
  27. package/dist/packages/_es/CheckboxGroup.js +38 -61
  28. package/dist/packages/_es/CircleProgress.js +67 -96
  29. package/dist/packages/_es/Col.js +23 -31
  30. package/dist/packages/_es/Collapse.js +37 -67
  31. package/dist/packages/_es/CollapseItem.js +91 -184
  32. package/dist/packages/_es/Comment.js +207 -279
  33. package/dist/packages/_es/ConfigProvider.js +38 -56
  34. package/dist/packages/_es/Countdown.js +100 -194
  35. package/dist/packages/_es/Countup.js +232 -428
  36. package/dist/packages/_es/DatePicker.js +169 -245
  37. package/dist/packages/_es/Dialog.js +163 -188
  38. package/dist/packages/_es/Divider.js +42 -40
  39. package/dist/packages/_es/Drag.js +70 -153
  40. package/dist/packages/_es/Ecard.js +64 -104
  41. package/dist/packages/_es/Elevator.js +144 -201
  42. package/dist/packages/_es/Ellipsis.js +95 -159
  43. package/dist/packages/_es/Empty.js +23 -39
  44. package/dist/packages/_es/FixedNav.js +93 -116
  45. package/dist/packages/_es/Form.js +108 -164
  46. package/dist/packages/_es/FormItem.js +48 -61
  47. package/dist/packages/_es/Grid.js +5 -6
  48. package/dist/packages/_es/GridItem.js +58 -84
  49. package/dist/packages/_es/Image.js +98 -88
  50. package/dist/packages/_es/ImagePreview.js +262 -392
  51. package/dist/packages/_es/Indicator.js +30 -34
  52. package/dist/packages/_es/InfiniteLoading.js +83 -117
  53. package/dist/packages/_es/Input.js +176 -223
  54. package/dist/packages/_es/InputNumber.js +81 -117
  55. package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
  56. package/dist/packages/_es/Invoice.js +105 -113
  57. package/dist/packages/_es/Layout.js +3 -4
  58. package/dist/packages/_es/List.js +147 -89
  59. package/dist/packages/_es/Menu.js +96 -152
  60. package/dist/packages/_es/MenuItem.js +117 -153
  61. package/dist/packages/_es/Navbar.js +103 -119
  62. package/dist/packages/_es/Noticebar.js +207 -273
  63. package/dist/packages/_es/Notify.js +110 -147
  64. package/dist/packages/_es/NumberKeyboard.js +127 -202
  65. package/dist/packages/_es/Overlay.js +53 -66
  66. package/dist/packages/_es/Pagination.js +70 -100
  67. package/dist/packages/_es/Picker.js +276 -425
  68. package/dist/packages/_es/Popover.js +122 -225
  69. package/dist/packages/_es/Popup.js +4 -4
  70. package/dist/packages/_es/Price.js +47 -80
  71. package/dist/packages/_es/Progress.js +63 -79
  72. package/dist/packages/_es/PullRefresh.js +96 -157
  73. package/dist/packages/_es/Radio.js +4 -4
  74. package/dist/packages/_es/RadioGroup.js +3 -3
  75. package/dist/packages/_es/Range.js +205 -329
  76. package/dist/packages/_es/Rate.js +93 -122
  77. package/dist/packages/_es/Row.js +21 -27
  78. package/dist/packages/_es/Searchbar.js +130 -160
  79. package/dist/packages/_es/ShortPassword.js +69 -93
  80. package/dist/packages/_es/SideNavbar.js +49 -59
  81. package/dist/packages/_es/SideNavbarItem.js +22 -32
  82. package/dist/packages/_es/Signature.js +83 -128
  83. package/dist/packages/_es/Skeleton.js +110 -130
  84. package/dist/packages/_es/Sku.js +251 -326
  85. package/dist/packages/_es/Step.js +60 -69
  86. package/dist/packages/_es/Steps.js +26 -31
  87. package/dist/packages/_es/Sticky.js +4 -4
  88. package/dist/packages/_es/SubSideNavbar.js +52 -56
  89. package/dist/packages/_es/Swipe.js +84 -137
  90. package/dist/packages/_es/Swiper.js +175 -310
  91. package/dist/packages/_es/SwiperItem.js +28 -44
  92. package/dist/packages/_es/Switch.js +55 -67
  93. package/dist/packages/_es/TabPane.js +32 -20
  94. package/dist/packages/_es/Tabbar.js +41 -52
  95. package/dist/packages/_es/TabbarItem.js +61 -81
  96. package/dist/packages/_es/Table.js +110 -148
  97. package/dist/packages/_es/Tabs.js +284 -205
  98. package/dist/packages/_es/Tag.js +44 -61
  99. package/dist/packages/_es/Textarea.js +80 -124
  100. package/dist/packages/_es/TimeDetail.js +49 -57
  101. package/dist/packages/_es/TimePannel.js +35 -31
  102. package/dist/packages/_es/TimeSelect.js +47 -68
  103. package/dist/packages/_es/Toast.js +150 -203
  104. package/dist/packages/_es/Tour.js +139 -175
  105. package/dist/packages/_es/TrendArrow.js +57 -58
  106. package/dist/packages/_es/Uploader.js +235 -359
  107. package/dist/packages/_es/Video.js +191 -298
  108. package/dist/packages/_es/Watermark.js +84 -98
  109. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
  110. package/dist/packages/_es/common-d218746f.js +116 -0
  111. package/dist/packages/_es/component-234624bc.js +89 -0
  112. package/dist/packages/_es/index-14dfadc4.js +561 -0
  113. package/dist/packages/_es/index-192a3ef6.js +29 -0
  114. package/dist/packages/_es/index-360c5092.js +210 -0
  115. package/dist/packages/_es/index-496e6e05.js +24 -0
  116. package/dist/packages/_es/index-50eed3d9.js +7 -0
  117. package/dist/packages/_es/index-53ec2d4d.js +34 -0
  118. package/dist/packages/_es/index-fadb0974.js +8 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
  120. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
  121. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
  122. package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
  123. package/dist/packages/_es/pxCheck-38173291.js +4 -0
  124. package/dist/packages/_es/raf-a74f1a06.js +16 -0
  125. package/dist/packages/_es/renderIcon-47498b32.js +5 -0
  126. package/dist/packages/actionsheet/index.scss +2 -0
  127. package/dist/packages/actionsheet/style.mjs +0 -2
  128. package/dist/packages/address/index.scss +5 -2
  129. package/dist/packages/address/style.mjs +0 -3
  130. package/dist/packages/addresslist/index.scss +3 -0
  131. package/dist/packages/addresslist/style.mjs +0 -2
  132. package/dist/packages/audio/index.scss +2 -0
  133. package/dist/packages/audio/style.mjs +0 -1
  134. package/dist/packages/audiooperate/index.scss +2 -0
  135. package/dist/packages/audiooperate/style.mjs +0 -1
  136. package/dist/packages/badge/index.scss +3 -0
  137. package/dist/packages/button/index.scss +1 -1
  138. package/dist/packages/calendar/index.scss +3 -0
  139. package/dist/packages/calendar/style.mjs +0 -3
  140. package/dist/packages/card/index.scss +3 -0
  141. package/dist/packages/card/style.mjs +0 -2
  142. package/dist/packages/cascader/index.scss +4 -0
  143. package/dist/packages/cascader/style.mjs +0 -5
  144. package/dist/packages/cellgroup/index.scss +1 -1
  145. package/dist/packages/checkbox/index.scss +41 -0
  146. package/dist/packages/col/index.scss +2 -2
  147. package/dist/packages/comment/index.scss +2 -0
  148. package/dist/packages/comment/style.mjs +0 -1
  149. package/dist/packages/datepicker/index.scss +1 -2
  150. package/dist/packages/datepicker/style.mjs +0 -3
  151. package/dist/packages/dialog/index.scss +11 -0
  152. package/dist/packages/dialog/style.mjs +0 -3
  153. package/dist/packages/ecard/index.scss +2 -0
  154. package/dist/packages/ecard/style.mjs +0 -1
  155. package/dist/packages/fixednav/index.scss +2 -0
  156. package/dist/packages/fixednav/style.mjs +0 -1
  157. package/dist/packages/form/index.scss +1 -2
  158. package/dist/packages/form/style.mjs +0 -1
  159. package/dist/packages/formitem/index.scss +3 -0
  160. package/dist/packages/formitem/style.mjs +0 -1
  161. package/dist/packages/imagepreview/index.scss +5 -5
  162. package/dist/packages/imagepreview/style.mjs +0 -5
  163. package/dist/packages/input/index.scss +13 -13
  164. package/dist/packages/invoice/index.scss +6 -0
  165. package/dist/packages/invoice/style.mjs +0 -7
  166. package/dist/packages/list/index.scss +8 -8
  167. package/dist/packages/menuitem/index.scss +9 -10
  168. package/dist/packages/menuitem/style.mjs +0 -2
  169. package/dist/packages/navbar/index.scss +0 -1
  170. package/dist/packages/noticebar/index.scss +12 -2
  171. package/dist/packages/notify/index.scss +2 -0
  172. package/dist/packages/notify/style.mjs +0 -2
  173. package/dist/packages/numberkeyboard/index.scss +2 -0
  174. package/dist/packages/numberkeyboard/style.mjs +0 -2
  175. package/dist/packages/picker/index.scss +4 -9
  176. package/dist/packages/picker/style.mjs +0 -2
  177. package/dist/packages/popover/index.scss +2 -0
  178. package/dist/packages/popover/style.mjs +0 -2
  179. package/dist/packages/popup/index.scss +2 -0
  180. package/dist/packages/popup/style.mjs +0 -1
  181. package/dist/packages/price/index.scss +5 -10
  182. package/dist/packages/rate/index.scss +6 -9
  183. package/dist/packages/searchbar/index.scss +4 -0
  184. package/dist/packages/shortpassword/index.scss +18 -0
  185. package/dist/packages/shortpassword/style.mjs +0 -2
  186. package/dist/packages/signature/index.scss +2 -0
  187. package/dist/packages/signature/style.mjs +0 -1
  188. package/dist/packages/skeleton/index.scss +2 -0
  189. package/dist/packages/skeleton/style.mjs +0 -1
  190. package/dist/packages/sku/index.scss +4 -0
  191. package/dist/packages/sku/style.mjs +0 -4
  192. package/dist/packages/tabbaritem/index.scss +2 -0
  193. package/dist/packages/tabbaritem/style.mjs +0 -1
  194. package/dist/packages/tabs/index.scss +36 -2
  195. package/dist/packages/tabs/style.mjs +0 -1
  196. package/dist/packages/textarea/index.scss +2 -0
  197. package/dist/packages/timeselect/index.scss +2 -0
  198. package/dist/packages/timeselect/style.mjs +0 -2
  199. package/dist/packages/tour/index.scss +2 -0
  200. package/dist/packages/tour/style.mjs +0 -3
  201. package/dist/packages/uploader/index.scss +10 -2
  202. package/dist/packages/uploader/style.mjs +0 -2
  203. package/dist/resolver/index.d.ts +6 -0
  204. package/dist/resolver/index.js +1 -0
  205. package/dist/resolver/index.mjs +24 -0
  206. package/dist/resolver/package.json +20 -0
  207. package/dist/smartips/web-types.json +114 -15
  208. package/dist/style.css +1 -1
  209. package/dist/styles/themes/default.scss +155 -52
  210. package/dist/styles/themes/jdb.scss +155 -52
  211. package/dist/styles/themes/jddkh.scss +155 -52
  212. package/dist/styles/themes/jdt.scss +155 -52
  213. package/dist/styles/variables-jdb.scss +9 -1
  214. package/dist/styles/variables-jddkh.scss +9 -1
  215. package/dist/styles/variables-jdt.scss +9 -1
  216. package/dist/styles/variables.scss +8 -0
  217. package/dist/types/__VUE/address/index.vue.d.ts +2 -1
  218. package/dist/types/__VUE/addresslist/components/GeneralShell.vue.d.ts +1 -1
  219. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -1
  220. package/dist/types/__VUE/addresslist/index.vue.d.ts +1 -1
  221. package/dist/types/__VUE/animate/index.vue.d.ts +6 -0
  222. package/dist/types/__VUE/audiooperate/index.vue.d.ts +4 -4
  223. package/dist/types/__VUE/badge/index.vue.d.ts +9 -0
  224. package/dist/types/__VUE/button/type.d.ts +1 -0
  225. package/dist/types/__VUE/calendaritem/type.d.ts +1 -0
  226. package/dist/types/__VUE/collapse/index.vue.d.ts +31 -5
  227. package/dist/types/__VUE/collapseitem/index.vue.d.ts +117 -11
  228. package/dist/types/__VUE/configprovider/index.vue.d.ts +2 -2
  229. package/dist/types/__VUE/datepicker/index.vue.d.ts +1 -1
  230. package/dist/types/__VUE/dialog/index.d.ts +1 -0
  231. package/dist/types/__VUE/dialog/index.vue.d.ts +1 -0
  232. package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
  233. package/dist/types/__VUE/image/index.vue.d.ts +14 -3
  234. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +9 -0
  235. package/dist/types/__VUE/imagepreview/index.vue.d.ts +1 -1
  236. package/dist/types/__VUE/input/index.vue.d.ts +27 -2
  237. package/dist/types/__VUE/list/index.vue.d.ts +42 -13
  238. package/dist/types/__VUE/list/type.d.ts +13 -0
  239. package/dist/types/__VUE/menu/index.vue.d.ts +0 -2
  240. package/dist/types/__VUE/menuitem/index.vue.d.ts +9 -17
  241. package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
  242. package/dist/types/__VUE/noticebar/index.vue.d.ts +5 -2
  243. package/dist/types/__VUE/picker/common.d.ts +2 -0
  244. package/dist/types/__VUE/picker/usePicker.d.ts +1 -1
  245. package/dist/types/__VUE/price/index.vue.d.ts +9 -0
  246. package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
  247. package/dist/types/__VUE/row/index.vue.d.ts +1 -1
  248. package/dist/types/__VUE/searchbar/index.vue.d.ts +121 -5
  249. package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
  250. package/dist/types/__VUE/swiper/index.vue.d.ts +9 -2
  251. package/dist/types/__VUE/switch/index.vue.d.ts +1 -0
  252. package/dist/types/__VUE/table/common.d.ts +55 -2
  253. package/dist/types/__VUE/tabpane/index.vue.d.ts +1 -4
  254. package/dist/types/__VUE/tabs/hooks.d.ts +12 -0
  255. package/dist/types/__VUE/tabs/index.vue.d.ts +35 -5
  256. package/dist/types/__VUE/tabs/types.d.ts +12 -0
  257. package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
  258. package/dist/types/__VUE/toast/index.vue.d.ts +11 -4
  259. package/dist/types/__VUE/uploader/type.d.ts +2 -1
  260. package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
  261. package/dist/types/index.d.ts +1 -2
  262. package/dist/types/resolver/index.d.ts +6 -0
  263. package/dist/types/utils/date.d.ts +4 -0
  264. package/dist/types/utils/useTaroRect/index.d.ts +1 -1
  265. package/dist/types/utils/util.d.ts +1 -1
  266. package/package.json +13 -6
  267. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
  268. package/dist/packages/_es/common-b9a5e726.js +0 -145
  269. package/dist/packages/_es/component-81a4c1d0.js +0 -145
  270. package/dist/packages/_es/index-29892cda.js +0 -33
  271. package/dist/packages/_es/index-2ae3ae87.js +0 -846
  272. package/dist/packages/_es/index-43c34ac6.js +0 -30
  273. package/dist/packages/_es/index-54d03fc1.js +0 -8
  274. package/dist/packages/_es/index-79c5dc33.js +0 -10
  275. package/dist/packages/_es/index-7a7385e4.js +0 -67
  276. package/dist/packages/_es/index-991c279f.js +0 -244
  277. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
  278. package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
  279. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
  280. package/dist/packages/_es/interceptor-956b24fc.js +0 -29
  281. package/dist/packages/_es/mountComponent-1ece4110.js +0 -39
  282. package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
  283. package/dist/packages/_es/raf-729dad54.js +0 -25
  284. package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
  285. /package/dist/types/utils/{interceptor.d.ts → Interceptor.d.ts} +0 -0
@@ -1,19 +1,18 @@
1
- import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, toDisplayString, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { P as Popup } from "./index-991c279f.js";
4
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ import { computed as l, provide as p, resolveComponent as d, openBlock as u, createBlock as _, normalizeStyle as f, withCtx as y, createElementVNode as t, normalizeClass as v, createElementBlock as h, toDisplayString as k, renderSlot as i } from "vue";
2
+ import { c as b } from "./component-234624bc.js";
3
+ import { P as m } from "./index-360c5092.js";
4
+ import { _ as C } from "./_plugin-vue_export-helper-dad06003.js";
5
5
  import "../locale/lang";
6
6
  import "./Overlay.js";
7
7
  import "@nutui/icons-vue";
8
- const { componentName, create, translate } = createComponent("time-select");
9
- const _sfc_main = create({
8
+ const { componentName: S, create: w, translate: $ } = b("time-select"), g = w({
10
9
  components: {
11
- [Popup.name]: Popup
10
+ [m.name]: m
12
11
  },
13
12
  props: {
14
13
  visible: {
15
14
  type: Boolean,
16
- defalut: false
15
+ defalut: !1
17
16
  },
18
17
  height: {
19
18
  type: [String],
@@ -29,84 +28,64 @@ const _sfc_main = create({
29
28
  },
30
29
  currentTime: {
31
30
  type: Array,
32
- default: () => {
33
- return [];
34
- }
31
+ default: () => []
35
32
  },
36
33
  lockScroll: {
37
34
  type: [Boolean],
38
- default: true
35
+ default: !0
39
36
  },
40
37
  teleportDisable: {
41
38
  type: Boolean,
42
- default: false
39
+ default: !1
43
40
  }
44
41
  },
45
42
  emits: ["update:visible", "select"],
46
- setup: (props, context) => {
47
- const classes = computed(() => {
48
- const prefixCls = componentName;
49
- return {
50
- [prefixCls]: true
51
- };
52
- });
53
- const popStyle = computed(() => {
54
- return {
55
- width: "100%",
56
- height: props.height
57
- };
58
- });
59
- const currentKey = computed(() => props.currentKey);
60
- const currentTime = computed(() => props.currentTime);
61
- const close = () => {
62
- context.emit("update:visible", false);
63
- context.emit("select", currentTime.value);
43
+ setup: (e, o) => {
44
+ const r = l(() => ({
45
+ [S]: !0
46
+ })), c = l(() => ({
47
+ width: "100%",
48
+ height: e.height
49
+ })), a = l(() => e.currentKey), s = l(() => e.currentTime), n = () => {
50
+ o.emit("update:visible", !1), o.emit("select", s.value);
64
51
  };
65
- provide("currentKey", currentKey);
66
- provide("currentTime", currentTime);
67
- return {
68
- classes,
69
- popStyle,
70
- props,
71
- close,
72
- translate
52
+ return p("currentKey", a), p("currentTime", s), {
53
+ classes: r,
54
+ popStyle: c,
55
+ props: e,
56
+ close: n,
57
+ translate: $
73
58
  };
74
59
  }
75
- });
76
- const _hoisted_1 = { class: "nut-time-select__title" };
77
- const _hoisted_2 = { class: "nut-time-select__title__fixed" };
78
- const _hoisted_3 = { key: 0 };
79
- const _hoisted_4 = { class: "nut-time-select__content" };
80
- const _hoisted_5 = { class: "nut-time-select__content__pannel" };
81
- const _hoisted_6 = { class: "nut-time-select__content__detail" };
82
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
83
- const _component_nut_popup = resolveComponent("nut-popup");
84
- return openBlock(), createBlock(_component_nut_popup, {
60
+ }), B = { class: "nut-time-select__title" }, D = { class: "nut-time-select__title__fixed" }, T = { key: 0 }, K = { class: "nut-time-select__content" }, N = { class: "nut-time-select__content__pannel" }, z = { class: "nut-time-select__content__detail" };
61
+ function E(e, o, r, c, a, s) {
62
+ const n = d("nut-popup");
63
+ return u(), _(n, {
85
64
  position: "bottom",
86
65
  closeable: "",
87
66
  round: "",
88
- teleportDisable: _ctx.teleportDisable,
89
- visible: _ctx.visible,
90
- style: normalizeStyle(_ctx.popStyle),
91
- "lock-scroll": _ctx.lockScroll,
92
- onClickOverlay: _ctx.close,
93
- onClickCloseIcon: _ctx.close
67
+ teleportDisable: e.teleportDisable,
68
+ visible: e.visible,
69
+ style: f(e.popStyle),
70
+ "lock-scroll": e.lockScroll,
71
+ onClickOverlay: e.close,
72
+ onClickCloseIcon: e.close
94
73
  }, {
95
- default: withCtx(() => [
96
- createElementVNode("view", {
97
- class: normalizeClass(_ctx.classes)
74
+ default: y(() => [
75
+ t("view", {
76
+ class: v(e.classes)
98
77
  }, [
99
- createElementVNode("view", _hoisted_1, [
100
- createElementVNode("view", _hoisted_2, [
101
- !_ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(_ctx.title || _ctx.translate("pickupTime")), 1)) : renderSlot(_ctx.$slots, "title", { key: 1 })
78
+ t("view", B, [
79
+ t("view", D, [
80
+ e.$slots.title ? i(e.$slots, "title", { key: 1 }) : (u(), h("span", T, k(e.title || e.translate("pickupTime")), 1))
102
81
  ])
103
82
  ]),
104
- createElementVNode("view", _hoisted_4, [
105
- createElementVNode("view", _hoisted_5, [
106
- renderSlot(_ctx.$slots, "pannel")
83
+ t("view", K, [
84
+ t("view", N, [
85
+ i(e.$slots, "pannel")
107
86
  ]),
108
- createElementVNode("view", _hoisted_6, [
109
- renderSlot(_ctx.$slots, "detail")
87
+ t("view", z, [
88
+ i(e.$slots, "detail")
110
89
  ])
111
90
  ])
112
91
  ], 2)
@@ -114,7 +93,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
114
93
  _: 3
115
94
  }, 8, ["teleportDisable", "visible", "style", "lock-scroll", "onClickOverlay", "onClickCloseIcon"]);
116
95
  }
117
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
96
+ const G = /* @__PURE__ */ C(g, [["render", E]]);
118
97
  export {
119
- index as default
98
+ G as default
120
99
  };
@@ -1,12 +1,23 @@
1
- import { reactive, onMounted, watch, computed, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, createElementBlock, resolveDynamicComponent, createCommentVNode, toDisplayString, vShow, createVNode, render } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { r as renderIcon } from "./renderIcon-3d0fd47c.js";
4
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ var M = Object.defineProperty, N = Object.defineProperties;
2
+ var D = Object.getOwnPropertyDescriptors;
3
+ var b = Object.getOwnPropertySymbols;
4
+ var $ = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
5
+ var p = (e, t, n) => t in e ? M(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, o = (e, t) => {
6
+ for (var n in t || (t = {}))
7
+ $.call(t, n) && p(e, n, t[n]);
8
+ if (b)
9
+ for (var n of b(t))
10
+ F.call(t, n) && p(e, n, t[n]);
11
+ return e;
12
+ }, a = (e, t) => N(e, D(t));
13
+ import { reactive as R, onMounted as V, watch as H, computed as y, openBlock as f, createBlock as w, Transition as W, withCtx as j, withDirectives as U, createElementVNode as C, normalizeClass as k, normalizeStyle as S, createElementBlock as T, resolveDynamicComponent as q, createCommentVNode as B, toDisplayString as G, vShow as J, createVNode as K, render as P } from "vue";
14
+ import { c as Q } from "./component-234624bc.js";
15
+ import { r as X } from "./renderIcon-47498b32.js";
16
+ import { _ as Y } from "./_plugin-vue_export-helper-dad06003.js";
5
17
  import "../locale/lang";
6
- import { C as CreateComponent } from "./mountComponent-1ece4110.js";
7
- import { Success, Failure, Tips, Loading } from "@nutui/icons-vue";
8
- const { create } = createComponent("toast");
9
- const _sfc_main = create({
18
+ import { C as Z } from "./mountComponent-6d4ff200.js";
19
+ import { Success as x, Failure as _, Tips as ee, Loading as te } from "@nutui/icons-vue";
20
+ const { create: ne } = Q("toast"), oe = ne({
10
21
  components: {},
11
22
  props: {
12
23
  id: String,
@@ -17,9 +28,12 @@ const _sfc_main = create({
17
28
  },
18
29
  center: {
19
30
  type: Boolean,
20
- default: true
31
+ default: !0
32
+ },
33
+ type: {
34
+ type: String,
35
+ default: "text"
21
36
  },
22
- type: String,
23
37
  customClass: String,
24
38
  bottom: {
25
39
  type: String,
@@ -31,16 +45,15 @@ const _sfc_main = create({
31
45
  },
32
46
  icon: {
33
47
  type: Object,
34
- default: () => {
35
- }
48
+ default: null
36
49
  },
37
50
  textAlignCenter: {
38
51
  type: Boolean,
39
- default: true
52
+ default: !0
40
53
  },
41
54
  loadingRotate: {
42
55
  type: Boolean,
43
- default: true
56
+ default: !0
44
57
  },
45
58
  bgColor: {
46
59
  type: String,
@@ -50,7 +63,7 @@ const _sfc_main = create({
50
63
  unmount: Function,
51
64
  cover: {
52
65
  type: Boolean,
53
- default: false
66
+ default: !1
54
67
  },
55
68
  coverColor: {
56
69
  type: String,
@@ -62,142 +75,107 @@ const _sfc_main = create({
62
75
  },
63
76
  closeOnClickOverlay: {
64
77
  type: Boolean,
65
- default: false
78
+ default: !1
66
79
  }
67
80
  },
68
81
  emits: ["close"],
69
- setup(props, { emit }) {
70
- let timer;
71
- const state = reactive({
72
- mounted: false
82
+ setup(e, { emit: t }) {
83
+ let n;
84
+ const r = R({
85
+ mounted: !1
73
86
  });
74
- onMounted(() => {
75
- state.mounted = true;
87
+ V(() => {
88
+ r.mounted = !0;
76
89
  });
77
- const clearTimer = () => {
78
- if (timer) {
79
- clearTimeout(timer);
80
- timer = null;
81
- }
82
- };
83
- const hide = () => {
84
- state.mounted = false;
85
- };
86
- const show = () => {
87
- clearTimer();
88
- if (props.duration) {
89
- timer = setTimeout(() => {
90
- hide();
91
- }, props.duration);
92
- }
90
+ const l = () => {
91
+ n && (clearTimeout(n), n = null);
92
+ }, u = () => {
93
+ r.mounted = !1;
94
+ }, d = () => {
95
+ l(), e.duration && (n = setTimeout(() => {
96
+ u();
97
+ }, e.duration));
98
+ }, A = () => {
99
+ e.closeOnClickOverlay && (u(), t("close"));
93
100
  };
94
- const clickCover = () => {
95
- if (props.closeOnClickOverlay) {
96
- hide();
97
- emit("close");
98
- }
99
- };
100
- if (props.duration) {
101
- show();
102
- }
103
- watch(
104
- () => props.duration,
105
- (val) => {
106
- if (val) {
107
- show();
108
- }
101
+ e.duration && d(), H(
102
+ () => e.duration,
103
+ (E) => {
104
+ E && d();
109
105
  }
110
106
  );
111
- const hasIcon = computed(() => {
112
- if (props.type !== "text") {
113
- return true;
114
- } else {
115
- return !!props.icon;
116
- }
117
- });
118
- const toastBodyClass = computed(() => {
119
- return [
120
- "nut-toast",
121
- { "nut-toast-center": props.center },
122
- { "nut-toast-has-icon": hasIcon.value },
123
- { "nut-toast-cover": props.cover },
124
- { "nut-toast-loading": props.type === "loading" },
125
- props.customClass,
126
- "nut-toast-" + props.size
127
- ];
128
- });
129
- const toastIconWrapperClass = computed(() => {
130
- return ["nut-toast-icon-wrapper", { "nut-toast-icon-no-animation": !props.loadingRotate }];
131
- });
132
- const onAfterLeave = () => {
133
- clearTimer();
134
- props.unmount(props.id);
135
- props.onClose && props.onClose();
136
- };
107
+ const h = y(() => e.type !== "text" ? !0 : e.icon !== null), L = y(() => [
108
+ "nut-toast",
109
+ { "nut-toast-center": e.center },
110
+ { "nut-toast-has-icon": h.value },
111
+ { "nut-toast-cover": e.cover },
112
+ { "nut-toast-loading": e.type === "loading" },
113
+ e.customClass,
114
+ "nut-toast-" + e.size
115
+ ]), z = y(() => ["nut-toast-icon-wrapper", { "nut-toast-icon-no-animation": !e.loadingRotate }]);
137
116
  return {
138
- state,
139
- hide,
140
- clickCover,
141
- hasIcon,
142
- toastBodyClass,
143
- toastIconWrapperClass,
144
- onAfterLeave,
145
- renderIcon
117
+ state: r,
118
+ hide: u,
119
+ clickCover: A,
120
+ hasIcon: h,
121
+ toastBodyClass: L,
122
+ toastIconWrapperClass: z,
123
+ onAfterLeave: () => {
124
+ l(), e.unmount(e.id), e.onClose && e.onClose();
125
+ },
126
+ renderIcon: X
146
127
  };
147
128
  }
148
- });
149
- const _hoisted_1 = {
129
+ }), re = {
150
130
  key: 1,
151
131
  class: "nut-toast-title"
152
- };
153
- const _hoisted_2 = ["innerHTML"];
154
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
155
- return openBlock(), createBlock(Transition, {
132
+ }, ae = ["innerHTML"];
133
+ function ie(e, t, n, r, l, u) {
134
+ return f(), w(W, {
156
135
  name: "toast-fade",
157
- onAfterLeave: _ctx.onAfterLeave
136
+ onAfterLeave: e.onAfterLeave
158
137
  }, {
159
- default: withCtx(() => [
160
- withDirectives(createElementVNode("view", {
161
- class: normalizeClass(_ctx.toastBodyClass),
162
- style: normalizeStyle({
163
- bottom: _ctx.center ? "auto" : _ctx.bottom,
164
- "background-color": _ctx.coverColor
138
+ default: j(() => [
139
+ U(C("view", {
140
+ class: k(e.toastBodyClass),
141
+ style: S({
142
+ bottom: e.center ? "auto" : e.bottom,
143
+ "background-color": e.coverColor
165
144
  }),
166
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clickCover && _ctx.clickCover(...args))
145
+ onClick: t[0] || (t[0] = (...d) => e.clickCover && e.clickCover(...d))
167
146
  }, [
168
- createElementVNode("view", {
147
+ C("view", {
169
148
  class: "nut-toast-inner",
170
- style: normalizeStyle({
171
- "text-align": _ctx.textAlignCenter ? "center" : "left",
172
- "background-color": _ctx.bgColor
149
+ style: S({
150
+ "text-align": e.textAlignCenter ? "center" : "left",
151
+ "background-color": e.bgColor
173
152
  })
174
153
  }, [
175
- _ctx.hasIcon ? (openBlock(), createElementBlock("view", {
154
+ e.hasIcon ? (f(), T("view", {
176
155
  key: 0,
177
- class: normalizeClass(_ctx.toastIconWrapperClass)
156
+ class: k(e.toastIconWrapperClass)
178
157
  }, [
179
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderIcon(_ctx.icon)), { color: "#ffffff" }))
180
- ], 2)) : createCommentVNode("", true),
181
- _ctx.title ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
182
- createElementVNode("view", {
158
+ (f(), w(q(e.renderIcon(e.icon)), { color: "#ffffff" }))
159
+ ], 2)) : B("", !0),
160
+ e.title ? (f(), T("div", re, G(e.title), 1)) : B("", !0),
161
+ C("view", {
183
162
  class: "nut-toast-text",
184
- innerHTML: _ctx.msg
185
- }, null, 8, _hoisted_2)
163
+ innerHTML: e.msg
164
+ }, null, 8, ae)
186
165
  ], 4)
187
166
  ], 6), [
188
- [vShow, _ctx.state.mounted]
167
+ [J, e.state.mounted]
189
168
  ])
190
169
  ]),
191
170
  _: 1
192
171
  }, 8, ["onAfterLeave"]);
193
172
  }
194
- const Toast = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
195
- const defaultOptions = {
173
+ const v = /* @__PURE__ */ Y(oe, [["render", ie]]), g = {
196
174
  msg: "",
197
175
  id: "",
198
176
  duration: 2e3,
199
177
  //显示时间(毫秒)
200
- center: true,
178
+ center: !0,
201
179
  // 未实现
202
180
  type: "text",
203
181
  title: "",
@@ -206,115 +184,84 @@ const defaultOptions = {
206
184
  size: "base",
207
185
  iconSize: "20",
208
186
  icon: null,
209
- textAlignCenter: true,
187
+ textAlignCenter: !0,
210
188
  // 未实现
211
- loadingRotate: true,
189
+ loadingRotate: !0,
212
190
  // 未实现
213
191
  bgColor: "",
214
192
  onClose: null,
215
193
  // 未实现
216
194
  unmount: null,
217
- cover: false,
195
+ cover: !1,
218
196
  //透明遮罩层 // 未实现
219
197
  coverColor: "",
220
198
  // 未实现
221
- closeOnClickOverlay: false
199
+ closeOnClickOverlay: !1
222
200
  // 未实现
223
201
  };
224
- let idsMap = [];
225
- let optsMap = [];
226
- const clearToast = (id) => {
227
- if (id) {
228
- const container = document.getElementById(id);
229
- optsMap = optsMap.filter((item) => item.id !== id);
230
- idsMap = idsMap.filter((item) => item !== id);
231
- if (container) {
232
- document.body.removeChild(container);
233
- }
234
- } else {
235
- idsMap.forEach((item) => {
236
- const container = document.getElementById(item);
237
- if (container) {
238
- document.body.removeChild(container);
239
- }
240
- });
241
- optsMap = [];
242
- idsMap = [];
243
- }
244
- };
245
- const updateToast = (opts) => {
246
- const container = document.getElementById(opts.id);
247
- if (container) {
248
- const currentOpt = optsMap.find((item) => item.id === opts.id);
249
- if (currentOpt) {
250
- opts = { ...defaultOptions, ...currentOpt, ...opts };
251
- } else {
252
- opts = { ...defaultOptions, ...opts };
253
- }
254
- const instance = createVNode(Toast, opts);
255
- render(instance, container);
256
- return showToast;
257
- }
258
- };
259
- const mountToast = (opts) => {
260
- opts.unmount = clearToast;
261
- let _id;
262
- if (opts.id) {
263
- _id = opts.id;
264
- if (idsMap.find((item) => item === opts.id)) {
265
- return updateToast(opts);
266
- }
267
- } else {
268
- _id = new Date().getTime() + "";
202
+ let i = [], c = [];
203
+ const I = (e) => {
204
+ if (e) {
205
+ const t = document.getElementById(e);
206
+ c = c.filter((n) => n.id !== e), i = i.filter((n) => n !== e), t && document.body.removeChild(t);
207
+ } else
208
+ i.forEach((t) => {
209
+ const n = document.getElementById(t);
210
+ n && document.body.removeChild(n);
211
+ }), c = [], i = [];
212
+ }, le = (e) => {
213
+ const t = document.getElementById(e.id);
214
+ if (t) {
215
+ const n = c.find((l) => l.id === e.id);
216
+ n ? e = o(o(o({}, g), n), e) : e = o(o({}, g), e);
217
+ const r = K(v, e);
218
+ return P(r, t), O;
269
219
  }
270
- opts = { ...defaultOptions, ...opts };
271
- opts.id = _id;
272
- idsMap.push(opts.id);
273
- optsMap.push(opts);
274
- CreateComponent(opts, {
275
- wrapper: Toast
276
- });
277
- return showToast;
278
- };
279
- const errorMsg = (msg) => {
280
- if (!msg) {
220
+ }, s = (e) => {
221
+ e.unmount = I;
222
+ let t;
223
+ if (e.id) {
224
+ if (t = e.id, i.find((n) => n === e.id))
225
+ return le(e);
226
+ } else
227
+ t = (/* @__PURE__ */ new Date()).getTime() + "";
228
+ return e = o(o({}, g), e), e.id = t, i.push(e.id), c.push(e), Z(e, {
229
+ wrapper: v
230
+ }), O;
231
+ }, m = (e) => {
232
+ if (!e) {
281
233
  console.warn("[NutUI Toast]: msg不能为空");
282
234
  return;
283
235
  }
284
- };
285
- const showToast = {
286
- text(msg, opts = {}) {
287
- errorMsg(msg);
288
- return mountToast({ ...opts, type: "text", msg });
236
+ }, O = {
237
+ text(e, t = {}) {
238
+ return m(e), s(a(o({}, t), { type: "text", msg: e }));
289
239
  },
290
- success(msg, opts = {}) {
291
- errorMsg(msg);
292
- return mountToast({ icon: Success, ...opts, msg, type: "success" });
240
+ success(e, t = {}) {
241
+ return m(e), s(a(o({ icon: x }, t), { msg: e, type: "success" }));
293
242
  },
294
- fail(msg, opts = {}) {
295
- errorMsg(msg);
296
- return mountToast({ icon: Failure, ...opts, msg, type: "fail" });
243
+ fail(e, t = {}) {
244
+ return m(e), s(a(o({ icon: _ }, t), { msg: e, type: "fail" }));
297
245
  },
298
- warn(msg, opts = {}) {
299
- errorMsg(msg);
300
- return mountToast({ icon: Tips, ...opts, msg, type: "warn" });
246
+ warn(e, t = {}) {
247
+ return m(e), s(a(o({ icon: ee }, t), { msg: e, type: "warn" }));
301
248
  },
302
- loading(msg, opts = {}) {
303
- return mountToast({
304
- icon: Loading,
305
- ...opts,
306
- msg,
249
+ loading(e, t = {}) {
250
+ return s(a(o({
251
+ icon: te
252
+ }, t), {
253
+ msg: e,
307
254
  type: "loading"
308
- });
255
+ }));
309
256
  },
310
- hide(id) {
311
- clearToast(id);
257
+ hide(e) {
258
+ I(e);
312
259
  },
313
- install(app) {
314
- app.use(Toast);
260
+ install(e) {
261
+ e.use(v);
315
262
  }
316
263
  };
317
264
  export {
318
- Toast as default,
319
- showToast
265
+ v as default,
266
+ O as showToast
320
267
  };