geekin-devtoys 0.2.14 → 0.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("vue"),ft=require("../_plugin-vue_export-helper-BHFhmbuH.js"),ut={class:"g-pie3d-tooltip__default"},pt={class:"g-pie3d-tooltip__name"},vt={class:"g-pie3d-tooltip__value"},gt=260,yt=c.defineComponent({__name:"index",props:{data:{default:()=>[]},config:{default:()=>({})},animation:{type:Boolean,default:!0}},emits:["slice-click"],setup(H,{emit:nt}){const P=H,at=nt,V={alpha:55,depth:26,startAngle:0,colors:["#22d3ee","#3b82f6","#8b5cf6","#06b6d4","#0ea5e9","#a855f7","#14b8a6"],textColor:"#cbd5e1",radiusRatio:.55,hoverDistance:14,showLabel:!0,showPercent:!0,labelFontSize:12,opacity:.7,showAura:!0,glowColor:"",labelLineColor:"auto",labelLineWidth:1},n={...V,...P.config},R=c.ref(null),S=c.ref(null);let E=null,C=0,_=0,L=1,v=0,p=0,g=0,x=0,M=[],B=P.animation?0:1,Y=null,N=P.animation,k=null,X=0;const W=c.ref(-1),$=c.ref(!1),U=c.ref(0),J=c.ref(0),I=c.ref(null),q=c.ref(0),K=t=>t*Math.PI/180,O=(t,s=0,a=0)=>({x:v+s+g*Math.cos(t),y:p+a+x*Math.sin(t)}),j=(t,s=0,a=0)=>({x:v+s+g*Math.cos(t),y:p+a+x*Math.sin(t)+n.depth}),F=()=>{if(!S.value||!R.value)return;const t=R.value,s=S.value;L=window.devicePixelRatio||1,C=t.clientWidth,_=t.clientHeight,s.width=C*L,s.height=_*L,s.style.width=C+"px",s.style.height=_+"px",E=s.getContext("2d"),E&&E.setTransform(L,0,0,L,0,0),v=C/2,p=_/2-n.depth/2;const a=n.showLabel?60:10,h=Math.min(C,_-n.depth-a)/2*n.radiusRatio*1.6;g=Math.max(20,h),x=g*Math.cos(K(n.alpha)),lt(),N?st():G()},lt=()=>{M=[];const t=P.data.reduce((a,h)=>a+(h.value||0),0);if(t<=0)return;let s=-Math.PI/2+K(n.startAngle);P.data.forEach((a,h)=>{const i=a.value/t,f=i*Math.PI*2;M.push({data:a,index:h,color:a.color||n.colors[h%n.colors.length],startA:s,endA:s+f,midA:s+f/2,percent:i,hover:!1,hoverProgress:0}),s+=f})},st=()=>{B=0;const t=800,s=performance.now(),a=h=>{const i=Math.min(1,(h-s)/t);B=1-Math.pow(1-i,3),G(),i<1?Y=requestAnimationFrame(a):(N=!1,Y=null)};Y=requestAnimationFrame(a)},Q=t=>1-Math.pow(1-t,3),Z=t=>{const s=X===0?16:t-X;X=t;const a=s/gt;let h=!1;for(const i of M){const f=i.hover?1:0;if(i.hoverProgress===f)continue;const e=f>i.hoverProgress?1:-1;i.hoverProgress+=e*a,(e>0&&i.hoverProgress>=f||e<0&&i.hoverProgress<=f)&&(i.hoverProgress=f),i.hoverProgress!==f&&(h=!0)}G(),h?k=requestAnimationFrame(Z):(k=null,X=0)},tt=()=>{k==null&&(X=0,k=requestAnimationFrame(Z))},T=(t,s)=>{let a=t.replace("#","");a.length===3&&(a=a.split("").map(e=>e+e).join(""));const h=parseInt(a.slice(0,2),16),i=parseInt(a.slice(2,4),16),f=parseInt(a.slice(4,6),16);return`rgba(${h},${i},${f},${s})`},G=()=>{if(!E)return;const t=E;if(t.clearRect(0,0,C,_),!M.length)return;const s=M[0]?.startA??0,a=Math.PI*2*B,h=s+a,i=M.map(e=>{const l=e.startA,d=Math.min(e.endA,h),u=d>l,y=Q(Math.max(0,Math.min(1,e.hoverProgress))),w=Math.cos(e.midA)*n.hoverDistance*y,b=Math.sin(e.midA)*n.hoverDistance*y;return{...e,startA:l,endA:d,valid:u,ox:w,oy:b,hp:y}});if(n.showAura){const e=t.createRadialGradient(v,p+n.depth,g*.1,v,p+n.depth,g*1.5);e.addColorStop(0,"rgba(6,182,212,0.15)"),e.addColorStop(.4,"rgba(59,130,246,0.08)"),e.addColorStop(.8,"rgba(139,92,246,0.03)"),e.addColorStop(1,"rgba(0,0,0,0)"),t.beginPath(),t.ellipse(v,p+n.depth,g*1.5,x*.9,0,0,Math.PI*2),t.fillStyle=e,t.fill(),t.strokeStyle="rgba(56,189,248,0.08)",t.lineWidth=1;for(let l=3;l>=1;l--){const d=g*(.3+l*.25);t.beginPath(),t.ellipse(v,p+n.depth,d,d*(x/g),0,0,Math.PI*2),t.stroke()}}const f=Math.PI/120;for(const e of i){if(!e.valid)continue;let l=e.startA;const d=n.glowColor||e.color;for(;l<e.endA;){const u=Math.min(l+f,e.endA),y=(l+u)/2;if(Math.sin(y)>0){const w=O(l,e.ox,e.oy),b=O(u,e.ox,e.oy),o=j(u,e.ox,e.oy),m=j(l,e.ox,e.oy);t.fillStyle=T(d,n.opacity*.4),t.beginPath(),t.moveTo(w.x,w.y),t.lineTo(b.x,b.y),t.lineTo(o.x,o.y),t.lineTo(m.x,m.y),t.closePath(),t.fill(),t.strokeStyle=T(d,.7),t.lineWidth=.8,t.beginPath(),t.moveTo(m.x,m.y),t.lineTo(o.x,o.y),t.stroke()}l=u}}for(const e of i){if(!e.valid)continue;const l=[];Math.sin(e.startA)>.001&&l.push({a:e.startA}),Math.sin(e.endA)>.001&&l.push({a:e.endA});const d=n.glowColor||e.color;for(const u of l){const y={x:v+e.ox,y:p+e.oy},w={x:y.x,y:y.y+n.depth},b=O(u.a,e.ox,e.oy),o=j(u.a,e.ox,e.oy);t.fillStyle=T(d,n.opacity*.5),t.beginPath(),t.moveTo(y.x,y.y),t.lineTo(b.x,b.y),t.lineTo(o.x,o.y),t.lineTo(w.x,w.y),t.closePath(),t.fill(),t.strokeStyle=T(d,.8),t.lineWidth=.8,t.beginPath(),t.moveTo(b.x,b.y),t.lineTo(o.x,o.y),t.stroke()}}for(const e of i){if(!e.valid)continue;const l=n.glowColor||e.color;e.hp>.01&&(t.save(),t.shadowColor=l,t.shadowBlur=12*e.hp,t.beginPath(),t.moveTo(v+e.ox,p+e.oy),t.ellipse(v+e.ox,p+e.oy,g,x,0,e.startA,e.endA),t.closePath(),t.fillStyle=T(l,.08*e.hp),t.fill(),t.restore()),t.beginPath(),t.moveTo(v+e.ox,p+e.oy),t.ellipse(v+e.ox,p+e.oy,g,x,0,e.startA,e.endA),t.closePath();const d=t.createRadialGradient(v+e.ox-g*.2,p+e.oy-x*.2,0,v+e.ox,p+e.oy,g*1.05);d.addColorStop(0,T(l,n.opacity*.95)),d.addColorStop(.6,T(l,n.opacity*.8)),d.addColorStop(1,T(l,n.opacity*.6)),t.fillStyle=d,t.fill(),t.strokeStyle=T(l,.95),t.lineWidth=.8+.6*e.hp,t.stroke()}if(n.showLabel&&B>=.999){t.font=`${n.labelFontSize}px Arial, sans-serif`,t.textBaseline="middle";const e=[],l=[],d=n.labelFontSize+6,u=14,y=4;for(const o of i){if(!o.valid)continue;const m=Math.cos(o.midA)>=0,A=v+o.ox+g*1.02*Math.cos(o.midA),r=p+o.oy+x*1.02*Math.sin(o.midA),z=p+o.oy+x*1.18*Math.sin(o.midA),ct=n.showPercent?`${o.data.name} ${(o.percent*100).toFixed(1)}%`:`${o.data.name}`,ht=!n.labelLineColor||n.labelLineColor==="auto"?n.glowColor||o.color:n.labelLineColor,dt={slice:o,text:ct,isRight:m,anchorX:A,anchorY:r,targetY:z,y:z,color:ht};(m?l:e).push(dt)}const w=o=>{if(!o.length)return;o.sort((r,z)=>r.targetY-z.targetY);const m=y+n.labelFontSize/2,A=_-y-n.labelFontSize/2;for(let r=0;r<o.length;r++)r===0?o[r].y=Math.max(m,o[r].targetY):o[r].y=Math.max(o[r].targetY,o[r-1].y+d);if(o[o.length-1].y>A){o[o.length-1].y=A;for(let r=o.length-2;r>=0;r--)o[r].y>o[r+1].y-d&&(o[r].y=o[r+1].y-d)}for(let r=0;r<o.length;r++)o[r].y<m&&(o[r].y=m)};w(e),w(l),t.lineWidth=n.labelLineWidth;const b=[...e,...l];for(const o of b){const m=t.measureText(o.text).width;let A;if(o.isRight){const r=Math.min(Math.max(o.anchorX+6,o.anchorX+Math.abs(o.targetY-o.y)*.2+6),C-y-m-u);A=r+u,t.strokeStyle=o.color,t.beginPath(),t.moveTo(o.anchorX,o.anchorY),t.lineTo(r,o.y),t.lineTo(A,o.y),t.stroke(),t.fillStyle=n.textColor,t.textAlign="left",t.fillText(o.text,A+2,o.y)}else{const r=Math.max(Math.min(o.anchorX-6,o.anchorX-Math.abs(o.targetY-o.y)*.2-6),y+m+u);A=r-u,t.strokeStyle=o.color,t.beginPath(),t.moveTo(o.anchorX,o.anchorY),t.lineTo(r,o.y),t.lineTo(A,o.y),t.stroke(),t.fillStyle=n.textColor,t.textAlign="right",t.fillText(o.text,A-2,o.y)}}}},et=(t,s)=>{for(let a=0;a<M.length;a++){const h=M[a],i=Q(Math.max(0,Math.min(1,h.hoverProgress))),f=Math.cos(h.midA)*n.hoverDistance*i,e=Math.sin(h.midA)*n.hoverDistance*i,l=(t-(v+f))/g,d=(s-(p+e))/x;if(l*l+d*d>1)continue;let u=Math.atan2((s-(p+e))/x,(t-(v+f))/g);for(;u<h.startA;)u+=Math.PI*2;for(;u>h.startA+Math.PI*2;)u-=Math.PI*2;if(u>=h.startA&&u<=h.endA)return a}return-1},it=t=>{if(!S.value)return;const s=S.value.getBoundingClientRect(),a=t.clientX-s.left,h=t.clientY-s.top,i=et(a,h);if(i!==W.value&&(W.value=i,M.forEach((f,e)=>f.hover=e===i),tt()),i>=0){const f=M[i];$.value=!0,I.value=f.data,q.value=f.percent;const e=R.value?.clientWidth||0,l=R.value?.clientHeight||0,d=Math.min(a+12,e-140),u=Math.min(h+12,l-60);U.value=Math.max(0,d),J.value=Math.max(0,u)}else $.value=!1,I.value=null},rt=()=>{W.value!==-1&&(W.value=-1,M.forEach(t=>t.hover=!1),tt()),$.value=!1,I.value=null},ot=t=>{if(!S.value)return;const s=S.value.getBoundingClientRect(),a=et(t.clientX-s.left,t.clientY-s.top);a>=0&&at("slice-click",M[a].data,a)};return c.watch(()=>P.data,()=>{Object.assign(n,V,P.config),N=P.animation,F()},{deep:!0}),c.watch(()=>P.config,()=>{Object.assign(n,V,P.config),F()},{deep:!0}),c.onMounted(()=>{F(),window.addEventListener("resize",F),S.value?.addEventListener("click",ot)}),c.onUnmounted(()=>{window.removeEventListener("resize",F),S.value?.removeEventListener("click",ot),Y&&cancelAnimationFrame(Y),k&&cancelAnimationFrame(k)}),(t,s)=>(c.openBlock(),c.createElementBlock("div",{class:"g-pie3d-container",ref_key:"containerRef",ref:R},[c.createElementVNode("canvas",{ref_key:"canvasRef",ref:S,onMousemove:it,onMouseleave:rt},null,544),$.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:"g-pie3d-tooltip",style:c.normalizeStyle({left:`${U.value}px`,top:`${J.value}px`})},[c.renderSlot(t.$slots,"tooltip",{data:I.value,percent:q.value},()=>[c.createElementVNode("div",ut,[c.createElementVNode("p",pt,c.toDisplayString(I.value?.name),1),c.createElementVNode("p",vt,c.toDisplayString(I.value?.value)+" ("+c.toDisplayString((q.value*100).toFixed(1))+"%) ",1)])],!0)],4)):c.createCommentVNode("",!0)],512))}}),D=ft._export_sfc(yt,[["__scopeId","data-v-bf418cec"]]);D.install=H=>{H.component(D.name,D)};exports.GPie3D=D;exports.default=D;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("vue"),pt=require("../_plugin-vue_export-helper-BHFhmbuH.js"),vt={class:"g-pie3d-tooltip__default"},gt={class:"g-pie3d-tooltip__name"},yt={class:"g-pie3d-tooltip__value"},mt=260,xt=h.defineComponent({__name:"index",props:{data:{default:()=>[]},config:{default:()=>({})},animation:{type:Boolean,default:!0}},emits:["slice-click"],setup(V,{emit:at}){const S=V,lt=at,N={alpha:55,depth:26,startAngle:0,colors:["#22d3ee","#3b82f6","#8b5cf6","#06b6d4","#0ea5e9","#a855f7","#14b8a6"],textColor:"#cbd5e1",radiusRatio:.55,hoverDistance:14,showLabel:!0,showPercent:!0,labelFontSize:12,opacity:.7,showAura:!0,glowColor:"",labelLineColor:"auto",labelLineWidth:1},a={...N,...S.config},E=h.ref(null),C=h.ref(null);let L=null,_=0,k=0,Y=1,p=0,u=0,g=0,M=0,A=[],B=S.animation?0:1,F=null,q=S.animation,I=null,X=0;const D=h.ref(-1),H=h.ref(!1),J=h.ref(0),K=h.ref(0),R=h.ref(null),O=h.ref(0),Q=t=>t*Math.PI/180,j=(t,l=0,n=0)=>({x:p+l+g*Math.cos(t),y:u+n+M*Math.sin(t)}),G=(t,l=0,n=0)=>({x:p+l+g*Math.cos(t),y:u+n+M*Math.sin(t)+a.depth}),W=()=>{if(!C.value||!E.value)return;const t=E.value,l=C.value;Y=window.devicePixelRatio||1,_=t.clientWidth,k=t.clientHeight,l.width=_*Y,l.height=k*Y,l.style.width=_+"px",l.style.height=k+"px",L=l.getContext("2d"),L&&L.setTransform(Y,0,0,Y,0,0),p=_/2,u=k/2-a.depth/2;const n=a.showLabel?60:10,s=Math.min(_,k-a.depth-n)/2*a.radiusRatio*1.6;g=Math.max(20,s),M=g*Math.cos(Q(a.alpha)),it(),q?st():U()},it=()=>{A=[];const t=S.data.reduce((n,s)=>n+(s.value||0),0);if(t<=0)return;let l=-Math.PI/2+Q(a.startAngle);S.data.forEach((n,s)=>{const i=n.value/t,d=i*Math.PI*2;A.push({data:n,index:s,color:n.color||a.colors[s%a.colors.length],startA:l,endA:l+d,midA:l+d/2,percent:i,hover:!1,hoverProgress:0}),l+=d})},st=()=>{B=0;const t=800,l=performance.now(),n=s=>{const i=Math.min(1,(s-l)/t);B=1-Math.pow(1-i,3),U(),i<1?F=requestAnimationFrame(n):(q=!1,F=null)};F=requestAnimationFrame(n)},rt=t=>1-Math.pow(1-t,3),Z=t=>{const l=X===0?16:t-X;X=t;const n=l/mt;let s=!1;for(const i of A){const d=i.hover?1:0;if(i.hoverProgress===d)continue;const v=d>i.hoverProgress?1:-1;i.hoverProgress+=v*n,(v>0&&i.hoverProgress>=d||v<0&&i.hoverProgress<=d)&&(i.hoverProgress=d),i.hoverProgress!==d&&(s=!0)}U(),s?I=requestAnimationFrame(Z):(I=null,X=0)},tt=()=>{I==null&&(X=0,I=requestAnimationFrame(Z))},T=(t,l)=>{let n=t.replace("#","");n.length===3&&(n=n.split("").map(v=>v+v).join(""));const s=parseInt(n.slice(0,2),16),i=parseInt(n.slice(2,4),16),d=parseInt(n.slice(4,6),16);return`rgba(${s},${i},${d},${l})`},U=()=>{if(!L)return;const t=L;if(t.clearRect(0,0,_,k),!A.length)return;const l=A[0]?.startA??0,n=Math.PI*2*B,s=l+n,i=A.map(e=>{const c=e.startA,f=Math.min(e.endA,s),y=f>c,x=rt(Math.max(0,Math.min(1,e.hoverProgress))),b=Math.cos(e.midA)*a.hoverDistance*x,P=Math.sin(e.midA)*a.hoverDistance*x;return{...e,startA:c,endA:f,valid:y,ox:b,oy:P,hp:x}});if(a.showAura){const e=t.createRadialGradient(p,u+a.depth,g*.1,p,u+a.depth,g*1.5);e.addColorStop(0,"rgba(6,182,212,0.15)"),e.addColorStop(.4,"rgba(59,130,246,0.08)"),e.addColorStop(.8,"rgba(139,92,246,0.03)"),e.addColorStop(1,"rgba(0,0,0,0)"),t.beginPath(),t.ellipse(p,u+a.depth,g*1.5,M*.9,0,0,Math.PI*2),t.fillStyle=e,t.fill(),t.strokeStyle="rgba(56,189,248,0.08)",t.lineWidth=1;for(let c=3;c>=1;c--){const f=g*(.3+c*.25);t.beginPath(),t.ellipse(p,u+a.depth,f,f*(M/g),0,0,Math.PI*2),t.stroke()}}const d=(e,c)=>{const f=a.glowColor||e.color,y={x:p+e.ox,y:u+e.oy},x={x:y.x,y:y.y+a.depth},b=j(c,e.ox,e.oy),P=G(c,e.ox,e.oy);t.fillStyle=T(f,a.opacity*.5),t.beginPath(),t.moveTo(y.x,y.y),t.lineTo(b.x,b.y),t.lineTo(P.x,P.y),t.lineTo(x.x,x.y),t.closePath(),t.fill(),t.strokeStyle=T(f,.8),t.lineWidth=.8,t.beginPath(),t.moveTo(b.x,b.y),t.lineTo(P.x,P.y),t.stroke()};for(const e of i)e.valid&&(Math.sin(e.startA)<=.001&&d(e,e.startA),Math.sin(e.endA)<=.001&&d(e,e.endA));const v=Math.PI/120;for(const e of i){if(!e.valid)continue;let c=e.startA;const f=a.glowColor||e.color;for(;c<e.endA;){const y=Math.min(c+v,e.endA),x=(c+y)/2;if(Math.sin(x)>0){const b=j(c,e.ox,e.oy),P=j(y,e.ox,e.oy),o=G(y,e.ox,e.oy),m=G(c,e.ox,e.oy);t.fillStyle=T(f,a.opacity*.4),t.beginPath(),t.moveTo(b.x,b.y),t.lineTo(P.x,P.y),t.lineTo(o.x,o.y),t.lineTo(m.x,m.y),t.closePath(),t.fill(),t.strokeStyle=T(f,.7),t.lineWidth=.8,t.beginPath(),t.moveTo(m.x,m.y),t.lineTo(o.x,o.y),t.stroke()}c=y}}for(const e of i)e.valid&&(Math.sin(e.startA)>.001&&d(e,e.startA),Math.sin(e.endA)>.001&&d(e,e.endA));for(const e of i){if(!e.valid)continue;const c=a.glowColor||e.color;e.hp>.01&&(t.save(),t.shadowColor=c,t.shadowBlur=12*e.hp,t.beginPath(),t.moveTo(p+e.ox,u+e.oy),t.ellipse(p+e.ox,u+e.oy,g,M,0,e.startA,e.endA),t.closePath(),t.fillStyle=T(c,.08*e.hp),t.fill(),t.restore()),t.beginPath(),t.moveTo(p+e.ox,u+e.oy),t.ellipse(p+e.ox,u+e.oy,g,M,0,e.startA,e.endA),t.closePath();const f=t.createRadialGradient(p+e.ox-g*.2,u+e.oy-M*.2,0,p+e.ox,u+e.oy,g*1.05);f.addColorStop(0,T(c,a.opacity*.95)),f.addColorStop(.6,T(c,a.opacity*.8)),f.addColorStop(1,T(c,a.opacity*.6)),t.fillStyle=f,t.fill(),t.strokeStyle=T(c,.95),t.lineWidth=.8+.6*e.hp,t.stroke()}if(a.showLabel&&B>=.999){t.font=`${a.labelFontSize}px Arial, sans-serif`,t.textBaseline="middle";const e=[],c=[],f=a.labelFontSize+6,y=14,x=4;for(const o of i){if(!o.valid)continue;const m=Math.cos(o.midA)>=0,w=p+o.ox+g*1.02*Math.cos(o.midA),r=u+o.oy+M*1.02*Math.sin(o.midA),z=u+o.oy+M*1.18*Math.sin(o.midA),dt=a.showPercent?`${o.data.name} ${(o.percent*100).toFixed(1)}%`:`${o.data.name}`,ft=!a.labelLineColor||a.labelLineColor==="auto"?a.glowColor||o.color:a.labelLineColor,ut={slice:o,text:dt,isRight:m,anchorX:w,anchorY:r,targetY:z,y:z,color:ft};(m?c:e).push(ut)}const b=o=>{if(!o.length)return;o.sort((r,z)=>r.targetY-z.targetY);const m=x+a.labelFontSize/2,w=k-x-a.labelFontSize/2;for(let r=0;r<o.length;r++)r===0?o[r].y=Math.max(m,o[r].targetY):o[r].y=Math.max(o[r].targetY,o[r-1].y+f);if(o[o.length-1].y>w){o[o.length-1].y=w;for(let r=o.length-2;r>=0;r--)o[r].y>o[r+1].y-f&&(o[r].y=o[r+1].y-f)}for(let r=0;r<o.length;r++)o[r].y<m&&(o[r].y=m)};b(e),b(c),t.lineWidth=a.labelLineWidth;const P=[...e,...c];for(const o of P){const m=t.measureText(o.text).width;let w;if(o.isRight){const r=Math.min(Math.max(o.anchorX+6,o.anchorX+Math.abs(o.targetY-o.y)*.2+6),_-x-m-y);w=r+y,t.strokeStyle=o.color,t.beginPath(),t.moveTo(o.anchorX,o.anchorY),t.lineTo(r,o.y),t.lineTo(w,o.y),t.stroke(),t.fillStyle=a.textColor,t.textAlign="left",t.fillText(o.text,w+2,o.y)}else{const r=Math.max(Math.min(o.anchorX-6,o.anchorX-Math.abs(o.targetY-o.y)*.2-6),x+m+y);w=r-y,t.strokeStyle=o.color,t.beginPath(),t.moveTo(o.anchorX,o.anchorY),t.lineTo(r,o.y),t.lineTo(w,o.y),t.stroke(),t.fillStyle=a.textColor,t.textAlign="right",t.fillText(o.text,w-2,o.y)}}}},et=(t,l)=>{for(let n=0;n<A.length;n++){const s=A[n],i=(t-p)/g,d=(l-u)/M;if(i*i+d*d>1)continue;let v=Math.atan2((l-u)/M,(t-p)/g);for(;v<s.startA;)v+=Math.PI*2;for(;v>s.startA+Math.PI*2;)v-=Math.PI*2;if(v>=s.startA&&v<=s.endA)return n}return-1},ot=t=>{const l=C.value,n=l.getBoundingClientRect(),s=n.width/(l.clientWidth||n.width)||1,i=n.height/(l.clientHeight||n.height)||1;return{mx:(t.clientX-n.left)/s,my:(t.clientY-n.top)/i}},ct=t=>{if(!C.value)return;const{mx:l,my:n}=ot(t),s=et(l,n);if(s!==D.value&&(D.value=s,A.forEach((i,d)=>i.hover=d===s),tt()),s>=0){const i=A[s];H.value=!0,R.value=i.data,O.value=i.percent;const d=E.value?.clientWidth||0,v=E.value?.clientHeight||0,e=Math.min(l+12,d-140),c=Math.min(n+12,v-60);J.value=Math.max(0,e),K.value=Math.max(0,c)}else H.value=!1,R.value=null},ht=()=>{D.value!==-1&&(D.value=-1,A.forEach(t=>t.hover=!1),tt()),H.value=!1,R.value=null},nt=t=>{if(!C.value)return;const{mx:l,my:n}=ot(t),s=et(l,n);s>=0&&lt("slice-click",A[s].data,s)};return h.watch(()=>S.data,()=>{Object.assign(a,N,S.config),q=S.animation,W()},{deep:!0}),h.watch(()=>S.config,()=>{Object.assign(a,N,S.config),W()},{deep:!0}),h.onMounted(()=>{W(),window.addEventListener("resize",W),C.value?.addEventListener("click",nt)}),h.onUnmounted(()=>{window.removeEventListener("resize",W),C.value?.removeEventListener("click",nt),F&&cancelAnimationFrame(F),I&&cancelAnimationFrame(I)}),(t,l)=>(h.openBlock(),h.createElementBlock("div",{class:"g-pie3d-container",ref_key:"containerRef",ref:E},[h.createElementVNode("canvas",{ref_key:"canvasRef",ref:C,onMousemove:ct,onMouseleave:ht},null,544),H.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"g-pie3d-tooltip",style:h.normalizeStyle({left:`${J.value}px`,top:`${K.value}px`})},[h.renderSlot(t.$slots,"tooltip",{data:R.value,percent:O.value},()=>[h.createElementVNode("div",vt,[h.createElementVNode("p",gt,h.toDisplayString(R.value?.name),1),h.createElementVNode("p",yt,h.toDisplayString(R.value?.value)+" ("+h.toDisplayString((O.value*100).toFixed(1))+"%) ",1)])],!0)],4)):h.createCommentVNode("",!0)],512))}}),$=pt._export_sfc(xt,[["__scopeId","data-v-023ff455"]]);$.install=V=>{V.component($.name,$)};exports.GPie3D=$;exports.default=$;
@@ -1,6 +1,6 @@
1
- import { defineComponent as yt, ref as T, watch as lt, onMounted as mt, onUnmounted as xt, createElementBlock as st, openBlock as it, createElementVNode as z, createCommentVNode as Mt, normalizeStyle as bt, renderSlot as At, toDisplayString as U } from "vue";
2
- import { _ as Pt } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
3
- const wt = { class: "g-pie3d-tooltip__default" }, St = { class: "g-pie3d-tooltip__name" }, Tt = { class: "g-pie3d-tooltip__value" }, Ct = 260, _t = /* @__PURE__ */ yt({
1
+ import { defineComponent as xt, ref as C, watch as it, onMounted as Mt, onUnmounted as At, createElementBlock as st, openBlock as rt, createElementVNode as D, createCommentVNode as bt, normalizeStyle as Pt, renderSlot as wt, toDisplayString as J } from "vue";
2
+ import { _ as St } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
3
+ const Tt = { class: "g-pie3d-tooltip__default" }, Ct = { class: "g-pie3d-tooltip__name" }, _t = { class: "g-pie3d-tooltip__value" }, kt = 260, It = /* @__PURE__ */ xt({
4
4
  __name: "index",
5
5
  props: {
6
6
  data: { default: () => [] },
@@ -8,8 +8,8 @@ const wt = { class: "g-pie3d-tooltip__default" }, St = { class: "g-pie3d-tooltip
8
8
  animation: { type: Boolean, default: !0 }
9
9
  },
10
10
  emits: ["slice-click"],
11
- setup(H, { emit: rt }) {
12
- const A = H, ct = rt, O = {
11
+ setup(O, { emit: ct }) {
12
+ const w = O, ht = ct, q = {
13
13
  alpha: 55,
14
14
  depth: 26,
15
15
  startAngle: 0,
@@ -25,253 +25,257 @@ const wt = { class: "g-pie3d-tooltip__default" }, St = { class: "g-pie3d-tooltip
25
25
  glowColor: "",
26
26
  labelLineColor: "auto",
27
27
  labelLineWidth: 1
28
- }, n = { ...O, ...A.config }, R = T(null), w = T(null);
29
- let L = null, C = 0, _ = 0, Y = 1, p = 0, u = 0, v = 0, m = 0, x = [], W = A.animation ? 0 : 1, X = null, q = A.animation, k = null, F = 0;
30
- const $ = T(-1), B = T(!1), K = T(0), Q = T(0), I = T(null), N = T(0), Z = (t) => t * Math.PI / 180, V = (t, s = 0, a = 0) => ({
31
- x: p + s + v * Math.cos(t),
32
- y: u + a + m * Math.sin(t)
33
- }), j = (t, s = 0, a = 0) => ({
34
- x: p + s + v * Math.cos(t),
35
- y: u + a + m * Math.sin(t) + n.depth
36
- }), E = () => {
37
- if (!w.value || !R.value) return;
38
- const t = R.value, s = w.value;
39
- Y = window.devicePixelRatio || 1, C = t.clientWidth, _ = t.clientHeight, s.width = C * Y, s.height = _ * Y, s.style.width = C + "px", s.style.height = _ + "px", L = s.getContext("2d"), L && L.setTransform(Y, 0, 0, Y, 0, 0), p = C / 2, u = _ / 2 - n.depth / 2;
40
- const a = n.showLabel ? 60 : 10, c = Math.min(C, _ - n.depth - a) / 2 * n.radiusRatio * 1.6;
41
- v = Math.max(20, c), m = v * Math.cos(Z(n.alpha)), ht(), q ? dt() : G();
42
- }, ht = () => {
43
- x = [];
44
- const t = A.data.reduce((a, c) => a + (c.value || 0), 0);
28
+ }, a = { ...q, ...w.config }, L = C(null), T = C(null);
29
+ let Y = null, _ = 0, k = 0, F = 1, u = 0, f = 0, v = 0, x = 0, M = [], $ = w.animation ? 0 : 1, X = null, N = w.animation, I = null, E = 0;
30
+ const z = C(-1), B = C(!1), Q = C(0), Z = C(0), R = C(null), V = C(0), tt = (t) => t * Math.PI / 180, j = (t, l = 0, n = 0) => ({
31
+ x: u + l + v * Math.cos(t),
32
+ y: f + n + x * Math.sin(t)
33
+ }), G = (t, l = 0, n = 0) => ({
34
+ x: u + l + v * Math.cos(t),
35
+ y: f + n + x * Math.sin(t) + a.depth
36
+ }), W = () => {
37
+ if (!T.value || !L.value) return;
38
+ const t = L.value, l = T.value;
39
+ F = window.devicePixelRatio || 1, _ = t.clientWidth, k = t.clientHeight, l.width = _ * F, l.height = k * F, l.style.width = _ + "px", l.style.height = k + "px", Y = l.getContext("2d"), Y && Y.setTransform(F, 0, 0, F, 0, 0), u = _ / 2, f = k / 2 - a.depth / 2;
40
+ const n = a.showLabel ? 60 : 10, s = Math.min(_, k - a.depth - n) / 2 * a.radiusRatio * 1.6;
41
+ v = Math.max(20, s), x = v * Math.cos(tt(a.alpha)), dt(), N ? ft() : U();
42
+ }, dt = () => {
43
+ M = [];
44
+ const t = w.data.reduce((n, s) => n + (s.value || 0), 0);
45
45
  if (t <= 0) return;
46
- let s = -Math.PI / 2 + Z(n.startAngle);
47
- A.data.forEach((a, c) => {
48
- const i = a.value / t, d = i * Math.PI * 2;
49
- x.push({
50
- data: a,
51
- index: c,
52
- color: a.color || n.colors[c % n.colors.length],
53
- startA: s,
54
- endA: s + d,
55
- midA: s + d / 2,
46
+ let l = -Math.PI / 2 + tt(a.startAngle);
47
+ w.data.forEach((n, s) => {
48
+ const i = n.value / t, h = i * Math.PI * 2;
49
+ M.push({
50
+ data: n,
51
+ index: s,
52
+ color: n.color || a.colors[s % a.colors.length],
53
+ startA: l,
54
+ endA: l + h,
55
+ midA: l + h / 2,
56
56
  percent: i,
57
57
  hover: !1,
58
58
  hoverProgress: 0
59
- }), s += d;
59
+ }), l += h;
60
60
  });
61
- }, dt = () => {
62
- W = 0;
63
- const t = 800, s = performance.now(), a = (c) => {
64
- const i = Math.min(1, (c - s) / t);
65
- W = 1 - Math.pow(1 - i, 3), G(), i < 1 ? X = requestAnimationFrame(a) : (q = !1, X = null);
61
+ }, ft = () => {
62
+ $ = 0;
63
+ const t = 800, l = performance.now(), n = (s) => {
64
+ const i = Math.min(1, (s - l) / t);
65
+ $ = 1 - Math.pow(1 - i, 3), U(), i < 1 ? X = requestAnimationFrame(n) : (N = !1, X = null);
66
66
  };
67
- X = requestAnimationFrame(a);
68
- }, tt = (t) => 1 - Math.pow(1 - t, 3), et = (t) => {
69
- const s = F === 0 ? 16 : t - F;
70
- F = t;
71
- const a = s / Ct;
72
- let c = !1;
73
- for (const i of x) {
74
- const d = i.hover ? 1 : 0;
75
- if (i.hoverProgress === d) continue;
76
- const e = d > i.hoverProgress ? 1 : -1;
77
- i.hoverProgress += e * a, (e > 0 && i.hoverProgress >= d || e < 0 && i.hoverProgress <= d) && (i.hoverProgress = d), i.hoverProgress !== d && (c = !0);
67
+ X = requestAnimationFrame(n);
68
+ }, ut = (t) => 1 - Math.pow(1 - t, 3), et = (t) => {
69
+ const l = E === 0 ? 16 : t - E;
70
+ E = t;
71
+ const n = l / kt;
72
+ let s = !1;
73
+ for (const i of M) {
74
+ const h = i.hover ? 1 : 0;
75
+ if (i.hoverProgress === h) continue;
76
+ const p = h > i.hoverProgress ? 1 : -1;
77
+ i.hoverProgress += p * n, (p > 0 && i.hoverProgress >= h || p < 0 && i.hoverProgress <= h) && (i.hoverProgress = h), i.hoverProgress !== h && (s = !0);
78
78
  }
79
- G(), c ? k = requestAnimationFrame(et) : (k = null, F = 0);
79
+ U(), s ? I = requestAnimationFrame(et) : (I = null, E = 0);
80
80
  }, ot = () => {
81
- k == null && (F = 0, k = requestAnimationFrame(et));
82
- }, S = (t, s) => {
83
- let a = t.replace("#", "");
84
- a.length === 3 && (a = a.split("").map((e) => e + e).join(""));
85
- const c = parseInt(a.slice(0, 2), 16), i = parseInt(a.slice(2, 4), 16), d = parseInt(a.slice(4, 6), 16);
86
- return `rgba(${c},${i},${d},${s})`;
87
- }, G = () => {
88
- if (!L) return;
89
- const t = L;
90
- if (t.clearRect(0, 0, C, _), !x.length) return;
91
- const s = x[0]?.startA ?? 0, a = Math.PI * 2 * W, c = s + a, i = x.map((e) => {
92
- const l = e.startA, h = Math.min(e.endA, c), f = h > l, g = tt(Math.max(0, Math.min(1, e.hoverProgress))), P = Math.cos(e.midA) * n.hoverDistance * g, M = Math.sin(e.midA) * n.hoverDistance * g;
93
- return { ...e, startA: l, endA: h, valid: f, ox: P, oy: M, hp: g };
81
+ I == null && (E = 0, I = requestAnimationFrame(et));
82
+ }, S = (t, l) => {
83
+ let n = t.replace("#", "");
84
+ n.length === 3 && (n = n.split("").map((p) => p + p).join(""));
85
+ const s = parseInt(n.slice(0, 2), 16), i = parseInt(n.slice(2, 4), 16), h = parseInt(n.slice(4, 6), 16);
86
+ return `rgba(${s},${i},${h},${l})`;
87
+ }, U = () => {
88
+ if (!Y) return;
89
+ const t = Y;
90
+ if (t.clearRect(0, 0, _, k), !M.length) return;
91
+ const l = M[0]?.startA ?? 0, n = Math.PI * 2 * $, s = l + n, i = M.map((e) => {
92
+ const c = e.startA, d = Math.min(e.endA, s), g = d > c, m = ut(Math.max(0, Math.min(1, e.hoverProgress))), A = Math.cos(e.midA) * a.hoverDistance * m, b = Math.sin(e.midA) * a.hoverDistance * m;
93
+ return { ...e, startA: c, endA: d, valid: g, ox: A, oy: b, hp: m };
94
94
  });
95
- if (n.showAura) {
95
+ if (a.showAura) {
96
96
  const e = t.createRadialGradient(
97
- p,
98
- u + n.depth,
97
+ u,
98
+ f + a.depth,
99
99
  v * 0.1,
100
- p,
101
- u + n.depth,
100
+ u,
101
+ f + a.depth,
102
102
  v * 1.5
103
103
  );
104
- e.addColorStop(0, "rgba(6,182,212,0.15)"), e.addColorStop(0.4, "rgba(59,130,246,0.08)"), e.addColorStop(0.8, "rgba(139,92,246,0.03)"), e.addColorStop(1, "rgba(0,0,0,0)"), t.beginPath(), t.ellipse(p, u + n.depth, v * 1.5, m * 0.9, 0, 0, Math.PI * 2), t.fillStyle = e, t.fill(), t.strokeStyle = "rgba(56,189,248,0.08)", t.lineWidth = 1;
105
- for (let l = 3; l >= 1; l--) {
106
- const h = v * (0.3 + l * 0.25);
107
- t.beginPath(), t.ellipse(p, u + n.depth, h, h * (m / v), 0, 0, Math.PI * 2), t.stroke();
104
+ e.addColorStop(0, "rgba(6,182,212,0.15)"), e.addColorStop(0.4, "rgba(59,130,246,0.08)"), e.addColorStop(0.8, "rgba(139,92,246,0.03)"), e.addColorStop(1, "rgba(0,0,0,0)"), t.beginPath(), t.ellipse(u, f + a.depth, v * 1.5, x * 0.9, 0, 0, Math.PI * 2), t.fillStyle = e, t.fill(), t.strokeStyle = "rgba(56,189,248,0.08)", t.lineWidth = 1;
105
+ for (let c = 3; c >= 1; c--) {
106
+ const d = v * (0.3 + c * 0.25);
107
+ t.beginPath(), t.ellipse(u, f + a.depth, d, d * (x / v), 0, 0, Math.PI * 2), t.stroke();
108
108
  }
109
109
  }
110
- const d = Math.PI / 120;
110
+ const h = (e, c) => {
111
+ const d = a.glowColor || e.color, g = { x: u + e.ox, y: f + e.oy }, m = { x: g.x, y: g.y + a.depth }, A = j(c, e.ox, e.oy), b = G(c, e.ox, e.oy);
112
+ t.fillStyle = S(d, a.opacity * 0.5), t.beginPath(), t.moveTo(g.x, g.y), t.lineTo(A.x, A.y), t.lineTo(b.x, b.y), t.lineTo(m.x, m.y), t.closePath(), t.fill(), t.strokeStyle = S(d, 0.8), t.lineWidth = 0.8, t.beginPath(), t.moveTo(A.x, A.y), t.lineTo(b.x, b.y), t.stroke();
113
+ };
114
+ for (const e of i)
115
+ e.valid && (Math.sin(e.startA) <= 1e-3 && h(e, e.startA), Math.sin(e.endA) <= 1e-3 && h(e, e.endA));
116
+ const p = Math.PI / 120;
111
117
  for (const e of i) {
112
118
  if (!e.valid) continue;
113
- let l = e.startA;
114
- const h = n.glowColor || e.color;
115
- for (; l < e.endA; ) {
116
- const f = Math.min(l + d, e.endA), g = (l + f) / 2;
117
- if (Math.sin(g) > 0) {
118
- const P = V(l, e.ox, e.oy), M = V(f, e.ox, e.oy), o = j(f, e.ox, e.oy), y = j(l, e.ox, e.oy);
119
- t.fillStyle = S(h, n.opacity * 0.4), t.beginPath(), t.moveTo(P.x, P.y), t.lineTo(M.x, M.y), t.lineTo(o.x, o.y), t.lineTo(y.x, y.y), t.closePath(), t.fill(), t.strokeStyle = S(h, 0.7), t.lineWidth = 0.8, t.beginPath(), t.moveTo(y.x, y.y), t.lineTo(o.x, o.y), t.stroke();
119
+ let c = e.startA;
120
+ const d = a.glowColor || e.color;
121
+ for (; c < e.endA; ) {
122
+ const g = Math.min(c + p, e.endA), m = (c + g) / 2;
123
+ if (Math.sin(m) > 0) {
124
+ const A = j(c, e.ox, e.oy), b = j(g, e.ox, e.oy), o = G(g, e.ox, e.oy), y = G(c, e.ox, e.oy);
125
+ t.fillStyle = S(d, a.opacity * 0.4), t.beginPath(), t.moveTo(A.x, A.y), t.lineTo(b.x, b.y), t.lineTo(o.x, o.y), t.lineTo(y.x, y.y), t.closePath(), t.fill(), t.strokeStyle = S(d, 0.7), t.lineWidth = 0.8, t.beginPath(), t.moveTo(y.x, y.y), t.lineTo(o.x, o.y), t.stroke();
120
126
  }
121
- l = f;
122
- }
123
- }
124
- for (const e of i) {
125
- if (!e.valid) continue;
126
- const l = [];
127
- Math.sin(e.startA) > 1e-3 && l.push({ a: e.startA }), Math.sin(e.endA) > 1e-3 && l.push({ a: e.endA });
128
- const h = n.glowColor || e.color;
129
- for (const f of l) {
130
- const g = { x: p + e.ox, y: u + e.oy }, P = { x: g.x, y: g.y + n.depth }, M = V(f.a, e.ox, e.oy), o = j(f.a, e.ox, e.oy);
131
- t.fillStyle = S(h, n.opacity * 0.5), t.beginPath(), t.moveTo(g.x, g.y), t.lineTo(M.x, M.y), t.lineTo(o.x, o.y), t.lineTo(P.x, P.y), t.closePath(), t.fill(), t.strokeStyle = S(h, 0.8), t.lineWidth = 0.8, t.beginPath(), t.moveTo(M.x, M.y), t.lineTo(o.x, o.y), t.stroke();
127
+ c = g;
132
128
  }
133
129
  }
130
+ for (const e of i)
131
+ e.valid && (Math.sin(e.startA) > 1e-3 && h(e, e.startA), Math.sin(e.endA) > 1e-3 && h(e, e.endA));
134
132
  for (const e of i) {
135
133
  if (!e.valid) continue;
136
- const l = n.glowColor || e.color;
137
- e.hp > 0.01 && (t.save(), t.shadowColor = l, t.shadowBlur = 12 * e.hp, t.beginPath(), t.moveTo(p + e.ox, u + e.oy), t.ellipse(p + e.ox, u + e.oy, v, m, 0, e.startA, e.endA), t.closePath(), t.fillStyle = S(l, 0.08 * e.hp), t.fill(), t.restore()), t.beginPath(), t.moveTo(p + e.ox, u + e.oy), t.ellipse(p + e.ox, u + e.oy, v, m, 0, e.startA, e.endA), t.closePath();
138
- const h = t.createRadialGradient(
139
- p + e.ox - v * 0.2,
140
- u + e.oy - m * 0.2,
134
+ const c = a.glowColor || e.color;
135
+ e.hp > 0.01 && (t.save(), t.shadowColor = c, t.shadowBlur = 12 * e.hp, t.beginPath(), t.moveTo(u + e.ox, f + e.oy), t.ellipse(u + e.ox, f + e.oy, v, x, 0, e.startA, e.endA), t.closePath(), t.fillStyle = S(c, 0.08 * e.hp), t.fill(), t.restore()), t.beginPath(), t.moveTo(u + e.ox, f + e.oy), t.ellipse(u + e.ox, f + e.oy, v, x, 0, e.startA, e.endA), t.closePath();
136
+ const d = t.createRadialGradient(
137
+ u + e.ox - v * 0.2,
138
+ f + e.oy - x * 0.2,
141
139
  0,
142
- p + e.ox,
143
- u + e.oy,
140
+ u + e.ox,
141
+ f + e.oy,
144
142
  v * 1.05
145
143
  );
146
- h.addColorStop(0, S(l, n.opacity * 0.95)), h.addColorStop(0.6, S(l, n.opacity * 0.8)), h.addColorStop(1, S(l, n.opacity * 0.6)), t.fillStyle = h, t.fill(), t.strokeStyle = S(l, 0.95), t.lineWidth = 0.8 + 0.6 * e.hp, t.stroke();
144
+ d.addColorStop(0, S(c, a.opacity * 0.95)), d.addColorStop(0.6, S(c, a.opacity * 0.8)), d.addColorStop(1, S(c, a.opacity * 0.6)), t.fillStyle = d, t.fill(), t.strokeStyle = S(c, 0.95), t.lineWidth = 0.8 + 0.6 * e.hp, t.stroke();
147
145
  }
148
- if (n.showLabel && W >= 0.999) {
149
- t.font = `${n.labelFontSize}px Arial, sans-serif`, t.textBaseline = "middle";
150
- const e = [], l = [], h = n.labelFontSize + 6, f = 14, g = 4;
146
+ if (a.showLabel && $ >= 0.999) {
147
+ t.font = `${a.labelFontSize}px Arial, sans-serif`, t.textBaseline = "middle";
148
+ const e = [], c = [], d = a.labelFontSize + 6, g = 14, m = 4;
151
149
  for (const o of i) {
152
150
  if (!o.valid) continue;
153
- const y = Math.cos(o.midA) >= 0, b = p + o.ox + v * 1.02 * Math.cos(o.midA), r = u + o.oy + m * 1.02 * Math.sin(o.midA), D = u + o.oy + m * 1.18 * Math.sin(o.midA), pt = n.showPercent ? `${o.data.name} ${(o.percent * 100).toFixed(1)}%` : `${o.data.name}`, vt = !n.labelLineColor || n.labelLineColor === "auto" ? n.glowColor || o.color : n.labelLineColor, gt = {
151
+ const y = Math.cos(o.midA) >= 0, P = u + o.ox + v * 1.02 * Math.cos(o.midA), r = f + o.oy + x * 1.02 * Math.sin(o.midA), H = f + o.oy + x * 1.18 * Math.sin(o.midA), gt = a.showPercent ? `${o.data.name} ${(o.percent * 100).toFixed(1)}%` : `${o.data.name}`, yt = !a.labelLineColor || a.labelLineColor === "auto" ? a.glowColor || o.color : a.labelLineColor, mt = {
154
152
  slice: o,
155
- text: pt,
153
+ text: gt,
156
154
  isRight: y,
157
- anchorX: b,
155
+ anchorX: P,
158
156
  anchorY: r,
159
- targetY: D,
160
- y: D,
161
- color: vt
157
+ targetY: H,
158
+ y: H,
159
+ color: yt
162
160
  };
163
- (y ? l : e).push(gt);
161
+ (y ? c : e).push(mt);
164
162
  }
165
- const P = (o) => {
163
+ const A = (o) => {
166
164
  if (!o.length) return;
167
- o.sort((r, D) => r.targetY - D.targetY);
168
- const y = g + n.labelFontSize / 2, b = _ - g - n.labelFontSize / 2;
165
+ o.sort((r, H) => r.targetY - H.targetY);
166
+ const y = m + a.labelFontSize / 2, P = k - m - a.labelFontSize / 2;
169
167
  for (let r = 0; r < o.length; r++)
170
- r === 0 ? o[r].y = Math.max(y, o[r].targetY) : o[r].y = Math.max(o[r].targetY, o[r - 1].y + h);
171
- if (o[o.length - 1].y > b) {
172
- o[o.length - 1].y = b;
168
+ r === 0 ? o[r].y = Math.max(y, o[r].targetY) : o[r].y = Math.max(o[r].targetY, o[r - 1].y + d);
169
+ if (o[o.length - 1].y > P) {
170
+ o[o.length - 1].y = P;
173
171
  for (let r = o.length - 2; r >= 0; r--)
174
- o[r].y > o[r + 1].y - h && (o[r].y = o[r + 1].y - h);
172
+ o[r].y > o[r + 1].y - d && (o[r].y = o[r + 1].y - d);
175
173
  }
176
174
  for (let r = 0; r < o.length; r++)
177
175
  o[r].y < y && (o[r].y = y);
178
176
  };
179
- P(e), P(l), t.lineWidth = n.labelLineWidth;
180
- const M = [...e, ...l];
181
- for (const o of M) {
177
+ A(e), A(c), t.lineWidth = a.labelLineWidth;
178
+ const b = [...e, ...c];
179
+ for (const o of b) {
182
180
  const y = t.measureText(o.text).width;
183
- let b;
181
+ let P;
184
182
  if (o.isRight) {
185
183
  const r = Math.min(
186
184
  Math.max(o.anchorX + 6, o.anchorX + Math.abs(o.targetY - o.y) * 0.2 + 6),
187
- C - g - y - f
185
+ _ - m - y - g
188
186
  );
189
- b = r + f, t.strokeStyle = o.color, t.beginPath(), t.moveTo(o.anchorX, o.anchorY), t.lineTo(r, o.y), t.lineTo(b, o.y), t.stroke(), t.fillStyle = n.textColor, t.textAlign = "left", t.fillText(o.text, b + 2, o.y);
187
+ P = r + g, t.strokeStyle = o.color, t.beginPath(), t.moveTo(o.anchorX, o.anchorY), t.lineTo(r, o.y), t.lineTo(P, o.y), t.stroke(), t.fillStyle = a.textColor, t.textAlign = "left", t.fillText(o.text, P + 2, o.y);
190
188
  } else {
191
189
  const r = Math.max(
192
190
  Math.min(o.anchorX - 6, o.anchorX - Math.abs(o.targetY - o.y) * 0.2 - 6),
193
- g + y + f
191
+ m + y + g
194
192
  );
195
- b = r - f, t.strokeStyle = o.color, t.beginPath(), t.moveTo(o.anchorX, o.anchorY), t.lineTo(r, o.y), t.lineTo(b, o.y), t.stroke(), t.fillStyle = n.textColor, t.textAlign = "right", t.fillText(o.text, b - 2, o.y);
193
+ P = r - g, t.strokeStyle = o.color, t.beginPath(), t.moveTo(o.anchorX, o.anchorY), t.lineTo(r, o.y), t.lineTo(P, o.y), t.stroke(), t.fillStyle = a.textColor, t.textAlign = "right", t.fillText(o.text, P - 2, o.y);
196
194
  }
197
195
  }
198
196
  }
199
- }, nt = (t, s) => {
200
- for (let a = 0; a < x.length; a++) {
201
- const c = x[a], i = tt(Math.max(0, Math.min(1, c.hoverProgress))), d = Math.cos(c.midA) * n.hoverDistance * i, e = Math.sin(c.midA) * n.hoverDistance * i, l = (t - (p + d)) / v, h = (s - (u + e)) / m;
202
- if (l * l + h * h > 1) continue;
203
- let f = Math.atan2((s - (u + e)) / m, (t - (p + d)) / v);
204
- for (; f < c.startA; ) f += Math.PI * 2;
205
- for (; f > c.startA + Math.PI * 2; ) f -= Math.PI * 2;
206
- if (f >= c.startA && f <= c.endA) return a;
197
+ }, nt = (t, l) => {
198
+ for (let n = 0; n < M.length; n++) {
199
+ const s = M[n], i = (t - u) / v, h = (l - f) / x;
200
+ if (i * i + h * h > 1) continue;
201
+ let p = Math.atan2((l - f) / x, (t - u) / v);
202
+ for (; p < s.startA; ) p += Math.PI * 2;
203
+ for (; p > s.startA + Math.PI * 2; ) p -= Math.PI * 2;
204
+ if (p >= s.startA && p <= s.endA) return n;
207
205
  }
208
206
  return -1;
209
- }, ft = (t) => {
210
- if (!w.value) return;
211
- const s = w.value.getBoundingClientRect(), a = t.clientX - s.left, c = t.clientY - s.top, i = nt(a, c);
212
- if (i !== $.value && ($.value = i, x.forEach((d, e) => d.hover = e === i), ot()), i >= 0) {
213
- const d = x[i];
214
- B.value = !0, I.value = d.data, N.value = d.percent;
215
- const e = R.value?.clientWidth || 0, l = R.value?.clientHeight || 0, h = Math.min(a + 12, e - 140), f = Math.min(c + 12, l - 60);
216
- K.value = Math.max(0, h), Q.value = Math.max(0, f);
217
- } else
218
- B.value = !1, I.value = null;
219
- }, ut = () => {
220
- $.value !== -1 && ($.value = -1, x.forEach((t) => t.hover = !1), ot()), B.value = !1, I.value = null;
221
207
  }, at = (t) => {
222
- if (!w.value) return;
223
- const s = w.value.getBoundingClientRect(), a = nt(t.clientX - s.left, t.clientY - s.top);
224
- a >= 0 && ct("slice-click", x[a].data, a);
208
+ const l = T.value, n = l.getBoundingClientRect(), s = n.width / (l.clientWidth || n.width) || 1, i = n.height / (l.clientHeight || n.height) || 1;
209
+ return {
210
+ mx: (t.clientX - n.left) / s,
211
+ my: (t.clientY - n.top) / i
212
+ };
213
+ }, pt = (t) => {
214
+ if (!T.value) return;
215
+ const { mx: l, my: n } = at(t), s = nt(l, n);
216
+ if (s !== z.value && (z.value = s, M.forEach((i, h) => i.hover = h === s), ot()), s >= 0) {
217
+ const i = M[s];
218
+ B.value = !0, R.value = i.data, V.value = i.percent;
219
+ const h = L.value?.clientWidth || 0, p = L.value?.clientHeight || 0, e = Math.min(l + 12, h - 140), c = Math.min(n + 12, p - 60);
220
+ Q.value = Math.max(0, e), Z.value = Math.max(0, c);
221
+ } else
222
+ B.value = !1, R.value = null;
223
+ }, vt = () => {
224
+ z.value !== -1 && (z.value = -1, M.forEach((t) => t.hover = !1), ot()), B.value = !1, R.value = null;
225
+ }, lt = (t) => {
226
+ if (!T.value) return;
227
+ const { mx: l, my: n } = at(t), s = nt(l, n);
228
+ s >= 0 && ht("slice-click", M[s].data, s);
225
229
  };
226
- return lt(
227
- () => A.data,
230
+ return it(
231
+ () => w.data,
228
232
  () => {
229
- Object.assign(n, O, A.config), q = A.animation, E();
233
+ Object.assign(a, q, w.config), N = w.animation, W();
230
234
  },
231
235
  { deep: !0 }
232
- ), lt(
233
- () => A.config,
236
+ ), it(
237
+ () => w.config,
234
238
  () => {
235
- Object.assign(n, O, A.config), E();
239
+ Object.assign(a, q, w.config), W();
236
240
  },
237
241
  { deep: !0 }
238
- ), mt(() => {
239
- E(), window.addEventListener("resize", E), w.value?.addEventListener("click", at);
240
- }), xt(() => {
241
- window.removeEventListener("resize", E), w.value?.removeEventListener("click", at), X && cancelAnimationFrame(X), k && cancelAnimationFrame(k);
242
- }), (t, s) => (it(), st("div", {
242
+ ), Mt(() => {
243
+ W(), window.addEventListener("resize", W), T.value?.addEventListener("click", lt);
244
+ }), At(() => {
245
+ window.removeEventListener("resize", W), T.value?.removeEventListener("click", lt), X && cancelAnimationFrame(X), I && cancelAnimationFrame(I);
246
+ }), (t, l) => (rt(), st("div", {
243
247
  class: "g-pie3d-container",
244
248
  ref_key: "containerRef",
245
- ref: R
249
+ ref: L
246
250
  }, [
247
- z("canvas", {
251
+ D("canvas", {
248
252
  ref_key: "canvasRef",
249
- ref: w,
250
- onMousemove: ft,
251
- onMouseleave: ut
253
+ ref: T,
254
+ onMousemove: pt,
255
+ onMouseleave: vt
252
256
  }, null, 544),
253
- B.value ? (it(), st("div", {
257
+ B.value ? (rt(), st("div", {
254
258
  key: 0,
255
259
  class: "g-pie3d-tooltip",
256
- style: bt({ left: `${K.value}px`, top: `${Q.value}px` })
260
+ style: Pt({ left: `${Q.value}px`, top: `${Z.value}px` })
257
261
  }, [
258
- At(t.$slots, "tooltip", {
259
- data: I.value,
260
- percent: N.value
262
+ wt(t.$slots, "tooltip", {
263
+ data: R.value,
264
+ percent: V.value
261
265
  }, () => [
262
- z("div", wt, [
263
- z("p", St, U(I.value?.name), 1),
264
- z("p", Tt, U(I.value?.value) + " (" + U((N.value * 100).toFixed(1)) + "%) ", 1)
266
+ D("div", Tt, [
267
+ D("p", Ct, J(R.value?.name), 1),
268
+ D("p", _t, J(R.value?.value) + " (" + J((V.value * 100).toFixed(1)) + "%) ", 1)
265
269
  ])
266
270
  ], !0)
267
- ], 4)) : Mt("", !0)
271
+ ], 4)) : bt("", !0)
268
272
  ], 512));
269
273
  }
270
- }), J = /* @__PURE__ */ Pt(_t, [["__scopeId", "data-v-bf418cec"]]);
271
- J.install = (H) => {
272
- H.component(J.name, J);
274
+ }), K = /* @__PURE__ */ St(It, [["__scopeId", "data-v-023ff455"]]);
275
+ K.install = (O) => {
276
+ O.component(K.name, K);
273
277
  };
274
278
  export {
275
- J as GPie3D,
276
- J as default
279
+ K as GPie3D,
280
+ K as default
277
281
  };
@@ -1 +1 @@
1
- .g-pie3d-container[data-v-bf418cec]{position:relative;width:100%;height:100%;overflow:hidden}canvas[data-v-bf418cec]{display:block;width:100%;height:100%}.g-pie3d-tooltip[data-v-bf418cec]{position:absolute;pointer-events:none;z-index:10;background:#0a121ed9;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);color:#e2e8f0;padding:8px 12px;border-radius:4px;font-size:12px;min-width:100px;box-shadow:0 4px 20px #22d3ee40;border:1px solid rgba(34,211,238,.5)}.g-pie3d-tooltip__default p[data-v-bf418cec]{margin:0;line-height:1.5}.g-pie3d-tooltip__name[data-v-bf418cec]{font-weight:600}
1
+ .g-pie3d-container[data-v-023ff455]{position:relative;width:100%;height:100%;overflow:hidden}canvas[data-v-023ff455]{display:block;width:100%;height:100%}.g-pie3d-tooltip[data-v-023ff455]{position:absolute;pointer-events:none;z-index:10;background:#0a121ed9;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);color:#e2e8f0;padding:8px 12px;border-radius:4px;font-size:12px;min-width:100px;box-shadow:0 4px 20px #22d3ee40;border:1px solid rgba(34,211,238,.5)}.g-pie3d-tooltip__default p[data-v-023ff455]{margin:0;line-height:1.5}.g-pie3d-tooltip__name[data-v-023ff455]{font-weight:600}
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("../_plugin-vue_export-helper-BHFhmbuH.js"),a={class:"g-progress-bar-container"},i={class:"g-progress-info"},d=e.defineComponent({name:"GProgress",inheritAttrs:!1,__name:"index",props:{count:{default:0},height:{default:10},gradient:{default:()=>["#3b82f6","#f97316"]},textColor:{default:"#fff"}},setup(o){const s=o,l=e.computed(()=>`linear-gradient(90deg, ${s.gradient[0]} 0%, ${s.gradient[1]} 100%)`);return(t,c)=>(e.openBlock(),e.createElementBlock("div",a,[e.createElementVNode("div",i,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),e.createElementVNode("div",{class:"g-progress-wrapper",style:e.normalizeStyle({height:`${t.height}px`})},[e.createElementVNode("div",{class:"g-progress-bg",style:e.normalizeStyle({background:l.value})},null,4),e.createElementVNode("div",{class:"g-progress-fill",style:e.normalizeStyle({width:`${t.count}%`,background:l.value})},null,4)],4),e.createElementVNode("div",{class:"g-progress-count",style:e.normalizeStyle(`color: ${t.textColor}`)},[e.renderSlot(t.$slots,"count",{},()=>[e.createTextVNode(e.toDisplayString(t.count)+"%",1)],!0)],4)]))}}),r=n._export_sfc(d,[["__scopeId","data-v-205c6e5d"]]);r.install=o=>{o.component(r.name,r)};exports.GProgress=r;exports.default=r;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../_plugin-vue_export-helper-BHFhmbuH.js"),c={class:"g-progress-bar-container"},p={class:"g-progress-info"},m=["aria-valuenow"],g={class:"g-progress-splash","aria-hidden":"true"},v=e.defineComponent({name:"GProgress",inheritAttrs:!1,__name:"index",props:{count:{default:0},height:{default:10},gradient:{default:()=>["#3b82f6","#f97316"]},textColor:{default:"#fff"},wave:{type:Boolean,default:!1},waveSpeed:{default:3},forceAnimation:{type:Boolean,default:!1}},setup(l){const r=l,s=e.computed(()=>{const t=Number(r.count);return Number.isFinite(t)?Math.min(100,Math.max(0,t)):0}),i=e.computed(()=>typeof r.height=="number"?`${r.height}px`:r.height),n=e.computed(()=>{const[t="#3b82f6",o="#f97316"]=r.gradient??[];return`linear-gradient(90deg, ${t} 0%, ${o} 100%)`});return(t,o)=>(e.openBlock(),e.createElementBlock("div",c,[e.createElementVNode("div",p,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),e.createElementVNode("div",{class:"g-progress-wrapper",style:e.normalizeStyle({height:i.value}),role:"progressbar","aria-valuenow":s.value,"aria-valuemin":"0","aria-valuemax":"100"},[e.createElementVNode("div",{class:"g-progress-bg",style:e.normalizeStyle({background:n.value})},null,4),e.createElementVNode("div",{class:e.normalizeClass(["g-progress-fill",{"is-wave":t.wave,"is-force-animation":t.forceAnimation}]),style:e.normalizeStyle({width:`${s.value}%`,background:n.value})},[t.wave?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",{class:"g-progress-sweep g-progress-sweep--front",style:e.normalizeStyle({animationDuration:`${t.waveSpeed}s`}),"aria-hidden":"true"},null,4),e.createElementVNode("div",{class:"g-progress-sweep g-progress-sweep--back",style:e.normalizeStyle({animationDuration:`${t.waveSpeed*1.6}s`}),"aria-hidden":"true"},null,4),o[0]||(o[0]=e.createElementVNode("div",{class:"g-progress-grid","aria-hidden":"true"},null,-1)),e.createElementVNode("div",{class:"g-progress-impact",style:e.normalizeStyle({animationDuration:`${t.waveSpeed}s`}),"aria-hidden":"true"},null,4),e.createElementVNode("div",g,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,d=>e.createElementVNode("span",{key:d,class:"g-progress-splash__particle",style:e.normalizeStyle({animationDuration:`${t.waveSpeed}s`})},null,4)),64))])],64)):e.createCommentVNode("",!0)],6)],12,m),e.createElementVNode("div",{class:"g-progress-count",style:e.normalizeStyle({color:t.textColor})},[e.renderSlot(t.$slots,"count",{},()=>[e.createTextVNode(e.toDisplayString(s.value)+"%",1)],!0)],4)]))}}),a=u._export_sfc(v,[["__scopeId","data-v-324fae85"]]);a.install=l=>{l.component(a.name,a)};exports.GProgress=a;exports.default=a;
@@ -1,6 +1,9 @@
1
- import { defineComponent as i, computed as d, createElementBlock as c, openBlock as g, createElementVNode as t, renderSlot as a, normalizeStyle as o, createTextVNode as p, toDisplayString as u } from "vue";
2
- import { _ as f } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
3
- const m = { class: "g-progress-bar-container" }, h = { class: "g-progress-info" }, v = /* @__PURE__ */ i({
1
+ import { defineComponent as v, computed as i, createElementBlock as l, openBlock as d, createElementVNode as s, renderSlot as g, normalizeStyle as a, normalizeClass as h, createCommentVNode as w, Fragment as c, renderList as y, createTextVNode as b, toDisplayString as $ } from "vue";
2
+ import { _ as S } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
3
+ const _ = { class: "g-progress-bar-container" }, k = { class: "g-progress-info" }, C = ["aria-valuenow"], D = {
4
+ class: "g-progress-splash",
5
+ "aria-hidden": "true"
6
+ }, N = /* @__PURE__ */ v({
4
7
  name: "GProgress",
5
8
  inheritAttrs: !1,
6
9
  __name: "index",
@@ -8,42 +11,84 @@ const m = { class: "g-progress-bar-container" }, h = { class: "g-progress-info"
8
11
  count: { default: 0 },
9
12
  height: { default: 10 },
10
13
  gradient: { default: () => ["#3b82f6", "#f97316"] },
11
- textColor: { default: "#fff" }
14
+ textColor: { default: "#fff" },
15
+ wave: { type: Boolean, default: !1 },
16
+ waveSpeed: { default: 3 },
17
+ forceAnimation: { type: Boolean, default: !1 }
12
18
  },
13
- setup(r) {
14
- const n = r, l = d(() => `linear-gradient(90deg, ${n.gradient[0]} 0%, ${n.gradient[1]} 100%)`);
15
- return (e, _) => (g(), c("div", m, [
16
- t("div", h, [
17
- a(e.$slots, "title", {}, void 0, !0)
19
+ setup(o) {
20
+ const r = o, n = i(() => {
21
+ const e = Number(r.count);
22
+ return Number.isFinite(e) ? Math.min(100, Math.max(0, e)) : 0;
23
+ }), f = i(() => typeof r.height == "number" ? `${r.height}px` : r.height), p = i(() => {
24
+ const [e = "#3b82f6", t = "#f97316"] = r.gradient ?? [];
25
+ return `linear-gradient(90deg, ${e} 0%, ${t} 100%)`;
26
+ });
27
+ return (e, t) => (d(), l("div", _, [
28
+ s("div", k, [
29
+ g(e.$slots, "title", {}, void 0, !0)
18
30
  ]),
19
- t("div", {
31
+ s("div", {
20
32
  class: "g-progress-wrapper",
21
- style: o({ height: `${e.height}px` })
33
+ style: a({ height: f.value }),
34
+ role: "progressbar",
35
+ "aria-valuenow": n.value,
36
+ "aria-valuemin": "0",
37
+ "aria-valuemax": "100"
22
38
  }, [
23
- t("div", {
39
+ s("div", {
24
40
  class: "g-progress-bg",
25
- style: o({ background: l.value })
41
+ style: a({ background: p.value })
26
42
  }, null, 4),
27
- t("div", {
28
- class: "g-progress-fill",
29
- style: o({ width: `${e.count}%`, background: l.value })
30
- }, null, 4)
31
- ], 4),
32
- t("div", {
43
+ s("div", {
44
+ class: h(["g-progress-fill", { "is-wave": e.wave, "is-force-animation": e.forceAnimation }]),
45
+ style: a({ width: `${n.value}%`, background: p.value })
46
+ }, [
47
+ e.wave ? (d(), l(c, { key: 0 }, [
48
+ s("div", {
49
+ class: "g-progress-sweep g-progress-sweep--front",
50
+ style: a({ animationDuration: `${e.waveSpeed}s` }),
51
+ "aria-hidden": "true"
52
+ }, null, 4),
53
+ s("div", {
54
+ class: "g-progress-sweep g-progress-sweep--back",
55
+ style: a({ animationDuration: `${e.waveSpeed * 1.6}s` }),
56
+ "aria-hidden": "true"
57
+ }, null, 4),
58
+ t[0] || (t[0] = s("div", {
59
+ class: "g-progress-grid",
60
+ "aria-hidden": "true"
61
+ }, null, -1)),
62
+ s("div", {
63
+ class: "g-progress-impact",
64
+ style: a({ animationDuration: `${e.waveSpeed}s` }),
65
+ "aria-hidden": "true"
66
+ }, null, 4),
67
+ s("div", D, [
68
+ (d(), l(c, null, y(6, (m) => s("span", {
69
+ key: m,
70
+ class: "g-progress-splash__particle",
71
+ style: a({ animationDuration: `${e.waveSpeed}s` })
72
+ }, null, 4)), 64))
73
+ ])
74
+ ], 64)) : w("", !0)
75
+ ], 6)
76
+ ], 12, C),
77
+ s("div", {
33
78
  class: "g-progress-count",
34
- style: o(`color: ${e.textColor}`)
79
+ style: a({ color: e.textColor })
35
80
  }, [
36
- a(e.$slots, "count", {}, () => [
37
- p(u(e.count) + "%", 1)
81
+ g(e.$slots, "count", {}, () => [
82
+ b($(n.value) + "%", 1)
38
83
  ], !0)
39
84
  ], 4)
40
85
  ]));
41
86
  }
42
- }), s = /* @__PURE__ */ f(v, [["__scopeId", "data-v-205c6e5d"]]);
43
- s.install = (r) => {
44
- r.component(s.name, s);
87
+ }), u = /* @__PURE__ */ S(N, [["__scopeId", "data-v-324fae85"]]);
88
+ u.install = (o) => {
89
+ o.component(u.name, u);
45
90
  };
46
91
  export {
47
- s as GProgress,
48
- s as default
92
+ u as GProgress,
93
+ u as default
49
94
  };
@@ -1 +1 @@
1
- .g-progress-bar-container[data-v-205c6e5d]{display:flex;align-items:baseline;width:100%}.g-progress-bar-container .g-progress-info[data-v-205c6e5d]{flex:0 0 auto;color:#fff;font-size:14px;white-space:nowrap}.g-progress-bar-container .g-progress-wrapper[data-v-205c6e5d]{flex:1;background:#ffffff1a;border-radius:4px;overflow:hidden;margin:0 auto;position:relative}.g-progress-bar-container .g-progress-wrapper .g-progress-bg[data-v-205c6e5d]{position:absolute;top:0;left:0;width:100%;height:100%;background:linear-gradient(90deg,#3b82f6,#273a98);opacity:.2;border-radius:4px}.g-progress-bar-container .g-progress-wrapper .g-progress-fill[data-v-205c6e5d]{position:absolute;top:0;left:0;height:100%;background:linear-gradient(90deg,#3b82f6,#273a98);border-radius:4px;transition:width .5s ease;box-shadow:0 0 10px #3b82f680}.g-progress-bar-container .g-progress-count[data-v-205c6e5d]{flex:0 0 auto;font-size:14px;font-weight:500;min-width:60px;box-sizing:border-box;text-align:center}
1
+ .g-progress-bar-container[data-v-324fae85]{display:flex;align-items:center;width:100%;font-size:14px;line-height:1.4}.g-progress-bar-container .g-progress-info[data-v-324fae85]{flex:0 0 auto;color:#fff;margin-right:12px;font-size:inherit;line-height:inherit;white-space:nowrap}.g-progress-bar-container .g-progress-wrapper[data-v-324fae85]{flex:1;background:#ffffff1a;border-radius:4px;overflow:hidden;margin:0 auto;position:relative}.g-progress-bar-container .g-progress-wrapper .g-progress-bg[data-v-324fae85]{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.2;border-radius:4px}.g-progress-bar-container .g-progress-wrapper .g-progress-fill[data-v-324fae85]{position:absolute;top:0;left:0;height:100%;border-radius:4px;transition:width .5s ease;box-shadow:0 0 10px #3b82f680;overflow:hidden;isolation:isolate}.g-progress-bar-container .g-progress-wrapper .g-progress-fill .g-progress-sweep[data-v-324fae85]{position:absolute;top:0;left:0;height:100%;pointer-events:none;will-change:transform,opacity;animation-name:g-progress-sweep-move-324fae85;animation-timing-function:cubic-bezier(.45,0,.55,1);animation-iteration-count:infinite;mix-blend-mode:screen}.g-progress-bar-container .g-progress-wrapper .g-progress-fill .g-progress-sweep--front[data-v-324fae85]{width:70%;background:linear-gradient(90deg,#fff0,#ffffff14,#ffffff4d,#ffffff14,#fff0);filter:blur(.5px)}.g-progress-bar-container .g-progress-wrapper .g-progress-fill .g-progress-sweep--back[data-v-324fae85]{width:110%;background:linear-gradient(90deg,#fff0,#ffffff1f,#fff0);filter:blur(1px)}.g-progress-bar-container .g-progress-wrapper .g-progress-fill .g-progress-grid[data-v-324fae85]{position:absolute;inset:0;pointer-events:none;background-image:linear-gradient(90deg,rgba(255,255,255,.08) 1px,transparent 1px),linear-gradient(0deg,rgba(255,255,255,.05) 1px,transparent 1px);background-size:14px 100%,100% 7px;opacity:.35;mix-blend-mode:overlay}.g-progress-bar-container .g-progress-wrapper .g-progress-fill .g-progress-impact[data-v-324fae85]{position:absolute;top:0;right:0;width:18px;height:100%;pointer-events:none;background:linear-gradient(270deg,#ffffff8c,#fff3 45%,#fff0);box-shadow:0 0 12px #ffffff59;filter:blur(1px);opacity:0;will-change:opacity,transform;transform-origin:right center;animation-name:g-progress-impact-flash-324fae85;animation-timing-function:cubic-bezier(.45,0,.55,1);animation-iteration-count:infinite;mix-blend-mode:screen}.g-progress-bar-container .g-progress-wrapper .g-progress-fill .g-progress-splash[data-v-324fae85]{position:absolute;top:0;right:0;width:0;height:100%;pointer-events:none}.g-progress-bar-container .g-progress-wrapper .g-progress-fill .g-progress-splash .g-progress-splash__particle[data-v-324fae85]{position:absolute;top:50%;left:0;width:2px;height:2px;border-radius:50%;background:#ffffff8c;box-shadow:0 0 4px #ffffff59;opacity:0;will-change:transform,opacity;animation:g-progress-splash-burst-324fae85 cubic-bezier(.4,0,.6,1) infinite;mix-blend-mode:screen}.g-progress-bar-container .g-progress-wrapper .g-progress-fill .g-progress-splash .g-progress-splash__particle[data-v-324fae85]:nth-child(1){--splash-x: 7px;--splash-y: -8px}.g-progress-bar-container .g-progress-wrapper .g-progress-fill .g-progress-splash .g-progress-splash__particle[data-v-324fae85]:nth-child(2){--splash-x: 9px;--splash-y: -2px;width:1.5px;height:1.5px}.g-progress-bar-container .g-progress-wrapper .g-progress-fill .g-progress-splash .g-progress-splash__particle[data-v-324fae85]:nth-child(3){--splash-x: 5px;--splash-y: -10px;width:2.5px;height:2.5px}.g-progress-bar-container .g-progress-wrapper .g-progress-fill .g-progress-splash .g-progress-splash__particle[data-v-324fae85]:nth-child(4){--splash-x: 8px;--splash-y: 6px}.g-progress-bar-container .g-progress-wrapper .g-progress-fill .g-progress-splash .g-progress-splash__particle[data-v-324fae85]:nth-child(5){--splash-x: 4px;--splash-y: 9px;width:1.5px;height:1.5px}.g-progress-bar-container .g-progress-wrapper .g-progress-fill .g-progress-splash .g-progress-splash__particle[data-v-324fae85]:nth-child(6){--splash-x: 10px;--splash-y: 1px}.g-progress-bar-container .g-progress-count[data-v-324fae85]{flex:0 0 auto;margin-left:12px;font-size:inherit;line-height:inherit;font-weight:500;min-width:3em;white-space:nowrap;text-align:left;font-variant-numeric:tabular-nums}@keyframes g-progress-sweep-move-324fae85{0%{transform:translate3d(-110%,0,0);opacity:0}25%{opacity:1}75%{opacity:1}to{transform:translate3d(220%,0,0);opacity:0}}@keyframes g-progress-impact-flash-324fae85{0%,55%{opacity:0;transform:scaleX(.8)}72%{opacity:.55;transform:scaleX(1.05)}88%{opacity:.25;transform:scaleX(1)}to{opacity:0;transform:scaleX(.9)}}@keyframes g-progress-splash-burst-324fae85{0%,62%{transform:translate(0) scale(.6);opacity:0}74%{opacity:.6;transform:translate(calc(var(--splash-x, 8px) * .35),calc(var(--splash-y, -8px) * .35)) scale(1)}to{transform:translate(var(--splash-x, 8px),var(--splash-y, -8px)) scale(.4);opacity:0}}@media(prefers-reduced-motion:reduce){.g-progress-bar-container .g-progress-wrapper .g-progress-fill:not(.is-force-animation) .g-progress-sweep--front[data-v-324fae85]{animation-duration:6s!important;opacity:.6}.g-progress-bar-container .g-progress-wrapper .g-progress-fill:not(.is-force-animation) .g-progress-sweep--back[data-v-324fae85],.g-progress-bar-container .g-progress-wrapper .g-progress-fill:not(.is-force-animation) .g-progress-impact[data-v-324fae85],.g-progress-bar-container .g-progress-wrapper .g-progress-fill:not(.is-force-animation) .g-progress-splash__particle[data-v-324fae85]{animation:none!important;opacity:0}}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("../_plugin-vue_export-helper-BHFhmbuH.js"),y=["aria-valuenow"],w=["viewBox"],N=["stop-color"],V=["stop-color"],E=["r","stroke","stroke-width"],S=["r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","transform"],$={class:"g-ring-title"},b={class:"g-ring-count"},d=100,z=e.defineComponent({name:"GRing",inheritAttrs:!1,__name:"index",props:{count:{default:0},size:{default:120},strokeWidth:{default:10},gradient:{default:()=>["#3b82f6","#f97316"]},textColor:{default:"#fff"},wave:{type:Boolean,default:!1},waveSpeed:{default:3},forceAnimation:{type:Boolean,default:!1}},setup(s){const o=s,a=e.computed(()=>{const t=Number(o.count);return Number.isFinite(t)?Math.min(100,Math.max(0,t)):0}),u=e.computed(()=>typeof o.size=="number"?`${o.size}px`:o.size),r=d/2,l=e.computed(()=>o.strokeWidth),i=e.computed(()=>r-l.value/2),m=e.computed(()=>2*Math.PI*i.value),g=e.computed(()=>m.value*(1-a.value/100)),f=e.computed(()=>a.value/100*360),p=e.computed(()=>o.gradient?.[0]??"#3b82f6"),v=e.computed(()=>o.gradient?.[1]??"#f97316"),h=e.computed(()=>"rgba(255, 255, 255, 0)"),_=e.computed(()=>"rgba(255, 255, 255, 0.2)"),c=`g-ring-gradient-${e.getCurrentInstance()?.uid??0}`;return(t,B)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["g-ring-container",{"is-force-animation":t.forceAnimation}]),style:e.normalizeStyle({width:u.value,height:u.value}),role:"progressbar","aria-valuenow":a.value,"aria-valuemin":"0","aria-valuemax":"100"},[t.wave?(e.openBlock(),e.createElementBlock("div",{key:0,class:"g-ring-sweep",style:e.normalizeStyle({"--g-ring-stroke":`${l.value}%`,"--g-ring-fill-angle":`${f.value}deg`}),"aria-hidden":"true"},[e.createElementVNode("div",{class:"g-ring-sweep__beam",style:e.normalizeStyle({animationDuration:`${t.waveSpeed}s`,"--g-ring-sweep-from":h.value,"--g-ring-sweep-to":_.value})},null,4)],4)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{class:"g-ring-svg",viewBox:`0 0 ${d} ${d}`,"aria-hidden":"true"},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:c,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":p.value},null,8,N),e.createElementVNode("stop",{offset:"100%","stop-color":v.value},null,8,V)])]),e.createElementVNode("circle",{class:"g-ring-track",cx:r,cy:r,r:i.value,fill:"none",stroke:`url(#${c})`,"stroke-width":l.value},null,8,E),e.createElementVNode("circle",{class:"g-ring-fill",cx:r,cy:r,r:i.value,fill:"none",stroke:`url(#${c})`,"stroke-width":l.value,"stroke-linecap":"butt","stroke-dasharray":m.value,"stroke-dashoffset":g.value,transform:`rotate(-90 ${r} ${r})`},null,8,S)],8,w)),e.createElementVNode("div",{class:"g-ring-content",style:e.normalizeStyle({color:t.textColor})},[e.createElementVNode("div",$,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),e.createElementVNode("div",b,[e.renderSlot(t.$slots,"count",{},()=>[e.createTextVNode(e.toDisplayString(a.value)+"%",1)],!0)])],4)],14,y))}}),n=k._export_sfc(z,[["__scopeId","data-v-63242fd9"]]);n.install=s=>{s.component(n.name,n)};exports.GRing=n;exports.default=n;
@@ -0,0 +1,116 @@
1
+ import { defineComponent as x, computed as e, getCurrentInstance as z, createElementBlock as u, openBlock as f, normalizeStyle as i, normalizeClass as S, createCommentVNode as B, createElementVNode as t, renderSlot as h, createTextVNode as C, toDisplayString as N } from "vue";
2
+ import { _ as A } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
3
+ const I = ["aria-valuenow"], V = ["viewBox"], F = ["stop-color"], G = ["stop-color"], M = ["r", "stroke", "stroke-width"], T = ["r", "stroke", "stroke-width", "stroke-dasharray", "stroke-dashoffset", "transform"], W = { class: "g-ring-title" }, D = { class: "g-ring-count" }, g = 100, E = /* @__PURE__ */ x({
4
+ name: "GRing",
5
+ inheritAttrs: !1,
6
+ __name: "index",
7
+ props: {
8
+ count: { default: 0 },
9
+ size: { default: 120 },
10
+ strokeWidth: { default: 10 },
11
+ gradient: { default: () => ["#3b82f6", "#f97316"] },
12
+ textColor: { default: "#fff" },
13
+ wave: { type: Boolean, default: !1 },
14
+ waveSpeed: { default: 3 },
15
+ forceAnimation: { type: Boolean, default: !1 }
16
+ },
17
+ setup(l) {
18
+ const s = l, a = e(() => {
19
+ const o = Number(s.count);
20
+ return Number.isFinite(o) ? Math.min(100, Math.max(0, o)) : 0;
21
+ }), m = e(() => typeof s.size == "number" ? `${s.size}px` : s.size), r = g / 2, n = e(() => s.strokeWidth), c = e(() => r - n.value / 2), p = e(() => 2 * Math.PI * c.value), _ = e(() => p.value * (1 - a.value / 100)), k = e(() => a.value / 100 * 360), w = e(() => s.gradient?.[0] ?? "#3b82f6"), y = e(() => s.gradient?.[1] ?? "#f97316"), $ = e(() => "rgba(255, 255, 255, 0)"), b = e(() => "rgba(255, 255, 255, 0.2)"), d = `g-ring-gradient-${z()?.uid ?? 0}`;
22
+ return (o, R) => (f(), u("div", {
23
+ class: S(["g-ring-container", { "is-force-animation": o.forceAnimation }]),
24
+ style: i({ width: m.value, height: m.value }),
25
+ role: "progressbar",
26
+ "aria-valuenow": a.value,
27
+ "aria-valuemin": "0",
28
+ "aria-valuemax": "100"
29
+ }, [
30
+ o.wave ? (f(), u("div", {
31
+ key: 0,
32
+ class: "g-ring-sweep",
33
+ style: i({
34
+ "--g-ring-stroke": `${n.value}%`,
35
+ "--g-ring-fill-angle": `${k.value}deg`
36
+ }),
37
+ "aria-hidden": "true"
38
+ }, [
39
+ t("div", {
40
+ class: "g-ring-sweep__beam",
41
+ style: i({
42
+ animationDuration: `${o.waveSpeed}s`,
43
+ "--g-ring-sweep-from": $.value,
44
+ "--g-ring-sweep-to": b.value
45
+ })
46
+ }, null, 4)
47
+ ], 4)) : B("", !0),
48
+ (f(), u("svg", {
49
+ class: "g-ring-svg",
50
+ viewBox: `0 0 ${g} ${g}`,
51
+ "aria-hidden": "true"
52
+ }, [
53
+ t("defs", null, [
54
+ t("linearGradient", {
55
+ id: d,
56
+ x1: "0%",
57
+ y1: "0%",
58
+ x2: "100%",
59
+ y2: "0%"
60
+ }, [
61
+ t("stop", {
62
+ offset: "0%",
63
+ "stop-color": w.value
64
+ }, null, 8, F),
65
+ t("stop", {
66
+ offset: "100%",
67
+ "stop-color": y.value
68
+ }, null, 8, G)
69
+ ])
70
+ ]),
71
+ t("circle", {
72
+ class: "g-ring-track",
73
+ cx: r,
74
+ cy: r,
75
+ r: c.value,
76
+ fill: "none",
77
+ stroke: `url(#${d})`,
78
+ "stroke-width": n.value
79
+ }, null, 8, M),
80
+ t("circle", {
81
+ class: "g-ring-fill",
82
+ cx: r,
83
+ cy: r,
84
+ r: c.value,
85
+ fill: "none",
86
+ stroke: `url(#${d})`,
87
+ "stroke-width": n.value,
88
+ "stroke-linecap": "butt",
89
+ "stroke-dasharray": p.value,
90
+ "stroke-dashoffset": _.value,
91
+ transform: `rotate(-90 ${r} ${r})`
92
+ }, null, 8, T)
93
+ ], 8, V)),
94
+ t("div", {
95
+ class: "g-ring-content",
96
+ style: i({ color: o.textColor })
97
+ }, [
98
+ t("div", W, [
99
+ h(o.$slots, "title", {}, void 0, !0)
100
+ ]),
101
+ t("div", D, [
102
+ h(o.$slots, "count", {}, () => [
103
+ C(N(a.value) + "%", 1)
104
+ ], !0)
105
+ ])
106
+ ], 4)
107
+ ], 14, I));
108
+ }
109
+ }), v = /* @__PURE__ */ A(E, [["__scopeId", "data-v-63242fd9"]]);
110
+ v.install = (l) => {
111
+ l.component(v.name, v);
112
+ };
113
+ export {
114
+ v as GRing,
115
+ v as default
116
+ };
@@ -0,0 +1 @@
1
+ .g-ring-container[data-v-63242fd9]{position:relative;display:inline-flex;align-items:center;justify-content:center;font-size:14px;line-height:1.4;isolation:isolate}.g-ring-container .g-ring-svg[data-v-63242fd9]{width:100%;height:100%;display:block}.g-ring-container .g-ring-svg .g-ring-track[data-v-63242fd9]{opacity:.15}.g-ring-container .g-ring-svg .g-ring-fill[data-v-63242fd9]{transition:stroke-dashoffset .5s ease;filter:drop-shadow(0 0 6px rgba(59,130,246,.4))}.g-ring-container .g-ring-sweep[data-v-63242fd9]{position:absolute;inset:0;border-radius:50%;pointer-events:none;overflow:hidden;mask:radial-gradient(circle closest-side,transparent calc(100% - 2 * var(--g-ring-stroke, 10%) - 1%),#000 calc(100% - 2 * var(--g-ring-stroke, 10%)),#000 100%),conic-gradient(from 0deg,#000 0deg,#000 var(--g-ring-fill-angle, 0deg),transparent var(--g-ring-fill-angle, 0deg),transparent 360deg);mask-composite:intersect;-webkit-mask:radial-gradient(circle closest-side,transparent calc(100% - 2 * var(--g-ring-stroke, 10%) - 1%),#000 calc(100% - 2 * var(--g-ring-stroke, 10%)),#000 100%),conic-gradient(from 0deg,#000 0deg,#000 var(--g-ring-fill-angle, 0deg),transparent var(--g-ring-fill-angle, 0deg),transparent 360deg);-webkit-mask-composite:source-in;mix-blend-mode:screen;transition:--g-ring-fill-angle .5s ease}.g-ring-container .g-ring-sweep .g-ring-sweep__beam[data-v-63242fd9]{position:absolute;inset:0;border-radius:50%;background:conic-gradient(from 0deg,var(--g-ring-sweep-from) 0deg,var(--g-ring-sweep-from) 200deg,var(--g-ring-sweep-to) 340deg,var(--g-ring-sweep-from) 360deg);animation:g-ring-sweep-rotate-63242fd9 linear infinite;will-change:transform;filter:blur(.5px)}.g-ring-container .g-ring-content[data-v-63242fd9]{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:0 12%;pointer-events:none;font-variant-numeric:tabular-nums}.g-ring-container .g-ring-content .g-ring-title[data-v-63242fd9]{font-size:inherit;line-height:1.2;opacity:.9}.g-ring-container .g-ring-content .g-ring-title[data-v-63242fd9]:empty{display:none}.g-ring-container .g-ring-content .g-ring-count[data-v-63242fd9]{font-size:1.4em;font-weight:600;line-height:1.2;margin-top:2px}@keyframes g-ring-sweep-rotate-63242fd9{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.g-ring-container:not(.is-force-animation) .g-ring-sweep__beam[data-v-63242fd9]{animation-duration:6s!important;opacity:.6}.g-ring-container:not(.is-force-animation) .g-ring-fill[data-v-63242fd9]{transition:none}}
package/lib/GRing.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {}
@@ -1,7 +1,7 @@
1
- interface Props {
2
- /** 当前数值 (唯一数据来源) */
3
- num?: number;
4
- /** 延迟时间 */
1
+ import { default as GCount } from './index';
2
+ export default GCount;
3
+ export { GCount };
4
+ * 延迟时间 */
5
5
  delay?: number;
6
6
  /** 动画持续时间 */
7
7
  duration?: number;
@@ -1,18 +1,18 @@
1
1
  interface Props {
2
2
  /**
3
- * @description 数量
3
+ * @description 进度数值,范围 0 ~ 100,超出会被自动 clamp
4
4
  * @version 0.1.7
5
5
  * @default 0
6
6
  */
7
7
  count?: number | string;
8
8
  /**
9
- * @description 宽度
9
+ * @description 进度条高度,数字按 px 处理,字符串原样输出(支持 rem / % 等)
10
10
  * @version 0.1.7
11
11
  * @default 10
12
12
  */
13
- height?: number;
13
+ height?: number | string;
14
14
  /**
15
- * @description 渐变颜色
15
+ * @description 渐变颜色,至少需要两个色值
16
16
  * @version 0.1.7
17
17
  * @default () => ['#3b82f6', '#f97316']
18
18
  */
@@ -23,6 +23,25 @@ interface Props {
23
23
  * @default () => '#fff'
24
24
  */
25
25
  textColor?: string;
26
+ /**
27
+ * @description 是否启用水波 wave 动效(建议 height ≥ 16 时观感更佳)
28
+ * @version 0.2.13
29
+ * @default false
30
+ */
31
+ wave?: boolean;
32
+ /**
33
+ * @description 水波动效周期(秒),数值越小波动越快
34
+ * @version 0.2.13
35
+ * @default 3
36
+ */
37
+ waveSpeed?: number;
38
+ /**
39
+ * @description 强制开启动效,忽略系统的 prefers-reduced-motion 偏好。
40
+ * 适用于数据大屏等需要常态动效的场景;常规业务页建议保持默认以尊重无障碍设置。
41
+ * @version 0.2.14
42
+ * @default false
43
+ */
44
+ forceAnimation?: boolean;
26
45
  }
27
46
  declare function __VLS_template(): {
28
47
  attrs: Partial<{}>;
@@ -36,9 +55,12 @@ declare function __VLS_template(): {
36
55
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
37
56
  declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
38
57
  count: number | string;
39
- height: number;
58
+ height: number | string;
40
59
  gradient: string[];
41
60
  textColor: string;
61
+ wave: boolean;
62
+ waveSpeed: number;
63
+ forceAnimation: boolean;
42
64
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
43
65
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
44
66
  export default _default;
@@ -0,0 +1,78 @@
1
+ interface Props {
2
+ /**
3
+ * @description 进度数值,范围 0 ~ 100,超出会被自动 clamp
4
+ * @version 0.2.16
5
+ * @default 0
6
+ */
7
+ count?: number | string;
8
+ /**
9
+ * @description 圆环外径,数字按 px 处理,字符串原样输出(支持 rem / % 等)
10
+ * @version 0.2.16
11
+ * @default 120
12
+ */
13
+ size?: number | string;
14
+ /**
15
+ * @description 圆环线宽(px)
16
+ * @version 0.2.16
17
+ * @default 10
18
+ */
19
+ strokeWidth?: number;
20
+ /**
21
+ * @description 渐变颜色,至少需要两个色值
22
+ * @version 0.2.16
23
+ * @default () => ['#3b82f6', '#f97316']
24
+ */
25
+ gradient?: string[];
26
+ /**
27
+ * @description 文字颜色
28
+ * @version 0.2.16
29
+ * @default '#fff'
30
+ */
31
+ textColor?: string;
32
+ /**
33
+ * @description 是否启用扫光动效
34
+ * @version 0.2.16
35
+ * @default false
36
+ */
37
+ wave?: boolean;
38
+ /**
39
+ * @description 扫光动效周期(秒),数值越小转动越快
40
+ * @version 0.2.16
41
+ * @default 3
42
+ */
43
+ waveSpeed?: number;
44
+ /**
45
+ * @description 强制开启动效,忽略系统的 prefers-reduced-motion 偏好。
46
+ * 适用于数据大屏等需要常态动效的场景;常规业务页建议保持默认以尊重无障碍设置。
47
+ * @version 0.2.16
48
+ * @default false
49
+ */
50
+ forceAnimation?: boolean;
51
+ }
52
+ declare function __VLS_template(): {
53
+ attrs: Partial<{}>;
54
+ slots: {
55
+ title?(_: {}): any;
56
+ count?(_: {}): any;
57
+ };
58
+ refs: {};
59
+ rootEl: any;
60
+ };
61
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
62
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
63
+ size: number | string;
64
+ count: number | string;
65
+ gradient: string[];
66
+ textColor: string;
67
+ wave: boolean;
68
+ waveSpeed: number;
69
+ forceAnimation: boolean;
70
+ strokeWidth: number;
71
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
72
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
73
+ export default _default;
74
+ type __VLS_WithTemplateSlots<T, S> = T & {
75
+ new (): {
76
+ $slots: S;
77
+ };
78
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("../GCount/index.js"),o=require("../GDialog/index.js"),l=require("../GTable/index.js"),n=require("../GVideo/index.js"),r=require("../GBubble/index.js"),a=require("../GProgress/index.js"),i=require("../GScreen/index.js"),d=require("../GPluginVideo/index.js"),G=require("../GPie3D/index.js"),t={GCount:u.default,GDialog:o.default,GTable:l.default,GVideo:n.default,GBubble:r.default,GProgress:a.default,GScreen:i.default,GPluginVideo:d.default,GPie3D:G.default},f=s=>{Object.keys(t).forEach(c=>{const e=t[c];s.component(e.name,e)})},b={install:f};exports.GCount=u.default;exports.GDialog=o.default;exports.GTable=l.default;exports.GVideo=n.default;exports.GBubble=r.default;exports.GProgress=a.default;exports.GScreen=i.default;exports.GPluginVideo=d.default;exports.GPie3D=G.default;exports.default=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("../GCount/index.js"),o=require("../GDialog/index.js"),l=require("../GTable/index.js"),n=require("../GVideo/index.js"),r=require("../GBubble/index.js"),i=require("../GProgress/index.js"),a=require("../GScreen/index.js"),d=require("../GPluginVideo/index.js"),G=require("../GPie3D/index.js"),s=require("../GRing/index.js"),t={GCount:u.default,GDialog:o.default,GTable:l.default,GVideo:n.default,GBubble:r.default,GProgress:i.default,GScreen:a.default,GPluginVideo:d.default,GPie3D:G.default,GRing:s.default},g=c=>{Object.keys(t).forEach(f=>{const e=t[f];c.component(e.name,e)})},b={install:g};exports.GCount=u.default;exports.GDialog=o.default;exports.GTable=l.default;exports.GVideo=n.default;exports.GBubble=r.default;exports.GProgress=i.default;exports.GScreen=a.default;exports.GPluginVideo=d.default;exports.GPie3D=G.default;exports.GRing=s.default;exports.default=b;
@@ -1,37 +1,40 @@
1
- import t from "../GCount/index.mjs";
2
- import i from "../GDialog/index.mjs";
1
+ import n from "../GCount/index.mjs";
2
+ import t from "../GDialog/index.mjs";
3
3
  import e from "../GTable/index.mjs";
4
4
  import s from "../GVideo/index.mjs";
5
- import c from "../GBubble/index.mjs";
6
- import f from "../GProgress/index.mjs";
7
- import a from "../GScreen/index.mjs";
8
- import p from "../GPluginVideo/index.mjs";
5
+ import f from "../GBubble/index.mjs";
6
+ import c from "../GProgress/index.mjs";
7
+ import p from "../GScreen/index.mjs";
8
+ import a from "../GPluginVideo/index.mjs";
9
9
  import G from "../GPie3D/index.mjs";
10
+ import l from "../GRing/index.mjs";
10
11
  const m = {
11
- GCount: t,
12
- GDialog: i,
12
+ GCount: n,
13
+ GDialog: t,
13
14
  GTable: e,
14
15
  GVideo: s,
15
- GBubble: c,
16
- GProgress: f,
17
- GScreen: a,
18
- GPluginVideo: p,
19
- GPie3D: G
20
- }, l = (r) => {
21
- Object.keys(m).forEach((n) => {
22
- const o = m[n];
16
+ GBubble: f,
17
+ GProgress: c,
18
+ GScreen: p,
19
+ GPluginVideo: a,
20
+ GPie3D: G,
21
+ GRing: l
22
+ }, u = (r) => {
23
+ Object.keys(m).forEach((i) => {
24
+ const o = m[i];
23
25
  r.component(o.name, o);
24
26
  });
25
- }, D = { install: l };
27
+ }, $ = { install: u };
26
28
  export {
27
- c as GBubble,
28
- t as GCount,
29
- i as GDialog,
29
+ f as GBubble,
30
+ n as GCount,
31
+ t as GDialog,
30
32
  G as GPie3D,
31
- p as GPluginVideo,
32
- f as GProgress,
33
- a as GScreen,
33
+ a as GPluginVideo,
34
+ c as GProgress,
35
+ l as GRing,
36
+ p as GScreen,
34
37
  e as GTable,
35
38
  s as GVideo,
36
- D as default
39
+ $ as default
37
40
  };
package/lib/index.d.ts CHANGED
@@ -7,8 +7,9 @@ import { GProgress } from './components/GProgress';
7
7
  import { GScreen } from './components/GScreen';
8
8
  import { GPluginVideo } from './components/GPluginVideo';
9
9
  import { GPie3D } from './components/GPie3D';
10
+ import { GRing } from './components/GRing';
10
11
  declare const _default: {
11
12
  install: (app: any) => void;
12
13
  };
13
14
  export default _default;
14
- export { GCount, GDialog, GTable, GVideo, GBubble, GProgress, GScreen, GPluginVideo, GPie3D };
15
+ export { GCount, GDialog, GTable, GVideo, GBubble, GProgress, GScreen, GPluginVideo, GPie3D, GRing };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geekin-devtoys",
3
- "version": "0.2.14",
3
+ "version": "0.2.16",
4
4
  "author": "leon",
5
5
  "license": "MIT",
6
6
  "description": "geekin-devtoys组件库",
@@ -112,6 +112,14 @@
112
112
  "import": "./lib/GProgress/style.css",
113
113
  "require": "./lib/GProgress/style.css"
114
114
  },
115
+ "./GRing": {
116
+ "import": "./lib/GRing/index.mjs",
117
+ "require": "./lib/GRing/index.js"
118
+ },
119
+ "./GRing/style": {
120
+ "import": "./lib/GRing/style.css",
121
+ "require": "./lib/GRing/style.css"
122
+ },
115
123
  "./GScreen": {
116
124
  "import": "./lib/GScreen/index.mjs",
117
125
  "require": "./lib/GScreen/index.js"