@xto/feedback 1.0.3 → 1.1.0

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