UNPKG

@aplus-frontend/ui

Version:

123 lines (122 loc) 4.2 kB
import { defineComponent as h, useSlots as E, computed as t, createVNode as r, Fragment as a, createElementBlock as F, openBlock as u, mergeProps as x, createBlock as o, createElementVNode as C, resolveDynamicComponent as s, normalizeClass as B, unref as O, createSlots as P, withCtx as d } from "vue"; import { QuestionCircleOutlined as V } from "@ant-design/icons-vue"; import { Tooltip as I, Badge as Q, Statistic as R } from "@aplus-frontend/antdv"; import { omit as T } from "lodash-unified"; import "../../../config-provider/index.mjs"; import { mergeClass as c } from "../../../editable-table/utils.mjs"; import { useNamespace as q } from "../../../config-provider/hooks/use-namespace.mjs"; const Y = /* @__PURE__ */ h({ name: "ApProCardStatistic", __name: "index", props: { prefixCls: {}, decimalSeparator: {}, groupSeparator: {}, format: {}, value: {}, valueStyle: {}, valueRender: {}, formatter: { type: [Boolean, String, Function] }, precision: {}, prefix: { type: [Object, String, Number, Boolean, null, Array], default: void 0 }, suffix: { type: [Object, String, Number, Boolean, null, Array], default: void 0 }, title: { type: [Object, String, Number, Boolean, null, Array], default: void 0 }, loading: { type: Boolean }, description: { type: [Object, String, Number, Boolean, null, Array], default: void 0 }, tip: { type: [Object, String, Number, Boolean, null, Array], default: void 0 }, status: { default: void 0 }, icon: { type: [Object, String, Number, Boolean, null, Array], default: void 0 }, layout: { default: "inline" }, trend: { default: void 0 }, size: { default: "default" } }, setup(S) { const n = E(), e = S, { b: l } = q("pro-card-statistic"), b = t(() => { const i = l(); return c(`${i}`, [e.size ? `${i}-size-${e.size}` : void 0].filter(Boolean)); }), g = t(() => l("tip")), $ = t(() => { const i = l(); return c(`${i}-trend-icon`, [e.trend ? `${i}-trend-icon-${e.trend}` : void 0].filter(Boolean)); }), D = t(() => l("status")), N = t(() => l("icon")), M = t(() => l("wrapper")), A = t(() => l("content")), j = t(() => { const i = l(); return c(`${i}-layout`, [e.layout ? `${i}-layout-${e.layout}` : void 0, e.trend ? `${i}-trend-${e.trend}` : void 0].filter(Boolean)); }), k = t(() => l("description")), f = t(() => e.tip || n.tip ? r(I, { title: e.tip ?? n.tip?.() }, { default: () => [r(V, { class: g.value }, null)] }) : void 0), p = t(() => e.trend ? r("div", { class: $.value }, null) : void 0), _ = t(() => e.status ? r(Q, { class: D.value, status: e.status }, null) : void 0), z = t(() => e.icon || n.icon ? r("div", { class: N.value }, [e.icon ?? n.icon?.()]) : void 0), m = t(() => e.title || n.title ? r(a, null, [e.title || n.title?.()]) : void 0), v = t(() => e.prefix || n.prefix ? r(a, null, [e.prefix || n.prefix?.()]) : void 0), y = t(() => e.suffix || n.suffix ? r(a, null, [e.suffix || n.suffix?.()]) : void 0), w = t(() => e.description || n.description ? r("div", { class: k.value }, [e.description || n.description?.()]) : void 0); return (i, G) => (u(), F("div", x({ ...i.$attrs }, { class: b.value }), [(u(), o(s(z.value))), C("div", { class: B(M.value) }, [(u(), o(s(_.value))), C("div", { class: B(A.value) }, [r(O(R), x({ class: j.value }, { ...O(T)(e, ["title", "prefix"]) }), P({ _: 2 }, [m.value || f.value ? { name: "title", fn: d(() => [(u(), o(s(m.value))), (u(), o(s(f.value)))]), key: "0" } : void 0, p.value || v.value ? { name: "prefix", fn: d(() => [(u(), o(s(p.value))), (u(), o(s(v.value)))]), key: "1" } : void 0, y.value ? { name: "suffix", fn: d(() => [(u(), o(s(y.value)))]), key: "2" } : void 0]), 1040, ["class"]), (u(), o(s(w.value)))], 2)], 2)], 16)); } }); export { Y as default };