UNPKG

@aplus-frontend/ui

Version:

80 lines (79 loc) 1.94 kB
import { defineComponent as c, createVNode as e, Fragment as t } from "vue"; import { convertValue as n, renderValue as p, isVNodeOrFunction as d } from "../utils.mjs"; import "../../../config-provider/index.mjs"; import { useNamespace as v } from "../../../config-provider/hooks/use-namespace.mjs"; const f = /* @__PURE__ */ c({ name: "ApLadderValues", props: { labelValue: { type: Object, default: () => { } }, labelValues: { type: Object, default: () => { } }, onHandleClick: { type: Function, default: () => { } } }, setup(o, { emit: r }) { return () => { const { labelValue: l, labelValues: i } = o, { e: a } = v("ap-ladder"), s = (u) => { r("handleClick", u); }; return e(t, null, [e("span", { class: a("value-group-value"), title: String(n(l.value, { ...l })) }, [d(l.value) ? p(l.value) : l.link ? e("a", { href: l.link, target: "_blank", class: a("value-group-link"), title: String(l.value), style: l.linkColor ? { color: l.linkColor } : null, onClick: (u) => { u.preventDefault(), s(l); } }, [n(l.value, { ...l })]) : e(t, null, [e("span", { class: [l.handleValueClick ? a("value-group-link") : null], title: String(l.value), style: l.valueColor ? { color: l.valueColor } : null, onClick: () => { l.handleValueClick && l.handleValueClick(i); } }, [n(l.value, { ...l })]), l.unit && e("span", { class: a("value-group-unit"), title: String(n(l.value, { ...l })), style: l.unitColor ? { color: l.unitColor } : null }, [l.unit])])])]); }; } }); export { f as default };