geekin-devtoys 0.3.3 → 0.3.5

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.
@@ -0,0 +1,9 @@
1
+ "use strict";const d=require("./index-B8Ap0044.js"),i=require("vue");var P=0;function y(a){const r=new WeakMap,s=d.useMotionConfig();function p(o){if(a.mode!=="popLayout")return;const u=o.offsetParent,h=u instanceof HTMLElement&&u.offsetWidth||0,c={height:o.offsetHeight||0,width:o.offsetWidth||0,top:o.offsetTop,left:o.offsetLeft,right:0};c.right=h-c.width-c.left;const v=a.anchorX==="left"?`left: ${c.left}px`:`right: ${c.right}px`,g=`pop-${P++}`;o.dataset.motionPopId=g;const t=document.createElement("style");s.value.nonce&&(t.nonce=s.value.nonce),r.set(o,t),document.head.appendChild(t),t.sheet&&t.sheet.insertRule(`
2
+ [data-motion-pop-id="${g}"] {
3
+ position: absolute !important;
4
+ width: ${c.width}px !important;
5
+ height: ${c.height}px !important;
6
+ top: ${c.top}px !important;
7
+ ${v} !important;
8
+ }
9
+ `)}function m(o){const u=r.get(o);u&&(r.delete(o),d.frame.render(()=>{document.head.removeChild(u)}))}return{addPopStyle:p,removePopStyle:m}}var C=0;function S(a){const r=String(C++),s=new Map,{addPopStyle:p,removePopStyle:m}=y(a);function o(t){const e=[],n=d.mountedStates.get(t);n&&t.getAttribute(d.motionGlobalConfig.motionAttribute)===r&&e.push(n);const f=Array.from(t.querySelectorAll(`[${d.motionGlobalConfig.motionAttribute}="${r}"]`));for(const x of f){const l=d.mountedStates.get(x);l&&e.push(l)}return e}function u(t,e){const n=s.get(t);n&&(n.remaining.delete(e),n.remaining.size===0&&c(n))}const h={initial:a.initial,custom:a.custom,presenceId:r,onMotionExitComplete:u};d.provideAnimatePresence(h),i.onMounted(()=>{h.initial=void 0});function c(t){m(t.el),t.states.forEach(e=>{e.getSnapshot(e.options,!1)}),t.done(),s.delete(t.el),t.el?.isConnected?t.states[0]?.didUpdate():t.states.forEach(e=>{e.unmount()}),a.onExitComplete?.()}function v(t,e){o(t).forEach(n=>{n.setActive("exit",!1),n.getSnapshot(n.options,!0)}),e()}function g(t,e){h.custom=a.custom;const n=t,f=o(n);if(f.length===0){e(),a.onExitComplete?.();return}const x={remaining:new Set(f),states:f,done:e,el:n};s.set(n,x),p(n),f.forEach(l=>{l.presenceContainer=n,l.setActive("exit",!0),l.getSnapshot(l.options,!1)}),f[0]?.didUpdate()}return i.onUnmounted(()=>{s.forEach(t=>{t.states.forEach(e=>{e.unmount()})}),s.clear()}),{enter:v,exit:g}}var E=i.defineComponent({name:"AnimatePresence",inheritAttrs:!0,__name:"AnimatePresence",props:{mode:{default:"sync"},initial:{type:Boolean,default:!0},as:{},custom:{},onExitComplete:{},anchorX:{default:"left"}},setup(a){const r=a,{enter:s,exit:p}=S(r),m=i.computed(()=>r.mode!=="wait"?{tag:r.as}:{mode:r.mode==="wait"?"out-in":void 0});return(o,u)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(o.mode==="wait"?i.Transition:i.TransitionGroup),i.mergeProps(m.value,{appear:"",css:!1,onLeave:i.unref(p),onEnter:i.unref(s)}),{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default")]),_:3},16,["onLeave","onEnter"]))}}),A=E;exports.AnimatePresence_default=A;
@@ -0,0 +1,136 @@
1
+ import { u as P, f as C, p as E, a as v, b as x } from "./index-Bbr5fWvI.mjs";
2
+ import { onMounted as S, onUnmounted as A, defineComponent as _, computed as w, createBlock as $, openBlock as M, resolveDynamicComponent as b, Transition as L, TransitionGroup as I, mergeProps as T, unref as y, withCtx as W, renderSlot as k } from "vue";
3
+ var z = 0;
4
+ function B(a) {
5
+ const i = /* @__PURE__ */ new WeakMap(), r = P();
6
+ function p(o) {
7
+ if (a.mode !== "popLayout") return;
8
+ const c = o.offsetParent, d = c instanceof HTMLElement && c.offsetWidth || 0, s = {
9
+ height: o.offsetHeight || 0,
10
+ width: o.offsetWidth || 0,
11
+ top: o.offsetTop,
12
+ left: o.offsetLeft,
13
+ right: 0
14
+ };
15
+ s.right = d - s.width - s.left;
16
+ const h = a.anchorX === "left" ? `left: ${s.left}px` : `right: ${s.right}px`, m = `pop-${z++}`;
17
+ o.dataset.motionPopId = m;
18
+ const t = document.createElement("style");
19
+ r.value.nonce && (t.nonce = r.value.nonce), i.set(o, t), document.head.appendChild(t), t.sheet && t.sheet.insertRule(`
20
+ [data-motion-pop-id="${m}"] {
21
+ position: absolute !important;
22
+ width: ${s.width}px !important;
23
+ height: ${s.height}px !important;
24
+ top: ${s.top}px !important;
25
+ ${h} !important;
26
+ }
27
+ `);
28
+ }
29
+ function l(o) {
30
+ const c = i.get(o);
31
+ c && (i.delete(o), C.render(() => {
32
+ document.head.removeChild(c);
33
+ }));
34
+ }
35
+ return {
36
+ addPopStyle: p,
37
+ removePopStyle: l
38
+ };
39
+ }
40
+ var U = 0;
41
+ function G(a) {
42
+ const i = String(U++), r = /* @__PURE__ */ new Map(), { addPopStyle: p, removePopStyle: l } = B(a);
43
+ function o(t) {
44
+ const e = [], n = v.get(t);
45
+ n && t.getAttribute(x.motionAttribute) === i && e.push(n);
46
+ const f = Array.from(t.querySelectorAll(`[${x.motionAttribute}="${i}"]`));
47
+ for (const g of f) {
48
+ const u = v.get(g);
49
+ u && e.push(u);
50
+ }
51
+ return e;
52
+ }
53
+ function c(t, e) {
54
+ const n = r.get(t);
55
+ n && (n.remaining.delete(e), n.remaining.size === 0 && s(n));
56
+ }
57
+ const d = {
58
+ initial: a.initial,
59
+ custom: a.custom,
60
+ presenceId: i,
61
+ onMotionExitComplete: c
62
+ };
63
+ E(d), S(() => {
64
+ d.initial = void 0;
65
+ });
66
+ function s(t) {
67
+ l(t.el), t.states.forEach((e) => {
68
+ e.getSnapshot(e.options, !1);
69
+ }), t.done(), r.delete(t.el), t.el?.isConnected ? t.states[0]?.didUpdate() : t.states.forEach((e) => {
70
+ e.unmount();
71
+ }), a.onExitComplete?.();
72
+ }
73
+ function h(t, e) {
74
+ o(t).forEach((n) => {
75
+ n.setActive("exit", !1), n.getSnapshot(n.options, !0);
76
+ }), e();
77
+ }
78
+ function m(t, e) {
79
+ d.custom = a.custom;
80
+ const n = t, f = o(n);
81
+ if (f.length === 0) {
82
+ e(), a.onExitComplete?.();
83
+ return;
84
+ }
85
+ const g = {
86
+ remaining: new Set(f),
87
+ states: f,
88
+ done: e,
89
+ el: n
90
+ };
91
+ r.set(n, g), p(n), f.forEach((u) => {
92
+ u.presenceContainer = n, u.setActive("exit", !0), u.getSnapshot(u.options, !1);
93
+ }), f[0]?.didUpdate();
94
+ }
95
+ return A(() => {
96
+ r.forEach((t) => {
97
+ t.states.forEach((e) => {
98
+ e.unmount();
99
+ });
100
+ }), r.clear();
101
+ }), {
102
+ enter: h,
103
+ exit: m
104
+ };
105
+ }
106
+ var H = /* @__PURE__ */ _({
107
+ name: "AnimatePresence",
108
+ inheritAttrs: !0,
109
+ __name: "AnimatePresence",
110
+ props: {
111
+ mode: { default: "sync" },
112
+ initial: {
113
+ type: Boolean,
114
+ default: !0
115
+ },
116
+ as: {},
117
+ custom: {},
118
+ onExitComplete: {},
119
+ anchorX: { default: "left" }
120
+ },
121
+ setup(a) {
122
+ const i = a, { enter: r, exit: p } = G(i), l = w(() => i.mode !== "wait" ? { tag: i.as } : { mode: i.mode === "wait" ? "out-in" : void 0 });
123
+ return (o, c) => (M(), $(b(o.mode === "wait" ? L : I), T(l.value, {
124
+ appear: "",
125
+ css: !1,
126
+ onLeave: y(p),
127
+ onEnter: y(r)
128
+ }), {
129
+ default: W(() => [k(o.$slots, "default")]),
130
+ _: 3
131
+ }, 16, ["onLeave", "onEnter"]));
132
+ }
133
+ }), D = H;
134
+ export {
135
+ D as A
136
+ };
@@ -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:{},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
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),U=require("../_plugin-vue_export-helper-BHFhmbuH.js"),H={class:"g-card__content"},W=a.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},shadow:{type:Boolean,default:!0},glow:{type:Boolean,default:!0}},setup(v){function O(e){const t=e.match(/([\d.]+)\s*([\d.]+)%?\s*([\d.]+)%?/);return t?{h:parseFloat(t[1]),s:parseFloat(t[2]),l:parseFloat(t[3])}:{h:40,s:80,l:80}}function B(e,t){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,$,k,T,q])=>{const D=Math.min(T*t,100);return`${q?"inset ":""}${d}px ${s}px ${$}px ${k}px hsl(${c} / ${D}%)`}).join(", ")}function C(e){return 1-Math.pow(1-e,3)}function w(e){return e*e*e}function b({start:e=0,end:t=100,duration:n=1e3,delay:o=0,ease:l=C,onUpdate:c,onEnd:i}){const d=performance.now()+o;function s(){const $=performance.now()-d,k=Math.min($/n,1);c(e+(t-e)*l(k)),k<1?requestAnimationFrame(s):i&&i()}setTimeout(()=>requestAnimationFrame(s),o)}const P=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],E=[0,1,2,0,1,2,1];function N(e){const t=[];for(let n=0;n<7;n++){const o=e[Math.min(E[n],e.length-1)];t.push(`radial-gradient(at ${P[n]}, ${o} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}const r=v,S=a.computed(()=>r.backgroundColor??"transparent"),x=a.useTemplateRef("cardRef"),y=a.ref(!1),f=a.ref(45),p=a.ref(0),h=a.ref(!1),_=e=>{const{width:t,height:n}=e.getBoundingClientRect();return[t/2,n/2]},V=(e,t,n)=>{const[o,l]=_(e),c=t-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)},z=(e,t,n)=>{const[o,l]=_(e),c=t-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 t=x.value;if(!t)return;const n=t.getBoundingClientRect(),o=e.clientX-n.left,l=e.clientY-n.top;p.value=V(t,o,l),f.value=z(t,o,l)};a.watch(()=>r.animated,()=>{if(!r.animated)return;const e=110,t=465;h.value=!0,f.value=e,b({duration:500,onUpdate:n=>p.value=n/100}),b({ease:w,duration:1500,end:50,onUpdate:n=>{f.value=(t-e)*(n/100)+e}}),b({ease:C,delay:1500,duration:2250,start:50,end:100,onUpdate:n=>{f.value=(t-e)*(n/100)+e}}),b({ease:w,delay:2500,duration:1500,start:100,end:0,onUpdate:n=>p.value=n/100,onEnd:()=>h.value=!1})},{immediate:!0});const M=a.computed(()=>r.edgeSensitivity+20),g=a.computed(()=>y.value||h.value),I=a.computed(()=>g.value?Math.max(0,(p.value*100-M.value)/(100-M.value)):0),F=a.computed(()=>g.value?Math.max(0,(p.value*100-r.edgeSensitivity)/(100-r.edgeSensitivity)):0),R=a.computed(()=>N(r.colors)),j=a.computed(()=>R.value.map(e=>`${e} border-box`)),G=a.computed(()=>R.value.map(e=>`${e} padding-box`)),u=a.computed(()=>`${f.value.toFixed(3)}deg`);return(e,t)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"cardRef",ref:x,onPointermove:A,onPointerenter:t[0]||(t[0]=n=>y.value=!0),onPointerleave:t[1]||(t[1]=n=>y.value=!1),class:a.normalizeClass(["g-card",{"g-card--shadow":r.shadow},r.className]),style:a.normalizeStyle({background:S.value,borderRadius:r.borderRadius+"px"})},[r.glow?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",{class:"g-card__border",style:a.normalizeStyle({background:[`linear-gradient(${S.value} 0 100%) padding-box`,"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",...j.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),a.createElementVNode("div",{class:"g-card__fill",style:a.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),a.createElementVNode("span",{class:"g-card__glow",style:a.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:F.value,transition:g.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},[a.createElementVNode("span",{class:"g-card__glow-inner",style:a.normalizeStyle({inset:`${r.glowRadius}px`,boxShadow:B(r.glowColor,r.glowIntensity)})},null,4)],4)],64)):a.createCommentVNode("",!0),a.createElementVNode("div",H,[a.renderSlot(e.$slots,"default",{},void 0,!0)])],38))}}),m=U._export_sfc(W,[["__scopeId","data-v-c2ad9d99"]]),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,6 +1,6 @@
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({
1
+ import { defineComponent as X, computed as i, useTemplateRef as Y, ref as y, watch as J, createElementBlock as A, openBlock as F, normalizeStyle as b, normalizeClass as K, createCommentVNode as Z, createElementVNode as m, Fragment as ee, renderSlot as ae } from "vue";
2
+ import { _ as te } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
3
+ const ne = { class: "g-card__content" }, re = /* @__PURE__ */ X({
4
4
  __name: "index",
5
5
  props: {
6
6
  className: { default: "" },
@@ -13,15 +13,17 @@ const ae = { class: "g-card__content" }, te = /* @__PURE__ */ L({
13
13
  coneSpread: { default: 25 },
14
14
  animated: { type: Boolean, default: !1 },
15
15
  colors: { default: () => ["#c084fc", "#f472b6", "#38bdf8"] },
16
- fillOpacity: { default: 0.5 }
16
+ fillOpacity: { default: 0.5 },
17
+ shadow: { type: Boolean, default: !0 },
18
+ glow: { type: Boolean, default: !0 }
17
19
  },
18
- setup($) {
19
- function A(e) {
20
+ setup(h) {
21
+ function E(e) {
20
22
  const a = e.match(/([\d.]+)\s*([\d.]+)%?\s*([\d.]+)%?/);
21
23
  return a ? { h: parseFloat(a[1]), s: parseFloat(a[2]), l: parseFloat(a[3]) } : { h: 40, s: 80, l: 80 };
22
24
  }
23
- function E(e, a) {
24
- const { h: t, s: r, l: o } = A(e), s = `${t}deg ${r}% ${o}%`;
25
+ function N(e, a) {
26
+ const { h: t, s: r, l: o } = E(e), s = `${t}deg ${r}% ${o}%`;
25
27
  return [
26
28
  [0, 0, 0, 1, 100, !0],
27
29
  [0, 0, 1, 0, 60, !0],
@@ -36,9 +38,9 @@ const ae = { class: "g-card__content" }, te = /* @__PURE__ */ L({
36
38
  [0, 0, 15, 0, 30, !1],
37
39
  [0, 0, 25, 2, 20, !1],
38
40
  [0, 0, 50, 2, 10, !1]
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}%)`;
41
+ ].map(([d, l, w, v, H, L]) => {
42
+ const Q = Math.min(H * a, 100);
43
+ return `${L ? "inset " : ""}${d}px ${l}px ${w}px ${v}px hsl(${s} / ${Q}%)`;
42
44
  }).join(", ");
43
45
  }
44
46
  function S(e) {
@@ -54,16 +56,16 @@ const ae = { class: "g-card__content" }, te = /* @__PURE__ */ L({
54
56
  delay: r = 0,
55
57
  ease: o = S,
56
58
  onUpdate: s,
57
- onEnd: i
59
+ onEnd: c
58
60
  }) {
59
61
  const d = performance.now() + r;
60
62
  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
+ const w = performance.now() - d, v = Math.min(w / t, 1);
64
+ s(e + (a - e) * o(v)), v < 1 ? requestAnimationFrame(l) : c && c();
63
65
  }
64
66
  setTimeout(() => requestAnimationFrame(l), r);
65
67
  }
66
- const F = [
68
+ const j = [
67
69
  "80% 55%",
68
70
  "69% 34%",
69
71
  "8% 6%",
@@ -71,34 +73,34 @@ const ae = { class: "g-card__content" }, te = /* @__PURE__ */ L({
71
73
  "86% 85%",
72
74
  "82% 18%",
73
75
  "51% 4%"
74
- ], j = [0, 1, 2, 0, 1, 2, 1];
75
- function N(e) {
76
+ ], z = [0, 1, 2, 0, 1, 2, 1];
77
+ function D(e) {
76
78
  const a = [];
77
79
  for (let t = 0; t < 7; t++) {
78
- const r = e[Math.min(j[t], e.length - 1)];
79
- a.push(`radial-gradient(at ${F[t]}, ${r} 0px, transparent 50%)`);
80
+ const r = e[Math.min(z[t], e.length - 1)];
81
+ a.push(`radial-gradient(at ${j[t]}, ${r} 0px, transparent 50%)`);
80
82
  }
81
83
  return a.push(`linear-gradient(${e[0]} 0 100%)`), a;
82
84
  }
83
- const n = $, _ = c(() => n.backgroundColor ?? "transparent"), I = Q("cardRef"), h = y(!1), f = y(45), p = y(0), C = y(!1), R = (e) => {
85
+ const n = h, _ = i(() => n.backgroundColor ?? "transparent"), I = Y("cardRef"), $ = y(!1), f = y(45), p = y(0), C = y(!1), R = (e) => {
84
86
  const { width: a, height: t } = e.getBoundingClientRect();
85
87
  return [a / 2, t / 2];
86
- }, z = (e, a, t) => {
87
- const [r, o] = R(e), s = a - r, i = t - o;
88
+ }, G = (e, a, t) => {
89
+ const [r, o] = R(e), s = a - r, c = t - o;
88
90
  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
- if (s === 0 && i === 0) return 0;
93
- let l = Math.atan2(i, s) * (180 / Math.PI) + 90;
91
+ return s !== 0 && (d = r / Math.abs(s)), c !== 0 && (l = o / Math.abs(c)), Math.min(Math.max(1 / Math.min(d, l), 0), 1);
92
+ }, T = (e, a, t) => {
93
+ const [r, o] = R(e), s = a - r, c = t - o;
94
+ if (s === 0 && c === 0) return 0;
95
+ let l = Math.atan2(c, s) * (180 / Math.PI) + 90;
94
96
  return l < 0 && (l += 360), l;
95
- }, G = (e) => {
97
+ }, U = (e) => {
96
98
  const a = I.value;
97
99
  if (!a) return;
98
100
  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);
101
+ p.value = G(a, r, o), f.value = T(a, r, o);
100
102
  };
101
- X(
103
+ J(
102
104
  () => n.animated,
103
105
  () => {
104
106
  if (!n.animated) return;
@@ -131,93 +133,95 @@ const ae = { class: "g-card__content" }, te = /* @__PURE__ */ L({
131
133
  },
132
134
  { immediate: !0 }
133
135
  );
134
- const O = c(() => n.edgeSensitivity + 20), g = c(() => h.value || C.value), P = c(
136
+ const O = i(() => n.edgeSensitivity + 20), g = i(() => $.value || C.value), B = i(
135
137
  () => g.value ? Math.max(
136
138
  0,
137
139
  (p.value * 100 - O.value) / (100 - O.value)
138
140
  ) : 0
139
- ), T = c(
141
+ ), V = i(
140
142
  () => g.value ? Math.max(
141
143
  0,
142
144
  (p.value * 100 - n.edgeSensitivity) / (100 - n.edgeSensitivity)
143
145
  ) : 0
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
- return (e, a) => (J(), Y("div", {
146
+ ), P = i(() => D(n.colors)), W = i(() => P.value.map((e) => `${e} border-box`)), q = i(() => P.value.map((e) => `${e} padding-box`)), u = i(() => `${f.value.toFixed(3)}deg`);
147
+ return (e, a) => (F(), A("div", {
146
148
  ref_key: "cardRef",
147
149
  ref: I,
148
- onPointermove: G,
149
- onPointerenter: a[0] || (a[0] = (t) => h.value = !0),
150
- onPointerleave: a[1] || (a[1] = (t) => h.value = !1),
151
- class: K(["g-card", n.className]),
150
+ onPointermove: U,
151
+ onPointerenter: a[0] || (a[0] = (t) => $.value = !0),
152
+ onPointerleave: a[1] || (a[1] = (t) => $.value = !1),
153
+ class: K(["g-card", { "g-card--shadow": n.shadow }, n.className]),
152
154
  style: b({
153
155
  background: _.value,
154
156
  borderRadius: n.borderRadius + "px"
155
157
  })
156
158
  }, [
157
- m("div", {
158
- class: "g-card__border",
159
- style: b({
160
- background: [
161
- `linear-gradient(${_.value} 0 100%) padding-box`,
162
- "linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",
163
- ...U.value
164
- ].join(", "),
165
- opacity: P.value,
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
- 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: g.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
169
- })
170
- }, null, 4),
171
- m("div", {
172
- class: "g-card__fill",
173
- style: b({
174
- background: V.value.join(", "),
175
- maskImage: [
176
- "linear-gradient(to bottom, black, black)",
177
- "radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)",
178
- "radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)",
179
- "radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)",
180
- "radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)",
181
- "radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",
182
- `conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`
183
- ].join(", "),
184
- WebkitMaskImage: [
185
- "linear-gradient(to bottom, black, black)",
186
- "radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)",
187
- "radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)",
188
- "radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)",
189
- "radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)",
190
- "radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",
191
- `conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`
192
- ].join(", "),
193
- opacity: P.value * n.fillOpacity,
194
- transition: g.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
195
- })
196
- }, null, 4),
197
- m("span", {
198
- class: "g-card__glow",
199
- style: b({
200
- inset: `-${n.glowRadius}px`,
201
- maskImage: `conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,
202
- WebkitMaskImage: `conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,
203
- opacity: T.value,
204
- transition: g.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
205
- })
206
- }, [
159
+ n.glow ? (F(), A(ee, { key: 0 }, [
160
+ m("div", {
161
+ class: "g-card__border",
162
+ style: b({
163
+ background: [
164
+ `linear-gradient(${_.value} 0 100%) padding-box`,
165
+ "linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",
166
+ ...W.value
167
+ ].join(", "),
168
+ opacity: B.value,
169
+ maskImage: `conic-gradient(from ${u.value} at center, black ${n.coneSpread}%, transparent ${n.coneSpread + 15}%, transparent ${100 - n.coneSpread - 15}%, black ${100 - n.coneSpread}%)`,
170
+ WebkitMaskImage: `conic-gradient(from ${u.value} at center, black ${n.coneSpread}%, transparent ${n.coneSpread + 15}%, transparent ${100 - n.coneSpread - 15}%, black ${100 - n.coneSpread}%)`,
171
+ transition: g.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
172
+ })
173
+ }, null, 4),
174
+ m("div", {
175
+ class: "g-card__fill",
176
+ style: b({
177
+ background: q.value.join(", "),
178
+ maskImage: [
179
+ "linear-gradient(to bottom, black, black)",
180
+ "radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)",
181
+ "radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)",
182
+ "radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)",
183
+ "radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)",
184
+ "radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",
185
+ `conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`
186
+ ].join(", "),
187
+ WebkitMaskImage: [
188
+ "linear-gradient(to bottom, black, black)",
189
+ "radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)",
190
+ "radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)",
191
+ "radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)",
192
+ "radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)",
193
+ "radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",
194
+ `conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`
195
+ ].join(", "),
196
+ opacity: B.value * n.fillOpacity,
197
+ transition: g.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
198
+ })
199
+ }, null, 4),
207
200
  m("span", {
208
- class: "g-card__glow-inner",
201
+ class: "g-card__glow",
209
202
  style: b({
210
- inset: `${n.glowRadius}px`,
211
- boxShadow: E(n.glowColor, n.glowIntensity)
203
+ inset: `-${n.glowRadius}px`,
204
+ maskImage: `conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,
205
+ WebkitMaskImage: `conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,
206
+ opacity: V.value,
207
+ transition: g.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
212
208
  })
213
- }, null, 4)
214
- ], 4),
215
- m("div", ae, [
216
- Z(e.$slots, "default", {}, void 0, !0)
209
+ }, [
210
+ m("span", {
211
+ class: "g-card__glow-inner",
212
+ style: b({
213
+ inset: `${n.glowRadius}px`,
214
+ boxShadow: N(n.glowColor, n.glowIntensity)
215
+ })
216
+ }, null, 4)
217
+ ], 4)
218
+ ], 64)) : Z("", !0),
219
+ m("div", ne, [
220
+ ae(e.$slots, "default", {}, void 0, !0)
217
221
  ])
218
222
  ], 38));
219
223
  }
220
- }), w = /* @__PURE__ */ ee(te, [["__scopeId", "data-v-d2f696d6"]]), oe = [
224
+ }), x = /* @__PURE__ */ te(re, [["__scopeId", "data-v-c2ad9d99"]]), se = [
221
225
  // ===== 浅色方案 =====
222
226
  {
223
227
  name: "Daylight",
@@ -277,11 +281,11 @@ const ae = { class: "g-card__content" }, te = /* @__PURE__ */ L({
277
281
  dark: !0
278
282
  }
279
283
  ];
280
- w.install = ($) => {
281
- $.component(w.name, w);
284
+ x.install = (h) => {
285
+ h.component(x.name, x);
282
286
  };
283
287
  export {
284
- w as GCard,
285
- oe as cardPresets,
286
- w as default
288
+ x as GCard,
289
+ se as cardPresets,
290
+ x as default
287
291
  };
@@ -1 +1 @@
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
+ .g-card[data-v-c2ad9d99]{position:relative;display:grid;isolation:isolate;border:1px solid rgba(255,255,255,.15);transform:translateZ(.01px)}.g-card--shadow[data-v-c2ad9d99]{box-shadow:#0000000d 0 2px 8px,#0000000d 0 16px 40px}.g-card__border[data-v-c2ad9d99],.g-card__fill[data-v-c2ad9d99]{position:absolute;inset:0;z-index:-1;border:1px solid transparent;border-radius:inherit}.g-card__fill[data-v-c2ad9d99]{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-c2ad9d99]{position:absolute;z-index:1;border-radius:inherit;pointer-events:none;mix-blend-mode:plus-lighter}.g-card__glow-inner[data-v-c2ad9d99]{position:absolute;border-radius:inherit}.g-card__content[data-v-c2ad9d99]{position:relative;z-index:1;display:flex;flex-direction:column;overflow:auto}
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../index-B1MYKy3L.js"),S=require("../_plugin-vue_export-helper-BHFhmbuH.js"),N=Symbol("GDialogManager"),M={small:"380px",medium:"480px",large:"580px"},T={ICON_WIDTH:92,ICON_HEIGHT:34,GAP:8,BOTTOM_OFFSET:18,RIGHT_OFFSET:18,MAX_PER_ROW:8};function q(s){const m=new Map,{ICON_WIDTH:a,ICON_HEIGHT:r,GAP:f,BOTTOM_OFFSET:g,RIGHT_OFFSET:l,MAX_PER_ROW:o}=T;return s.forEach((c,u)=>{const n=Math.floor(u/o),i=u%o;m.set(c,{right:l+i*(a+f),bottom:g+n*(r+f)})}),m}function W(){const s=e.reactive(new Map),m=e.computed(()=>{const n=[];return s.forEach(i=>{i.isMinimized&&n.push(i.id)}),n}),a=e.computed(()=>q(m.value));function r(n){s.set(n.id,{attentionTick:0,...n})}function f(n){s.delete(n)}function g(n){const i=s.get(n);if(i){if(i.isMinimized){i.attentionTick=(i.attentionTick??0)+1;return}i.isMinimized=!0}}function l(n){const i=s.get(n);i?.isMinimized&&(i.attentionTick=(i.attentionTick??0)+1)}function o(n){const i=s.get(n);i&&(i.isMinimized=!1)}function c(n){return e.computed(()=>a.value.get(n)??{right:T.RIGHT_OFFSET,bottom:T.BOTTOM_OFFSET})}const u=e.computed(()=>m.value.map(n=>s.get(n)).filter(Boolean));return{dialogs:s,register:r,unregister:f,minimize:g,remindMinimized:l,restore:o,getPosition:c,minimizedList:u}}function O(){return e.inject(N,null)}const Y=["title","aria-label"],Z={class:"g-dialog-minimized-icon__icon","aria-hidden":"true"},j={class:"g-dialog-minimized-icon__title"},K=e.defineComponent({name:"GDialogMinimizedIcon",__name:"GDialogMinimizedIcon",props:{title:{},position:{},attentionTick:{default:0}},emits:["restore"],setup(s,{emit:m}){const a=s,r=m,f=e.computed(()=>a.title||"弹窗"),g=e.computed(()=>`恢复 ${f.value}`),l=e.computed(()=>({position:"fixed",right:`${a.position.right}px`,bottom:`${a.position.bottom}px`})),o=e.ref(!1);let c;e.watch(()=>a.attentionTick,(n,i)=>{i===void 0||n===i||(o.value=!1,window.clearTimeout(c),window.requestAnimationFrame(()=>{o.value=!0,c=window.setTimeout(()=>{o.value=!1},580)}))}),e.onUnmounted(()=>{window.clearTimeout(c)});function u(){r("restore")}return(n,i)=>{const w=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",{class:e.normalizeClass(["g-dialog-minimized-icon",{"is-attention":o.value}]),type:"button",style:e.normalizeStyle(l.value),title:g.value,"aria-label":g.value,onClick:u},[i[0]||(i[0]=e.createElementVNode("span",{class:"g-dialog-minimized-icon__glow","aria-hidden":"true"},null,-1)),i[1]||(i[1]=e.createElementVNode("span",{class:"g-dialog-minimized-icon__wave","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Z,[e.createVNode(w,null,{default:e.withCtx(()=>[e.createVNode(e.unref(y.chat_dot_round_default))]),_:1})]),e.createElementVNode("span",j,e.toDisplayString(f.value),1)],14,Y)])}}}),C=S._export_sfc(K,[["__scopeId","data-v-5195816e"]]),X={class:"g-dialog-header"},J={class:"g-dialog-title"},Q={class:"g-dialog-operation-container","aria-label":"弹窗操作"},ee=["aria-label","title"],te=["onClick"],oe={class:"g-dialog-footer"},B="关闭",ie=e.defineComponent({name:"GDialog",inheritAttrs:!1,__name:"index",props:{title:{default:""},size:{default:"medium"},modelValue:{type:Boolean},hideFooter:{type:Boolean,default:!1},actions:{},showCancel:{type:Boolean,default:!0},showReset:{type:Boolean,default:!0},showSave:{type:Boolean,default:!0},cancelText:{default:"取消"},resetText:{default:"重置"},saveText:{default:"保存"},saveLoading:{type:Boolean,default:!1},saveDisabled:{type:Boolean,default:!1},beforeClose:{}},emits:["cancel","reset","save","minimize","action","update:modelValue"],setup(s,{emit:m}){const a=s,r=m,f=e.computed(()=>a.modelValue);function g(t){r("update:modelValue",t)}const l=e.useId?e.useId():`g-dialog-${Date.now()}-${Math.random().toString(36).slice(2)}`,o=O(),c=e.ref(!1),u=e.ref(!0),n=e.ref(0),i=e.ref(!1),w=e.computed(()=>o?o.dialogs.get(l)?.isMinimized??!1:c.value),D=e.computed(()=>o?o.dialogs.get(l)?.attentionTick??0:n.value),G=e.computed(()=>o?!(o.dialogs.get(l)?.isMinimized??!1):u.value),A=e.computed(()=>o?o.getPosition(l).value:{right:20,bottom:20});e.onMounted(()=>{o?.register({id:l,title:a.title,isMinimized:!1})}),e.onUnmounted(()=>{o?.unregister(l)}),e.watch(()=>a.title,t=>{if(o){const p=o.dialogs.get(l);p&&(p.title=t)}}),e.watch(()=>a.modelValue,t=>{if(t===!1){if(i.value){i.value=!1;return}o?o.restore(l):(u.value=!0,c.value=!1)}t===!0&&(o?.dialogs.get(l)?.isMinimized?o.remindMinimized(l):c.value&&(n.value+=1))});const F=e.computed(()=>Object.prototype.hasOwnProperty.call(M,a.size)?M[a.size]:a.size);async function v(t){if(!a.beforeClose)return!0;try{return await a.beforeClose(t)!==!1}catch{return!1}}async function L(t){const p=await v("close");t(!p)}async function $(){await v("close")&&r("update:modelValue",!1)}async function b(){await v("cancel")&&r("cancel")}function V(){r("reset")}async function E(){await v("save")&&r("save")}const z=e.reactive({});async function R(t){if(await v("action")&&(r("action",t.key),!!t.onClick))try{const p=t.onClick();p instanceof Promise&&(z[t.key]=!0,await p)}finally{z[t.key]=!1}}const k=e.ref(!1),P=()=>{k.value=!k.value},I=e.computed(()=>k.value?"退出全屏":"全屏"),x=async()=>{if(await v("minimize")){if(i.value=!0,o)o.minimize(l);else{if(c.value){n.value+=1,r("minimize",{id:l});return}u.value=!1,c.value=!0}r("update:modelValue",!1),r("minimize",{id:l})}},H=()=>{o?o.restore(l):(u.value=!0,c.value=!1),r("update:modelValue",!0)};return(t,p)=>{const h=e.resolveComponent("el-button"),U=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[G.value?(e.openBlock(),e.createBlock(U,e.mergeProps({key:0},t.$attrs,{"model-value":f.value,width:F.value,"lock-scroll":!1,"show-close":!1,fullscreen:k.value,"before-close":L,class:"g-dialog","onUpdate:modelValue":g}),e.createSlots({header:e.withCtx(({close:d})=>[e.createElementVNode("div",X,[e.createElementVNode("p",J,e.toDisplayString(t.title),1),e.createElementVNode("div",Q,[e.createElementVNode("button",{type:"button",class:"g-dialog-control g-dialog-control--minimize","aria-label":"最小化",title:"最小化",onClick:x}),e.createElementVNode("button",{type:"button",class:"g-dialog-control g-dialog-control--fullscreen","aria-label":I.value,title:I.value,onClick:P},null,8,ee),e.createElementVNode("button",{type:"button",class:"g-dialog-control g-dialog-control--close","aria-label":B,title:B,onClick:d},null,8,te)])])]),default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},void 0,!0)]),_:2},[t.hideFooter?void 0:{name:"footer",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"footer",{cancel:b,reset:V,save:E,close:$,loading:t.saveLoading},()=>[e.createElementVNode("div",oe,[t.actions&&t.actions.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.actions,d=>(e.openBlock(),e.createBlock(h,{key:d.key,type:d.type,icon:d.icon,loading:d.loading||z[d.key],disabled:d.disabled,plain:d.plain,size:"small",onClick:ne=>R(d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["type","icon","loading","disabled","plain","onClick"]))),128)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.showCancel?(e.openBlock(),e.createBlock(h,{key:0,icon:e.unref(y.remove_default),size:"small",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.cancelText),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0),t.showReset?(e.openBlock(),e.createBlock(h,{key:1,icon:e.unref(y.refresh_default),size:"small",onClick:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.resetText),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0),t.showSave?(e.openBlock(),e.createBlock(h,{key:2,type:"primary",icon:e.unref(y.circle_check_default),loading:t.saveLoading,disabled:t.saveDisabled,size:"small",onClick:E},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.saveText),1)]),_:1},8,["icon","loading","disabled"])):e.createCommentVNode("",!0)],64)),e.renderSlot(t.$slots,"moreOperations",{},void 0,!0)])],!0)]),key:"0"}]),1040,["model-value","width","fullscreen"])):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createBlock(C,{key:1,title:t.title,position:A.value,"attention-tick":D.value,onRestore:H},null,8,["title","position","attention-tick"])):e.createCommentVNode("",!0)])}}}),_=S._export_sfc(ie,[["__scopeId","data-v-0cb7c4e3"]]);_.install=s=>{s.component(_.name,_),s.component(C.name,C)};exports.DIALOG_MANAGER_KEY=N;exports.DIALOG_SIZES=M;exports.GDialog=_;exports.GDialogMinimizedIcon=C;exports.MINIMIZED_LAYOUT=T;exports.createDialogManager=W;exports.default=_;exports.useDialogManager=O;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),M=require("../index-B1MYKy3L.js"),j=require("../AnimatePresence-26Wy0TGN.js"),K=require("../index-B8Ap0044.js"),x=require("../_plugin-vue_export-helper-BHFhmbuH.js"),F=Symbol("GDialogManager"),N={small:"380px",medium:"480px",large:"580px"},b={ICON_WIDTH:92,ICON_HEIGHT:34,GAP:8,BOTTOM_OFFSET:18,RIGHT_OFFSET:18,MAX_PER_ROW:8};function X(s){const m=new Map,{ICON_WIDTH:a,ICON_HEIGHT:r,GAP:f,BOTTOM_OFFSET:v,RIGHT_OFFSET:l,MAX_PER_ROW:o}=b;return s.forEach((c,u)=>{const n=Math.floor(u/o),i=u%o;m.set(c,{right:l+i*(a+f),bottom:v+n*(r+f)})}),m}function J(){const s=e.reactive(new Map),m=e.computed(()=>{const n=[];return s.forEach(i=>{i.isMinimized&&n.push(i.id)}),n}),a=e.computed(()=>X(m.value));function r(n){s.set(n.id,{attentionTick:0,...n})}function f(n){s.delete(n)}function v(n){const i=s.get(n);if(i){if(i.isMinimized){i.attentionTick=(i.attentionTick??0)+1;return}i.isMinimized=!0}}function l(n){const i=s.get(n);i?.isMinimized&&(i.attentionTick=(i.attentionTick??0)+1)}function o(n){const i=s.get(n);i&&(i.isMinimized=!1)}function c(n){return e.computed(()=>a.value.get(n)??{right:b.RIGHT_OFFSET,bottom:b.BOTTOM_OFFSET})}const u=e.computed(()=>m.value.map(n=>s.get(n)).filter(Boolean));return{dialogs:s,register:r,unregister:f,minimize:v,remindMinimized:l,restore:o,getPosition:c,minimizedList:u}}function P(){return e.inject(F,null)}const Q={class:"g-dialog-minimized-icon__icon","aria-hidden":"true"},ee={class:"g-dialog-minimized-icon__title"},te=e.defineComponent({name:"GDialogMinimizedIcon",__name:"GDialogMinimizedIcon",props:{title:{},position:{},attentionTick:{default:0}},emits:["restore"],setup(s,{emit:m}){const a=s,r=m,f=e.computed(()=>a.title||"弹窗"),v=e.computed(()=>`恢复 ${f.value}`),l={opacity:0,scale:.8,x:-24,y:12},o={opacity:1,scale:1,x:0,y:0},c={opacity:0,scale:.8,x:-24,y:12},u={duration:.28,ease:[.2,.8,.2,1]},n={scale:1.04,y:-2},i={scale:.98},y=e.computed(()=>({position:"fixed",right:`${a.position.right}px`,bottom:`${a.position.bottom}px`})),_=e.ref(!1);let k;e.watch(()=>a.attentionTick,(z,p)=>{p===void 0||z===p||(_.value=!1,window.clearTimeout(k),window.requestAnimationFrame(()=>{_.value=!0,k=window.setTimeout(()=>{_.value=!1},580)}))}),e.onUnmounted(()=>{window.clearTimeout(k)});function I(){r("restore")}return(z,p)=>{const E=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.unref(K.motion).div,{class:e.normalizeClass(["g-dialog-minimized-icon",{"is-attention":_.value}]),type:"button",style:e.normalizeStyle(y.value),title:v.value,"aria-label":v.value,initial:l,animate:o,exit:c,transition:u,"while-hover":n,"while-press":i,onClick:I},{default:e.withCtx(()=>[p[0]||(p[0]=e.createElementVNode("span",{class:"g-dialog-minimized-icon__glow","aria-hidden":"true"},null,-1)),p[1]||(p[1]=e.createElementVNode("span",{class:"g-dialog-minimized-icon__wave","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Q,[e.createVNode(E,null,{default:e.withCtx(()=>[e.createVNode(e.unref(M.chat_dot_round_default))]),_:1})]),e.createElementVNode("span",ee,e.toDisplayString(f.value),1)]),_:1,__:[0,1]},8,["class","style","title","aria-label"])])}}}),V=x._export_sfc(te,[["__scopeId","data-v-5ff0a7c2"]]),oe={class:"g-dialog-header"},ie={class:"g-dialog-title"},ne={class:"g-dialog-operation-container","aria-label":"弹窗操作"},le=["aria-label","title"],ae=["onClick"],se={class:"g-dialog-footer"},G="关闭",re=e.defineComponent({name:"GDialog",inheritAttrs:!1,__name:"index",props:{title:{default:""},size:{default:"medium"},modelValue:{type:Boolean},hideFooter:{type:Boolean,default:!1},actions:{},showCancel:{type:Boolean,default:!0},showReset:{type:Boolean,default:!0},showSave:{type:Boolean,default:!0},cancelText:{default:"取消"},resetText:{default:"重置"},saveText:{default:"保存"},saveLoading:{type:Boolean,default:!1},saveDisabled:{type:Boolean,default:!1},beforeClose:{}},emits:["cancel","reset","save","minimize","action","update:modelValue"],setup(s,{emit:m}){const a=s,r=m,f=e.computed(()=>a.modelValue);function v(t){r("update:modelValue",t)}const l=e.useId?e.useId():`g-dialog-${Date.now()}-${Math.random().toString(36).slice(2)}`,o=P(),c=e.ref(!1),u=e.ref(!0),n=e.ref(0),i=e.ref(!1),y=e.ref(!1),_=e.ref(!1),k=e.computed(()=>o?o.dialogs.get(l)?.isMinimized??!1:c.value),I=e.computed(()=>o?o.dialogs.get(l)?.attentionTick??0:n.value),z=e.computed(()=>o?!y.value:u.value),p=e.computed(()=>o?o.getPosition(l).value:{right:20,bottom:20});e.onMounted(()=>{o?.register({id:l,title:a.title,isMinimized:!1})}),e.onUnmounted(()=>{o?.unregister(l)}),e.watch(()=>a.title,t=>{if(o){const g=o.dialogs.get(l);g&&(g.title=t)}}),e.watch(()=>a.modelValue,t=>{if(t===!1){if(i.value)return;o?(o.restore(l),y.value=!1):(u.value=!0,c.value=!1)}t===!0&&(o?.dialogs.get(l)?.isMinimized?o.remindMinimized(l):c.value&&(n.value+=1))});const E=e.computed(()=>Object.prototype.hasOwnProperty.call(N,a.size)?N[a.size]:a.size);async function h(t){if(!a.beforeClose)return!0;try{return await a.beforeClose(t)!==!1}catch{return!1}}async function L(t){const g=await h("close");t(!g)}async function R(){await h("close")&&r("update:modelValue",!1)}async function O(){await h("cancel")&&r("cancel")}function S(){r("reset")}async function D(){await h("save")&&r("save")}const B=e.reactive({});async function $(t){if(await h("action")&&(r("action",t.key),!!t.onClick))try{const g=t.onClick();g instanceof Promise&&(B[t.key]=!0,await g)}finally{B[t.key]=!1}}const C=e.ref(!1),H=()=>{C.value=!C.value},A=e.computed(()=>C.value?"退出全屏":"全屏"),q=async()=>{if(!await h("minimize"))return;if(o?o.dialogs.get(l)?.isMinimized??!1:c.value){o?o.minimize(l):n.value+=1,r("minimize",{id:l});return}i.value=!0,o?o.minimize(l):c.value=!0,r("update:modelValue",!1),r("minimize",{id:l})},W=()=>{_.value=!0,i.value=!1,o?(y.value=!1,o.restore(l)):(u.value=!0,c.value=!1),r("update:modelValue",!0)},U=()=>{i.value&&(o?y.value=!0:u.value=!1,i.value=!1)},Y=()=>{_.value=!1};return(t,g)=>{const w=e.resolveComponent("el-button"),Z=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[z.value?(e.openBlock(),e.createBlock(Z,e.mergeProps({key:0},t.$attrs,{"model-value":f.value,width:E.value,"lock-scroll":!1,"show-close":!1,fullscreen:C.value,"before-close":L,class:["g-dialog",{"is-leave-to-minimize":i.value,"is-enter-from-minimize":_.value}],"onUpdate:modelValue":v,onClosed:U,onOpened:Y}),e.createSlots({header:e.withCtx(({close:d})=>[e.createElementVNode("div",oe,[e.createElementVNode("p",ie,e.toDisplayString(t.title),1),e.createElementVNode("div",ne,[e.createElementVNode("button",{type:"button",class:"g-dialog-control g-dialog-control--minimize","aria-label":"最小化",title:"最小化",onClick:q}),e.createElementVNode("button",{type:"button",class:"g-dialog-control g-dialog-control--fullscreen","aria-label":A.value,title:A.value,onClick:H},null,8,le),e.createElementVNode("button",{type:"button",class:"g-dialog-control g-dialog-control--close","aria-label":G,title:G,onClick:d},null,8,ae)])])]),default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},void 0,!0)]),_:2},[t.hideFooter?void 0:{name:"footer",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"footer",{cancel:O,reset:S,save:D,close:R,loading:t.saveLoading},()=>[e.createElementVNode("div",se,[t.actions&&t.actions.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.actions,d=>(e.openBlock(),e.createBlock(w,{key:d.key,type:d.type,icon:d.icon,loading:d.loading||B[d.key],disabled:d.disabled,plain:d.plain,size:"small",onClick:ce=>$(d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["type","icon","loading","disabled","plain","onClick"]))),128)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.showCancel?(e.openBlock(),e.createBlock(w,{key:0,icon:e.unref(M.remove_default),size:"small",onClick:O},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.cancelText),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0),t.showReset?(e.openBlock(),e.createBlock(w,{key:1,icon:e.unref(M.refresh_default),size:"small",onClick:S},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.resetText),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0),t.showSave?(e.openBlock(),e.createBlock(w,{key:2,type:"primary",icon:e.unref(M.circle_check_default),loading:t.saveLoading,disabled:t.saveDisabled,size:"small",onClick:D},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.saveText),1)]),_:1},8,["icon","loading","disabled"])):e.createCommentVNode("",!0)],64)),e.renderSlot(t.$slots,"moreOperations",{},void 0,!0)])],!0)]),key:"0"}]),1040,["model-value","width","fullscreen","class"])):e.createCommentVNode("",!0),e.createVNode(e.unref(j.AnimatePresence_default),null,{default:e.withCtx(()=>[k.value?(e.openBlock(),e.createBlock(V,{key:0,title:t.title,position:p.value,"attention-tick":I.value,onRestore:W},null,8,["title","position","attention-tick"])):e.createCommentVNode("",!0)]),_:1})])}}}),T=x._export_sfc(re,[["__scopeId","data-v-4a8b52ec"]]);T.install=s=>{s.component(T.name,T),s.component(V.name,V)};exports.DIALOG_MANAGER_KEY=F;exports.DIALOG_SIZES=N;exports.GDialog=T;exports.GDialogMinimizedIcon=V;exports.MINIMIZED_LAYOUT=b;exports.createDialogManager=J;exports.default=T;exports.useDialogManager=P;