geekin-devtoys 0.3.11 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/lib/{GBubble → GBranched}/index.js +1 -1
  2. package/lib/GBranched/index.mjs +5 -0
  3. package/lib/GBranched/style.css +1 -0
  4. package/lib/GBranched-BtF7heMk.js +1 -0
  5. package/lib/GBranched-vnLlYOl9.mjs +197 -0
  6. package/lib/GButton/index.js +1 -1
  7. package/lib/GButton/index.mjs +10 -10
  8. package/lib/GButton/style.css +1 -1
  9. package/lib/GCard/index.js +1 -1
  10. package/lib/GCard/index.mjs +1 -1
  11. package/lib/GDialog/index.js +1 -1
  12. package/lib/GDialog/index.mjs +29 -29
  13. package/lib/GDialog/style.css +1 -1
  14. package/lib/GDropdown/index.js +1 -0
  15. package/lib/GDropdown/index.mjs +278 -0
  16. package/lib/GDropdown/style.css +1 -0
  17. package/lib/GInput/index.js +1 -1
  18. package/lib/GInput/index.mjs +2 -2
  19. package/lib/GInput/style.css +1 -1
  20. package/lib/GPicker/index.js +1 -0
  21. package/lib/{GInputTreeTag → GPicker}/index.mjs +111 -111
  22. package/lib/GPicker/style.css +1 -0
  23. package/lib/GPicker.d.ts +1 -0
  24. package/lib/GPie3D/index.js +1 -1
  25. package/lib/GPie3D/index.mjs +1 -1
  26. package/lib/GPluginVideo/index.js +1 -1
  27. package/lib/GPluginVideo/index.mjs +59 -58
  28. package/lib/GProgress/index.js +1 -1
  29. package/lib/GProgress/index.mjs +1 -1
  30. package/lib/GRadio/index.js +1 -0
  31. package/lib/GRadio/index.mjs +198 -0
  32. package/lib/GRadio/style.css +1 -0
  33. package/lib/GRadio.d.ts +1 -0
  34. package/lib/GRing/index.js +1 -1
  35. package/lib/GRing/index.mjs +1 -1
  36. package/lib/GScroller/index.js +1 -1
  37. package/lib/GScroller/index.mjs +1 -1
  38. package/lib/GSegment/index.js +1 -0
  39. package/lib/GSegment/index.mjs +364 -0
  40. package/lib/GSegment/style.css +1 -0
  41. package/lib/GSegment.d.ts +1 -0
  42. package/lib/GSlider/index.js +1 -0
  43. package/lib/GSlider/index.mjs +184 -0
  44. package/lib/GSlider/style.css +1 -0
  45. package/lib/GSlider.d.ts +1 -0
  46. package/lib/GSteps/index.js +1 -1
  47. package/lib/GSteps/index.mjs +1 -1
  48. package/lib/GTable/index.js +1 -1
  49. package/lib/GTable/index.mjs +1 -1
  50. package/lib/GTag/index.js +1 -1
  51. package/lib/GTag/index.mjs +7 -5
  52. package/lib/GTag/style.css +1 -0
  53. package/lib/GToast/index.js +1 -0
  54. package/lib/GToast/index.mjs +292 -0
  55. package/lib/GToast/style.css +1 -0
  56. package/lib/GToast.d.ts +1 -0
  57. package/lib/GTree/index.js +1 -1
  58. package/lib/GTree/index.mjs +1 -1
  59. package/lib/GVideo/index.js +2 -2
  60. package/lib/GVideo/index.mjs +1 -1
  61. package/lib/components/GBranched/index.d.ts +29 -0
  62. package/lib/components/GBranched/types.d.ts +139 -0
  63. package/lib/components/GDialog/index.d.ts +3 -90
  64. package/lib/components/GDialog/types.d.ts +89 -0
  65. package/lib/components/GDropdown/index.d.ts +59 -0
  66. package/lib/components/GRadio/index.d.ts +45 -0
  67. package/lib/components/GRadio/types.d.ts +94 -0
  68. package/lib/components/GScroller/index.d.ts +1 -1
  69. package/lib/components/GSegment/index.d.ts +30 -0
  70. package/lib/components/GSegment/types.d.ts +125 -0
  71. package/lib/components/GShinyText/index.d.ts +1 -1
  72. package/lib/components/GSlider/index.d.ts +27 -0
  73. package/lib/components/GSlider/types.d.ts +88 -0
  74. package/lib/components/GTag/index.d.ts +3 -0
  75. package/lib/components/GToast/ToastCard.d.ts +9 -0
  76. package/lib/components/GToast/index.d.ts +7 -0
  77. package/lib/components/GToast/store.d.ts +46 -0
  78. package/lib/components/GToast/types.d.ts +121 -0
  79. package/lib/index/index.js +1 -1
  80. package/lib/index/index.mjs +70 -53
  81. package/lib/index/style.css +17 -5
  82. package/lib/index.d.ts +16 -5
  83. package/package.json +58 -13
  84. package/lib/GBubble/index.mjs +0 -5
  85. package/lib/GBubble/style.css +0 -1
  86. package/lib/GBubble-C3cM9Put.mjs +0 -216
  87. package/lib/GBubble-Dph0YDkU.js +0 -2
  88. package/lib/GInputTreeTag/index.js +0 -1
  89. package/lib/GInputTreeTag/style.css +0 -1
  90. package/lib/assets/GTag.css +0 -1
  91. package/lib/components/GBubble/index.d.ts +0 -61
  92. /package/lib/{GBubble.d.ts → GBranched.d.ts} +0 -0
  93. /package/lib/{GInputTreeTag.d.ts → GDropdown.d.ts} +0 -0
  94. /package/lib/components/{GInputTreeTag → GPicker}/index.d.ts +0 -0
@@ -1,13 +1,13 @@
1
- import { defineComponent as Le, computed as n, ref as p, watch as Se, nextTick as J, onMounted as Te, onBeforeUnmount as Ae, createElementBlock as M, openBlock as d, normalizeClass as P, createElementVNode as O, createBlock as R, createCommentVNode as N, normalizeStyle as $, createVNode as V, unref as c, withKeys as Ce, Teleport as Pe, withCtx as b, withModifiers as Oe, renderSlot as B, createTextVNode as Q, toDisplayString as X, Fragment as Re, renderList as Ne } from "vue";
1
+ import { defineComponent as Le, computed as n, ref as c, watch as Se, nextTick as J, onMounted as Ae, onBeforeUnmount as Ce, createElementBlock as I, openBlock as p, normalizeClass as T, createElementVNode as O, createBlock as R, createCommentVNode as N, normalizeStyle as $, createVNode as V, unref as d, withKeys as Pe, Teleport as Te, withCtx as g, withModifiers as Oe, renderSlot as M, createTextVNode as Q, toDisplayString as X, Fragment as Re, renderList as Ne } from "vue";
2
2
  import $e from "../GInput/index.mjs";
3
3
  import ze from "../GTag/index.mjs";
4
4
  import He from "../GTree/index.mjs";
5
- import { ElMessage as Y } from "element-plus";
5
+ import { toast as Y } from "../GToast/index.mjs";
6
6
  import { AnimatePresence as D, motion as ee } from "motion-v";
7
- import { _ as Ke } from "../GBubble-C3cM9Put.mjs";
7
+ import { _ as Ke } from "../GBranched-vnLlYOl9.mjs";
8
8
  const je = {
9
9
  key: 0,
10
- class: "g-input-tree-tag__tags"
10
+ class: "g-picker__tags"
11
11
  }, Ge = /* @__PURE__ */ Le({
12
12
  __name: "index",
13
13
  props: {
@@ -37,39 +37,39 @@ const je = {
37
37
  },
38
38
  emits: ["update:modelValue", "change", "add", "remove", "node-click", "duplicate", "not-found"],
39
39
  setup(L, { expose: te, emit: le }) {
40
- const a = L, r = le, ae = n(() => ({
41
- label: a.props.label || "label",
42
- children: a.props.children || "children",
43
- disabled: a.props.disabled
44
- })), oe = n(() => a.props.value || a.nodeKey || "id"), ne = n(() => a.props.label || "label"), re = n(() => a.props.children || "children"), S = n(() => a.props.isLeaf), se = n(() => a.echoProps?.value || "value"), ie = n(() => a.echoProps?.label || "label"), h = (e) => e ? e[oe.value] : void 0, f = (e) => e ? e[ne.value] : "", H = (e) => e ? e[re.value] : void 0, ue = (e) => e?.[se.value] ?? e?.value, pe = (e) => e?.[ie.value] ?? e?.label, v = (e) => {
40
+ const o = L, r = le, oe = n(() => ({
41
+ label: o.props.label || "label",
42
+ children: o.props.children || "children",
43
+ disabled: o.props.disabled
44
+ })), ae = n(() => o.props.value || o.nodeKey || "id"), ne = n(() => o.props.label || "label"), re = n(() => o.props.children || "children"), S = n(() => o.props.isLeaf), se = n(() => o.echoProps?.value || "value"), ie = n(() => o.echoProps?.label || "label"), h = (e) => e ? e[ae.value] : void 0, f = (e) => e ? e[ne.value] : "", H = (e) => e ? e[re.value] : void 0, ue = (e) => e?.[se.value] ?? e?.value, ce = (e) => e?.[ie.value] ?? e?.label, v = (e) => {
45
45
  if (!e) return !1;
46
- if (typeof a.selectable == "function") return a.selectable(e);
46
+ if (typeof o.selectable == "function") return o.selectable(e);
47
47
  if (S.value && e[S.value] !== void 0) return !!e[S.value];
48
48
  const t = H(e);
49
49
  return !t || !t.length;
50
- }, T = n(() => {
50
+ }, A = n(() => {
51
51
  const e = /* @__PURE__ */ new Map(), t = (l = []) => {
52
- l.forEach((o) => {
53
- v(o) && e.set(h(o), o);
54
- const s = H(o);
52
+ l.forEach((a) => {
53
+ v(a) && e.set(h(a), a);
54
+ const s = H(a);
55
55
  s?.length && t(s);
56
56
  });
57
57
  };
58
- return t(a.data || []), e;
59
- }), i = n(() => (a.modelValue || []).map((t) => {
60
- const l = a.valueFormat === "object" ? ue(t) : t, o = T.value.get(l), s = a.valueFormat === "object" ? pe(t) : void 0;
58
+ return t(o.data || []), e;
59
+ }), i = n(() => (o.modelValue || []).map((t) => {
60
+ const l = o.valueFormat === "object" ? ue(t) : t, a = A.value.get(l), s = o.valueFormat === "object" ? ce(t) : void 0;
61
61
  return {
62
62
  value: l,
63
- label: o ? f(o) : s ?? String(l ?? ""),
64
- raw: o ?? (a.valueFormat === "object" ? t : void 0)
63
+ label: a ? f(a) : s ?? String(l ?? ""),
64
+ raw: a ?? (o.valueFormat === "object" ? t : void 0)
65
65
  };
66
- })), E = (e) => i.value.some((t) => t.value === e), F = p(""), u = p(!1), K = p(null), j = p(null), G = p(null), m = p(null), de = (e) => {
66
+ })), F = (e) => i.value.some((t) => t.value === e), _ = c(""), u = c(!1), K = c(null), j = c(null), G = c(null), m = c(null), pe = (e) => {
67
67
  if (!e) {
68
68
  m.value = null;
69
69
  return;
70
70
  }
71
71
  m.value = e.$el ?? (e instanceof HTMLElement ? e : null);
72
- }, U = p({}), y = p("bottom"), ce = n(() => ({
72
+ }, U = c({}), y = c("bottom"), de = n(() => ({
73
73
  opacity: 0,
74
74
  scale: 0.95,
75
75
  y: y.value === "bottom" ? -8 : 8
@@ -77,32 +77,32 @@ const je = {
77
77
  opacity: 0,
78
78
  scale: 0.95,
79
79
  y: y.value === "bottom" ? -8 : 8
80
- })), me = { duration: 0.2, ease: "easeOut" }, ge = n(() => ({
80
+ })), me = { duration: 0.2, ease: "easeOut" }, be = n(() => ({
81
81
  ...U.value,
82
82
  transformOrigin: y.value === "bottom" ? "top center" : "bottom center"
83
- })), 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(
84
- () => typeof a.width == "number" ? `${a.width}px` : a.width
85
- ), A = () => {
86
- a.disabled || (u.value = !0);
87
- }, _ = () => {
83
+ })), ge = { opacity: 0, scale: 0.8 }, he = { opacity: 1, scale: 1 }, ye = { opacity: 0, scale: 0.8 }, we = { duration: 0.2, ease: "easeOut" }, ke = n(
84
+ () => typeof o.width == "number" ? `${o.width}px` : o.width
85
+ ), C = () => {
86
+ o.disabled || (u.value = !0);
87
+ }, E = () => {
88
88
  if (!u.value) return;
89
89
  const e = G.value, t = m.value;
90
90
  if (!e || !t) return;
91
- const l = e.getBoundingClientRect(), o = t.offsetHeight || a.popperMaxHeight, I = window.innerHeight - l.bottom - a.popperOffset, Me = l.top - a.popperOffset, W = I >= o || I >= Me ? "bottom" : "top";
91
+ const l = e.getBoundingClientRect(), a = t.offsetHeight || o.popperMaxHeight, B = window.innerHeight - l.bottom - o.popperOffset, Ie = l.top - o.popperOffset, W = B >= a || B >= Ie ? "bottom" : "top";
92
92
  y.value = W;
93
- const Be = W === "bottom" ? l.bottom + a.popperOffset : l.top - o - a.popperOffset;
93
+ const Me = W === "bottom" ? l.bottom + o.popperOffset : l.top - a - o.popperOffset;
94
94
  U.value = {
95
95
  position: "fixed",
96
- top: `${Be}px`,
96
+ top: `${Me}px`,
97
97
  left: `${l.left}px`,
98
98
  width: `${l.width}px`,
99
- zIndex: String(a.popperZIndex)
99
+ zIndex: String(o.popperZIndex)
100
100
  };
101
101
  };
102
- let g = null;
102
+ let b = null;
103
103
  const w = () => {
104
- u.value && (g && cancelAnimationFrame(g), g = requestAnimationFrame(() => {
105
- g = null, _();
104
+ u.value && (b && cancelAnimationFrame(b), b = requestAnimationFrame(() => {
105
+ b = null, E();
106
106
  }));
107
107
  };
108
108
  let k = null;
@@ -116,57 +116,57 @@ const je = {
116
116
  q();
117
117
  return;
118
118
  }
119
- await J(), _(), requestAnimationFrame(_), Ve();
119
+ await J(), E(), requestAnimationFrame(E), Ve();
120
120
  });
121
121
  const Z = (e) => {
122
122
  if (!u.value) return;
123
123
  const t = e.target;
124
124
  j.value?.contains(t) || m.value?.contains(t) || (u.value = !1);
125
125
  };
126
- Te(() => {
126
+ Ae(() => {
127
127
  document.addEventListener("mousedown", Z, !0), window.addEventListener("scroll", w, !0), window.addEventListener("resize", w);
128
- }), Ae(() => {
129
- document.removeEventListener("mousedown", Z, !0), window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", w), g && cancelAnimationFrame(g), q();
128
+ }), Ce(() => {
129
+ document.removeEventListener("mousedown", Z, !0), window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", w), b && cancelAnimationFrame(b), q();
130
130
  });
131
- const Ee = (e) => {
132
- u.value = !0, K.value?.filter(e), J(_);
133
- }, Fe = (e, t) => e ? typeof a.filterMethod == "function" ? a.filterMethod(e, t) : String(f(t) ?? "").toLowerCase().includes(String(e).toLowerCase()) : !0, _e = (e) => {
134
- r("node-click", e), v(e) && (C(e), u.value = !1);
135
- }, xe = (e) => a.valueFormat === "object" ? { value: e.value, label: e.label, raw: e.raw } : e.value, C = (e) => {
131
+ const Fe = (e) => {
132
+ u.value = !0, K.value?.filter(e), J(E);
133
+ }, _e = (e, t) => e ? typeof o.filterMethod == "function" ? o.filterMethod(e, t) : String(f(t) ?? "").toLowerCase().includes(String(e).toLowerCase()) : !0, Ee = (e) => {
134
+ r("node-click", e), v(e) && (P(e), u.value = !1);
135
+ }, xe = (e) => o.valueFormat === "object" ? { value: e.value, label: e.label, raw: e.raw } : e.value, P = (e) => {
136
136
  const t = h(e);
137
137
  if (t == null || t === "") return;
138
- if (E(t)) {
138
+ if (F(t)) {
139
139
  const s = { value: t, label: f(e), raw: e };
140
- r("duplicate", s), a.duplicateMessage && Y.warning(a.duplicateMessage);
140
+ r("duplicate", s), o.duplicateMessage && Y.warning(o.duplicateMessage, { position: "top-center" });
141
141
  return;
142
142
  }
143
- const l = { value: t, label: f(e), raw: e }, o = [...a.modelValue || [], xe(l)];
144
- r("update:modelValue", o), r("add", l), r("change", o, [...i.value, l]), a.clearInputAfterSelect && (F.value = "");
145
- }, Ie = () => {
146
- if (!a.enterToAdd) return;
147
- const e = (F.value || "").trim();
143
+ const l = { value: t, label: f(e), raw: e }, a = [...o.modelValue || [], xe(l)];
144
+ r("update:modelValue", a), r("add", l), r("change", a, [...i.value, l]), o.clearInputAfterSelect && (_.value = "");
145
+ }, Be = () => {
146
+ if (!o.enterToAdd) return;
147
+ const e = (_.value || "").trim();
148
148
  if (!e) return;
149
149
  let t = null;
150
- for (const l of T.value.values())
150
+ for (const l of A.value.values())
151
151
  if (f(l) === e) {
152
152
  t = l;
153
153
  break;
154
154
  }
155
155
  if (!t) {
156
- r("not-found", e), a.notFoundMessage && Y.warning(a.notFoundMessage);
156
+ r("not-found", e), o.notFoundMessage && Y.warning(o.notFoundMessage, { position: "top-center" });
157
157
  return;
158
158
  }
159
- C(t);
159
+ P(t);
160
160
  }, x = (e) => {
161
161
  if (e < 0 || e >= i.value.length) return;
162
- const t = i.value[e], l = [...a.modelValue || []];
162
+ const t = i.value[e], l = [...o.modelValue || []];
163
163
  l.splice(e, 1), r("update:modelValue", l), t && r("remove", t, e);
164
- const o = i.value.filter((s, I) => I !== e);
165
- r("change", l, o);
164
+ const a = i.value.filter((s, B) => B !== e);
165
+ r("change", l, a);
166
166
  };
167
167
  return te({
168
168
  /** 主动打开下拉面板 */
169
- open: A,
169
+ open: C,
170
170
  /** 主动关闭下拉面板 */
171
171
  close: () => u.value = !1,
172
172
  /** 清空已选 */
@@ -175,8 +175,8 @@ const je = {
175
175
  },
176
176
  /** 根据 value 直接添加 */
177
177
  addByValue: (e) => {
178
- const t = T.value.get(e);
179
- t && C(t);
178
+ const t = A.value.get(e);
179
+ t && P(t);
180
180
  },
181
181
  /** 根据索引移除,触发与关闭 tag 一致的事件 */
182
182
  removeByIndex: (e) => {
@@ -189,86 +189,86 @@ const je = {
189
189
  },
190
190
  /** 获取当前归一化后的已选项 */
191
191
  getSelectedItems: () => i.value
192
- }), (e, t) => (d(), M("div", {
193
- class: P(["g-input-tree-tag", { "is-disabled": e.disabled }])
192
+ }), (e, t) => (p(), I("div", {
193
+ class: T(["g-picker", { "is-disabled": e.disabled }])
194
194
  }, [
195
195
  O("div", {
196
- class: "g-input-tree-tag__wrap",
196
+ class: "g-picker__wrap",
197
197
  ref_key: "wrapRef",
198
198
  ref: j
199
199
  }, [
200
200
  O("div", {
201
- class: "g-input-tree-tag__input-box",
201
+ class: "g-picker__input-box",
202
202
  ref_key: "inputBoxRef",
203
203
  ref: G,
204
204
  style: $({ width: ke.value })
205
205
  }, [
206
- V(c($e), {
207
- modelValue: F.value,
208
- "onUpdate:modelValue": t[0] || (t[0] = (l) => F.value = l),
206
+ V(d($e), {
207
+ modelValue: _.value,
208
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => _.value = l),
209
209
  placeholder: e.placeholder,
210
210
  clearable: e.clearable,
211
211
  disabled: e.disabled,
212
212
  block: "",
213
- class: "g-input-tree-tag__input",
214
- onFocus: A,
215
- onClick: A,
216
- onInput: Ee,
217
- onKeyup: Ce(Ie, ["enter"])
213
+ class: "g-picker__input",
214
+ onFocus: C,
215
+ onClick: C,
216
+ onInput: Fe,
217
+ onKeyup: Pe(Be, ["enter"])
218
218
  }, null, 8, ["modelValue", "placeholder", "clearable", "disabled"])
219
219
  ], 4),
220
- (d(), R(Pe, { to: "body" }, [
221
- V(c(D), null, {
222
- default: b(() => [
223
- u.value ? (d(), R(c(ee).div, {
220
+ (p(), R(Te, { to: "body" }, [
221
+ V(d(D), null, {
222
+ default: g(() => [
223
+ u.value ? (p(), R(d(ee).div, {
224
224
  key: 0,
225
- ref: de,
226
- class: P(["g-input-tree-tag__popover", `is-${y.value}`]),
227
- style: $(ge.value),
228
- initial: ce.value,
225
+ ref: pe,
226
+ class: T(["g-picker__popover", `is-${y.value}`]),
227
+ style: $(be.value),
228
+ initial: de.value,
229
229
  animate: fe,
230
230
  exit: ve.value,
231
231
  transition: me,
232
232
  onMousedown: t[1] || (t[1] = Oe(() => {
233
233
  }, ["prevent"]))
234
234
  }, {
235
- default: b(() => [
235
+ default: g(() => [
236
236
  O("div", {
237
- class: "g-input-tree-tag__tree-wrap",
237
+ class: "g-picker__tree-wrap",
238
238
  style: $({ maxHeight: e.popperMaxHeight + "px" })
239
239
  }, [
240
- V(c(He), {
240
+ V(d(He), {
241
241
  ref_key: "treeRef",
242
242
  ref: K,
243
243
  data: e.data,
244
- props: ae.value,
244
+ props: oe.value,
245
245
  "node-key": e.nodeKey,
246
- "filter-method": Fe,
246
+ "filter-method": _e,
247
247
  "default-expand-all": e.defaultExpandAll,
248
248
  "highlight-current": !1,
249
- onNodeClick: _e
249
+ onNodeClick: Ee
250
250
  }, {
251
- default: b(({ data: l, level: o, expanded: s }) => [
252
- B(e.$slots, "tree-node", {
251
+ default: g(({ data: l, level: a, expanded: s }) => [
252
+ M(e.$slots, "tree-node", {
253
253
  data: l,
254
- node: { level: o, expanded: s },
254
+ node: { level: a, expanded: s },
255
255
  selectable: v(l),
256
- selected: E(h(l))
256
+ selected: F(h(l))
257
257
  }, () => [
258
- l ? (d(), M("span", {
258
+ l ? (p(), I("span", {
259
259
  key: 0,
260
- class: P([
261
- "g-input-tree-tag__node",
260
+ class: T([
261
+ "g-picker__node",
262
262
  {
263
263
  "is-selectable": v(l),
264
- "is-selected": v(l) && E(h(l))
264
+ "is-selected": v(l) && F(h(l))
265
265
  }
266
266
  ])
267
267
  }, [
268
- B(e.$slots, "leaf-icon", {
268
+ M(e.$slots, "leaf-icon", {
269
269
  data: l,
270
270
  selectable: v(l),
271
- selected: E(h(l))
271
+ selected: F(h(l))
272
272
  }, void 0, !0),
273
273
  Q(" " + X(f(l)), 1)
274
274
  ], 2)) : N("", !0)
@@ -284,34 +284,34 @@ const je = {
284
284
  _: 3
285
285
  })
286
286
  ])),
287
- i.value.length ? (d(), M("div", je, [
288
- B(e.$slots, "tags", {
287
+ i.value.length ? (p(), I("div", je, [
288
+ M(e.$slots, "tags", {
289
289
  items: i.value,
290
290
  remove: x
291
291
  }, () => [
292
- V(c(D), { mode: "popLayout" }, {
293
- default: b(() => [
294
- (d(!0), M(Re, null, Ne(i.value, (l, o) => (d(), R(c(ee).div, {
292
+ V(d(D), { mode: "popLayout" }, {
293
+ default: g(() => [
294
+ (p(!0), I(Re, null, Ne(i.value, (l, a) => (p(), R(d(ee).div, {
295
295
  key: l.value,
296
296
  layout: !0,
297
- class: "g-input-tree-tag__tag-motion",
298
- initial: be,
297
+ class: "g-picker__tag-motion",
298
+ initial: ge,
299
299
  animate: he,
300
300
  exit: ye,
301
301
  transition: we
302
302
  }, {
303
- default: b(() => [
304
- V(c(ze), {
305
- class: "g-input-tree-tag__tag",
303
+ default: g(() => [
304
+ V(d(ze), {
305
+ class: "g-picker__tag",
306
306
  type: e.tagType,
307
307
  variant: e.tagVariant,
308
308
  closable: e.closable && !e.disabled,
309
- onClose: (s) => x(o)
309
+ onClose: (s) => x(a)
310
310
  }, {
311
- default: b(() => [
312
- B(e.$slots, "tag", {
311
+ default: g(() => [
312
+ M(e.$slots, "tag", {
313
313
  item: l,
314
- index: o
314
+ index: a
315
315
  }, () => [
316
316
  Q(X(l.label), 1)
317
317
  ], !0)
@@ -329,11 +329,11 @@ const je = {
329
329
  ], 512)
330
330
  ], 2));
331
331
  }
332
- }), z = /* @__PURE__ */ Ke(Ge, [["__scopeId", "data-v-4e5882e3"]]);
332
+ }), z = /* @__PURE__ */ Ke(Ge, [["__scopeId", "data-v-92c90ec0"]]);
333
333
  z.install = (L) => {
334
334
  L.component(z.name, z);
335
335
  };
336
336
  export {
337
- z as GInputTreeTag,
337
+ z as GPicker,
338
338
  z as default
339
339
  };
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.g-picker[data-v-92c90ec0]{width:100%}.g-picker__wrap[data-v-92c90ec0]{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.g-picker__tags[data-v-92c90ec0]{display:flex;flex-wrap:wrap;gap:8px;width:100%}.g-picker__tag-motion[data-v-92c90ec0]{display:inline-flex}.g-picker__tag[data-v-92c90ec0]{margin:0}.g-picker.is-disabled[data-v-92c90ec0]{cursor:not-allowed}.g-picker__popover{box-sizing:border-box;background:var(--g-bg-color, #fff);border:1px solid var(--g-border-color, #dcdfe3);border-radius:4px;box-shadow:0 0 12px #0000001f;padding:8px 0}.g-picker__popover .g-picker__tree-wrap{overflow:auto}.g-picker__popover .g-picker__node{display:inline-flex;align-items:center;gap:4px;font-size:13px}.g-picker__popover .g-picker__node.is-selectable{cursor:pointer;color:var(--g-text-color, rgba(0, 0, 0, .88))}.g-picker__popover .g-picker__node.is-selected{color:var(--g-primary-color, #039be5)}
@@ -0,0 +1 @@
1
+ export {}
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("vue"),pt=require("../GBubble-Dph0YDkU.js"),vt={class:"g-pie3d-tooltip__default"},gt={class:"g-pie3d-tooltip__name"},yt={class:"g-pie3d-tooltip__value"},mt=260,xt=h.defineComponent({__name:"index",props:{data:{default:()=>[]},config:{default:()=>({})},animation:{type:Boolean,default:!0}},emits:["slice-click"],setup(N,{emit:at}){const S=N,lt=at,V={alpha:55,depth:26,startAngle:0,colors:["#22d3ee","#3b82f6","#8b5cf6","#06b6d4","#0ea5e9","#a855f7","#14b8a6"],textColor:"#cbd5e1",radiusRatio:.55,hoverDistance:14,showLabel:!0,showPercent:!0,labelFontSize:12,opacity:.7,showAura:!0,glowColor:"",labelLineColor:"auto",labelLineWidth:1},a={...V,...S.config},E=h.ref(null),C=h.ref(null);let L=null,k=0,_=0,Y=1,p=0,u=0,g=0,M=0,b=[],$=S.animation?0:1,F=null,q=S.animation,I=null,X=0;const D=h.ref(-1),z=h.ref(!1),J=h.ref(0),K=h.ref(0),R=h.ref(null),O=h.ref(0),Q=t=>t*Math.PI/180,G=(t,l=0,n=0)=>({x:p+l+g*Math.cos(t),y:u+n+M*Math.sin(t)}),j=(t,l=0,n=0)=>({x:p+l+g*Math.cos(t),y:u+n+M*Math.sin(t)+a.depth}),W=()=>{if(!C.value||!E.value)return;const t=E.value,l=C.value;Y=window.devicePixelRatio||1,k=t.clientWidth,_=t.clientHeight,l.width=k*Y,l.height=_*Y,l.style.width=k+"px",l.style.height=_+"px",L=l.getContext("2d"),L&&L.setTransform(Y,0,0,Y,0,0),p=k/2,u=_/2-a.depth/2;const n=a.showLabel?60:10,s=Math.min(k,_-a.depth-n)/2*a.radiusRatio*1.6;g=Math.max(20,s),M=g*Math.cos(Q(a.alpha)),it(),q?st():U()},it=()=>{b=[];const t=S.data.reduce((n,s)=>n+(s.value||0),0);if(t<=0)return;let l=-Math.PI/2+Q(a.startAngle);S.data.forEach((n,s)=>{const i=n.value/t,d=i*Math.PI*2;b.push({data:n,index:s,color:n.color||a.colors[s%a.colors.length],startA:l,endA:l+d,midA:l+d/2,percent:i,hover:!1,hoverProgress:0}),l+=d})},st=()=>{$=0;const t=800,l=performance.now(),n=s=>{const i=Math.min(1,(s-l)/t);$=1-Math.pow(1-i,3),U(),i<1?F=requestAnimationFrame(n):(q=!1,F=null)};F=requestAnimationFrame(n)},rt=t=>1-Math.pow(1-t,3),Z=t=>{const l=X===0?16:t-X;X=t;const n=l/mt;let s=!1;for(const i of b){const d=i.hover?1:0;if(i.hoverProgress===d)continue;const v=d>i.hoverProgress?1:-1;i.hoverProgress+=v*n,(v>0&&i.hoverProgress>=d||v<0&&i.hoverProgress<=d)&&(i.hoverProgress=d),i.hoverProgress!==d&&(s=!0)}U(),s?I=requestAnimationFrame(Z):(I=null,X=0)},tt=()=>{I==null&&(X=0,I=requestAnimationFrame(Z))},T=(t,l)=>{let n=t.replace("#","");n.length===3&&(n=n.split("").map(v=>v+v).join(""));const s=parseInt(n.slice(0,2),16),i=parseInt(n.slice(2,4),16),d=parseInt(n.slice(4,6),16);return`rgba(${s},${i},${d},${l})`},U=()=>{if(!L)return;const t=L;if(t.clearRect(0,0,k,_),!b.length)return;const l=b[0]?.startA??0,n=Math.PI*2*$,s=l+n,i=b.map(e=>{const c=e.startA,f=Math.min(e.endA,s),y=f>c,x=rt(Math.max(0,Math.min(1,e.hoverProgress))),A=Math.cos(e.midA)*a.hoverDistance*x,P=Math.sin(e.midA)*a.hoverDistance*x;return{...e,startA:c,endA:f,valid:y,ox:A,oy:P,hp:x}});if(a.showAura){const e=t.createRadialGradient(p,u+a.depth,g*.1,p,u+a.depth,g*1.5);e.addColorStop(0,"rgba(6,182,212,0.15)"),e.addColorStop(.4,"rgba(59,130,246,0.08)"),e.addColorStop(.8,"rgba(139,92,246,0.03)"),e.addColorStop(1,"rgba(0,0,0,0)"),t.beginPath(),t.ellipse(p,u+a.depth,g*1.5,M*.9,0,0,Math.PI*2),t.fillStyle=e,t.fill(),t.strokeStyle="rgba(56,189,248,0.08)",t.lineWidth=1;for(let c=3;c>=1;c--){const f=g*(.3+c*.25);t.beginPath(),t.ellipse(p,u+a.depth,f,f*(M/g),0,0,Math.PI*2),t.stroke()}}const d=(e,c)=>{const f=a.glowColor||e.color,y={x:p+e.ox,y:u+e.oy},x={x:y.x,y:y.y+a.depth},A=G(c,e.ox,e.oy),P=j(c,e.ox,e.oy);t.fillStyle=T(f,a.opacity*.5),t.beginPath(),t.moveTo(y.x,y.y),t.lineTo(A.x,A.y),t.lineTo(P.x,P.y),t.lineTo(x.x,x.y),t.closePath(),t.fill(),t.strokeStyle=T(f,.8),t.lineWidth=.8,t.beginPath(),t.moveTo(A.x,A.y),t.lineTo(P.x,P.y),t.stroke()};for(const e of i)e.valid&&(Math.sin(e.startA)<=.001&&d(e,e.startA),Math.sin(e.endA)<=.001&&d(e,e.endA));const v=Math.PI/120;for(const e of i){if(!e.valid)continue;let c=e.startA;const f=a.glowColor||e.color;for(;c<e.endA;){const y=Math.min(c+v,e.endA),x=(c+y)/2;if(Math.sin(x)>0){const A=G(c,e.ox,e.oy),P=G(y,e.ox,e.oy),o=j(y,e.ox,e.oy),m=j(c,e.ox,e.oy);t.fillStyle=T(f,a.opacity*.4),t.beginPath(),t.moveTo(A.x,A.y),t.lineTo(P.x,P.y),t.lineTo(o.x,o.y),t.lineTo(m.x,m.y),t.closePath(),t.fill(),t.strokeStyle=T(f,.7),t.lineWidth=.8,t.beginPath(),t.moveTo(m.x,m.y),t.lineTo(o.x,o.y),t.stroke()}c=y}}for(const e of i)e.valid&&(Math.sin(e.startA)>.001&&d(e,e.startA),Math.sin(e.endA)>.001&&d(e,e.endA));for(const e of i){if(!e.valid)continue;const c=a.glowColor||e.color;e.hp>.01&&(t.save(),t.shadowColor=c,t.shadowBlur=12*e.hp,t.beginPath(),t.moveTo(p+e.ox,u+e.oy),t.ellipse(p+e.ox,u+e.oy,g,M,0,e.startA,e.endA),t.closePath(),t.fillStyle=T(c,.08*e.hp),t.fill(),t.restore()),t.beginPath(),t.moveTo(p+e.ox,u+e.oy),t.ellipse(p+e.ox,u+e.oy,g,M,0,e.startA,e.endA),t.closePath();const f=t.createRadialGradient(p+e.ox-g*.2,u+e.oy-M*.2,0,p+e.ox,u+e.oy,g*1.05);f.addColorStop(0,T(c,a.opacity*.95)),f.addColorStop(.6,T(c,a.opacity*.8)),f.addColorStop(1,T(c,a.opacity*.6)),t.fillStyle=f,t.fill(),t.strokeStyle=T(c,.95),t.lineWidth=.8+.6*e.hp,t.stroke()}if(a.showLabel&&$>=.999){t.font=`${a.labelFontSize}px Arial, sans-serif`,t.textBaseline="middle";const e=[],c=[],f=a.labelFontSize+6,y=14,x=4;for(const o of i){if(!o.valid)continue;const m=Math.cos(o.midA)>=0,w=p+o.ox+g*1.02*Math.cos(o.midA),r=u+o.oy+M*1.02*Math.sin(o.midA),H=u+o.oy+M*1.18*Math.sin(o.midA),dt=a.showPercent?`${o.data.name} ${(o.percent*100).toFixed(1)}%`:`${o.data.name}`,ft=!a.labelLineColor||a.labelLineColor==="auto"?a.glowColor||o.color:a.labelLineColor,ut={slice:o,text:dt,isRight:m,anchorX:w,anchorY:r,targetY:H,y:H,color:ft};(m?c:e).push(ut)}const A=o=>{if(!o.length)return;o.sort((r,H)=>r.targetY-H.targetY);const m=x+a.labelFontSize/2,w=_-x-a.labelFontSize/2;for(let r=0;r<o.length;r++)r===0?o[r].y=Math.max(m,o[r].targetY):o[r].y=Math.max(o[r].targetY,o[r-1].y+f);if(o[o.length-1].y>w){o[o.length-1].y=w;for(let r=o.length-2;r>=0;r--)o[r].y>o[r+1].y-f&&(o[r].y=o[r+1].y-f)}for(let r=0;r<o.length;r++)o[r].y<m&&(o[r].y=m)};A(e),A(c),t.lineWidth=a.labelLineWidth;const P=[...e,...c];for(const o of P){const m=t.measureText(o.text).width;let w;if(o.isRight){const r=Math.min(Math.max(o.anchorX+6,o.anchorX+Math.abs(o.targetY-o.y)*.2+6),k-x-m-y);w=r+y,t.strokeStyle=o.color,t.beginPath(),t.moveTo(o.anchorX,o.anchorY),t.lineTo(r,o.y),t.lineTo(w,o.y),t.stroke(),t.fillStyle=a.textColor,t.textAlign="left",t.fillText(o.text,w+2,o.y)}else{const r=Math.max(Math.min(o.anchorX-6,o.anchorX-Math.abs(o.targetY-o.y)*.2-6),x+m+y);w=r-y,t.strokeStyle=o.color,t.beginPath(),t.moveTo(o.anchorX,o.anchorY),t.lineTo(r,o.y),t.lineTo(w,o.y),t.stroke(),t.fillStyle=a.textColor,t.textAlign="right",t.fillText(o.text,w-2,o.y)}}}},et=(t,l)=>{for(let n=0;n<b.length;n++){const s=b[n],i=(t-p)/g,d=(l-u)/M;if(i*i+d*d>1)continue;let v=Math.atan2((l-u)/M,(t-p)/g);for(;v<s.startA;)v+=Math.PI*2;for(;v>s.startA+Math.PI*2;)v-=Math.PI*2;if(v>=s.startA&&v<=s.endA)return n}return-1},ot=t=>{const l=C.value,n=l.getBoundingClientRect(),s=n.width/(l.clientWidth||n.width)||1,i=n.height/(l.clientHeight||n.height)||1;return{mx:(t.clientX-n.left)/s,my:(t.clientY-n.top)/i}},ct=t=>{if(!C.value)return;const{mx:l,my:n}=ot(t),s=et(l,n);if(s!==D.value&&(D.value=s,b.forEach((i,d)=>i.hover=d===s),tt()),s>=0){const i=b[s];z.value=!0,R.value=i.data,O.value=i.percent;const d=E.value?.clientWidth||0,v=E.value?.clientHeight||0,e=Math.min(l+12,d-140),c=Math.min(n+12,v-60);J.value=Math.max(0,e),K.value=Math.max(0,c)}else z.value=!1,R.value=null},ht=()=>{D.value!==-1&&(D.value=-1,b.forEach(t=>t.hover=!1),tt()),z.value=!1,R.value=null},nt=t=>{if(!C.value)return;const{mx:l,my:n}=ot(t),s=et(l,n);s>=0&&lt("slice-click",b[s].data,s)};return h.watch(()=>S.data,()=>{Object.assign(a,V,S.config),q=S.animation,W()},{deep:!0}),h.watch(()=>S.config,()=>{Object.assign(a,V,S.config),W()},{deep:!0}),h.onMounted(()=>{W(),window.addEventListener("resize",W),C.value?.addEventListener("click",nt)}),h.onUnmounted(()=>{window.removeEventListener("resize",W),C.value?.removeEventListener("click",nt),F&&cancelAnimationFrame(F),I&&cancelAnimationFrame(I)}),(t,l)=>(h.openBlock(),h.createElementBlock("div",{class:"g-pie3d-container",ref_key:"containerRef",ref:E},[h.createElementVNode("canvas",{ref_key:"canvasRef",ref:C,onMousemove:ct,onMouseleave:ht},null,544),z.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"g-pie3d-tooltip",style:h.normalizeStyle({left:`${J.value}px`,top:`${K.value}px`})},[h.renderSlot(t.$slots,"tooltip",{data:R.value,percent:O.value},()=>[h.createElementVNode("div",vt,[h.createElementVNode("p",gt,h.toDisplayString(R.value?.name),1),h.createElementVNode("p",yt,h.toDisplayString(R.value?.value)+" ("+h.toDisplayString((O.value*100).toFixed(1))+"%) ",1)])],!0)],4)):h.createCommentVNode("",!0)],512))}}),B=pt._export_sfc(xt,[["__scopeId","data-v-d37c2ffe"]]);B.install=N=>{N.component(B.name,B)};exports.GPie3D=B;exports.default=B;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("vue"),pt=require("../GBranched-BtF7heMk.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,A=[],$=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=()=>{A=[];const t=S.data.reduce((n,s)=>n+(s.value||0),0);if(t<=0)return;let l=-Math.PI/2+Q(a.startAngle);S.data.forEach((n,s)=>{const i=n.value/t,d=i*Math.PI*2;A.push({data:n,index:s,color:n.color||a.colors[s%a.colors.length],startA:l,endA:l+d,midA:l+d/2,percent:i,hover:!1,hoverProgress:0}),l+=d})},st=()=>{$=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 A){const d=i.hover?1:0;if(i.hoverProgress===d)continue;const v=d>i.hoverProgress?1:-1;i.hoverProgress+=v*n,(v>0&&i.hoverProgress>=d||v<0&&i.hoverProgress<=d)&&(i.hoverProgress=d),i.hoverProgress!==d&&(s=!0)}U(),s?I=requestAnimationFrame(Z):(I=null,X=0)},tt=()=>{I==null&&(X=0,I=requestAnimationFrame(Z))},T=(t,l)=>{let n=t.replace("#","");n.length===3&&(n=n.split("").map(v=>v+v).join(""));const s=parseInt(n.slice(0,2),16),i=parseInt(n.slice(2,4),16),d=parseInt(n.slice(4,6),16);return`rgba(${s},${i},${d},${l})`},U=()=>{if(!L)return;const t=L;if(t.clearRect(0,0,k,_),!A.length)return;const l=A[0]?.startA??0,n=Math.PI*2*$,s=l+n,i=A.map(e=>{const c=e.startA,f=Math.min(e.endA,s),y=f>c,x=rt(Math.max(0,Math.min(1,e.hoverProgress))),b=Math.cos(e.midA)*a.hoverDistance*x,P=Math.sin(e.midA)*a.hoverDistance*x;return{...e,startA:c,endA:f,valid:y,ox:b,oy:P,hp:x}});if(a.showAura){const e=t.createRadialGradient(p,u+a.depth,g*.1,p,u+a.depth,g*1.5);e.addColorStop(0,"rgba(6,182,212,0.15)"),e.addColorStop(.4,"rgba(59,130,246,0.08)"),e.addColorStop(.8,"rgba(139,92,246,0.03)"),e.addColorStop(1,"rgba(0,0,0,0)"),t.beginPath(),t.ellipse(p,u+a.depth,g*1.5,M*.9,0,0,Math.PI*2),t.fillStyle=e,t.fill(),t.strokeStyle="rgba(56,189,248,0.08)",t.lineWidth=1;for(let c=3;c>=1;c--){const f=g*(.3+c*.25);t.beginPath(),t.ellipse(p,u+a.depth,f,f*(M/g),0,0,Math.PI*2),t.stroke()}}const d=(e,c)=>{const f=a.glowColor||e.color,y={x:p+e.ox,y:u+e.oy},x={x:y.x,y:y.y+a.depth},b=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(b.x,b.y),t.lineTo(P.x,P.y),t.lineTo(x.x,x.y),t.closePath(),t.fill(),t.strokeStyle=T(f,.8),t.lineWidth=.8,t.beginPath(),t.moveTo(b.x,b.y),t.lineTo(P.x,P.y),t.stroke()};for(const e of i)e.valid&&(Math.sin(e.startA)<=.001&&d(e,e.startA),Math.sin(e.endA)<=.001&&d(e,e.endA));const v=Math.PI/120;for(const e of i){if(!e.valid)continue;let c=e.startA;const f=a.glowColor||e.color;for(;c<e.endA;){const y=Math.min(c+v,e.endA),x=(c+y)/2;if(Math.sin(x)>0){const b=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(b.x,b.y),t.lineTo(P.x,P.y),t.lineTo(o.x,o.y),t.lineTo(m.x,m.y),t.closePath(),t.fill(),t.strokeStyle=T(f,.7),t.lineWidth=.8,t.beginPath(),t.moveTo(m.x,m.y),t.lineTo(o.x,o.y),t.stroke()}c=y}}for(const e of i)e.valid&&(Math.sin(e.startA)>.001&&d(e,e.startA),Math.sin(e.endA)>.001&&d(e,e.endA));for(const e of i){if(!e.valid)continue;const c=a.glowColor||e.color;e.hp>.01&&(t.save(),t.shadowColor=c,t.shadowBlur=12*e.hp,t.beginPath(),t.moveTo(p+e.ox,u+e.oy),t.ellipse(p+e.ox,u+e.oy,g,M,0,e.startA,e.endA),t.closePath(),t.fillStyle=T(c,.08*e.hp),t.fill(),t.restore()),t.beginPath(),t.moveTo(p+e.ox,u+e.oy),t.ellipse(p+e.ox,u+e.oy,g,M,0,e.startA,e.endA),t.closePath();const f=t.createRadialGradient(p+e.ox-g*.2,u+e.oy-M*.2,0,p+e.ox,u+e.oy,g*1.05);f.addColorStop(0,T(c,a.opacity*.95)),f.addColorStop(.6,T(c,a.opacity*.8)),f.addColorStop(1,T(c,a.opacity*.6)),t.fillStyle=f,t.fill(),t.strokeStyle=T(c,.95),t.lineWidth=.8+.6*e.hp,t.stroke()}if(a.showLabel&&$>=.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 b=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)};b(e),b(c),t.lineWidth=a.labelLineWidth;const P=[...e,...c];for(const o of P){const m=t.measureText(o.text).width;let w;if(o.isRight){const r=Math.min(Math.max(o.anchorX+6,o.anchorX+Math.abs(o.targetY-o.y)*.2+6),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<A.length;n++){const s=A[n],i=(t-p)/g,d=(l-u)/M;if(i*i+d*d>1)continue;let v=Math.atan2((l-u)/M,(t-p)/g);for(;v<s.startA;)v+=Math.PI*2;for(;v>s.startA+Math.PI*2;)v-=Math.PI*2;if(v>=s.startA&&v<=s.endA)return n}return-1},ot=t=>{const l=C.value,n=l.getBoundingClientRect(),s=n.width/(l.clientWidth||n.width)||1,i=n.height/(l.clientHeight||n.height)||1;return{mx:(t.clientX-n.left)/s,my:(t.clientY-n.top)/i}},ct=t=>{if(!C.value)return;const{mx:l,my:n}=ot(t),s=et(l,n);if(s!==D.value&&(D.value=s,A.forEach((i,d)=>i.hover=d===s),tt()),s>=0){const i=A[s];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,A.forEach(t=>t.hover=!1),tt()),z.value=!1,R.value=null},nt=t=>{if(!C.value)return;const{mx:l,my:n}=ot(t),s=et(l,n);s>=0&&lt("slice-click",A[s].data,s)};return h.watch(()=>S.data,()=>{Object.assign(a,V,S.config),q=S.animation,W()},{deep:!0}),h.watch(()=>S.config,()=>{Object.assign(a,V,S.config),W()},{deep:!0}),h.onMounted(()=>{W(),window.addEventListener("resize",W),C.value?.addEventListener("click",nt)}),h.onUnmounted(()=>{window.removeEventListener("resize",W),C.value?.removeEventListener("click",nt),F&&cancelAnimationFrame(F),I&&cancelAnimationFrame(I)}),(t,l)=>(h.openBlock(),h.createElementBlock("div",{class:"g-pie3d-container",ref_key:"containerRef",ref:E},[h.createElementVNode("canvas",{ref_key:"canvasRef",ref:C,onMousemove:ct,onMouseleave:ht},null,544),z.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"g-pie3d-tooltip",style:h.normalizeStyle({left:`${J.value}px`,top:`${K.value}px`})},[h.renderSlot(t.$slots,"tooltip",{data:R.value,percent:O.value},()=>[h.createElementVNode("div",vt,[h.createElementVNode("p",gt,h.toDisplayString(R.value?.name),1),h.createElementVNode("p",yt,h.toDisplayString(R.value?.value)+" ("+h.toDisplayString((O.value*100).toFixed(1))+"%) ",1)])],!0)],4)):h.createCommentVNode("",!0)],512))}}),B=pt._export_sfc(xt,[["__scopeId","data-v-d37c2ffe"]]);B.install=N=>{N.component(B.name,B)};exports.GPie3D=B;exports.default=B;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as xt, ref as C, watch as it, onMounted as Mt, onUnmounted as At, createElementBlock as st, openBlock as rt, createElementVNode as D, createCommentVNode as bt, normalizeStyle as Pt, renderSlot as wt, toDisplayString as J } from "vue";
2
- import { _ as St } from "../GBubble-C3cM9Put.mjs";
2
+ import { _ as St } from "../GBranched-vnLlYOl9.mjs";
3
3
  const Tt = { class: "g-pie3d-tooltip__default" }, Ct = { class: "g-pie3d-tooltip__name" }, _t = { class: "g-pie3d-tooltip__value" }, kt = 260, It = /* @__PURE__ */ xt({
4
4
  __name: "index",
5
5
  props: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),L=require("jsencrypt"),d=require("element-plus"),Y={id:"playWnd",class:"playWnd"},W=3,k=3e3,b="插件未启动,正在尝试启动,请稍候...",S="插件启动失败,请检查插件是否安装!",f={__name:"index",props:{isPlayVideo:{type:Boolean,default:!1},isFullScreen:{type:Boolean,default:!1},cameraIndexCode:{type:String,default:""},currentPlayType:{type:Number,default:0},baseUrl:{type:String,default:"http://92.97.137.81:48181"},basePath:{type:String,default:""},usefullData:{type:Object,default:()=>({appkey:"24460774",secret:"vphyI4pTqEVk4lT67jVe",ip:"61.27.16.15",port:443})},size:{type:Object,default:()=>({windowWidth:300,windowHeight:200})},isMulTip:{type:Boolean,default:!1},multipPointsArr:{type:Array,default:()=>[]},happenedTime:{type:String,default:""},isDoubleClickClose:{type:Boolean,default:!1}},emits:["closeVideoEmit"],setup(p,{expose:A,emit:E}){const n=p,B=E,a=l.ref(null),m=l.ref(0),C=l.ref(""),c=l.ref(""),g=l.ref("1x1"),h=l.ref(0),r=l.ref([]),w=l.ref(1),v=l.ref([]),M=l.ref(0);let T="/";try{T="/"}catch{}const q=()=>{const e=n.basePath||T;return e.endsWith("/")?e:`${e}/`};let y=null;function V(){return window.WebControl?Promise.resolve():(y||(y=import(`${q()}web-control.esm.min.js`).then(e=>{window.WebControl=e.WebControl}).catch(e=>{throw y=null,console.error("web-control.esm.min.js加载失败",e),new Error("加载web-control.esm.min.js失败")})),y)}function _(e){const t=new Date(Number(e));return t.setMinutes(t.getMinutes()-1),t.getTime()}function I(e){const t=new Date(Number(e));return t.setMinutes(t.getMinutes()+1),t.getTime()}function J(e,t){const o=[];for(let s=0;s<e.length;s+=t)o.push(e.slice(s,s+t));return o}function O(e){const t=new L;return t.setPublicKey(C.value),t.encrypt(e)}function u(e){B("closeVideoEmit",e),a.value!==null&&(a.value.JS_RequestInterface({funcName:"stopAllPreview"}),a.value.JS_HideWnd(),a.value.JS_Disconnect().then(()=>{},()=>{}))}function z(){a.value&&(a.value.JS_RequestInterface({funcName:"stopAllPreview"}),a.value.JS_HideWnd(),a.value.JS_RequestInterface({funcName:"destroyWnd"}))}function F(e){a.value.JS_RequestInterface({funcName:"getRSAPubKey",argument:JSON.stringify({keyLength:1024})}).then(t=>{t.responseMsg.data&&(C.value=t.responseMsg.data,e())})}function N(){let e=n.cameraIndexCode.trim();a.value.JS_RequestInterface({funcName:"startPreview",argument:JSON.stringify({cameraIndexCode:e,streamMode:0,transMode:1,gpuMode:0,wndId:-1})})}function D(){let e=n.cameraIndexCode,t="",o="";n.happenedTime?(t=_(n.happenedTime),o=I(n.happenedTime)):(t=Date.now()-1440*60*1e3,o=Date.now()),a.value.JS_RequestInterface({funcName:"startPlayback",argument:JSON.stringify({cameraIndexCode:e,startTimeStamp:Math.floor(t/1e3).toString(),endTimeStamp:Math.floor(o/1e3).toString(),recordLocation:1,transMode:1,gpuMode:0,wndId:-1})})}function R(){const e=v.value.map((t,o)=>({cameraIndexCode:t.indexCode.trim(),gpuMode:0,streamMode:0,transMode:1,wndId:o+1}));a.value.JS_RequestInterface({funcName:"startMultiPreviewByCameraIndexCode",argument:JSON.stringify({list:e})})}function P(){let e="",t="";n.happenedTime?(e=_(n.happenedTime),t=I(n.happenedTime)):(e=Date.now()-1440*60*1e3,t=Date.now());const o=v.value.map((s,K)=>({startTimeStamp:Math.floor(e/1e3).toString(),endTimeStamp:Math.floor(t/1e3).toString(),cameraIndexCode:s.indexCode.trim(),gpuMode:0,streamMode:0,transMode:1,wndId:K+1}));a.value.JS_RequestInterface({funcName:"startMultiPlaybackByCameraIndexCode",argument:JSON.stringify({list:o})})}function H(){F(()=>{a.value.JS_RequestInterface({funcName:"init",argument:JSON.stringify({appkey:n.usefullData.appkey,secret:O(n.usefullData.secret),ip:n.usefullData.ip,playMode:n.currentPlayType,port:n.usefullData.port,snapDir:"D:\\SnapDir",videoDir:"D:\\VideoDir",layout:g.value,enableHTTPS:1,encryptedFields:"secret",showToolbar:1,showSmart:0,buttonIDs:"0,256,257,258,259,260,512,513,514,515,516,517,768,769"})}).then(()=>{a.value.JS_Resize(n.size.windowWidth,n.size.windowHeight),n.isMulTip?n.currentPlayType===1?P():R():n.currentPlayType===1?D():N()}),n.isFullScreen&&a.value.JS_RequestInterface({funcName:"setFullScreen"})})}function j(e){const{responseMsg:t}=e;t.type===6&&(h.value=n.multipPointsArr.length,w.value=1,r.value=n.multipPointsArr,g.value=t.msg.layout,M.value=t.msg.wndNum,r.value=J(r.value,t.msg.wndNum),v.value=[...r.value[w.value-1]],a.value.JS_Disconnect().then(()=>{i()},()=>{})),t.type===7&&n.isDoubleClickClose&&u("doubleClick")}function i(){a.value=new window.WebControl({szPluginContainer:"playWnd",iServicePortStart:15900,iServicePortEnd:15900,szClassId:"23BF3B0A-2C56-4D97-9C03-0CB103AA8F11",cbConnectSuccess:()=>{a.value.JS_StartService("window",{dllPath:"./VideoPluginConnect.dll"}).then(()=>{a.value.JS_SetWindowControlCallback({cbIntegrationCallBack:j}),a.value.JS_CreateWnd("playWnd",n.size.windowWidth,n.size.windowHeight).then(()=>{H()})})},cbConnectError:()=>{a.value=null,d.ElMessage.error(b),c.value=b,window.WebControl.JS_WakeUp("VideoWebPlugin://"),m.value++,m.value<W?setTimeout(()=>i(),k):(d.ElMessage.error(S),c.value=S)},cbConnectClose:e=>{e||(a.value=null,c.value=b,m.value++,m.value<W?setTimeout(()=>i(),k):(d.ElMessage.error(S),c.value=S))}})}function x(){d.ElMessageBox.alert("播放视频需要下载插件","提示",{confirmButtonText:"下载插件",cancelButtonText:"取消",type:"info",showCancelButton:!0}).then(()=>{U(),d.ElMessage({type:"success",message:"下载插件成功"})}).catch(()=>{u()})}function U(){try{const e=n.baseUrl+"static/VideoWebPlugin.exe",t=document.createElement("a");t.href=e,t.download="VideoWebPlugin.exe",t.style.display="none",document.body.appendChild(t),t.click(),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),u()},100)}catch{u()}}function G(){n.isMulTip&&(M.value=4,h.value=n.multipPointsArr.length,g.value=h.value<=1?"1x1":"2x2",r.value=J(n.multipPointsArr,4),v.value=[...r.value[w.value-1]])}return l.watch(()=>n.isPlayVideo,e=>{e===!0&&i(),e===!1&&u()}),l.watch(()=>n.happenedTime,()=>{P()}),l.watch(()=>n.cameraIndexCode,(e,t)=>{e!==t&&(z(),a.value.JS_Disconnect().then(()=>{i()},()=>{}))}),l.watch(c,e=>{e!==""&&x()}),l.onMounted(()=>{G(),V().then(()=>{n.isPlayVideo&&i()}).catch(()=>{x()})}),l.onBeforeUnmount(()=>{a.value&&(a.value.JS_RequestInterface({funcName:"stopAllPreview"}),a.value.JS_HideWnd(),a.value.JS_RequestInterface({funcName:"destroyWnd"}))}),A({closeVideo:u,initPlugin:i,startPlay:N,startPlayback:D,startMultiPreview:R,startMultiPlayback:P}),(e,t)=>l.withDirectives((l.openBlock(),l.createElementBlock("div",Y,null,512)),[[l.vShow,!p.isFullScreen]])}};f.install=p=>{p.component(f.name,f)};exports.GPluginVideo=f;exports.default=f;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),K=require("jsencrypt"),d=require("../GToast/index.js"),Y={id:"playWnd",class:"playWnd"},x=3,A=3e3,b="插件未启动,正在尝试启动,请稍候...",S="插件启动失败,请检查插件是否安装!",p={__name:"index",props:{isPlayVideo:{type:Boolean,default:!1},isFullScreen:{type:Boolean,default:!1},cameraIndexCode:{type:String,default:""},currentPlayType:{type:Number,default:0},baseUrl:{type:String,default:"http://92.97.137.81:48181"},basePath:{type:String,default:""},usefullData:{type:Object,default:()=>({appkey:"24460774",secret:"vphyI4pTqEVk4lT67jVe",ip:"61.27.16.15",port:443})},size:{type:Object,default:()=>({windowWidth:300,windowHeight:200})},isMulTip:{type:Boolean,default:!1},multipPointsArr:{type:Array,default:()=>[]},happenedTime:{type:String,default:""},isDoubleClickClose:{type:Boolean,default:!1}},emits:["closeVideoEmit"],setup(f,{expose:k,emit:q}){const n=f,E=q,a=o.ref(null),m=o.ref(0),C=o.ref(""),c=o.ref(""),g=o.ref("1x1"),h=o.ref(0),r=o.ref([]),w=o.ref(1),v=o.ref([]),T=o.ref(0);let M="/";try{M="/"}catch{}const B=()=>{const e=n.basePath||M;return e.endsWith("/")?e:`${e}/`};let y=null;function V(){return window.WebControl?Promise.resolve():(y||(y=import(`${B()}web-control.esm.min.js`).then(e=>{window.WebControl=e.WebControl}).catch(e=>{throw y=null,console.error("web-control.esm.min.js加载失败",e),new Error("加载web-control.esm.min.js失败")})),y)}function _(e){const t=new Date(Number(e));return t.setMinutes(t.getMinutes()-1),t.getTime()}function I(e){const t=new Date(Number(e));return t.setMinutes(t.getMinutes()+1),t.getTime()}function J(e,t){const i=[];for(let s=0;s<e.length;s+=t)i.push(e.slice(s,s+t));return i}function O(e){const t=new K;return t.setPublicKey(C.value),t.encrypt(e)}function u(e){E("closeVideoEmit",e),a.value!==null&&(a.value.JS_RequestInterface({funcName:"stopAllPreview"}),a.value.JS_HideWnd(),a.value.JS_Disconnect().then(()=>{},()=>{}))}function z(){a.value&&(a.value.JS_RequestInterface({funcName:"stopAllPreview"}),a.value.JS_HideWnd(),a.value.JS_RequestInterface({funcName:"destroyWnd"}))}function F(e){a.value.JS_RequestInterface({funcName:"getRSAPubKey",argument:JSON.stringify({keyLength:1024})}).then(t=>{t.responseMsg.data&&(C.value=t.responseMsg.data,e())})}function D(){let e=n.cameraIndexCode.trim();a.value.JS_RequestInterface({funcName:"startPreview",argument:JSON.stringify({cameraIndexCode:e,streamMode:0,transMode:1,gpuMode:0,wndId:-1})})}function N(){let e=n.cameraIndexCode,t="",i="";n.happenedTime?(t=_(n.happenedTime),i=I(n.happenedTime)):(t=Date.now()-1440*60*1e3,i=Date.now()),a.value.JS_RequestInterface({funcName:"startPlayback",argument:JSON.stringify({cameraIndexCode:e,startTimeStamp:Math.floor(t/1e3).toString(),endTimeStamp:Math.floor(i/1e3).toString(),recordLocation:1,transMode:1,gpuMode:0,wndId:-1})})}function R(){const e=v.value.map((t,i)=>({cameraIndexCode:t.indexCode.trim(),gpuMode:0,streamMode:0,transMode:1,wndId:i+1}));a.value.JS_RequestInterface({funcName:"startMultiPreviewByCameraIndexCode",argument:JSON.stringify({list:e})})}function P(){let e="",t="";n.happenedTime?(e=_(n.happenedTime),t=I(n.happenedTime)):(e=Date.now()-1440*60*1e3,t=Date.now());const i=v.value.map((s,U)=>({startTimeStamp:Math.floor(e/1e3).toString(),endTimeStamp:Math.floor(t/1e3).toString(),cameraIndexCode:s.indexCode.trim(),gpuMode:0,streamMode:0,transMode:1,wndId:U+1}));a.value.JS_RequestInterface({funcName:"startMultiPlaybackByCameraIndexCode",argument:JSON.stringify({list:i})})}function H(){F(()=>{a.value.JS_RequestInterface({funcName:"init",argument:JSON.stringify({appkey:n.usefullData.appkey,secret:O(n.usefullData.secret),ip:n.usefullData.ip,playMode:n.currentPlayType,port:n.usefullData.port,snapDir:"D:\\SnapDir",videoDir:"D:\\VideoDir",layout:g.value,enableHTTPS:1,encryptedFields:"secret",showToolbar:1,showSmart:0,buttonIDs:"0,256,257,258,259,260,512,513,514,515,516,517,768,769"})}).then(()=>{a.value.JS_Resize(n.size.windowWidth,n.size.windowHeight),n.isMulTip?n.currentPlayType===1?P():R():n.currentPlayType===1?N():D()}),n.isFullScreen&&a.value.JS_RequestInterface({funcName:"setFullScreen"})})}function j(e){const{responseMsg:t}=e;t.type===6&&(h.value=n.multipPointsArr.length,w.value=1,r.value=n.multipPointsArr,g.value=t.msg.layout,T.value=t.msg.wndNum,r.value=J(r.value,t.msg.wndNum),v.value=[...r.value[w.value-1]],a.value.JS_Disconnect().then(()=>{l()},()=>{})),t.type===7&&n.isDoubleClickClose&&u("doubleClick")}function l(){a.value=new window.WebControl({szPluginContainer:"playWnd",iServicePortStart:15900,iServicePortEnd:15900,szClassId:"23BF3B0A-2C56-4D97-9C03-0CB103AA8F11",cbConnectSuccess:()=>{a.value.JS_StartService("window",{dllPath:"./VideoPluginConnect.dll"}).then(()=>{a.value.JS_SetWindowControlCallback({cbIntegrationCallBack:j}),a.value.JS_CreateWnd("playWnd",n.size.windowWidth,n.size.windowHeight).then(()=>{H()})})},cbConnectError:()=>{a.value=null,d.toast.danger(b,{position:"top-center"}),c.value=b,window.WebControl.JS_WakeUp("VideoWebPlugin://"),m.value++,m.value<x?setTimeout(()=>l(),A):(d.toast.danger(S,{position:"top-center"}),c.value=S)},cbConnectClose:e=>{e||(a.value=null,c.value=b,m.value++,m.value<x?setTimeout(()=>l(),A):(d.toast.danger(S,{position:"top-center"}),c.value=S))}})}function W(){d.toast("播放视频需要下载插件",{position:"top-center",actionLabel:"下载插件",duration:0,onAction:()=>{G(),d.toast.success("下载插件成功",{position:"top-center"})},onDismiss:()=>u()})}function G(){try{const e=n.baseUrl+"static/VideoWebPlugin.exe",t=document.createElement("a");t.href=e,t.download="VideoWebPlugin.exe",t.style.display="none",document.body.appendChild(t),t.click(),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),u()},100)}catch{u()}}function L(){n.isMulTip&&(T.value=4,h.value=n.multipPointsArr.length,g.value=h.value<=1?"1x1":"2x2",r.value=J(n.multipPointsArr,4),v.value=[...r.value[w.value-1]])}return o.watch(()=>n.isPlayVideo,e=>{e===!0&&l(),e===!1&&u()}),o.watch(()=>n.happenedTime,()=>{P()}),o.watch(()=>n.cameraIndexCode,(e,t)=>{e!==t&&(z(),a.value.JS_Disconnect().then(()=>{l()},()=>{}))}),o.watch(c,e=>{e!==""&&W()}),o.onMounted(()=>{L(),V().then(()=>{n.isPlayVideo&&l()}).catch(()=>{W()})}),o.onBeforeUnmount(()=>{a.value&&(a.value.JS_RequestInterface({funcName:"stopAllPreview"}),a.value.JS_HideWnd(),a.value.JS_RequestInterface({funcName:"destroyWnd"}))}),k({closeVideo:u,initPlugin:l,startPlay:D,startPlayback:N,startMultiPreview:R,startMultiPlayback:P}),(e,t)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",Y,null,512)),[[o.vShow,!f.isFullScreen]])}};p.install=f=>{f.component(p.name,p)};exports.GPluginVideo=p;exports.default=p;