@xto/feedback 1.2.3 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Message/index.d.ts +2 -1
- package/es/MessageBox/index.d.ts +2 -1
- package/es/Notification/index.d.ts +2 -1
- package/es/index.d.ts +13 -6
- package/es/index.mjs +87 -87
- package/lib/index.cjs +1 -1
- package/package.json +1 -1
package/es/Message/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { App } from 'vue';
|
|
|
2
2
|
import { default as MessageService } from './message';
|
|
3
3
|
export type { MessageType, MessageProps, MessageInstance, MessageOptions, MessageReturnType } from './types';
|
|
4
4
|
export type { Message as MessageFn } from './types';
|
|
5
|
-
|
|
5
|
+
declare const Message: import('./types').Message;
|
|
6
|
+
export { Message };
|
|
6
7
|
export default MessageService;
|
|
7
8
|
export declare const MessageComponent: {
|
|
8
9
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./types').MessageProps> & Readonly<{
|
package/es/MessageBox/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { App } from 'vue';
|
|
|
2
2
|
import { default as MessageBoxService } from './messageBox';
|
|
3
3
|
export type { MessageBoxMessageType, MessageBoxOptions, MessageBoxResult, MessageBoxFn } from './types';
|
|
4
4
|
export type { MessageBox as MessageBoxType } from './types';
|
|
5
|
-
|
|
5
|
+
declare const MessageBox: import('./types').MessageBox;
|
|
6
|
+
export { MessageBox };
|
|
6
7
|
export default MessageBoxService;
|
|
7
8
|
export declare const TMessageBox: {
|
|
8
9
|
install(app: App): void;
|
|
@@ -3,7 +3,8 @@ import { default as NotificationService } from './notification';
|
|
|
3
3
|
export type { NotificationPosition, NotificationOptions, NotificationInstance, NotificationFn } from './types';
|
|
4
4
|
export type { NotificationType } from './types';
|
|
5
5
|
export type { Notification as NotificationInterface } from './types';
|
|
6
|
-
|
|
6
|
+
declare const Notification: import('./types').Notification;
|
|
7
|
+
export { Notification };
|
|
7
8
|
export default NotificationService;
|
|
8
9
|
export declare const TNotification: {
|
|
9
10
|
install(app: App): void;
|
package/es/index.d.ts
CHANGED
|
@@ -7,9 +7,13 @@ export { default as Popconfirm } from './Popconfirm/index.vue';
|
|
|
7
7
|
export { default as Backtop } from './Backtop/index.vue';
|
|
8
8
|
export { default as Result } from './Result/index.vue';
|
|
9
9
|
export { Timeline, TimelineItem } from './Timeline';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
declare const Message: import('./Message').MessageFn;
|
|
11
|
+
declare const MessageBox: import('./MessageBox').MessageBoxType;
|
|
12
|
+
declare const Notification: import('./Notification').NotificationInterface;
|
|
13
|
+
export { Message, MessageBox, Notification };
|
|
14
|
+
export { MessageComponent, TMessage } from './Message';
|
|
15
|
+
export { TMessageBox } from './MessageBox';
|
|
16
|
+
export { TNotification } from './Notification';
|
|
13
17
|
export type { ModalProps, ModalEmits } from './Modal';
|
|
14
18
|
export type { DrawerProps } from './Drawer';
|
|
15
19
|
export type { FormField, DrawerFormProps, DrawerFormEmits } from './DrawerForm';
|
|
@@ -18,6 +22,9 @@ export type { TooltipProps } from './Tooltip';
|
|
|
18
22
|
export type { PopconfirmProps, PopconfirmPlacement, PopconfirmInstance } from './Popconfirm';
|
|
19
23
|
export type { BacktopProps, BacktopEmits } from './Backtop';
|
|
20
24
|
export type { ResultProps } from './Result';
|
|
21
|
-
export type { MessageProps, MessageOptions, MessageInstance, MessageFn
|
|
22
|
-
export type {
|
|
23
|
-
export type {
|
|
25
|
+
export type { MessageProps, MessageOptions, MessageInstance, MessageFn } from './Message/types';
|
|
26
|
+
export type { Message as MessageType } from './Message/types';
|
|
27
|
+
export type { MessageBoxOptions, MessageBoxResult, MessageBoxFn } from './MessageBox/types';
|
|
28
|
+
export type { MessageBox as MessageBoxType } from './MessageBox/types';
|
|
29
|
+
export type { NotificationOptions, NotificationInstance, NotificationFn, NotificationPosition } from './Notification/types';
|
|
30
|
+
export type { Notification as NotificationType } from './Notification/types';
|
package/es/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as R, computed as B, openBlock as u, createElementBlock as f, normalizeStyle as P, normalizeClass as s, createElementVNode as z, renderSlot as H, createTextVNode as S, toDisplayString as $, ref as I, watch as ae, resolveComponent as ze, createBlock as Z, Teleport as oe, createVNode as E, Transition as K, withCtx as D, unref as o, withModifiers as re, createCommentVNode as C, withDirectives as ce, vShow as ue, Fragment as
|
|
2
|
-
import { useNamespace as
|
|
1
|
+
import { defineComponent as R, computed as B, openBlock as u, createElementBlock as f, normalizeStyle as P, normalizeClass as s, createElementVNode as z, renderSlot as H, createTextVNode as S, toDisplayString as $, ref as I, watch as ae, resolveComponent as ze, createBlock as Z, Teleport as oe, createVNode as E, Transition as K, withCtx as D, unref as o, withModifiers as re, createCommentVNode as C, withDirectives as ce, vShow as ue, Fragment as ge, renderList as be, nextTick as te, onUnmounted as de, onMounted as ye, reactive as Ce, createApp as Me, h as k } from "vue";
|
|
2
|
+
import { useNamespace as N, useZIndex as Ve, useEscape as Le, nextMessageZIndex as He } from "@xto/core";
|
|
3
3
|
const we = {
|
|
4
4
|
// 箭头类
|
|
5
5
|
"arrow-up": "M12 19V5m0 0l-7 7m7-7l7 7",
|
|
@@ -215,7 +215,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
215
215
|
strokeWidth: { default: 2 }
|
|
216
216
|
},
|
|
217
217
|
setup(e, { expose: n }) {
|
|
218
|
-
const t = e, r =
|
|
218
|
+
const t = e, r = N("icon"), a = B(() => typeof t.size == "number" ? `${t.size}px` : t.size), i = B(() => ({
|
|
219
219
|
width: a.value,
|
|
220
220
|
height: a.value,
|
|
221
221
|
color: t.color
|
|
@@ -253,7 +253,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
253
253
|
])
|
|
254
254
|
], 14, Be));
|
|
255
255
|
}
|
|
256
|
-
}),
|
|
256
|
+
}), dt = /* @__PURE__ */ R({
|
|
257
257
|
name: "XModal",
|
|
258
258
|
inheritAttrs: !1,
|
|
259
259
|
__name: "index",
|
|
@@ -272,7 +272,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
272
272
|
},
|
|
273
273
|
emits: ["update:modelValue", "update:open", "close", "open", "ok", "cancel"],
|
|
274
274
|
setup(e, { emit: n }) {
|
|
275
|
-
const t = e, r = n, a =
|
|
275
|
+
const t = e, r = n, a = N("modal"), { next: i } = Ve(), m = I(i()), g = B({
|
|
276
276
|
get: () => t.modelValue !== void 0 ? t.modelValue : t.open !== void 0 ? t.open : !1,
|
|
277
277
|
set: (h) => {
|
|
278
278
|
t.modelValue !== void 0 && r("update:modelValue", h), t.open !== void 0 && r("update:open", h), t.modelValue === void 0 && t.open === void 0 && r("update:modelValue", h);
|
|
@@ -377,7 +377,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
377
377
|
]);
|
|
378
378
|
};
|
|
379
379
|
}
|
|
380
|
-
}),
|
|
380
|
+
}), mt = /* @__PURE__ */ R({
|
|
381
381
|
name: "XDrawer",
|
|
382
382
|
inheritAttrs: !1,
|
|
383
383
|
__name: "index",
|
|
@@ -396,7 +396,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
396
396
|
},
|
|
397
397
|
emits: ["update:modelValue", "close", "open"],
|
|
398
398
|
setup(e, { emit: n }) {
|
|
399
|
-
const t = e, r = n, a =
|
|
399
|
+
const t = e, r = n, a = N("drawer"), i = I(2e3), m = () => {
|
|
400
400
|
r("update:modelValue", !1), r("close");
|
|
401
401
|
}, g = () => {
|
|
402
402
|
t.closeOnClickModal && m();
|
|
@@ -476,7 +476,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
476
476
|
}), Ee = {
|
|
477
477
|
key: 0,
|
|
478
478
|
class: "required-mark"
|
|
479
|
-
}, Ae = ["value", "placeholder", "disabled", "onInput"], Pe = ["value", "placeholder", "disabled", "onInput"], Se = ["value", "placeholder", "disabled", "onInput"], Re = ["value", "disabled", "onChange"], Oe = ["value"], We = ["disabled", "onClick"],
|
|
479
|
+
}, Ae = ["value", "placeholder", "disabled", "onInput"], Pe = ["value", "placeholder", "disabled", "onInput"], Se = ["value", "placeholder", "disabled", "onInput"], Re = ["value", "disabled", "onChange"], Oe = ["value"], We = ["disabled", "onClick"], ht = /* @__PURE__ */ R({
|
|
480
480
|
name: "XDrawerForm",
|
|
481
481
|
__name: "index",
|
|
482
482
|
props: {
|
|
@@ -494,7 +494,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
494
494
|
},
|
|
495
495
|
emits: ["update:modelValue", "confirm", "cancel", "close", "field-change"],
|
|
496
496
|
setup(e, { emit: n }) {
|
|
497
|
-
const t = e, r = n, a =
|
|
497
|
+
const t = e, r = n, a = N("drawer-form"), i = I({}), m = I({});
|
|
498
498
|
B(() => [
|
|
499
499
|
a.b()
|
|
500
500
|
]), ae(() => t.formData, (M) => {
|
|
@@ -562,7 +562,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
562
562
|
key: 0,
|
|
563
563
|
class: s(o(a).e("form"))
|
|
564
564
|
}, [
|
|
565
|
-
(u(!0), f(
|
|
565
|
+
(u(!0), f(ge, null, be(e.fields, (l) => (u(), f("div", {
|
|
566
566
|
key: l.name,
|
|
567
567
|
class: s(o(a).e("field"))
|
|
568
568
|
}, [
|
|
@@ -602,7 +602,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
602
602
|
disabled: e.disabled || l.disabled,
|
|
603
603
|
onChange: (b) => w(l.name, b.target.value)
|
|
604
604
|
}, [
|
|
605
|
-
(u(!0), f(
|
|
605
|
+
(u(!0), f(ge, null, be(l.options, (b) => (u(), f("option", {
|
|
606
606
|
key: b.value,
|
|
607
607
|
value: b.value
|
|
608
608
|
}, $(b.label), 9, Oe))), 128))
|
|
@@ -646,7 +646,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
646
646
|
})
|
|
647
647
|
]));
|
|
648
648
|
}
|
|
649
|
-
}),
|
|
649
|
+
}), ft = /* @__PURE__ */ R({
|
|
650
650
|
name: "XAlert",
|
|
651
651
|
__name: "index",
|
|
652
652
|
props: {
|
|
@@ -659,7 +659,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
659
659
|
},
|
|
660
660
|
emits: ["close"],
|
|
661
661
|
setup(e, { emit: n }) {
|
|
662
|
-
const t = e, r = n, a =
|
|
662
|
+
const t = e, r = n, a = N("alert"), i = I(!0), m = {
|
|
663
663
|
success: "check",
|
|
664
664
|
warning: "warning",
|
|
665
665
|
error: "close-circle",
|
|
@@ -722,7 +722,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
722
722
|
_: 3
|
|
723
723
|
}));
|
|
724
724
|
}
|
|
725
|
-
}),
|
|
725
|
+
}), vt = /* @__PURE__ */ R({
|
|
726
726
|
name: "XTooltip",
|
|
727
727
|
__name: "index",
|
|
728
728
|
props: {
|
|
@@ -739,35 +739,35 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
739
739
|
},
|
|
740
740
|
emits: ["update:visible", "show", "hide"],
|
|
741
741
|
setup(e, { emit: n }) {
|
|
742
|
-
const t = e, r = n, a =
|
|
742
|
+
const t = e, r = n, a = N("tooltip"), i = I(!1), m = I(), g = I();
|
|
743
743
|
let v, c;
|
|
744
744
|
const x = I({}), p = () => {
|
|
745
745
|
if (!m.value || !g.value) return;
|
|
746
746
|
const L = m.value.getBoundingClientRect(), F = g.value;
|
|
747
747
|
F.style.visibility = "hidden", F.style.display = "block";
|
|
748
|
-
const
|
|
749
|
-
let O = 0, W = 0,
|
|
748
|
+
const j = F.offsetWidth, U = F.offsetHeight, q = t.offset, he = window.innerWidth, fe = window.innerHeight;
|
|
749
|
+
let O = 0, W = 0, J = t.placement;
|
|
750
750
|
switch (t.placement) {
|
|
751
751
|
case "top":
|
|
752
|
-
O = L.top - U - q, W = L.left + (L.width -
|
|
752
|
+
O = L.top - U - q, W = L.left + (L.width - j) / 2;
|
|
753
753
|
break;
|
|
754
754
|
case "bottom":
|
|
755
|
-
O = L.bottom + q, W = L.left + (L.width -
|
|
755
|
+
O = L.bottom + q, W = L.left + (L.width - j) / 2;
|
|
756
756
|
break;
|
|
757
757
|
case "left":
|
|
758
|
-
O = L.top + (L.height - U) / 2, W = L.left -
|
|
758
|
+
O = L.top + (L.height - U) / 2, W = L.left - j - q;
|
|
759
759
|
break;
|
|
760
760
|
case "right":
|
|
761
761
|
O = L.top + (L.height - U) / 2, W = L.right + q;
|
|
762
762
|
break;
|
|
763
763
|
}
|
|
764
|
-
t.placement === "top" && O < 0 ? (
|
|
764
|
+
t.placement === "top" && O < 0 ? (J = "bottom", O = L.bottom + q) : t.placement === "bottom" && O + U > fe ? (J = "top", O = L.top - U - q) : t.placement === "left" && W < 0 ? (J = "right", W = L.right + q) : t.placement === "right" && W + j > he && (J = "left", W = L.left - j - q), W < 8 && (W = 8), W + j > he - 8 && (W = he - j - 8), O < 8 && (O = 8), O + U > fe - 8 && (O = fe - U - 8), x.value = {
|
|
765
765
|
position: "fixed",
|
|
766
766
|
top: `${O}px`,
|
|
767
767
|
left: `${W}px`,
|
|
768
768
|
visibility: "visible",
|
|
769
769
|
zIndex: "2000"
|
|
770
|
-
}, w.value =
|
|
770
|
+
}, w.value = J;
|
|
771
771
|
}, w = I(t.placement), M = () => {
|
|
772
772
|
t.disabled || (clearTimeout(c), v = setTimeout(() => {
|
|
773
773
|
i.value = !0, r("update:visible", !0), r("show"), te(() => {
|
|
@@ -791,8 +791,8 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
791
791
|
}, A = () => {
|
|
792
792
|
t.trigger === "focus" && h();
|
|
793
793
|
}, T = (L) => {
|
|
794
|
-
var F,
|
|
795
|
-
t.trigger === "click" && !((F = m.value) != null && F.contains(L.target)) && !((
|
|
794
|
+
var F, j;
|
|
795
|
+
t.trigger === "click" && !((F = m.value) != null && F.contains(L.target)) && !((j = g.value) != null && j.contains(L.target)) && h();
|
|
796
796
|
}, V = () => {
|
|
797
797
|
i.value && p();
|
|
798
798
|
};
|
|
@@ -854,7 +854,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
854
854
|
]))
|
|
855
855
|
], 2));
|
|
856
856
|
}
|
|
857
|
-
}),
|
|
857
|
+
}), Ne = { class: "x-popconfirm-wrapper" }, je = { class: "x-popconfirm__main" }, De = { class: "x-popconfirm__title" }, Xe = { class: "x-popconfirm__action" }, pt = /* @__PURE__ */ R({
|
|
858
858
|
name: "XPopconfirm",
|
|
859
859
|
__name: "index",
|
|
860
860
|
props: {
|
|
@@ -974,7 +974,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
974
974
|
}
|
|
975
975
|
return y;
|
|
976
976
|
});
|
|
977
|
-
return (d, y) => (u(), f("span",
|
|
977
|
+
return (d, y) => (u(), f("span", Ne, [
|
|
978
978
|
z("span", {
|
|
979
979
|
ref_key: "triggerRef",
|
|
980
980
|
ref: i,
|
|
@@ -1000,7 +1000,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1000
1000
|
class: "x-popconfirm__arrow",
|
|
1001
1001
|
style: P(b.value)
|
|
1002
1002
|
}, null, 4)) : C("", !0),
|
|
1003
|
-
z("div",
|
|
1003
|
+
z("div", je, [
|
|
1004
1004
|
e.hideIcon ? C("", !0) : (u(), f("span", {
|
|
1005
1005
|
key: 0,
|
|
1006
1006
|
class: "x-popconfirm__icon",
|
|
@@ -1035,7 +1035,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1035
1035
|
]))
|
|
1036
1036
|
]));
|
|
1037
1037
|
}
|
|
1038
|
-
}),
|
|
1038
|
+
}), Mt = /* @__PURE__ */ R({
|
|
1039
1039
|
name: "XBacktop",
|
|
1040
1040
|
__name: "index",
|
|
1041
1041
|
props: {
|
|
@@ -1045,7 +1045,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1045
1045
|
},
|
|
1046
1046
|
emits: ["click"],
|
|
1047
1047
|
setup(e, { emit: n }) {
|
|
1048
|
-
const t = e, r = n, a =
|
|
1048
|
+
const t = e, r = n, a = N("backtop"), i = I(!1), m = () => {
|
|
1049
1049
|
const c = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
1050
1050
|
i.value = c >= t.visibilityHeight;
|
|
1051
1051
|
}, g = (c) => {
|
|
@@ -1085,7 +1085,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1085
1085
|
_: 3
|
|
1086
1086
|
}));
|
|
1087
1087
|
}
|
|
1088
|
-
}),
|
|
1088
|
+
}), gt = /* @__PURE__ */ R({
|
|
1089
1089
|
name: "XResult",
|
|
1090
1090
|
__name: "index",
|
|
1091
1091
|
props: {
|
|
@@ -1095,7 +1095,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1095
1095
|
icon: {}
|
|
1096
1096
|
},
|
|
1097
1097
|
setup(e) {
|
|
1098
|
-
const n = e, t =
|
|
1098
|
+
const n = e, t = N("result"), r = B(() => n.icon ? n.icon : {
|
|
1099
1099
|
success: "check-circle",
|
|
1100
1100
|
warning: "warning",
|
|
1101
1101
|
error: "close-circle",
|
|
@@ -1144,18 +1144,18 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1144
1144
|
], 2)) : C("", !0)
|
|
1145
1145
|
], 2));
|
|
1146
1146
|
}
|
|
1147
|
-
}),
|
|
1147
|
+
}), bt = /* @__PURE__ */ R({
|
|
1148
1148
|
name: "XTimeline",
|
|
1149
1149
|
__name: "index",
|
|
1150
1150
|
setup(e) {
|
|
1151
|
-
const n =
|
|
1151
|
+
const n = N("timeline");
|
|
1152
1152
|
return (t, r) => (u(), f("ul", {
|
|
1153
1153
|
class: s(o(n).b())
|
|
1154
1154
|
}, [
|
|
1155
1155
|
H(t.$slots, "default")
|
|
1156
1156
|
], 2));
|
|
1157
1157
|
}
|
|
1158
|
-
}),
|
|
1158
|
+
}), yt = /* @__PURE__ */ R({
|
|
1159
1159
|
name: "XTimelineItem",
|
|
1160
1160
|
__name: "TimelineItem",
|
|
1161
1161
|
props: {
|
|
@@ -1168,7 +1168,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1168
1168
|
hollow: { type: Boolean, default: !1 }
|
|
1169
1169
|
},
|
|
1170
1170
|
setup(e) {
|
|
1171
|
-
const n =
|
|
1171
|
+
const n = N("timeline-item");
|
|
1172
1172
|
return (t, r) => (u(), f("li", {
|
|
1173
1173
|
class: s([o(n).b(), o(n).m(e.placement)])
|
|
1174
1174
|
}, [
|
|
@@ -1220,7 +1220,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1220
1220
|
},
|
|
1221
1221
|
emits: ["close", "destroy"],
|
|
1222
1222
|
setup(e, { expose: n, emit: t }) {
|
|
1223
|
-
const r = e, a = t, i =
|
|
1223
|
+
const r = e, a = t, i = N("message"), m = I(!1), g = I(He()), v = {
|
|
1224
1224
|
success: "check",
|
|
1225
1225
|
warning: "warning",
|
|
1226
1226
|
error: "close-circle",
|
|
@@ -1336,7 +1336,7 @@ function xe(e) {
|
|
|
1336
1336
|
l > 0 && (v = setTimeout(x, l));
|
|
1337
1337
|
}, w = () => {
|
|
1338
1338
|
v && (clearTimeout(v), v = null);
|
|
1339
|
-
}, M =
|
|
1339
|
+
}, M = Me({
|
|
1340
1340
|
render() {
|
|
1341
1341
|
if (!m.visible) return null;
|
|
1342
1342
|
const l = [
|
|
@@ -1443,19 +1443,19 @@ function xe(e) {
|
|
|
1443
1443
|
function Ke(e) {
|
|
1444
1444
|
return xe(typeof e == "string" ? { message: e } : e);
|
|
1445
1445
|
}
|
|
1446
|
-
const se = (e) => (n) => xe({ ...typeof n == "string" ? { message: n } : n, type: e }),
|
|
1446
|
+
const se = (e) => (n) => xe({ ...typeof n == "string" ? { message: n } : n, type: e }), ve = Object.assign(Ke, {
|
|
1447
1447
|
info: se("info"),
|
|
1448
1448
|
success: se("success"),
|
|
1449
1449
|
warning: se("warning"),
|
|
1450
1450
|
error: se("error"),
|
|
1451
1451
|
closeAll: Ze
|
|
1452
|
-
}),
|
|
1452
|
+
}), Ue = ve, wt = Fe, xt = {
|
|
1453
1453
|
install(e) {
|
|
1454
|
-
e.config.globalProperties.$message =
|
|
1454
|
+
e.config.globalProperties.$message = ve, e.provide("message", ve);
|
|
1455
1455
|
}
|
|
1456
|
-
}, _ = [],
|
|
1456
|
+
}, _ = [], Ye = () => {
|
|
1457
1457
|
_.slice().forEach((e) => e.close());
|
|
1458
|
-
},
|
|
1458
|
+
}, Ge = {
|
|
1459
1459
|
success: { iconPath: "M5 13l4 4L19 7", color: "#67c23a" },
|
|
1460
1460
|
warning: { iconPath: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z", color: "#e6a23c" },
|
|
1461
1461
|
error: { iconPath: "M6 18L18 6M6 6l12 12", color: "#f56c6c" },
|
|
@@ -1510,7 +1510,7 @@ function me(e) {
|
|
|
1510
1510
|
},
|
|
1511
1511
|
render() {
|
|
1512
1512
|
if (!this.visible) return null;
|
|
1513
|
-
const g = e.type, v = g ?
|
|
1513
|
+
const g = e.type, v = g ? Ge[g] : null, c = [];
|
|
1514
1514
|
v && c.push(
|
|
1515
1515
|
k("span", {
|
|
1516
1516
|
class: "x-message-box__icon",
|
|
@@ -1643,7 +1643,7 @@ function me(e) {
|
|
|
1643
1643
|
])
|
|
1644
1644
|
]);
|
|
1645
1645
|
}
|
|
1646
|
-
}), i =
|
|
1646
|
+
}), i = Me(a);
|
|
1647
1647
|
i.mount(t);
|
|
1648
1648
|
const m = {
|
|
1649
1649
|
app: i,
|
|
@@ -1657,7 +1657,7 @@ function me(e) {
|
|
|
1657
1657
|
_.push(m);
|
|
1658
1658
|
});
|
|
1659
1659
|
}
|
|
1660
|
-
async function
|
|
1660
|
+
async function Je(e, n, t) {
|
|
1661
1661
|
return me({
|
|
1662
1662
|
message: e,
|
|
1663
1663
|
title: n,
|
|
@@ -1666,7 +1666,7 @@ async function Ge(e, n, t) {
|
|
|
1666
1666
|
showCancelButton: !1
|
|
1667
1667
|
});
|
|
1668
1668
|
}
|
|
1669
|
-
async function
|
|
1669
|
+
async function Qe(e, n, t) {
|
|
1670
1670
|
return me({
|
|
1671
1671
|
message: e,
|
|
1672
1672
|
title: n,
|
|
@@ -1675,7 +1675,7 @@ async function Je(e, n, t) {
|
|
|
1675
1675
|
showCancelButton: !0
|
|
1676
1676
|
});
|
|
1677
1677
|
}
|
|
1678
|
-
async function
|
|
1678
|
+
async function _e(e, n, t) {
|
|
1679
1679
|
return me({
|
|
1680
1680
|
message: e,
|
|
1681
1681
|
title: n,
|
|
@@ -1685,28 +1685,28 @@ async function Qe(e, n, t) {
|
|
|
1685
1685
|
showCancelButton: !0
|
|
1686
1686
|
});
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1688
|
+
function et(e) {
|
|
1689
1689
|
return me(e);
|
|
1690
1690
|
}
|
|
1691
|
-
const
|
|
1692
|
-
alert:
|
|
1693
|
-
confirm:
|
|
1694
|
-
prompt:
|
|
1695
|
-
closeAll:
|
|
1696
|
-
}),
|
|
1691
|
+
const G = Object.assign(et, {
|
|
1692
|
+
alert: Je,
|
|
1693
|
+
confirm: Qe,
|
|
1694
|
+
prompt: _e,
|
|
1695
|
+
closeAll: Ye
|
|
1696
|
+
}), tt = G, kt = {
|
|
1697
1697
|
install(e) {
|
|
1698
|
-
e.config.globalProperties.$msgbox =
|
|
1698
|
+
e.config.globalProperties.$msgbox = G, e.config.globalProperties.$alert = G.alert, e.config.globalProperties.$confirm = G.confirm, e.config.globalProperties.$prompt = G.prompt, e.provide("messageBox", G);
|
|
1699
1699
|
}
|
|
1700
1700
|
}, ee = [];
|
|
1701
|
-
let
|
|
1702
|
-
const
|
|
1701
|
+
let at = 1;
|
|
1702
|
+
const ot = () => {
|
|
1703
1703
|
ee.slice().forEach((e) => e.close());
|
|
1704
|
-
},
|
|
1704
|
+
}, lt = {
|
|
1705
1705
|
success: { iconPath: "M5 13l4 4L19 7", color: "#67c23a" },
|
|
1706
1706
|
warning: { iconPath: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z", color: "#e6a23c" },
|
|
1707
1707
|
error: { iconPath: "M6 18L18 6M6 6l12 12", color: "#f56c6c" },
|
|
1708
1708
|
info: { iconPath: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z", color: "#909399" }
|
|
1709
|
-
},
|
|
1709
|
+
}, nt = (e, n) => {
|
|
1710
1710
|
const t = ee.filter((a) => a.position === e);
|
|
1711
1711
|
let r = 16;
|
|
1712
1712
|
for (const a of t)
|
|
@@ -1715,7 +1715,7 @@ const tt = () => {
|
|
|
1715
1715
|
i && (r += i.offsetHeight + 16);
|
|
1716
1716
|
}
|
|
1717
1717
|
return r;
|
|
1718
|
-
},
|
|
1718
|
+
}, st = (e, n) => {
|
|
1719
1719
|
const t = {
|
|
1720
1720
|
position: "fixed",
|
|
1721
1721
|
width: "330px",
|
|
@@ -1740,7 +1740,7 @@ const tt = () => {
|
|
|
1740
1740
|
return t;
|
|
1741
1741
|
};
|
|
1742
1742
|
function ke(e) {
|
|
1743
|
-
const n =
|
|
1743
|
+
const n = at++, t = e.position || "top-right", r = document.createElement("div");
|
|
1744
1744
|
document.body.appendChild(r);
|
|
1745
1745
|
let a = null, i = !1;
|
|
1746
1746
|
const m = R({
|
|
@@ -1762,7 +1762,7 @@ function ke(e) {
|
|
|
1762
1762
|
l > 0 && (a = setTimeout(x, l));
|
|
1763
1763
|
}, w = () => {
|
|
1764
1764
|
a && (clearTimeout(a), a = null);
|
|
1765
|
-
}, M = B(() => (e.offset ?? 0) +
|
|
1765
|
+
}, M = B(() => (e.offset ?? 0) + nt(t, n)), h = B(() => st(t, M.value));
|
|
1766
1766
|
return te(() => {
|
|
1767
1767
|
c.value = !0, p();
|
|
1768
1768
|
}), {
|
|
@@ -1775,7 +1775,7 @@ function ke(e) {
|
|
|
1775
1775
|
},
|
|
1776
1776
|
render() {
|
|
1777
1777
|
if (!this.visible) return null;
|
|
1778
|
-
const c = e.type, x = c ?
|
|
1778
|
+
const c = e.type, x = c ? lt[c] : null, p = [];
|
|
1779
1779
|
e.title && p.push(
|
|
1780
1780
|
k("div", {
|
|
1781
1781
|
class: "x-notification__title",
|
|
@@ -1892,7 +1892,7 @@ function ke(e) {
|
|
|
1892
1892
|
onMouseleave: this.startTimer
|
|
1893
1893
|
}, w);
|
|
1894
1894
|
}
|
|
1895
|
-
}), g =
|
|
1895
|
+
}), g = Me(m);
|
|
1896
1896
|
g.mount(r);
|
|
1897
1897
|
const v = {
|
|
1898
1898
|
id: n,
|
|
@@ -1907,36 +1907,36 @@ function ke(e) {
|
|
|
1907
1907
|
};
|
|
1908
1908
|
return ee.push(v), { close: v.close };
|
|
1909
1909
|
}
|
|
1910
|
-
function
|
|
1910
|
+
function it(e) {
|
|
1911
1911
|
return ke(typeof e == "string" ? { message: e } : e);
|
|
1912
1912
|
}
|
|
1913
|
-
const ie = (e) => (n) => ke({ ...typeof n == "string" ? { message: n } : n, type: e }),
|
|
1913
|
+
const ie = (e) => (n) => ke({ ...typeof n == "string" ? { message: n } : n, type: e }), pe = Object.assign(it, {
|
|
1914
1914
|
info: ie("info"),
|
|
1915
1915
|
success: ie("success"),
|
|
1916
1916
|
warning: ie("warning"),
|
|
1917
1917
|
error: ie("error"),
|
|
1918
|
-
closeAll:
|
|
1919
|
-
}),
|
|
1918
|
+
closeAll: ot
|
|
1919
|
+
}), rt = pe, zt = {
|
|
1920
1920
|
install(e) {
|
|
1921
|
-
e.config.globalProperties.$notify =
|
|
1921
|
+
e.config.globalProperties.$notify = pe, e.provide("notification", pe);
|
|
1922
1922
|
}
|
|
1923
|
-
};
|
|
1923
|
+
}, Ct = Ue, Vt = tt, Lt = rt;
|
|
1924
1924
|
export {
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1925
|
+
ft as Alert,
|
|
1926
|
+
Mt as Backtop,
|
|
1927
|
+
mt as Drawer,
|
|
1928
|
+
ht as DrawerForm,
|
|
1929
|
+
Ct as Message,
|
|
1930
|
+
Vt as MessageBox,
|
|
1931
|
+
wt as MessageComponent,
|
|
1932
|
+
dt as Modal,
|
|
1933
|
+
Lt as Notification,
|
|
1934
|
+
pt as Popconfirm,
|
|
1935
|
+
gt as Result,
|
|
1936
|
+
xt as TMessage,
|
|
1937
|
+
kt as TMessageBox,
|
|
1938
|
+
zt as TNotification,
|
|
1939
|
+
bt as Timeline,
|
|
1940
|
+
yt as TimelineItem,
|
|
1941
|
+
vt as Tooltip
|
|
1942
1942
|
};
|
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),x=require("@xto/core"),Z={"arrow-up":"M12 19V5m0 0l-7 7m7-7l7 7","arrow-down":"M12 5v14m0 0l7-7m-7 7l-7-7","arrow-left":"M19 12H5m0 0l7 7m-7-7l7-7","arrow-right":"M5 12h14m0 0l-7-7m7 7l-7 7","arrow-up-bold":"M12 5l-7 7h4v7h6v-7h4l-7-7z","arrow-down-bold":"M12 19l7-7h-4V5H9v7H5l7 7z","arrow-left-bold":"M5 12l7-7v4h7v6h-7v4l-7-7z","arrow-right-bold":"M19 12l-7 7v-4H5v-6h7V5l7 7z","caret-down":"M6 9l6 6 6-6","caret-right":"M9 18l6-6-6-6",plus:"M12 5v14m-7-7h14",minus:"M5 12h14",close:"M6 18L18 6M6 6l12 12",check:"M5 13l4 4L19 7","check-bold":"M4 12l5 5L20 6",edit:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z",delete:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",copy:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",download:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",upload:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",refresh:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15",search:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",filter:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z",more:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z","more-h":"M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z",setting:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",share:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z",loading:"M12 2v4m0 12v4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83M2 12h4m12 0h4M4.93 19.07l2.83-2.83m8.48-8.48l2.83-2.83",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",question:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",user:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z","user-add":"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z","user-group":"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",logout:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1",login:"M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1",file:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",folder:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z","folder-open":"M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z",document:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",image:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",video:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z",music:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3",camera:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z M15 13a3 3 0 11-6 0 3 3 0 016 0z",mail:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",phone:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",chat:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",bell:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",message:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z",eye:"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z","eye-off":"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21",calendar:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",clock:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",history:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",timer:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",location:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z M15 11a3 3 0 11-6 0 3 3 0 016 0z",map:"M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7",globe:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9",star:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",heart:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z","thumb-up":"M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5",link:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1","external-link":"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",lock:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z",unlock:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z",key:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z",home:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",menu:"M4 6h16M4 12h16M4 18h16","menu-fold":"M4 6h16M4 12h10M4 18h16","menu-unfold":"M4 6h16M10 12h10M4 18h16","menu-collapse":"M4 6h16M4 12h10M4 18h16","menu-expand":"M4 6h16M10 12h10M4 18h16","sidebar-fold":"M11 19l-7-7 7-7m8 14l-7-7 7-7","sidebar-expand":"M13 5l7 7-7 7M5 5l7 7-7 7","sidebar-left":"M11 19l-7-7 7-7m8 14l-7-7 7-7",dashboard:"M4 5a1 1 0 011-1h4a1 1 0 011 1v5a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM14 5a1 1 0 011-1h4a1 1 0 011 1v2a1 1 0 01-1 1h-4a1 1 0 01-1-1V5zM4 15a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1v-4zM14 12a1 1 0 011-1h4a1 1 0 011 1v7a1 1 0 01-1 1h-4a1 1 0 01-1-1v-7z",chart:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z","chart-pie":"M11 3.055A9.001 9.001 0 1020.945 13H11V3.055z M20.488 9H15V3.512A9.025 9.025 0 0120.488 9z","chart-line":"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4v16",report:"M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",analytics:"M16 8v8m-4-5v5m-4-2v2m-2 4h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",system:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M12 15a3 3 0 100-6 3 3 0 000 6z",permission:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",role:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z","user-manage":"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z",log:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",notification:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",app:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z",list:"M4 6h16M4 10h16M4 14h16M4 18h16",grid:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z",fullscreen:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4","fullscreen-exit":"M9 4V9H4m11-5v5h5M4 15h5v5m11-5h-5v5","zoom-in":"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v6m3-3H7","zoom-out":"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM13 10H7",print:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z",bookmark:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z",tag:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z",code:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4",terminal:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",database:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4",server:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01",cloud:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z",gift:"M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7",moon:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z",sun:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z",theme:"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01",skin:"M7 4h2v1c0 1.66 1.34 3 3 3s3-1.34 3-3V4h2l3 3v6h-4l1 3v5H7v-5l1-3H4V7l3-3z",heading:"M4 6h16M4 12h8m-8 6h16",bold:"M6 4h8a4 4 0 014 4 4 4 0 01-4 4H6z M6 12h9a4 4 0 014 4 4 4 0 01-4 4H6z",italic:"M10 4h4m-2 0v16m-4 0h8",strikethrough:"M16 4H8a4 4 0 00-4 4v4h16V8a4 4 0 00-4-4zM4 12h16m-4 4H8a4 4 0 00-4 4v0a4 4 0 004 4h8a4 4 0 004-4v0a4 4 0 00-4-4z","list-bullet":"M4 6h.01M4 12h.01M4 18h.01M8 6h12M8 12h12M8 18h12","list-number":"M4 6h2M4 12h2M4 18h2M8 6h12M8 12h12M8 18h12","link-text":"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1","image-insert":"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z","code-inline":"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4","divider-h":"M4 12h16",quote:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z","code-block":"M4 4h16v16H4z M8 8h8M8 12h8M8 16h4","sort-up":"M12 5v14m-7-7l7-7 7 7","sort-down":"M12 19V5m7 7l-7 7-7-7","chevron-down":"M6 9l6 6 6-6","chevron-right":"M9 18l6-6-6-6","chevron-up":"M18 15l-6-6-6 6","chevron-left":"M15 18l-6-6 6-6","move-up":"M5 15l7-7 7 7","move-down":"M19 9l-7 7-7-7","back-top":"M12 19V5m-7 7l7-7 7 7","dropdown-arrow":"M6 9l6 6 6-6","close-circle":"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z","close-bold":"M6 18L18 6M6 6l12 12","check-circle":"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z","info-circle":"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z","warning-circle":"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z","back-arrow":"M19 12H5m0 0l7 7m-7-7l7-7","d-arrow-left":"M11 17l-5-5 5-5M18 17l-5-5 5-5","d-arrow-right":"M6 7l5 5-5 5M13 7l5 5-5 5",left:"M15 19l-7-7 7-7",right:"M9 5l7 7-7 7",down:"M19 9l-7 7-7-7",up:"M5 15l7-7 7 7"};function G(t){return t in Z}const J=["aria-hidden","aria-label"],Q=["stroke-width"],_=["d"],E=e.defineComponent({name:"XIcon",__name:"index",props:{name:{},size:{default:24},color:{},spin:{type:Boolean,default:!1},strokeWidth:{default:2}},setup(t,{expose:n}){const o=t,r=x.useNamespace("icon"),a=e.computed(()=>typeof o.size=="number"?`${o.size}px`:o.size),s=e.computed(()=>({width:a.value,height:a.value,color:o.color})),m=e.computed(()=>({strokeWidth:o.strokeWidth})),p=e.computed(()=>[r.b(),r.is("spin",o.spin)]),u=e.computed(()=>o.name&&G(o.name)?Z[o.name]:"");return n({iconSize:a,iconStyle:s,iconPath:u}),(i,k)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(p.value),style:e.normalizeStyle(s.value),"aria-hidden":!t.name,"aria-label":t.name,role:"img"},[u.value?(e.openBlock(),e.createElementBlock("svg",{key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",style:e.normalizeStyle(m.value),"aria-hidden":"true"},[e.createElementVNode("path",{d:u.value},null,8,_)],12,Q)):e.renderSlot(i.$slots,"default",{key:1},()=>[e.createTextVNode(e.toDisplayString(t.name),1)])],14,J))}}),ee=e.defineComponent({name:"XModal",inheritAttrs:!1,__name:"index",props:{modelValue:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},title:{default:""},width:{default:"50%"},top:{default:"15vh"},modal:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},center:{type:Boolean,default:!1},destroyOnClose:{type:Boolean,default:!1}},emits:["update:modelValue","update:open","close","open","ok","cancel"],setup(t,{emit:n}){const o=t,r=n,a=x.useNamespace("modal"),{next:s}=x.useZIndex(),m=e.ref(s()),p=e.computed({get:()=>o.modelValue!==void 0?o.modelValue:o.open!==void 0?o.open:!1,set:d=>{o.modelValue!==void 0&&r("update:modelValue",d),o.open!==void 0&&r("update:open",d),o.modelValue===void 0&&o.open===void 0&&r("update:modelValue",d)}}),u=e.ref(),i=()=>{p.value=!1,r("cancel"),r("close")},k=()=>{r("ok")},h=()=>{o.closeOnClickModal&&o.modal&&i()};x.useEscape(()=>{o.closeOnPressEscape&&p.value&&i()}),e.watch(()=>[o.modelValue,o.open],([d,l])=>{(d!==void 0?d:l)&&(m.value=s(),r("open"))},{immediate:!0});const M=e.computed(()=>({paddingTop:o.top})),f=e.computed(()=>({width:typeof o.width=="number"?`${o.width}px`:o.width,zIndex:m.value}));return(d,l)=>{const v=e.resolveComponent("x-button");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"x-modal-fade"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(a).e("wrapper")),style:e.normalizeStyle(M.value),onClick:h},[e.createElementVNode("div",{ref_key:"modalRef",ref:u,class:e.normalizeClass(e.unref(a).b()),style:e.normalizeStyle(f.value),onClick:l[0]||(l[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("header"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(a).e("title"))},[e.renderSlot(d.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],2),t.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(e.unref(a).e("close")),onClick:i},[e.createVNode(e.unref(E),{name:"close",size:16})],2)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("body"))},[e.renderSlot(d.$slots,"default")],2),d.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(a).e("footer"))},[e.renderSlot(d.$slots,"footer",{ok:k,cancel:i})],2)):d.$slots.footer?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(a).e("footer"))},[e.createVNode(v,{onClick:i},{default:e.withCtx(()=>[...l[1]||(l[1]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(v,{type:"primary",style:{"margin-left":"8px"},onClick:k},{default:e.withCtx(()=>[...l[2]||(l[2]=[e.createTextVNode("确定",-1)])]),_:1})],2))],6)],6)):e.createCommentVNode("",!0)]),_:3})])}}}),te=e.defineComponent({name:"XDrawer",inheritAttrs:!1,__name:"index",props:{modelValue:{type:Boolean,default:!1},title:{default:""},placement:{default:void 0},direction:{default:"rtl"},width:{default:void 0},size:{default:"30%"},withHeader:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!1},modal:{type:Boolean,default:!0}},emits:["update:modelValue","close","open"],setup(t,{emit:n}){const o=t,r=n,a=x.useNamespace("drawer"),s=e.ref(2e3),m=()=>{r("update:modelValue",!1),r("close")},p=()=>{o.closeOnClickModal&&m()},u=h=>{h.key==="Escape"&&o.modelValue&&m()};e.watch(()=>o.modelValue,h=>{h?(s.value=2e3+Math.floor(Math.random()*100),r("open"),document.addEventListener("keydown",u)):document.removeEventListener("keydown",u)});const i=e.computed(()=>({zIndex:s.value})),k=e.computed(()=>{const h=o.direction??o.placement??"rtl",M=o.size??o.width??"30%",f=typeof M=="number"?`${M}px`:M;return{ltr:{width:f,height:"100%"},rtl:{width:f,height:"100%"},ttb:{width:"100%",height:f},btt:{width:"100%",height:f}}[h]});return(h,M)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"x-drawer-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(a).e("overlay"),{[e.unref(a).em("overlay","no-modal")]:!t.modal}]),style:e.normalizeStyle(i.value),onClick:p},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(a).b(),e.unref(a).m(t.direction??t.placement??"rtl")]),style:e.normalizeStyle(k.value),onClick:M[0]||(M[0]=e.withModifiers(()=>{},["stop"]))},[t.withHeader?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(a).e("header"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(a).e("title"))},[e.renderSlot(h.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],2),t.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(e.unref(a).e("close")),onClick:m},[e.createVNode(e.unref(E),{name:"close",size:18})],2)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(a).e("body"),h.$slots.footer&&e.unref(a).em("body","has-footer")])},[e.renderSlot(h.$slots,"default")],2),h.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(a).e("footer"))},[e.renderSlot(h.$slots,"footer")],2)):e.createCommentVNode("",!0)],6)],6),[[e.vShow,t.modelValue]])]),_:3})]))}}),oe={key:0,class:"required-mark"},ae=["value","placeholder","disabled","onInput"],le=["value","placeholder","disabled","onInput"],ne=["value","placeholder","disabled","onInput"],se=["value","disabled","onChange"],re=["value"],ie=["disabled","onClick"],ce=e.defineComponent({name:"XDrawerForm",__name:"index",props:{modelValue:{type:Boolean,default:!1},title:{default:"配置"},size:{default:"400px"},fields:{default:()=>[]},formData:{default:()=>({})},showConfirm:{type:Boolean,default:!0},showCancel:{type:Boolean,default:!0},confirmText:{default:"确认"},cancelText:{default:"取消"},disabled:{type:Boolean,default:!1},destroyOnClose:{type:Boolean,default:!1}},emits:["update:modelValue","confirm","cancel","close","field-change"],setup(t,{emit:n}){const o=t,r=n,a=x.useNamespace("drawer-form"),s=e.ref({}),m=e.ref({});e.computed(()=>[a.b()]),e.watch(()=>o.formData,f=>{s.value={...f}},{immediate:!0,deep:!0});const p=e.computed(()=>typeof o.size=="number"?`${o.size}px`:o.size),u=()=>{r("update:modelValue",!1),r("close")},i=()=>{r("cancel"),u()},k=()=>{h()&&(r("confirm",s.value),u())},h=()=>{m.value={};for(const f of o.fields){if(f.required){const d=s.value[f.name];if(d==null||d===""){m.value[f.name]=`${f.label}为必填项`;continue}}if(f.rules)for(const d of f.rules){const l=s.value[f.name];d.type==="email"&&l&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l)&&(m.value[f.name]=d.message),d.type==="minLength"&&l&&l.length<d.min&&(m.value[f.name]=d.message)}}return Object.keys(m.value).length===0},M=(f,d)=>{s.value[f]=d,r("field-change",f,d)};return(f,d)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"drawer-form-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("overlay")),onClick:u},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).b()),style:e.normalizeStyle({width:p.value}),onClick:d[0]||(d[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("header"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(a).e("title"))},e.toDisplayString(t.title),3),e.createElementVNode("button",{class:e.normalizeClass(e.unref(a).e("close")),onClick:u},[e.createVNode(e.unref(E),{name:"close",size:16})],2)],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("body"))},[!t.destroyOnClose||t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(a).e("form"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,l=>(e.openBlock(),e.createElementBlock("div",{key:l.name,class:e.normalizeClass(e.unref(a).e("field"))},[e.createElementVNode("label",{class:e.normalizeClass(e.unref(a).e("label"))},[e.createTextVNode(e.toDisplayString(l.label)+" ",1),l.required?(e.openBlock(),e.createElementBlock("span",oe,"*")):e.createCommentVNode("",!0)],2),l.type==="input"?(e.openBlock(),e.createElementBlock("input",{key:0,class:e.normalizeClass([e.unref(a).e("input"),{"has-error":m.value[l.name]}]),value:s.value[l.name],placeholder:l.placeholder,disabled:t.disabled||l.disabled,onInput:v=>M(l.name,v.target.value)},null,42,ae)):l.type==="textarea"?(e.openBlock(),e.createElementBlock("textarea",{key:1,class:e.normalizeClass([e.unref(a).e("textarea"),{"has-error":m.value[l.name]}]),value:s.value[l.name],placeholder:l.placeholder,disabled:t.disabled||l.disabled,rows:"4",onInput:v=>M(l.name,v.target.value)},null,42,le)):l.type==="number"?(e.openBlock(),e.createElementBlock("input",{key:2,type:"number",class:e.normalizeClass([e.unref(a).e("input"),{"has-error":m.value[l.name]}]),value:s.value[l.name],placeholder:l.placeholder,disabled:t.disabled||l.disabled,onInput:v=>M(l.name,Number(v.target.value))},null,42,ne)):l.type==="select"?(e.openBlock(),e.createElementBlock("select",{key:3,class:e.normalizeClass([e.unref(a).e("select"),{"has-error":m.value[l.name]}]),value:s.value[l.name],disabled:t.disabled||l.disabled,onChange:v=>M(l.name,v.target.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,v=>(e.openBlock(),e.createElementBlock("option",{key:v.value,value:v.value},e.toDisplayString(v.label),9,re))),128))],42,se)):l.type==="switch"?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(e.unref(a).e("switch"))},[e.createElementVNode("button",{class:e.normalizeClass(["switch-btn",{"is-on":s.value[l.name]}]),disabled:t.disabled||l.disabled,onClick:v=>M(l.name,!s.value[l.name])},e.toDisplayString(s.value[l.name]?"开启":"关闭"),11,ie)],2)):e.createCommentVNode("",!0),m.value[l.name]?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(e.unref(a).e("error"))},e.toDisplayString(m.value[l.name]),3)):e.createCommentVNode("",!0)],2))),128))],2)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("footer"))},[t.showCancel?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(e.unref(a).e("cancel")),onClick:i},e.toDisplayString(t.cancelText),3)):e.createCommentVNode("",!0),t.showConfirm?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(e.unref(a).e("confirm")),onClick:k},e.toDisplayString(t.confirmText),3)):e.createCommentVNode("",!0)],2)],6)],2),[[e.vShow,t.modelValue]])]),_:1})]))}}),me=e.defineComponent({name:"XAlert",__name:"index",props:{type:{default:"info"},title:{default:""},description:{},closable:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!1},center:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:n}){const o=t,r=n,a=x.useNamespace("alert"),s=e.ref(!0),m={success:"check",warning:"warning",error:"close-circle",info:"info"},p=e.computed(()=>[a.b(),a.m(o.type),a.is("center",o.center),a.is("with-description",!!o.description)]),u=i=>{s.value=!1,r("close",i)};return(i,k)=>(e.openBlock(),e.createBlock(e.Transition,{name:"x-alert-fade"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(p.value)},[t.showIcon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(a).e("icon"))},[e.createVNode(e.unref(E),{name:m[t.type],size:16},null,8,["name"])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("content"))},[t.title||i.$slots.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(a).e("title"))},[e.renderSlot(i.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],2)):e.createCommentVNode("",!0),t.description||i.$slots.default?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(a).e("description"))},[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.description),1)])],2)):e.createCommentVNode("",!0)],2),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(e.unref(a).e("close")),onClick:u},[e.createVNode(e.unref(E),{name:"close",size:14})],2)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:3}))}}),de=e.defineComponent({name:"XTooltip",__name:"index",props:{content:{default:""},placement:{default:"top"},effect:{default:"dark"},disabled:{type:Boolean,default:!1},offset:{default:8},transition:{default:"fade"},visibleArrow:{type:Boolean,default:!0},trigger:{default:"hover"},openDelay:{default:0},closeDelay:{default:0}},emits:["update:visible","show","hide"],setup(t,{emit:n}){const o=t,r=n,a=x.useNamespace("tooltip"),s=e.ref(!1),m=e.ref(),p=e.ref();let u,i;const k=e.ref({}),h=()=>{if(!m.value||!p.value)return;const C=m.value.getBoundingClientRect(),N=p.value;N.style.visibility="hidden",N.style.display="block";const V=N.offsetWidth,S=N.offsetHeight,T=o.offset,X=window.innerWidth,F=window.innerHeight;let z=0,B=0,$=o.placement;switch(o.placement){case"top":z=C.top-S-T,B=C.left+(C.width-V)/2;break;case"bottom":z=C.bottom+T,B=C.left+(C.width-V)/2;break;case"left":z=C.top+(C.height-S)/2,B=C.left-V-T;break;case"right":z=C.top+(C.height-S)/2,B=C.right+T;break}o.placement==="top"&&z<0?($="bottom",z=C.bottom+T):o.placement==="bottom"&&z+S>F?($="top",z=C.top-S-T):o.placement==="left"&&B<0?($="right",B=C.right+T):o.placement==="right"&&B+V>X&&($="left",B=C.left-V-T),B<8&&(B=8),B+V>X-8&&(B=X-V-8),z<8&&(z=8),z+S>F-8&&(z=F-S-8),k.value={position:"fixed",top:`${z}px`,left:`${B}px`,visibility:"visible",zIndex:"2000"},M.value=$},M=e.ref(o.placement),f=()=>{o.disabled||(clearTimeout(i),u=setTimeout(()=>{s.value=!0,r("update:visible",!0),r("show"),e.nextTick(()=>{h()})},o.openDelay))},d=()=>{clearTimeout(u),i=setTimeout(()=>{s.value=!1,r("update:visible",!1),r("hide")},o.closeDelay)},l=()=>{s.value?d():f()},v=()=>{o.trigger==="hover"&&f()},c=()=>{o.trigger==="hover"&&d()},g=()=>{o.trigger==="click"&&l()},L=()=>{o.trigger==="focus"&&f()},w=()=>{o.trigger==="focus"&&d()},b=C=>{var N,V;o.trigger==="click"&&!((N=m.value)!=null&&N.contains(C.target))&&!((V=p.value)!=null&&V.contains(C.target))&&d()},y=()=>{s.value&&h()};e.watch(s,C=>{C?e.nextTick(()=>{h(),o.trigger==="click"&&document.addEventListener("click",b),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y)}):(document.removeEventListener("click",b),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y))}),e.onUnmounted(()=>{clearTimeout(u),clearTimeout(i),document.removeEventListener("click",b),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)});const P=e.computed(()=>[a.b(),a.m(o.effect)]),R=e.computed(()=>[a.e("arrow"),a.e(`arrow-${M.value}`)]);return(C,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(a).e("wrapper"))},[e.createElementVNode("div",{ref_key:"triggerRef",ref:m,class:e.normalizeClass(e.unref(a).e("trigger")),onMouseenter:v,onMouseleave:c,onClick:g,onFocus:L,onBlur:w},[e.renderSlot(C.$slots,"default")],34),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:`x-tooltip-${t.transition}`},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"tooltipRef",ref:p,class:e.normalizeClass(P.value),style:e.normalizeStyle(k.value),onMouseenter:v,onMouseleave:c},[e.renderSlot(C.$slots,"content",{},()=>[e.createTextVNode(e.toDisplayString(t.content),1)]),t.visibleArrow?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(R.value)},null,2)):e.createCommentVNode("",!0)],38),[[e.vShow,s.value]])]),_:3},8,["name"])]))],2))}}),ue={class:"x-popconfirm-wrapper"},he={class:"x-popconfirm__main"},fe={class:"x-popconfirm__title"},pe={class:"x-popconfirm__action"},ve=e.defineComponent({name:"XPopconfirm",__name:"index",props:{title:{default:""},confirmButtonText:{default:"确定"},cancelButtonText:{default:"取消"},confirmButtonType:{default:"primary"},cancelButtonType:{default:"default"},icon:{default:""},iconColor:{default:"#faad14"},hideIcon:{type:Boolean,default:!1},hideCancelButton:{type:Boolean,default:!1},hideConfirmButton:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},width:{default:200},placement:{default:"top"},offset:{default:12},showArrow:{type:Boolean,default:!0}},emits:["confirm","cancel"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(!1),s=e.ref(null),m=e.ref(null),p=e.ref({}),u=()=>{if(!s.value||!m.value)return;const c=s.value.getBoundingClientRect(),g=m.value.getBoundingClientRect(),L=o.placement,w=o.offset;let b=0,y=0;switch(L){case"top":b=c.top-g.height-w,y=c.left+(c.width-g.width)/2;break;case"top-start":b=c.top-g.height-w,y=c.left;break;case"top-end":b=c.top-g.height-w,y=c.right-g.width;break;case"bottom":b=c.bottom+w,y=c.left+(c.width-g.width)/2;break;case"bottom-start":b=c.bottom+w,y=c.left;break;case"bottom-end":b=c.bottom+w,y=c.right-g.width;break;case"left":b=c.top+(c.height-g.height)/2,y=c.left-g.width-w;break;case"left-start":b=c.top,y=c.left-g.width-w;break;case"left-end":b=c.bottom-g.height,y=c.left-g.width-w;break;case"right":b=c.top+(c.height-g.height)/2,y=c.right+w;break;case"right-start":b=c.top,y=c.right+w;break;case"right-end":b=c.bottom-g.height,y=c.right+w;break;default:b=c.top-g.height-w,y=c.left+(c.width-g.width)/2}const P=window.innerWidth,R=window.innerHeight;y<0&&(y=10),y+g.width>P&&(y=P-g.width-10),b<0&&(b=10),b+g.height>R&&(b=R-g.height-10),p.value={position:"fixed",top:`${b}px`,left:`${y}px`,zIndex:"2000"}},i=c=>{var g,L;a.value&&((g=s.value)!=null&&g.contains(c.target)||(L=m.value)!=null&&L.contains(c.target)||(a.value=!1))},k=c=>{o.disabled||(c.stopPropagation(),a.value=!a.value,a.value&&setTimeout(u,0))},h=()=>{a.value=!1,r("confirm")},M=()=>{a.value=!1,r("cancel")},f=()=>{a.value&&u()},d=()=>{a.value&&u()};e.watch(a,c=>{c?(setTimeout(u,0),document.addEventListener("click",i),window.addEventListener("scroll",f,!0),window.addEventListener("resize",d)):(document.removeEventListener("click",i),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",d))}),e.onUnmounted(()=>{document.removeEventListener("click",i),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",d)});const l=e.computed(()=>({width:typeof o.width=="number"?`${o.width}px`:o.width})),v=e.computed(()=>{const c=o.placement,g={};switch(c){case"top":case"top-start":case"top-end":g.bottom="-6px",g.transform="rotate(45deg)";break;case"bottom":case"bottom-start":case"bottom-end":g.top="-6px",g.transform="rotate(225deg)";break;case"left":case"left-start":case"left-end":g.right="-6px",g.transform="rotate(315deg)";break;case"right":case"right-start":case"right-end":g.left="-6px",g.transform="rotate(135deg)";break}return g});return(c,g)=>(e.openBlock(),e.createElementBlock("span",ue,[e.createElementVNode("span",{ref_key:"triggerRef",ref:s,class:"x-popconfirm-trigger",onClick:k},[e.renderSlot(c.$slots,"default")],512),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"x-popconfirm-fade"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"popperRef",ref:m,class:"x-popconfirm",style:e.normalizeStyle({...p.value,...l.value}),onClick:g[0]||(g[0]=e.withModifiers(()=>{},["stop"]))},[t.showArrow?(e.openBlock(),e.createElementBlock("span",{key:0,class:"x-popconfirm__arrow",style:e.normalizeStyle(v.value)},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",he,[t.hideIcon?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:"x-popconfirm__icon",style:e.normalizeStyle({color:t.iconColor})},[e.renderSlot(c.$slots,"icon",{},()=>[e.createTextVNode(e.toDisplayString(t.icon||"⚠"),1)])],4)),e.createElementVNode("div",fe,[e.renderSlot(c.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])])]),e.createElementVNode("div",pe,[t.hideCancelButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"x-button p-button--default p-button--small",onClick:M},e.toDisplayString(t.cancelButtonText),1)),t.hideConfirmButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["x-button x-button--small",`x-button--${t.confirmButtonType}`]),onClick:h},e.toDisplayString(t.confirmButtonText),3))])],4)):e.createCommentVNode("",!0)]),_:3})]))]))}}),ge=e.defineComponent({name:"XBacktop",__name:"index",props:{visibilityHeight:{default:200},right:{default:40},bottom:{default:40}},emits:["click"],setup(t,{emit:n}){const o=t,r=n,a=x.useNamespace("backtop"),s=e.ref(!1),m=()=>{const i=window.scrollY||document.documentElement.scrollTop||document.body.scrollTop||0;s.value=i>=o.visibilityHeight},p=i=>{window.scrollTo({top:0,behavior:"smooth"}),r("click",i)},u=e.computed(()=>({right:`${o.right}px`,bottom:`${o.bottom}px`}));return e.onMounted(()=>{window.addEventListener("scroll",m,{passive:!0,capture:!0}),setTimeout(m,100)}),e.onUnmounted(()=>{window.removeEventListener("scroll",m,!0)}),(i,k)=>(e.openBlock(),e.createBlock(e.Transition,{name:"x-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).b()),style:e.normalizeStyle(u.value),onClick:p},[e.renderSlot(i.$slots,"default",{},()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(a).e("icon"))},[e.createVNode(e.unref(E),{name:"back-top",size:20})],2)])],6),[[e.vShow,s.value]])]),_:3}))}}),Me=e.defineComponent({name:"XResult",__name:"index",props:{status:{default:"info"},title:{default:""},subTitle:{default:""},icon:{}},setup(t){const n=t,o=x.useNamespace("result"),r=e.computed(()=>n.icon?n.icon:{success:"check-circle",warning:"warning",error:"close-circle",info:"info-circle"}[n.status]);return(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(o).b(),e.unref(o).m(t.status)])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(o).e("icon"))},[e.renderSlot(a.$slots,"icon",{},()=>[e.createVNode(e.unref(E),{name:r.value,size:72},null,8,["name"])])],2),t.title||a.$slots.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o).e("title"))},[e.renderSlot(a.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],2)):e.createCommentVNode("",!0),t.subTitle||a.$slots.subTitle?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(o).e("subtitle"))},[e.renderSlot(a.$slots,"subTitle",{},()=>[e.createTextVNode(e.toDisplayString(t.subTitle),1)])],2)):e.createCommentVNode("",!0),a.$slots.extra?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(o).e("extra"))},[e.renderSlot(a.$slots,"extra")],2)):e.createCommentVNode("",!0),a.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(e.unref(o).e("content"))},[e.renderSlot(a.$slots,"default")],2)):e.createCommentVNode("",!0)],2))}}),ke=e.defineComponent({name:"XTimeline",__name:"index",setup(t){const n=x.useNamespace("timeline");return(o,r)=>(e.openBlock(),e.createElementBlock("ul",{class:e.normalizeClass(e.unref(n).b())},[e.renderSlot(o.$slots,"default")],2))}}),ye=e.defineComponent({name:"XTimelineItem",__name:"TimelineItem",props:{timestamp:{},placement:{default:"bottom"},type:{default:"primary"},color:{},size:{default:"normal"},icon:{},hollow:{type:Boolean,default:!1}},setup(t){const n=x.useNamespace("timeline-item");return(o,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([e.unref(n).b(),e.unref(n).m(t.placement)])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(n).e("tail"))},null,2),e.createElementVNode("div",{class:e.normalizeClass([e.unref(n).e("node"),e.unref(n).m(t.type),e.unref(n).is("hollow",t.hollow)]),style:e.normalizeStyle(t.color?{backgroundColor:t.color,borderColor:t.color}:void 0)},[e.renderSlot(o.$slots,"icon",{},()=>[t.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n).e("icon"))},e.toDisplayString(t.icon),3)):e.createCommentVNode("",!0)])],6),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n).e("wrapper"))},[t.timestamp&&t.placement==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n).e("timestamp"))},e.toDisplayString(t.timestamp),3)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n).e("content"))},[e.renderSlot(o.$slots,"default")],2),t.timestamp&&t.placement==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(n).e("timestamp"))},e.toDisplayString(t.timestamp),3)):e.createCommentVNode("",!0)],2)],2))}}),Ce=e.defineComponent({name:"XMessage",__name:"index",props:{message:{default:""},type:{default:"info"},duration:{default:3e3},showClose:{type:Boolean,default:!1},center:{type:Boolean,default:!1},offset:{default:20},customClass:{},onClose:{}},emits:["close","destroy"],setup(t,{expose:n,emit:o}){const r=t,a=o,s=x.useNamespace("message"),m=e.ref(!1),p=e.ref(x.nextMessageZIndex()),u={success:"check",warning:"warning",error:"close-circle",info:"info"},i=e.computed(()=>[s.b(),s.m(r.type),s.is("center",r.center),s.is("closable",r.showClose),r.customClass]),k=e.computed(()=>({top:`${r.offset}px`,zIndex:p.value}));let h=null;const M=()=>{r.duration>0&&(h=setTimeout(()=>{d()},r.duration))},f=()=>{h&&(clearTimeout(h),h=null)},d=()=>{var v;m.value=!1,(v=r.onClose)==null||v.call(r),a("close")},l=()=>{a("destroy")};return e.onMounted(()=>{M(),m.value=!0}),e.onUnmounted(()=>{f()}),n({close:d}),(v,c)=>(e.openBlock(),e.createBlock(e.Transition,{name:"x-message-fade",onAfterLeave:l},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(i.value),style:e.normalizeStyle(k.value),onMouseenter:f,onMouseleave:M},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(s).e("icon"))},[e.createVNode(e.unref(E),{name:u[t.type],size:16},null,8,["name"])],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(s).e("content"))},[e.renderSlot(v.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.message),1)])],2),t.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(e.unref(s).e("close")),onClick:d},[e.createVNode(e.unref(E),{name:"close",size:14})],2)):e.createCommentVNode("",!0)],38)):e.createCommentVNode("",!0)]),_:3}))}}),I=[];let be=1;const we=()=>{I.slice().forEach(t=>t.close())};function K(t){const n=be++,o=document.createElement("div");document.body.appendChild(o);const r={success:{bg:"#f0f9eb",border:"#67c23a",iconPath:"M5 13l4 4L19 7"},warning:{bg:"#fdf6ec",border:"#e6a23c",iconPath:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},error:{bg:"#fef0f0",border:"#f56c6c",iconPath:"M6 18L18 6M6 6l12 12"},info:{bg:"#f4f4f5",border:"#909399",iconPath:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}},a=t.type||"info",s=r[a]||r.info,m=e.reactive({visible:!1,offset:t.offset??20});let p=t.offset??20;I.forEach(l=>{const v=l.container.firstElementChild;v&&v.offsetHeight&&(p+=v.offsetHeight+16)}),m.offset=p;let u=null,i=!1;const k=()=>{i||(m.visible=!1,setTimeout(()=>{if(i)return;i=!0;const l=I.findIndex(v=>v.id===n);l!==-1&&I.splice(l,1);try{f.unmount()}catch{}o.parentNode&&o.parentNode.removeChild(o)},300))},h=()=>{const l=t.duration??3e3;l>0&&(u=setTimeout(k,l))},M=()=>{u&&(clearTimeout(u),u=null)},f=e.createApp({render(){if(!m.visible)return null;const l=[e.h("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"10px",color:s.border}},[e.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[e.h("path",{d:s.iconPath})])]),e.h("span",{style:{flex:"1",fontSize:"14px",color:"#606266",lineHeight:"1.4"}},t.message||"")];return t.showClose&&l.push(e.h("button",{style:{position:"absolute",top:"50%",right:"12px",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"#909399",padding:"0",display:"flex",alignItems:"center",justifyContent:"center"},onClick:v=>{v.stopPropagation(),k()}},[e.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[e.h("path",{d:"M6 18L18 6M6 6l12 12"})])])),e.h("div",{class:["x-message",`x-message--${a}`,t.center?"is-center":"",t.showClose?"is-closable":""],style:{position:"fixed",left:"50%",top:`${m.offset}px`,transform:"translateX(-50%)",display:"flex",alignItems:"center",padding:t.showClose?"12px 40px 12px 16px":"12px 16px",borderRadius:"4px",boxShadow:"0 2px 12px rgba(0,0,0,0.1)",minWidth:"280px",maxWidth:"480px",backgroundColor:s.bg,border:`1px solid ${s.border}`,zIndex:2e3+n,transition:"opacity 0.3s, transform 0.3s"},onMouseenter:M,onMouseleave:h},l)}});f.mount(o),e.nextTick(()=>{m.visible=!0,h()});const d={id:n,app:f,container:o,close:k};return I.push(d),{close:k}}function xe(t){return K(typeof t=="string"?{message:t}:t)}const O=t=>n=>K({...typeof n=="string"?{message:n}:n,type:t}),q=Object.assign(xe,{info:O("info"),success:O("success"),warning:O("warning"),error:O("error"),closeAll:we}),ze=Ce,Be={install(t){t.config.globalProperties.$message=q,t.provide("message",q)}},A=[],Ve=()=>{A.slice().forEach(t=>t.close())},Ee={success:{iconPath:"M5 13l4 4L19 7",color:"#67c23a"},warning:{iconPath:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",color:"#e6a23c"},error:{iconPath:"M6 18L18 6M6 6l12 12",color:"#f56c6c"},info:{iconPath:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",color:"#909399"}};function j(t){return new Promise(n=>{const o=document.createElement("div");document.body.appendChild(o);let r=!1;const a=e.defineComponent({name:"TMessageBox",setup(){const p=e.ref(!1),u=e.ref(t.inputValue??""),i=e.ref(""),k=2e3+A.length+1,h=v=>{r||(r=!0,p.value=!1,setTimeout(()=>{const c=A.findIndex(g=>g.container===o);c!==-1&&A.splice(c,1);try{s.unmount()}catch{}o.parentNode&&o.parentNode.removeChild(o),n({action:v,value:v==="confirm"?u.value:void 0})},300))},M=()=>{if(t.showInput&&t.inputPattern&&!t.inputPattern.test(u.value)){i.value=t.inputErrorMessage||"输入格式不正确";return}i.value="",h("confirm")},f=()=>{h("cancel")},d=()=>{h("close")},l=()=>{t.closeOnClickModal!==!1&&d()};return e.nextTick(()=>{p.value=!0}),{visible:p,inputValue:u,inputError:i,zIndex:k,handleConfirm:M,handleCancel:f,handleClose:d,handleMaskClick:l}},render(){if(!this.visible)return null;const p=t.type,u=p?Ee[p]:null,i=[];u&&i.push(e.h("span",{class:"x-message-box__icon",style:{color:u.color,marginRight:"10px",display:"flex",alignItems:"center"}},[e.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[e.h("path",{d:u.iconPath})])])),i.push(e.h("span",{class:"x-message-box__title"},t.title||"提示")),t.showClose!==!1&&i.push(e.h("button",{class:"x-message-box__close",onClick:this.handleClose,style:{display:"flex",alignItems:"center",justifyContent:"center"}},[e.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[e.h("path",{d:"M6 18L18 6M6 6l12 12"})])]));const k=[];k.push(e.h("div",{class:"x-message-box__content"},t.message||"")),t.showInput&&k.push(e.h("div",{class:"x-message-box__input",style:{marginTop:"12px"}},[e.h("input",{class:["x-message-box__input-inner",this.inputError?"is-error":""].filter(Boolean),type:t.inputType||"text",placeholder:t.inputPlaceholder||"请输入",value:this.inputValue,onInput:M=>{this.inputValue=M.target.value,this.inputError=""},onKeyup:M=>{M.key==="Enter"&&this.handleConfirm()}}),this.inputError?e.h("div",{class:"x-message-box__error",style:{color:"#f56c6c",fontSize:"12px",marginTop:"4px"}},this.inputError):null]));const h=[];return t.showCancelButton&&h.push(e.h("button",{class:"x-button p-button--default",onClick:this.handleCancel},t.cancelButtonText||"取消")),t.showConfirmButton!==!1&&h.push(e.h("button",{class:"x-button p-button--primary",onClick:this.handleConfirm,style:{marginLeft:"10px"}},t.confirmButtonText||"确定")),e.h("div",{class:["x-message-box-wrapper",t.center?"is-center":""],style:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:this.zIndex},onClick:this.handleMaskClick},[e.h("div",{class:["x-message-box",t.customClass],style:{backgroundColor:"#fff",borderRadius:"4px",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.1)",minWidth:"300px",maxWidth:"500px"},onClick:M=>M.stopPropagation()},[e.h("div",{class:"x-message-box__header",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #eee"}},i),e.h("div",{class:"x-message-box__body",style:{padding:"20px",fontSize:"14px",color:"#606266"}},k),e.h("div",{class:"x-message-box__footer",style:{padding:"10px 20px 16px",textAlign:"right"}},h)])])}}),s=e.createApp(a);s.mount(o);const m={app:s,container:o,close:()=>{var u;const p=(u=s._instance)==null?void 0:u.proxy;p!=null&&p.handleClose&&p.handleClose()}};A.push(m)})}async function Ne(t,n,o){return j({message:t,title:n,...o,showConfirmButton:!0,showCancelButton:!1})}async function Te(t,n,o){return j({message:t,title:n,...o,showConfirmButton:!0,showCancelButton:!0})}async function Se(t,n,o){return j({message:t,title:n,...o,showInput:!0,showConfirmButton:!0,showCancelButton:!0})}function Le(t){return j(t)}const H=Object.assign(Le,{alert:Ne,confirm:Te,prompt:Se,closeAll:Ve}),He={install(t){t.config.globalProperties.$msgbox=H,t.config.globalProperties.$alert=H.alert,t.config.globalProperties.$confirm=H.confirm,t.config.globalProperties.$prompt=H.prompt,t.provide("messageBox",H)}},D=[];let $e=1;const Ie=()=>{D.slice().forEach(t=>t.close())},Ae={success:{iconPath:"M5 13l4 4L19 7",color:"#67c23a"},warning:{iconPath:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",color:"#e6a23c"},error:{iconPath:"M6 18L18 6M6 6l12 12",color:"#f56c6c"},info:{iconPath:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",color:"#909399"}},De=(t,n)=>{const o=D.filter(a=>a.position===t);let r=16;for(const a of o)if(a.id<n){const s=a.container.firstElementChild;s&&(r+=s.offsetHeight+16)}return r},Pe=(t,n)=>{const o={position:"fixed",width:"330px",zIndex:"2010"};switch(t){case"top-right":o.top=`${n}px`,o.right="16px";break;case"top-left":o.top=`${n}px`,o.left="16px";break;case"bottom-right":o.bottom=`${n}px`,o.right="16px";break;case"bottom-left":o.bottom=`${n}px`,o.left="16px";break;default:o.top=`${n}px`,o.right="16px"}return o};function Y(t){const n=$e++,o=t.position||"top-right",r=document.createElement("div");document.body.appendChild(r);let a=null,s=!1;const m=e.defineComponent({name:"TNotification",setup(){const i=e.ref(!1),k=()=>{s||(s=!0,i.value=!1,setTimeout(()=>{var v;const l=D.findIndex(c=>c.id===n);l!==-1&&D.splice(l,1),a&&clearTimeout(a),(v=t.onClose)==null||v.call(t);try{p.unmount()}catch{}r.parentNode&&r.parentNode.removeChild(r)},300))},h=()=>{const l=t.duration??4500;l>0&&(a=setTimeout(k,l))},M=()=>{a&&(clearTimeout(a),a=null)},f=e.computed(()=>(t.offset??0)+De(o,n)),d=e.computed(()=>Pe(o,f.value));return e.nextTick(()=>{i.value=!0,h()}),{visible:i,close:k,positionStyles:d,startTimer:h,clearTimer:M}},render(){if(!this.visible)return null;const i=t.type,k=i?Ae[i]:null,h=[];t.title&&h.push(e.h("div",{class:"x-notification__title",style:{fontWeight:"600",fontSize:"16px",color:"#303133",marginBottom:t.message?"6px":"0"}},t.title)),t.message&&(t.dangerouslyUseHTMLString?h.push(e.h("div",{class:"x-notification__content",style:{fontSize:"14px",color:"#606266",lineHeight:"1.5"},innerHTML:t.message})):h.push(e.h("div",{class:"x-notification__content",style:{fontSize:"14px",color:"#606266",lineHeight:"1.5"}},t.message)));const M=[];return k&&M.push(e.h("div",{class:"x-notification__icon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",marginRight:"12px",color:k.color}},[e.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[e.h("path",{d:k.iconPath})])])),M.push(e.h("div",{class:"x-notification__main",style:{flex:"1"}},h)),t.showClose!==!1&&M.push(e.h("button",{class:"x-notification__close",style:{position:"absolute",top:"18px",right:"15px",background:"none",border:"none",cursor:"pointer",color:"#909399",padding:"0",display:"flex",alignItems:"center",justifyContent:"center"},onClick:f=>{f.stopPropagation(),this.close()}},[e.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[e.h("path",{d:"M6 18L18 6M6 6l12 12"})])])),e.h("div",{class:["x-notification",t.customClass],style:{...this.positionStyles,display:"flex",alignItems:"flex-start",padding:"14px 26px 14px 13px",borderRadius:"8px",backgroundColor:"#fff",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",transition:"opacity 0.3s, transform 0.3s",boxSizing:"border-box"},onMouseenter:this.clearTimer,onMouseleave:this.startTimer},M)}}),p=e.createApp(m);p.mount(r);const u={id:n,app:p,container:r,position:o,close:()=>{var k;const i=(k=p._instance)==null?void 0:k.proxy;i!=null&&i.close&&i.close()}};return D.push(u),{close:u.close}}function Re(t){return Y(typeof t=="string"?{message:t}:t)}const W=t=>n=>Y({...typeof n=="string"?{message:n}:n,type:t}),U=Object.assign(Re,{info:W("info"),success:W("success"),warning:W("warning"),error:W("error"),closeAll:Ie}),Oe={install(t){t.config.globalProperties.$notify=U,t.provide("notification",U)}};exports.Alert=me;exports.Backtop=ge;exports.Drawer=te;exports.DrawerForm=ce;exports.Message=q;exports.MessageBox=H;exports.MessageComponent=ze;exports.Modal=ee;exports.Notification=U;exports.Popconfirm=ve;exports.Result=Me;exports.TMessage=Be;exports.TMessageBox=He;exports.TNotification=Oe;exports.Timeline=ke;exports.TimelineItem=ye;exports.Tooltip=de;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),x=require("@xto/core"),Z={"arrow-up":"M12 19V5m0 0l-7 7m7-7l7 7","arrow-down":"M12 5v14m0 0l7-7m-7 7l-7-7","arrow-left":"M19 12H5m0 0l7 7m-7-7l7-7","arrow-right":"M5 12h14m0 0l-7-7m7 7l-7 7","arrow-up-bold":"M12 5l-7 7h4v7h6v-7h4l-7-7z","arrow-down-bold":"M12 19l7-7h-4V5H9v7H5l7 7z","arrow-left-bold":"M5 12l7-7v4h7v6h-7v4l-7-7z","arrow-right-bold":"M19 12l-7 7v-4H5v-6h7V5l7 7z","caret-down":"M6 9l6 6 6-6","caret-right":"M9 18l6-6-6-6",plus:"M12 5v14m-7-7h14",minus:"M5 12h14",close:"M6 18L18 6M6 6l12 12",check:"M5 13l4 4L19 7","check-bold":"M4 12l5 5L20 6",edit:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z",delete:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",copy:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",download:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",upload:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",refresh:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15",search:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",filter:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z",more:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z","more-h":"M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z",setting:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",share:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z",loading:"M12 2v4m0 12v4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83M2 12h4m12 0h4M4.93 19.07l2.83-2.83m8.48-8.48l2.83-2.83",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",question:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",user:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z","user-add":"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z","user-group":"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",logout:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1",login:"M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1",file:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",folder:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z","folder-open":"M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z",document:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",image:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",video:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z",music:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3",camera:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z M15 13a3 3 0 11-6 0 3 3 0 016 0z",mail:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",phone:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",chat:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",bell:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",message:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z",eye:"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z","eye-off":"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21",calendar:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",clock:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",history:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",timer:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",location:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z M15 11a3 3 0 11-6 0 3 3 0 016 0z",map:"M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7",globe:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9",star:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",heart:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z","thumb-up":"M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5",link:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1","external-link":"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",lock:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z",unlock:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z",key:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z",home:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",menu:"M4 6h16M4 12h16M4 18h16","menu-fold":"M4 6h16M4 12h10M4 18h16","menu-unfold":"M4 6h16M10 12h10M4 18h16","menu-collapse":"M4 6h16M4 12h10M4 18h16","menu-expand":"M4 6h16M10 12h10M4 18h16","sidebar-fold":"M11 19l-7-7 7-7m8 14l-7-7 7-7","sidebar-expand":"M13 5l7 7-7 7M5 5l7 7-7 7","sidebar-left":"M11 19l-7-7 7-7m8 14l-7-7 7-7",dashboard:"M4 5a1 1 0 011-1h4a1 1 0 011 1v5a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM14 5a1 1 0 011-1h4a1 1 0 011 1v2a1 1 0 01-1 1h-4a1 1 0 01-1-1V5zM4 15a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1v-4zM14 12a1 1 0 011-1h4a1 1 0 011 1v7a1 1 0 01-1 1h-4a1 1 0 01-1-1v-7z",chart:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z","chart-pie":"M11 3.055A9.001 9.001 0 1020.945 13H11V3.055z M20.488 9H15V3.512A9.025 9.025 0 0120.488 9z","chart-line":"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4v16",report:"M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",analytics:"M16 8v8m-4-5v5m-4-2v2m-2 4h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",system:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M12 15a3 3 0 100-6 3 3 0 000 6z",permission:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",role:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z","user-manage":"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z",log:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",notification:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",app:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z",list:"M4 6h16M4 10h16M4 14h16M4 18h16",grid:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z",fullscreen:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4","fullscreen-exit":"M9 4V9H4m11-5v5h5M4 15h5v5m11-5h-5v5","zoom-in":"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v6m3-3H7","zoom-out":"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM13 10H7",print:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z",bookmark:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z",tag:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z",code:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4",terminal:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",database:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4",server:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01",cloud:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z",gift:"M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7",moon:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z",sun:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z",theme:"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01",skin:"M7 4h2v1c0 1.66 1.34 3 3 3s3-1.34 3-3V4h2l3 3v6h-4l1 3v5H7v-5l1-3H4V7l3-3z",heading:"M4 6h16M4 12h8m-8 6h16",bold:"M6 4h8a4 4 0 014 4 4 4 0 01-4 4H6z M6 12h9a4 4 0 014 4 4 4 0 01-4 4H6z",italic:"M10 4h4m-2 0v16m-4 0h8",strikethrough:"M16 4H8a4 4 0 00-4 4v4h16V8a4 4 0 00-4-4zM4 12h16m-4 4H8a4 4 0 00-4 4v0a4 4 0 004 4h8a4 4 0 004-4v0a4 4 0 00-4-4z","list-bullet":"M4 6h.01M4 12h.01M4 18h.01M8 6h12M8 12h12M8 18h12","list-number":"M4 6h2M4 12h2M4 18h2M8 6h12M8 12h12M8 18h12","link-text":"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1","image-insert":"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z","code-inline":"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4","divider-h":"M4 12h16",quote:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z","code-block":"M4 4h16v16H4z M8 8h8M8 12h8M8 16h4","sort-up":"M12 5v14m-7-7l7-7 7 7","sort-down":"M12 19V5m7 7l-7 7-7-7","chevron-down":"M6 9l6 6 6-6","chevron-right":"M9 18l6-6-6-6","chevron-up":"M18 15l-6-6-6 6","chevron-left":"M15 18l-6-6 6-6","move-up":"M5 15l7-7 7 7","move-down":"M19 9l-7 7-7-7","back-top":"M12 19V5m-7 7l7-7 7 7","dropdown-arrow":"M6 9l6 6 6-6","close-circle":"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z","close-bold":"M6 18L18 6M6 6l12 12","check-circle":"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z","info-circle":"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z","warning-circle":"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z","back-arrow":"M19 12H5m0 0l7 7m-7-7l7-7","d-arrow-left":"M11 17l-5-5 5-5M18 17l-5-5 5-5","d-arrow-right":"M6 7l5 5-5 5M13 7l5 5-5 5",left:"M15 19l-7-7 7-7",right:"M9 5l7 7-7 7",down:"M19 9l-7 7-7-7",up:"M5 15l7-7 7 7"};function G(t){return t in Z}const J=["aria-hidden","aria-label"],Q=["stroke-width"],_=["d"],E=e.defineComponent({name:"XIcon",__name:"index",props:{name:{},size:{default:24},color:{},spin:{type:Boolean,default:!1},strokeWidth:{default:2}},setup(t,{expose:n}){const o=t,r=x.useNamespace("icon"),a=e.computed(()=>typeof o.size=="number"?`${o.size}px`:o.size),s=e.computed(()=>({width:a.value,height:a.value,color:o.color})),m=e.computed(()=>({strokeWidth:o.strokeWidth})),p=e.computed(()=>[r.b(),r.is("spin",o.spin)]),u=e.computed(()=>o.name&&G(o.name)?Z[o.name]:"");return n({iconSize:a,iconStyle:s,iconPath:u}),(i,k)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(p.value),style:e.normalizeStyle(s.value),"aria-hidden":!t.name,"aria-label":t.name,role:"img"},[u.value?(e.openBlock(),e.createElementBlock("svg",{key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",style:e.normalizeStyle(m.value),"aria-hidden":"true"},[e.createElementVNode("path",{d:u.value},null,8,_)],12,Q)):e.renderSlot(i.$slots,"default",{key:1},()=>[e.createTextVNode(e.toDisplayString(t.name),1)])],14,J))}}),ee=e.defineComponent({name:"XModal",inheritAttrs:!1,__name:"index",props:{modelValue:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},title:{default:""},width:{default:"50%"},top:{default:"15vh"},modal:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},center:{type:Boolean,default:!1},destroyOnClose:{type:Boolean,default:!1}},emits:["update:modelValue","update:open","close","open","ok","cancel"],setup(t,{emit:n}){const o=t,r=n,a=x.useNamespace("modal"),{next:s}=x.useZIndex(),m=e.ref(s()),p=e.computed({get:()=>o.modelValue!==void 0?o.modelValue:o.open!==void 0?o.open:!1,set:d=>{o.modelValue!==void 0&&r("update:modelValue",d),o.open!==void 0&&r("update:open",d),o.modelValue===void 0&&o.open===void 0&&r("update:modelValue",d)}}),u=e.ref(),i=()=>{p.value=!1,r("cancel"),r("close")},k=()=>{r("ok")},h=()=>{o.closeOnClickModal&&o.modal&&i()};x.useEscape(()=>{o.closeOnPressEscape&&p.value&&i()}),e.watch(()=>[o.modelValue,o.open],([d,l])=>{(d!==void 0?d:l)&&(m.value=s(),r("open"))},{immediate:!0});const M=e.computed(()=>({paddingTop:o.top})),f=e.computed(()=>({width:typeof o.width=="number"?`${o.width}px`:o.width,zIndex:m.value}));return(d,l)=>{const v=e.resolveComponent("x-button");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"x-modal-fade"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(a).e("wrapper")),style:e.normalizeStyle(M.value),onClick:h},[e.createElementVNode("div",{ref_key:"modalRef",ref:u,class:e.normalizeClass(e.unref(a).b()),style:e.normalizeStyle(f.value),onClick:l[0]||(l[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("header"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(a).e("title"))},[e.renderSlot(d.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],2),t.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(e.unref(a).e("close")),onClick:i},[e.createVNode(e.unref(E),{name:"close",size:16})],2)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("body"))},[e.renderSlot(d.$slots,"default")],2),d.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(a).e("footer"))},[e.renderSlot(d.$slots,"footer",{ok:k,cancel:i})],2)):d.$slots.footer?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(a).e("footer"))},[e.createVNode(v,{onClick:i},{default:e.withCtx(()=>[...l[1]||(l[1]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(v,{type:"primary",style:{"margin-left":"8px"},onClick:k},{default:e.withCtx(()=>[...l[2]||(l[2]=[e.createTextVNode("确定",-1)])]),_:1})],2))],6)],6)):e.createCommentVNode("",!0)]),_:3})])}}}),te=e.defineComponent({name:"XDrawer",inheritAttrs:!1,__name:"index",props:{modelValue:{type:Boolean,default:!1},title:{default:""},placement:{default:void 0},direction:{default:"rtl"},width:{default:void 0},size:{default:"30%"},withHeader:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!1},modal:{type:Boolean,default:!0}},emits:["update:modelValue","close","open"],setup(t,{emit:n}){const o=t,r=n,a=x.useNamespace("drawer"),s=e.ref(2e3),m=()=>{r("update:modelValue",!1),r("close")},p=()=>{o.closeOnClickModal&&m()},u=h=>{h.key==="Escape"&&o.modelValue&&m()};e.watch(()=>o.modelValue,h=>{h?(s.value=2e3+Math.floor(Math.random()*100),r("open"),document.addEventListener("keydown",u)):document.removeEventListener("keydown",u)});const i=e.computed(()=>({zIndex:s.value})),k=e.computed(()=>{const h=o.direction??o.placement??"rtl",M=o.size??o.width??"30%",f=typeof M=="number"?`${M}px`:M;return{ltr:{width:f,height:"100%"},rtl:{width:f,height:"100%"},ttb:{width:"100%",height:f},btt:{width:"100%",height:f}}[h]});return(h,M)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"x-drawer-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(a).e("overlay"),{[e.unref(a).em("overlay","no-modal")]:!t.modal}]),style:e.normalizeStyle(i.value),onClick:p},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(a).b(),e.unref(a).m(t.direction??t.placement??"rtl")]),style:e.normalizeStyle(k.value),onClick:M[0]||(M[0]=e.withModifiers(()=>{},["stop"]))},[t.withHeader?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(a).e("header"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(a).e("title"))},[e.renderSlot(h.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],2),t.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(e.unref(a).e("close")),onClick:m},[e.createVNode(e.unref(E),{name:"close",size:18})],2)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(a).e("body"),h.$slots.footer&&e.unref(a).em("body","has-footer")])},[e.renderSlot(h.$slots,"default")],2),h.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(a).e("footer"))},[e.renderSlot(h.$slots,"footer")],2)):e.createCommentVNode("",!0)],6)],6),[[e.vShow,t.modelValue]])]),_:3})]))}}),oe={key:0,class:"required-mark"},ae=["value","placeholder","disabled","onInput"],le=["value","placeholder","disabled","onInput"],ne=["value","placeholder","disabled","onInput"],se=["value","disabled","onChange"],re=["value"],ie=["disabled","onClick"],ce=e.defineComponent({name:"XDrawerForm",__name:"index",props:{modelValue:{type:Boolean,default:!1},title:{default:"配置"},size:{default:"400px"},fields:{default:()=>[]},formData:{default:()=>({})},showConfirm:{type:Boolean,default:!0},showCancel:{type:Boolean,default:!0},confirmText:{default:"确认"},cancelText:{default:"取消"},disabled:{type:Boolean,default:!1},destroyOnClose:{type:Boolean,default:!1}},emits:["update:modelValue","confirm","cancel","close","field-change"],setup(t,{emit:n}){const o=t,r=n,a=x.useNamespace("drawer-form"),s=e.ref({}),m=e.ref({});e.computed(()=>[a.b()]),e.watch(()=>o.formData,f=>{s.value={...f}},{immediate:!0,deep:!0});const p=e.computed(()=>typeof o.size=="number"?`${o.size}px`:o.size),u=()=>{r("update:modelValue",!1),r("close")},i=()=>{r("cancel"),u()},k=()=>{h()&&(r("confirm",s.value),u())},h=()=>{m.value={};for(const f of o.fields){if(f.required){const d=s.value[f.name];if(d==null||d===""){m.value[f.name]=`${f.label}为必填项`;continue}}if(f.rules)for(const d of f.rules){const l=s.value[f.name];d.type==="email"&&l&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l)&&(m.value[f.name]=d.message),d.type==="minLength"&&l&&l.length<d.min&&(m.value[f.name]=d.message)}}return Object.keys(m.value).length===0},M=(f,d)=>{s.value[f]=d,r("field-change",f,d)};return(f,d)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"drawer-form-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("overlay")),onClick:u},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).b()),style:e.normalizeStyle({width:p.value}),onClick:d[0]||(d[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("header"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(a).e("title"))},e.toDisplayString(t.title),3),e.createElementVNode("button",{class:e.normalizeClass(e.unref(a).e("close")),onClick:u},[e.createVNode(e.unref(E),{name:"close",size:16})],2)],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("body"))},[!t.destroyOnClose||t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(a).e("form"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,l=>(e.openBlock(),e.createElementBlock("div",{key:l.name,class:e.normalizeClass(e.unref(a).e("field"))},[e.createElementVNode("label",{class:e.normalizeClass(e.unref(a).e("label"))},[e.createTextVNode(e.toDisplayString(l.label)+" ",1),l.required?(e.openBlock(),e.createElementBlock("span",oe,"*")):e.createCommentVNode("",!0)],2),l.type==="input"?(e.openBlock(),e.createElementBlock("input",{key:0,class:e.normalizeClass([e.unref(a).e("input"),{"has-error":m.value[l.name]}]),value:s.value[l.name],placeholder:l.placeholder,disabled:t.disabled||l.disabled,onInput:v=>M(l.name,v.target.value)},null,42,ae)):l.type==="textarea"?(e.openBlock(),e.createElementBlock("textarea",{key:1,class:e.normalizeClass([e.unref(a).e("textarea"),{"has-error":m.value[l.name]}]),value:s.value[l.name],placeholder:l.placeholder,disabled:t.disabled||l.disabled,rows:"4",onInput:v=>M(l.name,v.target.value)},null,42,le)):l.type==="number"?(e.openBlock(),e.createElementBlock("input",{key:2,type:"number",class:e.normalizeClass([e.unref(a).e("input"),{"has-error":m.value[l.name]}]),value:s.value[l.name],placeholder:l.placeholder,disabled:t.disabled||l.disabled,onInput:v=>M(l.name,Number(v.target.value))},null,42,ne)):l.type==="select"?(e.openBlock(),e.createElementBlock("select",{key:3,class:e.normalizeClass([e.unref(a).e("select"),{"has-error":m.value[l.name]}]),value:s.value[l.name],disabled:t.disabled||l.disabled,onChange:v=>M(l.name,v.target.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,v=>(e.openBlock(),e.createElementBlock("option",{key:v.value,value:v.value},e.toDisplayString(v.label),9,re))),128))],42,se)):l.type==="switch"?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(e.unref(a).e("switch"))},[e.createElementVNode("button",{class:e.normalizeClass(["switch-btn",{"is-on":s.value[l.name]}]),disabled:t.disabled||l.disabled,onClick:v=>M(l.name,!s.value[l.name])},e.toDisplayString(s.value[l.name]?"开启":"关闭"),11,ie)],2)):e.createCommentVNode("",!0),m.value[l.name]?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(e.unref(a).e("error"))},e.toDisplayString(m.value[l.name]),3)):e.createCommentVNode("",!0)],2))),128))],2)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("footer"))},[t.showCancel?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(e.unref(a).e("cancel")),onClick:i},e.toDisplayString(t.cancelText),3)):e.createCommentVNode("",!0),t.showConfirm?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(e.unref(a).e("confirm")),onClick:k},e.toDisplayString(t.confirmText),3)):e.createCommentVNode("",!0)],2)],6)],2),[[e.vShow,t.modelValue]])]),_:1})]))}}),me=e.defineComponent({name:"XAlert",__name:"index",props:{type:{default:"info"},title:{default:""},description:{},closable:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!1},center:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:n}){const o=t,r=n,a=x.useNamespace("alert"),s=e.ref(!0),m={success:"check",warning:"warning",error:"close-circle",info:"info"},p=e.computed(()=>[a.b(),a.m(o.type),a.is("center",o.center),a.is("with-description",!!o.description)]),u=i=>{s.value=!1,r("close",i)};return(i,k)=>(e.openBlock(),e.createBlock(e.Transition,{name:"x-alert-fade"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(p.value)},[t.showIcon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(a).e("icon"))},[e.createVNode(e.unref(E),{name:m[t.type],size:16},null,8,["name"])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("content"))},[t.title||i.$slots.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(a).e("title"))},[e.renderSlot(i.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],2)):e.createCommentVNode("",!0),t.description||i.$slots.default?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(a).e("description"))},[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.description),1)])],2)):e.createCommentVNode("",!0)],2),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(e.unref(a).e("close")),onClick:u},[e.createVNode(e.unref(E),{name:"close",size:14})],2)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:3}))}}),de=e.defineComponent({name:"XTooltip",__name:"index",props:{content:{default:""},placement:{default:"top"},effect:{default:"dark"},disabled:{type:Boolean,default:!1},offset:{default:8},transition:{default:"fade"},visibleArrow:{type:Boolean,default:!0},trigger:{default:"hover"},openDelay:{default:0},closeDelay:{default:0}},emits:["update:visible","show","hide"],setup(t,{emit:n}){const o=t,r=n,a=x.useNamespace("tooltip"),s=e.ref(!1),m=e.ref(),p=e.ref();let u,i;const k=e.ref({}),h=()=>{if(!m.value||!p.value)return;const C=m.value.getBoundingClientRect(),N=p.value;N.style.visibility="hidden",N.style.display="block";const V=N.offsetWidth,S=N.offsetHeight,T=o.offset,X=window.innerWidth,F=window.innerHeight;let z=0,B=0,$=o.placement;switch(o.placement){case"top":z=C.top-S-T,B=C.left+(C.width-V)/2;break;case"bottom":z=C.bottom+T,B=C.left+(C.width-V)/2;break;case"left":z=C.top+(C.height-S)/2,B=C.left-V-T;break;case"right":z=C.top+(C.height-S)/2,B=C.right+T;break}o.placement==="top"&&z<0?($="bottom",z=C.bottom+T):o.placement==="bottom"&&z+S>F?($="top",z=C.top-S-T):o.placement==="left"&&B<0?($="right",B=C.right+T):o.placement==="right"&&B+V>X&&($="left",B=C.left-V-T),B<8&&(B=8),B+V>X-8&&(B=X-V-8),z<8&&(z=8),z+S>F-8&&(z=F-S-8),k.value={position:"fixed",top:`${z}px`,left:`${B}px`,visibility:"visible",zIndex:"2000"},M.value=$},M=e.ref(o.placement),f=()=>{o.disabled||(clearTimeout(i),u=setTimeout(()=>{s.value=!0,r("update:visible",!0),r("show"),e.nextTick(()=>{h()})},o.openDelay))},d=()=>{clearTimeout(u),i=setTimeout(()=>{s.value=!1,r("update:visible",!1),r("hide")},o.closeDelay)},l=()=>{s.value?d():f()},v=()=>{o.trigger==="hover"&&f()},c=()=>{o.trigger==="hover"&&d()},g=()=>{o.trigger==="click"&&l()},L=()=>{o.trigger==="focus"&&f()},w=()=>{o.trigger==="focus"&&d()},b=C=>{var N,V;o.trigger==="click"&&!((N=m.value)!=null&&N.contains(C.target))&&!((V=p.value)!=null&&V.contains(C.target))&&d()},y=()=>{s.value&&h()};e.watch(s,C=>{C?e.nextTick(()=>{h(),o.trigger==="click"&&document.addEventListener("click",b),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y)}):(document.removeEventListener("click",b),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y))}),e.onUnmounted(()=>{clearTimeout(u),clearTimeout(i),document.removeEventListener("click",b),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)});const P=e.computed(()=>[a.b(),a.m(o.effect)]),R=e.computed(()=>[a.e("arrow"),a.e(`arrow-${M.value}`)]);return(C,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(a).e("wrapper"))},[e.createElementVNode("div",{ref_key:"triggerRef",ref:m,class:e.normalizeClass(e.unref(a).e("trigger")),onMouseenter:v,onMouseleave:c,onClick:g,onFocus:L,onBlur:w},[e.renderSlot(C.$slots,"default")],34),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:`x-tooltip-${t.transition}`},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"tooltipRef",ref:p,class:e.normalizeClass(P.value),style:e.normalizeStyle(k.value),onMouseenter:v,onMouseleave:c},[e.renderSlot(C.$slots,"content",{},()=>[e.createTextVNode(e.toDisplayString(t.content),1)]),t.visibleArrow?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(R.value)},null,2)):e.createCommentVNode("",!0)],38),[[e.vShow,s.value]])]),_:3},8,["name"])]))],2))}}),ue={class:"x-popconfirm-wrapper"},he={class:"x-popconfirm__main"},fe={class:"x-popconfirm__title"},pe={class:"x-popconfirm__action"},ve=e.defineComponent({name:"XPopconfirm",__name:"index",props:{title:{default:""},confirmButtonText:{default:"确定"},cancelButtonText:{default:"取消"},confirmButtonType:{default:"primary"},cancelButtonType:{default:"default"},icon:{default:""},iconColor:{default:"#faad14"},hideIcon:{type:Boolean,default:!1},hideCancelButton:{type:Boolean,default:!1},hideConfirmButton:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},width:{default:200},placement:{default:"top"},offset:{default:12},showArrow:{type:Boolean,default:!0}},emits:["confirm","cancel"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(!1),s=e.ref(null),m=e.ref(null),p=e.ref({}),u=()=>{if(!s.value||!m.value)return;const c=s.value.getBoundingClientRect(),g=m.value.getBoundingClientRect(),L=o.placement,w=o.offset;let b=0,y=0;switch(L){case"top":b=c.top-g.height-w,y=c.left+(c.width-g.width)/2;break;case"top-start":b=c.top-g.height-w,y=c.left;break;case"top-end":b=c.top-g.height-w,y=c.right-g.width;break;case"bottom":b=c.bottom+w,y=c.left+(c.width-g.width)/2;break;case"bottom-start":b=c.bottom+w,y=c.left;break;case"bottom-end":b=c.bottom+w,y=c.right-g.width;break;case"left":b=c.top+(c.height-g.height)/2,y=c.left-g.width-w;break;case"left-start":b=c.top,y=c.left-g.width-w;break;case"left-end":b=c.bottom-g.height,y=c.left-g.width-w;break;case"right":b=c.top+(c.height-g.height)/2,y=c.right+w;break;case"right-start":b=c.top,y=c.right+w;break;case"right-end":b=c.bottom-g.height,y=c.right+w;break;default:b=c.top-g.height-w,y=c.left+(c.width-g.width)/2}const P=window.innerWidth,R=window.innerHeight;y<0&&(y=10),y+g.width>P&&(y=P-g.width-10),b<0&&(b=10),b+g.height>R&&(b=R-g.height-10),p.value={position:"fixed",top:`${b}px`,left:`${y}px`,zIndex:"2000"}},i=c=>{var g,L;a.value&&((g=s.value)!=null&&g.contains(c.target)||(L=m.value)!=null&&L.contains(c.target)||(a.value=!1))},k=c=>{o.disabled||(c.stopPropagation(),a.value=!a.value,a.value&&setTimeout(u,0))},h=()=>{a.value=!1,r("confirm")},M=()=>{a.value=!1,r("cancel")},f=()=>{a.value&&u()},d=()=>{a.value&&u()};e.watch(a,c=>{c?(setTimeout(u,0),document.addEventListener("click",i),window.addEventListener("scroll",f,!0),window.addEventListener("resize",d)):(document.removeEventListener("click",i),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",d))}),e.onUnmounted(()=>{document.removeEventListener("click",i),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",d)});const l=e.computed(()=>({width:typeof o.width=="number"?`${o.width}px`:o.width})),v=e.computed(()=>{const c=o.placement,g={};switch(c){case"top":case"top-start":case"top-end":g.bottom="-6px",g.transform="rotate(45deg)";break;case"bottom":case"bottom-start":case"bottom-end":g.top="-6px",g.transform="rotate(225deg)";break;case"left":case"left-start":case"left-end":g.right="-6px",g.transform="rotate(315deg)";break;case"right":case"right-start":case"right-end":g.left="-6px",g.transform="rotate(135deg)";break}return g});return(c,g)=>(e.openBlock(),e.createElementBlock("span",ue,[e.createElementVNode("span",{ref_key:"triggerRef",ref:s,class:"x-popconfirm-trigger",onClick:k},[e.renderSlot(c.$slots,"default")],512),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"x-popconfirm-fade"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"popperRef",ref:m,class:"x-popconfirm",style:e.normalizeStyle({...p.value,...l.value}),onClick:g[0]||(g[0]=e.withModifiers(()=>{},["stop"]))},[t.showArrow?(e.openBlock(),e.createElementBlock("span",{key:0,class:"x-popconfirm__arrow",style:e.normalizeStyle(v.value)},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",he,[t.hideIcon?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:"x-popconfirm__icon",style:e.normalizeStyle({color:t.iconColor})},[e.renderSlot(c.$slots,"icon",{},()=>[e.createTextVNode(e.toDisplayString(t.icon||"⚠"),1)])],4)),e.createElementVNode("div",fe,[e.renderSlot(c.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])])]),e.createElementVNode("div",pe,[t.hideCancelButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"x-button p-button--default p-button--small",onClick:M},e.toDisplayString(t.cancelButtonText),1)),t.hideConfirmButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["x-button x-button--small",`x-button--${t.confirmButtonType}`]),onClick:h},e.toDisplayString(t.confirmButtonText),3))])],4)):e.createCommentVNode("",!0)]),_:3})]))]))}}),ge=e.defineComponent({name:"XBacktop",__name:"index",props:{visibilityHeight:{default:200},right:{default:40},bottom:{default:40}},emits:["click"],setup(t,{emit:n}){const o=t,r=n,a=x.useNamespace("backtop"),s=e.ref(!1),m=()=>{const i=window.scrollY||document.documentElement.scrollTop||document.body.scrollTop||0;s.value=i>=o.visibilityHeight},p=i=>{window.scrollTo({top:0,behavior:"smooth"}),r("click",i)},u=e.computed(()=>({right:`${o.right}px`,bottom:`${o.bottom}px`}));return e.onMounted(()=>{window.addEventListener("scroll",m,{passive:!0,capture:!0}),setTimeout(m,100)}),e.onUnmounted(()=>{window.removeEventListener("scroll",m,!0)}),(i,k)=>(e.openBlock(),e.createBlock(e.Transition,{name:"x-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).b()),style:e.normalizeStyle(u.value),onClick:p},[e.renderSlot(i.$slots,"default",{},()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(a).e("icon"))},[e.createVNode(e.unref(E),{name:"back-top",size:20})],2)])],6),[[e.vShow,s.value]])]),_:3}))}}),Me=e.defineComponent({name:"XResult",__name:"index",props:{status:{default:"info"},title:{default:""},subTitle:{default:""},icon:{}},setup(t){const n=t,o=x.useNamespace("result"),r=e.computed(()=>n.icon?n.icon:{success:"check-circle",warning:"warning",error:"close-circle",info:"info-circle"}[n.status]);return(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(o).b(),e.unref(o).m(t.status)])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(o).e("icon"))},[e.renderSlot(a.$slots,"icon",{},()=>[e.createVNode(e.unref(E),{name:r.value,size:72},null,8,["name"])])],2),t.title||a.$slots.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o).e("title"))},[e.renderSlot(a.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],2)):e.createCommentVNode("",!0),t.subTitle||a.$slots.subTitle?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(o).e("subtitle"))},[e.renderSlot(a.$slots,"subTitle",{},()=>[e.createTextVNode(e.toDisplayString(t.subTitle),1)])],2)):e.createCommentVNode("",!0),a.$slots.extra?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(o).e("extra"))},[e.renderSlot(a.$slots,"extra")],2)):e.createCommentVNode("",!0),a.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(e.unref(o).e("content"))},[e.renderSlot(a.$slots,"default")],2)):e.createCommentVNode("",!0)],2))}}),ke=e.defineComponent({name:"XTimeline",__name:"index",setup(t){const n=x.useNamespace("timeline");return(o,r)=>(e.openBlock(),e.createElementBlock("ul",{class:e.normalizeClass(e.unref(n).b())},[e.renderSlot(o.$slots,"default")],2))}}),ye=e.defineComponent({name:"XTimelineItem",__name:"TimelineItem",props:{timestamp:{},placement:{default:"bottom"},type:{default:"primary"},color:{},size:{default:"normal"},icon:{},hollow:{type:Boolean,default:!1}},setup(t){const n=x.useNamespace("timeline-item");return(o,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([e.unref(n).b(),e.unref(n).m(t.placement)])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(n).e("tail"))},null,2),e.createElementVNode("div",{class:e.normalizeClass([e.unref(n).e("node"),e.unref(n).m(t.type),e.unref(n).is("hollow",t.hollow)]),style:e.normalizeStyle(t.color?{backgroundColor:t.color,borderColor:t.color}:void 0)},[e.renderSlot(o.$slots,"icon",{},()=>[t.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n).e("icon"))},e.toDisplayString(t.icon),3)):e.createCommentVNode("",!0)])],6),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n).e("wrapper"))},[t.timestamp&&t.placement==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n).e("timestamp"))},e.toDisplayString(t.timestamp),3)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n).e("content"))},[e.renderSlot(o.$slots,"default")],2),t.timestamp&&t.placement==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(n).e("timestamp"))},e.toDisplayString(t.timestamp),3)):e.createCommentVNode("",!0)],2)],2))}}),Ce=e.defineComponent({name:"XMessage",__name:"index",props:{message:{default:""},type:{default:"info"},duration:{default:3e3},showClose:{type:Boolean,default:!1},center:{type:Boolean,default:!1},offset:{default:20},customClass:{},onClose:{}},emits:["close","destroy"],setup(t,{expose:n,emit:o}){const r=t,a=o,s=x.useNamespace("message"),m=e.ref(!1),p=e.ref(x.nextMessageZIndex()),u={success:"check",warning:"warning",error:"close-circle",info:"info"},i=e.computed(()=>[s.b(),s.m(r.type),s.is("center",r.center),s.is("closable",r.showClose),r.customClass]),k=e.computed(()=>({top:`${r.offset}px`,zIndex:p.value}));let h=null;const M=()=>{r.duration>0&&(h=setTimeout(()=>{d()},r.duration))},f=()=>{h&&(clearTimeout(h),h=null)},d=()=>{var v;m.value=!1,(v=r.onClose)==null||v.call(r),a("close")},l=()=>{a("destroy")};return e.onMounted(()=>{M(),m.value=!0}),e.onUnmounted(()=>{f()}),n({close:d}),(v,c)=>(e.openBlock(),e.createBlock(e.Transition,{name:"x-message-fade",onAfterLeave:l},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(i.value),style:e.normalizeStyle(k.value),onMouseenter:f,onMouseleave:M},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(s).e("icon"))},[e.createVNode(e.unref(E),{name:u[t.type],size:16},null,8,["name"])],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(s).e("content"))},[e.renderSlot(v.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.message),1)])],2),t.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(e.unref(s).e("close")),onClick:d},[e.createVNode(e.unref(E),{name:"close",size:14})],2)):e.createCommentVNode("",!0)],38)):e.createCommentVNode("",!0)]),_:3}))}}),I=[];let be=1;const we=()=>{I.slice().forEach(t=>t.close())};function K(t){const n=be++,o=document.createElement("div");document.body.appendChild(o);const r={success:{bg:"#f0f9eb",border:"#67c23a",iconPath:"M5 13l4 4L19 7"},warning:{bg:"#fdf6ec",border:"#e6a23c",iconPath:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},error:{bg:"#fef0f0",border:"#f56c6c",iconPath:"M6 18L18 6M6 6l12 12"},info:{bg:"#f4f4f5",border:"#909399",iconPath:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}},a=t.type||"info",s=r[a]||r.info,m=e.reactive({visible:!1,offset:t.offset??20});let p=t.offset??20;I.forEach(l=>{const v=l.container.firstElementChild;v&&v.offsetHeight&&(p+=v.offsetHeight+16)}),m.offset=p;let u=null,i=!1;const k=()=>{i||(m.visible=!1,setTimeout(()=>{if(i)return;i=!0;const l=I.findIndex(v=>v.id===n);l!==-1&&I.splice(l,1);try{f.unmount()}catch{}o.parentNode&&o.parentNode.removeChild(o)},300))},h=()=>{const l=t.duration??3e3;l>0&&(u=setTimeout(k,l))},M=()=>{u&&(clearTimeout(u),u=null)},f=e.createApp({render(){if(!m.visible)return null;const l=[e.h("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"10px",color:s.border}},[e.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[e.h("path",{d:s.iconPath})])]),e.h("span",{style:{flex:"1",fontSize:"14px",color:"#606266",lineHeight:"1.4"}},t.message||"")];return t.showClose&&l.push(e.h("button",{style:{position:"absolute",top:"50%",right:"12px",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"#909399",padding:"0",display:"flex",alignItems:"center",justifyContent:"center"},onClick:v=>{v.stopPropagation(),k()}},[e.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[e.h("path",{d:"M6 18L18 6M6 6l12 12"})])])),e.h("div",{class:["x-message",`x-message--${a}`,t.center?"is-center":"",t.showClose?"is-closable":""],style:{position:"fixed",left:"50%",top:`${m.offset}px`,transform:"translateX(-50%)",display:"flex",alignItems:"center",padding:t.showClose?"12px 40px 12px 16px":"12px 16px",borderRadius:"4px",boxShadow:"0 2px 12px rgba(0,0,0,0.1)",minWidth:"280px",maxWidth:"480px",backgroundColor:s.bg,border:`1px solid ${s.border}`,zIndex:2e3+n,transition:"opacity 0.3s, transform 0.3s"},onMouseenter:M,onMouseleave:h},l)}});f.mount(o),e.nextTick(()=>{m.visible=!0,h()});const d={id:n,app:f,container:o,close:k};return I.push(d),{close:k}}function xe(t){return K(typeof t=="string"?{message:t}:t)}const O=t=>n=>K({...typeof n=="string"?{message:n}:n,type:t}),q=Object.assign(xe,{info:O("info"),success:O("success"),warning:O("warning"),error:O("error"),closeAll:we}),ze=q,Be=Ce,Ve={install(t){t.config.globalProperties.$message=q,t.provide("message",q)}},A=[],Ee=()=>{A.slice().forEach(t=>t.close())},Ne={success:{iconPath:"M5 13l4 4L19 7",color:"#67c23a"},warning:{iconPath:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",color:"#e6a23c"},error:{iconPath:"M6 18L18 6M6 6l12 12",color:"#f56c6c"},info:{iconPath:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",color:"#909399"}};function j(t){return new Promise(n=>{const o=document.createElement("div");document.body.appendChild(o);let r=!1;const a=e.defineComponent({name:"TMessageBox",setup(){const p=e.ref(!1),u=e.ref(t.inputValue??""),i=e.ref(""),k=2e3+A.length+1,h=v=>{r||(r=!0,p.value=!1,setTimeout(()=>{const c=A.findIndex(g=>g.container===o);c!==-1&&A.splice(c,1);try{s.unmount()}catch{}o.parentNode&&o.parentNode.removeChild(o),n({action:v,value:v==="confirm"?u.value:void 0})},300))},M=()=>{if(t.showInput&&t.inputPattern&&!t.inputPattern.test(u.value)){i.value=t.inputErrorMessage||"输入格式不正确";return}i.value="",h("confirm")},f=()=>{h("cancel")},d=()=>{h("close")},l=()=>{t.closeOnClickModal!==!1&&d()};return e.nextTick(()=>{p.value=!0}),{visible:p,inputValue:u,inputError:i,zIndex:k,handleConfirm:M,handleCancel:f,handleClose:d,handleMaskClick:l}},render(){if(!this.visible)return null;const p=t.type,u=p?Ne[p]:null,i=[];u&&i.push(e.h("span",{class:"x-message-box__icon",style:{color:u.color,marginRight:"10px",display:"flex",alignItems:"center"}},[e.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[e.h("path",{d:u.iconPath})])])),i.push(e.h("span",{class:"x-message-box__title"},t.title||"提示")),t.showClose!==!1&&i.push(e.h("button",{class:"x-message-box__close",onClick:this.handleClose,style:{display:"flex",alignItems:"center",justifyContent:"center"}},[e.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[e.h("path",{d:"M6 18L18 6M6 6l12 12"})])]));const k=[];k.push(e.h("div",{class:"x-message-box__content"},t.message||"")),t.showInput&&k.push(e.h("div",{class:"x-message-box__input",style:{marginTop:"12px"}},[e.h("input",{class:["x-message-box__input-inner",this.inputError?"is-error":""].filter(Boolean),type:t.inputType||"text",placeholder:t.inputPlaceholder||"请输入",value:this.inputValue,onInput:M=>{this.inputValue=M.target.value,this.inputError=""},onKeyup:M=>{M.key==="Enter"&&this.handleConfirm()}}),this.inputError?e.h("div",{class:"x-message-box__error",style:{color:"#f56c6c",fontSize:"12px",marginTop:"4px"}},this.inputError):null]));const h=[];return t.showCancelButton&&h.push(e.h("button",{class:"x-button p-button--default",onClick:this.handleCancel},t.cancelButtonText||"取消")),t.showConfirmButton!==!1&&h.push(e.h("button",{class:"x-button p-button--primary",onClick:this.handleConfirm,style:{marginLeft:"10px"}},t.confirmButtonText||"确定")),e.h("div",{class:["x-message-box-wrapper",t.center?"is-center":""],style:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:this.zIndex},onClick:this.handleMaskClick},[e.h("div",{class:["x-message-box",t.customClass],style:{backgroundColor:"#fff",borderRadius:"4px",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.1)",minWidth:"300px",maxWidth:"500px"},onClick:M=>M.stopPropagation()},[e.h("div",{class:"x-message-box__header",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #eee"}},i),e.h("div",{class:"x-message-box__body",style:{padding:"20px",fontSize:"14px",color:"#606266"}},k),e.h("div",{class:"x-message-box__footer",style:{padding:"10px 20px 16px",textAlign:"right"}},h)])])}}),s=e.createApp(a);s.mount(o);const m={app:s,container:o,close:()=>{var u;const p=(u=s._instance)==null?void 0:u.proxy;p!=null&&p.handleClose&&p.handleClose()}};A.push(m)})}async function Te(t,n,o){return j({message:t,title:n,...o,showConfirmButton:!0,showCancelButton:!1})}async function Se(t,n,o){return j({message:t,title:n,...o,showConfirmButton:!0,showCancelButton:!0})}async function Le(t,n,o){return j({message:t,title:n,...o,showInput:!0,showConfirmButton:!0,showCancelButton:!0})}function He(t){return j(t)}const H=Object.assign(He,{alert:Te,confirm:Se,prompt:Le,closeAll:Ee}),$e=H,Ie={install(t){t.config.globalProperties.$msgbox=H,t.config.globalProperties.$alert=H.alert,t.config.globalProperties.$confirm=H.confirm,t.config.globalProperties.$prompt=H.prompt,t.provide("messageBox",H)}},D=[];let Ae=1;const De=()=>{D.slice().forEach(t=>t.close())},Pe={success:{iconPath:"M5 13l4 4L19 7",color:"#67c23a"},warning:{iconPath:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",color:"#e6a23c"},error:{iconPath:"M6 18L18 6M6 6l12 12",color:"#f56c6c"},info:{iconPath:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",color:"#909399"}},Re=(t,n)=>{const o=D.filter(a=>a.position===t);let r=16;for(const a of o)if(a.id<n){const s=a.container.firstElementChild;s&&(r+=s.offsetHeight+16)}return r},Oe=(t,n)=>{const o={position:"fixed",width:"330px",zIndex:"2010"};switch(t){case"top-right":o.top=`${n}px`,o.right="16px";break;case"top-left":o.top=`${n}px`,o.left="16px";break;case"bottom-right":o.bottom=`${n}px`,o.right="16px";break;case"bottom-left":o.bottom=`${n}px`,o.left="16px";break;default:o.top=`${n}px`,o.right="16px"}return o};function Y(t){const n=Ae++,o=t.position||"top-right",r=document.createElement("div");document.body.appendChild(r);let a=null,s=!1;const m=e.defineComponent({name:"TNotification",setup(){const i=e.ref(!1),k=()=>{s||(s=!0,i.value=!1,setTimeout(()=>{var v;const l=D.findIndex(c=>c.id===n);l!==-1&&D.splice(l,1),a&&clearTimeout(a),(v=t.onClose)==null||v.call(t);try{p.unmount()}catch{}r.parentNode&&r.parentNode.removeChild(r)},300))},h=()=>{const l=t.duration??4500;l>0&&(a=setTimeout(k,l))},M=()=>{a&&(clearTimeout(a),a=null)},f=e.computed(()=>(t.offset??0)+Re(o,n)),d=e.computed(()=>Oe(o,f.value));return e.nextTick(()=>{i.value=!0,h()}),{visible:i,close:k,positionStyles:d,startTimer:h,clearTimer:M}},render(){if(!this.visible)return null;const i=t.type,k=i?Pe[i]:null,h=[];t.title&&h.push(e.h("div",{class:"x-notification__title",style:{fontWeight:"600",fontSize:"16px",color:"#303133",marginBottom:t.message?"6px":"0"}},t.title)),t.message&&(t.dangerouslyUseHTMLString?h.push(e.h("div",{class:"x-notification__content",style:{fontSize:"14px",color:"#606266",lineHeight:"1.5"},innerHTML:t.message})):h.push(e.h("div",{class:"x-notification__content",style:{fontSize:"14px",color:"#606266",lineHeight:"1.5"}},t.message)));const M=[];return k&&M.push(e.h("div",{class:"x-notification__icon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",marginRight:"12px",color:k.color}},[e.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[e.h("path",{d:k.iconPath})])])),M.push(e.h("div",{class:"x-notification__main",style:{flex:"1"}},h)),t.showClose!==!1&&M.push(e.h("button",{class:"x-notification__close",style:{position:"absolute",top:"18px",right:"15px",background:"none",border:"none",cursor:"pointer",color:"#909399",padding:"0",display:"flex",alignItems:"center",justifyContent:"center"},onClick:f=>{f.stopPropagation(),this.close()}},[e.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[e.h("path",{d:"M6 18L18 6M6 6l12 12"})])])),e.h("div",{class:["x-notification",t.customClass],style:{...this.positionStyles,display:"flex",alignItems:"flex-start",padding:"14px 26px 14px 13px",borderRadius:"8px",backgroundColor:"#fff",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",transition:"opacity 0.3s, transform 0.3s",boxSizing:"border-box"},onMouseenter:this.clearTimer,onMouseleave:this.startTimer},M)}}),p=e.createApp(m);p.mount(r);const u={id:n,app:p,container:r,position:o,close:()=>{var k;const i=(k=p._instance)==null?void 0:k.proxy;i!=null&&i.close&&i.close()}};return D.push(u),{close:u.close}}function We(t){return Y(typeof t=="string"?{message:t}:t)}const W=t=>n=>Y({...typeof n=="string"?{message:n}:n,type:t}),U=Object.assign(We,{info:W("info"),success:W("success"),warning:W("warning"),error:W("error"),closeAll:De}),je=U,Xe={install(t){t.config.globalProperties.$notify=U,t.provide("notification",U)}},Fe=ze,qe=$e,Ue=je;exports.Alert=me;exports.Backtop=ge;exports.Drawer=te;exports.DrawerForm=ce;exports.Message=Fe;exports.MessageBox=qe;exports.MessageComponent=Be;exports.Modal=ee;exports.Notification=Ue;exports.Popconfirm=ve;exports.Result=Me;exports.TMessage=Ve;exports.TMessageBox=Ie;exports.TNotification=Xe;exports.Timeline=ke;exports.TimelineItem=ye;exports.Tooltip=de;
|