@shtabapp/ui-kit 1.69.1 → 1.70.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 +7 -0
- package/dist/SChartBar-CUAibXox.js +215 -0
- package/dist/SChartBar-xzw8oxXl.cjs +1 -0
- package/dist/{SChartBurnup-DyJHdRlf.js → SChartBurnup-C5Z7UDi-.js} +39 -40
- package/dist/SChartBurnup-CWSJUoA_.cjs +1 -0
- package/dist/{SChartHorizontalBar-Bv90SV6E.cjs → SChartHorizontalBar-0RpJa5EJ.cjs} +1 -1
- package/dist/{SChartHorizontalBar-DDo6TfE8.js → SChartHorizontalBar-B9SWFvdN.js} +14 -14
- package/dist/SChartLine-CTjiKi4H.js +165 -0
- package/dist/SChartLine-Cp1csHeY.cjs +1 -0
- package/dist/SChartMultiLine-Bt9Cf-L9.cjs +1 -0
- package/dist/SChartMultiLine-CbPSG0mN.js +244 -0
- package/dist/{SChartPie-Bt3o7LZI.js → SChartPie-0ugeo2fO.js} +72 -58
- package/dist/SChartPie-QpnxLQYv.cjs +1 -0
- package/dist/{SChartProgress-xxqrj03o.cjs → SChartProgress-9Zzy7E8K.cjs} +1 -1
- package/dist/{SChartProgress-uMg4DBpS.js → SChartProgress-DUgSOdv7.js} +15 -15
- package/dist/{SChartStackedArea-BQGnKp1i.js → SChartStackedArea-Blpqa23h.js} +40 -40
- package/dist/{SChartStackedArea-BNe6FAg8.cjs → SChartStackedArea-C3MezV9k.cjs} +1 -1
- package/dist/{SChartStackedBar-fiUU9lNp.js → SChartStackedBar-CCxEXw1H.js} +21 -21
- package/dist/{SChartStackedBar-D1G-VloG.cjs → SChartStackedBar-CJ-UdOfv.cjs} +1 -1
- package/dist/{buildWorkTimeLegendItems-ChGHTwbn.js → buildWorkTimeLegendItems-CifzZM9C.js} +126 -76
- package/dist/buildWorkTimeLegendItems-DPx5Yma0.cjs +1 -0
- package/dist/components/SCalendar/index.d.ts +2 -2
- package/dist/components/SCalendar/index.d.ts.map +1 -1
- package/dist/components/SCalendar/utils/demoCalendarMonthEvents.d.ts +6 -0
- package/dist/components/SCalendar/utils/demoCalendarMonthEvents.d.ts.map +1 -0
- package/dist/components/SCalendarMonth/SCalendarMonth.types.d.ts +36 -3
- package/dist/components/SCalendarMonth/SCalendarMonth.types.d.ts.map +1 -1
- package/dist/components/SCalendarMonth/SCalendarMonth.vue.d.ts +6 -1
- package/dist/components/SCalendarMonth/SCalendarMonth.vue.d.ts.map +1 -1
- package/dist/components/SCalendarMonth/index.d.ts +2 -1
- package/dist/components/SCalendarMonth/index.d.ts.map +1 -1
- package/dist/components/SChartBar/SChartBar.types.d.ts +2 -0
- 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/utils/buildBarChartConfig.d.ts +2 -1
- package/dist/components/SChartBar/utils/buildBarChartConfig.d.ts.map +1 -1
- package/dist/components/SChartBar/utils/demoBarSeries.d.ts +1 -0
- package/dist/components/SChartBar/utils/demoBarSeries.d.ts.map +1 -1
- package/dist/components/SChartLine/SChartLine.types.d.ts +14 -2
- package/dist/components/SChartLine/SChartLine.types.d.ts.map +1 -1
- package/dist/components/SChartLine/SChartLine.vue.d.ts.map +1 -1
- package/dist/components/SChartLine/index.d.ts +1 -1
- package/dist/components/SChartLine/index.d.ts.map +1 -1
- package/dist/components/SChartLine/utils/buildLineChartConfig.d.ts +6 -2
- package/dist/components/SChartLine/utils/buildLineChartConfig.d.ts.map +1 -1
- package/dist/components/SChartLine/utils/demoPoints.d.ts +3 -1
- package/dist/components/SChartLine/utils/demoPoints.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.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 +5 -1
- package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts.map +1 -1
- package/dist/components/SChartMultiLine/utils/demoMultiLineSeries.d.ts +1 -0
- package/dist/components/SChartMultiLine/utils/demoMultiLineSeries.d.ts.map +1 -1
- package/dist/components/SChartPie/SChartPie.types.d.ts +6 -0
- package/dist/components/SChartPie/SChartPie.types.d.ts.map +1 -1
- package/dist/components/SChartPie/SChartPie.vue.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/SChartSegmentedBar/SChartSegmentedBar.types.d.ts +2 -0
- package/dist/components/SChartSegmentedBar/SChartSegmentedBar.types.d.ts.map +1 -1
- package/dist/components/SChartSegmentedBar/SChartSegmentedBar.vue.d.ts.map +1 -1
- package/dist/components/SChartSegmentedBar/utils/buildSegmentedBarChartConfig.d.ts +2 -1
- package/dist/components/SChartSegmentedBar/utils/buildSegmentedBarChartConfig.d.ts.map +1 -1
- package/dist/components/SChartSegmentedBar/utils/createSegmentedBarBadgePlugin.d.ts +1 -1
- package/dist/components/SChartSegmentedBar/utils/createSegmentedBarBadgePlugin.d.ts.map +1 -1
- package/dist/components/SChartStackedArea/utils/demoStackedSeries.d.ts +4 -0
- package/dist/components/SChartStackedArea/utils/demoStackedSeries.d.ts.map +1 -1
- package/dist/components/SChartWidget/SChartWidget.types.d.ts +2 -0
- package/dist/components/SChartWidget/SChartWidget.types.d.ts.map +1 -1
- package/dist/components/SChartWidget/SChartWidget.vue.d.ts +7 -3
- package/dist/components/SChartWidget/SChartWidget.vue.d.ts.map +1 -1
- package/dist/{createChartCrosshairPlugin-DfYzBie2.cjs → createChartCrosshairPlugin-B4e8d8OF.cjs} +1 -1
- package/dist/{createChartCrosshairPlugin-DU5grSok.js → createChartCrosshairPlugin-C2NUAO5s.js} +1 -1
- package/dist/createChartMarkersPlugin-DSKGilFU.js +40 -0
- package/dist/createChartMarkersPlugin-S4oQKxO4.cjs +1 -0
- package/dist/entries/calendar.cjs +1 -1
- package/dist/entries/calendar.d.ts +2 -2
- package/dist/entries/calendar.d.ts.map +1 -1
- package/dist/entries/calendar.js +2 -2
- 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.d.ts +1 -1
- package/dist/entries/chart-line.d.ts.map +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.d.ts +1 -1
- package/dist/entries/chart-multi-line.d.ts.map +1 -1
- package/dist/entries/chart-multi-line.js +1 -1
- package/dist/entries/chart-pie.cjs +1 -1
- package/dist/entries/chart-pie.js +1 -1
- 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/separator.cjs +1 -0
- package/dist/entries/separator.js +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +162 -149
- package/dist/resolveBarStackedSeriesColor-DM7Ax0-s.js +11 -0
- package/dist/resolveBarStackedSeriesColor-z3NP5vAS.cjs +1 -0
- package/dist/resolveChartValueRange-DBCYLCXs.cjs +1 -0
- package/dist/resolveChartValueRange-DZybnmaX.js +10 -0
- package/dist/{resolveSeriesPaletteColor-DcLSyk-D.js → resolveSeriesPaletteColor-B7wHDj1L.js} +1 -1
- package/dist/resolveSeriesPaletteColor-D0XlU5vT.cjs +1 -0
- package/dist/{resolveStackedChartContext-CQbgdV55.cjs → resolveStackedChartContext-Br3N7ISo.cjs} +1 -1
- package/dist/{resolveStackedChartContext-CIKVXkDn.js → resolveStackedChartContext-DxJNWqwE.js} +1 -1
- package/dist/uikit-components.css +1 -1
- package/dist/{useChartInteractivity-BATdT86l.js → useChartInteractivity-Cl06JL4l.js} +121 -108
- package/dist/useChartInteractivity-LbJiqlvI.cjs +1 -0
- package/dist/utils/chart/chart.types.d.ts +14 -0
- package/dist/utils/chart/chart.types.d.ts.map +1 -1
- package/dist/utils/chart/core/chartInteractivity.d.ts.map +1 -1
- package/dist/utils/chart/core/createChartMarkersPlugin.d.ts +8 -0
- package/dist/utils/chart/core/createChartMarkersPlugin.d.ts.map +1 -0
- package/dist/utils/chart/core/createZeroLinePlugin.d.ts +3 -0
- package/dist/utils/chart/core/createZeroLinePlugin.d.ts.map +1 -0
- package/dist/utils/chart/core/resolveChartValueRange.d.ts +11 -0
- package/dist/utils/chart/core/resolveChartValueRange.d.ts.map +1 -0
- package/dist/utils/chart/index.d.ts +7 -2
- package/dist/utils/chart/index.d.ts.map +1 -1
- package/dist/utils/chart/line/createChartAreaFillGradient.d.ts +2 -0
- package/dist/utils/chart/line/createChartAreaFillGradient.d.ts.map +1 -1
- package/dist/utils/chart/pie/createPieSegmentBadgePlugin.d.ts +1 -1
- package/dist/utils/chart/pie/createPieSegmentBadgePlugin.d.ts.map +1 -1
- package/dist/utils/chart/pie/createPieTooltipCallbacks.d.ts +1 -1
- package/dist/utils/chart/pie/createPieTooltipCallbacks.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/SChartBar-BVgwPlYi.js +0 -215
- package/dist/SChartBar-CBU1uCuL.cjs +0 -1
- package/dist/SChartBurnup-Ch3UMa9w.cjs +0 -1
- package/dist/SChartLine-Cs1JzPEK.js +0 -129
- package/dist/SChartLine-nIGaef_o.cjs +0 -1
- package/dist/SChartMultiLine-BzoW4ETf.cjs +0 -1
- package/dist/SChartMultiLine-DqCQ7FCv.js +0 -204
- package/dist/SChartPie-Bv5Obcwb.cjs +0 -1
- package/dist/buildWorkTimeLegendItems-DjhLKbAP.cjs +0 -1
- package/dist/createChartAreaFillGradient-BDmME9Gy.js +0 -17
- package/dist/createChartAreaFillGradient-BwsojVzU.cjs +0 -1
- package/dist/resolveBarStackedSeriesColor-HDSkh6Mw.cjs +0 -1
- package/dist/resolveBarStackedSeriesColor-LpVh1SvQ.js +0 -11
- package/dist/resolveSeriesPaletteColor-B5qoBbXN.cjs +0 -1
- package/dist/useChartInteractivity-CXSdHPOw.cjs +0 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { E as e, T as t, c as n, l as r, n as i, o as a, s as o, t as s, y as c } from "./useChartInteractivity-Cl06JL4l.js";
|
|
2
|
+
import { t as l } from "./buildCartesianChartScales-EofFq3ry.js";
|
|
3
|
+
import { t as u } from "./resolveChartValueRange-DZybnmaX.js";
|
|
4
|
+
import { n as d, t as f } from "./createChartMarkersPlugin-DSKGilFU.js";
|
|
5
|
+
import { computed as p, createElementBlock as m, createElementVNode as h, createVNode as g, defineComponent as _, normalizeClass as v, normalizeStyle as y, openBlock as b, unref as x, useTemplateRef as S, withCtx as C } from "vue";
|
|
6
|
+
//#region src/utils/chart/css/readCssNumber.ts
|
|
7
|
+
var w = (e, t, n = 1) => {
|
|
8
|
+
if (typeof window > "u") return n;
|
|
9
|
+
let r = t ?? document.documentElement, i = getComputedStyle(r).getPropertyValue(e).trim(), a = Number.parseFloat(i);
|
|
10
|
+
return Number.isNaN(a) ? n : a;
|
|
11
|
+
}, T = 5, E = 5, D = 16, O = "--s-ui-chart-line-danger-fill", k = (e) => typeof e == "number" ? `${e}%` : e, A = (e, t, n, r, i) => {
|
|
12
|
+
let a = e.map((e) => e.value);
|
|
13
|
+
return i ? {
|
|
14
|
+
min: t ?? 0,
|
|
15
|
+
max: n ?? u(a, { yStep: r }).max
|
|
16
|
+
} : u(a, {
|
|
17
|
+
yMin: t,
|
|
18
|
+
yMax: n,
|
|
19
|
+
yStep: r
|
|
20
|
+
});
|
|
21
|
+
}, j = ({ points: e, seriesLabel: i, colorHostElement: s, yMax: u, yMin: p, yStep: m = E, area: h = !0, zeroLine: g = !1, dangerBelowZero: _ = !1, markers: v = [], skeleton: y = !1 }) => {
|
|
22
|
+
let b = t(c.axisLabel, s), x = t(c.grid, s), S = t(y ? c.skeletonSeries : c.seriesPrimary, s), C = t(y ? c.skeletonFillStart : c.seriesFillStart, s), j = t(y ? c.skeletonFillEnd : c.seriesFillEnd, s), M = t(O, s), N = t(c.tooltipBackground, s), P = t(c.tooltipText, s), F = w(y ? c.skeletonFillOpacity : c.seriesFillOpacity, s, .8), I = A(e, p, u, m, y), L = h || y, R = _ && !y, z = (e) => a(e, C, j, F), B = R ? {
|
|
23
|
+
target: { value: 0 },
|
|
24
|
+
below: M
|
|
25
|
+
} : L ? "origin" : !1;
|
|
26
|
+
return {
|
|
27
|
+
type: "line",
|
|
28
|
+
data: {
|
|
29
|
+
labels: e.map((e) => e.label),
|
|
30
|
+
datasets: [{
|
|
31
|
+
label: i,
|
|
32
|
+
data: e.map((e) => e.value),
|
|
33
|
+
borderColor: S,
|
|
34
|
+
backgroundColor: L ? z : "transparent",
|
|
35
|
+
pointBackgroundColor: S,
|
|
36
|
+
pointHoverBackgroundColor: S,
|
|
37
|
+
borderWidth: T,
|
|
38
|
+
fill: B,
|
|
39
|
+
pointRadius: 0,
|
|
40
|
+
pointHoverRadius: 4,
|
|
41
|
+
tension: .4
|
|
42
|
+
}]
|
|
43
|
+
},
|
|
44
|
+
options: {
|
|
45
|
+
responsive: !0,
|
|
46
|
+
maintainAspectRatio: !1,
|
|
47
|
+
layout: { padding: { top: v.length > 0 ? D : 0 } },
|
|
48
|
+
interaction: o(y, {
|
|
49
|
+
mode: "index",
|
|
50
|
+
intersect: !1
|
|
51
|
+
}),
|
|
52
|
+
plugins: {
|
|
53
|
+
legend: { display: !1 },
|
|
54
|
+
tooltip: {
|
|
55
|
+
enabled: n(y),
|
|
56
|
+
backgroundColor: N,
|
|
57
|
+
titleColor: P,
|
|
58
|
+
bodyColor: P,
|
|
59
|
+
displayColors: !1
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
scales: l({
|
|
63
|
+
axisLabelColor: b,
|
|
64
|
+
gridColor: x,
|
|
65
|
+
yMin: I.min,
|
|
66
|
+
yMax: I.max,
|
|
67
|
+
yStep: m,
|
|
68
|
+
...y ? { formatYAxisTick: k } : {}
|
|
69
|
+
})
|
|
70
|
+
},
|
|
71
|
+
plugins: r(y, [...g ? [d(s)] : [], ...v.length > 0 ? [f({ markers: v }, s)] : []])
|
|
72
|
+
};
|
|
73
|
+
}, M = [
|
|
74
|
+
{
|
|
75
|
+
label: "ноябрь 2025",
|
|
76
|
+
value: 63
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
label: "декабрь 2025",
|
|
80
|
+
value: 77
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: "январь 2026",
|
|
84
|
+
value: 75
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
label: "февраль 2026",
|
|
88
|
+
value: 81
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: "март 2026",
|
|
92
|
+
value: 91
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
label: "апрель 2026",
|
|
96
|
+
value: 87
|
|
97
|
+
}
|
|
98
|
+
], N = { class: "s-ui-chart-line__canvas-wrap" }, P = /* @__PURE__ */ _({
|
|
99
|
+
__name: "SChartLine",
|
|
100
|
+
props: {
|
|
101
|
+
points: { default: () => [] },
|
|
102
|
+
seriesLabel: { default: "Series" },
|
|
103
|
+
loading: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: !1
|
|
106
|
+
},
|
|
107
|
+
yMax: {},
|
|
108
|
+
yMin: {},
|
|
109
|
+
yStep: {},
|
|
110
|
+
height: {},
|
|
111
|
+
area: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: !0
|
|
114
|
+
},
|
|
115
|
+
zeroLine: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
default: !1
|
|
118
|
+
},
|
|
119
|
+
dangerBelowZero: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: !1
|
|
122
|
+
},
|
|
123
|
+
markers: { default: () => [] }
|
|
124
|
+
},
|
|
125
|
+
setup(t, { expose: n }) {
|
|
126
|
+
let r = S("chartRootRef"), a = S("chartCanvasRef"), o = p(() => t.loading ? M : t.points), c = p(() => {
|
|
127
|
+
if (t.height !== void 0) return { "--s-ui-chart-line-viewport-height": typeof t.height == "number" ? `${t.height}px` : t.height };
|
|
128
|
+
}), { chartInstance: l } = i({
|
|
129
|
+
canvasRef: a,
|
|
130
|
+
config: p(() => !t.loading && t.points.length === 0 ? null : j({
|
|
131
|
+
points: o.value,
|
|
132
|
+
seriesLabel: t.seriesLabel,
|
|
133
|
+
colorHostElement: r.value,
|
|
134
|
+
yMax: t.loading ? 100 : t.yMax,
|
|
135
|
+
yMin: t.loading ? 50 : t.yMin,
|
|
136
|
+
yStep: t.loading ? 10 : t.yStep,
|
|
137
|
+
area: t.area,
|
|
138
|
+
zeroLine: t.zeroLine,
|
|
139
|
+
dangerBelowZero: t.dangerBelowZero,
|
|
140
|
+
markers: t.markers,
|
|
141
|
+
skeleton: t.loading
|
|
142
|
+
})),
|
|
143
|
+
enabled: p(() => t.loading || t.points.length > 0)
|
|
144
|
+
}), { exportImage: u } = s({
|
|
145
|
+
chartInstance: l,
|
|
146
|
+
canvasRef: a,
|
|
147
|
+
colorHostElement: r
|
|
148
|
+
});
|
|
149
|
+
return n({ exportImage: u }), (n, i) => (b(), m("div", {
|
|
150
|
+
ref_key: "chartRootRef",
|
|
151
|
+
ref: r,
|
|
152
|
+
class: v(["s-ui-chart-line", { "s-ui-chart-line--skeleton": t.loading }]),
|
|
153
|
+
style: y(c.value)
|
|
154
|
+
}, [h("div", N, [g(x(e), { loading: t.loading }, {
|
|
155
|
+
default: C(() => [h("canvas", {
|
|
156
|
+
ref_key: "chartCanvasRef",
|
|
157
|
+
ref: a,
|
|
158
|
+
class: "s-ui-chart-line__canvas"
|
|
159
|
+
}, null, 512)]),
|
|
160
|
+
_: 1
|
|
161
|
+
}, 8, ["loading"])])], 6));
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
//#endregion
|
|
165
|
+
export { P as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./useChartInteractivity-LbJiqlvI.cjs"),t=require("./buildCartesianChartScales-Dck5yBMo.cjs"),n=require("./resolveChartValueRange-DBCYLCXs.cjs"),r=require("./createChartMarkersPlugin-S4oQKxO4.cjs");let i=require("vue");var a=(e,t,n=1)=>{if(typeof window>`u`)return n;let r=t??document.documentElement,i=getComputedStyle(r).getPropertyValue(e).trim(),a=Number.parseFloat(i);return Number.isNaN(a)?n:a},o=5,s=5,c=16,l=`--s-ui-chart-line-danger-fill`,u=e=>typeof e==`number`?`${e}%`:e,d=(e,t,r,i,a)=>{let o=e.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})},f=({points:n,seriesLabel:i,colorHostElement:f,yMax:p,yMin:m,yStep:h=s,area:g=!0,zeroLine:_=!1,dangerBelowZero:v=!1,markers:y=[],skeleton:b=!1})=>{let x=e.T(e.y.axisLabel,f),S=e.T(e.y.grid,f),C=e.T(b?e.y.skeletonSeries:e.y.seriesPrimary,f),w=e.T(b?e.y.skeletonFillStart:e.y.seriesFillStart,f),T=e.T(b?e.y.skeletonFillEnd:e.y.seriesFillEnd,f),E=e.T(l,f),D=e.T(e.y.tooltipBackground,f),O=e.T(e.y.tooltipText,f),k=a(b?e.y.skeletonFillOpacity:e.y.seriesFillOpacity,f,.8),A=d(n,m,p,h,b),j=g||b,M=v&&!b,N=t=>e.o(t,w,T,k),P=M?{target:{value:0},below:E}:j?`origin`:!1;return{type:`line`,data:{labels:n.map(e=>e.label),datasets:[{label:i,data:n.map(e=>e.value),borderColor:C,backgroundColor:j?N:`transparent`,pointBackgroundColor:C,pointHoverBackgroundColor:C,borderWidth:o,fill:P,pointRadius:0,pointHoverRadius:4,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,layout:{padding:{top:y.length>0?c:0}},interaction:e.s(b,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:e.c(b),backgroundColor:D,titleColor:O,bodyColor:O,displayColors:!1}},scales:t.t({axisLabelColor:x,gridColor:S,yMin:A.min,yMax:A.max,yStep:h,...b?{formatYAxisTick:u}:{}})},plugins:e.l(b,[..._?[r.n(f)]:[],...y.length>0?[r.t({markers:y},f)]:[]])}},p=[{label:`ноябрь 2025`,value:63},{label:`декабрь 2025`,value:77},{label:`январь 2026`,value:75},{label:`февраль 2026`,value:81},{label:`март 2026`,value:91},{label:`апрель 2026`,value:87}],m={class:`s-ui-chart-line__canvas-wrap`},h=(0,i.defineComponent)({__name:`SChartLine`,props:{points:{default:()=>[]},seriesLabel:{default:`Series`},loading:{type:Boolean,default:!1},yMax:{},yMin:{},yStep:{},height:{},area:{type:Boolean,default:!0},zeroLine:{type:Boolean,default:!1},dangerBelowZero:{type:Boolean,default:!1},markers:{default:()=>[]}},setup(t,{expose:n}){let r=(0,i.useTemplateRef)(`chartRootRef`),a=(0,i.useTemplateRef)(`chartCanvasRef`),o=(0,i.computed)(()=>t.loading?p:t.points),s=(0,i.computed)(()=>{if(t.height!==void 0)return{"--s-ui-chart-line-viewport-height":typeof t.height==`number`?`${t.height}px`:t.height}}),{chartInstance:c}=e.n({canvasRef:a,config:(0,i.computed)(()=>!t.loading&&t.points.length===0?null:f({points:o.value,seriesLabel:t.seriesLabel,colorHostElement:r.value,yMax:t.loading?100:t.yMax,yMin:t.loading?50:t.yMin,yStep:t.loading?10:t.yStep,area:t.area,zeroLine:t.zeroLine,dangerBelowZero:t.dangerBelowZero,markers:t.markers,skeleton:t.loading})),enabled:(0,i.computed)(()=>t.loading||t.points.length>0)}),{exportImage:l}=e.t({chartInstance:c,canvasRef:a,colorHostElement:r});return n({exportImage:l}),(n,o)=>((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:r,class:(0,i.normalizeClass)([`s-ui-chart-line`,{"s-ui-chart-line--skeleton":t.loading}]),style:(0,i.normalizeStyle)(s.value)},[(0,i.createElementVNode)(`div`,m,[(0,i.createVNode)((0,i.unref)(e.E),{loading:t.loading},{default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:a,class:`s-ui-chart-line__canvas`},null,512)]),_:1},8,[`loading`])])],6))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./SChartLegend-DGtjd6zV.cjs"),t=require("./useChartInteractivity-LbJiqlvI.cjs"),n=require("./resolveChartValueRange-DBCYLCXs.cjs"),r=require("./createChartMarkersPlugin-S4oQKxO4.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}});
|
|
@@ -0,0 +1,244 @@
|
|
|
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-DSKGilFU.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,43 +1,46 @@
|
|
|
1
1
|
import { t as e } from "./SChartLegend-oZoF8XK7.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as p } from "./resolveSeriesPaletteColor-
|
|
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
4
|
import { t as m } from "./useHasListener-RSjlUyqH.js";
|
|
5
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
6
|
//#region src/utils/chart/pie/resolvePieSliceColor.ts
|
|
7
|
-
var D = (e, t, n,
|
|
8
|
-
palette:
|
|
9
|
-
paletteFallback:
|
|
10
|
-
skeletonPalette:
|
|
11
|
-
skeletonFallback:
|
|
12
|
-
}), O = () => ({
|
|
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
13
|
title: () => "",
|
|
14
|
-
label: (
|
|
14
|
+
label: (t) => {
|
|
15
|
+
let n = t.label ?? "", r = t.parsed ?? 0;
|
|
16
|
+
return `${n} – ${e ? e(r) : `${r}`}`;
|
|
17
|
+
}
|
|
15
18
|
}), k = 4, A = 4, j = 1, M = "400 12px var(--s-ui-font-family-label)", N = (e, t, n, r, i, a) => {
|
|
16
19
|
let o = Math.min(a, r / 2, i / 2);
|
|
17
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();
|
|
18
|
-
}, P = (e) => !("getCenterPoint" in e) || typeof e.getCenterPoint != "function" ? null : e.getCenterPoint(!1), F = (e) => ({
|
|
21
|
+
}, P = (e) => !("getCenterPoint" in e) || typeof e.getCenterPoint != "function" ? null : e.getCenterPoint(!1), F = (e, t) => ({
|
|
19
22
|
id: "pieSegmentBadge",
|
|
20
|
-
afterDatasetsDraw(
|
|
21
|
-
let r =
|
|
23
|
+
afterDatasetsDraw(n) {
|
|
24
|
+
let r = n.getDatasetMeta(0);
|
|
22
25
|
if (!r) return;
|
|
23
|
-
let a =
|
|
26
|
+
let a = i(f.pieBadgeBackground, e), o = i(f.pieBadgeBorder, e), s = i(f.pieBadgeText, e), { ctx: c } = n;
|
|
24
27
|
c.save(), c.font = M, c.textAlign = "center", c.textBaseline = "middle";
|
|
25
28
|
for (let e = 0; e < r.data.length; e += 1) {
|
|
26
|
-
let
|
|
27
|
-
if (
|
|
28
|
-
let e = `${
|
|
29
|
-
N(c,
|
|
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);
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
c.restore();
|
|
33
36
|
}
|
|
34
|
-
}), I = ({ sliceList: e, colorHostElement: t, skeleton:
|
|
37
|
+
}), I = ({ sliceList: e, colorHostElement: t, skeleton: n = !1, formatValue: r, showBadges: s = !0, onSliceClick: u }) => {
|
|
35
38
|
if (e.length === 0) return null;
|
|
36
|
-
let
|
|
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({
|
|
37
40
|
kind: "element",
|
|
38
|
-
skeleton:
|
|
41
|
+
skeleton: n,
|
|
39
42
|
colorHostElement: t,
|
|
40
|
-
onIndexClick:
|
|
43
|
+
onIndexClick: u
|
|
41
44
|
});
|
|
42
45
|
return {
|
|
43
46
|
type: "pie",
|
|
@@ -45,10 +48,10 @@ var D = (e, t, n, r = !1) => p(e, t, n, r, {
|
|
|
45
48
|
labels: e.map((e) => e.label),
|
|
46
49
|
datasets: [{
|
|
47
50
|
data: e.map((e) => e.value),
|
|
48
|
-
backgroundColor:
|
|
49
|
-
hoverBackgroundColor:
|
|
50
|
-
borderColor:
|
|
51
|
-
hoverBorderColor:
|
|
51
|
+
backgroundColor: h,
|
|
52
|
+
hoverBackgroundColor: h,
|
|
53
|
+
borderColor: d,
|
|
54
|
+
hoverBorderColor: d,
|
|
52
55
|
borderWidth: 4,
|
|
53
56
|
hoverBorderWidth: 4,
|
|
54
57
|
hoverOffset: 26,
|
|
@@ -62,25 +65,25 @@ var D = (e, t, n, r = !1) => p(e, t, n, r, {
|
|
|
62
65
|
cutout: "58%",
|
|
63
66
|
rotation: 115,
|
|
64
67
|
layout: { padding: 26 },
|
|
65
|
-
onHover:
|
|
66
|
-
onClick:
|
|
67
|
-
interaction:
|
|
68
|
+
onHover: g.onHover,
|
|
69
|
+
onClick: g.onClick,
|
|
70
|
+
interaction: l(n, {
|
|
68
71
|
mode: "nearest",
|
|
69
72
|
intersect: !0
|
|
70
73
|
}),
|
|
71
74
|
plugins: {
|
|
72
75
|
legend: { display: !1 },
|
|
73
76
|
tooltip: {
|
|
74
|
-
enabled:
|
|
75
|
-
backgroundColor:
|
|
76
|
-
titleColor:
|
|
77
|
-
bodyColor:
|
|
77
|
+
enabled: a(n),
|
|
78
|
+
backgroundColor: p,
|
|
79
|
+
titleColor: m,
|
|
80
|
+
bodyColor: m,
|
|
78
81
|
displayColors: !1,
|
|
79
|
-
callbacks: O()
|
|
82
|
+
callbacks: O(r)
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
85
|
},
|
|
83
|
-
plugins:
|
|
86
|
+
plugins: o(n, [...s ? [F(t, r)] : [], ...g.plugins])
|
|
84
87
|
};
|
|
85
88
|
}, L = [
|
|
86
89
|
"Series 1",
|
|
@@ -110,50 +113,61 @@ var D = (e, t, n, r = !1) => p(e, t, n, r, {
|
|
|
110
113
|
loading: {
|
|
111
114
|
type: Boolean,
|
|
112
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
|
|
113
125
|
}
|
|
114
126
|
},
|
|
115
127
|
emits: ["sliceClick"],
|
|
116
|
-
setup(
|
|
117
|
-
let
|
|
118
|
-
let t =
|
|
119
|
-
t &&
|
|
120
|
-
}, x = m("onSliceClick"), O = h(() => !
|
|
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({
|
|
121
133
|
sliceList: f.value,
|
|
122
|
-
colorHostElement:
|
|
123
|
-
skeleton:
|
|
134
|
+
colorHostElement: l.value,
|
|
135
|
+
skeleton: r.loading,
|
|
136
|
+
formatValue: r.formatValue,
|
|
137
|
+
showBadges: r.showBadges,
|
|
124
138
|
onSliceClick: x() ? p : void 0
|
|
125
139
|
})), k = h(() => f.value.map((e, t) => ({
|
|
126
140
|
label: e.label,
|
|
127
|
-
color: D(t,
|
|
128
|
-
}))), { chartInstance: A } =
|
|
129
|
-
canvasRef:
|
|
141
|
+
color: D(t, l.value, e.fillColor, r.loading)
|
|
142
|
+
}))), { chartInstance: A } = s({
|
|
143
|
+
canvasRef: d,
|
|
130
144
|
config: O,
|
|
131
|
-
enabled: h(() =>
|
|
132
|
-
}), { exportImage: j, handleLegendItemHover: M } =
|
|
145
|
+
enabled: h(() => r.loading || r.slices.length > 0)
|
|
146
|
+
}), { exportImage: j, handleLegendItemHover: M } = u({
|
|
133
147
|
chartInstance: A,
|
|
134
|
-
canvasRef:
|
|
135
|
-
colorHostElement:
|
|
148
|
+
canvasRef: d,
|
|
149
|
+
colorHostElement: l,
|
|
136
150
|
legendDimKind: "element"
|
|
137
151
|
});
|
|
138
|
-
return
|
|
152
|
+
return i({ exportImage: j }), (t, i) => (C(), v("div", {
|
|
139
153
|
ref_key: "chartRootRef",
|
|
140
|
-
ref:
|
|
141
|
-
class: S(["s-ui-chart-pie", { "s-ui-chart-pie--skeleton":
|
|
142
|
-
}, [y("div", B, [b(w(
|
|
143
|
-
loading:
|
|
144
|
-
type: w(
|
|
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
|
|
145
159
|
}, {
|
|
146
160
|
default: E(() => [y("canvas", {
|
|
147
161
|
ref_key: "chartCanvasRef",
|
|
148
|
-
ref:
|
|
162
|
+
ref: d,
|
|
149
163
|
class: "s-ui-chart-pie__canvas"
|
|
150
164
|
}, null, 512)]),
|
|
151
165
|
_: 1
|
|
152
|
-
}, 8, ["loading", "type"])]), k.value.length ? (C(), g(w(e), {
|
|
166
|
+
}, 8, ["loading", "type"])]), r.showLegend && k.value.length ? (C(), g(w(e), {
|
|
153
167
|
key: 0,
|
|
154
168
|
items: k.value,
|
|
155
|
-
disabled:
|
|
156
|
-
interactive: !
|
|
169
|
+
disabled: r.loading,
|
|
170
|
+
interactive: !r.loading,
|
|
157
171
|
direction: "column",
|
|
158
172
|
onItemHover: w(M)
|
|
159
173
|
}, null, 8, [
|
|
@@ -0,0 +1 @@
|
|
|
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}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./useChartInteractivity-
|
|
1
|
+
const e=require("./useChartInteractivity-LbJiqlvI.cjs");let t=require("vue");var n=4,r=12,i=24,a=e=>{let t=e<=15;return{pointRadius:t?n:0,pointHoverRadius:n,pointHitRadius:t?r:i}},o=e=>e<=15?{mode:`nearest`,intersect:!0}:{mode:`nearest`,axis:`x`,intersect:!1},s=.3,c=1,l=({labels:t,progressValues:n,referenceValues:r,seriesLabel:i,valuePrefix:l,minValue:u,maxValue:d,stepSize:f,progressSnapshotCount:p,colorHostElement:m,skeleton:h=!1})=>{let g=e.T(e.y.axisLabel,m),_=e.T(e.y.grid,m),v=e.T(h?e.y.skeletonSeries:e.y.progressLine,m),y=e.T(h?e.y.skeletonFillStart:e.y.referenceFill,m),b=e.T(e.y.tooltipBackground,m),x=e.T(e.y.tooltipText,m),S=s,C=a(p),w=o(p);return{type:`line`,data:{labels:t,datasets:[{data:r,borderColor:`transparent`,backgroundColor:y,pointRadius:0,pointHoverRadius:0,pointHitRadius:0,fill:`start`,order:0},{label:i,data:n,borderColor:v,backgroundColor:v,tension:S,pointRadius:C.pointRadius,pointHoverRadius:C.pointHoverRadius,pointHitRadius:C.pointHitRadius,pointBackgroundColor:v,pointBorderColor:v,fill:!1,order:1}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:e.s(h,w),plugins:{legend:{display:!1},tooltip:{enabled:e.c(h),backgroundColor:b,titleColor:x,bodyColor:x,position:e.f,filter:e=>e.datasetIndex===c,callbacks:{label:e=>{let t=e.parsed.y;return t===null?``:`${t}${l}`}}}},scales:{x:{type:`category`,border:{display:!1},grid:{color:_,drawTicks:!0},ticks:{color:g,font:{family:`var(--s-ui-font-family-label)`,size:10,weight:500},padding:8}},y:{type:`linear`,min:u,max:d,border:{display:!1},grid:{color:_,drawTicks:!0},ticks:{color:g,stepSize:f,callback:e=>`${e}${l}`,font:{family:`var(--s-ui-font-family-label)`,size:10,weight:500},padding:8}}}}}},u=e=>{let t=e.match(/^(\d{4})-(\d{2})-(\d{2})/);return t?`${t[3]}.${t[2]}.${t[1]}`:e},d=e=>Math.round(e*10)/10,f=({progressSnapshots:e,deadline:t=null,minValue:n=0,maxValue:r=100})=>{let i=e.map(e=>u(e.date)),a=e.map(e=>e.progress),o=t?u(t):null,s=a.length===1?[``,i[0]??``,``]:o?[...i,o]:i,c=a.length===1?[null,a[0]??null,null]:o?[...a,null]:a,l=s.length;return{labels:s,progressValues:c,referenceValues:l===0?[]:l===1?[n]:Array.from({length:l},(e,t)=>d(n+t*((r-n)/(l-1)))),minValue:n,maxValue:r,stepSize:d((r-n)/4),progressSnapshotCount:e.length}},p=[{date:`2025-11-01`,progress:20},{date:`2025-12-01`,progress:35},{date:`2026-01-01`,progress:42},{date:`2026-02-01`,progress:58},{date:`2026-03-01`,progress:71},{date:`2026-04-01`,progress:84}],m={class:`s-ui-chart-progress__canvas-wrap`},h=(0,t.defineComponent)({__name:`SChartProgress`,props:{progressSnapshots:{default:()=>[]},deadline:{default:null},minValue:{},maxValue:{},prefix:{},seriesLabel:{default:`Progress`},loading:{type:Boolean,default:!1}},setup(n,{expose:r}){let i=(0,t.useTemplateRef)(`chartRootRef`),a=(0,t.useTemplateRef)(`chartCanvasRef`),o=(0,t.computed)(()=>n.minValue??0),s=(0,t.computed)(()=>n.maxValue??100),c=(0,t.computed)(()=>n.prefix??`%`),u=(0,t.computed)(()=>n.loading?p:n.progressSnapshots),d=(0,t.computed)(()=>f({progressSnapshots:u.value,deadline:n.loading?`2026-06-28`:n.deadline,minValue:n.loading?0:o.value,maxValue:n.loading?100:s.value})),{chartInstance:h}=e.n({canvasRef:a,config:(0,t.computed)(()=>!n.loading&&n.progressSnapshots.length===0?null:l({labels:d.value.labels,progressValues:d.value.progressValues,referenceValues:d.value.referenceValues,seriesLabel:n.seriesLabel,valuePrefix:c.value,minValue:d.value.minValue,maxValue:d.value.maxValue,stepSize:n.loading?25:d.value.stepSize,progressSnapshotCount:d.value.progressSnapshotCount,colorHostElement:i.value,skeleton:n.loading})),enabled:(0,t.computed)(()=>n.loading||n.progressSnapshots.length>0)}),{exportImage:g}=e.t({chartInstance:h,canvasRef:a,colorHostElement:i});return r({exportImage:g}),(r,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:i,class:(0,t.normalizeClass)([`s-ui-chart-progress`,{"s-ui-chart-progress--skeleton":n.loading}])},[(0,t.createElementVNode)(`div`,m,[(0,t.createVNode)((0,t.unref)(e.E),{loading:n.loading},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:a,class:`s-ui-chart-progress__canvas`},null,512)]),_:1},8,[`loading`])])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|