dk-plus
Version:
74 lines (73 loc) • 2.17 kB
JavaScript
import { defineComponent as h, ref as p, watch as v, resolveComponent as n, resolveDirective as g, openBlock as a, createBlock as C, Transition as V, withCtx as s, createElementBlock as c, withModifiers as b, createElementVNode as e, normalizeClass as w, toDisplayString as y, createVNode as r, withDirectives as B, renderSlot as D, createTextVNode as N, createCommentVNode as x } from "vue";
const S = { class: "dk-dialog__header" }, E = {
class: "dk-dialog__body",
width: "100%",
height: "80vh"
}, T = { class: "dk-dialog__footer" }, I = /* @__PURE__ */ h({
__name: "dialog",
props: {
modelValue: {
type: Boolean,
required: !0
},
title: {
type: String,
default: "Dialog"
}
},
emits: ["update:modelValue"],
setup(d, { emit: _ }) {
const u = _, i = d, o = p(i.modelValue);
v(
() => i.modelValue,
(l) => {
o.value = l;
}
);
const t = () => {
u("update:modelValue", !1);
};
return (l, q) => {
const m = n("dk-icon"), k = n("dk-button"), f = g("dk-scroll");
return a(), C(V, { name: "dk-dialog__fade" }, {
default: s(() => [
o.value ? (a(), c("div", {
key: 0,
class: "dk-dialog",
onClick: b(t, ["self"])
}, [
e("div", {
class: w(["dk-dialog__content", { "dialog-leave-active": !o.value }])
}, [
e("header", S, [
e("h3", null, y(d.title), 1),
r(m, {
class: "dk-dialog__close-button",
icon: "IconClose",
onClick: t
})
]),
B((a(), c("main", E, [
D(l.$slots, "default", {}, void 0, !0)
])), [
[f, !0]
]),
e("footer", T, [
r(k, { onClick: t }, {
default: s(() => [
N("Close")
]),
_: 1
})
])
], 2)
])) : x("", !0)
]),
_: 3
});
};
}
});
export {
I as default
};