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/lib/zan-layer.js CHANGED
@@ -1,5 +1,5 @@
1
- import { defineComponent as A, computed as $, openBlock as d, createElementBlock as v, normalizeStyle as N, createCommentVNode as h, h as Me, renderSlot as ee, createVNode as te, unref as z, withModifiers as de, normalizeClass as P, createElementVNode as B, toDisplayString as T, ref as g, watch as J, onMounted as he, nextTick as D, Fragment as W, renderList as De, shallowRef as rt, withDirectives as Se, vModelText as ut, vModelDynamic as ct, useSlots as dt, onUnmounted as ft, createBlock as M, Teleport as mt, Transition as vt, withCtx as fe, render as Z, isVNode as Ie } from "vue";
2
- const yt = /* @__PURE__ */ A({
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 (u, a) => e.visible ? (d(), v("div", {
25
+ return (c, a) => e.visible ? (d(), v("div", {
26
26
  key: 0,
27
27
  class: "zan-layer-shade",
28
- style: N(o.value),
28
+ style: _(o.value),
29
29
  onClick: i
30
- }, null, 4)) : h("", !0);
30
+ }, null, 4)) : g("", !0);
31
31
  }
32
- }), pt = ["src"], ht = /* @__PURE__ */ A({
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 = $(() => n.src);
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, pt));
46
+ }, null, 8, Et));
47
47
  }
48
- }), ie = A({
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
- }), ne = function(e) {
60
- return typeof e == "function" ? e() : typeof e == "string" ? Me("span", e) : e;
59
+ }), de = function(e) {
60
+ return typeof e == "function" ? e() : typeof e == "string" ? Ue("span", e) : e;
61
61
  };
62
- function Pe() {
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 gt(e, n, l) {
69
- return e != "drawer" && e != 4 ? xt(n) : Ne(l, n);
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 xt(e) {
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 Ne(e, n = "30%") {
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 $e(e) {
102
+ function _e(e) {
78
103
  return e == null || e === "" ? "0px" : e;
79
104
  }
80
- function me(e = "auto", n, l) {
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 = $e(t[0]), i = $e(t[1]), u = [
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" ? u.indexOf(e) > -1 ? (e === "t" && (a[0] = "0px", a[1] = "calc(50% - " + o + "/2)"), e === "l" && (a[0] = "calc(50% - " + i + "/2)", a[1] = "0px"), e === "b" && (a[0] = "calc(100% - " + i + ")", a[1] = "calc(50% - " + o + "/2)"), e === "r" && (a[0] = "calc(50% - " + i + "/2)", a[1] = "calc(100% - " + o + ")"), (e === "lt" || e === "tl") && (a[0] = "0px", a[1] = "0px"), (e === "lb" || e === "bl") && (a[0] = "calc(100% - " + i + ")", a[1] = "0px"), (e === "rt" || e === "tr") && (a[0] = "0px", a[1] = "calc(100% - " + o + ")"), (e === "rb" || e === "br") && (a[0] = "calc(100% - " + i + ")", a[1] = "calc(100% - " + o + ")")) : e == "auto" ? (a[0] = "calc(50% - " + i + "/2)", a[1] = "calc(50% - " + o + "/2)") : (a[0] = e, a[1] = "calc(50% - " + o + "/2)") : e && e[0] !== void 0 && e[1] !== void 0 ? (a[0] = e[0], a[1] = e[1]) : (a[0] = "calc(50% - " + i + "/2)", a[1] = "calc(50% - " + o + "/2)"), a;
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 bt(e) {
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 Be() {
142
+ function Xe() {
102
143
  return { w: "100%", h: "100%" };
103
144
  }
104
- function Oe() {
145
+ function Ye() {
105
146
  return { t: "0px", l: "0px" };
106
147
  }
107
- function Fe(e) {
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 Y = [];
113
- function q(e, n) {
153
+ const U = [];
154
+ function se(e, n) {
114
155
  let l = 0;
115
156
  if (n) {
116
- const t = Y.findIndex((o) => o === void 0);
117
- t === -1 ? (Y.push(e), l = Y.length - 1) : (Y[t] = e, l = t);
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 Y[Y.findIndex((t) => t == e)], l = -1;
160
+ delete U[U.findIndex((t) => t == e)], l = -1;
120
161
  return l;
121
162
  }
122
- function Ee(e, n = !1) {
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 He(e, n) {
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 u = I.load(2, { shadeOpacity: "0" });
174
+ const c = F.load(2, { shadeOpacity: "0" });
134
175
  l.onload = () => {
135
- I.close(u), o(t(l));
176
+ F.close(c), o(t(l));
136
177
  }, l.onerror = () => {
137
- I.close(u), I.msg("图片加载失败"), i(!1);
178
+ F.close(c), F.msg("图片加载失败"), i(!1);
138
179
  };
139
180
  });
140
181
  function t(o) {
141
- const i = [o.width, o.height], u = [window.innerWidth - 250, window.innerHeight - 250];
142
- if (i[0] > u[0] || i[1] > u[1]) {
143
- const a = [i[0] / u[0], i[1] / u[1]];
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 ye(e, n) {
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 zt(e, n, l) {
158
- const t = ["lt", "lb", "rt", "rb"];
159
- let o = "0", i = "0", a = 15;
160
- window.NotifiyQueen = window.NotifiyQueen || [];
161
- const r = window.NotifiyQueen;
162
- (typeof e != "string" || t.indexOf(e) === -1) && (e = "rt");
163
- const m = r.filter((s) => {
164
- if (s.offset === e)
165
- return s;
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
- let f = m.length > 0 ? m[m.length - 1] : null;
168
- if (f)
169
- if (f = ye("zan-layer", f.id), e === "rt" || e === "lt")
170
- a += f.offsetHeight + parseFloat(f.style.top);
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: e
180
- }), [o, i];
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 Ct(e) {
183
- const n = ye("zan-layer", e);
184
- if (!n) return;
185
- const l = 15, t = n.offsetHeight;
186
- window.NotifiyQueen = window.NotifiyQueen || [];
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 wt(e) {
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 kt = /* @__PURE__ */ A({
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 = $(() => [n.move ? "cursor: move" : "", n.titleStyle]);
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: N(l.value)
285
+ style: _(l.value)
219
286
  }, [
220
- ee(t.$slots, "default", {}, () => [
221
- te(ie, {
222
- render: () => z(ne)(e.title)
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
- }), Lt = /* @__PURE__ */ A({
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: N(e.footerStyle)
304
+ style: _(e.footerStyle)
238
305
  }, [
239
- ee(n.$slots, "default", {}, () => [
240
- te(ie, {
241
- render: () => z(ne)(e.footer)
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
- }), St = { class: "zan-layer-setwin" }, It = { class: "zan-tooltip" }, $t = { class: "zan-tooltip" }, Bt = /* @__PURE__ */ A({
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
- }, u = () => {
328
+ }, c = () => {
262
329
  t("onClose");
263
330
  };
264
- return (a, r) => (d(), v("span", St, [
331
+ return (a, r) => (d(), v("span", Yt, [
265
332
  l.maxmin && !l.max ? (d(), v("i", {
266
333
  key: 0,
267
- class: P(["zan-icon-btn", l.min ? "zan-icon-full" : "zan-icon-min"]),
268
- onClick: de(o, ["stop"])
334
+ class: j(["zan-icon-btn", l.min ? "zan-icon-full" : "zan-icon-min"]),
335
+ onClick: ge(o, ["stop"])
269
336
  }, [
270
- B("span", It, T(l.min ? "还原" : "最小化"), 1)
271
- ], 2)) : h("", !0),
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: P(["zan-icon-btn", l.max ? "zan-icon-restore" : "zan-icon-max"]),
275
- onClick: de(i, ["stop"])
341
+ class: j(["zan-icon-btn", l.max ? "zan-icon-restore" : "zan-icon-max"]),
342
+ onClick: ge(i, ["stop"])
276
343
  }, [
277
- B("span", $t, T(l.max ? "还原" : "最大化"), 1)
278
- ], 2)) : h("", !0),
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: P(["zan-icon-btn zan-icon-close-btn", `zan-layer-close${e.closeBtn}`]),
282
- onClick: de(u, ["stop"])
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
- B("span", { class: "zan-tooltip" }, "关闭", -1)
285
- ])], 2)) : h("", !0)
351
+ A("span", { class: "zan-tooltip" }, "关闭", -1)
352
+ ])], 2)) : g("", !0)
286
353
  ]));
287
354
  }
288
- }), Ot = (e, n) => {
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
- }, Ft = /* @__PURE__ */ Ot(Bt, [["__scopeId", "data-v-a2b66c03"]]), Et = { class: "zan-layer-phimg" }, Ht = ["src"], At = {
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
- }, Mt = {
363
+ }, tn = {
297
364
  key: 0,
298
365
  class: "zan-layer-imguide"
299
- }, Dt = {
366
+ }, nn = {
300
367
  key: 0,
301
368
  class: "thumb-row"
302
- }, Pt = ["onClick"], Nt = ["src"], Tt = {
369
+ }, ln = ["onClick"], an = ["src"], on = {
303
370
  key: 1,
304
371
  class: "zan-layer-imgtit"
305
- }, Vt = { key: 0 }, jt = { key: 1 }, Rt = /* @__PURE__ */ A({
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 = g(t.startIndex);
315
- J(o, () => {
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 f = o.value + r;
320
- f < 0 && (f = t.imgList.length - 1), f >= t.imgList.length && (f = 0), o.value = f;
321
- }, u = g(!1);
322
- he(() => {
323
- D(() => {
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
- u.value = !0;
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((m) => {
332
- m.thumb && (r = !0);
398
+ return t.imgList.forEach((y) => {
399
+ y.thumb && (r = !0);
333
400
  }), r;
334
401
  });
335
- return (r, m) => (d(), v("div", Et, [
336
- B("img", {
402
+ return (r, y) => (d(), v("div", Kt, [
403
+ A("img", {
337
404
  src: e.imgList[o.value].src
338
- }, null, 8, Ht),
339
- e.imgList.length > 0 ? (d(), v("div", At, [
340
- e.imgList.length > 1 ? (d(), v("span", Mt, [
341
- B("a", {
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: m[0] || (m[0] = (f) => i(-1))
411
+ onClick: y[0] || (y[0] = (m) => i(-1))
345
412
  }, "‹"),
346
- B("a", {
413
+ A("a", {
347
414
  href: "javascript:;",
348
415
  class: "zan-layer-iconext zan-layer-imgnext",
349
- onClick: m[1] || (m[1] = (f) => i(1))
416
+ onClick: y[1] || (y[1] = (m) => i(1))
350
417
  }, "›")
351
- ])) : h("", !0),
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: N({ opacity: u.value ? 1 : 0 })
422
+ style: _({ opacity: c.value ? 1 : 0 })
356
423
  }, [
357
- a.value ? (d(), v("div", Dt, [
358
- (d(!0), v(W, null, De(e.imgList, (f, s) => (d(), v("div", {
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: (p) => o.value = s
428
+ onClick: (B) => o.value = s
362
429
  }, [
363
- B("img", {
364
- src: f.thumb
365
- }, null, 8, Nt)
366
- ], 8, Pt))), 128)),
367
- B("div", {
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: N({
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", Tt, [
374
- e.imgList[o.value].alt ? (d(), v("span", Vt, T(e.imgList[o.value].alt), 1)) : h("", !0),
375
- e.imgList.length > 1 ? (d(), v("em", jt, T(o.value + 1) + " / " + T(e.imgList.length), 1)) : h("", !0)
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)) : h("", !0)
378
- ])) : h("", !0)
444
+ ], 4)) : g("", !0)
445
+ ])) : g("", !0)
379
446
  ]));
380
447
  }
381
- }), _t = { class: "title" }, Wt = {
448
+ }), cn = { class: "title" }, dn = {
382
449
  key: 0,
383
450
  class: "content"
384
- }, Xt = ["innerHTML"], Yt = /* @__PURE__ */ A({
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 = rt(null), i = () => {
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 u(a, r) {
400
- let m = a.className, f = m != "" ? " " : "", s = m + f + r;
401
- a.className = s;
469
+ function r(m, s) {
470
+ let B = m.className, h = B != "" ? " " : "", w = B + h + s;
471
+ m.className = w;
402
472
  }
403
- return he(() => {
404
- D(() => {
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 a, r, m, f;
407
- (r = (a = o.value) == null ? void 0 : a.parentElement) != null && r.parentElement && u(
408
- (f = (m = o.value) == null ? void 0 : m.parentElement) == null ? void 0 : f.parentElement,
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
- }), (a, r) => (d(), v("div", {
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
- B("h2", _t, [
497
+ A("h2", cn, [
419
498
  e.icon ? (d(), v("i", {
420
499
  key: 0,
421
- class: P(e.iconClass)
422
- }, null, 2)) : h("", !0),
423
- B("span", null, T(e.title), 1)
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", Wt, [
426
- te(ie, {
427
- render: () => z(ne)(l.content)
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, Xt)) : h("", !0),
434
- B("i", {
512
+ }, null, 8, fn)) : g("", !0),
513
+ A("i", {
435
514
  class: "zan-icon-close",
436
- onClick: i
437
- }, [...r[0] || (r[0] = [
438
- B("svg", {
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
- B("path", {
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
- }), Qt = ["maxlength", "placeholder"], Gt = ["type", "placeholder"], Zt = /* @__PURE__ */ A({
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 = g(l.promptValue), o = $(() => {
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 (u, a) => o.value ? Se((d(), v("textarea", {
553
+ return (c, a) => o.value ? Te((d(), v("textarea", {
475
554
  key: 0,
476
- onInput: a[0] || (a[0] = (r) => u.$emit("update:promptValue", t.value)),
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, Qt)), [
482
- [ut, t.value]
483
- ]) : Se((d(), v("input", {
560
+ }, null, 40, vn)), [
561
+ [Bt, t.value]
562
+ ]) : Te((d(), v("input", {
484
563
  key: 1,
485
- onInput: a[2] || (a[2] = (r) => u.$emit("update:promptValue", t.value)),
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, Gt)), [
491
- [ct, t.value]
569
+ }, null, 40, yn)), [
570
+ [Ht, t.value]
492
571
  ]);
493
572
  }
494
573
  });
495
- function qt(e) {
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 se = (e) => {
580
+ const ve = (e) => {
502
581
  document.querySelectorAll(".zan-layer iframe").forEach((l) => {
503
582
  l.style.pointerEvents = e;
504
583
  });
505
- }, Ut = function(e, n, l, t, o) {
506
- let i, u, a = 0, r = 0, m = !0;
507
- const f = (s) => {
508
- const p = s.target;
509
- return !p || p.closest("button, input, textarea, select, a") ? !1 : (s.composedPath && s.composedPath() || s.path || []).some((O) => O instanceof HTMLElement && O.classList.contains("zan-layer-title"));
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 (f(s) && s.button == 0 && e != null) {
513
- se("none");
514
- const p = getComputedStyle(e);
515
- i = s.pageX - e.offsetLeft + parseInt(p["margin-left"]), u = s.pageY - e.offsetTop + parseInt(p["margin-right"]), a = s.clientX, r = s.clientY, document.body.style.userSelect = "none", document.body.style.cursor = "move";
516
- const L = function(S) {
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
- (S.clientX - a != 0 || S.clientY - r != 0) && m && (m = !1, o());
519
- let x = S.pageX - i, b = S.pageY - u;
520
- const w = document.documentElement.clientWidth, k = document.documentElement.clientHeight;
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 F = w - e.offsetWidth, E = k - e.offsetHeight;
601
+ let z = L - e.offsetWidth, S = H - e.offsetHeight;
523
602
  if (e.style.position === "absolute") {
524
- const H = qt(e);
525
- H != null && (F = H.clientWidth - e.offsetWidth, E = H.clientHeight - e.offsetHeight);
603
+ const I = hn(e);
604
+ I != null && (z = I.clientWidth - e.offsetWidth, S = I.clientHeight - e.offsetHeight);
526
605
  }
527
- x < 0 ? x = 0 : x > F && (x = F), b < 0 ? b = 0 : b > E && (b = E);
606
+ $ < 0 ? $ = 0 : $ > z && ($ = z), b < 0 ? b = 0 : b > S && (b = S);
528
607
  }
529
- e.style.top = b + "px", e.style.left = x + "px", l(e.style.left, e.style.top);
608
+ e.style.top = b + "px", e.style.left = $ + "px", l(e.style.left, e.style.top);
530
609
  }
531
610
  return !1;
532
- }, O = function() {
533
- m = !0, document.body.style.userSelect = "", document.body.style.cursor = "", t(), se("auto"), document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", O);
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", L, { passive: !1 }), document.addEventListener("mouseup", O);
614
+ document.addEventListener("mousemove", h, { passive: !1 }), document.addEventListener("mouseup", w);
536
615
  }
537
616
  return !1;
538
617
  });
539
- }, Kt = function(e, n, l, t) {
540
- let o = 0, i = 0, u = !0;
541
- e != null && e.addEventListener("mousedown", function(a) {
542
- if ((a.composedPath && a.composedPath() || a.path)[0].className === "zan-layer-resize" && a.button == 0 && e != null) {
543
- se("none");
544
- const m = e.getBoundingClientRect(), f = m.left, s = m.top;
545
- o = a.clientX, i = a.clientY, document.body.style.userSelect = "none", document.body.style.cursor = "se-resize";
546
- const p = function(O) {
547
- var S;
548
- if (window.getSelection != null && ((S = window.getSelection()) == null || S.removeAllRanges()), e != null) {
549
- const x = O.clientX, b = O.clientY;
550
- (x - o != 0 || b - i != 0) && u && (u = !1, t());
551
- let w = x - f, k = b - s;
552
- w < 260 && (w = 260), k < 115 && (k = 115), e.style.width = w + "px", e.style.height = k + "px", n(e.style.width, e.style.height);
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", p, { passive: !1 });
557
- const L = function() {
558
- u = !0, document.body.style.userSelect = "", document.body.style.cursor = "", l(), se("auto"), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", L);
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", L);
640
+ document.addEventListener("mouseup", E);
561
641
  }
562
642
  return !1;
563
643
  });
564
- }, Jt = Symbol("zIndex");
565
- let en = 99999;
566
- function Ae() {
567
- return ++en;
644
+ }, bn = Symbol("zIndex");
645
+ let zn = 99999;
646
+ function Ze() {
647
+ return ++zn;
568
648
  }
569
- const tn = ["id"], nn = {
649
+ const Cn = ["id"], wn = {
570
650
  key: 1,
571
651
  class: "slot-fragment"
572
- }, ln = ["innerHTML"], an = ["onClick"], on = {
652
+ }, Sn = ["innerHTML"], kn = ["onClick"], $n = {
573
653
  key: 2,
574
654
  class: "zan-layer-resize"
575
- }, pe = /* @__PURE__ */ A({
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 = dt(), u = g(!1), a = g(!1), r = g(t.id || Pe()), m = g(null), f = g(), s = bt(t.type), p = g(
654
- gt(t.type, t.area, t.offset)
655
- ), L = g(
656
- me(t.offset, p.value, s)
657
- ), O = g(99999), S = g(!1), x = g(p.value[0]), b = g(p.value[1]), w = g(L.value[0]), k = g(L.value[1]), F = g(""), E = g(""), H = g(""), j = g(""), le = g(!1), Q = g(t.value);
658
- J(
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
- Q.value = t.value;
784
+ te.value = t.value;
662
785
  }
663
786
  );
664
- const ge = () => {
665
- O.value = t.zIndex ?? Ae();
787
+ const Be = () => {
788
+ E.value = t.zIndex ?? Ze();
666
789
  };
667
- J(
790
+ re(
668
791
  () => t.zIndex,
669
792
  () => {
670
- ge();
793
+ Be();
671
794
  },
672
795
  { immediate: !0 }
673
796
  );
674
- const xe = function() {
675
- D(async () => {
676
- s == 4 && (p.value = Ne(t.offset, t.area)), s == 5 && (p.value = await He(
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 c = p.value;
680
- (c[0] == null || c[1] == null) && (c = Fe(m.value)), s == 6 && (L.value = zt(t.offset, c, r.value)), oe(), Le(), je();
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
- }, Te = function() {
683
- a.value && we(), u.value && ze(), F.value = "", E.value = "", H.value = "", j.value = "";
684
- }, be = () => {
685
- H.value = w.value, j.value = k.value, F.value = x.value, E.value = b.value, x.value = Be().w, b.value = Be().h, w.value = Oe().t, k.value = Oe().l;
686
- }, ze = () => {
687
- u.value ? (G(), x.value = F.value, b.value = E.value, t.revert(r.value)) : (X(), be(), t.full(r.value)), u.value = !u.value;
688
- }, Ce = () => {
689
- let ce = 10 + 190 * q(r.value, !0);
690
- const it = document.documentElement.clientWidth;
691
- ce + 180 > it && (ce = 10), F.value = x.value, E.value = b.value, H.value = w.value, j.value = k.value, b.value = "51px", x.value = "180px", w.value = "calc(100% - 51px)", k.value = ce + "px";
692
- }, we = async () => {
693
- a.value ? (G(), q(r.value, !1), x.value = F.value, b.value = E.value, t.revert(r.value)) : (X(), Ce(), t.min(r.value)), a.value = !a.value;
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
- J(
818
+ re(
696
819
  () => t.modelValue,
697
- (c) => {
698
- S.value !== c && (S.value = c);
820
+ (u) => {
821
+ $.value !== u && ($.value = u);
699
822
  },
700
823
  { immediate: !0 }
701
- ), J(
702
- () => S.value,
703
- (c, y) => {
704
- if (c !== y && !(!c && y === void 0)) {
705
- if (c) {
706
- le.value = !1, xe(), ge(), G(), t.isFunction && xe(), D(() => {
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
- X(), Te(), y !== void 0 && t.end(r.value);
834
+ Z(), ot(), f !== void 0 && t.end(r.value);
712
835
  }
713
836
  },
714
837
  { immediate: !0, flush: "post" }
715
838
  );
716
- const Ve = $(() => [
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
- ]), je = function() {
730
- t.move && s != 4 && D(() => {
731
- m.value && (Ut(
732
- m.value,
852
+ ]), st = function() {
853
+ t.move && s != 4 && P(() => {
854
+ y.value && (gn(
855
+ y.value,
733
856
  t.moveOut,
734
- (c, y) => {
735
- k.value = c, w.value = y, le.value = !0, a.value || (j.value = c, H.value = y), t.moving(r.value, { top: y, left: c });
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 c = {
739
- left: k.value,
740
- top: w.value,
861
+ const u = {
862
+ left: z.value,
863
+ top: H.value,
741
864
  isMin: a.value,
742
- isMax: u.value
743
- }, [y, C] = t.moveEnd(r.value, c) || [];
744
- C && y && (k.value = y, w.value = C);
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
- ), Kt(
750
- m.value,
751
- (c, y) => {
752
- b.value = y, x.value = c, E.value = y, F.value = c, t.resizing(r.value, { width: c, height: y });
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 c = {
756
- width: x.value,
757
- height: b.value
758
- }, [y, C] = t.resizeEnd(r.value, c) || [];
759
- y && C && (x.value = y, b.value = C);
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
- }, Re = $(() => ({
896
+ }, rt = O(() => ({
767
897
  position: t.teleportDisabled || t.teleport != "body" ? "absolute" : "fixed",
768
- top: w.value,
769
- left: k.value,
770
- height: b.value,
771
- width: x.value,
898
+ top: H.value,
899
+ left: z.value,
900
+ height: L.value,
901
+ width: b.value,
772
902
  animationDuration: t.animDuration,
773
- zIndex: O.value
774
- })), _e = $(() => [
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
- ]), ae = () => {
908
+ ]), fe = () => {
779
909
  if (typeof t.beforeClose == "function") {
780
- const c = t.beforeClose(r.value);
781
- (c === void 0 || c != null && c === !0) && (t.close(r.value), o("close"), o("update:modelValue", !1), t.internalDestroy && t.internalDestroy(), a.value && q(r.value, !a.value));
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
- }, We = (...c) => {
784
- typeof t.yes == "function" ? t.yes(...c) : ae();
785
- }, Xe = () => {
786
- t.shadeClose && ae();
787
- }, ke = $(() => ["zan-icon", `zan-icon-ico${t.icon}`]), Ye = $(() => s === 4 ? Ee(t.offset) : s === 6 ? wt(t.offset) : `zan-layer-anim-0${t.anim}`), Qe = $(() => s === 4 ? Ee(t.offset, !0) : t.isOutAnim ? "zan-layer-anim-close" : ""), Ge = () => {
788
- S.value = !0;
789
- }, Ze = () => {
790
- S.value = !1, s === 6 && Ct(r.value);
791
- }, qe = $(() => S.value && t.shade && !a.value), Ue = $(() => t.resize && !u.value && !a.value), Ke = $(() => t.title && s != 3 && s != 5 && s != 6), Je = function(c) {
792
- D(async () => {
793
- p.value = await He(t.imgList[c].src), L.value = me(t.offset, p.value, s), x.value = p.value[0], b.value = p.value[1], w.value = L.value[0], k.value = L.value[1], F.value = p.value[0], E.value = p.value[1];
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
- }, et = function() {
796
- t.zIndex || (O.value = Ae());
797
- }, tt = (c, y) => ((c == null ? void 0 : c[0]) || "") === ((y == null ? void 0 : y[0]) || "") && ((c == null ? void 0 : c[1]) || "") === ((y == null ? void 0 : y[1]) || ""), nt = () => {
798
- o("opened");
947
+ }, Ct = () => {
948
+ s === 6 && ke(t.offset), o("opened");
799
949
  };
800
- he(() => {
801
- }), ft(() => {
802
- X();
950
+ we(() => {
951
+ }), Je(() => {
952
+ Z();
803
953
  });
804
- let R, _ = 0;
805
- const G = function() {
806
- D(() => {
807
- !S.value || !f.value || R || s == 6 || f.value && !R && s != 6 && (R = new ResizeObserver(() => {
808
- m.value && (_ && cancelAnimationFrame(_), _ = requestAnimationFrame(() => {
809
- if (_ = 0, !m.value)
810
- return;
811
- const c = me(
812
- t.offset,
813
- Fe(m.value),
814
- s
815
- );
816
- if (tt(L.value, c) || (L.value = c), le.value && t.lastPosition)
817
- return;
818
- const y = t.lastPosition && H.value || c[0], C = t.lastPosition && j.value || c[1];
819
- w.value !== y && (w.value = y), k.value !== C && (k.value = C);
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
- }), R.observe(f.value));
961
+ }), q.observe(m.value));
822
962
  });
823
- }, X = function() {
824
- _ && (cancelAnimationFrame(_), _ = 0), R && (R.disconnect(), R = void 0);
825
- }, oe = function(c = !1) {
826
- w.value = c && t.lastPosition && H.value || L.value[0], k.value = c && t.lastPosition && j.value || L.value[1];
827
- }, Le = function() {
828
- x.value = p.value[0], b.value = p.value[1], F.value = p.value[0], E.value = p.value[1];
829
- }, lt = function() {
830
- G(), q(r.value, !1), a.value = !1, u.value = !1, le.value = !1, H.value = "", j.value = "", oe(), Le(), t.modelValue || o("update:modelValue", !0);
831
- }, at = async function() {
832
- a.value && (re(), oe(!0)), u.value || (await D(), X(), be(), u.value = !0);
833
- }, ot = async function() {
834
- u.value && (re(), oe(!0)), a.value || (await D(), X(), Ce(), a.value = !0);
835
- }, re = () => {
836
- G(), q(r.value, !1), a.value = !1, u.value = !1, x.value = F.value, b.value = E.value;
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: lt, open: Ge, close: Ze, full: at, min: ot, revert: re }), (c, y) => (d(), M(mt, {
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
- te(yt, {
843
- index: O.value,
987
+ ce(At, {
988
+ index: E.value,
844
989
  "shade-style": e.shadeStyle,
845
- visible: qe.value,
990
+ visible: pt.value,
846
991
  opacity: e.shadeOpacity,
847
992
  teleport: e.teleport,
848
993
  teleportDisabled: e.teleportDisabled,
849
- onShadeClick: Xe
994
+ onShadeClick: dt
850
995
  }, null, 8, ["index", "shade-style", "visible", "opacity", "teleport", "teleportDisabled"]),
851
- te(vt, {
852
- "enter-active-class": Ye.value,
853
- "leave-active-class": Qe.value,
854
- onAfterEnter: nt
996
+ ce(Ot, {
997
+ "enter-active-class": ft.value,
998
+ "leave-active-class": mt.value,
999
+ onAfterEnter: Ct
855
1000
  }, {
856
- default: fe(() => [
857
- S.value ? (d(), v("div", {
1001
+ default: xe(() => [
1002
+ $.value ? (d(), v("div", {
858
1003
  key: 0,
859
1004
  ref_key: "layerRef",
860
- ref: m,
861
- class: P(["zan-layer zan-layer-border", [Ve.value, { "zan-layer-min": a.value }]]),
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: N(Re.value)
1008
+ style: _(rt.value)
864
1009
  }, [
865
- Ke.value ? (d(), M(kt, {
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: et
1015
+ onMousedown: bt
871
1016
  }, {
872
- default: fe(() => [
873
- ee(c.$slots, "title")
1017
+ default: xe(() => [
1018
+ ue(u.$slots, "title")
874
1019
  ]),
875
1020
  _: 3
876
- }, 8, ["title", "titleStyle", "move"])) : h("", !0),
877
- B("div", {
1021
+ }, 8, ["title", "titleStyle", "move"])) : g("", !0),
1022
+ A("div", {
878
1023
  ref_key: "contentRef",
879
- ref: f,
880
- class: P(["zan-layer-content", _e.value]),
881
- style: N(a.value === !0 ? "display:none" : "")
1024
+ ref: m,
1025
+ class: j(["zan-layer-content", ut.value]),
1026
+ style: _(a.value === !0 ? "display:none" : "")
882
1027
  }, [
883
- z(s) === 0 || z(s) === 1 || z(s) === 4 ? (d(), v(W, { key: 0 }, [
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: P(ke.value)
887
- }, null, 2)) : h("", !0),
888
- z(i).default ? (d(), v("div", nn, [
889
- ee(c.$slots, "default")
890
- ])) : (d(), v(W, { key: 2 }, [
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: z(ne)(t.content)
895
- }, null, 8, ln)) : (d(), v(W, { key: 1 }, [
896
- t.content ? (d(), M(ie, {
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: () => z(ne)(t.content)
899
- }, null, 8, ["render"])) : h("", !0)
1043
+ render: () => C(de)(t.content)
1044
+ }, null, 8, ["render"])) : g("", !0)
900
1045
  ], 64))
901
1046
  ], 64))
902
- ], 64)) : h("", !0),
903
- z(s) === 7 ? (d(), M(Zt, {
1047
+ ], 64)) : g("", !0),
1048
+ C(s) === 7 ? (d(), R(pn, {
904
1049
  key: 1,
905
- "prompt-value": Q.value,
906
- "onUpdate:promptValue": y[0] || (y[0] = (C) => Q.value = C),
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"])) : h("", !0),
911
- z(s) === 2 ? (d(), M(ht, {
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"])) : h("", !0),
915
- z(s) === 5 ? (d(), M(Rt, {
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: Je
920
- }, null, 8, ["imgList", "startIndex"])) : h("", !0),
921
- z(s) === 6 ? (d(), M(Yt, {
1064
+ onResetCalculationPohtosArea: xt
1065
+ }, null, 8, ["imgList", "startIndex"])) : g("", !0),
1066
+ C(s) === 6 ? (d(), R(mn, {
922
1067
  key: 4,
923
- onClose: ae,
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: ke.value
929
- }, null, 8, ["title", "content", "isHtmlFragment", "icon", "iconClass"])) : h("", !0)
1073
+ iconClass: Ee.value,
1074
+ offset: t.offset
1075
+ }, null, 8, ["title", "content", "isHtmlFragment", "icon", "iconClass", "offset"])) : g("", !0)
930
1076
  ], 6),
931
- z(s) != 3 && z(s) != 5 && z(s) != 6 ? (d(), M(Ft, {
1077
+ C(s) != 3 && C(s) != 5 && C(s) != 6 ? (d(), R(Ut, {
932
1078
  key: 1,
933
1079
  maxmin: e.maxmin,
934
- max: u.value,
1080
+ max: c.value,
935
1081
  min: a.value,
936
1082
  closeBtn: e.closeBtn,
937
- onOnMin: we,
938
- onOnMax: ze,
939
- onOnClose: ae
940
- }, null, 8, ["maxmin", "max", "min", "closeBtn"])) : h("", !0),
941
- B("div", {
942
- style: N(a.value === !0 ? "display:none" : "")
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
- z(i).footer || t.footer ? (d(), M(Lt, {
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: fe(() => [
950
- ee(c.$slots, "footer")
1095
+ default: xe(() => [
1096
+ ue(u.$slots, "footer")
951
1097
  ]),
952
1098
  _: 3
953
- }, 8, ["footer", "footerStyle"])) : (d(), v(W, { key: 1 }, [
954
- (e.btn && e.btn.length > 0 || z(s) === 0 || z(s) === 7) && !e.isMessage ? (d(), v("div", {
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: P(["zan-layer-btn", [`zan-layer-btn-${e.btnAlign}`]])
1102
+ class: j(["zan-layer-btn", [`zan-layer-btn-${e.btnAlign}`]])
957
1103
  }, [
958
- e.btn && e.btn.length > 0 ? (d(!0), v(W, { key: 0 }, De(e.btn, (C, ue) => (d(), v("a", {
959
- key: ue,
960
- style: N(C.style),
961
- class: P([
962
- C.class,
963
- `zan-layer-btn${ue}`,
964
- { "zan-layer-btn-disabled": C.disabled }
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: (st) => !C.disabled && (z(s) === 7 ? C.callback(r.value, Q.value) : C.callback(r.value))
967
- }, T(C.text), 15, an))), 128)) : (d(), v(W, { key: 1 }, [
968
- z(s) === 0 || z(s) === 7 ? (d(), v("a", {
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: y[1] || (y[1] = (C) => We(r.value, Q.value))
972
- }, T(e.yesText), 1)) : h("", !0)
1117
+ onClick: f[1] || (f[1] = (p) => ct(r.value, te.value))
1118
+ }, X(e.yesText), 1)) : g("", !0)
973
1119
  ], 64))
974
- ], 2)) : h("", !0)
1120
+ ], 2)) : g("", !0)
975
1121
  ], 64))
976
1122
  ], 4),
977
- Ue.value ? (d(), v("span", on)) : h("", !0)
978
- ], 14, tn)) : h("", !0)
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
- }), V = [], sn = (e) => {
985
- V.push(e);
986
- }, ve = (e) => {
987
- V.forEach((n, l) => {
988
- n.modalContainer.id === e && V.splice(l, 1);
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
- }, rn = () => {
991
- V.splice(0, V.length);
992
- }, U = (e) => {
1136
+ }, Bn = () => {
1137
+ Y.splice(0, Y.length);
1138
+ }, K = (e) => {
993
1139
  let n = !1;
994
- return V.forEach((l, t) => {
1140
+ return Y.forEach((l, t) => {
995
1141
  l.modalContainer.id == e && (n = !0);
996
1142
  }), n;
997
- }, K = (e) => {
1143
+ }, J = (e) => {
998
1144
  let n = null;
999
- return V.forEach((l, t) => {
1145
+ return Y.forEach((l, t) => {
1000
1146
  l.modalContainer.id === e && (n = l);
1001
1147
  }), n;
1002
- }, un = (e, n) => (e && (n = Object.assign(n, e)), n), cn = (e) => {
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
- }, dn = (e) => typeof e == "function" ? Ie(e()) ? { default: () => e() } : void 0 : Ie(e) ? { default: () => e } : void 0, I = {
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 I.create(e, n);
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 I.create(e, n);
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 I.create(n, t, l);
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 I.create(n, l);
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 I.create(n, l);
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 I.create(e, l, n);
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 I.create(e, n);
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 I.create(e, n);
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 = un(e, n);
1097
- o.hasOwnProperty("id") ? I.close(o.id) : o.id = Pe();
1098
- const i = cn(o), u = Me(
1099
- pe,
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 m, f;
1105
- t && clearTimeout(t), (f = (m = u.component) == null ? void 0 : m.exposed) == null || f.close(), setTimeout(() => {
1106
- Z(null, i), document.body.contains(i) && document.body.removeChild(i);
1107
- }, 500), ve(i.id);
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
- dn(o.content)
1256
+ Fn(o.content)
1111
1257
  );
1112
- return u.appContext = o.appContext || I._context, Z(u, i), (r = (a = u.component) == null ? void 0 : a.exposed) == null || r.open(), n && n.time != null && n.time != 0 && (t = setTimeout(() => {
1113
- var m, f;
1114
- (f = (m = u.component) == null ? void 0 : m.exposed) == null || f.close(), l && l(i.id), setTimeout(() => {
1115
- Z(null, i), document.body.contains(i) && document.body.removeChild(i);
1116
- }, 500), ve(i.id);
1117
- }, n.time)), sn({ modalContainer: i, modalInstance: u }), i.id;
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 && U(e)) {
1123
- const t = K(e);
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
- Z(null, t.modalContainer), document.body.contains(t.modalContainer) && document.body.removeChild(t.modalContainer);
1271
+ oe(null, t.modalContainer), document.body.contains(t.modalContainer) && document.body.removeChild(t.modalContainer);
1126
1272
  }, 500);
1127
1273
  }
1128
- ve(e);
1274
+ ze(e);
1129
1275
  },
1130
1276
  // 关闭所有弹窗
1131
1277
  closeAll: () => {
1132
- V.forEach((e) => {
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
- Z(null, e.modalContainer), document.body.contains(e.modalContainer) && document.body.removeChild(e.modalContainer);
1281
+ oe(null, e.modalContainer), document.body.contains(e.modalContainer) && document.body.removeChild(e.modalContainer);
1136
1282
  }, 500);
1137
- }), rn();
1283
+ }), Bn();
1138
1284
  },
1139
1285
  // 重置位置
1140
1286
  reset: (e) => {
1141
1287
  var n, l;
1142
- e != null && U(e) && ((l = (n = K(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.reset());
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 && U(e) && ((l = (n = K(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.min());
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 && U(e) && ((l = (n = K(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.full());
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 && U(e) && ((l = (n = K(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.revert());
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
- }, fn = (e, n) => {
1160
- I._context = e._context, e.component(pe.name, pe), e.config.globalProperties.$layer = I, n && typeof n.zIndex == "number" && e.provide(Jt, g(n.zIndex));
1161
- }, vn = {
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
- fn(e, n);
1314
+ On(e, n);
1164
1315
  }
1165
1316
  };
1166
1317
  export {
1167
- pe as ZanLayer,
1168
- vn as default,
1169
- I as layer,
1170
- I as zanLayer
1318
+ Ce as ZanLayer,
1319
+ Mn as default,
1320
+ F as layer,
1321
+ F as zanLayer
1171
1322
  };