vlite3 1.4.24 → 1.4.26

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 (49) hide show
  1. package/components/AppShell/AppShell.vue.d.ts +2 -0
  2. package/components/AppShell/AppShell.vue.js +11 -9
  3. package/components/AppShell/AppShellLayoutClassic.vue.js +34 -32
  4. package/components/AppShell/AppShellLayoutDashboard.vue.js +51 -49
  5. package/components/AppShell/AppShellLayoutDock.vue.js +52 -50
  6. package/components/AppShell/AppShellLayoutHeaderShell.vue.js +56 -54
  7. package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +51 -49
  8. package/components/AppShell/AppShellLayoutStorefront.vue.js +40 -38
  9. package/components/AppShell/useAppShell.js +1 -1
  10. package/components/CategoryManager/CategoryManager.vue2.js +2 -2
  11. package/components/Chart/BarChart.vue.d.ts +1 -1
  12. package/components/Chart/ChartLegend.vue.d.ts +22 -0
  13. package/components/Chart/ChartLegend.vue.js +91 -0
  14. package/components/Chart/ChartLegend.vue2.js +4 -0
  15. package/components/Chart/GanttChart.vue.d.ts +2 -2
  16. package/components/Chart/GanttChart.vue.js +1 -1
  17. package/components/Chart/GanttChart.vue2.js +367 -364
  18. package/components/Chart/LineChart.vue.d.ts +5 -2
  19. package/components/Chart/LineChart.vue.js +1 -1
  20. package/components/Chart/LineChart.vue2.js +40 -39
  21. package/components/Chart/PieChart.vue.d.ts +11 -4
  22. package/components/Chart/PieChart.vue.js +118 -114
  23. package/components/Chart/SegmentBarChart.vue.d.ts +1 -1
  24. package/components/Chart/TimelineChart.vue.d.ts +2 -2
  25. package/components/Chart/index.d.ts +2 -1
  26. package/components/Chart/types.d.ts +27 -0
  27. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  28. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  29. package/components/Form/Form.vue.js +1 -1
  30. package/components/Form/Form.vue2.js +131 -127
  31. package/components/Heatmap/Heatmap.vue.d.ts +1 -1
  32. package/components/NavbarCommandPalette.vue.js +1 -1
  33. package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
  34. package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
  35. package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
  36. package/components/Screen/ScreenFilter.vue.js +2 -2
  37. package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
  38. package/components/Stats/StatItem.vue.d.ts +2 -0
  39. package/components/Stats/StatItem.vue.js +234 -134
  40. package/components/Stats/Stats.vue.d.ts +1 -0
  41. package/components/Stats/Stats.vue.js +45 -41
  42. package/components/Stats/components/StatTrend.vue.js +35 -32
  43. package/components/Stats/types.d.ts +32 -2
  44. package/index.js +138 -136
  45. package/package.json +1 -1
  46. package/style.css +1 -1
  47. package/types/appshell.type.d.ts +2 -0
  48. /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
  49. /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
@@ -31,6 +31,8 @@ export interface LineChartProps {
31
31
  axisOpacity?: number;
32
32
  /** Stroke width of the chart lines */
33
33
  lineWidth?: number;
34
+ /** Top stop opacity for the area fill gradient (0–1) */
35
+ fillOpacity?: number;
34
36
  }
35
37
  declare const _default: import('vue').DefineComponent<LineChartProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<LineChartProps> & Readonly<{}>, {
36
38
  fill: boolean;
@@ -38,10 +40,10 @@ declare const _default: import('vue').DefineComponent<LineChartProps, {}, {}, {}
38
40
  height: number;
39
41
  colors: string[];
40
42
  smooth: boolean;
41
- showLegend: boolean;
42
- showTooltip: boolean;
43
43
  showDots: boolean;
44
44
  showGrid: boolean;
45
+ showLegend: boolean;
46
+ showTooltip: boolean;
45
47
  showXAxis: boolean;
46
48
  showYAxis: boolean;
47
49
  showXLabels: boolean;
@@ -49,6 +51,7 @@ declare const _default: import('vue').DefineComponent<LineChartProps, {}, {}, {}
49
51
  gridOpacity: number;
50
52
  axisOpacity: number;
51
53
  lineWidth: number;
54
+ fillOpacity: number;
52
55
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
53
56
  containerRef: HTMLDivElement;
54
57
  }, HTMLDivElement>;
@@ -1,7 +1,7 @@
1
1
  import o from "./LineChart.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-07c9fb47"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-044e962d"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as ae, ref as S, computed as r, onMounted as oe, watch as ne, onUnmounted as ue, openBlock as o, createElementBlock as n, Fragment as p, renderList as g, createElementVNode as h, normalizeStyle as W, createTextVNode as se, toDisplayString as b, createCommentVNode as i, unref as M, withDirectives as re, vShow as ie, createBlock as ce, Teleport as de } from "vue";
1
+ import { defineComponent as ae, ref as R, computed as r, onMounted as oe, watch as ne, onUnmounted as ue, openBlock as o, createElementBlock as n, Fragment as p, renderList as g, createElementVNode as h, normalizeStyle as W, createTextVNode as se, toDisplayString as b, createCommentVNode as i, unref as M, withDirectives as re, vShow as ie, createBlock as ce, Teleport as de } from "vue";
2
2
  import { CHART_COLORS as he, formatNumber as D, getColor as E, niceYTicks as ve, smoothPath as fe, linearPath as ye, animateProgress as me } from "./utils.js";
3
3
  const xe = {
4
4
  key: 0,
5
5
  class: "flex flex-wrap gap-x-4 gap-y-1 mb-3 pl-14"
6
- }, pe = ["width", "height"], ge = ["id"], be = ["width", "height"], ke = ["id"], we = ["stop-color"], Me = ["stop-color"], Le = ["transform"], $e = ["y1", "x2", "y2", "stroke-opacity"], Be = ["y"], Ce = ["x", "y", "text-anchor", "transform"], _e = ["y1", "x2", "y2", "stroke-opacity"], Ve = ["y2", "stroke-opacity"], Xe = ["x1", "x2", "y2"], Re = ["d", "fill", "clip-path"], Se = ["d", "stroke", "stroke-width", "clip-path"], Ye = ["cx", "cy", "r", "fill", "opacity", "clip-path"], Oe = ["x", "y"], Pe = ["x", "y"], ze = { class: "font-medium text-xs mb-1.5" }, Ae = {
6
+ }, pe = ["width", "height"], ge = ["id"], be = ["width", "height"], ke = ["id"], we = ["stop-color", "stop-opacity"], Me = ["stop-color"], Le = ["transform"], $e = ["y1", "x2", "y2", "stroke-opacity"], Be = ["y"], Ce = ["x", "y", "text-anchor", "transform"], Ve = ["y1", "x2", "y2", "stroke-opacity"], _e = ["y2", "stroke-opacity"], Xe = ["x1", "x2", "y2"], Oe = ["d", "fill", "clip-path"], Re = ["d", "stroke", "stroke-width", "clip-path"], Se = ["cx", "cy", "r", "fill", "opacity", "clip-path"], Ye = ["x", "y"], Pe = ["x", "y"], ze = { class: "font-medium text-xs mb-1.5" }, Ae = {
7
7
  key: 0,
8
8
  class: "text-muted-foreground"
9
9
  }, Te = { class: "font-semibold" }, Ne = /* @__PURE__ */ ae({
@@ -32,17 +32,18 @@ const xe = {
32
32
  showYLabels: { type: Boolean, default: !0 },
33
33
  gridOpacity: { default: 0.07 },
34
34
  axisOpacity: { default: 0.1 },
35
- lineWidth: { default: 2.5 }
35
+ lineWidth: { default: 2.5 },
36
+ fillOpacity: { default: 0.25 }
36
37
  },
37
38
  setup(u) {
38
- const l = u, L = S(), X = S(600), y = r(() => l.labels?.length ? l.labels : l.datasets?.length ? l.datasets[0].data.map((t, a) => String(a + 1)) : (l.data ?? []).map((t) => t.label)), R = r(() => {
39
+ const l = u, L = R(), X = R(600), y = r(() => l.labels?.length ? l.labels : l.datasets?.length ? l.datasets[0].data.map((t, a) => String(a + 1)) : (l.data ?? []).map((t) => t.label)), O = r(() => {
39
40
  if (!l.showXLabels || y.value.length === 0) return !1;
40
41
  const t = Math.max(2, Math.floor(X.value / 65));
41
42
  return y.value.length > t;
42
43
  }), v = r(() => {
43
44
  const t = (c) => String(c).length, a = l.showYLabels ? Math.max(2, ...$.value.map((c) => t(l.formatValue ? l.formatValue(c) : D(c)))) * 6.5 : 0, e = l.showYLabels ? Math.max(24, a + 12) : 8;
44
45
  let s = l.showXLabels ? 24 : 6;
45
- return l.showXLabels && R.value && (s = Math.max(2, ...y.value.map((m) => String(m).length)) * 6.5 * 0.7 + 16), {
46
+ return l.showXLabels && O.value && (s = Math.max(2, ...y.value.map((m) => String(m).length)) * 6.5 * 0.7 + 16), {
46
47
  top: 16,
47
48
  right: 16,
48
49
  bottom: s,
@@ -64,7 +65,7 @@ const xe = {
64
65
  }
65
66
  ];
66
67
  }), P = r(() => {
67
- const t = R.value ? 25 : 65, a = Math.max(2, Math.floor(f.value / t));
68
+ const t = O.value ? 25 : 65, a = Math.max(2, Math.floor(f.value / t));
68
69
  return Math.ceil(y.value.length / a);
69
70
  }), F = (t) => {
70
71
  const a = y.value.length;
@@ -77,7 +78,7 @@ const xe = {
77
78
  const a = y.value.length;
78
79
  return a < 2 ? f.value / 2 : t / (a - 1) * f.value;
79
80
  }
80
- const Y = S(l.animate ? 0 : 1);
81
+ const S = R(l.animate ? 0 : 1);
81
82
  let A = null;
82
83
  function Z(t) {
83
84
  return t.map((a, e) => [C(e), B(a)]);
@@ -89,8 +90,8 @@ const xe = {
89
90
  })
90
91
  );
91
92
  function G() {
92
- A?.(), Y.value = 0, A = me(900, (t) => {
93
- Y.value = t;
93
+ A?.(), S.value = 0, A = me(900, (t) => {
94
+ S.value = t;
94
95
  });
95
96
  }
96
97
  oe(() => {
@@ -110,17 +111,17 @@ const xe = {
110
111
  X.value = t[0].contentRect.width || 600;
111
112
  }), T.observe(L.value), X.value = L.value.clientWidth || 600);
112
113
  }
113
- const w = S(null), _ = S(null);
114
+ const w = R(null), V = R(null);
114
115
  function K(t) {
115
116
  if (!l.showTooltip) return;
116
117
  const a = t.currentTarget.getBoundingClientRect(), e = t.clientX - a.left - v.value.left, s = y.value.length;
117
118
  if (s === 0) return;
118
119
  const c = s < 2 ? f.value : f.value / (s - 1), m = Math.round(e / c), x = Math.max(0, Math.min(s - 1, m));
119
- _.value = x;
120
- const ee = k.value.map((O) => ({
121
- color: O.color,
122
- label: O.label,
123
- value: l.formatValue ? l.formatValue(O.values[x]) : D(O.values[x])
120
+ V.value = x;
121
+ const ee = k.value.map((Y) => ({
122
+ color: Y.color,
123
+ label: Y.label,
124
+ value: l.formatValue ? l.formatValue(Y.values[x]) : D(Y.values[x])
124
125
  })), te = C(x) + v.value.left, le = B(k.value[0].values[x]) + v.value.top;
125
126
  w.value = {
126
127
  x: te,
@@ -130,9 +131,9 @@ const xe = {
130
131
  };
131
132
  }
132
133
  function Q() {
133
- w.value = null, _.value = null;
134
+ w.value = null, V.value = null;
134
135
  }
135
- const V = Math.random().toString(36).slice(2, 7);
136
+ const _ = Math.random().toString(36).slice(2, 7);
136
137
  return (t, a) => (o(), n("div", {
137
138
  ref_key: "containerRef",
138
139
  ref: L,
@@ -161,18 +162,18 @@ const xe = {
161
162
  }, [
162
163
  h("defs", null, [
163
164
  h("clipPath", {
164
- id: `clip-${M(V)}`
165
+ id: `clip-${M(_)}`
165
166
  }, [
166
167
  h("rect", {
167
168
  x: 0,
168
169
  y: -10,
169
- width: f.value * Y.value,
170
+ width: f.value * S.value,
170
171
  height: d.value + 20
171
172
  }, null, 8, be)
172
173
  ], 8, ge),
173
174
  (o(!0), n(p, null, g(k.value, (e, s) => (o(), n("linearGradient", {
174
175
  key: s,
175
- id: `grad-${M(V)}-${s}`,
176
+ id: `grad-${M(_)}-${s}`,
176
177
  x1: "0",
177
178
  y1: "0",
178
179
  x2: "0",
@@ -181,7 +182,7 @@ const xe = {
181
182
  h("stop", {
182
183
  offset: "0%",
183
184
  "stop-color": e.color,
184
- "stop-opacity": "0.25"
185
+ "stop-opacity": u.fillOpacity
185
186
  }, null, 8, we),
186
187
  h("stop", {
187
188
  offset: "100%",
@@ -215,9 +216,9 @@ const xe = {
215
216
  u.showXLabels ? (o(!0), n(p, { key: 2 }, g(y.value, (e, s) => re((o(), n("text", {
216
217
  key: `xl-${s}`,
217
218
  x: C(s),
218
- y: d.value + (R.value ? 12 : 16),
219
- "text-anchor": R.value ? "end" : "middle",
220
- transform: R.value ? `rotate(-45, ${C(s)}, ${d.value + 12})` : void 0,
219
+ y: d.value + (O.value ? 12 : 16),
220
+ "text-anchor": O.value ? "end" : "middle",
221
+ transform: O.value ? `rotate(-45, ${C(s)}, ${d.value + 12})` : void 0,
221
222
  class: "fill-muted-foreground",
222
223
  "font-size": "11"
223
224
  }, b(e), 9, Ce)), [
@@ -231,7 +232,7 @@ const xe = {
231
232
  y2: d.value,
232
233
  stroke: "currentColor",
233
234
  "stroke-opacity": u.axisOpacity
234
- }, null, 8, _e)) : i("", !0),
235
+ }, null, 8, Ve)) : i("", !0),
235
236
  u.showYAxis ? (o(), n("line", {
236
237
  key: 4,
237
238
  x1: 0,
@@ -240,12 +241,12 @@ const xe = {
240
241
  y2: d.value,
241
242
  stroke: "currentColor",
242
243
  "stroke-opacity": u.axisOpacity
243
- }, null, 8, Ve)) : i("", !0),
244
- _.value !== null ? (o(), n("line", {
244
+ }, null, 8, _e)) : i("", !0),
245
+ V.value !== null ? (o(), n("line", {
245
246
  key: 5,
246
- x1: C(_.value),
247
+ x1: C(V.value),
247
248
  y1: 0,
248
- x2: C(_.value),
249
+ x2: C(V.value),
249
250
  y2: d.value,
250
251
  stroke: "currentColor",
251
252
  "stroke-opacity": "0.12",
@@ -256,9 +257,9 @@ const xe = {
256
257
  u.fill ? (o(), n("path", {
257
258
  key: 0,
258
259
  d: e.fillPath,
259
- fill: `url(#grad-${M(V)}-${s})`,
260
- "clip-path": `url(#clip-${M(V)})`
261
- }, null, 8, Re)) : i("", !0),
260
+ fill: `url(#grad-${M(_)}-${s})`,
261
+ "clip-path": `url(#clip-${M(_)})`
262
+ }, null, 8, Oe)) : i("", !0),
262
263
  h("path", {
263
264
  d: e.line,
264
265
  fill: "none",
@@ -266,18 +267,18 @@ const xe = {
266
267
  "stroke-width": u.lineWidth,
267
268
  "stroke-linejoin": "round",
268
269
  "stroke-linecap": "round",
269
- "clip-path": `url(#clip-${M(V)})`
270
- }, null, 8, Se),
270
+ "clip-path": `url(#clip-${M(_)})`
271
+ }, null, 8, Re),
271
272
  u.showDots ? (o(!0), n(p, { key: 1 }, g(e.pts, (c, m) => (o(), n("circle", {
272
273
  key: m,
273
274
  cx: c[0],
274
275
  cy: c[1],
275
- r: _.value === m ? 5 : 3.5,
276
+ r: V.value === m ? 5 : 3.5,
276
277
  fill: e.color,
277
278
  class: "transition-[r] duration-150",
278
- opacity: Y.value > 0 ? 1 : 0,
279
- "clip-path": `url(#clip-${M(V)})`
280
- }, null, 8, Ye))), 128)) : i("", !0)
279
+ opacity: S.value > 0 ? 1 : 0,
280
+ "clip-path": `url(#clip-${M(_)})`
281
+ }, null, 8, Se))), 128)) : i("", !0)
281
282
  ]))), 128)),
282
283
  u.yLabel ? (o(), n("text", {
283
284
  key: 6,
@@ -287,7 +288,7 @@ const xe = {
287
288
  transform: "rotate(-90)",
288
289
  "font-size": "11",
289
290
  class: "fill-muted-foreground font-medium"
290
- }, b(u.yLabel), 9, Oe)) : i("", !0),
291
+ }, b(u.yLabel), 9, Ye)) : i("", !0),
291
292
  u.xLabel ? (o(), n("text", {
292
293
  key: 7,
293
294
  x: f.value / 2,
@@ -1,6 +1,5 @@
1
- import { ChartDataPoint } from './types';
2
- export type PieLabelMode = 'percent' | 'value' | 'label' | 'none' | 'outside';
3
- export type LegendPosition = 'right' | 'bottom';
1
+ import { ChartDataPoint, ChartLegendsVariant, LegendPosition, PieLabelMode } from './types';
2
+ export type { PieLabelMode, LegendPosition, ChartLegendsVariant };
4
3
  export interface PieChartProps {
5
4
  data: ChartDataPoint[];
6
5
  donut?: boolean;
@@ -9,6 +8,13 @@ export interface PieChartProps {
9
8
  startAngle?: number;
10
9
  showLegend?: boolean;
11
10
  legendPosition?: LegendPosition;
11
+ /**
12
+ * Legend layout preset.
13
+ * - `default` — original two-line items (label + value)
14
+ * - `variant1` — compact horizontal wrap: "Label (value, pct%)"
15
+ * - `variant2` — vertical rows with value/pct aligned right
16
+ */
17
+ legendsVariant?: ChartLegendsVariant;
12
18
  labelMode?: PieLabelMode;
13
19
  colors?: string[];
14
20
  animate?: boolean;
@@ -34,10 +40,11 @@ declare const __VLS_component: import('vue').DefineComponent<PieChartProps, {},
34
40
  colors: string[];
35
41
  showLegend: boolean;
36
42
  showTooltip: boolean;
43
+ legendsVariant: ChartLegendsVariant;
44
+ legendPosition: LegendPosition;
37
45
  donut: boolean;
38
46
  innerRadius: number;
39
47
  startAngle: number;
40
- legendPosition: LegendPosition;
41
48
  labelMode: PieLabelMode;
42
49
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
43
50
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -1,9 +1,10 @@
1
- import { defineComponent as se, ref as E, onMounted as ie, watch as ue, onUnmounted as re, computed as f, openBlock as s, createElementBlock as i, normalizeClass as Z, createElementVNode as u, unref as M, Fragment as p, renderList as $, createCommentVNode as h, toDisplayString as d, renderSlot as de, normalizeStyle as I, createBlock as ce, Teleport as ve, createTextVNode as fe } from "vue";
2
- import { CHART_COLORS as he, getColor as _, arcPath as me, formatNumber as z, animateProgress as xe } from "./utils.js";
3
- const ye = { class: "shrink-0" }, ge = ["width", "height"], be = ["id"], Me = ["filter"], ke = ["d", "fill", "transform", "onMouseenter"], we = {
1
+ import { defineComponent as re, ref as B, onMounted as ue, watch as de, onUnmounted as ce, computed as d, openBlock as i, createElementBlock as s, normalizeClass as W, createElementVNode as u, unref as T, Fragment as D, renderList as N, createCommentVNode as f, toDisplayString as x, renderSlot as ve, createBlock as Z, Teleport as fe, normalizeStyle as _, createTextVNode as he } from "vue";
2
+ import { CHART_COLORS as me, getColor as ge, arcPath as xe, formatNumber as E, animateProgress as ye } from "./utils.js";
3
+ import be from "./ChartLegend.vue.js";
4
+ const Me = ["width", "height"], ke = ["id"], we = ["filter"], pe = ["d", "fill", "transform", "opacity", "onMouseenter"], $e = {
4
5
  key: 0,
5
6
  style: { "pointer-events": "none" }
6
- }, pe = ["d", "opacity"], $e = ["x", "y", "text-anchor", "font-size", "font-weight", "fill", "opacity"], ze = { key: 2 }, Le = ["x", "y"], Ae = ["x", "y"], Pe = ["onMouseenter"], Ce = { class: "min-w-0" }, Re = { class: "text-xs font-medium text-foreground truncate" }, Se = { class: "text-[10px] text-muted-foreground" }, Be = { class: "flex items-center gap-1.5 mb-1" }, Ve = { class: "text-xs font-semibold" }, Te = { class: "text-xs text-muted-foreground" }, De = { class: "font-medium text-foreground ml-1" }, Oe = /* @__PURE__ */ se({
7
+ }, Le = ["d", "opacity"], ze = ["x", "y", "text-anchor", "font-size", "font-weight", "fill", "opacity"], Pe = { key: 2 }, Ae = ["x", "y"], Ve = ["x", "y"], Ce = { class: "flex items-center gap-1.5 mb-1" }, Re = { class: "text-xs font-semibold" }, Se = { class: "text-xs text-muted-foreground" }, Be = { class: "font-medium text-foreground ml-1" }, He = /* @__PURE__ */ re({
7
8
  __name: "PieChart",
8
9
  props: {
9
10
  data: {},
@@ -13,59 +14,72 @@ const ye = { class: "shrink-0" }, ge = ["width", "height"], be = ["id"], Me = ["
13
14
  startAngle: { default: -90 },
14
15
  showLegend: { type: Boolean, default: !0 },
15
16
  legendPosition: { default: "right" },
17
+ legendsVariant: { default: "default" },
16
18
  labelMode: { default: "percent" },
17
- colors: { default: () => he },
19
+ colors: { default: () => me },
18
20
  animate: { type: Boolean, default: !0 },
19
21
  showTooltip: { type: Boolean, default: !0 },
20
22
  centerLabel: {},
21
23
  centerValue: {}
22
24
  },
23
25
  setup(e) {
24
- const o = e, O = Math.random().toString(36).slice(2, 7), L = E(o.animate ? 0 : 1);
25
- let A = null;
26
- function j() {
27
- A?.(), L.value = 0, A = xe(1e3, (a) => L.value = a);
26
+ const t = e, H = Math.random().toString(36).slice(2, 7), w = B(t.animate ? 0 : 1);
27
+ let p = null;
28
+ function I() {
29
+ p?.(), w.value = 0, p = ye(1e3, (l) => w.value = l);
28
30
  }
29
- ie(() => {
30
- o.animate && j();
31
- }), ue(() => o.data, () => {
32
- o.animate && j();
33
- }, { deep: !0 }), re(() => A?.());
34
- const X = f(() => o.labelMode === "outside"), m = f(() => o.size / 2), v = f(() => o.size / 2), x = f(() => o.size / 2 - (X.value ? 36 : 4)), Y = f(() => o.donut ? x.value * (o.innerRadius / 100) : 0), P = f(() => o.data.reduce((a, n) => a + n.value, 0) || 1), k = f(() => {
35
- let a = o.startAngle;
36
- return o.data.map((n, t) => {
37
- const l = n.value / P.value, c = l * 360 * L.value, C = n.color ?? _(o.colors, t), g = a, R = a + c;
38
- a += l * 360;
39
- const F = (g + R) / 2 * (Math.PI / 180), w = Math.cos(F), S = Math.sin(F), B = w >= 0, H = x.value * 0.65 + Y.value * 0.35;
40
- let U = m.value + H * w, q = v.value + H * S, G = "middle", J = 0, K = 0, V = 0, T = 0, D = 0, N = 0, Q = "";
41
- if (X.value) {
42
- const W = x.value + 20, ae = 14;
43
- J = m.value + x.value * w, K = v.value + x.value * S, V = m.value + W * w, T = v.value + W * S, D = V + ae * (B ? 1 : -1), N = T, Q = `M ${J},${K} L ${V},${T} L ${D},${N}`, U = D + 5 * (B ? 1 : -1), q = N, G = B ? "start" : "end";
31
+ ue(() => {
32
+ t.animate && I();
33
+ }), de(
34
+ () => t.data,
35
+ () => {
36
+ t.animate && I();
37
+ },
38
+ { deep: !0 }
39
+ ), ce(() => p?.());
40
+ const O = d(() => t.labelMode === "outside"), h = d(() => t.size / 2), c = d(() => t.size / 2), m = d(() => t.size / 2 - (O.value ? 36 : 4)), X = d(() => t.donut ? m.value * (t.innerRadius / 100) : 0), $ = d(() => t.data.reduce((l, a) => l + a.value, 0) || 1), ee = d(() => t.legendPosition === "bottom" ? t.legendsVariant === "variant2" ? "flex flex-col items-stretch gap-5 w-full" : "inline-flex flex-col items-center gap-4" : "inline-flex flex-row items-center gap-6"), M = d(() => {
41
+ let l = t.startAngle;
42
+ return t.data.map((a, o) => {
43
+ const n = a.value / $.value, g = n * 360 * w.value, L = a.color ?? ge(t.colors, o), y = l, z = l + g;
44
+ l += n * 360;
45
+ const Y = (y + z) / 2 * (Math.PI / 180), k = Math.cos(Y), P = Math.sin(Y), A = k >= 0, j = m.value * 0.65 + X.value * 0.35;
46
+ let F = h.value + j * k, U = c.value + j * P, q = "middle", G = 0, J = 0, V = 0, C = 0, R = 0, S = 0, K = "";
47
+ if (O.value) {
48
+ const Q = m.value + 20, se = 14;
49
+ G = h.value + m.value * k, J = c.value + m.value * P, V = h.value + Q * k, C = c.value + Q * P, R = V + se * (A ? 1 : -1), S = C, K = `M ${G},${J} L ${V},${C} L ${R},${S}`, F = R + 5 * (A ? 1 : -1), U = S, q = A ? "start" : "end";
44
50
  }
45
- const ne = me(m.value, v.value, x.value, g, R, Y.value);
51
+ const ie = xe(h.value, c.value, m.value, y, z, X.value);
46
52
  let b = "";
47
- return o.labelMode === "percent" ? b = `${Math.round(l * 100)}%` : o.labelMode === "value" ? b = z(n.value) : o.labelMode === "label" ? b = n.label : o.labelMode === "outside" && (b = `${z(n.value)} (${Math.round(l * 100)}%)`), { d: n, path: ne, color: C, lx: U, ly: q, label: b, pct: l, startA: g, endA: R, leaderPath: Q, textAnchor: G };
53
+ return t.labelMode === "percent" ? b = `${Math.round(n * 100)}%` : t.labelMode === "value" ? b = E(a.value) : t.labelMode === "label" ? b = a.label : t.labelMode === "outside" && (b = `${E(a.value)} (${Math.round(n * 100)}%)`), { d: a, path: ie, color: L, lx: F, ly: U, label: b, pct: n, startA: y, endA: z, leaderPath: K, textAnchor: q };
48
54
  });
49
- }), y = E(null), r = E(null);
50
- function ee(a, n) {
51
- y.value = n, o.showTooltip && (r.value = { x: a.clientX, y: a.clientY, item: k.value[n] });
55
+ }), v = B(null), r = B(null);
56
+ function te(l, a) {
57
+ v.value = a, t.showTooltip && (r.value = { x: l.clientX, y: l.clientY, item: M.value[a] });
52
58
  }
53
- function te(a) {
54
- r.value && (r.value = { ...r.value, x: a.clientX, y: a.clientY });
59
+ function le(l) {
60
+ r.value && (r.value = { ...r.value, x: l.clientX, y: l.clientY });
55
61
  }
56
- function le() {
57
- y.value = null, r.value = null;
62
+ function oe() {
63
+ v.value = null, r.value = null;
58
64
  }
59
- function oe(a, n, t) {
60
- if (y.value !== a) return "";
61
- const l = (n + t) / 2 * (Math.PI / 180), c = 8, C = Math.cos(l) * c, g = Math.sin(l) * c;
62
- return `translate(${C}, ${g})`;
65
+ function ne(l) {
66
+ v.value = l;
63
67
  }
64
- return (a, n) => (s(), i("div", {
65
- class: Z(["vlite-pie-chart inline-flex gap-6 select-none", e.legendPosition === "bottom" ? "flex-col items-center" : "flex-row items-center"])
68
+ function ae(l, a, o) {
69
+ if (v.value !== l) return "";
70
+ const n = (a + o) / 2 * (Math.PI / 180), g = 8, L = Math.cos(n) * g, y = Math.sin(n) * g;
71
+ return `translate(${L}, ${y})`;
72
+ }
73
+ return (l, a) => (i(), s("div", {
74
+ class: W(["vlite-pie-chart select-none", ee.value])
66
75
  }, [
67
- u("div", ye, [
68
- (s(), i("svg", {
76
+ u("div", {
77
+ class: W([
78
+ "shrink-0",
79
+ e.legendPosition === "bottom" && e.legendsVariant === "variant2" ? "self-center" : ""
80
+ ])
81
+ }, [
82
+ (i(), s("svg", {
69
83
  width: e.size,
70
84
  height: e.size,
71
85
  role: "img",
@@ -74,130 +88,120 @@ const ye = { class: "shrink-0" }, ge = ["width", "height"], be = ["id"], Me = ["
74
88
  }, [
75
89
  u("defs", null, [
76
90
  u("filter", {
77
- id: `shadow-${M(O)}`,
91
+ id: `shadow-${T(H)}`,
78
92
  x: "-20%",
79
93
  y: "-20%",
80
94
  width: "140%",
81
95
  height: "140%"
82
- }, [...n[1] || (n[1] = [
96
+ }, [...a[0] || (a[0] = [
83
97
  u("feDropShadow", {
84
98
  dx: "0",
85
99
  dy: "2",
86
100
  stdDeviation: "3",
87
101
  "flood-opacity": "0.12"
88
102
  }, null, -1)
89
- ])], 8, be)
103
+ ])], 8, ke)
90
104
  ]),
91
105
  u("g", {
92
- filter: `url(#shadow-${M(O)})`
106
+ filter: `url(#shadow-${T(H)})`
93
107
  }, [
94
- (s(!0), i(p, null, $(k.value, (t, l) => (s(), i("path", {
95
- key: l,
96
- d: t.path,
97
- fill: t.color,
98
- transform: oe(l, t.startA, t.endA),
108
+ (i(!0), s(D, null, N(M.value, (o, n) => (i(), s("path", {
109
+ key: n,
110
+ d: o.path,
111
+ fill: o.color,
112
+ transform: ae(n, o.startA, o.endA),
99
113
  class: "cursor-pointer transition-transform duration-200",
114
+ opacity: v.value !== null && v.value !== n ? 0.55 : 1,
100
115
  stroke: "var(--color-background)",
101
116
  "stroke-width": "2",
102
- onMouseenter: (c) => ee(c, l),
103
- onMousemove: te,
104
- onMouseleave: le
105
- }, null, 40, ke))), 128))
106
- ], 8, Me),
107
- e.labelMode === "outside" ? (s(), i("g", we, [
108
- (s(!0), i(p, null, $(k.value, (t, l) => (s(), i("path", {
109
- key: `leader-${l}`,
110
- d: t.leaderPath,
117
+ onMouseenter: (g) => te(g, n),
118
+ onMousemove: le,
119
+ onMouseleave: oe
120
+ }, null, 40, pe))), 128))
121
+ ], 8, we),
122
+ e.labelMode === "outside" ? (i(), s("g", $e, [
123
+ (i(!0), s(D, null, N(M.value, (o, n) => (i(), s("path", {
124
+ key: `leader-${n}`,
125
+ d: o.leaderPath,
111
126
  fill: "none",
112
127
  stroke: "var(--color-muted-foreground)",
113
128
  "stroke-width": "1",
114
129
  "stroke-linecap": "round",
115
130
  "stroke-linejoin": "round",
116
- opacity: t.pct > 0.02 ? 0.5 : 0
117
- }, null, 8, pe))), 128))
118
- ])) : h("", !0),
119
- e.labelMode !== "none" ? (s(!0), i(p, { key: 1 }, $(k.value, (t, l) => (s(), i("text", {
120
- key: `lbl-${l}`,
121
- x: t.lx,
122
- y: t.ly,
123
- "text-anchor": e.labelMode === "outside" ? t.textAnchor : "middle",
131
+ opacity: o.pct > 0.02 ? 0.5 : 0
132
+ }, null, 8, Le))), 128))
133
+ ])) : f("", !0),
134
+ e.labelMode !== "none" ? (i(!0), s(D, { key: 1 }, N(M.value, (o, n) => (i(), s("text", {
135
+ key: `lbl-${n}`,
136
+ x: o.lx,
137
+ y: o.ly,
138
+ "text-anchor": e.labelMode === "outside" ? o.textAnchor : "middle",
124
139
  "dominant-baseline": "middle",
125
140
  "font-size": e.labelMode === "outside" ? 11.5 : 11,
126
141
  "font-weight": e.labelMode === "outside" ? "500" : "600",
127
142
  fill: e.labelMode === "outside" ? "var(--color-foreground)" : "white",
128
- opacity: t.pct > 0.04 ? 1 : 0
129
- }, d(t.label), 9, $e))), 128)) : h("", !0),
130
- e.donut ? (s(), i("g", ze, [
131
- de(a.$slots, "center", {
132
- total: P.value,
143
+ opacity: o.pct > 0.04 ? 1 : 0
144
+ }, x(o.label), 9, ze))), 128)) : f("", !0),
145
+ e.donut ? (i(), s("g", Pe, [
146
+ ve(l.$slots, "center", {
147
+ total: $.value,
133
148
  data: e.data
134
149
  }, () => [
135
- e.centerValue ? (s(), i("text", {
150
+ e.centerValue ? (i(), s("text", {
136
151
  key: 0,
137
- x: m.value,
138
- y: e.centerLabel ? v.value - 8 : v.value,
152
+ x: h.value,
153
+ y: e.centerLabel ? c.value - 8 : c.value,
139
154
  "text-anchor": "middle",
140
155
  "dominant-baseline": "central",
141
156
  "font-size": "22",
142
157
  "font-weight": "700",
143
158
  class: "fill-foreground"
144
- }, d(e.centerValue), 9, Le)) : h("", !0),
145
- e.centerLabel ? (s(), i("text", {
159
+ }, x(e.centerValue), 9, Ae)) : f("", !0),
160
+ e.centerLabel ? (i(), s("text", {
146
161
  key: 1,
147
- x: m.value,
148
- y: v.value + (e.centerValue ? 14 : 0),
162
+ x: h.value,
163
+ y: c.value + (e.centerValue ? 14 : 0),
149
164
  "text-anchor": "middle",
150
165
  "dominant-baseline": "middle",
151
166
  "font-size": "12",
152
167
  class: "fill-muted-foreground"
153
- }, d(e.centerLabel), 9, Ae)) : h("", !0)
168
+ }, x(e.centerLabel), 9, Ve)) : f("", !0)
154
169
  ])
155
- ])) : h("", !0)
156
- ], 8, ge))
157
- ]),
158
- e.showLegend ? (s(), i("div", {
170
+ ])) : f("", !0)
171
+ ], 8, Me))
172
+ ], 2),
173
+ e.showLegend ? (i(), Z(be, {
159
174
  key: 0,
160
- class: Z(["flex flex-col gap-2 min-w-[120px]", e.legendPosition === "bottom" ? "flex-row flex-wrap justify-center" : ""])
161
- }, [
162
- (s(!0), i(p, null, $(e.data, (t, l) => (s(), i("div", {
163
- key: l,
164
- class: "flex items-center gap-2 cursor-pointer",
165
- style: { transition: "opacity 0.15s" },
166
- onMouseenter: (c) => y.value = l,
167
- onMouseleave: n[0] || (n[0] = (c) => y.value = null)
168
- }, [
169
- u("span", {
170
- class: "w-2.5 h-2.5 rounded-sm shrink-0",
171
- style: I({ backgroundColor: t.color ?? M(_)(e.colors, l) })
172
- }, null, 4),
173
- u("div", Ce, [
174
- u("div", Re, d(t.label), 1),
175
- u("div", Se, d(M(z)(t.value)) + " (" + d(Math.round(t.value / P.value * 100)) + "%) ", 1)
176
- ])
177
- ], 40, Pe))), 128))
178
- ], 2)) : h("", !0),
179
- (s(), ce(ve, { to: "body" }, [
180
- r.value ? (s(), i("div", {
175
+ data: e.data,
176
+ total: $.value,
177
+ colors: e.colors,
178
+ "legends-variant": e.legendsVariant,
179
+ "legend-position": e.legendPosition,
180
+ "hovered-index": v.value,
181
+ onHover: ne
182
+ }, null, 8, ["data", "total", "colors", "legends-variant", "legend-position", "hovered-index"])) : f("", !0),
183
+ (i(), Z(fe, { to: "body" }, [
184
+ r.value ? (i(), s("div", {
181
185
  key: 0,
182
186
  class: "vlite-chart-tooltip",
183
- style: I({ left: `${r.value.x + 12}px`, top: `${r.value.y - 10}px` })
187
+ style: _({ left: `${r.value.x + 12}px`, top: `${r.value.y - 10}px` })
184
188
  }, [
185
- u("div", Be, [
189
+ u("div", Ce, [
186
190
  u("span", {
187
191
  class: "w-2.5 h-2.5 rounded-sm shrink-0",
188
- style: I({ backgroundColor: r.value.item.color })
192
+ style: _({ backgroundColor: r.value.item.color })
189
193
  }, null, 4),
190
- u("span", Ve, d(r.value.item.d.label), 1)
194
+ u("span", Re, x(r.value.item.d.label), 1)
191
195
  ]),
192
- u("div", Te, [
193
- fe(d(M(z)(r.value.item.d.value)) + " ", 1),
194
- u("span", De, " (" + d(Math.round(r.value.item.pct * 100)) + "%) ", 1)
196
+ u("div", Se, [
197
+ he(x(T(E)(r.value.item.d.value)) + " ", 1),
198
+ u("span", Be, " (" + x(Math.round(r.value.item.pct * 100)) + "%) ", 1)
195
199
  ])
196
- ], 4)) : h("", !0)
200
+ ], 4)) : f("", !0)
197
201
  ]))
198
202
  ], 2));
199
203
  }
200
204
  });
201
205
  export {
202
- Oe as default
206
+ He as default
203
207
  };
@@ -13,8 +13,8 @@ export interface SegmentBarChartProps {
13
13
  declare const _default: import('vue').DefineComponent<SegmentBarChartProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SegmentBarChartProps> & Readonly<{}>, {
14
14
  animate: boolean;
15
15
  colors: string[];
16
- showLabels: boolean;
17
16
  showTooltip: boolean;
17
+ showLabels: boolean;
18
18
  barRadius: number;
19
19
  showValues: boolean;
20
20
  barHeight: number;
@@ -14,9 +14,9 @@ declare const _default: import('vue').DefineComponent<TimelineChartProps, {}, {}
14
14
  animate: boolean;
15
15
  height: number;
16
16
  colors: string[];
17
- showLabels: boolean;
18
- showTooltip: boolean;
19
17
  showGrid: boolean;
18
+ showTooltip: boolean;
19
+ showLabels: boolean;
20
20
  barRadius: number;
21
21
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
22
22
  containerRef: HTMLDivElement;