geekin-devtoys 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/GBubble/index.js +1 -2
- package/lib/GBubble/index.mjs +3 -210
- package/lib/GBubble-C3cM9Put.mjs +216 -0
- package/lib/GBubble-Dph0YDkU.js +2 -0
- package/lib/GButton/index.js +1 -1
- package/lib/GButton/index.mjs +81 -5
- package/lib/GButton/style.css +1 -0
- package/lib/GCard/index.js +1 -1
- package/lib/GCard/index.mjs +1 -1
- package/lib/GDialog/index.js +1 -1
- package/lib/GDialog/index.mjs +33 -34
- package/lib/GInput/index.js +1 -0
- package/lib/GInput/index.mjs +145 -0
- package/lib/GInput/style.css +1 -0
- package/lib/GInput.d.ts +1 -0
- package/lib/GInputTreeTag/index.js +1 -1
- package/lib/GInputTreeTag/index.mjs +77 -75
- package/lib/GInputTreeTag/style.css +1 -1
- package/lib/GPie3D/index.js +1 -1
- package/lib/GPie3D/index.mjs +1 -1
- package/lib/GProgress/index.js +1 -1
- package/lib/GProgress/index.mjs +1 -1
- package/lib/GRing/index.js +1 -1
- package/lib/GRing/index.mjs +1 -1
- package/lib/GScroller/index.js +1 -1
- package/lib/GScroller/index.mjs +135 -152
- package/lib/GShinyText/index.js +1 -1
- package/lib/GShinyText/index.mjs +45 -119
- package/lib/GSteps/index.js +1 -1
- package/lib/GSteps/index.mjs +89 -43
- package/lib/GSteps/style.css +1 -1
- package/lib/GTable/index.js +1 -1
- package/lib/GTable/index.mjs +1 -1
- package/lib/GTag/index.js +1 -0
- package/lib/GTag/index.mjs +73 -0
- package/lib/GTag.d.ts +1 -0
- package/lib/GVideo/index.js +2 -2
- package/lib/GVideo/index.mjs +1 -1
- package/lib/assets/GTag.css +1 -0
- package/lib/components/GInput/index.d.ts +64 -0
- package/lib/components/GInputTreeTag/index.d.ts +15 -23
- package/lib/components/GTag/index.d.ts +38 -0
- package/lib/index/index.js +1 -1
- package/lib/index/index.mjs +38 -33
- package/lib/index/style.css +25 -1
- package/lib/index.d.ts +3 -1
- package/package.json +12 -20
- package/lib/AnimatePresence-26Wy0TGN.js +0 -9
- package/lib/AnimatePresence-nl0c23TZ.mjs +0 -136
- package/lib/_plugin-vue_export-helper-BHFhmbuH.js +0 -1
- package/lib/_plugin-vue_export-helper-CHgC5LLL.mjs +0 -9
- package/lib/index-B8Ap0044.js +0 -1
- package/lib/index-Bbr5fWvI.mjs +0 -5158
- package/lib/index-CWxEZ_zc.mjs +0 -74
- package/lib/index-Q0Ej8RIj.js +0 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as Le, computed as n, ref as d, watch as Se, nextTick as W, onMounted as Te, onBeforeUnmount as Ae, createElementBlock as M, openBlock as c, normalizeClass as O, createElementVNode as R, createBlock as $, createCommentVNode as z, normalizeStyle as H, createVNode as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { defineComponent as Le, computed as n, ref as d, watch as Se, nextTick as W, onMounted as Te, onBeforeUnmount as Ae, createElementBlock as M, openBlock as c, normalizeClass as O, createElementVNode as R, createBlock as $, createCommentVNode as z, normalizeStyle as H, createVNode as V, unref as p, withKeys as Ce, Teleport as Oe, withCtx as b, withModifiers as Re, renderSlot as B, createTextVNode as J, toDisplayString as Q, Fragment as $e, renderList as ze } from "vue";
|
|
2
|
+
import He from "../GInput/index.mjs";
|
|
3
|
+
import Ne from "../GTag/index.mjs";
|
|
4
|
+
import { ElTree as Ke, ElMessage as X } from "element-plus";
|
|
5
|
+
import { AnimatePresence as Y, motion as ee } from "motion-v";
|
|
6
|
+
import { _ as je } from "../GBubble-C3cM9Put.mjs";
|
|
7
|
+
const Ge = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "g-input-tree-tag__tags"
|
|
9
|
-
},
|
|
10
|
+
}, Ue = /* @__PURE__ */ Le({
|
|
10
11
|
__name: "index",
|
|
11
12
|
props: {
|
|
12
13
|
modelValue: { default: () => [] },
|
|
@@ -23,8 +24,8 @@ const Ue = {
|
|
|
23
24
|
disabled: { type: Boolean, default: !1 },
|
|
24
25
|
clearable: { type: Boolean, default: !0 },
|
|
25
26
|
closable: { type: Boolean, default: !0 },
|
|
26
|
-
tagType: { default: "
|
|
27
|
-
|
|
27
|
+
tagType: { default: "primary" },
|
|
28
|
+
tagVariant: { default: "filled" },
|
|
28
29
|
clearInputAfterSelect: { type: Boolean, default: !0 },
|
|
29
30
|
enterToAdd: { type: Boolean, default: !0 },
|
|
30
31
|
valueFormat: { default: "value" },
|
|
@@ -39,7 +40,7 @@ const Ue = {
|
|
|
39
40
|
label: l.props.label || "label",
|
|
40
41
|
children: l.props.children || "children",
|
|
41
42
|
disabled: l.props.disabled
|
|
42
|
-
})), oe = n(() => l.props.value || l.nodeKey || "id"), ne = n(() => l.props.label || "label"), re = n(() => l.props.children || "children"), S = n(() => l.props.isLeaf),
|
|
43
|
+
})), oe = n(() => l.props.value || l.nodeKey || "id"), ne = n(() => l.props.label || "label"), re = n(() => l.props.children || "children"), S = n(() => l.props.isLeaf), ie = n(() => l.echoProps?.value || "value"), se = n(() => l.echoProps?.label || "label"), h = (e) => e ? e[oe.value] : void 0, f = (e) => e ? e[ne.value] : "", K = (e) => e ? e[re.value] : void 0, ue = (e) => e?.[ie.value] ?? e?.value, de = (e) => e?.[se.value] ?? e?.label, v = (e) => {
|
|
43
44
|
if (!e) return !1;
|
|
44
45
|
if (typeof l.selectable == "function") return l.selectable(e);
|
|
45
46
|
if (S.value && e[S.value] !== void 0) return !!e[S.value];
|
|
@@ -54,20 +55,20 @@ const Ue = {
|
|
|
54
55
|
});
|
|
55
56
|
};
|
|
56
57
|
return t(l.data || []), e;
|
|
57
|
-
}),
|
|
58
|
+
}), i = n(() => (l.modelValue || []).map((t) => {
|
|
58
59
|
const a = l.valueFormat === "object" ? ue(t) : t, o = T.value.get(a), u = l.valueFormat === "object" ? de(t) : void 0;
|
|
59
60
|
return {
|
|
60
61
|
value: a,
|
|
61
62
|
label: o ? f(o) : u ?? String(a ?? ""),
|
|
62
63
|
raw: o ?? (l.valueFormat === "object" ? t : void 0)
|
|
63
64
|
};
|
|
64
|
-
})), x = (e) =>
|
|
65
|
+
})), x = (e) => i.value.some((t) => t.value === e), E = d(""), s = d(!1), j = d(null), G = d(null), U = d(null), m = d(null), ce = (e) => {
|
|
65
66
|
if (!e) {
|
|
66
67
|
m.value = null;
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
69
70
|
m.value = e.$el ?? (e instanceof HTMLElement ? e : null);
|
|
70
|
-
},
|
|
71
|
+
}, q = d({}), y = d("bottom"), pe = n(() => ({
|
|
71
72
|
opacity: 0,
|
|
72
73
|
scale: 0.95,
|
|
73
74
|
y: y.value === "bottom" ? -8 : 8
|
|
@@ -76,20 +77,20 @@ const Ue = {
|
|
|
76
77
|
scale: 0.95,
|
|
77
78
|
y: y.value === "bottom" ? -8 : 8
|
|
78
79
|
})), me = { duration: 0.2, ease: "easeOut" }, ge = n(() => ({
|
|
79
|
-
...
|
|
80
|
+
...q.value,
|
|
80
81
|
transformOrigin: y.value === "bottom" ? "top center" : "bottom center"
|
|
81
|
-
})), be = { opacity: 0, scale: 0.8 }, he = { opacity: 1, scale: 1 }, ye = { opacity: 0, scale: 0.8 }, we = { duration: 0.2, ease: "easeOut" },
|
|
82
|
+
})), be = { opacity: 0, scale: 0.8 }, he = { opacity: 1, scale: 1 }, ye = { opacity: 0, scale: 0.8 }, we = { duration: 0.2, ease: "easeOut" }, ke = n(
|
|
82
83
|
() => typeof l.width == "number" ? `${l.width}px` : l.width
|
|
83
84
|
), A = () => {
|
|
84
|
-
l.disabled || (
|
|
85
|
-
},
|
|
86
|
-
if (!
|
|
87
|
-
const e =
|
|
85
|
+
l.disabled || (s.value = !0);
|
|
86
|
+
}, F = () => {
|
|
87
|
+
if (!s.value) return;
|
|
88
|
+
const e = U.value, t = m.value;
|
|
88
89
|
if (!e || !t) return;
|
|
89
|
-
const a = e.getBoundingClientRect(), o = t.offsetHeight || l.popperMaxHeight, I = window.innerHeight - a.bottom - l.popperOffset, Me = a.top - l.popperOffset,
|
|
90
|
-
y.value =
|
|
91
|
-
const Be =
|
|
92
|
-
|
|
90
|
+
const a = e.getBoundingClientRect(), o = t.offsetHeight || l.popperMaxHeight, I = window.innerHeight - a.bottom - l.popperOffset, Me = a.top - l.popperOffset, D = I >= o || I >= Me ? "bottom" : "top";
|
|
91
|
+
y.value = D;
|
|
92
|
+
const Be = D === "bottom" ? a.bottom + l.popperOffset : a.top - o - l.popperOffset;
|
|
93
|
+
q.value = {
|
|
93
94
|
position: "fixed",
|
|
94
95
|
top: `${Be}px`,
|
|
95
96
|
left: `${a.left}px`,
|
|
@@ -99,42 +100,42 @@ const Ue = {
|
|
|
99
100
|
};
|
|
100
101
|
let g = null;
|
|
101
102
|
const w = () => {
|
|
102
|
-
|
|
103
|
-
g = null,
|
|
103
|
+
s.value && (g && cancelAnimationFrame(g), g = requestAnimationFrame(() => {
|
|
104
|
+
g = null, F();
|
|
104
105
|
}));
|
|
105
106
|
};
|
|
106
|
-
let
|
|
107
|
-
const
|
|
108
|
-
typeof ResizeObserver > "u" || !m.value || (
|
|
109
|
-
},
|
|
110
|
-
|
|
107
|
+
let k = null;
|
|
108
|
+
const Ve = () => {
|
|
109
|
+
typeof ResizeObserver > "u" || !m.value || (k?.disconnect(), k = new ResizeObserver(() => w()), k.observe(m.value));
|
|
110
|
+
}, P = () => {
|
|
111
|
+
k?.disconnect(), k = null;
|
|
111
112
|
};
|
|
112
|
-
Se(
|
|
113
|
+
Se(s, async (e) => {
|
|
113
114
|
if (!e) {
|
|
114
|
-
|
|
115
|
+
P();
|
|
115
116
|
return;
|
|
116
117
|
}
|
|
117
|
-
await W(),
|
|
118
|
+
await W(), F(), requestAnimationFrame(F), Ve();
|
|
118
119
|
});
|
|
119
|
-
const
|
|
120
|
-
if (!
|
|
120
|
+
const Z = (e) => {
|
|
121
|
+
if (!s.value) return;
|
|
121
122
|
const t = e.target;
|
|
122
|
-
|
|
123
|
+
G.value?.contains(t) || m.value?.contains(t) || (s.value = !1);
|
|
123
124
|
};
|
|
124
125
|
Te(() => {
|
|
125
|
-
document.addEventListener("mousedown",
|
|
126
|
+
document.addEventListener("mousedown", Z, !0), window.addEventListener("scroll", w, !0), window.addEventListener("resize", w);
|
|
126
127
|
}), Ae(() => {
|
|
127
|
-
document.removeEventListener("mousedown",
|
|
128
|
+
document.removeEventListener("mousedown", Z, !0), window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", w), g && cancelAnimationFrame(g), P();
|
|
128
129
|
});
|
|
129
130
|
const xe = (e) => {
|
|
130
|
-
|
|
131
|
-
},
|
|
131
|
+
s.value = !0, j.value?.filter(e), W(F);
|
|
132
|
+
}, Ee = (e, t) => e ? typeof l.filterMethod == "function" ? l.filterMethod(e, t) : String(f(t) ?? "").toLowerCase().includes(String(e).toLowerCase()) : !0, Fe = (e, t) => {
|
|
132
133
|
if (r("node-click", e), !v(e)) {
|
|
133
134
|
t && (t.expanded = !t.expanded);
|
|
134
135
|
return;
|
|
135
136
|
}
|
|
136
|
-
C(e),
|
|
137
|
-
},
|
|
137
|
+
C(e), s.value = !1;
|
|
138
|
+
}, _e = (e) => l.valueFormat === "object" ? { value: e.value, label: e.label, raw: e.raw } : e.value, C = (e) => {
|
|
138
139
|
const t = h(e);
|
|
139
140
|
if (t == null || t === "") return;
|
|
140
141
|
if (x(t)) {
|
|
@@ -142,11 +143,11 @@ const Ue = {
|
|
|
142
143
|
r("duplicate", u), l.duplicateMessage && X.warning(l.duplicateMessage);
|
|
143
144
|
return;
|
|
144
145
|
}
|
|
145
|
-
const a = { value: t, label: f(e), raw: e }, o = [...l.modelValue || [],
|
|
146
|
-
r("update:modelValue", o), r("add", a), r("change", o, [...
|
|
146
|
+
const a = { value: t, label: f(e), raw: e }, o = [...l.modelValue || [], _e(a)];
|
|
147
|
+
r("update:modelValue", o), r("add", a), r("change", o, [...i.value, a]), l.clearInputAfterSelect && (E.value = "");
|
|
147
148
|
}, Ie = () => {
|
|
148
149
|
if (!l.enterToAdd) return;
|
|
149
|
-
const e = (
|
|
150
|
+
const e = (E.value || "").trim();
|
|
150
151
|
if (!e) return;
|
|
151
152
|
let t = null;
|
|
152
153
|
for (const a of T.value.values())
|
|
@@ -159,18 +160,18 @@ const Ue = {
|
|
|
159
160
|
return;
|
|
160
161
|
}
|
|
161
162
|
C(t);
|
|
162
|
-
},
|
|
163
|
-
if (e < 0 || e >=
|
|
164
|
-
const t =
|
|
163
|
+
}, _ = (e) => {
|
|
164
|
+
if (e < 0 || e >= i.value.length) return;
|
|
165
|
+
const t = i.value[e], a = [...l.modelValue || []];
|
|
165
166
|
a.splice(e, 1), r("update:modelValue", a), t && r("remove", t, e);
|
|
166
|
-
const o =
|
|
167
|
+
const o = i.value.filter((u, I) => I !== e);
|
|
167
168
|
r("change", a, o);
|
|
168
169
|
};
|
|
169
170
|
return te({
|
|
170
171
|
/** 主动打开下拉面板 */
|
|
171
172
|
open: A,
|
|
172
173
|
/** 主动关闭下拉面板 */
|
|
173
|
-
close: () =>
|
|
174
|
+
close: () => s.value = !1,
|
|
174
175
|
/** 清空已选 */
|
|
175
176
|
clear: () => {
|
|
176
177
|
r("update:modelValue", []), r("change", [], []);
|
|
@@ -182,35 +183,36 @@ const Ue = {
|
|
|
182
183
|
},
|
|
183
184
|
/** 根据索引移除,触发与关闭 tag 一致的事件 */
|
|
184
185
|
removeByIndex: (e) => {
|
|
185
|
-
|
|
186
|
+
_(e);
|
|
186
187
|
},
|
|
187
188
|
/** 根据 value 移除,触发与关闭 tag 一致的事件 */
|
|
188
189
|
removeByValue: (e) => {
|
|
189
|
-
const t =
|
|
190
|
-
t > -1 &&
|
|
190
|
+
const t = i.value.findIndex((a) => a.value === e);
|
|
191
|
+
t > -1 && _(t);
|
|
191
192
|
},
|
|
192
193
|
/** 获取当前归一化后的已选项 */
|
|
193
|
-
getSelectedItems: () =>
|
|
194
|
+
getSelectedItems: () => i.value
|
|
194
195
|
}), (e, t) => (c(), M("div", {
|
|
195
196
|
class: O(["g-input-tree-tag", { "is-disabled": e.disabled }])
|
|
196
197
|
}, [
|
|
197
198
|
R("div", {
|
|
198
199
|
class: "g-input-tree-tag__wrap",
|
|
199
200
|
ref_key: "wrapRef",
|
|
200
|
-
ref:
|
|
201
|
+
ref: G
|
|
201
202
|
}, [
|
|
202
203
|
R("div", {
|
|
203
204
|
class: "g-input-tree-tag__input-box",
|
|
204
205
|
ref_key: "inputBoxRef",
|
|
205
|
-
ref:
|
|
206
|
-
style: H({ width:
|
|
206
|
+
ref: U,
|
|
207
|
+
style: H({ width: ke.value })
|
|
207
208
|
}, [
|
|
208
|
-
|
|
209
|
-
modelValue:
|
|
210
|
-
"onUpdate:modelValue": t[0] || (t[0] = (a) =>
|
|
209
|
+
V(p(He), {
|
|
210
|
+
modelValue: E.value,
|
|
211
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => E.value = a),
|
|
211
212
|
placeholder: e.placeholder,
|
|
212
213
|
clearable: e.clearable,
|
|
213
214
|
disabled: e.disabled,
|
|
215
|
+
block: "",
|
|
214
216
|
class: "g-input-tree-tag__input",
|
|
215
217
|
onFocus: A,
|
|
216
218
|
onClick: A,
|
|
@@ -219,9 +221,9 @@ const Ue = {
|
|
|
219
221
|
}, null, 8, ["modelValue", "placeholder", "clearable", "disabled"])
|
|
220
222
|
], 4),
|
|
221
223
|
(c(), $(Oe, { to: "body" }, [
|
|
222
|
-
|
|
224
|
+
V(p(Y), null, {
|
|
223
225
|
default: b(() => [
|
|
224
|
-
|
|
226
|
+
s.value ? (c(), $(p(ee).div, {
|
|
225
227
|
key: 0,
|
|
226
228
|
ref: ce,
|
|
227
229
|
class: O(["g-input-tree-tag__popover", `is-${y.value}`]),
|
|
@@ -238,16 +240,16 @@ const Ue = {
|
|
|
238
240
|
class: "g-input-tree-tag__tree-wrap",
|
|
239
241
|
style: H({ maxHeight: e.popperMaxHeight + "px" })
|
|
240
242
|
}, [
|
|
241
|
-
|
|
243
|
+
V(p(Ke), {
|
|
242
244
|
ref_key: "treeRef",
|
|
243
245
|
ref: j,
|
|
244
246
|
data: e.data,
|
|
245
247
|
props: le.value,
|
|
246
248
|
"node-key": e.nodeKey,
|
|
247
|
-
"filter-node-method":
|
|
249
|
+
"filter-node-method": Ee,
|
|
248
250
|
"expand-on-click-node": !1,
|
|
249
251
|
"default-expand-all": e.defaultExpandAll,
|
|
250
|
-
onNodeClick:
|
|
252
|
+
onNodeClick: Fe
|
|
251
253
|
}, {
|
|
252
254
|
default: b((a) => [
|
|
253
255
|
B(e.$slots, "tree-node", {
|
|
@@ -285,14 +287,14 @@ const Ue = {
|
|
|
285
287
|
_: 3
|
|
286
288
|
})
|
|
287
289
|
])),
|
|
288
|
-
|
|
290
|
+
i.value.length ? (c(), M("div", Ge, [
|
|
289
291
|
B(e.$slots, "tags", {
|
|
290
|
-
items:
|
|
291
|
-
remove:
|
|
292
|
+
items: i.value,
|
|
293
|
+
remove: _
|
|
292
294
|
}, () => [
|
|
293
|
-
|
|
295
|
+
V(p(Y), { mode: "popLayout" }, {
|
|
294
296
|
default: b(() => [
|
|
295
|
-
(c(!0), M($e, null, ze(
|
|
297
|
+
(c(!0), M($e, null, ze(i.value, (a, o) => (c(), $(p(ee).div, {
|
|
296
298
|
key: a.value,
|
|
297
299
|
layout: !0,
|
|
298
300
|
class: "g-input-tree-tag__tag-motion",
|
|
@@ -302,12 +304,12 @@ const Ue = {
|
|
|
302
304
|
transition: we
|
|
303
305
|
}, {
|
|
304
306
|
default: b(() => [
|
|
305
|
-
|
|
307
|
+
V(p(Ne), {
|
|
306
308
|
class: "g-input-tree-tag__tag",
|
|
307
309
|
type: e.tagType,
|
|
308
|
-
|
|
310
|
+
variant: e.tagVariant,
|
|
309
311
|
closable: e.closable && !e.disabled,
|
|
310
|
-
onClose: (u) =>
|
|
312
|
+
onClose: (u) => _(o)
|
|
311
313
|
}, {
|
|
312
314
|
default: b(() => [
|
|
313
315
|
B(e.$slots, "tag", {
|
|
@@ -318,7 +320,7 @@ const Ue = {
|
|
|
318
320
|
], !0)
|
|
319
321
|
]),
|
|
320
322
|
_: 2
|
|
321
|
-
}, 1032, ["type", "
|
|
323
|
+
}, 1032, ["type", "variant", "closable", "onClose"])
|
|
322
324
|
]),
|
|
323
325
|
_: 2
|
|
324
326
|
}, 1024))), 128))
|
|
@@ -330,7 +332,7 @@ const Ue = {
|
|
|
330
332
|
], 512)
|
|
331
333
|
], 2));
|
|
332
334
|
}
|
|
333
|
-
}), N = /* @__PURE__ */ je(
|
|
335
|
+
}), N = /* @__PURE__ */ je(Ue, [["__scopeId", "data-v-e10d8b6e"]]);
|
|
334
336
|
N.install = (L) => {
|
|
335
337
|
L.component(N.name, N);
|
|
336
338
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.g-input-tree-tag[data-v-
|
|
1
|
+
@charset "UTF-8";.g-input-tree-tag[data-v-e10d8b6e]{width:100%}.g-input-tree-tag__wrap[data-v-e10d8b6e]{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.g-input-tree-tag__tags[data-v-e10d8b6e]{display:flex;flex-wrap:wrap;gap:8px;width:100%}.g-input-tree-tag__tag-motion[data-v-e10d8b6e]{display:inline-flex}.g-input-tree-tag__tag[data-v-e10d8b6e]{margin:0}.g-input-tree-tag.is-disabled[data-v-e10d8b6e]{cursor:not-allowed}.g-input-tree-tag__popover{box-sizing:border-box;background:var(--el-bg-color-overlay, #fff);border:1px solid var(--el-border-color-light);border-radius:4px;box-shadow:var(--el-box-shadow-light);padding:8px 0}.g-input-tree-tag__popover .g-input-tree-tag__tree-wrap{overflow:auto}.g-input-tree-tag__popover .g-input-tree-tag__node{display:inline-flex;align-items:center;gap:4px;font-size:13px}.g-input-tree-tag__popover .g-input-tree-tag__node.is-selectable{cursor:pointer;color:var(--el-text-color-primary)}.g-input-tree-tag__popover .g-input-tree-tag__node.is-selected{color:var(--el-color-primary)}
|
package/lib/GPie3D/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("vue"),pt=require("../
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("vue"),pt=require("../GBubble-Dph0YDkU.js"),vt={class:"g-pie3d-tooltip__default"},gt={class:"g-pie3d-tooltip__name"},yt={class:"g-pie3d-tooltip__value"},mt=260,xt=h.defineComponent({__name:"index",props:{data:{default:()=>[]},config:{default:()=>({})},animation:{type:Boolean,default:!0}},emits:["slice-click"],setup(N,{emit:at}){const S=N,lt=at,V={alpha:55,depth:26,startAngle:0,colors:["#22d3ee","#3b82f6","#8b5cf6","#06b6d4","#0ea5e9","#a855f7","#14b8a6"],textColor:"#cbd5e1",radiusRatio:.55,hoverDistance:14,showLabel:!0,showPercent:!0,labelFontSize:12,opacity:.7,showAura:!0,glowColor:"",labelLineColor:"auto",labelLineWidth:1},a={...V,...S.config},E=h.ref(null),C=h.ref(null);let L=null,k=0,_=0,Y=1,p=0,u=0,g=0,M=0,b=[],$=S.animation?0:1,F=null,q=S.animation,I=null,X=0;const D=h.ref(-1),z=h.ref(!1),J=h.ref(0),K=h.ref(0),R=h.ref(null),O=h.ref(0),Q=t=>t*Math.PI/180,G=(t,l=0,n=0)=>({x:p+l+g*Math.cos(t),y:u+n+M*Math.sin(t)}),j=(t,l=0,n=0)=>({x:p+l+g*Math.cos(t),y:u+n+M*Math.sin(t)+a.depth}),W=()=>{if(!C.value||!E.value)return;const t=E.value,l=C.value;Y=window.devicePixelRatio||1,k=t.clientWidth,_=t.clientHeight,l.width=k*Y,l.height=_*Y,l.style.width=k+"px",l.style.height=_+"px",L=l.getContext("2d"),L&&L.setTransform(Y,0,0,Y,0,0),p=k/2,u=_/2-a.depth/2;const n=a.showLabel?60:10,s=Math.min(k,_-a.depth-n)/2*a.radiusRatio*1.6;g=Math.max(20,s),M=g*Math.cos(Q(a.alpha)),it(),q?st():U()},it=()=>{b=[];const t=S.data.reduce((n,s)=>n+(s.value||0),0);if(t<=0)return;let l=-Math.PI/2+Q(a.startAngle);S.data.forEach((n,s)=>{const i=n.value/t,d=i*Math.PI*2;b.push({data:n,index:s,color:n.color||a.colors[s%a.colors.length],startA:l,endA:l+d,midA:l+d/2,percent:i,hover:!1,hoverProgress:0}),l+=d})},st=()=>{$=0;const t=800,l=performance.now(),n=s=>{const i=Math.min(1,(s-l)/t);$=1-Math.pow(1-i,3),U(),i<1?F=requestAnimationFrame(n):(q=!1,F=null)};F=requestAnimationFrame(n)},rt=t=>1-Math.pow(1-t,3),Z=t=>{const l=X===0?16:t-X;X=t;const n=l/mt;let s=!1;for(const i of b){const d=i.hover?1:0;if(i.hoverProgress===d)continue;const v=d>i.hoverProgress?1:-1;i.hoverProgress+=v*n,(v>0&&i.hoverProgress>=d||v<0&&i.hoverProgress<=d)&&(i.hoverProgress=d),i.hoverProgress!==d&&(s=!0)}U(),s?I=requestAnimationFrame(Z):(I=null,X=0)},tt=()=>{I==null&&(X=0,I=requestAnimationFrame(Z))},T=(t,l)=>{let n=t.replace("#","");n.length===3&&(n=n.split("").map(v=>v+v).join(""));const s=parseInt(n.slice(0,2),16),i=parseInt(n.slice(2,4),16),d=parseInt(n.slice(4,6),16);return`rgba(${s},${i},${d},${l})`},U=()=>{if(!L)return;const t=L;if(t.clearRect(0,0,k,_),!b.length)return;const l=b[0]?.startA??0,n=Math.PI*2*$,s=l+n,i=b.map(e=>{const c=e.startA,f=Math.min(e.endA,s),y=f>c,x=rt(Math.max(0,Math.min(1,e.hoverProgress))),A=Math.cos(e.midA)*a.hoverDistance*x,P=Math.sin(e.midA)*a.hoverDistance*x;return{...e,startA:c,endA:f,valid:y,ox:A,oy:P,hp:x}});if(a.showAura){const e=t.createRadialGradient(p,u+a.depth,g*.1,p,u+a.depth,g*1.5);e.addColorStop(0,"rgba(6,182,212,0.15)"),e.addColorStop(.4,"rgba(59,130,246,0.08)"),e.addColorStop(.8,"rgba(139,92,246,0.03)"),e.addColorStop(1,"rgba(0,0,0,0)"),t.beginPath(),t.ellipse(p,u+a.depth,g*1.5,M*.9,0,0,Math.PI*2),t.fillStyle=e,t.fill(),t.strokeStyle="rgba(56,189,248,0.08)",t.lineWidth=1;for(let c=3;c>=1;c--){const f=g*(.3+c*.25);t.beginPath(),t.ellipse(p,u+a.depth,f,f*(M/g),0,0,Math.PI*2),t.stroke()}}const d=(e,c)=>{const f=a.glowColor||e.color,y={x:p+e.ox,y:u+e.oy},x={x:y.x,y:y.y+a.depth},A=G(c,e.ox,e.oy),P=j(c,e.ox,e.oy);t.fillStyle=T(f,a.opacity*.5),t.beginPath(),t.moveTo(y.x,y.y),t.lineTo(A.x,A.y),t.lineTo(P.x,P.y),t.lineTo(x.x,x.y),t.closePath(),t.fill(),t.strokeStyle=T(f,.8),t.lineWidth=.8,t.beginPath(),t.moveTo(A.x,A.y),t.lineTo(P.x,P.y),t.stroke()};for(const e of i)e.valid&&(Math.sin(e.startA)<=.001&&d(e,e.startA),Math.sin(e.endA)<=.001&&d(e,e.endA));const v=Math.PI/120;for(const e of i){if(!e.valid)continue;let c=e.startA;const f=a.glowColor||e.color;for(;c<e.endA;){const y=Math.min(c+v,e.endA),x=(c+y)/2;if(Math.sin(x)>0){const A=G(c,e.ox,e.oy),P=G(y,e.ox,e.oy),o=j(y,e.ox,e.oy),m=j(c,e.ox,e.oy);t.fillStyle=T(f,a.opacity*.4),t.beginPath(),t.moveTo(A.x,A.y),t.lineTo(P.x,P.y),t.lineTo(o.x,o.y),t.lineTo(m.x,m.y),t.closePath(),t.fill(),t.strokeStyle=T(f,.7),t.lineWidth=.8,t.beginPath(),t.moveTo(m.x,m.y),t.lineTo(o.x,o.y),t.stroke()}c=y}}for(const e of i)e.valid&&(Math.sin(e.startA)>.001&&d(e,e.startA),Math.sin(e.endA)>.001&&d(e,e.endA));for(const e of i){if(!e.valid)continue;const c=a.glowColor||e.color;e.hp>.01&&(t.save(),t.shadowColor=c,t.shadowBlur=12*e.hp,t.beginPath(),t.moveTo(p+e.ox,u+e.oy),t.ellipse(p+e.ox,u+e.oy,g,M,0,e.startA,e.endA),t.closePath(),t.fillStyle=T(c,.08*e.hp),t.fill(),t.restore()),t.beginPath(),t.moveTo(p+e.ox,u+e.oy),t.ellipse(p+e.ox,u+e.oy,g,M,0,e.startA,e.endA),t.closePath();const f=t.createRadialGradient(p+e.ox-g*.2,u+e.oy-M*.2,0,p+e.ox,u+e.oy,g*1.05);f.addColorStop(0,T(c,a.opacity*.95)),f.addColorStop(.6,T(c,a.opacity*.8)),f.addColorStop(1,T(c,a.opacity*.6)),t.fillStyle=f,t.fill(),t.strokeStyle=T(c,.95),t.lineWidth=.8+.6*e.hp,t.stroke()}if(a.showLabel&&$>=.999){t.font=`${a.labelFontSize}px Arial, sans-serif`,t.textBaseline="middle";const e=[],c=[],f=a.labelFontSize+6,y=14,x=4;for(const o of i){if(!o.valid)continue;const m=Math.cos(o.midA)>=0,w=p+o.ox+g*1.02*Math.cos(o.midA),r=u+o.oy+M*1.02*Math.sin(o.midA),H=u+o.oy+M*1.18*Math.sin(o.midA),dt=a.showPercent?`${o.data.name} ${(o.percent*100).toFixed(1)}%`:`${o.data.name}`,ft=!a.labelLineColor||a.labelLineColor==="auto"?a.glowColor||o.color:a.labelLineColor,ut={slice:o,text:dt,isRight:m,anchorX:w,anchorY:r,targetY:H,y:H,color:ft};(m?c:e).push(ut)}const A=o=>{if(!o.length)return;o.sort((r,H)=>r.targetY-H.targetY);const m=x+a.labelFontSize/2,w=_-x-a.labelFontSize/2;for(let r=0;r<o.length;r++)r===0?o[r].y=Math.max(m,o[r].targetY):o[r].y=Math.max(o[r].targetY,o[r-1].y+f);if(o[o.length-1].y>w){o[o.length-1].y=w;for(let r=o.length-2;r>=0;r--)o[r].y>o[r+1].y-f&&(o[r].y=o[r+1].y-f)}for(let r=0;r<o.length;r++)o[r].y<m&&(o[r].y=m)};A(e),A(c),t.lineWidth=a.labelLineWidth;const P=[...e,...c];for(const o of P){const m=t.measureText(o.text).width;let w;if(o.isRight){const r=Math.min(Math.max(o.anchorX+6,o.anchorX+Math.abs(o.targetY-o.y)*.2+6),k-x-m-y);w=r+y,t.strokeStyle=o.color,t.beginPath(),t.moveTo(o.anchorX,o.anchorY),t.lineTo(r,o.y),t.lineTo(w,o.y),t.stroke(),t.fillStyle=a.textColor,t.textAlign="left",t.fillText(o.text,w+2,o.y)}else{const r=Math.max(Math.min(o.anchorX-6,o.anchorX-Math.abs(o.targetY-o.y)*.2-6),x+m+y);w=r-y,t.strokeStyle=o.color,t.beginPath(),t.moveTo(o.anchorX,o.anchorY),t.lineTo(r,o.y),t.lineTo(w,o.y),t.stroke(),t.fillStyle=a.textColor,t.textAlign="right",t.fillText(o.text,w-2,o.y)}}}},et=(t,l)=>{for(let n=0;n<b.length;n++){const s=b[n],i=(t-p)/g,d=(l-u)/M;if(i*i+d*d>1)continue;let v=Math.atan2((l-u)/M,(t-p)/g);for(;v<s.startA;)v+=Math.PI*2;for(;v>s.startA+Math.PI*2;)v-=Math.PI*2;if(v>=s.startA&&v<=s.endA)return n}return-1},ot=t=>{const l=C.value,n=l.getBoundingClientRect(),s=n.width/(l.clientWidth||n.width)||1,i=n.height/(l.clientHeight||n.height)||1;return{mx:(t.clientX-n.left)/s,my:(t.clientY-n.top)/i}},ct=t=>{if(!C.value)return;const{mx:l,my:n}=ot(t),s=et(l,n);if(s!==D.value&&(D.value=s,b.forEach((i,d)=>i.hover=d===s),tt()),s>=0){const i=b[s];z.value=!0,R.value=i.data,O.value=i.percent;const d=E.value?.clientWidth||0,v=E.value?.clientHeight||0,e=Math.min(l+12,d-140),c=Math.min(n+12,v-60);J.value=Math.max(0,e),K.value=Math.max(0,c)}else z.value=!1,R.value=null},ht=()=>{D.value!==-1&&(D.value=-1,b.forEach(t=>t.hover=!1),tt()),z.value=!1,R.value=null},nt=t=>{if(!C.value)return;const{mx:l,my:n}=ot(t),s=et(l,n);s>=0&<("slice-click",b[s].data,s)};return h.watch(()=>S.data,()=>{Object.assign(a,V,S.config),q=S.animation,W()},{deep:!0}),h.watch(()=>S.config,()=>{Object.assign(a,V,S.config),W()},{deep:!0}),h.onMounted(()=>{W(),window.addEventListener("resize",W),C.value?.addEventListener("click",nt)}),h.onUnmounted(()=>{window.removeEventListener("resize",W),C.value?.removeEventListener("click",nt),F&&cancelAnimationFrame(F),I&&cancelAnimationFrame(I)}),(t,l)=>(h.openBlock(),h.createElementBlock("div",{class:"g-pie3d-container",ref_key:"containerRef",ref:E},[h.createElementVNode("canvas",{ref_key:"canvasRef",ref:C,onMousemove:ct,onMouseleave:ht},null,544),z.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"g-pie3d-tooltip",style:h.normalizeStyle({left:`${J.value}px`,top:`${K.value}px`})},[h.renderSlot(t.$slots,"tooltip",{data:R.value,percent:O.value},()=>[h.createElementVNode("div",vt,[h.createElementVNode("p",gt,h.toDisplayString(R.value?.name),1),h.createElementVNode("p",yt,h.toDisplayString(R.value?.value)+" ("+h.toDisplayString((O.value*100).toFixed(1))+"%) ",1)])],!0)],4)):h.createCommentVNode("",!0)],512))}}),B=pt._export_sfc(xt,[["__scopeId","data-v-d37c2ffe"]]);B.install=N=>{N.component(B.name,B)};exports.GPie3D=B;exports.default=B;
|
package/lib/GPie3D/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as xt, ref as C, watch as it, onMounted as Mt, onUnmounted as At, createElementBlock as st, openBlock as rt, createElementVNode as D, createCommentVNode as bt, normalizeStyle as Pt, renderSlot as wt, toDisplayString as J } from "vue";
|
|
2
|
-
import { _ as St } from "../
|
|
2
|
+
import { _ as St } from "../GBubble-C3cM9Put.mjs";
|
|
3
3
|
const Tt = { class: "g-pie3d-tooltip__default" }, Ct = { class: "g-pie3d-tooltip__name" }, _t = { class: "g-pie3d-tooltip__value" }, kt = 260, It = /* @__PURE__ */ xt({
|
|
4
4
|
__name: "index",
|
|
5
5
|
props: {
|
package/lib/GProgress/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../GBubble-Dph0YDkU.js"),c={class:"g-progress-bar-container"},m={class:"g-progress-info"},p=["aria-valuenow"],g={class:"g-progress-splash","aria-hidden":"true"},v=e.defineComponent({name:"GProgress",inheritAttrs:!1,__name:"index",props:{count:{default:0},height:{default:10},gradient:{default:()=>["#3b82f6","#f97316"]},textColor:{default:"#fff"},wave:{type:Boolean,default:!1},waveSpeed:{default:3},forceAnimation:{type:Boolean,default:!1}},setup(s){const r=s,l=e.computed(()=>{const t=Number(r.count);return Number.isFinite(t)?Math.min(100,Math.max(0,t)):0}),i=e.computed(()=>typeof r.height=="number"?`${r.height}px`:r.height),n=e.computed(()=>{const[t="#3b82f6",o="#f97316"]=r.gradient??[];return`linear-gradient(90deg, ${t} 0%, ${o} 100%)`});return(t,o)=>(e.openBlock(),e.createElementBlock("div",c,[e.createElementVNode("div",m,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),e.createElementVNode("div",{class:"g-progress-wrapper",style:e.normalizeStyle({height:i.value}),role:"progressbar","aria-valuenow":l.value,"aria-valuemin":"0","aria-valuemax":"100"},[e.createElementVNode("div",{class:"g-progress-bg",style:e.normalizeStyle({background:n.value})},null,4),e.createElementVNode("div",{class:e.normalizeClass(["g-progress-fill",{"is-wave":t.wave,"is-force-animation":t.forceAnimation}]),style:e.normalizeStyle({width:`${l.value}%`,background:n.value})},[t.wave?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",{class:"g-progress-sweep g-progress-sweep--front",style:e.normalizeStyle({animationDuration:`${t.waveSpeed}s`}),"aria-hidden":"true"},null,4),e.createElementVNode("div",{class:"g-progress-sweep g-progress-sweep--back",style:e.normalizeStyle({animationDuration:`${t.waveSpeed*1.6}s`}),"aria-hidden":"true"},null,4),o[0]||(o[0]=e.createElementVNode("div",{class:"g-progress-grid","aria-hidden":"true"},null,-1)),e.createElementVNode("div",{class:"g-progress-impact",style:e.normalizeStyle({animationDuration:`${t.waveSpeed}s`}),"aria-hidden":"true"},null,4),e.createElementVNode("div",g,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,d=>e.createElementVNode("span",{key:d,class:"g-progress-splash__particle",style:e.normalizeStyle({animationDuration:`${t.waveSpeed}s`})},null,4)),64))])],64)):e.createCommentVNode("",!0)],6)],12,p),e.createElementVNode("div",{class:"g-progress-count",style:e.normalizeStyle({color:t.textColor})},[e.renderSlot(t.$slots,"count",{},()=>[e.createTextVNode(e.toDisplayString(l.value)+"%",1)],!0)],4)]))}}),a=u._export_sfc(v,[["__scopeId","data-v-324fae85"]]);a.install=s=>{s.component(a.name,a)};exports.GProgress=a;exports.default=a;
|
package/lib/GProgress/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as v, computed as i, createElementBlock as l, openBlock as d, createElementVNode as s, renderSlot as g, normalizeStyle as a, normalizeClass as h, createCommentVNode as w, Fragment as c, renderList as y, createTextVNode as b, toDisplayString as $ } from "vue";
|
|
2
|
-
import { _ as S } from "../
|
|
2
|
+
import { _ as S } from "../GBubble-C3cM9Put.mjs";
|
|
3
3
|
const _ = { class: "g-progress-bar-container" }, k = { class: "g-progress-info" }, C = ["aria-valuenow"], D = {
|
|
4
4
|
class: "g-progress-splash",
|
|
5
5
|
"aria-hidden": "true"
|
package/lib/GRing/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("../GBubble-Dph0YDkU.js"),V=["aria-valuenow"],B=["viewBox"],z=["stop-color"],x=["stop-color"],C=["r","stroke","stroke-width"],T=["r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","transform"],M={class:"g-ring-title"},A={class:"g-ring-count"},G={key:1,class:"g-ring-endpoint g-ring-endpoint--head",style:{"--g-ring-endpoint-angle":"0deg"},"aria-hidden":"true"},P={class:"g-ring-endpoint__inner"},R={class:"g-ring-endpoint__inner"},f=100,I=2e3,W=e.defineComponent({name:"GRing",inheritAttrs:!1,__name:"index",props:{count:{default:0},size:{default:120},strokeWidth:{default:10},gradient:{default:()=>["#3b82f6","#f97316"]},textColor:{default:"#fff"},wave:{type:Boolean,default:!1},waveSpeed:{default:3},forceAnimation:{type:Boolean,default:!1}},setup(d){const o=d,c=e.computed(()=>{const t=Number(o.count);return Number.isFinite(t)?Math.min(100,Math.max(0,t)):0}),p=e.computed(()=>typeof o.size=="number"?`${o.size}px`:o.size),n=f/2,r=e.computed(()=>o.strokeWidth),u=e.computed(()=>n-r.value/2),v=e.computed(()=>2*Math.PI*u.value),w=e.computed(()=>v.value*(1-c.value/100)),l=e.computed(()=>c.value/100*360),y=e.computed(()=>o.gradient?.[0]??"#3b82f6"),S=e.computed(()=>o.gradient?.[1]??"#f97316"),E=e.computed(()=>"rgba(255, 255, 255, 0)"),N=e.computed(()=>"rgba(255, 255, 255, 0.2)"),g=`g-ring-gradient-${e.getCurrentInstance()?.uid??0}`,h=e.useSlots(),_=e.ref(null);let a=null,s=null;const m=()=>{s&&(clearTimeout(s),s=null),a&&(a.cancel(),a=null)},k=()=>{const t=_.value;t&&(l.value<=0||(a=t.animate([{transform:"rotate(-340deg)"},{transform:`rotate(${l.value-340}deg)`}],{duration:Math.max(200,o.waveSpeed*1e3),easing:"ease",fill:"forwards"}),a.onfinish=()=>{s=setTimeout(()=>{s=null,k()},I)}))},$=()=>{m(),e.nextTick(k)};return e.watch(()=>[o.wave,l.value,o.waveSpeed],([t])=>{if(!t){m();return}$()},{immediate:!0}),e.onBeforeUnmount(m),(t,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["g-ring-container",{"is-force-animation":t.forceAnimation}]),style:e.normalizeStyle({width:p.value,height:p.value,"--g-ring-stroke":`${r.value}%`}),role:"progressbar","aria-valuenow":c.value,"aria-valuemin":"0","aria-valuemax":"100"},[t.wave?(e.openBlock(),e.createElementBlock("div",{key:0,class:"g-ring-sweep",style:e.normalizeStyle({"--g-ring-stroke":`${r.value}%`,"--g-ring-fill-angle":`${l.value}deg`}),"aria-hidden":"true"},[e.createElementVNode("div",{ref_key:"beamRef",ref:_,class:"g-ring-sweep__beam",style:e.normalizeStyle({"--g-ring-sweep-from":E.value,"--g-ring-sweep-to":N.value})},null,4)],4)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{class:"g-ring-svg",viewBox:`0 0 ${f} ${f}`,"aria-hidden":"true"},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:g,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":y.value},null,8,z),e.createElementVNode("stop",{offset:"100%","stop-color":S.value},null,8,x)])]),e.createElementVNode("circle",{class:"g-ring-track",cx:n,cy:n,r:u.value,fill:"none",stroke:`url(#${g})`,"stroke-width":r.value},null,8,C),e.createElementVNode("circle",{class:"g-ring-fill",cx:n,cy:n,r:u.value,fill:"none",stroke:`url(#${g})`,"stroke-width":r.value,"stroke-linecap":"butt","stroke-dasharray":v.value,"stroke-dashoffset":w.value,transform:`rotate(-90 ${n} ${n})`},null,8,T)],8,B)),e.createElementVNode("div",{class:"g-ring-content",style:e.normalizeStyle({color:t.textColor})},[e.createElementVNode("div",M,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),e.createElementVNode("div",A,[e.renderSlot(t.$slots,"count",{},()=>[e.createTextVNode(e.toDisplayString(c.value)+"%",1)],!0)])],4),e.unref(h).head?(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("div",P,[e.renderSlot(t.$slots,"head",{},void 0,!0)])])):e.createCommentVNode("",!0),e.unref(h).tail?(e.openBlock(),e.createElementBlock("div",{key:2,class:"g-ring-endpoint g-ring-endpoint--tail",style:e.normalizeStyle({"--g-ring-endpoint-angle":`${l.value}deg`}),"aria-hidden":"true"},[e.createElementVNode("div",R,[e.renderSlot(t.$slots,"tail",{},void 0,!0)])],4)):e.createCommentVNode("",!0)],14,V))}}),i=b._export_sfc(W,[["__scopeId","data-v-1505555b"]]);i.install=d=>{d.component(i.name,i)};exports.GRing=i;exports.default=i;
|
package/lib/GRing/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as N, computed as n, getCurrentInstance as I, useSlots as P, ref as R, watch as V, onBeforeUnmount as W, createElementBlock as d, openBlock as u, normalizeStyle as c, normalizeClass as F, createCommentVNode as _, createElementVNode as t, renderSlot as f, createTextVNode as G, toDisplayString as O, unref as z, nextTick as U } from "vue";
|
|
2
|
-
import { _ as D } from "../
|
|
2
|
+
import { _ as D } from "../GBubble-C3cM9Put.mjs";
|
|
3
3
|
const j = ["aria-valuenow"], q = ["viewBox"], H = ["stop-color"], J = ["stop-color"], K = ["r", "stroke", "stroke-width"], L = ["r", "stroke", "stroke-width", "stroke-dasharray", "stroke-dashoffset", "transform"], Q = { class: "g-ring-title" }, X = { class: "g-ring-count" }, Y = {
|
|
4
4
|
key: 1,
|
|
5
5
|
class: "g-ring-endpoint g-ring-endpoint--head",
|
package/lib/GScroller/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),R=require("motion-v"),x=require("../GBubble-Dph0YDkU.js"),ee=["onMouseenter","onClick"],le={class:"g-scroller__item-text"},te={class:"g-scroller__item-text"},G=80,se=10,ae=e.defineComponent({__name:"index",props:{items:{default:()=>[]},showGradients:{type:Boolean,default:!0},className:{default:""},itemClassName:{default:""},displayScrollbar:{type:Boolean,default:!0},initialSelectedIndex:{default:-1},height:{},stagger:{default:.05},loading:{type:Boolean,default:!1},skeletonCount:{default:5},seamless:{type:Boolean,default:!1},seamlessSpeed:{default:40},seamlessDirection:{default:"up"},seamlessPauseOnHover:{type:Boolean,default:!0}},emits:["itemSelected"],setup(S,{emit:A}){const P=e.defineComponent({name:"AnimatedItem",props:{index:{type:Number,required:!0},stagger:{type:Number,default:.05},instant:{type:Boolean,default:!1}},emits:["mouseenter","click"],setup(l,{slots:n,emit:s}){const a=e.ref(null),i=R.useInView(a,{amount:.5,once:!1});return()=>e.h(R.motion.div,{ref:a,"data-index":l.index,style:{marginBottom:"1rem",cursor:"pointer"},initial:{x:-24,opacity:0},animate:i.value?{x:0,opacity:1}:{x:-24,opacity:0},transition:l.instant?{duration:0}:{duration:.3,delay:Math.min(l.index*l.stagger,.3),ease:"easeOut"},onMouseenter:m=>s("mouseenter",m),onClick:m=>s("click",m)},n.default?.())}}),t=S,q=A,Y=e.useSlots(),N=e.computed(()=>!!Y.default),w=e.ref(null),g=e.ref(t.initialSelectedIndex),b=e.ref(0),V=e.ref(1),H=e.ref(0),v=e.ref(0),h=e.ref(!1);let c=null;const k=e.ref(!1);let $=0,B=0,u=null;const F=e.ref(null),I=e.ref(null),W=e.computed(()=>t.seamless&&t.items.length>0?[...t.items,...t.items]:t.items),o=e.ref(0),_=e.ref(!1),r=e.ref(0),E=e.ref(!1);let d=null,f=0;const U=e.computed(()=>{const l={};return t.height!=null&&t.height!==""&&(l.height=typeof t.height=="number"?`${t.height}px`:String(t.height)),l}),j=e.computed(()=>({transform:`translateY(${o.value}px)`}));function K(l,n,s){return Math.min(Math.max(l,n),s)}const O=l=>{g.value=l},z=(l,n)=>{g.value=n,q("itemSelected",l,n)},X=l=>{const n=l.target,{scrollTop:s,scrollHeight:a,clientHeight:i}=n,m=performance.now();B>0&&Math.abs(s-$)/(m-B)>se&&(k.value=!0),$=s,B=m,u&&clearTimeout(u),u=setTimeout(()=>{k.value=!1},150),b.value=Math.min(s/50,1);const M=a-(s+i);V.value=a<=i?0:Math.min(M/50,1)};function J(l){const n=w.value;if(!n)return;const{scrollTop:s,scrollHeight:a,clientHeight:i}=n;if(a<=i)return;const m=s<=0,M=s+i>=a-1;if(m&&l.deltaY<0||M&&l.deltaY>0){const D=K(v.value-l.deltaY*.3,-G,G);v.value=D,h.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{v.value=0,h.value=!1},150)}}function y(){const l=I.value;if(!l||t.items.length===0){r.value=0,E.value=!1;return}const n=t.items.length,s=l.children[n];r.value=s?s.offsetTop:l.scrollHeight/2;const a=F.value;E.value=a?r.value>a.clientHeight:!0}function L(l){f===0&&(f=l);const n=l-f;if(f=l,!_.value&&r.value>0&&t.items.length>0){const s=t.seamlessSpeed*n/1e3;t.seamlessDirection==="down"?(o.value+=s,o.value>=0&&(o.value-=r.value)):(o.value-=s,o.value<=-r.value&&(o.value+=r.value))}d=requestAnimationFrame(L)}function T(){d==null&&(f=0,d=requestAnimationFrame(L))}function C(){d!=null&&(cancelAnimationFrame(d),d=null),f=0}function Q(){t.seamlessPauseOnHover&&(_.value=!0)}function Z(){t.seamlessPauseOnHover&&(_.value=!1)}return e.onMounted(()=>{t.seamless&&!t.loading&&(y(),o.value=t.seamlessDirection==="down"?-r.value:0,T())}),e.onUnmounted(()=>{C(),c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null)}),e.watch(()=>t.items,()=>{t.seamless&&e.nextTick(()=>{y(),o.value=t.seamlessDirection==="down"?-r.value:0}),H.value++,g.value=-1}),e.watch(()=>t.seamless,l=>{l&&!t.loading?e.nextTick(()=>{y(),o.value=t.seamlessDirection==="down"?-r.value:0,T()}):(C(),o.value=0,_.value=!1)}),e.watch(()=>t.loading,l=>{l?(v.value=0,h.value=!1,k.value=!1,C(),c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null)):t.seamless&&e.nextTick(()=>{y(),o.value=t.seamlessDirection==="down"?-r.value:0,T()})}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["g-scroller",l.className]),style:e.normalizeStyle(U.value)},[l.seamless&&!l.loading?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"seamlessWrapRef",ref:F,class:"g-scroller__seamless",onMouseenter:Q,onMouseleave:Z},[e.createElementVNode("div",{ref_key:"seamlessTrackRef",ref:I,class:"g-scroller__seamless-track",style:e.normalizeStyle(j.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(s,a)=>(e.openBlock(),e.createElementBlock("div",{key:`seamless-${a}`,class:e.normalizeClass(["g-scroller__item","g-scroller__item--seamless",!N.value&&"g-scroller__item--default",g.value===a%l.items.length&&"g-scroller__item--active",l.itemClassName]),onMouseenter:i=>O(a%l.items.length),onClick:i=>z(s,a%l.items.length)},[e.renderSlot(l.$slots,"default",{item:s,index:a%l.items.length},()=>[e.createElementVNode("p",le,e.toDisplayString(s),1)],!0)],42,ee))),128))],4),l.showGradients&&E.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("div",{class:"g-scroller__gradient g-scroller__gradient--top"},null,-1)),n[1]||(n[1]=e.createElementVNode("div",{class:"g-scroller__gradient g-scroller__gradient--bottom"},null,-1))],64)):e.createCommentVNode("",!0)],544)):l.loading?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["g-scroller__list",!l.displayScrollbar&&"g-scroller__list--hidden-scrollbar"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.skeletonCount,s=>(e.openBlock(),e.createElementBlock("div",{key:`skeleton-${s}`,class:"g-scroller__skeleton"},n[2]||(n[2]=[e.createElementVNode("div",{class:"g-scroller__skeleton-line"},null,-1)])))),128))],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{ref_key:"listRef",ref:w,class:e.normalizeClass(["g-scroller__list",!l.displayScrollbar&&"g-scroller__list--hidden-scrollbar"]),onScroll:X,onWheel:J},[e.createElementVNode("div",{class:e.normalizeClass(["g-scroller__content",{"g-scroller__content--pulling":h.value}]),style:e.normalizeStyle({transform:`translateY(${v.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,(s,a)=>(e.openBlock(),e.createBlock(e.unref(P),{key:`${H.value}-${a}`,index:a,stagger:l.stagger,instant:k.value,onMouseenter:i=>O(a),onClick:i=>z(s,a)},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["g-scroller__item",!N.value&&"g-scroller__item--default",g.value===a&&"g-scroller__item--active",l.itemClassName])},[e.renderSlot(l.$slots,"default",{item:s,index:a},()=>[e.createElementVNode("p",te,e.toDisplayString(s),1)],!0)],2)]),_:2},1032,["index","stagger","instant","onMouseenter","onClick"]))),128))],6)],34),l.showGradients?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",{class:"g-scroller__gradient g-scroller__gradient--top",style:e.normalizeStyle({opacity:b.value})},null,4),e.createElementVNode("div",{class:"g-scroller__gradient g-scroller__gradient--bottom",style:e.normalizeStyle({opacity:V.value})},null,4)],64)):e.createCommentVNode("",!0)],64))],6))}}),p=x._export_sfc(ae,[["__scopeId","data-v-972060e6"]]);p.install=S=>{S.component(p.name,p)};exports.GScroller=p;exports.default=p;
|