@xto/feedback 1.1.6 → 1.1.7

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