geekin-devtoys 0.3.7 → 0.3.9

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.
Files changed (63) hide show
  1. package/lib/GBubble/index.js +1 -2
  2. package/lib/GBubble/index.mjs +3 -210
  3. package/lib/GBubble-C3cM9Put.mjs +216 -0
  4. package/lib/GBubble-Dph0YDkU.js +2 -0
  5. package/lib/GButton/index.js +1 -0
  6. package/lib/GButton/index.mjs +84 -0
  7. package/lib/GButton/style.css +1 -0
  8. package/lib/GButton.d.ts +1 -0
  9. package/lib/GCard/index.js +1 -1
  10. package/lib/GCard/index.mjs +1 -1
  11. package/lib/GDialog/index.js +1 -1
  12. package/lib/GDialog/index.mjs +271 -342
  13. package/lib/GDialog/style.css +1 -1
  14. package/lib/GInput/index.js +1 -0
  15. package/lib/GInput/index.mjs +145 -0
  16. package/lib/GInput/style.css +1 -0
  17. package/lib/GInput.d.ts +1 -0
  18. package/lib/GInputTreeTag/index.js +1 -1
  19. package/lib/GInputTreeTag/index.mjs +77 -75
  20. package/lib/GInputTreeTag/style.css +1 -1
  21. package/lib/GPie3D/index.js +1 -1
  22. package/lib/GPie3D/index.mjs +1 -1
  23. package/lib/GProgress/index.js +1 -1
  24. package/lib/GProgress/index.mjs +1 -1
  25. package/lib/GRing/index.js +1 -1
  26. package/lib/GRing/index.mjs +1 -1
  27. package/lib/GScroller/index.js +1 -1
  28. package/lib/GScroller/index.mjs +135 -152
  29. package/lib/GShinyText/index.js +1 -1
  30. package/lib/GShinyText/index.mjs +45 -119
  31. package/lib/GSteps/index.js +1 -1
  32. package/lib/GSteps/index.mjs +89 -43
  33. package/lib/GSteps/style.css +1 -1
  34. package/lib/GTable/index.js +1 -1
  35. package/lib/GTable/index.mjs +1 -1
  36. package/lib/GTag/index.js +1 -0
  37. package/lib/GTag/index.mjs +73 -0
  38. package/lib/GTag.d.ts +1 -0
  39. package/lib/GVideo/index.js +2 -2
  40. package/lib/GVideo/index.mjs +159 -158
  41. package/lib/GVideo/style.css +1 -1
  42. package/lib/assets/GTag.css +1 -0
  43. package/lib/components/GButton/index.d.ts +38 -0
  44. package/lib/components/GDialog/const.d.ts +4 -4
  45. package/lib/components/GDialog/icons.d.ts +4 -4
  46. package/lib/components/GInput/index.d.ts +64 -0
  47. package/lib/components/GInputTreeTag/index.d.ts +16 -16
  48. package/lib/components/GProgress/index.d.ts +1 -1
  49. package/lib/components/GRing/index.d.ts +1 -1
  50. package/lib/components/GScreen/index.d.ts +1 -1
  51. package/lib/components/GTag/index.d.ts +38 -0
  52. package/lib/index/index.js +1 -1
  53. package/lib/index/index.mjs +42 -33
  54. package/lib/index/style.css +25 -0
  55. package/lib/index.d.ts +4 -1
  56. package/package.json +20 -20
  57. package/lib/AnimatePresence-26Wy0TGN.js +0 -9
  58. package/lib/AnimatePresence-nl0c23TZ.mjs +0 -136
  59. package/lib/_plugin-vue_export-helper-BHFhmbuH.js +0 -1
  60. package/lib/_plugin-vue_export-helper-CHgC5LLL.mjs +0 -9
  61. package/lib/components/GDialog/GButton.d.ts +0 -42
  62. package/lib/index-B8Ap0044.js +0 -1
  63. package/lib/index-Bbr5fWvI.mjs +0 -5158
@@ -1 +1 @@
1
- @charset "UTF-8";.g-input-tree-tag[data-v-b74dd5d2]{width:100%}.g-input-tree-tag__wrap[data-v-b74dd5d2]{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.g-input-tree-tag__tags[data-v-b74dd5d2]{display:flex;flex-wrap:wrap;gap:8px;width:100%}.g-input-tree-tag__tag-motion[data-v-b74dd5d2]{display:inline-flex}.g-input-tree-tag__tag[data-v-b74dd5d2]{margin:0}.g-input-tree-tag.is-disabled[data-v-b74dd5d2]{cursor:not-allowed}.g-input-tree-tag__popover{box-sizing:border-box;background:var(--el-bg-color-overlay, #fff);border:1px solid var(--el-border-color-light);border-radius:4px;box-shadow:var(--el-box-shadow-light);padding:8px 0}.g-input-tree-tag__popover .g-input-tree-tag__tree-wrap{overflow:auto}.g-input-tree-tag__popover .g-input-tree-tag__node{display:inline-flex;align-items:center;gap:4px;font-size:13px}.g-input-tree-tag__popover .g-input-tree-tag__node.is-selectable{cursor:pointer;color:var(--el-text-color-primary)}.g-input-tree-tag__popover .g-input-tree-tag__node.is-selected{color:var(--el-color-primary)}
1
+ @charset "UTF-8";.g-input-tree-tag[data-v-e10d8b6e]{width:100%}.g-input-tree-tag__wrap[data-v-e10d8b6e]{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.g-input-tree-tag__tags[data-v-e10d8b6e]{display:flex;flex-wrap:wrap;gap:8px;width:100%}.g-input-tree-tag__tag-motion[data-v-e10d8b6e]{display:inline-flex}.g-input-tree-tag__tag[data-v-e10d8b6e]{margin:0}.g-input-tree-tag.is-disabled[data-v-e10d8b6e]{cursor:not-allowed}.g-input-tree-tag__popover{box-sizing:border-box;background:var(--el-bg-color-overlay, #fff);border:1px solid var(--el-border-color-light);border-radius:4px;box-shadow:var(--el-box-shadow-light);padding:8px 0}.g-input-tree-tag__popover .g-input-tree-tag__tree-wrap{overflow:auto}.g-input-tree-tag__popover .g-input-tree-tag__node{display:inline-flex;align-items:center;gap:4px;font-size:13px}.g-input-tree-tag__popover .g-input-tree-tag__node.is-selectable{cursor:pointer;color:var(--el-text-color-primary)}.g-input-tree-tag__popover .g-input-tree-tag__node.is-selected{color:var(--el-color-primary)}
@@ -1 +1 @@
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-d37c2ffe"]]);$.install=V=>{V.component($.name,$)};exports.GPie3D=$;exports.default=$;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("vue"),pt=require("../GBubble-Dph0YDkU.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(N,{emit:at}){const S=N,lt=at,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},a={...V,...S.config},E=h.ref(null),C=h.ref(null);let L=null,k=0,_=0,Y=1,p=0,u=0,g=0,M=0,b=[],$=S.animation?0:1,F=null,q=S.animation,I=null,X=0;const D=h.ref(-1),z=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,G=(t,l=0,n=0)=>({x:p+l+g*Math.cos(t),y:u+n+M*Math.sin(t)}),j=(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,k=t.clientWidth,_=t.clientHeight,l.width=k*Y,l.height=_*Y,l.style.width=k+"px",l.style.height=_+"px",L=l.getContext("2d"),L&&L.setTransform(Y,0,0,Y,0,0),p=k/2,u=_/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=()=>{b=[];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;b.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=()=>{$=0;const t=800,l=performance.now(),n=s=>{const i=Math.min(1,(s-l)/t);$=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 b){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,_),!b.length)return;const l=b[0]?.startA??0,n=Math.PI*2*$,s=l+n,i=b.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))),A=Math.cos(e.midA)*a.hoverDistance*x,P=Math.sin(e.midA)*a.hoverDistance*x;return{...e,startA:c,endA:f,valid:y,ox:A,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},A=G(c,e.ox,e.oy),P=j(c,e.ox,e.oy);t.fillStyle=T(f,a.opacity*.5),t.beginPath(),t.moveTo(y.x,y.y),t.lineTo(A.x,A.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(A.x,A.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 A=G(c,e.ox,e.oy),P=G(y,e.ox,e.oy),o=j(y,e.ox,e.oy),m=j(c,e.ox,e.oy);t.fillStyle=T(f,a.opacity*.4),t.beginPath(),t.moveTo(A.x,A.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&&$>=.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),H=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:H,y:H,color:ft};(m?c:e).push(ut)}const A=o=>{if(!o.length)return;o.sort((r,H)=>r.targetY-H.targetY);const m=x+a.labelFontSize/2,w=_-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)};A(e),A(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),k-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<b.length;n++){const s=b[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,b.forEach((i,d)=>i.hover=d===s),tt()),s>=0){const i=b[s];z.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 z.value=!1,R.value=null},ht=()=>{D.value!==-1&&(D.value=-1,b.forEach(t=>t.hover=!1),tt()),z.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",b[s].data,s)};return h.watch(()=>S.data,()=>{Object.assign(a,V,S.config),q=S.animation,W()},{deep:!0}),h.watch(()=>S.config,()=>{Object.assign(a,V,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),z.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))}}),B=pt._export_sfc(xt,[["__scopeId","data-v-d37c2ffe"]]);B.install=N=>{N.component(B.name,B)};exports.GPie3D=B;exports.default=B;
@@ -1,5 +1,5 @@
1
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";
2
+ import { _ as St } from "../GBubble-C3cM9Put.mjs";
3
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: {
@@ -1 +1 @@
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
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../GBubble-Dph0YDkU.js"),c={class:"g-progress-bar-container"},m={class:"g-progress-info"},p=["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(s){const r=s,l=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",m,[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":l.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:`${l.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,p),e.createElementVNode("div",{class:"g-progress-count",style:e.normalizeStyle({color:t.textColor})},[e.renderSlot(t.$slots,"count",{},()=>[e.createTextVNode(e.toDisplayString(l.value)+"%",1)],!0)],4)]))}}),a=u._export_sfc(v,[["__scopeId","data-v-324fae85"]]);a.install=s=>{s.component(a.name,a)};exports.GProgress=a;exports.default=a;
@@ -1,5 +1,5 @@
1
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";
2
+ import { _ as S } from "../GBubble-C3cM9Put.mjs";
3
3
  const _ = { class: "g-progress-bar-container" }, k = { class: "g-progress-info" }, C = ["aria-valuenow"], D = {
4
4
  class: "g-progress-splash",
5
5
  "aria-hidden": "true"
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),$=require("../_plugin-vue_export-helper-BHFhmbuH.js"),b=["aria-valuenow"],B=["viewBox"],z=["stop-color"],x=["stop-color"],C=["r","stroke","stroke-width"],T=["r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","transform"],M={class:"g-ring-title"},A={class:"g-ring-count"},P={key:1,class:"g-ring-endpoint g-ring-endpoint--head",style:{"--g-ring-endpoint-angle":"0deg"},"aria-hidden":"true"},R={class:"g-ring-endpoint__inner"},G={class:"g-ring-endpoint__inner"},f=100,I=2e3,W=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(d){const o=d,c=e.computed(()=>{const t=Number(o.count);return Number.isFinite(t)?Math.min(100,Math.max(0,t)):0}),p=e.computed(()=>typeof o.size=="number"?`${o.size}px`:o.size),n=f/2,r=e.computed(()=>o.strokeWidth),u=e.computed(()=>n-r.value/2),v=e.computed(()=>2*Math.PI*u.value),w=e.computed(()=>v.value*(1-c.value/100)),l=e.computed(()=>c.value/100*360),y=e.computed(()=>o.gradient?.[0]??"#3b82f6"),S=e.computed(()=>o.gradient?.[1]??"#f97316"),E=e.computed(()=>"rgba(255, 255, 255, 0)"),N=e.computed(()=>"rgba(255, 255, 255, 0.2)"),g=`g-ring-gradient-${e.getCurrentInstance()?.uid??0}`,h=e.useSlots(),_=e.ref(null);let a=null,s=null;const m=()=>{s&&(clearTimeout(s),s=null),a&&(a.cancel(),a=null)},k=()=>{const t=_.value;t&&(l.value<=0||(a=t.animate([{transform:"rotate(-340deg)"},{transform:`rotate(${l.value-340}deg)`}],{duration:Math.max(200,o.waveSpeed*1e3),easing:"ease",fill:"forwards"}),a.onfinish=()=>{s=setTimeout(()=>{s=null,k()},I)}))},V=()=>{m(),e.nextTick(k)};return e.watch(()=>[o.wave,l.value,o.waveSpeed],([t])=>{if(!t){m();return}V()},{immediate:!0}),e.onBeforeUnmount(m),(t,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["g-ring-container",{"is-force-animation":t.forceAnimation}]),style:e.normalizeStyle({width:p.value,height:p.value,"--g-ring-stroke":`${r.value}%`}),role:"progressbar","aria-valuenow":c.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":`${r.value}%`,"--g-ring-fill-angle":`${l.value}deg`}),"aria-hidden":"true"},[e.createElementVNode("div",{ref_key:"beamRef",ref:_,class:"g-ring-sweep__beam",style:e.normalizeStyle({"--g-ring-sweep-from":E.value,"--g-ring-sweep-to":N.value})},null,4)],4)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{class:"g-ring-svg",viewBox:`0 0 ${f} ${f}`,"aria-hidden":"true"},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:g,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":y.value},null,8,z),e.createElementVNode("stop",{offset:"100%","stop-color":S.value},null,8,x)])]),e.createElementVNode("circle",{class:"g-ring-track",cx:n,cy:n,r:u.value,fill:"none",stroke:`url(#${g})`,"stroke-width":r.value},null,8,C),e.createElementVNode("circle",{class:"g-ring-fill",cx:n,cy:n,r:u.value,fill:"none",stroke:`url(#${g})`,"stroke-width":r.value,"stroke-linecap":"butt","stroke-dasharray":v.value,"stroke-dashoffset":w.value,transform:`rotate(-90 ${n} ${n})`},null,8,T)],8,B)),e.createElementVNode("div",{class:"g-ring-content",style:e.normalizeStyle({color:t.textColor})},[e.createElementVNode("div",M,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),e.createElementVNode("div",A,[e.renderSlot(t.$slots,"count",{},()=>[e.createTextVNode(e.toDisplayString(c.value)+"%",1)],!0)])],4),e.unref(h).head?(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("div",R,[e.renderSlot(t.$slots,"head",{},void 0,!0)])])):e.createCommentVNode("",!0),e.unref(h).tail?(e.openBlock(),e.createElementBlock("div",{key:2,class:"g-ring-endpoint g-ring-endpoint--tail",style:e.normalizeStyle({"--g-ring-endpoint-angle":`${l.value}deg`}),"aria-hidden":"true"},[e.createElementVNode("div",G,[e.renderSlot(t.$slots,"tail",{},void 0,!0)])],4)):e.createCommentVNode("",!0)],14,b))}}),i=$._export_sfc(W,[["__scopeId","data-v-1505555b"]]);i.install=d=>{d.component(i.name,i)};exports.GRing=i;exports.default=i;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("../GBubble-Dph0YDkU.js"),V=["aria-valuenow"],B=["viewBox"],z=["stop-color"],x=["stop-color"],C=["r","stroke","stroke-width"],T=["r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","transform"],M={class:"g-ring-title"},A={class:"g-ring-count"},G={key:1,class:"g-ring-endpoint g-ring-endpoint--head",style:{"--g-ring-endpoint-angle":"0deg"},"aria-hidden":"true"},P={class:"g-ring-endpoint__inner"},R={class:"g-ring-endpoint__inner"},f=100,I=2e3,W=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(d){const o=d,c=e.computed(()=>{const t=Number(o.count);return Number.isFinite(t)?Math.min(100,Math.max(0,t)):0}),p=e.computed(()=>typeof o.size=="number"?`${o.size}px`:o.size),n=f/2,r=e.computed(()=>o.strokeWidth),u=e.computed(()=>n-r.value/2),v=e.computed(()=>2*Math.PI*u.value),w=e.computed(()=>v.value*(1-c.value/100)),l=e.computed(()=>c.value/100*360),y=e.computed(()=>o.gradient?.[0]??"#3b82f6"),S=e.computed(()=>o.gradient?.[1]??"#f97316"),E=e.computed(()=>"rgba(255, 255, 255, 0)"),N=e.computed(()=>"rgba(255, 255, 255, 0.2)"),g=`g-ring-gradient-${e.getCurrentInstance()?.uid??0}`,h=e.useSlots(),_=e.ref(null);let a=null,s=null;const m=()=>{s&&(clearTimeout(s),s=null),a&&(a.cancel(),a=null)},k=()=>{const t=_.value;t&&(l.value<=0||(a=t.animate([{transform:"rotate(-340deg)"},{transform:`rotate(${l.value-340}deg)`}],{duration:Math.max(200,o.waveSpeed*1e3),easing:"ease",fill:"forwards"}),a.onfinish=()=>{s=setTimeout(()=>{s=null,k()},I)}))},$=()=>{m(),e.nextTick(k)};return e.watch(()=>[o.wave,l.value,o.waveSpeed],([t])=>{if(!t){m();return}$()},{immediate:!0}),e.onBeforeUnmount(m),(t,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["g-ring-container",{"is-force-animation":t.forceAnimation}]),style:e.normalizeStyle({width:p.value,height:p.value,"--g-ring-stroke":`${r.value}%`}),role:"progressbar","aria-valuenow":c.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":`${r.value}%`,"--g-ring-fill-angle":`${l.value}deg`}),"aria-hidden":"true"},[e.createElementVNode("div",{ref_key:"beamRef",ref:_,class:"g-ring-sweep__beam",style:e.normalizeStyle({"--g-ring-sweep-from":E.value,"--g-ring-sweep-to":N.value})},null,4)],4)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{class:"g-ring-svg",viewBox:`0 0 ${f} ${f}`,"aria-hidden":"true"},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:g,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":y.value},null,8,z),e.createElementVNode("stop",{offset:"100%","stop-color":S.value},null,8,x)])]),e.createElementVNode("circle",{class:"g-ring-track",cx:n,cy:n,r:u.value,fill:"none",stroke:`url(#${g})`,"stroke-width":r.value},null,8,C),e.createElementVNode("circle",{class:"g-ring-fill",cx:n,cy:n,r:u.value,fill:"none",stroke:`url(#${g})`,"stroke-width":r.value,"stroke-linecap":"butt","stroke-dasharray":v.value,"stroke-dashoffset":w.value,transform:`rotate(-90 ${n} ${n})`},null,8,T)],8,B)),e.createElementVNode("div",{class:"g-ring-content",style:e.normalizeStyle({color:t.textColor})},[e.createElementVNode("div",M,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),e.createElementVNode("div",A,[e.renderSlot(t.$slots,"count",{},()=>[e.createTextVNode(e.toDisplayString(c.value)+"%",1)],!0)])],4),e.unref(h).head?(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("div",P,[e.renderSlot(t.$slots,"head",{},void 0,!0)])])):e.createCommentVNode("",!0),e.unref(h).tail?(e.openBlock(),e.createElementBlock("div",{key:2,class:"g-ring-endpoint g-ring-endpoint--tail",style:e.normalizeStyle({"--g-ring-endpoint-angle":`${l.value}deg`}),"aria-hidden":"true"},[e.createElementVNode("div",R,[e.renderSlot(t.$slots,"tail",{},void 0,!0)])],4)):e.createCommentVNode("",!0)],14,V))}}),i=b._export_sfc(W,[["__scopeId","data-v-1505555b"]]);i.install=d=>{d.component(i.name,i)};exports.GRing=i;exports.default=i;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as N, computed as n, getCurrentInstance as I, useSlots as P, ref as R, watch as V, onBeforeUnmount as W, createElementBlock as d, openBlock as u, normalizeStyle as c, normalizeClass as F, createCommentVNode as _, createElementVNode as t, renderSlot as f, createTextVNode as G, toDisplayString as O, unref as z, nextTick as U } from "vue";
2
- import { _ as D } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
2
+ import { _ as D } from "../GBubble-C3cM9Put.mjs";
3
3
  const j = ["aria-valuenow"], q = ["viewBox"], H = ["stop-color"], J = ["stop-color"], K = ["r", "stroke", "stroke-width"], L = ["r", "stroke", "stroke-width", "stroke-dasharray", "stroke-dashoffset", "transform"], Q = { class: "g-ring-title" }, X = { class: "g-ring-count" }, Y = {
4
4
  key: 1,
5
5
  class: "g-ring-endpoint g-ring-endpoint--head",
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),x=require("@vueuse/core"),Y=require("../index-B8Ap0044.js"),ee=require("../_plugin-vue_export-helper-BHFhmbuH.js");function le(p,M){const f=e.ref(!1);return e.watchEffect(t=>{const h=e.unref(M)||{},{once:S}=h,k=x.unrefElement(p);if(!k||S&&f.value)return;const B=()=>(f.value=!0,S?void 0:()=>{f.value=!1}),d=Y.inView(k,B,{...h,root:e.unref(h.root)});t(()=>{d()})},{flush:"post"}),f}const te=["onMouseenter","onClick"],se={class:"g-scroller__item-text"},ae={class:"g-scroller__item-text"},P=80,ne=10,oe=e.defineComponent({__name:"index",props:{items:{default:()=>[]},showGradients:{type:Boolean,default:!0},className:{default:""},itemClassName:{default:""},displayScrollbar:{type:Boolean,default:!0},initialSelectedIndex:{default:-1},height:{},stagger:{default:.05},loading:{type:Boolean,default:!1},skeletonCount:{default:5},seamless:{type:Boolean,default:!1},seamlessSpeed:{default:40},seamlessDirection:{default:"up"},seamlessPauseOnHover:{type:Boolean,default:!0}},emits:["itemSelected"],setup(p,{emit:M}){const f=e.defineComponent({name:"AnimatedItem",props:{index:{type:Number,required:!0},stagger:{type:Number,default:.05},instant:{type:Boolean,default:!1}},emits:["mouseenter","click"],setup(l,{slots:n,emit:s}){const a=e.ref(null),i=le(a,{amount:.5,once:!1});return()=>e.h(Y.motion.div,{ref:a,"data-index":l.index,style:{marginBottom:"1rem",cursor:"pointer"},initial:{x:-24,opacity:0},animate:i.value?{x:0,opacity:1}:{x:-24,opacity:0},transition:l.instant?{duration:0}:{duration:.3,delay:Math.min(l.index*l.stagger,.3),ease:"easeOut"},onMouseenter:m=>s("mouseenter",m),onClick:m=>s("click",m)},n.default?.())}}),t=p,h=M,S=e.useSlots(),k=e.computed(()=>!!S.default),B=e.ref(null),d=e.ref(t.initialSelectedIndex),O=e.ref(0),$=e.ref(1),F=e.ref(0),_=e.ref(0),E=e.ref(!1);let c=null;const T=e.ref(!1);let z=0,N=0,u=null;const L=e.ref(null),D=e.ref(null),W=e.computed(()=>t.seamless&&t.items.length>0?[...t.items,...t.items]:t.items),o=e.ref(0),C=e.ref(!1),r=e.ref(0),V=e.ref(!1);let v=null,g=0;const U=e.computed(()=>{const l={};return t.height!=null&&t.height!==""&&(l.height=typeof t.height=="number"?`${t.height}px`:String(t.height)),l}),j=e.computed(()=>({transform:`translateY(${o.value}px)`}));function K(l,n,s){return Math.min(Math.max(l,n),s)}const R=l=>{d.value=l},q=(l,n)=>{d.value=n,h("itemSelected",l,n)},X=l=>{const n=l.target,{scrollTop:s,scrollHeight:a,clientHeight:i}=n,m=performance.now();N>0&&Math.abs(s-z)/(m-N)>ne&&(T.value=!0),z=s,N=m,u&&clearTimeout(u),u=setTimeout(()=>{T.value=!1},150),O.value=Math.min(s/50,1);const I=a-(s+i);$.value=a<=i?0:Math.min(I/50,1)};function J(l){const n=B.value;if(!n)return;const{scrollTop:s,scrollHeight:a,clientHeight:i}=n;if(a<=i)return;const m=s<=0,I=s+i>=a-1;if(m&&l.deltaY<0||I&&l.deltaY>0){const G=K(_.value-l.deltaY*.3,-P,P);_.value=G,E.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{_.value=0,E.value=!1},150)}}function w(){const l=D.value;if(!l||t.items.length===0){r.value=0,V.value=!1;return}const n=t.items.length,s=l.children[n];r.value=s?s.offsetTop:l.scrollHeight/2;const a=L.value;V.value=a?r.value>a.clientHeight:!0}function A(l){g===0&&(g=l);const n=l-g;if(g=l,!C.value&&r.value>0&&t.items.length>0){const s=t.seamlessSpeed*n/1e3;t.seamlessDirection==="down"?(o.value+=s,o.value>=0&&(o.value-=r.value)):(o.value-=s,o.value<=-r.value&&(o.value+=r.value))}v=requestAnimationFrame(A)}function b(){v==null&&(g=0,v=requestAnimationFrame(A))}function H(){v!=null&&(cancelAnimationFrame(v),v=null),g=0}function Q(){t.seamlessPauseOnHover&&(C.value=!0)}function Z(){t.seamlessPauseOnHover&&(C.value=!1)}return e.onMounted(()=>{t.seamless&&!t.loading&&(w(),o.value=t.seamlessDirection==="down"?-r.value:0,b())}),e.onUnmounted(()=>{H(),c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null)}),e.watch(()=>t.items,()=>{t.seamless&&e.nextTick(()=>{w(),o.value=t.seamlessDirection==="down"?-r.value:0}),F.value++,d.value=-1}),e.watch(()=>t.seamless,l=>{l&&!t.loading?e.nextTick(()=>{w(),o.value=t.seamlessDirection==="down"?-r.value:0,b()}):(H(),o.value=0,C.value=!1)}),e.watch(()=>t.loading,l=>{l?(_.value=0,E.value=!1,T.value=!1,H(),c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null)):t.seamless&&e.nextTick(()=>{w(),o.value=t.seamlessDirection==="down"?-r.value:0,b()})}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["g-scroller",l.className]),style:e.normalizeStyle(U.value)},[l.seamless&&!l.loading?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"seamlessWrapRef",ref:L,class:"g-scroller__seamless",onMouseenter:Q,onMouseleave:Z},[e.createElementVNode("div",{ref_key:"seamlessTrackRef",ref:D,class:"g-scroller__seamless-track",style:e.normalizeStyle(j.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(s,a)=>(e.openBlock(),e.createElementBlock("div",{key:`seamless-${a}`,class:e.normalizeClass(["g-scroller__item","g-scroller__item--seamless",!k.value&&"g-scroller__item--default",d.value===a%l.items.length&&"g-scroller__item--active",l.itemClassName]),onMouseenter:i=>R(a%l.items.length),onClick:i=>q(s,a%l.items.length)},[e.renderSlot(l.$slots,"default",{item:s,index:a%l.items.length},()=>[e.createElementVNode("p",se,e.toDisplayString(s),1)],!0)],42,te))),128))],4),l.showGradients&&V.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("div",{class:"g-scroller__gradient g-scroller__gradient--top"},null,-1)),n[1]||(n[1]=e.createElementVNode("div",{class:"g-scroller__gradient g-scroller__gradient--bottom"},null,-1))],64)):e.createCommentVNode("",!0)],544)):l.loading?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["g-scroller__list",!l.displayScrollbar&&"g-scroller__list--hidden-scrollbar"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.skeletonCount,s=>(e.openBlock(),e.createElementBlock("div",{key:`skeleton-${s}`,class:"g-scroller__skeleton"},n[2]||(n[2]=[e.createElementVNode("div",{class:"g-scroller__skeleton-line"},null,-1)])))),128))],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{ref_key:"listRef",ref:B,class:e.normalizeClass(["g-scroller__list",!l.displayScrollbar&&"g-scroller__list--hidden-scrollbar"]),onScroll:X,onWheel:J},[e.createElementVNode("div",{class:e.normalizeClass(["g-scroller__content",{"g-scroller__content--pulling":E.value}]),style:e.normalizeStyle({transform:`translateY(${_.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,(s,a)=>(e.openBlock(),e.createBlock(e.unref(f),{key:`${F.value}-${a}`,index:a,stagger:l.stagger,instant:T.value,onMouseenter:i=>R(a),onClick:i=>q(s,a)},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["g-scroller__item",!k.value&&"g-scroller__item--default",d.value===a&&"g-scroller__item--active",l.itemClassName])},[e.renderSlot(l.$slots,"default",{item:s,index:a},()=>[e.createElementVNode("p",ae,e.toDisplayString(s),1)],!0)],2)]),_:2},1032,["index","stagger","instant","onMouseenter","onClick"]))),128))],6)],34),l.showGradients?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",{class:"g-scroller__gradient g-scroller__gradient--top",style:e.normalizeStyle({opacity:O.value})},null,4),e.createElementVNode("div",{class:"g-scroller__gradient g-scroller__gradient--bottom",style:e.normalizeStyle({opacity:$.value})},null,4)],64)):e.createCommentVNode("",!0)],64))],6))}}),y=ee._export_sfc(oe,[["__scopeId","data-v-972060e6"]]);y.install=p=>{p.component(y.name,y)};exports.GScroller=y;exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),R=require("motion-v"),x=require("../GBubble-Dph0YDkU.js"),ee=["onMouseenter","onClick"],le={class:"g-scroller__item-text"},te={class:"g-scroller__item-text"},G=80,se=10,ae=e.defineComponent({__name:"index",props:{items:{default:()=>[]},showGradients:{type:Boolean,default:!0},className:{default:""},itemClassName:{default:""},displayScrollbar:{type:Boolean,default:!0},initialSelectedIndex:{default:-1},height:{},stagger:{default:.05},loading:{type:Boolean,default:!1},skeletonCount:{default:5},seamless:{type:Boolean,default:!1},seamlessSpeed:{default:40},seamlessDirection:{default:"up"},seamlessPauseOnHover:{type:Boolean,default:!0}},emits:["itemSelected"],setup(S,{emit:A}){const P=e.defineComponent({name:"AnimatedItem",props:{index:{type:Number,required:!0},stagger:{type:Number,default:.05},instant:{type:Boolean,default:!1}},emits:["mouseenter","click"],setup(l,{slots:n,emit:s}){const a=e.ref(null),i=R.useInView(a,{amount:.5,once:!1});return()=>e.h(R.motion.div,{ref:a,"data-index":l.index,style:{marginBottom:"1rem",cursor:"pointer"},initial:{x:-24,opacity:0},animate:i.value?{x:0,opacity:1}:{x:-24,opacity:0},transition:l.instant?{duration:0}:{duration:.3,delay:Math.min(l.index*l.stagger,.3),ease:"easeOut"},onMouseenter:m=>s("mouseenter",m),onClick:m=>s("click",m)},n.default?.())}}),t=S,q=A,Y=e.useSlots(),N=e.computed(()=>!!Y.default),w=e.ref(null),g=e.ref(t.initialSelectedIndex),b=e.ref(0),V=e.ref(1),H=e.ref(0),v=e.ref(0),h=e.ref(!1);let c=null;const k=e.ref(!1);let $=0,B=0,u=null;const F=e.ref(null),I=e.ref(null),W=e.computed(()=>t.seamless&&t.items.length>0?[...t.items,...t.items]:t.items),o=e.ref(0),_=e.ref(!1),r=e.ref(0),E=e.ref(!1);let d=null,f=0;const U=e.computed(()=>{const l={};return t.height!=null&&t.height!==""&&(l.height=typeof t.height=="number"?`${t.height}px`:String(t.height)),l}),j=e.computed(()=>({transform:`translateY(${o.value}px)`}));function K(l,n,s){return Math.min(Math.max(l,n),s)}const O=l=>{g.value=l},z=(l,n)=>{g.value=n,q("itemSelected",l,n)},X=l=>{const n=l.target,{scrollTop:s,scrollHeight:a,clientHeight:i}=n,m=performance.now();B>0&&Math.abs(s-$)/(m-B)>se&&(k.value=!0),$=s,B=m,u&&clearTimeout(u),u=setTimeout(()=>{k.value=!1},150),b.value=Math.min(s/50,1);const M=a-(s+i);V.value=a<=i?0:Math.min(M/50,1)};function J(l){const n=w.value;if(!n)return;const{scrollTop:s,scrollHeight:a,clientHeight:i}=n;if(a<=i)return;const m=s<=0,M=s+i>=a-1;if(m&&l.deltaY<0||M&&l.deltaY>0){const D=K(v.value-l.deltaY*.3,-G,G);v.value=D,h.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{v.value=0,h.value=!1},150)}}function y(){const l=I.value;if(!l||t.items.length===0){r.value=0,E.value=!1;return}const n=t.items.length,s=l.children[n];r.value=s?s.offsetTop:l.scrollHeight/2;const a=F.value;E.value=a?r.value>a.clientHeight:!0}function L(l){f===0&&(f=l);const n=l-f;if(f=l,!_.value&&r.value>0&&t.items.length>0){const s=t.seamlessSpeed*n/1e3;t.seamlessDirection==="down"?(o.value+=s,o.value>=0&&(o.value-=r.value)):(o.value-=s,o.value<=-r.value&&(o.value+=r.value))}d=requestAnimationFrame(L)}function T(){d==null&&(f=0,d=requestAnimationFrame(L))}function C(){d!=null&&(cancelAnimationFrame(d),d=null),f=0}function Q(){t.seamlessPauseOnHover&&(_.value=!0)}function Z(){t.seamlessPauseOnHover&&(_.value=!1)}return e.onMounted(()=>{t.seamless&&!t.loading&&(y(),o.value=t.seamlessDirection==="down"?-r.value:0,T())}),e.onUnmounted(()=>{C(),c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null)}),e.watch(()=>t.items,()=>{t.seamless&&e.nextTick(()=>{y(),o.value=t.seamlessDirection==="down"?-r.value:0}),H.value++,g.value=-1}),e.watch(()=>t.seamless,l=>{l&&!t.loading?e.nextTick(()=>{y(),o.value=t.seamlessDirection==="down"?-r.value:0,T()}):(C(),o.value=0,_.value=!1)}),e.watch(()=>t.loading,l=>{l?(v.value=0,h.value=!1,k.value=!1,C(),c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null)):t.seamless&&e.nextTick(()=>{y(),o.value=t.seamlessDirection==="down"?-r.value:0,T()})}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["g-scroller",l.className]),style:e.normalizeStyle(U.value)},[l.seamless&&!l.loading?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"seamlessWrapRef",ref:F,class:"g-scroller__seamless",onMouseenter:Q,onMouseleave:Z},[e.createElementVNode("div",{ref_key:"seamlessTrackRef",ref:I,class:"g-scroller__seamless-track",style:e.normalizeStyle(j.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(s,a)=>(e.openBlock(),e.createElementBlock("div",{key:`seamless-${a}`,class:e.normalizeClass(["g-scroller__item","g-scroller__item--seamless",!N.value&&"g-scroller__item--default",g.value===a%l.items.length&&"g-scroller__item--active",l.itemClassName]),onMouseenter:i=>O(a%l.items.length),onClick:i=>z(s,a%l.items.length)},[e.renderSlot(l.$slots,"default",{item:s,index:a%l.items.length},()=>[e.createElementVNode("p",le,e.toDisplayString(s),1)],!0)],42,ee))),128))],4),l.showGradients&&E.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("div",{class:"g-scroller__gradient g-scroller__gradient--top"},null,-1)),n[1]||(n[1]=e.createElementVNode("div",{class:"g-scroller__gradient g-scroller__gradient--bottom"},null,-1))],64)):e.createCommentVNode("",!0)],544)):l.loading?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["g-scroller__list",!l.displayScrollbar&&"g-scroller__list--hidden-scrollbar"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.skeletonCount,s=>(e.openBlock(),e.createElementBlock("div",{key:`skeleton-${s}`,class:"g-scroller__skeleton"},n[2]||(n[2]=[e.createElementVNode("div",{class:"g-scroller__skeleton-line"},null,-1)])))),128))],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{ref_key:"listRef",ref:w,class:e.normalizeClass(["g-scroller__list",!l.displayScrollbar&&"g-scroller__list--hidden-scrollbar"]),onScroll:X,onWheel:J},[e.createElementVNode("div",{class:e.normalizeClass(["g-scroller__content",{"g-scroller__content--pulling":h.value}]),style:e.normalizeStyle({transform:`translateY(${v.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,(s,a)=>(e.openBlock(),e.createBlock(e.unref(P),{key:`${H.value}-${a}`,index:a,stagger:l.stagger,instant:k.value,onMouseenter:i=>O(a),onClick:i=>z(s,a)},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["g-scroller__item",!N.value&&"g-scroller__item--default",g.value===a&&"g-scroller__item--active",l.itemClassName])},[e.renderSlot(l.$slots,"default",{item:s,index:a},()=>[e.createElementVNode("p",te,e.toDisplayString(s),1)],!0)],2)]),_:2},1032,["index","stagger","instant","onMouseenter","onClick"]))),128))],6)],34),l.showGradients?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",{class:"g-scroller__gradient g-scroller__gradient--top",style:e.normalizeStyle({opacity:b.value})},null,4),e.createElementVNode("div",{class:"g-scroller__gradient g-scroller__gradient--bottom",style:e.normalizeStyle({opacity:V.value})},null,4)],64)):e.createCommentVNode("",!0)],64))],6))}}),p=x._export_sfc(ae,[["__scopeId","data-v-972060e6"]]);p.install=S=>{S.component(p.name,p)};exports.GScroller=p;exports.default=p;
@@ -1,24 +1,7 @@
1
- import { ref as n, watchEffect as de, unref as W, defineComponent as ee, h as ve, useSlots as ge, computed as B, onMounted as pe, onUnmounted as he, watch as G, nextTick as P, createElementBlock as c, openBlock as r, normalizeStyle as C, normalizeClass as y, createElementVNode as m, createCommentVNode as le, Fragment as k, renderList as V, renderSlot as te, toDisplayString as se, createBlock as _e, withCtx as ye } from "vue";
2
- import { unrefElement as ke } from "@vueuse/core";
3
- import { i as Se, m as Te } from "../index-Bbr5fWvI.mjs";
4
- import { _ as we } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
5
- function Me(S, E) {
6
- const p = n(!1);
7
- return de((l) => {
8
- const T = W(E) || {}, { once: H } = T, w = ke(S);
9
- if (!w || H && p.value) return;
10
- const g = Se(w, () => (p.value = !0, H ? void 0 : () => {
11
- p.value = !1;
12
- }), {
13
- ...T,
14
- root: W(T.root)
15
- });
16
- l(() => {
17
- g();
18
- });
19
- }, { flush: "post" }), p;
20
- }
21
- const Ce = ["onMouseenter", "onClick"], He = { class: "g-scroller__item-text" }, be = { class: "g-scroller__item-text" }, ae = 80, Ie = 10, $e = /* @__PURE__ */ ee({
1
+ import { defineComponent as j, ref as n, h as de, useSlots as fe, computed as H, onMounted as ve, onUnmounted as ge, watch as D, nextTick as L, createElementBlock as c, openBlock as r, normalizeStyle as S, normalizeClass as h, createElementVNode as m, createCommentVNode as J, Fragment as _, renderList as N, renderSlot as Q, toDisplayString as Z, createBlock as pe, unref as he, withCtx as _e } from "vue";
2
+ import { useInView as ye, motion as ke } from "motion-v";
3
+ import { _ as Se } from "../GBubble-C3cM9Put.mjs";
4
+ const Te = ["onMouseenter", "onClick"], Me = { class: "g-scroller__item-text" }, we = { class: "g-scroller__item-text" }, x = 80, Ce = 10, He = /* @__PURE__ */ j({
22
5
  __name: "index",
23
6
  props: {
24
7
  items: { default: () => [] },
@@ -37,8 +20,8 @@ const Ce = ["onMouseenter", "onClick"], He = { class: "g-scroller__item-text" },
37
20
  seamlessPauseOnHover: { type: Boolean, default: !0 }
38
21
  },
39
22
  emits: ["itemSelected"],
40
- setup(S, { emit: E }) {
41
- const p = ee({
23
+ setup(b, { emit: ee }) {
24
+ const le = j({
42
25
  name: "AnimatedItem",
43
26
  props: {
44
27
  index: { type: Number, required: !0 },
@@ -47,12 +30,12 @@ const Ce = ["onMouseenter", "onClick"], He = { class: "g-scroller__item-text" },
47
30
  instant: { type: Boolean, default: !1 }
48
31
  },
49
32
  emits: ["mouseenter", "click"],
50
- setup(e, { slots: a, emit: t }) {
51
- const s = n(null), u = Me(s, { amount: 0.5, once: !1 });
52
- return () => ve(
53
- Te.div,
33
+ setup(e, { slots: a, emit: s }) {
34
+ const t = n(null), u = ye(t, { amount: 0.5, once: !1 });
35
+ return () => de(
36
+ ke.div,
54
37
  {
55
- ref: s,
38
+ ref: t,
56
39
  "data-index": e.index,
57
40
  style: { marginBottom: "1rem", cursor: "pointer" },
58
41
  initial: { x: -24, opacity: 0 },
@@ -62,197 +45,197 @@ const Ce = ["onMouseenter", "onClick"], He = { class: "g-scroller__item-text" },
62
45
  delay: Math.min(e.index * e.stagger, 0.3),
63
46
  ease: "easeOut"
64
47
  },
65
- onMouseenter: (v) => t("mouseenter", v),
66
- onClick: (v) => t("click", v)
48
+ onMouseenter: (v) => s("mouseenter", v),
49
+ onClick: (v) => s("click", v)
67
50
  },
68
51
  a.default?.()
69
52
  );
70
53
  }
71
- }), l = S, T = E, H = ge(), w = B(() => !!H.default), R = n(null), g = n(l.initialSelectedIndex), q = n(0), z = n(1), U = n(0), M = n(0), b = n(!1);
72
- let f = null;
73
- const I = n(!1);
74
- let K = 0, D = 0, d = null;
75
- const X = n(null), j = n(null), ne = B(
54
+ }), l = b, se = ee, te = fe(), F = H(() => !!te.default), E = n(null), y = n(l.initialSelectedIndex), G = n(0), P = n(1), Y = n(0), k = n(0), T = n(!1);
55
+ let d = null;
56
+ const M = n(!1);
57
+ let V = 0, $ = 0, f = null;
58
+ const W = n(null), q = n(null), ae = H(
76
59
  () => l.seamless && l.items.length > 0 ? [...l.items, ...l.items] : l.items
77
- ), o = n(0), $ = n(!1), i = n(0), L = n(!1);
78
- let h = null, _ = 0;
79
- const oe = B(() => {
60
+ ), o = n(0), w = n(!1), i = n(0), I = n(!1);
61
+ let g = null, p = 0;
62
+ const ne = H(() => {
80
63
  const e = {};
81
64
  return l.height != null && l.height !== "" && (e.height = typeof l.height == "number" ? `${l.height}px` : String(l.height)), e;
82
- }), re = B(() => ({
65
+ }), oe = H(() => ({
83
66
  transform: `translateY(${o.value}px)`
84
67
  }));
85
- function ie(e, a, t) {
86
- return Math.min(Math.max(e, a), t);
68
+ function re(e, a, s) {
69
+ return Math.min(Math.max(e, a), s);
87
70
  }
88
- const J = (e) => {
89
- g.value = e;
90
- }, Q = (e, a) => {
91
- g.value = a, T("itemSelected", e, a);
92
- }, ue = (e) => {
93
- const a = e.target, { scrollTop: t, scrollHeight: s, clientHeight: u } = a, v = performance.now();
94
- D > 0 && Math.abs(t - K) / (v - D) > Ie && (I.value = !0), K = t, D = v, d && clearTimeout(d), d = setTimeout(() => {
95
- I.value = !1;
96
- }, 150), q.value = Math.min(t / 50, 1);
97
- const F = s - (t + u);
98
- z.value = s <= u ? 0 : Math.min(F / 50, 1);
71
+ const z = (e) => {
72
+ y.value = e;
73
+ }, U = (e, a) => {
74
+ y.value = a, se("itemSelected", e, a);
75
+ }, ie = (e) => {
76
+ const a = e.target, { scrollTop: s, scrollHeight: t, clientHeight: u } = a, v = performance.now();
77
+ $ > 0 && Math.abs(s - V) / (v - $) > Ce && (M.value = !0), V = s, $ = v, f && clearTimeout(f), f = setTimeout(() => {
78
+ M.value = !1;
79
+ }, 150), G.value = Math.min(s / 50, 1);
80
+ const R = t - (s + u);
81
+ P.value = t <= u ? 0 : Math.min(R / 50, 1);
99
82
  };
100
- function ce(e) {
101
- const a = R.value;
83
+ function ue(e) {
84
+ const a = E.value;
102
85
  if (!a) return;
103
- const { scrollTop: t, scrollHeight: s, clientHeight: u } = a;
104
- if (s <= u) return;
105
- const v = t <= 0, F = t + u >= s - 1;
106
- if (v && e.deltaY < 0 || F && e.deltaY > 0) {
107
- const x = ie(M.value - e.deltaY * 0.3, -ae, ae);
108
- M.value = x, b.value = !0, f && clearTimeout(f), f = setTimeout(() => {
109
- M.value = 0, b.value = !1;
86
+ const { scrollTop: s, scrollHeight: t, clientHeight: u } = a;
87
+ if (t <= u) return;
88
+ const v = s <= 0, R = s + u >= t - 1;
89
+ if (v && e.deltaY < 0 || R && e.deltaY > 0) {
90
+ const X = re(k.value - e.deltaY * 0.3, -x, x);
91
+ k.value = X, T.value = !0, d && clearTimeout(d), d = setTimeout(() => {
92
+ k.value = 0, T.value = !1;
110
93
  }, 150);
111
94
  }
112
95
  }
113
- function O() {
114
- const e = j.value;
96
+ function C() {
97
+ const e = q.value;
115
98
  if (!e || l.items.length === 0) {
116
- i.value = 0, L.value = !1;
99
+ i.value = 0, I.value = !1;
117
100
  return;
118
101
  }
119
- const a = l.items.length, t = e.children[a];
120
- i.value = t ? t.offsetTop : e.scrollHeight / 2;
121
- const s = X.value;
122
- L.value = s ? i.value > s.clientHeight : !0;
102
+ const a = l.items.length, s = e.children[a];
103
+ i.value = s ? s.offsetTop : e.scrollHeight / 2;
104
+ const t = W.value;
105
+ I.value = t ? i.value > t.clientHeight : !0;
123
106
  }
124
- function Z(e) {
125
- _ === 0 && (_ = e);
126
- const a = e - _;
127
- if (_ = e, !$.value && i.value > 0 && l.items.length > 0) {
128
- const t = l.seamlessSpeed * a / 1e3;
129
- l.seamlessDirection === "down" ? (o.value += t, o.value >= 0 && (o.value -= i.value)) : (o.value -= t, o.value <= -i.value && (o.value += i.value));
107
+ function K(e) {
108
+ p === 0 && (p = e);
109
+ const a = e - p;
110
+ if (p = e, !w.value && i.value > 0 && l.items.length > 0) {
111
+ const s = l.seamlessSpeed * a / 1e3;
112
+ l.seamlessDirection === "down" ? (o.value += s, o.value >= 0 && (o.value -= i.value)) : (o.value -= s, o.value <= -i.value && (o.value += i.value));
130
113
  }
131
- h = requestAnimationFrame(Z);
114
+ g = requestAnimationFrame(K);
115
+ }
116
+ function B() {
117
+ g == null && (p = 0, g = requestAnimationFrame(K));
132
118
  }
133
- function N() {
134
- h == null && (_ = 0, h = requestAnimationFrame(Z));
119
+ function O() {
120
+ g != null && (cancelAnimationFrame(g), g = null), p = 0;
135
121
  }
136
- function A() {
137
- h != null && (cancelAnimationFrame(h), h = null), _ = 0;
122
+ function ce() {
123
+ l.seamlessPauseOnHover && (w.value = !0);
138
124
  }
139
125
  function me() {
140
- l.seamlessPauseOnHover && ($.value = !0);
141
- }
142
- function fe() {
143
- l.seamlessPauseOnHover && ($.value = !1);
126
+ l.seamlessPauseOnHover && (w.value = !1);
144
127
  }
145
- return pe(() => {
146
- l.seamless && !l.loading && (O(), o.value = l.seamlessDirection === "down" ? -i.value : 0, N());
147
- }), he(() => {
148
- A(), f && (clearTimeout(f), f = null), d && (clearTimeout(d), d = null);
149
- }), G(
128
+ return ve(() => {
129
+ l.seamless && !l.loading && (C(), o.value = l.seamlessDirection === "down" ? -i.value : 0, B());
130
+ }), ge(() => {
131
+ O(), d && (clearTimeout(d), d = null), f && (clearTimeout(f), f = null);
132
+ }), D(
150
133
  () => l.items,
151
134
  () => {
152
- l.seamless && P(() => {
153
- O(), o.value = l.seamlessDirection === "down" ? -i.value : 0;
154
- }), U.value++, g.value = -1;
135
+ l.seamless && L(() => {
136
+ C(), o.value = l.seamlessDirection === "down" ? -i.value : 0;
137
+ }), Y.value++, y.value = -1;
155
138
  }
156
- ), G(
139
+ ), D(
157
140
  () => l.seamless,
158
141
  (e) => {
159
- e && !l.loading ? P(() => {
160
- O(), o.value = l.seamlessDirection === "down" ? -i.value : 0, N();
161
- }) : (A(), o.value = 0, $.value = !1);
142
+ e && !l.loading ? L(() => {
143
+ C(), o.value = l.seamlessDirection === "down" ? -i.value : 0, B();
144
+ }) : (O(), o.value = 0, w.value = !1);
162
145
  }
163
- ), G(
146
+ ), D(
164
147
  () => l.loading,
165
148
  (e) => {
166
- e ? (M.value = 0, b.value = !1, I.value = !1, A(), f && (clearTimeout(f), f = null), d && (clearTimeout(d), d = null)) : l.seamless && P(() => {
167
- O(), o.value = l.seamlessDirection === "down" ? -i.value : 0, N();
149
+ e ? (k.value = 0, T.value = !1, M.value = !1, O(), d && (clearTimeout(d), d = null), f && (clearTimeout(f), f = null)) : l.seamless && L(() => {
150
+ C(), o.value = l.seamlessDirection === "down" ? -i.value : 0, B();
168
151
  });
169
152
  }
170
153
  ), (e, a) => (r(), c("div", {
171
- class: y(["g-scroller", e.className]),
172
- style: C(oe.value)
154
+ class: h(["g-scroller", e.className]),
155
+ style: S(ne.value)
173
156
  }, [
174
157
  e.seamless && !e.loading ? (r(), c("div", {
175
158
  key: 0,
176
159
  ref_key: "seamlessWrapRef",
177
- ref: X,
160
+ ref: W,
178
161
  class: "g-scroller__seamless",
179
- onMouseenter: me,
180
- onMouseleave: fe
162
+ onMouseenter: ce,
163
+ onMouseleave: me
181
164
  }, [
182
165
  m("div", {
183
166
  ref_key: "seamlessTrackRef",
184
- ref: j,
167
+ ref: q,
185
168
  class: "g-scroller__seamless-track",
186
- style: C(re.value)
169
+ style: S(oe.value)
187
170
  }, [
188
- (r(!0), c(k, null, V(ne.value, (t, s) => (r(), c("div", {
189
- key: `seamless-${s}`,
190
- class: y([
171
+ (r(!0), c(_, null, N(ae.value, (s, t) => (r(), c("div", {
172
+ key: `seamless-${t}`,
173
+ class: h([
191
174
  "g-scroller__item",
192
175
  "g-scroller__item--seamless",
193
- !w.value && "g-scroller__item--default",
194
- g.value === s % e.items.length && "g-scroller__item--active",
176
+ !F.value && "g-scroller__item--default",
177
+ y.value === t % e.items.length && "g-scroller__item--active",
195
178
  e.itemClassName
196
179
  ]),
197
- onMouseenter: (u) => J(s % e.items.length),
198
- onClick: (u) => Q(t, s % e.items.length)
180
+ onMouseenter: (u) => z(t % e.items.length),
181
+ onClick: (u) => U(s, t % e.items.length)
199
182
  }, [
200
- te(e.$slots, "default", {
201
- item: t,
202
- index: s % e.items.length
183
+ Q(e.$slots, "default", {
184
+ item: s,
185
+ index: t % e.items.length
203
186
  }, () => [
204
- m("p", He, se(t), 1)
187
+ m("p", Me, Z(s), 1)
205
188
  ], !0)
206
- ], 42, Ce))), 128))
189
+ ], 42, Te))), 128))
207
190
  ], 4),
208
- e.showGradients && L.value ? (r(), c(k, { key: 0 }, [
191
+ e.showGradients && I.value ? (r(), c(_, { key: 0 }, [
209
192
  a[0] || (a[0] = m("div", { class: "g-scroller__gradient g-scroller__gradient--top" }, null, -1)),
210
193
  a[1] || (a[1] = m("div", { class: "g-scroller__gradient g-scroller__gradient--bottom" }, null, -1))
211
- ], 64)) : le("", !0)
194
+ ], 64)) : J("", !0)
212
195
  ], 544)) : e.loading ? (r(), c("div", {
213
196
  key: 1,
214
- class: y(["g-scroller__list", !e.displayScrollbar && "g-scroller__list--hidden-scrollbar"])
197
+ class: h(["g-scroller__list", !e.displayScrollbar && "g-scroller__list--hidden-scrollbar"])
215
198
  }, [
216
- (r(!0), c(k, null, V(e.skeletonCount, (t) => (r(), c("div", {
217
- key: `skeleton-${t}`,
199
+ (r(!0), c(_, null, N(e.skeletonCount, (s) => (r(), c("div", {
200
+ key: `skeleton-${s}`,
218
201
  class: "g-scroller__skeleton"
219
202
  }, a[2] || (a[2] = [
220
203
  m("div", { class: "g-scroller__skeleton-line" }, null, -1)
221
204
  ])))), 128))
222
- ], 2)) : (r(), c(k, { key: 2 }, [
205
+ ], 2)) : (r(), c(_, { key: 2 }, [
223
206
  m("div", {
224
207
  ref_key: "listRef",
225
- ref: R,
226
- class: y(["g-scroller__list", !e.displayScrollbar && "g-scroller__list--hidden-scrollbar"]),
227
- onScroll: ue,
228
- onWheel: ce
208
+ ref: E,
209
+ class: h(["g-scroller__list", !e.displayScrollbar && "g-scroller__list--hidden-scrollbar"]),
210
+ onScroll: ie,
211
+ onWheel: ue
229
212
  }, [
230
213
  m("div", {
231
- class: y(["g-scroller__content", { "g-scroller__content--pulling": b.value }]),
232
- style: C({ transform: `translateY(${M.value}px)` })
214
+ class: h(["g-scroller__content", { "g-scroller__content--pulling": T.value }]),
215
+ style: S({ transform: `translateY(${k.value}px)` })
233
216
  }, [
234
- (r(!0), c(k, null, V(e.items, (t, s) => (r(), _e(W(p), {
235
- key: `${U.value}-${s}`,
236
- index: s,
217
+ (r(!0), c(_, null, N(e.items, (s, t) => (r(), pe(he(le), {
218
+ key: `${Y.value}-${t}`,
219
+ index: t,
237
220
  stagger: e.stagger,
238
- instant: I.value,
239
- onMouseenter: (u) => J(s),
240
- onClick: (u) => Q(t, s)
221
+ instant: M.value,
222
+ onMouseenter: (u) => z(t),
223
+ onClick: (u) => U(s, t)
241
224
  }, {
242
- default: ye(() => [
225
+ default: _e(() => [
243
226
  m("div", {
244
- class: y([
227
+ class: h([
245
228
  "g-scroller__item",
246
- !w.value && "g-scroller__item--default",
247
- g.value === s && "g-scroller__item--active",
229
+ !F.value && "g-scroller__item--default",
230
+ y.value === t && "g-scroller__item--active",
248
231
  e.itemClassName
249
232
  ])
250
233
  }, [
251
- te(e.$slots, "default", {
252
- item: t,
253
- index: s
234
+ Q(e.$slots, "default", {
235
+ item: s,
236
+ index: t
254
237
  }, () => [
255
- m("p", be, se(t), 1)
238
+ m("p", we, Z(s), 1)
256
239
  ], !0)
257
240
  ], 2)
258
241
  ]),
@@ -260,24 +243,24 @@ const Ce = ["onMouseenter", "onClick"], He = { class: "g-scroller__item-text" },
260
243
  }, 1032, ["index", "stagger", "instant", "onMouseenter", "onClick"]))), 128))
261
244
  ], 6)
262
245
  ], 34),
263
- e.showGradients ? (r(), c(k, { key: 0 }, [
246
+ e.showGradients ? (r(), c(_, { key: 0 }, [
264
247
  m("div", {
265
248
  class: "g-scroller__gradient g-scroller__gradient--top",
266
- style: C({ opacity: q.value })
249
+ style: S({ opacity: G.value })
267
250
  }, null, 4),
268
251
  m("div", {
269
252
  class: "g-scroller__gradient g-scroller__gradient--bottom",
270
- style: C({ opacity: z.value })
253
+ style: S({ opacity: P.value })
271
254
  }, null, 4)
272
- ], 64)) : le("", !0)
255
+ ], 64)) : J("", !0)
273
256
  ], 64))
274
257
  ], 6));
275
258
  }
276
- }), Y = /* @__PURE__ */ we($e, [["__scopeId", "data-v-972060e6"]]);
277
- Y.install = (S) => {
278
- S.component(Y.name, Y);
259
+ }), A = /* @__PURE__ */ Se(He, [["__scopeId", "data-v-972060e6"]]);
260
+ A.install = (b) => {
261
+ b.component(A.name, A);
279
262
  };
280
263
  export {
281
- Y as GScroller,
282
- Y as default
264
+ A as GScroller,
265
+ A as default
283
266
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),u=require("../index-B8Ap0044.js");function A(...t){const e=!Array.isArray(t[0]),l=e?0:-1,n=t[0+l],s=t[1+l],r=t[2+l],c=t[3+l],o=u.interpolate(s,r,c);return e?o(n):o}function S(t){let e=0;const l=({timestamp:s,delta:r})=>{e||(e=s),t(s-e,r)},n=()=>u.cancelFrame(l);a.onBeforeUpdate(()=>{n(),u.frame.update(l,!0)}),a.onUnmounted(()=>n()),u.frame.update(l,!0)}function k(t){const e=u.motionValue(t()),l=()=>e.set(t()),n=()=>u.frame.preRender(l,!1,!0);let s;const r=o=>{s=o.map(i=>i.on("change",n))},c=()=>{s.forEach(o=>o()),u.cancelFrame(l)};return a.getCurrentInstance()&&a.onUnmounted(()=>{c()}),{subscribe:r,unsubscribe:c,value:e,updateValue:l}}function T(t){u.collectMotionValues.current=[];const{value:e,subscribe:l,unsubscribe:n,updateValue:s}=k(t);return l(u.collectMotionValues.current),u.collectMotionValues.current=void 0,a.watchEffect(()=>{n(),u.collectMotionValues.current=[],s(),l(u.collectMotionValues.current),u.collectMotionValues.current=void 0}),e}function B(t,e,l,n){if(typeof t=="function")return T(t);let s,r;if(typeof e=="function")r=e,s=Array.isArray(t)?t:[t];else if(a.isRef(e)){const o=u.motionValue(0);let i=A(e.value,l,n);a.watch(e,v=>{i=A(v,l,n),o.set(o.get()+1)},{flush:"sync"}),r=v=>Array.isArray(v)?i(v[0]):i(v),s=Array.isArray(t)?[...t,o]:[t,o]}else r=A(e,l,n),s=Array.isArray(t)?t:[t];const c=Array.isArray(t)?M(s,r):M(s,o=>r(o[0]));if(!Array.isArray(t)){const o=t.accelerate;if(o&&!o.isTransformed&&typeof e!="function"&&Array.isArray(l)&&n?.clamp!==!1){const i=a.isRef(e)?e.value:e;c.accelerate={...o,times:i,keyframes:l,isTransformed:!0}}}return c}function M(t,e){const l=[],n=()=>{l.length=0;const c=t.length;for(let o=0;o<c;o++)l[o]=t[o].get();return e(l)},{value:s,subscribe:r}=k(n);return r(t),s}const m=a.defineComponent({__name:"index",props:{text:{},disabled:{type:Boolean,default:!1},speed:{default:2},className:{default:""},color:{default:"#b5b5b5"},shineColor:{default:"#ffffff"},spread:{default:120},yoyo:{type:Boolean,default:!1},pauseOnHover:{type:Boolean,default:!1},direction:{default:"left"},delay:{default:0}},setup(t){const e=t,l=a.ref(!1),n=u.motionValue(0),s=a.ref(0),r=a.ref(null),c=a.ref(e.direction==="left"?1:-1),o=a.computed(()=>e.speed*1e3),i=a.computed(()=>e.delay*1e3);S(f=>{if(e.disabled||l.value){r.value=null;return}if(r.value===null){r.value=f;return}const V=f-r.value;if(r.value=f,s.value+=V,e.yoyo){const y=o.value+i.value,b=y*2,d=s.value%b;if(d<o.value){const p=d/o.value*100;n.set(c.value===1?p:100-p)}else if(d<y)n.set(c.value===1?100:0);else if(d<y+o.value){const h=100-(d-y)/o.value*100;n.set(c.value===1?h:100-h)}else n.set(c.value===1?0:100)}else{const y=o.value+i.value,b=s.value%y;if(b<o.value){const d=b/o.value*100;n.set(c.value===1?d:100-d)}else n.set(c.value===1?100:0)}}),a.watch(()=>e.direction,()=>{c.value=e.direction==="left"?1:-1,s.value=0,n.set(0)},{immediate:!0});const v=B(n,f=>`${150-f*2}% center`),C=()=>{e.pauseOnHover&&(l.value=!0)},g=()=>{e.pauseOnHover&&(l.value=!1)},x=a.computed(()=>({backgroundImage:`linear-gradient(${e.spread}deg, ${e.color} 0%, ${e.color} 35%, ${e.shineColor} 50%, ${e.color} 65%, ${e.color} 100%)`,backgroundSize:"200% auto",WebkitBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent"}));return(f,V)=>(a.openBlock(),a.createBlock(a.unref(u.Motion),{tag:"span",class:a.normalizeClass(["inline-block",f.className]),style:a.normalizeStyle({...x.value,backgroundPosition:a.unref(v)}),onMouseenter:C,onMouseleave:g},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(f.text),1)]),_:1},8,["class","style"]))}});m.install=t=>{t.component(m.name,m)};exports.GShinyText=m;exports.default=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("motion-v"),i=e.defineComponent({__name:"index",props:{text:{},disabled:{type:Boolean,default:!1},speed:{default:2},className:{default:""},color:{default:"#b5b5b5"},shineColor:{default:"#ffffff"},spread:{default:120},yoyo:{type:Boolean,default:!1},pauseOnHover:{type:Boolean,default:!1},direction:{default:"left"},delay:{default:0}},setup(v){const l=v,p=e.ref(!1),t=f.useMotionValue(0),c=e.ref(0),r=e.ref(null),s=e.ref(l.direction==="left"?1:-1),a=e.computed(()=>l.speed*1e3),y=e.computed(()=>l.delay*1e3);f.useAnimationFrame(o=>{if(l.disabled||p.value){r.value=null;return}if(r.value===null){r.value=o;return}const b=o-r.value;if(r.value=o,c.value+=b,l.yoyo){const u=a.value+y.value,d=u*2,n=c.value%d;if(n<a.value){const m=n/a.value*100;t.set(s.value===1?m:100-m)}else if(n<u)t.set(s.value===1?100:0);else if(n<u+a.value){const g=100-(n-u)/a.value*100;t.set(s.value===1?g:100-g)}else t.set(s.value===1?0:100)}else{const u=a.value+y.value,d=c.value%u;if(d<a.value){const n=d/a.value*100;t.set(s.value===1?n:100-n)}else t.set(s.value===1?100:0)}}),e.watch(()=>l.direction,()=>{s.value=l.direction==="left"?1:-1,c.value=0,t.set(0)},{immediate:!0});const k=f.useTransform(t,o=>`${150-o*2}% center`),T=()=>{l.pauseOnHover&&(p.value=!0)},C=()=>{l.pauseOnHover&&(p.value=!1)},h=e.computed(()=>({backgroundImage:`linear-gradient(${l.spread}deg, ${l.color} 0%, ${l.color} 35%, ${l.shineColor} 50%, ${l.color} 65%, ${l.color} 100%)`,backgroundSize:"200% auto",WebkitBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent"}));return(o,b)=>(e.openBlock(),e.createBlock(e.unref(f.Motion),{tag:"span",class:e.normalizeClass(["inline-block",o.className]),style:e.normalizeStyle({...h.value,backgroundPosition:e.unref(k)}),onMouseenter:T,onMouseleave:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.text),1)]),_:1},8,["class","style"]))}});i.install=v=>{v.component(i.name,i)};exports.GShinyText=i;exports.default=i;