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