@aplus-frontend/ui
Version:
80 lines (79 loc) • 2.48 kB
JavaScript
import { defineComponent as f, h as t, createVNode as e, createTextVNode as v } from "vue";
import { ApProductInfoProps as g } from "./constans.mjs";
import "../../config-provider/index.mjs";
import { ApImage as y } from "../ap-image/index.mjs";
import { ApCopy as i } from "../ap-copy/index.mjs";
import { Space as h, Tooltip as m } from "@aplus-frontend/antdv";
import { IconApAdFillWarn as b } from "@aplus-frontend/icon";
import { useNamespace as k } from "../../config-provider/hooks/use-namespace.mjs";
import { useGlobalConfig as C } from "../../config-provider/hooks/use-global-config.mjs";
const T = /* @__PURE__ */ f({
name: "ApProductInfo",
props: g(),
setup(r) {
const {
b: s,
e: o,
m: a
} = k("ap-product-info"), c = (l) => typeof l.value == "function" ? l.value() : l.helpMessage ? t(h.Compact, {}, [t(i, {
text: l.value,
link: l.link,
textStyle: l.link ? "link" : "minor"
}), t(m, {
placement: "top",
color: l.toolTipBgColor,
title: typeof l.helpMessage == "string" ? l.helpMessage : t(l.helpMessage)
}, () => t(b, {
color: "#FFA940",
style: {
cursor: "pointer"
}
}))]) : t(i, {
text: l.value,
textStyle: l.link ? "link" : "minor",
link: l.link,
disableCopy: r.disableCopy
}, l.value), p = C("uiMode");
return () => e("div", {
class: [s(), `${a(p.value)}`]
}, [e("div", {
class: o("img")
}, [e(y, {
src: r.imgSrc,
width: 44,
height: 44,
preview: r.preview
}, null)]), e("div", {
class: [o("content")]
}, [e(i, {
disableCopy: r.disableCopy
}, {
default: () => [r.title]
}), e("div", {
class: o("row-container")
}, [r.values.map((l, u) => {
const n = l.col === 2, d = l.col !== 2 && u % 2 === 0;
return e("div", {
key: JSON.stringify(l),
class: [o("row-item"), a(n ? "full" : "half")]
}, [e("div", {
class: [o("item")]
}, [l.label && e("div", {
class: o("label")
}, [l.label, e("span", null, [v(":")])]), e("div", {
class: [o("value"), !n && a("overflow")],
title: typeof l.value != "function" ? String(l.value || "") : ""
}, [c(l)])]), d && e("div", {
class: o("divider"),
style: {
right: 0
}
}, [e("div", {
class: o("divider-vertical")
}, null)])]);
})])])]);
}
});
export {
T as default
};