vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
89 lines (88 loc) • 2.83 kB
JavaScript
import { createElementBlock as l, openBlock as n, Fragment as f, createElementVNode as p, createCommentVNode as o, normalizeStyle as d, unref as e, toDisplayString as g, renderSlot as r } from "vue";
import { a as s } from "./useNestedProp-2p4Tjzc8.js";
const b = {
__name: "Title",
props: {
config: {
type: Object,
default() {
return {};
}
},
lineHeight: {
type: [String, Boolean],
default: !1
}
},
setup(i) {
const t = s({
userConfig: i.config,
defaultConfig: {
title: {
cy: "",
text: "",
color: "",
fontSize: 20,
bold: !0,
textAlign: "center",
paddingLeft: 0,
paddingRight: 0
},
subtitle: {
cy: "",
text: "",
color: "",
fontSize: 14,
bold: !1
}
}
});
return (a, u) => (n(), l(f, null, [
p("div", {
class: "atom-title",
style: d({
width: `calc(100% - ${e(t).title.paddingLeft + e(t).title.paddingRight}px)`,
textAlign: e(t).title.textAlign,
color: e(t).title.color,
fontSize: `var(--title-font-size, ${e(t).title.fontSize}px)`,
fontWeight: e(t).title.bold ? "bold" : "",
paddingLeft: e(t).title.paddingLeft + "px",
paddingRight: e(t).title.paddingRight + "px",
lineHeight: i.lineHeight ? i.lineHeight : void 0
})
}, g(e(t).title.text), 5),
e(t).subtitle.text ? (n(), l("div", {
key: 0,
class: "atom-subtitle",
style: d({
width: `calc(100% - ${e(t).title.paddingLeft + e(t).title.paddingRight}px)`,
textAlign: e(t).title.textAlign,
color: e(t).subtitle.color,
fontSize: `var(--subtitle-font-size, ${e(t).subtitle.fontSize}px)`,
fontWeight: e(t).subtitle.bold ? "bold" : "",
paddingLeft: e(t).title.paddingLeft + "px",
paddingRight: e(t).title.paddingRight + "px",
lineHeight: i.lineHeight ? i.lineHeight : void 0
})
}, g(e(t).subtitle.text), 5)) : o("", !0),
e(t).subtitle.text ? (n(), l("div", {
key: 1,
style: d({
width: `calc(100% - ${e(t).title.paddingLeft + e(t).title.paddingRight}px)`,
textAlign: e(t).title.textAlign,
color: e(t).subtitle.color,
fontSize: `var(--subtitle-font-size, ${e(t).subtitle.fontSize}px)`,
fontWeight: e(t).subtitle.bold ? "bold" : "",
paddingLeft: e(t).title.paddingLeft + "px",
paddingRight: e(t).title.paddingRight + "px",
lineHeight: i.lineHeight ? i.lineHeight : void 0
})
}, [
r(a.$slots, "default")
], 4)) : o("", !0)
], 64));
}
};
export {
b as default
};