@aplus-frontend/ui
Version:
124 lines (123 loc) • 3.82 kB
JavaScript
import { defineComponent as O, useSlots as N, computed as r, createVNode as a, mergeProps as f, createBlock as s, openBlock as u, createSlots as _, withCtx as m, createCommentVNode as y, renderSlot as h, resolveDynamicComponent as v, renderList as $, unref as A } from "vue";
import "../../../config-provider/index.mjs";
import "../card/index.vue.mjs";
import "../statistic/index.vue.mjs";
import { mergeClass as b } from "../../../editable-table/utils.mjs";
import { omit as j } from "lodash-unified";
import { useNamespace as P } from "../../../config-provider/hooks/use-namespace.mjs";
import D from "../statistic/index.vue2.mjs";
import k from "../card/index.vue2.mjs";
const G = /* @__PURE__ */ O({
name: "ApStatisticCard",
__name: "index",
props: {
headStyle: {},
bodyStyle: {},
actionsStyle: {},
headerBordered: {
type: Boolean
},
title: {
type: [Object, String, Number, Boolean, null, Array]
},
tooltip: {
type: [Object, String, Number, Boolean, null, Array]
},
extra: {
type: [Object, String, Number, Boolean, null, Array]
},
layout: {},
type: {},
direction: {},
wrap: {
type: Boolean
},
loading: {
type: [Boolean, Object, String, Number, null, Array]
},
colSpan: {},
colStyle: {},
gutter: {},
actions: {
type: [Object, String, Number, Boolean, null, Array]
},
split: {},
bordered: {
type: Boolean
},
hoverable: {
type: Boolean
},
ghost: {
type: Boolean
},
collapsible: {
type: Boolean
},
defaultCollapsed: {
type: Boolean
},
collapsed: {
type: Boolean,
default: void 0
},
collapsibleIconRender: {},
boxShadow: {
type: Boolean
},
chart: {
type: [Object, String, Number, Boolean, null, Array]
},
statistic: {},
chartPlacement: {},
footer: {
type: [Object, String, Number, Boolean, null, Array]
}
},
setup(B) {
const t = B, e = N(), {
b: n
} = P("statistic-card"), S = r(() => n()), g = r(() => {
const o = n("chart");
return b(`${o}`, [t.chartPlacement === "left" ? `${o}-left` : void 0, t.chartPlacement === "right" ? `${o}-right` : void 0].filter(Boolean));
}), p = r(() => {
const o = n("content");
return b(`${o}`, [t.chartPlacement === "left" || t.chartPlacement === "right" ? `${o}-horizontal` : void 0].filter(Boolean));
}), C = r(() => n("footer")), l = r(() => t.statistic ? a(D, f({
layout: "vertical"
}, t.statistic, {
title: t.statistic?.title || e.statisticTitle?.(),
prefix: t.statistic?.prefix || e.prefix?.(),
suffix: t.statistic?.suffix || e.suffix?.(),
icon: t.statistic?.icon || e.icon?.(),
tip: t.statistic?.tip || e.tip?.(),
description: t.statistic?.description || e.description?.()
}), null) : void 0), i = r(() => t.chart || e.chart ? a("div", {
class: g.value
}, [t.chart || e.chart?.()]) : void 0), c = r(() => i.value || l.value ? t.chartPlacement === "left" ? a("div", {
class: p.value
}, [i.value, l.value]) : a("div", {
class: p.value
}, [l.value, i.value]) : void 0), x = r(() => t.footer || e.footer ? a("div", {
class: C.value
}, [t.footer || e.footer?.()]) : void 0);
return (o, M) => (u(), s(k, f({
class: S.value
}, {
...t
}), _({
default: m(() => [c.value ? (u(), s(v(c.value), {
key: 0
})) : y("", !0), h(o.$slots, "default"), c.value ? (u(), s(v(x.value), {
key: 1
})) : y("", !0)]),
_: 2
}, [$(A(j)(e, ["chart", "footer", "description", "default"]), (w, d) => ({
name: d,
fn: m(() => [h(o.$slots, d)])
}))]), 1040, ["class"]));
}
});
export {
G as default
};