x-next 0.0.0-alpha.13 → 0.0.0-alpha.15

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var Ye = Object.defineProperty;
2
2
  var Ge = (e, t, n) => t in e ? Ye(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var L = (e, t, n) => Ge(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { defineComponent as z, createVNode as f, reactive as Ne, computed as k, getCurrentInstance as qe, ref as X, watch as ue, onMounted as de, onBeforeUnmount as Te, readonly as Je, openBlock as v, createBlock as O, Teleport as Qe, withDirectives as U, createElementBlock as S, normalizeClass as g, normalizeStyle as N, Transition as _, withCtx as ee, vShow as R, createCommentVNode as D, createElementVNode as y, withModifiers as Me, renderSlot as j, toDisplayString as te, Comment as _e, Fragment as x, render as M, isVNode as w, createTextVNode as E, onUnmounted as Ae, resolveComponent as V, resolveDynamicComponent as et } from "vue";
4
+ import { defineComponent as z, createVNode as f, reactive as Ne, computed as k, getCurrentInstance as qe, ref as R, watch as ce, onMounted as ue, onBeforeUnmount as Te, readonly as Je, openBlock as v, createBlock as O, Teleport as Qe, withDirectives as U, createElementBlock as S, normalizeClass as g, normalizeStyle as N, Transition as _, withCtx as ee, vShow as x, createCommentVNode as D, createElementVNode as y, withModifiers as Me, renderSlot as j, toDisplayString as te, Comment as _e, Fragment as X, render as M, isVNode as w, createTextVNode as E, onUnmounted as Ae, resolveComponent as V, resolveDynamicComponent as et } from "vue";
5
5
  const tt = "X", nt = "x", Fe = (e) => e ? nt + "-" + e : e || "", Y = (e) => tt + e, A = (e) => {
6
6
  const t = Fe(e);
7
7
  return {
@@ -17,11 +17,11 @@ function De(e) {
17
17
  function ze(e) {
18
18
  return G.call(e) === "[object Object]";
19
19
  }
20
- const Le = (e) => G.call(e) === "[object Promise]";
20
+ const Le = (e) => G.call(e) === "[object Promise]", lt = (e) => B(e) && e.constructor.name === "AsyncFunction", rt = (e) => Le(e) || lt(e);
21
21
  function je(e) {
22
22
  return G.call(e) === "[object String]";
23
23
  }
24
- function lt(e) {
24
+ function ot(e) {
25
25
  return G.call(e) === "[object Number]" && e === e;
26
26
  }
27
27
  function B(e) {
@@ -30,17 +30,17 @@ function B(e) {
30
30
  function ne() {
31
31
  return typeof window < "u";
32
32
  }
33
- const W = (e) => e, rt = (e) => !!(e && e.shapeFlag & 1), ot = (e, t) => !!(e && e.shapeFlag & 6), st = (e, t) => !!(e && e.shapeFlag & 8), at = (e, t) => !!(e && e.shapeFlag & 16), it = (e, t) => !!(e && e.shapeFlag & 32), Q = (e, t = !1) => {
33
+ const W = (e) => e, st = (e) => !!(e && e.shapeFlag & 1), at = (e, t) => !!(e && e.shapeFlag & 6), it = (e, t) => !!(e && e.shapeFlag & 8), ct = (e, t) => !!(e && e.shapeFlag & 16), ut = (e, t) => !!(e && e.shapeFlag & 32), Q = (e, t = !1) => {
34
34
  var l, o;
35
35
  const n = [];
36
36
  for (const r of e ?? [])
37
- rt(r) || ot(r) || t && st(r, r.children) ? n.push(r) : at(r, r.children) ? n.push(...Q(r.children, t)) : it(r, r.children) ? n.push(...Q((o = (l = r.children).default) == null ? void 0 : o.call(l), t)) : De(r) && n.push(...Q(r, t));
37
+ st(r) || at(r) || t && it(r, r.children) ? n.push(r) : ct(r, r.children) ? n.push(...Q(r.children, t)) : ut(r, r.children) ? n.push(...Q((o = (l = r.children).default) == null ? void 0 : o.call(l), t)) : De(r) && n.push(...Q(r, t));
38
38
  return n;
39
- }, ct = (e, t) => Object.assign(t, {
40
- install: (n) => {
41
- n.component(e, t);
39
+ }, dt = (e, t) => Object.assign(t, {
40
+ install(n) {
41
+ n.component(e) || n.component(e, t);
42
42
  }
43
- }), ut = {
43
+ }), ft = {
44
44
  disabled: Boolean,
45
45
  block: Boolean,
46
46
  loading: Boolean,
@@ -80,21 +80,27 @@ const W = (e) => e, rt = (e) => !!(e && e.shapeFlag & 1), ot = (e, t) => !!(e &&
80
80
  type: Boolean,
81
81
  default: !0
82
82
  }
83
- }, dt = /* @__PURE__ */ z({
84
- name: "Backward",
83
+ }, mt = /* @__PURE__ */ z({
84
+ name: "AnimationLoading",
85
+ props: {
86
+ cls: String
87
+ },
85
88
  render() {
86
89
  return f("svg", {
87
- viewBox: "0 0 20 20",
90
+ viewBox: "0 0 50 50",
91
+ class: "x-icon-loading-svg"
92
+ }, [f("circle", {
93
+ cx: "25",
94
+ cy: "25",
95
+ r: "20",
96
+ class: "path",
88
97
  fill: "none",
89
- xmlns: "http://www.w3.org/2000/svg"
90
- }, [f("path", {
91
- d: "M12.2674 15.793C11.9675 16.0787 11.4927 16.0672 11.2071 15.7673L6.20572 10.5168C5.9298 10.2271 5.9298 9.7719 6.20572 9.48223L11.2071 4.23177C11.4927 3.93184 11.9675 3.92031 12.2674 4.206C12.5673 4.49169 12.5789 4.96642 12.2932 5.26634L7.78458 9.99952L12.2932 14.7327C12.5789 15.0326 12.5673 15.5074 12.2674 15.793Z",
92
- fill: "currentColor"
98
+ stroke: "currentColor"
93
99
  }, null)]);
94
100
  }
95
- }), ft = /* @__PURE__ */ z({
96
- name: Y("Button"),
97
- props: ut,
101
+ }), gt = /* @__PURE__ */ z({
102
+ name: "Button",
103
+ props: ft,
98
104
  emits: ["click"],
99
105
  setup(e, {
100
106
  slots: t,
@@ -109,15 +115,20 @@ const W = (e) => e, rt = (e) => !!(e && e.shapeFlag & 1), ot = (e, t) => !!(e &&
109
115
  }, e.debounce));
110
116
  }, s = k(() => e.loading || l.clicked || l.isDebounce), d = qe(), m = (i, a) => {
111
117
  const c = i(a);
112
- Le(c) && (l.clicked = !0, c.finally(() => {
118
+ rt(c) && (l.clicked = !0, c.finally(() => {
113
119
  l.clicked = !1;
114
120
  }));
115
121
  }, C = (i) => {
116
122
  var c, p, b, $;
117
- if ((p = (c = i.target).blur) == null || p.call(c), s.value) return;
123
+ if (i.stopPropagation(), (p = (c = i.target).blur) == null || p.call(c), s.value) return;
118
124
  u();
119
125
  const a = ($ = (b = d == null ? void 0 : d.vnode) == null ? void 0 : b.props) == null ? void 0 : $.onClick;
120
- De(a) ? a.forEach((le) => m(le, i)) : B(a) && m(a, i), n("click", i);
126
+ if (De(a))
127
+ a.forEach((le) => m(le, i));
128
+ else if (B(a)) {
129
+ m(a, i);
130
+ return;
131
+ }
121
132
  };
122
133
  return () => {
123
134
  var i;
@@ -126,9 +137,13 @@ const W = (e) => e, rt = (e) => !!(e && e.shapeFlag & 1), ot = (e, t) => !!(e &&
126
137
  type: "button",
127
138
  disabled: e.disabled,
128
139
  onClick: C
129
- }, [s.value && f("span", {
140
+ }, [f("span", {
141
+ style: {
142
+ width: s.value ? "16px" : "0px",
143
+ marginRight: s.value ? "4px" : "0px"
144
+ },
130
145
  class: o.element("loading")
131
- }, [f(dt, null, null)]), t.prefix && f("span", {
146
+ }, [f(mt, null, null)]), t.prefix && f("span", {
132
147
  class: o.element("prefix")
133
148
  }, [t.prefix()]), f("span", {
134
149
  class: o.element("content")
@@ -137,22 +152,22 @@ const W = (e) => e, rt = (e) => !!(e && e.shapeFlag & 1), ot = (e, t) => !!(e &&
137
152
  }, [t.suffix()])]);
138
153
  };
139
154
  }
140
- }), K = ct("XButton", ft), oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
155
+ }), K = dt(Y("Button"), gt), we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
141
156
  __proto__: null,
142
157
  XButton: K
143
- }, Symbol.toStringTag, { value: "Module" })), mt = ["px", "%", "vh", "vw", "calc"], Be = (e, t = "px") => {
158
+ }, Symbol.toStringTag, { value: "Module" })), yt = ["px", "%", "vh", "vw", "calc"], Be = (e, t = "px") => {
144
159
  if (e === void 0) return "";
145
160
  const n = String(e);
146
- return mt.some((l) => n.includes(l)) ? n : n + t;
147
- }, gt = 1e3, yt = 3e3, ht = 1;
148
- class vt {
161
+ return yt.some((l) => n.includes(l)) ? n : n + t;
162
+ }, ht = 1e3, vt = 3e3, Ct = 1;
163
+ class pt {
149
164
  constructor() {
150
165
  L(this, "popupStack", {
151
166
  popup: /* @__PURE__ */ new Set(),
152
167
  dialog: /* @__PURE__ */ new Set(),
153
168
  message: /* @__PURE__ */ new Set()
154
169
  });
155
- L(this, "getNextZIndex", (t) => (t === "message" ? Array.from(this.popupStack.message).pop() || yt : Array.from(this.popupStack.popup).pop() || gt) + ht);
170
+ L(this, "getNextZIndex", (t) => (t === "message" ? Array.from(this.popupStack.message).pop() || vt : Array.from(this.popupStack.popup).pop() || ht) + Ct);
156
171
  L(this, "add", (t) => {
157
172
  const n = this.getNextZIndex(t);
158
173
  return this.popupStack[t].add(n), t === "dialog" && this.popupStack.popup.add(n), n;
@@ -163,17 +178,17 @@ class vt {
163
178
  L(this, "isLastDialog", (t) => this.popupStack.dialog.size > 1 ? t === Array.from(this.popupStack.dialog).pop() : !0);
164
179
  }
165
180
  }
166
- const se = new vt();
167
- function fe(e, {
181
+ const oe = new pt();
182
+ function de(e, {
168
183
  visible: t,
169
184
  runOnMounted: n
170
185
  } = {}) {
171
- const l = X(0), o = () => {
172
- l.value = se.add(e);
186
+ const l = R(0), o = () => {
187
+ l.value = oe.add(e);
173
188
  }, r = () => {
174
- se.delete(l.value, e);
175
- }, u = () => e === "dialog" ? se.isLastDialog(l.value) : !1;
176
- return ue(
189
+ oe.delete(l.value, e);
190
+ }, u = () => e === "dialog" ? oe.isLastDialog(l.value) : !1;
191
+ return ce(
177
192
  () => t == null ? void 0 : t.value,
178
193
  (s) => {
179
194
  s ? o() : r();
@@ -181,7 +196,7 @@ function fe(e, {
181
196
  {
182
197
  immediate: !0
183
198
  }
184
- ), n && (de(() => {
199
+ ), n && (ue(() => {
185
200
  o();
186
201
  }), Te(() => {
187
202
  r();
@@ -193,15 +208,15 @@ function fe(e, {
193
208
  };
194
209
  }
195
210
  const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t, n) => (n == null ? void 0 : n.toUpperCase()) ?? ""), Pe = () => {
196
- }, Ct = (e, t) => {
211
+ }, kt = (e, t) => {
197
212
  if (ne)
198
213
  return (t ?? document).querySelector(e) ?? void 0;
199
- }, pt = (e) => {
214
+ }, bt = (e) => {
200
215
  if (e.tagName === "BODY")
201
216
  return window.innerWidth - (document.documentElement.offsetWidth || document.body.offsetWidth);
202
217
  const { borderLeftWidth: t, borderRightWidth: n } = window.getComputedStyle(e), l = Number(t.replace("px", "")) + Number(n.replace("px", ""));
203
218
  return e.offsetWidth - (e.clientWidth + l);
204
- }, kt = (e) => e.tagName === "BODY" ? document.documentElement.scrollHeight > window.innerHeight : e.scrollHeight > e.offsetHeight, bt = (e, t) => {
219
+ }, wt = (e) => e.tagName === "BODY" ? document.documentElement.scrollHeight > window.innerHeight : e.scrollHeight > e.offsetHeight, Bt = (e, t) => {
205
220
  var l;
206
221
  if (!ne || !e || !t) return "";
207
222
  let n = Ie(t);
@@ -224,17 +239,17 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
224
239
  const l = Ie(t);
225
240
  e.style[l] = n;
226
241
  }
227
- }, me = (e, t) => {
242
+ }, fe = (e, t) => {
228
243
  if (je(e)) {
229
244
  const n = e[0] === "#" ? `[id='${e.slice(1)}']` : e;
230
- return Ct(n, t);
245
+ return kt(n, t);
231
246
  }
232
247
  return e;
233
- }, wt = ne ? (e, t, n, l = !1) => {
248
+ }, St = ne ? (e, t, n, l = !1) => {
234
249
  e.addEventListener(t, n, l);
235
- } : Pe, Bt = ne ? (e, t, n, l = !1) => {
250
+ } : Pe, $t = ne ? (e, t, n, l = !1) => {
236
251
  e.removeEventListener(t, n, l);
237
- } : Pe, St = (e, t) => {
252
+ } : Pe, Ot = (e, t) => {
238
253
  let n = !1;
239
254
  const l = {
240
255
  overflow: "",
@@ -243,8 +258,8 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
243
258
  if (e.value) {
244
259
  const s = e.value;
245
260
  if (!n && s.style.overflow !== "hidden") {
246
- const d = pt(s);
247
- if (d > 0 || kt(s)) {
261
+ const d = bt(s);
262
+ if (d > 0 || wt(s)) {
248
263
  l.overflow = s.style.overflow, l.width = s.style.width;
249
264
  let m = 0;
250
265
  o(s) && (m = s.getBoundingClientRect().left || 0), Z(s, {
@@ -263,18 +278,18 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
263
278
  }), n = !1;
264
279
  }
265
280
  };
266
- return ue(
281
+ return ce(
267
282
  () => t == null ? void 0 : t.value,
268
283
  (s) => {
269
284
  e.value && !o(e.value) && (s && Z(s, {
270
285
  position: "absolute"
271
- }), bt(e.value, "position") === "static" && Z(e.value, { position: "relative" }));
286
+ }), Bt(e.value, "position") === "static" && Z(e.value, { position: "relative" }));
272
287
  }
273
288
  ), {
274
289
  setOverflowHidden: r,
275
290
  resetOverflow: u
276
291
  };
277
- }, $t = {
292
+ }, Et = {
278
293
  ENTER: "Enter",
279
294
  ESC: "Escape",
280
295
  BACKSPACE: "Backspace",
@@ -284,7 +299,7 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
284
299
  ARROW_DOWN: "ArrowDown",
285
300
  ARROW_LEFT: "ArrowLeft",
286
301
  ARROW_RIGHT: "ArrowRight"
287
- }, Ot = {
302
+ }, Nt = {
288
303
  renderTo: {
289
304
  type: W([String, Object]),
290
305
  default: "body"
@@ -370,29 +385,29 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
370
385
  type: Boolean,
371
386
  default: !1
372
387
  }
373
- }, Et = ["width", "minWidth", "height", "minHeight"], Nt = z({
388
+ }, Tt = ["width", "minWidth", "height", "minHeight"], Mt = z({
374
389
  name: Y("Dialog"),
375
390
  inheritAttrs: !1,
376
- props: Ot,
391
+ props: Nt,
377
392
  emits: ["closed", "close", "open", "opened", "update:modelValue"],
378
393
  setup(e, { emit: t }) {
379
394
  const n = A("dialog"), l = n.block, o = A("message-box"), r = o.block, u = k(() => [
380
395
  l,
381
396
  e.messageBox && "is-message-box",
382
397
  e.popupClass && e.popupClass
383
- ]), s = k(() => me(e.renderTo)), d = X(), m = k(() => e.disabled || !s.value), C = k(() => ({
398
+ ]), s = k(() => fe(e.renderTo)), d = R(), m = k(() => e.disabled || !s.value), C = k(() => ({
384
399
  zIndex: b.value
385
400
  })), i = k(() => {
386
401
  const h = {};
387
- return e.fullscreen || (!e.center && e.top && (h.top = Be(e.top)), Et.forEach((T) => {
402
+ return e.fullscreen || (!e.center && e.top && (h.top = Be(e.top)), Tt.forEach((T) => {
388
403
  e[T] && (h[T] = Be(e[T]));
389
404
  })), h;
390
- }), a = X(!1), c = k(() => e.modelValue), p = k(() => c.value || a.value), { zIndex: b, isLastDialog: $ } = fe("dialog", {
405
+ }), a = R(!1), c = k(() => e.modelValue), p = k(() => c.value || a.value), { zIndex: b, isLastDialog: $ } = de("dialog", {
391
406
  visible: c
392
- }), { setOverflowHidden: le, resetOverflow: pe } = St(s, d), ke = (h, T) => {
407
+ }), { setOverflowHidden: le, resetOverflow: Ce } = Ot(s, d), pe = (h, T) => {
393
408
  t("update:modelValue", !1), t("close", e.messageBox ? h : void 0, e.messageBox ? T : void 0);
394
409
  }, We = () => {
395
- a.value = !1, pe(), t("closed");
410
+ a.value = !1, Ce(), t("closed");
396
411
  }, Ze = () => {
397
412
  t("opened");
398
413
  }, q = Ne({
@@ -402,32 +417,32 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
402
417
  let J = !0;
403
418
  if (q[h] = !0, B(e.onBeforeCancel) && (J = e.onBeforeCancel(h) ?? !1), Le(J)) {
404
419
  J.then((Ke) => {
405
- q[h] = !1, Ke && ke(h, T);
420
+ q[h] = !1, Ke && pe(h, T);
406
421
  });
407
422
  return;
408
423
  }
409
- q[h] = !1, J && ke(h, T);
424
+ q[h] = !1, J && pe(h, T);
410
425
  }, Ue = () => {
411
426
  e.maskToClose && e.mask && P("cancel");
412
- }, Re = (h) => {
427
+ }, xe = (h) => {
413
428
  P("cancel", h);
414
- }, Xe = (h) => {
429
+ }, Re = (h) => {
415
430
  P("ok", h);
416
431
  };
417
432
  let re = !1;
418
- const be = (h) => {
419
- e.escToClose && h.key === $t.ESC && $() && P("cancel");
420
- }, xe = () => {
421
- e.escToClose && !re && (re = !0, wt(document.documentElement, "keydown", be));
422
- }, we = () => {
423
- re = !1, Bt(document.documentElement, "keydown", be);
433
+ const ke = (h) => {
434
+ e.escToClose && h.key === Et.ESC && $() && P("cancel");
435
+ }, Xe = () => {
436
+ e.escToClose && !re && (re = !0, St(document.documentElement, "keydown", ke));
437
+ }, be = () => {
438
+ re = !1, $t(document.documentElement, "keydown", ke);
424
439
  };
425
440
  return Te(() => {
426
- pe(), we();
427
- }), ue(
441
+ Ce(), be();
442
+ }), ce(
428
443
  () => c.value,
429
444
  (h) => {
430
- h ? (t("open"), le(), a.value = !0, xe()) : we();
445
+ h ? (t("open"), le(), a.value = !0, Xe()) : be();
431
446
  },
432
447
  { immediate: !0 }
433
448
  ), {
@@ -447,8 +462,8 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
447
462
  afterLeave: We,
448
463
  afterEnter: Ze,
449
464
  handleMaskClick: Ue,
450
- handleCancel: Re,
451
- handleOk: Xe,
465
+ handleCancel: xe,
466
+ handleOk: Re,
452
467
  loadingObj: q
453
468
  };
454
469
  }
@@ -458,7 +473,7 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
458
473
  n[l] = o;
459
474
  return n;
460
475
  };
461
- function Tt(e, t, n, l, o, r) {
476
+ function At(e, t, n, l, o, r) {
462
477
  return v(), O(Qe, {
463
478
  to: e.teleportContainer,
464
479
  disabled: e.teleportDisabled
@@ -478,7 +493,7 @@ function Tt(e, t, n, l, o, r) {
478
493
  key: 0,
479
494
  class: g([e.cn.element("mask")])
480
495
  }, null, 2)), [
481
- [R, e.modelVisible]
496
+ [x, e.modelVisible]
482
497
  ]) : D("", !0)
483
498
  ]),
484
499
  _: 1
@@ -530,18 +545,18 @@ function Tt(e, t, n, l, o, r) {
530
545
  onClick: t[0] || (t[0] = (u) => e.interceptClose("cancel"))
531
546
  }, null, 2)) : D("", !0)
532
547
  ], 6), [
533
- [R, e.modelVisible]
548
+ [x, e.modelVisible]
534
549
  ])
535
550
  ]),
536
551
  _: 3
537
552
  }, 8, ["onAfterEnter", "onAfterLeave"])
538
553
  ], 2)
539
554
  ], 6)), [
540
- [R, e.mergeVisible]
555
+ [x, e.mergeVisible]
541
556
  ]) : D("", !0)
542
557
  ], 8, ["to", "disabled"]);
543
558
  }
544
- const Ve = /* @__PURE__ */ F(Nt, [["render", Tt]]), He = /* @__PURE__ */ z({
559
+ const Ve = /* @__PURE__ */ F(Mt, [["render", At]]), He = /* @__PURE__ */ z({
545
560
  name: Y("Space"),
546
561
  props: {
547
562
  direction: {
@@ -566,7 +581,7 @@ const Ve = /* @__PURE__ */ F(Nt, [["render", Tt]]), He = /* @__PURE__ */ z({
566
581
  }) {
567
582
  const n = A("space"), l = k(() => [n.block, n.element(e.direction), e.fill && "is-fill", n.element(`${e.direction}-${e.align}`)]);
568
583
  function o(u) {
569
- if (lt(u))
584
+ if (ot(u))
570
585
  return u;
571
586
  switch (u) {
572
587
  case "mini":
@@ -595,7 +610,7 @@ const Ve = /* @__PURE__ */ F(Nt, [["render", Tt]]), He = /* @__PURE__ */ z({
595
610
  }, [u.map((d, m) => {
596
611
  var i;
597
612
  const C = t.split && m > 0;
598
- return f(x, {
613
+ return f(X, {
599
614
  key: `space-item-${m}`
600
615
  }, [C && f("div", {
601
616
  className: n.element("split"),
@@ -611,7 +626,7 @@ const Ve = /* @__PURE__ */ F(Nt, [["render", Tt]]), He = /* @__PURE__ */ z({
611
626
  function Se(e) {
612
627
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !w(e);
613
628
  }
614
- const $e = A("dialog"), rn = (e) => {
629
+ const $e = A("dialog"), on = (e) => {
615
630
  const t = document.createElement("div"), n = () => {
616
631
  M(null, t);
617
632
  }, l = (i) => {
@@ -639,7 +654,7 @@ const $e = A("dialog"), rn = (e) => {
639
654
  return f("div", {
640
655
  class: $e.element("content")
641
656
  }, [E(" "), e.content, E(" ")]);
642
- }, s = () => () => f(x, null, [e.title && r(e.title)]), d = () => () => f(x, null, [e.content && u(e.content)]), m = () => {
657
+ }, s = () => () => f(X, null, [e.title && r(e.title)]), d = () => () => f(X, null, [e.content && u(e.content)]), m = () => {
643
658
  if (w(e.footer) || B(e.footer))
644
659
  return e.footer;
645
660
  const i = (e == null ? void 0 : e.cancelText) || "取消", a = (e == null ? void 0 : e.okText) || "确认";
@@ -689,14 +704,14 @@ const $e = A("dialog"), rn = (e) => {
689
704
  footer: m()
690
705
  });
691
706
  M(C, t);
692
- }, Mt = ["success", "warning", "error", "strong", "info"], At = (e) => je(e) ? e.split("-").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join("") : "", Ft = (e, t = "px") => {
707
+ }, Ft = ["success", "warning", "error", "strong", "info"], Dt = (e) => je(e) ? e.split("-").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join("") : "", zt = (e, t = "px") => {
693
708
  if (e === void 0) return "";
694
709
  const n = typeof e == "number" ? `${e}` : e;
695
710
  return ["px", "%", "vh", "vw", "calc"].some((o) => n.includes(o)) ? n : n + t;
696
711
  };
697
712
  function I(e) {
698
713
  return z({
699
- name: Fe(`Icon${At(e)}`),
714
+ name: Fe(`Icon${Dt(e)}`),
700
715
  props: {
701
716
  size: {
702
717
  type: [Number, String],
@@ -722,7 +737,7 @@ function I(e) {
722
737
  setup(t) {
723
738
  const n = "x-icon", l = k(() => {
724
739
  const r = {};
725
- return t.size && (r.fontSize = Ft(t.size)), t.rotate && (r.transform = `rotate(${t.rotate}deg)`), t.color && (r.color = t.color), r;
740
+ return t.size && (r.fontSize = zt(t.size)), t.rotate && (r.transform = `rotate(${t.rotate}deg)`), t.color && (r.color = t.color), r;
726
741
  });
727
742
  return {
728
743
  cls: k(() => [
@@ -736,8 +751,8 @@ function I(e) {
736
751
  }
737
752
  });
738
753
  }
739
- const Dt = I("close-circle-fill");
740
- function zt(e, t, n, l, o, r) {
754
+ const Lt = I("close-circle-fill");
755
+ function jt(e, t, n, l, o, r) {
741
756
  return v(), S("div", {
742
757
  class: g(e.cls),
743
758
  style: N(e.styles)
@@ -762,8 +777,8 @@ function zt(e, t, n, l, o, r) {
762
777
  ], -1)
763
778
  ]), 6);
764
779
  }
765
- const ge = /* @__PURE__ */ F(Dt, [["render", zt]]), Lt = I("check-circle-fill");
766
- function jt(e, t, n, l, o, r) {
780
+ const me = /* @__PURE__ */ F(Lt, [["render", jt]]), It = I("check-circle-fill");
781
+ function Pt(e, t, n, l, o, r) {
767
782
  return v(), S("div", {
768
783
  class: g(e.cls),
769
784
  style: N(e.styles)
@@ -788,8 +803,8 @@ function jt(e, t, n, l, o, r) {
788
803
  ], -1)
789
804
  ]), 6);
790
805
  }
791
- const ye = /* @__PURE__ */ F(Lt, [["render", jt]]), It = I("exclamation-circle-fill");
792
- function Pt(e, t, n, l, o, r) {
806
+ const ge = /* @__PURE__ */ F(It, [["render", Pt]]), Vt = I("exclamation-circle-fill");
807
+ function Ht(e, t, n, l, o, r) {
793
808
  return v(), S("div", {
794
809
  class: g(e.cls),
795
810
  style: N(e.styles)
@@ -814,8 +829,8 @@ function Pt(e, t, n, l, o, r) {
814
829
  ], -1)
815
830
  ]), 6);
816
831
  }
817
- const he = /* @__PURE__ */ F(It, [["render", Pt]]), Vt = I("info-circle-fill");
818
- function Ht(e, t, n, l, o, r) {
832
+ const ye = /* @__PURE__ */ F(Vt, [["render", Ht]]), Wt = I("info-circle-fill");
833
+ function Zt(e, t, n, l, o, r) {
819
834
  return v(), S("div", {
820
835
  class: g(e.cls),
821
836
  style: N(e.styles)
@@ -840,8 +855,8 @@ function Ht(e, t, n, l, o, r) {
840
855
  ], -1)
841
856
  ]), 6);
842
857
  }
843
- const ve = /* @__PURE__ */ F(Vt, [["render", Ht]]), Wt = I("minus-circle-fill");
844
- function Zt(e, t, n, l, o, r) {
858
+ const he = /* @__PURE__ */ F(Wt, [["render", Zt]]), Ut = I("minus-circle-fill");
859
+ function xt(e, t, n, l, o, r) {
845
860
  return v(), S("div", {
846
861
  class: g(e.cls),
847
862
  style: N(e.styles)
@@ -866,16 +881,16 @@ function Zt(e, t, n, l, o, r) {
866
881
  ], -1)
867
882
  ]), 6);
868
883
  }
869
- const Ce = /* @__PURE__ */ F(Wt, [["render", Zt]]);
884
+ const ve = /* @__PURE__ */ F(Ut, [["render", xt]]);
870
885
  I("animation-loading");
871
- const Ut = z({
886
+ const Rt = z({
872
887
  name: Y("Message"),
873
888
  components: {
874
- CloseCircleFill: ge,
875
- CheckCircleFill: ye,
876
- ExclamationCircleFill: he,
877
- InfoCircleFill: ve,
878
- MinusCircleFill: Ce
889
+ CloseCircleFill: me,
890
+ CheckCircleFill: ge,
891
+ ExclamationCircleFill: ye,
892
+ InfoCircleFill: he,
893
+ MinusCircleFill: ve
879
894
  },
880
895
  props: {
881
896
  id: {
@@ -929,19 +944,19 @@ const Ut = z({
929
944
  e.center && t.modifier("center"),
930
945
  e.showClose && !e.center && t.element("show-close"),
931
946
  e.popupClass && e.popupClass
932
- ]), l = X(!1);
947
+ ]), l = R(!1);
933
948
  let o = null;
934
949
  const r = () => {
935
950
  o = setTimeout(() => {
936
951
  l.value = !1;
937
952
  }, e.duration);
938
953
  };
939
- de(() => {
954
+ ue(() => {
940
955
  l.value = !0, e.duration !== 0 && r();
941
956
  }), Ae(() => {
942
957
  clearTimeout(o);
943
958
  });
944
- const { zIndex: u } = fe("message", { runOnMounted: !0 }), s = k(() => ({
959
+ const { zIndex: u } = de("message", { runOnMounted: !0 }), s = k(() => ({
945
960
  top: `${e.offset}px`,
946
961
  zIndex: u.value
947
962
  }));
@@ -955,8 +970,8 @@ const Ut = z({
955
970
  }
956
971
  };
957
972
  }
958
- }), Rt = ["innerHTML"], Xt = { key: 1 };
959
- function xt(e, t, n, l, o, r) {
973
+ }), Xt = ["innerHTML"], Kt = { key: 1 };
974
+ function Yt(e, t, n, l, o, r) {
960
975
  const u = V("CheckCircleFill"), s = V("ExclamationCircleFill"), d = V("MinusCircleFill"), m = V("CloseCircleFill"), C = V("InfoCircleFill");
961
976
  return v(), O(_, {
962
977
  name: "x-message-slide-top",
@@ -980,7 +995,7 @@ function xt(e, t, n, l, o, r) {
980
995
  e.useHTML ? (v(), S("span", {
981
996
  key: 0,
982
997
  innerHTML: e.message
983
- }, null, 8, Rt)) : (v(), S("span", Xt, te(e.message), 1)),
998
+ }, null, 8, Xt)) : (v(), S("span", Kt, te(e.message), 1)),
984
999
  e.showClose ? (v(), S("span", {
985
1000
  key: 2,
986
1001
  class: g([e.cn.element("close-icon")]),
@@ -988,19 +1003,19 @@ function xt(e, t, n, l, o, r) {
988
1003
  }, null, 2)) : D("", !0)
989
1004
  ])
990
1005
  ], 6), [
991
- [R, e.visible]
1006
+ [x, e.visible]
992
1007
  ])
993
1008
  ]),
994
1009
  _: 3
995
1010
  }, 8, ["onBeforeLeave"]);
996
1011
  }
997
- const Kt = /* @__PURE__ */ F(Ut, [["render", xt]]), ae = /* @__PURE__ */ new WeakMap(), ie = (e) => {
1012
+ const Gt = /* @__PURE__ */ F(Rt, [["render", Yt]]), se = /* @__PURE__ */ new WeakMap(), ae = (e) => {
998
1013
  (typeof e == "string" || w(e)) && (e = {
999
1014
  message: e
1000
1015
  });
1001
- const t = me(e.renderTo || "body");
1002
- ae.has(t) || ae.set(t, []);
1003
- const n = ae.get(t);
1016
+ const t = fe(e.renderTo || "body");
1017
+ se.has(t) || se.set(t, []);
1018
+ const n = se.get(t);
1004
1019
  let l = e.offset || 20;
1005
1020
  n.forEach((i) => {
1006
1021
  var a;
@@ -1022,7 +1037,7 @@ const Kt = /* @__PURE__ */ F(Ut, [["render", xt]]), ae = /* @__PURE__ */ new Wea
1022
1037
  M(null, m);
1023
1038
  }, offset: l };
1024
1039
  const d = f(
1025
- Kt,
1040
+ Gt,
1026
1041
  r,
1027
1042
  B(r.message) || w(r.message) ? {
1028
1043
  default: B(r.message) ? r.message : () => r.message
@@ -1033,23 +1048,23 @@ const Kt = /* @__PURE__ */ F(Ut, [["render", xt]]), ae = /* @__PURE__ */ new Wea
1033
1048
  d.component.proxy.handleClose();
1034
1049
  }
1035
1050
  };
1036
- }, Yt = () => {
1037
- Mt.forEach((e) => {
1038
- ie[e] = (t) => ze(t) ? ie({
1051
+ }, qt = () => {
1052
+ Ft.forEach((e) => {
1053
+ ae[e] = (t) => ze(t) ? ae({
1039
1054
  type: e,
1040
1055
  ...t
1041
- }) : ie({
1056
+ }) : ae({
1042
1057
  message: t,
1043
1058
  type: e
1044
1059
  });
1045
1060
  });
1046
1061
  };
1047
- Yt();
1048
- const Gt = ["info", "success", "warning", "strong", "error"];
1062
+ qt();
1063
+ const Jt = ["info", "success", "warning", "strong", "error"];
1049
1064
  function Oe(e) {
1050
1065
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !w(e);
1051
1066
  }
1052
- const ce = A("message-box"), Ee = (e) => {
1067
+ const ie = A("message-box"), Ee = (e) => {
1053
1068
  const t = document.createElement("div"), n = () => {
1054
1069
  M(null, t);
1055
1070
  }, l = (a) => {
@@ -1063,38 +1078,38 @@ const ce = A("message-box"), Ee = (e) => {
1063
1078
  let c;
1064
1079
  switch (a) {
1065
1080
  case "warning":
1066
- c = f(he, {
1081
+ c = f(ye, {
1067
1082
  size: "22px",
1068
1083
  color: "#f6c64b"
1069
1084
  }, null);
1070
1085
  break;
1071
1086
  case "strong":
1072
- c = f(Ce, {
1087
+ c = f(ve, {
1073
1088
  size: "22px",
1074
1089
  color: "#ff7125"
1075
1090
  }, null);
1076
1091
  break;
1077
1092
  case "error":
1078
- c = f(ge, {
1093
+ c = f(me, {
1079
1094
  size: "22px",
1080
1095
  color: "#e24f48"
1081
1096
  }, null);
1082
1097
  break;
1083
1098
  case "success":
1084
- c = f(ye, {
1099
+ c = f(ge, {
1085
1100
  size: "22px",
1086
1101
  color: "#68d1ab"
1087
1102
  }, null);
1088
1103
  break;
1089
1104
  case "info":
1090
- c = f(ve, {
1105
+ c = f(he, {
1091
1106
  size: "22px",
1092
1107
  color: "#2355f5"
1093
1108
  }, null);
1094
1109
  break;
1095
1110
  }
1096
1111
  return f("div", {
1097
- class: ce.element("icon")
1112
+ class: ie.element("icon")
1098
1113
  }, [c]);
1099
1114
  }, u = (a) => {
1100
1115
  if (w(a)) return a;
@@ -1103,7 +1118,7 @@ const ce = A("message-box"), Ee = (e) => {
1103
1118
  return w(c) ? c : null;
1104
1119
  }
1105
1120
  return f("div", {
1106
- class: ce.element("title")
1121
+ class: ie.element("title")
1107
1122
  }, [E(" "), a, E(" ")]);
1108
1123
  }, s = (a) => {
1109
1124
  if (w(a)) return a;
@@ -1112,9 +1127,9 @@ const ce = A("message-box"), Ee = (e) => {
1112
1127
  return w(c) ? c : null;
1113
1128
  }
1114
1129
  return f("div", {
1115
- class: ce.element("content")
1130
+ class: ie.element("content")
1116
1131
  }, [E(" "), e.content, E(" ")]);
1117
- }, d = () => () => f(x, null, [r(e.type || "success"), e.title && u(e.title)]), m = () => () => f(x, null, [e.content && s(e.content)]), C = () => {
1132
+ }, d = () => () => f(X, null, [r(e.type || "success"), e.title && u(e.title)]), m = () => () => f(X, null, [e.content && s(e.content)]), C = () => {
1118
1133
  if (w(e.footer) || B(e.footer))
1119
1134
  return e.footer;
1120
1135
  const a = (e == null ? void 0 : e.cancelText) || "取消", c = (e == null ? void 0 : e.okText) || "确认";
@@ -1165,8 +1180,8 @@ const ce = A("message-box"), Ee = (e) => {
1165
1180
  footer: C()
1166
1181
  });
1167
1182
  M(i, t);
1168
- }, qt = () => {
1169
- Gt.forEach((e) => {
1183
+ }, Qt = () => {
1184
+ Jt.forEach((e) => {
1170
1185
  Ee[e] = (t, n) => {
1171
1186
  const l = [], o = [];
1172
1187
  let r = () => !0, u = () => !0;
@@ -1195,8 +1210,8 @@ const ce = A("message-box"), Ee = (e) => {
1195
1210
  };
1196
1211
  });
1197
1212
  };
1198
- qt();
1199
- const Jt = {
1213
+ Qt();
1214
+ const _t = {
1200
1215
  position: {
1201
1216
  type: String,
1202
1217
  default: "top-right"
@@ -1234,12 +1249,12 @@ const Jt = {
1234
1249
  type: Boolean,
1235
1250
  default: !1
1236
1251
  }
1237
- }, Qt = z({
1252
+ }, en = z({
1238
1253
  name: Y("Notification"),
1239
- props: Jt,
1254
+ props: _t,
1240
1255
  emits: ["close", "destroy"],
1241
1256
  setup(e) {
1242
- const t = A("notification"), n = t.block, l = k(() => [n, t.modifier(r.value.ver)]), { zIndex: o } = fe("message", { runOnMounted: !0 }), r = k(() => {
1257
+ const t = A("notification"), n = t.block, l = k(() => [n, t.modifier(r.value.ver)]), { zIndex: o } = de("message", { runOnMounted: !0 }), r = k(() => {
1243
1258
  const c = e.position.split("-");
1244
1259
  return {
1245
1260
  hor: c[1],
@@ -1248,16 +1263,16 @@ const Jt = {
1248
1263
  }), u = k(() => `x-notification-slide-${r.value.hor}`), s = k(() => {
1249
1264
  const c = {};
1250
1265
  return c.position = e.renderToBody ? "fixed" : "absolute", c.zIndex = o.value, c[r.value.hor] = "20px", c[r.value.ver] = `${e.offset}px`, c;
1251
- }), d = X(!1);
1266
+ }), d = R(!1);
1252
1267
  let m = 0;
1253
1268
  const C = () => {
1254
1269
  setTimeout(() => {
1255
1270
  d.value = !1;
1256
1271
  }, e.duration);
1257
- }, i = k(() => e.type === "info" ? ve : e.type === "warning" ? he : e.type === "strong" ? Ce : e.type === "success" ? ye : e.type === "error" ? ge : ""), a = () => {
1272
+ }, i = k(() => e.type === "info" ? he : e.type === "warning" ? ye : e.type === "strong" ? ve : e.type === "success" ? ge : e.type === "error" ? me : ""), a = () => {
1258
1273
  d.value = !1;
1259
1274
  };
1260
- return de(() => {
1275
+ return ue(() => {
1261
1276
  e.duration !== 0 && C(), d.value = !0;
1262
1277
  }), Ae(() => {
1263
1278
  clearTimeout(m);
@@ -1274,7 +1289,7 @@ const Jt = {
1274
1289
  };
1275
1290
  }
1276
1291
  });
1277
- function _t(e, t, n, l, o, r) {
1292
+ function tn(e, t, n, l, o, r) {
1278
1293
  return v(), O(_, {
1279
1294
  name: e.animationClsName,
1280
1295
  onBeforeLeave: t[1] || (t[1] = (u) => e.$emit("close")),
@@ -1312,14 +1327,14 @@ function _t(e, t, n, l, o, r) {
1312
1327
  onClick: t[0] || (t[0] = Me((...u) => e.handleClose && e.handleClose(...u), ["self"]))
1313
1328
  }, null, 2)) : D("", !0)
1314
1329
  ], 6), [
1315
- [R, e.visible]
1330
+ [x, e.visible]
1316
1331
  ])
1317
1332
  ]),
1318
1333
  _: 3
1319
1334
  }, 8, ["name"]);
1320
1335
  }
1321
- const en = /* @__PURE__ */ F(Qt, [["render", _t]]), H = /* @__PURE__ */ new WeakMap(), on = (e) => {
1322
- const t = me(e.renderTo || "body"), n = document.createElement("div");
1336
+ const nn = /* @__PURE__ */ F(en, [["render", tn]]), H = /* @__PURE__ */ new WeakMap(), sn = (e) => {
1337
+ const t = fe(e.renderTo || "body"), n = document.createElement("div");
1323
1338
  H.get(t) || H.set(t, {}), H.get(t)[e.position] || (H.get(t)[e.position] = []);
1324
1339
  const l = H.get(t)[e.position];
1325
1340
  let o = e.offset || 20;
@@ -1342,7 +1357,7 @@ const en = /* @__PURE__ */ F(Qt, [["render", _t]]), H = /* @__PURE__ */ new Weak
1342
1357
  }, d = () => {
1343
1358
  M(null, n);
1344
1359
  }, m = f(
1345
- en,
1360
+ nn,
1346
1361
  {
1347
1362
  message: e.message,
1348
1363
  title: e.title,
@@ -1360,20 +1375,19 @@ const en = /* @__PURE__ */ F(Qt, [["render", _t]]), H = /* @__PURE__ */ new Weak
1360
1375
  } : null
1361
1376
  );
1362
1377
  M(m, n), l.push(m), t == null || t.appendChild(n.firstChild);
1363
- }, tn = function(e) {
1364
- Object.keys(oe).forEach((t) => {
1365
- const n = oe[t];
1366
- n.install ? e.use(n) : e.component(t, oe[t]);
1367
- });
1368
- }, sn = {
1369
- install: tn
1378
+ }, an = {
1379
+ install: function(e) {
1380
+ Object.keys(we).forEach((t) => {
1381
+ const n = we[t];
1382
+ n.install && e.use(n);
1383
+ });
1384
+ }
1370
1385
  };
1371
1386
  export {
1372
- rn as Dialog,
1373
- ie as Message,
1387
+ on as Dialog,
1388
+ ae as Message,
1374
1389
  Ee as MessageBox,
1375
- on as Notification,
1390
+ sn as Notification,
1376
1391
  K as XButton,
1377
- sn as default,
1378
- tn as install
1392
+ an as default
1379
1393
  };