geekin-devtoys 0.3.2 → 0.3.3

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 t=require("vue"),U=require("../_plugin-vue_export-helper-BHFhmbuH.js"),H={class:"g-card__content"},W=t.defineComponent({__name:"index",props:{className:{default:""},edgeSensitivity:{default:30},glowColor:{default:"40 80 80"},backgroundColor:{default:"#060010"},borderRadius:{default:28},glowRadius:{default:40},glowIntensity:{default:1},coneSpread:{default:25},animated:{type:Boolean,default:!1},colors:{default:()=>["#c084fc","#f472b6","#38bdf8"]},fillOpacity:{default:.5}},setup(k){function R(e){const a=e.match(/([\d.]+)\s*([\d.]+)%?\s*([\d.]+)%?/);return a?{h:parseFloat(a[1]),s:parseFloat(a[2]),l:parseFloat(a[3])}:{h:40,s:80,l:80}}function O(e,a){const{h:n,s:l,l:o}=R(e),s=`${n}deg ${l}% ${o}%`;return[[0,0,0,1,100,!0],[0,0,1,0,60,!0],[0,0,3,0,50,!0],[0,0,6,0,40,!0],[0,0,15,0,30,!0],[0,0,25,2,20,!0],[0,0,50,2,10,!0],[0,0,1,0,60,!1],[0,0,3,0,50,!1],[0,0,6,0,40,!1],[0,0,15,0,30,!1],[0,0,25,2,20,!1],[0,0,50,2,10,!1]].map(([d,i,h,v,G,T])=>{const q=Math.min(G*a,100);return`${T?"inset ":""}${d}px ${i}px ${h}px ${v}px hsl(${s} / ${q}%)`}).join(", ")}function S(e){return 1-Math.pow(1-e,3)}function x(e){return e*e*e}function b({start:e=0,end:a=100,duration:n=1e3,delay:l=0,ease:o=S,onUpdate:s,onEnd:c}){const d=performance.now()+l;function i(){const h=performance.now()-d,v=Math.min(h/n,1);s(e+(a-e)*o(v)),v<1?requestAnimationFrame(i):c&&c()}setTimeout(()=>requestAnimationFrame(i),l)}const E=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],P=[0,1,2,0,1,2,1];function N(e){const a=[];for(let n=0;n<7;n++){const l=e[Math.min(P[n],e.length-1)];a.push(`radial-gradient(at ${E[n]}, ${l} 0px, transparent 50%)`)}return a.push(`linear-gradient(${e[0]} 0 100%)`),a}const r=k,_=t.useTemplateRef("cardRef"),y=t.ref(!1),p=t.ref(45),g=t.ref(0),$=t.ref(!1),M=e=>{const{width:a,height:n}=e.getBoundingClientRect();return[a/2,n/2]},B=(e,a,n)=>{const[l,o]=M(e),s=a-l,c=n-o;let d=1/0,i=1/0;return s!==0&&(d=l/Math.abs(s)),c!==0&&(i=o/Math.abs(c)),Math.min(Math.max(1/Math.min(d,i),0),1)},V=(e,a,n)=>{const[l,o]=M(e),s=a-l,c=n-o;if(s===0&&c===0)return 0;let i=Math.atan2(c,s)*(180/Math.PI)+90;return i<0&&(i+=360),i},A=e=>{const a=_.value;if(!a)return;const n=a.getBoundingClientRect(),l=e.clientX-n.left,o=e.clientY-n.top;g.value=B(a,l,o),p.value=V(a,l,o)};t.watch(()=>r.animated,()=>{if(!r.animated)return;const e=110,a=465;$.value=!0,p.value=e,b({duration:500,onUpdate:n=>g.value=n/100}),b({ease:x,duration:1500,end:50,onUpdate:n=>{p.value=(a-e)*(n/100)+e}}),b({ease:S,delay:1500,duration:2250,start:50,end:100,onUpdate:n=>{p.value=(a-e)*(n/100)+e}}),b({ease:x,delay:2500,duration:1500,start:100,end:0,onUpdate:n=>g.value=n/100,onEnd:()=>$.value=!1})},{immediate:!0});const w=t.computed(()=>r.edgeSensitivity+20),m=t.computed(()=>y.value||$.value),C=t.computed(()=>m.value?Math.max(0,(g.value*100-w.value)/(100-w.value)):0),j=t.computed(()=>m.value?Math.max(0,(g.value*100-r.edgeSensitivity)/(100-r.edgeSensitivity)):0),I=t.computed(()=>N(r.colors)),z=t.computed(()=>I.value.map(e=>`${e} border-box`)),F=t.computed(()=>I.value.map(e=>`${e} padding-box`)),u=t.computed(()=>`${p.value.toFixed(3)}deg`);return(e,a)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"cardRef",ref:_,onPointermove:A,onPointerenter:a[0]||(a[0]=n=>y.value=!0),onPointerleave:a[1]||(a[1]=n=>y.value=!1),class:t.normalizeClass(["g-card",r.className]),style:t.normalizeStyle({background:r.backgroundColor,borderRadius:r.borderRadius+"px"})},[t.createElementVNode("div",{class:"g-card__border",style:t.normalizeStyle({background:[`linear-gradient(${r.backgroundColor} 0 100%) padding-box`,"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",...z.value].join(", "),opacity:C.value,maskImage:`conic-gradient(from ${u.value} at center, black ${r.coneSpread}%, transparent ${r.coneSpread+15}%, transparent ${100-r.coneSpread-15}%, black ${100-r.coneSpread}%)`,WebkitMaskImage:`conic-gradient(from ${u.value} at center, black ${r.coneSpread}%, transparent ${r.coneSpread+15}%, transparent ${100-r.coneSpread-15}%, black ${100-r.coneSpread}%)`,transition:m.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},null,4),t.createElementVNode("div",{class:"g-card__fill",style:t.normalizeStyle({background:F.value.join(", "),maskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),WebkitMaskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),opacity:C.value*r.fillOpacity,transition:m.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},null,4),t.createElementVNode("span",{class:"g-card__glow",style:t.normalizeStyle({inset:`-${r.glowRadius}px`,maskImage:`conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,WebkitMaskImage:`conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,opacity:j.value,transition:m.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},[t.createElementVNode("span",{class:"g-card__glow-inner",style:t.normalizeStyle({inset:`${r.glowRadius}px`,boxShadow:O(r.glowColor,r.glowIntensity)})},null,4)],4),t.createElementVNode("div",H,[t.renderSlot(e.$slots,"default",{},void 0,!0)])],38))}}),f=U._export_sfc(W,[["__scopeId","data-v-22c04b33"]]);f.install=k=>{k.component(f.name,f)};exports.GCard=f;exports.default=f;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),U=require("../_plugin-vue_export-helper-BHFhmbuH.js"),H={class:"g-card__content"},W=t.defineComponent({__name:"index",props:{className:{default:""},edgeSensitivity:{default:30},glowColor:{default:"40 80 80"},backgroundColor:{},borderRadius:{default:28},glowRadius:{default:40},glowIntensity:{default:1},coneSpread:{default:25},animated:{type:Boolean,default:!1},colors:{default:()=>["#c084fc","#f472b6","#38bdf8"]},fillOpacity:{default:.5}},setup(v){function O(e){const a=e.match(/([\d.]+)\s*([\d.]+)%?\s*([\d.]+)%?/);return a?{h:parseFloat(a[1]),s:parseFloat(a[2]),l:parseFloat(a[3])}:{h:40,s:80,l:80}}function P(e,a){const{h:n,s:o,l}=O(e),c=`${n}deg ${o}% ${l}%`;return[[0,0,0,1,100,!0],[0,0,1,0,60,!0],[0,0,3,0,50,!0],[0,0,6,0,40,!0],[0,0,15,0,30,!0],[0,0,25,2,20,!0],[0,0,50,2,10,!0],[0,0,1,0,60,!1],[0,0,3,0,50,!1],[0,0,6,0,40,!1],[0,0,15,0,30,!1],[0,0,25,2,20,!1],[0,0,50,2,10,!1]].map(([d,s,h,k,T,q])=>{const D=Math.min(T*a,100);return`${q?"inset ":""}${d}px ${s}px ${h}px ${k}px hsl(${c} / ${D}%)`}).join(", ")}function C(e){return 1-Math.pow(1-e,3)}function S(e){return e*e*e}function b({start:e=0,end:a=100,duration:n=1e3,delay:o=0,ease:l=C,onUpdate:c,onEnd:i}){const d=performance.now()+o;function s(){const h=performance.now()-d,k=Math.min(h/n,1);c(e+(a-e)*l(k)),k<1?requestAnimationFrame(s):i&&i()}setTimeout(()=>requestAnimationFrame(s),o)}const E=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],N=[0,1,2,0,1,2,1];function z(e){const a=[];for(let n=0;n<7;n++){const o=e[Math.min(N[n],e.length-1)];a.push(`radial-gradient(at ${E[n]}, ${o} 0px, transparent 50%)`)}return a.push(`linear-gradient(${e[0]} 0 100%)`),a}const r=v,x=t.computed(()=>r.backgroundColor??"transparent"),w=t.useTemplateRef("cardRef"),y=t.ref(!1),f=t.ref(45),p=t.ref(0),$=t.ref(!1),_=e=>{const{width:a,height:n}=e.getBoundingClientRect();return[a/2,n/2]},B=(e,a,n)=>{const[o,l]=_(e),c=a-o,i=n-l;let d=1/0,s=1/0;return c!==0&&(d=o/Math.abs(c)),i!==0&&(s=l/Math.abs(i)),Math.min(Math.max(1/Math.min(d,s),0),1)},V=(e,a,n)=>{const[o,l]=_(e),c=a-o,i=n-l;if(c===0&&i===0)return 0;let s=Math.atan2(i,c)*(180/Math.PI)+90;return s<0&&(s+=360),s},A=e=>{const a=w.value;if(!a)return;const n=a.getBoundingClientRect(),o=e.clientX-n.left,l=e.clientY-n.top;p.value=B(a,o,l),f.value=V(a,o,l)};t.watch(()=>r.animated,()=>{if(!r.animated)return;const e=110,a=465;$.value=!0,f.value=e,b({duration:500,onUpdate:n=>p.value=n/100}),b({ease:S,duration:1500,end:50,onUpdate:n=>{f.value=(a-e)*(n/100)+e}}),b({ease:C,delay:1500,duration:2250,start:50,end:100,onUpdate:n=>{f.value=(a-e)*(n/100)+e}}),b({ease:S,delay:2500,duration:1500,start:100,end:0,onUpdate:n=>p.value=n/100,onEnd:()=>$.value=!1})},{immediate:!0});const M=t.computed(()=>r.edgeSensitivity+20),g=t.computed(()=>y.value||$.value),I=t.computed(()=>g.value?Math.max(0,(p.value*100-M.value)/(100-M.value)):0),j=t.computed(()=>g.value?Math.max(0,(p.value*100-r.edgeSensitivity)/(100-r.edgeSensitivity)):0),R=t.computed(()=>z(r.colors)),F=t.computed(()=>R.value.map(e=>`${e} border-box`)),G=t.computed(()=>R.value.map(e=>`${e} padding-box`)),u=t.computed(()=>`${f.value.toFixed(3)}deg`);return(e,a)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"cardRef",ref:w,onPointermove:A,onPointerenter:a[0]||(a[0]=n=>y.value=!0),onPointerleave:a[1]||(a[1]=n=>y.value=!1),class:t.normalizeClass(["g-card",r.className]),style:t.normalizeStyle({background:x.value,borderRadius:r.borderRadius+"px"})},[t.createElementVNode("div",{class:"g-card__border",style:t.normalizeStyle({background:[`linear-gradient(${x.value} 0 100%) padding-box`,"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",...F.value].join(", "),opacity:I.value,maskImage:`conic-gradient(from ${u.value} at center, black ${r.coneSpread}%, transparent ${r.coneSpread+15}%, transparent ${100-r.coneSpread-15}%, black ${100-r.coneSpread}%)`,WebkitMaskImage:`conic-gradient(from ${u.value} at center, black ${r.coneSpread}%, transparent ${r.coneSpread+15}%, transparent ${100-r.coneSpread-15}%, black ${100-r.coneSpread}%)`,transition:g.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},null,4),t.createElementVNode("div",{class:"g-card__fill",style:t.normalizeStyle({background:G.value.join(", "),maskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),WebkitMaskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),opacity:I.value*r.fillOpacity,transition:g.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},null,4),t.createElementVNode("span",{class:"g-card__glow",style:t.normalizeStyle({inset:`-${r.glowRadius}px`,maskImage:`conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,WebkitMaskImage:`conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,opacity:j.value,transition:g.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},[t.createElementVNode("span",{class:"g-card__glow-inner",style:t.normalizeStyle({inset:`${r.glowRadius}px`,boxShadow:P(r.glowColor,r.glowIntensity)})},null,4)],4),t.createElementVNode("div",H,[t.renderSlot(e.$slots,"default",{},void 0,!0)])],38))}}),m=U._export_sfc(W,[["__scopeId","data-v-d2f696d6"]]),L=[{name:"Daylight",colors:["#5464f6ff","#c084fc","#38bdf8"],glowColor:"220 80 60",backgroundColor:"#f8fafc",dark:!1},{name:"Quartz",colors:["#f472b6","#fb7185","#f9a8d4"],glowColor:"340 80 65",backgroundColor:"#f8fafc",dark:!1},{name:"Matcha",colors:["#34d399","#86efac","#fbbf24"],glowColor:"150 60 50",backgroundColor:"#f8fafc",dark:!1},{name:"Ocean",colors:["#0ea5e9","#22d3ee","#6366f1"],glowColor:"200 90 65",backgroundColor:"#f8fafc",dark:!1},{name:"Daylight",colors:["#c084fc","#f472b6","#38bdf8"],glowColor:"280 80 75",backgroundColor:"#1d1e1f",dark:!0},{name:"Quartz",colors:["#f97316","#f43f5e","#facc15"],glowColor:"20 90 65",backgroundColor:"#1d1e1f",dark:!0},{name:"Matcha",colors:["#34d399","#10b981","#a7f3d0"],glowColor:"150 70 65",backgroundColor:"#1d1e1f",dark:!0},{name:"Ocean",colors:["#0ea5e9","#22d3ee","#6366f1"],glowColor:"200 90 65",backgroundColor:"#1d1e1f",dark:!0}];m.install=v=>{v.component(m.name,m)};exports.GCard=m;exports.cardPresets=L;exports.default=m;
@@ -1,12 +1,12 @@
1
- import { defineComponent as H, useTemplateRef as L, ref as y, watch as X, computed as c, createElementBlock as Y, openBlock as J, normalizeStyle as m, normalizeClass as K, createElementVNode as b, renderSlot as Q } from "vue";
2
- import { _ as Z } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
3
- const ee = { class: "g-card__content" }, ae = /* @__PURE__ */ H({
1
+ import { defineComponent as L, computed as c, useTemplateRef as Q, ref as y, watch as X, createElementBlock as Y, openBlock as J, normalizeStyle as b, normalizeClass as K, createElementVNode as m, renderSlot as Z } from "vue";
2
+ import { _ as ee } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
3
+ const ae = { class: "g-card__content" }, te = /* @__PURE__ */ L({
4
4
  __name: "index",
5
5
  props: {
6
6
  className: { default: "" },
7
7
  edgeSensitivity: { default: 30 },
8
8
  glowColor: { default: "40 80 80" },
9
- backgroundColor: { default: "#060010" },
9
+ backgroundColor: {},
10
10
  borderRadius: { default: 28 },
11
11
  glowRadius: { default: 40 },
12
12
  glowIntensity: { default: 1 },
@@ -16,12 +16,12 @@ const ee = { class: "g-card__content" }, ae = /* @__PURE__ */ H({
16
16
  fillOpacity: { default: 0.5 }
17
17
  },
18
18
  setup($) {
19
- function B(e) {
19
+ function A(e) {
20
20
  const a = e.match(/([\d.]+)\s*([\d.]+)%?\s*([\d.]+)%?/);
21
21
  return a ? { h: parseFloat(a[1]), s: parseFloat(a[2]), l: parseFloat(a[3]) } : { h: 40, s: 80, l: 80 };
22
22
  }
23
- function A(e, a) {
24
- const { h: t, s: r, l } = B(e), s = `${t}deg ${r}% ${l}%`;
23
+ function E(e, a) {
24
+ const { h: t, s: r, l: o } = A(e), s = `${t}deg ${r}% ${o}%`;
25
25
  return [
26
26
  [0, 0, 0, 1, 100, !0],
27
27
  [0, 0, 1, 0, 60, !0],
@@ -36,34 +36,34 @@ const ee = { class: "g-card__content" }, ae = /* @__PURE__ */ H({
36
36
  [0, 0, 15, 0, 30, !1],
37
37
  [0, 0, 25, 2, 20, !1],
38
38
  [0, 0, 50, 2, 10, !1]
39
- ].map(([d, o, S, k, q, z]) => {
40
- const D = Math.min(q * a, 100);
41
- return `${z ? "inset " : ""}${d}px ${o}px ${S}px ${k}px hsl(${s} / ${D}%)`;
39
+ ].map(([d, l, x, v, W, q]) => {
40
+ const H = Math.min(W * a, 100);
41
+ return `${q ? "inset " : ""}${d}px ${l}px ${x}px ${v}px hsl(${s} / ${H}%)`;
42
42
  }).join(", ");
43
43
  }
44
- function M(e) {
44
+ function S(e) {
45
45
  return 1 - Math.pow(1 - e, 3);
46
46
  }
47
- function w(e) {
47
+ function M(e) {
48
48
  return e * e * e;
49
49
  }
50
- function v({
50
+ function k({
51
51
  start: e = 0,
52
52
  end: a = 100,
53
53
  duration: t = 1e3,
54
54
  delay: r = 0,
55
- ease: l = M,
55
+ ease: o = S,
56
56
  onUpdate: s,
57
57
  onEnd: i
58
58
  }) {
59
59
  const d = performance.now() + r;
60
- function o() {
61
- const S = performance.now() - d, k = Math.min(S / t, 1);
62
- s(e + (a - e) * l(k)), k < 1 ? requestAnimationFrame(o) : i && i();
60
+ function l() {
61
+ const x = performance.now() - d, v = Math.min(x / t, 1);
62
+ s(e + (a - e) * o(v)), v < 1 ? requestAnimationFrame(l) : i && i();
63
63
  }
64
- setTimeout(() => requestAnimationFrame(o), r);
64
+ setTimeout(() => requestAnimationFrame(l), r);
65
65
  }
66
- const E = [
66
+ const F = [
67
67
  "80% 55%",
68
68
  "69% 34%",
69
69
  "8% 6%",
@@ -71,107 +71,107 @@ const ee = { class: "g-card__content" }, ae = /* @__PURE__ */ H({
71
71
  "86% 85%",
72
72
  "82% 18%",
73
73
  "51% 4%"
74
- ], F = [0, 1, 2, 0, 1, 2, 1];
75
- function j(e) {
74
+ ], j = [0, 1, 2, 0, 1, 2, 1];
75
+ function N(e) {
76
76
  const a = [];
77
77
  for (let t = 0; t < 7; t++) {
78
- const r = e[Math.min(F[t], e.length - 1)];
79
- a.push(`radial-gradient(at ${E[t]}, ${r} 0px, transparent 50%)`);
78
+ const r = e[Math.min(j[t], e.length - 1)];
79
+ a.push(`radial-gradient(at ${F[t]}, ${r} 0px, transparent 50%)`);
80
80
  }
81
81
  return a.push(`linear-gradient(${e[0]} 0 100%)`), a;
82
82
  }
83
- const n = $, I = L("cardRef"), h = y(!1), p = y(45), g = y(0), x = y(!1), C = (e) => {
83
+ const n = $, _ = c(() => n.backgroundColor ?? "transparent"), I = Q("cardRef"), h = y(!1), f = y(45), p = y(0), C = y(!1), R = (e) => {
84
84
  const { width: a, height: t } = e.getBoundingClientRect();
85
85
  return [a / 2, t / 2];
86
- }, N = (e, a, t) => {
87
- const [r, l] = C(e), s = a - r, i = t - l;
88
- let d = 1 / 0, o = 1 / 0;
89
- return s !== 0 && (d = r / Math.abs(s)), i !== 0 && (o = l / Math.abs(i)), Math.min(Math.max(1 / Math.min(d, o), 0), 1);
90
- }, G = (e, a, t) => {
91
- const [r, l] = C(e), s = a - r, i = t - l;
86
+ }, z = (e, a, t) => {
87
+ const [r, o] = R(e), s = a - r, i = t - o;
88
+ let d = 1 / 0, l = 1 / 0;
89
+ return s !== 0 && (d = r / Math.abs(s)), i !== 0 && (l = o / Math.abs(i)), Math.min(Math.max(1 / Math.min(d, l), 0), 1);
90
+ }, D = (e, a, t) => {
91
+ const [r, o] = R(e), s = a - r, i = t - o;
92
92
  if (s === 0 && i === 0) return 0;
93
- let o = Math.atan2(i, s) * (180 / Math.PI) + 90;
94
- return o < 0 && (o += 360), o;
95
- }, T = (e) => {
93
+ let l = Math.atan2(i, s) * (180 / Math.PI) + 90;
94
+ return l < 0 && (l += 360), l;
95
+ }, G = (e) => {
96
96
  const a = I.value;
97
97
  if (!a) return;
98
- const t = a.getBoundingClientRect(), r = e.clientX - t.left, l = e.clientY - t.top;
99
- g.value = N(a, r, l), p.value = G(a, r, l);
98
+ const t = a.getBoundingClientRect(), r = e.clientX - t.left, o = e.clientY - t.top;
99
+ p.value = z(a, r, o), f.value = D(a, r, o);
100
100
  };
101
101
  X(
102
102
  () => n.animated,
103
103
  () => {
104
104
  if (!n.animated) return;
105
105
  const e = 110, a = 465;
106
- x.value = !0, p.value = e, v({ duration: 500, onUpdate: (t) => g.value = t / 100 }), v({
107
- ease: w,
106
+ C.value = !0, f.value = e, k({ duration: 500, onUpdate: (t) => p.value = t / 100 }), k({
107
+ ease: M,
108
108
  duration: 1500,
109
109
  end: 50,
110
110
  onUpdate: (t) => {
111
- p.value = (a - e) * (t / 100) + e;
111
+ f.value = (a - e) * (t / 100) + e;
112
112
  }
113
- }), v({
114
- ease: M,
113
+ }), k({
114
+ ease: S,
115
115
  delay: 1500,
116
116
  duration: 2250,
117
117
  start: 50,
118
118
  end: 100,
119
119
  onUpdate: (t) => {
120
- p.value = (a - e) * (t / 100) + e;
120
+ f.value = (a - e) * (t / 100) + e;
121
121
  }
122
- }), v({
123
- ease: w,
122
+ }), k({
123
+ ease: M,
124
124
  delay: 2500,
125
125
  duration: 1500,
126
126
  start: 100,
127
127
  end: 0,
128
- onUpdate: (t) => g.value = t / 100,
129
- onEnd: () => x.value = !1
128
+ onUpdate: (t) => p.value = t / 100,
129
+ onEnd: () => C.value = !1
130
130
  });
131
131
  },
132
132
  { immediate: !0 }
133
133
  );
134
- const R = c(() => n.edgeSensitivity + 20), f = c(() => h.value || x.value), O = c(
135
- () => f.value ? Math.max(
134
+ const O = c(() => n.edgeSensitivity + 20), g = c(() => h.value || C.value), P = c(
135
+ () => g.value ? Math.max(
136
136
  0,
137
- (g.value * 100 - R.value) / (100 - R.value)
137
+ (p.value * 100 - O.value) / (100 - O.value)
138
138
  ) : 0
139
- ), U = c(
140
- () => f.value ? Math.max(
139
+ ), T = c(
140
+ () => g.value ? Math.max(
141
141
  0,
142
- (g.value * 100 - n.edgeSensitivity) / (100 - n.edgeSensitivity)
142
+ (p.value * 100 - n.edgeSensitivity) / (100 - n.edgeSensitivity)
143
143
  ) : 0
144
- ), P = c(() => j(n.colors)), V = c(() => P.value.map((e) => `${e} border-box`)), W = c(() => P.value.map((e) => `${e} padding-box`)), u = c(() => `${p.value.toFixed(3)}deg`);
144
+ ), B = c(() => N(n.colors)), U = c(() => B.value.map((e) => `${e} border-box`)), V = c(() => B.value.map((e) => `${e} padding-box`)), u = c(() => `${f.value.toFixed(3)}deg`);
145
145
  return (e, a) => (J(), Y("div", {
146
146
  ref_key: "cardRef",
147
147
  ref: I,
148
- onPointermove: T,
148
+ onPointermove: G,
149
149
  onPointerenter: a[0] || (a[0] = (t) => h.value = !0),
150
150
  onPointerleave: a[1] || (a[1] = (t) => h.value = !1),
151
151
  class: K(["g-card", n.className]),
152
- style: m({
153
- background: n.backgroundColor,
152
+ style: b({
153
+ background: _.value,
154
154
  borderRadius: n.borderRadius + "px"
155
155
  })
156
156
  }, [
157
- b("div", {
157
+ m("div", {
158
158
  class: "g-card__border",
159
- style: m({
159
+ style: b({
160
160
  background: [
161
- `linear-gradient(${n.backgroundColor} 0 100%) padding-box`,
161
+ `linear-gradient(${_.value} 0 100%) padding-box`,
162
162
  "linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",
163
- ...V.value
163
+ ...U.value
164
164
  ].join(", "),
165
- opacity: O.value,
165
+ opacity: P.value,
166
166
  maskImage: `conic-gradient(from ${u.value} at center, black ${n.coneSpread}%, transparent ${n.coneSpread + 15}%, transparent ${100 - n.coneSpread - 15}%, black ${100 - n.coneSpread}%)`,
167
167
  WebkitMaskImage: `conic-gradient(from ${u.value} at center, black ${n.coneSpread}%, transparent ${n.coneSpread + 15}%, transparent ${100 - n.coneSpread - 15}%, black ${100 - n.coneSpread}%)`,
168
- transition: f.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
168
+ transition: g.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
169
169
  })
170
170
  }, null, 4),
171
- b("div", {
171
+ m("div", {
172
172
  class: "g-card__fill",
173
- style: m({
174
- background: W.value.join(", "),
173
+ style: b({
174
+ background: V.value.join(", "),
175
175
  maskImage: [
176
176
  "linear-gradient(to bottom, black, black)",
177
177
  "radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)",
@@ -190,38 +190,98 @@ const ee = { class: "g-card__content" }, ae = /* @__PURE__ */ H({
190
190
  "radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",
191
191
  `conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`
192
192
  ].join(", "),
193
- opacity: O.value * n.fillOpacity,
194
- transition: f.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
193
+ opacity: P.value * n.fillOpacity,
194
+ transition: g.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
195
195
  })
196
196
  }, null, 4),
197
- b("span", {
197
+ m("span", {
198
198
  class: "g-card__glow",
199
- style: m({
199
+ style: b({
200
200
  inset: `-${n.glowRadius}px`,
201
201
  maskImage: `conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,
202
202
  WebkitMaskImage: `conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,
203
- opacity: U.value,
204
- transition: f.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
203
+ opacity: T.value,
204
+ transition: g.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
205
205
  })
206
206
  }, [
207
- b("span", {
207
+ m("span", {
208
208
  class: "g-card__glow-inner",
209
- style: m({
209
+ style: b({
210
210
  inset: `${n.glowRadius}px`,
211
- boxShadow: A(n.glowColor, n.glowIntensity)
211
+ boxShadow: E(n.glowColor, n.glowIntensity)
212
212
  })
213
213
  }, null, 4)
214
214
  ], 4),
215
- b("div", ee, [
216
- Q(e.$slots, "default", {}, void 0, !0)
215
+ m("div", ae, [
216
+ Z(e.$slots, "default", {}, void 0, !0)
217
217
  ])
218
218
  ], 38));
219
219
  }
220
- }), _ = /* @__PURE__ */ Z(ae, [["__scopeId", "data-v-22c04b33"]]);
221
- _.install = ($) => {
222
- $.component(_.name, _);
220
+ }), w = /* @__PURE__ */ ee(te, [["__scopeId", "data-v-d2f696d6"]]), oe = [
221
+ // ===== 浅色方案 =====
222
+ {
223
+ name: "Daylight",
224
+ colors: ["#5464f6ff", "#c084fc", "#38bdf8"],
225
+ glowColor: "220 80 60",
226
+ backgroundColor: "#f8fafc",
227
+ dark: !1
228
+ },
229
+ {
230
+ name: "Quartz",
231
+ colors: ["#f472b6", "#fb7185", "#f9a8d4"],
232
+ glowColor: "340 80 65",
233
+ backgroundColor: "#f8fafc",
234
+ dark: !1
235
+ },
236
+ {
237
+ name: "Matcha",
238
+ colors: ["#34d399", "#86efac", "#fbbf24"],
239
+ glowColor: "150 60 50",
240
+ backgroundColor: "#f8fafc",
241
+ dark: !1
242
+ },
243
+ {
244
+ name: "Ocean",
245
+ colors: ["#0ea5e9", "#22d3ee", "#6366f1"],
246
+ glowColor: "200 90 65",
247
+ backgroundColor: "#f8fafc",
248
+ dark: !1
249
+ },
250
+ // ===== 深色方案 =====
251
+ {
252
+ name: "Daylight",
253
+ colors: ["#c084fc", "#f472b6", "#38bdf8"],
254
+ glowColor: "280 80 75",
255
+ backgroundColor: "#1d1e1f",
256
+ dark: !0
257
+ },
258
+ {
259
+ name: "Quartz",
260
+ colors: ["#f97316", "#f43f5e", "#facc15"],
261
+ glowColor: "20 90 65",
262
+ backgroundColor: "#1d1e1f",
263
+ dark: !0
264
+ },
265
+ {
266
+ name: "Matcha",
267
+ colors: ["#34d399", "#10b981", "#a7f3d0"],
268
+ glowColor: "150 70 65",
269
+ backgroundColor: "#1d1e1f",
270
+ dark: !0
271
+ },
272
+ {
273
+ name: "Ocean",
274
+ colors: ["#0ea5e9", "#22d3ee", "#6366f1"],
275
+ glowColor: "200 90 65",
276
+ backgroundColor: "#1d1e1f",
277
+ dark: !0
278
+ }
279
+ ];
280
+ w.install = ($) => {
281
+ $.component(w.name, w);
223
282
  };
224
283
  export {
225
- _ as GCard,
226
- _ as default
284
+ w as GCard,
285
+ oe as cardPresets,
286
+ w as default
227
287
  };
@@ -1 +1 @@
1
- .g-card[data-v-22c04b33]{position:relative;display:grid;isolation:isolate;border:1px solid rgba(255,255,255,.15);transform:translateZ(.01px);box-shadow:#0000001a 0 1px 2px,#0000001a 0 2px 4px,#0000001a 0 4px 8px,#0000001a 0 8px 16px,#0000001a 0 16px 32px,#0000001a 0 32px 64px}.g-card__border[data-v-22c04b33],.g-card__fill[data-v-22c04b33]{position:absolute;inset:0;z-index:-1;border:1px solid transparent;border-radius:inherit}.g-card__fill[data-v-22c04b33]{mask-composite:subtract,add,add,add,add,add;-webkit-mask-composite:source-out,source-over,source-over,source-over,source-over,source-over;mix-blend-mode:soft-light}.g-card__glow[data-v-22c04b33]{position:absolute;z-index:1;border-radius:inherit;pointer-events:none;mix-blend-mode:plus-lighter}.g-card__glow-inner[data-v-22c04b33]{position:absolute;border-radius:inherit}.g-card__content[data-v-22c04b33]{position:relative;z-index:1;display:flex;flex-direction:column;overflow:auto}
1
+ .g-card[data-v-d2f696d6]{position:relative;display:grid;isolation:isolate;border:1px solid rgba(255,255,255,.15);transform:translateZ(.01px);box-shadow:#0000001a 0 1px 2px,#0000001a 0 2px 4px,#0000001a 0 4px 8px,#0000001a 0 8px 16px,#0000001a 0 16px 32px,#0000001a 0 32px 64px}.g-card__border[data-v-d2f696d6],.g-card__fill[data-v-d2f696d6]{position:absolute;inset:0;z-index:-1;border:1px solid transparent;border-radius:inherit}.g-card__fill[data-v-d2f696d6]{mask-composite:subtract,add,add,add,add,add;-webkit-mask-composite:source-out,source-over,source-over,source-over,source-over,source-over;mix-blend-mode:soft-light}.g-card__glow[data-v-d2f696d6]{position:absolute;z-index:1;border-radius:inherit;pointer-events:none;mix-blend-mode:plus-lighter}.g-card__glow-inner[data-v-d2f696d6]{position:absolute;border-radius:inherit}.g-card__content[data-v-d2f696d6]{position:relative;z-index:1;display:flex;flex-direction:column;overflow:auto}
@@ -1 +1,9 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),b=require("element-plus"),ae=require("../_plugin-vue_export-helper-BHFhmbuH.js"),oe={key:0,class:"g-input-tree-tag__tags"},ne=t.defineComponent({__name:"index",props:{modelValue:{default:()=>[]},data:{default:()=>[]},props:{default:()=>({})},echoProps:{},nodeKey:{default:"id"},placeholder:{default:"请输入关键字搜索"},width:{default:320},popperMaxHeight:{default:320},popperZIndex:{default:2e3},popperOffset:{default:4},defaultExpandAll:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},tagType:{default:"info"},tagEffect:{default:"light"},clearInputAfterSelect:{type:Boolean,default:!0},enterToAdd:{type:Boolean,default:!0},valueFormat:{default:"value"},selectable:{},filterMethod:{},duplicateMessage:{default:"该项已添加"},notFoundMessage:{default:"未找到匹配项"}},emits:["update:modelValue","change","add","remove","node-click","duplicate","not-found"],setup(B,{expose:H,emit:$}){const o=B,r=$,O=t.computed(()=>({label:o.props.label||"label",children:o.props.children||"children",disabled:o.props.disabled})),j=t.computed(()=>o.props.value||o.nodeKey||"id"),q=t.computed(()=>o.props.label||"label"),K=t.computed(()=>o.props.children||"children"),S=t.computed(()=>o.props.isLeaf),D=t.computed(()=>o.echoProps?.value||"value"),U=t.computed(()=>o.echoProps?.label||"label"),f=e=>e?e[j.value]:void 0,i=e=>e?e[q.value]:"",_=e=>e?e[K.value]:void 0,G=e=>e?.[D.value]??e?.value,P=e=>e?.[U.value]??e?.label,c=e=>{if(!e)return!1;if(typeof o.selectable=="function")return o.selectable(e);if(S.value&&e[S.value]!==void 0)return!!e[S.value];const l=_(e);return!l||!l.length},F=t.computed(()=>{const e=new Map,l=(a=[])=>{a.forEach(n=>{c(n)&&e.set(f(n),n);const s=_(n);s?.length&&l(s)})};return l(o.data||[]),e}),u=t.computed(()=>(o.modelValue||[]).map(l=>{const a=o.valueFormat==="object"?G(l):l,n=F.value.get(a),s=o.valueFormat==="object"?P(l):void 0;return{value:a,label:n?i(n):s??String(a??""),raw:n??(o.valueFormat==="object"?l:void 0)}})),w=e=>u.value.some(l=>l.value===e),y=t.ref(""),d=t.ref(!1),C=t.ref(null),I=t.ref(null),T=t.ref(null),v=t.ref(null),L=t.ref({}),N=t.ref("bottom"),Z=t.computed(()=>typeof o.width=="number"?`${o.width}px`:o.width),x=()=>{o.disabled||(d.value=!0)},k=()=>{if(!d.value)return;const e=T.value,l=v.value;if(!e||!l)return;const a=e.getBoundingClientRect(),n=l.offsetHeight||o.popperMaxHeight,V=window.innerHeight-a.bottom-o.popperOffset,te=a.top,A=V>=n||V>=te?"bottom":"top";N.value=A;const le=A==="bottom"?a.bottom+o.popperOffset:a.top-n;L.value={position:"fixed",top:`${le}px`,left:`${a.left}px`,width:`${a.width}px`,zIndex:String(o.popperZIndex)}};let p=null;const m=()=>{d.value&&(p&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{p=null,k()}))};let g=null;const W=()=>{typeof ResizeObserver>"u"||!v.value||(g?.disconnect(),g=new ResizeObserver(()=>m()),g.observe(v.value))},z=()=>{g?.disconnect(),g=null};t.watch(d,async e=>{if(!e){z();return}await t.nextTick(),k(),requestAnimationFrame(k),W()});const R=e=>{if(!d.value)return;const l=e.target;I.value?.contains(l)||v.value?.contains(l)||(d.value=!1)};t.onMounted(()=>{document.addEventListener("mousedown",R,!0),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m)}),t.onBeforeUnmount(()=>{document.removeEventListener("mousedown",R,!0),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m),p&&cancelAnimationFrame(p),z()});const J=e=>{d.value=!0,C.value?.filter(e),t.nextTick(k)},Q=(e,l)=>e?typeof o.filterMethod=="function"?o.filterMethod(e,l):String(i(l)??"").toLowerCase().includes(String(e).toLowerCase()):!0,X=(e,l)=>{if(r("node-click",e),!c(e)){l&&(l.expanded=!l.expanded);return}M(e),d.value=!1},Y=e=>o.valueFormat==="object"?{value:e.value,label:e.label,raw:e.raw}:e.value,M=e=>{const l=f(e);if(l==null||l==="")return;if(w(l)){const s={value:l,label:i(e),raw:e};r("duplicate",s),o.duplicateMessage&&b.ElMessage.warning(o.duplicateMessage);return}const a={value:l,label:i(e),raw:e},n=[...o.modelValue||[],Y(a)];r("update:modelValue",n),r("add",a),r("change",n,[...u.value,a]),o.clearInputAfterSelect&&(y.value="")},ee=()=>{if(!o.enterToAdd)return;const e=(y.value||"").trim();if(!e)return;let l=null;for(const a of F.value.values())if(i(a)===e){l=a;break}if(!l){r("not-found",e),o.notFoundMessage&&b.ElMessage.warning(o.notFoundMessage);return}M(l)},E=e=>{if(e<0||e>=u.value.length)return;const l=u.value[e],a=[...o.modelValue||[]];a.splice(e,1),r("update:modelValue",a),l&&r("remove",l,e);const n=u.value.filter((s,V)=>V!==e);r("change",a,n)};return H({open:x,close:()=>d.value=!1,clear:()=>{r("update:modelValue",[]),r("change",[],[])},addByValue:e=>{const l=F.value.get(e);l&&M(l)},removeByIndex:e=>{E(e)},removeByValue:e=>{const l=u.value.findIndex(a=>a.value===e);l>-1&&E(l)},getSelectedItems:()=>u.value}),(e,l)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["g-input-tree-tag",{"is-disabled":e.disabled}])},[t.createElementVNode("div",{class:"g-input-tree-tag__wrap",ref_key:"wrapRef",ref:I},[t.createElementVNode("div",{class:"g-input-tree-tag__input-box",ref_key:"inputBoxRef",ref:T,style:t.normalizeStyle({width:Z.value})},[t.createVNode(t.unref(b.ElInput),{modelValue:y.value,"onUpdate:modelValue":l[0]||(l[0]=a=>y.value=a),placeholder:e.placeholder,clearable:e.clearable,disabled:e.disabled,class:"g-input-tree-tag__input",onFocus:x,onClick:x,onInput:J,onKeyup:t.withKeys(ee,["enter"])},null,8,["modelValue","placeholder","clearable","disabled"])],4),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.withDirectives(t.createElementVNode("div",{ref_key:"popperRef",ref:v,class:t.normalizeClass(["g-input-tree-tag__popover",`is-${N.value}`]),style:t.normalizeStyle(L.value),onMousedown:l[1]||(l[1]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("div",{class:"g-input-tree-tag__tree-wrap",style:t.normalizeStyle({maxHeight:e.popperMaxHeight+"px"})},[t.createVNode(t.unref(b.ElTree),{ref_key:"treeRef",ref:C,data:e.data,props:O.value,"node-key":e.nodeKey,"filter-node-method":Q,"expand-on-click-node":!1,"default-expand-all":e.defaultExpandAll,onNodeClick:X},{default:t.withCtx(a=>[t.renderSlot(e.$slots,"tree-node",{data:a?.data,node:a?.node,selectable:c(a?.data),selected:w(f(a?.data))},()=>[a?.data?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["g-input-tree-tag__node",{"is-selectable":c(a.data),"is-selected":c(a.data)&&w(f(a.data))}])},[t.renderSlot(e.$slots,"leaf-icon",{data:a.data,selectable:c(a.data),selected:w(f(a.data))},void 0,!0),t.createTextVNode(" "+t.toDisplayString(i(a.data)),1)],2)):t.createCommentVNode("",!0)],!0)]),_:3},8,["data","props","node-key","default-expand-all"])],4)],38),[[t.vShow,d.value]])])),u.value.length?(t.openBlock(),t.createElementBlock("div",oe,[t.renderSlot(e.$slots,"tags",{items:u.value,remove:E},()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(a,n)=>(t.openBlock(),t.createBlock(t.unref(b.ElTag),{key:a.value,class:"g-input-tree-tag__tag",type:e.tagType,effect:e.tagEffect,closable:e.closable&&!e.disabled,onClose:s=>E(n)},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"tag",{item:a,index:n},()=>[t.createTextVNode(t.toDisplayString(a.label),1)],!0)]),_:2},1032,["type","effect","closable","onClose"]))),128))],!0)])):t.createCommentVNode("",!0)],512)],2))}}),h=ae._export_sfc(ne,[["__scopeId","data-v-1fe6c294"]]);h.install=B=>{B.component(h.name,h)};exports.GInputTreeTag=h;exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),T=require("element-plus"),x=require("../index-xqOURU1q.js"),ve=require("../_plugin-vue_export-helper-BHFhmbuH.js");var ge=0;function he(d){const p=new WeakMap,f=x.useMotionConfig();function n(u){if(d.mode!=="popLayout")return;const v=u.offsetParent,E=v instanceof HTMLElement&&v.offsetWidth||0,m={height:u.offsetHeight||0,width:u.offsetWidth||0,top:u.offsetTop,left:u.offsetLeft,right:0};m.right=E-m.width-m.left;const S=d.anchorX==="left"?`left: ${m.left}px`:`right: ${m.right}px`,k=`pop-${ge++}`;u.dataset.motionPopId=k;const l=document.createElement("style");f.value.nonce&&(l.nonce=f.value.nonce),p.set(u,l),document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`
2
+ [data-motion-pop-id="${k}"] {
3
+ position: absolute !important;
4
+ width: ${m.width}px !important;
5
+ height: ${m.height}px !important;
6
+ top: ${m.top}px !important;
7
+ ${S} !important;
8
+ }
9
+ `)}function c(u){const v=p.get(u);v&&(p.delete(u),x.frame.render(()=>{document.head.removeChild(v)}))}return{addPopStyle:n,removePopStyle:c}}var be=0;function ye(d){const p=String(be++),f=new Map,{addPopStyle:n,removePopStyle:c}=he(d);function u(l){const i=[],r=x.mountedStates.get(l);r&&l.getAttribute(x.motionGlobalConfig.motionAttribute)===p&&i.push(r);const g=Array.from(l.querySelectorAll(`[${x.motionGlobalConfig.motionAttribute}="${p}"]`));for(const V of g){const y=x.mountedStates.get(V);y&&i.push(y)}return i}function v(l,i){const r=f.get(l);r&&(r.remaining.delete(i),r.remaining.size===0&&m(r))}const E={initial:d.initial,custom:d.custom,presenceId:p,onMotionExitComplete:v};x.provideAnimatePresence(E),e.onMounted(()=>{E.initial=void 0});function m(l){c(l.el),l.states.forEach(i=>{i.getSnapshot(i.options,!1)}),l.done(),f.delete(l.el),l.el?.isConnected?l.states[0]?.didUpdate():l.states.forEach(i=>{i.unmount()}),d.onExitComplete?.()}function S(l,i){u(l).forEach(r=>{r.setActive("exit",!1),r.getSnapshot(r.options,!0)}),i()}function k(l,i){E.custom=d.custom;const r=l,g=u(r);if(g.length===0){i(),d.onExitComplete?.();return}const V={remaining:new Set(g),states:g,done:i,el:r};f.set(r,V),n(r),g.forEach(y=>{y.presenceContainer=r,y.setActive("exit",!0),y.getSnapshot(y.options,!1)}),g[0]?.didUpdate()}return e.onUnmounted(()=>{f.forEach(l=>{l.states.forEach(i=>{i.unmount()})}),f.clear()}),{enter:S,exit:k}}var we=e.defineComponent({name:"AnimatePresence",inheritAttrs:!0,__name:"AnimatePresence",props:{mode:{default:"sync"},initial:{type:Boolean,default:!0},as:{},custom:{},onExitComplete:{},anchorX:{default:"left"}},setup(d){const p=d,{enter:f,exit:n}=ye(p),c=e.computed(()=>p.mode!=="wait"?{tag:p.as}:{mode:p.mode==="wait"?"out-in":void 0});return(u,v)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.mode==="wait"?e.Transition:e.TransitionGroup),e.mergeProps(c.value,{appear:"",css:!1,onLeave:e.unref(n),onEnter:e.unref(f)}),{default:e.withCtx(()=>[e.renderSlot(u.$slots,"default")]),_:3},16,["onLeave","onEnter"]))}}),X=we;const xe={key:0,class:"g-input-tree-tag__tags"},Ee=e.defineComponent({__name:"index",props:{modelValue:{default:()=>[]},data:{default:()=>[]},props:{default:()=>({})},echoProps:{},nodeKey:{default:"id"},placeholder:{default:"请输入关键字搜索"},width:{default:320},popperMaxHeight:{default:320},popperZIndex:{default:2e3},popperOffset:{default:4},defaultExpandAll:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},tagType:{default:"info"},tagEffect:{default:"light"},clearInputAfterSelect:{type:Boolean,default:!0},enterToAdd:{type:Boolean,default:!0},valueFormat:{default:"value"},selectable:{},filterMethod:{},duplicateMessage:{default:"该项已添加"},notFoundMessage:{default:"未找到匹配项"}},emits:["update:modelValue","change","add","remove","node-click","duplicate","not-found"],setup(d,{expose:p,emit:f}){const n=d,c=f,u=e.computed(()=>({label:n.props.label||"label",children:n.props.children||"children",disabled:n.props.disabled})),v=e.computed(()=>n.props.value||n.nodeKey||"id"),E=e.computed(()=>n.props.label||"label"),m=e.computed(()=>n.props.children||"children"),S=e.computed(()=>n.props.isLeaf),k=e.computed(()=>n.echoProps?.value||"value"),l=e.computed(()=>n.echoProps?.label||"label"),i=t=>t?t[v.value]:void 0,r=t=>t?t[E.value]:"",g=t=>t?t[m.value]:void 0,V=t=>t?.[k.value]??t?.value,y=t=>t?.[l.value]??t?.label,C=t=>{if(!t)return!1;if(typeof n.selectable=="function")return n.selectable(t);if(S.value&&t[S.value]!==void 0)return!!t[S.value];const o=g(t);return!o||!o.length},H=e.computed(()=>{const t=new Map,o=(a=[])=>{a.forEach(s=>{C(s)&&t.set(i(s),s);const w=g(s);w?.length&&o(w)})};return o(n.data||[]),t}),h=e.computed(()=>(n.modelValue||[]).map(o=>{const a=n.valueFormat==="object"?V(o):o,s=H.value.get(a),w=n.valueFormat==="object"?y(o):void 0;return{value:a,label:s?r(s):w??String(a??""),raw:s??(n.valueFormat==="object"?o:void 0)}})),$=t=>h.value.some(o=>o.value===t),F=e.ref(""),b=e.ref(!1),q=e.ref(null),U=e.ref(null),j=e.ref(null),_=e.ref(null),Z=t=>{if(!t){_.value=null;return}_.value=t.$el??(t instanceof HTMLElement?t:null)},G=e.ref({}),M=e.ref("bottom"),J=e.computed(()=>({opacity:0,scale:.95,y:M.value==="bottom"?-8:8})),Q={opacity:1,scale:1,y:0},Y=e.computed(()=>({opacity:0,scale:.95,y:M.value==="bottom"?-8:8})),ee={duration:.2,ease:"easeOut"},te=e.computed(()=>({...G.value,transformOrigin:M.value==="bottom"?"top center":"bottom center"})),oe={opacity:0,scale:.8},ne={opacity:1,scale:1},ae={opacity:0,scale:.8},le={duration:.2,ease:"easeOut"},re=e.computed(()=>typeof n.width=="number"?`${n.width}px`:n.width),O=()=>{n.disabled||(b.value=!0)},P=()=>{if(!b.value)return;const t=j.value,o=_.value;if(!t||!o)return;const a=t.getBoundingClientRect(),s=o.offsetHeight||n.popperMaxHeight,z=window.innerHeight-a.bottom-n.popperOffset,fe=a.top-n.popperOffset,D=z>=s||z>=fe?"bottom":"top";M.value=D;const me=D==="bottom"?a.bottom+n.popperOffset:a.top-s-n.popperOffset;G.value={position:"fixed",top:`${me}px`,left:`${a.left}px`,width:`${a.width}px`,zIndex:String(n.popperZIndex)}};let B=null;const A=()=>{b.value&&(B&&cancelAnimationFrame(B),B=requestAnimationFrame(()=>{B=null,P()}))};let I=null;const ie=()=>{typeof ResizeObserver>"u"||!_.value||(I?.disconnect(),I=new ResizeObserver(()=>A()),I.observe(_.value))},K=()=>{I?.disconnect(),I=null};e.watch(b,async t=>{if(!t){K();return}await e.nextTick(),P(),requestAnimationFrame(P),ie()});const W=t=>{if(!b.value)return;const o=t.target;U.value?.contains(o)||_.value?.contains(o)||(b.value=!1)};e.onMounted(()=>{document.addEventListener("mousedown",W,!0),window.addEventListener("scroll",A,!0),window.addEventListener("resize",A)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",W,!0),window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A),B&&cancelAnimationFrame(B),K()});const se=t=>{b.value=!0,q.value?.filter(t),e.nextTick(P)},ue=(t,o)=>t?typeof n.filterMethod=="function"?n.filterMethod(t,o):String(r(o)??"").toLowerCase().includes(String(t).toLowerCase()):!0,ce=(t,o)=>{if(c("node-click",t),!C(t)){o&&(o.expanded=!o.expanded);return}R(t),b.value=!1},de=t=>n.valueFormat==="object"?{value:t.value,label:t.label,raw:t.raw}:t.value,R=t=>{const o=i(t);if(o==null||o==="")return;if($(o)){const w={value:o,label:r(t),raw:t};c("duplicate",w),n.duplicateMessage&&T.ElMessage.warning(n.duplicateMessage);return}const a={value:o,label:r(t),raw:t},s=[...n.modelValue||[],de(a)];c("update:modelValue",s),c("add",a),c("change",s,[...h.value,a]),n.clearInputAfterSelect&&(F.value="")},pe=()=>{if(!n.enterToAdd)return;const t=(F.value||"").trim();if(!t)return;let o=null;for(const a of H.value.values())if(r(a)===t){o=a;break}if(!o){c("not-found",t),n.notFoundMessage&&T.ElMessage.warning(n.notFoundMessage);return}R(o)},N=t=>{if(t<0||t>=h.value.length)return;const o=h.value[t],a=[...n.modelValue||[]];a.splice(t,1),c("update:modelValue",a),o&&c("remove",o,t);const s=h.value.filter((w,z)=>z!==t);c("change",a,s)};return p({open:O,close:()=>b.value=!1,clear:()=>{c("update:modelValue",[]),c("change",[],[])},addByValue:t=>{const o=H.value.get(t);o&&R(o)},removeByIndex:t=>{N(t)},removeByValue:t=>{const o=h.value.findIndex(a=>a.value===t);o>-1&&N(o)},getSelectedItems:()=>h.value}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["g-input-tree-tag",{"is-disabled":t.disabled}])},[e.createElementVNode("div",{class:"g-input-tree-tag__wrap",ref_key:"wrapRef",ref:U},[e.createElementVNode("div",{class:"g-input-tree-tag__input-box",ref_key:"inputBoxRef",ref:j,style:e.normalizeStyle({width:re.value})},[e.createVNode(e.unref(T.ElInput),{modelValue:F.value,"onUpdate:modelValue":o[0]||(o[0]=a=>F.value=a),placeholder:t.placeholder,clearable:t.clearable,disabled:t.disabled,class:"g-input-tree-tag__input",onFocus:O,onClick:O,onInput:se,onKeyup:e.withKeys(pe,["enter"])},null,8,["modelValue","placeholder","clearable","disabled"])],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.unref(X),null,{default:e.withCtx(()=>[b.value?(e.openBlock(),e.createBlock(e.unref(x.motion).div,{key:0,ref:Z,class:e.normalizeClass(["g-input-tree-tag__popover",`is-${M.value}`]),style:e.normalizeStyle(te.value),initial:J.value,animate:Q,exit:Y.value,transition:ee,onMousedown:o[1]||(o[1]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"g-input-tree-tag__tree-wrap",style:e.normalizeStyle({maxHeight:t.popperMaxHeight+"px"})},[e.createVNode(e.unref(T.ElTree),{ref_key:"treeRef",ref:q,data:t.data,props:u.value,"node-key":t.nodeKey,"filter-node-method":ue,"expand-on-click-node":!1,"default-expand-all":t.defaultExpandAll,onNodeClick:ce},{default:e.withCtx(a=>[e.renderSlot(t.$slots,"tree-node",{data:a?.data,node:a?.node,selectable:C(a?.data),selected:$(i(a?.data))},()=>[a?.data?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["g-input-tree-tag__node",{"is-selectable":C(a.data),"is-selected":C(a.data)&&$(i(a.data))}])},[e.renderSlot(t.$slots,"leaf-icon",{data:a.data,selectable:C(a.data),selected:$(i(a.data))},void 0,!0),e.createTextVNode(" "+e.toDisplayString(r(a.data)),1)],2)):e.createCommentVNode("",!0)],!0)]),_:3},8,["data","props","node-key","default-expand-all"])],4)]),_:3},8,["class","style","initial","exit"])):e.createCommentVNode("",!0)]),_:3})])),h.value.length?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(t.$slots,"tags",{items:h.value,remove:N},()=>[e.createVNode(e.unref(X),{mode:"popLayout"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,s)=>(e.openBlock(),e.createBlock(e.unref(x.motion).div,{key:a.value,layout:!0,class:"g-input-tree-tag__tag-motion",initial:oe,animate:ne,exit:ae,transition:le},{default:e.withCtx(()=>[e.createVNode(e.unref(T.ElTag),{class:"g-input-tree-tag__tag",type:t.tagType,effect:t.tagEffect,closable:t.closable&&!t.disabled,onClose:w=>N(s)},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"tag",{item:a,index:s},()=>[e.createTextVNode(e.toDisplayString(a.label),1)],!0)]),_:2},1032,["type","effect","closable","onClose"])]),_:2},1024))),128))]),_:3})],!0)])):e.createCommentVNode("",!0)],512)],2))}}),L=ve._export_sfc(Ee,[["__scopeId","data-v-b74dd5d2"]]);L.install=d=>{d.component(L.name,L)};exports.GInputTreeTag=L;exports.default=L;