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.
- package/lib/GCard/index.js +1 -1
- package/lib/GCard/index.mjs +140 -80
- package/lib/GCard/style.css +1 -1
- package/lib/GInputTreeTag/index.js +9 -1
- package/lib/GInputTreeTag/index.mjs +366 -190
- package/lib/GInputTreeTag/style.css +1 -1
- package/lib/GScroller/index.js +1 -0
- package/lib/GScroller/index.mjs +283 -0
- package/lib/GScroller/style.css +1 -0
- package/lib/GScroller.d.ts +1 -0
- package/lib/components/GCard/index.d.ts +2 -3
- package/lib/components/GCard/presets.d.ts +17 -0
- package/lib/components/GFuzzyText/index.d.ts +4 -4
- package/lib/components/GInputTreeTag/index.d.ts +16 -19
- package/lib/components/GScroller/index.d.ts +70 -0
- package/lib/components/GTable/index.d.ts +126 -3
- package/lib/index/index.js +1 -1
- package/lib/index/index.mjs +28 -23
- package/lib/index-Bi7JS7ve.mjs +5152 -0
- package/lib/index-xqOURU1q.js +1 -0
- package/lib/index.d.ts +4 -2
- package/package.json +15 -5
package/lib/GCard/index.js
CHANGED
|
@@ -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:{
|
|
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;
|
package/lib/GCard/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
3
|
-
const
|
|
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: {
|
|
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
|
|
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
|
|
24
|
-
const { h: t, s: 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,
|
|
40
|
-
const
|
|
41
|
-
return `${
|
|
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
|
|
44
|
+
function S(e) {
|
|
45
45
|
return 1 - Math.pow(1 - e, 3);
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function M(e) {
|
|
48
48
|
return e * e * e;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
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:
|
|
55
|
+
ease: o = S,
|
|
56
56
|
onUpdate: s,
|
|
57
57
|
onEnd: i
|
|
58
58
|
}) {
|
|
59
59
|
const d = performance.now() + r;
|
|
60
|
-
function
|
|
61
|
-
const
|
|
62
|
-
s(e + (a - e) *
|
|
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(
|
|
64
|
+
setTimeout(() => requestAnimationFrame(l), r);
|
|
65
65
|
}
|
|
66
|
-
const
|
|
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
|
-
],
|
|
75
|
-
function
|
|
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(
|
|
79
|
-
a.push(`radial-gradient(at ${
|
|
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 =
|
|
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
|
-
},
|
|
87
|
-
const [r,
|
|
88
|
-
let d = 1 / 0,
|
|
89
|
-
return s !== 0 && (d = r / Math.abs(s)), i !== 0 && (
|
|
90
|
-
},
|
|
91
|
-
const [r,
|
|
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
|
|
94
|
-
return
|
|
95
|
-
},
|
|
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,
|
|
99
|
-
|
|
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
|
-
|
|
107
|
-
ease:
|
|
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
|
-
|
|
111
|
+
f.value = (a - e) * (t / 100) + e;
|
|
112
112
|
}
|
|
113
|
-
}),
|
|
114
|
-
ease:
|
|
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
|
-
|
|
120
|
+
f.value = (a - e) * (t / 100) + e;
|
|
121
121
|
}
|
|
122
|
-
}),
|
|
123
|
-
ease:
|
|
122
|
+
}), k({
|
|
123
|
+
ease: M,
|
|
124
124
|
delay: 2500,
|
|
125
125
|
duration: 1500,
|
|
126
126
|
start: 100,
|
|
127
127
|
end: 0,
|
|
128
|
-
onUpdate: (t) =>
|
|
129
|
-
onEnd: () =>
|
|
128
|
+
onUpdate: (t) => p.value = t / 100,
|
|
129
|
+
onEnd: () => C.value = !1
|
|
130
130
|
});
|
|
131
131
|
},
|
|
132
132
|
{ immediate: !0 }
|
|
133
133
|
);
|
|
134
|
-
const
|
|
135
|
-
() =>
|
|
134
|
+
const O = c(() => n.edgeSensitivity + 20), g = c(() => h.value || C.value), P = c(
|
|
135
|
+
() => g.value ? Math.max(
|
|
136
136
|
0,
|
|
137
|
-
(
|
|
137
|
+
(p.value * 100 - O.value) / (100 - O.value)
|
|
138
138
|
) : 0
|
|
139
|
-
),
|
|
140
|
-
() =>
|
|
139
|
+
), T = c(
|
|
140
|
+
() => g.value ? Math.max(
|
|
141
141
|
0,
|
|
142
|
-
(
|
|
142
|
+
(p.value * 100 - n.edgeSensitivity) / (100 - n.edgeSensitivity)
|
|
143
143
|
) : 0
|
|
144
|
-
),
|
|
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:
|
|
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:
|
|
153
|
-
background:
|
|
152
|
+
style: b({
|
|
153
|
+
background: _.value,
|
|
154
154
|
borderRadius: n.borderRadius + "px"
|
|
155
155
|
})
|
|
156
156
|
}, [
|
|
157
|
-
|
|
157
|
+
m("div", {
|
|
158
158
|
class: "g-card__border",
|
|
159
|
-
style:
|
|
159
|
+
style: b({
|
|
160
160
|
background: [
|
|
161
|
-
`linear-gradient(${
|
|
161
|
+
`linear-gradient(${_.value} 0 100%) padding-box`,
|
|
162
162
|
"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",
|
|
163
|
-
...
|
|
163
|
+
...U.value
|
|
164
164
|
].join(", "),
|
|
165
|
-
opacity:
|
|
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:
|
|
168
|
+
transition: g.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
|
|
169
169
|
})
|
|
170
170
|
}, null, 4),
|
|
171
|
-
|
|
171
|
+
m("div", {
|
|
172
172
|
class: "g-card__fill",
|
|
173
|
-
style:
|
|
174
|
-
background:
|
|
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:
|
|
194
|
-
transition:
|
|
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
|
-
|
|
197
|
+
m("span", {
|
|
198
198
|
class: "g-card__glow",
|
|
199
|
-
style:
|
|
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:
|
|
204
|
-
transition:
|
|
203
|
+
opacity: T.value,
|
|
204
|
+
transition: g.value ? "opacity 0.25s ease-out" : "opacity 0.75s ease-in-out"
|
|
205
205
|
})
|
|
206
206
|
}, [
|
|
207
|
-
|
|
207
|
+
m("span", {
|
|
208
208
|
class: "g-card__glow-inner",
|
|
209
|
-
style:
|
|
209
|
+
style: b({
|
|
210
210
|
inset: `${n.glowRadius}px`,
|
|
211
|
-
boxShadow:
|
|
211
|
+
boxShadow: E(n.glowColor, n.glowIntensity)
|
|
212
212
|
})
|
|
213
213
|
}, null, 4)
|
|
214
214
|
], 4),
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
m("div", ae, [
|
|
216
|
+
Z(e.$slots, "default", {}, void 0, !0)
|
|
217
217
|
])
|
|
218
218
|
], 38));
|
|
219
219
|
}
|
|
220
|
-
}),
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
226
|
-
|
|
284
|
+
w as GCard,
|
|
285
|
+
oe as cardPresets,
|
|
286
|
+
w as default
|
|
227
287
|
};
|
package/lib/GCard/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.g-card[data-v-
|
|
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
|
|
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;
|