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