x-next 0.0.0-alpha.13 → 0.0.0-alpha.14
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +182 -2
- package/dist/index.es.js +59 -58
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -6,7 +6,187 @@ import { default as Notification } from './components/notification/warp';
|
|
6
6
|
export * from './components';
|
7
7
|
export { Dialog, Message, MessageBox, Notification };
|
8
8
|
export declare const install: (app: App) => void;
|
9
|
-
declare const
|
9
|
+
declare const XNext: {
|
10
|
+
XButton: {
|
11
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
12
|
+
disabled: BooleanConstructor;
|
13
|
+
block: BooleanConstructor;
|
14
|
+
loading: BooleanConstructor;
|
15
|
+
loadingFill: {
|
16
|
+
type: BooleanConstructor;
|
17
|
+
default: boolean;
|
18
|
+
};
|
19
|
+
debounce: {
|
20
|
+
type: NumberConstructor;
|
21
|
+
default: number;
|
22
|
+
};
|
23
|
+
shape: {
|
24
|
+
type: import('vue').PropType<import('./components/button/props').ButtonShape>;
|
25
|
+
default: undefined;
|
26
|
+
};
|
27
|
+
link: {
|
28
|
+
type: BooleanConstructor;
|
29
|
+
default: boolean;
|
30
|
+
};
|
31
|
+
type: {
|
32
|
+
type: import('vue').PropType<import('./components/button/props').ButtonType>;
|
33
|
+
default: undefined;
|
34
|
+
};
|
35
|
+
status: {
|
36
|
+
type: import('vue').PropType<import('./components/button/props').ButtonStatus>;
|
37
|
+
default: undefined;
|
38
|
+
};
|
39
|
+
plain: {
|
40
|
+
type: BooleanConstructor;
|
41
|
+
default: boolean;
|
42
|
+
};
|
43
|
+
size: {
|
44
|
+
type: import('vue').PropType<import('./components/button/props').ButtonSize>;
|
45
|
+
default: string;
|
46
|
+
};
|
47
|
+
border: {
|
48
|
+
type: BooleanConstructor;
|
49
|
+
default: boolean;
|
50
|
+
};
|
51
|
+
}>> & Readonly<{
|
52
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
53
|
+
}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "click"[], import('vue').PublicProps, {
|
54
|
+
size: import('./components/button/props').ButtonSize;
|
55
|
+
disabled: boolean;
|
56
|
+
block: boolean;
|
57
|
+
loading: boolean;
|
58
|
+
loadingFill: boolean;
|
59
|
+
debounce: number;
|
60
|
+
shape: import('./components/button/props').ButtonShape;
|
61
|
+
link: boolean;
|
62
|
+
type: import('./components/button/props').ButtonType;
|
63
|
+
status: import('./components/button/props').ButtonStatus;
|
64
|
+
plain: boolean;
|
65
|
+
border: boolean;
|
66
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
67
|
+
P: {};
|
68
|
+
B: {};
|
69
|
+
D: {};
|
70
|
+
C: {};
|
71
|
+
M: {};
|
72
|
+
Defaults: {};
|
73
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
74
|
+
disabled: BooleanConstructor;
|
75
|
+
block: BooleanConstructor;
|
76
|
+
loading: BooleanConstructor;
|
77
|
+
loadingFill: {
|
78
|
+
type: BooleanConstructor;
|
79
|
+
default: boolean;
|
80
|
+
};
|
81
|
+
debounce: {
|
82
|
+
type: NumberConstructor;
|
83
|
+
default: number;
|
84
|
+
};
|
85
|
+
shape: {
|
86
|
+
type: import('vue').PropType<import('./components/button/props').ButtonShape>;
|
87
|
+
default: undefined;
|
88
|
+
};
|
89
|
+
link: {
|
90
|
+
type: BooleanConstructor;
|
91
|
+
default: boolean;
|
92
|
+
};
|
93
|
+
type: {
|
94
|
+
type: import('vue').PropType<import('./components/button/props').ButtonType>;
|
95
|
+
default: undefined;
|
96
|
+
};
|
97
|
+
status: {
|
98
|
+
type: import('vue').PropType<import('./components/button/props').ButtonStatus>;
|
99
|
+
default: undefined;
|
100
|
+
};
|
101
|
+
plain: {
|
102
|
+
type: BooleanConstructor;
|
103
|
+
default: boolean;
|
104
|
+
};
|
105
|
+
size: {
|
106
|
+
type: import('vue').PropType<import('./components/button/props').ButtonSize>;
|
107
|
+
default: string;
|
108
|
+
};
|
109
|
+
border: {
|
110
|
+
type: BooleanConstructor;
|
111
|
+
default: boolean;
|
112
|
+
};
|
113
|
+
}>> & Readonly<{
|
114
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
115
|
+
}>, () => any, {}, {}, {}, {
|
116
|
+
size: import('./components/button/props').ButtonSize;
|
117
|
+
disabled: boolean;
|
118
|
+
block: boolean;
|
119
|
+
loading: boolean;
|
120
|
+
loadingFill: boolean;
|
121
|
+
debounce: number;
|
122
|
+
shape: import('./components/button/props').ButtonShape;
|
123
|
+
link: boolean;
|
124
|
+
type: import('./components/button/props').ButtonType;
|
125
|
+
status: import('./components/button/props').ButtonStatus;
|
126
|
+
plain: boolean;
|
127
|
+
border: boolean;
|
128
|
+
}>;
|
129
|
+
__isFragment?: never;
|
130
|
+
__isTeleport?: never;
|
131
|
+
__isSuspense?: never;
|
132
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
133
|
+
disabled: BooleanConstructor;
|
134
|
+
block: BooleanConstructor;
|
135
|
+
loading: BooleanConstructor;
|
136
|
+
loadingFill: {
|
137
|
+
type: BooleanConstructor;
|
138
|
+
default: boolean;
|
139
|
+
};
|
140
|
+
debounce: {
|
141
|
+
type: NumberConstructor;
|
142
|
+
default: number;
|
143
|
+
};
|
144
|
+
shape: {
|
145
|
+
type: import('vue').PropType<import('./components/button/props').ButtonShape>;
|
146
|
+
default: undefined;
|
147
|
+
};
|
148
|
+
link: {
|
149
|
+
type: BooleanConstructor;
|
150
|
+
default: boolean;
|
151
|
+
};
|
152
|
+
type: {
|
153
|
+
type: import('vue').PropType<import('./components/button/props').ButtonType>;
|
154
|
+
default: undefined;
|
155
|
+
};
|
156
|
+
status: {
|
157
|
+
type: import('vue').PropType<import('./components/button/props').ButtonStatus>;
|
158
|
+
default: undefined;
|
159
|
+
};
|
160
|
+
plain: {
|
161
|
+
type: BooleanConstructor;
|
162
|
+
default: boolean;
|
163
|
+
};
|
164
|
+
size: {
|
165
|
+
type: import('vue').PropType<import('./components/button/props').ButtonSize>;
|
166
|
+
default: string;
|
167
|
+
};
|
168
|
+
border: {
|
169
|
+
type: BooleanConstructor;
|
170
|
+
default: boolean;
|
171
|
+
};
|
172
|
+
}>> & Readonly<{
|
173
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
174
|
+
}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "click"[], "click", {
|
175
|
+
size: import('./components/button/props').ButtonSize;
|
176
|
+
disabled: boolean;
|
177
|
+
block: boolean;
|
178
|
+
loading: boolean;
|
179
|
+
loadingFill: boolean;
|
180
|
+
debounce: number;
|
181
|
+
shape: import('./components/button/props').ButtonShape;
|
182
|
+
link: boolean;
|
183
|
+
type: import('./components/button/props').ButtonType;
|
184
|
+
status: import('./components/button/props').ButtonStatus;
|
185
|
+
plain: boolean;
|
186
|
+
border: boolean;
|
187
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
|
188
|
+
install: (app: App) => void;
|
189
|
+
};
|
10
190
|
install: (app: App) => void;
|
11
191
|
};
|
12
|
-
export default
|
192
|
+
export default XNext;
|
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
|
4
|
+
import { defineComponent as z, createVNode as f, reactive as Ne, computed as k, getCurrentInstance as qe, ref as R, watch as ue, onMounted as de, onBeforeUnmount as Te, readonly as Je, openBlock as v, createBlock as O, Teleport as Qe, withDirectives as X, createElementBlock as S, normalizeClass as g, normalizeStyle as N, Transition as ee, withCtx as te, vShow as U, createCommentVNode as D, createElementVNode as y, withModifiers as Me, renderSlot as j, toDisplayString as ne, 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 {
|
@@ -27,7 +27,7 @@ function lt(e) {
|
|
27
27
|
function B(e) {
|
28
28
|
return typeof e == "function";
|
29
29
|
}
|
30
|
-
function
|
30
|
+
function le() {
|
31
31
|
return typeof window < "u";
|
32
32
|
}
|
33
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) => {
|
@@ -117,7 +117,7 @@ const W = (e) => e, rt = (e) => !!(e && e.shapeFlag & 1), ot = (e, t) => !!(e &&
|
|
117
117
|
if ((p = (c = i.target).blur) == null || p.call(c), s.value) return;
|
118
118
|
u();
|
119
119
|
const a = ($ = (b = d == null ? void 0 : d.vnode) == null ? void 0 : b.props) == null ? void 0 : $.onClick;
|
120
|
-
De(a) ? a.forEach((
|
120
|
+
De(a) ? a.forEach((re) => m(re, i)) : B(a) && m(a, i), n("click", i);
|
121
121
|
};
|
122
122
|
return () => {
|
123
123
|
var i;
|
@@ -137,7 +137,7 @@ const W = (e) => e, rt = (e) => !!(e && e.shapeFlag & 1), ot = (e, t) => !!(e &&
|
|
137
137
|
}, [t.suffix()])]);
|
138
138
|
};
|
139
139
|
}
|
140
|
-
}), K = ct("XButton", ft),
|
140
|
+
}), K = ct("XButton", ft), _ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
141
141
|
__proto__: null,
|
142
142
|
XButton: K
|
143
143
|
}, Symbol.toStringTag, { value: "Module" })), mt = ["px", "%", "vh", "vw", "calc"], Be = (e, t = "px") => {
|
@@ -168,7 +168,7 @@ function fe(e, {
|
|
168
168
|
visible: t,
|
169
169
|
runOnMounted: n
|
170
170
|
} = {}) {
|
171
|
-
const l =
|
171
|
+
const l = R(0), o = () => {
|
172
172
|
l.value = se.add(e);
|
173
173
|
}, r = () => {
|
174
174
|
se.delete(l.value, e);
|
@@ -194,7 +194,7 @@ function fe(e, {
|
|
194
194
|
}
|
195
195
|
const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t, n) => (n == null ? void 0 : n.toUpperCase()) ?? ""), Pe = () => {
|
196
196
|
}, Ct = (e, t) => {
|
197
|
-
if (
|
197
|
+
if (le)
|
198
198
|
return (t ?? document).querySelector(e) ?? void 0;
|
199
199
|
}, pt = (e) => {
|
200
200
|
if (e.tagName === "BODY")
|
@@ -203,7 +203,7 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
203
203
|
return e.offsetWidth - (e.clientWidth + l);
|
204
204
|
}, kt = (e) => e.tagName === "BODY" ? document.documentElement.scrollHeight > window.innerHeight : e.scrollHeight > e.offsetHeight, bt = (e, t) => {
|
205
205
|
var l;
|
206
|
-
if (!
|
206
|
+
if (!le || !e || !t) return "";
|
207
207
|
let n = Ie(t);
|
208
208
|
n === "float" && (n = "cssFloat");
|
209
209
|
try {
|
@@ -230,9 +230,9 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
230
230
|
return Ct(n, t);
|
231
231
|
}
|
232
232
|
return e;
|
233
|
-
}, wt =
|
233
|
+
}, wt = le ? (e, t, n, l = !1) => {
|
234
234
|
e.addEventListener(t, n, l);
|
235
|
-
} : Pe, Bt =
|
235
|
+
} : Pe, Bt = le ? (e, t, n, l = !1) => {
|
236
236
|
e.removeEventListener(t, n, l);
|
237
237
|
} : Pe, St = (e, t) => {
|
238
238
|
let n = !1;
|
@@ -380,16 +380,16 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
380
380
|
l,
|
381
381
|
e.messageBox && "is-message-box",
|
382
382
|
e.popupClass && e.popupClass
|
383
|
-
]), s = k(() => me(e.renderTo)), d =
|
383
|
+
]), s = k(() => me(e.renderTo)), d = R(), m = k(() => e.disabled || !s.value), C = k(() => ({
|
384
384
|
zIndex: b.value
|
385
385
|
})), i = k(() => {
|
386
386
|
const h = {};
|
387
387
|
return e.fullscreen || (!e.center && e.top && (h.top = Be(e.top)), Et.forEach((T) => {
|
388
388
|
e[T] && (h[T] = Be(e[T]));
|
389
389
|
})), h;
|
390
|
-
}), a =
|
390
|
+
}), a = R(!1), c = k(() => e.modelValue), p = k(() => c.value || a.value), { zIndex: b, isLastDialog: $ } = fe("dialog", {
|
391
391
|
visible: c
|
392
|
-
}), { setOverflowHidden:
|
392
|
+
}), { setOverflowHidden: re, resetOverflow: pe } = St(s, d), ke = (h, T) => {
|
393
393
|
t("update:modelValue", !1), t("close", e.messageBox ? h : void 0, e.messageBox ? T : void 0);
|
394
394
|
}, We = () => {
|
395
395
|
a.value = !1, pe(), t("closed");
|
@@ -407,27 +407,27 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
407
407
|
return;
|
408
408
|
}
|
409
409
|
q[h] = !1, J && ke(h, T);
|
410
|
-
},
|
410
|
+
}, Xe = () => {
|
411
411
|
e.maskToClose && e.mask && P("cancel");
|
412
|
-
},
|
412
|
+
}, Ue = (h) => {
|
413
413
|
P("cancel", h);
|
414
|
-
},
|
414
|
+
}, Re = (h) => {
|
415
415
|
P("ok", h);
|
416
416
|
};
|
417
|
-
let
|
417
|
+
let oe = !1;
|
418
418
|
const be = (h) => {
|
419
419
|
e.escToClose && h.key === $t.ESC && $() && P("cancel");
|
420
420
|
}, xe = () => {
|
421
|
-
e.escToClose && !
|
421
|
+
e.escToClose && !oe && (oe = !0, wt(document.documentElement, "keydown", be));
|
422
422
|
}, we = () => {
|
423
|
-
|
423
|
+
oe = !1, Bt(document.documentElement, "keydown", be);
|
424
424
|
};
|
425
425
|
return Te(() => {
|
426
426
|
pe(), we();
|
427
427
|
}), ue(
|
428
428
|
() => c.value,
|
429
429
|
(h) => {
|
430
|
-
h ? (t("open"),
|
430
|
+
h ? (t("open"), re(), a.value = !0, xe()) : we();
|
431
431
|
},
|
432
432
|
{ immediate: !0 }
|
433
433
|
), {
|
@@ -446,9 +446,9 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
446
446
|
interceptClose: P,
|
447
447
|
afterLeave: We,
|
448
448
|
afterEnter: Ze,
|
449
|
-
handleMaskClick:
|
450
|
-
handleCancel:
|
451
|
-
handleOk:
|
449
|
+
handleMaskClick: Xe,
|
450
|
+
handleCancel: Ue,
|
451
|
+
handleOk: Re,
|
452
452
|
loadingObj: q
|
453
453
|
};
|
454
454
|
}
|
@@ -463,22 +463,22 @@ function Tt(e, t, n, l, o, r) {
|
|
463
463
|
to: e.teleportContainer,
|
464
464
|
disabled: e.teleportDisabled
|
465
465
|
}, [
|
466
|
-
!e.destroyOnClosed || e.mergeVisible ?
|
466
|
+
!e.destroyOnClosed || e.mergeVisible ? X((v(), S("div", {
|
467
467
|
key: 0,
|
468
468
|
ref: "dialogRef",
|
469
469
|
class: g(e.cls),
|
470
470
|
style: N(e.dialogStyle)
|
471
471
|
}, [
|
472
|
-
f(
|
472
|
+
f(ee, {
|
473
473
|
name: "x-fade-in-standard",
|
474
474
|
appear: ""
|
475
475
|
}, {
|
476
|
-
default:
|
477
|
-
e.mask ?
|
476
|
+
default: te(() => [
|
477
|
+
e.mask ? X((v(), S("div", {
|
478
478
|
key: 0,
|
479
479
|
class: g([e.cn.element("mask")])
|
480
480
|
}, null, 2)), [
|
481
|
-
[
|
481
|
+
[U, e.modelVisible]
|
482
482
|
]) : D("", !0)
|
483
483
|
]),
|
484
484
|
_: 1
|
@@ -487,14 +487,14 @@ function Tt(e, t, n, l, o, r) {
|
|
487
487
|
class: g([e.cn.element("wrapper"), { "is-center": e.center }]),
|
488
488
|
onClick: t[1] || (t[1] = Me((...u) => e.handleMaskClick && e.handleMaskClick(...u), ["self"]))
|
489
489
|
}, [
|
490
|
-
f(
|
490
|
+
f(ee, {
|
491
491
|
name: "x-zoom-in",
|
492
492
|
appear: "",
|
493
493
|
onAfterEnter: e.afterEnter,
|
494
494
|
onAfterLeave: e.afterLeave
|
495
495
|
}, {
|
496
|
-
default:
|
497
|
-
|
496
|
+
default: te(() => [
|
497
|
+
X(y("div", {
|
498
498
|
class: g([e.cn.element("container"), { "is-fullscreen": e.fullscreen }]),
|
499
499
|
style: N(e.containerStyle)
|
500
500
|
}, [
|
@@ -507,7 +507,7 @@ function Tt(e, t, n, l, o, r) {
|
|
507
507
|
j(e.$slots, "title", {}, () => [
|
508
508
|
y("div", {
|
509
509
|
class: g([e.cn.element("header-title")])
|
510
|
-
},
|
510
|
+
}, ne(e.title), 3)
|
511
511
|
])
|
512
512
|
], 2),
|
513
513
|
y("div", {
|
@@ -530,14 +530,14 @@ function Tt(e, t, n, l, o, r) {
|
|
530
530
|
onClick: t[0] || (t[0] = (u) => e.interceptClose("cancel"))
|
531
531
|
}, null, 2)) : D("", !0)
|
532
532
|
], 6), [
|
533
|
-
[
|
533
|
+
[U, e.modelVisible]
|
534
534
|
])
|
535
535
|
]),
|
536
536
|
_: 3
|
537
537
|
}, 8, ["onAfterEnter", "onAfterLeave"])
|
538
538
|
], 2)
|
539
539
|
], 6)), [
|
540
|
-
[
|
540
|
+
[U, e.mergeVisible]
|
541
541
|
]) : D("", !0)
|
542
542
|
], 8, ["to", "disabled"]);
|
543
543
|
}
|
@@ -611,7 +611,7 @@ const Ve = /* @__PURE__ */ F(Nt, [["render", Tt]]), He = /* @__PURE__ */ z({
|
|
611
611
|
function Se(e) {
|
612
612
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !w(e);
|
613
613
|
}
|
614
|
-
const $e = A("dialog"),
|
614
|
+
const $e = A("dialog"), on = (e) => {
|
615
615
|
const t = document.createElement("div"), n = () => {
|
616
616
|
M(null, t);
|
617
617
|
}, l = (i) => {
|
@@ -868,7 +868,7 @@ function Zt(e, t, n, l, o, r) {
|
|
868
868
|
}
|
869
869
|
const Ce = /* @__PURE__ */ F(Wt, [["render", Zt]]);
|
870
870
|
I("animation-loading");
|
871
|
-
const
|
871
|
+
const Xt = z({
|
872
872
|
name: Y("Message"),
|
873
873
|
components: {
|
874
874
|
CloseCircleFill: ge,
|
@@ -929,7 +929,7 @@ const Ut = z({
|
|
929
929
|
e.center && t.modifier("center"),
|
930
930
|
e.showClose && !e.center && t.element("show-close"),
|
931
931
|
e.popupClass && e.popupClass
|
932
|
-
]), l =
|
932
|
+
]), l = R(!1);
|
933
933
|
let o = null;
|
934
934
|
const r = () => {
|
935
935
|
o = setTimeout(() => {
|
@@ -955,16 +955,16 @@ const Ut = z({
|
|
955
955
|
}
|
956
956
|
};
|
957
957
|
}
|
958
|
-
}),
|
958
|
+
}), Ut = ["innerHTML"], Rt = { key: 1 };
|
959
959
|
function xt(e, t, n, l, o, r) {
|
960
960
|
const u = V("CheckCircleFill"), s = V("ExclamationCircleFill"), d = V("MinusCircleFill"), m = V("CloseCircleFill"), C = V("InfoCircleFill");
|
961
|
-
return v(), O(
|
961
|
+
return v(), O(ee, {
|
962
962
|
name: "x-message-slide-top",
|
963
963
|
onBeforeLeave: e.onClose,
|
964
964
|
onAfterLeave: t[1] || (t[1] = (i) => e.$emit("destroy"))
|
965
965
|
}, {
|
966
|
-
default:
|
967
|
-
|
966
|
+
default: te(() => [
|
967
|
+
X(y("div", {
|
968
968
|
class: g(e.cls),
|
969
969
|
style: N(e.styles)
|
970
970
|
}, [
|
@@ -980,7 +980,7 @@ function xt(e, t, n, l, o, r) {
|
|
980
980
|
e.useHTML ? (v(), S("span", {
|
981
981
|
key: 0,
|
982
982
|
innerHTML: e.message
|
983
|
-
}, null, 8,
|
983
|
+
}, null, 8, Ut)) : (v(), S("span", Rt, ne(e.message), 1)),
|
984
984
|
e.showClose ? (v(), S("span", {
|
985
985
|
key: 2,
|
986
986
|
class: g([e.cn.element("close-icon")]),
|
@@ -988,13 +988,13 @@ function xt(e, t, n, l, o, r) {
|
|
988
988
|
}, null, 2)) : D("", !0)
|
989
989
|
])
|
990
990
|
], 6), [
|
991
|
-
[
|
991
|
+
[U, e.visible]
|
992
992
|
])
|
993
993
|
]),
|
994
994
|
_: 3
|
995
995
|
}, 8, ["onBeforeLeave"]);
|
996
996
|
}
|
997
|
-
const Kt = /* @__PURE__ */ F(
|
997
|
+
const Kt = /* @__PURE__ */ F(Xt, [["render", xt]]), ae = /* @__PURE__ */ new WeakMap(), ie = (e) => {
|
998
998
|
(typeof e == "string" || w(e)) && (e = {
|
999
999
|
message: e
|
1000
1000
|
});
|
@@ -1248,7 +1248,7 @@ const Jt = {
|
|
1248
1248
|
}), u = k(() => `x-notification-slide-${r.value.hor}`), s = k(() => {
|
1249
1249
|
const c = {};
|
1250
1250
|
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 =
|
1251
|
+
}), d = R(!1);
|
1252
1252
|
let m = 0;
|
1253
1253
|
const C = () => {
|
1254
1254
|
setTimeout(() => {
|
@@ -1275,13 +1275,13 @@ const Jt = {
|
|
1275
1275
|
}
|
1276
1276
|
});
|
1277
1277
|
function _t(e, t, n, l, o, r) {
|
1278
|
-
return v(), O(
|
1278
|
+
return v(), O(ee, {
|
1279
1279
|
name: e.animationClsName,
|
1280
1280
|
onBeforeLeave: t[1] || (t[1] = (u) => e.$emit("close")),
|
1281
1281
|
onAfterLeave: t[2] || (t[2] = (u) => e.$emit("destroy"))
|
1282
1282
|
}, {
|
1283
|
-
default:
|
1284
|
-
|
1283
|
+
default: te(() => [
|
1284
|
+
X(y("div", {
|
1285
1285
|
class: g(e.cls),
|
1286
1286
|
style: N(e.positionStyle)
|
1287
1287
|
}, [
|
@@ -1296,12 +1296,12 @@ function _t(e, t, n, l, o, r) {
|
|
1296
1296
|
y("div", null, [
|
1297
1297
|
y("div", {
|
1298
1298
|
class: g([e.cn.element("title")])
|
1299
|
-
},
|
1299
|
+
}, ne(e.title), 3),
|
1300
1300
|
y("div", {
|
1301
1301
|
class: g([e.cn.element("message")])
|
1302
1302
|
}, [
|
1303
1303
|
j(e.$slots, "default", {}, () => [
|
1304
|
-
E(
|
1304
|
+
E(ne(e.message), 1)
|
1305
1305
|
])
|
1306
1306
|
], 2)
|
1307
1307
|
])
|
@@ -1312,13 +1312,13 @@ function _t(e, t, n, l, o, r) {
|
|
1312
1312
|
onClick: t[0] || (t[0] = Me((...u) => e.handleClose && e.handleClose(...u), ["self"]))
|
1313
1313
|
}, null, 2)) : D("", !0)
|
1314
1314
|
], 6), [
|
1315
|
-
[
|
1315
|
+
[U, e.visible]
|
1316
1316
|
])
|
1317
1317
|
]),
|
1318
1318
|
_: 3
|
1319
1319
|
}, 8, ["name"]);
|
1320
1320
|
}
|
1321
|
-
const en = /* @__PURE__ */ F(Qt, [["render", _t]]), H = /* @__PURE__ */ new WeakMap(),
|
1321
|
+
const en = /* @__PURE__ */ F(Qt, [["render", _t]]), H = /* @__PURE__ */ new WeakMap(), sn = (e) => {
|
1322
1322
|
const t = me(e.renderTo || "body"), n = document.createElement("div");
|
1323
1323
|
H.get(t) || H.set(t, {}), H.get(t)[e.position] || (H.get(t)[e.position] = []);
|
1324
1324
|
const l = H.get(t)[e.position];
|
@@ -1361,19 +1361,20 @@ const en = /* @__PURE__ */ F(Qt, [["render", _t]]), H = /* @__PURE__ */ new Weak
|
|
1361
1361
|
);
|
1362
1362
|
M(m, n), l.push(m), t == null || t.appendChild(n.firstChild);
|
1363
1363
|
}, tn = function(e) {
|
1364
|
-
Object.keys(
|
1365
|
-
const n =
|
1366
|
-
n.install ? e.use(n) : e.component(t,
|
1364
|
+
Object.keys(_).forEach((t) => {
|
1365
|
+
const n = _[t];
|
1366
|
+
n.install ? e.use(n) : e.component(t, _[t]);
|
1367
1367
|
});
|
1368
|
-
},
|
1368
|
+
}, { XButton: nn } = _, an = {
|
1369
|
+
XButton: nn,
|
1369
1370
|
install: tn
|
1370
1371
|
};
|
1371
1372
|
export {
|
1372
|
-
|
1373
|
+
on as Dialog,
|
1373
1374
|
ie as Message,
|
1374
1375
|
Ee as MessageBox,
|
1375
|
-
|
1376
|
+
sn as Notification,
|
1376
1377
|
K as XButton,
|
1377
|
-
|
1378
|
+
an as default,
|
1378
1379
|
tn as install
|
1379
1380
|
};
|
package/dist/index.umd.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
(function(C,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(C=typeof globalThis<"u"?globalThis:C||self,t(C.index={},C.Vue))})(this,function(C,t){"use strict";var Vt=Object.defineProperty;var St=(C,t,V)=>t in C?Vt(C,t,{enumerable:!0,configurable:!0,writable:!0,value:V}):C[t]=V;var $=(C,t,V)=>St(C,typeof t!="symbol"?t+"":t,V);const V="X",he="x",v=e=>e?he+"-"+e:e||"",O=e=>V+e,b=e=>{const n=v(e);return{block:n,element:r=>`${n}--${r}`,modifier:r=>`${n}-${r}`,is:r=>`${n}-is-${r}`}},T=Object.prototype.toString;function ee(e){return T.call(e)==="[object Array]"}function te(e){return T.call(e)==="[object Object]"}const ne=e=>T.call(e)==="[object Promise]";function le(e){return T.call(e)==="[object String]"}function pe(e){return T.call(e)==="[object Number]"&&e===e}function k(e){return typeof e=="function"}function A(){return typeof window<"u"}const z=e=>e,ke=e=>!!(e&&e.shapeFlag&1),Ne=(e,n)=>!!(e&&e.shapeFlag&6),be=(e,n)=>!!(e&&e.shapeFlag&8),Be=(e,n)=>!!(e&&e.shapeFlag&16),we=(e,n)=>!!(e&&e.shapeFlag&32),L=(e,n=!1)=>{var o,a;const l=[];for(const r of e??[])ke(r)||Ne(r)||n&&be(r,r.children)?l.push(r):Be(r,r.children)?l.push(...L(r.children,n)):we(r,r.children)?l.push(...L((a=(o=r.children).default)==null?void 0:a.call(o),n)):ee(r)&&l.push(...L(r,n));return l},Ve=(e,n)=>Object.assign(n,{install:l=>{l.component(e,n)}}),Se={disabled:Boolean,block:Boolean,loading:Boolean,loadingFill:{type:Boolean,default:!1},debounce:{type:Number,default:0},shape:{type:z(String),default:void 0},link:{type:Boolean,default:!1},type:{type:z(String),default:void 0},status:{type:z(String),default:void 0},plain:{type:Boolean,default:!1},size:{type:z(String),default:"medium"},border:{type:Boolean,default:!0}},Ee=t.defineComponent({name:"Backward",render(){return t.createVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createVNode("path",{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",fill:"currentColor"},null)])}}),$e=t.defineComponent({name:O("Button"),props:Se,emits:["click"],setup(e,{slots:n,emit:l}){const o=t.reactive({clicked:!1,isDebounce:!1}),a=b("button"),r=t.computed(()=>[a.block,e.type&&a.modifier(e.type),e.status&&a.modifier(e.status),e.disabled&&a.is("disabled"),e.block&&a.modifier("block"),e.plain&&a.is("plain"),e.shape&&a.modifier(e.shape),e.link&&a.modifier("is-link"),e.size&&a.modifier(e.size),!e.border&&a.modifier("is-hide-border"),s.value&&a.modifier("is-loading")]),f=()=>{e.debounce>0&&!o.isDebounce&&(o.isDebounce=!0,setTimeout(()=>{o.isDebounce=!1},e.debounce))},s=t.computed(()=>e.loading||o.clicked||o.isDebounce),m=t.getCurrentInstance(),u=(i,c)=>{const d=i(c);ne(d)&&(o.clicked=!0,d.finally(()=>{o.clicked=!1}))},y=i=>{var d,h,p,N;if((h=(d=i.target).blur)==null||h.call(d),s.value)return;f();const c=(N=(p=m==null?void 0:m.vnode)==null?void 0:p.props)==null?void 0:N.onClick;ee(c)?c.forEach(Q=>u(Q,i)):k(c)&&u(c,i),l("click",i)};return()=>{var i;return t.createVNode("button",{class:r.value,type:"button",disabled:e.disabled,onClick:y},[s.value&&t.createVNode("span",{class:a.element("loading")},[t.createVNode(Ee,null,null)]),n.prefix&&t.createVNode("span",{class:a.element("prefix")},[n.prefix()]),t.createVNode("span",{class:a.element("content")},[(i=n.default)==null?void 0:i.call(n)]),n.suffix&&t.createVNode("span",{class:a.element("suffix")},[n.suffix()])])}}}),S=Ve("XButton",$e),H=Object.freeze(Object.defineProperty({__proto__:null,XButton:S},Symbol.toStringTag,{value:"Module"})),Oe=["px","%","vh","vw","calc"],oe=(e,n="px")=>{if(e===void 0)return"";const l=String(e);return Oe.some(o=>l.includes(o))?l:l+n},Te=1e3,ze=3e3,Me=1;class De{constructor(){$(this,"popupStack",{popup:new Set,dialog:new Set,message:new Set});$(this,"getNextZIndex",n=>(n==="message"?Array.from(this.popupStack.message).pop()||ze:Array.from(this.popupStack.popup).pop()||Te)+Me);$(this,"add",n=>{const l=this.getNextZIndex(n);return this.popupStack[n].add(l),n==="dialog"&&this.popupStack.popup.add(l),l});$(this,"delete",(n,l)=>{this.popupStack[l].delete(n),l==="dialog"&&this.popupStack.popup.delete(n)});$(this,"isLastDialog",n=>this.popupStack.dialog.size>1?n===Array.from(this.popupStack.dialog).pop():!0)}}const W=new De;function Z(e,{visible:n,runOnMounted:l}={}){const o=t.ref(0),a=()=>{o.value=W.add(e)},r=()=>{W.delete(o.value,e)},f=()=>e==="dialog"?W.isLastDialog(o.value):!1;return t.watch(()=>n==null?void 0:n.value,s=>{s?a():r()},{immediate:!0}),l&&(t.onMounted(()=>{a()}),t.onBeforeUnmount(()=>{r()})),{zIndex:t.readonly(o),open:a,close:r,isLastDialog:f}}const re=e=>e.replace(/^./,n=>n.toLowerCase()).replace(/-(\w)/g,(n,l)=>(l==null?void 0:l.toUpperCase())??""),ae=()=>{},Fe=(e,n)=>{if(A)return(n??document).querySelector(e)??void 0},Ae=e=>{if(e.tagName==="BODY")return window.innerWidth-(document.documentElement.offsetWidth||document.body.offsetWidth);const{borderLeftWidth:n,borderRightWidth:l}=window.getComputedStyle(e),o=Number(n.replace("px",""))+Number(l.replace("px",""));return e.offsetWidth-(e.clientWidth+o)},Le=e=>e.tagName==="BODY"?document.documentElement.scrollHeight>window.innerHeight:e.scrollHeight>e.offsetHeight,je=(e,n)=>{var o;if(!A||!e||!n)return"";let l=re(n);l==="float"&&(l="cssFloat");try{const a=e.style[l];if(a)return a;const r=(o=document.defaultView)==null?void 0:o.getComputedStyle(e,"");return r?r[l]:""}catch{return e.style[l]}},M=(e,n,l)=>{if(!(!e||!n))if(te(n))Object.entries(n).forEach(([o,a])=>M(e,o,a));else{const o=re(n);e.style[o]=l}},U=(e,n)=>{if(le(e)){const l=e[0]==="#"?`[id='${e.slice(1)}']`:e;return Fe(l,n)}return e},Ie=A?(e,n,l,o=!1)=>{e.addEventListener(n,l,o)}:ae,Pe=A?(e,n,l,o=!1)=>{e.removeEventListener(n,l,o)}:ae,He=(e,n)=>{let l=!1;const o={overflow:"",width:""},a=s=>s.tagName==="BODY",r=()=>{if(e.value){const s=e.value;if(!l&&s.style.overflow!=="hidden"){const m=Ae(s);if(m>0||Le(s)){o.overflow=s.style.overflow,o.width=s.style.width;let u=0;a(s)&&(u=s.getBoundingClientRect().left||0),M(s,{width:`calc(100% - ${Math.ceil(m-u)}px)`,overflow:"hidden"}),l=!0}}}},f=()=>{if(e.value&&l){const s=e.value;M(s,{overflow:o.overflow,width:o.width}),l=!1}};return t.watch(()=>n==null?void 0:n.value,s=>{e.value&&!a(e.value)&&(s&&M(s,{position:"absolute"}),je(e.value,"position")==="static"&&M(e.value,{position:"relative"}))}),{setOverflowHidden:r,resetOverflow:f}},We={ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",TAB:"Tab",SPACE:" ",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight"},Ze={renderTo:{type:z([String,Object]),default:"body"},disabled:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1},top:{type:[String,Number],default:"3vh"},center:{type:Boolean,default:!1},width:{type:[String,Number],default:0},height:{type:[String,Number],default:0},minWidth:{type:[String,Number],default:0},minHeight:{type:[String,Number],default:0},title:{type:String,default:""},mask:{type:Boolean,default:!0},destroyOnClosed:{type:Boolean,default:!0},onBeforeCancel:{type:Function},maskToClose:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!0},fullscreen:{type:Boolean,default:!1},messageBox:{type:Boolean,default:!1},popupClass:{type:String,default:void 0},showClose:{type:Boolean,default:!0},showHeaderBottomLine:{type:Boolean,default:!1}},Ue=["width","minWidth","height","minHeight"],xe=t.defineComponent({name:O("Dialog"),inheritAttrs:!1,props:Ze,emits:["closed","close","open","opened","update:modelValue"],setup(e,{emit:n}){const l=b("dialog"),o=l.block,a=b("message-box"),r=a.block,f=t.computed(()=>[o,e.messageBox&&"is-message-box",e.popupClass&&e.popupClass]),s=t.computed(()=>U(e.renderTo)),m=t.ref(),u=t.computed(()=>e.disabled||!s.value),y=t.computed(()=>({zIndex:p.value})),i=t.computed(()=>{const g={};return e.fullscreen||(!e.center&&e.top&&(g.top=oe(e.top)),Ue.forEach(w=>{e[w]&&(g[w]=oe(e[w]))})),g}),c=t.ref(!1),d=t.computed(()=>e.modelValue),h=t.computed(()=>d.value||c.value),{zIndex:p,isLastDialog:N}=Z("dialog",{visible:d}),{setOverflowHidden:Q,resetOverflow:ue}=He(s,m),ge=(g,w)=>{n("update:modelValue",!1),n("close",e.messageBox?g:void 0,e.messageBox?w:void 0)},ht=()=>{c.value=!1,ue(),n("closed")},pt=()=>{n("opened")},I=t.reactive({ok:!1,cancel:!1}),F=(g,w)=>{let P=!0;if(I[g]=!0,k(e.onBeforeCancel)&&(P=e.onBeforeCancel(g)??!1),ne(P)){P.then(wt=>{I[g]=!1,wt&&ge(g,w)});return}I[g]=!1,P&&ge(g,w)},kt=()=>{e.maskToClose&&e.mask&&F("cancel")},Nt=g=>{F("cancel",g)},bt=g=>{F("ok",g)};let _=!1;const ye=g=>{e.escToClose&&g.key===We.ESC&&N()&&F("cancel")},Bt=()=>{e.escToClose&&!_&&(_=!0,Ie(document.documentElement,"keydown",ye))},Ce=()=>{_=!1,Pe(document.documentElement,"keydown",ye)};return t.onBeforeUnmount(()=>{ue(),Ce()}),t.watch(()=>d.value,g=>{g?(n("open"),Q(),c.value=!0,Bt()):Ce()},{immediate:!0}),{cls:f,ns:o,cn:l,cnOMB:a,messageBoxNs:r,containerStyle:i,dialogStyle:y,dialogRef:m,teleportContainer:s,teleportDisabled:u,modelVisible:d,mergeVisible:h,interceptClose:F,afterLeave:ht,afterEnter:pt,handleMaskClick:kt,handleCancel:Nt,handleOk:bt,loadingObj:I}}}),B=(e,n)=>{const l=e.__vccOpts||e;for(const[o,a]of n)l[o]=a;return l};function Re(e,n,l,o,a,r){return t.openBlock(),t.createBlock(t.Teleport,{to:e.teleportContainer,disabled:e.teleportDisabled},[!e.destroyOnClosed||e.mergeVisible?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,ref:"dialogRef",class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.dialogStyle)},[t.createVNode(t.Transition,{name:"x-fade-in-standard",appear:""},{default:t.withCtx(()=>[e.mask?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([e.cn.element("mask")])},null,2)),[[t.vShow,e.modelVisible]]):t.createCommentVNode("",!0)]),_:1}),t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("wrapper"),{"is-center":e.center}]),onClick:n[1]||(n[1]=t.withModifiers((...f)=>e.handleMaskClick&&e.handleMaskClick(...f),["self"]))},[t.createVNode(t.Transition,{name:"x-zoom-in",appear:"",onAfterEnter:e.afterEnter,onAfterLeave:e.afterLeave},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("container"),{"is-fullscreen":e.fullscreen}]),style:t.normalizeStyle(e.containerStyle)},[t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("header"):e.cn.element("header"),e.showHeaderBottomLine&&"is-bottom-line"])},[t.renderSlot(e.$slots,"title",{},()=>[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("header-title")])},t.toDisplayString(e.title),3)])],2),t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("body"):e.cn.element("body")])},[t.renderSlot(e.$slots,"default")],2),t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("footer"):e.cn.element("footer")])},[t.renderSlot(e.$slots,"footer",{cancel:e.handleCancel,ok:e.handleOk,loadingObj:e.loadingObj})],2),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("close-icon"),e.messageBox&&e.cnOMB.element("close-icon")]),onClick:n[0]||(n[0]=f=>e.interceptClose("cancel"))},null,2)):t.createCommentVNode("",!0)],6),[[t.vShow,e.modelVisible]])]),_:3},8,["onAfterEnter","onAfterLeave"])],2)],6)),[[t.vShow,e.mergeVisible]]):t.createCommentVNode("",!0)],8,["to","disabled"])}const se=B(xe,[["render",Re]]),ce=t.defineComponent({name:O("Space"),props:{direction:{type:String,default:"horizontal"},size:{type:[Number,String],default:"small"},align:{type:String,default:"center"},fill:{type:Boolean,default:!1}},setup(e,{slots:n}){const l=b("space"),o=t.computed(()=>[l.block,l.element(e.direction),e.fill&&"is-fill",l.element(`${e.direction}-${e.align}`)]);function a(f){if(pe(f))return f;switch(f){case"mini":return 4;case"small":return 8;case"medium":return 16;case"large":return 24;default:return 8}}const r=f=>{const s={};if(f)return s;const m=`${a(e.size)}px`,u=`${a(e.size)}px`;return e.direction==="horizontal"&&(s.marginRight=m),e.direction==="vertical"&&(s.marginBottom=u),s};return()=>{var s;const f=L((s=n.default)==null?void 0:s.call(n),!0).filter(m=>m.type!==t.Comment);return t.createVNode("div",{class:[o.value]},[f.map((m,u)=>{var i;const y=n.split&&u>0;return t.createVNode(t.Fragment,{key:`space-item-${u}`},[y&&t.createVNode("div",{className:l.element("split"),style:r(!1)},[(i=n.split)==null?void 0:i.call(n)]),t.createVNode("div",{className:l.element("item"),style:r(u===f.length-1)},[m])])})])}}});function ie(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const de=b("dialog"),Xe=e=>{const n=document.createElement("div"),l=()=>{t.render(null,n)},o=i=>{if(i==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(i==="ok")return e.beforeOnOk?e.beforeOnOk():!0},a=(i,c)=>{i==="cancel"&&e.onCancel&&e.onCancel(c),i==="ok"&&e.onOk&&e.onOk(c)},r=i=>{if(t.isVNode(i))return i;if(k(i)){const c=i();return t.isVNode(c)?c:null}return t.createVNode("div",{class:de.element("header-title")},[t.createTextVNode(" "),i,t.createTextVNode(" ")])},f=i=>{if(t.isVNode(i))return i;if(k(i)){const c=i();return t.isVNode(c)?c:null}return t.createVNode("div",{class:de.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},s=()=>()=>t.createVNode(t.Fragment,null,[e.title&&r(e.title)]),m=()=>()=>t.createVNode(t.Fragment,null,[e.content&&f(e.content)]),u=()=>{if(t.isVNode(e.footer)||k(e.footer))return e.footer;const i=(e==null?void 0:e.cancelText)||"取消",c=(e==null?void 0:e.okText)||"确认";return d=>t.createVNode(ce,{size:12},{default:()=>{var h,p;return[!e.hideCancel&&t.createVNode(S,{size:"small",onClick:d.cancel,loading:(h=d.loadingObj)==null?void 0:h.cancel},ie(i)?i:{default:()=>[i]}),!e.hideOk&&t.createVNode(S,{type:"primary",size:"small",onClick:d.ok,loading:(p=d.loadingObj)==null?void 0:p.ok},ie(c)?c:{default:()=>[c]})]}})},y=t.createVNode(se,{width:(e==null?void 0:e.width)??368,height:(e==null?void 0:e.height)??"auto",modelValue:!0,renderTo:e==null?void 0:e.renderTo,center:e!=null&&e.top?!1:(e==null?void 0:e.center)??!0,top:(e==null?void 0:e.top)??0,mask:(e==null?void 0:e.mask)??!0,maskToClose:(e==null?void 0:e.maskToClose)??!0,popupClass:e.popupClass,onClose:a,onBeforeCancel:o,"onUpdate:modelValue":()=>{y.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:s(),default:m(),footer:u()});t.render(y,n)},Ke=["success","warning","error","strong","info"],Ye=e=>le(e)?e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(""):"",Ge=(e,n="px")=>{if(e===void 0)return"";const l=typeof e=="number"?`${e}`:e;return["px","%","vh","vw","calc"].some(a=>l.includes(a))?l:l+n};function E(e){return t.defineComponent({name:v(`Icon${Ye(e)}`),props:{size:{type:[Number,String],default:void 0},rotate:{type:Number,default:void 0},spin:{type:Boolean,default:!1},color:{type:String,default:void 0},fillColor:{type:Array,default:void 0}},setup(n){const l="x-icon",o=t.computed(()=>{const r={};return n.size&&(r.fontSize=Ge(n.size)),n.rotate&&(r.transform=`rotate(${n.rotate}deg)`),n.color&&(r.color=n.color),r});return{cls:t.computed(()=>[l,{[`${l}-loading`]:n.spin}]),styles:o}}})}const qe=E("close-circle-fill");function Je(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm4.955-27.771-4.95 4.95-4.95-4.95a1 1 0 0 0-1.414 0l-1.414 1.414a1 1 0 0 0 0 1.414l4.95 4.95-4.95 4.95a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0l4.95-4.95 4.95 4.95a1 1 0 0 0 1.414 0l1.414-1.414a1 1 0 0 0 0-1.414l-4.95-4.95 4.95-4.95a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const x=B(qe,[["render",Je]]),Qe=E("check-circle-fill");function _e(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm10.207-24.379a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0L22 26.172l-4.878-4.88a1 1 0 0 0-1.415 0l-1.414 1.415a1 1 0 0 0 0 1.414l7 7a1 1 0 0 0 1.414 0l11.5-11.5Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const R=B(Qe,[["render",_e]]),ve=E("exclamation-circle-fill");function et(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-2-11a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2Zm4-18a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V15Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const X=B(ve,[["render",et]]),tt=E("info-circle-fill");function nt(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const K=B(tt,[["render",nt]]),lt=E("minus-circle-fill");function ot(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-7-22a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1H17Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const Y=B(lt,[["render",ot]]);E("animation-loading");const rt=t.defineComponent({name:O("Message"),components:{CloseCircleFill:x,CheckCircleFill:R,ExclamationCircleFill:X,InfoCircleFill:K,MinusCircleFill:Y},props:{id:{type:String,default:""},message:{type:[String,Number,Object],default:""},type:{type:String,default:"success"},duration:{type:Number,default:1500},center:{type:Boolean,default:!1},onClose:{type:Function,default:()=>{}},offset:{type:Number,default:20},zIndex:{type:Number,default:0},showClose:{type:Boolean,default:!1},useHTML:Boolean,popupClass:{type:String,default:void 0}},emits:["destroy"],setup(e){const n=b("message"),l=t.computed(()=>[n.block,n.modifier(e.type),e.center&&n.modifier("center"),e.showClose&&!e.center&&n.element("show-close"),e.popupClass&&e.popupClass]),o=t.ref(!1);let a=null;const r=()=>{a=setTimeout(()=>{o.value=!1},e.duration)};t.onMounted(()=>{o.value=!0,e.duration!==0&&r()}),t.onUnmounted(()=>{clearTimeout(a)});const{zIndex:f}=Z("message",{runOnMounted:!0}),s=t.computed(()=>({top:`${e.offset}px`,zIndex:f.value}));return{cn:n,cls:l,styles:s,visible:o,handleClose:()=>{o.value=!1}}}}),at=["innerHTML"],st={key:1};function ct(e,n,l,o,a,r){const f=t.resolveComponent("CheckCircleFill"),s=t.resolveComponent("ExclamationCircleFill"),m=t.resolveComponent("MinusCircleFill"),u=t.resolveComponent("CloseCircleFill"),y=t.resolveComponent("InfoCircleFill");return t.openBlock(),t.createBlock(t.Transition,{name:"x-message-slide-top",onBeforeLeave:e.onClose,onAfterLeave:n[1]||(n[1]=i=>e.$emit("destroy"))},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},[e.$slots.icon?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("icon"),e.cn.modifier(`icon-${e.type}`)])},[t.renderSlot(e.$slots,"icon",{},()=>[e.type==="success"?(t.openBlock(),t.createBlock(f,{key:0})):e.type==="warning"?(t.openBlock(),t.createBlock(s,{key:1})):e.type==="strong"?(t.openBlock(),t.createBlock(m,{key:2})):e.type==="error"?(t.openBlock(),t.createBlock(u,{key:3})):e.type==="info"?(t.openBlock(),t.createBlock(y,{key:4})):t.createCommentVNode("",!0)])],2)),t.renderSlot(e.$slots,"default",{},()=>[e.useHTML?(t.openBlock(),t.createElementBlock("span",{key:0,innerHTML:e.message},null,8,at)):(t.openBlock(),t.createElementBlock("span",st,t.toDisplayString(e.message),1)),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:2,class:t.normalizeClass([e.cn.element("close-icon")]),onClick:n[0]||(n[0]=(...i)=>e.handleClose&&e.handleClose(...i))},null,2)):t.createCommentVNode("",!0)])],6),[[t.vShow,e.visible]])]),_:3},8,["onBeforeLeave"])}const it=B(rt,[["render",ct]]),G=new WeakMap,j=e=>{(typeof e=="string"||t.isVNode(e))&&(e={message:e});const n=U(e.renderTo||"body");G.has(n)||G.set(n,[]);const l=G.get(n);let o=e.offset||20;l.forEach(i=>{var c;o+=((c=i.el)==null?void 0:c.offsetHeight)+20});const a=e.onClose;let r={};r={...e,onClose:()=>{var d;const i=l.findIndex(h=>h===m);if(i<0)return;const c=((d=m.el)==null?void 0:d.offsetHeight)+20;l.slice(i+1).forEach(h=>{var N;const p=(N=h.component)==null?void 0:N.props.offset;h.component.props.offset=p-c}),l.splice(i,1),a&&a(m)},onDestroy:()=>{t.render(null,u)},offset:o};const m=t.createVNode(it,r,k(r.message)||t.isVNode(r.message)?{default:k(r.message)?r.message:()=>r.message}:null),u=document.createElement("div");return t.render(m,u),n.tagName==="BODY"?m.el.style.position="fixed":(n.style.position="relative",m.el.style.position="absolute"),n.appendChild(u.firstElementChild),l.push(m),{close:()=>{m.component.proxy.handleClose()}}};(()=>{Ke.forEach(e=>{j[e]=n=>te(n)?j({type:e,...n}):j({message:n,type:e})})})();const dt=["info","success","warning","strong","error"];function fe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const q=b("message-box"),J=e=>{const n=document.createElement("div"),l=()=>{t.render(null,n)},o=c=>{if(c==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(c==="ok")return e.beforeOnOk?e.beforeOnOk():!0},a=(c,d)=>{c==="cancel"&&e.onCancel&&e.onCancel(d),c==="ok"&&e.onOk&&e.onOk(d)},r=c=>{let d;switch(c){case"warning":d=t.createVNode(X,{size:"22px",color:"#f6c64b"},null);break;case"strong":d=t.createVNode(Y,{size:"22px",color:"#ff7125"},null);break;case"error":d=t.createVNode(x,{size:"22px",color:"#e24f48"},null);break;case"success":d=t.createVNode(R,{size:"22px",color:"#68d1ab"},null);break;case"info":d=t.createVNode(K,{size:"22px",color:"#2355f5"},null);break}return t.createVNode("div",{class:q.element("icon")},[d])},f=c=>{if(t.isVNode(c))return c;if(k(c)){const d=c();return t.isVNode(d)?d:null}return t.createVNode("div",{class:q.element("title")},[t.createTextVNode(" "),c,t.createTextVNode(" ")])},s=c=>{if(t.isVNode(c))return c;if(k(c)){const d=c();return t.isVNode(d)?d:null}return t.createVNode("div",{class:q.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},m=()=>()=>t.createVNode(t.Fragment,null,[r(e.type||"success"),e.title&&f(e.title)]),u=()=>()=>t.createVNode(t.Fragment,null,[e.content&&s(e.content)]),y=()=>{if(t.isVNode(e.footer)||k(e.footer))return e.footer;const c=(e==null?void 0:e.cancelText)||"取消",d=(e==null?void 0:e.okText)||"确认";return h=>t.createVNode(ce,{size:12},{default:()=>{var p,N;return[!e.hideCancel&&t.createVNode(S,{size:"small",onClick:h.cancel,loading:(p=h.loadingObj)==null?void 0:p.cancel},fe(c)?c:{default:()=>[c]}),!e.hideOk&&t.createVNode(S,{type:"primary",size:"small",onClick:h.ok,loading:(N=h.loadingObj)==null?void 0:N.ok},fe(d)?d:{default:()=>[d]})]}})},i=t.createVNode(se,{messageBox:!0,width:(e==null?void 0:e.width)??358,height:(e==null?void 0:e.height)??"auto",modelValue:!0,renderTo:e==null?void 0:e.renderTo,center:e!=null&&e.top?!1:(e==null?void 0:e.center)??!0,top:(e==null?void 0:e.top)??0,mask:(e==null?void 0:e.mask)??!0,maskToClose:(e==null?void 0:e.maskToClose)??!0,popupClass:e.popupClass,onClose:a,onBeforeCancel:o,"onUpdate:modelValue":()=>{i.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:m(),default:u(),footer:y()});t.render(i,n)};(()=>{dt.forEach(e=>{J[e]=(n,l)=>{const o=[],a=[];let r=()=>!0,f=()=>!0;return setTimeout(()=>{J({title:n,content:l,type:e,beforeOnCancel:f,beforeOnOk:r,onOk:()=>{o.forEach(s=>k(s)&&s())},onCancel:()=>{a.forEach(s=>k(s)&&s())}})},0),{ok(...s){return s.length===1&&o.push(s[0]),s.length===2&&(r=s[0],o.push(s[1])),this},cancel(...s){return s.length===1&&a.push(s[0]),s.length===2&&(f=s[0],a.push(s[1])),this}}}})})();const ft={position:{type:String,default:"top-right"},offset:{type:Number,default:0},title:{type:String,default:""},type:{type:String,default:"info"},message:{type:String,default:void 0},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!0},onClose:{type:Function,default:()=>{}},renderToBody:{type:Boolean,default:!1}},mt=t.defineComponent({name:O("Notification"),props:ft,emits:["close","destroy"],setup(e){const n=b("notification"),l=n.block,o=t.computed(()=>[l,n.modifier(r.value.ver)]),{zIndex:a}=Z("message",{runOnMounted:!0}),r=t.computed(()=>{const d=e.position.split("-");return{hor:d[1],ver:d[0]}}),f=t.computed(()=>`x-notification-slide-${r.value.hor}`),s=t.computed(()=>{const d={};return d.position=e.renderToBody?"fixed":"absolute",d.zIndex=a.value,d[r.value.hor]="20px",d[r.value.ver]=`${e.offset}px`,d}),m=t.ref(!1);let u=0;const y=()=>{setTimeout(()=>{m.value=!1},e.duration)},i=t.computed(()=>e.type==="info"?K:e.type==="warning"?X:e.type==="strong"?Y:e.type==="success"?R:e.type==="error"?x:""),c=()=>{m.value=!1};return t.onMounted(()=>{e.duration!==0&&y(),m.value=!0}),t.onUnmounted(()=>{clearTimeout(u)}),{ns:l,cn:n,cls:o,animationClsName:f,positionStyle:s,visible:m,positionPropMap:r,currentIcon:i,handleClose:c}}});function ut(e,n,l,o,a,r){return t.openBlock(),t.createBlock(t.Transition,{name:e.animationClsName,onBeforeLeave:n[1]||(n[1]=f=>e.$emit("close")),onAfterLeave:n[2]||(n[2]=f=>e.$emit("destroy"))},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.positionStyle)},[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("header")])},[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("icon"),e.cn.modifier(`icon-${e.type}`)])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.currentIcon)))],2),t.createElementVNode("div",null,[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("title")])},t.toDisplayString(e.title),3),t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("message")])},[t.renderSlot(e.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(e.message),1)])],2)])],2),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("close-icon")]),onClick:n[0]||(n[0]=t.withModifiers((...f)=>e.handleClose&&e.handleClose(...f),["self"]))},null,2)):t.createCommentVNode("",!0)],6),[[t.vShow,e.visible]])]),_:3},8,["name"])}const gt=B(mt,[["render",ut]]),D=new WeakMap,yt=e=>{const n=U(e.renderTo||"body"),l=document.createElement("div");D.get(n)||D.set(n,{}),D.get(n)[e.position]||(D.get(n)[e.position]=[]);const o=D.get(n)[e.position];let a=e.offset||20;o.forEach(y=>{var i;a+=((i=y.el)==null?void 0:i.offsetHeight)+20});const r=n.tagName==="BODY";r||(n.style.position="relative",n.style.overflowX="hidden");const f=e.onClose,s=()=>{var c;const y=o.findIndex(d=>d===u);if(y<0)return;const i=((c=u.el)==null?void 0:c.offsetHeight)+20;o.slice(y+1).forEach(d=>{var p;const h=(p=d.component)==null?void 0:p.props.offset;d.component.props.offset=h-i}),o.splice(y,1),f&&f(u)},m=()=>{t.render(null,l)},u=t.createVNode(gt,{message:e.message,title:e.title,type:e.type,offset:a,renderToBody:r,position:e.position,duration:e.duration??3e3,showClose:e.showClose??!0,onClose:s,onDestroy:m},k(e.message)||t.isVNode(e.message)?{default:k(e.message)?e.message:()=>e.message}:null);t.render(u,l),o.push(u),n==null||n.appendChild(l.firstChild)},me=function(e){Object.keys(H).forEach(n=>{const l=H[n];l.install?e.use(l):e.component(n,H[n])})},Ct={install:me};C.Dialog=Xe,C.Message=j,C.MessageBox=J,C.Notification=yt,C.XButton=S,C.default=Ct,C.install=me,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
1
|
+
(function(C,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(C=typeof globalThis<"u"?globalThis:C||self,t(C.index={},C.Vue))})(this,function(C,t){"use strict";var St=Object.defineProperty;var Et=(C,t,V)=>t in C?St(C,t,{enumerable:!0,configurable:!0,writable:!0,value:V}):C[t]=V;var $=(C,t,V)=>Et(C,typeof t!="symbol"?t+"":t,V);const V="X",he="x",v=e=>e?he+"-"+e:e||"",O=e=>V+e,B=e=>{const n=v(e);return{block:n,element:r=>`${n}--${r}`,modifier:r=>`${n}-${r}`,is:r=>`${n}-is-${r}`}},T=Object.prototype.toString;function ee(e){return T.call(e)==="[object Array]"}function te(e){return T.call(e)==="[object Object]"}const ne=e=>T.call(e)==="[object Promise]";function le(e){return T.call(e)==="[object String]"}function pe(e){return T.call(e)==="[object Number]"&&e===e}function k(e){return typeof e=="function"}function A(){return typeof window<"u"}const z=e=>e,ke=e=>!!(e&&e.shapeFlag&1),Ne=(e,n)=>!!(e&&e.shapeFlag&6),Be=(e,n)=>!!(e&&e.shapeFlag&8),be=(e,n)=>!!(e&&e.shapeFlag&16),we=(e,n)=>!!(e&&e.shapeFlag&32),L=(e,n=!1)=>{var o,a;const l=[];for(const r of e??[])ke(r)||Ne(r)||n&&Be(r,r.children)?l.push(r):be(r,r.children)?l.push(...L(r.children,n)):we(r,r.children)?l.push(...L((a=(o=r.children).default)==null?void 0:a.call(o),n)):ee(r)&&l.push(...L(r,n));return l},Ve=(e,n)=>Object.assign(n,{install:l=>{l.component(e,n)}}),Se={disabled:Boolean,block:Boolean,loading:Boolean,loadingFill:{type:Boolean,default:!1},debounce:{type:Number,default:0},shape:{type:z(String),default:void 0},link:{type:Boolean,default:!1},type:{type:z(String),default:void 0},status:{type:z(String),default:void 0},plain:{type:Boolean,default:!1},size:{type:z(String),default:"medium"},border:{type:Boolean,default:!0}},Ee=t.defineComponent({name:"Backward",render(){return t.createVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createVNode("path",{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",fill:"currentColor"},null)])}}),$e=t.defineComponent({name:O("Button"),props:Se,emits:["click"],setup(e,{slots:n,emit:l}){const o=t.reactive({clicked:!1,isDebounce:!1}),a=B("button"),r=t.computed(()=>[a.block,e.type&&a.modifier(e.type),e.status&&a.modifier(e.status),e.disabled&&a.is("disabled"),e.block&&a.modifier("block"),e.plain&&a.is("plain"),e.shape&&a.modifier(e.shape),e.link&&a.modifier("is-link"),e.size&&a.modifier(e.size),!e.border&&a.modifier("is-hide-border"),s.value&&a.modifier("is-loading")]),f=()=>{e.debounce>0&&!o.isDebounce&&(o.isDebounce=!0,setTimeout(()=>{o.isDebounce=!1},e.debounce))},s=t.computed(()=>e.loading||o.clicked||o.isDebounce),m=t.getCurrentInstance(),u=(i,c)=>{const d=i(c);ne(d)&&(o.clicked=!0,d.finally(()=>{o.clicked=!1}))},y=i=>{var d,h,p,N;if((h=(d=i.target).blur)==null||h.call(d),s.value)return;f();const c=(N=(p=m==null?void 0:m.vnode)==null?void 0:p.props)==null?void 0:N.onClick;ee(c)?c.forEach(Q=>u(Q,i)):k(c)&&u(c,i),l("click",i)};return()=>{var i;return t.createVNode("button",{class:r.value,type:"button",disabled:e.disabled,onClick:y},[s.value&&t.createVNode("span",{class:a.element("loading")},[t.createVNode(Ee,null,null)]),n.prefix&&t.createVNode("span",{class:a.element("prefix")},[n.prefix()]),t.createVNode("span",{class:a.element("content")},[(i=n.default)==null?void 0:i.call(n)]),n.suffix&&t.createVNode("span",{class:a.element("suffix")},[n.suffix()])])}}}),S=Ve("XButton",$e),j=Object.freeze(Object.defineProperty({__proto__:null,XButton:S},Symbol.toStringTag,{value:"Module"})),Oe=["px","%","vh","vw","calc"],oe=(e,n="px")=>{if(e===void 0)return"";const l=String(e);return Oe.some(o=>l.includes(o))?l:l+n},Te=1e3,ze=3e3,Me=1;class De{constructor(){$(this,"popupStack",{popup:new Set,dialog:new Set,message:new Set});$(this,"getNextZIndex",n=>(n==="message"?Array.from(this.popupStack.message).pop()||ze:Array.from(this.popupStack.popup).pop()||Te)+Me);$(this,"add",n=>{const l=this.getNextZIndex(n);return this.popupStack[n].add(l),n==="dialog"&&this.popupStack.popup.add(l),l});$(this,"delete",(n,l)=>{this.popupStack[l].delete(n),l==="dialog"&&this.popupStack.popup.delete(n)});$(this,"isLastDialog",n=>this.popupStack.dialog.size>1?n===Array.from(this.popupStack.dialog).pop():!0)}}const W=new De;function Z(e,{visible:n,runOnMounted:l}={}){const o=t.ref(0),a=()=>{o.value=W.add(e)},r=()=>{W.delete(o.value,e)},f=()=>e==="dialog"?W.isLastDialog(o.value):!1;return t.watch(()=>n==null?void 0:n.value,s=>{s?a():r()},{immediate:!0}),l&&(t.onMounted(()=>{a()}),t.onBeforeUnmount(()=>{r()})),{zIndex:t.readonly(o),open:a,close:r,isLastDialog:f}}const re=e=>e.replace(/^./,n=>n.toLowerCase()).replace(/-(\w)/g,(n,l)=>(l==null?void 0:l.toUpperCase())??""),ae=()=>{},Fe=(e,n)=>{if(A)return(n??document).querySelector(e)??void 0},Ae=e=>{if(e.tagName==="BODY")return window.innerWidth-(document.documentElement.offsetWidth||document.body.offsetWidth);const{borderLeftWidth:n,borderRightWidth:l}=window.getComputedStyle(e),o=Number(n.replace("px",""))+Number(l.replace("px",""));return e.offsetWidth-(e.clientWidth+o)},Le=e=>e.tagName==="BODY"?document.documentElement.scrollHeight>window.innerHeight:e.scrollHeight>e.offsetHeight,je=(e,n)=>{var o;if(!A||!e||!n)return"";let l=re(n);l==="float"&&(l="cssFloat");try{const a=e.style[l];if(a)return a;const r=(o=document.defaultView)==null?void 0:o.getComputedStyle(e,"");return r?r[l]:""}catch{return e.style[l]}},M=(e,n,l)=>{if(!(!e||!n))if(te(n))Object.entries(n).forEach(([o,a])=>M(e,o,a));else{const o=re(n);e.style[o]=l}},U=(e,n)=>{if(le(e)){const l=e[0]==="#"?`[id='${e.slice(1)}']`:e;return Fe(l,n)}return e},Ie=A?(e,n,l,o=!1)=>{e.addEventListener(n,l,o)}:ae,Pe=A?(e,n,l,o=!1)=>{e.removeEventListener(n,l,o)}:ae,He=(e,n)=>{let l=!1;const o={overflow:"",width:""},a=s=>s.tagName==="BODY",r=()=>{if(e.value){const s=e.value;if(!l&&s.style.overflow!=="hidden"){const m=Ae(s);if(m>0||Le(s)){o.overflow=s.style.overflow,o.width=s.style.width;let u=0;a(s)&&(u=s.getBoundingClientRect().left||0),M(s,{width:`calc(100% - ${Math.ceil(m-u)}px)`,overflow:"hidden"}),l=!0}}}},f=()=>{if(e.value&&l){const s=e.value;M(s,{overflow:o.overflow,width:o.width}),l=!1}};return t.watch(()=>n==null?void 0:n.value,s=>{e.value&&!a(e.value)&&(s&&M(s,{position:"absolute"}),je(e.value,"position")==="static"&&M(e.value,{position:"relative"}))}),{setOverflowHidden:r,resetOverflow:f}},We={ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",TAB:"Tab",SPACE:" ",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight"},Ze={renderTo:{type:z([String,Object]),default:"body"},disabled:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1},top:{type:[String,Number],default:"3vh"},center:{type:Boolean,default:!1},width:{type:[String,Number],default:0},height:{type:[String,Number],default:0},minWidth:{type:[String,Number],default:0},minHeight:{type:[String,Number],default:0},title:{type:String,default:""},mask:{type:Boolean,default:!0},destroyOnClosed:{type:Boolean,default:!0},onBeforeCancel:{type:Function},maskToClose:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!0},fullscreen:{type:Boolean,default:!1},messageBox:{type:Boolean,default:!1},popupClass:{type:String,default:void 0},showClose:{type:Boolean,default:!0},showHeaderBottomLine:{type:Boolean,default:!1}},Ue=["width","minWidth","height","minHeight"],xe=t.defineComponent({name:O("Dialog"),inheritAttrs:!1,props:Ze,emits:["closed","close","open","opened","update:modelValue"],setup(e,{emit:n}){const l=B("dialog"),o=l.block,a=B("message-box"),r=a.block,f=t.computed(()=>[o,e.messageBox&&"is-message-box",e.popupClass&&e.popupClass]),s=t.computed(()=>U(e.renderTo)),m=t.ref(),u=t.computed(()=>e.disabled||!s.value),y=t.computed(()=>({zIndex:p.value})),i=t.computed(()=>{const g={};return e.fullscreen||(!e.center&&e.top&&(g.top=oe(e.top)),Ue.forEach(w=>{e[w]&&(g[w]=oe(e[w]))})),g}),c=t.ref(!1),d=t.computed(()=>e.modelValue),h=t.computed(()=>d.value||c.value),{zIndex:p,isLastDialog:N}=Z("dialog",{visible:d}),{setOverflowHidden:Q,resetOverflow:ue}=He(s,m),ge=(g,w)=>{n("update:modelValue",!1),n("close",e.messageBox?g:void 0,e.messageBox?w:void 0)},pt=()=>{c.value=!1,ue(),n("closed")},kt=()=>{n("opened")},P=t.reactive({ok:!1,cancel:!1}),F=(g,w)=>{let H=!0;if(P[g]=!0,k(e.onBeforeCancel)&&(H=e.onBeforeCancel(g)??!1),ne(H)){H.then(Vt=>{P[g]=!1,Vt&&ge(g,w)});return}P[g]=!1,H&&ge(g,w)},Nt=()=>{e.maskToClose&&e.mask&&F("cancel")},Bt=g=>{F("cancel",g)},bt=g=>{F("ok",g)};let _=!1;const ye=g=>{e.escToClose&&g.key===We.ESC&&N()&&F("cancel")},wt=()=>{e.escToClose&&!_&&(_=!0,Ie(document.documentElement,"keydown",ye))},Ce=()=>{_=!1,Pe(document.documentElement,"keydown",ye)};return t.onBeforeUnmount(()=>{ue(),Ce()}),t.watch(()=>d.value,g=>{g?(n("open"),Q(),c.value=!0,wt()):Ce()},{immediate:!0}),{cls:f,ns:o,cn:l,cnOMB:a,messageBoxNs:r,containerStyle:i,dialogStyle:y,dialogRef:m,teleportContainer:s,teleportDisabled:u,modelVisible:d,mergeVisible:h,interceptClose:F,afterLeave:pt,afterEnter:kt,handleMaskClick:Nt,handleCancel:Bt,handleOk:bt,loadingObj:P}}}),b=(e,n)=>{const l=e.__vccOpts||e;for(const[o,a]of n)l[o]=a;return l};function Xe(e,n,l,o,a,r){return t.openBlock(),t.createBlock(t.Teleport,{to:e.teleportContainer,disabled:e.teleportDisabled},[!e.destroyOnClosed||e.mergeVisible?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,ref:"dialogRef",class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.dialogStyle)},[t.createVNode(t.Transition,{name:"x-fade-in-standard",appear:""},{default:t.withCtx(()=>[e.mask?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([e.cn.element("mask")])},null,2)),[[t.vShow,e.modelVisible]]):t.createCommentVNode("",!0)]),_:1}),t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("wrapper"),{"is-center":e.center}]),onClick:n[1]||(n[1]=t.withModifiers((...f)=>e.handleMaskClick&&e.handleMaskClick(...f),["self"]))},[t.createVNode(t.Transition,{name:"x-zoom-in",appear:"",onAfterEnter:e.afterEnter,onAfterLeave:e.afterLeave},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("container"),{"is-fullscreen":e.fullscreen}]),style:t.normalizeStyle(e.containerStyle)},[t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("header"):e.cn.element("header"),e.showHeaderBottomLine&&"is-bottom-line"])},[t.renderSlot(e.$slots,"title",{},()=>[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("header-title")])},t.toDisplayString(e.title),3)])],2),t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("body"):e.cn.element("body")])},[t.renderSlot(e.$slots,"default")],2),t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("footer"):e.cn.element("footer")])},[t.renderSlot(e.$slots,"footer",{cancel:e.handleCancel,ok:e.handleOk,loadingObj:e.loadingObj})],2),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("close-icon"),e.messageBox&&e.cnOMB.element("close-icon")]),onClick:n[0]||(n[0]=f=>e.interceptClose("cancel"))},null,2)):t.createCommentVNode("",!0)],6),[[t.vShow,e.modelVisible]])]),_:3},8,["onAfterEnter","onAfterLeave"])],2)],6)),[[t.vShow,e.mergeVisible]]):t.createCommentVNode("",!0)],8,["to","disabled"])}const se=b(xe,[["render",Xe]]),ce=t.defineComponent({name:O("Space"),props:{direction:{type:String,default:"horizontal"},size:{type:[Number,String],default:"small"},align:{type:String,default:"center"},fill:{type:Boolean,default:!1}},setup(e,{slots:n}){const l=B("space"),o=t.computed(()=>[l.block,l.element(e.direction),e.fill&&"is-fill",l.element(`${e.direction}-${e.align}`)]);function a(f){if(pe(f))return f;switch(f){case"mini":return 4;case"small":return 8;case"medium":return 16;case"large":return 24;default:return 8}}const r=f=>{const s={};if(f)return s;const m=`${a(e.size)}px`,u=`${a(e.size)}px`;return e.direction==="horizontal"&&(s.marginRight=m),e.direction==="vertical"&&(s.marginBottom=u),s};return()=>{var s;const f=L((s=n.default)==null?void 0:s.call(n),!0).filter(m=>m.type!==t.Comment);return t.createVNode("div",{class:[o.value]},[f.map((m,u)=>{var i;const y=n.split&&u>0;return t.createVNode(t.Fragment,{key:`space-item-${u}`},[y&&t.createVNode("div",{className:l.element("split"),style:r(!1)},[(i=n.split)==null?void 0:i.call(n)]),t.createVNode("div",{className:l.element("item"),style:r(u===f.length-1)},[m])])})])}}});function ie(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const de=B("dialog"),Re=e=>{const n=document.createElement("div"),l=()=>{t.render(null,n)},o=i=>{if(i==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(i==="ok")return e.beforeOnOk?e.beforeOnOk():!0},a=(i,c)=>{i==="cancel"&&e.onCancel&&e.onCancel(c),i==="ok"&&e.onOk&&e.onOk(c)},r=i=>{if(t.isVNode(i))return i;if(k(i)){const c=i();return t.isVNode(c)?c:null}return t.createVNode("div",{class:de.element("header-title")},[t.createTextVNode(" "),i,t.createTextVNode(" ")])},f=i=>{if(t.isVNode(i))return i;if(k(i)){const c=i();return t.isVNode(c)?c:null}return t.createVNode("div",{class:de.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},s=()=>()=>t.createVNode(t.Fragment,null,[e.title&&r(e.title)]),m=()=>()=>t.createVNode(t.Fragment,null,[e.content&&f(e.content)]),u=()=>{if(t.isVNode(e.footer)||k(e.footer))return e.footer;const i=(e==null?void 0:e.cancelText)||"取消",c=(e==null?void 0:e.okText)||"确认";return d=>t.createVNode(ce,{size:12},{default:()=>{var h,p;return[!e.hideCancel&&t.createVNode(S,{size:"small",onClick:d.cancel,loading:(h=d.loadingObj)==null?void 0:h.cancel},ie(i)?i:{default:()=>[i]}),!e.hideOk&&t.createVNode(S,{type:"primary",size:"small",onClick:d.ok,loading:(p=d.loadingObj)==null?void 0:p.ok},ie(c)?c:{default:()=>[c]})]}})},y=t.createVNode(se,{width:(e==null?void 0:e.width)??368,height:(e==null?void 0:e.height)??"auto",modelValue:!0,renderTo:e==null?void 0:e.renderTo,center:e!=null&&e.top?!1:(e==null?void 0:e.center)??!0,top:(e==null?void 0:e.top)??0,mask:(e==null?void 0:e.mask)??!0,maskToClose:(e==null?void 0:e.maskToClose)??!0,popupClass:e.popupClass,onClose:a,onBeforeCancel:o,"onUpdate:modelValue":()=>{y.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:s(),default:m(),footer:u()});t.render(y,n)},Ke=["success","warning","error","strong","info"],Ye=e=>le(e)?e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(""):"",Ge=(e,n="px")=>{if(e===void 0)return"";const l=typeof e=="number"?`${e}`:e;return["px","%","vh","vw","calc"].some(a=>l.includes(a))?l:l+n};function E(e){return t.defineComponent({name:v(`Icon${Ye(e)}`),props:{size:{type:[Number,String],default:void 0},rotate:{type:Number,default:void 0},spin:{type:Boolean,default:!1},color:{type:String,default:void 0},fillColor:{type:Array,default:void 0}},setup(n){const l="x-icon",o=t.computed(()=>{const r={};return n.size&&(r.fontSize=Ge(n.size)),n.rotate&&(r.transform=`rotate(${n.rotate}deg)`),n.color&&(r.color=n.color),r});return{cls:t.computed(()=>[l,{[`${l}-loading`]:n.spin}]),styles:o}}})}const qe=E("close-circle-fill");function Je(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm4.955-27.771-4.95 4.95-4.95-4.95a1 1 0 0 0-1.414 0l-1.414 1.414a1 1 0 0 0 0 1.414l4.95 4.95-4.95 4.95a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0l4.95-4.95 4.95 4.95a1 1 0 0 0 1.414 0l1.414-1.414a1 1 0 0 0 0-1.414l-4.95-4.95 4.95-4.95a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const x=b(qe,[["render",Je]]),Qe=E("check-circle-fill");function _e(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm10.207-24.379a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0L22 26.172l-4.878-4.88a1 1 0 0 0-1.415 0l-1.414 1.415a1 1 0 0 0 0 1.414l7 7a1 1 0 0 0 1.414 0l11.5-11.5Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const X=b(Qe,[["render",_e]]),ve=E("exclamation-circle-fill");function et(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-2-11a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2Zm4-18a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V15Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const R=b(ve,[["render",et]]),tt=E("info-circle-fill");function nt(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const K=b(tt,[["render",nt]]),lt=E("minus-circle-fill");function ot(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-7-22a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1H17Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const Y=b(lt,[["render",ot]]);E("animation-loading");const rt=t.defineComponent({name:O("Message"),components:{CloseCircleFill:x,CheckCircleFill:X,ExclamationCircleFill:R,InfoCircleFill:K,MinusCircleFill:Y},props:{id:{type:String,default:""},message:{type:[String,Number,Object],default:""},type:{type:String,default:"success"},duration:{type:Number,default:1500},center:{type:Boolean,default:!1},onClose:{type:Function,default:()=>{}},offset:{type:Number,default:20},zIndex:{type:Number,default:0},showClose:{type:Boolean,default:!1},useHTML:Boolean,popupClass:{type:String,default:void 0}},emits:["destroy"],setup(e){const n=B("message"),l=t.computed(()=>[n.block,n.modifier(e.type),e.center&&n.modifier("center"),e.showClose&&!e.center&&n.element("show-close"),e.popupClass&&e.popupClass]),o=t.ref(!1);let a=null;const r=()=>{a=setTimeout(()=>{o.value=!1},e.duration)};t.onMounted(()=>{o.value=!0,e.duration!==0&&r()}),t.onUnmounted(()=>{clearTimeout(a)});const{zIndex:f}=Z("message",{runOnMounted:!0}),s=t.computed(()=>({top:`${e.offset}px`,zIndex:f.value}));return{cn:n,cls:l,styles:s,visible:o,handleClose:()=>{o.value=!1}}}}),at=["innerHTML"],st={key:1};function ct(e,n,l,o,a,r){const f=t.resolveComponent("CheckCircleFill"),s=t.resolveComponent("ExclamationCircleFill"),m=t.resolveComponent("MinusCircleFill"),u=t.resolveComponent("CloseCircleFill"),y=t.resolveComponent("InfoCircleFill");return t.openBlock(),t.createBlock(t.Transition,{name:"x-message-slide-top",onBeforeLeave:e.onClose,onAfterLeave:n[1]||(n[1]=i=>e.$emit("destroy"))},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},[e.$slots.icon?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("icon"),e.cn.modifier(`icon-${e.type}`)])},[t.renderSlot(e.$slots,"icon",{},()=>[e.type==="success"?(t.openBlock(),t.createBlock(f,{key:0})):e.type==="warning"?(t.openBlock(),t.createBlock(s,{key:1})):e.type==="strong"?(t.openBlock(),t.createBlock(m,{key:2})):e.type==="error"?(t.openBlock(),t.createBlock(u,{key:3})):e.type==="info"?(t.openBlock(),t.createBlock(y,{key:4})):t.createCommentVNode("",!0)])],2)),t.renderSlot(e.$slots,"default",{},()=>[e.useHTML?(t.openBlock(),t.createElementBlock("span",{key:0,innerHTML:e.message},null,8,at)):(t.openBlock(),t.createElementBlock("span",st,t.toDisplayString(e.message),1)),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:2,class:t.normalizeClass([e.cn.element("close-icon")]),onClick:n[0]||(n[0]=(...i)=>e.handleClose&&e.handleClose(...i))},null,2)):t.createCommentVNode("",!0)])],6),[[t.vShow,e.visible]])]),_:3},8,["onBeforeLeave"])}const it=b(rt,[["render",ct]]),G=new WeakMap,I=e=>{(typeof e=="string"||t.isVNode(e))&&(e={message:e});const n=U(e.renderTo||"body");G.has(n)||G.set(n,[]);const l=G.get(n);let o=e.offset||20;l.forEach(i=>{var c;o+=((c=i.el)==null?void 0:c.offsetHeight)+20});const a=e.onClose;let r={};r={...e,onClose:()=>{var d;const i=l.findIndex(h=>h===m);if(i<0)return;const c=((d=m.el)==null?void 0:d.offsetHeight)+20;l.slice(i+1).forEach(h=>{var N;const p=(N=h.component)==null?void 0:N.props.offset;h.component.props.offset=p-c}),l.splice(i,1),a&&a(m)},onDestroy:()=>{t.render(null,u)},offset:o};const m=t.createVNode(it,r,k(r.message)||t.isVNode(r.message)?{default:k(r.message)?r.message:()=>r.message}:null),u=document.createElement("div");return t.render(m,u),n.tagName==="BODY"?m.el.style.position="fixed":(n.style.position="relative",m.el.style.position="absolute"),n.appendChild(u.firstElementChild),l.push(m),{close:()=>{m.component.proxy.handleClose()}}};(()=>{Ke.forEach(e=>{I[e]=n=>te(n)?I({type:e,...n}):I({message:n,type:e})})})();const dt=["info","success","warning","strong","error"];function fe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const q=B("message-box"),J=e=>{const n=document.createElement("div"),l=()=>{t.render(null,n)},o=c=>{if(c==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(c==="ok")return e.beforeOnOk?e.beforeOnOk():!0},a=(c,d)=>{c==="cancel"&&e.onCancel&&e.onCancel(d),c==="ok"&&e.onOk&&e.onOk(d)},r=c=>{let d;switch(c){case"warning":d=t.createVNode(R,{size:"22px",color:"#f6c64b"},null);break;case"strong":d=t.createVNode(Y,{size:"22px",color:"#ff7125"},null);break;case"error":d=t.createVNode(x,{size:"22px",color:"#e24f48"},null);break;case"success":d=t.createVNode(X,{size:"22px",color:"#68d1ab"},null);break;case"info":d=t.createVNode(K,{size:"22px",color:"#2355f5"},null);break}return t.createVNode("div",{class:q.element("icon")},[d])},f=c=>{if(t.isVNode(c))return c;if(k(c)){const d=c();return t.isVNode(d)?d:null}return t.createVNode("div",{class:q.element("title")},[t.createTextVNode(" "),c,t.createTextVNode(" ")])},s=c=>{if(t.isVNode(c))return c;if(k(c)){const d=c();return t.isVNode(d)?d:null}return t.createVNode("div",{class:q.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},m=()=>()=>t.createVNode(t.Fragment,null,[r(e.type||"success"),e.title&&f(e.title)]),u=()=>()=>t.createVNode(t.Fragment,null,[e.content&&s(e.content)]),y=()=>{if(t.isVNode(e.footer)||k(e.footer))return e.footer;const c=(e==null?void 0:e.cancelText)||"取消",d=(e==null?void 0:e.okText)||"确认";return h=>t.createVNode(ce,{size:12},{default:()=>{var p,N;return[!e.hideCancel&&t.createVNode(S,{size:"small",onClick:h.cancel,loading:(p=h.loadingObj)==null?void 0:p.cancel},fe(c)?c:{default:()=>[c]}),!e.hideOk&&t.createVNode(S,{type:"primary",size:"small",onClick:h.ok,loading:(N=h.loadingObj)==null?void 0:N.ok},fe(d)?d:{default:()=>[d]})]}})},i=t.createVNode(se,{messageBox:!0,width:(e==null?void 0:e.width)??358,height:(e==null?void 0:e.height)??"auto",modelValue:!0,renderTo:e==null?void 0:e.renderTo,center:e!=null&&e.top?!1:(e==null?void 0:e.center)??!0,top:(e==null?void 0:e.top)??0,mask:(e==null?void 0:e.mask)??!0,maskToClose:(e==null?void 0:e.maskToClose)??!0,popupClass:e.popupClass,onClose:a,onBeforeCancel:o,"onUpdate:modelValue":()=>{i.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:m(),default:u(),footer:y()});t.render(i,n)};(()=>{dt.forEach(e=>{J[e]=(n,l)=>{const o=[],a=[];let r=()=>!0,f=()=>!0;return setTimeout(()=>{J({title:n,content:l,type:e,beforeOnCancel:f,beforeOnOk:r,onOk:()=>{o.forEach(s=>k(s)&&s())},onCancel:()=>{a.forEach(s=>k(s)&&s())}})},0),{ok(...s){return s.length===1&&o.push(s[0]),s.length===2&&(r=s[0],o.push(s[1])),this},cancel(...s){return s.length===1&&a.push(s[0]),s.length===2&&(f=s[0],a.push(s[1])),this}}}})})();const ft={position:{type:String,default:"top-right"},offset:{type:Number,default:0},title:{type:String,default:""},type:{type:String,default:"info"},message:{type:String,default:void 0},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!0},onClose:{type:Function,default:()=>{}},renderToBody:{type:Boolean,default:!1}},mt=t.defineComponent({name:O("Notification"),props:ft,emits:["close","destroy"],setup(e){const n=B("notification"),l=n.block,o=t.computed(()=>[l,n.modifier(r.value.ver)]),{zIndex:a}=Z("message",{runOnMounted:!0}),r=t.computed(()=>{const d=e.position.split("-");return{hor:d[1],ver:d[0]}}),f=t.computed(()=>`x-notification-slide-${r.value.hor}`),s=t.computed(()=>{const d={};return d.position=e.renderToBody?"fixed":"absolute",d.zIndex=a.value,d[r.value.hor]="20px",d[r.value.ver]=`${e.offset}px`,d}),m=t.ref(!1);let u=0;const y=()=>{setTimeout(()=>{m.value=!1},e.duration)},i=t.computed(()=>e.type==="info"?K:e.type==="warning"?R:e.type==="strong"?Y:e.type==="success"?X:e.type==="error"?x:""),c=()=>{m.value=!1};return t.onMounted(()=>{e.duration!==0&&y(),m.value=!0}),t.onUnmounted(()=>{clearTimeout(u)}),{ns:l,cn:n,cls:o,animationClsName:f,positionStyle:s,visible:m,positionPropMap:r,currentIcon:i,handleClose:c}}});function ut(e,n,l,o,a,r){return t.openBlock(),t.createBlock(t.Transition,{name:e.animationClsName,onBeforeLeave:n[1]||(n[1]=f=>e.$emit("close")),onAfterLeave:n[2]||(n[2]=f=>e.$emit("destroy"))},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.positionStyle)},[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("header")])},[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("icon"),e.cn.modifier(`icon-${e.type}`)])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.currentIcon)))],2),t.createElementVNode("div",null,[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("title")])},t.toDisplayString(e.title),3),t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("message")])},[t.renderSlot(e.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(e.message),1)])],2)])],2),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("close-icon")]),onClick:n[0]||(n[0]=t.withModifiers((...f)=>e.handleClose&&e.handleClose(...f),["self"]))},null,2)):t.createCommentVNode("",!0)],6),[[t.vShow,e.visible]])]),_:3},8,["name"])}const gt=b(mt,[["render",ut]]),D=new WeakMap,yt=e=>{const n=U(e.renderTo||"body"),l=document.createElement("div");D.get(n)||D.set(n,{}),D.get(n)[e.position]||(D.get(n)[e.position]=[]);const o=D.get(n)[e.position];let a=e.offset||20;o.forEach(y=>{var i;a+=((i=y.el)==null?void 0:i.offsetHeight)+20});const r=n.tagName==="BODY";r||(n.style.position="relative",n.style.overflowX="hidden");const f=e.onClose,s=()=>{var c;const y=o.findIndex(d=>d===u);if(y<0)return;const i=((c=u.el)==null?void 0:c.offsetHeight)+20;o.slice(y+1).forEach(d=>{var p;const h=(p=d.component)==null?void 0:p.props.offset;d.component.props.offset=h-i}),o.splice(y,1),f&&f(u)},m=()=>{t.render(null,l)},u=t.createVNode(gt,{message:e.message,title:e.title,type:e.type,offset:a,renderToBody:r,position:e.position,duration:e.duration??3e3,showClose:e.showClose??!0,onClose:s,onDestroy:m},k(e.message)||t.isVNode(e.message)?{default:k(e.message)?e.message:()=>e.message}:null);t.render(u,l),o.push(u),n==null||n.appendChild(l.firstChild)},me=function(e){Object.keys(j).forEach(n=>{const l=j[n];l.install?e.use(l):e.component(n,j[n])})},{XButton:Ct}=j,ht={XButton:Ct,install:me};C.Dialog=Re,C.Message=I,C.MessageBox=J,C.Notification=yt,C.XButton=S,C.default=ht,C.install=me,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|