@xto/feedback 1.0.4 → 1.1.1

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/es/index.mjs CHANGED
@@ -1,10 +1,12 @@
1
- import { defineComponent as O, ref as E, computed as I, watch as ne, openBlock as v, createBlock as X, Teleport as le, createVNode as ie, Transition as j, withCtx as F, createElementBlock as $, normalizeStyle as N, normalizeClass as g, unref as x, createElementVNode as z, withModifiers as pe, renderSlot as L, createTextVNode as W, toDisplayString as V, createCommentVNode as M, withDirectives as me, vShow as he, nextTick as Q, onUnmounted as ae, onMounted as ve, reactive as be, createApp as ge, h as b } from "vue";
2
- import { useNamespace as U, useZIndex as we, useEscape as Ce, nextMessageZIndex as ke } from "@xto/core";
3
- const Ze = /* @__PURE__ */ O({
1
+ import { defineComponent as A, ref as E, computed as I, watch as le, resolveComponent as be, openBlock as x, createBlock as j, Teleport as ie, createVNode as U, Transition as F, withCtx as O, createElementBlock as $, normalizeStyle as H, normalizeClass as v, unref as b, createElementVNode as z, withModifiers as pe, renderSlot as L, createTextVNode as N, toDisplayString as V, createCommentVNode as M, withDirectives as me, vShow as he, nextTick as ee, onUnmounted as ae, onMounted as ve, reactive as we, createApp as ge, h as C } from "vue";
2
+ import { useNamespace as Y, useZIndex as ke, useEscape as Ce, nextMessageZIndex as Be } from "@xto/core";
3
+ const Ke = /* @__PURE__ */ A({
4
4
  name: "XModal",
5
+ inheritAttrs: !1,
5
6
  __name: "index",
6
7
  props: {
7
- modelValue: { type: Boolean, default: !1 },
8
+ modelValue: { type: Boolean, default: void 0 },
9
+ open: { type: Boolean, default: void 0 },
8
10
  title: { default: "" },
9
11
  width: { default: "50%" },
10
12
  top: { default: "15vh" },
@@ -15,79 +17,109 @@ const Ze = /* @__PURE__ */ O({
15
17
  center: { type: Boolean, default: !1 },
16
18
  destroyOnClose: { type: Boolean, default: !1 }
17
19
  },
18
- emits: ["update:modelValue", "close", "open"],
19
- setup(e, { emit: l }) {
20
- const t = e, a = l, o = U("modal"), { next: i } = we(), f = E(i()), d = I({
21
- get: () => t.modelValue,
22
- set: (p) => a("update:modelValue", p)
20
+ emits: ["update:modelValue", "update:open", "close", "open", "ok", "cancel"],
21
+ setup(e, { emit: i }) {
22
+ const t = e, l = i, o = Y("modal"), { next: a } = ke(), f = E(a()), d = I({
23
+ get: () => t.modelValue !== void 0 ? t.modelValue : t.open !== void 0 ? t.open : !1,
24
+ set: (g) => {
25
+ l("update:modelValue", g), l("update:open", g);
26
+ }
23
27
  }), u = E(), n = () => {
24
- d.value = !1, a("close");
25
- }, m = () => {
28
+ d.value = !1, l("cancel"), l("close");
29
+ }, p = () => {
30
+ l("ok");
31
+ }, r = () => {
26
32
  t.closeOnClickModal && t.modal && n();
27
33
  };
28
34
  Ce(() => {
29
35
  t.closeOnPressEscape && d.value && n();
30
- }), ne(() => t.modelValue, (p) => {
31
- p && (f.value = i(), a("open"));
32
- });
33
- const r = I(() => ({
36
+ }), le(() => [t.modelValue, t.open], ([g, h]) => {
37
+ (g !== void 0 ? g : h) && (f.value = a(), l("open"));
38
+ }, { immediate: !0 });
39
+ const m = I(() => ({
34
40
  paddingTop: t.top
35
- })), h = I(() => ({
41
+ })), w = I(() => ({
36
42
  width: typeof t.width == "number" ? `${t.width}px` : t.width,
37
43
  zIndex: f.value
38
44
  }));
39
- return (p, B) => (v(), X(le, { to: "body" }, [
40
- ie(j, { name: "x-modal-fade" }, {
41
- default: F(() => [
42
- e.modelValue ? (v(), $("div", {
43
- key: 0,
44
- class: g(x(o).e("wrapper")),
45
- style: N(r.value),
46
- onClick: m
47
- }, [
48
- z("div", {
49
- ref_key: "modalRef",
50
- ref: u,
51
- class: g(x(o).b()),
52
- style: N(h.value),
53
- onClick: B[0] || (B[0] = pe(() => {
54
- }, ["stop"]))
45
+ return (g, h) => {
46
+ const y = be("x-button");
47
+ return x(), j(ie, { to: "body" }, [
48
+ U(F, { name: "x-modal-fade" }, {
49
+ default: O(() => [
50
+ d.value ? (x(), $("div", {
51
+ key: 0,
52
+ class: v(b(o).e("wrapper")),
53
+ style: H(m.value),
54
+ onClick: r
55
55
  }, [
56
56
  z("div", {
57
- class: g(x(o).e("header"))
57
+ ref_key: "modalRef",
58
+ ref: u,
59
+ class: v(b(o).b()),
60
+ style: H(w.value),
61
+ onClick: h[0] || (h[0] = pe(() => {
62
+ }, ["stop"]))
58
63
  }, [
59
- z("span", {
60
- class: g(x(o).e("title"))
64
+ z("div", {
65
+ class: v(b(o).e("header"))
61
66
  }, [
62
- L(p.$slots, "title", {}, () => [
63
- W(V(e.title), 1)
64
- ])
67
+ z("span", {
68
+ class: v(b(o).e("title"))
69
+ }, [
70
+ L(g.$slots, "title", {}, () => [
71
+ N(V(e.title), 1)
72
+ ])
73
+ ], 2),
74
+ e.showClose ? (x(), $("button", {
75
+ key: 0,
76
+ class: v(b(o).e("close")),
77
+ onClick: n
78
+ }, " ✕ ", 2)) : M("", !0)
65
79
  ], 2),
66
- e.showClose ? (v(), $("button", {
80
+ z("div", {
81
+ class: v(b(o).e("body"))
82
+ }, [
83
+ L(g.$slots, "default")
84
+ ], 2),
85
+ g.$slots.footer ? (x(), $("div", {
67
86
  key: 0,
68
- class: g(x(o).e("close")),
69
- onClick: n
70
- }, "", 2)) : M("", !0)
71
- ], 2),
72
- z("div", {
73
- class: g(x(o).e("body"))
74
- }, [
75
- L(p.$slots, "default")
76
- ], 2),
77
- p.$slots.footer ? (v(), $("div", {
78
- key: 0,
79
- class: g(x(o).e("footer"))
80
- }, [
81
- L(p.$slots, "footer")
82
- ], 2)) : M("", !0)
83
- ], 6)
84
- ], 6)) : M("", !0)
85
- ]),
86
- _: 3
87
- })
88
- ]));
87
+ class: v(b(o).e("footer"))
88
+ }, [
89
+ L(g.$slots, "footer", {
90
+ ok: p,
91
+ cancel: n
92
+ })
93
+ ], 2)) : g.$slots.footer ? M("", !0) : (x(), $("div", {
94
+ key: 1,
95
+ class: v(b(o).e("footer"))
96
+ }, [
97
+ U(y, { onClick: n }, {
98
+ default: O(() => [...h[1] || (h[1] = [
99
+ N("取消", -1)
100
+ ])]),
101
+ _: 1
102
+ }),
103
+ U(y, {
104
+ type: "primary",
105
+ style: { "margin-left": "8px" },
106
+ onClick: p
107
+ }, {
108
+ default: O(() => [...h[2] || (h[2] = [
109
+ N("确定", -1)
110
+ ])]),
111
+ _: 1
112
+ })
113
+ ], 2))
114
+ ], 6)
115
+ ], 6)) : M("", !0)
116
+ ]),
117
+ _: 3
118
+ })
119
+ ]);
120
+ };
89
121
  }
90
- }), Ke = /* @__PURE__ */ O({
122
+ }), Ue = /* @__PURE__ */ A({
91
123
  name: "XDrawer",
92
124
  inheritAttrs: !1,
93
125
  __name: "index",
@@ -104,67 +136,67 @@ const Ze = /* @__PURE__ */ O({
104
136
  destroyOnClose: { type: Boolean, default: !1 }
105
137
  },
106
138
  emits: ["update:modelValue", "close", "open"],
107
- setup(e, { emit: l }) {
108
- const t = e, a = l, o = U("drawer"), i = E(2e3), f = () => {
109
- a("update:modelValue", !1), a("close");
139
+ setup(e, { emit: i }) {
140
+ const t = e, l = i, o = Y("drawer"), a = E(2e3), f = () => {
141
+ l("update:modelValue", !1), l("close");
110
142
  }, d = () => {
111
143
  t.closeOnClickModal && f();
112
144
  }, u = (r) => {
113
145
  r.key === "Escape" && t.modelValue && f();
114
146
  };
115
- ne(() => t.modelValue, (r) => {
116
- r ? (i.value = 2e3 + Math.floor(Math.random() * 100), a("open"), document.addEventListener("keydown", u)) : document.removeEventListener("keydown", u);
147
+ le(() => t.modelValue, (r) => {
148
+ r ? (a.value = 2e3 + Math.floor(Math.random() * 100), l("open"), document.addEventListener("keydown", u)) : document.removeEventListener("keydown", u);
117
149
  });
118
150
  const n = I(() => ({
119
- zIndex: i.value
120
- })), m = I(() => {
121
- const r = t.direction ?? t.placement ?? "rtl", h = t.size ?? t.width ?? "30%", p = typeof h == "number" ? `${h}px` : h;
151
+ zIndex: a.value
152
+ })), p = I(() => {
153
+ const r = t.direction ?? t.placement ?? "rtl", m = t.size ?? t.width ?? "30%", w = typeof m == "number" ? `${m}px` : m;
122
154
  return {
123
- ltr: { width: p, height: "100%" },
124
- rtl: { width: p, height: "100%" },
125
- ttb: { width: "100%", height: p },
126
- btt: { width: "100%", height: p }
155
+ ltr: { width: w, height: "100%" },
156
+ rtl: { width: w, height: "100%" },
157
+ ttb: { width: "100%", height: w },
158
+ btt: { width: "100%", height: w }
127
159
  }[r];
128
160
  });
129
- return (r, h) => (v(), X(le, { to: "body" }, [
130
- ie(j, { name: "x-drawer-fade" }, {
131
- default: F(() => [
161
+ return (r, m) => (x(), j(ie, { to: "body" }, [
162
+ U(F, { name: "x-drawer-fade" }, {
163
+ default: O(() => [
132
164
  me(z("div", {
133
- class: g(x(o).e("overlay")),
134
- style: N(n.value),
165
+ class: v(b(o).e("overlay")),
166
+ style: H(n.value),
135
167
  onClick: d
136
168
  }, [
137
169
  z("div", {
138
- class: g([x(o).b(), x(o).m(e.direction ?? e.placement)]),
139
- style: N(m.value),
140
- onClick: h[0] || (h[0] = pe(() => {
170
+ class: v([b(o).b(), b(o).m(e.direction ?? e.placement)]),
171
+ style: H(p.value),
172
+ onClick: m[0] || (m[0] = pe(() => {
141
173
  }, ["stop"]))
142
174
  }, [
143
- e.withHeader ? (v(), $("div", {
175
+ e.withHeader ? (x(), $("div", {
144
176
  key: 0,
145
- class: g(x(o).e("header"))
177
+ class: v(b(o).e("header"))
146
178
  }, [
147
179
  z("span", {
148
- class: g(x(o).e("title"))
180
+ class: v(b(o).e("title"))
149
181
  }, [
150
182
  L(r.$slots, "title", {}, () => [
151
- W(V(e.title), 1)
183
+ N(V(e.title), 1)
152
184
  ])
153
185
  ], 2),
154
- e.showClose ? (v(), $("button", {
186
+ e.showClose ? (x(), $("button", {
155
187
  key: 0,
156
- class: g(x(o).e("close")),
188
+ class: v(b(o).e("close")),
157
189
  onClick: f
158
190
  }, " ✕ ", 2)) : M("", !0)
159
191
  ], 2)) : M("", !0),
160
192
  z("div", {
161
- class: g(x(o).e("body"))
193
+ class: v(b(o).e("body"))
162
194
  }, [
163
195
  L(r.$slots, "default")
164
196
  ], 2),
165
- r.$slots.footer ? (v(), $("div", {
197
+ r.$slots.footer ? (x(), $("div", {
166
198
  key: 1,
167
- class: g(x(o).e("footer"))
199
+ class: v(b(o).e("footer"))
168
200
  }, [
169
201
  L(r.$slots, "footer")
170
202
  ], 2)) : M("", !0)
@@ -177,7 +209,7 @@ const Ze = /* @__PURE__ */ O({
177
209
  })
178
210
  ]));
179
211
  }
180
- }), Ue = /* @__PURE__ */ O({
212
+ }), Ye = /* @__PURE__ */ A({
181
213
  name: "XAlert",
182
214
  __name: "index",
183
215
  props: {
@@ -189,8 +221,8 @@ const Ze = /* @__PURE__ */ O({
189
221
  center: { type: Boolean, default: !1 }
190
222
  },
191
223
  emits: ["close"],
192
- setup(e, { emit: l }) {
193
- const t = e, a = l, o = U("alert"), i = E(!0), f = {
224
+ setup(e, { emit: i }) {
225
+ const t = e, l = i, o = Y("alert"), a = E(!0), f = {
194
226
  success: "✓",
195
227
  warning: "⚠",
196
228
  error: "✕",
@@ -201,41 +233,41 @@ const Ze = /* @__PURE__ */ O({
201
233
  o.is("center", t.center),
202
234
  o.is("with-description", t.description)
203
235
  ]), u = (n) => {
204
- i.value = !1, a("close", n);
236
+ a.value = !1, l("close", n);
205
237
  };
206
- return (n, m) => (v(), X(j, { name: "x-alert-fade" }, {
207
- default: F(() => [
208
- i.value ? (v(), $("div", {
238
+ return (n, p) => (x(), j(F, { name: "x-alert-fade" }, {
239
+ default: O(() => [
240
+ a.value ? (x(), $("div", {
209
241
  key: 0,
210
- class: g(d.value)
242
+ class: v(d.value)
211
243
  }, [
212
- e.showIcon ? (v(), $("span", {
244
+ e.showIcon ? (x(), $("span", {
213
245
  key: 0,
214
- class: g(x(o).e("icon"))
246
+ class: v(b(o).e("icon"))
215
247
  }, V(f[e.type]), 3)) : M("", !0),
216
248
  z("div", {
217
- class: g(x(o).e("content"))
249
+ class: v(b(o).e("content"))
218
250
  }, [
219
- e.title || n.$slots.title ? (v(), $("span", {
251
+ e.title || n.$slots.title ? (x(), $("span", {
220
252
  key: 0,
221
- class: g(x(o).e("title"))
253
+ class: v(b(o).e("title"))
222
254
  }, [
223
255
  L(n.$slots, "title", {}, () => [
224
- W(V(e.title), 1)
256
+ N(V(e.title), 1)
225
257
  ])
226
258
  ], 2)) : M("", !0),
227
- e.description || n.$slots.default ? (v(), $("span", {
259
+ e.description || n.$slots.default ? (x(), $("span", {
228
260
  key: 1,
229
- class: g(x(o).e("description"))
261
+ class: v(b(o).e("description"))
230
262
  }, [
231
263
  L(n.$slots, "default", {}, () => [
232
- W(V(e.description), 1)
264
+ N(V(e.description), 1)
233
265
  ])
234
266
  ], 2)) : M("", !0)
235
267
  ], 2),
236
- e.closable ? (v(), $("button", {
268
+ e.closable ? (x(), $("button", {
237
269
  key: 1,
238
- class: g(x(o).e("close")),
270
+ class: v(b(o).e("close")),
239
271
  onClick: u
240
272
  }, " ✕ ", 2)) : M("", !0)
241
273
  ], 2)) : M("", !0)
@@ -243,7 +275,7 @@ const Ze = /* @__PURE__ */ O({
243
275
  _: 3
244
276
  }));
245
277
  }
246
- }), Ye = /* @__PURE__ */ O({
278
+ }), qe = /* @__PURE__ */ A({
247
279
  name: "XTooltip",
248
280
  __name: "index",
249
281
  props: {
@@ -259,115 +291,115 @@ const Ze = /* @__PURE__ */ O({
259
291
  closeDelay: { default: 0 }
260
292
  },
261
293
  emits: ["update:visible", "show", "hide"],
262
- setup(e, { emit: l }) {
263
- const t = e, a = l, o = U("tooltip"), i = E(!1), f = E(), d = E();
294
+ setup(e, { emit: i }) {
295
+ const t = e, l = i, o = Y("tooltip"), a = E(!1), f = E(), d = E();
264
296
  let u, n;
265
- const m = E({}), r = () => {
297
+ const p = E({}), r = () => {
266
298
  if (!f.value || !d.value) return;
267
- const k = f.value.getBoundingClientRect(), _ = d.value;
268
- _.style.visibility = "hidden", _.style.display = "block";
269
- const H = _.offsetWidth, D = _.offsetHeight, A = t.offset, ce = window.innerWidth, de = window.innerHeight;
270
- let P = 0, R = 0, Y = t.placement;
299
+ const B = f.value.getBoundingClientRect(), W = d.value;
300
+ W.style.visibility = "hidden", W.style.display = "block";
301
+ const _ = W.offsetWidth, X = W.offsetHeight, D = t.offset, ce = window.innerWidth, de = window.innerHeight;
302
+ let P = 0, R = 0, q = t.placement;
271
303
  switch (t.placement) {
272
304
  case "top":
273
- P = k.top - D - A, R = k.left + (k.width - H) / 2;
305
+ P = B.top - X - D, R = B.left + (B.width - _) / 2;
274
306
  break;
275
307
  case "bottom":
276
- P = k.bottom + A, R = k.left + (k.width - H) / 2;
308
+ P = B.bottom + D, R = B.left + (B.width - _) / 2;
277
309
  break;
278
310
  case "left":
279
- P = k.top + (k.height - D) / 2, R = k.left - H - A;
311
+ P = B.top + (B.height - X) / 2, R = B.left - _ - D;
280
312
  break;
281
313
  case "right":
282
- P = k.top + (k.height - D) / 2, R = k.right + A;
314
+ P = B.top + (B.height - X) / 2, R = B.right + D;
283
315
  break;
284
316
  }
285
- t.placement === "top" && P < 0 ? (Y = "bottom", P = k.bottom + A) : t.placement === "bottom" && P + D > de ? (Y = "top", P = k.top - D - A) : t.placement === "left" && R < 0 ? (Y = "right", R = k.right + A) : t.placement === "right" && R + H > ce && (Y = "left", R = k.left - H - A), R < 8 && (R = 8), R + H > ce - 8 && (R = ce - H - 8), P < 8 && (P = 8), P + D > de - 8 && (P = de - D - 8), m.value = {
317
+ t.placement === "top" && P < 0 ? (q = "bottom", P = B.bottom + D) : t.placement === "bottom" && P + X > de ? (q = "top", P = B.top - X - D) : t.placement === "left" && R < 0 ? (q = "right", R = B.right + D) : t.placement === "right" && R + _ > ce && (q = "left", R = B.left - _ - D), R < 8 && (R = 8), R + _ > ce - 8 && (R = ce - _ - 8), P < 8 && (P = 8), P + X > de - 8 && (P = de - X - 8), p.value = {
286
318
  position: "fixed",
287
319
  top: `${P}px`,
288
320
  left: `${R}px`,
289
321
  visibility: "visible",
290
322
  zIndex: "2000"
291
- }, h.value = Y;
292
- }, h = E(t.placement), p = () => {
323
+ }, m.value = q;
324
+ }, m = E(t.placement), w = () => {
293
325
  t.disabled || (clearTimeout(n), u = setTimeout(() => {
294
- i.value = !0, a("update:visible", !0), a("show"), Q(() => {
326
+ a.value = !0, l("update:visible", !0), l("show"), ee(() => {
295
327
  r();
296
328
  });
297
329
  }, t.openDelay));
298
- }, B = () => {
330
+ }, g = () => {
299
331
  clearTimeout(u), n = setTimeout(() => {
300
- i.value = !1, a("update:visible", !1), a("hide");
332
+ a.value = !1, l("update:visible", !1), l("hide");
301
333
  }, t.closeDelay);
302
- }, w = () => {
303
- i.value ? B() : p();
304
- }, C = () => {
305
- t.trigger === "hover" && p();
334
+ }, h = () => {
335
+ a.value ? g() : w();
336
+ }, y = () => {
337
+ t.trigger === "hover" && w();
306
338
  }, s = () => {
307
- t.trigger === "hover" && B();
339
+ t.trigger === "hover" && g();
308
340
  }, c = () => {
309
- t.trigger === "click" && w();
341
+ t.trigger === "click" && h();
310
342
  }, Z = () => {
311
- t.trigger === "focus" && p();
343
+ t.trigger === "focus" && w();
312
344
  }, S = () => {
313
- t.trigger === "focus" && B();
314
- }, T = (k) => {
315
- var _, H;
316
- t.trigger === "click" && !((_ = f.value) != null && _.contains(k.target)) && !((H = d.value) != null && H.contains(k.target)) && B();
317
- }, y = () => {
318
- i.value && r();
345
+ t.trigger === "focus" && g();
346
+ }, T = (B) => {
347
+ var W, _;
348
+ t.trigger === "click" && !((W = f.value) != null && W.contains(B.target)) && !((_ = d.value) != null && _.contains(B.target)) && g();
349
+ }, k = () => {
350
+ a.value && r();
319
351
  };
320
- ne(i, (k) => {
321
- k ? Q(() => {
322
- r(), t.trigger === "click" && document.addEventListener("click", T), window.addEventListener("scroll", y, !0), window.addEventListener("resize", y);
323
- }) : (document.removeEventListener("click", T), window.removeEventListener("scroll", y, !0), window.removeEventListener("resize", y));
352
+ le(a, (B) => {
353
+ B ? ee(() => {
354
+ r(), t.trigger === "click" && document.addEventListener("click", T), window.addEventListener("scroll", k, !0), window.addEventListener("resize", k);
355
+ }) : (document.removeEventListener("click", T), window.removeEventListener("scroll", k, !0), window.removeEventListener("resize", k));
324
356
  }), ae(() => {
325
- clearTimeout(u), clearTimeout(n), document.removeEventListener("click", T), window.removeEventListener("scroll", y, !0), window.removeEventListener("resize", y);
357
+ clearTimeout(u), clearTimeout(n), document.removeEventListener("click", T), window.removeEventListener("scroll", k, !0), window.removeEventListener("resize", k);
326
358
  });
327
- const ee = I(() => [
359
+ const te = I(() => [
328
360
  o.b(),
329
361
  o.m(t.effect)
330
- ]), te = I(() => [
362
+ ]), oe = I(() => [
331
363
  o.e("arrow"),
332
- o.e(`arrow-${h.value}`)
364
+ o.e(`arrow-${m.value}`)
333
365
  ]);
334
- return (k, _) => (v(), $("div", {
335
- class: g(x(o).e("wrapper"))
366
+ return (B, W) => (x(), $("div", {
367
+ class: v(b(o).e("wrapper"))
336
368
  }, [
337
369
  z("div", {
338
370
  ref_key: "triggerRef",
339
371
  ref: f,
340
- class: g(x(o).e("trigger")),
341
- onMouseenter: C,
372
+ class: v(b(o).e("trigger")),
373
+ onMouseenter: y,
342
374
  onMouseleave: s,
343
375
  onClick: c,
344
376
  onFocus: Z,
345
377
  onBlur: S
346
378
  }, [
347
- L(k.$slots, "default")
379
+ L(B.$slots, "default")
348
380
  ], 34),
349
- (v(), X(le, { to: "body" }, [
350
- ie(j, {
381
+ (x(), j(ie, { to: "body" }, [
382
+ U(F, {
351
383
  name: `x-tooltip-${e.transition}`
352
384
  }, {
353
- default: F(() => [
385
+ default: O(() => [
354
386
  me(z("div", {
355
387
  ref_key: "tooltipRef",
356
388
  ref: d,
357
- class: g(ee.value),
358
- style: N(m.value),
359
- onMouseenter: C,
389
+ class: v(te.value),
390
+ style: H(p.value),
391
+ onMouseenter: y,
360
392
  onMouseleave: s
361
393
  }, [
362
- L(k.$slots, "content", {}, () => [
363
- W(V(e.content), 1)
394
+ L(B.$slots, "content", {}, () => [
395
+ N(V(e.content), 1)
364
396
  ]),
365
- e.visibleArrow ? (v(), $("div", {
397
+ e.visibleArrow ? (x(), $("div", {
366
398
  key: 0,
367
- class: g(te.value)
399
+ class: v(oe.value)
368
400
  }, null, 2)) : M("", !0)
369
401
  ], 38), [
370
- [he, i.value]
402
+ [he, a.value]
371
403
  ])
372
404
  ]),
373
405
  _: 3
@@ -375,7 +407,7 @@ const Ze = /* @__PURE__ */ O({
375
407
  ]))
376
408
  ], 2));
377
409
  }
378
- }), Be = { class: "x-popconfirm-wrapper" }, Te = { class: "x-popconfirm__main" }, $e = { class: "x-popconfirm__title" }, Ee = { class: "x-popconfirm__action" }, qe = /* @__PURE__ */ O({
410
+ }), Te = { class: "x-popconfirm-wrapper" }, $e = { class: "x-popconfirm__main" }, Ee = { class: "x-popconfirm__title" }, Me = { class: "x-popconfirm__action" }, Ge = /* @__PURE__ */ A({
379
411
  name: "XPopconfirm",
380
412
  __name: "index",
381
413
  props: {
@@ -396,80 +428,80 @@ const Ze = /* @__PURE__ */ O({
396
428
  showArrow: { type: Boolean, default: !0 }
397
429
  },
398
430
  emits: ["confirm", "cancel"],
399
- setup(e, { emit: l }) {
400
- const t = e, a = l, o = E(!1), i = E(null), f = E(null), d = E({}), u = () => {
401
- if (!i.value || !f.value) return;
402
- const s = i.value.getBoundingClientRect(), c = f.value.getBoundingClientRect(), Z = t.placement, S = t.offset;
403
- let T = 0, y = 0;
431
+ setup(e, { emit: i }) {
432
+ const t = e, l = i, o = E(!1), a = E(null), f = E(null), d = E({}), u = () => {
433
+ if (!a.value || !f.value) return;
434
+ const s = a.value.getBoundingClientRect(), c = f.value.getBoundingClientRect(), Z = t.placement, S = t.offset;
435
+ let T = 0, k = 0;
404
436
  switch (Z) {
405
437
  case "top":
406
- T = s.top - c.height - S, y = s.left + (s.width - c.width) / 2;
438
+ T = s.top - c.height - S, k = s.left + (s.width - c.width) / 2;
407
439
  break;
408
440
  case "top-start":
409
- T = s.top - c.height - S, y = s.left;
441
+ T = s.top - c.height - S, k = s.left;
410
442
  break;
411
443
  case "top-end":
412
- T = s.top - c.height - S, y = s.right - c.width;
444
+ T = s.top - c.height - S, k = s.right - c.width;
413
445
  break;
414
446
  case "bottom":
415
- T = s.bottom + S, y = s.left + (s.width - c.width) / 2;
447
+ T = s.bottom + S, k = s.left + (s.width - c.width) / 2;
416
448
  break;
417
449
  case "bottom-start":
418
- T = s.bottom + S, y = s.left;
450
+ T = s.bottom + S, k = s.left;
419
451
  break;
420
452
  case "bottom-end":
421
- T = s.bottom + S, y = s.right - c.width;
453
+ T = s.bottom + S, k = s.right - c.width;
422
454
  break;
423
455
  case "left":
424
- T = s.top + (s.height - c.height) / 2, y = s.left - c.width - S;
456
+ T = s.top + (s.height - c.height) / 2, k = s.left - c.width - S;
425
457
  break;
426
458
  case "left-start":
427
- T = s.top, y = s.left - c.width - S;
459
+ T = s.top, k = s.left - c.width - S;
428
460
  break;
429
461
  case "left-end":
430
- T = s.bottom - c.height, y = s.left - c.width - S;
462
+ T = s.bottom - c.height, k = s.left - c.width - S;
431
463
  break;
432
464
  case "right":
433
- T = s.top + (s.height - c.height) / 2, y = s.right + S;
465
+ T = s.top + (s.height - c.height) / 2, k = s.right + S;
434
466
  break;
435
467
  case "right-start":
436
- T = s.top, y = s.right + S;
468
+ T = s.top, k = s.right + S;
437
469
  break;
438
470
  case "right-end":
439
- T = s.bottom - c.height, y = s.right + S;
471
+ T = s.bottom - c.height, k = s.right + S;
440
472
  break;
441
473
  default:
442
- T = s.top - c.height - S, y = s.left + (s.width - c.width) / 2;
474
+ T = s.top - c.height - S, k = s.left + (s.width - c.width) / 2;
443
475
  }
444
- const ee = window.innerWidth, te = window.innerHeight;
445
- y < 0 && (y = 10), y + c.width > ee && (y = ee - c.width - 10), T < 0 && (T = 10), T + c.height > te && (T = te - c.height - 10), d.value = {
476
+ const te = window.innerWidth, oe = window.innerHeight;
477
+ k < 0 && (k = 10), k + c.width > te && (k = te - c.width - 10), T < 0 && (T = 10), T + c.height > oe && (T = oe - c.height - 10), d.value = {
446
478
  position: "fixed",
447
479
  top: `${T}px`,
448
- left: `${y}px`,
480
+ left: `${k}px`,
449
481
  zIndex: "2000"
450
482
  };
451
483
  }, n = (s) => {
452
484
  var c, Z;
453
- o.value && ((c = i.value) != null && c.contains(s.target) || (Z = f.value) != null && Z.contains(s.target) || (o.value = !1));
454
- }, m = (s) => {
485
+ o.value && ((c = a.value) != null && c.contains(s.target) || (Z = f.value) != null && Z.contains(s.target) || (o.value = !1));
486
+ }, p = (s) => {
455
487
  t.disabled || (s.stopPropagation(), o.value = !o.value, o.value && setTimeout(u, 0));
456
488
  }, r = () => {
457
- o.value = !1, a("confirm");
458
- }, h = () => {
459
- o.value = !1, a("cancel");
460
- }, p = () => {
489
+ o.value = !1, l("confirm");
490
+ }, m = () => {
491
+ o.value = !1, l("cancel");
492
+ }, w = () => {
461
493
  o.value && u();
462
- }, B = () => {
494
+ }, g = () => {
463
495
  o.value && u();
464
496
  };
465
- ne(o, (s) => {
466
- s ? (setTimeout(u, 0), document.addEventListener("click", n), window.addEventListener("scroll", p, !0), window.addEventListener("resize", B)) : (document.removeEventListener("click", n), window.removeEventListener("scroll", p, !0), window.removeEventListener("resize", B));
497
+ le(o, (s) => {
498
+ s ? (setTimeout(u, 0), document.addEventListener("click", n), window.addEventListener("scroll", w, !0), window.addEventListener("resize", g)) : (document.removeEventListener("click", n), window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", g));
467
499
  }), ae(() => {
468
- document.removeEventListener("click", n), window.removeEventListener("scroll", p, !0), window.removeEventListener("resize", B);
500
+ document.removeEventListener("click", n), window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", g);
469
501
  });
470
- const w = I(() => ({
502
+ const h = I(() => ({
471
503
  width: typeof t.width == "number" ? `${t.width}px` : t.width
472
- })), C = I(() => {
504
+ })), y = I(() => {
473
505
  const s = t.placement, c = {};
474
506
  switch (s) {
475
507
  case "top":
@@ -495,57 +527,57 @@ const Ze = /* @__PURE__ */ O({
495
527
  }
496
528
  return c;
497
529
  });
498
- return (s, c) => (v(), $("span", Be, [
530
+ return (s, c) => (x(), $("span", Te, [
499
531
  z("span", {
500
532
  ref_key: "triggerRef",
501
- ref: i,
533
+ ref: a,
502
534
  class: "x-popconfirm-trigger",
503
- onClick: m
535
+ onClick: p
504
536
  }, [
505
537
  L(s.$slots, "default")
506
538
  ], 512),
507
- (v(), X(le, { to: "body" }, [
508
- ie(j, { name: "x-popconfirm-fade" }, {
509
- default: F(() => [
510
- o.value ? (v(), $("div", {
539
+ (x(), j(ie, { to: "body" }, [
540
+ U(F, { name: "x-popconfirm-fade" }, {
541
+ default: O(() => [
542
+ o.value ? (x(), $("div", {
511
543
  key: 0,
512
544
  ref_key: "popperRef",
513
545
  ref: f,
514
546
  class: "x-popconfirm",
515
- style: N({ ...d.value, ...w.value }),
547
+ style: H({ ...d.value, ...h.value }),
516
548
  onClick: c[0] || (c[0] = pe(() => {
517
549
  }, ["stop"]))
518
550
  }, [
519
- e.showArrow ? (v(), $("span", {
551
+ e.showArrow ? (x(), $("span", {
520
552
  key: 0,
521
553
  class: "x-popconfirm__arrow",
522
- style: N(C.value)
554
+ style: H(y.value)
523
555
  }, null, 4)) : M("", !0),
524
- z("div", Te, [
525
- e.hideIcon ? M("", !0) : (v(), $("span", {
556
+ z("div", $e, [
557
+ e.hideIcon ? M("", !0) : (x(), $("span", {
526
558
  key: 0,
527
559
  class: "x-popconfirm__icon",
528
- style: N({ color: e.iconColor })
560
+ style: H({ color: e.iconColor })
529
561
  }, [
530
562
  L(s.$slots, "icon", {}, () => [
531
- W(V(e.icon || "⚠"), 1)
563
+ N(V(e.icon || "⚠"), 1)
532
564
  ])
533
565
  ], 4)),
534
- z("div", $e, [
566
+ z("div", Ee, [
535
567
  L(s.$slots, "title", {}, () => [
536
- W(V(e.title), 1)
568
+ N(V(e.title), 1)
537
569
  ])
538
570
  ])
539
571
  ]),
540
- z("div", Ee, [
541
- e.hideCancelButton ? M("", !0) : (v(), $("button", {
572
+ z("div", Me, [
573
+ e.hideCancelButton ? M("", !0) : (x(), $("button", {
542
574
  key: 0,
543
575
  class: "x-button p-button--default p-button--small",
544
- onClick: h
576
+ onClick: m
545
577
  }, V(e.cancelButtonText), 1)),
546
- e.hideConfirmButton ? M("", !0) : (v(), $("button", {
578
+ e.hideConfirmButton ? M("", !0) : (x(), $("button", {
547
579
  key: 1,
548
- class: g(["x-button x-button--small", `x-button--${e.confirmButtonType}`]),
580
+ class: v(["x-button x-button--small", `x-button--${e.confirmButtonType}`]),
549
581
  onClick: r
550
582
  }, V(e.confirmButtonText), 3))
551
583
  ])
@@ -556,7 +588,7 @@ const Ze = /* @__PURE__ */ O({
556
588
  ]))
557
589
  ]));
558
590
  }
559
- }), Ge = /* @__PURE__ */ O({
591
+ }), Je = /* @__PURE__ */ A({
560
592
  name: "XBacktop",
561
593
  __name: "index",
562
594
  props: {
@@ -565,15 +597,15 @@ const Ze = /* @__PURE__ */ O({
565
597
  bottom: { default: 40 }
566
598
  },
567
599
  emits: ["click"],
568
- setup(e, { emit: l }) {
569
- const t = e, a = l, o = U("backtop"), i = E(!1), f = () => {
600
+ setup(e, { emit: i }) {
601
+ const t = e, l = i, o = Y("backtop"), a = E(!1), f = () => {
570
602
  const n = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop || 0;
571
- i.value = n >= t.visibilityHeight;
603
+ a.value = n >= t.visibilityHeight;
572
604
  }, d = (n) => {
573
605
  window.scrollTo({
574
606
  top: 0,
575
607
  behavior: "smooth"
576
- }), a("click", n);
608
+ }), l("click", n);
577
609
  }, u = I(() => ({
578
610
  right: `${t.right}px`,
579
611
  bottom: `${t.bottom}px`
@@ -582,26 +614,26 @@ const Ze = /* @__PURE__ */ O({
582
614
  window.addEventListener("scroll", f, { passive: !0, capture: !0 }), setTimeout(f, 100);
583
615
  }), ae(() => {
584
616
  window.removeEventListener("scroll", f, !0);
585
- }), (n, m) => (v(), X(j, { name: "x-fade" }, {
586
- default: F(() => [
617
+ }), (n, p) => (x(), j(F, { name: "x-fade" }, {
618
+ default: O(() => [
587
619
  me(z("div", {
588
- class: g(x(o).b()),
589
- style: N(u.value),
620
+ class: v(b(o).b()),
621
+ style: H(u.value),
590
622
  onClick: d
591
623
  }, [
592
624
  L(n.$slots, "default", {}, () => [
593
625
  z("span", {
594
- class: g(x(o).e("icon"))
626
+ class: v(b(o).e("icon"))
595
627
  }, "↑", 2)
596
628
  ])
597
629
  ], 6), [
598
- [he, i.value]
630
+ [he, a.value]
599
631
  ])
600
632
  ]),
601
633
  _: 3
602
634
  }));
603
635
  }
604
- }), Me = /* @__PURE__ */ O({
636
+ }), ze = /* @__PURE__ */ A({
605
637
  name: "XMessage",
606
638
  __name: "index",
607
639
  props: {
@@ -615,119 +647,119 @@ const Ze = /* @__PURE__ */ O({
615
647
  onClose: {}
616
648
  },
617
649
  emits: ["close", "destroy"],
618
- setup(e, { expose: l, emit: t }) {
619
- const a = e, o = t, i = U("message"), f = E(!1), d = E(ke()), u = {
650
+ setup(e, { expose: i, emit: t }) {
651
+ const l = e, o = t, a = Y("message"), f = E(!1), d = E(Be()), u = {
620
652
  success: "✓",
621
653
  warning: "⚠",
622
654
  error: "✕",
623
655
  info: "ℹ"
624
656
  }, n = I(() => [
625
- i.b(),
626
- i.m(a.type),
627
- i.is("center", a.center),
628
- i.is("closable", a.showClose),
629
- a.customClass
630
- ]), m = I(() => ({
631
- top: `${a.offset}px`,
657
+ a.b(),
658
+ a.m(l.type),
659
+ a.is("center", l.center),
660
+ a.is("closable", l.showClose),
661
+ l.customClass
662
+ ]), p = I(() => ({
663
+ top: `${l.offset}px`,
632
664
  zIndex: d.value
633
665
  }));
634
666
  let r = null;
635
- const h = () => {
636
- a.duration > 0 && (r = setTimeout(() => {
637
- B();
638
- }, a.duration));
639
- }, p = () => {
640
- r && (clearTimeout(r), r = null);
641
- }, B = () => {
642
- var C;
643
- f.value = !1, (C = a.onClose) == null || C.call(a), o("close");
667
+ const m = () => {
668
+ l.duration > 0 && (r = setTimeout(() => {
669
+ g();
670
+ }, l.duration));
644
671
  }, w = () => {
672
+ r && (clearTimeout(r), r = null);
673
+ }, g = () => {
674
+ var y;
675
+ f.value = !1, (y = l.onClose) == null || y.call(l), o("close");
676
+ }, h = () => {
645
677
  o("destroy");
646
678
  };
647
679
  return ve(() => {
648
- h(), f.value = !0;
680
+ m(), f.value = !0;
649
681
  }), ae(() => {
650
- p();
651
- }), l({
652
- close: B
653
- }), (C, s) => (v(), X(j, {
682
+ w();
683
+ }), i({
684
+ close: g
685
+ }), (y, s) => (x(), j(F, {
654
686
  name: "x-message-fade",
655
- onAfterLeave: w
687
+ onAfterLeave: h
656
688
  }, {
657
- default: F(() => [
658
- f.value ? (v(), $("div", {
689
+ default: O(() => [
690
+ f.value ? (x(), $("div", {
659
691
  key: 0,
660
- class: g(n.value),
661
- style: N(m.value),
662
- onMouseenter: p,
663
- onMouseleave: h
692
+ class: v(n.value),
693
+ style: H(p.value),
694
+ onMouseenter: w,
695
+ onMouseleave: m
664
696
  }, [
665
697
  z("span", {
666
- class: g(x(i).e("icon"))
698
+ class: v(b(a).e("icon"))
667
699
  }, V(u[e.type]), 3),
668
700
  z("span", {
669
- class: g(x(i).e("content"))
701
+ class: v(b(a).e("content"))
670
702
  }, [
671
- L(C.$slots, "default", {}, () => [
672
- W(V(e.message), 1)
703
+ L(y.$slots, "default", {}, () => [
704
+ N(V(e.message), 1)
673
705
  ])
674
706
  ], 2),
675
- e.showClose ? (v(), $("button", {
707
+ e.showClose ? (x(), $("button", {
676
708
  key: 0,
677
- class: g(x(i).e("close")),
678
- onClick: B
709
+ class: v(b(a).e("close")),
710
+ onClick: g
679
711
  }, " ✕ ", 2)) : M("", !0)
680
712
  ], 38)) : M("", !0)
681
713
  ]),
682
714
  _: 3
683
715
  }));
684
716
  }
685
- }), q = [];
686
- let ze = 1;
687
- const Se = () => {
688
- q.slice().forEach((e) => e.close());
717
+ }), G = [];
718
+ let Se = 1;
719
+ const Ie = () => {
720
+ G.slice().forEach((e) => e.close());
689
721
  };
690
722
  function xe(e) {
691
- const l = ze++, t = document.createElement("div");
723
+ const i = Se++, t = document.createElement("div");
692
724
  document.body.appendChild(t);
693
- const a = {
725
+ const l = {
694
726
  success: { bg: "#f0f9eb", border: "#67c23a", icon: "✓" },
695
727
  warning: { bg: "#fdf6ec", border: "#e6a23c", icon: "⚠" },
696
728
  error: { bg: "#fef0f0", border: "#f56c6c", icon: "✕" },
697
729
  info: { bg: "#f4f4f5", border: "#909399", icon: "ℹ" }
698
- }, o = e.type || "info", i = a[o] || a.info, f = be({
730
+ }, o = e.type || "info", a = l[o] || l.info, f = we({
699
731
  visible: !1,
700
732
  offset: e.offset ?? 20
701
733
  });
702
734
  let d = e.offset ?? 20;
703
- q.forEach((w) => {
704
- const C = w.container.firstElementChild;
705
- C && C.offsetHeight && (d += C.offsetHeight + 16);
735
+ G.forEach((h) => {
736
+ const y = h.container.firstElementChild;
737
+ y && y.offsetHeight && (d += y.offsetHeight + 16);
706
738
  }), f.offset = d;
707
739
  let u = null, n = !1;
708
- const m = () => {
740
+ const p = () => {
709
741
  n || (f.visible = !1, setTimeout(() => {
710
742
  if (n) return;
711
743
  n = !0;
712
- const w = q.findIndex((C) => C.id === l);
713
- w !== -1 && q.splice(w, 1);
744
+ const h = G.findIndex((y) => y.id === i);
745
+ h !== -1 && G.splice(h, 1);
714
746
  try {
715
- p.unmount();
747
+ w.unmount();
716
748
  } catch {
717
749
  }
718
750
  t.parentNode && t.parentNode.removeChild(t);
719
751
  }, 300));
720
752
  }, r = () => {
721
- const w = e.duration ?? 3e3;
722
- w > 0 && (u = setTimeout(m, w));
723
- }, h = () => {
753
+ const h = e.duration ?? 3e3;
754
+ h > 0 && (u = setTimeout(p, h));
755
+ }, m = () => {
724
756
  u && (clearTimeout(u), u = null);
725
- }, p = ge({
757
+ }, w = ge({
726
758
  render() {
727
759
  if (!f.visible) return null;
728
- const w = [
760
+ const h = [
729
761
  // Icon
730
- b("span", {
762
+ C("span", {
731
763
  style: {
732
764
  display: "inline-flex",
733
765
  alignItems: "center",
@@ -736,11 +768,11 @@ function xe(e) {
736
768
  height: "20px",
737
769
  marginRight: "10px",
738
770
  fontSize: "16px",
739
- color: i.border
771
+ color: a.border
740
772
  }
741
- }, i.icon),
773
+ }, a.icon),
742
774
  // Content
743
- b("span", {
775
+ C("span", {
744
776
  style: {
745
777
  flex: "1",
746
778
  fontSize: "14px",
@@ -749,8 +781,8 @@ function xe(e) {
749
781
  }
750
782
  }, e.message || "")
751
783
  ];
752
- return e.showClose && w.push(
753
- b("button", {
784
+ return e.showClose && h.push(
785
+ C("button", {
754
786
  style: {
755
787
  position: "absolute",
756
788
  top: "50%",
@@ -763,11 +795,11 @@ function xe(e) {
763
795
  color: "#909399",
764
796
  padding: "0"
765
797
  },
766
- onClick: (C) => {
767
- C.stopPropagation(), m();
798
+ onClick: (y) => {
799
+ y.stopPropagation(), p();
768
800
  }
769
801
  }, "✕")
770
- ), b("div", {
802
+ ), C("div", {
771
803
  class: ["x-message", `x-message--${o}`, e.center ? "is-center" : "", e.showClose ? "is-closable" : ""],
772
804
  style: {
773
805
  position: "fixed",
@@ -781,139 +813,139 @@ function xe(e) {
781
813
  boxShadow: "0 2px 12px rgba(0,0,0,0.1)",
782
814
  minWidth: "280px",
783
815
  maxWidth: "480px",
784
- backgroundColor: i.bg,
785
- border: `1px solid ${i.border}`,
786
- zIndex: 2e3 + l,
816
+ backgroundColor: a.bg,
817
+ border: `1px solid ${a.border}`,
818
+ zIndex: 2e3 + i,
787
819
  transition: "opacity 0.3s, transform 0.3s"
788
820
  },
789
- onMouseenter: h,
821
+ onMouseenter: m,
790
822
  onMouseleave: r
791
- }, w);
823
+ }, h);
792
824
  }
793
825
  });
794
- p.mount(t), Q(() => {
826
+ w.mount(t), ee(() => {
795
827
  f.visible = !0, r();
796
828
  });
797
- const B = { id: l, app: p, container: t, close: m };
798
- return q.push(B), { close: m };
829
+ const g = { id: i, app: w, container: t, close: p };
830
+ return G.push(g), { close: p };
799
831
  }
800
- function Ie(e) {
832
+ function Le(e) {
801
833
  return xe(typeof e == "string" ? { message: e } : e);
802
834
  }
803
- const oe = (e) => (l) => xe({ ...typeof l == "string" ? { message: l } : l, type: e }), ue = Object.assign(Ie, {
804
- info: oe("info"),
805
- success: oe("success"),
806
- warning: oe("warning"),
807
- error: oe("error"),
808
- closeAll: Se
809
- }), Je = ue, Qe = Me, et = {
835
+ const ne = (e) => (i) => xe({ ...typeof i == "string" ? { message: i } : i, type: e }), ue = Object.assign(Le, {
836
+ info: ne("info"),
837
+ success: ne("success"),
838
+ warning: ne("warning"),
839
+ error: ne("error"),
840
+ closeAll: Ie
841
+ }), Qe = ue, et = ze, tt = {
810
842
  install(e) {
811
843
  e.config.globalProperties.$message = ue, e.provide("message", ue);
812
844
  }
813
- }, G = [], Le = () => {
814
- G.slice().forEach((e) => e.close());
815
- }, Pe = {
845
+ }, J = [], Pe = () => {
846
+ J.slice().forEach((e) => e.close());
847
+ }, Re = {
816
848
  success: { icon: "✓", color: "#67c23a" },
817
849
  warning: { icon: "⚠", color: "#e6a23c" },
818
850
  error: { icon: "✕", color: "#f56c6c" },
819
851
  info: { icon: "ℹ", color: "#909399" }
820
852
  };
821
853
  function re(e) {
822
- return new Promise((l) => {
854
+ return new Promise((i) => {
823
855
  const t = document.createElement("div");
824
856
  document.body.appendChild(t);
825
- let a = !1;
826
- const o = O({
857
+ let l = !1;
858
+ const o = A({
827
859
  name: "TMessageBox",
828
860
  setup() {
829
- const d = E(!1), u = E(e.inputValue ?? ""), n = E(""), m = 2e3 + G.length + 1, r = (C) => {
830
- a || (a = !0, d.value = !1, setTimeout(() => {
831
- const s = G.findIndex((c) => c.container === t);
832
- s !== -1 && G.splice(s, 1);
861
+ const d = E(!1), u = E(e.inputValue ?? ""), n = E(""), p = 2e3 + J.length + 1, r = (y) => {
862
+ l || (l = !0, d.value = !1, setTimeout(() => {
863
+ const s = J.findIndex((c) => c.container === t);
864
+ s !== -1 && J.splice(s, 1);
833
865
  try {
834
- i.unmount();
866
+ a.unmount();
835
867
  } catch {
836
868
  }
837
- t.parentNode && t.parentNode.removeChild(t), l({
838
- action: C,
839
- value: C === "confirm" ? u.value : void 0
869
+ t.parentNode && t.parentNode.removeChild(t), i({
870
+ action: y,
871
+ value: y === "confirm" ? u.value : void 0
840
872
  });
841
873
  }, 300));
842
- }, h = () => {
874
+ }, m = () => {
843
875
  if (e.showInput && e.inputPattern && !e.inputPattern.test(u.value)) {
844
876
  n.value = e.inputErrorMessage || "输入格式不正确";
845
877
  return;
846
878
  }
847
879
  n.value = "", r("confirm");
848
- }, p = () => {
880
+ }, w = () => {
849
881
  r("cancel");
850
- }, B = () => {
882
+ }, g = () => {
851
883
  r("close");
852
- }, w = () => {
853
- e.closeOnClickModal !== !1 && B();
884
+ }, h = () => {
885
+ e.closeOnClickModal !== !1 && g();
854
886
  };
855
- return Q(() => {
887
+ return ee(() => {
856
888
  d.value = !0;
857
889
  }), {
858
890
  visible: d,
859
891
  inputValue: u,
860
892
  inputError: n,
861
- zIndex: m,
862
- handleConfirm: h,
863
- handleCancel: p,
864
- handleClose: B,
865
- handleMaskClick: w
893
+ zIndex: p,
894
+ handleConfirm: m,
895
+ handleCancel: w,
896
+ handleClose: g,
897
+ handleMaskClick: h
866
898
  };
867
899
  },
868
900
  render() {
869
901
  if (!this.visible) return null;
870
- const d = e.type, u = d ? Pe[d] : null, n = [];
902
+ const d = e.type, u = d ? Re[d] : null, n = [];
871
903
  u && n.push(
872
- b("span", {
904
+ C("span", {
873
905
  class: "x-message-box__icon",
874
906
  style: { color: u.color, marginRight: "10px", fontSize: "20px" }
875
907
  }, u.icon)
876
908
  ), n.push(
877
- b("span", { class: "x-message-box__title" }, e.title || "提示")
909
+ C("span", { class: "x-message-box__title" }, e.title || "提示")
878
910
  ), e.showClose !== !1 && n.push(
879
- b("button", {
911
+ C("button", {
880
912
  class: "x-message-box__close",
881
913
  onClick: this.handleClose
882
914
  }, "✕")
883
915
  );
884
- const m = [];
885
- m.push(
886
- b("div", { class: "x-message-box__content" }, e.message || "")
887
- ), e.showInput && m.push(
888
- b("div", { class: "x-message-box__input", style: { marginTop: "12px" } }, [
889
- b("input", {
916
+ const p = [];
917
+ p.push(
918
+ C("div", { class: "x-message-box__content" }, e.message || "")
919
+ ), e.showInput && p.push(
920
+ C("div", { class: "x-message-box__input", style: { marginTop: "12px" } }, [
921
+ C("input", {
890
922
  class: ["x-message-box__input-inner", this.inputError ? "is-error" : ""].filter(Boolean),
891
923
  type: e.inputType || "text",
892
924
  placeholder: e.inputPlaceholder || "请输入",
893
925
  value: this.inputValue,
894
- onInput: (h) => {
895
- this.inputValue = h.target.value, this.inputError = "";
926
+ onInput: (m) => {
927
+ this.inputValue = m.target.value, this.inputError = "";
896
928
  },
897
- onKeyup: (h) => {
898
- h.key === "Enter" && this.handleConfirm();
929
+ onKeyup: (m) => {
930
+ m.key === "Enter" && this.handleConfirm();
899
931
  }
900
932
  }),
901
- this.inputError ? b("div", { class: "x-message-box__error", style: { color: "#f56c6c", fontSize: "12px", marginTop: "4px" } }, this.inputError) : null
933
+ this.inputError ? C("div", { class: "x-message-box__error", style: { color: "#f56c6c", fontSize: "12px", marginTop: "4px" } }, this.inputError) : null
902
934
  ])
903
935
  );
904
936
  const r = [];
905
937
  return e.showCancelButton && r.push(
906
- b("button", {
938
+ C("button", {
907
939
  class: "x-button p-button--default",
908
940
  onClick: this.handleCancel
909
941
  }, e.cancelButtonText || "取消")
910
942
  ), e.showConfirmButton !== !1 && r.push(
911
- b("button", {
943
+ C("button", {
912
944
  class: "x-button p-button--primary",
913
945
  onClick: this.handleConfirm,
914
946
  style: { marginLeft: "10px" }
915
947
  }, e.confirmButtonText || "确定")
916
- ), b("div", {
948
+ ), C("div", {
917
949
  class: ["x-message-box-wrapper", e.center ? "is-center" : ""],
918
950
  style: {
919
951
  position: "fixed",
@@ -929,7 +961,7 @@ function re(e) {
929
961
  },
930
962
  onClick: this.handleMaskClick
931
963
  }, [
932
- b("div", {
964
+ C("div", {
933
965
  class: ["x-message-box", e.customClass],
934
966
  style: {
935
967
  backgroundColor: "#fff",
@@ -938,10 +970,10 @@ function re(e) {
938
970
  minWidth: "300px",
939
971
  maxWidth: "500px"
940
972
  },
941
- onClick: (h) => h.stopPropagation()
973
+ onClick: (m) => m.stopPropagation()
942
974
  }, [
943
975
  // Header
944
- b("div", {
976
+ C("div", {
945
977
  class: "x-message-box__header",
946
978
  style: {
947
979
  display: "flex",
@@ -952,16 +984,16 @@ function re(e) {
952
984
  }
953
985
  }, n),
954
986
  // Body
955
- b("div", {
987
+ C("div", {
956
988
  class: "x-message-box__body",
957
989
  style: {
958
990
  padding: "20px",
959
991
  fontSize: "14px",
960
992
  color: "#606266"
961
993
  }
962
- }, m),
994
+ }, p),
963
995
  // Footer
964
- b("div", {
996
+ C("div", {
965
997
  class: "x-message-box__footer",
966
998
  style: {
967
999
  padding: "10px 20px 16px",
@@ -971,42 +1003,42 @@ function re(e) {
971
1003
  ])
972
1004
  ]);
973
1005
  }
974
- }), i = ge(o);
975
- i.mount(t);
1006
+ }), a = ge(o);
1007
+ a.mount(t);
976
1008
  const f = {
977
- app: i,
1009
+ app: a,
978
1010
  container: t,
979
1011
  close: () => {
980
1012
  var u;
981
- const d = (u = i._instance) == null ? void 0 : u.proxy;
1013
+ const d = (u = a._instance) == null ? void 0 : u.proxy;
982
1014
  d != null && d.handleClose && d.handleClose();
983
1015
  }
984
1016
  };
985
- G.push(f);
1017
+ J.push(f);
986
1018
  });
987
1019
  }
988
- async function Re(e, l, t) {
1020
+ async function Ve(e, i, t) {
989
1021
  return re({
990
1022
  message: e,
991
- title: l,
1023
+ title: i,
992
1024
  ...t,
993
1025
  showConfirmButton: !0,
994
1026
  showCancelButton: !1
995
1027
  });
996
1028
  }
997
- async function Ve(e, l, t) {
1029
+ async function _e(e, i, t) {
998
1030
  return re({
999
1031
  message: e,
1000
- title: l,
1032
+ title: i,
1001
1033
  ...t,
1002
1034
  showConfirmButton: !0,
1003
1035
  showCancelButton: !0
1004
1036
  });
1005
1037
  }
1006
- async function He(e, l, t) {
1038
+ async function He(e, i, t) {
1007
1039
  return re({
1008
1040
  message: e,
1009
- title: l,
1041
+ title: i,
1010
1042
  ...t,
1011
1043
  showInput: !0,
1012
1044
  showConfirmButton: !0,
@@ -1017,33 +1049,33 @@ function Ne(e) {
1017
1049
  return re(e);
1018
1050
  }
1019
1051
  const K = Object.assign(Ne, {
1020
- alert: Re,
1021
- confirm: Ve,
1052
+ alert: Ve,
1053
+ confirm: _e,
1022
1054
  prompt: He,
1023
- closeAll: Le
1024
- }), tt = K, ot = {
1055
+ closeAll: Pe
1056
+ }), ot = K, nt = {
1025
1057
  install(e) {
1026
1058
  e.config.globalProperties.$msgbox = K, e.config.globalProperties.$alert = K.alert, e.config.globalProperties.$confirm = K.confirm, e.config.globalProperties.$prompt = K.prompt, e.provide("messageBox", K);
1027
1059
  }
1028
- }, J = [];
1060
+ }, Q = [];
1029
1061
  let Oe = 1;
1030
- const _e = () => {
1031
- J.slice().forEach((e) => e.close());
1032
- }, Ae = {
1062
+ const Ae = () => {
1063
+ Q.slice().forEach((e) => e.close());
1064
+ }, We = {
1033
1065
  success: { icon: "✓", color: "#67c23a" },
1034
1066
  warning: { icon: "⚠", color: "#e6a23c" },
1035
1067
  error: { icon: "✕", color: "#f56c6c" },
1036
1068
  info: { icon: "ℹ", color: "#909399" }
1037
- }, We = (e, l) => {
1038
- const t = J.filter((o) => o.position === e);
1039
- let a = 16;
1069
+ }, De = (e, i) => {
1070
+ const t = Q.filter((o) => o.position === e);
1071
+ let l = 16;
1040
1072
  for (const o of t)
1041
- if (o.id < l) {
1042
- const i = o.container.firstElementChild;
1043
- i && (a += i.offsetHeight + 16);
1073
+ if (o.id < i) {
1074
+ const a = o.container.firstElementChild;
1075
+ a && (l += a.offsetHeight + 16);
1044
1076
  }
1045
- return a;
1046
- }, De = (e, l) => {
1077
+ return l;
1078
+ }, Xe = (e, i) => {
1047
1079
  const t = {
1048
1080
  position: "fixed",
1049
1081
  width: "330px",
@@ -1051,61 +1083,61 @@ const _e = () => {
1051
1083
  };
1052
1084
  switch (e) {
1053
1085
  case "top-right":
1054
- t.top = `${l}px`, t.right = "16px";
1086
+ t.top = `${i}px`, t.right = "16px";
1055
1087
  break;
1056
1088
  case "top-left":
1057
- t.top = `${l}px`, t.left = "16px";
1089
+ t.top = `${i}px`, t.left = "16px";
1058
1090
  break;
1059
1091
  case "bottom-right":
1060
- t.bottom = `${l}px`, t.right = "16px";
1092
+ t.bottom = `${i}px`, t.right = "16px";
1061
1093
  break;
1062
1094
  case "bottom-left":
1063
- t.bottom = `${l}px`, t.left = "16px";
1095
+ t.bottom = `${i}px`, t.left = "16px";
1064
1096
  break;
1065
1097
  default:
1066
- t.top = `${l}px`, t.right = "16px";
1098
+ t.top = `${i}px`, t.right = "16px";
1067
1099
  }
1068
1100
  return t;
1069
1101
  };
1070
1102
  function ye(e) {
1071
- const l = Oe++, t = e.position || "top-right", a = document.createElement("div");
1072
- document.body.appendChild(a);
1073
- let o = null, i = !1;
1074
- const f = O({
1103
+ const i = Oe++, t = e.position || "top-right", l = document.createElement("div");
1104
+ document.body.appendChild(l);
1105
+ let o = null, a = !1;
1106
+ const f = A({
1075
1107
  name: "TNotification",
1076
1108
  setup() {
1077
- const n = E(!1), m = () => {
1078
- i || (i = !0, n.value = !1, setTimeout(() => {
1079
- var C;
1080
- const w = J.findIndex((s) => s.id === l);
1081
- w !== -1 && J.splice(w, 1), o && clearTimeout(o), (C = e.onClose) == null || C.call(e);
1109
+ const n = E(!1), p = () => {
1110
+ a || (a = !0, n.value = !1, setTimeout(() => {
1111
+ var y;
1112
+ const h = Q.findIndex((s) => s.id === i);
1113
+ h !== -1 && Q.splice(h, 1), o && clearTimeout(o), (y = e.onClose) == null || y.call(e);
1082
1114
  try {
1083
1115
  d.unmount();
1084
1116
  } catch {
1085
1117
  }
1086
- a.parentNode && a.parentNode.removeChild(a);
1118
+ l.parentNode && l.parentNode.removeChild(l);
1087
1119
  }, 300));
1088
1120
  }, r = () => {
1089
- const w = e.duration ?? 4500;
1090
- w > 0 && (o = setTimeout(m, w));
1091
- }, h = () => {
1121
+ const h = e.duration ?? 4500;
1122
+ h > 0 && (o = setTimeout(p, h));
1123
+ }, m = () => {
1092
1124
  o && (clearTimeout(o), o = null);
1093
- }, p = I(() => (e.offset ?? 0) + We(t, l)), B = I(() => De(t, p.value));
1094
- return Q(() => {
1125
+ }, w = I(() => (e.offset ?? 0) + De(t, i)), g = I(() => Xe(t, w.value));
1126
+ return ee(() => {
1095
1127
  n.value = !0, r();
1096
1128
  }), {
1097
1129
  visible: n,
1098
- close: m,
1099
- positionStyles: B,
1130
+ close: p,
1131
+ positionStyles: g,
1100
1132
  startTimer: r,
1101
- clearTimer: h
1133
+ clearTimer: m
1102
1134
  };
1103
1135
  },
1104
1136
  render() {
1105
1137
  if (!this.visible) return null;
1106
- const n = e.type, m = n ? Ae[n] : null, r = [];
1138
+ const n = e.type, p = n ? We[n] : null, r = [];
1107
1139
  e.title && r.push(
1108
- b("div", {
1140
+ C("div", {
1109
1141
  class: "x-notification__title",
1110
1142
  style: {
1111
1143
  fontWeight: "600",
@@ -1115,7 +1147,7 @@ function ye(e) {
1115
1147
  }
1116
1148
  }, e.title)
1117
1149
  ), e.message && (e.dangerouslyUseHTMLString ? r.push(
1118
- b("div", {
1150
+ C("div", {
1119
1151
  class: "x-notification__content",
1120
1152
  style: {
1121
1153
  fontSize: "14px",
@@ -1125,7 +1157,7 @@ function ye(e) {
1125
1157
  innerHTML: e.message
1126
1158
  })
1127
1159
  ) : r.push(
1128
- b("div", {
1160
+ C("div", {
1129
1161
  class: "x-notification__content",
1130
1162
  style: {
1131
1163
  fontSize: "14px",
@@ -1134,9 +1166,9 @@ function ye(e) {
1134
1166
  }
1135
1167
  }, e.message)
1136
1168
  ));
1137
- const h = [];
1138
- return m && h.push(
1139
- b("div", {
1169
+ const m = [];
1170
+ return p && m.push(
1171
+ C("div", {
1140
1172
  class: "x-notification__icon",
1141
1173
  style: {
1142
1174
  display: "flex",
@@ -1146,18 +1178,18 @@ function ye(e) {
1146
1178
  height: "24px",
1147
1179
  marginRight: "12px",
1148
1180
  fontSize: "18px",
1149
- color: m.color
1181
+ color: p.color
1150
1182
  }
1151
- }, m.icon)
1152
- ), h.push(
1153
- b("div", {
1183
+ }, p.icon)
1184
+ ), m.push(
1185
+ C("div", {
1154
1186
  class: "x-notification__main",
1155
1187
  style: {
1156
1188
  flex: "1"
1157
1189
  }
1158
1190
  }, r)
1159
- ), e.showClose !== !1 && h.push(
1160
- b("button", {
1191
+ ), e.showClose !== !1 && m.push(
1192
+ C("button", {
1161
1193
  class: "x-notification__close",
1162
1194
  style: {
1163
1195
  position: "absolute",
@@ -1170,11 +1202,11 @@ function ye(e) {
1170
1202
  color: "#909399",
1171
1203
  padding: "0"
1172
1204
  },
1173
- onClick: (p) => {
1174
- p.stopPropagation(), this.close();
1205
+ onClick: (w) => {
1206
+ w.stopPropagation(), this.close();
1175
1207
  }
1176
1208
  }, "✕")
1177
- ), b("div", {
1209
+ ), C("div", {
1178
1210
  class: ["x-notification", e.customClass],
1179
1211
  style: {
1180
1212
  ...this.positionStyles,
@@ -1189,49 +1221,49 @@ function ye(e) {
1189
1221
  },
1190
1222
  onMouseenter: this.clearTimer,
1191
1223
  onMouseleave: this.startTimer
1192
- }, h);
1224
+ }, m);
1193
1225
  }
1194
1226
  }), d = ge(f);
1195
- d.mount(a);
1227
+ d.mount(l);
1196
1228
  const u = {
1197
- id: l,
1229
+ id: i,
1198
1230
  app: d,
1199
- container: a,
1231
+ container: l,
1200
1232
  position: t,
1201
1233
  close: () => {
1202
- var m;
1203
- const n = (m = d._instance) == null ? void 0 : m.proxy;
1234
+ var p;
1235
+ const n = (p = d._instance) == null ? void 0 : p.proxy;
1204
1236
  n != null && n.close && n.close();
1205
1237
  }
1206
1238
  };
1207
- return J.push(u), { close: u.close };
1239
+ return Q.push(u), { close: u.close };
1208
1240
  }
1209
- function Xe(e) {
1241
+ function je(e) {
1210
1242
  return ye(typeof e == "string" ? { message: e } : e);
1211
1243
  }
1212
- const se = (e) => (l) => ye({ ...typeof l == "string" ? { message: l } : l, type: e }), fe = Object.assign(Xe, {
1244
+ const se = (e) => (i) => ye({ ...typeof i == "string" ? { message: i } : i, type: e }), fe = Object.assign(je, {
1213
1245
  info: se("info"),
1214
1246
  success: se("success"),
1215
1247
  warning: se("warning"),
1216
1248
  error: se("error"),
1217
- closeAll: _e
1218
- }), st = fe, nt = {
1249
+ closeAll: Ae
1250
+ }), st = fe, lt = {
1219
1251
  install(e) {
1220
1252
  e.config.globalProperties.$notify = fe, e.provide("notification", fe);
1221
1253
  }
1222
1254
  };
1223
1255
  export {
1224
- Ue as Alert,
1225
- Ge as Backtop,
1226
- Ke as Drawer,
1227
- Je as Message,
1228
- tt as MessageBox,
1229
- Qe as MessageComponent,
1230
- Ze as Modal,
1256
+ Ye as Alert,
1257
+ Je as Backtop,
1258
+ Ue as Drawer,
1259
+ Qe as Message,
1260
+ ot as MessageBox,
1261
+ et as MessageComponent,
1262
+ Ke as Modal,
1231
1263
  st as Notification,
1232
- qe as Popconfirm,
1233
- et as TMessage,
1234
- ot as TMessageBox,
1235
- nt as TNotification,
1236
- Ye as Tooltip
1264
+ Ge as Popconfirm,
1265
+ tt as TMessage,
1266
+ nt as TMessageBox,
1267
+ lt as TNotification,
1268
+ qe as Tooltip
1237
1269
  };