zan-layer 1.0.2 → 1.0.3
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/lib/zan-layer.js +257 -253
- package/lib/zan-layer.umd.js +1 -1
- package/package.json +1 -1
package/lib/zan-layer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as M, computed as I, openBlock as d, createElementBlock as m, normalizeStyle as V, createCommentVNode as p, h as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as M, computed as I, openBlock as d, createElementBlock as m, normalizeStyle as V, createCommentVNode as p, h as Ee, renderSlot as ee, createVNode as te, unref as x, withModifiers as re, normalizeClass as N, createElementVNode as B, toDisplayString as P, ref as b, watch as j, onMounted as ye, nextTick as D, Fragment as R, renderList as Me, shallowRef as at, withDirectives as ke, vModelText as ot, vModelDynamic as st, useSlots as it, onUnmounted as ut, createBlock as A, Teleport as rt, Transition as ct, withCtx as ce, render as Z, isVNode as Se } from "vue";
|
|
2
|
+
const dt = /* @__PURE__ */ M({
|
|
3
3
|
name: "Shade",
|
|
4
4
|
__name: "Shade",
|
|
5
5
|
props: {
|
|
@@ -12,24 +12,24 @@ const ct = /* @__PURE__ */ M({
|
|
|
12
12
|
},
|
|
13
13
|
emits: ["shadeClick"],
|
|
14
14
|
setup(e, { emit: n }) {
|
|
15
|
-
const l = e, t = n,
|
|
15
|
+
const l = e, t = n, o = I(() => [
|
|
16
16
|
{
|
|
17
17
|
opacity: l.opacity,
|
|
18
18
|
position: l.teleportDisabled || l.teleport != "body" ? "absolute" : "fixed",
|
|
19
19
|
zIndex: l.index
|
|
20
20
|
},
|
|
21
21
|
l.shadeStyle
|
|
22
|
-
]),
|
|
22
|
+
]), s = () => {
|
|
23
23
|
t("shadeClick");
|
|
24
24
|
};
|
|
25
|
-
return (c,
|
|
25
|
+
return (c, a) => e.visible ? (d(), m("div", {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "zan-layer-shade",
|
|
28
|
-
style: V(
|
|
29
|
-
onClick:
|
|
28
|
+
style: V(o.value),
|
|
29
|
+
onClick: s
|
|
30
30
|
}, null, 4)) : p("", !0);
|
|
31
31
|
}
|
|
32
|
-
}),
|
|
32
|
+
}), ft = ["src"], mt = /* @__PURE__ */ M({
|
|
33
33
|
name: "Iframe",
|
|
34
34
|
__name: "Iframe",
|
|
35
35
|
props: {
|
|
@@ -37,13 +37,13 @@ const ct = /* @__PURE__ */ M({
|
|
|
37
37
|
},
|
|
38
38
|
setup(e) {
|
|
39
39
|
const n = e, l = I(() => n.src);
|
|
40
|
-
return (t,
|
|
40
|
+
return (t, o) => (d(), m("iframe", {
|
|
41
41
|
scrolling: "auto",
|
|
42
42
|
class: "zan-layer-iframe",
|
|
43
43
|
allowtransparency: "true",
|
|
44
44
|
frameborder: "0",
|
|
45
45
|
src: l.value
|
|
46
|
-
}, null, 8,
|
|
46
|
+
}, null, 8, ft));
|
|
47
47
|
}
|
|
48
48
|
}), oe = M({
|
|
49
49
|
name: "ZanRender",
|
|
@@ -57,25 +57,29 @@ const ct = /* @__PURE__ */ M({
|
|
|
57
57
|
return () => e.render();
|
|
58
58
|
}
|
|
59
59
|
}), ne = function(e) {
|
|
60
|
-
return typeof e == "function" ? e() : typeof e == "string" ?
|
|
60
|
+
return typeof e == "function" ? e() : typeof e == "string" ? Ee("span", e) : e;
|
|
61
61
|
};
|
|
62
|
-
function
|
|
62
|
+
function Ae() {
|
|
63
63
|
const e = [], n = "0123456789abcdef";
|
|
64
64
|
for (let t = 0; t < 36; t++)
|
|
65
65
|
e[t] = n.substr(Math.floor(Math.random() * 16), 1);
|
|
66
66
|
return e[14] = "4", e[19] = n.substr(e[19] & 3 | 8, 1), e[8] = e[13] = e[18] = e[23] = "-", e.join("").replaceAll("-", "");
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
return e != "drawer" && e != 4 ?
|
|
68
|
+
function vt(e, n, l) {
|
|
69
|
+
return e != "drawer" && e != 4 ? yt(n) : De(l, n);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
return e
|
|
71
|
+
function yt(e) {
|
|
72
|
+
return e == null || e === "auto" ? [] : typeof e == "string" ? [e] : e[1] && e[1] === "auto" ? e[0] && e[0] === "auto" ? [] : [e[0]] : e[0] && e[0] === "auto" ? e[1] && e[1] != "auto" ? [void 0, e[1]] : [] : [...e];
|
|
73
|
+
}
|
|
74
|
+
function De(e, n = "30%") {
|
|
75
|
+
return n == null && (n = "30%"), n instanceof Array ? n : (n === "auto" && (n = "30%"), e === "l" || e === "r" || e === "lt" || e === "lb" || e === "rt" || e === "rb" ? [n, "100%"] : e === "t" || e === "b" || e === "tr" || e === "tl" || e === "br" || e === "bl" ? ["100%", n] : [n, "100%"]);
|
|
73
76
|
}
|
|
74
|
-
function
|
|
75
|
-
return
|
|
77
|
+
function Le(e) {
|
|
78
|
+
return e == null || e === "" ? "0px" : e;
|
|
76
79
|
}
|
|
77
80
|
function de(e = "auto", n, l) {
|
|
78
|
-
|
|
81
|
+
e == null && (e = "auto");
|
|
82
|
+
const t = Array.isArray(n) ? n : [], o = Le(t[0]), s = Le(t[1]), c = [
|
|
79
83
|
"t",
|
|
80
84
|
"r",
|
|
81
85
|
"b",
|
|
@@ -89,102 +93,102 @@ function de(e = "auto", n, l) {
|
|
|
89
93
|
"rb",
|
|
90
94
|
"br"
|
|
91
95
|
], a = [];
|
|
92
|
-
return e === "auto" && l == 4 && (e = "r"), typeof e == "string" ?
|
|
96
|
+
return e === "auto" && l == 4 && (e = "r"), typeof e == "string" ? c.indexOf(e) > -1 ? (e === "t" && (a[0] = "0px", a[1] = "calc(50% - " + o + "/2)"), e === "l" && (a[0] = "calc(50% - " + s + "/2)", a[1] = "0px"), e === "b" && (a[0] = "calc(100% - " + s + ")", a[1] = "calc(50% - " + o + "/2)"), e === "r" && (a[0] = "calc(50% - " + s + "/2)", a[1] = "calc(100% - " + o + ")"), (e === "lt" || e === "tl") && (a[0] = "0px", a[1] = "0px"), (e === "lb" || e === "bl") && (a[0] = "calc(100% - " + s + ")", a[1] = "0px"), (e === "rt" || e === "tr") && (a[0] = "0px", a[1] = "calc(100% - " + o + ")"), (e === "rb" || e === "br") && (a[0] = "calc(100% - " + s + ")", a[1] = "calc(100% - " + o + ")")) : e == "auto" ? (a[0] = "calc(50% - " + s + "/2)", a[1] = "calc(50% - " + o + "/2)") : (a[0] = e, a[1] = "calc(50% - " + o + "/2)") : e && e[0] !== void 0 && e[1] !== void 0 ? (a[0] = e[0], a[1] = e[1]) : (a[0] = "calc(50% - " + s + "/2)", a[1] = "calc(50% - " + o + "/2)"), a;
|
|
93
97
|
}
|
|
94
|
-
function
|
|
98
|
+
function pt(e) {
|
|
95
99
|
return e === "dialog" || e == 0 ? 0 : e === "page" || e == 1 ? 1 : e === "iframe" || e == 2 ? 2 : e === "loading" || e == 3 ? 3 : e === "drawer" || e == 4 ? 4 : e === "photos" || e == 5 ? 5 : e === "notify" || e == 6 ? 6 : e === "prompt" || e == 7 ? 7 : 0;
|
|
96
100
|
}
|
|
97
|
-
function
|
|
101
|
+
function $e() {
|
|
98
102
|
return { w: "100%", h: "100%" };
|
|
99
103
|
}
|
|
100
|
-
function
|
|
104
|
+
function Ie() {
|
|
101
105
|
return { t: "0px", l: "0px" };
|
|
102
106
|
}
|
|
103
|
-
function
|
|
104
|
-
var t,
|
|
105
|
-
const n = (t = getComputedStyle(e, null)) == null ? void 0 : t.width, l = (
|
|
107
|
+
function Be(e) {
|
|
108
|
+
var t, o;
|
|
109
|
+
const n = (t = getComputedStyle(e, null)) == null ? void 0 : t.width, l = (o = getComputedStyle(e, null)) == null ? void 0 : o.height;
|
|
106
110
|
return [n, l];
|
|
107
111
|
}
|
|
108
112
|
const Q = [];
|
|
109
113
|
function q(e, n) {
|
|
110
114
|
let l = 0;
|
|
111
115
|
if (n) {
|
|
112
|
-
const t = Q.findIndex((
|
|
116
|
+
const t = Q.findIndex((o) => o === void 0);
|
|
113
117
|
t === -1 ? (Q.push(e), l = Q.length - 1) : (Q[t] = e, l = t);
|
|
114
118
|
} else
|
|
115
119
|
delete Q[Q.findIndex((t) => t == e)], l = -1;
|
|
116
120
|
return l;
|
|
117
121
|
}
|
|
118
|
-
function
|
|
122
|
+
function Oe(e, n = !1) {
|
|
119
123
|
const l = ["rl"], t = "zan-layer-drawer-anim zan-layer-anim";
|
|
120
124
|
return e === "l" || e === "lt" || e === "lb" ? l[0] = "lr" : e === "r" || e === "rt" || e === "rb" ? l[0] = "rl" : e === "t" || e === "tr" || e === "tl" ? l[0] = "tb" : (e === "b" || e === "br" || e === "bl") && (l[0] = "bt"), n ? `${t}-${l[0]}-close` : `${t}-${l[0]}`;
|
|
121
125
|
}
|
|
122
|
-
async function
|
|
126
|
+
async function Fe(e, n) {
|
|
123
127
|
const l = new Image();
|
|
124
|
-
return l.src = e, new Promise((
|
|
128
|
+
return l.src = e, new Promise((o, s) => {
|
|
125
129
|
if (l.complete) {
|
|
126
|
-
|
|
130
|
+
o(t(l));
|
|
127
131
|
return;
|
|
128
132
|
}
|
|
129
133
|
const c = L.load(2, { shadeOpacity: "0" });
|
|
130
134
|
l.onload = () => {
|
|
131
|
-
L.close(c),
|
|
135
|
+
L.close(c), o(t(l));
|
|
132
136
|
}, l.onerror = () => {
|
|
133
|
-
L.close(c), L.msg("图片加载失败"),
|
|
137
|
+
L.close(c), L.msg("图片加载失败"), s(!1);
|
|
134
138
|
};
|
|
135
139
|
});
|
|
136
|
-
function t(
|
|
137
|
-
const
|
|
138
|
-
if (
|
|
139
|
-
const
|
|
140
|
-
|
|
140
|
+
function t(o) {
|
|
141
|
+
const s = [o.width, o.height], c = [window.innerWidth - 250, window.innerHeight - 250];
|
|
142
|
+
if (s[0] > c[0] || s[1] > c[1]) {
|
|
143
|
+
const a = [s[0] / c[0], s[1] / c[1]];
|
|
144
|
+
a[0] > a[1] ? (s[0] = s[0] / a[0], s[1] = s[1] / a[0]) : a[0] < a[1] && (s[0] = s[0] / a[1], s[1] = s[1] / a[1]);
|
|
141
145
|
}
|
|
142
|
-
return [
|
|
146
|
+
return [s[0] + "px", s[1] + "px"];
|
|
143
147
|
}
|
|
144
148
|
}
|
|
145
149
|
function me(e, n) {
|
|
146
150
|
const l = document.getElementsByClassName(e);
|
|
147
151
|
for (let t = 0; t < l.length; t++) {
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
return
|
|
152
|
+
const o = l[t];
|
|
153
|
+
if (o.id === n)
|
|
154
|
+
return o;
|
|
151
155
|
}
|
|
152
156
|
}
|
|
153
|
-
function
|
|
157
|
+
function ht(e, n, l) {
|
|
154
158
|
const t = ["lt", "lb", "rt", "rb"];
|
|
155
|
-
let
|
|
159
|
+
let o = "0", s = "0", a = 15;
|
|
156
160
|
window.NotifiyQueen = window.NotifiyQueen || [];
|
|
157
|
-
const
|
|
161
|
+
const i = window.NotifiyQueen;
|
|
158
162
|
(typeof e != "string" || t.indexOf(e) === -1) && (e = "rt");
|
|
159
|
-
const f =
|
|
163
|
+
const f = i.filter((u) => {
|
|
160
164
|
if (u.offset === e)
|
|
161
165
|
return u;
|
|
162
166
|
});
|
|
163
167
|
let r = f.length > 0 ? f[f.length - 1] : null;
|
|
164
168
|
if (r)
|
|
165
169
|
if (r = me("zan-layer", r.id), e === "rt" || e === "lt")
|
|
166
|
-
|
|
170
|
+
a += r.offsetHeight + parseFloat(r.style.top);
|
|
167
171
|
else {
|
|
168
172
|
const u = parseFloat(r.style.top.split(" - ")[1]);
|
|
169
|
-
|
|
173
|
+
a += r.offsetHeight + u;
|
|
170
174
|
}
|
|
171
175
|
else
|
|
172
|
-
(e === "rb" || e === "lb") && (
|
|
173
|
-
return e === "rt" ? (
|
|
176
|
+
(e === "rb" || e === "lb") && (a += parseFloat(n[1]));
|
|
177
|
+
return e === "rt" ? (o = a + "px", s = "calc(100% - " + (parseFloat(n[0]) + 15) + "px)") : e === "rb" ? (o = "calc(100% - " + a + "px)", s = "calc(100% - " + (parseFloat(n[0]) + 15) + "px)") : e === "lt" ? (o = a + "px", s = "15px") : e === "lb" && (o = "calc(100% - " + a + "px)", s = "15px"), i.push({
|
|
174
178
|
id: l,
|
|
175
179
|
offset: e
|
|
176
|
-
}), [
|
|
180
|
+
}), [o, s];
|
|
177
181
|
}
|
|
178
|
-
function
|
|
182
|
+
function gt(e) {
|
|
179
183
|
const n = me("zan-layer", e);
|
|
180
184
|
if (!n) return;
|
|
181
185
|
const l = 15, t = n.offsetHeight;
|
|
182
186
|
window.NotifiyQueen = window.NotifiyQueen || [];
|
|
183
|
-
const
|
|
187
|
+
const o = window.NotifiyQueen, s = o.findIndex((r) => r.id === e), c = o[s].offset, a = o.filter((r) => {
|
|
184
188
|
if (r.offset === c)
|
|
185
189
|
return r;
|
|
186
|
-
}),
|
|
187
|
-
|
|
190
|
+
}), i = a.findIndex((r) => r.id === e);
|
|
191
|
+
a.slice(i + 1).forEach((r) => {
|
|
188
192
|
const u = me("zan-layer", r.id);
|
|
189
193
|
if (c === "rt" || c === "lt")
|
|
190
194
|
u.style.top = parseFloat(u.style.top) - l - t + "px";
|
|
@@ -192,14 +196,14 @@ function ht(e) {
|
|
|
192
196
|
const y = parseFloat(u.style.top.split(" - ")[1]) - l - t;
|
|
193
197
|
u.style.top = "calc(100% - " + y + "px)";
|
|
194
198
|
}
|
|
195
|
-
}),
|
|
199
|
+
}), o.splice(s, 1);
|
|
196
200
|
}
|
|
197
|
-
function
|
|
201
|
+
function xt(e) {
|
|
198
202
|
const n = "zan-layer-drawer-anim zan-layer-anim";
|
|
199
203
|
let l = "";
|
|
200
204
|
return e === "lt" || e === "lb" ? l = "lr" : l = "rl", `${n}-${l}`;
|
|
201
205
|
}
|
|
202
|
-
const
|
|
206
|
+
const bt = /* @__PURE__ */ M({
|
|
203
207
|
name: "Header",
|
|
204
208
|
__name: "Header",
|
|
205
209
|
props: {
|
|
@@ -209,7 +213,7 @@ const xt = /* @__PURE__ */ M({
|
|
|
209
213
|
},
|
|
210
214
|
setup(e) {
|
|
211
215
|
const n = e, l = I(() => [n.move ? "cursor: move" : "", n.titleStyle]);
|
|
212
|
-
return (t,
|
|
216
|
+
return (t, o) => (d(), m("div", {
|
|
213
217
|
class: "zan-layer-title",
|
|
214
218
|
style: V(l.value)
|
|
215
219
|
}, [
|
|
@@ -220,7 +224,7 @@ const xt = /* @__PURE__ */ M({
|
|
|
220
224
|
])
|
|
221
225
|
], 4));
|
|
222
226
|
}
|
|
223
|
-
}),
|
|
227
|
+
}), zt = /* @__PURE__ */ M({
|
|
224
228
|
name: "Footer",
|
|
225
229
|
__name: "Footer",
|
|
226
230
|
props: {
|
|
@@ -239,7 +243,7 @@ const xt = /* @__PURE__ */ M({
|
|
|
239
243
|
])
|
|
240
244
|
], 4));
|
|
241
245
|
}
|
|
242
|
-
}),
|
|
246
|
+
}), Ct = { class: "zan-layer-setwin" }, wt = { class: "zan-tooltip" }, kt = { class: "zan-tooltip" }, St = /* @__PURE__ */ M({
|
|
243
247
|
name: "HeaderBtn",
|
|
244
248
|
__name: "HeaderBtn",
|
|
245
249
|
props: {
|
|
@@ -250,55 +254,55 @@ const xt = /* @__PURE__ */ M({
|
|
|
250
254
|
},
|
|
251
255
|
emits: ["onMin", "onMax", "onClose"],
|
|
252
256
|
setup(e, { emit: n }) {
|
|
253
|
-
const l = e, t = n,
|
|
257
|
+
const l = e, t = n, o = () => {
|
|
254
258
|
t("onMin");
|
|
255
|
-
},
|
|
259
|
+
}, s = () => {
|
|
256
260
|
t("onMax");
|
|
257
261
|
}, c = () => {
|
|
258
262
|
t("onClose");
|
|
259
263
|
};
|
|
260
|
-
return (
|
|
264
|
+
return (a, i) => (d(), m("span", Ct, [
|
|
261
265
|
l.maxmin && !l.max ? (d(), m("i", {
|
|
262
266
|
key: 0,
|
|
263
267
|
class: N(["zan-icon-btn", l.min ? "zan-icon-full" : "zan-icon-min"]),
|
|
264
|
-
onClick: re(
|
|
268
|
+
onClick: re(o, ["stop"])
|
|
265
269
|
}, [
|
|
266
|
-
B("span",
|
|
270
|
+
B("span", wt, P(l.min ? "还原" : "最小化"), 1)
|
|
267
271
|
], 2)) : p("", !0),
|
|
268
272
|
l.maxmin && !l.min ? (d(), m("i", {
|
|
269
273
|
key: 1,
|
|
270
274
|
class: N(["zan-icon-btn", l.max ? "zan-icon-restore" : "zan-icon-max"]),
|
|
271
|
-
onClick: re(
|
|
275
|
+
onClick: re(s, ["stop"])
|
|
272
276
|
}, [
|
|
273
|
-
B("span",
|
|
277
|
+
B("span", kt, P(l.max ? "还原" : "最大化"), 1)
|
|
274
278
|
], 2)) : p("", !0),
|
|
275
279
|
l.closeBtn ? (d(), m("i", {
|
|
276
280
|
key: 2,
|
|
277
281
|
class: N(["zan-icon-btn zan-icon-close-btn", `zan-layer-close${e.closeBtn}`]),
|
|
278
282
|
onClick: re(c, ["stop"])
|
|
279
|
-
}, [...
|
|
283
|
+
}, [...i[0] || (i[0] = [
|
|
280
284
|
B("span", { class: "zan-tooltip" }, "关闭", -1)
|
|
281
285
|
])], 2)) : p("", !0)
|
|
282
286
|
]));
|
|
283
287
|
}
|
|
284
|
-
}),
|
|
288
|
+
}), Lt = (e, n) => {
|
|
285
289
|
const l = e.__vccOpts || e;
|
|
286
|
-
for (const [t,
|
|
287
|
-
l[t] =
|
|
290
|
+
for (const [t, o] of n)
|
|
291
|
+
l[t] = o;
|
|
288
292
|
return l;
|
|
289
|
-
},
|
|
293
|
+
}, $t = /* @__PURE__ */ Lt(St, [["__scopeId", "data-v-8d683fcb"]]), It = { class: "zan-layer-phimg" }, Bt = ["src"], Ot = {
|
|
290
294
|
key: 0,
|
|
291
295
|
class: "zan-layer-imgsee"
|
|
292
|
-
},
|
|
296
|
+
}, Ft = {
|
|
293
297
|
key: 0,
|
|
294
298
|
class: "zan-layer-imguide"
|
|
295
|
-
},
|
|
299
|
+
}, Ht = {
|
|
296
300
|
key: 0,
|
|
297
301
|
class: "thumb-row"
|
|
298
|
-
},
|
|
302
|
+
}, Et = ["onClick"], Mt = ["src"], At = {
|
|
299
303
|
key: 1,
|
|
300
304
|
class: "zan-layer-imgtit"
|
|
301
|
-
},
|
|
305
|
+
}, Dt = { key: 0 }, Nt = { key: 1 }, Vt = /* @__PURE__ */ M({
|
|
302
306
|
name: "Photos",
|
|
303
307
|
__name: "Photos",
|
|
304
308
|
props: {
|
|
@@ -307,13 +311,13 @@ const xt = /* @__PURE__ */ M({
|
|
|
307
311
|
},
|
|
308
312
|
emits: ["resetCalculationPohtosArea"],
|
|
309
313
|
setup(e, { emit: n }) {
|
|
310
|
-
const l = n, t = e,
|
|
311
|
-
j(
|
|
312
|
-
l("resetCalculationPohtosArea",
|
|
314
|
+
const l = n, t = e, o = b(t.startIndex);
|
|
315
|
+
j(o, () => {
|
|
316
|
+
l("resetCalculationPohtosArea", o.value);
|
|
313
317
|
});
|
|
314
|
-
const
|
|
315
|
-
let r =
|
|
316
|
-
r < 0 && (r = t.imgList.length - 1), r >= t.imgList.length && (r = 0),
|
|
318
|
+
const s = (i) => {
|
|
319
|
+
let r = o.value + i;
|
|
320
|
+
r < 0 && (r = t.imgList.length - 1), r >= t.imgList.length && (r = 0), o.value = r;
|
|
317
321
|
}, c = b(!1);
|
|
318
322
|
ye(() => {
|
|
319
323
|
D(() => {
|
|
@@ -322,62 +326,62 @@ const xt = /* @__PURE__ */ M({
|
|
|
322
326
|
}, 400);
|
|
323
327
|
});
|
|
324
328
|
});
|
|
325
|
-
const
|
|
326
|
-
let
|
|
329
|
+
const a = I(() => {
|
|
330
|
+
let i = !1;
|
|
327
331
|
return t.imgList.forEach((f) => {
|
|
328
|
-
f.thumb && (
|
|
329
|
-
}),
|
|
332
|
+
f.thumb && (i = !0);
|
|
333
|
+
}), i;
|
|
330
334
|
});
|
|
331
|
-
return (
|
|
335
|
+
return (i, f) => (d(), m("div", It, [
|
|
332
336
|
B("img", {
|
|
333
|
-
src: e.imgList[
|
|
334
|
-
}, null, 8,
|
|
335
|
-
e.imgList.length > 0 ? (d(), m("div",
|
|
336
|
-
e.imgList.length > 1 ? (d(), m("span",
|
|
337
|
+
src: e.imgList[o.value].src
|
|
338
|
+
}, null, 8, Bt),
|
|
339
|
+
e.imgList.length > 0 ? (d(), m("div", Ot, [
|
|
340
|
+
e.imgList.length > 1 ? (d(), m("span", Ft, [
|
|
337
341
|
B("a", {
|
|
338
342
|
href: "javascript:;",
|
|
339
343
|
class: "zan-layer-iconext zan-layer-imgprev",
|
|
340
|
-
onClick: f[0] || (f[0] = (r) =>
|
|
344
|
+
onClick: f[0] || (f[0] = (r) => s(-1))
|
|
341
345
|
}, "‹"),
|
|
342
346
|
B("a", {
|
|
343
347
|
href: "javascript:;",
|
|
344
348
|
class: "zan-layer-iconext zan-layer-imgnext",
|
|
345
|
-
onClick: f[1] || (f[1] = (r) =>
|
|
349
|
+
onClick: f[1] || (f[1] = (r) => s(1))
|
|
346
350
|
}, "›")
|
|
347
351
|
])) : p("", !0),
|
|
348
|
-
e.imgList.length > 1 || e.imgList[
|
|
352
|
+
e.imgList.length > 1 || e.imgList[o.value].alt ? (d(), m("div", {
|
|
349
353
|
key: 1,
|
|
350
354
|
class: "zan-layer-imgbar",
|
|
351
355
|
style: V({ opacity: c.value ? 1 : 0 })
|
|
352
356
|
}, [
|
|
353
|
-
|
|
354
|
-
(d(!0), m(R, null,
|
|
357
|
+
a.value ? (d(), m("div", Ht, [
|
|
358
|
+
(d(!0), m(R, null, Me(e.imgList, (r, u) => (d(), m("div", {
|
|
355
359
|
class: "thumb-box",
|
|
356
360
|
key: "thumb-box" + u,
|
|
357
|
-
onClick: (y) =>
|
|
361
|
+
onClick: (y) => o.value = u
|
|
358
362
|
}, [
|
|
359
363
|
B("img", {
|
|
360
364
|
src: r.thumb
|
|
361
|
-
}, null, 8,
|
|
362
|
-
], 8,
|
|
365
|
+
}, null, 8, Mt)
|
|
366
|
+
], 8, Et))), 128)),
|
|
363
367
|
B("div", {
|
|
364
368
|
class: "thumb-box-border",
|
|
365
369
|
style: V({
|
|
366
|
-
left: `calc(calc( calc(100% - ${100 * e.imgList.length}px) / 2) + ${
|
|
370
|
+
left: `calc(calc( calc(100% - ${100 * e.imgList.length}px) / 2) + ${o.value * 100}px)`
|
|
367
371
|
})
|
|
368
372
|
}, null, 4)
|
|
369
|
-
])) : (d(), m("span",
|
|
370
|
-
e.imgList[
|
|
371
|
-
e.imgList.length > 1 ? (d(), m("em",
|
|
373
|
+
])) : (d(), m("span", At, [
|
|
374
|
+
e.imgList[o.value].alt ? (d(), m("span", Dt, P(e.imgList[o.value].alt), 1)) : p("", !0),
|
|
375
|
+
e.imgList.length > 1 ? (d(), m("em", Nt, P(o.value + 1) + " / " + P(e.imgList.length), 1)) : p("", !0)
|
|
372
376
|
]))
|
|
373
377
|
], 4)) : p("", !0)
|
|
374
378
|
])) : p("", !0)
|
|
375
379
|
]));
|
|
376
380
|
}
|
|
377
|
-
}),
|
|
381
|
+
}), Pt = { class: "title" }, Tt = {
|
|
378
382
|
key: 0,
|
|
379
383
|
class: "content"
|
|
380
|
-
},
|
|
384
|
+
}, jt = ["innerHTML"], Rt = /* @__PURE__ */ M({
|
|
381
385
|
name: "Notifiy",
|
|
382
386
|
__name: "Notifiy",
|
|
383
387
|
props: {
|
|
@@ -389,36 +393,36 @@ const xt = /* @__PURE__ */ M({
|
|
|
389
393
|
},
|
|
390
394
|
emits: ["close"],
|
|
391
395
|
setup(e, { emit: n }) {
|
|
392
|
-
const l = e, t = n,
|
|
396
|
+
const l = e, t = n, o = at(null), s = () => {
|
|
393
397
|
t("close");
|
|
394
398
|
};
|
|
395
|
-
function c(
|
|
396
|
-
let f =
|
|
397
|
-
|
|
399
|
+
function c(a, i) {
|
|
400
|
+
let f = a.className, r = f != "" ? " " : "", u = f + r + i;
|
|
401
|
+
a.className = u;
|
|
398
402
|
}
|
|
399
403
|
return ye(() => {
|
|
400
404
|
D(() => {
|
|
401
405
|
setTimeout(() => {
|
|
402
|
-
var
|
|
403
|
-
(
|
|
404
|
-
(r = (f =
|
|
406
|
+
var a, i, f, r;
|
|
407
|
+
(i = (a = o.value) == null ? void 0 : a.parentElement) != null && i.parentElement && c(
|
|
408
|
+
(r = (f = o.value) == null ? void 0 : f.parentElement) == null ? void 0 : r.parentElement,
|
|
405
409
|
"zan-layer-notifiy-transition"
|
|
406
410
|
);
|
|
407
411
|
}, 300);
|
|
408
412
|
});
|
|
409
|
-
}), (
|
|
413
|
+
}), (a, i) => (d(), m("div", {
|
|
410
414
|
class: "zan-layer-notifiy-wrapper",
|
|
411
415
|
ref_key: "notifyRef",
|
|
412
|
-
ref:
|
|
416
|
+
ref: o
|
|
413
417
|
}, [
|
|
414
|
-
B("h2",
|
|
418
|
+
B("h2", Pt, [
|
|
415
419
|
e.icon ? (d(), m("i", {
|
|
416
420
|
key: 0,
|
|
417
421
|
class: N(e.iconClass)
|
|
418
422
|
}, null, 2)) : p("", !0),
|
|
419
423
|
B("span", null, P(e.title), 1)
|
|
420
424
|
]),
|
|
421
|
-
!e.isHtmlFragment && e.content ? (d(), m("div",
|
|
425
|
+
!e.isHtmlFragment && e.content ? (d(), m("div", Tt, [
|
|
422
426
|
te(oe, {
|
|
423
427
|
render: () => x(ne)(l.content)
|
|
424
428
|
}, null, 8, ["render"])
|
|
@@ -426,11 +430,11 @@ const xt = /* @__PURE__ */ M({
|
|
|
426
430
|
key: 1,
|
|
427
431
|
class: "content",
|
|
428
432
|
innerHTML: e.content
|
|
429
|
-
}, null, 8,
|
|
433
|
+
}, null, 8, jt)) : p("", !0),
|
|
430
434
|
B("i", {
|
|
431
435
|
class: "zan-icon-close",
|
|
432
|
-
onClick:
|
|
433
|
-
}, [...
|
|
436
|
+
onClick: s
|
|
437
|
+
}, [...i[0] || (i[0] = [
|
|
434
438
|
B("svg", {
|
|
435
439
|
viewBox: "0 0 1024 1024",
|
|
436
440
|
width: "16",
|
|
@@ -444,7 +448,7 @@ const xt = /* @__PURE__ */ M({
|
|
|
444
448
|
])])
|
|
445
449
|
], 512));
|
|
446
450
|
}
|
|
447
|
-
}),
|
|
451
|
+
}), _t = ["maxlength", "placeholder"], Wt = ["type", "placeholder"], Xt = /* @__PURE__ */ M({
|
|
448
452
|
name: "Prompt",
|
|
449
453
|
__name: "Prompt",
|
|
450
454
|
props: {
|
|
@@ -455,7 +459,7 @@ const xt = /* @__PURE__ */ M({
|
|
|
455
459
|
},
|
|
456
460
|
emits: ["update:promptValue"],
|
|
457
461
|
setup(e, { emit: n }) {
|
|
458
|
-
const l = e, t = b(l.promptValue),
|
|
462
|
+
const l = e, t = b(l.promptValue), o = I(() => {
|
|
459
463
|
switch (typeof l.formType) {
|
|
460
464
|
case "string":
|
|
461
465
|
return l.formType === "textarea";
|
|
@@ -464,31 +468,31 @@ const xt = /* @__PURE__ */ M({
|
|
|
464
468
|
default:
|
|
465
469
|
return !1;
|
|
466
470
|
}
|
|
467
|
-
}),
|
|
471
|
+
}), s = I(
|
|
468
472
|
() => l.formType == 1 || l.formType == "password"
|
|
469
473
|
);
|
|
470
|
-
return (c,
|
|
474
|
+
return (c, a) => o.value ? ke((d(), m("textarea", {
|
|
471
475
|
key: 0,
|
|
472
|
-
onInput:
|
|
473
|
-
"onUpdate:modelValue":
|
|
476
|
+
onInput: a[0] || (a[0] = (i) => c.$emit("update:promptValue", t.value)),
|
|
477
|
+
"onUpdate:modelValue": a[1] || (a[1] = (i) => t.value = i),
|
|
474
478
|
maxlength: l.maxLength,
|
|
475
479
|
placeholder: l.placeholder,
|
|
476
480
|
class: "zan-textarea"
|
|
477
|
-
}, null, 40,
|
|
478
|
-
[
|
|
481
|
+
}, null, 40, _t)), [
|
|
482
|
+
[ot, t.value]
|
|
479
483
|
]) : ke((d(), m("input", {
|
|
480
484
|
key: 1,
|
|
481
|
-
onInput:
|
|
482
|
-
"onUpdate:modelValue":
|
|
483
|
-
type:
|
|
485
|
+
onInput: a[2] || (a[2] = (i) => c.$emit("update:promptValue", t.value)),
|
|
486
|
+
"onUpdate:modelValue": a[3] || (a[3] = (i) => t.value = i),
|
|
487
|
+
type: s.value ? "password" : "text",
|
|
484
488
|
placeholder: l.placeholder,
|
|
485
489
|
class: "zan-input"
|
|
486
|
-
}, null, 40,
|
|
487
|
-
[
|
|
490
|
+
}, null, 40, Wt)), [
|
|
491
|
+
[st, t.value]
|
|
488
492
|
]);
|
|
489
493
|
}
|
|
490
494
|
});
|
|
491
|
-
function
|
|
495
|
+
function Yt(e) {
|
|
492
496
|
for (; e && e.parentNode; )
|
|
493
497
|
if (e = e.parentNode, e && getComputedStyle(e).position === "relative")
|
|
494
498
|
return e;
|
|
@@ -498,22 +502,22 @@ const ae = (e) => {
|
|
|
498
502
|
document.querySelectorAll(".zan-layer iframe").forEach((l) => {
|
|
499
503
|
l.style.pointerEvents = e;
|
|
500
504
|
});
|
|
501
|
-
},
|
|
502
|
-
let
|
|
505
|
+
}, Qt = function(e, n, l, t, o) {
|
|
506
|
+
let s, c, a = 0, i = 0, f = !0;
|
|
503
507
|
e != null && e.addEventListener("mousedown", function(r) {
|
|
504
508
|
if ((r.composedPath && r.composedPath() || r.path)[0].className === "zan-layer-title" && r.button == 0 && e != null) {
|
|
505
509
|
ae("none");
|
|
506
510
|
const y = getComputedStyle(e);
|
|
507
|
-
|
|
511
|
+
s = r.pageX - e.offsetLeft + parseInt(y["margin-left"]), c = r.pageY - e.offsetTop + parseInt(y["margin-right"]), a = r.clientX, i = r.clientY, document.body.style.userSelect = "none", document.body.style.cursor = "move";
|
|
508
512
|
const $ = function(C) {
|
|
509
513
|
if (e != null) {
|
|
510
|
-
(C.clientX -
|
|
511
|
-
let h = C.pageX -
|
|
514
|
+
(C.clientX - a != 0 || C.clientY - i != 0) && f && (f = !1, o());
|
|
515
|
+
let h = C.pageX - s, g = C.pageY - c;
|
|
512
516
|
const k = document.documentElement.clientWidth, S = document.documentElement.clientHeight;
|
|
513
517
|
if (!n) {
|
|
514
518
|
let O = k - e.offsetWidth, F = S - e.offsetHeight;
|
|
515
519
|
if (e.style.position === "absolute") {
|
|
516
|
-
const E =
|
|
520
|
+
const E = Yt(e);
|
|
517
521
|
E != null && (O = E.clientWidth - e.offsetWidth, F = E.clientHeight - e.offsetHeight);
|
|
518
522
|
}
|
|
519
523
|
h < 0 ? h = 0 : h > O && (h = O), g < 0 ? g = 0 : g > F && (g = F);
|
|
@@ -528,18 +532,18 @@ const ae = (e) => {
|
|
|
528
532
|
}
|
|
529
533
|
return !1;
|
|
530
534
|
});
|
|
531
|
-
},
|
|
532
|
-
let
|
|
533
|
-
e != null && e.addEventListener("mousedown", function(
|
|
534
|
-
if ((
|
|
535
|
+
}, Gt = function(e, n, l, t) {
|
|
536
|
+
let o = 0, s = 0, c = !0;
|
|
537
|
+
e != null && e.addEventListener("mousedown", function(a) {
|
|
538
|
+
if ((a.composedPath && a.composedPath() || a.path)[0].className === "zan-layer-resize" && a.button == 0 && e != null) {
|
|
535
539
|
ae("none");
|
|
536
540
|
const f = e.getBoundingClientRect(), r = f.left, u = f.top;
|
|
537
|
-
|
|
541
|
+
o = a.clientX, s = a.clientY, document.body.style.userSelect = "none", document.body.style.cursor = "se-resize";
|
|
538
542
|
const y = function(H) {
|
|
539
543
|
var C;
|
|
540
544
|
if (window.getSelection != null && ((C = window.getSelection()) == null || C.removeAllRanges()), e != null) {
|
|
541
545
|
const h = H.clientX, g = H.clientY;
|
|
542
|
-
(h -
|
|
546
|
+
(h - o != 0 || g - s != 0) && c && (c = !1, t());
|
|
543
547
|
let k = h - r, S = g - u;
|
|
544
548
|
k < 260 && (k = 260), S < 115 && (S = 115), e.style.width = k + "px", e.style.height = S + "px", n(e.style.width, e.style.height);
|
|
545
549
|
}
|
|
@@ -553,15 +557,15 @@ const ae = (e) => {
|
|
|
553
557
|
}
|
|
554
558
|
return !1;
|
|
555
559
|
});
|
|
556
|
-
},
|
|
557
|
-
let
|
|
558
|
-
function
|
|
559
|
-
return ++
|
|
560
|
+
}, Ut = Symbol("zIndex");
|
|
561
|
+
let Zt = 99999;
|
|
562
|
+
function He() {
|
|
563
|
+
return ++Zt;
|
|
560
564
|
}
|
|
561
|
-
const
|
|
565
|
+
const qt = ["id"], Kt = {
|
|
562
566
|
key: 1,
|
|
563
567
|
class: "slot-fragment"
|
|
564
|
-
},
|
|
568
|
+
}, Jt = ["innerHTML"], en = ["onClick"], tn = {
|
|
565
569
|
key: 2,
|
|
566
570
|
class: "zan-layer-resize"
|
|
567
571
|
}, ve = /* @__PURE__ */ M({
|
|
@@ -641,8 +645,8 @@ const Zt = ["id"], qt = {
|
|
|
641
645
|
},
|
|
642
646
|
emits: ["close", "update:modelValue"],
|
|
643
647
|
setup(e, { expose: n, emit: l }) {
|
|
644
|
-
const t = e,
|
|
645
|
-
|
|
648
|
+
const t = e, o = l, s = it(), c = b(!1), a = b(!1), i = b(t.id || Ae()), f = b(null), r = b(), u = pt(t.type), y = b(
|
|
649
|
+
vt(t.type, t.area, t.offset)
|
|
646
650
|
), $ = b(
|
|
647
651
|
de(t.offset, y.value, u)
|
|
648
652
|
), H = b(99999), C = b(!1), h = b(y.value[0]), g = b(y.value[1]), k = b($.value[0]), S = b($.value[1]), O = b(""), F = b(""), E = b(""), _ = b(""), G = b(t.value);
|
|
@@ -653,7 +657,7 @@ const Zt = ["id"], qt = {
|
|
|
653
657
|
}
|
|
654
658
|
);
|
|
655
659
|
const pe = () => {
|
|
656
|
-
H.value = t.zIndex ??
|
|
660
|
+
H.value = t.zIndex ?? He();
|
|
657
661
|
};
|
|
658
662
|
j(
|
|
659
663
|
() => t.zIndex,
|
|
@@ -664,46 +668,46 @@ const Zt = ["id"], qt = {
|
|
|
664
668
|
);
|
|
665
669
|
const he = function() {
|
|
666
670
|
D(async () => {
|
|
667
|
-
u == 4 && (y.value =
|
|
671
|
+
u == 4 && (y.value = De(t.offset, t.area)), u == 5 && (y.value = await Fe(
|
|
668
672
|
t.imgList[t.startIndex].src
|
|
669
673
|
));
|
|
670
674
|
let v = y.value;
|
|
671
|
-
(v[0] == null || v[1] == null) && (v =
|
|
675
|
+
(v[0] == null || v[1] == null) && (v = Be(f.value)), u == 6 && ($.value = ht(t.offset, v, i.value)), U(), we(), Pe();
|
|
672
676
|
});
|
|
673
|
-
},
|
|
674
|
-
|
|
677
|
+
}, Ne = function() {
|
|
678
|
+
a.value && ze(), c.value && xe(), O.value = "", F.value = "", E.value = "", _.value = "";
|
|
675
679
|
}, ge = () => {
|
|
676
|
-
E.value = k.value, _.value = S.value, O.value = h.value, F.value = g.value, h.value =
|
|
680
|
+
E.value = k.value, _.value = S.value, O.value = h.value, F.value = g.value, h.value = $e().w, g.value = $e().h, k.value = Ie().t, S.value = Ie().l;
|
|
677
681
|
}, xe = () => {
|
|
678
|
-
c.value ? (X(), h.value = O.value, g.value = F.value, t.revert(
|
|
682
|
+
c.value ? (X(), h.value = O.value, g.value = F.value, t.revert(i.value)) : (Y(), ge(), t.full(i.value)), c.value = !c.value;
|
|
679
683
|
}, be = () => {
|
|
680
|
-
let ue = 10 + 190 * q(
|
|
681
|
-
const
|
|
682
|
-
ue + 180 >
|
|
684
|
+
let ue = 10 + 190 * q(i.value, !0);
|
|
685
|
+
const lt = document.documentElement.clientWidth;
|
|
686
|
+
ue + 180 > lt && (ue = 10), O.value = h.value, F.value = g.value, E.value = k.value, _.value = S.value, g.value = "51px", h.value = "180px", k.value = "calc(100% - 51px)", S.value = ue + "px";
|
|
683
687
|
}, ze = async () => {
|
|
684
|
-
|
|
688
|
+
a.value ? (X(), q(i.value, !1), h.value = O.value, g.value = F.value, t.revert(i.value)) : (Y(), be(), t.min(i.value)), a.value = !a.value;
|
|
685
689
|
};
|
|
686
690
|
j(
|
|
687
691
|
() => t.modelValue,
|
|
688
692
|
() => {
|
|
689
|
-
C.value = t.modelValue, C.value ? (he(), pe()) :
|
|
693
|
+
C.value = t.modelValue, C.value ? (he(), pe()) : Ne();
|
|
690
694
|
},
|
|
691
695
|
{ deep: !0, immediate: !0 }
|
|
692
696
|
), j(
|
|
693
697
|
() => C.value,
|
|
694
698
|
() => {
|
|
695
699
|
C.value && (t.isFunction && he(), D(() => {
|
|
696
|
-
t.success(
|
|
700
|
+
t.success(i.value);
|
|
697
701
|
}));
|
|
698
702
|
},
|
|
699
703
|
{ immediate: !0, flush: "post" }
|
|
700
704
|
), j(
|
|
701
705
|
() => C.value,
|
|
702
706
|
() => {
|
|
703
|
-
C.value || t.end(
|
|
707
|
+
C.value || t.end(i.value);
|
|
704
708
|
}
|
|
705
709
|
);
|
|
706
|
-
const
|
|
710
|
+
const Ve = I(() => [
|
|
707
711
|
{
|
|
708
712
|
"zan-layer-dialog": u === 0 || u === 7,
|
|
709
713
|
"zan-layer-page": u === 1,
|
|
@@ -716,44 +720,44 @@ const Zt = ["id"], qt = {
|
|
|
716
720
|
"zan-layer-hui": t.isMessage && !t.icon
|
|
717
721
|
},
|
|
718
722
|
t.layerClasses
|
|
719
|
-
]),
|
|
723
|
+
]), Pe = function() {
|
|
720
724
|
t.move && u != 4 && D(() => {
|
|
721
|
-
f.value && (
|
|
725
|
+
f.value && (Qt(
|
|
722
726
|
f.value,
|
|
723
727
|
t.moveOut,
|
|
724
728
|
(v, z) => {
|
|
725
|
-
S.value = v, k.value = z,
|
|
729
|
+
S.value = v, k.value = z, a.value || (_.value = v, E.value = z), t.moving(i.value, { top: z, left: v });
|
|
726
730
|
},
|
|
727
731
|
() => {
|
|
728
732
|
const v = {
|
|
729
733
|
left: S.value,
|
|
730
734
|
top: k.value,
|
|
731
|
-
isMin:
|
|
735
|
+
isMin: a.value,
|
|
732
736
|
isMax: c.value
|
|
733
|
-
}, [z, w] = t.moveEnd(
|
|
737
|
+
}, [z, w] = t.moveEnd(i.value, v) || [];
|
|
734
738
|
w && z && (S.value = z, k.value = w);
|
|
735
739
|
},
|
|
736
740
|
() => {
|
|
737
|
-
t.moveStart(
|
|
741
|
+
t.moveStart(i.value);
|
|
738
742
|
}
|
|
739
|
-
),
|
|
743
|
+
), Gt(
|
|
740
744
|
f.value,
|
|
741
745
|
(v, z) => {
|
|
742
|
-
g.value = z, h.value = v, F.value = z, O.value = v, t.resizing(
|
|
746
|
+
g.value = z, h.value = v, F.value = z, O.value = v, t.resizing(i.value, { width: v, height: z });
|
|
743
747
|
},
|
|
744
748
|
() => {
|
|
745
749
|
const v = {
|
|
746
750
|
width: h.value,
|
|
747
751
|
height: g.value
|
|
748
|
-
}, [z, w] = t.resizeEnd(
|
|
752
|
+
}, [z, w] = t.resizeEnd(i.value, v) || [];
|
|
749
753
|
z && w && (h.value = z, g.value = w);
|
|
750
754
|
},
|
|
751
755
|
() => {
|
|
752
|
-
t.resizeStart(
|
|
756
|
+
t.resizeStart(i.value);
|
|
753
757
|
}
|
|
754
758
|
));
|
|
755
759
|
});
|
|
756
|
-
},
|
|
760
|
+
}, Te = I(() => ({
|
|
757
761
|
position: t.teleportDisabled || t.teleport != "body" ? "absolute" : "fixed",
|
|
758
762
|
top: k.value,
|
|
759
763
|
left: S.value,
|
|
@@ -761,32 +765,32 @@ const Zt = ["id"], qt = {
|
|
|
761
765
|
width: h.value,
|
|
762
766
|
animationDuration: t.animDuration,
|
|
763
767
|
zIndex: H.value
|
|
764
|
-
})),
|
|
768
|
+
})), je = I(() => [
|
|
765
769
|
u === 3 ? `zan-layer-loading${t.load}` : "",
|
|
766
770
|
t.icon ? "zan-layer-padding" : ""
|
|
767
771
|
]), le = () => {
|
|
768
772
|
if (typeof t.beforeClose == "function") {
|
|
769
|
-
const v = t.beforeClose(
|
|
770
|
-
(v === void 0 || v != null && v === !0) && (t.close(
|
|
773
|
+
const v = t.beforeClose(i.value);
|
|
774
|
+
(v === void 0 || v != null && v === !0) && (t.close(i.value), o("close"), o("update:modelValue", !1), t.internalDestroy && t.internalDestroy(), a.value && q(i.value, !a.value));
|
|
771
775
|
}
|
|
772
|
-
},
|
|
776
|
+
}, Re = (...v) => {
|
|
773
777
|
typeof t.yes == "function" ? t.yes(...v) : le();
|
|
774
|
-
},
|
|
778
|
+
}, _e = () => {
|
|
775
779
|
t.shadeClose && le();
|
|
776
|
-
}, Ce = I(() => ["zan-icon", `zan-icon-ico${t.icon}`]),
|
|
780
|
+
}, Ce = I(() => ["zan-icon", `zan-icon-ico${t.icon}`]), We = I(() => u === 4 ? Oe(t.offset) : u === 6 ? xt(t.offset) : `zan-layer-anim-0${t.anim}`), Xe = I(() => u === 4 ? Oe(t.offset, !0) : t.isOutAnim ? "zan-layer-anim-close" : ""), Ye = () => {
|
|
777
781
|
C.value = !0;
|
|
778
|
-
},
|
|
779
|
-
C.value = !1, u === 6 &&
|
|
780
|
-
},
|
|
782
|
+
}, Qe = () => {
|
|
783
|
+
C.value = !1, u === 6 && gt(i.value);
|
|
784
|
+
}, Ge = I(() => C.value && t.shade && !a.value), Ue = I(() => t.resize && !c.value && !a.value), Ze = I(() => t.title && u != 3 && u != 5 && u != 6), qe = function(v) {
|
|
781
785
|
D(async () => {
|
|
782
|
-
y.value = await
|
|
786
|
+
y.value = await Fe(t.imgList[v].src), $.value = de(t.offset, y.value, u), h.value = y.value[0], g.value = y.value[1], k.value = $.value[0], S.value = $.value[1], O.value = y.value[0], F.value = y.value[1];
|
|
783
787
|
});
|
|
784
|
-
},
|
|
785
|
-
t.zIndex || (H.value =
|
|
788
|
+
}, Ke = function() {
|
|
789
|
+
t.zIndex || (H.value = He());
|
|
786
790
|
};
|
|
787
791
|
ye(() => {
|
|
788
792
|
X();
|
|
789
|
-
}),
|
|
793
|
+
}), ut(() => {
|
|
790
794
|
Y();
|
|
791
795
|
}), j(
|
|
792
796
|
() => t.modelValue,
|
|
@@ -800,7 +804,7 @@ const Zt = ["id"], qt = {
|
|
|
800
804
|
r.value && !W && u != 6 && (W = new ResizeObserver((v) => {
|
|
801
805
|
f.value && ($.value = de(
|
|
802
806
|
t.offset,
|
|
803
|
-
|
|
807
|
+
Be(f.value),
|
|
804
808
|
u
|
|
805
809
|
), U(!0));
|
|
806
810
|
}), W.observe(r.value));
|
|
@@ -811,47 +815,47 @@ const Zt = ["id"], qt = {
|
|
|
811
815
|
k.value = v && t.lastPosition && E.value || $.value[0], S.value = v && t.lastPosition && _.value || $.value[1];
|
|
812
816
|
}, we = function() {
|
|
813
817
|
h.value = y.value[0], g.value = y.value[1], O.value = y.value[0], F.value = y.value[1];
|
|
814
|
-
},
|
|
815
|
-
X(), q(
|
|
816
|
-
}, Je = async function() {
|
|
817
|
-
o.value && (se(), U(!0)), c.value || (await D(), Y(), ge(), c.value = !0);
|
|
818
|
+
}, Je = function() {
|
|
819
|
+
X(), q(i.value, !1), a.value = !1, c.value = !1, E.value = "", _.value = "", U(), we(), t.modelValue || o("update:modelValue", !0);
|
|
818
820
|
}, et = async function() {
|
|
819
|
-
|
|
821
|
+
a.value && (se(), U(!0)), c.value || (await D(), Y(), ge(), c.value = !0);
|
|
822
|
+
}, tt = async function() {
|
|
823
|
+
c.value && (se(), U(!0)), a.value || (await D(), Y(), be(), a.value = !0);
|
|
820
824
|
}, se = () => {
|
|
821
|
-
X(), q(
|
|
825
|
+
X(), q(i.value, !1), a.value = !1, c.value = !1, h.value = O.value, g.value = F.value;
|
|
822
826
|
};
|
|
823
|
-
return n({ reset:
|
|
827
|
+
return n({ reset: Je, open: Ye, close: Qe, full: et, min: tt, revert: se }), (v, z) => (d(), A(rt, {
|
|
824
828
|
to: e.teleport,
|
|
825
829
|
disabled: e.teleportDisabled
|
|
826
830
|
}, [
|
|
827
|
-
te(
|
|
831
|
+
te(dt, {
|
|
828
832
|
index: H.value,
|
|
829
833
|
"shade-style": e.shadeStyle,
|
|
830
|
-
visible:
|
|
834
|
+
visible: Ge.value,
|
|
831
835
|
opacity: e.shadeOpacity,
|
|
832
836
|
teleport: e.teleport,
|
|
833
837
|
teleportDisabled: e.teleportDisabled,
|
|
834
|
-
onShadeClick:
|
|
838
|
+
onShadeClick: _e
|
|
835
839
|
}, null, 8, ["index", "shade-style", "visible", "opacity", "teleport", "teleportDisabled"]),
|
|
836
|
-
te(
|
|
837
|
-
"enter-active-class":
|
|
838
|
-
"leave-active-class":
|
|
840
|
+
te(ct, {
|
|
841
|
+
"enter-active-class": We.value,
|
|
842
|
+
"leave-active-class": Xe.value
|
|
839
843
|
}, {
|
|
840
844
|
default: ce(() => [
|
|
841
845
|
C.value ? (d(), m("div", {
|
|
842
846
|
key: 0,
|
|
843
847
|
ref_key: "layerRef",
|
|
844
848
|
ref: f,
|
|
845
|
-
class: N(["zan-layer zan-layer-border", [
|
|
846
|
-
id:
|
|
847
|
-
style: V(
|
|
849
|
+
class: N(["zan-layer zan-layer-border", [Ve.value, { "zan-layer-min": a.value }]]),
|
|
850
|
+
id: i.value,
|
|
851
|
+
style: V(Te.value)
|
|
848
852
|
}, [
|
|
849
|
-
|
|
853
|
+
Ze.value ? (d(), A(bt, {
|
|
850
854
|
key: 0,
|
|
851
855
|
title: e.title,
|
|
852
856
|
titleStyle: e.titleStyle,
|
|
853
857
|
move: e.move,
|
|
854
|
-
onMousedown:
|
|
858
|
+
onMousedown: Ke
|
|
855
859
|
}, {
|
|
856
860
|
default: ce(() => [
|
|
857
861
|
ee(v.$slots, "title")
|
|
@@ -861,22 +865,22 @@ const Zt = ["id"], qt = {
|
|
|
861
865
|
B("div", {
|
|
862
866
|
ref_key: "contentRef",
|
|
863
867
|
ref: r,
|
|
864
|
-
class: N(["zan-layer-content",
|
|
865
|
-
style: V(
|
|
868
|
+
class: N(["zan-layer-content", je.value]),
|
|
869
|
+
style: V(a.value === !0 ? "display:none" : "")
|
|
866
870
|
}, [
|
|
867
871
|
x(u) === 0 || x(u) === 1 || x(u) === 4 ? (d(), m(R, { key: 0 }, [
|
|
868
872
|
e.icon ? (d(), m("i", {
|
|
869
873
|
key: 0,
|
|
870
874
|
class: N(Ce.value)
|
|
871
875
|
}, null, 2)) : p("", !0),
|
|
872
|
-
x(
|
|
876
|
+
x(s).default ? (d(), m("div", Kt, [
|
|
873
877
|
ee(v.$slots, "default")
|
|
874
878
|
])) : (d(), m(R, { key: 2 }, [
|
|
875
879
|
e.isHtmlFragment ? (d(), m("div", {
|
|
876
880
|
key: 0,
|
|
877
881
|
class: "html-fragment",
|
|
878
882
|
innerHTML: x(ne)(t.content)
|
|
879
|
-
}, null, 8,
|
|
883
|
+
}, null, 8, Jt)) : (d(), m(R, { key: 1 }, [
|
|
880
884
|
t.content ? (d(), A(oe, {
|
|
881
885
|
key: 0,
|
|
882
886
|
render: () => x(ne)(t.content)
|
|
@@ -884,7 +888,7 @@ const Zt = ["id"], qt = {
|
|
|
884
888
|
], 64))
|
|
885
889
|
], 64))
|
|
886
890
|
], 64)) : p("", !0),
|
|
887
|
-
x(u) === 7 ? (d(), A(
|
|
891
|
+
x(u) === 7 ? (d(), A(Xt, {
|
|
888
892
|
key: 1,
|
|
889
893
|
"prompt-value": G.value,
|
|
890
894
|
"onUpdate:promptValue": z[0] || (z[0] = (w) => G.value = w),
|
|
@@ -892,17 +896,17 @@ const Zt = ["id"], qt = {
|
|
|
892
896
|
maxLength: t.maxLength,
|
|
893
897
|
placeholder: t.placeholder
|
|
894
898
|
}, null, 8, ["prompt-value", "formType", "maxLength", "placeholder"])) : p("", !0),
|
|
895
|
-
x(u) === 2 ? (d(), A(
|
|
899
|
+
x(u) === 2 ? (d(), A(mt, {
|
|
896
900
|
key: 2,
|
|
897
901
|
src: t.content
|
|
898
902
|
}, null, 8, ["src"])) : p("", !0),
|
|
899
|
-
x(u) === 5 ? (d(), A(
|
|
903
|
+
x(u) === 5 ? (d(), A(Vt, {
|
|
900
904
|
key: 3,
|
|
901
905
|
imgList: t.imgList,
|
|
902
906
|
startIndex: t.startIndex,
|
|
903
|
-
onResetCalculationPohtosArea:
|
|
907
|
+
onResetCalculationPohtosArea: qe
|
|
904
908
|
}, null, 8, ["imgList", "startIndex"])) : p("", !0),
|
|
905
|
-
x(u) === 6 ? (d(), A(
|
|
909
|
+
x(u) === 6 ? (d(), A(Rt, {
|
|
906
910
|
key: 4,
|
|
907
911
|
onClose: le,
|
|
908
912
|
title: t.title,
|
|
@@ -912,20 +916,20 @@ const Zt = ["id"], qt = {
|
|
|
912
916
|
iconClass: Ce.value
|
|
913
917
|
}, null, 8, ["title", "content", "isHtmlFragment", "icon", "iconClass"])) : p("", !0)
|
|
914
918
|
], 6),
|
|
915
|
-
x(u) != 3 && x(u) != 5 && x(u) != 6 ? (d(), A(
|
|
919
|
+
x(u) != 3 && x(u) != 5 && x(u) != 6 ? (d(), A($t, {
|
|
916
920
|
key: 1,
|
|
917
921
|
maxmin: e.maxmin,
|
|
918
922
|
max: c.value,
|
|
919
|
-
min:
|
|
923
|
+
min: a.value,
|
|
920
924
|
closeBtn: e.closeBtn,
|
|
921
925
|
onOnMin: ze,
|
|
922
926
|
onOnMax: xe,
|
|
923
927
|
onOnClose: le
|
|
924
928
|
}, null, 8, ["maxmin", "max", "min", "closeBtn"])) : p("", !0),
|
|
925
929
|
B("div", {
|
|
926
|
-
style: V(
|
|
930
|
+
style: V(a.value === !0 ? "display:none" : "")
|
|
927
931
|
}, [
|
|
928
|
-
x(
|
|
932
|
+
x(s).footer || t.footer ? (d(), A(zt, {
|
|
929
933
|
key: 0,
|
|
930
934
|
footer: t.footer,
|
|
931
935
|
footerStyle: t.footerStyle
|
|
@@ -939,7 +943,7 @@ const Zt = ["id"], qt = {
|
|
|
939
943
|
key: 0,
|
|
940
944
|
class: N(["zan-layer-btn", [`zan-layer-btn-${e.btnAlign}`]])
|
|
941
945
|
}, [
|
|
942
|
-
e.btn && e.btn.length > 0 ? (d(!0), m(R, { key: 0 },
|
|
946
|
+
e.btn && e.btn.length > 0 ? (d(!0), m(R, { key: 0 }, Me(e.btn, (w, ie) => (d(), m("a", {
|
|
943
947
|
key: ie,
|
|
944
948
|
style: V(w.style),
|
|
945
949
|
class: N([
|
|
@@ -947,31 +951,31 @@ const Zt = ["id"], qt = {
|
|
|
947
951
|
`zan-layer-btn${ie}`,
|
|
948
952
|
{ "zan-layer-btn-disabled": w.disabled }
|
|
949
953
|
]),
|
|
950
|
-
onClick: (
|
|
951
|
-
}, P(w.text), 15,
|
|
954
|
+
onClick: (nt) => !w.disabled && (x(u) === 7 ? w.callback(i.value, G.value) : w.callback(i.value))
|
|
955
|
+
}, P(w.text), 15, en))), 128)) : (d(), m(R, { key: 1 }, [
|
|
952
956
|
x(u) === 0 || x(u) === 7 ? (d(), m("a", {
|
|
953
957
|
key: 0,
|
|
954
958
|
class: "zan-layer-btn0",
|
|
955
|
-
onClick: z[1] || (z[1] = (w) =>
|
|
959
|
+
onClick: z[1] || (z[1] = (w) => Re(i.value, G.value))
|
|
956
960
|
}, P(e.yesText), 1)) : p("", !0)
|
|
957
961
|
], 64))
|
|
958
962
|
], 2)) : p("", !0)
|
|
959
963
|
], 64))
|
|
960
964
|
], 4),
|
|
961
|
-
|
|
962
|
-
], 14,
|
|
965
|
+
Ue.value ? (d(), m("span", tn)) : p("", !0)
|
|
966
|
+
], 14, qt)) : p("", !0)
|
|
963
967
|
]),
|
|
964
968
|
_: 3
|
|
965
969
|
}, 8, ["enter-active-class", "leave-active-class"])
|
|
966
970
|
], 8, ["to", "disabled"]));
|
|
967
971
|
}
|
|
968
|
-
}), T = [],
|
|
972
|
+
}), T = [], nn = (e) => {
|
|
969
973
|
T.push(e);
|
|
970
974
|
}, fe = (e) => {
|
|
971
975
|
T.forEach((n, l) => {
|
|
972
976
|
n.modalContainer.id === e && T.splice(l, 1);
|
|
973
977
|
});
|
|
974
|
-
},
|
|
978
|
+
}, ln = () => {
|
|
975
979
|
T.splice(0, T.length);
|
|
976
980
|
}, K = (e) => {
|
|
977
981
|
let n = !1;
|
|
@@ -983,10 +987,10 @@ const Zt = ["id"], qt = {
|
|
|
983
987
|
return T.forEach((l, t) => {
|
|
984
988
|
l.modalContainer.id === e && (n = l);
|
|
985
989
|
}), n;
|
|
986
|
-
},
|
|
990
|
+
}, an = (e, n) => (e && (n = Object.assign(n, e)), n), on = (e) => {
|
|
987
991
|
const n = document.createElement("div");
|
|
988
992
|
return n.id = e.id, document.body.appendChild(n), n;
|
|
989
|
-
},
|
|
993
|
+
}, sn = (e) => typeof e == "function" ? Se(e()) ? { default: () => e() } : void 0 : Se(e) ? { default: () => e } : void 0, L = {
|
|
990
994
|
_context: null,
|
|
991
995
|
// 打开弹窗
|
|
992
996
|
open: (e) => {
|
|
@@ -1075,30 +1079,30 @@ const Zt = ["id"], qt = {
|
|
|
1075
1079
|
},
|
|
1076
1080
|
// 创建弹窗
|
|
1077
1081
|
create: (e, n, l) => {
|
|
1078
|
-
var
|
|
1082
|
+
var a, i;
|
|
1079
1083
|
let t;
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1082
|
-
const
|
|
1084
|
+
const o = an(e, n);
|
|
1085
|
+
o.hasOwnProperty("id") ? L.close(o.id) : o.id = Ae();
|
|
1086
|
+
const s = on(o), c = Ee(
|
|
1083
1087
|
ve,
|
|
1084
1088
|
{
|
|
1085
|
-
...
|
|
1089
|
+
...o,
|
|
1086
1090
|
isFunction: !0,
|
|
1087
1091
|
internalDestroy() {
|
|
1088
1092
|
var f, r;
|
|
1089
1093
|
t && clearTimeout(t), (r = (f = c.component) == null ? void 0 : f.exposed) == null || r.close(), setTimeout(() => {
|
|
1090
|
-
Z(null,
|
|
1091
|
-
}, 500), fe(
|
|
1094
|
+
Z(null, s), document.body.contains(s) && document.body.removeChild(s);
|
|
1095
|
+
}, 500), fe(s.id);
|
|
1092
1096
|
}
|
|
1093
1097
|
},
|
|
1094
|
-
|
|
1098
|
+
sn(o.content)
|
|
1095
1099
|
);
|
|
1096
|
-
return c.appContext =
|
|
1100
|
+
return c.appContext = o.appContext || L._context, Z(c, s), (i = (a = c.component) == null ? void 0 : a.exposed) == null || i.open(), n && n.time != null && n.time != 0 && (t = setTimeout(() => {
|
|
1097
1101
|
var f, r;
|
|
1098
|
-
(r = (f = c.component) == null ? void 0 : f.exposed) == null || r.close(), l && l(
|
|
1099
|
-
Z(null,
|
|
1100
|
-
}, 500), fe(
|
|
1101
|
-
}, n.time)),
|
|
1102
|
+
(r = (f = c.component) == null ? void 0 : f.exposed) == null || r.close(), l && l(s.id), setTimeout(() => {
|
|
1103
|
+
Z(null, s), document.body.contains(s) && document.body.removeChild(s);
|
|
1104
|
+
}, 500), fe(s.id);
|
|
1105
|
+
}, n.time)), nn({ modalContainer: s, modalInstance: c }), s.id;
|
|
1102
1106
|
},
|
|
1103
1107
|
// 关闭弹窗
|
|
1104
1108
|
close: (e) => {
|
|
@@ -1118,7 +1122,7 @@ const Zt = ["id"], qt = {
|
|
|
1118
1122
|
(l = (n = e.modalInstance.component) == null ? void 0 : n.exposed) == null || l.close(), setTimeout(() => {
|
|
1119
1123
|
Z(null, e.modalContainer), document.body.contains(e.modalContainer) && document.body.removeChild(e.modalContainer);
|
|
1120
1124
|
}, 500);
|
|
1121
|
-
}),
|
|
1125
|
+
}), ln();
|
|
1122
1126
|
},
|
|
1123
1127
|
// 重置位置
|
|
1124
1128
|
reset: (e) => {
|
|
@@ -1140,12 +1144,12 @@ const Zt = ["id"], qt = {
|
|
|
1140
1144
|
var n, l;
|
|
1141
1145
|
e != null && K(e) && ((l = (n = J(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.revert());
|
|
1142
1146
|
}
|
|
1143
|
-
},
|
|
1144
|
-
L._context = e._context, e.component(ve.name, ve), e.config.globalProperties.$layer = L, n && typeof n.zIndex == "number" && e.provide(
|
|
1145
|
-
},
|
|
1147
|
+
}, un = (e, n) => {
|
|
1148
|
+
L._context = e._context, e.component(ve.name, ve), e.config.globalProperties.$layer = L, n && typeof n.zIndex == "number" && e.provide(Ut, b(n.zIndex));
|
|
1149
|
+
}, cn = { install: un };
|
|
1146
1150
|
export {
|
|
1147
1151
|
ve as ZanLayer,
|
|
1148
|
-
|
|
1152
|
+
cn as default,
|
|
1149
1153
|
L as layer,
|
|
1150
1154
|
L as zanLayer
|
|
1151
1155
|
};
|