UNPKG

@aplus-frontend/ui

Version:

53 lines (52 loc) 2.18 kB
import { defineComponent as S, useSlots as _, computed as s, createElementBlock as r, openBlock as i, normalizeStyle as g, normalizeClass as h, unref as l, createBlock as p, createCommentVNode as a, renderSlot as f, mergeProps as C, createSlots as $, withCtx as c, isVNode as d, resolveDynamicComponent as m, toDisplayString as u } from "vue"; import { omit as B } from "lodash-unified"; import "../../config-provider/index.mjs"; import "../ap-title/ApTitle.vue.mjs"; import N from "./style/index.mjs"; import { useNamespace as b } from "../../config-provider/hooks/use-namespace.mjs"; import z from "../ap-title/ApTitle.vue2.mjs"; const D = { key: 2 }, V = { key: 2 }, F = /* @__PURE__ */ S({ __name: "ApCard", props: { titleProps: {}, padding: {} }, setup(x) { const e = x, t = _(), { b: n } = b("ap-card"), P = N("ap-card"), y = s( () => B(e?.titleProps || {}, ["prefix", "suffix"]) ), k = s(() => Object.keys(e?.titleProps || {})?.length), v = s(() => e.padding ?? "var(--ap-card-padding, 12px 16px)"); return (o, j) => (i(), r("div", { class: h([l(n)(), l(P)]), style: g({ padding: v.value }) }, [ k.value || t?.titlePrefix || t?.titleSuffix ? (i(), p(z, C({ key: 0, class: [`${l(n)()}-title`] }, { ...y.value }), $({ _: 2 }, [ t?.titleSuffix || e?.titleProps?.suffix ? { name: "suffix", fn: c(() => [ t?.titleSuffix ? f(o.$slots, "titleSuffix", { key: 0 }) : d(e?.titleProps?.suffix) ? (i(), p(m(e?.titleProps?.suffix), { key: 1 })) : (i(), r("div", D, u(e?.titleProps?.suffix), 1)) ]), key: "0" } : void 0, t?.titlePrefix || e?.titleProps?.prefix ? { name: "prefix", fn: c(() => [ t?.titlePrefix ? f(o.$slots, "titlePrefix", { key: 0 }) : a("", !0), d(e?.titleProps?.prefix) ? (i(), p(m(e?.titleProps?.prefix), { key: 1 })) : (i(), r("div", V, u(e?.titleProps?.prefix), 1)) ]), key: "1" } : void 0 ]), 1040, ["class"])) : a("", !0), f(o.$slots, "default") ], 6)); } }); export { F as default };