UNPKG

@aplus-frontend/ui

Version:

39 lines (38 loc) 1.25 kB
import { defineComponent as f, computed as t, createVNode as i } from "vue"; import "../../config-provider/index.mjs"; import s from "./components/SimpleMode.mjs"; import p from "./components/ValueGroupMode.mjs"; import { ApLadderProps as k } from "./constans.mjs"; import b from "./style/index.mjs"; import { useNamespace as h } from "../../config-provider/hooks/use-namespace.mjs"; const M = /* @__PURE__ */ f({ name: "ApLadder", props: k(), setup(e, { slots: n }) { const { b: o } = h("ap-ladder"), d = b("ap-ladder"), r = t(() => e.labelValues === void 0 || e.labelValues.length === 0), u = t(() => e.labelValues.length > 0), m = t(() => e.labelAlign), c = (l) => { l.link && window.open(l.link, "_blank"), typeof l.handleClickLink == "function" && l.handleClickLink(); }, a = () => n.title?.() || null; return () => i("div", { class: [o(), d.value] }, [r.value ? i(s, { major: e.major, minor: e.minor, layout: e.layout }, { title: n.title ? a : void 0 }) : u.value ? i(p, { labelValues: e.labelValues || [], labelAlign: m.value, onHandleClick: c }, { title: n.title ? a : void 0 }) : null]); } }); export { M as default };