@xto/feedback 1.1.2 → 1.1.3

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