@nutui/nutui 4.0.10-beta.1 → 4.0.11
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.
- package/CHANGELOG.md +23 -0
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +6316 -7237
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +78 -111
- package/dist/packages/_es/Address.js +250 -375
- package/dist/packages/_es/AddressList.js +269 -354
- package/dist/packages/_es/Animate.js +41 -58
- package/dist/packages/_es/Audio.js +128 -197
- package/dist/packages/_es/AudioOperate.js +60 -71
- package/dist/packages/_es/Avatar.js +66 -89
- package/dist/packages/_es/AvatarGroup.js +23 -31
- package/dist/packages/_es/Backtop.js +59 -99
- package/dist/packages/_es/Badge.js +36 -47
- package/dist/packages/_es/Barrage.js +68 -147
- package/dist/packages/_es/Button.js +47 -66
- package/dist/packages/_es/Calendar.js +135 -157
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +42 -56
- package/dist/packages/_es/Cascader.js +315 -474
- package/dist/packages/_es/Category.js +29 -39
- package/dist/packages/_es/CategoryPane.js +57 -83
- package/dist/packages/_es/Cell.js +56 -71
- package/dist/packages/_es/CellGroup.js +19 -27
- package/dist/packages/_es/Checkbox.js +109 -156
- package/dist/packages/_es/CheckboxGroup.js +38 -59
- package/dist/packages/_es/CircleProgress.js +67 -96
- package/dist/packages/_es/Col.js +23 -31
- package/dist/packages/_es/Collapse.js +33 -58
- package/dist/packages/_es/CollapseItem.js +78 -108
- package/dist/packages/_es/Comment.js +207 -279
- package/dist/packages/_es/ConfigProvider.js +37 -55
- package/dist/packages/_es/Countdown.js +100 -212
- package/dist/packages/_es/Countup.js +232 -445
- package/dist/packages/_es/DatePicker.js +162 -265
- package/dist/packages/_es/Dialog.js +161 -213
- package/dist/packages/_es/Divider.js +42 -57
- package/dist/packages/_es/Drag.js +70 -153
- package/dist/packages/_es/Ecard.js +64 -104
- package/dist/packages/_es/Elevator.js +143 -219
- package/dist/packages/_es/Ellipsis.js +95 -178
- package/dist/packages/_es/Empty.js +23 -39
- package/dist/packages/_es/FixedNav.js +93 -116
- package/dist/packages/_es/Form.js +107 -178
- package/dist/packages/_es/FormItem.js +48 -61
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +58 -84
- package/dist/packages/_es/Image.js +90 -129
- package/dist/packages/_es/ImagePreview.js +256 -412
- package/dist/packages/_es/Indicator.js +30 -34
- package/dist/packages/_es/InfiniteLoading.js +83 -136
- package/dist/packages/_es/Input.js +160 -264
- package/dist/packages/_es/InputNumber.js +81 -117
- package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
- package/dist/packages/_es/Invoice.js +104 -130
- package/dist/packages/_es/Layout.js +3 -4
- package/dist/packages/_es/List.js +117 -215
- package/dist/packages/_es/Menu.js +95 -150
- package/dist/packages/_es/MenuItem.js +109 -154
- package/dist/packages/_es/Navbar.js +103 -119
- package/dist/packages/_es/Noticebar.js +197 -312
- package/dist/packages/_es/Notify.js +110 -166
- package/dist/packages/_es/NumberKeyboard.js +127 -202
- package/dist/packages/_es/Overlay.js +52 -80
- package/dist/packages/_es/Pagination.js +70 -100
- package/dist/packages/_es/Picker.js +275 -437
- package/dist/packages/_es/Popover.js +122 -225
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +44 -82
- package/dist/packages/_es/Progress.js +63 -79
- package/dist/packages/_es/PullRefresh.js +95 -173
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +204 -347
- package/dist/packages/_es/Rate.js +92 -141
- package/dist/packages/_es/Row.js +21 -27
- package/dist/packages/_es/Searchbar.js +123 -174
- package/dist/packages/_es/ShortPassword.js +69 -93
- package/dist/packages/_es/SideNavbar.js +49 -80
- package/dist/packages/_es/SideNavbarItem.js +22 -32
- package/dist/packages/_es/Signature.js +83 -146
- package/dist/packages/_es/Skeleton.js +110 -130
- package/dist/packages/_es/Sku.js +250 -343
- package/dist/packages/_es/Step.js +59 -86
- package/dist/packages/_es/Steps.js +26 -31
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +52 -74
- package/dist/packages/_es/Swipe.js +83 -155
- package/dist/packages/_es/Swiper.js +174 -311
- package/dist/packages/_es/SwiperItem.js +28 -44
- package/dist/packages/_es/Switch.js +55 -68
- package/dist/packages/_es/TabPane.js +30 -41
- package/dist/packages/_es/Tabbar.js +41 -52
- package/dist/packages/_es/TabbarItem.js +61 -82
- package/dist/packages/_es/Table.js +109 -165
- package/dist/packages/_es/Tabs.js +240 -388
- package/dist/packages/_es/Tag.js +44 -61
- package/dist/packages/_es/Textarea.js +80 -124
- package/dist/packages/_es/TimeDetail.js +49 -76
- package/dist/packages/_es/TimePannel.js +34 -48
- package/dist/packages/_es/TimeSelect.js +47 -68
- package/dist/packages/_es/Toast.js +144 -218
- package/dist/packages/_es/Tour.js +138 -192
- package/dist/packages/_es/TrendArrow.js +57 -77
- package/dist/packages/_es/Uploader.js +234 -359
- package/dist/packages/_es/Video.js +191 -316
- package/dist/packages/_es/Watermark.js +84 -117
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
- package/dist/packages/_es/common-d218746f.js +116 -0
- package/dist/packages/_es/component-234624bc.js +89 -0
- package/dist/packages/_es/index-14dfadc4.js +561 -0
- package/dist/packages/_es/index-192a3ef6.js +29 -0
- package/dist/packages/_es/index-360c5092.js +210 -0
- package/dist/packages/_es/index-496e6e05.js +24 -0
- package/dist/packages/_es/index-50eed3d9.js +7 -0
- package/dist/packages/_es/index-53ec2d4d.js +34 -0
- package/dist/packages/_es/index-fadb0974.js +8 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
- package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
- package/dist/packages/_es/pxCheck-38173291.js +4 -0
- package/dist/packages/_es/raf-a74f1a06.js +16 -0
- package/dist/packages/_es/renderIcon-47498b32.js +5 -0
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +148 -45
- package/dist/styles/themes/jdb.scss +148 -45
- package/dist/styles/themes/jddkh.scss +148 -45
- package/dist/styles/themes/jdt.scss +148 -45
- package/dist/types/__VUE/address/index.vue.d.ts +1 -1
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
- package/dist/types/__VUE/image/index.vue.d.ts +2 -2
- package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
- package/dist/types/__VUE/searchbar/index.vue.d.ts +110 -3
- package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
- package/dist/types/__VUE/table/common.d.ts +55 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
- package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
- package/dist/packages/_es/common-b9a5e726.js +0 -145
- package/dist/packages/_es/component-81a4c1d0.js +0 -145
- package/dist/packages/_es/index-29892cda.js +0 -33
- package/dist/packages/_es/index-43c34ac6.js +0 -30
- package/dist/packages/_es/index-54d03fc1.js +0 -8
- package/dist/packages/_es/index-79c5dc33.js +0 -10
- package/dist/packages/_es/index-7a7385e4.js +0 -67
- package/dist/packages/_es/index-87422be8.js +0 -942
- package/dist/packages/_es/index-da0a7662.js +0 -259
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
- package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
- package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
- package/dist/packages/_es/raf-729dad54.js +0 -25
- package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, toDisplayString, renderSlot } from "vue";
|
|
2
|
-
import { c as
|
|
3
|
-
import { P as
|
|
4
|
-
import { _ as
|
|
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 } =
|
|
9
|
-
const _sfc_main = create({
|
|
8
|
+
const { componentName: S, create: w, translate: $ } = b("time-select"), g = w({
|
|
10
9
|
components: {
|
|
11
|
-
[
|
|
10
|
+
[m.name]: m
|
|
12
11
|
},
|
|
13
12
|
props: {
|
|
14
13
|
visible: {
|
|
15
14
|
type: Boolean,
|
|
16
|
-
defalut:
|
|
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:
|
|
35
|
+
default: !0
|
|
39
36
|
},
|
|
40
37
|
teleportDisable: {
|
|
41
38
|
type: Boolean,
|
|
42
|
-
default:
|
|
39
|
+
default: !1
|
|
43
40
|
}
|
|
44
41
|
},
|
|
45
42
|
emits: ["update:visible", "select"],
|
|
46
|
-
setup: (
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
})
|
|
53
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
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:
|
|
89
|
-
visible:
|
|
90
|
-
style:
|
|
91
|
-
"lock-scroll":
|
|
92
|
-
onClickOverlay:
|
|
93
|
-
onClickCloseIcon:
|
|
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:
|
|
96
|
-
|
|
97
|
-
class:
|
|
74
|
+
default: y(() => [
|
|
75
|
+
t("view", {
|
|
76
|
+
class: v(e.classes)
|
|
98
77
|
}, [
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
83
|
+
t("view", K, [
|
|
84
|
+
t("view", N, [
|
|
85
|
+
i(e.$slots, "pannel")
|
|
107
86
|
]),
|
|
108
|
-
|
|
109
|
-
|
|
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
|
|
96
|
+
const G = /* @__PURE__ */ C(g, [["render", E]]);
|
|
118
97
|
export {
|
|
119
|
-
|
|
98
|
+
G as default
|
|
120
99
|
};
|
|
@@ -1,31 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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";
|
|
21
|
-
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
22
|
-
import { r as renderIcon } from "./renderIcon-3d0fd47c.js";
|
|
23
|
-
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";
|
|
24
17
|
import "../locale/lang";
|
|
25
|
-
import { C as
|
|
26
|
-
import { Success, Failure, Tips, Loading } from "@nutui/icons-vue";
|
|
27
|
-
const { create } =
|
|
28
|
-
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({
|
|
29
21
|
components: {},
|
|
30
22
|
props: {
|
|
31
23
|
id: String,
|
|
@@ -36,7 +28,7 @@ const _sfc_main = create({
|
|
|
36
28
|
},
|
|
37
29
|
center: {
|
|
38
30
|
type: Boolean,
|
|
39
|
-
default:
|
|
31
|
+
default: !0
|
|
40
32
|
},
|
|
41
33
|
type: {
|
|
42
34
|
type: String,
|
|
@@ -57,11 +49,11 @@ const _sfc_main = create({
|
|
|
57
49
|
},
|
|
58
50
|
textAlignCenter: {
|
|
59
51
|
type: Boolean,
|
|
60
|
-
default:
|
|
52
|
+
default: !0
|
|
61
53
|
},
|
|
62
54
|
loadingRotate: {
|
|
63
55
|
type: Boolean,
|
|
64
|
-
default:
|
|
56
|
+
default: !0
|
|
65
57
|
},
|
|
66
58
|
bgColor: {
|
|
67
59
|
type: String,
|
|
@@ -71,7 +63,7 @@ const _sfc_main = create({
|
|
|
71
63
|
unmount: Function,
|
|
72
64
|
cover: {
|
|
73
65
|
type: Boolean,
|
|
74
|
-
default:
|
|
66
|
+
default: !1
|
|
75
67
|
},
|
|
76
68
|
coverColor: {
|
|
77
69
|
type: String,
|
|
@@ -83,142 +75,107 @@ const _sfc_main = create({
|
|
|
83
75
|
},
|
|
84
76
|
closeOnClickOverlay: {
|
|
85
77
|
type: Boolean,
|
|
86
|
-
default:
|
|
78
|
+
default: !1
|
|
87
79
|
}
|
|
88
80
|
},
|
|
89
81
|
emits: ["close"],
|
|
90
|
-
setup(
|
|
91
|
-
let
|
|
92
|
-
const
|
|
93
|
-
mounted:
|
|
82
|
+
setup(e, { emit: t }) {
|
|
83
|
+
let n;
|
|
84
|
+
const r = R({
|
|
85
|
+
mounted: !1
|
|
94
86
|
});
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
V(() => {
|
|
88
|
+
r.mounted = !0;
|
|
97
89
|
});
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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"));
|
|
106
100
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
hide();
|
|
112
|
-
}, props.duration);
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
const clickCover = () => {
|
|
116
|
-
if (props.closeOnClickOverlay) {
|
|
117
|
-
hide();
|
|
118
|
-
emit("close");
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
if (props.duration) {
|
|
122
|
-
show();
|
|
123
|
-
}
|
|
124
|
-
watch(
|
|
125
|
-
() => props.duration,
|
|
126
|
-
(val) => {
|
|
127
|
-
if (val) {
|
|
128
|
-
show();
|
|
129
|
-
}
|
|
101
|
+
e.duration && d(), H(
|
|
102
|
+
() => e.duration,
|
|
103
|
+
(E) => {
|
|
104
|
+
E && d();
|
|
130
105
|
}
|
|
131
106
|
);
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
"nut-toast",
|
|
142
|
-
{ "nut-toast-center": props.center },
|
|
143
|
-
{ "nut-toast-has-icon": hasIcon.value },
|
|
144
|
-
{ "nut-toast-cover": props.cover },
|
|
145
|
-
{ "nut-toast-loading": props.type === "loading" },
|
|
146
|
-
props.customClass,
|
|
147
|
-
"nut-toast-" + props.size
|
|
148
|
-
];
|
|
149
|
-
});
|
|
150
|
-
const toastIconWrapperClass = computed(() => {
|
|
151
|
-
return ["nut-toast-icon-wrapper", { "nut-toast-icon-no-animation": !props.loadingRotate }];
|
|
152
|
-
});
|
|
153
|
-
const onAfterLeave = () => {
|
|
154
|
-
clearTimer();
|
|
155
|
-
props.unmount(props.id);
|
|
156
|
-
props.onClose && props.onClose();
|
|
157
|
-
};
|
|
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 }]);
|
|
158
116
|
return {
|
|
159
|
-
state,
|
|
160
|
-
hide,
|
|
161
|
-
clickCover,
|
|
162
|
-
hasIcon,
|
|
163
|
-
toastBodyClass,
|
|
164
|
-
toastIconWrapperClass,
|
|
165
|
-
onAfterLeave
|
|
166
|
-
|
|
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
|
|
167
127
|
};
|
|
168
128
|
}
|
|
169
|
-
})
|
|
170
|
-
const _hoisted_1 = {
|
|
129
|
+
}), re = {
|
|
171
130
|
key: 1,
|
|
172
131
|
class: "nut-toast-title"
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return openBlock(), createBlock(Transition, {
|
|
132
|
+
}, ae = ["innerHTML"];
|
|
133
|
+
function ie(e, t, n, r, l, u) {
|
|
134
|
+
return f(), w(W, {
|
|
177
135
|
name: "toast-fade",
|
|
178
|
-
onAfterLeave:
|
|
136
|
+
onAfterLeave: e.onAfterLeave
|
|
179
137
|
}, {
|
|
180
|
-
default:
|
|
181
|
-
|
|
182
|
-
class:
|
|
183
|
-
style:
|
|
184
|
-
bottom:
|
|
185
|
-
"background-color":
|
|
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
|
|
186
144
|
}),
|
|
187
|
-
onClick:
|
|
145
|
+
onClick: t[0] || (t[0] = (...d) => e.clickCover && e.clickCover(...d))
|
|
188
146
|
}, [
|
|
189
|
-
|
|
147
|
+
C("view", {
|
|
190
148
|
class: "nut-toast-inner",
|
|
191
|
-
style:
|
|
192
|
-
"text-align":
|
|
193
|
-
"background-color":
|
|
149
|
+
style: S({
|
|
150
|
+
"text-align": e.textAlignCenter ? "center" : "left",
|
|
151
|
+
"background-color": e.bgColor
|
|
194
152
|
})
|
|
195
153
|
}, [
|
|
196
|
-
|
|
154
|
+
e.hasIcon ? (f(), T("view", {
|
|
197
155
|
key: 0,
|
|
198
|
-
class:
|
|
156
|
+
class: k(e.toastIconWrapperClass)
|
|
199
157
|
}, [
|
|
200
|
-
(
|
|
201
|
-
], 2)) :
|
|
202
|
-
|
|
203
|
-
|
|
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", {
|
|
204
162
|
class: "nut-toast-text",
|
|
205
|
-
innerHTML:
|
|
206
|
-
}, null, 8,
|
|
163
|
+
innerHTML: e.msg
|
|
164
|
+
}, null, 8, ae)
|
|
207
165
|
], 4)
|
|
208
166
|
], 6), [
|
|
209
|
-
[
|
|
167
|
+
[J, e.state.mounted]
|
|
210
168
|
])
|
|
211
169
|
]),
|
|
212
170
|
_: 1
|
|
213
171
|
}, 8, ["onAfterLeave"]);
|
|
214
172
|
}
|
|
215
|
-
const
|
|
216
|
-
const defaultOptions = {
|
|
173
|
+
const v = /* @__PURE__ */ Y(oe, [["render", ie]]), g = {
|
|
217
174
|
msg: "",
|
|
218
175
|
id: "",
|
|
219
176
|
duration: 2e3,
|
|
220
177
|
//显示时间(毫秒)
|
|
221
|
-
center:
|
|
178
|
+
center: !0,
|
|
222
179
|
// 未实现
|
|
223
180
|
type: "text",
|
|
224
181
|
title: "",
|
|
@@ -227,115 +184,84 @@ const defaultOptions = {
|
|
|
227
184
|
size: "base",
|
|
228
185
|
iconSize: "20",
|
|
229
186
|
icon: null,
|
|
230
|
-
textAlignCenter:
|
|
187
|
+
textAlignCenter: !0,
|
|
231
188
|
// 未实现
|
|
232
|
-
loadingRotate:
|
|
189
|
+
loadingRotate: !0,
|
|
233
190
|
// 未实现
|
|
234
191
|
bgColor: "",
|
|
235
192
|
onClose: null,
|
|
236
193
|
// 未实现
|
|
237
194
|
unmount: null,
|
|
238
|
-
cover:
|
|
195
|
+
cover: !1,
|
|
239
196
|
//透明遮罩层 // 未实现
|
|
240
197
|
coverColor: "",
|
|
241
198
|
// 未实现
|
|
242
|
-
closeOnClickOverlay:
|
|
199
|
+
closeOnClickOverlay: !1
|
|
243
200
|
// 未实现
|
|
244
201
|
};
|
|
245
|
-
let
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
document.body.removeChild(
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
optsMap = [];
|
|
263
|
-
idsMap = [];
|
|
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;
|
|
264
219
|
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
if (
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
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) {
|
|
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) {
|
|
302
233
|
console.warn("[NutUI Toast]: msg不能为空");
|
|
303
234
|
return;
|
|
304
235
|
}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
errorMsg(msg);
|
|
309
|
-
return mountToast(__spreadProps(__spreadValues({}, opts), { type: "text", msg }));
|
|
236
|
+
}, O = {
|
|
237
|
+
text(e, t = {}) {
|
|
238
|
+
return m(e), s(a(o({}, t), { type: "text", msg: e }));
|
|
310
239
|
},
|
|
311
|
-
success(
|
|
312
|
-
|
|
313
|
-
return mountToast(__spreadProps(__spreadValues({ icon: Success }, opts), { msg, type: "success" }));
|
|
240
|
+
success(e, t = {}) {
|
|
241
|
+
return m(e), s(a(o({ icon: x }, t), { msg: e, type: "success" }));
|
|
314
242
|
},
|
|
315
|
-
fail(
|
|
316
|
-
|
|
317
|
-
return mountToast(__spreadProps(__spreadValues({ icon: Failure }, opts), { msg, type: "fail" }));
|
|
243
|
+
fail(e, t = {}) {
|
|
244
|
+
return m(e), s(a(o({ icon: _ }, t), { msg: e, type: "fail" }));
|
|
318
245
|
},
|
|
319
|
-
warn(
|
|
320
|
-
|
|
321
|
-
return mountToast(__spreadProps(__spreadValues({ icon: Tips }, opts), { msg, type: "warn" }));
|
|
246
|
+
warn(e, t = {}) {
|
|
247
|
+
return m(e), s(a(o({ icon: ee }, t), { msg: e, type: "warn" }));
|
|
322
248
|
},
|
|
323
|
-
loading(
|
|
324
|
-
return
|
|
325
|
-
icon:
|
|
326
|
-
},
|
|
327
|
-
msg,
|
|
249
|
+
loading(e, t = {}) {
|
|
250
|
+
return s(a(o({
|
|
251
|
+
icon: te
|
|
252
|
+
}, t), {
|
|
253
|
+
msg: e,
|
|
328
254
|
type: "loading"
|
|
329
255
|
}));
|
|
330
256
|
},
|
|
331
|
-
hide(
|
|
332
|
-
|
|
257
|
+
hide(e) {
|
|
258
|
+
I(e);
|
|
333
259
|
},
|
|
334
|
-
install(
|
|
335
|
-
|
|
260
|
+
install(e) {
|
|
261
|
+
e.use(v);
|
|
336
262
|
}
|
|
337
263
|
};
|
|
338
264
|
export {
|
|
339
|
-
|
|
340
|
-
showToast
|
|
265
|
+
v as default,
|
|
266
|
+
O as showToast
|
|
341
267
|
};
|