adverich-kun-ui 0.1.261 → 0.1.262
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.
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as x, watch as C, onMounted as f, onBeforeUnmount as S, onUnmounted as k, createBlock as u, openBlock as o, Teleport as P, createVNode as a, Transition as m, withCtx as n, createElementBlock as B, createCommentVNode as y, mergeProps as V, renderSlot as E } from "vue";
|
|
2
2
|
import W from "./KunDialogOverlay.vue.js";
|
|
3
3
|
import $ from "./KunDialogContent.vue.js";
|
|
4
|
-
const
|
|
4
|
+
const D = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
|
|
5
5
|
__name: "KunDialog",
|
|
6
6
|
props: {
|
|
7
7
|
modelValue: Boolean,
|
|
8
|
-
teleport: { type: Boolean, default: !0 },
|
|
9
8
|
overlay: { type: Boolean, default: !0 },
|
|
10
9
|
fullscreen: { type: Boolean, default: !1 },
|
|
11
10
|
scrollable: { type: Boolean, default: !1 },
|
|
@@ -33,18 +32,18 @@ const H = "fixed inset-0 z-250 flex", U = /* @__PURE__ */ C({
|
|
|
33
32
|
},
|
|
34
33
|
emits: ["update:modelValue"],
|
|
35
34
|
setup(e, { emit: h }) {
|
|
36
|
-
const t = e, i = h, g = "justify-" + t.xPosition, p = "items-" + t.yPosition, w = t.yPosition === "top" ? "pt-15" : t.yPosition === "bottom" ? "pb-15" : "",
|
|
35
|
+
const t = e, i = h, g = "justify-" + t.xPosition, p = "items-" + t.yPosition, w = t.yPosition === "top" ? "pt-15" : t.yPosition === "bottom" ? "pb-15" : "", b = [D, t.dialogClass, g, p, w], s = () => {
|
|
37
36
|
t.persistent || i("update:modelValue", !1);
|
|
38
|
-
},
|
|
37
|
+
}, v = () => {
|
|
39
38
|
s();
|
|
40
39
|
}, r = () => {
|
|
41
40
|
document.body.style.overflow = "hidden";
|
|
42
41
|
}, d = () => {
|
|
43
42
|
document.body.style.overflow = "";
|
|
44
43
|
};
|
|
45
|
-
|
|
44
|
+
C(() => t.modelValue, (l) => {
|
|
46
45
|
l && !t.fullscreen ? r() : d();
|
|
47
|
-
}),
|
|
46
|
+
}), f(() => {
|
|
48
47
|
t.modelValue && !t.fullscreen && r();
|
|
49
48
|
}), S(() => {
|
|
50
49
|
d();
|
|
@@ -52,67 +51,62 @@ const H = "fixed inset-0 z-250 flex", U = /* @__PURE__ */ C({
|
|
|
52
51
|
function c(l) {
|
|
53
52
|
l.stopPropagation(), l.key === "Escape" && (t.persistent || i("update:modelValue", !1));
|
|
54
53
|
}
|
|
55
|
-
return
|
|
54
|
+
return f(() => {
|
|
56
55
|
window.addEventListener("keydown", c);
|
|
57
56
|
}), k(() => {
|
|
58
57
|
window.removeEventListener("keydown", c);
|
|
59
|
-
}), (l,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
}), (l, H) => (o(), u(P, { to: "body" }, [
|
|
59
|
+
a(m, {
|
|
60
|
+
name: "fade",
|
|
61
|
+
appear: ""
|
|
62
|
+
}, {
|
|
63
|
+
default: n(() => [
|
|
64
|
+
e.modelValue ? (o(), B("div", V({
|
|
65
|
+
key: 0,
|
|
66
|
+
class: b
|
|
67
|
+
}, l.$attrs), [
|
|
68
|
+
e.overlay ? (o(), u(W, {
|
|
69
69
|
key: 0,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
]),
|
|
109
|
-
_: 3
|
|
110
|
-
})
|
|
111
|
-
]),
|
|
112
|
-
_: 3
|
|
113
|
-
}, 8, ["to"]));
|
|
70
|
+
persistent: e.persistent,
|
|
71
|
+
onClick: v
|
|
72
|
+
}, null, 8, ["persistent"])) : y("", !0),
|
|
73
|
+
a(m, {
|
|
74
|
+
name: "scale",
|
|
75
|
+
"enter-active-class": "transition transform ease-out duration-300",
|
|
76
|
+
"enter-from-class": "opacity-0 scale-95",
|
|
77
|
+
"enter-to-class": "opacity-100 scale-100",
|
|
78
|
+
"leave-active-class": "transition transform ease-in duration-200",
|
|
79
|
+
"leave-from-class": "opacity-100 scale-100",
|
|
80
|
+
"leave-to-class": "opacity-0 scale-95"
|
|
81
|
+
}, {
|
|
82
|
+
default: n(() => [
|
|
83
|
+
a($, {
|
|
84
|
+
fullscreen: e.fullscreen,
|
|
85
|
+
scrollable: e.scrollable,
|
|
86
|
+
"min-width": e.minWidth,
|
|
87
|
+
width: e.width,
|
|
88
|
+
"max-width": e.maxWidth,
|
|
89
|
+
height: e.height,
|
|
90
|
+
"max-height": e.maxHeigh,
|
|
91
|
+
"bg-color": e.bgColor,
|
|
92
|
+
"content-class": e.contentClass,
|
|
93
|
+
onClose: s
|
|
94
|
+
}, {
|
|
95
|
+
default: n(() => [
|
|
96
|
+
E(l.$slots, "default")
|
|
97
|
+
]),
|
|
98
|
+
_: 3
|
|
99
|
+
}, 8, ["fullscreen", "scrollable", "min-width", "width", "max-width", "height", "max-height", "bg-color", "content-class"])
|
|
100
|
+
]),
|
|
101
|
+
_: 3
|
|
102
|
+
})
|
|
103
|
+
], 16)) : y("", !0)
|
|
104
|
+
]),
|
|
105
|
+
_: 3
|
|
106
|
+
})
|
|
107
|
+
]));
|
|
114
108
|
}
|
|
115
109
|
});
|
|
116
110
|
export {
|
|
117
|
-
|
|
111
|
+
T as default
|
|
118
112
|
};
|