UNPKG

vue-data-ui-hq

Version:

A user-empowering data visualization Vue 3 components library for eloquent data storytelling

70 lines (69 loc) 2.11 kB
import { openBlock as n, createElementBlock as o, normalizeStyle as c, renderSlot as d, Fragment as u, renderList as g, normalizeClass as m, createVNode as h, createCommentVNode as k } from "vue"; import { _ as y } from "./Shape-DNIrFW-J.js"; import { _ as v } from "./_plugin-vue_export-helper-CHgC5LLL.js"; const $ = ["id"], S = ["onClick", "height", "width"], b = { __name: "Legend", props: { legendSet: { type: Array, default() { return []; } }, config: { type: Object, default() { return {}; } }, id: { type: String, default: "" }, clickable: { type: Boolean, default: !0 } }, emits: ["clickMarker"], setup(e, { emit: r }) { const f = r; function s(i, l) { f("clickMarker", { legend: i, i: l }); } return (i, l) => (n(), o("div", { id: e.id, class: "vue-data-ui-legend", style: c(`background:${e.config.backgroundColor};font-size:${e.config.fontSize}px;color:${e.config.color};padding-bottom:${e.config.paddingBottom}px;padding-top:${e.config.paddingTop || 12}px;font-weight:${e.config.fontWeight}`) }, [ d(i.$slots, "legendTitle", { titleSet: e.legendSet }, void 0, !0), (n(!0), o(u, null, g(e.legendSet, (t, a) => (n(), o("div", { class: m({ "vue-data-ui-legend-item": !0, active: e.clickable }) }, [ t.shape ? (n(), o("svg", { key: 0, onClick: (p) => s(t, a), height: e.config.fontSize, width: e.config.fontSize, viewBox: "0 0 20 20", style: c(`overflow: visible;opacity:${t.opacity}`) }, [ h(y, { shape: t.shape, radius: 9, stroke: "none", plot: { x: 10, y: 10 }, fill: t.color }, null, 8, ["shape", "fill"]) ], 12, S)) : k("", !0), d(i.$slots, "item", { legend: t, index: a }, void 0, !0) ], 2))), 256)) ], 12, $)); } }, w = /* @__PURE__ */ v(b, [["__scopeId", "data-v-310b3d7d"]]); export { w as L };