import{defineComponent as v,computed as t,createVNode as o,Fragment as p}from"vue";import k from"../_util/props-util/initDefaultProps.mjs";import{anyType as x}from"../_util/type.mjs";import P from"../tooltip/index.mjs";import y from"../vc-progress/src/Circle.mjs";import"../vc-progress/src/Line.mjs";import{progressProps as D}from"./props.mjs";import{getSize as w,getPercentage as S,getStrokeColor as b}from"./utils.mjs";const W=()=>({...D(),strokeColor:x()}),z=3,$=e=>z/e*100,R=v({compatConfig:{MODE:3},name:"ProgressCircle",inheritAttrs:!1,props:k(W(),{trailColor:null}),setup(e,{slots:l,attrs:i}){const n=t(()=>e.width??120),s=t(()=>e.size??[n.value,n.value]),r=t(()=>w(s.value,"circle")),u=t(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type==="dashboard")return 75}),d=t(()=>({width:`${r.value.width}px`,height:`${r.value.height}px`,fontSize:`${r.value.width*.15+6}px`})),a=t(()=>e.strokeWidth??Math.max($(r.value.width),6)),g=t(()=>e.gapPosition||e.type==="dashboard"&&"bottom"||void 0),f=t(()=>S(e)),m=t(()=>Object.prototype.toString.call(e.strokeColor)==="[object Object]"),C=t(()=>b({success:e.success,strokeColor:e.strokeColor})),h=t(()=>({[`${e.prefixCls}-inner`]:!0,[`${e.prefixCls}-circle-gradient`]:m.value}));return()=>{const c=o(y,{percent:f.value,strokeWidth:a.value,trailWidth:a.value,strokeColor:C.value,strokeLinecap:e.strokeLinecap,trailColor:e.trailColor,prefixCls:e.prefixCls,gapDegree:u.value,gapPosition:g.value},null);return o("div",{...i,class:[h.value,i.class],style:[i.style,d.value]},[r.value.width<=20?o(P,null,{default:()=>[o("span",null,[c])],title:l.default}):o(p,null,[c,l.default?.()])])}}});export{W as circleProps,R as default};
