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