@extclp/vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
55 lines (54 loc) • 1.75 kB
JavaScript
import { defineComponent as v, useSlots as f, computed as a, createElementBlock as s, openBlock as l, normalizeStyle as h, normalizeClass as n, createCommentVNode as b, unref as m, renderSlot as g } from "vue";
import { useProps as x, useNameHelper as y } from "@vexip-ui/config";
import { toCssSize as _ } from "@vexip-ui/utils";
import { dividerProps as P } from "./props.mjs";
const w = /* @__PURE__ */ v({
name: "Divider",
__name: "divider",
props: P,
setup(c) {
const e = x("divider", c, {
vertical: !1,
textPosition: {
default: "center",
validator: (o) => ["center", "left", "right"].includes(o)
},
primary: !1,
dashed: !1,
margin: null
}), u = f(), t = y("divider"), i = a(() => !!u.default), d = a(() => [
t.b(),
t.bs("vars"),
t.bm(e.vertical ? "vertical" : "horizontal"),
{
[t.bm("inherit")]: e.inherit,
[t.bm("primary")]: !e.vertical && e.primary,
[t.bm("dashed")]: e.dashed,
[t.bm("with-text")]: !e.vertical && i.value,
[t.bm(`with-text-${e.textPosition}`)]: !e.vertical && i.value && e.textPosition !== "center"
}
]), r = a(() => _(e.margin)), p = a(() => r.value ? e.vertical ? {
marginRight: r.value,
marginLeft: r.value
} : {
marginTop: r.value,
marginBottom: r.value
} : {});
return (o, C) => (l(), s("div", {
class: n(d.value),
role: "separator",
style: h(p.value)
}, [
!m(e).vertical && i.value ? (l(), s("span", {
key: 0,
class: n(m(t).be("text"))
}, [
g(o.$slots, "default")
], 2)) : b("", !0)
], 6));
}
});
export {
w as default
};
//# sourceMappingURL=divider.vue2.mjs.map