rtcpts 0.0.28 → 0.0.30

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 (46) hide show
  1. package/dist/{charts-D_0khFg_.js → charts-DFjKd2J4.js} +264 -214
  2. package/dist/charts-DpNGi6Y4.cjs +1 -0
  3. package/dist/charts.cjs.js +1 -1
  4. package/dist/charts.es.js +1 -1
  5. package/dist/components/j-c-editable-proxy/index.d.ts +9 -8
  6. package/dist/components/j-c-list-editor/index.d.ts +5 -4
  7. package/dist/components/j-c-nested-select/NestedMenuItem.d.ts +51 -0
  8. package/dist/components/j-c-nested-select/index.d.ts +199 -0
  9. package/dist/components/j-c-nested-select/types.d.ts +27 -0
  10. package/dist/components/j-c-table/index.d.ts +5 -4
  11. package/dist/components/j-c-tooltip/index.d.ts +5 -5
  12. package/dist/components/j-c-tooltip/types.d.ts +125 -7
  13. package/dist/components/j-c-tooltip-ellipsis/index.d.ts +7 -7
  14. package/dist/components/j-c-tree-select/index.d.ts +13 -12
  15. package/dist/components/j-ch-bar/index.d.ts +11 -0
  16. package/dist/components/j-ch-bar/types.d.ts +42 -0
  17. package/dist/components/j-ch-bar-line/index.d.ts +11 -0
  18. package/dist/components/j-ch-bar-line/types.d.ts +42 -0
  19. package/dist/components/j-ch-bubble/index.d.ts +11 -0
  20. package/dist/components/j-ch-bubble/types.d.ts +51 -0
  21. package/dist/components/j-ch-line/index.d.ts +11 -0
  22. package/dist/components/j-ch-line/types.d.ts +42 -0
  23. package/dist/components/j-ch-pie-doughnut/index.d.ts +11 -0
  24. package/dist/components/j-ch-pie-doughnut/types.d.ts +55 -0
  25. package/dist/components/j-ch-radar/index.d.ts +11 -0
  26. package/dist/components/j-ch-radar/types.d.ts +42 -0
  27. package/dist/components/j-q-autocomplete/index.d.ts +5 -4
  28. package/dist/components/j-q-button/index.d.ts +9 -9
  29. package/dist/components/j-q-confirm/index.d.ts +9 -8
  30. package/dist/components/j-q-confirm-dialog/index.d.ts +0 -321
  31. package/dist/components/j-q-detail-list/index.d.ts +11 -10
  32. package/dist/components/j-q-form-label/index.d.ts +5 -4
  33. package/dist/components/j-q-message/index.d.ts +1 -1
  34. package/dist/components/j-q-option-group/index.d.ts +5 -4
  35. package/dist/components/j-q-search-form/index.d.ts +9 -8
  36. package/dist/components/j-q-table/index.d.ts +5 -4
  37. package/dist/components/j-q-table/pagination.d.ts +19 -20
  38. package/dist/global.d.ts +74 -4
  39. package/dist/index.css +1 -1
  40. package/dist/index.d.ts +3 -1
  41. package/dist/rtcpt-styles.css +1 -1
  42. package/dist/rtcpt.cjs.js +1 -1
  43. package/dist/rtcpt.es.js +2405 -2112
  44. package/dist/utils/chart.d.ts +28 -0
  45. package/package.json +1 -1
  46. package/dist/charts-B7LwnjcQ.cjs +0 -1
@@ -1,11 +1,31 @@
1
- import { defineComponent as b, ref as f, onMounted as g, watch as m, createElementBlock as C, openBlock as x, createElementVNode as y, normalizeStyle as v } from "vue";
2
- import { Chart as k } from "chart.js/auto";
3
- const $ = (t, o) => {
4
- const n = t.__vccOpts || t;
5
- for (const [l, d] of o)
6
- n[l] = d;
7
- return n;
8
- }, A = b({
1
+ import { defineComponent as g, ref as f, onMounted as m, watch as C, createElementBlock as x, openBlock as v, createElementVNode as y, normalizeStyle as k } from "vue";
2
+ import { Chart as $ } from "chart.js/auto";
3
+ const O = (e, s) => {
4
+ const a = e.__vccOpts || e;
5
+ for (const [l, o] of s)
6
+ a[l] = o;
7
+ return a;
8
+ };
9
+ function T(e) {
10
+ return Object.prototype.toString.call(e) === "[object Object]";
11
+ }
12
+ function h(e, s) {
13
+ if (!s)
14
+ return { ...e };
15
+ const a = { ...e };
16
+ for (const l of Object.keys(s)) {
17
+ const o = s[l], c = e[l];
18
+ if (o !== void 0) {
19
+ if (o === null) {
20
+ a[l] = null;
21
+ continue;
22
+ }
23
+ T(c) && T(o) ? a[l] = h(c, o) : a[l] = o;
24
+ }
25
+ }
26
+ return a;
27
+ }
28
+ const q = g({
9
29
  name: "JChBar",
10
30
  props: {
11
31
  labels: {
@@ -17,53 +37,58 @@ const $ = (t, o) => {
17
37
  type: Array,
18
38
  required: !0
19
39
  },
40
+ options: {
41
+ type: Object,
42
+ default: () => ({}),
43
+ required: !1
44
+ },
20
45
  height: {
21
46
  type: Number,
22
47
  default: 300
23
48
  }
24
49
  },
25
- setup(t) {
26
- const o = f(null), n = f(null);
50
+ setup(e) {
51
+ const s = f(null), a = f(null);
27
52
  let l = null;
28
- const d = (s) => {
29
- let e = s.querySelector("div.chartjs-tooltip");
30
- return e || (e = document.createElement("div"), e.className = "chartjs-tooltip", e.style.background = "#ffffff", e.style.borderRadius = "8px", e.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.15)", e.style.color = "#323232", e.style.opacity = "0", e.style.pointerEvents = "none", e.style.position = "absolute", e.style.transform = "translate(-50%, 0)", e.style.transition = "all .1s ease", e.style.padding = "8px 10px", e.style.font = "12px Open Sans, sans-serif", s.appendChild(e)), e;
31
- }, c = (s) => {
32
- const { chart: e, tooltip: r } = s, i = n.value;
33
- if (!i) return;
34
- const a = d(i);
53
+ const o = (i) => {
54
+ let t = i.querySelector("div.chartjs-tooltip");
55
+ return t || (t = document.createElement("div"), t.className = "chartjs-tooltip", t.style.background = "#ffffff", t.style.borderRadius = "8px", t.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.15)", t.style.color = "#323232", t.style.opacity = "0", t.style.pointerEvents = "none", t.style.position = "absolute", t.style.transform = "translate(-50%, 0)", t.style.transition = "all .1s ease", t.style.padding = "8px 10px", t.style.font = "12px Open Sans, sans-serif", i.appendChild(t)), t;
56
+ }, c = (i) => {
57
+ const { chart: t, tooltip: r } = i, d = a.value;
58
+ if (!d) return;
59
+ const n = o(d);
35
60
  if (r.opacity === 0) {
36
- a.style.opacity = "0";
61
+ n.style.opacity = "0";
37
62
  return;
38
63
  }
39
64
  if (r.body) {
40
- const _ = r.title || [], O = r.body.map((p) => p.lines);
41
- if (a.innerHTML = "", _.length) {
42
- const p = document.createElement("div");
43
- p.style.fontWeight = "600", p.style.marginBottom = "4px", p.textContent = _.join(" "), a.appendChild(p);
65
+ const _ = r.title || [], A = r.body.map((u) => u.lines);
66
+ if (n.innerHTML = "", _.length) {
67
+ const u = document.createElement("div");
68
+ u.style.fontWeight = "600", u.style.marginBottom = "4px", u.textContent = _.join(" "), n.appendChild(u);
44
69
  }
45
- O.forEach((p) => {
70
+ A.forEach((u) => {
46
71
  const w = document.createElement("div");
47
- w.textContent = p.join(" "), a.appendChild(w);
72
+ w.textContent = u.join(" "), n.appendChild(w);
48
73
  });
49
74
  }
50
- const { offsetLeft: h, offsetTop: S } = e.canvas;
51
- a.style.opacity = "1", a.style.left = `${h + r.caretX}px`, a.style.top = `${S + r.caretY}px`;
52
- }, u = () => {
53
- var i;
75
+ const { offsetLeft: b, offsetTop: S } = t.canvas;
76
+ n.style.opacity = "1", n.style.left = `${b + r.caretX}px`, n.style.top = `${S + r.caretY}px`;
77
+ }, p = () => {
78
+ var d;
54
79
  l && l.destroy();
55
- const s = (i = o.value) == null ? void 0 : i.getContext("2d");
56
- if (!s) return;
57
- const e = {
58
- labels: t.labels,
59
- datasets: t.datasets.map((a) => ({
60
- ...a,
80
+ const i = (d = s.value) == null ? void 0 : d.getContext("2d");
81
+ if (!i) return;
82
+ const t = {
83
+ labels: e.labels,
84
+ datasets: e.datasets.map((n) => ({
85
+ ...n,
61
86
  type: "bar",
62
- borderWidth: a.borderWidth ?? 0,
63
- borderRadius: a.borderRadius ?? 4,
64
- maxBarThickness: a.maxBarThickness ?? 34,
87
+ borderWidth: n.borderWidth ?? 0,
88
+ borderRadius: n.borderRadius ?? 4,
89
+ maxBarThickness: n.maxBarThickness ?? 34,
65
90
  // 确保填充色使用传入的颜色,而不是渐变色
66
- backgroundColor: a.backgroundColor || "#3A416F"
91
+ backgroundColor: n.backgroundColor || "#3A416F"
67
92
  }))
68
93
  }, r = {
69
94
  responsive: !0,
@@ -123,40 +148,40 @@ const $ = (t, o) => {
123
148
  }
124
149
  }
125
150
  };
126
- l = new k(s, {
151
+ l = new $(i, {
127
152
  type: "bar",
128
- data: e,
129
- options: r
153
+ data: t,
154
+ options: h(r, e.options)
130
155
  });
131
156
  };
132
- return g(() => {
133
- u();
134
- }), m(
135
- [() => t.labels, () => t.datasets, () => t.height],
157
+ return m(() => {
158
+ p();
159
+ }), C(
160
+ [() => e.labels, () => e.datasets, () => e.height],
136
161
  () => {
137
- u();
162
+ p();
138
163
  },
139
164
  { deep: !0 }
140
165
  ), {
141
- barChartCanvas: o,
142
- chartContainer: n
166
+ barChartCanvas: s,
167
+ chartContainer: a
143
168
  };
144
169
  }
145
- }), T = {
170
+ }), H = {
146
171
  ref: "chartContainer",
147
172
  style: { position: "relative" }
148
173
  };
149
- function H(t, o, n, l, d, c) {
150
- return x(), C("div", T, [
174
+ function j(e, s, a, l, o, c) {
175
+ return v(), x("div", H, [
151
176
  y("div", null, [
152
177
  y("canvas", {
153
178
  ref: "barChartCanvas",
154
- style: v([{ width: "100%" }, { height: t.height + "px", maxHeight: t.height + "px" }])
179
+ style: k([{ width: "100%" }, { height: e.height + "px", maxHeight: e.height + "px" }])
155
180
  }, null, 4)
156
181
  ])
157
182
  ], 512);
158
183
  }
159
- const X = /* @__PURE__ */ $(A, [["render", H], ["__scopeId", "data-v-63c1cbe6"]]), E = b({
184
+ const Z = /* @__PURE__ */ O(q, [["render", j], ["__scopeId", "data-v-ab70454a"]]), E = g({
160
185
  name: "JChBarLine",
161
186
  props: {
162
187
  labels: {
@@ -168,24 +193,29 @@ const X = /* @__PURE__ */ $(A, [["render", H], ["__scopeId", "data-v-63c1cbe6"]]
168
193
  type: Array,
169
194
  required: !0
170
195
  },
196
+ options: {
197
+ type: Object,
198
+ default: () => ({}),
199
+ required: !1
200
+ },
171
201
  height: {
172
202
  type: Number,
173
203
  default: 300
174
204
  // 默认高度 300px
175
205
  }
176
206
  },
177
- setup(t) {
178
- const o = f(null);
179
- let n = null;
207
+ setup(e) {
208
+ const s = f(null);
209
+ let a = null;
180
210
  const l = () => {
181
- var e;
182
- n && n.destroy();
183
- const d = (e = o.value) == null ? void 0 : e.getContext("2d");
184
- if (!d) return;
185
- const c = t.datasets.map((r) => {
186
- let i = {};
187
- const a = r.type === "line" ? "line" : "bar";
188
- return r.type === "line" ? i = {
211
+ var t;
212
+ a && a.destroy();
213
+ const o = (t = s.value) == null ? void 0 : t.getContext("2d");
214
+ if (!o) return;
215
+ const c = e.datasets.map((r) => {
216
+ let d = {};
217
+ const n = r.type === "line" ? "line" : "bar";
218
+ return r.type === "line" ? d = {
189
219
  type: "line",
190
220
  tension: 0.4,
191
221
  pointRadius: 0,
@@ -194,7 +224,7 @@ const X = /* @__PURE__ */ $(A, [["render", H], ["__scopeId", "data-v-63c1cbe6"]]
194
224
  // 关键:取消填充
195
225
  backgroundColor: "transparent",
196
226
  maxBarThickness: void 0
197
- } : r.type === "bar" && (i = {
227
+ } : r.type === "bar" && (d = {
198
228
  type: "bar",
199
229
  borderWidth: 0,
200
230
  borderRadius: 4,
@@ -203,14 +233,14 @@ const X = /* @__PURE__ */ $(A, [["render", H], ["__scopeId", "data-v-63c1cbe6"]]
203
233
  maxBarThickness: 34,
204
234
  backgroundColor: r.backgroundColor
205
235
  }), {
206
- type: a,
236
+ type: n,
207
237
  ...r,
208
- ...i
238
+ ...d
209
239
  };
210
- }), u = {
211
- labels: t.labels,
240
+ }), p = {
241
+ labels: e.labels,
212
242
  datasets: c
213
- }, s = {
243
+ }, i = {
214
244
  responsive: !0,
215
245
  maintainAspectRatio: !1,
216
246
  plugins: {
@@ -272,41 +302,41 @@ const X = /* @__PURE__ */ $(A, [["render", H], ["__scopeId", "data-v-63c1cbe6"]]
272
302
  color: "#969799",
273
303
  padding: 10,
274
304
  font: { size: 11, family: "Open Sans", style: "normal", lineHeight: 2 },
275
- callback: (r, i) => {
276
- const a = t.labels[i];
277
- return a && a.length > 13 ? `${a.slice(0, 13)}...` : a;
305
+ callback: (r, d) => {
306
+ const n = e.labels[d];
307
+ return n && n.length > 13 ? `${n.slice(0, 13)}...` : n;
278
308
  }
279
309
  }
280
310
  }
281
311
  }
282
312
  };
283
- n = new k(d, {
284
- data: u,
285
- options: s
313
+ a = new $(o, {
314
+ data: p,
315
+ options: h(i, e.options)
286
316
  });
287
317
  };
288
- return g(() => {
318
+ return m(() => {
289
319
  l();
290
- }), m(
291
- [() => t.labels, () => t.datasets, () => t.height],
320
+ }), C(
321
+ [() => e.labels, () => e.datasets, () => e.height],
292
322
  () => {
293
323
  l();
294
324
  },
295
325
  { deep: !0 }
296
326
  ), {
297
- mixedChartCanvas: o
327
+ mixedChartCanvas: s
298
328
  };
299
329
  }
300
330
  });
301
- function q(t, o, n, l, d, c) {
302
- return x(), C("div", null, [
331
+ function W(e, s, a, l, o, c) {
332
+ return v(), x("div", null, [
303
333
  y("canvas", {
304
334
  ref: "mixedChartCanvas",
305
- style: v([{ width: "100%" }, { height: t.height + "px", maxHeight: t.height + "px" }])
335
+ style: k([{ width: "100%" }, { height: e.height + "px", maxHeight: e.height + "px" }])
306
336
  }, null, 4)
307
337
  ]);
308
338
  }
309
- const Y = /* @__PURE__ */ $(E, [["render", q]]), W = b({
339
+ const M = /* @__PURE__ */ O(E, [["render", W]]), z = g({
310
340
  name: "JChBubble",
311
341
  props: {
312
342
  labels: {
@@ -318,27 +348,32 @@ const Y = /* @__PURE__ */ $(E, [["render", q]]), W = b({
318
348
  type: Array,
319
349
  required: !0
320
350
  },
351
+ options: {
352
+ type: Object,
353
+ default: () => ({}),
354
+ required: !1
355
+ },
321
356
  height: {
322
357
  type: Number,
323
358
  default: 300
324
359
  }
325
360
  },
326
- setup(t) {
327
- const o = f(null);
328
- let n = null;
361
+ setup(e) {
362
+ const s = f(null);
363
+ let a = null;
329
364
  const l = () => {
330
- var s;
331
- n && n.destroy();
332
- const d = (s = o.value) == null ? void 0 : s.getContext("2d");
333
- if (!d) return;
365
+ var i;
366
+ a && a.destroy();
367
+ const o = (i = s.value) == null ? void 0 : i.getContext("2d");
368
+ if (!o) return;
334
369
  const c = {
335
- labels: t.labels,
336
- datasets: t.datasets.map((e) => ({
337
- ...e,
370
+ labels: e.labels,
371
+ datasets: e.datasets.map((t) => ({
372
+ ...t,
338
373
  // 确保类型正确,并设置透明度
339
- backgroundColor: e.backgroundColor || "rgba(54, 162, 235, 0.6)"
374
+ backgroundColor: t.backgroundColor || "rgba(54, 162, 235, 0.6)"
340
375
  }))
341
- }, u = {
376
+ }, p = {
342
377
  responsive: !0,
343
378
  maintainAspectRatio: !1,
344
379
  plugins: {
@@ -361,7 +396,7 @@ const Y = /* @__PURE__ */ $(E, [["render", q]]), W = b({
361
396
  borderColor: "#eeeeee",
362
397
  padding: 12,
363
398
  callbacks: {
364
- label: (e) => `${e.dataset.label || ""}: ${e.formattedValue}`
399
+ label: (t) => `${t.dataset.label || ""}: ${t.formattedValue}`
365
400
  }
366
401
  }
367
402
  },
@@ -386,42 +421,42 @@ const Y = /* @__PURE__ */ $(E, [["render", q]]), W = b({
386
421
  color: "#969799",
387
422
  padding: 10,
388
423
  font: { size: 11, family: "Open Sans", style: "normal", lineHeight: 2 },
389
- callback: (e, r) => {
390
- const i = t.labels[r];
391
- return i ? typeof i == "string" && i.length > 13 ? `${i.slice(0, 13)}...` : i : e;
424
+ callback: (t, r) => {
425
+ const d = e.labels[r];
426
+ return d ? typeof d == "string" && d.length > 13 ? `${d.slice(0, 13)}...` : d : t;
392
427
  }
393
428
  }
394
429
  }
395
430
  }
396
431
  };
397
- n = new k(d, {
432
+ a = new $(o, {
398
433
  type: "bubble",
399
434
  data: c,
400
- options: u
435
+ options: h(p, e.options)
401
436
  });
402
437
  };
403
- return g(() => {
438
+ return m(() => {
404
439
  l();
405
- }), m(
406
- [() => t.labels, () => t.datasets, () => t.height],
440
+ }), C(
441
+ [() => e.labels, () => e.datasets, () => e.height],
407
442
  () => {
408
443
  l();
409
444
  },
410
445
  { deep: !0 }
411
446
  ), {
412
- bubbleChartCanvas: o
447
+ bubbleChartCanvas: s
413
448
  };
414
449
  }
415
450
  });
416
- function z(t, o, n, l, d, c) {
417
- return x(), C("div", null, [
451
+ function R(e, s, a, l, o, c) {
452
+ return v(), x("div", null, [
418
453
  y("canvas", {
419
454
  ref: "bubbleChartCanvas",
420
- style: v([{ width: "100%" }, { height: t.height + "px", maxHeight: t.height + "px" }])
455
+ style: k([{ width: "100%" }, { height: e.height + "px", maxHeight: e.height + "px" }])
421
456
  }, null, 4)
422
457
  ]);
423
458
  }
424
- const Z = /* @__PURE__ */ $(W, [["render", z]]), R = b({
459
+ const F = /* @__PURE__ */ O(z, [["render", R]]), L = g({
425
460
  name: "JChLine",
426
461
  props: {
427
462
  labels: {
@@ -433,24 +468,29 @@ const Z = /* @__PURE__ */ $(W, [["render", z]]), R = b({
433
468
  type: Array,
434
469
  required: !0
435
470
  },
471
+ options: {
472
+ type: Object,
473
+ default: () => ({}),
474
+ required: !1
475
+ },
436
476
  height: {
437
477
  type: Number,
438
478
  default: 300
439
479
  }
440
480
  },
441
- setup(t) {
442
- const o = f(null);
443
- let n = null;
481
+ setup(e) {
482
+ const s = f(null);
483
+ let a = null;
444
484
  const l = () => {
445
- var s;
446
- n && n.destroy();
447
- const d = (s = o.value) == null ? void 0 : s.getContext("2d");
448
- if (!d) return;
485
+ var i;
486
+ a && a.destroy();
487
+ const o = (i = s.value) == null ? void 0 : i.getContext("2d");
488
+ if (!o) return;
449
489
  const c = {
450
- labels: t.labels,
490
+ labels: e.labels,
451
491
  // 使用 props.labels
452
- datasets: t.datasets.map((e) => ({
453
- ...e,
492
+ datasets: e.datasets.map((t) => ({
493
+ ...t,
454
494
  tension: 0.4,
455
495
  pointRadius: 2,
456
496
  borderWidth: 3,
@@ -458,7 +498,7 @@ const Z = /* @__PURE__ */ $(W, [["render", z]]), R = b({
458
498
  backgroundColor: "transparent",
459
499
  type: "line"
460
500
  }))
461
- }, u = {
501
+ }, p = {
462
502
  responsive: !0,
463
503
  maintainAspectRatio: !1,
464
504
  plugins: {
@@ -490,7 +530,7 @@ const Z = /* @__PURE__ */ $(W, [["render", z]]), R = b({
490
530
  // Optional: Add a border color
491
531
  padding: 12,
492
532
  callbacks: {
493
- label: (e) => `${e.dataset.label || ""}: ${e.formattedValue}`
533
+ label: (t) => `${t.dataset.label || ""}: ${t.formattedValue}`
494
534
  }
495
535
  }
496
536
  },
@@ -538,48 +578,48 @@ const Z = /* @__PURE__ */ $(W, [["render", z]]), R = b({
538
578
  family: "Open Sans",
539
579
  style: "normal"
540
580
  },
541
- callback: (e, r, i) => {
542
- const a = t.labels[r];
543
- return a.length > 13 ? `${a.slice(0, 13)}...` : a;
581
+ callback: (t, r, d) => {
582
+ const n = e.labels[r];
583
+ return n.length > 13 ? `${n.slice(0, 13)}...` : n;
544
584
  }
545
585
  }
546
586
  }
547
587
  }
548
588
  };
549
- n = new k(d, {
589
+ a = new $(o, {
550
590
  type: "line",
551
591
  data: c,
552
- options: u
592
+ options: h(p, e.options)
553
593
  });
554
594
  };
555
- return g(() => {
595
+ return m(() => {
556
596
  l();
557
- }), m(
558
- [() => t.labels, () => t.datasets],
597
+ }), C(
598
+ [() => e.labels, () => e.datasets],
559
599
  () => {
560
600
  l();
561
601
  },
562
602
  { deep: !0 }
563
603
  ), {
564
- lineChartCanvas: o
604
+ lineChartCanvas: s
565
605
  };
566
606
  }
567
- }), L = { ref: "chartContainer" };
568
- function B(t, o, n, l, d, c) {
569
- return x(), C("div", L, [
607
+ }), B = { ref: "chartContainer" };
608
+ function N(e, s, a, l, o, c) {
609
+ return v(), x("div", B, [
570
610
  y("canvas", {
571
611
  ref: "lineChartCanvas",
572
- style: v([{ width: "100%" }, { height: t.height + "px", maxHeight: t.height + "px" }])
612
+ style: k([{ width: "100%" }, { height: e.height + "px", maxHeight: e.height + "px" }])
573
613
  }, null, 4)
574
614
  ], 512);
575
615
  }
576
- const M = /* @__PURE__ */ $(R, [["render", B], ["__scopeId", "data-v-c86e6b6d"]]), N = b({
616
+ const G = /* @__PURE__ */ O(L, [["render", N], ["__scopeId", "data-v-3bd61468"]]), P = g({
577
617
  name: "JChPieDoughnut",
578
618
  props: {
579
619
  type: {
580
620
  type: String,
581
621
  required: !0,
582
- validator: (t) => ["pie", "doughnut"].includes(t)
622
+ validator: (e) => ["pie", "doughnut"].includes(e)
583
623
  },
584
624
  labels: {
585
625
  type: Array,
@@ -591,52 +631,57 @@ const M = /* @__PURE__ */ $(R, [["render", B], ["__scopeId", "data-v-c86e6b6d"]]
591
631
  type: Array,
592
632
  required: !0
593
633
  },
634
+ options: {
635
+ type: Object,
636
+ default: () => ({}),
637
+ required: !1
638
+ },
594
639
  height: {
595
640
  type: Number,
596
641
  default: 300
597
642
  }
598
643
  },
599
- setup(t) {
600
- const o = f(null), n = f(null);
644
+ setup(e) {
645
+ const s = f(null), a = f(null);
601
646
  let l = null;
602
- const d = (s) => {
603
- let e = s.querySelector("div.chartjs-tooltip");
604
- return e || (e = document.createElement("div"), e.className = "chartjs-tooltip", e.style.background = "#ffffff", e.style.borderRadius = "8px", e.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.15)", e.style.color = "#323232", e.style.opacity = "0", e.style.pointerEvents = "none", e.style.position = "absolute", e.style.transform = "translate(-50%, 0)", e.style.transition = "all .1s ease", e.style.padding = "8px 10px", e.style.font = "12px Open Sans, sans-serif", s.appendChild(e)), e;
605
- }, c = (s) => {
606
- const { chart: e, tooltip: r } = s, i = n.value;
607
- if (!i) return;
608
- const a = d(i);
647
+ const o = (i) => {
648
+ let t = i.querySelector("div.chartjs-tooltip");
649
+ return t || (t = document.createElement("div"), t.className = "chartjs-tooltip", t.style.background = "#ffffff", t.style.borderRadius = "8px", t.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.15)", t.style.color = "#323232", t.style.opacity = "0", t.style.pointerEvents = "none", t.style.position = "absolute", t.style.transform = "translate(-50%, 0)", t.style.transition = "all .1s ease", t.style.padding = "8px 10px", t.style.font = "12px Open Sans, sans-serif", i.appendChild(t)), t;
650
+ }, c = (i) => {
651
+ const { chart: t, tooltip: r } = i, d = a.value;
652
+ if (!d) return;
653
+ const n = o(d);
609
654
  if (r.opacity === 0) {
610
- a.style.opacity = "0";
655
+ n.style.opacity = "0";
611
656
  return;
612
657
  }
613
658
  if (r.body) {
614
- const _ = r.title || [], O = r.body.map((p) => p.lines);
615
- if (a.innerHTML = "", _.length) {
616
- const p = document.createElement("div");
617
- p.style.fontWeight = "600", p.style.marginBottom = "4px", p.textContent = _.join(" "), a.appendChild(p);
659
+ const _ = r.title || [], A = r.body.map((u) => u.lines);
660
+ if (n.innerHTML = "", _.length) {
661
+ const u = document.createElement("div");
662
+ u.style.fontWeight = "600", u.style.marginBottom = "4px", u.textContent = _.join(" "), n.appendChild(u);
618
663
  }
619
- O.forEach((p) => {
664
+ A.forEach((u) => {
620
665
  const w = document.createElement("div");
621
- w.textContent = p.join(" "), a.appendChild(w);
666
+ w.textContent = u.join(" "), n.appendChild(w);
622
667
  });
623
668
  }
624
- const { offsetLeft: h, offsetTop: S } = e.canvas;
625
- a.style.opacity = "1", a.style.left = `${h + r.caretX}px`, a.style.top = `${S + r.caretY}px`;
626
- }, u = () => {
627
- var a;
669
+ const { offsetLeft: b, offsetTop: S } = t.canvas;
670
+ n.style.opacity = "1", n.style.left = `${b + r.caretX}px`, n.style.top = `${S + r.caretY}px`;
671
+ }, p = () => {
672
+ var n;
628
673
  l && l.destroy();
629
- const s = (a = o.value) == null ? void 0 : a.getContext("2d");
630
- if (!s) return;
631
- const e = t.type, r = {
632
- labels: t.labels,
633
- datasets: t.datasets.map((h) => ({
634
- ...h,
635
- type: e,
674
+ const i = (n = s.value) == null ? void 0 : n.getContext("2d");
675
+ if (!i) return;
676
+ const t = e.type, r = {
677
+ labels: e.labels,
678
+ datasets: e.datasets.map((b) => ({
679
+ ...b,
680
+ type: t,
636
681
  // 关键:动态设置 ChartDataSet 的类型
637
- borderWidth: h.borderWidth ?? 2
682
+ borderWidth: b.borderWidth ?? 2
638
683
  }))
639
- }, i = {
684
+ }, d = {
640
685
  responsive: !0,
641
686
  maintainAspectRatio: !1,
642
687
  plugins: {
@@ -663,39 +708,39 @@ const M = /* @__PURE__ */ $(R, [["render", B], ["__scopeId", "data-v-c86e6b6d"]]
663
708
  },
664
709
  interaction: { intersect: !1, mode: "index" }
665
710
  };
666
- l = new k(s, {
667
- type: e,
711
+ l = new $(i, {
712
+ type: t,
668
713
  data: r,
669
714
  // 需要使用 'as any' 来避免 TypeScript 对不同 ChartOptions 类型的严格检查
670
- options: i
715
+ options: h(d, e.options)
671
716
  });
672
717
  };
673
- return g(() => {
674
- u();
675
- }), m(
676
- [() => t.labels, () => t.datasets, () => t.type],
718
+ return m(() => {
719
+ p();
720
+ }), C(
721
+ [() => e.labels, () => e.datasets, () => e.type],
677
722
  () => {
678
- u();
723
+ p();
679
724
  },
680
725
  { deep: !0 }
681
726
  ), {
682
- chartCanvas: o,
683
- chartContainer: n
727
+ chartCanvas: s,
728
+ chartContainer: a
684
729
  };
685
730
  }
686
- }), j = {
731
+ }), D = {
687
732
  ref: "chartContainer",
688
733
  style: { position: "relative" }
689
734
  };
690
- function D(t, o, n, l, d, c) {
691
- return x(), C("div", j, [
735
+ function I(e, s, a, l, o, c) {
736
+ return v(), x("div", D, [
692
737
  y("canvas", {
693
738
  ref: "chartCanvas",
694
- style: v([{ width: "100%" }, { height: t.height + "px", maxHeight: t.height + "px" }])
739
+ style: k([{ width: "100%" }, { height: e.height + "px", maxHeight: e.height + "px" }])
695
740
  }, null, 4)
696
741
  ], 512);
697
742
  }
698
- const F = /* @__PURE__ */ $(N, [["render", D]]), I = b({
743
+ const K = /* @__PURE__ */ O(P, [["render", I]]), V = g({
699
744
  name: "JChRadar",
700
745
  props: {
701
746
  labels: {
@@ -707,30 +752,35 @@ const F = /* @__PURE__ */ $(N, [["render", D]]), I = b({
707
752
  type: Array,
708
753
  required: !0
709
754
  },
755
+ options: {
756
+ type: Object,
757
+ default: () => ({}),
758
+ required: !1
759
+ },
710
760
  height: {
711
761
  type: Number,
712
762
  default: 300
713
763
  }
714
764
  },
715
- setup(t) {
716
- const o = f(null);
717
- let n = null;
765
+ setup(e) {
766
+ const s = f(null);
767
+ let a = null;
718
768
  const l = () => {
719
- var s;
720
- n && n.destroy();
721
- const d = (s = o.value) == null ? void 0 : s.getContext("2d");
722
- if (!d) return;
769
+ var i;
770
+ a && a.destroy();
771
+ const o = (i = s.value) == null ? void 0 : i.getContext("2d");
772
+ if (!o) return;
723
773
  const c = {
724
- labels: t.labels,
725
- datasets: t.datasets.map((e) => ({
726
- ...e,
774
+ labels: e.labels,
775
+ datasets: e.datasets.map((t) => ({
776
+ ...t,
727
777
  type: "radar",
728
- fill: e.fill ?? !0,
729
- backgroundColor: e.backgroundColor || "rgba(58,65,111,0.2)",
730
- borderColor: e.borderColor || "rgba(58,65,111,1)",
731
- borderWidth: e.borderWidth ?? 2
778
+ fill: t.fill ?? !0,
779
+ backgroundColor: t.backgroundColor || "rgba(58,65,111,0.2)",
780
+ borderColor: t.borderColor || "rgba(58,65,111,1)",
781
+ borderWidth: t.borderWidth ?? 2
732
782
  }))
733
- }, u = {
783
+ }, p = {
734
784
  responsive: !0,
735
785
  maintainAspectRatio: !1,
736
786
  plugins: {
@@ -759,7 +809,7 @@ const F = /* @__PURE__ */ $(N, [["render", D]]), I = b({
759
809
  borderColor: "#eeeeee",
760
810
  padding: 12,
761
811
  callbacks: {
762
- label: (e) => `${e.dataset.label || ""}: ${e.formattedValue}`
812
+ label: (t) => `${t.dataset.label || ""}: ${t.formattedValue}`
763
813
  }
764
814
  }
765
815
  },
@@ -787,40 +837,40 @@ const F = /* @__PURE__ */ $(N, [["render", D]]), I = b({
787
837
  }
788
838
  }
789
839
  };
790
- n = new k(d, {
840
+ a = new $(o, {
791
841
  type: "radar",
792
842
  data: c,
793
- options: u
843
+ options: h(p, e.options)
794
844
  });
795
845
  };
796
- return g(() => {
846
+ return m(() => {
797
847
  l();
798
- }), m(
799
- [() => t.labels, () => t.datasets, () => t.height],
848
+ }), C(
849
+ [() => e.labels, () => e.datasets, () => e.height],
800
850
  () => {
801
851
  l();
802
852
  },
803
853
  { deep: !0 }
804
854
  ), {
805
- radarChartCanvas: o
855
+ radarChartCanvas: s
806
856
  };
807
857
  }
808
858
  });
809
- function P(t, o, n, l, d, c) {
810
- return x(), C("div", null, [
859
+ function J(e, s, a, l, o, c) {
860
+ return v(), x("div", null, [
811
861
  y("canvas", {
812
862
  ref: "radarChartCanvas",
813
- style: v([{ width: "100%" }, { height: t.height + "px", maxHeight: t.height + "px" }])
863
+ style: k([{ width: "100%" }, { height: e.height + "px", maxHeight: e.height + "px" }])
814
864
  }, null, 4)
815
865
  ]);
816
866
  }
817
- const G = /* @__PURE__ */ $(I, [["render", P]]);
867
+ const Q = /* @__PURE__ */ O(V, [["render", J]]);
818
868
  export {
819
- $ as _,
820
- Y as a,
821
- Z as b,
822
- M as c,
823
- F as d,
824
- G as e,
825
- X as i
869
+ O as _,
870
+ M as a,
871
+ F as b,
872
+ G as c,
873
+ K as d,
874
+ Q as e,
875
+ Z as i
826
876
  };