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