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