@shtabapp/ui-kit 1.73.0 → 1.75.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/SChartBar-BvytQ-2z.js +293 -0
- package/dist/SChartBar-BzCeNCsi.cjs +1 -0
- package/dist/SChartBurnup-BeQWgnGT.js +261 -0
- package/dist/SChartBurnup-joKIDLFb.cjs +1 -0
- package/dist/SChartHorizontalBar-C40Yroue.js +176 -0
- package/dist/SChartHorizontalBar-Dwln3uuE.cjs +1 -0
- package/dist/SChartLegend-D1gPKGm0.cjs +1 -0
- package/dist/SChartLegend-dDqLhvIj.js +88 -0
- package/dist/{SChartLine-v0tkmnN6.js → SChartLine-BV8Ytso5.js} +36 -36
- package/dist/{SChartLine-3l507dBg.cjs → SChartLine-DeJjaBmo.cjs} +1 -1
- package/dist/SChartMultiLine-7_HcvVEQ.js +279 -0
- package/dist/SChartMultiLine-Cl9Pf3Wp.cjs +1 -0
- package/dist/SChartPie-BiLoxutQ.js +267 -0
- package/dist/SChartPie-DccW5J0b.cjs +1 -0
- package/dist/{SChartProgress-9Zzy7E8K.cjs → SChartProgress-Cpdkad6Q.cjs} +1 -1
- package/dist/{SChartProgress-DUgSOdv7.js → SChartProgress-DSxJqRA0.js} +27 -27
- package/dist/{SChartStackedArea-Blpqa23h.js → SChartStackedArea-B28offwE.js} +44 -44
- package/dist/{SChartStackedArea-C3MezV9k.cjs → SChartStackedArea-Ce7xyhp1.cjs} +1 -1
- package/dist/{SChartStackedBar-CCxEXw1H.js → SChartStackedBar-C77FlKGS.js} +55 -55
- package/dist/{SChartStackedBar-CJ-UdOfv.cjs → SChartStackedBar-CqUDrFJ3.cjs} +1 -1
- package/dist/STable-BXVhLjSQ.cjs +1 -0
- package/dist/{STable-DpH_h2-n.js → STable-G2k-tI4g.js} +168 -144
- package/dist/applyChartHighlightedYTick-BHVwiljn.cjs +1 -0
- package/dist/applyChartHighlightedYTick-DmsstRVM.js +17 -0
- package/dist/buildMultiLineChartScales-Di-yTvEB.js +41 -0
- package/dist/buildMultiLineChartScales-lVP6h9H4.cjs +1 -0
- package/dist/components/SChartBar/SChartBar.types.d.ts +33 -4
- package/dist/components/SChartBar/SChartBar.types.d.ts.map +1 -1
- package/dist/components/SChartBar/SChartBar.vue.d.ts.map +1 -1
- package/dist/components/SChartBar/index.d.ts +1 -1
- package/dist/components/SChartBar/index.d.ts.map +1 -1
- package/dist/components/SChartBar/utils/buildBarChartConfig.d.ts +8 -2
- package/dist/components/SChartBar/utils/buildBarChartConfig.d.ts.map +1 -1
- package/dist/components/SChartBar/utils/createBarTargetLinePlugin.d.ts.map +1 -1
- package/dist/components/SChartBar/utils/createBarValueLabelPlugin.d.ts +7 -0
- package/dist/components/SChartBar/utils/createBarValueLabelPlugin.d.ts.map +1 -0
- package/dist/components/SChartBar/utils/demoBarSeries.d.ts +7 -1
- package/dist/components/SChartBar/utils/demoBarSeries.d.ts.map +1 -1
- package/dist/components/SChartBurnup/SChartBurnup.types.d.ts +8 -1
- package/dist/components/SChartBurnup/SChartBurnup.types.d.ts.map +1 -1
- package/dist/components/SChartBurnup/utils/buildBurnupChartConfig.d.ts.map +1 -1
- package/dist/components/SChartBurnup/utils/demoBurnupPoints.d.ts +1 -0
- package/dist/components/SChartBurnup/utils/demoBurnupPoints.d.ts.map +1 -1
- package/dist/components/SChartLegend/SChartLegend.types.d.ts +17 -0
- package/dist/components/SChartLegend/SChartLegend.types.d.ts.map +1 -1
- package/dist/components/SChartLegend/SChartLegend.vue.d.ts +3 -1
- package/dist/components/SChartLegend/SChartLegend.vue.d.ts.map +1 -1
- package/dist/components/SChartLegend/index.d.ts +1 -0
- package/dist/components/SChartLegend/index.d.ts.map +1 -1
- package/dist/components/SChartMultiLine/SChartMultiLine.types.d.ts +14 -2
- package/dist/components/SChartMultiLine/SChartMultiLine.types.d.ts.map +1 -1
- package/dist/components/SChartMultiLine/SChartMultiLine.vue.d.ts +3 -1
- package/dist/components/SChartMultiLine/SChartMultiLine.vue.d.ts.map +1 -1
- package/dist/components/SChartMultiLine/index.d.ts +1 -1
- package/dist/components/SChartMultiLine/index.d.ts.map +1 -1
- package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts +9 -2
- package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts.map +1 -1
- package/dist/components/SChartMultiLine/utils/demoMultiLineSeries.d.ts +4 -1
- package/dist/components/SChartMultiLine/utils/demoMultiLineSeries.d.ts.map +1 -1
- package/dist/components/SChartPie/SChartPie.types.d.ts +27 -1
- package/dist/components/SChartPie/SChartPie.types.d.ts.map +1 -1
- package/dist/components/SChartPie/SChartPie.vue.d.ts +16 -2
- package/dist/components/SChartPie/SChartPie.vue.d.ts.map +1 -1
- package/dist/components/SChartPie/index.d.ts +2 -1
- package/dist/components/SChartPie/index.d.ts.map +1 -1
- package/dist/components/SChartPie/utils/buildPieChartConfig.d.ts +3 -1
- package/dist/components/SChartPie/utils/buildPieChartConfig.d.ts.map +1 -1
- package/dist/components/SChartPie/utils/demoPieSlices.d.ts +1 -0
- package/dist/components/SChartPie/utils/demoPieSlices.d.ts.map +1 -1
- package/dist/components/SChartSegmentedBar/SChartSegmentedBar.types.d.ts +9 -0
- package/dist/components/SChartSegmentedBar/SChartSegmentedBar.types.d.ts.map +1 -1
- package/dist/components/SChartSegmentedBar/SChartSegmentedBar.vue.d.ts +14 -2
- package/dist/components/SChartSegmentedBar/SChartSegmentedBar.vue.d.ts.map +1 -1
- package/dist/components/SChartSegmentedBar/utils/buildSegmentedBarChartConfig.d.ts +4 -1
- package/dist/components/SChartSegmentedBar/utils/buildSegmentedBarChartConfig.d.ts.map +1 -1
- package/dist/components/SChartSegmentedBar/utils/createSegmentedBarBadgePlugin.d.ts.map +1 -1
- package/dist/components/SList/utils/resolveListItemFields.d.ts +1 -1
- package/dist/components/SList/utils/resolveListItemFields.d.ts.map +1 -1
- package/dist/components/SRoadmap/SRoadmap.types.d.ts +47 -0
- package/dist/components/SRoadmap/SRoadmap.types.d.ts.map +1 -0
- package/dist/components/SRoadmap/SRoadmap.vue.d.ts +21 -0
- package/dist/components/SRoadmap/SRoadmap.vue.d.ts.map +1 -0
- package/dist/components/SRoadmap/index.d.ts +4 -0
- package/dist/components/SRoadmap/index.d.ts.map +1 -0
- package/dist/components/SRoadmap/utils/buildRoadmapRows.d.ts +19 -0
- package/dist/components/SRoadmap/utils/buildRoadmapRows.d.ts.map +1 -0
- package/dist/components/SRoadmap/utils/demoRoadmapItems.d.ts +5 -0
- package/dist/components/SRoadmap/utils/demoRoadmapItems.d.ts.map +1 -0
- package/dist/components/SRoadmap/utils/roadmapDate.d.ts +16 -0
- package/dist/components/SRoadmap/utils/roadmapDate.d.ts.map +1 -0
- package/dist/components/STable/STable.types.d.ts +8 -0
- package/dist/components/STable/STable.types.d.ts.map +1 -1
- package/dist/components/STable/STable.vue.d.ts +3 -0
- package/dist/components/STable/STable.vue.d.ts.map +1 -1
- package/dist/components/STable/parts/STableGroupRow.vue.d.ts +3 -0
- package/dist/components/STable/parts/STableGroupRow.vue.d.ts.map +1 -1
- package/dist/components/STable/parts/STableHeaderCell.vue.d.ts +2 -0
- package/dist/components/STable/parts/STableHeaderCell.vue.d.ts.map +1 -1
- package/dist/components/STable/utils/useTableRowDnd.d.ts +2 -1
- package/dist/components/STable/utils/useTableRowDnd.d.ts.map +1 -1
- package/dist/components/STable/utils/useTableRowHydration.d.ts +3 -1
- package/dist/components/STable/utils/useTableRowHydration.d.ts.map +1 -1
- package/dist/composables/useChartInteractivity.d.ts +2 -1
- package/dist/composables/useChartInteractivity.d.ts.map +1 -1
- package/dist/{createChartCrosshairPlugin-B4e8d8OF.cjs → createChartCrosshairPlugin-BTPv09h4.cjs} +1 -1
- package/dist/{createChartCrosshairPlugin-C2NUAO5s.js → createChartCrosshairPlugin-EqMlaexu.js} +2 -2
- package/dist/createChartMarkersPlugin-BKxLg4pL.cjs +1 -0
- package/dist/{createChartMarkersPlugin-DkXituwE.js → createChartMarkersPlugin-DPvfZp_e.js} +11 -11
- package/dist/entries/chart-bar.cjs +1 -1
- package/dist/entries/chart-bar.js +1 -1
- package/dist/entries/chart-burnup.cjs +1 -1
- package/dist/entries/chart-burnup.js +1 -1
- package/dist/entries/chart-horizontal-bar.cjs +1 -1
- package/dist/entries/chart-horizontal-bar.js +1 -1
- package/dist/entries/chart-line.cjs +1 -1
- package/dist/entries/chart-line.js +1 -1
- package/dist/entries/chart-multi-line.cjs +1 -1
- package/dist/entries/chart-multi-line.js +1 -1
- package/dist/entries/chart-pie.cjs +1 -1
- package/dist/entries/chart-pie.d.ts +2 -2
- package/dist/entries/chart-pie.d.ts.map +1 -1
- package/dist/entries/chart-pie.js +2 -2
- package/dist/entries/chart-progress.cjs +1 -1
- package/dist/entries/chart-progress.js +1 -1
- package/dist/entries/chart-stacked-area.cjs +1 -1
- package/dist/entries/chart-stacked-area.js +1 -1
- package/dist/entries/chart-stacked-bar.cjs +1 -1
- package/dist/entries/chart-stacked-bar.js +1 -1
- package/dist/entries/table.cjs +1 -1
- package/dist/entries/table.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +569 -303
- package/dist/resolveBarStackedSeriesColor-CjwUxrUx.js +11 -0
- package/dist/resolveBarStackedSeriesColor-Czkj5bJY.cjs +1 -0
- package/dist/resolveCssColorValue-BFMo08-w.cjs +1 -0
- package/dist/resolveCssColorValue-DH_SEZj4.js +8 -0
- package/dist/resolveSeriesPaletteColor-BepW1gdW.cjs +1 -0
- package/dist/{resolveSeriesPaletteColor-B7wHDj1L.js → resolveSeriesPaletteColor-DoPeNP_F.js} +3 -2
- package/dist/{resolveStackedChartContext-DxJNWqwE.js → resolveStackedChartContext-BbCzct6O.js} +5 -5
- package/dist/{resolveStackedChartContext-Br3N7ISo.cjs → resolveStackedChartContext-D4tuSA6Z.cjs} +1 -1
- package/dist/splitChartAxisLabel-D-IFyucJ.js +4 -0
- package/dist/splitChartAxisLabel-DAmQOJn6.cjs +2 -0
- package/dist/uikit-components.css +1 -1
- package/dist/useChartInteractivity-CaZ37kX-.cjs +1 -0
- package/dist/{useChartInteractivity-Cl06JL4l.js → useChartInteractivity-DygkiRA1.js} +178 -144
- package/dist/utils/chart/burnup/createBurnupTooltipCallbacks.d.ts +3 -1
- package/dist/utils/chart/burnup/createBurnupTooltipCallbacks.d.ts.map +1 -1
- package/dist/utils/chart/chart.types.d.ts +10 -0
- package/dist/utils/chart/chart.types.d.ts.map +1 -1
- package/dist/utils/chart/core/applyChartHighlightedYTick.d.ts +19 -0
- package/dist/utils/chart/core/applyChartHighlightedYTick.d.ts.map +1 -0
- package/dist/utils/chart/core/chartCssVariables.d.ts +3 -0
- package/dist/utils/chart/core/chartCssVariables.d.ts.map +1 -1
- package/dist/utils/chart/core/chartInteractivity.d.ts +9 -2
- package/dist/utils/chart/core/chartInteractivity.d.ts.map +1 -1
- package/dist/utils/chart/core/createChartMarkersPlugin.d.ts.map +1 -1
- package/dist/utils/chart/core/resolveSeriesPaletteColor.d.ts.map +1 -1
- package/dist/utils/chart/core/splitChartAxisLabel.d.ts +2 -0
- package/dist/utils/chart/core/splitChartAxisLabel.d.ts.map +1 -0
- package/dist/utils/chart/css/resolveCssColorValue.d.ts +2 -0
- package/dist/utils/chart/css/resolveCssColorValue.d.ts.map +1 -0
- package/dist/utils/chart/horizontalBar/resolveHorizontalBarColor.d.ts.map +1 -1
- package/dist/utils/chart/index.d.ts +4 -1
- package/dist/utils/chart/index.d.ts.map +1 -1
- package/dist/utils/chart/multiLine/buildMultiLineChartScales.d.ts +119 -14
- package/dist/utils/chart/multiLine/buildMultiLineChartScales.d.ts.map +1 -1
- package/dist/utils/chart/multiLine/createMultiLineTooltipCallbacks.d.ts +7 -2
- package/dist/utils/chart/multiLine/createMultiLineTooltipCallbacks.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/SChartBar-CUAibXox.js +0 -215
- package/dist/SChartBar-xzw8oxXl.cjs +0 -1
- package/dist/SChartBurnup-C5Z7UDi-.js +0 -250
- package/dist/SChartBurnup-CWSJUoA_.cjs +0 -1
- package/dist/SChartHorizontalBar-0RpJa5EJ.cjs +0 -1
- package/dist/SChartHorizontalBar-B9SWFvdN.js +0 -175
- package/dist/SChartLegend-DGtjd6zV.cjs +0 -1
- package/dist/SChartLegend-oZoF8XK7.js +0 -42
- package/dist/SChartMultiLine-CG6dKmWm.js +0 -244
- package/dist/SChartMultiLine-vz7JdyA3.cjs +0 -1
- package/dist/SChartPie-0ugeo2fO.js +0 -182
- package/dist/SChartPie-QpnxLQYv.cjs +0 -1
- package/dist/STable-BHTC8_Gq.cjs +0 -1
- package/dist/buildMultiLineChartScales-7mcIfRVG.cjs +0 -1
- package/dist/buildMultiLineChartScales-CFZ8YVeJ.js +0 -19
- package/dist/createChartMarkersPlugin-Cg1yGzxW.cjs +0 -1
- package/dist/resolveBarStackedSeriesColor-DM7Ax0-s.js +0 -11
- package/dist/resolveBarStackedSeriesColor-z3NP5vAS.cjs +0 -1
- package/dist/resolveSeriesPaletteColor-D0XlU5vT.cjs +0 -1
- package/dist/useChartInteractivity-LbJiqlvI.cjs +0 -1
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./SChartLegend-oZoF8XK7.js";
|
|
2
|
-
import { C as t, E as n, T as r, a as i, b as a, c as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, y as g } from "./useChartInteractivity-Cl06JL4l.js";
|
|
3
|
-
import { t as _ } from "./resolveChartValueRange-DZybnmaX.js";
|
|
4
|
-
import { n as v, t as y } from "./createChartMarkersPlugin-DkXituwE.js";
|
|
5
|
-
import { t as b } from "./areChartSeriesAligned-DjonrIMm.js";
|
|
6
|
-
import { t as x } from "./createChartCrosshairPlugin-C2NUAO5s.js";
|
|
7
|
-
import { t as S } from "./resolveSeriesPaletteColor-B7wHDj1L.js";
|
|
8
|
-
import { t as C } from "./buildMultiLineChartScales-CFZ8YVeJ.js";
|
|
9
|
-
import { n as w, t as T } from "./buildChartSeriesPoints-BTyOpkin.js";
|
|
10
|
-
import { t as E } from "./useHasListener-RSjlUyqH.js";
|
|
11
|
-
import { computed as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createVNode as M, defineComponent as N, normalizeClass as P, normalizeStyle as F, openBlock as I, unref as L, useTemplateRef as R, withCtx as z } from "vue";
|
|
12
|
-
//#region src/utils/chart/multiLine/resolveMultiLineSeriesColor.ts
|
|
13
|
-
var B = (e, n, r, i = !1) => S(e, n, r, i, {
|
|
14
|
-
palette: a,
|
|
15
|
-
paletteFallback: g.multiLinePalette1,
|
|
16
|
-
skeletonPalette: t,
|
|
17
|
-
skeletonFallback: g.skeletonPalette1
|
|
18
|
-
}), V = 3, H = .4, U = 4, W = 5, G = [8, 8], K = 16, q = "--s-ui-chart-multi-line-danger-fill", J = (e, t, n, r, i) => {
|
|
19
|
-
let a = e.flatMap((e) => e.points.map((e) => e.value));
|
|
20
|
-
return i ? {
|
|
21
|
-
min: t ?? 0,
|
|
22
|
-
max: n ?? _(a, { yStep: r }).max
|
|
23
|
-
} : _(a, {
|
|
24
|
-
yMin: t,
|
|
25
|
-
yMax: n,
|
|
26
|
-
yStep: r
|
|
27
|
-
});
|
|
28
|
-
}, Y = (e, t, n) => t ? {
|
|
29
|
-
target: { value: 0 },
|
|
30
|
-
...e ? {} : { above: s },
|
|
31
|
-
below: n
|
|
32
|
-
} : e ? "origin" : !1, X = ({ seriesList: e, colorHostElement: t, yMax: n, yMin: a, yStep: u = W, mirrorYAxis: h = !0, straightSegments: _ = !1, zeroLine: S = !1, dangerBelowZero: w = !1, markers: T = [], skeleton: E = !1, onSeriesClick: D }) => {
|
|
33
|
-
if (!b(e)) return null;
|
|
34
|
-
let O = r(g.axisLabel, t), k = r(g.grid, t), A = r(q, t), j = r(g.tooltipBackground, t), M = r(g.tooltipText, t), N = J(e, a, n, u, E), P = e[0]?.points.map((e) => e.label) ?? [], F = p({
|
|
35
|
-
kind: "series",
|
|
36
|
-
skeleton: E,
|
|
37
|
-
colorHostElement: t,
|
|
38
|
-
onIndexClick: D
|
|
39
|
-
});
|
|
40
|
-
return {
|
|
41
|
-
type: "line",
|
|
42
|
-
data: {
|
|
43
|
-
labels: P,
|
|
44
|
-
datasets: e.map((e, n) => {
|
|
45
|
-
let r = B(n, t, e.fillColor, E), a = !!e.area && !E, o = w && n === 0 && !E, c = a ? (e) => d(e, r, s, i) : r;
|
|
46
|
-
return {
|
|
47
|
-
label: e.label,
|
|
48
|
-
data: e.points.map((e) => e.value),
|
|
49
|
-
borderColor: r,
|
|
50
|
-
backgroundColor: c,
|
|
51
|
-
pointBackgroundColor: r,
|
|
52
|
-
pointHoverBackgroundColor: r,
|
|
53
|
-
...E ? {} : {
|
|
54
|
-
hoverBorderColor: r,
|
|
55
|
-
hoverBackgroundColor: c
|
|
56
|
-
},
|
|
57
|
-
borderWidth: U,
|
|
58
|
-
...e.dashed && !E ? { borderDash: G } : {},
|
|
59
|
-
fill: Y(a, o, A),
|
|
60
|
-
pointRadius: _ && !E ? V : 0,
|
|
61
|
-
pointHoverRadius: 4,
|
|
62
|
-
tension: _ ? 0 : H
|
|
63
|
-
};
|
|
64
|
-
})
|
|
65
|
-
},
|
|
66
|
-
options: {
|
|
67
|
-
responsive: !0,
|
|
68
|
-
maintainAspectRatio: !1,
|
|
69
|
-
layout: { padding: { top: T.length > 0 ? K : 0 } },
|
|
70
|
-
onHover: F.onHover,
|
|
71
|
-
onClick: F.onClick,
|
|
72
|
-
interaction: m(E, {
|
|
73
|
-
mode: "index",
|
|
74
|
-
intersect: !1
|
|
75
|
-
}),
|
|
76
|
-
hover: E ? void 0 : {
|
|
77
|
-
mode: "nearest",
|
|
78
|
-
intersect: !1
|
|
79
|
-
},
|
|
80
|
-
plugins: {
|
|
81
|
-
legend: { display: !1 },
|
|
82
|
-
tooltip: {
|
|
83
|
-
enabled: o(E),
|
|
84
|
-
backgroundColor: j,
|
|
85
|
-
titleColor: M,
|
|
86
|
-
bodyColor: M,
|
|
87
|
-
footerColor: M,
|
|
88
|
-
displayColors: !1,
|
|
89
|
-
position: f,
|
|
90
|
-
yAlign: "bottom",
|
|
91
|
-
xAlign: "center",
|
|
92
|
-
caretPadding: 8,
|
|
93
|
-
callbacks: l()
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
scales: C({
|
|
97
|
-
axisLabelColor: O,
|
|
98
|
-
gridColor: k,
|
|
99
|
-
yMin: N.min,
|
|
100
|
-
yMax: N.max,
|
|
101
|
-
yStep: u,
|
|
102
|
-
mirrorYAxis: h
|
|
103
|
-
})
|
|
104
|
-
},
|
|
105
|
-
plugins: c(E, [
|
|
106
|
-
...S ? [v(t)] : [],
|
|
107
|
-
x(t),
|
|
108
|
-
...T.length > 0 ? [y({ markers: T }, t)] : [],
|
|
109
|
-
...F.plugins
|
|
110
|
-
])
|
|
111
|
-
};
|
|
112
|
-
}, Z = [
|
|
113
|
-
"26.01",
|
|
114
|
-
"2.02",
|
|
115
|
-
"9.02",
|
|
116
|
-
"16.02",
|
|
117
|
-
"23.02",
|
|
118
|
-
"2.03",
|
|
119
|
-
"9.03",
|
|
120
|
-
"16.03",
|
|
121
|
-
"23.03",
|
|
122
|
-
"30.03",
|
|
123
|
-
"6.04"
|
|
124
|
-
], Q = [{
|
|
125
|
-
label: "Series 1",
|
|
126
|
-
points: T(Z, [
|
|
127
|
-
30,
|
|
128
|
-
34,
|
|
129
|
-
38,
|
|
130
|
-
44,
|
|
131
|
-
46,
|
|
132
|
-
50,
|
|
133
|
-
54,
|
|
134
|
-
56,
|
|
135
|
-
58,
|
|
136
|
-
60,
|
|
137
|
-
62
|
|
138
|
-
])
|
|
139
|
-
}, {
|
|
140
|
-
label: "Series 2",
|
|
141
|
-
points: T(Z, [
|
|
142
|
-
22,
|
|
143
|
-
24,
|
|
144
|
-
26,
|
|
145
|
-
28,
|
|
146
|
-
30,
|
|
147
|
-
32,
|
|
148
|
-
33,
|
|
149
|
-
35,
|
|
150
|
-
36,
|
|
151
|
-
38,
|
|
152
|
-
40
|
|
153
|
-
])
|
|
154
|
-
}], $ = { class: "s-ui-chart-multi-line__canvas-wrap" }, ee = /* @__PURE__ */ N({
|
|
155
|
-
__name: "SChartMultiLine",
|
|
156
|
-
props: {
|
|
157
|
-
series: { default: () => [] },
|
|
158
|
-
loading: {
|
|
159
|
-
type: Boolean,
|
|
160
|
-
default: !1
|
|
161
|
-
},
|
|
162
|
-
yMax: {},
|
|
163
|
-
yMin: {},
|
|
164
|
-
yStep: {},
|
|
165
|
-
mirrorYAxis: {
|
|
166
|
-
type: Boolean,
|
|
167
|
-
default: !0
|
|
168
|
-
},
|
|
169
|
-
straightSegments: {
|
|
170
|
-
type: Boolean,
|
|
171
|
-
default: !1
|
|
172
|
-
},
|
|
173
|
-
zeroLine: {
|
|
174
|
-
type: Boolean,
|
|
175
|
-
default: !1
|
|
176
|
-
},
|
|
177
|
-
dangerBelowZero: {
|
|
178
|
-
type: Boolean,
|
|
179
|
-
default: !1
|
|
180
|
-
},
|
|
181
|
-
markers: { default: () => [] },
|
|
182
|
-
showLegend: {
|
|
183
|
-
type: Boolean,
|
|
184
|
-
default: !0
|
|
185
|
-
},
|
|
186
|
-
height: {}
|
|
187
|
-
},
|
|
188
|
-
emits: ["seriesClick"],
|
|
189
|
-
setup(t, { expose: r, emit: i }) {
|
|
190
|
-
let a = i, o = R("chartRootRef"), s = R("chartCanvasRef"), c = D(() => t.loading ? Q : t.series), l = (e) => {
|
|
191
|
-
let n = t.series[e];
|
|
192
|
-
n && a("seriesClick", e, n);
|
|
193
|
-
}, d = E("onSeriesClick"), f = D(() => {
|
|
194
|
-
if (t.height !== void 0) return { "--s-ui-chart-multi-line-viewport-height": typeof t.height == "number" ? `${t.height}px` : t.height };
|
|
195
|
-
}), p = D(() => !t.loading && t.series.length === 0 ? null : X({
|
|
196
|
-
seriesList: c.value,
|
|
197
|
-
colorHostElement: o.value,
|
|
198
|
-
yMax: t.yMax,
|
|
199
|
-
yMin: t.yMin,
|
|
200
|
-
yStep: t.yStep,
|
|
201
|
-
mirrorYAxis: t.mirrorYAxis,
|
|
202
|
-
straightSegments: t.straightSegments,
|
|
203
|
-
zeroLine: t.zeroLine,
|
|
204
|
-
dangerBelowZero: t.dangerBelowZero,
|
|
205
|
-
markers: t.markers,
|
|
206
|
-
skeleton: t.loading,
|
|
207
|
-
onSeriesClick: d() ? l : void 0
|
|
208
|
-
})), m = D(() => w(c.value, (e, n) => B(e, o.value, n, t.loading))), { chartInstance: g } = u({
|
|
209
|
-
canvasRef: s,
|
|
210
|
-
config: p,
|
|
211
|
-
enabled: D(() => t.loading || t.series.length > 0)
|
|
212
|
-
}), { exportImage: _, handleLegendItemHover: v } = h({
|
|
213
|
-
chartInstance: g,
|
|
214
|
-
canvasRef: s,
|
|
215
|
-
colorHostElement: o
|
|
216
|
-
});
|
|
217
|
-
return r({ exportImage: _ }), (r, i) => (I(), A("div", {
|
|
218
|
-
ref_key: "chartRootRef",
|
|
219
|
-
ref: o,
|
|
220
|
-
class: P(["s-ui-chart-multi-line", { "s-ui-chart-multi-line--skeleton": t.loading }]),
|
|
221
|
-
style: F(f.value)
|
|
222
|
-
}, [j("div", $, [M(L(n), { loading: t.loading }, {
|
|
223
|
-
default: z(() => [j("canvas", {
|
|
224
|
-
ref_key: "chartCanvasRef",
|
|
225
|
-
ref: s,
|
|
226
|
-
class: "s-ui-chart-multi-line__canvas"
|
|
227
|
-
}, null, 512)]),
|
|
228
|
-
_: 1
|
|
229
|
-
}, 8, ["loading"])]), t.showLegend && m.value.length ? (I(), O(L(e), {
|
|
230
|
-
key: 0,
|
|
231
|
-
items: m.value,
|
|
232
|
-
disabled: t.loading,
|
|
233
|
-
interactive: !t.loading,
|
|
234
|
-
onItemHover: L(v)
|
|
235
|
-
}, null, 8, [
|
|
236
|
-
"items",
|
|
237
|
-
"disabled",
|
|
238
|
-
"interactive",
|
|
239
|
-
"onItemHover"
|
|
240
|
-
])) : k("", !0)], 6));
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
//#endregion
|
|
244
|
-
export { ee as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SChartLegend-DGtjd6zV.cjs"),t=require("./useChartInteractivity-LbJiqlvI.cjs"),n=require("./resolveChartValueRange-DBCYLCXs.cjs"),r=require("./createChartMarkersPlugin-Cg1yGzxW.cjs"),i=require("./areChartSeriesAligned-DiBX3TTk.cjs"),a=require("./createChartCrosshairPlugin-B4e8d8OF.cjs"),o=require("./resolveSeriesPaletteColor-D0XlU5vT.cjs"),s=require("./buildMultiLineChartScales-7mcIfRVG.cjs"),c=require("./buildChartSeriesPoints-Cqo2ed-n.cjs"),l=require("./useHasListener-BPgtbbo6.cjs");let u=require("vue");var d=(e,n,r,i=!1)=>o.t(e,n,r,i,{palette:t.b,paletteFallback:t.y.multiLinePalette1,skeletonPalette:t.C,skeletonFallback:t.y.skeletonPalette1}),f=3,p=.4,m=4,h=5,g=[8,8],_=16,v=`--s-ui-chart-multi-line-danger-fill`,y=(e,t,r,i,a)=>{let o=e.flatMap(e=>e.points.map(e=>e.value));return a?{min:t??0,max:r??n.t(o,{yStep:i}).max}:n.t(o,{yMin:t,yMax:r,yStep:i})},b=(e,n,r)=>n?{target:{value:0},...e?{}:{above:t.i},below:r}:e?`origin`:!1,x=({seriesList:e,colorHostElement:n,yMax:o,yMin:c,yStep:l=h,mirrorYAxis:u=!0,straightSegments:x=!1,zeroLine:S=!1,dangerBelowZero:C=!1,markers:w=[],skeleton:T=!1,onSeriesClick:E})=>{if(!i.t(e))return null;let D=t.T(t.y.axisLabel,n),O=t.T(t.y.grid,n),k=t.T(v,n),A=t.T(t.y.tooltipBackground,n),j=t.T(t.y.tooltipText,n),M=y(e,c,o,l,T),N=e[0]?.points.map(e=>e.label)??[],P=t.r({kind:`series`,skeleton:T,colorHostElement:n,onIndexClick:E});return{type:`line`,data:{labels:N,datasets:e.map((e,r)=>{let i=d(r,n,e.fillColor,T),a=!!e.area&&!T,o=C&&r===0&&!T,s=a?e=>t.o(e,i,t.i,t.a):i;return{label:e.label,data:e.points.map(e=>e.value),borderColor:i,backgroundColor:s,pointBackgroundColor:i,pointHoverBackgroundColor:i,...T?{}:{hoverBorderColor:i,hoverBackgroundColor:s},borderWidth:m,...e.dashed&&!T?{borderDash:g}:{},fill:b(a,o,k),pointRadius:x&&!T?f:0,pointHoverRadius:4,tension:x?0:p}})},options:{responsive:!0,maintainAspectRatio:!1,layout:{padding:{top:w.length>0?_:0}},onHover:P.onHover,onClick:P.onClick,interaction:t.s(T,{mode:`index`,intersect:!1}),hover:T?void 0:{mode:`nearest`,intersect:!1},plugins:{legend:{display:!1},tooltip:{enabled:t.c(T),backgroundColor:A,titleColor:j,bodyColor:j,footerColor:j,displayColors:!1,position:t.p,yAlign:`bottom`,xAlign:`center`,caretPadding:8,callbacks:t.m()}},scales:s.t({axisLabelColor:D,gridColor:O,yMin:M.min,yMax:M.max,yStep:l,mirrorYAxis:u})},plugins:t.l(T,[...S?[r.n(n)]:[],a.t(n),...w.length>0?[r.t({markers:w},n)]:[],...P.plugins])}},S=[`26.01`,`2.02`,`9.02`,`16.02`,`23.02`,`2.03`,`9.03`,`16.03`,`23.03`,`30.03`,`6.04`],C=[{label:`Series 1`,points:c.t(S,[30,34,38,44,46,50,54,56,58,60,62])},{label:`Series 2`,points:c.t(S,[22,24,26,28,30,32,33,35,36,38,40])}],w={class:`s-ui-chart-multi-line__canvas-wrap`},T=(0,u.defineComponent)({__name:`SChartMultiLine`,props:{series:{default:()=>[]},loading:{type:Boolean,default:!1},yMax:{},yMin:{},yStep:{},mirrorYAxis:{type:Boolean,default:!0},straightSegments:{type:Boolean,default:!1},zeroLine:{type:Boolean,default:!1},dangerBelowZero:{type:Boolean,default:!1},markers:{default:()=>[]},showLegend:{type:Boolean,default:!0},height:{}},emits:[`seriesClick`],setup(n,{expose:r,emit:i}){let a=i,o=(0,u.useTemplateRef)(`chartRootRef`),s=(0,u.useTemplateRef)(`chartCanvasRef`),f=(0,u.computed)(()=>n.loading?C:n.series),p=e=>{let t=n.series[e];t&&a(`seriesClick`,e,t)},m=l.t(`onSeriesClick`),h=(0,u.computed)(()=>{if(n.height!==void 0)return{"--s-ui-chart-multi-line-viewport-height":typeof n.height==`number`?`${n.height}px`:n.height}}),g=(0,u.computed)(()=>!n.loading&&n.series.length===0?null:x({seriesList:f.value,colorHostElement:o.value,yMax:n.yMax,yMin:n.yMin,yStep:n.yStep,mirrorYAxis:n.mirrorYAxis,straightSegments:n.straightSegments,zeroLine:n.zeroLine,dangerBelowZero:n.dangerBelowZero,markers:n.markers,skeleton:n.loading,onSeriesClick:m()?p:void 0})),_=(0,u.computed)(()=>c.n(f.value,(e,t)=>d(e,o.value,t,n.loading))),{chartInstance:v}=t.n({canvasRef:s,config:g,enabled:(0,u.computed)(()=>n.loading||n.series.length>0)}),{exportImage:y,handleLegendItemHover:b}=t.t({chartInstance:v,canvasRef:s,colorHostElement:o});return r({exportImage:y}),(r,i)=>((0,u.openBlock)(),(0,u.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:o,class:(0,u.normalizeClass)([`s-ui-chart-multi-line`,{"s-ui-chart-multi-line--skeleton":n.loading}]),style:(0,u.normalizeStyle)(h.value)},[(0,u.createElementVNode)(`div`,w,[(0,u.createVNode)((0,u.unref)(t.E),{loading:n.loading},{default:(0,u.withCtx)(()=>[(0,u.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:s,class:`s-ui-chart-multi-line__canvas`},null,512)]),_:1},8,[`loading`])]),n.showLegend&&_.value.length?((0,u.openBlock)(),(0,u.createBlock)((0,u.unref)(e.t),{key:0,items:_.value,disabled:n.loading,interactive:!n.loading,onItemHover:(0,u.unref)(b)},null,8,[`items`,`disabled`,`interactive`,`onItemHover`])):(0,u.createCommentVNode)(``,!0)],6))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return T}});
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./SChartLegend-oZoF8XK7.js";
|
|
2
|
-
import { D as t, E as n, S as r, T as i, c as a, l as o, n as s, r as c, s as l, t as u, x as d, y as f } from "./useChartInteractivity-Cl06JL4l.js";
|
|
3
|
-
import { t as p } from "./resolveSeriesPaletteColor-B7wHDj1L.js";
|
|
4
|
-
import { t as m } from "./useHasListener-RSjlUyqH.js";
|
|
5
|
-
import { computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createVNode as b, defineComponent as x, normalizeClass as S, openBlock as C, unref as w, useTemplateRef as T, withCtx as E } from "vue";
|
|
6
|
-
//#region src/utils/chart/pie/resolvePieSliceColor.ts
|
|
7
|
-
var D = (e, t, n, i = !1) => p(e, t, n, i, {
|
|
8
|
-
palette: r,
|
|
9
|
-
paletteFallback: f.piePalette1,
|
|
10
|
-
skeletonPalette: d,
|
|
11
|
-
skeletonFallback: f.pieSkeletonPalette1
|
|
12
|
-
}), O = (e) => ({
|
|
13
|
-
title: () => "",
|
|
14
|
-
label: (t) => {
|
|
15
|
-
let n = t.label ?? "", r = t.parsed ?? 0;
|
|
16
|
-
return `${n} – ${e ? e(r) : `${r}`}`;
|
|
17
|
-
}
|
|
18
|
-
}), k = 4, A = 4, j = 1, M = "400 12px var(--s-ui-font-family-label)", N = (e, t, n, r, i, a) => {
|
|
19
|
-
let o = Math.min(a, r / 2, i / 2);
|
|
20
|
-
e.beginPath(), e.moveTo(t + o, n), e.lineTo(t + r - o, n), e.arcTo(t + r, n, t + r, n + o, o), e.lineTo(t + r, n + i - o), e.arcTo(t + r, n + i, t + r - o, n + i, o), e.lineTo(t + o, n + i), e.arcTo(t, n + i, t, n + i - o, o), e.lineTo(t, n + o), e.arcTo(t, n, t + o, n, o), e.closePath();
|
|
21
|
-
}, P = (e) => !("getCenterPoint" in e) || typeof e.getCenterPoint != "function" ? null : e.getCenterPoint(!1), F = (e, t) => ({
|
|
22
|
-
id: "pieSegmentBadge",
|
|
23
|
-
afterDatasetsDraw(n) {
|
|
24
|
-
let r = n.getDatasetMeta(0);
|
|
25
|
-
if (!r) return;
|
|
26
|
-
let a = i(f.pieBadgeBackground, e), o = i(f.pieBadgeBorder, e), s = i(f.pieBadgeText, e), { ctx: c } = n;
|
|
27
|
-
c.save(), c.font = M, c.textAlign = "center", c.textBaseline = "middle";
|
|
28
|
-
for (let e = 0; e < r.data.length; e += 1) {
|
|
29
|
-
let i = r.data[e], l = n.data.datasets[0]?.data[e], u = i ? P(i) : null;
|
|
30
|
-
if (i && typeof l == "number" && l > 0 && u) {
|
|
31
|
-
let e = t ? t(l) : `${l}`, n = c.measureText(e).width + k * 2;
|
|
32
|
-
N(c, u.x - n / 2, u.y - 20 / 2, n, 20, A), c.fillStyle = a, c.fill(), c.lineWidth = j, c.strokeStyle = o, c.stroke(), c.fillStyle = s, c.fillText(e, u.x, u.y);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
c.restore();
|
|
36
|
-
}
|
|
37
|
-
}), I = ({ sliceList: e, colorHostElement: t, skeleton: n = !1, formatValue: r, showBadges: s = !0, onSliceClick: u }) => {
|
|
38
|
-
if (e.length === 0) return null;
|
|
39
|
-
let d = i(f.pieSegmentBorder, t), p = i(f.tooltipBackground, t), m = i(f.tooltipText, t), h = e.map((e, r) => D(r, t, e.fillColor, n)), g = c({
|
|
40
|
-
kind: "element",
|
|
41
|
-
skeleton: n,
|
|
42
|
-
colorHostElement: t,
|
|
43
|
-
onIndexClick: u
|
|
44
|
-
});
|
|
45
|
-
return {
|
|
46
|
-
type: "pie",
|
|
47
|
-
data: {
|
|
48
|
-
labels: e.map((e) => e.label),
|
|
49
|
-
datasets: [{
|
|
50
|
-
data: e.map((e) => e.value),
|
|
51
|
-
backgroundColor: h,
|
|
52
|
-
hoverBackgroundColor: h,
|
|
53
|
-
borderColor: d,
|
|
54
|
-
hoverBorderColor: d,
|
|
55
|
-
borderWidth: 4,
|
|
56
|
-
hoverBorderWidth: 4,
|
|
57
|
-
hoverOffset: 26,
|
|
58
|
-
spacing: 0,
|
|
59
|
-
borderRadius: 8
|
|
60
|
-
}]
|
|
61
|
-
},
|
|
62
|
-
options: {
|
|
63
|
-
responsive: !0,
|
|
64
|
-
maintainAspectRatio: !0,
|
|
65
|
-
cutout: "58%",
|
|
66
|
-
rotation: 115,
|
|
67
|
-
layout: { padding: 26 },
|
|
68
|
-
onHover: g.onHover,
|
|
69
|
-
onClick: g.onClick,
|
|
70
|
-
interaction: l(n, {
|
|
71
|
-
mode: "nearest",
|
|
72
|
-
intersect: !0
|
|
73
|
-
}),
|
|
74
|
-
plugins: {
|
|
75
|
-
legend: { display: !1 },
|
|
76
|
-
tooltip: {
|
|
77
|
-
enabled: a(n),
|
|
78
|
-
backgroundColor: p,
|
|
79
|
-
titleColor: m,
|
|
80
|
-
bodyColor: m,
|
|
81
|
-
displayColors: !1,
|
|
82
|
-
callbacks: O(r)
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
plugins: o(n, [...s ? [F(t, r)] : [], ...g.plugins])
|
|
87
|
-
};
|
|
88
|
-
}, L = [
|
|
89
|
-
"Series 1",
|
|
90
|
-
"Series 2",
|
|
91
|
-
"Series 3",
|
|
92
|
-
"Series 4",
|
|
93
|
-
"Series 5",
|
|
94
|
-
"Series 6",
|
|
95
|
-
"Series 7",
|
|
96
|
-
"Series 8"
|
|
97
|
-
], R = [
|
|
98
|
-
4,
|
|
99
|
-
1,
|
|
100
|
-
1,
|
|
101
|
-
1,
|
|
102
|
-
1,
|
|
103
|
-
1,
|
|
104
|
-
1,
|
|
105
|
-
1
|
|
106
|
-
], z = L.map((e, t) => ({
|
|
107
|
-
label: e,
|
|
108
|
-
value: R[t] ?? 1
|
|
109
|
-
})), B = { class: "s-ui-chart-pie__canvas-wrap" }, V = /* @__PURE__ */ x({
|
|
110
|
-
__name: "SChartPie",
|
|
111
|
-
props: {
|
|
112
|
-
slices: { default: () => [] },
|
|
113
|
-
loading: {
|
|
114
|
-
type: Boolean,
|
|
115
|
-
default: !1
|
|
116
|
-
},
|
|
117
|
-
showLegend: {
|
|
118
|
-
type: Boolean,
|
|
119
|
-
default: !0
|
|
120
|
-
},
|
|
121
|
-
formatValue: { type: Function },
|
|
122
|
-
showBadges: {
|
|
123
|
-
type: Boolean,
|
|
124
|
-
default: !0
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
emits: ["sliceClick"],
|
|
128
|
-
setup(r, { expose: i, emit: a }) {
|
|
129
|
-
let o = a, c = t, l = T("chartRootRef"), d = T("chartCanvasRef"), f = h(() => r.loading ? z : r.slices), p = (e) => {
|
|
130
|
-
let t = r.slices[e];
|
|
131
|
-
t && o("sliceClick", e, t);
|
|
132
|
-
}, x = m("onSliceClick"), O = h(() => !r.loading && r.slices.length === 0 ? null : I({
|
|
133
|
-
sliceList: f.value,
|
|
134
|
-
colorHostElement: l.value,
|
|
135
|
-
skeleton: r.loading,
|
|
136
|
-
formatValue: r.formatValue,
|
|
137
|
-
showBadges: r.showBadges,
|
|
138
|
-
onSliceClick: x() ? p : void 0
|
|
139
|
-
})), k = h(() => f.value.map((e, t) => ({
|
|
140
|
-
label: e.label,
|
|
141
|
-
color: D(t, l.value, e.fillColor, r.loading)
|
|
142
|
-
}))), { chartInstance: A } = s({
|
|
143
|
-
canvasRef: d,
|
|
144
|
-
config: O,
|
|
145
|
-
enabled: h(() => r.loading || r.slices.length > 0)
|
|
146
|
-
}), { exportImage: j, handleLegendItemHover: M } = u({
|
|
147
|
-
chartInstance: A,
|
|
148
|
-
canvasRef: d,
|
|
149
|
-
colorHostElement: l,
|
|
150
|
-
legendDimKind: "element"
|
|
151
|
-
});
|
|
152
|
-
return i({ exportImage: j }), (t, i) => (C(), v("div", {
|
|
153
|
-
ref_key: "chartRootRef",
|
|
154
|
-
ref: l,
|
|
155
|
-
class: S(["s-ui-chart-pie", { "s-ui-chart-pie--skeleton": r.loading }])
|
|
156
|
-
}, [y("div", B, [b(w(n), {
|
|
157
|
-
loading: r.loading,
|
|
158
|
-
type: w(c).PIE
|
|
159
|
-
}, {
|
|
160
|
-
default: E(() => [y("canvas", {
|
|
161
|
-
ref_key: "chartCanvasRef",
|
|
162
|
-
ref: d,
|
|
163
|
-
class: "s-ui-chart-pie__canvas"
|
|
164
|
-
}, null, 512)]),
|
|
165
|
-
_: 1
|
|
166
|
-
}, 8, ["loading", "type"])]), r.showLegend && k.value.length ? (C(), g(w(e), {
|
|
167
|
-
key: 0,
|
|
168
|
-
items: k.value,
|
|
169
|
-
disabled: r.loading,
|
|
170
|
-
interactive: !r.loading,
|
|
171
|
-
direction: "column",
|
|
172
|
-
onItemHover: w(M)
|
|
173
|
-
}, null, 8, [
|
|
174
|
-
"items",
|
|
175
|
-
"disabled",
|
|
176
|
-
"interactive",
|
|
177
|
-
"onItemHover"
|
|
178
|
-
])) : _("", !0)], 2));
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
//#endregion
|
|
182
|
-
export { V as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SChartLegend-DGtjd6zV.cjs"),t=require("./useChartInteractivity-LbJiqlvI.cjs"),n=require("./resolveSeriesPaletteColor-D0XlU5vT.cjs"),r=require("./useHasListener-BPgtbbo6.cjs");let i=require("vue");var a=(e,r,i,a=!1)=>n.t(e,r,i,a,{palette:t.S,paletteFallback:t.y.piePalette1,skeletonPalette:t.x,skeletonFallback:t.y.pieSkeletonPalette1}),o=e=>({title:()=>``,label:t=>{let n=t.label??``,r=t.parsed??0;return`${n} – ${e?e(r):`${r}`}`}}),s=4,c=4,l=1,u=`400 12px var(--s-ui-font-family-label)`,d=(e,t,n,r,i,a)=>{let o=Math.min(a,r/2,i/2);e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.arcTo(t+r,n,t+r,n+o,o),e.lineTo(t+r,n+i-o),e.arcTo(t+r,n+i,t+r-o,n+i,o),e.lineTo(t+o,n+i),e.arcTo(t,n+i,t,n+i-o,o),e.lineTo(t,n+o),e.arcTo(t,n,t+o,n,o),e.closePath()},f=e=>!(`getCenterPoint`in e)||typeof e.getCenterPoint!=`function`?null:e.getCenterPoint(!1),p=(e,n)=>({id:`pieSegmentBadge`,afterDatasetsDraw(r){let i=r.getDatasetMeta(0);if(!i)return;let a=t.T(t.y.pieBadgeBackground,e),o=t.T(t.y.pieBadgeBorder,e),p=t.T(t.y.pieBadgeText,e),{ctx:m}=r;m.save(),m.font=u,m.textAlign=`center`,m.textBaseline=`middle`;for(let e=0;e<i.data.length;e+=1){let t=i.data[e],u=r.data.datasets[0]?.data[e],h=t?f(t):null;if(t&&typeof u==`number`&&u>0&&h){let e=n?n(u):`${u}`,t=m.measureText(e).width+s*2;d(m,h.x-t/2,h.y-20/2,t,20,c),m.fillStyle=a,m.fill(),m.lineWidth=l,m.strokeStyle=o,m.stroke(),m.fillStyle=p,m.fillText(e,h.x,h.y)}}m.restore()}}),m=({sliceList:e,colorHostElement:n,skeleton:r=!1,formatValue:i,showBadges:s=!0,onSliceClick:c})=>{if(e.length===0)return null;let l=t.T(t.y.pieSegmentBorder,n),u=t.T(t.y.tooltipBackground,n),d=t.T(t.y.tooltipText,n),f=e.map((e,t)=>a(t,n,e.fillColor,r)),m=t.r({kind:`element`,skeleton:r,colorHostElement:n,onIndexClick:c});return{type:`pie`,data:{labels:e.map(e=>e.label),datasets:[{data:e.map(e=>e.value),backgroundColor:f,hoverBackgroundColor:f,borderColor:l,hoverBorderColor:l,borderWidth:4,hoverBorderWidth:4,hoverOffset:26,spacing:0,borderRadius:8}]},options:{responsive:!0,maintainAspectRatio:!0,cutout:`58%`,rotation:115,layout:{padding:26},onHover:m.onHover,onClick:m.onClick,interaction:t.s(r,{mode:`nearest`,intersect:!0}),plugins:{legend:{display:!1},tooltip:{enabled:t.c(r),backgroundColor:u,titleColor:d,bodyColor:d,displayColors:!1,callbacks:o(i)}}},plugins:t.l(r,[...s?[p(n,i)]:[],...m.plugins])}},h=[`Series 1`,`Series 2`,`Series 3`,`Series 4`,`Series 5`,`Series 6`,`Series 7`,`Series 8`],g=[4,1,1,1,1,1,1,1],_=h.map((e,t)=>({label:e,value:g[t]??1})),v={class:`s-ui-chart-pie__canvas-wrap`},y=(0,i.defineComponent)({__name:`SChartPie`,props:{slices:{default:()=>[]},loading:{type:Boolean,default:!1},showLegend:{type:Boolean,default:!0},formatValue:{type:Function},showBadges:{type:Boolean,default:!0}},emits:[`sliceClick`],setup(n,{expose:o,emit:s}){let c=s,l=t.D,u=(0,i.useTemplateRef)(`chartRootRef`),d=(0,i.useTemplateRef)(`chartCanvasRef`),f=(0,i.computed)(()=>n.loading?_:n.slices),p=e=>{let t=n.slices[e];t&&c(`sliceClick`,e,t)},h=r.t(`onSliceClick`),g=(0,i.computed)(()=>!n.loading&&n.slices.length===0?null:m({sliceList:f.value,colorHostElement:u.value,skeleton:n.loading,formatValue:n.formatValue,showBadges:n.showBadges,onSliceClick:h()?p:void 0})),y=(0,i.computed)(()=>f.value.map((e,t)=>({label:e.label,color:a(t,u.value,e.fillColor,n.loading)}))),{chartInstance:b}=t.n({canvasRef:d,config:g,enabled:(0,i.computed)(()=>n.loading||n.slices.length>0)}),{exportImage:x,handleLegendItemHover:S}=t.t({chartInstance:b,canvasRef:d,colorHostElement:u,legendDimKind:`element`});return o({exportImage:x}),(r,a)=>((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:u,class:(0,i.normalizeClass)([`s-ui-chart-pie`,{"s-ui-chart-pie--skeleton":n.loading}])},[(0,i.createElementVNode)(`div`,v,[(0,i.createVNode)((0,i.unref)(t.E),{loading:n.loading,type:(0,i.unref)(l).PIE},{default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:d,class:`s-ui-chart-pie__canvas`},null,512)]),_:1},8,[`loading`,`type`])]),n.showLegend&&y.value.length?((0,i.openBlock)(),(0,i.createBlock)((0,i.unref)(e.t),{key:0,items:y.value,disabled:n.loading,interactive:!n.loading,direction:`column`,onItemHover:(0,i.unref)(S)},null,8,[`items`,`disabled`,`interactive`,`onItemHover`])):(0,i.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return y}});
|