import{defineComponent as x,createVNode as a}from"vue";import y from"../_util/props-util/initDefaultProps.mjs";import{booleanType as b,vNodeType as o,anyType as C,functionType as N,someType as T}from"../_util/type.mjs";import $ from"../config-provider/hooks/useConfigInject.mjs";import h from"../skeleton/Skeleton.mjs";import j from"./Number.mjs";import O from"./style/index.mjs";const D=()=>({prefixCls:String,decimalSeparator:String,groupSeparator:String,format:String,value:T([Number,String,Object]),valueStyle:{type:Object,default:void 0},valueRender:N(),formatter:C(),precision:Number,prefix:o(),suffix:o(),title:o(),loading:b()}),M=x({compatConfig:{MODE:3},name:"AStatistic",inheritAttrs:!1,props:y(D(),{decimalSeparator:".",groupSeparator:",",loading:!1}),slots:Object,setup(t,{slots:i,attrs:n}){const{prefixCls:l,direction:p}=$("statistic",t),[m,d]=O(l);return()=>{const{value:S=0,valueStyle:g,valueRender:f}=t,e=l.value,s=t.title??i.title?.(),c=t.prefix??i.prefix?.(),u=t.suffix??i.suffix?.(),v=t.formatter??i.formatter;let r=a(j,{"data-for-update":Date.now(),...t,prefixCls:e,value:S,formatter:v},null);return f&&(r=f(r)),m(a("div",{...n,class:[e,{[`${e}-rtl`]:p.value==="rtl"},n.class,d.value]},[s&&a("div",{class:`${e}-title`},[s]),a(h,{paragraph:!1,loading:t.loading},{default:()=>[a("div",{style:g,class:`${e}-content`},[c&&a("span",{class:`${e}-content-prefix`},[c]),r,u&&a("span",{class:`${e}-content-suffix`},[u])])]})]))}}});export{M as default,D as statisticProps};
